code_text
stringlengths 604
999k
| repo_name
stringlengths 4
100
| file_path
stringlengths 4
873
| language
stringclasses 23
values | license
stringclasses 15
values | size
int32 1.02k
999k
|
---|---|---|---|---|---|
/*
YUI 3.16.0 (build 76f0e08)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('dataschema-text', function (Y, NAME) {
/**
* Provides a DataSchema implementation which can be used to work with
* delimited text data.
*
* @module dataschema
* @submodule dataschema-text
*/
/**
Provides a DataSchema implementation which can be used to work with
delimited text data.
See the `apply` method for usage.
@class DataSchema.Text
@extends DataSchema.Base
@static
**/
var Lang = Y.Lang,
isString = Lang.isString,
isUndef = Lang.isUndefined,
SchemaText = {
////////////////////////////////////////////////////////////////////////
//
// DataSchema.Text static methods
//
////////////////////////////////////////////////////////////////////////
/**
Applies a schema to a string of delimited data, returning a normalized
object with results in the `results` property. The `meta` property of
the response object is present for consistency, but is assigned an
empty object. If the input data is absent or not a string, an `error`
property will be added.
Use _schema.resultDelimiter_ and _schema.fieldDelimiter_ to instruct
`apply` how to split up the string into an array of data arrays for
processing.
Use _schema.resultFields_ to specify the keys in the generated result
objects in `response.results`. The key:value pairs will be assigned
in the order of the _schema.resultFields_ array, assuming the values
in the data records are defined in the same order.
_schema.resultFields_ field identifiers are objects with the following
properties:
* `key` : <strong>(required)</strong> The property name you want
the data value assigned to in the result object (String)
* `parser`: A function or the name of a function on `Y.Parsers` used
to convert the input value into a normalized type. Parser
functions are passed the value as input and are expected to
return a value.
If no value parsing is needed, you can use just the desired property
name string as the field identifier instead of an object (see example
below).
@example
// Process simple csv
var schema = {
resultDelimiter: "\n",
fieldDelimiter: ",",
resultFields: [ 'fruit', 'color' ]
},
data = "Banana,yellow\nOrange,orange\nEggplant,purple";
var response = Y.DataSchema.Text.apply(schema, data);
// response.results[0] is { fruit: "Banana", color: "yellow" }
// Use parsers
schema.resultFields = [
{
key: 'fruit',
parser: function (val) { return val.toUpperCase(); }
},
'color' // mix and match objects and strings
];
response = Y.DataSchema.Text.apply(schema, data);
// response.results[0] is { fruit: "BANANA", color: "yellow" }
@method apply
@param {Object} schema Schema to apply. Supported configuration
properties are:
@param {String} schema.resultDelimiter Character or character
sequence that marks the end of one record and the start of
another.
@param {String} [schema.fieldDelimiter] Character or character
sequence that marks the end of a field and the start of
another within the same record.
@param {Array} [schema.resultFields] Field identifiers to
assign values in the response records. See above for details.
@param {String} data Text data.
@return {Object} An Object with properties `results` and `meta`
@static
**/
apply: function(schema, data) {
var data_in = data,
data_out = { results: [], meta: {} };
if (isString(data) && schema && isString(schema.resultDelimiter)) {
// Parse results data
data_out = SchemaText._parseResults.call(this, schema, data_in, data_out);
} else {
Y.log("Text data could not be schema-parsed: " + Y.dump(data) + " " + Y.dump(data), "error", "dataschema-text");
data_out.error = new Error("Text schema parse failure");
}
return data_out;
},
/**
* Schema-parsed list of results from full data
*
* @method _parseResults
* @param schema {Array} Schema to parse against.
* @param text_in {String} Text to parse.
* @param data_out {Object} In-progress parsed data to update.
* @return {Object} Parsed data object.
* @static
* @protected
*/
_parseResults: function(schema, text_in, data_out) {
var resultDelim = schema.resultDelimiter,
fieldDelim = isString(schema.fieldDelimiter) &&
schema.fieldDelimiter,
fields = schema.resultFields || [],
results = [],
parse = Y.DataSchema.Base.parse,
results_in, fields_in, result, item,
field, key, value, i, j;
// Delete final delimiter at end of string if there
if (text_in.slice(-resultDelim.length) === resultDelim) {
text_in = text_in.slice(0, -resultDelim.length);
}
// Split into results
results_in = text_in.split(schema.resultDelimiter);
if (fieldDelim) {
for (i = results_in.length - 1; i >= 0; --i) {
result = {};
item = results_in[i];
fields_in = item.split(schema.fieldDelimiter);
for (j = fields.length - 1; j >= 0; --j) {
field = fields[j];
key = (!isUndef(field.key)) ? field.key : field;
// FIXME: unless the key is an array index, this test
// for fields_in[key] is useless.
value = (!isUndef(fields_in[key])) ?
fields_in[key] :
fields_in[j];
result[key] = parse.call(this, value, field);
}
results[i] = result;
}
} else {
results = results_in;
}
data_out.results = results;
return data_out;
}
};
Y.DataSchema.Text = Y.mix(SchemaText, Y.DataSchema.Base);
}, '3.16.0', {"requires": ["dataschema-base"]});
|
gauravarora/cdnjs
|
ajax/libs/yui/3.16.0/dataschema-text/dataschema-text-debug.js
|
JavaScript
|
mit
| 6,954 |
/*
YUI 3.16.0 (build 76f0e08)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("history-hash-ie",function(e,t){if(e.UA.ie&&!e.HistoryBase.nativeHashChange){var n=e.Do,r=YUI.namespace("Env.HistoryHash"),i=e.HistoryHash,s=r._iframe,o=e.config.win;i.getIframeHash=function(){if(!s||!s.contentWindow)return"";var e=i.hashPrefix,t=s.contentWindow.location.hash.substr(1);return e&&t.indexOf(e)===0?t.replace(e,""):t},i._updateIframe=function(e,t){var n=s&&s.contentWindow&&s.contentWindow.document,r=n&&n.location;if(!n||!r)return;t?r.replace(e.charAt(0)==="#"?e:"#"+e):(n.open().close(),r.hash=e)},n.before(i._updateIframe,i,"replaceHash",i,!0),s||e.on("domready",function(){var t=i.getHash();s=r._iframe=e.Node.getDOMNode(e.Node.create('<iframe src="javascript:0" style="display:none" height="0" width="0" tabindex="-1" title="empty"/>')),e.config.doc.documentElement.appendChild(s),i._updateIframe(t||"#"),e.on("hashchange",function(e){t=e.newHash,i.getIframeHash()!==t&&i._updateIframe(t)},o),e.later(50,null,function(){var e=i.getIframeHash();e!==t&&i.setHash(e)},null,!0)})}},"3.16.0",{requires:["history-hash","node-base"]});
|
Rich-Harris/cdnjs
|
ajax/libs/yui/3.16.0/history-hash-ie/history-hash-ie-min.js
|
JavaScript
|
mit
| 1,202 |
/*
YUI 3.16.0 (build 76f0e08)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("graphics-vml",function(e,t){function E(){}var n="vml",r="shape",i=/[a-z][^a-z]*/ig,s=/[\-]?[0-9]*[0-9|\.][0-9]*/g,o=e.Lang,u=o.isNumber,a=o.isArray,f=e.DOM,l=e.Selector,c=e.config.doc,h=e.AttributeLite,p,d,v,m,g,y,b,w=e.ClassNameManager.getClassName;E.prototype={_pathSymbolToMethod:{M:"moveTo",m:"relativeMoveTo",L:"lineTo",l:"relativeLineTo",C:"curveTo",c:"relativeCurveTo",Q:"quadraticCurveTo",q:"relativeQuadraticCurveTo",z:"closePath",Z:"closePath"},_coordSpaceMultiplier:100,_round:function(e){return Math.round(e*this._coordSpaceMultiplier)},_addToPath:function(e){this._path=this._path||"",this._movePath&&(this._path+=this._movePath,this._movePath=null),this._path+=e},_currentX:0,_currentY:0,curveTo:function(){return this._curveTo.apply(this,[e.Array(arguments),!1]),this},relativeCurveTo:function(){return this._curveTo.apply(this,[e.Array(arguments),!0]),this},_curveTo:function(e,t){var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y=t?" v ":" c ",b=t?parseFloat(this._currentX):0,w=t?parseFloat(this._currentY):0;m=e.length-5,g=y;for(v=0;v<m;v+=6)o=parseFloat(e[v]),u=parseFloat(e[v+1]),a=parseFloat(e[v+2]),f=parseFloat(e[v+3]),i=parseFloat(e[v+4]),s=parseFloat(e[v+5]),v>0&&(g+=", "),g=g+this._round(o)+", "+this._round(u)+", "+this._round(a)+", "+this._round(f)+", "+this._round(i)+", "+this._round(s),o+=b,u+=w,a+=b,f+=w,i+=b,s+=w,c=Math.max(i,Math.max(o,a)),p=Math.max(s,Math.max(u,f)),h=Math.min(i,Math.min(o,a)),d=Math.min(s,Math.min(u,f)),n=Math.abs(c-h),r=Math.abs(p-d),l=[[this._currentX,this._currentY],[o,u],[a,f],[i,s]],this._setCurveBoundingBox(l,n,r),this._currentX=i,this._currentY=s;this._addToPath(g)},quadraticCurveTo:function(){return this._quadraticCurveTo.apply(this,[e.Array(arguments),!1]),this},relativeQuadraticCurveTo:function(){return this._quadraticCurveTo.apply(this,[e.Array(arguments),!0]),this},_quadraticCurveTo:function(e,t){var n,r,i,s,o,u,a,f,l=this._currentX,c=this._currentY,h,p=e.length-3,d=[],v=t?parseFloat(this._currentX):0,m=t?parseFloat(this._currentY):0;for(h=0;h<p;h+=4)n=parseFloat(e[h])+v,r=parseFloat(e[h+1])+m,a=parseFloat(e[h+2])+v,f=parseFloat(e[h+3])+m,i=l+.67*(n-l),s=c+.67*(r-c),o=i+(a-l)*.34,u=s+(f-c)*.34,d.push(i),d.push(s),d.push(o),d.push(u),d.push(a),d.push(f);this._curveTo.apply(this,[d,!1])},drawRect:function(e,t,n,r){return this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+r),this.lineTo(e,t+r),this.lineTo(e,t),this._currentX=e,this._currentY=t,this},drawRoundRect:function(e,t,n,r,i,s){return this.moveTo(e,t+s),this.lineTo(e,t+r-s),this.quadraticCurveTo(e,t+r,e+i,t+r),this.lineTo(e+n-i,t+r),this.quadraticCurveTo(e+n,t+r,e+n,t+r-s),this.lineTo(e+n,t+s),this.quadraticCurveTo(e+n,t,e+n-i,t),this.lineTo(e+i,t),this.quadraticCurveTo(e,t,e,t+s),this},drawCircle:function(e,t,n){var r=0,i=360,s=n*2;return i*=65535,this._drawingComplete=!1,this._trackSize(e+s,t+s),this.moveTo(e+s,t+n),this._addToPath(" ae "+this._round(e+n)+", "+this._round(t+n)+", "+this._round(n)+", "+this._round(n)+", "+r+", "+i),this},drawEllipse:function(e,t,n,r){var i=0,s=360,o=n*.5,u=r*.5;return s*=65535,this._drawingComplete=!1,this._trackSize(e+n,t+r),this.moveTo(e+n,t+u),this._addToPath(" ae "+this._round(e+o)+", "+this._round(e+o)+", "+this._round(t+u)+", "+this._round(o)+", "+this._round(u)+", "+i+", "+s),this},drawDiamond:function(e,t,n,r){var i=n*.5,s=r*.5;return this.moveTo(e+i,t),this.lineTo(e+n,t+s),this.lineTo(e+i,t+r),this.lineTo(e,t+s),this.lineTo(e+i,t),this},drawWedge:function(e,t,n,r,i){var s=i*2;return Math.abs(r)>360&&(r=360),this._currentX=e,this._currentY=t,n*=-65535,r*=65536,n=Math.round(n),r=Math.round(r),this.moveTo(e,t),this._addToPath(" ae "+this._round(e)+", "+this._round(t)+", "+this._round(i)+" "+this._round(i)+", "+n+", "+r),this._trackSize(s,s),this},lineTo:function(){return this._lineTo.apply(this,[e.Array(arguments),!1]),this},relativeLineTo:function(){return this._lineTo.apply(this,[e.Array(arguments),!0]),this},_lineTo:function(e,t){var n=e[0],r,i,s,o,u=t?" r ":" l ",a=t?parseFloat(this._currentX):0,f=t?parseFloat(this._currentY):0;if(typeof n=="string"||typeof n=="number"){i=e.length-1;for(r=0;r<i;r+=2)s=parseFloat(e[r]),o=parseFloat(e[r+1]),u+=" "+this._round(s)+", "+this._round(o),s+=a,o+=f,this._currentX=s,this._currentY=o,this._trackSize.apply(this,[s,o])}else{i=e.length;for(r=0;r<i;r+=1)s=parseFloat(e[r][0]),o=parseFloat(e[r][1]),u+=" "+this._round(s)+", "+this._round(o),s+=a,o+=f,this._currentX=s,this._currentY=o,this._trackSize.apply(this,[s,o])}return this._addToPath(u),this},moveTo:function(){return this._moveTo.apply(this,[e.Array(arguments),!1]),this},relativeMoveTo:function(){return this._moveTo.apply(this,[e.Array(arguments),!0]),this},_moveTo:function(e,t){var n=parseFloat(e[0]),r=parseFloat(e[1]),i=t?" t ":" m ",s=t?parseFloat(this._currentX):0,o=t?parseFloat(this._currentY):0;this._movePath=i+this._round(n)+", "+this._round(r),n+=s,r+=o,this._trackSize(n,r),this._currentX=n,this._currentY=r},_closePath:function(){var e=this.get("fill"),t=this.get("stroke"),n=this.node,r=this.get("width"),i=this.get("height"),s=this._path,o="",u=this._coordSpaceMultiplier;this._fillChangeHandler(),this._strokeChangeHandler(),s&&(e&&e.color&&(o+=" x"),t&&(o+=" e")),s&&(n.path=s+o),!isNaN(r)&&!isNaN(i)&&(n.coordOrigin=this._left+", "+this._top,n.coordSize=r*u+", "+i*u,n.style.position="absolute",n.style.width=r+"px",n.style.height=i+"px"),this._path=s,this._movePath=null,this._updateTransform()},end:function(){return this._closePath(),this},closePath:function(){return this._addToPath(" x e"),this},clear:function(){return this._right=0,this._bottom=0,this._width=0,this._height=0,this._left=0,this._top=0,this._path="",this._movePath=null,this},getBezierData:function(e,t){var n=e.length,r=[],i,s;for(i=0;i<n;++i)r[i]=[e[i][0],e[i][1]];for(s=1;s<n;++s)for(i=0;i<n-s;++i)r[i][0]=(1-t)*r[i][0]+t*r[parseInt(i+1,10)][0],r[i][1]=(1-t)*r[i][1]+t*r[parseInt(i+1,10)][1];return[r[0][0],r[0][1]]},_setCurveBoundingBox:function(e,t,n){var r,i=this._currentX,s=i,o=this._currentY
,u=o,a=Math.round(Math.sqrt(t*t+n*n)),f=1/a,l;for(r=0;r<a;++r)l=this.getBezierData(e,f*r),i=isNaN(i)?l[0]:Math.min(l[0],i),s=isNaN(s)?l[0]:Math.max(l[0],s),o=isNaN(o)?l[1]:Math.min(l[1],o),u=isNaN(u)?l[1]:Math.max(l[1],u);i=Math.round(i*10)/10,s=Math.round(s*10)/10,o=Math.round(o*10)/10,u=Math.round(u*10)/10,this._trackSize(s,u),this._trackSize(i,o)},_trackSize:function(e,t){e>this._right&&(this._right=e),e<this._left&&(this._left=e),t<this._top&&(this._top=t),t>this._bottom&&(this._bottom=t),this._width=this._right-this._left,this._height=this._bottom-this._top},_left:0,_right:0,_top:0,_bottom:0,_width:0,_height:0},e.VMLDrawing=E,p=function(){this._transforms=[],this.matrix=new e.Matrix,this._normalizedMatrix=new e.Matrix,p.superclass.constructor.apply(this,arguments)},p.NAME="shape",e.extend(p,e.GraphicBase,e.mix({_type:"shape",init:function(){this.initializer.apply(this,arguments)},initializer:function(e){var t=this,n=e.graphic,r=this.get("data");t.createNode(),n&&this._setGraphic(n),r&&t._parsePathData(r),this._updateHandler()},_setGraphic:function(t){var n;t instanceof e.VMLGraphic?this._graphic=t:(n=new e.VMLGraphic({render:t}),n._appendShape(this),this._graphic=n,this._appendStrokeAndFill())},_appendStrokeAndFill:function(){this._strokeNode&&this.node.appendChild(this._strokeNode),this._fillNode&&this.node.appendChild(this._fillNode)},createNode:function(){var e,t=this._camelCaseConcat,i=this.get("x"),s=this.get("y"),o=this.get("width"),u=this.get("height"),a,f,l=this.name,h,p=this.get("visible")?"visible":"hidden",d,v,m,g,y,b,E,S,x,T;a=this.get("id"),f=this._type==="path"?"shape":this._type,v=w(r)+" "+w(t(n,r))+" "+w(l)+" "+w(t(n,l))+" "+n+f,m=this._getStrokeProps(),x=this._getFillProps(),h="<"+f+' xmlns="urn:schemas-microsft.com:vml" id="'+a+'" class="'+v+'" style="behavior:url(#default#VML);display:inline-block;position:absolute;left:'+i+"px;top:"+s+"px;width:"+o+"px;height:"+u+"px;visibility:"+p+'"',m&&m.weight&&m.weight>0?(g=m.endcap,y=parseFloat(m.opacity),b=m.joinstyle,E=m.miterlimit,S=m.dashstyle,h+=' stroked="t" strokecolor="'+m.color+'" strokeWeight="'+m.weight+'px"',d='<stroke class="vmlstroke" xmlns="urn:schemas-microsft.com:vml" on="t" style="behavior:url(#default#VML);display:inline-block;" opacity="'+y+'"',g&&(d+=' endcap="'+g+'"'),b&&(d+=' joinstyle="'+b+'"'),E&&(d+=' miterlimit="'+E+'"'),S&&(d+=' dashstyle="'+S+'"'),d+="></stroke>",this._strokeNode=c.createElement(d),h+=' stroked="t"'):h+=' stroked="f"',x&&(x.node&&(T=x.node,this._fillNode=c.createElement(T)),x.color&&(h+=' fillcolor="'+x.color+'"'),h+=' filled="'+x.filled+'"'),h+=">",h+="</"+f+">",e=c.createElement(h),this.node=e,this._strokeFlag=!1,this._fillFlag=!1},addClass:function(e){var t=this.node;f.addClass(t,e)},removeClass:function(e){var t=this.node;f.removeClass(t,e)},getXY:function(){var e=this._graphic,t=e.getXY(),n=this.get("x"),r=this.get("y");return[t[0]+n,t[1]+r]},setXY:function(e){var t=this._graphic,n=t.getXY();this.set("x",e[0]-n[0]),this.set("y",e[1]-n[1])},contains:function(t){var n=t instanceof e.Node?t._node:t;return n===this.node},compareTo:function(e){var t=this.node;return t===e},test:function(e){return l.test(this.node,e)},_getStrokeProps:function(){var e,t=this.get("stroke"),n,r,i="",s,o=0,f,l,c;if(t&&t.weight&&t.weight>0){e={},l=t.linecap||"flat",c=t.linejoin||"round",l!=="round"&&l!=="square"&&(l="flat"),n=parseFloat(t.opacity),r=t.dashstyle||"none",t.color=t.color||"#000000",t.weight=t.weight||1,t.opacity=u(n)?n:1,e.stroked=!0,e.color=t.color,e.weight=t.weight,e.endcap=l,e.opacity=t.opacity;if(a(r)){i=[],f=r.length;for(o=0;o<f;++o)s=r[o],i[o]=s/t.weight}c==="round"||c==="bevel"?e.joinstyle=c:(c=parseInt(c,10),u(c)&&(e.miterlimit=Math.max(c,1),e.joinstyle="miter")),e.dashstyle=i}return e},_strokeChangeHandler:function(){if(!this._strokeFlag)return;var e=this.node,t=this.get("stroke"),n,r,i="",s,o=0,f,l,c;if(t&&t.weight&&t.weight>0){l=t.linecap||"flat",c=t.linejoin||"round",l!=="round"&&l!=="square"&&(l="flat"),n=parseFloat(t.opacity),r=t.dashstyle||"none",t.color=t.color||"#000000",t.weight=t.weight||1,t.opacity=u(n)?n:1,e.stroked=!0,e.strokeColor=t.color,e.strokeWeight=t.weight+"px",this._strokeNode||(this._strokeNode=this._createGraphicNode("stroke"),e.appendChild(this._strokeNode)),this._strokeNode.endcap=l,this._strokeNode.opacity=t.opacity;if(a(r)){i=[],f=r.length;for(o=0;o<f;++o)s=r[o],i[o]=s/t.weight}c==="round"||c==="bevel"?this._strokeNode.joinstyle=c:(c=parseInt(c,10),u(c)&&(this._strokeNode.miterlimit=Math.max(c,1),this._strokeNode.joinstyle="miter")),this._strokeNode.dashstyle=i,this._strokeNode.on=!0}else this._strokeNode&&(this._strokeNode.on=!1),e.stroked=!1;this._strokeFlag=!1},_getFillProps:function(){var e=this.get("fill"),t,n,r,i,s,o=!1;if(e){n={};if(e.type==="radial"||e.type==="linear"){t=parseFloat(e.opacity),t=u(t)?t:1,o=!0,r=this._getGradientFill(e),s='<fill xmlns="urn:schemas-microsft.com:vml" class="vmlfill" style="behavior:url(#default#VML);display:inline-block;" opacity="'+t+'"';for(i in r)r.hasOwnProperty(i)&&(s+=" "+i+'="'+r[i]+'"');s+=" />",n.node=s}else e.color&&(t=parseFloat(e.opacity),o=!0,n.color=e.color,u(t)&&(t=Math.max(Math.min(t,1),0),n.opacity=t,t<1&&(n.node='<fill xmlns="urn:schemas-microsft.com:vml" class="vmlfill" style="behavior:url(#default#VML);display:inline-block;" type="solid" opacity="'+t+'"/>')));n.filled=o}return n},_fillChangeHandler:function(){if(!this._fillFlag)return;var e=this.node,t=this.get("fill"),n,r,i=!1,s,o;if(t)if(t.type==="radial"||t.type==="linear"){i=!0,o=this._getGradientFill(t);if(this._fillNode)for(s in o)o.hasOwnProperty(s)&&(s==="colors"?this._fillNode.colors.value=o[s]:this._fillNode[s]=o[s]);else{r='<fill xmlns="urn:schemas-microsft.com:vml" class="vmlfill" style="behavior:url(#default#VML);display:inline-block;"';for(s in o)o.hasOwnProperty(s)&&(r+=" "+s+'="'+o[s]+'"');r+=" />",this._fillNode=c.createElement(r),e.appendChild(this._fillNode)}}else t.color&&(e.fillcolor=t.color,n=parseFloat(t.opacity),i=!0,u(n)&&
n<1?(t.opacity=n,this._fillNode?(this._fillNode.getAttribute("type")!=="solid"&&(this._fillNode.type="solid"),this._fillNode.opacity=n):(r='<fill xmlns="urn:schemas-microsft.com:vml" class="vmlfill" style="behavior:url(#default#VML);display:inline-block;" type="solid" opacity="'+n+'"'+"/>",this._fillNode=c.createElement(r),e.appendChild(this._fillNode))):this._fillNode&&(this._fillNode.opacity=1,this._fillNode.type="solid"));e.filled=i,this._fillFlag=!1},_updateFillNode:function(e){this._fillNode||(this._fillNode=this._createGraphicNode("fill"),e.appendChild(this._fillNode))},_getGradientFill:function(e){var t={},n,r,i=e.type,s=this.get("width"),o=this.get("height"),a=u,f,l=e.stops,c=l.length,h,p,d,v,m="",g=e.cx,y=e.cy,b=e.fx,w=e.fy,E=e.r,S,x=e.rotation||0;i==="linear"?(x<=270?x=Math.abs(x-270):x<360?x=270+(360-x):x=270,t.type="gradient",t.angle=x):i==="radial"&&(n=s*E*2,r=o*E*2,b=E*2*(b-.5),w=E*2*(w-.5),b+=g,w+=y,t.focussize=n/s/10+"% "+r/o/10+"%",t.alignshape=!1,t.type="gradientradial",t.focus="100%",t.focusposition=Math.round(b*100)+"% "+Math.round(w*100)+"%");for(d=0;d<c;++d)f=l[d],p=f.color,h=f.opacity,h=a(h)?h:1,S=f.offset||d/(c-1),S*=E*2,S=Math.round(100*S)+"%",v=d>0?d+1:"",t["opacity"+v]=h+"",m+=", "+S+" "+p;return parseFloat(S)<100&&(m+=", 100% "+p),t.colors=m.substr(2),t},_addTransform:function(t,n){n=e.Array(n),this._transform=o.trim(this._transform+" "+t+"("+n.join(", ")+")"),n.unshift(t),this._transforms.push(n),this.initialized&&this._updateTransform()},_updateTransform:function(){var t=this.node,n,r,i,s=this.get("x"),o=this.get("y"),u,a,f=this.matrix,l=this._normalizedMatrix,h=this instanceof e.VMLPath,p,d=this._transforms.length;if(this._transforms&&this._transforms.length>0){i=this.get("transformOrigin"),h&&l.translate(this._left,this._top),u=i[0]-.5,a=i[1]-.5,u=Math.max(-0.5,Math.min(.5,u)),a=Math.max(-0.5,Math.min(.5,a));for(p=0;p<d;++p)n=this._transforms[p].shift(),n&&(l[n].apply(l,this._transforms[p]),f[n].apply(f,this._transforms[p]));h&&l.translate(-this._left,-this._top),r=l.a+","+l.c+","+l.b+","+l.d+","+0+","+0}this._graphic.addToRedrawQueue(this),r&&(this._skew||(this._skew=c.createElement('<skew class="vmlskew" xmlns="urn:schemas-microsft.com:vml" on="false" style="behavior:url(#default#VML);display:inline-block;"/>'),this.node.appendChild(this._skew)),this._skew.matrix=r,this._skew.on=!0,this._skew.origin=u+", "+a),this._type!=="path"&&(this._transforms=[]),t.style.left=s+this._getSkewOffsetValue(l.dx)+"px",t.style.top=o+this._getSkewOffsetValue(l.dy)+"px"},_getSkewOffsetValue:function(t){var n=e.MatrixUtil.sign(t),r=Math.abs(t);return t=Math.min(r,32767)*n,t},_translateX:0,_translateY:0,_transform:"",translate:function(e,t){this._translateX+=e,this._translateY+=t,this._addTransform("translate",arguments)},translateX:function(e){this._translateX+=e,this._addTransform("translateX",arguments)},translateY:function(e){this._translateY+=e,this._addTransform("translateY",arguments)},skew:function(){this._addTransform("skew",arguments)},skewX:function(){this._addTransform("skewX",arguments)},skewY:function(){this._addTransform("skewY",arguments)},rotate:function(){this._addTransform("rotate",arguments)},scale:function(){this._addTransform("scale",arguments)},on:function(t,n){return e.Node.DOM_EVENTS[t]?e.on(t,n,"#"+this.get("id")):e.on.apply(this,arguments)},_draw:function(){},_updateHandler:function(){var e=this,t=e.node;e._fillChangeHandler(),e._strokeChangeHandler(),t.style.width=this.get("width")+"px",t.style.height=this.get("height")+"px",this._draw(),e._updateTransform()},_createGraphicNode:function(e){return e=e||this._type,c.createElement("<"+e+' xmlns="urn:schemas-microsft.com:vml"'+' style="behavior:url(#default#VML);display:inline-block;"'+' class="vml'+e+'"'+"/>")},_getDefaultFill:function(){return{type:"solid",opacity:1,cx:.5,cy:.5,fx:.5,fy:.5,r:.5}},_getDefaultStroke:function(){return{weight:1,dashstyle:"none",color:"#000",opacity:1}},set:function(){var e=this;h.prototype.set.apply(e,arguments),e.initialized&&e._updateHandler()},getBounds:function(){var t=this instanceof e.VMLPath,n=this.get("width"),r=this.get("height"),i=this.get("x"),s=this.get("y");return t&&(i+=this._left,s+=this._top,n=this._right-this._left,r=this._bottom-this._top),this._getContentRect(n,r,i,s)},_getContentRect:function(t,n,r,i){var s=this.get("transformOrigin"),o=s[0]*t,u=s[1]*n,a=this.matrix.getTransformArray(this.get("transform")),f=new e.Matrix,l,c=a.length,h,p,d,v=this instanceof e.VMLPath;v&&f.translate(this._left,this._top),o=isNaN(o)?0:o,u=isNaN(u)?0:u,f.translate(o,u);for(l=0;l<c;l+=1)h=a[l],p=h.shift(),p&&f[p].apply(f,h);return f.translate(-o,-u),v&&f.translate(-this._left,-this._top),d=f.getContentRect(t,n,r,i),d},toFront:function(){var e=this.get("graphic");e&&e._toFront(this)},toBack:function(){var e=this.get("graphic");e&&e._toBack(this)},_parsePathData:function(t){var n,r,o,u=e.Lang.trim(t.match(i)),a,f,l,c=this._pathSymbolToMethod;if(u){this.clear(),f=u.length||0;for(a=0;a<f;a+=1)l=u[a],r=l.substr(0,1),o=l.substr(1).match(s),n=c[r],n&&(o?this[n].apply(this,o):this[n].apply(this));this.end()}},destroy:function(){var e=this.get("graphic");e?e.removeShape(this):this._destroy()},_destroy:function(){this.node&&(this._fillNode&&(this.node.removeChild(this._fillNode),this._fillNode=null),this._strokeNode&&(this.node.removeChild(this._strokeNode),this._strokeNode=null),e.Event.purgeElement(this.node,!0),this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null)}},e.VMLDrawing.prototype)),p.ATTRS={transformOrigin:{valueFn:function(){return[.5,.5]}},transform:{setter:function(e){var t,n,r;this.matrix.init(),this._normalizedMatrix.init(),this._transforms=this.matrix.getTransformArray(e),n=this._transforms.length;for(t=0;t<n;++t)r=this._transforms[t];return this._transform=e,e},getter:function(){return this._transform}},x:{value:0},y:{value:0},id:{valueFn:function(){return e.guid()},setter:function(e){var t=this.node;return t&&t.setAttribute("id",e),e}}
,width:{value:0},height:{value:0},visible:{value:!0,setter:function(e){var t=this.node,n=e?"visible":"hidden";return t&&(t.style.visibility=n),e}},fill:{valueFn:"_getDefaultFill",setter:function(t){var n,r,i=this.get("fill")||this._getDefaultFill();if(t){t.hasOwnProperty("color")&&(t.type="solid");for(n in t)t.hasOwnProperty(n)&&(i[n]=t[n])}return r=i,r&&r.color&&(r.color===undefined||r.color==="none"?r.color=null:r.color.toLowerCase().indexOf("rgba")>-1&&(r.opacity=e.Color._getAlpha(r.color),r.color=e.Color.toHex(r.color))),this._fillFlag=!0,r}},stroke:{valueFn:"_getDefaultStroke",setter:function(t){var n,r,i,s=this.get("stroke")||this._getDefaultStroke();if(t){t.hasOwnProperty("weight")&&(i=parseInt(t.weight,10),isNaN(i)||(t.weight=i));for(n in t)t.hasOwnProperty(n)&&(s[n]=t[n])}return s.color&&s.color.toLowerCase().indexOf("rgba")>-1&&(s.opacity=e.Color._getAlpha(s.color),s.color=e.Color.toHex(s.color)),r=s,this._strokeFlag=!0,r}},autoSize:{value:!1},pointerEvents:{value:"visiblePainted"},node:{readOnly:!0,getter:function(){return this.node}},data:{setter:function(e){return this.get("node")&&this._parsePathData(e),e}},graphic:{readOnly:!0,getter:function(){return this._graphic}}},e.VMLShape=p,v=function(){v.superclass.constructor.apply(this,arguments)},v.NAME="path",e.extend(v,e.VMLShape),v.ATTRS=e.merge(e.VMLShape.ATTRS,{width:{getter:function(){var e=Math.max(this._right-this._left,0);return e}},height:{getter:function(){return Math.max(this._bottom-this._top,0)}},path:{readOnly:!0,getter:function(){return this._path}}}),e.VMLPath=v,m=function(){m.superclass.constructor.apply(this,arguments)},m.NAME="rect",e.extend(m,e.VMLShape,{_type:"rect"}),m.ATTRS=e.VMLShape.ATTRS,e.VMLRect=m,g=function(){g.superclass.constructor.apply(this,arguments)},g.NAME="ellipse",e.extend(g,e.VMLShape,{_type:"oval"}),g.ATTRS=e.merge(e.VMLShape.ATTRS,{xRadius:{lazyAdd:!1,getter:function(){var e=this.get("width");return e=Math.round(e/2*100)/100,e},setter:function(e){var t=e*2;return this.set("width",t),e}},yRadius:{lazyAdd:!1,getter:function(){var e=this.get("height");return e=Math.round(e/2*100)/100,e},setter:function(e){var t=e*2;return this.set("height",t),e}}}),e.VMLEllipse=g,d=function(){d.superclass.constructor.apply(this,arguments)},d.NAME="circle",e.extend(d,p,{_type:"oval"}),d.ATTRS=e.merge(p.ATTRS,{radius:{lazyAdd:!1,value:0},width:{setter:function(e){return this.set("radius",e/2),e},getter:function(){var e=this.get("radius"),t=e&&e>0?e*2:0;return t}},height:{setter:function(e){return this.set("radius",e/2),e},getter:function(){var e=this.get("radius"),t=e&&e>0?e*2:0;return t}}}),e.VMLCircle=d,b=function(){b.superclass.constructor.apply(this,arguments)},b.NAME="vmlPieSlice",e.extend(b,e.VMLShape,e.mix({_type:"shape",_draw:function(){var e=this.get("cx"),t=this.get("cy"),n=this.get("startAngle"),r=this.get("arc"),i=this.get("radius");this.clear(),this.drawWedge(e,t,n,r,i),this.end()}},e.VMLDrawing.prototype)),b.ATTRS=e.mix({cx:{value:0},cy:{value:0},startAngle:{value:0},arc:{value:0},radius:{value:0}},e.VMLShape.ATTRS),e.VMLPieSlice=b,y=function(){y.superclass.constructor.apply(this,arguments)},y.NAME="vmlGraphic",y.ATTRS={render:{},id:{valueFn:function(){return e.guid()},setter:function(e){var t=this._node;return t&&t.setAttribute("id",e),e}},shapes:{readOnly:!0,getter:function(){return this._shapes}},contentBounds:{readOnly:!0,getter:function(){return this._contentBounds}},node:{readOnly:!0,getter:function(){return this._node}},width:{setter:function(e){return this._node&&(this._node.style.width=e+"px"),e}},height:{setter:function(e){return this._node&&(this._node.style.height=e+"px"),e}},autoSize:{value:!1},preserveAspectRatio:{value:"xMidYMid"},resizeDown:{resizeDown:!1},x:{getter:function(){return this._x},setter:function(e){return this._x=e,this._node&&(this._node.style.left=e+"px"),e}},y:{getter:function(){return this._y},setter:function(e){return this._y=e,this._node&&(this._node.style.top=e+"px"),e}},autoDraw:{value:!0},visible:{value:!0,setter:function(e){return this._toggleVisible(e),e}}},e.extend(y,e.GraphicBase,{set:function(){var t=this,n=arguments[0],r={autoDraw:!0,autoSize:!0,preserveAspectRatio:!0,resizeDown:!0},i,s=!1;h.prototype.set.apply(t,arguments);if(t._state.autoDraw===!0&&e.Object.size(this._shapes)>0)if(o.isString&&r[n])s=!0;else if(o.isObject(n))for(i in r)if(r.hasOwnProperty(i)&&n[i]){s=!0;break}s&&t._redraw()},_x:0,_y:0,getXY:function(){var t=this.parentNode,n=this.get("x"),r=this.get("y"),i;return t?(i=e.DOM.getXY(t),i[0]+=n,i[1]+=r):i=e.DOM._getOffset(this._node),i},initializer:function(){var e=this.get("render"),t=this.get("visible")?"visible":"hidden";this._shapes={},this._contentBounds={left:0,top:0,right:0,bottom:0},this._node=this._createGraphic(),this._node.style.left=this.get("x")+"px",this._node.style.top=this.get("y")+"px",this._node.style.visibility=t,this._node.setAttribute("id",this.get("id")),e&&this.render(e)},render:function(t){var n=t||c.body,r=this._node,i,s;return t instanceof e.Node?n=t._node:e.Lang.isString(t)&&(n=e.Selector.query(t,c.body,!0)),i=this.get("width")||parseInt(e.DOM.getComputedStyle(n,"width"),10),s=this.get("height")||parseInt(e.DOM.getComputedStyle(n,"height"),10),n.appendChild(r),this.parentNode=n,this.set("width",i),this.set("height",s),this},destroy:function(){this.removeAllShapes(),this._node&&(this._removeChildren(this._node),this._node.parentNode&&this._node.parentNode.removeChild(this._node),this._node=null)},addShape:function(e){e.graphic=this,this.get("visible")||(e.visible=!1);var t=this._getShapeClass(e.type),n=new t(e);return this._appendShape(n),n._appendStrokeAndFill(),n},_appendShape:function(e){var t=e.node,n=this._frag||this._node;this.get("autoDraw")||this.get("autoSize")==="sizeContentToGraphic"?n.appendChild(t):this._getDocFrag().appendChild(t)},removeShape:function(e){e instanceof p||o.isString(e)&&(e=this._shapes[e]),e&&e instanceof p&&(e._destroy(),this._shapes[e.get("id")]=null,delete this._shapes[e.get("id")]
),this.get("autoDraw")&&this._redraw()},removeAllShapes:function(){var e=this._shapes,t;for(t in e)e.hasOwnProperty(t)&&e[t].destroy();this._shapes={}},_removeChildren:function(e){if(e.hasChildNodes()){var t;while(e.firstChild)t=e.firstChild,this._removeChildren(t),e.removeChild(t)}},clear:function(){this.removeAllShapes(),this._removeChildren(this._node)},_toggleVisible:function(e){var t,n=this._shapes,r=e?"visible":"hidden";if(n)for(t in n)n.hasOwnProperty(t)&&n[t].set("visible",e);this._node&&(this._node.style.visibility=r),this._node&&(this._node.style.visibility=r)},setSize:function(e,t){e=Math.round(e),t=Math.round(t),this._node.style.width=e+"px",this._node.style.height=t+"px"},setPosition:function(e,t){e=Math.round(e),t=Math.round(t),this._node.style.left=e+"px",this._node.style.top=t+"px"},_createGraphic:function(){var e=c.createElement('<group xmlns="urn:schemas-microsft.com:vml" style="behavior:url(#default#VML);padding:0px 0px 0px 0px;display:block;position:absolute;top:0px;left:0px;zoom:1;"/>');return e},_createGraphicNode:function(e){return c.createElement("<"+e+' xmlns="urn:schemas-microsft.com:vml"'+' style="behavior:url(#default#VML);display:inline-block;zoom:1;"'+"/>")},getShapeById:function(e){return this._shapes[e]},_getShapeClass:function(e){var t=this._shapeClass[e];return t?t:e},_shapeClass:{circle:e.VMLCircle,rect:e.VMLRect,path:e.VMLPath,ellipse:e.VMLEllipse,pieslice:e.VMLPieSlice},batch:function(e){var t=this.get("autoDraw");this.set("autoDraw",!1),e.apply(),this.set("autoDraw",t)},_getDocFrag:function(){return this._frag||(this._frag=c.createDocumentFragment()),this._frag},addToRedrawQueue:function(e){var t,n;this._shapes[e.get("id")]=e,this.get("resizeDown")||(t=e.getBounds(),n=this._contentBounds,n.left=n.left<t.left?n.left:t.left,n.top=n.top<t.top?n.top:t.top,n.right=n.right>t.right?n.right:t.right,n.bottom=n.bottom>t.bottom?n.bottom:t.bottom,n.width=n.right-n.left,n.height=n.bottom-n.top,this._contentBounds=n),this.get("autoDraw")&&this._redraw()},_redraw:function(){var t=this.get("autoSize"),n,r=this.parentNode,i=parseFloat(e.DOM.getComputedStyle(r,"width")),s=parseFloat(e.DOM.getComputedStyle(r,"height")),o=0,u=0,a=this.get("resizeDown")?this._getUpdatedContentBounds():this._contentBounds,f=a.left,l=a.right,c=a.top,h=a.bottom,p=l-f,d=h-c,v,m,g,y,b,w=this.get("visible");this._node.style.visibility="hidden",t?(t==="sizeContentToGraphic"?(n=this.get("preserveAspectRatio"),n==="none"||p/d===i/s?(o=f,u=c,m=p,g=d):p*s/d>i?(v=s/i,m=p,g=p*v,b=i*(d/p)*(g/s),u=this._calculateCoordOrigin(n.slice(5).toLowerCase(),b,g),u=c+u,o=f):(v=i/s,m=d*v,g=d,y=s*(p/d)*(m/i),o=this._calculateCoordOrigin(n.slice(1,4).toLowerCase(),y,m),o+=f,u=c),this._node.style.width=i+"px",this._node.style.height=s+"px",this._node.coordOrigin=o+", "+u):(m=p,g=d,this._node.style.width=p+"px",this._node.style.height=d+"px",this._state.width=p,this._state.height=d),this._node.coordSize=m+", "+g):(this._node.style.width=i+"px",this._node.style.height=s+"px",this._node.coordSize=i+", "+s),this._frag&&(this._node.appendChild(this._frag),this._frag=null),w&&(this._node.style.visibility="visible")},_calculateCoordOrigin:function(e,t,n){var r;switch(e){case"min":r=0;break;case"mid":r=(t-n)/2;break;case"max":r=t-n}return r},_getUpdatedContentBounds:function(){var e,t,n,r=this._shapes,i={};for(t in r)r.hasOwnProperty(t)&&(n=r[t],e=n.getBounds(),i.left=o.isNumber(i.left)?Math.min(i.left,e.left):e.left,i.top=o.isNumber(i.top)?Math.min(i.top,e.top):e.top,i.right=o.isNumber(i.right)?Math.max(i.right,e.right):e.right,i.bottom=o.isNumber(i.bottom)?Math.max(i.bottom,e.bottom):e.bottom);return i.left=o.isNumber(i.left)?i.left:0,i.top=o.isNumber(i.top)?i.top:0,i.right=o.isNumber(i.right)?i.right:0,i.bottom=o.isNumber(i.bottom)?i.bottom:0,this._contentBounds=i,i},_toFront:function(t){var n=this._node;t instanceof e.VMLShape&&(t=t.get("node")),n&&t&&n.appendChild(t)},_toBack:function(t){var n=this._node,r;t instanceof e.VMLShape&&(t=t.get("node")),n&&t&&(r=n.firstChild,r?n.insertBefore(t,r):n.appendChild(t))}}),e.VMLGraphic=y},"3.16.0",{requires:["graphics"]});
|
alucard001/cdnjs
|
ajax/libs/yui/3.16.0/graphics-vml/graphics-vml-min.js
|
JavaScript
|
mit
| 28,270 |
/**
* @license AngularJS v1.2.0-rc.3
* (c) 2010-2012 Google, Inc. http://angularjs.org
* License: MIT
*
* TODO(vojta): wrap whole file into closure during build
*/
/**
* @ngdoc overview
* @name angular.mock
* @description
*
* Namespace from 'angular-mocks.js' which contains testing related code.
*/
angular.mock = {};
/**
* ! This is a private undocumented service !
*
* @name ngMock.$browser
*
* @description
* This service is a mock implementation of {@link ng.$browser}. It provides fake
* implementation for commonly used browser apis that are hard to test, e.g. setTimeout, xhr,
* cookies, etc...
*
* The api of this service is the same as that of the real {@link ng.$browser $browser}, except
* that there are several helper methods available which can be used in tests.
*/
angular.mock.$BrowserProvider = function() {
this.$get = function() {
return new angular.mock.$Browser();
};
};
angular.mock.$Browser = function() {
var self = this;
this.isMock = true;
self.$$url = "http://server/";
self.$$lastUrl = self.$$url; // used by url polling fn
self.pollFns = [];
// TODO(vojta): remove this temporary api
self.$$completeOutstandingRequest = angular.noop;
self.$$incOutstandingRequestCount = angular.noop;
// register url polling fn
self.onUrlChange = function(listener) {
self.pollFns.push(
function() {
if (self.$$lastUrl != self.$$url) {
self.$$lastUrl = self.$$url;
listener(self.$$url);
}
}
);
return listener;
};
self.cookieHash = {};
self.lastCookieHash = {};
self.deferredFns = [];
self.deferredNextId = 0;
self.defer = function(fn, delay) {
delay = delay || 0;
self.deferredFns.push({time:(self.defer.now + delay), fn:fn, id: self.deferredNextId});
self.deferredFns.sort(function(a,b){ return a.time - b.time;});
return self.deferredNextId++;
};
/**
* @name ngMock.$browser#defer.now
* @propertyOf ngMock.$browser
*
* @description
* Current milliseconds mock time.
*/
self.defer.now = 0;
self.defer.cancel = function(deferId) {
var fnIndex;
angular.forEach(self.deferredFns, function(fn, index) {
if (fn.id === deferId) fnIndex = index;
});
if (fnIndex !== undefined) {
self.deferredFns.splice(fnIndex, 1);
return true;
}
return false;
};
/**
* @name ngMock.$browser#defer.flush
* @methodOf ngMock.$browser
*
* @description
* Flushes all pending requests and executes the defer callbacks.
*
* @param {number=} number of milliseconds to flush. See {@link #defer.now}
*/
self.defer.flush = function(delay) {
if (angular.isDefined(delay)) {
self.defer.now += delay;
} else {
if (self.deferredFns.length) {
self.defer.now = self.deferredFns[self.deferredFns.length-1].time;
} else {
throw Error('No deferred tasks to be flushed');
}
}
while (self.deferredFns.length && self.deferredFns[0].time <= self.defer.now) {
self.deferredFns.shift().fn();
}
};
self.$$baseHref = '';
self.baseHref = function() {
return this.$$baseHref;
};
};
angular.mock.$Browser.prototype = {
/**
* @name ngMock.$browser#poll
* @methodOf ngMock.$browser
*
* @description
* run all fns in pollFns
*/
poll: function poll() {
angular.forEach(this.pollFns, function(pollFn){
pollFn();
});
},
addPollFn: function(pollFn) {
this.pollFns.push(pollFn);
return pollFn;
},
url: function(url, replace) {
if (url) {
this.$$url = url;
return this;
}
return this.$$url;
},
cookies: function(name, value) {
if (name) {
if (value == undefined) {
delete this.cookieHash[name];
} else {
if (angular.isString(value) && //strings only
value.length <= 4096) { //strict cookie storage limits
this.cookieHash[name] = value;
}
}
} else {
if (!angular.equals(this.cookieHash, this.lastCookieHash)) {
this.lastCookieHash = angular.copy(this.cookieHash);
this.cookieHash = angular.copy(this.cookieHash);
}
return this.cookieHash;
}
},
notifyWhenNoOutstandingRequests: function(fn) {
fn();
}
};
/**
* @ngdoc object
* @name ngMock.$exceptionHandlerProvider
*
* @description
* Configures the mock implementation of {@link ng.$exceptionHandler} to rethrow or to log errors passed
* into the `$exceptionHandler`.
*/
/**
* @ngdoc object
* @name ngMock.$exceptionHandler
*
* @description
* Mock implementation of {@link ng.$exceptionHandler} that rethrows or logs errors passed
* into it. See {@link ngMock.$exceptionHandlerProvider $exceptionHandlerProvider} for configuration
* information.
*
*
* <pre>
* describe('$exceptionHandlerProvider', function() {
*
* it('should capture log messages and exceptions', function() {
*
* module(function($exceptionHandlerProvider) {
* $exceptionHandlerProvider.mode('log');
* });
*
* inject(function($log, $exceptionHandler, $timeout) {
* $timeout(function() { $log.log(1); });
* $timeout(function() { $log.log(2); throw 'banana peel'; });
* $timeout(function() { $log.log(3); });
* expect($exceptionHandler.errors).toEqual([]);
* expect($log.assertEmpty());
* $timeout.flush();
* expect($exceptionHandler.errors).toEqual(['banana peel']);
* expect($log.log.logs).toEqual([[1], [2], [3]]);
* });
* });
* });
* </pre>
*/
angular.mock.$ExceptionHandlerProvider = function() {
var handler;
/**
* @ngdoc method
* @name ngMock.$exceptionHandlerProvider#mode
* @methodOf ngMock.$exceptionHandlerProvider
*
* @description
* Sets the logging mode.
*
* @param {string} mode Mode of operation, defaults to `rethrow`.
*
* - `rethrow`: If any errors are passed into the handler in tests, it typically
* means that there is a bug in the application or test, so this mock will
* make these tests fail.
* - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log` mode stores an
* array of errors in `$exceptionHandler.errors`, to allow later assertion of them.
* See {@link ngMock.$log#assertEmpty assertEmpty()} and
* {@link ngMock.$log#reset reset()}
*/
this.mode = function(mode) {
switch(mode) {
case 'rethrow':
handler = function(e) {
throw e;
};
break;
case 'log':
var errors = [];
handler = function(e) {
if (arguments.length == 1) {
errors.push(e);
} else {
errors.push([].slice.call(arguments, 0));
}
};
handler.errors = errors;
break;
default:
throw Error("Unknown mode '" + mode + "', only 'log'/'rethrow' modes are allowed!");
}
};
this.$get = function() {
return handler;
};
this.mode('rethrow');
};
/**
* @ngdoc service
* @name ngMock.$log
*
* @description
* Mock implementation of {@link ng.$log} that gathers all logged messages in arrays
* (one array per logging level). These arrays are exposed as `logs` property of each of the
* level-specific log function, e.g. for level `error` the array is exposed as `$log.error.logs`.
*
*/
angular.mock.$LogProvider = function() {
var debug = true;
function concat(array1, array2, index) {
return array1.concat(Array.prototype.slice.call(array2, index));
}
this.debugEnabled = function(flag) {
if (angular.isDefined(flag)) {
debug = flag;
return this;
} else {
return debug;
}
};
this.$get = function () {
var $log = {
log: function() { $log.log.logs.push(concat([], arguments, 0)); },
warn: function() { $log.warn.logs.push(concat([], arguments, 0)); },
info: function() { $log.info.logs.push(concat([], arguments, 0)); },
error: function() { $log.error.logs.push(concat([], arguments, 0)); },
debug: function() {
if (debug) {
$log.debug.logs.push(concat([], arguments, 0));
}
}
};
/**
* @ngdoc method
* @name ngMock.$log#reset
* @methodOf ngMock.$log
*
* @description
* Reset all of the logging arrays to empty.
*/
$log.reset = function () {
/**
* @ngdoc property
* @name ngMock.$log#log.logs
* @propertyOf ngMock.$log
*
* @description
* Array of messages logged using {@link ngMock.$log#log}.
*
* @example
* <pre>
* $log.log('Some Log');
* var first = $log.log.logs.unshift();
* </pre>
*/
$log.log.logs = [];
/**
* @ngdoc property
* @name ngMock.$log#info.logs
* @propertyOf ngMock.$log
*
* @description
* Array of messages logged using {@link ngMock.$log#info}.
*
* @example
* <pre>
* $log.info('Some Info');
* var first = $log.info.logs.unshift();
* </pre>
*/
$log.info.logs = [];
/**
* @ngdoc property
* @name ngMock.$log#warn.logs
* @propertyOf ngMock.$log
*
* @description
* Array of messages logged using {@link ngMock.$log#warn}.
*
* @example
* <pre>
* $log.warn('Some Warning');
* var first = $log.warn.logs.unshift();
* </pre>
*/
$log.warn.logs = [];
/**
* @ngdoc property
* @name ngMock.$log#error.logs
* @propertyOf ngMock.$log
*
* @description
* Array of messages logged using {@link ngMock.$log#error}.
*
* @example
* <pre>
* $log.log('Some Error');
* var first = $log.error.logs.unshift();
* </pre>
*/
$log.error.logs = [];
/**
* @ngdoc property
* @name ngMock.$log#debug.logs
* @propertyOf ngMock.$log
*
* @description
* Array of messages logged using {@link ngMock.$log#debug}.
*
* @example
* <pre>
* $log.debug('Some Error');
* var first = $log.debug.logs.unshift();
* </pre>
*/
$log.debug.logs = []
};
/**
* @ngdoc method
* @name ngMock.$log#assertEmpty
* @methodOf ngMock.$log
*
* @description
* Assert that the all of the logging methods have no logged messages. If messages present, an exception is thrown.
*/
$log.assertEmpty = function() {
var errors = [];
angular.forEach(['error', 'warn', 'info', 'log', 'debug'], function(logLevel) {
angular.forEach($log[logLevel].logs, function(log) {
angular.forEach(log, function (logItem) {
errors.push('MOCK $log (' + logLevel + '): ' + String(logItem) + '\n' + (logItem.stack || ''));
});
});
});
if (errors.length) {
errors.unshift("Expected $log to be empty! Either a message was logged unexpectedly, or an expected " +
"log message was not checked and removed:");
errors.push('');
throw new Error(errors.join('\n---------\n'));
}
};
$log.reset();
return $log;
};
};
/**
* @ngdoc service
* @name ngMock.$interval
*
* @description
* Mock implementation of the $interval service.
*
* Use {@link ngMock.$interval#flush `$interval.flush(millis)`} to
* move forward by `millis` milliseconds and trigger any functions scheduled to run in that
* time.
*
* @param {function()} fn A function that should be called repeatedly.
* @param {number} delay Number of milliseconds between each function call.
* @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat
* indefinitely.
* @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise
* will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.
* @returns {promise} A promise which will be notified on each iteration.
*/
angular.mock.$IntervalProvider = function() {
this.$get = ['$rootScope', '$q',
function($rootScope, $q) {
var repeatFns = [],
nextRepeatId = 0,
now = 0;
var $interval = function(fn, delay, count, invokeApply) {
var deferred = $q.defer(),
promise = deferred.promise,
count = (angular.isDefined(count)) ? count : 0,
iteration = 0,
skipApply = (angular.isDefined(invokeApply) && !invokeApply);
promise.then(null, null, fn);
promise.$$intervalId = nextRepeatId;
function tick() {
deferred.notify(iteration++);
if (count > 0 && iteration >= count) {
var fnIndex;
deferred.resolve(iteration);
angular.forEach(repeatFns, function(fn, index) {
if (fn.id === promise.$$intervalId) fnIndex = index;
});
if (fnIndex !== undefined) {
repeatFns.splice(fnIndex, 1);
}
}
if (!skipApply) $rootScope.$apply();
};
repeatFns.push({
nextTime:(now + delay),
delay: delay,
fn: tick,
id: nextRepeatId,
deferred: deferred
});
repeatFns.sort(function(a,b){ return a.nextTime - b.nextTime;});
nextRepeatId++;
return promise;
};
$interval.cancel = function(promise) {
var fnIndex;
angular.forEach(repeatFns, function(fn, index) {
if (fn.id === promise.$$intervalId) fnIndex = index;
});
if (fnIndex !== undefined) {
repeatFns[fnIndex].deferred.reject('canceled');
repeatFns.splice(fnIndex, 1);
return true;
}
return false;
};
/**
* @ngdoc method
* @name ngMock.$interval#flush
* @methodOf ngMock.$interval
* @description
*
* Runs interval tasks scheduled to be run in the next `millis` milliseconds.
*
* @param {number=} millis maximum timeout amount to flush up until.
*
* @return {number} The amount of time moved forward.
*/
$interval.flush = function(millis) {
now += millis;
while (repeatFns.length && repeatFns[0].nextTime <= now) {
var task = repeatFns[0];
task.fn();
task.nextTime += task.delay;
repeatFns.sort(function(a,b){ return a.nextTime - b.nextTime;});
}
return millis;
};
return $interval;
}];
};
(function() {
var R_ISO8061_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?:\:?(\d\d)(?:\:?(\d\d)(?:\.(\d{3}))?)?)?(Z|([+-])(\d\d):?(\d\d)))?$/;
function jsonStringToDate(string) {
var match;
if (match = string.match(R_ISO8061_STR)) {
var date = new Date(0),
tzHour = 0,
tzMin = 0;
if (match[9]) {
tzHour = int(match[9] + match[10]);
tzMin = int(match[9] + match[11]);
}
date.setUTCFullYear(int(match[1]), int(match[2]) - 1, int(match[3]));
date.setUTCHours(int(match[4]||0) - tzHour, int(match[5]||0) - tzMin, int(match[6]||0), int(match[7]||0));
return date;
}
return string;
}
function int(str) {
return parseInt(str, 10);
}
function padNumber(num, digits, trim) {
var neg = '';
if (num < 0) {
neg = '-';
num = -num;
}
num = '' + num;
while(num.length < digits) num = '0' + num;
if (trim)
num = num.substr(num.length - digits);
return neg + num;
}
/**
* @ngdoc object
* @name angular.mock.TzDate
* @description
*
* *NOTE*: this is not an injectable instance, just a globally available mock class of `Date`.
*
* Mock of the Date type which has its timezone specified via constructor arg.
*
* The main purpose is to create Date-like instances with timezone fixed to the specified timezone
* offset, so that we can test code that depends on local timezone settings without dependency on
* the time zone settings of the machine where the code is running.
*
* @param {number} offset Offset of the *desired* timezone in hours (fractions will be honored)
* @param {(number|string)} timestamp Timestamp representing the desired time in *UTC*
*
* @example
* !!!! WARNING !!!!!
* This is not a complete Date object so only methods that were implemented can be called safely.
* To make matters worse, TzDate instances inherit stuff from Date via a prototype.
*
* We do our best to intercept calls to "unimplemented" methods, but since the list of methods is
* incomplete we might be missing some non-standard methods. This can result in errors like:
* "Date.prototype.foo called on incompatible Object".
*
* <pre>
* var newYearInBratislava = new TzDate(-1, '2009-12-31T23:00:00Z');
* newYearInBratislava.getTimezoneOffset() => -60;
* newYearInBratislava.getFullYear() => 2010;
* newYearInBratislava.getMonth() => 0;
* newYearInBratislava.getDate() => 1;
* newYearInBratislava.getHours() => 0;
* newYearInBratislava.getMinutes() => 0;
* newYearInBratislava.getSeconds() => 0;
* </pre>
*
*/
angular.mock.TzDate = function (offset, timestamp) {
var self = new Date(0);
if (angular.isString(timestamp)) {
var tsStr = timestamp;
self.origDate = jsonStringToDate(timestamp);
timestamp = self.origDate.getTime();
if (isNaN(timestamp))
throw {
name: "Illegal Argument",
message: "Arg '" + tsStr + "' passed into TzDate constructor is not a valid date string"
};
} else {
self.origDate = new Date(timestamp);
}
var localOffset = new Date(timestamp).getTimezoneOffset();
self.offsetDiff = localOffset*60*1000 - offset*1000*60*60;
self.date = new Date(timestamp + self.offsetDiff);
self.getTime = function() {
return self.date.getTime() - self.offsetDiff;
};
self.toLocaleDateString = function() {
return self.date.toLocaleDateString();
};
self.getFullYear = function() {
return self.date.getFullYear();
};
self.getMonth = function() {
return self.date.getMonth();
};
self.getDate = function() {
return self.date.getDate();
};
self.getHours = function() {
return self.date.getHours();
};
self.getMinutes = function() {
return self.date.getMinutes();
};
self.getSeconds = function() {
return self.date.getSeconds();
};
self.getMilliseconds = function() {
return self.date.getMilliseconds();
};
self.getTimezoneOffset = function() {
return offset * 60;
};
self.getUTCFullYear = function() {
return self.origDate.getUTCFullYear();
};
self.getUTCMonth = function() {
return self.origDate.getUTCMonth();
};
self.getUTCDate = function() {
return self.origDate.getUTCDate();
};
self.getUTCHours = function() {
return self.origDate.getUTCHours();
};
self.getUTCMinutes = function() {
return self.origDate.getUTCMinutes();
};
self.getUTCSeconds = function() {
return self.origDate.getUTCSeconds();
};
self.getUTCMilliseconds = function() {
return self.origDate.getUTCMilliseconds();
};
self.getDay = function() {
return self.date.getDay();
};
// provide this method only on browsers that already have it
if (self.toISOString) {
self.toISOString = function() {
return padNumber(self.origDate.getUTCFullYear(), 4) + '-' +
padNumber(self.origDate.getUTCMonth() + 1, 2) + '-' +
padNumber(self.origDate.getUTCDate(), 2) + 'T' +
padNumber(self.origDate.getUTCHours(), 2) + ':' +
padNumber(self.origDate.getUTCMinutes(), 2) + ':' +
padNumber(self.origDate.getUTCSeconds(), 2) + '.' +
padNumber(self.origDate.getUTCMilliseconds(), 3) + 'Z'
}
}
//hide all methods not implemented in this mock that the Date prototype exposes
var unimplementedMethods = ['getUTCDay',
'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds',
'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear',
'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds',
'setYear', 'toDateString', 'toGMTString', 'toJSON', 'toLocaleFormat', 'toLocaleString',
'toLocaleTimeString', 'toSource', 'toString', 'toTimeString', 'toUTCString', 'valueOf'];
angular.forEach(unimplementedMethods, function(methodName) {
self[methodName] = function() {
throw Error("Method '" + methodName + "' is not implemented in the TzDate mock");
};
});
return self;
};
//make "tzDateInstance instanceof Date" return true
angular.mock.TzDate.prototype = Date.prototype;
})();
angular.mock.animate = angular.module('mock.animate', ['ng'])
.config(['$provide', function($provide) {
$provide.decorator('$animate', function($delegate) {
var animate = {
queue : [],
enabled : $delegate.enabled,
flushNext : function(name) {
var tick = animate.queue.shift();
expect(tick.method).toBe(name);
tick.fn();
return tick;
}
};
angular.forEach(['enter','leave','move','addClass','removeClass'], function(method) {
animate[method] = function() {
var params = arguments;
animate.queue.push({
method : method,
params : params,
element : angular.isElement(params[0]) && params[0],
parent : angular.isElement(params[1]) && params[1],
after : angular.isElement(params[2]) && params[2],
fn : function() {
$delegate[method].apply($delegate, params);
}
});
};
});
return animate;
});
}]);
/**
* @ngdoc function
* @name angular.mock.dump
* @description
*
* *NOTE*: this is not an injectable instance, just a globally available function.
*
* Method for serializing common angular objects (scope, elements, etc..) into strings, useful for debugging.
*
* This method is also available on window, where it can be used to display objects on debug console.
*
* @param {*} object - any object to turn into string.
* @return {string} a serialized string of the argument
*/
angular.mock.dump = function(object) {
return serialize(object);
function serialize(object) {
var out;
if (angular.isElement(object)) {
object = angular.element(object);
out = angular.element('<div></div>');
angular.forEach(object, function(element) {
out.append(angular.element(element).clone());
});
out = out.html();
} else if (angular.isArray(object)) {
out = [];
angular.forEach(object, function(o) {
out.push(serialize(o));
});
out = '[ ' + out.join(', ') + ' ]';
} else if (angular.isObject(object)) {
if (angular.isFunction(object.$eval) && angular.isFunction(object.$apply)) {
out = serializeScope(object);
} else if (object instanceof Error) {
out = object.stack || ('' + object.name + ': ' + object.message);
} else {
// TODO(i): this prevents methods to be logged, we should have a better way to serialize objects
out = angular.toJson(object, true);
}
} else {
out = String(object);
}
return out;
}
function serializeScope(scope, offset) {
offset = offset || ' ';
var log = [offset + 'Scope(' + scope.$id + '): {'];
for ( var key in scope ) {
if (Object.prototype.hasOwnProperty.call(scope, key) && !key.match(/^(\$|this)/)) {
log.push(' ' + key + ': ' + angular.toJson(scope[key]));
}
}
var child = scope.$$childHead;
while(child) {
log.push(serializeScope(child, offset + ' '));
child = child.$$nextSibling;
}
log.push('}');
return log.join('\n' + offset);
}
};
/**
* @ngdoc object
* @name ngMock.$httpBackend
* @description
* Fake HTTP backend implementation suitable for unit testing applications that use the
* {@link ng.$http $http service}.
*
* *Note*: For fake HTTP backend implementation suitable for end-to-end testing or backend-less
* development please see {@link ngMockE2E.$httpBackend e2e $httpBackend mock}.
*
* During unit testing, we want our unit tests to run quickly and have no external dependencies so
* we don’t want to send {@link https://developer.mozilla.org/en/xmlhttprequest XHR} or
* {@link http://en.wikipedia.org/wiki/JSONP JSONP} requests to a real server. All we really need is
* to verify whether a certain request has been sent or not, or alternatively just let the
* application make requests, respond with pre-trained responses and assert that the end result is
* what we expect it to be.
*
* This mock implementation can be used to respond with static or dynamic responses via the
* `expect` and `when` apis and their shortcuts (`expectGET`, `whenPOST`, etc).
*
* When an Angular application needs some data from a server, it calls the $http service, which
* sends the request to a real server using $httpBackend service. With dependency injection, it is
* easy to inject $httpBackend mock (which has the same API as $httpBackend) and use it to verify
* the requests and respond with some testing data without sending a request to real server.
*
* There are two ways to specify what test data should be returned as http responses by the mock
* backend when the code under test makes http requests:
*
* - `$httpBackend.expect` - specifies a request expectation
* - `$httpBackend.when` - specifies a backend definition
*
*
* # Request Expectations vs Backend Definitions
*
* Request expectations provide a way to make assertions about requests made by the application and
* to define responses for those requests. The test will fail if the expected requests are not made
* or they are made in the wrong order.
*
* Backend definitions allow you to define a fake backend for your application which doesn't assert
* if a particular request was made or not, it just returns a trained response if a request is made.
* The test will pass whether or not the request gets made during testing.
*
*
* <table class="table">
* <tr><th width="220px"></th><th>Request expectations</th><th>Backend definitions</th></tr>
* <tr>
* <th>Syntax</th>
* <td>.expect(...).respond(...)</td>
* <td>.when(...).respond(...)</td>
* </tr>
* <tr>
* <th>Typical usage</th>
* <td>strict unit tests</td>
* <td>loose (black-box) unit testing</td>
* </tr>
* <tr>
* <th>Fulfills multiple requests</th>
* <td>NO</td>
* <td>YES</td>
* </tr>
* <tr>
* <th>Order of requests matters</th>
* <td>YES</td>
* <td>NO</td>
* </tr>
* <tr>
* <th>Request required</th>
* <td>YES</td>
* <td>NO</td>
* </tr>
* <tr>
* <th>Response required</th>
* <td>optional (see below)</td>
* <td>YES</td>
* </tr>
* </table>
*
* In cases where both backend definitions and request expectations are specified during unit
* testing, the request expectations are evaluated first.
*
* If a request expectation has no response specified, the algorithm will search your backend
* definitions for an appropriate response.
*
* If a request didn't match any expectation or if the expectation doesn't have the response
* defined, the backend definitions are evaluated in sequential order to see if any of them match
* the request. The response from the first matched definition is returned.
*
*
* # Flushing HTTP requests
*
* The $httpBackend used in production, always responds to requests with responses asynchronously.
* If we preserved this behavior in unit testing, we'd have to create async unit tests, which are
* hard to write, follow and maintain. At the same time the testing mock, can't respond
* synchronously because that would change the execution of the code under test. For this reason the
* mock $httpBackend has a `flush()` method, which allows the test to explicitly flush pending
* requests and thus preserving the async api of the backend, while allowing the test to execute
* synchronously.
*
*
* # Unit testing with mock $httpBackend
* The following code shows how to setup and use the mock backend in unit testing a controller.
* First we create the controller under test
*
<pre>
// The controller code
function MyController($scope, $http) {
var authToken;
$http.get('/auth.py').success(function(data, status, headers) {
authToken = headers('A-Token');
$scope.user = data;
});
$scope.saveMessage = function(message) {
var headers = { 'Authorization': authToken };
$scope.status = 'Saving...';
$http.post('/add-msg.py', message, { headers: headers } ).success(function(response) {
$scope.status = '';
}).error(function() {
$scope.status = 'ERROR!';
});
};
}
</pre>
*
* Now we setup the mock backend and create the test specs.
*
<pre>
// testing controller
describe('MyController', function() {
var $httpBackend, $rootScope, createController;
beforeEach(inject(function($injector) {
// Set up the mock http service responses
$httpBackend = $injector.get('$httpBackend');
// backend definition common for all tests
$httpBackend.when('GET', '/auth.py').respond({userId: 'userX'}, {'A-Token': 'xxx'});
// Get hold of a scope (i.e. the root scope)
$rootScope = $injector.get('$rootScope');
// The $controller service is used to create instances of controllers
var $controller = $injector.get('$controller');
createController = function() {
return $controller('MyController', {'$scope' : $rootScope });
};
}));
afterEach(function() {
$httpBackend.verifyNoOutstandingExpectation();
$httpBackend.verifyNoOutstandingRequest();
});
it('should fetch authentication token', function() {
$httpBackend.expectGET('/auth.py');
var controller = createController();
$httpBackend.flush();
});
it('should send msg to server', function() {
var controller = createController();
$httpBackend.flush();
// now you don’t care about the authentication, but
// the controller will still send the request and
// $httpBackend will respond without you having to
// specify the expectation and response for this request
$httpBackend.expectPOST('/add-msg.py', 'message content').respond(201, '');
$rootScope.saveMessage('message content');
expect($rootScope.status).toBe('Saving...');
$httpBackend.flush();
expect($rootScope.status).toBe('');
});
it('should send auth header', function() {
var controller = createController();
$httpBackend.flush();
$httpBackend.expectPOST('/add-msg.py', undefined, function(headers) {
// check if the header was send, if it wasn't the expectation won't
// match the request and the test will fail
return headers['Authorization'] == 'xxx';
}).respond(201, '');
$rootScope.saveMessage('whatever');
$httpBackend.flush();
});
});
</pre>
*/
angular.mock.$HttpBackendProvider = function() {
this.$get = ['$rootScope', createHttpBackendMock];
};
/**
* General factory function for $httpBackend mock.
* Returns instance for unit testing (when no arguments specified):
* - passing through is disabled
* - auto flushing is disabled
*
* Returns instance for e2e testing (when `$delegate` and `$browser` specified):
* - passing through (delegating request to real backend) is enabled
* - auto flushing is enabled
*
* @param {Object=} $delegate Real $httpBackend instance (allow passing through if specified)
* @param {Object=} $browser Auto-flushing enabled if specified
* @return {Object} Instance of $httpBackend mock
*/
function createHttpBackendMock($rootScope, $delegate, $browser) {
var definitions = [],
expectations = [],
responses = [],
responsesPush = angular.bind(responses, responses.push);
function createResponse(status, data, headers) {
if (angular.isFunction(status)) return status;
return function() {
return angular.isNumber(status)
? [status, data, headers]
: [200, status, data];
};
}
// TODO(vojta): change params to: method, url, data, headers, callback
function $httpBackend(method, url, data, callback, headers, timeout, withCredentials) {
var xhr = new MockXhr(),
expectation = expectations[0],
wasExpected = false;
function prettyPrint(data) {
return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp)
? data
: angular.toJson(data);
}
function wrapResponse(wrapped) {
if (!$browser && timeout && timeout.then) timeout.then(handleTimeout);
return handleResponse;
function handleResponse() {
var response = wrapped.response(method, url, data, headers);
xhr.$$respHeaders = response[2];
callback(response[0], response[1], xhr.getAllResponseHeaders());
}
function handleTimeout() {
for (var i = 0, ii = responses.length; i < ii; i++) {
if (responses[i] === handleResponse) {
responses.splice(i, 1);
callback(-1, undefined, '');
break;
}
}
}
}
if (expectation && expectation.match(method, url)) {
if (!expectation.matchData(data))
throw new Error('Expected ' + expectation + ' with different data\n' +
'EXPECTED: ' + prettyPrint(expectation.data) + '\nGOT: ' + data);
if (!expectation.matchHeaders(headers))
throw new Error('Expected ' + expectation + ' with different headers\n' +
'EXPECTED: ' + prettyPrint(expectation.headers) + '\nGOT: ' + prettyPrint(headers));
expectations.shift();
if (expectation.response) {
responses.push(wrapResponse(expectation));
return;
}
wasExpected = true;
}
var i = -1, definition;
while ((definition = definitions[++i])) {
if (definition.match(method, url, data, headers || {})) {
if (definition.response) {
// if $browser specified, we do auto flush all requests
($browser ? $browser.defer : responsesPush)(wrapResponse(definition));
} else if (definition.passThrough) {
$delegate(method, url, data, callback, headers, timeout, withCredentials);
} else throw Error('No response defined !');
return;
}
}
throw wasExpected ?
new Error('No response defined !') :
new Error('Unexpected request: ' + method + ' ' + url + '\n' +
(expectation ? 'Expected ' + expectation : 'No more request expected'));
}
/**
* @ngdoc method
* @name ngMock.$httpBackend#when
* @methodOf ngMock.$httpBackend
* @description
* Creates a new backend definition.
*
* @param {string} method HTTP method.
* @param {string|RegExp} url HTTP url.
* @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
* data string and returns true if the data is as expected.
* @param {(Object|function(Object))=} headers HTTP headers or function that receives http header
* object and returns true if the headers match the current definition.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
* request is handled.
*
* - respond – `{function([status,] data[, headers])|function(function(method, url, data, headers)}`
* – The respond method takes a set of static data to be returned or a function that can return
* an array containing response status (number), response data (string) and response headers
* (Object).
*/
$httpBackend.when = function(method, url, data, headers) {
var definition = new MockHttpExpectation(method, url, data, headers),
chain = {
respond: function(status, data, headers) {
definition.response = createResponse(status, data, headers);
}
};
if ($browser) {
chain.passThrough = function() {
definition.passThrough = true;
};
}
definitions.push(definition);
return chain;
};
/**
* @ngdoc method
* @name ngMock.$httpBackend#whenGET
* @methodOf ngMock.$httpBackend
* @description
* Creates a new backend definition for GET requests. For more info see `when()`.
*
* @param {string|RegExp} url HTTP url.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
* request is handled.
*/
/**
* @ngdoc method
* @name ngMock.$httpBackend#whenHEAD
* @methodOf ngMock.$httpBackend
* @description
* Creates a new backend definition for HEAD requests. For more info see `when()`.
*
* @param {string|RegExp} url HTTP url.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
* request is handled.
*/
/**
* @ngdoc method
* @name ngMock.$httpBackend#whenDELETE
* @methodOf ngMock.$httpBackend
* @description
* Creates a new backend definition for DELETE requests. For more info see `when()`.
*
* @param {string|RegExp} url HTTP url.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
* request is handled.
*/
/**
* @ngdoc method
* @name ngMock.$httpBackend#whenPOST
* @methodOf ngMock.$httpBackend
* @description
* Creates a new backend definition for POST requests. For more info see `when()`.
*
* @param {string|RegExp} url HTTP url.
* @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
* data string and returns true if the data is as expected.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
* request is handled.
*/
/**
* @ngdoc method
* @name ngMock.$httpBackend#whenPUT
* @methodOf ngMock.$httpBackend
* @description
* Creates a new backend definition for PUT requests. For more info see `when()`.
*
* @param {string|RegExp} url HTTP url.
* @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
* data string and returns true if the data is as expected.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
* request is handled.
*/
/**
* @ngdoc method
* @name ngMock.$httpBackend#whenJSONP
* @methodOf ngMock.$httpBackend
* @description
* Creates a new backend definition for JSONP requests. For more info see `when()`.
*
* @param {string|RegExp} url HTTP url.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
* request is handled.
*/
createShortMethods('when');
/**
* @ngdoc method
* @name ngMock.$httpBackend#expect
* @methodOf ngMock.$httpBackend
* @description
* Creates a new request expectation.
*
* @param {string} method HTTP method.
* @param {string|RegExp} url HTTP url.
* @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that
* receives data string and returns true if the data is as expected, or Object if request body
* is in JSON format.
* @param {(Object|function(Object))=} headers HTTP headers or function that receives http header
* object and returns true if the headers match the current expectation.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
* request is handled.
*
* - respond – `{function([status,] data[, headers])|function(function(method, url, data, headers)}`
* – The respond method takes a set of static data to be returned or a function that can return
* an array containing response status (number), response data (string) and response headers
* (Object).
*/
$httpBackend.expect = function(method, url, data, headers) {
var expectation = new MockHttpExpectation(method, url, data, headers);
expectations.push(expectation);
return {
respond: function(status, data, headers) {
expectation.response = createResponse(status, data, headers);
}
};
};
/**
* @ngdoc method
* @name ngMock.$httpBackend#expectGET
* @methodOf ngMock.$httpBackend
* @description
* Creates a new request expectation for GET requests. For more info see `expect()`.
*
* @param {string|RegExp} url HTTP url.
* @param {Object=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
* request is handled. See #expect for more info.
*/
/**
* @ngdoc method
* @name ngMock.$httpBackend#expectHEAD
* @methodOf ngMock.$httpBackend
* @description
* Creates a new request expectation for HEAD requests. For more info see `expect()`.
*
* @param {string|RegExp} url HTTP url.
* @param {Object=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
* request is handled.
*/
/**
* @ngdoc method
* @name ngMock.$httpBackend#expectDELETE
* @methodOf ngMock.$httpBackend
* @description
* Creates a new request expectation for DELETE requests. For more info see `expect()`.
*
* @param {string|RegExp} url HTTP url.
* @param {Object=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
* request is handled.
*/
/**
* @ngdoc method
* @name ngMock.$httpBackend#expectPOST
* @methodOf ngMock.$httpBackend
* @description
* Creates a new request expectation for POST requests. For more info see `expect()`.
*
* @param {string|RegExp} url HTTP url.
* @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that
* receives data string and returns true if the data is as expected, or Object if request body
* is in JSON format.
* @param {Object=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
* request is handled.
*/
/**
* @ngdoc method
* @name ngMock.$httpBackend#expectPUT
* @methodOf ngMock.$httpBackend
* @description
* Creates a new request expectation for PUT requests. For more info see `expect()`.
*
* @param {string|RegExp} url HTTP url.
* @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that
* receives data string and returns true if the data is as expected, or Object if request body
* is in JSON format.
* @param {Object=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
* request is handled.
*/
/**
* @ngdoc method
* @name ngMock.$httpBackend#expectPATCH
* @methodOf ngMock.$httpBackend
* @description
* Creates a new request expectation for PATCH requests. For more info see `expect()`.
*
* @param {string|RegExp} url HTTP url.
* @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that
* receives data string and returns true if the data is as expected, or Object if request body
* is in JSON format.
* @param {Object=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
* request is handled.
*/
/**
* @ngdoc method
* @name ngMock.$httpBackend#expectJSONP
* @methodOf ngMock.$httpBackend
* @description
* Creates a new request expectation for JSONP requests. For more info see `expect()`.
*
* @param {string|RegExp} url HTTP url.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched
* request is handled.
*/
createShortMethods('expect');
/**
* @ngdoc method
* @name ngMock.$httpBackend#flush
* @methodOf ngMock.$httpBackend
* @description
* Flushes all pending requests using the trained responses.
*
* @param {number=} count Number of responses to flush (in the order they arrived). If undefined,
* all pending requests will be flushed. If there are no pending requests when the flush method
* is called an exception is thrown (as this typically a sign of programming error).
*/
$httpBackend.flush = function(count) {
$rootScope.$digest();
if (!responses.length) throw Error('No pending request to flush !');
if (angular.isDefined(count)) {
while (count--) {
if (!responses.length) throw Error('No more pending request to flush !');
responses.shift()();
}
} else {
while (responses.length) {
responses.shift()();
}
}
$httpBackend.verifyNoOutstandingExpectation();
};
/**
* @ngdoc method
* @name ngMock.$httpBackend#verifyNoOutstandingExpectation
* @methodOf ngMock.$httpBackend
* @description
* Verifies that all of the requests defined via the `expect` api were made. If any of the
* requests were not made, verifyNoOutstandingExpectation throws an exception.
*
* Typically, you would call this method following each test case that asserts requests using an
* "afterEach" clause.
*
* <pre>
* afterEach($httpBackend.verifyNoOutstandingExpectation);
* </pre>
*/
$httpBackend.verifyNoOutstandingExpectation = function() {
$rootScope.$digest();
if (expectations.length) {
throw new Error('Unsatisfied requests: ' + expectations.join(', '));
}
};
/**
* @ngdoc method
* @name ngMock.$httpBackend#verifyNoOutstandingRequest
* @methodOf ngMock.$httpBackend
* @description
* Verifies that there are no outstanding requests that need to be flushed.
*
* Typically, you would call this method following each test case that asserts requests using an
* "afterEach" clause.
*
* <pre>
* afterEach($httpBackend.verifyNoOutstandingRequest);
* </pre>
*/
$httpBackend.verifyNoOutstandingRequest = function() {
if (responses.length) {
throw Error('Unflushed requests: ' + responses.length);
}
};
/**
* @ngdoc method
* @name ngMock.$httpBackend#resetExpectations
* @methodOf ngMock.$httpBackend
* @description
* Resets all request expectations, but preserves all backend definitions. Typically, you would
* call resetExpectations during a multiple-phase test when you want to reuse the same instance of
* $httpBackend mock.
*/
$httpBackend.resetExpectations = function() {
expectations.length = 0;
responses.length = 0;
};
return $httpBackend;
function createShortMethods(prefix) {
angular.forEach(['GET', 'DELETE', 'JSONP'], function(method) {
$httpBackend[prefix + method] = function(url, headers) {
return $httpBackend[prefix](method, url, undefined, headers)
}
});
angular.forEach(['PUT', 'POST', 'PATCH'], function(method) {
$httpBackend[prefix + method] = function(url, data, headers) {
return $httpBackend[prefix](method, url, data, headers)
}
});
}
}
function MockHttpExpectation(method, url, data, headers) {
this.data = data;
this.headers = headers;
this.match = function(m, u, d, h) {
if (method != m) return false;
if (!this.matchUrl(u)) return false;
if (angular.isDefined(d) && !this.matchData(d)) return false;
if (angular.isDefined(h) && !this.matchHeaders(h)) return false;
return true;
};
this.matchUrl = function(u) {
if (!url) return true;
if (angular.isFunction(url.test)) return url.test(u);
return url == u;
};
this.matchHeaders = function(h) {
if (angular.isUndefined(headers)) return true;
if (angular.isFunction(headers)) return headers(h);
return angular.equals(headers, h);
};
this.matchData = function(d) {
if (angular.isUndefined(data)) return true;
if (data && angular.isFunction(data.test)) return data.test(d);
if (data && angular.isFunction(data)) return data(d);
if (data && !angular.isString(data)) return angular.toJson(data) == d;
return data == d;
};
this.toString = function() {
return method + ' ' + url;
};
}
function MockXhr() {
// hack for testing $http, $httpBackend
MockXhr.$$lastInstance = this;
this.open = function(method, url, async) {
this.$$method = method;
this.$$url = url;
this.$$async = async;
this.$$reqHeaders = {};
this.$$respHeaders = {};
};
this.send = function(data) {
this.$$data = data;
};
this.setRequestHeader = function(key, value) {
this.$$reqHeaders[key] = value;
};
this.getResponseHeader = function(name) {
// the lookup must be case insensitive, that's why we try two quick lookups and full scan at last
var header = this.$$respHeaders[name];
if (header) return header;
name = angular.lowercase(name);
header = this.$$respHeaders[name];
if (header) return header;
header = undefined;
angular.forEach(this.$$respHeaders, function(headerVal, headerName) {
if (!header && angular.lowercase(headerName) == name) header = headerVal;
});
return header;
};
this.getAllResponseHeaders = function() {
var lines = [];
angular.forEach(this.$$respHeaders, function(value, key) {
lines.push(key + ': ' + value);
});
return lines.join('\n');
};
this.abort = angular.noop;
}
/**
* @ngdoc function
* @name ngMock.$timeout
* @description
*
* This service is just a simple decorator for {@link ng.$timeout $timeout} service
* that adds a "flush" and "verifyNoPendingTasks" methods.
*/
angular.mock.$TimeoutDecorator = function($delegate, $browser) {
/**
* @ngdoc method
* @name ngMock.$timeout#flush
* @methodOf ngMock.$timeout
* @description
*
* Flushes the queue of pending tasks.
*
* @param {number=} delay maximum timeout amount to flush up until
*/
$delegate.flush = function(delay) {
$browser.defer.flush(delay);
};
/**
* @ngdoc method
* @name ngMock.$timeout#flushNext
* @methodOf ngMock.$timeout
* @description
*
* Flushes the next timeout in the queue and compares it to the provided delay
*
* @param {number=} expectedDelay the delay value that will be asserted against the delay of the next timeout function
*/
$delegate.flushNext = function(expectedDelay) {
$browser.defer.flushNext(expectedDelay);
};
/**
* @ngdoc method
* @name ngMock.$timeout#verifyNoPendingTasks
* @methodOf ngMock.$timeout
* @description
*
* Verifies that there are no pending tasks that need to be flushed.
*/
$delegate.verifyNoPendingTasks = function() {
if ($browser.deferredFns.length) {
throw new Error('Deferred tasks to flush (' + $browser.deferredFns.length + '): ' +
formatPendingTasksAsString($browser.deferredFns));
}
};
function formatPendingTasksAsString(tasks) {
var result = [];
angular.forEach(tasks, function(task) {
result.push('{id: ' + task.id + ', ' + 'time: ' + task.time + '}');
});
return result.join(', ');
}
return $delegate;
};
/**
*
*/
angular.mock.$RootElementProvider = function() {
this.$get = function() {
return angular.element('<div ng-app></div>');
}
};
/**
* @ngdoc overview
* @name ngMock
* @description
*
* The `ngMock` is an angular module which is used with `ng` module and adds unit-test configuration as well as useful
* mocks to the {@link AUTO.$injector $injector}.
*/
angular.module('ngMock', ['ng']).provider({
$browser: angular.mock.$BrowserProvider,
$exceptionHandler: angular.mock.$ExceptionHandlerProvider,
$log: angular.mock.$LogProvider,
$interval: angular.mock.$IntervalProvider,
$httpBackend: angular.mock.$HttpBackendProvider,
$rootElement: angular.mock.$RootElementProvider
}).config(function($provide) {
$provide.decorator('$timeout', angular.mock.$TimeoutDecorator);
});
/**
* @ngdoc overview
* @name ngMockE2E
* @description
*
* The `ngMockE2E` is an angular module which contains mocks suitable for end-to-end testing.
* Currently there is only one mock present in this module -
* the {@link ngMockE2E.$httpBackend e2e $httpBackend} mock.
*/
angular.module('ngMockE2E', ['ng']).config(function($provide) {
$provide.decorator('$httpBackend', angular.mock.e2e.$httpBackendDecorator);
});
/**
* @ngdoc object
* @name ngMockE2E.$httpBackend
* @description
* Fake HTTP backend implementation suitable for end-to-end testing or backend-less development of
* applications that use the {@link ng.$http $http service}.
*
* *Note*: For fake http backend implementation suitable for unit testing please see
* {@link ngMock.$httpBackend unit-testing $httpBackend mock}.
*
* This implementation can be used to respond with static or dynamic responses via the `when` api
* and its shortcuts (`whenGET`, `whenPOST`, etc) and optionally pass through requests to the
* real $httpBackend for specific requests (e.g. to interact with certain remote apis or to fetch
* templates from a webserver).
*
* As opposed to unit-testing, in an end-to-end testing scenario or in scenario when an application
* is being developed with the real backend api replaced with a mock, it is often desirable for
* certain category of requests to bypass the mock and issue a real http request (e.g. to fetch
* templates or static files from the webserver). To configure the backend with this behavior
* use the `passThrough` request handler of `when` instead of `respond`.
*
* Additionally, we don't want to manually have to flush mocked out requests like we do during unit
* testing. For this reason the e2e $httpBackend automatically flushes mocked out requests
* automatically, closely simulating the behavior of the XMLHttpRequest object.
*
* To setup the application to run with this http backend, you have to create a module that depends
* on the `ngMockE2E` and your application modules and defines the fake backend:
*
* <pre>
* myAppDev = angular.module('myAppDev', ['myApp', 'ngMockE2E']);
* myAppDev.run(function($httpBackend) {
* phones = [{name: 'phone1'}, {name: 'phone2'}];
*
* // returns the current list of phones
* $httpBackend.whenGET('/phones').respond(phones);
*
* // adds a new phone to the phones array
* $httpBackend.whenPOST('/phones').respond(function(method, url, data) {
* phones.push(angular.fromJson(data));
* });
* $httpBackend.whenGET(/^\/templates\//).passThrough();
* //...
* });
* </pre>
*
* Afterwards, bootstrap your app with this new module.
*/
/**
* @ngdoc method
* @name ngMockE2E.$httpBackend#when
* @methodOf ngMockE2E.$httpBackend
* @description
* Creates a new backend definition.
*
* @param {string} method HTTP method.
* @param {string|RegExp} url HTTP url.
* @param {(string|RegExp)=} data HTTP request body.
* @param {(Object|function(Object))=} headers HTTP headers or function that receives http header
* object and returns true if the headers match the current definition.
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
* control how a matched request is handled.
*
* - respond – `{function([status,] data[, headers])|function(function(method, url, data, headers)}`
* – The respond method takes a set of static data to be returned or a function that can return
* an array containing response status (number), response data (string) and response headers
* (Object).
* - passThrough – `{function()}` – Any request matching a backend definition with `passThrough`
* handler, will be pass through to the real backend (an XHR request will be made to the
* server.
*/
/**
* @ngdoc method
* @name ngMockE2E.$httpBackend#whenGET
* @methodOf ngMockE2E.$httpBackend
* @description
* Creates a new backend definition for GET requests. For more info see `when()`.
*
* @param {string|RegExp} url HTTP url.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
* control how a matched request is handled.
*/
/**
* @ngdoc method
* @name ngMockE2E.$httpBackend#whenHEAD
* @methodOf ngMockE2E.$httpBackend
* @description
* Creates a new backend definition for HEAD requests. For more info see `when()`.
*
* @param {string|RegExp} url HTTP url.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
* control how a matched request is handled.
*/
/**
* @ngdoc method
* @name ngMockE2E.$httpBackend#whenDELETE
* @methodOf ngMockE2E.$httpBackend
* @description
* Creates a new backend definition for DELETE requests. For more info see `when()`.
*
* @param {string|RegExp} url HTTP url.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
* control how a matched request is handled.
*/
/**
* @ngdoc method
* @name ngMockE2E.$httpBackend#whenPOST
* @methodOf ngMockE2E.$httpBackend
* @description
* Creates a new backend definition for POST requests. For more info see `when()`.
*
* @param {string|RegExp} url HTTP url.
* @param {(string|RegExp)=} data HTTP request body.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
* control how a matched request is handled.
*/
/**
* @ngdoc method
* @name ngMockE2E.$httpBackend#whenPUT
* @methodOf ngMockE2E.$httpBackend
* @description
* Creates a new backend definition for PUT requests. For more info see `when()`.
*
* @param {string|RegExp} url HTTP url.
* @param {(string|RegExp)=} data HTTP request body.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
* control how a matched request is handled.
*/
/**
* @ngdoc method
* @name ngMockE2E.$httpBackend#whenPATCH
* @methodOf ngMockE2E.$httpBackend
* @description
* Creates a new backend definition for PATCH requests. For more info see `when()`.
*
* @param {string|RegExp} url HTTP url.
* @param {(string|RegExp)=} data HTTP request body.
* @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
* control how a matched request is handled.
*/
/**
* @ngdoc method
* @name ngMockE2E.$httpBackend#whenJSONP
* @methodOf ngMockE2E.$httpBackend
* @description
* Creates a new backend definition for JSONP requests. For more info see `when()`.
*
* @param {string|RegExp} url HTTP url.
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
* control how a matched request is handled.
*/
angular.mock.e2e = {};
angular.mock.e2e.$httpBackendDecorator = ['$rootScope', '$delegate', '$browser', createHttpBackendMock];
angular.mock.clearDataCache = function() {
var key,
cache = angular.element.cache;
for(key in cache) {
if (Object.prototype.hasOwnProperty.call(cache,key)) {
var handle = cache[key].handle;
handle && angular.element(handle.elem).off();
delete cache[key];
}
}
};
(window.jasmine || window.mocha) && (function(window) {
var currentSpec = null;
beforeEach(function() {
currentSpec = this;
});
afterEach(function() {
var injector = currentSpec.$injector;
currentSpec.$injector = null;
currentSpec.$modules = null;
currentSpec = null;
if (injector) {
injector.get('$rootElement').off();
injector.get('$browser').pollFns.length = 0;
}
angular.mock.clearDataCache();
// clean up jquery's fragment cache
angular.forEach(angular.element.fragments, function(val, key) {
delete angular.element.fragments[key];
});
MockXhr.$$lastInstance = null;
angular.forEach(angular.callbacks, function(val, key) {
delete angular.callbacks[key];
});
angular.callbacks.counter = 0;
});
function isSpecRunning() {
return currentSpec && (window.mocha || currentSpec.queue.running);
}
/**
* @ngdoc function
* @name angular.mock.module
* @description
*
* *NOTE*: This function is also published on window for easy access.<br>
*
* This function registers a module configuration code. It collects the configuration information
* which will be used when the injector is created by {@link angular.mock.inject inject}.
*
* See {@link angular.mock.inject inject} for usage example
*
* @param {...(string|Function|Object)} fns any number of modules which are represented as string
* aliases or as anonymous module initialization functions. The modules are used to
* configure the injector. The 'ng' and 'ngMock' modules are automatically loaded. If an
* object literal is passed they will be register as values in the module, the key being
* the module name and the value being what is returned.
*/
window.module = angular.mock.module = function() {
var moduleFns = Array.prototype.slice.call(arguments, 0);
return isSpecRunning() ? workFn() : workFn;
/////////////////////
function workFn() {
if (currentSpec.$injector) {
throw Error('Injector already created, can not register a module!');
} else {
var modules = currentSpec.$modules || (currentSpec.$modules = []);
angular.forEach(moduleFns, function(module) {
if (angular.isObject(module) && !angular.isArray(module)) {
modules.push(function($provide) {
angular.forEach(module, function(value, key) {
$provide.value(key, value);
});
});
} else {
modules.push(module);
}
});
}
}
};
/**
* @ngdoc function
* @name angular.mock.inject
* @description
*
* *NOTE*: This function is also published on window for easy access.<br>
*
* The inject function wraps a function into an injectable function. The inject() creates new
* instance of {@link AUTO.$injector $injector} per test, which is then used for
* resolving references.
*
*
* ## Resolving References (Underscore Wrapping)
* Often, we would like to inject a reference once, in a `beforeEach()` block and reuse this
* in multiple `it()` clauses. To be able to do this we must assign the reference to a variable
* that is declared in the scope of the `describe()` block. Since we would, most likely, want
* the variable to have the same name of the reference we have a problem, since the parameter
* to the `inject()` function would hide the outer variable.
*
* To help with this, the injected parameters can, optionally, be enclosed with underscores.
* These are ignored by the injector when the reference name is resolved.
*
* For example, the parameter `_myService_` would be resolved as the reference `myService`.
* Since it is available in the function body as _myService_, we can then assign it to a variable
* defined in an outer scope.
*
* ```
* // Defined out reference variable outside
* var myService;
*
* // Wrap the parameter in underscores
* beforeEach( inject( function(_myService_){
* myService = _myService_;
* }));
*
* // Use myService in a series of tests.
* it('makes use of myService', function() {
* myService.doStuff();
* });
*
* ```
*
* See also {@link angular.mock.module angular.mock.module}
*
* ## Example
* Example of what a typical jasmine tests looks like with the inject method.
* <pre>
*
* angular.module('myApplicationModule', [])
* .value('mode', 'app')
* .value('version', 'v1.0.1');
*
*
* describe('MyApp', function() {
*
* // You need to load modules that you want to test,
* // it loads only the "ng" module by default.
* beforeEach(module('myApplicationModule'));
*
*
* // inject() is used to inject arguments of all given functions
* it('should provide a version', inject(function(mode, version) {
* expect(version).toEqual('v1.0.1');
* expect(mode).toEqual('app');
* }));
*
*
* // The inject and module method can also be used inside of the it or beforeEach
* it('should override a version and test the new version is injected', function() {
* // module() takes functions or strings (module aliases)
* module(function($provide) {
* $provide.value('version', 'overridden'); // override version here
* });
*
* inject(function(version) {
* expect(version).toEqual('overridden');
* });
* });
* });
*
* </pre>
*
* @param {...Function} fns any number of functions which will be injected using the injector.
*/
window.inject = angular.mock.inject = function() {
var blockFns = Array.prototype.slice.call(arguments, 0);
var errorForStack = new Error('Declaration Location');
return isSpecRunning() ? workFn() : workFn;
/////////////////////
function workFn() {
var modules = currentSpec.$modules || [];
modules.unshift('ngMock');
modules.unshift('ng');
var injector = currentSpec.$injector;
if (!injector) {
injector = currentSpec.$injector = angular.injector(modules);
}
for(var i = 0, ii = blockFns.length; i < ii; i++) {
try {
injector.invoke(blockFns[i] || angular.noop, this);
} catch (e) {
if(e.stack && errorForStack) e.stack += '\n' + errorForStack.stack;
throw e;
} finally {
errorForStack = null;
}
}
}
};
})(window);
|
tonytlwu/cdnjs
|
ajax/libs/angular.js/1.2.0rc3/angular-mocks.js
|
JavaScript
|
mit
| 67,014 |
if (typeof _yuitest_coverage == "undefined"){
_yuitest_coverage = {};
_yuitest_coverline = function(src, line){
var coverage = _yuitest_coverage[src];
if (!coverage.lines[line]){
coverage.calledLines++;
}
coverage.lines[line]++;
};
_yuitest_coverfunc = function(src, name, line){
var coverage = _yuitest_coverage[src],
funcId = name + ":" + line;
if (!coverage.functions[funcId]){
coverage.calledFunctions++;
}
coverage.functions[funcId]++;
};
}
_yuitest_coverage["build/uploader-queue/uploader-queue.js"] = {
lines: {},
functions: {},
coveredLines: 0,
calledLines: 0,
coveredFunctions: 0,
calledFunctions: 0,
path: "build/uploader-queue/uploader-queue.js",
code: []
};
_yuitest_coverage["build/uploader-queue/uploader-queue.js"].code=["YUI.add('uploader-queue', function (Y, NAME) {","","/**","* The class manages a queue of files that should be uploaded to the server.","* It initializes the required number of uploads, tracks them as they progress,","* and automatically advances to the next upload when a preceding one has completed.","* @module uploader-queue","*/","","","","/**","* This class manages a queue of files to be uploaded to the server.","* @class Uploader.Queue","* @extends Base","* @constructor","*/","var UploaderQueue = function() {"," this.queuedFiles = [];"," this.uploadRetries = {};"," this.numberOfUploads = 0;"," this.currentUploadedByteValues = {};"," this.currentFiles = {};"," this.totalBytesUploaded = 0;"," this.totalBytes = 0;",""," UploaderQueue.superclass.constructor.apply(this, arguments);","};","","","Y.extend(UploaderQueue, Y.Base, {",""," /**"," * Stored value of the current queue state"," * @property _currentState"," * @type {String}"," * @protected"," * @default UploaderQueue.STOPPED"," */"," _currentState: UploaderQueue.STOPPED,",""," /**"," * Construction logic executed during UploaderQueue instantiation."," *"," * @method initializer"," * @protected"," */"," initializer : function () {},",""," /**"," * Handles and retransmits upload start event."," *"," * @method _uploadStartHandler"," * @param event The event dispatched during the upload process."," * @private"," */"," _uploadStartHandler : function (event) {"," var updatedEvent = event;"," updatedEvent.file = event.target;"," updatedEvent.originEvent = event;",""," this.fire(\"uploadstart\", updatedEvent);"," },",""," /**"," * Handles and retransmits upload error event."," *"," * @method _uploadErrorHandler"," * @param event The event dispatched during the upload process."," * @private"," */"," _uploadErrorHandler : function (event) {"," var errorAction = this.get(\"errorAction\"),"," updatedEvent = event,"," fileid,"," retries;",""," updatedEvent.file = event.target;"," updatedEvent.originEvent = event;",""," this.numberOfUploads-=1;"," delete this.currentFiles[event.target.get(\"id\")];"," this._detachFileEvents(event.target);",""," event.target.cancelUpload();",""," if (errorAction === UploaderQueue.STOP) {"," this.pauseUpload();"," }",""," else if (errorAction === UploaderQueue.RESTART_ASAP) {"," fileid = event.target.get(\"id\");"," retries = this.uploadRetries[fileid] || 0;",""," if (retries < this.get(\"retryCount\")) {"," this.uploadRetries[fileid] = retries + 1;"," this.addToQueueTop(event.target);"," }"," this._startNextFile();"," }"," else if (errorAction === UploaderQueue.RESTART_AFTER) {"," fileid = event.target.get(\"id\");"," retries = this.uploadRetries[fileid] || 0;",""," if (retries < this.get(\"retryCount\")) {"," this.uploadRetries[fileid] = retries + 1;"," this.addToQueueBottom(event.target);"," }"," this._startNextFile();"," }",""," this.fire(\"uploaderror\", updatedEvent);"," },",""," /**"," * Launches the upload of the next file in the queue."," *"," * @method _startNextFile"," * @private"," */"," _startNextFile : function () {"," if (this.queuedFiles.length > 0) {"," var currentFile = this.queuedFiles.shift(),"," fileId = currentFile.get(\"id\"),"," parameters = this.get(\"perFileParameters\"),"," fileParameters = parameters.hasOwnProperty(fileId) ? parameters[fileId] : parameters;",""," this.currentUploadedByteValues[fileId] = 0;",""," currentFile.on(\"uploadstart\", this._uploadStartHandler, this);"," currentFile.on(\"uploadprogress\", this._uploadProgressHandler, this);"," currentFile.on(\"uploadcomplete\", this._uploadCompleteHandler, this);"," currentFile.on(\"uploaderror\", this._uploadErrorHandler, this);"," currentFile.on(\"uploadcancel\", this._uploadCancelHandler, this);",""," currentFile.set(\"xhrHeaders\", this.get(\"uploadHeaders\"));"," currentFile.set(\"xhrWithCredentials\", this.get(\"withCredentials\"));",""," currentFile.startUpload(this.get(\"uploadURL\"), fileParameters, this.get(\"fileFieldName\"));",""," this._registerUpload(currentFile);"," }"," },",""," /**"," * Register a new upload process."," *"," * @method _registerUpload"," * @private"," */"," _registerUpload : function (file) {"," this.numberOfUploads += 1;"," this.currentFiles[file.get(\"id\")] = file;"," },",""," /**"," * Unregisters a new upload process."," *"," * @method _unregisterUpload"," * @private"," */"," _unregisterUpload : function (file) {"," if (this.numberOfUploads > 0) {"," this.numberOfUploads -= 1;"," }",""," delete this.currentFiles[file.get(\"id\")];"," delete this.uploadRetries[file.get(\"id\")];",""," this._detachFileEvents(file);"," },",""," _detachFileEvents : function (file) {"," file.detach(\"uploadstart\", this._uploadStartHandler);"," file.detach(\"uploadprogress\", this._uploadProgressHandler);"," file.detach(\"uploadcomplete\", this._uploadCompleteHandler);"," file.detach(\"uploaderror\", this._uploadErrorHandler);"," file.detach(\"uploadcancel\", this._uploadCancelHandler);"," },",""," /**"," * Handles and retransmits upload complete event."," *"," * @method _uploadCompleteHandler"," * @param event The event dispatched during the upload process."," * @private"," */"," _uploadCompleteHandler : function (event) {",""," this._unregisterUpload(event.target);",""," this.totalBytesUploaded += event.target.get(\"size\");"," delete this.currentUploadedByteValues[event.target.get(\"id\")];","",""," if (this.queuedFiles.length > 0 && this._currentState === UploaderQueue.UPLOADING) {"," this._startNextFile();"," }",""," var updatedEvent = event,"," uploadedTotal = this.totalBytesUploaded,"," percentLoaded = Math.min(100, Math.round(10000*uploadedTotal/this.totalBytes) / 100);",""," updatedEvent.file = event.target;"," updatedEvent.originEvent = event;",""," Y.each(this.currentUploadedByteValues, function (value) {"," uploadedTotal += value;"," });",""," this.fire(\"totaluploadprogress\", {"," bytesLoaded: uploadedTotal,"," bytesTotal: this.totalBytes,"," percentLoaded: percentLoaded"," });",""," this.fire(\"uploadcomplete\", updatedEvent);",""," if (this.queuedFiles.length === 0 && this.numberOfUploads <= 0) {"," this.fire(\"alluploadscomplete\");"," this._currentState = UploaderQueue.STOPPED;"," }"," },",""," /**"," * Handles and retransmits upload cancel event."," *"," * @method _uploadCancelHandler"," * @param event The event dispatched during the upload process."," * @private"," */"," _uploadCancelHandler : function (event) {",""," var updatedEvent = event;"," updatedEvent.originEvent = event;"," updatedEvent.file = event.target;",""," this.fire(\"uploadcacel\", updatedEvent);"," },","","",""," /**"," * Handles and retransmits upload progress event."," *"," * @method _uploadProgressHandler"," * @param event The event dispatched during the upload process."," * @private"," */"," _uploadProgressHandler : function (event) {",""," this.currentUploadedByteValues[event.target.get(\"id\")] = event.bytesLoaded;",""," var updatedEvent = event,"," uploadedTotal = this.totalBytesUploaded,"," percentLoaded = Math.min(100, Math.round(10000*uploadedTotal/this.totalBytes) / 100);",""," updatedEvent.originEvent = event;"," updatedEvent.file = event.target;",""," this.fire(\"uploadprogress\", updatedEvent);",""," Y.each(this.currentUploadedByteValues, function (value) {"," uploadedTotal += value;"," });",""," this.fire(\"totaluploadprogress\", {"," bytesLoaded: uploadedTotal,"," bytesTotal: this.totalBytes,"," percentLoaded: percentLoaded"," });"," },",""," /**"," * Starts uploading the queued up file list."," *"," * @method startUpload"," */"," startUpload: function() {"," this.queuedFiles = this.get(\"fileList\").slice(0);"," this.numberOfUploads = 0;"," this.currentUploadedByteValues = {};"," this.currentFiles = {};"," this.totalBytesUploaded = 0;",""," this._currentState = UploaderQueue.UPLOADING;",""," while (this.numberOfUploads < this.get(\"simUploads\") && this.queuedFiles.length > 0) {"," this._startNextFile();"," }"," },",""," /**"," * Pauses the upload process. The ongoing file uploads"," * will complete after this method is called, but no"," * new ones will be launched."," *"," * @method pauseUpload"," */"," pauseUpload: function () {"," this._currentState = UploaderQueue.STOPPED;"," },",""," /**"," * Restarts a paused upload process."," *"," * @method restartUpload"," */"," restartUpload: function () {"," this._currentState = UploaderQueue.UPLOADING;"," while (this.numberOfUploads < this.get(\"simUploads\")) {"," this._startNextFile();"," }"," },",""," /**"," * If a particular file is stuck in an ongoing upload without"," * any progress events, this method allows to force its reupload"," * by cancelling its upload and immediately relaunching it."," *"," * @method forceReupload"," * @param file {Y.File} The file to force reupload on."," */"," forceReupload : function (file) {"," var id = file.get(\"id\");"," if (this.currentFiles.hasOwnProperty(id)) {"," file.cancelUpload();"," this._unregisterUpload(file);"," this.addToQueueTop(file);"," this._startNextFile();"," }"," },",""," /**"," * Add a new file to the top of the queue (the upload will be"," * launched as soon as the current number of uploading files"," * drops below the maximum permissible value)."," *"," * @method addToQueueTop"," * @param file {Y.File} The file to add to the top of the queue."," */"," addToQueueTop: function (file) {"," this.queuedFiles.unshift(file);"," },",""," /**"," * Add a new file to the bottom of the queue (the upload will be"," * launched after all the other queued files are uploaded.)"," *"," * @method addToQueueBottom"," * @param file {Y.File} The file to add to the bottom of the queue."," */"," addToQueueBottom: function (file) {"," this.queuedFiles.push(file);"," },",""," /**"," * Cancels a specific file's upload. If no argument is passed,"," * all ongoing uploads are cancelled and the upload process is"," * stopped."," *"," * @method cancelUpload"," * @param file {Y.File} An optional parameter - the file whose upload"," * should be cancelled."," */"," cancelUpload: function (file) {"," var id,"," i,"," fid;",""," if (file) {"," id = file.get(\"id\");",""," if (this.currentFiles[id]) {"," this.currentFiles[id].cancelUpload();"," this._unregisterUpload(this.currentFiles[id]);"," if (this._currentState === UploaderQueue.UPLOADING) {"," this._startNextFile();"," }"," }"," else {"," for (i = 0, len = this.queuedFiles.length; i < len; i++) {"," if (this.queuedFiles[i].get(\"id\") === id) {"," this.queuedFiles.splice(i, 1);"," break;"," }"," }"," }"," }"," else {"," for (fid in this.currentFiles) {"," this.currentFiles[fid].cancelUpload();"," this._unregisterUpload(this.currentFiles[fid]);"," }",""," this.currentUploadedByteValues = {};"," this.currentFiles = {};"," this.totalBytesUploaded = 0;"," this.fire(\"alluploadscancelled\");"," this._currentState = UploaderQueue.STOPPED;"," }"," }","}, {"," /**"," * Static constant for the value of the `errorAction` attribute:"," * prescribes the queue to continue uploading files in case of"," * an error."," * @property CONTINUE"," * @readOnly"," * @type {String}"," * @static"," */"," CONTINUE: \"continue\",",""," /**"," * Static constant for the value of the `errorAction` attribute:"," * prescribes the queue to stop uploading files in case of"," * an error."," * @property STOP"," * @readOnly"," * @type {String}"," * @static"," */"," STOP: \"stop\",",""," /**"," * Static constant for the value of the `errorAction` attribute:"," * prescribes the queue to restart a file upload immediately in case of"," * an error."," * @property RESTART_ASAP"," * @readOnly"," * @type {String}"," * @static"," */"," RESTART_ASAP: \"restartasap\",",""," /**"," * Static constant for the value of the `errorAction` attribute:"," * prescribes the queue to restart an errored out file upload after"," * other files have finished uploading."," * @property RESTART_AFTER"," * @readOnly"," * @type {String}"," * @static"," */"," RESTART_AFTER: \"restartafter\",",""," /**"," * Static constant for the value of the `_currentState` property:"," * implies that the queue is currently not uploading files."," * @property STOPPED"," * @readOnly"," * @type {String}"," * @static"," */"," STOPPED: \"stopped\",",""," /**"," * Static constant for the value of the `_currentState` property:"," * implies that the queue is currently uploading files."," * @property UPLOADING"," * @readOnly"," * @type {String}"," * @static"," */"," UPLOADING: \"uploading\",",""," /**"," * The identity of the class."," *"," * @property NAME"," * @type String"," * @default 'uploaderqueue'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'uploaderqueue',",""," /**"," * Static property used to define the default attribute configuration of"," * the class."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {",""," /**"," * Maximum number of simultaneous uploads; must be in the"," * range between 1 and 5. The value of `2` is default. It"," * is recommended that this value does not exceed 3."," * @attribute simUploads"," * @type Number"," * @default 2"," */"," simUploads: {"," value: 2,"," validator: function (val) {"," return (val >= 1 && val <= 5);"," }"," },",""," /**"," * The action to take in case of error. The valid values for this attribute are:"," * `Y.Uploader.Queue.CONTINUE` (the upload process should continue on other files,"," * ignoring the error), `Y.Uploader.Queue.STOP` (the upload process"," * should stop completely), `Y.Uploader.Queue.RESTART_ASAP` (the upload"," * should restart immediately on the errored out file and continue as planned), or"," * Y.Uploader.Queue.RESTART_AFTER (the upload of the errored out file should restart"," * after all other files have uploaded)"," * @attribute errorAction"," * @type String"," * @default Y.Uploader.Queue.CONTINUE"," */"," errorAction: {"," value: \"continue\","," validator: function (val) {"," return ("," val === UploaderQueue.CONTINUE ||"," val === UploaderQueue.STOP ||"," val === UploaderQueue.RESTART_ASAP ||"," val === UploaderQueue.RESTART_AFTER"," );"," }"," },",""," /**"," * The total number of bytes that has been uploaded."," * @attribute bytesUploaded"," * @type Number"," */"," bytesUploaded: {"," readOnly: true,"," value: 0"," },",""," /**"," * The total number of bytes in the queue."," * @attribute bytesTotal"," * @type Number"," */"," bytesTotal: {"," readOnly: true,"," value: 0"," },",""," /**"," * The queue file list. This file list should only be modified"," * before the upload has been started; modifying it after starting"," * the upload has no effect, and `addToQueueTop` or `addToQueueBottom` methods"," * should be used instead."," * @attribute fileList"," * @type Array"," */"," fileList: {"," value: [],"," lazyAdd: false,"," setter: function (val) {"," var newValue = val;"," Y.Array.each(newValue, function (value) {"," this.totalBytes += value.get(\"size\");"," }, this);",""," return val;"," }"," },",""," /**"," * A String specifying what should be the POST field name for the file"," * content in the upload request."," *"," * @attribute fileFieldName"," * @type {String}"," * @default Filedata"," */"," fileFieldName: {"," value: \"Filedata\""," },",""," /**"," * The URL to POST the file upload requests to."," *"," * @attribute uploadURL"," * @type {String}"," * @default \"\""," */"," uploadURL: {"," value: \"\""," },",""," /**"," * Additional HTTP headers that should be included"," * in the upload request. Due to Flash Player security"," * restrictions, this attribute is only honored in the"," * HTML5 Uploader."," *"," * @attribute uploadHeaders"," * @type {Object}"," * @default {}"," */"," uploadHeaders: {"," value: {}"," },",""," /**"," * A Boolean that specifies whether the file should be"," * uploaded with the appropriate user credentials for the"," * domain. Due to Flash Player security restrictions, this"," * attribute is only honored in the HTML5 Uploader."," *"," * @attribute withCredentials"," * @type {Boolean}"," * @default true"," */"," withCredentials: {"," value: true"," },","",""," /**"," * An object, keyed by `fileId`, containing sets of key-value pairs"," * that should be passed as POST variables along with each corresponding"," * file."," *"," * @attribute perFileParameters"," * @type {Object}"," * @default {}"," */"," perFileParameters: {"," value: {}"," },",""," /**"," * The number of times to try re-uploading a file that failed to upload before"," * cancelling its upload."," *"," * @attribute retryCount"," * @type {Number}"," * @default 3"," */"," retryCount: {"," value: 3"," }",""," }","});","","","Y.namespace('Uploader');","Y.Uploader.Queue = UploaderQueue;","","","}, '@VERSION@', {\"requires\": [\"base\"]});"];
_yuitest_coverage["build/uploader-queue/uploader-queue.js"].lines = {"1":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"27":0,"31":0,"58":0,"59":0,"60":0,"62":0,"73":0,"78":0,"79":0,"81":0,"82":0,"83":0,"85":0,"87":0,"88":0,"91":0,"92":0,"93":0,"95":0,"96":0,"97":0,"99":0,"101":0,"102":0,"103":0,"105":0,"106":0,"107":0,"109":0,"112":0,"122":0,"123":0,"128":0,"130":0,"131":0,"132":0,"133":0,"134":0,"136":0,"137":0,"139":0,"141":0,"152":0,"153":0,"163":0,"164":0,"167":0,"168":0,"170":0,"174":0,"175":0,"176":0,"177":0,"178":0,"190":0,"192":0,"193":0,"196":0,"197":0,"200":0,"204":0,"205":0,"207":0,"208":0,"211":0,"217":0,"219":0,"220":0,"221":0,"234":0,"235":0,"236":0,"238":0,"252":0,"254":0,"258":0,"259":0,"261":0,"263":0,"264":0,"267":0,"280":0,"281":0,"282":0,"283":0,"284":0,"286":0,"288":0,"289":0,"301":0,"310":0,"311":0,"312":0,"325":0,"326":0,"327":0,"328":0,"329":0,"330":0,"343":0,"354":0,"367":0,"371":0,"372":0,"374":0,"375":0,"376":0,"377":0,"378":0,"382":0,"383":0,"384":0,"385":0,"391":0,"392":0,"393":0,"396":0,"397":0,"398":0,"399":0,"400":0,"502":0,"521":0,"562":0,"563":0,"564":0,"567":0,"652":0,"653":0};
_yuitest_coverage["build/uploader-queue/uploader-queue.js"].functions = {"UploaderQueue:18":0,"_uploadStartHandler:57":0,"_uploadErrorHandler:72":0,"_startNextFile:121":0,"_registerUpload:151":0,"_unregisterUpload:162":0,"_detachFileEvents:173":0,"(anonymous 2):207":0,"_uploadCompleteHandler:188":0,"_uploadCancelHandler:232":0,"(anonymous 3):263":0,"_uploadProgressHandler:250":0,"startUpload:279":0,"pauseUpload:300":0,"restartUpload:309":0,"forceReupload:324":0,"addToQueueTop:342":0,"addToQueueBottom:353":0,"cancelUpload:366":0,"validator:501":0,"validator:520":0,"(anonymous 4):563":0,"setter:561":0,"(anonymous 1):1":0};
_yuitest_coverage["build/uploader-queue/uploader-queue.js"].coveredLines = 138;
_yuitest_coverage["build/uploader-queue/uploader-queue.js"].coveredFunctions = 24;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 1);
YUI.add('uploader-queue', function (Y, NAME) {
/**
* The class manages a queue of files that should be uploaded to the server.
* It initializes the required number of uploads, tracks them as they progress,
* and automatically advances to the next upload when a preceding one has completed.
* @module uploader-queue
*/
/**
* This class manages a queue of files to be uploaded to the server.
* @class Uploader.Queue
* @extends Base
* @constructor
*/
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "(anonymous 1)", 1);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 18);
var UploaderQueue = function() {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "UploaderQueue", 18);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 19);
this.queuedFiles = [];
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 20);
this.uploadRetries = {};
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 21);
this.numberOfUploads = 0;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 22);
this.currentUploadedByteValues = {};
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 23);
this.currentFiles = {};
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 24);
this.totalBytesUploaded = 0;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 25);
this.totalBytes = 0;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 27);
UploaderQueue.superclass.constructor.apply(this, arguments);
};
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 31);
Y.extend(UploaderQueue, Y.Base, {
/**
* Stored value of the current queue state
* @property _currentState
* @type {String}
* @protected
* @default UploaderQueue.STOPPED
*/
_currentState: UploaderQueue.STOPPED,
/**
* Construction logic executed during UploaderQueue instantiation.
*
* @method initializer
* @protected
*/
initializer : function () {},
/**
* Handles and retransmits upload start event.
*
* @method _uploadStartHandler
* @param event The event dispatched during the upload process.
* @private
*/
_uploadStartHandler : function (event) {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "_uploadStartHandler", 57);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 58);
var updatedEvent = event;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 59);
updatedEvent.file = event.target;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 60);
updatedEvent.originEvent = event;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 62);
this.fire("uploadstart", updatedEvent);
},
/**
* Handles and retransmits upload error event.
*
* @method _uploadErrorHandler
* @param event The event dispatched during the upload process.
* @private
*/
_uploadErrorHandler : function (event) {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "_uploadErrorHandler", 72);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 73);
var errorAction = this.get("errorAction"),
updatedEvent = event,
fileid,
retries;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 78);
updatedEvent.file = event.target;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 79);
updatedEvent.originEvent = event;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 81);
this.numberOfUploads-=1;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 82);
delete this.currentFiles[event.target.get("id")];
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 83);
this._detachFileEvents(event.target);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 85);
event.target.cancelUpload();
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 87);
if (errorAction === UploaderQueue.STOP) {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 88);
this.pauseUpload();
}
else {_yuitest_coverline("build/uploader-queue/uploader-queue.js", 91);
if (errorAction === UploaderQueue.RESTART_ASAP) {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 92);
fileid = event.target.get("id");
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 93);
retries = this.uploadRetries[fileid] || 0;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 95);
if (retries < this.get("retryCount")) {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 96);
this.uploadRetries[fileid] = retries + 1;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 97);
this.addToQueueTop(event.target);
}
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 99);
this._startNextFile();
}
else {_yuitest_coverline("build/uploader-queue/uploader-queue.js", 101);
if (errorAction === UploaderQueue.RESTART_AFTER) {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 102);
fileid = event.target.get("id");
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 103);
retries = this.uploadRetries[fileid] || 0;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 105);
if (retries < this.get("retryCount")) {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 106);
this.uploadRetries[fileid] = retries + 1;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 107);
this.addToQueueBottom(event.target);
}
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 109);
this._startNextFile();
}}}
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 112);
this.fire("uploaderror", updatedEvent);
},
/**
* Launches the upload of the next file in the queue.
*
* @method _startNextFile
* @private
*/
_startNextFile : function () {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "_startNextFile", 121);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 122);
if (this.queuedFiles.length > 0) {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 123);
var currentFile = this.queuedFiles.shift(),
fileId = currentFile.get("id"),
parameters = this.get("perFileParameters"),
fileParameters = parameters.hasOwnProperty(fileId) ? parameters[fileId] : parameters;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 128);
this.currentUploadedByteValues[fileId] = 0;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 130);
currentFile.on("uploadstart", this._uploadStartHandler, this);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 131);
currentFile.on("uploadprogress", this._uploadProgressHandler, this);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 132);
currentFile.on("uploadcomplete", this._uploadCompleteHandler, this);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 133);
currentFile.on("uploaderror", this._uploadErrorHandler, this);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 134);
currentFile.on("uploadcancel", this._uploadCancelHandler, this);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 136);
currentFile.set("xhrHeaders", this.get("uploadHeaders"));
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 137);
currentFile.set("xhrWithCredentials", this.get("withCredentials"));
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 139);
currentFile.startUpload(this.get("uploadURL"), fileParameters, this.get("fileFieldName"));
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 141);
this._registerUpload(currentFile);
}
},
/**
* Register a new upload process.
*
* @method _registerUpload
* @private
*/
_registerUpload : function (file) {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "_registerUpload", 151);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 152);
this.numberOfUploads += 1;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 153);
this.currentFiles[file.get("id")] = file;
},
/**
* Unregisters a new upload process.
*
* @method _unregisterUpload
* @private
*/
_unregisterUpload : function (file) {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "_unregisterUpload", 162);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 163);
if (this.numberOfUploads > 0) {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 164);
this.numberOfUploads -= 1;
}
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 167);
delete this.currentFiles[file.get("id")];
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 168);
delete this.uploadRetries[file.get("id")];
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 170);
this._detachFileEvents(file);
},
_detachFileEvents : function (file) {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "_detachFileEvents", 173);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 174);
file.detach("uploadstart", this._uploadStartHandler);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 175);
file.detach("uploadprogress", this._uploadProgressHandler);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 176);
file.detach("uploadcomplete", this._uploadCompleteHandler);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 177);
file.detach("uploaderror", this._uploadErrorHandler);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 178);
file.detach("uploadcancel", this._uploadCancelHandler);
},
/**
* Handles and retransmits upload complete event.
*
* @method _uploadCompleteHandler
* @param event The event dispatched during the upload process.
* @private
*/
_uploadCompleteHandler : function (event) {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "_uploadCompleteHandler", 188);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 190);
this._unregisterUpload(event.target);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 192);
this.totalBytesUploaded += event.target.get("size");
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 193);
delete this.currentUploadedByteValues[event.target.get("id")];
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 196);
if (this.queuedFiles.length > 0 && this._currentState === UploaderQueue.UPLOADING) {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 197);
this._startNextFile();
}
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 200);
var updatedEvent = event,
uploadedTotal = this.totalBytesUploaded,
percentLoaded = Math.min(100, Math.round(10000*uploadedTotal/this.totalBytes) / 100);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 204);
updatedEvent.file = event.target;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 205);
updatedEvent.originEvent = event;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 207);
Y.each(this.currentUploadedByteValues, function (value) {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "(anonymous 2)", 207);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 208);
uploadedTotal += value;
});
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 211);
this.fire("totaluploadprogress", {
bytesLoaded: uploadedTotal,
bytesTotal: this.totalBytes,
percentLoaded: percentLoaded
});
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 217);
this.fire("uploadcomplete", updatedEvent);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 219);
if (this.queuedFiles.length === 0 && this.numberOfUploads <= 0) {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 220);
this.fire("alluploadscomplete");
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 221);
this._currentState = UploaderQueue.STOPPED;
}
},
/**
* Handles and retransmits upload cancel event.
*
* @method _uploadCancelHandler
* @param event The event dispatched during the upload process.
* @private
*/
_uploadCancelHandler : function (event) {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "_uploadCancelHandler", 232);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 234);
var updatedEvent = event;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 235);
updatedEvent.originEvent = event;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 236);
updatedEvent.file = event.target;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 238);
this.fire("uploadcacel", updatedEvent);
},
/**
* Handles and retransmits upload progress event.
*
* @method _uploadProgressHandler
* @param event The event dispatched during the upload process.
* @private
*/
_uploadProgressHandler : function (event) {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "_uploadProgressHandler", 250);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 252);
this.currentUploadedByteValues[event.target.get("id")] = event.bytesLoaded;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 254);
var updatedEvent = event,
uploadedTotal = this.totalBytesUploaded,
percentLoaded = Math.min(100, Math.round(10000*uploadedTotal/this.totalBytes) / 100);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 258);
updatedEvent.originEvent = event;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 259);
updatedEvent.file = event.target;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 261);
this.fire("uploadprogress", updatedEvent);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 263);
Y.each(this.currentUploadedByteValues, function (value) {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "(anonymous 3)", 263);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 264);
uploadedTotal += value;
});
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 267);
this.fire("totaluploadprogress", {
bytesLoaded: uploadedTotal,
bytesTotal: this.totalBytes,
percentLoaded: percentLoaded
});
},
/**
* Starts uploading the queued up file list.
*
* @method startUpload
*/
startUpload: function() {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "startUpload", 279);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 280);
this.queuedFiles = this.get("fileList").slice(0);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 281);
this.numberOfUploads = 0;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 282);
this.currentUploadedByteValues = {};
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 283);
this.currentFiles = {};
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 284);
this.totalBytesUploaded = 0;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 286);
this._currentState = UploaderQueue.UPLOADING;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 288);
while (this.numberOfUploads < this.get("simUploads") && this.queuedFiles.length > 0) {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 289);
this._startNextFile();
}
},
/**
* Pauses the upload process. The ongoing file uploads
* will complete after this method is called, but no
* new ones will be launched.
*
* @method pauseUpload
*/
pauseUpload: function () {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "pauseUpload", 300);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 301);
this._currentState = UploaderQueue.STOPPED;
},
/**
* Restarts a paused upload process.
*
* @method restartUpload
*/
restartUpload: function () {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "restartUpload", 309);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 310);
this._currentState = UploaderQueue.UPLOADING;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 311);
while (this.numberOfUploads < this.get("simUploads")) {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 312);
this._startNextFile();
}
},
/**
* If a particular file is stuck in an ongoing upload without
* any progress events, this method allows to force its reupload
* by cancelling its upload and immediately relaunching it.
*
* @method forceReupload
* @param file {Y.File} The file to force reupload on.
*/
forceReupload : function (file) {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "forceReupload", 324);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 325);
var id = file.get("id");
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 326);
if (this.currentFiles.hasOwnProperty(id)) {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 327);
file.cancelUpload();
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 328);
this._unregisterUpload(file);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 329);
this.addToQueueTop(file);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 330);
this._startNextFile();
}
},
/**
* Add a new file to the top of the queue (the upload will be
* launched as soon as the current number of uploading files
* drops below the maximum permissible value).
*
* @method addToQueueTop
* @param file {Y.File} The file to add to the top of the queue.
*/
addToQueueTop: function (file) {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "addToQueueTop", 342);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 343);
this.queuedFiles.unshift(file);
},
/**
* Add a new file to the bottom of the queue (the upload will be
* launched after all the other queued files are uploaded.)
*
* @method addToQueueBottom
* @param file {Y.File} The file to add to the bottom of the queue.
*/
addToQueueBottom: function (file) {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "addToQueueBottom", 353);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 354);
this.queuedFiles.push(file);
},
/**
* Cancels a specific file's upload. If no argument is passed,
* all ongoing uploads are cancelled and the upload process is
* stopped.
*
* @method cancelUpload
* @param file {Y.File} An optional parameter - the file whose upload
* should be cancelled.
*/
cancelUpload: function (file) {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "cancelUpload", 366);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 367);
var id,
i,
fid;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 371);
if (file) {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 372);
id = file.get("id");
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 374);
if (this.currentFiles[id]) {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 375);
this.currentFiles[id].cancelUpload();
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 376);
this._unregisterUpload(this.currentFiles[id]);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 377);
if (this._currentState === UploaderQueue.UPLOADING) {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 378);
this._startNextFile();
}
}
else {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 382);
for (i = 0, len = this.queuedFiles.length; i < len; i++) {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 383);
if (this.queuedFiles[i].get("id") === id) {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 384);
this.queuedFiles.splice(i, 1);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 385);
break;
}
}
}
}
else {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 391);
for (fid in this.currentFiles) {
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 392);
this.currentFiles[fid].cancelUpload();
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 393);
this._unregisterUpload(this.currentFiles[fid]);
}
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 396);
this.currentUploadedByteValues = {};
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 397);
this.currentFiles = {};
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 398);
this.totalBytesUploaded = 0;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 399);
this.fire("alluploadscancelled");
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 400);
this._currentState = UploaderQueue.STOPPED;
}
}
}, {
/**
* Static constant for the value of the `errorAction` attribute:
* prescribes the queue to continue uploading files in case of
* an error.
* @property CONTINUE
* @readOnly
* @type {String}
* @static
*/
CONTINUE: "continue",
/**
* Static constant for the value of the `errorAction` attribute:
* prescribes the queue to stop uploading files in case of
* an error.
* @property STOP
* @readOnly
* @type {String}
* @static
*/
STOP: "stop",
/**
* Static constant for the value of the `errorAction` attribute:
* prescribes the queue to restart a file upload immediately in case of
* an error.
* @property RESTART_ASAP
* @readOnly
* @type {String}
* @static
*/
RESTART_ASAP: "restartasap",
/**
* Static constant for the value of the `errorAction` attribute:
* prescribes the queue to restart an errored out file upload after
* other files have finished uploading.
* @property RESTART_AFTER
* @readOnly
* @type {String}
* @static
*/
RESTART_AFTER: "restartafter",
/**
* Static constant for the value of the `_currentState` property:
* implies that the queue is currently not uploading files.
* @property STOPPED
* @readOnly
* @type {String}
* @static
*/
STOPPED: "stopped",
/**
* Static constant for the value of the `_currentState` property:
* implies that the queue is currently uploading files.
* @property UPLOADING
* @readOnly
* @type {String}
* @static
*/
UPLOADING: "uploading",
/**
* The identity of the class.
*
* @property NAME
* @type String
* @default 'uploaderqueue'
* @readOnly
* @protected
* @static
*/
NAME: 'uploaderqueue',
/**
* Static property used to define the default attribute configuration of
* the class.
*
* @property ATTRS
* @type {Object}
* @protected
* @static
*/
ATTRS: {
/**
* Maximum number of simultaneous uploads; must be in the
* range between 1 and 5. The value of `2` is default. It
* is recommended that this value does not exceed 3.
* @attribute simUploads
* @type Number
* @default 2
*/
simUploads: {
value: 2,
validator: function (val) {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "validator", 501);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 502);
return (val >= 1 && val <= 5);
}
},
/**
* The action to take in case of error. The valid values for this attribute are:
* `Y.Uploader.Queue.CONTINUE` (the upload process should continue on other files,
* ignoring the error), `Y.Uploader.Queue.STOP` (the upload process
* should stop completely), `Y.Uploader.Queue.RESTART_ASAP` (the upload
* should restart immediately on the errored out file and continue as planned), or
* Y.Uploader.Queue.RESTART_AFTER (the upload of the errored out file should restart
* after all other files have uploaded)
* @attribute errorAction
* @type String
* @default Y.Uploader.Queue.CONTINUE
*/
errorAction: {
value: "continue",
validator: function (val) {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "validator", 520);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 521);
return (
val === UploaderQueue.CONTINUE ||
val === UploaderQueue.STOP ||
val === UploaderQueue.RESTART_ASAP ||
val === UploaderQueue.RESTART_AFTER
);
}
},
/**
* The total number of bytes that has been uploaded.
* @attribute bytesUploaded
* @type Number
*/
bytesUploaded: {
readOnly: true,
value: 0
},
/**
* The total number of bytes in the queue.
* @attribute bytesTotal
* @type Number
*/
bytesTotal: {
readOnly: true,
value: 0
},
/**
* The queue file list. This file list should only be modified
* before the upload has been started; modifying it after starting
* the upload has no effect, and `addToQueueTop` or `addToQueueBottom` methods
* should be used instead.
* @attribute fileList
* @type Array
*/
fileList: {
value: [],
lazyAdd: false,
setter: function (val) {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "setter", 561);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 562);
var newValue = val;
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 563);
Y.Array.each(newValue, function (value) {
_yuitest_coverfunc("build/uploader-queue/uploader-queue.js", "(anonymous 4)", 563);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 564);
this.totalBytes += value.get("size");
}, this);
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 567);
return val;
}
},
/**
* A String specifying what should be the POST field name for the file
* content in the upload request.
*
* @attribute fileFieldName
* @type {String}
* @default Filedata
*/
fileFieldName: {
value: "Filedata"
},
/**
* The URL to POST the file upload requests to.
*
* @attribute uploadURL
* @type {String}
* @default ""
*/
uploadURL: {
value: ""
},
/**
* Additional HTTP headers that should be included
* in the upload request. Due to Flash Player security
* restrictions, this attribute is only honored in the
* HTML5 Uploader.
*
* @attribute uploadHeaders
* @type {Object}
* @default {}
*/
uploadHeaders: {
value: {}
},
/**
* A Boolean that specifies whether the file should be
* uploaded with the appropriate user credentials for the
* domain. Due to Flash Player security restrictions, this
* attribute is only honored in the HTML5 Uploader.
*
* @attribute withCredentials
* @type {Boolean}
* @default true
*/
withCredentials: {
value: true
},
/**
* An object, keyed by `fileId`, containing sets of key-value pairs
* that should be passed as POST variables along with each corresponding
* file.
*
* @attribute perFileParameters
* @type {Object}
* @default {}
*/
perFileParameters: {
value: {}
},
/**
* The number of times to try re-uploading a file that failed to upload before
* cancelling its upload.
*
* @attribute retryCount
* @type {Number}
* @default 3
*/
retryCount: {
value: 3
}
}
});
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 652);
Y.namespace('Uploader');
_yuitest_coverline("build/uploader-queue/uploader-queue.js", 653);
Y.Uploader.Queue = UploaderQueue;
}, '@VERSION@', {"requires": ["base"]});
|
itvsai/cdnjs
|
ajax/libs/yui/3.9.0/uploader-queue/uploader-queue-coverage.js
|
JavaScript
|
mit
| 53,103 |
YUI.add('event-custom-complex', function (Y, NAME) {
/**
* Adds event facades, preventable default behavior, and bubbling.
* events.
* @module event-custom
* @submodule event-custom-complex
*/
var FACADE,
FACADE_KEYS,
YObject = Y.Object,
key,
EMPTY = {},
CEProto = Y.CustomEvent.prototype,
ETProto = Y.EventTarget.prototype,
mixFacadeProps = function(facade, payload) {
var p;
for (p in payload) {
if (!(FACADE_KEYS.hasOwnProperty(p))) {
facade[p] = payload[p];
}
}
};
/**
* Wraps and protects a custom event for use when emitFacade is set to true.
* Requires the event-custom-complex module
* @class EventFacade
* @param e {Event} the custom event
* @param currentTarget {HTMLElement} the element the listener was attached to
*/
Y.EventFacade = function(e, currentTarget) {
if (!e) {
e = EMPTY;
}
this._event = e;
/**
* The arguments passed to fire
* @property details
* @type Array
*/
this.details = e.details;
/**
* The event type, this can be overridden by the fire() payload
* @property type
* @type string
*/
this.type = e.type;
/**
* The real event type
* @property _type
* @type string
* @private
*/
this._type = e.type;
//////////////////////////////////////////////////////
/**
* Node reference for the targeted eventtarget
* @property target
* @type Node
*/
this.target = e.target;
/**
* Node reference for the element that the listener was attached to.
* @property currentTarget
* @type Node
*/
this.currentTarget = currentTarget;
/**
* Node reference to the relatedTarget
* @property relatedTarget
* @type Node
*/
this.relatedTarget = e.relatedTarget;
};
Y.mix(Y.EventFacade.prototype, {
/**
* Stops the propagation to the next bubble target
* @method stopPropagation
*/
stopPropagation: function() {
this._event.stopPropagation();
this.stopped = 1;
},
/**
* Stops the propagation to the next bubble target and
* prevents any additional listeners from being exectued
* on the current target.
* @method stopImmediatePropagation
*/
stopImmediatePropagation: function() {
this._event.stopImmediatePropagation();
this.stopped = 2;
},
/**
* Prevents the event's default behavior
* @method preventDefault
*/
preventDefault: function() {
this._event.preventDefault();
this.prevented = 1;
},
/**
* Stops the event propagation and prevents the default
* event behavior.
* @method halt
* @param immediate {boolean} if true additional listeners
* on the current target will not be executed
*/
halt: function(immediate) {
this._event.halt(immediate);
this.prevented = 1;
this.stopped = (immediate) ? 2 : 1;
}
});
CEProto.fireComplex = function(args) {
var es,
ef,
q,
queue,
ce,
ret = true,
events,
subs,
ons,
afters,
afterQueue,
postponed,
prevented,
preventedFn,
defaultFn,
self = this,
host = self.host || self,
next,
oldbubble,
stack = self.stack,
yuievt = host._yuievt,
hasPotentialSubscribers;
if (stack) {
// queue this event if the current item in the queue bubbles
if (self.queuable && self.type !== stack.next.type) {
if (!stack.queue) {
stack.queue = [];
}
stack.queue.push([self, args]);
return true;
}
}
hasPotentialSubscribers = self.hasSubs() || yuievt.hasTargets || self.broadcast;
self.target = self.target || host;
self.currentTarget = host;
self.details = args.concat();
if (hasPotentialSubscribers) {
es = stack || {
id: self.id, // id of the first event in the stack
next: self,
silent: self.silent,
stopped: 0,
prevented: 0,
bubbling: null,
type: self.type,
// defaultFnQueue: new Y.Queue(),
defaultTargetOnly: self.defaultTargetOnly
};
subs = self.getSubs();
ons = subs[0];
afters = subs[1];
self.stopped = (self.type !== es.type) ? 0 : es.stopped;
self.prevented = (self.type !== es.type) ? 0 : es.prevented;
if (self.stoppedFn) {
// PERF TODO: Can we replace with callback, like preventedFn. Look into history
events = new Y.EventTarget({
fireOnce: true,
context: host
});
self.events = events;
events.on('stopped', self.stoppedFn);
}
self._facade = null; // kill facade to eliminate stale properties
ef = self._createFacade(args);
if (ons) {
self._procSubs(ons, args, ef);
}
// bubble if this is hosted in an event target and propagation has not been stopped
if (self.bubbles && host.bubble && !self.stopped) {
oldbubble = es.bubbling;
es.bubbling = self.type;
if (es.type !== self.type) {
es.stopped = 0;
es.prevented = 0;
}
ret = host.bubble(self, args, null, es);
self.stopped = Math.max(self.stopped, es.stopped);
self.prevented = Math.max(self.prevented, es.prevented);
es.bubbling = oldbubble;
}
prevented = self.prevented;
if (prevented) {
preventedFn = self.preventedFn;
if (preventedFn) {
preventedFn.apply(host, args);
}
} else {
defaultFn = self.defaultFn;
if (defaultFn && ((!self.defaultTargetOnly && !es.defaultTargetOnly) || host === ef.target)) {
defaultFn.apply(host, args);
}
}
// broadcast listeners are fired as discreet events on the
// YUI instance and potentially the YUI global.
if (self.broadcast) {
self._broadcast(args);
}
if (afters && !self.prevented && self.stopped < 2) {
// Queue the after
afterQueue = es.afterQueue;
if (es.id === self.id || self.type !== yuievt.bubbling) {
self._procSubs(afters, args, ef);
if (afterQueue) {
while ((next = afterQueue.last())) {
next();
}
}
} else {
postponed = afters;
if (es.execDefaultCnt) {
postponed = Y.merge(postponed);
Y.each(postponed, function(s) {
s.postponed = true;
});
}
if (!afterQueue) {
es.afterQueue = new Y.Queue();
}
es.afterQueue.add(function() {
self._procSubs(postponed, args, ef);
});
}
}
self.target = null;
if (es.id === self.id) {
queue = es.queue;
if (queue) {
while (queue.length) {
q = queue.pop();
ce = q[0];
// set up stack to allow the next item to be processed
es.next = ce;
ce._fire(q[1]);
}
}
self.stack = null;
}
ret = !(self.stopped);
if (self.type !== yuievt.bubbling) {
es.stopped = 0;
es.prevented = 0;
self.stopped = 0;
self.prevented = 0;
}
} else {
defaultFn = self.defaultFn;
if(defaultFn) {
ef = self._createFacade(args);
if ((!self.defaultTargetOnly) || (host === ef.target)) {
defaultFn.apply(host, args);
}
}
}
// Kill the cached facade to free up memory.
// Otherwise we have the facade from the last fire, sitting around forever.
self._facade = null;
return ret;
};
/**
* @method _hasPotentialSubscribers
* @for CustomEvent
* @private
* @return {boolean} Whether the event has potential subscribers or not
*/
CEProto._hasPotentialSubscribers = function() {
return this.hasSubs() || this.host._yuievt.hasTargets || this.broadcast;
};
/**
* Internal utility method to create a new facade instance and
* insert it into the fire argument list, accounting for any payload
* merging which needs to happen.
*
* This used to be called `_getFacade`, but the name seemed inappropriate
* when it was used without a need for the return value.
*
* @method _createFacade
* @private
* @param fireArgs {Array} The arguments passed to "fire", which need to be
* shifted (and potentially merged) when the facade is added.
* @return {EventFacade} The event facade created.
*/
// TODO: Remove (private) _getFacade alias, once synthetic.js is updated.
CEProto._createFacade = CEProto._getFacade = function(fireArgs) {
var userArgs = this.details,
firstArg = userArgs && userArgs[0],
firstArgIsObj = (firstArg && (typeof firstArg === "object")),
ef = this._facade;
if (!ef) {
ef = new Y.EventFacade(this, this.currentTarget);
}
if (firstArgIsObj) {
// protect the event facade properties
mixFacadeProps(ef, firstArg);
// Allow the event type to be faked http://yuilibrary.com/projects/yui3/ticket/2528376
if (firstArg.type) {
ef.type = firstArg.type;
}
if (fireArgs) {
fireArgs[0] = ef;
}
} else {
if (fireArgs) {
fireArgs.unshift(ef);
}
}
// update the details field with the arguments
ef.details = this.details;
// use the original target when the event bubbled to this target
ef.target = this.originalTarget || this.target;
ef.currentTarget = this.currentTarget;
ef.stopped = 0;
ef.prevented = 0;
this._facade = ef;
return this._facade;
};
/**
* Utility method to manipulate the args array passed in, to add the event facade,
* if it's not already the first arg.
*
* @method _addFacadeToArgs
* @private
* @param {Array} The arguments to manipulate
*/
CEProto._addFacadeToArgs = function(args) {
var e = args[0];
// Trying not to use instanceof, just to avoid potential cross Y edge case issues.
if (!(e && e.halt && e.stopImmediatePropagation && e.stopPropagation && e._event)) {
this._createFacade(args);
}
};
/**
* Stop propagation to bubble targets
* @for CustomEvent
* @method stopPropagation
*/
CEProto.stopPropagation = function() {
this.stopped = 1;
if (this.stack) {
this.stack.stopped = 1;
}
if (this.events) {
this.events.fire('stopped', this);
}
};
/**
* Stops propagation to bubble targets, and prevents any remaining
* subscribers on the current target from executing.
* @method stopImmediatePropagation
*/
CEProto.stopImmediatePropagation = function() {
this.stopped = 2;
if (this.stack) {
this.stack.stopped = 2;
}
if (this.events) {
this.events.fire('stopped', this);
}
};
/**
* Prevents the execution of this event's defaultFn
* @method preventDefault
*/
CEProto.preventDefault = function() {
if (this.preventable) {
this.prevented = 1;
if (this.stack) {
this.stack.prevented = 1;
}
}
};
/**
* Stops the event propagation and prevents the default
* event behavior.
* @method halt
* @param immediate {boolean} if true additional listeners
* on the current target will not be executed
*/
CEProto.halt = function(immediate) {
if (immediate) {
this.stopImmediatePropagation();
} else {
this.stopPropagation();
}
this.preventDefault();
};
/**
* Registers another EventTarget as a bubble target. Bubble order
* is determined by the order registered. Multiple targets can
* be specified.
*
* Events can only bubble if emitFacade is true.
*
* Included in the event-custom-complex submodule.
*
* @method addTarget
* @param o {EventTarget} the target to add
* @for EventTarget
*/
ETProto.addTarget = function(o) {
var etState = this._yuievt;
if (!etState.targets) {
etState.targets = {};
}
etState.targets[Y.stamp(o)] = o;
etState.hasTargets = true;
};
/**
* Returns an array of bubble targets for this object.
* @method getTargets
* @return EventTarget[]
*/
ETProto.getTargets = function() {
var targets = this._yuievt.targets;
return targets ? YObject.values(targets) : [];
};
/**
* Removes a bubble target
* @method removeTarget
* @param o {EventTarget} the target to remove
* @for EventTarget
*/
ETProto.removeTarget = function(o) {
var targets = this._yuievt.targets;
if (targets) {
delete targets[Y.stamp(o, true)];
if (YObject.size(targets) === 0) {
this._yuievt.hasTargets = false;
}
}
};
/**
* Propagate an event. Requires the event-custom-complex module.
* @method bubble
* @param evt {CustomEvent} the custom event to propagate
* @return {boolean} the aggregated return value from Event.Custom.fire
* @for EventTarget
*/
ETProto.bubble = function(evt, args, target, es) {
var targs = this._yuievt.targets,
ret = true,
t,
ce,
i,
bc,
ce2,
type = evt && evt.type,
originalTarget = target || (evt && evt.target) || this,
oldbubble;
if (!evt || ((!evt.stopped) && targs)) {
for (i in targs) {
if (targs.hasOwnProperty(i)) {
t = targs[i];
ce = t._yuievt.events[type];
if (t._hasSiblings) {
ce2 = t.getSibling(type, ce);
}
if (ce2 && !ce) {
ce = t.publish(type);
}
oldbubble = t._yuievt.bubbling;
t._yuievt.bubbling = type;
// if this event was not published on the bubble target,
// continue propagating the event.
if (!ce) {
if (t._yuievt.hasTargets) {
t.bubble(evt, args, originalTarget, es);
}
} else {
if (ce2) {
ce.sibling = ce2;
}
// set the original target to that the target payload on the facade is correct.
ce.target = originalTarget;
ce.originalTarget = originalTarget;
ce.currentTarget = t;
bc = ce.broadcast;
ce.broadcast = false;
// default publish may not have emitFacade true -- that
// shouldn't be what the implementer meant to do
ce.emitFacade = true;
ce.stack = es;
// TODO: See what's getting in the way of changing this to use
// the more performant ce._fire(args || evt.details || []).
// Something in Widget Parent/Child tests is not happy if we
// change it - maybe evt.details related?
ret = ret && ce.fire.apply(ce, args || evt.details || []);
ce.broadcast = bc;
ce.originalTarget = null;
// stopPropagation() was called
if (ce.stopped) {
break;
}
}
t._yuievt.bubbling = oldbubble;
}
}
}
return ret;
};
/**
* @method _hasPotentialSubscribers
* @for EventTarget
* @private
* @param {String} fullType The fully prefixed type name
* @return {boolean} Whether the event has potential subscribers or not
*/
ETProto._hasPotentialSubscribers = function(fullType) {
var etState = this._yuievt,
e = etState.events[fullType];
if (e) {
return e.hasSubs() || etState.hasTargets || e.broadcast;
} else {
return false;
}
};
FACADE = new Y.EventFacade();
FACADE_KEYS = {};
// Flatten whitelist
for (key in FACADE) {
FACADE_KEYS[key] = true;
}
}, '@VERSION@', {"requires": ["event-custom-base"]});
|
DeuxHuitHuit/cdnjs
|
ajax/libs/yui/3.12.0/event-custom-complex/event-custom-complex.js
|
JavaScript
|
mit
| 16,738 |
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": {
"0": "上午",
"1": "下午"
},
"DAY": {
"0": "星期日",
"1": "星期一",
"2": "星期二",
"3": "星期三",
"4": "星期四",
"5": "星期五",
"6": "星期六"
},
"MONTH": {
"0": "1月",
"1": "2月",
"2": "3月",
"3": "4月",
"4": "5月",
"5": "6月",
"6": "7月",
"7": "8月",
"8": "9月",
"9": "10月",
"10": "11月",
"11": "12月"
},
"SHORTDAY": {
"0": "週日",
"1": "週一",
"2": "週二",
"3": "週三",
"4": "週四",
"5": "週五",
"6": "週六"
},
"SHORTMONTH": {
"0": "1月",
"1": "2月",
"2": "3月",
"3": "4月",
"4": "5月",
"5": "6月",
"6": "7月",
"7": "8月",
"8": "9月",
"9": "10月",
"10": "11月",
"11": "12月"
},
"fullDate": "y年M月d日EEEE",
"longDate": "y年M月d日",
"medium": "yyyy/M/d ah:mm:ss",
"mediumDate": "yyyy/M/d",
"mediumTime": "ah:mm:ss",
"short": "y/M/d ah:mm",
"shortDate": "y/M/d",
"shortTime": "ah:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "¥",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": {
"0": {
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
"1": {
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00A4",
"negSuf": ")",
"posPre": "\u00A4",
"posSuf": ""
}
}
},
"id": "zh-hant-tw",
"pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
});
}]);
|
calebmer/cdnjs
|
ajax/libs/angular-i18n/1.1.5/angular-locale_zh-hant-tw.js
|
JavaScript
|
mit
| 2,105 |
<?php
/****************************************************************************/
/* */
/* YOU MAY WISH TO MODIFY OR REMOVE THE FOLLOWING LINES WHICH SET DEFAULTS */
/* */
/****************************************************************************/
$preferences = Swift_Preferences::getInstance();
// Sets the default charset so that setCharset() is not needed elsewhere
$preferences->setCharset('utf-8');
// Without these lines the default caching mechanism is "array" but this uses a lot of memory.
// If possible, use a disk cache to enable attaching large attachments etc.
// You can override the default temporary directory by setting the TMPDIR environment variable.
// The @ operator in front of is_writable calls is to avoid PHP warnings
// when using open_basedir
$tmp = getenv('TMPDIR');
if ($tmp && @is_writable($tmp)) {
$preferences
->setTempDir($tmp)
->setCacheType('disk');
} elseif (function_exists('sys_get_temp_dir') && @is_writable(sys_get_temp_dir())) {
$preferences
->setTempDir(sys_get_temp_dir())
->setCacheType('disk');
}
// this should only be done when Swiftmailer won't use the native QP content encoder
// see mime_deps.php
if (version_compare(phpversion(), '5.4.7', '<')) {
$preferences->setQPDotEscape(false);
}
|
MacTynow/redbear
|
vendor/swiftmailer/swiftmailer/lib/preferences.php
|
PHP
|
mit
| 1,443 |
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": {
"0": "上午",
"1": "下午"
},
"DAY": {
"0": "星期日",
"1": "星期一",
"2": "星期二",
"3": "星期三",
"4": "星期四",
"5": "星期五",
"6": "星期六"
},
"MONTH": {
"0": "1月",
"1": "2月",
"2": "3月",
"3": "4月",
"4": "5月",
"5": "6月",
"6": "7月",
"7": "8月",
"8": "9月",
"9": "10月",
"10": "11月",
"11": "12月"
},
"SHORTDAY": {
"0": "週日",
"1": "週一",
"2": "週二",
"3": "週三",
"4": "週四",
"5": "週五",
"6": "週六"
},
"SHORTMONTH": {
"0": "1月",
"1": "2月",
"2": "3月",
"3": "4月",
"4": "5月",
"5": "6月",
"6": "7月",
"7": "8月",
"8": "9月",
"9": "10月",
"10": "11月",
"11": "12月"
},
"fullDate": "y年M月d日EEEE",
"longDate": "y年M月d日",
"medium": "y年M月d日 ahh:mm:ss",
"mediumDate": "y年M月d日",
"mediumTime": "ahh:mm:ss",
"short": "yy年M月d日 ah:mm",
"shortDate": "yy年M月d日",
"shortTime": "ah:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "¥",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": {
"0": {
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
"1": {
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00A4",
"negSuf": ")",
"posPre": "\u00A4",
"posSuf": ""
}
}
},
"id": "zh-hant-hk",
"pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
});
}]);
|
bootcdn/cdnjs
|
ajax/libs/angular-i18n/1.2.0rc1/angular-locale_zh-hant-hk.js
|
JavaScript
|
mit
| 2,131 |
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// A bit simpler than readable streams.
// Implement an async ._write(chunk, cb), and it'll handle all
// the drain event emission and buffering.
module.exports = Writable;
/*<replacement>*/
var Buffer = require('buffer').Buffer;
/*</replacement>*/
Writable.WritableState = WritableState;
/*<replacement>*/
var util = require('core-util-is');
util.inherits = require('inherits');
/*</replacement>*/
var Stream = require('stream');
util.inherits(Writable, Stream);
function WriteReq(chunk, encoding, cb) {
this.chunk = chunk;
this.encoding = encoding;
this.callback = cb;
}
function WritableState(options, stream) {
options = options || {};
// the point at which write() starts returning false
// Note: 0 is a valid value, means that we always return false if
// the entire buffer is not flushed immediately on write()
var hwm = options.highWaterMark;
var defaultHwm = options.objectMode ? 16 : 16 * 1024;
this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
// object stream flag to indicate whether or not this stream
// contains buffers or objects.
this.objectMode = !!options.objectMode;
// cast to ints.
this.highWaterMark = ~~this.highWaterMark;
this.needDrain = false;
// at the start of calling end()
this.ending = false;
// when end() has been called, and returned
this.ended = false;
// when 'finish' is emitted
this.finished = false;
// should we decode strings into buffers before passing to _write?
// this is here so that some node-core streams can optimize string
// handling at a lower level.
var noDecode = options.decodeStrings === false;
this.decodeStrings = !noDecode;
// Crypto is kind of old and crusty. Historically, its default string
// encoding is 'binary' so we have to make this configurable.
// Everything else in the universe uses 'utf8', though.
this.defaultEncoding = options.defaultEncoding || 'utf8';
// not an actual buffer we keep track of, but a measurement
// of how much we're waiting to get pushed to some underlying
// socket or file.
this.length = 0;
// a flag to see when we're in the middle of a write.
this.writing = false;
// when true all writes will be buffered until .uncork() call
this.corked = 0;
// a flag to be able to tell if the onwrite cb is called immediately,
// or on a later tick. We set this to true at first, because any
// actions that shouldn't happen until "later" should generally also
// not happen before the first write call.
this.sync = true;
// a flag to know if we're processing previously buffered items, which
// may call the _write() callback in the same tick, so that we don't
// end up in an overlapped onwrite situation.
this.bufferProcessing = false;
// the callback that's passed to _write(chunk,cb)
this.onwrite = function(er) {
onwrite(stream, er);
};
// the callback that the user supplies to write(chunk,encoding,cb)
this.writecb = null;
// the amount that is being written when _write is called.
this.writelen = 0;
this.buffer = [];
// number of pending user-supplied write callbacks
// this must be 0 before 'finish' can be emitted
this.pendingcb = 0;
// emit prefinish if the only thing we're waiting for is _write cbs
// This is relevant for synchronous Transform streams
this.prefinished = false;
// True if the error was already emitted and should not be thrown again
this.errorEmitted = false;
}
function Writable(options) {
var Duplex = require('./_stream_duplex');
// Writable ctor is applied to Duplexes, though they're not
// instanceof Writable, they're instanceof Readable.
if (!(this instanceof Writable) && !(this instanceof Duplex))
return new Writable(options);
this._writableState = new WritableState(options, this);
// legacy.
this.writable = true;
Stream.call(this);
}
// Otherwise people can pipe Writable streams, which is just wrong.
Writable.prototype.pipe = function() {
this.emit('error', new Error('Cannot pipe. Not readable.'));
};
function writeAfterEnd(stream, state, cb) {
var er = new Error('write after end');
// TODO: defer error events consistently everywhere, not just the cb
stream.emit('error', er);
process.nextTick(function() {
cb(er);
});
}
// If we get something that is not a buffer, string, null, or undefined,
// and we're not in objectMode, then that's an error.
// Otherwise stream chunks are all considered to be of length=1, and the
// watermarks determine how many objects to keep in the buffer, rather than
// how many bytes or characters.
function validChunk(stream, state, chunk, cb) {
var valid = true;
if (!util.isBuffer(chunk) &&
!util.isString(chunk) &&
!util.isNullOrUndefined(chunk) &&
!state.objectMode) {
var er = new TypeError('Invalid non-string/buffer chunk');
stream.emit('error', er);
process.nextTick(function() {
cb(er);
});
valid = false;
}
return valid;
}
Writable.prototype.write = function(chunk, encoding, cb) {
var state = this._writableState;
var ret = false;
if (util.isFunction(encoding)) {
cb = encoding;
encoding = null;
}
if (util.isBuffer(chunk))
encoding = 'buffer';
else if (!encoding)
encoding = state.defaultEncoding;
if (!util.isFunction(cb))
cb = function() {};
if (state.ended)
writeAfterEnd(this, state, cb);
else if (validChunk(this, state, chunk, cb)) {
state.pendingcb++;
ret = writeOrBuffer(this, state, chunk, encoding, cb);
}
return ret;
};
Writable.prototype.cork = function() {
var state = this._writableState;
state.corked++;
};
Writable.prototype.uncork = function() {
var state = this._writableState;
if (state.corked) {
state.corked--;
if (!state.writing &&
!state.corked &&
!state.finished &&
!state.bufferProcessing &&
state.buffer.length)
clearBuffer(this, state);
}
};
function decodeChunk(state, chunk, encoding) {
if (!state.objectMode &&
state.decodeStrings !== false &&
util.isString(chunk)) {
chunk = new Buffer(chunk, encoding);
}
return chunk;
}
// if we're already writing something, then just put this
// in the queue, and wait our turn. Otherwise, call _write
// If we return false, then we need a drain event, so set that flag.
function writeOrBuffer(stream, state, chunk, encoding, cb) {
chunk = decodeChunk(state, chunk, encoding);
if (util.isBuffer(chunk))
encoding = 'buffer';
var len = state.objectMode ? 1 : chunk.length;
state.length += len;
var ret = state.length < state.highWaterMark;
// we must ensure that previous needDrain will not be reset to false.
if (!ret)
state.needDrain = true;
if (state.writing || state.corked)
state.buffer.push(new WriteReq(chunk, encoding, cb));
else
doWrite(stream, state, false, len, chunk, encoding, cb);
return ret;
}
function doWrite(stream, state, writev, len, chunk, encoding, cb) {
state.writelen = len;
state.writecb = cb;
state.writing = true;
state.sync = true;
if (writev)
stream._writev(chunk, state.onwrite);
else
stream._write(chunk, encoding, state.onwrite);
state.sync = false;
}
function onwriteError(stream, state, sync, er, cb) {
if (sync)
process.nextTick(function() {
state.pendingcb--;
cb(er);
});
else {
state.pendingcb--;
cb(er);
}
stream._writableState.errorEmitted = true;
stream.emit('error', er);
}
function onwriteStateUpdate(state) {
state.writing = false;
state.writecb = null;
state.length -= state.writelen;
state.writelen = 0;
}
function onwrite(stream, er) {
var state = stream._writableState;
var sync = state.sync;
var cb = state.writecb;
onwriteStateUpdate(state);
if (er)
onwriteError(stream, state, sync, er, cb);
else {
// Check if we're actually ready to finish, but don't emit yet
var finished = needFinish(stream, state);
if (!finished &&
!state.corked &&
!state.bufferProcessing &&
state.buffer.length) {
clearBuffer(stream, state);
}
if (sync) {
process.nextTick(function() {
afterWrite(stream, state, finished, cb);
});
} else {
afterWrite(stream, state, finished, cb);
}
}
}
function afterWrite(stream, state, finished, cb) {
if (!finished)
onwriteDrain(stream, state);
state.pendingcb--;
cb();
finishMaybe(stream, state);
}
// Must force callback to be called on nextTick, so that we don't
// emit 'drain' before the write() consumer gets the 'false' return
// value, and has a chance to attach a 'drain' listener.
function onwriteDrain(stream, state) {
if (state.length === 0 && state.needDrain) {
state.needDrain = false;
stream.emit('drain');
}
}
// if there's something in the buffer waiting, then process it
function clearBuffer(stream, state) {
state.bufferProcessing = true;
if (stream._writev && state.buffer.length > 1) {
// Fast case, write everything using _writev()
var cbs = [];
for (var c = 0; c < state.buffer.length; c++)
cbs.push(state.buffer[c].callback);
// count the one we are adding, as well.
// TODO(isaacs) clean this up
state.pendingcb++;
doWrite(stream, state, true, state.length, state.buffer, '', function(err) {
for (var i = 0; i < cbs.length; i++) {
state.pendingcb--;
cbs[i](err);
}
});
// Clear buffer
state.buffer = [];
} else {
// Slow case, write chunks one-by-one
for (var c = 0; c < state.buffer.length; c++) {
var entry = state.buffer[c];
var chunk = entry.chunk;
var encoding = entry.encoding;
var cb = entry.callback;
var len = state.objectMode ? 1 : chunk.length;
doWrite(stream, state, false, len, chunk, encoding, cb);
// if we didn't call the onwrite immediately, then
// it means that we need to wait until it does.
// also, that means that the chunk and cb are currently
// being processed, so move the buffer counter past them.
if (state.writing) {
c++;
break;
}
}
if (c < state.buffer.length)
state.buffer = state.buffer.slice(c);
else
state.buffer.length = 0;
}
state.bufferProcessing = false;
}
Writable.prototype._write = function(chunk, encoding, cb) {
cb(new Error('not implemented'));
};
Writable.prototype._writev = null;
Writable.prototype.end = function(chunk, encoding, cb) {
var state = this._writableState;
if (util.isFunction(chunk)) {
cb = chunk;
chunk = null;
encoding = null;
} else if (util.isFunction(encoding)) {
cb = encoding;
encoding = null;
}
if (!util.isNullOrUndefined(chunk))
this.write(chunk, encoding);
// .end() fully uncorks
if (state.corked) {
state.corked = 1;
this.uncork();
}
// ignore unnecessary end() calls.
if (!state.ending && !state.finished)
endWritable(this, state, cb);
};
function needFinish(stream, state) {
return (state.ending &&
state.length === 0 &&
!state.finished &&
!state.writing);
}
function prefinish(stream, state) {
if (!state.prefinished) {
state.prefinished = true;
stream.emit('prefinish');
}
}
function finishMaybe(stream, state) {
var need = needFinish(stream, state);
if (need) {
if (state.pendingcb === 0) {
prefinish(stream, state);
state.finished = true;
stream.emit('finish');
} else
prefinish(stream, state);
}
return need;
}
function endWritable(stream, state, cb) {
state.ending = true;
finishMaybe(stream, state);
if (cb) {
if (state.finished)
process.nextTick(cb);
else
stream.once('finish', cb);
}
state.ended = true;
}
|
msniff16/matthewsniff.github.com
|
node_modules/mysql/node_modules/readable-stream/lib/_stream_writable.js
|
JavaScript
|
mit
| 12,920 |
if (typeof _yuitest_coverage == "undefined"){
_yuitest_coverage = {};
_yuitest_coverline = function(src, line){
var coverage = _yuitest_coverage[src];
if (!coverage.lines[line]){
coverage.calledLines++;
}
coverage.lines[line]++;
};
_yuitest_coverfunc = function(src, name, line){
var coverage = _yuitest_coverage[src],
funcId = name + ":" + line;
if (!coverage.functions[funcId]){
coverage.calledFunctions++;
}
coverage.functions[funcId]++;
};
}
_yuitest_coverage["build/editor-bidi/editor-bidi.js"] = {
lines: {},
functions: {},
coveredLines: 0,
calledLines: 0,
coveredFunctions: 0,
calledFunctions: 0,
path: "build/editor-bidi/editor-bidi.js",
code: []
};
_yuitest_coverage["build/editor-bidi/editor-bidi.js"].code=["YUI.add('editor-bidi', function (Y, NAME) {","",""," /**"," * Plugin for Editor to support BiDirectional (bidi) text operations."," * @class Plugin.EditorBidi"," * @extends Base"," * @constructor"," * @module editor"," * @submodule editor-bidi"," */","",""," var EditorBidi = function() {"," EditorBidi.superclass.constructor.apply(this, arguments);"," }, HOST = 'host', DIR = 'dir', BODY = 'BODY', NODE_CHANGE = 'nodeChange',"," B_C_CHANGE = 'bidiContextChange', STYLE = 'style';",""," Y.extend(EditorBidi, Y.Base, {"," /**"," * Place holder for the last direction when checking for a switch"," * @private"," * @property lastDirection"," */"," lastDirection: null,"," /**"," * Tells us that an initial bidi check has already been performed"," * @private"," * @property firstEvent"," */"," firstEvent: null,",""," /**"," * Method checks to see if the direction of the text has changed based on a nodeChange event."," * @private"," * @method _checkForChange"," */"," _checkForChange: function() {"," var host = this.get(HOST),"," inst = host.getInstance(),"," sel = new inst.EditorSelection(),"," node, direction;",""," if (sel.isCollapsed) {"," node = EditorBidi.blockParent(sel.focusNode);"," if (node) {"," direction = node.getStyle('direction');"," if (direction !== this.lastDirection) {"," host.fire(B_C_CHANGE, { changedTo: direction });"," this.lastDirection = direction;"," }"," }"," } else {"," host.fire(B_C_CHANGE, { changedTo: 'select' });"," this.lastDirection = null;"," }"," },",""," /**"," * Checked for a change after a specific nodeChange event has been fired."," * @private"," * @method _afterNodeChange"," */"," _afterNodeChange: function(e) {"," // If this is the first event ever, or an event that can result in a context change"," if (this.firstEvent || EditorBidi.EVENTS[e.changedType]) {"," this._checkForChange();"," this.firstEvent = false;"," }"," },",""," /**"," * Checks for a direction change after a mouseup occurs."," * @private"," * @method _afterMouseUp"," */"," _afterMouseUp: function() {"," this._checkForChange();"," this.firstEvent = false;"," },"," initializer: function() {"," var host = this.get(HOST);",""," this.firstEvent = true;",""," host.after(NODE_CHANGE, Y.bind(this._afterNodeChange, this));"," host.after('dom:mouseup', Y.bind(this._afterMouseUp, this));"," }"," }, {"," /**"," * The events to check for a direction change on"," * @property EVENTS"," * @static"," */"," EVENTS: {"," 'backspace-up': true,"," 'pageup-up': true,"," 'pagedown-down': true,"," 'end-up': true,"," 'home-up': true,"," 'left-up': true,"," 'up-up': true,"," 'right-up': true,"," 'down-up': true,"," 'delete-up': true"," },",""," /**"," * More elements may be needed. BODY *must* be in the list to take care of the special case."," *"," * blockParent could be changed to use inst.EditorSelection.BLOCKS"," * instead, but that would make Y.Plugin.EditorBidi.blockParent"," * unusable in non-RTE contexts (it being usable is a nice"," * side-effect)."," * @property BLOCKS"," * @static"," */"," //BLOCKS: Y.EditorSelection.BLOCKS+',LI,HR,' + BODY,"," BLOCKS: Y.EditorSelection.BLOCKS,"," /**"," * Template for creating a block element"," * @static"," * @property DIV_WRAPPER"," */"," DIV_WRAPPER: '<DIV></DIV>',"," /**"," * Returns a block parent for a given element"," * @static"," * @method blockParent"," */"," blockParent: function(node, wrap) {"," var parent = node, divNode, firstChild;",""," if (!parent) {"," parent = Y.one(BODY);"," }",""," if (!parent.test(EditorBidi.BLOCKS)) {"," parent = parent.ancestor(EditorBidi.BLOCKS);"," }"," if (wrap && parent.test(BODY)) {"," // This shouldn't happen if the RTE handles everything"," // according to spec: we should get to a P before BODY. But"," // we don't want to set the direction of BODY even if that"," // happens, so we wrap everything in a DIV.",""," // The code is based on YUI3's Y.EditorSelection._wrapBlock function."," divNode = Y.Node.create(EditorBidi.DIV_WRAPPER);"," parent.get('children').each(function(node, index) {"," if (index === 0) {"," firstChild = node;"," } else {"," divNode.append(node);"," }"," });"," firstChild.replace(divNode);"," divNode.prepend(firstChild);"," parent = divNode;"," }"," return parent;"," },"," /**"," * The data key to store on the node."," * @static"," * @property _NODE_SELECTED"," */"," _NODE_SELECTED: 'bidiSelected',"," /**"," * Generates a list of all the block parents of the current NodeList"," * @static"," * @method addParents"," */"," addParents: function(nodeArray) {"," var i, parent, addParent;"," tester = function(sibling) {"," if (!sibling.getData(EditorBidi._NODE_SELECTED)) {"," addParent = false;"," return true; // stop more processing"," }"," };",""," for (i = 0; i < nodeArray.length; i += 1) {"," nodeArray[i].setData(EditorBidi._NODE_SELECTED, true);"," }",""," // This works automagically, since new parents added get processed"," // later themselves. So if there's a node early in the process that"," // we haven't discovered some of its siblings yet, thus resulting in"," // its parent not added, the parent will be added later, since those"," // siblings will be added to the array and then get processed."," for (i = 0; i < nodeArray.length; i += 1) {"," parent = nodeArray[i].get('parentNode');",""," // Don't add the parent if the parent is the BODY element."," // We don't want to change the direction of BODY. Also don't"," // do it if the parent is already in the list."," if (!parent.test(BODY) && !parent.getData(EditorBidi._NODE_SELECTED)) {"," addParent = true;"," parent.get('children').some(tester);"," if (addParent) {"," nodeArray.push(parent);"," parent.setData(EditorBidi._NODE_SELECTED, true);"," }"," }"," }",""," for (i = 0; i < nodeArray.length; i += 1) {"," nodeArray[i].clearData(EditorBidi._NODE_SELECTED);"," }",""," return nodeArray;"," },","",""," /**"," * editorBidi"," * @static"," * @property NAME"," */"," NAME: 'editorBidi',"," /**"," * editorBidi"," * @static"," * @property NS"," */"," NS: 'editorBidi',"," ATTRS: {"," host: {"," value: false"," }"," },"," /**"," * Regex for testing/removing text-align style from an element"," * @static"," * @property RE_TEXT_ALIGN"," */"," RE_TEXT_ALIGN: /text-align:\\s*\\w*\\s*;/,"," /**"," * Method to test a node's style attribute for text-align and removing it."," * @static"," * @method removeTextAlign"," */"," removeTextAlign: function(n) {"," if (n) {"," if (n.getAttribute(STYLE).match(EditorBidi.RE_TEXT_ALIGN)) {"," n.setAttribute(STYLE, n.getAttribute(STYLE).replace(EditorBidi.RE_TEXT_ALIGN, ''));"," }"," if (n.hasAttribute('align')) {"," n.removeAttribute('align');"," }"," }"," return n;"," }"," });",""," Y.namespace('Plugin');",""," Y.Plugin.EditorBidi = EditorBidi;",""," /**"," * bidi execCommand override for setting the text direction of a node."," * This property is added to the `Y.Plugin.ExecCommands.COMMANDS`"," * collection."," *"," * @for Plugin.ExecCommand"," * @property bidi"," */"," //TODO -- This should not add this command unless the plugin is added to the instance.."," Y.Plugin.ExecCommand.COMMANDS.bidi = function(cmd, direction) {"," var inst = this.getInstance(),"," sel = new inst.EditorSelection(),"," ns = this.get(HOST).get(HOST).editorBidi,"," returnValue, block, b,"," selected, selectedBlocks, dir;",""," if (!ns) {"," Y.error('bidi execCommand is not available without the EditorBiDi plugin.');"," return;"," }",""," inst.EditorSelection.filterBlocks();",""," if (sel.isCollapsed) { // No selection"," block = EditorBidi.blockParent(sel.anchorNode);"," if (!block) {"," block = inst.one('body').one(inst.EditorSelection.BLOCKS);"," }"," //Remove text-align attribute if it exists"," block = EditorBidi.removeTextAlign(block);"," if (!direction) {"," //If no direction is set, auto-detect the proper setting to make it \"toggle\""," dir = block.getAttribute(DIR);"," if (!dir || dir === 'ltr') {"," direction = 'rtl';"," } else {"," direction = 'ltr';"," }"," }"," block.setAttribute(DIR, direction);"," if (Y.UA.ie) {"," b = block.all('br.yui-cursor');"," if (b.size() === 1 && block.get('childNodes').size() === 1) {"," b.remove();"," }"," }"," returnValue = block;"," } else { // some text is selected"," selected = sel.getSelected();"," selectedBlocks = [];"," selected.each(function(node) {"," selectedBlocks.push(EditorBidi.blockParent(node));"," });"," selectedBlocks = inst.all(EditorBidi.addParents(selectedBlocks));"," selectedBlocks.each(function(n) {"," var d = direction;"," //Remove text-align attribute if it exists"," n = EditorBidi.removeTextAlign(n);"," if (!d) {"," dir = n.getAttribute(DIR);"," if (!dir || dir === 'ltr') {"," d = 'rtl';"," } else {"," d = 'ltr';"," }"," }"," n.setAttribute(DIR, d);"," });"," returnValue = selectedBlocks;"," }"," ns._checkForChange();"," return returnValue;"," };","","","","","}, '@VERSION@', {\"requires\": [\"editor-base\"]});"];
_yuitest_coverage["build/editor-bidi/editor-bidi.js"].lines = {"1":0,"14":0,"15":0,"19":0,"39":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"54":0,"55":0,"66":0,"67":0,"68":0,"78":0,"79":0,"82":0,"84":0,"86":0,"87":0,"132":0,"134":0,"135":0,"138":0,"139":0,"141":0,"148":0,"149":0,"150":0,"151":0,"153":0,"156":0,"157":0,"158":0,"160":0,"174":0,"175":0,"176":0,"177":0,"178":0,"182":0,"183":0,"191":0,"192":0,"197":0,"198":0,"199":0,"200":0,"201":0,"202":0,"207":0,"208":0,"211":0,"244":0,"245":0,"246":0,"248":0,"249":0,"252":0,"256":0,"258":0,"269":0,"270":0,"276":0,"277":0,"278":0,"281":0,"283":0,"284":0,"285":0,"286":0,"289":0,"290":0,"292":0,"293":0,"294":0,"296":0,"299":0,"300":0,"301":0,"302":0,"303":0,"306":0,"308":0,"309":0,"310":0,"311":0,"313":0,"314":0,"315":0,"317":0,"318":0,"319":0,"320":0,"321":0,"323":0,"326":0,"328":0,"330":0,"331":0};
_yuitest_coverage["build/editor-bidi/editor-bidi.js"].functions = {"EditorBidi:14":0,"_checkForChange:38":0,"_afterNodeChange:64":0,"_afterMouseUp:77":0,"initializer:81":0,"(anonymous 2):149":0,"blockParent:131":0,"tester:175":0,"addParents:173":0,"removeTextAlign:243":0,"(anonymous 3):310":0,"(anonymous 4):314":0,"bidi:269":0,"(anonymous 1):1":0};
_yuitest_coverage["build/editor-bidi/editor-bidi.js"].coveredLines = 103;
_yuitest_coverage["build/editor-bidi/editor-bidi.js"].coveredFunctions = 14;
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 1);
YUI.add('editor-bidi', function (Y, NAME) {
/**
* Plugin for Editor to support BiDirectional (bidi) text operations.
* @class Plugin.EditorBidi
* @extends Base
* @constructor
* @module editor
* @submodule editor-bidi
*/
_yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "(anonymous 1)", 1);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 14);
var EditorBidi = function() {
_yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "EditorBidi", 14);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 15);
EditorBidi.superclass.constructor.apply(this, arguments);
}, HOST = 'host', DIR = 'dir', BODY = 'BODY', NODE_CHANGE = 'nodeChange',
B_C_CHANGE = 'bidiContextChange', STYLE = 'style';
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 19);
Y.extend(EditorBidi, Y.Base, {
/**
* Place holder for the last direction when checking for a switch
* @private
* @property lastDirection
*/
lastDirection: null,
/**
* Tells us that an initial bidi check has already been performed
* @private
* @property firstEvent
*/
firstEvent: null,
/**
* Method checks to see if the direction of the text has changed based on a nodeChange event.
* @private
* @method _checkForChange
*/
_checkForChange: function() {
_yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "_checkForChange", 38);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 39);
var host = this.get(HOST),
inst = host.getInstance(),
sel = new inst.EditorSelection(),
node, direction;
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 44);
if (sel.isCollapsed) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 45);
node = EditorBidi.blockParent(sel.focusNode);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 46);
if (node) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 47);
direction = node.getStyle('direction');
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 48);
if (direction !== this.lastDirection) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 49);
host.fire(B_C_CHANGE, { changedTo: direction });
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 50);
this.lastDirection = direction;
}
}
} else {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 54);
host.fire(B_C_CHANGE, { changedTo: 'select' });
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 55);
this.lastDirection = null;
}
},
/**
* Checked for a change after a specific nodeChange event has been fired.
* @private
* @method _afterNodeChange
*/
_afterNodeChange: function(e) {
// If this is the first event ever, or an event that can result in a context change
_yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "_afterNodeChange", 64);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 66);
if (this.firstEvent || EditorBidi.EVENTS[e.changedType]) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 67);
this._checkForChange();
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 68);
this.firstEvent = false;
}
},
/**
* Checks for a direction change after a mouseup occurs.
* @private
* @method _afterMouseUp
*/
_afterMouseUp: function() {
_yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "_afterMouseUp", 77);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 78);
this._checkForChange();
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 79);
this.firstEvent = false;
},
initializer: function() {
_yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "initializer", 81);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 82);
var host = this.get(HOST);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 84);
this.firstEvent = true;
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 86);
host.after(NODE_CHANGE, Y.bind(this._afterNodeChange, this));
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 87);
host.after('dom:mouseup', Y.bind(this._afterMouseUp, this));
}
}, {
/**
* The events to check for a direction change on
* @property EVENTS
* @static
*/
EVENTS: {
'backspace-up': true,
'pageup-up': true,
'pagedown-down': true,
'end-up': true,
'home-up': true,
'left-up': true,
'up-up': true,
'right-up': true,
'down-up': true,
'delete-up': true
},
/**
* More elements may be needed. BODY *must* be in the list to take care of the special case.
*
* blockParent could be changed to use inst.EditorSelection.BLOCKS
* instead, but that would make Y.Plugin.EditorBidi.blockParent
* unusable in non-RTE contexts (it being usable is a nice
* side-effect).
* @property BLOCKS
* @static
*/
//BLOCKS: Y.EditorSelection.BLOCKS+',LI,HR,' + BODY,
BLOCKS: Y.EditorSelection.BLOCKS,
/**
* Template for creating a block element
* @static
* @property DIV_WRAPPER
*/
DIV_WRAPPER: '<DIV></DIV>',
/**
* Returns a block parent for a given element
* @static
* @method blockParent
*/
blockParent: function(node, wrap) {
_yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "blockParent", 131);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 132);
var parent = node, divNode, firstChild;
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 134);
if (!parent) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 135);
parent = Y.one(BODY);
}
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 138);
if (!parent.test(EditorBidi.BLOCKS)) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 139);
parent = parent.ancestor(EditorBidi.BLOCKS);
}
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 141);
if (wrap && parent.test(BODY)) {
// This shouldn't happen if the RTE handles everything
// according to spec: we should get to a P before BODY. But
// we don't want to set the direction of BODY even if that
// happens, so we wrap everything in a DIV.
// The code is based on YUI3's Y.EditorSelection._wrapBlock function.
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 148);
divNode = Y.Node.create(EditorBidi.DIV_WRAPPER);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 149);
parent.get('children').each(function(node, index) {
_yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "(anonymous 2)", 149);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 150);
if (index === 0) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 151);
firstChild = node;
} else {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 153);
divNode.append(node);
}
});
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 156);
firstChild.replace(divNode);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 157);
divNode.prepend(firstChild);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 158);
parent = divNode;
}
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 160);
return parent;
},
/**
* The data key to store on the node.
* @static
* @property _NODE_SELECTED
*/
_NODE_SELECTED: 'bidiSelected',
/**
* Generates a list of all the block parents of the current NodeList
* @static
* @method addParents
*/
addParents: function(nodeArray) {
_yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "addParents", 173);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 174);
var i, parent, addParent;
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 175);
tester = function(sibling) {
_yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "tester", 175);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 176);
if (!sibling.getData(EditorBidi._NODE_SELECTED)) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 177);
addParent = false;
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 178);
return true; // stop more processing
}
};
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 182);
for (i = 0; i < nodeArray.length; i += 1) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 183);
nodeArray[i].setData(EditorBidi._NODE_SELECTED, true);
}
// This works automagically, since new parents added get processed
// later themselves. So if there's a node early in the process that
// we haven't discovered some of its siblings yet, thus resulting in
// its parent not added, the parent will be added later, since those
// siblings will be added to the array and then get processed.
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 191);
for (i = 0; i < nodeArray.length; i += 1) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 192);
parent = nodeArray[i].get('parentNode');
// Don't add the parent if the parent is the BODY element.
// We don't want to change the direction of BODY. Also don't
// do it if the parent is already in the list.
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 197);
if (!parent.test(BODY) && !parent.getData(EditorBidi._NODE_SELECTED)) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 198);
addParent = true;
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 199);
parent.get('children').some(tester);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 200);
if (addParent) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 201);
nodeArray.push(parent);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 202);
parent.setData(EditorBidi._NODE_SELECTED, true);
}
}
}
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 207);
for (i = 0; i < nodeArray.length; i += 1) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 208);
nodeArray[i].clearData(EditorBidi._NODE_SELECTED);
}
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 211);
return nodeArray;
},
/**
* editorBidi
* @static
* @property NAME
*/
NAME: 'editorBidi',
/**
* editorBidi
* @static
* @property NS
*/
NS: 'editorBidi',
ATTRS: {
host: {
value: false
}
},
/**
* Regex for testing/removing text-align style from an element
* @static
* @property RE_TEXT_ALIGN
*/
RE_TEXT_ALIGN: /text-align:\s*\w*\s*;/,
/**
* Method to test a node's style attribute for text-align and removing it.
* @static
* @method removeTextAlign
*/
removeTextAlign: function(n) {
_yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "removeTextAlign", 243);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 244);
if (n) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 245);
if (n.getAttribute(STYLE).match(EditorBidi.RE_TEXT_ALIGN)) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 246);
n.setAttribute(STYLE, n.getAttribute(STYLE).replace(EditorBidi.RE_TEXT_ALIGN, ''));
}
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 248);
if (n.hasAttribute('align')) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 249);
n.removeAttribute('align');
}
}
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 252);
return n;
}
});
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 256);
Y.namespace('Plugin');
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 258);
Y.Plugin.EditorBidi = EditorBidi;
/**
* bidi execCommand override for setting the text direction of a node.
* This property is added to the `Y.Plugin.ExecCommands.COMMANDS`
* collection.
*
* @for Plugin.ExecCommand
* @property bidi
*/
//TODO -- This should not add this command unless the plugin is added to the instance..
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 269);
Y.Plugin.ExecCommand.COMMANDS.bidi = function(cmd, direction) {
_yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "bidi", 269);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 270);
var inst = this.getInstance(),
sel = new inst.EditorSelection(),
ns = this.get(HOST).get(HOST).editorBidi,
returnValue, block, b,
selected, selectedBlocks, dir;
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 276);
if (!ns) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 277);
Y.error('bidi execCommand is not available without the EditorBiDi plugin.');
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 278);
return;
}
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 281);
inst.EditorSelection.filterBlocks();
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 283);
if (sel.isCollapsed) { // No selection
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 284);
block = EditorBidi.blockParent(sel.anchorNode);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 285);
if (!block) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 286);
block = inst.one('body').one(inst.EditorSelection.BLOCKS);
}
//Remove text-align attribute if it exists
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 289);
block = EditorBidi.removeTextAlign(block);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 290);
if (!direction) {
//If no direction is set, auto-detect the proper setting to make it "toggle"
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 292);
dir = block.getAttribute(DIR);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 293);
if (!dir || dir === 'ltr') {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 294);
direction = 'rtl';
} else {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 296);
direction = 'ltr';
}
}
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 299);
block.setAttribute(DIR, direction);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 300);
if (Y.UA.ie) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 301);
b = block.all('br.yui-cursor');
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 302);
if (b.size() === 1 && block.get('childNodes').size() === 1) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 303);
b.remove();
}
}
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 306);
returnValue = block;
} else { // some text is selected
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 308);
selected = sel.getSelected();
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 309);
selectedBlocks = [];
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 310);
selected.each(function(node) {
_yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "(anonymous 3)", 310);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 311);
selectedBlocks.push(EditorBidi.blockParent(node));
});
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 313);
selectedBlocks = inst.all(EditorBidi.addParents(selectedBlocks));
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 314);
selectedBlocks.each(function(n) {
_yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "(anonymous 4)", 314);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 315);
var d = direction;
//Remove text-align attribute if it exists
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 317);
n = EditorBidi.removeTextAlign(n);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 318);
if (!d) {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 319);
dir = n.getAttribute(DIR);
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 320);
if (!dir || dir === 'ltr') {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 321);
d = 'rtl';
} else {
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 323);
d = 'ltr';
}
}
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 326);
n.setAttribute(DIR, d);
});
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 328);
returnValue = selectedBlocks;
}
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 330);
ns._checkForChange();
_yuitest_coverline("build/editor-bidi/editor-bidi.js", 331);
return returnValue;
};
}, '@VERSION@', {"requires": ["editor-base"]});
|
akiran/cdnjs
|
ajax/libs/yui/3.8.1/editor-bidi/editor-bidi-coverage.js
|
JavaScript
|
mit
| 32,951 |
/*
* Skin for jPlayer Plugin (jQuery JavaScript Library)
* http://www.jplayer.org
*
* Skin Name: Pink Flag
*
* Copyright (c) 2012 Happyworm Ltd
* Dual licensed under the MIT and GPL licenses.
* - http://www.opensource.org/licenses/mit-license.php
* - http://www.gnu.org/copyleft/gpl.html
*
* Author: Silvia Benvenuti
* Skin Version: 1.2 (jPlayer 2.2.0)
* Date: 22nd October 2012
*/
div.jp-audio,
div.jp-audio-stream,
div.jp-video {
/* Edit the font-size to counteract inherited font sizing.
* Eg. 1.25em = 1 / 0.8em
*/
font-size:1.25em; /* 1.25em for testing in site pages */ /* No parent CSS that can effect the size in the demos ZIP */
font-family:Verdana, Arial, sans-serif;
line-height:1.6;
color: #fff;
border-top:1px solid #554461;
border-left:1px solid #554461;
border-right:1px solid #180a1f;
border-bottom:1px solid #180a1f;
background-color:#3a2a45;
}
div.jp-audio {
width:201px;
padding:20px;
}
div.jp-audio-stream {
width:101px;
padding:20px 20px 10px 20px;
}
div.jp-video-270p {
width:480px;
}
div.jp-video-360p {
width:640px;
}
div.jp-video-full {
/* Rules for IE6 (full-screen) */
width:480px;
height:270px;
/* Rules for IE7 (full-screen) - Otherwise the relative container causes other page items that are not position:static (default) to appear over the video/gui. */
position:static !important; position:relative;
}
/* The z-index rule is defined in this manner to enable Popcorn plugins that add overlays to video area. EG. Subtitles. */
div.jp-video-full div div {
z-index:1000;
}
div.jp-video-full div.jp-jplayer {
top: 0;
left: 0;
position: fixed !important; position: relative; /* Rules for IE6 (full-screen) */
overflow: hidden;
}
div.jp-video-full div.jp-gui {
position: fixed !important; position: static; /* Rules for IE6 (full-screen) */
top: 0;
left: 0;
width:100%;
height:100%;
z-index:1001; /* 1 layer above the others. */
}
div.jp-video-full div.jp-interface {
position: absolute !important; position: relative; /* Rules for IE6 (full-screen) */
bottom: 0;
left: 0;
}
div.jp-interface {
position: relative;
width:100%;
background-color:#3a2a45; /* Required for the full screen */
}
div.jp-audio .jp-interface {
height: 80px;
padding-top:30px;
}
div.jp-audio-stream .jp-interface {
height: 50px;
padding-top:30px;
}
/* @group CONTROLS */
div.jp-controls-holder {
clear: both;
width:440px;
margin:0 auto 10px auto;
position: relative;
overflow:hidden;
}
div.jp-interface ul.jp-controls {
background: url("jplayer.pink.flag.jpg") 0 0 no-repeat;
list-style-type:none;
padding: 1px 0 2px 1px;
overflow:hidden;
width: 201px;
height: 34px;
}
div.jp-audio ul.jp-controls,
div.jp-audio-stream ul.jp-controls {
margin:0 auto;
}
div.jp-audio-stream ul.jp-controls {
width: 100px;
}
div.jp-video ul.jp-controls {
margin:0 0 0 115px;
float:left;
display:inline; /* need this to fix IE6 double margin */
}
div.jp-interface ul.jp-controls li {
display:inline;
float: left;
}
div.jp-interface ul.jp-controls a {
display:block;
overflow:hidden;
text-indent:-9999px;
height: 34px;
margin: 0 1px 2px 0;
padding: 0;
}
/* @group single player controls */
div.jp-type-single .jp-controls li a{
width: 99px;
}
div.jp-type-single .jp-play {
background: url("jplayer.pink.flag.jpg") 0px -40px no-repeat;
}
div.jp-type-single .jp-play:hover {
background: url("jplayer.pink.flag.jpg") -100px -40px no-repeat;
}
div.jp-type-single .jp-pause {
background: url("jplayer.pink.flag.jpg") 0px -120px no-repeat;
}
div.jp-type-single .jp-pause:hover {
background: url("jplayer.pink.flag.jpg") -100px -120px no-repeat;
}
/* The right border is normally in the ul background image. */
div.jp-audio-stream .jp-play,
div.jp-audio-stream .jp-pause {
border-right:1px solid #180920;
}
div.jp-type-single .jp-stop {
background: url("jplayer.pink.flag.jpg") 0px -80px no-repeat;
}
div.jp-type-single .jp-stop:hover {
background: url("jplayer.pink.flag.jpg") -100px -80px no-repeat;
}
/* @end */
/* @group playlist player controls */
div.jp-type-playlist .jp-controls li a{
width: 49px;
}
div.jp-type-playlist .jp-play {
background: url("jplayer.pink.flag.jpg") -24px -40px no-repeat;
}
div.jp-type-playlist .jp-play:hover {
background: url("jplayer.pink.flag.jpg") -124px -40px no-repeat;
}
div.jp-type-playlist .jp-pause {
background: url("jplayer.pink.flag.jpg") -24px -120px no-repeat;
}
div.jp-type-playlist .jp-pause:hover {
background: url("jplayer.pink.flag.jpg") -124px -120px no-repeat;
}
div.jp-type-playlist .jp-stop {
background: url("jplayer.pink.flag.jpg") -24px -80px no-repeat;
}
div.jp-type-playlist .jp-stop:hover {
background: url("jplayer.pink.flag.jpg") -124px -80px no-repeat;
}
div.jp-type-playlist .jp-previous {
background: url("jplayer.pink.flag.jpg") -24px -200px no-repeat;
}
div.jp-type-playlist .jp-previous:hover {
background: url("jplayer.pink.flag.jpg") -124px -200px no-repeat;
}
div.jp-type-playlist .jp-next {
background: url("jplayer.pink.flag.jpg") -24px -160px no-repeat;
}
div.jp-type-playlist .jp-next:hover {
background: url("jplayer.pink.flag.jpg") -124px -160px no-repeat;
}
/* @end */
/* @end */
/* @group TOGGLES */
ul.jp-toggles {
list-style-type:none;
padding:0;
margin:0 auto;
overflow:hidden;
}
div.jp-audio ul.jp-toggles {
width:55px;
}
div.jp-audio .jp-type-single ul.jp-toggles {
width:25px;
}
div.jp-video ul.jp-toggles {
width:100px;
margin-top: 10px;
}
ul.jp-toggles li{
display:block;
float:right;
}
ul.jp-toggles li a{
display:block;
width:25px;
height:18px;
text-indent:-9999px;
line-height:100%; /* need this for IE6 */
}
.jp-full-screen {
background: url("jplayer.pink.flag.jpg") 0 -420px no-repeat;
margin-left: 20px;
}
.jp-full-screen:hover {
background: url("jplayer.pink.flag.jpg") -30px -420px no-repeat;
}
.jp-restore-screen {
background: url("jplayer.pink.flag.jpg") -60px -420px no-repeat;
margin-left: 20px;
}
.jp-restore-screen:hover {
background: url("jplayer.pink.flag.jpg") -90px -420px no-repeat;
}
.jp-repeat {
background: url("jplayer.pink.flag.jpg") 0 -440px no-repeat;
}
.jp-repeat:hover {
background: url("jplayer.pink.flag.jpg") -30px -440px no-repeat;
}
.jp-repeat-off {
background: url("jplayer.pink.flag.jpg") -60px -440px no-repeat;
}
.jp-repeat-off:hover {
background: url("jplayer.pink.flag.jpg") -90px -440px no-repeat;
}
.jp-shuffle {
background: url("jplayer.pink.flag.jpg") 0 -460px no-repeat;
margin-left: 5px;
}
.jp-shuffle:hover {
background: url("jplayer.pink.flag.jpg") -30px -460px no-repeat;
}
.jp-shuffle-off {
background: url("jplayer.pink.flag.jpg") -60px -460px no-repeat;
margin-left: 5px;
}
.jp-shuffle-off:hover {
background: url("jplayer.pink.flag.jpg") -90px -460px no-repeat;
}
/* @end */
/* @group progress bar */
/* The seeking class is added/removed inside jPlayer */
div.jp-seeking-bg {
background: url("jplayer.pink.flag.seeking.gif");
}
.jp-progress {
background: url("jplayer.pink.flag.jpg") 0px -240px no-repeat;
width: 197px;
height: 13px;
padding: 0 2px 2px 2px;
margin-bottom: 4px;
overflow:hidden;
}
div.jp-video .jp-progress {
border-top:1px solid #180a1f;
border-bottom: 1px solid #554560;
width:100%;
background-image: none;
padding: 0;
}
.jp-seek-bar {
background: url("jplayer.pink.flag.jpg") 0px -260px repeat-x;
width:0px;
height: 100%;
overflow:hidden;
cursor:pointer;
}
.jp-play-bar {
background: url("jplayer.pink.flag.jpg") 0px -280px repeat-x;
width:0px;
height: 100%;
overflow:hidden;
}
/* @end */
/* @group volume controls */
div.jp-interface ul.jp-controls a.jp-mute,
div.jp-interface ul.jp-controls a.jp-unmute,
div.jp-interface ul.jp-controls a.jp-volume-max {
background: url("jplayer.pink.flag.jpg") 0px -330px no-repeat;
position: absolute;
width: 16px;
height: 11px;
}
div.jp-audio ul.jp-controls a.jp-mute,
div.jp-audio ul.jp-controls a.jp-unmute,
div.jp-audio-stream ul.jp-controls a.jp-mute,
div.jp-audio-stream ul.jp-controls a.jp-unmute {
top:-6px;
left: 0;
}
div.jp-audio ul.jp-controls a.jp-volume-max,
div.jp-audio-stream ul.jp-controls a.jp-volume-max {
top:-6px;
right: 0;
}
div.jp-video ul.jp-controls a.jp-mute,
div.jp-video ul.jp-controls a.jp-unmute {
left: 0;
top:14px;
}
div.jp-video ul.jp-controls a.jp-volume-max {
left: 84px;
top:14px;
}
div.jp-interface ul.jp-controls a.jp-mute:hover {
background: url("jplayer.pink.flag.jpg") -25px -330px no-repeat;
}
div.jp-interface ul.jp-controls a.jp-unmute {
background: url("jplayer.pink.flag.jpg") -60px -330px no-repeat;
}
div.jp-interface ul.jp-controls a.jp-unmute:hover {
background: url("jplayer.pink.flag.jpg") -85px -330px no-repeat;
}
div.jp-interface ul.jp-controls a.jp-volume-max {
background: url("jplayer.pink.flag.jpg") 0px -350px no-repeat;
}
div.jp-interface ul.jp-controls a.jp-volume-max:hover {
background: url("jplayer.pink.flag.jpg") -25px -350px no-repeat;
}
.jp-volume-bar {
background: url("jplayer.pink.flag.jpg") 0px -300px repeat-x;
position: absolute;
width: 197px;
height: 4px;
padding: 2px 2px 1px 2px;
overflow: hidden;
}
.jp-volume-bar:hover {
cursor: pointer;
}
div.jp-audio .jp-interface .jp-volume-bar,
div.jp-audio-stream .jp-interface .jp-volume-bar {
top:10px;
left: 0;
}
div.jp-audio-stream .jp-interface .jp-volume-bar {
width: 97px;
border-right:1px solid #180920;
padding-right:1px;
}
div.jp-video .jp-volume-bar {
top: 0;
left: 0;
width:95px;
border-right:1px solid #180920;
padding-right:1px;
margin-top: 30px;
}
.jp-volume-bar-value {
background: url("jplayer.pink.flag.jpg") 0px -320px repeat-x;
height: 4px;
}
/* @end */
/* @group current time and duration */
.jp-current-time, .jp-duration {
width:70px;
font-size:.5em;
color: #8c7a99;
}
.jp-current-time {
float: left;
}
.jp-duration {
float: right;
text-align:right;
}
.jp-video .jp-current-time {
padding-left:20px;
}
.jp-video .jp-duration {
padding-right:20px;
}
/* @end */
/* @group playlist */
.jp-title ul,
.jp-playlist ul {
list-style-type:none;
font-size:.7em;
margin: 0;
padding: 0;
}
.jp-video .jp-title ul {
margin: 0 20px 10px;
}
.jp-video .jp-playlist ul {
margin: 0 20px;
}
.jp-title li,
.jp-playlist li {
position: relative;
padding: 2px 0;
border-top:1px solid #554461;
border-bottom:1px solid #180a1f;
overflow: hidden;
}
.jp-title li{
border-bottom:none;
border-top:none;
padding:0;
text-align:center;
}
/* Note that the first-child (IE6) and last-child (IE6/7/8) selectors do not work on IE */
div.jp-type-playlist div.jp-playlist li:first-child {
border-top:none;
padding-top:3px;
}
div.jp-type-playlist div.jp-playlist li:last-child {
border-bottom:none;
padding-bottom:3px;
}
div.jp-type-playlist div.jp-playlist a {
color: #fff;
text-decoration:none;
}
div.jp-type-playlist div.jp-playlist a:hover {
color: #e892e9;
}
div.jp-type-playlist div.jp-playlist li.jp-playlist-current {
background-color: #26102e;
margin: 0 -20px;
padding: 2px 20px;
border-top: 1px solid #26102e;
border-bottom: 1px solid #26102e;
}
div.jp-type-playlist div.jp-playlist li.jp-playlist-current a{
color: #e892e9;
}
div.jp-type-playlist div.jp-playlist a.jp-playlist-item-remove {
float:right;
display:inline;
text-align:right;
margin-left:10px;
font-weight:bold;
color:#8C7A99;
}
div.jp-type-playlist div.jp-playlist a.jp-playlist-item-remove:hover {
color:#E892E9;
}
div.jp-type-playlist div.jp-playlist span.jp-free-media {
float: right;
display:inline;
text-align:right;
color:#8C7A99;
}
div.jp-type-playlist div.jp-playlist span.jp-free-media a{
color:#8C7A99;
}
div.jp-type-playlist div.jp-playlist span.jp-free-media a:hover{
color:#E892E9;
}
span.jp-artist {
font-size:.8em;
color:#8C7A99;
}
/* @end */
div.jp-video div.jp-video-play {
width:100%;
overflow:hidden; /* Important for nested negative margins to work in modern browsers */
cursor:pointer;
}
div.jp-video-270p div.jp-video-play {
margin-top:-270px;
height:270px;
}
div.jp-video-360p div.jp-video-play {
margin-top:-360px;
height:360px;
}
div.jp-video-full div.jp-video-play {
height:100%;
}
a.jp-video-play-icon {
position:relative;
display:block;
width: 112px;
height: 100px;
margin-left:-56px;
margin-top:-50px;
left:50%;
top:50%;
background: url("jplayer.pink.flag.video.play.png") 0 0 no-repeat;
text-indent:-9999px;
}
div.jp-video-play:hover a.jp-video-play-icon {
background: url("jplayer.pink.flag.video.play.png") 0 -100px no-repeat;
}
div.jp-jplayer audio,
div.jp-jplayer {
width:0px;
height:0px;
}
div.jp-jplayer {
background-color: #000000;
}
/* @group NO SOLUTION error feedback */
.jp-no-solution {
padding:5px;
font-size:.8em;
background-color:#3a2a45;
border-top:2px solid #554461;
border-left:2px solid #554461;
border-right:2px solid #180a1f;
border-bottom:2px solid #180a1f;
color:#FFF;
display:none;
}
.jp-no-solution a {
color:#FFF;
}
.jp-no-solution span {
font-size:1em;
display:block;
text-align:center;
font-weight:bold;
}
/* @end */
|
jakubfiala/cdnjs
|
ajax/libs/jplayer/2.3.7/skin/pink.flag/jplayer.pink.flag.css
|
CSS
|
mit
| 13,042 |
/**
* jQuery Skitter Slideshow
* @name jquery.skitter.js
* @description Slideshow
* @author Thiago Silva Ferreira - http://thiagosf.net
* @version 4.0
* @date August 04, 2010
* @update April 19, 2012
* @copyright (c) 2010 Thiago Silva Ferreira - http://thiagosf.net
* @license Dual licensed under the MIT or GPL Version 2 licenses
* @example http://thiagosf.net/projects/jquery/skitter/
*/
(function($) {
var number_skitter = 0,
skitters = [];
$.fn.skitter = function(options) {
return this.each(function() {
$(this).data('skitter_number', number_skitter);
skitters.push(new $sk(this, options, number_skitter));
++number_skitter;
});
};
var defaults = {
velocity: 1,
interval: 2500,
animation: '',
numbers: true,
navigation: true,
label: true,
easing_default: '',
box_skitter: null,
time_interval: null,
images_links: null,
image_atual: null,
link_atual: null,
label_atual: null,
target_atual: '_self',
width_skitter: null,
height_skitter: null,
image_i: 1,
is_animating: false,
is_hover_box_skitter: false,
random_ia: null,
show_randomly: false,
thumbs: false,
animateNumberOut: {backgroundColor:'#333', color:'#fff'},
animateNumberOver: {backgroundColor:'#fff', color:'#000'},
animateNumberActive: {backgroundColor:'#cc3333', color:'#fff'},
hideTools: false,
fullscreen: false,
xml: false,
dots: false,
width_label: null,
opacity_elements: 0.75, // Final opacity of elements in hideTools
interval_in_elements: 300, // Interval animation hover elements hideTools
interval_out_elements: 500, // Interval animation out elements hideTools
onLoad: null,
imageSwitched: null,
max_number_height: 20,
numbers_align: 'left',
preview: false,
focus: false,
foucs_active: false,
focus_position: 'center',
controls: false,
controls_position: 'center',
progressbar: false,
progressbar_css: {},
is_paused: false,
is_blur: false,
is_paused_time: false,
timeStart: 0,
elapsedTime: 0,
stop_over: true,
enable_navigation_keys: false,
with_animations: [],
mouseOverButton: function() { $(this).stop().animate({opacity:0.5}, 200); },
mouseOutButton: function() { $(this).stop().animate({opacity:1}, 200); },
auto_play: true,
structure: '<a href="#" class="prev_button">prev</a>'
+ '<a href="#" class="next_button">next</a>'
+ '<span class="info_slide"></span>'
+ '<div class="container_skitter">'
+ '<div class="image">'
+ '<a href=""><img class="image_main" /></a>'
+ '<div class="label_skitter"></div>'
+ '</div>'
+ '</div>'
};
$.skitter = function(obj, options, number) {
this.box_skitter = $(obj);
this.timer = null;
this.settings = $.extend({}, defaults, options || {});
this.number_skitter = number;
this.setup();
};
// Shortcut
var $sk = $.skitter;
$sk.fn = $sk.prototype = {};
$sk.fn.extend = $.extend;
$sk.fn.extend({
/**
* Init
*/
setup: function()
{
var self = this;
// Fullscreen
if (this.settings.fullscreen) {
var width = $(window).width();
var height = $(window).height();
this.box_skitter.width(width).height(height);
this.box_skitter.css({'position':'absolute', 'top':0, 'left':0, 'z-index':1000});
this.settings.stop_over = false;
$('body').css({'overflown':'hidden'});
}
this.settings.width_skitter = parseFloat(this.box_skitter.css('width'));
this.settings.height_skitter = parseFloat(this.box_skitter.css('height'));
if (!this.settings.width_skitter || !this.settings.height_skitter) {
console.warn('Width or height size is null! - Skitter Slideshow');
return false;
}
// Structure html
this.box_skitter.append(this.settings.structure);
// Settings
this.settings.easing_default = this.getEasing(this.settings.easing);
if (this.settings.velocity >= 2) this.settings.velocity = 1.3;
if (this.settings.velocity <= 0) this.settings.velocity = 1;
this.box_skitter.find('.info_slide').hide();
this.box_skitter.find('.label_skitter').hide();
this.box_skitter.find('.prev_button').hide();
this.box_skitter.find('.next_button').hide();
this.box_skitter.find('.container_skitter').width(this.settings.width_skitter);
this.box_skitter.find('.container_skitter').height(this.settings.height_skitter);
var width_label = this.settings.width_label ? this.settings.width_label : this.settings.width_skitter;
this.box_skitter.find('.label_skitter').width(width_label);
var initial_select_class = ' image_number_select', u = 0;
this.settings.images_links = new Array();
// Add image, link, animation type and label
var addImageLink = function (link, src, animation_type, label, target) {
self.settings.images_links.push([src, link, animation_type, label, target]);
if (self.settings.thumbs) {
var dimension_thumb = '';
if (self.settings.width_skitter > self.settings.height_skitter) {
dimension_thumb = 'height="100"';
}
else {
dimension_thumb = 'width="100"';
}
self.box_skitter.find('.info_slide').append(
'<span class="image_number'+initial_select_class+'" rel="'+(u - 1)+'" id="image_n_'+u+'_'+self.number_skitter+'">'
+'<img src="'+src+'" '+dimension_thumb+' />'
+'</span> '
);
}
else {
self.box_skitter.find('.info_slide').append(
'<span class="image_number'+initial_select_class+'" rel="'+(u - 1)+'" id="image_n_'+u+'_'+self.number_skitter+'">'+u+'</span> '
);
}
initial_select_class = '';
};
// Load from XML
if (this.settings.xml) {
$.ajax({
type: 'GET',
url: this.settings.xml,
async: false,
dataType: 'xml',
success: function(xml) {
var ul = $('<ul></ul>');
$(xml).find('skitter slide').each(function(){
++u;
var link = ($(this).find('link').text()) ? $(this).find('link').text() : '#';
var src = $(this).find('image').text();
var animation_type = $(this).find('image').attr('type');
var label = $(this).find('label').text();
var target = ($(this).find('target').text()) ? $(this).find('target').text() : '_self';
addImageLink(link, src, animation_type, label, target);
});
}
});
}
// Load from json
else if (this.settings.json) {
}
// Load from HTML
else {
this.box_skitter.find('ul li').each(function(){
++u;
var link = ($(this).find('a').length) ? $(this).find('a').attr('href') : '#';
var src = $(this).find('img').attr('src');
var animation_type = $(this).find('img').attr('class');
var label = $(this).find('.label_text').html();
var target = ($(this).find('a').length && $(this).find('a').attr('target')) ? $(this).find('a').attr('target') : '_self';
addImageLink(link, src, animation_type, label, target);
});
}
// Thumbs
if (self.settings.thumbs && !self.settings.fullscreen)
{
// New animation
self.settings.animateNumberOut = {opacity:0.3};
self.settings.animateNumberOver = {opacity:0.5};
self.settings.animateNumberActive = {opacity:1};
self.box_skitter.find('.info_slide').addClass('info_slide_thumb');
var width_info_slide = (u + 1) * self.box_skitter.find('.info_slide_thumb .image_number').width();
self.box_skitter.find('.info_slide_thumb').width(width_info_slide);
self.box_skitter.css({height:self.box_skitter.height() + self.box_skitter.find('.info_slide').height()});
self.box_skitter.append('<div class="container_thumbs"></div>');
var copy_info_slide = self.box_skitter.find('.info_slide').clone();
self.box_skitter.find('.info_slide').remove();
self.box_skitter.find('.container_thumbs')
.width(self.settings.width_skitter)
.append(copy_info_slide);
// Scrolling with mouse movement
var width_image = 0,
width_skitter = this.settings.width_skitter,
height_skitter = this.settings.height_skitter,
w_info_slide_thumb = 0,
info_slide_thumb = self.box_skitter.find('.info_slide_thumb'),
x_value = 0,
y_value = self.box_skitter.offset().top;
info_slide_thumb.find('.image_number').each(function(){
width_image += $(this).outerWidth();
});
info_slide_thumb.width(width_image+'px');
w_info_slide_thumb = info_slide_thumb.width();
width_value = this.settings.width_skitter;
width_value = width_skitter - 100;
if (width_info_slide > self.settings.width_skitter) {
self.box_skitter.mousemove(function(e){
x_value = self.box_skitter.offset().left + 90;
var x = e.pageX, y = e.pageY, new_x = 0;
x = x - x_value;
y = y - y_value;
novo_width = w_info_slide_thumb - width_value;
new_x = -((novo_width * x) / width_value);
if (new_x > 0) new_x = 0;
if (new_x < -(w_info_slide_thumb - width_skitter)) new_x = -(w_info_slide_thumb - width_skitter);
if (y > height_skitter) {
info_slide_thumb.css({left: new_x});
}
});
}
self.box_skitter.find('.scroll_thumbs').css({'left':10});
if (width_info_slide < self.settings.width_skitter) {
self.box_skitter.find('.info_slide').width('auto');
self.box_skitter.find('.box_scroll_thumbs').hide();
var class_info = '.info_slide';
switch (self.settings.numbers_align) {
case 'center' :
var _vleft = (self.settings.width_skitter - self.box_skitter.find(class_info).width()) / 2;
self.box_skitter.find(class_info).css({'left':_vleft});
break;
case 'right' :
self.box_skitter.find(class_info).css({'left':'auto', 'right':'-5px'});
break;
case 'left' :
self.box_skitter.find(class_info).css({'left':'0px'});
break;
}
}
}
else
{
var class_info = '.info_slide';
if (self.settings.dots) {
self.box_skitter.find('.info_slide').addClass('info_slide_dots').removeClass('info_slide');
class_info = '.info_slide_dots';
}
switch (self.settings.numbers_align) {
case 'center' :
var _vleft = (self.settings.width_skitter - self.box_skitter.find(class_info).width()) / 2;
self.box_skitter.find(class_info).css({'left':_vleft});
break;
case 'right' :
self.box_skitter.find(class_info).css({'left':'auto', 'right':'15px'});
break;
case 'left' :
self.box_skitter.find(class_info).css({'left':'15px'});
break;
}
if (!self.settings.dots) {
if (self.box_skitter.find('.info_slide').height() > 20) {
self.box_skitter.find('.info_slide').hide();
}
}
}
this.box_skitter.find('ul').hide();
if (this.settings.show_randomly)
this.settings.images_links.sort(function(a,b) {return Math.random() - 0.5;});
this.settings.image_atual = this.settings.images_links[0][0];
this.settings.link_atual = this.settings.images_links[0][1];
this.settings.label_atual = this.settings.images_links[0][3];
this.settings.target_atual = this.settings.images_links[0][4];
if (this.settings.images_links.length > 1)
{
this.box_skitter.find('.prev_button').click(function() {
if (self.settings.is_animating == false) {
self.settings.image_i -= 2;
if (self.settings.image_i == -2) {
self.settings.image_i = self.settings.images_links.length - 2;
}
else if (self.settings.image_i == -1) {
self.settings.image_i = self.settings.images_links.length - 1;
}
self.jumpToImage(self.settings.image_i);
}
return false;
});
this.box_skitter.find('.next_button').click(function() {
self.jumpToImage(self.settings.image_i);
return false;
});
self.box_skitter.find('.next_button, .prev_button').bind('mouseover', self.settings.mouseOverButton);
self.box_skitter.find('.next_button, .prev_button').bind('mouseleave', self.settings.mouseOutButton);
this.box_skitter.find('.image_number').hover(function() {
if ($(this).attr('class') != 'image_number image_number_select') {
$(this).stop().animate(self.settings.animateNumberOver, 300);
}
}, function(){
if ($(this).attr('class') != 'image_number image_number_select') {
$(this).stop().animate(self.settings.animateNumberOut, 500);
}
});
this.box_skitter.find('.image_number').click(function(){
if ($(this).attr('class') != 'image_number image_number_select') {
var imageNumber = parseInt($(this).attr('rel'));
self.jumpToImage(imageNumber);
}
return false;
});
this.box_skitter.find('.image_number').css(self.settings.animateNumberOut);
this.box_skitter.find('.image_number:eq(0)').css(self.settings.animateNumberActive);
// Preview with dots
if (self.settings.preview && self.settings.dots)
{
var preview = $('<div class="preview_slide"><ul></ul></div>');
for (var i = 0; i < this.settings.images_links.length; i++) {
var li = $('<li></li>');
var img = $('<img />');
img.attr('src', this.settings.images_links[i][0]);
li.append(img);
preview.find('ul').append(li);
}
var width_preview_ul = parseInt(this.settings.images_links.length * 100);
preview.find('ul').width(width_preview_ul);
$(class_info).append(preview);
self.box_skitter.find(class_info).find('.image_number').mouseenter(function() {
var _left_info = parseFloat(self.box_skitter.find(class_info).offset().left);
var _left_image = parseFloat($(this).offset().left);
var _left_preview = (_left_image - _left_info) - 43;
var rel = parseInt($(this).attr('rel'));
var image_current_preview = self.box_skitter.find('.preview_slide_current img').attr('src');
var _left_ul = -(rel * 100);
self.box_skitter.find('.preview_slide').find('ul').animate({left: _left_ul}, {duration:200, queue: false, easing: 'easeOutSine'});
self.box_skitter.find('.preview_slide').fadeTo(1,1).animate({left: _left_preview}, {duration:200, queue: false});
});
self.box_skitter.find(class_info).mouseleave(function() {
$('.preview_slide').animate({opacity: 'hide'}, {duration: 200, queue: false});
});
}
}
// Focus
if (self.settings.focus) {
self.focusSkitter();
}
// Constrols
if (self.settings.controls) {
self.setControls();
}
// Progressbar
if (self.settings.progressbar && self.settings.auto_play) {
self.addProgressBar();
}
// hideTools
if (self.settings.hideTools) {
self.hideTools();
}
// Navigation keys
if (self.settings.enable_navigation_keys) {
self.enableNavigationKeys();
}
this.loadImages();
},
/**
* Load images
*/
loadImages: function ()
{
var self = this;
var loading = $('<div class="loading">Loading</div>');
this.box_skitter.append(loading);
var total = this.settings.images_links.length;
var u = 0;
$.each(this.settings.images_links, function(i)
{
var self_il = this;
var loading = $('<span class="image_loading"></span>');
loading.css({position:'absolute', top:'-9999em'});
self.box_skitter.append(loading);
var img = new Image();
$(img).load(function () {
++u;
if (u == total) {
self.box_skitter.find('.loading').remove();
self.box_skitter.find('.image_loading').remove();
self.start();
}
}).error(function () {
self.box_skitter.find('.loading, .image_loading, .image_number, .next_button, .prev_button').remove();
self.box_skitter.html('<p style="color:white;background:black;">Error loading images. One or more images were not found.</p>');
}).attr('src', self_il[0]);
});
},
/**
* Start skitter
*/
start: function()
{
var self = this;
var init_pause = false;
if (this.settings.numbers || this.settings.thumbs) this.box_skitter.find('.info_slide').fadeIn(500);
if (this.settings.dots) this.box_skitter.find('.info_slide_dots').fadeIn(500);
if (this.settings.label) this.box_skitter.find('.label_skitter').show();
if (this.settings.navigation) {
this.box_skitter.find('.prev_button').fadeIn(500);
this.box_skitter.find('.next_button').fadeIn(500);
}
if (self.settings.auto_play) {
self.startTime();
}
self.windowFocusOut();
self.setLinkAtual();
self.box_skitter.find('.image a img').attr({'src': self.settings.image_atual});
img_link = self.box_skitter.find('.image a');
img_link = self.resizeImage(img_link);
img_link.find('img').fadeIn(1500);
self.setValueBoxText();
self.showBoxText();
if (self.settings.auto_play) {
self.stopOnMouseOver();
}
var mouseOverInit = function() {
if (self.settings.stop_over) {
init_pause = true;
self.settings.is_hover_box_skitter = true;
self.clearTimer(true);
self.pauseProgressBar();
}
};
self.box_skitter.mouseover(mouseOverInit);
self.box_skitter.find('.next_button').mouseover(mouseOverInit);
if (self.settings.images_links.length > 1 && !init_pause) {
if (self.settings.auto_play) {
self.timer = setTimeout(function() { self.nextImage(); }, self.settings.interval);
}
}
else {
self.box_skitter.find('.loading, .image_loading, .image_number, .next_button, .prev_button').remove();
}
if ($.isFunction(self.settings.onLoad)) self.settings.onLoad(self);
},
/**
* Jump to image
*/
jumpToImage: function(imageNumber)
{
if (this.settings.is_animating == false) {
this.settings.elapsedTime = 0;
this.box_skitter.find('.box_clone').stop();
this.clearTimer(true);
this.settings.image_i = Math.floor(imageNumber);
this.box_skitter.find('.image a').attr({'href': this.settings.link_atual});
this.box_skitter.find('.image_main').attr({'src': this.settings.image_atual});
this.box_skitter.find('.box_clone').remove();
this.nextImage();
}
},
/**
* Next image
*/
nextImage: function()
{
var self = this;
animations_functions = [
'cube',
'cubeRandom',
'block',
'cubeStop',
'cubeStopRandom',
'cubeHide',
'cubeSize',
'horizontal',
'showBars',
'showBarsRandom',
'tube',
'fade',
'fadeFour',
'paralell',
'blind',
'blindHeight',
'blindWidth',
'directionTop',
'directionBottom',
'directionRight',
'directionLeft',
'cubeSpread',
'glassCube',
'glassBlock',
'circles',
'circlesInside',
'circlesRotate',
'cubeShow',
'upBars',
'downBars',
'hideBars',
'swapBars',
'swapBarsBack',
'swapBlocks',
'cut'
];
if (self.settings.progressbar) self.hideProgressBar();
animation_type = (this.settings.animation == '' && this.settings.images_links[this.settings.image_i][2]) ?
this.settings.images_links[this.settings.image_i][2] : (this.settings.animation == '' ? 'default' : this.settings.animation);
// RandomUnique
if (animation_type == 'randomSmart')
{
if (!this.settings.random_ia) {
animations_functions.sort(function() {
return 0.5 - Math.random();
});
this.settings.random_ia = animations_functions;
}
animation_type = this.settings.random_ia[this.settings.image_i];
}
// Random
else if (animation_type == 'random')
{
var random_id = parseInt(Math.random() * animations_functions.length);
animation_type = animations_functions[random_id];
}
// Specific animations
else if (self.settings.with_animations.length > 0)
{
var total_with_animations = self.settings.with_animations.length;
if (this.settings._i_animation == undefined) {
this.settings._i_animation = 0;
}
animation_type = self.settings.with_animations[this.settings._i_animation];
++this.settings._i_animation;
if (this.settings._i_animation >= total_with_animations) this.settings._i_animation = 0;
}
switch (animation_type)
{
case 'cube' :
this.animationCube();
break;
case 'cubeRandom' :
this.animationCube({random:true});
break;
case 'block' :
this.animationBlock();
break;
case 'cubeStop' :
this.animationCubeStop();
break;
case 'cubeStopRandom' :
this.animationCubeStop({random:true});
break;
case 'cubeHide' :
this.animationCubeHide();
break;
case 'cubeSize' :
this.animationCubeSize();
break;
case 'horizontal' :
this.animationHorizontal();
break;
case 'showBars' :
this.animationShowBars();
break;
case 'showBarsRandom' :
this.animationShowBars({random:true});
break;
case 'tube' :
this.animationTube();
break;
case 'fade' :
this.animationFade();
break;
case 'fadeFour' :
this.animationFadeFour();
break;
case 'paralell' :
this.animationParalell();
break;
case 'blind' :
this.animationBlind();
break;
case 'blindHeight' :
this.animationBlindDimension({height:true});
break;
case 'blindWidth' :
this.animationBlindDimension({height:false, time_animate:400, delay:50});
break;
case 'directionTop' :
this.animationDirection({direction:'top'});
break;
case 'directionBottom' :
this.animationDirection({direction:'bottom'});
break;
case 'directionRight' :
this.animationDirection({direction:'right', total:5});
break;
case 'directionLeft' :
this.animationDirection({direction:'left', total:5});
break;
case 'cubeSpread' :
this.animationCubeSpread();
break;
case 'cubeJelly' :
this.animationCubeJelly();
break;
case 'glassCube' :
this.animationGlassCube();
break;
case 'glassBlock' :
this.animationGlassBlock();
break;
case 'circles' :
this.animationCircles();
break;
case 'circlesInside' :
this.animationCirclesInside();
break;
case 'circlesRotate' :
this.animationCirclesRotate();
break;
case 'cubeShow' :
this.animationCubeShow();
break;
case 'upBars' :
this.animationDirectionBars({direction: 'top'});
break;
case 'downBars' :
this.animationDirectionBars({direction: 'bottom'});
break;
case 'hideBars' :
this.animationHideBars();
break;
case 'swapBars' :
this.animationSwapBars();
break;
case 'swapBarsBack' :
this.animationSwapBars({easing: 'easeOutBack'});
break;
case 'swapBlocks' :
this.animationSwapBlocks();
break;
case 'cut' :
this.animationCut();
break;
default :
this.animationTube();
break;
}
},
animationCube: function (options)
{
var self = this;
var options = $.extend({}, {random: false}, options || {});
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeOutExpo' : this.settings.easing_default;
var time_animate = 700 / this.settings.velocity;
this.setActualLevel();
var division_w = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 8));
var division_h = Math.ceil(this.settings.height_skitter / (this.settings.height_skitter / 3));
var total = division_w * division_h;
var width_box = Math.ceil(this.settings.width_skitter / division_w);
var height_box = Math.ceil(this.settings.height_skitter / division_h);
var init_top = this.settings.height_skitter + 200;
var init_left = this.settings.height_skitter + 200;
var col_t = 0;
var col = 0;
for (i = 0; i < total; i++) {
init_top = (i % 2 == 0) ? init_top : -init_top;
init_left = (i % 2 == 0) ? init_left : -init_left;
var _vtop = init_top + (height_box * col_t) + (col_t * 150);
var _vleft = -self.settings.width_skitter;
//var _vleft = (init_left + (width_box * col)) + (col * 50);
var _vtop_image = -(height_box * col_t);
var _vleft_image = -(width_box * col);
var _btop = (height_box * col_t);
var _bleft = (width_box * col);
var box_clone = this.getBoxClone();
box_clone.hide();
var delay_time = 50 * (i);
if (options.random) {
delay_time = 40 * (col);
box_clone.css({left:_vleft+'px', top:_vtop+'px', width:width_box, height:height_box});
}
else {
time_animate = 500;
//box_clone.css({left:(this.settings.width_skitter / 2), top:this.settings.height_skitter + 50, width:width_box, height:height_box});
box_clone.css({left:(this.settings.width_skitter) + (width_box * i), top:this.settings.height_skitter + (height_box * i), width:width_box, height:height_box});
}
//box_clone.find('img').css({left:_vleft_image, top:_vtop_image});
//box_clone.find('img').css({left:_vleft_image+100, top:_vtop_image});
this.addBoxClone(box_clone);
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.show().delay(delay_time).animate({top:_btop+'px', left:_bleft+'px'}, time_animate, easing, callback);
if (options.random) {
box_clone.find('img').css({left:_vleft_image+100, top:_vtop_image+50});
box_clone.find('img').delay(delay_time+(time_animate/2)).animate({left:_vleft_image, top:_vtop_image}, 1000, 'easeOutBack');
}
else {
box_clone.find('img').css({left:_vleft_image, top:_vtop_image});
box_clone.find('img').delay(delay_time+(time_animate/2)).fadeTo(100, 0.5).fadeTo(300, 1);
}
col_t++;
if (col_t == division_h) {
col_t = 0;
col++;
}
}
},
animationBlock: function(options)
{
var self = this;
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default;
var time_animate = 500 / this.settings.velocity;
this.setActualLevel();
var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 15));
var width_box = Math.ceil(this.settings.width_skitter / total);
var height_box = (this.settings.height_skitter);
for (i = 0; i < total; i++) {
var _bleft = (width_box * (i));
var _btop = 0;
var box_clone = this.getBoxClone();
box_clone.css({left: this.settings.width_skitter + 100, top:0, width:width_box, height:height_box});
box_clone.find('img').css({left:-(width_box * i)});
this.addBoxClone(box_clone);
var delay_time = 80 * (i);
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
//box_clone.delay(delay_time).animate({top:_btop, left:_bleft, opacity:'show'}, time_animate, easing, callback);
box_clone.show().delay(delay_time).animate({top:_btop, left:_bleft}, time_animate, easing);
box_clone.find('img').hide().delay(delay_time+100).animate({opacity:'show'}, time_animate+300, easing, callback);
}
},
animationCubeStop: function(options)
{
var self = this;
var options = $.extend({}, {random: false}, options || {});
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeInQuad' : this.settings.easing_default;
var time_animate = 300 / this.settings.velocity;
var image_old = this.box_skitter.find('.image_main').attr('src');
this.setActualLevel();
this.setLinkAtual();
this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual});
var division_w = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 8));
var division_h = Math.ceil(this.settings.height_skitter / (this.settings.width_skitter / 8));
var total = division_w * division_h;
var width_box = Math.ceil(this.settings.width_skitter / division_w);
var height_box = Math.ceil(this.settings.height_skitter / division_h);
var init_top = 0;
var init_left = 0;
var col_t = 0;
var col = 0;
var _ftop = this.settings.width_skitter / 16;
for (i = 0; i < total; i++) {
init_top = (i % 2 == 0) ? init_top : -init_top;
init_left = (i % 2 == 0) ? init_left : -init_left;
var _vtop = init_top + (height_box * col_t);
var _vleft = (init_left + (width_box * col));
var _vtop_image = -(height_box * col_t);
var _vleft_image = -(width_box * col);
var _btop = _vtop - _ftop;
var _bleft = _vleft - _ftop;
var box_clone = this.getBoxCloneImgOld(image_old);
box_clone.css({left:_vleft+'px', top:_vtop+'px', width:width_box, height:height_box});
box_clone.find('img').css({left:_vleft_image, top:_vtop_image});
this.addBoxClone(box_clone);
box_clone.show();
var delay_time = 50 * i;
if (options.random) {
time_animate = (400 * (self.getRandom(2) + 1)) / this.settings.velocity;
_btop = _vtop;
_bleft = _vleft;
delay_time = Math.ceil( 30 * self.getRandom(30) );
}
if (options.random && i == (total - 1)) {
time_animate = 400 * 3;
delay_time = 30 * 30;
}
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.delay(delay_time).animate({opacity:'hide', top:_btop+'px', left:_bleft+'px'}, time_animate, easing, callback);
col_t++;
if (col_t == division_h) {
col_t = 0;
col++;
}
}
},
animationCubeHide: function(options)
{
var self = this;
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default;
var time_animate = 500 / this.settings.velocity;
var image_old = this.box_skitter.find('.image_main').attr('src');
this.setActualLevel();
this.setLinkAtual();
this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual});
var division_w = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 8));
var division_h = Math.ceil(this.settings.height_skitter / (this.settings.height_skitter / 3));
var total = division_w * division_h;
var width_box = Math.ceil(this.settings.width_skitter / division_w);
var height_box = Math.ceil(this.settings.height_skitter / division_h);
var init_top = 0;
var init_left = 0;
var col_t = 0;
var col = 0;
for (i = 0; i < total; i++) {
init_top = (i % 2 == 0) ? init_top : -init_top;
init_left = (i % 2 == 0) ? init_left : -init_left;
var _vtop = init_top + (height_box * col_t);
var _vleft = (init_left + (width_box * col));
var _vtop_image = -(height_box * col_t);
var _vleft_image = -(width_box * col);
var _btop = _vtop - 50;
var _bleft = _vleft - 50;
var box_clone = this.getBoxCloneImgOld(image_old);
box_clone.css({left:_vleft+'px', top:_vtop+'px', width:width_box, height:height_box});
box_clone.find('img').css({left:_vleft_image, top:_vtop_image});
this.addBoxClone(box_clone);
box_clone.show();
var delay_time = 50 * i;
delay_time = (i == (total - 1)) ? (total * 50) : delay_time;
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.delay(delay_time).animate({opacity:'hide'}, time_animate, easing, callback);
col_t++;
if (col_t == division_h) {
col_t = 0;
col++;
}
}
},
animationCubeJelly: function(options)
{
var self = this;
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeInBack' : this.settings.easing_default;
var time_animate = 300 / this.settings.velocity;
var image_old = this.box_skitter.find('.image_main').attr('src');
this.setActualLevel();
this.setLinkAtual();
this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual});
var division_w = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 8));
var division_h = Math.ceil(this.settings.height_skitter / (this.settings.height_skitter / 3));
var total = division_w * division_h;
var width_box = Math.ceil(this.settings.width_skitter / division_w);
var height_box = Math.ceil(this.settings.height_skitter / division_h);
var init_top = 0;
var init_left = 0;
var col_t = 0;
var col = 0;
var u = -1;
for (i = 0; i < total; i++) {
if (col % 2 != 0) {
if (col_t == 0) {
u = u + division_h + 1;
}
u--;
}
else {
if (col > 0 && col_t == 0) {
u = u + 2;
}
u++;
}
init_top = (i % 2 == 0) ? init_top : -init_top;
init_left = (i % 2 == 0) ? init_left : -init_left;
var _vtop = init_top + (height_box * col_t);
var _vleft = (init_left + (width_box * col));
var _vtop_image = -(height_box * col_t);
var _vleft_image = -(width_box * col);
var _btop = _vtop - 50;
var _bleft = _vleft - 50;
var box_clone = this.getBoxCloneImgOld(image_old);
box_clone.css({left:_vleft+'px', top:_vtop+'px', width:width_box, height:height_box});
box_clone.find('img').css({left:_vleft_image, top:_vtop_image});
this.addBoxClone(box_clone);
box_clone.show();
var delay_time = (50 * i);
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.delay(delay_time).animate({width:'+=100px', height:'+=100px', top:'-=20px', left: '-=20px', opacity:'hide'}, time_animate, easing, callback);
col_t++;
if (col_t == division_h) {
col_t = 0;
col++;
}
}
},
animationCubeSize: function(options)
{
var self = this;
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeInOutQuad' : this.settings.easing_default;
var time_animate = 600 / this.settings.velocity;
var image_old = this.box_skitter.find('.image_main').attr('src');
this.setActualLevel();
this.setLinkAtual();
this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual});
var division_w = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 8));
var division_h = Math.ceil(this.settings.height_skitter / (this.settings.height_skitter / 3));
var total = division_w * division_h;
var width_box = Math.ceil(this.settings.width_skitter / division_w);
var height_box = Math.ceil(this.settings.height_skitter / division_h);
var init_top = 0;
var init_left = 0;
var col_t = 0;
var col = 0;
var _ftop = Math.ceil(this.settings.width_skitter / 6);
for (i = 0; i < total; i++) {
init_top = (i % 2 == 0) ? init_top : -init_top;
init_left = (i % 2 == 0) ? init_left : -init_left;
var _vtop = init_top + (height_box * col_t);
var _vleft = (init_left + (width_box * col));
var _vtop_image = -(height_box * col_t);
var _vleft_image = -(width_box * col);
var _btop = _vtop - _ftop;
var _bleft = _vleft - _ftop;
var box_clone = this.getBoxCloneImgOld(image_old);
box_clone.css({left:_vleft, top:_vtop, width:width_box, height:height_box});
box_clone.find('img').css({left:_vleft_image, top:_vtop_image});
this.addBoxClone(box_clone);
box_clone.show();
var delay_time = 50 * i;
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.delay(delay_time).animate({
opacity:'hide',width:'hide',height:'hide',top:_vtop+(width_box*1.5),left:_vleft+(height_box*1.5)
}, time_animate, easing, callback);
col_t++;
if (col_t == division_h) {
col_t = 0;
col++;
}
}
},
animationHorizontal: function(options)
{
var self = this;
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeOutExpo' : this.settings.easing_default;
var time_animate = 700 / this.settings.velocity;
this.setActualLevel();
var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 7));
var width_box = (this.settings.width_skitter);
var height_box = Math.ceil(this.settings.height_skitter / total);
for (i = 0; i < total; i++) {
var _bleft = (i % 2 == 0 ? '' : '') + width_box;
var _btop = (i * height_box);
var box_clone = this.getBoxClone();
box_clone.css({left:_bleft+'px', top:_btop+'px', width:width_box, height:height_box});
box_clone.find('img').css({left:0, top:-_btop});
this.addBoxClone(box_clone);
var delay_time = 90 * i;
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.delay(delay_time).animate({opacity:'show', top:_btop, left:0}, time_animate, easing, callback);
}
},
animationShowBars: function(options)
{
var self = this;
var options = $.extend({}, {random: false}, options || {});
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default;
var time_animate = 400 / this.settings.velocity;
this.setActualLevel();
var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 10));
var width_box = Math.ceil(this.settings.width_skitter / total);
var height_box = (this.settings.height_skitter);
for (i = 0; i < total; i++) {
var _bleft = (width_box * (i));
var _btop = 0;
var box_clone = this.getBoxClone();
box_clone.css({left:_bleft, top:_btop - 50, width:width_box, height:height_box});
box_clone.find('img').css({left:-(width_box * i), top:0});
this.addBoxClone(box_clone);
if (options.random) {
var random = this.getRandom(total);
var delay_time = 50 * random;
delay_time = (i == (total - 1)) ? (50 * total) : delay_time;
}
else {
var delay_time = 70 * (i);
time_animate = time_animate - (i * 2);
}
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.delay(delay_time).animate({
opacity:'show', top:_btop+'px', left:_bleft+'px'
}, time_animate, easing, callback);
}
},
animationTube: function(options)
{
var self = this;
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeOutElastic' : this.settings.easing_default;
var time_animate = 600 / this.settings.velocity;
this.setActualLevel();
var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 10));
var width_box = Math.ceil(this.settings.width_skitter / total);
var height_box = this.settings.height_skitter;
for (i = 0;i<total;i++) {
var _btop = 0;
var _vtop = height_box;
var vleft = width_box * i;
var box_clone = this.getBoxClone();
box_clone.css({left:vleft,top: _vtop, height:height_box, width: width_box});
box_clone.find('img').css({left:-(vleft)});
this.addBoxClone(box_clone);
var random = this.getRandom(total);
var delay_time = 30 * random;
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.show().delay(delay_time).animate({top:_btop}, time_animate, easing, callback);
}
},
animationFade: function(options)
{
var self = this;
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default;
var time_animate = 800 / this.settings.velocity;
this.setActualLevel();
var width_box = this.settings.width_skitter;
var height_box = this.settings.height_skitter;
var total = 2;
for (i = 0;i<total;i++) {
var _vtop = 0;
var _vleft = 0;
var box_clone = this.getBoxClone();
box_clone.css({left:_vleft, top:_vtop, width:width_box, height:height_box});
this.addBoxClone(box_clone);
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.animate({opacity:'show', left:0, top:0}, time_animate, easing, callback);
}
},
animationFadeFour: function(options)
{
var self = this;
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default;
var time_animate = 500 / this.settings.velocity;
this.setActualLevel();
var width_box = this.settings.width_skitter;
var height_box = this.settings.height_skitter;
var total = 4;
for (i = 0;i<total;i++) {
if (i == 0) {
var _vtop = '-100px';
var _vleft = '-100px';
} else if (i == 1) {
var _vtop = '-100px';
var _vleft = '100px';
} else if (i == 2) {
var _vtop = '100px';
var _vleft = '-100px';
} else if (i == 3) {
var _vtop = '100px';
var _vleft = '100px';
}
var box_clone = this.getBoxClone();
box_clone.css({left:_vleft, top:_vtop, width:width_box, height:height_box});
this.addBoxClone(box_clone);
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.animate({opacity:'show', left:0, top:0}, time_animate, easing, callback);
}
},
animationParalell: function(options)
{
var self = this;
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default;
var time_animate = 400 / this.settings.velocity;
this.setActualLevel();
var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 16));
var width_box = Math.ceil(this.settings.width_skitter / total);
var height_box = this.settings.height_skitter;
for (i = 0; i < total; i++) {
var _bleft = (width_box * (i));
var _btop = 0;
var box_clone = this.getBoxClone();
box_clone.css({left:_bleft, top:_btop - this.settings.height_skitter, width:width_box, height:height_box});
box_clone.find('img').css({left:-(width_box * i), top:0});
this.addBoxClone(box_clone);
var delay_time;
if (i <= ((total / 2) - 1)) {
delay_time = 1400 - (i * 200);
}
else if (i > ((total / 2) - 1)) {
delay_time = ((i - (total / 2)) * 200);
}
delay_time = delay_time / 2.5;
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.delay(delay_time).animate({
top:_btop+'px', left:_bleft+'px', opacity: 'show'
}, time_animate, easing, callback);
}
},
animationBlind: function(options)
{
var self = this;
var options = $.extend({}, {height: false}, options || {});
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default;
var time_animate = 400 / this.settings.velocity;
this.setActualLevel();
var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 16));
var width_box = Math.ceil(this.settings.width_skitter / total);
var height_box = this.settings.height_skitter;
for (i = 0; i < total; i++) {
var _bleft = (width_box * (i));
var _btop = 0;
var box_clone = this.getBoxClone();
box_clone.css({left:_bleft, top:_btop, width:width_box, height:height_box});
box_clone.find('img').css({left:-(width_box * i), top:0});
this.addBoxClone(box_clone);
var delay_time;
if (!options.height) {
if (i <= ((total / 2) - 1)) {
delay_time = 1400 - (i * 200);
}
else if (i > ((total / 2) - 1)) {
delay_time = ((i - (total / 2)) * 200);
}
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
}
else {
if (i <= ((total / 2) - 1)) {
delay_time = 200 + (i * 200);
}
else if (i > ((total / 2) - 1)) {
delay_time = (((total / 2) - i) * 200) + (total * 100);
}
var callback = (i == (total / 2)) ? function() { self.finishAnimation(); } : '';
}
delay_time = delay_time / 2.5;
if (!options.height) {
box_clone.delay(delay_time).animate({
opacity:'show',top:_btop+'px', left:_bleft+'px', width:'show'
}, time_animate, easing, callback);
}
else {
time_animate = time_animate + (i * 2);
var easing = 'easeOutQuad';
box_clone.delay(delay_time).animate({
opacity:'show',top:_btop+'px', left:_bleft+'px', height:'show'
}, time_animate, easing, callback);
}
}
},
animationBlindDimension: function(options)
{
var self = this;
var options = $.extend({}, {height: true, time_animate: 500, delay: 100}, options || {});
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default;
var time_animate = options.time_animate / this.settings.velocity;
this.setActualLevel();
var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 16));
var width_box = Math.ceil(this.settings.width_skitter / total);
var height_box = this.settings.height_skitter;
for (i = 0; i < total; i++) {
var _bleft = (width_box * (i));
var _btop = 0;
var box_clone = this.getBoxClone();
box_clone.css({left:_bleft, top:_btop, width:width_box, height:height_box});
box_clone.find('img').css({left:-(width_box * i), top:0});
this.addBoxClone(box_clone);
var delay_time = options.delay * i;
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
if (!options.height) {
box_clone.delay(delay_time).animate({
opacity:'show',top:_btop+'px', left:_bleft+'px', width:'show'
}, time_animate, easing, callback);
}
else {
var easing = 'easeOutQuad';
box_clone.delay(delay_time).animate({
opacity:'show',top:_btop+'px', left:_bleft+'px', height:'show'
}, time_animate, easing, callback);
}
}
},
animationDirection: function(options)
{
var self = this;
var options = $.extend({}, {direction: 'top', delay_type: 'sequence', total: 7}, options || {});
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeInOutExpo' : this.settings.easing_default;
var time_animate = 1200 / this.settings.velocity;
var image_old = this.box_skitter.find('.image_main').attr('src');
this.setActualLevel();
this.setLinkAtual();
this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual});
this.box_skitter.find('.image_main').hide();
var total = options.total;
for (i = 0; i < total; i++) {
switch (options.direction)
{
default : case 'top' :
var width_box = Math.ceil(this.settings.width_skitter / total);
var height_box = this.settings.height_skitter;
var _itopc = 0;
var _ileftc = (width_box * i);
var _ftopc = -height_box;
var _fleftc = _ileftc;
var _itopn = height_box;
var _ileftn = _ileftc;
var _ftopn = 0;
var _fleftn = _ileftc;
var _vtop_image = 0;
var _vleft_image = -_ileftc;
break;
case 'bottom' :
var width_box = Math.ceil(this.settings.width_skitter / total);
var height_box = this.settings.height_skitter;
var _itopc = 0;
var _ileftc = (width_box * i);
var _ftopc = height_box;
var _fleftc = _ileftc;
var _itopn = -height_box;
var _ileftn = _ileftc;
var _ftopn = 0;
var _fleftn = _ileftc;
var _vtop_image = 0;
var _vleft_image = -_ileftc;
break;
case 'right' :
var width_box = this.settings.width_skitter;
var height_box = Math.ceil(this.settings.height_skitter / total);
var _itopc = (height_box * i);
var _ileftc = 0;
var _ftopc = _itopc;
var _fleftc = width_box;
var _itopn = _itopc;
var _ileftn = -_fleftc;
var _ftopn = _itopc;
var _fleftn = 0;
var _vtop_image = -_itopc;
var _vleft_image = 0;
break;
case 'left' :
var width_box = this.settings.width_skitter;
var height_box = Math.ceil(this.settings.height_skitter / total);
var _itopc = (height_box * i);
var _ileftc = 0;
var _ftopc = _itopc;
var _fleftc = -width_box;
var _itopn = _itopc;
var _ileftn = -_fleftc;
var _ftopn = _itopc;
var _fleftn = 0;
var _vtop_image = -_itopc;
var _vleft_image = 0;
break;
}
switch (options.delay_type)
{
case 'zebra' : default : var delay_time = (i % 2 == 0) ? 0 : 150; break;
case 'random' : var delay_time = 30 * (Math.random() * 30); break;
case 'sequence' : var delay_time = i * 100; break;
}
var box_clone = this.getBoxCloneImgOld(image_old);
box_clone.find('img').css({left:_vleft_image, top:_vtop_image});
box_clone.css({top:_itopc, left:_ileftc, width:width_box, height:height_box});
this.addBoxClone(box_clone);
box_clone.show();
box_clone.delay(delay_time).animate({ top:_ftopc, left:_fleftc }, time_animate, easing);
// Next image
var box_clone_next = this.getBoxClone();
box_clone_next.find('img').css({left:_vleft_image, top:_vtop_image});
box_clone_next.css({top:_itopn, left:_ileftn, width:width_box, height:height_box});
this.addBoxClone(box_clone_next);
box_clone_next.show();
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone_next.delay(delay_time).animate({ top:_ftopn, left:_fleftn }, time_animate, easing, callback);
}
},
animationCubeSpread: function(options)
{
var self = this;
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default;
var time_animate = 700 / this.settings.velocity;
this.setActualLevel();
var division_w = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 8));
var division_h = Math.ceil(this.settings.height_skitter / (this.settings.width_skitter / 8));
var total = division_w * division_h;
var width_box = Math.ceil(this.settings.width_skitter / division_w);
var height_box = Math.ceil(this.settings.height_skitter / division_h);
var init_top = 0;
var init_left = 0;
var col_t = 0;
var col = 0;
var order = new Array;
var spread = new Array;
// Make order
for (i = 0; i < total; i++) {
init_top = (i % 2 == 0) ? init_top : -init_top;
init_left = (i % 2 == 0) ? init_left : -init_left;
var _vtop = init_top + (height_box * col_t);
var _vleft = (init_left + (width_box * col));
order[i] = [_vtop, _vleft];
col_t++;
if (col_t == division_h) {
col_t = 0;
col++;
}
}
// Reset col and col_t
col_t = 0;
col = 0;
// Make array for spread
for (i = 0; i < total; i++) {
spread[i] = i;
};
// Shuffle array
var spread = self.shuffleArray(spread);
for (i = 0; i < total; i++) {
init_top = (i % 2 == 0) ? init_top : -init_top;
init_left = (i % 2 == 0) ? init_left : -init_left;
var _vtop = init_top + (height_box * col_t);
var _vleft = (init_left + (width_box * col));
var _vtop_image = -(height_box * col_t);
var _vleft_image = -(width_box * col);
var _btop = _vtop;
var _bleft = _vleft;
_vtop = order[spread[i]][0];
_vleft = order[spread[i]][1];
var box_clone = this.getBoxClone();
box_clone.css({left:_vleft+'px', top:_vtop+'px', width:width_box, height:height_box});
box_clone.find('img').css({left:_vleft_image, top:_vtop_image});
this.addBoxClone(box_clone);
var delay_time = 30 * (Math.random() * 30);
if (i == (total-1)) delay_time = 30 * 30;
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.delay(delay_time).animate({opacity:'show',top:_btop+'px', left:_bleft+'px'}, time_animate, easing, callback);
col_t++;
if (col_t == division_h) {
col_t = 0;
col++;
}
}
},
animationGlassCube: function(options)
{
var self = this;
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeOutExpo' : this.settings.easing_default;
var time_animate = 500 / this.settings.velocity;
this.setActualLevel();
var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 10)) * 2;
var width_box = Math.ceil(this.settings.width_skitter / total) * 2;
var height_box = (this.settings.height_skitter) / 2;
var col = 0;
for (i = 0; i < total; i++) {
mod = (i % 2) == 0 ? true : false;
var _ileft = (width_box * (col));
var _itop = (mod) ? -self.settings.height_skitter : self.settings.height_skitter;
var _fleft = (width_box * (col));
var _ftop = (mod) ? 0 : (height_box);
var _bleft = -(width_box * col);
var _btop = (mod) ? 0 : -(height_box);
var delay_time = 120 * col;
var box_clone = this.getBoxClone();
box_clone.css({left: _ileft, top:_itop, width:width_box, height:height_box});
box_clone
.find('img')
.css({left: _bleft + (width_box / 1.5), top: _btop})
.delay(delay_time)
.animate({left: _bleft, top: _btop}, (time_animate * 1.9), 'easeOutQuad');
this.addBoxClone(box_clone);
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.show().delay(delay_time).animate({top:_ftop, left:_fleft}, time_animate, easing, callback);
if ((i % 2) != 0) col++;
}
},
animationGlassBlock: function(options)
{
var self = this;
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeOutExpo' : this.settings.easing_default;
var time_animate = 700 / this.settings.velocity;
this.setActualLevel();
var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 10));
var width_box = Math.ceil(this.settings.width_skitter / total);
var height_box = (this.settings.height_skitter);
for (i = 0; i < total; i++) {
var _ileft = (width_box * (i));
var _itop = 0;
var _fleft = (width_box * (i));
var _ftop = 0;
var _bleft = -(width_box * (i));
var _btop = 0;
var delay_time = 100 * i;
var box_clone = this.getBoxClone();
box_clone.css({left: _ileft, top:_itop, width:width_box, height:height_box});
box_clone
.find('img')
.css({left: _bleft + (width_box / 1.5), top: _btop})
.delay(delay_time)
.animate({left: _bleft, top: _btop}, (time_animate * 1.1), 'easeInOutQuad');
this.addBoxClone(box_clone);
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.delay(delay_time).animate({top:_ftop, left:_fleft, opacity: 'show'}, time_animate, easing, callback);
}
},
animationCircles: function(options)
{
var self = this;
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeInQuad' : this.settings.easing_default;
var time_animate = 500 / this.settings.velocity;
this.setActualLevel();
var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 10));
var size_box = 100;
var radius = Math.sqrt(Math.pow((this.settings.width_skitter), 2) + Math.pow((this.settings.height_skitter), 2));
var radius = Math.ceil(radius);
for (i = 0; i < total; i++) {
var _ileft = (self.settings.width_skitter / 2) - (size_box / 2);
var _itop = (self.settings.height_skitter / 2) - (size_box / 2);
var _fleft = _ileft;
var _ftop = _itop;
var box_clone = null;
// if ($.browser.mozilla) {
// box_clone = this.getBoxClone();
// box_clone.css({left: _ileft, top:_itop, width:size_box, height:size_box}).css3({
// 'border-radius': radius+'px'
// });
// box_clone.find('img').css({left: -_ileft, top: -_itop});
// }
// else {
box_clone = this.getBoxCloneBackground({
image: self.settings.image_atual,
left: _ileft,
top: _itop,
width: size_box,
height: size_box,
position: {
top: -_itop,
left: -_ileft
}
}).css3({
'border-radius': radius+'px'
});
// }
// var box_clone = this.getBoxClone();
// box_clone.css({left: _ileft, top:_itop, width:size_box, height:size_box}).css3({
// 'border-radius': radius+'px'
// });
// box_clone.find('img').css({left: -_ileft, top: -_itop});
size_box += 100;
this.addBoxClone(box_clone);
var delay_time = 70 * i;
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.delay(delay_time).animate({top: _ftop, left: _fleft, opacity: 'show'}, time_animate, easing, callback);
}
},
animationCirclesInside: function(options)
{
var self = this;
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeInQuad' : this.settings.easing_default;
var time_animate = 500 / this.settings.velocity;
var image_old = this.box_skitter.find('.image_main').attr('src');
this.setActualLevel();
this.setLinkAtual();
this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual});
var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 10));
var radius = Math.sqrt(Math.pow((this.settings.width_skitter), 2) + Math.pow((this.settings.height_skitter), 2));
var radius = Math.ceil(radius);
var size_box = radius;
for (i = 0; i < total; i++) {
var _ileft = (self.settings.width_skitter / 2) - (size_box / 2);
var _itop = (self.settings.height_skitter / 2) - (size_box / 2);
var _fleft = _ileft;
var _ftop = _itop;
var box_clone = null;
// if ($.browser.mozilla) {
// box_clone = this.getBoxCloneImgOld(image_old);
// box_clone.css({left: _ileft, top:_itop, width:size_box, height:size_box}).css3({
// 'border-radius': radius+'px'
// });
// box_clone.find('img').css({left: -_ileft, top: -_itop});
// }
// else {
box_clone = this.getBoxCloneBackground({
image: image_old,
left: _ileft,
top: _itop,
width: size_box,
height: size_box,
position: {
top: -_itop,
left: -_ileft
}
}).css3({
'border-radius': radius+'px'
});
// }
// var box_clone = this.getBoxCloneImgOld(image_old);
// box_clone.css({left: _ileft, top:_itop, width:size_box, height:size_box}).css3({
// 'border-radius': radius+'px'
// });
// box_clone.find('img').css({left: -_ileft, top: -_itop});
size_box -= 100;
this.addBoxClone(box_clone);
box_clone.show();
var delay_time = 70 * i;
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.delay(delay_time).animate({top: _ftop, left: _fleft, opacity: 'hide'}, time_animate, easing, callback);
}
},
animationCirclesRotate: function(options)
{
var self = this;
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default;
var time_animate = 500 / this.settings.velocity;
var image_old = this.box_skitter.find('.image_main').attr('src');
this.setActualLevel();
this.setLinkAtual();
this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual});
var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 10));
var radius = Math.sqrt(Math.pow((this.settings.width_skitter), 2) + Math.pow((this.settings.height_skitter), 2));
var radius = Math.ceil(radius);
var size_box = radius;
for (i = 0; i < total; i++) {
var _ileft = (self.settings.width_skitter / 2) - (size_box / 2);
var _itop = (self.settings.height_skitter / 2) - (size_box / 2);
var _fleft = _ileft;
var _ftop = _itop;
var box_clone = null;
if ($.browser.mozilla) {
box_clone = this.getBoxCloneImgOld(image_old);
box_clone.css({left: _ileft, top:_itop, width:size_box, height:size_box}).css3({
'border-radius': radius+'px'
});
box_clone.find('img').css({left: -_ileft, top: -_itop});
}
else {
box_clone = this.getBoxCloneBackground({
image: image_old,
left: _ileft,
top: _itop,
width: size_box,
height: size_box,
position: {
top: -_itop,
left: -_ileft
}
}).css3({
'border-radius': radius+'px'
});
}
size_box -= 100;
this.addBoxClone(box_clone);
box_clone.show();
var delay_time = 100 * i;
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
var _rotate = (i % 2 == 0) ? '20deg' : '-20deg';
box_clone.delay(delay_time).animate({top: _ftop, left: _fleft, opacity: 'hide', rotate: _rotate}, time_animate, easing, callback);
}
},
animationCubeShow: function(options)
{
var self = this;
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default;
var time_animate = 400 / this.settings.velocity;
this.setActualLevel();
var division_w = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 8));
var division_h = Math.ceil(this.settings.height_skitter / (this.settings.height_skitter / 4));
var total = division_w * division_h;
var width_box = Math.ceil(this.settings.width_skitter / division_w);
var height_box = Math.ceil(this.settings.height_skitter / division_h);
var last = false;
var _btop = 0;
var _bleft = 0;
var line = 0;
var col = 0;
for (i = 0; i < total; i++) {
_btop = height_box * line;
_bleft = width_box * col;
var delay_time = 30 * (i);
var box_clone = this.getBoxClone();
box_clone.css({left:_bleft, top:_btop, width:width_box, height:height_box}).hide();
box_clone.find('img').css({left:-_bleft, top:-_btop});
this.addBoxClone(box_clone);
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.delay(delay_time).animate({width:'show', height:'show'}, time_animate, easing, callback);
line++;
if (line == division_h) {
line = 0;
col++;
}
}
},
animationDirectionBars: function(options)
{
var self = this;
var options = $.extend({}, {direction: 'top'}, options || {});
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeInOutQuad' : this.settings.easing_default;
var time_animate = 400 / this.settings.velocity;
var image_old = this.box_skitter.find('.image_main').attr('src');
this.setActualLevel();
this.setLinkAtual();
this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual});
var total = 12;
var width_box = Math.ceil(this.settings.width_skitter / total);
var height_box = this.settings.height_skitter;
var _ftop = (options.direction == 'top') ? -height_box : height_box;
for (i = 0; i < total; i++) {
var _vtop = 0;
var _vleft = (width_box * i);
var _vtop_image = 0;
var _vleft_image = -(width_box * i);
var box_clone = this.getBoxCloneImgOld(image_old);
box_clone.css({left:_vleft+'px', top:_vtop+'px', width:width_box, height:height_box});
box_clone.find('img').css({left:_vleft_image, top:_vtop_image});
this.addBoxClone(box_clone);
box_clone.show();
var delay_time = 70 * i;
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.delay(delay_time).animate({top:_ftop}, time_animate, easing, callback);
}
},
animationHideBars: function(options)
{
var self = this;
var options = $.extend({}, {random: false}, options || {});
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? 'easeOutCirc' : this.settings.easing_default;
var time_animate = 700 / this.settings.velocity;
var image_old = this.box_skitter.find('.image_main').attr('src');
this.setActualLevel();
this.setLinkAtual();
this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual});
var division_w = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 10));
var total = division_w;
var width_box = Math.ceil(this.settings.width_skitter / division_w);
var height_box = this.settings.height_skitter;
for (i = 0; i < total; i++) {
var _vtop = 0;
var _vleft = width_box * i;
var _vtop_image = 0;
var _vleft_image = -(width_box * i);
var _fleft = '+='+width_box;
var box_clone = this.getBoxCloneImgOld(image_old);
box_clone.css({left:0, top:0, width:width_box, height:height_box});
box_clone.find('img').css({left:_vleft_image, top:_vtop_image});
var box_clone_main = this.getBoxCloneImgOld(image_old);
box_clone_main.css({left:_vleft+'px', top:_vtop+'px', width:width_box, height:height_box});
box_clone_main.html(box_clone);
this.addBoxClone(box_clone_main);
box_clone.show();
box_clone_main.show();
var delay_time = 50 * i;
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
box_clone.delay(delay_time).animate({left:_fleft}, time_animate, easing, callback);
}
},
animationSwapBars: function(options)
{
var self = this;
var options = $.extend({}, {direction: 'top', delay_type: 'sequence', total: 7, easing: 'easeOutCirc'}, options || {});
this.settings.is_animating = true;
var easing = (this.settings.easing_default == '') ? options.easing : this.settings.easing_default;
var time_animate = 500 / this.settings.velocity;
var image_old = this.box_skitter.find('.image_main').attr('src');
this.setActualLevel();
this.setLinkAtual();
this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual});
this.box_skitter.find('.image_main').hide();
var total = options.total;
for (i = 0; i < total; i++) {
var width_box = Math.ceil(this.settings.width_skitter / total);
var height_box = this.settings.height_skitter;
var _itopc = 0;
var _ileftc = (width_box * i);
var _ftopc = -height_box;
var _fleftc = _ileftc + width_box ;
var _itopn = height_box;
var _ileftn = _ileftc;
var _ftopn = 0;
var _fleftn = _ileftc;
var _vtop_image = 0;
var _vleft_image = -_ileftc;
switch (options.delay_type)
{
case 'zebra' : default : var delay_time = (i % 2 == 0) ? 0 : 150; break;
case 'random' : var delay_time = 30 * (Math.random() * 30); break;
case 'sequence' : var delay_time = i * 100; break;
}
// Old image
var box_clone = this.getBoxCloneImgOld(image_old);
box_clone.find('img').css({left:_vleft_image, top:0});
box_clone.css({top:0, left:0, width:width_box, height:height_box});
// Next image
var box_clone_next = this.getBoxClone();
box_clone_next.find('img').css({left:_vleft_image, top:0});
box_clone_next.css({top:0, left:-width_box, width:width_box, height:height_box});
// Container box images
var box_clone_container = this.getBoxClone();
box_clone_container.html('').append(box_clone).append(box_clone_next);
box_clone_container.css({top:0, left:_ileftc, width:width_box, height:height_box});
// Add containuer
this.addBoxClone(box_clone_container);
// Show boxes
box_clone_container.show();
box_clone.show();
box_clone_next.show();
// Callback
var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
// Animations
box_clone.delay(delay_time).animate({ left: width_box }, time_animate, easing);
box_clone_next.delay(delay_time).animate({ left:0 }, time_animate, easing, callback);
}
},
animationSwapBlocks: function(options)
{
var self = this;
var options = $.extend({}, {easing_old: 'easeInOutQuad', easing_new: 'easeOutQuad'}, options || {});
this.settings.is_animating = true;
var easing_old = (this.settings.easing_default == '') ? options.easing_old : this.settings.easing_default;
var easing_new = (this.settings.easing_default == '') ? options.easing_new : this.settings.easing_default;
var time_animate = 800 / this.settings.velocity;
var image_old = this.box_skitter.find('.image_main').attr('src');
this.setActualLevel();
this.setLinkAtual();
this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual});
this.box_skitter.find('.image_main').hide();
var total = 2;
var width_box = this.settings.width_skitter;
var height_box = Math.ceil(this.settings.height_skitter / total);
// Old image
var box_clone1 = this.getBoxCloneImgOld(image_old), box_clone2 = this.getBoxCloneImgOld(image_old);
box_clone1.find('img').css({left:0, top:0});
box_clone1.css({top:0, left:0, width:width_box, height:height_box});
box_clone2.find('img').css({left:0, top:-height_box});
box_clone2.css({top:height_box, left:0, width:width_box, height:height_box});
// Next image
var box_clone_next1 = this.getBoxClone(), box_clone_next2 = this.getBoxClone();
box_clone_next1.find('img').css({left:0, top:height_box});
box_clone_next1.css({top:0, left:0, width:width_box, height:height_box});
box_clone_next2.find('img').css({left:0, top: -(height_box * total) });
box_clone_next2.css({top:height_box, left:0, width:width_box, height:height_box});
// Add boxes
this.addBoxClone(box_clone_next1);
this.addBoxClone(box_clone_next2);
this.addBoxClone(box_clone1);
this.addBoxClone(box_clone2);
// Show boxes
box_clone1.show();
box_clone2.show();
box_clone_next1.show();
box_clone_next2.show();
// Callback
var callback = function() { self.finishAnimation(); };
// Animations
box_clone1.find('img').animate({ top: height_box }, time_animate, easing_old, function() {
box_clone1.remove();
});
box_clone2.find('img').animate({ top: -(height_box * total) }, time_animate, easing_old, function() {
box_clone2.remove();
});
box_clone_next1.find('img').animate({ top: 0 }, time_animate, easing_new);
box_clone_next2.find('img').animate({ top: -height_box }, time_animate, easing_new, callback);
},
animationCut: function(options)
{
var self = this;
var options = $.extend({}, {easing_old: 'easeInOutExpo', easing_new: 'easeInOutExpo'}, options || {});
this.settings.is_animating = true;
var easing_old = (this.settings.easing_default == '') ? options.easing_old : this.settings.easing_default;
var easing_new = (this.settings.easing_default == '') ? options.easing_new : this.settings.easing_default;
var time_animate = 900 / this.settings.velocity;
var image_old = this.box_skitter.find('.image_main').attr('src');
this.setActualLevel();
this.setLinkAtual();
this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual});
this.box_skitter.find('.image_main').hide();
var total = 2;
var width_box = this.settings.width_skitter;
var height_box = Math.ceil(this.settings.height_skitter / total);
// Old image
var box_clone1 = this.getBoxCloneImgOld(image_old), box_clone2 = this.getBoxCloneImgOld(image_old);
box_clone1.find('img').css({left:0, top:0});
box_clone1.css({top:0, left:0, width:width_box, height:height_box});
box_clone2.find('img').css({left:0, top:-height_box});
box_clone2.css({top:height_box, left:0, width:width_box, height:height_box});
// Next image
var box_clone_next1 = this.getBoxClone(), box_clone_next2 = this.getBoxClone();
//box_clone_next1.find('img').css({left:0, top:height_box});
box_clone_next1.find('img').css({left:0, top:0});
box_clone_next1.css({top:0, left:width_box, width:width_box, height:height_box});
//box_clone_next2.find('img').css({left:0, top: -(height_box * total) });
box_clone_next2.find('img').css({left:0, top: -height_box });
box_clone_next2.css({top:height_box, left:-width_box, width:width_box, height:height_box});
// Add boxes
this.addBoxClone(box_clone_next1);
this.addBoxClone(box_clone_next2);
this.addBoxClone(box_clone1);
this.addBoxClone(box_clone2);
// Show boxes
box_clone1.show();
box_clone2.show();
box_clone_next1.show();
box_clone_next2.show();
// Callback
var callback = function() { self.finishAnimation(); };
// Animations
box_clone1.animate({ left: -width_box }, time_animate, easing_old, function() {
box_clone1.remove();
});
box_clone2.animate({ left: width_box }, time_animate, easing_old, function() {
box_clone2.remove();
});
box_clone_next1.animate({ left: 0 }, time_animate, easing_new);
box_clone_next2.animate({ left: 0 }, time_animate, easing_new, callback);
},
// End animations ----------------------
// Finish animation
finishAnimation: function (options)
{
var self = this;
this.box_skitter.find('.image_main').show();
this.showBoxText();
this.settings.is_animating = false;
this.box_skitter.find('.image_main').attr({'src': this.settings.image_atual});
this.box_skitter.find('.image a').attr({'href': this.settings.link_atual});
if (!this.settings.is_hover_box_skitter && !this.settings.is_paused && !this.settings.is_blur) {
this.timer = setTimeout(function() { self.completeMove(); }, this.settings.interval);
}
self.startTime();
},
// Complete move
completeMove: function ()
{
this.clearTimer(true);
this.box_skitter.find('.box_clone').remove();
if (!this.settings.is_paused && !this.settings.is_blur) this.nextImage();
},
// Actual config for animation
setActualLevel: function() {
if ($.isFunction(this.settings.imageSwitched)) this.settings.imageSwitched(this.settings.image_i, this);
this.setImageLink();
this.addClassNumber();
this.hideBoxText();
this.increasingImage();
},
// Set image and link
setImageLink: function()
{
var name_image = this.settings.images_links[this.settings.image_i][0];
var link_image = this.settings.images_links[this.settings.image_i][1];
var label_image = this.settings.images_links[this.settings.image_i][3];
var target_link = this.settings.images_links[this.settings.image_i][4];
this.settings.image_atual = name_image;
this.settings.link_atual = link_image;
this.settings.label_atual = label_image;
this.settings.target_atual = target_link;
},
// Add class for number
addClassNumber: function ()
{
var self = this;
this.box_skitter.find('.image_number_select').animate(self.settings.animateNumberOut, 500).removeClass('image_number_select');
$('#image_n_'+(this.settings.image_i+1)+'_'+self.number_skitter).animate(self.settings.animateNumberActive, 700).addClass('image_number_select');
},
// Increment image_i
increasingImage: function()
{
this.settings.image_i++;
if (this.settings.image_i == this.settings.images_links.length) {
this.settings.image_i = 0;
}
},
// Get box clone
getBoxClone: function()
{
if (this.settings.link_atual != '#') {
var img_clone = $('<a href="'+this.settings.link_atual+'"><img src="'+this.settings.image_atual+'" /></a>');
}
else {
var img_clone = $('<img src="'+this.settings.image_atual+'" />');
}
img_clone = this.resizeImage(img_clone);
var box_clone = $('<div class="box_clone"></div>');
box_clone.append(img_clone);
return box_clone;
},
// Get box clone
getBoxCloneImgOld: function(image_old)
{
if (this.settings.link_atual != '#') {
var img_clone = $('<a href="'+this.settings.link_atual+'"><img src="'+image_old+'" /></a>');
}
else {
var img_clone = $('<img src="'+image_old+'" />');
}
img_clone = this.resizeImage(img_clone);
var box_clone = $('<div class="box_clone"></div>');
box_clone.append(img_clone);
return box_clone;
},
// Redimensiona imagem
resizeImage: function(img_clone)
{
if (this.settings.fullscreen) {
img_clone.find('img').height(this.settings.height_skitter);
}
return img_clone;
},
// Add box clone in box_skitter
addBoxClone: function(box_clone)
{
this.box_skitter.find('.container_skitter').append(box_clone);
},
// Get accepts easing
getEasing: function(easing)
{
var easing_accepts = [
'easeInQuad', 'easeOutQuad', 'easeInOutQuad',
'easeInCubic', 'easeOutCubic', 'easeInOutCubic',
'easeInQuart', 'easeOutQuart', 'easeInOutQuart',
'easeInQuint', 'easeOutQuint', 'easeInOutQuint',
'easeInSine', 'easeOutSine', 'easeInOutSine',
'easeInExpo', 'easeOutExpo', 'easeInOutExpo',
'easeInCirc', 'easeOutCirc', 'easeInOutCirc',
'easeInElastic', 'easeOutElastic', 'easeInOutElastic',
'easeInBack', 'easeOutBack', 'easeInOutBack',
'easeInBounce', 'easeOutBounce', 'easeInOutBounce',
];
if (jQuery.inArray(easing, easing_accepts) > 0) {
return easing;
}
else {
return '';
}
},
// Get random number
getRandom: function (i)
{
return Math.floor(Math.random() * i);
},
// Set value for text
setValueBoxText: function ()
{
this.box_skitter.find('.label_skitter').html(this.settings.label_atual);
},
// Show box text
showBoxText: function ()
{
var self = this;
if (this.settings.label_atual != undefined && this.settings.label_atual != '' && self.settings.label) {
self.box_skitter.find('.label_skitter').slideDown(400);
}
},
// Hide box text
hideBoxText: function ()
{
var self = this;
this.box_skitter.find('.label_skitter').slideUp(200, function() {
self.setValueBoxText();
});
},
// Stop time to get over box_skitter
stopOnMouseOver: function ()
{
var self = this;
var opacity_elements = self.settings.opacity_elements;
var interval_in_elements = self.settings.interval_in_elements;
var interval_out_elements = self.settings.interval_out_elements;
self.box_skitter.hover(function() {
if (self.settings.stop_over) self.settings.is_hover_box_skitter = true;
if (!self.settings.is_paused_time) {
self.pauseTime();
}
if (self.settings.hideTools) {
if (self.settings.numbers) {
self.box_skitter
.find('.info_slide')
.show()
.css({opacity:0})
.animate({opacity: opacity_elements}, interval_in_elements);
}
if (self.settings.navigation) {
self.box_skitter
.find('.prev_button')
.show()
.css({opacity:0})
.animate({opacity: opacity_elements}, interval_in_elements);
self.box_skitter
.find('.next_button')
.show().css({opacity:0})
.animate({opacity: opacity_elements}, interval_in_elements);
}
if (self.settings.focus && !self.settings.foucs_active) {
self.box_skitter
.find('.focus_button')
.stop()
.show().css({opacity:0})
.animate({opacity:opacity_elements}, 200);
}
if (self.settings.controls) {
self.box_skitter
.find('.play_pause_button')
.stop()
.show().css({opacity:0})
.animate({opacity:opacity_elements}, 200);
}
}
self.clearTimer(true);
if (self.settings.focus && !self.settings.foucs_active && !self.settings.hideTools) {
self.box_skitter
.find('.focus_button')
.stop()
.animate({opacity:1}, 200);
}
if (self.settings.controls && !self.settings.hideTools) {
self.box_skitter
.find('.play_pause_button')
.stop()
.animate({opacity:1}, 200);
}
}, function() {
if (self.settings.stop_over) self.settings.is_hover_box_skitter = false;
if (self.settings.elapsedTime == 0 && !self.settings.is_animating && !self.settings.is_paused) {
self.startTime();
}
else if (!self.settings.is_paused) {
self.resumeTime();
}
if (self.settings.hideTools) {
if (self.settings.numbers) {
self.box_skitter
.find('.info_slide')
.queue("fx", [])
.show()
.css({opacity: opacity_elements})
.animate({opacity:0}, interval_out_elements);
}
if (self.settings.navigation) {
self.box_skitter
.find('.prev_button')
.queue("fx", [])
.show()
.css({opacity: opacity_elements})
.animate({opacity:0}, interval_out_elements);
self.box_skitter
.find('.next_button')
.queue("fx", [])
.show()
.css({opacity: opacity_elements})
.animate({opacity:0}, interval_out_elements);
}
if (self.settings.focus && !self.settings.foucs_active) {
self.box_skitter
.find('.focus_button')
.stop()
.css({opacity: opacity_elements})
.animate({opacity:0}, 200);
}
if (self.settings.controls) {
self.box_skitter
.find('.play_pause_button')
.stop()
.css({opacity: opacity_elements})
.animate({opacity:0}, 200);
}
}
self.clearTimer(true);
if (!self.settings.is_animating && self.settings.images_links.length > 1) {
self.timer = setTimeout(function() { self.completeMove(); }, self.settings.interval - self.settings.elapsedTime);
self.box_skitter.find('.image_main').attr({'src': self.settings.image_atual});
self.box_skitter.find('.image a').attr({'href': self.settings.link_atual});
}
if (self.settings.focus && !self.settings.foucs_active && !self.settings.hideTools) {
self.box_skitter
.find('.focus_button')
.stop()
.animate({opacity:0.3}, 200);
}
if (self.settings.controls && !self.settings.hideTools) {
self.box_skitter
.find('.play_pause_button')
.stop()
.animate({opacity:0.3}, 200);
}
});
},
// Stop timer
clearTimer: function (force) {
var self = this;
clearInterval(self.timer);
},
// Set link atual
setLinkAtual: function() {
if (this.settings.link_atual != '#') {
this.box_skitter.find('.image a').attr({'href': this.settings.link_atual, 'target': this.settings.target_atual});
}
else {
this.box_skitter.find('.image a').removeAttr('href');
}
},
// Hide tools
hideTools: function() {
this.box_skitter.find('.info_slide').hide();
this.box_skitter.find('.prev_button').hide();
this.box_skitter.find('.next_button').hide();
this.box_skitter.find('.label_skitter').hide();
this.box_skitter.find('.focus_button').hide();
this.box_skitter.find('.play_pause_button').hide();
},
// Focus Skitter
focusSkitter: function() {
var self = this;
var focus_button = $('<a href="#" class="focus_button">focus</a>');
self.box_skitter.append(focus_button);
var _left = (self.settings.width_skitter - focus_button.width()) / 2;
var _space = 0;
if (self.settings.controls) _left -= 25;
if (self.settings.controls_position == self.settings.focus_position) _space = focus_button.width() + 5;
var cssPosition = {left: _left};
switch (self.settings.focus_position)
{
case 'leftTop' : cssPosition = {left: 5 + _space, top: 30}; break;
case 'rightTop' : cssPosition = {right: 5 + _space, top: 30}; break;
case 'leftBottom' : cssPosition = {left: 5 + _space, bottom: 5, top: 'auto'}; break;
case 'rightBottom' : cssPosition = {right: 5 + _space, bottom: 5, top: 'auto'}; break;
}
focus_button
.css(cssPosition)
.animate({opacity:0.3}, self.settings.interval_in_elements);
$(document).keypress(function(e) {
var code = (e.keyCode ? e.keyCode : e.which);
if (code == 27) $('#overlay_skitter').trigger('click');
});
self.box_skitter.find('.focus_button').click(function() {
self.settings.foucs_active = true;
$(this).stop().animate({opacity:0}, self.settings.interval_out_elements);
var div = $('<div id="overlay_skitter"></div>')
.height( $(document).height() )
.hide()
.fadeTo(self.settings.interval_in_elements, 0.98);
var _top = $('.box_skitter').offset().top;
var _left = $('.box_skitter').offset().left;
var _topFinal = (($(window).height() - $('.box_skitter').height()) / 2) + $(document).scrollTop();
var _leftFinal = ($(window).width() - $('.box_skitter').width()) / 2;
self.box_skitter.before('<div id="mark_position"></div>');
$('body').prepend(div);
$('body').prepend(self.box_skitter);
self.box_skitter
.css({'top':_top, 'left':_left, 'position':'absolute', 'z-index':9999})
.animate({'top':_topFinal, 'left':_leftFinal}, 2000, 'easeOutExpo');
$('#mark_position')
.width($('.box_skitter').width())
.height($('.box_skitter').height())
.css({'background':'none'})
.fadeTo(300,0.3);
$('#overlay_skitter').click(function() {
if ($(this).hasClass('finish_overlay_skitter')) return false;
self.settings.foucs_active = false;
$(this).addClass('finish_overlay_skitter');
$('#mark_position').before($('.box_skitter'));
if (!self.settings.hideTools) self.box_skitter.find('.focus_button').animate({opacity:0.3}, 200);
self.box_skitter
.stop()
.animate({'top':_top, 'left':_left}, 300, 'easeOutExpo', function() {
$(this).css({'position':'relative', 'top':0, 'left': 0});
$('#mark_position').remove();
});
$('#overlay_skitter').fadeTo(self.settings.interval_out_elements, 0, function() {
$(this).remove();
});
return false;
});
return false;
});
},
/**
* Controls: play and stop
*/
setControls: function() {
var self = this;
var play_pause_button = $('<a href="#" class="play_pause_button">pause</a>');
self.box_skitter.append(play_pause_button);
var _left = (self.settings.width_skitter - play_pause_button.width()) / 2;
if (self.settings.focus) _left += 25;
var cssPosition = {left: _left};
switch (self.settings.controls_position)
{
case 'leftTop' : cssPosition = {left: 5, top: 30}; break;
case 'rightTop' : cssPosition = {right: 5, top: 30}; break;
case 'leftBottom' : cssPosition = {left: 5, bottom: 5, top: 'auto'}; break;
case 'rightBottom' : cssPosition = {right: 5, bottom: 5, top: 'auto'}; break;
}
play_pause_button
.css(cssPosition)
.animate({opacity:0.3}, self.settings.interval_in_elements);
play_pause_button.click(function() {
if (!self.settings.is_paused) {
$(this).html('play');
$(this).fadeTo(100, 0.5).fadeTo(100, 1);
$(this).addClass('play_button');
self.pauseTime();
self.settings.is_paused = true;
self.clearTimer(true);
}
else {
if (!self.settings.is_animating && !self.box_skitter.find('.progressbar').is(':visible')) {
self.settings.elapsedTime = 0;
}
else {
self.resumeTime();
}
if (!self.settings.progressbar) self.resumeTime();
self.settings.is_paused = false;
$(this).html('pause');
$(this).fadeTo(100, 0.5).fadeTo(100, 1);
$(this).removeClass('play_button');
if (!self.settings.stop_over) {
self.clearTimer(true);
if (!self.settings.is_animating && self.settings.images_links.length > 1) {
self.timer = setTimeout(function() { self.completeMove(); }, self.settings.interval - self.settings.elapsedTime);
self.box_skitter.find('.image_main').attr({'src': self.settings.image_atual});
self.box_skitter.find('.image a').attr({'href': self.settings.link_atual});
}
}
}
return false;
});
},
/**
* Object size
*/
objectSize: function(obj) {
var size = 0, key;
for (key in obj) { if (obj.hasOwnProperty(key)) size++; }
return size;
},
/**
* Add progress bar
*/
addProgressBar: function() {
var self = this;
var progressbar = $('<div class="progressbar"></div>');
self.box_skitter.append(progressbar);
if (self.objectSize(self.settings.progressbar_css) == 0) {
if (parseInt(progressbar.css('width')) > 0) {
self.settings.progressbar_css.width = parseInt(progressbar.css('width'));
}
else {
self.settings.progressbar_css = {width: self.settings.width_skitter, height:5};
}
}
if (self.objectSize(self.settings.progressbar_css) > 0 && self.settings.progressbar_css.width == undefined) {
self.settings.progressbar_css.width = self.settings.width_skitter;
}
progressbar.css(self.settings.progressbar_css).hide();
},
/**
* Start progress bar
*/
startProgressBar: function() {
var self = this;
if (self.settings.is_hover_box_skitter || self.settings.is_paused || self.settings.is_blur || !self.settings.progressbar) return false;
self.box_skitter.find('.progressbar')
.hide()
.dequeue()
.width(self.settings.progressbar_css.width)
.animate({width:'show'}, self.settings.interval, 'linear');
},
/**
* Pause progress bar
*/
pauseProgressBar: function() {
var self = this;
if (!self.settings.is_animating) {
self.box_skitter.find('.progressbar').stop();
}
},
/**
* Resume progress bar
*/
resumeProgressBar: function() {
var self = this;
if (self.settings.is_hover_box_skitter || self.settings.is_paused || !self.settings.progressbar) return false;
self.box_skitter.find('.progressbar').dequeue().animate({width: self.settings.progressbar_css.width}, (self.settings.interval - self.settings.elapsedTime), 'linear');
},
/**
* Hide progress bar
*/
hideProgressBar: function() {
var self = this;
if (!self.settings.progressbar) return false;
self.box_skitter.find('.progressbar').stop().fadeOut(300, function() {
$(this).width(self.settings.progressbar_css.width);
});
},
/**
* Start time
*/
startTime: function() {
var self = this;
self.settings.is_paused_time = false;
var date = new Date();
self.settings.elapsedTime = 0;
self.settings.timeStart = date.getTime();
// Start progress bar
self.startProgressBar();
},
/**
* Pause time
*/
pauseTime: function() {
var self = this;
if (self.settings.is_paused_time) return false;
self.settings.is_paused_time = true;
var date = new Date();
self.settings.elapsedTime += date.getTime() - self.settings.timeStart;
// Pause progress bar
self.pauseProgressBar();
},
/**
* Resume time
*/
resumeTime: function() {
var self = this;
self.settings.is_paused_time = false;
var date = new Date();
self.settings.timeStart = date.getTime();
// Resume progress bar
self.resumeProgressBar();
},
/**
* Enable navigation keys
*/
enableNavigationKeys: function() {
var self = this;
$(window).keydown(function(e) {
// Next
if (e.keyCode == 39 || e.keyCode == 40) {
self.box_skitter.find('.next_button').trigger('click');
}
// Prev
else if (e.keyCode == 37 || e.keyCode == 38) {
self.box_skitter.find('.prev_button').trigger('click');
}
});
},
/**
* Get box clone with background image
*/
getBoxCloneBackground: function(options)
{
var box_clone = $('<div class="box_clone"></div>');
box_clone.css({
'left': options.left,
'top': options.top,
'width': options.width,
'height': options.height,
'background-image': 'url('+options.image+')',
'background-position': options.position.left+'px '+options.position.top+'px'
});
return box_clone;
},
/**
* Shuffle array
* @author Daniel Castro Machado <daniel@cdt.unb.br>
*/
shuffleArray: function (arrayOrigem) {
var self = this;
var arrayDestino = new Array();
var indice;
while (arrayOrigem.length > 0) {
indice = self.randomUnique(0, arrayOrigem.length - 1);
arrayDestino[arrayDestino.length] = arrayOrigem[indice];
arrayOrigem.splice(indice, 1);
}
return arrayDestino;
},
/**
* Gera números aleatórios inteiros entre um intervalo
* @author Daniel Castro Machado <daniel@cdt.unb.br>
*/
randomUnique: function (valorIni, valorFim) {
var numRandom;
do numRandom = Math.random(); while (numRandom == 1); // Evita gerar o número valorFim + 1
return (numRandom * (valorFim - valorIni + 1) + valorIni) | 0;
},
/**
* Stop on window focus out
* @author Dan Partac (http://thiagosf.net/projects/jquery/skitter/#comment-355473307)
*/
windowFocusOut: function () {
var self = this;
$(window).bind('blur', function(){
self.settings.is_blur = true;
self.pauseTime();
self.clearTimer(true);
});
$(window).bind('focus', function(){
if ( self.settings.images_links.length > 1 ) {
self.settings.is_blur = false;
if (self.settings.elapsedTime == 0) {
self.startTime();
}
else {
self.resumeTime();
}
if (self.settings.elapsedTime <= self.settings.interval) {
self.clearTimer(true); // Fix bug IE: double next
self.timer = setTimeout(function() { self.completeMove(); }, self.settings.interval - self.settings.elapsedTime);
self.box_skitter.find('.image_main').attr({'src': self.settings.image_atual});
self.box_skitter.find('.image a').attr({'href': self.settings.link_atual});
}
}
});
}
});
/**
* Helper function for cross-browser CSS3 support, prepends all possible prefixes to all properties passed in
* @param {Object} props Ker/value pairs of CSS3 properties
*/
$.fn.css3 = function(props) {
var css = {};
var prefixes = ['moz', 'ms', 'o', 'webkit'];
for(var prop in props) {
// Add the vendor specific versions
for(var i=0; i<prefixes.length; i++)
css['-'+prefixes[i]+'-'+prop] = props[prop];
// Add the actual version
css[prop] = props[prop];
}
this.css(css);
return this;
};
// Monkey patch jQuery 1.3.1+ to add support for setting or animating CSS
// scale and rotation independently.
// 2009-2010 Zachary Johnson www.zachstronaut.com
// Updated 2010.11.06
var rotateUnits = 'deg';
$.fn.rotate = function (val) {
var style = $(this).css('transform') || 'none';
if (typeof val == 'undefined') {
if (style) {
var m = style.match(/rotate\(([^)]+)\)/);
if (m && m[1]) {
return m[1];
}
}
return 0;
}
var m = val.toString().match(/^(-?\d+(\.\d+)?)(.+)?$/);
if (m) {
if (m[3]) rotateUnits = m[3];
$(this).css('transform',
style.replace(/none|rotate\([^)]*\)/, '') + 'rotate(' + m[1] + rotateUnits + ')'
);
}
return this;
};
// Note that scale is unitless.
$.fn.scale = function (val, duration, options) {
var style = $(this).css('transform');
if (typeof val == 'undefined') {
if (style) {
var m = style.match(/scale\(([^)]+)\)/);
if (m && m[1]) {
return m[1];
}
}
return 1;
}
$(this).css('transform',
style.replace(/none|scale\([^)]*\)/, '') + 'scale(' + val + ')'
);
return this;
};
// fx.cur() must be monkey patched because otherwise it would always
// return 0 for current rotate and scale values
var curProxied = $.fx.prototype.cur;
$.fx.prototype.cur = function () {
if (this.prop == 'rotate') {
return parseFloat($(this.elem).rotate());
}
else if (this.prop == 'scale') {
return parseFloat($(this.elem).scale());
}
return curProxied.apply(this, arguments);
};
$.fx.step.rotate = function (fx) {
$(fx.elem).rotate(fx.now + rotateUnits);
};
$.fx.step.scale = function (fx) {
$(fx.elem).scale(fx.now);
};
var animateProxied = $.fn.animate;
$.fn.animate = function (prop) {
if (typeof prop['rotate'] != 'undefined') {
var m = prop['rotate'].toString().match(/^(([+-]=)?(-?\d+(\.\d+)?))(.+)?$/);
if (m && m[5]) {
rotateUnits = m[5];
}
prop['rotate'] = m[1];
}
return animateProxied.apply(this, arguments);
};
// Monkey patch jQuery 1.3.1+ css() method to support CSS 'transform'
// property uniformly across Safari/Chrome/Webkit, Firefox 3.5+, IE 9+, and Opera 11+.
// 2009-2011 Zachary Johnson www.zachstronaut.com
// Updated 2011.05.04 (May the fourth be with you!)
function getTransformProperty(element) {
var properties = ['transform', 'WebkitTransform', 'msTransform', 'MozTransform', 'OTransform'];
var p;
while (p = properties.shift()) {
if (typeof element.style[p] != 'undefined') {
return p;
}
}
return 'transform';
};
var _propsObj = null;
var proxied = $.fn.css;
$.fn.css = function (arg, val) {
if (_propsObj === null) {
if (typeof $.cssProps != 'undefined') {
_propsObj = $.cssProps;
}
else if (typeof $.props != 'undefined') {
_propsObj = $.props;
}
else {
_propsObj = {};
}
}
if
(
typeof _propsObj['transform'] == 'undefined'
&&
(
arg == 'transform'
||
(
typeof arg == 'object'
&& typeof arg['transform'] != 'undefined'
)
)
) {
_propsObj['transform'] = getTransformProperty(this.get(0));
}
if (_propsObj['transform'] != 'transform') {
// Call in form of css('transform' ...)
if (arg == 'transform') {
arg = _propsObj['transform'];
if (typeof val == 'undefined' && jQuery.style) {
return jQuery.style(this.get(0), arg);
}
}
// Call in form of css({'transform': ...})
else if
(
typeof arg == 'object'
&& typeof arg['transform'] != 'undefined'
) {
arg[_propsObj['transform']] = arg['transform'];
delete arg['transform'];
}
}
return proxied.apply(this, arguments);
};
})(jQuery);
|
RoberMac/jsdelivr
|
files/jquery.skitter/4.0/js/jquery.skitter.js
|
JavaScript
|
mit
| 100,405 |
/*
*
* (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
*
*/
#include "LETypes.h"
#include "LEFontInstance.h"
#include "OpenTypeTables.h"
#include "AnchorTables.h"
#include "MarkArrays.h"
#include "LESwaps.h"
U_NAMESPACE_BEGIN
le_int32 MarkArray::getMarkClass(LEGlyphID glyphID, le_int32 coverageIndex, const LEFontInstance *fontInstance,
LEPoint &anchor) const
{
le_int32 markClass = -1;
if (coverageIndex >= 0) {
le_uint16 mCount = SWAPW(markCount);
if (coverageIndex < mCount) {
const MarkRecord *markRecord = &markRecordArray[coverageIndex];
Offset anchorTableOffset = SWAPW(markRecord->markAnchorTableOffset);
const AnchorTable *anchorTable = (AnchorTable *) ((char *) this + anchorTableOffset);
anchorTable->getAnchor(glyphID, fontInstance, anchor);
markClass = SWAPW(markRecord->markClass);
}
// XXXX If we get here, the table is mal-formed
}
return markClass;
}
U_NAMESPACE_END
|
JellyLu/WinObjC
|
deps/3rdparty/iculegacy/source/layout/MarkArrays.cpp
|
C++
|
mit
| 1,044 |
ace.define("ace/mode/r",["require","exports","module","ace/range","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/r_highlight_rules","ace/mode/matching_brace_outdent","ace/unicode"],function(e,t,n){var r=e("../range").Range,i=e("../lib/oop"),s=e("./text").Mode,o=e("../tokenizer").Tokenizer,u=e("./text_highlight_rules").TextHighlightRules,a=e("./r_highlight_rules").RHighlightRules,f=e("./matching_brace_outdent").MatchingBraceOutdent,l=e("../unicode"),c=function(){this.HighlightRules=a,this.$outdent=new f};i.inherits(c,s),function(){this.lineCommentStart="#"}.call(c.prototype),t.Mode=c}),ace.define("ace/mode/r_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/tex_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=e("./tex_highlight_rules").TexHighlightRules,u=function(){var e=i.arrayToMap("function|if|in|break|next|repeat|else|for|return|switch|while|try|tryCatch|stop|warning|require|library|attach|detach|source|setMethod|setGeneric|setGroupGeneric|setClass".split("|")),t=i.arrayToMap("NULL|NA|TRUE|FALSE|T|F|Inf|NaN|NA_integer_|NA_real_|NA_character_|NA_complex_".split("|"));this.$rules={start:[{token:"comment.sectionhead",regex:"#+(?!').*(?:----|====|####)\\s*$"},{token:"comment",regex:"#+'",next:"rd-start"},{token:"comment",regex:"#.*$"},{token:"string",regex:'["]',next:"qqstring"},{token:"string",regex:"[']",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+[Li]?\\b"},{token:"constant.numeric",regex:"\\d+L\\b"},{token:"constant.numeric",regex:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b"},{token:"constant.numeric",regex:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b"},{token:"constant.language.boolean",regex:"(?:TRUE|FALSE|T|F)\\b"},{token:"identifier",regex:"`.*?`"},{onMatch:function(n){return e[n]?"keyword":t[n]?"constant.language":n=="..."||n.match(/^\.\.\d+$/)?"variable.language":"identifier"},regex:"[a-zA-Z.][a-zA-Z0-9._]*\\b"},{token:"keyword.operator",regex:"%%|>=|<=|==|!=|\\->|<\\-|\\|\\||&&|=|\\+|\\-|\\*|/|\\^|>|<|!|&|\\||~|\\$|:"},{token:"keyword.operator",regex:"%.*?%"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]};var n=(new o("comment")).getRules();for(var r=0;r<n.start.length;r++)n.start[r].token+=".virtual-comment";this.addRules(n,"rd-"),this.$rules["rd-start"].unshift({token:"text",regex:"^",next:"start"}),this.$rules["rd-start"].unshift({token:"keyword",regex:"@(?!@)[^ ]*"}),this.$rules["rd-start"].unshift({token:"comment",regex:"@@"}),this.$rules["rd-start"].push({token:"comment",regex:"[^%\\\\[({\\])}]+"})};r.inherits(u,s),t.RHighlightRules=u}),ace.define("ace/mode/tex_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=function(e){e||(e="text"),this.$rules={start:[{token:"comment",regex:"%.*$"},{token:e,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b",next:"nospell"},{token:"keyword",regex:"\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:e,regex:"\\s+"}],nospell:[{token:"comment",regex:"%.*$",next:"start"},{token:"nospell."+e,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"},{token:"keyword",regex:"\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])",next:"start"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"start"},{token:"nospell."+e,regex:"\\s+"},{token:"nospell."+e,regex:"\\w+"}]}};r.inherits(o,s),t.TexHighlightRules=o}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i})
|
sympmarc/cdnjs
|
ajax/libs/ace/1.1.2/mode-r.js
|
JavaScript
|
mit
| 4,983 |
.mCustomScrollbar{-ms-touch-action:pinch-zoom;touch-action:pinch-zoom}.mCustomScrollbar.mCS_no_scrollbar,.mCustomScrollbar.mCS_touch_action{-ms-touch-action:auto;touch-action:auto}.mCustomScrollBox{position:relative;overflow:hidden;height:100%;max-width:100%;outline:0;direction:ltr}.mCSB_container{overflow:hidden;width:auto;height:auto}.mCSB_inside>.mCSB_container{margin-right:30px}.mCSB_container.mCS_no_scrollbar_y.mCS_y_hidden{margin-right:0}.mCS-dir-rtl>.mCSB_inside>.mCSB_container{margin-right:0;margin-left:30px}.mCS-dir-rtl>.mCSB_inside>.mCSB_container.mCS_no_scrollbar_y.mCS_y_hidden{margin-left:0}.mCSB_scrollTools{position:absolute;width:16px;height:auto;left:auto;top:0;right:0;bottom:0;opacity:.75;filter:"alpha(opacity=75)";-ms-filter:"alpha(opacity=75)"}.mCSB_outside+.mCSB_scrollTools{right:-26px}.mCS-dir-rtl>.mCSB_inside>.mCSB_scrollTools,.mCS-dir-rtl>.mCSB_outside+.mCSB_scrollTools{right:auto;left:0}.mCS-dir-rtl>.mCSB_outside+.mCSB_scrollTools{left:-26px}.mCSB_scrollTools .mCSB_draggerContainer{position:absolute;top:0;left:0;bottom:0;right:0;height:auto}.mCSB_scrollTools a+.mCSB_draggerContainer{margin:20px 0}.mCSB_scrollTools .mCSB_draggerRail{width:2px;height:100%;margin:0 auto;-webkit-border-radius:16px;-moz-border-radius:16px;border-radius:16px}.mCSB_scrollTools .mCSB_dragger{cursor:pointer;width:100%;height:30px;z-index:1}.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{position:relative;width:4px;height:100%;margin:0 auto;-webkit-border-radius:16px;-moz-border-radius:16px;border-radius:16px;text-align:center}.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar,.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar{width:12px}.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded+.mCSB_draggerRail,.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail{width:8px}.mCSB_scrollTools .mCSB_buttonDown,.mCSB_scrollTools .mCSB_buttonUp{display:block;position:absolute;height:20px;width:100%;overflow:hidden;margin:0 auto;cursor:pointer}.mCSB_scrollTools .mCSB_buttonDown{bottom:0}.mCSB_horizontal.mCSB_inside>.mCSB_container{margin-right:0;margin-bottom:30px}.mCSB_horizontal.mCSB_outside>.mCSB_container{min-height:100%}.mCSB_horizontal>.mCSB_container.mCS_no_scrollbar_x.mCS_x_hidden{margin-bottom:0}.mCSB_scrollTools.mCSB_scrollTools_horizontal{width:auto;height:16px;top:auto;right:0;bottom:0;left:0}.mCustomScrollBox+.mCSB_scrollTools+.mCSB_scrollTools.mCSB_scrollTools_horizontal,.mCustomScrollBox+.mCSB_scrollTools.mCSB_scrollTools_horizontal{bottom:-26px}.mCSB_scrollTools.mCSB_scrollTools_horizontal a+.mCSB_draggerContainer{margin:0 20px}.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_draggerRail{width:100%;height:2px;margin:7px 0}.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_dragger{width:30px;height:100%;left:0}.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{width:100%;height:4px;margin:6px auto}.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar,.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar{height:12px;margin:2px auto}.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded+.mCSB_draggerRail,.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail{height:8px;margin:4px 0}.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonLeft,.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonRight{display:block;position:absolute;width:20px;height:100%;overflow:hidden;margin:0 auto;cursor:pointer}.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonLeft{left:0}.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonRight{right:0}.mCSB_container_wrapper{position:absolute;height:auto;width:auto;overflow:hidden;top:0;left:0;right:0;bottom:0;margin-right:30px;margin-bottom:30px}.mCSB_container_wrapper>.mCSB_container{padding-right:30px;padding-bottom:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.mCSB_vertical_horizontal>.mCSB_scrollTools.mCSB_scrollTools_vertical{bottom:20px}.mCSB_vertical_horizontal>.mCSB_scrollTools.mCSB_scrollTools_horizontal{right:20px}.mCSB_container_wrapper.mCS_no_scrollbar_x.mCS_x_hidden+.mCSB_scrollTools.mCSB_scrollTools_vertical{bottom:0}.mCS-dir-rtl>.mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside>.mCSB_scrollTools.mCSB_scrollTools_horizontal,.mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden+.mCSB_scrollTools~.mCSB_scrollTools.mCSB_scrollTools_horizontal{right:0}.mCS-dir-rtl>.mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside>.mCSB_scrollTools.mCSB_scrollTools_horizontal{left:20px}.mCS-dir-rtl>.mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside>.mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden+.mCSB_scrollTools~.mCSB_scrollTools.mCSB_scrollTools_horizontal{left:0}.mCS-dir-rtl>.mCSB_inside>.mCSB_container_wrapper{margin-right:0;margin-left:30px}.mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden>.mCSB_container{padding-right:0}.mCSB_container_wrapper.mCS_no_scrollbar_x.mCS_x_hidden>.mCSB_container{padding-bottom:0}.mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside>.mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden{margin-right:0;margin-left:0}.mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside>.mCSB_container_wrapper.mCS_no_scrollbar_x.mCS_x_hidden{margin-bottom:0}.mCSB_scrollTools,.mCSB_scrollTools .mCSB_buttonDown,.mCSB_scrollTools .mCSB_buttonLeft,.mCSB_scrollTools .mCSB_buttonRight,.mCSB_scrollTools .mCSB_buttonUp,.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{-webkit-transition:opacity .2s ease-in-out,background-color .2s ease-in-out;-moz-transition:opacity .2s ease-in-out,background-color .2s ease-in-out;-o-transition:opacity .2s ease-in-out,background-color .2s ease-in-out;transition:opacity .2s ease-in-out,background-color .2s ease-in-out}.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerRail,.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger_bar,.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerRail,.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger_bar{-webkit-transition:width .2s ease-out .2s,height .2s ease-out .2s,margin-left .2s ease-out .2s,margin-right .2s ease-out .2s,margin-top .2s ease-out .2s,margin-bottom .2s ease-out .2s,opacity .2s ease-in-out,background-color .2s ease-in-out;-moz-transition:width .2s ease-out .2s,height .2s ease-out .2s,margin-left .2s ease-out .2s,margin-right .2s ease-out .2s,margin-top .2s ease-out .2s,margin-bottom .2s ease-out .2s,opacity .2s ease-in-out,background-color .2s ease-in-out;-o-transition:width .2s ease-out .2s,height .2s ease-out .2s,margin-left .2s ease-out .2s,margin-right .2s ease-out .2s,margin-top .2s ease-out .2s,margin-bottom .2s ease-out .2s,opacity .2s ease-in-out,background-color .2s ease-in-out;transition:width .2s ease-out .2s,height .2s ease-out .2s,margin-left .2s ease-out .2s,margin-right .2s ease-out .2s,margin-top .2s ease-out .2s,margin-bottom .2s ease-out .2s,opacity .2s ease-in-out,background-color .2s ease-in-out}.mCS-autoHide>.mCustomScrollBox>.mCSB_scrollTools,.mCS-autoHide>.mCustomScrollBox~.mCSB_scrollTools{opacity:0;filter:"alpha(opacity=0)";-ms-filter:"alpha(opacity=0)"}.mCS-autoHide:hover>.mCustomScrollBox>.mCSB_scrollTools,.mCS-autoHide:hover>.mCustomScrollBox~.mCSB_scrollTools,.mCustomScrollBox:hover>.mCSB_scrollTools,.mCustomScrollBox:hover~.mCSB_scrollTools,.mCustomScrollbar>.mCustomScrollBox>.mCSB_scrollTools.mCSB_scrollTools_onDrag,.mCustomScrollbar>.mCustomScrollBox~.mCSB_scrollTools.mCSB_scrollTools_onDrag{opacity:1;filter:"alpha(opacity=100)";-ms-filter:"alpha(opacity=100)"}.mCSB_scrollTools .mCSB_draggerRail{background-color:#000;background-color:rgba(0,0,0,.4);filter:"alpha(opacity=40)";-ms-filter:"alpha(opacity=40)"}.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{background-color:#fff;background-color:rgba(255,255,255,.75);filter:"alpha(opacity=75)";-ms-filter:"alpha(opacity=75)"}.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{background-color:#fff;background-color:rgba(255,255,255,.85);filter:"alpha(opacity=85)";-ms-filter:"alpha(opacity=85)"}.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar{background-color:#fff;background-color:rgba(255,255,255,.9);filter:"alpha(opacity=90)";-ms-filter:"alpha(opacity=90)"}.mCSB_scrollTools .mCSB_buttonDown,.mCSB_scrollTools .mCSB_buttonLeft,.mCSB_scrollTools .mCSB_buttonRight,.mCSB_scrollTools .mCSB_buttonUp{background-image:url(mCSB_buttons.png);background-repeat:no-repeat;opacity:.4;filter:"alpha(opacity=40)";-ms-filter:"alpha(opacity=40)"}.mCSB_scrollTools .mCSB_buttonUp{background-position:0 0}.mCSB_scrollTools .mCSB_buttonDown{background-position:0 -20px}.mCSB_scrollTools .mCSB_buttonLeft{background-position:0 -40px}.mCSB_scrollTools .mCSB_buttonRight{background-position:0 -56px}.mCSB_scrollTools .mCSB_buttonDown:hover,.mCSB_scrollTools .mCSB_buttonLeft:hover,.mCSB_scrollTools .mCSB_buttonRight:hover,.mCSB_scrollTools .mCSB_buttonUp:hover{opacity:.75;filter:"alpha(opacity=75)";-ms-filter:"alpha(opacity=75)"}.mCSB_scrollTools .mCSB_buttonDown:active,.mCSB_scrollTools .mCSB_buttonLeft:active,.mCSB_scrollTools .mCSB_buttonRight:active,.mCSB_scrollTools .mCSB_buttonUp:active{opacity:.9;filter:"alpha(opacity=90)";-ms-filter:"alpha(opacity=90)"}.mCS-dark.mCSB_scrollTools .mCSB_draggerRail{background-color:#000;background-color:rgba(0,0,0,.15)}.mCS-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.75)}.mCS-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{background-color:rgba(0,0,0,.85)}.mCS-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar{background-color:rgba(0,0,0,.9)}.mCS-dark.mCSB_scrollTools .mCSB_buttonUp{background-position:-80px 0}.mCS-dark.mCSB_scrollTools .mCSB_buttonDown{background-position:-80px -20px}.mCS-dark.mCSB_scrollTools .mCSB_buttonLeft{background-position:-80px -40px}.mCS-dark.mCSB_scrollTools .mCSB_buttonRight{background-position:-80px -56px}.mCS-dark-2.mCSB_scrollTools .mCSB_draggerRail,.mCS-light-2.mCSB_scrollTools .mCSB_draggerRail{width:4px;background-color:#fff;background-color:rgba(255,255,255,.1);-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px}.mCS-dark-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-light-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{width:4px;background-color:#fff;background-color:rgba(255,255,255,.75);-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px}.mCS-dark-2.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-dark-2.mCSB_scrollTools_horizontal .mCSB_draggerRail,.mCS-light-2.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-light-2.mCSB_scrollTools_horizontal .mCSB_draggerRail{width:100%;height:4px;margin:6px auto}.mCS-light-2.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{background-color:#fff;background-color:rgba(255,255,255,.85)}.mCS-light-2.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-light-2.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar{background-color:#fff;background-color:rgba(255,255,255,.9)}.mCS-light-2.mCSB_scrollTools .mCSB_buttonUp{background-position:-32px 0}.mCS-light-2.mCSB_scrollTools .mCSB_buttonDown{background-position:-32px -20px}.mCS-light-2.mCSB_scrollTools .mCSB_buttonLeft{background-position:-40px -40px}.mCS-light-2.mCSB_scrollTools .mCSB_buttonRight{background-position:-40px -56px}.mCS-dark-2.mCSB_scrollTools .mCSB_draggerRail{background-color:#000;background-color:rgba(0,0,0,.1);-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px}.mCS-dark-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.75);-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px}.mCS-dark-2.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.85)}.mCS-dark-2.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-dark-2.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.9)}.mCS-dark-2.mCSB_scrollTools .mCSB_buttonUp{background-position:-112px 0}.mCS-dark-2.mCSB_scrollTools .mCSB_buttonDown{background-position:-112px -20px}.mCS-dark-2.mCSB_scrollTools .mCSB_buttonLeft{background-position:-120px -40px}.mCS-dark-2.mCSB_scrollTools .mCSB_buttonRight{background-position:-120px -56px}.mCS-dark-thick.mCSB_scrollTools .mCSB_draggerRail,.mCS-light-thick.mCSB_scrollTools .mCSB_draggerRail{width:4px;background-color:#fff;background-color:rgba(255,255,255,.1);-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-light-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{width:6px;background-color:#fff;background-color:rgba(255,255,255,.75);-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mCS-dark-thick.mCSB_scrollTools_horizontal .mCSB_draggerRail,.mCS-light-thick.mCSB_scrollTools_horizontal .mCSB_draggerRail{width:100%;height:4px;margin:6px 0}.mCS-dark-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-light-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{width:100%;height:6px;margin:5px auto}.mCS-light-thick.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{background-color:#fff;background-color:rgba(255,255,255,.85)}.mCS-light-thick.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-light-thick.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar{background-color:#fff;background-color:rgba(255,255,255,.9)}.mCS-light-thick.mCSB_scrollTools .mCSB_buttonUp{background-position:-16px 0}.mCS-light-thick.mCSB_scrollTools .mCSB_buttonDown{background-position:-16px -20px}.mCS-light-thick.mCSB_scrollTools .mCSB_buttonLeft{background-position:-20px -40px}.mCS-light-thick.mCSB_scrollTools .mCSB_buttonRight{background-position:-20px -56px}.mCS-dark-thick.mCSB_scrollTools .mCSB_draggerRail{background-color:#000;background-color:rgba(0,0,0,.1);-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.75);-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.85)}.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.9)}.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonUp{background-position:-96px 0}.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonDown{background-position:-96px -20px}.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonLeft{background-position:-100px -40px}.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonRight{background-position:-100px -56px}.mCS-light-thin.mCSB_scrollTools .mCSB_draggerRail{background-color:#fff;background-color:rgba(255,255,255,.1)}.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-light-thin.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{width:2px}.mCS-dark-thin.mCSB_scrollTools_horizontal .mCSB_draggerRail,.mCS-light-thin.mCSB_scrollTools_horizontal .mCSB_draggerRail{width:100%}.mCS-dark-thin.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-light-thin.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{width:100%;height:2px;margin:7px auto}.mCS-dark-thin.mCSB_scrollTools .mCSB_draggerRail{background-color:#000;background-color:rgba(0,0,0,.15)}.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.75)}.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.85)}.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.9)}.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonUp{background-position:-80px 0}.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonDown{background-position:-80px -20px}.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonLeft{background-position:-80px -40px}.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonRight{background-position:-80px -56px}.mCS-rounded.mCSB_scrollTools .mCSB_draggerRail{background-color:#fff;background-color:rgba(255,255,255,.15)}.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger,.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger,.mCS-rounded-dots.mCSB_scrollTools .mCSB_dragger,.mCS-rounded.mCSB_scrollTools .mCSB_dragger{height:14px}.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-rounded-dots.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-rounded.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{width:14px;margin:0 1px}.mCS-rounded-dark.mCSB_scrollTools_horizontal .mCSB_dragger,.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_dragger,.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_dragger,.mCS-rounded.mCSB_scrollTools_horizontal .mCSB_dragger{width:14px}.mCS-rounded-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-rounded.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{height:14px;margin:1px 0}.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar,.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar,.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar,.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar{width:16px;height:16px;margin:-1px 0}.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded+.mCSB_draggerRail,.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail,.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded+.mCSB_draggerRail,.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail{width:4px}.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar,.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar,.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar,.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar{height:16px;width:16px;margin:0 -1px}.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded+.mCSB_draggerRail,.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail,.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded+.mCSB_draggerRail,.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail{height:4px;margin:6px 0}.mCS-rounded.mCSB_scrollTools .mCSB_buttonUp{background-position:0 -72px}.mCS-rounded.mCSB_scrollTools .mCSB_buttonDown{background-position:0 -92px}.mCS-rounded.mCSB_scrollTools .mCSB_buttonLeft{background-position:0 -112px}.mCS-rounded.mCSB_scrollTools .mCSB_buttonRight{background-position:0 -128px}.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.75)}.mCS-rounded-dark.mCSB_scrollTools .mCSB_draggerRail{background-color:#000;background-color:rgba(0,0,0,.15)}.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar,.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.85)}.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.9)}.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonUp{background-position:-80px -72px}.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonDown{background-position:-80px -92px}.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonLeft{background-position:-80px -112px}.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonRight{background-position:-80px -128px}.mCS-rounded-dots-dark.mCSB_scrollTools_vertical .mCSB_draggerRail,.mCS-rounded-dots.mCSB_scrollTools_vertical .mCSB_draggerRail{width:4px}.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_draggerRail,.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail,.mCS-rounded-dots.mCSB_scrollTools .mCSB_draggerRail,.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_draggerRail{background-color:transparent;background-position:center}.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_draggerRail,.mCS-rounded-dots.mCSB_scrollTools .mCSB_draggerRail{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAANElEQVQYV2NkIAAYiVbw//9/Y6DiM1ANJoyMjGdBbLgJQAX/kU0DKgDLkaQAvxW4HEvQFwCRcxIJK1XznAAAAABJRU5ErkJggg==);background-repeat:repeat-y;opacity:.3;filter:"alpha(opacity=30)";-ms-filter:"alpha(opacity=30)"}.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail,.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_draggerRail{height:4px;margin:6px 0;background-repeat:repeat-x}.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonUp{background-position:-16px -72px}.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonDown{background-position:-16px -92px}.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonLeft{background-position:-20px -112px}.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonRight{background-position:-20px -128px}.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_draggerRail{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAALElEQVQYV2NkIAAYSVFgDFR8BqrBBEifBbGRTfiPZhpYjiQFBK3A6l6CvgAAE9kGCd1mvgEAAAAASUVORK5CYII=)}.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonUp{background-position:-96px -72px}.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonDown{background-position:-96px -92px}.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonLeft{background-position:-100px -112px}.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonRight{background-position:-100px -128px}.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{background-repeat:repeat-y;background-image:-moz-linear-gradient(left,rgba(255,255,255,.5) 0,rgba(255,255,255,0) 100%);background-image:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,.5)),color-stop(100%,rgba(255,255,255,0)));background-image:-webkit-linear-gradient(left,rgba(255,255,255,.5) 0,rgba(255,255,255,0) 100%);background-image:-o-linear-gradient(left,rgba(255,255,255,.5) 0,rgba(255,255,255,0) 100%);background-image:-ms-linear-gradient(left,rgba(255,255,255,.5) 0,rgba(255,255,255,0) 100%);background-image:linear-gradient(to right,rgba(255,255,255,.5) 0,rgba(255,255,255,0) 100%)}.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-3d-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-3d.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{background-repeat:repeat-x;background-image:-moz-linear-gradient(top,rgba(255,255,255,.5) 0,rgba(255,255,255,0) 100%);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,rgba(255,255,255,.5)),color-stop(100%,rgba(255,255,255,0)));background-image:-webkit-linear-gradient(top,rgba(255,255,255,.5) 0,rgba(255,255,255,0) 100%);background-image:-o-linear-gradient(top,rgba(255,255,255,.5) 0,rgba(255,255,255,0) 100%);background-image:-ms-linear-gradient(top,rgba(255,255,255,.5) 0,rgba(255,255,255,0) 100%);background-image:linear-gradient(to bottom,rgba(255,255,255,.5) 0,rgba(255,255,255,0) 100%)}.mCS-3d-dark.mCSB_scrollTools_vertical .mCSB_dragger,.mCS-3d.mCSB_scrollTools_vertical .mCSB_dragger{height:70px}.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_dragger,.mCS-3d.mCSB_scrollTools_horizontal .mCSB_dragger{width:70px}.mCS-3d-dark.mCSB_scrollTools,.mCS-3d.mCSB_scrollTools{opacity:1;filter:"alpha(opacity=30)";-ms-filter:"alpha(opacity=30)"}.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail,.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-3d.mCSB_scrollTools .mCSB_draggerRail{-webkit-border-radius:16px;-moz-border-radius:16px;border-radius:16px}.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail,.mCS-3d.mCSB_scrollTools .mCSB_draggerRail{width:8px;background-color:#000;background-color:rgba(0,0,0,.2);box-shadow:inset 1px 0 1px rgba(0,0,0,.5),inset -1px 0 1px rgba(255,255,255,.2)}.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar,.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-3d.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-3d.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,.mCS-3d.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{background-color:#555}.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{width:8px}.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail,.mCS-3d.mCSB_scrollTools_horizontal .mCSB_draggerRail{width:100%;height:8px;margin:4px 0;box-shadow:inset 0 1px 1px rgba(0,0,0,.5),inset 0 -1px 1px rgba(255,255,255,.2)}.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-3d.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{width:100%;height:8px;margin:4px auto}.mCS-3d.mCSB_scrollTools .mCSB_buttonUp{background-position:-32px -72px}.mCS-3d.mCSB_scrollTools .mCSB_buttonDown{background-position:-32px -92px}.mCS-3d.mCSB_scrollTools .mCSB_buttonLeft{background-position:-40px -112px}.mCS-3d.mCSB_scrollTools .mCSB_buttonRight{background-position:-40px -128px}.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail{background-color:#000;background-color:rgba(0,0,0,.1);box-shadow:inset 1px 0 1px rgba(0,0,0,.1)}.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail{box-shadow:inset 0 1px 1px rgba(0,0,0,.1)}.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonUp{background-position:-112px -72px}.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonDown{background-position:-112px -92px}.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonLeft{background-position:-120px -112px}.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonRight{background-position:-120px -128px}.mCS-3d-thick-dark.mCSB_scrollTools,.mCS-3d-thick.mCSB_scrollTools{opacity:1;filter:"alpha(opacity=30)";-ms-filter:"alpha(opacity=30)"}.mCS-3d-thick-dark.mCSB_scrollTools,.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_draggerContainer,.mCS-3d-thick.mCSB_scrollTools,.mCS-3d-thick.mCSB_scrollTools .mCSB_draggerContainer{-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mCSB_inside+.mCS-3d-thick-dark.mCSB_scrollTools_vertical,.mCSB_inside+.mCS-3d-thick.mCSB_scrollTools_vertical{right:1px}.mCS-3d-thick-dark.mCSB_scrollTools_vertical,.mCS-3d-thick.mCSB_scrollTools_vertical{box-shadow:inset 1px 0 1px rgba(0,0,0,.1),inset 0 0 14px rgba(0,0,0,.5)}.mCS-3d-thick-dark.mCSB_scrollTools_horizontal,.mCS-3d-thick.mCSB_scrollTools_horizontal{bottom:1px;box-shadow:inset 0 1px 1px rgba(0,0,0,.1),inset 0 0 14px rgba(0,0,0,.5)}.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;box-shadow:inset 1px 0 0 rgba(255,255,255,.4);width:12px;margin:2px;position:absolute;height:auto;top:0;bottom:0;left:0;right:0}.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-3d-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{box-shadow:inset 0 1px 0 rgba(255,255,255,.4);height:12px;width:auto}.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{background-color:#555}.mCS-3d-thick.mCSB_scrollTools .mCSB_draggerContainer{background-color:#000;background-color:rgba(0,0,0,.05);box-shadow:inset 1px 1px 16px rgba(0,0,0,.1)}.mCS-3d-thick.mCSB_scrollTools .mCSB_draggerRail{background-color:transparent}.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonUp{background-position:-32px -72px}.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonDown{background-position:-32px -92px}.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonLeft{background-position:-40px -112px}.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonRight{background-position:-40px -128px}.mCS-3d-thick-dark.mCSB_scrollTools{box-shadow:inset 0 0 14px rgba(0,0,0,.2)}.mCS-3d-thick-dark.mCSB_scrollTools_horizontal{box-shadow:inset 0 1px 1px rgba(0,0,0,.1),inset 0 0 14px rgba(0,0,0,.2)}.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{box-shadow:inset 1px 0 0 rgba(255,255,255,.4),inset -1px 0 0 rgba(0,0,0,.2)}.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{box-shadow:inset 0 1px 0 rgba(255,255,255,.4),inset 0 -1px 0 rgba(0,0,0,.2)}.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{background-color:#777}.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_draggerContainer{background-color:#fff;background-color:rgba(0,0,0,.05);box-shadow:inset 1px 1px 16px rgba(0,0,0,.1)}.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_draggerRail,.mCS-minimal-dark.mCSB_scrollTools .mCSB_draggerRail,.mCS-minimal.mCSB_scrollTools .mCSB_draggerRail{background-color:transparent}.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonUp{background-position:-112px -72px}.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonDown{background-position:-112px -92px}.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonLeft{background-position:-120px -112px}.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonRight{background-position:-120px -128px}.mCSB_outside+.mCS-minimal-dark.mCSB_scrollTools_vertical,.mCSB_outside+.mCS-minimal.mCSB_scrollTools_vertical{right:0;margin:12px 0}.mCustomScrollBox.mCS-minimal+.mCSB_scrollTools+.mCSB_scrollTools.mCSB_scrollTools_horizontal,.mCustomScrollBox.mCS-minimal+.mCSB_scrollTools.mCSB_scrollTools_horizontal,.mCustomScrollBox.mCS-minimal-dark+.mCSB_scrollTools+.mCSB_scrollTools.mCSB_scrollTools_horizontal,.mCustomScrollBox.mCS-minimal-dark+.mCSB_scrollTools.mCSB_scrollTools_horizontal{bottom:0;margin:0 12px}.mCS-dir-rtl>.mCSB_outside+.mCS-minimal-dark.mCSB_scrollTools_vertical,.mCS-dir-rtl>.mCSB_outside+.mCS-minimal.mCSB_scrollTools_vertical{left:0;right:auto}.mCS-minimal-dark.mCSB_scrollTools_vertical .mCSB_dragger,.mCS-minimal.mCSB_scrollTools_vertical .mCSB_dragger{height:50px}.mCS-minimal-dark.mCSB_scrollTools_horizontal .mCSB_dragger,.mCS-minimal.mCSB_scrollTools_horizontal .mCSB_dragger{width:50px}.mCS-minimal.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{background-color:#fff;background-color:rgba(255,255,255,.2);filter:"alpha(opacity=20)";-ms-filter:"alpha(opacity=20)"}.mCS-minimal.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-minimal.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar{background-color:#fff;background-color:rgba(255,255,255,.5);filter:"alpha(opacity=50)";-ms-filter:"alpha(opacity=50)"}.mCS-minimal-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.2);filter:"alpha(opacity=20)";-ms-filter:"alpha(opacity=20)"}.mCS-minimal-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-minimal-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.5);filter:"alpha(opacity=50)";-ms-filter:"alpha(opacity=50)"}.mCS-dark-3.mCSB_scrollTools .mCSB_draggerRail,.mCS-light-3.mCSB_scrollTools .mCSB_draggerRail{width:6px;background-color:#000;background-color:rgba(0,0,0,.2)}.mCS-dark-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-light-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{width:6px}.mCS-dark-3.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-dark-3.mCSB_scrollTools_horizontal .mCSB_draggerRail,.mCS-light-3.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-light-3.mCSB_scrollTools_horizontal .mCSB_draggerRail{width:100%;height:6px;margin:5px 0}.mCS-dark-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded+.mCSB_draggerRail,.mCS-dark-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail,.mCS-light-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded+.mCSB_draggerRail,.mCS-light-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail{width:12px}.mCS-dark-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded+.mCSB_draggerRail,.mCS-dark-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail,.mCS-light-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded+.mCSB_draggerRail,.mCS-light-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail{height:12px;margin:2px 0}.mCS-light-3.mCSB_scrollTools .mCSB_buttonUp{background-position:-32px -72px}.mCS-light-3.mCSB_scrollTools .mCSB_buttonDown{background-position:-32px -92px}.mCS-light-3.mCSB_scrollTools .mCSB_buttonLeft{background-position:-40px -112px}.mCS-light-3.mCSB_scrollTools .mCSB_buttonRight{background-position:-40px -128px}.mCS-dark-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.75)}.mCS-dark-3.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.85)}.mCS-dark-3.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-dark-3.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.9)}.mCS-dark-3.mCSB_scrollTools .mCSB_draggerRail{background-color:#000;background-color:rgba(0,0,0,.1)}.mCS-dark-3.mCSB_scrollTools .mCSB_buttonUp{background-position:-112px -72px}.mCS-dark-3.mCSB_scrollTools .mCSB_buttonDown{background-position:-112px -92px}.mCS-dark-3.mCSB_scrollTools .mCSB_buttonLeft{background-position:-120px -112px}.mCS-dark-3.mCSB_scrollTools .mCSB_buttonRight{background-position:-120px -128px}.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail,.mCS-inset-2.mCSB_scrollTools .mCSB_draggerRail,.mCS-inset-3-dark.mCSB_scrollTools .mCSB_draggerRail,.mCS-inset-3.mCSB_scrollTools .mCSB_draggerRail,.mCS-inset-dark.mCSB_scrollTools .mCSB_draggerRail,.mCS-inset.mCSB_scrollTools .mCSB_draggerRail{width:12px;background-color:#000;background-color:rgba(0,0,0,.2)}.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-inset-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-inset-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-inset.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{width:6px;margin:3px 5px;position:absolute;height:auto;top:0;bottom:0;left:0;right:0}.mCS-inset-2-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-inset-2.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-inset-3-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-inset-3.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-inset-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar,.mCS-inset.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{height:6px;margin:5px 3px;position:absolute;width:auto;top:0;bottom:0;left:0;right:0}.mCS-inset-2-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail,.mCS-inset-2.mCSB_scrollTools_horizontal .mCSB_draggerRail,.mCS-inset-3-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail,.mCS-inset-3.mCSB_scrollTools_horizontal .mCSB_draggerRail,.mCS-inset-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail,.mCS-inset.mCSB_scrollTools_horizontal .mCSB_draggerRail{width:100%;height:12px;margin:2px 0}.mCS-inset-2.mCSB_scrollTools .mCSB_buttonUp,.mCS-inset-3.mCSB_scrollTools .mCSB_buttonUp,.mCS-inset.mCSB_scrollTools .mCSB_buttonUp{background-position:-32px -72px}.mCS-inset-2.mCSB_scrollTools .mCSB_buttonDown,.mCS-inset-3.mCSB_scrollTools .mCSB_buttonDown,.mCS-inset.mCSB_scrollTools .mCSB_buttonDown{background-position:-32px -92px}.mCS-inset-2.mCSB_scrollTools .mCSB_buttonLeft,.mCS-inset-3.mCSB_scrollTools .mCSB_buttonLeft,.mCS-inset.mCSB_scrollTools .mCSB_buttonLeft{background-position:-40px -112px}.mCS-inset-2.mCSB_scrollTools .mCSB_buttonRight,.mCS-inset-3.mCSB_scrollTools .mCSB_buttonRight,.mCS-inset.mCSB_scrollTools .mCSB_buttonRight{background-position:-40px -128px}.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar,.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.75)}.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar,.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar,.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.85)}.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.9)}.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail,.mCS-inset-3-dark.mCSB_scrollTools .mCSB_draggerRail,.mCS-inset-dark.mCSB_scrollTools .mCSB_draggerRail{background-color:#000;background-color:rgba(0,0,0,.1)}.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonUp,.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonUp,.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonUp{background-position:-112px -72px}.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonDown,.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonDown,.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonDown{background-position:-112px -92px}.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonLeft,.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonLeft,.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonLeft{background-position:-120px -112px}.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonRight,.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonRight,.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonRight{background-position:-120px -128px}.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail,.mCS-inset-2.mCSB_scrollTools .mCSB_draggerRail{background-color:transparent;border-width:1px;border-style:solid;border-color:#fff;border-color:rgba(255,255,255,.2);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail{border-color:#000;border-color:rgba(0,0,0,.2)}.mCS-inset-3.mCSB_scrollTools .mCSB_draggerRail{background-color:#fff;background-color:rgba(255,255,255,.6)}.mCS-inset-3-dark.mCSB_scrollTools .mCSB_draggerRail{background-color:#000;background-color:rgba(0,0,0,.6)}.mCS-inset-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.75)}.mCS-inset-3.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.85)}.mCS-inset-3.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-inset-3.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar{background-color:#000;background-color:rgba(0,0,0,.9)}.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{background-color:#fff;background-color:rgba(255,255,255,.75)}.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{background-color:#fff;background-color:rgba(255,255,255,.85)}.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar{background-color:#fff;background-color:rgba(255,255,255,.9)}
|
giogio96/Zero-WordPress_Starter_Theme
|
library/js/plugin/custom-scrollbar/jquery.mCustomScrollbar.min.css
|
CSS
|
mit
| 42,839 |
.ws-custom-file{zoom:1}.ws-custom-file:before,.ws-custom-file:after{display:table;clear:both;content:' '}.ws-popover,.ws-range .ws-range-thumb,.ws-inline-picker,div.ws-inline-picker{-moz-box-sizing:content-box;box-sizing:content-box}.ws-popover *,.ws-range .ws-range-thumb *,.ws-inline-picker *,div.ws-inline-picker *,.ws-popover:before,.ws-range .ws-range-thumb:before,.ws-inline-picker:before,.ws-popover:after,.ws-range .ws-range-thumb:after,.ws-inline-picker:after,.ws-popover :after,.ws-range .ws-range-thumb :after,.ws-inline-picker :after,.ws-popover :before,.ws-range .ws-range-thumb :before,.ws-inline-picker :before{-moz-box-sizing:content-box;box-sizing:content-box}.ws-important-hide{display:none!important;visibility:hidden!important;position:absolute;top:-999999px}.ws-po-box button,.ws-custom-file>button{display:inline-block;overflow:visible;position:relative;margin:0;border:0;padding:0;-webkit-appearance:none;appearance:none;font-family:inherit;background:transparent;cursor:pointer;font-size:inherit;line-height:inherit;touch-action:none}.ws-po-box button::-moz-focus-inner,.ws-custom-file>button::-moz-focus-inner{border:0;padding:0}.ws-po-box button[disabled],.ws-custom-file>button[disabled]{cursor:default;color:#888}[hidden]{display:none}article,aside,canvas,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio{display:none;height:0;width:0;overflow:hidden}video{overflow:hidden}video,audio[controls]{display:inline-block;min-height:45px;min-width:40px}audio[controls]{width:300px}video>*,audio>*{visibility:hidden}.no-swf video>*,.no-swf audio>*{visibility:inherit}.polyfill-mediaelement>iframe{border:0;padding:0;margin:0;width:100%;height:100%}.flashblocker-assumed{min-height:20px;min-width:20px;z-index:99999}.cue-display{position:absolute!important;margin:0;padding:0!important;max-width:100%!important;max-height:100%!important;border:0!important;background:none!important;text-align:center;visibility:hidden;font-family:sans-serif;font-size:12px;white-space:pre-wrap;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}.cue-display b{font-weight:700}.cue-display i{font-style:italic}.cue-display u{text-decoration:underline}.cue-display span.cue-wrapper{position:absolute;left:0;bottom:0;right:0;display:block;padding:0;margin:0;width:100%;font-size:160%;color:#fff;visibility:visible!important;pointer-events:none}.cue-display .cue-line{display:block}.cue-display span.cue{display:inline-block;padding:3px 5px;background:#000;background:rgba(0,0,0,.8);color:#fff}.cue-display .description-cues{position:absolute;top:-99px;left:-99px;display:block;width:5px;height:5px;overflow:hidden}mark{background-color:#ff9;color:#000;font-style:italic;font-weight:700}.ws-range,.ws-range *,.placeholder-box,.placeholder-text,.input-buttons,.input-buttons *,.details-open-indicator,.ws-input-seperator,progress span.progress-value{margin:0;padding:0;border:0;width:auto;background:transparent none}output{position:relative}.webshims-visual-hide{position:absolute!important;top:0!important;left:0!important;visibility:hidden!important;width:0!important;height:0!important;overflow:hidden!important}.webshims-visual-hide *{visibility:hidden!important}.placeholder-box{position:relative;display:inline-block;zoom:1}.placeholder-box-input{vertical-align:bottom}.placeholder-box-left{float:left}.placeholder-box-right{float:right}.placeholder-text{position:absolute;display:none;top:0;left:0;overflow:hidden;color:#999;line-height:1;cursor:text}.placeholder-visible .placeholder-text,.placeholder-text.placeholder-visible{display:inline-block}.placeholder-box-input .placeholder-text{white-space:nowrap}.placeholder-visible{color:#999}.placeholder-focused.placeholder-visible{color:#ccc}.ws-popover{font-size:13px;display:block;visibility:hidden;overflow:hidden;position:absolute;top:0;left:0;outline:0;padding:0 .92308em;margin:0 0 0 -.92308em;z-index:1100;min-width:3.84615em;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:translate3d(0px,0,0);transform:translate3d(0px,0,0);-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:visibility 400ms ease-in-out;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;direction:ltr;-webkit-tap-highlight-color:transparent}.ws-popover.ws-is-rtl{direction:rtl;margin:0 0 0 .92308em}.ws-popover.no-transition{display:none}.ws-popover.ws-po-visible{visibility:visible;display:block}.ws-po-outerbox{position:relative;opacity:0;padding:.84615em 0 .69231em;-webkit-transform:translate(0,-100%);transform:translate(0,-100%);transition:all 400ms ease-in-out}[data-vertical=bottom] .ws-po-outerbox{-webkit-transform:translate(0,100%);transform:translate(0,100%);padding:.30769em 0 .84615em}[data-vertical=middle] .ws-po-outerbox{-webkit-transform:translate(0,0) scale(0.3);transform:translate(0,0) scale(0.3);padding:.30769em 0}.ws-popover.ws-po-visible .ws-po-outerbox,div.ws-popover[data-vertical][data-horizontal].ws-po-visible .ws-po-outerbox{opacity:1;-webkit-transform:translate(0,0) scale(1);transform:translate(0,0) scale(1)}.ws-po-box{border:.07692em solid #ccc;background:#fff;padding:.38462em .38462em .23077em;border-radius:.23077em;box-shadow:0 .07692em .38462em rgba(0,0,0,.25)}.ws-po-arrow{position:absolute;top:.30769em;left:1.53846em;display:block;width:0;height:0;border-left:.61538em solid transparent;border-right:.61538em solid transparent;border-bottom:.61538em solid #ccc;border-top:0;zoom:1}.ws-is-rtl .ws-po-arrow{left:auto;right:1.53846em}[data-horizontal=center] .ws-po-arrow{left:50%;margin-left:-.30769em}[data-horizontal=right] .ws-po-arrow{left:auto;right:1.53846em}[data-vertical=bottom] .ws-po-arrow{top:auto;bottom:.30769em;border-bottom:0;border-top:.61538em solid #ccc}html .ws-po-arrow{border-left-color:transparent;border-right-color:transparent}html .ws-po-arrow .ws-po-arrowbox{border-left-color:transparent;border-right-color:transparent}[data-vertical=middle] .ws-po-arrow{display:none}.ws-po-arrow .ws-po-arrowbox{position:relative;top:.07692em;left:-.53846em;display:block;width:0;height:0;border-left:.53846em solid transparent;border-right:.53846em solid transparent;border-bottom:.53846em solid #fefefe;border-top:0;z-index:999999999}.ws-is-rtl .ws-po-arrow .ws-po-arrowbox{left:auto;right:-.53846em}[data-vertical=bottom] .ws-po-arrow .ws-po-arrowbox{top:-.61538em;border-bottom:0;border-top:.53846em solid #fefefe}datalist{display:none}input[data-wslist]::-webkit-calendar-picker-indicator{display:none}.datalist-polyfill{position:absolute!important}.datalist-polyfill .ws-po-box{padding:.38462em 0}.datalist-polyfill .datalist-box{position:relative;max-height:15.38462em;overflow:hidden;overflow-x:hidden!important;overflow-y:auto}.datalist-polyfill .datalist-box ul,.datalist-polyfill .datalist-box li{font-size:100%;list-style:none!important}.datalist-polyfill .datalist-box ul{position:static!important;overflow:hidden;margin:0;padding:.07692em 0;height:auto!important;background-color:#fff;color:#000}.datalist-polyfill .datalist-box li{margin:.07692em 0;padding:.15385em .76923em;overflow:hidden;white-space:nowrap;cursor:default;zoom:1;overflow:hidden;text-overflow:ellipsis;background-color:#fff;transition:background-color 400ms;touch-action:none}.datalist-polyfill .datalist-box mark{font-weight:400;font-style:normal}.datalist-polyfill .datalist-box .option-value{display:inline-block;text-overflow:ellipsis;max-width:100%;color:#000;float:left;transition:color 400ms}.datalist-polyfill .datalist-box .option-label{display:none;max-width:100%;float:right;font-size:90%;color:#666;text-overflow:ellipsis;vertical-align:bottom;margin-top:.15em;margin-left:.76923em;text-align:right;transition:color 400ms}.datalist-polyfill .datalist-box .has-option-label .option-label{display:inline-block}.datalist-polyfill .datalist-box .hidden-item{display:none!important}.datalist-polyfill .datalist-box .active-item{cursor:default;background-color:#39f}.datalist-polyfill .datalist-box .active-item .option-value{color:#fff}.datalist-polyfill .datalist-box .active-item .option-label{color:#eee}.datalist-polyfill.ws-is-rtl .option-value{float:right}.datalist-polyfill.ws-is-rtl .option-label{float:left;margin-right:.76923em;margin-left:0;text-align:left}.validity-alert{display:inline-block;z-index:1000000000}.validity-alert .ws-titlevalue{display:block}.ws-errorbox{display:none;border:0;margin:0;padding:0;overflow:hidden;position:relative;clear:both}.ws-errorbox p{margin:2px 0 3px;padding:0;color:#a94442}progress{position:relative;display:inline-block;width:164px;height:20px;overflow:hidden;-moz-box-sizing:border-box;box-sizing:border-box;vertical-align:-.2em}progress>*{display:none!important}progress[data-position],progress.ws-style{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;border:1px solid #ddd;background:#f0f0f0;box-shadow:0 1px 2px rgba(0,0,0,.1) inset;border-radius:4px}progress[data-position]::-webkit-progress-bar,progress.ws-style::-webkit-progress-bar{border:1px solid #ddd;background:#f0f0f0;box-shadow:0 1px 2px rgba(0,0,0,.1) inset;border-radius:4px;border:0 none}progress[data-position]::-moz-progress-bar,progress.ws-style::-moz-progress-bar{border:1px solid #ddd;background:#f0f0f0;box-shadow:0 1px 2px rgba(0,0,0,.1) inset;border-radius:4px}progress[data-position]::-ms-fill,progress.ws-style::-ms-fill{animation-name:none;border:1px solid #ddd;background:#f0f0f0;box-shadow:0 1px 2px rgba(0,0,0,.1) inset;border-radius:4px}progress[data-position]>span.progress-value,progress.ws-style>span.progress-value{left:0}progress[data-position].ws-is-rtl>span.progress-value,progress.ws-style.ws-is-rtl>span.progress-value{left:auto;right:0}progress[data-position]::-webkit-progress-value,progress.ws-style::-webkit-progress-value{position:absolute;top:0;bottom:0;height:100%;box-shadow:0 -1px 1px rgba(0,0,0,.15) inset;background:#0063a6 url(progress.png);border:0}progress[data-position]::-moz-progress-bar,progress.ws-style::-moz-progress-bar{position:absolute;top:0;bottom:0;height:100%;box-shadow:0 -1px 1px rgba(0,0,0,.15) inset;background:#0063a6 url(progress.png);border:0}progress[data-position]::-ms-fill,progress.ws-style::-ms-fill{animation-name:none;position:absolute;top:0;bottom:0;height:100%;box-shadow:0 -1px 1px rgba(0,0,0,.15) inset;background:#0063a6 url(progress.png);border:0}progress[data-position]>span.progress-value,progress.ws-style>span.progress-value{display:block!important;position:absolute;top:0;bottom:0;height:100%;box-shadow:0 -1px 1px rgba(0,0,0,.15) inset;background:#0063a6 url(progress.png);border:0}progress[data-position]:indeterminate::-webkit-progress-bar,progress.ws-style:indeterminate::-webkit-progress-bar{background-image:url(progress.gif)}progress[data-position]:indeterminate::-moz-progress-bar,progress.ws-style:indeterminate::-moz-progress-bar{background-image:url(progress.gif)}progress[data-position]:indeterminate,progress.ws-style:indeterminate{animation-name:none;background-image:url(progress.gif)}progress[data-position].ws-indeterminate>span.progress-value,progress.ws-style.ws-indeterminate>span.progress-value{display:block!important;width:100%;right:0;background-image:url(progress.gif)}details{overflow:hidden}summary{position:relative}.closed-details-child{display:none!important}.details-open-indicator{margin:-1px 0 0;display:inline-block;margin-right:.4em;width:0;height:0;border-style:solid;border-width:.76923em .38462em 0;border-color:#000 transparent transparent;vertical-align:middle}.closed-details-summary .details-open-indicator{border-width:.38462em 0 .38462em .76923em;border-color:transparent transparent transparent #000}summary.summary-has-focus{outline:1px dotted #aaa;outline-offset:-1px}.ws-custom-file{position:relative;zoom:1}.ws-custom-file>button,.ws-custom-file>input{-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer}.ws-custom-file>button,.ws-custom-file>.ws-file-value{position:relative;z-index:0;display:inline-block;padding:5px;border:1px solid #ccc;background:#eee;color:#333;transition:400ms all}.ws-custom-file>button{margin-right:.4em;float:left}.ws-custom-file .ws-file-value{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ws-custom-file:hover>button,.ws-custom-file.ws-mouseenter>button,.ws-custom-file>input[type=file]:focus~button{background:#fff;border-color:#999;background:#eee linear-gradient(transparent,rgba(0,0,0,.05) 40%,rgba(0,0,0,.1))}.ws-custom-file:hover>.ws-file-value,.ws-custom-file.ws-mouseenter>.ws-file-value,.ws-custom-file>input[type=file]:focus~.ws-file-value{border-color:#999}.ws-custom-file.ws-active>button,.ws-custom-file>input[type=file]:active~button{border-color:#000}.ws-custom-file.ws-active>.ws-file-value,.ws-custom-file>input[type=file]:active~.ws-file-value{border-color:#000}.ws-custom-file>input[type=file][disabled]~.ws-file-value,.ws-custom-file>input[type=file][disabled]~button{border-color:#bbb;background:#eee;color:#999}.ws-custom-file>input[type=file]{position:absolute;top:0;left:0;bottom:0;right:0;height:100%;width:100%;filter:alpha(opacity=0);opacity:.00001;z-index:9}.ws-custom-file>input[type=file][disabled]{cursor:default;cursor:not-allowed}.ws-custom-file>.moxie-shim{z-index:20}.ws-custom-file{zoom:1}.ws-custom-file:before,.ws-custom-file:after{display:table;clear:both;content:' '}.ws-popover,.ws-range .ws-range-thumb,.ws-inline-picker,div.ws-inline-picker{-moz-box-sizing:content-box;box-sizing:content-box}.ws-popover *,.ws-range .ws-range-thumb *,.ws-inline-picker *,div.ws-inline-picker *,.ws-popover:before,.ws-range .ws-range-thumb:before,.ws-inline-picker:before,.ws-popover:after,.ws-range .ws-range-thumb:after,.ws-inline-picker:after,.ws-popover :after,.ws-range .ws-range-thumb :after,.ws-inline-picker :after,.ws-popover :before,.ws-range .ws-range-thumb :before,.ws-inline-picker :before{-moz-box-sizing:content-box;box-sizing:content-box}.hide-spinbtns+.input-buttons>.step-controls,.hide-spinbtns .input-buttons>.step-controls{display:none}.hide-spinbtns::-webkit-inner-spin-button,.hide-spinbtns ::-webkit-inner-spin-button{display:none}.hide-dropdownbtn+.input-buttons>.ws-popover-opener,.hide-dropdownbtn .input-buttons>.ws-popover-opener{display:none}.hide-inputbtns+.input-buttons,.hide-inputbtns .input-buttons{display:none}.hide-inputbtns::-webkit-inner-spin-button,.hide-inputbtns ::-webkit-inner-spin-button{display:none}.a11yhide-inputbtns+.input-buttons,.a11yhide-inputbtns .input-buttons{width:0;margin:0;overflow:visible}.a11yhide-inputbtns+.input-buttons>.step-controls,.a11yhide-inputbtns .input-buttons>.step-controls{display:none}.a11yhide-inputbtns+.input-buttons>.ws-popover-opener,.a11yhide-inputbtns .input-buttons>.ws-popover-opener{height:0;width:0;overflow:hidden}.a11yhide-inputbtns+.input-buttons>.ws-popover-opener:focus,.a11yhide-inputbtns+.input-buttons>.ws-popover-opener:active,.a11yhide-inputbtns .input-buttons>.ws-popover-opener:focus,.a11yhide-inputbtns .input-buttons>.ws-popover-opener:active{height:19px;width:19px}.inputbtns-outside+span.input-buttons,.inputbtns-outside span.input.input-buttons{margin-left:2px}.inputbtns-outside+span.input-buttons.ws-is-rtl,.inputbtns-outside span.input.input-buttons.ws-is-rtl{margin-left:0;margin-right:2px}.show-ticklabels .ws-range-ticks[data-label]:after{display:inline-block}.show-tickvalues .ws-range-ticks:before{display:inline-block}.hide-ticks .ws-range-ticks{display:none}.show-valuetooltip span.ws-range-thumb>span,.show-valuetooltip span.ws-range-thumb>span span:after{display:inline-block}.show-valuetooltip span.ws-range-thumb>span span:after{content:attr(data-value)!important;visibility:visible!important}.ws-active.show-activevaluetooltip span.ws-range-thumb>span,.ws-active.show-activevaluetooltip span.ws-range-thumb>span span:after,.show-activevaluetooltip .ws-range.ws-active span.ws-range-thumb>span,.show-activevaluetooltip .ws-range.ws-active span.ws-range-thumb>span span:after{display:inline-block}.ws-active.show-activevaluetooltip span.ws-range-thumb>span span:after,.show-activevaluetooltip .ws-range.ws-active span.ws-range-thumb>span span:after{content:attr(data-value)!important;visibility:visible!important}.show-labeltooltip span.ws-range-thumb>span,.show-labeltooltip span.ws-range-thumb>span span:before{display:inline-block}.show-labeltooltip span.ws-range-thumb>span span:before{content:attr(data-valuetext)!important;visibility:visible!important}.ws-active.show-activelabeltooltip span.ws-range-thumb>span,.ws-active.show-activelabeltooltip span.ws-range-thumb>span span:before,.show-activelabeltooltip .ws-range.ws-active span.ws-range-thumb>span,.show-activelabeltooltip .ws-range.ws-active span.ws-range-thumb>span span:before{display:inline-block}.ws-active.show-activelabeltooltip span.ws-range-thumb>span span:before,.show-activelabeltooltip .ws-range.ws-active span.ws-range-thumb>span span:before{content:attr(data-valuetext)!important;visibility:visible!important}@font-face{font-family:widget;src:url(widget.eot)}@font-face{font-family:widget;src:url(data:application/font-woff;charset=utf-8;base64,d09GRk9UVE8AAAbMAAoAAAAABoQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAAA9AAAA08AAANPG9W6FE9TLzIAAAREAAAAYAAAAGAIIwcpY21hcAAABKQAAABUAAAAVPCu8JlnYXNwAAAE+AAAAAgAAAAIAAAAEGhlYWQAAAUAAAAANgAAADYABTw7aGhlYQAABTgAAAAkAAAAJAO9AedobXR4AAAFXAAAABgAAAAYBNwAAG1heHAAAAV0AAAABgAAAAYABlAAbmFtZQAABXwAAAEwAAABMOvWjh9wb3N0AAAGrAAAACAAAAAgAAMAAAEABAQAAQEBB3dpZGdldAABAgABADr4HAL4GwP4GAQeCgAZU/+Lix4KABlT/4uLDAeLZviU+HQFHQAAAHkPHQAAAH4RHQAAAAkdAAADRhIABwEBBw0PERQZHndpZGdldHdpZGdldHUwdTF1MjB1RjAxN3VGMDczAAACAYkABAAGAgABAAQABwAKAA0BAQK4/JQO/JQO/JQO+5QO95T31hWL+xQFi4mKiImKiomJioiLCC+LBYmLiYyJjYmMio6LjQiLngWLjYyNjY2NjY2MjYsIy4uL7wWLjoyNjY2NjY2LjosInYsFjouNi4yJjYmMiYuICPcLJxWLp4SlfaN9o3idc5l0mXGSbotvi3GEc310fXh5fXN9c4Rxi2+Lb5JxmXOZc554on0Io32lhKeLqIulkqKZo5menpmjmaOSpYunCMuLFYtjgWZ3anhpcHBqeGl3ZoFji2SLZpVpn2qecKZ3rXisgbCLs4uzla+erZ+spqasnwitnrCVsouzi7CBrXisd6ZwnmqfaZVni2MIDmewixXdi4vdOYuLOQXvixXni4vdL4uLOQUn8BXdi4vmOYuLMAXvixXni4vmL4uLMAUn9wEV3YuL3jmLizgF92b7ZhXmi4vdMIuLOQX7AvdmFeeLi94vi4s4Bfdw+2YV3YuL3TmLizkF+wLwFeaLi+Ywi4swBSb3ihWL3gWLjYqNio2JjYmMiIsIeYsFiIuJiomJiomKiYuJCIs4BYuJjImMiY2JjYqOiwidiwWOi42MjY2MjYyNi40I92f7ihXdi4vmOYuLMAX7AvcBFeaLi94wi4s4BfcCixXdi4veOYuLOAWU9x0Vi94Fi42KjYmNiY2JjImLCHiLBYmLiYqJiYmJiomLiQiLOAWLiYyJjYmNiY2KjYsInosFjYuNjI2NjY2MjYuNCPcBnhWL/AIFi4GIg4SDg4SDh4GLCPwmiwWBi4KPhJKEk4eTi5UIi/gCBYuVj5OSkpKTlI6Viwivi4unBYuXkJaUlJSUlY+YiwidiwWYi5WHlIKUgpCAi38Ii2/3AouLpwWLl4+WlJSUlJaPl4sInosFl4uWh5SClIKPgIt/CItvsIsFlYuTiJODkoSOg4uBCA74lBT4lBWLDAoAAAMCAAGQAAUAAAFMAWYAAABHAUwBZgAAAPUAGQCEAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA8HMB4P/g/+AB4AAgAAAAAQAAAAAAAAAAAAAAIAAAAAAAAgAAAAMAAAAUAAMAAQAAABQABABAAAAADAAIAAIABAABACDwF/Bz//3//wAAAAAAIPAX8HP//f//AAH/4w/tD5IAAwABAAAAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAEAAG0trL5fDzz1AAsCAAAAAADPhX3EAAAAAM+FfcQAAP/bAdsB2wAAAAgAAgAAAAAAAAABAAAB4P/gAAACAAAAAAAB2wABAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAEAAAACAAAAAdwAAAAAUAAABgAAAAAADgCuAAEAAAAAAAEADAAAAAEAAAAAAAIADgBAAAEAAAAAAAMADAAiAAEAAAAAAAQADABOAAEAAAAAAAUAFgAMAAEAAAAAAAYABgAuAAEAAAAAAAoAKABaAAMAAQQJAAEADAAAAAMAAQQJAAIADgBAAAMAAQQJAAMADAAiAAMAAQQJAAQADABOAAMAAQQJAAUAFgAMAAMAAQQJAAYADAA0AAMAAQQJAAoAKABaAHcAaQBkAGcAZQB0AFYAZQByAHMAaQBvAG4AIAAxAC4AMAB3AGkAZABnAGUAdHdpZGdldAB3AGkAZABnAGUAdABSAGUAZwB1AGwAYQByAHcAaQBkAGcAZQB0AEcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format("woff"),url(widget.ttf) format("truetype");font-weight:400;font-style:normal}.ws-popover-opener span,.time-input-buttons .ws-popover-opener span{font-family:widget;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;zoom:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ws-popover-opener span:before{content:"\f073"}.time-input-buttons .ws-popover-opener span:before{content:"\f017"}.has-input-buttons,html>body input.ws-inputreplace.has-input-buttons,span.has-input-buttons{display:inline-block;vertical-align:middle}.ws-inputreplace[readonly][aria-readonly=false]{cursor:pointer}.ws-inputreplace[readonly][aria-readonly=false][disabled]{cursor:default;cursor:not-allowed}.input-buttons,.step-controls,.ws-popover-opener{zoom:1;overflow:hidden;display:inline-block;vertical-align:middle;margin-left:-18.5px}.step-controls,.ws-popover-opener{position:relative;float:left;margin:0;height:19px;width:15px}.ws-is-rtl .step-controls,.ws-is-rtl .ws-popover-opener{float:right}.ws-popover-opener{position:relative;zoom:1;overflow:visible;margin:0 0 0 2px;width:19px;border-radius:3px;cursor:pointer;background:#ccc;font-size:13px;text-align:center;outline-offset:-2px}.ws-popover-opener:focus,.ws-popover-opener:active{outline:1px dotted #666}.ws-popover-opener:hover{outline:0}.ws-is-rtl .ws-popover-opener{margin:0 2px 0 0}.ws-popover-opener span{display:block;position:absolute;top:50%;left:50%;width:16px;height:16px;margin:-8px 0 0 -8px}.time-input-buttons .ws-popover-opener span{margin:-7.5px 0 0 -7.5px}.color-input-buttons .ws-popover-opener span{background:url(color-picker.png) no-repeat 0 0}.color-input-buttons .ws-popover-opener span:before{content:""}.ws-popover-opener span.ws-color-indicator-bg{background:url(../jpicker/images/preview-opacity.png) no-repeat 0}.ws-popover-opener span.ws-color-indicator{background:0}input[type=color]{width:7.5em}.input-buttons{text-align:left}.input-buttons.color-input-buttons{margin-left:2px}.input-buttons.ws-disabled{opacity:.95}.input-buttons.ws-disabled *,.input-buttons.ws-readonly *{cursor:default}.input-button-size-1.month-input-buttons,.input-button-size-1.date-input-buttons,.input-button-size-1.datetime-local-input-buttons{margin-left:-24px}.input-button-size-1.month-input-buttons.ws-is-rtl,.input-button-size-1.date-input-buttons.ws-is-rtl,.input-button-size-1.datetime-local-input-buttons.ws-is-rtl{margin-left:0;margin-right:-24px}.input-button-size-2{margin-left:-39px}.input-button-size-2.ws-is-rtl{margin-left:0;margin-right:-39px}.input-button-size-2 .step-controls{visibility:hidden;opacity:0}:focus+.input-button-size-2 .step-controls,:hover+.input-button-size-2 .step-controls,:active+.input-button-size-2 .step-controls,.input-button-size-2:hover .step-controls{opacity:1;visibility:visible}.step-controls{transition:all 300ms}.step-controls span{position:absolute;left:0;display:inline-block;overflow:hidden;margin:0!important;padding:0!important;width:15px;height:9px;cursor:pointer;font-size:0;line-height:0;text-align:center;transition:border-color 300ms,background-color 300ms}.step-controls span.step-down{bottom:0}.step-controls span:before{position:absolute;top:50%;left:50%;content:"";display:inline-block;width:0;height:0;border-style:solid;margin:-2px 0 0 -4px;transition:border-color 300ms,background-color 300ms}.step-controls span.step-up:before{border-width:0 4px 4px;border-color:transparent transparent #999}.step-controls span.step-up:hover:before{border-color:transparent transparent #666}.step-controls span.step-up.mousepress-ui:before{border-color:transparent transparent #000}.ws-disabled .step-controls span.step-up:before{border-color:transparent transparent #aaa}.step-controls span.step-down:before{border-width:4px 4px 0;border-color:#999 transparent transparent}.step-controls span.step-down:hover:before{border-color:#666 transparent transparent}.step-controls span.step-down.mousepress-ui:before{border-color:#000 transparent transparent}.ws-disabled .step-controls span.step-down:before{border-color:#aaa transparent transparent}.ws-input{letter-spacing:-.31em;word-spacing:-.43em}.ws-input>*{text-align:center;letter-spacing:normal;word-spacing:normal}.ws-input>*>option{text-align:left}.ws-input .ws-input-seperator{vertical-align:middle;width:2%;overflow:hidden}.ws-input+.input-buttons{margin-left:2px}.ws-input input,.ws-input .ws-input-seperator{-moz-box-sizing:border-box;box-sizing:border-box;text-align:center;display:inline-block}span.ws-input{display:inline-block}.ws-date .mm,.ws-date .dd{width:23.5%;min-width:10%}.ws-date .yy{width:48%;min-width:20%}.ws-date.ws-month-select .dd{width:22%;min-width:10%}.ws-date.ws-month-select .mm{width:38%;min-width:17%}.ws-date.ws-month-select .yy{width:36%;min-width:16%}.ws-month .mm,.ws-month .yy{width:47.9%;min-width:20%}.ws-range{position:relative;display:inline-block;vertical-align:middle;margin:.57692em 0;zoom:1;border:0;height:.61538em;width:155px;border-radius:.38462em;background:#ddd;cursor:pointer;font-size:13px;outline:0;transition:background-color 400ms,border-color 400ms;background-color:#ddd;box-shadow:0 -.07692em .11538em rgba(0,0,0,.2) inset}[list]+.ws-range{margin:.19231em 0 .96154em}.ws-range .ws-range-thumb{top:0;position:absolute;display:block;z-index:4;margin:-.46154em 0 0 -.76923em;height:1.53846em;width:1.53846em;border-radius:50%;background:#ccc;border:.07692em solid #aaa;cursor:pointer;transition:background-color 400ms,border-color 400ms}.ws-range .ws-range-thumb>span{position:absolute;margin:0 0 3px -90px;padding:0;border:0;left:50%;bottom:1.61538em;visibility:hidden;width:180px;text-align:center;background:0}.ws-range .ws-range-thumb>span span{visibility:visible}.ws-range .ws-range-thumb>span span:after,.ws-range .ws-range-thumb>span span:before{content:"";padding:.07692em .26923em;text-align:center;background:#fff;border:.07692em solid #ccc;border-radius:.30769em;visibility:visible}.ws-range.ws-focus .ws-range-thumb{background:#eee;border-color:#999}.ws-range.ws-active .ws-range-thumb{box-shadow:0 0 .69231em rgba(0,75,100,.2)}.ws-range[aria-disabled=true],.ws-range[aria-readonly=true]{cursor:default;opacity:.95}.ws-range[aria-disabled=true] .ws-range-thumb,.ws-range[aria-readonly=true] .ws-range-thumb{cursor:default}.ws-range[aria-disabled=true] .ws-range-thumb{background:#ddd;border-color:#ddd}.ws-range .ws-range-rail{position:absolute;display:block;top:0;left:0;right:0;bottom:0;margin:0;zoom:1}.ws-range .ws-range-progress{position:absolute!important;display:block;margin:0;padding:0;top:0;border-radius:.38462em;height:100%;left:0;z-index:1;overflow:hidden;background:#09c;box-shadow:0 .11538em .26923em rgba(255,255,255,.2) inset;-moz-box-sizing:content-box;box-sizing:content-box}.ws-range .ws-range-ticks{position:absolute;bottom:-.76923em;left:0;height:.61538em;width:.07692em;margin:0 0 0 -.07692em;background:#ccc;transition:background-color 400ms,color 400ms}.ws-range .ws-range-ticks.ws-selected-option{background:#09c;color:#09c}.ws-range.ws-is-rtl .ws-range-progress{left:auto;right:0}.ws-range.ws-is-rtl .ws-range-ticks{left:auto;right:0}.ws-range.vertical-range{width:.61538em;margin:0 10px 0 5px}.ws-range.vertical-range .ws-range-ticks{bottom:auto;left:auto;margin:-.05769em 0 0 0;right:-.57692em;height:.11538em;width:.52308em}.ws-range.vertical-range .ws-range-progress{top:auto;bottom:1px;left:0;width:100%;height:0}.ws-range-ticks[data-label]:after,.ws-range-ticks:before{display:none;content:attr(data-label);font-size:.76923em;min-width:2em;text-align:center;margin:.69231em 0 0 -.95em}.ws-is-rtl .ws-range-ticks[data-label]:after,.ws-is-rtl .ws-range-ticks:before{margin:.69231em -.95em 0 0}.vertical-range .ws-range-ticks[data-label]:after,.vertical-range .ws-range-ticks:before{margin:0 0 0 5px;position:relative;top:-.7em;left:.53846em;min-width:0}.ws-range-ticks:before{content:attr(data-value)}.ws-range-thumb>span,.ws-range-thumb>span span:after,.ws-range-thumb>span span:before{display:none}.ws-inline-picker,div.ws-inline-picker{position:relative;max-width:100%;z-index:99}
|
fk/cdnjs
|
ajax/libs/webshim/1.4.2/minified/shims/styles/shim-ext.css
|
CSS
|
mit
| 27,532 |
var baseIsEqual = require('../internal/baseIsEqual'),
bindCallback = require('../internal/bindCallback');
/**
* Performs a deep comparison between two values to determine if they are
* equivalent. If `customizer` is provided it's invoked to compare values.
* If `customizer` returns `undefined` comparisons are handled by the method
* instead. The `customizer` is bound to `thisArg` and invoked with up to
* three arguments: (value, other [, index|key]).
*
* **Note:** This method supports comparing arrays, booleans, `Date` objects,
* numbers, `Object` objects, regexes, and strings. Objects are compared by
* their own, not inherited, enumerable properties. Functions and DOM nodes
* are **not** supported. Provide a customizer function to extend support
* for comparing other values.
*
* @static
* @memberOf _
* @alias eq
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {Function} [customizer] The function to customize value comparisons.
* @param {*} [thisArg] The `this` binding of `customizer`.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'user': 'fred' };
* var other = { 'user': 'fred' };
*
* object == other;
* // => false
*
* _.isEqual(object, other);
* // => true
*
* // using a customizer callback
* var array = ['hello', 'goodbye'];
* var other = ['hi', 'goodbye'];
*
* _.isEqual(array, other, function(value, other) {
* if (_.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/)) {
* return true;
* }
* });
* // => true
*/
function isEqual(value, other, customizer, thisArg) {
customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
var result = customizer ? customizer(value, other) : undefined;
return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
}
module.exports = isEqual;
|
rajkrishna1590/anand
|
server/node_modules1/lodash/lang/isEqual.js
|
JavaScript
|
mit
| 1,965 |
/**
* @fileoverview Rule to restrict what can be thrown as an exception.
* @author Dieter Oberkofler
*/
"use strict";
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Determine if a node has a possiblity to be an Error object
* @param {ASTNode} node ASTNode to check
* @returns {boolean} True if there is a chance it contains an Error obj
*/
function couldBeError(node) {
switch (node.type) {
case "Identifier":
case "CallExpression":
case "NewExpression":
case "MemberExpression":
case "TaggedTemplateExpression":
case "YieldExpression":
return true; // possibly an error object.
case "AssignmentExpression":
return couldBeError(node.right);
case "SequenceExpression":
var exprs = node.expressions;
return exprs.length !== 0 && couldBeError(exprs[exprs.length - 1]);
case "LogicalExpression":
return couldBeError(node.left) || couldBeError(node.right);
case "ConditionalExpression":
return couldBeError(node.consequent) || couldBeError(node.alternate);
default:
return false;
}
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = {
meta: {
docs: {
description: "disallow throwing literals as exceptions",
category: "Best Practices",
recommended: false
},
schema: []
},
create: function(context) {
return {
ThrowStatement: function(node) {
if (!couldBeError(node.argument)) {
context.report(node, "Expected an object to be thrown.");
} else if (node.argument.type === "Identifier") {
if (node.argument.name === "undefined") {
context.report(node, "Do not throw undefined.");
}
}
}
};
}
};
|
bobhami/payrollbot
|
node_modules/eslint/lib/rules/no-throw-literal.js
|
JavaScript
|
mit
| 2,229 |
/*
jQuery Zoom v1.7.1 - 2013-03-12
(c) 2013 Jack Moore - jacklmoore.com/zoom
license: http://www.opensource.org/licenses/mit-license.php
*/
(function(o){var t={url:!1,callback:!1,target:!1,duration:120,on:"mouseover"};o.zoom=function(t,n,e){var i,u,a,c,r,m=o(t).css("position");return o(t).css({position:/(absolute|fixed)/.test()?m:"relative",overflow:"hidden"}),o(e).addClass("zoomImg").css({position:"absolute",top:0,left:0,opacity:0,width:e.width,height:e.height,border:"none",maxWidth:"none"}).appendTo(t),{init:function(){i=o(t).outerWidth(),u=o(t).outerHeight(),a=(e.width-i)/o(n).outerWidth(),c=(e.height-u)/o(n).outerHeight(),r=o(n).offset()},move:function(o){var t=o.pageX-r.left,n=o.pageY-r.top;n=Math.max(Math.min(n,u),0),t=Math.max(Math.min(t,i),0),e.style.left=t*-a+"px",e.style.top=n*-c+"px"}}},o.fn.zoom=function(n){return this.each(function(){var e=o.extend({},t,n||{}),i=e.target||this,u=this,a=new Image,c=o(a),r="mousemove",m=!1;(e.url||(e.url=o(u).find("img").attr("src"),e.url))&&(a.onload=function(){function t(t){s.init(),s.move(t),c.stop().fadeTo(o.support.opacity?e.duration:0,1)}function n(){c.stop().fadeTo(e.duration,0)}var s=o.zoom(i,u,a);"grab"===e.on?o(u).on("mousedown",function(e){o(document).one("mouseup",function(){n(),o(document).off(r,s.move)}),t(e),o(document).on(r,s.move),e.preventDefault()}):"click"===e.on?o(u).on("click",function(e){return m?void 0:(m=!0,t(e),o(document).on(r,s.move),o(document).one("click",function(){n(),m=!1,o(document).off(r,s.move)}),!1)}):"toggle"===e.on?o(u).on("click",function(o){m?n():t(o),m=!m}):(s.init(),o(u).on("mouseenter",t).on("mouseleave",n).on(r,s.move)),o.isFunction(e.callback)&&e.callback.call(a)},a.src=e.url)})},o.fn.zoom.defaults=t})(window.jQuery);
|
iamJoeTaylor/cdnjs
|
ajax/libs/jquery-zoom/1.7.1/jquery.zoom.min.js
|
JavaScript
|
mit
| 1,739 |
require File.expand_path("../../../base", __FILE__)
require "vagrant/util/retryable"
describe Vagrant::Util::Retryable do
let(:klass) do
Class.new do
extend Vagrant::Util::Retryable
end
end
it "doesn't retry by default" do
tries = 0
block = lambda do
tries += 1
raise RuntimeError, "Try"
end
# It should re-raise the error
expect { klass.retryable(&block) }.
to raise_error(RuntimeError)
# It should've tried once
expect(tries).to eq(1)
end
it "retries the set number of times" do
tries = 0
block = lambda do
tries += 1
raise RuntimeError, "Try"
end
# It should re-raise the error
expect { klass.retryable(tries: 5, &block) }.
to raise_error(RuntimeError)
# It should've tried all specified times
expect(tries).to eq(5)
end
it "only retries on the given exception" do
tries = 0
block = lambda do
tries += 1
raise StandardError, "Try"
end
# It should re-raise the error
expect { klass.retryable(tries: 5, on: RuntimeError, &block) }.
to raise_error(StandardError)
# It should've never tried since it was a different kind of error
expect(tries).to eq(1)
end
it "can retry on multiple types of errors" do
tries = 0
foo_error = Class.new(StandardError)
bar_error = Class.new(StandardError)
block = lambda do
tries += 1
raise foo_error, "Try" if tries == 1
raise bar_error, "Try" if tries == 2
raise RuntimeError, "YAY"
end
# It should re-raise the error
expect { klass.retryable(tries: 5, on: [foo_error, bar_error], &block) }.
to raise_error(RuntimeError)
# It should've never tried since it was a different kind of error
expect(tries).to eq(3)
end
it "doesn't sleep between tries by default" do
block = lambda do
raise RuntimeError, "Try"
end
# Sleep should never be called
expect(klass).not_to receive(:sleep)
# Run it.
expect { klass.retryable(tries: 5, &block) }.
to raise_error(RuntimeError)
end
it "sleeps specified amount between retries" do
block = lambda do
raise RuntimeError, "Try"
end
# Sleep should be called between each retry
expect(klass).to receive(:sleep).with(10).exactly(4).times
# Run it.
expect { klass.retryable(tries: 5, sleep: 10, &block) }.
to raise_error(RuntimeError)
end
end
|
lonniev/vagrant
|
test/unit/vagrant/util/retryable_test.rb
|
Ruby
|
mit
| 2,444 |
function onYouTubePlayerAPIReady(){ytp.YTAPIReady||(ytp.YTAPIReady=!0,jQuery(document).trigger("YTAPIReady"))}!function(){if(!(8>jQuery.fn.jquery.split(".")[1])){jQuery.browser={},jQuery.browser.mozilla=!1,jQuery.browser.webkit=!1,jQuery.browser.opera=!1,jQuery.browser.msie=!1;var e=navigator.userAgent;jQuery.browser.name=navigator.appName,jQuery.browser.fullVersion=""+parseFloat(navigator.appVersion),jQuery.browser.majorVersion=parseInt(navigator.appVersion,10);var r,t;-1!=(t=e.indexOf("Opera"))?(jQuery.browser.opera=!0,jQuery.browser.name="Opera",jQuery.browser.fullVersion=e.substring(t+6),-1!=(t=e.indexOf("Version"))&&(jQuery.browser.fullVersion=e.substring(t+8))):-1!=(t=e.indexOf("MSIE"))?(jQuery.browser.msie=!0,jQuery.browser.name="Microsoft Internet Explorer",jQuery.browser.fullVersion=e.substring(t+5)):-1!=(t=e.indexOf("Chrome"))?(jQuery.browser.webkit=!0,jQuery.browser.name="Chrome",jQuery.browser.fullVersion=e.substring(t+7)):-1!=(t=e.indexOf("Safari"))?(jQuery.browser.webkit=!0,jQuery.browser.name="Safari",jQuery.browser.fullVersion=e.substring(t+7),-1!=(t=e.indexOf("Version"))&&(jQuery.browser.fullVersion=e.substring(t+8))):-1!=(t=e.indexOf("Firefox"))?(jQuery.browser.mozilla=!0,jQuery.browser.name="Firefox",jQuery.browser.fullVersion=e.substring(t+8)):(r=e.lastIndexOf(" ")+1)<(t=e.lastIndexOf("/"))&&(jQuery.browser.name=e.substring(r,t),jQuery.browser.fullVersion=e.substring(t+1),jQuery.browser.name.toLowerCase()==jQuery.browser.name.toUpperCase()&&(jQuery.browser.name=navigator.appName)),-1!=(e=jQuery.browser.fullVersion.indexOf(";"))&&(jQuery.browser.fullVersion=jQuery.browser.fullVersion.substring(0,e)),-1!=(e=jQuery.browser.fullVersion.indexOf(" "))&&(jQuery.browser.fullVersion=jQuery.browser.fullVersion.substring(0,e)),jQuery.browser.majorVersion=parseInt(""+jQuery.browser.fullVersion,10),isNaN(jQuery.browser.majorVersion)&&(jQuery.browser.fullVersion=""+parseFloat(navigator.appVersion),jQuery.browser.majorVersion=parseInt(navigator.appVersion,10)),jQuery.browser.version=jQuery.browser.majorVersion}}(jQuery),jQuery.fn.CSSAnimate=function(e,r,t,a,o){return this.each(function(){var i=jQuery(this);if(0!==i.length&&e){if("function"==typeof r&&(o=r,r=jQuery.fx.speeds._default),"function"==typeof t&&(o=t,t=0),"function"==typeof a&&(o=a,a="cubic-bezier(0.65,0.03,0.36,0.72)"),"string"==typeof r)for(var n in jQuery.fx.speeds){if(r==n){r=jQuery.fx.speeds[n];break}r=null}if(jQuery.support.transition){var l="",y="transitionEnd";jQuery.browser.webkit?(l="-webkit-",y="webkitTransitionEnd"):jQuery.browser.mozilla?(l="-moz-",y="transitionend"):jQuery.browser.opera?(l="-o-",y="otransitionend"):jQuery.browser.msie&&(l="-ms-",y="msTransitionEnd"),n=[];for(u in e){var s=u;"transform"===s&&(s=l+"transform",e[s]=e[u],delete e[u]),"transform-origin"===s&&(s=l+"transform-origin",e[s]=e[u],delete e[u]),n.push(s),i.css(s)||i.css(s,0)}u=n.join(","),i.css(l+"transition-property",u),i.css(l+"transition-duration",r+"ms"),i.css(l+"transition-delay",t+"ms"),i.css(l+"transition-timing-function",a),i.css(l+"backface-visibility","hidden"),setTimeout(function(){i.css(e)},0),setTimeout(function(){i.called||!o?i.called=!1:o()},r+20),i.on(y,function(e){return i.off(y),i.css(l+"transition",""),e.stopPropagation(),"function"==typeof o&&(i.called=!0,o()),!1})}else{for(var u in e)"transform"===u&&delete e[u],"transform-origin"===u&&delete e[u],"auto"===e[u]&&delete e[u];o&&"string"!=typeof o||(o="linear"),i.animate(e,r,o)}}})},jQuery.fn.CSSAnimateStop=function(){var e="",r="transitionEnd";jQuery.browser.webkit?(e="-webkit-",r="webkitTransitionEnd"):jQuery.browser.mozilla?(e="-moz-",r="transitionend"):jQuery.browser.opera?(e="-o-",r="otransitionend"):jQuery.browser.msie&&(e="-ms-",r="msTransitionEnd"),jQuery(this).css(e+"transition",""),jQuery(this).off(r)},jQuery.support.transition=function(){var e=(document.body||document.documentElement).style;return void 0!==e.transition||void 0!==e.WebkitTransition||void 0!==e.MozTransition||void 0!==e.MsTransition||void 0!==e.OTransition}(),function(c){c.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(e,r){this.defaults.type=e,this.defaults.name=r},get:function(b,f){var d=c.extend({},this.defaults,f);d.single.length||(d.single="metadata");var a=c.data(b,d.single);if(a)return a;if(a="{}","class"==d.type){var e=d.cre.exec(b.className);e&&(a=e[1])}else if("elem"==d.type){if(!b.getElementsByTagName)return;e=b.getElementsByTagName(d.name),e.length&&(a=c.trim(e[0].innerHTML))}else void 0!=b.getAttribute&&(e=b.getAttribute(d.name))&&(a=e);return 0>a.indexOf("{")&&(a="{"+a+"}"),a=eval("("+a+")"),c.data(b,d.single,a),a}}}),c.fn.metadata=function(e){return c.metadata.get(this[0],e)}}(jQuery),"object"!=typeof ytp&&(ytp={}),String.prototype.getVideoID=function(){var e;return e="http://youtu.be/"==this.substr(0,16)?this.replace("http://youtu.be/",""):this.indexOf("http")>-1?this.match(/[\\?&]v=([^&#]*)/)[1]:this};var isDevice="ontouchstart"in window;!function(jQuery){jQuery.mbYTPlayer={name:"jquery.mb.YTPlayer",version:"2.5.2",author:"Matteo Bicocchi",defaults:{containment:"body",ratio:"16/9",showYTLogo:!1,videoURL:null,startAt:0,autoPlay:!0,vol:100,addRaster:!1,opacity:1,quality:"default",mute:!1,loop:!0,showControls:!0,showAnnotations:!1,printUrl:!0,stopMovieOnClick:!1,onReady:function(){},onStateChange:function(){},onPlaybackQualityChange:function(){},onError:function(){}},controls:{play:"P",pause:"p",mute:"M",unmute:"A",onlyYT:"O",showSite:"R",ytLogo:"Y"},rasterImg:"images/raster.png",rasterImgRetina:"images/raster@2x.png",buildPlayer:function(options){return this.each(function(){var YTPlayer=this,$YTPlayer=jQuery(YTPlayer);YTPlayer.loop=0,YTPlayer.opt={};var property={};jQuery.metadata&&(jQuery.metadata.setType("class"),property=$YTPlayer.metadata()),jQuery.isEmptyObject(property)&&(property=$YTPlayer.data("property")&&"string"==typeof $YTPlayer.data("property")?eval("("+$YTPlayer.data("property")+")"):$YTPlayer.data("property")),jQuery.extend(YTPlayer.opt,jQuery.mbYTPlayer.defaults,options,property),$YTPlayer.attr("id")||$YTPlayer.attr("id","id_"+(new Date).getTime()),YTPlayer.opt.id=YTPlayer.id,YTPlayer.isAlone=!1,YTPlayer.opt.isBgndMovie&&(YTPlayer.opt.containment="body"),YTPlayer.opt.isBgndMovie&&void 0!=YTPlayer.opt.isBgndMovie.mute&&(YTPlayer.opt.mute=YTPlayer.opt.isBgndMovie.mute),YTPlayer.opt.videoURL||(YTPlayer.opt.videoURL=$YTPlayer.attr("href"));var playerID="mbYTP_"+YTPlayer.id,videoID=this.opt.videoURL?this.opt.videoURL.getVideoID():$YTPlayer.attr("href")?$YTPlayer.attr("href").getVideoID():!1;YTPlayer.videoID=videoID,YTPlayer.opt.showAnnotations=YTPlayer.opt.showAnnotations?"0":"3";var playerVars={autoplay:0,modestbranding:1,controls:0,showinfo:0,rel:0,enablejsapi:1,version:3,playerapiid:playerID,origin:"*",allowfullscreen:!0,wmode:"transparent",iv_load_policy:YTPlayer.opt.showAnnotations},canPlayHTML5=!1,v=document.createElement("video");v.canPlayType&&(canPlayHTML5=!0),canPlayHTML5&&jQuery.extend(playerVars,{html5:1}),jQuery.browser.msie&&jQuery.browser.version<9&&(this.opt.opacity=1);var playerBox=jQuery("<div/>").attr("id",playerID).addClass("playerBox"),overlay=jQuery("<div/>").css({position:"absolute",top:0,left:0,width:"100%",height:"100%"}).addClass("YTPOverlay");if(YTPlayer.opt.containment=jQuery("self"==YTPlayer.opt.containment?this:YTPlayer.opt.containment),YTPlayer.isBackground="body"==YTPlayer.opt.containment.get(0).tagName.toLowerCase(),isDevice&&YTPlayer.isBackground)return void $YTPlayer.hide();if(YTPlayer.opt.addRaster){var retina=window.retina||window.devicePixelRatio>1;overlay.addClass(retina?"raster retina":"raster")}else overlay.removeClass("raster retina");var wrapper=jQuery("<div/>").addClass("mbYTP_wrapper").attr("id","wrapper_"+playerID);if(wrapper.css({position:"absolute",zIndex:0,minWidth:"100%",minHeight:"100%",left:0,top:0,overflow:"hidden",opacity:0}),playerBox.css({position:"absolute",zIndex:0,width:"100%",height:"100%",top:0,left:0,overflow:"hidden",opacity:this.opt.opacity}),wrapper.append(playerBox),!YTPlayer.isBackground||!ytp.isInit){if(YTPlayer.opt.containment.children().each(function(){"static"==jQuery(this).css("position")&&jQuery(this).css("position","relative")}),YTPlayer.isBackground?(jQuery("body").css({position:"relative",minWidth:"100%",minHeight:"100%",zIndex:1,boxSizing:"border-box"}),wrapper.css({position:"fixed",top:0,left:0,zIndex:0}),$YTPlayer.hide(),YTPlayer.opt.containment.prepend(wrapper)):YTPlayer.opt.containment.prepend(wrapper),YTPlayer.wrapper=wrapper,playerBox.css({opacity:1}),isDevice||(playerBox.after(overlay),YTPlayer.overlay=overlay),YTPlayer.isBackground||overlay.on("mouseenter",function(){$YTPlayer.find(".mb_YTVPBar").addClass("visible")}).on("mouseleave",function(){$YTPlayer.find(".mb_YTVPBar").removeClass("visible")}),ytp.YTAPIReady)setTimeout(function(){jQuery(document).trigger("YTAPIReady")},200);else{var tag=document.createElement("script");tag.src="http://www.youtube.com/player_api",tag.id="YTAPI";var firstScriptTag=document.getElementsByTagName("script")[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}jQuery(document).on("YTAPIReady",function(){YTPlayer.isBackground&&ytp.isInit||YTPlayer.opt.isInit||(YTPlayer.isBackground&&YTPlayer.opt.stopMovieOnClick&&jQuery(document).off("mousedown.ytplayer").on("mousedown,.ytplayer",function(e){var r=jQuery(e.target);(r.is("a")||r.parents().is("a"))&&$YTPlayer.pauseYTP()}),YTPlayer.isBackground&&(ytp.isInit=!0),YTPlayer.opt.isInit=!0,YTPlayer.opt.vol=YTPlayer.opt.vol?YTPlayer.opt.vol:100,jQuery.mbYTPlayer.getDataFromFeed(YTPlayer.videoID,YTPlayer),jQuery(document).on("getVideoInfo_"+YTPlayer.opt.id,function(){return isDevice&&!YTPlayer.isBackground?void new YT.Player(playerID,{height:"100%",width:"100%",videoId:YTPlayer.videoID,events:{onReady:function(){$YTPlayer.optimizeDisplay(),playerBox.css({opacity:1}),YTPlayer.wrapper.css({opacity:1}),$YTPlayer.optimizeDisplay()},onStateChange:function(){}}}):void new YT.Player(playerID,{videoId:YTPlayer.videoID.toString(),playerVars:playerVars,events:{onReady:function(e){YTPlayer.player=e.target,YTPlayer.playerEl=YTPlayer.player.getIframe(),$YTPlayer.optimizeDisplay(),YTPlayer.videoID=videoID,jQuery(window).on("resize.YTP",function(){$YTPlayer.optimizeDisplay()}),YTPlayer.opt.showControls&&jQuery(YTPlayer).buildYTPControls(),YTPlayer.player.setPlaybackQuality(YTPlayer.opt.quality),YTPlayer.opt.startAt>0&&YTPlayer.player.seekTo(parseFloat(YTPlayer.opt.startAt),!0),YTPlayer.opt.autoPlay?($YTPlayer.playYTP(),YTPlayer.player.setVolume(YTPlayer.opt.vol),YTPlayer.opt.mute?jQuery(YTPlayer).muteYTPVolume():jQuery(YTPlayer).unmuteYTPVolume()):YTPlayer.checkForStartAt=setInterval(function(){YTPlayer.player.getCurrentTime()>=YTPlayer.opt.startAt&&(clearInterval(YTPlayer.checkForStartAt),$YTPlayer.pauseYTP(),YTPlayer.opt.mute?jQuery(YTPlayer).muteYTPVolume():jQuery(YTPlayer).unmuteYTPVolume())},1),"function"==typeof YTPlayer.opt.onReady&&YTPlayer.opt.onReady($YTPlayer),jQuery.mbYTPlayer.checkForState(YTPlayer)},onStateChange:function(e){if("function"==typeof e.target.getPlayerState){var r=e.target.getPlayerState(),t=jQuery(YTPlayer.playerEl),a=jQuery("#controlBar_"+YTPlayer.id);t.css({opacity:1});var o=YTPlayer.opt;if(0==r){if(YTPlayer.state==r)return;YTPlayer.state=r,YTPlayer.player.pauseVideo();var i=YTPlayer.opt.startAt?YTPlayer.opt.startAt:1;o.loop?(YTPlayer.wrapper.css({opacity:0}),YTPlayer.player.seekTo(i),$YTPlayer.playYTP()):YTPlayer.isBackground||(YTPlayer.player.seekTo(i,!0),$YTPlayer.playYTP(),setTimeout(function(){$YTPlayer.pauseYTP()},10)),!o.loop&&YTPlayer.isBackground?YTPlayer.wrapper.CSSAnimate({opacity:0},2e3):o.loop&&(YTPlayer.wrapper.css({opacity:0}),YTPlayer.loop++),a.find(".mb_YTVPPlaypause").html(jQuery.mbYTPlayer.controls.play),jQuery(YTPlayer).trigger("YTPEnd")}if(3==r){if(YTPlayer.state==r)return;YTPlayer.state=r,a.find(".mb_YTVPPlaypause").html(jQuery.mbYTPlayer.controls.play),jQuery(YTPlayer).trigger("YTPBuffering")}if(-1==r){if(YTPlayer.state==r)return;YTPlayer.state=r,jQuery(YTPlayer).trigger("YTPUnstarted")}if(1==r){if(YTPlayer.state==r)return;YTPlayer.state=r,YTPlayer.opt.mute&&($YTPlayer.muteYTPVolume(),YTPlayer.opt.mute=!1),YTPlayer.opt.autoPlay&&0==YTPlayer.loop?YTPlayer.wrapper.CSSAnimate({opacity:YTPlayer.isAlone?1:YTPlayer.opt.opacity},2e3):YTPlayer.isBackground?setTimeout(function(){jQuery(YTPlayer.playerEl).CSSAnimate({opacity:1},2e3),YTPlayer.wrapper.CSSAnimate({opacity:YTPlayer.opt.opacity},2e3)},1e3):YTPlayer.wrapper.css({opacity:YTPlayer.isAlone?1:YTPlayer.opt.opacity}),a.find(".mb_YTVPPlaypause").html(jQuery.mbYTPlayer.controls.pause),$YTPlayer.css({background:"transparent"}),jQuery(YTPlayer).trigger("YTPStart")}if(2==r){if(YTPlayer.state==r)return;YTPlayer.state=r,a.find(".mb_YTVPPlaypause").html(jQuery.mbYTPlayer.controls.play),jQuery(YTPlayer).trigger("YTPPause")}}},onPlaybackQualityChange:function(){},onError:function(){jQuery(YTPlayer).trigger("YTPError")}}})}))})}})},getDataFromFeed:function(e,r){r.videoID=e,jQuery.browser.msie?("auto"==r.opt.ratio?r.opt.ratio="16/9":r.opt.ratio,r.isInit||(r.isInit=!0,setTimeout(function(){jQuery(document).trigger("getVideoInfo_"+r.opt.id)},100)),jQuery(r).trigger("YTPChanged")):(jQuery.getJSON("http://gdata.youtube.com/feeds/api/videos/"+e+"?v=2&alt=jsonc",function(e){r.dataReceived=!0;var t=e.data;if(r.title=t.title,r.videoData=t,"auto"==r.opt.ratio&&(r.opt.ratio=t.aspectRatio&&"widescreen"===t.aspectRatio?"16/9":"4/3"),!r.isInit){if(r.isInit=!0,!r.isBackground){var a=t.thumbnail.hqDefault;jQuery(r).css({background:"url("+a+") center center",backgroundSize:"cover"})}jQuery(document).trigger("getVideoInfo_"+r.opt.id)}jQuery(r).trigger("YTPChanged")}),setTimeout(function(){r.dataReceived||r.isInit||(r.isInit=!0,jQuery(document).trigger("getVideoInfo_"+r.opt.id))},2500))},getVideoID:function(){var e=this.get(0);return e.videoID||!1},YTPlaylist:function(e,r,t){var a=this.get(0);a.isPlayList=!0,r&&(e=jQuery.shuffle(e)),a.videoID||(a.videos=e,a.videoCounter=0,a.videoLength=e.length,jQuery(a).data("property",e[0]),jQuery(a).mb_YTPlayer()),"function"==typeof t&&jQuery(a).on("YTPChanged",function(){t(a)}),jQuery(a).on("YTPError",function(){setTimeout(function(){jQuery(a).trigger("YTPEnd")},1e3)}),jQuery(a).on("YTPEnd",function(){a.videoCounter++,a.videoCounter>=a.videoLength&&(a.videoCounter=0),jQuery(a).changeMovie(e[a.videoCounter])})},playNext:function(){var e=this.get(0);e.videoCounter++,e.videoCounter>=e.videoLength&&(e.videoCounter=0),jQuery(e).changeMovie(e.videos[e.videoCounter])},changeMovie:function(e){var r=this.get(0),t=r.opt;if(e&&jQuery.extend(t,e),r.videoID=t.videoURL.getVideoID(),jQuery(r).getPlayer().loadVideoByUrl("http://www.youtube.com/v/"+r.videoID,0),r.opt.mute?jQuery(r).muteYTPVolume():jQuery(r).unmuteYTPVolume(),r.opt.addRaster){var a=window.retina||window.devicePixelRatio>1;r.overlay.addClass(a?"raster retina":"raster")}else r.overlay.removeClass("raster"),r.overlay.removeClass("retina");$("#controlBar_"+r.id).remove(),r.opt.showControls?$(r).buildYTPControls():$("controlBar_"+r.id).remove(),$.mbYTPlayer.getDataFromFeed(r.videoID,r),jQuery(r).optimizeDisplay(),jQuery.mbYTPlayer.checkForState(r)},getPlayer:function(){return jQuery(this).get(0).player},playerDestroy:function(){var e=this.get(0);ytp.YTAPIReady=!1,ytp.isInit=!1,e.opt.isInit=!1,e.videoID=null;var r=e.wrapper;r.remove(),jQuery("#controlBar_"+e.id).remove()},playYTP:function(){var e=this.get(0),r=(e.opt,jQuery("#controlBar_"+e.id)),t=r.find(".mb_YTVPPlaypause");t.html(jQuery.mbYTPlayer.controls.pause),e.player.playVideo(),e.wrapper.CSSAnimate({opacity:e.opt.opacity},2e3)},toggleLoops:function(){var e=this.get(0),r=e.opt;1==r.loop?r.loop=0:(r.startAt?e.player.seekTo(r.startAt):e.player.playVideo(),r.loop=1)},stopYTP:function(){var e=this.get(0),r=jQuery("#controlBar_"+e.id),t=r.find(".mb_YTVPPlaypause");t.html(jQuery.mbYTPlayer.controls.play),e.player.stopVideo()},pauseYTP:function(){var e=this.get(0),r=(e.opt,jQuery("#controlBar_"+e.id)),t=r.find(".mb_YTVPPlaypause");t.html(jQuery.mbYTPlayer.controls.play),e.player.pauseVideo()},setYTPVolume:function(e){var r=this.get(0);e||r.opt.vol||0!=player.getVolume()?!e&&r.player.getVolume()>0||e&&r.player.getVolume()==e?jQuery(r).muteYTPVolume():r.opt.vol=e:jQuery(r).unmuteYTPVolume(),r.player.setVolume(r.opt.vol)},muteYTPVolume:function(){var e=this.get(0);e.opt.vol=e.player.getVolume()||50,e.player.mute(),e.player.setVolume(0);var r=jQuery("#controlBar_"+e.id),t=r.find(".mb_YTVPMuteUnmute");t.html(jQuery.mbYTPlayer.controls.unmute)},unmuteYTPVolume:function(){var e=this.get(0);e.player.unMute(),e.player.setVolume(e.opt.vol);var r=jQuery("#controlBar_"+e.id),t=r.find(".mb_YTVPMuteUnmute");t.html(jQuery.mbYTPlayer.controls.mute)},manageYTPProgress:function(){var e=this.get(0),r=(e.opt,jQuery("#controlBar_"+e.id)),t=r.find(".mb_YTVPProgress"),a=r.find(".mb_YTVPLoaded"),o=r.find(".mb_YTVTime"),i=t.outerWidth(),n=Math.floor(e.player.getCurrentTime()),l=Math.floor(e.player.getDuration()),y=n*i/l,s=0,u=100*e.player.getVideoLoadedFraction();return a.css({left:s,width:u+"%"}),o.css({left:0,width:y}),{totalTime:l,currentTime:n}},buildYTPControls:function(){var e=this.get(0),r=e.opt,t=jQuery("<span/>").attr("id","controlBar_"+e.id).addClass("mb_YTVPBar").css({whiteSpace:"noWrap",position:e.isBackground?"fixed":"absolute",zIndex:e.isBackground?1e4:1e3}).hide(),a=jQuery("<div/>").addClass("buttonBar"),o=jQuery("<span>"+jQuery.mbYTPlayer.controls.play+"</span>").addClass("mb_YTVPPlaypause ytpicon").click(function(){1==e.player.getPlayerState()?jQuery(e).pauseYTP():jQuery(e).playYTP()}),i=jQuery("<span>"+jQuery.mbYTPlayer.controls.mute+"</span>").addClass("mb_YTVPMuteUnmute ytpicon").click(function(){0==e.player.getVolume()?jQuery(e).unmuteYTPVolume():jQuery(e).muteYTPVolume()}),n=jQuery("<span/>").addClass("mb_YTVPTime"),l=r.videoURL;l.indexOf("http")<0&&(l="http://www.youtube.com/watch?v="+r.videoURL);var y=jQuery("<span/>").html(jQuery.mbYTPlayer.controls.ytLogo).addClass("mb_YTVPUrl ytpicon").attr("title","view on YouTube").on("click",function(){window.open(l,"viewOnYT")}),s=jQuery("<span/>").html(jQuery.mbYTPlayer.controls.onlyYT).addClass("mb_OnlyYT ytpicon").on("click",function(){if(e.isAlone)jQuery(e.wrapper).CSSAnimate({opacity:e.opt.opacity},500),jQuery(e.wrapper).css({zIndex:-1}),jQuery(this).html(jQuery.mbYTPlayer.controls.onlyYT),e.isAlone=!1;else{if(1!=e.player.getPlayerState())return;jQuery(e.wrapper).css({zIndex:1e4}).CSSAnimate({opacity:1},1e3,0),jQuery(this).html(jQuery.mbYTPlayer.controls.showSite),e.isAlone=!0}}),u=jQuery("<div/>").addClass("mb_YTVPProgress").css("position","absolute").click(function(r){d.css({width:r.clientX-d.offset().left}),e.timeW=r.clientX-d.offset().left,t.find(".mb_YTVPLoaded").css({width:0});var a=Math.floor(e.player.getDuration());e.goto=d.outerWidth()*a/u.outerWidth(),e.player.seekTo(parseFloat(e.goto),!0),t.find(".mb_YTVPLoaded").css({width:0})}),p=jQuery("<div/>").addClass("mb_YTVPLoaded").css("position","absolute"),d=jQuery("<div/>").addClass("mb_YTVTime").css("position","absolute");u.append(p).append(d),a.append(o).append(i).append(n),r.printUrl&&a.append(y),e.isBackground&&a.append(s),t.append(a).append(u),e.isBackground?jQuery("body").after(t):(t.addClass("inlinePlayer"),e.wrapper.before(t)),t.fadeIn()},checkForState:function(e){var r=jQuery("#controlBar_"+e.id),t=e.opt,a=e.opt.startAt?e.opt.startAt:1;e.getState=setInterval(function(){var o=jQuery(e).manageYTPProgress();r.find(".mb_YTVPTime").html(jQuery.mbYTPlayer.formatTime(o.currentTime)+" / "+jQuery.mbYTPlayer.formatTime(o.totalTime)),parseFloat(e.player.getDuration()-3)<e.player.getCurrentTime()&&1==e.player.getPlayerState()&&(t.loop?e.player.seekTo(a):(e.player.pauseVideo(),e.wrapper.CSSAnimate({opacity:0},2e3,function(){e.player.seekTo(a)})),jQuery(e).trigger("YTPEnd"))},1)},formatTime:function(e){var r=Math.floor(e/60),t=Math.floor(e-60*r);return(9>r?"0"+r:r)+" : "+(9>t?"0"+t:t)}},jQuery.fn.toggleVolume=function(){var e=this.get(0);if(e)return e.player.isMuted()?(jQuery(e).unmuteYTPVolume(),!0):(jQuery(e).muteYTPVolume(),!1)},jQuery.fn.optimizeDisplay=function(){var e=this.get(0),r=e.opt,t=jQuery(e.playerEl),a={},o=e.isBackground?jQuery(window):r.containment;a.width=o.width(),a.height=o.height();var i=24,n={};n.width=a.width+a.width*i/100,n.height=Math.ceil("16/9"==r.ratio?9*a.width/16:3*a.width/4),n.marginTop=-((n.height-a.height)/2),n.marginLeft=-(a.width*(i/2)/100),n.height<a.height&&(n.height=a.height+a.height*i/100,n.width=Math.floor("16/9"==r.ratio?16*a.height/9:4*a.height/3),n.marginTop=-(a.height*(i/2)/100),n.marginLeft=-((n.width-a.width)/2)),t.css({width:n.width,height:n.height,marginTop:n.marginTop,marginLeft:n.marginLeft})},jQuery.shuffle=function(e){for(var r=e.slice(),t=r.length,a=t;a--;){var o=parseInt(Math.random()*t),i=r[a];r[a]=r[o],r[o]=i}return r},jQuery.fn.mb_YTPlayer=jQuery.mbYTPlayer.buildPlayer,jQuery.fn.YTPlaylist=jQuery.mbYTPlayer.YTPlaylist,jQuery.fn.playNext=jQuery.mbYTPlayer.playNext,jQuery.fn.changeMovie=jQuery.mbYTPlayer.changeMovie,jQuery.fn.getVideoID=jQuery.mbYTPlayer.getVideoID,jQuery.fn.getPlayer=jQuery.mbYTPlayer.getPlayer,jQuery.fn.playerDestroy=jQuery.mbYTPlayer.playerDestroy,jQuery.fn.buildYTPControls=jQuery.mbYTPlayer.buildYTPControls,jQuery.fn.playYTP=jQuery.mbYTPlayer.playYTP,jQuery.fn.toggleLoops=jQuery.mbYTPlayer.toggleLoops,jQuery.fn.stopYTP=jQuery.mbYTPlayer.stopYTP,jQuery.fn.pauseYTP=jQuery.mbYTPlayer.pauseYTP,jQuery.fn.muteYTPVolume=jQuery.mbYTPlayer.muteYTPVolume,jQuery.fn.unmuteYTPVolume=jQuery.mbYTPlayer.unmuteYTPVolume,jQuery.fn.setYTPVolume=jQuery.mbYTPlayer.setYTPVolume,jQuery.fn.manageYTPProgress=jQuery.mbYTPlayer.manageYTPProgress}(jQuery);
|
sevypannella/cdnjs
|
ajax/libs/jquery.mb.YTPlayer/2.5.2/jquery.mb.YTPlayer.min.js
|
JavaScript
|
mit
| 21,741 |
/*! angular-google-maps 1.2.1 2014-08-21
* AngularJS directives for Google Maps
* git: https://github.com/nlaplante/angular-google-maps.git
*/
/**
* @name InfoBox
* @version 1.1.12 [December 11, 2012]
* @author Gary Little (inspired by proof-of-concept code from Pamela Fox of Google)
* @copyright Copyright 2010 Gary Little [gary at luxcentral.com]
* @fileoverview InfoBox extends the Google Maps JavaScript API V3 <tt>OverlayView</tt> class.
* <p>
* An InfoBox behaves like a <tt>google.maps.InfoWindow</tt>, but it supports several
* additional properties for advanced styling. An InfoBox can also be used as a map label.
* <p>
* An InfoBox also fires the same events as a <tt>google.maps.InfoWindow</tt>.
*/
/*!
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*jslint browser:true */
/*global google */
/**
* @name InfoBoxOptions
* @class This class represents the optional parameter passed to the {@link InfoBox} constructor.
* @property {string|Node} content The content of the InfoBox (plain text or an HTML DOM node).
* @property {boolean} [disableAutoPan=false] Disable auto-pan on <tt>open</tt>.
* @property {number} maxWidth The maximum width (in pixels) of the InfoBox. Set to 0 if no maximum.
* @property {Size} pixelOffset The offset (in pixels) from the top left corner of the InfoBox
* (or the bottom left corner if the <code>alignBottom</code> property is <code>true</code>)
* to the map pixel corresponding to <tt>position</tt>.
* @property {LatLng} position The geographic location at which to display the InfoBox.
* @property {number} zIndex The CSS z-index style value for the InfoBox.
* Note: This value overrides a zIndex setting specified in the <tt>boxStyle</tt> property.
* @property {string} [boxClass="infoBox"] The name of the CSS class defining the styles for the InfoBox container.
* @property {Object} [boxStyle] An object literal whose properties define specific CSS
* style values to be applied to the InfoBox. Style values defined here override those that may
* be defined in the <code>boxClass</code> style sheet. If this property is changed after the
* InfoBox has been created, all previously set styles (except those defined in the style sheet)
* are removed from the InfoBox before the new style values are applied.
* @property {string} closeBoxMargin The CSS margin style value for the close box.
* The default is "2px" (a 2-pixel margin on all sides).
* @property {string} closeBoxURL The URL of the image representing the close box.
* Note: The default is the URL for Google's standard close box.
* Set this property to "" if no close box is required.
* @property {Size} infoBoxClearance Minimum offset (in pixels) from the InfoBox to the
* map edge after an auto-pan.
* @property {boolean} [isHidden=false] Hide the InfoBox on <tt>open</tt>.
* [Deprecated in favor of the <tt>visible</tt> property.]
* @property {boolean} [visible=true] Show the InfoBox on <tt>open</tt>.
* @property {boolean} alignBottom Align the bottom left corner of the InfoBox to the <code>position</code>
* location (default is <tt>false</tt> which means that the top left corner of the InfoBox is aligned).
* @property {string} pane The pane where the InfoBox is to appear (default is "floatPane").
* Set the pane to "mapPane" if the InfoBox is being used as a map label.
* Valid pane names are the property names for the <tt>google.maps.MapPanes</tt> object.
* @property {boolean} enableEventPropagation Propagate mousedown, mousemove, mouseover, mouseout,
* mouseup, click, dblclick, touchstart, touchend, touchmove, and contextmenu events in the InfoBox
* (default is <tt>false</tt> to mimic the behavior of a <tt>google.maps.InfoWindow</tt>). Set
* this property to <tt>true</tt> if the InfoBox is being used as a map label.
*/
/**
* Creates an InfoBox with the options specified in {@link InfoBoxOptions}.
* Call <tt>InfoBox.open</tt> to add the box to the map.
* @constructor
* @param {InfoBoxOptions} [opt_opts]
*/
function InfoBox(opt_opts) {
opt_opts = opt_opts || {};
google.maps.OverlayView.apply(this, arguments);
// Standard options (in common with google.maps.InfoWindow):
//
this.content_ = opt_opts.content || "";
this.disableAutoPan_ = opt_opts.disableAutoPan || false;
this.maxWidth_ = opt_opts.maxWidth || 0;
this.pixelOffset_ = opt_opts.pixelOffset || new google.maps.Size(0, 0);
this.position_ = opt_opts.position || new google.maps.LatLng(0, 0);
this.zIndex_ = opt_opts.zIndex || null;
// Additional options (unique to InfoBox):
//
this.boxClass_ = opt_opts.boxClass || "infoBox";
this.boxStyle_ = opt_opts.boxStyle || {};
this.closeBoxMargin_ = opt_opts.closeBoxMargin || "2px";
this.closeBoxURL_ = opt_opts.closeBoxURL || "http://www.google.com/intl/en_us/mapfiles/close.gif";
if (opt_opts.closeBoxURL === "") {
this.closeBoxURL_ = "";
}
this.infoBoxClearance_ = opt_opts.infoBoxClearance || new google.maps.Size(1, 1);
if (typeof opt_opts.visible === "undefined") {
if (typeof opt_opts.isHidden === "undefined") {
opt_opts.visible = true;
} else {
opt_opts.visible = !opt_opts.isHidden;
}
}
this.isHidden_ = !opt_opts.visible;
this.alignBottom_ = opt_opts.alignBottom || false;
this.pane_ = opt_opts.pane || "floatPane";
this.enableEventPropagation_ = opt_opts.enableEventPropagation || false;
this.div_ = null;
this.closeListener_ = null;
this.moveListener_ = null;
this.contextListener_ = null;
this.eventListeners_ = null;
this.fixedWidthSet_ = null;
}
/* InfoBox extends OverlayView in the Google Maps API v3.
*/
InfoBox.prototype = new google.maps.OverlayView();
/**
* Creates the DIV representing the InfoBox.
* @private
*/
InfoBox.prototype.createInfoBoxDiv_ = function () {
var i;
var events;
var bw;
var me = this;
// This handler prevents an event in the InfoBox from being passed on to the map.
//
var cancelHandler = function (e) {
e.cancelBubble = true;
if (e.stopPropagation) {
e.stopPropagation();
}
};
// This handler ignores the current event in the InfoBox and conditionally prevents
// the event from being passed on to the map. It is used for the contextmenu event.
//
var ignoreHandler = function (e) {
e.returnValue = false;
if (e.preventDefault) {
e.preventDefault();
}
if (!me.enableEventPropagation_) {
cancelHandler(e);
}
};
if (!this.div_) {
this.div_ = document.createElement("div");
this.setBoxStyle_();
if (typeof this.content_.nodeType === "undefined") {
this.div_.innerHTML = this.getCloseBoxImg_() + this.content_;
} else {
this.div_.innerHTML = this.getCloseBoxImg_();
this.div_.appendChild(this.content_);
}
// Add the InfoBox DIV to the DOM
this.getPanes()[this.pane_].appendChild(this.div_);
this.addClickHandler_();
if (this.div_.style.width) {
this.fixedWidthSet_ = true;
} else {
if (this.maxWidth_ !== 0 && this.div_.offsetWidth > this.maxWidth_) {
this.div_.style.width = this.maxWidth_;
this.div_.style.overflow = "auto";
this.fixedWidthSet_ = true;
} else { // The following code is needed to overcome problems with MSIE
bw = this.getBoxWidths_();
this.div_.style.width = (this.div_.offsetWidth - bw.left - bw.right) + "px";
this.fixedWidthSet_ = false;
}
}
this.panBox_(this.disableAutoPan_);
if (!this.enableEventPropagation_) {
this.eventListeners_ = [];
// Cancel event propagation.
//
// Note: mousemove not included (to resolve Issue 152)
events = ["mousedown", "mouseover", "mouseout", "mouseup",
"click", "dblclick", "touchstart", "touchend", "touchmove"];
for (i = 0; i < events.length; i++) {
this.eventListeners_.push(google.maps.event.addDomListener(this.div_, events[i], cancelHandler));
}
// Workaround for Google bug that causes the cursor to change to a pointer
// when the mouse moves over a marker underneath InfoBox.
this.eventListeners_.push(google.maps.event.addDomListener(this.div_, "mouseover", function (e) {
this.style.cursor = "default";
}));
}
this.contextListener_ = google.maps.event.addDomListener(this.div_, "contextmenu", ignoreHandler);
/**
* This event is fired when the DIV containing the InfoBox's content is attached to the DOM.
* @name InfoBox#domready
* @event
*/
google.maps.event.trigger(this, "domready");
}
};
/**
* Returns the HTML <IMG> tag for the close box.
* @private
*/
InfoBox.prototype.getCloseBoxImg_ = function () {
var img = "";
if (this.closeBoxURL_ !== "") {
img = "<img";
img += " src='" + this.closeBoxURL_ + "'";
img += " align=right"; // Do this because Opera chokes on style='float: right;'
img += " style='";
img += " position: relative;"; // Required by MSIE
img += " cursor: pointer;";
img += " margin: " + this.closeBoxMargin_ + ";";
img += "'>";
}
return img;
};
/**
* Adds the click handler to the InfoBox close box.
* @private
*/
InfoBox.prototype.addClickHandler_ = function () {
var closeBox;
if (this.closeBoxURL_ !== "") {
closeBox = this.div_.firstChild;
this.closeListener_ = google.maps.event.addDomListener(closeBox, "click", this.getCloseClickHandler_());
} else {
this.closeListener_ = null;
}
};
/**
* Returns the function to call when the user clicks the close box of an InfoBox.
* @private
*/
InfoBox.prototype.getCloseClickHandler_ = function () {
var me = this;
return function (e) {
// 1.0.3 fix: Always prevent propagation of a close box click to the map:
e.cancelBubble = true;
if (e.stopPropagation) {
e.stopPropagation();
}
/**
* This event is fired when the InfoBox's close box is clicked.
* @name InfoBox#closeclick
* @event
*/
google.maps.event.trigger(me, "closeclick");
me.close();
};
};
/**
* Pans the map so that the InfoBox appears entirely within the map's visible area.
* @private
*/
InfoBox.prototype.panBox_ = function (disablePan) {
var map;
var bounds;
var xOffset = 0, yOffset = 0;
if (!disablePan) {
map = this.getMap();
if (map instanceof google.maps.Map) { // Only pan if attached to map, not panorama
if (!map.getBounds().contains(this.position_)) {
// Marker not in visible area of map, so set center
// of map to the marker position first.
map.setCenter(this.position_);
}
bounds = map.getBounds();
var mapDiv = map.getDiv();
var mapWidth = mapDiv.offsetWidth;
var mapHeight = mapDiv.offsetHeight;
var iwOffsetX = this.pixelOffset_.width;
var iwOffsetY = this.pixelOffset_.height;
var iwWidth = this.div_.offsetWidth;
var iwHeight = this.div_.offsetHeight;
var padX = this.infoBoxClearance_.width;
var padY = this.infoBoxClearance_.height;
var pixPosition = this.getProjection().fromLatLngToContainerPixel(this.position_);
if (pixPosition.x < (-iwOffsetX + padX)) {
xOffset = pixPosition.x + iwOffsetX - padX;
} else if ((pixPosition.x + iwWidth + iwOffsetX + padX) > mapWidth) {
xOffset = pixPosition.x + iwWidth + iwOffsetX + padX - mapWidth;
}
if (this.alignBottom_) {
if (pixPosition.y < (-iwOffsetY + padY + iwHeight)) {
yOffset = pixPosition.y + iwOffsetY - padY - iwHeight;
} else if ((pixPosition.y + iwOffsetY + padY) > mapHeight) {
yOffset = pixPosition.y + iwOffsetY + padY - mapHeight;
}
} else {
if (pixPosition.y < (-iwOffsetY + padY)) {
yOffset = pixPosition.y + iwOffsetY - padY;
} else if ((pixPosition.y + iwHeight + iwOffsetY + padY) > mapHeight) {
yOffset = pixPosition.y + iwHeight + iwOffsetY + padY - mapHeight;
}
}
if (!(xOffset === 0 && yOffset === 0)) {
// Move the map to the shifted center.
//
var c = map.getCenter();
map.panBy(xOffset, yOffset);
}
}
}
};
/**
* Sets the style of the InfoBox by setting the style sheet and applying
* other specific styles requested.
* @private
*/
InfoBox.prototype.setBoxStyle_ = function () {
var i, boxStyle;
if (this.div_) {
// Apply style values from the style sheet defined in the boxClass parameter:
this.div_.className = this.boxClass_;
// Clear existing inline style values:
this.div_.style.cssText = "";
// Apply style values defined in the boxStyle parameter:
boxStyle = this.boxStyle_;
for (i in boxStyle) {
if (boxStyle.hasOwnProperty(i)) {
this.div_.style[i] = boxStyle[i];
}
}
// Fix up opacity style for benefit of MSIE:
//
if (typeof this.div_.style.opacity !== "undefined" && this.div_.style.opacity !== "") {
this.div_.style.filter = "alpha(opacity=" + (this.div_.style.opacity * 100) + ")";
}
// Apply required styles:
//
this.div_.style.position = "absolute";
this.div_.style.visibility = 'hidden';
if (this.zIndex_ !== null) {
this.div_.style.zIndex = this.zIndex_;
}
}
};
/**
* Get the widths of the borders of the InfoBox.
* @private
* @return {Object} widths object (top, bottom left, right)
*/
InfoBox.prototype.getBoxWidths_ = function () {
var computedStyle;
var bw = {top: 0, bottom: 0, left: 0, right: 0};
var box = this.div_;
if (document.defaultView && document.defaultView.getComputedStyle) {
computedStyle = box.ownerDocument.defaultView.getComputedStyle(box, "");
if (computedStyle) {
// The computed styles are always in pixel units (good!)
bw.top = parseInt(computedStyle.borderTopWidth, 10) || 0;
bw.bottom = parseInt(computedStyle.borderBottomWidth, 10) || 0;
bw.left = parseInt(computedStyle.borderLeftWidth, 10) || 0;
bw.right = parseInt(computedStyle.borderRightWidth, 10) || 0;
}
} else if (document.documentElement.currentStyle) { // MSIE
if (box.currentStyle) {
// The current styles may not be in pixel units, but assume they are (bad!)
bw.top = parseInt(box.currentStyle.borderTopWidth, 10) || 0;
bw.bottom = parseInt(box.currentStyle.borderBottomWidth, 10) || 0;
bw.left = parseInt(box.currentStyle.borderLeftWidth, 10) || 0;
bw.right = parseInt(box.currentStyle.borderRightWidth, 10) || 0;
}
}
return bw;
};
/**
* Invoked when <tt>close</tt> is called. Do not call it directly.
*/
InfoBox.prototype.onRemove = function () {
if (this.div_) {
this.div_.parentNode.removeChild(this.div_);
this.div_ = null;
}
};
/**
* Draws the InfoBox based on the current map projection and zoom level.
*/
InfoBox.prototype.draw = function () {
this.createInfoBoxDiv_();
var pixPosition = this.getProjection().fromLatLngToDivPixel(this.position_);
this.div_.style.left = (pixPosition.x + this.pixelOffset_.width) + "px";
if (this.alignBottom_) {
this.div_.style.bottom = -(pixPosition.y + this.pixelOffset_.height) + "px";
} else {
this.div_.style.top = (pixPosition.y + this.pixelOffset_.height) + "px";
}
if (this.isHidden_) {
this.div_.style.visibility = 'hidden';
} else {
this.div_.style.visibility = "visible";
}
};
/**
* Sets the options for the InfoBox. Note that changes to the <tt>maxWidth</tt>,
* <tt>closeBoxMargin</tt>, <tt>closeBoxURL</tt>, and <tt>enableEventPropagation</tt>
* properties have no affect until the current InfoBox is <tt>close</tt>d and a new one
* is <tt>open</tt>ed.
* @param {InfoBoxOptions} opt_opts
*/
InfoBox.prototype.setOptions = function (opt_opts) {
if (typeof opt_opts.boxClass !== "undefined") { // Must be first
this.boxClass_ = opt_opts.boxClass;
this.setBoxStyle_();
}
if (typeof opt_opts.boxStyle !== "undefined") { // Must be second
this.boxStyle_ = opt_opts.boxStyle;
this.setBoxStyle_();
}
if (typeof opt_opts.content !== "undefined") {
this.setContent(opt_opts.content);
}
if (typeof opt_opts.disableAutoPan !== "undefined") {
this.disableAutoPan_ = opt_opts.disableAutoPan;
}
if (typeof opt_opts.maxWidth !== "undefined") {
this.maxWidth_ = opt_opts.maxWidth;
}
if (typeof opt_opts.pixelOffset !== "undefined") {
this.pixelOffset_ = opt_opts.pixelOffset;
}
if (typeof opt_opts.alignBottom !== "undefined") {
this.alignBottom_ = opt_opts.alignBottom;
}
if (typeof opt_opts.position !== "undefined") {
this.setPosition(opt_opts.position);
}
if (typeof opt_opts.zIndex !== "undefined") {
this.setZIndex(opt_opts.zIndex);
}
if (typeof opt_opts.closeBoxMargin !== "undefined") {
this.closeBoxMargin_ = opt_opts.closeBoxMargin;
}
if (typeof opt_opts.closeBoxURL !== "undefined") {
this.closeBoxURL_ = opt_opts.closeBoxURL;
}
if (typeof opt_opts.infoBoxClearance !== "undefined") {
this.infoBoxClearance_ = opt_opts.infoBoxClearance;
}
if (typeof opt_opts.isHidden !== "undefined") {
this.isHidden_ = opt_opts.isHidden;
}
if (typeof opt_opts.visible !== "undefined") {
this.isHidden_ = !opt_opts.visible;
}
if (typeof opt_opts.enableEventPropagation !== "undefined") {
this.enableEventPropagation_ = opt_opts.enableEventPropagation;
}
if (this.div_) {
this.draw();
}
};
/**
* Sets the content of the InfoBox.
* The content can be plain text or an HTML DOM node.
* @param {string|Node} content
*/
InfoBox.prototype.setContent = function (content) {
this.content_ = content;
if (this.div_) {
if (this.closeListener_) {
google.maps.event.removeListener(this.closeListener_);
this.closeListener_ = null;
}
// Odd code required to make things work with MSIE.
//
if (!this.fixedWidthSet_) {
this.div_.style.width = "";
}
if (typeof content.nodeType === "undefined") {
this.div_.innerHTML = this.getCloseBoxImg_() + content;
} else {
this.div_.innerHTML = this.getCloseBoxImg_();
this.div_.appendChild(content);
}
// Perverse code required to make things work with MSIE.
// (Ensures the close box does, in fact, float to the right.)
//
if (!this.fixedWidthSet_) {
this.div_.style.width = this.div_.offsetWidth + "px";
if (typeof content.nodeType === "undefined") {
this.div_.innerHTML = this.getCloseBoxImg_() + content;
} else {
this.div_.innerHTML = this.getCloseBoxImg_();
this.div_.appendChild(content);
}
}
this.addClickHandler_();
}
/**
* This event is fired when the content of the InfoBox changes.
* @name InfoBox#content_changed
* @event
*/
google.maps.event.trigger(this, "content_changed");
};
/**
* Sets the geographic location of the InfoBox.
* @param {LatLng} latlng
*/
InfoBox.prototype.setPosition = function (latlng) {
this.position_ = latlng;
if (this.div_) {
this.draw();
}
/**
* This event is fired when the position of the InfoBox changes.
* @name InfoBox#position_changed
* @event
*/
google.maps.event.trigger(this, "position_changed");
};
/**
* Sets the zIndex style for the InfoBox.
* @param {number} index
*/
InfoBox.prototype.setZIndex = function (index) {
this.zIndex_ = index;
if (this.div_) {
this.div_.style.zIndex = index;
}
/**
* This event is fired when the zIndex of the InfoBox changes.
* @name InfoBox#zindex_changed
* @event
*/
google.maps.event.trigger(this, "zindex_changed");
};
/**
* Sets the visibility of the InfoBox.
* @param {boolean} isVisible
*/
InfoBox.prototype.setVisible = function (isVisible) {
this.isHidden_ = !isVisible;
if (this.div_) {
this.div_.style.visibility = (this.isHidden_ ? "hidden" : "visible");
}
};
/**
* Returns the content of the InfoBox.
* @returns {string}
*/
InfoBox.prototype.getContent = function () {
return this.content_;
};
/**
* Returns the geographic location of the InfoBox.
* @returns {LatLng}
*/
InfoBox.prototype.getPosition = function () {
return this.position_;
};
/**
* Returns the zIndex for the InfoBox.
* @returns {number}
*/
InfoBox.prototype.getZIndex = function () {
return this.zIndex_;
};
/**
* Returns a flag indicating whether the InfoBox is visible.
* @returns {boolean}
*/
InfoBox.prototype.getVisible = function () {
var isVisible;
if ((typeof this.getMap() === "undefined") || (this.getMap() === null)) {
isVisible = false;
} else {
isVisible = !this.isHidden_;
}
return isVisible;
};
/**
* Shows the InfoBox. [Deprecated; use <tt>setVisible</tt> instead.]
*/
InfoBox.prototype.show = function () {
this.isHidden_ = false;
if (this.div_) {
this.div_.style.visibility = "visible";
}
};
/**
* Hides the InfoBox. [Deprecated; use <tt>setVisible</tt> instead.]
*/
InfoBox.prototype.hide = function () {
this.isHidden_ = true;
if (this.div_) {
this.div_.style.visibility = "hidden";
}
};
/**
* Adds the InfoBox to the specified map or Street View panorama. If <tt>anchor</tt>
* (usually a <tt>google.maps.Marker</tt>) is specified, the position
* of the InfoBox is set to the position of the <tt>anchor</tt>. If the
* anchor is dragged to a new location, the InfoBox moves as well.
* @param {Map|StreetViewPanorama} map
* @param {MVCObject} [anchor]
*/
InfoBox.prototype.open = function (map, anchor) {
var me = this;
if (anchor) {
this.position_ = anchor.getPosition();
this.moveListener_ = google.maps.event.addListener(anchor, "position_changed", function () {
me.setPosition(this.getPosition());
});
}
this.setMap(map);
if (this.div_) {
this.panBox_();
}
};
/**
* Removes the InfoBox from the map.
*/
InfoBox.prototype.close = function () {
var i;
if (this.closeListener_) {
google.maps.event.removeListener(this.closeListener_);
this.closeListener_ = null;
}
if (this.eventListeners_) {
for (i = 0; i < this.eventListeners_.length; i++) {
google.maps.event.removeListener(this.eventListeners_[i]);
}
this.eventListeners_ = null;
}
if (this.moveListener_) {
google.maps.event.removeListener(this.moveListener_);
this.moveListener_ = null;
}
if (this.contextListener_) {
google.maps.event.removeListener(this.contextListener_);
this.contextListener_ = null;
}
this.setMap(null);
};;/**
* @name MarkerClustererPlus for Google Maps V3
* @version 2.1.1 [November 4, 2013]
* @author Gary Little
* @fileoverview
* The library creates and manages per-zoom-level clusters for large amounts of markers.
* <p>
* This is an enhanced V3 implementation of the
* <a href="http://gmaps-utility-library-dev.googlecode.com/svn/tags/markerclusterer/"
* >V2 MarkerClusterer</a> by Xiaoxi Wu. It is based on the
* <a href="http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/"
* >V3 MarkerClusterer</a> port by Luke Mahe. MarkerClustererPlus was created by Gary Little.
* <p>
* v2.0 release: MarkerClustererPlus v2.0 is backward compatible with MarkerClusterer v1.0. It
* adds support for the <code>ignoreHidden</code>, <code>title</code>, <code>batchSizeIE</code>,
* and <code>calculator</code> properties as well as support for four more events. It also allows
* greater control over the styling of the text that appears on the cluster marker. The
* documentation has been significantly improved and the overall code has been simplified and
* polished. Very large numbers of markers can now be managed without causing Javascript timeout
* errors on Internet Explorer. Note that the name of the <code>clusterclick</code> event has been
* deprecated. The new name is <code>click</code>, so please change your application code now.
*/
/**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @name ClusterIconStyle
* @class This class represents the object for values in the <code>styles</code> array passed
* to the {@link MarkerClusterer} constructor. The element in this array that is used to
* style the cluster icon is determined by calling the <code>calculator</code> function.
*
* @property {string} url The URL of the cluster icon image file. Required.
* @property {number} height The display height (in pixels) of the cluster icon. Required.
* @property {number} width The display width (in pixels) of the cluster icon. Required.
* @property {Array} [anchorText] The position (in pixels) from the center of the cluster icon to
* where the text label is to be centered and drawn. The format is <code>[yoffset, xoffset]</code>
* where <code>yoffset</code> increases as you go down from center and <code>xoffset</code>
* increases to the right of center. The default is <code>[0, 0]</code>.
* @property {Array} [anchorIcon] The anchor position (in pixels) of the cluster icon. This is the
* spot on the cluster icon that is to be aligned with the cluster position. The format is
* <code>[yoffset, xoffset]</code> where <code>yoffset</code> increases as you go down and
* <code>xoffset</code> increases to the right of the top-left corner of the icon. The default
* anchor position is the center of the cluster icon.
* @property {string} [textColor="black"] The color of the label text shown on the
* cluster icon.
* @property {number} [textSize=11] The size (in pixels) of the label text shown on the
* cluster icon.
* @property {string} [textDecoration="none"] The value of the CSS <code>text-decoration</code>
* property for the label text shown on the cluster icon.
* @property {string} [fontWeight="bold"] The value of the CSS <code>font-weight</code>
* property for the label text shown on the cluster icon.
* @property {string} [fontStyle="normal"] The value of the CSS <code>font-style</code>
* property for the label text shown on the cluster icon.
* @property {string} [fontFamily="Arial,sans-serif"] The value of the CSS <code>font-family</code>
* property for the label text shown on the cluster icon.
* @property {string} [backgroundPosition="0 0"] The position of the cluster icon image
* within the image defined by <code>url</code>. The format is <code>"xpos ypos"</code>
* (the same format as for the CSS <code>background-position</code> property). You must set
* this property appropriately when the image defined by <code>url</code> represents a sprite
* containing multiple images. Note that the position <i>must</i> be specified in px units.
*/
/**
* @name ClusterIconInfo
* @class This class is an object containing general information about a cluster icon. This is
* the object that a <code>calculator</code> function returns.
*
* @property {string} text The text of the label to be shown on the cluster icon.
* @property {number} index The index plus 1 of the element in the <code>styles</code>
* array to be used to style the cluster icon.
* @property {string} title The tooltip to display when the mouse moves over the cluster icon.
* If this value is <code>undefined</code> or <code>""</code>, <code>title</code> is set to the
* value of the <code>title</code> property passed to the MarkerClusterer.
*/
/**
* A cluster icon.
*
* @constructor
* @extends google.maps.OverlayView
* @param {Cluster} cluster The cluster with which the icon is to be associated.
* @param {Array} [styles] An array of {@link ClusterIconStyle} defining the cluster icons
* to use for various cluster sizes.
* @private
*/
function ClusterIcon(cluster, styles) {
cluster.getMarkerClusterer().extend(ClusterIcon, google.maps.OverlayView);
this.cluster_ = cluster;
this.className_ = cluster.getMarkerClusterer().getClusterClass();
this.styles_ = styles;
this.center_ = null;
this.div_ = null;
this.sums_ = null;
this.visible_ = false;
this.setMap(cluster.getMap()); // Note: this causes onAdd to be called
}
/**
* Adds the icon to the DOM.
*/
ClusterIcon.prototype.onAdd = function () {
var cClusterIcon = this;
var cMouseDownInCluster;
var cDraggingMapByCluster;
this.div_ = document.createElement("div");
this.div_.className = this.className_;
if (this.visible_) {
this.show();
}
this.getPanes().overlayMouseTarget.appendChild(this.div_);
// Fix for Issue 157
this.boundsChangedListener_ = google.maps.event.addListener(this.getMap(), "bounds_changed", function () {
cDraggingMapByCluster = cMouseDownInCluster;
});
google.maps.event.addDomListener(this.div_, "mousedown", function () {
cMouseDownInCluster = true;
cDraggingMapByCluster = false;
});
google.maps.event.addDomListener(this.div_, "click", function (e) {
cMouseDownInCluster = false;
if (!cDraggingMapByCluster) {
var theBounds;
var mz;
var mc = cClusterIcon.cluster_.getMarkerClusterer();
/**
* This event is fired when a cluster marker is clicked.
* @name MarkerClusterer#click
* @param {Cluster} c The cluster that was clicked.
* @event
*/
google.maps.event.trigger(mc, "click", cClusterIcon.cluster_);
google.maps.event.trigger(mc, "clusterclick", cClusterIcon.cluster_); // deprecated name
// The default click handler follows. Disable it by setting
// the zoomOnClick property to false.
if (mc.getZoomOnClick()) {
// Zoom into the cluster.
mz = mc.getMaxZoom();
theBounds = cClusterIcon.cluster_.getBounds();
mc.getMap().fitBounds(theBounds);
// There is a fix for Issue 170 here:
setTimeout(function () {
mc.getMap().fitBounds(theBounds);
// Don't zoom beyond the max zoom level
if (mz !== null && (mc.getMap().getZoom() > mz)) {
mc.getMap().setZoom(mz + 1);
}
}, 100);
}
// Prevent event propagation to the map:
e.cancelBubble = true;
if (e.stopPropagation) {
e.stopPropagation();
}
}
});
google.maps.event.addDomListener(this.div_, "mouseover", function () {
var mc = cClusterIcon.cluster_.getMarkerClusterer();
/**
* This event is fired when the mouse moves over a cluster marker.
* @name MarkerClusterer#mouseover
* @param {Cluster} c The cluster that the mouse moved over.
* @event
*/
google.maps.event.trigger(mc, "mouseover", cClusterIcon.cluster_);
});
google.maps.event.addDomListener(this.div_, "mouseout", function () {
var mc = cClusterIcon.cluster_.getMarkerClusterer();
/**
* This event is fired when the mouse moves out of a cluster marker.
* @name MarkerClusterer#mouseout
* @param {Cluster} c The cluster that the mouse moved out of.
* @event
*/
google.maps.event.trigger(mc, "mouseout", cClusterIcon.cluster_);
});
};
/**
* Removes the icon from the DOM.
*/
ClusterIcon.prototype.onRemove = function () {
if (this.div_ && this.div_.parentNode) {
this.hide();
google.maps.event.removeListener(this.boundsChangedListener_);
google.maps.event.clearInstanceListeners(this.div_);
this.div_.parentNode.removeChild(this.div_);
this.div_ = null;
}
};
/**
* Draws the icon.
*/
ClusterIcon.prototype.draw = function () {
if (this.visible_) {
var pos = this.getPosFromLatLng_(this.center_);
this.div_.style.top = pos.y + "px";
this.div_.style.left = pos.x + "px";
}
};
/**
* Hides the icon.
*/
ClusterIcon.prototype.hide = function () {
if (this.div_) {
this.div_.style.display = "none";
}
this.visible_ = false;
};
/**
* Positions and shows the icon.
*/
ClusterIcon.prototype.show = function () {
if (this.div_) {
var img = "";
// NOTE: values must be specified in px units
var bp = this.backgroundPosition_.split(" ");
var spriteH = parseInt(bp[0].trim(), 10);
var spriteV = parseInt(bp[1].trim(), 10);
var pos = this.getPosFromLatLng_(this.center_);
this.div_.style.cssText = this.createCss(pos);
img = "<img src='" + this.url_ + "' style='position: absolute; top: " + spriteV + "px; left: " + spriteH + "px; ";
if (!this.cluster_.getMarkerClusterer().enableRetinaIcons_) {
img += "clip: rect(" + (-1 * spriteV) + "px, " + ((-1 * spriteH) + this.width_) + "px, " +
((-1 * spriteV) + this.height_) + "px, " + (-1 * spriteH) + "px);";
}
img += "'>";
this.div_.innerHTML = img + "<div style='" +
"position: absolute;" +
"top: " + this.anchorText_[0] + "px;" +
"left: " + this.anchorText_[1] + "px;" +
"color: " + this.textColor_ + ";" +
"font-size: " + this.textSize_ + "px;" +
"font-family: " + this.fontFamily_ + ";" +
"font-weight: " + this.fontWeight_ + ";" +
"font-style: " + this.fontStyle_ + ";" +
"text-decoration: " + this.textDecoration_ + ";" +
"text-align: center;" +
"width: " + this.width_ + "px;" +
"line-height:" + this.height_ + "px;" +
"'>" + this.sums_.text + "</div>";
if (typeof this.sums_.title === "undefined" || this.sums_.title === "") {
this.div_.title = this.cluster_.getMarkerClusterer().getTitle();
} else {
this.div_.title = this.sums_.title;
}
this.div_.style.display = "";
}
this.visible_ = true;
};
/**
* Sets the icon styles to the appropriate element in the styles array.
*
* @param {ClusterIconInfo} sums The icon label text and styles index.
*/
ClusterIcon.prototype.useStyle = function (sums) {
this.sums_ = sums;
var index = Math.max(0, sums.index - 1);
index = Math.min(this.styles_.length - 1, index);
var style = this.styles_[index];
this.url_ = style.url;
this.height_ = style.height;
this.width_ = style.width;
this.anchorText_ = style.anchorText || [0, 0];
this.anchorIcon_ = style.anchorIcon || [parseInt(this.height_ / 2, 10), parseInt(this.width_ / 2, 10)];
this.textColor_ = style.textColor || "black";
this.textSize_ = style.textSize || 11;
this.textDecoration_ = style.textDecoration || "none";
this.fontWeight_ = style.fontWeight || "bold";
this.fontStyle_ = style.fontStyle || "normal";
this.fontFamily_ = style.fontFamily || "Arial,sans-serif";
this.backgroundPosition_ = style.backgroundPosition || "0 0";
};
/**
* Sets the position at which to center the icon.
*
* @param {google.maps.LatLng} center The latlng to set as the center.
*/
ClusterIcon.prototype.setCenter = function (center) {
this.center_ = center;
};
/**
* Creates the cssText style parameter based on the position of the icon.
*
* @param {google.maps.Point} pos The position of the icon.
* @return {string} The CSS style text.
*/
ClusterIcon.prototype.createCss = function (pos) {
var style = [];
style.push("cursor: pointer;");
style.push("position: absolute; top: " + pos.y + "px; left: " + pos.x + "px;");
style.push("width: " + this.width_ + "px; height: " + this.height_ + "px;");
return style.join("");
};
/**
* Returns the position at which to place the DIV depending on the latlng.
*
* @param {google.maps.LatLng} latlng The position in latlng.
* @return {google.maps.Point} The position in pixels.
*/
ClusterIcon.prototype.getPosFromLatLng_ = function (latlng) {
var pos = this.getProjection().fromLatLngToDivPixel(latlng);
pos.x -= this.anchorIcon_[1];
pos.y -= this.anchorIcon_[0];
pos.x = parseInt(pos.x, 10);
pos.y = parseInt(pos.y, 10);
return pos;
};
/**
* Creates a single cluster that manages a group of proximate markers.
* Used internally, do not call this constructor directly.
* @constructor
* @param {MarkerClusterer} mc The <code>MarkerClusterer</code> object with which this
* cluster is associated.
*/
function Cluster(mc) {
this.markerClusterer_ = mc;
this.map_ = mc.getMap();
this.gridSize_ = mc.getGridSize();
this.minClusterSize_ = mc.getMinimumClusterSize();
this.averageCenter_ = mc.getAverageCenter();
this.markers_ = [];
this.center_ = null;
this.bounds_ = null;
this.clusterIcon_ = new ClusterIcon(this, mc.getStyles());
}
/**
* Returns the number of markers managed by the cluster. You can call this from
* a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler
* for the <code>MarkerClusterer</code> object.
*
* @return {number} The number of markers in the cluster.
*/
Cluster.prototype.getSize = function () {
return this.markers_.length;
};
/**
* Returns the array of markers managed by the cluster. You can call this from
* a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler
* for the <code>MarkerClusterer</code> object.
*
* @return {Array} The array of markers in the cluster.
*/
Cluster.prototype.getMarkers = function () {
return this.markers_;
};
/**
* Returns the center of the cluster. You can call this from
* a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler
* for the <code>MarkerClusterer</code> object.
*
* @return {google.maps.LatLng} The center of the cluster.
*/
Cluster.prototype.getCenter = function () {
return this.center_;
};
/**
* Returns the map with which the cluster is associated.
*
* @return {google.maps.Map} The map.
* @ignore
*/
Cluster.prototype.getMap = function () {
return this.map_;
};
/**
* Returns the <code>MarkerClusterer</code> object with which the cluster is associated.
*
* @return {MarkerClusterer} The associated marker clusterer.
* @ignore
*/
Cluster.prototype.getMarkerClusterer = function () {
return this.markerClusterer_;
};
/**
* Returns the bounds of the cluster.
*
* @return {google.maps.LatLngBounds} the cluster bounds.
* @ignore
*/
Cluster.prototype.getBounds = function () {
var i;
var bounds = new google.maps.LatLngBounds(this.center_, this.center_);
var markers = this.getMarkers();
for (i = 0; i < markers.length; i++) {
bounds.extend(markers[i].getPosition());
}
return bounds;
};
/**
* Removes the cluster from the map.
*
* @ignore
*/
Cluster.prototype.remove = function () {
this.clusterIcon_.setMap(null);
this.markers_ = [];
delete this.markers_;
};
/**
* Adds a marker to the cluster.
*
* @param {google.maps.Marker} marker The marker to be added.
* @return {boolean} True if the marker was added.
* @ignore
*/
Cluster.prototype.addMarker = function (marker) {
var i;
var mCount;
var mz;
if (this.isMarkerAlreadyAdded_(marker)) {
return false;
}
if (!this.center_) {
this.center_ = marker.getPosition();
this.calculateBounds_();
} else {
if (this.averageCenter_) {
var l = this.markers_.length + 1;
var lat = (this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l;
var lng = (this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l;
this.center_ = new google.maps.LatLng(lat, lng);
this.calculateBounds_();
}
}
marker.isAdded = true;
this.markers_.push(marker);
mCount = this.markers_.length;
mz = this.markerClusterer_.getMaxZoom();
if (mz !== null && this.map_.getZoom() > mz) {
// Zoomed in past max zoom, so show the marker.
if (marker.getMap() !== this.map_) {
marker.setMap(this.map_);
}
} else if (mCount < this.minClusterSize_) {
// Min cluster size not reached so show the marker.
if (marker.getMap() !== this.map_) {
marker.setMap(this.map_);
}
} else if (mCount === this.minClusterSize_) {
// Hide the markers that were showing.
for (i = 0; i < mCount; i++) {
this.markers_[i].setMap(null);
}
} else {
marker.setMap(null);
}
this.updateIcon_();
return true;
};
/**
* Determines if a marker lies within the cluster's bounds.
*
* @param {google.maps.Marker} marker The marker to check.
* @return {boolean} True if the marker lies in the bounds.
* @ignore
*/
Cluster.prototype.isMarkerInClusterBounds = function (marker) {
return this.bounds_.contains(marker.getPosition());
};
/**
* Calculates the extended bounds of the cluster with the grid.
*/
Cluster.prototype.calculateBounds_ = function () {
var bounds = new google.maps.LatLngBounds(this.center_, this.center_);
this.bounds_ = this.markerClusterer_.getExtendedBounds(bounds);
};
/**
* Updates the cluster icon.
*/
Cluster.prototype.updateIcon_ = function () {
var mCount = this.markers_.length;
var mz = this.markerClusterer_.getMaxZoom();
if (mz !== null && this.map_.getZoom() > mz) {
this.clusterIcon_.hide();
return;
}
if (mCount < this.minClusterSize_) {
// Min cluster size not yet reached.
this.clusterIcon_.hide();
return;
}
var numStyles = this.markerClusterer_.getStyles().length;
var sums = this.markerClusterer_.getCalculator()(this.markers_, numStyles);
this.clusterIcon_.setCenter(this.center_);
this.clusterIcon_.useStyle(sums);
this.clusterIcon_.show();
};
/**
* Determines if a marker has already been added to the cluster.
*
* @param {google.maps.Marker} marker The marker to check.
* @return {boolean} True if the marker has already been added.
*/
Cluster.prototype.isMarkerAlreadyAdded_ = function (marker) {
var i;
if (this.markers_.indexOf) {
return this.markers_.indexOf(marker) !== -1;
} else {
for (i = 0; i < this.markers_.length; i++) {
if (marker === this.markers_[i]) {
return true;
}
}
}
return false;
};
/**
* @name MarkerClustererOptions
* @class This class represents the optional parameter passed to
* the {@link MarkerClusterer} constructor.
* @property {number} [gridSize=60] The grid size of a cluster in pixels. The grid is a square.
* @property {number} [maxZoom=null] The maximum zoom level at which clustering is enabled or
* <code>null</code> if clustering is to be enabled at all zoom levels.
* @property {boolean} [zoomOnClick=true] Whether to zoom the map when a cluster marker is
* clicked. You may want to set this to <code>false</code> if you have installed a handler
* for the <code>click</code> event and it deals with zooming on its own.
* @property {boolean} [averageCenter=false] Whether the position of a cluster marker should be
* the average position of all markers in the cluster. If set to <code>false</code>, the
* cluster marker is positioned at the location of the first marker added to the cluster.
* @property {number} [minimumClusterSize=2] The minimum number of markers needed in a cluster
* before the markers are hidden and a cluster marker appears.
* @property {boolean} [ignoreHidden=false] Whether to ignore hidden markers in clusters. You
* may want to set this to <code>true</code> to ensure that hidden markers are not included
* in the marker count that appears on a cluster marker (this count is the value of the
* <code>text</code> property of the result returned by the default <code>calculator</code>).
* If set to <code>true</code> and you change the visibility of a marker being clustered, be
* sure to also call <code>MarkerClusterer.repaint()</code>.
* @property {string} [title=""] The tooltip to display when the mouse moves over a cluster
* marker. (Alternatively, you can use a custom <code>calculator</code> function to specify a
* different tooltip for each cluster marker.)
* @property {function} [calculator=MarkerClusterer.CALCULATOR] The function used to determine
* the text to be displayed on a cluster marker and the index indicating which style to use
* for the cluster marker. The input parameters for the function are (1) the array of markers
* represented by a cluster marker and (2) the number of cluster icon styles. It returns a
* {@link ClusterIconInfo} object. The default <code>calculator</code> returns a
* <code>text</code> property which is the number of markers in the cluster and an
* <code>index</code> property which is one higher than the lowest integer such that
* <code>10^i</code> exceeds the number of markers in the cluster, or the size of the styles
* array, whichever is less. The <code>styles</code> array element used has an index of
* <code>index</code> minus 1. For example, the default <code>calculator</code> returns a
* <code>text</code> value of <code>"125"</code> and an <code>index</code> of <code>3</code>
* for a cluster icon representing 125 markers so the element used in the <code>styles</code>
* array is <code>2</code>. A <code>calculator</code> may also return a <code>title</code>
* property that contains the text of the tooltip to be used for the cluster marker. If
* <code>title</code> is not defined, the tooltip is set to the value of the <code>title</code>
* property for the MarkerClusterer.
* @property {string} [clusterClass="cluster"] The name of the CSS class defining general styles
* for the cluster markers. Use this class to define CSS styles that are not set up by the code
* that processes the <code>styles</code> array.
* @property {Array} [styles] An array of {@link ClusterIconStyle} elements defining the styles
* of the cluster markers to be used. The element to be used to style a given cluster marker
* is determined by the function defined by the <code>calculator</code> property.
* The default is an array of {@link ClusterIconStyle} elements whose properties are derived
* from the values for <code>imagePath</code>, <code>imageExtension</code>, and
* <code>imageSizes</code>.
* @property {boolean} [enableRetinaIcons=false] Whether to allow the use of cluster icons that
* have sizes that are some multiple (typically double) of their actual display size. Icons such
* as these look better when viewed on high-resolution monitors such as Apple's Retina displays.
* Note: if this property is <code>true</code>, sprites cannot be used as cluster icons.
* @property {number} [batchSize=MarkerClusterer.BATCH_SIZE] Set this property to the
* number of markers to be processed in a single batch when using a browser other than
* Internet Explorer (for Internet Explorer, use the batchSizeIE property instead).
* @property {number} [batchSizeIE=MarkerClusterer.BATCH_SIZE_IE] When Internet Explorer is
* being used, markers are processed in several batches with a small delay inserted between
* each batch in an attempt to avoid Javascript timeout errors. Set this property to the
* number of markers to be processed in a single batch; select as high a number as you can
* without causing a timeout error in the browser. This number might need to be as low as 100
* if 15,000 markers are being managed, for example.
* @property {string} [imagePath=MarkerClusterer.IMAGE_PATH]
* The full URL of the root name of the group of image files to use for cluster icons.
* The complete file name is of the form <code>imagePath</code>n.<code>imageExtension</code>
* where n is the image file number (1, 2, etc.).
* @property {string} [imageExtension=MarkerClusterer.IMAGE_EXTENSION]
* The extension name for the cluster icon image files (e.g., <code>"png"</code> or
* <code>"jpg"</code>).
* @property {Array} [imageSizes=MarkerClusterer.IMAGE_SIZES]
* An array of numbers containing the widths of the group of
* <code>imagePath</code>n.<code>imageExtension</code> image files.
* (The images are assumed to be square.)
*/
/**
* Creates a MarkerClusterer object with the options specified in {@link MarkerClustererOptions}.
* @constructor
* @extends google.maps.OverlayView
* @param {google.maps.Map} map The Google map to attach to.
* @param {Array.<google.maps.Marker>} [opt_markers] The markers to be added to the cluster.
* @param {MarkerClustererOptions} [opt_options] The optional parameters.
*/
function MarkerClusterer(map, opt_markers, opt_options) {
// MarkerClusterer implements google.maps.OverlayView interface. We use the
// extend function to extend MarkerClusterer with google.maps.OverlayView
// because it might not always be available when the code is defined so we
// look for it at the last possible moment. If it doesn't exist now then
// there is no point going ahead :)
this.extend(MarkerClusterer, google.maps.OverlayView);
opt_markers = opt_markers || [];
opt_options = opt_options || {};
this.markers_ = [];
this.clusters_ = [];
this.listeners_ = [];
this.activeMap_ = null;
this.ready_ = false;
this.gridSize_ = opt_options.gridSize || 60;
this.minClusterSize_ = opt_options.minimumClusterSize || 2;
this.maxZoom_ = opt_options.maxZoom || null;
this.styles_ = opt_options.styles || [];
this.title_ = opt_options.title || "";
this.zoomOnClick_ = true;
if (opt_options.zoomOnClick !== undefined) {
this.zoomOnClick_ = opt_options.zoomOnClick;
}
this.averageCenter_ = false;
if (opt_options.averageCenter !== undefined) {
this.averageCenter_ = opt_options.averageCenter;
}
this.ignoreHidden_ = false;
if (opt_options.ignoreHidden !== undefined) {
this.ignoreHidden_ = opt_options.ignoreHidden;
}
this.enableRetinaIcons_ = false;
if (opt_options.enableRetinaIcons !== undefined) {
this.enableRetinaIcons_ = opt_options.enableRetinaIcons;
}
this.imagePath_ = opt_options.imagePath || MarkerClusterer.IMAGE_PATH;
this.imageExtension_ = opt_options.imageExtension || MarkerClusterer.IMAGE_EXTENSION;
this.imageSizes_ = opt_options.imageSizes || MarkerClusterer.IMAGE_SIZES;
this.calculator_ = opt_options.calculator || MarkerClusterer.CALCULATOR;
this.batchSize_ = opt_options.batchSize || MarkerClusterer.BATCH_SIZE;
this.batchSizeIE_ = opt_options.batchSizeIE || MarkerClusterer.BATCH_SIZE_IE;
this.clusterClass_ = opt_options.clusterClass || "cluster";
if (navigator.userAgent.toLowerCase().indexOf("msie") !== -1) {
// Try to avoid IE timeout when processing a huge number of markers:
this.batchSize_ = this.batchSizeIE_;
}
this.setupStyles_();
this.addMarkers(opt_markers, true);
this.setMap(map); // Note: this causes onAdd to be called
}
/**
* Implementation of the onAdd interface method.
* @ignore
*/
MarkerClusterer.prototype.onAdd = function () {
var cMarkerClusterer = this;
this.activeMap_ = this.getMap();
this.ready_ = true;
this.repaint();
// Add the map event listeners
this.listeners_ = [
google.maps.event.addListener(this.getMap(), "zoom_changed", function () {
cMarkerClusterer.resetViewport_(false);
// Workaround for this Google bug: when map is at level 0 and "-" of
// zoom slider is clicked, a "zoom_changed" event is fired even though
// the map doesn't zoom out any further. In this situation, no "idle"
// event is triggered so the cluster markers that have been removed
// do not get redrawn. Same goes for a zoom in at maxZoom.
if (this.getZoom() === (this.get("minZoom") || 0) || this.getZoom() === this.get("maxZoom")) {
google.maps.event.trigger(this, "idle");
}
}),
google.maps.event.addListener(this.getMap(), "idle", function () {
cMarkerClusterer.redraw_();
})
];
};
/**
* Implementation of the onRemove interface method.
* Removes map event listeners and all cluster icons from the DOM.
* All managed markers are also put back on the map.
* @ignore
*/
MarkerClusterer.prototype.onRemove = function () {
var i;
// Put all the managed markers back on the map:
for (i = 0; i < this.markers_.length; i++) {
if (this.markers_[i].getMap() !== this.activeMap_) {
this.markers_[i].setMap(this.activeMap_);
}
}
// Remove all clusters:
for (i = 0; i < this.clusters_.length; i++) {
this.clusters_[i].remove();
}
this.clusters_ = [];
// Remove map event listeners:
for (i = 0; i < this.listeners_.length; i++) {
google.maps.event.removeListener(this.listeners_[i]);
}
this.listeners_ = [];
this.activeMap_ = null;
this.ready_ = false;
};
/**
* Implementation of the draw interface method.
* @ignore
*/
MarkerClusterer.prototype.draw = function () {};
/**
* Sets up the styles object.
*/
MarkerClusterer.prototype.setupStyles_ = function () {
var i, size;
if (this.styles_.length > 0) {
return;
}
for (i = 0; i < this.imageSizes_.length; i++) {
size = this.imageSizes_[i];
this.styles_.push({
url: this.imagePath_ + (i + 1) + "." + this.imageExtension_,
height: size,
width: size
});
}
};
/**
* Fits the map to the bounds of the markers managed by the clusterer.
*/
MarkerClusterer.prototype.fitMapToMarkers = function () {
var i;
var markers = this.getMarkers();
var bounds = new google.maps.LatLngBounds();
for (i = 0; i < markers.length; i++) {
bounds.extend(markers[i].getPosition());
}
this.getMap().fitBounds(bounds);
};
/**
* Returns the value of the <code>gridSize</code> property.
*
* @return {number} The grid size.
*/
MarkerClusterer.prototype.getGridSize = function () {
return this.gridSize_;
};
/**
* Sets the value of the <code>gridSize</code> property.
*
* @param {number} gridSize The grid size.
*/
MarkerClusterer.prototype.setGridSize = function (gridSize) {
this.gridSize_ = gridSize;
};
/**
* Returns the value of the <code>minimumClusterSize</code> property.
*
* @return {number} The minimum cluster size.
*/
MarkerClusterer.prototype.getMinimumClusterSize = function () {
return this.minClusterSize_;
};
/**
* Sets the value of the <code>minimumClusterSize</code> property.
*
* @param {number} minimumClusterSize The minimum cluster size.
*/
MarkerClusterer.prototype.setMinimumClusterSize = function (minimumClusterSize) {
this.minClusterSize_ = minimumClusterSize;
};
/**
* Returns the value of the <code>maxZoom</code> property.
*
* @return {number} The maximum zoom level.
*/
MarkerClusterer.prototype.getMaxZoom = function () {
return this.maxZoom_;
};
/**
* Sets the value of the <code>maxZoom</code> property.
*
* @param {number} maxZoom The maximum zoom level.
*/
MarkerClusterer.prototype.setMaxZoom = function (maxZoom) {
this.maxZoom_ = maxZoom;
};
/**
* Returns the value of the <code>styles</code> property.
*
* @return {Array} The array of styles defining the cluster markers to be used.
*/
MarkerClusterer.prototype.getStyles = function () {
return this.styles_;
};
/**
* Sets the value of the <code>styles</code> property.
*
* @param {Array.<ClusterIconStyle>} styles The array of styles to use.
*/
MarkerClusterer.prototype.setStyles = function (styles) {
this.styles_ = styles;
};
/**
* Returns the value of the <code>title</code> property.
*
* @return {string} The content of the title text.
*/
MarkerClusterer.prototype.getTitle = function () {
return this.title_;
};
/**
* Sets the value of the <code>title</code> property.
*
* @param {string} title The value of the title property.
*/
MarkerClusterer.prototype.setTitle = function (title) {
this.title_ = title;
};
/**
* Returns the value of the <code>zoomOnClick</code> property.
*
* @return {boolean} True if zoomOnClick property is set.
*/
MarkerClusterer.prototype.getZoomOnClick = function () {
return this.zoomOnClick_;
};
/**
* Sets the value of the <code>zoomOnClick</code> property.
*
* @param {boolean} zoomOnClick The value of the zoomOnClick property.
*/
MarkerClusterer.prototype.setZoomOnClick = function (zoomOnClick) {
this.zoomOnClick_ = zoomOnClick;
};
/**
* Returns the value of the <code>averageCenter</code> property.
*
* @return {boolean} True if averageCenter property is set.
*/
MarkerClusterer.prototype.getAverageCenter = function () {
return this.averageCenter_;
};
/**
* Sets the value of the <code>averageCenter</code> property.
*
* @param {boolean} averageCenter The value of the averageCenter property.
*/
MarkerClusterer.prototype.setAverageCenter = function (averageCenter) {
this.averageCenter_ = averageCenter;
};
/**
* Returns the value of the <code>ignoreHidden</code> property.
*
* @return {boolean} True if ignoreHidden property is set.
*/
MarkerClusterer.prototype.getIgnoreHidden = function () {
return this.ignoreHidden_;
};
/**
* Sets the value of the <code>ignoreHidden</code> property.
*
* @param {boolean} ignoreHidden The value of the ignoreHidden property.
*/
MarkerClusterer.prototype.setIgnoreHidden = function (ignoreHidden) {
this.ignoreHidden_ = ignoreHidden;
};
/**
* Returns the value of the <code>enableRetinaIcons</code> property.
*
* @return {boolean} True if enableRetinaIcons property is set.
*/
MarkerClusterer.prototype.getEnableRetinaIcons = function () {
return this.enableRetinaIcons_;
};
/**
* Sets the value of the <code>enableRetinaIcons</code> property.
*
* @param {boolean} enableRetinaIcons The value of the enableRetinaIcons property.
*/
MarkerClusterer.prototype.setEnableRetinaIcons = function (enableRetinaIcons) {
this.enableRetinaIcons_ = enableRetinaIcons;
};
/**
* Returns the value of the <code>imageExtension</code> property.
*
* @return {string} The value of the imageExtension property.
*/
MarkerClusterer.prototype.getImageExtension = function () {
return this.imageExtension_;
};
/**
* Sets the value of the <code>imageExtension</code> property.
*
* @param {string} imageExtension The value of the imageExtension property.
*/
MarkerClusterer.prototype.setImageExtension = function (imageExtension) {
this.imageExtension_ = imageExtension;
};
/**
* Returns the value of the <code>imagePath</code> property.
*
* @return {string} The value of the imagePath property.
*/
MarkerClusterer.prototype.getImagePath = function () {
return this.imagePath_;
};
/**
* Sets the value of the <code>imagePath</code> property.
*
* @param {string} imagePath The value of the imagePath property.
*/
MarkerClusterer.prototype.setImagePath = function (imagePath) {
this.imagePath_ = imagePath;
};
/**
* Returns the value of the <code>imageSizes</code> property.
*
* @return {Array} The value of the imageSizes property.
*/
MarkerClusterer.prototype.getImageSizes = function () {
return this.imageSizes_;
};
/**
* Sets the value of the <code>imageSizes</code> property.
*
* @param {Array} imageSizes The value of the imageSizes property.
*/
MarkerClusterer.prototype.setImageSizes = function (imageSizes) {
this.imageSizes_ = imageSizes;
};
/**
* Returns the value of the <code>calculator</code> property.
*
* @return {function} the value of the calculator property.
*/
MarkerClusterer.prototype.getCalculator = function () {
return this.calculator_;
};
/**
* Sets the value of the <code>calculator</code> property.
*
* @param {function(Array.<google.maps.Marker>, number)} calculator The value
* of the calculator property.
*/
MarkerClusterer.prototype.setCalculator = function (calculator) {
this.calculator_ = calculator;
};
/**
* Returns the value of the <code>batchSizeIE</code> property.
*
* @return {number} the value of the batchSizeIE property.
*/
MarkerClusterer.prototype.getBatchSizeIE = function () {
return this.batchSizeIE_;
};
/**
* Sets the value of the <code>batchSizeIE</code> property.
*
* @param {number} batchSizeIE The value of the batchSizeIE property.
*/
MarkerClusterer.prototype.setBatchSizeIE = function (batchSizeIE) {
this.batchSizeIE_ = batchSizeIE;
};
/**
* Returns the value of the <code>clusterClass</code> property.
*
* @return {string} the value of the clusterClass property.
*/
MarkerClusterer.prototype.getClusterClass = function () {
return this.clusterClass_;
};
/**
* Sets the value of the <code>clusterClass</code> property.
*
* @param {string} clusterClass The value of the clusterClass property.
*/
MarkerClusterer.prototype.setClusterClass = function (clusterClass) {
this.clusterClass_ = clusterClass;
};
/**
* Returns the array of markers managed by the clusterer.
*
* @return {Array} The array of markers managed by the clusterer.
*/
MarkerClusterer.prototype.getMarkers = function () {
return this.markers_;
};
/**
* Returns the number of markers managed by the clusterer.
*
* @return {number} The number of markers.
*/
MarkerClusterer.prototype.getTotalMarkers = function () {
return this.markers_.length;
};
/**
* Returns the current array of clusters formed by the clusterer.
*
* @return {Array} The array of clusters formed by the clusterer.
*/
MarkerClusterer.prototype.getClusters = function () {
return this.clusters_;
};
/**
* Returns the number of clusters formed by the clusterer.
*
* @return {number} The number of clusters formed by the clusterer.
*/
MarkerClusterer.prototype.getTotalClusters = function () {
return this.clusters_.length;
};
/**
* Adds a marker to the clusterer. The clusters are redrawn unless
* <code>opt_nodraw</code> is set to <code>true</code>.
*
* @param {google.maps.Marker} marker The marker to add.
* @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.
*/
MarkerClusterer.prototype.addMarker = function (marker, opt_nodraw) {
this.pushMarkerTo_(marker);
if (!opt_nodraw) {
this.redraw_();
}
};
/**
* Adds an array of markers to the clusterer. The clusters are redrawn unless
* <code>opt_nodraw</code> is set to <code>true</code>.
*
* @param {Array.<google.maps.Marker>} markers The markers to add.
* @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.
*/
MarkerClusterer.prototype.addMarkers = function (markers, opt_nodraw) {
var key;
for (key in markers) {
if (markers.hasOwnProperty(key)) {
this.pushMarkerTo_(markers[key]);
}
}
if (!opt_nodraw) {
this.redraw_();
}
};
/**
* Pushes a marker to the clusterer.
*
* @param {google.maps.Marker} marker The marker to add.
*/
MarkerClusterer.prototype.pushMarkerTo_ = function (marker) {
// If the marker is draggable add a listener so we can update the clusters on the dragend:
if (marker.getDraggable()) {
var cMarkerClusterer = this;
google.maps.event.addListener(marker, "dragend", function () {
if (cMarkerClusterer.ready_) {
this.isAdded = false;
cMarkerClusterer.repaint();
}
});
}
marker.isAdded = false;
this.markers_.push(marker);
};
/**
* Removes a marker from the cluster. The clusters are redrawn unless
* <code>opt_nodraw</code> is set to <code>true</code>. Returns <code>true</code> if the
* marker was removed from the clusterer.
*
* @param {google.maps.Marker} marker The marker to remove.
* @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.
* @return {boolean} True if the marker was removed from the clusterer.
*/
MarkerClusterer.prototype.removeMarker = function (marker, opt_nodraw) {
var removed = this.removeMarker_(marker);
if (!opt_nodraw && removed) {
this.repaint();
}
return removed;
};
/**
* Removes an array of markers from the cluster. The clusters are redrawn unless
* <code>opt_nodraw</code> is set to <code>true</code>. Returns <code>true</code> if markers
* were removed from the clusterer.
*
* @param {Array.<google.maps.Marker>} markers The markers to remove.
* @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.
* @return {boolean} True if markers were removed from the clusterer.
*/
MarkerClusterer.prototype.removeMarkers = function (markers, opt_nodraw) {
var i, r;
var removed = false;
for (i = 0; i < markers.length; i++) {
r = this.removeMarker_(markers[i]);
removed = removed || r;
}
if (!opt_nodraw && removed) {
this.repaint();
}
return removed;
};
/**
* Removes a marker and returns true if removed, false if not.
*
* @param {google.maps.Marker} marker The marker to remove
* @return {boolean} Whether the marker was removed or not
*/
MarkerClusterer.prototype.removeMarker_ = function (marker) {
var i;
var index = -1;
if (this.markers_.indexOf) {
index = this.markers_.indexOf(marker);
} else {
for (i = 0; i < this.markers_.length; i++) {
if (marker === this.markers_[i]) {
index = i;
break;
}
}
}
if (index === -1) {
// Marker is not in our list of markers, so do nothing:
return false;
}
marker.setMap(null);
this.markers_.splice(index, 1); // Remove the marker from the list of managed markers
return true;
};
/**
* Removes all clusters and markers from the map and also removes all markers
* managed by the clusterer.
*/
MarkerClusterer.prototype.clearMarkers = function () {
this.resetViewport_(true);
this.markers_ = [];
};
/**
* Recalculates and redraws all the marker clusters from scratch.
* Call this after changing any properties.
*/
MarkerClusterer.prototype.repaint = function () {
var oldClusters = this.clusters_.slice();
this.clusters_ = [];
this.resetViewport_(false);
this.redraw_();
// Remove the old clusters.
// Do it in a timeout to prevent blinking effect.
setTimeout(function () {
var i;
for (i = 0; i < oldClusters.length; i++) {
oldClusters[i].remove();
}
}, 0);
};
/**
* Returns the current bounds extended by the grid size.
*
* @param {google.maps.LatLngBounds} bounds The bounds to extend.
* @return {google.maps.LatLngBounds} The extended bounds.
* @ignore
*/
MarkerClusterer.prototype.getExtendedBounds = function (bounds) {
var projection = this.getProjection();
// Turn the bounds into latlng.
var tr = new google.maps.LatLng(bounds.getNorthEast().lat(),
bounds.getNorthEast().lng());
var bl = new google.maps.LatLng(bounds.getSouthWest().lat(),
bounds.getSouthWest().lng());
// Convert the points to pixels and the extend out by the grid size.
var trPix = projection.fromLatLngToDivPixel(tr);
trPix.x += this.gridSize_;
trPix.y -= this.gridSize_;
var blPix = projection.fromLatLngToDivPixel(bl);
blPix.x -= this.gridSize_;
blPix.y += this.gridSize_;
// Convert the pixel points back to LatLng
var ne = projection.fromDivPixelToLatLng(trPix);
var sw = projection.fromDivPixelToLatLng(blPix);
// Extend the bounds to contain the new bounds.
bounds.extend(ne);
bounds.extend(sw);
return bounds;
};
/**
* Redraws all the clusters.
*/
MarkerClusterer.prototype.redraw_ = function () {
this.createClusters_(0);
};
/**
* Removes all clusters from the map. The markers are also removed from the map
* if <code>opt_hide</code> is set to <code>true</code>.
*
* @param {boolean} [opt_hide] Set to <code>true</code> to also remove the markers
* from the map.
*/
MarkerClusterer.prototype.resetViewport_ = function (opt_hide) {
var i, marker;
// Remove all the clusters
for (i = 0; i < this.clusters_.length; i++) {
this.clusters_[i].remove();
}
this.clusters_ = [];
// Reset the markers to not be added and to be removed from the map.
for (i = 0; i < this.markers_.length; i++) {
marker = this.markers_[i];
marker.isAdded = false;
if (opt_hide) {
marker.setMap(null);
}
}
};
/**
* Calculates the distance between two latlng locations in km.
*
* @param {google.maps.LatLng} p1 The first lat lng point.
* @param {google.maps.LatLng} p2 The second lat lng point.
* @return {number} The distance between the two points in km.
* @see http://www.movable-type.co.uk/scripts/latlong.html
*/
MarkerClusterer.prototype.distanceBetweenPoints_ = function (p1, p2) {
var R = 6371; // Radius of the Earth in km
var dLat = (p2.lat() - p1.lat()) * Math.PI / 180;
var dLon = (p2.lng() - p1.lng()) * Math.PI / 180;
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(p1.lat() * Math.PI / 180) * Math.cos(p2.lat() * Math.PI / 180) *
Math.sin(dLon / 2) * Math.sin(dLon / 2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
var d = R * c;
return d;
};
/**
* Determines if a marker is contained in a bounds.
*
* @param {google.maps.Marker} marker The marker to check.
* @param {google.maps.LatLngBounds} bounds The bounds to check against.
* @return {boolean} True if the marker is in the bounds.
*/
MarkerClusterer.prototype.isMarkerInBounds_ = function (marker, bounds) {
return bounds.contains(marker.getPosition());
};
/**
* Adds a marker to a cluster, or creates a new cluster.
*
* @param {google.maps.Marker} marker The marker to add.
*/
MarkerClusterer.prototype.addToClosestCluster_ = function (marker) {
var i, d, cluster, center;
var distance = 40000; // Some large number
var clusterToAddTo = null;
for (i = 0; i < this.clusters_.length; i++) {
cluster = this.clusters_[i];
center = cluster.getCenter();
if (center) {
d = this.distanceBetweenPoints_(center, marker.getPosition());
if (d < distance) {
distance = d;
clusterToAddTo = cluster;
}
}
}
if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {
clusterToAddTo.addMarker(marker);
} else {
cluster = new Cluster(this);
cluster.addMarker(marker);
this.clusters_.push(cluster);
}
};
/**
* Creates the clusters. This is done in batches to avoid timeout errors
* in some browsers when there is a huge number of markers.
*
* @param {number} iFirst The index of the first marker in the batch of
* markers to be added to clusters.
*/
MarkerClusterer.prototype.createClusters_ = function (iFirst) {
var i, marker;
var mapBounds;
var cMarkerClusterer = this;
if (!this.ready_) {
return;
}
// Cancel previous batch processing if we're working on the first batch:
if (iFirst === 0) {
/**
* This event is fired when the <code>MarkerClusterer</code> begins
* clustering markers.
* @name MarkerClusterer#clusteringbegin
* @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.
* @event
*/
google.maps.event.trigger(this, "clusteringbegin", this);
if (typeof this.timerRefStatic !== "undefined") {
clearTimeout(this.timerRefStatic);
delete this.timerRefStatic;
}
}
// Get our current map view bounds.
// Create a new bounds object so we don't affect the map.
//
// See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:
if (this.getMap().getZoom() > 3) {
mapBounds = new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),
this.getMap().getBounds().getNorthEast());
} else {
mapBounds = new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));
}
var bounds = this.getExtendedBounds(mapBounds);
var iLast = Math.min(iFirst + this.batchSize_, this.markers_.length);
for (i = iFirst; i < iLast; i++) {
marker = this.markers_[i];
if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {
if (!this.ignoreHidden_ || (this.ignoreHidden_ && marker.getVisible())) {
this.addToClosestCluster_(marker);
}
}
}
if (iLast < this.markers_.length) {
this.timerRefStatic = setTimeout(function () {
cMarkerClusterer.createClusters_(iLast);
}, 0);
} else {
delete this.timerRefStatic;
/**
* This event is fired when the <code>MarkerClusterer</code> stops
* clustering markers.
* @name MarkerClusterer#clusteringend
* @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.
* @event
*/
google.maps.event.trigger(this, "clusteringend", this);
}
};
/**
* Extends an object's prototype by another's.
*
* @param {Object} obj1 The object to be extended.
* @param {Object} obj2 The object to extend with.
* @return {Object} The new extended object.
* @ignore
*/
MarkerClusterer.prototype.extend = function (obj1, obj2) {
return (function (object) {
var property;
for (property in object.prototype) {
this.prototype[property] = object.prototype[property];
}
return this;
}).apply(obj1, [obj2]);
};
/**
* The default function for determining the label text and style
* for a cluster icon.
*
* @param {Array.<google.maps.Marker>} markers The array of markers represented by the cluster.
* @param {number} numStyles The number of marker styles available.
* @return {ClusterIconInfo} The information resource for the cluster.
* @constant
* @ignore
*/
MarkerClusterer.CALCULATOR = function (markers, numStyles) {
var index = 0;
var title = "";
var count = markers.length.toString();
var dv = count;
while (dv !== 0) {
dv = parseInt(dv / 10, 10);
index++;
}
index = Math.min(index, numStyles);
return {
text: count,
index: index,
title: title
};
};
/**
* The number of markers to process in one batch.
*
* @type {number}
* @constant
*/
MarkerClusterer.BATCH_SIZE = 2000;
/**
* The number of markers to process in one batch (IE only).
*
* @type {number}
* @constant
*/
MarkerClusterer.BATCH_SIZE_IE = 500;
/**
* The default root name for the marker cluster images.
*
* @type {string}
* @constant
*/
MarkerClusterer.IMAGE_PATH = "http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/images/m";
/**
* The default extension name for the marker cluster images.
*
* @type {string}
* @constant
*/
MarkerClusterer.IMAGE_EXTENSION = "png";
/**
* The default array of sizes for the marker cluster images.
*
* @type {Array.<number>}
* @constant
*/
MarkerClusterer.IMAGE_SIZES = [53, 56, 66, 78, 90];
if (typeof String.prototype.trim !== 'function') {
/**
* IE hack since trim() doesn't exist in all browsers
* @return {string} The string with removed whitespace
*/
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
}
}
;/**
* 1.1.9-patched
* @name MarkerWithLabel for V3
* @version 1.1.8 [February 26, 2013]
* @author Gary Little (inspired by code from Marc Ridey of Google).
* @copyright Copyright 2012 Gary Little [gary at luxcentral.com]
* @fileoverview MarkerWithLabel extends the Google Maps JavaScript API V3
* <code>google.maps.Marker</code> class.
* <p>
* MarkerWithLabel allows you to define markers with associated labels. As you would expect,
* if the marker is draggable, so too will be the label. In addition, a marker with a label
* responds to all mouse events in the same manner as a regular marker. It also fires mouse
* events and "property changed" events just as a regular marker would. Version 1.1 adds
* support for the raiseOnDrag feature introduced in API V3.3.
* <p>
* If you drag a marker by its label, you can cancel the drag and return the marker to its
* original position by pressing the <code>Esc</code> key. This doesn't work if you drag the marker
* itself because this feature is not (yet) supported in the <code>google.maps.Marker</code> class.
*/
/*!
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*jslint browser:true */
/*global document,google */
/**
* @param {Function} childCtor Child class.
* @param {Function} parentCtor Parent class.
*/
function inherits(childCtor, parentCtor) {
/** @constructor */
function tempCtor() {}
tempCtor.prototype = parentCtor.prototype;
childCtor.superClass_ = parentCtor.prototype;
childCtor.prototype = new tempCtor();
/** @override */
childCtor.prototype.constructor = childCtor;
}
/**
* This constructor creates a label and associates it with a marker.
* It is for the private use of the MarkerWithLabel class.
* @constructor
* @param {Marker} marker The marker with which the label is to be associated.
* @param {string} crossURL The URL of the cross image =.
* @param {string} handCursor The URL of the hand cursor.
* @private
*/
function MarkerLabel_(marker, crossURL, handCursorURL) {
this.marker_ = marker;
this.handCursorURL_ = marker.handCursorURL;
this.labelDiv_ = document.createElement("div");
this.labelDiv_.style.cssText = "position: absolute; overflow: hidden;";
// Set up the DIV for handling mouse events in the label. This DIV forms a transparent veil
// in the "overlayMouseTarget" pane, a veil that covers just the label. This is done so that
// events can be captured even if the label is in the shadow of a google.maps.InfoWindow.
// Code is included here to ensure the veil is always exactly the same size as the label.
this.eventDiv_ = document.createElement("div");
this.eventDiv_.style.cssText = this.labelDiv_.style.cssText;
// This is needed for proper behavior on MSIE:
this.eventDiv_.setAttribute("onselectstart", "return false;");
this.eventDiv_.setAttribute("ondragstart", "return false;");
// Get the DIV for the "X" to be displayed when the marker is raised.
this.crossDiv_ = MarkerLabel_.getSharedCross(crossURL);
}
inherits(MarkerLabel_, google.maps.OverlayView);
/**
* Returns the DIV for the cross used when dragging a marker when the
* raiseOnDrag parameter set to true. One cross is shared with all markers.
* @param {string} crossURL The URL of the cross image =.
* @private
*/
MarkerLabel_.getSharedCross = function (crossURL) {
var div;
if (typeof MarkerLabel_.getSharedCross.crossDiv === "undefined") {
div = document.createElement("img");
div.style.cssText = "position: absolute; z-index: 1000002; display: none;";
// Hopefully Google never changes the standard "X" attributes:
div.style.marginLeft = "-8px";
div.style.marginTop = "-9px";
div.src = crossURL;
MarkerLabel_.getSharedCross.crossDiv = div;
}
return MarkerLabel_.getSharedCross.crossDiv;
};
/**
* Adds the DIV representing the label to the DOM. This method is called
* automatically when the marker's <code>setMap</code> method is called.
* @private
*/
MarkerLabel_.prototype.onAdd = function () {
var me = this;
var cMouseIsDown = false;
var cDraggingLabel = false;
var cSavedZIndex;
var cLatOffset, cLngOffset;
var cIgnoreClick;
var cRaiseEnabled;
var cStartPosition;
var cStartCenter;
// Constants:
var cRaiseOffset = 20;
var cDraggingCursor = "url(" + this.handCursorURL_ + ")";
// Stops all processing of an event.
//
var cAbortEvent = function (e) {
if (e.preventDefault) {
e.preventDefault();
}
e.cancelBubble = true;
if (e.stopPropagation) {
e.stopPropagation();
}
};
var cStopBounce = function () {
me.marker_.setAnimation(null);
};
this.getPanes().overlayImage.appendChild(this.labelDiv_);
this.getPanes().overlayMouseTarget.appendChild(this.eventDiv_);
// One cross is shared with all markers, so only add it once:
if (typeof MarkerLabel_.getSharedCross.processed === "undefined") {
this.getPanes().overlayImage.appendChild(this.crossDiv_);
MarkerLabel_.getSharedCross.processed = true;
}
this.listeners_ = [
google.maps.event.addDomListener(this.eventDiv_, "mouseover", function (e) {
if (me.marker_.getDraggable() || me.marker_.getClickable()) {
this.style.cursor = "pointer";
google.maps.event.trigger(me.marker_, "mouseover", e);
}
}),
google.maps.event.addDomListener(this.eventDiv_, "mouseout", function (e) {
if ((me.marker_.getDraggable() || me.marker_.getClickable()) && !cDraggingLabel) {
this.style.cursor = me.marker_.getCursor();
google.maps.event.trigger(me.marker_, "mouseout", e);
}
}),
google.maps.event.addDomListener(this.eventDiv_, "mousedown", function (e) {
cDraggingLabel = false;
if (me.marker_.getDraggable()) {
cMouseIsDown = true;
this.style.cursor = cDraggingCursor;
}
if (me.marker_.getDraggable() || me.marker_.getClickable()) {
google.maps.event.trigger(me.marker_, "mousedown", e);
cAbortEvent(e); // Prevent map pan when starting a drag on a label
}
}),
google.maps.event.addDomListener(document, "mouseup", function (mEvent) {
var position;
if (cMouseIsDown) {
cMouseIsDown = false;
me.eventDiv_.style.cursor = "pointer";
google.maps.event.trigger(me.marker_, "mouseup", mEvent);
}
if (cDraggingLabel) {
if (cRaiseEnabled) { // Lower the marker & label
position = me.getProjection().fromLatLngToDivPixel(me.marker_.getPosition());
position.y += cRaiseOffset;
me.marker_.setPosition(me.getProjection().fromDivPixelToLatLng(position));
// This is not the same bouncing style as when the marker portion is dragged,
// but it will have to do:
try { // Will fail if running Google Maps API earlier than V3.3
me.marker_.setAnimation(google.maps.Animation.BOUNCE);
setTimeout(cStopBounce, 1406);
} catch (e) {}
}
me.crossDiv_.style.display = "none";
me.marker_.setZIndex(cSavedZIndex);
cIgnoreClick = true; // Set flag to ignore the click event reported after a label drag
cDraggingLabel = false;
mEvent.latLng = me.marker_.getPosition();
google.maps.event.trigger(me.marker_, "dragend", mEvent);
}
}),
google.maps.event.addListener(me.marker_.getMap(), "mousemove", function (mEvent) {
var position;
if (cMouseIsDown) {
if (cDraggingLabel) {
// Change the reported location from the mouse position to the marker position:
mEvent.latLng = new google.maps.LatLng(mEvent.latLng.lat() - cLatOffset, mEvent.latLng.lng() - cLngOffset);
position = me.getProjection().fromLatLngToDivPixel(mEvent.latLng);
if (cRaiseEnabled) {
me.crossDiv_.style.left = position.x + "px";
me.crossDiv_.style.top = position.y + "px";
me.crossDiv_.style.display = "";
position.y -= cRaiseOffset;
}
me.marker_.setPosition(me.getProjection().fromDivPixelToLatLng(position));
if (cRaiseEnabled) { // Don't raise the veil; this hack needed to make MSIE act properly
me.eventDiv_.style.top = (position.y + cRaiseOffset) + "px";
}
google.maps.event.trigger(me.marker_, "drag", mEvent);
} else {
// Calculate offsets from the click point to the marker position:
cLatOffset = mEvent.latLng.lat() - me.marker_.getPosition().lat();
cLngOffset = mEvent.latLng.lng() - me.marker_.getPosition().lng();
cSavedZIndex = me.marker_.getZIndex();
cStartPosition = me.marker_.getPosition();
cStartCenter = me.marker_.getMap().getCenter();
cRaiseEnabled = me.marker_.get("raiseOnDrag");
cDraggingLabel = true;
me.marker_.setZIndex(1000000); // Moves the marker & label to the foreground during a drag
mEvent.latLng = me.marker_.getPosition();
google.maps.event.trigger(me.marker_, "dragstart", mEvent);
}
}
}),
google.maps.event.addDomListener(document, "keydown", function (e) {
if (cDraggingLabel) {
if (e.keyCode === 27) { // Esc key
cRaiseEnabled = false;
me.marker_.setPosition(cStartPosition);
me.marker_.getMap().setCenter(cStartCenter);
google.maps.event.trigger(document, "mouseup", e);
}
}
}),
google.maps.event.addDomListener(this.eventDiv_, "click", function (e) {
if (me.marker_.getDraggable() || me.marker_.getClickable()) {
if (cIgnoreClick) { // Ignore the click reported when a label drag ends
cIgnoreClick = false;
} else {
google.maps.event.trigger(me.marker_, "click", e);
cAbortEvent(e); // Prevent click from being passed on to map
}
}
}),
google.maps.event.addDomListener(this.eventDiv_, "dblclick", function (e) {
if (me.marker_.getDraggable() || me.marker_.getClickable()) {
google.maps.event.trigger(me.marker_, "dblclick", e);
cAbortEvent(e); // Prevent map zoom when double-clicking on a label
}
}),
google.maps.event.addListener(this.marker_, "dragstart", function (mEvent) {
if (!cDraggingLabel) {
cRaiseEnabled = this.get("raiseOnDrag");
}
}),
google.maps.event.addListener(this.marker_, "drag", function (mEvent) {
if (!cDraggingLabel) {
if (cRaiseEnabled) {
me.setPosition(cRaiseOffset);
// During a drag, the marker's z-index is temporarily set to 1000000 to
// ensure it appears above all other markers. Also set the label's z-index
// to 1000000 (plus or minus 1 depending on whether the label is supposed
// to be above or below the marker).
me.labelDiv_.style.zIndex = 1000000 + (this.get("labelInBackground") ? -1 : +1);
}
}
}),
google.maps.event.addListener(this.marker_, "dragend", function (mEvent) {
if (!cDraggingLabel) {
if (cRaiseEnabled) {
me.setPosition(0); // Also restores z-index of label
}
}
}),
google.maps.event.addListener(this.marker_, "position_changed", function () {
me.setPosition();
}),
google.maps.event.addListener(this.marker_, "zindex_changed", function () {
me.setZIndex();
}),
google.maps.event.addListener(this.marker_, "visible_changed", function () {
me.setVisible();
}),
google.maps.event.addListener(this.marker_, "labelvisible_changed", function () {
me.setVisible();
}),
google.maps.event.addListener(this.marker_, "title_changed", function () {
me.setTitle();
}),
google.maps.event.addListener(this.marker_, "labelcontent_changed", function () {
me.setContent();
}),
google.maps.event.addListener(this.marker_, "labelanchor_changed", function () {
me.setAnchor();
}),
google.maps.event.addListener(this.marker_, "labelclass_changed", function () {
me.setStyles();
}),
google.maps.event.addListener(this.marker_, "labelstyle_changed", function () {
me.setStyles();
})
];
};
/**
* Removes the DIV for the label from the DOM. It also removes all event handlers.
* This method is called automatically when the marker's <code>setMap(null)</code>
* method is called.
* @private
*/
MarkerLabel_.prototype.onRemove = function () {
var i;
if (this.labelDiv_.parentNode !== null)
this.labelDiv_.parentNode.removeChild(this.labelDiv_);
if (this.eventDiv_.parentNode !== null)
this.eventDiv_.parentNode.removeChild(this.eventDiv_);
// Remove event listeners:
for (i = 0; i < this.listeners_.length; i++) {
google.maps.event.removeListener(this.listeners_[i]);
}
};
/**
* Draws the label on the map.
* @private
*/
MarkerLabel_.prototype.draw = function () {
this.setContent();
this.setTitle();
this.setStyles();
};
/**
* Sets the content of the label.
* The content can be plain text or an HTML DOM node.
* @private
*/
MarkerLabel_.prototype.setContent = function () {
var content = this.marker_.get("labelContent");
if (typeof content.nodeType === "undefined") {
this.labelDiv_.innerHTML = content;
this.eventDiv_.innerHTML = this.labelDiv_.innerHTML;
} else {
this.labelDiv_.innerHTML = ""; // Remove current content
this.labelDiv_.appendChild(content);
content = content.cloneNode(true);
this.eventDiv_.appendChild(content);
}
};
/**
* Sets the content of the tool tip for the label. It is
* always set to be the same as for the marker itself.
* @private
*/
MarkerLabel_.prototype.setTitle = function () {
this.eventDiv_.title = this.marker_.getTitle() || "";
};
/**
* Sets the style of the label by setting the style sheet and applying
* other specific styles requested.
* @private
*/
MarkerLabel_.prototype.setStyles = function () {
var i, labelStyle;
// Apply style values from the style sheet defined in the labelClass parameter:
this.labelDiv_.className = this.marker_.get("labelClass");
this.eventDiv_.className = this.labelDiv_.className;
// Clear existing inline style values:
this.labelDiv_.style.cssText = "";
this.eventDiv_.style.cssText = "";
// Apply style values defined in the labelStyle parameter:
labelStyle = this.marker_.get("labelStyle");
for (i in labelStyle) {
if (labelStyle.hasOwnProperty(i)) {
this.labelDiv_.style[i] = labelStyle[i];
this.eventDiv_.style[i] = labelStyle[i];
}
}
this.setMandatoryStyles();
};
/**
* Sets the mandatory styles to the DIV representing the label as well as to the
* associated event DIV. This includes setting the DIV position, z-index, and visibility.
* @private
*/
MarkerLabel_.prototype.setMandatoryStyles = function () {
this.labelDiv_.style.position = "absolute";
this.labelDiv_.style.overflow = "hidden";
// Make sure the opacity setting causes the desired effect on MSIE:
if (typeof this.labelDiv_.style.opacity !== "undefined" && this.labelDiv_.style.opacity !== "") {
this.labelDiv_.style.MsFilter = "\"progid:DXImageTransform.Microsoft.Alpha(opacity=" + (this.labelDiv_.style.opacity * 100) + ")\"";
this.labelDiv_.style.filter = "alpha(opacity=" + (this.labelDiv_.style.opacity * 100) + ")";
}
this.eventDiv_.style.position = this.labelDiv_.style.position;
this.eventDiv_.style.overflow = this.labelDiv_.style.overflow;
this.eventDiv_.style.opacity = 0.01; // Don't use 0; DIV won't be clickable on MSIE
this.eventDiv_.style.MsFilter = "\"progid:DXImageTransform.Microsoft.Alpha(opacity=1)\"";
this.eventDiv_.style.filter = "alpha(opacity=1)"; // For MSIE
this.setAnchor();
this.setPosition(); // This also updates z-index, if necessary.
this.setVisible();
};
/**
* Sets the anchor point of the label.
* @private
*/
MarkerLabel_.prototype.setAnchor = function () {
var anchor = this.marker_.get("labelAnchor");
this.labelDiv_.style.marginLeft = -anchor.x + "px";
this.labelDiv_.style.marginTop = -anchor.y + "px";
this.eventDiv_.style.marginLeft = -anchor.x + "px";
this.eventDiv_.style.marginTop = -anchor.y + "px";
};
/**
* Sets the position of the label. The z-index is also updated, if necessary.
* @private
*/
MarkerLabel_.prototype.setPosition = function (yOffset) {
var position = this.getProjection().fromLatLngToDivPixel(this.marker_.getPosition());
if (typeof yOffset === "undefined") {
yOffset = 0;
}
this.labelDiv_.style.left = Math.round(position.x) + "px";
this.labelDiv_.style.top = Math.round(position.y - yOffset) + "px";
this.eventDiv_.style.left = this.labelDiv_.style.left;
this.eventDiv_.style.top = this.labelDiv_.style.top;
this.setZIndex();
};
/**
* Sets the z-index of the label. If the marker's z-index property has not been defined, the z-index
* of the label is set to the vertical coordinate of the label. This is in keeping with the default
* stacking order for Google Maps: markers to the south are in front of markers to the north.
* @private
*/
MarkerLabel_.prototype.setZIndex = function () {
var zAdjust = (this.marker_.get("labelInBackground") ? -1 : +1);
if (typeof this.marker_.getZIndex() === "undefined") {
this.labelDiv_.style.zIndex = parseInt(this.labelDiv_.style.top, 10) + zAdjust;
this.eventDiv_.style.zIndex = this.labelDiv_.style.zIndex;
} else {
this.labelDiv_.style.zIndex = this.marker_.getZIndex() + zAdjust;
this.eventDiv_.style.zIndex = this.labelDiv_.style.zIndex;
}
};
/**
* Sets the visibility of the label. The label is visible only if the marker itself is
* visible (i.e., its visible property is true) and the labelVisible property is true.
* @private
*/
MarkerLabel_.prototype.setVisible = function () {
if (this.marker_.get("labelVisible")) {
this.labelDiv_.style.display = this.marker_.getVisible() ? "block" : "none";
} else {
this.labelDiv_.style.display = "none";
}
this.eventDiv_.style.display = this.labelDiv_.style.display;
};
/**
* @name MarkerWithLabelOptions
* @class This class represents the optional parameter passed to the {@link MarkerWithLabel} constructor.
* The properties available are the same as for <code>google.maps.Marker</code> with the addition
* of the properties listed below. To change any of these additional properties after the labeled
* marker has been created, call <code>google.maps.Marker.set(propertyName, propertyValue)</code>.
* <p>
* When any of these properties changes, a property changed event is fired. The names of these
* events are derived from the name of the property and are of the form <code>propertyname_changed</code>.
* For example, if the content of the label changes, a <code>labelcontent_changed</code> event
* is fired.
* <p>
* @property {string|Node} [labelContent] The content of the label (plain text or an HTML DOM node).
* @property {Point} [labelAnchor] By default, a label is drawn with its anchor point at (0,0) so
* that its top left corner is positioned at the anchor point of the associated marker. Use this
* property to change the anchor point of the label. For example, to center a 50px-wide label
* beneath a marker, specify a <code>labelAnchor</code> of <code>google.maps.Point(25, 0)</code>.
* (Note: x-values increase to the right and y-values increase to the top.)
* @property {string} [labelClass] The name of the CSS class defining the styles for the label.
* Note that style values for <code>position</code>, <code>overflow</code>, <code>top</code>,
* <code>left</code>, <code>zIndex</code>, <code>display</code>, <code>marginLeft</code>, and
* <code>marginTop</code> are ignored; these styles are for internal use only.
* @property {Object} [labelStyle] An object literal whose properties define specific CSS
* style values to be applied to the label. Style values defined here override those that may
* be defined in the <code>labelClass</code> style sheet. If this property is changed after the
* label has been created, all previously set styles (except those defined in the style sheet)
* are removed from the label before the new style values are applied.
* Note that style values for <code>position</code>, <code>overflow</code>, <code>top</code>,
* <code>left</code>, <code>zIndex</code>, <code>display</code>, <code>marginLeft</code>, and
* <code>marginTop</code> are ignored; these styles are for internal use only.
* @property {boolean} [labelInBackground] A flag indicating whether a label that overlaps its
* associated marker should appear in the background (i.e., in a plane below the marker).
* The default is <code>false</code>, which causes the label to appear in the foreground.
* @property {boolean} [labelVisible] A flag indicating whether the label is to be visible.
* The default is <code>true</code>. Note that even if <code>labelVisible</code> is
* <code>true</code>, the label will <i>not</i> be visible unless the associated marker is also
* visible (i.e., unless the marker's <code>visible</code> property is <code>true</code>).
* @property {boolean} [raiseOnDrag] A flag indicating whether the label and marker are to be
* raised when the marker is dragged. The default is <code>true</code>. If a draggable marker is
* being created and a version of Google Maps API earlier than V3.3 is being used, this property
* must be set to <code>false</code>.
* @property {boolean} [optimized] A flag indicating whether rendering is to be optimized for the
* marker. <b>Important: The optimized rendering technique is not supported by MarkerWithLabel,
* so the value of this parameter is always forced to <code>false</code>.
* @property {string} [crossImage="http://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png"]
* The URL of the cross image to be displayed while dragging a marker.
* @property {string} [handCursor="http://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur"]
* The URL of the cursor to be displayed while dragging a marker.
*/
/**
* Creates a MarkerWithLabel with the options specified in {@link MarkerWithLabelOptions}.
* @constructor
* @param {MarkerWithLabelOptions} [opt_options] The optional parameters.
*/
function MarkerWithLabel(opt_options) {
opt_options = opt_options || {};
opt_options.labelContent = opt_options.labelContent || "";
opt_options.labelAnchor = opt_options.labelAnchor || new google.maps.Point(0, 0);
opt_options.labelClass = opt_options.labelClass || "markerLabels";
opt_options.labelStyle = opt_options.labelStyle || {};
opt_options.labelInBackground = opt_options.labelInBackground || false;
if (typeof opt_options.labelVisible === "undefined") {
opt_options.labelVisible = true;
}
if (typeof opt_options.raiseOnDrag === "undefined") {
opt_options.raiseOnDrag = true;
}
if (typeof opt_options.clickable === "undefined") {
opt_options.clickable = true;
}
if (typeof opt_options.draggable === "undefined") {
opt_options.draggable = false;
}
if (typeof opt_options.optimized === "undefined") {
opt_options.optimized = false;
}
opt_options.crossImage = opt_options.crossImage || "http" + (document.location.protocol === "https:" ? "s" : "") + "://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png";
opt_options.handCursor = opt_options.handCursor || "http" + (document.location.protocol === "https:" ? "s" : "") + "://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur";
opt_options.optimized = false; // Optimized rendering is not supported
this.label = new MarkerLabel_(this, opt_options.crossImage, opt_options.handCursor); // Bind the label to the marker
// Call the parent constructor. It calls Marker.setValues to initialize, so all
// the new parameters are conveniently saved and can be accessed with get/set.
// Marker.set triggers a property changed event (called "propertyname_changed")
// that the marker label listens for in order to react to state changes.
google.maps.Marker.apply(this, arguments);
}
inherits(MarkerWithLabel, google.maps.Marker);
/**
* Overrides the standard Marker setMap function.
* @param {Map} theMap The map to which the marker is to be added.
* @private
*/
MarkerWithLabel.prototype.setMap = function (theMap) {
// Call the inherited function...
google.maps.Marker.prototype.setMap.apply(this, arguments);
// ... then deal with the label:
this.label.setMap(theMap);
};;/*
!
The MIT License
Copyright (c) 2010-2013 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
angular-google-maps
https://github.com/nlaplante/angular-google-maps
@authors
Nicolas Laplante - https://plus.google.com/108189012221374960701
Nicholas McCready - https://twitter.com/nmccready
*/
(function() {
angular.module("google-maps.wrapped", []);
angular.module("google-maps.extensions", ["google-maps.wrapped"]);
angular.module("google-maps.directives.api.utils", ['google-maps.extensions']);
angular.module("google-maps.directives.api.managers", []);
angular.module("google-maps.directives.api.models.child", ["google-maps.directives.api.utils"]);
angular.module("google-maps.directives.api.models.parent", ["google-maps.directives.api.managers", "google-maps.directives.api.models.child"]);
angular.module("google-maps.directives.api", ["google-maps.directives.api.models.parent"]);
angular.module("google-maps", ["google-maps.directives.api"]).factory("debounce", [
"$timeout", function($timeout) {
return function(fn) {
var nthCall;
nthCall = 0;
return function() {
var argz, later, that;
that = this;
argz = arguments;
nthCall++;
later = (function(version) {
return function() {
if (version === nthCall) {
return fn.apply(that, argz);
}
};
})(nthCall);
return $timeout(later, 0, true);
};
};
}
]);
}).call(this);
(function() {
angular.module("google-maps.extensions").service('ExtendGWin', function() {
return {
init: _.once(function() {
if (!(google || (typeof google !== "undefined" && google !== null ? google.maps : void 0) || (google.maps.InfoWindow != null))) {
return;
}
google.maps.InfoWindow.prototype._open = google.maps.InfoWindow.prototype.open;
google.maps.InfoWindow.prototype._close = google.maps.InfoWindow.prototype.close;
google.maps.InfoWindow.prototype._isOpen = false;
google.maps.InfoWindow.prototype.open = function(map, anchor) {
this._isOpen = true;
this._open(map, anchor);
};
google.maps.InfoWindow.prototype.close = function() {
this._isOpen = false;
this._close();
};
google.maps.InfoWindow.prototype.isOpen = function(val) {
if (val == null) {
val = void 0;
}
if (val == null) {
return this._isOpen;
} else {
return this._isOpen = val;
}
};
/*
Do the same for InfoBox
TODO: Clean this up so the logic is defined once, wait until develop becomes master as this will be easier
*/
if (!window.InfoBox) {
return;
}
window.InfoBox.prototype._open = window.InfoBox.prototype.open;
window.InfoBox.prototype._close = window.InfoBox.prototype.close;
window.InfoBox.prototype._isOpen = false;
window.InfoBox.prototype.open = function(map, anchor) {
this._isOpen = true;
this._open(map, anchor);
};
window.InfoBox.prototype.close = function() {
this._isOpen = false;
this._close();
};
window.InfoBox.prototype.isOpen = function(val) {
if (val == null) {
val = void 0;
}
if (val == null) {
return this._isOpen;
} else {
return this._isOpen = val;
}
};
MarkerLabel_.prototype.setContent = function() {
var content;
content = this.marker_.get("labelContent");
if (!content || _.isEqual(this.oldContent, content)) {
return;
}
if (typeof (content != null ? content.nodeType : void 0) === "undefined") {
this.labelDiv_.innerHTML = content;
this.eventDiv_.innerHTML = this.labelDiv_.innerHTML;
this.oldContent = content;
} else {
this.labelDiv_.innerHTML = "";
this.labelDiv_.appendChild(content);
content = content.cloneNode(true);
this.eventDiv_.appendChild(content);
this.oldContent = content;
}
};
/*
Removes the DIV for the label from the DOM. It also removes all event handlers.
This method is called automatically when the marker's <code>setMap(null)</code>
method is called.
@private
*/
return MarkerLabel_.prototype.onRemove = function() {
if (this.labelDiv_.parentNode != null) {
this.labelDiv_.parentNode.removeChild(this.labelDiv_);
}
if (this.eventDiv_.parentNode != null) {
this.eventDiv_.parentNode.removeChild(this.eventDiv_);
}
if (!this.listeners_) {
return;
}
if (!this.listeners_.length) {
return;
}
this.listeners_.forEach(function(l) {
return google.maps.event.removeListener(l);
});
};
})
};
});
}).call(this);
/*
Author Nick McCready
Intersection of Objects if the arrays have something in common each intersecting object will be returned
in an new array.
*/
(function() {
_.intersectionObjects = function(array1, array2, comparison) {
var res,
_this = this;
if (comparison == null) {
comparison = void 0;
}
res = _.map(array1, function(obj1) {
return _.find(array2, function(obj2) {
if (comparison != null) {
return comparison(obj1, obj2);
} else {
return _.isEqual(obj1, obj2);
}
});
});
return _.filter(res, function(o) {
return o != null;
});
};
_.containsObject = _.includeObject = function(obj, target, comparison) {
var _this = this;
if (comparison == null) {
comparison = void 0;
}
if (obj === null) {
return false;
}
return _.any(obj, function(value) {
if (comparison != null) {
return comparison(value, target);
} else {
return _.isEqual(value, target);
}
});
};
_.differenceObjects = function(array1, array2, comparison) {
if (comparison == null) {
comparison = void 0;
}
return _.filter(array1, function(value) {
return !_.containsObject(array2, value, comparison);
});
};
_.withoutObjects = _.differenceObjects;
_.indexOfObject = function(array, item, comparison, isSorted) {
var i, length;
if (array == null) {
return -1;
}
i = 0;
length = array.length;
if (isSorted) {
if (typeof isSorted === "number") {
i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted);
} else {
i = _.sortedIndex(array, item);
return (array[i] === item ? i : -1);
}
}
while (i < length) {
if (comparison != null) {
if (comparison(array[i], item)) {
return i;
}
} else {
if (_.isEqual(array[i], item)) {
return i;
}
}
i++;
}
return -1;
};
_["extends"] = function(arrayOfObjectsToCombine) {
return _.reduce(arrayOfObjectsToCombine, function(combined, toAdd) {
return _.extend(combined, toAdd);
}, {});
};
_.isNullOrUndefined = function(thing) {
return _.isNull(thing || _.isUndefined(thing));
};
}).call(this);
(function() {
String.prototype.contains = function(value, fromIndex) {
return this.indexOf(value, fromIndex) !== -1;
};
String.prototype.flare = function(flare) {
if (flare == null) {
flare = 'nggmap';
}
return flare + this;
};
String.prototype.ns = String.prototype.flare;
}).call(this);
/*
Author: Nicholas McCready & jfriend00
_async handles things asynchronous-like :), to allow the UI to be free'd to do other things
Code taken from http://stackoverflow.com/questions/10344498/best-way-to-iterate-over-an-array-without-blocking-the-ui
The design of any funcitonality of _async is to be like lodash/underscore and replicate it but call things
asynchronously underneath. Each should be sufficient for most things to be derrived from.
TODO: Handle Object iteration like underscore and lodash as well.. not that important right now
*/
(function() {
var async;
async = {
each: function(array, callback, doneCallBack, pausedCallBack, chunk, index, pause) {
var doChunk;
if (chunk == null) {
chunk = 20;
}
if (index == null) {
index = 0;
}
if (pause == null) {
pause = 1;
}
if (!pause) {
throw "pause (delay) must be set from _async!";
return;
}
if (array === void 0 || (array != null ? array.length : void 0) <= 0) {
doneCallBack();
return;
}
doChunk = function() {
var cnt, i;
cnt = chunk;
i = index;
while (cnt-- && i < (array ? array.length : i + 1)) {
callback(array[i], i);
++i;
}
if (array) {
if (i < array.length) {
index = i;
if (pausedCallBack != null) {
pausedCallBack();
}
return setTimeout(doChunk, pause);
} else {
if (doneCallBack) {
return doneCallBack();
}
}
}
};
return doChunk();
},
map: function(objs, iterator, doneCallBack, pausedCallBack, chunk) {
var results;
results = [];
if (objs == null) {
return results;
}
return _async.each(objs, function(o) {
return results.push(iterator(o));
}, function() {
return doneCallBack(results);
}, pausedCallBack, chunk);
}
};
window._async = async;
angular.module("google-maps.directives.api.utils").factory("async", function() {
return window._async;
});
}).call(this);
(function() {
var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
angular.module("google-maps.directives.api.utils").factory("BaseObject", function() {
var BaseObject, baseObjectKeywords;
baseObjectKeywords = ['extended', 'included'];
BaseObject = (function() {
function BaseObject() {}
BaseObject.extend = function(obj) {
var key, value, _ref;
for (key in obj) {
value = obj[key];
if (__indexOf.call(baseObjectKeywords, key) < 0) {
this[key] = value;
}
}
if ((_ref = obj.extended) != null) {
_ref.apply(this);
}
return this;
};
BaseObject.include = function(obj) {
var key, value, _ref;
for (key in obj) {
value = obj[key];
if (__indexOf.call(baseObjectKeywords, key) < 0) {
this.prototype[key] = value;
}
}
if ((_ref = obj.included) != null) {
_ref.apply(this);
}
return this;
};
return BaseObject;
})();
return BaseObject;
});
}).call(this);
/*
Useful function callbacks that should be defined at later time.
Mainly to be used for specs to verify creation / linking.
This is to lead a common design in notifying child stuff.
*/
(function() {
angular.module("google-maps.directives.api.utils").factory("ChildEvents", function() {
return {
onChildCreation: function(child) {}
};
});
}).call(this);
(function() {
angular.module("google-maps.directives.api.utils").service('CtrlHandle', [
'$q', function($q) {
var CtrlHandle;
return CtrlHandle = {
handle: function($scope, $element) {
$scope.deferred = $q.defer();
return {
getScope: function() {
return $scope;
}
};
},
mapPromise: function(scope, ctrl) {
var mapScope;
mapScope = ctrl.getScope();
mapScope.deferred.promise.then(function(map) {
return scope.map = map;
});
return mapScope.deferred.promise;
}
};
}
]);
}).call(this);
(function() {
angular.module("google-maps.directives.api.utils").service("EventsHelper", [
"Logger", function($log) {
return {
setEvents: function(gObject, scope, model, ignores) {
if (angular.isDefined(scope.events) && (scope.events != null) && angular.isObject(scope.events)) {
return _.compact(_.map(scope.events, function(eventHandler, eventName) {
var doIgnore;
if (ignores) {
doIgnore = _(ignores).contains(eventName);
}
if (scope.events.hasOwnProperty(eventName) && angular.isFunction(scope.events[eventName]) && !doIgnore) {
return google.maps.event.addListener(gObject, eventName, function() {
return eventHandler.apply(scope, [gObject, eventName, model, arguments]);
});
} else {
return $log.info("EventHelper: invalid event listener " + eventName);
}
}));
}
},
removeEvents: function(listeners) {
return listeners != null ? listeners.forEach(function(l) {
return google.maps.event.removeListener(l);
}) : void 0;
}
};
}
]);
}).call(this);
(function() {
var __hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api.utils").factory("FitHelper", [
"BaseObject", "Logger", function(BaseObject, $log) {
var FitHelper, _ref;
return FitHelper = (function(_super) {
__extends(FitHelper, _super);
function FitHelper() {
_ref = FitHelper.__super__.constructor.apply(this, arguments);
return _ref;
}
FitHelper.prototype.fit = function(gMarkers, gMap) {
var bounds, everSet,
_this = this;
if (gMap && gMarkers && gMarkers.length > 0) {
bounds = new google.maps.LatLngBounds();
everSet = false;
return _async.each(gMarkers, function(gMarker) {
if (gMarker) {
if (!everSet) {
everSet = true;
}
return bounds.extend(gMarker.getPosition());
}
}, function() {
if (everSet) {
return gMap.fitBounds(bounds);
}
});
}
};
return FitHelper;
})(BaseObject);
}
]);
}).call(this);
(function() {
angular.module("google-maps.directives.api.utils").service("GmapUtil", [
"Logger", "$compile", function(Logger, $compile) {
var getCoords, getLatitude, getLongitude, setCoordsFromEvent, validateCoords;
getLatitude = function(value) {
if (Array.isArray(value) && value.length === 2) {
return value[1];
} else if (angular.isDefined(value.type) && value.type === "Point") {
return value.coordinates[1];
} else {
return value.latitude;
}
};
getLongitude = function(value) {
if (Array.isArray(value) && value.length === 2) {
return value[0];
} else if (angular.isDefined(value.type) && value.type === "Point") {
return value.coordinates[0];
} else {
return value.longitude;
}
};
getCoords = function(value) {
if (!value) {
return;
}
if (Array.isArray(value) && value.length === 2) {
return new google.maps.LatLng(value[1], value[0]);
} else if (angular.isDefined(value.type) && value.type === "Point") {
return new google.maps.LatLng(value.coordinates[1], value.coordinates[0]);
} else {
return new google.maps.LatLng(value.latitude, value.longitude);
}
};
setCoordsFromEvent = function(prevValue, newLatLon) {
if (!prevValue) {
return;
}
if (Array.isArray(prevValue) && prevValue.length === 2) {
prevValue[1] = newLatLon.lat();
prevValue[0] = newLatLon.lng();
} else if (angular.isDefined(prevValue.type) && prevValue.type === "Point") {
prevValue.coordinates[1] = newLatLon.lat();
prevValue.coordinates[0] = newLatLon.lng();
} else {
prevValue.latitude = newLatLon.lat();
prevValue.longitude = newLatLon.lng();
}
return prevValue;
};
validateCoords = function(coords) {
if (angular.isUndefined(coords)) {
return false;
}
if (_.isArray(coords)) {
if (coords.length === 2) {
return true;
}
} else if ((coords != null) && (coords != null ? coords.type : void 0)) {
if (coords.type === "Point" && _.isArray(coords.coordinates) && coords.coordinates.length === 2) {
return true;
}
}
if (coords && angular.isDefined((coords != null ? coords.latitude : void 0) && angular.isDefined(coords != null ? coords.longitude : void 0))) {
return true;
}
return false;
};
return {
getLabelPositionPoint: function(anchor) {
var xPos, yPos;
if (anchor === void 0) {
return void 0;
}
anchor = /^([-\d\.]+)\s([-\d\.]+)$/.exec(anchor);
xPos = parseFloat(anchor[1]);
yPos = parseFloat(anchor[2]);
if ((xPos != null) && (yPos != null)) {
return new google.maps.Point(xPos, yPos);
}
},
createMarkerOptions: function(coords, icon, defaults, map) {
var opts;
if (map == null) {
map = void 0;
}
if (defaults == null) {
defaults = {};
}
opts = angular.extend({}, defaults, {
position: defaults.position != null ? defaults.position : getCoords(coords),
visible: defaults.visible != null ? defaults.visible : validateCoords(coords)
});
if ((defaults.icon != null) || (icon != null)) {
opts = angular.extend(opts, {
icon: defaults.icon != null ? defaults.icon : icon
});
}
if (map != null) {
opts.map = map;
}
return opts;
},
createWindowOptions: function(gMarker, scope, content, defaults) {
if ((content != null) && (defaults != null) && ($compile != null)) {
return angular.extend({}, defaults, {
content: this.buildContent(scope, defaults, content),
position: defaults.position != null ? defaults.position : angular.isObject(gMarker) ? gMarker.getPosition() : getCoords(scope.coords)
});
} else {
if (!defaults) {
Logger.error("infoWindow defaults not defined");
if (!content) {
return Logger.error("infoWindow content not defined");
}
} else {
return defaults;
}
}
},
buildContent: function(scope, defaults, content) {
var parsed, ret;
if (defaults.content != null) {
ret = defaults.content;
} else {
if ($compile != null) {
parsed = $compile(content)(scope);
if (parsed.length > 0) {
ret = parsed[0];
}
} else {
ret = content;
}
}
return ret;
},
defaultDelay: 50,
isTrue: function(val) {
return angular.isDefined(val) && val !== null && val === true || val === "1" || val === "y" || val === "true";
},
isFalse: function(value) {
return ['false', 'FALSE', 0, 'n', 'N', 'no', 'NO'].indexOf(value) !== -1;
},
getCoords: getCoords,
validateCoords: validateCoords,
equalCoords: function(coord1, coord2) {
return getLatitude(coord1) === getLatitude(coord2) && getLongitude(coord1) === getLongitude(coord2);
},
validatePath: function(path) {
var array, i, polygon, trackMaxVertices;
i = 0;
if (angular.isUndefined(path.type)) {
if (!Array.isArray(path) || path.length < 2) {
return false;
}
while (i < path.length) {
if (!((angular.isDefined(path[i].latitude) && angular.isDefined(path[i].longitude)) || (typeof path[i].lat === "function" && typeof path[i].lng === "function"))) {
return false;
}
i++;
}
return true;
} else {
if (angular.isUndefined(path.coordinates)) {
return false;
}
if (path.type === "Polygon") {
if (path.coordinates[0].length < 4) {
return false;
}
array = path.coordinates[0];
} else if (path.type === "MultiPolygon") {
trackMaxVertices = {
max: 0,
index: 0
};
_.forEach(path.coordinates, function(polygon, index) {
if (polygon[0].length > this.max) {
this.max = polygon[0].length;
return this.index = index;
}
}, trackMaxVertices);
polygon = path.coordinates[trackMaxVertices.index];
array = polygon[0];
if (array.length < 4) {
return false;
}
} else if (path.type === "LineString") {
if (path.coordinates.length < 2) {
return false;
}
array = path.coordinates;
} else {
return false;
}
while (i < array.length) {
if (array[i].length !== 2) {
return false;
}
i++;
}
return true;
}
},
convertPathPoints: function(path) {
var array, i, latlng, result, trackMaxVertices;
i = 0;
result = new google.maps.MVCArray();
if (angular.isUndefined(path.type)) {
while (i < path.length) {
latlng;
if (angular.isDefined(path[i].latitude) && angular.isDefined(path[i].longitude)) {
latlng = new google.maps.LatLng(path[i].latitude, path[i].longitude);
} else if (typeof path[i].lat === "function" && typeof path[i].lng === "function") {
latlng = path[i];
}
result.push(latlng);
i++;
}
} else {
array;
if (path.type === "Polygon") {
array = path.coordinates[0];
} else if (path.type === "MultiPolygon") {
trackMaxVertices = {
max: 0,
index: 0
};
_.forEach(path.coordinates, function(polygon, index) {
if (polygon[0].length > this.max) {
this.max = polygon[0].length;
return this.index = index;
}
}, trackMaxVertices);
array = path.coordinates[trackMaxVertices.index][0];
} else if (path.type === "LineString") {
array = path.coordinates;
}
while (i < array.length) {
result.push(new google.maps.LatLng(array[i][1], array[i][0]));
i++;
}
}
return result;
},
extendMapBounds: function(map, points) {
var bounds, i;
bounds = new google.maps.LatLngBounds();
i = 0;
while (i < points.length) {
bounds.extend(points.getAt(i));
i++;
}
return map.fitBounds(bounds);
},
getPath: function(object, key) {
var obj;
obj = object;
_.each(key.split("."), function(value) {
if (obj) {
return obj = obj[value];
}
});
return obj;
},
setCoordsFromEvent: setCoordsFromEvent
};
}
]);
}).call(this);
(function() {
angular.module("google-maps.directives.api.utils").service("IsReady".ns(), [
'$q', '$timeout', function($q, $timeout) {
var ctr, promises, proms;
ctr = 0;
proms = [];
promises = function() {
return $q.all(proms);
};
return {
spawn: function() {
var d;
d = $q.defer();
proms.push(d.promise);
ctr += 1;
return {
instance: ctr,
deferred: d
};
},
promises: promises,
instances: function() {
return ctr;
},
promise: function(expect) {
var d, ohCrap;
if (expect == null) {
expect = 1;
}
d = $q.defer();
ohCrap = function() {
return $timeout(function() {
if (ctr !== expect) {
return ohCrap();
} else {
return d.resolve(promises());
}
});
};
ohCrap();
return d.promise;
}
};
}
]);
}).call(this);
(function() {
var __hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api.utils").factory("Linked", [
"BaseObject", function(BaseObject) {
var Linked;
Linked = (function(_super) {
__extends(Linked, _super);
function Linked(scope, element, attrs, ctrls) {
this.scope = scope;
this.element = element;
this.attrs = attrs;
this.ctrls = ctrls;
}
return Linked;
})(BaseObject);
return Linked;
}
]);
}).call(this);
(function() {
angular.module("google-maps.directives.api.utils").service("Logger", [
"$log", function($log) {
return {
doLog: false,
info: function(msg) {
if (this.doLog) {
if ($log != null) {
return $log.info(msg);
} else {
return console.info(msg);
}
}
},
error: function(msg) {
if (this.doLog) {
if ($log != null) {
return $log.error(msg);
} else {
return console.error(msg);
}
}
},
warn: function(msg) {
if (this.doLog) {
if ($log != null) {
return $log.warn(msg);
} else {
return console.warn(msg);
}
}
}
};
}
]);
}).call(this);
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api.utils").factory("ModelKey", [
"BaseObject", "GmapUtil", function(BaseObject, GmapUtil) {
var ModelKey;
return ModelKey = (function(_super) {
__extends(ModelKey, _super);
function ModelKey(scope) {
this.scope = scope;
this.setIdKey = __bind(this.setIdKey, this);
this.modelKeyComparison = __bind(this.modelKeyComparison, this);
ModelKey.__super__.constructor.call(this);
this.defaultIdKey = "id";
this.idKey = void 0;
}
ModelKey.prototype.evalModelHandle = function(model, modelKey) {
if (model === void 0 || modelKey === void 0) {
return void 0;
}
if (modelKey === 'self') {
return model;
} else {
return GmapUtil.getPath(model, modelKey);
}
};
ModelKey.prototype.modelKeyComparison = function(model1, model2) {
var scope;
scope = this.scope.coords != null ? this.scope : this.parentScope;
if (scope == null) {
throw "No scope or parentScope set!";
}
return GmapUtil.equalCoords(this.evalModelHandle(model1, scope.coords), this.evalModelHandle(model2, scope.coords));
};
ModelKey.prototype.setIdKey = function(scope) {
return this.idKey = scope.idKey != null ? scope.idKey : this.defaultIdKey;
};
ModelKey.prototype.setVal = function(model, key, newValue) {
var thingToSet;
thingToSet = this.modelOrKey(model, key);
thingToSet = newValue;
return model;
};
ModelKey.prototype.modelOrKey = function(model, key) {
var thing;
thing = key !== 'self' ? model[key] : model;
return thing;
};
return ModelKey;
})(BaseObject);
}
]);
}).call(this);
(function() {
angular.module("google-maps.directives.api.utils").factory("ModelsWatcher", [
"Logger", function(Logger) {
return {
figureOutState: function(idKey, scope, childObjects, comparison, callBack) {
var adds, mappedScopeModelIds, removals, updates,
_this = this;
adds = [];
mappedScopeModelIds = {};
removals = [];
updates = [];
return _async.each(scope.models, function(m) {
var child;
if (m[idKey] != null) {
mappedScopeModelIds[m[idKey]] = {};
if (childObjects[m[idKey]] == null) {
return adds.push(m);
} else {
child = childObjects[m[idKey]];
if (!comparison(m, child.model)) {
return updates.push({
model: m,
child: child
});
}
}
} else {
return Logger.error("id missing for model " + (m.toString()) + ", can not use do comparison/insertion");
}
}, function() {
return _async.each(childObjects.values(), function(c) {
var id;
if (c == null) {
Logger.error("child undefined in ModelsWatcher.");
return;
}
if (c.model == null) {
Logger.error("child.model undefined in ModelsWatcher.");
return;
}
id = c.model[idKey];
if (mappedScopeModelIds[id] == null) {
return removals.push(c);
}
}, function() {
return callBack({
adds: adds,
removals: removals,
updates: updates
});
});
});
}
};
}
]);
}).call(this);
/*
Simple Object Map with a lenght property to make it easy to track length/size
*/
(function() {
var propsToPop,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
propsToPop = ['get', 'put', 'remove', 'values', 'keys', 'length', 'push', 'didValueStateChange', 'didKeyStateChange', 'slice', 'removeAll', 'allVals', 'allKeys', 'stateChanged'];
window.PropMap = (function() {
function PropMap() {
this.removeAll = __bind(this.removeAll, this);
this.slice = __bind(this.slice, this);
this.push = __bind(this.push, this);
this.keys = __bind(this.keys, this);
this.values = __bind(this.values, this);
this.remove = __bind(this.remove, this);
this.put = __bind(this.put, this);
this.stateChanged = __bind(this.stateChanged, this);
this.get = __bind(this.get, this);
this.length = 0;
this.didValueStateChange = false;
this.didKeyStateChange = false;
this.allVals = [];
this.allKeys = [];
}
PropMap.prototype.get = function(key) {
return this[key];
};
PropMap.prototype.stateChanged = function() {
this.didValueStateChange = true;
return this.didKeyStateChange = true;
};
PropMap.prototype.put = function(key, value) {
if (this.get(key) == null) {
this.length++;
}
this.stateChanged();
return this[key] = value;
};
PropMap.prototype.remove = function(key, isSafe) {
var value;
if (isSafe == null) {
isSafe = false;
}
if (isSafe && !this.get(key)) {
return void 0;
}
value = this[key];
delete this[key];
this.length--;
this.stateChanged();
return value;
};
PropMap.prototype.values = function() {
var all,
_this = this;
if (!this.didValueStateChange) {
return this.allVals;
}
all = [];
this.keys().forEach(function(key) {
if (_.indexOf(propsToPop, key) === -1) {
return all.push(_this[key]);
}
});
all;
this.didValueStateChange = false;
this.keys();
return this.allVals = all;
};
PropMap.prototype.keys = function() {
var all, keys,
_this = this;
if (!this.didKeyStateChange) {
return this.allKeys;
}
keys = _.keys(this);
all = [];
_.each(keys, function(prop) {
if (_.indexOf(propsToPop, prop) === -1) {
return all.push(prop);
}
});
this.didKeyStateChange = false;
this.values();
return this.allKeys = all;
};
PropMap.prototype.push = function(obj, key) {
if (key == null) {
key = "key";
}
return this.put(obj[key], obj);
};
PropMap.prototype.slice = function() {
var _this = this;
return this.keys().map(function(k) {
return _this.remove(k);
});
};
PropMap.prototype.removeAll = function() {
return this.slice();
};
return PropMap;
})();
angular.module("google-maps.directives.api.utils").factory("PropMap", function() {
return window.PropMap;
});
}).call(this);
(function() {
angular.module("google-maps.directives.api.utils").factory("nggmap-PropertyAction", [
"Logger", function(Logger) {
var PropertyAction;
PropertyAction = function(setterFn, isFirstSet) {
var _this = this;
this.setIfChange = function(newVal, oldVal) {
if (!_.isEqual(oldVal, newVal || isFirstSet)) {
return setterFn(newVal);
}
};
this.sic = function(oldVal, newVal) {
return _this.setIfChange(oldVal, newVal);
};
return this;
};
return PropertyAction;
}
]);
}).call(this);
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api.managers").factory("ClustererMarkerManager", [
"Logger", "FitHelper", "PropMap", function($log, FitHelper, PropMap) {
var ClustererMarkerManager;
ClustererMarkerManager = (function(_super) {
__extends(ClustererMarkerManager, _super);
function ClustererMarkerManager(gMap, opt_markers, opt_options, opt_events) {
var self;
this.opt_events = opt_events;
this.checkSync = __bind(this.checkSync, this);
this.getGMarkers = __bind(this.getGMarkers, this);
this.fit = __bind(this.fit, this);
this.destroy = __bind(this.destroy, this);
this.clear = __bind(this.clear, this);
this.draw = __bind(this.draw, this);
this.removeMany = __bind(this.removeMany, this);
this.remove = __bind(this.remove, this);
this.addMany = __bind(this.addMany, this);
this.add = __bind(this.add, this);
ClustererMarkerManager.__super__.constructor.call(this);
self = this;
this.opt_options = opt_options;
if ((opt_options != null) && opt_markers === void 0) {
this.clusterer = new NgMapMarkerClusterer(gMap, void 0, opt_options);
} else if ((opt_options != null) && (opt_markers != null)) {
this.clusterer = new NgMapMarkerClusterer(gMap, opt_markers, opt_options);
} else {
this.clusterer = new NgMapMarkerClusterer(gMap);
}
this.propMapGMarkers = new PropMap();
this.attachEvents(this.opt_events, "opt_events");
this.clusterer.setIgnoreHidden(true);
this.noDrawOnSingleAddRemoves = true;
$log.info(this);
}
ClustererMarkerManager.prototype.checkKey = function(gMarker) {
var msg;
if (gMarker.key == null) {
msg = "gMarker.key undefined and it is REQUIRED!!";
return Logger.error(msg);
}
};
ClustererMarkerManager.prototype.add = function(gMarker) {
var exists;
this.checkKey(gMarker);
exists = this.propMapGMarkers.get(gMarker.key) != null;
this.clusterer.addMarker(gMarker, this.noDrawOnSingleAddRemoves);
this.propMapGMarkers.put(gMarker.key, gMarker);
return this.checkSync();
};
ClustererMarkerManager.prototype.addMany = function(gMarkers) {
var _this = this;
return gMarkers.forEach(function(gMarker) {
return _this.add(gMarker);
});
};
ClustererMarkerManager.prototype.remove = function(gMarker) {
var exists;
this.checkKey(gMarker);
exists = this.propMapGMarkers.get(gMarker.key);
if (exists) {
this.clusterer.removeMarker(gMarker, this.noDrawOnSingleAddRemoves);
this.propMapGMarkers.remove(gMarker.key);
}
return this.checkSync();
};
ClustererMarkerManager.prototype.removeMany = function(gMarkers) {
var _this = this;
return gMarkers.forEach(function(gMarker) {
return _this.remove(gMarker);
});
};
ClustererMarkerManager.prototype.draw = function() {
return this.clusterer.repaint();
};
ClustererMarkerManager.prototype.clear = function() {
this.removeMany(this.getGMarkers());
return this.clusterer.repaint();
};
ClustererMarkerManager.prototype.attachEvents = function(options, optionsName) {
var eventHandler, eventName, _results;
if (angular.isDefined(options) && (options != null) && angular.isObject(options)) {
_results = [];
for (eventName in options) {
eventHandler = options[eventName];
if (options.hasOwnProperty(eventName) && angular.isFunction(options[eventName])) {
$log.info("" + optionsName + ": Attaching event: " + eventName + " to clusterer");
_results.push(google.maps.event.addListener(this.clusterer, eventName, options[eventName]));
} else {
_results.push(void 0);
}
}
return _results;
}
};
ClustererMarkerManager.prototype.clearEvents = function(options) {
var eventHandler, eventName, _results;
if (angular.isDefined(options) && (options != null) && angular.isObject(options)) {
_results = [];
for (eventName in options) {
eventHandler = options[eventName];
if (options.hasOwnProperty(eventName) && angular.isFunction(options[eventName])) {
$log.info("" + optionsName + ": Clearing event: " + eventName + " to clusterer");
_results.push(google.maps.event.clearListeners(this.clusterer, eventName));
} else {
_results.push(void 0);
}
}
return _results;
}
};
ClustererMarkerManager.prototype.destroy = function() {
this.clearEvents(this.opt_events);
this.clearEvents(this.opt_internal_events);
return this.clear();
};
ClustererMarkerManager.prototype.fit = function() {
return ClustererMarkerManager.__super__.fit.call(this, this.getGMarkers(), this.clusterer.getMap());
};
ClustererMarkerManager.prototype.getGMarkers = function() {
return this.clusterer.getMarkers().values();
};
ClustererMarkerManager.prototype.checkSync = function() {
if (this.getGMarkers().length !== this.propMapGMarkers.length) {
throw "GMarkers out of Sync in MarkerClusterer";
}
};
return ClustererMarkerManager;
})(FitHelper);
return ClustererMarkerManager;
}
]);
}).call(this);
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api.managers").factory("MarkerManager", [
"Logger", "FitHelper", "PropMap", function(Logger, FitHelper, PropMap) {
var MarkerManager;
MarkerManager = (function(_super) {
__extends(MarkerManager, _super);
MarkerManager.include(FitHelper);
function MarkerManager(gMap, opt_markers, opt_options) {
this.getGMarkers = __bind(this.getGMarkers, this);
this.fit = __bind(this.fit, this);
this.handleOptDraw = __bind(this.handleOptDraw, this);
this.clear = __bind(this.clear, this);
this.draw = __bind(this.draw, this);
this.removeMany = __bind(this.removeMany, this);
this.remove = __bind(this.remove, this);
this.addMany = __bind(this.addMany, this);
this.add = __bind(this.add, this);
MarkerManager.__super__.constructor.call(this);
this.gMap = gMap;
this.gMarkers = new PropMap();
this.$log = Logger;
this.$log.info(this);
}
MarkerManager.prototype.add = function(gMarker, optDraw) {
var exists, msg;
if (optDraw == null) {
optDraw = true;
}
if (gMarker.key == null) {
msg = "gMarker.key undefined and it is REQUIRED!!";
Logger.error(msg);
throw msg;
}
exists = (this.gMarkers.get(gMarker.key)) != null;
if (!exists) {
this.handleOptDraw(gMarker, optDraw, true);
return this.gMarkers.put(gMarker.key, gMarker);
}
};
MarkerManager.prototype.addMany = function(gMarkers) {
var _this = this;
return gMarkers.forEach(function(gMarker) {
return _this.add(gMarker);
});
};
MarkerManager.prototype.remove = function(gMarker, optDraw) {
if (optDraw == null) {
optDraw = true;
}
this.handleOptDraw(gMarker, optDraw, false);
if (this.gMarkers.get(gMarker.key)) {
return this.gMarkers.remove(gMarker.key);
}
};
MarkerManager.prototype.removeMany = function(gMarkers) {
var _this = this;
return this.gMarkers.values().forEach(function(marker) {
return _this.remove(marker);
});
};
MarkerManager.prototype.draw = function() {
var deletes,
_this = this;
deletes = [];
this.gMarkers.values().forEach(function(gMarker) {
if (!gMarker.isDrawn) {
if (gMarker.doAdd) {
gMarker.setMap(_this.gMap);
return gMarker.isDrawn = true;
} else {
return deletes.push(gMarker);
}
}
});
return deletes.forEach(function(gMarker) {
gMarker.isDrawn = false;
return _this.remove(gMarker, true);
});
};
MarkerManager.prototype.clear = function() {
this.gMarkers.values().forEach(function(gMarker) {
return gMarker.setMap(null);
});
delete this.gMarkers;
return this.gMarkers = new PropMap();
};
MarkerManager.prototype.handleOptDraw = function(gMarker, optDraw, doAdd) {
if (optDraw === true) {
if (doAdd) {
gMarker.setMap(this.gMap);
} else {
gMarker.setMap(null);
}
return gMarker.isDrawn = true;
} else {
gMarker.isDrawn = false;
return gMarker.doAdd = doAdd;
}
};
MarkerManager.prototype.fit = function() {
return MarkerManager.__super__.fit.call(this, this.getGMarkers(), this.gMap);
};
MarkerManager.prototype.getGMarkers = function() {
return this.gMarkers.values();
};
return MarkerManager;
})(FitHelper);
return MarkerManager;
}
]);
}).call(this);
(function() {
angular.module("google-maps").factory("array-sync", [
"add-events", function(mapEvents) {
return function(mapArray, scope, pathEval, pathChangedFn) {
var geojsonArray, geojsonHandlers, geojsonWatcher, isSetFromScope, legacyHandlers, legacyWatcher, mapArrayListener, scopePath, watchListener;
isSetFromScope = false;
scopePath = scope.$eval(pathEval);
if (!scope["static"]) {
legacyHandlers = {
set_at: function(index) {
var value;
if (isSetFromScope) {
return;
}
value = mapArray.getAt(index);
if (!value) {
return;
}
if (!value.lng || !value.lat) {
return scopePath[index] = value;
} else {
scopePath[index].latitude = value.lat();
return scopePath[index].longitude = value.lng();
}
},
insert_at: function(index) {
var value;
if (isSetFromScope) {
return;
}
value = mapArray.getAt(index);
if (!value) {
return;
}
if (!value.lng || !value.lat) {
return scopePath.splice(index, 0, value);
} else {
return scopePath.splice(index, 0, {
latitude: value.lat(),
longitude: value.lng()
});
}
},
remove_at: function(index) {
if (isSetFromScope) {
return;
}
return scopePath.splice(index, 1);
}
};
geojsonArray;
if (scopePath.type === "Polygon") {
geojsonArray = scopePath.coordinates[0];
} else if (scopePath.type === "LineString") {
geojsonArray = scopePath.coordinates;
}
geojsonHandlers = {
set_at: function(index) {
var value;
if (isSetFromScope) {
return;
}
value = mapArray.getAt(index);
if (!value) {
return;
}
if (!value.lng || !value.lat) {
return;
}
geojsonArray[index][1] = value.lat();
return geojsonArray[index][0] = value.lng();
},
insert_at: function(index) {
var value;
if (isSetFromScope) {
return;
}
value = mapArray.getAt(index);
if (!value) {
return;
}
if (!value.lng || !value.lat) {
return;
}
return geojsonArray.splice(index, 0, [value.lng(), value.lat()]);
},
remove_at: function(index) {
if (isSetFromScope) {
return;
}
return geojsonArray.splice(index, 1);
}
};
mapArrayListener = mapEvents(mapArray, angular.isUndefined(scopePath.type) ? legacyHandlers : geojsonHandlers);
}
legacyWatcher = function(newPath) {
var changed, i, l, newLength, newValue, oldArray, oldLength, oldValue;
isSetFromScope = true;
oldArray = mapArray;
changed = false;
if (newPath) {
i = 0;
oldLength = oldArray.getLength();
newLength = newPath.length;
l = Math.min(oldLength, newLength);
newValue = void 0;
while (i < l) {
oldValue = oldArray.getAt(i);
newValue = newPath[i];
if (typeof newValue.equals === "function") {
if (!newValue.equals(oldValue)) {
oldArray.setAt(i, newValue);
changed = true;
}
} else {
if ((oldValue.lat() !== newValue.latitude) || (oldValue.lng() !== newValue.longitude)) {
oldArray.setAt(i, new google.maps.LatLng(newValue.latitude, newValue.longitude));
changed = true;
}
}
i++;
}
while (i < newLength) {
newValue = newPath[i];
if (typeof newValue.lat === "function" && typeof newValue.lng === "function") {
oldArray.push(newValue);
} else {
oldArray.push(new google.maps.LatLng(newValue.latitude, newValue.longitude));
}
changed = true;
i++;
}
while (i < oldLength) {
oldArray.pop();
changed = true;
i++;
}
}
isSetFromScope = false;
if (changed) {
return pathChangedFn(oldArray);
}
};
geojsonWatcher = function(newPath) {
var array, changed, i, l, newLength, newValue, oldArray, oldLength, oldValue;
isSetFromScope = true;
oldArray = mapArray;
changed = false;
if (newPath) {
array;
if (scopePath.type === "Polygon") {
array = newPath.coordinates[0];
} else if (scopePath.type === "LineString") {
array = newPath.coordinates;
}
i = 0;
oldLength = oldArray.getLength();
newLength = array.length;
l = Math.min(oldLength, newLength);
newValue = void 0;
while (i < l) {
oldValue = oldArray.getAt(i);
newValue = array[i];
if ((oldValue.lat() !== newValue[1]) || (oldValue.lng() !== newValue[0])) {
oldArray.setAt(i, new google.maps.LatLng(newValue[1], newValue[0]));
changed = true;
}
i++;
}
while (i < newLength) {
newValue = array[i];
oldArray.push(new google.maps.LatLng(newValue[1], newValue[0]));
changed = true;
i++;
}
while (i < oldLength) {
oldArray.pop();
changed = true;
i++;
}
}
isSetFromScope = false;
if (changed) {
return pathChangedFn(oldArray);
}
};
watchListener;
if (!scope["static"]) {
if (angular.isUndefined(scopePath.type)) {
watchListener = scope.$watchCollection(pathEval, legacyWatcher);
} else {
watchListener = scope.$watch(pathEval, geojsonWatcher, true);
}
}
return function() {
if (mapArrayListener) {
mapArrayListener();
mapArrayListener = null;
}
if (watchListener) {
watchListener();
return watchListener = null;
}
};
};
}
]);
}).call(this);
(function() {
angular.module("google-maps").factory("add-events", [
"$timeout", function($timeout) {
var addEvent, addEvents;
addEvent = function(target, eventName, handler) {
return google.maps.event.addListener(target, eventName, function() {
handler.apply(this, arguments);
return $timeout((function() {}), true);
});
};
addEvents = function(target, eventName, handler) {
var remove;
if (handler) {
return addEvent(target, eventName, handler);
}
remove = [];
angular.forEach(eventName, function(_handler, key) {
return remove.push(addEvent(target, key, _handler));
});
return function() {
angular.forEach(remove, function(listener) {
return google.maps.event.removeListener(listener);
});
return remove = null;
};
};
return addEvents;
}
]);
}).call(this);
/*
angular-google-maps
https://github.com/nlaplante/angular-google-maps
@authors
Nicholas McCready - https://twitter.com/nmccready
Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawing-freehand , &
http://jsfiddle.net/YsQdh/88/
*/
(function() {
angular.module("google-maps.directives.api.models.child").factory("DrawFreeHandChildModel", [
'Logger', '$q', function($log, $q) {
var drawFreeHand, freeHandMgr;
drawFreeHand = function(map, polys, enable) {
var move, poly;
this.polys = polys;
poly = new google.maps.Polyline({
map: map,
clickable: false
});
move = google.maps.event.addListener(map, 'mousemove', function(e) {
return poly.getPath().push(e.latLng);
});
google.maps.event.addListenerOnce(map, 'mouseup', function(e) {
var path;
google.maps.event.removeListener(move);
path = poly.getPath();
poly.setMap(null);
polys.push(new google.maps.Polygon({
map: map,
path: path
}));
poly = null;
google.maps.event.clearListeners(map.getDiv(), 'mousedown');
return enable();
});
return void 0;
};
freeHandMgr = function(map) {
var disableMap, enable,
_this = this;
this.map = map;
enable = function() {
var _ref;
if ((_ref = _this.deferred) != null) {
_ref.resolve();
}
return _this.map.setOptions(_this.oldOptions);
};
disableMap = function() {
$log.info('disabling map move');
_this.oldOptions = map.getOptions();
return _this.map.setOptions({
draggable: false,
zoomControl: false,
scrollwheel: false,
disableDoubleClickZoom: false
});
};
this.engage = function(polys) {
_this.polys = polys;
_this.deferred = $q.defer();
disableMap();
$log.info('DrawFreeHandChildModel is engaged (drawing).');
google.maps.event.addDomListener(_this.map.getDiv(), 'mousedown', function(e) {
return drawFreeHand(_this.map, _this.polys, enable);
});
return _this.deferred.promise;
};
return this;
};
return freeHandMgr;
}
]);
}).call(this);
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api.models.child").factory("MarkerLabelChildModel", [
"BaseObject", "GmapUtil", function(BaseObject, GmapUtil) {
var MarkerLabelChildModel;
MarkerLabelChildModel = (function(_super) {
__extends(MarkerLabelChildModel, _super);
MarkerLabelChildModel.include(GmapUtil);
function MarkerLabelChildModel(gMarker, options, map) {
this.destroy = __bind(this.destroy, this);
this.setOptions = __bind(this.setOptions, this);
var self;
MarkerLabelChildModel.__super__.constructor.call(this);
self = this;
this.gMarker = gMarker;
this.setOptions(options);
this.gMarkerLabel = new MarkerLabel_(this.gMarker, options.crossImage, options.handCursor);
this.gMarker.set("setMap", function(theMap) {
self.gMarkerLabel.setMap(theMap);
return google.maps.Marker.prototype.setMap.apply(this, arguments);
});
this.gMarker.setMap(map);
}
MarkerLabelChildModel.prototype.setOption = function(optStr, content) {
/*
COMENTED CODE SHOWS AWFUL CHROME BUG in Google Maps SDK 3, still happens in version 3.16
any animation will cause markers to disappear
*/
return this.gMarker.set(optStr, content);
};
MarkerLabelChildModel.prototype.setOptions = function(options) {
var _ref, _ref1;
if (options != null ? options.labelContent : void 0) {
this.gMarker.set("labelContent", options.labelContent);
}
if (options != null ? options.labelAnchor : void 0) {
this.gMarker.set("labelAnchor", this.getLabelPositionPoint(options.labelAnchor));
}
this.gMarker.set("labelClass", options.labelClass || 'labels');
this.gMarker.set("labelStyle", options.labelStyle || {
opacity: 100
});
this.gMarker.set("labelInBackground", options.labelInBackground || false);
if (!options.labelVisible) {
this.gMarker.set("labelVisible", true);
}
if (!options.raiseOnDrag) {
this.gMarker.set("raiseOnDrag", true);
}
if (!options.clickable) {
this.gMarker.set("clickable", true);
}
if (!options.draggable) {
this.gMarker.set("draggable", false);
}
if (!options.optimized) {
this.gMarker.set("optimized", false);
}
options.crossImage = (_ref = options.crossImage) != null ? _ref : document.location.protocol + "//maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png";
return options.handCursor = (_ref1 = options.handCursor) != null ? _ref1 : document.location.protocol + "//maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur";
};
MarkerLabelChildModel.prototype.destroy = function() {
if ((this.gMarkerLabel.labelDiv_.parentNode != null) && (this.gMarkerLabel.eventDiv_.parentNode != null)) {
return this.gMarkerLabel.onRemove();
}
};
return MarkerLabelChildModel;
})(BaseObject);
return MarkerLabelChildModel;
}
]);
}).call(this);
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api.models.child").factory("MarkerChildModel", [
"ModelKey", "GmapUtil", "Logger", "$injector", "EventsHelper", function(ModelKey, GmapUtil, $log, $injector, EventsHelper) {
var MarkerChildModel;
MarkerChildModel = (function(_super) {
__extends(MarkerChildModel, _super);
MarkerChildModel.include(GmapUtil);
MarkerChildModel.include(EventsHelper);
function MarkerChildModel(model, parentScope, gMap, $timeout, defaults, doClick, gMarkerManager, idKey, doDrawSelf) {
var _this = this;
this.model = model;
this.parentScope = parentScope;
this.gMap = gMap;
this.$timeout = $timeout;
this.defaults = defaults;
this.doClick = doClick;
this.gMarkerManager = gMarkerManager;
this.idKey = idKey != null ? idKey : "id";
this.doDrawSelf = doDrawSelf != null ? doDrawSelf : true;
this.watchDestroy = __bind(this.watchDestroy, this);
this.internalEvents = __bind(this.internalEvents, this);
this.setLabelOptions = __bind(this.setLabelOptions, this);
this.setOptions = __bind(this.setOptions, this);
this.setIcon = __bind(this.setIcon, this);
this.setCoords = __bind(this.setCoords, this);
this.destroy = __bind(this.destroy, this);
this.maybeSetScopeValue = __bind(this.maybeSetScopeValue, this);
this.createMarker = __bind(this.createMarker, this);
this.setMyScope = __bind(this.setMyScope, this);
if (this.model[this.idKey] != null) {
this.id = this.model[this.idKey];
}
this.iconKey = this.parentScope.icon;
this.coordsKey = this.parentScope.coords;
this.clickKey = this.parentScope.click();
this.optionsKey = this.parentScope.options;
this.needRedraw = false;
MarkerChildModel.__super__.constructor.call(this, this.parentScope.$new(false));
this.scope.model = this.model;
this.setMyScope(this.model, void 0, true);
this.createMarker(this.model);
this.scope.$watch('model', function(newValue, oldValue) {
if (newValue !== oldValue) {
_this.setMyScope(newValue, oldValue);
return _this.needRedraw = true;
}
}, true);
$log.info(this);
this.watchDestroy(this.scope);
}
MarkerChildModel.prototype.setMyScope = function(model, oldModel, isInit) {
var _this = this;
if (oldModel == null) {
oldModel = void 0;
}
if (isInit == null) {
isInit = false;
}
this.maybeSetScopeValue('icon', model, oldModel, this.iconKey, this.evalModelHandle, isInit, this.setIcon);
this.maybeSetScopeValue('coords', model, oldModel, this.coordsKey, this.evalModelHandle, isInit, this.setCoords);
if (_.isFunction(this.clickKey) && $injector) {
return this.scope.click = function() {
return $injector.invoke(_this.clickKey, void 0, {
"$markerModel": model
});
};
} else {
this.maybeSetScopeValue('click', model, oldModel, this.clickKey, this.evalModelHandle, isInit);
return this.createMarker(model, oldModel, isInit);
}
};
MarkerChildModel.prototype.createMarker = function(model, oldModel, isInit) {
if (oldModel == null) {
oldModel = void 0;
}
if (isInit == null) {
isInit = false;
}
this.maybeSetScopeValue('options', model, oldModel, this.optionsKey, this.evalModelHandle, isInit, this.setOptions);
if (this.parentScope.options && !this.scope.options) {
return $log.error('Options not found on model!');
}
};
MarkerChildModel.prototype.maybeSetScopeValue = function(scopePropName, model, oldModel, modelKey, evaluate, isInit, gSetter) {
var newValue, oldVal;
if (gSetter == null) {
gSetter = void 0;
}
if (oldModel === void 0) {
this.scope[scopePropName] = evaluate(model, modelKey);
if (!isInit) {
if (gSetter != null) {
gSetter(this.scope);
}
}
return;
}
oldVal = evaluate(oldModel, modelKey);
newValue = evaluate(model, modelKey);
if (newValue !== oldVal) {
this.scope[scopePropName] = newValue;
if (!isInit) {
if (gSetter != null) {
gSetter(this.scope);
}
if (this.doDrawSelf) {
return this.gMarkerManager.draw();
}
}
}
};
MarkerChildModel.prototype.destroy = function() {
if (this.gMarker != null) {
this.removeEvents(this.externalListeners);
this.removeEvents(this.internalListeners);
this.gMarkerManager.remove(this.gMarker, true);
delete this.gMarker;
return this.scope.$destroy();
}
};
MarkerChildModel.prototype.setCoords = function(scope) {
if (scope.$id !== this.scope.$id || this.gMarker === void 0) {
return;
}
if (scope.coords != null) {
if (!this.validateCoords(this.scope.coords)) {
$log.error("MarkerChildMarker cannot render marker as scope.coords as no position on marker: " + (JSON.stringify(this.model)));
return;
}
this.gMarker.setPosition(this.getCoords(scope.coords));
this.gMarker.setVisible(this.validateCoords(scope.coords));
return this.gMarkerManager.add(this.gMarker);
} else {
return this.gMarkerManager.remove(this.gMarker);
}
};
MarkerChildModel.prototype.setIcon = function(scope) {
if (scope.$id !== this.scope.$id || this.gMarker === void 0) {
return;
}
this.gMarkerManager.remove(this.gMarker);
this.gMarker.setIcon(scope.icon);
this.gMarkerManager.add(this.gMarker);
this.gMarker.setPosition(this.getCoords(scope.coords));
return this.gMarker.setVisible(this.validateCoords(scope.coords));
};
MarkerChildModel.prototype.setOptions = function(scope) {
var ignore, _ref;
if (scope.$id !== this.scope.$id) {
return;
}
if (this.gMarker != null) {
this.gMarkerManager.remove(this.gMarker);
delete this.gMarker;
}
if (!((_ref = scope.coords) != null ? _ref : typeof scope.icon === "function" ? scope.icon(scope.options != null) : void 0)) {
return;
}
this.opts = this.createMarkerOptions(scope.coords, scope.icon, scope.options);
delete this.gMarker;
if (scope.isLabel) {
this.gMarker = new MarkerWithLabel(this.setLabelOptions(this.opts));
} else {
this.gMarker = new google.maps.Marker(this.opts);
}
this.externalListeners = this.setEvents(this.gMarker, this.parentScope, this.model, ignore = ['dragend']);
this.internalListeners = this.setEvents(this.gMarker, {
events: this.internalEvents()
}, this.model);
if (this.id != null) {
this.gMarker.key = this.id;
}
return this.gMarkerManager.add(this.gMarker);
};
MarkerChildModel.prototype.setLabelOptions = function(opts) {
opts.labelAnchor = this.getLabelPositionPoint(opts.labelAnchor);
return opts;
};
MarkerChildModel.prototype.internalEvents = function() {
var _this = this;
return {
dragend: function(marker, eventName, model, mousearg) {
var newCoords, _ref, _ref1;
newCoords = _this.setCoordsFromEvent(_this.modelOrKey(_this.scope.model, _this.coordsKey), _this.gMarker.getPosition());
_this.scope.model = _this.setVal(model, _this.coordsKey, newCoords);
if (((_ref = _this.parentScope.events) != null ? _ref.dragend : void 0) != null) {
if ((_ref1 = _this.parentScope.events) != null) {
_ref1.dragend(marker, eventName, _this.scope.model, mousearg);
}
}
return _this.scope.$apply();
},
click: function() {
if (_this.doClick && (_this.scope.click != null)) {
_this.scope.click();
return _this.scope.$apply();
}
}
};
};
MarkerChildModel.prototype.watchDestroy = function(scope) {
return scope.$on("$destroy", this.destroy);
};
return MarkerChildModel;
})(ModelKey);
return MarkerChildModel;
}
]);
}).call(this);
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api").factory("PolylineChildModel", [
"BaseObject", "Logger", "$timeout", "array-sync", "GmapUtil", "EventsHelper", function(BaseObject, $log, $timeout, arraySync, GmapUtil, EventsHelper) {
var PolylineChildModel;
return PolylineChildModel = (function(_super) {
__extends(PolylineChildModel, _super);
PolylineChildModel.include(GmapUtil);
PolylineChildModel.include(EventsHelper);
function PolylineChildModel(scope, attrs, map, defaults, model) {
var _this = this;
this.scope = scope;
this.attrs = attrs;
this.map = map;
this.defaults = defaults;
this.model = model;
this.clean = __bind(this.clean, this);
this.buildOpts = __bind(this.buildOpts, this);
scope.$watch('path', function(newValue, oldValue) {
var pathPoints;
if (!_.isEqual(newValue, oldValue) || !_this.polyline) {
pathPoints = _this.convertPathPoints(scope.path);
if (pathPoints.length > 0) {
_this.polyline = new google.maps.Polyline(_this.buildOpts(pathPoints));
}
if (_this.polyline) {
if (scope.fit) {
_this.extendMapBounds(map, pathPoints);
}
arraySync(_this.polyline.getPath(), scope, "path", function(pathPoints) {
if (scope.fit) {
return _this.extendMapBounds(map, pathPoints);
}
});
return _this.listeners = _this.model ? _this.setEvents(_this.polyline, scope, _this.model) : _this.setEvents(_this.polyline, scope, scope);
}
}
});
if (!scope["static"] && angular.isDefined(scope.editable)) {
scope.$watch("editable", function(newValue, oldValue) {
var _ref;
if (newValue !== oldValue) {
return (_ref = _this.polyline) != null ? _ref.setEditable(newValue) : void 0;
}
});
}
if (angular.isDefined(scope.draggable)) {
scope.$watch("draggable", function(newValue, oldValue) {
var _ref;
if (newValue !== oldValue) {
return (_ref = _this.polyline) != null ? _ref.setDraggable(newValue) : void 0;
}
});
}
if (angular.isDefined(scope.visible)) {
scope.$watch("visible", function(newValue, oldValue) {
var _ref;
if (newValue !== oldValue) {
return (_ref = _this.polyline) != null ? _ref.setVisible(newValue) : void 0;
}
});
}
if (angular.isDefined(scope.geodesic)) {
scope.$watch("geodesic", function(newValue, oldValue) {
var _ref;
if (newValue !== oldValue) {
return (_ref = _this.polyline) != null ? _ref.setOptions(_this.buildOpts(_this.polyline.getPath())) : void 0;
}
});
}
if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.weight)) {
scope.$watch("stroke.weight", function(newValue, oldValue) {
var _ref;
if (newValue !== oldValue) {
return (_ref = _this.polyline) != null ? _ref.setOptions(_this.buildOpts(_this.polyline.getPath())) : void 0;
}
});
}
if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.color)) {
scope.$watch("stroke.color", function(newValue, oldValue) {
var _ref;
if (newValue !== oldValue) {
return (_ref = _this.polyline) != null ? _ref.setOptions(_this.buildOpts(_this.polyline.getPath())) : void 0;
}
});
}
if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.opacity)) {
scope.$watch("stroke.opacity", function(newValue, oldValue) {
var _ref;
if (newValue !== oldValue) {
return (_ref = _this.polyline) != null ? _ref.setOptions(_this.buildOpts(_this.polyline.getPath())) : void 0;
}
});
}
if (angular.isDefined(scope.icons)) {
scope.$watch("icons", function(newValue, oldValue) {
var _ref;
if (newValue !== oldValue) {
return (_ref = _this.polyline) != null ? _ref.setOptions(_this.buildOpts(_this.polyline.getPath())) : void 0;
}
});
}
scope.$on("$destroy", function() {
_this.clean();
return _this.scope = null;
});
$log.info(this);
}
PolylineChildModel.prototype.buildOpts = function(pathPoints) {
var opts,
_this = this;
opts = angular.extend({}, this.defaults, {
map: this.map,
path: pathPoints,
icons: this.scope.icons,
strokeColor: this.scope.stroke && this.scope.stroke.color,
strokeOpacity: this.scope.stroke && this.scope.stroke.opacity,
strokeWeight: this.scope.stroke && this.scope.stroke.weight
});
angular.forEach({
clickable: true,
draggable: false,
editable: false,
geodesic: false,
visible: true,
"static": false,
fit: false
}, function(defaultValue, key) {
if (angular.isUndefined(_this.scope[key]) || _this.scope[key] === null) {
return opts[key] = defaultValue;
} else {
return opts[key] = _this.scope[key];
}
});
if (opts["static"]) {
opts.editable = false;
}
return opts;
};
PolylineChildModel.prototype.clean = function() {
var arraySyncer;
this.removeEvents(this.listeners);
this.polyline.setMap(null);
this.polyline = null;
if (arraySyncer) {
arraySyncer();
return arraySyncer = null;
}
};
PolylineChildModel.prototype.destroy = function() {
return this.scope.$destroy();
};
return PolylineChildModel;
})(BaseObject);
}
]);
}).call(this);
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api.models.child").factory("WindowChildModel", [
"BaseObject", "GmapUtil", "Logger", "$compile", "$http", "$templateCache", function(BaseObject, GmapUtil, Logger, $compile, $http, $templateCache) {
var WindowChildModel;
WindowChildModel = (function(_super) {
__extends(WindowChildModel, _super);
WindowChildModel.include(GmapUtil);
function WindowChildModel(model, scope, opts, isIconVisibleOnClick, mapCtrl, markerCtrl, element, needToManualDestroy, markerIsVisibleAfterWindowClose) {
var _this = this;
this.model = model;
this.scope = scope;
this.opts = opts;
this.isIconVisibleOnClick = isIconVisibleOnClick;
this.mapCtrl = mapCtrl;
this.markerCtrl = markerCtrl;
this.element = element;
this.needToManualDestroy = needToManualDestroy != null ? needToManualDestroy : false;
this.markerIsVisibleAfterWindowClose = markerIsVisibleAfterWindowClose != null ? markerIsVisibleAfterWindowClose : true;
this.destroy = __bind(this.destroy, this);
this.remove = __bind(this.remove, this);
this.hideWindow = __bind(this.hideWindow, this);
this.getLatestPosition = __bind(this.getLatestPosition, this);
this.showWindow = __bind(this.showWindow, this);
this.handleClick = __bind(this.handleClick, this);
this.watchOptions = __bind(this.watchOptions, this);
this.watchCoords = __bind(this.watchCoords, this);
this.watchShow = __bind(this.watchShow, this);
this.createGWin = __bind(this.createGWin, this);
this.watchElement = __bind(this.watchElement, this);
this.googleMapsHandles = [];
this.$log = Logger;
this.createGWin();
if (this.markerCtrl != null) {
this.markerCtrl.setClickable(true);
}
this.watchElement();
this.watchOptions();
this.watchShow();
this.watchCoords();
this.scope.$on("$destroy", function() {
return _this.destroy();
});
this.$log.info(this);
}
WindowChildModel.prototype.watchElement = function() {
var _this = this;
return this.scope.$watch(function() {
var _ref;
if (!_this.element || !_this.html) {
return;
}
if (_this.html !== _this.element.html()) {
if (_this.gWin) {
if ((_ref = _this.opts) != null) {
_ref.content = void 0;
}
_this.remove();
_this.createGWin();
return _this.showHide();
}
}
});
};
WindowChildModel.prototype.createGWin = function() {
var defaults, _opts,
_this = this;
if (this.gWin == null) {
defaults = {};
if (this.opts != null) {
if (this.scope.coords) {
this.opts.position = this.getCoords(this.scope.coords);
}
defaults = this.opts;
}
if (this.element) {
this.html = _.isObject(this.element) ? this.element.html() : this.element;
}
_opts = this.scope.options ? this.scope.options : defaults;
this.opts = this.createWindowOptions(this.markerCtrl, this.scope, this.html, _opts);
}
if ((this.opts != null) && !this.gWin) {
if (this.opts.boxClass && (window.InfoBox && typeof window.InfoBox === 'function')) {
this.gWin = new window.InfoBox(this.opts);
} else {
this.gWin = new google.maps.InfoWindow(this.opts);
}
if (this.gWin) {
this.handleClick();
}
return this.googleMapsHandles.push(google.maps.event.addListener(this.gWin, 'closeclick', function() {
if (_this.markerCtrl) {
_this.markerCtrl.setAnimation(_this.oldMarkerAnimation);
if (_this.markerIsVisibleAfterWindowClose) {
_.delay(function() {
_this.markerCtrl.setVisible(false);
return _this.markerCtrl.setVisible(_this.markerIsVisibleAfterWindowClose);
}, 250);
}
}
_this.gWin.isOpen(false);
if (_this.scope.closeClick != null) {
return _this.scope.closeClick();
}
}));
}
};
WindowChildModel.prototype.watchShow = function() {
var _this = this;
return this.scope.$watch('show', function(newValue, oldValue) {
if (newValue !== oldValue) {
if (newValue) {
return _this.showWindow();
} else {
return _this.hideWindow();
}
} else {
if (_this.gWin != null) {
if (newValue && !_this.gWin.getMap()) {
return _this.showWindow();
}
}
}
}, true);
};
WindowChildModel.prototype.watchCoords = function() {
var scope,
_this = this;
scope = this.markerCtrl != null ? this.scope.$parent : this.scope;
return scope.$watch('coords', function(newValue, oldValue) {
var pos;
if (newValue !== oldValue) {
if (newValue == null) {
return _this.hideWindow();
} else {
if (!_this.validateCoords(newValue)) {
_this.$log.error("WindowChildMarker cannot render marker as scope.coords as no position on marker: " + (JSON.stringify(_this.model)));
return;
}
pos = _this.getCoords(newValue);
_this.gWin.setPosition(pos);
if (_this.opts) {
return _this.opts.position = pos;
}
}
}
}, true);
};
WindowChildModel.prototype.watchOptions = function() {
var scope,
_this = this;
scope = this.markerCtrl != null ? this.scope.$parent : this.scope;
return scope.$watch('options', function(newValue, oldValue) {
if (newValue !== oldValue) {
_this.opts = newValue;
if (_this.gWin != null) {
return _this.gWin.setOptions(_this.opts);
}
}
}, true);
};
WindowChildModel.prototype.handleClick = function(forceClick) {
var click,
_this = this;
click = function() {
var pos;
if (_this.gWin == null) {
_this.createGWin();
}
pos = _this.markerCtrl.getPosition();
if (_this.gWin != null) {
_this.gWin.setPosition(pos);
if (_this.opts) {
_this.opts.position = pos;
}
_this.showWindow();
}
_this.initialMarkerVisibility = _this.markerCtrl.getVisible();
_this.oldMarkerAnimation = _this.markerCtrl.getAnimation();
return _this.markerCtrl.setVisible(_this.isIconVisibleOnClick);
};
if (this.markerCtrl != null) {
if (forceClick) {
click();
}
return this.googleMapsHandles.push(google.maps.event.addListener(this.markerCtrl, 'click', click));
}
};
WindowChildModel.prototype.showWindow = function() {
var show,
_this = this;
show = function() {
if (_this.gWin) {
if ((_this.scope.show || (_this.scope.show == null)) && !_this.gWin.isOpen()) {
return _this.gWin.open(_this.mapCtrl);
}
}
};
if (this.scope.templateUrl) {
if (this.gWin) {
$http.get(this.scope.templateUrl, {
cache: $templateCache
}).then(function(content) {
var compiled, templateScope;
templateScope = _this.scope.$new();
if (angular.isDefined(_this.scope.templateParameter)) {
templateScope.parameter = _this.scope.templateParameter;
}
compiled = $compile(content.data)(templateScope);
return _this.gWin.setContent(compiled[0]);
});
}
return show();
} else {
return show();
}
};
WindowChildModel.prototype.showHide = function() {
if (this.scope.show || (this.scope.show == null)) {
return this.showWindow();
} else {
return this.hideWindow();
}
};
WindowChildModel.prototype.getLatestPosition = function(overridePos) {
if ((this.gWin != null) && (this.markerCtrl != null) && !overridePos) {
return this.gWin.setPosition(this.markerCtrl.getPosition());
} else {
if (overridePos) {
return this.gWin.setPosition(overridePos);
}
}
};
WindowChildModel.prototype.hideWindow = function() {
if ((this.gWin != null) && this.gWin.isOpen()) {
return this.gWin.close();
}
};
WindowChildModel.prototype.remove = function() {
this.hideWindow();
_.each(this.googleMapsHandles, function(h) {
return google.maps.event.removeListener(h);
});
this.googleMapsHandles.length = 0;
delete this.gWin;
return delete this.opts;
};
WindowChildModel.prototype.destroy = function(manualOverride) {
var self;
if (manualOverride == null) {
manualOverride = false;
}
this.remove();
if ((this.scope != null) && (this.needToManualDestroy || manualOverride)) {
this.scope.$destroy();
}
return self = void 0;
};
return WindowChildModel;
})(BaseObject);
return WindowChildModel;
}
]);
}).call(this);
/*
- interface for all markers to derrive from
- to enforce a minimum set of requirements
- attributes
- coords
- icon
- implementation needed on watches
*/
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api.models.parent").factory("IMarkerParentModel", [
"ModelKey", "Logger", function(ModelKey, Logger) {
var IMarkerParentModel;
IMarkerParentModel = (function(_super) {
__extends(IMarkerParentModel, _super);
IMarkerParentModel.prototype.DEFAULTS = {};
function IMarkerParentModel(scope, element, attrs, map, $timeout) {
var self,
_this = this;
this.scope = scope;
this.element = element;
this.attrs = attrs;
this.map = map;
this.$timeout = $timeout;
this.onDestroy = __bind(this.onDestroy, this);
this.onWatch = __bind(this.onWatch, this);
this.watch = __bind(this.watch, this);
this.validateScope = __bind(this.validateScope, this);
IMarkerParentModel.__super__.constructor.call(this, this.scope);
self = this;
this.$log = Logger;
if (!this.validateScope(scope)) {
throw new String("Unable to construct IMarkerParentModel due to invalid scope");
}
this.doClick = angular.isDefined(attrs.click);
if (scope.options != null) {
this.DEFAULTS = scope.options;
}
this.watch('coords', this.scope);
this.watch('icon', this.scope);
this.watch('options', this.scope);
scope.$on("$destroy", function() {
return _this.onDestroy(scope);
});
}
IMarkerParentModel.prototype.validateScope = function(scope) {
var ret;
if (scope == null) {
this.$log.error(this.constructor.name + ": invalid scope used");
return false;
}
ret = scope.coords != null;
if (!ret) {
this.$log.error(this.constructor.name + ": no valid coords attribute found");
return false;
}
return ret;
};
IMarkerParentModel.prototype.watch = function(propNameToWatch, scope) {
var _this = this;
return scope.$watch(propNameToWatch, function(newValue, oldValue) {
if (!_.isEqual(newValue, oldValue)) {
return _this.onWatch(propNameToWatch, scope, newValue, oldValue);
}
}, true);
};
IMarkerParentModel.prototype.onWatch = function(propNameToWatch, scope, newValue, oldValue) {
throw new String("OnWatch Not Implemented!!");
};
IMarkerParentModel.prototype.onDestroy = function(scope) {
throw new String("OnDestroy Not Implemented!!");
};
return IMarkerParentModel;
})(ModelKey);
return IMarkerParentModel;
}
]);
}).call(this);
/*
- interface directive for all window(s) to derrive from
*/
(function() {
var __hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api.models.parent").factory("IWindowParentModel", [
"ModelKey", "GmapUtil", "Logger", function(ModelKey, GmapUtil, Logger) {
var IWindowParentModel;
IWindowParentModel = (function(_super) {
__extends(IWindowParentModel, _super);
IWindowParentModel.include(GmapUtil);
IWindowParentModel.prototype.DEFAULTS = {};
function IWindowParentModel(scope, element, attrs, ctrls, $timeout, $compile, $http, $templateCache) {
var self;
IWindowParentModel.__super__.constructor.call(this, scope);
self = this;
this.$log = Logger;
this.$timeout = $timeout;
this.$compile = $compile;
this.$http = $http;
this.$templateCache = $templateCache;
if (scope.options != null) {
this.DEFAULTS = scope.options;
}
}
return IWindowParentModel;
})(ModelKey);
return IWindowParentModel;
}
]);
}).call(this);
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api.models.parent").factory("LayerParentModel", [
"BaseObject", "Logger", '$timeout', function(BaseObject, Logger, $timeout) {
var LayerParentModel;
LayerParentModel = (function(_super) {
__extends(LayerParentModel, _super);
function LayerParentModel(scope, element, attrs, gMap, onLayerCreated, $log) {
var _this = this;
this.scope = scope;
this.element = element;
this.attrs = attrs;
this.gMap = gMap;
this.onLayerCreated = onLayerCreated != null ? onLayerCreated : void 0;
this.$log = $log != null ? $log : Logger;
this.createGoogleLayer = __bind(this.createGoogleLayer, this);
if (this.attrs.type == null) {
this.$log.info("type attribute for the layer directive is mandatory. Layer creation aborted!!");
return;
}
this.createGoogleLayer();
this.doShow = true;
if (angular.isDefined(this.attrs.show)) {
this.doShow = this.scope.show;
}
if (this.doShow && (this.gMap != null)) {
this.layer.setMap(this.gMap);
}
this.scope.$watch("show", function(newValue, oldValue) {
if (newValue !== oldValue) {
_this.doShow = newValue;
if (newValue) {
return _this.layer.setMap(_this.gMap);
} else {
return _this.layer.setMap(null);
}
}
}, true);
this.scope.$watch("options", function(newValue, oldValue) {
if (newValue !== oldValue) {
_this.layer.setMap(null);
_this.layer = null;
return _this.createGoogleLayer();
}
}, true);
this.scope.$on("$destroy", function() {
return _this.layer.setMap(null);
});
}
LayerParentModel.prototype.createGoogleLayer = function() {
var fn;
if (this.attrs.options == null) {
this.layer = this.attrs.namespace === void 0 ? new google.maps[this.attrs.type]() : new google.maps[this.attrs.namespace][this.attrs.type]();
} else {
this.layer = this.attrs.namespace === void 0 ? new google.maps[this.attrs.type](this.scope.options) : new google.maps[this.attrs.namespace][this.attrs.type](this.scope.options);
}
if ((this.layer != null) && (this.onLayerCreated != null)) {
fn = this.onLayerCreated(this.scope, this.layer);
if (fn) {
return fn(this.layer);
}
}
};
return LayerParentModel;
})(BaseObject);
return LayerParentModel;
}
]);
}).call(this);
/*
Basic Directive api for a marker. Basic in the sense that this directive contains 1:1 on scope and model.
Thus there will be one html element per marker within the directive.
*/
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api.models.parent").factory("MarkerParentModel", [
"IMarkerParentModel", "GmapUtil", "EventsHelper", "ModelKey", function(IMarkerParentModel, GmapUtil, EventsHelper) {
var MarkerParentModel;
MarkerParentModel = (function(_super) {
__extends(MarkerParentModel, _super);
MarkerParentModel.include(GmapUtil);
MarkerParentModel.include(EventsHelper);
function MarkerParentModel(scope, element, attrs, map, $timeout, gMarkerManager, doFit) {
var opts,
_this = this;
this.gMarkerManager = gMarkerManager;
this.doFit = doFit;
this.onDestroy = __bind(this.onDestroy, this);
this.setGMarker = __bind(this.setGMarker, this);
this.onWatch = __bind(this.onWatch, this);
MarkerParentModel.__super__.constructor.call(this, scope, element, attrs, map, $timeout);
opts = this.createMarkerOptions(scope.coords, scope.icon, scope.options, this.map);
this.setGMarker(new google.maps.Marker(opts));
this.listener = google.maps.event.addListener(this.scope.gMarker, 'click', function() {
if (_this.doClick && (scope.click != null)) {
return _this.scope.click();
}
});
this.setEvents(this.scope.gMarker, scope, scope);
this.$log.info(this);
}
MarkerParentModel.prototype.onWatch = function(propNameToWatch, scope) {
var old, pos, _ref;
switch (propNameToWatch) {
case 'coords':
if (this.validateCoords(scope.coords) && (this.scope.gMarker != null)) {
pos = (_ref = this.scope.gMarker) != null ? _ref.getPosition() : void 0;
if (pos.lat() === this.scope.coords.latitude && this.scope.coords.longitude === pos.lng()) {
return;
}
old = this.scope.gMarker.getAnimation();
this.scope.gMarker.setMap(this.map);
this.scope.gMarker.setPosition(this.getCoords(scope.coords));
this.scope.gMarker.setVisible(this.validateCoords(scope.coords));
return this.scope.gMarker.setAnimation(old);
} else {
return this.scope.gMarker.setMap(null);
}
break;
case 'icon':
if ((scope.icon != null) && this.validateCoords(scope.coords) && (this.scope.gMarker != null)) {
this.scope.gMarker.setIcon(scope.icon);
this.scope.gMarker.setMap(null);
this.scope.gMarker.setMap(this.map);
this.scope.gMarker.setPosition(this.getCoords(scope.coords));
return this.scope.gMarker.setVisible(this.validateCoords(scope.coords));
}
break;
case 'options':
if (this.validateCoords(scope.coords) && scope.options) {
if (this.scope.gMarker != null) {
this.scope.gMarker.setMap(null);
}
return this.setGMarker(new google.maps.Marker(this.createMarkerOptions(scope.coords, scope.icon, scope.options, this.map)));
}
}
};
MarkerParentModel.prototype.setGMarker = function(gMarker) {
var ret;
if (this.scope.gMarker) {
ret = this.gMarkerManager.remove(this.scope.gMarker, false);
delete this.scope.gMarker;
ret;
}
this.scope.gMarker = gMarker;
if (this.scope.gMarker) {
this.scope.gMarker.key = this.scope.idKey;
this.gMarkerManager.add(this.scope.gMarker, false);
if (this.doFit) {
return this.gMarkerManager.fit();
}
}
};
MarkerParentModel.prototype.onDestroy = function(scope) {
var self;
if (!this.scope.gMarker) {
self = void 0;
return;
}
this.scope.gMarker.setMap(null);
google.maps.event.removeListener(this.listener);
this.listener = null;
this.gMarkerManager.remove(this.scope.gMarker, false);
delete this.scope.gMarker;
return self = void 0;
};
return MarkerParentModel;
})(IMarkerParentModel);
return MarkerParentModel;
}
]);
}).call(this);
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api.models.parent").factory("MarkersParentModel", [
"IMarkerParentModel", "ModelsWatcher", "PropMap", "MarkerChildModel", "ClustererMarkerManager", "MarkerManager", function(IMarkerParentModel, ModelsWatcher, PropMap, MarkerChildModel, ClustererMarkerManager, MarkerManager) {
var MarkersParentModel;
MarkersParentModel = (function(_super) {
__extends(MarkersParentModel, _super);
MarkersParentModel.include(ModelsWatcher);
function MarkersParentModel(scope, element, attrs, map, $timeout) {
this.onDestroy = __bind(this.onDestroy, this);
this.newChildMarker = __bind(this.newChildMarker, this);
this.updateChild = __bind(this.updateChild, this);
this.pieceMeal = __bind(this.pieceMeal, this);
this.reBuildMarkers = __bind(this.reBuildMarkers, this);
this.createMarkersFromScratch = __bind(this.createMarkersFromScratch, this);
this.validateScope = __bind(this.validateScope, this);
this.onWatch = __bind(this.onWatch, this);
var self,
_this = this;
MarkersParentModel.__super__.constructor.call(this, scope, element, attrs, map, $timeout);
self = this;
this.scope.markerModels = new PropMap();
this.$timeout = $timeout;
this.$log.info(this);
this.doRebuildAll = this.scope.doRebuildAll != null ? this.scope.doRebuildAll : false;
this.setIdKey(scope);
this.scope.$watch('doRebuildAll', function(newValue, oldValue) {
if (newValue !== oldValue) {
return _this.doRebuildAll = newValue;
}
});
this.watch('models', scope);
this.watch('doCluster', scope);
this.watch('clusterOptions', scope);
this.watch('clusterEvents', scope);
this.watch('fit', scope);
this.watch('idKey', scope);
this.gMarkerManager = void 0;
this.createMarkersFromScratch(scope);
}
MarkersParentModel.prototype.onWatch = function(propNameToWatch, scope, newValue, oldValue) {
if (propNameToWatch === "idKey" && newValue !== oldValue) {
this.idKey = newValue;
}
if (this.doRebuildAll) {
return this.reBuildMarkers(scope);
} else {
return this.pieceMeal(scope);
}
};
MarkersParentModel.prototype.validateScope = function(scope) {
var modelsNotDefined;
modelsNotDefined = angular.isUndefined(scope.models) || scope.models === void 0;
if (modelsNotDefined) {
this.$log.error(this.constructor.name + ": no valid models attribute found");
}
return MarkersParentModel.__super__.validateScope.call(this, scope) || modelsNotDefined;
};
MarkersParentModel.prototype.createMarkersFromScratch = function(scope) {
var _this = this;
if (scope.doCluster) {
if (scope.clusterEvents) {
this.clusterInternalOptions = _.once(function() {
var self, _ref, _ref1, _ref2;
self = _this;
if (!_this.origClusterEvents) {
_this.origClusterEvents = {
click: (_ref = scope.clusterEvents) != null ? _ref.click : void 0,
mouseout: (_ref1 = scope.clusterEvents) != null ? _ref1.mouseout : void 0,
mouseover: (_ref2 = scope.clusterEvents) != null ? _ref2.mouseover : void 0
};
return _.extend(scope.clusterEvents, {
click: function(cluster) {
return self.maybeExecMappedEvent(cluster, 'click');
},
mouseout: function(cluster) {
return self.maybeExecMappedEvent(cluster, 'mouseout');
},
mouseover: function(cluster) {
return self.maybeExecMappedEvent(cluster, 'mouseover');
}
});
}
})();
}
if (scope.clusterOptions || scope.clusterEvents) {
if (this.gMarkerManager === void 0) {
this.gMarkerManager = new ClustererMarkerManager(this.map, void 0, scope.clusterOptions, this.clusterInternalOptions);
} else {
if (this.gMarkerManager.opt_options !== scope.clusterOptions) {
this.gMarkerManager = new ClustererMarkerManager(this.map, void 0, scope.clusterOptions, this.clusterInternalOptions);
}
}
} else {
this.gMarkerManager = new ClustererMarkerManager(this.map);
}
} else {
this.gMarkerManager = new MarkerManager(this.map);
}
return _async.each(scope.models, function(model) {
return _this.newChildMarker(model, scope);
}, function() {
_this.gMarkerManager.draw();
if (scope.fit) {
return _this.gMarkerManager.fit();
}
});
};
MarkersParentModel.prototype.reBuildMarkers = function(scope) {
if (!scope.doRebuild && scope.doRebuild !== void 0) {
return;
}
this.onDestroy(scope);
return this.createMarkersFromScratch(scope);
};
MarkersParentModel.prototype.pieceMeal = function(scope) {
var _this = this;
if ((this.scope.models != null) && this.scope.models.length > 0 && this.scope.markerModels.length > 0) {
return this.figureOutState(this.idKey, scope, this.scope.markerModels, this.modelKeyComparison, function(state) {
var payload;
payload = state;
return _async.each(payload.removals, function(child) {
if (child != null) {
if (child.destroy != null) {
child.destroy();
}
return _this.scope.markerModels.remove(child.id);
}
}, function() {
return _async.each(payload.adds, function(modelToAdd) {
return _this.newChildMarker(modelToAdd, scope);
}, function() {
return _async.each(payload.updates, function(update) {
return _this.updateChild(update.child, update.model);
}, function() {
if (payload.adds.length > 0 || payload.removals.length > 0 || payload.updates.length > 0) {
_this.gMarkerManager.draw();
return scope.markerModels = _this.scope.markerModels;
}
});
});
});
});
} else {
return this.reBuildMarkers(scope);
}
};
MarkersParentModel.prototype.updateChild = function(child, model) {
if (model[this.idKey] == null) {
this.$log.error("Marker model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key.");
return;
}
return child.setMyScope(model, child.model, false);
};
MarkersParentModel.prototype.newChildMarker = function(model, scope) {
var child, doDrawSelf;
if (model[this.idKey] == null) {
this.$log.error("Marker model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key.");
return;
}
this.$log.info('child', child, 'markers', this.scope.markerModels);
child = new MarkerChildModel(model, scope, this.map, this.$timeout, this.DEFAULTS, this.doClick, this.gMarkerManager, this.idKey, doDrawSelf = false);
this.scope.markerModels.put(model[this.idKey], child);
return child;
};
MarkersParentModel.prototype.onDestroy = function(scope) {
_.each(this.scope.markerModels.values(), function(model) {
if (model != null) {
return model.destroy();
}
});
delete this.scope.markerModels;
this.scope.markerModels = new PropMap();
if (this.gMarkerManager != null) {
return this.gMarkerManager.clear();
}
};
MarkersParentModel.prototype.maybeExecMappedEvent = function(cluster, fnName) {
var pair, _ref;
if (_.isFunction((_ref = this.scope.clusterEvents) != null ? _ref[fnName] : void 0)) {
pair = this.mapClusterToMarkerModels(cluster);
if (this.origClusterEvents[fnName]) {
return this.origClusterEvents[fnName](pair.cluster, pair.mapped);
}
}
};
MarkersParentModel.prototype.mapClusterToMarkerModels = function(cluster) {
var gMarkers, mapped,
_this = this;
gMarkers = cluster.getMarkers().values();
mapped = gMarkers.map(function(g) {
return _this.scope.markerModels[g.key].model;
});
return {
cluster: cluster,
mapped: mapped
};
};
return MarkersParentModel;
})(IMarkerParentModel);
return MarkersParentModel;
}
]);
}).call(this);
/*
Windows directive where many windows map to the models property
*/
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api.models.parent").factory("PolylinesParentModel", [
"$timeout", "Logger", "ModelKey", "ModelsWatcher", "PropMap", "PolylineChildModel", function($timeout, Logger, ModelKey, ModelsWatcher, PropMap, PolylineChildModel) {
var PolylinesParentModel;
return PolylinesParentModel = (function(_super) {
__extends(PolylinesParentModel, _super);
PolylinesParentModel.include(ModelsWatcher);
function PolylinesParentModel(scope, element, attrs, gMap, defaults) {
var self,
_this = this;
this.scope = scope;
this.element = element;
this.attrs = attrs;
this.gMap = gMap;
this.defaults = defaults;
this.modelKeyComparison = __bind(this.modelKeyComparison, this);
this.setChildScope = __bind(this.setChildScope, this);
this.createChild = __bind(this.createChild, this);
this.pieceMeal = __bind(this.pieceMeal, this);
this.createAllNew = __bind(this.createAllNew, this);
this.watchIdKey = __bind(this.watchIdKey, this);
this.createChildScopes = __bind(this.createChildScopes, this);
this.watchOurScope = __bind(this.watchOurScope, this);
this.watchDestroy = __bind(this.watchDestroy, this);
this.rebuildAll = __bind(this.rebuildAll, this);
this.doINeedToWipe = __bind(this.doINeedToWipe, this);
this.watchModels = __bind(this.watchModels, this);
this.watch = __bind(this.watch, this);
PolylinesParentModel.__super__.constructor.call(this, scope);
self = this;
this.$log = Logger;
this.plurals = new PropMap();
this.scopePropNames = ['path', 'stroke', 'clickable', 'draggable', 'editable', 'geodesic', 'icons', 'visible'];
_.each(this.scopePropNames, function(name) {
return _this[name + 'Key'] = void 0;
});
this.models = void 0;
this.firstTime = true;
this.$log.info(this);
this.watchOurScope(scope);
this.createChildScopes();
}
PolylinesParentModel.prototype.watch = function(scope, name, nameKey) {
var _this = this;
return scope.$watch(name, function(newValue, oldValue) {
if (newValue !== oldValue) {
_this[nameKey] = typeof newValue === 'function' ? newValue() : newValue;
return _async.each(_.values(_this.plurals), function(model) {
return model.scope[name] = _this[nameKey] === 'self' ? model : model[_this[nameKey]];
}, function() {});
}
});
};
PolylinesParentModel.prototype.watchModels = function(scope) {
var _this = this;
return scope.$watch('models', function(newValue, oldValue) {
if (!_.isEqual(newValue, oldValue)) {
if (_this.doINeedToWipe(newValue)) {
return _this.rebuildAll(scope, true, true);
} else {
return _this.createChildScopes(false);
}
}
}, true);
};
PolylinesParentModel.prototype.doINeedToWipe = function(newValue) {
var newValueIsEmpty;
newValueIsEmpty = newValue != null ? newValue.length === 0 : true;
return this.plurals.length > 0 && newValueIsEmpty;
};
PolylinesParentModel.prototype.rebuildAll = function(scope, doCreate, doDelete) {
var _this = this;
return _async.each(this.plurals.values(), function(model) {
return model.destroy();
}, function() {
if (doDelete) {
delete _this.plurals;
}
_this.plurals = new PropMap();
if (doCreate) {
return _this.createChildScopes();
}
});
};
PolylinesParentModel.prototype.watchDestroy = function(scope) {
var _this = this;
return scope.$on("$destroy", function() {
return _this.rebuildAll(scope, false, true);
});
};
PolylinesParentModel.prototype.watchOurScope = function(scope) {
var _this = this;
return _.each(this.scopePropNames, function(name) {
var nameKey;
nameKey = name + 'Key';
_this[nameKey] = typeof scope[name] === 'function' ? scope[name]() : scope[name];
return _this.watch(scope, name, nameKey);
});
};
PolylinesParentModel.prototype.createChildScopes = function(isCreatingFromScratch) {
if (isCreatingFromScratch == null) {
isCreatingFromScratch = true;
}
if (angular.isUndefined(this.scope.models)) {
this.$log.error("No models to create polylines from! I Need direct models!");
return;
}
if (this.gMap != null) {
if (this.scope.models != null) {
this.watchIdKey(this.scope);
if (isCreatingFromScratch) {
return this.createAllNew(this.scope, false);
} else {
return this.pieceMeal(this.scope, false);
}
}
}
};
PolylinesParentModel.prototype.watchIdKey = function(scope) {
var _this = this;
this.setIdKey(scope);
return scope.$watch('idKey', function(newValue, oldValue) {
if (newValue !== oldValue && (newValue == null)) {
_this.idKey = newValue;
return _this.rebuildAll(scope, true, true);
}
});
};
PolylinesParentModel.prototype.createAllNew = function(scope, isArray) {
var _this = this;
if (isArray == null) {
isArray = false;
}
this.models = scope.models;
if (this.firstTime) {
this.watchModels(scope);
this.watchDestroy(scope);
}
return _async.each(scope.models, function(model) {
return _this.createChild(model, _this.gMap);
}, function() {
return _this.firstTime = false;
});
};
PolylinesParentModel.prototype.pieceMeal = function(scope, isArray) {
var _this = this;
if (isArray == null) {
isArray = true;
}
this.models = scope.models;
if ((scope != null) && (scope.models != null) && scope.models.length > 0 && this.plurals.length > 0) {
return this.figureOutState(this.idKey, scope, this.plurals, this.modelKeyComparison, function(state) {
var payload;
payload = state;
return _async.each(payload.removals, function(id) {
var child;
child = _this.plurals[id];
if (child != null) {
child.destroy();
return _this.plurals.remove(id);
}
}, function() {
return _async.each(payload.adds, function(modelToAdd) {
return _this.createChild(modelToAdd, _this.gMap);
}, function() {});
});
});
} else {
return this.rebuildAll(this.scope, true, true);
}
};
PolylinesParentModel.prototype.createChild = function(model, gMap) {
var child, childScope,
_this = this;
childScope = this.scope.$new(false);
this.setChildScope(childScope, model);
childScope.$watch('model', function(newValue, oldValue) {
if (newValue !== oldValue) {
return _this.setChildScope(childScope, newValue);
}
}, true);
childScope["static"] = this.scope["static"];
child = new PolylineChildModel(childScope, this.attrs, gMap, this.defaults, model);
if (model[this.idKey] == null) {
this.$log.error("Polyline model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key.");
return;
}
this.plurals.put(model[this.idKey], child);
return child;
};
PolylinesParentModel.prototype.setChildScope = function(childScope, model) {
var _this = this;
_.each(this.scopePropNames, function(name) {
var nameKey, newValue;
nameKey = name + 'Key';
newValue = _this[nameKey] === 'self' ? model : model[_this[nameKey]];
if (newValue !== childScope[name]) {
return childScope[name] = newValue;
}
});
return childScope.model = model;
};
PolylinesParentModel.prototype.modelKeyComparison = function(model1, model2) {
return _.isEqual(this.evalModelHandle(model1, this.scope.path), this.evalModelHandle(model2, this.scope.path));
};
return PolylinesParentModel;
})(ModelKey);
}
]);
}).call(this);
/*
Windows directive where many windows map to the models property
*/
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api.models.parent").factory("WindowsParentModel", [
"IWindowParentModel", "ModelsWatcher", "PropMap", "WindowChildModel", "Linked", function(IWindowParentModel, ModelsWatcher, PropMap, WindowChildModel, Linked) {
var WindowsParentModel;
WindowsParentModel = (function(_super) {
__extends(WindowsParentModel, _super);
WindowsParentModel.include(ModelsWatcher);
function WindowsParentModel(scope, element, attrs, ctrls, $timeout, $compile, $http, $templateCache, $interpolate) {
var mapScope, self,
_this = this;
this.$interpolate = $interpolate;
this.interpolateContent = __bind(this.interpolateContent, this);
this.setChildScope = __bind(this.setChildScope, this);
this.createWindow = __bind(this.createWindow, this);
this.setContentKeys = __bind(this.setContentKeys, this);
this.pieceMealWindows = __bind(this.pieceMealWindows, this);
this.createAllNewWindows = __bind(this.createAllNewWindows, this);
this.watchIdKey = __bind(this.watchIdKey, this);
this.createChildScopesWindows = __bind(this.createChildScopesWindows, this);
this.watchOurScope = __bind(this.watchOurScope, this);
this.watchDestroy = __bind(this.watchDestroy, this);
this.rebuildAll = __bind(this.rebuildAll, this);
this.doINeedToWipe = __bind(this.doINeedToWipe, this);
this.watchModels = __bind(this.watchModels, this);
this.watch = __bind(this.watch, this);
this.go = __bind(this.go, this);
WindowsParentModel.__super__.constructor.call(this, scope, element, attrs, ctrls, $timeout, $compile, $http, $templateCache);
self = this;
this.windows = new PropMap();
this.scopePropNames = ['show', 'coords', 'templateUrl', 'templateParameter', 'isIconVisibleOnClick', 'closeClick'];
_.each(this.scopePropNames, function(name) {
return _this[name + 'Key'] = void 0;
});
this.linked = new Linked(scope, element, attrs, ctrls);
this.models = void 0;
this.contentKeys = void 0;
this.isIconVisibleOnClick = void 0;
this.firstTime = true;
this.$log.info(self);
this.parentScope = void 0;
mapScope = ctrls[0].getScope();
mapScope.deferred.promise.then(function(map) {
var markerCtrl;
_this.gMap = map;
markerCtrl = ctrls.length > 1 && (ctrls[1] != null) ? ctrls[1] : void 0;
if (!markerCtrl) {
_this.go(scope);
return;
}
return markerCtrl.getScope().deferred.promise.then(function() {
_this.markerScope = markerCtrl.getScope();
return _this.go(scope);
});
});
}
WindowsParentModel.prototype.go = function(scope) {
var _this = this;
this.watchOurScope(scope);
this.doRebuildAll = this.scope.doRebuildAll != null ? this.scope.doRebuildAll : false;
scope.$watch('doRebuildAll', function(newValue, oldValue) {
if (newValue !== oldValue) {
return _this.doRebuildAll = newValue;
}
});
return this.createChildScopesWindows();
};
WindowsParentModel.prototype.watch = function(scope, name, nameKey) {
var _this = this;
return scope.$watch(name, function(newValue, oldValue) {
if (newValue !== oldValue) {
_this[nameKey] = typeof newValue === 'function' ? newValue() : newValue;
return _async.each(_.values(_this.windows), function(model) {
return model.scope[name] = _this[nameKey] === 'self' ? model : model[_this[nameKey]];
}, function() {});
}
});
};
WindowsParentModel.prototype.watchModels = function(scope) {
var _this = this;
return scope.$watch('models', function(newValue, oldValue) {
if (!_.isEqual(newValue, oldValue)) {
if (_this.doRebuildAll || _this.doINeedToWipe(newValue)) {
return _this.rebuildAll(scope, true, true);
} else {
return _this.createChildScopesWindows(false);
}
}
});
};
WindowsParentModel.prototype.doINeedToWipe = function(newValue) {
var newValueIsEmpty;
newValueIsEmpty = newValue != null ? newValue.length === 0 : true;
return this.windows.length > 0 && newValueIsEmpty;
};
WindowsParentModel.prototype.rebuildAll = function(scope, doCreate, doDelete) {
var _this = this;
return _async.each(this.windows.values(), function(model) {
return model.destroy();
}, function() {
if (doDelete) {
delete _this.windows;
}
_this.windows = new PropMap();
if (doCreate) {
return _this.createChildScopesWindows();
}
});
};
WindowsParentModel.prototype.watchDestroy = function(scope) {
var _this = this;
return scope.$on("$destroy", function() {
return _this.rebuildAll(scope, false, true);
});
};
WindowsParentModel.prototype.watchOurScope = function(scope) {
var _this = this;
return _.each(this.scopePropNames, function(name) {
var nameKey;
nameKey = name + 'Key';
_this[nameKey] = typeof scope[name] === 'function' ? scope[name]() : scope[name];
return _this.watch(scope, name, nameKey);
});
};
WindowsParentModel.prototype.createChildScopesWindows = function(isCreatingFromScratch) {
var markersScope, modelsNotDefined;
if (isCreatingFromScratch == null) {
isCreatingFromScratch = true;
}
/*
being that we cannot tell the difference in Key String vs. a normal value string (TemplateUrl)
we will assume that all scope values are string expressions either pointing to a key (propName) or using
'self' to point the model as container/object of interest.
This may force redundant information into the model, but this appears to be the most flexible approach.
*/
this.isIconVisibleOnClick = true;
if (angular.isDefined(this.linked.attrs.isiconvisibleonclick)) {
this.isIconVisibleOnClick = this.linked.scope.isIconVisibleOnClick;
}
markersScope = this.markerScope;
modelsNotDefined = angular.isUndefined(this.linked.scope.models);
if (modelsNotDefined && (markersScope === void 0 || (markersScope.markerModels === void 0 || markersScope.models === void 0))) {
this.$log.error("No models to create windows from! Need direct models or models derrived from markers!");
return;
}
if (this.gMap != null) {
if (this.linked.scope.models != null) {
this.watchIdKey(this.linked.scope);
if (isCreatingFromScratch) {
return this.createAllNewWindows(this.linked.scope, false);
} else {
return this.pieceMealWindows(this.linked.scope, false);
}
} else {
this.parentScope = markersScope;
this.watchIdKey(this.parentScope);
if (isCreatingFromScratch) {
return this.createAllNewWindows(markersScope, true, 'markerModels', false);
} else {
return this.pieceMealWindows(markersScope, true, 'markerModels', false);
}
}
}
};
WindowsParentModel.prototype.watchIdKey = function(scope) {
var _this = this;
this.setIdKey(scope);
return scope.$watch('idKey', function(newValue, oldValue) {
if (newValue !== oldValue && (newValue == null)) {
_this.idKey = newValue;
return _this.rebuildAll(scope, true, true);
}
});
};
WindowsParentModel.prototype.createAllNewWindows = function(scope, hasGMarker, modelsPropToIterate, isArray) {
var _this = this;
if (modelsPropToIterate == null) {
modelsPropToIterate = 'models';
}
if (isArray == null) {
isArray = false;
}
this.models = scope.models;
if (this.firstTime) {
this.watchModels(scope);
this.watchDestroy(scope);
}
this.setContentKeys(scope.models);
return _async.each(scope.models, function(model) {
var gMarker;
gMarker = hasGMarker ? scope[modelsPropToIterate][[model[_this.idKey]]].gMarker : void 0;
return _this.createWindow(model, gMarker, _this.gMap);
}, function() {
return _this.firstTime = false;
});
};
WindowsParentModel.prototype.pieceMealWindows = function(scope, hasGMarker, modelsPropToIterate, isArray) {
var _this = this;
if (modelsPropToIterate == null) {
modelsPropToIterate = 'models';
}
if (isArray == null) {
isArray = true;
}
this.models = scope.models;
if ((scope != null) && (scope.models != null) && scope.models.length > 0 && this.windows.length > 0) {
return this.figureOutState(this.idKey, scope, this.windows, this.modelKeyComparison, function(state) {
var payload;
payload = state;
return _async.each(payload.removals, function(child) {
if (child != null) {
if (child.destroy != null) {
child.destroy();
}
return _this.windows.remove(child.id);
}
}, function() {
return _async.each(payload.adds, function(modelToAdd) {
var gMarker;
gMarker = scope[modelsPropToIterate][modelToAdd[_this.idKey]].gMarker;
return _this.createWindow(modelToAdd, gMarker, _this.gMap);
}, function() {});
});
});
} else {
return this.rebuildAll(this.scope, true, true);
}
};
WindowsParentModel.prototype.setContentKeys = function(models) {
if (models.length > 0) {
return this.contentKeys = Object.keys(models[0]);
}
};
WindowsParentModel.prototype.createWindow = function(model, gMarker, gMap) {
var child, childScope, fakeElement, opts,
_this = this;
childScope = this.linked.scope.$new(false);
this.setChildScope(childScope, model);
childScope.$watch('model', function(newValue, oldValue) {
if (newValue !== oldValue) {
_this.setChildScope(childScope, newValue);
if (_this.markerScope) {
return _this.windows[newValue[_this.idKey]].markerCtrl = _this.markerScope.markerModels[newValue[_this.idKey]].gMarker;
}
}
}, true);
fakeElement = {
html: function() {
return _this.interpolateContent(_this.linked.element.html(), model);
}
};
opts = this.createWindowOptions(gMarker, childScope, fakeElement.html(), this.DEFAULTS);
child = new WindowChildModel(model, childScope, opts, this.isIconVisibleOnClick, gMap, gMarker, fakeElement, false, true);
if (model[this.idKey] == null) {
this.$log.error("Window model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key.");
return;
}
this.windows.put(model[this.idKey], child);
return child;
};
WindowsParentModel.prototype.setChildScope = function(childScope, model) {
var _this = this;
_.each(this.scopePropNames, function(name) {
var nameKey, newValue;
nameKey = name + 'Key';
newValue = _this[nameKey] === 'self' ? model : model[_this[nameKey]];
if (newValue !== childScope[name]) {
return childScope[name] = newValue;
}
});
return childScope.model = model;
};
WindowsParentModel.prototype.interpolateContent = function(content, model) {
var exp, interpModel, key, _i, _len, _ref;
if (this.contentKeys === void 0 || this.contentKeys.length === 0) {
return;
}
exp = this.$interpolate(content);
interpModel = {};
_ref = this.contentKeys;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
key = _ref[_i];
interpModel[key] = model[key];
}
return exp(interpModel);
};
return WindowsParentModel;
})(IWindowParentModel);
return WindowsParentModel;
}
]);
}).call(this);
(function() {
var __hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api").factory("Control", [
"IControl", "$http", "$templateCache", "$compile", "$controller", function(IControl, $http, $templateCache, $compile, $controller) {
var Control;
return Control = (function(_super) {
__extends(Control, _super);
function Control() {
var self;
Control.__super__.constructor.call(this);
self = this;
}
Control.prototype.link = function(scope, element, attrs, ctrl) {
var index, position,
_this = this;
if (angular.isUndefined(scope.template)) {
this.$log.error('mapControl: could not find a valid template property');
return;
}
index = angular.isDefined(scope.index && !isNaN(parseInt(scope.index))) ? parseInt(scope.index) : void 0;
position = angular.isDefined(scope.position) ? scope.position.toUpperCase().replace(/-/g, '_') : 'TOP_CENTER';
if (!google.maps.ControlPosition[position]) {
this.$log.error('mapControl: invalid position property');
return;
}
return IControl.mapPromise(scope, ctrl).then(function(map) {
var control, controlDiv;
control = void 0;
controlDiv = angular.element('<div></div>');
return $http.get(scope.template, {
cache: $templateCache
}).success(function(template) {
var templateCtrl, templateScope;
templateScope = scope.$new();
controlDiv.append(template);
if (index) {
controlDiv[0].index = index;
}
if (angular.isDefined(scope.controller)) {
templateCtrl = $controller(scope.controller, {
$scope: templateScope
});
controlDiv.children().data('$ngControllerController', templateCtrl);
}
return control = $compile(controlDiv.contents())(templateScope);
}).error(function(error) {
return _this.$log.error('mapControl: template could not be found');
}).then(function() {
return map.controls[google.maps.ControlPosition[position]].push(control[0]);
});
});
};
return Control;
})(IControl);
}
]);
}).call(this);
/*
- Link up Polygons to be sent back to a controller
- inject the draw function into a controllers scope so that controller can call the directive to draw on demand
- draw function creates the DrawFreeHandChildModel which manages itself
*/
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api").factory('FreeDrawPolygons', [
'Logger', 'BaseObject', 'CtrlHandle', 'DrawFreeHandChildModel', function($log, BaseObject, CtrlHandle, DrawFreeHandChildModel) {
var FreeDrawPolygons, _ref;
return FreeDrawPolygons = (function(_super) {
__extends(FreeDrawPolygons, _super);
function FreeDrawPolygons() {
this.link = __bind(this.link, this);
_ref = FreeDrawPolygons.__super__.constructor.apply(this, arguments);
return _ref;
}
FreeDrawPolygons.include(CtrlHandle);
FreeDrawPolygons.prototype.restrict = 'EA';
FreeDrawPolygons.prototype.replace = true;
FreeDrawPolygons.prototype.require = '^googleMap';
FreeDrawPolygons.prototype.scope = {
polygons: '=',
draw: '='
};
FreeDrawPolygons.prototype.link = function(scope, element, attrs, ctrl) {
var _this = this;
return this.mapPromise(scope, ctrl).then(function(map) {
var freeHand, listener;
if (!scope.polygons) {
return $log.error("No polygons to bind to!");
}
if (!_.isArray(scope.polygons)) {
return $log.error("Free Draw Polygons must be of type Array!");
}
freeHand = new DrawFreeHandChildModel(map, scope.originalMapOpts);
listener = void 0;
return scope.draw = function() {
if (typeof listener === "function") {
listener();
}
return freeHand.engage(scope.polygons).then(function() {
var firstTime;
firstTime = true;
return listener = scope.$watch('polygons', function(newValue, oldValue) {
var removals;
if (firstTime) {
firstTime = false;
return;
}
removals = _.differenceObjects(oldValue, newValue);
return removals.forEach(function(p) {
return p.setMap(null);
});
});
});
};
});
};
return FreeDrawPolygons;
})(BaseObject);
}
]);
}).call(this);
/*
- interface for all controls to derive from
- to enforce a minimum set of requirements
- attributes
- template
- position
- controller
- index
*/
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api").factory("IControl", [
"BaseObject", "Logger", "CtrlHandle", function(BaseObject, Logger, CtrlHandle) {
var IControl;
return IControl = (function(_super) {
__extends(IControl, _super);
IControl.extend(CtrlHandle);
function IControl() {
this.link = __bind(this.link, this);
this.restrict = 'EA';
this.replace = true;
this.require = '^googleMap';
this.scope = {
template: '@template',
position: '@position',
controller: '@controller',
index: '@index'
};
this.$log = Logger;
}
IControl.prototype.link = function(scope, element, attrs, ctrl) {
throw new Exception("Not implemented!!");
};
return IControl;
})(BaseObject);
}
]);
}).call(this);
/*
- interface for all labels to derrive from
- to enforce a minimum set of requirements
- attributes
- content
- anchor
- implementation needed on watches
*/
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api").factory("ILabel", [
"BaseObject", "Logger", function(BaseObject, Logger) {
var ILabel;
return ILabel = (function(_super) {
__extends(ILabel, _super);
function ILabel($timeout) {
this.link = __bind(this.link, this);
var self;
self = this;
this.restrict = 'EMA';
this.replace = true;
this.template = void 0;
this.require = void 0;
this.transclude = true;
this.priority = -100;
this.scope = {
labelContent: '=content',
labelAnchor: '@anchor',
labelClass: '@class',
labelStyle: '=style'
};
this.$log = Logger;
this.$timeout = $timeout;
}
ILabel.prototype.link = function(scope, element, attrs, ctrl) {
throw new Exception("Not Implemented!!");
};
return ILabel;
})(BaseObject);
}
]);
}).call(this);
/*
- interface for all markers to derrive from
- to enforce a minimum set of requirements
- attributes
- coords
- icon
- implementation needed on watches
*/
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api").factory("IMarker", [
"Logger", "BaseObject", "CtrlHandle", function(Logger, BaseObject, CtrlHandle) {
var IMarker;
return IMarker = (function(_super) {
__extends(IMarker, _super);
IMarker.extend(CtrlHandle);
function IMarker() {
this.link = __bind(this.link, this);
this.$log = Logger;
this.restrict = 'EMA';
this.require = '^googleMap';
this.priority = -1;
this.transclude = true;
this.replace = true;
this.scope = {
coords: '=coords',
icon: '=icon',
click: '&click',
options: '=options',
events: '=events',
fit: '=fit',
idKey: '=idkey',
control: '=control'
};
}
IMarker.prototype.link = function(scope, element, attrs, ctrl) {
if (!ctrl) {
throw new Error("No Map Control! Marker Directive Must be inside the map!");
}
};
return IMarker;
})(BaseObject);
}
]);
}).call(this);
(function() {
var __hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api").factory("IPolyline", [
"GmapUtil", "BaseObject", "Logger", 'CtrlHandle', function(GmapUtil, BaseObject, Logger, CtrlHandle) {
var IPolyline;
return IPolyline = (function(_super) {
__extends(IPolyline, _super);
IPolyline.include(GmapUtil);
IPolyline.extend(CtrlHandle);
function IPolyline() {}
IPolyline.prototype.restrict = "EA";
IPolyline.prototype.replace = true;
IPolyline.prototype.require = "^googleMap";
IPolyline.prototype.scope = {
path: "=",
stroke: "=",
clickable: "=",
draggable: "=",
editable: "=",
geodesic: "=",
icons: "=",
visible: "=",
"static": "=",
fit: "=",
events: "="
};
IPolyline.prototype.DEFAULTS = {};
IPolyline.prototype.$log = Logger;
return IPolyline;
})(BaseObject);
}
]);
}).call(this);
/*
- interface directive for all window(s) to derive from
*/
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api").factory("IWindow", [
"BaseObject", "ChildEvents", "Logger", function(BaseObject, ChildEvents, Logger) {
var IWindow;
return IWindow = (function(_super) {
__extends(IWindow, _super);
IWindow.include(ChildEvents);
function IWindow($timeout, $compile, $http, $templateCache) {
this.$timeout = $timeout;
this.$compile = $compile;
this.$http = $http;
this.$templateCache = $templateCache;
this.link = __bind(this.link, this);
this.restrict = 'EMA';
this.template = void 0;
this.transclude = true;
this.priority = -100;
this.require = void 0;
this.replace = true;
this.scope = {
coords: '=coords',
show: '=show',
templateUrl: '=templateurl',
templateParameter: '=templateparameter',
isIconVisibleOnClick: '=isiconvisibleonclick',
closeClick: '&closeclick',
options: '=options',
control: '=control'
};
this.$log = Logger;
}
IWindow.prototype.link = function(scope, element, attrs, ctrls) {
throw new Exception("Not Implemented!!");
};
return IWindow;
})(BaseObject);
}
]);
}).call(this);
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api").factory("Map", [
"$timeout", '$q', 'Logger', "GmapUtil", "BaseObject", "ExtendGWin", "CtrlHandle", 'IsReady'.ns(), "uuid".ns(), function($timeout, $q, Logger, GmapUtil, BaseObject, ExtendGWin, CtrlHandle, IsReady, uuid) {
"use strict";
var $log, DEFAULTS, Map;
$log = Logger;
DEFAULTS = {
mapTypeId: google.maps.MapTypeId.ROADMAP
};
return Map = (function(_super) {
__extends(Map, _super);
Map.include(GmapUtil);
function Map() {
this.link = __bind(this.link, this);
var ctrlFn, self;
ctrlFn = function($scope) {
var ctrlObj;
ctrlObj = CtrlHandle.handle($scope);
$scope.ctrlType = 'Map';
$scope.deferred.promise.then(function() {
return ExtendGWin.init();
});
return _.extend(ctrlObj, {
getMap: function() {
return $scope.map;
}
});
};
this.controller = ["$scope", ctrlFn];
self = this;
}
Map.prototype.restrict = "EMA";
Map.prototype.transclude = true;
Map.prototype.replace = false;
Map.prototype.template = '<div class="angular-google-map"><div class="angular-google-map-container"></div><div ng-transclude style="display: none"></div></div>';
Map.prototype.scope = {
center: "=",
zoom: "=",
dragging: "=",
control: "=",
windows: "=",
options: "=",
events: "=",
styles: "=",
bounds: "="
};
/*
@param scope
@param element
@param attrs
*/
Map.prototype.link = function(scope, element, attrs) {
var dragging, el, eventName, getEventHandler, mapOptions, opts, resolveSpawned, settingCenterFromScope, spawned, type, _m,
_this = this;
spawned = IsReady.spawn();
resolveSpawned = function() {
return spawned.deferred.resolve({
instance: spawned.instance,
map: _m
});
};
if (!this.validateCoords(scope.center)) {
$log.error("angular-google-maps: could not find a valid center property");
return;
}
if (!angular.isDefined(scope.zoom)) {
$log.error("angular-google-maps: map zoom property not set");
return;
}
el = angular.element(element);
el.addClass("angular-google-map");
opts = {
options: {}
};
if (attrs.options) {
opts.options = scope.options;
}
if (attrs.styles) {
opts.styles = scope.styles;
}
if (attrs.type) {
type = attrs.type.toUpperCase();
if (google.maps.MapTypeId.hasOwnProperty(type)) {
opts.mapTypeId = google.maps.MapTypeId[attrs.type.toUpperCase()];
} else {
$log.error("angular-google-maps: invalid map type \"" + attrs.type + "\"");
}
}
mapOptions = angular.extend({}, DEFAULTS, opts, {
center: this.getCoords(scope.center),
draggable: this.isTrue(attrs.draggable),
zoom: scope.zoom,
bounds: scope.bounds
});
_m = new google.maps.Map(el.find("div")[1], mapOptions);
_m.nggmap_id = uuid.generate();
dragging = false;
if (!_m) {
google.maps.event.addListener(_m, 'tilesloaded ', function(map) {
scope.deferred.resolve(map);
return resolveSpawned();
});
} else {
scope.deferred.resolve(_m);
resolveSpawned();
}
google.maps.event.addListener(_m, "dragstart", function() {
dragging = true;
return _.defer(function() {
return scope.$apply(function(s) {
if (s.dragging != null) {
return s.dragging = dragging;
}
});
});
});
google.maps.event.addListener(_m, "dragend", function() {
dragging = false;
return _.defer(function() {
return scope.$apply(function(s) {
if (s.dragging != null) {
return s.dragging = dragging;
}
});
});
});
google.maps.event.addListener(_m, "drag", function() {
var c;
c = _m.center;
return _.defer(function() {
return scope.$apply(function(s) {
if (angular.isDefined(s.center.type)) {
s.center.coordinates[1] = c.lat();
return s.center.coordinates[0] = c.lng();
} else {
s.center.latitude = c.lat();
return s.center.longitude = c.lng();
}
});
});
});
google.maps.event.addListener(_m, "zoom_changed", function() {
if (scope.zoom !== _m.zoom) {
return _.defer(function() {
return scope.$apply(function(s) {
return s.zoom = _m.zoom;
});
});
}
});
settingCenterFromScope = false;
google.maps.event.addListener(_m, "center_changed", function() {
var c;
c = _m.center;
if (settingCenterFromScope) {
return;
}
return _.defer(function() {
return scope.$apply(function(s) {
if (!_m.dragging) {
if (angular.isDefined(s.center.type)) {
if (s.center.coordinates[1] !== c.lat()) {
s.center.coordinates[1] = c.lat();
}
if (s.center.coordinates[0] !== c.lng()) {
return s.center.coordinates[0] = c.lng();
}
} else {
if (s.center.latitude !== c.lat()) {
s.center.latitude = c.lat();
}
if (s.center.longitude !== c.lng()) {
return s.center.longitude = c.lng();
}
}
}
});
});
});
google.maps.event.addListener(_m, "idle", function() {
var b, ne, sw;
b = _m.getBounds();
ne = b.getNorthEast();
sw = b.getSouthWest();
return _.defer(function() {
return scope.$apply(function(s) {
if (s.bounds !== null && s.bounds !== undefined && s.bounds !== void 0) {
s.bounds.northeast = {
latitude: ne.lat(),
longitude: ne.lng()
};
return s.bounds.southwest = {
latitude: sw.lat(),
longitude: sw.lng()
};
}
});
});
});
if (angular.isDefined(scope.events) && scope.events !== null && angular.isObject(scope.events)) {
getEventHandler = function(eventName) {
return function() {
return scope.events[eventName].apply(scope, [_m, eventName, arguments]);
};
};
for (eventName in scope.events) {
if (scope.events.hasOwnProperty(eventName) && angular.isFunction(scope.events[eventName])) {
google.maps.event.addListener(_m, eventName, getEventHandler(eventName));
}
}
}
_m.getOptions = function() {
return mapOptions;
};
scope.map = _m;
if ((attrs.control != null) && (scope.control != null)) {
scope.control.refresh = function(maybeCoords) {
var coords;
if (_m == null) {
return;
}
google.maps.event.trigger(_m, "resize");
if (((maybeCoords != null ? maybeCoords.latitude : void 0) != null) && ((maybeCoords != null ? maybeCoords.latitude : void 0) != null)) {
coords = _this.getCoords(maybeCoords);
if (_this.isTrue(attrs.pan)) {
return _m.panTo(coords);
} else {
return _m.setCenter(coords);
}
}
};
/*
I am sure you all will love this. You want the instance here you go.. BOOM!
*/
scope.control.getGMap = function() {
return _m;
};
scope.control.getMapOptions = function() {
return mapOptions;
};
}
scope.$watch("center", (function(newValue, oldValue) {
var coords;
coords = _this.getCoords(newValue);
if (coords.lat() === _m.center.lat() && coords.lng() === _m.center.lng()) {
return;
}
settingCenterFromScope = true;
if (!dragging) {
if (!_this.validateCoords(newValue)) {
$log.error("Invalid center for newValue: " + (JSON.stringify(newValue)));
}
if (_this.isTrue(attrs.pan) && scope.zoom === _m.zoom) {
_m.panTo(coords);
} else {
_m.setCenter(coords);
}
}
return settingCenterFromScope = false;
}), true);
scope.$watch("zoom", function(newValue, oldValue) {
if (newValue === _m.zoom) {
return;
}
return _.defer(function() {
return _m.setZoom(newValue);
});
});
scope.$watch("bounds", function(newValue, oldValue) {
var bounds, ne, sw;
if (newValue === oldValue) {
return;
}
if ((newValue.northeast.latitude == null) || (newValue.northeast.longitude == null) || (newValue.southwest.latitude == null) || (newValue.southwest.longitude == null)) {
$log.error("Invalid map bounds for new value: " + (JSON.stringify(newValue)));
return;
}
ne = new google.maps.LatLng(newValue.northeast.latitude, newValue.northeast.longitude);
sw = new google.maps.LatLng(newValue.southwest.latitude, newValue.southwest.longitude);
bounds = new google.maps.LatLngBounds(sw, ne);
return _m.fitBounds(bounds);
});
scope.$watch("options", function(newValue, oldValue) {
if (!_.isEqual(newValue, oldValue)) {
opts.options = newValue;
if (_m != null) {
return _m.setOptions(opts);
}
}
}, true);
return scope.$watch("styles", function(newValue, oldValue) {
if (!_.isEqual(newValue, oldValue)) {
opts.styles = newValue;
if (_m != null) {
return _m.setOptions(opts);
}
}
}, true);
};
return Map;
})(BaseObject);
}
]);
}).call(this);
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api").factory("Marker", [
"IMarker", "MarkerParentModel", "MarkerManager", function(IMarker, MarkerParentModel, MarkerManager) {
var Marker;
return Marker = (function(_super) {
var _this = this;
__extends(Marker, _super);
function Marker() {
this.link = __bind(this.link, this);
Marker.__super__.constructor.call(this);
this.template = '<span class="angular-google-map-marker" ng-transclude></span>';
this.$log.info(this);
}
Marker.prototype.controller = [
'$scope', '$element', function($scope, $element) {
$scope.ctrlType = 'Marker';
return IMarker.handle($scope, $element);
}
];
Marker.prototype.link = function(scope, element, attrs, ctrl) {
var doFit,
_this = this;
if (scope.fit) {
doFit = true;
}
return IMarker.mapPromise(scope, ctrl).then(function(map) {
if (!_this.gMarkerManager) {
_this.gMarkerManager = new MarkerManager(map);
}
new MarkerParentModel(scope, element, attrs, map, _this.$timeout, _this.gMarkerManager, doFit);
scope.deferred.resolve();
if (scope.control != null) {
return scope.control.getGMarkers = _this.gMarkerManager.getGMarkers;
}
});
};
return Marker;
}).call(this, IMarker);
}
]);
}).call(this);
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api").factory("Markers", [
"IMarker", "MarkersParentModel", function(IMarker, MarkersParentModel) {
var Markers;
return Markers = (function(_super) {
__extends(Markers, _super);
function Markers($timeout) {
this.link = __bind(this.link, this);
Markers.__super__.constructor.call(this, $timeout);
this.template = '<span class="angular-google-map-markers" ng-transclude></span>';
this.scope = _.extend(this.scope || {}, {
idKey: '=idkey',
doRebuildAll: '=dorebuildall',
models: '=models',
doCluster: '=docluster',
clusterOptions: '=clusteroptions',
clusterEvents: '=clusterevents',
isLabel: '=islabel'
});
this.$timeout = $timeout;
this.$log.info(this);
}
Markers.prototype.controller = [
'$scope', '$element', function($scope, $element) {
$scope.ctrlType = 'Markers';
return IMarker.handle($scope, $element);
}
];
Markers.prototype.link = function(scope, element, attrs, ctrl) {
var _this = this;
return IMarker.mapPromise(scope, ctrl).then(function(map) {
var parentModel;
parentModel = new MarkersParentModel(scope, element, attrs, map, _this.$timeout);
scope.deferred.resolve();
if (scope.control != null) {
scope.control.getGMarkers = function() {
var _ref;
return (_ref = parentModel.gMarkerManager) != null ? _ref.getGMarkers() : void 0;
};
return scope.control.getChildMarkers = function() {
return parentModel.markerModels;
};
}
});
};
return Markers;
})(IMarker);
}
]);
}).call(this);
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api").factory("Polyline", [
"IPolyline", "$timeout", "array-sync", "PolylineChildModel", function(IPolyline, $timeout, arraySync, PolylineChildModel) {
var Polyline, _ref;
return Polyline = (function(_super) {
__extends(Polyline, _super);
function Polyline() {
this.link = __bind(this.link, this);
_ref = Polyline.__super__.constructor.apply(this, arguments);
return _ref;
}
Polyline.prototype.link = function(scope, element, attrs, mapCtrl) {
var _this = this;
if (angular.isUndefined(scope.path) || scope.path === null || !this.validatePath(scope.path)) {
this.$log.error("polyline: no valid path attribute found");
return;
}
return IPolyline.mapPromise(scope, mapCtrl).then(function(map) {
return new PolylineChildModel(scope, attrs, map, _this.DEFAULTS);
});
};
return Polyline;
})(IPolyline);
}
]);
}).call(this);
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api").factory("Polylines", [
"IPolyline", "$timeout", "array-sync", "PolylinesParentModel", function(IPolyline, $timeout, arraySync, PolylinesParentModel) {
var Polylines;
return Polylines = (function(_super) {
__extends(Polylines, _super);
function Polylines() {
this.link = __bind(this.link, this);
Polylines.__super__.constructor.call(this);
this.scope.idKey = '=idkey';
this.scope.models = '=models';
this.$log.info(this);
}
Polylines.prototype.link = function(scope, element, attrs, mapCtrl) {
var _this = this;
if (angular.isUndefined(scope.path) || scope.path === null) {
this.$log.error("polylines: no valid path attribute found");
return;
}
if (!scope.models) {
this.$log.error("polylines: no models found to create from");
return;
}
return mapCtrl.getScope().deferred.promise.then(function(map) {
return new PolylinesParentModel(scope, element, attrs, map, _this.DEFAULTS);
});
};
return Polylines;
})(IPolyline);
}
]);
}).call(this);
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api").factory("Window", [
"IWindow", "GmapUtil", "WindowChildModel", function(IWindow, GmapUtil, WindowChildModel) {
var Window;
return Window = (function(_super) {
__extends(Window, _super);
Window.include(GmapUtil);
function Window($timeout, $compile, $http, $templateCache) {
this.init = __bind(this.init, this);
this.link = __bind(this.link, this);
Window.__super__.constructor.call(this, $timeout, $compile, $http, $templateCache);
this.require = ['^googleMap', '^?marker'];
this.template = '<span class="angular-google-maps-window" ng-transclude></span>';
this.$log.info(this);
this.childWindows = [];
}
Window.prototype.link = function(scope, element, attrs, ctrls) {
var mapScope,
_this = this;
mapScope = ctrls[0].getScope();
return mapScope.deferred.promise.then(function(mapCtrl) {
var isIconVisibleOnClick, markerCtrl, markerScope;
isIconVisibleOnClick = true;
if (angular.isDefined(attrs.isiconvisibleonclick)) {
isIconVisibleOnClick = scope.isIconVisibleOnClick;
}
markerCtrl = ctrls.length > 1 && (ctrls[1] != null) ? ctrls[1] : void 0;
if (!markerCtrl) {
_this.init(scope, element, isIconVisibleOnClick, mapCtrl);
return;
}
markerScope = markerCtrl.getScope();
return markerScope.deferred.promise.then(function() {
return _this.init(scope, element, isIconVisibleOnClick, mapCtrl, markerScope);
});
});
};
Window.prototype.init = function(scope, element, isIconVisibleOnClick, mapCtrl, markerScope) {
var defaults, gMarker, hasScopeCoords, opts, window,
_this = this;
defaults = scope.options != null ? scope.options : {};
hasScopeCoords = (scope != null) && this.validateCoords(scope.coords);
if (markerScope != null) {
gMarker = markerScope.gMarker;
markerScope.$watch('coords', function(newValue, oldValue) {
if ((markerScope.gMarker != null) && !window.markerCtrl) {
window.markerCtrl = gMarker;
window.handleClick(true);
}
if (!_this.validateCoords(newValue)) {
return window.hideWindow();
}
if (!angular.equals(newValue, oldValue)) {
return window.getLatestPosition(_this.getCoords(newValue));
}
}, true);
}
opts = hasScopeCoords ? this.createWindowOptions(gMarker, scope, element.html(), defaults) : defaults;
if (mapCtrl != null) {
window = new WindowChildModel({}, scope, opts, isIconVisibleOnClick, mapCtrl, gMarker, element);
this.childWindows.push(window);
scope.$on("$destroy", function() {
return _this.childWindows = _.withoutObjects(_this.childWindows, [window], function(child1, child2) {
return child1.scope.$id === child2.scope.$id;
});
});
}
if (scope.control != null) {
scope.control.getGWindows = function() {
return _this.childWindows.map(function(child) {
return child.gWin;
});
};
scope.control.getChildWindows = function() {
return _this.childWindows;
};
}
if ((this.onChildCreation != null) && (window != null)) {
return this.onChildCreation(window);
}
};
return Window;
})(IWindow);
}
]);
}).call(this);
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps.directives.api").factory("Windows", [
"IWindow", "WindowsParentModel", function(IWindow, WindowsParentModel) {
/*
Windows directive where many windows map to the models property
*/
var Windows;
return Windows = (function(_super) {
__extends(Windows, _super);
function Windows($timeout, $compile, $http, $templateCache, $interpolate) {
this.link = __bind(this.link, this);
var self;
Windows.__super__.constructor.call(this, $timeout, $compile, $http, $templateCache);
self = this;
this.$interpolate = $interpolate;
this.require = ['^googleMap', '^?markers'];
this.template = '<span class="angular-google-maps-windows" ng-transclude></span>';
this.scope.idKey = '=idkey';
this.scope.doRebuildAll = '=dorebuildall';
this.scope.models = '=models';
this.$log.info(this);
}
Windows.prototype.link = function(scope, element, attrs, ctrls) {
var parentModel,
_this = this;
parentModel = new WindowsParentModel(scope, element, attrs, ctrls, this.$timeout, this.$compile, this.$http, this.$templateCache, this.$interpolate);
if (scope.control != null) {
scope.control.getGWindows = function() {
return parentModel.windows.map(function(child) {
return child.gWin;
});
};
return scope.control.getChildWindows = function() {
return parentModel.windows;
};
}
};
return Windows;
})(IWindow);
}
]);
}).call(this);
/*
!
The MIT License
Copyright (c) 2010-2013 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
angular-google-maps
https://github.com/nlaplante/angular-google-maps
@authors
Nicolas Laplante - https://plus.google.com/108189012221374960701
Nicholas McCready - https://twitter.com/nmccready
Nick Baugh - https://github.com/niftylettuce
*/
(function() {
angular.module("google-maps").directive("googleMap", [
"Map", function(Map) {
return new Map();
}
]);
}).call(this);
/*
!
The MIT License
Copyright (c) 2010-2013 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
angular-google-maps
https://github.com/nlaplante/angular-google-maps
@authors
Nicolas Laplante - https://plus.google.com/108189012221374960701
Nicholas McCready - https://twitter.com/nmccready
*/
/*
Map marker directive
This directive is used to create a marker on an existing map.
This directive creates a new scope.
{attribute coords required} object containing latitude and longitude properties
{attribute icon optional} string url to image used for marker icon
{attribute animate optional} if set to false, the marker won't be animated (on by default)
*/
(function() {
angular.module("google-maps").directive("marker", [
"$timeout", "Marker", function($timeout, Marker) {
return new Marker($timeout);
}
]);
}).call(this);
/*
!
The MIT License
Copyright (c) 2010-2013 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
angular-google-maps
https://github.com/nlaplante/angular-google-maps
@authors
Nicolas Laplante - https://plus.google.com/108189012221374960701
Nicholas McCready - https://twitter.com/nmccready
*/
/*
Map marker directive
This directive is used to create a marker on an existing map.
This directive creates a new scope.
{attribute coords required} object containing latitude and longitude properties
{attribute icon optional} string url to image used for marker icon
{attribute animate optional} if set to false, the marker won't be animated (on by default)
*/
(function() {
angular.module("google-maps").directive("markers", [
"$timeout", "Markers", function($timeout, Markers) {
return new Markers($timeout);
}
]);
}).call(this);
/*
!
The MIT License
Copyright (c) 2010-2013 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
angular-google-maps
https://github.com/nlaplante/angular-google-maps
@authors Bruno Queiroz, creativelikeadog@gmail.com
*/
/*
Marker label directive
This directive is used to create a marker label on an existing map.
{attribute content required} content of the label
{attribute anchor required} string that contains the x and y point position of the label
{attribute class optional} class to DOM object
{attribute style optional} style for the label
*/
/*
Basic Directive api for a label. Basic in the sense that this directive contains 1:1 on scope and model.
Thus there will be one html element per marker within the directive.
*/
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
angular.module("google-maps").directive("markerLabel", [
"$timeout", "ILabel", "MarkerLabelChildModel", "GmapUtil", "nggmap-PropertyAction", function($timeout, ILabel, MarkerLabelChildModel, GmapUtil, PropertyAction) {
var Label;
Label = (function(_super) {
__extends(Label, _super);
function Label($timeout) {
this.init = __bind(this.init, this);
this.link = __bind(this.link, this);
var self;
Label.__super__.constructor.call(this, $timeout);
self = this;
this.require = '^marker';
this.template = '<span class="angular-google-maps-marker-label" ng-transclude></span>';
this.$log.info(this);
}
Label.prototype.link = function(scope, element, attrs, ctrl) {
var markerScope,
_this = this;
markerScope = ctrl.getScope();
if (markerScope) {
return markerScope.deferred.promise.then(function() {
return _this.init(markerScope, scope);
});
}
};
Label.prototype.init = function(markerScope, scope) {
var createLabel, isFirstSet, label;
label = null;
createLabel = function() {
if (!label) {
return label = new MarkerLabelChildModel(markerScope.gMarker, scope, markerScope.map);
}
};
isFirstSet = true;
return markerScope.$watch('gMarker', function(newVal, oldVal) {
var anchorAction, classAction, contentAction, styleAction;
if (markerScope.gMarker != null) {
contentAction = new PropertyAction(function(newVal) {
createLabel();
if (scope.labelContent) {
return label != null ? label.setOption('labelContent', scope.labelContent) : void 0;
}
}, isFirstSet);
anchorAction = new PropertyAction(function(newVal) {
createLabel();
return label != null ? label.setOption('labelAnchor', scope.labelAnchor) : void 0;
}, isFirstSet);
classAction = new PropertyAction(function(newVal) {
createLabel();
return label != null ? label.setOption('labelClass', scope.labelClass) : void 0;
}, isFirstSet);
styleAction = new PropertyAction(function(newVal) {
createLabel();
return label != null ? label.setOption('labelStyle', scope.labelStyle) : void 0;
}, isFirstSet);
scope.$watch('labelContent', contentAction.sic);
scope.$watch('labelAnchor', anchorAction.sic);
scope.$watch('labelClass', classAction.sic);
scope.$watch('labelStyle', styleAction.sic);
isFirstSet = false;
}
return scope.$on('$destroy', function() {
return label != null ? label.destroy() : void 0;
});
});
};
return Label;
})(ILabel);
return new Label($timeout);
}
]);
}).call(this);
/*
!
The MIT License
Copyright (c) 2010-2013 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
angular-google-maps
https://github.com/nlaplante/angular-google-maps
@authors
Nicolas Laplante - https://plus.google.com/108189012221374960701
Nicholas McCready - https://twitter.com/nmccready
Rick Huizinga - https://plus.google.com/+RickHuizinga
*/
(function() {
angular.module("google-maps").directive("polygon", [
"$log", "$timeout", "array-sync", "GmapUtil", function($log, $timeout, arraySync, GmapUtil) {
/*
Check if a value is true
*/
var DEFAULTS, isTrue;
isTrue = function(val) {
return angular.isDefined(val) && val !== null && val === true || val === "1" || val === "y" || val === "true";
};
"use strict";
DEFAULTS = {};
return {
restrict: "EA",
replace: true,
require: "^googleMap",
scope: {
path: "=path",
stroke: "=stroke",
clickable: "=",
draggable: "=",
editable: "=",
geodesic: "=",
fill: "=",
icons: "=icons",
visible: "=",
"static": "=",
events: "=",
zIndex: "=zindex",
fit: "="
},
link: function(scope, element, attrs, mapCtrl) {
var _this = this;
if (angular.isUndefined(scope.path) || scope.path === null || !GmapUtil.validatePath(scope.path)) {
$log.error("polygon: no valid path attribute found");
return;
}
return mapCtrl.getScope().deferred.promise.then(function(map) {
var arraySyncer, buildOpts, eventName, getEventHandler, pathPoints, polygon;
buildOpts = function(pathPoints) {
var opts;
opts = angular.extend({}, DEFAULTS, {
map: map,
path: pathPoints,
strokeColor: scope.stroke && scope.stroke.color,
strokeOpacity: scope.stroke && scope.stroke.opacity,
strokeWeight: scope.stroke && scope.stroke.weight,
fillColor: scope.fill && scope.fill.color,
fillOpacity: scope.fill && scope.fill.opacity
});
angular.forEach({
clickable: true,
draggable: false,
editable: false,
geodesic: false,
visible: true,
"static": false,
fit: false,
zIndex: 0
}, function(defaultValue, key) {
if (angular.isUndefined(scope[key]) || scope[key] === null) {
return opts[key] = defaultValue;
} else {
return opts[key] = scope[key];
}
});
if (opts["static"]) {
opts.editable = false;
}
return opts;
};
pathPoints = GmapUtil.convertPathPoints(scope.path);
polygon = new google.maps.Polygon(buildOpts(pathPoints));
if (scope.fit) {
GmapUtil.extendMapBounds(map, pathPoints);
}
if (!scope["static"] && angular.isDefined(scope.editable)) {
scope.$watch("editable", function(newValue, oldValue) {
if (newValue !== oldValue) {
return polygon.setEditable(newValue);
}
});
}
if (angular.isDefined(scope.draggable)) {
scope.$watch("draggable", function(newValue, oldValue) {
if (newValue !== oldValue) {
return polygon.setDraggable(newValue);
}
});
}
if (angular.isDefined(scope.visible)) {
scope.$watch("visible", function(newValue, oldValue) {
if (newValue !== oldValue) {
return polygon.setVisible(newValue);
}
});
}
if (angular.isDefined(scope.geodesic)) {
scope.$watch("geodesic", function(newValue, oldValue) {
if (newValue !== oldValue) {
return polygon.setOptions(buildOpts(polygon.getPath()));
}
});
}
if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.opacity)) {
scope.$watch("stroke.opacity", function(newValue, oldValue) {
return polygon.setOptions(buildOpts(polygon.getPath()));
});
}
if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.weight)) {
scope.$watch("stroke.weight", function(newValue, oldValue) {
if (newValue !== oldValue) {
return polygon.setOptions(buildOpts(polygon.getPath()));
}
});
}
if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.color)) {
scope.$watch("stroke.color", function(newValue, oldValue) {
if (newValue !== oldValue) {
return polygon.setOptions(buildOpts(polygon.getPath()));
}
});
}
if (angular.isDefined(scope.fill) && angular.isDefined(scope.fill.color)) {
scope.$watch("fill.color", function(newValue, oldValue) {
if (newValue !== oldValue) {
return polygon.setOptions(buildOpts(polygon.getPath()));
}
});
}
if (angular.isDefined(scope.fill) && angular.isDefined(scope.fill.opacity)) {
scope.$watch("fill.opacity", function(newValue, oldValue) {
if (newValue !== oldValue) {
return polygon.setOptions(buildOpts(polygon.getPath()));
}
});
}
if (angular.isDefined(scope.zIndex)) {
scope.$watch("zIndex", function(newValue, oldValue) {
if (newValue !== oldValue) {
return polygon.setOptions(buildOpts(polygon.getPath()));
}
});
}
if (angular.isDefined(scope.events) && scope.events !== null && angular.isObject(scope.events)) {
getEventHandler = function(eventName) {
return function() {
return scope.events[eventName].apply(scope, [polygon, eventName, arguments]);
};
};
for (eventName in scope.events) {
if (scope.events.hasOwnProperty(eventName) && angular.isFunction(scope.events[eventName])) {
polygon.addListener(eventName, getEventHandler(eventName));
}
}
}
arraySyncer = arraySync(polygon.getPath(), scope, "path", function(pathPoints) {
if (scope.fit) {
return GmapUtil.extendMapBounds(map, pathPoints);
}
});
return scope.$on("$destroy", function() {
polygon.setMap(null);
if (arraySyncer) {
arraySyncer();
return arraySyncer = null;
}
});
});
}
};
}
]);
}).call(this);
/*
!
The MIT License
Copyright (c) 2010-2013 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@authors
Julian Popescu - https://github.com/jpopesculian
Rick Huizinga - https://plus.google.com/+RickHuizinga
*/
(function() {
angular.module("google-maps").directive("circle", [
"$log", "$timeout", "GmapUtil", "EventsHelper", function($log, $timeout, GmapUtil, EventsHelper) {
"use strict";
var DEFAULTS;
DEFAULTS = {};
return {
restrict: "EA",
replace: true,
require: "^googleMap",
scope: {
center: "=center",
radius: "=radius",
stroke: "=stroke",
fill: "=fill",
clickable: "=",
draggable: "=",
editable: "=",
geodesic: "=",
icons: "=icons",
visible: "=",
events: "="
},
link: function(scope, element, attrs, mapCtrl) {
var _this = this;
return mapCtrl.getScope().deferred.promise.then(function(map) {
var buildOpts, circle;
buildOpts = function() {
var opts;
if (!GmapUtil.validateCoords(scope.center)) {
$log.error("circle: no valid center attribute found");
return;
}
opts = angular.extend({}, DEFAULTS, {
map: map,
center: GmapUtil.getCoords(scope.center),
radius: scope.radius,
strokeColor: scope.stroke && scope.stroke.color,
strokeOpacity: scope.stroke && scope.stroke.opacity,
strokeWeight: scope.stroke && scope.stroke.weight,
fillColor: scope.fill && scope.fill.color,
fillOpacity: scope.fill && scope.fill.opacity
});
angular.forEach({
clickable: true,
draggable: false,
editable: false,
geodesic: false,
visible: true
}, function(defaultValue, key) {
if (angular.isUndefined(scope[key]) || scope[key] === null) {
return opts[key] = defaultValue;
} else {
return opts[key] = scope[key];
}
});
return opts;
};
circle = new google.maps.Circle(buildOpts());
scope.$watchCollection('center', function(newVals, oldVals) {
if (newVals !== oldVals) {
return circle.setOptions(buildOpts());
}
});
scope.$watchCollection('stroke', function(newVals, oldVals) {
if (newVals !== oldVals) {
return circle.setOptions(buildOpts());
}
});
scope.$watchCollection('fill', function(newVals, oldVals) {
if (newVals !== oldVals) {
return circle.setOptions(buildOpts());
}
});
scope.$watch('radius', function(newVal, oldVal) {
if (newVal !== oldVal) {
return circle.setOptions(buildOpts());
}
});
scope.$watch('clickable', function(newVal, oldVal) {
if (newVal !== oldVal) {
return circle.setOptions(buildOpts());
}
});
scope.$watch('editable', function(newVal, oldVal) {
if (newVal !== oldVal) {
return circle.setOptions(buildOpts());
}
});
scope.$watch('draggable', function(newVal, oldVal) {
if (newVal !== oldVal) {
return circle.setOptions(buildOpts());
}
});
scope.$watch('visible', function(newVal, oldVal) {
if (newVal !== oldVal) {
return circle.setOptions(buildOpts());
}
});
scope.$watch('geodesic', function(newVal, oldVal) {
if (newVal !== oldVal) {
return circle.setOptions(buildOpts());
}
});
EventsHelper.setEvents(circle, scope, scope);
google.maps.event.addListener(circle, 'radius_changed', function() {
scope.radius = circle.getRadius();
return $timeout(function() {
return scope.$apply();
});
});
google.maps.event.addListener(circle, 'center_changed', function() {
if (angular.isDefined(scope.center.type)) {
scope.center.coordinates[1] = circle.getCenter().lat();
scope.center.coordinates[0] = circle.getCenter().lng();
} else {
scope.center.latitude = circle.getCenter().lat();
scope.center.longitude = circle.getCenter().lng();
}
return $timeout(function() {
return scope.$apply();
});
});
return scope.$on("$destroy", function() {
return circle.setMap(null);
});
});
}
};
}
]);
}).call(this);
/*
!
The MIT License
Copyright (c) 2010-2013 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
angular-google-maps
https://github.com/nlaplante/angular-google-maps
@authors
Nicolas Laplante - https://plus.google.com/108189012221374960701
Nicholas McCready - https://twitter.com/nmccready
*/
(function() {
angular.module("google-maps").directive("polyline", [
"Polyline", function(Polyline) {
return new Polyline();
}
]);
}).call(this);
/*
!
The MIT License
Copyright (c) 2010-2013 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
angular-google-maps
https://github.com/nlaplante/angular-google-maps
@authors
Nicolas Laplante - https://plus.google.com/108189012221374960701
Nicholas McCready - https://twitter.com/nmccready
*/
(function() {
angular.module("google-maps").directive("polylines", [
"Polylines", function(Polylines) {
return new Polylines();
}
]);
}).call(this);
/*
!
The MIT License
Copyright (c) 2010-2013 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
angular-google-maps
https://github.com/nlaplante/angular-google-maps
@authors
Nicolas Laplante - https://plus.google.com/108189012221374960701
Nicholas McCready - https://twitter.com/nmccready
Chentsu Lin - https://github.com/ChenTsuLin
*/
(function() {
angular.module("google-maps").directive("rectangle", [
"$log", "$timeout", function($log, $timeout) {
var DEFAULTS, convertBoundPoints, fitMapBounds, isTrue, validateBoundPoints;
validateBoundPoints = function(bounds) {
if (angular.isUndefined(bounds.sw.latitude) || angular.isUndefined(bounds.sw.longitude) || angular.isUndefined(bounds.ne.latitude) || angular.isUndefined(bounds.ne.longitude)) {
return false;
}
return true;
};
convertBoundPoints = function(bounds) {
var result;
result = new google.maps.LatLngBounds(new google.maps.LatLng(bounds.sw.latitude, bounds.sw.longitude), new google.maps.LatLng(bounds.ne.latitude, bounds.ne.longitude));
return result;
};
fitMapBounds = function(map, bounds) {
return map.fitBounds(bounds);
};
/*
Check if a value is true
*/
isTrue = function(val) {
return angular.isDefined(val) && val !== null && val === true || val === "1" || val === "y" || val === "true";
};
"use strict";
DEFAULTS = {};
return {
restrict: "ECA",
require: "^googleMap",
replace: true,
scope: {
bounds: "=",
stroke: "=",
clickable: "=",
draggable: "=",
editable: "=",
fill: "=",
visible: "="
},
link: function(scope, element, attrs, mapCtrl) {
var _this = this;
if (angular.isUndefined(scope.bounds) || scope.bounds === null || angular.isUndefined(scope.bounds.sw) || scope.bounds.sw === null || angular.isUndefined(scope.bounds.ne) || scope.bounds.ne === null || !validateBoundPoints(scope.bounds)) {
$log.error("rectangle: no valid bound attribute found");
return;
}
return mapCtrl.getScope().deferred.promise.then(function(map) {
var buildOpts, dragging, rectangle, settingBoundsFromScope;
buildOpts = function(bounds) {
var opts;
opts = angular.extend({}, DEFAULTS, {
map: map,
bounds: bounds,
strokeColor: scope.stroke && scope.stroke.color,
strokeOpacity: scope.stroke && scope.stroke.opacity,
strokeWeight: scope.stroke && scope.stroke.weight,
fillColor: scope.fill && scope.fill.color,
fillOpacity: scope.fill && scope.fill.opacity
});
angular.forEach({
clickable: true,
draggable: false,
editable: false,
visible: true
}, function(defaultValue, key) {
if (angular.isUndefined(scope[key]) || scope[key] === null) {
return opts[key] = defaultValue;
} else {
return opts[key] = scope[key];
}
});
return opts;
};
rectangle = new google.maps.Rectangle(buildOpts(convertBoundPoints(scope.bounds)));
if (isTrue(attrs.fit)) {
fitMapBounds(map, bounds);
}
dragging = false;
google.maps.event.addListener(rectangle, "mousedown", function() {
google.maps.event.addListener(rectangle, "mousemove", function() {
dragging = true;
return _.defer(function() {
return scope.$apply(function(s) {
if (s.dragging != null) {
return s.dragging = dragging;
}
});
});
});
google.maps.event.addListener(rectangle, "mouseup", function() {
google.maps.event.clearListeners(rectangle, 'mousemove');
google.maps.event.clearListeners(rectangle, 'mouseup');
dragging = false;
return _.defer(function() {
return scope.$apply(function(s) {
if (s.dragging != null) {
return s.dragging = dragging;
}
});
});
});
});
settingBoundsFromScope = false;
google.maps.event.addListener(rectangle, "bounds_changed", function() {
var b, ne, sw;
b = rectangle.getBounds();
ne = b.getNorthEast();
sw = b.getSouthWest();
if (settingBoundsFromScope) {
return;
}
return _.defer(function() {
return scope.$apply(function(s) {
if (!rectangle.dragging) {
if (s.bounds !== null && s.bounds !== undefined && s.bounds !== void 0) {
s.bounds.ne = {
latitude: ne.lat(),
longitude: ne.lng()
};
s.bounds.sw = {
latitude: sw.lat(),
longitude: sw.lng()
};
}
}
});
});
});
scope.$watch("bounds", (function(newValue, oldValue) {
var bounds;
if (_.isEqual(newValue, oldValue)) {
return;
}
settingBoundsFromScope = true;
if (!dragging) {
if ((newValue.sw.latitude == null) || (newValue.sw.longitude == null) || (newValue.ne.latitude == null) || (newValue.ne.longitude == null)) {
$log.error("Invalid bounds for newValue: " + (JSON.stringify(newValue)));
}
bounds = new google.maps.LatLngBounds(new google.maps.LatLng(newValue.sw.latitude, newValue.sw.longitude), new google.maps.LatLng(newValue.ne.latitude, newValue.ne.longitude));
rectangle.setBounds(bounds);
}
return settingBoundsFromScope = false;
}), true);
if (angular.isDefined(scope.editable)) {
scope.$watch("editable", function(newValue, oldValue) {
return rectangle.setEditable(newValue);
});
}
if (angular.isDefined(scope.draggable)) {
scope.$watch("draggable", function(newValue, oldValue) {
return rectangle.setDraggable(newValue);
});
}
if (angular.isDefined(scope.visible)) {
scope.$watch("visible", function(newValue, oldValue) {
return rectangle.setVisible(newValue);
});
}
if (angular.isDefined(scope.stroke)) {
if (angular.isDefined(scope.stroke.color)) {
scope.$watch("stroke.color", function(newValue, oldValue) {
return rectangle.setOptions(buildOpts(rectangle.getBounds()));
});
}
if (angular.isDefined(scope.stroke.weight)) {
scope.$watch("stroke.weight", function(newValue, oldValue) {
return rectangle.setOptions(buildOpts(rectangle.getBounds()));
});
}
if (angular.isDefined(scope.stroke.opacity)) {
scope.$watch("stroke.opacity", function(newValue, oldValue) {
return rectangle.setOptions(buildOpts(rectangle.getBounds()));
});
}
}
if (angular.isDefined(scope.fill)) {
if (angular.isDefined(scope.fill.color)) {
scope.$watch("fill.color", function(newValue, oldValue) {
return rectangle.setOptions(buildOpts(rectangle.getBounds()));
});
}
if (angular.isDefined(scope.fill.opacity)) {
scope.$watch("fill.opacity", function(newValue, oldValue) {
return rectangle.setOptions(buildOpts(rectangle.getBounds()));
});
}
}
return scope.$on("$destroy", function() {
return rectangle.setMap(null);
});
});
}
};
}
]);
}).call(this);
/*
!
The MIT License
Copyright (c) 2010-2013 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
angular-google-maps
https://github.com/nlaplante/angular-google-maps
@authors
Nicolas Laplante - https://plus.google.com/108189012221374960701
Nicholas McCready - https://twitter.com/nmccready
*/
/*
Map info window directive
This directive is used to create an info window on an existing map.
This directive creates a new scope.
{attribute coords required} object containing latitude and longitude properties
{attribute show optional} map will show when this expression returns true
*/
(function() {
angular.module("google-maps").directive("window", [
"$timeout", "$compile", "$http", "$templateCache", "Window", function($timeout, $compile, $http, $templateCache, Window) {
return new Window($timeout, $compile, $http, $templateCache);
}
]);
}).call(this);
/*
!
The MIT License
Copyright (c) 2010-2013 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
angular-google-maps
https://github.com/nlaplante/angular-google-maps
@authors
Nicolas Laplante - https://plus.google.com/108189012221374960701
Nicholas McCready - https://twitter.com/nmccready
*/
/*
Map info window directive
This directive is used to create an info window on an existing map.
This directive creates a new scope.
{attribute coords required} object containing latitude and longitude properties
{attribute show optional} map will show when this expression returns true
*/
(function() {
angular.module("google-maps").directive("windows", [
"$timeout", "$compile", "$http", "$templateCache", "$interpolate", "Windows", function($timeout, $compile, $http, $templateCache, $interpolate, Windows) {
return new Windows($timeout, $compile, $http, $templateCache, $interpolate);
}
]);
}).call(this);
/*
!
The MIT License
Copyright (c) 2010-2013 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
angular-google-maps
https://github.com/nlaplante/angular-google-maps
@authors:
- Nicolas Laplante https://plus.google.com/108189012221374960701
- Nicholas McCready - https://twitter.com/nmccready
*/
/*
Map Layer directive
This directive is used to create any type of Layer from the google maps sdk.
This directive creates a new scope.
{attribute show optional} true (default) shows the trafficlayer otherwise it is hidden
*/
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
angular.module("google-maps").directive("layer", [
"$timeout", "Logger", "LayerParentModel", function($timeout, Logger, LayerParentModel) {
var Layer;
Layer = (function() {
function Layer() {
this.link = __bind(this.link, this);
this.$log = Logger;
this.restrict = "EMA";
this.require = "^googleMap";
this.priority = -1;
this.transclude = true;
this.template = '<span class=\"angular-google-map-layer\" ng-transclude></span>';
this.replace = true;
this.scope = {
show: "=show",
type: "=type",
namespace: "=namespace",
options: '=options',
onCreated: '&oncreated'
};
}
Layer.prototype.link = function(scope, element, attrs, mapCtrl) {
var _this = this;
return mapCtrl.getScope().deferred.promise.then(function(map) {
if (scope.onCreated != null) {
return new LayerParentModel(scope, element, attrs, map, scope.onCreated);
} else {
return new LayerParentModel(scope, element, attrs, map);
}
});
};
return Layer;
})();
return new Layer();
}
]);
}).call(this);
/*
!
The MIT License
Copyright (c) 2010-2013 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
angular-google-maps
https://github.com/nlaplante/angular-google-maps
@authors
Adam Kreitals, kreitals@hotmail.com
*/
/*
mapControl directive
This directive is used to create a custom control element on an existing map.
This directive creates a new scope.
{attribute template required} string url of the template to be used for the control
{attribute position optional} string position of the control of the form top-left or TOP_LEFT defaults to TOP_CENTER
{attribute controller optional} string controller to be applied to the template
{attribute index optional} number index for controlling the order of similarly positioned mapControl elements
*/
(function() {
angular.module("google-maps").directive("mapControl", [
"Control", function(Control) {
return new Control();
}
]);
}).call(this);
/*
angular-google-maps
https://github.com/nlaplante/angular-google-maps
@authors
Nicholas McCready - https://twitter.com/nmccready
# Brunt of the work is in DrawFreeHandChildModel
*/
(function() {
angular.module('google-maps').directive('FreeDrawPolygons'.ns(), [
'FreeDrawPolygons', function(FreeDrawPolygons) {
return new FreeDrawPolygons();
}
]);
}).call(this);
;angular.module("google-maps.wrapped").service("uuid".ns(), function(){
/*
Version: core-1.0
The MIT License: Copyright (c) 2012 LiosK.
*/
function UUID(){}UUID.generate=function(){var a=UUID._gri,b=UUID._ha;return b(a(32),8)+"-"+b(a(16),4)+"-"+b(16384|a(12),4)+"-"+b(32768|a(14),4)+"-"+b(a(48),12)};UUID._gri=function(a){return 0>a?NaN:30>=a?0|Math.random()*(1<<a):53>=a?(0|1073741824*Math.random())+1073741824*(0|Math.random()*(1<<a-30)):NaN};UUID._ha=function(a,b){for(var c=a.toString(16),d=b-c.length,e="0";0<d;d>>>=1,e+=e)d&1&&(c=e+c);return c};
return UUID;
});;/**
* Performance overrides on MarkerClusterer custom to Angular Google Maps
*
* Created by Petr Bruna ccg1415 and Nick McCready on 7/13/14.
*/
(function () {
var __hasProp = {}.hasOwnProperty,
__extends = function (child, parent) {
for (var key in parent) {
if (__hasProp.call(parent, key)) child[key] = parent[key];
}
function ctor() {
this.constructor = child;
}
ctor.prototype = parent.prototype;
child.prototype = new ctor();
child.__super__ = parent.prototype;
return child;
};
window.NgMapCluster = (function (_super) {
__extends(NgMapCluster, _super);
function NgMapCluster(opts) {
NgMapCluster.__super__.constructor.call(this, opts);
this.markers_ = new window.PropMap();
}
/**
* Adds a marker to the cluster.
*
* @param {google.maps.Marker} marker The marker to be added.
* @return {boolean} True if the marker was added.
* @ignore
*/
NgMapCluster.prototype.addMarker = function (marker) {
var i;
var mCount;
var mz;
if (this.isMarkerAlreadyAdded_(marker)) {
var oldMarker = this.markers_.get(marker.key);
if (oldMarker.getPosition().lat() == marker.getPosition().lat() && oldMarker.getPosition().lon() == marker.getPosition().lon()) //if nothing has changed
return false;
}
if (!this.center_) {
this.center_ = marker.getPosition();
this.calculateBounds_();
} else {
if (this.averageCenter_) {
var l = this.markers_.length + 1;
var lat = (this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l;
var lng = (this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l;
this.center_ = new google.maps.LatLng(lat, lng);
this.calculateBounds_();
}
}
marker.isAdded = true;
this.markers_.push(marker);
mCount = this.markers_.length;
mz = this.markerClusterer_.getMaxZoom();
if (mz !== null && this.map_.getZoom() > mz) {
// Zoomed in past max zoom, so show the marker.
if (marker.getMap() !== this.map_) {
marker.setMap(this.map_);
}
} else if (mCount < this.minClusterSize_) {
// Min cluster size not reached so show the marker.
if (marker.getMap() !== this.map_) {
marker.setMap(this.map_);
}
} else if (mCount === this.minClusterSize_) {
// Hide the markers that were showing.
this.markers_.values().forEach(function(m){
m.setMap(null);
});
} else {
marker.setMap(null);
}
// this.updateIcon_();
return true;
};
/**
* Determines if a marker has already been added to the cluster.
*
* @param {google.maps.Marker} marker The marker to check.
* @return {boolean} True if the marker has already been added.
*/
NgMapCluster.prototype.isMarkerAlreadyAdded_ = function (marker) {
return _.isNullOrUndefined(this.markers_.get(marker.key));
};
/**
* Returns the bounds of the cluster.
*
* @return {google.maps.LatLngBounds} the cluster bounds.
* @ignore
*/
NgMapCluster.prototype.getBounds = function () {
var i;
var bounds = new google.maps.LatLngBounds(this.center_, this.center_);
var markers = this.getMarkers().values();
for (i = 0; i < markers.length; i++) {
bounds.extend(markers[i].getPosition());
}
return bounds;
};
/**
* Removes the cluster from the map.
*
* @ignore
*/
NgMapCluster.prototype.remove = function () {
this.clusterIcon_.setMap(null);
this.markers_ = new PropMap();
delete this.markers_;
};
return NgMapCluster;
})(Cluster);
window.NgMapMarkerClusterer = (function (_super) {
__extends(NgMapMarkerClusterer, _super);
function NgMapMarkerClusterer(map, opt_markers, opt_options) {
NgMapMarkerClusterer.__super__.constructor.call(this, map, opt_markers, opt_options);
this.markers_ = new window.PropMap();
}
/**
* Removes all clusters and markers from the map and also removes all markers
* managed by the clusterer.
*/
NgMapMarkerClusterer.prototype.clearMarkers = function () {
this.resetViewport_(true);
this.markers_ = new PropMap();
};
/**
* Removes a marker and returns true if removed, false if not.
*
* @param {google.maps.Marker} marker The marker to remove
* @return {boolean} Whether the marker was removed or not
*/
NgMapMarkerClusterer.prototype.removeMarker_ = function (marker) {
if (!this.markers_.get(marker.key)) {
return false;
}
marker.setMap(null);
this.markers_.remove(marker.key); // Remove the marker from the list of managed markers
return true;
};
/**
* Creates the clusters. This is done in batches to avoid timeout errors
* in some browsers when there is a huge number of markers.
*
* @param {number} iFirst The index of the first marker in the batch of
* markers to be added to clusters.
*/
NgMapMarkerClusterer.prototype.createClusters_ = function (iFirst) {
var i, marker;
var mapBounds;
var cMarkerClusterer = this;
if (!this.ready_) {
return;
}
// Cancel previous batch processing if we're working on the first batch:
if (iFirst === 0) {
/**
* This event is fired when the <code>MarkerClusterer</code> begins
* clustering markers.
* @name MarkerClusterer#clusteringbegin
* @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.
* @event
*/
google.maps.event.trigger(this, "clusteringbegin", this);
if (typeof this.timerRefStatic !== "undefined") {
clearTimeout(this.timerRefStatic);
delete this.timerRefStatic;
}
}
// Get our current map view bounds.
// Create a new bounds object so we don't affect the map.
//
// See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:
if (this.getMap().getZoom() > 3) {
mapBounds = new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),
this.getMap().getBounds().getNorthEast());
} else {
mapBounds = new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));
}
var bounds = this.getExtendedBounds(mapBounds);
var iLast = Math.min(iFirst + this.batchSize_, this.markers_.length);
for (i = iFirst; i < iLast; i++) {
marker = this.markers_.values()[i];
if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {
if (!this.ignoreHidden_ || (this.ignoreHidden_ && marker.getVisible())) {
this.addToClosestCluster_(marker);
}
}
}
if (iLast < this.markers_.length) {
this.timerRefStatic = setTimeout(function () {
cMarkerClusterer.createClusters_(iLast);
}, 0);
} else {
// custom addition by ngmaps
// update icon for all clusters
for (i = 0; i < this.clusters_.length; i++) {
this.clusters_[i].updateIcon_();
}
delete this.timerRefStatic;
/**
* This event is fired when the <code>MarkerClusterer</code> stops
* clustering markers.
* @name MarkerClusterer#clusteringend
* @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.
* @event
*/
google.maps.event.trigger(this, "clusteringend", this);
}
};
/**
* Adds a marker to a cluster, or creates a new cluster.
*
* @param {google.maps.Marker} marker The marker to add.
*/
NgMapMarkerClusterer.prototype.addToClosestCluster_ = function (marker) {
var i, d, cluster, center;
var distance = 40000; // Some large number
var clusterToAddTo = null;
for (i = 0; i < this.clusters_.length; i++) {
cluster = this.clusters_[i];
center = cluster.getCenter();
if (center) {
d = this.distanceBetweenPoints_(center, marker.getPosition());
if (d < distance) {
distance = d;
clusterToAddTo = cluster;
}
}
}
if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {
clusterToAddTo.addMarker(marker);
} else {
cluster = new NgMapCluster(this);
cluster.addMarker(marker);
this.clusters_.push(cluster);
}
};
/**
* Redraws all the clusters.
*/
NgMapMarkerClusterer.prototype.redraw_ = function () {
this.createClusters_(0);
};
/**
* Removes all clusters from the map. The markers are also removed from the map
* if <code>opt_hide</code> is set to <code>true</code>.
*
* @param {boolean} [opt_hide] Set to <code>true</code> to also remove the markers
* from the map.
*/
NgMapMarkerClusterer.prototype.resetViewport_ = function (opt_hide) {
var i, marker;
// Remove all the clusters
for (i = 0; i < this.clusters_.length; i++) {
this.clusters_[i].remove();
}
this.clusters_ = [];
// Reset the markers to not be added and to be removed from the map.
this.markers_.values().forEach(function (marker) {
marker.isAdded = false;
if (opt_hide) {
marker.setMap(null);
}
});
};
/**
* Extends an object's prototype by another's.
*
* @param {Object} obj1 The object to be extended.
* @param {Object} obj2 The object to extend with.
* @return {Object} The new extended object.
* @ignore
*/
MarkerClusterer.prototype.extend = function (obj1, obj2) {
return (function (object) {
var property;
for (property in object.prototype) {
if(property !== 'constructor')
this.prototype[property] = object.prototype[property];
}
return this;
}).apply(obj1, [obj2]);
};
return NgMapMarkerClusterer;
})(MarkerClusterer);
}).call(this);
|
codfish/cdnjs
|
ajax/libs/angular-google-maps/1.2.1/angular-google-maps.js
|
JavaScript
|
mit
| 336,078 |
# -*- coding: utf-8 -*-
"""
pygments.styles.manni
~~~~~~~~~~~~~~~~~~~~~
A colorful style, inspired by the terminal highlighting style.
This is a port of the style used in the `php port`_ of pygments
by Manni. The style is called 'default' there.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace
class ManniStyle(Style):
"""
A colorful style, inspired by the terminal highlighting style.
"""
background_color = '#f0f3f3'
styles = {
Whitespace: '#bbbbbb',
Comment: 'italic #0099FF',
Comment.Preproc: 'noitalic #009999',
Comment.Special: 'bold',
Keyword: 'bold #006699',
Keyword.Pseudo: 'nobold',
Keyword.Type: '#007788',
Operator: '#555555',
Operator.Word: 'bold #000000',
Name.Builtin: '#336666',
Name.Function: '#CC00FF',
Name.Class: 'bold #00AA88',
Name.Namespace: 'bold #00CCFF',
Name.Exception: 'bold #CC0000',
Name.Variable: '#003333',
Name.Constant: '#336600',
Name.Label: '#9999FF',
Name.Entity: 'bold #999999',
Name.Attribute: '#330099',
Name.Tag: 'bold #330099',
Name.Decorator: '#9999FF',
String: '#CC3300',
String.Doc: 'italic',
String.Interpol: '#AA0000',
String.Escape: 'bold #CC3300',
String.Regex: '#33AAAA',
String.Symbol: '#FFCC33',
String.Other: '#CC3300',
Number: '#FF6600',
Generic.Heading: 'bold #003300',
Generic.Subheading: 'bold #003300',
Generic.Deleted: 'border:#CC0000 bg:#FFCCCC',
Generic.Inserted: 'border:#00CC00 bg:#CCFFCC',
Generic.Error: '#FF0000',
Generic.Emph: 'italic',
Generic.Strong: 'bold',
Generic.Prompt: 'bold #000099',
Generic.Output: '#AAAAAA',
Generic.Traceback: '#99CC66',
Error: 'bg:#FFAAAA #AA0000'
}
|
jaskaye17/nomadpad
|
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/manni.py
|
Python
|
mit
| 2,374 |
// XMLHttpRequest.js Copyright (C) 2010 Sergey Ilinsky (http://www.ilinsky.com)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* @requires OpenLayers/Request.js
*/
(function () {
// Save reference to earlier defined object implementation (if any)
var oXMLHttpRequest = window.XMLHttpRequest;
// Define on browser type
var bGecko = !!window.controllers,
bIE = window.document.all && !window.opera,
bIE7 = bIE && window.navigator.userAgent.match(/MSIE 7.0/);
// Enables "XMLHttpRequest()" call next to "new XMLHttpReques()"
function fXMLHttpRequest() {
this._object = oXMLHttpRequest && !bIE7 ? new oXMLHttpRequest : new window.ActiveXObject("Microsoft.XMLHTTP");
this._listeners = [];
};
// Constructor
function cXMLHttpRequest() {
return new fXMLHttpRequest;
};
cXMLHttpRequest.prototype = fXMLHttpRequest.prototype;
// BUGFIX: Firefox with Firebug installed would break pages if not executed
if (bGecko && oXMLHttpRequest.wrapped)
cXMLHttpRequest.wrapped = oXMLHttpRequest.wrapped;
// Constants
cXMLHttpRequest.UNSENT = 0;
cXMLHttpRequest.OPENED = 1;
cXMLHttpRequest.HEADERS_RECEIVED = 2;
cXMLHttpRequest.LOADING = 3;
cXMLHttpRequest.DONE = 4;
// Public Properties
cXMLHttpRequest.prototype.readyState = cXMLHttpRequest.UNSENT;
cXMLHttpRequest.prototype.responseText = '';
cXMLHttpRequest.prototype.responseXML = null;
cXMLHttpRequest.prototype.status = 0;
cXMLHttpRequest.prototype.statusText = '';
// Priority proposal
cXMLHttpRequest.prototype.priority = "NORMAL";
// Instance-level Events Handlers
cXMLHttpRequest.prototype.onreadystatechange = null;
// Class-level Events Handlers
cXMLHttpRequest.onreadystatechange = null;
cXMLHttpRequest.onopen = null;
cXMLHttpRequest.onsend = null;
cXMLHttpRequest.onabort = null;
// Public Methods
cXMLHttpRequest.prototype.open = function(sMethod, sUrl, bAsync, sUser, sPassword) {
// Delete headers, required when object is reused
delete this._headers;
// When bAsync parameter value is omitted, use true as default
if (arguments.length < 3)
bAsync = true;
// Save async parameter for fixing Gecko bug with missing readystatechange in synchronous requests
this._async = bAsync;
// Set the onreadystatechange handler
var oRequest = this,
nState = this.readyState,
fOnUnload;
// BUGFIX: IE - memory leak on page unload (inter-page leak)
if (bIE && bAsync) {
fOnUnload = function() {
if (nState != cXMLHttpRequest.DONE) {
fCleanTransport(oRequest);
// Safe to abort here since onreadystatechange handler removed
oRequest.abort();
}
};
window.attachEvent("onunload", fOnUnload);
}
// Add method sniffer
if (cXMLHttpRequest.onopen)
cXMLHttpRequest.onopen.apply(this, arguments);
if (arguments.length > 4)
this._object.open(sMethod, sUrl, bAsync, sUser, sPassword);
else
if (arguments.length > 3)
this._object.open(sMethod, sUrl, bAsync, sUser);
else
this._object.open(sMethod, sUrl, bAsync);
this.readyState = cXMLHttpRequest.OPENED;
fReadyStateChange(this);
this._object.onreadystatechange = function() {
if (bGecko && !bAsync)
return;
// Synchronize state
oRequest.readyState = oRequest._object.readyState;
//
fSynchronizeValues(oRequest);
// BUGFIX: Firefox fires unnecessary DONE when aborting
if (oRequest._aborted) {
// Reset readyState to UNSENT
oRequest.readyState = cXMLHttpRequest.UNSENT;
// Return now
return;
}
if (oRequest.readyState == cXMLHttpRequest.DONE) {
// Free up queue
delete oRequest._data;
/* if (bAsync)
fQueue_remove(oRequest);*/
//
fCleanTransport(oRequest);
// Uncomment this block if you need a fix for IE cache
/*
// BUGFIX: IE - cache issue
if (!oRequest._object.getResponseHeader("Date")) {
// Save object to cache
oRequest._cached = oRequest._object;
// Instantiate a new transport object
cXMLHttpRequest.call(oRequest);
// Re-send request
if (sUser) {
if (sPassword)
oRequest._object.open(sMethod, sUrl, bAsync, sUser, sPassword);
else
oRequest._object.open(sMethod, sUrl, bAsync, sUser);
}
else
oRequest._object.open(sMethod, sUrl, bAsync);
oRequest._object.setRequestHeader("If-Modified-Since", oRequest._cached.getResponseHeader("Last-Modified") || new window.Date(0));
// Copy headers set
if (oRequest._headers)
for (var sHeader in oRequest._headers)
if (typeof oRequest._headers[sHeader] == "string") // Some frameworks prototype objects with functions
oRequest._object.setRequestHeader(sHeader, oRequest._headers[sHeader]);
oRequest._object.onreadystatechange = function() {
// Synchronize state
oRequest.readyState = oRequest._object.readyState;
if (oRequest._aborted) {
//
oRequest.readyState = cXMLHttpRequest.UNSENT;
// Return
return;
}
if (oRequest.readyState == cXMLHttpRequest.DONE) {
// Clean Object
fCleanTransport(oRequest);
// get cached request
if (oRequest.status == 304)
oRequest._object = oRequest._cached;
//
delete oRequest._cached;
//
fSynchronizeValues(oRequest);
//
fReadyStateChange(oRequest);
// BUGFIX: IE - memory leak in interrupted
if (bIE && bAsync)
window.detachEvent("onunload", fOnUnload);
}
};
oRequest._object.send(null);
// Return now - wait until re-sent request is finished
return;
};
*/
// BUGFIX: IE - memory leak in interrupted
if (bIE && bAsync)
window.detachEvent("onunload", fOnUnload);
}
// BUGFIX: Some browsers (Internet Explorer, Gecko) fire OPEN readystate twice
if (nState != oRequest.readyState)
fReadyStateChange(oRequest);
nState = oRequest.readyState;
}
};
function fXMLHttpRequest_send(oRequest) {
oRequest._object.send(oRequest._data);
// BUGFIX: Gecko - missing readystatechange calls in synchronous requests
if (bGecko && !oRequest._async) {
oRequest.readyState = cXMLHttpRequest.OPENED;
// Synchronize state
fSynchronizeValues(oRequest);
// Simulate missing states
while (oRequest.readyState < cXMLHttpRequest.DONE) {
oRequest.readyState++;
fReadyStateChange(oRequest);
// Check if we are aborted
if (oRequest._aborted)
return;
}
}
};
cXMLHttpRequest.prototype.send = function(vData) {
// Add method sniffer
if (cXMLHttpRequest.onsend)
cXMLHttpRequest.onsend.apply(this, arguments);
if (!arguments.length)
vData = null;
// BUGFIX: Safari - fails sending documents created/modified dynamically, so an explicit serialization required
// BUGFIX: IE - rewrites any custom mime-type to "text/xml" in case an XMLNode is sent
// BUGFIX: Gecko - fails sending Element (this is up to the implementation either to standard)
if (vData && vData.nodeType) {
vData = window.XMLSerializer ? new window.XMLSerializer().serializeToString(vData) : vData.xml;
if (!this._headers["Content-Type"])
this._object.setRequestHeader("Content-Type", "application/xml");
}
this._data = vData;
/*
// Add to queue
if (this._async)
fQueue_add(this);
else*/
fXMLHttpRequest_send(this);
};
cXMLHttpRequest.prototype.abort = function() {
// Add method sniffer
if (cXMLHttpRequest.onabort)
cXMLHttpRequest.onabort.apply(this, arguments);
// BUGFIX: Gecko - unnecessary DONE when aborting
if (this.readyState > cXMLHttpRequest.UNSENT)
this._aborted = true;
this._object.abort();
// BUGFIX: IE - memory leak
fCleanTransport(this);
this.readyState = cXMLHttpRequest.UNSENT;
delete this._data;
/* if (this._async)
fQueue_remove(this);*/
};
cXMLHttpRequest.prototype.getAllResponseHeaders = function() {
return this._object.getAllResponseHeaders();
};
cXMLHttpRequest.prototype.getResponseHeader = function(sName) {
return this._object.getResponseHeader(sName);
};
cXMLHttpRequest.prototype.setRequestHeader = function(sName, sValue) {
// BUGFIX: IE - cache issue
if (!this._headers)
this._headers = {};
this._headers[sName] = sValue;
return this._object.setRequestHeader(sName, sValue);
};
// EventTarget interface implementation
cXMLHttpRequest.prototype.addEventListener = function(sName, fHandler, bUseCapture) {
for (var nIndex = 0, oListener; oListener = this._listeners[nIndex]; nIndex++)
if (oListener[0] == sName && oListener[1] == fHandler && oListener[2] == bUseCapture)
return;
// Add listener
this._listeners.push([sName, fHandler, bUseCapture]);
};
cXMLHttpRequest.prototype.removeEventListener = function(sName, fHandler, bUseCapture) {
for (var nIndex = 0, oListener; oListener = this._listeners[nIndex]; nIndex++)
if (oListener[0] == sName && oListener[1] == fHandler && oListener[2] == bUseCapture)
break;
// Remove listener
if (oListener)
this._listeners.splice(nIndex, 1);
};
cXMLHttpRequest.prototype.dispatchEvent = function(oEvent) {
var oEventPseudo = {
'type': oEvent.type,
'target': this,
'currentTarget':this,
'eventPhase': 2,
'bubbles': oEvent.bubbles,
'cancelable': oEvent.cancelable,
'timeStamp': oEvent.timeStamp,
'stopPropagation': function() {}, // There is no flow
'preventDefault': function() {}, // There is no default action
'initEvent': function() {} // Original event object should be initialized
};
// Execute onreadystatechange
if (oEventPseudo.type == "readystatechange" && this.onreadystatechange)
(this.onreadystatechange.handleEvent || this.onreadystatechange).apply(this, [oEventPseudo]);
// Execute listeners
for (var nIndex = 0, oListener; oListener = this._listeners[nIndex]; nIndex++)
if (oListener[0] == oEventPseudo.type && !oListener[2])
(oListener[1].handleEvent || oListener[1]).apply(this, [oEventPseudo]);
};
//
cXMLHttpRequest.prototype.toString = function() {
return '[' + "object" + ' ' + "XMLHttpRequest" + ']';
};
cXMLHttpRequest.toString = function() {
return '[' + "XMLHttpRequest" + ']';
};
// Helper function
function fReadyStateChange(oRequest) {
// Sniffing code
if (cXMLHttpRequest.onreadystatechange)
cXMLHttpRequest.onreadystatechange.apply(oRequest);
// Fake event
oRequest.dispatchEvent({
'type': "readystatechange",
'bubbles': false,
'cancelable': false,
'timeStamp': new Date + 0
});
};
function fGetDocument(oRequest) {
var oDocument = oRequest.responseXML,
sResponse = oRequest.responseText;
// Try parsing responseText
if (bIE && sResponse && oDocument && !oDocument.documentElement && oRequest.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)) {
oDocument = new window.ActiveXObject("Microsoft.XMLDOM");
oDocument.async = false;
oDocument.validateOnParse = false;
oDocument.loadXML(sResponse);
}
// Check if there is no error in document
if (oDocument)
if ((bIE && oDocument.parseError != 0) || !oDocument.documentElement || (oDocument.documentElement && oDocument.documentElement.tagName == "parsererror"))
return null;
return oDocument;
};
function fSynchronizeValues(oRequest) {
try { oRequest.responseText = oRequest._object.responseText; } catch (e) {}
try { oRequest.responseXML = fGetDocument(oRequest._object); } catch (e) {}
try { oRequest.status = oRequest._object.status; } catch (e) {}
try { oRequest.statusText = oRequest._object.statusText; } catch (e) {}
};
function fCleanTransport(oRequest) {
// BUGFIX: IE - memory leak (on-page leak)
oRequest._object.onreadystatechange = new window.Function;
};
/*
// Queue manager
var oQueuePending = {"CRITICAL":[],"HIGH":[],"NORMAL":[],"LOW":[],"LOWEST":[]},
aQueueRunning = [];
function fQueue_add(oRequest) {
oQueuePending[oRequest.priority in oQueuePending ? oRequest.priority : "NORMAL"].push(oRequest);
//
setTimeout(fQueue_process);
};
function fQueue_remove(oRequest) {
for (var nIndex = 0, bFound = false; nIndex < aQueueRunning.length; nIndex++)
if (bFound)
aQueueRunning[nIndex - 1] = aQueueRunning[nIndex];
else
if (aQueueRunning[nIndex] == oRequest)
bFound = true;
if (bFound)
aQueueRunning.length--;
//
setTimeout(fQueue_process);
};
function fQueue_process() {
if (aQueueRunning.length < 6) {
for (var sPriority in oQueuePending) {
if (oQueuePending[sPriority].length) {
var oRequest = oQueuePending[sPriority][0];
oQueuePending[sPriority] = oQueuePending[sPriority].slice(1);
//
aQueueRunning.push(oRequest);
// Send request
fXMLHttpRequest_send(oRequest);
break;
}
}
}
};
*/
// Internet Explorer 5.0 (missing apply)
if (!window.Function.prototype.apply) {
window.Function.prototype.apply = function(oRequest, oArguments) {
if (!oArguments)
oArguments = [];
oRequest.__func = this;
oRequest.__func(oArguments[0], oArguments[1], oArguments[2], oArguments[3], oArguments[4]);
delete oRequest.__func;
};
};
// Register new object with window
/**
* Class: OpenLayers.Request.XMLHttpRequest
* Standard-compliant (W3C) cross-browser implementation of the
* XMLHttpRequest object. From
* http://code.google.com/p/xmlhttprequest/.
*/
if (!OpenLayers.Request) {
/**
* This allows for OpenLayers/Request.js to be included
* before or after this script.
*/
OpenLayers.Request = {};
}
OpenLayers.Request.XMLHttpRequest = cXMLHttpRequest;
})();
|
MenZil/cdnjs
|
ajax/libs/openlayers/2.13.1/lib/OpenLayers/Request/XMLHttpRequest.js
|
JavaScript
|
mit
| 17,568 |
.c3 svg{font:10px sans-serif}.c3 line,.c3 path{fill:none;stroke:#000}.c3 text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.c3-bars path,.c3-event-rect,.c3-legend-item-tile,.c3-xgrid-focus,.c3-ygrid{shape-rendering:crispEdges}.c3-chart-arc path{stroke:#fff}.c3-chart-arc text{fill:#fff;font-size:13px}.c3-grid line{stroke:#aaa}.c3-grid text{fill:#aaa}.c3-xgrid,.c3-ygrid{stroke-dasharray:3 3}.c3-text.c3-empty{fill:gray;font-size:2em}.c3-line{stroke-width:1px}.c3-circle._expanded_{stroke-width:1px;stroke:#fff}.c3-selected-circle{fill:#fff;stroke-width:2px}.c3-bar{stroke-width:0}.c3-bar._expanded_{fill-opacity:.75}.c3-chart-arcs-title{font-size:1.3em}.c3-target.c3-focused path.c3-line,.c3-target.c3-focused path.c3-step{stroke-width:2px}.c3-region{fill:#4682b4;fill-opacity:.1}.c3-brush .extent{fill-opacity:.1}.c3-legend-item{font-size:12px}.c3-tooltip{border-collapse:collapse;border-spacing:0;background-color:#fff;empty-cells:show;-webkit-box-shadow:7px 7px 12px -9px #777;-moz-box-shadow:7px 7px 12px -9px #777;box-shadow:7px 7px 12px -9px #777;opacity:.9}.c3-tooltip tr{border:1px solid #CCC}.c3-tooltip th{background-color:#aaa;font-size:14px;padding:2px 5px;text-align:left;color:#FFF}.c3-tooltip td{font-size:13px;padding:3px 6px;background-color:#fff;border-left:1px dotted #999}.c3-tooltip td>span{display:inline-block;width:10px;height:10px;margin-right:6px}.c3-tooltip td.value{text-align:right}.c3-area{stroke-width:0;opacity:.2}.c3-chart-arcs .c3-chart-arcs-background{fill:#e0e0e0;stroke:none}.c3-chart-arcs .c3-chart-arcs-gauge-unit{fill:#000;font-size:16px}.c3-chart-arcs .c3-chart-arcs-gauge-max,.c3-chart-arcs .c3-chart-arcs-gauge-min{fill:#777}.c3-chart-arc .c3-gauge-value{fill:#000;font-size:28px}
|
chrisyip/cdnjs
|
ajax/libs/c3/0.2.0/c3.min.css
|
CSS
|
mit
| 1,743 |
videojs.addLanguage("pt-BR",{
"Play": "Tocar",
"Pause": "Pause",
"Current Time": "Tempo",
"Duration Time": "Duração",
"Remaining Time": "Tempo Restante",
"Stream Type": "Tipo de Stream",
"LIVE": "AO VIVO",
"Loaded": "Carregado",
"Progress": "Progresso",
"Fullscreen": "Tela Cheia",
"Non-Fullscreen": "Tela Normal",
"Mute": "Mudo",
"Unmuted": "Habilitar Som",
"Playback Rate": "Velocidade",
"Subtitles": "Legendas",
"subtitles off": "Sem Legendas",
"Captions": "Anotações",
"captions off": "Sem Anotações",
"Chapters": "Capítulos",
"You aborted the video playback": "Você parou a execução de vídeo.",
"A network error caused the video download to fail part-way.": "Um erro na rede fez o vídeo parar parcialmente.",
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "O vídeo não pode ser carregado, ou porque houve um problema com sua rede ou pelo formato do vídeo não ser suportado.",
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "A Execução foi interrompida por um problema com o vídeo ou por seu navegador não dar suporte ao seu formato.",
"No compatible source was found for this video.": "Não foi encontrada fonte de vídeo compatível."
});
|
abishekrsrikaanth/jsdelivr
|
files/videojs/5.0.0-rc.14/lang/pt-BR.js
|
JavaScript
|
mit
| 1,339 |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/protobuf/type.proto
/*
Package ptype is a generated protocol buffer package.
It is generated from these files:
google/protobuf/type.proto
It has these top-level messages:
Type
Field
Enum
EnumValue
Option
*/
package ptype
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf "github.com/golang/protobuf/ptypes/any"
import google_protobuf1 "google.golang.org/genproto/protobuf/source_context"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
// The syntax in which a protocol buffer element is defined.
type Syntax int32
const (
// Syntax `proto2`.
Syntax_SYNTAX_PROTO2 Syntax = 0
// Syntax `proto3`.
Syntax_SYNTAX_PROTO3 Syntax = 1
)
var Syntax_name = map[int32]string{
0: "SYNTAX_PROTO2",
1: "SYNTAX_PROTO3",
}
var Syntax_value = map[string]int32{
"SYNTAX_PROTO2": 0,
"SYNTAX_PROTO3": 1,
}
func (x Syntax) String() string {
return proto.EnumName(Syntax_name, int32(x))
}
func (Syntax) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
// Basic field types.
type Field_Kind int32
const (
// Field type unknown.
Field_TYPE_UNKNOWN Field_Kind = 0
// Field type double.
Field_TYPE_DOUBLE Field_Kind = 1
// Field type float.
Field_TYPE_FLOAT Field_Kind = 2
// Field type int64.
Field_TYPE_INT64 Field_Kind = 3
// Field type uint64.
Field_TYPE_UINT64 Field_Kind = 4
// Field type int32.
Field_TYPE_INT32 Field_Kind = 5
// Field type fixed64.
Field_TYPE_FIXED64 Field_Kind = 6
// Field type fixed32.
Field_TYPE_FIXED32 Field_Kind = 7
// Field type bool.
Field_TYPE_BOOL Field_Kind = 8
// Field type string.
Field_TYPE_STRING Field_Kind = 9
// Field type group. Proto2 syntax only, and deprecated.
Field_TYPE_GROUP Field_Kind = 10
// Field type message.
Field_TYPE_MESSAGE Field_Kind = 11
// Field type bytes.
Field_TYPE_BYTES Field_Kind = 12
// Field type uint32.
Field_TYPE_UINT32 Field_Kind = 13
// Field type enum.
Field_TYPE_ENUM Field_Kind = 14
// Field type sfixed32.
Field_TYPE_SFIXED32 Field_Kind = 15
// Field type sfixed64.
Field_TYPE_SFIXED64 Field_Kind = 16
// Field type sint32.
Field_TYPE_SINT32 Field_Kind = 17
// Field type sint64.
Field_TYPE_SINT64 Field_Kind = 18
)
var Field_Kind_name = map[int32]string{
0: "TYPE_UNKNOWN",
1: "TYPE_DOUBLE",
2: "TYPE_FLOAT",
3: "TYPE_INT64",
4: "TYPE_UINT64",
5: "TYPE_INT32",
6: "TYPE_FIXED64",
7: "TYPE_FIXED32",
8: "TYPE_BOOL",
9: "TYPE_STRING",
10: "TYPE_GROUP",
11: "TYPE_MESSAGE",
12: "TYPE_BYTES",
13: "TYPE_UINT32",
14: "TYPE_ENUM",
15: "TYPE_SFIXED32",
16: "TYPE_SFIXED64",
17: "TYPE_SINT32",
18: "TYPE_SINT64",
}
var Field_Kind_value = map[string]int32{
"TYPE_UNKNOWN": 0,
"TYPE_DOUBLE": 1,
"TYPE_FLOAT": 2,
"TYPE_INT64": 3,
"TYPE_UINT64": 4,
"TYPE_INT32": 5,
"TYPE_FIXED64": 6,
"TYPE_FIXED32": 7,
"TYPE_BOOL": 8,
"TYPE_STRING": 9,
"TYPE_GROUP": 10,
"TYPE_MESSAGE": 11,
"TYPE_BYTES": 12,
"TYPE_UINT32": 13,
"TYPE_ENUM": 14,
"TYPE_SFIXED32": 15,
"TYPE_SFIXED64": 16,
"TYPE_SINT32": 17,
"TYPE_SINT64": 18,
}
func (x Field_Kind) String() string {
return proto.EnumName(Field_Kind_name, int32(x))
}
func (Field_Kind) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} }
// Whether a field is optional, required, or repeated.
type Field_Cardinality int32
const (
// For fields with unknown cardinality.
Field_CARDINALITY_UNKNOWN Field_Cardinality = 0
// For optional fields.
Field_CARDINALITY_OPTIONAL Field_Cardinality = 1
// For required fields. Proto2 syntax only.
Field_CARDINALITY_REQUIRED Field_Cardinality = 2
// For repeated fields.
Field_CARDINALITY_REPEATED Field_Cardinality = 3
)
var Field_Cardinality_name = map[int32]string{
0: "CARDINALITY_UNKNOWN",
1: "CARDINALITY_OPTIONAL",
2: "CARDINALITY_REQUIRED",
3: "CARDINALITY_REPEATED",
}
var Field_Cardinality_value = map[string]int32{
"CARDINALITY_UNKNOWN": 0,
"CARDINALITY_OPTIONAL": 1,
"CARDINALITY_REQUIRED": 2,
"CARDINALITY_REPEATED": 3,
}
func (x Field_Cardinality) String() string {
return proto.EnumName(Field_Cardinality_name, int32(x))
}
func (Field_Cardinality) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 1} }
// A protocol buffer message type.
type Type struct {
// The fully qualified message name.
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
// The list of fields.
Fields []*Field `protobuf:"bytes,2,rep,name=fields" json:"fields,omitempty"`
// The list of types appearing in `oneof` definitions in this type.
Oneofs []string `protobuf:"bytes,3,rep,name=oneofs" json:"oneofs,omitempty"`
// The protocol buffer options.
Options []*Option `protobuf:"bytes,4,rep,name=options" json:"options,omitempty"`
// The source context.
SourceContext *google_protobuf1.SourceContext `protobuf:"bytes,5,opt,name=source_context,json=sourceContext" json:"source_context,omitempty"`
// The source syntax.
Syntax Syntax `protobuf:"varint,6,opt,name=syntax,enum=google.protobuf.Syntax" json:"syntax,omitempty"`
}
func (m *Type) Reset() { *m = Type{} }
func (m *Type) String() string { return proto.CompactTextString(m) }
func (*Type) ProtoMessage() {}
func (*Type) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *Type) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *Type) GetFields() []*Field {
if m != nil {
return m.Fields
}
return nil
}
func (m *Type) GetOneofs() []string {
if m != nil {
return m.Oneofs
}
return nil
}
func (m *Type) GetOptions() []*Option {
if m != nil {
return m.Options
}
return nil
}
func (m *Type) GetSourceContext() *google_protobuf1.SourceContext {
if m != nil {
return m.SourceContext
}
return nil
}
func (m *Type) GetSyntax() Syntax {
if m != nil {
return m.Syntax
}
return Syntax_SYNTAX_PROTO2
}
// A single field of a message type.
type Field struct {
// The field type.
Kind Field_Kind `protobuf:"varint,1,opt,name=kind,enum=google.protobuf.Field_Kind" json:"kind,omitempty"`
// The field cardinality.
Cardinality Field_Cardinality `protobuf:"varint,2,opt,name=cardinality,enum=google.protobuf.Field_Cardinality" json:"cardinality,omitempty"`
// The field number.
Number int32 `protobuf:"varint,3,opt,name=number" json:"number,omitempty"`
// The field name.
Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"`
// The field type URL, without the scheme, for message or enumeration
// types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
TypeUrl string `protobuf:"bytes,6,opt,name=type_url,json=typeUrl" json:"type_url,omitempty"`
// The index of the field type in `Type.oneofs`, for message or enumeration
// types. The first type has index 1; zero means the type is not in the list.
OneofIndex int32 `protobuf:"varint,7,opt,name=oneof_index,json=oneofIndex" json:"oneof_index,omitempty"`
// Whether to use alternative packed wire representation.
Packed bool `protobuf:"varint,8,opt,name=packed" json:"packed,omitempty"`
// The protocol buffer options.
Options []*Option `protobuf:"bytes,9,rep,name=options" json:"options,omitempty"`
// The field JSON name.
JsonName string `protobuf:"bytes,10,opt,name=json_name,json=jsonName" json:"json_name,omitempty"`
// The string value of the default value of this field. Proto2 syntax only.
DefaultValue string `protobuf:"bytes,11,opt,name=default_value,json=defaultValue" json:"default_value,omitempty"`
}
func (m *Field) Reset() { *m = Field{} }
func (m *Field) String() string { return proto.CompactTextString(m) }
func (*Field) ProtoMessage() {}
func (*Field) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *Field) GetKind() Field_Kind {
if m != nil {
return m.Kind
}
return Field_TYPE_UNKNOWN
}
func (m *Field) GetCardinality() Field_Cardinality {
if m != nil {
return m.Cardinality
}
return Field_CARDINALITY_UNKNOWN
}
func (m *Field) GetNumber() int32 {
if m != nil {
return m.Number
}
return 0
}
func (m *Field) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *Field) GetTypeUrl() string {
if m != nil {
return m.TypeUrl
}
return ""
}
func (m *Field) GetOneofIndex() int32 {
if m != nil {
return m.OneofIndex
}
return 0
}
func (m *Field) GetPacked() bool {
if m != nil {
return m.Packed
}
return false
}
func (m *Field) GetOptions() []*Option {
if m != nil {
return m.Options
}
return nil
}
func (m *Field) GetJsonName() string {
if m != nil {
return m.JsonName
}
return ""
}
func (m *Field) GetDefaultValue() string {
if m != nil {
return m.DefaultValue
}
return ""
}
// Enum type definition.
type Enum struct {
// Enum type name.
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
// Enum value definitions.
Enumvalue []*EnumValue `protobuf:"bytes,2,rep,name=enumvalue" json:"enumvalue,omitempty"`
// Protocol buffer options.
Options []*Option `protobuf:"bytes,3,rep,name=options" json:"options,omitempty"`
// The source context.
SourceContext *google_protobuf1.SourceContext `protobuf:"bytes,4,opt,name=source_context,json=sourceContext" json:"source_context,omitempty"`
// The source syntax.
Syntax Syntax `protobuf:"varint,5,opt,name=syntax,enum=google.protobuf.Syntax" json:"syntax,omitempty"`
}
func (m *Enum) Reset() { *m = Enum{} }
func (m *Enum) String() string { return proto.CompactTextString(m) }
func (*Enum) ProtoMessage() {}
func (*Enum) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *Enum) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *Enum) GetEnumvalue() []*EnumValue {
if m != nil {
return m.Enumvalue
}
return nil
}
func (m *Enum) GetOptions() []*Option {
if m != nil {
return m.Options
}
return nil
}
func (m *Enum) GetSourceContext() *google_protobuf1.SourceContext {
if m != nil {
return m.SourceContext
}
return nil
}
func (m *Enum) GetSyntax() Syntax {
if m != nil {
return m.Syntax
}
return Syntax_SYNTAX_PROTO2
}
// Enum value definition.
type EnumValue struct {
// Enum value name.
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
// Enum value number.
Number int32 `protobuf:"varint,2,opt,name=number" json:"number,omitempty"`
// Protocol buffer options.
Options []*Option `protobuf:"bytes,3,rep,name=options" json:"options,omitempty"`
}
func (m *EnumValue) Reset() { *m = EnumValue{} }
func (m *EnumValue) String() string { return proto.CompactTextString(m) }
func (*EnumValue) ProtoMessage() {}
func (*EnumValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func (m *EnumValue) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *EnumValue) GetNumber() int32 {
if m != nil {
return m.Number
}
return 0
}
func (m *EnumValue) GetOptions() []*Option {
if m != nil {
return m.Options
}
return nil
}
// A protocol buffer option, which can be attached to a message, field,
// enumeration, etc.
type Option struct {
// The option's name. For protobuf built-in options (options defined in
// descriptor.proto), this is the short name. For example, `"map_entry"`.
// For custom options, it should be the fully-qualified name. For example,
// `"google.api.http"`.
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
// The option's value packed in an Any message. If the value is a primitive,
// the corresponding wrapper type defined in google/protobuf/wrappers.proto
// should be used. If the value is an enum, it should be stored as an int32
// value using the google.protobuf.Int32Value type.
Value *google_protobuf.Any `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
}
func (m *Option) Reset() { *m = Option{} }
func (m *Option) String() string { return proto.CompactTextString(m) }
func (*Option) ProtoMessage() {}
func (*Option) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
func (m *Option) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *Option) GetValue() *google_protobuf.Any {
if m != nil {
return m.Value
}
return nil
}
func init() {
proto.RegisterType((*Type)(nil), "google.protobuf.Type")
proto.RegisterType((*Field)(nil), "google.protobuf.Field")
proto.RegisterType((*Enum)(nil), "google.protobuf.Enum")
proto.RegisterType((*EnumValue)(nil), "google.protobuf.EnumValue")
proto.RegisterType((*Option)(nil), "google.protobuf.Option")
proto.RegisterEnum("google.protobuf.Syntax", Syntax_name, Syntax_value)
proto.RegisterEnum("google.protobuf.Field_Kind", Field_Kind_name, Field_Kind_value)
proto.RegisterEnum("google.protobuf.Field_Cardinality", Field_Cardinality_name, Field_Cardinality_value)
}
func init() { proto.RegisterFile("google/protobuf/type.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 810 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x8e, 0xda, 0x56,
0x14, 0x8e, 0x8d, 0xf1, 0xe0, 0xc3, 0xc0, 0xdc, 0xdc, 0x44, 0x89, 0x33, 0x91, 0x52, 0x44, 0xbb,
0x40, 0x59, 0x80, 0x0a, 0xa3, 0x51, 0xa5, 0xae, 0x60, 0xf0, 0x50, 0x6b, 0x88, 0xed, 0x5e, 0x4c,
0x93, 0xe9, 0x06, 0x79, 0xe0, 0x0e, 0x22, 0x31, 0xd7, 0x08, 0xdb, 0xed, 0xb0, 0xe8, 0x23, 0xf4,
0x25, 0xba, 0xec, 0xba, 0x0f, 0xd1, 0x47, 0xea, 0xae, 0xd5, 0xbd, 0x06, 0x63, 0x7e, 0x2a, 0x4d,
0x9b, 0xcd, 0x68, 0xce, 0xf7, 0x7d, 0xe7, 0xf7, 0x1e, 0x8e, 0xe1, 0x7c, 0x1a, 0x04, 0x53, 0x9f,
0x36, 0x16, 0xcb, 0x20, 0x0a, 0xee, 0xe2, 0xfb, 0x46, 0xb4, 0x5a, 0xd0, 0xba, 0xb0, 0xf0, 0x59,
0xc2, 0xd5, 0x37, 0xdc, 0xf9, 0xab, 0x7d, 0xb1, 0xc7, 0x56, 0x09, 0x7b, 0xfe, 0xd5, 0x3e, 0x15,
0x06, 0xf1, 0x72, 0x4c, 0x47, 0xe3, 0x80, 0x45, 0xf4, 0x21, 0x4a, 0x54, 0xd5, 0x5f, 0x65, 0x50,
0xdc, 0xd5, 0x82, 0x62, 0x0c, 0x0a, 0xf3, 0xe6, 0x54, 0x97, 0x2a, 0x52, 0x4d, 0x23, 0xe2, 0x7f,
0x5c, 0x07, 0xf5, 0x7e, 0x46, 0xfd, 0x49, 0xa8, 0xcb, 0x95, 0x5c, 0xad, 0xd8, 0x7c, 0x51, 0xdf,
0xcb, 0x5f, 0xbf, 0xe6, 0x34, 0x59, 0xab, 0xf0, 0x0b, 0x50, 0x03, 0x46, 0x83, 0xfb, 0x50, 0xcf,
0x55, 0x72, 0x35, 0x8d, 0xac, 0x2d, 0xfc, 0x35, 0x9c, 0x04, 0x8b, 0x68, 0x16, 0xb0, 0x50, 0x57,
0x44, 0xa0, 0x97, 0x07, 0x81, 0x6c, 0xc1, 0x93, 0x8d, 0x0e, 0x1b, 0x50, 0xde, 0xad, 0x57, 0xcf,
0x57, 0xa4, 0x5a, 0xb1, 0xf9, 0xe6, 0xc0, 0x73, 0x20, 0x64, 0x57, 0x89, 0x8a, 0x94, 0xc2, 0xac,
0x89, 0x1b, 0xa0, 0x86, 0x2b, 0x16, 0x79, 0x0f, 0xba, 0x5a, 0x91, 0x6a, 0xe5, 0x23, 0x89, 0x07,
0x82, 0x26, 0x6b, 0x59, 0xf5, 0x0f, 0x15, 0xf2, 0xa2, 0x29, 0xdc, 0x00, 0xe5, 0xd3, 0x8c, 0x4d,
0xc4, 0x40, 0xca, 0xcd, 0xd7, 0xc7, 0x5b, 0xaf, 0xdf, 0xcc, 0xd8, 0x84, 0x08, 0x21, 0xee, 0x42,
0x71, 0xec, 0x2d, 0x27, 0x33, 0xe6, 0xf9, 0xb3, 0x68, 0xa5, 0xcb, 0xc2, 0xaf, 0xfa, 0x2f, 0x7e,
0x57, 0x5b, 0x25, 0xc9, 0xba, 0xf1, 0x19, 0xb2, 0x78, 0x7e, 0x47, 0x97, 0x7a, 0xae, 0x22, 0xd5,
0xf2, 0x64, 0x6d, 0xa5, 0xef, 0xa3, 0x64, 0xde, 0xe7, 0x15, 0x14, 0xf8, 0x72, 0x8c, 0xe2, 0xa5,
0x2f, 0xfa, 0xd3, 0xc8, 0x09, 0xb7, 0x87, 0x4b, 0x1f, 0x7f, 0x01, 0x45, 0x31, 0xfc, 0xd1, 0x8c,
0x4d, 0xe8, 0x83, 0x7e, 0x22, 0x62, 0x81, 0x80, 0x4c, 0x8e, 0xf0, 0x3c, 0x0b, 0x6f, 0xfc, 0x89,
0x4e, 0xf4, 0x42, 0x45, 0xaa, 0x15, 0xc8, 0xda, 0xca, 0xbe, 0x95, 0xf6, 0xc8, 0xb7, 0x7a, 0x0d,
0xda, 0xc7, 0x30, 0x60, 0x23, 0x51, 0x1f, 0x88, 0x3a, 0x0a, 0x1c, 0xb0, 0x78, 0x8d, 0x5f, 0x42,
0x69, 0x42, 0xef, 0xbd, 0xd8, 0x8f, 0x46, 0x3f, 0x79, 0x7e, 0x4c, 0xf5, 0xa2, 0x10, 0x9c, 0xae,
0xc1, 0x1f, 0x38, 0x56, 0xfd, 0x53, 0x06, 0x85, 0x4f, 0x12, 0x23, 0x38, 0x75, 0x6f, 0x1d, 0x63,
0x34, 0xb4, 0x6e, 0x2c, 0xfb, 0xbd, 0x85, 0x9e, 0xe0, 0x33, 0x28, 0x0a, 0xa4, 0x6b, 0x0f, 0x3b,
0x7d, 0x03, 0x49, 0xb8, 0x0c, 0x20, 0x80, 0xeb, 0xbe, 0xdd, 0x76, 0x91, 0x9c, 0xda, 0xa6, 0xe5,
0x5e, 0x5e, 0xa0, 0x5c, 0xea, 0x30, 0x4c, 0x00, 0x25, 0x2b, 0x68, 0x35, 0x51, 0x3e, 0xcd, 0x71,
0x6d, 0x7e, 0x30, 0xba, 0x97, 0x17, 0x48, 0xdd, 0x45, 0x5a, 0x4d, 0x74, 0x82, 0x4b, 0xa0, 0x09,
0xa4, 0x63, 0xdb, 0x7d, 0x54, 0x48, 0x63, 0x0e, 0x5c, 0x62, 0x5a, 0x3d, 0xa4, 0xa5, 0x31, 0x7b,
0xc4, 0x1e, 0x3a, 0x08, 0xd2, 0x08, 0xef, 0x8c, 0xc1, 0xa0, 0xdd, 0x33, 0x50, 0x31, 0x55, 0x74,
0x6e, 0x5d, 0x63, 0x80, 0x4e, 0x77, 0xca, 0x6a, 0x35, 0x51, 0x29, 0x4d, 0x61, 0x58, 0xc3, 0x77,
0xa8, 0x8c, 0x9f, 0x42, 0x29, 0x49, 0xb1, 0x29, 0xe2, 0x6c, 0x0f, 0xba, 0xbc, 0x40, 0x68, 0x5b,
0x48, 0x12, 0xe5, 0xe9, 0x0e, 0x70, 0x79, 0x81, 0x70, 0x35, 0x82, 0x62, 0x66, 0xb7, 0xf0, 0x4b,
0x78, 0x76, 0xd5, 0x26, 0x5d, 0xd3, 0x6a, 0xf7, 0x4d, 0xf7, 0x36, 0x33, 0x57, 0x1d, 0x9e, 0x67,
0x09, 0xdb, 0x71, 0x4d, 0xdb, 0x6a, 0xf7, 0x91, 0xb4, 0xcf, 0x10, 0xe3, 0xfb, 0xa1, 0x49, 0x8c,
0x2e, 0x92, 0x0f, 0x19, 0xc7, 0x68, 0xbb, 0x46, 0x17, 0xe5, 0xaa, 0x7f, 0x4b, 0xa0, 0x18, 0x2c,
0x9e, 0x1f, 0x3d, 0x23, 0xdf, 0x80, 0x46, 0x59, 0x3c, 0x4f, 0x9e, 0x3f, 0xb9, 0x24, 0xe7, 0x07,
0x4b, 0xc5, 0xbd, 0xc5, 0x32, 0x90, 0xad, 0x38, 0xbb, 0x8c, 0xb9, 0xff, 0x7d, 0x38, 0x94, 0xcf,
0x3b, 0x1c, 0xf9, 0xc7, 0x1d, 0x8e, 0x8f, 0xa0, 0xa5, 0x2d, 0x1c, 0x9d, 0xc2, 0xf6, 0x87, 0x2d,
0xef, 0xfc, 0xb0, 0xff, 0x7b, 0x8f, 0xd5, 0xef, 0x40, 0x4d, 0xa0, 0xa3, 0x89, 0xde, 0x42, 0x7e,
0x33, 0x6a, 0xde, 0xf8, 0xf3, 0x83, 0x70, 0x6d, 0xb6, 0x22, 0x89, 0xe4, 0x6d, 0x1d, 0xd4, 0xa4,
0x0f, 0xbe, 0x6c, 0x83, 0x5b, 0xcb, 0x6d, 0x7f, 0x18, 0x39, 0xc4, 0x76, 0xed, 0x26, 0x7a, 0xb2,
0x0f, 0xb5, 0x90, 0xd4, 0xf9, 0x05, 0x9e, 0x8d, 0x83, 0xf9, 0x7e, 0xc4, 0x8e, 0xc6, 0x3f, 0x21,
0x0e, 0xb7, 0x1c, 0xe9, 0xc7, 0xc6, 0x9a, 0x9d, 0x06, 0xbe, 0xc7, 0xa6, 0xf5, 0x60, 0x39, 0x6d,
0x4c, 0x29, 0x13, 0xda, 0xed, 0xc7, 0x68, 0xc1, 0x0f, 0xd5, 0xb7, 0xe2, 0xef, 0x5f, 0x92, 0xf4,
0x9b, 0x9c, 0xeb, 0x39, 0x9d, 0xdf, 0xe5, 0x37, 0xbd, 0xc4, 0xd5, 0xd9, 0x94, 0xfa, 0x9e, 0xfa,
0xfe, 0x0d, 0x0b, 0x7e, 0x66, 0x3c, 0x41, 0x78, 0xa7, 0x0a, 0xff, 0xd6, 0x3f, 0x01, 0x00, 0x00,
0xff, 0xff, 0x6d, 0x2b, 0xc0, 0xd8, 0x24, 0x07, 0x00, 0x00,
}
|
hkjn/hkjninfra
|
telemetry/vendor/google.golang.org/genproto/protobuf/ptype/type.pb.go
|
GO
|
mit
| 18,465 |
// Type definitions for hapi 8.2.0
// Project: http://github.com/spumko/hapi
// Definitions by: Jason Swearingen <http://github.com/jasonswearingen>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//This is a total rewrite of Hakubo's original hapi.d.ts, as it was out of date/incomplete.
/// <reference path="../node/node.d.ts" />
/// <reference path="../bluebird/bluebird.d.ts" />
declare module "hapi" {
import http = require("http");
import stream = require("stream");
import Events = require("events");
interface IDictionary<T> {
[key: string]: T;
}
/** Boom Module for errors. https://github.com/hapijs/boom
* boom provides a set of utilities for returning HTTP errors. Each utility returns a Boom error response object (instance of Error) which includes the following properties: */
export interface IBoom extends Error {
/** if true, indicates this is a Boom object instance. */
isBoom: boolean;
/** convenience bool indicating status code >= 500. */
isServer: boolean;
/** the error message. */
message: string;
/** the formatted response.Can be directly manipulated after object construction to return a custom error response.Allowed root keys: */
output: {
/** the HTTP status code (typically 4xx or 5xx). */
statusCode: number;
/** an object containing any HTTP headers where each key is a header name and value is the header content. */
headers: IDictionary<string>;
/** the formatted object used as the response payload (stringified).Can be directly manipulated but any changes will be lost if reformat() is called.Any content allowed and by default includes the following content: */
payload: {
/** the HTTP status code, derived from error.output.statusCode. */
statusCode: number;
/** the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from statusCode. */
error: string;
/** the error message derived from error.message. */
message: string;
};
};
/** reformat()rebuilds error.output using the other object properties. */
reformat(): void;
}
/** cache functionality via the "CatBox" module. */
export interface ICatBoxCacheOptions {
/** a prototype function or catbox engine object. */
engine: any;
/** an identifier used later when provisioning or configuring caching for server methods or plugins. Each cache name must be unique. A single item may omit the name option which defines the default cache. If every cache includes a name, a default memory cache is provisions as well. */
name?: string;
/** if true, allows multiple cache users to share the same segment (e.g. multiple methods using the same cache storage container). Default to false. */
shared?: boolean;
}
/** Any connections configuration server defaults can be included to override and customize the individual connection. */
export interface ISeverConnectionOptions extends IConnectionConfigurationServerDefaults {
/** - the public hostname or IP address. Used only to set server.info.host and server.info.uri. If not configured, defaults to the operating system hostname and if not available, to 'localhost'.*/
host?: string;
/** - sets the host name or IP address the connection will listen on.If not configured, defaults to host if present, otherwise to all available network interfaces (i.e. '0.0.0.0').Set to 127.0.0.1 or localhost to restrict connection to only those coming from the same machine.*/
address?: string;
/** - the TCP port the connection will listen to.Defaults to an ephemeral port (0) which uses an available port when the server is started (and assigned to server.info.port).If port is a string containing a '/' character, it is used as a UNIX domain socket path and if it starts with '\.\pipe' as a Windows named pipe.*/
port?: string|number;
/** - the full public URI without the path (e.g. 'http://example.com:8080').If present, used as the connection info.uri otherwise constructed from the connection settings.*/
uri?: string;
/** - optional node.js HTTP (or HTTPS) http.Server object or any compatible object.If the listener needs to be manually started, set autoListen to false.If the listener uses TLS, set tls to true.*/
listener?: any;
/** - indicates that the connection.listener will be started manually outside the framework.Cannot be specified with a port setting.Defaults to true.*/
autoListen?: boolean;
/** caching headers configuration: */
cache?: {
/** - an array of HTTP response status codes (e.g. 200) which are allowed to include a valid caching directive.Defaults to [200]. */
statuses: number[];
};
/** - a string or string array of labels used to server.select() specific connections matching the specified labels.Defaults to an empty array [](no labels).*/
labels?: string|string[];
/** - used to create an HTTPS connection.The tls object is passed unchanged as options to the node.js HTTPS server as described in the node.js HTTPS documentation.Set to true when passing a listener object that has been configured to use TLS directly. */
tls?: boolean;
}
export interface IConnectionConfigurationServerDefaults {
/** application-specific connection configuration which can be accessed via connection.settings.app. Provides a safe place to store application configuration without potential conflicts with the framework internals. Should not be used to configure plugins which should use plugins[name]. Note the difference between connection.settings.app which is used to store configuration values and connection.app which is meant for storing run-time state. */
app?: any;
/** connection load limits configuration where: */
load?: {
/** maximum V8 heap size over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). */
maxHeapUsedBytes: number;
/** maximum process RSS size over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). */
maxRssBytes: number;
/** maximum event loop delay duration in milliseconds over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). */
maxEventLoopDelay: number;
};
/** plugin-specific configuration which can later be accessed via connection.settings.plugins. Provides a place to store and pass connection-specific plugin configuration. plugins is an object where each key is a plugin name and the value is the configuration. Note the difference between connection.settings.plugins which is used to store configuration values and connection.plugins which is meant for storing run-time state. */
plugins?: any;
/** controls how incoming request URIs are matched against the routing table: */
router?: {
/** determines whether the paths '/example' and '/EXAMPLE' are considered different resources. Defaults to true. */
isCaseSensitive: boolean;
/** removes trailing slashes on incoming paths. Defaults to false. */
stripTrailingSlash: boolean;
};
/** a route options object used to set the default configuration for every route. */
routes?: IRouteAdditionalConfigurationOptions;
state?: IServerState;
}
/** Note that the options object is deeply cloned and cannot contain any values that are unsafe to perform deep copy on.*/
export interface IServerOptions {
/** application-specific configuration which can later be accessed via server.settings.app. Note the difference between server.settings.app which is used to store static configuration values and server.app which is meant for storing run-time state. Defaults to {}. */
app?: any;
/** sets up server-side caching. Every server includes a default cache for storing application state. By default, a simple memory-based cache is created which has limited capacity and capabilities. hapi uses catbox for its cache which includes support for common storage solutions (e.g. Redis, MongoDB, Memcached, and Riak). Caching is only utilized if methods and plugins explicitly store their state in the cache. The server cache configuration only defines the storage container itself. cache can be assigned:
a prototype function (usually obtained by calling require() on a catbox strategy such as require('catbox-redis')).
a configuration object with the following options:
enginea prototype function or catbox engine object.
namean identifier used later when provisioning or configuring caching for server methods or plugins. Each cache name must be unique. A single item may omit the name option which defines the default cache. If every cache includes a name, a default memory cache is provisions as well.
sharedif true, allows multiple cache users to share the same segment (e.g. multiple methods using the same cache storage container). Default to false.
other options passed to the catbox strategy used.
an array of the above object for configuring multiple cache instances, each with a unique name. When an array of objects is provided, multiple cache connections are established and each array item (except one) must include a name. */
cache?: string|ICatBoxCacheOptions|Array<ICatBoxCacheOptions>|any;
/** sets the default connections configuration which can be overridden by each connection where: */
connections?: IConnectionConfigurationServerDefaults;
/** determines which logged events are sent to the console (this should only be used for development and does not affect which events are actually logged internally and recorded). Set to false to disable all console logging, or to an object*/
debug?: boolean|{
/** - a string array of server log tags to be displayed via console.error() when the events are logged via server.log() as well as internally generated server logs. For example, to display all errors, set the option to ['error']. To turn off all console debug messages set it to false. Defaults to uncaught errors thrown in external code (these errors are handled automatically and result in an Internal Server Error response) or runtime errors due to developer error. */
log: string[];
/** - a string array of request log tags to be displayed via console.error() when the events are logged via request.log() as well as internally generated request logs. For example, to display all errors, set the option to ['error']. To turn off all console debug messages set it to false. Defaults to uncaught errors thrown in external code (these errors are handled automatically and result in an Internal Server Error response) or runtime errors due to developer error.*/
request: string[];
};
/** file system related settings*/
files?: {
/** sets the maximum number of file etag hash values stored in the etags cache. Defaults to 10000.*/
etagsCacheMaxSize?: number;
};
/** process load monitoring*/
load?: {
/** the frequency of sampling in milliseconds. Defaults to 0 (no sampling).*/
sampleInterval?: number;
};
/** options passed to the mimos module (https://github.com/hapijs/mimos) when generating the mime database used by the server and accessed via server.mime.*/
mime?: any;
/** if true, does not load the inert (file and directory support), h2o2 (proxy support), and vision (views support) plugins automatically. The plugins can be loaded manually after construction. Defaults to false (plugins loaded). */
minimal?: boolean;
/** plugin-specific configuration which can later be accessed via server.settings.plugins. plugins is an object where each key is a plugin name and the value is the configuration. Note the difference between server.settings.plugins which is used to store static configuration values and server.plugins which is meant for storing run-time state. Defaults to {}.*/
plugins?: IDictionary<any>;
}
export interface IServerViewCompile {
(template: string, options: any): void;
(template: string, options: any, callback: (err: any, compiled: (context: any, options: any, callback: (err: any, rendered: boolean) => void) => void) => void): void;
}
export interface IServerViewsAdditionalOptions {
/** path - the root file path used to resolve and load the templates identified when calling reply.view().Defaults to current working directory.*/
path?: string;
/**partialsPath - the root file path where partials are located.Partials are small segments of template code that can be nested and reused throughout other templates.Defaults to no partials support (empty path).
*/
partialsPath?: string;
/**helpersPath - the directory path where helpers are located.Helpers are functions used within templates to perform transformations and other data manipulations using the template context or other inputs.Each '.js' file in the helpers directory is loaded and the file name is used as the helper name.The files must export a single method with the signature function(context) and return a string.Sub - folders are not supported and are ignored.Defaults to no helpers support (empty path).Note that jade does not support loading helpers this way.*/
helpersPath?: string;
/**relativeTo - a base path used as prefix for path and partialsPath.No default.*/
relativeTo?: string;
/**layout - if set to true or a layout filename, layout support is enabled.A layout is a single template file used as the parent template for other view templates in the same engine.If true, the layout template name must be 'layout.ext' where 'ext' is the engine's extension. Otherwise, the provided filename is suffixed with the engine's extension and loaded.Disable layout when using Jade as it will handle including any layout files independently.Defaults to false.*/
layout?: boolean;
/**layoutPath - the root file path where layout templates are located (using the relativeTo prefix if present). Defaults to path.*/
layoutPath?: string;
/**layoutKeyword - the key used by the template engine to denote where primary template content should go.Defaults to 'content'.*/
layoutKeywork?: string;
/**encoding - the text encoding used by the templates when reading the files and outputting the result.Defaults to 'utf8'.*/
encoding?: string;
/**isCached - if set to false, templates will not be cached (thus will be read from file on every use).Defaults to true.*/
isCached?: boolean;
/**allowAbsolutePaths - if set to true, allows absolute template paths passed to reply.view().Defaults to false.*/
allowAbsolutePaths?: boolean;
/**allowInsecureAccess - if set to true, allows template paths passed to reply.view() to contain '../'.Defaults to false.*/
allowInsecureAccess?: boolean;
/**compileOptions - options object passed to the engine's compile function. Defaults to empty options {}.*/
compileOptions?: any;
/**runtimeOptions - options object passed to the returned function from the compile operation.Defaults to empty options {}.*/
runtimeOptions?: any;
/**contentType - the content type of the engine results.Defaults to 'text/html'.*/
contentType?: string;
/**compileMode - specify whether the engine compile() method is 'sync' or 'async'.Defaults to 'sync'.*/
compileMode?: string;
/**context - a global context used with all templates.The global context option can be either an object or a function that takes no arguments and returns a context object.When rendering views, the global context will be merged with any context object specified on the handler or using reply.view().When multiple context objects are used, values from the global context always have lowest precedence.*/
context?: any;
}
export interface IServerViewsEnginesOptions extends IServerViewsAdditionalOptions {
/**- the npm module used for rendering the templates.The module object must contain: "module", the rendering function. The required function signature depends on the compileMode settings.
* If the compileMode is 'sync', the signature is compile(template, options), the return value is a function with signature function(context, options), and the method is allowed to throw errors.If the compileMode is 'async', the signature is compile(template, options, callback) where callback has the signature function(err, compiled) where compiled is a function with signature function(context, options, callback) and callback has the signature function(err, rendered).*/
module: {
compile? (template: any, options: any): (context: any, options: any) => void;
compile? (template: any, options: any, callback: (err: any, compiled: (context: any, options: any, callback: (err: any, rendered: any) => void) => void) => void): void;
};
}
/**Initializes the server views manager
var Hapi = require('hapi');
var server = new Hapi.Server();
server.views({
engines: {
html: require('handlebars'),
jade: require('jade')
},
path: '/static/templates'
});
When server.views() is called within a plugin, the views manager is only available to plugins methods.
*/
export interface IServerViewsConfiguration extends IServerViewsAdditionalOptions {
/** - required object where each key is a file extension (e.g. 'html', 'hbr'), mapped to the npm module used for rendering the templates.Alternatively, the extension can be mapped to an object with the following options:*/
engines: IDictionary<any>|IServerViewsEnginesOptions;
/** defines the default filename extension to append to template names when multiple engines are configured and not explicit extension is provided for a given template. No default value.*/
defaultExtension?: string;
}
/** Concludes the handler activity by setting a response and returning control over to the framework where:
erran optional error response.
resultan optional response payload.
Since an request can only have one response regardless if it is an error or success, the reply() method can only result in a single response value. This means that passing both an err and result will only use the err. There is no requirement for either err or result to be (or not) an Error object. The framework will simply use the first argument if present, otherwise the second. The method supports two arguments to be compatible with the common callback pattern of error first.
FLOW CONTROL:
When calling reply(), the framework waits until process.nextTick() to continue processing the request and transmit the response. This enables making changes to the returned response object before the response is sent. This means the framework will resume as soon as the handler method exits. To suspend this behavior, the returned response object supports the following methods: hold(), send() */
export interface IReply {
<T>(err: Error,
result?: string|number|boolean|Buffer|stream.Stream | Promise<T> | T,
/** Note that when used to return both an error and credentials in the authentication methods, reply() must be called with three arguments function(err, null, data) where data is the additional authentication information. */
credentialData?: any
): IBoom;
/** Note that if result is a Stream with a statusCode property, that status code will be used as the default response code. */
<T>(result: string|number|boolean|Buffer|stream.Stream | Promise<T> | T): Response;
/** Returns control back to the framework without setting a response. If called in the handler, the response defaults to an empty payload with status code 200.
* The data argument is only used for passing back authentication data and is ignored elsewhere. */
continue(credentialData?: any): void;
/** Transmits a file from the file system. The 'Content-Type' header defaults to the matching mime type based on filename extension. The response flow control rules do not apply. */
file(
/** the file path. */
path: string,
/** optional settings: */
options?: {
/** - an optional filename to specify if sending a 'Content-Disposition' header, defaults to the basename of path*/
filename?: string;
/** specifies whether to include the 'Content-Disposition' header with the response. Available values:
false - header is not included. This is the default value.
'attachment'
'inline'*/
mode?: boolean|string;
/** if true, looks for the same filename with the '.gz' suffix for a pre-compressed version of the file to serve if the request supports content encoding. Defaults to false. */
lookupCompressed: boolean;
}): void;
/** Concludes the handler activity by returning control over to the router with a templatized view response.
the response flow control rules apply. */
view(
/** the template filename and path, relative to the templates path configured via the server views manager. */
template: string,
/** optional object used by the template to render context-specific result. Defaults to no context {}. */
context?: {},
/** optional object used to override the server's views manager configuration for this response. Cannot override isCached, partialsPath, or helpersPath which are only loaded at initialization. */
options?: any): Response;
/** Concludes the handler activity by returning control over to the router and informing the router that a response has already been sent back directly via request.raw.res and that no further response action is needed
The response flow control rules do not apply. */
close(options?: {
/** if false, the router will not call request.raw.res.end()) to ensure the response was ended. Defaults to true. */
end?: boolean;
}): void;
/** Proxies the request to an upstream endpoint.
the response flow control rules do not apply. */
proxy(/** an object including the same keys and restrictions defined by the route proxy handler options. */
options: IProxyHandlerConfig): void;
/** Redirects the client to the specified uri. Same as calling reply().redirect(uri).
he response flow control rules apply. */
redirect(uri: string): Response;
}
export interface ISessionHandler {
(request: Request, reply: IReply): void;
}
export interface IRequestHandler<T> {
(request: Request): T;
}
export interface IFailAction {
(source: string, error: any, next: () => void): void
}
/** generates a reverse proxy handler */
export interface IProxyHandlerConfig {
/** the upstream service host to proxy requests to. The same path on the client request will be used as the path on the host.*/
host?: string;
/** the upstream service port. */
port?: number;
/** The protocol to use when making a request to the proxied host:
'http'
'https'*/
protocol?: string;
/** an absolute URI used instead of the incoming host, port, protocol, path, and query. Cannot be used with host, port, protocol, or mapUri.*/
uri?: string;
/** if true, forwards the headers sent from the client to the upstream service being proxied to, headers sent from the upstream service will also be forwarded to the client. Defaults to false.*/
passThrough?: boolean;
/** localStatePassThrough - if false, any locally defined state is removed from incoming requests before being passed upstream. This is a security feature to prevent local state (e.g. authentication cookies) from leaking upstream to other servers along with the cookies intended for those servers. This value can be overridden on a per state basis via the server.state() passThrough option. Defaults to false.*/
localStatePassThrough?: boolean;
/**acceptEncoding - if false, does not pass-through the 'Accept-Encoding' HTTP header which is useful when using an onResponse post-processing to avoid receiving an encoded response (e.g. gzipped). Can only be used together with passThrough. Defaults to true (passing header).*/
acceptEncoding?: boolean;
/** rejectUnauthorized - sets the rejectUnauthorized property on the https agent making the request. This value is only used when the proxied server uses TLS/SSL. When set it will override the node.js rejectUnauthorized property. If false then ssl errors will be ignored. When true the server certificate is verified and an 500 response will be sent when verification fails. This shouldn't be used alongside the agent setting as the agent will be used instead. Defaults to the https agent default value of true.*/
rejectUnauthorized?: boolean;
/**if true, sets the 'X-Forwarded-For', 'X-Forwarded-Port', 'X-Forwarded-Proto' headers when making a request to the proxied upstream endpoint. Defaults to false.*/
xforward?: boolean;
/** the maximum number of HTTP redirections allowed, to be followed automatically by the handler. Set to false or 0 to disable all redirections (the response will contain the redirection received from the upstream service). If redirections are enabled, no redirections (301, 302, 307, 308) will be passed along to the client, and reaching the maximum allowed redirections will return an error response. Defaults to false.*/
redirects?: boolean|number;
/**number of milliseconds before aborting the upstream request. Defaults to 180000 (3 minutes).*/
timeout?: number;
/** a function used to map the request URI to the proxied URI. Cannot be used together with host, port, protocol, or uri. The function signature is function(request, callback) where:
request - is the incoming request object.
callback - is function(err, uri, headers) where:
err - internal error condition.
uri - the absolute proxy URI.
headers - optional object where each key is an HTTP request header and the value is the header content.*/
mapUri?: (request: Request, callback: (err: any, uri: string, headers?: { [key: string]: string }) => void) => void;
/** a custom function for processing the response from the upstream service before sending to the client. Useful for custom error handling of responses from the proxied endpoint or other payload manipulation. Function signature is function(err, res, request, reply, settings, ttl) where: - err - internal or upstream error returned from attempting to contact the upstream proxy. - res - the node response object received from the upstream service. res is a readable stream (use the wreck module read method to easily convert it to a Buffer or string). - request - is the incoming request object. - reply - the reply interface function. - settings - the proxy handler configuration. - ttl - the upstream TTL in milliseconds if proxy.ttl it set to 'upstream' and the upstream response included a valid 'Cache-Control' header with 'max-age'.*/
onResponse?: (
err: any,
res: http.ServerResponse,
req: Request,
reply: () => void,
settings: IProxyHandlerConfig,
ttl: number
) => void;
/** if set to 'upstream', applies the upstream response caching policy to the response using the response.ttl() method (or passed as an argument to the onResponse method if provided).*/
ttl?: number;
/** - a node http(s) agent to be used for connections to upstream server. see https://nodejs.org/api/http.html#http_class_http_agent */
agent?: http.Agent;
/** sets the maximum number of sockets available per outgoing proxy host connection. false means use the wreck module default value (Infinity). Does not affect non-proxy outgoing client connections. Defaults to Infinity.*/
maxSockets?: boolean|number;
}
/** TODO: fill in joi definition */
export interface IJoi {
}
/** a validation function using the signature function(value, options, next) */
export interface IValidationFunction {
(/** the object containing the path parameters. */
value: any,
/** the server validation options. */
options: any,
/** the callback function called when validation is completed. */
next: (err: any, value: any) => void): void;
}
/** a custom error handler function with the signature 'function(request, reply, source, error)` */
export interface IRouteFailFunction {
/** a custom error handler function with the signature 'function(request, reply, source, error)` */
(
/** - the [request object]. */
request: Request,
/** the continuation reply interface. */
reply: IReply,
/** the source of the invalid field (e.g. 'path', 'query', 'payload'). */
source: string,
/** the error object prepared for the client response (including the validation function error under error.data). */
error: any): void;
}
/** Each route can be customize to change the default behavior of the request lifecycle using the following options: */
export interface IRouteAdditionalConfigurationOptions {
/** application specific configuration.Should not be used by plugins which should use plugins[name] instead. */
app?: any;
/** authentication configuration.Value can be: false to disable authentication if a default strategy is set.
a string with the name of an authentication strategy registered with server.auth.strategy().
an object */
auth?: boolean|string|
{
/** the authentication mode.Defaults to 'required' if a server authentication strategy is configured, otherwise defaults to no authentication.Available values:
'required'authentication is required.
'optional'authentication is optional (must be valid if present).
'try'same as 'optional' but allows for invalid authentication. */
mode: string;
/** a string array of strategy names in order they should be attempted.If only one strategy is used, strategy can be used instead with the single string value.Defaults to the default authentication strategy which is available only when a single strategy is configured. */
strategies?: string | Array<string>;
strategy?: string;
/** if set, the payload (in requests other than 'GET' and 'HEAD') is authenticated after it is processed.Requires a strategy with payload authentication support (e.g.Hawk).Cannot be set to a value other than 'required' when the scheme sets the options.payload to true.Available values:
falseno payload authentication.This is the default value.
'required'payload authentication required.This is the default value when the scheme sets options.payload to true.
'optional'payload authentication performed only when the client includes payload authentication information (e.g.hash attribute in Hawk). */
payload?: string;
/** the application scope required to access the route.Value can be a scope string or an array of scope strings.The authenticated credentials object scope property must contain at least one of the scopes defined to access the route.Set to false to remove scope requirements.Defaults to no scope required. */
scope?: string|Array<string>|boolean;
/** the required authenticated entity type.If set, must match the entity value of the authentication credentials.Available values:
anythe authentication can be on behalf of a user or application.This is the default value.
userthe authentication must be on behalf of a user.
appthe authentication must be on behalf of an application. */
entity?: string;
};
/** an object passed back to the provided handler (via this) when called. */
bind?: any;
/** if the route method is 'GET', the route can be configured to include caching directives in the response using the following options */
cache?: {
/** mines the privacy flag included in clientside caching using the 'Cache-Control' header.Values are:
fault'no privacy flag.This is the default setting.
'public'mark the response as suitable for public caching.
'private'mark the response as suitable only for private caching. */
privacy: string;
/** relative expiration expressed in the number of milliseconds since the item was saved in the cache.Cannot be used together with expiresAt. */
expiresIn: number;
/** time of day expressed in 24h notation using the 'HH:MM' format, at which point all cache records for the route expire.Cannot be used together with expiresIn. */
expiresAt: string;
};
/** the Cross- Origin Resource Sharing protocol allows browsers to make cross- origin API calls.CORS is required by web applications running inside a browser which are loaded from a different domain than the API server.CORS headers are disabled by default. To enable, set cors to true, or to an object with the following options: */
cors?: {
/** a strings array of allowed origin servers ('Access-Control-Allow-Origin').The array can contain any combination of fully qualified origins along with origin strings containing a wildcard '' character, or a single `''origin string. Defaults to any origin['*']`. */
origin?: Array<string>;
/** if true, matches the value of the incoming 'Origin' header to the list of origin values ('*' matches anything) and if a match is found, uses that as the value of the 'Access-Control-Allow-Origin' response header.When false, the origin config is returned as- is.Defaults to true. */
matchOrigin?: boolean;
/** if false, prevents the connection from returning the full list of non- wildcard origin values if the incoming origin header does not match any of the values.Has no impact if matchOrigin is set to false.Defaults to true. */
isOriginExposed?: boolean;
/** number of seconds the browser should cache the CORS response ('Access-Control-Max-Age').The greater the value, the longer it will take before the browser checks for changes in policy.Defaults to 86400 (one day). */
maxAge?: number;
/** a strings array of allowed headers ('Access-Control-Allow-Headers').Defaults to ['Authorization', 'Content-Type', 'If-None-Match']. */
headers?: string[];
/** a strings array of additional headers to headers.Use this to keep the default headers in place. */
additionalHeaders?: string[];
/** a strings array of allowed HTTP methods ('Access-Control-Allow-Methods').Defaults to ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'OPTIONS']. */
methods?: string[];
/** a strings array of additional methods to methods.Use this to keep the default methods in place. */
additionalMethods?: string[];
/** a strings array of exposed headers ('Access-Control-Expose-Headers').Defaults to ['WWW-Authenticate', 'Server-Authorization']. */
exposedHeaders?: string[];
/** a strings array of additional headers to exposedHeaders.Use this to keep the default headers in place. */
additionalExposedHeaders?: string[];
/** if true, allows user credentials to be sent ('Access-Control-Allow-Credentials').Defaults to false. */
credentials?: boolean;
/** if false, preserves existing CORS headers set manually before the response is sent.Defaults to true. */
override?: boolean;
};
/** defines the behavior for serving static resources using the built-in route handlers for files and directories: */
files?: {/** determines the folder relative paths are resolved against when using the file and directory handlers. */
relativeTo: string;
};
/** an alternative location for the route handler option. */
handler?: ISessionHandler | string | IRouteHandlerConfig;
/** an optional unique identifier used to look up the route using server.lookup(). */
id?: number;
/** optional arguments passed to JSON.stringify() when converting an object or error response to a string payload.Supports the following: */
json?: {
/** the replacer function or array.Defaults to no action. */
replacer?: Function | string[];
/** number of spaces to indent nested object keys.Defaults to no indentation. */
space?: number|string;
/** string suffix added after conversion to JSON string.Defaults to no suffix. */
suffix?: string;
};
/** enables JSONP support by setting the value to the query parameter name containing the function name used to wrap the response payload.For example, if the value is 'callback', a request comes in with 'callback=me', and the JSON response is '{ "a":"b" }', the payload will be 'me({ "a":"b" });'.Does not work with stream responses. */
jsonp?: string;
/** determines how the request payload is processed: */
payload?: {
/** the type of payload representation requested. The value must be one of:
'data'the incoming payload is read fully into memory.If parse is true, the payload is parsed (JSON, formdecoded, multipart) based on the 'Content- Type' header.If parse is false, the raw Buffer is returned.This is the default value except when a proxy handler is used.
'stream'the incoming payload is made available via a Stream.Readable interface.If the payload is 'multipart/form-data' and parse is true, fields values are presented as text while files are provided as streams.File streams from a 'multipart/form-data' upload will also have a property hapi containing filename and headers properties.
'file'the incoming payload in written to temporary file in the directory specified by the server's payload.uploads settings. If the payload is 'multipart/ formdata' and parse is true, fields values are presented as text while files are saved. Note that it is the sole responsibility of the application to clean up the files generated by the framework. This can be done by keeping track of which files are used (e.g. using the request.app object), and listening to the server 'response' event to perform any needed cleaup. */
output?: string;
/** can be true, false, or gunzip; determines if the incoming payload is processed or presented raw. true and gunzip includes gunzipping when the appropriate 'Content-Encoding' is specified on the received request. If parsing is enabled and the 'Content-Type' is known (for the whole payload as well as parts), the payload is converted into an object when possible. If the format is unknown, a Bad Request (400) error response is sent. Defaults to true, except when a proxy handler is used. The supported mime types are:
'application/json'
'application/x-www-form-urlencoded'
'application/octet-stream'
'text/ *'
'multipart/form-data' */
parse?: string | boolean;
/** a string or an array of strings with the allowed mime types for the endpoint.Defaults to any of the supported mime types listed above.Note that allowing other mime types not listed will not enable them to be parsed, and that if parsing mode is 'parse', the request will result in an error response. */
allow?: string | string[];
/** a mime type string overriding the 'Content-Type' header value received.Defaults to no override. */
override?: string;
/** limits the size of incoming payloads to the specified byte count.Allowing very large payloads may cause the server to run out of memory.Defaults to 1048576 (1MB). */
maxBytes?: number;
/** payload reception timeout in milliseconds.Sets the maximum time allowed for the client to transmit the request payload (body) before giving up and responding with a Request Timeout (408) error response.Set to false to disable.Defaults to 10000 (10 seconds). */
timeout?: number;
/** the directory used for writing file uploads.Defaults to os.tmpDir(). */
uploads?: string;
/** determines how to handle payload parsing errors. Allowed values are:
'error'return a Bad Request (400) error response. This is the default value.
'log'report the error but continue processing the request.
'ignore'take no action and continue processing the request. */
failAction?: string;
};
/** pluginspecific configuration.plugins is an object where each key is a plugin name and the value is the plugin configuration. */
plugins?: IDictionary<any>;
/** an array with [route prerequisites] methods which are executed in serial or in parallel before the handler is called. */
pre?: any[];
/** validation rules for the outgoing response payload (response body).Can only validate object response: */
response?: {
/** the default response object validation rules (for all non-error responses) expressed as one of:
trueany payload allowed (no validation performed). This is the default.
falseno payload allowed.
a Joi validation object.
a validation function using the signature function(value, options, next) where:
valuethe object containing the response object.
optionsthe server validation options.
next(err)the callback function called when validation is completed. */
schema: boolean|any;
/** HTTP status- codespecific validation rules.The status key is set to an object where each key is a 3 digit HTTP status code and the value has the same definition as schema.If a response status code is not present in the status object, the schema definition is used, expect for errors which are not validated by default. */
status: number;
/** the percent of responses validated (0100).Set to 0 to disable all validation.Defaults to 100 (all responses). */
sample: number;
/** defines what to do when a response fails validation.Options are:
errorreturn an Internal Server Error (500) error response.This is the default value.
loglog the error but send the response. */
failAction: string;
/** if true, applies the validation rule changes to the response.Defaults to false. */
modify: boolean;
/** options to pass to Joi.Useful to set global options such as stripUnknown or abortEarly (the complete list is available here: https://github.com/hapijs/joi#validatevalue-schema-options-callback ).Defaults to no options. */
options: any;
};
/** sets common security headers (disabled by default).To enable set security to true or to an object with the following options */
security?: boolean| {
/** controls the 'Strict-Transport-Security' header.If set to true the header will be set to max- age=15768000, if specified as a number the maxAge parameter will be set to that number.Defaults to true.You may also specify an object with the following fields: */
hsts: boolean|number|{
/** the max- age portion of the header, as a number.Default is 15768000. */
maxAge?: number;
/** a boolean specifying whether to add the includeSubdomains flag to the header. */
includeSubdomains?: boolean;
};
/** controls the 'X-Frame-Options' header.When set to true the header will be set to DENY, you may also specify a string value of 'deny' or 'sameorigin'.To use the 'allow-from' rule, you must set this to an object with the following fields: */
xframe: {
/** either 'deny', 'sameorigin', or 'allow-from' */
rule: string;
/** when rule is 'allow-from' this is used to form the rest of the header, otherwise this field is ignored.If rule is 'allow-from' but source is unset, the rule will be automatically changed to 'sameorigin'. */
source: string;
};
/** boolean that controls the 'X-XSS-PROTECTION' header for IE.Defaults to true which sets the header to equal '1; mode=block'.NOTE: This setting can create a security vulnerability in versions of IE below 8, as well as unpatched versions of IE8.See here and here for more information.If you actively support old versions of IE, it may be wise to explicitly set this flag to false. */
xss: boolean;
/** boolean controlling the 'X-Download-Options' header for IE, preventing downloads from executing in your context.Defaults to true setting the header to 'noopen'. */
noOpen: boolean;
/** boolean controlling the 'X-Content-Type-Options' header.Defaults to true setting the header to its only and default option, 'nosniff'. */
noSniff: boolean;
};
/** HTTP state management (cookies) allows the server to store information on the client which is sent back to the server with every request (as defined in RFC 6265).state supports the following options: */
state?: {
/** determines if incoming 'Cookie' headers are parsed and stored in the request.state object.Defaults to true. */
parse: boolean;
/** determines how to handle cookie parsing errors.Allowed values are:
'error'return a Bad Request (400) error response.This is the default value.
'log'report the error but continue processing the request.
'ignore'take no action. */
failAction: string;
};
/** request input validation rules for various request components.When using a Joi validation object, the values of the other inputs (i.e.headers, query, params, payload, and auth) are made available under the validation context (accessible in rules as Joi.ref('$query.key')).Note that validation is performed in order(i.e.headers, params, query, payload) and if type casting is used (converting a string to number), the value of inputs not yet validated will reflect the raw, unvalidated and unmodified values.The validate object supports: */
validate?: {
/** validation rules for incoming request headers.Values allowed:
* trueany headers allowed (no validation performed).This is the default.
falseno headers allowed (this will cause all valid HTTP requests to fail).
a Joi validation object.
a validation function using the signature function(value, options, next) where:
valuethe object containing the request headers.
optionsthe server validation options.
next(err, value)the callback function called when validation is completed.
*/
headers?: boolean | IJoi | IValidationFunction;
/** validation rules for incoming request path parameters, after matching the path against the route and extracting any parameters then stored in request.params.Values allowed:
trueany path parameters allowed (no validation performed).This is the default.
falseno path variables allowed.
a Joi validation object.
a validation function using the signature function(value, options, next) where:
valuethe object containing the path parameters.
optionsthe server validation options.
next(err, value)the callback function called when validation is completed. */
params?: boolean | IJoi | IValidationFunction;
/** validation rules for an incoming request URI query component (the key- value part of the URI between '?' and '#').The query is parsed into its individual key- value pairs (using the qs module) and stored in request.query prior to validation.Values allowed:
trueany query parameters allowed (no validation performed).This is the default.
falseno query parameters allowed.
a Joi validation object.
a validation function using the signature function(value, options, next) where:
valuethe object containing the query parameters.
optionsthe server validation options.
next(err, value)the callback function called when validation is completed. */
query?: boolean | IJoi | IValidationFunction;
/** validation rules for an incoming request payload (request body).Values allowed:
trueany payload allowed (no validation performed).This is the default.
falseno payload allowed.
a Joi validation object.
a validation function using the signature function(value, options, next) where:
valuethe object containing the payload object.
optionsthe server validation options.
next(err, value)the callback function called when validation is completed. */
payload?: boolean | IJoi | IValidationFunction;
/** an optional object with error fields copied into every validation error response. */
errorFields?: any;
/** determines how to handle invalid requests.Allowed values are:
'error'return a Bad Request (400) error response.This is the default value.
'log'log the error but continue processing the request.
'ignore'take no action.
OR a custom error handler function with the signature 'function(request, reply, source, error)` where:
requestthe request object.
replythe continuation reply interface.
sourcethe source of the invalid field (e.g. 'path', 'query', 'payload').
errorthe error object prepared for the client response (including the validation function error under error.data). */
failAction?: string | IRouteFailFunction;
/** options to pass to Joi.Useful to set global options such as stripUnknown or abortEarly (the complete list is available here: https://github.com/hapijs/joi#validatevalue-schema-options-callback ).Defaults to no options. */
options?: any;
};
/** define timeouts for processing durations: */
timeout?: {
/** response timeout in milliseconds.Sets the maximum time allowed for the server to respond to an incoming client request before giving up and responding with a Service Unavailable (503) error response.Disabled by default (false). */
server: boolean|number;
/** by default, node sockets automatically timeout after 2 minutes.Use this option to override this behavior.Defaults to undefined which leaves the node default unchanged.Set to false to disable socket timeouts. */
socket: boolean|number;
};
/** ONLY WHEN ADDING NEW ROUTES (not when setting defaults).
*route description used for generating documentation (string).
*/
description?: string;
/** ONLY WHEN ADDING NEW ROUTES (not when setting defaults).
*route notes used for generating documentation (string or array of strings).
*/
notes?: string|string[];
/** ONLY WHEN ADDING NEW ROUTES (not when setting defaults).
*route tags used for generating documentation (array of strings).
*/
tags?: string[]
}
/** server.realm http://hapijs.com/api#serverrealm
The realm object contains server-wide or plugin-specific state that can be shared across various methods. For example, when calling server.bind(),
the active realm settings.bind property is set which is then used by routes and extensions added at the same level (server root or plugin).
Realms are a limited version of a sandbox where plugins can maintain state used by the framework when adding routes, extensions, and other properties.
The server.realm object should be considered read-only and must not be changed directly except for the plugins property can be directly manipulated by the plugins (each setting its own under plugins[name]).
exports.register = function (server, options, next) {
console.log(server.realm.modifiers.route.prefix);
return next();
};
*/
export interface IServerRealm {
/** when the server object is provided as an argument to the plugin register() method, modifiers provides the registration preferences passed the server.register() method */
modifiers: {
/** routes preferences: */
route: {
/** - the route path prefix used by any calls to server.route() from the server. */
prefix: string;
/** the route virtual host settings used by any calls to server.route() from the server. */
vhost: string;
};
};
/** the active plugin name (empty string if at the server root). */
plugin: string;
/** plugin-specific state to be shared only among activities sharing the same active state. plugins is an object where each key is a plugin name and the value is the plugin state. */
plugins: IDictionary<any>;
/** settings overrides */
settings: {
files: {
relativeTo: any;
};
bind: any;
}
}
/** server.state(name, [options]) http://hapijs.com/api#serverstatename-options
HTTP state management uses client cookies to persist a state across multiple requests. Registers a cookie definitions where:*/
export interface IServerState {
/** - the cookie name string. */name: string;
/** - are the optional cookie settings: */options: {
/** - time - to - live in milliseconds.Defaults to null (session time- life - cookies are deleted when the browser is closed).*/ttl: number;
/** - sets the 'Secure' flag.Defaults to false.*/isSecure: boolean;
/** - sets the 'HttpOnly' flag.Defaults to false.*/isHttpOnly: boolean
/** - the path scope.Defaults to null (no path).*/path: any;
/** - the domain scope.Defaults to null (no domain). */domain: any;
/** if present and the cookie was not received from the client or explicitly set by the route handler, the cookie is automatically added to the response with the provided value. The value can be a function with signature function(request, next) where:
request - the request object.
next - the continuation function using the function(err, value) signature.*/
autoValue: (request: Request, next: (err: any, value: any) => void) => void;
/** - encoding performs on the provided value before serialization. Options are:
'none' - no encoding. When used, the cookie value must be a string. This is the default value.
'base64' - string value is encoded using Base64.
'base64json' - object value is JSON-stringified than encoded using Base64.
'form' - object value is encoded using the x-www-form-urlencoded method.
'iron' - Encrypts and sign the value using iron.*/
encoding: string;
/** - an object used to calculate an HMAC for cookie integrity validation.This does not provide privacy, only a mean to verify that the cookie value was generated by the server.Redundant when 'iron' encoding is used.Options are:*/sign: {
/** - algorithm options.Defaults to require('iron').defaults.integrity.*/integrity: any;
/** - password used for HMAC key generation.*/password: string;
};
/** - password used for 'iron' encoding.*/password: string;
/** - options for 'iron' encoding.Defaults to require('iron').defaults.*/iron: any;
/** - if false, errors are ignored and treated as missing cookies.*/ignoreErrors: boolean;
/** - if true, automatically instruct the client to remove invalid cookies.Defaults to false.*/clearInvalid: boolean;
/** - if false, allows any cookie value including values in violation of RFC 6265. Defaults to true.*/strictHeader: boolean;
/** - overrides the default proxy localStatePassThrough setting.*/passThrough: any;
};
}
export interface IFileHandlerConfig {
/** a path string or function as described above.*/
path: string;
/** an optional filename to specify if sending a 'Content-Disposition' header, defaults to the basename of path*/
filename?: string;
/**- specifies whether to include the 'Content-Disposition' header with the response. Available values:
false - header is not included. This is the default value.
'attachment'
'inline'*/
mode?: boolean| string;
/** if true, looks for the same filename with the '.gz' suffix for a pre-compressed version of the file to serve if the request supports content encoding. Defaults to false.*/
lookupCompressed: boolean;
}
/**http://hapijs.com/api#route-handler
Built-in handlers
The framework comes with a few built-in handler types available by setting the route handler config to an object containing one of these keys.*/
export interface IRouteHandlerConfig {
/** generates a static file endpoint for serving a single file. file can be set to:
a relative or absolute file path string (relative paths are resolved based on the route files configuration).
a function with the signature function(request) which returns the relative or absolute file path.
an object with the following options */
file?: string | IRequestHandler<void> |IFileHandlerConfig;
/** directory - generates a directory endpoint for serving static content from a directory. Routes using the directory handler must include a path parameter at the end of the path string (e.g. /path/to/somewhere/{param} where the parameter name does not matter). The path parameter can use any of the parameter options (e.g. {param} for one level files only, {param?} for one level files or the directory root, {param*} for any level, or {param*3} for a specific level). If additional path parameters are present, they are ignored for the purpose of selecting the file system resource. The directory handler is an object with the following options:
path - (required) the directory root path (relative paths are resolved based on the route files configuration). Value can be:
a single path string used as the prefix for any resources requested by appending the request path parameter to the provided string.
an array of path strings. Each path will be attempted in order until a match is found (by following the same process as the single path string).
a function with the signature function(request) which returns the path string or an array of path strings. If the function returns an error, the error is passed back to the client in the response.
index - optional boolean|string|string[], determines if an index file will be served if found in the folder when requesting a directory. The given string or strings specify the name(s) of the index file to look for. If true, looks for 'index.html'. Any falsy value disables index file lookup. Defaults to true.
listing - optional boolean, determines if directory listing is generated when a directory is requested without an index document. Defaults to false.
showHidden - optional boolean, determines if hidden files will be shown and served. Defaults to false.
redirectToSlash - optional boolean, determines if requests for a directory without a trailing slash are redirected to the same path with the missing slash. Useful for ensuring relative links inside the response are resolved correctly. Disabled when the server config router.stripTrailingSlash is true.Defaults to false.
lookupCompressed - optional boolean, instructs the file processor to look for the same filename with the '.gz' suffix for a pre-compressed version of the file to serve if the request supports content encoding. Defaults to false.
defaultExtension - optional string, appended to file requests if the requested file is not found. Defaults to no extension.*/
directory?: {
path: string |Array<string> | IRequestHandler<string> | IRequestHandler<Array<string>>;
index?: boolean;
listing?: boolean;
showHidden?: boolean;
redirectToSlash?: boolean;
lookupCompressed?: boolean;
defaultExtension?: string;
};
proxy?: IProxyHandlerConfig;
view?: string | {
template: string;
context: {
payload: any;
params: any;
query: any;
pre: any;
}
};
config?: {
handler: any;
bind: any;
app: any;
plugins: {
[name: string]: any;
};
pre: Array<() => void>;
validate: {
headers: any;
params: any;
query: any;
payload: any;
errorFields?: any;
failAction?: string | IFailAction;
};
payload: {
output: {
data: any;
stream: any;
file: any;
};
parse?: any;
allow?: string|Array<string>;
override?: string;
maxBytes?: number;
uploads?: number;
failAction?: string;
};
response: {
schema: any;
sample: number;
failAction: string;
};
cache: {
privacy: string;
expiresIn: number;
expiresAt: number;
};
auth: string|boolean|{
mode: string;
strategies: Array<string>;
payload?: boolean|string;
tos?: boolean|string;
scope?: string|Array<string>;
entity: string;
};
cors?: boolean;
jsonp?: string;
description?: string;
notes?: string|Array<string>;
tags?: Array<string>;
};
}
/** Route configuration
The route configuration object*/
export interface IRouteConfiguration {
/** - (required) the absolute path used to match incoming requests (must begin with '/'). Incoming requests are compared to the configured paths based on the connection router configuration option.The path can include named parameters enclosed in {} which will be matched against literal values in the request as described in Path parameters.*/
path: string;
/** - (required) the HTTP method.Typically one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', or 'OPTIONS'.Any HTTP method is allowed, except for 'HEAD'.Use '*' to match against any HTTP method (only when an exact match was not found, and any match with a specific method will be given a higher priority over a wildcard match).
* Can be assigned an array of methods which has the same result as adding the same route with different methods manually.*/
method: string|string[];
/** - an optional domain string or an array of domain strings for limiting the route to only requests with a matching host header field.Matching is done against the hostname part of the header only (excluding the port).Defaults to all hosts.*/
vhost?: string;
/** - (required) the function called to generate the response after successful authentication and validation.The handler function is described in Route handler.If set to a string, the value is parsed the same way a prerequisite server method string shortcut is processed.Alternatively, handler can be assigned an object with a single key using the name of a registered handler type and value with the options passed to the registered handler.*/
handler: ISessionHandler | string | IRouteHandlerConfig;
/** - additional route options.*/
config?: IRouteAdditionalConfigurationOptions;
}
/** Route public interface When route information is returned or made available as a property. http://hapijs.com/api#route-public-interface */
export interface IRoute {
/** the route HTTP method. */
method: string;
/** the route path. */
path: string;
/** the route vhost option if configured. */
vhost?: string|Array<string>;
/** the [active realm] associated with the route.*/
realm: IServerRealm;
/** the [route options] object with all defaults applied. */
settings: IRouteAdditionalConfigurationOptions;
}
export interface IServerAuthScheme {
/** authenticate(request, reply) - required function called on each incoming request configured with the authentication scheme where:
request - the request object.
reply - the reply interface the authentication method must call when done authenticating the request where:
reply(err, response, result) - is called if authentication failed where:
err - any authentication error.
response - any authentication response action such as redirection. Ignored if err is present, otherwise required.
result - an object containing:
credentials - the authenticated credentials.
artifacts - optional authentication artifacts.
reply.continue(result) - is called if authentication succeeded where:
result - same object as result above.
When the scheme authenticate() method implementation calls reply() with an error condition, the specifics of the error affect whether additional authentication strategies will be attempted if configured for the route.
.If the err returned by the reply() method includes a message, no additional strategies will be attempted.
If the err does not include a message but does include a scheme name (e.g. Boom.unauthorized(null, 'Custom')), additional strategies will be attempted in order of preference.
var server = new Hapi.Server();
server.connection({ port: 80 });
var scheme = function (server, options) {
return {
authenticate: function (request, reply) {
var req = request.raw.req;
var authorization = req.headers.authorization;
if (!authorization) {
return reply(Boom.unauthorized(null, 'Custom'));
}
return reply(null, { credentials: { user: 'john' } });
}
};
};
server.auth.scheme('custom', scheme);*/
authenticate(request: Request, reply: IReply): void;
/** payload(request, reply) - optional function called to authenticate the request payload where:
request - the request object.
reply(err, response) - is called if authentication failed where:
err - any authentication error.
response - any authentication response action such as redirection. Ignored if err is present, otherwise required.
reply.continue() - is called if payload authentication succeeded.
When the scheme payload() method returns an error with a message, it means payload validation failed due to bad payload. If the error has no message but includes a scheme name (e.g. Boom.unauthorized(null, 'Custom')), authentication may still be successful if the route auth.payload configuration is set to 'optional'.*/
payload? (request: Request, reply: IReply): void;
/** response(request, reply) - optional function called to decorate the response with authentication headers before the response headers or payload is written where:
request - the request object.
reply(err, response) - is called if an error occurred where:
err - any authentication error.
response - any authentication response to send instead of the current response. Ignored if err is present, otherwise required.
reply.continue() - is called if the operation succeeded.*/
response? (request: Request, reply: IReply): void;
/** an optional object */
options?: {
/** if true, requires payload validation as part of the scheme and forbids routes from disabling payload auth validation. Defaults to false.*/
payload: boolean;
}
}
export interface IServerInject {
(options: {
/** the request HTTP method (e.g. 'POST'). Defaults to 'GET'.*/
method: string;
/** the request URL. If the URI includes an authority (e.g. 'example.com:8080'), it is used to automatically set an HTTP 'Host' header, unless one was specified in headers.*/
url: string;
/** an object with optional request headers where each key is the header name and the value is the header content. Defaults to no additions to the default Shot headers.*/
headers: IDictionary<string>;
/**- an optional string or buffer containing the request payload (object must be manually converted to a string first). Defaults to no payload. Note that payload processing defaults to 'application/json' if no 'Content-Type' header provided.*/
payload: string|Buffer;
/**an optional credentials object containing authentication information. The credentials are used to bypass the default authentication strategies, and are validated directly as if they were received via an authentication scheme. Defaults to no credentials.*/
credentials: any;
/**object with options used to simulate client request stream conditions for testing:
error - if true, emits an 'error' event after payload transmission (if any). Defaults to false.
close - if true, emits a 'close' event after payload transmission (if any). Defaults to false.
end - if false, does not end the stream. Defaults to true.*/
simulate: {
error: boolean;
close: boolean;
end: boolean;
};
},
callback: (
/**the response object where:
statusCode - the HTTP status code.
headers - an object containing the headers set.
payload - the response payload string.
rawPayload - the raw response payload buffer.
raw - an object with the injection request and response objects:
req - the simulated node request object.
res - the simulated node response object.
result - the raw handler response (e.g. when not a stream or a view) before it is serialized for transmission. If not available, the value is set to payload. Useful for inspection and reuse of the internal objects returned (instead of parsing the response string).
request - the request object.*/
res: { statusCode: number; headers: IDictionary<string>; payload: string; rawPayload: Buffer; raw: { req: http.ClientRequest; res: http.ServerResponse }; result: string; request: Request }) => void
):void;
}
/** host - optional host to filter routes matching a specific virtual host. Defaults to all virtual hosts.
The return value is an array where each item is an object containing:
info - the connection.info the connection the table was generated for.
labels - the connection labels.
table - an array of routes where each route contains:
settings - the route config with defaults applied.
method - the HTTP method in lower case.
path - the route path.*/
export interface IConnectionTable {
info: any;
labels: any;
table: IRoute[];
}
export interface ICookieSettings {
/** - time - to - live in milliseconds.Defaults to null (session time- life - cookies are deleted when the browser is closed).*/
ttl?: number;
/** - sets the 'Secure' flag.Defaults to false.*/
isSecure?: boolean;
/** - sets the 'HttpOnly' flag.Defaults to false.*/
isHttpOnly?: boolean;
/** - the path scope.Defaults to null (no path).*/
path?: string;
/** - the domain scope.Defaults to null (no domain).*/
domain?: any;
/** - if present and the cookie was not received from the client or explicitly set by the route handler, the cookie is automatically added to the response with the provided value.The value can be a function with signature function(request, next) where:
request - the request object.
next - the continuation function using the function(err, value) signature.*/
autoValue?: (request: Request, next: (err: any, value: any) => void) => void;
/** - encoding performs on the provided value before serialization.Options are:
'none' - no encoding.When used, the cookie value must be a string.This is the default value.
'base64' - string value is encoded using Base64.
'base64json' - object value is JSON- stringified than encoded using Base64.
'form' - object value is encoded using the x- www - form - urlencoded method. */
encoding?: string;
/** - an object used to calculate an HMAC for cookie integrity validation.This does not provide privacy, only a mean to verify that the cookie value was generated by the server.Redundant when 'iron' encoding is used.Options are:
integrity - algorithm options.Defaults to require('iron').defaults.integrity.
password - password used for HMAC key generation. */
sign?: { integrity: any; password: string; }
password?: string;
iron?: any;
ignoreErrors?: boolean;
clearInvalid?: boolean;
strictHeader?: boolean;
passThrough?: any;
}
/** method - the method function with the signature is one of:
function(arg1, arg2, ..., argn, next) where:
arg1, arg2, etc. - the method function arguments.
next - the function called when the method is done with the signature function(err, result, ttl) where:
err - error response if the method failed.
result - the return value.
ttl - 0 if result is valid but cannot be cached. Defaults to cache policy.
function(arg1, arg2, ..., argn) where:
arg1, arg2, etc. - the method function arguments.
the callback option is set to false.
the method must returns a value (result, Error, or a promise) or throw an Error.*/
export interface IServerMethod {
//(): void;
//(next: (err: any, result: any, ttl: number) => void): void;
//(arg1: any): void;
//(arg1: any, arg2: any, next: (err: any, result: any, ttl: number) => void): void;
//(arg1: any, arg2: any): void;
(...args: any[]): void;
}
/** options - optional configuration:
bind - a context object passed back to the method function (via this) when called. Defaults to active context (set via server.bind() when the method is registered.
cache - the same cache configuration used in server.cache().
callback - if false, expects the method to be a synchronous function. Note that using a synchronous function with caching will convert the method interface to require a callback as an additional argument with the signature function(err, result, cached, report) since the cache interface cannot return values synchronously. Defaults to true.
generateKey - a function used to generate a unique key (for caching) from the arguments passed to the method function (the callback argument is not passed as input). The server will automatically generate a unique key if the function's arguments are all of types 'string', 'number', or 'boolean'. However if the method uses other types of arguments, a key generation function must be provided which takes the same arguments as the function and returns a unique string (or null if no key can be generated).*/
export interface IServerMethodOptions {
bind?: any;
cache?: ICatBoxCacheOptions;
callback?: boolean;
generateKey?(args: any[]): string;
}
/** Request object
The request object is created internally for each incoming request. It is different from the node.js request object received from the HTTP server callback (which is available in request.raw.req). The request object methods and properties change throughout the request lifecycle.
Request events
The request object supports the following events:
'peek' - emitted for each chunk of payload data read from the client connection. The event method signature is function(chunk, encoding).
'finish' - emitted when the request payload finished reading. The event method signature is function ().
'disconnect' - emitted when a request errors or aborts unexpectedly.
var Crypto = require('crypto');
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
server.ext('onRequest', function (request, reply) {
var hash = Crypto.createHash('sha1');
request.on('peek', function (chunk) {
hash.update(chunk);
});
request.once('finish', function () {
console.log(hash.digest('hex'));
});
request.once('disconnect', function () {
console.error('request aborted');
});
return reply.continue();
});*/
export class Request extends Events.EventEmitter {
/** application-specific state. Provides a safe place to store application data without potential conflicts with the framework. Should not be used by plugins which should use plugins[name].*/
app: any;
/** authentication information*/
auth: {
/** true is the request has been successfully authenticated, otherwise false.*/
isAuthenticated: boolean;
/** the credential object received during the authentication process. The presence of an object does not mean successful authentication.*/
credentials: any;
/** an artifact object received from the authentication strategy and used in authentication-related actions.*/
artifacts: any;
/** the route authentication mode.*/
mode: any;
/** the authentication error is failed and mode set to 'try'.*/
error: any;
/** an object used by the ['cookie' authentication scheme] https://github.com/hapijs/hapi-auth-cookie */
session: any
};
/** the node domain object used to protect against exceptions thrown in extensions, handlers and route prerequisites. Can be used to manually bind callback functions otherwise bound to other domains.*/
domain: any;
/** the raw request headers (references request.raw.headers).*/
headers: IDictionary<string>;
/** a unique request identifier (using the format '{now}:{connection.info.id}:{5 digits counter}').*/
id: number;
/** request information */
info: {
/** request reception timestamp. */
received: number;
/** request response timestamp (0 is not responded yet). */
responded: number;
/** remote client IP address. */
remoteAddress: string;
/** remote client port. */
remotePort: number;
/** content of the HTTP 'Referrer' (or 'Referer') header. */
referrer: string;
/** content of the HTTP 'Host' header (e.g. 'example.com:8080'). */
host: string;
/** the hostname part of the 'Host' header (e.g. 'example.com').*/
hostname: string;
};
/** the request method in lower case (e.g. 'get', 'post'). */
method: string;
/** the parsed content-type header. Only available when payload parsing enabled and no payload error occurred. */
mime: string;
/** an object containing the values of params, query, and payload before any validation modifications made. Only set when input validation is performed.*/
orig: {
params: any;
query: any;
payload: any;
};
/** an object where each key is a path parameter name with matching value as described in Path parameters.*/
params: IDictionary<string>;
/** an array containing all the path params values in the order they appeared in the path.*/
paramsArray: string[];
/** the request URI's path component. */
path: string;
/** the request payload based on the route payload.output and payload.parse settings.*/
payload: any;
/** plugin-specific state. Provides a place to store and pass request-level plugin data. The plugins is an object where each key is a plugin name and the value is the state.*/
plugins: any;
/** an object where each key is the name assigned by a route prerequisites function. The values are the raw values provided to the continuation function as argument. For the wrapped response object, use responses.*/
pre: IDictionary<any>;
/** the response object when set. The object can be modified but must not be assigned another object. To replace the response with another from within an extension point, use reply(response) to override with a different response. Contains null when no response has been set (e.g. when a request terminates prematurely when the client disconnects).*/
response: Response;
/**preResponses - same as pre but represented as the response object created by the pre method.*/
preResponses: any;
/**an object containing the query parameters.*/
query: any;
/** an object containing the Node HTTP server objects. Direct interaction with these raw objects is not recommended.*/
raw: {
req: http.ClientRequest;
res: http.ServerResponse;
};
/** the route public interface.*/
route: IRoute;
/** the server object. */
server: Server;
/** Special key reserved for plugins implementing session support. Plugins utilizing this key must check for null value to ensure there is no conflict with another similar server. */
session: any;
/** an object containing parsed HTTP state information (cookies) where each key is the cookie name and value is the matching cookie content after processing using any registered cookie definition. */
state: any;
/** complex object contining details on the url */
url: {
/** null when i tested */
auth: any;
/** null when i tested */
hash: any;
/** null when i tested */
host: any;
/** null when i tested */
hostname: any;
href: string;
path: string;
/** path without search*/
pathname: string;
/** null when i tested */
port: any;
/** null when i tested */
protocol: any;
/** querystring parameters*/
query: IDictionary<string>;
/** querystring parameters as a string*/
search: string;
/** null when i tested */
slashes: any;
};
/** request.setUrl(url)
Available only in 'onRequest' extension methods.
Changes the request URI before the router begins processing the request where:
url - the new request path value.
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
server.ext('onRequest', function (request, reply) {
// Change all requests to '/test'
request.setUrl('/test');
return reply.continue();
});*/
setUrl(url: string): void;
/** request.setMethod(method)
Available only in 'onRequest' extension methods.
Changes the request method before the router begins processing the request where:
method - is the request HTTP method (e.g. 'GET').
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
server.ext('onRequest', function (request, reply) {
// Change all requests to 'GET'
request.setMethod('GET');
return reply.continue();
});*/
setMethod(method: string): void;
/** request.log(tags, [data, [timestamp]])
Always available.
Logs request-specific events. When called, the server emits a 'request' event which can be used by other listeners or plugins. The arguments are:
data - an optional message string or object with the application data being logged.
timestamp - an optional timestamp expressed in milliseconds. Defaults to Date.now() (now).
Any logs generated by the server internally will be emitted only on the 'request-internal' channel and will include the event.internal flag set to true.
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
server.on('request', function (request, event, tags) {
if (tags.error) {
console.log(event);
}
});
var handler = function (request, reply) {
request.log(['test', 'error'], 'Test event');
return reply();
};
*/
log(
/** a string or an array of strings (e.g. ['error', 'database', 'read']) used to identify the event. Tags are used instead of log levels and provide a much more expressive mechanism for describing and filtering events.*/
tags: string|string[],
/** an optional message string or object with the application data being logged.*/
data?: string,
/** an optional timestamp expressed in milliseconds. Defaults to Date.now() (now).*/
timestamp?: number): void;
/** request.getLog([tags], [internal])
Always available.
Returns an array containing the events matching any of the tags specified (logical OR)
request.getLog();
request.getLog('error');
request.getLog(['error', 'auth']);
request.getLog(['error'], true);
request.getLog(false);*/
getLog(
/** is a single tag string or array of tag strings. If no tags specified, returns all events.*/
tags?: string,
/** filters the events to only those with a matching event.internal value. If true, only internal logs are included. If false, only user event are included. Defaults to all events (undefined).*/
internal?: boolean): string[];
/** request.tail([name])
Available until immediately after the 'response' event is emitted.
Adds a request tail which has to complete before the request lifecycle is complete where:
name - an optional tail name used for logging purposes.
Returns a tail function which must be called when the tail activity is completed.
Tails are actions performed throughout the request lifecycle, but which may end after a response is sent back to the client. For example, a request may trigger a database update which should not delay sending back a response. However, it is still desirable to associate the activity with the request when logging it (or an error associated with it).
When all tails completed, the server emits a 'tail' event.
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
var get = function (request, reply) {
var dbTail = request.tail('write to database');
db.save('key', 'value', function () {
dbTail();
});
return reply('Success!');
};
server.route({ method: 'GET', path: '/', handler: get });
server.on('tail', function (request) {
console.log('Request completed including db activity');
});*/
tail(
/** an optional tail name used for logging purposes.*/
name?: string): Function;
}
/** Response events
The response object supports the following events:
'peek' - emitted for each chunk of data written back to the client connection. The event method signature is function(chunk, encoding).
'finish' - emitted when the response finished writing but before the client response connection is ended. The event method signature is function ().
var Crypto = require('crypto');
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
server.ext('onPreResponse', function (request, reply) {
var response = request.response;
if (response.isBoom) {
return reply();
}
var hash = Crypto.createHash('sha1');
response.on('peek', function (chunk) {
hash.update(chunk);
});
response.once('finish', function () {
console.log(hash.digest('hex'));
});
return reply.continue();
});*/
export class Response extends Events.EventEmitter {
/** the HTTP response status code. Defaults to 200 (except for errors).*/
statusCode: number;
/** an object containing the response headers where each key is a header field name. Note that this is an incomplete list of headers to be included with the response. Additional headers will be added once the response is prepare for transmission.*/
headers: IDictionary<string>;
/** the value provided using the reply interface.*/
source: any;
/** a string indicating the type of source with available values:
'plain' - a plain response such as string, number, null, or simple object (e.g. not a Stream, Buffer, or view).
'buffer' - a Buffer.
'view' - a view generated with reply.view().
'file' - a file generated with reply.file() of via the directory handler.
'stream' - a Stream.
'promise' - a Promise object. */
variety: string;
/** application-specific state. Provides a safe place to store application data without potential conflicts with the framework. Should not be used by plugins which should use plugins[name].*/
app: any;
/** plugin-specific state. Provides a place to store and pass request-level plugin data. The plugins is an object where each key is a plugin name and the value is the state. */
plugins: any;
/** settings - response handling flags:
charset - the 'Content-Type' HTTP header 'charset' property. Defaults to 'utf-8'.
encoding - the string encoding scheme used to serial data into the HTTP payload when source is a string or marshals into a string. Defaults to 'utf8'.
passThrough - if true and source is a Stream, copies the statusCode and headers of the stream to the outbound response. Defaults to true.
stringify - options used for source value requiring stringification. Defaults to no replacer and no space padding.
ttl - if set, overrides the route cache expiration milliseconds value set in the route config. Defaults to no override.
varyEtag - if true, a suffix will be automatically added to the 'ETag' header at transmission time (separated by a '-' character) when the HTTP 'Vary' header is present.*/
settings: {
charset: string;
encoding: string;
passThrough: boolean;
stringify: any;
ttl: number;
varyEtag: boolean;
}
/** sets the HTTP 'Content-Length' header (to avoid chunked transfer encoding) where:
length - the header value. Must match the actual payload size.*/
bytes(length: number): void;
/** sets the 'Content-Type' HTTP header 'charset' property where: charset - the charset property value.*/
charset(charset: string): void;
/** sets the HTTP status code where:
statusCode - the HTTP status code.*/
code(statusCode: number): void;
/** sets the HTTP status code to Created (201) and the HTTP 'Location' header where: uri - an absolute or relative URI used as the 'Location' header value.*/
created(uri: string): void;
/** encoding(encoding) - sets the string encoding scheme used to serial data into the HTTP payload where: encoding - the encoding property value (see node Buffer encoding).*/
encoding(encoding: string): void;
/** etag(tag, options) - sets the representation entity tag where:
tag - the entity tag string without the double-quote.
options - optional settings where:
weak - if true, the tag will be prefixed with the 'W/' weak signifier. Weak tags will fail to match identical tags for the purpose of determining 304 response status. Defaults to false.
vary - if true and content encoding is set or applied to the response (e.g 'gzip' or 'deflate'), the encoding name will be automatically added to the tag at transmission time (separated by a '-' character). Ignored when weak is true. Defaults to true.*/
etag(tag: string, options: {
weak: boolean; vary: boolean;
}): void;
/**header(name, value, options) - sets an HTTP header where:
name - the header name.
value - the header value.
options - optional settings where:
append - if true, the value is appended to any existing header value using separator. Defaults to false.
separator - string used as separator when appending to an exiting value. Defaults to ','.
override - if false, the header value is not set if an existing value present. Defaults to true.*/
header(name: string, value: string, options?: {
append: boolean;
separator: string;
override: boolean;
}): void;
/** location(uri) - sets the HTTP 'Location' header where:
uri - an absolute or relative URI used as the 'Location' header value.*/
location(uri: string): void;
/** redirect(uri) - sets an HTTP redirection response (302) and decorates the response with additional methods listed below, where:
uri - an absolute or relative URI used to redirect the client to another resource. */
redirect(uri: string): void;
/** replacer(method) - sets the JSON.stringify() replacer argument where:
method - the replacer function or array. Defaults to none.*/
replacer(method: Function| Array<Function>): void;
/** spaces(count) - sets the JSON.stringify() space argument where:
count - the number of spaces to indent nested object keys. Defaults to no indentation. */
spaces(count: number): void;
/**state(name, value, [options]) - sets an HTTP cookie where:
name - the cookie name.
value - the cookie value. If no encoding is defined, must be a string.
options - optional configuration. If the state was previously registered with the server using server.state(), the specified keys in options override those same keys in the server definition (but not others).*/
state(name: string, value: string, options?: any): void;
}
/** Server http://hapijs.com/api#server
rver object is the main application container. The server manages all incoming connections along with all the facilities provided by the framework. A server can contain more than one connection (e.g. listen to port 80 and 8080).
Server events
The server object inherits from Events.EventEmitter and emits the following events:
'log' - events logged with server.log() and server events generated internally by the framework.
'start' - emitted when the server is started using server.start().
'stop' - emitted when the server is stopped using server.stop().
'request' - events generated by request.log(). Does not include any internally generated events.
'request-internal' - request events generated internally by the framework (multiple events per request).
'request-error' - emitted whenever an Internal Server Error (500) error response is sent. Single event per request.
'response' - emitted after the response is sent back to the client (or when the client connection closed and no response sent, in which case request.response is null). Single event per request.
'tail' - emitted when a request finished processing, including any registered tails. Single event per request.
Note that the server object should not be used to emit application events as its internal implementation is designed to fan events out to the various plugin selections and not for application events.
MORE EVENTS HERE: http://hapijs.com/api#server-events*/
export class Server extends Events.EventEmitter {
constructor(options?: IServerOptions);
/** Provides a safe place to store server-specific run-time application data without potential conflicts with the framework internals. The data can be accessed whenever the server is accessible. Initialized with an empty object.
var Hapi = require('hapi');
server = new Hapi.Server();
server.app.key = 'value';
var handler = function (request, reply) {
return reply(request.server.app.key);
}; */
app: any;
/** An array containing the server's connections. When the server object is returned from server.select(), the connections array only includes the connections matching the selection criteria.
var server = new Hapi.Server();
server.connection({ port: 80, labels: 'a' });
server.connection({ port: 8080, labels: 'b' });
// server.connections.length === 2
var a = server.select('a');
// a.connections.length === 1*/
connections: Array<ISeverConnectionOptions>;
/** When the server contains exactly one connection, info is an object containing information about the sole connection.
* When the server contains more than one connection, each server.connections array member provides its own connection.info.
var server = new Hapi.Server();
server.connection({ port: 80 });
// server.info.port === 80
server.connection({ port: 8080 });
// server.info === null
// server.connections[1].info.port === 8080
*/
info: {
/** - a unique connection identifier (using the format '{hostname}:{pid}:{now base36}').*/
id: string;
/** - the connection creation timestamp.*/
created: number;
/** - the connection start timestamp (0 when stopped).*/
started: number;
/** the connection port based on the following rules:
the configured port value before the server has been started.
the actual port assigned when no port is configured or set to 0 after the server has been started.*/
port: number;
/** - the host name the connection was configured to. Defaults to the operating system hostname when available, otherwise 'localhost'.*/
host: string;
/** - the active IP address the connection was bound to after starting.Set to undefined until the server has been started or when using a non TCP port (e.g. UNIX domain socket).*/
address: string;
/** - the protocol used:
'http' - HTTP.
'https' - HTTPS.
'socket' - UNIX domain socket or Windows named pipe.*/
protocol: string;
/** a string representing the connection (e.g. 'http://example.com:8080' or 'socket:/unix/domain/socket/path'). Contains the uri setting if provided, otherwise constructed from the available settings. If no port is available or set to 0, the uri will not include a port component.*/
uri: string;
};
/** An object containing the process load metrics (when load.sampleInterval is enabled):
rss - RSS memory usage.
var Hapi = require('hapi');
var server = new Hapi.Server({ load: { sampleInterval: 1000 } });
console.log(server.load.rss);*/
load: {
/** - event loop delay milliseconds.*/
eventLoopDelay: number;
/** - V8 heap usage.*/
heapUsed: number;
};
/** When the server contains exactly one connection, listener is the node HTTP server object of the sole connection.
When the server contains more than one connection, each server.connections array member provides its own connection.listener.
var Hapi = require('hapi');
var SocketIO = require('socket.io');
var server = new Hapi.Server();
server.connection({ port: 80 });
var io = SocketIO.listen(server.listener);
io.sockets.on('connection', function(socket) {
socket.emit({ msg: 'welcome' });
});*/
listener: http.Server;
/** server.methods
An object providing access to the server methods where each server method name is an object property.
var Hapi = require('hapi');
var server = new Hapi.Server();
server.method('add', function (a, b, next) {
return next(null, a + b);
});
server.methods.add(1, 2, function (err, result) {
// result === 3
});*/
methods: IDictionary<Function>;
/** server.mime
Provides access to the server MIME database used for setting content-type information. The object must not be modified directly but only through the mime server setting.
var Hapi = require('hapi');
var options = {
mime: {
override: {
'node/module': {
source: 'steve',
compressible: false,
extensions: ['node', 'module', 'npm'],
type: 'node/module'
}
}
}
};
var server = new Hapi.Server(options);
// server.mime.path('code.js').type === 'application/javascript'
// server.mime.path('file.npm').type === 'node/module'*/
mime: any;
/**server.plugins
An object containing the values exposed by each plugin registered where each key is a plugin name and the values are the exposed properties by each plugin using server.expose(). Plugins may set the value of the server.plugins[name] object directly or via the server.expose() method.
exports.register = function (server, options, next) {
server.expose('key', 'value');
// server.plugins.example.key === 'value'
return next();
};
exports.register.attributes = {
name: 'example'
};*/
plugins: IDictionary<any>;
/** server.realm
The realm object contains server-wide or plugin-specific state that can be shared across various methods. For example, when calling server.bind(), the active realm settings.bind property is set which is then used by routes and extensions added at the same level (server root or plugin). Realms are a limited version of a sandbox where plugins can maintain state used by the framework when adding routes, extensions, and other properties.
modifiers - when the server object is provided as an argument to the plugin register() method, modifiers provides the registration preferences passed the server.register() method and includes:
route - routes preferences:
prefix - the route path prefix used by any calls to server.route() from the server.
vhost - the route virtual host settings used by any calls to server.route() from the server.
plugin - the active plugin name (empty string if at the server root).
plugins - plugin-specific state to be shared only among activities sharing the same active state. plugins is an object where each key is a plugin name and the value is the plugin state.
settings - settings overrides:
files.relativeTo
bind
The server.realm object should be considered read-only and must not be changed directly except for the plugins property can be directly manipulated by the plugins (each setting its own under plugins[name]).
exports.register = function (server, options, next) {
console.log(server.realm.modifiers.route.prefix);
return next();
};*/
realm: IServerRealm;
/** server.root
The root server object containing all the connections and the root server methods (e.g. start(), stop(), connection()).*/
root: Server;
/** server.settings
The server configuration object after defaults applied.
var Hapi = require('hapi');
var server = new Hapi.Server({
app: {
key: 'value'
}
});
// server.settings.app === { key: 'value' }*/
settings: IServerOptions;
/** server.version
The hapi module version number.
var Hapi = require('hapi');
var server = new Hapi.Server();
// server.version === '8.0.0'*/
version: string;
/** server.after(method, [dependencies])
Adds a method to be called after all the plugin dependencies have been registered and before the server starts (only called if the server is started) where:
after - the method with signature function(plugin, next) where:
server - server object the after() method was called on.
next - the callback function the method must call to return control over to the application and complete the registration process. The function signature is function(err) where:
err - internal error which is returned back via the server.start() callback.
dependencies - a string or array of string with the plugin names to call this method after their after() methods. There is no requirement for the other plugins to be registered. Setting dependencies only arranges the after methods in the specified order.
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
server.after(function () {
// Perform some pre-start logic
});
server.start(function (err) {
// After method already executed
});
server.auth.default(options)*/
after(method: (plugin: any, next: (err: any) => void) => void, dependencies: string|string[]): void;
auth: {
/** server.auth.default(options)
Sets a default strategy which is applied to every route where:
options - a string with the default strategy name or an object with a specified strategy or strategies using the same format as the route auth handler options.
The default does not apply when the route config specifies auth as false, or has an authentication strategy configured. Otherwise, the route authentication config is applied to the defaults. Note that the default only applies at time of route configuration, not at runtime. Calling default() after adding a route will have no impact on routes added prior.
The default auth strategy configuration can be accessed via connection.auth.settings.default.
var server = new Hapi.Server();
server.connection({ port: 80 });
server.auth.scheme('custom', scheme);
server.auth.strategy('default', 'custom');
server.auth.default('default');
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
return reply(request.auth.credentials.user);
}
});*/
default(options: string):void;
/** server.auth.scheme(name, scheme)
Registers an authentication scheme where:
name - the scheme name.
scheme - the method implementing the scheme with signature function(server, options) where:
server - a reference to the server object the scheme is added to.
options - optional scheme settings used to instantiate a strategy.*/
scheme(name: string,
/** When the scheme authenticate() method implementation calls reply() with an error condition, the specifics of the error affect whether additional authentication strategies will be attempted if configured for the route. If the err returned by the reply() method includes a message, no additional strategies will be attempted. If the err does not include a message but does include a scheme name (e.g. Boom.unauthorized(null, 'Custom')), additional strategies will be attempted in order of preference.
n the scheme payload() method returns an error with a message, it means payload validation failed due to bad payload. If the error has no message but includes a scheme name (e.g. Boom.unauthorized(null, 'Custom')), authentication may still be successful if the route auth.payload configuration is set to 'optional'.
server = new Hapi.Server();
server.connection({ port: 80 });
scheme = function (server, options) {
urn {
authenticate: function (request, reply) {
req = request.raw.req;
var authorization = req.headers.authorization;
if (!authorization) {
return reply(Boom.unauthorized(null, 'Custom'));
}
urn reply(null, { credentials: { user: 'john' } });
}
};
};
*/
scheme: (server: Server, options: any) => IServerAuthScheme): void;
/** server.auth.strategy(name, scheme, [mode], [options])
Registers an authentication strategy where:
name - the strategy name.
scheme - the scheme name (must be previously registered using server.auth.scheme()).
mode - if true, the scheme is automatically assigned as a required strategy to any route without an auth config. Can only be assigned to a single server strategy. Value must be true (which is the same as 'required') or a valid authentication mode ('required', 'optional', 'try'). Defaults to false.
options - scheme options based on the scheme requirements.
var server = new Hapi.Server();
server.connection({ port: 80 });
server.auth.scheme('custom', scheme);
server.auth.strategy('default', 'custom');
server.route({
method: 'GET',
path: '/',
config: {
auth: 'default',
handler: function (request, reply) {
return reply(request.auth.credentials.user);
}
}
});*/
strategy(name: string, scheme: any, mode?: boolean, options?: any):void;
/** server.auth.test(strategy, request, next)
Tests a request against an authentication strategy where:
strategy - the strategy name registered with server.auth.strategy().
request - the request object.
next - the callback function with signature function(err, credentials) where:
err - the error if authentication failed.
credentials - the authentication credentials object if authentication was successful.
Note that the test() method does not take into account the route authentication configuration. It also does not perform payload authentication. It is limited to the basic strategy authentication execution. It does not include verifying scope, entity, or other route properties.
var server = new Hapi.Server();
server.connection({ port: 80 });
server.auth.scheme('custom', scheme);
server.auth.strategy('default', 'custom');
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
request.server.auth.test('default', request, function (err, credentials) {
if (err) {
return reply({ status: false });
}
return reply({ status: true, user: credentials.name });
});
}
});*/
test(strategy: string, request: Request, next: (err: any, credentials: any) => void): void;
};
/** server.bind(context)
Sets a global context used as the default bind object when adding a route or an extension where:
context - the object used to bind this in handler and extension methods.
When setting context inside a plugin, the context is applied only to methods set up by the plugin. Note that the context applies only to routes and extensions added after it has been set.
var handler = function (request, reply) {
return reply(this.message);
};
exports.register = function (server, options, next) {
var bind = {
message: 'hello'
};
server.bind(bind);
server.route({ method: 'GET', path: '/', handler: handler });
return next();
};*/
bind(context: any): void;
/** server.cache(options)
Provisions a cache segment within the server cache facility where:
options - catbox policy configuration where:
expiresIn - relative expiration expressed in the number of milliseconds since the item was saved in the cache. Cannot be used together with expiresAt.
expiresAt - time of day expressed in 24h notation using the 'HH:MM' format, at which point all cache records expire. Uses local time. Cannot be used together with expiresIn.
generateFunc - a function used to generate a new cache item if one is not found in the cache when calling get(). The method's signature is function(id, next) where: - id - the id string or object provided to the get() method. - next - the method called when the new item is returned with the signature function(err, value, ttl) where: - err - an error condition. - value - the new value generated. - ttl - the cache ttl value in milliseconds. Set to 0 to skip storing in the cache. Defaults to the cache global policy.
staleIn - number of milliseconds to mark an item stored in cache as stale and attempt to regenerate it when generateFunc is provided. Must be less than expiresIn.
staleTimeout - number of milliseconds to wait before checking if an item is stale.
generateTimeout - number of milliseconds to wait before returning a timeout error when the generateFunc function takes too long to return a value. When the value is eventually returned, it is stored in the cache for future requests.
cache - the cache name configured in 'server.cache`. Defaults to the default cache.
segment - string segment name, used to isolate cached items within the cache partition. When called within a plugin, defaults to '!name' where 'name' is the plugin name. Required when called outside of a plugin.
shared - if true, allows multiple cache provisions to share the same segment. Default to false.
var server = new Hapi.Server();
server.connection({ port: 80 });
var cache = server.cache({ segment: 'countries', expiresIn: 60 * 60 * 1000 });
cache.set('norway', { capital: 'oslo' }, null, function (err) {
cache.get('norway', function (err, value, cached, log) {
// value === { capital: 'oslo' };
});
});*/
cache(options: ICatBoxCacheOptions): void;
/** server.connection([options])
Adds an incoming server connection
Returns a server object with the new connection selected.
Must be called before any other server method that modifies connections is called for it to apply to the new connection (e.g. server.state()).
Note that the options object is deeply cloned (with the exception of listener which is shallowly copied) and cannot contain any values that are unsafe to perform deep copy on.
var Hapi = require('hapi');
var server = new Hapi.Server();
var web = server.connection({ port: 8000, host: 'example.com', labels: ['web'] });
var admin = server.connection({ port: 8001, host: 'example.com', labels: ['admin'] });
// server.connections.length === 2
// web.connections.length === 1
// admin.connections.length === 1 */
connection(options: ISeverConnectionOptions): Server;
/** server.decorate(type, property, method)
Extends various framework interfaces with custom methods where:
type - the interface being decorated. Supported types:
'reply' - adds methods to the reply interface.
'server' - adds methods to the Server object.
property - the object decoration key name.
method - the extension function.
Note that decorations apply to the entire server and all its connections regardless of current selection.
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
server.decorate('reply', 'success', function () {
return this.response({ status: 'ok' });
});
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
return reply.success();
}
});*/
decorate(type: string, property: string, method: Function):void;
/** server.dependency(dependencies, [after])
Used within a plugin to declares a required dependency on other plugins where:
dependencies - a single string or array of plugin name strings which must be registered in order for this plugin to operate. Plugins listed must be registered before the server is started. Does not provide version dependency which should be implemented using npm peer dependencies.
after - an optional function called after all the specified dependencies have been registered and before the server starts. The function is only called if the server is started. If a circular dependency is detected, an exception is thrown (e.g. two plugins each has an after function to be called after the other). The function signature is function(server, next) where:
server - the server the dependency() method was called on.
next - the callback function the method must call to return control over to the application and complete the registration process. The function signature is function(err) where:
err - internal error condition, which is returned back via the server.start() callback.
exports.register = function (server, options, next) {
server.dependency('yar', after);
return next();
};
var after = function (server, next) {
// Additional plugin registration logic
return next();
};*/
dependency(dependencies: string|string[], after?: (server: Server, next: (err: any) => void) => void): void;
/** server.expose(key, value)
Used within a plugin to expose a property via server.plugins[name] where:
key - the key assigned (server.plugins[name][key]).
value - the value assigned.
exports.register = function (server, options, next) {
server.expose('util', function () { console.log('something'); });
return next();
};*/
expose(key: string, value: any): void;
/** server.expose(obj)
Merges a deep copy of an object into to the existing content of server.plugins[name] where:
obj - the object merged into the exposed properties container.
exports.register = function (server, options, next) {
server.expose({ util: function () { console.log('something'); } });
return next();
};*/
expose(obj: any): void;
/** server.ext(event, method, [options])
Registers an extension function in one of the available extension points where:
event - the event name.
method - a function or an array of functions to be executed at a specified point during request processing. The required extension function signature is function(request, reply) where:
request - the request object.
reply - the reply interface which is used to return control back to the framework. To continue normal execution of the request lifecycle, reply.continue() must be called. To abort processing and return a response to the client, call reply(value) where value is an error or any other valid response.
this - the object provided via options.bind or the current active context set with server.bind().
options - an optional object with the following:
before - a string or array of strings of plugin names this method must execute before (on the same event). Otherwise, extension methods are executed in the order added.
after - a string or array of strings of plugin names this method must execute after (on the same event). Otherwise, extension methods are executed in the order added.
bind - a context object passed back to the provided method (via this) when called.
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
server.ext('onRequest', function (request, reply) {
// Change all requests to '/test'
request.setUrl('/test');
return reply.continue();
});
var handler = function (request, reply) {
return reply({ status: 'ok' });
};
server.route({ method: 'GET', path: '/test', handler: handler });
server.start();
// All requests will get routed to '/test'*/
ext(event: string, method: (request: Request, reply: IReply, bind?: any) => void, options?: { before: string|string[]; after: string|string[]; bind?: any }): void;
/** server.handler(name, method)
Registers a new handler type to be used in routes where:
name - string name for the handler being registered. Cannot override the built-in handler types (directory, file, proxy, and view) or any previously registered type.
method - the function used to generate the route handler using the signature function(route, options) where:
route - the route public interface object.
options - the configuration object provided in the handler config.
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ host: 'localhost', port: 8000 });
// Defines new handler for routes on this server
server.handler('test', function (route, options) {
return function (request, reply) {
return reply('new handler: ' + options.msg);
}
});
server.route({
method: 'GET',
path: '/',
handler: { test: { msg: 'test' } }
});
server.start();
The method function can have a defaults object or function property. If the property is set to an object, that object is used as the default route config for routes using this handler. If the property is set to a function, the function uses the signature function(method) and returns the route default configuration.
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ host: 'localhost', port: 8000 });
var handler = function (route, options) {
return function (request, reply) {
return reply('new handler: ' + options.msg);
}
};
// Change the default payload processing for this handler
handler.defaults = {
payload: {
output: 'stream',
parse: false
}
};
server.handler('test', handler);*/
handler<THandlerConfig>(name: string, method: (route: IRoute, options: THandlerConfig) => ISessionHandler): void;
/** When the server contains exactly one connection, injects a request into the sole connection simulating an incoming HTTP request without making an actual socket connection.
Injection is useful for testing purposes as well as for invoking routing logic internally without the overhead or limitations of the network stack.
Utilizes the [shot module | https://github.com/hapijs/shot ] for performing injections, with some additional options and response properties
* When the server contains more than one connection, each server.connections array member provides its own connection.inject().
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
var handler = function (request, reply) {
return reply('Success!');
};
server.route({ method: 'GET', path: '/', handler: handler });
server.inject('/', function (res) {
console.log(res.result);
});
*/
inject: IServerInject;
/** server.log(tags, [data, [timestamp]])
Logs server events that cannot be associated with a specific request. When called the server emits a 'log' event which can be used by other listeners or plugins to record the information or output to the console. The arguments are:
tags - a string or an array of strings (e.g. ['error', 'database', 'read']) used to identify the event. Tags are used instead of log levels and provide a much more expressive mechanism for describing and filtering events. Any logs generated by the server internally include the 'hapi' tag along with event-specific information.
data - an optional message string or object with the application data being logged.
timestamp - an optional timestamp expressed in milliseconds. Defaults to Date.now() (now).
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
server.on('log', function (event, tags) {
if (tags.error) {
console.log(event);
}
});
server.log(['test', 'error'], 'Test event');*/
log(tags: string|string[], data?: string|any, timestamp?: number): void;
/**server.lookup(id)
When the server contains exactly one connection, looks up a route configuration where:
id - the route identifier as set in the route options.
returns the route public interface object if found, otherwise null.
var server = new Hapi.Server();
server.connection();
server.route({
method: 'GET',
path: '/',
config: {
handler: function (request, reply) { return reply(); },
id: 'root'
}
});
var route = server.lookup('root');
When the server contains more than one connection, each server.connections array member provides its own connection.lookup() method.*/
lookup(id: string): IRoute;
/** server.match(method, path, [host])
When the server contains exactly one connection, looks up a route configuration where:
method - the HTTP method (e.g. 'GET', 'POST').
path - the requested path (must begin with '/').
host - optional hostname (to match against routes with vhost).
returns the route public interface object if found, otherwise null.
var server = new Hapi.Server();
server.connection();
server.route({
method: 'GET',
path: '/',
config: {
handler: function (request, reply) { return reply(); },
id: 'root'
}
});
var route = server.match('get', '/');
When the server contains more than one connection, each server.connections array member provides its own connection.match() method.*/
match(method: string, path: string, host?: string): IRoute;
/** server.method(name, method, [options])
Registers a server method. Server methods are functions registered with the server and used throughout the application as a common utility. Their advantage is in the ability to configure them to use the built-in cache and share across multiple request handlers without having to create a common module.
Methods are registered via server.method(name, method, [options])
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
// Simple arguments
var add = function (a, b, next) {
return next(null, a + b);
};
server.method('sum', add, { cache: { expiresIn: 2000 } });
server.methods.sum(4, 5, function (err, result) {
console.log(result);
});
// Object argument
var addArray = function (array, next) {
var sum = 0;
array.forEach(function (item) {
sum += item;
});
return next(null, sum);
};
server.method('sumObj', addArray, {
cache: { expiresIn: 2000 },
generateKey: function (array) {
return array.join(',');
}
});
server.methods.sumObj([5, 6], function (err, result) {
console.log(result);
});
// Synchronous method with cache
var addSync = function (a, b) {
return a + b;
};
server.method('sumSync', addSync, { cache: { expiresIn: 2000 }, callback: false });
server.methods.sumSync(4, 5, function (err, result) {
console.log(result);
}); */
method(
/** a unique method name used to invoke the method via server.methods[name]. When configured with caching enabled, server.methods[name].cache.drop(arg1, arg2, ..., argn, callback) can be used to clear the cache for a given key. Supports using nested names such as utils.users.get which will automatically create the missing path under server.methods and can be accessed for the previous example via server.methods.utils.users.get.*/
name: string,
method: IServerMethod,
options?: IServerMethodOptions):void;
/**server.method(methods)
Registers a server method function as described in server.method() using a configuration object where:
methods - an object or an array of objects where each one contains:
name - the method name.
method - the method function.
options - optional settings.
var add = function (a, b, next) {
next(null, a + b);
};
server.method({
name: 'sum',
method: add,
options: {
cache: {
expiresIn: 2000
}
}
});*/
method(methods: {
name: string; method: IServerMethod; options?: IServerMethodOptions
}| Array<{
name: string; method: IServerMethod; options?: IServerMethodOptions
}>):void;
/**server.path(relativeTo)
Sets the path prefix used to locate static resources (files and view templates) when relative paths are used where:
relativeTo - the path prefix added to any relative file path starting with '.'.
Note that setting a path within a plugin only applies to resources accessed by plugin methods. If no path is set, the connection files.relativeTo configuration is used. The path only applies to routes added after it has been set.
exports.register = function (server, options, next) {
server.path(__dirname + '../static');
server.route({ path: '/file', method: 'GET', handler: { file: './test.html' } });
next();
};*/
path(relativeTo: string): void;
/**server.register(plugins, [options], callback)
Registers a plugin where:
plugins - an object or array of objects where each one is either:
a plugin registration function.
an object with the following:
register - the plugin registration function.
options - optional options passed to the registration function when called.
options - optional registration options (different from the options passed to the registration function):
select - a string or array of string labels used to pre-select connections for plugin registration.
routes - modifiers applied to each route added by the plugin:
prefix - string added as prefix to any route path (must begin with '/'). If a plugin registers a child plugin the prefix is passed on to the child or is added in front of the child-specific prefix.
vhost - virtual host string (or array of strings) applied to every route. The outer-most vhost overrides the any nested configuration.
callback - the callback function with signature function(err) where:
err - an error returned from the registration function. Note that exceptions thrown by the registration function are not handled by the framework.
server.register({
register: require('plugin_name'),
options: {
message: 'hello'
}
}, function (err) {
if (err) {
console.log('Failed loading plugin');
}
});*/
register(plugins: any|any[], options: {
select: string|string[];
routes: {
prefix: string; vhost?: string|string[]
};
}
, callback: (err: any) => void):void;
register(plugins: any|any[], callback: (err: any) => void):void;
/**server.render(template, context, [options], callback)
Utilizes the server views manager to render a template where:
template - the template filename and path, relative to the views manager templates path (path or relativeTo).
context - optional object used by the template to render context-specific result. Defaults to no context ({}).
options - optional object used to override the views manager configuration.
callback - the callback function with signature function (err, rendered, config) where:
err - the rendering error if any.
rendered - the result view string.
config - the configuration used to render the template.
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
server.views({
engines: { html: require('handlebars') },
path: __dirname + '/templates'
});
var context = {
title: 'Views Example',
message: 'Hello, World'
};
server.render('hello', context, function (err, rendered, config) {
console.log(rendered);
});*/
render(template: string, context: any, options: any, callback: (err: any, rendered: any, config: any) => void):void;
/** server.route(options)
Adds a connection route where:
options - a route configuration object or an array of configuration objects.
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
server.route({ method: 'GET', path: '/', handler: function (request, reply) { return reply('ok'); } });
server.route([
{ method: 'GET', path: '/1', handler: function (request, reply) { return reply('ok'); } },
{ method: 'GET', path: '/2', handler: function (request, reply) { return reply('ok'); } }
]);*/
route(options: IRouteConfiguration):void;
route(options: IRouteConfiguration[]):void;
/**server.select(labels)
Selects a subset of the server's connections where:
labels - a single string or array of strings of labels used as a logical OR statement to select all the connections with matching labels in their configuration.
Returns a server object with connections set to the requested subset. Selecting again on a selection operates as a logic AND statement between the individual selections.
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80, labels: ['a', 'b'] });
server.connection({ port: 8080, labels: ['a', 'c'] });
server.connection({ port: 8081, labels: ['b', 'c'] });
var a = server.select('a'); // 80, 8080
var ac = a.select('c'); // 8080*/
select(labels: string|string[]): void;
/** server.start([callback])
Starts the server connections by listening for incoming requests on the configured port of each listener (unless the connection was configured with autoListen set to false), where:
callback - optional callback when server startup is completed or failed with the signature function(err) where:
err - any startup error condition.
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
server.start(function (err) {
console.log('Server started at: ' + server.info.uri);
});*/
start(callback?: (err: any) => void): void;
/** server.state(name, [options])
HTTP state management uses client cookies to persist a state across multiple requests. Registers a cookie definitions
State defaults can be modified via the server connections.routes.state configuration option.
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
// Set cookie definition
server.state('session', {
ttl: 24 * 60 * 60 * 1000, // One day
isSecure: true,
path: '/',
encoding: 'base64json'
});
// Set state in route handler
var handler = function (request, reply) {
var session = request.state.session;
if (!session) {
session = { user: 'joe' };
}
session.last = Date.now();
return reply('Success').state('session', session);
};
Registered cookies are automatically parsed when received. Parsing rules depends on the route state.parse configuration. If an incoming registered cookie fails parsing, it is not included in request.state, regardless of the state.failAction setting. When state.failAction is set to 'log' and an invalid cookie value is received, the server will emit a 'request-internal' event. To capture these errors subscribe to the 'request-internal' events and filter on 'error' and 'state' tags:
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
server.on('request-internal', function (request, event, tags) {
if (tags.error && tags.state) {
console.error(event);
}
}); */
state(name: string, options?: ICookieSettings): void;
/** server.stop([options], [callback])
Stops the server's connections by refusing to accept any new connections or requests (existing connections will continue until closed or timeout), where:
options - optional object with:
timeout - overrides the timeout in millisecond before forcefully terminating a connection. Defaults to 5000 (5 seconds).
callback - optional callback method with signature function() which is called once all the connections have ended and it is safe to exit the process.
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
server.stop({ timeout: 60 * 1000 }, function () {
console.log('Server stopped');
});*/
stop(options?: { timeout: number }, callback?: () => void): void;
/**server.table([host])
Returns a copy of the routing table where:
host - optional host to filter routes matching a specific virtual host. Defaults to all virtual hosts.
The return value is an array where each item is an object containing:
info - the connection.info the connection the table was generated for.
labels - the connection labels.
table - an array of routes where each route contains:
settings - the route config with defaults applied.
method - the HTTP method in lower case.
path - the route path.
Note that if the server has not been started and multiple connections use port 0, the table items will override each other and will produce an incomplete result.
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80, host: 'example.com' });
server.route({ method: 'GET', path: '/example', handler: function (request, reply) { return reply(); } });
var table = server.table();
When calling connection.table() directly on each connection, the return value is the same as the array table item value of an individual connection:
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80, host: 'example.com' });
server.route({ method: 'GET', path: '/example', handler: function (request, reply) { return reply(); } });
var table = server.connections[0].table();
//[
// {
// method: 'get',
// path: '/example',
// settings: { ... }
// }
//]
*/
table(host?: any): IConnectionTable;
/**server.views(options)
Initializes the server views manager
var Hapi = require('hapi');
var server = new Hapi.Server();
server.views({
engines: {
html: require('handlebars'),
jade: require('jade')
},
path: '/static/templates'
});
When server.views() is called within a plugin, the views manager is only available to plugins methods.*/
views(options: IServerViewsConfiguration): void;
}
}
|
omidkrad/DefinitelyTyped
|
hapi/hapi-8.2.0.d.ts
|
TypeScript
|
mit
| 129,987 |
// Approach:
//
// 1. Get the minimatch set
// 2. For each pattern in the set, PROCESS(pattern)
// 3. Store matches per-set, then uniq them
//
// PROCESS(pattern)
// Get the first [n] items from pattern that are all strings
// Join these together. This is PREFIX.
// If there is no more remaining, then stat(PREFIX) and
// add to matches if it succeeds. END.
// readdir(PREFIX) as ENTRIES
// If fails, END
// If pattern[n] is GLOBSTAR
// // handle the case where the globstar match is empty
// // by pruning it out, and testing the resulting pattern
// PROCESS(pattern[0..n] + pattern[n+1 .. $])
// // handle other cases.
// for ENTRY in ENTRIES (not dotfiles)
// // attach globstar + tail onto the entry
// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $])
//
// else // not globstar
// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
// Test ENTRY against pattern[n]
// If fails, continue
// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
//
// Caveat:
// Cache all stats and readdirs results to minimize syscall. Since all
// we ever care about is existence and directory-ness, we can just keep
// `true` for files, and [children,...] for directories, or `false` for
// things that don't exist.
module.exports = glob
var fs = require("fs")
, minimatch = require("minimatch")
, Minimatch = minimatch.Minimatch
, inherits = require("inherits")
, EE = require("events").EventEmitter
, path = require("path")
, isDir = {}
, assert = require("assert").ok
function glob (pattern, options, cb) {
if (typeof options === "function") cb = options, options = {}
if (!options) options = {}
if (typeof options === "number") {
deprecated()
return
}
var g = new Glob(pattern, options, cb)
return g.sync ? g.found : g
}
glob.fnmatch = deprecated
function deprecated () {
throw new Error("glob's interface has changed. Please see the docs.")
}
glob.sync = globSync
function globSync (pattern, options) {
if (typeof options === "number") {
deprecated()
return
}
options = options || {}
options.sync = true
return glob(pattern, options)
}
glob.Glob = Glob
inherits(Glob, EE)
function Glob (pattern, options, cb) {
if (!(this instanceof Glob)) {
return new Glob(pattern, options, cb)
}
if (typeof cb === "function") {
this.on("error", cb)
this.on("end", function (matches) {
cb(null, matches)
})
}
options = options || {}
this.EOF = {}
this._emitQueue = []
this.maxDepth = options.maxDepth || 1000
this.maxLength = options.maxLength || Infinity
this.cache = options.cache || {}
this.statCache = options.statCache || {}
this.changedCwd = false
var cwd = process.cwd()
if (!options.hasOwnProperty("cwd")) this.cwd = cwd
else {
this.cwd = options.cwd
this.changedCwd = path.resolve(options.cwd) !== cwd
}
this.root = options.root || path.resolve(this.cwd, "/")
this.root = path.resolve(this.root)
if (process.platform === "win32")
this.root = this.root.replace(/\\/g, "/")
this.nomount = !!options.nomount
if (!pattern) {
throw new Error("must provide pattern")
}
// base-matching: just use globstar for that.
if (options.matchBase && -1 === pattern.indexOf("/")) {
if (options.noglobstar) {
throw new Error("base matching requires globstar")
}
pattern = "**/" + pattern
}
this.strict = options.strict !== false
this.dot = !!options.dot
this.mark = !!options.mark
this.sync = !!options.sync
this.nounique = !!options.nounique
this.nonull = !!options.nonull
this.nosort = !!options.nosort
this.nocase = !!options.nocase
this.stat = !!options.stat
this.debug = !!options.debug || !!options.globDebug
if (this.debug)
this.log = console.error
this.silent = !!options.silent
var mm = this.minimatch = new Minimatch(pattern, options)
this.options = mm.options
pattern = this.pattern = mm.pattern
this.error = null
this.aborted = false
// list of all the patterns that ** has resolved do, so
// we can avoid visiting multiple times.
this._globstars = {}
EE.call(this)
// process each pattern in the minimatch set
var n = this.minimatch.set.length
// The matches are stored as {<filename>: true,...} so that
// duplicates are automagically pruned.
// Later, we do an Object.keys() on these.
// Keep them as a list so we can fill in when nonull is set.
this.matches = new Array(n)
this.minimatch.set.forEach(iterator.bind(this))
function iterator (pattern, i, set) {
this._process(pattern, 0, i, function (er) {
if (er) this.emit("error", er)
if (-- n <= 0) this._finish()
})
}
}
Glob.prototype.log = function () {}
Glob.prototype._finish = function () {
assert(this instanceof Glob)
var nou = this.nounique
, all = nou ? [] : {}
for (var i = 0, l = this.matches.length; i < l; i ++) {
var matches = this.matches[i]
this.log("matches[%d] =", i, matches)
// do like the shell, and spit out the literal glob
if (!matches) {
if (this.nonull) {
var literal = this.minimatch.globSet[i]
if (nou) all.push(literal)
else all[literal] = true
}
} else {
// had matches
var m = Object.keys(matches)
if (nou) all.push.apply(all, m)
else m.forEach(function (m) {
all[m] = true
})
}
}
if (!nou) all = Object.keys(all)
if (!this.nosort) {
all = all.sort(this.nocase ? alphasorti : alphasort)
}
if (this.mark) {
// at *some* point we statted all of these
all = all.map(function (m) {
var sc = this.cache[m]
if (!sc)
return m
var isDir = (Array.isArray(sc) || sc === 2)
if (isDir && m.slice(-1) !== "/") {
return m + "/"
}
if (!isDir && m.slice(-1) === "/") {
return m.replace(/\/+$/, "")
}
return m
}, this)
}
this.log("emitting end", all)
this.EOF = this.found = all
this.emitMatch(this.EOF)
}
function alphasorti (a, b) {
a = a.toLowerCase()
b = b.toLowerCase()
return alphasort(a, b)
}
function alphasort (a, b) {
return a > b ? 1 : a < b ? -1 : 0
}
Glob.prototype.abort = function () {
this.aborted = true
this.emit("abort")
}
Glob.prototype.pause = function () {
if (this.paused) return
if (this.sync)
this.emit("error", new Error("Can't pause/resume sync glob"))
this.paused = true
this.emit("pause")
}
Glob.prototype.resume = function () {
if (!this.paused) return
if (this.sync)
this.emit("error", new Error("Can't pause/resume sync glob"))
this.paused = false
this.emit("resume")
this._processEmitQueue()
//process.nextTick(this.emit.bind(this, "resume"))
}
Glob.prototype.emitMatch = function (m) {
if (!this.stat || this.statCache[m] || m === this.EOF) {
this._emitQueue.push(m)
this._processEmitQueue()
} else {
this._stat(m, function(exists, isDir) {
if (exists) {
this._emitQueue.push(m)
this._processEmitQueue()
}
})
}
}
Glob.prototype._processEmitQueue = function (m) {
while (!this._processingEmitQueue &&
!this.paused) {
this._processingEmitQueue = true
var m = this._emitQueue.shift()
if (!m) {
this._processingEmitQueue = false
break
}
this.log('emit!', m === this.EOF ? "end" : "match")
this.emit(m === this.EOF ? "end" : "match", m)
this._processingEmitQueue = false
}
}
Glob.prototype._process = function (pattern, depth, index, cb_) {
assert(this instanceof Glob)
var cb = function cb (er, res) {
assert(this instanceof Glob)
if (this.paused) {
if (!this._processQueue) {
this._processQueue = []
this.once("resume", function () {
var q = this._processQueue
this._processQueue = null
q.forEach(function (cb) { cb() })
})
}
this._processQueue.push(cb_.bind(this, er, res))
} else {
cb_.call(this, er, res)
}
}.bind(this)
if (this.aborted) return cb()
if (depth > this.maxDepth) return cb()
// Get the first [n] parts of pattern that are all strings.
var n = 0
while (typeof pattern[n] === "string") {
n ++
}
// now n is the index of the first one that is *not* a string.
// see if there's anything else
var prefix
switch (n) {
// if not, then this is rather simple
case pattern.length:
prefix = pattern.join("/")
this._stat(prefix, function (exists, isDir) {
// either it's there, or it isn't.
// nothing more to do, either way.
if (exists) {
if (prefix && isAbsolute(prefix) && !this.nomount) {
if (prefix.charAt(0) === "/") {
prefix = path.join(this.root, prefix)
} else {
prefix = path.resolve(this.root, prefix)
}
}
if (process.platform === "win32")
prefix = prefix.replace(/\\/g, "/")
this.matches[index] = this.matches[index] || {}
this.matches[index][prefix] = true
this.emitMatch(prefix)
}
return cb()
})
return
case 0:
// pattern *starts* with some non-trivial item.
// going to readdir(cwd), but not include the prefix in matches.
prefix = null
break
default:
// pattern has some string bits in the front.
// whatever it starts with, whether that's "absolute" like /foo/bar,
// or "relative" like "../baz"
prefix = pattern.slice(0, n)
prefix = prefix.join("/")
break
}
// get the list of entries.
var read
if (prefix === null) read = "."
else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) {
if (!prefix || !isAbsolute(prefix)) {
prefix = path.join("/", prefix)
}
read = prefix = path.resolve(prefix)
// if (process.platform === "win32")
// read = prefix = prefix.replace(/^[a-zA-Z]:|\\/g, "/")
this.log('absolute: ', prefix, this.root, pattern, read)
} else {
read = prefix
}
this.log('readdir(%j)', read, this.cwd, this.root)
return this._readdir(read, function (er, entries) {
if (er) {
// not a directory!
// this means that, whatever else comes after this, it can never match
return cb()
}
// globstar is special
if (pattern[n] === minimatch.GLOBSTAR) {
// test without the globstar, and with every child both below
// and replacing the globstar.
var s = [ pattern.slice(0, n).concat(pattern.slice(n + 1)) ]
entries.forEach(function (e) {
if (e.charAt(0) === "." && !this.dot) return
// instead of the globstar
s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1)))
// below the globstar
s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n)))
}, this)
s = s.filter(function (pattern) {
var key = gsKey(pattern)
var seen = !this._globstars[key]
this._globstars[key] = true
return seen
}, this)
if (!s.length)
return cb()
// now asyncForEach over this
var l = s.length
, errState = null
s.forEach(function (gsPattern) {
this._process(gsPattern, depth + 1, index, function (er) {
if (errState) return
if (er) return cb(errState = er)
if (--l <= 0) return cb()
})
}, this)
return
}
// not a globstar
// It will only match dot entries if it starts with a dot, or if
// dot is set. Stuff like @(.foo|.bar) isn't allowed.
var pn = pattern[n]
var rawGlob = pattern[n]._glob
, dotOk = this.dot || rawGlob.charAt(0) === "."
entries = entries.filter(function (e) {
return (e.charAt(0) !== "." || dotOk) &&
e.match(pattern[n])
})
// If n === pattern.length - 1, then there's no need for the extra stat
// *unless* the user has specified "mark" or "stat" explicitly.
// We know that they exist, since the readdir returned them.
if (n === pattern.length - 1 &&
!this.mark &&
!this.stat) {
entries.forEach(function (e) {
if (prefix) {
if (prefix !== "/") e = prefix + "/" + e
else e = prefix + e
}
if (e.charAt(0) === "/" && !this.nomount) {
e = path.join(this.root, e)
}
if (process.platform === "win32")
e = e.replace(/\\/g, "/")
this.matches[index] = this.matches[index] || {}
this.matches[index][e] = true
this.emitMatch(e)
}, this)
return cb.call(this)
}
// now test all the remaining entries as stand-ins for that part
// of the pattern.
var l = entries.length
, errState = null
if (l === 0) return cb() // no matches possible
entries.forEach(function (e) {
var p = pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1))
this._process(p, depth + 1, index, function (er) {
if (errState) return
if (er) return cb(errState = er)
if (--l === 0) return cb.call(this)
})
}, this)
})
}
function gsKey (pattern) {
return '**' + pattern.map(function (p) {
return (p === minimatch.GLOBSTAR) ? '**' : (''+p)
}).join('/')
}
Glob.prototype._stat = function (f, cb) {
assert(this instanceof Glob)
var abs = f
if (f.charAt(0) === "/") {
abs = path.join(this.root, f)
} else if (this.changedCwd) {
abs = path.resolve(this.cwd, f)
}
if (f.length > this.maxLength) {
var er = new Error("Path name too long")
er.code = "ENAMETOOLONG"
er.path = f
return this._afterStat(f, abs, cb, er)
}
this.log('stat', [this.cwd, f, '=', abs])
if (!this.stat && this.cache.hasOwnProperty(f)) {
var exists = this.cache[f]
, isDir = exists && (Array.isArray(exists) || exists === 2)
if (this.sync) return cb.call(this, !!exists, isDir)
return process.nextTick(cb.bind(this, !!exists, isDir))
}
var stat = this.statCache[abs]
if (this.sync || stat) {
var er
try {
stat = fs.statSync(abs)
} catch (e) {
er = e
}
this._afterStat(f, abs, cb, er, stat)
} else {
fs.stat(abs, this._afterStat.bind(this, f, abs, cb))
}
}
Glob.prototype._afterStat = function (f, abs, cb, er, stat) {
var exists
assert(this instanceof Glob)
if (abs.slice(-1) === "/" && stat && !stat.isDirectory()) {
this.log("should be ENOTDIR, fake it")
er = new Error("ENOTDIR, not a directory '" + abs + "'")
er.path = abs
er.code = "ENOTDIR"
stat = null
}
var emit = !this.statCache[abs]
this.statCache[abs] = stat
if (er || !stat) {
exists = false
} else {
exists = stat.isDirectory() ? 2 : 1
if (emit)
this.emit('stat', f, stat)
}
this.cache[f] = this.cache[f] || exists
cb.call(this, !!exists, exists === 2)
}
Glob.prototype._readdir = function (f, cb) {
assert(this instanceof Glob)
var abs = f
if (f.charAt(0) === "/") {
abs = path.join(this.root, f)
} else if (isAbsolute(f)) {
abs = f
} else if (this.changedCwd) {
abs = path.resolve(this.cwd, f)
}
if (f.length > this.maxLength) {
var er = new Error("Path name too long")
er.code = "ENAMETOOLONG"
er.path = f
return this._afterReaddir(f, abs, cb, er)
}
this.log('readdir', [this.cwd, f, abs])
if (this.cache.hasOwnProperty(f)) {
var c = this.cache[f]
if (Array.isArray(c)) {
if (this.sync) return cb.call(this, null, c)
return process.nextTick(cb.bind(this, null, c))
}
if (!c || c === 1) {
// either ENOENT or ENOTDIR
var code = c ? "ENOTDIR" : "ENOENT"
, er = new Error((c ? "Not a directory" : "Not found") + ": " + f)
er.path = f
er.code = code
this.log(f, er)
if (this.sync) return cb.call(this, er)
return process.nextTick(cb.bind(this, er))
}
// at this point, c === 2, meaning it's a dir, but we haven't
// had to read it yet, or c === true, meaning it's *something*
// but we don't have any idea what. Need to read it, either way.
}
if (this.sync) {
var er, entries
try {
entries = fs.readdirSync(abs)
} catch (e) {
er = e
}
return this._afterReaddir(f, abs, cb, er, entries)
}
fs.readdir(abs, this._afterReaddir.bind(this, f, abs, cb))
}
Glob.prototype._afterReaddir = function (f, abs, cb, er, entries) {
assert(this instanceof Glob)
if (entries && !er) {
this.cache[f] = entries
// if we haven't asked to stat everything for suresies, then just
// assume that everything in there exists, so we can avoid
// having to stat it a second time. This also gets us one step
// further into ELOOP territory.
if (!this.mark && !this.stat) {
entries.forEach(function (e) {
if (f === "/") e = f + e
else e = f + "/" + e
this.cache[e] = true
}, this)
}
return cb.call(this, er, entries)
}
// now handle errors, and cache the information
if (er) switch (er.code) {
case "ENOTDIR": // totally normal. means it *does* exist.
this.cache[f] = 1
return cb.call(this, er)
case "ENOENT": // not terribly unusual
case "ELOOP":
case "ENAMETOOLONG":
case "UNKNOWN":
this.cache[f] = false
return cb.call(this, er)
default: // some unusual error. Treat as failure.
this.cache[f] = false
if (this.strict) this.emit("error", er)
if (!this.silent) console.error("glob error", er)
return cb.call(this, er)
}
}
var isAbsolute = process.platform === "win32" ? absWin : absUnix
function absWin (p) {
if (absUnix(p)) return true
// pull off the device/UNC bit from a windows path.
// from node's lib/path.js
var splitDeviceRe =
/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/
, result = splitDeviceRe.exec(p)
, device = result[1] || ''
, isUnc = device && device.charAt(1) !== ':'
, isAbsolute = !!result[2] || isUnc // UNC paths are always absolute
return isAbsolute
}
function absUnix (p) {
return p.charAt(0) === "/" || p === ""
}
|
patpaquette/CampCarolinas
|
implementations/camp_carolinas/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/fileset/node_modules/glob/glob.js
|
JavaScript
|
mit
| 18,154 |
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Upgrading from 2.2.0 to 2.2.1 — CodeIgniter 3.1.0 documentation</title>
<link rel="shortcut icon" href="../_static/ci-icon.ico"/>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" />
<link rel="top" title="CodeIgniter 3.1.0 documentation" href="../index.html"/>
<link rel="up" title="Upgrading From a Previous Version" href="upgrading.html"/>
<link rel="next" title="Upgrading from 2.1.4 to 2.2.x" href="upgrade_220.html"/>
<link rel="prev" title="Upgrading from 2.2.1 to 2.2.2" href="upgrade_222.html"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div id="nav">
<div id="nav_inner">
<div id="pulldown-menu" class="ciNav">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">Welcome to CodeIgniter</a><ul class="simple">
</ul>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Installation Instructions</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="downloads.html">Downloading CodeIgniter</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html">Installation Instructions</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="upgrading.html">Upgrading From a Previous Version</a></li>
<li class="toctree-l2"><a class="reference internal" href="troubleshooting.html">Troubleshooting</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/index.html">General Topics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP Style Guide</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div id="nav2">
<a href="#" id="openToc">
<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAAAf/bAIQABAMDAwMDBAMDBAYEAwQGBwUEBAUHCAYGBwYGCAoICQkJCQgKCgwMDAwMCgwMDQ0MDBERERERFBQUFBQUFBQUFAEEBQUIBwgPCgoPFA4ODhQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgAKwCaAwERAAIRAQMRAf/EAHsAAQAABwEBAAAAAAAAAAAAAAABAwQFBgcIAgkBAQAAAAAAAAAAAAAAAAAAAAAQAAEDAwICBwYEAgsAAAAAAAIBAwQAEQUSBiEHkROTVNQWGDFBUVIUCHEiMtOUFWGBobHRQlMkZIRVEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwDSC+ygkOOaUoKigUCgUCgUCgUCgUCgUCgUCgkuGguIP9FBMFb0Hqg7We+3jlmIqqYFf4ub+/QYlnOR/LqIBKGFUbf8qWv971BytQXXE7Y3Lnm3HsFhp2TaZJAdchRXpIgSpdEJWxJEW3xoKV7F5OMy7JkQn2o7D6w33XGjEAkoiqrJEqIiOIiKuhePCgqp22dyYyS3CyWHnQ5joG61HkRnmnTbaFSMhExRVQRRVJU9iUHjE7ez+fJ0MFipmUNhBV8YUd2SoIV9KkjQla9ltegttBdPLW4/qocL+UTfrMiHW4+P9M71shuyrqaHTcxsl7jegpsji8nh5ZwMvDfgTm0RTjSmjYdFCS6KoOIipdFunCgmNYTMv457MMY6U7iI6oMieDDhRm1VbIhuoOkbqtuK0Hpzb+eZcYZexUxt6UyUqK2cd0SdjtgrhOgijcgERUlJOCIl6CpgbP3blRI8XgMjNARAyKNDfeRBdFDBVUAXgQrqH4pxoJTu2NysY97LP4ac1io5q1InHFeGO24LnVKJuKOkSQ/yKir+rh7aCLG1dzypZQI2FnvTgccYOM3FeN0XWERXAUEFVQgQkUktdLpegm+Td3/Xli/L+S/mYNJIOF9G/wBeLKrZHFb0akG6W1WtQWSg3Dyg5e7V3fipE3O4/wCrktyzYA+ufas2LbZIlmnAT2kvuoN1wft95augilglX/tzP3qCu9O3LL/wV/i5v79BvmTADq14UGu91467Z6U9y0HzH/ncj/U/sT/CgynZG7I2NezpZGUjIycJkYkZSG+uQ81pbBNKLxJfjwoMqZ3/ALYHl35AJ7/cuwHcu5k7r1Q5pHetBjquqVVJWGxj9Zrtcl/Ggy3dHMvauR3HFZj5nHNxSyW5JISYDMoIwx8tFIGHZhPNaykGapr6rUAiicEoMG21lMRj8buPAz8xhJrr7uOeiPTCyAwXUaGR1mgozbTusOsFLEiJ7fbQa/h7gcjy2H3V6xppwDNtUSxCJIqp7valBuWVzJ22xuCROXNNZiJkMtms0DbjUkAZjzoDrTMd9dDRI44ZC2YsrYdKWP2WDT2S3N9dNdlRYrGMYc06IURXSYb0igrpWS485xVNS6nF4rwslkoMwnbpgZLB7bmt5uMweAhDEl4B5uSLzzqTnnyVpW2jaJHRMSIjdDiiotvy3DOE5rYTEbkl5yFn28k7JyG4c7AU2HtLH1uKfaiMPI40CdYbpNtmLdwTSn5rewLNld+7TLdeal4WarWBkbVKBjgdElMJJwAAY5fl4kB3b1fp4XvagsGS3FjJfLzDNtS8aeXx7LzT7TyzByQE5PccRGRC0ZRUDRV6y62vbjagzLmJzS2vuPK43JY6aP1TW6Jz+RIWyFtyC06y3EkiiinAo7YCqfq1AqqnGgsOH3lhZO8d1pmcpB8j5XIm9OYlBJSQ/FSS4427DKO0RC8AlcEMhFdViRR1WDWR5t3WXVuL1d106kG9vdeye2g60+1FDyW0shIcXVpyroXt8I8dfd+NB1vioAdWnD3UF1+gD4UFc6CEKpagxXN43rwJLUHz7yX2c8zokt9uHlsPIhA4aRnnHJTLptIS6CNsY7iASpxUUMkReGpfbQW0vtN5pitvrsN28rwtBD0nc0+/Yft5XhaB6TuaXfsP28rwtA9J3NPv2H7eV4Wgek7mn37D9vK8LQPSdzT79h+3leFoHpO5pd+w/byvC0D0nc0u/Yft5XhaB6TuaXfsP28rwtA9J3NLv2H7eV4Wgek7ml37D9vK8LQPSdzS79h+3leFoHpO5p9+w/byvC0E9r7Reazy2HIYVPxkS/CUHVn26cosxyv2g7h89LYmZSXOenvLEQ1YaQ222RATcQCP8rSGqqA8S02W2pQ6FhMoAIlqCtsnwoCpdKClejI4i3Sgtb+GBxVuNBSFt1pV/RQefLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8utJ/koJ7WCbBU/LQXOPAFq1koK8B0pag90CggtBBf6qB0UDooHRQOigdFA6KB0UDooHRQOigdFA6KB0UDooI0EaBQf//Z" title="Toggle Table of Contents" alt="Toggle Table of Contents" />
</a>
</div>
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="../index.html" class="fa fa-home"> CodeIgniter</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">Welcome to CodeIgniter</a><ul class="simple">
</ul>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Installation Instructions</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="downloads.html">Downloading CodeIgniter</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html">Installation Instructions</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="upgrading.html">Upgrading From a Previous Version</a></li>
<li class="toctree-l2"><a class="reference internal" href="troubleshooting.html">Troubleshooting</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/index.html">General Topics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP Style Guide</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li>
</ul>
</li>
</ul>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">CodeIgniter</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html">Docs</a> »</li>
<li><a href="index.html">Installation Instructions</a> »</li>
<li><a href="upgrading.html">Upgrading From a Previous Version</a> »</li>
<li>Upgrading from 2.2.0 to 2.2.1</li>
<li class="wy-breadcrumbs-aside">
</li>
<div style="float:right;margin-left:5px;" id="closeMe">
<img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" />
</div>
</ul>
<hr/>
</div>
<div role="main" class="document">
<div class="section" id="upgrading-from-2-2-0-to-2-2-1">
<h1>Upgrading from 2.2.0 to 2.2.1<a class="headerlink" href="#upgrading-from-2-2-0-to-2-2-1" title="Permalink to this headline">¶</a></h1>
<p>Before performing an update you should take your site offline by
replacing the index.php file with a static one.</p>
<div class="section" id="step-1-update-your-codeigniter-files">
<h2>Step 1: Update your CodeIgniter files<a class="headerlink" href="#step-1-update-your-codeigniter-files" title="Permalink to this headline">¶</a></h2>
<p>Replace all files and directories in your “system” folder.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If you have any custom developed files in these folders please
make copies of them first.</p>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="upgrade_220.html" class="btn btn-neutral float-right" title="Upgrading from 2.1.4 to 2.2.x">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="upgrade_222.html" class="btn btn-neutral" title="Upgrading from 2.2.1 to 2.2.2"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2014 - 2016, British Columbia Institute of Technology.
Last updated on Jul 26, 2016.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../',
VERSION:'3.1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
|
BrainElvis/solormsgb
|
user_guide/installation/upgrade_221.html
|
HTML
|
mit
| 35,539 |
/*
TimelineJS - ver. 2.26.3 - 2013-10-30
Copyright (c) 2012-2013 Northwestern University
a project of the Northwestern University Knight Lab, originally created by Zach Wise
https://github.com/NUKnightLab/TimelineJS
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Esperanto LANGUAGE
================================================== */typeof VMM!="undefined"&&(VMM.Language={lang:"eo",api:{wikipedia:"eo"},date:{month:["januaro","februaro","marto","aprilo","majo","junio","julio","aŭgusto","septembro","oktobro","novembro","decembro"],month_abbr:["jan.","feb.","mar.","apr.","maj.","jun.","jul.","aŭg.","sep.","okt.","nov.","dec."],day:["dimanĉo","lundo","mardo","merkredo","ĵaŭdo","vendredo","sabato"],day_abbr:["dim.","lun.","mar.","mer.","ĵaŭ.","ven.","sab."]},dateformats:{year:"yyyy",month_short:"mmm",month:"mmmm yyyy",full_short:"d mmm",full:"d mmmm yyyy",time_short:"HH:MM:SS",time_no_seconds_short:"HH:MM",time_no_seconds_small_date:"HH:MM'<br/><small>'d mmmm yyyy'</small>'",full_long:"dddd',' d mmm yyyy 'ĉe' HH:MM",full_long_small_date:"HH:MM'<br/><small>'dddd',' d mmm yyyy'</small>'"},messages:{loading_timeline:"Ŝarĝante Kronologio... ",return_to_title:"Reveno al Titolo",expand_timeline:"Pliampleksigu Kronologio",contract_timeline:"Malpliampleksigu Kronologio",wikipedia:"El Vikipedio, la libera enciklopedio",loading_content:"Ŝarĝante enhavo",loading:"Ŝarĝante"}});
|
knpwrs/cdnjs
|
ajax/libs/timelinejs/2.26.3/js/locale/eo.js
|
JavaScript
|
mit
| 1,574 |
var hljs=new function(){function k(v){return v.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">")}function t(v){return v.nodeName.toLowerCase()}function i(w,x){var v=w&&w.exec(x);return v&&v.index==0}function d(v){return Array.prototype.map.call(v.childNodes,function(w){if(w.nodeType==3){return b.useBR?w.nodeValue.replace(/\n/g,""):w.nodeValue}if(t(w)=="br"){return"\n"}return d(w)}).join("")}function r(w){var v=(w.className+" "+(w.parentNode?w.parentNode.className:"")).split(/\s+/);v=v.map(function(x){return x.replace(/^language-/,"")});return v.filter(function(x){return j(x)||x=="no-highlight"})[0]}function o(x,y){var v={};for(var w in x){v[w]=x[w]}if(y){for(var w in y){v[w]=y[w]}}return v}function u(x){var v=[];(function w(y,z){for(var A=y.firstChild;A;A=A.nextSibling){if(A.nodeType==3){z+=A.nodeValue.length}else{if(t(A)=="br"){z+=1}else{if(A.nodeType==1){v.push({event:"start",offset:z,node:A});z=w(A,z);v.push({event:"stop",offset:z,node:A})}}}}return z})(x,0);return v}function q(w,y,C){var x=0;var F="";var z=[];function B(){if(!w.length||!y.length){return w.length?w:y}if(w[0].offset!=y[0].offset){return(w[0].offset<y[0].offset)?w:y}return y[0].event=="start"?w:y}function A(H){function G(I){return" "+I.nodeName+'="'+k(I.value)+'"'}F+="<"+t(H)+Array.prototype.map.call(H.attributes,G).join("")+">"}function E(G){F+="</"+t(G)+">"}function v(G){(G.event=="start"?A:E)(G.node)}while(w.length||y.length){var D=B();F+=k(C.substr(x,D[0].offset-x));x=D[0].offset;if(D==w){z.reverse().forEach(E);do{v(D.splice(0,1)[0]);D=B()}while(D==w&&D.length&&D[0].offset==x);z.reverse().forEach(A)}else{if(D[0].event=="start"){z.push(D[0].node)}else{z.pop()}v(D.splice(0,1)[0])}}return F+k(C.substr(x))}function m(y){function v(z){return(z&&z.source)||z}function w(A,z){return RegExp(v(A),"m"+(y.cI?"i":"")+(z?"g":""))}function x(D,C){if(D.compiled){return}D.compiled=true;D.k=D.k||D.bK;if(D.k){var z={};function E(G,F){if(y.cI){F=F.toLowerCase()}F.split(" ").forEach(function(H){var I=H.split("|");z[I[0]]=[G,I[1]?Number(I[1]):1]})}if(typeof D.k=="string"){E("keyword",D.k)}else{Object.keys(D.k).forEach(function(F){E(F,D.k[F])})}D.k=z}D.lR=w(D.l||/\b[A-Za-z0-9_]+\b/,true);if(C){if(D.bK){D.b=D.bK.split(" ").join("|")}if(!D.b){D.b=/\B|\b/}D.bR=w(D.b);if(!D.e&&!D.eW){D.e=/\B|\b/}if(D.e){D.eR=w(D.e)}D.tE=v(D.e)||"";if(D.eW&&C.tE){D.tE+=(D.e?"|":"")+C.tE}}if(D.i){D.iR=w(D.i)}if(D.r===undefined){D.r=1}if(!D.c){D.c=[]}var B=[];D.c.forEach(function(F){if(F.v){F.v.forEach(function(G){B.push(o(F,G))})}else{B.push(F=="self"?D:F)}});D.c=B;D.c.forEach(function(F){x(F,D)});if(D.starts){x(D.starts,C)}var A=D.c.map(function(F){return F.bK?"\\.?\\b("+F.b+")\\b\\.?":F.b}).concat([D.tE]).concat([D.i]).map(v).filter(Boolean);D.t=A.length?w(A.join("|"),true):{exec:function(F){return null}};D.continuation={}}x(y)}function c(S,L,J,R){function v(U,V){for(var T=0;T<V.c.length;T++){if(i(V.c[T].bR,U)){return V.c[T]}}}function z(U,T){if(i(U.eR,T)){return U}if(U.eW){return z(U.parent,T)}}function A(T,U){return !J&&i(U.iR,T)}function E(V,T){var U=M.cI?T[0].toLowerCase():T[0];return V.k.hasOwnProperty(U)&&V.k[U]}function w(Z,X,W,V){var T=V?"":b.classPrefix,U='<span class="'+T,Y=W?"":"</span>";U+=Z+'">';return U+X+Y}function N(){var U=k(C);if(!I.k){return U}var T="";var X=0;I.lR.lastIndex=0;var V=I.lR.exec(U);while(V){T+=U.substr(X,V.index-X);var W=E(I,V);if(W){H+=W[1];T+=w(W[0],V[0])}else{T+=V[0]}X=I.lR.lastIndex;V=I.lR.exec(U)}return T+U.substr(X)}function F(){if(I.sL&&!f[I.sL]){return k(C)}var T=I.sL?c(I.sL,C,true,I.continuation.top):g(C);if(I.r>0){H+=T.r}if(I.subLanguageMode=="continuous"){I.continuation.top=T.top}return w(T.language,T.value,false,true)}function Q(){return I.sL!==undefined?F():N()}function P(V,U){var T=V.cN?w(V.cN,"",true):"";if(V.rB){D+=T;C=""}else{if(V.eB){D+=k(U)+T;C=""}else{D+=T;C=U}}I=Object.create(V,{parent:{value:I}})}function G(T,X){C+=T;if(X===undefined){D+=Q();return 0}var V=v(X,I);if(V){D+=Q();P(V,X);return V.rB?0:X.length}var W=z(I,X);if(W){var U=I;if(!(U.rE||U.eE)){C+=X}D+=Q();do{if(I.cN){D+="</span>"}H+=I.r;I=I.parent}while(I!=W.parent);if(U.eE){D+=k(X)}C="";if(W.starts){P(W.starts,"")}return U.rE?0:X.length}if(A(X,I)){throw new Error('Illegal lexeme "'+X+'" for mode "'+(I.cN||"<unnamed>")+'"')}C+=X;return X.length||1}var M=j(S);if(!M){throw new Error('Unknown language: "'+S+'"')}m(M);var I=R||M;var D="";for(var K=I;K!=M;K=K.parent){if(K.cN){D=w(K.cN,D,true)}}var C="";var H=0;try{var B,y,x=0;while(true){I.t.lastIndex=x;B=I.t.exec(L);if(!B){break}y=G(L.substr(x,B.index-x),B[0]);x=B.index+y}G(L.substr(x));for(var K=I;K.parent;K=K.parent){if(K.cN){D+="</span>"}}return{r:H,value:D,language:S,top:I}}catch(O){if(O.message.indexOf("Illegal")!=-1){return{r:0,value:k(L)}}else{throw O}}}function g(y,x){x=x||b.languages||Object.keys(f);var v={r:0,value:k(y)};var w=v;x.forEach(function(z){if(!j(z)){return}var A=c(z,y,false);A.language=z;if(A.r>w.r){w=A}if(A.r>v.r){w=v;v=A}});if(w.language){v.second_best=w}return v}function h(v){if(b.tabReplace){v=v.replace(/^((<[^>]+>|\t)+)/gm,function(w,z,y,x){return z.replace(/\t/g,b.tabReplace)})}if(b.useBR){v=v.replace(/\n/g,"<br>")}return v}function p(z){var y=d(z);var A=r(z);if(A=="no-highlight"){return}var v=A?c(A,y,true):g(y);var w=u(z);if(w.length){var x=document.createElementNS("http://www.w3.org/1999/xhtml","pre");x.innerHTML=v.value;v.value=q(w,u(x),y)}v.value=h(v.value);z.innerHTML=v.value;z.className+=" hljs "+(!A&&v.language||"");z.result={language:v.language,re:v.r};if(v.second_best){z.second_best={language:v.second_best.language,re:v.second_best.r}}}var b={classPrefix:"hljs-",tabReplace:null,useBR:false,languages:undefined};function s(v){b=o(b,v)}function l(){if(l.called){return}l.called=true;var v=document.querySelectorAll("pre code");Array.prototype.forEach.call(v,p)}function a(){addEventListener("DOMContentLoaded",l,false);addEventListener("load",l,false)}var f={};var n={};function e(v,x){var w=f[v]=x(this);if(w.aliases){w.aliases.forEach(function(y){n[y]=v})}}function j(v){return f[v]||f[n[v]]}this.highlight=c;this.highlightAuto=g;this.fixMarkup=h;this.highlightBlock=p;this.configure=s;this.initHighlighting=l;this.initHighlightingOnLoad=a;this.registerLanguage=e;this.getLanguage=j;this.inherit=o;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE]};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE]};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.REGEXP_MODE={cN:"regexp",b:/\//,e:/\/[gim]*/,i:/\n/,c:[this.BE,{b:/\[/,e:/\]/,r:0,c:[this.BE]}]};this.TM={cN:"title",b:this.IR,r:0};this.UTM={cN:"title",b:this.UIR,r:0}}();hljs.registerLanguage("ruleslanguage",function(a){return{k:{keyword:"BILL_PERIOD BILL_START BILL_STOP RS_EFFECTIVE_START RS_EFFECTIVE_STOP RS_JURIS_CODE RS_OPCO_CODE INTDADDATTRIBUTE|5 INTDADDVMSG|5 INTDBLOCKOP|5 INTDBLOCKOPNA|5 INTDCLOSE|5 INTDCOUNT|5 INTDCOUNTSTATUSCODE|5 INTDCREATEMASK|5 INTDCREATEDAYMASK|5 INTDCREATEFACTORMASK|5 INTDCREATEHANDLE|5 INTDCREATEOVERRIDEDAYMASK|5 INTDCREATEOVERRIDEMASK|5 INTDCREATESTATUSCODEMASK|5 INTDCREATETOUPERIOD|5 INTDDELETE|5 INTDDIPTEST|5 INTDEXPORT|5 INTDGETERRORCODE|5 INTDGETERRORMESSAGE|5 INTDISEQUAL|5 INTDJOIN|5 INTDLOAD|5 INTDLOADACTUALCUT|5 INTDLOADDATES|5 INTDLOADHIST|5 INTDLOADLIST|5 INTDLOADLISTDATES|5 INTDLOADLISTENERGY|5 INTDLOADLISTHIST|5 INTDLOADRELATEDCHANNEL|5 INTDLOADSP|5 INTDLOADSTAGING|5 INTDLOADUOM|5 INTDLOADUOMDATES|5 INTDLOADUOMHIST|5 INTDLOADVERSION|5 INTDOPEN|5 INTDREADFIRST|5 INTDREADNEXT|5 INTDRECCOUNT|5 INTDRELEASE|5 INTDREPLACE|5 INTDROLLAVG|5 INTDROLLPEAK|5 INTDSCALAROP|5 INTDSCALE|5 INTDSETATTRIBUTE|5 INTDSETDSTPARTICIPANT|5 INTDSETSTRING|5 INTDSETVALUE|5 INTDSETVALUESTATUS|5 INTDSHIFTSTARTTIME|5 INTDSMOOTH|5 INTDSORT|5 INTDSPIKETEST|5 INTDSUBSET|5 INTDTOU|5 INTDTOURELEASE|5 INTDTOUVALUE|5 INTDUPDATESTATS|5 INTDVALUE|5 STDEV INTDDELETEEX|5 INTDLOADEXACTUAL|5 INTDLOADEXCUT|5 INTDLOADEXDATES|5 INTDLOADEX|5 INTDLOADEXRELATEDCHANNEL|5 INTDSAVEEX|5 MVLOAD|5 MVLOADACCT|5 MVLOADACCTDATES|5 MVLOADACCTHIST|5 MVLOADDATES|5 MVLOADHIST|5 MVLOADLIST|5 MVLOADLISTDATES|5 MVLOADLISTHIST|5 IF FOR NEXT DONE SELECT END CALL ABORT CLEAR CHANNEL FACTOR LIST NUMBER OVERRIDE SET WEEK DISTRIBUTIONNODE ELSE WHEN THEN OTHERWISE IENUM CSV INCLUDE LEAVE RIDER SAVE DELETE NOVALUE SECTION WARN SAVE_UPDATE DETERMINANT LABEL REPORT REVENUE EACH IN FROM TOTAL CHARGE BLOCK AND OR CSV_FILE RATE_CODE AUXILIARY_DEMAND UIDACCOUNT RS BILL_PERIOD_SELECT HOURS_PER_MONTH INTD_ERROR_STOP SEASON_SCHEDULE_NAME ACCOUNTFACTOR ARRAYUPPERBOUND CALLSTOREDPROC GETADOCONNECTION GETCONNECT GETDATASOURCE GETQUALIFIER GETUSERID HASVALUE LISTCOUNT LISTOP LISTUPDATE LISTVALUE PRORATEFACTOR RSPRORATE SETBINPATH SETDBMONITOR WQ_OPEN BILLINGHOURS DATE DATEFROMFLOAT DATETIMEFROMSTRING DATETIMETOSTRING DATETOFLOAT DAY DAYDIFF DAYNAME DBDATETIME HOUR MINUTE MONTH MONTHDIFF MONTHHOURS MONTHNAME ROUNDDATE SAMEWEEKDAYLASTYEAR SECOND WEEKDAY WEEKDIFF YEAR YEARDAY YEARSTR COMPSUM HISTCOUNT HISTMAX HISTMIN HISTMINNZ HISTVALUE MAXNRANGE MAXRANGE MINRANGE COMPIKVA COMPKVA COMPKVARFROMKQKW COMPLF IDATTR FLAG LF2KW LF2KWH MAXKW POWERFACTOR READING2USAGE AVGSEASON MAXSEASON MONTHLYMERGE SEASONVALUE SUMSEASON ACCTREADDATES ACCTTABLELOAD CONFIGADD CONFIGGET CREATEOBJECT CREATEREPORT EMAILCLIENT EXPBLKMDMUSAGE EXPMDMUSAGE EXPORT_USAGE FACTORINEFFECT GETUSERSPECIFIEDSTOP INEFFECT ISHOLIDAY RUNRATE SAVE_PROFILE SETREPORTTITLE USEREXIT WATFORRUNRATE TO TABLE ACOS ASIN ATAN ATAN2 BITAND CEIL COS COSECANT COSH COTANGENT DIVQUOT DIVREM EXP FABS FLOOR FMOD FREPM FREXPN LOG LOG10 MAX MAXN MIN MINNZ MODF POW ROUND ROUND2VALUE ROUNDINT SECANT SIN SINH SQROOT TAN TANH FLOAT2STRING FLOAT2STRINGNC INSTR LEFT LEN LTRIM MID RIGHT RTRIM STRING STRINGNC TOLOWER TOUPPER TRIM NUMDAYS READ_DATE STAGING",built_in:"IDENTIFIER OPTIONS XML_ELEMENT XML_OP XML_ELEMENT_OF DOMDOCCREATE DOMDOCLOADFILE DOMDOCLOADXML DOMDOCSAVEFILE DOMDOCGETROOT DOMDOCADDPI DOMNODEGETNAME DOMNODEGETTYPE DOMNODEGETVALUE DOMNODEGETCHILDCT DOMNODEGETFIRSTCHILD DOMNODEGETSIBLING DOMNODECREATECHILDELEMENT DOMNODESETATTRIBUTE DOMNODEGETCHILDELEMENTCT DOMNODEGETFIRSTCHILDELEMENT DOMNODEGETSIBLINGELEMENT DOMNODEGETATTRIBUTECT DOMNODEGETATTRIBUTEI DOMNODEGETATTRIBUTEBYNAME DOMNODEGETBYNAME"},c:[a.CLCM,a.CBLCLM,a.ASM,a.QSM,a.CNM,{cN:"array",b:"#[a-zA-Z .]+"}]}});hljs.registerLanguage("ruby",function(e){var h="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var g="and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor";var a={cN:"yardoctag",b:"@[A-Za-z]+"};var i={cN:"comment",v:[{b:"#",e:"$",c:[a]},{b:"^\\=begin",e:"^\\=end",c:[a],r:10},{b:"^__END__",e:"\\n$"}]};var c={cN:"subst",b:"#\\{",e:"}",k:g};var d={cN:"string",c:[e.BE,c],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:"%[qw]?\\(",e:"\\)"},{b:"%[qw]?\\[",e:"\\]"},{b:"%[qw]?{",e:"}"},{b:"%[qw]?<",e:">",r:10},{b:"%[qw]?/",e:"/",r:10},{b:"%[qw]?%",e:"%",r:10},{b:"%[qw]?-",e:"-",r:10},{b:"%[qw]?\\|",e:"\\|",r:10},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/}]};var b={cN:"params",b:"\\(",e:"\\)",k:g};var f=[d,i,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+e.IR+"::)?"+e.IR}]},i]},{cN:"function",bK:"def",e:" |$|;",r:0,c:[e.inherit(e.TM,{b:h}),b,i]},{cN:"constant",b:"(::)?(\\b[A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:":",c:[d,{b:h}],r:0},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+e.RSR+")\\s*",c:[i,{cN:"regexp",c:[e.BE,c],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}],r:0}];c.c=f;b.c=f;return{k:g,c:f}});hljs.registerLanguage("haml",function(a){return{cI:true,c:[{cN:"doctype",b:"^!!!( (5|1\\.1|Strict|Frameset|Basic|Mobile|RDFa|XML\\b.*))?$",r:10},{cN:"comment",b:"^\\s*(!=#|=#|-#|/).*$",r:0},{b:"^\\s*(-|=|!=)(?!#)",starts:{e:"\\n",sL:"ruby"}},{cN:"tag",b:"^\\s*%",c:[{cN:"title",b:"\\w+"},{cN:"value",b:"[#\\.]\\w+"},{b:"{\\s*",e:"\\s*}",eE:true,c:[{b:":\\w+\\s*=>",e:",\\s+",rB:true,eW:true,c:[{cN:"symbol",b:":\\w+"},{cN:"string",b:'"',e:'"'},{cN:"string",b:"'",e:"'"},{b:"\\w+",r:0}]}]},{b:"\\(\\s*",e:"\\s*\\)",eE:true,c:[{b:"\\w+\\s*=",e:"\\s+",rB:true,eW:true,c:[{cN:"attribute",b:"\\w+",r:0},{cN:"string",b:'"',e:'"'},{cN:"string",b:"'",e:"'"},{b:"\\w+",r:0}]},]}]},{cN:"bullet",b:"^\\s*[=~]\\s*",r:0},{b:"#{",starts:{e:"}",sL:"ruby"}}]}});hljs.registerLanguage("haskell",function(f){var g={cN:"comment",v:[{b:"--",e:"$"},{b:"{-",e:"-}",c:["self"]}]};var e={cN:"pragma",b:"{-#",e:"#-}"};var b={cN:"preprocessor",b:"^#",e:"$"};var d={cN:"type",b:"\\b[A-Z][\\w']*",r:0};var c={cN:"container",b:"\\(",e:"\\)",i:'"',c:[e,g,b,{cN:"type",b:"\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"},f.inherit(f.TM,{b:"[_a-z][\\w']*"})]};var a={cN:"container",b:"{",e:"}",c:c.c};return{k:"let in if then else case of where do module import hiding qualified type data newtype deriving class instance as default infix infixl infixr foreign export ccall stdcall cplusplus jvm dotnet safe unsafe family forall mdo proc rec",c:[{cN:"module",b:"\\bmodule\\b",e:"where",k:"module where",c:[c,g],i:"\\W\\.|;"},{cN:"import",b:"\\bimport\\b",e:"$",k:"import|0 qualified as hiding",c:[c,g],i:"\\W\\.|;"},{cN:"class",b:"^(\\s*)?(class|instance)\\b",e:"where",k:"class family instance where",c:[d,c,g]},{cN:"typedef",b:"\\b(data|(new)?type)\\b",e:"$",k:"data family type newtype deriving",c:[e,g,d,c,a]},{cN:"default",bK:"default",e:"$",c:[d,c,g]},{cN:"infix",bK:"infix infixl infixr",e:"$",c:[f.CNM,g]},{cN:"foreign",b:"\\bforeign\\b",e:"$",k:"foreign import export ccall stdcall cplusplus jvm dotnet safe unsafe",c:[d,f.QSM,g]},{cN:"shebang",b:"#!\\/usr\\/bin\\/env runhaskell",e:"$"},e,g,b,f.QSM,f.CNM,d,f.inherit(f.TM,{b:"^[_a-z][\\w']*"}),{b:"->|<-"}]}});hljs.registerLanguage("xml",function(a){var c="[A-Za-z0-9\\._:-]+";var d={b:/<\?(php)?(?!\w)/,e:/\?>/,sL:"php",subLanguageMode:"continuous"};var b={eW:true,i:/</,r:0,c:[d,{cN:"attribute",b:c,r:0},{b:"=",r:0,c:[{cN:"value",v:[{b:/"/,e:/"/},{b:/'/,e:/'/},{b:/[^\s\/>]+/}]}]}]};return{aliases:["html"],cI:true,c:[{cN:"doctype",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"<!--",e:"-->",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{title:"style"},c:[b],starts:{e:"</style>",rE:true,sL:"css"}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{title:"script"},c:[b],starts:{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},d,{cN:"pi",b:/<\?\w+/,e:/\?>/,r:10},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"title",b:"[^ /><]+",r:0},b]}]}});hljs.registerLanguage("django",function(a){var b={cN:"filter",b:/\|[A-Za-z]+\:?/,k:"truncatewords removetags linebreaksbr yesno get_digit timesince random striptags filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort dictsortreversed default_if_none pluralize lower join center default truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize localtime utc timezone",c:[{cN:"argument",b:/"/,e:/"/},{cN:"argument",b:/'/,e:/'/}]};return{cI:true,sL:"xml",subLanguageMode:"continuous",c:[{cN:"template_comment",b:/\{%\s*comment\s*%}/,e:/\{%\s*endcomment\s*%}/},{cN:"template_comment",b:/\{#/,e:/#}/},{cN:"template_tag",b:/\{%/,e:/%}/,k:"comment endcomment load templatetag ifchanged endifchanged if endif firstof for endfor in ifnotequal endifnotequal widthratio extends include spaceless endspaceless regroup by as ifequal endifequal ssi now with cycle url filter endfilter debug block endblock else autoescape endautoescape csrf_token empty elif endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix plural get_current_language language get_available_languages get_current_language_bidi get_language_info get_language_info_list localize endlocalize localtime endlocaltime timezone endtimezone get_current_timezone verbatim",c:[b]},{cN:"variable",b:/\{\{/,e:/}}/,c:[b]}]}});hljs.registerLanguage("bash",function(b){var a={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)\}/}]};var d={cN:"string",b:/"/,e:/"/,c:[b.BE,a,{cN:"variable",b:/\$\(/,e:/\)/,c:[b.BE]}]};var c={cN:"string",b:/'/,e:/'/};return{l:/-?[a-z\.]+/,k:{keyword:"if then else elif fi for break continue while in do done exit return set declare case esac export exec",literal:"true false",built_in:"printf echo read cd pwd pushd popd dirs let eval unset typeset readonly getopts source shopt caller type hash bind help sudo",operator:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"shebang",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:true,c:[b.inherit(b.TM,{b:/\w[\w\d_]*/})],r:0},b.HCM,b.NM,d,c,a]}});hljs.registerLanguage("ini",function(a){return{cI:true,i:/\S/,c:[{cN:"comment",b:";",e:"$"},{cN:"title",b:"^\\[",e:"\\]"},{cN:"setting",b:"^[a-z0-9\\[\\]_-]+[ \\t]*=[ \\t]*",e:"$",c:[{cN:"value",eW:true,k:"on off true false yes no",c:[a.QSM,a.NM],r:0}]}]}});hljs.registerLanguage("objectivec",function(a){var d={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign self synchronized id nonatomic super unichar IBOutlet IBAction strong weak @private @protected @public @try @property @end @throw @catch @finally @synthesize @dynamic @selector @optional @required",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"NSString NSDictionary CGRect CGPoint UIButton UILabel UITextView UIWebView MKMapView UISegmentedControl NSObject UITableViewDelegate UITableViewDataSource NSThread UIActivityIndicator UITabbar UIToolBar UIBarButtonItem UIImageView NSAutoreleasePool UITableView BOOL NSInteger CGFloat NSException NSLog NSMutableString NSMutableArray NSMutableDictionary NSURL NSIndexPath CGSize UITableViewCell UIView UIViewController UINavigationBar UINavigationController UITabBarController UIPopoverController UIPopoverControllerDelegate UIImage NSNumber UISearchBar NSFetchedResultsController NSFetchedResultsChangeType UIScrollView UIScrollViewDelegate UIEdgeInsets UIColor UIFont UIApplication NSNotFound NSNotificationCenter NSNotification UILocalNotification NSBundle NSFileManager NSTimeInterval NSDate NSCalendar NSUserDefaults UIWindow NSRange NSArray NSError NSURLRequest NSURLConnection UIInterfaceOrientation MPMoviePlayerController dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"};var c=/[a-zA-Z@][a-zA-Z0-9_]*/;var b="@interface @class @protocol @implementation";return{k:d,l:c,i:"</",c:[a.CLCM,a.CBLCLM,a.CNM,a.QSM,{cN:"string",b:"'",e:"[^\\\\]'",i:"[^\\\\][^']"},{cN:"preprocessor",b:"#import",e:"$",c:[{cN:"title",b:'"',e:'"'},{cN:"title",b:"<",e:">"}]},{cN:"preprocessor",b:"#",e:"$"},{cN:"class",b:"("+b.split(" ").join("|")+")\\b",e:"({|$)",k:b,l:c,c:[a.UTM]},{cN:"variable",b:"\\."+a.UIR,r:0}]}});hljs.registerLanguage("scss",function(a){var c="[a-zA-Z-][a-zA-Z0-9_-]*";var d={cN:"function",b:c+"\\(",e:"\\)",c:["self",a.NM,a.ASM,a.QSM]};var b={cN:"hexcolor",b:"#[0-9A-Fa-f]+"};var e={cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[d,b,a.NM,a.QSM,a.ASM,a.CBLCLM,{cN:"important",b:"!important"}]}};return{cI:true,i:"[=/|']",c:[a.CLCM,a.CBLCLM,{cN:"function",b:c+"\\(",e:"\\)",c:["self",a.NM,a.ASM,a.QSM]},{cN:"id",b:"\\#[A-Za-z0-9_-]+",r:0},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"tag",b:"\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\\b",r:0},{cN:"pseudo",b:":(visited|valid|root|right|required|read-write|read-only|out-range|optional|only-of-type|only-child|nth-of-type|nth-last-of-type|nth-last-child|nth-child|not|link|left|last-of-type|last-child|lang|invalid|indeterminate|in-range|hover|focus|first-of-type|first-line|first-letter|first-child|first|enabled|empty|disabled|default|checked|before|after|active)"},{cN:"pseudo",b:"::(after|before|choices|first-letter|first-line|repeat-index|repeat-item|selection|value)"},{cN:"attribute",b:"\\b(z-index|word-wrap|word-spacing|word-break|width|widows|white-space|visibility|vertical-align|unicode-bidi|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform|top|text-underline-position|text-transform|text-shadow|text-rendering|text-overflow|text-indent|text-decoration-style|text-decoration-line|text-decoration-color|text-decoration|text-align-last|text-align|tab-size|table-layout|right|resize|quotes|position|pointer-events|perspective-origin|perspective|page-break-inside|page-break-before|page-break-after|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-y|overflow-x|overflow-wrap|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|order|opacity|object-position|object-fit|normal|none|nav-up|nav-right|nav-left|nav-index|nav-down|min-width|min-height|max-width|max-height|mask|marks|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|left|justify-content|initial|inherit|ime-mode|image-orientation|image-resolution|image-rendering|icon|hyphens|height|font-weight|font-variant-ligatures|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-language-override|font-kerning|font-feature-settings|font-family|font|float|flex-wrap|flex-shrink|flex-grow|flex-flow|flex-direction|flex-basis|flex|filter|empty-cells|display|direction|cursor|counter-reset|counter-increment|content|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|columns|color|clip-path|clip|clear|caption-side|break-inside|break-before|break-after|box-sizing|box-shadow|box-decoration-break|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-left-width|border-left-style|border-left-color|border-left|border-image-width|border-image-source|border-image-slice|border-image-repeat|border-image-outset|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-attachment|background|backface-visibility|auto|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-fill-mode|animation-duration|animation-direction|animation-delay|animation|align-self|align-items|align-content)\\b",i:"[^\\s]"},{cN:"value",b:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{cN:"value",b:":",e:";",c:[b,a.NM,a.QSM,a.ASM,{cN:"important",b:"!important"}]},{cN:"at_rule",b:"@",e:"[{;]",k:"mixin include extend for if else each while charset import debug media page content font-face namespace warn",c:[d,a.QSM,a.ASM,b,a.NM,{cN:"preprocessor",b:"\\s[A-Za-z0-9_.-]+",r:0}]}]}});hljs.registerLanguage("python",function(a){var f={cN:"prompt",b:/^(>>>|\.\.\.) /};var b={cN:"string",c:[a.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[f],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[f],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/,},{b:/(b|br)"/,e:/"/,},a.ASM,a.QSM]};var d={cN:"number",r:0,v:[{b:a.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:a.CNR+"[lLjJ]?"}]};var e={cN:"params",b:/\(/,e:/\)/,c:["self",f,d,b]};var c={e:/:/,i:/[${=;\n]/,c:[a.UTM,e]};return{k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)/,c:[f,d,b,a.HCM,a.inherit(c,{cN:"function",bK:"def",r:10}),a.inherit(c,{cN:"class",bK:"class"}),{cN:"decorator",b:/@/,e:/$/},{b:/\b(print|exec)\(/}]}});hljs.registerLanguage("mel",function(a){return{k:"int float string vector matrix if else switch case default while do for in break continue global proc return about abs addAttr addAttributeEditorNodeHelp addDynamic addNewShelfTab addPP addPanelCategory addPrefixToName advanceToNextDrivenKey affectedNet affects aimConstraint air alias aliasAttr align alignCtx alignCurve alignSurface allViewFit ambientLight angle angleBetween animCone animCurveEditor animDisplay animView annotate appendStringArray applicationName applyAttrPreset applyTake arcLenDimContext arcLengthDimension arclen arrayMapper art3dPaintCtx artAttrCtx artAttrPaintVertexCtx artAttrSkinPaintCtx artAttrTool artBuildPaintMenu artFluidAttrCtx artPuttyCtx artSelectCtx artSetPaintCtx artUserPaintCtx assignCommand assignInputDevice assignViewportFactories attachCurve attachDeviceAttr attachSurface attrColorSliderGrp attrCompatibility attrControlGrp attrEnumOptionMenu attrEnumOptionMenuGrp attrFieldGrp attrFieldSliderGrp attrNavigationControlGrp attrPresetEditWin attributeExists attributeInfo attributeMenu attributeQuery autoKeyframe autoPlace bakeClip bakeFluidShading bakePartialHistory bakeResults bakeSimulation basename basenameEx batchRender bessel bevel bevelPlus binMembership bindSkin blend2 blendShape blendShapeEditor blendShapePanel blendTwoAttr blindDataType boneLattice boundary boxDollyCtx boxZoomCtx bufferCurve buildBookmarkMenu buildKeyframeMenu button buttonManip CBG cacheFile cacheFileCombine cacheFileMerge cacheFileTrack camera cameraView canCreateManip canvas capitalizeString catch catchQuiet ceil changeSubdivComponentDisplayLevel changeSubdivRegion channelBox character characterMap characterOutlineEditor characterize chdir checkBox checkBoxGrp checkDefaultRenderGlobals choice circle circularFillet clamp clear clearCache clip clipEditor clipEditorCurrentTimeCtx clipSchedule clipSchedulerOutliner clipTrimBefore closeCurve closeSurface cluster cmdFileOutput cmdScrollFieldExecuter cmdScrollFieldReporter cmdShell coarsenSubdivSelectionList collision color colorAtPoint colorEditor colorIndex colorIndexSliderGrp colorSliderButtonGrp colorSliderGrp columnLayout commandEcho commandLine commandPort compactHairSystem componentEditor compositingInterop computePolysetVolume condition cone confirmDialog connectAttr connectControl connectDynamic connectJoint connectionInfo constrain constrainValue constructionHistory container containsMultibyte contextInfo control convertFromOldLayers convertIffToPsd convertLightmap convertSolidTx convertTessellation convertUnit copyArray copyFlexor copyKey copySkinWeights cos cpButton cpCache cpClothSet cpCollision cpConstraint cpConvClothToMesh cpForces cpGetSolverAttr cpPanel cpProperty cpRigidCollisionFilter cpSeam cpSetEdit cpSetSolverAttr cpSolver cpSolverTypes cpTool cpUpdateClothUVs createDisplayLayer createDrawCtx createEditor createLayeredPsdFile createMotionField createNewShelf createNode createRenderLayer createSubdivRegion cross crossProduct ctxAbort ctxCompletion ctxEditMode ctxTraverse currentCtx currentTime currentTimeCtx currentUnit curve curveAddPtCtx curveCVCtx curveEPCtx curveEditorCtx curveIntersect curveMoveEPCtx curveOnSurface curveSketchCtx cutKey cycleCheck cylinder dagPose date defaultLightListCheckBox defaultNavigation defineDataServer defineVirtualDevice deformer deg_to_rad delete deleteAttr deleteShadingGroupsAndMaterials deleteShelfTab deleteUI deleteUnusedBrushes delrandstr detachCurve detachDeviceAttr detachSurface deviceEditor devicePanel dgInfo dgdirty dgeval dgtimer dimWhen directKeyCtx directionalLight dirmap dirname disable disconnectAttr disconnectJoint diskCache displacementToPoly displayAffected displayColor displayCull displayLevelOfDetail displayPref displayRGBColor displaySmoothness displayStats displayString displaySurface distanceDimContext distanceDimension doBlur dolly dollyCtx dopeSheetEditor dot dotProduct doubleProfileBirailSurface drag dragAttrContext draggerContext dropoffLocator duplicate duplicateCurve duplicateSurface dynCache dynControl dynExport dynExpression dynGlobals dynPaintEditor dynParticleCtx dynPref dynRelEdPanel dynRelEditor dynamicLoad editAttrLimits editDisplayLayerGlobals editDisplayLayerMembers editRenderLayerAdjustment editRenderLayerGlobals editRenderLayerMembers editor editorTemplate effector emit emitter enableDevice encodeString endString endsWith env equivalent equivalentTol erf error eval evalDeferred evalEcho event exactWorldBoundingBox exclusiveLightCheckBox exec executeForEachObject exists exp expression expressionEditorListen extendCurve extendSurface extrude fcheck fclose feof fflush fgetline fgetword file fileBrowserDialog fileDialog fileExtension fileInfo filetest filletCurve filter filterCurve filterExpand filterStudioImport findAllIntersections findAnimCurves findKeyframe findMenuItem findRelatedSkinCluster finder firstParentOf fitBspline flexor floatEq floatField floatFieldGrp floatScrollBar floatSlider floatSlider2 floatSliderButtonGrp floatSliderGrp floor flow fluidCacheInfo fluidEmitter fluidVoxelInfo flushUndo fmod fontDialog fopen formLayout format fprint frameLayout fread freeFormFillet frewind fromNativePath fwrite gamma gauss geometryConstraint getApplicationVersionAsFloat getAttr getClassification getDefaultBrush getFileList getFluidAttr getInputDeviceRange getMayaPanelTypes getModifiers getPanel getParticleAttr getPluginResource getenv getpid glRender glRenderEditor globalStitch gmatch goal gotoBindPose grabColor gradientControl gradientControlNoAttr graphDollyCtx graphSelectContext graphTrackCtx gravity grid gridLayout group groupObjectsByName HfAddAttractorToAS HfAssignAS HfBuildEqualMap HfBuildFurFiles HfBuildFurImages HfCancelAFR HfConnectASToHF HfCreateAttractor HfDeleteAS HfEditAS HfPerformCreateAS HfRemoveAttractorFromAS HfSelectAttached HfSelectAttractors HfUnAssignAS hardenPointCurve hardware hardwareRenderPanel headsUpDisplay headsUpMessage help helpLine hermite hide hilite hitTest hotBox hotkey hotkeyCheck hsv_to_rgb hudButton hudSlider hudSliderButton hwReflectionMap hwRender hwRenderLoad hyperGraph hyperPanel hyperShade hypot iconTextButton iconTextCheckBox iconTextRadioButton iconTextRadioCollection iconTextScrollList iconTextStaticLabel ikHandle ikHandleCtx ikHandleDisplayScale ikSolver ikSplineHandleCtx ikSystem ikSystemInfo ikfkDisplayMethod illustratorCurves image imfPlugins inheritTransform insertJoint insertJointCtx insertKeyCtx insertKnotCurve insertKnotSurface instance instanceable instancer intField intFieldGrp intScrollBar intSlider intSliderGrp interToUI internalVar intersect iprEngine isAnimCurve isConnected isDirty isParentOf isSameObject isTrue isValidObjectName isValidString isValidUiName isolateSelect itemFilter itemFilterAttr itemFilterRender itemFilterType joint jointCluster jointCtx jointDisplayScale jointLattice keyTangent keyframe keyframeOutliner keyframeRegionCurrentTimeCtx keyframeRegionDirectKeyCtx keyframeRegionDollyCtx keyframeRegionInsertKeyCtx keyframeRegionMoveKeyCtx keyframeRegionScaleKeyCtx keyframeRegionSelectKeyCtx keyframeRegionSetKeyCtx keyframeRegionTrackCtx keyframeStats lassoContext lattice latticeDeformKeyCtx launch launchImageEditor layerButton layeredShaderPort layeredTexturePort layout layoutDialog lightList lightListEditor lightListPanel lightlink lineIntersection linearPrecision linstep listAnimatable listAttr listCameras listConnections listDeviceAttachments listHistory listInputDeviceAxes listInputDeviceButtons listInputDevices listMenuAnnotation listNodeTypes listPanelCategories listRelatives listSets listTransforms listUnselected listerEditor loadFluid loadNewShelf loadPlugin loadPluginLanguageResources loadPrefObjects localizedPanelLabel lockNode loft log longNameOf lookThru ls lsThroughFilter lsType lsUI Mayatomr mag makeIdentity makeLive makePaintable makeRoll makeSingleSurface makeTubeOn makebot manipMoveContext manipMoveLimitsCtx manipOptions manipRotateContext manipRotateLimitsCtx manipScaleContext manipScaleLimitsCtx marker match max memory menu menuBarLayout menuEditor menuItem menuItemToShelf menuSet menuSetPref messageLine min minimizeApp mirrorJoint modelCurrentTimeCtx modelEditor modelPanel mouse movIn movOut move moveIKtoFK moveKeyCtx moveVertexAlongDirection multiProfileBirailSurface mute nParticle nameCommand nameField namespace namespaceInfo newPanelItems newton nodeCast nodeIconButton nodeOutliner nodePreset nodeType noise nonLinear normalConstraint normalize nurbsBoolean nurbsCopyUVSet nurbsCube nurbsEditUV nurbsPlane nurbsSelect nurbsSquare nurbsToPoly nurbsToPolygonsPref nurbsToSubdiv nurbsToSubdivPref nurbsUVSet nurbsViewDirectionVector objExists objectCenter objectLayer objectType objectTypeUI obsoleteProc oceanNurbsPreviewPlane offsetCurve offsetCurveOnSurface offsetSurface openGLExtension openMayaPref optionMenu optionMenuGrp optionVar orbit orbitCtx orientConstraint outlinerEditor outlinerPanel overrideModifier paintEffectsDisplay pairBlend palettePort paneLayout panel panelConfiguration panelHistory paramDimContext paramDimension paramLocator parent parentConstraint particle particleExists particleInstancer particleRenderInfo partition pasteKey pathAnimation pause pclose percent performanceOptions pfxstrokes pickWalk picture pixelMove planarSrf plane play playbackOptions playblast plugAttr plugNode pluginInfo pluginResourceUtil pointConstraint pointCurveConstraint pointLight pointMatrixMult pointOnCurve pointOnSurface pointPosition poleVectorConstraint polyAppend polyAppendFacetCtx polyAppendVertex polyAutoProjection polyAverageNormal polyAverageVertex polyBevel polyBlendColor polyBlindData polyBoolOp polyBridgeEdge polyCacheMonitor polyCheck polyChipOff polyClipboard polyCloseBorder polyCollapseEdge polyCollapseFacet polyColorBlindData polyColorDel polyColorPerVertex polyColorSet polyCompare polyCone polyCopyUV polyCrease polyCreaseCtx polyCreateFacet polyCreateFacetCtx polyCube polyCut polyCutCtx polyCylinder polyCylindricalProjection polyDelEdge polyDelFacet polyDelVertex polyDuplicateAndConnect polyDuplicateEdge polyEditUV polyEditUVShell polyEvaluate polyExtrudeEdge polyExtrudeFacet polyExtrudeVertex polyFlipEdge polyFlipUV polyForceUV polyGeoSampler polyHelix polyInfo polyInstallAction polyLayoutUV polyListComponentConversion polyMapCut polyMapDel polyMapSew polyMapSewMove polyMergeEdge polyMergeEdgeCtx polyMergeFacet polyMergeFacetCtx polyMergeUV polyMergeVertex polyMirrorFace polyMoveEdge polyMoveFacet polyMoveFacetUV polyMoveUV polyMoveVertex polyNormal polyNormalPerVertex polyNormalizeUV polyOptUvs polyOptions polyOutput polyPipe polyPlanarProjection polyPlane polyPlatonicSolid polyPoke polyPrimitive polyPrism polyProjection polyPyramid polyQuad polyQueryBlindData polyReduce polySelect polySelectConstraint polySelectConstraintMonitor polySelectCtx polySelectEditCtx polySeparate polySetToFaceNormal polySewEdge polyShortestPathCtx polySmooth polySoftEdge polySphere polySphericalProjection polySplit polySplitCtx polySplitEdge polySplitRing polySplitVertex polyStraightenUVBorder polySubdivideEdge polySubdivideFacet polyToSubdiv polyTorus polyTransfer polyTriangulate polyUVSet polyUnite polyWedgeFace popen popupMenu pose pow preloadRefEd print progressBar progressWindow projFileViewer projectCurve projectTangent projectionContext projectionManip promptDialog propModCtx propMove psdChannelOutliner psdEditTextureFile psdExport psdTextureFile putenv pwd python querySubdiv quit rad_to_deg radial radioButton radioButtonGrp radioCollection radioMenuItemCollection rampColorPort rand randomizeFollicles randstate rangeControl readTake rebuildCurve rebuildSurface recordAttr recordDevice redo reference referenceEdit referenceQuery refineSubdivSelectionList refresh refreshAE registerPluginResource rehash reloadImage removeJoint removeMultiInstance removePanelCategory rename renameAttr renameSelectionList renameUI render renderGlobalsNode renderInfo renderLayerButton renderLayerParent renderLayerPostProcess renderLayerUnparent renderManip renderPartition renderQualityNode renderSettings renderThumbnailUpdate renderWindowEditor renderWindowSelectContext renderer reorder reorderDeformers requires reroot resampleFluid resetAE resetPfxToPolyCamera resetTool resolutionNode retarget reverseCurve reverseSurface revolve rgb_to_hsv rigidBody rigidSolver roll rollCtx rootOf rot rotate rotationInterpolation roundConstantRadius rowColumnLayout rowLayout runTimeCommand runup sampleImage saveAllShelves saveAttrPreset saveFluid saveImage saveInitialState saveMenu savePrefObjects savePrefs saveShelf saveToolSettings scale scaleBrushBrightness scaleComponents scaleConstraint scaleKey scaleKeyCtx sceneEditor sceneUIReplacement scmh scriptCtx scriptEditorInfo scriptJob scriptNode scriptTable scriptToShelf scriptedPanel scriptedPanelType scrollField scrollLayout sculpt searchPathArray seed selLoadSettings select selectContext selectCurveCV selectKey selectKeyCtx selectKeyframeRegionCtx selectMode selectPref selectPriority selectType selectedNodes selectionConnection separator setAttr setAttrEnumResource setAttrMapping setAttrNiceNameResource setConstraintRestPosition setDefaultShadingGroup setDrivenKeyframe setDynamic setEditCtx setEditor setFluidAttr setFocus setInfinity setInputDeviceMapping setKeyCtx setKeyPath setKeyframe setKeyframeBlendshapeTargetWts setMenuMode setNodeNiceNameResource setNodeTypeFlag setParent setParticleAttr setPfxToPolyCamera setPluginResource setProject setStampDensity setStartupMessage setState setToolTo setUITemplate setXformManip sets shadingConnection shadingGeometryRelCtx shadingLightRelCtx shadingNetworkCompare shadingNode shapeCompare shelfButton shelfLayout shelfTabLayout shellField shortNameOf showHelp showHidden showManipCtx showSelectionInTitle showShadingGroupAttrEditor showWindow sign simplify sin singleProfileBirailSurface size sizeBytes skinCluster skinPercent smoothCurve smoothTangentSurface smoothstep snap2to2 snapKey snapMode snapTogetherCtx snapshot soft softMod softModCtx sort sound soundControl source spaceLocator sphere sphrand spotLight spotLightPreviewPort spreadSheetEditor spring sqrt squareSurface srtContext stackTrace startString startsWith stitchAndExplodeShell stitchSurface stitchSurfacePoints strcmp stringArrayCatenate stringArrayContains stringArrayCount stringArrayInsertAtIndex stringArrayIntersector stringArrayRemove stringArrayRemoveAtIndex stringArrayRemoveDuplicates stringArrayRemoveExact stringArrayToString stringToStringArray strip stripPrefixFromName stroke subdAutoProjection subdCleanTopology subdCollapse subdDuplicateAndConnect subdEditUV subdListComponentConversion subdMapCut subdMapSewMove subdMatchTopology subdMirror subdToBlind subdToPoly subdTransferUVsToCache subdiv subdivCrease subdivDisplaySmoothness substitute substituteAllString substituteGeometry substring surface surfaceSampler surfaceShaderList swatchDisplayPort switchTable symbolButton symbolCheckBox sysFile system tabLayout tan tangentConstraint texLatticeDeformContext texManipContext texMoveContext texMoveUVShellContext texRotateContext texScaleContext texSelectContext texSelectShortestPathCtx texSmudgeUVContext texWinToolCtx text textCurves textField textFieldButtonGrp textFieldGrp textManip textScrollList textToShelf textureDisplacePlane textureHairColor texturePlacementContext textureWindow threadCount threePointArcCtx timeControl timePort timerX toNativePath toggle toggleAxis toggleWindowVisibility tokenize tokenizeList tolerance tolower toolButton toolCollection toolDropped toolHasOptions toolPropertyWindow torus toupper trace track trackCtx transferAttributes transformCompare transformLimits translator trim trunc truncateFluidCache truncateHairCache tumble tumbleCtx turbulence twoPointArcCtx uiRes uiTemplate unassignInputDevice undo undoInfo ungroup uniform unit unloadPlugin untangleUV untitledFileName untrim upAxis updateAE userCtx uvLink uvSnapshot validateShelfName vectorize view2dToolCtx viewCamera viewClipPlane viewFit viewHeadOn viewLookAt viewManip viewPlace viewSet visor volumeAxis vortex waitCursor warning webBrowser webBrowserPrefs whatIs window windowPref wire wireContext workspace wrinkle wrinkleContext writeTake xbmLangPathList xform",i:"</",c:[a.CNM,a.ASM,a.QSM,{cN:"string",b:"`",e:"`",c:[a.BE]},{cN:"variable",v:[{b:"\\$\\d"},{b:"[\\$\\%\\@](\\^\\w\\b|#\\w+|[^\\s\\w{]|{\\w+}|\\w+)"},{b:"\\*(\\^\\w\\b|#\\w+|[^\\s\\w{]|{\\w+}|\\w+)",r:0}]},a.CLCM,a.CBLCLM]}});hljs.registerLanguage("dos",function(a){return{cI:true,k:{flow:"if else goto for in do call exit not exist errorlevel defined equ neq lss leq gtr geq",keyword:"shift cd dir echo setlocal endlocal set pause copy",stream:"prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux",winutils:"ping net ipconfig taskkill xcopy ren del"},c:[{cN:"envvar",b:"%%[^ ]"},{cN:"envvar",b:"%[^ ]+?%"},{cN:"envvar",b:"![^ ]+?!"},{cN:"number",b:"\\b\\d+",r:0},{cN:"comment",b:"@?rem",e:"$"}]}});hljs.registerLanguage("java",function(b){var a="false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws";return{k:a,i:/<\//,c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",c:[{cN:"javadoctag",b:"(^|\\s)@[A-Za-z]+"}],r:10},b.CLCM,b.CBLCLM,b.ASM,b.QSM,{bK:"protected public private",e:/[{;=]/,k:a,c:[{cN:"class",bK:"class interface",eW:true,i:/[:"<>]/,c:[{bK:"extends implements",r:10},b.UTM]},{b:b.UIR+"\\s*\\(",rB:true,c:[b.UTM]}]},b.CNM,{cN:"annotation",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("tex",function(a){var d={cN:"command",b:"\\\\[a-zA-Zа-яА-я]+[\\*]?"};var c={cN:"command",b:"\\\\[^a-zA-Zа-яА-я0-9]"};var b={cN:"special",b:"[{}\\[\\]\\&#~]",r:0};return{c:[{b:"\\\\[a-zA-Zа-яА-я]+[\\*]? *= *-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?",rB:true,c:[d,c,{cN:"number",b:" *=",e:"-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?",eB:true}],r:10},d,c,b,{cN:"formula",b:"\\$\\$",e:"\\$\\$",c:[d,c,b],r:0},{cN:"formula",b:"\\$",e:"\\$",c:[d,c,b],r:0},{cN:"comment",b:"%",e:"$",r:0}]}});hljs.registerLanguage("glsl",function(a){return{k:{keyword:"atomic_uint attribute bool break bvec2 bvec3 bvec4 case centroid coherent const continue default discard dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 do double dvec2 dvec3 dvec4 else flat float for highp if iimage1D iimage1DArray iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray image2DRect image3D imageBuffer imageCube imageCubeArray in inout int invariant isampler1D isampler1DArray isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 layout lowp mat2 mat2x2 mat2x3 mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 mediump noperspective out patch precision readonly restrict return sample sampler1D sampler1DArray sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow smooth struct subroutine switch uimage1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect uimage3D uimageBuffer uimageCube uimageCubeArray uint uniform usampler1D usampler1DArray usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D usamplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 varying vec2 vec3 vec4 void volatile while writeonly",built_in:"gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial gl_FrontSecondaryColor gl_InstanceID gl_InvocationID gl_Layer gl_LightModel gl_LightSource gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms gl_MaxVertexOutputComponents gl_MaxVertexTextureImageUnits gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffsetgl_ModelViewMatrix gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_Normal gl_NormalMatrix gl_NormalScale gl_ObjectPlaneQ gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_PerVertex gl_Point gl_PointCoord gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter gl_TexCoord gl_TextureEnvColor gl_TextureMatrixInverseTranspose gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_in gl_out EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin asinh atan atanh atomicCounter atomicCounterDecrement atomicCounterIncrement barrier bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan greaterThanEqual imageAtomicAdd imageAtomicAnd imageAtomicCompSwap imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log log2 matrixCompMult max memoryBarrier min mix mod modf noise1 noise2 noise3 noise4 normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset textureProjLod textureProjLodOffset textureProjOffset textureQueryLod textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow gl_TextureMatrix gl_TextureMatrixInverse",literal:"true false"},i:'"',c:[a.CLCM,a.CBLCLM,a.CNM,{cN:"preprocessor",b:"#",e:"$"}]}});hljs.registerLanguage("brainfuck",function(b){var a={cN:"literal",b:"[\\+\\-]",r:0};return{c:[{cN:"comment",b:"[^\\[\\]\\.,\\+\\-<> \r\n]",rE:true,e:"[\\[\\]\\.,\\+\\-<> \r\n]",r:0},{cN:"title",b:"[\\[\\]]",r:0},{cN:"string",b:"[\\.,]",r:0},{b:/\+\+|\-\-/,rB:true,c:[a]},a]}});hljs.registerLanguage("mathematica",function(a){return{aliases:["mma"],l:"(\\$|\\b)"+a.IR+"\\b",k:"AbelianGroup Abort AbortKernels AbortProtect Above Abs Absolute AbsoluteCorrelation AbsoluteCorrelationFunction AbsoluteCurrentValue AbsoluteDashing AbsoluteFileName AbsoluteOptions AbsolutePointSize AbsoluteThickness AbsoluteTime AbsoluteTiming AccountingForm Accumulate Accuracy AccuracyGoal ActionDelay ActionMenu ActionMenuBox ActionMenuBoxOptions Active ActiveItem ActiveStyle AcyclicGraphQ AddOnHelpPath AddTo AdjacencyGraph AdjacencyList AdjacencyMatrix AdjustmentBox AdjustmentBoxOptions AdjustTimeSeriesForecast AffineTransform After AiryAi AiryAiPrime AiryAiZero AiryBi AiryBiPrime AiryBiZero AlgebraicIntegerQ AlgebraicNumber AlgebraicNumberDenominator AlgebraicNumberNorm AlgebraicNumberPolynomial AlgebraicNumberTrace AlgebraicRules AlgebraicRulesData Algebraics AlgebraicUnitQ Alignment AlignmentMarker AlignmentPoint All AllowedDimensions AllowGroupClose AllowInlineCells AllowKernelInitialization AllowReverseGroupClose AllowScriptLevelChange AlphaChannel AlternatingGroup AlternativeHypothesis Alternatives AmbientLight Analytic AnchoredSearch And AndersonDarlingTest AngerJ AngleBracket AngularGauge Animate AnimationCycleOffset AnimationCycleRepetitions AnimationDirection AnimationDisplayTime AnimationRate AnimationRepetitions AnimationRunning Animator AnimatorBox AnimatorBoxOptions AnimatorElements Annotation Annuity AnnuityDue Antialiasing Antisymmetric Apart ApartSquareFree Appearance AppearanceElements AppellF1 Append AppendTo Apply ArcCos ArcCosh ArcCot ArcCoth ArcCsc ArcCsch ArcSec ArcSech ArcSin ArcSinDistribution ArcSinh ArcTan ArcTanh Arg ArgMax ArgMin ArgumentCountQ ARIMAProcess ArithmeticGeometricMean ARMAProcess ARProcess Array ArrayComponents ArrayDepth ArrayFlatten ArrayPad ArrayPlot ArrayQ ArrayReshape ArrayRules Arrays Arrow Arrow3DBox ArrowBox Arrowheads AspectRatio AspectRatioFixed Assert Assuming Assumptions AstronomicalData Asynchronous AsynchronousTaskObject AsynchronousTasks AtomQ Attributes AugmentedSymmetricPolynomial AutoAction AutoDelete AutoEvaluateEvents AutoGeneratedPackage AutoIndent AutoIndentSpacings AutoItalicWords AutoloadPath AutoMatch Automatic AutomaticImageSize AutoMultiplicationSymbol AutoNumberFormatting AutoOpenNotebooks AutoOpenPalettes AutorunSequencing AutoScaling AutoScroll AutoSpacing AutoStyleOptions AutoStyleWords Axes AxesEdge AxesLabel AxesOrigin AxesStyle Axis BabyMonsterGroupB Back Background BackgroundTasksSettings Backslash Backsubstitution Backward Band BandpassFilter BandstopFilter BarabasiAlbertGraphDistribution BarChart BarChart3D BarLegend BarlowProschanImportance BarnesG BarOrigin BarSpacing BartlettHannWindow BartlettWindow BaseForm Baseline BaselinePosition BaseStyle BatesDistribution BattleLemarieWavelet Because BeckmannDistribution Beep Before Begin BeginDialogPacket BeginFrontEndInteractionPacket BeginPackage BellB BellY Below BenfordDistribution BeniniDistribution BenktanderGibratDistribution BenktanderWeibullDistribution BernoulliB BernoulliDistribution BernoulliGraphDistribution BernoulliProcess BernsteinBasis BesselFilterModel BesselI BesselJ BesselJZero BesselK BesselY BesselYZero Beta BetaBinomialDistribution BetaDistribution BetaNegativeBinomialDistribution BetaPrimeDistribution BetaRegularized BetweennessCentrality BezierCurve BezierCurve3DBox BezierCurve3DBoxOptions BezierCurveBox BezierCurveBoxOptions BezierFunction BilateralFilter Binarize BinaryFormat BinaryImageQ BinaryRead BinaryReadList BinaryWrite BinCounts BinLists Binomial BinomialDistribution BinomialProcess BinormalDistribution BiorthogonalSplineWavelet BipartiteGraphQ BirnbaumImportance BirnbaumSaundersDistribution BitAnd BitClear BitGet BitLength BitNot BitOr BitSet BitShiftLeft BitShiftRight BitXor Black BlackmanHarrisWindow BlackmanNuttallWindow BlackmanWindow Blank BlankForm BlankNullSequence BlankSequence Blend Block BlockRandom BlomqvistBeta BlomqvistBetaTest Blue Blur BodePlot BohmanWindow Bold Bookmarks Boole BooleanConsecutiveFunction BooleanConvert BooleanCountingFunction BooleanFunction BooleanGraph BooleanMaxterms BooleanMinimize BooleanMinterms Booleans BooleanTable BooleanVariables BorderDimensions BorelTannerDistribution Bottom BottomHatTransform BoundaryStyle Bounds Box BoxBaselineShift BoxData BoxDimensions Boxed Boxes BoxForm BoxFormFormatTypes BoxFrame BoxID BoxMargins BoxMatrix BoxRatios BoxRotation BoxRotationPoint BoxStyle BoxWhiskerChart Bra BracketingBar BraKet BrayCurtisDistance BreadthFirstScan Break Brown BrownForsytheTest BrownianBridgeProcess BrowserCategory BSplineBasis BSplineCurve BSplineCurve3DBox BSplineCurveBox BSplineCurveBoxOptions BSplineFunction BSplineSurface BSplineSurface3DBox BubbleChart BubbleChart3D BubbleScale BubbleSizes BulletGauge BusinessDayQ ButterflyGraph ButterworthFilterModel Button ButtonBar ButtonBox ButtonBoxOptions ButtonCell ButtonContents ButtonData ButtonEvaluator ButtonExpandable ButtonFrame ButtonFunction ButtonMargins ButtonMinHeight ButtonNote ButtonNotebook ButtonSource ButtonStyle ButtonStyleMenuListing Byte ByteCount ByteOrdering C CachedValue CacheGraphics CalendarData CalendarType CallPacket CanberraDistance Cancel CancelButton CandlestickChart Cap CapForm CapitalDifferentialD CardinalBSplineBasis CarmichaelLambda Cases Cashflow Casoratian Catalan CatalanNumber Catch CauchyDistribution CauchyWindow CayleyGraph CDF CDFDeploy CDFInformation CDFWavelet Ceiling Cell CellAutoOverwrite CellBaseline CellBoundingBox CellBracketOptions CellChangeTimes CellContents CellContext CellDingbat CellDynamicExpression CellEditDuplicate CellElementsBoundingBox CellElementSpacings CellEpilog CellEvaluationDuplicate CellEvaluationFunction CellEventActions CellFrame CellFrameColor CellFrameLabelMargins CellFrameLabels CellFrameMargins CellGroup CellGroupData CellGrouping CellGroupingRules CellHorizontalScrolling CellID CellLabel CellLabelAutoDelete CellLabelMargins CellLabelPositioning CellMargins CellObject CellOpen CellPrint CellProlog Cells CellSize CellStyle CellTags CellularAutomaton CensoredDistribution Censoring Center CenterDot CentralMoment CentralMomentGeneratingFunction CForm ChampernowneNumber ChanVeseBinarize Character CharacterEncoding CharacterEncodingsPath CharacteristicFunction CharacteristicPolynomial CharacterRange Characters ChartBaseStyle ChartElementData ChartElementDataFunction ChartElementFunction ChartElements ChartLabels ChartLayout ChartLegends ChartStyle Chebyshev1FilterModel Chebyshev2FilterModel ChebyshevDistance ChebyshevT ChebyshevU Check CheckAbort CheckAll Checkbox CheckboxBar CheckboxBox CheckboxBoxOptions ChemicalData ChessboardDistance ChiDistribution ChineseRemainder ChiSquareDistribution ChoiceButtons ChoiceDialog CholeskyDecomposition Chop Circle CircleBox CircleDot CircleMinus CirclePlus CircleTimes CirculantGraph CityData Clear ClearAll ClearAttributes ClearSystemCache ClebschGordan ClickPane Clip ClipboardNotebook ClipFill ClippingStyle ClipPlanes ClipRange Clock ClockGauge ClockwiseContourIntegral Close Closed CloseKernels ClosenessCentrality Closing ClosingAutoSave ClosingEvent ClusteringComponents CMYKColor Coarse Coefficient CoefficientArrays CoefficientDomain CoefficientList CoefficientRules CoifletWavelet Collect Colon ColonForm ColorCombine ColorConvert ColorData ColorDataFunction ColorFunction ColorFunctionScaling Colorize ColorNegate ColorOutput ColorProfileData ColorQuantize ColorReplace ColorRules ColorSelectorSettings ColorSeparate ColorSetter ColorSetterBox ColorSetterBoxOptions ColorSlider ColorSpace Column ColumnAlignments ColumnBackgrounds ColumnForm ColumnLines ColumnsEqual ColumnSpacings ColumnWidths CommonDefaultFormatTypes Commonest CommonestFilter CommonUnits CommunityBoundaryStyle CommunityGraphPlot CommunityLabels CommunityRegionStyle CompatibleUnitQ CompilationOptions CompilationTarget Compile Compiled CompiledFunction Complement CompleteGraph CompleteGraphQ CompleteKaryTree CompletionsListPacket Complex Complexes ComplexExpand ComplexInfinity ComplexityFunction ComponentMeasurements ComponentwiseContextMenu Compose ComposeList ComposeSeries Composition CompoundExpression CompoundPoissonDistribution CompoundPoissonProcess CompoundRenewalProcess Compress CompressedData Condition ConditionalExpression Conditioned Cone ConeBox ConfidenceLevel ConfidenceRange ConfidenceTransform ConfigurationPath Congruent Conjugate ConjugateTranspose Conjunction Connect ConnectedComponents ConnectedGraphQ ConnesWindow ConoverTest ConsoleMessage ConsoleMessagePacket ConsolePrint Constant ConstantArray Constants ConstrainedMax ConstrainedMin ContentPadding ContentsBoundingBox ContentSelectable ContentSize Context ContextMenu Contexts ContextToFilename ContextToFileName Continuation Continue ContinuedFraction ContinuedFractionK ContinuousAction ContinuousMarkovProcess ContinuousTimeModelQ ContinuousWaveletData ContinuousWaveletTransform ContourDetect ContourGraphics ContourIntegral ContourLabels ContourLines ContourPlot ContourPlot3D Contours ContourShading ContourSmoothing ContourStyle ContraharmonicMean Control ControlActive ControlAlignment ControllabilityGramian ControllabilityMatrix ControllableDecomposition ControllableModelQ ControllerDuration ControllerInformation ControllerInformationData ControllerLinking ControllerManipulate ControllerMethod ControllerPath ControllerState ControlPlacement ControlsRendering ControlType Convergents ConversionOptions ConversionRules ConvertToBitmapPacket ConvertToPostScript ConvertToPostScriptPacket Convolve ConwayGroupCo1 ConwayGroupCo2 ConwayGroupCo3 CoordinateChartData CoordinatesToolOptions CoordinateTransform CoordinateTransformData CoprimeQ Coproduct CopulaDistribution Copyable CopyDirectory CopyFile CopyTag CopyToClipboard CornerFilter CornerNeighbors Correlation CorrelationDistance CorrelationFunction CorrelationTest Cos Cosh CoshIntegral CosineDistance CosineWindow CosIntegral Cot Coth Count CounterAssignments CounterBox CounterBoxOptions CounterClockwiseContourIntegral CounterEvaluator CounterFunction CounterIncrements CounterStyle CounterStyleMenuListing CountRoots CountryData Covariance CovarianceEstimatorFunction CovarianceFunction CoxianDistribution CoxIngersollRossProcess CoxModel CoxModelFit CramerVonMisesTest CreateArchive CreateDialog CreateDirectory CreateDocument CreateIntermediateDirectories CreatePalette CreatePalettePacket CreateScheduledTask CreateTemporary CreateWindow CriticalityFailureImportance CriticalitySuccessImportance CriticalSection Cross CrossingDetect CrossMatrix Csc Csch CubeRoot Cubics Cuboid CuboidBox Cumulant CumulantGeneratingFunction Cup CupCap Curl CurlyDoubleQuote CurlyQuote CurrentImage CurrentlySpeakingPacket CurrentValue CurvatureFlowFilter CurveClosed Cyan CycleGraph CycleIndexPolynomial Cycles CyclicGroup Cyclotomic Cylinder CylinderBox CylindricalDecomposition D DagumDistribution DamerauLevenshteinDistance DampingFactor Darker Dashed Dashing DataCompression DataDistribution DataRange DataReversed Date DateDelimiters DateDifference DateFunction DateList DateListLogPlot DateListPlot DatePattern DatePlus DateRange DateString DateTicksFormat DaubechiesWavelet DavisDistribution DawsonF DayCount DayCountConvention DayMatchQ DayName DayPlus DayRange DayRound DeBruijnGraph Debug DebugTag Decimal DeclareKnownSymbols DeclarePackage Decompose Decrement DedekindEta Default DefaultAxesStyle DefaultBaseStyle DefaultBoxStyle DefaultButton DefaultColor DefaultControlPlacement DefaultDuplicateCellStyle DefaultDuration DefaultElement DefaultFaceGridsStyle DefaultFieldHintStyle DefaultFont DefaultFontProperties DefaultFormatType DefaultFormatTypeForStyle DefaultFrameStyle DefaultFrameTicksStyle DefaultGridLinesStyle DefaultInlineFormatType DefaultInputFormatType DefaultLabelStyle DefaultMenuStyle DefaultNaturalLanguage DefaultNewCellStyle DefaultNewInlineCellStyle DefaultNotebook DefaultOptions DefaultOutputFormatType DefaultStyle DefaultStyleDefinitions DefaultTextFormatType DefaultTextInlineFormatType DefaultTicksStyle DefaultTooltipStyle DefaultValues Defer DefineExternal DefineInputStreamMethod DefineOutputStreamMethod Definition Degree DegreeCentrality DegreeGraphDistribution DegreeLexicographic DegreeReverseLexicographic Deinitialization Del Deletable Delete DeleteBorderComponents DeleteCases DeleteContents DeleteDirectory DeleteDuplicates DeleteFile DeleteSmallComponents DeleteWithContents DeletionWarning Delimiter DelimiterFlashTime DelimiterMatching Delimiters Denominator DensityGraphics DensityHistogram DensityPlot DependentVariables Deploy Deployed Depth DepthFirstScan Derivative DerivativeFilter DescriptorStateSpace DesignMatrix Det DGaussianWavelet DiacriticalPositioning Diagonal DiagonalMatrix Dialog DialogIndent DialogInput DialogLevel DialogNotebook DialogProlog DialogReturn DialogSymbols Diamond DiamondMatrix DiceDissimilarity DictionaryLookup DifferenceDelta DifferenceOrder DifferenceRoot DifferenceRootReduce Differences DifferentialD DifferentialRoot DifferentialRootReduce DifferentiatorFilter DigitBlock DigitBlockMinimum DigitCharacter DigitCount DigitQ DihedralGroup Dilation Dimensions DiracComb DiracDelta DirectedEdge DirectedEdges DirectedGraph DirectedGraphQ DirectedInfinity Direction Directive Directory DirectoryName DirectoryQ DirectoryStack DirichletCharacter DirichletConvolve DirichletDistribution DirichletL DirichletTransform DirichletWindow DisableConsolePrintPacket DiscreteChirpZTransform DiscreteConvolve DiscreteDelta DiscreteHadamardTransform DiscreteIndicator DiscreteLQEstimatorGains DiscreteLQRegulatorGains DiscreteLyapunovSolve DiscreteMarkovProcess DiscretePlot DiscretePlot3D DiscreteRatio DiscreteRiccatiSolve DiscreteShift DiscreteTimeModelQ DiscreteUniformDistribution DiscreteVariables DiscreteWaveletData DiscreteWaveletPacketTransform DiscreteWaveletTransform Discriminant Disjunction Disk DiskBox DiskMatrix Dispatch DispersionEstimatorFunction Display DisplayAllSteps DisplayEndPacket DisplayFlushImagePacket DisplayForm DisplayFunction DisplayPacket DisplayRules DisplaySetSizePacket DisplayString DisplayTemporary DisplayWith DisplayWithRef DisplayWithVariable DistanceFunction DistanceTransform Distribute Distributed DistributedContexts DistributeDefinitions DistributionChart DistributionDomain DistributionFitTest DistributionParameterAssumptions DistributionParameterQ Dithering Div Divergence Divide DivideBy Dividers Divisible Divisors DivisorSigma DivisorSum DMSList DMSString Do DockedCells DocumentNotebook DominantColors DOSTextFormat Dot DotDashed DotEqual Dotted DoubleBracketingBar DoubleContourIntegral DoubleDownArrow DoubleLeftArrow DoubleLeftRightArrow DoubleLeftTee DoubleLongLeftArrow DoubleLongLeftRightArrow DoubleLongRightArrow DoubleRightArrow DoubleRightTee DoubleUpArrow DoubleUpDownArrow DoubleVerticalBar DoublyInfinite Down DownArrow DownArrowBar DownArrowUpArrow DownLeftRightVector DownLeftTeeVector DownLeftVector DownLeftVectorBar DownRightTeeVector DownRightVector DownRightVectorBar Downsample DownTee DownTeeArrow DownValues DragAndDrop DrawEdges DrawFrontFaces DrawHighlighted Drop DSolve Dt DualLinearProgramming DualSystemsModel DumpGet DumpSave DuplicateFreeQ Dynamic DynamicBox DynamicBoxOptions DynamicEvaluationTimeout DynamicLocation DynamicModule DynamicModuleBox DynamicModuleBoxOptions DynamicModuleParent DynamicModuleValues DynamicName DynamicNamespace DynamicReference DynamicSetting DynamicUpdating DynamicWrapper DynamicWrapperBox DynamicWrapperBoxOptions E EccentricityCentrality EdgeAdd EdgeBetweennessCentrality EdgeCapacity EdgeCapForm EdgeColor EdgeConnectivity EdgeCost EdgeCount EdgeCoverQ EdgeDashing EdgeDelete EdgeDetect EdgeForm EdgeIndex EdgeJoinForm EdgeLabeling EdgeLabels EdgeLabelStyle EdgeList EdgeOpacity EdgeQ EdgeRenderingFunction EdgeRules EdgeShapeFunction EdgeStyle EdgeThickness EdgeWeight Editable EditButtonSettings EditCellTagsSettings EditDistance EffectiveInterest Eigensystem Eigenvalues EigenvectorCentrality Eigenvectors Element ElementData Eliminate EliminationOrder EllipticE EllipticExp EllipticExpPrime EllipticF EllipticFilterModel EllipticK EllipticLog EllipticNomeQ EllipticPi EllipticReducedHalfPeriods EllipticTheta EllipticThetaPrime EmitSound EmphasizeSyntaxErrors EmpiricalDistribution Empty EmptyGraphQ EnableConsolePrintPacket Enabled Encode End EndAdd EndDialogPacket EndFrontEndInteractionPacket EndOfFile EndOfLine EndOfString EndPackage EngineeringForm Enter EnterExpressionPacket EnterTextPacket Entropy EntropyFilter Environment Epilog Equal EqualColumns EqualRows EqualTilde EquatedTo Equilibrium EquirippleFilterKernel Equivalent Erf Erfc Erfi ErlangB ErlangC ErlangDistribution Erosion ErrorBox ErrorBoxOptions ErrorNorm ErrorPacket ErrorsDialogSettings EstimatedDistribution EstimatedProcess EstimatorGains EstimatorRegulator EuclideanDistance EulerE EulerGamma EulerianGraphQ EulerPhi Evaluatable Evaluate Evaluated EvaluatePacket EvaluationCell EvaluationCompletionAction EvaluationElements EvaluationMode EvaluationMonitor EvaluationNotebook EvaluationObject EvaluationOrder Evaluator EvaluatorNames EvenQ EventData EventEvaluator EventHandler EventHandlerTag EventLabels ExactBlackmanWindow ExactNumberQ ExactRootIsolation ExampleData Except ExcludedForms ExcludePods Exclusions ExclusionsStyle Exists Exit ExitDialog Exp Expand ExpandAll ExpandDenominator ExpandFileName ExpandNumerator Expectation ExpectationE ExpectedValue ExpGammaDistribution ExpIntegralE ExpIntegralEi Exponent ExponentFunction ExponentialDistribution ExponentialFamily ExponentialGeneratingFunction ExponentialMovingAverage ExponentialPowerDistribution ExponentPosition ExponentStep Export ExportAutoReplacements ExportPacket ExportString Expression ExpressionCell ExpressionPacket ExpToTrig ExtendedGCD Extension ExtentElementFunction ExtentMarkers ExtentSize ExternalCall ExternalDataCharacterEncoding Extract ExtractArchive ExtremeValueDistribution FaceForm FaceGrids FaceGridsStyle Factor FactorComplete Factorial Factorial2 FactorialMoment FactorialMomentGeneratingFunction FactorialPower FactorInteger FactorList FactorSquareFree FactorSquareFreeList FactorTerms FactorTermsList Fail FailureDistribution False FARIMAProcess FEDisableConsolePrintPacket FeedbackSector FeedbackSectorStyle FeedbackType FEEnableConsolePrintPacket Fibonacci FieldHint FieldHintStyle FieldMasked FieldSize File FileBaseName FileByteCount FileDate FileExistsQ FileExtension FileFormat FileHash FileInformation FileName FileNameDepth FileNameDialogSettings FileNameDrop FileNameJoin FileNames FileNameSetter FileNameSplit FileNameTake FilePrint FileType FilledCurve FilledCurveBox Filling FillingStyle FillingTransform FilterRules FinancialBond FinancialData FinancialDerivative FinancialIndicator Find FindArgMax FindArgMin FindClique FindClusters FindCurvePath FindDistributionParameters FindDivisions FindEdgeCover FindEdgeCut FindEulerianCycle FindFaces FindFile FindFit FindGeneratingFunction FindGeoLocation FindGeometricTransform FindGraphCommunities FindGraphIsomorphism FindGraphPartition FindHamiltonianCycle FindIndependentEdgeSet FindIndependentVertexSet FindInstance FindIntegerNullVector FindKClan FindKClique FindKClub FindKPlex FindLibrary FindLinearRecurrence FindList FindMaximum FindMaximumFlow FindMaxValue FindMinimum FindMinimumCostFlow FindMinimumCut FindMinValue FindPermutation FindPostmanTour FindProcessParameters FindRoot FindSequenceFunction FindSettings FindShortestPath FindShortestTour FindThreshold FindVertexCover FindVertexCut Fine FinishDynamic FiniteAbelianGroupCount FiniteGroupCount FiniteGroupData First FirstPassageTimeDistribution FischerGroupFi22 FischerGroupFi23 FischerGroupFi24Prime FisherHypergeometricDistribution FisherRatioTest FisherZDistribution Fit FitAll FittedModel FixedPoint FixedPointList FlashSelection Flat Flatten FlattenAt FlatTopWindow FlipView Floor FlushPrintOutputPacket Fold FoldList Font FontColor FontFamily FontForm FontName FontOpacity FontPostScriptName FontProperties FontReencoding FontSize FontSlant FontSubstitutions FontTracking FontVariations FontWeight For ForAll Format FormatRules FormatType FormatTypeAutoConvert FormatValues FormBox FormBoxOptions FortranForm Forward ForwardBackward Fourier FourierCoefficient FourierCosCoefficient FourierCosSeries FourierCosTransform FourierDCT FourierDCTFilter FourierDCTMatrix FourierDST FourierDSTMatrix FourierMatrix FourierParameters FourierSequenceTransform FourierSeries FourierSinCoefficient FourierSinSeries FourierSinTransform FourierTransform FourierTrigSeries FractionalBrownianMotionProcess FractionalPart FractionBox FractionBoxOptions FractionLine Frame FrameBox FrameBoxOptions Framed FrameInset FrameLabel Frameless FrameMargins FrameStyle FrameTicks FrameTicksStyle FRatioDistribution FrechetDistribution FreeQ FrequencySamplingFilterKernel FresnelC FresnelS Friday FrobeniusNumber FrobeniusSolve FromCharacterCode FromCoefficientRules FromContinuedFraction FromDate FromDigits FromDMS Front FrontEndDynamicExpression FrontEndEventActions FrontEndExecute FrontEndObject FrontEndResource FrontEndResourceString FrontEndStackSize FrontEndToken FrontEndTokenExecute FrontEndValueCache FrontEndVersion FrontFaceColor FrontFaceOpacity Full FullAxes FullDefinition FullForm FullGraphics FullOptions FullSimplify Function FunctionExpand FunctionInterpolation FunctionSpace FussellVeselyImportance GaborFilter GaborMatrix GaborWavelet GainMargins GainPhaseMargins Gamma GammaDistribution GammaRegularized GapPenalty Gather GatherBy GaugeFaceElementFunction GaugeFaceStyle GaugeFrameElementFunction GaugeFrameSize GaugeFrameStyle GaugeLabels GaugeMarkers GaugeStyle GaussianFilter GaussianIntegers GaussianMatrix GaussianWindow GCD GegenbauerC General GeneralizedLinearModelFit GenerateConditions GeneratedCell GeneratedParameters GeneratingFunction Generic GenericCylindricalDecomposition GenomeData GenomeLookup GeodesicClosing GeodesicDilation GeodesicErosion GeodesicOpening GeoDestination GeodesyData GeoDirection GeoDistance GeoGridPosition GeometricBrownianMotionProcess GeometricDistribution GeometricMean GeometricMeanFilter GeometricTransformation GeometricTransformation3DBox GeometricTransformation3DBoxOptions GeometricTransformationBox GeometricTransformationBoxOptions GeoPosition GeoPositionENU GeoPositionXYZ GeoProjectionData GestureHandler GestureHandlerTag Get GetBoundingBoxSizePacket GetContext GetEnvironment GetFileName GetFrontEndOptionsDataPacket GetLinebreakInformationPacket GetMenusPacket GetPageBreakInformationPacket Glaisher GlobalClusteringCoefficient GlobalPreferences GlobalSession Glow GoldenRatio GompertzMakehamDistribution GoodmanKruskalGamma GoodmanKruskalGammaTest Goto Grad Gradient GradientFilter GradientOrientationFilter Graph GraphAssortativity GraphCenter GraphComplement GraphData GraphDensity GraphDiameter GraphDifference GraphDisjointUnion GraphDistance GraphDistanceMatrix GraphElementData GraphEmbedding GraphHighlight GraphHighlightStyle GraphHub Graphics Graphics3D Graphics3DBox Graphics3DBoxOptions GraphicsArray GraphicsBaseline GraphicsBox GraphicsBoxOptions GraphicsColor GraphicsColumn GraphicsComplex GraphicsComplex3DBox GraphicsComplex3DBoxOptions GraphicsComplexBox GraphicsComplexBoxOptions GraphicsContents GraphicsData GraphicsGrid GraphicsGridBox GraphicsGroup GraphicsGroup3DBox GraphicsGroup3DBoxOptions GraphicsGroupBox GraphicsGroupBoxOptions GraphicsGrouping GraphicsHighlightColor GraphicsRow GraphicsSpacing GraphicsStyle GraphIntersection GraphLayout GraphLinkEfficiency GraphPeriphery GraphPlot GraphPlot3D GraphPower GraphPropertyDistribution GraphQ GraphRadius GraphReciprocity GraphRoot GraphStyle GraphUnion Gray GrayLevel GreatCircleDistance Greater GreaterEqual GreaterEqualLess GreaterFullEqual GreaterGreater GreaterLess GreaterSlantEqual GreaterTilde Green Grid GridBaseline GridBox GridBoxAlignment GridBoxBackground GridBoxDividers GridBoxFrame GridBoxItemSize GridBoxItemStyle GridBoxOptions GridBoxSpacings GridCreationSettings GridDefaultElement GridElementStyleOptions GridFrame GridFrameMargins GridGraph GridLines GridLinesStyle GroebnerBasis GroupActionBase GroupCentralizer GroupElementFromWord GroupElementPosition GroupElementQ GroupElements GroupElementToWord GroupGenerators GroupMultiplicationTable GroupOrbits GroupOrder GroupPageBreakWithin GroupSetwiseStabilizer GroupStabilizer GroupStabilizerChain Gudermannian GumbelDistribution HaarWavelet HadamardMatrix HalfNormalDistribution HamiltonianGraphQ HammingDistance HammingWindow HankelH1 HankelH2 HankelMatrix HannPoissonWindow HannWindow HaradaNortonGroupHN HararyGraph HarmonicMean HarmonicMeanFilter HarmonicNumber Hash HashTable Haversine HazardFunction Head HeadCompose Heads HeavisideLambda HeavisidePi HeavisideTheta HeldGroupHe HeldPart HelpBrowserLookup HelpBrowserNotebook HelpBrowserSettings HermiteDecomposition HermiteH HermitianMatrixQ HessenbergDecomposition Hessian HexadecimalCharacter Hexahedron HexahedronBox HexahedronBoxOptions HiddenSurface HighlightGraph HighlightImage HighpassFilter HigmanSimsGroupHS HilbertFilter HilbertMatrix Histogram Histogram3D HistogramDistribution HistogramList HistogramTransform HistogramTransformInterpolation HitMissTransform HITSCentrality HodgeDual HoeffdingD HoeffdingDTest Hold HoldAll HoldAllComplete HoldComplete HoldFirst HoldForm HoldPattern HoldRest HolidayCalendar HomeDirectory HomePage Horizontal HorizontalForm HorizontalGauge HorizontalScrollPosition HornerForm HotellingTSquareDistribution HoytDistribution HTMLSave Hue HumpDownHump HumpEqual HurwitzLerchPhi HurwitzZeta HyperbolicDistribution HypercubeGraph HyperexponentialDistribution Hyperfactorial Hypergeometric0F1 Hypergeometric0F1Regularized Hypergeometric1F1 Hypergeometric1F1Regularized Hypergeometric2F1 Hypergeometric2F1Regularized HypergeometricDistribution HypergeometricPFQ HypergeometricPFQRegularized HypergeometricU Hyperlink HyperlinkCreationSettings Hyphenation HyphenationOptions HypoexponentialDistribution HypothesisTestData I Identity IdentityMatrix If IgnoreCase Im Image Image3D Image3DSlices ImageAccumulate ImageAdd ImageAdjust ImageAlign ImageApply ImageAspectRatio ImageAssemble ImageCache ImageCacheValid ImageCapture ImageChannels ImageClip ImageColorSpace ImageCompose ImageConvolve ImageCooccurrence ImageCorners ImageCorrelate ImageCorrespondingPoints ImageCrop ImageData ImageDataPacket ImageDeconvolve ImageDemosaic ImageDifference ImageDimensions ImageDistance ImageEffect ImageFeatureTrack ImageFileApply ImageFileFilter ImageFileScan ImageFilter ImageForestingComponents ImageForwardTransformation ImageHistogram ImageKeypoints ImageLevels ImageLines ImageMargins ImageMarkers ImageMeasurements ImageMultiply ImageOffset ImagePad ImagePadding ImagePartition ImagePeriodogram ImagePerspectiveTransformation ImageQ ImageRangeCache ImageReflect ImageRegion ImageResize ImageResolution ImageRotate ImageRotated ImageScaled ImageScan ImageSize ImageSizeAction ImageSizeCache ImageSizeMultipliers ImageSizeRaw ImageSubtract ImageTake ImageTransformation ImageTrim ImageType ImageValue ImageValuePositions Implies Import ImportAutoReplacements ImportString ImprovementImportance In IncidenceGraph IncidenceList IncidenceMatrix IncludeConstantBasis IncludeFileExtension IncludePods IncludeSingularTerm Increment Indent IndentingNewlineSpacings IndentMaxFraction IndependenceTest IndependentEdgeSetQ IndependentUnit IndependentVertexSetQ Indeterminate IndexCreationOptions Indexed IndexGraph IndexTag Inequality InexactNumberQ InexactNumbers Infinity Infix Information Inherited InheritScope Initialization InitializationCell InitializationCellEvaluation InitializationCellWarning InlineCounterAssignments InlineCounterIncrements InlineRules Inner Inpaint Input InputAliases InputAssumptions InputAutoReplacements InputField InputFieldBox InputFieldBoxOptions InputForm InputGrouping InputNamePacket InputNotebook InputPacket InputSettings InputStream InputString InputStringPacket InputToBoxFormPacket Insert InsertionPointObject InsertResults Inset Inset3DBox Inset3DBoxOptions InsetBox InsetBoxOptions Install InstallService InString Integer IntegerDigits IntegerExponent IntegerLength IntegerPart IntegerPartitions IntegerQ Integers IntegerString Integral Integrate Interactive InteractiveTradingChart Interlaced Interleaving InternallyBalancedDecomposition InterpolatingFunction InterpolatingPolynomial Interpolation InterpolationOrder InterpolationPoints InterpolationPrecision Interpretation InterpretationBox InterpretationBoxOptions InterpretationFunction InterpretTemplate InterquartileRange Interrupt InterruptSettings Intersection Interval IntervalIntersection IntervalMemberQ IntervalUnion Inverse InverseBetaRegularized InverseCDF InverseChiSquareDistribution InverseContinuousWaveletTransform InverseDistanceTransform InverseEllipticNomeQ InverseErf InverseErfc InverseFourier InverseFourierCosTransform InverseFourierSequenceTransform InverseFourierSinTransform InverseFourierTransform InverseFunction InverseFunctions InverseGammaDistribution InverseGammaRegularized InverseGaussianDistribution InverseGudermannian InverseHaversine InverseJacobiCD InverseJacobiCN InverseJacobiCS InverseJacobiDC InverseJacobiDN InverseJacobiDS InverseJacobiNC InverseJacobiND InverseJacobiNS InverseJacobiSC InverseJacobiSD InverseJacobiSN InverseLaplaceTransform InversePermutation InverseRadon InverseSeries InverseSurvivalFunction InverseWaveletTransform InverseWeierstrassP InverseZTransform Invisible InvisibleApplication InvisibleTimes IrreduciblePolynomialQ IsolatingInterval IsomorphicGraphQ IsotopeData Italic Item ItemBox ItemBoxOptions ItemSize ItemStyle ItoProcess JaccardDissimilarity JacobiAmplitude Jacobian JacobiCD JacobiCN JacobiCS JacobiDC JacobiDN JacobiDS JacobiNC JacobiND JacobiNS JacobiP JacobiSC JacobiSD JacobiSN JacobiSymbol JacobiZeta JankoGroupJ1 JankoGroupJ2 JankoGroupJ3 JankoGroupJ4 JarqueBeraALMTest JohnsonDistribution Join Joined JoinedCurve JoinedCurveBox JoinForm JordanDecomposition JordanModelDecomposition K KagiChart KaiserBesselWindow KaiserWindow KalmanEstimator KalmanFilter KarhunenLoeveDecomposition KaryTree KatzCentrality KCoreComponents KDistribution KelvinBei KelvinBer KelvinKei KelvinKer KendallTau KendallTauTest KernelExecute KernelMixtureDistribution KernelObject Kernels Ket Khinchin KirchhoffGraph KirchhoffMatrix KleinInvariantJ KnightTourGraph KnotData KnownUnitQ KolmogorovSmirnovTest KroneckerDelta KroneckerModelDecomposition KroneckerProduct KroneckerSymbol KuiperTest KumaraswamyDistribution Kurtosis KuwaharaFilter Label Labeled LabeledSlider LabelingFunction LabelStyle LaguerreL LambdaComponents LambertW LanczosWindow LandauDistribution Language LanguageCategory LaplaceDistribution LaplaceTransform Laplacian LaplacianFilter LaplacianGaussianFilter Large Larger Last Latitude LatitudeLongitude LatticeData LatticeReduce Launch LaunchKernels LayeredGraphPlot LayerSizeFunction LayoutInformation LCM LeafCount LeapYearQ LeastSquares LeastSquaresFilterKernel Left LeftArrow LeftArrowBar LeftArrowRightArrow LeftDownTeeVector LeftDownVector LeftDownVectorBar LeftRightArrow LeftRightVector LeftTee LeftTeeArrow LeftTeeVector LeftTriangle LeftTriangleBar LeftTriangleEqual LeftUpDownVector LeftUpTeeVector LeftUpVector LeftUpVectorBar LeftVector LeftVectorBar LegendAppearance Legended LegendFunction LegendLabel LegendLayout LegendMargins LegendMarkers LegendMarkerSize LegendreP LegendreQ LegendreType Length LengthWhile LerchPhi Less LessEqual LessEqualGreater LessFullEqual LessGreater LessLess LessSlantEqual LessTilde LetterCharacter LetterQ Level LeveneTest LeviCivitaTensor LevyDistribution Lexicographic LibraryFunction LibraryFunctionError LibraryFunctionInformation LibraryFunctionLoad LibraryFunctionUnload LibraryLoad LibraryUnload LicenseID LiftingFilterData LiftingWaveletTransform LightBlue LightBrown LightCyan Lighter LightGray LightGreen Lighting LightingAngle LightMagenta LightOrange LightPink LightPurple LightRed LightSources LightYellow Likelihood Limit LimitsPositioning LimitsPositioningTokens LindleyDistribution Line Line3DBox LinearFilter LinearFractionalTransform LinearModelFit LinearOffsetFunction LinearProgramming LinearRecurrence LinearSolve LinearSolveFunction LineBox LineBreak LinebreakAdjustments LineBreakChart LineBreakWithin LineColor LineForm LineGraph LineIndent LineIndentMaxFraction LineIntegralConvolutionPlot LineIntegralConvolutionScale LineLegend LineOpacity LineSpacing LineWrapParts LinkActivate LinkClose LinkConnect LinkConnectedQ LinkCreate LinkError LinkFlush LinkFunction LinkHost LinkInterrupt LinkLaunch LinkMode LinkObject LinkOpen LinkOptions LinkPatterns LinkProtocol LinkRead LinkReadHeld LinkReadyQ Links LinkWrite LinkWriteHeld LiouvilleLambda List Listable ListAnimate ListContourPlot ListContourPlot3D ListConvolve ListCorrelate ListCurvePathPlot ListDeconvolve ListDensityPlot Listen ListFourierSequenceTransform ListInterpolation ListLineIntegralConvolutionPlot ListLinePlot ListLogLinearPlot ListLogLogPlot ListLogPlot ListPicker ListPickerBox ListPickerBoxBackground ListPickerBoxOptions ListPlay ListPlot ListPlot3D ListPointPlot3D ListPolarPlot ListQ ListStreamDensityPlot ListStreamPlot ListSurfacePlot3D ListVectorDensityPlot ListVectorPlot ListVectorPlot3D ListZTransform Literal LiteralSearch LocalClusteringCoefficient LocalizeVariables LocationEquivalenceTest LocationTest Locator LocatorAutoCreate LocatorBox LocatorBoxOptions LocatorCentering LocatorPane LocatorPaneBox LocatorPaneBoxOptions LocatorRegion Locked Log Log10 Log2 LogBarnesG LogGamma LogGammaDistribution LogicalExpand LogIntegral LogisticDistribution LogitModelFit LogLikelihood LogLinearPlot LogLogisticDistribution LogLogPlot LogMultinormalDistribution LogNormalDistribution LogPlot LogRankTest LogSeriesDistribution LongEqual Longest LongestAscendingSequence LongestCommonSequence LongestCommonSequencePositions LongestCommonSubsequence LongestCommonSubsequencePositions LongestMatch LongForm Longitude LongLeftArrow LongLeftRightArrow LongRightArrow Loopback LoopFreeGraphQ LowerCaseQ LowerLeftArrow LowerRightArrow LowerTriangularize LowpassFilter LQEstimatorGains LQGRegulator LQOutputRegulatorGains LQRegulatorGains LUBackSubstitution LucasL LuccioSamiComponents LUDecomposition LyapunovSolve LyonsGroupLy MachineID MachineName MachineNumberQ MachinePrecision MacintoshSystemPageSetup Magenta Magnification Magnify MainSolve MaintainDynamicCaches Majority MakeBoxes MakeExpression MakeRules MangoldtLambda ManhattanDistance Manipulate Manipulator MannWhitneyTest MantissaExponent Manual Map MapAll MapAt MapIndexed MAProcess MapThread MarcumQ MardiaCombinedTest MardiaKurtosisTest MardiaSkewnessTest MarginalDistribution MarkovProcessProperties Masking MatchingDissimilarity MatchLocalNameQ MatchLocalNames MatchQ Material MathematicaNotation MathieuC MathieuCharacteristicA MathieuCharacteristicB MathieuCharacteristicExponent MathieuCPrime MathieuGroupM11 MathieuGroupM12 MathieuGroupM22 MathieuGroupM23 MathieuGroupM24 MathieuS MathieuSPrime MathMLForm MathMLText Matrices MatrixExp MatrixForm MatrixFunction MatrixLog MatrixPlot MatrixPower MatrixQ MatrixRank Max MaxBend MaxDetect MaxExtraBandwidths MaxExtraConditions MaxFeatures MaxFilter Maximize MaxIterations MaxMemoryUsed MaxMixtureKernels MaxPlotPoints MaxPoints MaxRecursion MaxStableDistribution MaxStepFraction MaxSteps MaxStepSize MaxValue MaxwellDistribution McLaughlinGroupMcL Mean MeanClusteringCoefficient MeanDegreeConnectivity MeanDeviation MeanFilter MeanGraphDistance MeanNeighborDegree MeanShift MeanShiftFilter Median MedianDeviation MedianFilter Medium MeijerG MeixnerDistribution MemberQ MemoryConstrained MemoryInUse Menu MenuAppearance MenuCommandKey MenuEvaluator MenuItem MenuPacket MenuSortingValue MenuStyle MenuView MergeDifferences Mesh MeshFunctions MeshRange MeshShading MeshStyle Message MessageDialog MessageList MessageName MessageOptions MessagePacket Messages MessagesNotebook MetaCharacters MetaInformation Method MethodOptions MexicanHatWavelet MeyerWavelet Min MinDetect MinFilter MinimalPolynomial MinimalStateSpaceModel Minimize Minors MinRecursion MinSize MinStableDistribution Minus MinusPlus MinValue Missing MissingDataMethod MittagLefflerE MixedRadix MixedRadixQuantity MixtureDistribution Mod Modal Mode Modular ModularLambda Module Modulus MoebiusMu Moment Momentary MomentConvert MomentEvaluate MomentGeneratingFunction Monday Monitor MonomialList MonomialOrder MonsterGroupM MorletWavelet MorphologicalBinarize MorphologicalBranchPoints MorphologicalComponents MorphologicalEulerNumber MorphologicalGraph MorphologicalPerimeter MorphologicalTransform Most MouseAnnotation MouseAppearance MouseAppearanceTag MouseButtons Mouseover MousePointerNote MousePosition MovingAverage MovingMedian MoyalDistribution MultiedgeStyle MultilaunchWarning MultiLetterItalics MultiLetterStyle MultilineFunction Multinomial MultinomialDistribution MultinormalDistribution MultiplicativeOrder Multiplicity Multiselection MultivariateHypergeometricDistribution MultivariatePoissonDistribution MultivariateTDistribution N NakagamiDistribution NameQ Names NamespaceBox Nand NArgMax NArgMin NBernoulliB NCache NDSolve NDSolveValue Nearest NearestFunction NeedCurrentFrontEndPackagePacket NeedCurrentFrontEndSymbolsPacket NeedlemanWunschSimilarity Needs Negative NegativeBinomialDistribution NegativeMultinomialDistribution NeighborhoodGraph Nest NestedGreaterGreater NestedLessLess NestedScriptRules NestList NestWhile NestWhileList NevilleThetaC NevilleThetaD NevilleThetaN NevilleThetaS NewPrimitiveStyle NExpectation Next NextPrime NHoldAll NHoldFirst NHoldRest NicholsGridLines NicholsPlot NIntegrate NMaximize NMaxValue NMinimize NMinValue NominalVariables NonAssociative NoncentralBetaDistribution NoncentralChiSquareDistribution NoncentralFRatioDistribution NoncentralStudentTDistribution NonCommutativeMultiply NonConstants None NonlinearModelFit NonlocalMeansFilter NonNegative NonPositive Nor NorlundB Norm Normal NormalDistribution NormalGrouping Normalize NormalizedSquaredEuclideanDistance NormalsFunction NormFunction Not NotCongruent NotCupCap NotDoubleVerticalBar Notebook NotebookApply NotebookAutoSave NotebookClose NotebookConvertSettings NotebookCreate NotebookCreateReturnObject NotebookDefault NotebookDelete NotebookDirectory NotebookDynamicExpression NotebookEvaluate NotebookEventActions NotebookFileName NotebookFind NotebookFindReturnObject NotebookGet NotebookGetLayoutInformationPacket NotebookGetMisspellingsPacket NotebookInformation NotebookInterfaceObject NotebookLocate NotebookObject NotebookOpen NotebookOpenReturnObject NotebookPath NotebookPrint NotebookPut NotebookPutReturnObject NotebookRead NotebookResetGeneratedCells Notebooks NotebookSave NotebookSaveAs NotebookSelection NotebookSetupLayoutInformationPacket NotebooksMenu NotebookWrite NotElement NotEqualTilde NotExists NotGreater NotGreaterEqual NotGreaterFullEqual NotGreaterGreater NotGreaterLess NotGreaterSlantEqual NotGreaterTilde NotHumpDownHump NotHumpEqual NotLeftTriangle NotLeftTriangleBar NotLeftTriangleEqual NotLess NotLessEqual NotLessFullEqual NotLessGreater NotLessLess NotLessSlantEqual NotLessTilde NotNestedGreaterGreater NotNestedLessLess NotPrecedes NotPrecedesEqual NotPrecedesSlantEqual NotPrecedesTilde NotReverseElement NotRightTriangle NotRightTriangleBar NotRightTriangleEqual NotSquareSubset NotSquareSubsetEqual NotSquareSuperset NotSquareSupersetEqual NotSubset NotSubsetEqual NotSucceeds NotSucceedsEqual NotSucceedsSlantEqual NotSucceedsTilde NotSuperset NotSupersetEqual NotTilde NotTildeEqual NotTildeFullEqual NotTildeTilde NotVerticalBar NProbability NProduct NProductFactors NRoots NSolve NSum NSumTerms Null NullRecords NullSpace NullWords Number NumberFieldClassNumber NumberFieldDiscriminant NumberFieldFundamentalUnits NumberFieldIntegralBasis NumberFieldNormRepresentatives NumberFieldRegulator NumberFieldRootsOfUnity NumberFieldSignature NumberForm NumberFormat NumberMarks NumberMultiplier NumberPadding NumberPoint NumberQ NumberSeparator NumberSigns NumberString Numerator NumericFunction NumericQ NuttallWindow NValues NyquistGridLines NyquistPlot O ObservabilityGramian ObservabilityMatrix ObservableDecomposition ObservableModelQ OddQ Off Offset OLEData On ONanGroupON OneIdentity Opacity Open OpenAppend Opener OpenerBox OpenerBoxOptions OpenerView OpenFunctionInspectorPacket Opening OpenRead OpenSpecialOptions OpenTemporary OpenWrite Operate OperatingSystem OptimumFlowData Optional OptionInspectorSettings OptionQ Options OptionsPacket OptionsPattern OptionValue OptionValueBox OptionValueBoxOptions Or Orange Order OrderDistribution OrderedQ Ordering Orderless OrnsteinUhlenbeckProcess Orthogonalize Out Outer OutputAutoOverwrite OutputControllabilityMatrix OutputControllableModelQ OutputForm OutputFormData OutputGrouping OutputMathEditExpression OutputNamePacket OutputResponse OutputSizeLimit OutputStream Over OverBar OverDot Overflow OverHat Overlaps Overlay OverlayBox OverlayBoxOptions Overscript OverscriptBox OverscriptBoxOptions OverTilde OverVector OwenT OwnValues PackingMethod PaddedForm Padding PadeApproximant PadLeft PadRight PageBreakAbove PageBreakBelow PageBreakWithin PageFooterLines PageFooters PageHeaderLines PageHeaders PageHeight PageRankCentrality PageWidth PairedBarChart PairedHistogram PairedSmoothHistogram PairedTTest PairedZTest PaletteNotebook PalettePath Pane PaneBox PaneBoxOptions Panel PanelBox PanelBoxOptions Paneled PaneSelector PaneSelectorBox PaneSelectorBoxOptions PaperWidth ParabolicCylinderD ParagraphIndent ParagraphSpacing ParallelArray ParallelCombine ParallelDo ParallelEvaluate Parallelization Parallelize ParallelMap ParallelNeeds ParallelProduct ParallelSubmit ParallelSum ParallelTable ParallelTry Parameter ParameterEstimator ParameterMixtureDistribution ParameterVariables ParametricFunction ParametricNDSolve ParametricNDSolveValue ParametricPlot ParametricPlot3D ParentConnect ParentDirectory ParentForm Parenthesize ParentList ParetoDistribution Part PartialCorrelationFunction PartialD ParticleData Partition PartitionsP PartitionsQ ParzenWindow PascalDistribution PassEventsDown PassEventsUp Paste PasteBoxFormInlineCells PasteButton Path PathGraph PathGraphQ Pattern PatternSequence PatternTest PauliMatrix PaulWavelet Pause PausedTime PDF PearsonChiSquareTest PearsonCorrelationTest PearsonDistribution PerformanceGoal PeriodicInterpolation Periodogram PeriodogramArray PermutationCycles PermutationCyclesQ PermutationGroup PermutationLength PermutationList PermutationListQ PermutationMax PermutationMin PermutationOrder PermutationPower PermutationProduct PermutationReplace Permutations PermutationSupport Permute PeronaMalikFilter Perpendicular PERTDistribution PetersenGraph PhaseMargins Pi Pick PIDData PIDDerivativeFilter PIDFeedforward PIDTune Piecewise PiecewiseExpand PieChart PieChart3D PillaiTrace PillaiTraceTest Pink Pivoting PixelConstrained PixelValue PixelValuePositions Placed Placeholder PlaceholderReplace Plain PlanarGraphQ Play PlayRange Plot Plot3D Plot3Matrix PlotDivision PlotJoined PlotLabel PlotLayout PlotLegends PlotMarkers PlotPoints PlotRange PlotRangeClipping PlotRangePadding PlotRegion PlotStyle Plus PlusMinus Pochhammer PodStates PodWidth Point Point3DBox PointBox PointFigureChart PointForm PointLegend PointSize PoissonConsulDistribution PoissonDistribution PoissonProcess PoissonWindow PolarAxes PolarAxesOrigin PolarGridLines PolarPlot PolarTicks PoleZeroMarkers PolyaAeppliDistribution PolyGamma Polygon Polygon3DBox Polygon3DBoxOptions PolygonBox PolygonBoxOptions PolygonHoleScale PolygonIntersections PolygonScale PolyhedronData PolyLog PolynomialExtendedGCD PolynomialForm PolynomialGCD PolynomialLCM PolynomialMod PolynomialQ PolynomialQuotient PolynomialQuotientRemainder PolynomialReduce PolynomialRemainder Polynomials PopupMenu PopupMenuBox PopupMenuBoxOptions PopupView PopupWindow Position Positive PositiveDefiniteMatrixQ PossibleZeroQ Postfix PostScript Power PowerDistribution PowerExpand PowerMod PowerModList PowerSpectralDensity PowersRepresentations PowerSymmetricPolynomial Precedence PrecedenceForm Precedes PrecedesEqual PrecedesSlantEqual PrecedesTilde Precision PrecisionGoal PreDecrement PredictionRoot PreemptProtect PreferencesPath Prefix PreIncrement Prepend PrependTo PreserveImageOptions Previous PriceGraphDistribution PrimaryPlaceholder Prime PrimeNu PrimeOmega PrimePi PrimePowerQ PrimeQ Primes PrimeZetaP PrimitiveRoot PrincipalComponents PrincipalValue Print PrintAction PrintForm PrintingCopies PrintingOptions PrintingPageRange PrintingStartingPageNumber PrintingStyleEnvironment PrintPrecision PrintTemporary Prism PrismBox PrismBoxOptions PrivateCellOptions PrivateEvaluationOptions PrivateFontOptions PrivateFrontEndOptions PrivateNotebookOptions PrivatePaths Probability ProbabilityDistribution ProbabilityPlot ProbabilityPr ProbabilityScalePlot ProbitModelFit ProcessEstimator ProcessParameterAssumptions ProcessParameterQ ProcessStateDomain ProcessTimeDomain Product ProductDistribution ProductLog ProgressIndicator ProgressIndicatorBox ProgressIndicatorBoxOptions Projection Prolog PromptForm Properties Property PropertyList PropertyValue Proportion Proportional Protect Protected ProteinData Pruning PseudoInverse Purple Put PutAppend Pyramid PyramidBox PyramidBoxOptions QBinomial QFactorial QGamma QHypergeometricPFQ QPochhammer QPolyGamma QRDecomposition QuadraticIrrationalQ Quantile QuantilePlot Quantity QuantityForm QuantityMagnitude QuantityQ QuantityUnit Quartics QuartileDeviation Quartiles QuartileSkewness QueueingNetworkProcess QueueingProcess QueueProperties Quiet Quit Quotient QuotientRemainder RadialityCentrality RadicalBox RadicalBoxOptions RadioButton RadioButtonBar RadioButtonBox RadioButtonBoxOptions Radon RamanujanTau RamanujanTauL RamanujanTauTheta RamanujanTauZ Random RandomChoice RandomComplex RandomFunction RandomGraph RandomImage RandomInteger RandomPermutation RandomPrime RandomReal RandomSample RandomSeed RandomVariate RandomWalkProcess Range RangeFilter RangeSpecification RankedMax RankedMin Raster Raster3D Raster3DBox Raster3DBoxOptions RasterArray RasterBox RasterBoxOptions Rasterize RasterSize Rational RationalFunctions Rationalize Rationals Ratios Raw RawArray RawBoxes RawData RawMedium RayleighDistribution Re Read ReadList ReadProtected Real RealBlockDiagonalForm RealDigits RealExponent Reals Reap Record RecordLists RecordSeparators Rectangle RectangleBox RectangleBoxOptions RectangleChart RectangleChart3D RecurrenceFilter RecurrenceTable RecurringDigitsForm Red Reduce RefBox ReferenceLineStyle ReferenceMarkers ReferenceMarkerStyle Refine ReflectionMatrix ReflectionTransform Refresh RefreshRate RegionBinarize RegionFunction RegionPlot RegionPlot3D RegularExpression Regularization Reinstall Release ReleaseHold ReliabilityDistribution ReliefImage ReliefPlot Remove RemoveAlphaChannel RemoveAsynchronousTask Removed RemoveInputStreamMethod RemoveOutputStreamMethod RemoveProperty RemoveScheduledTask RenameDirectory RenameFile RenderAll RenderingOptions RenewalProcess RenkoChart Repeated RepeatedNull RepeatedString Replace ReplaceAll ReplaceHeldPart ReplaceImageValue ReplaceList ReplacePart ReplacePixelValue ReplaceRepeated Resampling Rescale RescalingTransform ResetDirectory ResetMenusPacket ResetScheduledTask Residue Resolve Rest Resultant ResumePacket Return ReturnExpressionPacket ReturnInputFormPacket ReturnPacket ReturnTextPacket Reverse ReverseBiorthogonalSplineWavelet ReverseElement ReverseEquilibrium ReverseGraph ReverseUpEquilibrium RevolutionAxis RevolutionPlot3D RGBColor RiccatiSolve RiceDistribution RidgeFilter RiemannR RiemannSiegelTheta RiemannSiegelZ Riffle Right RightArrow RightArrowBar RightArrowLeftArrow RightCosetRepresentative RightDownTeeVector RightDownVector RightDownVectorBar RightTee RightTeeArrow RightTeeVector RightTriangle RightTriangleBar RightTriangleEqual RightUpDownVector RightUpTeeVector RightUpVector RightUpVectorBar RightVector RightVectorBar RiskAchievementImportance RiskReductionImportance RogersTanimotoDissimilarity Root RootApproximant RootIntervals RootLocusPlot RootMeanSquare RootOfUnityQ RootReduce Roots RootSum Rotate RotateLabel RotateLeft RotateRight RotationAction RotationBox RotationBoxOptions RotationMatrix RotationTransform Round RoundImplies RoundingRadius Row RowAlignments RowBackgrounds RowBox RowHeights RowLines RowMinHeight RowReduce RowsEqual RowSpacings RSolve RudvalisGroupRu Rule RuleCondition RuleDelayed RuleForm RulerUnits Run RunScheduledTask RunThrough RuntimeAttributes RuntimeOptions RussellRaoDissimilarity SameQ SameTest SampleDepth SampledSoundFunction SampledSoundList SampleRate SamplingPeriod SARIMAProcess SARMAProcess SatisfiabilityCount SatisfiabilityInstances SatisfiableQ Saturday Save Saveable SaveAutoDelete SaveDefinitions SawtoothWave Scale Scaled ScaleDivisions ScaledMousePosition ScaleOrigin ScalePadding ScaleRanges ScaleRangeStyle ScalingFunctions ScalingMatrix ScalingTransform Scan ScheduledTaskActiveQ ScheduledTaskData ScheduledTaskObject ScheduledTasks SchurDecomposition ScientificForm ScreenRectangle ScreenStyleEnvironment ScriptBaselineShifts ScriptLevel ScriptMinSize ScriptRules ScriptSizeMultipliers Scrollbars ScrollingOptions ScrollPosition Sec Sech SechDistribution SectionGrouping SectorChart SectorChart3D SectorOrigin SectorSpacing SeedRandom Select Selectable SelectComponents SelectedCells SelectedNotebook Selection SelectionAnimate SelectionCell SelectionCellCreateCell SelectionCellDefaultStyle SelectionCellParentStyle SelectionCreateCell SelectionDebuggerTag SelectionDuplicateCell SelectionEvaluate SelectionEvaluateCreateCell SelectionMove SelectionPlaceholder SelectionSetStyle SelectWithContents SelfLoops SelfLoopStyle SemialgebraicComponentInstances SendMail Sequence SequenceAlignment SequenceForm SequenceHold SequenceLimit Series SeriesCoefficient SeriesData SessionTime Set SetAccuracy SetAlphaChannel SetAttributes Setbacks SetBoxFormNamesPacket SetDelayed SetDirectory SetEnvironment SetEvaluationNotebook SetFileDate SetFileLoadingContext SetNotebookStatusLine SetOptions SetOptionsPacket SetPrecision SetProperty SetSelectedNotebook SetSharedFunction SetSharedVariable SetSpeechParametersPacket SetStreamPosition SetSystemOptions Setter SetterBar SetterBox SetterBoxOptions Setting SetValue Shading Shallow ShannonWavelet ShapiroWilkTest Share Sharpen ShearingMatrix ShearingTransform ShenCastanMatrix Short ShortDownArrow Shortest ShortestMatch ShortestPathFunction ShortLeftArrow ShortRightArrow ShortUpArrow Show ShowAutoStyles ShowCellBracket ShowCellLabel ShowCellTags ShowClosedCellArea ShowContents ShowControls ShowCursorTracker ShowGroupOpenCloseIcon ShowGroupOpener ShowInvisibleCharacters ShowPageBreaks ShowPredictiveInterface ShowSelection ShowShortBoxForm ShowSpecialCharacters ShowStringCharacters ShowSyntaxStyles ShrinkingDelay ShrinkWrapBoundingBox SiegelTheta SiegelTukeyTest Sign Signature SignedRankTest SignificanceLevel SignPadding SignTest SimilarityRules SimpleGraph SimpleGraphQ Simplify Sin Sinc SinghMaddalaDistribution SingleEvaluation SingleLetterItalics SingleLetterStyle SingularValueDecomposition SingularValueList SingularValuePlot SingularValues Sinh SinhIntegral SinIntegral SixJSymbol Skeleton SkeletonTransform SkellamDistribution Skewness SkewNormalDistribution Skip SliceDistribution Slider Slider2D Slider2DBox Slider2DBoxOptions SliderBox SliderBoxOptions SlideView Slot SlotSequence Small SmallCircle Smaller SmithDelayCompensator SmithWatermanSimilarity SmoothDensityHistogram SmoothHistogram SmoothHistogram3D SmoothKernelDistribution SocialMediaData Socket SokalSneathDissimilarity Solve SolveAlways SolveDelayed Sort SortBy Sound SoundAndGraphics SoundNote SoundVolume Sow Space SpaceForm Spacer Spacings Span SpanAdjustments SpanCharacterRounding SpanFromAbove SpanFromBoth SpanFromLeft SpanLineThickness SpanMaxSize SpanMinSize SpanningCharacters SpanSymmetric SparseArray SpatialGraphDistribution Speak SpeakTextPacket SpearmanRankTest SpearmanRho Spectrogram SpectrogramArray Specularity SpellingCorrection SpellingDictionaries SpellingDictionariesPath SpellingOptions SpellingSuggestionsPacket Sphere SphereBox SphericalBesselJ SphericalBesselY SphericalHankelH1 SphericalHankelH2 SphericalHarmonicY SphericalPlot3D SphericalRegion SpheroidalEigenvalue SpheroidalJoiningFactor SpheroidalPS SpheroidalPSPrime SpheroidalQS SpheroidalQSPrime SpheroidalRadialFactor SpheroidalS1 SpheroidalS1Prime SpheroidalS2 SpheroidalS2Prime Splice SplicedDistribution SplineClosed SplineDegree SplineKnots SplineWeights Split SplitBy SpokenString Sqrt SqrtBox SqrtBoxOptions Square SquaredEuclideanDistance SquareFreeQ SquareIntersection SquaresR SquareSubset SquareSubsetEqual SquareSuperset SquareSupersetEqual SquareUnion SquareWave StabilityMargins StabilityMarginsStyle StableDistribution Stack StackBegin StackComplete StackInhibit StandardDeviation StandardDeviationFilter StandardForm Standardize StandbyDistribution Star StarGraph StartAsynchronousTask StartingStepSize StartOfLine StartOfString StartScheduledTask StartupSound StateDimensions StateFeedbackGains StateOutputEstimator StateResponse StateSpaceModel StateSpaceRealization StateSpaceTransform StationaryDistribution StationaryWaveletPacketTransform StationaryWaveletTransform StatusArea StatusCentrality StepMonitor StieltjesGamma StirlingS1 StirlingS2 StopAsynchronousTask StopScheduledTask StrataVariables StratonovichProcess StreamColorFunction StreamColorFunctionScaling StreamDensityPlot StreamPlot StreamPoints StreamPosition Streams StreamScale StreamStyle String StringBreak StringByteCount StringCases StringCount StringDrop StringExpression StringForm StringFormat StringFreeQ StringInsert StringJoin StringLength StringMatchQ StringPosition StringQ StringReplace StringReplaceList StringReplacePart StringReverse StringRotateLeft StringRotateRight StringSkeleton StringSplit StringTake StringToStream StringTrim StripBoxes StripOnInput StripWrapperBoxes StrokeForm StructuralImportance StructuredArray StructuredSelection StruveH StruveL Stub StudentTDistribution Style StyleBox StyleBoxAutoDelete StyleBoxOptions StyleData StyleDefinitions StyleForm StyleKeyMapping StyleMenuListing StyleNameDialogSettings StyleNames StylePrint StyleSheetPath Subfactorial Subgraph SubMinus SubPlus SubresultantPolynomialRemainders SubresultantPolynomials Subresultants Subscript SubscriptBox SubscriptBoxOptions Subscripted Subset SubsetEqual Subsets SubStar Subsuperscript SubsuperscriptBox SubsuperscriptBoxOptions Subtract SubtractFrom SubValues Succeeds SucceedsEqual SucceedsSlantEqual SucceedsTilde SuchThat Sum SumConvergence Sunday SuperDagger SuperMinus SuperPlus Superscript SuperscriptBox SuperscriptBoxOptions Superset SupersetEqual SuperStar Surd SurdForm SurfaceColor SurfaceGraphics SurvivalDistribution SurvivalFunction SurvivalModel SurvivalModelFit SuspendPacket SuzukiDistribution SuzukiGroupSuz SwatchLegend Switch Symbol SymbolName SymletWavelet Symmetric SymmetricGroup SymmetricMatrixQ SymmetricPolynomial SymmetricReduction Symmetrize SymmetrizedArray SymmetrizedArrayRules SymmetrizedDependentComponents SymmetrizedIndependentComponents SymmetrizedReplacePart SynchronousInitialization SynchronousUpdating Syntax SyntaxForm SyntaxInformation SyntaxLength SyntaxPacket SyntaxQ SystemDialogInput SystemException SystemHelpPath SystemInformation SystemInformationData SystemOpen SystemOptions SystemsModelDelay SystemsModelDelayApproximate SystemsModelDelete SystemsModelDimensions SystemsModelExtract SystemsModelFeedbackConnect SystemsModelLabels SystemsModelOrder SystemsModelParallelConnect SystemsModelSeriesConnect SystemsModelStateFeedbackConnect SystemStub Tab TabFilling Table TableAlignments TableDepth TableDirections TableForm TableHeadings TableSpacing TableView TableViewBox TabSpacings TabView TabViewBox TabViewBoxOptions TagBox TagBoxNote TagBoxOptions TaggingRules TagSet TagSetDelayed TagStyle TagUnset Take TakeWhile Tally Tan Tanh TargetFunctions TargetUnits TautologyQ TelegraphProcess TemplateBox TemplateBoxOptions TemplateSlotSequence TemporalData Temporary TemporaryVariable TensorContract TensorDimensions TensorExpand TensorProduct TensorQ TensorRank TensorReduce TensorSymmetry TensorTranspose TensorWedge Tetrahedron TetrahedronBox TetrahedronBoxOptions TeXForm TeXSave Text Text3DBox Text3DBoxOptions TextAlignment TextBand TextBoundingBox TextBox TextCell TextClipboardType TextData TextForm TextJustification TextLine TextPacket TextParagraph TextRecognize TextRendering TextStyle Texture TextureCoordinateFunction TextureCoordinateScaling Therefore ThermometerGauge Thick Thickness Thin Thinning ThisLink ThompsonGroupTh Thread ThreeJSymbol Threshold Through Throw Thumbnail Thursday Ticks TicksStyle Tilde TildeEqual TildeFullEqual TildeTilde TimeConstrained TimeConstraint Times TimesBy TimeSeriesForecast TimeSeriesInvertibility TimeUsed TimeValue TimeZone Timing Tiny TitleGrouping TitsGroupT ToBoxes ToCharacterCode ToColor ToContinuousTimeModel ToDate ToDiscreteTimeModel ToeplitzMatrix ToExpression ToFileName Together Toggle ToggleFalse Toggler TogglerBar TogglerBox TogglerBoxOptions ToHeldExpression ToInvertibleTimeSeries TokenWords Tolerance ToLowerCase ToNumberField TooBig Tooltip TooltipBox TooltipBoxOptions TooltipDelay TooltipStyle Top TopHatTransform TopologicalSort ToRadicals ToRules ToString Total TotalHeight TotalVariationFilter TotalWidth TouchscreenAutoZoom TouchscreenControlPlacement ToUpperCase Tr Trace TraceAbove TraceAction TraceBackward TraceDepth TraceDialog TraceForward TraceInternal TraceLevel TraceOff TraceOn TraceOriginal TracePrint TraceScan TrackedSymbols TradingChart TraditionalForm TraditionalFunctionNotation TraditionalNotation TraditionalOrder TransferFunctionCancel TransferFunctionExpand TransferFunctionFactor TransferFunctionModel TransferFunctionPoles TransferFunctionTransform TransferFunctionZeros TransformationFunction TransformationFunctions TransformationMatrix TransformedDistribution TransformedField Translate TranslationTransform TransparentColor Transpose TreeForm TreeGraph TreeGraphQ TreePlot TrendStyle TriangleWave TriangularDistribution Trig TrigExpand TrigFactor TrigFactorList Trigger TrigReduce TrigToExp TrimmedMean True TrueQ TruncatedDistribution TsallisQExponentialDistribution TsallisQGaussianDistribution TTest Tube TubeBezierCurveBox TubeBezierCurveBoxOptions TubeBox TubeBSplineCurveBox TubeBSplineCurveBoxOptions Tuesday TukeyLambdaDistribution TukeyWindow Tuples TuranGraph TuringMachine Transparent UnateQ Uncompress Undefined UnderBar Underflow Underlined Underoverscript UnderoverscriptBox UnderoverscriptBoxOptions Underscript UnderscriptBox UnderscriptBoxOptions UndirectedEdge UndirectedGraph UndirectedGraphQ UndocumentedTestFEParserPacket UndocumentedTestGetSelectionPacket Unequal Unevaluated UniformDistribution UniformGraphDistribution UniformSumDistribution Uninstall Union UnionPlus Unique UnitBox UnitConvert UnitDimensions Unitize UnitRootTest UnitSimplify UnitStep UnitTriangle UnitVector Unprotect UnsameQ UnsavedVariables Unset UnsetShared UntrackedVariables Up UpArrow UpArrowBar UpArrowDownArrow Update UpdateDynamicObjects UpdateDynamicObjectsSynchronous UpdateInterval UpDownArrow UpEquilibrium UpperCaseQ UpperLeftArrow UpperRightArrow UpperTriangularize Upsample UpSet UpSetDelayed UpTee UpTeeArrow UpValues URL URLFetch URLFetchAsynchronous URLSave URLSaveAsynchronous UseGraphicsRange Using UsingFrontEnd V2Get ValidationLength Value ValueBox ValueBoxOptions ValueForm ValueQ ValuesData Variables Variance VarianceEquivalenceTest VarianceEstimatorFunction VarianceGammaDistribution VarianceTest VectorAngle VectorColorFunction VectorColorFunctionScaling VectorDensityPlot VectorGlyphData VectorPlot VectorPlot3D VectorPoints VectorQ Vectors VectorScale VectorStyle Vee Verbatim Verbose VerboseConvertToPostScriptPacket VerifyConvergence VerifySolutions VerifyTestAssumptions Version VersionNumber VertexAdd VertexCapacity VertexColors VertexComponent VertexConnectivity VertexCoordinateRules VertexCoordinates VertexCorrelationSimilarity VertexCosineSimilarity VertexCount VertexCoverQ VertexDataCoordinates VertexDegree VertexDelete VertexDiceSimilarity VertexEccentricity VertexInComponent VertexInDegree VertexIndex VertexJaccardSimilarity VertexLabeling VertexLabels VertexLabelStyle VertexList VertexNormals VertexOutComponent VertexOutDegree VertexQ VertexRenderingFunction VertexReplace VertexShape VertexShapeFunction VertexSize VertexStyle VertexTextureCoordinates VertexWeight Vertical VerticalBar VerticalForm VerticalGauge VerticalSeparator VerticalSlider VerticalTilde ViewAngle ViewCenter ViewMatrix ViewPoint ViewPointSelectorSettings ViewPort ViewRange ViewVector ViewVertical VirtualGroupData Visible VisibleCell VoigtDistribution VonMisesDistribution WaitAll WaitAsynchronousTask WaitNext WaitUntil WakebyDistribution WalleniusHypergeometricDistribution WaringYuleDistribution WatershedComponents WatsonUSquareTest WattsStrogatzGraphDistribution WaveletBestBasis WaveletFilterCoefficients WaveletImagePlot WaveletListPlot WaveletMapIndexed WaveletMatrixPlot WaveletPhi WaveletPsi WaveletScale WaveletScalogram WaveletThreshold WeaklyConnectedComponents WeaklyConnectedGraphQ WeakStationarity WeatherData WeberE Wedge Wednesday WeibullDistribution WeierstrassHalfPeriods WeierstrassInvariants WeierstrassP WeierstrassPPrime WeierstrassSigma WeierstrassZeta WeightedAdjacencyGraph WeightedAdjacencyMatrix WeightedData WeightedGraphQ Weights WelchWindow WheelGraph WhenEvent Which While White Whitespace WhitespaceCharacter WhittakerM WhittakerW WienerFilter WienerProcess WignerD WignerSemicircleDistribution WilksW WilksWTest WindowClickSelect WindowElements WindowFloating WindowFrame WindowFrameElements WindowMargins WindowMovable WindowOpacity WindowSelected WindowSize WindowStatusArea WindowTitle WindowToolbars WindowWidth With WolframAlpha WolframAlphaDate WolframAlphaQuantity WolframAlphaResult Word WordBoundary WordCharacter WordData WordSearch WordSeparators WorkingPrecision Write WriteString Wronskian XMLElement XMLObject Xnor Xor Yellow YuleDissimilarity ZernikeR ZeroSymmetric ZeroTest ZeroWidthTimes Zeta ZetaZero ZipfDistribution ZTest ZTransform $Aborted $ActivationGroupID $ActivationKey $ActivationUserRegistered $AddOnsDirectory $AssertFunction $Assumptions $AsynchronousTask $BaseDirectory $BatchInput $BatchOutput $BoxForms $ByteOrdering $Canceled $CharacterEncoding $CharacterEncodings $CommandLine $CompilationTarget $ConditionHold $ConfiguredKernels $Context $ContextPath $ControlActiveSetting $CreationDate $CurrentLink $DateStringFormat $DefaultFont $DefaultFrontEnd $DefaultImagingDevice $DefaultPath $Display $DisplayFunction $DistributedContexts $DynamicEvaluation $Echo $Epilog $ExportFormats $Failed $FinancialDataSource $FormatType $FrontEnd $FrontEndSession $GeoLocation $HistoryLength $HomeDirectory $HTTPCookies $IgnoreEOF $ImagingDevices $ImportFormats $InitialDirectory $Input $InputFileName $InputStreamMethods $Inspector $InstallationDate $InstallationDirectory $InterfaceEnvironment $IterationLimit $KernelCount $KernelID $Language $LaunchDirectory $LibraryPath $LicenseExpirationDate $LicenseID $LicenseProcesses $LicenseServer $LicenseSubprocesses $LicenseType $Line $Linked $LinkSupported $LoadedFiles $MachineAddresses $MachineDomain $MachineDomains $MachineEpsilon $MachineID $MachineName $MachinePrecision $MachineType $MaxExtraPrecision $MaxLicenseProcesses $MaxLicenseSubprocesses $MaxMachineNumber $MaxNumber $MaxPiecewiseCases $MaxPrecision $MaxRootDegree $MessageGroups $MessageList $MessagePrePrint $Messages $MinMachineNumber $MinNumber $MinorReleaseNumber $MinPrecision $ModuleNumber $NetworkLicense $NewMessage $NewSymbol $Notebooks $NumberMarks $Off $OperatingSystem $Output $OutputForms $OutputSizeLimit $OutputStreamMethods $Packages $ParentLink $ParentProcessID $PasswordFile $PatchLevelID $Path $PathnameSeparator $PerformanceGoal $PipeSupported $Post $Pre $PreferencesDirectory $PrePrint $PreRead $PrintForms $PrintLiteral $ProcessID $ProcessorCount $ProcessorType $ProductInformation $ProgramName $RandomState $RecursionLimit $ReleaseNumber $RootDirectory $ScheduledTask $ScriptCommandLine $SessionID $SetParentLink $SharedFunctions $SharedVariables $SoundDisplay $SoundDisplayFunction $SuppressInputFormHeads $SynchronousEvaluation $SyntaxHandler $System $SystemCharacterEncoding $SystemID $SystemWordLength $TemporaryDirectory $TemporaryPrefix $TextStyle $TimedOut $TimeUnit $TimeZone $TopDirectory $TraceOff $TraceOn $TracePattern $TracePostAction $TracePreAction $Urgent $UserAddOnsDirectory $UserBaseDirectory $UserDocumentsDirectory $UserName $Version $VersionNumber",c:[{cN:"comment",b:/\(\*/,e:/\*\)/},a.ASM,a.QSM,a.CNM,{cN:"list",b:/\{/,e:/\}/,i:/:/}]}});hljs.registerLanguage("cs",function(b){var a="abstract as base bool break byte case catch char checked const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using virtual volatile void while async await ascending descending from get group into join let orderby partial select set value var where yield";return{k:a,c:[{cN:"comment",b:"///",e:"$",rB:true,c:[{cN:"xmlDocTag",b:"///|<!--|-->"},{cN:"xmlDocTag",b:"</?",e:">"}]},b.CLCM,b.CBLCLM,{cN:"preprocessor",b:"#",e:"$",k:"if else elif endif define undef warning error line region endregion pragma checksum"},{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},b.ASM,b.QSM,b.CNM,{bK:"protected public private internal",e:/[{;=]/,k:a,c:[{bK:"class namespace interface",starts:{c:[b.TM]}},{b:b.IR+"\\s*\\(",rB:true,c:[b.TM]}]}]}});hljs.registerLanguage("http",function(a){return{i:"\\S",c:[{cN:"status",b:"^HTTP/[0-9\\.]+",e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{cN:"request",b:"^[A-Z]+ (.*?) HTTP/[0-9\\.]+$",rB:true,e:"$",c:[{cN:"string",b:" ",e:" ",eB:true,eE:true}]},{cN:"attribute",b:"^\\w",e:": ",eE:true,i:"\\n|\\s|=",starts:{cN:"string",e:"$"}},{b:"\\n\\n",starts:{sL:"",eW:true}}]}});hljs.registerLanguage("rust",function(b){var c={cN:"number",b:"\\b(0[xb][A-Za-z0-9_]+|[0-9_]+(\\.[0-9_]+)?([uif](8|16|32|64)?)?)",r:0};var a="assert bool break char check claim comm const cont copy dir do drop else enum extern export f32 f64 fail false float fn for i16 i32 i64 i8 if impl int let log loop match mod move mut priv pub pure ref return self static str struct task true trait type u16 u32 u64 u8 uint unsafe use vec while";return{k:a,i:"</",c:[b.CLCM,b.CBLCLM,b.inherit(b.QSM,{i:null}),b.ASM,c,{cN:"function",bK:"fn",e:"(\\(|<)",c:[b.UTM]},{cN:"preprocessor",b:"#\\[",e:"\\]"},{bK:"type",e:"(=|<)",c:[b.UTM],i:"\\S"},{bK:"trait enum",e:"({|<)",c:[b.UTM],i:"\\S"}]}});hljs.registerLanguage("handlebars",function(b){var a="each in with if else unless bindattr action collection debugger log outlet template unbound view yield";return{cI:true,sL:"xml",subLanguageMode:"continuous",c:[{cN:"expression",b:"{{",e:"}}",c:[{cN:"begin-block",b:"#[a-zA-Z- .]+",k:a},{cN:"string",b:'"',e:'"'},{cN:"end-block",b:"\\/[a-zA-Z- .]+",k:a},{cN:"variable",b:"[a-zA-Z-.]+",k:a}]}]}});hljs.registerLanguage("cmake",function(a){return{cI:true,k:{keyword:"add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_subdirectory add_test aux_source_directory break build_command cmake_minimum_required cmake_policy configure_file create_test_sourcelist define_property else elseif enable_language enable_testing endforeach endfunction endif endmacro endwhile execute_process export find_file find_library find_package find_path find_program fltk_wrap_ui foreach function get_cmake_property get_directory_property get_filename_component get_property get_source_file_property get_target_property get_test_property if include include_directories include_external_msproject include_regular_expression install link_directories load_cache load_command macro mark_as_advanced message option output_required_files project qt_wrap_cpp qt_wrap_ui remove_definitions return separate_arguments set set_directory_properties set_property set_source_files_properties set_target_properties set_tests_properties site_name source_group string target_link_libraries try_compile try_run unset variable_watch while build_name exec_program export_library_dependencies install_files install_programs install_targets link_libraries make_directory remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file qt5_use_modules qt5_use_package qt5_wrap_cpp on off true false and or",operator:"equal less greater strless strgreater strequal matches"},c:[{cN:"envvar",b:"\\${",e:"}"},a.HCM,a.QSM,a.NM]}});hljs.registerLanguage("lisp",function(h){var k="[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#!]*";var l="(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?";var j={cN:"shebang",b:"^#!",e:"$"};var b={cN:"literal",b:"\\b(t{1}|nil)\\b"};var d={cN:"number",v:[{b:l,r:0},{b:"#b[0-1]+(/[0-1]+)?"},{b:"#o[0-7]+(/[0-7]+)?"},{b:"#x[0-9a-f]+(/[0-9a-f]+)?"},{b:"#c\\("+l+" +"+l,e:"\\)"}]};var g=h.inherit(h.QSM,{i:null});var m={cN:"comment",b:";",e:"$"};var f={cN:"variable",b:"\\*",e:"\\*"};var n={cN:"keyword",b:"[:&]"+k};var c={b:"\\(",e:"\\)",c:["self",b,g,d]};var a={cN:"quoted",c:[d,g,f,n,c],v:[{b:"['`]\\(",e:"\\)",},{b:"\\(quote ",e:"\\)",k:{title:"quote"},}]};var i={cN:"list",b:"\\(",e:"\\)"};var e={eW:true,r:0};i.c=[{cN:"title",b:k},e];e.c=[a,i,b,d,g,m,f,n];return{i:/\S/,c:[d,j,b,g,m,a,i]}});hljs.registerLanguage("rib",function(a){return{k:"ArchiveRecord AreaLightSource Atmosphere Attribute AttributeBegin AttributeEnd Basis Begin Blobby Bound Clipping ClippingPlane Color ColorSamples ConcatTransform Cone CoordinateSystem CoordSysTransform CropWindow Curves Cylinder DepthOfField Detail DetailRange Disk Displacement Display End ErrorHandler Exposure Exterior Format FrameAspectRatio FrameBegin FrameEnd GeneralPolygon GeometricApproximation Geometry Hider Hyperboloid Identity Illuminate Imager Interior LightSource MakeCubeFaceEnvironment MakeLatLongEnvironment MakeShadow MakeTexture Matte MotionBegin MotionEnd NuPatch ObjectBegin ObjectEnd ObjectInstance Opacity Option Orientation Paraboloid Patch PatchMesh Perspective PixelFilter PixelSamples PixelVariance Points PointsGeneralPolygons PointsPolygons Polygon Procedural Projection Quantize ReadArchive RelativeDetail ReverseOrientation Rotate Scale ScreenWindow ShadingInterpolation ShadingRate Shutter Sides Skew SolidBegin SolidEnd Sphere SubdivisionMesh Surface TextureCoordinates Torus Transform TransformBegin TransformEnd TransformPoints Translate TrimCurve WorldBegin WorldEnd",i:"</",c:[a.HCM,a.CNM,a.ASM,a.QSM]}});hljs.registerLanguage("css",function(a){var b="[a-zA-Z-][a-zA-Z0-9_-]*";var c={cN:"function",b:b+"\\(",e:"\\)",c:["self",a.NM,a.ASM,a.QSM]};return{cI:true,i:"[=/|']",c:[a.CBLCLM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:true,eE:true,r:0,c:[c,a.ASM,a.QSM,a.NM]}]},{cN:"tag",b:b,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[a.CBLCLM,{cN:"rule",b:"[^\\s]",rB:true,e:";",eW:true,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[c,a.NM,a.QSM,a.ASM,a.CBLCLM,{cN:"hexcolor",b:"#[0-9A-Fa-f]+"},{cN:"important",b:"!important"}]}}]}]}]}});hljs.registerLanguage("avrasm",function(a){return{cI:true,k:{keyword:"adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs brid brie brlo brlt brmi brne brpl brsh brtc brts brvc brvs bset bst call cbi cbr clc clh cli cln clr cls clt clv clz com cp cpc cpi cpse dec eicall eijmp elpm eor fmul fmuls fmulsu icall ijmp in inc jmp ld ldd ldi lds lpm lsl lsr mov movw mul muls mulsu neg nop or ori out pop push rcall ret reti rjmp rol ror sbc sbr sbrc sbrs sec seh sbi sbci sbic sbis sbiw sei sen ser ses set sev sez sleep spm st std sts sub subi swap tst wdr",built_in:"r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 r23 r24 r25 r26 r27 r28 r29 r30 r31 x|0 xh xl y|0 yh yl z|0 zh zl ucsr1c udr1 ucsr1a ucsr1b ubrr1l ubrr1h ucsr0c ubrr0h tccr3c tccr3a tccr3b tcnt3h tcnt3l ocr3ah ocr3al ocr3bh ocr3bl ocr3ch ocr3cl icr3h icr3l etimsk etifr tccr1c ocr1ch ocr1cl twcr twdr twar twsr twbr osccal xmcra xmcrb eicra spmcsr spmcr portg ddrg ping portf ddrf sreg sph spl xdiv rampz eicrb eimsk gimsk gicr eifr gifr timsk tifr mcucr mcucsr tccr0 tcnt0 ocr0 assr tccr1a tccr1b tcnt1h tcnt1l ocr1ah ocr1al ocr1bh ocr1bl icr1h icr1l tccr2 tcnt2 ocr2 ocdr wdtcr sfior eearh eearl eedr eecr porta ddra pina portb ddrb pinb portc ddrc pinc portd ddrd pind spdr spsr spcr udr0 ucsr0a ucsr0b ubrr0l acsr admux adcsr adch adcl porte ddre pine pinf"},c:[a.CBLCLM,{cN:"comment",b:";",e:"$",r:0},a.CNM,a.BNM,{cN:"number",b:"\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)"},a.QSM,{cN:"string",b:"'",e:"[^\\\\]'",i:"[^\\\\][^']"},{cN:"label",b:"^[A-Za-z0-9_.$]+:"},{cN:"preprocessor",b:"#",e:"$"},{cN:"preprocessor",b:"\\.[a-zA-Z]+"},{cN:"localvars",b:"@[0-9]+"}]}});hljs.registerLanguage("apache",function(a){var b={cN:"number",b:"[\\$%]\\d+"};return{cI:true,c:[a.HCM,{cN:"tag",b:"</?",e:">"},{cN:"keyword",b:/\w+/,r:0,k:{common:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"sqbracket",b:"\\s\\[",e:"\\]$"},{cN:"cbracket",b:"[\\$%]\\{",e:"\\}",c:["self",b]},b,a.QSM]}}],i:/\S/}});hljs.registerLanguage("1c",function(b){var f="[a-zA-Zа-яА-Я][a-zA-Z0-9_а-яА-Я]*";var c="возврат дата для если и или иначе иначеесли исключение конецесли конецпопытки конецпроцедуры конецфункции конеццикла константа не перейти перем перечисление по пока попытка прервать продолжить процедура строка тогда фс функция цикл число экспорт";var e="ansitooem oemtoansi ввестивидсубконто ввестидату ввестизначение ввестиперечисление ввестипериод ввестиплансчетов ввестистроку ввестичисло вопрос восстановитьзначение врег выбранныйплансчетов вызватьисключение датагод датамесяц датачисло добавитьмесяц завершитьработусистемы заголовоксистемы записьжурналарегистрации запуститьприложение зафиксироватьтранзакцию значениевстроку значениевстрокувнутр значениевфайл значениеизстроки значениеизстрокивнутр значениеизфайла имякомпьютера имяпользователя каталогвременныхфайлов каталогиб каталогпользователя каталогпрограммы кодсимв командасистемы конгода конецпериодаби конецрассчитанногопериодаби конецстандартногоинтервала конквартала конмесяца коннедели лев лог лог10 макс максимальноеколичествосубконто мин монопольныйрежим названиеинтерфейса названиенабораправ назначитьвид назначитьсчет найти найтипомеченныенаудаление найтиссылки началопериодаби началостандартногоинтервала начатьтранзакцию начгода начквартала начмесяца начнедели номерднягода номерднянедели номернеделигода нрег обработкаожидания окр описаниеошибки основнойжурналрасчетов основнойплансчетов основнойязык открытьформу открытьформумодально отменитьтранзакцию очиститьокносообщений периодстр полноеимяпользователя получитьвремята получитьдатута получитьдокументта получитьзначенияотбора получитьпозициюта получитьпустоезначение получитьта прав праводоступа предупреждение префиксавтонумерации пустаястрока пустоезначение рабочаядаттьпустоезначение рабочаядата разделительстраниц разделительстрок разм разобратьпозициюдокумента рассчитатьрегистрына рассчитатьрегистрыпо сигнал симв символтабуляции создатьобъект сокрл сокрлп сокрп сообщить состояние сохранитьзначение сред статусвозврата стрдлина стрзаменить стрколичествострок стрполучитьстроку стрчисловхождений сформироватьпозициюдокумента счетпокоду текущаядата текущеевремя типзначения типзначениястр удалитьобъекты установитьтана установитьтапо фиксшаблон формат цел шаблон";var a={cN:"dquote",b:'""'};var d={cN:"string",b:'"',e:'"|$',c:[a]};var g={cN:"string",b:"\\|",e:'"|$',c:[a]};return{cI:true,l:f,k:{keyword:c,built_in:e},c:[b.CLCM,b.NM,d,g,{cN:"function",b:"(процедура|функция)",e:"$",l:f,k:"процедура функция",c:[b.inherit(b.TM,{b:f}),{cN:"tail",eW:true,c:[{cN:"params",b:"\\(",e:"\\)",l:f,k:"знач",c:[d,g]},{cN:"export",b:"экспорт",eW:true,l:f,k:"экспорт",c:[b.CLCM]}]},b.CLCM]},{cN:"preprocessor",b:"#",e:"$"},{cN:"date",b:"'\\d{2}\\.\\d{2}\\.(\\d{2}|\\d{4})'"}]}});hljs.registerLanguage("javascript",function(a){return{aliases:["js"],k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require"},c:[{cN:"pi",b:/^\s*('|")use strict('|")/,r:10},a.ASM,a.QSM,a.CLCM,a.CBLCLM,a.CNM,{b:"("+a.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[a.CLCM,a.CBLCLM,a.REGEXP_MODE,{b:/</,e:/>;/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,c:[a.inherit(a.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,c:[a.CLCM,a.CBLCLM],i:/["'\(]/}],i:/\[|%/},{b:/\$[(.]/},{b:"\\."+a.IR,r:0}]}});hljs.registerLanguage("vbnet",function(a){return{cI:true,k:{keyword:"addhandler addressof alias and andalso aggregate ansi as assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into is isfalse isnot istrue join key let lib like loop me mid mod module mustinherit mustoverride mybase myclass namespace narrowing new next not notinheritable notoverridable of off on operator option optional or order orelse overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim rem removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly xor",built_in:"boolean byte cbool cbyte cchar cdate cdec cdbl char cint clng cobj csbyte cshort csng cstr ctype date decimal directcast double gettype getxmlnamespace iif integer long object sbyte short single string trycast typeof uinteger ulong ushort",literal:"true false nothing"},i:"//|{|}|endif|gosub|variant|wend",c:[a.inherit(a.QSM,{c:[{b:'""'}]}),{cN:"comment",b:"'",e:"$",rB:true,c:[{cN:"xmlDocTag",b:"'''|<!--|-->"},{cN:"xmlDocTag",b:"</?",e:">"},]},a.CNM,{cN:"preprocessor",b:"#",e:"$",k:"if else elseif end region externalsource"},]}});hljs.registerLanguage("fsharp",function(a){return{k:"abstract and as assert base begin class default delegate do done downcast downto elif else end exception extern false finally for fun function global if in inherit inline interface internal lazy let match member module mutable namespace new null of open or override private public rec return sig static struct then to true try type upcast use val void when while with yield",c:[{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},{cN:"string",b:'"""',e:'"""'},{cN:"comment",b:"\\(\\*",e:"\\*\\)"},{cN:"class",bK:"type",e:"\\(|=|$",c:[a.UTM]},{cN:"annotation",b:"\\[<",e:">\\]"},{cN:"attribute",b:"\\B('[A-Za-z])\\b",c:[a.BE]},a.CLCM,a.inherit(a.QSM,{i:null}),a.CNM]}});hljs.registerLanguage("matlab",function(a){var b=[a.CNM,{cN:"string",b:"'",e:"'",c:[a.BE,{b:"''"}]}];return{k:{keyword:"break case catch classdef continue else elseif end enumerated events for function global if methods otherwise parfor persistent properties return spmd switch try while",built_in:"sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i inf nan isnan isinf isfinite j why compan gallery hadamard hankel hilb invhilb magic pascal rosser toeplitz vander wilkinson"},i:'(//|"|#|/\\*|\\s+/\\w+)',c:[{cN:"function",bK:"function",e:"$",c:[a.UTM,{cN:"params",b:"\\(",e:"\\)"},{cN:"params",b:"\\[",e:"\\]"}]},{cN:"transposed_variable",b:"[a-zA-Z_][a-zA-Z_0-9]*('+[\\.']*|[\\.']+)",e:"",r:0},{cN:"matrix",b:"\\[",e:"\\]'*[\\.']*",c:b,r:0},{cN:"cell",b:"\\{",e:"\\}'*[\\.']*",c:b,i:/:/},{cN:"comment",b:"\\%",e:"$"}].concat(b)}});hljs.registerLanguage("applescript",function(a){var b=a.inherit(a.QSM,{i:""});var d={cN:"params",b:"\\(",e:"\\)",c:["self",a.CNM,b]};var c=[{cN:"comment",b:"--",e:"$",},{cN:"comment",b:"\\(\\*",e:"\\*\\)",c:["self",{b:"--",e:"$"}]},a.HCM];return{k:{keyword:"about above after against and around as at back before beginning behind below beneath beside between but by considering contain contains continue copy div does eighth else end equal equals error every exit fifth first for fourth from front get given global if ignoring in into is it its last local me middle mod my ninth not of on onto or over prop property put ref reference repeat returning script second set seventh since sixth some tell tenth that the then third through thru timeout times to transaction try until where while whose with without",constant:"AppleScript false linefeed return pi quote result space tab true",type:"alias application boolean class constant date file integer list number real record string text",command:"activate beep count delay launch log offset read round run say summarize write",property:"character characters contents day frontmost id item length month name paragraph paragraphs rest reverse running time version weekday word words year"},c:[b,a.CNM,{cN:"type",b:"\\bPOSIX file\\b"},{cN:"command",b:"\\b(clipboard info|the clipboard|info for|list (disks|folder)|mount volume|path to|(close|open for) access|(get|set) eof|current date|do shell script|get volume settings|random number|set volume|system attribute|system info|time to GMT|(load|run|store) script|scripting components|ASCII (character|number)|localized string|choose (application|color|file|file name|folder|from list|remote application|URL)|display (alert|dialog))\\b|^\\s*return\\b"},{cN:"constant",b:"\\b(text item delimiters|current application|missing value)\\b"},{cN:"keyword",b:"\\b(apart from|aside from|instead of|out of|greater than|isn't|(doesn't|does not) (equal|come before|come after|contain)|(greater|less) than( or equal)?|(starts?|ends|begins?) with|contained by|comes (before|after)|a (ref|reference))\\b"},{cN:"property",b:"\\b(POSIX path|(date|time) string|quoted form)\\b"},{cN:"function_start",bK:"on",i:"[${=;\\n]",c:[a.UTM,d]}].concat(c),i:"//"}});hljs.registerLanguage("delphi",function(b){var a="exports register file shl array record property for mod while set ally label uses raise not stored class safecall var interface or private static exit index inherited to else stdcall override shr asm far resourcestring finalization packed virtual out and protected library do xorwrite goto near function end div overload object unit begin string on inline repeat until destructor write message program with read initialization except default nil if case cdecl in downto threadvar of try pascal const external constructor type public then implementation finally published procedure";var e={cN:"comment",v:[{b:/\{/,e:/\}/,r:0},{b:/\(\*/,e:/\*\)/,r:10}]};var c={cN:"string",b:/'/,e:/'/,c:[{b:/''/}]};var d={cN:"string",b:/(#\d+)+/};var f={b:b.IR+"\\s*=\\s*class\\s*\\(",rB:true,c:[b.TM]};var g={cN:"function",bK:"function constructor destructor procedure",e:/[:;]/,k:"function constructor|10 destructor|10 procedure|10",c:[b.TM,{cN:"params",b:/\(/,e:/\)/,k:a,c:[c,d]},e]};return{cI:true,k:a,i:/("|\$[G-Zg-z]|\/\*|<\/)/,c:[e,b.CLCM,c,d,b.NM,f,g]}});hljs.registerLanguage("cpp",function(a){var b={keyword:"false int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long throw volatile static protected bool template mutable if public friend do return goto auto void enum else break new extern using true class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype noexcept nullptr static_assert thread_local restrict _Bool complex _Complex _Imaginary",built_in:"std string cin cout cerr clog stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf"};return{aliases:["c"],k:b,i:"</",c:[a.CLCM,a.CBLCLM,a.QSM,{cN:"string",b:"'\\\\?.",e:"'",i:"."},{cN:"number",b:"\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)"},a.CNM,{cN:"preprocessor",b:"#",e:"$",c:[{b:"include\\s*<",e:">",i:"\\n"},a.CLCM]},{cN:"stl_container",b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:b,r:10,c:["self"]}]}});hljs.registerLanguage("json",function(a){var e={literal:"true false null"};var d=[a.QSM,a.CNM];var c={cN:"value",e:",",eW:true,eE:true,c:d,k:e};var b={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:true,eE:true,c:[a.BE],i:"\\n",starts:c}],i:"\\S"};var f={b:"\\[",e:"\\]",c:[a.inherit(c,{cN:null})],i:"\\S"};d.splice(d.length,0,b,f);return{c:d,k:e,i:"\\S"}});hljs.registerLanguage("perl",function(c){var d="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when";var f={cN:"subst",b:"[$@]\\{",e:"\\}",k:d};var g={b:"->{",e:"}"};var a={cN:"variable",v:[{b:/\$\d/},{b:/[\$\%\@\*](\^\w\b|#\w+(\:\:\w+)*|{\w+}|\w+(\:\:\w*)*)/},{b:/[\$\%\@\*][^\s\w{]/,r:0}]};var e={cN:"comment",b:"^(__END__|__DATA__)",e:"\\n$",r:5};var h=[c.BE,f,a];var b=[a,c.HCM,e,{cN:"comment",b:"^\\=\\w",e:"\\=cut",eW:true},g,{cN:"string",c:h,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[c.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[c.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+c.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[c.HCM,e,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[c.BE],r:0}]},{cN:"sub",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",r:5},{cN:"operator",b:"-\\w\\b",r:0}];f.c=b;g.c=b;return{k:d,c:b}});hljs.registerLanguage("markdown",function(a){return{c:[{cN:"header",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"blockquote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"`.+?`"},{b:"^( {4}|\t)",e:"$",r:0}]},{cN:"horizontal_rule",b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].+?[\\)\\]]",rB:true,c:[{cN:"link_label",b:"\\[",e:"\\]",eB:true,rE:true,r:0},{cN:"link_url",b:"\\]\\(",e:"\\)",eB:true,eE:true},{cN:"link_reference",b:"\\]\\[",e:"\\]",eB:true,eE:true,}],r:10},{b:"^\\[.+\\]:",e:"$",rB:true,c:[{cN:"link_reference",b:"\\[",e:"\\]",eB:true,eE:true},{cN:"link_url",b:"\\s",e:"$"}]}]}});hljs.registerLanguage("ocaml",function(a){return{k:{keyword:"and as assert asr begin class constraint do done downto else end exception external false for fun function functor if in include inherit initializer land lazy let lor lsl lsr lxor match method mod module mutable new object of open or private rec ref sig struct then to true try type val virtual when while with parser value",built_in:"bool char float int list unit array exn option int32 int64 nativeint format4 format6 lazy_t in_channel out_channel string",},i:/\/\//,c:[{cN:"string",b:'"""',e:'"""'},{cN:"comment",b:"\\(\\*",e:"\\*\\)",c:["self"]},{cN:"class",bK:"type",e:"\\(|=|$",c:[a.UTM]},{cN:"annotation",b:"\\[<",e:">\\]"},a.CBLCLM,a.inherit(a.ASM,{i:null}),a.inherit(a.QSM,{i:null}),a.CNM]}});hljs.registerLanguage("d",function(x){var b={keyword:"abstract alias align asm assert auto body break byte case cast catch class const continue debug default delete deprecated do else enum export extern final finally for foreach foreach_reverse|10 goto if immutable import in inout int interface invariant is lazy macro mixin module new nothrow out override package pragma private protected public pure ref return scope shared static struct super switch synchronized template this throw try typedef typeid typeof union unittest version void volatile while with __FILE__ __LINE__ __gshared|10 __thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ __VERSION__",built_in:"bool cdouble cent cfloat char creal dchar delegate double dstring float function idouble ifloat ireal long real short string ubyte ucent uint ulong ushort wchar wstring",literal:"false null true"};var c="(0|[1-9][\\d_]*)",q="(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)",h="0[bB][01_]+",v="([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*)",y="0[xX]"+v,p="([eE][+-]?"+q+")",o="("+q+"(\\.\\d*|"+p+")|\\d+\\."+q+q+"|\\."+c+p+"?)",k="(0[xX]("+v+"\\."+v+"|\\.?"+v+")[pP][+-]?"+q+")",l="("+c+"|"+h+"|"+y+")",n="("+k+"|"+o+")";var z="\\\\(['\"\\?\\\\abfnrtv]|u[\\dA-Fa-f]{4}|[0-7]{1,3}|x[\\dA-Fa-f]{2}|U[\\dA-Fa-f]{8})|&[a-zA-Z\\d]{2,};";var m={cN:"number",b:"\\b"+l+"(L|u|U|Lu|LU|uL|UL)?",r:0};var j={cN:"number",b:"\\b("+n+"([fF]|L|i|[fF]i|Li)?|"+l+"(i|[fF]i|Li))",r:0};var s={cN:"string",b:"'("+z+"|.)",e:"'",i:"."};var r={b:z,r:0};var w={cN:"string",b:'"',c:[r],e:'"[cwd]?'};var f={cN:"string",b:'[rq]"',e:'"[cwd]?',r:5};var u={cN:"string",b:"`",e:"`[cwd]?"};var i={cN:"string",b:'x"[\\da-fA-F\\s\\n\\r]*"[cwd]?',r:10};var t={cN:"string",b:'q"\\{',e:'\\}"'};var e={cN:"shebang",b:"^#!",e:"$",r:5};var g={cN:"preprocessor",b:"#(line)",e:"$",r:5};var d={cN:"keyword",b:"@[a-zA-Z_][a-zA-Z_\\d]*"};var a={cN:"comment",b:"\\/\\+",c:["self"],e:"\\+\\/",r:10};return{l:x.UIR,k:b,c:[x.CLCM,x.CBLCLM,a,i,w,f,u,t,j,m,s,e,g,d]}});hljs.registerLanguage("coffeescript",function(c){var b={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",reserved:"case default function var void with const let enum export import native __hasProp __extends __slice __bind __indexOf",built_in:"npm require console print module exports global window document"};var a="[A-Za-z$_][0-9A-Za-z$_]*";var f=c.inherit(c.TM,{b:a});var e={cN:"subst",b:/#\{/,e:/}/,k:b};var d=[c.BNM,c.inherit(c.CNM,{starts:{e:"(\\s*/)?",r:0}}),{cN:"string",v:[{b:/'''/,e:/'''/,c:[c.BE]},{b:/'/,e:/'/,c:[c.BE]},{b:/"""/,e:/"""/,c:[c.BE,e]},{b:/"/,e:/"/,c:[c.BE,e]}]},{cN:"regexp",v:[{b:"///",e:"///",c:[e,c.HCM]},{b:"//[gim]*",r:0},{b:"/\\S(\\\\.|[^\\n])*?/[gim]*(?=\\s|\\W|$)"}]},{cN:"property",b:"@"+a},{b:"`",e:"`",eB:true,eE:true,sL:"javascript"}];e.c=d;return{k:b,c:d.concat([{cN:"comment",b:"###",e:"###"},c.HCM,{cN:"function",b:"("+a+"\\s*=\\s*)?(\\(.*\\))?\\s*\\B[-=]>",e:"[-=]>",rB:true,c:[f,{cN:"params",b:"\\(",rB:true,c:[{b:/\(/,e:/\)/,k:b,c:["self"].concat(d)}]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:true,i:/[:="\[\]]/,c:[f]},f]},{cN:"attribute",b:a+":",e:":",rB:true,eE:true,r:0}])}});hljs.registerLanguage("lua",function(b){var a="\\[=*\\[";var e="\\]=*\\]";var c={b:a,e:e,c:["self"]};var d=[{cN:"comment",b:"--(?!"+a+")",e:"$"},{cN:"comment",b:"--"+a,e:e,c:[c],r:10}];return{l:b.UIR,k:{keyword:"and break do else elseif end false for if in local nil not or repeat return then true until while",built_in:"_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall coroutine debug io math os package string table"},c:d.concat([{cN:"function",bK:"function",e:"\\)",c:[b.inherit(b.TM,{b:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{cN:"params",b:"\\(",eW:true,c:d}].concat(d)},b.CNM,b.ASM,b.QSM,{cN:"string",b:a,e:e,c:[c],r:10}])}});hljs.registerLanguage("makefile",function(a){var b={cN:"variable",b:/\$\(/,e:/\)/,c:[a.BE]};return{c:[a.HCM,{b:/^\w+\s*\W*=/,rB:true,r:0,starts:{cN:"constant",e:/\s*\W*=/,eE:true,starts:{e:/$/,r:0,c:[b],}}},{cN:"title",b:/^[\w]+:\s*$/},{cN:"phony",b:/^\.PHONY:/,e:/$/,k:".PHONY",l:/[\.\w]+/},{b:/^\t+/,e:/$/,c:[a.QSM,b]}]}});hljs.registerLanguage("rsl",function(a){return{k:{keyword:"float color point normal vector matrix while for if do return else break extern continue",built_in:"abs acos ambient area asin atan atmosphere attribute calculatenormal ceil cellnoise clamp comp concat cos degrees depth Deriv diffuse distance Du Dv environment exp faceforward filterstep floor format fresnel incident length lightsource log match max min mod noise normalize ntransform opposite option phong pnoise pow printf ptlined radians random reflect refract renderinfo round setcomp setxcomp setycomp setzcomp shadow sign sin smoothstep specular specularbrdf spline sqrt step tan texture textureinfo trace transform vtransform xcomp ycomp zcomp"},i:"</",c:[a.CLCM,a.CBLCLM,a.QSM,a.ASM,a.CNM,{cN:"preprocessor",b:"#",e:"$"},{cN:"shader",bK:"surface displacement light volume imager",e:"\\("},{cN:"shading",bK:"illuminate illuminance gather",e:"\\("}]}});hljs.registerLanguage("vbscript",function(a){return{cI:true,k:{keyword:"call class const dim do loop erase execute executeglobal exit for each next function if then else on error option explicit new private property let get public randomize redim rem select case set stop sub while wend with end to elseif is or xor and not class_initialize class_terminate default preserve in me byval byref step resume goto",built_in:"lcase month vartype instrrev ubound setlocale getobject rgb getref string weekdayname rnd dateadd monthname now day minute isarray cbool round formatcurrency conversions csng timevalue second year space abs clng timeserial fixs len asc isempty maths dateserial atn timer isobject filter weekday datevalue ccur isdate instr datediff formatdatetime replace isnull right sgn array snumeric log cdbl hex chr lbound msgbox ucase getlocale cos cdate cbyte rtrim join hour oct typename trim strcomp int createobject loadpicture tan formatnumber mid scriptenginebuildversion scriptengine split scriptengineminorversion cint sin datepart ltrim sqr scriptenginemajorversion time derived eval date formatpercent exp inputbox left ascw chrw regexp server response request cstr err",literal:"true false null nothing empty"},i:"//",c:[a.inherit(a.QSM,{c:[{b:'""'}]}),{cN:"comment",b:/'/,e:/$/,r:0},a.CNM]}});hljs.registerLanguage("go",function(a){var b={keyword:"break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer",constant:"true false iota nil",typename:"bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune",built_in:"append cap close complex copy imag len make new panic print println real recover delete"};return{aliases:["golang"],k:b,i:"</",c:[a.CLCM,a.CBLCLM,a.QSM,{cN:"string",b:"'",e:"[^\\\\]'"},{cN:"string",b:"`",e:"`"},{cN:"number",b:"[^a-zA-Z_0-9](\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?",r:0},a.CNM]}});hljs.registerLanguage("axapta",function(a){return{k:"false int abstract private char boolean static null if for true while long throw finally protected final return void enum else break new catch byte super case short default double public try this switch continue reverse firstfast firstonly forupdate nofetch sum avg minof maxof count order group by asc desc index hint like dispaly edit client server ttsbegin ttscommit str real date container anytype common div mod",c:[a.CLCM,a.CBLCLM,a.ASM,a.QSM,a.CNM,{cN:"preprocessor",b:"#",e:"$"},{cN:"class",bK:"class interface",e:"{",i:":",c:[{cN:"inheritance",bK:"extends implements",r:10},a.UTM]}]}});hljs.registerLanguage("vala",function(a){return{k:{keyword:"char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double bool struct enum string void weak unowned owned async signal static abstract interface override while do for foreach else switch case break default return try catch public private protected internal using new this get set const stdout stdin stderr var",built_in:"DBus GLib CCode Gee Object",literal:"false true null"},c:[{cN:"class",bK:"class interface delegate namespace",e:"{",i:"[^,:\\n\\s\\.]",c:[a.UTM]},a.CLCM,a.CBLCLM,{cN:"string",b:'"""',e:'"""',r:5},a.ASM,a.QSM,a.CNM,{cN:"preprocessor",b:"^#",e:"$",r:2},{cN:"constant",b:" [A-Z_]+ ",r:0}]}});hljs.registerLanguage("erlang",function(i){var c="[a-z'][a-zA-Z0-9_']*";var o="("+c+":"+c+"|"+c+")";var f={keyword:"after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun let not of orelse|10 query receive rem try when xor",literal:"false true"};var l={cN:"comment",b:"%",e:"$",r:0};var e={cN:"number",b:"\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)",r:0};var g={b:"fun\\s+"+c+"/\\d+"};var n={b:o+"\\(",e:"\\)",rB:true,r:0,c:[{cN:"function_name",b:o,r:0},{b:"\\(",e:"\\)",eW:true,rE:true,r:0}]};var h={cN:"tuple",b:"{",e:"}",r:0};var a={cN:"variable",b:"\\b_([A-Z][A-Za-z0-9_]*)?",r:0};var m={cN:"variable",b:"[A-Z][a-zA-Z0-9_]*",r:0};var b={b:"#"+i.UIR,r:0,rB:true,c:[{cN:"record_name",b:"#"+i.UIR,r:0},{b:"{",e:"}",r:0}]};var k={bK:"fun receive if try case",e:"end",k:f};k.c=[l,g,i.inherit(i.ASM,{cN:""}),k,n,i.QSM,e,h,a,m,b];var j=[l,g,k,n,i.QSM,e,h,a,m,b];n.c[1].c=j;h.c=j;b.c[1].c=j;var d={cN:"params",b:"\\(",e:"\\)",c:j};return{k:f,i:"(</|\\*=|\\+=|-=|/=|/\\*|\\*/|\\(\\*|\\*\\))",c:[{cN:"function",b:"^"+c+"\\s*\\(",e:"->",rB:true,i:"\\(|#|//|/\\*|\\\\|:|;",c:[d,i.inherit(i.TM,{b:c})],starts:{e:";|\\.",k:f,c:j}},l,{cN:"pp",b:"^-",e:"\\.",r:0,eE:true,rB:true,l:"-"+i.IR,k:"-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn -import -include -include_lib -compile -define -else -endif -file -behaviour -behavior",c:[d]},e,i.QSM,b,a,m,h]}});hljs.registerLanguage("sql",function(a){return{cI:true,i:/[<>]/,c:[{cN:"operator",b:"\\b(begin|end|start|commit|rollback|savepoint|lock|alter|create|drop|rename|call|delete|do|handler|insert|load|replace|select|truncate|update|set|show|pragma|grant|merge)\\b(?!:)",e:";",eW:true,k:{keyword:"all partial global month current_timestamp using go revoke smallint indicator end-exec disconnect zone with character assertion to add current_user usage input local alter match collate real then rollback get read timestamp session_user not integer bit unique day minute desc insert execute like ilike|2 level decimal drop continue isolation found where constraints domain right national some module transaction relative second connect escape close system_user for deferred section cast current sqlstate allocate intersect deallocate numeric public preserve full goto initially asc no key output collation group by union session both last language constraint column of space foreign deferrable prior connection unknown action commit view or first into float year primary cascaded except restrict set references names table outer open select size are rows from prepare distinct leading create only next inner authorization schema corresponding option declare precision immediate else timezone_minute external varying translation true case exception join hour default double scroll value cursor descriptor values dec fetch procedure delete and false int is describe char as at in varchar null trailing any absolute current_time end grant privileges when cross check write current_date pad begin temporary exec time update catalog user sql date on identity timezone_hour natural whenever interval work order cascade diagnostics nchar having left call do handler load replace truncate start lock show pragma exists number trigger if before after each row merge matched database",aggregate:"count sum min max avg"},c:[{cN:"string",b:"'",e:"'",c:[a.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[a.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[a.BE]},a.CNM]},a.CBLCLM,{cN:"comment",b:"--",e:"$"}]}});hljs.registerLanguage("mizar",function(a){return{k:["environ vocabularies notations constructors definitions registrations theorems schemes requirements","begin end definition registration cluster existence pred func defpred deffunc theorem proof","let take assume then thus hence ex for st holds consider reconsider such that and in provided of as from","be being by means equals implies iff redefine define now not or attr is mode suppose per cases set","thesis contradiction scheme reserve struct","correctness compatibility coherence symmetry assymetry reflexivity irreflexivity","connectedness uniqueness commutativity idempotence involutiveness projectivity"].join(" "),c:[{cN:"comment",b:"::",e:"$"}]}});hljs.registerLanguage("lasso",function(d){var b="[a-zA-Z_][a-zA-Z0-9_.]*";var i="<\\?(lasso(script)?|=)";var c="\\]|\\?>";var g={literal:"true false none minimal full all void and or not bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft",built_in:"array date decimal duration integer map pair string tag xml null bytes list queue set stack staticarray tie local var variable global data self inherited",keyword:"error_code error_msg error_pop error_push error_reset cache database_names database_schemanames database_tablenames define_tag define_type email_batch encode_set html_comment handle handle_error header if inline iterate ljax_target link link_currentaction link_currentgroup link_currentrecord link_detail link_firstgroup link_firstrecord link_lastgroup link_lastrecord link_nextgroup link_nextrecord link_prevgroup link_prevrecord log loop namespace_using output_none portal private protect records referer referrer repeating resultset rows search_args search_arguments select sort_args sort_arguments thread_atomic value_list while abort case else if_empty if_false if_null if_true loop_abort loop_continue loop_count params params_up return return_value run_children soap_definetag soap_lastrequest soap_lastresponse tag_name ascending average by define descending do equals frozen group handle_failure import in into join let match max min on order parent protected provide public require returnhome skip split_thread sum take thread to trait type where with yield yieldhome"};var a={cN:"comment",b:"<!--",e:"-->",r:0};var j={cN:"preprocessor",b:"\\[noprocess\\]",starts:{cN:"markup",e:"\\[/noprocess\\]",rE:true,c:[a]}};var e={cN:"preprocessor",b:"\\[/noprocess|"+i};var h={cN:"variable",b:"'"+b+"'"};var f=[d.CLCM,{cN:"javadoc",b:"/\\*\\*!",e:"\\*/"},d.CBLCLM,d.inherit(d.CNM,{b:d.CNR+"|-?(infinity|nan)\\b"}),d.inherit(d.ASM,{i:null}),d.inherit(d.QSM,{i:null}),{cN:"string",b:"`",e:"`"},{cN:"variable",v:[{b:"[#$]"+b},{b:"#",e:"\\d+",i:"\\W"}]},{cN:"tag",b:"::\\s*",e:b,i:"\\W"},{cN:"attribute",b:"\\.\\.\\.|-"+d.UIR},{cN:"subst",v:[{b:"->\\s*",c:[h]},{b:":=|/(?!\\w)=?|[-+*%=<>&|!?\\\\]+",r:0}]},{cN:"built_in",b:"\\.\\.?",r:0,c:[h]},{cN:"class",bK:"define",rE:true,e:"\\(|=>",c:[d.inherit(d.TM,{b:d.UIR+"(=(?!>))?"})]}];return{aliases:["ls","lassoscript"],cI:true,l:b+"|&[lg]t;",k:g,c:[{cN:"preprocessor",b:c,r:0,starts:{cN:"markup",e:"\\[|"+i,rE:true,r:0,c:[a]}},j,e,{cN:"preprocessor",b:"\\[no_square_brackets",starts:{e:"\\[/no_square_brackets\\]",l:b+"|&[lg]t;",k:g,c:[{cN:"preprocessor",b:c,r:0,starts:{cN:"markup",e:i,rE:true,c:[a]}},j,e].concat(f)}},{cN:"preprocessor",b:"\\[",r:0},{cN:"shebang",b:"^#!.+lasso9\\b",r:10}].concat(f)}});hljs.registerLanguage("r",function(a){var b="([a-zA-Z]|\\.[a-zA-Z.])[a-zA-Z0-9._]*";return{c:[a.HCM,{b:b,l:b,k:{keyword:"function if in break next repeat else for return switch while try tryCatch|10 stop warning require library attach detach source setMethod setGeneric setGroupGeneric setClass ...|10",literal:"NULL NA TRUE FALSE T F Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10"},r:0},{cN:"number",b:"0[xX][0-9a-fA-F]+[Li]?\\b",r:0},{cN:"number",b:"\\d+(?:[eE][+\\-]?\\d*)?L\\b",r:0},{cN:"number",b:"\\d+\\.(?!\\d)(?:i\\b)?",r:0},{cN:"number",b:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{cN:"number",b:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{b:"`",e:"`",r:0},{cN:"string",c:[a.BE],v:[{b:'"',e:'"'},{b:"'",e:"'"}]}]}});hljs.registerLanguage("scala",function(a){var c={cN:"annotation",b:"@[A-Za-z]+"};var b={cN:"string",b:'u?r?"""',e:'"""',r:10};return{k:"type yield lazy override def with val var false true sealed abstract private trait object null if for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws",c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",c:[{cN:"javadoctag",b:"@[A-Za-z]+"}],r:10},a.CLCM,a.CBLCLM,b,a.ASM,a.QSM,{cN:"class",b:"((case )?class |object |trait )",e:"({|$)",i:":",k:"case class trait object",c:[{bK:"extends with",r:10},a.UTM,{cN:"params",b:"\\(",e:"\\)",c:[a.ASM,a.QSM,b,c]}]},a.CNM,c]}});hljs.registerLanguage("livecodeserver",function(a){var e={cN:"variable",b:"\\b[gtps][A-Z]+[A-Za-z0-9_\\-]*\\b|\\$_[A-Z]+",r:0};var b={cN:"comment",e:"$",v:[a.CBLCLM,a.HCM,{b:"--",},{b:"[^:]//",}]};var d=a.inherit(a.TM,{v:[{b:"\\b_*rig[A-Z]+[A-Za-z0-9_\\-]*"},{b:"\\b_[a-z0-9\\-]+"}]});var c=a.inherit(a.TM,{b:"\\b([A-Za-z0-9_\\-]+)\\b"});return{cI:false,k:{keyword:"after byte bytes english the until http forever descending using line real8 with seventh for stdout finally element word fourth before black ninth sixth characters chars stderr uInt1 uInt1s uInt2 uInt2s stdin string lines relative rel any fifth items from middle mid at else of catch then third it file milliseconds seconds second secs sec int1 int1s int4 int4s internet int2 int2s normal text item last long detailed effective uInt4 uInt4s repeat end repeat URL in try into switch to words https token binfile each tenth as ticks tick system real4 by dateItems without char character ascending eighth whole dateTime numeric short first ftp integer abbreviated abbr abbrev private case while if",constant:"SIX TEN FORMFEED NINE ZERO NONE SPACE FOUR FALSE COLON CRLF PI COMMA ENDOFFILE EOF EIGHT FIVE QUOTE EMPTY ONE TRUE RETURN CR LINEFEED RIGHT BACKSLASH NULL SEVEN TAB THREE TWO six ten formfeed nine zero none space four false colon crlf pi comma endoffile eof eight five quote empty one true return cr linefeed right backslash null seven tab three two RIVERSION RISTATE FILE_READ_MODE FILE_WRITE_MODE FILE_WRITE_MODE DIR_WRITE_MODE FILE_READ_UMASK FILE_WRITE_UMASK DIR_READ_UMASK DIR_WRITE_UMASK",operator:"div mod wrap and or bitAnd bitNot bitOr bitXor among not in a an within contains ends with begins the keys of keys",built_in:"put abs acos aliasReference annuity arrayDecode arrayEncode asin atan atan2 average avg base64Decode base64Encode baseConvert binaryDecode binaryEncode byteToNum cachedURL cachedURLs charToNum cipherNames commandNames compound compress constantNames cos date dateFormat decompress directories diskSpace DNSServers exp exp1 exp2 exp10 extents files flushEvents folders format functionNames global globals hasMemory hostAddress hostAddressToName hostName hostNameToAddress isNumber ISOToMac itemOffset keys len length libURLErrorData libUrlFormData libURLftpCommand libURLLastHTTPHeaders libURLLastRHHeaders libUrlMultipartFormAddPart libUrlMultipartFormData libURLVersion lineOffset ln ln1 localNames log log2 log10 longFilePath lower macToISO matchChunk matchText matrixMultiply max md5Digest median merge millisec millisecs millisecond milliseconds min monthNames num number numToByte numToChar offset open openfiles openProcesses openProcessIDs openSockets paramCount param params peerAddress pendingMessages platform processID random randomBytes replaceText result revCreateXMLTree revCreateXMLTreeFromFile revCurrentRecord revCurrentRecordIsFirst revCurrentRecordIsLast revDatabaseColumnCount revDatabaseColumnIsNull revDatabaseColumnLengths revDatabaseColumnNames revDatabaseColumnNamed revDatabaseColumnNumbered revDatabaseColumnTypes revDatabaseConnectResult revDatabaseCursors revDatabaseID revDatabaseTableNames revDatabaseType revDataFromQuery revdb_closeCursor revdb_columnbynumber revdb_columncount revdb_columnisnull revdb_columnlengths revdb_columnnames revdb_columntypes revdb_commit revdb_connect revdb_connections revdb_connectionerr revdb_currentrecord revdb_cursorconnection revdb_cursorerr revdb_cursors revdb_dbtype revdb_disconnect revdb_execute revdb_iseof revdb_isbof revdb_movefirst revdb_movelast revdb_movenext revdb_moveprev revdb_query revdb_querylist revdb_recordcount revdb_rollback revdb_tablenames revGetDatabaseDriverPath revNumberOfRecords revOpenDatabase revOpenDatabases revQueryDatabase revQueryDatabaseBlob revQueryResult revQueryIsAtStart revQueryIsAtEnd revUnixFromMacPath revXMLAttribute revXMLAttributes revXMLAttributeValues revXMLChildContents revXMLChildNames revXMLFirstChild revXMLMatchingNode revXMLNextSibling revXMLNodeContents revXMLNumberOfChildren revXMLParent revXMLPreviousSibling revXMLRootNode revXMLRPC_CreateRequest revXMLRPC_Documents revXMLRPC_Error revXMLRPC_Execute revXMLRPC_GetHost revXMLRPC_GetMethod revXMLRPC_GetParam revXMLText revXMLRPC_GetParamCount revXMLRPC_GetParamNode revXMLRPC_GetParamType revXMLRPC_GetPath revXMLRPC_GetPort revXMLRPC_GetProtocol revXMLRPC_GetRequest revXMLRPC_GetResponse revXMLRPC_GetSocket revXMLTree revXMLTrees revXMLValidateDTD revZipDescribeItem revZipEnumerateItems revZipOpenArchives round sec secs seconds sha1Digest shell shortFilePath sin specialFolderPath sqrt standardDeviation statRound stdDev sum sysError systemVersion tan tempName tick ticks time to toLower toUpper transpose trunc uniDecode uniEncode upper URLDecode URLEncode URLStatus value variableNames version waitDepth weekdayNames wordOffset add breakpoint cancel clear local variable file word line folder directory URL close socket process combine constant convert create new alias folder directory decrypt delete variable word line folder directory URL dispatch divide do encrypt filter get include intersect kill libURLDownloadToFile libURLFollowHttpRedirects libURLftpUpload libURLftpUploadFile libURLresetAll libUrlSetAuthCallback libURLSetCustomHTTPHeaders libUrlSetExpect100 libURLSetFTPListCommand libURLSetFTPMode libURLSetFTPStopTime libURLSetStatusCallback load multiply socket process post seek rel relative read from process rename replace require resetAll revAddXMLNode revAppendXML revCloseCursor revCloseDatabase revCommitDatabase revCopyFile revCopyFolder revCopyXMLNode revDeleteFolder revDeleteXMLNode revDeleteAllXMLTrees revDeleteXMLTree revExecuteSQL revGoURL revInsertXMLNode revMoveFolder revMoveToFirstRecord revMoveToLastRecord revMoveToNextRecord revMoveToPreviousRecord revMoveToRecord revMoveXMLNode revPutIntoXMLNode revRollBackDatabase revSetDatabaseDriverPath revSetXMLAttribute revXMLRPC_AddParam revXMLRPC_DeleteAllDocuments revXMLAddDTD revXMLRPC_Free revXMLRPC_FreeAll revXMLRPC_DeleteDocument revXMLRPC_DeleteParam revXMLRPC_SetHost revXMLRPC_SetMethod revXMLRPC_SetPort revXMLRPC_SetProtocol revXMLRPC_SetSocket revZipAddItemWithData revZipAddItemWithFile revZipAddUncompressedItemWithData revZipAddUncompressedItemWithFile revZipCancel revZipCloseArchive revZipDeleteItem revZipExtractItemToFile revZipExtractItemToVariable revZipSetProgressCallback revZipRenameItem revZipReplaceItemWithData revZipReplaceItemWithFile revZipOpenArchive send set sort split subtract union unload wait write"},c:[e,{cN:"keyword",b:"\\bend\\sif\\b"},{cN:"function",bK:"function",e:"$",c:[e,c,a.ASM,a.QSM,a.BNM,a.CNM,d]},{cN:"function",bK:"end",e:"$",c:[c,d]},{cN:"command",bK:"command on",e:"$",c:[e,c,a.ASM,a.QSM,a.BNM,a.CNM,d]},{cN:"command",bK:"end",e:"$",c:[c,d]},{cN:"preprocessor",b:"<\\?rev|<\\?lc|<\\?livecode",r:10},{cN:"preprocessor",b:"<\\?"},{cN:"preprocessor",b:"\\?>"},b,a.ASM,a.QSM,a.BNM,a.CNM,d],i:";$|^\\[|^="}});hljs.registerLanguage("profile",function(a){return{c:[a.CNM,{cN:"built_in",b:"{",e:"}$",eB:true,eE:true,c:[a.ASM,a.QSM],r:0},{cN:"filename",b:"[a-zA-Z_][\\da-zA-Z_]+\\.[\\da-zA-Z_]{1,3}",e:":",eE:true},{cN:"header",b:"(ncalls|tottime|cumtime)",e:"$",k:"ncalls tottime|10 cumtime|10 filename",r:10},{cN:"summary",b:"function calls",e:"$",c:[a.CNM],r:10},a.ASM,a.QSM,{cN:"function",b:"\\(",e:"\\)$",c:[a.UTM],r:0}]}});hljs.registerLanguage("php",function(b){var e={cN:"variable",b:"\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*"};var a={cN:"preprocessor",b:/<\?(php)?|\?>/};var c={cN:"string",c:[b.BE,a],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},b.inherit(b.ASM,{i:null}),b.inherit(b.QSM,{i:null})]};var d={v:[b.BNM,b.CNM]};return{cI:true,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[b.CLCM,b.HCM,{cN:"comment",b:"/\\*",e:"\\*/",c:[{cN:"phpdoc",b:"\\s@[A-Za-z]+"},a]},{cN:"comment",b:"__halt_compiler.+?;",eW:true,k:"__halt_compiler",l:b.UIR},{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[b.BE]},a,e,{cN:"function",bK:"function",e:/[;{]/,i:"\\$|\\[|%",c:[b.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",e,b.CBLCLM,c,d]}]},{cN:"class",bK:"class interface",e:"{",i:/[:\(\$"]/,c:[{bK:"extends implements",r:10},b.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[b.UTM]},{bK:"use",e:";",c:[b.UTM]},{b:"=>"},c,d]}});hljs.registerLanguage("parser3",function(a){return{sL:"xml",r:0,c:[{cN:"comment",b:"^#",e:"$"},{cN:"comment",b:"\\^rem{",e:"}",r:10,c:[{b:"{",e:"}",c:["self"]}]},{cN:"preprocessor",b:"^@(?:BASE|USE|CLASS|OPTIONS)$",r:10},{cN:"title",b:"@[\\w\\-]+\\[[\\w^;\\-]*\\](?:\\[[\\w^;\\-]*\\])?(?:.*)$"},{cN:"variable",b:"\\$\\{?[\\w\\-\\.\\:]+\\}?"},{cN:"keyword",b:"\\^[\\w\\-\\.\\:]+"},{cN:"number",b:"\\^#[0-9a-fA-F]+"},a.CNM]}});hljs.registerLanguage("actionscript",function(a){var c="[a-zA-Z_$][a-zA-Z0-9_$]*";var b="([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)";var d={cN:"rest_arg",b:"[.]{3}",e:c,r:10};return{k:{keyword:"as break case catch class const continue default delete do dynamic each else extends final finally for function get if implements import in include instanceof interface internal is namespace native new override package private protected public return set static super switch this throw try typeof use var void while with",literal:"true false null undefined"},c:[a.ASM,a.QSM,a.CLCM,a.CBLCLM,a.CNM,{cN:"package",bK:"package",e:"{",c:[a.TM]},{cN:"class",bK:"class interface",e:"{",c:[{bK:"extends implements"},a.TM]},{cN:"preprocessor",bK:"import include",e:";"},{cN:"function",bK:"function",e:"[{;]",i:"\\S",c:[a.TM,{cN:"params",b:"\\(",e:"\\)",c:[a.ASM,a.QSM,a.CLCM,a.CBLCLM,d]},{cN:"type",b:":",e:b,r:10}]}]}});hljs.registerLanguage("nginx",function(c){var b={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+c.UIR}]};var a={eW:true,l:"[a-z/_]+",k:{built_in:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[c.HCM,{cN:"string",c:[c.BE,b],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{cN:"url",b:"([a-z]+):/",e:"\\s",eW:true,eE:true},{cN:"regexp",c:[c.BE,b],v:[{b:"\\s\\^",e:"\\s|{|;",rE:true},{b:"~\\*?\\s+",e:"\\s|{|;",rE:true},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},b]};return{c:[c.HCM,{b:c.UIR+"\\s",e:";|{",rB:true,c:[c.inherit(c.UTM,{starts:a})],r:0}],i:"[^\\s\\}]"}});hljs.registerLanguage("vhdl",function(a){return{cI:true,k:{keyword:"abs access after alias all and architecture array assert attribute begin block body buffer bus case component configuration constant context cover disconnect downto default else elsif end entity exit fairness file for force function generate generic group guarded if impure in inertial inout is label library linkage literal loop map mod nand new next nor not null of on open or others out package port postponed procedure process property protected pure range record register reject release rem report restrict restrict_guarantee return rol ror select sequence severity shared signal sla sll sra srl strong subtype then to transport type unaffected units until use variable vmode vprop vunit wait when while with xnor xor",typename:"boolean bit character severity_level integer time delay_length natural positive string bit_vector file_open_kind file_open_status std_ulogic std_ulogic_vector std_logic std_logic_vector unsigned signed boolean_vector integer_vector real_vector time_vector"},i:"{",c:[a.CBLCLM,{cN:"comment",b:"--",e:"$"},a.QSM,a.CNM,{cN:"literal",b:"'(U|X|0|1|Z|W|L|H|-)'",c:[a.BE]},{cN:"attribute",b:"'[A-Za-z](_?[A-Za-z0-9])*",c:[a.BE]}]}});hljs.registerLanguage("fix",function(a){return{c:[{b:/[^\u2401\u0001]+/,e:/[\u2401\u0001]/,eE:true,rB:true,rE:false,c:[{b:/([^\u2401\u0001=]+)/,e:/=([^\u2401\u0001=]+)/,rE:true,rB:false,cN:"attribute"},{b:/=/,e:/([\u2401\u0001])/,eE:true,eB:true,cN:"string"}]}],cI:true}});hljs.registerLanguage("diff",function(a){return{c:[{cN:"chunk",r:10,v:[{b:/^\@\@ +\-\d+,\d+ +\+\d+,\d+ +\@\@$/},{b:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{b:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{cN:"header",v:[{b:/Index: /,e:/$/},{b:/=====/,e:/=====$/},{b:/^\-\-\-/,e:/$/},{b:/^\*{3} /,e:/$/},{b:/^\+\+\+/,e:/$/},{b:/\*{5}/,e:/\*{5}$/}]},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}});hljs.registerLanguage("smalltalk",function(a){var b="[a-z][a-zA-Z0-9_]*";var d={cN:"char",b:"\\$.{1}"};var c={cN:"symbol",b:"#"+a.UIR};return{k:"self super nil true false thisContext",c:[{cN:"comment",b:'"',e:'"'},a.ASM,{cN:"class",b:"\\b[A-Z][A-Za-z0-9_]*",r:0},{cN:"method",b:b+":",r:0},a.CNM,c,d,{cN:"localvars",b:"\\|[ ]*"+b+"([ ]+"+b+")*[ ]*\\|",rB:true,e:/\|/,i:/\S/,c:[{b:"(\\|[ ]*)?"+b}]},{cN:"array",b:"\\#\\(",e:"\\)",c:[a.ASM,d,a.CNM,c]}]}});hljs.registerLanguage("clojure",function(l){var e={built_in:"def cond apply if-not if-let if not not= = < < > <= <= >= == + / * - rem quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last drop-while while intern condp case reduced cycle split-at split-with repeat replicate iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter monitor-exit defmacro defn defn- macroexpand macroexpand-1 for dosync and or when when-not when-let comp juxt partial sequence memoize constantly complement identity assert peek pop doto proxy defstruct first rest cons defprotocol cast coll deftype defrecord last butlast sigs reify second ffirst fnext nfirst nnext defmulti defmethod meta with-meta ns in-ns create-ns import refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! new next conj set! to-array future future-call into-array aset gen-class reduce map filter find empty hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize"};var f="[a-zA-Z_0-9\\!\\.\\?\\-\\+\\*\\/\\<\\=\\>\\&\\#\\$';]+";var a="[\\s:\\(\\{]+\\d+(\\.\\d+)?";var d={cN:"number",b:a,r:0};var j=l.inherit(l.QSM,{i:null});var o={cN:"comment",b:";",e:"$",r:0};var n={cN:"collection",b:"[\\[\\{]",e:"[\\]\\}]"};var c={cN:"comment",b:"\\^"+f};var b={cN:"comment",b:"\\^\\{",e:"\\}"};var h={cN:"attribute",b:"[:]"+f};var m={cN:"list",b:"\\(",e:"\\)"};var g={eW:true,k:{literal:"true false nil"},r:0};var i={k:e,l:f,cN:"title",b:f,starts:g};m.c=[{cN:"comment",b:"comment"},i,g];g.c=[m,j,c,b,o,h,n,d];n.c=[m,j,c,o,h,n,d];return{i:/\S/,c:[o,m,{cN:"prompt",b:/^=> /,starts:{e:/\n\n|\Z/}}]}});hljs.registerLanguage("oxygene",function(b){var g="abstract add and array as asc aspect assembly async begin break block by case class concat const copy constructor continue create default delegate desc distinct div do downto dynamic each else empty end ensure enum equals event except exit extension external false final finalize finalizer finally flags for forward from function future global group has if implementation implements implies in index inherited inline interface into invariants is iterator join locked locking loop matching method mod module namespace nested new nil not notify nullable of old on operator or order out override parallel params partial pinned private procedure property protected public queryable raise read readonly record reintroduce remove repeat require result reverse sealed select self sequence set shl shr skip static step soft take then to true try tuple type union unit unsafe until uses using var virtual raises volatile where while with write xor yield await mapped deprecated stdcall cdecl pascal register safecall overload library platform reference packed strict published autoreleasepool selector strong weak unretained";var a={cN:"comment",b:"{",e:"}",r:0};var e={cN:"comment",b:"\\(\\*",e:"\\*\\)",r:10};var c={cN:"string",b:"'",e:"'",c:[{b:"''"}]};var d={cN:"string",b:"(#\\d+)+"};var f={cN:"function",bK:"function constructor destructor procedure method",e:"[:;]",k:"function constructor|10 destructor|10 procedure|10 method|10",c:[b.TM,{cN:"params",b:"\\(",e:"\\)",k:g,c:[c,d]},a,e]};return{cI:true,k:g,i:'("|\\$[G-Zg-z]|\\/\\*|</)',c:[a,e,b.CLCM,c,d,b.NM,f,{cN:"class",b:"=\\bclass\\b",e:"end;",k:g,c:[c,d,a,e,b.CLCM,f]}]}});hljs.registerLanguage("asciidoc",function(a){return{c:[{cN:"comment",b:"^/{4,}\\n",e:"\\n/{4,}$",r:10},{cN:"comment",b:"^//",e:"$",r:0},{cN:"title",b:"^\\.\\w.*$"},{b:"^[=\\*]{4,}\\n",e:"\\n^[=\\*]{4,}$",r:10},{cN:"header",b:"^(={1,5}) .+?( \\1)?$",r:10},{cN:"header",b:"^[^\\[\\]\\n]+?\\n[=\\-~\\^\\+]{2,}$",r:10},{cN:"attribute",b:"^:.+?:",e:"\\s",eE:true,r:10},{cN:"attribute",b:"^\\[.+?\\]$",r:0},{cN:"blockquote",b:"^_{4,}\\n",e:"\\n_{4,}$",r:10},{cN:"code",b:"^[\\-\\.]{4,}\\n",e:"\\n[\\-\\.]{4,}$",r:10},{b:"^\\+{4,}\\n",e:"\\n\\+{4,}$",c:[{b:"<",e:">",sL:"xml",r:0}],r:10},{cN:"bullet",b:"^(\\*+|\\-+|\\.+|[^\\n]+?::)\\s+"},{cN:"label",b:"^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\\s+",r:10},{cN:"strong",b:"\\B\\*(?![\\*\\s])",e:"(\\n{2}|\\*)",c:[{b:"\\\\*\\w",r:0}]},{cN:"emphasis",b:"\\B'(?!['\\s])",e:"(\\n{2}|')",c:[{b:"\\\\'\\w",r:0}],r:0},{cN:"emphasis",b:"_(?![_\\s])",e:"(\\n{2}|_)",r:0},{cN:"smartquote",b:"``.+?''",r:10},{cN:"smartquote",b:"`.+?'",r:10},{cN:"code",b:"(`.+?`|\\+.+?\\+)",r:0},{cN:"code",b:"^[ \\t]",e:"$",r:0},{cN:"horizontal_rule",b:"^'{3,}[ \\t]*$",r:10},{b:"(link:)?(http|https|ftp|file|irc|image:?):\\S+\\[.*?\\]",rB:true,c:[{b:"(link|image:?):",r:0},{cN:"link_url",b:"\\w",e:"[^\\[]+",r:0},{cN:"link_label",b:"\\[",e:"\\]",eB:true,eE:true,r:0}],r:10}]}});hljs.registerLanguage("erlang-repl",function(a){return{k:{special_functions:"spawn spawn_link self",reserved:"after and andalso|10 band begin bnot bor bsl bsr bxor case catch cond div end fun if let not of or orelse|10 query receive rem try when xor"},c:[{cN:"prompt",b:"^[0-9]+> ",r:10},{cN:"comment",b:"%",e:"$"},{cN:"number",b:"\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)",r:0},a.ASM,a.QSM,{cN:"constant",b:"\\?(::)?([A-Z]\\w*(::)?)+"},{cN:"arrow",b:"->"},{cN:"ok",b:"ok"},{cN:"exclamation_mark",b:"!"},{cN:"function_or_atom",b:"(\\b[a-z'][a-zA-Z0-9_']*:[a-z'][a-zA-Z0-9_']*)|(\\b[a-z'][a-zA-Z0-9_']*)",r:0},{cN:"variable",b:"[A-Z][a-zA-Z0-9_']*",r:0}]}});hljs.registerLanguage("autohotkey",function(b){var d={cN:"escape",b:"`[\\s\\S]"};var c={cN:"comment",b:";",e:"$",r:0};var a=[{cN:"built_in",b:"A_[a-zA-Z0-9]+"},{cN:"built_in",bK:"ComSpec Clipboard ClipboardAll ErrorLevel"}];return{cI:true,k:{keyword:"Break Continue Else Gosub If Loop Return While",literal:"A true false NOT AND OR"},c:a.concat([d,b.inherit(b.QSM,{c:[d]}),c,{cN:"number",b:b.NR,r:0},{cN:"var_expand",b:"%",e:"%",i:"\\n",c:[d]},{cN:"label",c:[d],v:[{b:'^[^\\n";]+::(?!=)'},{b:'^[^\\n";]+:(?!=)',r:0}]},{b:",\\s*,",r:10}])}});hljs.registerLanguage("scilab",function(a){var b=[a.CNM,{cN:"string",b:"'|\"",e:"'|\"",c:[a.BE,{b:"''"}]}];return{k:{keyword:"abort break case clear catch continue do elseif else endfunction end for functionglobal if pause return resume select try then while%f %F %t %T %pi %eps %inf %nan %e %i %z %s",built_in:"abs and acos asin atan ceil cd chdir clearglobal cosh cos cumprod deff disp errorexec execstr exists exp eye gettext floor fprintf fread fsolve imag isdef isemptyisinfisnan isvector lasterror length load linspace list listfiles log10 log2 logmax min msprintf mclose mopen ones or pathconvert poly printf prod pwd rand realround sinh sin size gsort sprintf sqrt strcat strcmps tring sum system tanh tantype typename warning zeros matrix"},i:'("|#|/\\*|\\s+/\\w+)',c:[{cN:"function",bK:"function endfunction",e:"$",k:"function endfunction|10",c:[a.UTM,{cN:"params",b:"\\(",e:"\\)"},],},{cN:"transposed_variable",b:"[a-zA-Z_][a-zA-Z_0-9]*('+[\\.']*|[\\.']+)",e:"",r:0},{cN:"matrix",b:"\\[",e:"\\]'*[\\.']*",r:0,c:b},{cN:"comment",b:"//",e:"$"}].concat(b)}});
|
ksaitor/cdnjs
|
ajax/libs/highlight.js/8.0/highlight.min.js
|
JavaScript
|
mit
| 184,850 |
.cm-s-midnight span.CodeMirror-matchhighlight{background:#494949}.cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight{background:#314d67!important}.cm-s-midnight .CodeMirror-activeline-background{background:#253540!important}.cm-s-midnight.CodeMirror{background:#0f192a;color:#d1edff}.cm-s-midnight.CodeMirror{border-top:1px solid black;border-bottom:1px solid black}.cm-s-midnight div.CodeMirror-selected{background:#314d67!important}.cm-s-midnight .CodeMirror-gutters{background:#0f192a;border-right:1px solid}.cm-s-midnight .CodeMirror-linenumber{color:#d0d0d0}.cm-s-midnight .CodeMirror-cursor{border-left:1px solid #f8f8f0!important}.cm-s-midnight span.cm-comment{color:#428bdd}.cm-s-midnight span.cm-atom{color:#ae81ff}.cm-s-midnight span.cm-number{color:#d1edff}.cm-s-midnight span.cm-property,.cm-s-midnight span.cm-attribute{color:#a6e22e}.cm-s-midnight span.cm-keyword{color:#e83737}.cm-s-midnight span.cm-string{color:#1dc116}.cm-s-midnight span.cm-variable{color:#ffaa3e}.cm-s-midnight span.cm-variable-2{color:#ffaa3e}.cm-s-midnight span.cm-def{color:#4DD}.cm-s-midnight span.cm-bracket{color:#d1edff}.cm-s-midnight span.cm-tag{color:#449}.cm-s-midnight span.cm-link{color:#ae81ff}.cm-s-midnight span.cm-error{background:#f92672;color:#f8f8f0}.cm-s-midnight .CodeMirror-matchingbracket{text-decoration:underline;color:white!important}
|
jrbasso/cdnjs
|
ajax/libs/codemirror/4.0.3/theme/midnight.min.css
|
CSS
|
mit
| 1,359 |
(function($){var REDRAW_ATTEMPTS=10;var REDRAW_SHRINK=.95;function init(plot){var canvas=null,target=null,options=null,maxRadius=null,centerLeft=null,centerTop=null,processed=false,ctx=null;var highlights=[];plot.hooks.processOptions.push(function(plot,options){if(options.series.pie.show){options.grid.show=false;if(options.series.pie.label.show=="auto"){if(options.legend.show){options.series.pie.label.show=false}else{options.series.pie.label.show=true}}if(options.series.pie.radius=="auto"){if(options.series.pie.label.show){options.series.pie.radius=3/4}else{options.series.pie.radius=1}}if(options.series.pie.tilt>1){options.series.pie.tilt=1}else if(options.series.pie.tilt<0){options.series.pie.tilt=0}}});plot.hooks.bindEvents.push(function(plot,eventHolder){var options=plot.getOptions();if(options.series.pie.show){if(options.grid.hoverable){eventHolder.unbind("mousemove").mousemove(onMouseMove)}if(options.grid.clickable){eventHolder.unbind("click").click(onClick)}}});plot.hooks.processDatapoints.push(function(plot,series,data,datapoints){var options=plot.getOptions();if(options.series.pie.show){processDatapoints(plot,series,data,datapoints)}});plot.hooks.drawOverlay.push(function(plot,octx){var options=plot.getOptions();if(options.series.pie.show){drawOverlay(plot,octx)}});plot.hooks.draw.push(function(plot,newCtx){var options=plot.getOptions();if(options.series.pie.show){draw(plot,newCtx)}});function processDatapoints(plot,series,datapoints){if(!processed){processed=true;canvas=plot.getCanvas();target=$(canvas).parent();options=plot.getOptions();plot.setData(combine(plot.getData()))}}function combine(data){var total=0,combined=0,numCombined=0,color=options.series.pie.combine.color,newdata=[];for(var i=0;i<data.length;++i){var value=data[i].data;if($.isArray(value)&&value.length==1){value=value[0]}if($.isArray(value)){if(!isNaN(parseFloat(value[1]))&&isFinite(value[1])){value[1]=+value[1]}else{value[1]=0}}else if(!isNaN(parseFloat(value))&&isFinite(value)){value=[1,+value]}else{value=[1,0]}data[i].data=[value]}for(var i=0;i<data.length;++i){total+=data[i].data[0][1]}for(var i=0;i<data.length;++i){var value=data[i].data[0][1];if(value/total<=options.series.pie.combine.threshold){combined+=value;numCombined++;if(!color){color=data[i].color}}}for(var i=0;i<data.length;++i){var value=data[i].data[0][1];if(numCombined<2||value/total>options.series.pie.combine.threshold){newdata.push({data:[[1,value]],color:data[i].color,label:data[i].label,angle:value*Math.PI*2/total,percent:value/(total/100)})}}if(numCombined>1){newdata.push({data:[[1,combined]],color:color,label:options.series.pie.combine.label,angle:combined*Math.PI*2/total,percent:combined/(total/100)})}return newdata}function draw(plot,newCtx){if(!target){return}var canvasWidth=plot.getPlaceholder().width(),canvasHeight=plot.getPlaceholder().height(),legendWidth=target.children().filter(".legend").children().width()||0;ctx=newCtx;processed=false;maxRadius=Math.min(canvasWidth,canvasHeight/options.series.pie.tilt)/2;centerTop=canvasHeight/2+options.series.pie.offset.top;centerLeft=canvasWidth/2;if(options.series.pie.offset.left=="auto"){if(options.legend.position.match("w")){centerLeft+=legendWidth/2}else{centerLeft-=legendWidth/2}if(centerLeft<maxRadius){centerLeft=maxRadius}else if(centerLeft>canvasWidth-maxRadius){centerLeft=canvasWidth-maxRadius}}else{centerLeft+=options.series.pie.offset.left}var slices=plot.getData(),attempts=0;do{if(attempts>0){maxRadius*=REDRAW_SHRINK}attempts+=1;clear();if(options.series.pie.tilt<=.8){drawShadow()}}while(!drawPie()&&attempts<REDRAW_ATTEMPTS);if(attempts>=REDRAW_ATTEMPTS){clear();target.prepend("<div class='error'>Could not draw pie with labels contained inside canvas</div>")}if(plot.setSeries&&plot.insertLegend){plot.setSeries(slices);plot.insertLegend()}function clear(){ctx.clearRect(0,0,canvasWidth,canvasHeight);target.children().filter(".pieLabel, .pieLabelBackground").remove()}function drawShadow(){var shadowLeft=options.series.pie.shadow.left;var shadowTop=options.series.pie.shadow.top;var edge=10;var alpha=options.series.pie.shadow.alpha;var radius=options.series.pie.radius>1?options.series.pie.radius:maxRadius*options.series.pie.radius;if(radius>=canvasWidth/2-shadowLeft||radius*options.series.pie.tilt>=canvasHeight/2-shadowTop||radius<=edge){return}ctx.save();ctx.translate(shadowLeft,shadowTop);ctx.globalAlpha=alpha;ctx.fillStyle="#000";ctx.translate(centerLeft,centerTop);ctx.scale(1,options.series.pie.tilt);for(var i=1;i<=edge;i++){ctx.beginPath();ctx.arc(0,0,radius,0,Math.PI*2,false);ctx.fill();radius-=i}ctx.restore()}function drawPie(){var startAngle=Math.PI*options.series.pie.startAngle;var radius=options.series.pie.radius>1?options.series.pie.radius:maxRadius*options.series.pie.radius;ctx.save();ctx.translate(centerLeft,centerTop);ctx.scale(1,options.series.pie.tilt);ctx.save();var currentAngle=startAngle;for(var i=0;i<slices.length;++i){slices[i].startAngle=currentAngle;drawSlice(slices[i].angle,slices[i].color,true)}ctx.restore();if(options.series.pie.stroke.width>0){ctx.save();ctx.lineWidth=options.series.pie.stroke.width;currentAngle=startAngle;for(var i=0;i<slices.length;++i){drawSlice(slices[i].angle,options.series.pie.stroke.color,false)}ctx.restore()}drawDonutHole(ctx);ctx.restore();if(options.series.pie.label.show){return drawLabels()}else return true;function drawSlice(angle,color,fill){if(angle<=0||isNaN(angle)){return}if(fill){ctx.fillStyle=color}else{ctx.strokeStyle=color;ctx.lineJoin="round"}ctx.beginPath();if(Math.abs(angle-Math.PI*2)>1e-9){ctx.moveTo(0,0)}ctx.arc(0,0,radius,currentAngle,currentAngle+angle/2,false);ctx.arc(0,0,radius,currentAngle+angle/2,currentAngle+angle,false);ctx.closePath();currentAngle+=angle;if(fill){ctx.fill()}else{ctx.stroke()}}function drawLabels(){var currentAngle=startAngle;var radius=options.series.pie.label.radius>1?options.series.pie.label.radius:maxRadius*options.series.pie.label.radius;for(var i=0;i<slices.length;++i){if(slices[i].percent>=options.series.pie.label.threshold*100){if(!drawLabel(slices[i],currentAngle,i)){return false}}currentAngle+=slices[i].angle}return true;function drawLabel(slice,startAngle,index){if(slice.data[0][1]==0){return true}var lf=options.legend.labelFormatter,text,plf=options.series.pie.label.formatter;if(lf){text=lf(slice.label,slice)}else{text=slice.label}if(plf){text=plf(text,slice)}var halfAngle=(startAngle+slice.angle+startAngle)/2;var x=centerLeft+Math.round(Math.cos(halfAngle)*radius);var y=centerTop+Math.round(Math.sin(halfAngle)*radius)*options.series.pie.tilt;var html="<span class='pieLabel' id='pieLabel"+index+"' style='position:absolute;top:"+y+"px;left:"+x+"px;'>"+text+"</span>";target.append(html);var label=target.children("#pieLabel"+index);var labelTop=y-label.height()/2;var labelLeft=x-label.width()/2;label.css("top",labelTop);label.css("left",labelLeft);if(0-labelTop>0||0-labelLeft>0||canvasHeight-(labelTop+label.height())<0||canvasWidth-(labelLeft+label.width())<0){return false}if(options.series.pie.label.background.opacity!=0){var c=options.series.pie.label.background.color;if(c==null){c=slice.color}var pos="top:"+labelTop+"px;left:"+labelLeft+"px;";$("<div class='pieLabelBackground' style='position:absolute;width:"+label.width()+"px;height:"+label.height()+"px;"+pos+"background-color:"+c+";'></div>").css("opacity",options.series.pie.label.background.opacity).insertBefore(label)}return true}}}}function drawDonutHole(layer){if(options.series.pie.innerRadius>0){layer.save();var innerRadius=options.series.pie.innerRadius>1?options.series.pie.innerRadius:maxRadius*options.series.pie.innerRadius;layer.globalCompositeOperation="destination-out";layer.beginPath();layer.fillStyle=options.series.pie.stroke.color;layer.arc(0,0,innerRadius,0,Math.PI*2,false);layer.fill();layer.closePath();layer.restore();layer.save();layer.beginPath();layer.strokeStyle=options.series.pie.stroke.color;layer.arc(0,0,innerRadius,0,Math.PI*2,false);layer.stroke();layer.closePath();layer.restore()}}function isPointInPoly(poly,pt){for(var c=false,i=-1,l=poly.length,j=l-1;++i<l;j=i)(poly[i][1]<=pt[1]&&pt[1]<poly[j][1]||poly[j][1]<=pt[1]&&pt[1]<poly[i][1])&&pt[0]<(poly[j][0]-poly[i][0])*(pt[1]-poly[i][1])/(poly[j][1]-poly[i][1])+poly[i][0]&&(c=!c);return c}function findNearbySlice(mouseX,mouseY){var slices=plot.getData(),options=plot.getOptions(),radius=options.series.pie.radius>1?options.series.pie.radius:maxRadius*options.series.pie.radius,x,y;for(var i=0;i<slices.length;++i){var s=slices[i];if(s.pie.show){ctx.save();ctx.beginPath();ctx.moveTo(0,0);ctx.arc(0,0,radius,s.startAngle,s.startAngle+s.angle/2,false);ctx.arc(0,0,radius,s.startAngle+s.angle/2,s.startAngle+s.angle,false);ctx.closePath();x=mouseX-centerLeft;y=mouseY-centerTop;if(ctx.isPointInPath){if(ctx.isPointInPath(mouseX-centerLeft,mouseY-centerTop)){ctx.restore();return{datapoint:[s.percent,s.data],dataIndex:0,series:s,seriesIndex:i}}}else{var p1X=radius*Math.cos(s.startAngle),p1Y=radius*Math.sin(s.startAngle),p2X=radius*Math.cos(s.startAngle+s.angle/4),p2Y=radius*Math.sin(s.startAngle+s.angle/4),p3X=radius*Math.cos(s.startAngle+s.angle/2),p3Y=radius*Math.sin(s.startAngle+s.angle/2),p4X=radius*Math.cos(s.startAngle+s.angle/1.5),p4Y=radius*Math.sin(s.startAngle+s.angle/1.5),p5X=radius*Math.cos(s.startAngle+s.angle),p5Y=radius*Math.sin(s.startAngle+s.angle),arrPoly=[[0,0],[p1X,p1Y],[p2X,p2Y],[p3X,p3Y],[p4X,p4Y],[p5X,p5Y]],arrPoint=[x,y];if(isPointInPoly(arrPoly,arrPoint)){ctx.restore();return{datapoint:[s.percent,s.data],dataIndex:0,series:s,seriesIndex:i}}}ctx.restore()}}return null}function onMouseMove(e){triggerClickHoverEvent("plothover",e)}function onClick(e){triggerClickHoverEvent("plotclick",e)}function triggerClickHoverEvent(eventname,e){var offset=plot.offset();var canvasX=parseInt(e.pageX-offset.left);var canvasY=parseInt(e.pageY-offset.top);var item=findNearbySlice(canvasX,canvasY);if(options.grid.autoHighlight){for(var i=0;i<highlights.length;++i){var h=highlights[i];if(h.auto==eventname&&!(item&&h.series==item.series)){unhighlight(h.series)}}}if(item){highlight(item.series,eventname)}var pos={pageX:e.pageX,pageY:e.pageY};target.trigger(eventname,[pos,item])}function highlight(s,auto){var i=indexOfHighlight(s);if(i==-1){highlights.push({series:s,auto:auto});plot.triggerRedrawOverlay()}else if(!auto){highlights[i].auto=false}}function unhighlight(s){if(s==null){highlights=[];plot.triggerRedrawOverlay()}var i=indexOfHighlight(s);if(i!=-1){highlights.splice(i,1);plot.triggerRedrawOverlay()}}function indexOfHighlight(s){for(var i=0;i<highlights.length;++i){var h=highlights[i];if(h.series==s)return i}return-1}function drawOverlay(plot,octx){var options=plot.getOptions();var radius=options.series.pie.radius>1?options.series.pie.radius:maxRadius*options.series.pie.radius;octx.save();octx.translate(centerLeft,centerTop);octx.scale(1,options.series.pie.tilt);for(var i=0;i<highlights.length;++i){drawHighlight(highlights[i].series)}drawDonutHole(octx);octx.restore();function drawHighlight(series){if(series.angle<=0||isNaN(series.angle)){return}octx.fillStyle="rgba(255, 255, 255, "+options.series.pie.highlight.opacity+")";octx.beginPath();if(Math.abs(series.angle-Math.PI*2)>1e-9){octx.moveTo(0,0)}octx.arc(0,0,radius,series.startAngle,series.startAngle+series.angle/2,false);octx.arc(0,0,radius,series.startAngle+series.angle/2,series.startAngle+series.angle,false);octx.closePath();octx.fill()}}}var options={series:{pie:{show:false,radius:"auto",innerRadius:0,startAngle:3/2,tilt:1,shadow:{left:5,top:15,alpha:.02},offset:{top:0,left:"auto"},stroke:{color:"#fff",width:1},label:{show:"auto",formatter:function(label,slice){return"<div style='font-size:x-small;text-align:center;padding:2px;color:"+slice.color+";'>"+label+"<br/>"+Math.round(slice.percent)+"%</div>"},radius:1,background:{color:null,opacity:0},threshold:0},combine:{threshold:-1,color:null,label:"Other"},highlight:{opacity:.5}}}};$.plot.plugins.push({init:init,options:options,name:"pie",version:"1.1"})})(jQuery);
|
karenyov/baseSymfony
|
web/assets/vendor/AdminLTE/plugins/flot/jquery.flot.pie.min.js
|
JavaScript
|
mit
| 12,024 |
define("dojo/cldr/supplemental", ["../_base/lang", "../i18n"], function(lang, i18n){
// module:
// dojo/cldr/supplemental
var supplemental = {
// summary:
// TODOC
};
lang.setObject("dojo.cldr.supplemental", supplemental);
supplemental.getFirstDayOfWeek = function(/*String?*/locale){
// summary:
// Returns a zero-based index for first day of the week
// description:
// Returns a zero-based index for first day of the week, as used by the local (Gregorian) calendar.
// e.g. Sunday (returns 0), or Monday (returns 1)
// from http://www.unicode.org/cldr/data/common/supplemental/supplementalData.xml:supplementalData/weekData/firstDay
var firstDay = {/*default is 1=Monday*/
bd:5,mv:5,
ae:6,af:6,bh:6,dj:6,dz:6,eg:6,iq:6,ir:6,jo:6,kw:6,
ly:6,ma:6,om:6,qa:6,sa:6,sd:6,sy:6,ye:6,
ag:0,ar:0,as:0,au:0,br:0,bs:0,bt:0,bw:0,by:0,bz:0,ca:0,cn:0,
co:0,dm:0,'do':0,et:0,gt:0,gu:0,hk:0,hn:0,id:0,ie:0,il:0,'in':0,
jm:0,jp:0,ke:0,kh:0,kr:0,la:0,mh:0,mm:0,mo:0,mt:0,mx:0,mz:0,
ni:0,np:0,nz:0,pa:0,pe:0,ph:0,pk:0,pr:0,py:0,sg:0,sv:0,th:0,
tn:0,tt:0,tw:0,um:0,us:0,ve:0,vi:0,ws:0,za:0,zw:0
};
var country = supplemental._region(locale);
var dow = firstDay[country];
return (dow === undefined) ? 1 : dow; /*Number*/
};
supplemental._region = function(/*String?*/locale){
locale = i18n.normalizeLocale(locale);
var tags = locale.split('-');
var region = tags[1];
if(!region){
// IE often gives language only (#2269)
// Arbitrary mappings of language-only locales to a country:
region = {
aa:"et", ab:"ge", af:"za", ak:"gh", am:"et", ar:"eg", as:"in", av:"ru", ay:"bo", az:"az", ba:"ru",
be:"by", bg:"bg", bi:"vu", bm:"ml", bn:"bd", bo:"cn", br:"fr", bs:"ba", ca:"es", ce:"ru", ch:"gu",
co:"fr", cr:"ca", cs:"cz", cv:"ru", cy:"gb", da:"dk", de:"de", dv:"mv", dz:"bt", ee:"gh", el:"gr",
en:"us", es:"es", et:"ee", eu:"es", fa:"ir", ff:"sn", fi:"fi", fj:"fj", fo:"fo", fr:"fr", fy:"nl",
ga:"ie", gd:"gb", gl:"es", gn:"py", gu:"in", gv:"gb", ha:"ng", he:"il", hi:"in", ho:"pg", hr:"hr",
ht:"ht", hu:"hu", hy:"am", ia:"fr", id:"id", ig:"ng", ii:"cn", ik:"us", "in":"id", is:"is", it:"it",
iu:"ca", iw:"il", ja:"jp", ji:"ua", jv:"id", jw:"id", ka:"ge", kg:"cd", ki:"ke", kj:"na", kk:"kz",
kl:"gl", km:"kh", kn:"in", ko:"kr", ks:"in", ku:"tr", kv:"ru", kw:"gb", ky:"kg", la:"va", lb:"lu",
lg:"ug", li:"nl", ln:"cd", lo:"la", lt:"lt", lu:"cd", lv:"lv", mg:"mg", mh:"mh", mi:"nz", mk:"mk",
ml:"in", mn:"mn", mo:"ro", mr:"in", ms:"my", mt:"mt", my:"mm", na:"nr", nb:"no", nd:"zw", ne:"np",
ng:"na", nl:"nl", nn:"no", no:"no", nr:"za", nv:"us", ny:"mw", oc:"fr", om:"et", or:"in", os:"ge",
pa:"in", pl:"pl", ps:"af", pt:"br", qu:"pe", rm:"ch", rn:"bi", ro:"ro", ru:"ru", rw:"rw", sa:"in",
sd:"in", se:"no", sg:"cf", si:"lk", sk:"sk", sl:"si", sm:"ws", sn:"zw", so:"so", sq:"al", sr:"rs",
ss:"za", st:"za", su:"id", sv:"se", sw:"tz", ta:"in", te:"in", tg:"tj", th:"th", ti:"et", tk:"tm",
tl:"ph", tn:"za", to:"to", tr:"tr", ts:"za", tt:"ru", ty:"pf", ug:"cn", uk:"ua", ur:"pk", uz:"uz",
ve:"za", vi:"vn", wa:"be", wo:"sn", xh:"za", yi:"il", yo:"ng", za:"cn", zh:"cn", zu:"za",
ace:"id", ady:"ru", agq:"cm", alt:"ru", amo:"ng", asa:"tz", ast:"es", awa:"in", bal:"pk",
ban:"id", bas:"cm", bax:"cm", bbc:"id", bem:"zm", bez:"tz", bfq:"in", bft:"pk", bfy:"in",
bhb:"in", bho:"in", bik:"ph", bin:"ng", bjj:"in", bku:"ph", bqv:"ci", bra:"in", brx:"in",
bss:"cm", btv:"pk", bua:"ru", buc:"yt", bug:"id", bya:"id", byn:"er", cch:"ng", ccp:"in",
ceb:"ph", cgg:"ug", chk:"fm", chm:"ru", chp:"ca", chr:"us", cja:"kh", cjm:"vn", ckb:"iq",
crk:"ca", csb:"pl", dar:"ru", dav:"ke", den:"ca", dgr:"ca", dje:"ne", doi:"in", dsb:"de",
dua:"cm", dyo:"sn", dyu:"bf", ebu:"ke", efi:"ng", ewo:"cm", fan:"gq", fil:"ph", fon:"bj",
fur:"it", gaa:"gh", gag:"md", gbm:"in", gcr:"gf", gez:"et", gil:"ki", gon:"in", gor:"id",
grt:"in", gsw:"ch", guz:"ke", gwi:"ca", haw:"us", hil:"ph", hne:"in", hnn:"ph", hoc:"in",
hoj:"in", ibb:"ng", ilo:"ph", inh:"ru", jgo:"cm", jmc:"tz", kaa:"uz", kab:"dz", kaj:"ng",
kam:"ke", kbd:"ru", kcg:"ng", kde:"tz", kdt:"th", kea:"cv", ken:"cm", kfo:"ci", kfr:"in",
kha:"in", khb:"cn", khq:"ml", kht:"in", kkj:"cm", kln:"ke", kmb:"ao", koi:"ru", kok:"in",
kos:"fm", kpe:"lr", krc:"ru", kri:"sl", krl:"ru", kru:"in", ksb:"tz", ksf:"cm", ksh:"de",
kum:"ru", lag:"tz", lah:"pk", lbe:"ru", lcp:"cn", lep:"in", lez:"ru", lif:"np", lis:"cn",
lki:"ir", lmn:"in", lol:"cd", lua:"cd", luo:"ke", luy:"ke", lwl:"th", mad:"id", mag:"in",
mai:"in", mak:"id", man:"gn", mas:"ke", mdf:"ru", mdh:"ph", mdr:"id", men:"sl", mer:"ke",
mfe:"mu", mgh:"mz", mgo:"cm", min:"id", mni:"in", mnk:"gm", mnw:"mm", mos:"bf", mua:"cm",
mwr:"in", myv:"ru", nap:"it", naq:"na", nds:"de", "new":"np", niu:"nu", nmg:"cm", nnh:"cm",
nod:"th", nso:"za", nus:"sd", nym:"tz", nyn:"ug", pag:"ph", pam:"ph", pap:"bq", pau:"pw",
pon:"fm", prd:"ir", raj:"in", rcf:"re", rej:"id", rjs:"np", rkt:"in", rof:"tz", rwk:"tz",
saf:"gh", sah:"ru", saq:"ke", sas:"id", sat:"in", saz:"in", sbp:"tz", scn:"it", sco:"gb",
sdh:"ir", seh:"mz", ses:"ml", shi:"ma", shn:"mm", sid:"et", sma:"se", smj:"se", smn:"fi",
sms:"fi", snk:"ml", srn:"sr", srr:"sn", ssy:"er", suk:"tz", sus:"gn", swb:"yt", swc:"cd",
syl:"bd", syr:"sy", tbw:"ph", tcy:"in", tdd:"cn", tem:"sl", teo:"ug", tet:"tl", tig:"er",
tiv:"ng", tkl:"tk", tmh:"ne", tpi:"pg", trv:"tw", tsg:"ph", tts:"th", tum:"mw", tvl:"tv",
twq:"ne", tyv:"ru", tzm:"ma", udm:"ru", uli:"fm", umb:"ao", unr:"in", unx:"in", vai:"lr",
vun:"tz", wae:"ch", wal:"et", war:"ph", xog:"ug", xsr:"np", yao:"mz", yap:"fm", yav:"cm", zza:"tr"
}[tags[0]];
}else if(region.length == 4){
// The ISO 3166 country code is usually in the second position, unless a
// 4-letter script is given. See http://www.ietf.org/rfc/rfc4646.txt
region = tags[2];
}
return region;
};
supplemental.getWeekend = function(/*String?*/locale){
// summary:
// Returns a hash containing the start and end days of the weekend
// description:
// Returns a hash containing the start and end days of the weekend according to local custom using locale,
// or by default in the user's locale.
// e.g. {start:6, end:0}
// from http://www.unicode.org/cldr/data/common/supplemental/supplementalData.xml:supplementalData/weekData/weekend{Start,End}
var weekendStart = {/*default is 6=Saturday*/
'in':0,
af:4,dz:4,ir:4,om:4,sa:4,ye:4,
ae:5,bh:5,eg:5,il:5,iq:5,jo:5,kw:5,ly:5,ma:5,qa:5,sd:5,sy:5,tn:5
},
weekendEnd = {/*default is 0=Sunday*/
af:5,dz:5,ir:5,om:5,sa:5,ye:5,
ae:6,bh:5,eg:6,il:6,iq:6,jo:6,kw:6,ly:6,ma:6,qa:6,sd:6,sy:6,tn:6
},
country = supplemental._region(locale),
start = weekendStart[country],
end = weekendEnd[country];
if(start === undefined){start=6;}
if(end === undefined){end=0;}
return {start:start, end:end}; /*Object {start,end}*/
};
return supplemental;
});
|
ruiaraujo/cdnjs
|
ajax/libs/dojo/1.9.4/cldr/supplemental.js.uncompressed.js
|
JavaScript
|
mit
| 6,934 |
def geo_apps():
"""
Returns a list of GeoDjango test applications that reside in
`django.contrib.gis.tests` that can be used with the current
database and the spatial libraries that are installed.
"""
from django.db import connection
from django.contrib.gis.geos import GEOS_PREPARE
from django.contrib.gis.gdal import HAS_GDAL
apps = ['geoapp', 'relatedapp']
# No distance queries on MySQL.
if not connection.ops.mysql:
apps.append('distapp')
# Test geography support with PostGIS 1.5+.
if connection.ops.postgis and connection.ops.geography:
apps.append('geogapp')
# The following GeoDjango test apps depend on GDAL support.
if HAS_GDAL:
# Geographic admin, LayerMapping, and ogrinspect test apps
# all require GDAL.
apps.extend(['geoadmin', 'layermap', 'inspectapp'])
# 3D apps use LayerMapping, which uses GDAL and require GEOS 3.1+.
if connection.ops.postgis and GEOS_PREPARE:
apps.append('geo3d')
return [('django.contrib.gis.tests', app) for app in apps]
|
javierder/dogestart.me
|
django/contrib/gis/tests/__init__.py
|
Python
|
mit
| 1,099 |
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Config;
/**
* Configuration Source Interface
*
* @author Jordi Boggiano <j.boggiano@seld.be>
* @author Beau Simensen <beau@dflydev.com>
*/
interface ConfigSourceInterface
{
/**
* Add a repository
*
* @param string $name Name
* @param array $config Configuration
*/
public function addRepository($name, $config);
/**
* Remove a repository
*
* @param string $name
*/
public function removeRepository($name);
/**
* Add a config setting
*
* @param string $name Name
* @param string $value Value
*/
public function addConfigSetting($name, $value);
/**
* Remove a config setting
*
* @param string $name
*/
public function removeConfigSetting($name);
/**
* Add a package link
*
* @param string $type Type (require, require-dev, provide, suggest, replace, conflict)
* @param string $name Name
* @param string $value Value
*/
public function addLink($type, $name, $value);
/**
* Remove a package link
*
* @param string $type Type (require, require-dev, provide, suggest, replace, conflict)
* @param string $name Name
*/
public function removeLink($type, $name);
/**
* Gives a user-friendly name to this source (file path or so)
*
* @return string
*/
public function getName();
}
|
bobdenotter/bolt-preso-sug
|
vendor/composer/composer/src/Composer/Config/ConfigSourceInterface.php
|
PHP
|
mit
| 1,697 |
/**
* mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
* v1.2.1
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*
* Date: 2014-05-14
*/
!function(e,t){"use strict";function n(e,t){for(var n,i=[],r=0;r<e.length;++r){if(n=s[e[r]]||o(e[r]),!n)throw"module definition dependecy not found: "+e[r];i.push(n)}t.apply(null,i)}function i(e,i,r){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(i===t)throw"invalid module definition, dependencies must be specified";if(r===t)throw"invalid module definition, definition function must be specified";n(i,function(){s[e]=r.apply(null,arguments)})}function r(e){return!!s[e]}function o(t){for(var n=e,i=t.split(/[.\/]/),r=0;r<i.length;++r){if(!n[i[r]])return;n=n[i[r]]}return n}function a(n){for(var i=0;i<n.length;i++){for(var r=e,o=n[i],a=o.split(/[.\/]/),u=0;u<a.length-1;++u)r[a[u]]===t&&(r[a[u]]={}),r=r[a[u]];r[a[a.length-1]]=s[o]}}var s={},u="moxie/core/utils/Basic",c="moxie/core/I18n",l="moxie/core/utils/Mime",d="moxie/core/utils/Env",f="moxie/core/utils/Dom",h="moxie/core/Exceptions",p="moxie/core/EventTarget",m="moxie/core/utils/Encode",g="moxie/runtime/Runtime",v="moxie/runtime/RuntimeClient",y="moxie/file/Blob",w="moxie/file/File",E="moxie/file/FileInput",_="moxie/file/FileDrop",x="moxie/runtime/RuntimeTarget",b="moxie/file/FileReader",R="moxie/core/utils/Url",T="moxie/file/FileReaderSync",A="moxie/xhr/FormData",S="moxie/xhr/XMLHttpRequest",O="moxie/runtime/Transporter",I="moxie/image/Image",D="moxie/runtime/html5/Runtime",N="moxie/runtime/html5/file/Blob",L="moxie/core/utils/Events",M="moxie/runtime/html5/file/FileInput",C="moxie/runtime/html5/file/FileDrop",F="moxie/runtime/html5/file/FileReader",H="moxie/runtime/html5/xhr/XMLHttpRequest",P="moxie/runtime/html5/utils/BinaryReader",k="moxie/runtime/html5/image/JPEGHeaders",U="moxie/runtime/html5/image/ExifParser",B="moxie/runtime/html5/image/JPEG",z="moxie/runtime/html5/image/PNG",G="moxie/runtime/html5/image/ImageInfo",q="moxie/runtime/html5/image/MegaPixel",X="moxie/runtime/html5/image/Image",j="moxie/runtime/flash/Runtime",V="moxie/runtime/flash/file/Blob",W="moxie/runtime/flash/file/FileInput",Y="moxie/runtime/flash/file/FileReader",$="moxie/runtime/flash/file/FileReaderSync",J="moxie/runtime/flash/xhr/XMLHttpRequest",Z="moxie/runtime/flash/runtime/Transporter",K="moxie/runtime/flash/image/Image",Q="moxie/runtime/silverlight/Runtime",et="moxie/runtime/silverlight/file/Blob",tt="moxie/runtime/silverlight/file/FileInput",nt="moxie/runtime/silverlight/file/FileDrop",it="moxie/runtime/silverlight/file/FileReader",rt="moxie/runtime/silverlight/file/FileReaderSync",ot="moxie/runtime/silverlight/xhr/XMLHttpRequest",at="moxie/runtime/silverlight/runtime/Transporter",st="moxie/runtime/silverlight/image/Image",ut="moxie/runtime/html4/Runtime",ct="moxie/runtime/html4/file/FileInput",lt="moxie/runtime/html4/file/FileReader",dt="moxie/runtime/html4/xhr/XMLHttpRequest",ft="moxie/runtime/html4/image/Image";i(u,[],function(){var e=function(e){var t;return e===t?"undefined":null===e?"null":e.nodeType?"node":{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()},t=function(i){var r;return n(arguments,function(o,s){s>0&&n(o,function(n,o){n!==r&&(e(i[o])===e(n)&&~a(e(n),["array","object"])?t(i[o],n):i[o]=n)})}),i},n=function(e,t){var n,i,r,o;if(e){try{n=e.length}catch(a){n=o}if(n===o){for(i in e)if(e.hasOwnProperty(i)&&t(e[i],i)===!1)return}else for(r=0;n>r;r++)if(t(e[r],r)===!1)return}},i=function(t){var n;if(!t||"object"!==e(t))return!0;for(n in t)return!1;return!0},r=function(t,n){function i(r){"function"===e(t[r])&&t[r](function(e){++r<o&&!e?i(r):n(e)})}var r=0,o=t.length;"function"!==e(n)&&(n=function(){}),t&&t.length||n(),i(r)},o=function(e,t){var i=0,r=e.length,o=new Array(r);n(e,function(e,n){e(function(e){if(e)return t(e);var a=[].slice.call(arguments);a.shift(),o[n]=a,i++,i===r&&(o.unshift(null),t.apply(this,o))})})},a=function(e,t){if(t){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e);for(var n=0,i=t.length;i>n;n++)if(t[n]===e)return n}return-1},s=function(t,n){var i=[];"array"!==e(t)&&(t=[t]),"array"!==e(n)&&(n=[n]);for(var r in t)-1===a(t[r],n)&&i.push(t[r]);return i.length?i:!1},u=function(e,t){var i=[];return n(e,function(e){-1!==a(e,t)&&i.push(e)}),i.length?i:null},c=function(e){var t,n=[];for(t=0;t<e.length;t++)n[t]=e[t];return n},l=function(){var e=0;return function(t){var n=(new Date).getTime().toString(32),i;for(i=0;5>i;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}(),d=function(e){return e?String.prototype.trim?String.prototype.trim.call(e):e.toString().replace(/^\s*/,"").replace(/\s*$/,""):e},f=function(e){if("string"!=typeof e)return e;var t={t:1099511627776,g:1073741824,m:1048576,k:1024},n;return e=/^([0-9]+)([mgk]?)$/.exec(e.toLowerCase().replace(/[^0-9mkg]/g,"")),n=e[2],e=+e[1],t.hasOwnProperty(n)&&(e*=t[n]),e};return{guid:l,typeOf:e,extend:t,each:n,isEmptyObj:i,inSeries:r,inParallel:o,inArray:a,arrayDiff:s,arrayIntersect:u,toArray:c,trim:d,parseSizeStr:f}}),i(c,[u],function(e){var t={};return{addI18n:function(n){return e.extend(t,n)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(t){var n=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=n.shift();return"undefined"!==e.typeOf(t)?t:""})}}}),i(l,[u,c],function(e,t){var n="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",i={mimes:{},extensions:{},addMimeType:function(e){var t=e.split(/,/),n,i,r;for(n=0;n<t.length;n+=2){for(r=t[n+1].split(/ /),i=0;i<r.length;i++)this.mimes[r[i]]=t[n];this.extensions[t[n]]=r}},extList2mimes:function(t,n){var i=this,r,o,a,s,u=[];for(o=0;o<t.length;o++)for(r=t[o].extensions.split(/\s*,\s*/),a=0;a<r.length;a++){if("*"===r[a])return[];if(s=i.mimes[r[a]])-1===e.inArray(s,u)&&u.push(s);else{if(!n||!/^\w+$/.test(r[a]))return[];u.push("."+r[a])}}return u},mimes2exts:function(t){var n=this,i=[];return e.each(t,function(t){if("*"===t)return i=[],!1;var r=t.match(/^(\w+)\/(\*|\w+)$/);r&&("*"===r[2]?e.each(n.extensions,function(e,t){new RegExp("^"+r[1]+"/").test(t)&&[].push.apply(i,n.extensions[t])}):n.extensions[t]&&[].push.apply(i,n.extensions[t]))}),i},mimes2extList:function(n){var i=[],r=[];return"string"===e.typeOf(n)&&(n=e.trim(n).split(/\s*,\s*/)),r=this.mimes2exts(n),i.push({title:t.translate("Files"),extensions:r.length?r.join(","):"*"}),i.mimes=n,i},getFileExtension:function(e){var t=e&&e.match(/\.([^.]+)$/);return t?t[1].toLowerCase():""},getFileMime:function(e){return this.mimes[this.getFileExtension(e)]||""}};return i.addMimeType(n),i}),i(d,[u],function(e){function t(e,t,n){var i=0,r=0,o=0,a={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},s=function(e){return e=(""+e).replace(/[_\-+]/g,"."),e=e.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,"."),e.length?e.split("."):[-8]},u=function(e){return e?isNaN(e)?a[e]||-7:parseInt(e,10):0};for(e=s(e),t=s(t),r=Math.max(e.length,t.length),i=0;r>i;i++)if(e[i]!=t[i]){if(e[i]=u(e[i]),t[i]=u(t[i]),e[i]<t[i]){o=-1;break}if(e[i]>t[i]){o=1;break}}if(!n)return o;switch(n){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return 0>=o;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return 0>o;default:return null}}var n=function(e){var t="",n="?",i="function",r="undefined",o="object",a="major",s="model",u="name",c="type",l="vendor",d="version",f="architecture",h="console",p="mobile",m="tablet",g={has:function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()}},v={rgx:function(){for(var t,n=0,a,s,u,c,l,d,f=arguments;n<f.length;n+=2){var h=f[n],p=f[n+1];if(typeof t===r){t={};for(u in p)c=p[u],typeof c===o?t[c[0]]=e:t[c]=e}for(a=s=0;a<h.length;a++)if(l=h[a].exec(this.getUA())){for(u=0;u<p.length;u++)d=l[++s],c=p[u],typeof c===o&&c.length>0?2==c.length?t[c[0]]=typeof c[1]==i?c[1].call(this,d):c[1]:3==c.length?t[c[0]]=typeof c[1]!==i||c[1].exec&&c[1].test?d?d.replace(c[1],c[2]):e:d?c[1].call(this,d,c[2]):e:4==c.length&&(t[c[0]]=d?c[3].call(this,d.replace(c[1],c[2])):e):t[c]=d?d:e;break}if(l)break}return t},str:function(t,i){for(var r in i)if(typeof i[r]===o&&i[r].length>0){for(var a=0;a<i[r].length;a++)if(g.has(i[r][a],t))return r===n?e:r}else if(g.has(i[r],t))return r===n?e:r;return t}},y={browser:{oldsafari:{major:{1:["/8","/1","/3"],2:"/4","?":"/"},version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2000:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",RT:"ARM"}}}},w={browser:[[/(opera\smini)\/((\d+)?[\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i,/(opera).+version\/((\d+)?[\w\.]+)/i,/(opera)[\/\s]+((\d+)?[\w\.]+)/i],[u,d,a],[/\s(opr)\/((\d+)?[\w\.]+)/i],[[u,"Opera"],d,a],[/(kindle)\/((\d+)?[\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,/(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i,/(rekonq)((?:\/)[\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i],[u,d,a],[/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i],[[u,"IE"],d,a],[/(yabrowser)\/((\d+)?[\w\.]+)/i],[[u,"Yandex"],d,a],[/(comodo_dragon)\/((\d+)?[\w\.]+)/i],[[u,/_/g," "],d,a],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i],[u,d,a],[/(dolfin)\/((\d+)?[\w\.]+)/i],[[u,"Dolphin"],d,a],[/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i],[[u,"Chrome"],d,a],[/((?:android.+))version\/((\d+)?[\w\.]+)\smobile\ssafari/i],[[u,"Android Browser"],d,a],[/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i],[d,a,[u,"Mobile Safari"]],[/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i],[d,a,u],[/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i],[u,[a,v.str,y.browser.oldsafari.major],[d,v.str,y.browser.oldsafari.version]],[/(konqueror)\/((\d+)?[\w\.]+)/i,/(webkit|khtml)\/((\d+)?[\w\.]+)/i],[u,d,a],[/(navigator|netscape)\/((\d+)?[\w\.-]+)/i],[[u,"Netscape"],d,a],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,/(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i,/(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i,/(links)\s\(((\d+)?[\w\.]+)/i,/(gobrowser)\/?((\d+)?[\w\.]+)*/i,/(ice\s?browser)\/v?((\d+)?[\w\._]+)/i,/(mosaic)[\/\s]((\d+)?[\w\.]+)/i],[u,d,a]],engine:[[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[u,d],[/rv\:([\w\.]+).*(gecko)/i],[d,u]],os:[[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[u,[d,v.str,y.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[u,"Windows"],[d,v.str,y.os.windows.version]],[/\((bb)(10);/i],[[u,"BlackBerry"],d],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)\/([\w\.]+)/i,/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i],[u,d],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[u,"Symbian"],d],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[u,"Firefox OS"],d],[/(nintendo|playstation)\s([wids3portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[u,d],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[u,"Chromium OS"],d],[/(sunos)\s?([\w\.]+\d)*/i],[[u,"Solaris"],d],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[u,d],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[u,"iOS"],[d,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i],[u,[d,/_/g,"."]],[/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i,/(unix)\s?([\w\.]+)*/i],[u,d]]},E=function(e){var n=e||(window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:t);this.getBrowser=function(){return v.rgx.apply(this,w.browser)},this.getEngine=function(){return v.rgx.apply(this,w.engine)},this.getOS=function(){return v.rgx.apply(this,w.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS()}},this.getUA=function(){return n},this.setUA=function(e){return n=e,this},this.setUA(n)};return(new E).getResult()}(),i=function(){var t={define_property:function(){return!1}(),create_canvas:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))}(),return_response_type:function(t){try{if(-1!==e.inArray(t,["","text","document"]))return!0;if(window.XMLHttpRequest){var n=new XMLHttpRequest;if(n.open("get","/"),"responseType"in n)return n.responseType=t,n.responseType!==t?!1:!0}}catch(i){}return!1},use_data_uri:function(){var e=new Image;return e.onload=function(){t.use_data_uri=1===e.width&&1===e.height},setTimeout(function(){e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1}(),use_data_uri_over32kb:function(){return t.use_data_uri&&("IE"!==r.browser||r.version>=9)},use_data_uri_of:function(e){return t.use_data_uri&&33e3>e||t.use_data_uri_over32kb()},use_fileinput:function(){var e=document.createElement("input");return e.setAttribute("type","file"),!e.disabled}};return function(n){var i=[].slice.call(arguments);return i.shift(),"function"===e.typeOf(t[n])?t[n].apply(this,i):!!t[n]}}(),r={can:i,browser:n.browser.name,version:parseFloat(n.browser.major),os:n.os.name,osVersion:n.os.version,verComp:t,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return r.OS=r.os,r}),i(f,[d],function(e){var t=function(e){return"string"!=typeof e?e:document.getElementById(e)},n=function(e,t){if(!e.className)return!1;var n=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return n.test(e.className)},i=function(e,t){n(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},r=function(e,t){if(e.className){var n=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(n,function(e,t,n){return" "===t&&" "===n?" ":""})}},o=function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},a=function(t,n){function i(e){var t,n,i=0,r=0;return e&&(n=e.getBoundingClientRect(),t="CSS1Compat"===s.compatMode?s.documentElement:s.body,i=n.left+t.scrollLeft,r=n.top+t.scrollTop),{x:i,y:r}}var r=0,o=0,a,s=document,u,c;if(t=t,n=n||s.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!s.documentMode||s.documentMode<8))return u=i(t),c=i(n),{x:u.x-c.x,y:u.y-c.y};for(a=t;a&&a!=n&&a.nodeType;)r+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=t.parentNode;a&&a!=n&&a.nodeType;)r-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode;return{x:r,y:o}},s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:t,hasClass:n,addClass:i,removeClass:r,getStyle:o,getPos:a,getSize:s}}),i(h,[u],function(e){function t(e,t){var n;for(n in e)if(e[n]===t)return n;return null}return{RuntimeError:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": RuntimeError "+this.code}var i={NOT_INIT_ERR:1,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(n,i),n.prototype=Error.prototype,n}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": ImageError "+this.code}var i={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2};return e.extend(n,i),n.prototype=Error.prototype,n}(),FileException:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": FileException "+this.code}var i={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};return e.extend(n,i),n.prototype=Error.prototype,n}(),DOMException:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": DOMException "+this.code}var i={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};return e.extend(n,i),n.prototype=Error.prototype,n}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}}),i(p,[h,u],function(e,t){function n(){var n={};t.extend(this,{uid:null,init:function(){this.uid||(this.uid=t.guid("uid_"))},addEventListener:function(e,i,r,o){var a=this,s;return e=t.trim(e),/\s/.test(e)?void t.each(e.split(/\s+/),function(e){a.addEventListener(e,i,r,o)}):(e=e.toLowerCase(),r=parseInt(r,10)||0,s=n[this.uid]&&n[this.uid][e]||[],s.push({fn:i,priority:r,scope:o||this}),n[this.uid]||(n[this.uid]={}),void(n[this.uid][e]=s))},hasEventListener:function(e){return e?!(!n[this.uid]||!n[this.uid][e]):!!n[this.uid]},removeEventListener:function(e,i){e=e.toLowerCase();var r=n[this.uid]&&n[this.uid][e],o;if(r){if(i){for(o=r.length-1;o>=0;o--)if(r[o].fn===i){r.splice(o,1);break}}else r=[];r.length||(delete n[this.uid][e],t.isEmptyObj(n[this.uid])&&delete n[this.uid])}},removeAllEventListeners:function(){n[this.uid]&&delete n[this.uid]},dispatchEvent:function(i){var r,o,a,s,u={},c=!0,l;if("string"!==t.typeOf(i)){if(s=i,"string"!==t.typeOf(s.type))throw new e.EventException(e.EventException.UNSPECIFIED_EVENT_TYPE_ERR);i=s.type,s.total!==l&&s.loaded!==l&&(u.total=s.total,u.loaded=s.loaded),u.async=s.async||!1}if(-1!==i.indexOf("::")?!function(e){r=e[0],i=e[1]}(i.split("::")):r=this.uid,i=i.toLowerCase(),o=n[r]&&n[r][i]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),u.type=i,a.unshift(u);var d=[];t.each(o,function(e){a[0].target=e.scope,d.push(u.async?function(t){setTimeout(function(){t(e.fn.apply(e.scope,a)===!1)},1)}:function(t){t(e.fn.apply(e.scope,a)===!1)})}),d.length&&t.inSeries(d,function(e){c=!e})}return c},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},convertEventPropsToHandlers:function(e){var n;"array"!==t.typeOf(e)&&(e=[e]);for(var i=0;i<e.length;i++)n="on"+e[i],"function"===t.typeOf(this[n])?this.addEventListener(e[i],this[n]):"undefined"===t.typeOf(this[n])&&(this[n]=null)}})}return n.instance=new n,n}),i(m,[],function(){var e=function(e){return unescape(encodeURIComponent(e))},t=function(e){return decodeURIComponent(escape(e))},n=function(e,n){if("function"==typeof window.atob)return n?t(window.atob(e)):window.atob(e);var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,o,a,s,u,c,l,d,f=0,h=0,p="",m=[];if(!e)return e;e+="";do s=i.indexOf(e.charAt(f++)),u=i.indexOf(e.charAt(f++)),c=i.indexOf(e.charAt(f++)),l=i.indexOf(e.charAt(f++)),d=s<<18|u<<12|c<<6|l,r=d>>16&255,o=d>>8&255,a=255&d,m[h++]=64==c?String.fromCharCode(r):64==l?String.fromCharCode(r,o):String.fromCharCode(r,o,a);while(f<e.length);return p=m.join(""),n?t(p):p},i=function(t,n){if(n&&e(t),"function"==typeof window.btoa)return window.btoa(t);var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,o,a,s,u,c,l,d,f=0,h=0,p="",m=[];if(!t)return t;do r=t.charCodeAt(f++),o=t.charCodeAt(f++),a=t.charCodeAt(f++),d=r<<16|o<<8|a,s=d>>18&63,u=d>>12&63,c=d>>6&63,l=63&d,m[h++]=i.charAt(s)+i.charAt(u)+i.charAt(c)+i.charAt(l);while(f<t.length);p=m.join("");var g=t.length%3;return(g?p.slice(0,g-3):p)+"===".slice(g||3)};return{utf8_encode:e,utf8_decode:t,atob:n,btoa:i}}),i(g,[u,f,p],function(e,t,n){function i(n,r,a,s,u){var c=this,l,d=e.guid(r+"_"),f=u||"browser";n=n||{},o[d]=this,a=e.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,filter_by_extension:!0,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_file:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},a),n.preferred_caps&&(f=i.getMode(s,n.preferred_caps,f)),l=function(){var t={};return{exec:function(e,n,i,r){return l[n]&&(t[e]||(t[e]={context:this,instance:new l[n]}),t[e].instance[i])?t[e].instance[i].apply(this,r):void 0},removeInstance:function(e){delete t[e]},removeAllInstances:function(){var n=this;e.each(t,function(t,i){"function"===e.typeOf(t.instance.destroy)&&t.instance.destroy.call(t.context),n.removeInstance(i)})}}}(),e.extend(this,{initialized:!1,uid:d,type:r,mode:i.getMode(s,n.required_caps,f),shimid:d+"_container",clients:0,options:n,can:function(t,n){var r=arguments[2]||a;if("string"===e.typeOf(t)&&"undefined"===e.typeOf(n)&&(t=i.parseCaps(t)),"object"===e.typeOf(t)){for(var o in t)if(!this.can(o,t[o],r))return!1;return!0}return"function"===e.typeOf(r[t])?r[t].call(this,n):n===r[t]},getShimContainer:function(){var n,i=t.get(this.shimid);return i||(n=this.options.container?t.get(this.options.container):document.body,i=document.createElement("div"),i.id=this.shimid,i.className="moxie-shim moxie-shim-"+this.type,e.extend(i.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),n.appendChild(i),n=null),i},getShim:function(){return l},shimExec:function(e,t){var n=[].slice.call(arguments,2);return c.getShim().exec.call(this,this.uid,e,t,n)},exec:function(e,t){var n=[].slice.call(arguments,2);return c[e]&&c[e][t]?c[e][t].apply(this,n):c.shimExec.apply(this,arguments)},destroy:function(){if(c){var e=t.get(this.shimid);e&&e.parentNode.removeChild(e),l&&l.removeAllInstances(),this.unbindAll(),delete o[this.uid],this.uid=null,d=c=l=e=null}}}),this.mode&&n.required_caps&&!this.can(n.required_caps)&&(this.mode=!1)}var r={},o={};return i.order="html5,flash,silverlight,html4",i.getRuntime=function(e){return o[e]?o[e]:!1},i.addConstructor=function(e,t){t.prototype=n.instance,r[e]=t},i.getConstructor=function(e){return r[e]||null},i.getInfo=function(e){var t=i.getRuntime(e);return t?{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}:null},i.parseCaps=function(t){var n={};return"string"!==e.typeOf(t)?t||{}:(e.each(t.split(","),function(e){n[e]=!0}),n)},i.can=function(e,t){var n,r=i.getConstructor(e),o;return r?(n=new r({required_caps:t}),o=n.mode,n.destroy(),!!o):!1},i.thatCan=function(e,t){var n=(t||i.order).split(/\s*,\s*/);for(var r in n)if(i.can(n[r],e))return n[r];return null},i.getMode=function(t,n,i){var r=null;if("undefined"===e.typeOf(i)&&(i="browser"),n&&!e.isEmptyObj(t)){if(e.each(n,function(n,i){if(t.hasOwnProperty(i)){var o=t[i](n);if("string"==typeof o&&(o=[o]),r){if(!(r=e.arrayIntersect(r,o)))return r=!1}else r=o}}),r)return-1!==e.inArray(i,r)?i:r[0];if(r===!1)return!1}return i},i.capTrue=function(){return!0},i.capFalse=function(){return!1},i.capTest=function(e){return function(){return!!e}},i}),i(v,[h,u,g],function(e,t,n){return function i(){var i;t.extend(this,{connectRuntime:function(r){function o(t){var s,u;return t.length?(s=t.shift(),(u=n.getConstructor(s))?(i=new u(r),i.bind("Init",function(){i.initialized=!0,setTimeout(function(){i.clients++,a.trigger("RuntimeInit",i)},1)}),i.bind("Error",function(){i.destroy(),o(t)}),i.mode?void i.init():void i.trigger("Error")):void o(t)):(a.trigger("RuntimeError",new e.RuntimeError(e.RuntimeError.NOT_INIT_ERR)),void(i=null))}var a=this,s;if("string"===t.typeOf(r)?s=r:"string"===t.typeOf(r.ruid)&&(s=r.ruid),s){if(i=n.getRuntime(s))return i.clients++,i;throw new e.RuntimeError(e.RuntimeError.NOT_INIT_ERR)}o((r.runtime_order||n.order).split(/\s*,\s*/))},getRuntime:function(){return i&&i.uid?i:(i=null,null)},disconnectRuntime:function(){i&&--i.clients<=0&&(i.destroy(),i=null)}})}}),i(y,[u,m,v],function(e,t,n){function i(o,a){function s(t,n,o){var a,s=r[this.uid];return"string"===e.typeOf(s)&&s.length?(a=new i(null,{type:o,size:n-t}),a.detach(s.substr(t,a.size)),a):null}n.call(this),o&&this.connectRuntime(o),a?"string"===e.typeOf(a)&&(a={data:a}):a={},e.extend(this,{uid:a.uid||e.guid("uid_"),ruid:o,size:a.size||0,type:a.type||"",slice:function(e,t,n){return this.isDetached()?s.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,n)},getSource:function(){return r[this.uid]?r[this.uid]:null},detach:function(e){this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy"),this.disconnectRuntime(),this.ruid=null),e=e||"";var n=e.match(/^data:([^;]*);base64,/);n&&(this.type=n[1],e=t.atob(e.substring(e.indexOf("base64,")+7))),this.size=e.length,r[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===e.typeOf(r[this.uid])},destroy:function(){this.detach(),delete r[this.uid]}}),a.data?this.detach(a.data):r[this.uid]=a}var r={};return i}),i(w,[u,l,y],function(e,t,n){function i(i,r){var o,a;if(r||(r={}),a=r.type&&""!==r.type?r.type:t.getFileMime(r.name),r.name)o=r.name.replace(/\\/g,"/"),o=o.substr(o.lastIndexOf("/")+1);else{var s=a.split("/")[0];o=e.guid((""!==s?s:"file")+"_"),t.extensions[a]&&(o+="."+t.extensions[a][0])}n.apply(this,arguments),e.extend(this,{type:a||"",name:o||e.guid("file_"),lastModifiedDate:r.lastModifiedDate||(new Date).toLocaleString()})}return i.prototype=n.prototype,i}),i(E,[u,l,f,h,p,c,w,g,v],function(e,t,n,i,r,o,a,s,u){function c(r){var c=this,d,f,h;if(-1!==e.inArray(e.typeOf(r),["string","node"])&&(r={browse_button:r}),f=n.get(r.browse_button),!f)throw new i.DOMException(i.DOMException.NOT_FOUND_ERR);h={accept:[{title:o.translate("All Files"),extensions:"*"}],name:"file",multiple:!1,required_caps:!1,container:f.parentNode||document.body},r=e.extend({},h,r),"string"==typeof r.required_caps&&(r.required_caps=s.parseCaps(r.required_caps)),"string"==typeof r.accept&&(r.accept=t.mimes2extList(r.accept)),d=n.get(r.container),d||(d=document.body),"static"===n.getStyle(d,"position")&&(d.style.position="relative"),d=f=null,u.call(c),e.extend(c,{uid:e.guid("uid_"),ruid:null,shimid:null,files:null,init:function(){c.convertEventPropsToHandlers(l),c.bind("RuntimeInit",function(t,i){c.ruid=i.uid,c.shimid=i.shimid,c.bind("Ready",function(){c.trigger("Refresh")},999),c.bind("Change",function(){var t=i.exec.call(c,"FileInput","getFiles");c.files=[],e.each(t,function(e){return 0===e.size?!0:void c.files.push(new a(c.ruid,e))})},999),c.bind("Refresh",function(){var t,o,a,s;a=n.get(r.browse_button),s=n.get(i.shimid),a&&(t=n.getPos(a,n.get(r.container)),o=n.getSize(a),s&&e.extend(s.style,{top:t.y+"px",left:t.x+"px",width:o.w+"px",height:o.h+"px"})),s=a=null}),i.exec.call(c,"FileInput","init",r)}),c.connectRuntime(e.extend({},r,{required_caps:{select_file:!0}}))},disable:function(t){var n=this.getRuntime();n&&n.exec.call(this,"FileInput","disable","undefined"===e.typeOf(t)?!0:t)},refresh:function(){c.trigger("Refresh")},destroy:function(){var t=this.getRuntime();t&&(t.exec.call(this,"FileInput","destroy"),this.disconnectRuntime()),"array"===e.typeOf(this.files)&&e.each(this.files,function(e){e.destroy()}),this.files=null}})}var l=["ready","change","cancel","mouseenter","mouseleave","mousedown","mouseup"];return c.prototype=r.instance,c}),i(_,[c,f,h,u,w,v,p,l],function(e,t,n,i,r,o,a,s){function u(n){var a=this,u;"string"==typeof n&&(n={drop_zone:n}),u={accept:[{title:e.translate("All Files"),extensions:"*"}],required_caps:{drag_and_drop:!0}},n="object"==typeof n?i.extend({},u,n):u,n.container=t.get(n.drop_zone)||document.body,"static"===t.getStyle(n.container,"position")&&(n.container.style.position="relative"),"string"==typeof n.accept&&(n.accept=s.mimes2extList(n.accept)),o.call(a),i.extend(a,{uid:i.guid("uid_"),ruid:null,files:null,init:function(){a.convertEventPropsToHandlers(c),a.bind("RuntimeInit",function(e,t){a.ruid=t.uid,a.bind("Drop",function(){var e=t.exec.call(a,"FileDrop","getFiles");a.files=[],i.each(e,function(e){a.files.push(new r(a.ruid,e))})},999),t.exec.call(a,"FileDrop","init",n),a.dispatchEvent("ready")}),a.connectRuntime(n)},destroy:function(){var e=this.getRuntime();e&&(e.exec.call(this,"FileDrop","destroy"),this.disconnectRuntime()),this.files=null}})}var c=["ready","dragenter","dragleave","drop","error"];return u.prototype=a.instance,u}),i(x,[u,v,p],function(e,t,n){function i(){this.uid=e.guid("uid_"),t.call(this),this.destroy=function(){this.disconnectRuntime(),this.unbindAll()}}return i.prototype=n.instance,i}),i(b,[u,m,h,p,y,w,x],function(e,t,n,i,r,o,a){function s(){function i(e,i){function l(e){o.readyState=s.DONE,o.error=e,o.trigger("error"),d()}function d(){c.destroy(),c=null,o.trigger("loadend")}function f(t){c.bind("Error",function(e,t){l(t)}),c.bind("Progress",function(e){o.result=t.exec.call(c,"FileReader","getResult"),o.trigger(e)}),c.bind("Load",function(e){o.readyState=s.DONE,o.result=t.exec.call(c,"FileReader","getResult"),o.trigger(e),d()}),t.exec.call(c,"FileReader","read",e,i)}if(c=new a,this.convertEventPropsToHandlers(u),this.readyState===s.LOADING)return l(new n.DOMException(n.DOMException.INVALID_STATE_ERR));if(this.readyState=s.LOADING,this.trigger("loadstart"),i instanceof r)if(i.isDetached()){var h=i.getSource();switch(e){case"readAsText":case"readAsBinaryString":this.result=h;break;case"readAsDataURL":this.result="data:"+i.type+";base64,"+t.btoa(h)}this.readyState=s.DONE,this.trigger("load"),d()}else f(c.connectRuntime(i.ruid));else l(new n.DOMException(n.DOMException.NOT_FOUND_ERR))}var o=this,c;e.extend(this,{uid:e.guid("uid_"),readyState:s.EMPTY,result:null,error:null,readAsBinaryString:function(e){i.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){i.call(this,"readAsDataURL",e)},readAsText:function(e){i.call(this,"readAsText",e)},abort:function(){this.result=null,-1===e.inArray(this.readyState,[s.EMPTY,s.DONE])&&(this.readyState===s.LOADING&&(this.readyState=s.DONE),c&&c.getRuntime().exec.call(this,"FileReader","abort"),this.trigger("abort"),this.trigger("loadend"))
},destroy:function(){this.abort(),c&&(c.getRuntime().exec.call(this,"FileReader","destroy"),c.disconnectRuntime()),o=c=null}})}var u=["loadstart","progress","load","abort","error","loadend"];return s.EMPTY=0,s.LOADING=1,s.DONE=2,s.prototype=i.instance,s}),i(R,[],function(){var e=function(t,n){for(var i=["source","scheme","authority","userInfo","user","pass","host","port","relative","path","directory","file","query","fragment"],r=i.length,o={http:80,https:443},a={},s=/^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,u=s.exec(t||"");r--;)u[r]&&(a[i[r]]=u[r]);if(!a.scheme){n&&"string"!=typeof n||(n=e(n||document.location.href)),a.scheme=n.scheme,a.host=n.host,a.port=n.port;var c="";/^[^\/]/.test(a.path)&&(c=n.path,/(\/|\/[^\.]+)$/.test(c)?c+="/":c=c.replace(/\/[^\/]+$/,"/")),a.path=c+(a.path||"")}return a.port||(a.port=o[a.scheme]||80),a.port=parseInt(a.port,10),a.path||(a.path="/"),delete a.source,a},t=function(t){var n={http:80,https:443},i=e(t);return i.scheme+"://"+i.host+(i.port!==n[i.scheme]?":"+i.port:"")+i.path+(i.query?i.query:"")},n=function(t){function n(e){return[e.scheme,e.host,e.port].join("/")}return"string"==typeof t&&(t=e(t)),n(e())===n(t)};return{parseUrl:e,resolveUrl:t,hasSameOrigin:n}}),i(T,[u,v,m],function(e,t,n){return function(){function i(e,t){if(!t.isDetached()){var i=this.connectRuntime(t.ruid).exec.call(this,"FileReaderSync","read",e,t);return this.disconnectRuntime(),i}var r=t.getSource();switch(e){case"readAsBinaryString":return r;case"readAsDataURL":return"data:"+t.type+";base64,"+n.btoa(r);case"readAsText":for(var o="",a=0,s=r.length;s>a;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return i.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return i.call(this,"readAsDataURL",e)},readAsText:function(e){return i.call(this,"readAsText",e)}})}}),i(A,[h,u,y],function(e,t,n){function i(){var e,i=[];t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof n?e={name:r,value:o}:"array"===s?(r+="[]",t.each(o,function(e){a.append(r,e)})):"object"===s?t.each(o,function(e,t){a.append(r+"["+t+"]",e)}):"null"===s||"undefined"===s||"number"===s&&isNaN(o)?a.append(r,"false"):i.push({name:r,value:o.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return e&&e.value||null},getBlobName:function(){return e&&e.name||null},each:function(n){t.each(i,function(e){n(e.value,e.name)}),e&&n(e.value,e.name)},destroy:function(){e=null,i=[]}})}return i}),i(S,[u,h,p,m,R,g,x,y,T,A,d,l],function(e,t,n,i,r,o,a,s,u,c,l,d){function f(){this.uid=e.guid("uid_")}function h(){function n(e,t){return y.hasOwnProperty(e)?1===arguments.length?l.can("define_property")?y[e]:v[e]:void(l.can("define_property")?y[e]=t:v[e]=t):void 0}function u(t){function i(){k&&(k.destroy(),k=null),s.dispatchEvent("loadend"),s=null}function r(r){k.bind("LoadStart",function(e){n("readyState",h.LOADING),s.dispatchEvent("readystatechange"),s.dispatchEvent(e),I&&s.upload.dispatchEvent(e)}),k.bind("Progress",function(e){n("readyState")!==h.LOADING&&(n("readyState",h.LOADING),s.dispatchEvent("readystatechange")),s.dispatchEvent(e)}),k.bind("UploadProgress",function(e){I&&s.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),k.bind("Load",function(t){n("readyState",h.DONE),n("status",Number(r.exec.call(k,"XMLHttpRequest","getStatus")||0)),n("statusText",p[n("status")]||""),n("response",r.exec.call(k,"XMLHttpRequest","getResponse",n("responseType"))),~e.inArray(n("responseType"),["text",""])?n("responseText",n("response")):"document"===n("responseType")&&n("responseXML",n("response")),U=r.exec.call(k,"XMLHttpRequest","getAllResponseHeaders"),s.dispatchEvent("readystatechange"),n("status")>0?(I&&s.upload.dispatchEvent(t),s.dispatchEvent(t)):(N=!0,s.dispatchEvent("error")),i()}),k.bind("Abort",function(e){s.dispatchEvent(e),i()}),k.bind("Error",function(e){N=!0,n("readyState",h.DONE),s.dispatchEvent("readystatechange"),D=!0,s.dispatchEvent(e),i()}),r.exec.call(k,"XMLHttpRequest","send",{url:E,method:_,async:w,user:b,password:R,headers:x,mimeType:A,encoding:T,responseType:s.responseType,withCredentials:s.withCredentials,options:P},t)}var s=this;M=(new Date).getTime(),k=new a,"string"==typeof P.required_caps&&(P.required_caps=o.parseCaps(P.required_caps)),P.required_caps=e.extend({},P.required_caps,{return_response_type:s.responseType}),t instanceof c&&(P.required_caps.send_multipart=!0),L||(P.required_caps.do_cors=!0),P.ruid?r(k.connectRuntime(P)):(k.bind("RuntimeInit",function(e,t){r(t)}),k.bind("RuntimeError",function(e,t){s.dispatchEvent("RuntimeError",t)}),k.connectRuntime(P))}function g(){n("responseText",""),n("responseXML",null),n("response",null),n("status",0),n("statusText",""),M=C=null}var v=this,y={timeout:0,readyState:h.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},w=!0,E,_,x={},b,R,T=null,A=null,S=!1,O=!1,I=!1,D=!1,N=!1,L=!1,M,C,F=null,H=null,P={},k,U="",B;e.extend(this,y,{uid:e.guid("uid_"),upload:new f,open:function(o,a,s,u,c){var l;if(!o||!a)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(o)||i.utf8_encode(o)!==o)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~e.inArray(o.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(_=o.toUpperCase()),~e.inArray(_,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=i.utf8_encode(a),l=r.parseUrl(a),L=r.hasSameOrigin(l),E=r.resolveUrl(a),(u||c)&&!L)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(b=u||l.user,R=c||l.pass,w=s||!0,w===!1&&(n("timeout")||n("withCredentials")||""!==n("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);S=!w,O=!1,x={},g.call(this),n("readyState",h.OPENED),this.convertEventPropsToHandlers(["readystatechange"]),this.dispatchEvent("readystatechange")},setRequestHeader:function(r,o){var a=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];if(n("readyState")!==h.OPENED||O)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(r)||i.utf8_encode(r)!==r)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return r=e.trim(r).toLowerCase(),~e.inArray(r,a)||/^(proxy\-|sec\-)/.test(r)?!1:(x[r]?x[r]+=", "+o:x[r]=o,!0)},getAllResponseHeaders:function(){return U||""},getResponseHeader:function(t){return t=t.toLowerCase(),N||~e.inArray(t,["set-cookie","set-cookie2"])?null:U&&""!==U&&(B||(B={},e.each(U.split(/\r\n/),function(t){var n=t.split(/:\s+/);2===n.length&&(n[0]=e.trim(n[0]),B[n[0].toLowerCase()]={header:n[0],value:e.trim(n[1])})})),B.hasOwnProperty(t))?B[t].header+": "+B[t].value:null},overrideMimeType:function(i){var r,o;if(~e.inArray(n("readyState"),[h.LOADING,h.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i=e.trim(i.toLowerCase()),/;/.test(i)&&(r=i.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(i=r[1],r[2]&&(o=r[2])),!d.mimes[i])throw new t.DOMException(t.DOMException.SYNTAX_ERR);F=i,H=o},send:function(n,r){if(P="string"===e.typeOf(r)?{ruid:r}:r?r:{},this.convertEventPropsToHandlers(m),this.upload.convertEventPropsToHandlers(m),this.readyState!==h.OPENED||O)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(n instanceof s)P.ruid=n.ruid,A=n.type||"application/octet-stream";else if(n instanceof c){if(n.hasBlob()){var o=n.getBlob();P.ruid=o.ruid,A=o.type||"application/octet-stream"}}else"string"==typeof n&&(T="UTF-8",A="text/plain;charset=UTF-8",n=i.utf8_encode(n));this.withCredentials||(this.withCredentials=P.required_caps&&P.required_caps.send_browser_cookies&&!L),I=!S&&this.upload.hasEventListener(),N=!1,D=!n,S||(O=!0),u.call(this,n)},abort:function(){if(N=!0,S=!1,~e.inArray(n("readyState"),[h.UNSENT,h.OPENED,h.DONE]))n("readyState",h.UNSENT);else{if(n("readyState",h.DONE),O=!1,!k)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);k.getRuntime().exec.call(k,"XMLHttpRequest","abort",D),D=!0}},destroy:function(){k&&("function"===e.typeOf(k.destroy)&&k.destroy(),k=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}})}var p={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};f.prototype=n.instance;var m=["loadstart","progress","abort","error","load","timeout","loadend"],g=1,v=2;return h.UNSENT=0,h.OPENED=1,h.HEADERS_RECEIVED=2,h.LOADING=3,h.DONE=4,h.prototype=n.instance,h}),i(O,[u,m,v,p],function(e,t,n,i){function r(){function i(){l=d=0,c=this.result=null}function o(t,n){var i=this;u=n,i.bind("TransportingProgress",function(t){d=t.loaded,l>d&&-1===e.inArray(i.state,[r.IDLE,r.DONE])&&a.call(i)},999),i.bind("TransportingComplete",function(){d=l,i.state=r.DONE,c=null,i.result=u.exec.call(i,"Transporter","getAsBlob",t||"")},999),i.state=r.BUSY,i.trigger("TransportingStarted"),a.call(i)}function a(){var e=this,n,i=l-d;f>i&&(f=i),n=t.btoa(c.substr(d,f)),u.exec.call(e,"Transporter","receive",n,l)}var s,u,c,l,d,f;n.call(this),e.extend(this,{uid:e.guid("uid_"),state:r.IDLE,result:null,transport:function(t,n,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),f=r.chunk_size,i.call(this),c=t,l=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,n,this.connectRuntime(r));else{var u=function(e,t){a.unbind("RuntimeInit",u),o.call(a,n,t)};this.bind("RuntimeInit",u),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,u&&(u.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),i.call(e)},destroy:function(){this.unbindAll(),u=null,this.disconnectRuntime(),i.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=i.instance,r}),i(I,[u,f,h,T,S,g,v,O,d,p,y,w,m],function(e,t,n,i,r,o,a,s,u,c,l,d,f){function h(){function i(e){e||(e=this.getRuntime().exec.call(this,"Image","getInfo")),this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name)}function c(t){var i=e.typeOf(t);try{if(t instanceof h){if(!t.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);m.apply(this,arguments)}else if(t instanceof l){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new n.ImageError(n.ImageError.WRONG_FORMAT);g.apply(this,arguments)}else if(-1!==e.inArray(i,["blob","file"]))c.call(this,new d(null,t),arguments[1]);else if("string"===i)/^data:[^;]*;base64,/.test(t)?c.call(this,new l(null,{data:t}),arguments[1]):v.apply(this,arguments);else{if("node"!==i||"img"!==t.nodeName.toLowerCase())throw new n.DOMException(n.DOMException.TYPE_MISMATCH_ERR);c.call(this,t.src,arguments[1])}}catch(r){this.trigger("error",r.code)}}function m(t,n){var i=this.connectRuntime(t.ruid);this.ruid=i.uid,i.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(n)?!0:n)}function g(t,n){function i(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){i(t)}),n&&"string"==typeof n.required_caps&&(n.required_caps=o.parseCaps(n.required_caps)),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resize_image:!0}},n))):i(this.connectRuntime(t.ruid))}function v(e,t){var n=this,i;i=new r,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){g.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}a.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){this.bind("Load Resize",function(){i.call(this)},999),this.convertEventPropsToHandlers(p),c.apply(this,arguments)},downsize:function(t){var i={width:this.width,height:this.height,crop:!1,preserveHeaders:!0};t="object"==typeof t?e.extend(i,t):e.extend(i,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]});try{if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);if(this.width>h.MAX_RESIZE_WIDTH||this.height>h.MAX_RESIZE_HEIGHT)throw new n.ImageError(n.ImageError.MAX_RESOLUTION_ERR);this.getRuntime().exec.call(this,"Image","downsize",t.width,t.height,t.crop,t.preserveHeaders)}catch(r){this.trigger("error",r.code)}},crop:function(e,t,n){this.downsize(e,t,!0,n)},getAsCanvas:function(){if(!u.can("create_canvas"))throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);var e=this.connectRuntime(this.ruid);return e.exec.call(this,"Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);return e||(e="image/jpeg"),"image/jpeg"!==e||t||(t=90),this.getRuntime().exec.call(this,"Image","getAsBlob",e,t)},getAsDataURL:function(e,t){if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);return this.getRuntime().exec.call(this,"Image","getAsDataURL",e,t)},getAsBinaryString:function(e,t){var n=this.getAsDataURL(e,t);return f.atob(n.substring(n.indexOf("base64,")+7))},embed:function(i){function r(){if(u.can("create_canvas")){var t=a.getAsCanvas();if(t)return i.appendChild(t),t=null,a.destroy(),void o.trigger("embedded")}var r=a.getAsDataURL(c,l);if(!r)throw new n.ImageError(n.ImageError.WRONG_FORMAT);if(u.can("use_data_uri_of",r.length))i.innerHTML='<img src="'+r+'" width="'+a.width+'" height="'+a.height+'" />',a.destroy(),o.trigger("embedded");else{var d=new s;d.bind("TransportingComplete",function(){v=o.connectRuntime(this.result.ruid),o.bind("Embedded",function(){e.extend(v.getShimContainer().style,{top:"0px",left:"0px",width:a.width+"px",height:a.height+"px"}),v=null},999),v.exec.call(o,"ImageView","display",this.result.uid,m,g),a.destroy()}),d.transport(f.atob(r.substring(r.indexOf("base64,")+7)),c,e.extend({},p,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:i}))}}var o=this,a,c,l,d,p=arguments[1]||{},m=this.width,g=this.height,v;try{if(!(i=t.get(i)))throw new n.DOMException(n.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);if(this.width>h.MAX_RESIZE_WIDTH||this.height>h.MAX_RESIZE_HEIGHT)throw new n.ImageError(n.ImageError.MAX_RESOLUTION_ERR);if(c=p.type||this.type||"image/jpeg",l=p.quality||90,d="undefined"!==e.typeOf(p.crop)?p.crop:!1,p.width)m=p.width,g=p.height||m;else{var y=t.getSize(i);y.w&&y.h&&(m=y.w,g=y.h)}return a=new h,a.bind("Resize",function(){r.call(o)}),a.bind("Load",function(){a.downsize(m,g,d,!1)}),a.clone(this,!1),a}catch(w){this.trigger("error",w.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.unbindAll()}})}var p=["progress","load","error","resize","embedded"];return h.MAX_RESIZE_WIDTH=6500,h.MAX_RESIZE_HEIGHT=6500,h.prototype=c.instance,h}),i(D,[u,h,g,d],function(e,t,n,i){function r(t){var r=this,s=n.capTest,u=n.capTrue,c=e.extend({access_binary:s(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return r.can("access_binary")&&!!a.Image},display_media:s(i.can("create_canvas")||i.can("use_data_uri_over32kb")),do_cors:s(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:s(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==i.browser||i.version>9)}()),filter_by_extension:s(function(){return"Chrome"===i.browser&&i.version>=28||"IE"===i.browser&&i.version>=10}()),return_response_headers:u,return_response_type:function(e){return"json"===e&&window.JSON?!0:i.can("return_response_type",e)},return_status_code:u,report_upload_progress:s(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return r.can("access_binary")&&i.can("create_canvas")},select_file:function(){return i.can("use_fileinput")&&window.File},select_folder:function(){return r.can("select_file")&&"Chrome"===i.browser&&i.version>=21},select_multiple:function(){return!(!r.can("select_file")||"Safari"===i.browser&&"Windows"===i.os||"iOS"===i.os&&i.verComp(i.osVersion,"7.0.4","<"))},send_binary_string:s(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:s(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||r.can("send_binary_string")},slice_blob:s(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return r.can("slice_blob")&&r.can("send_multipart")},summon_file_dialog:s(function(){return"Firefox"===i.browser&&i.version>=4||"Opera"===i.browser&&i.version>=12||"IE"===i.browser&&i.version>=10||!!~e.inArray(i.browser,["Chrome","Safari"])}()),upload_filesize:u},arguments[2]);n.call(this,t,arguments[1]||o,c),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(r),e=r=null}}(this.destroy)}),e.extend(this.getShim(),a)}var o="html5",a={};return n.addConstructor(o,r),a}),i(N,[D,y],function(e,t){function n(){function e(e,t,n){var i;if(!window.File.prototype.slice)return(i=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?i.call(e,t,n):null;try{return e.slice(),e.slice(t,n)}catch(r){return e.slice(t,n-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))}}return e.Blob=n}),i(L,[u],function(e){function t(){this.returnValue=!1}function n(){this.cancelBubble=!0}var i={},r="moxie_"+e.guid(),o=function(o,a,s,u){var c,l;a=a.toLowerCase(),o.addEventListener?(c=s,o.addEventListener(a,c,!1)):o.attachEvent&&(c=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=t,e.stopPropagation=n,s(e)},o.attachEvent("on"+a,c)),o[r]||(o[r]=e.guid()),i.hasOwnProperty(o[r])||(i[o[r]]={}),l=i[o[r]],l.hasOwnProperty(a)||(l[a]=[]),l[a].push({func:c,orig:s,key:u})},a=function(t,n,o){var a,s;if(n=n.toLowerCase(),t[r]&&i[t[r]]&&i[t[r]][n]){a=i[t[r]][n];for(var u=a.length-1;u>=0&&(a[u].orig!==o&&a[u].key!==o||(t.removeEventListener?t.removeEventListener(n,a[u].func,!1):t.detachEvent&&t.detachEvent("on"+n,a[u].func),a[u].orig=null,a[u].func=null,a.splice(u,1),o===s));u--);if(a.length||delete i[t[r]][n],e.isEmptyObj(i[t[r]])){delete i[t[r]];try{delete t[r]}catch(c){t[r]=s}}}},s=function(t,n){t&&t[r]&&e.each(i[t[r]],function(e,i){a(t,i,n)})};return{addEvent:o,removeEvent:a,removeAllEvents:s}}),i(M,[D,u,f,L,l,d],function(e,t,n,i,r,o){function a(){var e=[],a;t.extend(this,{init:function(s){var u=this,c=u.getRuntime(),l,d,f,h,p,m;a=s,e=[],f=a.accept.mimes||r.extList2mimes(a.accept,c.can("filter_by_extension")),d=c.getShimContainer(),d.innerHTML='<input id="'+c.uid+'" type="file" style="font-size:999px;opacity:0;"'+(a.multiple&&c.can("select_multiple")?"multiple":"")+(a.directory&&c.can("select_folder")?"webkitdirectory directory":"")+(f?' accept="'+f.join(",")+'"':"")+" />",l=n.get(c.uid),t.extend(l.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),h=n.get(a.browse_button),c.can("summon_file_dialog")&&("static"===n.getStyle(h,"position")&&(h.style.position="relative"),p=parseInt(n.getStyle(h,"z-index"),10)||1,h.style.zIndex=p,d.style.zIndex=p-1,i.addEvent(h,"click",function(e){var t=n.get(c.uid);t&&!t.disabled&&t.click(),e.preventDefault()},u.uid)),m=c.can("summon_file_dialog")?h:d,i.addEvent(m,"mouseover",function(){u.trigger("mouseenter")},u.uid),i.addEvent(m,"mouseout",function(){u.trigger("mouseleave")},u.uid),i.addEvent(m,"mousedown",function(){u.trigger("mousedown")},u.uid),i.addEvent(n.get(a.container),"mouseup",function(){u.trigger("mouseup")},u.uid),l.onchange=function g(){if(e=[],a.directory?t.each(this.files,function(t){"."!==t.name&&e.push(t)}):e=[].slice.call(this.files),"IE"!==o.browser&&"IEMobile"!==o.browser)this.value="";else{var n=this.cloneNode(!0);this.parentNode.replaceChild(n,this),n.onchange=g}u.trigger("change")},u.trigger({type:"ready",async:!0}),d=null},getFiles:function(){return e},disable:function(e){var t=this.getRuntime(),i;(i=n.get(t.uid))&&(i.disabled=!!e)},destroy:function(){var t=this.getRuntime(),r=t.getShim(),o=t.getShimContainer();i.removeAllEvents(o,this.uid),i.removeAllEvents(a&&n.get(a.container),this.uid),i.removeAllEvents(a&&n.get(a.browse_button),this.uid),o&&(o.innerHTML=""),r.removeInstance(this.uid),e=a=o=r=null}})}return e.FileInput=a}),i(C,[D,u,f,L,l],function(e,t,n,i,r){function o(){function e(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;var n=t.toArray(e.dataTransfer.types||[]);return-1!==t.inArray("Files",n)||-1!==t.inArray("public.file-url",n)||-1!==t.inArray("application/x-moz-file",n)}function o(e){for(var n=[],i=0;i<e.length;i++)[].push.apply(n,e[i].extensions.split(/\s*,\s*/));return-1===t.inArray("*",n)?n:[]}function a(e){if(!f.length)return!0;var n=r.getFileExtension(e.name);return!n||-1!==t.inArray(n,f)}function s(e,n){var i=[];t.each(e,function(e){var t=e.webkitGetAsEntry();if(t)if(t.isFile){var n=e.getAsFile();a(n)&&d.push(n)}else i.push(t)}),i.length?u(i,n):n()}function u(e,n){var i=[];t.each(e,function(e){i.push(function(t){c(e,t)})}),t.inSeries(i,function(){n()})}function c(e,t){e.isFile?e.file(function(e){a(e)&&d.push(e),t()},function(){t()}):e.isDirectory?l(e,t):t()}function l(e,t){function n(e){r.readEntries(function(t){t.length?([].push.apply(i,t),n(e)):e()},e)}var i=[],r=e.createReader();n(function(){u(i,t)})}var d=[],f=[],h;t.extend(this,{init:function(n){var r=this,u;h=n,f=o(h.accept),u=h.container,i.addEvent(u,"dragover",function(t){e(t)&&(t.preventDefault(),t.dataTransfer.dropEffect="copy")},r.uid),i.addEvent(u,"drop",function(n){e(n)&&(n.preventDefault(),d=[],n.dataTransfer.items&&n.dataTransfer.items[0].webkitGetAsEntry?s(n.dataTransfer.items,function(){r.trigger("drop")}):(t.each(n.dataTransfer.files,function(e){a(e)&&d.push(e)}),r.trigger("drop")))},r.uid),i.addEvent(u,"dragenter",function(e){r.trigger("dragenter")},r.uid),i.addEvent(u,"dragleave",function(e){r.trigger("dragleave")},r.uid)},getFiles:function(){return d},destroy:function(){i.removeAllEvents(h&&n.get(h.container),this.uid),d=f=h=null}})}return e.FileDrop=o}),i(F,[D,m,u],function(e,t,n){function i(){function e(e){return t.atob(e.substring(e.indexOf("base64,")+7))}var i,r=!1;n.extend(this,{read:function(e,t){var o=this;i=new window.FileReader,i.addEventListener("progress",function(e){o.trigger(e)}),i.addEventListener("load",function(e){o.trigger(e)}),i.addEventListener("error",function(e){o.trigger(e,i.error)}),i.addEventListener("loadend",function(){i=null}),"function"===n.typeOf(i[e])?(r=!1,i[e](t.getSource())):"readAsBinaryString"===e&&(r=!0,i.readAsDataURL(t.getSource()))},getResult:function(){return i&&i.result?r?e(i.result):i.result:null},abort:function(){i&&i.abort()},destroy:function(){i=null}})}return e.FileReader=i}),i(H,[D,u,l,R,w,y,A,h,d],function(e,t,n,i,r,o,a,s,u){function c(){function e(e,t){var n=this,i,r;i=t.getBlob().getSource(),r=new window.FileReader,r.onload=function(){t.append(t.getBlobName(),new o(null,{type:i.type,data:r.result})),f.send.call(n,e,t)},r.readAsBinaryString(i)}function c(){return!window.XMLHttpRequest||"IE"===u.browser&&u.version<8?function(){for(var e=["Msxml2.XMLHTTP.6.0","Microsoft.XMLHTTP"],t=0;t<e.length;t++)try{return new ActiveXObject(e[t])}catch(n){}}():new window.XMLHttpRequest}function l(e){var t=e.responseXML,n=e.responseText;return"IE"===u.browser&&n&&t&&!t.documentElement&&/[^\/]+\/[^\+]+\+xml/.test(e.getResponseHeader("Content-Type"))&&(t=new window.ActiveXObject("Microsoft.XMLDOM"),t.async=!1,t.validateOnParse=!1,t.loadXML(n)),t&&("IE"===u.browser&&0!==t.parseError||!t.documentElement||"parsererror"===t.documentElement.tagName)?null:t}function d(e){var t="----moxieboundary"+(new Date).getTime(),n="--",i="\r\n",r="",a=this.getRuntime();if(!a.can("send_binary_string"))throw new s.RuntimeError(s.RuntimeError.NOT_SUPPORTED_ERR);return h.setRequestHeader("Content-Type","multipart/form-data; boundary="+t),e.each(function(e,a){r+=e instanceof o?n+t+i+'Content-Disposition: form-data; name="'+a+'"; filename="'+unescape(encodeURIComponent(e.name||"blob"))+'"'+i+"Content-Type: "+(e.type||"application/octet-stream")+i+i+e.getSource()+i:n+t+i+'Content-Disposition: form-data; name="'+a+'"'+i+i+unescape(encodeURIComponent(e))+i}),r+=n+t+n+i}var f=this,h,p;t.extend(this,{send:function(n,r){var s=this,l="Mozilla"===u.browser&&u.version>=4&&u.version<7,f="Android Browser"===u.browser,m=!1;if(p=n.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),h=c(),h.open(n.method,n.url,n.async,n.user,n.password),r instanceof o)r.isDetached()&&(m=!0),r=r.getSource();else if(r instanceof a){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(s,r),m=!0;else if((l||f)&&"blob"===t.typeOf(r.getBlob().getSource())&&window.FileReader)return void e.call(s,n,r);if(r instanceof a){var g=new window.FormData;r.each(function(e,t){e instanceof o?g.append(t,e.getSource()):g.append(t,e)}),r=g}}h.upload?(n.withCredentials&&(h.withCredentials=!0),h.addEventListener("load",function(e){s.trigger(e)}),h.addEventListener("error",function(e){s.trigger(e)}),h.addEventListener("progress",function(e){s.trigger(e)}),h.upload.addEventListener("progress",function(e){s.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):h.onreadystatechange=function v(){switch(h.readyState){case 1:break;case 2:break;case 3:var e,t;try{i.hasSameOrigin(n.url)&&(e=h.getResponseHeader("Content-Length")||0),h.responseText&&(t=h.responseText.length)}catch(r){e=t=0}s.trigger({type:"progress",lengthComputable:!!e,total:parseInt(e,10),loaded:t});break;case 4:h.onreadystatechange=function(){},s.trigger(0===h.status?"error":"load")}},t.isEmptyObj(n.headers)||t.each(n.headers,function(e,t){h.setRequestHeader(t,e)}),""!==n.responseType&&"responseType"in h&&(h.responseType="json"!==n.responseType||u.can("return_response_type","json")?n.responseType:"text"),m?h.sendAsBinary?h.sendAsBinary(r):!function(){for(var e=new Uint8Array(r.length),t=0;t<r.length;t++)e[t]=255&r.charCodeAt(t);h.send(e.buffer)}():h.send(r),s.trigger("loadstart")},getStatus:function(){try{if(h)return h.status}catch(e){}return 0},getResponse:function(e){var t=this.getRuntime();try{switch(e){case"blob":var i=new r(t.uid,h.response),o=h.getResponseHeader("Content-Disposition");if(o){var a=o.match(/filename=([\'\"'])([^\1]+)\1/);a&&(p=a[2])}return i.name=p,i.type||(i.type=n.getFileMime(p)),i;case"json":return u.can("return_response_type","json")?h.response:200===h.status&&window.JSON?JSON.parse(h.responseText):null;case"document":return l(h);default:return""!==h.responseText?h.responseText:null}}catch(s){return null}},getAllResponseHeaders:function(){try{return h.getAllResponseHeaders()}catch(e){}return""},abort:function(){h&&h.abort()},destroy:function(){f=p=null}})}return e.XMLHttpRequest=c}),i(P,[],function(){return function(){function e(e,t){var n=r?0:-8*(t-1),i=0,a;for(a=0;t>a;a++)i|=o.charCodeAt(e+a)<<Math.abs(n+8*a);return i}function n(e,t,n){n=3===arguments.length?n:o.length-t-1,o=o.substr(0,t)+e+o.substr(n+t)}function i(e,t,i){var o="",a=r?0:-8*(i-1),s;for(s=0;i>s;s++)o+=String.fromCharCode(t>>Math.abs(a+8*s)&255);n(o,e,i)}var r=!1,o;return{II:function(e){return e===t?r:void(r=e)},init:function(e){r=!1,o=e},SEGMENT:function(e,t,i){switch(arguments.length){case 1:return o.substr(e,o.length-e-1);case 2:return o.substr(e,t);case 3:n(i,e,t);break;default:return o}},BYTE:function(t){return e(t,1)},SHORT:function(t){return e(t,2)},LONG:function(n,r){return r===t?e(n,4):void i(n,r,4)},SLONG:function(t){var n=e(t,4);return n>2147483647?n-4294967296:n},STRING:function(t,n){var i="";for(n+=t;n>t;t++)i+=String.fromCharCode(e(t,1));return i}}}}),i(k,[P],function(e){return function t(n){var i=[],r,o,a,s=0;if(r=new e,r.init(n),65496===r.SHORT(0)){for(o=2;o<=n.length;)if(a=r.SHORT(o),a>=65488&&65495>=a)o+=2;else{if(65498===a||65497===a)break;s=r.SHORT(o+2)+2,a>=65505&&65519>=a&&i.push({hex:a,name:"APP"+(15&a),start:o,length:s,segment:r.SEGMENT(o,s)}),o+=s}return r.init(null),{headers:i,restore:function(e){var t,n;for(r.init(e),o=65504==r.SHORT(2)?4+r.SHORT(4):2,n=0,t=i.length;t>n;n++)r.SEGMENT(o,0,i[n].segment),o+=i[n].length;return e=r.SEGMENT(),r.init(null),e},strip:function(e){var n,i,o;for(i=new t(e),n=i.headers,i.purge(),r.init(e),o=n.length;o--;)r.SEGMENT(n[o].start,n[o].length,"");return e=r.SEGMENT(),r.init(null),e},get:function(e){for(var t=[],n=0,r=i.length;r>n;n++)i[n].name===e.toUpperCase()&&t.push(i[n].segment);return t},set:function(e,t){var n=[],r,o,a;for("string"==typeof t?n.push(t):n=t,r=o=0,a=i.length;a>r&&(i[r].name===e.toUpperCase()&&(i[r].segment=n[o],i[r].length=n[o].length,o++),!(o>=n.length));r++);},purge:function(){i=[],r.init(null),r=null}}}}}),i(U,[u,P],function(e,n){return function i(){function i(e,n){var i=a.SHORT(e),r,o,s,u,d,f,h,p,m=[],g={};for(r=0;i>r;r++)if(h=f=e+12*r+2,s=n[a.SHORT(h)],s!==t){switch(u=a.SHORT(h+=2),d=a.LONG(h+=2),h+=4,m=[],u){case 1:case 7:for(d>4&&(h=a.LONG(h)+c.tiffHeader),o=0;d>o;o++)m[o]=a.BYTE(h+o);break;case 2:d>4&&(h=a.LONG(h)+c.tiffHeader),g[s]=a.STRING(h,d-1);continue;case 3:for(d>2&&(h=a.LONG(h)+c.tiffHeader),o=0;d>o;o++)m[o]=a.SHORT(h+2*o);break;case 4:for(d>1&&(h=a.LONG(h)+c.tiffHeader),o=0;d>o;o++)m[o]=a.LONG(h+4*o);break;case 5:for(h=a.LONG(h)+c.tiffHeader,o=0;d>o;o++)m[o]=a.LONG(h+4*o)/a.LONG(h+4*o+4);break;case 9:for(h=a.LONG(h)+c.tiffHeader,o=0;d>o;o++)m[o]=a.SLONG(h+4*o);break;case 10:for(h=a.LONG(h)+c.tiffHeader,o=0;d>o;o++)m[o]=a.SLONG(h+4*o)/a.SLONG(h+4*o+4);break;default:continue}p=1==d?m[0]:m,g[s]=l.hasOwnProperty(s)&&"object"!=typeof p?l[s][p]:p}return g}function r(){var e=c.tiffHeader;return a.II(18761==a.SHORT(e)),42!==a.SHORT(e+=2)?!1:(c.IFD0=c.tiffHeader+a.LONG(e+=2),u=i(c.IFD0,s.tiff),"ExifIFDPointer"in u&&(c.exifIFD=c.tiffHeader+u.ExifIFDPointer,delete u.ExifIFDPointer),"GPSInfoIFDPointer"in u&&(c.gpsIFD=c.tiffHeader+u.GPSInfoIFDPointer,delete u.GPSInfoIFDPointer),!0)}function o(e,t,n){var i,r,o,u=0;if("string"==typeof t){var l=s[e.toLowerCase()];for(var d in l)if(l[d]===t){t=d;break}}i=c[e.toLowerCase()+"IFD"],r=a.SHORT(i);for(var f=0;r>f;f++)if(o=i+12*f+2,a.SHORT(o)==t){u=o+8;break}return u?(a.LONG(u,n),!0):!1}var a,s,u,c={},l;return a=new n,s={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"}},l={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire.",1:"Flash fired.",5:"Strobe return light not detected.",7:"Strobe return light detected.",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},{init:function(e){return c={tiffHeader:10},e!==t&&e.length?(a.init(e),65505===a.SHORT(0)&&"EXIF\x00"===a.STRING(4,5).toUpperCase()?r():!1):!1
},TIFF:function(){return u},EXIF:function(){var t;if(t=i(c.exifIFD,s.exif),t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var n=0,r="";n<t.ExifVersion.length;n++)r+=String.fromCharCode(t.ExifVersion[n]);t.ExifVersion=r}return t},GPS:function(){var t;return t=i(c.gpsIFD,s.gps),t.GPSVersionID&&"array"===e.typeOf(t.GPSVersionID)&&(t.GPSVersionID=t.GPSVersionID.join(".")),t},setExif:function(e,t){return"PixelXDimension"!==e&&"PixelYDimension"!==e?!1:o("exif",e,t)},getBinary:function(){return a.SEGMENT()},purge:function(){a.init(null),a=u=null,c={}}}}}),i(B,[u,h,k,P,U],function(e,t,n,i,r){function o(o){function a(){for(var e=0,t,n;e<=u.length;){if(t=c.SHORT(e+=2),t>=65472&&65475>=t)return e+=5,{height:c.SHORT(e),width:c.SHORT(e+=2)};n=c.SHORT(e+=2),e+=n-2}return null}function s(){d&&l&&c&&(d.purge(),l.purge(),c.init(null),u=f=l=d=c=null)}var u,c,l,d,f,h;if(u=o,c=new i,c.init(u),65496!==c.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);l=new n(o),d=new r,h=!!d.init(l.get("app1")[0]),f=a.call(this),e.extend(this,{type:"image/jpeg",size:u.length,width:f&&f.width||0,height:f&&f.height||0,setExif:function(t,n){return h?("object"===e.typeOf(t)?e.each(t,function(e,t){d.setExif(t,e)}):d.setExif(t,n),void l.set("app1",d.getBinary())):!1},writeHeaders:function(){return arguments.length?l.restore(arguments[0]):u=l.restore(u)},stripHeaders:function(e){return l.strip(e)},purge:function(){s.call(this)}}),h&&(this.meta={tiff:d.TIFF(),exif:d.EXIF(),gps:d.GPS()})}return o}),i(z,[h,u,P],function(e,t,n){function i(i){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:u.LONG(t),height:u.LONG(t+=4)}):null}function o(){u&&(u.init(null),s=d=c=l=u=null)}function a(e){var t,n,i,r;return t=u.LONG(e),n=u.STRING(e+=4,4),i=e+=4,r=u.LONG(e+t),{length:t,type:n,start:i,CRC:r}}var s,u,c,l,d;s=i,u=new n,u.init(s),function(){var t=0,n=0,i=[35152,20039,3338,6666];for(n=0;n<i.length;n++,t+=2)if(i[n]!=u.SHORT(t))throw new e.ImageError(e.ImageError.WRONG_FORMAT)}(),d=r.call(this),t.extend(this,{type:"image/png",size:s.length,width:d.width,height:d.height,purge:function(){o.call(this)}}),o.call(this)}return i}),i(G,[u,h,B,z],function(e,t,n,i){return function(r){var o=[n,i],a;a=function(){for(var e=0;e<o.length;e++)try{return new o[e](r)}catch(n){}throw new t.ImageError(t.ImageError.WRONG_FORMAT)}(),e.extend(this,{type:"",size:0,width:0,height:0,setExif:function(){},writeHeaders:function(e){return e},stripHeaders:function(e){return e},purge:function(){}}),e.extend(this,a),this.purge=function(){a.purge(),a=null}}}),i(q,[],function(){function e(e,i,r){var o=e.naturalWidth,a=e.naturalHeight,s=r.width,u=r.height,c=r.x||0,l=r.y||0,d=i.getContext("2d");t(e)&&(o/=2,a/=2);var f=1024,h=document.createElement("canvas");h.width=h.height=f;for(var p=h.getContext("2d"),m=n(e,o,a),g=0;a>g;){for(var v=g+f>a?a-g:f,y=0;o>y;){var w=y+f>o?o-y:f;p.clearRect(0,0,f,f),p.drawImage(e,-y,-g);var E=y*s/o+c<<0,_=Math.ceil(w*s/o),x=g*u/a/m+l<<0,b=Math.ceil(v*u/a/m);d.drawImage(h,0,0,w,v,E,x,_,b),y+=f}g+=f}h=p=null}function t(e){var t=e.naturalWidth,n=e.naturalHeight;if(t*n>1048576){var i=document.createElement("canvas");i.width=i.height=1;var r=i.getContext("2d");return r.drawImage(e,-t+1,0),0===r.getImageData(0,0,1,1).data[3]}return!1}function n(e,t,n){var i=document.createElement("canvas");i.width=1,i.height=n;var r=i.getContext("2d");r.drawImage(e,0,0);for(var o=r.getImageData(0,0,1,n).data,a=0,s=n,u=n;u>a;){var c=o[4*(u-1)+3];0===c?s=u:a=u,u=s+a>>1}i=null;var l=u/n;return 0===l?1:l}return{isSubsampled:t,renderTo:e}}),i(X,[D,u,h,m,w,G,q,l,d],function(e,t,n,i,r,o,a,s,u){function c(){function e(){if(!E&&!y)throw new n.ImageError(n.DOMException.INVALID_STATE_ERR);return E||y}function c(e){return i.atob(e.substring(e.indexOf("base64,")+7))}function l(e,t){return"data:"+(t||"")+";base64,"+i.btoa(e)}function d(e){var t=this;y=new Image,y.onerror=function(){g.call(this),t.trigger("error",n.ImageError.WRONG_FORMAT)},y.onload=function(){t.trigger("load")},y.src=/^data:[^;]*;base64,/.test(e)?e:l(e,x.type)}function f(e,t){var i=this,r;return window.FileReader?(r=new FileReader,r.onload=function(){t(this.result)},r.onerror=function(){i.trigger("error",n.ImageError.WRONG_FORMAT)},r.readAsDataURL(e),void 0):t(e.getAsDataURL())}function h(n,i,r,o){var a=this,s,u,c=0,l=0,d,f,h,g;if(R=o,g=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1,-1!==t.inArray(g,[5,6,7,8])){var v=n;n=i,i=v}return d=e(),r?(n=Math.min(n,d.width),i=Math.min(i,d.height),s=Math.max(n/d.width,i/d.height)):s=Math.min(n/d.width,i/d.height),s>1&&!r&&o?void this.trigger("Resize"):(E||(E=document.createElement("canvas")),f=Math.round(d.width*s),h=Math.round(d.height*s),r?(E.width=n,E.height=i,f>n&&(c=Math.round((f-n)/2)),h>i&&(l=Math.round((h-i)/2))):(E.width=f,E.height=h),R||m(E.width,E.height,g),p.call(this,d,E,-c,-l,f,h),this.width=E.width,this.height=E.height,b=!0,void a.trigger("Resize"))}function p(e,t,n,i,r,o){if("iOS"===u.OS)a.renderTo(e,t,{width:r,height:o,x:n,y:i});else{var s=t.getContext("2d");s.drawImage(e,n,i,r,o)}}function m(e,t,n){switch(n){case 5:case 6:case 7:case 8:E.width=t,E.height=e;break;default:E.width=e,E.height=t}var i=E.getContext("2d");switch(n){case 2:i.translate(e,0),i.scale(-1,1);break;case 3:i.translate(e,t),i.rotate(Math.PI);break;case 4:i.translate(0,t),i.scale(1,-1);break;case 5:i.rotate(.5*Math.PI),i.scale(1,-1);break;case 6:i.rotate(.5*Math.PI),i.translate(0,-t);break;case 7:i.rotate(.5*Math.PI),i.translate(e,-t),i.scale(-1,1);break;case 8:i.rotate(-.5*Math.PI),i.translate(-e,0)}}function g(){w&&(w.purge(),w=null),_=y=E=x=null,b=!1}var v=this,y,w,E,_,x,b=!1,R=!0;t.extend(this,{loadFromBlob:function(e){var t=this,i=t.getRuntime(),r=arguments.length>1?arguments[1]:!0;if(!i.can("access_binary"))throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);return x=e,e.isDetached()?(_=e.getSource(),void d.call(this,_)):void f.call(this,e.getSource(),function(e){r&&(_=c(e)),d.call(t,e)})},loadFromImage:function(e,t){this.meta=e.meta,x=new r(null,{name:e.name,size:e.size,type:e.type}),d.call(this,t?_=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t=this.getRuntime(),n;return!w&&_&&t.can("access_image_binary")&&(w=new o(_)),n={width:e().width||0,height:e().height||0,type:x.type||s.getFileMime(x.name),size:_&&_.length||x.size||0,name:x.name||"",meta:w&&w.meta||this.meta||{}}},downsize:function(){h.apply(this,arguments)},getAsCanvas:function(){return E&&(E.id=this.uid+"_canvas"),E},getAsBlob:function(e,t){return e!==this.type&&h.call(this,this.width,this.height,!1),new r(null,{name:x.name||"",type:e,data:v.getAsBinaryString.call(this,e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!b)return y.src;if("image/jpeg"!==e)return E.toDataURL("image/png");try{return E.toDataURL("image/jpeg",t/100)}catch(n){return E.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!b)return _||(_=c(v.getAsDataURL(e,t))),_;if("image/jpeg"!==e)_=c(v.getAsDataURL(e,t));else{var n;t||(t=90);try{n=E.toDataURL("image/jpeg",t/100)}catch(i){n=E.toDataURL("image/jpeg")}_=c(n),w&&(_=w.stripHeaders(_),R&&(w.meta&&w.meta.exif&&w.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),_=w.writeHeaders(_)),w.purge(),w=null)}return b=!1,_},destroy:function(){v=null,g.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=c}),i(j,[u,d,f,h,g],function(e,t,n,i,r){function o(){var e;try{e=navigator.plugins["Shockwave Flash"],e=e.description}catch(t){try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(n){e="0.0"}}return e=e.match(/\d+/g),parseFloat(e[0]+"."+e[1])}function a(a){var c=this,l;a=e.extend({swf_url:t.swf_url},a),r.call(this,a,s,{access_binary:function(e){return e&&"browser"===c.mode},access_image_binary:function(e){return e&&"browser"===c.mode},display_media:r.capTrue,do_cors:r.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===c.mode},resize_image:r.capTrue,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!e.arrayDiff(t,["","text","document"])||"browser"===c.mode},return_status_code:function(t){return"browser"===c.mode||!e.arrayDiff(t,[200,404])},select_file:r.capTrue,select_multiple:r.capTrue,send_binary_string:function(e){return e&&"browser"===c.mode},send_browser_cookies:function(e){return e&&"browser"===c.mode},send_custom_headers:function(e){return e&&"browser"===c.mode},send_multipart:r.capTrue,slice_blob:function(e){return e&&"browser"===c.mode},stream_upload:function(e){return e&&"browser"===c.mode},summon_file_dialog:!1,upload_filesize:function(t){return e.parseSizeStr(t)<=2097152||"client"===c.mode},use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}},{access_binary:function(e){return e?"browser":"client"},access_image_binary:function(e){return e?"browser":"client"},report_upload_progress:function(e){return e?"browser":"client"},return_response_type:function(t){return e.arrayDiff(t,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"browser":["client","browser"]},send_binary_string:function(e){return e?"browser":"client"},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"browser":"client"},stream_upload:function(e){return e?"client":"browser"},upload_filesize:function(t){return e.parseSizeStr(t)>=2097152?"client":"browser"}},"client"),o()<10&&(this.mode=!1),e.extend(this,{getShim:function(){return n.get(this.uid)},shimExec:function(e,t){var n=[].slice.call(arguments,2);return c.getShim().exec(this.uid,e,t,n)},init:function(){var n,r,o;o=this.getShimContainer(),e.extend(o.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),n='<object id="'+this.uid+'" type="application/x-shockwave-flash" data="'+a.swf_url+'" ',"IE"===t.browser&&(n+='classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '),n+='width="100%" height="100%" style="outline:0"><param name="movie" value="'+a.swf_url+'" /><param name="flashvars" value="uid='+escape(this.uid)+"&target="+t.global_event_dispatcher+'" /><param name="wmode" value="transparent" /><param name="allowscriptaccess" value="always" /></object>',"IE"===t.browser?(r=document.createElement("div"),o.appendChild(r),r.outerHTML=n,r=o=null):o.innerHTML=n,l=setTimeout(function(){c&&!c.initialized&&c.trigger("Error",new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(e){return function(){e.call(c),clearTimeout(l),a=l=e=c=null}}(this.destroy)},u)}var s="flash",u={};return r.addConstructor(s,a),u}),i(V,[j,y],function(e,t){var n={slice:function(e,n,i,r){var o=this.getRuntime();return 0>n?n=Math.max(e.size+n,0):n>0&&(n=Math.min(n,e.size)),0>i?i=Math.max(e.size+i,0):i>0&&(i=Math.min(i,e.size)),e=o.shimExec.call(this,"Blob","slice",n,i,r||""),e&&(e=new t(o.uid,e)),e}};return e.Blob=n}),i(W,[j],function(e){var t={init:function(e){this.getRuntime().shimExec.call(this,"FileInput","init",{name:e.name,accept:e.accept,multiple:e.multiple}),this.trigger("ready")}};return e.FileInput=t}),i(Y,[j,m],function(e,t){function n(e,n){switch(n){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var i="",r={read:function(e,t){var r=this,o=r.getRuntime();return"readAsDataURL"===e&&(i="data:"+(t.type||"")+";base64,"),r.bind("Progress",function(t,r){r&&(i+=n(r,e))}),o.shimExec.call(this,"FileReader","readAsBase64",t.uid)},getResult:function(){return i},destroy:function(){i=null}};return e.FileReader=r}),i($,[j,m],function(e,t){function n(e,n){switch(n){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var i={read:function(e,t){var i,r=this.getRuntime();return(i=r.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===e&&(i="data:"+(t.type||"")+";base64,"+i),n(i,e,t.type)):null}};return e.FileReaderSync=i}),i(J,[j,u,y,w,T,A,O],function(e,t,n,i,r,o,a){var s={send:function(e,i){function r(){e.transport=l.mode,l.shimExec.call(c,"XMLHttpRequest","send",e,i)}function s(e,t){l.shimExec.call(c,"XMLHttpRequest","appendBlob",e,t.uid),i=null,r()}function u(e,t){var n=new a;n.bind("TransportingComplete",function(){t(this.result)}),n.transport(e.getSource(),e.type,{ruid:l.uid})}var c=this,l=c.getRuntime();if(t.isEmptyObj(e.headers)||t.each(e.headers,function(e,t){l.shimExec.call(c,"XMLHttpRequest","setRequestHeader",t,e.toString())}),i instanceof o){var d;if(i.each(function(e,t){e instanceof n?d=t:l.shimExec.call(c,"XMLHttpRequest","append",t,e)}),i.hasBlob()){var f=i.getBlob();f.isDetached()?u(f,function(e){f.destroy(),s(d,e)}):s(d,f)}else i=null,r()}else i instanceof n?i.isDetached()?u(i,function(e){i.destroy(),i=e.uid,r()}):(i=i.uid,r()):r()},getResponse:function(e){var n,o,a=this.getRuntime();if(o=a.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(o=new i(a.uid,o),"blob"===e)return o;try{if(n=new r,~t.inArray(e,["","text"]))return n.readAsText(o);if("json"===e&&window.JSON)return JSON.parse(n.readAsText(o))}finally{o.destroy()}}return null},abort:function(e){var t=this.getRuntime();t.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=s}),i(Z,[j,y],function(e,t){var n={getAsBlob:function(e){var n=this.getRuntime(),i=n.shimExec.call(this,"Transporter","getAsBlob",e);return i?new t(n.uid,i):null}};return e.Transporter=n}),i(K,[j,u,O,y,T],function(e,t,n,i,r){var o={loadFromBlob:function(e){function t(e){r.shimExec.call(i,"Image","loadFromBlob",e.uid),i=r=null}var i=this,r=i.getRuntime();if(e.isDetached()){var o=new n;o.bind("TransportingComplete",function(){t(o.result.getSource())}),o.transport(e.getSource(),e.type,{ruid:r.uid})}else t(e.getSource())},loadFromImage:function(e){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",e.uid)},getAsBlob:function(e,t){var n=this.getRuntime(),r=n.shimExec.call(this,"Image","getAsBlob",e,t);return r?new i(n.uid,r):null},getAsDataURL:function(){var e=this.getRuntime(),t=e.Image.getAsBlob.apply(this,arguments),n;return t?(n=new r,n.readAsDataURL(t)):null}};return e.Image=o}),i(Q,[u,d,f,h,g],function(e,t,n,i,r){function o(e){var t=!1,n=null,i,r,o,a,s,u=0;try{try{n=new ActiveXObject("AgControl.AgControl"),n.IsVersionSupported(e)&&(t=!0),n=null}catch(c){var l=navigator.plugins["Silverlight Plug-In"];if(l){for(i=l.description,"1.0.30226.2"===i&&(i="2.0.30226.2"),r=i.split(".");r.length>3;)r.pop();for(;r.length<4;)r.push(0);for(o=e.split(".");o.length>4;)o.pop();do a=parseInt(o[u],10),s=parseInt(r[u],10),u++;while(u<o.length&&a===s);s>=a&&!isNaN(a)&&(t=!0)}}}catch(d){t=!1}return t}function a(a){var c=this,l;a=e.extend({xap_url:t.xap_url},a),r.call(this,a,s,{access_binary:r.capTrue,access_image_binary:r.capTrue,display_media:r.capTrue,do_cors:r.capTrue,drag_and_drop:!1,report_upload_progress:r.capTrue,resize_image:r.capTrue,return_response_headers:function(e){return e&&"client"===c.mode},return_response_type:function(e){return"json"!==e?!0:!!window.JSON},return_status_code:function(t){return"client"===c.mode||!e.arrayDiff(t,[200,404])},select_file:r.capTrue,select_multiple:r.capTrue,send_binary_string:r.capTrue,send_browser_cookies:function(e){return e&&"browser"===c.mode},send_custom_headers:function(e){return e&&"client"===c.mode},send_multipart:r.capTrue,slice_blob:r.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:r.capTrue,use_http_method:function(t){return"client"===c.mode||!e.arrayDiff(t,["GET","POST"])}},{return_response_headers:function(e){return e?"client":"browser"},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"client":["client","browser"]},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"client":"browser"},use_http_method:function(t){return e.arrayDiff(t,["GET","POST"])?"client":["client","browser"]}}),o("2.0.31005.0")&&"Opera"!==t.browser||(this.mode=!1),e.extend(this,{getShim:function(){return n.get(this.uid).content.Moxie},shimExec:function(e,t){var n=[].slice.call(arguments,2);return c.getShim().exec(this.uid,e,t,n)},init:function(){var e;e=this.getShimContainer(),e.innerHTML='<object id="'+this.uid+'" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" style="outline:none;"><param name="source" value="'+a.xap_url+'"/><param name="background" value="Transparent"/><param name="windowless" value="true"/><param name="enablehtmlaccess" value="true"/><param name="initParams" value="uid='+this.uid+",target="+t.global_event_dispatcher+'"/></object>',l=setTimeout(function(){c&&!c.initialized&&c.trigger("Error",new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3)},destroy:function(e){return function(){e.call(c),clearTimeout(l),a=l=e=c=null}}(this.destroy)},u)}var s="silverlight",u={};return r.addConstructor(s,a),u}),i(et,[Q,u,V],function(e,t,n){return e.Blob=t.extend({},n)}),i(tt,[Q],function(e){var t={init:function(e){function t(e){for(var t="",n=0;n<e.length;n++)t+=(""!==t?"|":"")+e[n].title+" | *."+e[n].extensions.replace(/,/g,";*.");return t}this.getRuntime().shimExec.call(this,"FileInput","init",t(e.accept),e.name,e.multiple),this.trigger("ready")}};return e.FileInput=t}),i(nt,[Q,f,L],function(e,t,n){var i={init:function(){var e=this,i=e.getRuntime(),r;return r=i.getShimContainer(),n.addEvent(r,"dragover",function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy"},e.uid),n.addEvent(r,"dragenter",function(e){e.preventDefault();var n=t.get(i.uid).dragEnter(e);n&&e.stopPropagation()},e.uid),n.addEvent(r,"drop",function(e){e.preventDefault();var n=t.get(i.uid).dragDrop(e);n&&e.stopPropagation()},e.uid),i.shimExec.call(this,"FileDrop","init")}};return e.FileDrop=i}),i(it,[Q,u,Y],function(e,t,n){return e.FileReader=t.extend({},n)}),i(rt,[Q,u,$],function(e,t,n){return e.FileReaderSync=t.extend({},n)}),i(ot,[Q,u,J],function(e,t,n){return e.XMLHttpRequest=t.extend({},n)}),i(at,[Q,u,Z],function(e,t,n){return e.Transporter=t.extend({},n)}),i(st,[Q,u,K],function(e,t,n){return e.Image=t.extend({},n,{getInfo:function(){var e=this.getRuntime(),n=["tiff","exif","gps"],i={meta:{}},r=e.shimExec.call(this,"Image","getInfo");return r.meta&&t.each(n,function(e){var t=r.meta[e],n,o,a,s;if(t&&t.keys)for(i.meta[e]={},o=0,a=t.keys.length;a>o;o++)n=t.keys[o],s=t[n],s&&(/^(\d|[1-9]\d+)$/.test(s)?s=parseInt(s,10):/^\d*\.\d+$/.test(s)&&(s=parseFloat(s)),i.meta[e][n]=s)}),i.width=parseInt(r.width,10),i.height=parseInt(r.height,10),i.size=parseInt(r.size,10),i.type=r.type,i.name=r.name,i}})}),i(ut,[u,h,g,d],function(e,t,n,i){function r(t){var r=this,s=n.capTest,u=n.capTrue;n.call(this,t,o,{access_binary:s(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:s(a.Image&&(i.can("create_canvas")||i.can("use_data_uri_over32kb"))),do_cors:!1,drag_and_drop:!1,filter_by_extension:s(function(){return"Chrome"===i.browser&&i.version>=28||"IE"===i.browser&&i.version>=10}()),resize_image:function(){return a.Image&&r.can("access_binary")&&i.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!!~e.inArray(t,["text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_file:function(){return i.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return r.can("select_file")},summon_file_dialog:s(function(){return"Firefox"===i.browser&&i.version>=4||"Opera"===i.browser&&i.version>=12||!!~e.inArray(i.browser,["Chrome","Safari"])}()),upload_filesize:u,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(r),e=r=null}}(this.destroy)}),e.extend(this.getShim(),a)}var o="html4",a={};return n.addConstructor(o,r),a}),i(ct,[ut,u,f,L,l,d],function(e,t,n,i,r,o){function a(){function e(){var r=this,l=r.getRuntime(),d,f,h,p,m,g;g=t.guid("uid_"),d=l.getShimContainer(),a&&(h=n.get(a+"_form"),h&&t.extend(h.style,{top:"100%"})),p=document.createElement("form"),p.setAttribute("id",g+"_form"),p.setAttribute("method","post"),p.setAttribute("enctype","multipart/form-data"),p.setAttribute("encoding","multipart/form-data"),t.extend(p.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),m=document.createElement("input"),m.setAttribute("id",g),m.setAttribute("type","file"),m.setAttribute("name",c.name||"Filedata"),m.setAttribute("accept",u.join(",")),t.extend(m.style,{fontSize:"999px",opacity:0}),p.appendChild(m),d.appendChild(p),t.extend(m.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===o.browser&&o.version<10&&t.extend(m.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),m.onchange=function(){var t;this.value&&(t=this.files?this.files[0]:{name:this.value},s=[t],this.onchange=function(){},e.call(r),r.bind("change",function i(){var e=n.get(g),t=n.get(g+"_form"),o;r.unbind("change",i),r.files.length&&e&&t&&(o=r.files[0],e.setAttribute("id",o.uid),t.setAttribute("id",o.uid+"_form"),t.setAttribute("target",o.uid+"_iframe")),e=t=null},998),m=p=null,r.trigger("change"))},l.can("summon_file_dialog")&&(f=n.get(c.browse_button),i.removeEvent(f,"click",r.uid),i.addEvent(f,"click",function(e){m&&!m.disabled&&m.click(),e.preventDefault()},r.uid)),a=g,d=h=f=null}var a,s=[],u=[],c;t.extend(this,{init:function(t){var o=this,a=o.getRuntime(),s;c=t,u=t.accept.mimes||r.extList2mimes(t.accept,a.can("filter_by_extension")),s=a.getShimContainer(),function(){var e,r,u;e=n.get(t.browse_button),a.can("summon_file_dialog")&&("static"===n.getStyle(e,"position")&&(e.style.position="relative"),r=parseInt(n.getStyle(e,"z-index"),10)||1,e.style.zIndex=r,s.style.zIndex=r-1),u=a.can("summon_file_dialog")?e:s,i.addEvent(u,"mouseover",function(){o.trigger("mouseenter")},o.uid),i.addEvent(u,"mouseout",function(){o.trigger("mouseleave")},o.uid),i.addEvent(u,"mousedown",function(){o.trigger("mousedown")},o.uid),i.addEvent(n.get(t.container),"mouseup",function(){o.trigger("mouseup")},o.uid),e=null}(),e.call(this),s=null,o.trigger({type:"ready",async:!0})},getFiles:function(){return s},disable:function(e){var t;(t=n.get(a))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),r=e.getShimContainer();i.removeAllEvents(r,this.uid),i.removeAllEvents(c&&n.get(c.container),this.uid),i.removeAllEvents(c&&n.get(c.browse_button),this.uid),r&&(r.innerHTML=""),t.removeInstance(this.uid),a=s=u=c=r=t=null}})}return e.FileInput=a}),i(lt,[ut,F],function(e,t){return e.FileReader=t}),i(dt,[ut,u,f,R,h,L,y,A],function(e,t,n,i,r,o,a,s){function u(){function e(e){var t=this,i,r,a,s,u=!1;if(l){if(i=l.id.replace(/_iframe$/,""),r=n.get(i+"_form")){for(a=r.getElementsByTagName("input"),s=a.length;s--;)switch(a[s].getAttribute("type")){case"hidden":a[s].parentNode.removeChild(a[s]);break;case"file":u=!0}a=[],u||r.parentNode.removeChild(r),r=null}setTimeout(function(){o.removeEvent(l,"load",t.uid),l.parentNode&&l.parentNode.removeChild(l);var n=t.getRuntime().getShimContainer();n.children.length||n.parentNode.removeChild(n),n=l=null,e()},1)}}var u,c,l;t.extend(this,{send:function(d,f){function h(){var n=m.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='<iframe id="'+g+'_iframe" name="'+g+'_iframe" src="javascript:""" style="display:none"></iframe>',l=r.firstChild,n.appendChild(l),o.addEvent(l,"load",function(){var n;try{n=l.contentWindow.document||l.contentDocument||window.frames[l.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(n.title)?u=n.title.replace(/^(\d+).*$/,"$1"):(u=200,c=t.trim(n.body.innerHTML),p.trigger({type:"progress",loaded:c.length,total:c.length}),w&&p.trigger({type:"uploadprogress",loaded:w.size||1025,total:w.size||1025}))}catch(r){if(!i.hasSameOrigin(d.url))return void e.call(p,function(){p.trigger("error")});u=404}e.call(p,function(){p.trigger("load")})},p.uid)}var p=this,m=p.getRuntime(),g,v,y,w;if(u=c=null,f instanceof s&&f.hasBlob()){if(w=f.getBlob(),g=w.uid,y=n.get(g),v=n.get(g+"_form"),!v)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else g=t.guid("uid_"),v=document.createElement("form"),v.setAttribute("id",g+"_form"),v.setAttribute("method",d.method),v.setAttribute("enctype","multipart/form-data"),v.setAttribute("encoding","multipart/form-data"),v.setAttribute("target",g+"_iframe"),m.getShimContainer().appendChild(v);f instanceof s&&f.each(function(e,n){if(e instanceof a)y&&y.setAttribute("name",n);else{var i=document.createElement("input");t.extend(i,{type:"hidden",name:n,value:e}),y?v.insertBefore(i,y):v.appendChild(i)}}),v.setAttribute("action",d.url),h(),v.submit(),p.trigger("loadstart")},getStatus:function(){return u},getResponse:function(e){if("json"===e&&"string"===t.typeOf(c)&&window.JSON)try{return JSON.parse(c.replace(/^\s*<pre[^>]*>/,"").replace(/<\/pre>\s*$/,""))}catch(n){return null}return c},abort:function(){var t=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})}})}return e.XMLHttpRequest=u}),i(ft,[ut,X],function(e,t){return e.Image=t}),a([u,c,l,d,f,h,p,m,g,v,y,w,E,_,x,b,R,T,A,S,O,I,L])}(this);;(function(e){"use strict";var t={},n=e.moxie.core.utils.Basic.inArray;return function r(e){var i,s;for(i in e)s=typeof e[i],s==="object"&&!~n(i,["Exceptions","Env","Mime"])?r(e[i]):s==="function"&&(t[i]=e[i])}(e.moxie),t.Env=e.moxie.core.utils.Env,t.Mime=e.moxie.core.utils.Mime,t.Exceptions=e.moxie.core.Exceptions,e.mOxie=t,e.o||(e.o=t),t})(this);
/**
* Plupload - multi-runtime File Uploader
* v2.1.2
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*
* Date: 2014-05-14
*/
;(function(e,t,n){function s(e){function r(e,t,r){var i={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};i[e]?n[i[e]]=t:r||(n[e]=t)}var t=e.required_features,n={};if(typeof t=="string")o.each(t.split(/\s*,\s*/),function(e){r(e,!0)});else if(typeof t=="object")o.each(t,function(e,t){r(t,e)});else if(t===!0){e.chunk_size>0&&(n.slice_blob=!0);if(e.resize.enabled||!e.multipart)n.send_binary_string=!0;o.each(e,function(e,t){r(t,!!e,!0)})}return n}var r=e.setTimeout,i={},o={VERSION:"2.1.2",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:t.mimes,ua:t.ua,typeOf:t.typeOf,extend:t.extend,guid:t.guid,get:function(n){var r=[],i;t.typeOf(n)!=="array"&&(n=[n]);var s=n.length;while(s--)i=t.get(n[s]),i&&r.push(i);return r.length?r:null},each:t.each,getPos:t.getPos,getSize:t.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},n=/[<>&\"\']/g;return e?(""+e).replace(n,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:t.toArray,inArray:t.inArray,addI18n:t.addI18n,translate:t.translate,isEmptyObj:t.isEmptyObj,hasClass:t.hasClass,addClass:t.addClass,removeClass:t.removeClass,getStyle:t.getStyle,addEvent:t.addEvent,removeEvent:t.removeEvent,removeAllEvents:t.removeAllEvents,cleanName:function(e){var t,n;n=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"];for(t=0;t<n.length;t+=2)e=e.replace(n[t],n[t+1]);return e=e.replace(/\s+/g,"_"),e=e.replace(/[^a-z0-9_\-\.]+/gi,""),e},buildUrl:function(e,t){var n="";return o.each(t,function(e,t){n+=(n?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(e)}),n&&(e+=(e.indexOf("?")>0?"&":"?")+n),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===n||/\D/.test(e))return o.translate("N/A");var r=Math.pow(1024,4);return e>r?t(e/r,1)+" "+o.translate("tb"):e>(r/=1024)?t(e/r,1)+" "+o.translate("gb"):e>(r/=1024)?t(e/r,1)+" "+o.translate("mb"):e>1024?Math.round(e/1024)+" "+o.translate("kb"):e+" "+o.translate("b")},parseSize:t.parseSizeStr,predictRuntime:function(e,n){var r,i;return r=new o.Uploader(e),i=t.Runtime.thatCan(r.getOption().required_features,n||e.runtimes),r.destroy(),i},addFileFilter:function(e,t){i[e]=t}};o.addFileFilter("mime_types",function(e,t,n){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:o.FILE_EXTENSION_ERROR,message:o.translate("File extension error."),file:t}),n(!1)):n(!0)}),o.addFileFilter("max_file_size",function(e,t,n){var r;e=o.parseSize(e),t.size!==r&&e&&t.size>e?(this.trigger("Error",{code:o.FILE_SIZE_ERROR,message:o.translate("File size error."),file:t}),n(!1)):n(!0)}),o.addFileFilter("prevent_duplicates",function(e,t,n){if(e){var r=this.files.length;while(r--)if(t.name===this.files[r].name&&t.size===this.files[r].size){this.trigger("Error",{code:o.FILE_DUPLICATE_ERROR,message:o.translate("Duplicate file error."),file:t}),n(!1);return}}n(!0)}),o.Uploader=function(e){function g(){var e,t=0,n;if(this.state==o.STARTED){for(n=0;n<f.length;n++)!e&&f[n].status==o.QUEUED?(e=f[n],this.trigger("BeforeUpload",e)&&(e.status=o.UPLOADING,this.trigger("UploadFile",e))):t++;t==f.length&&(this.state!==o.STOPPED&&(this.state=o.STOPPED,this.trigger("StateChanged")),this.trigger("UploadComplete",f))}}function y(e){e.percent=e.size>0?Math.ceil(e.loaded/e.size*100):100,b()}function b(){var e,t;d.reset();for(e=0;e<f.length;e++)t=f[e],t.size!==n?(d.size+=t.origSize,d.loaded+=t.loaded*t.origSize/t.size):d.size=n,t.status==o.DONE?d.uploaded++:t.status==o.FAILED?d.failed++:d.queued++;d.size===n?d.percent=f.length>0?Math.ceil(d.uploaded/f.length*100):0:(d.bytesPerSec=Math.ceil(d.loaded/((+(new Date)-p||1)/1e3)),d.percent=d.size>0?Math.ceil(d.loaded/d.size*100):0)}function w(){var e=c[0]||h[0];return e?e.getRuntime().uid:!1}function E(e,n){if(e.ruid){var r=t.Runtime.getInfo(e.ruid);if(r)return r.can(n)}return!1}function S(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",O),this.bind("BeforeUpload",C),this.bind("UploadFile",k),this.bind("UploadProgress",L),this.bind("StateChanged",A),this.bind("QueueChanged",b),this.bind("Error",_),this.bind("FileUploaded",M),this.bind("Destroy",D)}function x(e,n){var r=this,i=0,s=[],u={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:l,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};o.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(u[t]=e[t])}),e.browse_button&&o.each(e.browse_button,function(n){s.push(function(s){var a=new t.FileInput(o.extend({},u,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:n}));a.onready=function(){var e=t.Runtime.getInfo(this.ruid);t.extend(r.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),i++,c.push(this),s()},a.onchange=function(){r.addFile(this.files)},a.bind("mouseenter mouseleave mousedown mouseup",function(r){v||(e.browse_button_hover&&("mouseenter"===r.type?t.addClass(n,e.browse_button_hover):"mouseleave"===r.type&&t.removeClass(n,e.browse_button_hover)),e.browse_button_active&&("mousedown"===r.type?t.addClass(n,e.browse_button_active):"mouseup"===r.type&&t.removeClass(n,e.browse_button_active)))}),a.bind("mousedown",function(){r.trigger("Browse")}),a.bind("error runtimeerror",function(){a=null,s()}),a.init()})}),e.drop_element&&o.each(e.drop_element,function(e){s.push(function(n){var s=new t.FileDrop(o.extend({},u,{drop_zone:e}));s.onready=function(){var e=t.Runtime.getInfo(this.ruid);r.features.dragdrop=e.can("drag_and_drop"),i++,h.push(this),n()},s.ondrop=function(){r.addFile(this.files)},s.bind("error runtimeerror",function(){s=null,n()}),s.init()})}),t.inSeries(s,function(){typeof n=="function"&&n(i)})}function T(e,r,i){var s=new t.Image;try{s.onload=function(){if(r.width>this.width&&r.height>this.height&&r.quality===n&&r.preserve_headers&&!r.crop)return this.destroy(),i(e);s.downsize(r.width,r.height,r.crop,r.preserve_headers)},s.onresize=function(){i(this.getAsBlob(e.type,r.quality)),this.destroy()},s.onerror=function(){i(e)},s.load(e)}catch(o){i(e)}}function N(e,n,r){function f(e,t,n){var r=a[e];switch(e){case"max_file_size":e==="max_file_size"&&(a.max_file_size=a.filters.max_file_size=t);break;case"chunk_size":if(t=o.parseSize(t))a[e]=t,a.send_file_name=!0;break;case"multipart":a[e]=t,t||(a.send_file_name=!0);break;case"unique_names":a[e]=t,t&&(a.send_file_name=!0);break;case"filters":o.typeOf(t)==="array"&&(t={mime_types:t}),n?o.extend(a.filters,t):a.filters=t,t.mime_types&&(a.filters.mime_types.regexp=function(e){var t=[];return o.each(e,function(e){o.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(a.filters.mime_types));break;case"resize":n?o.extend(a.resize,t,{enabled:!0}):a.resize=t;break;case"prevent_duplicates":a.prevent_duplicates=a.filters.prevent_duplicates=!!t;break;case"browse_button":case"drop_element":t=o.get(t);case"container":case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":a[e]=t,n||(u=!0);break;default:a[e]=t}n||i.trigger("OptionChanged",e,t,r)}var i=this,u=!1;typeof e=="object"?o.each(e,function(e,t){f(t,e,r)}):f(e,n,r),r?(a.required_features=s(o.extend({},a)),l=s(o.extend({},a,{required_features:!0}))):u&&(i.trigger("Destroy"),x.call(i,a,function(e){e?(i.runtime=t.Runtime.getInfo(w()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")})}))}function C(e,t){if(e.settings.unique_names){var n=t.name.match(/\.([^.]+)$/),r="part";n&&(r=n[1]),t.target_name=t.id+"."+r}}function k(e,n){function h(){u-->0?r(p,1e3):(n.loaded=f,e.trigger("Error",{code:o.HTTP_ERROR,message:o.translate("HTTP Error."),file:n,response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()}))}function p(){var d,v,g={},y;if(n.status!==o.UPLOADING||e.state===o.STOPPED)return;e.settings.send_file_name&&(g.name=n.target_name||n.name),s&&a.chunks&&c.size>s?(y=Math.min(s,c.size-f),d=c.slice(f,f+y)):(y=c.size,d=c),s&&a.chunks&&(e.settings.send_chunk_number?(g.chunk=Math.ceil(f/s),g.chunks=Math.ceil(c.size/s)):(g.offset=f,g.total=c.size)),m=new t.XMLHttpRequest,m.upload&&(m.upload.onprogress=function(t){n.loaded=Math.min(n.size,f+t.loaded),e.trigger("UploadProgress",n)}),m.onload=function(){if(m.status>=400){h();return}u=e.settings.max_retries,y<c.size?(d.destroy(),f+=y,n.loaded=Math.min(f,c.size),e.trigger("ChunkUploaded",n,{offset:n.loaded,total:c.size,response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()}),t.Env.browser==="Android Browser"&&e.trigger("UploadProgress",n)):n.loaded=n.size,d=v=null,!f||f>=c.size?(n.size!=n.origSize&&(c.destroy(),c=null),e.trigger("UploadProgress",n),n.status=o.DONE,e.trigger("FileUploaded",n,{response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()})):r(p,1)},m.onerror=function(){h()},m.onloadend=function(){this.destroy(),m=null},e.settings.multipart&&a.multipart?(m.open("post",i,!0),o.each(e.settings.headers,function(e,t){m.setRequestHeader(t,e)}),v=new t.FormData,o.each(o.extend(g,e.settings.multipart_params),function(e,t){v.append(t,e)}),v.append(e.settings.file_data_name,d),m.send(v,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:l,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})):(i=o.buildUrl(e.settings.url,o.extend(g,e.settings.multipart_params)),m.open("post",i,!0),m.setRequestHeader("Content-Type","application/octet-stream"),o.each(e.settings.headers,function(e,t){m.setRequestHeader(t,e)}),m.send(d,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:l,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url}))}var i=e.settings.url,s=e.settings.chunk_size,u=e.settings.max_retries,a=e.features,f=0,c;n.loaded&&(f=n.loaded=s?s*Math.floor(n.loaded/s):0),c=n.getSource(),e.settings.resize.enabled&&E(c,"send_binary_string")&&!!~t.inArray(c.type,["image/jpeg","image/png"])?T.call(this,c,e.settings.resize,function(e){c=e,n.size=e.size,p()}):p()}function L(e,t){y(t)}function A(e){if(e.state==o.STARTED)p=+(new Date);else if(e.state==o.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==o.UPLOADING&&(e.files[t].status=o.QUEUED,b())}function O(){m&&m.abort()}function M(e){b(),r(function(){g.call(e)},1)}function _(e,t){t.code===o.INIT_ERROR?e.destroy():t.file&&(t.file.status=o.FAILED,y(t.file),e.state==o.STARTED&&(e.trigger("CancelUpload"),r(function(){g.call(e)},1)))}function D(e){e.stop(),o.each(f,function(e){e.destroy()}),f=[],c.length&&(o.each(c,function(e){e.destroy()}),c=[]),h.length&&(o.each(h,function(e){e.destroy()}),h=[]),l={},v=!1,p=m=null,d.reset()}var u=o.guid(),a,f=[],l={},c=[],h=[],p,d,v=!1,m;a={runtimes:t.Runtime.order,max_retries:0,chunk_size:0,multipart:!0,multi_selection:!0,file_data_name:"file",flash_swf_url:"js/Moxie.swf",silverlight_xap_url:"js/Moxie.xap",filters:{mime_types:[],prevent_duplicates:!1,max_file_size:0},resize:{enabled:!1,preserve_headers:!0,crop:!1},send_file_name:!0,send_chunk_number:!0},N.call(this,e,null,!0),d=new o.QueueProgress,o.extend(this,{id:u,uid:u,state:o.STOPPED,features:{},runtime:null,files:f,settings:a,total:d,init:function(){var e=this;typeof a.preinit=="function"?a.preinit(e):o.each(a.preinit,function(t,n){e.bind(n,t)}),S.call(this);if(!a.browse_button||!a.url){this.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")});return}x.call(this,a,function(n){typeof a.init=="function"?a.init(e):o.each(a.init,function(t,n){e.bind(n,t)}),n?(e.runtime=t.Runtime.getInfo(w()).type,e.trigger("Init",{runtime:e.runtime}),e.trigger("PostInit")):e.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")})})},setOption:function(e,t){N.call(this,e,t,!this.runtime)},getOption:function(e){return e?a[e]:a},refresh:function(){c.length&&o.each(c,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=o.STARTED&&(this.state=o.STARTED,this.trigger("StateChanged"),g.call(this))},stop:function(){this.state!=o.STOPPED&&(this.state=o.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){v=arguments[0]!==n?arguments[0]:!0,c.length&&o.each(c,function(e){e.disable(v)}),this.trigger("DisableBrowse",v)},getFile:function(e){var t;for(t=f.length-1;t>=0;t--)if(f[t].id===e)return f[t]},addFile:function(e,n){function l(e,n){var r=[];t.each(s.settings.filters,function(t,n){i[n]&&r.push(function(r){i[n].call(s,t,e,function(e){r(!e)})})}),t.inSeries(r,n)}function c(e){var i=t.typeOf(e);if(e instanceof t.File){if(!e.ruid&&!e.isDetached()){if(!a)return!1;e.ruid=a,e.connectRuntime(a)}c(new o.File(e))}else e instanceof t.Blob?(c(e.getSource()),e.destroy()):e instanceof o.File?(n&&(e.name=n),u.push(function(t){l(e,function(n){n||(f.push(e),s.trigger("FileFiltered",e)),r(t,1)})})):t.inArray(i,["file","blob"])!==-1?c(new t.File(null,e)):i==="node"&&t.typeOf(e.files)==="filelist"?t.each(e.files,c):i==="array"&&(n=null,t.each(e,c))}var s=this,u=[],a;a=w(),c(e),u.length&&t.inSeries(u,function(){f.length&&s.trigger("FilesAdded",f)})},removeFile:function(e){var t=typeof e=="string"?e:e.id;for(var n=f.length-1;n>=0;n--)if(f[n].id===t)return this.splice(n,1)[0]},splice:function(e,t){var r=f.splice(e===n?0:e,t===n?f.length:t),i=!1;return this.state==o.STARTED&&(o.each(r,function(e){if(e.status===o.UPLOADING)return i=!0,!1}),i&&this.stop()),this.trigger("FilesRemoved",r),o.each(r,function(e){e.destroy()}),i&&this.start(),r},bind:function(e,t,n){var r=this;o.Uploader.prototype.bind.call(this,e,function(){var e=[].slice.call(arguments);return e.splice(0,1,r),t.apply(this,e)},0,n)},destroy:function(){this.trigger("Destroy"),a=d=null,this.unbindAll()}})},o.Uploader.prototype=t.EventTarget.instance,o.File=function(){function n(n){o.extend(this,{id:o.guid(),name:n.name||n.fileName,type:n.type||"",size:n.size||n.fileSize,origSize:n.size||n.fileSize,loaded:0,percent:0,status:o.QUEUED,lastModifiedDate:n.lastModifiedDate||(new Date).toLocaleString(),getNative:function(){var e=this.getSource().getSource();return t.inArray(t.typeOf(e),["blob","file"])!==-1?e:null},getSource:function(){return e[this.id]?e[this.id]:null},destroy:function(){var t=this.getSource();t&&(t.destroy(),delete e[this.id])}}),e[this.id]=n}var e={};return n}(),o.QueueProgress=function(){var e=this;e.size=0,e.loaded=0,e.uploaded=0,e.failed=0,e.queued=0,e.percent=0,e.bytesPerSec=0,e.reset=function(){e.size=e.loaded=e.uploaded=e.failed=e.queued=e.percent=e.bytesPerSec=0}},e.plupload=o})(window,mOxie);
|
Teino1978-Corp/Teino1978-Corp-jsdelivr
|
files/plupload/2.1.2/plupload.full.min.js
|
JavaScript
|
mit
| 108,749 |
ace.define("ace/mode/ruby_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=t.constantOtherSymbol={token:"constant.other.symbol.ruby",regex:"[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?"},o=t.qString={token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},u=t.qqString={token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},a=t.tString={token:"string",regex:"[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]"},f=t.constantNumericHex={token:"constant.numeric",regex:"0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b"},l=t.constantNumericFloat={token:"constant.numeric",regex:"[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?\\b"},c=function(){var e="abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|gsub!|get_via_redirect|host!|https?|https!|include|Integer|lambda|link_to|link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|validates_inclusion_of|validates_numericality_of|validates_with|validates_each|authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|translate|localize|extract_locale_from_tld|caches_page|expire_page|caches_action|expire_action|cache|expire_fragment|expire_cache_for|observe|cache_sweeper|has_many|has_one|belongs_to|has_and_belongs_to_many",t="alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield",n="true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING",r="$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE|$!|root_url|flash|session|cookies|params|request|response|logger|self",i=this.$keywords=this.createKeywordMapper({keyword:t,"constant.language":n,"variable.language":r,"support.function":e,"invalid.deprecated":"debugger"},"identifier");this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"comment",regex:"^=begin(?:$|\\s.*$)",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"},[{regex:"[{}]",onMatch:function(e,t,n){this.next=e=="{"?this.nextState:"";if(e=="{"&&n.length)return n.unshift("start",t),"paren.lparen";if(e=="}"&&n.length){n.shift(),this.next=n.shift();if(this.next.indexOf("string")!=-1)return"paren.end"}return e=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.start",regex:/"/,push:[{token:"constant.language.escape",regex:/\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/},{token:"paren.start",regex:/\#{/,push:"start"},{token:"string.end",regex:/"/,next:"pop"},{defaultToken:"string"}]},{token:"string.start",regex:/`/,push:[{token:"constant.language.escape",regex:/\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/},{token:"paren.start",regex:/\#{/,push:"start"},{token:"string.end",regex:/`/,next:"pop"},{defaultToken:"string"}]},{token:"string.start",regex:/'/,push:[{token:"constant.language.escape",regex:/\\['\\]/},{token:"string.end",regex:/'/,next:"pop"},{defaultToken:"string"}]}],{token:"text",regex:"::"},{token:"variable.instance",regex:"@{1,2}[a-zA-Z_\\d]+"},{token:"support.class",regex:"[A-Z][a-zA-Z_\\d]+"},s,f,l,{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:i,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"punctuation.separator.key-value",regex:"=>"},{stateName:"heredoc",onMatch:function(e,t,n){var r=e[2]=="-"?"indentedHeredoc":"heredoc",i=e.split(this.splitRegex);return n.push(r,i[3]),[{type:"constant",value:i[1]},{type:"string",value:i[2]},{type:"support.class",value:i[3]},{type:"string",value:i[4]}]},regex:"(<<-?)(['\"`]?)([\\w]+)(['\"`]?)",rules:{heredoc:[{onMatch:function(e,t,n){return e===n[1]?(n.shift(),n.shift(),this.next=n[0]||"start","support.class"):(this.next="","string")},regex:".*$",next:"start"}],indentedHeredoc:[{token:"string",regex:"^ +"},{onMatch:function(e,t,n){return e===n[1]?(n.shift(),n.shift(),this.next=n[0]||"start","support.class"):(this.next="","string")},regex:".*$",next:"start"}]}},{regex:"$",token:"empty",next:function(e,t){return t[0]==="heredoc"||t[0]==="indentedHeredoc"?t[0]:e}},{token:"string.character",regex:"\\B\\?."},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"^=end(?:$|\\s.*$)",next:"start"},{token:"comment",regex:".+"}]},this.normalizeRules()};r.inherits(c,i),t.RubyHighlightRules=c}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f,l={},c=function(e){var t=-1;e.multiSelect&&(t=e.selection.index,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},h=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},p=function(){this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){c(n);var a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(l!==""&&l!=="{"&&n.getWrapBehavioursEnabled())return h(a,l,"{","}");if(p.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])||n.inMultiSelectMode?(p.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(p.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){c(n);var d=u.substring(s.column,s.column+1);if(d=="}"){var v=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(v!==null&&p.isAutoInsertedClosing(s,u,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(i=="\n"||i=="\r\n"){c(n);var m="";p.isMaybeInsertedClosing(s,u)&&(m=o.stringRepeat("}",f.maybeInsertedBrackets),p.clearMaybeInsertedClosing());var d=u.substring(s.column,s.column+1);if(d==="}"){var g=r.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!g)return null;var y=this.$getIndent(r.getLine(g.row))}else{if(!m){p.clearMaybeInsertedClosing();return}var y=this.$getIndent(u)}var b=y+r.getTabString();return{text:"\n"+b+"\n"+y+m,selection:[1,b.length,1,b.length]}}p.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return h(s,o,"(",")");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&p.isAutoInsertedClosing(u,a,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return h(s,o,"[","]");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&p.isAutoInsertedClosing(u,a,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){c(n);var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return h(o,u,s,s);if(!u){var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column),p=f.substring(a.column,a.column+1),d=r.getTokenAt(a.row,a.column),v=r.getTokenAt(a.row,a.column+1);if(l=="\\"&&d&&/escape/.test(d.type))return null;var m=d&&/string|escape/.test(d.type),g=!v||/string|escape/.test(v.type),y;if(p==s)y=m!==g;else{if(m&&!g)return null;if(m&&g)return null;var b=r.$mode.tokenRe;b.lastIndex=0;var w=b.test(l);b.lastIndex=0;var E=b.test(l);if(w||E)return null;if(p&&!/[\s;,.})\]\\]/.test(p))return null;y=!0}return{text:y?s+s:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};p.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},p.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},p.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(p,i),t.CstyleBehaviour=p}),ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=this.indentationBlock(e,n);if(r)return r;var i=/\S/,o=e.getLine(n),u=o.search(i);if(u==-1||o[u]!="#")return;var a=o.length,f=e.getLength(),l=n,c=n;while(++n<f){o=e.getLine(n);var h=o.search(i);if(h==-1)continue;if(o[h]!="#")break;c=n}if(c>l){var p=e.getLine(c).length;return new s(l,a,c,p)}},this.getFoldWidget=function(e,t,n){var r=e.getLine(n),i=r.search(/\S/),s=e.getLine(n+1),o=e.getLine(n-1),u=o.search(/\S/),a=s.search(/\S/);if(i==-1)return e.foldWidgets[n-1]=u!=-1&&u<a?"start":"","";if(u==-1){if(i==a&&r[i]=="#"&&s[i]=="#")return e.foldWidgets[n-1]="",e.foldWidgets[n+1]="","start"}else if(u==i&&r[i]=="#"&&o[i]=="#"&&e.getLine(n-2).search(/\S/)==-1)return e.foldWidgets[n-1]="start",e.foldWidgets[n+1]="","";return u!=-1&&u<i?e.foldWidgets[n-1]="start":e.foldWidgets[n-1]="",i<a?"start":""}}.call(o.prototype)}),ace.define("ace/mode/ruby",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ruby_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/coffee"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./ruby_highlight_rules").RubyHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../range").Range,a=e("./behaviour/cstyle").CstyleBehaviour,f=e("./folding/coffee").FoldMode,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new f};r.inherits(l,i),function(){this.lineCommentStart="#",this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"){var o=t.match(/^.*[\{\(\[]\s*$/),u=t.match(/^\s*(class|def|module)\s.*$/),a=t.match(/.*do(\s*|\s+\|.*\|\s*)$/),f=t.match(/^\s*(if|else)\s*/);if(o||u||a||f)r+=n}return r},this.checkOutdent=function(e,t,n){return/^\s+(end|else)$/.test(t+n)||this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){var r=t.getLine(n);if(/}/.test(r))return this.$outdent.autoOutdent(t,n);var i=this.$getIndent(r),s=t.getLine(n-1),o=this.$getIndent(s),a=t.getTabString();o.length<=i.length&&i.slice(-a.length)==a&&t.remove(new u(n,i.length-a.length,n,i.length))},this.$id="ace/mode/ruby"}.call(l.prototype),t.Mode=l})
|
sancospi/jsdelivr
|
files/ace/1.2.1/noconflict/mode-ruby.js
|
JavaScript
|
mit
| 16,531 |
tinyMCE.addI18n('sy.advanced_dlg',{"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","charmap_usage":"Use left and right arrows to navigate.","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","invalid_color_value":"Invalid color value"});
|
seamusclegg/polo360pavageaunicolas
|
concrete/js/tiny_mce/themes/advanced/langs/sy_dlg.js
|
JavaScript
|
mit
| 1,971 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Tests\Firewall;
use Symfony\Component\Security\Http\Firewall\DigestData;
class DigestDataTest extends \PHPUnit_Framework_TestCase
{
public function testGetResponse()
{
$digestAuth = new DigestData(
'username="user", realm="Welcome, robot!", '.
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '.
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '.
'response="b52938fc9e6d7c01be7702ece9031b42"'
);
$this->assertEquals('b52938fc9e6d7c01be7702ece9031b42', $digestAuth->getResponse());
}
public function testGetUsername()
{
$digestAuth = new DigestData(
'username="user", realm="Welcome, robot!", '.
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '.
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '.
'response="b52938fc9e6d7c01be7702ece9031b42"'
);
$this->assertEquals('user', $digestAuth->getUsername());
}
public function testGetUsernameWithQuote()
{
$digestAuth = new DigestData(
'username="\"user\"", realm="Welcome, robot!", '.
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '.
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '.
'response="b52938fc9e6d7c01be7702ece9031b42"'
);
$this->assertEquals('"user"', $digestAuth->getUsername());
}
public function testGetUsernameWithQuoteAndEscape()
{
$digestAuth = new DigestData(
'username="\"u\\\\\"ser\"", realm="Welcome, robot!", '.
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '.
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '.
'response="b52938fc9e6d7c01be7702ece9031b42"'
);
$this->assertEquals('"u\\"ser"', $digestAuth->getUsername());
}
public function testGetUsernameWithSingleQuote()
{
$digestAuth = new DigestData(
'username="\"u\'ser\"", realm="Welcome, robot!", '.
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '.
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '.
'response="b52938fc9e6d7c01be7702ece9031b42"'
);
$this->assertEquals('"u\'ser"', $digestAuth->getUsername());
}
public function testGetUsernameWithSingleQuoteAndEscape()
{
$digestAuth = new DigestData(
'username="\"u\\\'ser\"", realm="Welcome, robot!", '.
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '.
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '.
'response="b52938fc9e6d7c01be7702ece9031b42"'
);
$this->assertEquals('"u\\\'ser"', $digestAuth->getUsername());
}
public function testGetUsernameWithEscape()
{
$digestAuth = new DigestData(
'username="\"u\\ser\"", realm="Welcome, robot!", '.
'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '.
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '.
'response="b52938fc9e6d7c01be7702ece9031b42"'
);
$this->assertEquals('"u\\ser"', $digestAuth->getUsername());
}
public function testValidateAndDecode()
{
$time = microtime(true);
$key = 'ThisIsAKey';
$nonce = base64_encode($time.':'.md5($time.':'.$key));
$digestAuth = new DigestData(
'username="user", realm="Welcome, robot!", nonce="'.$nonce.'", '.
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '.
'response="b52938fc9e6d7c01be7702ece9031b42"'
);
try {
$digestAuth->validateAndDecode($key, 'Welcome, robot!');
} catch (\Exception $e) {
$this->fail(sprintf('testValidateAndDecode fail with message: %s', $e->getMessage()));
}
}
public function testCalculateServerDigest()
{
$this->calculateServerDigest('user', 'Welcome, robot!', 'pass,word=password', 'ThisIsAKey', '00000001', 'MDIwODkz', 'auth', 'GET', '/path/info?p1=5&p2=5');
}
public function testCalculateServerDigestWithQuote()
{
$this->calculateServerDigest('\"user\"', 'Welcome, \"robot\"!', 'pass,word=password', 'ThisIsAKey', '00000001', 'MDIwODkz', 'auth', 'GET', '/path/info?p1=5&p2=5');
}
public function testCalculateServerDigestWithQuoteAndEscape()
{
$this->calculateServerDigest('\"u\\\\\"ser\"', 'Welcome, \"robot\"!', 'pass,word=password', 'ThisIsAKey', '00000001', 'MDIwODkz', 'auth', 'GET', '/path/info?p1=5&p2=5');
}
public function testCalculateServerDigestEscape()
{
$this->calculateServerDigest('\"u\\ser\"', 'Welcome, \"robot\"!', 'pass,word=password', 'ThisIsAKey', '00000001', 'MDIwODkz', 'auth', 'GET', '/path/info?p1=5&p2=5');
$this->calculateServerDigest('\"u\\ser\\\\\"', 'Welcome, \"robot\"!', 'pass,word=password', 'ThisIsAKey', '00000001', 'MDIwODkz', 'auth', 'GET', '/path/info?p1=5&p2=5');
}
public function testIsNonceExpired()
{
$time = microtime(true) + 10;
$key = 'ThisIsAKey';
$nonce = base64_encode($time.':'.md5($time.':'.$key));
$digestAuth = new DigestData(
'username="user", realm="Welcome, robot!", nonce="'.$nonce.'", '.
'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '.
'response="b52938fc9e6d7c01be7702ece9031b42"'
);
$digestAuth->validateAndDecode($key, 'Welcome, robot!');
$this->assertFalse($digestAuth->isNonceExpired());
}
protected function setUp()
{
class_exists('Symfony\Component\Security\Http\Firewall\DigestAuthenticationListener', true);
}
private function calculateServerDigest($username, $realm, $password, $key, $nc, $cnonce, $qop, $method, $uri)
{
$time = microtime(true);
$nonce = base64_encode($time.':'.md5($time.':'.$key));
$response = md5(
md5($username.':'.$realm.':'.$password).':'.$nonce.':'.$nc.':'.$cnonce.':'.$qop.':'.md5($method.':'.$uri)
);
$digest = sprintf('username="%s", realm="%s", nonce="%s", uri="%s", cnonce="%s", nc=%s, qop="%s", response="%s"',
$username, $realm, $nonce, $uri, $cnonce, $nc, $qop, $response
);
$digestAuth = new DigestData($digest);
$this->assertEquals($digestAuth->getResponse(), $digestAuth->calculateServerDigest($password, $method));
}
}
|
GhafariOlivier/ProjetWeb2014GhafariMeunier
|
vendor/symfony/symfony/src/Symfony/Component/Security/Http/Tests/Firewall/DigestDataTest.php
|
PHP
|
mit
| 7,098 |
var assert = require('assert');
var Traverse = require('traverse');
exports.mutate = function () {
var obj = { a : 1, b : 2, c : [ 3, 4 ] };
var res = Traverse(obj).forEach(function (x) {
if (typeof x === 'number' && x % 2 === 0) {
this.update(x * 10);
}
});
assert.deepEqual(obj, res);
assert.deepEqual(obj, { a : 1, b : 20, c : [ 3, 40 ] });
};
exports.mutateT = function () {
var obj = { a : 1, b : 2, c : [ 3, 4 ] };
var res = Traverse.forEach(obj, function (x) {
if (typeof x === 'number' && x % 2 === 0) {
this.update(x * 10);
}
});
assert.deepEqual(obj, res);
assert.deepEqual(obj, { a : 1, b : 20, c : [ 3, 40 ] });
};
exports.map = function () {
var obj = { a : 1, b : 2, c : [ 3, 4 ] };
var res = Traverse(obj).map(function (x) {
if (typeof x === 'number' && x % 2 === 0) {
this.update(x * 10);
}
});
assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] });
assert.deepEqual(res, { a : 1, b : 20, c : [ 3, 40 ] });
};
exports.mapT = function () {
var obj = { a : 1, b : 2, c : [ 3, 4 ] };
var res = Traverse.map(obj, function (x) {
if (typeof x === 'number' && x % 2 === 0) {
this.update(x * 10);
}
});
assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] });
assert.deepEqual(res, { a : 1, b : 20, c : [ 3, 40 ] });
};
exports.clone = function () {
var obj = { a : 1, b : 2, c : [ 3, 4 ] };
var res = Traverse(obj).clone();
assert.deepEqual(obj, res);
assert.ok(obj !== res);
obj.a ++;
assert.deepEqual(res.a, 1);
obj.c.push(5);
assert.deepEqual(res.c, [ 3, 4 ]);
};
exports.cloneT = function () {
var obj = { a : 1, b : 2, c : [ 3, 4 ] };
var res = Traverse.clone(obj);
assert.deepEqual(obj, res);
assert.ok(obj !== res);
obj.a ++;
assert.deepEqual(res.a, 1);
obj.c.push(5);
assert.deepEqual(res.c, [ 3, 4 ]);
};
exports.reduce = function () {
var obj = { a : 1, b : 2, c : [ 3, 4 ] };
var res = Traverse(obj).reduce(function (acc, x) {
if (this.isLeaf) acc.push(x);
return acc;
}, []);
assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] });
assert.deepEqual(res, [ 1, 2, 3, 4 ]);
};
exports.reduceInit = function () {
var obj = { a : 1, b : 2, c : [ 3, 4 ] };
var res = Traverse(obj).reduce(function (acc, x) {
if (this.isRoot) assert.fail('got root');
return acc;
});
assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] });
assert.deepEqual(res, obj);
};
exports.remove = function () {
var obj = { a : 1, b : 2, c : [ 3, 4 ] };
Traverse(obj).forEach(function (x) {
if (this.isLeaf && x % 2 == 0) this.remove();
});
assert.deepEqual(obj, { a : 1, c : [ 3 ] });
};
exports.removeMap = function () {
var obj = { a : 1, b : 2, c : [ 3, 4 ] };
var res = Traverse(obj).map(function (x) {
if (this.isLeaf && x % 2 == 0) this.remove();
});
assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] });
assert.deepEqual(res, { a : 1, c : [ 3 ] });
};
exports.delete = function () {
var obj = { a : 1, b : 2, c : [ 3, 4 ] };
Traverse(obj).forEach(function (x) {
if (this.isLeaf && x % 2 == 0) this.delete();
});
assert.ok(!Traverse.deepEqual(
obj, { a : 1, c : [ 3, undefined ] }
));
assert.ok(Traverse.deepEqual(
obj, { a : 1, c : [ 3 ] }
));
assert.ok(!Traverse.deepEqual(
obj, { a : 1, c : [ 3, null ] }
));
};
exports.deleteRedux = function () {
var obj = { a : 1, b : 2, c : [ 3, 4, 5 ] };
Traverse(obj).forEach(function (x) {
if (this.isLeaf && x % 2 == 0) this.delete();
});
assert.ok(!Traverse.deepEqual(
obj, { a : 1, c : [ 3, undefined, 5 ] }
));
assert.ok(Traverse.deepEqual(
obj, { a : 1, c : [ 3 ,, 5 ] }
));
assert.ok(!Traverse.deepEqual(
obj, { a : 1, c : [ 3, null, 5 ] }
));
assert.ok(!Traverse.deepEqual(
obj, { a : 1, c : [ 3, 5 ] }
));
};
exports.deleteMap = function () {
var obj = { a : 1, b : 2, c : [ 3, 4 ] };
var res = Traverse(obj).map(function (x) {
if (this.isLeaf && x % 2 == 0) this.delete();
});
assert.ok(Traverse.deepEqual(
obj,
{ a : 1, b : 2, c : [ 3, 4 ] }
));
var xs = [ 3, 4 ];
delete xs[1];
assert.ok(Traverse.deepEqual(
res, { a : 1, c : xs }
));
assert.ok(Traverse.deepEqual(
res, { a : 1, c : [ 3, ] }
));
assert.ok(Traverse.deepEqual(
res, { a : 1, c : [ 3 ] }
));
};
exports.deleteMapRedux = function () {
var obj = { a : 1, b : 2, c : [ 3, 4, 5 ] };
var res = Traverse(obj).map(function (x) {
if (this.isLeaf && x % 2 == 0) this.delete();
});
assert.ok(Traverse.deepEqual(
obj,
{ a : 1, b : 2, c : [ 3, 4, 5 ] }
));
var xs = [ 3, 4, 5 ];
delete xs[1];
assert.ok(Traverse.deepEqual(
res, { a : 1, c : xs }
));
assert.ok(!Traverse.deepEqual(
res, { a : 1, c : [ 3, 5 ] }
));
assert.ok(Traverse.deepEqual(
res, { a : 1, c : [ 3 ,, 5 ] }
));
};
|
FranckW/utilsApp
|
node_modules/chainsaw/node_modules/traverse/test/mutability.js
|
JavaScript
|
mit
| 5,320 |
/*!
* depd
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module exports.
* @public
*/
module.exports = depd
/**
* Create deprecate for namespace in caller.
*/
function depd(namespace) {
if (!namespace) {
throw new TypeError('argument namespace is required')
}
function deprecate(message) {
// no-op in browser
}
deprecate._file = undefined
deprecate._ignored = true
deprecate._namespace = namespace
deprecate._traced = false
deprecate._warned = Object.create(null)
deprecate.function = wrapfunction
deprecate.property = wrapproperty
return deprecate
}
/**
* Return a wrapped function in a deprecation message.
*
* This is a no-op version of the wrapper, which does nothing but call
* validation.
*/
function wrapfunction(fn, message) {
if (typeof fn !== 'function') {
throw new TypeError('argument fn must be a function')
}
return fn
}
/**
* Wrap property in a deprecation message.
*
* This is a no-op version of the wrapper, which does nothing but call
* validation.
*/
function wrapproperty(obj, prop, message) {
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
throw new TypeError('argument obj must be object')
}
var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
if (!descriptor) {
throw new TypeError('must call property on owner object')
}
if (!descriptor.configurable) {
throw new TypeError('property must be configurable')
}
return
}
|
giiniiiii/Nodejs
|
node_modules/express/node_modules/depd/lib/browser/index.js
|
JavaScript
|
mit
| 1,518 |
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
#include "pch.h"
#include "Scenario2.xaml.h"
#include "MainPage.xaml.h"
#include "ProjectionViewPage.xaml.h"
#include "ViewLifetimeControl.h"
using namespace SDKSample;
using namespace Concurrency;
using namespace Platform;
using namespace SDKSample::SecondaryViewsHelpers;
using namespace Windows::ApplicationModel::Core;
using namespace Windows::UI::Core;
using namespace Windows::UI::ViewManagement;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Interop;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
Scenario2::Scenario2()
{
InitializeComponent();
thisViewId = ApplicationView::GetForCurrentView()->Id;
}
void Scenario2::OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
{
// An app can query if a second display is available...
UpdateTextBlock(ProjectionManager::ProjectionDisplayAvailable);
// ...or listen for when a display is attached or detached
displayChangeToken = ProjectionManager::ProjectionDisplayAvailableChanged += ref new Windows::Foundation::EventHandler<Object^>(this, &Scenario2::OnProjectionDisplayAvailableChanged);
dispatcher = Window::Current->Dispatcher;
}
void Scenario2::OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
{
ProjectionManager::ProjectionDisplayAvailableChanged -= displayChangeToken;
}
void Scenario2::OnProjectionDisplayAvailableChanged(Object^ sender, Object^ e)
{
dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]() {
UpdateTextBlock(ProjectionManager::ProjectionDisplayAvailable);
}));
}
void Scenario2::UpdateTextBlock(bool screenAvailable)
{
if (screenAvailable)
{
displayAvailableStatus->Text = "Display is available";
startprojecting_button->Visibility = Windows::UI::Xaml::Visibility::Visible;
requestandstartprojecting_button->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
}
else
{
displayAvailableStatus->Text = "Display is not available, select one:";
startprojecting_button->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
requestandstartprojecting_button->Visibility = Windows::UI::Xaml::Visibility::Visible;
}
}
void Scenario2::StartProjecting_Click(Object^ sender, RoutedEventArgs^ e)
{
auto prerequisite = task<void>([]() {});
// If projection is already in progress, then it could be shown on the monitor again
// Otherwise, we need to create a new view to show the presentation
if (MainPage::Current->ProjectionViewPageControl == nullptr)
{
// First, create a new, blank view
auto mainDispatcher = Window::Current->Dispatcher;
int mainViewId = thisViewId;
prerequisite = create_task(CoreApplication::CreateNewView()->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([mainViewId, mainDispatcher]()
{
// ViewLifetimeControl is a wrapper to make sure the view is closed only
// when the app is done with it
MainPage::Current->ProjectionViewPageControl = ViewLifetimeControl::CreateForCurrentView();
// Assemble some data necessary for the new page
auto initData = ref new ProjectionViewPageInitializationData();
initData->MainDispatcher = mainDispatcher;
initData->ProjectionViewPageControl = MainPage::Current->ProjectionViewPageControl;
initData->MainViewId = mainViewId;
// Display the page in the view. Note that the view will not become visible
// until "StartProjectingAsync" is called
auto rootFrame = ref new Windows::UI::Xaml::Controls::Frame();
rootFrame->Navigate(TypeName(ProjectionViewPage::typeid), initData);
Window::Current->Content = rootFrame;
// The call to Window.Current.Activate is required starting in Windos 10.
// Without it, the view will never appear.
Window::Current->Activate();
})));
}
prerequisite.then([this]()
{
try
{
// Start/StopViewInUse are used to signal that the app is interacting with the
// view, so it shouldn't be closed yet, even if the user loses access to it
MainPage::Current->ProjectionViewPageControl->StartViewInUse();
// Show the view on a second display (if available) or on the primary display
create_task(ProjectionManager::StartProjectingAsync(
MainPage::Current->ProjectionViewPageControl->Id,
thisViewId
)).then([]() {
MainPage::Current->ProjectionViewPageControl->StopViewInUse();
});
}
catch (ObjectDisposedException^)
{
// The projection view is being disposed
MainPage::Current->NotifyUser("The projection view is being disposed", NotifyType::ErrorMessage);
}
}, task_continuation_context::use_arbitrary());
}
void Scenario2::RequestAndStartProjecting_Click(Object^ sender, RoutedEventArgs^ e)
{
auto prerequisite = task<void>([]() {});
// If projection is already in progress, then it could be shown on the monitor again
// Otherwise, we need to create a new view to show the presentation
if (MainPage::Current->ProjectionViewPageControl == nullptr)
{
// First, create a new, blank view
auto mainDispatcher = Window::Current->Dispatcher;
int mainViewId = thisViewId;
prerequisite = create_task(CoreApplication::CreateNewView()->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([mainViewId, mainDispatcher]()
{
// ViewLifetimeControl is a wrapper to make sure the view is closed only
// when the app is done with it
MainPage::Current->ProjectionViewPageControl = ViewLifetimeControl::CreateForCurrentView();
// Assemble some data necessary for the new page
auto initData = ref new ProjectionViewPageInitializationData();
initData->MainDispatcher = mainDispatcher;
initData->ProjectionViewPageControl = MainPage::Current->ProjectionViewPageControl;
initData->MainViewId = mainViewId;
// Display the page in the view. Note that the view will not become visible
// until "StartProjectingAsync" is called
auto rootFrame = ref new Windows::UI::Xaml::Controls::Frame();
rootFrame->Navigate(TypeName(ProjectionViewPage::typeid), initData);
Window::Current->Content = rootFrame;
Window::Current->Activate();
})));
}
prerequisite.then([this]()
{
try
{
// Start/StopViewInUse are used to signal that the app is interacting with the
// view, so it shouldn't be closed yet, even if the user loses access to it
MainPage::Current->ProjectionViewPageControl->StartViewInUse();
// Show the view on a second display (if available) or on the primary display
Windows::Foundation::Rect pickerLocation = { 470.0, 0.0, 200.0, 300.0 };
// Show the view on a second display (if available) or on the primary display
create_task(ProjectionManager::RequestStartProjectingAsync(
MainPage::Current->ProjectionViewPageControl->Id,
thisViewId, pickerLocation,Windows::UI::Popups::Placement::Above
)).then([](bool result) {
MainPage::Current->ProjectionViewPageControl->StopViewInUse();
});
}
catch (ObjectDisposedException^)
{
// The projection view is being disposed
MainPage::Current->NotifyUser("The projection view is being disposed", NotifyType::ErrorMessage);
}
}, task_continuation_context::use_arbitrary());
}
|
GeorgePanaretos/Windows-universal-samples
|
Samples/Projection/cpp/Scenario2.xaml.cpp
|
C++
|
mit
| 8,425 |
/*! formstone v0.8.8 [grid.ie.css] 2015-09-15 | MIT License | formstone.it */
.fs_grid_row {
width: 300px;
margin-left: auto;
margin-right: auto;
}
@media screen and (min-width: 500px) {
.fs_grid_row {
width: 480px;
}
}
@media screen and (min-width: 740px) {
.fs_grid_row {
width: 720px;
}
}
@media screen and (min-width: 980px) {
.fs_grid_row {
width: 960px;
}
}
@media screen and (min-width: 1220px) {
.fs_grid_row {
width: 1200px;
}
}
.fs_grid_row:after {
height: 0;
clear: both;
content: ".";
display: block;
line-height: 0;
visibility: hidden;
}
.fs_grid_row_fluid {
width: 96%;
width: -webkit-calc(100% - 40px);
width: calc(100% - 40px);
}
@media screen and (max-width: 739px) {
.fs_grid_row_fluid_sm {
width: 96%;
width: -webkit-calc(100% - 40px);
width: calc(100% - 40px);
}
}
.fs_grid_row_row {
width: 102.08333333%;
margin-left: -1.04166667%;
margin-right: -1.04166667%;
}
.fs_grid_row_row_contained {
width: 100%;
margin-left: 0;
margin-right: 0;
}
.fs_grid_cell {
width: 97.91666667%;
float: left;
margin-left: 1.04166667%;
margin-right: 1.04166667%;
}
.fs_grid_cell_centered {
float: none;
margin-left: auto;
margin-right: auto;
}
.fs_grid_cell_padded {
box-sizing: content-box;
margin-left: 0;
margin-right: 0;
padding-left: 1.04166667%;
padding-right: 1.04166667%;
}
.fs_grid_cell_contained {
margin-left: 0;
margin-right: 0;
}
.fs_grid_cell_right {
float: right;
}
*,
*:before,
*:after {
behavior: url(boxsizing.htc);
}
.fs-grid .fs-row {
width: 960px;
}
.fs-grid .fs-row .fs-lg-1 {
width: 6.25%;
}
.fs-grid .fs-row .fs-lg-2 {
width: 14.58333333%;
}
.fs-grid .fs-row .fs-lg-3 {
width: 22.91666667%;
}
.fs-grid .fs-row .fs-lg-4 {
width: 31.25%;
}
.fs-grid .fs-row .fs-lg-5 {
width: 39.58333333%;
}
.fs-grid .fs-row .fs-lg-6 {
width: 47.91666667%;
}
.fs-grid .fs-row .fs-lg-7 {
width: 56.25%;
}
.fs-grid .fs-row .fs-lg-8 {
width: 64.58333333%;
}
.fs-grid .fs-row .fs-lg-9 {
width: 72.91666667%;
}
.fs-grid .fs-row .fs-lg-10 {
width: 81.25%;
}
.fs-grid .fs-row .fs-lg-11 {
width: 89.58333333%;
}
.fs-grid .fs-row .fs-lg-12 {
width: 97.91666667%;
}
.fs-grid .fs-row .fs-lg-push-1 {
margin-left: 9.375%;
}
.fs-grid .fs-row .fs-lg-push-2 {
margin-left: 17.70833333%;
}
.fs-grid .fs-row .fs-lg-push-3 {
margin-left: 26.04166667%;
}
.fs-grid .fs-row .fs-lg-push-4 {
margin-left: 34.375%;
}
.fs-grid .fs-row .fs-lg-push-5 {
margin-left: 42.70833333%;
}
.fs-grid .fs-row .fs-lg-push-6 {
margin-left: 51.04166667%;
}
.fs-grid .fs-row .fs-lg-push-7 {
margin-left: 59.375%;
}
.fs-grid .fs-row .fs-lg-push-8 {
margin-left: 67.70833333%;
}
.fs-grid .fs-row .fs-lg-push-9 {
margin-left: 76.04166667%;
}
.fs-grid .fs-row .fs-lg-push-10 {
margin-left: 84.375%;
}
.fs-grid .fs-row .fs-lg-push-11 {
margin-left: 92.70833333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-1 {
width: 8.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-2 {
width: 16.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-3 {
width: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-4 {
width: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-5 {
width: 41.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-6 {
width: 50%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-7 {
width: 58.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-8 {
width: 66.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-9 {
width: 75%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-10 {
width: 83.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-11 {
width: 91.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-12 {
width: 100%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-1 {
margin-left: 8.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-2 {
margin-left: 16.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-3 {
margin-left: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-4 {
margin-left: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-5 {
margin-left: 41.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-6 {
margin-left: 50%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-7 {
margin-left: 58.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-8 {
margin-left: 66.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-9 {
margin-left: 75%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-10 {
margin-left: 83.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-11 {
margin-left: 91.66666667%;
}
.fs-grid .fs-row .fs-lg-fifth {
width: 17.91666667%;
}
.fs-grid .fs-row .fs-lg-fourth {
width: 22.91666667%;
}
.fs-grid .fs-row .fs-lg-third {
width: 31.25%;
}
.fs-grid .fs-row .fs-lg-half {
width: 47.91666667%;
}
.fs-grid .fs-row .fs-lg-full {
width: 97.91666667%;
}
.fs-grid .fs-row .fs-lg-push-fifth {
margin-left: 21.04166667%;
}
.fs-grid .fs-row .fs-lg-push-fourth {
margin-left: 26.04166667%;
}
.fs-grid .fs-row .fs-lg-push-third {
margin-left: 34.375%;
}
.fs-grid .fs-row .fs-lg-push-half {
margin-left: 51.04166667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-fifth {
width: 20%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-fourth {
width: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-third {
width: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-half {
width: 50%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-full {
width: 100%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-fifth {
margin-left: 20%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-fourth {
margin-left: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-third {
margin-left: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-half {
margin-left: 50%;
}
.fs-grid .fs-row .fs-lg-hide {
display: none;
}
.fs-grid .fs-row .fs-cell.-padded {
behavior: none;
}
|
redmunds/cdnjs
|
ajax/libs/formstone/0.8.8/css/grid.ie.css
|
CSS
|
mit
| 5,987 |
<?php
/**
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
namespace Aws\DynamoDb\Model\BatchRequest;
use Aws\Common\Client\AwsClientInterface;
use Aws\Common\Enum\UaString as Ua;
use Aws\DynamoDb\Exception\DynamoDbException;
use Aws\DynamoDb\Exception\UnprocessedWriteRequestsException;
use Guzzle\Batch\BatchTransferInterface;
use Guzzle\Common\Exception\ExceptionCollection;
use Guzzle\Http\Message\EntityEnclosingRequestInterface;
use Guzzle\Service\Command\CommandInterface;
/**
* Transfer logic for executing the write request batch
*/
class WriteRequestBatchTransfer implements BatchTransferInterface
{
/**
* The maximum number of items allowed in a BatchWriteItem operation
*/
const BATCH_WRITE_MAX_SIZE = 25;
/**
* @var AwsClientInterface The DynamoDB client for doing transfers
*/
protected $client;
/**
* Constructs a transfer using the injected client
*
* @param AwsClientInterface $client
*/
public function __construct(AwsClientInterface $client)
{
$this->client = $client;
}
/**
* {@inheritdoc}
*/
public function transfer(array $batch)
{
// Create a container exception for any unprocessed items
$unprocessed = new UnprocessedWriteRequestsException();
// Execute the transfer logic
$this->performTransfer($batch, $unprocessed);
// Throw an exception containing the unprocessed items if there are any
if (count($unprocessed)) {
throw $unprocessed;
}
}
/**
* Transfer a batch of requests and collect any unprocessed items
*
* @param array $batch A batch of write requests
* @param UnprocessedWriteRequestsException $unprocessedRequests Collection of unprocessed items
*
* @throws \Guzzle\Common\Exception\ExceptionCollection
*/
protected function performTransfer(
array $batch,
UnprocessedWriteRequestsException $unprocessedRequests
) {
// Do nothing if the batch is empty
if (empty($batch)) {
return;
}
// Prepare an array of commands to be sent in parallel from the batch
$commands = $this->prepareCommandsForBatchedItems($batch);
// Execute the commands and handle exceptions
try {
$commands = $this->client->execute($commands);
$this->getUnprocessedRequestsFromCommands($commands, $unprocessedRequests);
} catch (ExceptionCollection $exceptions) {
// Create a container exception for any unhandled (true) exceptions
$unhandledExceptions = new ExceptionCollection();
// Loop through caught exceptions and handle RequestTooLarge scenarios
/** @var DynamoDbException $e */
foreach ($exceptions as $e) {
if ($e instanceof DynamoDbException) {
$request = $e->getRequest();
if ($e->getStatusCode() === 413) {
$this->retryLargeRequest($request, $unprocessedRequests);
} elseif ($e->getExceptionCode() === 'ProvisionedThroughputExceededException') {
$this->handleUnprocessedRequestsAfterException($request, $unprocessedRequests);
} else {
$unhandledExceptions->add($e);
}
} else {
$unhandledExceptions->add($e);
}
}
// If there were unhandled exceptions, throw them
if (count($unhandledExceptions)) {
throw $unhandledExceptions;
}
}
}
/**
* Prepares an array of BatchWriteItem command objects for a given batch of items
*
* @param array $batch A batch of write requests
*
* @return array
*/
protected function prepareCommandsForBatchedItems(array $batch)
{
$commands = array();
foreach (array_chunk($batch, self::BATCH_WRITE_MAX_SIZE) as $chunk) {
// Convert the request items into the format required by the client
$items = array();
foreach ($chunk as $item) {
if ($item instanceof AbstractWriteRequest) {
/** @var AbstractWriteRequest $item */
$table = $item->getTableName();
if (!isset($items[$table])) {
$items[$table] = array();
}
$items[$table][] = $item->toArray();
}
}
// Create the BatchWriteItem request
$commands[] = $this->client->getCommand('BatchWriteItem', array(
'RequestItems' => $items,
Ua::OPTION => Ua::BATCH
));
}
return $commands;
}
/**
* Handles unprocessed items from the executed commands. Unprocessed items
* can be collected and thrown in an UnprocessedWriteRequestsException
*
* @param array $commands Array of commands
* @param UnprocessedWriteRequestsException $unprocessedRequests Collection of unprocessed items
*/
protected function getUnprocessedRequestsFromCommands(
array $commands,
UnprocessedWriteRequestsException $unprocessedRequests
) {
/** @var CommandInterface $command */
foreach ($commands as $command) {
if ($command instanceof CommandInterface && $command->isExecuted()) {
$result = $command->getResult();
$items = $this->convertResultsToUnprocessedRequests($result['UnprocessedItems']);
foreach ($items as $request) {
$unprocessedRequests->addItem($request);
}
}
}
}
/**
* Handles exceptions caused by the request being too large (over 1 MB). The
* response will have a status code of 413. In this case the batch should be
* split up into smaller batches and retried.
*
* @param EntityEnclosingRequestInterface $request The failed request
* @param UnprocessedWriteRequestsException $unprocessedRequests Collection of unprocessed items
*/
protected function retryLargeRequest(
EntityEnclosingRequestInterface $request,
UnprocessedWriteRequestsException $unprocessedRequests
) {
// Collect the items out from the request object
$items = $this->extractItemsFromRequestObject($request);
// Divide batch into smaller batches and transfer them via recursion
// NOTE: Dividing the batch into 3 (instead of 2) batches resulted in less recursion during testing
if ($items) {
$newBatches = array_chunk($items, ceil(count($items) / 3));
foreach ($newBatches as $newBatch) {
$this->performTransfer($newBatch, $unprocessedRequests);
}
}
}
/**
* Handles unprocessed items if the entire batch was rejected due to exceeding the provisioned throughput
*
* @param EntityEnclosingRequestInterface $request The failed request
* @param UnprocessedWriteRequestsException $unprocessedRequests Collection of unprocessed items
*/
protected function handleUnprocessedRequestsAfterException(
EntityEnclosingRequestInterface $request,
UnprocessedWriteRequestsException $unprocessedRequests
) {
$items = $this->extractItemsFromRequestObject($request);
foreach ($items as $request) {
$unprocessedRequests->addItem($request);
}
}
/**
* Collects and creates unprocessed request objects from data collected from erroneous cases
*
* @param array $items Data formatted under "RequestItems" or "UnprocessedItems" keys
*
* @return array
*/
protected function convertResultsToUnprocessedRequests(array $items)
{
$unprocessed = array();
foreach ($items as $table => $requests) {
foreach ($requests as $request) {
$unprocessed[] = new UnprocessedRequest($request, $table);
}
}
return $unprocessed;
}
/**
* Helper method to extract the items from a request object for a BatchWriteItem operation
*
* @param EntityEnclosingRequestInterface $request
*
* @return array
*/
private function extractItemsFromRequestObject(EntityEnclosingRequestInterface $request)
{
$items = json_decode((string) $request->getBody(), true);
return $this->convertResultsToUnprocessedRequests($items['RequestItems'] ?: array());
}
}
|
UCM-SistemasWeb-Veery/Veery
|
vendor/aws/aws-sdk-php/src/Aws/DynamoDb/Model/BatchRequest/WriteRequestBatchTransfer.php
|
PHP
|
mit
| 9,292 |
"use strict";angular.module("ngLocale",[],["$provide",function($provide){var PLURAL_CATEGORY={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};function getDecimals(n){n=n+"";var i=n.indexOf(".");return i==-1?0:n.length-i-1}function getVF(n,opt_precision){var v=opt_precision;if(undefined===v){v=Math.min(getDecimals(n),3)}var base=Math.pow(10,v);var f=(n*base|0)%base;return{v:v,f:f}}$provide.value("$locale",{DATETIME_FORMATS:{AMPMS:["a.m.","p.m."],DAY:["dy Sul","dy Lun","dy Meurth","dy Merher","dy Yow","dy Gwener","dy Sadorn"],ERANAMES:["RC","AD"],ERAS:["RC","AD"],FIRSTDAYOFWEEK:0,MONTH:["mis Genver","mis Hwevrer","mis Meurth","mis Ebrel","mis Me","mis Metheven","mis Gortheren","mis Est","mis Gwynngala","mis Hedra","mis Du","mis Kevardhu"],SHORTDAY:["Sul","Lun","Mth","Mhr","Yow","Gwe","Sad"],SHORTMONTH:["Gen","Hwe","Meu","Ebr","Me","Met","Gor","Est","Gwn","Hed","Du","Kev"],STANDALONEMONTH:["mis Genver","mis Hwevrer","mis Meurth","mis Ebrel","mis Me","mis Metheven","mis Gortheren","mis Est","mis Gwynngala","mis Hedra","mis Du","mis Kevardhu"],WEEKENDRANGE:[5,6],fullDate:"EEEE d MMMM y",longDate:"d MMMM y",medium:"d MMM y HH:mm:ss",mediumDate:"d MMM y",mediumTime:"HH:mm:ss","short":"dd/MM/y HH:mm",shortDate:"dd/MM/y",shortTime:"HH:mm"},NUMBER_FORMATS:{CURRENCY_SYM:"£",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-¤",negSuf:"",posPre:"¤",posSuf:""}]},id:"kw",pluralCat:function(n,opt_precision){var i=n|0;var vf=getVF(n,opt_precision);if(i==1&&vf.v==0){return PLURAL_CATEGORY.ONE}return PLURAL_CATEGORY.OTHER}})}]);
|
kennynaoh/cdnjs
|
ajax/libs/angular-i18n/1.5.0-rc.1/angular-locale_kw.min.js
|
JavaScript
|
mit
| 1,695 |
/*!
* froala_editor v2.0.4 (https://www.froala.com/wysiwyg-editor)
* License https://froala.com/wysiwyg-editor/terms
* Copyright 2014-2015 Froala Labs
*/
/**
* Hungarian
*/
$.FroalaEditor.LANGUAGE['hu'] = {
translation: {
// Place holder
"Type something": "T\u00edpus valami",
// Basic formatting
"Bold": "F\u00e9lk\u00f6v\u00e9r",
"Italic": "D\u0151lt",
"Underline": "Al\u00e1h\u00fazott",
"Strikethrough": "\u00c1th\u00fazott",
// Main buttons
"Insert": "Beilleszt\u00e9se",
"Delete": "T\u00f6r\u00f6l",
"Cancel": "M\u00e9gse",
"OK": "Rendben",
"Back": "Vissza",
"Remove": "Elt\u00e1vol\u00edt\u00e1sa",
"More": "T\u00f6bb",
"Update": "Friss\u00edt\u00e9s",
"Style": "St\u00edlus",
// Font
"Font Family": "Bet\u0171t\u00edpus",
"Font Size": "Bet\u0171m\u00e9retek",
// Colors
"Colors": "Sz\u00ednek",
"Background": "H\u00e1tt\u00e9r",
"Text": "Sz\u00f6veg",
// Paragraphs
"Paragraph Format": "Form\u00e1tumok",
"Normal": "Norm\u00e1l",
"Code": "K\u00f3d",
"Heading 1": "C\u00edmsor 1",
"Heading 2": "C\u00edmsor 2",
"Heading 3": "C\u00edmsor 3",
"Heading 4": "C\u00edmsor 4",
// Style
"Paragraph Style": "Bekezd\u00e9s st\u00edlus\u00e1t",
"Inline Style": "Helyi st\u00edlus",
// Alignment
"Align": "Igaz\u00edt\u00e1s",
"Align Left": "Balra igaz\u00edt",
"Align Center": "K\u00f6z\u00e9pre z\u00e1r",
"Align Right": "Jobbra igaz\u00edt",
"Align Justify": "Sorkiz\u00e1r\u00e1s",
"None": "Egyik sem",
// Lists
"Ordered List": "Sz\u00e1moz\u00e1s",
"Unordered List": "Felsorol\u00e1s",
// Indent
"Decrease Indent": "Beh\u00faz\u00e1s cs\u00f6kkent\u00e9se",
"Increase Indent": "Beh\u00faz\u00e1s n\u00f6vel\u00e9se",
// Links
"Insert Link": "Link beilleszt\u00e9se",
"Open in new tab": "Megnyit\u00e1s \u00faj lapon",
"Open Link": "Link megnyit\u00e1sa",
"Edit Link": "Szerkeszt\u00e9s linkre",
"Unlink": "Hivatkoz\u00e1s t\u00f6rl\u00e9se",
"Choose Link": "V\u00e1lasztani linket",
// Images
"Insert Image": "K\u00e9p besz\u00far\u00e1sa",
"Upload Image": "Felt\u00f6lt\u00e9s k\u00e9p",
"By URL": "\u00c1ltal URL",
"Browse": "B\u00f6ng\u00e9sszen",
"Drop image": "Dobd k\u00e9p",
"or click": "vagy kattintson",
"Manage Images": "K\u00e9pek kezel\u00e9se",
"Loading": "Terhel\u00e9s",
"Deleting": "T\u00f6rl\u00e9se",
"Tags": "C\u00edmk\u00e9k",
"Are you sure? Image will be deleted.": "Biztos vagy benne? K\u00e9p t\u00f6rl\u00e9sre ker\u00fcl.",
"Replace": "Cser\u00e9je",
"Uploading": "Felt\u00f6lt\u00e9s",
"Loading image": "K\u00e9pfelt\u00f6lt\u00e9s",
"Display": "Kijelz\u0151",
"Inline": "Sorban",
"Break Text": "T\u00f6r sz\u00f6veg",
"Alternate Text": "Alternat\u00edv sz\u00f6veget",
"Change Size": "M\u00e9ret\u00e9nek v\u00e1ltoz\u00e1sa",
"Width": "Sz\u00e9less\u00e9g",
"Height": "Magass\u00e1g",
"Something went wrong. Please try again.": "Valami elromlott. K\u00e9rlek pr\u00f3b\u00e1ld \u00fajra.",
// Video
"Insert Video": "Vide\u00f3 beilleszt\u00e9se",
"Embedded Code": "Be\u00e1gyazott k\u00f3dot",
// Tables
"Insert Table": "T\u00e1bl\u00e1zat beilleszt\u00e9se",
"Header": "Fejl\u00e9c",
"Row": "Sor",
"Insert row above": "Sor besz\u00far\u00e1sa el\u00e9",
"Insert row below": "Sor besz\u00far\u00e1sa m\u00f6g\u00e9",
"Delete row": "Sor t\u00f6rl\u00e9se",
"Column": "Oszlop",
"Insert column before": "Oszlop besz\u00far\u00e1sa el\u00e9",
"Insert column after": "Oszlop besz\u00far\u00e1sa m\u00f6g\u00e9",
"Delete column": "Oszlop t\u00f6rl\u00e9se",
"Cell": "Cella",
"Merge cells": "Cell\u00e1k egyes\u00edt\u00e9se",
"Horizontal split": "V\u00edzszintes osztott",
"Vertical split": "F\u00fcgg\u0151leges osztott",
"Cell Background": "Cella h\u00e1tt\u00e9r",
"Vertical Align": "F\u00fcgg\u0151leges fej\u00e1ll\u00edt\u00e1s",
"Top": "Fels\u0151",
"Middle": "K\u00f6z\u00e9ps\u0151",
"Bottom": "Als\u00f3",
"Align Top": "Igaz\u00edtsa fels\u0151",
"Align Middle": "Igaz\u00edtsa k\u00f6zep\u00e9n",
"Align Bottom": "Igaz\u00edtsa alj\u00e1n",
"Cell Style": "Cellast\u00edlust",
// Files
"Upload File": "F\u00e1jl felt\u00f6lt\u00e9se",
"Drop file": "Csepp f\u00e1jl",
// Emoticons
"Emoticons": "Hangulatjelek",
"Grinning face": "Vigyorg\u00f3",
"Grinning face with smiling eyes": "Vigyorg\u00f3 arca mosolyg\u00f3 szemek",
"Face with tears of joy": "Arc \u00e1t az \u00f6r\u00f6m k\u00f6nnyei",
"Smiling face with open mouth": "Mosolyg\u00f3 arc t\u00e1tott sz\u00e1jjal",
"Smiling face with open mouth and smiling eyes": "Mosolyg\u00f3 arc t\u00e1tott sz\u00e1jjal \u00e9s mosolyg\u00f3 szemek",
"Smiling face with open mouth and cold sweat": "Mosolyg\u00f3 arc t\u00e1tott sz\u00e1jjal \u00e9s hideg ver\u00edt\u00e9k",
"Smiling face with open mouth and tightly-closed eyes": "Mosolyg\u00f3 arc t\u00e1tott sz\u00e1jjal \u00e9s szorosan lehunyt szemmel",
"Smiling face with halo": "Mosolyg\u00f3 arc halo",
"Smiling face with horns": "Mosolyg\u00f3 arc szarvakkal",
"Winking face": "Kacsintott arca",
"Smiling face with smiling eyes": "Mosolyg\u00f3 arc mosolyg\u00f3 szemek",
"Face savoring delicious food": "Arc \u00edzlelgette \u00edzletes \u00e9telek",
"Relieved face": "Megk\u00f6nnyebb\u00fclt arccal",
"Smiling face with heart-shaped eyes": "Mosolyg\u00f3 arc sz\u00edv alak\u00fa szemek",
"Smiling face with sunglasses": "Mosolyg\u00f3 arc, napszem\u00fcveg",
"Smirking face": "Vigyorg\u00f3 arca",
"Neutral face": "Semleges arc",
"Expressionless face": "Kifejez\u00e9stelen arc",
"Unamused face": "Unott arc",
"Face with cold sweat": "Arc\u00e1t hideg verejt\u00e9k",
"Pensive face": "T\u00f6preng\u0151 arca",
"Confused face": "Zavaros arca",
"Confounded face": "R\u00e1c\u00e1folt arca",
"Kissing face": "Cs\u00f3k arca",
"Face throwing a kiss": "Arc dobott egy cs\u00f3kot",
"Kissing face with smiling eyes": "Cs\u00f3kos arc\u00e1t mosolyg\u00f3 szemek",
"Kissing face with closed eyes": "Cs\u00f3kos arc\u00e1t csukott szemmel",
"Face with stuck out tongue": "Szembe kiny\u00fajtotta a nyelv\u00e9t",
"Face with stuck out tongue and winking eye": "Szembe kiny\u00fajtotta a nyelv\u00e9t, \u00e9s kacsintott szem",
"Face with stuck out tongue and tightly-closed eyes": "Arc kiny\u00fajtotta a nyelv\u00e9t, \u00e9s szorosan lehunyt szemmel",
"Disappointed face": "Csal\u00f3dott arca",
"Worried face": "Agg\u00f3d\u00f3 arc\u00e1t",
"Angry face": "D\u00fch\u00f6s arc",
"Pouting face": "Duzzogva arc",
"Crying face": "S\u00edr\u00f3 arc",
"Persevering face": "Kitart\u00f3 arca",
"Face with look of triumph": "Arc\u00e1t diadalmas pillant\u00e1st",
"Disappointed but relieved face": "Csal\u00f3dott, de megk\u00f6nnyebb\u00fclt arccal",
"Frowning face with open mouth": "Komor arcb\u00f3l t\u00e1tott sz\u00e1jjal",
"Anguished face": "Gy\u00f6tr\u0151d\u0151 arca",
"Fearful face": "F\u00e9lelmetes arc",
"Weary face": "F\u00e1radt arca",
"Sleepy face": "\u00e1lmos arc",
"Tired face": "F\u00e1radt arca",
"Grimacing face": "Fintorogva arc",
"Loudly crying face": "Hangosan s\u00edr\u00f3 arc",
"Face with open mouth": "Arc t\u00e1tott sz\u00e1jjal",
"Hushed face": "Csit\u00edtotta arca",
"Face with open mouth and cold sweat": "Arc t\u00e1tott sz\u00e1jjal \u00e9s hideg ver\u00edt\u00e9k",
"Face screaming in fear": "Arc sikoltozva f\u00e9lelem",
"Astonished face": "Meglepett arca",
"Flushed face": "Kipirult arc",
"Sleeping face": "Alv\u00f3 arc\u00e1t",
"Dizzy face": "sz\u00e1d\u00fcl arca",
"Face without mouth": "Arc n\u00e9lkül sz\u00e1j",
"Face with medical mask": "Arc\u00e1t orvosi maszk",
// Line breaker
"Break": "T\u00f6r",
// Math
"Subscript": "Als\u00f3 index",
"Superscript": "Fels\u0151 index",
// Full screen
"Fullscreen": "Teljes k\u00e9perny\u0151s",
// Horizontal line
"Insert Horizontal Line": "Helyezze v\u00edzszintes vonal",
// Clear formatting
"Clear Formatting": "Form\u00e1z\u00e1s elt\u00e1vol\u00edt\u00e1sa",
// Undo, redo
"Undo": "Visszavon\u00e1s",
"Redo": "Ism\u00e9t",
// Select all
"Select All": "Minden kijel\u00f6l\u00e9se",
// Code view
"Code View": "K\u00f3d n\u00e9zet",
// Quote
"Quote": "Id\u00e9zet",
"Increase": "N\u00f6veked\u00e9s",
"Decrease": "Cs\u00f6kkent"
},
direction: "ltr"
};
|
amoyeh/cdnjs
|
ajax/libs/froala-editor/2.0.4-1/js/languages/hu.js
|
JavaScript
|
mit
| 8,772 |
<?php
namespace TijsVerkoyen\CssToInlineStyles\Css\Rule;
use Symfony\Component\CssSelector\Node\Specificity;
use \TijsVerkoyen\CssToInlineStyles\Css\Property\Processor as PropertyProcessor;
class Processor
{
/**
* Split a string into seperate rules
*
* @param string $rulesString
* @return array
*/
public function splitIntoSeparateRules($rulesString)
{
$rulesString = $this->cleanup($rulesString);
return (array) explode('}', $rulesString);
}
/**
* @param string $string
* @return string
*/
private function cleanup($string)
{
$string = str_replace(array("\r", "\n"), '', $string);
$string = str_replace(array("\t"), ' ', $string);
$string = str_replace('"', '\'', $string);
$string = preg_replace('|/\*.*?\*/|', '', $string);
$string = preg_replace('/\s\s+/', ' ', $string);
$string = trim($string);
$string = rtrim($string, '}');
return $string;
}
/**
* Convert a rule-string into an object
*
* @param string $rule
* @param int $originalOrder
* @return array
*/
public function convertToObjects($rule, $originalOrder)
{
$rule = $this->cleanup($rule);
$chunks = explode('{', $rule);
if (!isset($chunks[1])) {
return array();
}
$propertiesProcessor = new PropertyProcessor();
$rules = array();
$selectors = (array) explode(',', trim($chunks[0]));
$properties = $propertiesProcessor->splitIntoSeparateProperties($chunks[1]);
foreach ($selectors as $selector) {
$selector = trim($selector);
$specificity = $this->calculateSpecificityBasedOnASelector($selector);
$rules[] = new Rule(
$selector,
$propertiesProcessor->convertArrayToObjects($properties, $specificity),
$specificity,
$originalOrder
);
}
return $rules;
}
/**
* Calculate the specificity based on a CSS Selector string,
* Based on the patterns from premailer/css_parser by Alex Dunae
*
* @see https://github.com/premailer/css_parser/blob/master/lib/css_parser/regexps.rb
* @param string $selector
* @return Specificity
*/
public function calculateSpecificityBasedOnASelector($selector)
{
$idSelectorsPattern = " \#";
$classAttributesPseudoClassesSelectorsPattern = " (\.[\w]+) # classes
|
\[(\w+) # attributes
|
(\:( # pseudo classes
link|visited|active
|hover|focus
|lang
|target
|enabled|disabled|checked|indeterminate
|root
|nth-child|nth-last-child|nth-of-type|nth-last-of-type
|first-child|last-child|first-of-type|last-of-type
|only-child|only-of-type
|empty|contains
))";
$typePseudoElementsSelectorPattern = " ((^|[\s\+\>\~]+)[\w]+ # elements
|
\:{1,2}( # pseudo-elements
after|before
|first-letter|first-line
|selection
)
)";
return new Specificity(
preg_match_all("/{$idSelectorsPattern}/ix", $selector, $matches),
preg_match_all("/{$classAttributesPseudoClassesSelectorsPattern}/ix", $selector, $matches),
preg_match_all("/{$typePseudoElementsSelectorPattern}/ix", $selector, $matches)
);
}
/**
* @param array $rules
* @return Rule[]
*/
public function convertArrayToObjects(array $rules, array $objects = array())
{
$order = 1;
foreach ($rules as $rule) {
$objects = array_merge($objects, $this->convertToObjects($rule, $order));
$order++;
}
return $objects;
}
/**
* Sort an array on the specificity element in an ascending way
* Lower specificity will be sorted to the beginning of the array
*
* @return int
* @param Rule $e1 The first element.
* @param Rule $e2 The second element.
*/
public static function sortOnSpecificity(Rule $e1, Rule $e2)
{
$e1Specificity = $e1->getSpecificity();
$value = $e1Specificity->compareTo($e2->getSpecificity());
// if the specificity is the same, use the order in which the element appeared
if ($value === 0) {
$value = $e1->getOrder() - $e2->getOrder();
}
return $value;
}
}
|
dhirajpatra/jobboard
|
vendor/tijsverkoyen/css-to-inline-styles/src/Css/Rule/Processor.php
|
PHP
|
mit
| 4,992 |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>D3 Example</title>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
</head>
<body>
<script>
var outerWidth = 300;
var outerHeight = 250;
var rMin = 0; // "r" stands for radius
var rMax = 20;
var xColumn = "population";
var yColumn = "gdp";
var rColumn = "population";
var svg = d3.select("body").append("svg")
.attr("width", outerWidth)
.attr("height", outerHeight);
var xScale = d3.scale.log().range([0, outerWidth]);
var yScale = d3.scale.log().range([outerHeight, 0]);
var rScale = d3.scale.sqrt().range([rMin, rMax]);
function render(data){
xScale.domain( d3.extent(data, function (d){ return d[xColumn]; }));
yScale.domain( d3.extent(data, function (d){ return d[yColumn]; }));
rScale.domain([0, d3.max(data, function (d){ return d[rColumn]; })]);
var circles = svg.selectAll("circle").data(data);
circles.enter().append("circle");
circles
.attr("cx", function (d){ return xScale(d[xColumn]); })
.attr("cy", function (d){ return yScale(d[yColumn]); })
.attr("r", function (d){ return rScale(d[rColumn]); });
circles.exit().remove();
}
function type(d){
d.population = +d.population;
d.gdp = +d.gdp;
return d;
}
d3.csv("countries_population_GDP.csv", type, function(data){
render(data);
// The population in the biggest circle.
var people = rScale.domain()[1];
// The number of pixels in the biggest circle, in pixels.
var pixels = Math.PI * rMax * rMax;
console.log((people / pixels) + " people per pixel.");
});
</script>
</body>
</html>
|
pastorenue/screencasts
|
d3ReusableCharts/examples/code/snapshot87/index.html
|
HTML
|
mit
| 1,862 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"a. m.",
"p. m."
],
"DAY": [
"domingo",
"lunes",
"martes",
"mi\u00e9rcoles",
"jueves",
"viernes",
"s\u00e1bado"
],
"ERANAMES": [
"antes de Cristo",
"despu\u00e9s de Cristo"
],
"ERAS": [
"a. C.",
"d. C."
],
"FIRSTDAYOFWEEK": 0,
"MONTH": [
"enero",
"febrero",
"marzo",
"abril",
"mayo",
"junio",
"julio",
"agosto",
"septiembre",
"octubre",
"noviembre",
"diciembre"
],
"SHORTDAY": [
"dom.",
"lun.",
"mar.",
"mi\u00e9.",
"jue.",
"vie.",
"s\u00e1b."
],
"SHORTMONTH": [
"ene.",
"feb.",
"mar.",
"abr.",
"may.",
"jun.",
"jul.",
"ago.",
"sept.",
"oct.",
"nov.",
"dic."
],
"STANDALONEMONTH": [
"enero",
"febrero",
"marzo",
"abril",
"mayo",
"junio",
"julio",
"agosto",
"septiembre",
"octubre",
"noviembre",
"diciembre"
],
"WEEKENDRANGE": [
5,
6
],
"fullDate": "EEEE, d 'de' MMMM 'de' y",
"longDate": "d 'de' MMMM 'de' y",
"medium": "d MMM y H:mm:ss",
"mediumDate": "d MMM y",
"mediumTime": "H:mm:ss",
"short": "d/M/yy H:mm",
"shortDate": "d/M/yy",
"shortTime": "H:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "FCFA",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 0,
"minFrac": 0,
"minInt": 1,
"negPre": "-\u00a4",
"negSuf": "",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "es-gq",
"localeID": "es_GQ",
"pluralCat": function(n, opt_precision) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
|
joeyparrish/cdnjs
|
ajax/libs/angular.js/1.6.5/i18n/angular-locale_es-gq.js
|
JavaScript
|
mit
| 2,395 |
/*
TimelineJS - ver. 2.34.1 - 2014-10-29
Copyright (c) 2012-2013 Northwestern University
a project of the Northwestern University Knight Lab, originally created by Zach Wise
https://github.com/NUKnightLab/TimelineJS
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
.vco-storyjs{font-family:'Gudea',sans-serif}.vco-storyjs .twitter,.vco-storyjs .vcard,.vco-storyjs .messege,.vco-storyjs .credit,.vco-storyjs .caption,.vco-storyjs .zoom-in,.vco-storyjs .zoom-out,.vco-storyjs .back-home,.vco-storyjs .time-interval div,.vco-storyjs .time-interval-major div,.vco-storyjs .nav-container{font-family:'Gudea',sans-serif !important}.vco-storyjs .vco-feature h1.date,.vco-storyjs .vco-feature h2.date,.vco-storyjs .vco-feature h3.date,.vco-storyjs .vco-feature h4.date,.vco-storyjs .vco-feature h5.date,.vco-storyjs .vco-feature h6.date{font-family:'Gudea',sans-serif !important}.vco-storyjs .timenav h1,.vco-storyjs .flag-content h1,.vco-storyjs .era h1,.vco-storyjs .timenav h2,.vco-storyjs .flag-content h2,.vco-storyjs .era h2,.vco-storyjs .timenav h3,.vco-storyjs .flag-content h3,.vco-storyjs .era h3,.vco-storyjs .timenav h4,.vco-storyjs .flag-content h4,.vco-storyjs .era h4,.vco-storyjs .timenav h5,.vco-storyjs .flag-content h5,.vco-storyjs .era h5,.vco-storyjs .timenav h6,.vco-storyjs .flag-content h6,.vco-storyjs .era h6{font-family:'Gudea',sans-serif !important}.vco-storyjs p,.vco-storyjs blockquote,.vco-storyjs blockquote p,.vco-storyjs .twitter blockquote p{font-family:'Gudea',sans-serif !important}.vco-storyjs .vco-feature h1,.vco-storyjs .vco-feature h2,.vco-storyjs .vco-feature h3,.vco-storyjs .vco-feature h4,.vco-storyjs .vco-feature h5,.vco-storyjs .vco-feature h6{font-family:'Rancho',cursive}.timeline-tooltip{font-family:'Gudea',sans-serif}
|
owcc/cdnjs
|
ajax/libs/timelinejs/2.34.1/css/themes/font/Rancho-Gudea.css
|
CSS
|
mit
| 1,934 |
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Security Helper — CodeIgniter 3.0.1 documentation</title>
<link rel="shortcut icon" href="../_static/ci-icon.ico"/>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" />
<link rel="top" title="CodeIgniter 3.0.1 documentation" href="../index.html"/>
<link rel="up" title="Helpers" href="index.html"/>
<link rel="next" title="Smiley Helper" href="smiley_helper.html"/>
<link rel="prev" title="Path Helper" href="path_helper.html"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="../index.html" class="fa fa-home"> CodeIgniter</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">Welcome to CodeIgniter</a><ul class="simple">
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/index.html">General Topics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP Style Guide</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li>
</ul>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="">Security Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="xml_helper.html">XML Helper</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li>
</ul>
</li>
</ul>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">CodeIgniter</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html">Docs</a> »</li>
<li><a href="index.html">Helpers</a> »</li>
<li>Security Helper</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document">
<div class="section" id="security-helper">
<h1>Security Helper<a class="headerlink" href="#security-helper" title="Permalink to this headline">¶</a></h1>
<p>The Security Helper file contains security related functions.</p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li>
<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li>
</ul>
</div>
<div class="custom-index container"></div><div class="section" id="loading-this-helper">
<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2>
<p>This helper is loaded using the following code:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">helper</span><span class="p">(</span><span class="s1">'security'</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="available-functions">
<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2>
<p>The following functions are available:</p>
<dl class="function">
<dt id="xss_clean">
<tt class="descname">xss_clean</tt><big>(</big><em>$str</em><span class="optional">[</span>, <em>$is_image = FALSE</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#xss_clean" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>$str</strong> (<em>string</em>) – Input data</li>
<li><strong>$is_image</strong> (<em>bool</em>) – Whether we’re dealing with an image</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">XSS-clean string</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>Provides Cross Site Script Hack filtering.</p>
<p>This function is an alias for <tt class="docutils literal"><span class="pre">CI_Input::xss_clean()</span></tt>. For more info,
please see the <a class="reference internal" href="../libraries/input.html"><em>Input Library</em></a> documentation.</p>
</dd></dl>
<dl class="function">
<dt id="sanitize_filename">
<tt class="descname">sanitize_filename</tt><big>(</big><em>$filename</em><big>)</big><a class="headerlink" href="#sanitize_filename" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>$filename</strong> (<em>string</em>) – Filename</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Sanitized file name</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>Provides protection against directory traversal.</p>
<p>This function is an alias for <tt class="docutils literal"><span class="pre">CI_Security::sanitize_filename()</span></tt>.
For more info, please see the <a class="reference internal" href="../libraries/security.html"><em>Security Library</em></a>
documentation.</p>
</dd></dl>
<dl class="function">
<dt id="do_hash">
<tt class="descname">do_hash</tt><big>(</big><em>$str</em><span class="optional">[</span>, <em>$type = 'sha1'</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#do_hash" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>$str</strong> (<em>string</em>) – Input</li>
<li><strong>$type</strong> (<em>string</em>) – Algorithm</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Hex-formatted hash</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>Permits you to create one way hashes suitable for encrypting
passwords. Will use SHA1 by default.</p>
<p>See <a class="reference external" href="http://php.net/function.hash_algos">hash_algos()</a>
for a full list of supported algorithms.</p>
<p>Examples:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$str</span> <span class="o">=</span> <span class="nx">do_hash</span><span class="p">(</span><span class="nv">$str</span><span class="p">);</span> <span class="c1">// SHA1</span>
<span class="nv">$str</span> <span class="o">=</span> <span class="nx">do_hash</span><span class="p">(</span><span class="nv">$str</span><span class="p">,</span> <span class="s1">'md5'</span><span class="p">);</span> <span class="c1">// MD5</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This function was formerly named <tt class="docutils literal"><span class="pre">dohash()</span></tt>, which has been
removed in favor of <tt class="docutils literal"><span class="pre">do_hash()</span></tt>.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This function is DEPRECATED. Use the native <tt class="docutils literal"><span class="pre">hash()</span></tt> instead.</p>
</div>
</dd></dl>
<dl class="function">
<dt id="strip_image_tags">
<tt class="descname">strip_image_tags</tt><big>(</big><em>$str</em><big>)</big><a class="headerlink" href="#strip_image_tags" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>$str</strong> (<em>string</em>) – Input string</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The input string with no image tags</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>This is a security function that will strip image tags from a string.
It leaves the image URL as plain text.</p>
<p>Example:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$string</span> <span class="o">=</span> <span class="nx">strip_image_tags</span><span class="p">(</span><span class="nv">$string</span><span class="p">);</span>
</pre></div>
</div>
<p>This function is an alias for <tt class="docutils literal"><span class="pre">CI_Security::strip_image_tags()</span></tt>. For
more info, please see the <a class="reference internal" href="../libraries/security.html"><em>Security Library</em></a>
documentation.</p>
</dd></dl>
<dl class="function">
<dt id="encode_php_tags">
<tt class="descname">encode_php_tags</tt><big>(</big><em>$str</em><big>)</big><a class="headerlink" href="#encode_php_tags" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>$str</strong> (<em>string</em>) – Input string</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Safely formatted string</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>This is a security function that converts PHP tags to entities.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><a class="reference internal" href="#xss_clean" title="xss_clean"><tt class="xref php php-func docutils literal"><span class="pre">xss_clean()</span></tt></a> does this automatically, if you use it.</p>
</div>
<p>Example:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$string</span> <span class="o">=</span> <span class="nx">encode_php_tags</span><span class="p">(</span><span class="nv">$string</span><span class="p">);</span>
</pre></div>
</div>
</dd></dl>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="smiley_helper.html" class="btn btn-neutral float-right" title="Smiley Helper">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="path_helper.html" class="btn btn-neutral" title="Path Helper"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2014 - 2015, British Columbia Institute of Technology.
Last updated on Aug 07, 2015.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../',
VERSION:'3.0.1',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
|
EduAraujoDev/CodeIgniter-Autentication-Sample
|
user_guide/helpers/security_helper.html
|
HTML
|
mit
| 26,964 |
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Queries — CodeIgniter 3.0.1 documentation</title>
<link rel="shortcut icon" href="../_static/ci-icon.ico"/>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" />
<link rel="top" title="CodeIgniter 3.0.1 documentation" href="../index.html"/>
<link rel="up" title="Database Reference" href="index.html"/>
<link rel="next" title="Generating Query Results" href="results.html"/>
<link rel="prev" title="Connecting to your Database" href="connecting.html"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="../index.html" class="fa fa-home"> CodeIgniter</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">Welcome to CodeIgniter</a><ul class="simple">
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/index.html">General Topics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP Style Guide</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li>
</ul>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Database Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="examples.html">Quick Start: Usage Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html">Database Configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="connecting.html">Connecting to a Database</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="">Running Queries</a></li>
<li class="toctree-l2"><a class="reference internal" href="results.html">Generating Query Results</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers.html">Query Helper Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="query_builder.html">Query Builder Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="transactions.html">Transactions</a></li>
<li class="toctree-l2"><a class="reference internal" href="metadata.html">Getting MetaData</a></li>
<li class="toctree-l2"><a class="reference internal" href="call_function.html">Custom Function Calls</a></li>
<li class="toctree-l2"><a class="reference internal" href="caching.html">Query Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="forge.html">Database Manipulation with Database Forge</a></li>
<li class="toctree-l2"><a class="reference internal" href="utilities.html">Database Utilities Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="db_driver_reference.html">Database Driver Reference</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li>
</ul>
</li>
</ul>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">CodeIgniter</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html">Docs</a> »</li>
<li><a href="index.html">Database Reference</a> »</li>
<li>Queries</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document">
<div class="section" id="queries">
<h1>Queries<a class="headerlink" href="#queries" title="Permalink to this headline">¶</a></h1>
<div class="section" id="query-basics">
<h2>Query Basics<a class="headerlink" href="#query-basics" title="Permalink to this headline">¶</a></h2>
<div class="section" id="regular-queries">
<h3>Regular Queries<a class="headerlink" href="#regular-queries" title="Permalink to this headline">¶</a></h3>
<p>To submit a query, use the <strong>query</strong> function:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">query</span><span class="p">(</span><span class="s1">'YOUR QUERY HERE'</span><span class="p">);</span>
</pre></div>
</div>
<p>The query() function returns a database result <strong>object</strong> when “read”
type queries are run, which you can use to <a class="reference internal" href="results.html"><em>show your
results</em></a>. When “write” type queries are run it simply
returns TRUE or FALSE depending on success or failure. When retrieving
data you will typically assign the query to your own variable, like
this:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$query</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">query</span><span class="p">(</span><span class="s1">'YOUR QUERY HERE'</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="simplified-queries">
<h3>Simplified Queries<a class="headerlink" href="#simplified-queries" title="Permalink to this headline">¶</a></h3>
<p>The <strong>simple_query</strong> method is a simplified version of the
$this->db->query() method. It DOES
NOT return a database result set, nor does it set the query timer, or
compile bind data, or store your query for debugging. It simply lets you
submit a query. Most users will rarely use this function.</p>
<p>It returns whatever the database drivers’ “execute” function returns.
That typically is TRUE/FALSE on success or failure for write type queries
such as INSERT, DELETE or UPDATE statements (which is what it really
should be used for) and a resource/object on success for queries with
fetchable results.</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="k">if</span> <span class="p">(</span><span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">simple_query</span><span class="p">(</span><span class="s1">'YOUR QUERY'</span><span class="p">))</span>
<span class="p">{</span>
<span class="k">echo</span> <span class="s2">"Success!"</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">else</span>
<span class="p">{</span>
<span class="k">echo</span> <span class="s2">"Query failed!"</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">PostgreSQL’s <tt class="docutils literal"><span class="pre">pg_exec()</span></tt> function (for example) always
returns a resource on success, even for write type queries.
So take that in mind if you’re looking for a boolean value.</p>
</div>
</div>
</div>
<div class="section" id="working-with-database-prefixes-manually">
<h2>Working with Database prefixes manually<a class="headerlink" href="#working-with-database-prefixes-manually" title="Permalink to this headline">¶</a></h2>
<p>If you have configured a database prefix and would like to prepend it to
a table name for use in a native SQL query for example, then you can use
the following:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">dbprefix</span><span class="p">(</span><span class="s1">'tablename'</span><span class="p">);</span> <span class="c1">// outputs prefix_tablename</span>
</pre></div>
</div>
<p>If for any reason you would like to change the prefix programatically
without needing to create a new connection, you can use this method:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">set_dbprefix</span><span class="p">(</span><span class="s1">'newprefix'</span><span class="p">);</span>
<span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">dbprefix</span><span class="p">(</span><span class="s1">'tablename'</span><span class="p">);</span> <span class="c1">// outputs newprefix_tablename</span>
</pre></div>
</div>
</div>
<div class="section" id="protecting-identifiers">
<h2>Protecting identifiers<a class="headerlink" href="#protecting-identifiers" title="Permalink to this headline">¶</a></h2>
<p>In many databases it is advisable to protect table and field names - for
example with backticks in MySQL. <strong>Query Builder queries are
automatically protected</strong>, however if you need to manually protect an
identifier you can use:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">protect_identifiers</span><span class="p">(</span><span class="s1">'table_name'</span><span class="p">);</span>
</pre></div>
</div>
<div class="admonition important">
<p class="first admonition-title">Important</p>
<p class="last">Although the Query Builder will try its best to properly
quote any field and table names that you feed it, note that it
is NOT designed to work with arbitrary user input. DO NOT feed it
with unsanitized user data.</p>
</div>
<p>This function will also add a table prefix to your table, assuming you
have a prefix specified in your database config file. To enable the
prefixing set TRUE (boolean) via the second parameter:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">protect_identifiers</span><span class="p">(</span><span class="s1">'table_name'</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="escaping-queries">
<h2>Escaping Queries<a class="headerlink" href="#escaping-queries" title="Permalink to this headline">¶</a></h2>
<p>It’s a very good security practice to escape your data before submitting
it into your database. CodeIgniter has three methods that help you do
this:</p>
<ol class="arabic">
<li><p class="first"><strong>$this->db->escape()</strong> This function determines the data type so
that it can escape only string data. It also automatically adds
single quotes around the data so you don’t have to:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$sql</span> <span class="o">=</span> <span class="s2">"INSERT INTO table (title) VALUES("</span><span class="o">.</span><span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">escape</span><span class="p">(</span><span class="nv">$title</span><span class="p">)</span><span class="o">.</span><span class="s2">")"</span><span class="p">;</span>
</pre></div>
</div>
</li>
<li><p class="first"><strong>$this->db->escape_str()</strong> This function escapes the data passed to
it, regardless of type. Most of the time you’ll use the above
function rather than this one. Use the function like this:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$sql</span> <span class="o">=</span> <span class="s2">"INSERT INTO table (title) VALUES('"</span><span class="o">.</span><span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">escape_str</span><span class="p">(</span><span class="nv">$title</span><span class="p">)</span><span class="o">.</span><span class="s2">"')"</span><span class="p">;</span>
</pre></div>
</div>
</li>
<li><p class="first"><strong>$this->db->escape_like_str()</strong> This method should be used when
strings are to be used in LIKE conditions so that LIKE wildcards
(‘%’, ‘_’) in the string are also properly escaped.</p>
</li>
</ol>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$search</span> <span class="o">=</span> <span class="s1">'20% raise'</span><span class="p">;</span>
<span class="nv">$sql</span> <span class="o">=</span> <span class="s2">"SELECT id FROM table WHERE column LIKE '%"</span> <span class="o">.</span>
<span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">escape_like_str</span><span class="p">(</span><span class="nv">$search</span><span class="p">)</span><span class="o">.</span><span class="s2">"%'"</span><span class="p">;</span>
</pre></div>
</div>
</div>
<div class="section" id="query-bindings">
<h2>Query Bindings<a class="headerlink" href="#query-bindings" title="Permalink to this headline">¶</a></h2>
<p>Bindings enable you to simplify your query syntax by letting the system
put the queries together for you. Consider the following example:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$sql</span> <span class="o">=</span> <span class="s2">"SELECT * FROM some_table WHERE id = ? AND status = ? AND author = ?"</span><span class="p">;</span>
<span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">query</span><span class="p">(</span><span class="nv">$sql</span><span class="p">,</span> <span class="k">array</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="s1">'live'</span><span class="p">,</span> <span class="s1">'Rick'</span><span class="p">));</span>
</pre></div>
</div>
<p>The question marks in the query are automatically replaced with the
values in the array in the second parameter of the query function.</p>
<p>Binding also work with arrays, which will be transformed to IN sets:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nv">$sql</span> <span class="o">=</span> <span class="s2">"SELECT * FROM some_table WHERE id IN ? AND status = ? AND author = ?"</span><span class="p">;</span>
<span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">query</span><span class="p">(</span><span class="nv">$sql</span><span class="p">,</span> <span class="k">array</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">6</span><span class="p">),</span> <span class="s1">'live'</span><span class="p">,</span> <span class="s1">'Rick'</span><span class="p">));</span>
</pre></div>
</div>
<p>The resulting query will be:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nx">SELECT</span> <span class="o">*</span> <span class="nx">FROM</span> <span class="nx">some_table</span> <span class="nx">WHERE</span> <span class="nx">id</span> <span class="nx">IN</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span><span class="mi">6</span><span class="p">)</span> <span class="k">AND</span> <span class="nx">status</span> <span class="o">=</span> <span class="s1">'live'</span> <span class="k">AND</span> <span class="nx">author</span> <span class="o">=</span> <span class="s1">'Rick'</span>
</pre></div>
</div>
<p>The secondary benefit of using binds is that the values are
automatically escaped, producing safer queries. You don’t have to
remember to manually escape data; the engine does it automatically for
you.</p>
</div>
<div class="section" id="handling-errors">
<h2>Handling Errors<a class="headerlink" href="#handling-errors" title="Permalink to this headline">¶</a></h2>
<p><strong>$this->db->error();</strong></p>
<p>If you need to get the last error that has occured, the error() method
will return an array containing its code and message. Here’s a quick
example:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="k">if</span> <span class="p">(</span> <span class="o">!</span> <span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">simple_query</span><span class="p">(</span><span class="s1">'SELECT `example_field` FROM `example_table`'</span><span class="p">))</span>
<span class="p">{</span>
<span class="nv">$error</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">error</span><span class="p">();</span> <span class="c1">// Has keys 'code' and 'message'</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="results.html" class="btn btn-neutral float-right" title="Generating Query Results">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="connecting.html" class="btn btn-neutral" title="Connecting to your Database"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2014 - 2015, British Columbia Institute of Technology.
Last updated on Aug 07, 2015.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../',
VERSION:'3.0.1',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
|
andresrojas686/random
|
user_guide/database/queries.html
|
HTML
|
mit
| 31,358 |
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Developer’s Certificate of Origin 1.1 — CodeIgniter 3.0.1 documentation</title>
<link rel="shortcut icon" href="_static/ci-icon.ico"/>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="_static/css/citheme.css" type="text/css" />
<link rel="top" title="CodeIgniter 3.0.1 documentation" href="index.html"/>
<link rel="next" title="Change Log" href="changelog.html"/>
<link rel="prev" title="Developer’s Certificate of Origin 1.1" href=""/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="index.html" class="fa fa-home"> CodeIgniter</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="general/welcome.html">Welcome to CodeIgniter</a><ul class="simple">
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="installation/index.html">Installation Instructions</a><ul>
<li class="toctree-l2"><a class="reference internal" href="installation/downloads.html">Downloading CodeIgniter</a></li>
<li class="toctree-l2"><a class="reference internal" href="installation/index.html">Installation Instructions</a></li>
<li class="toctree-l2"><a class="reference internal" href="installation/upgrading.html">Upgrading From a Previous Version</a></li>
<li class="toctree-l2"><a class="reference internal" href="installation/troubleshooting.html">Troubleshooting</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="overview/index.html">CodeIgniter Overview</a><ul>
<li class="toctree-l2"><a class="reference internal" href="overview/getting_started.html">Getting Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="overview/at_a_glance.html">CodeIgniter at a Glance</a></li>
<li class="toctree-l2"><a class="reference internal" href="overview/features.html">Supported Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="overview/appflow.html">Application Flow Chart</a></li>
<li class="toctree-l2"><a class="reference internal" href="overview/mvc.html">Model-View-Controller</a></li>
<li class="toctree-l2"><a class="reference internal" href="overview/goals.html">Architectural Goals</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="tutorial/index.html">Tutorial</a><ul>
<li class="toctree-l2"><a class="reference internal" href="tutorial/static_pages.html">Static pages</a></li>
<li class="toctree-l2"><a class="reference internal" href="tutorial/news_section.html">News section</a></li>
<li class="toctree-l2"><a class="reference internal" href="tutorial/create_news_items.html">Create news items</a></li>
<li class="toctree-l2"><a class="reference internal" href="tutorial/conclusion.html">Conclusion</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="general/index.html">General Topics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="general/urls.html">CodeIgniter URLs</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/controllers.html">Controllers</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/reserved_names.html">Reserved Names</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/views.html">Views</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/models.html">Models</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/helpers.html">Helpers</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/libraries.html">Using CodeIgniter Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/creating_libraries.html">Creating Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/drivers.html">Using CodeIgniter Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/creating_drivers.html">Creating Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/core_classes.html">Creating Core System Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/ancillary_classes.html">Creating Ancillary Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/hooks.html">Hooks - Extending the Framework Core</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/autoloader.html">Auto-loading Resources</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/common_functions.html">Common Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/compatibility_functions.html">Compatibility Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/routing.html">URI Routing</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/errors.html">Error Handling</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/caching.html">Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/profiling.html">Profiling Your Application</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/cli.html">Running via the CLI</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/managing_apps.html">Managing your Applications</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/environments.html">Handling Multiple Environments</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/alternative_php.html">Alternate PHP Syntax for View Files</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/security.html">Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/styleguide.html">PHP Style Guide</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="libraries/index.html">Libraries</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libraries/benchmark.html">Benchmarking Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/caching.html">Caching Driver</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/calendar.html">Calendaring Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/cart.html">Shopping Cart Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/config.html">Config Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/email.html">Email Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/encrypt.html">Encrypt Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/encryption.html">Encryption Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/file_uploading.html">File Uploading Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/form_validation.html">Form Validation</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/ftp.html">FTP Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/image_lib.html">Image Manipulation Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/input.html">Input Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/javascript.html">Javascript Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/language.html">Language Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/loader.html">Loader Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/migration.html">Migrations Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/output.html">Output Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/pagination.html">Pagination Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/parser.html">Template Parser Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/security.html">Security Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/sessions.html">Session Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/table.html">HTML Table Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/trackback.html">Trackback Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/typography.html">Typography Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/unit_testing.html">Unit Testing Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/uri.html">URI Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/user_agent.html">User Agent Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="libraries/zip.html">Zip Encoding Class</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="database/index.html">Database Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="database/examples.html">Quick Start: Usage Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="database/configuration.html">Database Configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="database/connecting.html">Connecting to a Database</a></li>
<li class="toctree-l2"><a class="reference internal" href="database/queries.html">Running Queries</a></li>
<li class="toctree-l2"><a class="reference internal" href="database/results.html">Generating Query Results</a></li>
<li class="toctree-l2"><a class="reference internal" href="database/helpers.html">Query Helper Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="database/query_builder.html">Query Builder Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="database/transactions.html">Transactions</a></li>
<li class="toctree-l2"><a class="reference internal" href="database/metadata.html">Getting MetaData</a></li>
<li class="toctree-l2"><a class="reference internal" href="database/call_function.html">Custom Function Calls</a></li>
<li class="toctree-l2"><a class="reference internal" href="database/caching.html">Query Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="database/forge.html">Database Manipulation with Database Forge</a></li>
<li class="toctree-l2"><a class="reference internal" href="database/utilities.html">Database Utilities Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="database/db_driver_reference.html">Database Driver Reference</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="helpers/index.html">Helpers</a><ul>
<li class="toctree-l2"><a class="reference internal" href="helpers/array_helper.html">Array Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/captcha_helper.html">CAPTCHA Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/cookie_helper.html">Cookie Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/date_helper.html">Date Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/directory_helper.html">Directory Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/download_helper.html">Download Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/email_helper.html">Email Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/file_helper.html">File Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/form_helper.html">Form Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/html_helper.html">HTML Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/inflector_helper.html">Inflector Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/language_helper.html">Language Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/number_helper.html">Number Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/path_helper.html">Path Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/security_helper.html">Security Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/smiley_helper.html">Smiley Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/string_helper.html">String Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/text_helper.html">Text Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/typography_helper.html">Typography Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/url_helper.html">URL Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers/xml_helper.html">XML Helper</a></li>
</ul>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="contributing/index.html">Contributing to CodeIgniter</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="documentation/index.html">Writing CodeIgniter Documentation</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="">Developer’s Certificate of Origin 1.1</a></li>
</ul>
</li>
</ul>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">CodeIgniter</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li>Developer’s Certificate of Origin 1.1</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document">
<div class="section" id="developer-s-certificate-of-origin-1-1">
<h1>Developer’s Certificate of Origin 1.1<a class="headerlink" href="#developer-s-certificate-of-origin-1-1" title="Permalink to this headline">¶</a></h1>
<p>By making a contribution to this project, I certify that:</p>
<ol class="arabic simple">
<li>The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or</li>
<li>The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or</li>
<li>The contribution was provided directly to me by some other
person who certified (1), (2) or (3) and I have not modified
it.</li>
<li>I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.</li>
</ol>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="changelog.html" class="btn btn-neutral float-right" title="Change Log">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="" class="btn btn-neutral" title="Developer’s Certificate of Origin 1.1"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2014 - 2015, British Columbia Institute of Technology.
Last updated on Aug 07, 2015.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'3.0.1',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
|
nilupull/Advanced_Web_Technology_Coursework_1
|
user_guide/DCO.html
|
HTML
|
mit
| 18,785 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
function getDecimals(n) {
n = n + '';
var i = n.indexOf('.');
return (i == -1) ? 0 : n.length - i - 1;
}
function getVF(n, opt_precision) {
var v = opt_precision;
if (undefined === v) {
v = Math.min(getDecimals(n), 3);
}
var base = Math.pow(10, v);
var f = ((n * base) | 0) % base;
return {v: v, f: f};
}
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"a.m.",
"p.m."
],
"DAY": [
"duminic\u0103",
"luni",
"mar\u021bi",
"miercuri",
"joi",
"vineri",
"s\u00e2mb\u0103t\u0103"
],
"ERANAMES": [
"\u00eenainte de Hristos",
"dup\u0103 Hristos"
],
"ERAS": [
"\u00ee.Hr.",
"d.Hr."
],
"FIRSTDAYOFWEEK": 0,
"MONTH": [
"ianuarie",
"februarie",
"martie",
"aprilie",
"mai",
"iunie",
"iulie",
"august",
"septembrie",
"octombrie",
"noiembrie",
"decembrie"
],
"SHORTDAY": [
"Dum",
"Lun",
"Mar",
"Mie",
"Joi",
"Vin",
"S\u00e2m"
],
"SHORTMONTH": [
"ian.",
"feb.",
"mar.",
"apr.",
"mai",
"iun.",
"iul.",
"aug.",
"sept.",
"oct.",
"nov.",
"dec."
],
"STANDALONEMONTH": [
"ianuarie",
"februarie",
"martie",
"aprilie",
"mai",
"iunie",
"iulie",
"august",
"septembrie",
"octombrie",
"noiembrie",
"decembrie"
],
"WEEKENDRANGE": [
5,
6
],
"fullDate": "EEEE, d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y HH:mm:ss",
"mediumDate": "d MMM y",
"mediumTime": "HH:mm:ss",
"short": "dd.MM.y HH:mm",
"shortDate": "dd.MM.y",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "MDL",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "mo",
"localeID": "mo",
"pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } if (vf.v != 0 || n == 0 || n != 1 && n % 100 >= 1 && n % 100 <= 19) { return PLURAL_CATEGORY.FEW; } return PLURAL_CATEGORY.OTHER;}
});
}]);
|
cdnjs/cdnjs
|
ajax/libs/angular.js/1.6.5/i18n/angular-locale_mo.js
|
JavaScript
|
mit
| 2,907 |
/*
YUI 3.17.2 (build 9c3c78e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/datasource-arrayschema/datasource-arrayschema.js']) {
__coverage__['build/datasource-arrayschema/datasource-arrayschema.js'] = {"path":"build/datasource-arrayschema/datasource-arrayschema.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0},"b":{"1":[0,0],"2":[0,0,0],"3":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":53}}},"2":{"name":"(anonymous_2)","line":15,"loc":{"start":{"line":15,"column":28},"end":{"line":15,"column":39}}},"3":{"name":"(anonymous_3)","line":64,"loc":{"start":{"line":64,"column":17},"end":{"line":64,"column":34}}},"4":{"name":"(anonymous_4)","line":82,"loc":{"start":{"line":82,"column":22},"end":{"line":82,"column":34}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":106,"column":79}},"2":{"start":{"line":15,"column":0},"end":{"line":17,"column":2}},"3":{"start":{"line":16,"column":4},"end":{"line":16,"column":72}},"4":{"start":{"line":19,"column":0},"end":{"line":54,"column":3}},"5":{"start":{"line":56,"column":0},"end":{"line":101,"column":3}},"6":{"start":{"line":65,"column":8},"end":{"line":65,"column":59}},"7":{"start":{"line":83,"column":8},"end":{"line":85,"column":35}},"8":{"start":{"line":88,"column":8},"end":{"line":93,"column":9}},"9":{"start":{"line":89,"column":12},"end":{"line":92,"column":14}},"10":{"start":{"line":95,"column":8},"end":{"line":95,"column":36}},"11":{"start":{"line":97,"column":8},"end":{"line":97,"column":51}},"12":{"start":{"line":99,"column":8},"end":{"line":99,"column":79}},"13":{"start":{"line":103,"column":0},"end":{"line":103,"column":68}}},"branchMap":{"1":{"line":83,"type":"cond-expr","locations":[{"start":{"line":83,"column":128},"end":{"line":83,"column":147}},{"start":{"line":83,"column":150},"end":{"line":83,"column":156}}]},"2":{"line":83,"type":"binary-expr","locations":[{"start":{"line":83,"column":20},"end":{"line":83,"column":35}},{"start":{"line":83,"column":40},"end":{"line":83,"column":83}},{"start":{"line":83,"column":88},"end":{"line":83,"column":124}}]},"3":{"line":88,"type":"if","locations":[{"start":{"line":88,"column":8},"end":{"line":88,"column":8}},{"start":{"line":88,"column":8},"end":{"line":88,"column":8}}]}},"code":["(function () { YUI.add('datasource-arrayschema', function (Y, NAME) {","","/**"," * Extends DataSource with schema-parsing on array data."," *"," * @module datasource"," * @submodule datasource-arrayschema"," */","","/**"," * Adds schema-parsing to the DataSource Utility."," * @class DataSourceArraySchema"," * @extends Plugin.Base"," */","var DataSourceArraySchema = function() {"," DataSourceArraySchema.superclass.constructor.apply(this, arguments);","};","","Y.mix(DataSourceArraySchema, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"schema\""," */"," NS: \"schema\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataSourceArraySchema\""," */"," NAME: \"dataSourceArraySchema\",",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSourceArraySchema Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," ATTRS: {"," schema: {"," //value: {}"," }"," }","});","","Y.extend(DataSourceArraySchema, Y.Plugin.Base, {"," /**"," * Internal init() handler."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this.doBefore(\"_defDataFn\", this._beforeDefDataFn);"," },",""," /**"," * Parses raw data into a normalized response."," *"," * @method _beforeDefDataFn"," * @param tId {Number} Unique transaction ID."," * @param request {Object} The request."," * @param callback {Object} The callback object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * @param data {Object} Raw data."," * @protected"," */"," _beforeDefDataFn: function(e) {"," var data = (Y.DataSource.IO && (this.get(\"host\") instanceof Y.DataSource.IO) && Y.Lang.isString(e.data.responseText)) ? e.data.responseText : e.data,"," response = Y.DataSchema.Array.apply.call(this, this.get(\"schema\"), data),"," payload = e.details[0];",""," // Default"," if (!response) {"," response = {"," meta: {},"," results: data"," };"," }",""," payload.response = response;",""," this.get(\"host\").fire(\"response\", payload);",""," return new Y.Do.Halt(\"DataSourceArraySchema plugin halted _defDataFn\");"," }","});","","Y.namespace('Plugin').DataSourceArraySchema = DataSourceArraySchema;","","","}, '3.17.2', {\"requires\": [\"datasource-local\", \"plugin\", \"dataschema-array\"]});","","}());"]};
}
var __cov_kL84FxfZGYNBp8ZzY3CHzQ = __coverage__['build/datasource-arrayschema/datasource-arrayschema.js'];
__cov_kL84FxfZGYNBp8ZzY3CHzQ.s['1']++;YUI.add('datasource-arrayschema',function(Y,NAME){__cov_kL84FxfZGYNBp8ZzY3CHzQ.f['1']++;__cov_kL84FxfZGYNBp8ZzY3CHzQ.s['2']++;var DataSourceArraySchema=function(){__cov_kL84FxfZGYNBp8ZzY3CHzQ.f['2']++;__cov_kL84FxfZGYNBp8ZzY3CHzQ.s['3']++;DataSourceArraySchema.superclass.constructor.apply(this,arguments);};__cov_kL84FxfZGYNBp8ZzY3CHzQ.s['4']++;Y.mix(DataSourceArraySchema,{NS:'schema',NAME:'dataSourceArraySchema',ATTRS:{schema:{}}});__cov_kL84FxfZGYNBp8ZzY3CHzQ.s['5']++;Y.extend(DataSourceArraySchema,Y.Plugin.Base,{initializer:function(config){__cov_kL84FxfZGYNBp8ZzY3CHzQ.f['3']++;__cov_kL84FxfZGYNBp8ZzY3CHzQ.s['6']++;this.doBefore('_defDataFn',this._beforeDefDataFn);},_beforeDefDataFn:function(e){__cov_kL84FxfZGYNBp8ZzY3CHzQ.f['4']++;__cov_kL84FxfZGYNBp8ZzY3CHzQ.s['7']++;var data=(__cov_kL84FxfZGYNBp8ZzY3CHzQ.b['2'][0]++,Y.DataSource.IO)&&(__cov_kL84FxfZGYNBp8ZzY3CHzQ.b['2'][1]++,this.get('host')instanceof Y.DataSource.IO)&&(__cov_kL84FxfZGYNBp8ZzY3CHzQ.b['2'][2]++,Y.Lang.isString(e.data.responseText))?(__cov_kL84FxfZGYNBp8ZzY3CHzQ.b['1'][0]++,e.data.responseText):(__cov_kL84FxfZGYNBp8ZzY3CHzQ.b['1'][1]++,e.data),response=Y.DataSchema.Array.apply.call(this,this.get('schema'),data),payload=e.details[0];__cov_kL84FxfZGYNBp8ZzY3CHzQ.s['8']++;if(!response){__cov_kL84FxfZGYNBp8ZzY3CHzQ.b['3'][0]++;__cov_kL84FxfZGYNBp8ZzY3CHzQ.s['9']++;response={meta:{},results:data};}else{__cov_kL84FxfZGYNBp8ZzY3CHzQ.b['3'][1]++;}__cov_kL84FxfZGYNBp8ZzY3CHzQ.s['10']++;payload.response=response;__cov_kL84FxfZGYNBp8ZzY3CHzQ.s['11']++;this.get('host').fire('response',payload);__cov_kL84FxfZGYNBp8ZzY3CHzQ.s['12']++;return new Y.Do.Halt('DataSourceArraySchema plugin halted _defDataFn');}});__cov_kL84FxfZGYNBp8ZzY3CHzQ.s['13']++;Y.namespace('Plugin').DataSourceArraySchema=DataSourceArraySchema;},'3.17.2',{'requires':['datasource-local','plugin','dataschema-array']});
|
legomushroom/cdnjs
|
ajax/libs/yui/3.17.2/datasource-arrayschema/datasource-arrayschema-coverage.js
|
JavaScript
|
mit
| 7,605 |
/*
YUI 3.17.2 (build 9c3c78e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('get', function (Y, NAME) {
/**
* NodeJS specific Get module used to load remote resources.
* It contains the same signature as the default Get module so there is no code change needed.
* @module get-nodejs
* @class GetNodeJS
*/
var Module = require('module'),
path = require('path'),
fs = require('fs'),
request = require('request'),
end = function(cb, msg, result) {
if (Y.Lang.isFunction(cb.onEnd)) {
cb.onEnd.call(Y, msg, result);
}
}, pass = function(cb) {
if (Y.Lang.isFunction(cb.onSuccess)) {
cb.onSuccess.call(Y, cb);
}
end(cb, 'success', 'success');
}, fail = function(cb, er) {
er.errors = [er];
if (Y.Lang.isFunction(cb.onFailure)) {
cb.onFailure.call(Y, er, cb);
}
end(cb, er, 'fail');
};
Y.Get = function() {
};
//Setup the default config base path
Y.config.base = path.join(__dirname, '../');
YUI.require = require;
YUI.process = process;
/**
* Takes the raw JS files and wraps them to be executed in the YUI context so they can be loaded
* into the YUI object
* @method _exec
* @private
* @param {String} data The JS to execute
* @param {String} url The path to the file that was parsed
* @param {Function} cb The callback to execute when this is completed
* @param {Error} cb.err=null Error object
* @param {String} cb.url The URL that was just parsed
*/
Y.Get._exec = function(data, url, cb) {
if (data.charCodeAt(0) === 0xFEFF) {
data = data.slice(1);
}
var mod = new Module(url, module);
mod.filename = url;
mod.paths = Module._nodeModulePaths(path.dirname(url));
if (typeof YUI._getLoadHook === 'function') {
data = YUI._getLoadHook(data, url);
}
mod._compile('module.exports = function (YUI) {' +
'return (function () {'+ data + '\n;return YUI;}).apply(global);' +
'};', url);
/*global YUI:true */
YUI = mod.exports(YUI);
mod.loaded = true;
cb(null, url);
};
/**
* Fetches the content from a remote URL or a file from disc and passes the content
* off to `_exec` for parsing
* @method _include
* @private
* @param {String} url The URL/File path to fetch the content from
* @param {Function} cb The callback to fire once the content has been executed via `_exec`
*/
Y.Get._include = function (url, cb) {
var cfg,
mod,
self = this;
if (url.match(/^https?:\/\//)) {
cfg = {
url: url,
timeout: self.timeout
};
request(cfg, function (err, response, body) {
if (err) {
cb(err, url);
} else {
Y.Get._exec(body, url, cb);
}
});
} else {
try {
// Try to resolve paths relative to the module that required yui.
url = Module._findPath(url, Module._resolveLookupPaths(url, module.parent.parent)[1]);
if (Y.config.useSync) {
//Needs to be in useSync
mod = fs.readFileSync(url,'utf8');
} else {
fs.readFile(url, 'utf8', function (err, mod) {
if (err) {
cb(err, url);
} else {
Y.Get._exec(mod, url, cb);
}
});
return;
}
} catch (err) {
cb(err, url);
return;
}
Y.Get._exec(mod, url, cb);
}
};
/**
* Override for Get.script for loading local or remote YUI modules.
* @method js
* @param {Array|String} s The URL's to load into this context
* @param {Object} options Transaction options
*/
Y.Get.js = function(s, options) {
var urls = Y.Array(s), url, i, l = urls.length, c= 0,
check = function() {
if (c === l) {
pass(options);
}
};
/*jshint loopfunc: true */
for (i=0; i<l; i++) {
url = urls[i];
if (Y.Lang.isObject(url)) {
url = url.url;
}
url = url.replace(/'/g, '%27');
Y.Get._include(url, function(err, url) {
if (!Y.config) {
Y.config = {
debug: true
};
}
if (options.onProgress) {
options.onProgress.call(options.context || Y, url);
}
if (err) {
fail(options, err);
} else {
c++;
check();
}
});
}
//Keeping Signature in the browser.
return {
execute: function() {}
};
};
/**
* Alias for `Y.Get.js`
* @method script
*/
Y.Get.script = Y.Get.js;
//Place holder for SS Dom access
Y.Get.css = function(s, cb) {
pass(cb);
};
}, '@VERSION@');
|
featurist/cdnjs
|
ajax/libs/yui/3.17.2/get-nodejs/get-nodejs.js
|
JavaScript
|
mit
| 5,597 |
/*
YUI 3.17.2 (build 9c3c78e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/axis-numeric-base/axis-numeric-base.js']) {
__coverage__['build/axis-numeric-base/axis-numeric-base.js'] = {"path":"build/axis-numeric-base/axis-numeric-base.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"136":0,"137":0,"138":0,"139":0,"140":0,"141":0,"142":0,"143":0,"144":0,"145":0,"146":0,"147":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0,"154":0,"155":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"163":0,"164":0,"165":0,"166":0,"167":0,"168":0,"169":0,"170":0,"171":0,"172":0,"173":0,"174":0,"175":0,"176":0,"177":0,"178":0,"179":0,"180":0,"181":0,"182":0,"183":0,"184":0,"185":0,"186":0,"187":0,"188":0,"189":0,"190":0,"191":0,"192":0,"193":0,"194":0,"195":0,"196":0,"197":0,"198":0,"199":0,"200":0,"201":0,"202":0,"203":0,"204":0,"205":0,"206":0,"207":0,"208":0,"209":0,"210":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0],"30":[0,0],"31":[0,0],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[0,0],"37":[0,0],"38":[0,0],"39":[0,0],"40":[0,0],"41":[0,0],"42":[0,0,0],"43":[0,0],"44":[0,0],"45":[0,0],"46":[0,0],"47":[0,0,0],"48":[0,0],"49":[0,0],"50":[0,0],"51":[0,0],"52":[0,0],"53":[0,0],"54":[0,0],"55":[0,0],"56":[0,0,0],"57":[0,0],"58":[0,0],"59":[0,0],"60":[0,0],"61":[0,0],"62":[0,0],"63":[0,0],"64":[0,0],"65":[0,0],"66":[0,0],"67":[0,0],"68":[0,0],"69":[0,0],"70":[0,0],"71":[0,0],"72":[0,0],"73":[0,0],"74":[0,0],"75":[0,0],"76":[0,0],"77":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":48}}},"2":{"name":"NumericImpl","line":22,"loc":{"start":{"line":22,"column":0},"end":{"line":23,"column":0}}},"3":{"name":"(anonymous_3)","line":106,"loc":{"start":{"line":106,"column":17},"end":{"line":106,"column":28}}},"4":{"name":"(anonymous_4)","line":120,"loc":{"start":{"line":120,"column":17},"end":{"line":121,"column":4}}},"5":{"name":"(anonymous_5)","line":136,"loc":{"start":{"line":136,"column":19},"end":{"line":137,"column":4}}},"6":{"name":"(anonymous_6)","line":160,"loc":{"start":{"line":160,"column":15},"end":{"line":160,"column":26}}},"7":{"name":"(anonymous_7)","line":188,"loc":{"start":{"line":188,"column":20},"end":{"line":189,"column":4}}},"8":{"name":"(anonymous_8)","line":201,"loc":{"start":{"line":201,"column":20},"end":{"line":202,"column":4}}},"9":{"name":"(anonymous_9)","line":231,"loc":{"start":{"line":231,"column":22},"end":{"line":232,"column":4}}},"10":{"name":"(anonymous_10)","line":305,"loc":{"start":{"line":305,"column":21},"end":{"line":306,"column":4}}},"11":{"name":"(anonymous_11)","line":608,"loc":{"start":{"line":608,"column":21},"end":{"line":609,"column":4}}},"12":{"name":"(anonymous_12)","line":625,"loc":{"start":{"line":625,"column":23},"end":{"line":626,"column":4}}},"13":{"name":"(anonymous_13)","line":641,"loc":{"start":{"line":641,"column":25},"end":{"line":642,"column":4}}},"14":{"name":"(anonymous_14)","line":661,"loc":{"start":{"line":661,"column":24},"end":{"line":662,"column":4}}},"15":{"name":"(anonymous_15)","line":698,"loc":{"start":{"line":698,"column":23},"end":{"line":699,"column":4}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":721,"column":42}},"2":{"start":{"line":9,"column":0},"end":{"line":9,"column":20}},"3":{"start":{"line":22,"column":0},"end":{"line":24,"column":1}},"4":{"start":{"line":26,"column":0},"end":{"line":26,"column":33}},"5":{"start":{"line":28,"column":0},"end":{"line":99,"column":2}},"6":{"start":{"line":101,"column":0},"end":{"line":704,"column":2}},"7":{"start":{"line":107,"column":8},"end":{"line":107,"column":67}},"8":{"start":{"line":108,"column":8},"end":{"line":108,"column":67}},"9":{"start":{"line":109,"column":8},"end":{"line":109,"column":62}},"10":{"start":{"line":122,"column":8},"end":{"line":125,"column":9}},"11":{"start":{"line":124,"column":12},"end":{"line":124,"column":57}},"12":{"start":{"line":126,"column":8},"end":{"line":126,"column":19}},"13":{"start":{"line":138,"column":8},"end":{"line":142,"column":45}},"14":{"start":{"line":143,"column":8},"end":{"line":150,"column":9}},"15":{"start":{"line":145,"column":11},"end":{"line":145,"column":39}},"16":{"start":{"line":146,"column":11},"end":{"line":149,"column":12}},"17":{"start":{"line":148,"column":16},"end":{"line":148,"column":29}},"18":{"start":{"line":151,"column":8},"end":{"line":151,"column":21}},"19":{"start":{"line":161,"column":8},"end":{"line":163,"column":38}},"20":{"start":{"line":164,"column":8},"end":{"line":164,"column":39}},"21":{"start":{"line":165,"column":8},"end":{"line":165,"column":39}},"22":{"start":{"line":166,"column":8},"end":{"line":166,"column":22}},"23":{"start":{"line":190,"column":8},"end":{"line":190,"column":65}},"24":{"start":{"line":203,"column":8},"end":{"line":206,"column":24}},"25":{"start":{"line":208,"column":8},"end":{"line":216,"column":9}},"26":{"start":{"line":210,"column":12},"end":{"line":210,"column":104}},"27":{"start":{"line":211,"column":12},"end":{"line":211,"column":84}},"28":{"start":{"line":215,"column":12},"end":{"line":215,"column":45}},"29":{"start":{"line":217,"column":8},"end":{"line":220,"column":9}},"30":{"start":{"line":219,"column":12},"end":{"line":219,"column":33}},"31":{"start":{"line":221,"column":8},"end":{"line":221,"column":28}},"32":{"start":{"line":233,"column":8},"end":{"line":240,"column":40}},"33":{"start":{"line":241,"column":8},"end":{"line":294,"column":9}},"34":{"start":{"line":243,"column":12},"end":{"line":284,"column":13}},"35":{"start":{"line":245,"column":16},"end":{"line":245,"column":34}},"36":{"start":{"line":246,"column":16},"end":{"line":283,"column":17}},"37":{"start":{"line":248,"column":20},"end":{"line":248,"column":34}},"38":{"start":{"line":249,"column":20},"end":{"line":254,"column":21}},"39":{"start":{"line":251,"column":24},"end":{"line":251,"column":62}},"40":{"start":{"line":252,"column":24},"end":{"line":252,"column":62}},"41":{"start":{"line":253,"column":24},"end":{"line":253,"column":33}},"42":{"start":{"line":256,"column":20},"end":{"line":267,"column":21}},"43":{"start":{"line":258,"column":24},"end":{"line":258,"column":47}},"44":{"start":{"line":260,"column":25},"end":{"line":267,"column":21}},"45":{"start":{"line":262,"column":24},"end":{"line":262,"column":34}},"46":{"start":{"line":266,"column":24},"end":{"line":266,"column":49}},"47":{"start":{"line":268,"column":20},"end":{"line":279,"column":21}},"48":{"start":{"line":270,"column":24},"end":{"line":270,"column":47}},"49":{"start":{"line":272,"column":25},"end":{"line":279,"column":21}},"50":{"start":{"line":274,"column":24},"end":{"line":274,"column":34}},"51":{"start":{"line":278,"column":24},"end":{"line":278,"column":49}},"52":{"start":{"line":281,"column":20},"end":{"line":281,"column":46}},"53":{"start":{"line":282,"column":20},"end":{"line":282,"column":46}},"54":{"start":{"line":285,"column":12},"end":{"line":293,"column":13}},"55":{"start":{"line":287,"column":16},"end":{"line":287,"column":63}},"56":{"start":{"line":291,"column":16},"end":{"line":291,"column":40}},"57":{"start":{"line":292,"column":16},"end":{"line":292,"column":40}},"58":{"start":{"line":307,"column":8},"end":{"line":321,"column":49}},"59":{"start":{"line":322,"column":8},"end":{"line":593,"column":9}},"60":{"start":{"line":324,"column":12},"end":{"line":592,"column":13}},"61":{"start":{"line":326,"column":16},"end":{"line":326,"column":69}},"62":{"start":{"line":327,"column":16},"end":{"line":460,"column":17}},"63":{"start":{"line":329,"column":20},"end":{"line":337,"column":21}},"64":{"start":{"line":331,"column":24},"end":{"line":331,"column":32}},"65":{"start":{"line":332,"column":24},"end":{"line":332,"column":77}},"66":{"start":{"line":336,"column":23},"end":{"line":336,"column":73}},"67":{"start":{"line":338,"column":20},"end":{"line":352,"column":21}},"68":{"start":{"line":340,"column":24},"end":{"line":343,"column":25}},"69":{"start":{"line":342,"column":28},"end":{"line":342,"column":63}},"70":{"start":{"line":345,"column":25},"end":{"line":352,"column":21}},"71":{"start":{"line":347,"column":24},"end":{"line":347,"column":59}},"72":{"start":{"line":351,"column":24},"end":{"line":351,"column":72}},"73":{"start":{"line":354,"column":21},"end":{"line":460,"column":17}},"74":{"start":{"line":356,"column":20},"end":{"line":427,"column":21}},"75":{"start":{"line":358,"column":24},"end":{"line":358,"column":74}},"76":{"start":{"line":359,"column":24},"end":{"line":359,"column":78}},"77":{"start":{"line":360,"column":24},"end":{"line":360,"column":52}},"78":{"start":{"line":361,"column":24},"end":{"line":361,"column":60}},"79":{"start":{"line":362,"column":24},"end":{"line":362,"column":66}},"80":{"start":{"line":364,"column":24},"end":{"line":410,"column":25}},"81":{"start":{"line":366,"column":28},"end":{"line":372,"column":29}},"82":{"start":{"line":368,"column":32},"end":{"line":368,"column":43}},"83":{"start":{"line":369,"column":32},"end":{"line":369,"column":43}},"84":{"start":{"line":370,"column":32},"end":{"line":370,"column":68}},"85":{"start":{"line":371,"column":32},"end":{"line":371,"column":74}},"86":{"start":{"line":375,"column":28},"end":{"line":382,"column":29}},"87":{"start":{"line":377,"column":32},"end":{"line":377,"column":57}},"88":{"start":{"line":381,"column":32},"end":{"line":381,"column":67}},"89":{"start":{"line":384,"column":29},"end":{"line":410,"column":25}},"90":{"start":{"line":386,"column":28},"end":{"line":392,"column":29}},"91":{"start":{"line":388,"column":32},"end":{"line":388,"column":43}},"92":{"start":{"line":389,"column":32},"end":{"line":389,"column":43}},"93":{"start":{"line":390,"column":32},"end":{"line":390,"column":74}},"94":{"start":{"line":391,"column":32},"end":{"line":391,"column":68}},"95":{"start":{"line":395,"column":28},"end":{"line":402,"column":29}},"96":{"start":{"line":397,"column":32},"end":{"line":397,"column":62}},"97":{"start":{"line":401,"column":32},"end":{"line":401,"column":67}},"98":{"start":{"line":406,"column":28},"end":{"line":406,"column":70}},"99":{"start":{"line":407,"column":28},"end":{"line":407,"column":77}},"100":{"start":{"line":408,"column":28},"end":{"line":408,"column":58}},"101":{"start":{"line":409,"column":28},"end":{"line":409,"column":63}},"102":{"start":{"line":414,"column":24},"end":{"line":426,"column":25}},"103":{"start":{"line":416,"column":28},"end":{"line":416,"column":63}},"104":{"start":{"line":418,"column":29},"end":{"line":426,"column":25}},"105":{"start":{"line":420,"column":28},"end":{"line":420,"column":63}},"106":{"start":{"line":424,"column":28},"end":{"line":424,"column":78}},"107":{"start":{"line":425,"column":28},"end":{"line":425,"column":76}},"108":{"start":{"line":431,"column":20},"end":{"line":459,"column":21}},"109":{"start":{"line":433,"column":24},"end":{"line":440,"column":25}},"110":{"start":{"line":435,"column":28},"end":{"line":435,"column":36}},"111":{"start":{"line":439,"column":28},"end":{"line":439,"column":63}},"112":{"start":{"line":442,"column":25},"end":{"line":459,"column":21}},"113":{"start":{"line":444,"column":24},"end":{"line":454,"column":25}},"114":{"start":{"line":446,"column":28},"end":{"line":446,"column":36}},"115":{"start":{"line":447,"column":28},"end":{"line":447,"column":81}},"116":{"start":{"line":448,"column":28},"end":{"line":448,"column":63}},"117":{"start":{"line":452,"column":28},"end":{"line":452,"column":78}},"118":{"start":{"line":453,"column":28},"end":{"line":453,"column":76}},"119":{"start":{"line":458,"column":24},"end":{"line":458,"column":59}},"120":{"start":{"line":462,"column":17},"end":{"line":592,"column":13}},"121":{"start":{"line":464,"column":16},"end":{"line":546,"column":17}},"122":{"start":{"line":466,"column":20},"end":{"line":469,"column":21}},"123":{"start":{"line":468,"column":24},"end":{"line":468,"column":32}},"124":{"start":{"line":471,"column":20},"end":{"line":471,"column":53}},"125":{"start":{"line":472,"column":20},"end":{"line":481,"column":21}},"126":{"start":{"line":474,"column":24},"end":{"line":474,"column":63}},"127":{"start":{"line":475,"column":24},"end":{"line":475,"column":59}},"128":{"start":{"line":479,"column":24},"end":{"line":479,"column":84}},"129":{"start":{"line":483,"column":21},"end":{"line":546,"column":17}},"130":{"start":{"line":485,"column":20},"end":{"line":517,"column":21}},"131":{"start":{"line":487,"column":24},"end":{"line":487,"column":80}},"132":{"start":{"line":488,"column":24},"end":{"line":488,"column":78}},"133":{"start":{"line":489,"column":24},"end":{"line":489,"column":52}},"134":{"start":{"line":491,"column":24},"end":{"line":506,"column":25}},"135":{"start":{"line":493,"column":28},"end":{"line":493,"column":64}},"136":{"start":{"line":494,"column":28},"end":{"line":494,"column":70}},"137":{"start":{"line":495,"column":28},"end":{"line":495,"column":70}},"138":{"start":{"line":496,"column":28},"end":{"line":496,"column":58}},"139":{"start":{"line":497,"column":28},"end":{"line":497,"column":63}},"140":{"start":{"line":501,"column":28},"end":{"line":501,"column":51}},"141":{"start":{"line":502,"column":28},"end":{"line":502,"column":56}},"142":{"start":{"line":503,"column":28},"end":{"line":503,"column":70}},"143":{"start":{"line":504,"column":28},"end":{"line":504,"column":85}},"144":{"start":{"line":505,"column":28},"end":{"line":505,"column":90}},"145":{"start":{"line":510,"column":24},"end":{"line":510,"column":57}},"146":{"start":{"line":511,"column":24},"end":{"line":514,"column":25}},"147":{"start":{"line":513,"column":28},"end":{"line":513,"column":67}},"148":{"start":{"line":515,"column":24},"end":{"line":515,"column":102}},"149":{"start":{"line":516,"column":24},"end":{"line":516,"column":100}},"150":{"start":{"line":521,"column":20},"end":{"line":521,"column":53}},"151":{"start":{"line":522,"column":20},"end":{"line":525,"column":21}},"152":{"start":{"line":524,"column":24},"end":{"line":524,"column":63}},"153":{"start":{"line":526,"column":20},"end":{"line":544,"column":21}},"154":{"start":{"line":528,"column":24},"end":{"line":528,"column":32}},"155":{"start":{"line":529,"column":24},"end":{"line":529,"column":57}},"156":{"start":{"line":530,"column":24},"end":{"line":538,"column":25}},"157":{"start":{"line":532,"column":28},"end":{"line":532,"column":52}},"158":{"start":{"line":533,"column":28},"end":{"line":533,"column":63}},"159":{"start":{"line":537,"column":28},"end":{"line":537,"column":88}},"160":{"start":{"line":542,"column":24},"end":{"line":542,"column":74}},"161":{"start":{"line":543,"column":24},"end":{"line":543,"column":72}},"162":{"start":{"line":548,"column":17},"end":{"line":592,"column":13}},"163":{"start":{"line":550,"column":16},"end":{"line":550,"column":46}},"164":{"start":{"line":551,"column":16},"end":{"line":551,"column":52}},"165":{"start":{"line":552,"column":16},"end":{"line":552,"column":62}},"166":{"start":{"line":553,"column":16},"end":{"line":553,"column":71}},"167":{"start":{"line":554,"column":16},"end":{"line":554,"column":69}},"168":{"start":{"line":555,"column":16},"end":{"line":591,"column":17}},"169":{"start":{"line":557,"column":20},"end":{"line":557,"column":45}},"170":{"start":{"line":559,"column":21},"end":{"line":591,"column":17}},"171":{"start":{"line":561,"column":20},"end":{"line":561,"column":45}},"172":{"start":{"line":563,"column":21},"end":{"line":591,"column":17}},"173":{"start":{"line":565,"column":20},"end":{"line":572,"column":21}},"174":{"start":{"line":567,"column":24},"end":{"line":567,"column":32}},"175":{"start":{"line":571,"column":24},"end":{"line":571,"column":39}},"176":{"start":{"line":573,"column":20},"end":{"line":573,"column":45}},"177":{"start":{"line":575,"column":21},"end":{"line":591,"column":17}},"178":{"start":{"line":577,"column":20},"end":{"line":577,"column":35}},"179":{"start":{"line":578,"column":20},"end":{"line":578,"column":35}},"180":{"start":{"line":582,"column":20},"end":{"line":589,"column":21}},"181":{"start":{"line":584,"column":24},"end":{"line":584,"column":32}},"182":{"start":{"line":588,"column":24},"end":{"line":588,"column":39}},"183":{"start":{"line":590,"column":20},"end":{"line":590,"column":45}},"184":{"start":{"line":594,"column":8},"end":{"line":594,"column":32}},"185":{"start":{"line":595,"column":8},"end":{"line":595,"column":32}},"186":{"start":{"line":610,"column":8},"end":{"line":610,"column":31}},"187":{"start":{"line":611,"column":8},"end":{"line":611,"column":95}},"188":{"start":{"line":612,"column":8},"end":{"line":612,"column":57}},"189":{"start":{"line":627,"column":8},"end":{"line":627,"column":31}},"190":{"start":{"line":628,"column":8},"end":{"line":628,"column":81}},"191":{"start":{"line":643,"column":8},"end":{"line":643,"column":31}},"192":{"start":{"line":644,"column":8},"end":{"line":644,"column":82}},"193":{"start":{"line":663,"column":8},"end":{"line":666,"column":39}},"194":{"start":{"line":667,"column":8},"end":{"line":667,"column":42}},"195":{"start":{"line":668,"column":8},"end":{"line":684,"column":9}},"196":{"start":{"line":670,"column":12},"end":{"line":675,"column":13}},"197":{"start":{"line":672,"column":16},"end":{"line":672,"column":36}},"198":{"start":{"line":673,"column":16},"end":{"line":673,"column":36}},"199":{"start":{"line":674,"column":16},"end":{"line":674,"column":48}},"200":{"start":{"line":676,"column":12},"end":{"line":676,"column":30}},"201":{"start":{"line":677,"column":12},"end":{"line":677,"column":38}},"202":{"start":{"line":678,"column":12},"end":{"line":678,"column":56}},"203":{"start":{"line":679,"column":12},"end":{"line":679,"column":77}},"204":{"start":{"line":683,"column":12},"end":{"line":683,"column":29}},"205":{"start":{"line":685,"column":8},"end":{"line":685,"column":26}},"206":{"start":{"line":700,"column":8},"end":{"line":700,"column":35}},"207":{"start":{"line":701,"column":8},"end":{"line":701,"column":52}},"208":{"start":{"line":702,"column":8},"end":{"line":702,"column":66}},"209":{"start":{"line":706,"column":0},"end":{"line":706,"column":28}},"210":{"start":{"line":718,"column":0},"end":{"line":718,"column":82}}},"branchMap":{"1":{"line":122,"type":"if","locations":[{"start":{"line":122,"column":8},"end":{"line":122,"column":8}},{"start":{"line":122,"column":8},"end":{"line":122,"column":8}}]},"2":{"line":142,"type":"cond-expr","locations":[{"start":{"line":142,"column":27},"end":{"line":142,"column":40}},{"start":{"line":142,"column":43},"end":{"line":142,"column":44}}]},"3":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":11},"end":{"line":146,"column":11}},{"start":{"line":146,"column":11},"end":{"line":146,"column":11}}]},"4":{"line":208,"type":"if","locations":[{"start":{"line":208,"column":8},"end":{"line":208,"column":8}},{"start":{"line":208,"column":8},"end":{"line":208,"column":8}}]},"5":{"line":217,"type":"if","locations":[{"start":{"line":217,"column":8},"end":{"line":217,"column":8}},{"start":{"line":217,"column":8},"end":{"line":217,"column":8}}]},"6":{"line":241,"type":"if","locations":[{"start":{"line":241,"column":8},"end":{"line":241,"column":8}},{"start":{"line":241,"column":8},"end":{"line":241,"column":8}}]},"7":{"line":241,"type":"binary-expr","locations":[{"start":{"line":241,"column":11},"end":{"line":241,"column":18}},{"start":{"line":241,"column":22},"end":{"line":241,"column":29}}]},"8":{"line":243,"type":"if","locations":[{"start":{"line":243,"column":12},"end":{"line":243,"column":12}},{"start":{"line":243,"column":12},"end":{"line":243,"column":12}}]},"9":{"line":243,"type":"binary-expr","locations":[{"start":{"line":243,"column":15},"end":{"line":243,"column":19}},{"start":{"line":243,"column":23},"end":{"line":243,"column":34}},{"start":{"line":243,"column":38},"end":{"line":243,"column":53}}]},"10":{"line":249,"type":"if","locations":[{"start":{"line":249,"column":20},"end":{"line":249,"column":20}},{"start":{"line":249,"column":20},"end":{"line":249,"column":20}}]},"11":{"line":251,"type":"cond-expr","locations":[{"start":{"line":251,"column":39},"end":{"line":251,"column":55}},{"start":{"line":251,"column":58},"end":{"line":251,"column":61}}]},"12":{"line":252,"type":"cond-expr","locations":[{"start":{"line":252,"column":39},"end":{"line":252,"column":55}},{"start":{"line":252,"column":58},"end":{"line":252,"column":61}}]},"13":{"line":256,"type":"if","locations":[{"start":{"line":256,"column":20},"end":{"line":256,"column":20}},{"start":{"line":256,"column":20},"end":{"line":256,"column":20}}]},"14":{"line":260,"type":"if","locations":[{"start":{"line":260,"column":25},"end":{"line":260,"column":25}},{"start":{"line":260,"column":25},"end":{"line":260,"column":25}}]},"15":{"line":268,"type":"if","locations":[{"start":{"line":268,"column":20},"end":{"line":268,"column":20}},{"start":{"line":268,"column":20},"end":{"line":268,"column":20}}]},"16":{"line":272,"type":"if","locations":[{"start":{"line":272,"column":25},"end":{"line":272,"column":25}},{"start":{"line":272,"column":25},"end":{"line":272,"column":25}}]},"17":{"line":285,"type":"if","locations":[{"start":{"line":285,"column":12},"end":{"line":285,"column":12}},{"start":{"line":285,"column":12},"end":{"line":285,"column":12}}]},"18":{"line":322,"type":"if","locations":[{"start":{"line":322,"column":8},"end":{"line":322,"column":8}},{"start":{"line":322,"column":8},"end":{"line":322,"column":8}}]},"19":{"line":324,"type":"if","locations":[{"start":{"line":324,"column":12},"end":{"line":324,"column":12}},{"start":{"line":324,"column":12},"end":{"line":324,"column":12}}]},"20":{"line":327,"type":"if","locations":[{"start":{"line":327,"column":16},"end":{"line":327,"column":16}},{"start":{"line":327,"column":16},"end":{"line":327,"column":16}}]},"21":{"line":327,"type":"binary-expr","locations":[{"start":{"line":327,"column":19},"end":{"line":327,"column":37}},{"start":{"line":327,"column":41},"end":{"line":327,"column":59}}]},"22":{"line":329,"type":"if","locations":[{"start":{"line":329,"column":20},"end":{"line":329,"column":20}},{"start":{"line":329,"column":20},"end":{"line":329,"column":20}}]},"23":{"line":329,"type":"binary-expr","locations":[{"start":{"line":329,"column":24},"end":{"line":329,"column":38}},{"start":{"line":329,"column":42},"end":{"line":329,"column":60}},{"start":{"line":329,"column":65},"end":{"line":329,"column":72}}]},"24":{"line":338,"type":"if","locations":[{"start":{"line":338,"column":20},"end":{"line":338,"column":20}},{"start":{"line":338,"column":20},"end":{"line":338,"column":20}}]},"25":{"line":340,"type":"if","locations":[{"start":{"line":340,"column":24},"end":{"line":340,"column":24}},{"start":{"line":340,"column":24},"end":{"line":340,"column":24}}]},"26":{"line":345,"type":"if","locations":[{"start":{"line":345,"column":25},"end":{"line":345,"column":25}},{"start":{"line":345,"column":25},"end":{"line":345,"column":25}}]},"27":{"line":354,"type":"if","locations":[{"start":{"line":354,"column":21},"end":{"line":354,"column":21}},{"start":{"line":354,"column":21},"end":{"line":354,"column":21}}]},"28":{"line":354,"type":"binary-expr","locations":[{"start":{"line":354,"column":24},"end":{"line":354,"column":42}},{"start":{"line":354,"column":46},"end":{"line":354,"column":65}}]},"29":{"line":356,"type":"if","locations":[{"start":{"line":356,"column":20},"end":{"line":356,"column":20}},{"start":{"line":356,"column":20},"end":{"line":356,"column":20}}]},"30":{"line":364,"type":"if","locations":[{"start":{"line":364,"column":24},"end":{"line":364,"column":24}},{"start":{"line":364,"column":24},"end":{"line":364,"column":24}}]},"31":{"line":366,"type":"binary-expr","locations":[{"start":{"line":366,"column":34},"end":{"line":366,"column":51}},{"start":{"line":366,"column":55},"end":{"line":366,"column":68}}]},"32":{"line":375,"type":"if","locations":[{"start":{"line":375,"column":28},"end":{"line":375,"column":28}},{"start":{"line":375,"column":28},"end":{"line":375,"column":28}}]},"33":{"line":384,"type":"if","locations":[{"start":{"line":384,"column":29},"end":{"line":384,"column":29}},{"start":{"line":384,"column":29},"end":{"line":384,"column":29}}]},"34":{"line":386,"type":"binary-expr","locations":[{"start":{"line":386,"column":34},"end":{"line":386,"column":51}},{"start":{"line":386,"column":55},"end":{"line":386,"column":68}}]},"35":{"line":395,"type":"if","locations":[{"start":{"line":395,"column":28},"end":{"line":395,"column":28}},{"start":{"line":395,"column":28},"end":{"line":395,"column":28}}]},"36":{"line":414,"type":"if","locations":[{"start":{"line":414,"column":24},"end":{"line":414,"column":24}},{"start":{"line":414,"column":24},"end":{"line":414,"column":24}}]},"37":{"line":418,"type":"if","locations":[{"start":{"line":418,"column":29},"end":{"line":418,"column":29}},{"start":{"line":418,"column":29},"end":{"line":418,"column":29}}]},"38":{"line":431,"type":"if","locations":[{"start":{"line":431,"column":20},"end":{"line":431,"column":20}},{"start":{"line":431,"column":20},"end":{"line":431,"column":20}}]},"39":{"line":433,"type":"if","locations":[{"start":{"line":433,"column":24},"end":{"line":433,"column":24}},{"start":{"line":433,"column":24},"end":{"line":433,"column":24}}]},"40":{"line":442,"type":"if","locations":[{"start":{"line":442,"column":25},"end":{"line":442,"column":25}},{"start":{"line":442,"column":25},"end":{"line":442,"column":25}}]},"41":{"line":444,"type":"if","locations":[{"start":{"line":444,"column":24},"end":{"line":444,"column":24}},{"start":{"line":444,"column":24},"end":{"line":444,"column":24}}]},"42":{"line":444,"type":"binary-expr","locations":[{"start":{"line":444,"column":27},"end":{"line":444,"column":41}},{"start":{"line":444,"column":45},"end":{"line":444,"column":54}},{"start":{"line":444,"column":58},"end":{"line":444,"column":80}}]},"43":{"line":462,"type":"if","locations":[{"start":{"line":462,"column":17},"end":{"line":462,"column":17}},{"start":{"line":462,"column":17},"end":{"line":462,"column":17}}]},"44":{"line":464,"type":"if","locations":[{"start":{"line":464,"column":16},"end":{"line":464,"column":16}},{"start":{"line":464,"column":16},"end":{"line":464,"column":16}}]},"45":{"line":464,"type":"binary-expr","locations":[{"start":{"line":464,"column":19},"end":{"line":464,"column":37}},{"start":{"line":464,"column":41},"end":{"line":464,"column":59}}]},"46":{"line":466,"type":"if","locations":[{"start":{"line":466,"column":20},"end":{"line":466,"column":20}},{"start":{"line":466,"column":20},"end":{"line":466,"column":20}}]},"47":{"line":466,"type":"binary-expr","locations":[{"start":{"line":466,"column":24},"end":{"line":466,"column":38}},{"start":{"line":466,"column":42},"end":{"line":466,"column":63}},{"start":{"line":466,"column":68},"end":{"line":466,"column":75}}]},"48":{"line":472,"type":"if","locations":[{"start":{"line":472,"column":20},"end":{"line":472,"column":20}},{"start":{"line":472,"column":20},"end":{"line":472,"column":20}}]},"49":{"line":483,"type":"if","locations":[{"start":{"line":483,"column":21},"end":{"line":483,"column":21}},{"start":{"line":483,"column":21},"end":{"line":483,"column":21}}]},"50":{"line":483,"type":"binary-expr","locations":[{"start":{"line":483,"column":24},"end":{"line":483,"column":42}},{"start":{"line":483,"column":46},"end":{"line":483,"column":65}}]},"51":{"line":485,"type":"if","locations":[{"start":{"line":485,"column":20},"end":{"line":485,"column":20}},{"start":{"line":485,"column":20},"end":{"line":485,"column":20}}]},"52":{"line":491,"type":"if","locations":[{"start":{"line":491,"column":24},"end":{"line":491,"column":24}},{"start":{"line":491,"column":24},"end":{"line":491,"column":24}}]},"53":{"line":511,"type":"if","locations":[{"start":{"line":511,"column":24},"end":{"line":511,"column":24}},{"start":{"line":511,"column":24},"end":{"line":511,"column":24}}]},"54":{"line":522,"type":"if","locations":[{"start":{"line":522,"column":20},"end":{"line":522,"column":20}},{"start":{"line":522,"column":20},"end":{"line":522,"column":20}}]},"55":{"line":526,"type":"if","locations":[{"start":{"line":526,"column":20},"end":{"line":526,"column":20}},{"start":{"line":526,"column":20},"end":{"line":526,"column":20}}]},"56":{"line":526,"type":"binary-expr","locations":[{"start":{"line":526,"column":23},"end":{"line":526,"column":37}},{"start":{"line":526,"column":41},"end":{"line":526,"column":50}},{"start":{"line":526,"column":54},"end":{"line":526,"column":76}}]},"57":{"line":530,"type":"if","locations":[{"start":{"line":530,"column":24},"end":{"line":530,"column":24}},{"start":{"line":530,"column":24},"end":{"line":530,"column":24}}]},"58":{"line":548,"type":"if","locations":[{"start":{"line":548,"column":17},"end":{"line":548,"column":17}},{"start":{"line":548,"column":17},"end":{"line":548,"column":17}}]},"59":{"line":548,"type":"binary-expr","locations":[{"start":{"line":548,"column":20},"end":{"line":548,"column":42}},{"start":{"line":548,"column":46},"end":{"line":548,"column":70}}]},"60":{"line":555,"type":"if","locations":[{"start":{"line":555,"column":16},"end":{"line":555,"column":16}},{"start":{"line":555,"column":16},"end":{"line":555,"column":16}}]},"61":{"line":559,"type":"if","locations":[{"start":{"line":559,"column":21},"end":{"line":559,"column":21}},{"start":{"line":559,"column":21},"end":{"line":559,"column":21}}]},"62":{"line":563,"type":"if","locations":[{"start":{"line":563,"column":21},"end":{"line":563,"column":21}},{"start":{"line":563,"column":21},"end":{"line":563,"column":21}}]},"63":{"line":563,"type":"binary-expr","locations":[{"start":{"line":563,"column":24},"end":{"line":563,"column":42}},{"start":{"line":563,"column":46},"end":{"line":563,"column":64}}]},"64":{"line":565,"type":"if","locations":[{"start":{"line":565,"column":20},"end":{"line":565,"column":20}},{"start":{"line":565,"column":20},"end":{"line":565,"column":20}}]},"65":{"line":565,"type":"binary-expr","locations":[{"start":{"line":565,"column":23},"end":{"line":565,"column":37}},{"start":{"line":565,"column":41},"end":{"line":565,"column":54}}]},"66":{"line":575,"type":"if","locations":[{"start":{"line":575,"column":21},"end":{"line":575,"column":21}},{"start":{"line":575,"column":21},"end":{"line":575,"column":21}}]},"67":{"line":575,"type":"binary-expr","locations":[{"start":{"line":575,"column":24},"end":{"line":575,"column":42}},{"start":{"line":575,"column":46},"end":{"line":575,"column":65}}]},"68":{"line":582,"type":"if","locations":[{"start":{"line":582,"column":20},"end":{"line":582,"column":20}},{"start":{"line":582,"column":20},"end":{"line":582,"column":20}}]},"69":{"line":582,"type":"binary-expr","locations":[{"start":{"line":582,"column":23},"end":{"line":582,"column":37}},{"start":{"line":582,"column":41},"end":{"line":582,"column":54}}]},"70":{"line":610,"type":"binary-expr","locations":[{"start":{"line":610,"column":18},"end":{"line":610,"column":25}},{"start":{"line":610,"column":29},"end":{"line":610,"column":30}}]},"71":{"line":627,"type":"binary-expr","locations":[{"start":{"line":627,"column":18},"end":{"line":627,"column":25}},{"start":{"line":627,"column":29},"end":{"line":627,"column":30}}]},"72":{"line":643,"type":"binary-expr","locations":[{"start":{"line":643,"column":18},"end":{"line":643,"column":25}},{"start":{"line":643,"column":29},"end":{"line":643,"column":30}}]},"73":{"line":668,"type":"if","locations":[{"start":{"line":668,"column":8},"end":{"line":668,"column":8}},{"start":{"line":668,"column":8},"end":{"line":668,"column":8}}]},"74":{"line":670,"type":"if","locations":[{"start":{"line":670,"column":12},"end":{"line":670,"column":12}},{"start":{"line":670,"column":12},"end":{"line":670,"column":12}}]},"75":{"line":670,"type":"binary-expr","locations":[{"start":{"line":670,"column":15},"end":{"line":670,"column":54}},{"start":{"line":670,"column":58},"end":{"line":670,"column":65}}]},"76":{"line":679,"type":"cond-expr","locations":[{"start":{"line":679,"column":35},"end":{"line":679,"column":54}},{"start":{"line":679,"column":57},"end":{"line":679,"column":76}}]},"77":{"line":700,"type":"binary-expr","locations":[{"start":{"line":700,"column":20},"end":{"line":700,"column":29}},{"start":{"line":700,"column":33},"end":{"line":700,"column":34}}]}},"code":["(function () { YUI.add('axis-numeric-base', function (Y, NAME) {","","/**"," * Provides functionality for the handling of numeric axis data for a chart."," *"," * @module charts"," * @submodule axis-numeric-base"," */","var Y_Lang = Y.Lang;","","/**"," * NumericImpl contains logic for numeric data. NumericImpl is used by the following classes:"," * <ul>"," * <li>{{#crossLink \"NumericAxisBase\"}}{{/crossLink}}</li>"," * <li>{{#crossLink \"NumericAxis\"}}{{/crossLink}}</li>"," * </ul>"," *"," * @class NumericImpl"," * @constructor"," * @submodule axis-numeric-base"," */","function NumericImpl()","{","}","","NumericImpl.NAME = \"numericImpl\";","","NumericImpl.ATTRS = {"," /**"," * Indicates whether 0 should always be displayed."," *"," * @attribute alwaysShowZero"," * @type Boolean"," */"," alwaysShowZero: {"," value: true"," },",""," /**"," * Method used for formatting a label. This attribute allows for the default label formatting method to overridden."," * The method use would need to implement the arguments below and return a `String` or an `HTMLElement`. The default"," * implementation of the method returns a `String`. The output of this method will be rendered to the DOM using"," * `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override"," * the Data' `appendLabelFunction` to accept html as a `String`."," * <dl>"," * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>"," * <dt>format</dt><dd>Object containing properties used to format the label. (optional)</dd>"," * </dl>"," *"," * @attribute labelFunction"," * @type Function"," */",""," /**"," * Object containing properties used by the `labelFunction` to format a"," * label."," *"," * @attribute labelFormat"," * @type Object"," */"," labelFormat: {"," value: {"," prefix: \"\","," thousandsSeparator: \"\","," decimalSeparator: \"\","," decimalPlaces: \"0\","," suffix: \"\""," }"," },",""," /**"," *Indicates how to round unit values."," * <dl>"," * <dt>niceNumber</dt><dd>Units will be smoothed based on the number of ticks and data range.</dd>"," * <dt>auto</dt><dd>If the range is greater than 1, the units will be rounded.</dd>"," * <dt>numeric value</dt><dd>Units will be equal to the numeric value.</dd>"," * <dt>null</dt><dd>No rounding will occur.</dd>"," * </dl>"," *"," * @attribute roundingMethod"," * @type String"," * @default niceNumber"," */"," roundingMethod: {"," value: \"niceNumber\""," },",""," /**"," * Indicates the scaling for the chart. The default value is `linear`. For a logarithmic axis, set the value"," * to `logarithmic`."," *"," * @attribute"," * @type String"," * @default linear"," */"," scaleType: {"," value: \"linear\""," }","};","","NumericImpl.prototype = {"," /**"," * @method initializer"," * @private"," */"," initializer: function() {"," this.after(\"alwaysShowZeroChange\", this._keyChangeHandler);"," this.after(\"roundingMethodChange\", this._keyChangeHandler);"," this.after(\"scaleTypeChange\", this._keyChangeHandler);"," },",""," /**"," * Formats a label based on the axis type and optionally specified format."," *"," * @method"," * @param {Object} value"," * @param {Object} format Pattern used to format the value."," * @return String"," */"," formatLabel: function(val, format)"," {"," if(format)"," {"," return Y.DataType.Number.format(val, format);"," }"," return val;"," },",""," /**"," * Returns the sum of all values per key."," *"," * @method getTotalByKey"," * @param {String} key The identifier for the array whose values will be calculated."," * @return Number"," */"," getTotalByKey: function(key)"," {"," var total = 0,"," values = this.getDataByKey(key),"," i = 0,"," val,"," len = values ? values.length : 0;"," for(; i < len; ++i)"," {"," val = parseFloat(values[i]);"," if(!isNaN(val))"," {"," total += val;"," }"," }"," return total;"," },",""," /**"," * Returns the value corresponding to the origin on the axis."," *"," * @method getOrigin"," * @return Number"," */"," getOrigin: function() {"," var origin = 0,"," min = this.get(\"minimum\"),"," max = this.get(\"maximum\");"," origin = Math.max(origin, min);"," origin = Math.min(origin, max);"," return origin;"," },",""," /**"," * Type of data used in `Data`."," *"," * @property _type"," * @readOnly"," * @private"," */"," _type: \"numeric\",",""," /**"," * Helper method for getting a `roundingUnit` when calculating the minimum and maximum values."," *"," * @method _getMinimumUnit"," * @param {Number} max Maximum number"," * @param {Number} min Minimum number"," * @param {Number} units Number of units on the axis"," * @return Number"," * @private"," */"," _getMinimumUnit:function(max, min, units)"," {"," return this._getNiceNumber(Math.ceil((max - min)/units));"," },",""," /**"," * Calculates a nice rounding unit based on the range."," *"," * @method _getNiceNumber"," * @param {Number} roundingUnit The calculated rounding unit."," * @return Number"," * @private"," */"," _getNiceNumber: function(roundingUnit)"," {"," var tempMajorUnit = roundingUnit,"," order = Math.ceil(Math.log(tempMajorUnit) * 0.4342944819032518),"," roundedMajorUnit = Math.pow(10, order),"," roundedDiff;",""," if (roundedMajorUnit / 2 >= tempMajorUnit)"," {"," roundedDiff = Math.floor((roundedMajorUnit / 2 - tempMajorUnit) / (Math.pow(10,order-1)/2));"," tempMajorUnit = roundedMajorUnit/2 - roundedDiff*Math.pow(10,order-1)/2;"," }"," else"," {"," tempMajorUnit = roundedMajorUnit;"," }"," if(!isNaN(tempMajorUnit))"," {"," return tempMajorUnit;"," }"," return roundingUnit;",""," },",""," /**"," * Calculates the maximum and minimum values for the `Data`."," *"," * @method _updateMinAndMax"," * @private"," */"," _updateMinAndMax: function()"," {"," var data = this.get(\"data\"),"," max,"," min,"," len,"," num,"," i = 0,"," setMax = this.get(\"setMax\"),"," setMin = this.get(\"setMin\");"," if(!setMax || !setMin)"," {"," if(data && data.length && data.length > 0)"," {"," len = data.length;"," for(; i < len; i++)"," {"," num = data[i];"," if(isNaN(num))"," {"," max = setMax ? this._setMaximum : max;"," min = setMin ? this._setMinimum : min;"," continue;"," }",""," if(setMin)"," {"," min = this._setMinimum;"," }"," else if(min === undefined)"," {"," min = num;"," }"," else"," {"," min = Math.min(num, min);"," }"," if(setMax)"," {"," max = this._setMaximum;"," }"," else if(max === undefined)"," {"," max = num;"," }"," else"," {"," max = Math.max(num, max);"," }",""," this._actualMaximum = max;"," this._actualMinimum = min;"," }"," }"," if(this.get(\"scaleType\") !== \"logarithmic\")"," {"," this._roundMinAndMax(min, max, setMin, setMax);"," }"," else"," {"," this._dataMaximum = max;"," this._dataMinimum = min;"," }"," }"," },",""," /**"," * Rounds the mimimum and maximum values based on the `roundingUnit` attribute."," *"," * @method _roundMinAndMax"," * @param {Number} min Minimum value"," * @param {Number} max Maximum value"," * @private"," */"," _roundMinAndMax: function(min, max, setMin, setMax)"," {"," var roundingUnit,"," minimumRange,"," minGreaterThanZero = min >= 0,"," maxGreaterThanZero = max > 0,"," dataRangeGreater,"," maxRound,"," minRound,"," topTicks,"," botTicks,"," tempMax,"," tempMin,"," units = this.getTotalMajorUnits() - 1,"," alwaysShowZero = this.get(\"alwaysShowZero\"),"," roundingMethod = this.get(\"roundingMethod\"),"," useIntegers = (max - min)/units >= 1;"," if(roundingMethod)"," {"," if(roundingMethod === \"niceNumber\")"," {"," roundingUnit = this._getMinimumUnit(max, min, units);"," if(minGreaterThanZero && maxGreaterThanZero)"," {"," if((alwaysShowZero || min < roundingUnit) && !setMin)"," {"," min = 0;"," roundingUnit = this._getMinimumUnit(max, min, units);"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," }"," if(setMax)"," {"," if(!alwaysShowZero)"," {"," min = max - (roundingUnit * units);"," }"," }"," else if(setMin)"," {"," max = min + (roundingUnit * units);"," }"," else"," {"," max = this._roundUpToNearest(max, roundingUnit);"," }"," }"," else if(maxGreaterThanZero && !minGreaterThanZero)"," {"," if(alwaysShowZero)"," {"," topTicks = Math.round(units/((-1 * min)/max + 1));"," topTicks = Math.max(Math.min(topTicks, units - 1), 1);"," botTicks = units - topTicks;"," tempMax = Math.ceil( max/topTicks );"," tempMin = Math.floor( min/botTicks ) * -1;",""," if(setMin)"," {"," while(tempMin < tempMax && botTicks >= 0)"," {"," botTicks--;"," topTicks++;"," tempMax = Math.ceil( max/topTicks );"," tempMin = Math.floor( min/botTicks ) * -1;"," }"," //if there are any bottom ticks left calcualate the maximum by multiplying by the tempMin value"," //if not, it's impossible to ensure that a zero is shown. skip it"," if(botTicks > 0)"," {"," max = tempMin * topTicks;"," }"," else"," {"," max = min + (roundingUnit * units);"," }"," }"," else if(setMax)"," {"," while(tempMax < tempMin && topTicks >= 0)"," {"," botTicks++;"," topTicks--;"," tempMin = Math.floor( min/botTicks ) * -1;"," tempMax = Math.ceil( max/topTicks );"," }"," //if there are any top ticks left calcualate the minimum by multiplying by the tempMax value"," //if not, it's impossible to ensure that a zero is shown. skip it"," if(topTicks > 0)"," {"," min = tempMax * botTicks * -1;"," }"," else"," {"," min = max - (roundingUnit * units);"," }"," }"," else"," {"," roundingUnit = Math.max(tempMax, tempMin);"," roundingUnit = this._getNiceNumber(roundingUnit);"," max = roundingUnit * topTicks;"," min = roundingUnit * botTicks * -1;"," }"," }"," else"," {"," if(setMax)"," {"," min = max - (roundingUnit * units);"," }"," else if(setMin)"," {"," max = min + (roundingUnit * units);"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," max = this._roundUpToNearest(max, roundingUnit);"," }"," }"," }"," else"," {"," if(setMin)"," {"," if(alwaysShowZero)"," {"," max = 0;"," }"," else"," {"," max = min + (roundingUnit * units);"," }"," }"," else if(!setMax)"," {"," if(alwaysShowZero || max === 0 || max + roundingUnit > 0)"," {"," max = 0;"," roundingUnit = this._getMinimumUnit(max, min, units);"," min = max - (roundingUnit * units);"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," max = this._roundUpToNearest(max, roundingUnit);"," }"," }"," else"," {"," min = max - (roundingUnit * units);"," }"," }"," }"," else if(roundingMethod === \"auto\")"," {"," if(minGreaterThanZero && maxGreaterThanZero)"," {"," if((alwaysShowZero || min < (max-min)/units) && !setMin)"," {"," min = 0;"," }",""," roundingUnit = (max - min)/units;"," if(useIntegers)"," {"," roundingUnit = Math.ceil(roundingUnit);"," max = min + (roundingUnit * units);"," }"," else"," {"," max = min + Math.ceil(roundingUnit * units * 100000)/100000;",""," }"," }"," else if(maxGreaterThanZero && !minGreaterThanZero)"," {"," if(alwaysShowZero)"," {"," topTicks = Math.round( units / ( (-1 * min) /max + 1) );"," topTicks = Math.max(Math.min(topTicks, units - 1), 1);"," botTicks = units - topTicks;",""," if(useIntegers)"," {"," tempMax = Math.ceil( max/topTicks );"," tempMin = Math.floor( min/botTicks ) * -1;"," roundingUnit = Math.max(tempMax, tempMin);"," max = roundingUnit * topTicks;"," min = roundingUnit * botTicks * -1;"," }"," else"," {"," tempMax = max/topTicks;"," tempMin = min/botTicks * -1;"," roundingUnit = Math.max(tempMax, tempMin);"," max = Math.ceil(roundingUnit * topTicks * 100000)/100000;"," min = Math.ceil(roundingUnit * botTicks * 100000)/100000 * -1;"," }"," }"," else"," {"," roundingUnit = (max - min)/units;"," if(useIntegers)"," {"," roundingUnit = Math.ceil(roundingUnit);"," }"," min = Math.round(this._roundDownToNearest(min, roundingUnit) * 100000)/100000;"," max = Math.round(this._roundUpToNearest(max, roundingUnit) * 100000)/100000;"," }"," }"," else"," {"," roundingUnit = (max - min)/units;"," if(useIntegers)"," {"," roundingUnit = Math.ceil(roundingUnit);"," }"," if(alwaysShowZero || max === 0 || max + roundingUnit > 0)"," {"," max = 0;"," roundingUnit = (max - min)/units;"," if(useIntegers)"," {"," Math.ceil(roundingUnit);"," min = max - (roundingUnit * units);"," }"," else"," {"," min = max - Math.ceil(roundingUnit * units * 100000)/100000;"," }"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," max = this._roundUpToNearest(max, roundingUnit);"," }",""," }"," }"," else if(!isNaN(roundingMethod) && isFinite(roundingMethod))"," {"," roundingUnit = roundingMethod;"," minimumRange = roundingUnit * units;"," dataRangeGreater = (max - min) > minimumRange;"," minRound = this._roundDownToNearest(min, roundingUnit);"," maxRound = this._roundUpToNearest(max, roundingUnit);"," if(setMax)"," {"," min = max - minimumRange;"," }"," else if(setMin)"," {"," max = min + minimumRange;"," }"," else if(minGreaterThanZero && maxGreaterThanZero)"," {"," if(alwaysShowZero || minRound <= 0)"," {"," min = 0;"," }"," else"," {"," min = minRound;"," }"," max = min + minimumRange;"," }"," else if(maxGreaterThanZero && !minGreaterThanZero)"," {"," min = minRound;"," max = maxRound;"," }"," else"," {"," if(alwaysShowZero || maxRound >= 0)"," {"," max = 0;"," }"," else"," {"," max = maxRound;"," }"," min = max - minimumRange;"," }"," }"," }"," this._dataMaximum = max;"," this._dataMinimum = min;"," },",""," /**"," * Rounds a Number to the nearest multiple of an input. For example, by rounding"," * 16 to the nearest 10, you will receive 20. Similar to the built-in function Math.round()."," *"," * @method _roundToNearest"," * @param {Number} number Number to round"," * @param {Number} nearest Multiple to round towards."," * @return Number"," * @private"," */"," _roundToNearest: function(number, nearest)"," {"," nearest = nearest || 1;"," var roundedNumber = Math.round(this._roundToPrecision(number / nearest, 10)) * nearest;"," return this._roundToPrecision(roundedNumber, 10);"," },",""," /**"," * Rounds a Number up to the nearest multiple of an input. For example, by rounding"," * 16 up to the nearest 10, you will receive 20. Similar to the built-in function Math.ceil()."," *"," * @method _roundUpToNearest"," * @param {Number} number Number to round"," * @param {Number} nearest Multiple to round towards."," * @return Number"," * @private"," */"," _roundUpToNearest: function(number, nearest)"," {"," nearest = nearest || 1;"," return Math.ceil(this._roundToPrecision(number / nearest, 10)) * nearest;"," },",""," /**"," * Rounds a Number down to the nearest multiple of an input. For example, by rounding"," * 16 down to the nearest 10, you will receive 10. Similar to the built-in function Math.floor()."," *"," * @method _roundDownToNearest"," * @param {Number} number Number to round"," * @param {Number} nearest Multiple to round towards."," * @return Number"," * @private"," */"," _roundDownToNearest: function(number, nearest)"," {"," nearest = nearest || 1;"," return Math.floor(this._roundToPrecision(number / nearest, 10)) * nearest;"," },",""," /**"," * Returns a coordinate corresponding to a data values."," *"," * @method _getCoordFromValue"," * @param {Number} min The minimum for the axis."," * @param {Number} max The maximum for the axis."," * @param {Number} length The distance that the axis spans."," * @param {Number} dataValue A value used to ascertain the coordinate."," * @param {Number} offset Value in which to offset the coordinates."," * @param {Boolean} reverse Indicates whether the coordinates should start from"," * the end of an axis. Only used in the numeric implementation."," * @return Number"," * @private"," */"," _getCoordFromValue: function(min, max, length, dataValue, offset, reverse)"," {"," var range,"," multiplier,"," valuecoord,"," isNumber = Y_Lang.isNumber;"," dataValue = parseFloat(dataValue);"," if(isNumber(dataValue))"," {"," if(this.get(\"scaleType\") === \"logarithmic\" && min > 0)"," {"," min = Math.log(min);"," max = Math.log(max);"," dataValue = Math.log(dataValue);"," }"," range = max - min;"," multiplier = length/range;"," valuecoord = (dataValue - min) * multiplier;"," valuecoord = reverse ? offset - valuecoord : offset + valuecoord;"," }"," else"," {"," valuecoord = NaN;"," }"," return valuecoord;"," },",""," /**"," * Rounds a number to a certain level of precision. Useful for limiting the number of"," * decimal places on a fractional number."," *"," * @method _roundToPrecision"," * @param {Number} number Number to round"," * @param {Number} precision Multiple to round towards."," * @return Number"," * @private"," */"," _roundToPrecision: function(number, precision)"," {"," precision = precision || 0;"," var decimalPlaces = Math.pow(10, precision);"," return Math.round(decimalPlaces * number) / decimalPlaces;"," }","};","","Y.NumericImpl = NumericImpl;","","/**"," * NumericAxisBase manages numeric data for an axis."," *"," * @class NumericAxisBase"," * @constructor"," * @extends AxisBase"," * @uses NumericImpl"," * @param {Object} config (optional) Configuration parameters."," * @submodule axis-numeric-base"," */","Y.NumericAxisBase = Y.Base.create(\"numericAxisBase\", Y.AxisBase, [Y.NumericImpl]);","","","}, '3.17.2', {\"requires\": [\"axis-base\"]});","","}());"]};
}
var __cov_w_x$LJ5sPl965kOy40ZtvQ = __coverage__['build/axis-numeric-base/axis-numeric-base.js'];
__cov_w_x$LJ5sPl965kOy40ZtvQ.s['1']++;YUI.add('axis-numeric-base',function(Y,NAME){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['1']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['2']++;var Y_Lang=Y.Lang;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['3']++;function NumericImpl(){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['2']++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['4']++;NumericImpl.NAME='numericImpl';__cov_w_x$LJ5sPl965kOy40ZtvQ.s['5']++;NumericImpl.ATTRS={alwaysShowZero:{value:true},labelFormat:{value:{prefix:'',thousandsSeparator:'',decimalSeparator:'',decimalPlaces:'0',suffix:''}},roundingMethod:{value:'niceNumber'},scaleType:{value:'linear'}};__cov_w_x$LJ5sPl965kOy40ZtvQ.s['6']++;NumericImpl.prototype={initializer:function(){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['3']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['7']++;this.after('alwaysShowZeroChange',this._keyChangeHandler);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['8']++;this.after('roundingMethodChange',this._keyChangeHandler);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['9']++;this.after('scaleTypeChange',this._keyChangeHandler);},formatLabel:function(val,format){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['4']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['10']++;if(format){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['1'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['11']++;return Y.DataType.Number.format(val,format);}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['1'][1]++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['12']++;return val;},getTotalByKey:function(key){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['5']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['13']++;var total=0,values=this.getDataByKey(key),i=0,val,len=values?(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['2'][0]++,values.length):(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['2'][1]++,0);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['14']++;for(;i<len;++i){__cov_w_x$LJ5sPl965kOy40ZtvQ.s['15']++;val=parseFloat(values[i]);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['16']++;if(!isNaN(val)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['3'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['17']++;total+=val;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['3'][1]++;}}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['18']++;return total;},getOrigin:function(){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['6']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['19']++;var origin=0,min=this.get('minimum'),max=this.get('maximum');__cov_w_x$LJ5sPl965kOy40ZtvQ.s['20']++;origin=Math.max(origin,min);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['21']++;origin=Math.min(origin,max);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['22']++;return origin;},_type:'numeric',_getMinimumUnit:function(max,min,units){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['7']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['23']++;return this._getNiceNumber(Math.ceil((max-min)/units));},_getNiceNumber:function(roundingUnit){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['8']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['24']++;var tempMajorUnit=roundingUnit,order=Math.ceil(Math.log(tempMajorUnit)*0.4342944819032518),roundedMajorUnit=Math.pow(10,order),roundedDiff;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['25']++;if(roundedMajorUnit/2>=tempMajorUnit){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['4'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['26']++;roundedDiff=Math.floor((roundedMajorUnit/2-tempMajorUnit)/(Math.pow(10,order-1)/2));__cov_w_x$LJ5sPl965kOy40ZtvQ.s['27']++;tempMajorUnit=roundedMajorUnit/2-roundedDiff*Math.pow(10,order-1)/2;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['4'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['28']++;tempMajorUnit=roundedMajorUnit;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['29']++;if(!isNaN(tempMajorUnit)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['5'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['30']++;return tempMajorUnit;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['5'][1]++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['31']++;return roundingUnit;},_updateMinAndMax:function(){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['9']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['32']++;var data=this.get('data'),max,min,len,num,i=0,setMax=this.get('setMax'),setMin=this.get('setMin');__cov_w_x$LJ5sPl965kOy40ZtvQ.s['33']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['7'][0]++,!setMax)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['7'][1]++,!setMin)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['6'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['34']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['9'][0]++,data)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['9'][1]++,data.length)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['9'][2]++,data.length>0)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['8'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['35']++;len=data.length;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['36']++;for(;i<len;i++){__cov_w_x$LJ5sPl965kOy40ZtvQ.s['37']++;num=data[i];__cov_w_x$LJ5sPl965kOy40ZtvQ.s['38']++;if(isNaN(num)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['10'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['39']++;max=setMax?(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['11'][0]++,this._setMaximum):(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['11'][1]++,max);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['40']++;min=setMin?(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['12'][0]++,this._setMinimum):(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['12'][1]++,min);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['41']++;continue;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['10'][1]++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['42']++;if(setMin){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['13'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['43']++;min=this._setMinimum;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['13'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['44']++;if(min===undefined){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['14'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['45']++;min=num;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['14'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['46']++;min=Math.min(num,min);}}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['47']++;if(setMax){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['15'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['48']++;max=this._setMaximum;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['15'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['49']++;if(max===undefined){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['16'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['50']++;max=num;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['16'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['51']++;max=Math.max(num,max);}}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['52']++;this._actualMaximum=max;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['53']++;this._actualMinimum=min;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['8'][1]++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['54']++;if(this.get('scaleType')!=='logarithmic'){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['17'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['55']++;this._roundMinAndMax(min,max,setMin,setMax);}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['17'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['56']++;this._dataMaximum=max;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['57']++;this._dataMinimum=min;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['6'][1]++;}},_roundMinAndMax:function(min,max,setMin,setMax){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['10']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['58']++;var roundingUnit,minimumRange,minGreaterThanZero=min>=0,maxGreaterThanZero=max>0,dataRangeGreater,maxRound,minRound,topTicks,botTicks,tempMax,tempMin,units=this.getTotalMajorUnits()-1,alwaysShowZero=this.get('alwaysShowZero'),roundingMethod=this.get('roundingMethod'),useIntegers=(max-min)/units>=1;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['59']++;if(roundingMethod){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['18'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['60']++;if(roundingMethod==='niceNumber'){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['19'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['61']++;roundingUnit=this._getMinimumUnit(max,min,units);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['62']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['21'][0]++,minGreaterThanZero)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['21'][1]++,maxGreaterThanZero)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['20'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['63']++;if(((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['23'][0]++,alwaysShowZero)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['23'][1]++,min<roundingUnit))&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['23'][2]++,!setMin)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['22'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['64']++;min=0;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['65']++;roundingUnit=this._getMinimumUnit(max,min,units);}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['22'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['66']++;min=this._roundDownToNearest(min,roundingUnit);}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['67']++;if(setMax){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['24'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['68']++;if(!alwaysShowZero){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['25'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['69']++;min=max-roundingUnit*units;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['25'][1]++;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['24'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['70']++;if(setMin){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['26'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['71']++;max=min+roundingUnit*units;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['26'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['72']++;max=this._roundUpToNearest(max,roundingUnit);}}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['20'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['73']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['28'][0]++,maxGreaterThanZero)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['28'][1]++,!minGreaterThanZero)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['27'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['74']++;if(alwaysShowZero){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['29'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['75']++;topTicks=Math.round(units/(-1*min/max+1));__cov_w_x$LJ5sPl965kOy40ZtvQ.s['76']++;topTicks=Math.max(Math.min(topTicks,units-1),1);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['77']++;botTicks=units-topTicks;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['78']++;tempMax=Math.ceil(max/topTicks);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['79']++;tempMin=Math.floor(min/botTicks)*-1;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['80']++;if(setMin){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['30'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['81']++;while((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['31'][0]++,tempMin<tempMax)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['31'][1]++,botTicks>=0)){__cov_w_x$LJ5sPl965kOy40ZtvQ.s['82']++;botTicks--;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['83']++;topTicks++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['84']++;tempMax=Math.ceil(max/topTicks);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['85']++;tempMin=Math.floor(min/botTicks)*-1;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['86']++;if(botTicks>0){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['32'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['87']++;max=tempMin*topTicks;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['32'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['88']++;max=min+roundingUnit*units;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['30'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['89']++;if(setMax){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['33'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['90']++;while((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['34'][0]++,tempMax<tempMin)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['34'][1]++,topTicks>=0)){__cov_w_x$LJ5sPl965kOy40ZtvQ.s['91']++;botTicks++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['92']++;topTicks--;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['93']++;tempMin=Math.floor(min/botTicks)*-1;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['94']++;tempMax=Math.ceil(max/topTicks);}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['95']++;if(topTicks>0){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['35'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['96']++;min=tempMax*botTicks*-1;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['35'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['97']++;min=max-roundingUnit*units;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['33'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['98']++;roundingUnit=Math.max(tempMax,tempMin);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['99']++;roundingUnit=this._getNiceNumber(roundingUnit);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['100']++;max=roundingUnit*topTicks;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['101']++;min=roundingUnit*botTicks*-1;}}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['29'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['102']++;if(setMax){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['36'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['103']++;min=max-roundingUnit*units;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['36'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['104']++;if(setMin){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['37'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['105']++;max=min+roundingUnit*units;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['37'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['106']++;min=this._roundDownToNearest(min,roundingUnit);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['107']++;max=this._roundUpToNearest(max,roundingUnit);}}}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['27'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['108']++;if(setMin){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['38'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['109']++;if(alwaysShowZero){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['39'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['110']++;max=0;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['39'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['111']++;max=min+roundingUnit*units;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['38'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['112']++;if(!setMax){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['40'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['113']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['42'][0]++,alwaysShowZero)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['42'][1]++,max===0)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['42'][2]++,max+roundingUnit>0)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['41'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['114']++;max=0;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['115']++;roundingUnit=this._getMinimumUnit(max,min,units);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['116']++;min=max-roundingUnit*units;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['41'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['117']++;min=this._roundDownToNearest(min,roundingUnit);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['118']++;max=this._roundUpToNearest(max,roundingUnit);}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['40'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['119']++;min=max-roundingUnit*units;}}}}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['19'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['120']++;if(roundingMethod==='auto'){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['43'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['121']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['45'][0]++,minGreaterThanZero)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['45'][1]++,maxGreaterThanZero)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['44'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['122']++;if(((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['47'][0]++,alwaysShowZero)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['47'][1]++,min<(max-min)/units))&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['47'][2]++,!setMin)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['46'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['123']++;min=0;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['46'][1]++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['124']++;roundingUnit=(max-min)/units;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['125']++;if(useIntegers){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['48'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['126']++;roundingUnit=Math.ceil(roundingUnit);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['127']++;max=min+roundingUnit*units;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['48'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['128']++;max=min+Math.ceil(roundingUnit*units*100000)/100000;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['44'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['129']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['50'][0]++,maxGreaterThanZero)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['50'][1]++,!minGreaterThanZero)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['49'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['130']++;if(alwaysShowZero){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['51'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['131']++;topTicks=Math.round(units/(-1*min/max+1));__cov_w_x$LJ5sPl965kOy40ZtvQ.s['132']++;topTicks=Math.max(Math.min(topTicks,units-1),1);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['133']++;botTicks=units-topTicks;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['134']++;if(useIntegers){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['52'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['135']++;tempMax=Math.ceil(max/topTicks);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['136']++;tempMin=Math.floor(min/botTicks)*-1;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['137']++;roundingUnit=Math.max(tempMax,tempMin);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['138']++;max=roundingUnit*topTicks;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['139']++;min=roundingUnit*botTicks*-1;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['52'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['140']++;tempMax=max/topTicks;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['141']++;tempMin=min/botTicks*-1;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['142']++;roundingUnit=Math.max(tempMax,tempMin);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['143']++;max=Math.ceil(roundingUnit*topTicks*100000)/100000;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['144']++;min=Math.ceil(roundingUnit*botTicks*100000)/100000*-1;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['51'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['145']++;roundingUnit=(max-min)/units;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['146']++;if(useIntegers){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['53'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['147']++;roundingUnit=Math.ceil(roundingUnit);}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['53'][1]++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['148']++;min=Math.round(this._roundDownToNearest(min,roundingUnit)*100000)/100000;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['149']++;max=Math.round(this._roundUpToNearest(max,roundingUnit)*100000)/100000;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['49'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['150']++;roundingUnit=(max-min)/units;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['151']++;if(useIntegers){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['54'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['152']++;roundingUnit=Math.ceil(roundingUnit);}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['54'][1]++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['153']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['56'][0]++,alwaysShowZero)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['56'][1]++,max===0)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['56'][2]++,max+roundingUnit>0)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['55'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['154']++;max=0;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['155']++;roundingUnit=(max-min)/units;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['156']++;if(useIntegers){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['57'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['157']++;Math.ceil(roundingUnit);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['158']++;min=max-roundingUnit*units;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['57'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['159']++;min=max-Math.ceil(roundingUnit*units*100000)/100000;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['55'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['160']++;min=this._roundDownToNearest(min,roundingUnit);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['161']++;max=this._roundUpToNearest(max,roundingUnit);}}}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['43'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['162']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['59'][0]++,!isNaN(roundingMethod))&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['59'][1]++,isFinite(roundingMethod))){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['58'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['163']++;roundingUnit=roundingMethod;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['164']++;minimumRange=roundingUnit*units;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['165']++;dataRangeGreater=max-min>minimumRange;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['166']++;minRound=this._roundDownToNearest(min,roundingUnit);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['167']++;maxRound=this._roundUpToNearest(max,roundingUnit);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['168']++;if(setMax){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['60'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['169']++;min=max-minimumRange;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['60'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['170']++;if(setMin){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['61'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['171']++;max=min+minimumRange;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['61'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['172']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['63'][0]++,minGreaterThanZero)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['63'][1]++,maxGreaterThanZero)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['62'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['173']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['65'][0]++,alwaysShowZero)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['65'][1]++,minRound<=0)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['64'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['174']++;min=0;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['64'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['175']++;min=minRound;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['176']++;max=min+minimumRange;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['62'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['177']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['67'][0]++,maxGreaterThanZero)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['67'][1]++,!minGreaterThanZero)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['66'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['178']++;min=minRound;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['179']++;max=maxRound;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['66'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['180']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['69'][0]++,alwaysShowZero)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['69'][1]++,maxRound>=0)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['68'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['181']++;max=0;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['68'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['182']++;max=maxRound;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['183']++;min=max-minimumRange;}}}}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['58'][1]++;}}}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['18'][1]++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['184']++;this._dataMaximum=max;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['185']++;this._dataMinimum=min;},_roundToNearest:function(number,nearest){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['11']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['186']++;nearest=(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['70'][0]++,nearest)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['70'][1]++,1);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['187']++;var roundedNumber=Math.round(this._roundToPrecision(number/nearest,10))*nearest;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['188']++;return this._roundToPrecision(roundedNumber,10);},_roundUpToNearest:function(number,nearest){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['12']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['189']++;nearest=(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['71'][0]++,nearest)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['71'][1]++,1);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['190']++;return Math.ceil(this._roundToPrecision(number/nearest,10))*nearest;},_roundDownToNearest:function(number,nearest){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['13']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['191']++;nearest=(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['72'][0]++,nearest)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['72'][1]++,1);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['192']++;return Math.floor(this._roundToPrecision(number/nearest,10))*nearest;},_getCoordFromValue:function(min,max,length,dataValue,offset,reverse){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['14']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['193']++;var range,multiplier,valuecoord,isNumber=Y_Lang.isNumber;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['194']++;dataValue=parseFloat(dataValue);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['195']++;if(isNumber(dataValue)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['73'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['196']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['75'][0]++,this.get('scaleType')==='logarithmic')&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['75'][1]++,min>0)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['74'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['197']++;min=Math.log(min);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['198']++;max=Math.log(max);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['199']++;dataValue=Math.log(dataValue);}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['74'][1]++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['200']++;range=max-min;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['201']++;multiplier=length/range;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['202']++;valuecoord=(dataValue-min)*multiplier;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['203']++;valuecoord=reverse?(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['76'][0]++,offset-valuecoord):(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['76'][1]++,offset+valuecoord);}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['73'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['204']++;valuecoord=NaN;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['205']++;return valuecoord;},_roundToPrecision:function(number,precision){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['15']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['206']++;precision=(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['77'][0]++,precision)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['77'][1]++,0);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['207']++;var decimalPlaces=Math.pow(10,precision);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['208']++;return Math.round(decimalPlaces*number)/decimalPlaces;}};__cov_w_x$LJ5sPl965kOy40ZtvQ.s['209']++;Y.NumericImpl=NumericImpl;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['210']++;Y.NumericAxisBase=Y.Base.create('numericAxisBase',Y.AxisBase,[Y.NumericImpl]);},'3.17.2',{'requires':['axis-base']});
|
jtblin/jsdelivr
|
files/yui/3.17.2/axis-numeric-base/axis-numeric-base-coverage.js
|
JavaScript
|
mit
| 82,908 |
/**
* @license AngularJS v1.2.1
* (c) 2010-2012 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, angular, undefined) {'use strict';
/**
* @ngdoc overview
* @name ngTouch
* @description
*
* # ngTouch
*
* The `ngTouch` module provides touch events and other helpers for touch-enabled devices.
* The implementation is based on jQuery Mobile touch event handling
* ([jquerymobile.com](http://jquerymobile.com/)).
*
* {@installModule touch}
*
* See {@link ngTouch.$swipe `$swipe`} for usage.
*
* <div doc-module-components="ngTouch"></div>
*
*/
// define ngTouch module
/* global -ngTouch */
var ngTouch = angular.module('ngTouch', []);
/* global ngTouch: false */
/**
* @ngdoc object
* @name ngTouch.$swipe
*
* @description
* The `$swipe` service is a service that abstracts the messier details of hold-and-drag swipe
* behavior, to make implementing swipe-related directives more convenient.
*
* Requires the {@link ngTouch `ngTouch`} module to be installed.
*
* `$swipe` is used by the `ngSwipeLeft` and `ngSwipeRight` directives in `ngTouch`, and by
* `ngCarousel` in a separate component.
*
* # Usage
* The `$swipe` service is an object with a single method: `bind`. `bind` takes an element
* which is to be watched for swipes, and an object with four handler functions. See the
* documentation for `bind` below.
*/
ngTouch.factory('$swipe', [function() {
// The total distance in any direction before we make the call on swipe vs. scroll.
var MOVE_BUFFER_RADIUS = 10;
function getCoordinates(event) {
var touches = event.touches && event.touches.length ? event.touches : [event];
var e = (event.changedTouches && event.changedTouches[0]) ||
(event.originalEvent && event.originalEvent.changedTouches &&
event.originalEvent.changedTouches[0]) ||
touches[0].originalEvent || touches[0];
return {
x: e.clientX,
y: e.clientY
};
}
return {
/**
* @ngdoc method
* @name ngTouch.$swipe#bind
* @methodOf ngTouch.$swipe
*
* @description
* The main method of `$swipe`. It takes an element to be watched for swipe motions, and an
* object containing event handlers.
*
* The four events are `start`, `move`, `end`, and `cancel`. `start`, `move`, and `end`
* receive as a parameter a coordinates object of the form `{ x: 150, y: 310 }`.
*
* `start` is called on either `mousedown` or `touchstart`. After this event, `$swipe` is
* watching for `touchmove` or `mousemove` events. These events are ignored until the total
* distance moved in either dimension exceeds a small threshold.
*
* Once this threshold is exceeded, either the horizontal or vertical delta is greater.
* - If the horizontal distance is greater, this is a swipe and `move` and `end` events follow.
* - If the vertical distance is greater, this is a scroll, and we let the browser take over.
* A `cancel` event is sent.
*
* `move` is called on `mousemove` and `touchmove` after the above logic has determined that
* a swipe is in progress.
*
* `end` is called when a swipe is successfully completed with a `touchend` or `mouseup`.
*
* `cancel` is called either on a `touchcancel` from the browser, or when we begin scrolling
* as described above.
*
*/
bind: function(element, eventHandlers) {
// Absolute total movement, used to control swipe vs. scroll.
var totalX, totalY;
// Coordinates of the start position.
var startCoords;
// Last event's position.
var lastPos;
// Whether a swipe is active.
var active = false;
element.on('touchstart mousedown', function(event) {
startCoords = getCoordinates(event);
active = true;
totalX = 0;
totalY = 0;
lastPos = startCoords;
eventHandlers['start'] && eventHandlers['start'](startCoords, event);
});
element.on('touchcancel', function(event) {
active = false;
eventHandlers['cancel'] && eventHandlers['cancel'](event);
});
element.on('touchmove mousemove', function(event) {
if (!active) return;
// Android will send a touchcancel if it thinks we're starting to scroll.
// So when the total distance (+ or - or both) exceeds 10px in either direction,
// we either:
// - On totalX > totalY, we send preventDefault() and treat this as a swipe.
// - On totalY > totalX, we let the browser handle it as a scroll.
if (!startCoords) return;
var coords = getCoordinates(event);
totalX += Math.abs(coords.x - lastPos.x);
totalY += Math.abs(coords.y - lastPos.y);
lastPos = coords;
if (totalX < MOVE_BUFFER_RADIUS && totalY < MOVE_BUFFER_RADIUS) {
return;
}
// One of totalX or totalY has exceeded the buffer, so decide on swipe vs. scroll.
if (totalY > totalX) {
// Allow native scrolling to take over.
active = false;
eventHandlers['cancel'] && eventHandlers['cancel'](event);
return;
} else {
// Prevent the browser from scrolling.
event.preventDefault();
eventHandlers['move'] && eventHandlers['move'](coords, event);
}
});
element.on('touchend mouseup', function(event) {
if (!active) return;
active = false;
eventHandlers['end'] && eventHandlers['end'](getCoordinates(event), event);
});
}
};
}]);
/* global ngTouch: false */
/**
* @ngdoc directive
* @name ngTouch.directive:ngClick
*
* @description
* A more powerful replacement for the default ngClick designed to be used on touchscreen
* devices. Most mobile browsers wait about 300ms after a tap-and-release before sending
* the click event. This version handles them immediately, and then prevents the
* following click event from propagating.
*
* Requires the {@link ngTouch `ngTouch`} module to be installed.
*
* This directive can fall back to using an ordinary click event, and so works on desktop
* browsers as well as mobile.
*
* This directive also sets the CSS class `ng-click-active` while the element is being held
* down (by a mouse click or touch) so you can restyle the depressed element if you wish.
*
* @element ANY
* @param {expression} ngClick {@link guide/expression Expression} to evaluate
* upon tap. (Event object is available as `$event`)
*
* @example
<doc:example>
<doc:source>
<button ng-click="count = count + 1" ng-init="count=0">
Increment
</button>
count: {{ count }}
</doc:source>
</doc:example>
*/
ngTouch.config(['$provide', function($provide) {
$provide.decorator('ngClickDirective', ['$delegate', function($delegate) {
// drop the default ngClick directive
$delegate.shift();
return $delegate;
}]);
}]);
ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement',
function($parse, $timeout, $rootElement) {
var TAP_DURATION = 750; // Shorter than 750ms is a tap, longer is a taphold or drag.
var MOVE_TOLERANCE = 12; // 12px seems to work in most mobile browsers.
var PREVENT_DURATION = 2500; // 2.5 seconds maximum from preventGhostClick call to click
var CLICKBUSTER_THRESHOLD = 25; // 25 pixels in any dimension is the limit for busting clicks.
var ACTIVE_CLASS_NAME = 'ng-click-active';
var lastPreventedTime;
var touchCoordinates;
// TAP EVENTS AND GHOST CLICKS
//
// Why tap events?
// Mobile browsers detect a tap, then wait a moment (usually ~300ms) to see if you're
// double-tapping, and then fire a click event.
//
// This delay sucks and makes mobile apps feel unresponsive.
// So we detect touchstart, touchmove, touchcancel and touchend ourselves and determine when
// the user has tapped on something.
//
// What happens when the browser then generates a click event?
// The browser, of course, also detects the tap and fires a click after a delay. This results in
// tapping/clicking twice. So we do "clickbusting" to prevent it.
//
// How does it work?
// We attach global touchstart and click handlers, that run during the capture (early) phase.
// So the sequence for a tap is:
// - global touchstart: Sets an "allowable region" at the point touched.
// - element's touchstart: Starts a touch
// (- touchmove or touchcancel ends the touch, no click follows)
// - element's touchend: Determines if the tap is valid (didn't move too far away, didn't hold
// too long) and fires the user's tap handler. The touchend also calls preventGhostClick().
// - preventGhostClick() removes the allowable region the global touchstart created.
// - The browser generates a click event.
// - The global click handler catches the click, and checks whether it was in an allowable region.
// - If preventGhostClick was called, the region will have been removed, the click is busted.
// - If the region is still there, the click proceeds normally. Therefore clicks on links and
// other elements without ngTap on them work normally.
//
// This is an ugly, terrible hack!
// Yeah, tell me about it. The alternatives are using the slow click events, or making our users
// deal with the ghost clicks, so I consider this the least of evils. Fortunately Angular
// encapsulates this ugly logic away from the user.
//
// Why not just put click handlers on the element?
// We do that too, just to be sure. The problem is that the tap event might have caused the DOM
// to change, so that the click fires in the same position but something else is there now. So
// the handlers are global and care only about coordinates and not elements.
// Checks if the coordinates are close enough to be within the region.
function hit(x1, y1, x2, y2) {
return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD;
}
// Checks a list of allowable regions against a click location.
// Returns true if the click should be allowed.
// Splices out the allowable region from the list after it has been used.
function checkAllowableRegions(touchCoordinates, x, y) {
for (var i = 0; i < touchCoordinates.length; i += 2) {
if (hit(touchCoordinates[i], touchCoordinates[i+1], x, y)) {
touchCoordinates.splice(i, i + 2);
return true; // allowable region
}
}
return false; // No allowable region; bust it.
}
// Global click handler that prevents the click if it's in a bustable zone and preventGhostClick
// was called recently.
function onClick(event) {
if (Date.now() - lastPreventedTime > PREVENT_DURATION) {
return; // Too old.
}
var touches = event.touches && event.touches.length ? event.touches : [event];
var x = touches[0].clientX;
var y = touches[0].clientY;
// Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label
// and on the input element). Depending on the exact browser, this second click we don't want
// to bust has either (0,0) or negative coordinates.
if (x < 1 && y < 1) {
return; // offscreen
}
// Look for an allowable region containing this click.
// If we find one, that means it was created by touchstart and not removed by
// preventGhostClick, so we don't bust it.
if (checkAllowableRegions(touchCoordinates, x, y)) {
return;
}
// If we didn't find an allowable region, bust the click.
event.stopPropagation();
event.preventDefault();
// Blur focused form elements
event.target && event.target.blur();
}
// Global touchstart handler that creates an allowable region for a click event.
// This allowable region can be removed by preventGhostClick if we want to bust it.
function onTouchStart(event) {
var touches = event.touches && event.touches.length ? event.touches : [event];
var x = touches[0].clientX;
var y = touches[0].clientY;
touchCoordinates.push(x, y);
$timeout(function() {
// Remove the allowable region.
for (var i = 0; i < touchCoordinates.length; i += 2) {
if (touchCoordinates[i] == x && touchCoordinates[i+1] == y) {
touchCoordinates.splice(i, i + 2);
return;
}
}
}, PREVENT_DURATION, false);
}
// On the first call, attaches some event handlers. Then whenever it gets called, it creates a
// zone around the touchstart where clicks will get busted.
function preventGhostClick(x, y) {
if (!touchCoordinates) {
$rootElement[0].addEventListener('click', onClick, true);
$rootElement[0].addEventListener('touchstart', onTouchStart, true);
touchCoordinates = [];
}
lastPreventedTime = Date.now();
checkAllowableRegions(touchCoordinates, x, y);
}
// Actual linking function.
return function(scope, element, attr) {
var clickHandler = $parse(attr.ngClick),
tapping = false,
tapElement, // Used to blur the element after a tap.
startTime, // Used to check if the tap was held too long.
touchStartX,
touchStartY;
function resetState() {
tapping = false;
element.removeClass(ACTIVE_CLASS_NAME);
}
element.on('touchstart', function(event) {
tapping = true;
tapElement = event.target ? event.target : event.srcElement; // IE uses srcElement.
// Hack for Safari, which can target text nodes instead of containers.
if(tapElement.nodeType == 3) {
tapElement = tapElement.parentNode;
}
element.addClass(ACTIVE_CLASS_NAME);
startTime = Date.now();
var touches = event.touches && event.touches.length ? event.touches : [event];
var e = touches[0].originalEvent || touches[0];
touchStartX = e.clientX;
touchStartY = e.clientY;
});
element.on('touchmove', function(event) {
resetState();
});
element.on('touchcancel', function(event) {
resetState();
});
element.on('touchend', function(event) {
var diff = Date.now() - startTime;
var touches = (event.changedTouches && event.changedTouches.length) ? event.changedTouches :
((event.touches && event.touches.length) ? event.touches : [event]);
var e = touches[0].originalEvent || touches[0];
var x = e.clientX;
var y = e.clientY;
var dist = Math.sqrt( Math.pow(x - touchStartX, 2) + Math.pow(y - touchStartY, 2) );
if (tapping && diff < TAP_DURATION && dist < MOVE_TOLERANCE) {
// Call preventGhostClick so the clickbuster will catch the corresponding click.
preventGhostClick(x, y);
// Blur the focused element (the button, probably) before firing the callback.
// This doesn't work perfectly on Android Chrome, but seems to work elsewhere.
// I couldn't get anything to work reliably on Android Chrome.
if (tapElement) {
tapElement.blur();
}
if (!angular.isDefined(attr.disabled) || attr.disabled === false) {
element.triggerHandler('click', [event]);
}
}
resetState();
});
// Hack for iOS Safari's benefit. It goes searching for onclick handlers and is liable to click
// something else nearby.
element.onclick = function(event) { };
// Actual click handler.
// There are three different kinds of clicks, only two of which reach this point.
// - On desktop browsers without touch events, their clicks will always come here.
// - On mobile browsers, the simulated "fast" click will call this.
// - But the browser's follow-up slow click will be "busted" before it reaches this handler.
// Therefore it's safe to use this directive on both mobile and desktop.
element.on('click', function(event, touchend) {
scope.$apply(function() {
clickHandler(scope, {$event: (touchend || event)});
});
});
element.on('mousedown', function(event) {
element.addClass(ACTIVE_CLASS_NAME);
});
element.on('mousemove mouseup', function(event) {
element.removeClass(ACTIVE_CLASS_NAME);
});
};
}]);
/* global ngTouch: false */
/**
* @ngdoc directive
* @name ngTouch.directive:ngSwipeLeft
*
* @description
* Specify custom behavior when an element is swiped to the left on a touchscreen device.
* A leftward swipe is a quick, right-to-left slide of the finger.
* Though ngSwipeLeft is designed for touch-based devices, it will work with a mouse click and drag
* too.
*
* Requires the {@link ngTouch `ngTouch`} module to be installed.
*
* @element ANY
* @param {expression} ngSwipeLeft {@link guide/expression Expression} to evaluate
* upon left swipe. (Event object is available as `$event`)
*
* @example
<doc:example>
<doc:source>
<div ng-show="!showActions" ng-swipe-left="showActions = true">
Some list content, like an email in the inbox
</div>
<div ng-show="showActions" ng-swipe-right="showActions = false">
<button ng-click="reply()">Reply</button>
<button ng-click="delete()">Delete</button>
</div>
</doc:source>
</doc:example>
*/
/**
* @ngdoc directive
* @name ngTouch.directive:ngSwipeRight
*
* @description
* Specify custom behavior when an element is swiped to the right on a touchscreen device.
* A rightward swipe is a quick, left-to-right slide of the finger.
* Though ngSwipeRight is designed for touch-based devices, it will work with a mouse click and drag
* too.
*
* Requires the {@link ngTouch `ngTouch`} module to be installed.
*
* @element ANY
* @param {expression} ngSwipeRight {@link guide/expression Expression} to evaluate
* upon right swipe. (Event object is available as `$event`)
*
* @example
<doc:example>
<doc:source>
<div ng-show="!showActions" ng-swipe-left="showActions = true">
Some list content, like an email in the inbox
</div>
<div ng-show="showActions" ng-swipe-right="showActions = false">
<button ng-click="reply()">Reply</button>
<button ng-click="delete()">Delete</button>
</div>
</doc:source>
</doc:example>
*/
function makeSwipeDirective(directiveName, direction, eventName) {
ngTouch.directive(directiveName, ['$parse', '$swipe', function($parse, $swipe) {
// The maximum vertical delta for a swipe should be less than 75px.
var MAX_VERTICAL_DISTANCE = 75;
// Vertical distance should not be more than a fraction of the horizontal distance.
var MAX_VERTICAL_RATIO = 0.3;
// At least a 30px lateral motion is necessary for a swipe.
var MIN_HORIZONTAL_DISTANCE = 30;
return function(scope, element, attr) {
var swipeHandler = $parse(attr[directiveName]);
var startCoords, valid;
function validSwipe(coords) {
// Check that it's within the coordinates.
// Absolute vertical distance must be within tolerances.
// Horizontal distance, we take the current X - the starting X.
// This is negative for leftward swipes and positive for rightward swipes.
// After multiplying by the direction (-1 for left, +1 for right), legal swipes
// (ie. same direction as the directive wants) will have a positive delta and
// illegal ones a negative delta.
// Therefore this delta must be positive, and larger than the minimum.
if (!startCoords) return false;
var deltaY = Math.abs(coords.y - startCoords.y);
var deltaX = (coords.x - startCoords.x) * direction;
return valid && // Short circuit for already-invalidated swipes.
deltaY < MAX_VERTICAL_DISTANCE &&
deltaX > 0 &&
deltaX > MIN_HORIZONTAL_DISTANCE &&
deltaY / deltaX < MAX_VERTICAL_RATIO;
}
$swipe.bind(element, {
'start': function(coords, event) {
startCoords = coords;
valid = true;
},
'cancel': function(event) {
valid = false;
},
'end': function(coords, event) {
if (validSwipe(coords)) {
scope.$apply(function() {
element.triggerHandler(eventName);
swipeHandler(scope, {$event: event});
});
}
}
});
};
}]);
}
// Left is negative X-coordinate, right is positive.
makeSwipeDirective('ngSwipeLeft', -1, 'swipeleft');
makeSwipeDirective('ngSwipeRight', 1, 'swiperight');
})(window, window.angular);
|
vanderlee/cdnjs
|
ajax/libs/angular.js/1.2.1/angular-touch.js
|
JavaScript
|
mit
| 20,705 |
/*
YUI 3.17.2 (build 9c3c78e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/autocomplete-highlighters/autocomplete-highlighters.js']) {
__coverage__['build/autocomplete-highlighters/autocomplete-highlighters.js'] = {"path":"build/autocomplete-highlighters/autocomplete-highlighters.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0},"b":{"1":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":56}}},"2":{"name":"(anonymous_2)","line":28,"loc":{"start":{"line":28,"column":15},"end":{"line":28,"column":56}}},"3":{"name":"(anonymous_3)","line":35,"loc":{"start":{"line":35,"column":35},"end":{"line":35,"column":53}}},"4":{"name":"(anonymous_4)","line":51,"loc":{"start":{"line":51,"column":19},"end":{"line":51,"column":45}}},"5":{"name":"(anonymous_5)","line":65,"loc":{"start":{"line":65,"column":17},"end":{"line":65,"column":58}}},"6":{"name":"(anonymous_6)","line":69,"loc":{"start":{"line":69,"column":35},"end":{"line":69,"column":53}}},"7":{"name":"(anonymous_7)","line":85,"loc":{"start":{"line":85,"column":21},"end":{"line":85,"column":47}}},"8":{"name":"(anonymous_8)","line":99,"loc":{"start":{"line":99,"column":16},"end":{"line":99,"column":57}}},"9":{"name":"(anonymous_9)","line":103,"loc":{"start":{"line":103,"column":35},"end":{"line":103,"column":53}}},"10":{"name":"(anonymous_10)","line":120,"loc":{"start":{"line":120,"column":20},"end":{"line":120,"column":46}}},"11":{"name":"(anonymous_11)","line":135,"loc":{"start":{"line":135,"column":18},"end":{"line":135,"column":59}}},"12":{"name":"(anonymous_12)","line":143,"loc":{"start":{"line":143,"column":35},"end":{"line":143,"column":53}}},"13":{"name":"(anonymous_13)","line":159,"loc":{"start":{"line":159,"column":22},"end":{"line":159,"column":48}}},"14":{"name":"(anonymous_14)","line":173,"loc":{"start":{"line":173,"column":15},"end":{"line":173,"column":56}}},"15":{"name":"(anonymous_15)","line":177,"loc":{"start":{"line":177,"column":35},"end":{"line":177,"column":53}}},"16":{"name":"(anonymous_16)","line":193,"loc":{"start":{"line":193,"column":19},"end":{"line":193,"column":45}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":199,"column":63}},"2":{"start":{"line":12,"column":0},"end":{"line":196,"column":3}},"3":{"start":{"line":32,"column":8},"end":{"line":33,"column":48}},"4":{"start":{"line":35,"column":8},"end":{"line":39,"column":11}},"5":{"start":{"line":36,"column":12},"end":{"line":38,"column":15}},"6":{"start":{"line":52,"column":8},"end":{"line":52,"column":60}},"7":{"start":{"line":69,"column":8},"end":{"line":73,"column":11}},"8":{"start":{"line":70,"column":12},"end":{"line":72,"column":15}},"9":{"start":{"line":86,"column":8},"end":{"line":86,"column":62}},"10":{"start":{"line":103,"column":8},"end":{"line":108,"column":11}},"11":{"start":{"line":104,"column":12},"end":{"line":107,"column":15}},"12":{"start":{"line":121,"column":8},"end":{"line":121,"column":61}},"13":{"start":{"line":139,"column":8},"end":{"line":141,"column":11}},"14":{"start":{"line":143,"column":8},"end":{"line":147,"column":11}},"15":{"start":{"line":144,"column":12},"end":{"line":146,"column":15}},"16":{"start":{"line":160,"column":8},"end":{"line":160,"column":63}},"17":{"start":{"line":177,"column":8},"end":{"line":181,"column":11}},"18":{"start":{"line":178,"column":12},"end":{"line":180,"column":15}},"19":{"start":{"line":194,"column":8},"end":{"line":194,"column":60}}},"branchMap":{"1":{"line":32,"type":"cond-expr","locations":[{"start":{"line":32,"column":56},"end":{"line":32,"column":61}},{"start":{"line":33,"column":16},"end":{"line":33,"column":35}}]}},"code":["(function () { YUI.add('autocomplete-highlighters', function (Y, NAME) {","","/**","Provides pre-built result highlighters for AutoComplete.","","@module autocomplete","@submodule autocomplete-highlighters","@class AutoCompleteHighlighters","@static","**/","","var YArray = Y.Array,"," Highlight = Y.Highlight,","","Highlighters = Y.mix(Y.namespace('AutoCompleteHighlighters'), {"," // -- Public Methods -------------------------------------------------------",""," /**"," Highlights any individual query character that occurs anywhere in a result."," Case-insensitive.",""," @method charMatch"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," charMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // charMatchCase(). It's intentionally undocumented.",""," var queryChars = YArray.unique((caseSensitive ? query :"," query.toLowerCase()).split(''));",""," return YArray.map(results, function (result) {"," return Highlight.all(result.text, queryChars, {"," caseSensitive: caseSensitive"," });"," });"," },",""," /**"," Case-sensitive version of `charMatch()`.",""," @method charMatchCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," charMatchCase: function (query, results) {"," return Highlighters.charMatch(query, results, true);"," },",""," /**"," Highlights the complete query as a phrase anywhere within a result. Case-"," insensitive.",""," @method phraseMatch"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," phraseMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // phraseMatchCase(). It's intentionally undocumented.",""," return YArray.map(results, function (result) {"," return Highlight.all(result.text, [query], {"," caseSensitive: caseSensitive"," });"," });"," },",""," /**"," Case-sensitive version of `phraseMatch()`.",""," @method phraseMatchCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," phraseMatchCase: function (query, results) {"," return Highlighters.phraseMatch(query, results, true);"," },",""," /**"," Highlights the complete query as a phrase at the beginning of a result."," Case-insensitive.",""," @method startsWith"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," startsWith: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // startsWithCase(). It's intentionally undocumented.",""," return YArray.map(results, function (result) {"," return Highlight.all(result.text, [query], {"," caseSensitive: caseSensitive,"," startsWith : true"," });"," });"," },",""," /**"," Case-sensitive version of `startsWith()`.",""," @method startsWithCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," startsWithCase: function (query, results) {"," return Highlighters.startsWith(query, results, true);"," },",""," /**"," Highlights portions of results in which words from the query match either"," whole words or parts of words in the result. Non-word characters like"," whitespace and certain punctuation are ignored. Case-insensitive.",""," @method subWordMatch"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," subWordMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // subWordMatchCase(). It's intentionally undocumented.",""," var queryWords = Y.Text.WordBreak.getUniqueWords(query, {"," ignoreCase: !caseSensitive"," });",""," return YArray.map(results, function (result) {"," return Highlight.all(result.text, queryWords, {"," caseSensitive: caseSensitive"," });"," });"," },",""," /**"," Case-sensitive version of `subWordMatch()`.",""," @method subWordMatchCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," subWordMatchCase: function (query, results) {"," return Highlighters.subWordMatch(query, results, true);"," },",""," /**"," Highlights individual words in results that are also in the query. Non-word"," characters like punctuation are ignored. Case-insensitive.",""," @method wordMatch"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," wordMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // wordMatchCase(). It's intentionally undocumented.",""," return YArray.map(results, function (result) {"," return Highlight.words(result.text, query, {"," caseSensitive: caseSensitive"," });"," });"," },",""," /**"," Case-sensitive version of `wordMatch()`.",""," @method wordMatchCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," wordMatchCase: function (query, results) {"," return Highlighters.wordMatch(query, results, true);"," }","});","","","}, '3.17.2', {\"requires\": [\"array-extras\", \"highlight-base\"]});","","}());"]};
}
var __cov_XrxKjJ9Q4XlOD8JIkFkjmg = __coverage__['build/autocomplete-highlighters/autocomplete-highlighters.js'];
__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['1']++;YUI.add('autocomplete-highlighters',function(Y,NAME){__cov_XrxKjJ9Q4XlOD8JIkFkjmg.f['1']++;__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['2']++;var YArray=Y.Array,Highlight=Y.Highlight,Highlighters=Y.mix(Y.namespace('AutoCompleteHighlighters'),{charMatch:function(query,results,caseSensitive){__cov_XrxKjJ9Q4XlOD8JIkFkjmg.f['2']++;__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['3']++;var queryChars=YArray.unique((caseSensitive?(__cov_XrxKjJ9Q4XlOD8JIkFkjmg.b['1'][0]++,query):(__cov_XrxKjJ9Q4XlOD8JIkFkjmg.b['1'][1]++,query.toLowerCase())).split(''));__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['4']++;return YArray.map(results,function(result){__cov_XrxKjJ9Q4XlOD8JIkFkjmg.f['3']++;__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['5']++;return Highlight.all(result.text,queryChars,{caseSensitive:caseSensitive});});},charMatchCase:function(query,results){__cov_XrxKjJ9Q4XlOD8JIkFkjmg.f['4']++;__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['6']++;return Highlighters.charMatch(query,results,true);},phraseMatch:function(query,results,caseSensitive){__cov_XrxKjJ9Q4XlOD8JIkFkjmg.f['5']++;__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['7']++;return YArray.map(results,function(result){__cov_XrxKjJ9Q4XlOD8JIkFkjmg.f['6']++;__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['8']++;return Highlight.all(result.text,[query],{caseSensitive:caseSensitive});});},phraseMatchCase:function(query,results){__cov_XrxKjJ9Q4XlOD8JIkFkjmg.f['7']++;__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['9']++;return Highlighters.phraseMatch(query,results,true);},startsWith:function(query,results,caseSensitive){__cov_XrxKjJ9Q4XlOD8JIkFkjmg.f['8']++;__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['10']++;return YArray.map(results,function(result){__cov_XrxKjJ9Q4XlOD8JIkFkjmg.f['9']++;__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['11']++;return Highlight.all(result.text,[query],{caseSensitive:caseSensitive,startsWith:true});});},startsWithCase:function(query,results){__cov_XrxKjJ9Q4XlOD8JIkFkjmg.f['10']++;__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['12']++;return Highlighters.startsWith(query,results,true);},subWordMatch:function(query,results,caseSensitive){__cov_XrxKjJ9Q4XlOD8JIkFkjmg.f['11']++;__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['13']++;var queryWords=Y.Text.WordBreak.getUniqueWords(query,{ignoreCase:!caseSensitive});__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['14']++;return YArray.map(results,function(result){__cov_XrxKjJ9Q4XlOD8JIkFkjmg.f['12']++;__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['15']++;return Highlight.all(result.text,queryWords,{caseSensitive:caseSensitive});});},subWordMatchCase:function(query,results){__cov_XrxKjJ9Q4XlOD8JIkFkjmg.f['13']++;__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['16']++;return Highlighters.subWordMatch(query,results,true);},wordMatch:function(query,results,caseSensitive){__cov_XrxKjJ9Q4XlOD8JIkFkjmg.f['14']++;__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['17']++;return YArray.map(results,function(result){__cov_XrxKjJ9Q4XlOD8JIkFkjmg.f['15']++;__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['18']++;return Highlight.words(result.text,query,{caseSensitive:caseSensitive});});},wordMatchCase:function(query,results){__cov_XrxKjJ9Q4XlOD8JIkFkjmg.f['16']++;__cov_XrxKjJ9Q4XlOD8JIkFkjmg.s['19']++;return Highlighters.wordMatch(query,results,true);}});},'3.17.2',{'requires':['array-extras','highlight-base']});
|
viskin/cdnjs
|
ajax/libs/yui/3.17.2/autocomplete-highlighters/autocomplete-highlighters-coverage.js
|
JavaScript
|
mit
| 13,701 |
/*
YUI 3.17.2 (build 9c3c78e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/axis-numeric-base/axis-numeric-base.js']) {
__coverage__['build/axis-numeric-base/axis-numeric-base.js'] = {"path":"build/axis-numeric-base/axis-numeric-base.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"136":0,"137":0,"138":0,"139":0,"140":0,"141":0,"142":0,"143":0,"144":0,"145":0,"146":0,"147":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0,"154":0,"155":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"163":0,"164":0,"165":0,"166":0,"167":0,"168":0,"169":0,"170":0,"171":0,"172":0,"173":0,"174":0,"175":0,"176":0,"177":0,"178":0,"179":0,"180":0,"181":0,"182":0,"183":0,"184":0,"185":0,"186":0,"187":0,"188":0,"189":0,"190":0,"191":0,"192":0,"193":0,"194":0,"195":0,"196":0,"197":0,"198":0,"199":0,"200":0,"201":0,"202":0,"203":0,"204":0,"205":0,"206":0,"207":0,"208":0,"209":0,"210":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0],"30":[0,0],"31":[0,0],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[0,0],"37":[0,0],"38":[0,0],"39":[0,0],"40":[0,0],"41":[0,0],"42":[0,0,0],"43":[0,0],"44":[0,0],"45":[0,0],"46":[0,0],"47":[0,0,0],"48":[0,0],"49":[0,0],"50":[0,0],"51":[0,0],"52":[0,0],"53":[0,0],"54":[0,0],"55":[0,0],"56":[0,0,0],"57":[0,0],"58":[0,0],"59":[0,0],"60":[0,0],"61":[0,0],"62":[0,0],"63":[0,0],"64":[0,0],"65":[0,0],"66":[0,0],"67":[0,0],"68":[0,0],"69":[0,0],"70":[0,0],"71":[0,0],"72":[0,0],"73":[0,0],"74":[0,0],"75":[0,0],"76":[0,0],"77":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":48}}},"2":{"name":"NumericImpl","line":22,"loc":{"start":{"line":22,"column":0},"end":{"line":23,"column":0}}},"3":{"name":"(anonymous_3)","line":106,"loc":{"start":{"line":106,"column":17},"end":{"line":106,"column":28}}},"4":{"name":"(anonymous_4)","line":120,"loc":{"start":{"line":120,"column":17},"end":{"line":121,"column":4}}},"5":{"name":"(anonymous_5)","line":136,"loc":{"start":{"line":136,"column":19},"end":{"line":137,"column":4}}},"6":{"name":"(anonymous_6)","line":160,"loc":{"start":{"line":160,"column":15},"end":{"line":160,"column":26}}},"7":{"name":"(anonymous_7)","line":188,"loc":{"start":{"line":188,"column":20},"end":{"line":189,"column":4}}},"8":{"name":"(anonymous_8)","line":201,"loc":{"start":{"line":201,"column":20},"end":{"line":202,"column":4}}},"9":{"name":"(anonymous_9)","line":231,"loc":{"start":{"line":231,"column":22},"end":{"line":232,"column":4}}},"10":{"name":"(anonymous_10)","line":305,"loc":{"start":{"line":305,"column":21},"end":{"line":306,"column":4}}},"11":{"name":"(anonymous_11)","line":608,"loc":{"start":{"line":608,"column":21},"end":{"line":609,"column":4}}},"12":{"name":"(anonymous_12)","line":625,"loc":{"start":{"line":625,"column":23},"end":{"line":626,"column":4}}},"13":{"name":"(anonymous_13)","line":641,"loc":{"start":{"line":641,"column":25},"end":{"line":642,"column":4}}},"14":{"name":"(anonymous_14)","line":661,"loc":{"start":{"line":661,"column":24},"end":{"line":662,"column":4}}},"15":{"name":"(anonymous_15)","line":698,"loc":{"start":{"line":698,"column":23},"end":{"line":699,"column":4}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":721,"column":42}},"2":{"start":{"line":9,"column":0},"end":{"line":9,"column":20}},"3":{"start":{"line":22,"column":0},"end":{"line":24,"column":1}},"4":{"start":{"line":26,"column":0},"end":{"line":26,"column":33}},"5":{"start":{"line":28,"column":0},"end":{"line":99,"column":2}},"6":{"start":{"line":101,"column":0},"end":{"line":704,"column":2}},"7":{"start":{"line":107,"column":8},"end":{"line":107,"column":67}},"8":{"start":{"line":108,"column":8},"end":{"line":108,"column":67}},"9":{"start":{"line":109,"column":8},"end":{"line":109,"column":62}},"10":{"start":{"line":122,"column":8},"end":{"line":125,"column":9}},"11":{"start":{"line":124,"column":12},"end":{"line":124,"column":57}},"12":{"start":{"line":126,"column":8},"end":{"line":126,"column":19}},"13":{"start":{"line":138,"column":8},"end":{"line":142,"column":45}},"14":{"start":{"line":143,"column":8},"end":{"line":150,"column":9}},"15":{"start":{"line":145,"column":11},"end":{"line":145,"column":39}},"16":{"start":{"line":146,"column":11},"end":{"line":149,"column":12}},"17":{"start":{"line":148,"column":16},"end":{"line":148,"column":29}},"18":{"start":{"line":151,"column":8},"end":{"line":151,"column":21}},"19":{"start":{"line":161,"column":8},"end":{"line":163,"column":38}},"20":{"start":{"line":164,"column":8},"end":{"line":164,"column":39}},"21":{"start":{"line":165,"column":8},"end":{"line":165,"column":39}},"22":{"start":{"line":166,"column":8},"end":{"line":166,"column":22}},"23":{"start":{"line":190,"column":8},"end":{"line":190,"column":65}},"24":{"start":{"line":203,"column":8},"end":{"line":206,"column":24}},"25":{"start":{"line":208,"column":8},"end":{"line":216,"column":9}},"26":{"start":{"line":210,"column":12},"end":{"line":210,"column":104}},"27":{"start":{"line":211,"column":12},"end":{"line":211,"column":84}},"28":{"start":{"line":215,"column":12},"end":{"line":215,"column":45}},"29":{"start":{"line":217,"column":8},"end":{"line":220,"column":9}},"30":{"start":{"line":219,"column":12},"end":{"line":219,"column":33}},"31":{"start":{"line":221,"column":8},"end":{"line":221,"column":28}},"32":{"start":{"line":233,"column":8},"end":{"line":240,"column":40}},"33":{"start":{"line":241,"column":8},"end":{"line":294,"column":9}},"34":{"start":{"line":243,"column":12},"end":{"line":284,"column":13}},"35":{"start":{"line":245,"column":16},"end":{"line":245,"column":34}},"36":{"start":{"line":246,"column":16},"end":{"line":283,"column":17}},"37":{"start":{"line":248,"column":20},"end":{"line":248,"column":34}},"38":{"start":{"line":249,"column":20},"end":{"line":254,"column":21}},"39":{"start":{"line":251,"column":24},"end":{"line":251,"column":62}},"40":{"start":{"line":252,"column":24},"end":{"line":252,"column":62}},"41":{"start":{"line":253,"column":24},"end":{"line":253,"column":33}},"42":{"start":{"line":256,"column":20},"end":{"line":267,"column":21}},"43":{"start":{"line":258,"column":24},"end":{"line":258,"column":47}},"44":{"start":{"line":260,"column":25},"end":{"line":267,"column":21}},"45":{"start":{"line":262,"column":24},"end":{"line":262,"column":34}},"46":{"start":{"line":266,"column":24},"end":{"line":266,"column":49}},"47":{"start":{"line":268,"column":20},"end":{"line":279,"column":21}},"48":{"start":{"line":270,"column":24},"end":{"line":270,"column":47}},"49":{"start":{"line":272,"column":25},"end":{"line":279,"column":21}},"50":{"start":{"line":274,"column":24},"end":{"line":274,"column":34}},"51":{"start":{"line":278,"column":24},"end":{"line":278,"column":49}},"52":{"start":{"line":281,"column":20},"end":{"line":281,"column":46}},"53":{"start":{"line":282,"column":20},"end":{"line":282,"column":46}},"54":{"start":{"line":285,"column":12},"end":{"line":293,"column":13}},"55":{"start":{"line":287,"column":16},"end":{"line":287,"column":63}},"56":{"start":{"line":291,"column":16},"end":{"line":291,"column":40}},"57":{"start":{"line":292,"column":16},"end":{"line":292,"column":40}},"58":{"start":{"line":307,"column":8},"end":{"line":321,"column":49}},"59":{"start":{"line":322,"column":8},"end":{"line":593,"column":9}},"60":{"start":{"line":324,"column":12},"end":{"line":592,"column":13}},"61":{"start":{"line":326,"column":16},"end":{"line":326,"column":69}},"62":{"start":{"line":327,"column":16},"end":{"line":460,"column":17}},"63":{"start":{"line":329,"column":20},"end":{"line":337,"column":21}},"64":{"start":{"line":331,"column":24},"end":{"line":331,"column":32}},"65":{"start":{"line":332,"column":24},"end":{"line":332,"column":77}},"66":{"start":{"line":336,"column":23},"end":{"line":336,"column":73}},"67":{"start":{"line":338,"column":20},"end":{"line":352,"column":21}},"68":{"start":{"line":340,"column":24},"end":{"line":343,"column":25}},"69":{"start":{"line":342,"column":28},"end":{"line":342,"column":63}},"70":{"start":{"line":345,"column":25},"end":{"line":352,"column":21}},"71":{"start":{"line":347,"column":24},"end":{"line":347,"column":59}},"72":{"start":{"line":351,"column":24},"end":{"line":351,"column":72}},"73":{"start":{"line":354,"column":21},"end":{"line":460,"column":17}},"74":{"start":{"line":356,"column":20},"end":{"line":427,"column":21}},"75":{"start":{"line":358,"column":24},"end":{"line":358,"column":74}},"76":{"start":{"line":359,"column":24},"end":{"line":359,"column":78}},"77":{"start":{"line":360,"column":24},"end":{"line":360,"column":52}},"78":{"start":{"line":361,"column":24},"end":{"line":361,"column":60}},"79":{"start":{"line":362,"column":24},"end":{"line":362,"column":66}},"80":{"start":{"line":364,"column":24},"end":{"line":410,"column":25}},"81":{"start":{"line":366,"column":28},"end":{"line":372,"column":29}},"82":{"start":{"line":368,"column":32},"end":{"line":368,"column":43}},"83":{"start":{"line":369,"column":32},"end":{"line":369,"column":43}},"84":{"start":{"line":370,"column":32},"end":{"line":370,"column":68}},"85":{"start":{"line":371,"column":32},"end":{"line":371,"column":74}},"86":{"start":{"line":375,"column":28},"end":{"line":382,"column":29}},"87":{"start":{"line":377,"column":32},"end":{"line":377,"column":57}},"88":{"start":{"line":381,"column":32},"end":{"line":381,"column":67}},"89":{"start":{"line":384,"column":29},"end":{"line":410,"column":25}},"90":{"start":{"line":386,"column":28},"end":{"line":392,"column":29}},"91":{"start":{"line":388,"column":32},"end":{"line":388,"column":43}},"92":{"start":{"line":389,"column":32},"end":{"line":389,"column":43}},"93":{"start":{"line":390,"column":32},"end":{"line":390,"column":74}},"94":{"start":{"line":391,"column":32},"end":{"line":391,"column":68}},"95":{"start":{"line":395,"column":28},"end":{"line":402,"column":29}},"96":{"start":{"line":397,"column":32},"end":{"line":397,"column":62}},"97":{"start":{"line":401,"column":32},"end":{"line":401,"column":67}},"98":{"start":{"line":406,"column":28},"end":{"line":406,"column":70}},"99":{"start":{"line":407,"column":28},"end":{"line":407,"column":77}},"100":{"start":{"line":408,"column":28},"end":{"line":408,"column":58}},"101":{"start":{"line":409,"column":28},"end":{"line":409,"column":63}},"102":{"start":{"line":414,"column":24},"end":{"line":426,"column":25}},"103":{"start":{"line":416,"column":28},"end":{"line":416,"column":63}},"104":{"start":{"line":418,"column":29},"end":{"line":426,"column":25}},"105":{"start":{"line":420,"column":28},"end":{"line":420,"column":63}},"106":{"start":{"line":424,"column":28},"end":{"line":424,"column":78}},"107":{"start":{"line":425,"column":28},"end":{"line":425,"column":76}},"108":{"start":{"line":431,"column":20},"end":{"line":459,"column":21}},"109":{"start":{"line":433,"column":24},"end":{"line":440,"column":25}},"110":{"start":{"line":435,"column":28},"end":{"line":435,"column":36}},"111":{"start":{"line":439,"column":28},"end":{"line":439,"column":63}},"112":{"start":{"line":442,"column":25},"end":{"line":459,"column":21}},"113":{"start":{"line":444,"column":24},"end":{"line":454,"column":25}},"114":{"start":{"line":446,"column":28},"end":{"line":446,"column":36}},"115":{"start":{"line":447,"column":28},"end":{"line":447,"column":81}},"116":{"start":{"line":448,"column":28},"end":{"line":448,"column":63}},"117":{"start":{"line":452,"column":28},"end":{"line":452,"column":78}},"118":{"start":{"line":453,"column":28},"end":{"line":453,"column":76}},"119":{"start":{"line":458,"column":24},"end":{"line":458,"column":59}},"120":{"start":{"line":462,"column":17},"end":{"line":592,"column":13}},"121":{"start":{"line":464,"column":16},"end":{"line":546,"column":17}},"122":{"start":{"line":466,"column":20},"end":{"line":469,"column":21}},"123":{"start":{"line":468,"column":24},"end":{"line":468,"column":32}},"124":{"start":{"line":471,"column":20},"end":{"line":471,"column":53}},"125":{"start":{"line":472,"column":20},"end":{"line":481,"column":21}},"126":{"start":{"line":474,"column":24},"end":{"line":474,"column":63}},"127":{"start":{"line":475,"column":24},"end":{"line":475,"column":59}},"128":{"start":{"line":479,"column":24},"end":{"line":479,"column":84}},"129":{"start":{"line":483,"column":21},"end":{"line":546,"column":17}},"130":{"start":{"line":485,"column":20},"end":{"line":517,"column":21}},"131":{"start":{"line":487,"column":24},"end":{"line":487,"column":80}},"132":{"start":{"line":488,"column":24},"end":{"line":488,"column":78}},"133":{"start":{"line":489,"column":24},"end":{"line":489,"column":52}},"134":{"start":{"line":491,"column":24},"end":{"line":506,"column":25}},"135":{"start":{"line":493,"column":28},"end":{"line":493,"column":64}},"136":{"start":{"line":494,"column":28},"end":{"line":494,"column":70}},"137":{"start":{"line":495,"column":28},"end":{"line":495,"column":70}},"138":{"start":{"line":496,"column":28},"end":{"line":496,"column":58}},"139":{"start":{"line":497,"column":28},"end":{"line":497,"column":63}},"140":{"start":{"line":501,"column":28},"end":{"line":501,"column":51}},"141":{"start":{"line":502,"column":28},"end":{"line":502,"column":56}},"142":{"start":{"line":503,"column":28},"end":{"line":503,"column":70}},"143":{"start":{"line":504,"column":28},"end":{"line":504,"column":85}},"144":{"start":{"line":505,"column":28},"end":{"line":505,"column":90}},"145":{"start":{"line":510,"column":24},"end":{"line":510,"column":57}},"146":{"start":{"line":511,"column":24},"end":{"line":514,"column":25}},"147":{"start":{"line":513,"column":28},"end":{"line":513,"column":67}},"148":{"start":{"line":515,"column":24},"end":{"line":515,"column":102}},"149":{"start":{"line":516,"column":24},"end":{"line":516,"column":100}},"150":{"start":{"line":521,"column":20},"end":{"line":521,"column":53}},"151":{"start":{"line":522,"column":20},"end":{"line":525,"column":21}},"152":{"start":{"line":524,"column":24},"end":{"line":524,"column":63}},"153":{"start":{"line":526,"column":20},"end":{"line":544,"column":21}},"154":{"start":{"line":528,"column":24},"end":{"line":528,"column":32}},"155":{"start":{"line":529,"column":24},"end":{"line":529,"column":57}},"156":{"start":{"line":530,"column":24},"end":{"line":538,"column":25}},"157":{"start":{"line":532,"column":28},"end":{"line":532,"column":52}},"158":{"start":{"line":533,"column":28},"end":{"line":533,"column":63}},"159":{"start":{"line":537,"column":28},"end":{"line":537,"column":88}},"160":{"start":{"line":542,"column":24},"end":{"line":542,"column":74}},"161":{"start":{"line":543,"column":24},"end":{"line":543,"column":72}},"162":{"start":{"line":548,"column":17},"end":{"line":592,"column":13}},"163":{"start":{"line":550,"column":16},"end":{"line":550,"column":46}},"164":{"start":{"line":551,"column":16},"end":{"line":551,"column":52}},"165":{"start":{"line":552,"column":16},"end":{"line":552,"column":62}},"166":{"start":{"line":553,"column":16},"end":{"line":553,"column":71}},"167":{"start":{"line":554,"column":16},"end":{"line":554,"column":69}},"168":{"start":{"line":555,"column":16},"end":{"line":591,"column":17}},"169":{"start":{"line":557,"column":20},"end":{"line":557,"column":45}},"170":{"start":{"line":559,"column":21},"end":{"line":591,"column":17}},"171":{"start":{"line":561,"column":20},"end":{"line":561,"column":45}},"172":{"start":{"line":563,"column":21},"end":{"line":591,"column":17}},"173":{"start":{"line":565,"column":20},"end":{"line":572,"column":21}},"174":{"start":{"line":567,"column":24},"end":{"line":567,"column":32}},"175":{"start":{"line":571,"column":24},"end":{"line":571,"column":39}},"176":{"start":{"line":573,"column":20},"end":{"line":573,"column":45}},"177":{"start":{"line":575,"column":21},"end":{"line":591,"column":17}},"178":{"start":{"line":577,"column":20},"end":{"line":577,"column":35}},"179":{"start":{"line":578,"column":20},"end":{"line":578,"column":35}},"180":{"start":{"line":582,"column":20},"end":{"line":589,"column":21}},"181":{"start":{"line":584,"column":24},"end":{"line":584,"column":32}},"182":{"start":{"line":588,"column":24},"end":{"line":588,"column":39}},"183":{"start":{"line":590,"column":20},"end":{"line":590,"column":45}},"184":{"start":{"line":594,"column":8},"end":{"line":594,"column":32}},"185":{"start":{"line":595,"column":8},"end":{"line":595,"column":32}},"186":{"start":{"line":610,"column":8},"end":{"line":610,"column":31}},"187":{"start":{"line":611,"column":8},"end":{"line":611,"column":95}},"188":{"start":{"line":612,"column":8},"end":{"line":612,"column":57}},"189":{"start":{"line":627,"column":8},"end":{"line":627,"column":31}},"190":{"start":{"line":628,"column":8},"end":{"line":628,"column":81}},"191":{"start":{"line":643,"column":8},"end":{"line":643,"column":31}},"192":{"start":{"line":644,"column":8},"end":{"line":644,"column":82}},"193":{"start":{"line":663,"column":8},"end":{"line":666,"column":39}},"194":{"start":{"line":667,"column":8},"end":{"line":667,"column":42}},"195":{"start":{"line":668,"column":8},"end":{"line":684,"column":9}},"196":{"start":{"line":670,"column":12},"end":{"line":675,"column":13}},"197":{"start":{"line":672,"column":16},"end":{"line":672,"column":36}},"198":{"start":{"line":673,"column":16},"end":{"line":673,"column":36}},"199":{"start":{"line":674,"column":16},"end":{"line":674,"column":48}},"200":{"start":{"line":676,"column":12},"end":{"line":676,"column":30}},"201":{"start":{"line":677,"column":12},"end":{"line":677,"column":38}},"202":{"start":{"line":678,"column":12},"end":{"line":678,"column":56}},"203":{"start":{"line":679,"column":12},"end":{"line":679,"column":77}},"204":{"start":{"line":683,"column":12},"end":{"line":683,"column":29}},"205":{"start":{"line":685,"column":8},"end":{"line":685,"column":26}},"206":{"start":{"line":700,"column":8},"end":{"line":700,"column":35}},"207":{"start":{"line":701,"column":8},"end":{"line":701,"column":52}},"208":{"start":{"line":702,"column":8},"end":{"line":702,"column":66}},"209":{"start":{"line":706,"column":0},"end":{"line":706,"column":28}},"210":{"start":{"line":718,"column":0},"end":{"line":718,"column":82}}},"branchMap":{"1":{"line":122,"type":"if","locations":[{"start":{"line":122,"column":8},"end":{"line":122,"column":8}},{"start":{"line":122,"column":8},"end":{"line":122,"column":8}}]},"2":{"line":142,"type":"cond-expr","locations":[{"start":{"line":142,"column":27},"end":{"line":142,"column":40}},{"start":{"line":142,"column":43},"end":{"line":142,"column":44}}]},"3":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":11},"end":{"line":146,"column":11}},{"start":{"line":146,"column":11},"end":{"line":146,"column":11}}]},"4":{"line":208,"type":"if","locations":[{"start":{"line":208,"column":8},"end":{"line":208,"column":8}},{"start":{"line":208,"column":8},"end":{"line":208,"column":8}}]},"5":{"line":217,"type":"if","locations":[{"start":{"line":217,"column":8},"end":{"line":217,"column":8}},{"start":{"line":217,"column":8},"end":{"line":217,"column":8}}]},"6":{"line":241,"type":"if","locations":[{"start":{"line":241,"column":8},"end":{"line":241,"column":8}},{"start":{"line":241,"column":8},"end":{"line":241,"column":8}}]},"7":{"line":241,"type":"binary-expr","locations":[{"start":{"line":241,"column":11},"end":{"line":241,"column":18}},{"start":{"line":241,"column":22},"end":{"line":241,"column":29}}]},"8":{"line":243,"type":"if","locations":[{"start":{"line":243,"column":12},"end":{"line":243,"column":12}},{"start":{"line":243,"column":12},"end":{"line":243,"column":12}}]},"9":{"line":243,"type":"binary-expr","locations":[{"start":{"line":243,"column":15},"end":{"line":243,"column":19}},{"start":{"line":243,"column":23},"end":{"line":243,"column":34}},{"start":{"line":243,"column":38},"end":{"line":243,"column":53}}]},"10":{"line":249,"type":"if","locations":[{"start":{"line":249,"column":20},"end":{"line":249,"column":20}},{"start":{"line":249,"column":20},"end":{"line":249,"column":20}}]},"11":{"line":251,"type":"cond-expr","locations":[{"start":{"line":251,"column":39},"end":{"line":251,"column":55}},{"start":{"line":251,"column":58},"end":{"line":251,"column":61}}]},"12":{"line":252,"type":"cond-expr","locations":[{"start":{"line":252,"column":39},"end":{"line":252,"column":55}},{"start":{"line":252,"column":58},"end":{"line":252,"column":61}}]},"13":{"line":256,"type":"if","locations":[{"start":{"line":256,"column":20},"end":{"line":256,"column":20}},{"start":{"line":256,"column":20},"end":{"line":256,"column":20}}]},"14":{"line":260,"type":"if","locations":[{"start":{"line":260,"column":25},"end":{"line":260,"column":25}},{"start":{"line":260,"column":25},"end":{"line":260,"column":25}}]},"15":{"line":268,"type":"if","locations":[{"start":{"line":268,"column":20},"end":{"line":268,"column":20}},{"start":{"line":268,"column":20},"end":{"line":268,"column":20}}]},"16":{"line":272,"type":"if","locations":[{"start":{"line":272,"column":25},"end":{"line":272,"column":25}},{"start":{"line":272,"column":25},"end":{"line":272,"column":25}}]},"17":{"line":285,"type":"if","locations":[{"start":{"line":285,"column":12},"end":{"line":285,"column":12}},{"start":{"line":285,"column":12},"end":{"line":285,"column":12}}]},"18":{"line":322,"type":"if","locations":[{"start":{"line":322,"column":8},"end":{"line":322,"column":8}},{"start":{"line":322,"column":8},"end":{"line":322,"column":8}}]},"19":{"line":324,"type":"if","locations":[{"start":{"line":324,"column":12},"end":{"line":324,"column":12}},{"start":{"line":324,"column":12},"end":{"line":324,"column":12}}]},"20":{"line":327,"type":"if","locations":[{"start":{"line":327,"column":16},"end":{"line":327,"column":16}},{"start":{"line":327,"column":16},"end":{"line":327,"column":16}}]},"21":{"line":327,"type":"binary-expr","locations":[{"start":{"line":327,"column":19},"end":{"line":327,"column":37}},{"start":{"line":327,"column":41},"end":{"line":327,"column":59}}]},"22":{"line":329,"type":"if","locations":[{"start":{"line":329,"column":20},"end":{"line":329,"column":20}},{"start":{"line":329,"column":20},"end":{"line":329,"column":20}}]},"23":{"line":329,"type":"binary-expr","locations":[{"start":{"line":329,"column":24},"end":{"line":329,"column":38}},{"start":{"line":329,"column":42},"end":{"line":329,"column":60}},{"start":{"line":329,"column":65},"end":{"line":329,"column":72}}]},"24":{"line":338,"type":"if","locations":[{"start":{"line":338,"column":20},"end":{"line":338,"column":20}},{"start":{"line":338,"column":20},"end":{"line":338,"column":20}}]},"25":{"line":340,"type":"if","locations":[{"start":{"line":340,"column":24},"end":{"line":340,"column":24}},{"start":{"line":340,"column":24},"end":{"line":340,"column":24}}]},"26":{"line":345,"type":"if","locations":[{"start":{"line":345,"column":25},"end":{"line":345,"column":25}},{"start":{"line":345,"column":25},"end":{"line":345,"column":25}}]},"27":{"line":354,"type":"if","locations":[{"start":{"line":354,"column":21},"end":{"line":354,"column":21}},{"start":{"line":354,"column":21},"end":{"line":354,"column":21}}]},"28":{"line":354,"type":"binary-expr","locations":[{"start":{"line":354,"column":24},"end":{"line":354,"column":42}},{"start":{"line":354,"column":46},"end":{"line":354,"column":65}}]},"29":{"line":356,"type":"if","locations":[{"start":{"line":356,"column":20},"end":{"line":356,"column":20}},{"start":{"line":356,"column":20},"end":{"line":356,"column":20}}]},"30":{"line":364,"type":"if","locations":[{"start":{"line":364,"column":24},"end":{"line":364,"column":24}},{"start":{"line":364,"column":24},"end":{"line":364,"column":24}}]},"31":{"line":366,"type":"binary-expr","locations":[{"start":{"line":366,"column":34},"end":{"line":366,"column":51}},{"start":{"line":366,"column":55},"end":{"line":366,"column":68}}]},"32":{"line":375,"type":"if","locations":[{"start":{"line":375,"column":28},"end":{"line":375,"column":28}},{"start":{"line":375,"column":28},"end":{"line":375,"column":28}}]},"33":{"line":384,"type":"if","locations":[{"start":{"line":384,"column":29},"end":{"line":384,"column":29}},{"start":{"line":384,"column":29},"end":{"line":384,"column":29}}]},"34":{"line":386,"type":"binary-expr","locations":[{"start":{"line":386,"column":34},"end":{"line":386,"column":51}},{"start":{"line":386,"column":55},"end":{"line":386,"column":68}}]},"35":{"line":395,"type":"if","locations":[{"start":{"line":395,"column":28},"end":{"line":395,"column":28}},{"start":{"line":395,"column":28},"end":{"line":395,"column":28}}]},"36":{"line":414,"type":"if","locations":[{"start":{"line":414,"column":24},"end":{"line":414,"column":24}},{"start":{"line":414,"column":24},"end":{"line":414,"column":24}}]},"37":{"line":418,"type":"if","locations":[{"start":{"line":418,"column":29},"end":{"line":418,"column":29}},{"start":{"line":418,"column":29},"end":{"line":418,"column":29}}]},"38":{"line":431,"type":"if","locations":[{"start":{"line":431,"column":20},"end":{"line":431,"column":20}},{"start":{"line":431,"column":20},"end":{"line":431,"column":20}}]},"39":{"line":433,"type":"if","locations":[{"start":{"line":433,"column":24},"end":{"line":433,"column":24}},{"start":{"line":433,"column":24},"end":{"line":433,"column":24}}]},"40":{"line":442,"type":"if","locations":[{"start":{"line":442,"column":25},"end":{"line":442,"column":25}},{"start":{"line":442,"column":25},"end":{"line":442,"column":25}}]},"41":{"line":444,"type":"if","locations":[{"start":{"line":444,"column":24},"end":{"line":444,"column":24}},{"start":{"line":444,"column":24},"end":{"line":444,"column":24}}]},"42":{"line":444,"type":"binary-expr","locations":[{"start":{"line":444,"column":27},"end":{"line":444,"column":41}},{"start":{"line":444,"column":45},"end":{"line":444,"column":54}},{"start":{"line":444,"column":58},"end":{"line":444,"column":80}}]},"43":{"line":462,"type":"if","locations":[{"start":{"line":462,"column":17},"end":{"line":462,"column":17}},{"start":{"line":462,"column":17},"end":{"line":462,"column":17}}]},"44":{"line":464,"type":"if","locations":[{"start":{"line":464,"column":16},"end":{"line":464,"column":16}},{"start":{"line":464,"column":16},"end":{"line":464,"column":16}}]},"45":{"line":464,"type":"binary-expr","locations":[{"start":{"line":464,"column":19},"end":{"line":464,"column":37}},{"start":{"line":464,"column":41},"end":{"line":464,"column":59}}]},"46":{"line":466,"type":"if","locations":[{"start":{"line":466,"column":20},"end":{"line":466,"column":20}},{"start":{"line":466,"column":20},"end":{"line":466,"column":20}}]},"47":{"line":466,"type":"binary-expr","locations":[{"start":{"line":466,"column":24},"end":{"line":466,"column":38}},{"start":{"line":466,"column":42},"end":{"line":466,"column":63}},{"start":{"line":466,"column":68},"end":{"line":466,"column":75}}]},"48":{"line":472,"type":"if","locations":[{"start":{"line":472,"column":20},"end":{"line":472,"column":20}},{"start":{"line":472,"column":20},"end":{"line":472,"column":20}}]},"49":{"line":483,"type":"if","locations":[{"start":{"line":483,"column":21},"end":{"line":483,"column":21}},{"start":{"line":483,"column":21},"end":{"line":483,"column":21}}]},"50":{"line":483,"type":"binary-expr","locations":[{"start":{"line":483,"column":24},"end":{"line":483,"column":42}},{"start":{"line":483,"column":46},"end":{"line":483,"column":65}}]},"51":{"line":485,"type":"if","locations":[{"start":{"line":485,"column":20},"end":{"line":485,"column":20}},{"start":{"line":485,"column":20},"end":{"line":485,"column":20}}]},"52":{"line":491,"type":"if","locations":[{"start":{"line":491,"column":24},"end":{"line":491,"column":24}},{"start":{"line":491,"column":24},"end":{"line":491,"column":24}}]},"53":{"line":511,"type":"if","locations":[{"start":{"line":511,"column":24},"end":{"line":511,"column":24}},{"start":{"line":511,"column":24},"end":{"line":511,"column":24}}]},"54":{"line":522,"type":"if","locations":[{"start":{"line":522,"column":20},"end":{"line":522,"column":20}},{"start":{"line":522,"column":20},"end":{"line":522,"column":20}}]},"55":{"line":526,"type":"if","locations":[{"start":{"line":526,"column":20},"end":{"line":526,"column":20}},{"start":{"line":526,"column":20},"end":{"line":526,"column":20}}]},"56":{"line":526,"type":"binary-expr","locations":[{"start":{"line":526,"column":23},"end":{"line":526,"column":37}},{"start":{"line":526,"column":41},"end":{"line":526,"column":50}},{"start":{"line":526,"column":54},"end":{"line":526,"column":76}}]},"57":{"line":530,"type":"if","locations":[{"start":{"line":530,"column":24},"end":{"line":530,"column":24}},{"start":{"line":530,"column":24},"end":{"line":530,"column":24}}]},"58":{"line":548,"type":"if","locations":[{"start":{"line":548,"column":17},"end":{"line":548,"column":17}},{"start":{"line":548,"column":17},"end":{"line":548,"column":17}}]},"59":{"line":548,"type":"binary-expr","locations":[{"start":{"line":548,"column":20},"end":{"line":548,"column":42}},{"start":{"line":548,"column":46},"end":{"line":548,"column":70}}]},"60":{"line":555,"type":"if","locations":[{"start":{"line":555,"column":16},"end":{"line":555,"column":16}},{"start":{"line":555,"column":16},"end":{"line":555,"column":16}}]},"61":{"line":559,"type":"if","locations":[{"start":{"line":559,"column":21},"end":{"line":559,"column":21}},{"start":{"line":559,"column":21},"end":{"line":559,"column":21}}]},"62":{"line":563,"type":"if","locations":[{"start":{"line":563,"column":21},"end":{"line":563,"column":21}},{"start":{"line":563,"column":21},"end":{"line":563,"column":21}}]},"63":{"line":563,"type":"binary-expr","locations":[{"start":{"line":563,"column":24},"end":{"line":563,"column":42}},{"start":{"line":563,"column":46},"end":{"line":563,"column":64}}]},"64":{"line":565,"type":"if","locations":[{"start":{"line":565,"column":20},"end":{"line":565,"column":20}},{"start":{"line":565,"column":20},"end":{"line":565,"column":20}}]},"65":{"line":565,"type":"binary-expr","locations":[{"start":{"line":565,"column":23},"end":{"line":565,"column":37}},{"start":{"line":565,"column":41},"end":{"line":565,"column":54}}]},"66":{"line":575,"type":"if","locations":[{"start":{"line":575,"column":21},"end":{"line":575,"column":21}},{"start":{"line":575,"column":21},"end":{"line":575,"column":21}}]},"67":{"line":575,"type":"binary-expr","locations":[{"start":{"line":575,"column":24},"end":{"line":575,"column":42}},{"start":{"line":575,"column":46},"end":{"line":575,"column":65}}]},"68":{"line":582,"type":"if","locations":[{"start":{"line":582,"column":20},"end":{"line":582,"column":20}},{"start":{"line":582,"column":20},"end":{"line":582,"column":20}}]},"69":{"line":582,"type":"binary-expr","locations":[{"start":{"line":582,"column":23},"end":{"line":582,"column":37}},{"start":{"line":582,"column":41},"end":{"line":582,"column":54}}]},"70":{"line":610,"type":"binary-expr","locations":[{"start":{"line":610,"column":18},"end":{"line":610,"column":25}},{"start":{"line":610,"column":29},"end":{"line":610,"column":30}}]},"71":{"line":627,"type":"binary-expr","locations":[{"start":{"line":627,"column":18},"end":{"line":627,"column":25}},{"start":{"line":627,"column":29},"end":{"line":627,"column":30}}]},"72":{"line":643,"type":"binary-expr","locations":[{"start":{"line":643,"column":18},"end":{"line":643,"column":25}},{"start":{"line":643,"column":29},"end":{"line":643,"column":30}}]},"73":{"line":668,"type":"if","locations":[{"start":{"line":668,"column":8},"end":{"line":668,"column":8}},{"start":{"line":668,"column":8},"end":{"line":668,"column":8}}]},"74":{"line":670,"type":"if","locations":[{"start":{"line":670,"column":12},"end":{"line":670,"column":12}},{"start":{"line":670,"column":12},"end":{"line":670,"column":12}}]},"75":{"line":670,"type":"binary-expr","locations":[{"start":{"line":670,"column":15},"end":{"line":670,"column":54}},{"start":{"line":670,"column":58},"end":{"line":670,"column":65}}]},"76":{"line":679,"type":"cond-expr","locations":[{"start":{"line":679,"column":35},"end":{"line":679,"column":54}},{"start":{"line":679,"column":57},"end":{"line":679,"column":76}}]},"77":{"line":700,"type":"binary-expr","locations":[{"start":{"line":700,"column":20},"end":{"line":700,"column":29}},{"start":{"line":700,"column":33},"end":{"line":700,"column":34}}]}},"code":["(function () { YUI.add('axis-numeric-base', function (Y, NAME) {","","/**"," * Provides functionality for the handling of numeric axis data for a chart."," *"," * @module charts"," * @submodule axis-numeric-base"," */","var Y_Lang = Y.Lang;","","/**"," * NumericImpl contains logic for numeric data. NumericImpl is used by the following classes:"," * <ul>"," * <li>{{#crossLink \"NumericAxisBase\"}}{{/crossLink}}</li>"," * <li>{{#crossLink \"NumericAxis\"}}{{/crossLink}}</li>"," * </ul>"," *"," * @class NumericImpl"," * @constructor"," * @submodule axis-numeric-base"," */","function NumericImpl()","{","}","","NumericImpl.NAME = \"numericImpl\";","","NumericImpl.ATTRS = {"," /**"," * Indicates whether 0 should always be displayed."," *"," * @attribute alwaysShowZero"," * @type Boolean"," */"," alwaysShowZero: {"," value: true"," },",""," /**"," * Method used for formatting a label. This attribute allows for the default label formatting method to overridden."," * The method use would need to implement the arguments below and return a `String` or an `HTMLElement`. The default"," * implementation of the method returns a `String`. The output of this method will be rendered to the DOM using"," * `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override"," * the Data' `appendLabelFunction` to accept html as a `String`."," * <dl>"," * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>"," * <dt>format</dt><dd>Object containing properties used to format the label. (optional)</dd>"," * </dl>"," *"," * @attribute labelFunction"," * @type Function"," */",""," /**"," * Object containing properties used by the `labelFunction` to format a"," * label."," *"," * @attribute labelFormat"," * @type Object"," */"," labelFormat: {"," value: {"," prefix: \"\","," thousandsSeparator: \"\","," decimalSeparator: \"\","," decimalPlaces: \"0\","," suffix: \"\""," }"," },",""," /**"," *Indicates how to round unit values."," * <dl>"," * <dt>niceNumber</dt><dd>Units will be smoothed based on the number of ticks and data range.</dd>"," * <dt>auto</dt><dd>If the range is greater than 1, the units will be rounded.</dd>"," * <dt>numeric value</dt><dd>Units will be equal to the numeric value.</dd>"," * <dt>null</dt><dd>No rounding will occur.</dd>"," * </dl>"," *"," * @attribute roundingMethod"," * @type String"," * @default niceNumber"," */"," roundingMethod: {"," value: \"niceNumber\""," },",""," /**"," * Indicates the scaling for the chart. The default value is `linear`. For a logarithmic axis, set the value"," * to `logarithmic`."," *"," * @attribute"," * @type String"," * @default linear"," */"," scaleType: {"," value: \"linear\""," }","};","","NumericImpl.prototype = {"," /**"," * @method initializer"," * @private"," */"," initializer: function() {"," this.after(\"alwaysShowZeroChange\", this._keyChangeHandler);"," this.after(\"roundingMethodChange\", this._keyChangeHandler);"," this.after(\"scaleTypeChange\", this._keyChangeHandler);"," },",""," /**"," * Formats a label based on the axis type and optionally specified format."," *"," * @method"," * @param {Object} value"," * @param {Object} format Pattern used to format the value."," * @return String"," */"," formatLabel: function(val, format)"," {"," if(format)"," {"," return Y.DataType.Number.format(val, format);"," }"," return val;"," },",""," /**"," * Returns the sum of all values per key."," *"," * @method getTotalByKey"," * @param {String} key The identifier for the array whose values will be calculated."," * @return Number"," */"," getTotalByKey: function(key)"," {"," var total = 0,"," values = this.getDataByKey(key),"," i = 0,"," val,"," len = values ? values.length : 0;"," for(; i < len; ++i)"," {"," val = parseFloat(values[i]);"," if(!isNaN(val))"," {"," total += val;"," }"," }"," return total;"," },",""," /**"," * Returns the value corresponding to the origin on the axis."," *"," * @method getOrigin"," * @return Number"," */"," getOrigin: function() {"," var origin = 0,"," min = this.get(\"minimum\"),"," max = this.get(\"maximum\");"," origin = Math.max(origin, min);"," origin = Math.min(origin, max);"," return origin;"," },",""," /**"," * Type of data used in `Data`."," *"," * @property _type"," * @readOnly"," * @private"," */"," _type: \"numeric\",",""," /**"," * Helper method for getting a `roundingUnit` when calculating the minimum and maximum values."," *"," * @method _getMinimumUnit"," * @param {Number} max Maximum number"," * @param {Number} min Minimum number"," * @param {Number} units Number of units on the axis"," * @return Number"," * @private"," */"," _getMinimumUnit:function(max, min, units)"," {"," return this._getNiceNumber(Math.ceil((max - min)/units));"," },",""," /**"," * Calculates a nice rounding unit based on the range."," *"," * @method _getNiceNumber"," * @param {Number} roundingUnit The calculated rounding unit."," * @return Number"," * @private"," */"," _getNiceNumber: function(roundingUnit)"," {"," var tempMajorUnit = roundingUnit,"," order = Math.ceil(Math.log(tempMajorUnit) * 0.4342944819032518),"," roundedMajorUnit = Math.pow(10, order),"," roundedDiff;",""," if (roundedMajorUnit / 2 >= tempMajorUnit)"," {"," roundedDiff = Math.floor((roundedMajorUnit / 2 - tempMajorUnit) / (Math.pow(10,order-1)/2));"," tempMajorUnit = roundedMajorUnit/2 - roundedDiff*Math.pow(10,order-1)/2;"," }"," else"," {"," tempMajorUnit = roundedMajorUnit;"," }"," if(!isNaN(tempMajorUnit))"," {"," return tempMajorUnit;"," }"," return roundingUnit;",""," },",""," /**"," * Calculates the maximum and minimum values for the `Data`."," *"," * @method _updateMinAndMax"," * @private"," */"," _updateMinAndMax: function()"," {"," var data = this.get(\"data\"),"," max,"," min,"," len,"," num,"," i = 0,"," setMax = this.get(\"setMax\"),"," setMin = this.get(\"setMin\");"," if(!setMax || !setMin)"," {"," if(data && data.length && data.length > 0)"," {"," len = data.length;"," for(; i < len; i++)"," {"," num = data[i];"," if(isNaN(num))"," {"," max = setMax ? this._setMaximum : max;"," min = setMin ? this._setMinimum : min;"," continue;"," }",""," if(setMin)"," {"," min = this._setMinimum;"," }"," else if(min === undefined)"," {"," min = num;"," }"," else"," {"," min = Math.min(num, min);"," }"," if(setMax)"," {"," max = this._setMaximum;"," }"," else if(max === undefined)"," {"," max = num;"," }"," else"," {"," max = Math.max(num, max);"," }",""," this._actualMaximum = max;"," this._actualMinimum = min;"," }"," }"," if(this.get(\"scaleType\") !== \"logarithmic\")"," {"," this._roundMinAndMax(min, max, setMin, setMax);"," }"," else"," {"," this._dataMaximum = max;"," this._dataMinimum = min;"," }"," }"," },",""," /**"," * Rounds the mimimum and maximum values based on the `roundingUnit` attribute."," *"," * @method _roundMinAndMax"," * @param {Number} min Minimum value"," * @param {Number} max Maximum value"," * @private"," */"," _roundMinAndMax: function(min, max, setMin, setMax)"," {"," var roundingUnit,"," minimumRange,"," minGreaterThanZero = min >= 0,"," maxGreaterThanZero = max > 0,"," dataRangeGreater,"," maxRound,"," minRound,"," topTicks,"," botTicks,"," tempMax,"," tempMin,"," units = this.getTotalMajorUnits() - 1,"," alwaysShowZero = this.get(\"alwaysShowZero\"),"," roundingMethod = this.get(\"roundingMethod\"),"," useIntegers = (max - min)/units >= 1;"," if(roundingMethod)"," {"," if(roundingMethod === \"niceNumber\")"," {"," roundingUnit = this._getMinimumUnit(max, min, units);"," if(minGreaterThanZero && maxGreaterThanZero)"," {"," if((alwaysShowZero || min < roundingUnit) && !setMin)"," {"," min = 0;"," roundingUnit = this._getMinimumUnit(max, min, units);"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," }"," if(setMax)"," {"," if(!alwaysShowZero)"," {"," min = max - (roundingUnit * units);"," }"," }"," else if(setMin)"," {"," max = min + (roundingUnit * units);"," }"," else"," {"," max = this._roundUpToNearest(max, roundingUnit);"," }"," }"," else if(maxGreaterThanZero && !minGreaterThanZero)"," {"," if(alwaysShowZero)"," {"," topTicks = Math.round(units/((-1 * min)/max + 1));"," topTicks = Math.max(Math.min(topTicks, units - 1), 1);"," botTicks = units - topTicks;"," tempMax = Math.ceil( max/topTicks );"," tempMin = Math.floor( min/botTicks ) * -1;",""," if(setMin)"," {"," while(tempMin < tempMax && botTicks >= 0)"," {"," botTicks--;"," topTicks++;"," tempMax = Math.ceil( max/topTicks );"," tempMin = Math.floor( min/botTicks ) * -1;"," }"," //if there are any bottom ticks left calcualate the maximum by multiplying by the tempMin value"," //if not, it's impossible to ensure that a zero is shown. skip it"," if(botTicks > 0)"," {"," max = tempMin * topTicks;"," }"," else"," {"," max = min + (roundingUnit * units);"," }"," }"," else if(setMax)"," {"," while(tempMax < tempMin && topTicks >= 0)"," {"," botTicks++;"," topTicks--;"," tempMin = Math.floor( min/botTicks ) * -1;"," tempMax = Math.ceil( max/topTicks );"," }"," //if there are any top ticks left calcualate the minimum by multiplying by the tempMax value"," //if not, it's impossible to ensure that a zero is shown. skip it"," if(topTicks > 0)"," {"," min = tempMax * botTicks * -1;"," }"," else"," {"," min = max - (roundingUnit * units);"," }"," }"," else"," {"," roundingUnit = Math.max(tempMax, tempMin);"," roundingUnit = this._getNiceNumber(roundingUnit);"," max = roundingUnit * topTicks;"," min = roundingUnit * botTicks * -1;"," }"," }"," else"," {"," if(setMax)"," {"," min = max - (roundingUnit * units);"," }"," else if(setMin)"," {"," max = min + (roundingUnit * units);"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," max = this._roundUpToNearest(max, roundingUnit);"," }"," }"," }"," else"," {"," if(setMin)"," {"," if(alwaysShowZero)"," {"," max = 0;"," }"," else"," {"," max = min + (roundingUnit * units);"," }"," }"," else if(!setMax)"," {"," if(alwaysShowZero || max === 0 || max + roundingUnit > 0)"," {"," max = 0;"," roundingUnit = this._getMinimumUnit(max, min, units);"," min = max - (roundingUnit * units);"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," max = this._roundUpToNearest(max, roundingUnit);"," }"," }"," else"," {"," min = max - (roundingUnit * units);"," }"," }"," }"," else if(roundingMethod === \"auto\")"," {"," if(minGreaterThanZero && maxGreaterThanZero)"," {"," if((alwaysShowZero || min < (max-min)/units) && !setMin)"," {"," min = 0;"," }",""," roundingUnit = (max - min)/units;"," if(useIntegers)"," {"," roundingUnit = Math.ceil(roundingUnit);"," max = min + (roundingUnit * units);"," }"," else"," {"," max = min + Math.ceil(roundingUnit * units * 100000)/100000;",""," }"," }"," else if(maxGreaterThanZero && !minGreaterThanZero)"," {"," if(alwaysShowZero)"," {"," topTicks = Math.round( units / ( (-1 * min) /max + 1) );"," topTicks = Math.max(Math.min(topTicks, units - 1), 1);"," botTicks = units - topTicks;",""," if(useIntegers)"," {"," tempMax = Math.ceil( max/topTicks );"," tempMin = Math.floor( min/botTicks ) * -1;"," roundingUnit = Math.max(tempMax, tempMin);"," max = roundingUnit * topTicks;"," min = roundingUnit * botTicks * -1;"," }"," else"," {"," tempMax = max/topTicks;"," tempMin = min/botTicks * -1;"," roundingUnit = Math.max(tempMax, tempMin);"," max = Math.ceil(roundingUnit * topTicks * 100000)/100000;"," min = Math.ceil(roundingUnit * botTicks * 100000)/100000 * -1;"," }"," }"," else"," {"," roundingUnit = (max - min)/units;"," if(useIntegers)"," {"," roundingUnit = Math.ceil(roundingUnit);"," }"," min = Math.round(this._roundDownToNearest(min, roundingUnit) * 100000)/100000;"," max = Math.round(this._roundUpToNearest(max, roundingUnit) * 100000)/100000;"," }"," }"," else"," {"," roundingUnit = (max - min)/units;"," if(useIntegers)"," {"," roundingUnit = Math.ceil(roundingUnit);"," }"," if(alwaysShowZero || max === 0 || max + roundingUnit > 0)"," {"," max = 0;"," roundingUnit = (max - min)/units;"," if(useIntegers)"," {"," Math.ceil(roundingUnit);"," min = max - (roundingUnit * units);"," }"," else"," {"," min = max - Math.ceil(roundingUnit * units * 100000)/100000;"," }"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," max = this._roundUpToNearest(max, roundingUnit);"," }",""," }"," }"," else if(!isNaN(roundingMethod) && isFinite(roundingMethod))"," {"," roundingUnit = roundingMethod;"," minimumRange = roundingUnit * units;"," dataRangeGreater = (max - min) > minimumRange;"," minRound = this._roundDownToNearest(min, roundingUnit);"," maxRound = this._roundUpToNearest(max, roundingUnit);"," if(setMax)"," {"," min = max - minimumRange;"," }"," else if(setMin)"," {"," max = min + minimumRange;"," }"," else if(minGreaterThanZero && maxGreaterThanZero)"," {"," if(alwaysShowZero || minRound <= 0)"," {"," min = 0;"," }"," else"," {"," min = minRound;"," }"," max = min + minimumRange;"," }"," else if(maxGreaterThanZero && !minGreaterThanZero)"," {"," min = minRound;"," max = maxRound;"," }"," else"," {"," if(alwaysShowZero || maxRound >= 0)"," {"," max = 0;"," }"," else"," {"," max = maxRound;"," }"," min = max - minimumRange;"," }"," }"," }"," this._dataMaximum = max;"," this._dataMinimum = min;"," },",""," /**"," * Rounds a Number to the nearest multiple of an input. For example, by rounding"," * 16 to the nearest 10, you will receive 20. Similar to the built-in function Math.round()."," *"," * @method _roundToNearest"," * @param {Number} number Number to round"," * @param {Number} nearest Multiple to round towards."," * @return Number"," * @private"," */"," _roundToNearest: function(number, nearest)"," {"," nearest = nearest || 1;"," var roundedNumber = Math.round(this._roundToPrecision(number / nearest, 10)) * nearest;"," return this._roundToPrecision(roundedNumber, 10);"," },",""," /**"," * Rounds a Number up to the nearest multiple of an input. For example, by rounding"," * 16 up to the nearest 10, you will receive 20. Similar to the built-in function Math.ceil()."," *"," * @method _roundUpToNearest"," * @param {Number} number Number to round"," * @param {Number} nearest Multiple to round towards."," * @return Number"," * @private"," */"," _roundUpToNearest: function(number, nearest)"," {"," nearest = nearest || 1;"," return Math.ceil(this._roundToPrecision(number / nearest, 10)) * nearest;"," },",""," /**"," * Rounds a Number down to the nearest multiple of an input. For example, by rounding"," * 16 down to the nearest 10, you will receive 10. Similar to the built-in function Math.floor()."," *"," * @method _roundDownToNearest"," * @param {Number} number Number to round"," * @param {Number} nearest Multiple to round towards."," * @return Number"," * @private"," */"," _roundDownToNearest: function(number, nearest)"," {"," nearest = nearest || 1;"," return Math.floor(this._roundToPrecision(number / nearest, 10)) * nearest;"," },",""," /**"," * Returns a coordinate corresponding to a data values."," *"," * @method _getCoordFromValue"," * @param {Number} min The minimum for the axis."," * @param {Number} max The maximum for the axis."," * @param {Number} length The distance that the axis spans."," * @param {Number} dataValue A value used to ascertain the coordinate."," * @param {Number} offset Value in which to offset the coordinates."," * @param {Boolean} reverse Indicates whether the coordinates should start from"," * the end of an axis. Only used in the numeric implementation."," * @return Number"," * @private"," */"," _getCoordFromValue: function(min, max, length, dataValue, offset, reverse)"," {"," var range,"," multiplier,"," valuecoord,"," isNumber = Y_Lang.isNumber;"," dataValue = parseFloat(dataValue);"," if(isNumber(dataValue))"," {"," if(this.get(\"scaleType\") === \"logarithmic\" && min > 0)"," {"," min = Math.log(min);"," max = Math.log(max);"," dataValue = Math.log(dataValue);"," }"," range = max - min;"," multiplier = length/range;"," valuecoord = (dataValue - min) * multiplier;"," valuecoord = reverse ? offset - valuecoord : offset + valuecoord;"," }"," else"," {"," valuecoord = NaN;"," }"," return valuecoord;"," },",""," /**"," * Rounds a number to a certain level of precision. Useful for limiting the number of"," * decimal places on a fractional number."," *"," * @method _roundToPrecision"," * @param {Number} number Number to round"," * @param {Number} precision Multiple to round towards."," * @return Number"," * @private"," */"," _roundToPrecision: function(number, precision)"," {"," precision = precision || 0;"," var decimalPlaces = Math.pow(10, precision);"," return Math.round(decimalPlaces * number) / decimalPlaces;"," }","};","","Y.NumericImpl = NumericImpl;","","/**"," * NumericAxisBase manages numeric data for an axis."," *"," * @class NumericAxisBase"," * @constructor"," * @extends AxisBase"," * @uses NumericImpl"," * @param {Object} config (optional) Configuration parameters."," * @submodule axis-numeric-base"," */","Y.NumericAxisBase = Y.Base.create(\"numericAxisBase\", Y.AxisBase, [Y.NumericImpl]);","","","}, '3.17.2', {\"requires\": [\"axis-base\"]});","","}());"]};
}
var __cov_w_x$LJ5sPl965kOy40ZtvQ = __coverage__['build/axis-numeric-base/axis-numeric-base.js'];
__cov_w_x$LJ5sPl965kOy40ZtvQ.s['1']++;YUI.add('axis-numeric-base',function(Y,NAME){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['1']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['2']++;var Y_Lang=Y.Lang;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['3']++;function NumericImpl(){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['2']++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['4']++;NumericImpl.NAME='numericImpl';__cov_w_x$LJ5sPl965kOy40ZtvQ.s['5']++;NumericImpl.ATTRS={alwaysShowZero:{value:true},labelFormat:{value:{prefix:'',thousandsSeparator:'',decimalSeparator:'',decimalPlaces:'0',suffix:''}},roundingMethod:{value:'niceNumber'},scaleType:{value:'linear'}};__cov_w_x$LJ5sPl965kOy40ZtvQ.s['6']++;NumericImpl.prototype={initializer:function(){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['3']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['7']++;this.after('alwaysShowZeroChange',this._keyChangeHandler);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['8']++;this.after('roundingMethodChange',this._keyChangeHandler);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['9']++;this.after('scaleTypeChange',this._keyChangeHandler);},formatLabel:function(val,format){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['4']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['10']++;if(format){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['1'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['11']++;return Y.DataType.Number.format(val,format);}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['1'][1]++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['12']++;return val;},getTotalByKey:function(key){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['5']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['13']++;var total=0,values=this.getDataByKey(key),i=0,val,len=values?(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['2'][0]++,values.length):(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['2'][1]++,0);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['14']++;for(;i<len;++i){__cov_w_x$LJ5sPl965kOy40ZtvQ.s['15']++;val=parseFloat(values[i]);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['16']++;if(!isNaN(val)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['3'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['17']++;total+=val;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['3'][1]++;}}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['18']++;return total;},getOrigin:function(){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['6']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['19']++;var origin=0,min=this.get('minimum'),max=this.get('maximum');__cov_w_x$LJ5sPl965kOy40ZtvQ.s['20']++;origin=Math.max(origin,min);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['21']++;origin=Math.min(origin,max);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['22']++;return origin;},_type:'numeric',_getMinimumUnit:function(max,min,units){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['7']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['23']++;return this._getNiceNumber(Math.ceil((max-min)/units));},_getNiceNumber:function(roundingUnit){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['8']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['24']++;var tempMajorUnit=roundingUnit,order=Math.ceil(Math.log(tempMajorUnit)*0.4342944819032518),roundedMajorUnit=Math.pow(10,order),roundedDiff;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['25']++;if(roundedMajorUnit/2>=tempMajorUnit){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['4'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['26']++;roundedDiff=Math.floor((roundedMajorUnit/2-tempMajorUnit)/(Math.pow(10,order-1)/2));__cov_w_x$LJ5sPl965kOy40ZtvQ.s['27']++;tempMajorUnit=roundedMajorUnit/2-roundedDiff*Math.pow(10,order-1)/2;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['4'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['28']++;tempMajorUnit=roundedMajorUnit;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['29']++;if(!isNaN(tempMajorUnit)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['5'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['30']++;return tempMajorUnit;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['5'][1]++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['31']++;return roundingUnit;},_updateMinAndMax:function(){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['9']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['32']++;var data=this.get('data'),max,min,len,num,i=0,setMax=this.get('setMax'),setMin=this.get('setMin');__cov_w_x$LJ5sPl965kOy40ZtvQ.s['33']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['7'][0]++,!setMax)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['7'][1]++,!setMin)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['6'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['34']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['9'][0]++,data)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['9'][1]++,data.length)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['9'][2]++,data.length>0)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['8'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['35']++;len=data.length;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['36']++;for(;i<len;i++){__cov_w_x$LJ5sPl965kOy40ZtvQ.s['37']++;num=data[i];__cov_w_x$LJ5sPl965kOy40ZtvQ.s['38']++;if(isNaN(num)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['10'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['39']++;max=setMax?(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['11'][0]++,this._setMaximum):(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['11'][1]++,max);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['40']++;min=setMin?(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['12'][0]++,this._setMinimum):(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['12'][1]++,min);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['41']++;continue;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['10'][1]++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['42']++;if(setMin){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['13'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['43']++;min=this._setMinimum;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['13'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['44']++;if(min===undefined){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['14'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['45']++;min=num;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['14'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['46']++;min=Math.min(num,min);}}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['47']++;if(setMax){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['15'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['48']++;max=this._setMaximum;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['15'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['49']++;if(max===undefined){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['16'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['50']++;max=num;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['16'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['51']++;max=Math.max(num,max);}}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['52']++;this._actualMaximum=max;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['53']++;this._actualMinimum=min;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['8'][1]++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['54']++;if(this.get('scaleType')!=='logarithmic'){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['17'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['55']++;this._roundMinAndMax(min,max,setMin,setMax);}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['17'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['56']++;this._dataMaximum=max;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['57']++;this._dataMinimum=min;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['6'][1]++;}},_roundMinAndMax:function(min,max,setMin,setMax){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['10']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['58']++;var roundingUnit,minimumRange,minGreaterThanZero=min>=0,maxGreaterThanZero=max>0,dataRangeGreater,maxRound,minRound,topTicks,botTicks,tempMax,tempMin,units=this.getTotalMajorUnits()-1,alwaysShowZero=this.get('alwaysShowZero'),roundingMethod=this.get('roundingMethod'),useIntegers=(max-min)/units>=1;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['59']++;if(roundingMethod){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['18'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['60']++;if(roundingMethod==='niceNumber'){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['19'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['61']++;roundingUnit=this._getMinimumUnit(max,min,units);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['62']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['21'][0]++,minGreaterThanZero)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['21'][1]++,maxGreaterThanZero)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['20'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['63']++;if(((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['23'][0]++,alwaysShowZero)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['23'][1]++,min<roundingUnit))&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['23'][2]++,!setMin)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['22'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['64']++;min=0;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['65']++;roundingUnit=this._getMinimumUnit(max,min,units);}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['22'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['66']++;min=this._roundDownToNearest(min,roundingUnit);}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['67']++;if(setMax){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['24'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['68']++;if(!alwaysShowZero){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['25'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['69']++;min=max-roundingUnit*units;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['25'][1]++;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['24'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['70']++;if(setMin){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['26'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['71']++;max=min+roundingUnit*units;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['26'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['72']++;max=this._roundUpToNearest(max,roundingUnit);}}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['20'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['73']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['28'][0]++,maxGreaterThanZero)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['28'][1]++,!minGreaterThanZero)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['27'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['74']++;if(alwaysShowZero){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['29'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['75']++;topTicks=Math.round(units/(-1*min/max+1));__cov_w_x$LJ5sPl965kOy40ZtvQ.s['76']++;topTicks=Math.max(Math.min(topTicks,units-1),1);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['77']++;botTicks=units-topTicks;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['78']++;tempMax=Math.ceil(max/topTicks);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['79']++;tempMin=Math.floor(min/botTicks)*-1;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['80']++;if(setMin){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['30'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['81']++;while((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['31'][0]++,tempMin<tempMax)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['31'][1]++,botTicks>=0)){__cov_w_x$LJ5sPl965kOy40ZtvQ.s['82']++;botTicks--;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['83']++;topTicks++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['84']++;tempMax=Math.ceil(max/topTicks);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['85']++;tempMin=Math.floor(min/botTicks)*-1;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['86']++;if(botTicks>0){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['32'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['87']++;max=tempMin*topTicks;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['32'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['88']++;max=min+roundingUnit*units;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['30'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['89']++;if(setMax){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['33'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['90']++;while((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['34'][0]++,tempMax<tempMin)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['34'][1]++,topTicks>=0)){__cov_w_x$LJ5sPl965kOy40ZtvQ.s['91']++;botTicks++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['92']++;topTicks--;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['93']++;tempMin=Math.floor(min/botTicks)*-1;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['94']++;tempMax=Math.ceil(max/topTicks);}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['95']++;if(topTicks>0){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['35'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['96']++;min=tempMax*botTicks*-1;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['35'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['97']++;min=max-roundingUnit*units;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['33'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['98']++;roundingUnit=Math.max(tempMax,tempMin);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['99']++;roundingUnit=this._getNiceNumber(roundingUnit);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['100']++;max=roundingUnit*topTicks;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['101']++;min=roundingUnit*botTicks*-1;}}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['29'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['102']++;if(setMax){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['36'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['103']++;min=max-roundingUnit*units;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['36'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['104']++;if(setMin){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['37'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['105']++;max=min+roundingUnit*units;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['37'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['106']++;min=this._roundDownToNearest(min,roundingUnit);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['107']++;max=this._roundUpToNearest(max,roundingUnit);}}}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['27'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['108']++;if(setMin){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['38'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['109']++;if(alwaysShowZero){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['39'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['110']++;max=0;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['39'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['111']++;max=min+roundingUnit*units;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['38'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['112']++;if(!setMax){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['40'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['113']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['42'][0]++,alwaysShowZero)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['42'][1]++,max===0)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['42'][2]++,max+roundingUnit>0)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['41'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['114']++;max=0;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['115']++;roundingUnit=this._getMinimumUnit(max,min,units);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['116']++;min=max-roundingUnit*units;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['41'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['117']++;min=this._roundDownToNearest(min,roundingUnit);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['118']++;max=this._roundUpToNearest(max,roundingUnit);}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['40'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['119']++;min=max-roundingUnit*units;}}}}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['19'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['120']++;if(roundingMethod==='auto'){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['43'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['121']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['45'][0]++,minGreaterThanZero)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['45'][1]++,maxGreaterThanZero)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['44'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['122']++;if(((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['47'][0]++,alwaysShowZero)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['47'][1]++,min<(max-min)/units))&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['47'][2]++,!setMin)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['46'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['123']++;min=0;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['46'][1]++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['124']++;roundingUnit=(max-min)/units;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['125']++;if(useIntegers){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['48'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['126']++;roundingUnit=Math.ceil(roundingUnit);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['127']++;max=min+roundingUnit*units;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['48'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['128']++;max=min+Math.ceil(roundingUnit*units*100000)/100000;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['44'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['129']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['50'][0]++,maxGreaterThanZero)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['50'][1]++,!minGreaterThanZero)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['49'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['130']++;if(alwaysShowZero){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['51'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['131']++;topTicks=Math.round(units/(-1*min/max+1));__cov_w_x$LJ5sPl965kOy40ZtvQ.s['132']++;topTicks=Math.max(Math.min(topTicks,units-1),1);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['133']++;botTicks=units-topTicks;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['134']++;if(useIntegers){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['52'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['135']++;tempMax=Math.ceil(max/topTicks);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['136']++;tempMin=Math.floor(min/botTicks)*-1;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['137']++;roundingUnit=Math.max(tempMax,tempMin);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['138']++;max=roundingUnit*topTicks;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['139']++;min=roundingUnit*botTicks*-1;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['52'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['140']++;tempMax=max/topTicks;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['141']++;tempMin=min/botTicks*-1;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['142']++;roundingUnit=Math.max(tempMax,tempMin);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['143']++;max=Math.ceil(roundingUnit*topTicks*100000)/100000;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['144']++;min=Math.ceil(roundingUnit*botTicks*100000)/100000*-1;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['51'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['145']++;roundingUnit=(max-min)/units;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['146']++;if(useIntegers){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['53'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['147']++;roundingUnit=Math.ceil(roundingUnit);}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['53'][1]++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['148']++;min=Math.round(this._roundDownToNearest(min,roundingUnit)*100000)/100000;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['149']++;max=Math.round(this._roundUpToNearest(max,roundingUnit)*100000)/100000;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['49'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['150']++;roundingUnit=(max-min)/units;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['151']++;if(useIntegers){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['54'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['152']++;roundingUnit=Math.ceil(roundingUnit);}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['54'][1]++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['153']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['56'][0]++,alwaysShowZero)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['56'][1]++,max===0)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['56'][2]++,max+roundingUnit>0)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['55'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['154']++;max=0;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['155']++;roundingUnit=(max-min)/units;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['156']++;if(useIntegers){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['57'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['157']++;Math.ceil(roundingUnit);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['158']++;min=max-roundingUnit*units;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['57'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['159']++;min=max-Math.ceil(roundingUnit*units*100000)/100000;}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['55'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['160']++;min=this._roundDownToNearest(min,roundingUnit);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['161']++;max=this._roundUpToNearest(max,roundingUnit);}}}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['43'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['162']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['59'][0]++,!isNaN(roundingMethod))&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['59'][1]++,isFinite(roundingMethod))){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['58'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['163']++;roundingUnit=roundingMethod;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['164']++;minimumRange=roundingUnit*units;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['165']++;dataRangeGreater=max-min>minimumRange;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['166']++;minRound=this._roundDownToNearest(min,roundingUnit);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['167']++;maxRound=this._roundUpToNearest(max,roundingUnit);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['168']++;if(setMax){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['60'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['169']++;min=max-minimumRange;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['60'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['170']++;if(setMin){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['61'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['171']++;max=min+minimumRange;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['61'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['172']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['63'][0]++,minGreaterThanZero)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['63'][1]++,maxGreaterThanZero)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['62'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['173']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['65'][0]++,alwaysShowZero)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['65'][1]++,minRound<=0)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['64'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['174']++;min=0;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['64'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['175']++;min=minRound;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['176']++;max=min+minimumRange;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['62'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['177']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['67'][0]++,maxGreaterThanZero)&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['67'][1]++,!minGreaterThanZero)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['66'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['178']++;min=minRound;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['179']++;max=maxRound;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['66'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['180']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['69'][0]++,alwaysShowZero)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['69'][1]++,maxRound>=0)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['68'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['181']++;max=0;}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['68'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['182']++;max=maxRound;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['183']++;min=max-minimumRange;}}}}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['58'][1]++;}}}}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['18'][1]++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['184']++;this._dataMaximum=max;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['185']++;this._dataMinimum=min;},_roundToNearest:function(number,nearest){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['11']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['186']++;nearest=(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['70'][0]++,nearest)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['70'][1]++,1);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['187']++;var roundedNumber=Math.round(this._roundToPrecision(number/nearest,10))*nearest;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['188']++;return this._roundToPrecision(roundedNumber,10);},_roundUpToNearest:function(number,nearest){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['12']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['189']++;nearest=(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['71'][0]++,nearest)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['71'][1]++,1);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['190']++;return Math.ceil(this._roundToPrecision(number/nearest,10))*nearest;},_roundDownToNearest:function(number,nearest){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['13']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['191']++;nearest=(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['72'][0]++,nearest)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['72'][1]++,1);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['192']++;return Math.floor(this._roundToPrecision(number/nearest,10))*nearest;},_getCoordFromValue:function(min,max,length,dataValue,offset,reverse){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['14']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['193']++;var range,multiplier,valuecoord,isNumber=Y_Lang.isNumber;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['194']++;dataValue=parseFloat(dataValue);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['195']++;if(isNumber(dataValue)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['73'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['196']++;if((__cov_w_x$LJ5sPl965kOy40ZtvQ.b['75'][0]++,this.get('scaleType')==='logarithmic')&&(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['75'][1]++,min>0)){__cov_w_x$LJ5sPl965kOy40ZtvQ.b['74'][0]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['197']++;min=Math.log(min);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['198']++;max=Math.log(max);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['199']++;dataValue=Math.log(dataValue);}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['74'][1]++;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['200']++;range=max-min;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['201']++;multiplier=length/range;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['202']++;valuecoord=(dataValue-min)*multiplier;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['203']++;valuecoord=reverse?(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['76'][0]++,offset-valuecoord):(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['76'][1]++,offset+valuecoord);}else{__cov_w_x$LJ5sPl965kOy40ZtvQ.b['73'][1]++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['204']++;valuecoord=NaN;}__cov_w_x$LJ5sPl965kOy40ZtvQ.s['205']++;return valuecoord;},_roundToPrecision:function(number,precision){__cov_w_x$LJ5sPl965kOy40ZtvQ.f['15']++;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['206']++;precision=(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['77'][0]++,precision)||(__cov_w_x$LJ5sPl965kOy40ZtvQ.b['77'][1]++,0);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['207']++;var decimalPlaces=Math.pow(10,precision);__cov_w_x$LJ5sPl965kOy40ZtvQ.s['208']++;return Math.round(decimalPlaces*number)/decimalPlaces;}};__cov_w_x$LJ5sPl965kOy40ZtvQ.s['209']++;Y.NumericImpl=NumericImpl;__cov_w_x$LJ5sPl965kOy40ZtvQ.s['210']++;Y.NumericAxisBase=Y.Base.create('numericAxisBase',Y.AxisBase,[Y.NumericImpl]);},'3.17.2',{'requires':['axis-base']});
|
ajibolam/jsdelivr
|
files/yui/3.17.2/axis-numeric-base/axis-numeric-base-coverage.js
|
JavaScript
|
mit
| 82,908 |
/*
* /MathJax/jax/output/HTML-CSS/config.js
*
* Copyright (c) 2012 Design Science, Inc.
*
* Part of the MathJax library.
* See http://www.mathjax.org for details.
*
* Licensed under the Apache License, Version 2.0;
* you may not use this file except in compliance with the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
MathJax.OutputJax["HTML-CSS"]=MathJax.OutputJax({id:"HTML-CSS",version:"2.0.1",directory:MathJax.OutputJax.directory+"/HTML-CSS",extensionDir:MathJax.OutputJax.extensionDir+"/HTML-CSS",autoloadDir:MathJax.OutputJax.directory+"/HTML-CSS/autoload",fontDir:MathJax.OutputJax.directory+"/HTML-CSS/fonts",webfontDir:MathJax.OutputJax.fontDir+"/HTML-CSS",config:{scale:100,minScaleAdjust:50,availableFonts:["STIX","TeX"],preferredFont:"TeX",webFont:"TeX",imageFont:"TeX",undefinedFamily:"STIXGeneral,'Arial Unicode MS',serif",mtextFontInherit:false,EqnChunk:(MathJax.Hub.Browser.isMobile?10:50),EqnChunkFactor:1.5,EqnChunkDelay:100,linebreaks:{automatic:false,width:"container"},styles:{".MathJax_Display":{"text-align":"center",margin:"1em 0em"},".MathJax .merror":{"background-color":"#FFFF88",color:"#CC0000",border:"1px solid #CC0000",padding:"1px 3px","font-style":"normal","font-size":"90%"},"#MathJax_Tooltip":{"background-color":"InfoBackground",color:"InfoText",border:"1px solid black","box-shadow":"2px 2px 5px #AAAAAA","-webkit-box-shadow":"2px 2px 5px #AAAAAA","-moz-box-shadow":"2px 2px 5px #AAAAAA","-khtml-box-shadow":"2px 2px 5px #AAAAAA",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')",padding:"3px 4px"}}}});if(MathJax.Hub.Browser.isMSIE&&document.documentMode>=9){delete MathJax.OutputJax["HTML-CSS"].config.styles["#MathJax_Tooltip"].filter}if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax["HTML-CSS"].Register("jax/mml")}MathJax.Hub.Register.StartupHook("End Config",[function(b,c){var a=b.Insert({minBrowserVersion:{Firefox:3,Opera:9.52,MSIE:6,Chrome:0.3,Safari:2,Konqueror:4},inlineMathDelimiters:["$","$"],displayMathDelimiters:["$$","$$"],multilineDisplay:true,minBrowserTranslate:function(f){var e=b.getJaxFor(f),k=["[Math]"],j;var h=document.createElement("span",{className:"MathJax_Preview"});if(e.inputJax==="TeX"){if(e.root.Get("displaystyle")){j=a.displayMathDelimiters;k=[j[0]+e.originalText+j[1]];if(a.multilineDisplay){k=k[0].split(/\n/)}}else{j=a.inlineMathDelimiters;k=[j[0]+e.originalText.replace(/^\s+/,"").replace(/\s+$/,"")+j[1]]}}for(var g=0,d=k.length;g<d;g++){h.appendChild(document.createTextNode(k[g]));if(g<d-1){h.appendChild(document.createElement("br"))}}f.parentNode.insertBefore(h,f)}},(b.config["HTML-CSS"]||{}));if(b.Browser.version!=="0.0"&&!b.Browser.versionAtLeast(a.minBrowserVersion[b.Browser]||0)){c.Translate=a.minBrowserTranslate;b.Config({showProcessingMessages:false});MathJax.Message.Set("Your browser does not support MathJax",null,4000);b.Startup.signal.Post("MathJax not supported")}},MathJax.Hub,MathJax.OutputJax["HTML-CSS"]]);MathJax.OutputJax["HTML-CSS"].loadComplete("config.js");
|
steakknife/cdnjs
|
ajax/libs/mathjax/2.0/jax/output/HTML-CSS/config.js
|
JavaScript
|
mit
| 3,074 |
/*
YUI 3.17.2 (build 9c3c78e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/datasource-xmlschema/datasource-xmlschema.js']) {
__coverage__['build/datasource-xmlschema/datasource-xmlschema.js'] = {"path":"build/datasource-xmlschema/datasource-xmlschema.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0},"b":{"1":[0,0],"2":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":51}}},"2":{"name":"(anonymous_2)","line":15,"loc":{"start":{"line":15,"column":26},"end":{"line":15,"column":37}}},"3":{"name":"(anonymous_3)","line":64,"loc":{"start":{"line":64,"column":17},"end":{"line":64,"column":34}}},"4":{"name":"(anonymous_4)","line":82,"loc":{"start":{"line":82,"column":22},"end":{"line":82,"column":34}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":102,"column":93}},"2":{"start":{"line":15,"column":0},"end":{"line":17,"column":2}},"3":{"start":{"line":16,"column":4},"end":{"line":16,"column":70}},"4":{"start":{"line":19,"column":0},"end":{"line":54,"column":3}},"5":{"start":{"line":56,"column":0},"end":{"line":97,"column":3}},"6":{"start":{"line":65,"column":8},"end":{"line":65,"column":59}},"7":{"start":{"line":83,"column":8},"end":{"line":86,"column":62}},"8":{"start":{"line":88,"column":8},"end":{"line":91,"column":10}},"9":{"start":{"line":93,"column":8},"end":{"line":93,"column":51}},"10":{"start":{"line":95,"column":8},"end":{"line":95,"column":77}},"11":{"start":{"line":99,"column":0},"end":{"line":99,"column":64}}},"branchMap":{"1":{"line":86,"type":"binary-expr","locations":[{"start":{"line":86,"column":19},"end":{"line":86,"column":51}},{"start":{"line":86,"column":55},"end":{"line":86,"column":61}}]},"2":{"line":88,"type":"binary-expr","locations":[{"start":{"line":88,"column":27},"end":{"line":88,"column":74}},{"start":{"line":88,"column":78},"end":{"line":91,"column":9}}]}},"code":["(function () { YUI.add('datasource-xmlschema', function (Y, NAME) {","","/**"," * Extends DataSource with schema-parsing on XML data."," *"," * @module datasource"," * @submodule datasource-xmlschema"," */","","/**"," * Adds schema-parsing to the DataSource Utility."," * @class DataSourceXMLSchema"," * @extends Plugin.Base"," */","var DataSourceXMLSchema = function() {"," DataSourceXMLSchema.superclass.constructor.apply(this, arguments);","};","","Y.mix(DataSourceXMLSchema, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"schema\""," */"," NS: \"schema\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataSourceXMLSchema\""," */"," NAME: \"dataSourceXMLSchema\",",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSourceXMLSchema Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," ATTRS: {"," schema: {"," //value: {}"," }"," }","});","","Y.extend(DataSourceXMLSchema, Y.Plugin.Base, {"," /**"," * Internal init() handler."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this.doBefore(\"_defDataFn\", this._beforeDefDataFn);"," },",""," /**"," * Parses raw data into a normalized response."," *"," * @method _beforeDefDataFn"," * @param tId {Number} Unique transaction ID."," * @param request {Object} The request."," * @param callback {Object} The callback object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * @param data {Object} Raw data."," * @protected"," */"," _beforeDefDataFn: function(e) {"," var schema = this.get('schema'),"," payload = e.details[0],"," // TODO: Do I need to sniff for DS.IO + responseXML.nodeType 9?"," data = Y.XML.parse(e.data.responseText) || e.data;",""," payload.response = Y.DataSchema.XML.apply.call(this, schema, data) || {"," meta: {},"," results: data"," };",""," this.get(\"host\").fire(\"response\", payload);",""," return new Y.Do.Halt(\"DataSourceXMLSchema plugin halted _defDataFn\");"," }","});","","Y.namespace('Plugin').DataSourceXMLSchema = DataSourceXMLSchema;","","","}, '3.17.2', {\"requires\": [\"datasource-local\", \"plugin\", \"datatype-xml\", \"dataschema-xml\"]});","","}());"]};
}
var __cov_MRZJnkZJfhNEcQemtwcRNQ = __coverage__['build/datasource-xmlschema/datasource-xmlschema.js'];
__cov_MRZJnkZJfhNEcQemtwcRNQ.s['1']++;YUI.add('datasource-xmlschema',function(Y,NAME){__cov_MRZJnkZJfhNEcQemtwcRNQ.f['1']++;__cov_MRZJnkZJfhNEcQemtwcRNQ.s['2']++;var DataSourceXMLSchema=function(){__cov_MRZJnkZJfhNEcQemtwcRNQ.f['2']++;__cov_MRZJnkZJfhNEcQemtwcRNQ.s['3']++;DataSourceXMLSchema.superclass.constructor.apply(this,arguments);};__cov_MRZJnkZJfhNEcQemtwcRNQ.s['4']++;Y.mix(DataSourceXMLSchema,{NS:'schema',NAME:'dataSourceXMLSchema',ATTRS:{schema:{}}});__cov_MRZJnkZJfhNEcQemtwcRNQ.s['5']++;Y.extend(DataSourceXMLSchema,Y.Plugin.Base,{initializer:function(config){__cov_MRZJnkZJfhNEcQemtwcRNQ.f['3']++;__cov_MRZJnkZJfhNEcQemtwcRNQ.s['6']++;this.doBefore('_defDataFn',this._beforeDefDataFn);},_beforeDefDataFn:function(e){__cov_MRZJnkZJfhNEcQemtwcRNQ.f['4']++;__cov_MRZJnkZJfhNEcQemtwcRNQ.s['7']++;var schema=this.get('schema'),payload=e.details[0],data=(__cov_MRZJnkZJfhNEcQemtwcRNQ.b['1'][0]++,Y.XML.parse(e.data.responseText))||(__cov_MRZJnkZJfhNEcQemtwcRNQ.b['1'][1]++,e.data);__cov_MRZJnkZJfhNEcQemtwcRNQ.s['8']++;payload.response=(__cov_MRZJnkZJfhNEcQemtwcRNQ.b['2'][0]++,Y.DataSchema.XML.apply.call(this,schema,data))||(__cov_MRZJnkZJfhNEcQemtwcRNQ.b['2'][1]++,{meta:{},results:data});__cov_MRZJnkZJfhNEcQemtwcRNQ.s['9']++;this.get('host').fire('response',payload);__cov_MRZJnkZJfhNEcQemtwcRNQ.s['10']++;return new Y.Do.Halt('DataSourceXMLSchema plugin halted _defDataFn');}});__cov_MRZJnkZJfhNEcQemtwcRNQ.s['11']++;Y.namespace('Plugin').DataSourceXMLSchema=DataSourceXMLSchema;},'3.17.2',{'requires':['datasource-local','plugin','datatype-xml','dataschema-xml']});
|
SaravananRajaraman/cdnjs
|
ajax/libs/yui/3.17.2/datasource-xmlschema/datasource-xmlschema-coverage.js
|
JavaScript
|
mit
| 6,726 |
/*
* /MathJax/extensions/TeX/AMSmath.js
*
* Copyright (c) 2012 Design Science, Inc.
*
* Part of the MathJax library.
* See http://www.mathjax.org for details.
*
* Licensed under the Apache License, Version 2.0;
* you may not use this file except in compliance with the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
MathJax.Extension["TeX/AMSmath"]={version:"2.0",number:0,startNumber:0,labels:{},eqlabels:{},refs:[]};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var b=MathJax.ElementJax.mml,g=MathJax.InputJax.TeX,f=MathJax.Extension["TeX/AMSmath"];var d=g.Definitions,e=g.Stack.Item,a=g.config.equationNumbers;var c=function(h){return h.join("em ")+"em"};d.Add({macros:{mathring:["Accent","2DA"],nobreakspace:"Tilde",negmedspace:["Spacer",b.LENGTH.NEGATIVEMEDIUMMATHSPACE],negthickspace:["Spacer",b.LENGTH.NEGATIVETHICKMATHSPACE],intI:["Macro","\\mathchoice{\\!}{}{}{}\\!\\!\\int"],iiiint:["MultiIntegral","\\int\\intI\\intI\\intI"],idotsint:["MultiIntegral","\\int\\cdots\\int"],dddot:["Macro","\\mathop{#1}\\limits^{\\textstyle \\mathord{.}\\mathord{.}\\mathord{.}}",1],ddddot:["Macro","\\mathop{#1}\\limits^{\\textstyle \\mathord{.}\\mathord{.}\\mathord{.}\\mathord{.}}",1],sideset:["Macro","\\mathop{\\mathop{\\rlap{\\phantom{#3}}}\\nolimits#1\\!\\mathop{#3}\\nolimits#2}",3],boxed:["Macro","\\fbox{$\\displaystyle{#1}$}",1],tag:"HandleTag",notag:"HandleNoTag",label:"HandleLabel",ref:"HandleRef",eqref:["HandleRef",true],substack:["Macro","\\begin{subarray}{c}#1\\end{subarray}",1],injlim:["Macro","\\mathop{\\rm inj\\,lim}"],projlim:["Macro","\\mathop{\\rm proj\\,lim}"],varliminf:["Macro","\\mathop{\\underline{\\rm lim}}"],varlimsup:["Macro","\\mathop{\\overline{\\rm lim}}"],varinjlim:["Macro","\\mathop{\\underrightarrow{\\rm lim\\Rule{-1pt}{0pt}{1pt}}\\Rule{0pt}{0pt}{.45em}}"],varprojlim:["Macro","\\mathop{\\underleftarrow{\\rm lim\\Rule{-1pt}{0pt}{1pt}}\\Rule{0pt}{0pt}{.45em}}"],DeclareMathOperator:"HandleDeclareOp",operatorname:"HandleOperatorName",genfrac:"Genfrac",frac:["Genfrac","","","",""],tfrac:["Genfrac","","","",1],dfrac:["Genfrac","","","",0],binom:["Genfrac","(",")","0em",""],tbinom:["Genfrac","(",")","0em",1],dbinom:["Genfrac","(",")","0em",0],cfrac:"CFrac",shoveleft:["HandleShove",b.ALIGN.LEFT],shoveright:["HandleShove",b.ALIGN.RIGHT],xrightarrow:["xArrow",8594,5,6],xleftarrow:["xArrow",8592,7,3]},environment:{align:["AMSarray",null,true,true,"rlrlrlrlrlrl",c([5/18,2,5/18,2,5/18,2,5/18,2,5/18,2,5/18])],"align*":["AMSarray",null,false,true,"rlrlrlrlrlrl",c([5/18,2,5/18,2,5/18,2,5/18,2,5/18,2,5/18])],multline:["Multline",null,true],"multline*":["Multline",null,false],split:["AMSarray",null,false,false,"rl",c([5/18])],gather:["AMSarray",null,true,true,"c"],"gather*":["AMSarray",null,false,true,"c"],alignat:["AlignAt",null,true,true],"alignat*":["AlignAt",null,false,true],alignedat:["AlignAt",null,false,false],aligned:["AlignedArray",null,null,null,"rlrlrlrlrlrl",c([5/18,2,5/18,2,5/18,2,5/18,2,5/18,2,5/18]),".5em","D"],gathered:["AlignedArray",null,null,null,"c",null,".5em","D"],subarray:["Array",null,null,null,null,c([0,0,0,0]),"0.1em","S",1],smallmatrix:["Array",null,null,null,"c",c([1/3]),".2em","S",1],equation:["EquationBegin","Equation",true],"equation*":["EquationBegin","EquationStar",false]},delimiter:{"\\lvert":["2223",{texClass:b.TEXCLASS.OPEN}],"\\rvert":["2223",{texClass:b.TEXCLASS.CLOSE}],"\\lVert":["2225",{texClass:b.TEXCLASS.OPEN}],"\\rVert":["2225",{texClass:b.TEXCLASS.CLOSE}]}},null,true);g.Parse.Augment({HandleTag:function(j){var l=this.GetStar();var i=this.trimSpaces(this.GetArgument(j)),h=i;if(!l){i=a.formatTag(i)}var k=this.stack.global;k.tagID=h;if(k.notags){g.Error(j+" not allowed in "+k.notags+" environment")}if(k.tag){g.Error("Multiple "+j)}k.tag=b.mtd.apply(b,this.InternalMath(i)).With({id:a.formatID(h)})},HandleNoTag:function(h){if(this.stack.global.tag){delete this.stack.global.tag}this.stack.global.notag=true},HandleLabel:function(i){var j=this.stack.global,h=this.GetArgument(i);if(!f.refUpdate){if(j.label){g.Error("Multiple "+i+"'s")}j.label=h;if(f.labels[h]||f.eqlabels[h]){g.Error("Label '"+h+"' mutiply defined")}f.eqlabels[h]="???"}},HandleRef:function(j,l){var i=this.GetArgument(j);var k=f.labels[i]||f.eqlabels[i];if(!k){k="??";f.badref=!f.refUpdate}var h=k;if(l){h=a.formatTag(h)}if(a.useLabelIds){k=i}this.Push(b.mrow.apply(b,this.InternalMath(h)).With({href:a.formatURL(a.formatID(k)),"class":"MathJax_ref"}))},HandleDeclareOp:function(i){var h=(this.GetStar()?"\\limits":"");var j=this.trimSpaces(this.GetArgument(i));if(j.charAt(0)=="\\"){j=j.substr(1)}var k=this.GetArgument(i);k=k.replace(/\*/g,"\\text{*}").replace(/-/g,"\\text{-}");g.Definitions.macros[j]=["Macro","\\mathop{\\rm "+k+"}"+h]},HandleOperatorName:function(i){var h=(this.GetStar()?"\\limits":"\\nolimits");var j=this.trimSpaces(this.GetArgument(i));j=j.replace(/\*/g,"\\text{*}").replace(/-/g,"\\text{-}");this.string="\\mathop{\\rm "+j+"}"+h+" "+this.string.slice(this.i);this.i=0},HandleShove:function(i,h){var j=this.stack.Top();if(j.type!=="multline"||j.data.length){g.Error(i+" must come at the beginning of the line")}j.data.shove=h},CFrac:function(k){var h=this.trimSpaces(this.GetBrackets(k,"")),j=this.GetArgument(k),l=this.GetArgument(k);var i=b.mfrac(g.Parse("\\strut\\textstyle{"+j+"}",this.stack.env).mml(),g.Parse("\\strut\\textstyle{"+l+"}",this.stack.env).mml());h=({l:b.ALIGN.LEFT,r:b.ALIGN.RIGHT,"":""})[h];if(h==null){g.Error("Illegal alignment specified in "+k)}if(h){i.numalign=i.denomalign=h}this.Push(i)},Genfrac:function(i,k,p,m,h){if(k==null){k=this.GetDelimiterArg(i)}else{k=this.convertDelimiter(k)}if(p==null){p=this.GetDelimiterArg(i)}else{p=this.convertDelimiter(p)}if(m==null){m=this.GetArgument(i)}if(h==null){h=this.trimSpaces(this.GetArgument(i))}var l=this.ParseArg(i);var o=this.ParseArg(i);var j=b.mfrac(l,o);if(m!==""){j.linethickness=m}if(k||p){j=b.mfenced(j).With({open:k,close:p})}if(h!==""){var n=(["D","T","S","SS"])[h];if(n==null){g.Error("Bad math style for "+i)}j=b.mstyle(j);if(n==="D"){j.displaystyle=true;j.scriptlevel=0}else{j.displaystyle=false;j.scriptlevel=h-1}}this.Push(j)},Multline:function(i,h){this.Push(i);this.checkEqnEnv();return e.multline(h,this.stack).With({arraydef:{displaystyle:true,rowspacing:".5em",width:g.config.MultLineWidth,columnwidth:"100%",side:g.config.TagSide,minlabelspacing:g.config.TagIndent}})},AMSarray:function(j,i,h,l,k){this.Push(j);if(h){this.checkEqnEnv()}l=l.replace(/[^clr]/g,"").split("").join(" ");l=l.replace(/l/g,"left").replace(/r/g,"right").replace(/c/g,"center");return e.AMSarray(j.name,i,h,this.stack).With({arraydef:{displaystyle:true,rowspacing:".5em",columnalign:l,columnspacing:(k||"1em"),rowspacing:"3pt",side:g.config.TagSide,minlabelspacing:g.config.TagIndent}})},AlignAt:function(k,i,h){var p,j,o="",m=[];if(!h){j=this.GetBrackets("\\begin{"+k.name+"}")}p=this.GetArgument("\\begin{"+k.name+"}");if(p.match(/[^0-9]/)){g.Error("Argument to \\begin{"+k.name+"} must me a positive integer")}while(p>0){o+="rl";m.push("0em 0em");p--}m=m.join(" ");if(h){return this.AMSarray(k,i,h,o,m)}var l=this.Array.call(this,k,null,null,o,m,".5em","D");return this.setArrayAlign(l,j)},EquationBegin:function(h,i){this.checkEqnEnv();this.stack.global.forcetag=(i&&a.autoNumber!=="none");return h},EquationStar:function(h,i){this.stack.global.tagged=true;return i},checkEqnEnv:function(){if(this.stack.global.eqnenv){g.Error("Erroneous nesting of equation structures")}this.stack.global.eqnenv=true},MultiIntegral:function(h,l){var k=this.GetNext();if(k==="\\"){var j=this.i;k=this.GetArgument(h);this.i=j;if(k==="\\limits"){if(h==="\\idotsint"){l="\\!\\!\\mathop{\\,\\,"+l+"}"}else{l="\\!\\!\\!\\mathop{\\,\\,\\,"+l+"}"}}}this.string=l+" "+this.string.slice(this.i);this.i=0},xArrow:function(j,n,m,h){var k={width:"+"+(m+h)+"mu",lspace:m+"mu"};var o=this.GetBrackets(j),p=this.ParseArg(j);var q=b.mo(b.chars(String.fromCharCode(n))).With({stretchy:true,texClass:b.TEXCLASS.REL});var i=b.munderover(q);i.SetData(i.over,b.mpadded(p).With(k).With({voffset:".15em"}));if(o){o=g.Parse(o,this.stack.env).mml();i.SetData(i.under,b.mpadded(o).With(k).With({voffset:"-.24em"}))}this.Push(i)},GetDelimiterArg:function(h){var i=this.trimSpaces(this.GetArgument(h));if(i==""){return null}if(d.delimiter[i]==null){g.Error("Missing or unrecognized delimiter for "+h)}return this.convertDelimiter(i)},GetStar:function(){var h=(this.GetNext()==="*");if(h){this.i++}return h}});e.Augment({autoTag:function(){var i=this.global;if(!i.notag){f.number++;i.tagID=a.formatNumber(f.number.toString());var h=g.Parse("\\text{"+a.formatTag(i.tagID)+"}",{}).mml();i.tag=b.mtd(h.With({id:a.formatID(i.tagID)}))}},getTag:function(){var i=this.global,h=i.tag;i.tagged=true;if(i.label){f.eqlabels[i.label]=i.tagID;if(a.useLabelIds){h.id=a.formatID(i.label)}}delete i.tag;delete i.tagID;delete i.label;return h}});e.multline=e.array.Subclass({type:"multline",Init:function(i,h){this.SUPER(arguments).Init.apply(this);this.numbered=(i&&a.autoNumber!=="none");this.save={notag:h.global.notag};h.global.tagged=!i&&!h.global.forcetag},EndEntry:function(){var h=b.mtd.apply(b,this.data);if(this.data.shove){h.columnalign=this.data.shove}this.row.push(h);this.data=[]},EndRow:function(){if(this.row.length!=1){g.Error("multline rows must have exactly one column")}this.table.push(this.row);this.row=[]},EndTable:function(){this.SUPER(arguments).EndTable.call(this);if(this.table.length){var j=this.table.length-1,l,k=-1;if(!this.table[0][0].columnalign){this.table[0][0].columnalign=b.ALIGN.LEFT}if(!this.table[j][0].columnalign){this.table[j][0].columnalign=b.ALIGN.RIGHT}if(!this.global.tag&&this.numbered){this.autoTag()}if(this.global.tag&&!this.global.notags){k=(this.arraydef.side==="left"?0:this.table.length-1);this.table[k]=[this.getTag()].concat(this.table[k])}for(l=0,j=this.table.length;l<j;l++){var h=(l===k?b.mlabeledtr:b.mtr);this.table[l]=h.apply(b,this.table[l])}}this.global.notag=this.save.notag}});e.AMSarray=e.array.Subclass({type:"AMSarray",Init:function(k,j,i,h){this.SUPER(arguments).Init.apply(this);this.numbered=(j&&a.autoNumber!=="none");this.save={notags:h.global.notags,notag:h.global.notag};h.global.notags=(i?null:k);h.global.tagged=!j&&!h.global.forcetag},EndRow:function(){var h=b.mtr;if(!this.global.tag&&this.numbered){this.autoTag()}if(this.global.tag&&!this.global.notags){this.row=[this.getTag()].concat(this.row);h=b.mlabeledtr}if(this.numbered){delete this.global.notag}this.table.push(h.apply(b,this.row));this.row=[]},EndTable:function(){this.SUPER(arguments).EndTable.call(this);this.global.notags=this.save.notags;this.global.notag=this.save.notag}});e.start.Augment({oldCheckItem:e.start.prototype.checkItem,checkItem:function(j){if(j.type==="stop"){var h=this.mmlData(),i=this.global;if(f.display&&!i.tag&&!i.tagged&&!i.isInner&&(a.autoNumber==="all"||i.forcetag)){this.autoTag()}if(i.tag){var l=[this.getTag(),b.mtd(h)];var k={side:g.config.TagSide,minlabelspacing:g.config.TagIndent,columnalign:h.displayAlign};if(h.displayAlign===b.INDENTALIGN.LEFT){k.width="100%";if(h.displayIndent&&!String(h.displayIndent).match(/^0+(\.0*)?($|[a-z%])/)){k.columnwidth=h.displayIndent+" fit";k.columnspacing="0";l=[l[0],b.mtd(),l[1]]}}else{if(h.displayAlign===b.INDENTALIGN.RIGHT){k.width="100%";if(h.displayIndent&&!String(h.displayIndent).match(/^0+(\.0*)?($|[a-z%])/)){k.columnwidth="fit "+h.displayIndent;k.columnspacing="0";l[2]=b.mtd()}}}h=b.mtable(b.mlabeledtr.apply(b,l)).With(k)}return e.mml(h)}return this.oldCheckItem.call(this,j)}});g.prefilterHooks.Add(function(h){f.display=h.display;f.number=f.startNumber;f.eqlabels={};f.badref=false;if(f.refUpdate){f.number=h.script.MathJax.startNumber}});g.postfilterHooks.Add(function(h){h.script.MathJax.startNumber=f.startNumber;f.startNumber=f.number;MathJax.Hub.Insert(f.labels,f.eqlabels);if(f.badref&&!h.math.texError){f.refs.push(h.script)}});MathJax.Hub.Register.MessageHook("Begin Math Input",function(){f.refs=[];f.refUpdate=false});MathJax.Hub.Register.MessageHook("End Math Input",function(k){if(f.refs.length){f.refUpdate=true;for(var j=0,h=f.refs.length;j<h;j++){f.refs[j].MathJax.state=MathJax.ElementJax.STATE.UPDATE}return MathJax.Hub.processInput({scripts:f.refs,start:new Date().getTime(),i:0,j:0,jax:{},jaxIDs:[]})}return null});g.resetEquationNumbers=function(i,h){f.startNumber=(i||0);if(!h){f.labels={}}};MathJax.Hub.Startup.signal.Post("TeX AMSmath Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/AMSmath.js");
|
mcarlo/dataAppPitch
|
index_files/mathjax/extensions/TeX/AMSmath.js
|
JavaScript
|
mit
| 12,519 |
<html>
<body>
<style>
<!--
.dragme{position:relative;}
-->
</style>
<script language="JavaScript1.2">
<!--
var ie=document.all;
var nn6=document.getElementById&&!document.all;
var isdrag=false;
var x,y;
var dobj;
function movemouse(e)
{
if (isdrag)
{
if (e && e.clientX)
{
dobj.style.left = tx + e.clientX - x;
dobj.style.top = ty + e.clientY - y
}
else
{
dobj.style.left = tx + event.clientX - x;
dobj.style.top = ty + event.clientY - y;
}
return false;
}
}
function selectmouse(e)
{
var fobj;
var topelement;
if (e && e.target)
{
fobj = e.target;
topelement = "HTML";
}
else
{
fobj = event.srcElement;
topelement = "BODY";
}
while (fobj.tagName != topelement && fobj.className != "dragme")
{
if (fobj.parentNode)
{
fobj = fobj.parentNode;
}
else
{
fobj = fobj.parentElement;
}
}
if (fobj.className=="dragme")
{
isdrag = true;
dobj = fobj;
tx = parseInt(dobj.style.left+0);
ty = parseInt(dobj.style.top+0);
if (e && e.clientX)
{
x = e.clientX;
y = e.clientY;
}
else
{
x = event.clientX;
y = event.clientY;
}
document.onmousemove=movemouse;
return false;
}
}
document.onmousedown=selectmouse;
document.onmouseup=new Function("isdrag=false");
//-->
</script>
<img src="icon.gif" class="dragme" id="test1"><br>
<img src="icon.gif" class="dragme" id="test2"><br>
<b>"Hi there</b>
<div style="position: absolute; left: 210px; top: 80px; height: 400px; width: 100px; padding: 10em;">
<img src="icon.gif" class="dragme" id="test3"><br>
<img src="icon.gif" class="dragme" id="test4"><br>
</div>
</body>
</html>
|
boringtaoxh/hshs-header
|
node_modules/protractor/node_modules/selenium-webdriver/lib/test/data/dragAndDropTest.html
|
HTML
|
mit
| 1,727 |
webshims.register("form-shim-extend",function(a,b,c,d,e,f){"use strict";b.inputTypes=b.inputTypes||{};var g=b.cfg.forms,h=b.bugs,i=/\s*,\s*/g,j=b.inputTypes,k={radio:1,checkbox:1},l=function(){var a=this,c=(a.getAttribute("type")||"").toLowerCase();return b.inputTypes[c]?c:a.type},m=function(a,b){"type"in a||(a.type=l.call(b))};!function(){if("querySelector"in d){try{h.findRequired=!a('<form action="#" style="width: 1px; height: 1px; overflow: hidden;"><select name="b" required="" /></form>')[0].querySelector("select:required")}catch(b){h.findRequired=!1}(h.bustedValidity||h.findRequired)&&!function(){var b=a.find,c=a.find.matchesSelector,e=/(\:valid|\:invalid|\:optional|\:required)(?=[\s\[\~\.\+\>\:\#*]|$)/gi,f=function(a){return a+"-element"};a.find=function(){var a=Array.prototype.slice,c=function(c){var d=arguments;return d=a.call(d,1,d.length),d.unshift(c.replace(e,f)),b.apply(this,d)};for(var d in b)b.hasOwnProperty(d)&&(c[d]=b[d]);return c}(),(!Modernizr.prefixed||Modernizr.prefixed("matchesSelector",d.documentElement))&&(a.find.matchesSelector=function(a,b){return b=b.replace(e,f),c.call(this,a,b)})}()}}(),b.addInputType=function(a,b){j[a]=b};var n={customError:!1,typeMismatch:!1,badInput:!1,rangeUnderflow:!1,rangeOverflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,patternMismatch:!1,valueMissing:!1,valid:!0},o=function(b){if("select-one"==b.type&&b.size<2){var c=a("> option:first-child",b);return!!c.prop("selected")}return!1},p=a([]),q=function(b){b=a(b);var c,e,f=p;return"radio"==b[0].type&&(c=b[0].name,c?(e=b.prop("form"),f=a(d.getElementsByName(c)).filter(function(){return"radio"==this.type&&a.prop(this,"form")==e&&this.name==c})):f=b),f},r={url:1,email:1,text:1,search:1,tel:1,password:1},s=a.extend({textarea:1},r),t={valueMissing:function(a,b,c){if(!a.prop("required"))return!1;var d=!1;return m(c,a[0]),d="select"==c.nodeName?!b&&(a[0].selectedIndex<0||o(a[0])):k[c.type]?"checkbox"==c.type?!a.is(":checked"):!q(a).filter(":checked")[0]:!b},patternMismatch:function(a,c,d){var e,f=!1;if(""===c||"select"==d.nodeName)return f;if(m(d,a[0]),!r[d.type])return f;var g=a.attr("pattern");if(!g)return f;try{g=new RegExp("^(?:"+g+")$")}catch(h){b.error('invalid pattern value: "'+g+'" | '+h),g=f}if(!g)return f;for(c="email"==d.type&&a.prop("multiple")?c.split(i):[c],e=0;e<c.length;e++)if(!g.test(c[e])){f=!0;break}return f}};a.each({tooShort:["minLength",-1],tooLong:["maxLength",1]},function(a,b){t[a]=function(a,c,d){if("select"==d.nodeName||a.prop("defaultValue")==c)return!1;if(m(d,a[0]),!s[d.type])return!1;var e=a.prop(b[0]);return e>0&&e*b[1]<c.length*b[1]}}),a.each({typeMismatch:"mismatch",badInput:"bad"},function(a,b){t[a]=function(c,d,e){if(""===d||"select"==e.nodeName)return!1;var f=!1;return m(e,c[0]),j[e.type]&&j[e.type][b]?f=j[e.type][b](d,c):"validity"in c[0]&&"name"in c[0].validity&&(f=c[0].validity[a]||!1),f}}),b.modules["form-core"].getGroupElements=q,b.addValidityRule=function(a,b){t[a]=b},a.event.special.invalid={add:function(){a.event.special.invalid.setup.call(this.form||this)},setup:function(){var c=this.form||this;return a.data(c,"invalidEventShim")?void(c=null):(a(c).data("invalidEventShim",!0).on("submit",a.event.special.invalid.handler),b.moveToFirstEvent(c,"submit"),b.bugs.bustedValidity&&a.nodeName(c,"form")&&!function(){var a=c.getAttribute("novalidate");c.setAttribute("novalidate","novalidate"),b.data(c,"bustedNoValidate",null==a?null:a)}(),void(c=null))},teardown:a.noop,handler:function(b){if("submit"==b.type&&!b.testedValidity&&b.originalEvent&&a.nodeName(b.target,"form")&&!a.prop(b.target,"noValidate")){b.testedValidity=!0;var c=!a(b.target).callProp("reportValidity");return c?(b.stopImmediatePropagation(),f.noFormInvalid||a(b.target).trigger("invalid"),!1):void 0}}},a.event.special.submit=a.event.special.submit||{setup:function(){return!1}};var u=a.event.special.submit.setup;a.extend(a.event.special.submit,{setup:function(){return a.nodeName(this,"form")?a(this).on("invalid",a.noop):a("form",this).on("invalid",a.noop),u.apply(this,arguments)}}),b.ready("form-shim-extend2 WINDOWLOAD",function(){a(c).on("invalid",a.noop)}),b.addInputType("email",{mismatch:function(){var a=g.emailReg||/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;return function(b,c){var d,e=!1;if(b)for(b=c.prop("multiple")?b.split(i):[b],d=0;d<b.length;d++)if(!a.test(b[d])){e=!0;break}return e}}()}),b.addInputType("url",{mismatch:function(){var a=g.urlReg||/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;return function(b){return b&&!a.test(b)}}()}),b.defineNodeNameProperty("input","type",{prop:{get:l}}),b.defineNodeNamesProperties(["button","fieldset","output"],{checkValidity:{value:function(){return!0}},reportValidity:{value:function(){return!0}},willValidate:{value:!1},setCustomValidity:{value:a.noop},validity:{writeable:!1,get:function(){return a.extend({},n)}}},"prop");var v=function(c,d){var e,f=a.prop(c,"validity");if(!f)return!0;if(a.data(c,"cachedValidity",f),!f.valid){e=a.Event("invalid");var g=a(c).trigger(e);"reportValidity"!=d||v.unhandledInvalids||e.isDefaultPrevented()||(b.validityAlert.showFor(g),v.unhandledInvalids=!0)}return a.removeData(c,"cachedValidity"),f.valid},w=/^(?:select|textarea|input)/i;["checkValidity","reportValidity"].forEach(function(c){b.defineNodeNameProperty("form",c,{prop:{value:function(){var d=!0,e=a(a.prop(this,"elements")).filter(function(){if(!w.test(this.nodeName))return!1;var a=b.data(this,"shadowData");return!a||!a.nativeElement||a.nativeElement===this});v.unhandledInvalids=!1;for(var f=0,g=e.length;g>f;f++)v(e[f],c)||(d=!1);return d}}})}),["input","textarea","select"].forEach(function(c){var d={setCustomValidity:{value:function(c){a.removeData(this,"cachedValidity"),b.data(this,"customvalidationMessage",""+c),h.bustedValidity&&d.setCustomValidity.prop._supvalue&&d.setCustomValidity.prop._supvalue.apply(this,arguments)}},willValidate:{writeable:!1,get:function(){var b={button:1,reset:1,hidden:1,image:1};return function(){var c=a(this).getNativeElement()[0];return!(c.readOnly||b[c.type]||a(c).is(":disabled"))}}()},validity:{writeable:!1,get:function(){var c=a(this).getNativeElement(),d=c[0],e=a.data(d,"cachedValidity");if(e)return e;if(e=a.extend({},n),!a.prop(d,"willValidate")||"submit"==d.type)return e;var f=c.val(),g={nodeName:d.nodeName.toLowerCase()};return e.customError=!!b.data(d,"customvalidationMessage"),e.customError&&(e.valid=!1),a.each(t,function(a,b){b(c,f,g)&&(e[a]=!0,e.valid=!1)}),a(this).getShadowFocusElement().attr("aria-invalid",e.valid?"false":"true"),c=null,d=null,e}}};["checkValidity","reportValidity"].forEach(function(b){d[b]={value:function(){return v.unhandledInvalids=!1,v(a(this).getNativeElement()[0],b)}}}),b.defineNodeNameProperties(c,d,"prop")}),b.defineNodeNamesBooleanProperty(["input","textarea","select"],"required",{set:function(b){a(this).getShadowFocusElement().attr("aria-required",!!b+"")},initAttr:!0}),b.defineNodeNamesBooleanProperty(["input"],"multiple"),h.bustedValidity&&(b.defineNodeNameProperty("form","novalidate",{attr:{set:function(a){b.data(this,"bustedNoValidate",""+a)},get:function(){var a=b.data(this,"bustedNoValidate");return null==a?e:a}},removeAttr:{value:function(){b.data(this,"bustedNoValidate",null)}}}),a.each(["rangeUnderflow","rangeOverflow","stepMismatch"],function(a,b){t[b]=function(a){return(a[0].validity||{})[b]||!1}})),b.defineNodeNameProperty("form","noValidate",{prop:{set:function(b){b=!!b,b?a.attr(this,"novalidate","novalidate"):a(this).removeAttr("novalidate")},get:function(){return null!=a.attr(this,"novalidate")}}}),["minlength","minLength"].forEach(function(a){b.defineNodeNamesProperty(["input","textarea"],a,{prop:{set:function(a){if(a*=1,0>a)throw"INDEX_SIZE_ERR";this.setAttribute("minlength",a||0)},get:function(){var a=this.getAttribute("minlength");return null==a?-1:1*a||0}}})}),Modernizr.inputtypes.date&&/webkit/i.test(navigator.userAgent)&&!function(){var b={updateInput:1,input:1},c={date:1,time:1,month:1,week:1,"datetime-local":1},e={focusout:1,blur:1},f={updateInput:1,change:1},g=function(a){var c,d,g=!0,h=a.prop("value"),i=h,j=function(c){if(a){var d=a.prop("value");d!==h&&(h=d,c&&b[c.type]||a.trigger("input")),c&&f[c.type]&&(i=d),g||d===i||a.trigger("change")}},k=function(){clearTimeout(d),d=setTimeout(j,9)},l=function(b){clearInterval(c),setTimeout(function(){b&&e[b.type]&&(g=!1),a&&(a.off("focusout blur",l).off("input change updateInput",j),j()),a=null},1)};clearInterval(c),c=setInterval(j,160),k(),a.off({"focusout blur":l,"input change updateInput":j}).on({"focusout blur":l,"input updateInput change":j})};a(d).on("focusin",function(b){b.target&&c[b.target.type]&&!b.target.readOnly&&!b.target.disabled&&g(a(b.target))})}(),b.addReady(function(b,c){var e;a("form",b).add(c.filter("form")).on("invalid",a.noop);try{b!=d||"form"in(d.activeElement||{})||(e=a(b.querySelector("input[autofocus], select[autofocus], textarea[autofocus]")).eq(0).getShadowFocusElement()[0],e&&e.offsetHeight&&e.offsetWidth&&e.focus())}catch(f){}}),Modernizr.input.list||b.defineNodeNameProperty("datalist","options",{prop:{writeable:!1,get:function(){var c,d=this,e=a("select",d);return e[0]?c=a.makeArray(e[0].options||[]):(c=d.getElementsByTagName("option"),c.length&&b.warn("you should wrap your option-elements for a datalist in a select element to support IE and other old browsers.")),c}}});var x={submit:1,button:1,image:1},y={};[{name:"enctype",limitedTo:{"application/x-www-form-urlencoded":1,"multipart/form-data":1,"text/plain":1},defaultProp:"application/x-www-form-urlencoded",proptype:"enum"},{name:"method",limitedTo:{get:1,post:1},defaultProp:"get",proptype:"enum"},{name:"action",proptype:"url"},{name:"target"},{name:"novalidate",propName:"noValidate",proptype:"boolean"}].forEach(function(b){var c="form"+(b.propName||b.name).replace(/^[a-z]/,function(a){return a.toUpperCase()}),e="form"+b.name,f=b.name,g="click.webshimssubmittermutate"+f,h=function(){var d=this;if("form"in d&&x[d.type]){var g=a.prop(d,"form");if(g){var h=a.attr(d,e);if(null!=h&&(!b.limitedTo||h.toLowerCase()===a.prop(d,c))){var i=a.attr(g,f);a.attr(g,f,h),setTimeout(function(){if(null!=i)a.attr(g,f,i);else try{a(g).removeAttr(f)}catch(b){g.removeAttribute(f)}},9)}}}};switch(b.proptype){case"url":var i=d.createElement("form");y[c]={prop:{set:function(b){a.attr(this,e,b)},get:function(){var b=a.attr(this,e);return null==b?"":(i.setAttribute("action",b),i.action)}}};break;case"boolean":y[c]={prop:{set:function(b){b=!!b,b?a.attr(this,"formnovalidate","formnovalidate"):a(this).removeAttr("formnovalidate")},get:function(){return null!=a.attr(this,"formnovalidate")}}};break;case"enum":y[c]={prop:{set:function(b){a.attr(this,e,b)},get:function(){var c=a.attr(this,e);return!c||(c=c.toLowerCase())&&!b.limitedTo[c]?b.defaultProp:c}}};break;default:y[c]={prop:{set:function(b){a.attr(this,e,b)},get:function(){var b=a.attr(this,e);return null!=b?b:""}}}}y[e]||(y[e]={}),y[e].attr={set:function(b){y[e].attr._supset.call(this,b),a(this).off(g).on(g,h)},get:function(){return y[e].attr._supget.call(this)}},y[e].initAttr=!0,y[e].removeAttr={value:function(){a(this).off(g),y[e].removeAttr._supvalue.call(this)}}}),b.defineNodeNamesProperties(["input","button"],y)}),webshims.register("form-message",function(a,b,c,d,e,f){"use strict";f.lazyCustomMessages&&(f.customMessages=!0);var g=b.validityMessages,h=f.customMessages?["customValidationMessage"]:[];g.en=a.extend(!0,{typeMismatch:{defaultMessage:"Please enter a valid value.",email:"Please enter an email address.",url:"Please enter a URL."},badInput:{defaultMessage:"Please enter a valid value.",number:"Please enter a number.",date:"Please enter a date.",time:"Please enter a time.",range:"Invalid input.",month:"Please enter a valid value.","datetime-local":"Please enter a datetime."},rangeUnderflow:{defaultMessage:"Value must be greater than or equal to {%min}."},rangeOverflow:{defaultMessage:"Value must be less than or equal to {%max}."},stepMismatch:"Invalid input.",tooLong:"Please enter at most {%maxlength} character(s). You entered {%valueLen}.",tooShort:"Please enter at least {%minlength} character(s). You entered {%valueLen}.",patternMismatch:"Invalid input. {%title}",valueMissing:{defaultMessage:"Please fill out this field.",checkbox:"Please check this box if you want to proceed."}},g.en||g["en-US"]||{}),"object"==typeof g.en.valueMissing&&["select","radio"].forEach(function(a){g.en.valueMissing[a]=g.en.valueMissing[a]||"Please select an option."}),"object"==typeof g.en.rangeUnderflow&&["date","time","datetime-local","month"].forEach(function(a){g.en.rangeUnderflow[a]=g.en.rangeUnderflow[a]||"Value must be at or after {%min}."}),"object"==typeof g.en.rangeOverflow&&["date","time","datetime-local","month"].forEach(function(a){g.en.rangeOverflow[a]=g.en.rangeOverflow[a]||"Value must be at or before {%max}."}),g["en-US"]||(g["en-US"]=a.extend(!0,{},g.en)),g["en-GB"]||(g["en-GB"]=a.extend(!0,{},g.en)),g["en-AU"]||(g["en-AU"]=a.extend(!0,{},g.en)),g[""]=g[""]||g["en-US"],g.de=a.extend(!0,{typeMismatch:{defaultMessage:"{%value} ist in diesem Feld nicht zul\xe4ssig.",email:"{%value} ist keine g\xfcltige E-Mail-Adresse.",url:"{%value} ist kein(e) g\xfcltige(r) Webadresse/Pfad."},badInput:{defaultMessage:"Geben Sie einen zul\xe4ssigen Wert ein.",number:"Geben Sie eine Nummer ein.",date:"Geben Sie ein Datum ein.",time:"Geben Sie eine Uhrzeit ein.",month:"Geben Sie einen Monat mit Jahr ein.",range:"Geben Sie eine Nummer.","datetime-local":"Geben Sie ein Datum mit Uhrzeit ein."},rangeUnderflow:{defaultMessage:"{%value} ist zu niedrig. {%min} ist der unterste Wert, den Sie benutzen k\xf6nnen."},rangeOverflow:{defaultMessage:"{%value} ist zu hoch. {%max} ist der oberste Wert, den Sie benutzen k\xf6nnen."},stepMismatch:"Der Wert {%value} ist in diesem Feld nicht zul\xe4ssig. Hier sind nur bestimmte Werte zul\xe4ssig. {%title}",tooLong:"Der eingegebene Text ist zu lang! Sie haben {%valueLen} Zeichen eingegeben, dabei sind {%maxlength} das Maximum.",tooShort:"Der eingegebene Text ist zu kurz! Sie haben {%valueLen} Zeichen eingegeben, dabei sind {%minlength} das Minimum.",patternMismatch:"{%value} hat f\xfcr dieses Eingabefeld ein falsches Format. {%title}",valueMissing:{defaultMessage:"Bitte geben Sie einen Wert ein.",checkbox:"Bitte aktivieren Sie das K\xe4stchen."}},g.de||{}),"object"==typeof g.de.valueMissing&&["select","radio"].forEach(function(a){g.de.valueMissing[a]=g.de.valueMissing[a]||"Bitte w\xe4hlen Sie eine Option aus."}),"object"==typeof g.de.rangeUnderflow&&["date","time","datetime-local","month"].forEach(function(a){g.de.rangeUnderflow[a]=g.de.rangeUnderflow[a]||"{%value} ist zu fr\xfch. {%min} ist die fr\xfcheste Zeit, die Sie benutzen k\xf6nnen."}),"object"==typeof g.de.rangeOverflow&&["date","time","datetime-local","month"].forEach(function(a){g.de.rangeOverflow[a]=g.de.rangeOverflow[a]||"{%value} ist zu sp\xe4t. {%max} ist die sp\xe4teste Zeit, die Sie benutzen k\xf6nnen."});var i=g[""],j=function(b,c){return b&&"string"!=typeof b&&(b=b[a.prop(c,"type")]||b[(c.nodeName||"").toLowerCase()]||b.defaultMessage),b||""},k=/</g,l=/>/g,m={value:1,min:1,max:1},n=function(){var d,e={number:function(a){var b=1*a;return b.toLocaleString&&!isNaN(b)&&(a=b.toLocaleString()||a),a}},f=function(b,c,d){var f,g;return m[d]&&(f=a.prop(c,"type"),g=a(c).getShadowElement().data("wsWidget"+f),g&&g.formatValue?b=g.formatValue(b,!1):e[f]&&(b=e[f](b))),b};return[{n:"date",f:"toLocaleDateString"},{n:"time",f:"toLocaleTimeString"},{n:"datetime-local",f:"toLocaleString"}].forEach(function(a){e[a.n]=function(b){var c=new Date(b);return c&&c[a.f]&&(b=c[a.f]()||b),b}}),c.Intl&&Intl.DateTimeFormat&&(d=new Intl.DateTimeFormat(navigator.browserLanguage||navigator.language,{year:"numeric",month:"2-digit"}).format(new Date),d&&d.format&&(e.month=function(a){var b=new Date(a);return b&&(a=d.format(b)||a),a})),b.format={},["date","number","month","time","datetime-local"].forEach(function(a){b.format[a]=function(c,d){return d&&d.nodeType?f(c,d,a):("number"==a&&d&&d.toFixed&&(c=1*c,(!d.fixOnlyFloat||c%1)&&(c=c.toFixed(d.toFixed))),b._format&&b._format[a]?b._format[a](c,d):e[a](c))}}),f}();b.replaceValidationplaceholder=function(c,d,e){var f=a.prop(c,"title");return d&&("patternMismatch"!=e||f||b.error("no title for patternMismatch provided. Always add a title attribute."),f&&(f='<span class="ws-titlevalue">'+f.replace(k,"<").replace(l,">")+"</span>"),-1!=d.indexOf("{%title}")?d=d.replace("{%title}",f):f&&(d=d+" "+f)),d&&-1!=d.indexOf("{%")&&["value","min","max","maxlength","minlength","label"].forEach(function(b){if(-1!==d.indexOf("{%"+b)){var e=("label"==b?a.trim(a('label[for="'+c.id+'"]',c.form).text()).replace(/\*$|:$/,""):a.prop(c,b)||a.attr(c,b)||"")||"";e=""+e,e=n(e,c,b),d=d.replace("{%"+b+"}",e.replace(k,"<").replace(l,">")),"value"==b&&(d=d.replace("{%valueLen}",e.length))}}),d},b.createValidationMessage=function(c,d){var e=j(i[d],c);return e||"badInput"!=d||(e=j(i.typeMismatch,c)),e||"typeMismatch"!=d||(e=j(i.badInput,c)),e||(e=j(g[""][d],c)||a.prop(c,"validationMessage"),"customError"!=d&&b.info("could not find errormessage for: "+d+" / "+a.prop(c,"type")+". in language: "+b.activeLang())),e=b.replaceValidationplaceholder(c,e,d),e||""},(!Modernizr.formvalidation||b.bugs.bustedValidity)&&h.push("validationMessage"),i=b.activeLang(g),a(g).on("change",function(){i=g.__active}),h.forEach(function(c){b.defineNodeNamesProperty(["fieldset","output","button"],c,{prop:{value:"",writeable:!1}}),["input","select","textarea"].forEach(function(d){var e=b.defineNodeNameProperty(d,c,{prop:{get:function(){var c=this,d="";if(!a.prop(c,"willValidate"))return d;var f=a.prop(c,"validity")||{valid:1};return f.valid?d:(d=b.getContentValidationMessage(c,f))?d:f.customError&&c.nodeName&&(d=Modernizr.formvalidation&&!b.bugs.bustedValidity&&e.prop._supget?e.prop._supget.call(c):b.data(c,"customvalidationMessage"))?d:(a.each(f,function(a,e){return"valid"!=a&&e?(d=b.createValidationMessage(c,a),d?!1:void 0):void 0}),d||"")},writeable:!1}})})})}),webshims.register("form-number-date-api",function(a,b,c,d){"use strict";b.addInputType||b.error("you can not call forms-ext feature after calling forms feature. call both at once instead: $.webshims.polyfill('forms forms-ext')"),b.getStep||(b.getStep=function(b,c){var d=a.attr(b,"step");return"any"===d?d:(c=c||i(b),f[c]&&f[c].step?(d=q.number.asNumber(d),(!isNaN(d)&&d>0?d:f[c].step)*(f[c].stepScaleFactor||1)):d)}),b.addMinMaxNumberToCache||(b.addMinMaxNumberToCache=function(a,b,c){a+"AsNumber"in c||(c[a+"AsNumber"]=f[c.type].asNumber(b.attr(a)),isNaN(c[a+"AsNumber"])&&a+"Default"in f[c.type]&&(c[a+"AsNumber"]=f[c.type][a+"Default"]))});var e=parseInt("NaN",10),f=b.inputTypes,g=function(a){return"number"==typeof a||a&&a==1*a},h=function(b){return a('<input type="'+b+'" />').prop("type")===b},i=function(a){return(a.getAttribute("type")||"").toLowerCase()},j=function(a){return a&&!isNaN(1*a)},k=b.addMinMaxNumberToCache,l=function(a,b){a=""+a,b-=a.length;for(var c=0;b>c;c++)a="0"+a;return a},m=1e-7,n=b.bugs.bustedValidity;b.addValidityRule("stepMismatch",function(a,c,d,e){if(""===c)return!1;if("type"in d||(d.type=i(a[0])),"week"==d.type)return!1;var g,h,j=(e||{}).stepMismatch||!1;if(f[d.type]&&f[d.type].step){if("step"in d||(d.step=b.getStep(a[0],d.type)),"any"==d.step)return!1;if("valueAsNumber"in d||(d.valueAsNumber=f[d.type].asNumber(c)),isNaN(d.valueAsNumber))return!1;k("min",a,d),g=d.minAsNumber,isNaN(g)&&(h=a.prop("defaultValue"))&&(g=f[d.type].asNumber(h)),isNaN(g)&&(g=f[d.type].stepBase||0),j=Math.abs((d.valueAsNumber-g)%d.step),j=!(m>=j||Math.abs(j-d.step)<=m)}return j}),[{name:"rangeOverflow",attr:"max",factor:1},{name:"rangeUnderflow",attr:"min",factor:-1}].forEach(function(a){b.addValidityRule(a.name,function(b,c,d,e){var g=(e||{})[a.name]||!1;if(""===c)return g;if("type"in d||(d.type=i(b[0])),f[d.type]&&f[d.type].asNumber){if("valueAsNumber"in d||(d.valueAsNumber=f[d.type].asNumber(c)),isNaN(d.valueAsNumber))return!1;if(k(a.attr,b,d),isNaN(d[a.attr+"AsNumber"]))return g;g=d[a.attr+"AsNumber"]*a.factor<d.valueAsNumber*a.factor-m}return g})}),b.reflectProperties(["input"],["max","min","step"]);var o=b.defineNodeNameProperty("input","valueAsNumber",{prop:{get:function(){var b=this,c=i(b),d=f[c]&&f[c].asNumber?f[c].asNumber(a.prop(b,"value")):o.prop._supget&&o.prop._supget.apply(b,arguments);return null==d&&(d=e),d},set:function(c){var d=this,e=i(d);if(f[e]&&f[e].numberToString){if(isNaN(c))return void a.prop(d,"value","");var g=f[e].numberToString(c);g!==!1?a.prop(d,"value",g):b.error("INVALID_STATE_ERR: DOM Exception 11")}else o.prop._supset&&o.prop._supset.apply(d,arguments)}}}),p=b.defineNodeNameProperty("input","valueAsDate",{prop:{get:function(){var b=this,c=i(b);return f[c]&&f[c].asDate&&!f[c].noAsDate?f[c].asDate(a.prop(b,"value")):p.prop._supget&&p.prop._supget.call(b)||null},set:function(c){var d=this,e=i(d);if(!f[e]||!f[e].dateToString||f[e].noAsDate)return p.prop._supset&&p.prop._supset.apply(d,arguments)||null;if(null===c)return a.prop(d,"value",""),"";var g=f[e].dateToString(c);return g!==!1?(a.prop(d,"value",g),g):void b.error("INVALID_STATE_ERR: DOM Exception 11")}}});a.each({stepUp:1,stepDown:-1},function(c,d){var e=b.defineNodeNameProperty("input",c,{prop:{value:function(c){var g,h,j,k,l,n,o,p=i(this);if(!f[p]||!f[p].asNumber){if(e.prop&&e.prop._supvalue)return e.prop._supvalue.apply(this,arguments);throw b.info("no step method for type: "+p),"invalid state error"}if(l={type:p},c||(c=1,b.warn("you should always use a factor for stepUp/stepDown")),c*=d,g=b.getStep(this,p),"any"==g)throw b.info("step is 'any' can't apply stepUp/stepDown"),"invalid state error";return b.addMinMaxNumberToCache("min",a(this),l),b.addMinMaxNumberToCache("max",a(this),l),h=a.prop(this,"valueAsNumber"),c>0&&!isNaN(l.minAsNumber)&&(isNaN(h)||l.minAsNumber>h)?void a.prop(this,"valueAsNumber",l.minAsNumber):0>c&&!isNaN(l.maxAsNumber)&&(isNaN(h)||l.maxAsNumber<h)?void a.prop(this,"valueAsNumber",l.maxAsNumber):(isNaN(h)&&(h=0),n=l.minAsNumber,isNaN(n)&&(o=a.prop(this,"defaultValue"))&&(n=f[p].asNumber(o)),n||(n=0),g*=c,h=1*(h+g).toFixed(5),j=(h-n)%g,j&&Math.abs(j)>m&&(k=h-j,k+=j>0?g:-g,h=1*k.toFixed(5)),!isNaN(l.maxAsNumber)&&h>l.maxAsNumber||!isNaN(l.minAsNumber)&&h<l.minAsNumber?void b.info("max/min overflow can't apply stepUp/stepDown"):void a.prop(this,"valueAsNumber",h))}}})});var q={number:{bad:function(a){return!g(a)},step:1,stepScaleFactor:1,asNumber:function(a){return g(a)?1*a:e},numberToString:function(a){return g(a)?a:!1}},range:{minDefault:0,maxDefault:100},color:{bad:function(){var a=/^\u0023[a-f0-9]{6}$/;return function(b){return!b||7!=b.length||!a.test(b)}}()},date:{bad:function(a){if(!a||!a.split||!/\d$/.test(a))return!0;var b,c=a.split(/\u002D/);if(3!==c.length)return!0;var d=!1;if(c[0].length<4||2!=c[1].length||c[1]>12||2!=c[2].length||c[2]>33)d=!0;else for(b=0;3>b;b++)if(!j(c[b])){d=!0;break}return d||a!==this.dateToString(this.asDate(a,!0))},step:1,stepScaleFactor:864e5,asDate:function(a,b){return!b&&this.bad(a)?null:new Date(this.asNumber(a,!0))},asNumber:function(a,b){var c=e;return(b||!this.bad(a))&&(a=a.split(/\u002D/),c=Date.UTC(a[0],a[1]-1,a[2])),c},numberToString:function(a){return g(a)?this.dateToString(new Date(1*a)):!1},dateToString:function(a){return a&&a.getFullYear?l(a.getUTCFullYear(),4)+"-"+l(a.getUTCMonth()+1,2)+"-"+l(a.getUTCDate(),2):!1}},time:{bad:function(b,c){if(!b||!b.split||!/\d$/.test(b))return!0;if(b=b.split(/\u003A/),b.length<2||b.length>3)return!0;var d,e=!1;return b[2]&&(b[2]=b[2].split(/\u002E/),d=parseInt(b[2][1],10),b[2]=b[2][0]),a.each(b,function(a,b){return j(b)&&2===b.length?void 0:(e=!0,!1)}),e?!0:b[0]>23||b[0]<0||b[1]>59||b[1]<0?!0:b[2]&&(b[2]>59||b[2]<0)?!0:d&&isNaN(d)?!0:(d&&(100>d?d*=100:10>d&&(d*=10)),c===!0?[b,d]:!1)},step:60,stepBase:0,stepScaleFactor:1e3,asDate:function(a){return a=new Date(this.asNumber(a)),isNaN(a)?null:a},asNumber:function(a){var b=e;return a=this.bad(a,!0),a!==!0&&(b=Date.UTC("1970",0,1,a[0][0],a[0][1],a[0][2]||0),a[1]&&(b+=a[1])),b},dateToString:function(a){if(a&&a.getUTCHours){var b=l(a.getUTCHours(),2)+":"+l(a.getUTCMinutes(),2),c=a.getSeconds();return"0"!=c&&(b+=":"+l(c,2)),c=a.getUTCMilliseconds(),"0"!=c&&(b+="."+l(c,3)),b}return!1}},month:{bad:function(a){return q.date.bad(a+"-01")},step:1,stepScaleFactor:!1,asDate:function(a){return new Date(q.date.asNumber(a+"-01"))},asNumber:function(a){var b=e;return a&&!this.bad(a)&&(a=a.split(/\u002D/),a[0]=1*a[0]-1970,a[1]=1*a[1]-1,b=12*a[0]+a[1]),b},numberToString:function(a){var b,c=!1;return g(a)&&(b=a%12,a=(a-b)/12+1970,b+=1,1>b&&(a-=1,b+=12),c=l(a,4)+"-"+l(b,2)),c},dateToString:function(a){if(a&&a.getUTCHours){var b=q.date.dateToString(a);return b.split&&(b=b.split(/\u002D/))?b[0]+"-"+b[1]:!1}return!1}},"datetime-local":{bad:function(a,b){return a&&a.split&&2===(a+"special").split(/\u0054/).length?(a=a.split(/\u0054/),q.date.bad(a[0])||q.time.bad(a[1],b)):!0},noAsDate:!0,asDate:function(a){return a=new Date(this.asNumber(a)),isNaN(a)?null:a},asNumber:function(a){var b=e,c=this.bad(a,!0);return c!==!0&&(a=a.split(/\u0054/)[0].split(/\u002D/),b=Date.UTC(a[0],a[1]-1,a[2],c[0][0],c[0][1],c[0][2]||0),c[1]&&(b+=c[1])),b},dateToString:function(a,b){return q.date.dateToString(a)+"T"+q.time.dateToString(a,b)}}};!n&&h("range")&&h("time")&&h("month")&&h("datetime-local")||(q.range=a.extend({},q.number,q.range),q.time=a.extend({},q.date,q.time),q.month=a.extend({},q.date,q.month),q["datetime-local"]=a.extend({},q.date,q.time,q["datetime-local"])),["number","month","range","date","time","color","datetime-local"].forEach(function(a){(n||!h(a))&&b.addInputType(a,q[a])}),null==a("<input />").prop("labels")&&b.defineNodeNamesProperty("button, input, keygen, meter, output, progress, select, textarea","labels",{prop:{get:function(){if("hidden"==this.type)return null;var b=this.id,c=a(this).closest("label").filter(function(){var a=this.attributes["for"]||{};return!a.specified||a.value==b});return b&&(c=c.add('label[for="'+b+'"]')),c.get()},writeable:!1}})}),webshims.register("form-datalist",function(a,b,c,d,e,f){"use strict";var g=function(a){a&&"string"==typeof a||(a="DOM"),g[a+"Loaded"]||(g[a+"Loaded"]=!0,b.ready(a,function(){b.loader.loadList(["form-datalist-lazy"])}))},h={submit:1,button:1,reset:1,hidden:1,range:1,date:1,month:1};b.modules["form-number-date-ui"].loaded&&a.extend(h,{number:1,time:1}),b.propTypes.element=function(c,e){b.createPropDefault(c,"attr"),c.prop||(c.prop={get:function(){var b=a.attr(this,e);return b&&(b=d.getElementById(b),b&&c.propNodeName&&!a.nodeName(b,c.propNodeName)&&(b=null)),b||null},writeable:!1})},function(){var i=a.webshims.cfg.forms,j=Modernizr.input.list;if(!j||i.customDatalist){var k=function(){var c=function(){var b;!a.data(this,"datalistWidgetData")&&(b=a.prop(this,"id"))?a('input[list="'+b+'"], input[data-wslist="'+b+'"]').eq(0).attr("list",b):a(this).triggerHandler("updateDatalist")},d={autocomplete:{attr:{get:function(){var b=this,c=a.data(b,"datalistWidget");return c?c._autocomplete:"autocomplete"in b?b.autocomplete:b.getAttribute("autocomplete")},set:function(b){var c=this,d=a.data(c,"datalistWidget");d?(d._autocomplete=b,"off"==b&&d.hideList()):"autocomplete"in c?c.autocomplete=b:c.setAttribute("autocomplete",b)}}}};j?((a("<datalist><select><option></option></select></datalist>").prop("options")||[]).length||b.defineNodeNameProperty("datalist","options",{prop:{writeable:!1,get:function(){var b=this.options||[];if(!b.length){var c=this,d=a("select",c);d[0]&&d[0].options&&d[0].options.length&&(b=d[0].options)}return b}}}),d.list={attr:{get:function(){var c=b.contentAttr(this,"list");return null!=c?(a.data(this,"datalistListAttr",c),h[a.prop(this,"type")]||h[a.attr(this,"type")]||this.removeAttribute("list")):c=a.data(this,"datalistListAttr"),null==c?e:c},set:function(c){var d=this;a.data(d,"datalistListAttr",c),h[a.prop(this,"type")]||h[a.attr(this,"type")]?d.setAttribute("list",c):(b.objectCreate(l,e,{input:d,id:c,datalist:a.prop(d,"list")}),d.setAttribute("data-wslist",c)),a(d).triggerHandler("listdatalistchange")}},initAttr:!0,reflect:!0,propType:"element",propNodeName:"datalist"}):b.defineNodeNameProperties("input",{list:{attr:{get:function(){var a=b.contentAttr(this,"list");return null==a?e:a},set:function(c){var d=this;b.contentAttr(d,"list",c),b.objectCreate(f.shadowListProto,e,{input:d,id:c,datalist:a.prop(d,"list")}),a(d).triggerHandler("listdatalistchange")}},initAttr:!0,reflect:!0,propType:"element",propNodeName:"datalist"}}),b.defineNodeNameProperties("input",d),b.addReady(function(a,b){b.filter("datalist > select, datalist, datalist > option, datalist > select > option").closest("datalist").each(c)})},l={_create:function(d){if(!h[a.prop(d.input,"type")]&&!h[a.attr(d.input,"type")]){var e=d.datalist,f=a.data(d.input,"datalistWidget"),i=this;return e&&f&&f.datalist!==e?(f.datalist=e,f.id=d.id,a(f.datalist).off("updateDatalist.datalistWidget").on("updateDatalist.datalistWidget",a.proxy(f,"_resetListCached")),void f._resetListCached()):e?void(f&&f.datalist===e||(this.datalist=e,this.id=d.id,this.hasViewableData=!0,this._autocomplete=a.attr(d.input,"autocomplete"),a.data(d.input,"datalistWidget",this),a.data(e,"datalistWidgetData",this),g("WINDOWLOAD"),b.isReady("form-datalist-lazy")?c.QUnit?i._lazyCreate(d):setTimeout(function(){i._lazyCreate(d)},9):(a(d.input).one("focus",g),b.ready("form-datalist-lazy",function(){i._destroyed||i._lazyCreate(d)})))):void(f&&f.destroy())}},destroy:function(b){var f,g=a.attr(this.input,"autocomplete");a(this.input).off(".datalistWidget").removeData("datalistWidget"),this.shadowList.remove(),a(d).off(".datalist"+this.id),a(c).off(".datalist"+this.id),this.input.form&&this.input.id&&a(this.input.form).off("submit.datalistWidget"+this.input.id),this.input.removeAttribute("aria-haspopup"),g===e?this.input.removeAttribute("autocomplete"):a(this.input).attr("autocomplete",g),b&&"beforeunload"==b.type&&(f=this.input,setTimeout(function(){a.attr(f,"list",a.attr(f,"list"))},9)),this._destroyed=!0}};b.loader.addModule("form-datalist-lazy",{noAutoCallback:!0,options:a.extend(f,{shadowListProto:l})}),f.list||(f.list={}),k()}}()});
|
tresni/cdnjs
|
ajax/libs/webshim/1.14.3-RC1/minified/shims/combos/28.js
|
JavaScript
|
mit
| 31,566 |
CodeMirror.defineMode("ruby", function(config) {
function wordObj(words) {
var o = {};
for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true;
return o;
}
var keywords = wordObj([
"alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else",
"elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or",
"redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless",
"until", "when", "while", "yield", "nil", "raise", "throw", "catch", "fail", "loop", "callcc",
"caller", "lambda", "proc", "public", "protected", "private", "require", "load",
"require_relative", "extend", "autoload", "__END__", "__FILE__", "__LINE__", "__dir__"
]);
var indentWords = wordObj(["def", "class", "case", "for", "while", "do", "module", "then",
"catch", "loop", "proc", "begin"]);
var dedentWords = wordObj(["end", "until"]);
var matching = {"[": "]", "{": "}", "(": ")"};
var curPunc;
function chain(newtok, stream, state) {
state.tokenize.push(newtok);
return newtok(stream, state);
}
function tokenBase(stream, state) {
curPunc = null;
if (stream.sol() && stream.match("=begin") && stream.eol()) {
state.tokenize.push(readBlockComment);
return "comment";
}
if (stream.eatSpace()) return null;
var ch = stream.next(), m;
if (ch == "`" || ch == "'" || ch == '"') {
return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state);
} else if (ch == "/" && !stream.eol() && stream.peek() != " ") {
return chain(readQuoted(ch, "string-2", true), stream, state);
} else if (ch == "%") {
var style = "string", embed = true;
if (stream.eat("s")) style = "atom";
else if (stream.eat(/[WQ]/)) style = "string";
else if (stream.eat(/[r]/)) style = "string-2";
else if (stream.eat(/[wxq]/)) { style = "string"; embed = false; }
var delim = stream.eat(/[^\w\s]/);
if (!delim) return "operator";
if (matching.propertyIsEnumerable(delim)) delim = matching[delim];
return chain(readQuoted(delim, style, embed, true), stream, state);
} else if (ch == "#") {
stream.skipToEnd();
return "comment";
} else if (ch == "<" && (m = stream.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) {
return chain(readHereDoc(m[1]), stream, state);
} else if (ch == "0") {
if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/);
else if (stream.eat("b")) stream.eatWhile(/[01]/);
else stream.eatWhile(/[0-7]/);
return "number";
} else if (/\d/.test(ch)) {
stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/);
return "number";
} else if (ch == "?") {
while (stream.match(/^\\[CM]-/)) {}
if (stream.eat("\\")) stream.eatWhile(/\w/);
else stream.next();
return "string";
} else if (ch == ":") {
if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state);
if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state);
// :> :>> :< :<< are valid symbols
if (stream.eat(/[\<\>]/)) {
stream.eat(/[\<\>]/);
return "atom";
}
// :+ :- :/ :* :| :& :! are valid symbols
if (stream.eat(/[\+\-\*\/\&\|\:\!]/)) {
return "atom";
}
// Symbols can't start by a digit
if (stream.eat(/[a-zA-Z$@_]/)) {
stream.eatWhile(/[\w]/);
// Only one ? ! = is allowed and only as the last character
stream.eat(/[\?\!\=]/);
return "atom";
}
return "operator";
} else if (ch == "@" && stream.match(/^@?[a-zA-Z_]/)) {
stream.eat("@");
stream.eatWhile(/[\w]/);
return "variable-2";
} else if (ch == "$") {
if (stream.eat(/[a-zA-Z_]/)) {
stream.eatWhile(/[\w]/);
} else if (stream.eat(/\d/)) {
stream.eat(/\d/);
} else {
stream.next(); // Must be a special global like $: or $!
}
return "variable-3";
} else if (/[a-zA-Z_]/.test(ch)) {
stream.eatWhile(/[\w]/);
stream.eat(/[\?\!]/);
if (stream.eat(":")) return "atom";
return "ident";
} else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) {
curPunc = "|";
return null;
} else if (/[\(\)\[\]{}\\;]/.test(ch)) {
curPunc = ch;
return null;
} else if (ch == "-" && stream.eat(">")) {
return "arrow";
} else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) {
stream.eatWhile(/[=+\-\/*:\.^%<>~|]/);
return "operator";
} else {
return null;
}
}
function tokenBaseUntilBrace() {
var depth = 1;
return function(stream, state) {
if (stream.peek() == "}") {
depth--;
if (depth == 0) {
state.tokenize.pop();
return state.tokenize[state.tokenize.length-1](stream, state);
}
} else if (stream.peek() == "{") {
depth++;
}
return tokenBase(stream, state);
};
}
function tokenBaseOnce() {
var alreadyCalled = false;
return function(stream, state) {
if (alreadyCalled) {
state.tokenize.pop();
return state.tokenize[state.tokenize.length-1](stream, state);
}
alreadyCalled = true;
return tokenBase(stream, state);
};
}
function readQuoted(quote, style, embed, unescaped) {
return function(stream, state) {
var escaped = false, ch;
if (state.context.type === 'read-quoted-paused') {
state.context = state.context.prev;
stream.eat("}");
}
while ((ch = stream.next()) != null) {
if (ch == quote && (unescaped || !escaped)) {
state.tokenize.pop();
break;
}
if (embed && ch == "#" && !escaped) {
if (stream.eat("{")) {
if (quote == "}") {
state.context = {prev: state.context, type: 'read-quoted-paused'};
}
state.tokenize.push(tokenBaseUntilBrace());
break;
} else if (/[@\$]/.test(stream.peek())) {
state.tokenize.push(tokenBaseOnce());
break;
}
}
escaped = !escaped && ch == "\\";
}
return style;
};
}
function readHereDoc(phrase) {
return function(stream, state) {
if (stream.match(phrase)) state.tokenize.pop();
else stream.skipToEnd();
return "string";
};
}
function readBlockComment(stream, state) {
if (stream.sol() && stream.match("=end") && stream.eol())
state.tokenize.pop();
stream.skipToEnd();
return "comment";
}
return {
startState: function() {
return {tokenize: [tokenBase],
indented: 0,
context: {type: "top", indented: -config.indentUnit},
continuedLine: false,
lastTok: null,
varList: false};
},
token: function(stream, state) {
if (stream.sol()) state.indented = stream.indentation();
var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype;
if (style == "ident") {
var word = stream.current();
style = keywords.propertyIsEnumerable(stream.current()) ? "keyword"
: /^[A-Z]/.test(word) ? "tag"
: (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def"
: "variable";
if (indentWords.propertyIsEnumerable(word)) kwtype = "indent";
else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent";
else if ((word == "if" || word == "unless") && stream.column() == stream.indentation())
kwtype = "indent";
}
if (curPunc || (style && style != "comment")) state.lastTok = word || curPunc || style;
if (curPunc == "|") state.varList = !state.varList;
if (kwtype == "indent" || /[\(\[\{]/.test(curPunc))
state.context = {prev: state.context, type: curPunc || style, indented: state.indented};
else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev)
state.context = state.context.prev;
if (stream.eol())
state.continuedLine = (curPunc == "\\" || style == "operator");
return style;
},
indent: function(state, textAfter) {
if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0;
var firstChar = textAfter && textAfter.charAt(0);
var ct = state.context;
var closing = ct.type == matching[firstChar] ||
ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter);
return ct.indented + (closing ? 0 : config.indentUnit) +
(state.continuedLine ? config.indentUnit : 0);
},
electricChars: "}de", // enD and rescuE
lineComment: "#"
};
});
CodeMirror.defineMIME("text/x-ruby", "ruby");
|
GaryChamberlain/cdnjs
|
ajax/libs/codemirror/3.20.0/mode/ruby/ruby.js
|
JavaScript
|
mit
| 8,905 |
var baseMerge = require('../internal/baseMerge'),
createAssigner = require('../internal/createAssigner');
/**
* Recursively merges own enumerable properties of the source object(s), that
* don't resolve to `undefined` into the destination object. Subsequent sources
* overwrite property assignments of previous sources. If `customizer` is
* provided it's invoked to produce the merged values of the destination and
* source properties. If `customizer` returns `undefined` merging is handled
* by the method instead. The `customizer` is bound to `thisArg` and invoked
* with five arguments: (objectValue, sourceValue, key, object, source).
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @param {Function} [customizer] The function to customize assigned values.
* @param {*} [thisArg] The `this` binding of `customizer`.
* @returns {Object} Returns `object`.
* @example
*
* var users = {
* 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
* };
*
* var ages = {
* 'data': [{ 'age': 36 }, { 'age': 40 }]
* };
*
* _.merge(users, ages);
* // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
*
* // using a customizer callback
* var object = {
* 'fruits': ['apple'],
* 'vegetables': ['beet']
* };
*
* var other = {
* 'fruits': ['banana'],
* 'vegetables': ['carrot']
* };
*
* _.merge(object, other, function(a, b) {
* if (_.isArray(a)) {
* return a.concat(b);
* }
* });
* // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
*/
var merge = createAssigner(baseMerge);
module.exports = merge;
|
xzzw9987/Memos
|
project/LearnReact/node_modules/react-css-modules/node_modules/lodash/object/merge.js
|
JavaScript
|
mit
| 1,710 |
var baseMerge = require('../internal/baseMerge'),
createAssigner = require('../internal/createAssigner');
/**
* Recursively merges own enumerable properties of the source object(s), that
* don't resolve to `undefined` into the destination object. Subsequent sources
* overwrite property assignments of previous sources. If `customizer` is
* provided it's invoked to produce the merged values of the destination and
* source properties. If `customizer` returns `undefined` merging is handled
* by the method instead. The `customizer` is bound to `thisArg` and invoked
* with five arguments: (objectValue, sourceValue, key, object, source).
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @param {Function} [customizer] The function to customize assigned values.
* @param {*} [thisArg] The `this` binding of `customizer`.
* @returns {Object} Returns `object`.
* @example
*
* var users = {
* 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
* };
*
* var ages = {
* 'data': [{ 'age': 36 }, { 'age': 40 }]
* };
*
* _.merge(users, ages);
* // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
*
* // using a customizer callback
* var object = {
* 'fruits': ['apple'],
* 'vegetables': ['beet']
* };
*
* var other = {
* 'fruits': ['banana'],
* 'vegetables': ['carrot']
* };
*
* _.merge(object, other, function(a, b) {
* if (_.isArray(a)) {
* return a.concat(b);
* }
* });
* // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
*/
var merge = createAssigner(baseMerge);
module.exports = merge;
|
meetsandeepan/meetsandeepan.github.io
|
node_modules/grunt-legacy-log/node_modules/lodash/object/merge.js
|
JavaScript
|
mit
| 1,710 |
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Upgrading from 2.1.2 to 2.1.3 — CodeIgniter 3.1.6 documentation</title>
<link rel="shortcut icon" href="../_static/ci-icon.ico"/>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" />
<link rel="index" title="Index"
href="../genindex.html"/>
<link rel="search" title="Search" href="../search.html"/>
<link rel="top" title="CodeIgniter 3.1.6 documentation" href="../index.html"/>
<link rel="up" title="Upgrading From a Previous Version" href="upgrading.html"/>
<link rel="next" title="Upgrading from 2.1.1 to 2.1.2" href="upgrade_212.html"/>
<link rel="prev" title="Upgrading from 2.1.3 to 2.1.4" href="upgrade_214.html"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div id="nav">
<div id="nav_inner">
<div id="pulldown-menu" class="ciNav">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">Welcome to CodeIgniter</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Installation Instructions</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="downloads.html">Downloading CodeIgniter</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html">Installation Instructions</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="upgrading.html">Upgrading From a Previous Version</a></li>
<li class="toctree-l2"><a class="reference internal" href="troubleshooting.html">Troubleshooting</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/index.html">General Topics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP Style Guide</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div id="nav2">
<a href="#" id="openToc">
<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAAAf/bAIQABAMDAwMDBAMDBAYEAwQGBwUEBAUHCAYGBwYGCAoICQkJCQgKCgwMDAwMCgwMDQ0MDBERERERFBQUFBQUFBQUFAEEBQUIBwgPCgoPFA4ODhQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgAKwCaAwERAAIRAQMRAf/EAHsAAQAABwEBAAAAAAAAAAAAAAABAwQFBgcIAgkBAQAAAAAAAAAAAAAAAAAAAAAQAAEDAwICBwYEAgsAAAAAAAIBAwQAEQUSBiEHkROTVNQWGDFBUVIUCHEiMtOUFWGBobHRQlMkZIRVEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwDSC+ygkOOaUoKigUCgUCgUCgUCgUCgUCgUCgkuGguIP9FBMFb0Hqg7We+3jlmIqqYFf4ub+/QYlnOR/LqIBKGFUbf8qWv971BytQXXE7Y3Lnm3HsFhp2TaZJAdchRXpIgSpdEJWxJEW3xoKV7F5OMy7JkQn2o7D6w33XGjEAkoiqrJEqIiOIiKuhePCgqp22dyYyS3CyWHnQ5joG61HkRnmnTbaFSMhExRVQRRVJU9iUHjE7ez+fJ0MFipmUNhBV8YUd2SoIV9KkjQla9ltegttBdPLW4/qocL+UTfrMiHW4+P9M71shuyrqaHTcxsl7jegpsji8nh5ZwMvDfgTm0RTjSmjYdFCS6KoOIipdFunCgmNYTMv457MMY6U7iI6oMieDDhRm1VbIhuoOkbqtuK0Hpzb+eZcYZexUxt6UyUqK2cd0SdjtgrhOgijcgERUlJOCIl6CpgbP3blRI8XgMjNARAyKNDfeRBdFDBVUAXgQrqH4pxoJTu2NysY97LP4ac1io5q1InHFeGO24LnVKJuKOkSQ/yKir+rh7aCLG1dzypZQI2FnvTgccYOM3FeN0XWERXAUEFVQgQkUktdLpegm+Td3/Xli/L+S/mYNJIOF9G/wBeLKrZHFb0akG6W1WtQWSg3Dyg5e7V3fipE3O4/wCrktyzYA+ufas2LbZIlmnAT2kvuoN1wft95augilglX/tzP3qCu9O3LL/wV/i5v79BvmTADq14UGu91467Z6U9y0HzH/ncj/U/sT/CgynZG7I2NezpZGUjIycJkYkZSG+uQ81pbBNKLxJfjwoMqZ3/ALYHl35AJ7/cuwHcu5k7r1Q5pHetBjquqVVJWGxj9Zrtcl/Ggy3dHMvauR3HFZj5nHNxSyW5JISYDMoIwx8tFIGHZhPNaykGapr6rUAiicEoMG21lMRj8buPAz8xhJrr7uOeiPTCyAwXUaGR1mgozbTusOsFLEiJ7fbQa/h7gcjy2H3V6xppwDNtUSxCJIqp7valBuWVzJ22xuCROXNNZiJkMtms0DbjUkAZjzoDrTMd9dDRI44ZC2YsrYdKWP2WDT2S3N9dNdlRYrGMYc06IURXSYb0igrpWS485xVNS6nF4rwslkoMwnbpgZLB7bmt5uMweAhDEl4B5uSLzzqTnnyVpW2jaJHRMSIjdDiiotvy3DOE5rYTEbkl5yFn28k7JyG4c7AU2HtLH1uKfaiMPI40CdYbpNtmLdwTSn5rewLNld+7TLdeal4WarWBkbVKBjgdElMJJwAAY5fl4kB3b1fp4XvagsGS3FjJfLzDNtS8aeXx7LzT7TyzByQE5PccRGRC0ZRUDRV6y62vbjagzLmJzS2vuPK43JY6aP1TW6Jz+RIWyFtyC06y3EkiiinAo7YCqfq1AqqnGgsOH3lhZO8d1pmcpB8j5XIm9OYlBJSQ/FSS4427DKO0RC8AlcEMhFdViRR1WDWR5t3WXVuL1d106kG9vdeye2g60+1FDyW0shIcXVpyroXt8I8dfd+NB1vioAdWnD3UF1+gD4UFc6CEKpagxXN43rwJLUHz7yX2c8zokt9uHlsPIhA4aRnnHJTLptIS6CNsY7iASpxUUMkReGpfbQW0vtN5pitvrsN28rwtBD0nc0+/Yft5XhaB6TuaXfsP28rwtA9J3NPv2H7eV4Wgek7mn37D9vK8LQPSdzT79h+3leFoHpO5pd+w/byvC0D0nc0u/Yft5XhaB6TuaXfsP28rwtA9J3NLv2H7eV4Wgek7ml37D9vK8LQPSdzS79h+3leFoHpO5p9+w/byvC0E9r7Reazy2HIYVPxkS/CUHVn26cosxyv2g7h89LYmZSXOenvLEQ1YaQ222RATcQCP8rSGqqA8S02W2pQ6FhMoAIlqCtsnwoCpdKClejI4i3Sgtb+GBxVuNBSFt1pV/RQefLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8utJ/koJ7WCbBU/LQXOPAFq1koK8B0pag90CggtBBf6qB0UDooHRQOigdFA6KB0UDooHRQOigdFA6KB0UDooI0EaBQf//Z" title="Toggle Table of Contents" alt="Toggle Table of Contents" />
</a>
</div>
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="../index.html" class="fa fa-home"> CodeIgniter</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">Welcome to CodeIgniter</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Installation Instructions</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="downloads.html">Downloading CodeIgniter</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html">Installation Instructions</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="upgrading.html">Upgrading From a Previous Version</a></li>
<li class="toctree-l2"><a class="reference internal" href="troubleshooting.html">Troubleshooting</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/index.html">General Topics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP Style Guide</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li>
</ul>
</li>
</ul>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">CodeIgniter</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html">Docs</a> »</li>
<li><a href="index.html">Installation Instructions</a> »</li>
<li><a href="upgrading.html">Upgrading From a Previous Version</a> »</li>
<li>Upgrading from 2.1.2 to 2.1.3</li>
<li class="wy-breadcrumbs-aside">
</li>
<div style="float:right;margin-left:5px;" id="closeMe">
<img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" />
</div>
</ul>
<hr/>
</div>
<div role="main" class="document">
<div class="section" id="upgrading-from-2-1-2-to-2-1-3">
<h1>Upgrading from 2.1.2 to 2.1.3<a class="headerlink" href="#upgrading-from-2-1-2-to-2-1-3" title="Permalink to this headline">¶</a></h1>
<p>Before performing an update you should take your site offline by
replacing the index.php file with a static one.</p>
<div class="section" id="step-1-update-your-codeigniter-files">
<h2>Step 1: Update your CodeIgniter files<a class="headerlink" href="#step-1-update-your-codeigniter-files" title="Permalink to this headline">¶</a></h2>
<p>Replace all files and directories in your “system” folder.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If you have any custom developed files in these folders please
make copies of them first.</p>
</div>
</div>
<div class="section" id="step-2-update-your-user-guide">
<h2>Step 2: Update your user guide<a class="headerlink" href="#step-2-update-your-user-guide" title="Permalink to this headline">¶</a></h2>
<p>Please also replace your local copy of the user guide with the new
version.</p>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="upgrade_212.html" class="btn btn-neutral float-right" title="Upgrading from 2.1.1 to 2.1.2">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="upgrade_214.html" class="btn btn-neutral" title="Upgrading from 2.1.3 to 2.1.4"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2014 - 2017, British Columbia Institute of Technology.
Last updated on Sep 25, 2017.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../',
VERSION:'3.1.6',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
|
ardhyanth/hiDoc
|
user_guide/installation/upgrade_213.html
|
HTML
|
mit
| 35,905 |
/* ssl/ssl_algs.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#include <stdio.h>
#include <openssl/objects.h>
#include <openssl/lhash.h>
#include "ssl_locl.h"
int SSL_library_init(void)
{
#ifndef OPENSSL_NO_DES
EVP_add_cipher(EVP_des_cbc());
EVP_add_cipher(EVP_des_ede3_cbc());
#endif
#ifndef OPENSSL_NO_IDEA
EVP_add_cipher(EVP_idea_cbc());
#endif
#ifndef OPENSSL_NO_RC4
EVP_add_cipher(EVP_rc4());
#endif
#ifndef OPENSSL_NO_RC2
EVP_add_cipher(EVP_rc2_cbc());
/* Not actually used for SSL/TLS but this makes PKCS#12 work
* if an application only calls SSL_library_init().
*/
EVP_add_cipher(EVP_rc2_40_cbc());
#endif
#ifndef OPENSSL_NO_AES
EVP_add_cipher(EVP_aes_128_cbc());
EVP_add_cipher(EVP_aes_192_cbc());
EVP_add_cipher(EVP_aes_256_cbc());
#endif
#ifndef OPENSSL_NO_CAMELLIA
EVP_add_cipher(EVP_camellia_128_cbc());
EVP_add_cipher(EVP_camellia_256_cbc());
#endif
#ifndef OPENSSL_NO_SEED
EVP_add_cipher(EVP_seed_cbc());
#endif
#ifndef OPENSSL_NO_MD5
EVP_add_digest(EVP_md5());
EVP_add_digest_alias(SN_md5,"ssl2-md5");
EVP_add_digest_alias(SN_md5,"ssl3-md5");
#endif
#ifndef OPENSSL_NO_SHA
EVP_add_digest(EVP_sha1()); /* RSA with sha1 */
EVP_add_digest_alias(SN_sha1,"ssl3-sha1");
EVP_add_digest_alias(SN_sha1WithRSAEncryption,SN_sha1WithRSA);
#endif
#ifndef OPENSSL_NO_SHA256
EVP_add_digest(EVP_sha224());
EVP_add_digest(EVP_sha256());
#endif
#ifndef OPENSSL_NO_SHA512
EVP_add_digest(EVP_sha384());
EVP_add_digest(EVP_sha512());
#endif
#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_DSA)
EVP_add_digest(EVP_dss1()); /* DSA with sha1 */
EVP_add_digest_alias(SN_dsaWithSHA1,SN_dsaWithSHA1_2);
EVP_add_digest_alias(SN_dsaWithSHA1,"DSS1");
EVP_add_digest_alias(SN_dsaWithSHA1,"dss1");
#endif
#ifndef OPENSSL_NO_ECDSA
EVP_add_digest(EVP_ecdsa());
#endif
/* If you want support for phased out ciphers, add the following */
#if 0
EVP_add_digest(EVP_sha());
EVP_add_digest(EVP_dss());
#endif
#ifndef OPENSSL_NO_COMP
/* This will initialise the built-in compression algorithms.
The value returned is a STACK_OF(SSL_COMP), but that can
be discarded safely */
(void)SSL_COMP_get_compression_methods();
#endif
/* initialize cipher/digest methods table */
ssl_load_ciphers();
return(1);
}
|
oubeichen/lk-v500
|
lib/openssl/ssl/ssl_algs.c
|
C
|
mit
| 5,370 |
/*!
* SVG.js Connectable Plugin
* =========================
*
* A JavaScript library for connecting SVG things.
* Created with <3 and JavaScript by the jillix developers.
*
* svg.connectable.js 1.0.1
* Licensed under the MIT license.
* */
;(function() {
var container = null;
var markers = null;
/**
* connectable
* Connects two elements.
*
* @name connectable
* @function
* @param {Object} options An object containing the following fields:
*
* - `container` (SVGElement): The line elements container.
* - `markers` (SVGElement): The marker elements container.
*
* @param {SVGElement} elmTarget The target SVG element.
* @return {Object} The connectable object containing:
*
* - `source` (SVGElement): The source element.
* - `target` (SVGElement): The target element.
* - `line` (SVGElement): The line element.
* - `marker` (SVGElement): The marker element.
* - `padEllipe` (Boolean): If `true`, the line coordinates will be placed with a padding.
* - [`computeLineCoordinates` (Function)](#computelinecoordinatescon)
* - [`update` (Function)](#update)
* - [`setLineColor` (Function)](#setlinecolorcolor-c)
*/
function connectable(options, elmTarget) {
var con = {};
if (elmTarget === undefined) {
elmTarget = options;
options = {};
}
container = options.container || container;
var elmSource = this;
markers = options.markers || markers;
var marker = markers.marker(10, 10);
var markerId = "triangle-" + Math.random().toString(16);
var line = container.line().attr("marker-end", "url(#" + markerId + ")");
marker.attr({
id: markerId,
viewBox: "0 0 10 10",
refX: "0",
refY: "5",
markerUnits: "strokeWidth",
markerWidth: "4",
markerHeight: "5"
});
marker.path().attr({
d: "M 0 0 L 10 5 L 0 10 z"
});
// Source and target positions
var sPos = {};
var tPos = {};
// Append the SVG elements
con.source = elmSource;
con.target = elmTarget;
con.line = line;
con.marker = marker;
/**
* computeLineCoordinates
* The function that computes the new coordinates.
* It can be overriden with a custom function.
*
* @name computeLineCoordinates
* @function
* @param {Connectable} con The connectable instance.
* @return {Object} An object containing the `x1`, `x2`, `y1` and `y2` coordinates.
*/
con.computeLineCoordinates = function (con) {
var sPos = con.source.bbox();
var tPos = con.target.bbox();
var x1 = sPos.x + sPos.width / 2;
var y1 = sPos.y + sPos.height / 2;
var x2 = tPos.x + tPos.width / 2;
var y2 = tPos.y + tPos.height / 2;
return {
x1: x1,
y1: y1,
x2: x2,
y2: y2
};
};
if (options.padEllipse) {
con.computeLineCoordinates = function (con) {
var sPos = con.source.transform();
var tPos = con.target.transform();
// Get ellipse radiuses
var xR1 = parseFloat(con.source.node.querySelector("ellipse").getAttribute("rx"));
var yR1 = parseFloat(con.source.node.querySelector("ellipse").getAttribute("ry"));
var xR2 = parseFloat(con.target.node.querySelector("ellipse").getAttribute("rx"));
var yR2 = parseFloat(con.target.node.querySelector("ellipse").getAttribute("ry"));
// Get centers
var sx = sPos.x + xR1 / 2;
var sy = sPos.y + yR1 / 2;
var tx = tPos.x + xR2 / 2;
var ty = tPos.y + yR2 / 2;
// Calculate distance from source center to target center
var dx = tx - sx;
var dy = ty - sy;
var d = Math.sqrt(dx * dx + dy * dy);
// Construct unit vector between centers
var ux = dx / d;
var uy = dy / d;
// Point on source circle
var x1 = sx + xR1 * ux;
var y1 = sy + yR1 * uy;
// Point on target circle
var x2 = sx + (d - xR2 - 5) * ux;
var y2 = sy + (d - yR2 - 5) * uy;
return {
x1: x1 + xR1 / 2,
y1: y1 + yR1 / 2,
x2: x2 + xR2 / 2,
y2: y2 + yR2 / 2
};
};
}
elmSource.cons = elmSource.cons || [];
elmSource.cons.push(con);
/**
* update
* Updates the line coordinates.
*
* @name update
* @function
* @return {undefined}
*/
con.update = function () {
line.attr(con.computeLineCoordinates(con));
};
con.update();
elmSource.on("dragmove", con.update);
elmTarget.on("dragmove", con.update);
/**
* setLineColor
* Sets the line color.
*
* @name setLineColor
* @function
* @param {String} color The new color.
* @param {Connectable} c The connectable instance.
* @return {undefined}
*/
con.setLineColor = function (color, c) {
c = c || this;
c.line.stroke(color);
c.marker.fill(color);
};
return con;
}
SVG.extend(SVG.Element, {
connectable: connectable
});
}).call(this);
|
menuka94/cdnjs
|
ajax/libs/svg.connectable.js/1.1.0/svg.connectable.js
|
JavaScript
|
mit
| 5,852 |
/// <reference path="deployJava.d.ts" />
/**
* @summary Test for the method: "allowPlugin".
*/
function testAllowPlugin() {
var result: boolean = deployJava.allowPlugin();
}
/**
* @summary Test for the method: "compareVersions".
*/
function testCompareVersions() {
var installed = '1.8';
var required = '1.7';
var result = deployJava.compareVersions(installed, required);
}
/**
* @summary Test for the method: "compareVersionToPattern".
*/
function testCompareVersionToPattern() {
var version: string = '1.8';
var patternArray: Array<string> = ['1.6', '1.7', '1.8'];
var familyMatch: boolean = false;
var minMatch: boolean = true;
var result = deployJava.compareVersionToPattern(version, patternArray, familyMatch, minMatch);
}
/**
* @summary Test for the method: "enableAlerts".
*/
function testEnableAlerts() {
deployJava.enableAlerts();
}
/**
* @summary Test for the method: "FFInstall".
*/
function testFFInstall() {
var result: boolean = deployJava.FFInstall();
}
/**
* @summary Test for the method: "getBrowser".
*/
function testGetBrowser() {
var result: string = deployJava.getBrowser();
}
/**
* @summary Test for the method: "getJPIVersionUsingMimeType".
*/
function testGetJPIVersionUsingMimeType() {
deployJava.getJPIVersionUsingMimeType();
}
/**
* @summary Test for the method: "getJREs".
*/
function testGetJREs() {
var versions: Array<String> = deployJava.getJREs();
}
/**
* @summary Test for the method: "getPlugin".
*/
function testGetPlugin() {
var versions: HTMLElement = deployJava.getPlugin();
}
/**
* @summary Test for the method: "IEInstall".
*/
function testIEInstall() {
var result: boolean = deployJava.IEInstall();
}
/**
* @summary Test for the method: "installJRE".
*/
function testInstallJRE() {
var requestVersion: string = '1.8';
var result: boolean = deployJava.installJRE(requestVersion);
}
/**
* @summary Test for the method: "installLatestJRE".
*/
function testInstallLatestJRE() {
var installCallback: Function = () => {};
var result: boolean = deployJava.installLatestJRE(installCallback);
}
/**
* @summary Test for the method: "isAutoInstallEnabled".
*/
function testIsAutoInstallEnabled() {
var requestedJREVersion: string = '1.8';
var result: boolean = deployJava.isAutoInstallEnabled();
var result: boolean = deployJava.isAutoInstallEnabled(requestedJREVersion);
}
/**
* @summary Test for the method: "isAutoUpdateEnabled".
*/
function testIsAutoUpdateEnabled() {
var result: boolean = deployJava.isAutoUpdateEnabled();
}
/**
* @summary Test for the method: "isCallbackSupported".
*/
function testIsCallbackSupported() {
var result: boolean = deployJava.isCallbackSupported();
}
/**
* @summary Test for the method: "isPlugin2".
*/
function testIsPlugin2() {
var result: boolean = deployJava.isPlugin2();
}
/**
* @summary Test for the method: "isPluginInstalled".
*/
function testIsPluginInstalled() {
var result: boolean = deployJava.isPluginInstalled();
}
/**
* @summary Test for the method: "isWebStartInstalled".
*/
function testIsWebStartInstalled() {
var minimumVersion: string = '1.7';
var result: boolean = deployJava.isWebStartInstalled();
var result: boolean = deployJava.isWebStartInstalled(minimumVersion);
}
/**
* @summary Test for the method: "launch".
*/
function testLaunch() {
var jnlp: string = 'http://www.example.com/';
var result: boolean = deployJava.launch(jnlp);
}
/**
* @summary Test for the method: "launchWebStartApplication".
*/
function testLaunchWebStartApplication() {
var jnlp: string = 'http://www.example.com/';
deployJava.launchWebStartApplication(jnlp);
}
/**
* @summary Test for the method: "poll".
*/
function testPool() {
deployJava.poll();
}
/**
* @summary Test for the method: "refresh".
*/
function testRefresh() {
deployJava.refresh();
}
/**
* @summary Test for the method: "runApplet".
*/
function testRunApplet() {
var attributes: Object = {
code:'java2d.Java2DemoApplet.class',
archive:'Java2Demo.jar',
width:710,
height:540
};
var parameters: Object = { fontSize:16, permissions:'sandbox' };
var version: string = '1.8';
deployJava.runApplet(attributes, parameters);
deployJava.runApplet(attributes, parameters, version);
}
/**
* @summary Test for the method: "setAdditionalPackages".
*/
function testSetAdditionalPackages() {
var packageList: string = 'javax.swing';
var result: boolean = deployJava.setAdditionalPackages(packageList);
}
/**
* @summary Test for the method: "setAutoUpdateEnabled".
*/
function testSetAutoUpdateEnabled() {
deployJava.setAutoUpdateEnabled();
}
/**
* @summary Test for the method: "setEarlyAccess".
*/
function testSetEarlyAccess() {
var enabled: string = 'true';
deployJava.setEarlyAccess(enabled);
}
/**
* @summary Test for the method: "setInstallerType".
*/
function testSetInstallerType() {
var type: string = 'kernel';
deployJava.setInstallerType(type);
}
/**
* @summary Test for the method: "testForMSVM".
*/
function testTestForMSVM() {
var result: boolean = deployJava.testForMSVM();
}
/**
* @summary Test for the method: "testUsingActiveX".
*/
function testTestUsingActiveX() {
var version: string = '1.7.0';
var result: boolean = deployJava.testUsingActiveX(version);
}
/**
* @summary Test for the method: "testUsingMimeTypes".
*/
function testTestUsingMimeTypes() {
var version: string = '1.7.0';
var result: boolean = deployJava.testUsingMimeTypes(version);
}
/**
* @summary Test for the method: "testUsingPluginsArray".
*/
function testTestUsingPluginsArray() {
var version: string = '1.7.0';
var result: boolean = deployJava.testUsingPluginsArray(version);
}
/**
* @summary Test for the method: "versionCheck".
*/
function testVersionCheck() {
deployJava.versionCheck('1.x');
}
/**
* @summary Test for the method: "writeAppletTag".
*/
function testWriteAppletTag() {
var attributes: Object = {
code:'java2d.Java2DemoApplet.class',
archive:'Java2Demo.jar',
width:710,
height:540
};
var parameters: Object = { fontSize:16, permissions:'sandbox' };
deployJava.writeAppletTag(attributes, parameters);
}
/**
* @summary Test for the method: "writeEmbedTag".
*/
function testWriteEmbedTag() {
deployJava.writeEmbedTag();
}
|
ajtowf/DefinitelyTyped
|
deployJava/deployJava-tests.ts
|
TypeScript
|
mit
| 6,486 |
'use strict';
var pify = module.exports = function (fn, P, opts) {
if (typeof P !== 'function') {
opts = P;
P = Promise;
}
opts = opts || {};
if (typeof fn !== 'function') {
return P.reject(new TypeError('Expected a function'));
}
return function () {
var that = this;
var args = [].slice.call(arguments);
return new P(function (resolve, reject) {
args.push(function (err, result) {
if (err) {
reject(err);
} else if (opts.multiArgs) {
resolve([].slice.call(arguments, 1));
} else {
resolve(result);
}
});
fn.apply(that, args);
});
};
};
pify.all = function (obj, P, opts) {
if (typeof P !== 'function') {
opts = P;
P = Promise;
}
opts = opts || {};
var filter = function (key) {
if (opts.include) {
return opts.include.indexOf(key) !== -1;
}
if (opts.exclude) {
return opts.exclude.indexOf(key) === -1;
}
return true;
};
var ret = (typeof obj === 'function') ? function () {
if (opts.excludeMain) {
return obj.apply(this, arguments);
}
return pify(obj, P, opts).apply(this, arguments);
} : {};
return Object.keys(obj).reduce(function (ret, key) {
var x = obj[key];
ret[key] = (typeof x === 'function') && filter(key) ? pify(x, P, opts) : x;
return ret;
}, ret);
};
|
amazingBastard/meteor-hackathon-2015
|
node_modules/gulp-jshint/node_modules/gulp-util/node_modules/dateformat/node_modules/meow/node_modules/read-pkg-up/node_modules/read-pkg/node_modules/load-json-file/node_modules/pify/index.js
|
JavaScript
|
mit
| 1,285 |
#!/bin/sh
set -e
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
XCASSET_FILES=()
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
;;
1)
TARGET_DEVICE_ARGS="--target-device iphone"
;;
2)
TARGET_DEVICE_ARGS="--target-device ipad"
;;
3)
TARGET_DEVICE_ARGS="--target-device tv"
;;
4)
TARGET_DEVICE_ARGS="--target-device watch"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
install_resource()
{
if [[ "$1" = /* ]] ; then
RESOURCE_PATH="$1"
else
RESOURCE_PATH="${PODS_ROOT}/$1"
fi
if [[ ! -e "$RESOURCE_PATH" ]] ; then
cat << EOM
error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
EOM
exit 1
fi
case $RESOURCE_PATH in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.framework)
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
*)
echo "$RESOURCE_PATH"
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
;;
esac
}
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
then
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
while read line; do
if [[ $line != "${PODS_ROOT}*" ]]; then
XCASSET_FILES+=("$line")
fi
done <<<"$OTHER_XCASSETS"
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
|
salemoh/GoldenQuraniOS
|
GoldenQuranSwift/Pods/Target Support Files/Pods-GoldenQuranSwift/Pods-GoldenQuranSwift-resources.sh
|
Shell
|
mit
| 5,126 |
YUI.add('dd-ddm', function(Y) {
/**
* Extends the dd-ddm-base Class to add support for the viewport shim to allow a draggable node to drag to be dragged over an iframe or any other node that traps mousemove events.
* It is also required to have Drop Targets enabled, as the viewport shim will contain the shims for the Drop Targets.
* @module dd
* @submodule dd-ddm
* @for DDM
* @namespace DD
*/
Y.mix(Y.DD.DDM, {
/**
* @private
* @property _pg
* @description The shim placed over the screen to track the mousemove event.
* @type {Node}
*/
_pg: null,
/**
* @private
* @property _debugShim
* @description Set this to true to set the shims opacity to .5 for debugging it, default: false.
* @type {Boolean}
*/
_debugShim: false,
_activateTargets: function() { },
_deactivateTargets: function() {},
_startDrag: function() {
if (this.activeDrag && this.activeDrag.get('useShim')) {
this._pg_activate();
this._activateTargets();
}
},
_endDrag: function() {
this._pg_deactivate();
this._deactivateTargets();
},
/**
* @private
* @method _pg_deactivate
* @description Deactivates the shim
*/
_pg_deactivate: function() {
this._pg.setStyle('display', 'none');
},
/**
* @private
* @method _pg_activate
* @description Activates the shim
*/
_pg_activate: function() {
var ah = this.activeDrag.get('activeHandle'), cur = 'auto';
if (ah) {
cur = ah.getStyle('cursor');
}
if (cur == 'auto') {
cur = this.get('dragCursor');
}
this._pg_size();
this._pg.setStyles({
top: 0,
left: 0,
display: 'block',
opacity: ((this._debugShim) ? '.5' : '0'),
cursor: cur
});
},
/**
* @private
* @method _pg_size
* @description Sizes the shim on: activatation, window:scroll, window:resize
*/
_pg_size: function() {
if (this.activeDrag) {
var b = Y.one('body'),
h = b.get('docHeight'),
w = b.get('docWidth');
this._pg.setStyles({
height: h + 'px',
width: w + 'px'
});
}
},
/**
* @private
* @method _createPG
* @description Creates the shim and adds it's listeners to it.
*/
_createPG: function() {
var pg = Y.Node.create('<div></div>'),
bd = Y.one('body'), win;
pg.setStyles({
top: '0',
left: '0',
position: 'absolute',
zIndex: '9999',
overflow: 'hidden',
backgroundColor: 'red',
display: 'none',
height: '5px',
width: '5px'
});
pg.set('id', Y.stamp(pg));
pg.addClass(Y.DD.DDM.CSS_PREFIX + '-shim');
bd.prepend(pg);
this._pg = pg;
this._pg.on('mousemove', Y.throttle(Y.bind(this._move, this), this.get('throttleTime')));
this._pg.on('mouseup', Y.bind(this._end, this));
win = Y.one('win');
Y.on('window:resize', Y.bind(this._pg_size, this));
win.on('scroll', Y.bind(this._pg_size, this));
}
}, true);
}, '@VERSION@' ,{requires:['dd-ddm-base', 'event-resize'], skinnable:false});
|
redmunds/cdnjs
|
ajax/libs/yui/3.3.0/dd/dd-ddm-debug.js
|
JavaScript
|
mit
| 3,854 |
.note-editor {
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
}
.note-editor article,
.note-editor aside,
.note-editor details,
.note-editor figcaption,
.note-editor figure,
.note-editor footer,
.note-editor header,
.note-editor hgroup,
.note-editor main,
.note-editor nav,
.note-editor section,
.note-editor summary {
display: block;
}
.note-editor audio,
.note-editor canvas,
.note-editor video {
display: inline-block;
}
.note-editor audio:not([controls]) {
display: none;
height: 0;
}
.note-editor [hidden],
.note-editor template {
display: none;
}
.note-editor html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
.note-editor body {
margin: 0;
}
.note-editor a {
background: transparent;
}
.note-editor a:focus {
outline: thin dotted;
}
.note-editor a:active,
.note-editor a:hover {
outline: 0;
}
.note-editor h1 {
font-size: 2em;
margin: 0.67em 0;
}
.note-editor abbr[title] {
border-bottom: 1px dotted;
}
.note-editor b,
.note-editor strong {
font-weight: bold;
}
.note-editor dfn {
font-style: italic;
}
.note-editor hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
.note-editor mark {
background: #ff0;
color: #000;
}
.note-editor code,
.note-editor kbd,
.note-editor pre,
.note-editor samp {
font-family: monospace, serif;
font-size: 1em;
}
.note-editor pre {
white-space: pre-wrap;
}
.note-editor q {
quotes: "\201C" "\201D" "\2018" "\2019";
}
.note-editor small {
font-size: 80%;
}
.note-editor sub,
.note-editor sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
.note-editor sup {
top: -0.5em;
}
.note-editor sub {
bottom: -0.25em;
}
.note-editor img {
border: 0;
}
.note-editor svg:not(:root) {
overflow: hidden;
}
.note-editor figure {
margin: 0;
}
.note-editor fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
.note-editor legend {
border: 0;
padding: 0;
}
.note-editor button,
.note-editor input,
.note-editor select,
.note-editor textarea {
font-family: inherit;
font-size: 100%;
margin: 0;
}
.note-editor button,
.note-editor input {
line-height: normal;
}
.note-editor button,
.note-editor select {
text-transform: none;
}
.note-editor button,
.note-editor html input[type="button"],
.note-editor input[type="reset"],
.note-editor input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
}
.note-editor button[disabled],
.note-editor html input[disabled] {
cursor: default;
}
.note-editor input[type="checkbox"],
.note-editor input[type="radio"] {
box-sizing: border-box;
padding: 0;
}
.note-editor input[type="search"] {
-webkit-appearance: textfield;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
.note-editor input[type="search"]::-webkit-search-cancel-button,
.note-editor input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
.note-editor button::-moz-focus-inner,
.note-editor input::-moz-focus-inner {
border: 0;
padding: 0;
}
.note-editor textarea {
overflow: auto;
vertical-align: top;
}
.note-editor table {
border-collapse: collapse;
border-spacing: 0;
}
@media print {
.note-editor * {
text-shadow: none !important;
color: #000 !important;
background: transparent !important;
box-shadow: none !important;
}
.note-editor a,
.note-editor a:visited {
text-decoration: underline;
}
.note-editor a[href]:after {
content: " (" attr(href) ")";
}
.note-editor abbr[title]:after {
content: " (" attr(title) ")";
}
.note-editor .ir a:after,
.note-editor a[href^="javascript:"]:after,
.note-editor a[href^="#"]:after {
content: "";
}
.note-editor pre,
.note-editor blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
.note-editor thead {
display: table-header-group;
}
.note-editor tr,
.note-editor img {
page-break-inside: avoid;
}
.note-editor img {
max-width: 100% !important;
}
@page {
margin: 2cm .5cm;
}
.note-editor p,
.note-editor h2,
.note-editor h3 {
orphans: 3;
widows: 3;
}
.note-editor h2,
.note-editor h3 {
page-break-after: avoid;
}
.note-editor .navbar {
display: none;
}
.note-editor .table td,
.note-editor .table th {
background-color: #fff !important;
}
.note-editor .btn > .caret,
.note-editor .dropup > .btn > .caret {
border-top-color: #000 !important;
}
.note-editor .label {
border: 1px solid #000;
}
.note-editor .table {
border-collapse: collapse !important;
}
.note-editor .table-bordered th,
.note-editor .table-bordered td {
border: 1px solid #ddd !important;
}
}
.note-editor *,
.note-editor *:before,
.note-editor *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.note-editor html {
font-size: 62.5%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.note-editor body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.428571429;
color: #333333;
background-color: #ffffff;
}
.note-editor input,
.note-editor button,
.note-editor select,
.note-editor textarea {
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
.note-editor a {
color: #428bca;
text-decoration: none;
}
.note-editor a:hover,
.note-editor a:focus {
color: #2a6496;
text-decoration: underline;
}
.note-editor a:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.note-editor img {
vertical-align: middle;
}
.note-editor .img-responsive {
display: block;
max-width: 100%;
height: auto;
}
.note-editor .img-rounded {
border-radius: 6px;
}
.note-editor .img-thumbnail {
padding: 4px;
line-height: 1.428571429;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
display: inline-block;
max-width: 100%;
height: auto;
}
.note-editor .img-circle {
border-radius: 50%;
}
.note-editor hr {
margin-top: 20px;
margin-bottom: 20px;
border: 0;
border-top: 1px solid #eeeeee;
}
.note-editor .sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
.note-editor p {
margin: 0 0 10px;
}
.note-editor .lead {
margin-bottom: 20px;
font-size: 16px;
font-weight: 200;
line-height: 1.4;
}
@media (min-width: 768px) {
.note-editor .lead {
font-size: 21px;
}
}
.note-editor small,
.note-editor .small {
font-size: 85%;
}
.note-editor cite {
font-style: normal;
}
.note-editor .text-muted {
color: #999999;
}
.note-editor .text-primary {
color: #428bca;
}
.note-editor .text-primary:hover {
color: #3071a9;
}
.note-editor .text-warning {
color: #c09853;
}
.note-editor .text-warning:hover {
color: #a47e3c;
}
.note-editor .text-danger {
color: #b94a48;
}
.note-editor .text-danger:hover {
color: #953b39;
}
.note-editor .text-success {
color: #468847;
}
.note-editor .text-success:hover {
color: #356635;
}
.note-editor .text-info {
color: #3a87ad;
}
.note-editor .text-info:hover {
color: #2d6987;
}
.note-editor .text-left {
text-align: left;
}
.note-editor .text-right {
text-align: right;
}
.note-editor .text-center {
text-align: center;
}
.note-editor h1,
.note-editor h2,
.note-editor h3,
.note-editor h4,
.note-editor h5,
.note-editor h6,
.note-editor .h1,
.note-editor .h2,
.note-editor .h3,
.note-editor .h4,
.note-editor .h5,
.note-editor .h6 {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 500;
line-height: 1.1;
color: inherit;
}
.note-editor h1 small,
.note-editor h2 small,
.note-editor h3 small,
.note-editor h4 small,
.note-editor h5 small,
.note-editor h6 small,
.note-editor .h1 small,
.note-editor .h2 small,
.note-editor .h3 small,
.note-editor .h4 small,
.note-editor .h5 small,
.note-editor .h6 small,
.note-editor h1 .small,
.note-editor h2 .small,
.note-editor h3 .small,
.note-editor h4 .small,
.note-editor h5 .small,
.note-editor h6 .small,
.note-editor .h1 .small,
.note-editor .h2 .small,
.note-editor .h3 .small,
.note-editor .h4 .small,
.note-editor .h5 .small,
.note-editor .h6 .small {
font-weight: normal;
line-height: 1;
color: #999999;
}
.note-editor h1,
.note-editor h2,
.note-editor h3 {
margin-top: 20px;
margin-bottom: 10px;
}
.note-editor h1 small,
.note-editor h2 small,
.note-editor h3 small,
.note-editor h1 .small,
.note-editor h2 .small,
.note-editor h3 .small {
font-size: 65%;
}
.note-editor h4,
.note-editor h5,
.note-editor h6 {
margin-top: 10px;
margin-bottom: 10px;
}
.note-editor h4 small,
.note-editor h5 small,
.note-editor h6 small,
.note-editor h4 .small,
.note-editor h5 .small,
.note-editor h6 .small {
font-size: 75%;
}
.note-editor h1,
.note-editor .h1 {
font-size: 36px;
}
.note-editor h2,
.note-editor .h2 {
font-size: 30px;
}
.note-editor h3,
.note-editor .h3 {
font-size: 24px;
}
.note-editor h4,
.note-editor .h4 {
font-size: 18px;
}
.note-editor h5,
.note-editor .h5 {
font-size: 14px;
}
.note-editor h6,
.note-editor .h6 {
font-size: 12px;
}
.note-editor .page-header {
padding-bottom: 9px;
margin: 40px 0 20px;
border-bottom: 1px solid #eeeeee;
}
.note-editor ul,
.note-editor ol {
margin-top: 0;
margin-bottom: 10px;
}
.note-editor ul ul,
.note-editor ol ul,
.note-editor ul ol,
.note-editor ol ol {
margin-bottom: 0;
}
.note-editor .list-unstyled {
padding-left: 0;
list-style: none;
}
.note-editor .list-inline {
padding-left: 0;
list-style: none;
}
.note-editor .list-inline > li {
display: inline-block;
padding-left: 5px;
padding-right: 5px;
}
.note-editor dl {
margin-bottom: 20px;
}
.note-editor dt,
.note-editor dd {
line-height: 1.428571429;
}
.note-editor dt {
font-weight: bold;
}
.note-editor dd {
margin-left: 0;
}
@media (min-width: 768px) {
.note-editor .dl-horizontal dt {
float: left;
width: 160px;
clear: left;
text-align: right;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.note-editor .dl-horizontal dd {
margin-left: 180px;
}
.note-editor .dl-horizontal dd:before,
.note-editor .dl-horizontal dd:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .dl-horizontal dd:after {
clear: both;
}
.note-editor .dl-horizontal dd:before,
.note-editor .dl-horizontal dd:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .dl-horizontal dd:after {
clear: both;
}
}
.note-editor abbr[title],
.note-editor abbr[data-original-title] {
cursor: help;
border-bottom: 1px dotted #999999;
}
.note-editor abbr.initialism {
font-size: 90%;
text-transform: uppercase;
}
.note-editor blockquote {
padding: 10px 20px;
margin: 0 0 20px;
border-left: 5px solid #eeeeee;
}
.note-editor blockquote p {
font-size: 17.5px;
font-weight: 300;
line-height: 1.25;
}
.note-editor blockquote p:last-child {
margin-bottom: 0;
}
.note-editor blockquote small {
display: block;
line-height: 1.428571429;
color: #999999;
}
.note-editor blockquote small:before {
content: '\2014 \00A0';
}
.note-editor blockquote.pull-right {
padding-right: 15px;
padding-left: 0;
border-right: 5px solid #eeeeee;
border-left: 0;
}
.note-editor blockquote.pull-right p,
.note-editor blockquote.pull-right small,
.note-editor blockquote.pull-right .small {
text-align: right;
}
.note-editor blockquote.pull-right small:before,
.note-editor blockquote.pull-right .small:before {
content: '';
}
.note-editor blockquote.pull-right small:after,
.note-editor blockquote.pull-right .small:after {
content: '\00A0 \2014';
}
.note-editor blockquote:before,
.note-editor blockquote:after {
content: "";
}
.note-editor address {
margin-bottom: 20px;
font-style: normal;
line-height: 1.428571429;
}
.note-editor code,
.note-editor kdb,
.note-editor pre,
.note-editor samp {
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
}
.note-editor code {
padding: 2px 4px;
font-size: 90%;
color: #c7254e;
background-color: #f9f2f4;
white-space: nowrap;
border-radius: 4px;
}
.note-editor pre {
display: block;
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 1.428571429;
word-break: break-all;
word-wrap: break-word;
color: #333333;
background-color: #f5f5f5;
border: 1px solid #cccccc;
border-radius: 4px;
}
.note-editor pre code {
padding: 0;
font-size: inherit;
color: inherit;
white-space: pre-wrap;
background-color: transparent;
border-radius: 0;
}
.note-editor .pre-scrollable {
max-height: 340px;
overflow-y: scroll;
}
.note-editor .container {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
.note-editor .container:before,
.note-editor .container:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .container:after {
clear: both;
}
.note-editor .container:before,
.note-editor .container:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .container:after {
clear: both;
}
.note-editor .row {
margin-left: -15px;
margin-right: -15px;
}
.note-editor .row:before,
.note-editor .row:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .row:after {
clear: both;
}
.note-editor .row:before,
.note-editor .row:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .row:after {
clear: both;
}
.note-editor .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
position: relative;
min-height: 1px;
padding-left: 15px;
padding-right: 15px;
}
.note-editor .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11 {
float: left;
}
.note-editor .col-xs-12 {
width: 100%;
}
.note-editor .col-xs-11 {
width: 91.66666666666666%;
}
.note-editor .col-xs-10 {
width: 83.33333333333334%;
}
.note-editor .col-xs-9 {
width: 75%;
}
.note-editor .col-xs-8 {
width: 66.66666666666666%;
}
.note-editor .col-xs-7 {
width: 58.333333333333336%;
}
.note-editor .col-xs-6 {
width: 50%;
}
.note-editor .col-xs-5 {
width: 41.66666666666667%;
}
.note-editor .col-xs-4 {
width: 33.33333333333333%;
}
.note-editor .col-xs-3 {
width: 25%;
}
.note-editor .col-xs-2 {
width: 16.666666666666664%;
}
.note-editor .col-xs-1 {
width: 8.333333333333332%;
}
.note-editor .col-xs-pull-12 {
right: 100%;
}
.note-editor .col-xs-pull-11 {
right: 91.66666666666666%;
}
.note-editor .col-xs-pull-10 {
right: 83.33333333333334%;
}
.note-editor .col-xs-pull-9 {
right: 75%;
}
.note-editor .col-xs-pull-8 {
right: 66.66666666666666%;
}
.note-editor .col-xs-pull-7 {
right: 58.333333333333336%;
}
.note-editor .col-xs-pull-6 {
right: 50%;
}
.note-editor .col-xs-pull-5 {
right: 41.66666666666667%;
}
.note-editor .col-xs-pull-4 {
right: 33.33333333333333%;
}
.note-editor .col-xs-pull-3 {
right: 25%;
}
.note-editor .col-xs-pull-2 {
right: 16.666666666666664%;
}
.note-editor .col-xs-pull-1 {
right: 8.333333333333332%;
}
.note-editor .col-xs-push-12 {
left: 100%;
}
.note-editor .col-xs-push-11 {
left: 91.66666666666666%;
}
.note-editor .col-xs-push-10 {
left: 83.33333333333334%;
}
.note-editor .col-xs-push-9 {
left: 75%;
}
.note-editor .col-xs-push-8 {
left: 66.66666666666666%;
}
.note-editor .col-xs-push-7 {
left: 58.333333333333336%;
}
.note-editor .col-xs-push-6 {
left: 50%;
}
.note-editor .col-xs-push-5 {
left: 41.66666666666667%;
}
.note-editor .col-xs-push-4 {
left: 33.33333333333333%;
}
.note-editor .col-xs-push-3 {
left: 25%;
}
.note-editor .col-xs-push-2 {
left: 16.666666666666664%;
}
.note-editor .col-xs-push-1 {
left: 8.333333333333332%;
}
.note-editor .col-xs-offset-12 {
margin-left: 100%;
}
.note-editor .col-xs-offset-11 {
margin-left: 91.66666666666666%;
}
.note-editor .col-xs-offset-10 {
margin-left: 83.33333333333334%;
}
.note-editor .col-xs-offset-9 {
margin-left: 75%;
}
.note-editor .col-xs-offset-8 {
margin-left: 66.66666666666666%;
}
.note-editor .col-xs-offset-7 {
margin-left: 58.333333333333336%;
}
.note-editor .col-xs-offset-6 {
margin-left: 50%;
}
.note-editor .col-xs-offset-5 {
margin-left: 41.66666666666667%;
}
.note-editor .col-xs-offset-4 {
margin-left: 33.33333333333333%;
}
.note-editor .col-xs-offset-3 {
margin-left: 25%;
}
.note-editor .col-xs-offset-2 {
margin-left: 16.666666666666664%;
}
.note-editor .col-xs-offset-1 {
margin-left: 8.333333333333332%;
}
@media (min-width: 768px) {
.note-editor .container {
width: 750px;
}
.note-editor .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11 {
float: left;
}
.note-editor .col-sm-12 {
width: 100%;
}
.note-editor .col-sm-11 {
width: 91.66666666666666%;
}
.note-editor .col-sm-10 {
width: 83.33333333333334%;
}
.note-editor .col-sm-9 {
width: 75%;
}
.note-editor .col-sm-8 {
width: 66.66666666666666%;
}
.note-editor .col-sm-7 {
width: 58.333333333333336%;
}
.note-editor .col-sm-6 {
width: 50%;
}
.note-editor .col-sm-5 {
width: 41.66666666666667%;
}
.note-editor .col-sm-4 {
width: 33.33333333333333%;
}
.note-editor .col-sm-3 {
width: 25%;
}
.note-editor .col-sm-2 {
width: 16.666666666666664%;
}
.note-editor .col-sm-1 {
width: 8.333333333333332%;
}
.note-editor .col-sm-pull-12 {
right: 100%;
}
.note-editor .col-sm-pull-11 {
right: 91.66666666666666%;
}
.note-editor .col-sm-pull-10 {
right: 83.33333333333334%;
}
.note-editor .col-sm-pull-9 {
right: 75%;
}
.note-editor .col-sm-pull-8 {
right: 66.66666666666666%;
}
.note-editor .col-sm-pull-7 {
right: 58.333333333333336%;
}
.note-editor .col-sm-pull-6 {
right: 50%;
}
.note-editor .col-sm-pull-5 {
right: 41.66666666666667%;
}
.note-editor .col-sm-pull-4 {
right: 33.33333333333333%;
}
.note-editor .col-sm-pull-3 {
right: 25%;
}
.note-editor .col-sm-pull-2 {
right: 16.666666666666664%;
}
.note-editor .col-sm-pull-1 {
right: 8.333333333333332%;
}
.note-editor .col-sm-push-12 {
left: 100%;
}
.note-editor .col-sm-push-11 {
left: 91.66666666666666%;
}
.note-editor .col-sm-push-10 {
left: 83.33333333333334%;
}
.note-editor .col-sm-push-9 {
left: 75%;
}
.note-editor .col-sm-push-8 {
left: 66.66666666666666%;
}
.note-editor .col-sm-push-7 {
left: 58.333333333333336%;
}
.note-editor .col-sm-push-6 {
left: 50%;
}
.note-editor .col-sm-push-5 {
left: 41.66666666666667%;
}
.note-editor .col-sm-push-4 {
left: 33.33333333333333%;
}
.note-editor .col-sm-push-3 {
left: 25%;
}
.note-editor .col-sm-push-2 {
left: 16.666666666666664%;
}
.note-editor .col-sm-push-1 {
left: 8.333333333333332%;
}
.note-editor .col-sm-offset-12 {
margin-left: 100%;
}
.note-editor .col-sm-offset-11 {
margin-left: 91.66666666666666%;
}
.note-editor .col-sm-offset-10 {
margin-left: 83.33333333333334%;
}
.note-editor .col-sm-offset-9 {
margin-left: 75%;
}
.note-editor .col-sm-offset-8 {
margin-left: 66.66666666666666%;
}
.note-editor .col-sm-offset-7 {
margin-left: 58.333333333333336%;
}
.note-editor .col-sm-offset-6 {
margin-left: 50%;
}
.note-editor .col-sm-offset-5 {
margin-left: 41.66666666666667%;
}
.note-editor .col-sm-offset-4 {
margin-left: 33.33333333333333%;
}
.note-editor .col-sm-offset-3 {
margin-left: 25%;
}
.note-editor .col-sm-offset-2 {
margin-left: 16.666666666666664%;
}
.note-editor .col-sm-offset-1 {
margin-left: 8.333333333333332%;
}
}
@media (min-width: 992px) {
.note-editor .container {
width: 970px;
}
.note-editor .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11 {
float: left;
}
.note-editor .col-md-12 {
width: 100%;
}
.note-editor .col-md-11 {
width: 91.66666666666666%;
}
.note-editor .col-md-10 {
width: 83.33333333333334%;
}
.note-editor .col-md-9 {
width: 75%;
}
.note-editor .col-md-8 {
width: 66.66666666666666%;
}
.note-editor .col-md-7 {
width: 58.333333333333336%;
}
.note-editor .col-md-6 {
width: 50%;
}
.note-editor .col-md-5 {
width: 41.66666666666667%;
}
.note-editor .col-md-4 {
width: 33.33333333333333%;
}
.note-editor .col-md-3 {
width: 25%;
}
.note-editor .col-md-2 {
width: 16.666666666666664%;
}
.note-editor .col-md-1 {
width: 8.333333333333332%;
}
.note-editor .col-md-pull-12 {
right: 100%;
}
.note-editor .col-md-pull-11 {
right: 91.66666666666666%;
}
.note-editor .col-md-pull-10 {
right: 83.33333333333334%;
}
.note-editor .col-md-pull-9 {
right: 75%;
}
.note-editor .col-md-pull-8 {
right: 66.66666666666666%;
}
.note-editor .col-md-pull-7 {
right: 58.333333333333336%;
}
.note-editor .col-md-pull-6 {
right: 50%;
}
.note-editor .col-md-pull-5 {
right: 41.66666666666667%;
}
.note-editor .col-md-pull-4 {
right: 33.33333333333333%;
}
.note-editor .col-md-pull-3 {
right: 25%;
}
.note-editor .col-md-pull-2 {
right: 16.666666666666664%;
}
.note-editor .col-md-pull-1 {
right: 8.333333333333332%;
}
.note-editor .col-md-push-12 {
left: 100%;
}
.note-editor .col-md-push-11 {
left: 91.66666666666666%;
}
.note-editor .col-md-push-10 {
left: 83.33333333333334%;
}
.note-editor .col-md-push-9 {
left: 75%;
}
.note-editor .col-md-push-8 {
left: 66.66666666666666%;
}
.note-editor .col-md-push-7 {
left: 58.333333333333336%;
}
.note-editor .col-md-push-6 {
left: 50%;
}
.note-editor .col-md-push-5 {
left: 41.66666666666667%;
}
.note-editor .col-md-push-4 {
left: 33.33333333333333%;
}
.note-editor .col-md-push-3 {
left: 25%;
}
.note-editor .col-md-push-2 {
left: 16.666666666666664%;
}
.note-editor .col-md-push-1 {
left: 8.333333333333332%;
}
.note-editor .col-md-offset-12 {
margin-left: 100%;
}
.note-editor .col-md-offset-11 {
margin-left: 91.66666666666666%;
}
.note-editor .col-md-offset-10 {
margin-left: 83.33333333333334%;
}
.note-editor .col-md-offset-9 {
margin-left: 75%;
}
.note-editor .col-md-offset-8 {
margin-left: 66.66666666666666%;
}
.note-editor .col-md-offset-7 {
margin-left: 58.333333333333336%;
}
.note-editor .col-md-offset-6 {
margin-left: 50%;
}
.note-editor .col-md-offset-5 {
margin-left: 41.66666666666667%;
}
.note-editor .col-md-offset-4 {
margin-left: 33.33333333333333%;
}
.note-editor .col-md-offset-3 {
margin-left: 25%;
}
.note-editor .col-md-offset-2 {
margin-left: 16.666666666666664%;
}
.note-editor .col-md-offset-1 {
margin-left: 8.333333333333332%;
}
}
@media (min-width: 1200px) {
.note-editor .container {
width: 1170px;
}
.note-editor .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11 {
float: left;
}
.note-editor .col-lg-12 {
width: 100%;
}
.note-editor .col-lg-11 {
width: 91.66666666666666%;
}
.note-editor .col-lg-10 {
width: 83.33333333333334%;
}
.note-editor .col-lg-9 {
width: 75%;
}
.note-editor .col-lg-8 {
width: 66.66666666666666%;
}
.note-editor .col-lg-7 {
width: 58.333333333333336%;
}
.note-editor .col-lg-6 {
width: 50%;
}
.note-editor .col-lg-5 {
width: 41.66666666666667%;
}
.note-editor .col-lg-4 {
width: 33.33333333333333%;
}
.note-editor .col-lg-3 {
width: 25%;
}
.note-editor .col-lg-2 {
width: 16.666666666666664%;
}
.note-editor .col-lg-1 {
width: 8.333333333333332%;
}
.note-editor .col-lg-pull-12 {
right: 100%;
}
.note-editor .col-lg-pull-11 {
right: 91.66666666666666%;
}
.note-editor .col-lg-pull-10 {
right: 83.33333333333334%;
}
.note-editor .col-lg-pull-9 {
right: 75%;
}
.note-editor .col-lg-pull-8 {
right: 66.66666666666666%;
}
.note-editor .col-lg-pull-7 {
right: 58.333333333333336%;
}
.note-editor .col-lg-pull-6 {
right: 50%;
}
.note-editor .col-lg-pull-5 {
right: 41.66666666666667%;
}
.note-editor .col-lg-pull-4 {
right: 33.33333333333333%;
}
.note-editor .col-lg-pull-3 {
right: 25%;
}
.note-editor .col-lg-pull-2 {
right: 16.666666666666664%;
}
.note-editor .col-lg-pull-1 {
right: 8.333333333333332%;
}
.note-editor .col-lg-push-12 {
left: 100%;
}
.note-editor .col-lg-push-11 {
left: 91.66666666666666%;
}
.note-editor .col-lg-push-10 {
left: 83.33333333333334%;
}
.note-editor .col-lg-push-9 {
left: 75%;
}
.note-editor .col-lg-push-8 {
left: 66.66666666666666%;
}
.note-editor .col-lg-push-7 {
left: 58.333333333333336%;
}
.note-editor .col-lg-push-6 {
left: 50%;
}
.note-editor .col-lg-push-5 {
left: 41.66666666666667%;
}
.note-editor .col-lg-push-4 {
left: 33.33333333333333%;
}
.note-editor .col-lg-push-3 {
left: 25%;
}
.note-editor .col-lg-push-2 {
left: 16.666666666666664%;
}
.note-editor .col-lg-push-1 {
left: 8.333333333333332%;
}
.note-editor .col-lg-offset-12 {
margin-left: 100%;
}
.note-editor .col-lg-offset-11 {
margin-left: 91.66666666666666%;
}
.note-editor .col-lg-offset-10 {
margin-left: 83.33333333333334%;
}
.note-editor .col-lg-offset-9 {
margin-left: 75%;
}
.note-editor .col-lg-offset-8 {
margin-left: 66.66666666666666%;
}
.note-editor .col-lg-offset-7 {
margin-left: 58.333333333333336%;
}
.note-editor .col-lg-offset-6 {
margin-left: 50%;
}
.note-editor .col-lg-offset-5 {
margin-left: 41.66666666666667%;
}
.note-editor .col-lg-offset-4 {
margin-left: 33.33333333333333%;
}
.note-editor .col-lg-offset-3 {
margin-left: 25%;
}
.note-editor .col-lg-offset-2 {
margin-left: 16.666666666666664%;
}
.note-editor .col-lg-offset-1 {
margin-left: 8.333333333333332%;
}
}
.note-editor table {
max-width: 100%;
background-color: transparent;
}
.note-editor th {
text-align: left;
}
.note-editor .table {
width: 100%;
margin-bottom: 20px;
}
.note-editor .table > thead > tr > th,
.note-editor .table > tbody > tr > th,
.note-editor .table > tfoot > tr > th,
.note-editor .table > thead > tr > td,
.note-editor .table > tbody > tr > td,
.note-editor .table > tfoot > tr > td {
padding: 8px;
line-height: 1.428571429;
vertical-align: top;
border-top: 1px solid #dddddd;
}
.note-editor .table > thead > tr > th {
vertical-align: bottom;
border-bottom: 2px solid #dddddd;
}
.note-editor .table > caption + thead > tr:first-child > th,
.note-editor .table > colgroup + thead > tr:first-child > th,
.note-editor .table > thead:first-child > tr:first-child > th,
.note-editor .table > caption + thead > tr:first-child > td,
.note-editor .table > colgroup + thead > tr:first-child > td,
.note-editor .table > thead:first-child > tr:first-child > td {
border-top: 0;
}
.note-editor .table > tbody + tbody {
border-top: 2px solid #dddddd;
}
.note-editor .table .table {
background-color: #ffffff;
}
.note-editor .table-condensed > thead > tr > th,
.note-editor .table-condensed > tbody > tr > th,
.note-editor .table-condensed > tfoot > tr > th,
.note-editor .table-condensed > thead > tr > td,
.note-editor .table-condensed > tbody > tr > td,
.note-editor .table-condensed > tfoot > tr > td {
padding: 5px;
}
.note-editor .table-bordered {
border: 1px solid #dddddd;
}
.note-editor .table-bordered > thead > tr > th,
.note-editor .table-bordered > tbody > tr > th,
.note-editor .table-bordered > tfoot > tr > th,
.note-editor .table-bordered > thead > tr > td,
.note-editor .table-bordered > tbody > tr > td,
.note-editor .table-bordered > tfoot > tr > td {
border: 1px solid #dddddd;
}
.note-editor .table-bordered > thead > tr > th,
.note-editor .table-bordered > thead > tr > td {
border-bottom-width: 2px;
}
.note-editor .table-striped > tbody > tr:nth-child(odd) > td,
.note-editor .table-striped > tbody > tr:nth-child(odd) > th {
background-color: #f9f9f9;
}
.note-editor .table-hover > tbody > tr:hover > td,
.note-editor .table-hover > tbody > tr:hover > th {
background-color: #f5f5f5;
}
.note-editor table col[class*="col-"] {
float: none;
display: table-column;
}
.note-editor table td[class*="col-"],
.note-editor table th[class*="col-"] {
float: none;
display: table-cell;
}
.note-editor .table > thead > tr > td.active,
.note-editor .table > tbody > tr > td.active,
.note-editor .table > tfoot > tr > td.active,
.note-editor .table > thead > tr > th.active,
.note-editor .table > tbody > tr > th.active,
.note-editor .table > tfoot > tr > th.active,
.note-editor .table > thead > tr.active > td,
.note-editor .table > tbody > tr.active > td,
.note-editor .table > tfoot > tr.active > td,
.note-editor .table > thead > tr.active > th,
.note-editor .table > tbody > tr.active > th,
.note-editor .table > tfoot > tr.active > th {
background-color: #f5f5f5;
}
.note-editor .table > thead > tr > td.success,
.note-editor .table > tbody > tr > td.success,
.note-editor .table > tfoot > tr > td.success,
.note-editor .table > thead > tr > th.success,
.note-editor .table > tbody > tr > th.success,
.note-editor .table > tfoot > tr > th.success,
.note-editor .table > thead > tr.success > td,
.note-editor .table > tbody > tr.success > td,
.note-editor .table > tfoot > tr.success > td,
.note-editor .table > thead > tr.success > th,
.note-editor .table > tbody > tr.success > th,
.note-editor .table > tfoot > tr.success > th {
background-color: #dff0d8;
border-color: #d6e9c6;
}
.note-editor .table-hover > tbody > tr > td.success:hover,
.note-editor .table-hover > tbody > tr > th.success:hover,
.note-editor .table-hover > tbody > tr.success:hover > td,
.note-editor .table-hover > tbody > tr.success:hover > th {
background-color: #d0e9c6;
border-color: #c9e2b3;
}
.note-editor .table > thead > tr > td.danger,
.note-editor .table > tbody > tr > td.danger,
.note-editor .table > tfoot > tr > td.danger,
.note-editor .table > thead > tr > th.danger,
.note-editor .table > tbody > tr > th.danger,
.note-editor .table > tfoot > tr > th.danger,
.note-editor .table > thead > tr.danger > td,
.note-editor .table > tbody > tr.danger > td,
.note-editor .table > tfoot > tr.danger > td,
.note-editor .table > thead > tr.danger > th,
.note-editor .table > tbody > tr.danger > th,
.note-editor .table > tfoot > tr.danger > th {
background-color: #f2dede;
border-color: #ebccd1;
}
.note-editor .table-hover > tbody > tr > td.danger:hover,
.note-editor .table-hover > tbody > tr > th.danger:hover,
.note-editor .table-hover > tbody > tr.danger:hover > td,
.note-editor .table-hover > tbody > tr.danger:hover > th {
background-color: #ebcccc;
border-color: #e4b9c0;
}
.note-editor .table > thead > tr > td.warning,
.note-editor .table > tbody > tr > td.warning,
.note-editor .table > tfoot > tr > td.warning,
.note-editor .table > thead > tr > th.warning,
.note-editor .table > tbody > tr > th.warning,
.note-editor .table > tfoot > tr > th.warning,
.note-editor .table > thead > tr.warning > td,
.note-editor .table > tbody > tr.warning > td,
.note-editor .table > tfoot > tr.warning > td,
.note-editor .table > thead > tr.warning > th,
.note-editor .table > tbody > tr.warning > th,
.note-editor .table > tfoot > tr.warning > th {
background-color: #fcf8e3;
border-color: #faebcc;
}
.note-editor .table-hover > tbody > tr > td.warning:hover,
.note-editor .table-hover > tbody > tr > th.warning:hover,
.note-editor .table-hover > tbody > tr.warning:hover > td,
.note-editor .table-hover > tbody > tr.warning:hover > th {
background-color: #faf2cc;
border-color: #f7e1b5;
}
@media (max-width: 767px) {
.note-editor .table-responsive {
width: 100%;
margin-bottom: 15px;
overflow-y: hidden;
overflow-x: scroll;
-ms-overflow-style: -ms-autohiding-scrollbar;
border: 1px solid #dddddd;
-webkit-overflow-scrolling: touch;
}
.note-editor .table-responsive > .table {
margin-bottom: 0;
}
.note-editor .table-responsive > .table > thead > tr > th,
.note-editor .table-responsive > .table > tbody > tr > th,
.note-editor .table-responsive > .table > tfoot > tr > th,
.note-editor .table-responsive > .table > thead > tr > td,
.note-editor .table-responsive > .table > tbody > tr > td,
.note-editor .table-responsive > .table > tfoot > tr > td {
white-space: nowrap;
}
.note-editor .table-responsive > .table-bordered {
border: 0;
}
.note-editor .table-responsive > .table-bordered > thead > tr > th:first-child,
.note-editor .table-responsive > .table-bordered > tbody > tr > th:first-child,
.note-editor .table-responsive > .table-bordered > tfoot > tr > th:first-child,
.note-editor .table-responsive > .table-bordered > thead > tr > td:first-child,
.note-editor .table-responsive > .table-bordered > tbody > tr > td:first-child,
.note-editor .table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0;
}
.note-editor .table-responsive > .table-bordered > thead > tr > th:last-child,
.note-editor .table-responsive > .table-bordered > tbody > tr > th:last-child,
.note-editor .table-responsive > .table-bordered > tfoot > tr > th:last-child,
.note-editor .table-responsive > .table-bordered > thead > tr > td:last-child,
.note-editor .table-responsive > .table-bordered > tbody > tr > td:last-child,
.note-editor .table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0;
}
.note-editor .table-responsive > .table-bordered > tbody > tr:last-child > th,
.note-editor .table-responsive > .table-bordered > tfoot > tr:last-child > th,
.note-editor .table-responsive > .table-bordered > tbody > tr:last-child > td,
.note-editor .table-responsive > .table-bordered > tfoot > tr:last-child > td {
border-bottom: 0;
}
}
.note-editor fieldset {
padding: 0;
margin: 0;
border: 0;
}
.note-editor legend {
display: block;
width: 100%;
padding: 0;
margin-bottom: 20px;
font-size: 21px;
line-height: inherit;
color: #333333;
border: 0;
border-bottom: 1px solid #e5e5e5;
}
.note-editor label {
display: inline-block;
margin-bottom: 5px;
font-weight: bold;
}
.note-editor input[type="search"] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.note-editor input[type="radio"],
.note-editor input[type="checkbox"] {
margin: 4px 0 0;
margin-top: 1px \9;
/* IE8-9 */
line-height: normal;
}
.note-editor input[type="file"] {
display: block;
}
.note-editor select[multiple],
.note-editor select[size] {
height: auto;
}
.note-editor select optgroup {
font-size: inherit;
font-style: inherit;
font-family: inherit;
}
.note-editor input[type="file"]:focus,
.note-editor input[type="radio"]:focus,
.note-editor input[type="checkbox"]:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.note-editor input[type="number"]::-webkit-outer-spin-button,
.note-editor input[type="number"]::-webkit-inner-spin-button {
height: auto;
}
.note-editor output {
display: block;
padding-top: 7px;
font-size: 14px;
line-height: 1.428571429;
color: #555555;
vertical-align: middle;
}
.note-editor .form-control:-moz-placeholder {
color: #999999;
}
.note-editor .form-control::-moz-placeholder {
color: #999999;
}
.note-editor .form-control:-ms-input-placeholder {
color: #999999;
}
.note-editor .form-control::-webkit-input-placeholder {
color: #999999;
}
.note-editor .form-control {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: #555555;
vertical-align: middle;
background-color: #ffffff;
background-image: none;
border: 1px solid #cccccc;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.note-editor .form-control:focus {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
.note-editor .form-control[disabled],
.note-editor .form-control[readonly],
fieldset[disabled] .note-editor .form-control {
cursor: not-allowed;
background-color: #eeeeee;
}
textarea.note-editor .form-control {
height: auto;
}
.note-editor .form-group {
margin-bottom: 15px;
}
.note-editor .radio,
.note-editor .checkbox {
display: block;
min-height: 20px;
margin-top: 10px;
margin-bottom: 10px;
padding-left: 20px;
vertical-align: middle;
}
.note-editor .radio label,
.note-editor .checkbox label {
display: inline;
margin-bottom: 0;
font-weight: normal;
cursor: pointer;
}
.note-editor .radio input[type="radio"],
.note-editor .radio-inline input[type="radio"],
.note-editor .checkbox input[type="checkbox"],
.note-editor .checkbox-inline input[type="checkbox"] {
float: left;
margin-left: -20px;
}
.note-editor .radio + .radio,
.note-editor .checkbox + .checkbox {
margin-top: -5px;
}
.note-editor .radio-inline,
.note-editor .checkbox-inline {
display: inline-block;
padding-left: 20px;
margin-bottom: 0;
vertical-align: middle;
font-weight: normal;
cursor: pointer;
}
.note-editor .radio-inline + .radio-inline,
.note-editor .checkbox-inline + .checkbox-inline {
margin-top: 0;
margin-left: 10px;
}
.note-editor input[type="radio"][disabled],
.note-editor input[type="checkbox"][disabled],
.note-editor .radio[disabled],
.note-editor .radio-inline[disabled],
.note-editor .checkbox[disabled],
.note-editor .checkbox-inline[disabled],
fieldset[disabled] .note-editor input[type="radio"],
fieldset[disabled] .note-editor input[type="checkbox"],
fieldset[disabled] .note-editor .radio,
fieldset[disabled] .note-editor .radio-inline,
fieldset[disabled] .note-editor .checkbox,
fieldset[disabled] .note-editor .checkbox-inline {
cursor: not-allowed;
}
.note-editor .input-sm {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
select.note-editor .input-sm {
height: 30px;
line-height: 30px;
}
textarea.note-editor .input-sm {
height: auto;
}
.note-editor .input-lg {
height: 45px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
select.note-editor .input-lg {
height: 45px;
line-height: 45px;
}
textarea.note-editor .input-lg {
height: auto;
}
.note-editor .has-warning .help-block,
.note-editor .has-warning .control-label {
color: #c09853;
}
.note-editor .has-warning .form-control {
border-color: #c09853;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.note-editor .has-warning .form-control:focus {
border-color: #a47e3c;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
}
.note-editor .has-warning .input-group-addon {
color: #c09853;
border-color: #c09853;
background-color: #fcf8e3;
}
.note-editor .has-error .help-block,
.note-editor .has-error .control-label {
color: #b94a48;
}
.note-editor .has-error .form-control {
border-color: #b94a48;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.note-editor .has-error .form-control:focus {
border-color: #953b39;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
}
.note-editor .has-error .input-group-addon {
color: #b94a48;
border-color: #b94a48;
background-color: #f2dede;
}
.note-editor .has-success .help-block,
.note-editor .has-success .control-label {
color: #468847;
}
.note-editor .has-success .form-control {
border-color: #468847;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.note-editor .has-success .form-control:focus {
border-color: #356635;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
}
.note-editor .has-success .input-group-addon {
color: #468847;
border-color: #468847;
background-color: #dff0d8;
}
.note-editor .form-control-static {
margin-bottom: 0;
}
.note-editor .help-block {
display: block;
margin-top: 5px;
margin-bottom: 10px;
color: #737373;
}
@media (min-width: 768px) {
.note-editor .form-inline .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.note-editor .form-inline .form-control {
display: inline-block;
}
.note-editor .form-inline .radio,
.note-editor .form-inline .checkbox {
display: inline-block;
margin-top: 0;
margin-bottom: 0;
padding-left: 0;
}
.note-editor .form-inline .radio input[type="radio"],
.note-editor .form-inline .checkbox input[type="checkbox"] {
float: none;
margin-left: 0;
}
}
.note-editor .form-horizontal .control-label,
.note-editor .form-horizontal .radio,
.note-editor .form-horizontal .checkbox,
.note-editor .form-horizontal .radio-inline,
.note-editor .form-horizontal .checkbox-inline {
margin-top: 0;
margin-bottom: 0;
padding-top: 7px;
}
.note-editor .form-horizontal .form-group {
margin-left: -15px;
margin-right: -15px;
}
.note-editor .form-horizontal .form-group:before,
.note-editor .form-horizontal .form-group:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .form-horizontal .form-group:after {
clear: both;
}
.note-editor .form-horizontal .form-group:before,
.note-editor .form-horizontal .form-group:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .form-horizontal .form-group:after {
clear: both;
}
.note-editor .form-horizontal .form-control-static {
padding-top: 7px;
}
@media (min-width: 768px) {
.note-editor .form-horizontal .control-label {
text-align: right;
}
}
.note-editor .btn {
display: inline-block;
margin-bottom: 0;
font-weight: normal;
text-align: center;
vertical-align: middle;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
.note-editor .btn:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.note-editor .btn:hover,
.note-editor .btn:focus {
color: #333333;
text-decoration: none;
}
.note-editor .btn:active,
.note-editor .btn.active {
outline: 0;
background-image: none;
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.note-editor .btn.disabled,
.note-editor .btn[disabled],
fieldset[disabled] .note-editor .btn {
cursor: not-allowed;
pointer-events: none;
opacity: 0.65;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
}
.note-editor .btn-default {
color: #333333;
background-color: #ffffff;
border-color: #cccccc;
}
.note-editor .btn-default:hover,
.note-editor .btn-default:focus,
.note-editor .btn-default:active,
.note-editor .btn-default.active,
.open .dropdown-toggle.note-editor .btn-default {
color: #333333;
background-color: #ebebeb;
border-color: #adadad;
}
.note-editor .btn-default:active,
.note-editor .btn-default.active,
.open .dropdown-toggle.note-editor .btn-default {
background-image: none;
}
.note-editor .btn-default.disabled,
.note-editor .btn-default[disabled],
fieldset[disabled] .note-editor .btn-default,
.note-editor .btn-default.disabled:hover,
.note-editor .btn-default[disabled]:hover,
fieldset[disabled] .note-editor .btn-default:hover,
.note-editor .btn-default.disabled:focus,
.note-editor .btn-default[disabled]:focus,
fieldset[disabled] .note-editor .btn-default:focus,
.note-editor .btn-default.disabled:active,
.note-editor .btn-default[disabled]:active,
fieldset[disabled] .note-editor .btn-default:active,
.note-editor .btn-default.disabled.active,
.note-editor .btn-default[disabled].active,
fieldset[disabled] .note-editor .btn-default.active {
background-color: #ffffff;
border-color: #cccccc;
}
.note-editor .btn-primary {
color: #ffffff;
background-color: #428bca;
border-color: #357ebd;
}
.note-editor .btn-primary:hover,
.note-editor .btn-primary:focus,
.note-editor .btn-primary:active,
.note-editor .btn-primary.active,
.open .dropdown-toggle.note-editor .btn-primary {
color: #ffffff;
background-color: #3276b1;
border-color: #285e8e;
}
.note-editor .btn-primary:active,
.note-editor .btn-primary.active,
.open .dropdown-toggle.note-editor .btn-primary {
background-image: none;
}
.note-editor .btn-primary.disabled,
.note-editor .btn-primary[disabled],
fieldset[disabled] .note-editor .btn-primary,
.note-editor .btn-primary.disabled:hover,
.note-editor .btn-primary[disabled]:hover,
fieldset[disabled] .note-editor .btn-primary:hover,
.note-editor .btn-primary.disabled:focus,
.note-editor .btn-primary[disabled]:focus,
fieldset[disabled] .note-editor .btn-primary:focus,
.note-editor .btn-primary.disabled:active,
.note-editor .btn-primary[disabled]:active,
fieldset[disabled] .note-editor .btn-primary:active,
.note-editor .btn-primary.disabled.active,
.note-editor .btn-primary[disabled].active,
fieldset[disabled] .note-editor .btn-primary.active {
background-color: #428bca;
border-color: #357ebd;
}
.note-editor .btn-warning {
color: #ffffff;
background-color: #f0ad4e;
border-color: #eea236;
}
.note-editor .btn-warning:hover,
.note-editor .btn-warning:focus,
.note-editor .btn-warning:active,
.note-editor .btn-warning.active,
.open .dropdown-toggle.note-editor .btn-warning {
color: #ffffff;
background-color: #ed9c28;
border-color: #d58512;
}
.note-editor .btn-warning:active,
.note-editor .btn-warning.active,
.open .dropdown-toggle.note-editor .btn-warning {
background-image: none;
}
.note-editor .btn-warning.disabled,
.note-editor .btn-warning[disabled],
fieldset[disabled] .note-editor .btn-warning,
.note-editor .btn-warning.disabled:hover,
.note-editor .btn-warning[disabled]:hover,
fieldset[disabled] .note-editor .btn-warning:hover,
.note-editor .btn-warning.disabled:focus,
.note-editor .btn-warning[disabled]:focus,
fieldset[disabled] .note-editor .btn-warning:focus,
.note-editor .btn-warning.disabled:active,
.note-editor .btn-warning[disabled]:active,
fieldset[disabled] .note-editor .btn-warning:active,
.note-editor .btn-warning.disabled.active,
.note-editor .btn-warning[disabled].active,
fieldset[disabled] .note-editor .btn-warning.active {
background-color: #f0ad4e;
border-color: #eea236;
}
.note-editor .btn-danger {
color: #ffffff;
background-color: #d9534f;
border-color: #d43f3a;
}
.note-editor .btn-danger:hover,
.note-editor .btn-danger:focus,
.note-editor .btn-danger:active,
.note-editor .btn-danger.active,
.open .dropdown-toggle.note-editor .btn-danger {
color: #ffffff;
background-color: #d2322d;
border-color: #ac2925;
}
.note-editor .btn-danger:active,
.note-editor .btn-danger.active,
.open .dropdown-toggle.note-editor .btn-danger {
background-image: none;
}
.note-editor .btn-danger.disabled,
.note-editor .btn-danger[disabled],
fieldset[disabled] .note-editor .btn-danger,
.note-editor .btn-danger.disabled:hover,
.note-editor .btn-danger[disabled]:hover,
fieldset[disabled] .note-editor .btn-danger:hover,
.note-editor .btn-danger.disabled:focus,
.note-editor .btn-danger[disabled]:focus,
fieldset[disabled] .note-editor .btn-danger:focus,
.note-editor .btn-danger.disabled:active,
.note-editor .btn-danger[disabled]:active,
fieldset[disabled] .note-editor .btn-danger:active,
.note-editor .btn-danger.disabled.active,
.note-editor .btn-danger[disabled].active,
fieldset[disabled] .note-editor .btn-danger.active {
background-color: #d9534f;
border-color: #d43f3a;
}
.note-editor .btn-success {
color: #ffffff;
background-color: #5cb85c;
border-color: #4cae4c;
}
.note-editor .btn-success:hover,
.note-editor .btn-success:focus,
.note-editor .btn-success:active,
.note-editor .btn-success.active,
.open .dropdown-toggle.note-editor .btn-success {
color: #ffffff;
background-color: #47a447;
border-color: #398439;
}
.note-editor .btn-success:active,
.note-editor .btn-success.active,
.open .dropdown-toggle.note-editor .btn-success {
background-image: none;
}
.note-editor .btn-success.disabled,
.note-editor .btn-success[disabled],
fieldset[disabled] .note-editor .btn-success,
.note-editor .btn-success.disabled:hover,
.note-editor .btn-success[disabled]:hover,
fieldset[disabled] .note-editor .btn-success:hover,
.note-editor .btn-success.disabled:focus,
.note-editor .btn-success[disabled]:focus,
fieldset[disabled] .note-editor .btn-success:focus,
.note-editor .btn-success.disabled:active,
.note-editor .btn-success[disabled]:active,
fieldset[disabled] .note-editor .btn-success:active,
.note-editor .btn-success.disabled.active,
.note-editor .btn-success[disabled].active,
fieldset[disabled] .note-editor .btn-success.active {
background-color: #5cb85c;
border-color: #4cae4c;
}
.note-editor .btn-info {
color: #ffffff;
background-color: #5bc0de;
border-color: #46b8da;
}
.note-editor .btn-info:hover,
.note-editor .btn-info:focus,
.note-editor .btn-info:active,
.note-editor .btn-info.active,
.open .dropdown-toggle.note-editor .btn-info {
color: #ffffff;
background-color: #39b3d7;
border-color: #269abc;
}
.note-editor .btn-info:active,
.note-editor .btn-info.active,
.open .dropdown-toggle.note-editor .btn-info {
background-image: none;
}
.note-editor .btn-info.disabled,
.note-editor .btn-info[disabled],
fieldset[disabled] .note-editor .btn-info,
.note-editor .btn-info.disabled:hover,
.note-editor .btn-info[disabled]:hover,
fieldset[disabled] .note-editor .btn-info:hover,
.note-editor .btn-info.disabled:focus,
.note-editor .btn-info[disabled]:focus,
fieldset[disabled] .note-editor .btn-info:focus,
.note-editor .btn-info.disabled:active,
.note-editor .btn-info[disabled]:active,
fieldset[disabled] .note-editor .btn-info:active,
.note-editor .btn-info.disabled.active,
.note-editor .btn-info[disabled].active,
fieldset[disabled] .note-editor .btn-info.active {
background-color: #5bc0de;
border-color: #46b8da;
}
.note-editor .btn-link {
color: #428bca;
font-weight: normal;
cursor: pointer;
border-radius: 0;
}
.note-editor .btn-link,
.note-editor .btn-link:active,
.note-editor .btn-link[disabled],
fieldset[disabled] .note-editor .btn-link {
background-color: transparent;
-webkit-box-shadow: none;
box-shadow: none;
}
.note-editor .btn-link,
.note-editor .btn-link:hover,
.note-editor .btn-link:focus,
.note-editor .btn-link:active {
border-color: transparent;
}
.note-editor .btn-link:hover,
.note-editor .btn-link:focus {
color: #2a6496;
text-decoration: underline;
background-color: transparent;
}
.note-editor .btn-link[disabled]:hover,
fieldset[disabled] .note-editor .btn-link:hover,
.note-editor .btn-link[disabled]:focus,
fieldset[disabled] .note-editor .btn-link:focus {
color: #999999;
text-decoration: none;
}
.note-editor .btn-lg {
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
.note-editor .btn-sm,
.note-editor .btn-xs {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.note-editor .btn-xs {
padding: 1px 5px;
}
.note-editor .btn-block {
display: block;
width: 100%;
padding-left: 0;
padding-right: 0;
}
.note-editor .btn-block + .btn-block {
margin-top: 5px;
}
.note-editor input[type="submit"].btn-block,
.note-editor input[type="reset"].btn-block,
.note-editor input[type="button"].btn-block {
width: 100%;
}
.note-editor .fade {
opacity: 0;
-webkit-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
}
.note-editor .fade.in {
opacity: 1;
}
.note-editor .collapse {
display: none;
}
.note-editor .collapse.in {
display: block;
}
.note-editor .collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition: height 0.35s ease;
transition: height 0.35s ease;
}
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
.note-editor .glyphicon {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings';
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
}
.note-editor .glyphicon:empty {
width: 1em;
}
.note-editor .glyphicon-asterisk:before {
content: "\2a";
}
.note-editor .glyphicon-plus:before {
content: "\2b";
}
.note-editor .glyphicon-euro:before {
content: "\20ac";
}
.note-editor .glyphicon-minus:before {
content: "\2212";
}
.note-editor .glyphicon-cloud:before {
content: "\2601";
}
.note-editor .glyphicon-envelope:before {
content: "\2709";
}
.note-editor .glyphicon-pencil:before {
content: "\270f";
}
.note-editor .glyphicon-glass:before {
content: "\e001";
}
.note-editor .glyphicon-music:before {
content: "\e002";
}
.note-editor .glyphicon-search:before {
content: "\e003";
}
.note-editor .glyphicon-heart:before {
content: "\e005";
}
.note-editor .glyphicon-star:before {
content: "\e006";
}
.note-editor .glyphicon-star-empty:before {
content: "\e007";
}
.note-editor .glyphicon-user:before {
content: "\e008";
}
.note-editor .glyphicon-film:before {
content: "\e009";
}
.note-editor .glyphicon-th-large:before {
content: "\e010";
}
.note-editor .glyphicon-th:before {
content: "\e011";
}
.note-editor .glyphicon-th-list:before {
content: "\e012";
}
.note-editor .glyphicon-ok:before {
content: "\e013";
}
.note-editor .glyphicon-remove:before {
content: "\e014";
}
.note-editor .glyphicon-zoom-in:before {
content: "\e015";
}
.note-editor .glyphicon-zoom-out:before {
content: "\e016";
}
.note-editor .glyphicon-off:before {
content: "\e017";
}
.note-editor .glyphicon-signal:before {
content: "\e018";
}
.note-editor .glyphicon-cog:before {
content: "\e019";
}
.note-editor .glyphicon-trash:before {
content: "\e020";
}
.note-editor .glyphicon-home:before {
content: "\e021";
}
.note-editor .glyphicon-file:before {
content: "\e022";
}
.note-editor .glyphicon-time:before {
content: "\e023";
}
.note-editor .glyphicon-road:before {
content: "\e024";
}
.note-editor .glyphicon-download-alt:before {
content: "\e025";
}
.note-editor .glyphicon-download:before {
content: "\e026";
}
.note-editor .glyphicon-upload:before {
content: "\e027";
}
.note-editor .glyphicon-inbox:before {
content: "\e028";
}
.note-editor .glyphicon-play-circle:before {
content: "\e029";
}
.note-editor .glyphicon-repeat:before {
content: "\e030";
}
.note-editor .glyphicon-refresh:before {
content: "\e031";
}
.note-editor .glyphicon-list-alt:before {
content: "\e032";
}
.note-editor .glyphicon-lock:before {
content: "\e033";
}
.note-editor .glyphicon-flag:before {
content: "\e034";
}
.note-editor .glyphicon-headphones:before {
content: "\e035";
}
.note-editor .glyphicon-volume-off:before {
content: "\e036";
}
.note-editor .glyphicon-volume-down:before {
content: "\e037";
}
.note-editor .glyphicon-volume-up:before {
content: "\e038";
}
.note-editor .glyphicon-qrcode:before {
content: "\e039";
}
.note-editor .glyphicon-barcode:before {
content: "\e040";
}
.note-editor .glyphicon-tag:before {
content: "\e041";
}
.note-editor .glyphicon-tags:before {
content: "\e042";
}
.note-editor .glyphicon-book:before {
content: "\e043";
}
.note-editor .glyphicon-bookmark:before {
content: "\e044";
}
.note-editor .glyphicon-print:before {
content: "\e045";
}
.note-editor .glyphicon-camera:before {
content: "\e046";
}
.note-editor .glyphicon-font:before {
content: "\e047";
}
.note-editor .glyphicon-bold:before {
content: "\e048";
}
.note-editor .glyphicon-italic:before {
content: "\e049";
}
.note-editor .glyphicon-text-height:before {
content: "\e050";
}
.note-editor .glyphicon-text-width:before {
content: "\e051";
}
.note-editor .glyphicon-align-left:before {
content: "\e052";
}
.note-editor .glyphicon-align-center:before {
content: "\e053";
}
.note-editor .glyphicon-align-right:before {
content: "\e054";
}
.note-editor .glyphicon-align-justify:before {
content: "\e055";
}
.note-editor .glyphicon-list:before {
content: "\e056";
}
.note-editor .glyphicon-indent-left:before {
content: "\e057";
}
.note-editor .glyphicon-indent-right:before {
content: "\e058";
}
.note-editor .glyphicon-facetime-video:before {
content: "\e059";
}
.note-editor .glyphicon-picture:before {
content: "\e060";
}
.note-editor .glyphicon-map-marker:before {
content: "\e062";
}
.note-editor .glyphicon-adjust:before {
content: "\e063";
}
.note-editor .glyphicon-tint:before {
content: "\e064";
}
.note-editor .glyphicon-edit:before {
content: "\e065";
}
.note-editor .glyphicon-share:before {
content: "\e066";
}
.note-editor .glyphicon-check:before {
content: "\e067";
}
.note-editor .glyphicon-move:before {
content: "\e068";
}
.note-editor .glyphicon-step-backward:before {
content: "\e069";
}
.note-editor .glyphicon-fast-backward:before {
content: "\e070";
}
.note-editor .glyphicon-backward:before {
content: "\e071";
}
.note-editor .glyphicon-play:before {
content: "\e072";
}
.note-editor .glyphicon-pause:before {
content: "\e073";
}
.note-editor .glyphicon-stop:before {
content: "\e074";
}
.note-editor .glyphicon-forward:before {
content: "\e075";
}
.note-editor .glyphicon-fast-forward:before {
content: "\e076";
}
.note-editor .glyphicon-step-forward:before {
content: "\e077";
}
.note-editor .glyphicon-eject:before {
content: "\e078";
}
.note-editor .glyphicon-chevron-left:before {
content: "\e079";
}
.note-editor .glyphicon-chevron-right:before {
content: "\e080";
}
.note-editor .glyphicon-plus-sign:before {
content: "\e081";
}
.note-editor .glyphicon-minus-sign:before {
content: "\e082";
}
.note-editor .glyphicon-remove-sign:before {
content: "\e083";
}
.note-editor .glyphicon-ok-sign:before {
content: "\e084";
}
.note-editor .glyphicon-question-sign:before {
content: "\e085";
}
.note-editor .glyphicon-info-sign:before {
content: "\e086";
}
.note-editor .glyphicon-screenshot:before {
content: "\e087";
}
.note-editor .glyphicon-remove-circle:before {
content: "\e088";
}
.note-editor .glyphicon-ok-circle:before {
content: "\e089";
}
.note-editor .glyphicon-ban-circle:before {
content: "\e090";
}
.note-editor .glyphicon-arrow-left:before {
content: "\e091";
}
.note-editor .glyphicon-arrow-right:before {
content: "\e092";
}
.note-editor .glyphicon-arrow-up:before {
content: "\e093";
}
.note-editor .glyphicon-arrow-down:before {
content: "\e094";
}
.note-editor .glyphicon-share-alt:before {
content: "\e095";
}
.note-editor .glyphicon-resize-full:before {
content: "\e096";
}
.note-editor .glyphicon-resize-small:before {
content: "\e097";
}
.note-editor .glyphicon-exclamation-sign:before {
content: "\e101";
}
.note-editor .glyphicon-gift:before {
content: "\e102";
}
.note-editor .glyphicon-leaf:before {
content: "\e103";
}
.note-editor .glyphicon-fire:before {
content: "\e104";
}
.note-editor .glyphicon-eye-open:before {
content: "\e105";
}
.note-editor .glyphicon-eye-close:before {
content: "\e106";
}
.note-editor .glyphicon-warning-sign:before {
content: "\e107";
}
.note-editor .glyphicon-plane:before {
content: "\e108";
}
.note-editor .glyphicon-calendar:before {
content: "\e109";
}
.note-editor .glyphicon-random:before {
content: "\e110";
}
.note-editor .glyphicon-comment:before {
content: "\e111";
}
.note-editor .glyphicon-magnet:before {
content: "\e112";
}
.note-editor .glyphicon-chevron-up:before {
content: "\e113";
}
.note-editor .glyphicon-chevron-down:before {
content: "\e114";
}
.note-editor .glyphicon-retweet:before {
content: "\e115";
}
.note-editor .glyphicon-shopping-cart:before {
content: "\e116";
}
.note-editor .glyphicon-folder-close:before {
content: "\e117";
}
.note-editor .glyphicon-folder-open:before {
content: "\e118";
}
.note-editor .glyphicon-resize-vertical:before {
content: "\e119";
}
.note-editor .glyphicon-resize-horizontal:before {
content: "\e120";
}
.note-editor .glyphicon-hdd:before {
content: "\e121";
}
.note-editor .glyphicon-bullhorn:before {
content: "\e122";
}
.note-editor .glyphicon-bell:before {
content: "\e123";
}
.note-editor .glyphicon-certificate:before {
content: "\e124";
}
.note-editor .glyphicon-thumbs-up:before {
content: "\e125";
}
.note-editor .glyphicon-thumbs-down:before {
content: "\e126";
}
.note-editor .glyphicon-hand-right:before {
content: "\e127";
}
.note-editor .glyphicon-hand-left:before {
content: "\e128";
}
.note-editor .glyphicon-hand-up:before {
content: "\e129";
}
.note-editor .glyphicon-hand-down:before {
content: "\e130";
}
.note-editor .glyphicon-circle-arrow-right:before {
content: "\e131";
}
.note-editor .glyphicon-circle-arrow-left:before {
content: "\e132";
}
.note-editor .glyphicon-circle-arrow-up:before {
content: "\e133";
}
.note-editor .glyphicon-circle-arrow-down:before {
content: "\e134";
}
.note-editor .glyphicon-globe:before {
content: "\e135";
}
.note-editor .glyphicon-wrench:before {
content: "\e136";
}
.note-editor .glyphicon-tasks:before {
content: "\e137";
}
.note-editor .glyphicon-filter:before {
content: "\e138";
}
.note-editor .glyphicon-briefcase:before {
content: "\e139";
}
.note-editor .glyphicon-fullscreen:before {
content: "\e140";
}
.note-editor .glyphicon-dashboard:before {
content: "\e141";
}
.note-editor .glyphicon-paperclip:before {
content: "\e142";
}
.note-editor .glyphicon-heart-empty:before {
content: "\e143";
}
.note-editor .glyphicon-link:before {
content: "\e144";
}
.note-editor .glyphicon-phone:before {
content: "\e145";
}
.note-editor .glyphicon-pushpin:before {
content: "\e146";
}
.note-editor .glyphicon-usd:before {
content: "\e148";
}
.note-editor .glyphicon-gbp:before {
content: "\e149";
}
.note-editor .glyphicon-sort:before {
content: "\e150";
}
.note-editor .glyphicon-sort-by-alphabet:before {
content: "\e151";
}
.note-editor .glyphicon-sort-by-alphabet-alt:before {
content: "\e152";
}
.note-editor .glyphicon-sort-by-order:before {
content: "\e153";
}
.note-editor .glyphicon-sort-by-order-alt:before {
content: "\e154";
}
.note-editor .glyphicon-sort-by-attributes:before {
content: "\e155";
}
.note-editor .glyphicon-sort-by-attributes-alt:before {
content: "\e156";
}
.note-editor .glyphicon-unchecked:before {
content: "\e157";
}
.note-editor .glyphicon-expand:before {
content: "\e158";
}
.note-editor .glyphicon-collapse-down:before {
content: "\e159";
}
.note-editor .glyphicon-collapse-up:before {
content: "\e160";
}
.note-editor .glyphicon-log-in:before {
content: "\e161";
}
.note-editor .glyphicon-flash:before {
content: "\e162";
}
.note-editor .glyphicon-log-out:before {
content: "\e163";
}
.note-editor .glyphicon-new-window:before {
content: "\e164";
}
.note-editor .glyphicon-record:before {
content: "\e165";
}
.note-editor .glyphicon-save:before {
content: "\e166";
}
.note-editor .glyphicon-open:before {
content: "\e167";
}
.note-editor .glyphicon-saved:before {
content: "\e168";
}
.note-editor .glyphicon-import:before {
content: "\e169";
}
.note-editor .glyphicon-export:before {
content: "\e170";
}
.note-editor .glyphicon-send:before {
content: "\e171";
}
.note-editor .glyphicon-floppy-disk:before {
content: "\e172";
}
.note-editor .glyphicon-floppy-saved:before {
content: "\e173";
}
.note-editor .glyphicon-floppy-remove:before {
content: "\e174";
}
.note-editor .glyphicon-floppy-save:before {
content: "\e175";
}
.note-editor .glyphicon-floppy-open:before {
content: "\e176";
}
.note-editor .glyphicon-credit-card:before {
content: "\e177";
}
.note-editor .glyphicon-transfer:before {
content: "\e178";
}
.note-editor .glyphicon-cutlery:before {
content: "\e179";
}
.note-editor .glyphicon-header:before {
content: "\e180";
}
.note-editor .glyphicon-compressed:before {
content: "\e181";
}
.note-editor .glyphicon-earphone:before {
content: "\e182";
}
.note-editor .glyphicon-phone-alt:before {
content: "\e183";
}
.note-editor .glyphicon-tower:before {
content: "\e184";
}
.note-editor .glyphicon-stats:before {
content: "\e185";
}
.note-editor .glyphicon-sd-video:before {
content: "\e186";
}
.note-editor .glyphicon-hd-video:before {
content: "\e187";
}
.note-editor .glyphicon-subtitles:before {
content: "\e188";
}
.note-editor .glyphicon-sound-stereo:before {
content: "\e189";
}
.note-editor .glyphicon-sound-dolby:before {
content: "\e190";
}
.note-editor .glyphicon-sound-5-1:before {
content: "\e191";
}
.note-editor .glyphicon-sound-6-1:before {
content: "\e192";
}
.note-editor .glyphicon-sound-7-1:before {
content: "\e193";
}
.note-editor .glyphicon-copyright-mark:before {
content: "\e194";
}
.note-editor .glyphicon-registration-mark:before {
content: "\e195";
}
.note-editor .glyphicon-cloud-download:before {
content: "\e197";
}
.note-editor .glyphicon-cloud-upload:before {
content: "\e198";
}
.note-editor .glyphicon-tree-conifer:before {
content: "\e199";
}
.note-editor .glyphicon-tree-deciduous:before {
content: "\e200";
}
.note-editor .caret {
display: inline-block;
width: 0;
height: 0;
margin-left: 2px;
vertical-align: middle;
border-top: 4px solid #000000;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
border-bottom: 0 dotted;
}
.note-editor .dropdown {
position: relative;
}
.note-editor .dropdown-toggle:focus {
outline: 0;
}
.note-editor .dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
list-style: none;
font-size: 14px;
background-color: #ffffff;
border: 1px solid #cccccc;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
background-clip: padding-box;
}
.note-editor .dropdown-menu.pull-right {
right: 0;
left: auto;
}
.note-editor .dropdown-menu .divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.note-editor .dropdown-menu > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.428571429;
color: #333333;
white-space: nowrap;
}
.note-editor .dropdown-menu > li > a:hover,
.note-editor .dropdown-menu > li > a:focus {
text-decoration: none;
color: #262626;
background-color: #f5f5f5;
}
.note-editor .dropdown-menu > .active > a,
.note-editor .dropdown-menu > .active > a:hover,
.note-editor .dropdown-menu > .active > a:focus {
color: #ffffff;
text-decoration: none;
outline: 0;
background-color: #428bca;
}
.note-editor .dropdown-menu > .disabled > a,
.note-editor .dropdown-menu > .disabled > a:hover,
.note-editor .dropdown-menu > .disabled > a:focus {
color: #999999;
}
.note-editor .dropdown-menu > .disabled > a:hover,
.note-editor .dropdown-menu > .disabled > a:focus {
text-decoration: none;
background-color: transparent;
background-image: none;
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
cursor: not-allowed;
}
.note-editor .open > .dropdown-menu {
display: block;
}
.note-editor .open > a {
outline: 0;
}
.note-editor .dropdown-header {
display: block;
padding: 3px 20px;
font-size: 12px;
line-height: 1.428571429;
color: #999999;
}
.note-editor .dropdown-backdrop {
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
z-index: 990;
}
.note-editor .pull-right > .dropdown-menu {
right: 0;
left: auto;
}
.note-editor .dropup .caret,
.note-editor .navbar-fixed-bottom .dropdown .caret {
border-top: 0 dotted;
border-bottom: 4px solid #000000;
content: "";
}
.note-editor .dropup .dropdown-menu,
.note-editor .navbar-fixed-bottom .dropdown .dropdown-menu {
top: auto;
bottom: 100%;
margin-bottom: 1px;
}
@media (min-width: 768px) {
.note-editor .navbar-right .dropdown-menu {
right: 0;
left: auto;
}
}
.btn-default .note-editor .caret {
border-top-color: #333333;
}
.btn-primary .note-editor .caret,
.btn-success .note-editor .caret,
.btn-warning .note-editor .caret,
.btn-danger .note-editor .caret,
.btn-info .note-editor .caret {
border-top-color: #fff;
}
.note-editor .dropup .btn-default .caret {
border-bottom-color: #333333;
}
.note-editor .dropup .btn-primary .caret,
.note-editor .dropup .btn-success .caret,
.note-editor .dropup .btn-warning .caret,
.note-editor .dropup .btn-danger .caret,
.note-editor .dropup .btn-info .caret {
border-bottom-color: #fff;
}
.note-editor .btn-group,
.note-editor .btn-group-vertical {
position: relative;
display: inline-block;
vertical-align: middle;
}
.note-editor .btn-group > .btn,
.note-editor .btn-group-vertical > .btn {
position: relative;
float: left;
}
.note-editor .btn-group > .btn:hover,
.note-editor .btn-group-vertical > .btn:hover,
.note-editor .btn-group > .btn:focus,
.note-editor .btn-group-vertical > .btn:focus,
.note-editor .btn-group > .btn:active,
.note-editor .btn-group-vertical > .btn:active,
.note-editor .btn-group > .btn.active,
.note-editor .btn-group-vertical > .btn.active {
z-index: 2;
}
.note-editor .btn-group > .btn:focus,
.note-editor .btn-group-vertical > .btn:focus {
outline: none;
}
.note-editor .btn-group .btn + .btn,
.note-editor .btn-group .btn + .btn-group,
.note-editor .btn-group .btn-group + .btn,
.note-editor .btn-group .btn-group + .btn-group {
margin-left: -1px;
}
.note-editor .btn-toolbar:before,
.note-editor .btn-toolbar:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .btn-toolbar:after {
clear: both;
}
.note-editor .btn-toolbar:before,
.note-editor .btn-toolbar:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .btn-toolbar:after {
clear: both;
}
.note-editor .btn-toolbar .btn-group {
float: left;
}
.note-editor .btn-toolbar > .btn + .btn,
.note-editor .btn-toolbar > .btn-group + .btn,
.note-editor .btn-toolbar > .btn + .btn-group,
.note-editor .btn-toolbar > .btn-group + .btn-group {
margin-left: 5px;
}
.note-editor .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
border-radius: 0;
}
.note-editor .btn-group > .btn:first-child {
margin-left: 0;
}
.note-editor .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.note-editor .btn-group > .btn:last-child:not(:first-child),
.note-editor .btn-group > .dropdown-toggle:not(:first-child) {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.note-editor .btn-group > .btn-group {
float: left;
}
.note-editor .btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.note-editor .btn-group > .btn-group:first-child > .btn:last-child,
.note-editor .btn-group > .btn-group:first-child > .dropdown-toggle {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.note-editor .btn-group > .btn-group:last-child > .btn:first-child {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.note-editor .btn-group .dropdown-toggle:active,
.note-editor .btn-group.open .dropdown-toggle {
outline: 0;
}
.note-editor .btn-group-xs > .btn {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
padding: 1px 5px;
}
.note-editor .btn-group-sm > .btn {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.note-editor .btn-group-lg > .btn {
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
.note-editor .btn-group > .btn + .dropdown-toggle {
padding-left: 5px;
padding-right: 5px;
}
.note-editor .btn-group > .btn-lg + .dropdown-toggle {
padding-left: 12px;
padding-right: 12px;
}
.note-editor .btn-group.open .dropdown-toggle {
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.note-editor .btn .caret {
margin-left: 0;
}
.note-editor .btn-lg .caret {
border-width: 5px 5px 0;
border-bottom-width: 0;
}
.note-editor .dropup .btn-lg .caret {
border-width: 0 5px 5px;
}
.note-editor .btn-group-vertical > .btn,
.note-editor .btn-group-vertical > .btn-group {
display: block;
float: none;
width: 100%;
max-width: 100%;
}
.note-editor .btn-group-vertical > .btn-group:before,
.note-editor .btn-group-vertical > .btn-group:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .btn-group-vertical > .btn-group:after {
clear: both;
}
.note-editor .btn-group-vertical > .btn-group:before,
.note-editor .btn-group-vertical > .btn-group:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .btn-group-vertical > .btn-group:after {
clear: both;
}
.note-editor .btn-group-vertical > .btn-group > .btn {
float: none;
}
.note-editor .btn-group-vertical > .btn + .btn,
.note-editor .btn-group-vertical > .btn + .btn-group,
.note-editor .btn-group-vertical > .btn-group + .btn,
.note-editor .btn-group-vertical > .btn-group + .btn-group {
margin-top: -1px;
margin-left: 0;
}
.note-editor .btn-group-vertical > .btn:not(:first-child):not(:last-child) {
border-radius: 0;
}
.note-editor .btn-group-vertical > .btn:first-child:not(:last-child) {
border-top-right-radius: 4px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.note-editor .btn-group-vertical > .btn:last-child:not(:first-child) {
border-bottom-left-radius: 4px;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.note-editor .btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.note-editor .btn-group-vertical > .btn-group:first-child > .btn:last-child,
.note-editor .btn-group-vertical > .btn-group:first-child > .dropdown-toggle {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.note-editor .btn-group-vertical > .btn-group:last-child > .btn:first-child {
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.note-editor .btn-group-justified {
display: table;
width: 100%;
table-layout: fixed;
border-collapse: separate;
}
.note-editor .btn-group-justified .btn {
float: none;
display: table-cell;
width: 1%;
}
.note-editor [data-toggle="buttons"] > .btn > input[type="radio"],
.note-editor [data-toggle="buttons"] > .btn > input[type="checkbox"] {
display: none;
}
.note-editor .input-group {
position: relative;
display: table;
border-collapse: separate;
}
.note-editor .input-group.col {
float: none;
padding-left: 0;
padding-right: 0;
}
.note-editor .input-group .form-control {
width: 100%;
margin-bottom: 0;
}
.note-editor .input-group-lg > .form-control,
.note-editor .input-group-lg > .input-group-addon,
.note-editor .input-group-lg > .input-group-btn > .btn {
height: 45px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
select.note-editor .input-group-lg > .form-control,
select.note-editor .input-group-lg > .input-group-addon,
select.note-editor .input-group-lg > .input-group-btn > .btn {
height: 45px;
line-height: 45px;
}
textarea.note-editor .input-group-lg > .form-control,
textarea.note-editor .input-group-lg > .input-group-addon,
textarea.note-editor .input-group-lg > .input-group-btn > .btn {
height: auto;
}
.note-editor .input-group-sm > .form-control,
.note-editor .input-group-sm > .input-group-addon,
.note-editor .input-group-sm > .input-group-btn > .btn {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
select.note-editor .input-group-sm > .form-control,
select.note-editor .input-group-sm > .input-group-addon,
select.note-editor .input-group-sm > .input-group-btn > .btn {
height: 30px;
line-height: 30px;
}
textarea.note-editor .input-group-sm > .form-control,
textarea.note-editor .input-group-sm > .input-group-addon,
textarea.note-editor .input-group-sm > .input-group-btn > .btn {
height: auto;
}
.note-editor .input-group-addon,
.note-editor .input-group-btn,
.note-editor .input-group .form-control {
display: table-cell;
}
.note-editor .input-group-addon:not(:first-child):not(:last-child),
.note-editor .input-group-btn:not(:first-child):not(:last-child),
.note-editor .input-group .form-control:not(:first-child):not(:last-child) {
border-radius: 0;
}
.note-editor .input-group-addon,
.note-editor .input-group-btn {
width: 1%;
white-space: nowrap;
vertical-align: middle;
}
.note-editor .input-group-addon {
padding: 6px 12px;
font-size: 14px;
font-weight: normal;
line-height: 1;
color: #555555;
text-align: center;
background-color: #eeeeee;
border: 1px solid #cccccc;
border-radius: 4px;
}
.note-editor .input-group-addon.input-sm {
padding: 5px 10px;
font-size: 12px;
border-radius: 3px;
}
.note-editor .input-group-addon.input-lg {
padding: 10px 16px;
font-size: 18px;
border-radius: 6px;
}
.note-editor .input-group-addon input[type="radio"],
.note-editor .input-group-addon input[type="checkbox"] {
margin-top: 0;
}
.note-editor .input-group .form-control:first-child,
.note-editor .input-group-addon:first-child,
.note-editor .input-group-btn:first-child > .btn,
.note-editor .input-group-btn:first-child > .dropdown-toggle,
.note-editor .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.note-editor .input-group-addon:first-child {
border-right: 0;
}
.note-editor .input-group .form-control:last-child,
.note-editor .input-group-addon:last-child,
.note-editor .input-group-btn:last-child > .btn,
.note-editor .input-group-btn:last-child > .dropdown-toggle,
.note-editor .input-group-btn:first-child > .btn:not(:first-child) {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.note-editor .input-group-addon:last-child {
border-left: 0;
}
.note-editor .input-group-btn {
position: relative;
white-space: nowrap;
}
.note-editor .input-group-btn:first-child > .btn {
margin-right: -1px;
}
.note-editor .input-group-btn:last-child > .btn {
margin-left: -1px;
}
.note-editor .input-group-btn > .btn {
position: relative;
}
.note-editor .input-group-btn > .btn + .btn {
margin-left: -4px;
}
.note-editor .input-group-btn > .btn:hover,
.note-editor .input-group-btn > .btn:active {
z-index: 2;
}
.note-editor .nav {
margin-bottom: 0;
padding-left: 0;
list-style: none;
}
.note-editor .nav:before,
.note-editor .nav:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .nav:after {
clear: both;
}
.note-editor .nav:before,
.note-editor .nav:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .nav:after {
clear: both;
}
.note-editor .nav > li {
position: relative;
display: block;
}
.note-editor .nav > li > a {
position: relative;
display: block;
padding: 10px 15px;
}
.note-editor .nav > li > a:hover,
.note-editor .nav > li > a:focus {
text-decoration: none;
background-color: #eeeeee;
}
.note-editor .nav > li.disabled > a {
color: #999999;
}
.note-editor .nav > li.disabled > a:hover,
.note-editor .nav > li.disabled > a:focus {
color: #999999;
text-decoration: none;
background-color: transparent;
cursor: not-allowed;
}
.note-editor .nav .open > a,
.note-editor .nav .open > a:hover,
.note-editor .nav .open > a:focus {
background-color: #eeeeee;
border-color: #428bca;
}
.note-editor .nav .open > a .caret,
.note-editor .nav .open > a:hover .caret,
.note-editor .nav .open > a:focus .caret {
border-top-color: #2a6496;
border-bottom-color: #2a6496;
}
.note-editor .nav .nav-divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.note-editor .nav > li > a > img {
max-width: none;
}
.note-editor .nav-tabs {
border-bottom: 1px solid #dddddd;
}
.note-editor .nav-tabs > li {
float: left;
margin-bottom: -1px;
}
.note-editor .nav-tabs > li > a {
margin-right: 2px;
line-height: 1.428571429;
border: 1px solid transparent;
border-radius: 4px 4px 0 0;
}
.note-editor .nav-tabs > li > a:hover {
border-color: #eeeeee #eeeeee #dddddd;
}
.note-editor .nav-tabs > li.active > a,
.note-editor .nav-tabs > li.active > a:hover,
.note-editor .nav-tabs > li.active > a:focus {
color: #555555;
background-color: #ffffff;
border: 1px solid #dddddd;
border-bottom-color: transparent;
cursor: default;
}
.note-editor .nav-tabs.nav-justified {
width: 100%;
border-bottom: 0;
}
.note-editor .nav-tabs.nav-justified > li {
float: none;
}
.note-editor .nav-tabs.nav-justified > li > a {
text-align: center;
margin-bottom: 5px;
}
@media (min-width: 768px) {
.note-editor .nav-tabs.nav-justified > li {
display: table-cell;
width: 1%;
}
.note-editor .nav-tabs.nav-justified > li > a {
margin-bottom: 0;
}
}
.note-editor .nav-tabs.nav-justified > li > a {
margin-right: 0;
border-radius: 4px;
}
.note-editor .nav-tabs.nav-justified > .active > a,
.note-editor .nav-tabs.nav-justified > .active > a:hover,
.note-editor .nav-tabs.nav-justified > .active > a:focus {
border: 1px solid #dddddd;
}
@media (min-width: 768px) {
.note-editor .nav-tabs.nav-justified > li > a {
border-bottom: 1px solid #dddddd;
border-radius: 4px 4px 0 0;
}
.note-editor .nav-tabs.nav-justified > .active > a,
.note-editor .nav-tabs.nav-justified > .active > a:hover,
.note-editor .nav-tabs.nav-justified > .active > a:focus {
border-bottom-color: #ffffff;
}
}
.note-editor .nav-pills > li {
float: left;
}
.note-editor .nav-pills > li > a {
border-radius: 4px;
}
.note-editor .nav-pills > li + li {
margin-left: 2px;
}
.note-editor .nav-pills > li.active > a,
.note-editor .nav-pills > li.active > a:hover,
.note-editor .nav-pills > li.active > a:focus {
color: #ffffff;
background-color: #428bca;
}
.note-editor .nav-pills > li.active > a .caret,
.note-editor .nav-pills > li.active > a:hover .caret,
.note-editor .nav-pills > li.active > a:focus .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
}
.note-editor .nav-stacked > li {
float: none;
}
.note-editor .nav-stacked > li + li {
margin-top: 2px;
margin-left: 0;
}
.note-editor .nav-justified {
width: 100%;
}
.note-editor .nav-justified > li {
float: none;
}
.note-editor .nav-justified > li > a {
text-align: center;
margin-bottom: 5px;
}
@media (min-width: 768px) {
.note-editor .nav-justified > li {
display: table-cell;
width: 1%;
}
.note-editor .nav-justified > li > a {
margin-bottom: 0;
}
}
.note-editor .nav-tabs-justified {
border-bottom: 0;
}
.note-editor .nav-tabs-justified > li > a {
margin-right: 0;
border-radius: 4px;
}
.note-editor .nav-tabs-justified > .active > a,
.note-editor .nav-tabs-justified > .active > a:hover,
.note-editor .nav-tabs-justified > .active > a:focus {
border: 1px solid #dddddd;
}
@media (min-width: 768px) {
.note-editor .nav-tabs-justified > li > a {
border-bottom: 1px solid #dddddd;
border-radius: 4px 4px 0 0;
}
.note-editor .nav-tabs-justified > .active > a,
.note-editor .nav-tabs-justified > .active > a:hover,
.note-editor .nav-tabs-justified > .active > a:focus {
border-bottom-color: #ffffff;
}
}
.note-editor .tab-content > .tab-pane {
display: none;
}
.note-editor .tab-content > .active {
display: block;
}
.note-editor .nav .caret {
border-top-color: #428bca;
border-bottom-color: #428bca;
}
.note-editor .nav a:hover .caret {
border-top-color: #2a6496;
border-bottom-color: #2a6496;
}
.note-editor .nav-tabs .dropdown-menu {
margin-top: -1px;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.note-editor .navbar {
position: relative;
z-index: 1000;
min-height: 50px;
margin-bottom: 20px;
border: 1px solid transparent;
}
.note-editor .navbar:before,
.note-editor .navbar:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .navbar:after {
clear: both;
}
.note-editor .navbar:before,
.note-editor .navbar:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .navbar:after {
clear: both;
}
@media (min-width: 768px) {
.note-editor .navbar {
border-radius: 4px;
}
}
.note-editor .navbar-header:before,
.note-editor .navbar-header:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .navbar-header:after {
clear: both;
}
.note-editor .navbar-header:before,
.note-editor .navbar-header:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .navbar-header:after {
clear: both;
}
@media (min-width: 768px) {
.note-editor .navbar-header {
float: left;
}
}
.note-editor .navbar-collapse {
max-height: 340px;
overflow-x: visible;
padding-right: 15px;
padding-left: 15px;
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
-webkit-overflow-scrolling: touch;
}
.note-editor .navbar-collapse:before,
.note-editor .navbar-collapse:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .navbar-collapse:after {
clear: both;
}
.note-editor .navbar-collapse:before,
.note-editor .navbar-collapse:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .navbar-collapse:after {
clear: both;
}
.note-editor .navbar-collapse.in {
overflow-y: auto;
}
@media (min-width: 768px) {
.note-editor .navbar-collapse {
width: auto;
border-top: 0;
box-shadow: none;
}
.note-editor .navbar-collapse.collapse {
display: block !important;
height: auto !important;
padding-bottom: 0;
overflow: visible !important;
}
.note-editor .navbar-collapse.in {
overflow-y: visible;
}
.note-editor .navbar-collapse .navbar-nav.navbar-left:first-child {
margin-left: -15px;
}
.note-editor .navbar-collapse .navbar-nav.navbar-right:last-child {
margin-right: -15px;
}
.note-editor .navbar-collapse .navbar-text:last-child {
margin-right: 0;
}
}
.note-editor .container > .navbar-header,
.note-editor .container > .navbar-collapse {
margin-right: -15px;
margin-left: -15px;
}
@media (min-width: 768px) {
.note-editor .container > .navbar-header,
.note-editor .container > .navbar-collapse {
margin-right: 0;
margin-left: 0;
}
}
.note-editor .navbar-static-top {
border-width: 0 0 1px;
}
@media (min-width: 768px) {
.note-editor .navbar-static-top {
border-radius: 0;
}
}
.note-editor .navbar-fixed-top,
.note-editor .navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
border-width: 0 0 1px;
}
@media (min-width: 768px) {
.note-editor .navbar-fixed-top,
.note-editor .navbar-fixed-bottom {
border-radius: 0;
}
}
.note-editor .navbar-fixed-top {
z-index: 1030;
top: 0;
}
.note-editor .navbar-fixed-bottom {
bottom: 0;
margin-bottom: 0;
}
.note-editor .navbar-brand {
float: left;
padding: 15px 15px;
font-size: 18px;
line-height: 20px;
}
.note-editor .navbar-brand:hover,
.note-editor .navbar-brand:focus {
text-decoration: none;
}
@media (min-width: 768px) {
.navbar > .container .note-editor .navbar-brand {
margin-left: -15px;
}
}
.note-editor .navbar-toggle {
position: relative;
float: right;
margin-right: 15px;
padding: 9px 10px;
margin-top: 8px;
margin-bottom: 8px;
background-color: transparent;
border: 1px solid transparent;
border-radius: 4px;
}
.note-editor .navbar-toggle .icon-bar {
display: block;
width: 22px;
height: 2px;
border-radius: 1px;
}
.note-editor .navbar-toggle .icon-bar + .icon-bar {
margin-top: 4px;
}
@media (min-width: 768px) {
.note-editor .navbar-toggle {
display: none;
}
}
.note-editor .navbar-nav {
margin: 7.5px -15px;
}
.note-editor .navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
line-height: 20px;
}
@media (max-width: 767px) {
.note-editor .navbar-nav .open .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
background-color: transparent;
border: 0;
box-shadow: none;
}
.note-editor .navbar-nav .open .dropdown-menu > li > a,
.note-editor .navbar-nav .open .dropdown-menu .dropdown-header {
padding: 5px 15px 5px 25px;
}
.note-editor .navbar-nav .open .dropdown-menu > li > a {
line-height: 20px;
}
.note-editor .navbar-nav .open .dropdown-menu > li > a:hover,
.note-editor .navbar-nav .open .dropdown-menu > li > a:focus {
background-image: none;
}
}
@media (min-width: 768px) {
.note-editor .navbar-nav {
float: left;
margin: 0;
}
.note-editor .navbar-nav > li {
float: left;
}
.note-editor .navbar-nav > li > a {
padding-top: 15px;
padding-bottom: 15px;
}
}
@media (min-width: 768px) {
.note-editor .navbar-left {
float: left !important;
}
.note-editor .navbar-right {
float: right !important;
}
}
.note-editor .navbar-form {
margin-left: -15px;
margin-right: -15px;
padding: 10px 15px;
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
margin-top: 8px;
margin-bottom: 8px;
}
@media (min-width: 768px) {
.note-editor .navbar-form .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.note-editor .navbar-form .form-control {
display: inline-block;
}
.note-editor .navbar-form .radio,
.note-editor .navbar-form .checkbox {
display: inline-block;
margin-top: 0;
margin-bottom: 0;
padding-left: 0;
}
.note-editor .navbar-form .radio input[type="radio"],
.note-editor .navbar-form .checkbox input[type="checkbox"] {
float: none;
margin-left: 0;
}
}
@media (max-width: 767px) {
.note-editor .navbar-form .form-group {
margin-bottom: 5px;
}
}
@media (min-width: 768px) {
.note-editor .navbar-form {
width: auto;
border: 0;
margin-left: 0;
margin-right: 0;
padding-top: 0;
padding-bottom: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
}
.note-editor .navbar-nav > li > .dropdown-menu {
margin-top: 0;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.note-editor .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.note-editor .navbar-nav.pull-right > li > .dropdown-menu,
.note-editor .navbar-nav > li > .dropdown-menu.pull-right {
left: auto;
right: 0;
}
.note-editor .navbar-btn {
margin-top: 8px;
margin-bottom: 8px;
}
.note-editor .navbar-text {
float: left;
margin-top: 15px;
margin-bottom: 15px;
}
@media (min-width: 768px) {
.note-editor .navbar-text {
margin-left: 15px;
margin-right: 15px;
}
}
.note-editor .navbar-default {
background-color: #f8f8f8;
border-color: #e7e7e7;
}
.note-editor .navbar-default .navbar-brand {
color: #777777;
}
.note-editor .navbar-default .navbar-brand:hover,
.note-editor .navbar-default .navbar-brand:focus {
color: #5e5e5e;
background-color: transparent;
}
.note-editor .navbar-default .navbar-text {
color: #777777;
}
.note-editor .navbar-default .navbar-nav > li > a {
color: #777777;
}
.note-editor .navbar-default .navbar-nav > li > a:hover,
.note-editor .navbar-default .navbar-nav > li > a:focus {
color: #333333;
background-color: transparent;
}
.note-editor .navbar-default .navbar-nav > .active > a,
.note-editor .navbar-default .navbar-nav > .active > a:hover,
.note-editor .navbar-default .navbar-nav > .active > a:focus {
color: #555555;
background-color: #e7e7e7;
}
.note-editor .navbar-default .navbar-nav > .disabled > a,
.note-editor .navbar-default .navbar-nav > .disabled > a:hover,
.note-editor .navbar-default .navbar-nav > .disabled > a:focus {
color: #cccccc;
background-color: transparent;
}
.note-editor .navbar-default .navbar-toggle {
border-color: #dddddd;
}
.note-editor .navbar-default .navbar-toggle:hover,
.note-editor .navbar-default .navbar-toggle:focus {
background-color: #dddddd;
}
.note-editor .navbar-default .navbar-toggle .icon-bar {
background-color: #cccccc;
}
.note-editor .navbar-default .navbar-collapse,
.note-editor .navbar-default .navbar-form {
border-color: #e7e7e7;
}
.note-editor .navbar-default .navbar-nav > .dropdown > a:hover .caret,
.note-editor .navbar-default .navbar-nav > .dropdown > a:focus .caret {
border-top-color: #333333;
border-bottom-color: #333333;
}
.note-editor .navbar-default .navbar-nav > .open > a,
.note-editor .navbar-default .navbar-nav > .open > a:hover,
.note-editor .navbar-default .navbar-nav > .open > a:focus {
background-color: #e7e7e7;
color: #555555;
}
.note-editor .navbar-default .navbar-nav > .open > a .caret,
.note-editor .navbar-default .navbar-nav > .open > a:hover .caret,
.note-editor .navbar-default .navbar-nav > .open > a:focus .caret {
border-top-color: #555555;
border-bottom-color: #555555;
}
.note-editor .navbar-default .navbar-nav > .dropdown > a .caret {
border-top-color: #777777;
border-bottom-color: #777777;
}
@media (max-width: 767px) {
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #777777;
}
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #333333;
background-color: transparent;
}
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > .active > a,
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #555555;
background-color: #e7e7e7;
}
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #cccccc;
background-color: transparent;
}
}
.note-editor .navbar-default .navbar-link {
color: #777777;
}
.note-editor .navbar-default .navbar-link:hover {
color: #333333;
}
.note-editor .navbar-inverse {
background-color: #222222;
border-color: #080808;
}
.note-editor .navbar-inverse .navbar-brand {
color: #999999;
}
.note-editor .navbar-inverse .navbar-brand:hover,
.note-editor .navbar-inverse .navbar-brand:focus {
color: #ffffff;
background-color: transparent;
}
.note-editor .navbar-inverse .navbar-text {
color: #999999;
}
.note-editor .navbar-inverse .navbar-nav > li > a {
color: #999999;
}
.note-editor .navbar-inverse .navbar-nav > li > a:hover,
.note-editor .navbar-inverse .navbar-nav > li > a:focus {
color: #ffffff;
background-color: transparent;
}
.note-editor .navbar-inverse .navbar-nav > .active > a,
.note-editor .navbar-inverse .navbar-nav > .active > a:hover,
.note-editor .navbar-inverse .navbar-nav > .active > a:focus {
color: #ffffff;
background-color: #080808;
}
.note-editor .navbar-inverse .navbar-nav > .disabled > a,
.note-editor .navbar-inverse .navbar-nav > .disabled > a:hover,
.note-editor .navbar-inverse .navbar-nav > .disabled > a:focus {
color: #444444;
background-color: transparent;
}
.note-editor .navbar-inverse .navbar-toggle {
border-color: #333333;
}
.note-editor .navbar-inverse .navbar-toggle:hover,
.note-editor .navbar-inverse .navbar-toggle:focus {
background-color: #333333;
}
.note-editor .navbar-inverse .navbar-toggle .icon-bar {
background-color: #ffffff;
}
.note-editor .navbar-inverse .navbar-collapse,
.note-editor .navbar-inverse .navbar-form {
border-color: #101010;
}
.note-editor .navbar-inverse .navbar-nav > .open > a,
.note-editor .navbar-inverse .navbar-nav > .open > a:hover,
.note-editor .navbar-inverse .navbar-nav > .open > a:focus {
background-color: #080808;
color: #ffffff;
}
.note-editor .navbar-inverse .navbar-nav > .dropdown > a:hover .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
}
.note-editor .navbar-inverse .navbar-nav > .dropdown > a .caret {
border-top-color: #999999;
border-bottom-color: #999999;
}
.note-editor .navbar-inverse .navbar-nav > .open > a .caret,
.note-editor .navbar-inverse .navbar-nav > .open > a:hover .caret,
.note-editor .navbar-inverse .navbar-nav > .open > a:focus .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
}
@media (max-width: 767px) {
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
border-color: #080808;
}
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
color: #999999;
}
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
color: #ffffff;
background-color: transparent;
}
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #ffffff;
background-color: #080808;
}
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #444444;
background-color: transparent;
}
}
.note-editor .navbar-inverse .navbar-link {
color: #999999;
}
.note-editor .navbar-inverse .navbar-link:hover {
color: #ffffff;
}
.note-editor .breadcrumb {
padding: 8px 15px;
margin-bottom: 20px;
list-style: none;
background-color: #f5f5f5;
border-radius: 4px;
}
.note-editor .breadcrumb > li {
display: inline-block;
}
.note-editor .breadcrumb > li + li:before {
content: "/\00a0";
padding: 0 5px;
color: #cccccc;
}
.note-editor .breadcrumb > .active {
color: #999999;
}
.note-editor .pagination {
display: inline-block;
padding-left: 0;
margin: 20px 0;
border-radius: 4px;
}
.note-editor .pagination > li {
display: inline;
}
.note-editor .pagination > li > a,
.note-editor .pagination > li > span {
position: relative;
float: left;
padding: 6px 12px;
line-height: 1.428571429;
text-decoration: none;
background-color: #ffffff;
border: 1px solid #dddddd;
margin-left: -1px;
}
.note-editor .pagination > li:first-child > a,
.note-editor .pagination > li:first-child > span {
margin-left: 0;
border-bottom-left-radius: 4px;
border-top-left-radius: 4px;
}
.note-editor .pagination > li:last-child > a,
.note-editor .pagination > li:last-child > span {
border-bottom-right-radius: 4px;
border-top-right-radius: 4px;
}
.note-editor .pagination > li > a:hover,
.note-editor .pagination > li > span:hover,
.note-editor .pagination > li > a:focus,
.note-editor .pagination > li > span:focus {
background-color: #eeeeee;
}
.note-editor .pagination > .active > a,
.note-editor .pagination > .active > span,
.note-editor .pagination > .active > a:hover,
.note-editor .pagination > .active > span:hover,
.note-editor .pagination > .active > a:focus,
.note-editor .pagination > .active > span:focus {
z-index: 2;
color: #ffffff;
background-color: #428bca;
border-color: #428bca;
cursor: default;
}
.note-editor .pagination > .disabled > span,
.note-editor .pagination > .disabled > span:hover,
.note-editor .pagination > .disabled > span:focus,
.note-editor .pagination > .disabled > a,
.note-editor .pagination > .disabled > a:hover,
.note-editor .pagination > .disabled > a:focus {
color: #999999;
background-color: #ffffff;
border-color: #dddddd;
cursor: not-allowed;
}
.note-editor .pagination-lg > li > a,
.note-editor .pagination-lg > li > span {
padding: 10px 16px;
font-size: 18px;
}
.note-editor .pagination-lg > li:first-child > a,
.note-editor .pagination-lg > li:first-child > span {
border-bottom-left-radius: 6px;
border-top-left-radius: 6px;
}
.note-editor .pagination-lg > li:last-child > a,
.note-editor .pagination-lg > li:last-child > span {
border-bottom-right-radius: 6px;
border-top-right-radius: 6px;
}
.note-editor .pagination-sm > li > a,
.note-editor .pagination-sm > li > span {
padding: 5px 10px;
font-size: 12px;
}
.note-editor .pagination-sm > li:first-child > a,
.note-editor .pagination-sm > li:first-child > span {
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
}
.note-editor .pagination-sm > li:last-child > a,
.note-editor .pagination-sm > li:last-child > span {
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
}
.note-editor .pager {
padding-left: 0;
margin: 20px 0;
list-style: none;
text-align: center;
}
.note-editor .pager:before,
.note-editor .pager:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .pager:after {
clear: both;
}
.note-editor .pager:before,
.note-editor .pager:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .pager:after {
clear: both;
}
.note-editor .pager li {
display: inline;
}
.note-editor .pager li > a,
.note-editor .pager li > span {
display: inline-block;
padding: 5px 14px;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 15px;
}
.note-editor .pager li > a:hover,
.note-editor .pager li > a:focus {
text-decoration: none;
background-color: #eeeeee;
}
.note-editor .pager .next > a,
.note-editor .pager .next > span {
float: right;
}
.note-editor .pager .previous > a,
.note-editor .pager .previous > span {
float: left;
}
.note-editor .pager .disabled > a,
.note-editor .pager .disabled > a:hover,
.note-editor .pager .disabled > a:focus,
.note-editor .pager .disabled > span {
color: #999999;
background-color: #ffffff;
cursor: not-allowed;
}
.note-editor .label {
display: inline;
padding: .2em .6em .3em;
font-size: 75%;
font-weight: bold;
line-height: 1;
color: #ffffff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25em;
}
.note-editor .label[href]:hover,
.note-editor .label[href]:focus {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
.note-editor .label:empty {
display: none;
}
.note-editor .label-default {
background-color: #999999;
}
.note-editor .label-default[href]:hover,
.note-editor .label-default[href]:focus {
background-color: #808080;
}
.note-editor .label-primary {
background-color: #428bca;
}
.note-editor .label-primary[href]:hover,
.note-editor .label-primary[href]:focus {
background-color: #3071a9;
}
.note-editor .label-success {
background-color: #5cb85c;
}
.note-editor .label-success[href]:hover,
.note-editor .label-success[href]:focus {
background-color: #449d44;
}
.note-editor .label-info {
background-color: #5bc0de;
}
.note-editor .label-info[href]:hover,
.note-editor .label-info[href]:focus {
background-color: #31b0d5;
}
.note-editor .label-warning {
background-color: #f0ad4e;
}
.note-editor .label-warning[href]:hover,
.note-editor .label-warning[href]:focus {
background-color: #ec971f;
}
.note-editor .label-danger {
background-color: #d9534f;
}
.note-editor .label-danger[href]:hover,
.note-editor .label-danger[href]:focus {
background-color: #c9302c;
}
.note-editor .badge {
display: inline-block;
min-width: 10px;
padding: 3px 7px;
font-size: 12px;
font-weight: bold;
color: #ffffff;
line-height: 1;
vertical-align: baseline;
white-space: nowrap;
text-align: center;
background-color: #999999;
border-radius: 10px;
}
.note-editor .badge:empty {
display: none;
}
.note-editor a.badge:hover,
.note-editor a.badge:focus {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
.note-editor .btn .badge {
position: relative;
top: -1px;
}
.note-editor a.list-group-item.active > .badge,
.note-editor .nav-pills > .active > a > .badge {
color: #428bca;
background-color: #ffffff;
}
.note-editor .nav-pills > li > a > .badge {
margin-left: 3px;
}
.note-editor .jumbotron {
padding: 30px;
margin-bottom: 30px;
font-size: 21px;
font-weight: 200;
line-height: 2.1428571435;
color: inherit;
background-color: #eeeeee;
}
.note-editor .jumbotron h1 {
line-height: 1;
color: inherit;
}
.note-editor .jumbotron p {
line-height: 1.4;
}
.container .note-editor .jumbotron {
border-radius: 6px;
}
@media screen and (min-width: 768px) {
.note-editor .jumbotron {
padding-top: 48px;
padding-bottom: 48px;
}
.container .note-editor .jumbotron {
padding-left: 60px;
padding-right: 60px;
}
.note-editor .jumbotron h1 {
font-size: 63px;
}
}
.note-editor .thumbnail {
padding: 4px;
line-height: 1.428571429;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
display: inline-block;
max-width: 100%;
height: auto;
display: block;
margin-bottom: 20px;
}
.note-editor .thumbnail > img {
display: block;
max-width: 100%;
height: auto;
}
.note-editor a.thumbnail:hover,
.note-editor a.thumbnail:focus,
.note-editor a.thumbnail.active {
border-color: #428bca;
}
.note-editor .thumbnail > img {
margin-left: auto;
margin-right: auto;
}
.note-editor .thumbnail .caption {
padding: 9px;
color: #333333;
}
.note-editor .alert {
padding: 15px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px;
}
.note-editor .alert h4 {
margin-top: 0;
color: inherit;
}
.note-editor .alert .alert-link {
font-weight: bold;
}
.note-editor .alert > p,
.note-editor .alert > ul {
margin-bottom: 0;
}
.note-editor .alert > p + p {
margin-top: 5px;
}
.note-editor .alert-dismissable {
padding-right: 35px;
}
.note-editor .alert-dismissable .close {
position: relative;
top: -2px;
right: -21px;
color: inherit;
}
.note-editor .alert-success {
background-color: #dff0d8;
border-color: #d6e9c6;
color: #468847;
}
.note-editor .alert-success hr {
border-top-color: #c9e2b3;
}
.note-editor .alert-success .alert-link {
color: #356635;
}
.note-editor .alert-info {
background-color: #d9edf7;
border-color: #bce8f1;
color: #3a87ad;
}
.note-editor .alert-info hr {
border-top-color: #a6e1ec;
}
.note-editor .alert-info .alert-link {
color: #2d6987;
}
.note-editor .alert-warning {
background-color: #fcf8e3;
border-color: #faebcc;
color: #c09853;
}
.note-editor .alert-warning hr {
border-top-color: #f7e1b5;
}
.note-editor .alert-warning .alert-link {
color: #a47e3c;
}
.note-editor .alert-danger {
background-color: #f2dede;
border-color: #ebccd1;
color: #b94a48;
}
.note-editor .alert-danger hr {
border-top-color: #e4b9c0;
}
.note-editor .alert-danger .alert-link {
color: #953b39;
}
@-webkit-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@-moz-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@-o-keyframes progress-bar-stripes {
from {
background-position: 0 0;
}
to {
background-position: 40px 0;
}
}
@keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
.note-editor .progress {
overflow: hidden;
height: 20px;
margin-bottom: 20px;
background-color: #f5f5f5;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}
.note-editor .progress-bar {
float: left;
width: 0%;
height: 100%;
font-size: 12px;
line-height: 20px;
color: #ffffff;
text-align: center;
background-color: #428bca;
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-webkit-transition: width 0.6s ease;
transition: width 0.6s ease;
}
.note-editor .progress-striped .progress-bar {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-size: 40px 40px;
}
.note-editor .progress.active .progress-bar {
-webkit-animation: progress-bar-stripes 2s linear infinite;
-moz-animation: progress-bar-stripes 2s linear infinite;
-ms-animation: progress-bar-stripes 2s linear infinite;
-o-animation: progress-bar-stripes 2s linear infinite;
animation: progress-bar-stripes 2s linear infinite;
}
.note-editor .progress-bar-success {
background-color: #5cb85c;
}
.progress-striped .note-editor .progress-bar-success {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.note-editor .progress-bar-info {
background-color: #5bc0de;
}
.progress-striped .note-editor .progress-bar-info {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.note-editor .progress-bar-warning {
background-color: #f0ad4e;
}
.progress-striped .note-editor .progress-bar-warning {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.note-editor .progress-bar-danger {
background-color: #d9534f;
}
.progress-striped .note-editor .progress-bar-danger {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.note-editor .media,
.note-editor .media-body {
overflow: hidden;
zoom: 1;
}
.note-editor .media,
.note-editor .media .media {
margin-top: 15px;
}
.note-editor .media:first-child {
margin-top: 0;
}
.note-editor .media-object {
display: block;
}
.note-editor .media-heading {
margin: 0 0 5px;
}
.note-editor .media > .pull-left {
margin-right: 10px;
}
.note-editor .media > .pull-right {
margin-left: 10px;
}
.note-editor .media-list {
padding-left: 0;
list-style: none;
}
.note-editor .list-group {
margin-bottom: 20px;
padding-left: 0;
}
.note-editor .list-group-item {
position: relative;
display: block;
padding: 10px 15px;
margin-bottom: -1px;
background-color: #ffffff;
border: 1px solid #dddddd;
}
.note-editor .list-group-item:first-child {
border-top-right-radius: 4px;
border-top-left-radius: 4px;
}
.note-editor .list-group-item:last-child {
margin-bottom: 0;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.note-editor .list-group-item > .badge {
float: right;
}
.note-editor .list-group-item > .badge + .badge {
margin-right: 5px;
}
.note-editor a.list-group-item {
color: #555555;
}
.note-editor a.list-group-item .list-group-item-heading {
color: #333333;
}
.note-editor a.list-group-item:hover,
.note-editor a.list-group-item:focus {
text-decoration: none;
background-color: #f5f5f5;
}
.note-editor a.list-group-item.active,
.note-editor a.list-group-item.active:hover,
.note-editor a.list-group-item.active:focus {
z-index: 2;
color: #ffffff;
background-color: #428bca;
border-color: #428bca;
}
.note-editor a.list-group-item.active .list-group-item-heading,
.note-editor a.list-group-item.active:hover .list-group-item-heading,
.note-editor a.list-group-item.active:focus .list-group-item-heading {
color: inherit;
}
.note-editor a.list-group-item.active .list-group-item-text,
.note-editor a.list-group-item.active:hover .list-group-item-text,
.note-editor a.list-group-item.active:focus .list-group-item-text {
color: #e1edf7;
}
.note-editor .list-group-item-heading {
margin-top: 0;
margin-bottom: 5px;
}
.note-editor .list-group-item-text {
margin-bottom: 0;
line-height: 1.3;
}
.note-editor .panel {
margin-bottom: 20px;
background-color: #ffffff;
border: 1px solid transparent;
border-radius: 4px;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}
.note-editor .panel-body {
padding: 15px;
}
.note-editor .panel-body:before,
.note-editor .panel-body:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .panel-body:after {
clear: both;
}
.note-editor .panel-body:before,
.note-editor .panel-body:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .panel-body:after {
clear: both;
}
.note-editor .panel > .list-group {
margin-bottom: 0;
}
.note-editor .panel > .list-group .list-group-item {
border-width: 1px 0;
}
.note-editor .panel > .list-group .list-group-item:first-child {
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.note-editor .panel > .list-group .list-group-item:last-child {
border-bottom: 0;
}
.note-editor .panel-heading + .list-group .list-group-item:first-child {
border-top-width: 0;
}
.note-editor .panel > .table,
.note-editor .panel > .table-responsive {
margin-bottom: 0;
}
.note-editor .panel > .panel-body + .table,
.note-editor .panel > .panel-body + .table-responsive {
border-top: 1px solid #dddddd;
}
.note-editor .panel > .table-bordered,
.note-editor .panel > .table-responsive > .table-bordered {
border: 0;
}
.note-editor .panel > .table-bordered > thead > tr > th:first-child,
.note-editor .panel > .table-responsive > .table-bordered > thead > tr > th:first-child,
.note-editor .panel > .table-bordered > tbody > tr > th:first-child,
.note-editor .panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,
.note-editor .panel > .table-bordered > tfoot > tr > th:first-child,
.note-editor .panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,
.note-editor .panel > .table-bordered > thead > tr > td:first-child,
.note-editor .panel > .table-responsive > .table-bordered > thead > tr > td:first-child,
.note-editor .panel > .table-bordered > tbody > tr > td:first-child,
.note-editor .panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,
.note-editor .panel > .table-bordered > tfoot > tr > td:first-child,
.note-editor .panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0;
}
.note-editor .panel > .table-bordered > thead > tr > th:last-child,
.note-editor .panel > .table-responsive > .table-bordered > thead > tr > th:last-child,
.note-editor .panel > .table-bordered > tbody > tr > th:last-child,
.note-editor .panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,
.note-editor .panel > .table-bordered > tfoot > tr > th:last-child,
.note-editor .panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,
.note-editor .panel > .table-bordered > thead > tr > td:last-child,
.note-editor .panel > .table-responsive > .table-bordered > thead > tr > td:last-child,
.note-editor .panel > .table-bordered > tbody > tr > td:last-child,
.note-editor .panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,
.note-editor .panel > .table-bordered > tfoot > tr > td:last-child,
.note-editor .panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0;
}
.note-editor .panel > .table-bordered > thead > tr:last-child > th,
.note-editor .panel > .table-responsive > .table-bordered > thead > tr:last-child > th,
.note-editor .panel > .table-bordered > tbody > tr:last-child > th,
.note-editor .panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,
.note-editor .panel > .table-bordered > tfoot > tr:last-child > th,
.note-editor .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th,
.note-editor .panel > .table-bordered > thead > tr:last-child > td,
.note-editor .panel > .table-responsive > .table-bordered > thead > tr:last-child > td,
.note-editor .panel > .table-bordered > tbody > tr:last-child > td,
.note-editor .panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,
.note-editor .panel > .table-bordered > tfoot > tr:last-child > td,
.note-editor .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td {
border-bottom: 0;
}
.note-editor .panel-heading {
padding: 10px 15px;
border-bottom: 1px solid transparent;
border-top-right-radius: 3px;
border-top-left-radius: 3px;
}
.note-editor .panel-title {
margin-top: 0;
margin-bottom: 0;
font-size: 16px;
}
.note-editor .panel-title > a {
color: inherit;
}
.note-editor .panel-footer {
padding: 10px 15px;
background-color: #f5f5f5;
border-top: 1px solid #dddddd;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.note-editor .panel-group .panel {
margin-bottom: 0;
border-radius: 4px;
overflow: hidden;
}
.note-editor .panel-group .panel + .panel {
margin-top: 5px;
}
.note-editor .panel-group .panel-heading {
border-bottom: 0;
}
.note-editor .panel-group .panel-heading + .panel-collapse .panel-body {
border-top: 1px solid #dddddd;
}
.note-editor .panel-group .panel-footer {
border-top: 0;
}
.note-editor .panel-group .panel-footer + .panel-collapse .panel-body {
border-bottom: 1px solid #dddddd;
}
.note-editor .panel-default {
border-color: #dddddd;
}
.note-editor .panel-default > .panel-heading {
color: #333333;
background-color: #f5f5f5;
border-color: #dddddd;
}
.note-editor .panel-default > .panel-heading + .panel-collapse .panel-body {
border-top-color: #dddddd;
}
.note-editor .panel-default > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #dddddd;
}
.note-editor .panel-primary {
border-color: #428bca;
}
.note-editor .panel-primary > .panel-heading {
color: #ffffff;
background-color: #428bca;
border-color: #428bca;
}
.note-editor .panel-primary > .panel-heading + .panel-collapse .panel-body {
border-top-color: #428bca;
}
.note-editor .panel-primary > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #428bca;
}
.note-editor .panel-success {
border-color: #d6e9c6;
}
.note-editor .panel-success > .panel-heading {
color: #468847;
background-color: #dff0d8;
border-color: #d6e9c6;
}
.note-editor .panel-success > .panel-heading + .panel-collapse .panel-body {
border-top-color: #d6e9c6;
}
.note-editor .panel-success > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #d6e9c6;
}
.note-editor .panel-warning {
border-color: #faebcc;
}
.note-editor .panel-warning > .panel-heading {
color: #c09853;
background-color: #fcf8e3;
border-color: #faebcc;
}
.note-editor .panel-warning > .panel-heading + .panel-collapse .panel-body {
border-top-color: #faebcc;
}
.note-editor .panel-warning > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #faebcc;
}
.note-editor .panel-danger {
border-color: #ebccd1;
}
.note-editor .panel-danger > .panel-heading {
color: #b94a48;
background-color: #f2dede;
border-color: #ebccd1;
}
.note-editor .panel-danger > .panel-heading + .panel-collapse .panel-body {
border-top-color: #ebccd1;
}
.note-editor .panel-danger > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #ebccd1;
}
.note-editor .panel-info {
border-color: #bce8f1;
}
.note-editor .panel-info > .panel-heading {
color: #3a87ad;
background-color: #d9edf7;
border-color: #bce8f1;
}
.note-editor .panel-info > .panel-heading + .panel-collapse .panel-body {
border-top-color: #bce8f1;
}
.note-editor .panel-info > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #bce8f1;
}
.note-editor .well {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
.note-editor .well blockquote {
border-color: #ddd;
border-color: rgba(0, 0, 0, 0.15);
}
.note-editor .well-lg {
padding: 24px;
border-radius: 6px;
}
.note-editor .well-sm {
padding: 9px;
border-radius: 3px;
}
.note-editor .close {
float: right;
font-size: 21px;
font-weight: bold;
line-height: 1;
color: #000000;
text-shadow: 0 1px 0 #ffffff;
opacity: 0.2;
filter: alpha(opacity=20);
}
.note-editor .close:hover,
.note-editor .close:focus {
color: #000000;
text-decoration: none;
cursor: pointer;
opacity: 0.5;
filter: alpha(opacity=50);
}
button.note-editor .close {
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
-webkit-appearance: none;
}
.modal-open {
overflow: hidden;
}
.modal {
display: none;
overflow: auto;
overflow-y: scroll;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
}
.modal.fade .modal-dialog {
-webkit-transform: translate(0, -25%);
-ms-transform: translate(0, -25%);
transform: translate(0, -25%);
-webkit-transition: -webkit-transform 0.3s ease-out;
-moz-transition: -moz-transform 0.3s ease-out;
-o-transition: -o-transform 0.3s ease-out;
transition: transform 0.3s ease-out;
}
.modal.in .modal-dialog {
-webkit-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
}
.modal-dialog {
margin-left: auto;
margin-right: auto;
width: auto;
padding: 10px;
z-index: 1050;
}
.modal-content {
position: relative;
background-color: #ffffff;
border: 1px solid #999999;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
background-clip: padding-box;
outline: none;
}
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1030;
background-color: #000000;
}
.modal-backdrop.fade {
opacity: 0;
filter: alpha(opacity=0);
}
.modal-backdrop.in {
opacity: 0.5;
filter: alpha(opacity=50);
}
.modal-header {
padding: 15px;
border-bottom: 1px solid #e5e5e5;
min-height: 16.428571429px;
}
.modal-header .close {
margin-top: -2px;
}
.modal-title {
margin: 0;
line-height: 1.428571429;
}
.modal-body {
position: relative;
padding: 20px;
}
.modal-footer {
margin-top: 15px;
padding: 19px 20px 20px;
text-align: right;
border-top: 1px solid #e5e5e5;
}
.modal-footer:before,
.modal-footer:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.modal-footer:after {
clear: both;
}
.modal-footer:before,
.modal-footer:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.modal-footer:after {
clear: both;
}
.modal-footer .btn + .btn {
margin-left: 5px;
margin-bottom: 0;
}
.modal-footer .btn-group .btn + .btn {
margin-left: -1px;
}
.modal-footer .btn-block + .btn-block {
margin-left: 0;
}
@media screen and (min-width: 768px) {
.modal-dialog {
width: 600px;
padding-top: 30px;
padding-bottom: 30px;
}
.modal-content {
-webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
}
.tooltip {
position: absolute;
z-index: 1030;
display: block;
visibility: visible;
font-size: 12px;
line-height: 1.4;
opacity: 0;
filter: alpha(opacity=0);
}
.tooltip.in {
opacity: 0.9;
filter: alpha(opacity=90);
}
.tooltip.top {
margin-top: -3px;
padding: 5px 0;
}
.tooltip.right {
margin-left: 3px;
padding: 0 5px;
}
.tooltip.bottom {
margin-top: 3px;
padding: 5px 0;
}
.tooltip.left {
margin-left: -3px;
padding: 0 5px;
}
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: #ffffff;
text-align: center;
text-decoration: none;
background-color: #000000;
border-radius: 4px;
}
.tooltip-arrow {
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.tooltip.top .tooltip-arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.top-left .tooltip-arrow {
bottom: 0;
left: 5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.top-right .tooltip-arrow {
bottom: 0;
right: 5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.right .tooltip-arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-width: 5px 5px 5px 0;
border-right-color: #000000;
}
.tooltip.left .tooltip-arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-width: 5px 0 5px 5px;
border-left-color: #000000;
}
.tooltip.bottom .tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.tooltip.bottom-left .tooltip-arrow {
top: 0;
left: 5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.tooltip.bottom-right .tooltip-arrow {
top: 0;
right: 5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.popover {
position: absolute;
top: 0;
left: 0;
z-index: 1010;
display: none;
max-width: 276px;
padding: 1px;
text-align: left;
background-color: #ffffff;
background-clip: padding-box;
border: 1px solid #cccccc;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
white-space: normal;
}
.popover.top {
margin-top: -10px;
}
.popover.right {
margin-left: 10px;
}
.popover.bottom {
margin-top: 10px;
}
.popover.left {
margin-left: -10px;
}
.popover-title {
margin: 0;
padding: 8px 14px;
font-size: 14px;
font-weight: normal;
line-height: 18px;
background-color: #f7f7f7;
border-bottom: 1px solid #ebebeb;
border-radius: 5px 5px 0 0;
}
.popover-content {
padding: 9px 14px;
}
.popover .arrow,
.popover .arrow:after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.popover .arrow {
border-width: 11px;
}
.popover .arrow:after {
border-width: 10px;
content: "";
}
.popover.top .arrow {
left: 50%;
margin-left: -11px;
border-bottom-width: 0;
border-top-color: #999999;
border-top-color: rgba(0, 0, 0, 0.25);
bottom: -11px;
}
.popover.top .arrow:after {
content: " ";
bottom: 1px;
margin-left: -10px;
border-bottom-width: 0;
border-top-color: #ffffff;
}
.popover.right .arrow {
top: 50%;
left: -11px;
margin-top: -11px;
border-left-width: 0;
border-right-color: #999999;
border-right-color: rgba(0, 0, 0, 0.25);
}
.popover.right .arrow:after {
content: " ";
left: 1px;
bottom: -10px;
border-left-width: 0;
border-right-color: #ffffff;
}
.popover.bottom .arrow {
left: 50%;
margin-left: -11px;
border-top-width: 0;
border-bottom-color: #999999;
border-bottom-color: rgba(0, 0, 0, 0.25);
top: -11px;
}
.popover.bottom .arrow:after {
content: " ";
top: 1px;
margin-left: -10px;
border-top-width: 0;
border-bottom-color: #ffffff;
}
.popover.left .arrow {
top: 50%;
right: -11px;
margin-top: -11px;
border-right-width: 0;
border-left-color: #999999;
border-left-color: rgba(0, 0, 0, 0.25);
}
.popover.left .arrow:after {
content: " ";
right: 1px;
border-right-width: 0;
border-left-color: #ffffff;
bottom: -10px;
}
.carousel {
position: relative;
}
.carousel-inner {
position: relative;
overflow: hidden;
width: 100%;
}
.carousel-inner > .item {
display: none;
position: relative;
-webkit-transition: 0.6s ease-in-out left;
transition: 0.6s ease-in-out left;
}
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
display: block;
max-width: 100%;
height: auto;
line-height: 1;
}
.carousel-inner > .active,
.carousel-inner > .next,
.carousel-inner > .prev {
display: block;
}
.carousel-inner > .active {
left: 0;
}
.carousel-inner > .next,
.carousel-inner > .prev {
position: absolute;
top: 0;
width: 100%;
}
.carousel-inner > .next {
left: 100%;
}
.carousel-inner > .prev {
left: -100%;
}
.carousel-inner > .next.left,
.carousel-inner > .prev.right {
left: 0;
}
.carousel-inner > .active.left {
left: -100%;
}
.carousel-inner > .active.right {
left: 100%;
}
.carousel-control {
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 15%;
opacity: 0.5;
filter: alpha(opacity=50);
font-size: 20px;
color: #ffffff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.carousel-control.left {
background-image: -webkit-gradient(linear, 0% top, 100% top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.0001)));
background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.5) 0%), color-stop(rgba(0, 0, 0, 0.0001) 100%));
background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
}
.carousel-control.right {
left: auto;
right: 0;
background-image: -webkit-gradient(linear, 0% top, 100% top, from(rgba(0, 0, 0, 0.0001)), to(rgba(0, 0, 0, 0.5)));
background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.0001) 0%), color-stop(rgba(0, 0, 0, 0.5) 100%));
background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
}
.carousel-control:hover,
.carousel-control:focus {
color: #ffffff;
text-decoration: none;
opacity: 0.9;
filter: alpha(opacity=90);
}
.carousel-control .icon-prev,
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-left,
.carousel-control .glyphicon-chevron-right {
position: absolute;
top: 50%;
z-index: 5;
display: inline-block;
}
.carousel-control .icon-prev,
.carousel-control .glyphicon-chevron-left {
left: 50%;
}
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-right {
right: 50%;
}
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 20px;
height: 20px;
margin-top: -10px;
margin-left: -10px;
font-family: serif;
}
.carousel-control .icon-prev:before {
content: '\2039';
}
.carousel-control .icon-next:before {
content: '\203a';
}
.carousel-indicators {
position: absolute;
bottom: 10px;
left: 50%;
z-index: 15;
width: 60%;
margin-left: -30%;
padding-left: 0;
list-style: none;
text-align: center;
}
.carousel-indicators li {
display: inline-block;
width: 10px;
height: 10px;
margin: 1px;
text-indent: -999px;
border: 1px solid #ffffff;
border-radius: 10px;
cursor: pointer;
}
.carousel-indicators .active {
margin: 0;
width: 12px;
height: 12px;
background-color: #ffffff;
}
.carousel-caption {
position: absolute;
left: 15%;
right: 15%;
bottom: 20px;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #ffffff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.carousel-caption .btn {
text-shadow: none;
}
@media screen and (min-width: 768px) {
.carousel-control .glyphicons-chevron-left,
.carousel-control .glyphicons-chevron-right,
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 30px;
height: 30px;
margin-top: -15px;
margin-left: -15px;
font-size: 30px;
}
.carousel-caption {
left: 20%;
right: 20%;
padding-bottom: 30px;
}
.carousel-indicators {
bottom: 20px;
}
}
.clearfix:before,
.clearfix:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.clearfix:after {
clear: both;
}
.center-block {
display: block;
margin-left: auto;
margin-right: auto;
}
.pull-right {
float: right !important;
}
.pull-left {
float: left !important;
}
.hide {
display: none !important;
}
.show {
display: block !important;
}
.invisible {
visibility: hidden;
}
.text-hide {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.hidden {
display: none !important;
visibility: hidden !important;
}
.affix {
position: fixed;
}
@-ms-viewport {
width: device-width;
}
.visible-xs,
tr.visible-xs,
th.visible-xs,
td.visible-xs {
display: none !important;
}
@media (max-width: 767px) {
.visible-xs {
display: block !important;
}
tr.visible-xs {
display: table-row !important;
}
th.visible-xs,
td.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-xs.visible-sm {
display: block !important;
}
tr.visible-xs.visible-sm {
display: table-row !important;
}
th.visible-xs.visible-sm,
td.visible-xs.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-xs.visible-md {
display: block !important;
}
tr.visible-xs.visible-md {
display: table-row !important;
}
th.visible-xs.visible-md,
td.visible-xs.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-xs.visible-lg {
display: block !important;
}
tr.visible-xs.visible-lg {
display: table-row !important;
}
th.visible-xs.visible-lg,
td.visible-xs.visible-lg {
display: table-cell !important;
}
}
.visible-sm,
tr.visible-sm,
th.visible-sm,
td.visible-sm {
display: none !important;
}
@media (max-width: 767px) {
.visible-sm.visible-xs {
display: block !important;
}
tr.visible-sm.visible-xs {
display: table-row !important;
}
th.visible-sm.visible-xs,
td.visible-sm.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm {
display: block !important;
}
tr.visible-sm {
display: table-row !important;
}
th.visible-sm,
td.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-sm.visible-md {
display: block !important;
}
tr.visible-sm.visible-md {
display: table-row !important;
}
th.visible-sm.visible-md,
td.visible-sm.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-sm.visible-lg {
display: block !important;
}
tr.visible-sm.visible-lg {
display: table-row !important;
}
th.visible-sm.visible-lg,
td.visible-sm.visible-lg {
display: table-cell !important;
}
}
.visible-md,
tr.visible-md,
th.visible-md,
td.visible-md {
display: none !important;
}
@media (max-width: 767px) {
.visible-md.visible-xs {
display: block !important;
}
tr.visible-md.visible-xs {
display: table-row !important;
}
th.visible-md.visible-xs,
td.visible-md.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-md.visible-sm {
display: block !important;
}
tr.visible-md.visible-sm {
display: table-row !important;
}
th.visible-md.visible-sm,
td.visible-md.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md {
display: block !important;
}
tr.visible-md {
display: table-row !important;
}
th.visible-md,
td.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-md.visible-lg {
display: block !important;
}
tr.visible-md.visible-lg {
display: table-row !important;
}
th.visible-md.visible-lg,
td.visible-md.visible-lg {
display: table-cell !important;
}
}
.visible-lg,
tr.visible-lg,
th.visible-lg,
td.visible-lg {
display: none !important;
}
@media (max-width: 767px) {
.visible-lg.visible-xs {
display: block !important;
}
tr.visible-lg.visible-xs {
display: table-row !important;
}
th.visible-lg.visible-xs,
td.visible-lg.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-lg.visible-sm {
display: block !important;
}
tr.visible-lg.visible-sm {
display: table-row !important;
}
th.visible-lg.visible-sm,
td.visible-lg.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-lg.visible-md {
display: block !important;
}
tr.visible-lg.visible-md {
display: table-row !important;
}
th.visible-lg.visible-md,
td.visible-lg.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-lg {
display: block !important;
}
tr.visible-lg {
display: table-row !important;
}
th.visible-lg,
td.visible-lg {
display: table-cell !important;
}
}
.hidden-xs {
display: block !important;
}
tr.hidden-xs {
display: table-row !important;
}
th.hidden-xs,
td.hidden-xs {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-xs,
tr.hidden-xs,
th.hidden-xs,
td.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-xs.hidden-sm,
tr.hidden-xs.hidden-sm,
th.hidden-xs.hidden-sm,
td.hidden-xs.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-xs.hidden-md,
tr.hidden-xs.hidden-md,
th.hidden-xs.hidden-md,
td.hidden-xs.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-xs.hidden-lg,
tr.hidden-xs.hidden-lg,
th.hidden-xs.hidden-lg,
td.hidden-xs.hidden-lg {
display: none !important;
}
}
.hidden-sm {
display: block !important;
}
tr.hidden-sm {
display: table-row !important;
}
th.hidden-sm,
td.hidden-sm {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-sm.hidden-xs,
tr.hidden-sm.hidden-xs,
th.hidden-sm.hidden-xs,
td.hidden-sm.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-sm,
tr.hidden-sm,
th.hidden-sm,
td.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-sm.hidden-md,
tr.hidden-sm.hidden-md,
th.hidden-sm.hidden-md,
td.hidden-sm.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-sm.hidden-lg,
tr.hidden-sm.hidden-lg,
th.hidden-sm.hidden-lg,
td.hidden-sm.hidden-lg {
display: none !important;
}
}
.hidden-md {
display: block !important;
}
tr.hidden-md {
display: table-row !important;
}
th.hidden-md,
td.hidden-md {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-md.hidden-xs,
tr.hidden-md.hidden-xs,
th.hidden-md.hidden-xs,
td.hidden-md.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-md.hidden-sm,
tr.hidden-md.hidden-sm,
th.hidden-md.hidden-sm,
td.hidden-md.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-md,
tr.hidden-md,
th.hidden-md,
td.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-md.hidden-lg,
tr.hidden-md.hidden-lg,
th.hidden-md.hidden-lg,
td.hidden-md.hidden-lg {
display: none !important;
}
}
.hidden-lg {
display: block !important;
}
tr.hidden-lg {
display: table-row !important;
}
th.hidden-lg,
td.hidden-lg {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-lg.hidden-xs,
tr.hidden-lg.hidden-xs,
th.hidden-lg.hidden-xs,
td.hidden-lg.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-lg.hidden-sm,
tr.hidden-lg.hidden-sm,
th.hidden-lg.hidden-sm,
td.hidden-lg.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-lg.hidden-md,
tr.hidden-lg.hidden-md,
th.hidden-lg.hidden-md,
td.hidden-lg.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-lg,
tr.hidden-lg,
th.hidden-lg,
td.hidden-lg {
display: none !important;
}
}
.visible-print,
tr.visible-print,
th.visible-print,
td.visible-print {
display: none !important;
}
@media print {
.visible-print {
display: block !important;
}
tr.visible-print {
display: table-row !important;
}
th.visible-print,
td.visible-print {
display: table-cell !important;
}
.hidden-print,
tr.hidden-print,
th.hidden-print,
td.hidden-print {
display: none !important;
}
}
|
saitheexplorer/cdnjs
|
ajax/libs/summernote/0.5.0/summernote-bs3.css
|
CSS
|
mit
| 146,393 |
YUI.add('dataschema-json', function (Y, NAME) {
/**
Provides a DataSchema implementation which can be used to work with JSON data.
@module dataschema
@submodule dataschema-json
**/
/**
Provides a DataSchema implementation which can be used to work with JSON data.
See the `apply` method for usage.
@class DataSchema.JSON
@extends DataSchema.Base
@static
**/
var LANG = Y.Lang,
isFunction = LANG.isFunction,
isObject = LANG.isObject,
isArray = LANG.isArray,
// TODO: I don't think the calls to Base.* need to be done via Base since
// Base is mixed into SchemaJSON. Investigate for later.
Base = Y.DataSchema.Base,
SchemaJSON;
SchemaJSON = {
/////////////////////////////////////////////////////////////////////////////
//
// DataSchema.JSON static methods
//
/////////////////////////////////////////////////////////////////////////////
/**
* Utility function converts JSON locator strings into walkable paths
*
* @method getPath
* @param locator {String} JSON value locator.
* @return {String[]} Walkable path to data value.
* @static
*/
getPath: function(locator) {
var path = null,
keys = [],
i = 0;
if (locator) {
// Strip the ["string keys"] and [1] array indexes
// TODO: the first two steps can probably be reduced to one with
// /\[\s*(['"])?(.*?)\1\s*\]/g, but the array indices would be
// stored as strings. This is not likely an issue.
locator = locator.
replace(/\[\s*(['"])(.*?)\1\s*\]/g,
function (x,$1,$2) {keys[i]=$2;return '.@'+(i++);}).
replace(/\[(\d+)\]/g,
function (x,$1) {keys[i]=parseInt($1,10)|0;return '.@'+(i++);}).
replace(/^\./,''); // remove leading dot
// Validate against problematic characters.
// commented out because the path isn't sent to eval, so it
// should be safe. I'm not sure what makes a locator invalid.
//if (!/[^\w\.\$@]/.test(locator)) {
path = locator.split('.');
for (i=path.length-1; i >= 0; --i) {
if (path[i].charAt(0) === '@') {
path[i] = keys[parseInt(path[i].substr(1),10)];
}
}
/*}
else {
}
*/
}
return path;
},
/**
* Utility function to walk a path and return the value located there.
*
* @method getLocationValue
* @param path {String[]} Locator path.
* @param data {String} Data to traverse.
* @return {Object} Data value at location.
* @static
*/
getLocationValue: function (path, data) {
var i = 0,
len = path.length;
for (;i<len;i++) {
if (isObject(data) && (path[i] in data)) {
data = data[path[i]];
} else {
data = undefined;
break;
}
}
return data;
},
/**
Applies a schema to an array of data located in a JSON structure, returning
a normalized object with results in the `results` property. Additional
information can be parsed out of the JSON for inclusion in the `meta`
property of the response object. If an error is encountered during
processing, an `error` property will be added.
The input _data_ is expected to be an object or array. If it is a string,
it will be passed through `Y.JSON.parse()`.
If _data_ contains an array of data records to normalize, specify the
_schema.resultListLocator_ as a dot separated path string just as you would
reference it in JavaScript. So if your _data_ object has a record array at
_data.response.results_, use _schema.resultListLocator_ =
"response.results". Bracket notation can also be used for array indices or
object properties (e.g. "response['results']"); This is called a "path
locator"
Field data in the result list is extracted with field identifiers in
_schema.resultFields_. Field identifiers are objects with the following
properties:
* `key` : <strong>(required)</strong> The path locator (String)
* `parser`: A function or the name of a function on `Y.Parsers` used
to convert the input value into a normalized type. Parser
functions are passed the value as input and are expected to
return a value.
If no value parsing is needed, you can use path locators (strings)
instead of field identifiers (objects) -- see example below.
If no processing of the result list array is needed, _schema.resultFields_
can be omitted; the `response.results` will point directly to the array.
If the result list contains arrays, `response.results` will contain an
array of objects with key:value pairs assuming the fields in
_schema.resultFields_ are ordered in accordance with the data array
values.
If the result list contains objects, the identified _schema.resultFields_
will be used to extract a value from those objects for the output result.
To extract additional information from the JSON, include an array of
path locators in _schema.metaFields_. The collected values will be
stored in `response.meta`.
@example
// Process array of arrays
var schema = {
resultListLocator: 'produce.fruit',
resultFields: [ 'name', 'color' ]
},
data = {
produce: {
fruit: [
[ 'Banana', 'yellow' ],
[ 'Orange', 'orange' ],
[ 'Eggplant', 'purple' ]
]
}
};
var response = Y.DataSchema.JSON.apply(schema, data);
// response.results[0] is { name: "Banana", color: "yellow" }
// Process array of objects + some metadata
schema.metaFields = [ 'lastInventory' ];
data = {
produce: {
fruit: [
{ name: 'Banana', color: 'yellow', price: '1.96' },
{ name: 'Orange', color: 'orange', price: '2.04' },
{ name: 'Eggplant', color: 'purple', price: '4.31' }
]
},
lastInventory: '2011-07-19'
};
response = Y.DataSchema.JSON.apply(schema, data);
// response.results[0] is { name: "Banana", color: "yellow" }
// response.meta.lastInventory is '2001-07-19'
// Use parsers
schema.resultFields = [
{
key: 'name',
parser: function (val) { return val.toUpperCase(); }
},
{
key: 'price',
parser: 'number' // Uses Y.Parsers.number
}
];
response = Y.DataSchema.JSON.apply(schema, data);
// Note price was converted from a numeric string to a number
// response.results[0] looks like { fruit: "BANANA", price: 1.96 }
@method apply
@param {Object} [schema] Schema to apply. Supported configuration
properties are:
@param {String} [schema.resultListLocator] Path locator for the
location of the array of records to flatten into `response.results`
@param {Array} [schema.resultFields] Field identifiers to
locate/assign values in the response records. See above for
details.
@param {Array} [schema.metaFields] Path locators to extract extra
non-record related information from the data object.
@param {Object|Array|String} data JSON data or its string serialization.
@return {Object} An Object with properties `results` and `meta`
@static
**/
apply: function(schema, data) {
var data_in = data,
data_out = { results: [], meta: {} };
// Convert incoming JSON strings
if (!isObject(data)) {
try {
data_in = Y.JSON.parse(data);
}
catch(e) {
data_out.error = e;
return data_out;
}
}
if (isObject(data_in) && schema) {
// Parse results data
data_out = SchemaJSON._parseResults.call(this, schema, data_in, data_out);
// Parse meta data
if (schema.metaFields !== undefined) {
data_out = SchemaJSON._parseMeta(schema.metaFields, data_in, data_out);
}
}
else {
data_out.error = new Error("JSON schema parse failure");
}
return data_out;
},
/**
* Schema-parsed list of results from full data
*
* @method _parseResults
* @param schema {Object} Schema to parse against.
* @param json_in {Object} JSON to parse.
* @param data_out {Object} In-progress parsed data to update.
* @return {Object} Parsed data object.
* @static
* @protected
*/
_parseResults: function(schema, json_in, data_out) {
var getPath = SchemaJSON.getPath,
getValue = SchemaJSON.getLocationValue,
path = getPath(schema.resultListLocator),
results = path ?
(getValue(path, json_in) ||
// Fall back to treat resultListLocator as a simple key
json_in[schema.resultListLocator]) :
// Or if no resultListLocator is supplied, use the input
json_in;
if (isArray(results)) {
// if no result fields are passed in, then just take
// the results array whole-hog Sometimes you're getting
// an array of strings, or want the whole object, so
// resultFields don't make sense.
if (isArray(schema.resultFields)) {
data_out = SchemaJSON._getFieldValues.call(this, schema.resultFields, results, data_out);
} else {
data_out.results = results;
}
} else if (schema.resultListLocator) {
data_out.results = [];
data_out.error = new Error("JSON results retrieval failure");
}
return data_out;
},
/**
* Get field data values out of list of full results
*
* @method _getFieldValues
* @param fields {Array} Fields to find.
* @param array_in {Array} Results to parse.
* @param data_out {Object} In-progress parsed data to update.
* @return {Object} Parsed data object.
* @static
* @protected
*/
_getFieldValues: function(fields, array_in, data_out) {
var results = [],
len = fields.length,
i, j,
field, key, locator, path, parser, val,
simplePaths = [], complexPaths = [], fieldParsers = [],
result, record;
// First collect hashes of simple paths, complex paths, and parsers
for (i=0; i<len; i++) {
field = fields[i]; // A field can be a simple string or a hash
key = field.key || field; // Find the key
locator = field.locator || key; // Find the locator
// Validate and store locators for later
path = SchemaJSON.getPath(locator);
if (path) {
if (path.length === 1) {
simplePaths.push({
key : key,
path: path[0]
});
} else {
complexPaths.push({
key : key,
path : path,
locator: locator
});
}
} else {
}
// Validate and store parsers for later
//TODO: use Y.DataSchema.parse?
parser = (isFunction(field.parser)) ?
field.parser :
Y.Parsers[field.parser + ''];
if (parser) {
fieldParsers.push({
key : key,
parser: parser
});
}
}
// Traverse list of array_in, creating records of simple fields,
// complex fields, and applying parsers as necessary
for (i=array_in.length-1; i>=0; --i) {
record = {};
result = array_in[i];
if(result) {
// Cycle through complexLocators
for (j=complexPaths.length - 1; j>=0; --j) {
path = complexPaths[j];
val = SchemaJSON.getLocationValue(path.path, result);
if (val === undefined) {
val = SchemaJSON.getLocationValue([path.locator], result);
// Fail over keys like "foo.bar" from nested parsing
// to single token parsing if a value is found in
// results["foo.bar"]
if (val !== undefined) {
simplePaths.push({
key: path.key,
path: path.locator
});
// Don't try to process the path as complex
// for further results
complexPaths.splice(i,1);
continue;
}
}
record[path.key] = Base.parse.call(this,
(SchemaJSON.getLocationValue(path.path, result)), path);
}
// Cycle through simpleLocators
for (j = simplePaths.length - 1; j >= 0; --j) {
path = simplePaths[j];
// Bug 1777850: The result might be an array instead of object
record[path.key] = Base.parse.call(this,
((result[path.path] === undefined) ?
result[j] : result[path.path]), path);
}
// Cycle through fieldParsers
for (j=fieldParsers.length-1; j>=0; --j) {
key = fieldParsers[j].key;
record[key] = fieldParsers[j].parser.call(this, record[key]);
// Safety net
if (record[key] === undefined) {
record[key] = null;
}
}
results[i] = record;
}
}
data_out.results = results;
return data_out;
},
/**
* Parses results data according to schema
*
* @method _parseMeta
* @param metaFields {Object} Metafields definitions.
* @param json_in {Object} JSON to parse.
* @param data_out {Object} In-progress parsed data to update.
* @return {Object} Schema-parsed meta data.
* @static
* @protected
*/
_parseMeta: function(metaFields, json_in, data_out) {
if (isObject(metaFields)) {
var key, path;
for(key in metaFields) {
if (metaFields.hasOwnProperty(key)) {
path = SchemaJSON.getPath(metaFields[key]);
if (path && json_in) {
data_out.meta[key] = SchemaJSON.getLocationValue(path, json_in);
}
}
}
}
else {
data_out.error = new Error("JSON meta data retrieval failure");
}
return data_out;
}
};
// TODO: Y.Object + mix() might be better here
Y.DataSchema.JSON = Y.mix(SchemaJSON, Base);
}, '@VERSION@', {"requires": ["dataschema-base", "json"]});
|
seogi1004/cdnjs
|
ajax/libs/yui/3.7.0/dataschema-json/dataschema-json.js
|
JavaScript
|
mit
| 15,837 |
YUI.add('text-wordbreak', function (Y, NAME) {
/**
* Provides utility methods for splitting strings on word breaks and determining
* whether a character index represents a word boundary.
*
* @module text
* @submodule text-wordbreak
*/
/**
* <p>
* Provides utility methods for splitting strings on word breaks and determining
* whether a character index represents a word boundary, using the generic word
* breaking algorithm defined in the Unicode Text Segmentation guidelines
* (<a href="http://unicode.org/reports/tr29/#Word_Boundaries">Unicode Standard
* Annex #29</a>).
* </p>
*
* <p>
* This algorithm provides a reasonable default for many languages. However, it
* does not cover language or context specific requirements, and it does not
* provide meaningful results at all for languages that don't use spaces between
* words, such as Chinese, Japanese, Thai, Lao, Khmer, and others. Server-based
* word breaking services usually provide significantly better results with
* better performance.
* </p>
*
* @class Text.WordBreak
* @static
*/
var Text = Y.Text,
WBData = Text.Data.WordBreak,
// Constants representing code point classifications.
ALETTER = 0,
MIDNUMLET = 1,
MIDLETTER = 2,
MIDNUM = 3,
NUMERIC = 4,
CR = 5,
LF = 6,
NEWLINE = 7,
EXTEND = 8,
FORMAT = 9,
KATAKANA = 10,
EXTENDNUMLET = 11,
OTHER = 12,
// RegExp objects generated from code point data. Each regex matches a single
// character against a set of Unicode code points. The index of each item in
// this array must match its corresponding code point constant value defined
// above.
SETS = [
new RegExp(WBData.aletter),
new RegExp(WBData.midnumlet),
new RegExp(WBData.midletter),
new RegExp(WBData.midnum),
new RegExp(WBData.numeric),
new RegExp(WBData.cr),
new RegExp(WBData.lf),
new RegExp(WBData.newline),
new RegExp(WBData.extend),
new RegExp(WBData.format),
new RegExp(WBData.katakana),
new RegExp(WBData.extendnumlet)
],
EMPTY_STRING = '',
PUNCTUATION = new RegExp('^' + WBData.punctuation + '$'),
WHITESPACE = /\s/,
WordBreak = {
// -- Public Static Methods ------------------------------------------------
/**
* Splits the specified string into an array of individual words.
*
* @method getWords
* @param {String} string String to split.
* @param {Object} options (optional) Options object containing zero or more
* of the following properties:
*
* <dl>
* <dt>ignoreCase (Boolean)</dt>
* <dd>
* If <code>true</code>, the string will be converted to lowercase
* before being split. Default is <code>false</code>.
* </dd>
*
* <dt>includePunctuation (Boolean)</dt>
* <dd>
* If <code>true</code>, the returned array will include punctuation
* characters. Default is <code>false</code>.
* </dd>
*
* <dt>includeWhitespace (Boolean)</dt>
* <dd>
* If <code>true</code>, the returned array will include whitespace
* characters. Default is <code>false</code>.
* </dd>
* </dl>
* @return {Array} Array of words.
* @static
*/
getWords: function (string, options) {
var i = 0,
map = WordBreak._classify(string),
len = map.length,
word = [],
words = [],
chr,
includePunctuation,
includeWhitespace;
if (!options) {
options = {};
}
if (options.ignoreCase) {
string = string.toLowerCase();
}
includePunctuation = options.includePunctuation;
includeWhitespace = options.includeWhitespace;
// Loop through each character in the classification map and determine
// whether it precedes a word boundary, building an array of distinct
// words as we go.
for (; i < len; ++i) {
chr = string.charAt(i);
// Append this character to the current word.
word.push(chr);
// If there's a word boundary between the current character and the
// next character, append the current word to the words array and
// start building a new word.
if (WordBreak._isWordBoundary(map, i)) {
word = word.join(EMPTY_STRING);
if (word &&
(includeWhitespace || !WHITESPACE.test(word)) &&
(includePunctuation || !PUNCTUATION.test(word))) {
words.push(word);
}
word = [];
}
}
return words;
},
/**
* Returns an array containing only unique words from the specified string.
* For example, the string <code>'foo bar baz foo'</code> would result in
* the array <code>['foo', 'bar', 'baz']</code>.
*
* @method getUniqueWords
* @param {String} string String to split.
* @param {Object} options (optional) Options (see <code>getWords()</code>
* for details).
* @return {Array} Array of unique words.
* @static
*/
getUniqueWords: function (string, options) {
return Y.Array.unique(WordBreak.getWords(string, options));
},
/**
* <p>
* Returns <code>true</code> if there is a word boundary between the
* specified character index and the next character index (or the end of the
* string).
* </p>
*
* <p>
* Note that there are always word breaks at the beginning and end of a
* string, so <code>isWordBoundary('', 0)</code> and
* <code>isWordBoundary('a', 0)</code> will both return <code>true</code>.
* </p>
*
* @method isWordBoundary
* @param {String} string String to test.
* @param {Number} index Character index to test within the string.
* @return {Boolean} <code>true</code> for a word boundary,
* <code>false</code> otherwise.
* @static
*/
isWordBoundary: function (string, index) {
return WordBreak._isWordBoundary(WordBreak._classify(string), index);
},
// -- Protected Static Methods ---------------------------------------------
/**
* Returns a character classification map for the specified string.
*
* @method _classify
* @param {String} string String to classify.
* @return {Array} Classification map.
* @protected
* @static
*/
_classify: function (string) {
var chr,
map = [],
i = 0,
j,
set,
stringLength = string.length,
setsLength = SETS.length,
type;
for (; i < stringLength; ++i) {
chr = string.charAt(i);
type = OTHER;
for (j = 0; j < setsLength; ++j) {
set = SETS[j];
if (set && set.test(chr)) {
type = j;
break;
}
}
map.push(type);
}
return map;
},
/**
* <p>
* Returns <code>true</code> if there is a word boundary between the
* specified character index and the next character index (or the end of the
* string).
* </p>
*
* <p>
* Note that there are always word breaks at the beginning and end of a
* string, so <code>_isWordBoundary('', 0)</code> and
* <code>_isWordBoundary('a', 0)</code> will both return <code>true</code>.
* </p>
*
* @method _isWordBoundary
* @param {Array} map Character classification map generated by
* <code>_classify</code>.
* @param {Number} index Character index to test.
* @return {Boolean}
* @protected
* @static
*/
_isWordBoundary: function (map, index) {
var prevType,
type = map[index],
nextType = map[index + 1],
nextNextType;
if (index < 0 || (index > map.length - 1 && index !== 0)) {
return false;
}
// WB5. Don't break between most letters.
if (type === ALETTER && nextType === ALETTER) {
return false;
}
nextNextType = map[index + 2];
// WB6. Don't break letters across certain punctuation.
if (type === ALETTER &&
(nextType === MIDLETTER || nextType === MIDNUMLET) &&
nextNextType === ALETTER) {
return false;
}
prevType = map[index - 1];
// WB7. Don't break letters across certain punctuation.
if ((type === MIDLETTER || type === MIDNUMLET) &&
nextType === ALETTER &&
prevType === ALETTER) {
return false;
}
// WB8/WB9/WB10. Don't break inside sequences of digits or digits
// adjacent to letters.
if ((type === NUMERIC || type === ALETTER) &&
(nextType === NUMERIC || nextType === ALETTER)) {
return false;
}
// WB11. Don't break inside numeric sequences like "3.2" or
// "3,456.789".
if ((type === MIDNUM || type === MIDNUMLET) &&
nextType === NUMERIC &&
prevType === NUMERIC) {
return false;
}
// WB12. Don't break inside numeric sequences like "3.2" or
// "3,456.789".
if (type === NUMERIC &&
(nextType === MIDNUM || nextType === MIDNUMLET) &&
nextNextType === NUMERIC) {
return false;
}
// WB4. Ignore format and extend characters.
if (type === EXTEND || type === FORMAT ||
prevType === EXTEND || prevType === FORMAT ||
nextType === EXTEND || nextType === FORMAT) {
return false;
}
// WB3. Don't break inside CRLF.
if (type === CR && nextType === LF) {
return false;
}
// WB3a. Break before newlines (including CR and LF).
if (type === NEWLINE || type === CR || type === LF) {
return true;
}
// WB3b. Break after newlines (including CR and LF).
if (nextType === NEWLINE || nextType === CR || nextType === LF) {
return true;
}
// WB13. Don't break between Katakana characters.
if (type === KATAKANA && nextType === KATAKANA) {
return false;
}
// WB13a. Don't break from extenders.
if (nextType === EXTENDNUMLET &&
(type === ALETTER || type === NUMERIC || type === KATAKANA ||
type === EXTENDNUMLET)) {
return false;
}
// WB13b. Don't break from extenders.
if (type === EXTENDNUMLET &&
(nextType === ALETTER || nextType === NUMERIC ||
nextType === KATAKANA)) {
return false;
}
// Break after any character not covered by the rules above.
return true;
}
};
Text.WordBreak = WordBreak;
}, '@VERSION@', {"requires": ["array-extras", "text-data-wordbreak"]});
|
kiwi89/cdnjs
|
ajax/libs/yui/3.9.0/text-wordbreak/text-wordbreak.js
|
JavaScript
|
mit
| 11,191 |
YUI.add('datasource-function', function (Y, NAME) {
/**
* Provides a DataSource implementation which can be used to retrieve data from
* a custom function.
*
* @module datasource
* @submodule datasource-function
*/
/**
* Function subclass for the DataSource Utility.
* @class DataSource.Function
* @extends DataSource.Local
* @constructor
*/
var LANG = Y.Lang,
DSFn = function() {
DSFn.superclass.constructor.apply(this, arguments);
};
/////////////////////////////////////////////////////////////////////////////
//
// DataSource.Function static properties
//
/////////////////////////////////////////////////////////////////////////////
Y.mix(DSFn, {
/**
* Class name.
*
* @property NAME
* @type String
* @static
* @final
* @value "dataSourceFunction"
*/
NAME: "dataSourceFunction",
/////////////////////////////////////////////////////////////////////////////
//
// DataSource.Function Attributes
//
/////////////////////////////////////////////////////////////////////////////
ATTRS: {
/**
* Stores the function that will serve the response data.
*
* @attribute source
* @type {Any}
* @default null
*/
source: {
validator: LANG.isFunction
}
}
});
Y.extend(DSFn, Y.DataSource.Local, {
/**
* Passes query data to the source function. Fires <code>response</code>
* event with the function results (synchronously).
*
* @method _defRequestFn
* @param e {Event.Facade} Event Facade with the following properties:
* <dl>
* <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>
* <dt>request (Object)</dt> <dd>The request.</dd>
* <dt>callback (Object)</dt> <dd>The callback object with the following
* properties:
* <dl>
* <dt>success (Function)</dt> <dd>Success handler.</dd>
* <dt>failure (Function)</dt> <dd>Failure handler.</dd>
* </dl>
* </dd>
* <dt>cfg (Object)</dt> <dd>Configuration object.</dd>
* </dl>
* @protected
*/
_defRequestFn: function(e) {
var fn = this.get("source"),
payload = e.details[0];
if (fn) {
try {
payload.data = fn(e.request, this, e);
} catch (ex) {
Y.log("Function execution failure", "error", "datasource-function");
payload.error = ex;
}
} else {
Y.log("Function data failure", "error", "datasource-function");
payload.error = new Error("Function data failure");
}
this.fire("data", payload);
return e.tId;
}
});
Y.DataSource.Function = DSFn;
}, '@VERSION@', {"requires": ["datasource-local"]});
|
Nadeermalangadan/cdnjs
|
ajax/libs/yui/3.10.1/datasource-function/datasource-function-debug.js
|
JavaScript
|
mit
| 2,889 |
YUI.add('datasource-function', function (Y, NAME) {
/**
* Provides a DataSource implementation which can be used to retrieve data from
* a custom function.
*
* @module datasource
* @submodule datasource-function
*/
/**
* Function subclass for the DataSource Utility.
* @class DataSource.Function
* @extends DataSource.Local
* @constructor
*/
var LANG = Y.Lang,
DSFn = function() {
DSFn.superclass.constructor.apply(this, arguments);
};
/////////////////////////////////////////////////////////////////////////////
//
// DataSource.Function static properties
//
/////////////////////////////////////////////////////////////////////////////
Y.mix(DSFn, {
/**
* Class name.
*
* @property NAME
* @type String
* @static
* @final
* @value "dataSourceFunction"
*/
NAME: "dataSourceFunction",
/////////////////////////////////////////////////////////////////////////////
//
// DataSource.Function Attributes
//
/////////////////////////////////////////////////////////////////////////////
ATTRS: {
/**
* Stores the function that will serve the response data.
*
* @attribute source
* @type {Any}
* @default null
*/
source: {
validator: LANG.isFunction
}
}
});
Y.extend(DSFn, Y.DataSource.Local, {
/**
* Passes query data to the source function. Fires <code>response</code>
* event with the function results (synchronously).
*
* @method _defRequestFn
* @param e {Event.Facade} Event Facade with the following properties:
* <dl>
* <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>
* <dt>request (Object)</dt> <dd>The request.</dd>
* <dt>callback (Object)</dt> <dd>The callback object with the following
* properties:
* <dl>
* <dt>success (Function)</dt> <dd>Success handler.</dd>
* <dt>failure (Function)</dt> <dd>Failure handler.</dd>
* </dl>
* </dd>
* <dt>cfg (Object)</dt> <dd>Configuration object.</dd>
* </dl>
* @protected
*/
_defRequestFn: function(e) {
var fn = this.get("source"),
payload = e.details[0];
if (fn) {
try {
payload.data = fn(e.request, this, e);
} catch (ex) {
Y.log("Function execution failure", "error", "datasource-function");
payload.error = ex;
}
} else {
Y.log("Function data failure", "error", "datasource-function");
payload.error = new Error("Function data failure");
}
this.fire("data", payload);
return e.tId;
}
});
Y.DataSource.Function = DSFn;
}, '@VERSION@', {"requires": ["datasource-local"]});
|
ErikSchierboom/cdnjs
|
ajax/libs/yui/3.7.1/datasource-function/datasource-function-debug.js
|
JavaScript
|
mit
| 2,889 |
YUI.add('dataschema-text', function (Y, NAME) {
/**
* Provides a DataSchema implementation which can be used to work with
* delimited text data.
*
* @module dataschema
* @submodule dataschema-text
*/
/**
Provides a DataSchema implementation which can be used to work with
delimited text data.
See the `apply` method for usage.
@class DataSchema.Text
@extends DataSchema.Base
@static
**/
var Lang = Y.Lang,
isString = Lang.isString,
isUndef = Lang.isUndefined,
SchemaText = {
////////////////////////////////////////////////////////////////////////
//
// DataSchema.Text static methods
//
////////////////////////////////////////////////////////////////////////
/**
Applies a schema to a string of delimited data, returning a normalized
object with results in the `results` property. The `meta` property of
the response object is present for consistency, but is assigned an
empty object. If the input data is absent or not a string, an `error`
property will be added.
Use _schema.resultDelimiter_ and _schema.fieldDelimiter_ to instruct
`apply` how to split up the string into an array of data arrays for
processing.
Use _schema.resultFields_ to specify the keys in the generated result
objects in `response.results`. The key:value pairs will be assigned
in the order of the _schema.resultFields_ array, assuming the values
in the data records are defined in the same order.
_schema.resultFields_ field identifiers are objects with the following
properties:
* `key` : <strong>(required)</strong> The property name you want
the data value assigned to in the result object (String)
* `parser`: A function or the name of a function on `Y.Parsers` used
to convert the input value into a normalized type. Parser
functions are passed the value as input and are expected to
return a value.
If no value parsing is needed, you can use just the desired property
name string as the field identifier instead of an object (see example
below).
@example
// Process simple csv
var schema = {
resultDelimiter: "\n",
fieldDelimiter: ",",
resultFields: [ 'fruit', 'color' ]
},
data = "Banana,yellow\nOrange,orange\nEggplant,purple";
var response = Y.DataSchema.Text.apply(schema, data);
// response.results[0] is { fruit: "Banana", color: "yellow" }
// Use parsers
schema.resultFields = [
{
key: 'fruit',
parser: function (val) { return val.toUpperCase(); }
},
'color' // mix and match objects and strings
];
response = Y.DataSchema.Text.apply(schema, data);
// response.results[0] is { fruit: "BANANA", color: "yellow" }
@method apply
@param {Object} schema Schema to apply. Supported configuration
properties are:
@param {String} schema.resultDelimiter Character or character
sequence that marks the end of one record and the start of
another.
@param {String} [schema.fieldDelimiter] Character or character
sequence that marks the end of a field and the start of
another within the same record.
@param {Array} [schema.resultFields] Field identifiers to
assign values in the response records. See above for details.
@param {String} data Text data.
@return {Object} An Object with properties `results` and `meta`
@static
**/
apply: function(schema, data) {
var data_in = data,
data_out = { results: [], meta: {} };
if (isString(data) && schema && isString(schema.resultDelimiter)) {
// Parse results data
data_out = SchemaText._parseResults.call(this, schema, data_in, data_out);
} else {
data_out.error = new Error("Text schema parse failure");
}
return data_out;
},
/**
* Schema-parsed list of results from full data
*
* @method _parseResults
* @param schema {Array} Schema to parse against.
* @param text_in {String} Text to parse.
* @param data_out {Object} In-progress parsed data to update.
* @return {Object} Parsed data object.
* @static
* @protected
*/
_parseResults: function(schema, text_in, data_out) {
var resultDelim = schema.resultDelimiter,
fieldDelim = isString(schema.fieldDelimiter) &&
schema.fieldDelimiter,
fields = schema.resultFields || [],
results = [],
parse = Y.DataSchema.Base.parse,
results_in, fields_in, result, item,
field, key, value, i, j;
// Delete final delimiter at end of string if there
if (text_in.slice(-resultDelim.length) === resultDelim) {
text_in = text_in.slice(0, -resultDelim.length);
}
// Split into results
results_in = text_in.split(schema.resultDelimiter);
if (fieldDelim) {
for (i = results_in.length - 1; i >= 0; --i) {
result = {};
item = results_in[i];
fields_in = item.split(schema.fieldDelimiter);
for (j = fields.length - 1; j >= 0; --j) {
field = fields[j];
key = (!isUndef(field.key)) ? field.key : field;
// FIXME: unless the key is an array index, this test
// for fields_in[key] is useless.
value = (!isUndef(fields_in[key])) ?
fields_in[key] :
fields_in[j];
result[key] = parse.call(this, value, field);
}
results[i] = result;
}
} else {
results = results_in;
}
data_out.results = results;
return data_out;
}
};
Y.DataSchema.Text = Y.mix(SchemaText, Y.DataSchema.Base);
}, '@VERSION@', {"requires": ["dataschema-base"]});
|
hnakamur/cdnjs
|
ajax/libs/yui/3.7.1/dataschema-text/dataschema-text.js
|
JavaScript
|
mit
| 6,692 |
YUI.add('pluginhost-base', function (Y, NAME) {
/**
* Provides the augmentable PluginHost interface, which can be added to any class.
* @module pluginhost
*/
/**
* Provides the augmentable PluginHost interface, which can be added to any class.
* @module pluginhost-base
*/
/**
* <p>
* An augmentable class, which provides the augmented class with the ability to host plugins.
* It adds <a href="#method_plug">plug</a> and <a href="#method_unplug">unplug</a> methods to the augmented class, which can
* be used to add or remove plugins from instances of the class.
* </p>
*
* <p>Plugins can also be added through the constructor configuration object passed to the host class' constructor using
* the "plugins" property. Supported values for the "plugins" property are those defined by the <a href="#method_plug">plug</a> method.
*
* For example the following code would add the AnimPlugin and IOPlugin to Overlay (the plugin host):
* <xmp>
* var o = new Overlay({plugins: [ AnimPlugin, {fn:IOPlugin, cfg:{section:"header"}}]});
* </xmp>
* </p>
* <p>
* Plug.Host's protected <a href="#method_initPlugins">_initPlugins</a> and <a href="#method_destroyPlugins">_destroyPlugins</a>
* methods should be invoked by the host class at the appropriate point in the host's lifecyle.
* </p>
*
* @class Plugin.Host
*/
var L = Y.Lang;
function PluginHost() {
this._plugins = {};
}
PluginHost.prototype = {
/**
* Adds a plugin to the host object. This will instantiate the
* plugin and attach it to the configured namespace on the host object.
*
* @method plug
* @chainable
* @param P {Function | Object |Array} Accepts the plugin class, or an
* object with a "fn" property specifying the plugin class and
* a "cfg" property specifying the configuration for the Plugin.
* <p>
* Additionally an Array can also be passed in, with the above function or
* object values, allowing the user to add multiple plugins in a single call.
* </p>
* @param config (Optional) If the first argument is the plugin class, the second argument
* can be the configuration for the plugin.
* @return {Base} A reference to the host object
*/
plug: function(Plugin, config) {
var i, ln, ns;
if (L.isArray(Plugin)) {
for (i = 0, ln = Plugin.length; i < ln; i++) {
this.plug(Plugin[i]);
}
} else {
if (Plugin && !L.isFunction(Plugin)) {
config = Plugin.cfg;
Plugin = Plugin.fn;
}
// Plugin should be fn by now
if (Plugin && Plugin.NS) {
ns = Plugin.NS;
config = config || {};
config.host = this;
if (this.hasPlugin(ns)) {
// Update config
if (this[ns].setAttrs) {
this[ns].setAttrs(config);
}
else { Y.log("Attempt to replug an already attached plugin, and we can't setAttrs, because it's not Attribute based: " + ns); }
} else {
// Create new instance
this[ns] = new Plugin(config);
this._plugins[ns] = Plugin;
}
}
else { Y.log("Attempt to plug in an invalid plugin. Host:" + this + ", Plugin:" + Plugin); }
}
return this;
},
/**
* Removes a plugin from the host object. This will destroy the
* plugin instance and delete the namespace from the host object.
*
* @method unplug
* @param {String | Function} plugin The namespace of the plugin, or the plugin class with the static NS namespace property defined. If not provided,
* all registered plugins are unplugged.
* @return {Base} A reference to the host object
* @chainable
*/
unplug: function(plugin) {
var ns = plugin,
plugins = this._plugins;
if (plugin) {
if (L.isFunction(plugin)) {
ns = plugin.NS;
if (ns && (!plugins[ns] || plugins[ns] !== plugin)) {
ns = null;
}
}
if (ns) {
if (this[ns]) {
if (this[ns].destroy) {
this[ns].destroy();
}
delete this[ns];
}
if (plugins[ns]) {
delete plugins[ns];
}
}
} else {
for (ns in this._plugins) {
if (this._plugins.hasOwnProperty(ns)) {
this.unplug(ns);
}
}
}
return this;
},
/**
* Determines if a plugin has plugged into this host.
*
* @method hasPlugin
* @param {String} ns The plugin's namespace
* @return {Plugin} Returns a truthy value (the plugin instance) if present, or undefined if not.
*/
hasPlugin : function(ns) {
return (this._plugins[ns] && this[ns]);
},
/**
* Initializes static plugins registered on the host (using the
* Base.plug static method) and any plugins passed to the
* instance through the "plugins" configuration property.
*
* @method _initPlugins
* @param {Config} config The configuration object with property name/value pairs.
* @private
*/
_initPlugins: function(config) {
this._plugins = this._plugins || {};
if (this._initConfigPlugins) {
this._initConfigPlugins(config);
}
},
/**
* Unplugs and destroys all plugins on the host
* @method _destroyPlugins
* @private
*/
_destroyPlugins: function() {
this.unplug();
}
};
Y.namespace("Plugin").Host = PluginHost;
}, '@VERSION@', {"requires": ["yui-base"]});
|
Teino1978-Corp/Teino1978-Corp-cdnjs
|
ajax/libs/yui/3.8.1/pluginhost-base/pluginhost-base-debug.js
|
JavaScript
|
mit
| 6,626 |
YUI.add('swfdetect', function (Y, NAME) {
/**
* Utility for Flash version detection
* @module swfdetect
*/
// Shortcuts and helper methods
var version = 0,
uA = Y.UA,
lG = Y.Lang,
sF = "ShockwaveFlash",
mF, eP, vS, ax6, ax;
function makeInt(n) {
return parseInt(n, 10);
}
function parseFlashVersion (flashVer) {
if (lG.isNumber(makeInt(flashVer[0]))) {
uA.flashMajor = flashVer[0];
}
if (lG.isNumber(makeInt(flashVer[1]))) {
uA.flashMinor = flashVer[1];
}
if (lG.isNumber(makeInt(flashVer[2]))) {
uA.flashRev = flashVer[2];
}
}
if (uA.gecko || uA.webkit || uA.opera) {
if ((mF = navigator.mimeTypes['application/x-shockwave-flash'])) {
if ((eP = mF.enabledPlugin)) {
vS = eP.description.replace(/\s[rd]/g, '.').replace(/[A-Za-z\s]+/g, '').split('.');
Y.log(vS[0]);
parseFlashVersion(vS);
}
}
}
else if(uA.ie) {
try
{
ax6 = new ActiveXObject(sF + "." + sF + ".6");
ax6.AllowScriptAccess = "always";
}
catch (e)
{
if(ax6 !== null)
{
version = 6.0;
}
}
if (version === 0) {
try
{
ax = new ActiveXObject(sF + "." + sF);
vS = ax.GetVariable("$version").replace(/[A-Za-z\s]+/g, '').split(',');
parseFlashVersion(vS);
} catch (e2) {}
}
}
/** Create a calendar view to represent a single or multiple
* month range of dates, rendered as a grid with date and
* weekday labels.
*
* @class SWFDetect
* @constructor
*/
Y.SWFDetect = {
/**
* Returns the version of either the Flash Player plugin (in Mozilla/WebKit/Opera browsers),
* or the Flash Player ActiveX control (in IE), as a String of the form "MM.mm.rr", where
* MM is the major version, mm is the minor version, and rr is the revision.
* @method getFlashVersion
*/
getFlashVersion : function () {
return (String(uA.flashMajor) + "." + String(uA.flashMinor) + "." + String(uA.flashRev));
},
/**
* Checks whether the version of the Flash player installed on the user's machine is greater
* than or equal to the one specified. If it is, this method returns true; it is false otherwise.
* @method isFlashVersionAtLeast
* @return {Boolean} Whether the Flash player version is greater than or equal to the one specified.
* @param flashMajor {int} The Major version of the Flash player to compare against.
* @param flashMinor {int} The Minor version of the Flash player to compare against.
* @param flashRev {int} The Revision version of the Flash player to compare against.
*/
isFlashVersionAtLeast : function (flashMajor, flashMinor, flashRev) {
var uaMajor = makeInt(uA.flashMajor),
uaMinor = makeInt(uA.flashMinor),
uaRev = makeInt(uA.flashRev);
flashMajor = makeInt(flashMajor || 0);
flashMinor = makeInt(flashMinor || 0);
flashRev = makeInt(flashRev || 0);
if (flashMajor === uaMajor) {
if (flashMinor === uaMinor) {
return flashRev <= uaRev;
}
return flashMinor < uaMinor;
}
return flashMajor < uaMajor;
}
};
}, '@VERSION@', {"requires": ["yui-base"]});
|
sinkcup/cdnjs
|
ajax/libs/yui/3.8.0/swfdetect/swfdetect-debug.js
|
JavaScript
|
mit
| 3,354 |
# -*- encoding: ascii-8bit -*-
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
describe "IO#readpartial" do
before :each do
@rd, @wr = IO.pipe
@rd.binmode
@wr.binmode
end
after :each do
@rd.close unless @rd.closed?
@wr.close unless @wr.closed?
end
it "raises IOError on closed stream" do
lambda { IOSpecs.closed_io.readpartial(10) }.should raise_error(IOError)
@rd.close
lambda { @rd.readpartial(10) }.should raise_error(IOError)
end
it "reads at most the specified number of bytes" do
@wr.write("foobar")
# buffered read
@rd.read(1).should == 'f'
# return only specified number, not the whole buffer
@rd.readpartial(1).should == "o"
end
it "reads after ungetc with data in the buffer" do
@wr.write("foobar")
c = @rd.getc
@rd.ungetc(c)
@rd.readpartial(3).should == "foo"
@rd.readpartial(3).should == "bar"
end
it "reads after ungetc with multibyte characters in the buffer" do
@wr.write("∂φ/∂x = gaîté")
c = @rd.getc
@rd.ungetc(c)
@rd.readpartial(3).should == "\xE2\x88\x82"
@rd.readpartial(3).should == "\xCF\x86/"
end
it "reads after ungetc without data in the buffer" do
@wr.write("f")
c = @rd.getc
@rd.ungetc(c)
@rd.readpartial(2).should == "f"
# now, also check that the ungot char is cleared and
# not returned again
@wr.write("b")
@rd.readpartial(2).should == "b"
end
it "discards the existing buffer content upon successful read" do
buffer = "existing"
@wr.write("hello world")
@wr.close
@rd.readpartial(11, buffer)
buffer.should == "hello world"
end
it "raises EOFError on EOF" do
@wr.write("abc")
@wr.close
@rd.readpartial(10).should == 'abc'
lambda { @rd.readpartial(10) }.should raise_error(EOFError)
end
it "discards the existing buffer content upon error" do
buffer = 'hello'
@wr.close
lambda { @rd.readpartial(1, buffer) }.should raise_error(EOFError)
buffer.should be_empty
end
it "raises IOError if the stream is closed" do
@wr.close
lambda { @rd.readpartial(1) }.should raise_error(IOError)
end
it "raises ArgumentError if the negative argument is provided" do
lambda { @rd.readpartial(-1) }.should raise_error(ArgumentError)
end
it "immediately returns an empty string if the length argument is 0" do
@rd.readpartial(0).should == ""
end
end
|
jbr/rubyspec
|
core/io/readpartial_spec.rb
|
Ruby
|
mit
| 2,497 |
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Inflector Helper — CodeIgniter 3.1.6 documentation</title>
<link rel="shortcut icon" href="../_static/ci-icon.ico"/>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" />
<link rel="index" title="Index"
href="../genindex.html"/>
<link rel="search" title="Search" href="../search.html"/>
<link rel="top" title="CodeIgniter 3.1.6 documentation" href="../index.html"/>
<link rel="up" title="Helpers" href="index.html"/>
<link rel="next" title="Language Helper" href="language_helper.html"/>
<link rel="prev" title="HTML Helper" href="html_helper.html"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div id="nav">
<div id="nav_inner">
<div id="pulldown-menu" class="ciNav">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">Welcome to CodeIgniter</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/index.html">General Topics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP Style Guide</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li>
</ul>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Inflector Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="xml_helper.html">XML Helper</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div id="nav2">
<a href="#" id="openToc">
<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAAAf/bAIQABAMDAwMDBAMDBAYEAwQGBwUEBAUHCAYGBwYGCAoICQkJCQgKCgwMDAwMCgwMDQ0MDBERERERFBQUFBQUFBQUFAEEBQUIBwgPCgoPFA4ODhQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgAKwCaAwERAAIRAQMRAf/EAHsAAQAABwEBAAAAAAAAAAAAAAABAwQFBgcIAgkBAQAAAAAAAAAAAAAAAAAAAAAQAAEDAwICBwYEAgsAAAAAAAIBAwQAEQUSBiEHkROTVNQWGDFBUVIUCHEiMtOUFWGBobHRQlMkZIRVEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwDSC+ygkOOaUoKigUCgUCgUCgUCgUCgUCgUCgkuGguIP9FBMFb0Hqg7We+3jlmIqqYFf4ub+/QYlnOR/LqIBKGFUbf8qWv971BytQXXE7Y3Lnm3HsFhp2TaZJAdchRXpIgSpdEJWxJEW3xoKV7F5OMy7JkQn2o7D6w33XGjEAkoiqrJEqIiOIiKuhePCgqp22dyYyS3CyWHnQ5joG61HkRnmnTbaFSMhExRVQRRVJU9iUHjE7ez+fJ0MFipmUNhBV8YUd2SoIV9KkjQla9ltegttBdPLW4/qocL+UTfrMiHW4+P9M71shuyrqaHTcxsl7jegpsji8nh5ZwMvDfgTm0RTjSmjYdFCS6KoOIipdFunCgmNYTMv457MMY6U7iI6oMieDDhRm1VbIhuoOkbqtuK0Hpzb+eZcYZexUxt6UyUqK2cd0SdjtgrhOgijcgERUlJOCIl6CpgbP3blRI8XgMjNARAyKNDfeRBdFDBVUAXgQrqH4pxoJTu2NysY97LP4ac1io5q1InHFeGO24LnVKJuKOkSQ/yKir+rh7aCLG1dzypZQI2FnvTgccYOM3FeN0XWERXAUEFVQgQkUktdLpegm+Td3/Xli/L+S/mYNJIOF9G/wBeLKrZHFb0akG6W1WtQWSg3Dyg5e7V3fipE3O4/wCrktyzYA+ufas2LbZIlmnAT2kvuoN1wft95augilglX/tzP3qCu9O3LL/wV/i5v79BvmTADq14UGu91467Z6U9y0HzH/ncj/U/sT/CgynZG7I2NezpZGUjIycJkYkZSG+uQ81pbBNKLxJfjwoMqZ3/ALYHl35AJ7/cuwHcu5k7r1Q5pHetBjquqVVJWGxj9Zrtcl/Ggy3dHMvauR3HFZj5nHNxSyW5JISYDMoIwx8tFIGHZhPNaykGapr6rUAiicEoMG21lMRj8buPAz8xhJrr7uOeiPTCyAwXUaGR1mgozbTusOsFLEiJ7fbQa/h7gcjy2H3V6xppwDNtUSxCJIqp7valBuWVzJ22xuCROXNNZiJkMtms0DbjUkAZjzoDrTMd9dDRI44ZC2YsrYdKWP2WDT2S3N9dNdlRYrGMYc06IURXSYb0igrpWS485xVNS6nF4rwslkoMwnbpgZLB7bmt5uMweAhDEl4B5uSLzzqTnnyVpW2jaJHRMSIjdDiiotvy3DOE5rYTEbkl5yFn28k7JyG4c7AU2HtLH1uKfaiMPI40CdYbpNtmLdwTSn5rewLNld+7TLdeal4WarWBkbVKBjgdElMJJwAAY5fl4kB3b1fp4XvagsGS3FjJfLzDNtS8aeXx7LzT7TyzByQE5PccRGRC0ZRUDRV6y62vbjagzLmJzS2vuPK43JY6aP1TW6Jz+RIWyFtyC06y3EkiiinAo7YCqfq1AqqnGgsOH3lhZO8d1pmcpB8j5XIm9OYlBJSQ/FSS4427DKO0RC8AlcEMhFdViRR1WDWR5t3WXVuL1d106kG9vdeye2g60+1FDyW0shIcXVpyroXt8I8dfd+NB1vioAdWnD3UF1+gD4UFc6CEKpagxXN43rwJLUHz7yX2c8zokt9uHlsPIhA4aRnnHJTLptIS6CNsY7iASpxUUMkReGpfbQW0vtN5pitvrsN28rwtBD0nc0+/Yft5XhaB6TuaXfsP28rwtA9J3NPv2H7eV4Wgek7mn37D9vK8LQPSdzT79h+3leFoHpO5pd+w/byvC0D0nc0u/Yft5XhaB6TuaXfsP28rwtA9J3NLv2H7eV4Wgek7ml37D9vK8LQPSdzS79h+3leFoHpO5p9+w/byvC0E9r7Reazy2HIYVPxkS/CUHVn26cosxyv2g7h89LYmZSXOenvLEQ1YaQ222RATcQCP8rSGqqA8S02W2pQ6FhMoAIlqCtsnwoCpdKClejI4i3Sgtb+GBxVuNBSFt1pV/RQefLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8utJ/koJ7WCbBU/LQXOPAFq1koK8B0pag90CggtBBf6qB0UDooHRQOigdFA6KB0UDooHRQOigdFA6KB0UDooI0EaBQf//Z" title="Toggle Table of Contents" alt="Toggle Table of Contents" />
</a>
</div>
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="../index.html" class="fa fa-home"> CodeIgniter</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">Welcome to CodeIgniter</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/index.html">General Topics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP Style Guide</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li>
</ul>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Inflector Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="xml_helper.html">XML Helper</a></li>
</ul>
</li>
</ul>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">CodeIgniter</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html">Docs</a> »</li>
<li><a href="index.html">Helpers</a> »</li>
<li>Inflector Helper</li>
<li class="wy-breadcrumbs-aside">
</li>
<div style="float:right;margin-left:5px;" id="closeMe">
<img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" />
</div>
</ul>
<hr/>
</div>
<div role="main" class="document">
<div class="section" id="inflector-helper">
<h1>Inflector Helper<a class="headerlink" href="#inflector-helper" title="Permalink to this headline">¶</a></h1>
<p>The Inflector Helper file contains functions that permits you to change
<strong>English</strong> words to plural, singular, camel case, etc.</p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li>
<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li>
</ul>
</div>
<div class="custom-index container"></div><div class="section" id="loading-this-helper">
<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2>
<p>This helper is loaded using the following code:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">helper</span><span class="p">(</span><span class="s1">'inflector'</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="available-functions">
<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2>
<p>The following functions are available:</p>
<dl class="function">
<dt id="singular">
<code class="descname">singular</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#singular" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>$str</strong> (<em>string</em>) – Input string</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A singular word</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>Changes a plural word to singular. Example:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">singular</span><span class="p">(</span><span class="s1">'dogs'</span><span class="p">);</span> <span class="c1">// Prints 'dog'</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="plural">
<code class="descname">plural</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#plural" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>$str</strong> (<em>string</em>) – Input string</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A plural word</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>Changes a singular word to plural. Example:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">plural</span><span class="p">(</span><span class="s1">'dog'</span><span class="p">);</span> <span class="c1">// Prints 'dogs'</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="camelize">
<code class="descname">camelize</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#camelize" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>$str</strong> (<em>string</em>) – Input string</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Camelized string</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>Changes a string of words separated by spaces or underscores to camel
case. Example:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">camelize</span><span class="p">(</span><span class="s1">'my_dog_spot'</span><span class="p">);</span> <span class="c1">// Prints 'myDogSpot'</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="underscore">
<code class="descname">underscore</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#underscore" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>$str</strong> (<em>string</em>) – Input string</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">String containing underscores instead of spaces</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>Takes multiple words separated by spaces and underscores them.
Example:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">underscore</span><span class="p">(</span><span class="s1">'my dog spot'</span><span class="p">);</span> <span class="c1">// Prints 'my_dog_spot'</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="humanize">
<code class="descname">humanize</code><span class="sig-paren">(</span><em>$str</em><span class="optional">[</span>, <em>$separator = '_'</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#humanize" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>$str</strong> (<em>string</em>) – Input string</li>
<li><strong>$separator</strong> (<em>string</em>) – Input separator</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Humanized string</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>Takes multiple words separated by underscores and adds spaces between
them. Each word is capitalized.</p>
<p>Example:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">humanize</span><span class="p">(</span><span class="s1">'my_dog_spot'</span><span class="p">);</span> <span class="c1">// Prints 'My Dog Spot'</span>
</pre></div>
</div>
<p>To use dashes instead of underscores:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">humanize</span><span class="p">(</span><span class="s1">'my-dog-spot'</span><span class="p">,</span> <span class="s1">'-'</span><span class="p">);</span> <span class="c1">// Prints 'My Dog Spot'</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="is_countable">
<code class="descname">is_countable</code><span class="sig-paren">(</span><em>$word</em><span class="sig-paren">)</span><a class="headerlink" href="#is_countable" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>$word</strong> (<em>string</em>) – Input string</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">TRUE if the word is countable or FALSE if not</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p>
</td>
</tr>
</tbody>
</table>
<p>Checks if the given word has a plural version. Example:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">is_countable</span><span class="p">(</span><span class="s1">'equipment'</span><span class="p">);</span> <span class="c1">// Returns FALSE</span>
</pre></div>
</div>
</dd></dl>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="language_helper.html" class="btn btn-neutral float-right" title="Language Helper">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="html_helper.html" class="btn btn-neutral" title="HTML Helper"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2014 - 2017, British Columbia Institute of Technology.
Last updated on Sep 25, 2017.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../',
VERSION:'3.1.6',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
|
seba316d/Balcerek
|
user_guide/helpers/inflector_helper.html
|
HTML
|
mit
| 43,866 |
/*!
{
"name": "Workers from Data URIs",
"property": "dataworkers",
"tags": ["performance", "workers"],
"builderAliases": ["workers_dataworkers"],
"notes": [{
"name": "W3C Reference",
"href": "https://www.w3.org/TR/workers/"
}],
"knownBugs": ["This test may output garbage to console."],
"authors": ["Jussi Kalliokoski"],
"async": true
}
!*/
/* DOC
Detects support for creating Web Workers from Data URIs.
*/
define(['Modernizr', 'addTest'], function(Modernizr, addTest) {
Modernizr.addAsyncTest(function() {
try {
var data = 'Modernizr',
worker = new Worker('data:text/javascript;base64,dGhpcy5vbm1lc3NhZ2U9ZnVuY3Rpb24oZSl7cG9zdE1lc3NhZ2UoZS5kYXRhKX0=');
worker.onmessage = function(e) {
worker.terminate();
addTest('dataworkers', data === e.data);
worker = null;
};
// Just in case...
worker.onerror = function() {
addTest('dataworkers', false);
worker = null;
};
setTimeout(function() {
addTest('dataworkers', false);
}, 200);
worker.postMessage(data);
} catch (e) {
setTimeout(function() {
addTest('dataworkers', false);
}, 0);
}
});
});
|
concord-re/concord-re.github.io
|
bower_components/modernizr/feature-detects/workers/dataworkers.js
|
JavaScript
|
mit
| 1,219 |
"use strict";
exports.__esModule = true;
var fp = typeof window !== "undefined" && window.flatpickr !== undefined
? window.flatpickr
: {
l10ns: {}
};
exports.Romanian = {
weekdays: {
shorthand: ["Dum", "Lun", "Mar", "Mie", "Joi", "Vin", "Sam"],
longhand: [
"Duminică",
"Luni",
"Marți",
"Miercuri",
"Joi",
"Vineri",
"Sâmbătă",
]
},
months: {
shorthand: [
"Ian",
"Feb",
"Mar",
"Apr",
"Mai",
"Iun",
"Iul",
"Aug",
"Sep",
"Oct",
"Noi",
"Dec",
],
longhand: [
"Ianuarie",
"Februarie",
"Martie",
"Aprilie",
"Mai",
"Iunie",
"Iulie",
"August",
"Septembrie",
"Octombrie",
"Noiembrie",
"Decembrie",
]
},
firstDayOfWeek: 1,
ordinal: function () {
return "";
}
};
fp.l10ns.ro = exports.Romanian;
exports["default"] = fp.l10ns;
|
sashberd/cdnjs
|
ajax/libs/flatpickr/4.0.0/l10n/ro.js
|
JavaScript
|
mit
| 1,202 |
/* rome@v2.1.5, MIT licensed. https://github.com/bevacqua/rome */
.rd-container{display:none;border:1px solid #333;background-color:#fff;padding:10px;text-align:center}.rd-container-attachment{position:absolute}.rd-month{display:inline-block;margin-right:25px}.rd-month:last-child{margin-right:0}.rd-back,.rd-next{cursor:pointer;border:none;outline:0;background:0 0;padding:0;margin:0}.rd-back[disabled],.rd-next[disabled]{cursor:default}.rd-back{float:left}.rd-next{float:right}.rd-back:before{display:block;content:'\2190'}.rd-next:before{display:block;content:'\2192'}.rd-day-body{cursor:pointer;text-align:center}.rd-day-selected,.rd-time-option:hover,.rd-time-selected{cursor:pointer;background-color:#333;color:#fff}.rd-day-next-month,.rd-day-prev-month{color:#999}.rd-day-disabled{cursor:default;color:#fcc}.rd-time{position:relative;display:inline-block;margin-top:5px;min-width:80px}.rd-time-list{display:none;position:absolute;overflow-y:scroll;max-height:160px;left:0;right:0;background-color:#fff;color:#333}.rd-time-option,.rd-time-selected{padding:5px}.rd-day-concealed{visibility:hidden}
|
viskin/cdnjs
|
ajax/libs/rome/2.1.5/rome.min.css
|
CSS
|
mit
| 1,102 |
/*
To get this list of colors inject jQuery at http://www.google.com/design/spec/style/color.html#color-color-palette
Then, run this script to get the list.
(function() {
var colors = {}, main = {};
$(".color-group").each(function() {
var color = $(this).find(".name").text().trim().toLowerCase().replace(" ", "-");
colors[color] = {};
$(this).find(".color").not(".main-color").each(function() {
var shade = $(this).find(".shade").text().trim(),
hex = $(this).find(".hex").text().trim();
colors[color][shade] = hex;
});
main[color] = color + "-" + $(this).find(".main-color .shade").text().trim();
});
var LESS = "";
$.each(colors, function(name, shades) {
LESS += "\n\n";
$.each(shades, function(shade, hex) {
LESS += "@" + name + "-" + shade + ": " + hex + ";\n";
});
if (main[name]) {
LESS += "@" + name + ": " + main[name] + ";\n";
}
});
console.log(LESS);
})();
*/
@font-face {
font-family: 'Material-Design-Icons';
src: url('../fonts/Material-Design-Icons.eot?3ocs8m');
src: url('../fonts/Material-Design-Icons.eot?#iefix3ocs8m') format('embedded-opentype'), url('../fonts/Material-Design-Icons.woff?3ocs8m') format('woff'), url('../fonts/Material-Design-Icons.ttf?3ocs8m') format('truetype'), url('../fonts/Material-Design-Icons.svg?3ocs8m#Material-Design-Icons') format('svg');
font-weight: normal;
font-style: normal;
}
[class^="mdi-"],
[class*="mdi-"] {
speak: none;
display: inline-block;
font: normal normal normal 24px/1 'Material-Design-Icons';
text-rendering: auto;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
}
[class^="mdi-"]:before,
[class*="mdi-"]:before {
display: inline-block;
speak: none;
text-decoration: inherit;
}
[class^="mdi-"].pull-left,
[class*="mdi-"].pull-left {
margin-right: .3em;
}
[class^="mdi-"].pull-right,
[class*="mdi-"].pull-right {
margin-left: .3em;
}
[class^="mdi-"].mdi-lg:before,
[class*="mdi-"].mdi-lg:before,
[class^="mdi-"].mdi-lg:after,
[class*="mdi-"].mdi-lg:after {
font-size: 1.33333333em;
line-height: 0.75em;
vertical-align: -15%;
}
[class^="mdi-"].mdi-2x:before,
[class*="mdi-"].mdi-2x:before,
[class^="mdi-"].mdi-2x:after,
[class*="mdi-"].mdi-2x:after {
font-size: 2em;
}
[class^="mdi-"].mdi-3x:before,
[class*="mdi-"].mdi-3x:before,
[class^="mdi-"].mdi-3x:after,
[class*="mdi-"].mdi-3x:after {
font-size: 3em;
}
[class^="mdi-"].mdi-4x:before,
[class*="mdi-"].mdi-4x:before,
[class^="mdi-"].mdi-4x:after,
[class*="mdi-"].mdi-4x:after {
font-size: 4em;
}
[class^="mdi-"].mdi-5x:before,
[class*="mdi-"].mdi-5x:before,
[class^="mdi-"].mdi-5x:after,
[class*="mdi-"].mdi-5x:after {
font-size: 5em;
}
[class^="mdi-device-signal-cellular-"]:after,
[class^="mdi-device-battery-"]:after,
[class^="mdi-device-battery-charging-"]:after,
[class^="mdi-device-signal-cellular-connected-no-internet-"]:after,
[class^="mdi-device-signal-wifi-"]:after,
[class^="mdi-device-signal-wifi-statusbar-not-connected"]:after,
.mdi-device-network-wifi:after {
opacity: .3;
position: absolute;
left: 0;
top: 0;
z-index: 1;
display: inline-block;
speak: none;
text-decoration: inherit;
}
[class^="mdi-device-signal-cellular-"]:after {
content: "\e758";
}
[class^="mdi-device-battery-"]:after {
content: "\e735";
}
[class^="mdi-device-battery-charging-"]:after {
content: "\e733";
}
[class^="mdi-device-signal-cellular-connected-no-internet-"]:after {
content: "\e75d";
}
[class^="mdi-device-signal-wifi-"]:after,
.mdi-device-network-wifi:after {
content: "\e765";
}
[class^="mdi-device-signal-wifi-statusbasr-not-connected"]:after {
content: "\e8f7";
}
.mdi-device-signal-cellular-off:after,
.mdi-device-signal-cellular-null:after,
.mdi-device-signal-cellular-no-sim:after,
.mdi-device-signal-wifi-off:after,
.mdi-device-signal-wifi-4-bar:after,
.mdi-device-signal-cellular-4-bar:after,
.mdi-device-battery-alert:after,
.mdi-device-signal-cellular-connected-no-internet-4-bar:after,
.mdi-device-battery-std:after,
.mdi-device-battery-full .mdi-device-battery-unknown:after {
content: "";
}
.mdi-fw {
width: 1.28571429em;
text-align: center;
}
.mdi-ul {
padding-left: 0;
margin-left: 2.14285714em;
list-style-type: none;
}
.mdi-ul > li {
position: relative;
}
.mdi-li {
position: absolute;
left: -2.14285714em;
width: 2.14285714em;
top: 0.14285714em;
text-align: center;
}
.mdi-li.mdi-lg {
left: -1.85714286em;
}
.mdi-border {
padding: .2em .25em .15em;
border: solid 0.08em #eeeeee;
border-radius: .1em;
}
.mdi-spin {
-webkit-animation: mdi-spin 2s infinite linear;
animation: mdi-spin 2s infinite linear;
-webkit-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
transform-origin: 50% 50%;
}
.mdi-pulse {
-webkit-animation: mdi-spin 1s steps(8) infinite;
animation: mdi-spin 1s steps(8) infinite;
-webkit-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
transform-origin: 50% 50%;
}
@-webkit-keyframes mdi-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@keyframes mdi-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
.mdi-rotate-90 {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
-webkit-transform: rotate(90deg);
-ms-transform: rotate(90deg);
transform: rotate(90deg);
}
.mdi-rotate-180 {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
-webkit-transform: rotate(180deg);
-ms-transform: rotate(180deg);
transform: rotate(180deg);
}
.mdi-rotate-270 {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
-webkit-transform: rotate(270deg);
-ms-transform: rotate(270deg);
transform: rotate(270deg);
}
.mdi-flip-horizontal {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);
-webkit-transform: scale(-1, 1);
-ms-transform: scale(-1, 1);
transform: scale(-1, 1);
}
.mdi-flip-vertical {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);
-webkit-transform: scale(1, -1);
-ms-transform: scale(1, -1);
transform: scale(1, -1);
}
:root .mdi-rotate-90,
:root .mdi-rotate-180,
:root .mdi-rotate-270,
:root .mdi-flip-horizontal,
:root .mdi-flip-vertical {
-webkit-filter: none;
filter: none;
}
.mdi-stack {
position: relative;
display: inline-block;
width: 2em;
height: 2em;
line-height: 2em;
vertical-align: middle;
}
.mdi-stack-1x,
.mdi-stack-2x {
position: absolute;
left: 0;
width: 100%;
text-align: center;
}
.mdi-stack-1x {
line-height: inherit;
}
.mdi-stack-2x {
font-size: 2em;
}
.mdi-inverse {
color: #ffffff;
}
/* Start Icons */
.mdi-action-3d-rotation:before {
content: "\e600";
}
.mdi-action-accessibility:before {
content: "\e601";
}
.mdi-action-account-balance-wallet:before {
content: "\e602";
}
.mdi-action-account-balance:before {
content: "\e603";
}
.mdi-action-account-box:before {
content: "\e604";
}
.mdi-action-account-child:before {
content: "\e605";
}
.mdi-action-account-circle:before {
content: "\e606";
}
.mdi-action-add-shopping-cart:before {
content: "\e607";
}
.mdi-action-alarm-add:before {
content: "\e608";
}
.mdi-action-alarm-off:before {
content: "\e609";
}
.mdi-action-alarm-on:before {
content: "\e60a";
}
.mdi-action-alarm:before {
content: "\e60b";
}
.mdi-action-android:before {
content: "\e60c";
}
.mdi-action-announcement:before {
content: "\e60d";
}
.mdi-action-aspect-ratio:before {
content: "\e60e";
}
.mdi-action-assessment:before {
content: "\e60f";
}
.mdi-action-assignment-ind:before {
content: "\e610";
}
.mdi-action-assignment-late:before {
content: "\e611";
}
.mdi-action-assignment-return:before {
content: "\e612";
}
.mdi-action-assignment-returned:before {
content: "\e613";
}
.mdi-action-assignment-turned-in:before {
content: "\e614";
}
.mdi-action-assignment:before {
content: "\e615";
}
.mdi-action-autorenew:before {
content: "\e616";
}
.mdi-action-backup:before {
content: "\e617";
}
.mdi-action-book:before {
content: "\e618";
}
.mdi-action-bookmark-outline:before {
content: "\e619";
}
.mdi-action-bookmark:before {
content: "\e61a";
}
.mdi-action-bug-report:before {
content: "\e61b";
}
.mdi-action-cached:before {
content: "\e61c";
}
.mdi-action-check-circle:before {
content: "\e61d";
}
.mdi-action-class:before {
content: "\e61e";
}
.mdi-action-credit-card:before {
content: "\e61f";
}
.mdi-action-dashboard:before {
content: "\e620";
}
.mdi-action-delete:before {
content: "\e621";
}
.mdi-action-description:before {
content: "\e622";
}
.mdi-action-dns:before {
content: "\e623";
}
.mdi-action-done-all:before {
content: "\e624";
}
.mdi-action-done:before {
content: "\e625";
}
.mdi-action-event:before {
content: "\e626";
}
.mdi-action-exit-to-app:before {
content: "\e627";
}
.mdi-action-explore:before {
content: "\e628";
}
.mdi-action-extension:before {
content: "\e629";
}
.mdi-action-face-unlock:before {
content: "\e62a";
}
.mdi-action-favorite-outline:before {
content: "\e62b";
}
.mdi-action-favorite:before {
content: "\e62c";
}
.mdi-action-find-in-page:before {
content: "\e62d";
}
.mdi-action-find-replace:before {
content: "\e62e";
}
.mdi-action-flip-to-back:before {
content: "\e62f";
}
.mdi-action-flip-to-front:before {
content: "\e630";
}
.mdi-action-get-app:before {
content: "\e631";
}
.mdi-action-grade:before {
content: "\e632";
}
.mdi-action-group-work:before {
content: "\e633";
}
.mdi-action-help:before {
content: "\e634";
}
.mdi-action-highlight-remove:before {
content: "\e635";
}
.mdi-action-history:before {
content: "\e636";
}
.mdi-action-home:before {
content: "\e637";
}
.mdi-action-https:before {
content: "\e638";
}
.mdi-action-info-outline:before {
content: "\e639";
}
.mdi-action-info:before {
content: "\e63a";
}
.mdi-action-input:before {
content: "\e63b";
}
.mdi-action-invert-colors:before {
content: "\e63c";
}
.mdi-action-label-outline:before {
content: "\e63d";
}
.mdi-action-label:before {
content: "\e63e";
}
.mdi-action-language:before {
content: "\e63f";
}
.mdi-action-launch:before {
content: "\e640";
}
.mdi-action-list:before {
content: "\e641";
}
.mdi-action-lock-open:before {
content: "\e642";
}
.mdi-action-lock-outline:before {
content: "\e643";
}
.mdi-action-lock:before {
content: "\e644";
}
.mdi-action-loyalty:before {
content: "\e645";
}
.mdi-action-markunread-mailbox:before {
content: "\e646";
}
.mdi-action-note-add:before {
content: "\e647";
}
.mdi-action-open-in-browser:before {
content: "\e648";
}
.mdi-action-open-in-new:before {
content: "\e649";
}
.mdi-action-open-with:before {
content: "\e64a";
}
.mdi-action-pageview:before {
content: "\e64b";
}
.mdi-action-payment:before {
content: "\e64c";
}
.mdi-action-perm-camera-mic:before {
content: "\e64d";
}
.mdi-action-perm-contact-cal:before {
content: "\e64e";
}
.mdi-action-perm-data-setting:before {
content: "\e64f";
}
.mdi-action-perm-device-info:before {
content: "\e650";
}
.mdi-action-perm-identity:before {
content: "\e651";
}
.mdi-action-perm-media:before {
content: "\e652";
}
.mdi-action-perm-phone-msg:before {
content: "\e653";
}
.mdi-action-perm-scan-wifi:before {
content: "\e654";
}
.mdi-action-picture-in-picture:before {
content: "\e655";
}
.mdi-action-polymer:before {
content: "\e656";
}
.mdi-action-print:before {
content: "\e657";
}
.mdi-action-query-builder:before {
content: "\e658";
}
.mdi-action-question-answer:before {
content: "\e659";
}
.mdi-action-receipt:before {
content: "\e65a";
}
.mdi-action-redeem:before {
content: "\e65b";
}
.mdi-action-reorder:before {
content: "\e65c";
}
.mdi-action-report-problem:before {
content: "\e65d";
}
.mdi-action-restore:before {
content: "\e65e";
}
.mdi-action-room:before {
content: "\e65f";
}
.mdi-action-schedule:before {
content: "\e660";
}
.mdi-action-search:before {
content: "\e661";
}
.mdi-action-settings-applications:before {
content: "\e662";
}
.mdi-action-settings-backup-restore:before {
content: "\e663";
}
.mdi-action-settings-bluetooth:before {
content: "\e664";
}
.mdi-action-settings-cell:before {
content: "\e665";
}
.mdi-action-settings-display:before {
content: "\e666";
}
.mdi-action-settings-ethernet:before {
content: "\e667";
}
.mdi-action-settings-input-antenna:before {
content: "\e668";
}
.mdi-action-settings-input-component:before {
content: "\e669";
}
.mdi-action-settings-input-composite:before {
content: "\e66a";
}
.mdi-action-settings-input-hdmi:before {
content: "\e66b";
}
.mdi-action-settings-input-svideo:before {
content: "\e66c";
}
.mdi-action-settings-overscan:before {
content: "\e66d";
}
.mdi-action-settings-phone:before {
content: "\e66e";
}
.mdi-action-settings-power:before {
content: "\e66f";
}
.mdi-action-settings-remote:before {
content: "\e670";
}
.mdi-action-settings-voice:before {
content: "\e671";
}
.mdi-action-settings:before {
content: "\e672";
}
.mdi-action-shop-two:before {
content: "\e673";
}
.mdi-action-shop:before {
content: "\e674";
}
.mdi-action-shopping-basket:before {
content: "\e675";
}
.mdi-action-shopping-cart:before {
content: "\e676";
}
.mdi-action-speaker-notes:before {
content: "\e677";
}
.mdi-action-spellcheck:before {
content: "\e678";
}
.mdi-action-star-rate:before {
content: "\e679";
}
.mdi-action-stars:before {
content: "\e67a";
}
.mdi-action-store:before {
content: "\e67b";
}
.mdi-action-subject:before {
content: "\e67c";
}
.mdi-action-supervisor-account:before {
content: "\e67d";
}
.mdi-action-swap-horiz:before {
content: "\e67e";
}
.mdi-action-swap-vert-circle:before {
content: "\e67f";
}
.mdi-action-swap-vert:before {
content: "\e680";
}
.mdi-action-system-update-tv:before {
content: "\e681";
}
.mdi-action-tab-unselected:before {
content: "\e682";
}
.mdi-action-tab:before {
content: "\e683";
}
.mdi-action-theaters:before {
content: "\e684";
}
.mdi-action-thumb-down:before {
content: "\e685";
}
.mdi-action-thumb-up:before {
content: "\e686";
}
.mdi-action-thumbs-up-down:before {
content: "\e687";
}
.mdi-action-toc:before {
content: "\e688";
}
.mdi-action-today:before {
content: "\e689";
}
.mdi-action-track-changes:before {
content: "\e68a";
}
.mdi-action-translate:before {
content: "\e68b";
}
.mdi-action-trending-down:before {
content: "\e68c";
}
.mdi-action-trending-neutral:before {
content: "\e68d";
}
.mdi-action-trending-up:before {
content: "\e68e";
}
.mdi-action-turned-in-not:before {
content: "\e68f";
}
.mdi-action-turned-in:before {
content: "\e690";
}
.mdi-action-verified-user:before {
content: "\e691";
}
.mdi-action-view-agenda:before {
content: "\e692";
}
.mdi-action-view-array:before {
content: "\e693";
}
.mdi-action-view-carousel:before {
content: "\e694";
}
.mdi-action-view-column:before {
content: "\e695";
}
.mdi-action-view-day:before {
content: "\e696";
}
.mdi-action-view-headline:before {
content: "\e697";
}
.mdi-action-view-list:before {
content: "\e698";
}
.mdi-action-view-module:before {
content: "\e699";
}
.mdi-action-view-quilt:before {
content: "\e69a";
}
.mdi-action-view-stream:before {
content: "\e69b";
}
.mdi-action-view-week:before {
content: "\e69c";
}
.mdi-action-visibility-off:before {
content: "\e69d";
}
.mdi-action-visibility:before {
content: "\e69e";
}
.mdi-action-wallet-giftcard:before {
content: "\e69f";
}
.mdi-action-wallet-membership:before {
content: "\e6a0";
}
.mdi-action-wallet-travel:before {
content: "\e6a1";
}
.mdi-action-work:before {
content: "\e6a2";
}
.mdi-alert-error:before {
content: "\e6a3";
}
.mdi-alert-warning:before {
content: "\e6a4";
}
.mdi-av-album:before {
content: "\e6a5";
}
.mdi-av-closed-caption:before {
content: "\e6a6";
}
.mdi-av-equalizer:before {
content: "\e6a7";
}
.mdi-av-explicit:before {
content: "\e6a8";
}
.mdi-av-fast-forward:before {
content: "\e6a9";
}
.mdi-av-fast-rewind:before {
content: "\e6aa";
}
.mdi-av-games:before {
content: "\e6ab";
}
.mdi-av-hearing:before {
content: "\e6ac";
}
.mdi-av-high-quality:before {
content: "\e6ad";
}
.mdi-av-loop:before {
content: "\e6ae";
}
.mdi-av-mic-none:before {
content: "\e6af";
}
.mdi-av-mic-off:before {
content: "\e6b0";
}
.mdi-av-mic:before {
content: "\e6b1";
}
.mdi-av-movie:before {
content: "\e6b2";
}
.mdi-av-my-library-add:before {
content: "\e6b3";
}
.mdi-av-my-library-books:before {
content: "\e6b4";
}
.mdi-av-my-library-music:before {
content: "\e6b5";
}
.mdi-av-new-releases:before {
content: "\e6b6";
}
.mdi-av-not-interested:before {
content: "\e6b7";
}
.mdi-av-pause-circle-fill:before {
content: "\e6b8";
}
.mdi-av-pause-circle-outline:before {
content: "\e6b9";
}
.mdi-av-pause:before {
content: "\e6ba";
}
.mdi-av-play-arrow:before {
content: "\e6bb";
}
.mdi-av-play-circle-fill:before {
content: "\e6bc";
}
.mdi-av-play-circle-outline:before {
content: "\e6bd";
}
.mdi-av-play-shopping-bag:before {
content: "\e6be";
}
.mdi-av-playlist-add:before {
content: "\e6bf";
}
.mdi-av-queue-mus:before {
content: "\e6c0";
}
.mdi-av-queue:before {
content: "\e6c1";
}
.mdi-av-radio:before {
content: "\e6c2";
}
.mdi-av-recent-actors:before {
content: "\e6c3";
}
.mdi-av-repeat-one:before {
content: "\e6c4";
}
.mdi-av-repeat:before {
content: "\e6c5";
}
.mdi-av-replay:before {
content: "\e6c6";
}
.mdi-av-shuffle:before {
content: "\e6c7";
}
.mdi-av-skip-next:before {
content: "\e6c8";
}
.mdi-av-skip-previous:before {
content: "\e6c9";
}
.mdi-av-snooze:before {
content: "\e6ca";
}
.mdi-av-stop:before {
content: "\e6cb";
}
.mdi-av-subtitles:before {
content: "\e6cc";
}
.mdi-av-surround-sound:before {
content: "\e6cd";
}
.mdi-av-timer:before {
content: "\e6ce";
}
.mdi-av-video-collection:before {
content: "\e6cf";
}
.mdi-av-videocam-off:before {
content: "\e6d0";
}
.mdi-av-videocam:before {
content: "\e6d1";
}
.mdi-av-volume-down:before {
content: "\e6d2";
}
.mdi-av-volume-mute:before {
content: "\e6d3";
}
.mdi-av-volume-off:before {
content: "\e6d4";
}
.mdi-av-volume-up:before {
content: "\e6d5";
}
.mdi-av-web:before {
content: "\e6d6";
}
.mdi-communication-business:before {
content: "\e6d7";
}
.mdi-communication-call-end:before {
content: "\e6d8";
}
.mdi-communication-call-made:before {
content: "\e6d9";
}
.mdi-communication-call-merge:before {
content: "\e6da";
}
.mdi-communication-call-missed:before {
content: "\e6db";
}
.mdi-communication-call-received:before {
content: "\e6dc";
}
.mdi-communication-call-split:before {
content: "\e6dd";
}
.mdi-communication-call:before {
content: "\e6de";
}
.mdi-communication-chat:before {
content: "\e6df";
}
.mdi-communication-clear-all:before {
content: "\e6e0";
}
.mdi-communication-comment:before {
content: "\e6e1";
}
.mdi-communication-contacts:before {
content: "\e6e2";
}
.mdi-communication-dialer-sip:before {
content: "\e6e3";
}
.mdi-communication-dialpad:before {
content: "\e6e4";
}
.mdi-communication-dnd-on:before {
content: "\e6e5";
}
.mdi-communication-email:before {
content: "\e6e6";
}
.mdi-communication-forum:before {
content: "\e6e7";
}
.mdi-communication-import-export:before {
content: "\e6e8";
}
.mdi-communication-invert-colors-off:before {
content: "\e6e9";
}
.mdi-communication-invert-colors-on:before {
content: "\e6ea";
}
.mdi-communication-live-help:before {
content: "\e6eb";
}
.mdi-communication-location-off:before {
content: "\e6ec";
}
.mdi-communication-location-on:before {
content: "\e6ed";
}
.mdi-communication-message:before {
content: "\e6ee";
}
.mdi-communication-messenger:before {
content: "\e6ef";
}
.mdi-communication-no-sim:before {
content: "\e6f0";
}
.mdi-communication-phone:before {
content: "\e6f1";
}
.mdi-communication-portable-wifi-off:before {
content: "\e6f2";
}
.mdi-communication-quick-contacts-dialer:before {
content: "\e6f3";
}
.mdi-communication-quick-contacts-mail:before {
content: "\e6f4";
}
.mdi-communication-ring-volume:before {
content: "\e6f5";
}
.mdi-communication-stay-current-landscape:before {
content: "\e6f6";
}
.mdi-communication-stay-current-portrait:before {
content: "\e6f7";
}
.mdi-communication-stay-primary-landscape:before {
content: "\e6f8";
}
.mdi-communication-stay-primary-portrait:before {
content: "\e6f9";
}
.mdi-communication-swap-calls:before {
content: "\e6fa";
}
.mdi-communication-textsms:before {
content: "\e6fb";
}
.mdi-communication-voicemail:before {
content: "\e6fc";
}
.mdi-communication-vpn-key:before {
content: "\e6fd";
}
.mdi-content-add-box:before {
content: "\e6fe";
}
.mdi-content-add-circle-outline:before {
content: "\e6ff";
}
.mdi-content-add-circle:before {
content: "\e700";
}
.mdi-content-add:before {
content: "\e701";
}
.mdi-content-archive:before {
content: "\e702";
}
.mdi-content-backspace:before {
content: "\e703";
}
.mdi-content-block:before {
content: "\e704";
}
.mdi-content-clear:before {
content: "\e705";
}
.mdi-content-content-copy:before {
content: "\e706";
}
.mdi-content-content-cut:before {
content: "\e707";
}
.mdi-content-content-paste:before {
content: "\e708";
}
.mdi-content-create:before {
content: "\e709";
}
.mdi-content-drafts:before {
content: "\e70a";
}
.mdi-content-filter-list:before {
content: "\e70b";
}
.mdi-content-flag:before {
content: "\e70c";
}
.mdi-content-forward:before {
content: "\e70d";
}
.mdi-content-gesture:before {
content: "\e70e";
}
.mdi-content-inbox:before {
content: "\e70f";
}
.mdi-content-link:before {
content: "\e710";
}
.mdi-content-mail:before {
content: "\e711";
}
.mdi-content-markunread:before {
content: "\e712";
}
.mdi-content-redo:before {
content: "\e713";
}
.mdi-content-remove-circle-outline:before {
content: "\e714";
}
.mdi-content-remove-circle:before {
content: "\e715";
}
.mdi-content-remove:before {
content: "\e716";
}
.mdi-content-reply-all:before {
content: "\e717";
}
.mdi-content-reply:before {
content: "\e718";
}
.mdi-content-report:before {
content: "\e719";
}
.mdi-content-save:before {
content: "\e71a";
}
.mdi-content-select-all:before {
content: "\e71b";
}
.mdi-content-send:before {
content: "\e71c";
}
.mdi-content-sort:before {
content: "\e71d";
}
.mdi-content-text-format:before {
content: "\e71e";
}
.mdi-content-undo:before {
content: "\e71f";
}
.mdi-editor-attach-file:before {
content: "\e776";
}
.mdi-editor-attach-money:before {
content: "\e777";
}
.mdi-editor-border-all:before {
content: "\e778";
}
.mdi-editor-border-bottom:before {
content: "\e779";
}
.mdi-editor-border-clear:before {
content: "\e77a";
}
.mdi-editor-border-color:before {
content: "\e77b";
}
.mdi-editor-border-horizontal:before {
content: "\e77c";
}
.mdi-editor-border-inner:before {
content: "\e77d";
}
.mdi-editor-border-left:before {
content: "\e77e";
}
.mdi-editor-border-outer:before {
content: "\e77f";
}
.mdi-editor-border-right:before {
content: "\e780";
}
.mdi-editor-border-style:before {
content: "\e781";
}
.mdi-editor-border-top:before {
content: "\e782";
}
.mdi-editor-border-vertical:before {
content: "\e783";
}
.mdi-editor-format-align-center:before {
content: "\e784";
}
.mdi-editor-format-align-justify:before {
content: "\e785";
}
.mdi-editor-format-align-left:before {
content: "\e786";
}
.mdi-editor-format-align-right:before {
content: "\e787";
}
.mdi-editor-format-bold:before {
content: "\e788";
}
.mdi-editor-format-clear:before {
content: "\e789";
}
.mdi-editor-format-color-fill:before {
content: "\e78a";
}
.mdi-editor-format-color-reset:before {
content: "\e78b";
}
.mdi-editor-format-color-text:before {
content: "\e78c";
}
.mdi-editor-format-indent-decrease:before {
content: "\e78d";
}
.mdi-editor-format-indent-increase:before {
content: "\e78e";
}
.mdi-editor-format-italic:before {
content: "\e78f";
}
.mdi-editor-format-line-spacing:before {
content: "\e790";
}
.mdi-editor-format-list-bulleted:before {
content: "\e791";
}
.mdi-editor-format-list-numbered:before {
content: "\e792";
}
.mdi-editor-format-paint:before {
content: "\e793";
}
.mdi-editor-format-quote:before {
content: "\e794";
}
.mdi-editor-format-size:before {
content: "\e795";
}
.mdi-editor-format-strikethrough:before {
content: "\e796";
}
.mdi-editor-format-textdirection-l-to-r:before {
content: "\e797";
}
.mdi-editor-format-textdirection-r-to-l:before {
content: "\e798";
}
.mdi-editor-format-underline:before {
content: "\e799";
}
.mdi-editor-functions:before {
content: "\e79a";
}
.mdi-editor-insert-chart:before {
content: "\e79b";
}
.mdi-editor-insert-comment:before {
content: "\e79c";
}
.mdi-editor-insert-drive-file:before {
content: "\e79d";
}
.mdi-editor-insert-emoticon:before {
content: "\e79e";
}
.mdi-editor-insert-invitation:before {
content: "\e79f";
}
.mdi-editor-insert-link:before {
content: "\e7a0";
}
.mdi-editor-insert-photo:before {
content: "\e7a1";
}
.mdi-editor-merge-type:before {
content: "\e7a2";
}
.mdi-editor-mode-comment:before {
content: "\e7a3";
}
.mdi-editor-mode-edit:before {
content: "\e7a4";
}
.mdi-editor-publish:before {
content: "\e7a5";
}
.mdi-editor-vertical-align-bottom:before {
content: "\e7a6";
}
.mdi-editor-vertical-align-center:before {
content: "\e7a7";
}
.mdi-editor-vertical-align-top:before {
content: "\e7a8";
}
.mdi-editor-wrap-text:before {
content: "\e7a9";
}
.mdi-file-attachment:before {
content: "\e7aa";
}
.mdi-file-cloud-circle:before {
content: "\e7ab";
}
.mdi-file-cloud-done:before {
content: "\e7ac";
}
.mdi-file-cloud-download:before {
content: "\e7ad";
}
.mdi-file-cloud-off:before {
content: "\e7ae";
}
.mdi-file-cloud-queue:before {
content: "\e7af";
}
.mdi-file-cloud-upload:before {
content: "\e7b0";
}
.mdi-file-cloud:before {
content: "\e7b1";
}
.mdi-file-file-download:before {
content: "\e7b2";
}
.mdi-file-file-upload:before {
content: "\e7b3";
}
.mdi-file-folder-open:before {
content: "\e7b4";
}
.mdi-file-folder-shared:before {
content: "\e7b5";
}
.mdi-file-folder:before {
content: "\e7b6";
}
.mdi-device-access-alarm:before {
content: "\e720";
}
.mdi-device-access-alarms:before {
content: "\e721";
}
.mdi-device-access-time:before {
content: "\e722";
}
.mdi-device-add-alarm:before {
content: "\e723";
}
.mdi-device-airplanemode-off:before {
content: "\e724";
}
.mdi-device-airplanemode-on:before {
content: "\e725";
}
.mdi-device-battery-20:before {
content: "\e726";
}
.mdi-device-battery-30:before {
content: "\e727";
}
.mdi-device-battery-50:before {
content: "\e728";
}
.mdi-device-battery-60:before {
content: "\e729";
}
.mdi-device-battery-80:before {
content: "\e72a";
}
.mdi-device-battery-90:before {
content: "\e72b";
}
.mdi-device-battery-alert:before {
content: "\e72c";
}
.mdi-device-battery-charging-20:before {
content: "\e72d";
}
.mdi-device-battery-charging-30:before {
content: "\e72e";
}
.mdi-device-battery-charging-50:before {
content: "\e72f";
}
.mdi-device-battery-charging-60:before {
content: "\e730";
}
.mdi-device-battery-charging-80:before {
content: "\e731";
}
.mdi-device-battery-charging-90:before {
content: "\e732";
}
.mdi-device-battery-charging-full:before {
content: "\e733";
}
.mdi-device-battery-full:before {
content: "\e734";
}
.mdi-device-battery-std:before {
content: "\e735";
}
.mdi-device-battery-unknown:before {
content: "\e736";
}
.mdi-device-bluetooth-connected:before {
content: "\e737";
}
.mdi-device-bluetooth-disabled:before {
content: "\e738";
}
.mdi-device-bluetooth-searching:before {
content: "\e739";
}
.mdi-device-bluetooth:before {
content: "\e73a";
}
.mdi-device-brightness-auto:before {
content: "\e73b";
}
.mdi-device-brightness-high:before {
content: "\e73c";
}
.mdi-device-brightness-low:before {
content: "\e73d";
}
.mdi-device-brightness-medium:before {
content: "\e73e";
}
.mdi-device-data-usage:before {
content: "\e73f";
}
.mdi-device-developer-mode:before {
content: "\e740";
}
.mdi-device-devices:before {
content: "\e741";
}
.mdi-device-dvr:before {
content: "\e742";
}
.mdi-device-gps-fixed:before {
content: "\e743";
}
.mdi-device-gps-not-fixed:before {
content: "\e744";
}
.mdi-device-gps-off:before {
content: "\e745";
}
.mdi-device-location-disabled:before {
content: "\e746";
}
.mdi-device-location-searching:before {
content: "\e747";
}
.mdi-device-multitrack-audio:before {
content: "\e748";
}
.mdi-device-network-cell:before {
content: "\e749";
}
.mdi-device-network-wifi:before {
content: "\e74a";
}
.mdi-device-nfc:before {
content: "\e74b";
}
.mdi-device-now-wallpaper:before {
content: "\e74c";
}
.mdi-device-now-widgets:before {
content: "\e74d";
}
.mdi-device-screen-lock-landscape:before {
content: "\e74e";
}
.mdi-device-screen-lock-portrait:before {
content: "\e74f";
}
.mdi-device-screen-lock-rotation:before {
content: "\e750";
}
.mdi-device-screen-rotation:before {
content: "\e751";
}
.mdi-device-sd-storage:before {
content: "\e752";
}
.mdi-device-settings-system-daydream:before {
content: "\e753";
}
.mdi-device-signal-cellular-0-bar:before {
content: "\e754";
}
.mdi-device-signal-cellular-1-bar:before {
content: "\e755";
}
.mdi-device-signal-cellular-2-bar:before {
content: "\e756";
}
.mdi-device-signal-cellular-3-bar:before {
content: "\e757";
}
.mdi-device-signal-cellular-4-bar:before {
content: "\e758";
}
.mdi-signal-wifi-statusbar-connected-no-internet-after:before {
content: "\e8f6";
}
.mdi-device-signal-cellular-connected-no-internet-0-bar:before {
content: "\e759";
}
.mdi-device-signal-cellular-connected-no-internet-1-bar:before {
content: "\e75a";
}
.mdi-device-signal-cellular-connected-no-internet-2-bar:before {
content: "\e75b";
}
.mdi-device-signal-cellular-connected-no-internet-3-bar:before {
content: "\e75c";
}
.mdi-device-signal-cellular-connected-no-internet-4-bar:before {
content: "\e75d";
}
.mdi-device-signal-cellular-no-sim:before {
content: "\e75e";
}
.mdi-device-signal-cellular-null:before {
content: "\e75f";
}
.mdi-device-signal-cellular-off:before {
content: "\e760";
}
.mdi-device-signal-wifi-0-bar:before {
content: "\e761";
}
.mdi-device-signal-wifi-1-bar:before {
content: "\e762";
}
.mdi-device-signal-wifi-2-bar:before {
content: "\e763";
}
.mdi-device-signal-wifi-3-bar:before {
content: "\e764";
}
.mdi-device-signal-wifi-4-bar:before {
content: "\e765";
}
.mdi-device-signal-wifi-off:before {
content: "\e766";
}
.mdi-device-signal-wifi-statusbar-1-bar:before {
content: "\e767";
}
.mdi-device-signal-wifi-statusbar-2-bar:before {
content: "\e768";
}
.mdi-device-signal-wifi-statusbar-3-bar:before {
content: "\e769";
}
.mdi-device-signal-wifi-statusbar-4-bar:before {
content: "\e76a";
}
.mdi-device-signal-wifi-statusbar-connected-no-internet-:before {
content: "\e76b";
}
.mdi-device-signal-wifi-statusbar-connected-no-internet:before {
content: "\e76f";
}
.mdi-device-signal-wifi-statusbar-connected-no-internet-2:before {
content: "\e76c";
}
.mdi-device-signal-wifi-statusbar-connected-no-internet-3:before {
content: "\e76d";
}
.mdi-device-signal-wifi-statusbar-connected-no-internet-4:before {
content: "\e76e";
}
.mdi-signal-wifi-statusbar-not-connected-after:before {
content: "\e8f7";
}
.mdi-device-signal-wifi-statusbar-not-connected:before {
content: "\e770";
}
.mdi-device-signal-wifi-statusbar-null:before {
content: "\e771";
}
.mdi-device-storage:before {
content: "\e772";
}
.mdi-device-usb:before {
content: "\e773";
}
.mdi-device-wifi-lock:before {
content: "\e774";
}
.mdi-device-wifi-tethering:before {
content: "\e775";
}
.mdi-hardware-cast-connected:before {
content: "\e7b7";
}
.mdi-hardware-cast:before {
content: "\e7b8";
}
.mdi-hardware-computer:before {
content: "\e7b9";
}
.mdi-hardware-desktop-mac:before {
content: "\e7ba";
}
.mdi-hardware-desktop-windows:before {
content: "\e7bb";
}
.mdi-hardware-dock:before {
content: "\e7bc";
}
.mdi-hardware-gamepad:before {
content: "\e7bd";
}
.mdi-hardware-headset-mic:before {
content: "\e7be";
}
.mdi-hardware-headset:before {
content: "\e7bf";
}
.mdi-hardware-keyboard-alt:before {
content: "\e7c0";
}
.mdi-hardware-keyboard-arrow-down:before {
content: "\e7c1";
}
.mdi-hardware-keyboard-arrow-left:before {
content: "\e7c2";
}
.mdi-hardware-keyboard-arrow-right:before {
content: "\e7c3";
}
.mdi-hardware-keyboard-arrow-up:before {
content: "\e7c4";
}
.mdi-hardware-keyboard-backspace:before {
content: "\e7c5";
}
.mdi-hardware-keyboard-capslock:before {
content: "\e7c6";
}
.mdi-hardware-keyboard-control:before {
content: "\e7c7";
}
.mdi-hardware-keyboard-hide:before {
content: "\e7c8";
}
.mdi-hardware-keyboard-return:before {
content: "\e7c9";
}
.mdi-hardware-keyboard-tab:before {
content: "\e7ca";
}
.mdi-hardware-keyboard-voice:before {
content: "\e7cb";
}
.mdi-hardware-keyboard:before {
content: "\e7cc";
}
.mdi-hardware-laptop-chromebook:before {
content: "\e7cd";
}
.mdi-hardware-laptop-mac:before {
content: "\e7ce";
}
.mdi-hardware-laptop-windows:before {
content: "\e7cf";
}
.mdi-hardware-laptop:before {
content: "\e7d0";
}
.mdi-hardware-memory:before {
content: "\e7d1";
}
.mdi-hardware-mouse:before {
content: "\e7d2";
}
.mdi-hardware-phone-android:before {
content: "\e7d3";
}
.mdi-hardware-phone-iphone:before {
content: "\e7d4";
}
.mdi-hardware-phonelink-off:before {
content: "\e7d5";
}
.mdi-hardware-phonelink:before {
content: "\e7d6";
}
.mdi-hardware-security:before {
content: "\e7d7";
}
.mdi-hardware-sim-card:before {
content: "\e7d8";
}
.mdi-hardware-smartphone:before {
content: "\e7d9";
}
.mdi-hardware-speaker:before {
content: "\e7da";
}
.mdi-hardware-tablet-android:before {
content: "\e7db";
}
.mdi-hardware-tablet-mac:before {
content: "\e7dc";
}
.mdi-hardware-tablet:before {
content: "\e7dd";
}
.mdi-hardware-tv:before {
content: "\e7de";
}
.mdi-hardware-watch:before {
content: "\e7df";
}
.mdi-image-add-to-photos:before {
content: "\e7e0";
}
.mdi-image-adjust:before {
content: "\e7e1";
}
.mdi-image-assistant-photo:before {
content: "\e7e2";
}
.mdi-image-audiotrack:before {
content: "\e7e3";
}
.mdi-image-blur-circular:before {
content: "\e7e4";
}
.mdi-image-blur-linear:before {
content: "\e7e5";
}
.mdi-image-blur-off:before {
content: "\e7e6";
}
.mdi-image-blur-on:before {
content: "\e7e7";
}
.mdi-image-brightness-1:before {
content: "\e7e8";
}
.mdi-image-brightness-2:before {
content: "\e7e9";
}
.mdi-image-brightness-3:before {
content: "\e7ea";
}
.mdi-image-brightness-4:before {
content: "\e7eb";
}
.mdi-image-brightness-5:before {
content: "\e7ec";
}
.mdi-image-brightness-6:before {
content: "\e7ed";
}
.mdi-image-brightness-7:before {
content: "\e7ee";
}
.mdi-image-brush:before {
content: "\e7ef";
}
.mdi-image-camera-alt:before {
content: "\e7f0";
}
.mdi-image-camera-front:before {
content: "\e7f1";
}
.mdi-image-camera-rear:before {
content: "\e7f2";
}
.mdi-image-camera-roll:before {
content: "\e7f3";
}
.mdi-image-camera:before {
content: "\e7f4";
}
.mdi-image-center-focus-strong:before {
content: "\e7f5";
}
.mdi-image-center-focus-weak:before {
content: "\e7f6";
}
.mdi-image-collections:before {
content: "\e7f7";
}
.mdi-image-color-lens:before {
content: "\e7f8";
}
.mdi-image-colorize:before {
content: "\e7f9";
}
.mdi-image-compare:before {
content: "\e7fa";
}
.mdi-image-control-point-duplicate:before {
content: "\e7fb";
}
.mdi-image-control-point:before {
content: "\e7fc";
}
.mdi-image-crop-3-2:before {
content: "\e7fd";
}
.mdi-image-crop-5-4:before {
content: "\e7fe";
}
.mdi-image-crop-7-5:before {
content: "\e7ff";
}
.mdi-image-crop-16-9:before {
content: "\e800";
}
.mdi-image-crop-din:before {
content: "\e801";
}
.mdi-image-crop-free:before {
content: "\e802";
}
.mdi-image-crop-landscape:before {
content: "\e803";
}
.mdi-image-crop-original:before {
content: "\e804";
}
.mdi-image-crop-portrait:before {
content: "\e805";
}
.mdi-image-crop-square:before {
content: "\e806";
}
.mdi-image-crop:before {
content: "\e807";
}
.mdi-image-dehaze:before {
content: "\e808";
}
.mdi-image-details:before {
content: "\e809";
}
.mdi-image-edit:before {
content: "\e80a";
}
.mdi-image-exposure-minus-1:before {
content: "\e80b";
}
.mdi-image-exposure-minus-2:before {
content: "\e80c";
}
.mdi-image-exposure-plus-1:before {
content: "\e80d";
}
.mdi-image-exposure-plus-2:before {
content: "\e80e";
}
.mdi-image-exposure-zero:before {
content: "\e80f";
}
.mdi-image-exposure:before {
content: "\e810";
}
.mdi-image-filter-1:before {
content: "\e811";
}
.mdi-image-filter-2:before {
content: "\e812";
}
.mdi-image-filter-3:before {
content: "\e813";
}
.mdi-image-filter-4:before {
content: "\e814";
}
.mdi-image-filter-5:before {
content: "\e815";
}
.mdi-image-filter-6:before {
content: "\e816";
}
.mdi-image-filter-7:before {
content: "\e817";
}
.mdi-image-filter-8:before {
content: "\e818";
}
.mdi-image-filter-9-plus:before {
content: "\e819";
}
.mdi-image-filter-9:before {
content: "\e81a";
}
.mdi-image-filter-b-and-w:before {
content: "\e81b";
}
.mdi-image-filter-center-focus:before {
content: "\e81c";
}
.mdi-image-filter-drama:before {
content: "\e81d";
}
.mdi-image-filter-frames:before {
content: "\e81e";
}
.mdi-image-filter-hdr:before {
content: "\e81f";
}
.mdi-image-filter-none:before {
content: "\e820";
}
.mdi-image-filter-tilt-shift:before {
content: "\e821";
}
.mdi-image-filter-vintage:before {
content: "\e822";
}
.mdi-image-filter:before {
content: "\e823";
}
.mdi-image-flare:before {
content: "\e824";
}
.mdi-image-flash-auto:before {
content: "\e825";
}
.mdi-image-flash-off:before {
content: "\e826";
}
.mdi-image-flash-on:before {
content: "\e827";
}
.mdi-image-flip:before {
content: "\e828";
}
.mdi-image-gradient:before {
content: "\e829";
}
.mdi-image-grain:before {
content: "\e82a";
}
.mdi-image-grid-off:before {
content: "\e82b";
}
.mdi-image-grid-on:before {
content: "\e82c";
}
.mdi-image-hdr-off:before {
content: "\e82d";
}
.mdi-image-hdr-on:before {
content: "\e82e";
}
.mdi-image-hdr-strong:before {
content: "\e82f";
}
.mdi-image-hdr-weak:before {
content: "\e830";
}
.mdi-image-healing:before {
content: "\e831";
}
.mdi-image-image-aspect-ratio:before {
content: "\e832";
}
.mdi-image-image:before {
content: "\e833";
}
.mdi-image-iso:before {
content: "\e834";
}
.mdi-image-landscape:before {
content: "\e835";
}
.mdi-image-leak-add:before {
content: "\e836";
}
.mdi-image-leak-remove:before {
content: "\e837";
}
.mdi-image-lens:before {
content: "\e838";
}
.mdi-image-looks-3:before {
content: "\e839";
}
.mdi-image-looks-4:before {
content: "\e83a";
}
.mdi-image-looks-5:before {
content: "\e83b";
}
.mdi-image-looks-6:before {
content: "\e83c";
}
.mdi-image-looks-one:before {
content: "\e83d";
}
.mdi-image-looks-two:before {
content: "\e83e";
}
.mdi-image-looks:before {
content: "\e83f";
}
.mdi-image-loupe:before {
content: "\e840";
}
.mdi-image-movie-creation:before {
content: "\e841";
}
.mdi-image-nature-people:before {
content: "\e842";
}
.mdi-image-nature:before {
content: "\e843";
}
.mdi-image-navigate-before:before {
content: "\e844";
}
.mdi-image-navigate-next:before {
content: "\e845";
}
.mdi-image-palette:before {
content: "\e846";
}
.mdi-image-panorama-fisheye:before {
content: "\e847";
}
.mdi-image-panorama-horizontal:before {
content: "\e848";
}
.mdi-image-panorama-vertical:before {
content: "\e849";
}
.mdi-image-panorama-wide-angle:before {
content: "\e84a";
}
.mdi-image-panorama:before {
content: "\e84b";
}
.mdi-image-photo-album:before {
content: "\e84c";
}
.mdi-image-photo-camera:before {
content: "\e84d";
}
.mdi-image-photo-library:before {
content: "\e84e";
}
.mdi-image-photo:before {
content: "\e84f";
}
.mdi-image-portrait:before {
content: "\e850";
}
.mdi-image-remove-red-eye:before {
content: "\e851";
}
.mdi-image-rotate-left:before {
content: "\e852";
}
.mdi-image-rotate-right:before {
content: "\e853";
}
.mdi-image-slideshow:before {
content: "\e854";
}
.mdi-image-straighten:before {
content: "\e855";
}
.mdi-image-style:before {
content: "\e856";
}
.mdi-image-switch-camera:before {
content: "\e857";
}
.mdi-image-switch-video:before {
content: "\e858";
}
.mdi-image-tag-faces:before {
content: "\e859";
}
.mdi-image-texture:before {
content: "\e85a";
}
.mdi-image-timelapse:before {
content: "\e85b";
}
.mdi-image-timer-3:before {
content: "\e85c";
}
.mdi-image-timer-10:before {
content: "\e85d";
}
.mdi-image-timer-auto:before {
content: "\e85e";
}
.mdi-image-timer-off:before {
content: "\e85f";
}
.mdi-image-timer:before {
content: "\e860";
}
.mdi-image-tonality:before {
content: "\e861";
}
.mdi-image-transform:before {
content: "\e862";
}
.mdi-image-tune:before {
content: "\e863";
}
.mdi-image-wb-auto:before {
content: "\e864";
}
.mdi-image-wb-cloudy:before {
content: "\e865";
}
.mdi-image-wb-incandescent:before {
content: "\e866";
}
.mdi-image-wb-irradescent:before {
content: "\e867";
}
.mdi-image-wb-sunny:before {
content: "\e868";
}
.mdi-maps-beenhere:before {
content: "\e869";
}
.mdi-maps-directions-bike:before {
content: "\e86a";
}
.mdi-maps-directions-bus:before {
content: "\e86b";
}
.mdi-maps-directions-car:before {
content: "\e86c";
}
.mdi-maps-directions-ferry:before {
content: "\e86d";
}
.mdi-maps-directions-subway:before {
content: "\e86e";
}
.mdi-maps-directions-train:before {
content: "\e86f";
}
.mdi-maps-directions-transit:before {
content: "\e870";
}
.mdi-maps-directions-walk:before {
content: "\e871";
}
.mdi-maps-directions:before {
content: "\e872";
}
.mdi-maps-flight:before {
content: "\e873";
}
.mdi-maps-hotel:before {
content: "\e874";
}
.mdi-maps-layers-clear:before {
content: "\e875";
}
.mdi-maps-layers:before {
content: "\e876";
}
.mdi-maps-local-airport:before {
content: "\e877";
}
.mdi-maps-local-atm:before {
content: "\e878";
}
.mdi-maps-local-attraction:before {
content: "\e879";
}
.mdi-maps-local-bar:before {
content: "\e87a";
}
.mdi-maps-local-cafe:before {
content: "\e87b";
}
.mdi-maps-local-car-wash:before {
content: "\e87c";
}
.mdi-maps-local-convenience-store:before {
content: "\e87d";
}
.mdi-maps-local-drink:before {
content: "\e87e";
}
.mdi-maps-local-florist:before {
content: "\e87f";
}
.mdi-maps-local-gas-station:before {
content: "\e880";
}
.mdi-maps-local-grocery-store:before {
content: "\e881";
}
.mdi-maps-local-hospital:before {
content: "\e882";
}
.mdi-maps-local-hotel:before {
content: "\e883";
}
.mdi-maps-local-laundry-service:before {
content: "\e884";
}
.mdi-maps-local-library:before {
content: "\e885";
}
.mdi-maps-local-mall:before {
content: "\e886";
}
.mdi-maps-local-movies:before {
content: "\e887";
}
.mdi-maps-local-offer:before {
content: "\e888";
}
.mdi-maps-local-parking:before {
content: "\e889";
}
.mdi-maps-local-pharmacy:before {
content: "\e88a";
}
.mdi-maps-local-phone:before {
content: "\e88b";
}
.mdi-maps-local-pizza:before {
content: "\e88c";
}
.mdi-maps-local-play:before {
content: "\e88d";
}
.mdi-maps-local-post-office:before {
content: "\e88e";
}
.mdi-maps-local-print-shop:before {
content: "\e88f";
}
.mdi-maps-local-restaurant:before {
content: "\e890";
}
.mdi-maps-local-see:before {
content: "\e891";
}
.mdi-maps-local-shipping:before {
content: "\e892";
}
.mdi-maps-local-taxi:before {
content: "\e893";
}
.mdi-maps-location-history:before {
content: "\e894";
}
.mdi-maps-map:before {
content: "\e895";
}
.mdi-maps-my-location:before {
content: "\e896";
}
.mdi-maps-navigation:before {
content: "\e897";
}
.mdi-maps-pin-drop:before {
content: "\e898";
}
.mdi-maps-place:before {
content: "\e899";
}
.mdi-maps-rate-review:before {
content: "\e89a";
}
.mdi-maps-restaurant-menu:before {
content: "\e89b";
}
.mdi-maps-satellite:before {
content: "\e89c";
}
.mdi-maps-store-mall-directory:before {
content: "\e89d";
}
.mdi-maps-terrain:before {
content: "\e89e";
}
.mdi-maps-traffic:before {
content: "\e89f";
}
.mdi-navigation-apps:before {
content: "\e8a0";
}
.mdi-navigation-arrow-back:before {
content: "\e8a1";
}
.mdi-navigation-arrow-drop-down-circle:before {
content: "\e8a2";
}
.mdi-navigation-arrow-drop-down:before {
content: "\e8a3";
}
.mdi-navigation-arrow-drop-up:before {
content: "\e8a4";
}
.mdi-navigation-arrow-forward:before {
content: "\e8a5";
}
.mdi-navigation-cancel:before {
content: "\e8a6";
}
.mdi-navigation-check:before {
content: "\e8a7";
}
.mdi-navigation-chevron-left:before {
content: "\e8a8";
}
.mdi-navigation-chevron-right:before {
content: "\e8a9";
}
.mdi-navigation-close:before {
content: "\e8aa";
}
.mdi-navigation-expand-less:before {
content: "\e8ab";
}
.mdi-navigation-expand-more:before {
content: "\e8ac";
}
.mdi-navigation-fullscreen-exit:before {
content: "\e8ad";
}
.mdi-navigation-fullscreen:before {
content: "\e8ae";
}
.mdi-navigation-menu:before {
content: "\e8af";
}
.mdi-navigation-more-horiz:before {
content: "\e8b0";
}
.mdi-navigation-more-vert:before {
content: "\e8b1";
}
.mdi-navigation-refresh:before {
content: "\e8b2";
}
.mdi-navigation-unfold-less:before {
content: "\e8b3";
}
.mdi-navigation-unfold-more:before {
content: "\e8b4";
}
.mdi-notification-adb:before {
content: "\e8b5";
}
.mdi-notification-bluetooth-audio:before {
content: "\e8b6";
}
.mdi-notification-disc-full:before {
content: "\e8b7";
}
.mdi-notification-dnd-forwardslash:before {
content: "\e8b8";
}
.mdi-notification-do-not-disturb:before {
content: "\e8b9";
}
.mdi-notification-drive-eta:before {
content: "\e8ba";
}
.mdi-notification-event-available:before {
content: "\e8bb";
}
.mdi-notification-event-busy:before {
content: "\e8bc";
}
.mdi-notification-event-note:before {
content: "\e8bd";
}
.mdi-notification-folder-special:before {
content: "\e8be";
}
.mdi-notification-mms:before {
content: "\e8bf";
}
.mdi-notification-more:before {
content: "\e8c0";
}
.mdi-notification-network-locked:before {
content: "\e8c1";
}
.mdi-notification-phone-bluetooth-speaker:before {
content: "\e8c2";
}
.mdi-notification-phone-forwarded:before {
content: "\e8c3";
}
.mdi-notification-phone-in-talk:before {
content: "\e8c4";
}
.mdi-notification-phone-locked:before {
content: "\e8c5";
}
.mdi-notification-phone-missed:before {
content: "\e8c6";
}
.mdi-notification-phone-paused:before {
content: "\e8c7";
}
.mdi-notification-play-download:before {
content: "\e8c8";
}
.mdi-notification-play-install:before {
content: "\e8c9";
}
.mdi-notification-sd-card:before {
content: "\e8ca";
}
.mdi-notification-sim-card-alert:before {
content: "\e8cb";
}
.mdi-notification-sms-failed:before {
content: "\e8cc";
}
.mdi-notification-sms:before {
content: "\e8cd";
}
.mdi-notification-sync-disabled:before {
content: "\e8ce";
}
.mdi-notification-sync-problem:before {
content: "\e8cf";
}
.mdi-notification-sync:before {
content: "\e8d0";
}
.mdi-notification-system-update:before {
content: "\e8d1";
}
.mdi-notification-tap-and-play:before {
content: "\e8d2";
}
.mdi-notification-time-to-leave:before {
content: "\e8d3";
}
.mdi-notification-vibration:before {
content: "\e8d4";
}
.mdi-notification-voice-chat:before {
content: "\e8d5";
}
.mdi-notification-vpn-lock:before {
content: "\e8d6";
}
.mdi-social-cake:before {
content: "\e8d7";
}
.mdi-social-domain:before {
content: "\e8d8";
}
.mdi-social-group-add:before {
content: "\e8d9";
}
.mdi-social-group:before {
content: "\e8da";
}
.mdi-social-location-city:before {
content: "\e8db";
}
.mdi-social-mood:before {
content: "\e8dc";
}
.mdi-social-notifications-none:before {
content: "\e8dd";
}
.mdi-social-notifications-off:before {
content: "\e8de";
}
.mdi-social-notifications-on:before {
content: "\e8df";
}
.mdi-social-notifications-paused:before {
content: "\e8e0";
}
.mdi-social-notifications:before {
content: "\e8e1";
}
.mdi-social-pages:before {
content: "\e8e2";
}
.mdi-social-party-mode:before {
content: "\e8e3";
}
.mdi-social-people-outline:before {
content: "\e8e4";
}
.mdi-social-people:before {
content: "\e8e5";
}
.mdi-social-person-add:before {
content: "\e8e6";
}
.mdi-social-person-outline:before {
content: "\e8e7";
}
.mdi-social-person:before {
content: "\e8e8";
}
.mdi-social-plus-one:before {
content: "\e8e9";
}
.mdi-social-poll:before {
content: "\e8ea";
}
.mdi-social-publ24px:before {
content: "\e8eb";
}
.mdi-social-school:before {
content: "\e8ec";
}
.mdi-social-share:before {
content: "\e8ed";
}
.mdi-social-whatshot:before {
content: "\e8ee";
}
.mdi-toggle-check-box-outline-blank:before {
content: "\e8ef";
}
.mdi-toggle-check-box:before {
content: "\e8f0";
}
.mdi-toggle-radio-button-off:before {
content: "\e8f1";
}
.mdi-toggle-radio-button-on:before {
content: "\e8f2";
}
.mdi-toggle-star-half:before {
content: "\e8f3";
}
.mdi-toggle-star-outline:before {
content: "\e8f4";
}
.mdi-toggle-star:before {
content: "\e8f5";
}
body {
background-color: #eeeeee;
}
body.inverse {
background: #333333;
}
body.inverse,
body.inverse .form-control {
color: rgba(255, 255, 255, 0.84);
}
body.inverse .modal,
body.inverse .panel-default,
body.inverse .card,
body.inverse .modal .form-control,
body.inverse .panel-default .form-control,
body.inverse .card .form-control {
background-color: initial;
color: initial;
}
body,
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4 {
font-family: "RobotoDraft", "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 300;
}
h5,
h6 {
font-weight: 400;
}
a,
a:hover,
a:focus {
color: #009688;
}
body .well,
.container .well,
.container-fluid .well,
body .well:not([class^="well well-material-"]),
.container .well:not([class^="well well-material-"]),
.container-fluid .well:not([class^="well well-material-"]),
body .well .form-control,
.container .well .form-control,
.container-fluid .well .form-control,
body .well:not([class^="well well-material-"]) .form-control,
.container .well:not([class^="well well-material-"]) .form-control,
.container-fluid .well:not([class^="well well-material-"]) .form-control {
color: rgba(0, 0, 0, 0.84);
}
body .well .floating-label,
.container .well .floating-label,
.container-fluid .well .floating-label,
body .well:not([class^="well well-material-"]) .floating-label,
.container .well:not([class^="well well-material-"]) .floating-label,
.container-fluid .well:not([class^="well well-material-"]) .floating-label {
color: #7e7e7e;
}
body .well .form-control::-webkit-input-placeholder,
.container .well .form-control::-webkit-input-placeholder,
.container-fluid .well .form-control::-webkit-input-placeholder,
body .well:not([class^="well well-material-"]) .form-control::-webkit-input-placeholder,
.container .well:not([class^="well well-material-"]) .form-control::-webkit-input-placeholder,
.container-fluid .well:not([class^="well well-material-"]) .form-control::-webkit-input-placeholder {
color: #7e7e7e;
}
body .well .form-control::-moz-placeholder,
.container .well .form-control::-moz-placeholder,
.container-fluid .well .form-control::-moz-placeholder,
body .well:not([class^="well well-material-"]) .form-control::-moz-placeholder,
.container .well:not([class^="well well-material-"]) .form-control::-moz-placeholder,
.container-fluid .well:not([class^="well well-material-"]) .form-control::-moz-placeholder {
color: #7e7e7e;
opacity: 1;
}
body .well .form-control:-ms-input-placeholder,
.container .well .form-control:-ms-input-placeholder,
.container-fluid .well .form-control:-ms-input-placeholder,
body .well:not([class^="well well-material-"]) .form-control:-ms-input-placeholder,
.container .well:not([class^="well well-material-"]) .form-control:-ms-input-placeholder,
.container-fluid .well:not([class^="well well-material-"]) .form-control:-ms-input-placeholder {
color: #7e7e7e;
}
body .well .option,
.container .well .option,
.container-fluid .well .option,
body .well:not([class^="well well-material-"]) .option,
.container .well:not([class^="well well-material-"]) .option,
.container-fluid .well:not([class^="well well-material-"]) .option,
body .well .create,
.container .well .create,
.container-fluid .well .create,
body .well:not([class^="well well-material-"]) .create,
.container .well:not([class^="well well-material-"]) .create,
.container-fluid .well:not([class^="well well-material-"]) .create {
color: rgba(0, 0, 0, 0.84);
}
body .well.well-sm,
.container .well.well-sm,
.container-fluid .well.well-sm {
padding: 10px;
}
body .well.well-lg,
.container .well.well-lg,
.container-fluid .well.well-lg {
padding: 26px;
}
body [class^="well well-material-"],
.container [class^="well well-material-"],
.container-fluid [class^="well well-material-"],
body [class^="well well-material-"] .form-control,
.container [class^="well well-material-"] .form-control,
.container-fluid [class^="well well-material-"] .form-control,
body [class^="well well-material-"] .floating-label,
.container [class^="well well-material-"] .floating-label,
.container-fluid [class^="well well-material-"] .floating-label {
color: rgba(255, 255, 255, 0.84);
}
body [class^="well well-material-"] .form-control,
.container [class^="well well-material-"] .form-control,
.container-fluid [class^="well well-material-"] .form-control {
border-bottom-color: rgba(255, 255, 255, 0.84);
}
body [class^="well well-material-"] .form-control::-webkit-input-placeholder,
.container [class^="well well-material-"] .form-control::-webkit-input-placeholder,
.container-fluid [class^="well well-material-"] .form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
body [class^="well well-material-"] .form-control::-moz-placeholder,
.container [class^="well well-material-"] .form-control::-moz-placeholder,
.container-fluid [class^="well well-material-"] .form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
opacity: 1;
}
body [class^="well well-material-"] .form-control:-ms-input-placeholder,
.container [class^="well well-material-"] .form-control:-ms-input-placeholder,
.container-fluid [class^="well well-material-"] .form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
body [class^="well well-material-"] .option,
.container [class^="well well-material-"] .option,
.container-fluid [class^="well well-material-"] .option,
body [class^="well well-material-"] .create,
.container [class^="well well-material-"] .create,
.container-fluid [class^="well well-material-"] .create {
color: rgba(0, 0, 0, 0.84);
}
body .well,
.container .well,
.container-fluid .well,
body .jumbotron,
.container .jumbotron,
.container-fluid .jumbotron {
background-color: #fff;
padding: 19px;
margin-bottom: 20px;
box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-radius: 2px;
border: 0;
}
body .well p,
.container .well p,
.container-fluid .well p,
body .jumbotron p,
.container .jumbotron p,
.container-fluid .jumbotron p {
font-weight: 300;
}
body .well,
.container .well,
.container-fluid .well,
body .jumbotron,
.container .jumbotron,
.container-fluid .jumbotron,
body .well-default,
.container .well-default,
.container-fluid .well-default,
body .jumbotron-default,
.container .jumbotron-default,
.container-fluid .jumbotron-default {
background-color: #ffffff;
}
body .well-black,
.container .well-black,
.container-fluid .well-black,
body .jumbotron-black,
.container .jumbotron-black,
.container-fluid .jumbotron-black {
background-color: #000000;
}
body .well-white,
.container .well-white,
.container-fluid .well-white,
body .jumbotron-white,
.container .jumbotron-white,
.container-fluid .jumbotron-white {
background-color: #ffffff;
}
body .well-inverse,
.container .well-inverse,
.container-fluid .well-inverse,
body .jumbotron-inverse,
.container .jumbotron-inverse,
.container-fluid .jumbotron-inverse {
background-color: #3f51b5;
}
body .well-primary,
.container .well-primary,
.container-fluid .well-primary,
body .jumbotron-primary,
.container .jumbotron-primary,
.container-fluid .jumbotron-primary {
background-color: #009688;
}
body .well-success,
.container .well-success,
.container-fluid .well-success,
body .jumbotron-success,
.container .jumbotron-success,
.container-fluid .jumbotron-success {
background-color: #4caf50;
}
body .well-info,
.container .well-info,
.container-fluid .well-info,
body .jumbotron-info,
.container .jumbotron-info,
.container-fluid .jumbotron-info {
background-color: #03a9f4;
}
body .well-warning,
.container .well-warning,
.container-fluid .well-warning,
body .jumbotron-warning,
.container .jumbotron-warning,
.container-fluid .jumbotron-warning {
background-color: #ff5722;
}
body .well-danger,
.container .well-danger,
.container-fluid .well-danger,
body .jumbotron-danger,
.container .jumbotron-danger,
.container-fluid .jumbotron-danger {
background-color: #f44336;
}
body .well-material-red,
.container .well-material-red,
.container-fluid .well-material-red,
body .jumbotron-material-red,
.container .jumbotron-material-red,
.container-fluid .jumbotron-material-red {
background-color: #f44336;
}
body .well-material-pink,
.container .well-material-pink,
.container-fluid .well-material-pink,
body .jumbotron-material-pink,
.container .jumbotron-material-pink,
.container-fluid .jumbotron-material-pink {
background-color: #e91e63;
}
body .well-material-purple,
.container .well-material-purple,
.container-fluid .well-material-purple,
body .jumbotron-material-purple,
.container .jumbotron-material-purple,
.container-fluid .jumbotron-material-purple {
background-color: #9c27b0;
}
body .well-material-deep-purple,
.container .well-material-deep-purple,
.container-fluid .well-material-deep-purple,
body .jumbotron-material-deep-purple,
.container .jumbotron-material-deep-purple,
.container-fluid .jumbotron-material-deep-purple {
background-color: #673ab7;
}
body .well-material-indigo,
.container .well-material-indigo,
.container-fluid .well-material-indigo,
body .jumbotron-material-indigo,
.container .jumbotron-material-indigo,
.container-fluid .jumbotron-material-indigo {
background-color: #3f51b5;
}
body .well-material-blue,
.container .well-material-blue,
.container-fluid .well-material-blue,
body .jumbotron-material-blue,
.container .jumbotron-material-blue,
.container-fluid .jumbotron-material-blue {
background-color: #2196f3;
}
body .well-material-light-blue,
.container .well-material-light-blue,
.container-fluid .well-material-light-blue,
body .jumbotron-material-light-blue,
.container .jumbotron-material-light-blue,
.container-fluid .jumbotron-material-light-blue {
background-color: #03a9f4;
}
body .well-material-cyan,
.container .well-material-cyan,
.container-fluid .well-material-cyan,
body .jumbotron-material-cyan,
.container .jumbotron-material-cyan,
.container-fluid .jumbotron-material-cyan {
background-color: #00bcd4;
}
body .well-material-teal,
.container .well-material-teal,
.container-fluid .well-material-teal,
body .jumbotron-material-teal,
.container .jumbotron-material-teal,
.container-fluid .jumbotron-material-teal {
background-color: #009688;
}
body .well-material-green,
.container .well-material-green,
.container-fluid .well-material-green,
body .jumbotron-material-green,
.container .jumbotron-material-green,
.container-fluid .jumbotron-material-green {
background-color: #4caf50;
}
body .well-material-light-green,
.container .well-material-light-green,
.container-fluid .well-material-light-green,
body .jumbotron-material-light-green,
.container .jumbotron-material-light-green,
.container-fluid .jumbotron-material-light-green {
background-color: #8bc34a;
}
body .well-material-lime,
.container .well-material-lime,
.container-fluid .well-material-lime,
body .jumbotron-material-lime,
.container .jumbotron-material-lime,
.container-fluid .jumbotron-material-lime {
background-color: #cddc39;
}
body .well-material-yellow,
.container .well-material-yellow,
.container-fluid .well-material-yellow,
body .jumbotron-material-yellow,
.container .jumbotron-material-yellow,
.container-fluid .jumbotron-material-yellow {
background-color: #ffeb3b;
}
body .well-material-amber,
.container .well-material-amber,
.container-fluid .well-material-amber,
body .jumbotron-material-amber,
.container .jumbotron-material-amber,
.container-fluid .jumbotron-material-amber {
background-color: #ffc107;
}
body .well-material-orange,
.container .well-material-orange,
.container-fluid .well-material-orange,
body .jumbotron-material-orange,
.container .jumbotron-material-orange,
.container-fluid .jumbotron-material-orange {
background-color: #ff9800;
}
body .well-material-deep-orange,
.container .well-material-deep-orange,
.container-fluid .well-material-deep-orange,
body .jumbotron-material-deep-orange,
.container .jumbotron-material-deep-orange,
.container-fluid .jumbotron-material-deep-orange {
background-color: #ff5722;
}
body .well-material-brown,
.container .well-material-brown,
.container-fluid .well-material-brown,
body .jumbotron-material-brown,
.container .jumbotron-material-brown,
.container-fluid .jumbotron-material-brown {
background-color: #795548;
}
body .well-material-grey,
.container .well-material-grey,
.container-fluid .well-material-grey,
body .jumbotron-material-grey,
.container .jumbotron-material-grey,
.container-fluid .jumbotron-material-grey {
background-color: #9e9e9e;
}
body .well-material-blue-grey,
.container .well-material-blue-grey,
.container-fluid .well-material-blue-grey,
body .jumbotron-material-blue-grey,
.container .jumbotron-material-blue-grey,
.container-fluid .jumbotron-material-blue-grey {
background-color: #607d8b;
}
.btn {
position: relative;
padding: 8px 30px;
border: 0;
margin: 10px 1px;
cursor: pointer;
border-radius: 2px;
text-transform: uppercase;
text-decoration: none;
color: rgba(255, 255, 255, 0.84);
transition: background-color 0.2s ease, box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
outline: none !important;
}
.btn:hover:not(.btn-link):not(.btn-flat):not(.btn-fab) {
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.12), 0 1px 6px 0 rgba(0, 0, 0, 0.12);
}
.btn:active:not(.btn-link):not(.btn-flat):not(.btn-fab) {
box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15);
}
.btn.btn-flat:not(.btn-link),
.btn-default.btn-flat:not(.btn-link) {
color: rgba(0, 0, 0, 0.84);
}
.btn-black.btn-flat:not(.btn-link) {
color: #000000;
}
.btn-white.btn-flat:not(.btn-link) {
color: #ffffff;
}
.btn-inverse.btn-flat:not(.btn-link) {
color: #3f51b5;
}
.btn-primary.btn-flat:not(.btn-link) {
color: #009688;
}
.btn-success.btn-flat:not(.btn-link) {
color: #4caf50;
}
.btn-info.btn-flat:not(.btn-link) {
color: #03a9f4;
}
.btn-warning.btn-flat:not(.btn-link) {
color: #ff5722;
}
.btn-danger.btn-flat:not(.btn-link) {
color: #f44336;
}
.btn-material-red.btn-flat:not(.btn-link) {
color: #f44336;
}
.btn-material-pink.btn-flat:not(.btn-link) {
color: #e91e63;
}
.btn-material-purple.btn-flat:not(.btn-link) {
color: #9c27b0;
}
.btn-material-deep-purple.btn-flat:not(.btn-link) {
color: #673ab7;
}
.btn-material-indigo.btn-flat:not(.btn-link) {
color: #3f51b5;
}
.btn-material-blue.btn-flat:not(.btn-link) {
color: #2196f3;
}
.btn-material-light-blue.btn-flat:not(.btn-link) {
color: #03a9f4;
}
.btn-material-cyan.btn-flat:not(.btn-link) {
color: #00bcd4;
}
.btn-material-teal.btn-flat:not(.btn-link) {
color: #009688;
}
.btn-material-green.btn-flat:not(.btn-link) {
color: #4caf50;
}
.btn-material-light-green.btn-flat:not(.btn-link) {
color: #8bc34a;
}
.btn-material-lime.btn-flat:not(.btn-link) {
color: #cddc39;
}
.btn-material-yellow.btn-flat:not(.btn-link) {
color: #ffeb3b;
}
.btn-material-amber.btn-flat:not(.btn-link) {
color: #ffc107;
}
.btn-material-orange.btn-flat:not(.btn-link) {
color: #ff9800;
}
.btn-material-deep-orange.btn-flat:not(.btn-link) {
color: #ff5722;
}
.btn-material-brown.btn-flat:not(.btn-link) {
color: #795548;
}
.btn-material-grey.btn-flat:not(.btn-link) {
color: #9e9e9e;
}
.btn-material-blue-grey.btn-flat:not(.btn-link) {
color: #607d8b;
}
.btn:not(.btn-link):not(.btn-flat),
.btn-default:not(.btn-link):not(.btn-flat) {
background-color: transparent;
color: rgba(255, 255, 255, 0.84);
color: rgba(0, 0, 0, 0.84);
}
.btn-black:not(.btn-link):not(.btn-flat) {
background-color: #000000;
color: rgba(255, 255, 255, 0.84);
}
.btn-white:not(.btn-link):not(.btn-flat) {
background-color: #ffffff;
color: rgba(0, 0, 0, 0.84);
}
.btn-inverse:not(.btn-link):not(.btn-flat) {
background-color: #3f51b5;
color: rgba(255, 255, 255, 0.84);
}
.btn-primary:not(.btn-link):not(.btn-flat) {
background-color: #009688;
color: rgba(255, 255, 255, 0.84);
}
.btn-success:not(.btn-link):not(.btn-flat) {
background-color: #4caf50;
color: rgba(255, 255, 255, 0.84);
}
.btn-info:not(.btn-link):not(.btn-flat) {
background-color: #03a9f4;
color: rgba(255, 255, 255, 0.84);
}
.btn-warning:not(.btn-link):not(.btn-flat) {
background-color: #ff5722;
color: rgba(255, 255, 255, 0.84);
}
.btn-danger:not(.btn-link):not(.btn-flat) {
background-color: #f44336;
color: rgba(255, 255, 255, 0.84);
}
.btn-material-red:not(.btn-link):not(.btn-flat) {
background-color: #f44336;
color: rgba(255, 255, 255, 0.84);
}
.btn-material-pink:not(.btn-link):not(.btn-flat) {
background-color: #e91e63;
color: rgba(255, 255, 255, 0.84);
}
.btn-material-purple:not(.btn-link):not(.btn-flat) {
background-color: #9c27b0;
color: rgba(255, 255, 255, 0.84);
}
.btn-material-deep-purple:not(.btn-link):not(.btn-flat) {
background-color: #673ab7;
color: rgba(255, 255, 255, 0.84);
}
.btn-material-indigo:not(.btn-link):not(.btn-flat) {
background-color: #3f51b5;
color: rgba(255, 255, 255, 0.84);
}
.btn-material-blue:not(.btn-link):not(.btn-flat) {
background-color: #2196f3;
color: rgba(255, 255, 255, 0.84);
}
.btn-material-light-blue:not(.btn-link):not(.btn-flat) {
background-color: #03a9f4;
color: rgba(255, 255, 255, 0.84);
}
.btn-material-cyan:not(.btn-link):not(.btn-flat) {
background-color: #00bcd4;
color: rgba(0, 0, 0, 0.84);
}
.btn-material-teal:not(.btn-link):not(.btn-flat) {
background-color: #009688;
color: rgba(255, 255, 255, 0.84);
}
.btn-material-green:not(.btn-link):not(.btn-flat) {
background-color: #4caf50;
color: rgba(255, 255, 255, 0.84);
}
.btn-material-light-green:not(.btn-link):not(.btn-flat) {
background-color: #8bc34a;
color: rgba(0, 0, 0, 0.84);
}
.btn-material-lime:not(.btn-link):not(.btn-flat) {
background-color: #cddc39;
color: rgba(0, 0, 0, 0.84);
}
.btn-material-yellow:not(.btn-link):not(.btn-flat) {
background-color: #ffeb3b;
color: rgba(0, 0, 0, 0.84);
}
.btn-material-amber:not(.btn-link):not(.btn-flat) {
background-color: #ffc107;
color: rgba(0, 0, 0, 0.84);
}
.btn-material-orange:not(.btn-link):not(.btn-flat) {
background-color: #ff9800;
color: rgba(0, 0, 0, 0.84);
}
.btn-material-deep-orange:not(.btn-link):not(.btn-flat) {
background-color: #ff5722;
color: rgba(255, 255, 255, 0.84);
}
.btn-material-brown:not(.btn-link):not(.btn-flat) {
background-color: #795548;
color: rgba(255, 255, 255, 0.84);
}
.btn-material-grey:not(.btn-link):not(.btn-flat) {
background-color: #9e9e9e;
color: rgba(255, 255, 255, 0.84);
}
.btn-material-blue-grey:not(.btn-link):not(.btn-flat) {
background-color: #607d8b;
color: rgba(255, 255, 255, 0.84);
}
.btn:hover:not(.btn-link):not(.btn-flat),
.btn-default:hover:not(.btn-link):not(.btn-flat) {
background-color: rgba(10, 10, 10, 0);
}
.btn-black:hover:not(.btn-link):not(.btn-flat) {
background-color: #0a0a0a;
}
.btn-white:hover:not(.btn-link):not(.btn-flat) {
background-color: #f5f5f5;
}
.btn-inverse:hover:not(.btn-link):not(.btn-flat) {
background-color: #495bc0;
}
.btn-primary:hover:not(.btn-link):not(.btn-flat) {
background-color: #00aa9a;
}
.btn-success:hover:not(.btn-link):not(.btn-flat) {
background-color: #59b75c;
}
.btn-info:hover:not(.btn-link):not(.btn-flat) {
background-color: #0fb2fc;
}
.btn-warning:hover:not(.btn-link):not(.btn-flat) {
background-color: #ff6736;
}
.btn-danger:hover:not(.btn-link):not(.btn-flat) {
background-color: #f55549;
}
.btn-material-red:hover:not(.btn-link):not(.btn-flat) {
background-color: #f55549;
}
.btn-material-pink:hover:not(.btn-link):not(.btn-flat) {
background-color: #eb3170;
}
.btn-material-purple:hover:not(.btn-link):not(.btn-flat) {
background-color: #ab2bc1;
}
.btn-material-deep-purple:hover:not(.btn-link):not(.btn-flat) {
background-color: #7142c3;
}
.btn-material-indigo:hover:not(.btn-link):not(.btn-flat) {
background-color: #495bc0;
}
.btn-material-blue:hover:not(.btn-link):not(.btn-flat) {
background-color: #349ff4;
}
.btn-material-light-blue:hover:not(.btn-link):not(.btn-flat) {
background-color: #0fb2fc;
}
.btn-material-cyan:hover:not(.btn-link):not(.btn-flat) {
background-color: #00aac0;
}
.btn-material-teal:hover:not(.btn-link):not(.btn-flat) {
background-color: #00aa9a;
}
.btn-material-green:hover:not(.btn-link):not(.btn-flat) {
background-color: #59b75c;
}
.btn-material-light-green:hover:not(.btn-link):not(.btn-flat) {
background-color: #81bb3e;
}
.btn-material-lime:hover:not(.btn-link):not(.btn-flat) {
background-color: #c9d928;
}
.btn-material-yellow:hover:not(.btn-link):not(.btn-flat) {
background-color: #ffe927;
}
.btn-material-amber:hover:not(.btn-link):not(.btn-flat) {
background-color: #f2b500;
}
.btn-material-orange:hover:not(.btn-link):not(.btn-flat) {
background-color: #eb8c00;
}
.btn-material-deep-orange:hover:not(.btn-link):not(.btn-flat) {
background-color: #ff6736;
}
.btn-material-brown:hover:not(.btn-link):not(.btn-flat) {
background-color: #865e50;
}
.btn-material-grey:hover:not(.btn-link):not(.btn-flat) {
background-color: #a8a8a8;
}
.btn-material-blue-grey:hover:not(.btn-link):not(.btn-flat) {
background-color: #688897;
}
.btn:active:not(.btn-link):not(.btn-flat),
.btn-default:active:not(.btn-link):not(.btn-flat) {
background-color: rgba(15, 15, 15, 0);
}
.btn-black:active:not(.btn-link):not(.btn-flat) {
background-color: #0f0f0f;
}
.btn-white:active:not(.btn-link):not(.btn-flat) {
background-color: #f0f0f0;
}
.btn-inverse:active:not(.btn-link):not(.btn-flat) {
background-color: #5062c2;
}
.btn-primary:active:not(.btn-link):not(.btn-flat) {
background-color: #00b5a4;
}
.btn-success:active:not(.btn-link):not(.btn-flat) {
background-color: #60ba63;
}
.btn-info:active:not(.btn-link):not(.btn-flat) {
background-color: #19b6fc;
}
.btn-warning:active:not(.btn-link):not(.btn-flat) {
background-color: #ff6e41;
}
.btn-danger:active:not(.btn-link):not(.btn-flat) {
background-color: #f65e53;
}
.btn-material-red:active:not(.btn-link):not(.btn-flat) {
background-color: #f65e53;
}
.btn-material-pink:active:not(.btn-link):not(.btn-flat) {
background-color: #ec3a76;
}
.btn-material-purple:active:not(.btn-link):not(.btn-flat) {
background-color: #b22dc9;
}
.btn-material-deep-purple:active:not(.btn-link):not(.btn-flat) {
background-color: #764ac6;
}
.btn-material-indigo:active:not(.btn-link):not(.btn-flat) {
background-color: #5062c2;
}
.btn-material-blue:active:not(.btn-link):not(.btn-flat) {
background-color: #3ea4f5;
}
.btn-material-light-blue:active:not(.btn-link):not(.btn-flat) {
background-color: #19b6fc;
}
.btn-material-cyan:active:not(.btn-link):not(.btn-flat) {
background-color: #00a1b5;
}
.btn-material-teal:active:not(.btn-link):not(.btn-flat) {
background-color: #00b5a4;
}
.btn-material-green:active:not(.btn-link):not(.btn-flat) {
background-color: #60ba63;
}
.btn-material-light-green:active:not(.btn-link):not(.btn-flat) {
background-color: #7cb33b;
}
.btn-material-lime:active:not(.btn-link):not(.btn-flat) {
background-color: #c2d125;
}
.btn-material-yellow:active:not(.btn-link):not(.btn-flat) {
background-color: #ffe81c;
}
.btn-material-amber:active:not(.btn-link):not(.btn-flat) {
background-color: #e7ae00;
}
.btn-material-orange:active:not(.btn-link):not(.btn-flat) {
background-color: #e08600;
}
.btn-material-deep-orange:active:not(.btn-link):not(.btn-flat) {
background-color: #ff6e41;
}
.btn-material-brown:active:not(.btn-link):not(.btn-flat) {
background-color: #8c6253;
}
.btn-material-grey:active:not(.btn-link):not(.btn-flat) {
background-color: #adadad;
}
.btn-material-blue-grey:active:not(.btn-link):not(.btn-flat) {
background-color: #6e8d9b;
}
.btn.active:not(.btn-link):not(.btn-flat),
.btn-default.active:not(.btn-link):not(.btn-flat) {
background-color: rgba(15, 15, 15, 0);
}
.btn-black.active:not(.btn-link):not(.btn-flat) {
background-color: #0f0f0f;
}
.btn-white.active:not(.btn-link):not(.btn-flat) {
background-color: #f0f0f0;
}
.btn-inverse.active:not(.btn-link):not(.btn-flat) {
background-color: #5062c2;
}
.btn-primary.active:not(.btn-link):not(.btn-flat) {
background-color: #00b5a4;
}
.btn-success.active:not(.btn-link):not(.btn-flat) {
background-color: #60ba63;
}
.btn-info.active:not(.btn-link):not(.btn-flat) {
background-color: #19b6fc;
}
.btn-warning.active:not(.btn-link):not(.btn-flat) {
background-color: #ff6e41;
}
.btn-danger.active:not(.btn-link):not(.btn-flat) {
background-color: #f65e53;
}
.btn-material-red.active:not(.btn-link):not(.btn-flat) {
background-color: #f65e53;
}
.btn-material-pink.active:not(.btn-link):not(.btn-flat) {
background-color: #ec3a76;
}
.btn-material-purple.active:not(.btn-link):not(.btn-flat) {
background-color: #b22dc9;
}
.btn-material-deep-purple.active:not(.btn-link):not(.btn-flat) {
background-color: #764ac6;
}
.btn-material-indigo.active:not(.btn-link):not(.btn-flat) {
background-color: #5062c2;
}
.btn-material-blue.active:not(.btn-link):not(.btn-flat) {
background-color: #3ea4f5;
}
.btn-material-light-blue.active:not(.btn-link):not(.btn-flat) {
background-color: #19b6fc;
}
.btn-material-cyan.active:not(.btn-link):not(.btn-flat) {
background-color: #00a1b5;
}
.btn-material-teal.active:not(.btn-link):not(.btn-flat) {
background-color: #00b5a4;
}
.btn-material-green.active:not(.btn-link):not(.btn-flat) {
background-color: #60ba63;
}
.btn-material-light-green.active:not(.btn-link):not(.btn-flat) {
background-color: #7cb33b;
}
.btn-material-lime.active:not(.btn-link):not(.btn-flat) {
background-color: #c2d125;
}
.btn-material-yellow.active:not(.btn-link):not(.btn-flat) {
background-color: #ffe81c;
}
.btn-material-amber.active:not(.btn-link):not(.btn-flat) {
background-color: #e7ae00;
}
.btn-material-orange.active:not(.btn-link):not(.btn-flat) {
background-color: #e08600;
}
.btn-material-deep-orange.active:not(.btn-link):not(.btn-flat) {
background-color: #ff6e41;
}
.btn-material-brown.active:not(.btn-link):not(.btn-flat) {
background-color: #8c6253;
}
.btn-material-grey.active:not(.btn-link):not(.btn-flat) {
background-color: #adadad;
}
.btn-material-blue-grey.active:not(.btn-link):not(.btn-flat) {
background-color: #6e8d9b;
}
.btn.btn-flat:hover:not(.btn-ink),
.btn-default.btn-flat:hover:not(.btn-ink) {
background-color: rgba(0, 0, 0, 0.2);
}
.btn-black.btn-flat:hover:not(.btn-ink) {
background-color: rgba(0, 0, 0, 0.2);
}
.btn-white.btn-flat:hover:not(.btn-ink) {
background-color: rgba(255, 255, 255, 0.2);
}
.btn-inverse.btn-flat:hover:not(.btn-ink) {
background-color: rgba(63, 81, 181, 0.2);
}
.btn-primary.btn-flat:hover:not(.btn-ink) {
background-color: rgba(0, 150, 136, 0.2);
}
.btn-success.btn-flat:hover:not(.btn-ink) {
background-color: rgba(76, 175, 80, 0.2);
}
.btn-info.btn-flat:hover:not(.btn-ink) {
background-color: rgba(3, 169, 244, 0.2);
}
.btn-warning.btn-flat:hover:not(.btn-ink) {
background-color: rgba(255, 87, 34, 0.2);
}
.btn-danger.btn-flat:hover:not(.btn-ink) {
background-color: rgba(244, 67, 54, 0.2);
}
.btn-material-red.btn-flat:hover:not(.btn-ink) {
background-color: rgba(244, 67, 54, 0.2);
}
.btn-material-pink.btn-flat:hover:not(.btn-ink) {
background-color: rgba(233, 30, 99, 0.2);
}
.btn-material-purple.btn-flat:hover:not(.btn-ink) {
background-color: rgba(156, 39, 176, 0.2);
}
.btn-material-deep-purple.btn-flat:hover:not(.btn-ink) {
background-color: rgba(103, 58, 183, 0.2);
}
.btn-material-indigo.btn-flat:hover:not(.btn-ink) {
background-color: rgba(63, 81, 181, 0.2);
}
.btn-material-blue.btn-flat:hover:not(.btn-ink) {
background-color: rgba(33, 150, 243, 0.2);
}
.btn-material-light-blue.btn-flat:hover:not(.btn-ink) {
background-color: rgba(3, 169, 244, 0.2);
}
.btn-material-cyan.btn-flat:hover:not(.btn-ink) {
background-color: rgba(0, 188, 212, 0.2);
}
.btn-material-teal.btn-flat:hover:not(.btn-ink) {
background-color: rgba(0, 150, 136, 0.2);
}
.btn-material-green.btn-flat:hover:not(.btn-ink) {
background-color: rgba(76, 175, 80, 0.2);
}
.btn-material-light-green.btn-flat:hover:not(.btn-ink) {
background-color: rgba(139, 195, 74, 0.2);
}
.btn-material-lime.btn-flat:hover:not(.btn-ink) {
background-color: rgba(205, 220, 57, 0.2);
}
.btn-material-yellow.btn-flat:hover:not(.btn-ink) {
background-color: rgba(255, 235, 59, 0.2);
}
.btn-material-amber.btn-flat:hover:not(.btn-ink) {
background-color: rgba(255, 193, 7, 0.2);
}
.btn-material-orange.btn-flat:hover:not(.btn-ink) {
background-color: rgba(255, 152, 0, 0.2);
}
.btn-material-deep-orange.btn-flat:hover:not(.btn-ink) {
background-color: rgba(255, 87, 34, 0.2);
}
.btn-material-brown.btn-flat:hover:not(.btn-ink) {
background-color: rgba(121, 85, 72, 0.2);
}
.btn-material-grey.btn-flat:hover:not(.btn-ink) {
background-color: rgba(158, 158, 158, 0.2);
}
.btn-material-blue-grey.btn-flat:hover:not(.btn-ink) {
background-color: rgba(96, 125, 139, 0.2);
}
.btn.btn-flat {
background: none;
box-shadow: none;
font-weight: 500;
}
.btn.btn-flat:disabled {
color: #a8a8a8 !important;
}
.btn.btn-sm {
padding: 5px 20px;
}
.btn.btn-xs {
padding: 4px 15px;
font-size: 10px;
}
.btn.btn-raised {
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.12), 0 1px 6px 0 rgba(0, 0, 0, 0.12);
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn.btn-raised:active:not(.btn-link) {
box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15);
}
.btn.btn-fab {
margin: 0;
padding: 15px;
font-size: 26px;
width: 56px;
height: 56px;
}
.btn.btn-fab,
.btn.btn-fab:hover,
.btn.btn-fab:active,
.btn.btn-fab-default,
.btn.btn-fab:hover-default,
.btn.btn-fab:active-default {
background-color: transparent;
}
.btn.btn-fab-black,
.btn.btn-fab:hover-black,
.btn.btn-fab:active-black {
background-color: #000000;
}
.btn.btn-fab-white,
.btn.btn-fab:hover-white,
.btn.btn-fab:active-white {
background-color: #ffffff;
}
.btn.btn-fab-inverse,
.btn.btn-fab:hover-inverse,
.btn.btn-fab:active-inverse {
background-color: #3f51b5;
}
.btn.btn-fab-primary,
.btn.btn-fab:hover-primary,
.btn.btn-fab:active-primary {
background-color: #009688;
}
.btn.btn-fab-success,
.btn.btn-fab:hover-success,
.btn.btn-fab:active-success {
background-color: #4caf50;
}
.btn.btn-fab-info,
.btn.btn-fab:hover-info,
.btn.btn-fab:active-info {
background-color: #03a9f4;
}
.btn.btn-fab-warning,
.btn.btn-fab:hover-warning,
.btn.btn-fab:active-warning {
background-color: #ff5722;
}
.btn.btn-fab-danger,
.btn.btn-fab:hover-danger,
.btn.btn-fab:active-danger {
background-color: #f44336;
}
.btn.btn-fab-material-red,
.btn.btn-fab:hover-material-red,
.btn.btn-fab:active-material-red {
background-color: #f44336;
}
.btn.btn-fab-material-pink,
.btn.btn-fab:hover-material-pink,
.btn.btn-fab:active-material-pink {
background-color: #e91e63;
}
.btn.btn-fab-material-purple,
.btn.btn-fab:hover-material-purple,
.btn.btn-fab:active-material-purple {
background-color: #9c27b0;
}
.btn.btn-fab-material-deep-purple,
.btn.btn-fab:hover-material-deep-purple,
.btn.btn-fab:active-material-deep-purple {
background-color: #673ab7;
}
.btn.btn-fab-material-indigo,
.btn.btn-fab:hover-material-indigo,
.btn.btn-fab:active-material-indigo {
background-color: #3f51b5;
}
.btn.btn-fab-material-blue,
.btn.btn-fab:hover-material-blue,
.btn.btn-fab:active-material-blue {
background-color: #2196f3;
}
.btn.btn-fab-material-light-blue,
.btn.btn-fab:hover-material-light-blue,
.btn.btn-fab:active-material-light-blue {
background-color: #03a9f4;
}
.btn.btn-fab-material-cyan,
.btn.btn-fab:hover-material-cyan,
.btn.btn-fab:active-material-cyan {
background-color: #00bcd4;
}
.btn.btn-fab-material-teal,
.btn.btn-fab:hover-material-teal,
.btn.btn-fab:active-material-teal {
background-color: #009688;
}
.btn.btn-fab-material-green,
.btn.btn-fab:hover-material-green,
.btn.btn-fab:active-material-green {
background-color: #4caf50;
}
.btn.btn-fab-material-light-green,
.btn.btn-fab:hover-material-light-green,
.btn.btn-fab:active-material-light-green {
background-color: #8bc34a;
}
.btn.btn-fab-material-lime,
.btn.btn-fab:hover-material-lime,
.btn.btn-fab:active-material-lime {
background-color: #cddc39;
}
.btn.btn-fab-material-yellow,
.btn.btn-fab:hover-material-yellow,
.btn.btn-fab:active-material-yellow {
background-color: #ffeb3b;
}
.btn.btn-fab-material-amber,
.btn.btn-fab:hover-material-amber,
.btn.btn-fab:active-material-amber {
background-color: #ffc107;
}
.btn.btn-fab-material-orange,
.btn.btn-fab:hover-material-orange,
.btn.btn-fab:active-material-orange {
background-color: #ff9800;
}
.btn.btn-fab-material-deep-orange,
.btn.btn-fab:hover-material-deep-orange,
.btn.btn-fab:active-material-deep-orange {
background-color: #ff5722;
}
.btn.btn-fab-material-brown,
.btn.btn-fab:hover-material-brown,
.btn.btn-fab:active-material-brown {
background-color: #795548;
}
.btn.btn-fab-material-grey,
.btn.btn-fab:hover-material-grey,
.btn.btn-fab:active-material-grey {
background-color: #9e9e9e;
}
.btn.btn-fab-material-blue-grey,
.btn.btn-fab:hover-material-blue-grey,
.btn.btn-fab:active-material-blue-grey {
background-color: #607d8b;
}
.btn.btn-fab,
.btn.btn-fab:hover {
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.12), 0 1px 6px 0 rgba(0, 0, 0, 0.12);
}
.btn.btn-fab:active {
box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15);
}
.btn.btn-fab,
.btn.btn-fab .ripple-wrapper {
border-radius: 100%;
}
.btn.btn-fab.btn-fab-mini {
width: 40px;
height: 40px;
padding: 13px;
font-size: 15px;
}
.btn.btn-fab i {
position: relative;
top: -5px;
}
.btn-link,
.btn:not([class*="btn-"]),
.btn-default {
color: rgba(0, 0, 0, 0.84);
}
.btn-link:hover,
.btn:not([class*="btn-"]):hover,
.btn-default:hover {
color: rgba(0, 0, 0, 0.84);
}
.btn:not([class*="btn-"]):hover,
.btn-default:hover,
.btn-flat:not(.btn-link):hover,
.btn:not([class*="btn-"]).active,
.btn-default.active,
.btn-flat:not(.btn-link).active {
background-color: rgba(255, 255, 255, 0.5);
}
.open > .dropdown-toggle.btn,
.open > .dropdown-toggle.btn-default {
background-color: transparent;
}
.open > .dropdown-toggle.btn-black {
background-color: #000000;
}
.open > .dropdown-toggle.btn-white {
background-color: #ffffff;
}
.open > .dropdown-toggle.btn-inverse {
background-color: #3f51b5;
}
.open > .dropdown-toggle.btn-primary {
background-color: #009688;
}
.open > .dropdown-toggle.btn-success {
background-color: #4caf50;
}
.open > .dropdown-toggle.btn-info {
background-color: #03a9f4;
}
.open > .dropdown-toggle.btn-warning {
background-color: #ff5722;
}
.open > .dropdown-toggle.btn-danger {
background-color: #f44336;
}
.open > .dropdown-toggle.btn-material-red {
background-color: #f44336;
}
.open > .dropdown-toggle.btn-material-pink {
background-color: #e91e63;
}
.open > .dropdown-toggle.btn-material-purple {
background-color: #9c27b0;
}
.open > .dropdown-toggle.btn-material-deep-purple {
background-color: #673ab7;
}
.open > .dropdown-toggle.btn-material-indigo {
background-color: #3f51b5;
}
.open > .dropdown-toggle.btn-material-blue {
background-color: #2196f3;
}
.open > .dropdown-toggle.btn-material-light-blue {
background-color: #03a9f4;
}
.open > .dropdown-toggle.btn-material-cyan {
background-color: #00bcd4;
}
.open > .dropdown-toggle.btn-material-teal {
background-color: #009688;
}
.open > .dropdown-toggle.btn-material-green {
background-color: #4caf50;
}
.open > .dropdown-toggle.btn-material-light-green {
background-color: #8bc34a;
}
.open > .dropdown-toggle.btn-material-lime {
background-color: #cddc39;
}
.open > .dropdown-toggle.btn-material-yellow {
background-color: #ffeb3b;
}
.open > .dropdown-toggle.btn-material-amber {
background-color: #ffc107;
}
.open > .dropdown-toggle.btn-material-orange {
background-color: #ff9800;
}
.open > .dropdown-toggle.btn-material-deep-orange {
background-color: #ff5722;
}
.open > .dropdown-toggle.btn-material-brown {
background-color: #795548;
}
.open > .dropdown-toggle.btn-material-grey {
background-color: #9e9e9e;
}
.open > .dropdown-toggle.btn-material-blue-grey {
background-color: #607d8b;
}
.btn-group .btn + .btn,
.btn-group .btn + .btn-group,
.btn-group .btn-group + .btn,
.btn-group .btn-group + .btn-group {
margin-left: 0;
}
.btn-group,
.btn-group-vertical {
position: relative;
border-radius: 2px;
margin: 10px 1px;
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.12), 0 1px 6px 0 rgba(0, 0, 0, 0.12);
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-group:active:not(.btn-link),
.btn-group-vertical:active:not(.btn-link) {
box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15);
}
.btn-group.open .dropdown-toggle,
.btn-group-vertical.open .dropdown-toggle {
box-shadow: none;
}
.btn-group.btn-group-raised,
.btn-group-vertical.btn-group-raised {
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.12), 0 1px 6px 0 rgba(0, 0, 0, 0.12);
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-group.btn-group-raised:active:not(.btn-link),
.btn-group-vertical.btn-group-raised:active:not(.btn-link) {
box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15);
}
.btn-group .btn,
.btn-group-vertical .btn,
.btn-group .btn:active,
.btn-group-vertical .btn:active,
.btn-group .btn-group,
.btn-group-vertical .btn-group {
box-shadow: none !important;
margin: 0;
}
.btn-group-flat {
box-shadow: none !important;
}
.form-horizontal .checkbox {
padding-top: 20px;
}
.checkbox {
-webkit-transform: translateZ(0);
transform: translateZ(0);
}
.checkbox label {
cursor: pointer;
padding-left: 0;
}
.checkbox input[type=checkbox] {
opacity: 0;
position: absolute;
margin: 0;
z-index: -1;
width: 0;
height: 0;
overflow: hidden;
left: 0;
pointer-events: none;
}
.checkbox .checkbox-material {
vertical-align: middle;
position: relative;
top: 3px;
}
.checkbox .checkbox-material:before {
display: block;
position: absolute;
left: 0;
content: "";
background-color: rgba(0, 0, 0, 0.84);
height: 20px;
width: 20px;
border-radius: 100%;
z-index: 1;
opacity: 0;
margin: 0;
-webkit-transform: scale3d(2.3, 2.3, 1);
transform: scale3d(2.3, 2.3, 1);
}
.checkbox .checkbox-material .check {
position: relative;
display: inline-block;
width: 20px;
height: 20px;
border: 2px solid;
border-radius: 2px;
overflow: hidden;
z-index: 1;
}
.checkbox .checkbox-material .check:before {
position: absolute;
content: "";
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
display: block;
margin-top: -4px;
margin-left: 6px;
width: 0;
height: 0;
box-shadow: 0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0 inset;
-webkit-animation: checkbox-off 0.3s forwards;
animation: checkbox-off 0.3s forwards;
}
.checkbox input[type=checkbox]:focus + .checkbox-material .check:after {
opacity: 0.2;
}
.checkbox input[type=checkbox]:checked + .checkbox-material .check:before {
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0px 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 20px -12px 0 11px;
-webkit-animation: checkbox-on 0.3s forwards;
animation: checkbox-on 0.3s forwards;
}
.checkbox input[type=checkbox]:not(:checked) + .checkbox-material:before {
-webkit-animation: rippleOff 500ms;
animation: rippleOff 500ms;
}
.checkbox input[type=checkbox]:checked + .checkbox-material:before {
-webkit-animation: rippleOn 500ms;
animation: rippleOn 500ms;
}
.checkbox input[type=checkbox]:not(:checked) + .checkbox-material .check:after {
-webkit-animation: rippleOff 500ms forwards;
animation: rippleOff 500ms forwards;
}
.checkbox input[type=checkbox]:checked + .checkbox-material .check:after {
-webkit-animation: rippleOn 500ms forwards;
animation: rippleOn 500ms forwards;
}
.checkbox input[type=checkbox][disabled]:not(:checked) ~ .checkbox-material .check:before,
.checkbox input[type=checkbox][disabled] + .circle {
opacity: 0.5;
}
.checkbox input[type=checkbox][disabled] + .checkbox-material .check:after {
background-color: rgba(0, 0, 0, 0.84);
-webkit-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
transform: rotate(-45deg);
}
.checkbox input[type=checkbox]:checked + .checkbox-material .check:after,
.checkbox-default input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #4caf50;
}
.checkbox-black input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #000000;
}
.checkbox-white input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #ffffff;
}
.checkbox-inverse input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #3f51b5;
}
.checkbox-primary input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #009688;
}
.checkbox-success input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #4caf50;
}
.checkbox-info input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #03a9f4;
}
.checkbox-warning input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #ff5722;
}
.checkbox-danger input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #f44336;
}
.checkbox-material-red input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #f44336;
}
.checkbox-material-pink input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #e91e63;
}
.checkbox-material-purple input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #9c27b0;
}
.checkbox-material-deep-purple input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #673ab7;
}
.checkbox-material-indigo input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #3f51b5;
}
.checkbox-material-blue input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #2196f3;
}
.checkbox-material-light-blue input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #03a9f4;
}
.checkbox-material-cyan input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #00bcd4;
}
.checkbox-material-teal input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #009688;
}
.checkbox-material-green input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #4caf50;
}
.checkbox-material-light-green input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #8bc34a;
}
.checkbox-material-lime input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #cddc39;
}
.checkbox-material-yellow input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #ffeb3b;
}
.checkbox-material-amber input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #ffc107;
}
.checkbox-material-orange input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #ff9800;
}
.checkbox-material-deep-orange input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #ff5722;
}
.checkbox-material-brown input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #795548;
}
.checkbox-material-grey input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #9e9e9e;
}
.checkbox-material-blue-grey input[type=checkbox]:checked + .checkbox-material .check:after {
background-color: #607d8b;
}
.checkbox input[type=checkbox]:checked + .checkbox-material .check:before,
.checkbox-default input[type=checkbox]:checked + .checkbox-material .check:before {
color: #4caf50;
}
.checkbox-black input[type=checkbox]:checked + .checkbox-material .check:before {
color: #000000;
}
.checkbox-white input[type=checkbox]:checked + .checkbox-material .check:before {
color: #ffffff;
}
.checkbox-inverse input[type=checkbox]:checked + .checkbox-material .check:before {
color: #3f51b5;
}
.checkbox-primary input[type=checkbox]:checked + .checkbox-material .check:before {
color: #009688;
}
.checkbox-success input[type=checkbox]:checked + .checkbox-material .check:before {
color: #4caf50;
}
.checkbox-info input[type=checkbox]:checked + .checkbox-material .check:before {
color: #03a9f4;
}
.checkbox-warning input[type=checkbox]:checked + .checkbox-material .check:before {
color: #ff5722;
}
.checkbox-danger input[type=checkbox]:checked + .checkbox-material .check:before {
color: #f44336;
}
.checkbox-material-red input[type=checkbox]:checked + .checkbox-material .check:before {
color: #f44336;
}
.checkbox-material-pink input[type=checkbox]:checked + .checkbox-material .check:before {
color: #e91e63;
}
.checkbox-material-purple input[type=checkbox]:checked + .checkbox-material .check:before {
color: #9c27b0;
}
.checkbox-material-deep-purple input[type=checkbox]:checked + .checkbox-material .check:before {
color: #673ab7;
}
.checkbox-material-indigo input[type=checkbox]:checked + .checkbox-material .check:before {
color: #3f51b5;
}
.checkbox-material-blue input[type=checkbox]:checked + .checkbox-material .check:before {
color: #2196f3;
}
.checkbox-material-light-blue input[type=checkbox]:checked + .checkbox-material .check:before {
color: #03a9f4;
}
.checkbox-material-cyan input[type=checkbox]:checked + .checkbox-material .check:before {
color: #00bcd4;
}
.checkbox-material-teal input[type=checkbox]:checked + .checkbox-material .check:before {
color: #009688;
}
.checkbox-material-green input[type=checkbox]:checked + .checkbox-material .check:before {
color: #4caf50;
}
.checkbox-material-light-green input[type=checkbox]:checked + .checkbox-material .check:before {
color: #8bc34a;
}
.checkbox-material-lime input[type=checkbox]:checked + .checkbox-material .check:before {
color: #cddc39;
}
.checkbox-material-yellow input[type=checkbox]:checked + .checkbox-material .check:before {
color: #ffeb3b;
}
.checkbox-material-amber input[type=checkbox]:checked + .checkbox-material .check:before {
color: #ffc107;
}
.checkbox-material-orange input[type=checkbox]:checked + .checkbox-material .check:before {
color: #ff9800;
}
.checkbox-material-deep-orange input[type=checkbox]:checked + .checkbox-material .check:before {
color: #ff5722;
}
.checkbox-material-brown input[type=checkbox]:checked + .checkbox-material .check:before {
color: #795548;
}
.checkbox-material-grey input[type=checkbox]:checked + .checkbox-material .check:before {
color: #9e9e9e;
}
.checkbox-material-blue-grey input[type=checkbox]:checked + .checkbox-material .check:before {
color: #607d8b;
}
.checkbox input[type=checkbox]:checked + .checkbox-material .check,
.checkbox-default input[type=checkbox]:checked + .checkbox-material .check {
color: #4caf50;
}
.checkbox-black input[type=checkbox]:checked + .checkbox-material .check {
color: #000000;
}
.checkbox-white input[type=checkbox]:checked + .checkbox-material .check {
color: #ffffff;
}
.checkbox-inverse input[type=checkbox]:checked + .checkbox-material .check {
color: #3f51b5;
}
.checkbox-primary input[type=checkbox]:checked + .checkbox-material .check {
color: #009688;
}
.checkbox-success input[type=checkbox]:checked + .checkbox-material .check {
color: #4caf50;
}
.checkbox-info input[type=checkbox]:checked + .checkbox-material .check {
color: #03a9f4;
}
.checkbox-warning input[type=checkbox]:checked + .checkbox-material .check {
color: #ff5722;
}
.checkbox-danger input[type=checkbox]:checked + .checkbox-material .check {
color: #f44336;
}
.checkbox-material-red input[type=checkbox]:checked + .checkbox-material .check {
color: #f44336;
}
.checkbox-material-pink input[type=checkbox]:checked + .checkbox-material .check {
color: #e91e63;
}
.checkbox-material-purple input[type=checkbox]:checked + .checkbox-material .check {
color: #9c27b0;
}
.checkbox-material-deep-purple input[type=checkbox]:checked + .checkbox-material .check {
color: #673ab7;
}
.checkbox-material-indigo input[type=checkbox]:checked + .checkbox-material .check {
color: #3f51b5;
}
.checkbox-material-blue input[type=checkbox]:checked + .checkbox-material .check {
color: #2196f3;
}
.checkbox-material-light-blue input[type=checkbox]:checked + .checkbox-material .check {
color: #03a9f4;
}
.checkbox-material-cyan input[type=checkbox]:checked + .checkbox-material .check {
color: #00bcd4;
}
.checkbox-material-teal input[type=checkbox]:checked + .checkbox-material .check {
color: #009688;
}
.checkbox-material-green input[type=checkbox]:checked + .checkbox-material .check {
color: #4caf50;
}
.checkbox-material-light-green input[type=checkbox]:checked + .checkbox-material .check {
color: #8bc34a;
}
.checkbox-material-lime input[type=checkbox]:checked + .checkbox-material .check {
color: #cddc39;
}
.checkbox-material-yellow input[type=checkbox]:checked + .checkbox-material .check {
color: #ffeb3b;
}
.checkbox-material-amber input[type=checkbox]:checked + .checkbox-material .check {
color: #ffc107;
}
.checkbox-material-orange input[type=checkbox]:checked + .checkbox-material .check {
color: #ff9800;
}
.checkbox-material-deep-orange input[type=checkbox]:checked + .checkbox-material .check {
color: #ff5722;
}
.checkbox-material-brown input[type=checkbox]:checked + .checkbox-material .check {
color: #795548;
}
.checkbox-material-grey input[type=checkbox]:checked + .checkbox-material .check {
color: #9e9e9e;
}
.checkbox-material-blue-grey input[type=checkbox]:checked + .checkbox-material .check {
color: #607d8b;
}
@-webkit-keyframes checkbox-on {
0% {
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0px 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 15px 2px 0 11px;
}
50% {
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0px 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 20px 2px 0 11px;
}
100% {
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0px 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 20px -12px 0 11px;
}
}
@keyframes checkbox-on {
0% {
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0px 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 15px 2px 0 11px;
}
50% {
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0px 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 20px 2px 0 11px;
}
100% {
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0px 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 20px -12px 0 11px;
}
}
@-webkit-keyframes checkbox-off {
0% {
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0px 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 20px -12px 0 11px, 0 0 0 0 inset;
}
25% {
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0px 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 20px -12px 0 11px, 0 0 0 0 inset;
}
50% {
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
margin-top: -4px;
margin-left: 6px;
width: 0px;
height: 0px;
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0px 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 15px 2px 0 11px, 0 0 0 0 inset;
}
51% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
margin-top: -2px;
margin-left: -2px;
width: 20px;
height: 20px;
box-shadow: 0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0px 0px 0 10px inset;
}
100% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
margin-top: -2px;
margin-left: -2px;
width: 20px;
height: 20px;
box-shadow: 0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0px 0px 0 0px inset;
}
}
@keyframes checkbox-off {
0% {
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0px 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 20px -12px 0 11px, 0 0 0 0 inset;
}
25% {
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0px 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 20px -12px 0 11px, 0 0 0 0 inset;
}
50% {
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
margin-top: -4px;
margin-left: 6px;
width: 0px;
height: 0px;
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0px 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 15px 2px 0 11px, 0 0 0 0 inset;
}
51% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
margin-top: -2px;
margin-left: -2px;
width: 20px;
height: 20px;
box-shadow: 0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0px 0px 0 10px inset;
}
100% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
margin-top: -2px;
margin-left: -2px;
width: 20px;
height: 20px;
box-shadow: 0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0px 0px 0 0px inset;
}
}
@-webkit-keyframes rippleOn {
0% {
opacity: 0;
}
50% {
opacity: 0.2;
}
100% {
opacity: 0;
}
}
@keyframes rippleOn {
0% {
opacity: 0;
}
50% {
opacity: 0.2;
}
100% {
opacity: 0;
}
}
@-webkit-keyframes rippleOff {
0% {
opacity: 0;
}
50% {
opacity: 0.2;
}
100% {
opacity: 0;
}
}
@keyframes rippleOff {
0% {
opacity: 0;
}
50% {
opacity: 0.2;
}
100% {
opacity: 0;
}
}
.togglebutton {
vertical-align: middle;
}
.togglebutton,
.togglebutton label,
.togglebutton input,
.togglebutton .toggle {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.togglebutton label {
font-weight: 400;
cursor: pointer;
}
.togglebutton label input[type=checkbox] {
opacity: 0;
width: 0;
height: 0;
}
.togglebutton label .toggle,
.togglebutton label input[type=checkbox][disabled] + .toggle {
content: "";
display: inline-block;
width: 30px;
height: 15px;
background-color: rgba(80, 80, 80, 0.7);
border-radius: 15px;
margin-right: 10px;
transition: background 0.3s ease;
vertical-align: middle;
}
.togglebutton label .toggle:after {
content: "";
display: inline-block;
width: 20px;
height: 20px;
background-color: #F1F1F1;
border-radius: 20px;
position: relative;
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4);
left: -5px;
top: -2px;
transition: left 0.3s ease, background 0.3s ease, box-shadow 0.1s ease;
}
.togglebutton label input[type=checkbox][disabled] + .toggle:after,
.togglebutton label input[type=checkbox][disabled]:checked + .toggle:after {
background-color: #BDBDBD;
}
.togglebutton label input[type=checkbox] + .toggle:active:after,
.togglebutton label input[type=checkbox][disabled] + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(0, 0, 0, 0.1);
}
.togglebutton label input[type=checkbox]:checked + .toggle:after {
left: 15px;
}
.togglebutton label input[type=checkbox]:checked + .toggle,
.togglebutton-default label input[type=checkbox]:checked + .toggle {
background-color: rgba(0, 150, 136, 0.5);
}
.togglebutton-black label input[type=checkbox]:checked + .toggle {
background-color: rgba(0, 0, 0, 0.5);
}
.togglebutton-white label input[type=checkbox]:checked + .toggle {
background-color: rgba(255, 255, 255, 0.5);
}
.togglebutton-inverse label input[type=checkbox]:checked + .toggle {
background-color: rgba(63, 81, 181, 0.5);
}
.togglebutton-primary label input[type=checkbox]:checked + .toggle {
background-color: rgba(0, 150, 136, 0.5);
}
.togglebutton-success label input[type=checkbox]:checked + .toggle {
background-color: rgba(76, 175, 80, 0.5);
}
.togglebutton-info label input[type=checkbox]:checked + .toggle {
background-color: rgba(3, 169, 244, 0.5);
}
.togglebutton-warning label input[type=checkbox]:checked + .toggle {
background-color: rgba(255, 87, 34, 0.5);
}
.togglebutton-danger label input[type=checkbox]:checked + .toggle {
background-color: rgba(244, 67, 54, 0.5);
}
.togglebutton-material-red label input[type=checkbox]:checked + .toggle {
background-color: rgba(244, 67, 54, 0.5);
}
.togglebutton-material-pink label input[type=checkbox]:checked + .toggle {
background-color: rgba(233, 30, 99, 0.5);
}
.togglebutton-material-purple label input[type=checkbox]:checked + .toggle {
background-color: rgba(156, 39, 176, 0.5);
}
.togglebutton-material-deep-purple label input[type=checkbox]:checked + .toggle {
background-color: rgba(103, 58, 183, 0.5);
}
.togglebutton-material-indigo label input[type=checkbox]:checked + .toggle {
background-color: rgba(63, 81, 181, 0.5);
}
.togglebutton-material-blue label input[type=checkbox]:checked + .toggle {
background-color: rgba(33, 150, 243, 0.5);
}
.togglebutton-material-light-blue label input[type=checkbox]:checked + .toggle {
background-color: rgba(3, 169, 244, 0.5);
}
.togglebutton-material-cyan label input[type=checkbox]:checked + .toggle {
background-color: rgba(0, 188, 212, 0.5);
}
.togglebutton-material-teal label input[type=checkbox]:checked + .toggle {
background-color: rgba(0, 150, 136, 0.5);
}
.togglebutton-material-green label input[type=checkbox]:checked + .toggle {
background-color: rgba(76, 175, 80, 0.5);
}
.togglebutton-material-light-green label input[type=checkbox]:checked + .toggle {
background-color: rgba(139, 195, 74, 0.5);
}
.togglebutton-material-lime label input[type=checkbox]:checked + .toggle {
background-color: rgba(205, 220, 57, 0.5);
}
.togglebutton-material-yellow label input[type=checkbox]:checked + .toggle {
background-color: rgba(255, 235, 59, 0.5);
}
.togglebutton-material-amber label input[type=checkbox]:checked + .toggle {
background-color: rgba(255, 193, 7, 0.5);
}
.togglebutton-material-orange label input[type=checkbox]:checked + .toggle {
background-color: rgba(255, 152, 0, 0.5);
}
.togglebutton-material-deep-orange label input[type=checkbox]:checked + .toggle {
background-color: rgba(255, 87, 34, 0.5);
}
.togglebutton-material-brown label input[type=checkbox]:checked + .toggle {
background-color: rgba(121, 85, 72, 0.5);
}
.togglebutton-material-grey label input[type=checkbox]:checked + .toggle {
background-color: rgba(158, 158, 158, 0.5);
}
.togglebutton-material-blue-grey label input[type=checkbox]:checked + .toggle {
background-color: rgba(96, 125, 139, 0.5);
}
.togglebutton label input[type=checkbox]:checked + .toggle:after,
.togglebutton-default label input[type=checkbox]:checked + .toggle:after {
background-color: #009688;
}
.togglebutton-black label input[type=checkbox]:checked + .toggle:after {
background-color: #000000;
}
.togglebutton-white label input[type=checkbox]:checked + .toggle:after {
background-color: #ffffff;
}
.togglebutton-inverse label input[type=checkbox]:checked + .toggle:after {
background-color: #3f51b5;
}
.togglebutton-primary label input[type=checkbox]:checked + .toggle:after {
background-color: #009688;
}
.togglebutton-success label input[type=checkbox]:checked + .toggle:after {
background-color: #4caf50;
}
.togglebutton-info label input[type=checkbox]:checked + .toggle:after {
background-color: #03a9f4;
}
.togglebutton-warning label input[type=checkbox]:checked + .toggle:after {
background-color: #ff5722;
}
.togglebutton-danger label input[type=checkbox]:checked + .toggle:after {
background-color: #f44336;
}
.togglebutton-material-red label input[type=checkbox]:checked + .toggle:after {
background-color: #f44336;
}
.togglebutton-material-pink label input[type=checkbox]:checked + .toggle:after {
background-color: #e91e63;
}
.togglebutton-material-purple label input[type=checkbox]:checked + .toggle:after {
background-color: #9c27b0;
}
.togglebutton-material-deep-purple label input[type=checkbox]:checked + .toggle:after {
background-color: #673ab7;
}
.togglebutton-material-indigo label input[type=checkbox]:checked + .toggle:after {
background-color: #3f51b5;
}
.togglebutton-material-blue label input[type=checkbox]:checked + .toggle:after {
background-color: #2196f3;
}
.togglebutton-material-light-blue label input[type=checkbox]:checked + .toggle:after {
background-color: #03a9f4;
}
.togglebutton-material-cyan label input[type=checkbox]:checked + .toggle:after {
background-color: #00bcd4;
}
.togglebutton-material-teal label input[type=checkbox]:checked + .toggle:after {
background-color: #009688;
}
.togglebutton-material-green label input[type=checkbox]:checked + .toggle:after {
background-color: #4caf50;
}
.togglebutton-material-light-green label input[type=checkbox]:checked + .toggle:after {
background-color: #8bc34a;
}
.togglebutton-material-lime label input[type=checkbox]:checked + .toggle:after {
background-color: #cddc39;
}
.togglebutton-material-yellow label input[type=checkbox]:checked + .toggle:after {
background-color: #ffeb3b;
}
.togglebutton-material-amber label input[type=checkbox]:checked + .toggle:after {
background-color: #ffc107;
}
.togglebutton-material-orange label input[type=checkbox]:checked + .toggle:after {
background-color: #ff9800;
}
.togglebutton-material-deep-orange label input[type=checkbox]:checked + .toggle:after {
background-color: #ff5722;
}
.togglebutton-material-brown label input[type=checkbox]:checked + .toggle:after {
background-color: #795548;
}
.togglebutton-material-grey label input[type=checkbox]:checked + .toggle:after {
background-color: #9e9e9e;
}
.togglebutton-material-blue-grey label input[type=checkbox]:checked + .toggle:after {
background-color: #607d8b;
}
.togglebutton label input[type=checkbox]:checked + .toggle:active:after,
.togglebutton-default label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(0, 150, 136, 0.1);
}
.togglebutton-black label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(0, 0, 0, 0.1);
}
.togglebutton-white label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(255, 255, 255, 0.1);
}
.togglebutton-inverse label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(63, 81, 181, 0.1);
}
.togglebutton-primary label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(0, 150, 136, 0.1);
}
.togglebutton-success label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(76, 175, 80, 0.1);
}
.togglebutton-info label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(3, 169, 244, 0.1);
}
.togglebutton-warning label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(255, 87, 34, 0.1);
}
.togglebutton-danger label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(244, 67, 54, 0.1);
}
.togglebutton-material-red label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(244, 67, 54, 0.1);
}
.togglebutton-material-pink label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(233, 30, 99, 0.1);
}
.togglebutton-material-purple label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(156, 39, 176, 0.1);
}
.togglebutton-material-deep-purple label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(103, 58, 183, 0.1);
}
.togglebutton-material-indigo label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(63, 81, 181, 0.1);
}
.togglebutton-material-blue label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(33, 150, 243, 0.1);
}
.togglebutton-material-light-blue label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(3, 169, 244, 0.1);
}
.togglebutton-material-cyan label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(0, 188, 212, 0.1);
}
.togglebutton-material-teal label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(0, 150, 136, 0.1);
}
.togglebutton-material-green label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(76, 175, 80, 0.1);
}
.togglebutton-material-light-green label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(139, 195, 74, 0.1);
}
.togglebutton-material-lime label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(205, 220, 57, 0.1);
}
.togglebutton-material-yellow label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(255, 235, 59, 0.1);
}
.togglebutton-material-amber label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(255, 193, 7, 0.1);
}
.togglebutton-material-orange label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(255, 152, 0, 0.1);
}
.togglebutton-material-deep-orange label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(255, 87, 34, 0.1);
}
.togglebutton-material-brown label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(121, 85, 72, 0.1);
}
.togglebutton-material-grey label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(158, 158, 158, 0.1);
}
.togglebutton-material-blue-grey label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(96, 125, 139, 0.1);
}
.form-horizontal .radio {
margin-bottom: 10px;
}
.radio label {
cursor: pointer;
padding-left: 45px;
position: relative;
}
.radio label span {
display: block;
position: absolute;
left: 10px;
top: 2px;
transition-duration: 0.2s;
}
.radio label .circle {
border: 2px solid rgba(0, 0, 0, 0.84);
height: 15px;
width: 15px;
border-radius: 100%;
}
.radio label .check {
height: 15px;
width: 15px;
border-radius: 100%;
background-color: rgba(0, 0, 0, 0.84);
-webkit-transform: scale3d(0, 0, 0);
transform: scale3d(0, 0, 0);
}
.radio label .check:after {
display: block;
position: absolute;
content: "";
background-color: rgba(0, 0, 0, 0.84);
left: -18px;
top: -18px;
height: 50px;
width: 50px;
border-radius: 100%;
z-index: 1;
opacity: 0;
margin: 0;
-webkit-transform: scale3d(1.5, 1.5, 1);
transform: scale3d(1.5, 1.5, 1);
}
.radio label input[type=radio]:not(:checked) ~ .check:after {
-webkit-animation: rippleOff 500ms;
animation: rippleOff 500ms;
}
.radio label input[type=radio]:checked ~ .check:after {
-webkit-animation: rippleOn 500ms;
animation: rippleOn 500ms;
}
.radio input[type=radio]:checked ~ .check,
.radio-default input[type=radio]:checked ~ .check {
background-color: rgba(0, 0, 0, 0.84);
}
.radio-black input[type=radio]:checked ~ .check {
background-color: #000000;
}
.radio-white input[type=radio]:checked ~ .check {
background-color: #ffffff;
}
.radio-inverse input[type=radio]:checked ~ .check {
background-color: #3f51b5;
}
.radio-primary input[type=radio]:checked ~ .check {
background-color: #009688;
}
.radio-success input[type=radio]:checked ~ .check {
background-color: #4caf50;
}
.radio-info input[type=radio]:checked ~ .check {
background-color: #03a9f4;
}
.radio-warning input[type=radio]:checked ~ .check {
background-color: #ff5722;
}
.radio-danger input[type=radio]:checked ~ .check {
background-color: #f44336;
}
.radio-material-red input[type=radio]:checked ~ .check {
background-color: #f44336;
}
.radio-material-pink input[type=radio]:checked ~ .check {
background-color: #e91e63;
}
.radio-material-purple input[type=radio]:checked ~ .check {
background-color: #9c27b0;
}
.radio-material-deep-purple input[type=radio]:checked ~ .check {
background-color: #673ab7;
}
.radio-material-indigo input[type=radio]:checked ~ .check {
background-color: #3f51b5;
}
.radio-material-blue input[type=radio]:checked ~ .check {
background-color: #2196f3;
}
.radio-material-light-blue input[type=radio]:checked ~ .check {
background-color: #03a9f4;
}
.radio-material-cyan input[type=radio]:checked ~ .check {
background-color: #00bcd4;
}
.radio-material-teal input[type=radio]:checked ~ .check {
background-color: #009688;
}
.radio-material-green input[type=radio]:checked ~ .check {
background-color: #4caf50;
}
.radio-material-light-green input[type=radio]:checked ~ .check {
background-color: #8bc34a;
}
.radio-material-lime input[type=radio]:checked ~ .check {
background-color: #cddc39;
}
.radio-material-yellow input[type=radio]:checked ~ .check {
background-color: #ffeb3b;
}
.radio-material-amber input[type=radio]:checked ~ .check {
background-color: #ffc107;
}
.radio-material-orange input[type=radio]:checked ~ .check {
background-color: #ff9800;
}
.radio-material-deep-orange input[type=radio]:checked ~ .check {
background-color: #ff5722;
}
.radio-material-brown input[type=radio]:checked ~ .check {
background-color: #795548;
}
.radio-material-grey input[type=radio]:checked ~ .check {
background-color: #9e9e9e;
}
.radio-material-blue-grey input[type=radio]:checked ~ .check {
background-color: #607d8b;
}
.radio input[type=radio]:checked ~ .circle,
.radio-default input[type=radio]:checked ~ .circle {
border-color: rgba(0, 0, 0, 0.84);
}
.radio-black input[type=radio]:checked ~ .circle {
border-color: #000000;
}
.radio-white input[type=radio]:checked ~ .circle {
border-color: #ffffff;
}
.radio-inverse input[type=radio]:checked ~ .circle {
border-color: #3f51b5;
}
.radio-primary input[type=radio]:checked ~ .circle {
border-color: #009688;
}
.radio-success input[type=radio]:checked ~ .circle {
border-color: #4caf50;
}
.radio-info input[type=radio]:checked ~ .circle {
border-color: #03a9f4;
}
.radio-warning input[type=radio]:checked ~ .circle {
border-color: #ff5722;
}
.radio-danger input[type=radio]:checked ~ .circle {
border-color: #f44336;
}
.radio-material-red input[type=radio]:checked ~ .circle {
border-color: #f44336;
}
.radio-material-pink input[type=radio]:checked ~ .circle {
border-color: #e91e63;
}
.radio-material-purple input[type=radio]:checked ~ .circle {
border-color: #9c27b0;
}
.radio-material-deep-purple input[type=radio]:checked ~ .circle {
border-color: #673ab7;
}
.radio-material-indigo input[type=radio]:checked ~ .circle {
border-color: #3f51b5;
}
.radio-material-blue input[type=radio]:checked ~ .circle {
border-color: #2196f3;
}
.radio-material-light-blue input[type=radio]:checked ~ .circle {
border-color: #03a9f4;
}
.radio-material-cyan input[type=radio]:checked ~ .circle {
border-color: #00bcd4;
}
.radio-material-teal input[type=radio]:checked ~ .circle {
border-color: #009688;
}
.radio-material-green input[type=radio]:checked ~ .circle {
border-color: #4caf50;
}
.radio-material-light-green input[type=radio]:checked ~ .circle {
border-color: #8bc34a;
}
.radio-material-lime input[type=radio]:checked ~ .circle {
border-color: #cddc39;
}
.radio-material-yellow input[type=radio]:checked ~ .circle {
border-color: #ffeb3b;
}
.radio-material-amber input[type=radio]:checked ~ .circle {
border-color: #ffc107;
}
.radio-material-orange input[type=radio]:checked ~ .circle {
border-color: #ff9800;
}
.radio-material-deep-orange input[type=radio]:checked ~ .circle {
border-color: #ff5722;
}
.radio-material-brown input[type=radio]:checked ~ .circle {
border-color: #795548;
}
.radio-material-grey input[type=radio]:checked ~ .circle {
border-color: #9e9e9e;
}
.radio-material-blue-grey input[type=radio]:checked ~ .circle {
border-color: #607d8b;
}
.radio input[type=radio][disabled] ~ .check,
.radio input[type=radio][disabled] ~ .circle {
opacity: 0.5;
}
.radio input[type=radio] {
opacity: 0;
height: 0;
width: 0;
overflow: hidden;
}
.radio input[type=radio]:checked ~ .check {
-webkit-transform: scale3d(0.55, 0.55, 1);
transform: scale3d(0.55, 0.55, 1);
}
.radio input[type=radio][disabled] ~ .circle {
border-color: rgba(0, 0, 0, 0.84);
}
.radio input[type=radio][disabled] ~ .check {
background-color: rgba(0, 0, 0, 0.84);
}
@keyframes rippleOn {
0% {
opacity: 0;
}
50% {
opacity: 0.2;
}
100% {
opacity: 0;
}
}
@keyframes rippleOff {
0% {
opacity: 0;
}
50% {
opacity: 0.2;
}
100% {
opacity: 0;
}
}
fieldset[disabled] .form-control,
.form-control-wrapper .form-control,
.form-control,
fieldset[disabled] .form-control:focus,
.form-control-wrapper .form-control:focus,
.form-control:focus,
fieldset[disabled] .form-control.focus,
.form-control-wrapper .form-control.focus,
.form-control.focus {
padding: 0;
float: none;
border: 0;
box-shadow: none;
border-radius: 0;
}
fieldset[disabled] .form-control:not(textarea),
.form-control-wrapper .form-control:not(textarea),
.form-control:not(textarea),
fieldset[disabled] .form-control:focus:not(textarea),
.form-control-wrapper .form-control:focus:not(textarea),
.form-control:focus:not(textarea),
fieldset[disabled] .form-control.focus:not(textarea),
.form-control-wrapper .form-control.focus:not(textarea),
.form-control.focus:not(textarea) {
height: 28px;
}
fieldset[disabled] .form-control:disabled,
.form-control-wrapper .form-control:disabled,
.form-control:disabled,
fieldset[disabled] .form-control:focus:disabled,
.form-control-wrapper .form-control:focus:disabled,
.form-control:focus:disabled,
fieldset[disabled] .form-control.focus:disabled,
.form-control-wrapper .form-control.focus:disabled,
.form-control.focus:disabled {
border-style: dashed;
border-bottom: 1px solid #757575;
}
select[multiple].form-control,
select[multiple].form-control:focus,
select[multiple].form-control.focus {
height: 85px;
}
.form-control {
border: 0;
background-image: linear-gradient(#009688, #009688), linear-gradient(#d2d2d2, #d2d2d2);
background-size: 0 2px, 100% 1px;
background-repeat: no-repeat;
background-position: center bottom, center calc(100% - 1px);
background-color: transparent;
background-color: rgba(0, 0, 0, 0);
}
.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
background-color: transparent;
background-color: rgba(0, 0, 0, 0);
}
fieldset[disabled] .form-control:disabled,
.form-control-wrapper .form-control:disabled,
.form-control:disabled,
fieldset[disabled] .form-control:focus:disabled,
.form-control-wrapper .form-control:focus:disabled,
.form-control:focus:disabled,
fieldset[disabled] .form-control.focus:disabled,
.form-control-wrapper .form-control.focus:disabled,
.form-control.focus:disabled {
border: 0;
}
.form-control:focus,
.form-control.focus {
outline: none;
background-image: linear-gradient(#009688, #009688), linear-gradient(#d2d2d2, #d2d2d2);
-webkit-animation: input-highlight 0.5s forwards;
animation: input-highlight 0.5s forwards;
box-shadow: none;
background-size: 0 2px, 100% 1px;
}
.form-control-wrapper {
position: relative;
}
.form-control-wrapper .floating-label {
color: #7E7E7E;
font-size: 14px;
position: absolute;
pointer-events: none;
left: 0px;
top: 5px;
transition: 0.2s ease all;
opacity: 0;
}
.form-control-wrapper .form-control:focus ~ .floating-label,
.form-control-wrapper .form-control:not(.empty) ~ .floating-label {
top: -10px;
font-size: 10px;
opacity: 1;
}
.form-control-wrapper .form-control:focus ~ .floating-label {
color: #009688;
}
.form-control-wrapper .form-control:not(.empty):invalid ~ .floating-label,
.form-control-wrapper .form-control.focus:invalid ~ .floating-label {
color: #f44336;
}
.form-control-wrapper .form-control:focus ~ .material-input:after,
.form-control-wrapper .form-control.focus ~ .material-input:after {
background-color: #009688;
}
.form-control-wrapper .form-control:invalid {
background-image: linear-gradient(#f44336, #f44336), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-control-wrapper .form-control.empty ~ .floating-label {
opacity: 1;
}
.form-control-wrapper textarea {
resize: none;
}
.form-control-wrapper textarea ~ .form-control-highlight {
margin-top: -11px;
}
.form-control-wrapper .hint {
position: absolute;
font-size: 80%;
display: none;
}
.form-control-wrapper .form-control:focus ~ .hint,
.form-control-wrapper .form-control.focus ~ .hint {
display: block;
}
.form-control-wrapper select ~ .material-input:after {
display: none;
}
.form-control-wrapper select {
appearance: none;
}
.form-group.has-warning .form-control {
box-shadow: none;
}
.form-group.has-warning .material-input:focus,
.form-group.has-warning .form-control:focus,
.form-group.has-warning .form-control.focus {
background-image: linear-gradient(#ff5722, #ff5722), linear-gradient(#d2d2d2, #d2d2d2);
box-shadow: none;
}
.form-group.has-warning .control-label,
.form-group.has-warning input.form-control:focus ~ .floating-label {
color: #ff5722;
}
.form-group.has-error .form-control {
box-shadow: none;
}
.form-group.has-error .material-input:focus,
.form-group.has-error .form-control:focus,
.form-group.has-error .form-control.focus {
background-image: linear-gradient(#f44336, #f44336), linear-gradient(#d2d2d2, #d2d2d2);
box-shadow: none;
}
.form-group.has-error .control-label,
.form-group.has-error input.form-control:focus ~ .floating-label {
color: #f44336;
}
.form-group.has-success .form-control {
box-shadow: none;
}
.form-group.has-success .material-input:focus,
.form-group.has-success .form-control:focus,
.form-group.has-success .form-control.focus {
background-image: linear-gradient(#4caf50, #4caf50), linear-gradient(#d2d2d2, #d2d2d2);
box-shadow: none;
}
.form-group.has-success .control-label,
.form-group.has-success input.form-control:focus ~ .floating-label {
color: #4caf50;
}
.form-group.has-info .form-control {
box-shadow: none;
}
.form-group.has-info .material-input:focus,
.form-group.has-info .form-control:focus,
.form-group.has-info .form-control.focus {
background-image: linear-gradient(#03a9f4, #03a9f4), linear-gradient(#d2d2d2, #d2d2d2);
box-shadow: none;
}
.form-group.has-info .control-label,
.form-group.has-info input.form-control:focus ~ .floating-label {
color: #03a9f4;
}
.form-group .form-control:focus,
.form-group-default .form-control:focus {
background-image: linear-gradient(#009688, #009688), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-black .form-control:focus {
background-image: linear-gradient(#000000, #000000), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-white .form-control:focus {
background-image: linear-gradient(#ffffff, #ffffff), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-inverse .form-control:focus {
background-image: linear-gradient(#3f51b5, #3f51b5), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-primary .form-control:focus {
background-image: linear-gradient(#009688, #009688), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-success .form-control:focus {
background-image: linear-gradient(#4caf50, #4caf50), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-info .form-control:focus {
background-image: linear-gradient(#03a9f4, #03a9f4), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-warning .form-control:focus {
background-image: linear-gradient(#ff5722, #ff5722), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-danger .form-control:focus {
background-image: linear-gradient(#f44336, #f44336), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-red .form-control:focus {
background-image: linear-gradient(#f44336, #f44336), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-pink .form-control:focus {
background-image: linear-gradient(#e91e63, #e91e63), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-purple .form-control:focus {
background-image: linear-gradient(#9c27b0, #9c27b0), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-deep-purple .form-control:focus {
background-image: linear-gradient(#673ab7, #673ab7), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-indigo .form-control:focus {
background-image: linear-gradient(#3f51b5, #3f51b5), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-blue .form-control:focus {
background-image: linear-gradient(#2196f3, #2196f3), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-light-blue .form-control:focus {
background-image: linear-gradient(#03a9f4, #03a9f4), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-cyan .form-control:focus {
background-image: linear-gradient(#00bcd4, #00bcd4), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-teal .form-control:focus {
background-image: linear-gradient(#009688, #009688), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-green .form-control:focus {
background-image: linear-gradient(#4caf50, #4caf50), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-light-green .form-control:focus {
background-image: linear-gradient(#8bc34a, #8bc34a), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-lime .form-control:focus {
background-image: linear-gradient(#cddc39, #cddc39), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-yellow .form-control:focus {
background-image: linear-gradient(#ffeb3b, #ffeb3b), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-amber .form-control:focus {
background-image: linear-gradient(#ffc107, #ffc107), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-orange .form-control:focus {
background-image: linear-gradient(#ff9800, #ff9800), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-deep-orange .form-control:focus {
background-image: linear-gradient(#ff5722, #ff5722), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-brown .form-control:focus {
background-image: linear-gradient(#795548, #795548), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-grey .form-control:focus {
background-image: linear-gradient(#9e9e9e, #9e9e9e), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-blue-grey .form-control:focus {
background-image: linear-gradient(#607d8b, #607d8b), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group .form-control.focus,
.form-group-default .form-control.focus {
background-image: linear-gradient(#009688, #009688), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-black .form-control.focus {
background-image: linear-gradient(#000000, #000000), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-white .form-control.focus {
background-image: linear-gradient(#ffffff, #ffffff), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-inverse .form-control.focus {
background-image: linear-gradient(#3f51b5, #3f51b5), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-primary .form-control.focus {
background-image: linear-gradient(#009688, #009688), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-success .form-control.focus {
background-image: linear-gradient(#4caf50, #4caf50), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-info .form-control.focus {
background-image: linear-gradient(#03a9f4, #03a9f4), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-warning .form-control.focus {
background-image: linear-gradient(#ff5722, #ff5722), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-danger .form-control.focus {
background-image: linear-gradient(#f44336, #f44336), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-red .form-control.focus {
background-image: linear-gradient(#f44336, #f44336), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-pink .form-control.focus {
background-image: linear-gradient(#e91e63, #e91e63), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-purple .form-control.focus {
background-image: linear-gradient(#9c27b0, #9c27b0), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-deep-purple .form-control.focus {
background-image: linear-gradient(#673ab7, #673ab7), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-indigo .form-control.focus {
background-image: linear-gradient(#3f51b5, #3f51b5), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-blue .form-control.focus {
background-image: linear-gradient(#2196f3, #2196f3), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-light-blue .form-control.focus {
background-image: linear-gradient(#03a9f4, #03a9f4), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-cyan .form-control.focus {
background-image: linear-gradient(#00bcd4, #00bcd4), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-teal .form-control.focus {
background-image: linear-gradient(#009688, #009688), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-green .form-control.focus {
background-image: linear-gradient(#4caf50, #4caf50), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-light-green .form-control.focus {
background-image: linear-gradient(#8bc34a, #8bc34a), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-lime .form-control.focus {
background-image: linear-gradient(#cddc39, #cddc39), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-yellow .form-control.focus {
background-image: linear-gradient(#ffeb3b, #ffeb3b), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-amber .form-control.focus {
background-image: linear-gradient(#ffc107, #ffc107), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-orange .form-control.focus {
background-image: linear-gradient(#ff9800, #ff9800), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-deep-orange .form-control.focus {
background-image: linear-gradient(#ff5722, #ff5722), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-brown .form-control.focus {
background-image: linear-gradient(#795548, #795548), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-grey .form-control.focus {
background-image: linear-gradient(#9e9e9e, #9e9e9e), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group-material-blue-grey .form-control.focus {
background-image: linear-gradient(#607d8b, #607d8b), linear-gradient(#d2d2d2, #d2d2d2);
}
.form-group .control-label,
.form-group-default .control-label {
color: rgba(0, 0, 0, 0.84);
}
.form-group-black .control-label {
color: #000000;
}
.form-group-white .control-label {
color: #ffffff;
}
.form-group-inverse .control-label {
color: #3f51b5;
}
.form-group-primary .control-label {
color: #009688;
}
.form-group-success .control-label {
color: #4caf50;
}
.form-group-info .control-label {
color: #03a9f4;
}
.form-group-warning .control-label {
color: #ff5722;
}
.form-group-danger .control-label {
color: #f44336;
}
.form-group-material-red .control-label {
color: #f44336;
}
.form-group-material-pink .control-label {
color: #e91e63;
}
.form-group-material-purple .control-label {
color: #9c27b0;
}
.form-group-material-deep-purple .control-label {
color: #673ab7;
}
.form-group-material-indigo .control-label {
color: #3f51b5;
}
.form-group-material-blue .control-label {
color: #2196f3;
}
.form-group-material-light-blue .control-label {
color: #03a9f4;
}
.form-group-material-cyan .control-label {
color: #00bcd4;
}
.form-group-material-teal .control-label {
color: #009688;
}
.form-group-material-green .control-label {
color: #4caf50;
}
.form-group-material-light-green .control-label {
color: #8bc34a;
}
.form-group-material-lime .control-label {
color: #cddc39;
}
.form-group-material-yellow .control-label {
color: #ffeb3b;
}
.form-group-material-amber .control-label {
color: #ffc107;
}
.form-group-material-orange .control-label {
color: #ff9800;
}
.form-group-material-deep-orange .control-label {
color: #ff5722;
}
.form-group-material-brown .control-label {
color: #795548;
}
.form-group-material-grey .control-label {
color: #9e9e9e;
}
.form-group-material-blue-grey .control-label {
color: #607d8b;
}
.form-group input.form-control:focus ~ .floating-label,
.form-group-default input.form-control:focus ~ .floating-label {
color: #009688;
}
.form-group-black input.form-control:focus ~ .floating-label {
color: #000000;
}
.form-group-white input.form-control:focus ~ .floating-label {
color: #ffffff;
}
.form-group-inverse input.form-control:focus ~ .floating-label {
color: #3f51b5;
}
.form-group-primary input.form-control:focus ~ .floating-label {
color: #009688;
}
.form-group-success input.form-control:focus ~ .floating-label {
color: #4caf50;
}
.form-group-info input.form-control:focus ~ .floating-label {
color: #03a9f4;
}
.form-group-warning input.form-control:focus ~ .floating-label {
color: #ff5722;
}
.form-group-danger input.form-control:focus ~ .floating-label {
color: #f44336;
}
.form-group-material-red input.form-control:focus ~ .floating-label {
color: #f44336;
}
.form-group-material-pink input.form-control:focus ~ .floating-label {
color: #e91e63;
}
.form-group-material-purple input.form-control:focus ~ .floating-label {
color: #9c27b0;
}
.form-group-material-deep-purple input.form-control:focus ~ .floating-label {
color: #673ab7;
}
.form-group-material-indigo input.form-control:focus ~ .floating-label {
color: #3f51b5;
}
.form-group-material-blue input.form-control:focus ~ .floating-label {
color: #2196f3;
}
.form-group-material-light-blue input.form-control:focus ~ .floating-label {
color: #03a9f4;
}
.form-group-material-cyan input.form-control:focus ~ .floating-label {
color: #00bcd4;
}
.form-group-material-teal input.form-control:focus ~ .floating-label {
color: #009688;
}
.form-group-material-green input.form-control:focus ~ .floating-label {
color: #4caf50;
}
.form-group-material-light-green input.form-control:focus ~ .floating-label {
color: #8bc34a;
}
.form-group-material-lime input.form-control:focus ~ .floating-label {
color: #cddc39;
}
.form-group-material-yellow input.form-control:focus ~ .floating-label {
color: #ffeb3b;
}
.form-group-material-amber input.form-control:focus ~ .floating-label {
color: #ffc107;
}
.form-group-material-orange input.form-control:focus ~ .floating-label {
color: #ff9800;
}
.form-group-material-deep-orange input.form-control:focus ~ .floating-label {
color: #ff5722;
}
.form-group-material-brown input.form-control:focus ~ .floating-label {
color: #795548;
}
.form-group-material-grey input.form-control:focus ~ .floating-label {
color: #9e9e9e;
}
.form-group-material-blue-grey input.form-control:focus ~ .floating-label {
color: #607d8b;
}
.input-group .form-control-wrapper {
margin-right: 5px;
margin-left: 5px;
}
.input-group .form-control-wrapper .form-control {
float: none;
}
.input-group .input-group-addon {
border: 0;
background: transparent;
}
.input-group .input-group-btn .btn {
border-radius: 4px;
margin: 0;
}
select.form-control {
border: 0;
box-shadow: none;
border-radius: 0;
}
select.form-control:focus,
select.form-control.focus {
box-shadow: none;
border-color: #757575;
}
@-webkit-keyframes input-highlight {
0% {
background-size: 0 2px, 100% 1px;
}
100% {
background-size: 100% 2px, 100% 1px;
}
}
@keyframes input-highlight {
0% {
background-size: 0 2px, 100% 1px;
}
100% {
background-size: 100% 2px, 100% 1px;
}
}
.form-control-wrapper input[type=file] {
opacity: 0;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 100;
}
legend {
border-bottom: 0;
}
.list-group {
border-radius: 0;
}
.list-group .list-group-item {
background-color: transparent;
overflow: hidden;
border: 0;
border-radius: 0;
padding: 0 16px;
}
.list-group .list-group-item.baseline {
border-bottom: 1px solid #cecece;
}
.list-group .list-group-item.baseline:last-child {
border-bottom: none;
}
.list-group .list-group-item .row-picture,
.list-group .list-group-item .row-action-primary {
float: left;
display: inline-block;
padding-right: 16px;
}
.list-group .list-group-item .row-picture img,
.list-group .list-group-item .row-action-primary img,
.list-group .list-group-item .row-picture i,
.list-group .list-group-item .row-action-primary i,
.list-group .list-group-item .row-picture label,
.list-group .list-group-item .row-action-primary label {
display: block;
width: 56px;
height: 56px;
}
.list-group .list-group-item .row-picture img,
.list-group .list-group-item .row-action-primary img {
background: rgba(0, 0, 0, 0.1);
padding: 1px;
}
.list-group .list-group-item .row-picture img.circle,
.list-group .list-group-item .row-action-primary img.circle {
border-radius: 100%;
}
.list-group .list-group-item .row-picture i,
.list-group .list-group-item .row-action-primary i {
background: rgba(0, 0, 0, 0.25);
border-radius: 100%;
text-align: center;
line-height: 56px;
font-size: 20px;
color: white;
}
.list-group .list-group-item .row-picture label,
.list-group .list-group-item .row-action-primary label {
margin-left: 7px;
margin-right: -7px;
margin-top: 5px;
margin-bottom: -5px;
}
.list-group .list-group-item .row-picture label .checkbox-material,
.list-group .list-group-item .row-action-primary label .checkbox-material {
left: -10px;
}
.list-group .list-group-item .row-content {
display: inline-block;
width: calc(100% - 92px);
min-height: 66px;
}
.list-group .list-group-item .row-content .action-secondary {
position: absolute;
right: 16px;
top: 16px;
}
.list-group .list-group-item .row-content .action-secondary i {
font-size: 20px;
color: rgba(0, 0, 0, 0.25);
cursor: pointer;
}
.list-group .list-group-item .row-content .action-secondary ~ * {
max-width: calc(100% - 30px);
}
.list-group .list-group-item .row-content .least-content {
position: absolute;
right: 16px;
top: 0px;
color: rgba(0, 0, 0, 0.54);
font-size: 14px;
}
.list-group .list-group-item .list-group-item-heading {
color: rgba(0, 0, 0, 0.77);
font-size: 20px;
line-height: 29px;
}
.list-group .list-group-item.active:hover,
.list-group .list-group-item.active:focus {
background: rgba(0, 0, 0, 0.15);
outline: 10px solid rgba(0, 0, 0, 0.15);
}
.list-group .list-group-item.active .list-group-item-heading,
.list-group .list-group-item.active .list-group-item-text {
color: rgba(0, 0, 0, 0.84);
}
.list-group .list-group-separator {
clear: both;
overflow: hidden;
margin-top: 10px;
margin-bottom: 10px;
}
.list-group .list-group-separator:before {
content: "";
width: calc(100% - 90px);
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
float: right;
}
.navbar {
background-color: #009688;
border: 0;
border-radius: 0;
}
.navbar .navbar-brand {
position: relative;
height: 60px;
line-height: 30px;
color: inherit;
}
.navbar .navbar-brand:hover,
.navbar .navbar-brand:focus {
color: inherit;
background-color: transparent;
}
.navbar .navbar-text {
color: inherit;
margin-top: 20px;
margin-bottom: 20px;
}
.navbar .navbar-nav > li > a {
color: inherit;
padding-top: 20px;
padding-bottom: 20px;
}
.navbar .navbar-nav > li > a:hover,
.navbar .navbar-nav > li > a:focus {
color: inherit;
background-color: transparent;
}
.navbar .navbar-nav > .active > a,
.navbar .navbar-nav > .active > a:hover,
.navbar .navbar-nav > .active > a:focus {
color: inherit;
background-color: rgba(255, 255, 255, 0.1);
}
.navbar .navbar-nav > .disabled > a,
.navbar .navbar-nav > .disabled > a:hover,
.navbar .navbar-nav > .disabled > a:focus {
color: inherit;
background-color: transparent;
opacity: 0.9;
}
.navbar .navbar-toggle {
border: 0;
}
.navbar .navbar-toggle:hover,
.navbar .navbar-toggle:focus {
background-color: transparent;
}
.navbar .navbar-toggle .icon-bar {
background-color: inherit;
border: 1px solid;
}
.navbar .navbar-default .navbar-toggle,
.navbar .navbar-inverse .navbar-toggle {
border-color: transparent;
}
.navbar .navbar-collapse,
.navbar .navbar-form {
border-color: rgba(0, 0, 0, 0.1);
}
.navbar .navbar-nav > .open > a,
.navbar .navbar-nav > .open > a:hover,
.navbar .navbar-nav > .open > a:focus {
background-color: transparent;
color: inherit;
}
@media (max-width: 767px) {
.navbar .navbar-nav .navbar-text {
color: inherit;
margin-top: 15px;
margin-bottom: 15px;
}
.navbar .navbar-nav .open .dropdown-menu > .dropdown-header {
border: 0;
color: inherit;
}
.navbar .navbar-nav .open .dropdown-menu .divider {
border-bottom: 1px solid;
opacity: 0.08;
}
.navbar .navbar-nav .open .dropdown-menu > li > a {
color: inherit;
}
.navbar .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar .navbar-nav .open .dropdown-menu > li > a:focus {
color: inherit;
background-color: transparent;
}
.navbar .navbar-nav .open .dropdown-menu > .active > a,
.navbar .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar .navbar-nav .open .dropdown-menu > .active > a:focus {
color: inherit;
background-color: transparent;
}
.navbar .navbar-nav .open .dropdown-menu > .disabled > a,
.navbar .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.navbar .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: inherit;
background-color: transparent;
}
}
.navbar .navbar-link {
color: inherit;
}
.navbar .navbar-link:hover {
color: inherit;
}
.navbar .btn-link {
color: inherit;
}
.navbar .btn-link:hover,
.navbar .btn-link:focus {
color: inherit;
}
.navbar .btn-link[disabled]:hover,
fieldset[disabled] .navbar .btn-link:hover,
.navbar .btn-link[disabled]:focus,
fieldset[disabled] .navbar .btn-link:focus {
color: inherit;
}
.navbar .navbar-form {
margin-top: 16px;
}
.navbar .navbar-form .form-control-wrapper .form-control,
.navbar .navbar-form .form-control {
border-color: inherit;
color: inherit;
}
.navbar .navbar-form .form-control-wrapper .material-input:before,
.navbar .navbar-form .form-control-wrapper input:focus ~ .material-input:after {
background-color: inherit;
}
.navbar.navbar,
.navbar-default.navbar {
background-color: #009688;
color: rgba(255, 255, 255, 0.84);
}
.navbar.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-default.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar.navbar .navbar-form input.form-control::-webkit-input-placeholder,
.navbar-default.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-default.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar.navbar .navbar-form input.form-control::-moz-placeholder,
.navbar-default.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-default.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar.navbar .navbar-form input.form-control:-ms-input-placeholder,
.navbar-default.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-default.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar.navbar .navbar-form input.form-control::placeholder,
.navbar-default.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar.navbar .dropdown-menu li > a:hover,
.navbar-default.navbar .dropdown-menu li > a:hover,
.navbar.navbar .dropdown-menu li > a:focus,
.navbar-default.navbar .dropdown-menu li > a:focus {
color: #009688;
}
.navbar.navbar .dropdown-menu .active > a,
.navbar-default.navbar .dropdown-menu .active > a {
background-color: #009688;
color: rgba(255, 255, 255, 0.84);
}
.navbar.navbar .dropdown-menu .active > a:hover,
.navbar-default.navbar .dropdown-menu .active > a:hover,
.navbar.navbar .dropdown-menu .active > a:focus,
.navbar-default.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-black.navbar {
background-color: #000000;
color: rgba(255, 255, 255, 0.84);
}
.navbar-black.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-black.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-black.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-black.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-black.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-black.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-black.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-black.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-black.navbar .dropdown-menu li > a:hover,
.navbar-black.navbar .dropdown-menu li > a:focus {
color: #000000;
}
.navbar-black.navbar .dropdown-menu .active > a {
background-color: #000000;
color: rgba(255, 255, 255, 0.84);
}
.navbar-black.navbar .dropdown-menu .active > a:hover,
.navbar-black.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-white.navbar {
background-color: #ffffff;
color: rgba(0, 0, 0, 0.84);
}
.navbar-white.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-white.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-white.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-white.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-white.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-white.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-white.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-white.navbar .navbar-form input.form-control::placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-white.navbar .dropdown-menu li > a:hover,
.navbar-white.navbar .dropdown-menu li > a:focus {
color: #ffffff;
}
.navbar-white.navbar .dropdown-menu .active > a {
background-color: #ffffff;
color: rgba(0, 0, 0, 0.84);
}
.navbar-white.navbar .dropdown-menu .active > a:hover,
.navbar-white.navbar .dropdown-menu .active > a:focus {
color: rgba(0, 0, 0, 0.84);
}
.navbar-inverse.navbar {
background-color: #3f51b5;
color: rgba(255, 255, 255, 0.84);
}
.navbar-inverse.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-inverse.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-inverse.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-inverse.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-inverse.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-inverse.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-inverse.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-inverse.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-inverse.navbar .dropdown-menu li > a:hover,
.navbar-inverse.navbar .dropdown-menu li > a:focus {
color: #3f51b5;
}
.navbar-inverse.navbar .dropdown-menu .active > a {
background-color: #3f51b5;
color: rgba(255, 255, 255, 0.84);
}
.navbar-inverse.navbar .dropdown-menu .active > a:hover,
.navbar-inverse.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-primary.navbar {
background-color: #009688;
color: rgba(255, 255, 255, 0.84);
}
.navbar-primary.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-primary.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-primary.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-primary.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-primary.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-primary.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-primary.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-primary.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-primary.navbar .dropdown-menu li > a:hover,
.navbar-primary.navbar .dropdown-menu li > a:focus {
color: #009688;
}
.navbar-primary.navbar .dropdown-menu .active > a {
background-color: #009688;
color: rgba(255, 255, 255, 0.84);
}
.navbar-primary.navbar .dropdown-menu .active > a:hover,
.navbar-primary.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-success.navbar {
background-color: #4caf50;
color: rgba(255, 255, 255, 0.84);
}
.navbar-success.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-success.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-success.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-success.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-success.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-success.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-success.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-success.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-success.navbar .dropdown-menu li > a:hover,
.navbar-success.navbar .dropdown-menu li > a:focus {
color: #4caf50;
}
.navbar-success.navbar .dropdown-menu .active > a {
background-color: #4caf50;
color: rgba(255, 255, 255, 0.84);
}
.navbar-success.navbar .dropdown-menu .active > a:hover,
.navbar-success.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-info.navbar {
background-color: #03a9f4;
color: rgba(255, 255, 255, 0.84);
}
.navbar-info.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-info.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-info.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-info.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-info.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-info.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-info.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-info.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-info.navbar .dropdown-menu li > a:hover,
.navbar-info.navbar .dropdown-menu li > a:focus {
color: #03a9f4;
}
.navbar-info.navbar .dropdown-menu .active > a {
background-color: #03a9f4;
color: rgba(255, 255, 255, 0.84);
}
.navbar-info.navbar .dropdown-menu .active > a:hover,
.navbar-info.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-warning.navbar {
background-color: #ff5722;
color: rgba(255, 255, 255, 0.84);
}
.navbar-warning.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-warning.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-warning.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-warning.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-warning.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-warning.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-warning.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-warning.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-warning.navbar .dropdown-menu li > a:hover,
.navbar-warning.navbar .dropdown-menu li > a:focus {
color: #ff5722;
}
.navbar-warning.navbar .dropdown-menu .active > a {
background-color: #ff5722;
color: rgba(255, 255, 255, 0.84);
}
.navbar-warning.navbar .dropdown-menu .active > a:hover,
.navbar-warning.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-danger.navbar {
background-color: #f44336;
color: rgba(255, 255, 255, 0.84);
}
.navbar-danger.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-danger.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-danger.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-danger.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-danger.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-danger.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-danger.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-danger.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-danger.navbar .dropdown-menu li > a:hover,
.navbar-danger.navbar .dropdown-menu li > a:focus {
color: #f44336;
}
.navbar-danger.navbar .dropdown-menu .active > a {
background-color: #f44336;
color: rgba(255, 255, 255, 0.84);
}
.navbar-danger.navbar .dropdown-menu .active > a:hover,
.navbar-danger.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-red.navbar {
background-color: #f44336;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-red.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-red.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-red.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-red.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-red.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-red.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-red.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-red.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-red.navbar .dropdown-menu li > a:hover,
.navbar-material-red.navbar .dropdown-menu li > a:focus {
color: #f44336;
}
.navbar-material-red.navbar .dropdown-menu .active > a {
background-color: #f44336;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-red.navbar .dropdown-menu .active > a:hover,
.navbar-material-red.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-pink.navbar {
background-color: #e91e63;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-pink.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-pink.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-pink.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-pink.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-pink.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-pink.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-pink.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-pink.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-pink.navbar .dropdown-menu li > a:hover,
.navbar-material-pink.navbar .dropdown-menu li > a:focus {
color: #e91e63;
}
.navbar-material-pink.navbar .dropdown-menu .active > a {
background-color: #e91e63;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-pink.navbar .dropdown-menu .active > a:hover,
.navbar-material-pink.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-purple.navbar {
background-color: #9c27b0;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-purple.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-purple.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-purple.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-purple.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-purple.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-purple.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-purple.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-purple.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-purple.navbar .dropdown-menu li > a:hover,
.navbar-material-purple.navbar .dropdown-menu li > a:focus {
color: #9c27b0;
}
.navbar-material-purple.navbar .dropdown-menu .active > a {
background-color: #9c27b0;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-purple.navbar .dropdown-menu .active > a:hover,
.navbar-material-purple.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-deep-purple.navbar {
background-color: #673ab7;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-deep-purple.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-deep-purple.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-deep-purple.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-deep-purple.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-deep-purple.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-deep-purple.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-deep-purple.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-deep-purple.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-deep-purple.navbar .dropdown-menu li > a:hover,
.navbar-material-deep-purple.navbar .dropdown-menu li > a:focus {
color: #673ab7;
}
.navbar-material-deep-purple.navbar .dropdown-menu .active > a {
background-color: #673ab7;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-deep-purple.navbar .dropdown-menu .active > a:hover,
.navbar-material-deep-purple.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-indigo.navbar {
background-color: #3f51b5;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-indigo.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-indigo.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-indigo.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-indigo.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-indigo.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-indigo.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-indigo.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-indigo.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-indigo.navbar .dropdown-menu li > a:hover,
.navbar-material-indigo.navbar .dropdown-menu li > a:focus {
color: #3f51b5;
}
.navbar-material-indigo.navbar .dropdown-menu .active > a {
background-color: #3f51b5;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-indigo.navbar .dropdown-menu .active > a:hover,
.navbar-material-indigo.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-blue.navbar {
background-color: #2196f3;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-blue.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-blue.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-blue.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-blue.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-blue.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-blue.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-blue.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-blue.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-blue.navbar .dropdown-menu li > a:hover,
.navbar-material-blue.navbar .dropdown-menu li > a:focus {
color: #2196f3;
}
.navbar-material-blue.navbar .dropdown-menu .active > a {
background-color: #2196f3;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-blue.navbar .dropdown-menu .active > a:hover,
.navbar-material-blue.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-light-blue.navbar {
background-color: #03a9f4;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-light-blue.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-light-blue.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-light-blue.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-light-blue.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-light-blue.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-light-blue.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-light-blue.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-light-blue.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-light-blue.navbar .dropdown-menu li > a:hover,
.navbar-material-light-blue.navbar .dropdown-menu li > a:focus {
color: #03a9f4;
}
.navbar-material-light-blue.navbar .dropdown-menu .active > a {
background-color: #03a9f4;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-light-blue.navbar .dropdown-menu .active > a:hover,
.navbar-material-light-blue.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-cyan.navbar {
background-color: #00bcd4;
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-cyan.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-cyan.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-cyan.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-cyan.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-cyan.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-cyan.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-cyan.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-cyan.navbar .navbar-form input.form-control::placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-cyan.navbar .dropdown-menu li > a:hover,
.navbar-material-cyan.navbar .dropdown-menu li > a:focus {
color: #00bcd4;
}
.navbar-material-cyan.navbar .dropdown-menu .active > a {
background-color: #00bcd4;
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-cyan.navbar .dropdown-menu .active > a:hover,
.navbar-material-cyan.navbar .dropdown-menu .active > a:focus {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-teal.navbar {
background-color: #009688;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-teal.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-teal.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-teal.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-teal.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-teal.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-teal.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-teal.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-teal.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-teal.navbar .dropdown-menu li > a:hover,
.navbar-material-teal.navbar .dropdown-menu li > a:focus {
color: #009688;
}
.navbar-material-teal.navbar .dropdown-menu .active > a {
background-color: #009688;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-teal.navbar .dropdown-menu .active > a:hover,
.navbar-material-teal.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-green.navbar {
background-color: #4caf50;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-green.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-green.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-green.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-green.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-green.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-green.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-green.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-green.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-green.navbar .dropdown-menu li > a:hover,
.navbar-material-green.navbar .dropdown-menu li > a:focus {
color: #4caf50;
}
.navbar-material-green.navbar .dropdown-menu .active > a {
background-color: #4caf50;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-green.navbar .dropdown-menu .active > a:hover,
.navbar-material-green.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-light-green.navbar {
background-color: #8bc34a;
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-light-green.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-light-green.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-light-green.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-light-green.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-light-green.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-light-green.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-light-green.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-light-green.navbar .navbar-form input.form-control::placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-light-green.navbar .dropdown-menu li > a:hover,
.navbar-material-light-green.navbar .dropdown-menu li > a:focus {
color: #8bc34a;
}
.navbar-material-light-green.navbar .dropdown-menu .active > a {
background-color: #8bc34a;
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-light-green.navbar .dropdown-menu .active > a:hover,
.navbar-material-light-green.navbar .dropdown-menu .active > a:focus {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-lime.navbar {
background-color: #cddc39;
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-lime.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-lime.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-lime.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-lime.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-lime.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-lime.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-lime.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-lime.navbar .navbar-form input.form-control::placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-lime.navbar .dropdown-menu li > a:hover,
.navbar-material-lime.navbar .dropdown-menu li > a:focus {
color: #cddc39;
}
.navbar-material-lime.navbar .dropdown-menu .active > a {
background-color: #cddc39;
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-lime.navbar .dropdown-menu .active > a:hover,
.navbar-material-lime.navbar .dropdown-menu .active > a:focus {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-yellow.navbar {
background-color: #ffeb3b;
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-yellow.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-yellow.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-yellow.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-yellow.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-yellow.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-yellow.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-yellow.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-yellow.navbar .navbar-form input.form-control::placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-yellow.navbar .dropdown-menu li > a:hover,
.navbar-material-yellow.navbar .dropdown-menu li > a:focus {
color: #ffeb3b;
}
.navbar-material-yellow.navbar .dropdown-menu .active > a {
background-color: #ffeb3b;
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-yellow.navbar .dropdown-menu .active > a:hover,
.navbar-material-yellow.navbar .dropdown-menu .active > a:focus {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-amber.navbar {
background-color: #ffc107;
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-amber.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-amber.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-amber.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-amber.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-amber.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-amber.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-amber.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-amber.navbar .navbar-form input.form-control::placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-amber.navbar .dropdown-menu li > a:hover,
.navbar-material-amber.navbar .dropdown-menu li > a:focus {
color: #ffc107;
}
.navbar-material-amber.navbar .dropdown-menu .active > a {
background-color: #ffc107;
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-amber.navbar .dropdown-menu .active > a:hover,
.navbar-material-amber.navbar .dropdown-menu .active > a:focus {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-orange.navbar {
background-color: #ff9800;
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-orange.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-orange.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-orange.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-orange.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-orange.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-orange.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-orange.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-orange.navbar .navbar-form input.form-control::placeholder {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-orange.navbar .dropdown-menu li > a:hover,
.navbar-material-orange.navbar .dropdown-menu li > a:focus {
color: #ff9800;
}
.navbar-material-orange.navbar .dropdown-menu .active > a {
background-color: #ff9800;
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-orange.navbar .dropdown-menu .active > a:hover,
.navbar-material-orange.navbar .dropdown-menu .active > a:focus {
color: rgba(0, 0, 0, 0.84);
}
.navbar-material-deep-orange.navbar {
background-color: #ff5722;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-deep-orange.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-deep-orange.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-deep-orange.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-deep-orange.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-deep-orange.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-deep-orange.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-deep-orange.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-deep-orange.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-deep-orange.navbar .dropdown-menu li > a:hover,
.navbar-material-deep-orange.navbar .dropdown-menu li > a:focus {
color: #ff5722;
}
.navbar-material-deep-orange.navbar .dropdown-menu .active > a {
background-color: #ff5722;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-deep-orange.navbar .dropdown-menu .active > a:hover,
.navbar-material-deep-orange.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-brown.navbar {
background-color: #795548;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-brown.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-brown.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-brown.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-brown.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-brown.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-brown.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-brown.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-brown.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-brown.navbar .dropdown-menu li > a:hover,
.navbar-material-brown.navbar .dropdown-menu li > a:focus {
color: #795548;
}
.navbar-material-brown.navbar .dropdown-menu .active > a {
background-color: #795548;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-brown.navbar .dropdown-menu .active > a:hover,
.navbar-material-brown.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-grey.navbar {
background-color: #9e9e9e;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-grey.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-grey.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-grey.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-grey.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-grey.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-grey.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-grey.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-grey.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-grey.navbar .dropdown-menu li > a:hover,
.navbar-material-grey.navbar .dropdown-menu li > a:focus {
color: #9e9e9e;
}
.navbar-material-grey.navbar .dropdown-menu .active > a {
background-color: #9e9e9e;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-grey.navbar .dropdown-menu .active > a:hover,
.navbar-material-grey.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-blue-grey.navbar {
background-color: #607d8b;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-blue-grey.navbar .navbar-form .form-control-wrapper input.form-control::-webkit-input-placeholder,
.navbar-material-blue-grey.navbar .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-blue-grey.navbar .navbar-form .form-control-wrapper input.form-control::-moz-placeholder,
.navbar-material-blue-grey.navbar .navbar-form input.form-control::-moz-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-blue-grey.navbar .navbar-form .form-control-wrapper input.form-control:-ms-input-placeholder,
.navbar-material-blue-grey.navbar .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-blue-grey.navbar .navbar-form .form-control-wrapper input.form-control::placeholder,
.navbar-material-blue-grey.navbar .navbar-form input.form-control::placeholder {
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-blue-grey.navbar .dropdown-menu li > a:hover,
.navbar-material-blue-grey.navbar .dropdown-menu li > a:focus {
color: #607d8b;
}
.navbar-material-blue-grey.navbar .dropdown-menu .active > a {
background-color: #607d8b;
color: rgba(255, 255, 255, 0.84);
}
.navbar-material-blue-grey.navbar .dropdown-menu .active > a:hover,
.navbar-material-blue-grey.navbar .dropdown-menu .active > a:focus {
color: rgba(255, 255, 255, 0.84);
}
.navbar-inverse {
background-color: #3f51b5;
}
@media (max-width: 1199px) {
.navbar .navbar-brand {
height: 50px;
padding: 10px 15px;
}
.navbar .navbar-form {
margin-top: 10px;
}
.navbar .navbar-nav > li > a {
padding-top: 15px;
padding-bottom: 15px;
}
}
.dropdown-menu {
border: 0;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
}
.dropdown-menu .divider {
background-color: rgba(229, 229, 229, 0.12);
}
.dropdown-menu li {
overflow: hidden;
position: relative;
}
.dropdown-menu li a:hover {
background-color: transparent;
color: #009688;
}
.dropdown-menu li a:hover,
.dropdown-menu-default li a:hover {
color: #009688;
}
.dropdown-menu-black li a:hover {
color: #000000;
}
.dropdown-menu-white li a:hover {
color: #ffffff;
}
.dropdown-menu-inverse li a:hover {
color: #3f51b5;
}
.dropdown-menu-primary li a:hover {
color: #009688;
}
.dropdown-menu-success li a:hover {
color: #4caf50;
}
.dropdown-menu-info li a:hover {
color: #03a9f4;
}
.dropdown-menu-warning li a:hover {
color: #ff5722;
}
.dropdown-menu-danger li a:hover {
color: #f44336;
}
.dropdown-menu-material-red li a:hover {
color: #f44336;
}
.dropdown-menu-material-pink li a:hover {
color: #e91e63;
}
.dropdown-menu-material-purple li a:hover {
color: #9c27b0;
}
.dropdown-menu-material-deep-purple li a:hover {
color: #673ab7;
}
.dropdown-menu-material-indigo li a:hover {
color: #3f51b5;
}
.dropdown-menu-material-blue li a:hover {
color: #2196f3;
}
.dropdown-menu-material-light-blue li a:hover {
color: #03a9f4;
}
.dropdown-menu-material-cyan li a:hover {
color: #00bcd4;
}
.dropdown-menu-material-teal li a:hover {
color: #009688;
}
.dropdown-menu-material-green li a:hover {
color: #4caf50;
}
.dropdown-menu-material-light-green li a:hover {
color: #8bc34a;
}
.dropdown-menu-material-lime li a:hover {
color: #cddc39;
}
.dropdown-menu-material-yellow li a:hover {
color: #ffeb3b;
}
.dropdown-menu-material-amber li a:hover {
color: #ffc107;
}
.dropdown-menu-material-orange li a:hover {
color: #ff9800;
}
.dropdown-menu-material-deep-orange li a:hover {
color: #ff5722;
}
.dropdown-menu-material-brown li a:hover {
color: #795548;
}
.dropdown-menu-material-grey li a:hover {
color: #9e9e9e;
}
.dropdown-menu-material-blue-grey li a:hover {
color: #607d8b;
}
.alert {
border: 0px;
border-radius: 0;
}
.alert,
.alert-default {
background-color: rgba(255, 255, 255, 0.84);
color: rgba(255, 255, 255, 0.84);
}
.alert a,
.alert-default a,
.alert .alert-link,
.alert-default .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-black {
background-color: #000000;
color: rgba(255, 255, 255, 0.84);
}
.alert-black a,
.alert-black .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-white {
background-color: #ffffff;
color: rgba(0, 0, 0, 0.84);
}
.alert-white a,
.alert-white .alert-link {
color: rgba(0, 0, 0, 0.84);
}
.alert-inverse {
background-color: #3f51b5;
color: rgba(255, 255, 255, 0.84);
}
.alert-inverse a,
.alert-inverse .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-primary {
background-color: #009688;
color: rgba(255, 255, 255, 0.84);
}
.alert-primary a,
.alert-primary .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-success {
background-color: #4caf50;
color: rgba(255, 255, 255, 0.84);
}
.alert-success a,
.alert-success .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-info {
background-color: #03a9f4;
color: rgba(255, 255, 255, 0.84);
}
.alert-info a,
.alert-info .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-warning {
background-color: #ff5722;
color: rgba(255, 255, 255, 0.84);
}
.alert-warning a,
.alert-warning .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-danger {
background-color: #f44336;
color: rgba(255, 255, 255, 0.84);
}
.alert-danger a,
.alert-danger .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-material-red {
background-color: #f44336;
color: rgba(255, 255, 255, 0.84);
}
.alert-material-red a,
.alert-material-red .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-material-pink {
background-color: #e91e63;
color: rgba(255, 255, 255, 0.84);
}
.alert-material-pink a,
.alert-material-pink .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-material-purple {
background-color: #9c27b0;
color: rgba(255, 255, 255, 0.84);
}
.alert-material-purple a,
.alert-material-purple .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-material-deep-purple {
background-color: #673ab7;
color: rgba(255, 255, 255, 0.84);
}
.alert-material-deep-purple a,
.alert-material-deep-purple .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-material-indigo {
background-color: #3f51b5;
color: rgba(255, 255, 255, 0.84);
}
.alert-material-indigo a,
.alert-material-indigo .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-material-blue {
background-color: #2196f3;
color: rgba(255, 255, 255, 0.84);
}
.alert-material-blue a,
.alert-material-blue .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-material-light-blue {
background-color: #03a9f4;
color: rgba(255, 255, 255, 0.84);
}
.alert-material-light-blue a,
.alert-material-light-blue .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-material-cyan {
background-color: #00bcd4;
color: rgba(0, 0, 0, 0.84);
}
.alert-material-cyan a,
.alert-material-cyan .alert-link {
color: rgba(0, 0, 0, 0.84);
}
.alert-material-teal {
background-color: #009688;
color: rgba(255, 255, 255, 0.84);
}
.alert-material-teal a,
.alert-material-teal .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-material-green {
background-color: #4caf50;
color: rgba(255, 255, 255, 0.84);
}
.alert-material-green a,
.alert-material-green .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-material-light-green {
background-color: #8bc34a;
color: rgba(0, 0, 0, 0.84);
}
.alert-material-light-green a,
.alert-material-light-green .alert-link {
color: rgba(0, 0, 0, 0.84);
}
.alert-material-lime {
background-color: #cddc39;
color: rgba(0, 0, 0, 0.84);
}
.alert-material-lime a,
.alert-material-lime .alert-link {
color: rgba(0, 0, 0, 0.84);
}
.alert-material-yellow {
background-color: #ffeb3b;
color: rgba(0, 0, 0, 0.84);
}
.alert-material-yellow a,
.alert-material-yellow .alert-link {
color: rgba(0, 0, 0, 0.84);
}
.alert-material-amber {
background-color: #ffc107;
color: rgba(0, 0, 0, 0.84);
}
.alert-material-amber a,
.alert-material-amber .alert-link {
color: rgba(0, 0, 0, 0.84);
}
.alert-material-orange {
background-color: #ff9800;
color: rgba(0, 0, 0, 0.84);
}
.alert-material-orange a,
.alert-material-orange .alert-link {
color: rgba(0, 0, 0, 0.84);
}
.alert-material-deep-orange {
background-color: #ff5722;
color: rgba(255, 255, 255, 0.84);
}
.alert-material-deep-orange a,
.alert-material-deep-orange .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-material-brown {
background-color: #795548;
color: rgba(255, 255, 255, 0.84);
}
.alert-material-brown a,
.alert-material-brown .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-material-grey {
background-color: #9e9e9e;
color: rgba(255, 255, 255, 0.84);
}
.alert-material-grey a,
.alert-material-grey .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-material-blue-grey {
background-color: #607d8b;
color: rgba(255, 255, 255, 0.84);
}
.alert-material-blue-grey a,
.alert-material-blue-grey .alert-link {
color: rgba(255, 255, 255, 0.84);
}
.alert-info,
.alert-danger,
.alert-warning,
.alert-success {
color: rgba(255, 255, 255, 0.84);
}
.alert-default a,
.alert-default .alert-link {
color: rgba(0, 0, 0, 0.84);
}
.progress {
height: 4px;
border-radius: 0;
box-shadow: none;
background: #c8c8c8;
}
.progress .progress-bar {
box-shadow: none;
}
.progress .progress-bar,
.progress .progress-bar-default {
background-color: #009688;
}
.progress .progress-bar-black {
background-color: #000000;
}
.progress .progress-bar-white {
background-color: #ffffff;
}
.progress .progress-bar-inverse {
background-color: #3f51b5;
}
.progress .progress-bar-primary {
background-color: #009688;
}
.progress .progress-bar-success {
background-color: #4caf50;
}
.progress .progress-bar-info {
background-color: #03a9f4;
}
.progress .progress-bar-warning {
background-color: #ff5722;
}
.progress .progress-bar-danger {
background-color: #f44336;
}
.progress .progress-bar-material-red {
background-color: #f44336;
}
.progress .progress-bar-material-pink {
background-color: #e91e63;
}
.progress .progress-bar-material-purple {
background-color: #9c27b0;
}
.progress .progress-bar-material-deep-purple {
background-color: #673ab7;
}
.progress .progress-bar-material-indigo {
background-color: #3f51b5;
}
.progress .progress-bar-material-blue {
background-color: #2196f3;
}
.progress .progress-bar-material-light-blue {
background-color: #03a9f4;
}
.progress .progress-bar-material-cyan {
background-color: #00bcd4;
}
.progress .progress-bar-material-teal {
background-color: #009688;
}
.progress .progress-bar-material-green {
background-color: #4caf50;
}
.progress .progress-bar-material-light-green {
background-color: #8bc34a;
}
.progress .progress-bar-material-lime {
background-color: #cddc39;
}
.progress .progress-bar-material-yellow {
background-color: #ffeb3b;
}
.progress .progress-bar-material-amber {
background-color: #ffc107;
}
.progress .progress-bar-material-orange {
background-color: #ff9800;
}
.progress .progress-bar-material-deep-orange {
background-color: #ff5722;
}
.progress .progress-bar-material-brown {
background-color: #795548;
}
.progress .progress-bar-material-grey {
background-color: #9e9e9e;
}
.progress .progress-bar-material-blue-grey {
background-color: #607d8b;
}
.text-warning {
color: #ff5722;
}
.text-primary {
color: #009688;
}
.text-danger {
color: #f44336;
}
.text-success {
color: #4caf50;
}
.text-info {
color: #03a9f4;
}
.nav-tabs {
background: #009688;
}
.nav-tabs > li > a {
color: #FFFFFF;
border: 0;
margin: 0;
}
.nav-tabs > li > a:hover {
background-color: transparent;
border: 0;
}
.nav-tabs > li > a,
.nav-tabs > li > a:hover,
.nav-tabs > li > a:focus {
background-color: transparent !important;
border: 0 !important;
color: #FFFFFF !important;
font-weight: 500;
}
.nav-tabs > li.disabled > a,
.nav-tabs > li.disabled > a:hover {
color: rgba(255, 255, 255, 0.5);
}
.popover,
.tooltip-inner {
color: #ececec;
line-height: 1em;
background: rgba(101, 101, 101, 0.9);
border: none;
border-radius: 2px;
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.12), 0 1px 6px 0 rgba(0, 0, 0, 0.12);
}
.tooltip,
.tooltip.in {
opacity: 1;
}
.popover .arrow,
.tooltip .arrow,
.popover .tooltip-arrow,
.tooltip .tooltip-arrow {
display: none;
}
.mdi,
icon {
line-height: inherit;
vertical-align: bottom;
}
.mdi,
icon,
.mdi-default,
icon-default {
color: rgba(0, 0, 0, 0.84);
}
.mdi-black,
icon-black {
color: #000000;
}
.mdi-white,
icon-white {
color: #ffffff;
}
.mdi-inverse,
icon-inverse {
color: #3f51b5;
}
.mdi-primary,
icon-primary {
color: #009688;
}
.mdi-success,
icon-success {
color: #4caf50;
}
.mdi-info,
icon-info {
color: #03a9f4;
}
.mdi-warning,
icon-warning {
color: #ff5722;
}
.mdi-danger,
icon-danger {
color: #f44336;
}
.mdi-material-red,
icon-material-red {
color: #f44336;
}
.mdi-material-pink,
icon-material-pink {
color: #e91e63;
}
.mdi-material-purple,
icon-material-purple {
color: #9c27b0;
}
.mdi-material-deep-purple,
icon-material-deep-purple {
color: #673ab7;
}
.mdi-material-indigo,
icon-material-indigo {
color: #3f51b5;
}
.mdi-material-blue,
icon-material-blue {
color: #2196f3;
}
.mdi-material-light-blue,
icon-material-light-blue {
color: #03a9f4;
}
.mdi-material-cyan,
icon-material-cyan {
color: #00bcd4;
}
.mdi-material-teal,
icon-material-teal {
color: #009688;
}
.mdi-material-green,
icon-material-green {
color: #4caf50;
}
.mdi-material-light-green,
icon-material-light-green {
color: #8bc34a;
}
.mdi-material-lime,
icon-material-lime {
color: #cddc39;
}
.mdi-material-yellow,
icon-material-yellow {
color: #ffeb3b;
}
.mdi-material-amber,
icon-material-amber {
color: #ffc107;
}
.mdi-material-orange,
icon-material-orange {
color: #ff9800;
}
.mdi-material-deep-orange,
icon-material-deep-orange {
color: #ff5722;
}
.mdi-material-brown,
icon-material-brown {
color: #795548;
}
.mdi-material-grey,
icon-material-grey {
color: #9e9e9e;
}
.mdi-material-blue-grey,
icon-material-blue-grey {
color: #607d8b;
}
.card {
/***** Make height equal to width (http://stackoverflow.com/a/6615994) ****/
display: inline-block;
position: relative;
width: 100%;
/**************************************************************************/
border-radius: 2px;
color: rgba(0, 0, 0, 0.84);
background: #ffffff;
box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.card .card-height-indicator {
margin-top: 100%;
}
.card .card-content {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.card .card-image {
height: 60%;
position: relative;
overflow: hidden;
}
.card .card-image img {
width: 100%;
height: 100%;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
pointer-events: none;
}
.card .card-image .card-image-headline {
position: absolute;
bottom: 16px;
left: 18px;
color: #ffffff;
font-size: 2em;
}
.card .card-body {
height: 30%;
padding: 18px;
}
.card .card-footer {
height: 10%;
padding: 18px;
}
.card .card-footer button {
margin: 0 !important;
position: relative;
bottom: 25px;
width: auto;
}
.card .card-footer button:first-child {
left: -15px;
}
.modal-content {
box-shadow: 0 27px 24px 0 rgba(0, 0, 0, 0.2), 0 40px 77px 0 rgba(0, 0, 0, 0.22);
border-radius: 2px;
border: none;
}
.modal-content .modal-header {
border-bottom: none;
padding-top: 24px;
padding-right: 24px;
padding-bottom: 0px;
padding-left: 24px;
}
.modal-content .modal-body {
padding-top: 0px;
padding-right: 24px;
padding-bottom: 16px;
padding-left: 24px;
}
.modal-content .modal-footer {
border-top: none;
padding: 7px;
}
.modal-content .modal-footer button {
margin: 0;
padding-left: 16px;
padding-right: 16px;
width: auto;
}
.modal-content .modal-footer button.pull-left {
padding-left: 5px;
padding-right: 5px;
position: relative;
left: -5px;
}
.modal-content .modal-footer button + button {
margin-bottom: 16px;
}
.modal-content .modal-body + .modal-footer {
padding-top: 0;
}
.modal-backdrop {
background: rgba(0, 0, 0, 0.3);
}
.label {
border-radius: 1px;
}
.label,
.label-default {
background-color: #9e9e9e;
}
.label-black {
background-color: #000000;
}
.label-white {
background-color: #ffffff;
}
.label-inverse {
background-color: #3f51b5;
}
.label-primary {
background-color: #009688;
}
.label-success {
background-color: #4caf50;
}
.label-info {
background-color: #03a9f4;
}
.label-warning {
background-color: #ff5722;
}
.label-danger {
background-color: #f44336;
}
.label-material-red {
background-color: #f44336;
}
.label-material-pink {
background-color: #e91e63;
}
.label-material-purple {
background-color: #9c27b0;
}
.label-material-deep-purple {
background-color: #673ab7;
}
.label-material-indigo {
background-color: #3f51b5;
}
.label-material-blue {
background-color: #2196f3;
}
.label-material-light-blue {
background-color: #03a9f4;
}
.label-material-cyan {
background-color: #00bcd4;
}
.label-material-teal {
background-color: #009688;
}
.label-material-green {
background-color: #4caf50;
}
.label-material-light-green {
background-color: #8bc34a;
}
.label-material-lime {
background-color: #cddc39;
}
.label-material-yellow {
background-color: #ffeb3b;
}
.label-material-amber {
background-color: #ffc107;
}
.label-material-orange {
background-color: #ff9800;
}
.label-material-deep-orange {
background-color: #ff5722;
}
.label-material-brown {
background-color: #795548;
}
.label-material-grey {
background-color: #9e9e9e;
}
.label-material-blue-grey {
background-color: #607d8b;
}
.panel {
border-radius: 2px;
border: 0;
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.12), 0 1px 6px 0 rgba(0, 0, 0, 0.12);
}
.panel > .panel-heading,
.panel-default > .panel-heading {
background-color: #eeeeee;
}
.panel-black > .panel-heading {
background-color: #000000;
}
.panel-white > .panel-heading {
background-color: #ffffff;
}
.panel-inverse > .panel-heading {
background-color: #3f51b5;
}
.panel-primary > .panel-heading {
background-color: #009688;
}
.panel-success > .panel-heading {
background-color: #4caf50;
}
.panel-info > .panel-heading {
background-color: #03a9f4;
}
.panel-warning > .panel-heading {
background-color: #ff5722;
}
.panel-danger > .panel-heading {
background-color: #f44336;
}
.panel-material-red > .panel-heading {
background-color: #f44336;
}
.panel-material-pink > .panel-heading {
background-color: #e91e63;
}
.panel-material-purple > .panel-heading {
background-color: #9c27b0;
}
.panel-material-deep-purple > .panel-heading {
background-color: #673ab7;
}
.panel-material-indigo > .panel-heading {
background-color: #3f51b5;
}
.panel-material-blue > .panel-heading {
background-color: #2196f3;
}
.panel-material-light-blue > .panel-heading {
background-color: #03a9f4;
}
.panel-material-cyan > .panel-heading {
background-color: #00bcd4;
}
.panel-material-teal > .panel-heading {
background-color: #009688;
}
.panel-material-green > .panel-heading {
background-color: #4caf50;
}
.panel-material-light-green > .panel-heading {
background-color: #8bc34a;
}
.panel-material-lime > .panel-heading {
background-color: #cddc39;
}
.panel-material-yellow > .panel-heading {
background-color: #ffeb3b;
}
.panel-material-amber > .panel-heading {
background-color: #ffc107;
}
.panel-material-orange > .panel-heading {
background-color: #ff9800;
}
.panel-material-deep-orange > .panel-heading {
background-color: #ff5722;
}
.panel-material-brown > .panel-heading {
background-color: #795548;
}
.panel-material-grey > .panel-heading {
background-color: #9e9e9e;
}
.panel-material-blue-grey > .panel-heading {
background-color: #607d8b;
}
[class*="panel-"] > .panel-heading {
color: rgba(255, 255, 255, 0.84);
border: 0;
}
.panel-default > .panel-heading,
.panel:not([class*="panel-"]) > .panel-heading {
color: rgba(0, 0, 0, 0.84);
}
.panel-footer {
background-color: #eeeeee;
}
hr.on-dark {
color: #1a1a1a;
}
hr.on-light {
color: #ffffff;
}
@media (-webkit-min-device-pixel-ratio: 0.75), (min--moz-device-pixel-ratio: 0.75), (-o-device-pixel-ratio: 3/4), (min-device-pixel-ratio: 0.75), (min-resolution: 0.75dppx), (min-resolution: 120dpi) {
hr {
height: 0.75px;
}
}
@media (-webkit-min-device-pixel-ratio: 1), (min--moz-device-pixel-ratio: 1), (-o-device-pixel-ratio: 1), (min-device-pixel-ratio: 1), (min-resolution: 1dppx), (min-resolution: 160dpi) {
hr {
height: 1px;
}
}
@media (-webkit-min-device-pixel-ratio: 1.33), (min--moz-device-pixel-ratio: 1.33), (-o-device-pixel-ratio: 133/100), (min-device-pixel-ratio: 1.33), (min-resolution: 1.33dppx), (min-resolution: 213dpi) {
hr {
height: 1.333px;
}
}
@media (-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-device-pixel-ratio: 3/2), (min-device-pixel-ratio: 1.5), (min-resolution: 1.5dppx), (min-resolution: 240dpi) {
hr {
height: 1.5px;
}
}
@media (-webkit-min-device-pixel-ratio: 2), (min--moz-device-pixel-ratio: 2), (-o-device-pixel-ratio: 2/1), (min-device-pixel-ratio: 2), (min-resolution: 2dppx), (min-resolution: 380dpi) {
hr {
height: 2px;
}
}
@media (-webkit-min-device-pixel-ratio: 3), (min--moz-device-pixel-ratio: 3), (-o-device-pixel-ratio: 3/1), (min-device-pixel-ratio: 3), (min-resolution: 3dppx), (min-resolution: 480dpi) {
hr {
height: 3px;
}
}
@media (-webkit-min-device-pixel-ratio: 4), (min--moz-device-pixel-ratio: 4), (-o-device-pixel-ratio: 4/1), (min-device-pixel-ratio: 3), (min-resolution: 4dppx), (min-resolution: 640dpi) {
hr {
height: 4px;
}
}
* {
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
-webkit-tap-highlight-color: transparent;
}
*:focus {
outline: 0;
}
.snackbar {
background-color: #323232;
color: rgba(255, 255, 255, 0.84);
font-size: 14px;
border-radius: 2px;
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.12), 0 1px 6px 0 rgba(0, 0, 0, 0.12);
height: 0;
transition: -webkit-transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0 linear 0.2s, padding 0 linear 0.2s, height 0 linear 0.2s;
transition: transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0 linear 0.2s, padding 0 linear 0.2s, height 0 linear 0.2s;
-webkit-transform: translateY(200%);
-ms-transform: translateY(200%);
transform: translateY(200%);
}
.snackbar.snackbar-opened {
padding: 14px 15px;
margin-bottom: 20px;
height: auto;
transition: -webkit-transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0 linear 0.2s, height 0 linear 0.2s;
transition: transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0 linear 0.2s, height 0 linear 0.2s;
-webkit-transform: none;
-ms-transform: none;
transform: none;
}
.snackbar.toast {
border-radius: 200px;
}
.noUi-target,
.noUi-target * {
-webkit-touch-callout: none;
-ms-touch-action: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
box-sizing: border-box;
}
.noUi-base {
width: 100%;
height: 100%;
position: relative;
}
.noUi-origin {
position: absolute;
right: 0;
top: 0;
left: 0;
bottom: 0;
}
.noUi-handle {
position: relative;
z-index: 1;
box-sizing: border-box;
}
.noUi-stacking .noUi-handle {
z-index: 10;
}
.noUi-stacking + .noUi-origin {
*z-index: -1;
}
.noUi-state-tap .noUi-origin {
transition: left 0.3s, top 0.3s;
}
.noUi-state-drag * {
cursor: inherit !important;
}
.noUi-horizontal {
height: 10px;
}
.noUi-handle {
box-sizing: border-box;
width: 12px;
height: 12px;
left: -10px;
top: -5px;
cursor: ew-resize;
border-radius: 100%;
transition: all 0.2s ease-out;
border: 1px solid;
}
.noUi-vertical .noUi-handle {
margin-left: 5px;
cursor: ns-resize;
}
.noUi-horizontal.noUi-extended {
padding: 0 15px;
}
.noUi-horizontal.noUi-extended .noUi-origin {
right: -15px;
}
.noUi-background {
height: 2px;
margin: 20px 0;
}
.noUi-origin {
margin: 0;
border-radius: 0;
height: 2px;
background: #c8c8c8;
}
.noUi-origin[style^="left: 0"] .noUi-handle {
background-color: #fff;
border: 2px solid #c8c8c8;
}
.noUi-origin[style^="left: 0"] .noUi-handle.noUi-active {
border-width: 1px;
}
.noUi-target {
border-radius: 2px;
}
.noUi-horizontal {
height: 2px;
margin: 15px 0;
}
.noUi-vertical {
height: 100%;
width: 2px;
margin: 0 15px;
display: inline-block;
}
.noUi-handle.noUi-active {
-webkit-transform: scale3d(2.5, 2.5, 1);
transform: scale3d(2.5, 2.5, 1);
}
[disabled].noUi-slider {
opacity: 0.5;
}
[disabled] .noUi-handle {
cursor: not-allowed;
}
.slider {
background: #c8c8c8;
}
.slider.noUi-connect,
.slider-default.noUi-connect {
background-color: #009688;
}
.slider-black.noUi-connect {
background-color: #000000;
}
.slider-white.noUi-connect {
background-color: #ffffff;
}
.slider-inverse.noUi-connect {
background-color: #3f51b5;
}
.slider-primary.noUi-connect {
background-color: #009688;
}
.slider-success.noUi-connect {
background-color: #4caf50;
}
.slider-info.noUi-connect {
background-color: #03a9f4;
}
.slider-warning.noUi-connect {
background-color: #ff5722;
}
.slider-danger.noUi-connect {
background-color: #f44336;
}
.slider-material-red.noUi-connect {
background-color: #f44336;
}
.slider-material-pink.noUi-connect {
background-color: #e91e63;
}
.slider-material-purple.noUi-connect {
background-color: #9c27b0;
}
.slider-material-deep-purple.noUi-connect {
background-color: #673ab7;
}
.slider-material-indigo.noUi-connect {
background-color: #3f51b5;
}
.slider-material-blue.noUi-connect {
background-color: #2196f3;
}
.slider-material-light-blue.noUi-connect {
background-color: #03a9f4;
}
.slider-material-cyan.noUi-connect {
background-color: #00bcd4;
}
.slider-material-teal.noUi-connect {
background-color: #009688;
}
.slider-material-green.noUi-connect {
background-color: #4caf50;
}
.slider-material-light-green.noUi-connect {
background-color: #8bc34a;
}
.slider-material-lime.noUi-connect {
background-color: #cddc39;
}
.slider-material-yellow.noUi-connect {
background-color: #ffeb3b;
}
.slider-material-amber.noUi-connect {
background-color: #ffc107;
}
.slider-material-orange.noUi-connect {
background-color: #ff9800;
}
.slider-material-deep-orange.noUi-connect {
background-color: #ff5722;
}
.slider-material-brown.noUi-connect {
background-color: #795548;
}
.slider-material-grey.noUi-connect {
background-color: #9e9e9e;
}
.slider-material-blue-grey.noUi-connect {
background-color: #607d8b;
}
.slider .noUi-connect,
.slider-default .noUi-connect {
background-color: #009688;
}
.slider-black .noUi-connect {
background-color: #000000;
}
.slider-white .noUi-connect {
background-color: #ffffff;
}
.slider-inverse .noUi-connect {
background-color: #3f51b5;
}
.slider-primary .noUi-connect {
background-color: #009688;
}
.slider-success .noUi-connect {
background-color: #4caf50;
}
.slider-info .noUi-connect {
background-color: #03a9f4;
}
.slider-warning .noUi-connect {
background-color: #ff5722;
}
.slider-danger .noUi-connect {
background-color: #f44336;
}
.slider-material-red .noUi-connect {
background-color: #f44336;
}
.slider-material-pink .noUi-connect {
background-color: #e91e63;
}
.slider-material-purple .noUi-connect {
background-color: #9c27b0;
}
.slider-material-deep-purple .noUi-connect {
background-color: #673ab7;
}
.slider-material-indigo .noUi-connect {
background-color: #3f51b5;
}
.slider-material-blue .noUi-connect {
background-color: #2196f3;
}
.slider-material-light-blue .noUi-connect {
background-color: #03a9f4;
}
.slider-material-cyan .noUi-connect {
background-color: #00bcd4;
}
.slider-material-teal .noUi-connect {
background-color: #009688;
}
.slider-material-green .noUi-connect {
background-color: #4caf50;
}
.slider-material-light-green .noUi-connect {
background-color: #8bc34a;
}
.slider-material-lime .noUi-connect {
background-color: #cddc39;
}
.slider-material-yellow .noUi-connect {
background-color: #ffeb3b;
}
.slider-material-amber .noUi-connect {
background-color: #ffc107;
}
.slider-material-orange .noUi-connect {
background-color: #ff9800;
}
.slider-material-deep-orange .noUi-connect {
background-color: #ff5722;
}
.slider-material-brown .noUi-connect {
background-color: #795548;
}
.slider-material-grey .noUi-connect {
background-color: #9e9e9e;
}
.slider-material-blue-grey .noUi-connect {
background-color: #607d8b;
}
.slider .noUi-handle,
.slider-default .noUi-handle {
background-color: #009688;
}
.slider-black .noUi-handle {
background-color: #000000;
}
.slider-white .noUi-handle {
background-color: #ffffff;
}
.slider-inverse .noUi-handle {
background-color: #3f51b5;
}
.slider-primary .noUi-handle {
background-color: #009688;
}
.slider-success .noUi-handle {
background-color: #4caf50;
}
.slider-info .noUi-handle {
background-color: #03a9f4;
}
.slider-warning .noUi-handle {
background-color: #ff5722;
}
.slider-danger .noUi-handle {
background-color: #f44336;
}
.slider-material-red .noUi-handle {
background-color: #f44336;
}
.slider-material-pink .noUi-handle {
background-color: #e91e63;
}
.slider-material-purple .noUi-handle {
background-color: #9c27b0;
}
.slider-material-deep-purple .noUi-handle {
background-color: #673ab7;
}
.slider-material-indigo .noUi-handle {
background-color: #3f51b5;
}
.slider-material-blue .noUi-handle {
background-color: #2196f3;
}
.slider-material-light-blue .noUi-handle {
background-color: #03a9f4;
}
.slider-material-cyan .noUi-handle {
background-color: #00bcd4;
}
.slider-material-teal .noUi-handle {
background-color: #009688;
}
.slider-material-green .noUi-handle {
background-color: #4caf50;
}
.slider-material-light-green .noUi-handle {
background-color: #8bc34a;
}
.slider-material-lime .noUi-handle {
background-color: #cddc39;
}
.slider-material-yellow .noUi-handle {
background-color: #ffeb3b;
}
.slider-material-amber .noUi-handle {
background-color: #ffc107;
}
.slider-material-orange .noUi-handle {
background-color: #ff9800;
}
.slider-material-deep-orange .noUi-handle {
background-color: #ff5722;
}
.slider-material-brown .noUi-handle {
background-color: #795548;
}
.slider-material-grey .noUi-handle {
background-color: #9e9e9e;
}
.slider-material-blue-grey .noUi-handle {
background-color: #607d8b;
}
.slider .noUi-handle,
.slider-default .noUi-handle {
border-color: #009688;
}
.slider-black .noUi-handle {
border-color: #000000;
}
.slider-white .noUi-handle {
border-color: #ffffff;
}
.slider-inverse .noUi-handle {
border-color: #3f51b5;
}
.slider-primary .noUi-handle {
border-color: #009688;
}
.slider-success .noUi-handle {
border-color: #4caf50;
}
.slider-info .noUi-handle {
border-color: #03a9f4;
}
.slider-warning .noUi-handle {
border-color: #ff5722;
}
.slider-danger .noUi-handle {
border-color: #f44336;
}
.slider-material-red .noUi-handle {
border-color: #f44336;
}
.slider-material-pink .noUi-handle {
border-color: #e91e63;
}
.slider-material-purple .noUi-handle {
border-color: #9c27b0;
}
.slider-material-deep-purple .noUi-handle {
border-color: #673ab7;
}
.slider-material-indigo .noUi-handle {
border-color: #3f51b5;
}
.slider-material-blue .noUi-handle {
border-color: #2196f3;
}
.slider-material-light-blue .noUi-handle {
border-color: #03a9f4;
}
.slider-material-cyan .noUi-handle {
border-color: #00bcd4;
}
.slider-material-teal .noUi-handle {
border-color: #009688;
}
.slider-material-green .noUi-handle {
border-color: #4caf50;
}
.slider-material-light-green .noUi-handle {
border-color: #8bc34a;
}
.slider-material-lime .noUi-handle {
border-color: #cddc39;
}
.slider-material-yellow .noUi-handle {
border-color: #ffeb3b;
}
.slider-material-amber .noUi-handle {
border-color: #ffc107;
}
.slider-material-orange .noUi-handle {
border-color: #ff9800;
}
.slider-material-deep-orange .noUi-handle {
border-color: #ff5722;
}
.slider-material-brown .noUi-handle {
border-color: #795548;
}
.slider-material-grey .noUi-handle {
border-color: #9e9e9e;
}
.slider-material-blue-grey .noUi-handle {
border-color: #607d8b;
}
.selectize-control.single,
.selectize-control.multi {
padding: 0;
}
.selectize-control.single .selectize-input,
.selectize-control.multi .selectize-input,
.selectize-control.single .selectize-input.input-active,
.selectize-control.multi .selectize-input.input-active {
cursor: text;
background: transparent;
box-shadow: none;
border: 0;
padding: 0;
height: 100%;
font-size: 14px;
line-height: 30px;
}
.selectize-control.single .selectize-input .has-items,
.selectize-control.multi .selectize-input .has-items,
.selectize-control.single .selectize-input.input-active .has-items,
.selectize-control.multi .selectize-input.input-active .has-items {
padding: 0;
}
.selectize-control.single .selectize-input:after,
.selectize-control.multi .selectize-input:after,
.selectize-control.single .selectize-input.input-active:after,
.selectize-control.multi .selectize-input.input-active:after {
right: 5px;
position: absolute;
font-size: 7px;
content: "\e894";
font-family: "Material-Design-Icons";
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 4;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.selectize-control.single .selectize-input input,
.selectize-control.multi .selectize-input input,
.selectize-control.single .selectize-input.input-active input,
.selectize-control.multi .selectize-input.input-active input {
font-size: 14px;
outline: 0px;
border: 0px;
background: transparent;
}
.selectize-control.single .selectize-input.floating-label-fix input,
.selectize-control.multi .selectize-input.floating-label-fix input,
.selectize-control.single .selectize-input.input-active.floating-label-fix input,
.selectize-control.multi .selectize-input.input-active.floating-label-fix input {
opacity: 0;
}
.selectize-control.single .selectize-input > div,
.selectize-control.multi .selectize-input > div,
.selectize-control.single .selectize-input.input-active > div,
.selectize-control.multi .selectize-input.input-active > div,
.selectize-control.single .selectize-input > .item,
.selectize-control.multi .selectize-input > .item,
.selectize-control.single .selectize-input.input-active > .item,
.selectize-control.multi .selectize-input.input-active > .item {
display: inline-block;
margin: 0 8px 3px 0;
padding: 0;
background: transparent;
border: 0;
}
.selectize-control.single .selectize-input > div:after,
.selectize-control.multi .selectize-input > div:after,
.selectize-control.single .selectize-input.input-active > div:after,
.selectize-control.multi .selectize-input.input-active > div:after,
.selectize-control.single .selectize-input > .item:after,
.selectize-control.multi .selectize-input > .item:after,
.selectize-control.single .selectize-input.input-active > .item:after,
.selectize-control.multi .selectize-input.input-active > .item:after {
content: ",";
}
.selectize-control.single .selectize-input > div:last-of-type:after,
.selectize-control.multi .selectize-input > div:last-of-type:after,
.selectize-control.single .selectize-input.input-active > div:last-of-type:after,
.selectize-control.multi .selectize-input.input-active > div:last-of-type:after,
.selectize-control.single .selectize-input > .item:last-of-type:after,
.selectize-control.multi .selectize-input > .item:last-of-type:after,
.selectize-control.single .selectize-input.input-active > .item:last-of-type:after,
.selectize-control.multi .selectize-input.input-active > .item:last-of-type:after {
content: "";
}
.selectize-control.single .selectize-input > div.active,
.selectize-control.multi .selectize-input > div.active,
.selectize-control.single .selectize-input.input-active > div.active,
.selectize-control.multi .selectize-input.input-active > div.active,
.selectize-control.single .selectize-input > .item.active,
.selectize-control.multi .selectize-input > .item.active,
.selectize-control.single .selectize-input.input-active > .item.active,
.selectize-control.multi .selectize-input.input-active > .item.active {
font-weight: bold;
background: transparent;
border: 0;
}
.selectize-control.single .selectize-dropdown,
.selectize-control.multi .selectize-dropdown {
position: absolute;
z-index: 1000;
border: 0;
width: 100% !important;
left: 0 !important;
height: auto;
background-color: #FFF;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
border-radius: 2px;
padding: 0;
margin-top: 3px;
}
.selectize-control.single .selectize-dropdown .active,
.selectize-control.multi .selectize-dropdown .active {
background-color: inherit;
}
.selectize-control.single .selectize-dropdown .highlight,
.selectize-control.multi .selectize-dropdown .highlight {
background-color: #d5d8ff;
}
.selectize-control.single .selectize-dropdown .selected,
.selectize-control.multi .selectize-dropdown .selected,
.selectize-control.single .selectize-dropdown .selected.active,
.selectize-control.multi .selectize-dropdown .selected.active {
background-color: #EEEEEE;
}
.selectize-control.single .selectize-dropdown [data-selectable],
.selectize-control.multi .selectize-dropdown [data-selectable],
.selectize-control.single .selectize-dropdown .optgroup-header,
.selectize-control.multi .selectize-dropdown .optgroup-header {
padding: 10px 20px;
cursor: pointer;
}
.selectize-control.single .dropdown-active ~ .selectize-dropdown,
.selectize-control.multi .dropdown-active ~ .selectize-dropdown {
display: block;
}
.dropdownjs:after {
right: 5px;
top: 3px;
font-size: 25px;
position: absolute;
content: "\e894";
font-family: "Material-Design-Icons";
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
pointer-events: none;
color: #757575;
}
.shadow-z-1 {
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.12), 0 1px 6px 0 rgba(0, 0, 0, 0.12);
}
.shadow-z-1-hover {
box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15);
}
.shadow-z-2 {
box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.shadow-z-3 {
box-shadow: 0 12px 15px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19);
}
.shadow-z-4 {
box-shadow: 0 16px 28px 0 rgba(0, 0, 0, 0.22), 0 25px 55px 0 rgba(0, 0, 0, 0.21);
}
.shadow-z-5 {
box-shadow: 0 27px 24px 0 rgba(0, 0, 0, 0.2), 0 40px 77px 0 rgba(0, 0, 0, 0.22);
}
/*# sourceMappingURL=material.css.map */
|
Realbee/BestofFriends
|
bower_components/bootstrap-material-design/dist/css/material.css
|
CSS
|
mit
| 225,994 |
tinymce.PluginManager.add("autolink",function(a){function b(a){e(a,-1,"(",!0)}function c(a){e(a,0,"",!0)}function d(a){e(a,-1,"",!1)}function e(a,b,c){function d(a,b){if(0>b&&(b=0),3==a.nodeType){var c=a.data.length;b>c&&(b=c)}return b}function e(a,b){g.setStart(a,d(a,b))}function f(a,b){g.setEnd(a,d(a,b))}var g,h,i,j,k,l,m,n,o,p;if(g=a.selection.getRng(!0).cloneRange(),g.startOffset<5){if(n=g.endContainer.previousSibling,!n){if(!g.endContainer.firstChild||!g.endContainer.firstChild.nextSibling)return;n=g.endContainer.firstChild.nextSibling}if(o=n.length,e(n,o),f(n,o),g.endOffset<5)return;h=g.endOffset,j=n}else{if(j=g.endContainer,3!=j.nodeType&&j.firstChild){for(;3!=j.nodeType&&j.firstChild;)j=j.firstChild;3==j.nodeType&&(e(j,0),f(j,j.nodeValue.length))}h=1==g.endOffset?2:g.endOffset-1-b}i=h;do e(j,h>=2?h-2:0),f(j,h>=1?h-1:0),h-=1,p=g.toString();while(" "!=p&&""!==p&&160!=p.charCodeAt(0)&&h-2>=0&&p!=c);g.toString()==c||160==g.toString().charCodeAt(0)?(e(j,h),f(j,i),h+=1):0===g.startOffset?(e(j,0),f(j,i)):(e(j,h),f(j,i)),l=g.toString(),"."==l.charAt(l.length-1)&&f(j,i-1),l=g.toString(),m=l.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i),m&&("www."==m[1]?m[1]="http://www.":/@$/.test(m[1])&&!/^mailto:/.test(m[1])&&(m[1]="mailto:"+m[1]),k=a.selection.getBookmark(),a.selection.setRng(g),a.execCommand("createlink",!1,m[1]+m[2]),a.selection.moveToBookmark(k),a.nodeChanged())}var f;return a.on("keydown",function(b){return 13==b.keyCode?d(a):void 0}),tinymce.Env.ie?void a.on("focus",function(){if(!f){f=!0;try{a.execCommand("AutoUrlDetect",!1,!0)}catch(b){}}}):(a.on("keypress",function(c){return 41==c.keyCode?b(a):void 0}),void a.on("keyup",function(b){return 32==b.keyCode?c(a):void 0}))});
|
perdona/cdnjs
|
ajax/libs/tinymce/4.1.6/plugins/autolink/plugin.min.js
|
JavaScript
|
mit
| 1,753 |
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.jade=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';
var nodes = require('./nodes');
var filters = require('./filters');
var doctypes = require('./doctypes');
var selfClosing = require('./self-closing');
var runtime = require('./runtime');
var utils = require('./utils');
var parseJSExpression = require('character-parser').parseMax;
var isConstant = require('constantinople');
var toConstant = require('constantinople').toConstant;
/**
* Initialize `Compiler` with the given `node`.
*
* @param {Node} node
* @param {Object} options
* @api public
*/
var Compiler = module.exports = function Compiler(node, options) {
this.options = options = options || {};
this.node = node;
this.hasCompiledDoctype = false;
this.hasCompiledTag = false;
this.pp = options.pretty || false;
this.debug = false !== options.compileDebug;
this.indents = 0;
this.parentIndents = 0;
this.terse = false;
if (options.doctype) this.setDoctype(options.doctype);
};
/**
* Compiler prototype.
*/
Compiler.prototype = {
/**
* Compile parse tree to JavaScript.
*
* @api public
*/
compile: function(){
this.buf = [];
if (this.pp) this.buf.push("jade.indent = [];");
this.lastBufferedIdx = -1;
this.visit(this.node);
return this.buf.join('\n');
},
/**
* Sets the default doctype `name`. Sets terse mode to `true` when
* html 5 is used, causing self-closing tags to end with ">" vs "/>",
* and boolean attributes are not mirrored.
*
* @param {string} name
* @api public
*/
setDoctype: function(name){
name = name || 'default';
this.doctype = doctypes[name.toLowerCase()] || '<!DOCTYPE ' + name + '>';
this.terse = this.doctype.toLowerCase() == '<!doctype html>';
this.xml = 0 == this.doctype.indexOf('<?xml');
},
/**
* Buffer the given `str` exactly as is or with interpolation
*
* @param {String} str
* @param {Boolean} interpolate
* @api public
*/
buffer: function (str, interpolate) {
var self = this;
if (interpolate) {
var match = /(\\)?([#!]){((?:.|\n)*)$/.exec(str);
if (match) {
this.buffer(str.substr(0, match.index), false);
if (match[1]) { // escape
this.buffer(match[2] + '{', false);
this.buffer(match[3], true);
return;
} else {
try {
var rest = match[3];
var range = parseJSExpression(rest);
var code = ('!' == match[2] ? '' : 'jade.escape') + "((jade.interp = " + range.src + ") == null ? '' : jade.interp)";
} catch (ex) {
throw ex;
//didn't match, just as if escaped
this.buffer(match[2] + '{', false);
this.buffer(match[3], true);
return;
}
this.bufferExpression(code);
this.buffer(rest.substr(range.end + 1), true);
return;
}
}
}
str = JSON.stringify(str);
str = str.substr(1, str.length - 2);
if (this.lastBufferedIdx == this.buf.length) {
if (this.lastBufferedType === 'code') this.lastBuffered += ' + "';
this.lastBufferedType = 'text';
this.lastBuffered += str;
this.buf[this.lastBufferedIdx - 1] = 'buf.push(' + this.bufferStartChar + this.lastBuffered + '");'
} else {
this.buf.push('buf.push("' + str + '");');
this.lastBufferedType = 'text';
this.bufferStartChar = '"';
this.lastBuffered = str;
this.lastBufferedIdx = this.buf.length;
}
},
/**
* Buffer the given `src` so it is evaluated at run time
*
* @param {String} src
* @api public
*/
bufferExpression: function (src) {
var fn = Function('', 'return (' + src + ');');
if (isConstant(src)) {
return this.buffer(fn(), false)
}
if (this.lastBufferedIdx == this.buf.length) {
if (this.lastBufferedType === 'text') this.lastBuffered += '"';
this.lastBufferedType = 'code';
this.lastBuffered += ' + (' + src + ')';
this.buf[this.lastBufferedIdx - 1] = 'buf.push(' + this.bufferStartChar + this.lastBuffered + ');'
} else {
this.buf.push('buf.push(' + src + ');');
this.lastBufferedType = 'code';
this.bufferStartChar = '';
this.lastBuffered = '(' + src + ')';
this.lastBufferedIdx = this.buf.length;
}
},
/**
* Buffer an indent based on the current `indent`
* property and an additional `offset`.
*
* @param {Number} offset
* @param {Boolean} newline
* @api public
*/
prettyIndent: function(offset, newline){
offset = offset || 0;
newline = newline ? '\n' : '';
this.buffer(newline + Array(this.indents + offset).join(' '));
if (this.parentIndents)
this.buf.push("buf.push.apply(buf, jade.indent);");
},
/**
* Visit `node`.
*
* @param {Node} node
* @api public
*/
visit: function(node){
var debug = this.debug;
if (debug) {
this.buf.push('jade_debug.unshift({ lineno: ' + node.line
+ ', filename: ' + (node.filename
? JSON.stringify(node.filename)
: 'jade_debug[0].filename')
+ ' });');
}
// Massive hack to fix our context
// stack for - else[ if] etc
if (false === node.debug && this.debug) {
this.buf.pop();
this.buf.pop();
}
this.visitNode(node);
if (debug) this.buf.push('jade_debug.shift();');
},
/**
* Visit `node`.
*
* @param {Node} node
* @api public
*/
visitNode: function(node){
return this['visit' + node.type](node);
},
/**
* Visit case `node`.
*
* @param {Literal} node
* @api public
*/
visitCase: function(node){
var _ = this.withinCase;
this.withinCase = true;
this.buf.push('switch (' + node.expr + '){');
this.visit(node.block);
this.buf.push('}');
this.withinCase = _;
},
/**
* Visit when `node`.
*
* @param {Literal} node
* @api public
*/
visitWhen: function(node){
if ('default' == node.expr) {
this.buf.push('default:');
} else {
this.buf.push('case ' + node.expr + ':');
}
this.visit(node.block);
this.buf.push(' break;');
},
/**
* Visit literal `node`.
*
* @param {Literal} node
* @api public
*/
visitLiteral: function(node){
this.buffer(node.str);
},
/**
* Visit all nodes in `block`.
*
* @param {Block} block
* @api public
*/
visitBlock: function(block){
var len = block.nodes.length
, escape = this.escape
, pp = this.pp
// Pretty print multi-line text
if (pp && len > 1 && !escape && block.nodes[0].isText && block.nodes[1].isText)
this.prettyIndent(1, true);
for (var i = 0; i < len; ++i) {
// Pretty print text
if (pp && i > 0 && !escape && block.nodes[i].isText && block.nodes[i-1].isText)
this.prettyIndent(1, false);
this.visit(block.nodes[i]);
// Multiple text nodes are separated by newlines
if (block.nodes[i+1] && block.nodes[i].isText && block.nodes[i+1].isText)
this.buffer('\n');
}
},
/**
* Visit a mixin's `block` keyword.
*
* @param {MixinBlock} block
* @api public
*/
visitMixinBlock: function(block){
if (this.pp) this.buf.push("jade.indent.push('" + Array(this.indents + 1).join(' ') + "');");
this.buf.push('block && block();');
if (this.pp) this.buf.push("jade.indent.pop();");
},
/**
* Visit `doctype`. Sets terse mode to `true` when html 5
* is used, causing self-closing tags to end with ">" vs "/>",
* and boolean attributes are not mirrored.
*
* @param {Doctype} doctype
* @api public
*/
visitDoctype: function(doctype){
if (doctype && (doctype.val || !this.doctype)) {
this.setDoctype(doctype.val || 'default');
}
if (this.doctype) this.buffer(this.doctype);
this.hasCompiledDoctype = true;
},
/**
* Visit `mixin`, generating a function that
* may be called within the template.
*
* @param {Mixin} mixin
* @api public
*/
visitMixin: function(mixin){
var name = 'jade_mixins[';
var args = mixin.args || '';
var block = mixin.block;
var attrs = mixin.attrs;
var attrsBlocks = mixin.attributeBlocks;
var pp = this.pp;
name += (mixin.name[0]=='#' ? mixin.name.substr(2,mixin.name.length-3):'"'+mixin.name+'"')+']';
if (mixin.call) {
if (pp) this.buf.push("jade.indent.push('" + Array(this.indents + 1).join(' ') + "');")
if (block || attrs.length || attrsBlocks.length) {
this.buf.push(name + '.call({');
if (block) {
this.buf.push('block: function(){');
// Render block with no indents, dynamically added when rendered
this.parentIndents++;
var _indents = this.indents;
this.indents = 0;
this.visit(mixin.block);
this.indents = _indents;
this.parentIndents--;
if (attrs.length || attrsBlocks.length) {
this.buf.push('},');
} else {
this.buf.push('}');
}
}
if (attrsBlocks.length) {
if (attrs.length) {
var val = this.attrs(attrs);
attrsBlocks.unshift(val);
}
this.buf.push('attributes: jade.merge([' + attrsBlocks.join(',') + '])');
} else if (attrs.length) {
var val = this.attrs(attrs);
this.buf.push('attributes: ' + val);
}
if (args) {
this.buf.push('}, ' + args + ');');
} else {
this.buf.push('});');
}
} else {
this.buf.push(name + '(' + args + ');');
}
if (pp) this.buf.push("jade.indent.pop();")
} else {
this.buf.push(name + ' = function(' + args + '){');
this.buf.push('var block = (this && this.block), attributes = (this && this.attributes) || {};');
this.parentIndents++;
this.visit(block);
this.parentIndents--;
this.buf.push('};');
}
},
/**
* Visit `tag` buffering tag markup, generating
* attributes, visiting the `tag`'s code and block.
*
* @param {Tag} tag
* @api public
*/
visitTag: function(tag){
this.indents++;
var name = tag.name
, pp = this.pp
, self = this;
function bufferName() {
if (tag.buffer) self.bufferExpression(name);
else self.buffer(name);
}
if ('pre' == tag.name) this.escape = true;
if (!this.hasCompiledTag) {
if (!this.hasCompiledDoctype && 'html' == name) {
this.visitDoctype();
}
this.hasCompiledTag = true;
}
// pretty print
if (pp && !tag.isInline())
this.prettyIndent(0, true);
if ((~selfClosing.indexOf(name) || tag.selfClosing) && !this.xml) {
this.buffer('<');
bufferName();
this.visitAttributes(tag.attrs, tag.attributeBlocks);
this.terse
? this.buffer('>')
: this.buffer('/>');
// if it is non-empty throw an error
if (tag.block && !(tag.block.type === 'Block' && tag.block.nodes.length === 0)
&& tag.block.nodes.some(function (tag) { return tag.type !== 'Text' || !/^\s*$/.test(tag.val)})) {
throw new Error(name + ' is self closing and should not have content.');
}
} else {
// Optimize attributes buffering
this.buffer('<');
bufferName();
this.visitAttributes(tag.attrs, tag.attributeBlocks);
this.buffer('>');
if (tag.code) this.visitCode(tag.code);
this.visit(tag.block);
// pretty print
if (pp && !tag.isInline() && 'pre' != tag.name && !tag.canInline())
this.prettyIndent(0, true);
this.buffer('</');
bufferName();
this.buffer('>');
}
if ('pre' == tag.name) this.escape = false;
this.indents--;
},
/**
* Visit `filter`, throwing when the filter does not exist.
*
* @param {Filter} filter
* @api public
*/
visitFilter: function(filter){
var text = filter.block.nodes.map(
function(node){ return node.val; }
).join('\n');
filter.attrs = filter.attrs || {};
filter.attrs.filename = this.options.filename;
this.buffer(filters(filter.name, text, filter.attrs), true);
},
/**
* Visit `text` node.
*
* @param {Text} text
* @api public
*/
visitText: function(text){
this.buffer(text.val, true);
},
/**
* Visit a `comment`, only buffering when the buffer flag is set.
*
* @param {Comment} comment
* @api public
*/
visitComment: function(comment){
if (!comment.buffer) return;
if (this.pp) this.prettyIndent(1, true);
this.buffer('<!--' + comment.val + '-->');
},
/**
* Visit a `BlockComment`.
*
* @param {Comment} comment
* @api public
*/
visitBlockComment: function(comment){
if (!comment.buffer) return;
if (this.pp) this.prettyIndent(1, true);
this.buffer('<!--' + comment.val);
this.visit(comment.block);
if (this.pp) this.prettyIndent(1, true);
this.buffer('-->');
},
/**
* Visit `code`, respecting buffer / escape flags.
* If the code is followed by a block, wrap it in
* a self-calling function.
*
* @param {Code} code
* @api public
*/
visitCode: function(code){
// Wrap code blocks with {}.
// we only wrap unbuffered code blocks ATM
// since they are usually flow control
// Buffer code
if (code.buffer) {
var val = code.val.trimLeft();
val = 'null == (jade.interp = '+val+') ? "" : jade.interp';
if (code.escape) val = 'jade.escape(' + val + ')';
this.bufferExpression(val);
} else {
this.buf.push(code.val);
}
// Block support
if (code.block) {
if (!code.buffer) this.buf.push('{');
this.visit(code.block);
if (!code.buffer) this.buf.push('}');
}
},
/**
* Visit `each` block.
*
* @param {Each} each
* @api public
*/
visitEach: function(each){
this.buf.push(''
+ '// iterate ' + each.obj + '\n'
+ ';(function(){\n'
+ ' var $$obj = ' + each.obj + ';\n'
+ ' if (\'number\' == typeof $$obj.length) {\n');
if (each.alternative) {
this.buf.push(' if ($$obj.length) {');
}
this.buf.push(''
+ ' for (var ' + each.key + ' = 0, $$l = $$obj.length; ' + each.key + ' < $$l; ' + each.key + '++) {\n'
+ ' var ' + each.val + ' = $$obj[' + each.key + '];\n');
this.visit(each.block);
this.buf.push(' }\n');
if (each.alternative) {
this.buf.push(' } else {');
this.visit(each.alternative);
this.buf.push(' }');
}
this.buf.push(''
+ ' } else {\n'
+ ' var $$l = 0;\n'
+ ' for (var ' + each.key + ' in $$obj) {\n'
+ ' $$l++;'
+ ' var ' + each.val + ' = $$obj[' + each.key + '];\n');
this.visit(each.block);
this.buf.push(' }\n');
if (each.alternative) {
this.buf.push(' if ($$l === 0) {');
this.visit(each.alternative);
this.buf.push(' }');
}
this.buf.push(' }\n}).call(this);\n');
},
/**
* Visit `attrs`.
*
* @param {Array} attrs
* @api public
*/
visitAttributes: function(attrs, attributeBlocks){
if (attributeBlocks.length) {
if (attrs.length) {
var val = this.attrs(attrs);
attributeBlocks.unshift(val);
}
this.bufferExpression('jade.attrs(jade.merge([' + attributeBlocks.join(',') + ']), ' + JSON.stringify(this.terse) + ')');
} else if (attrs.length) {
this.attrs(attrs, true);
}
},
/**
* Compile attributes.
*/
attrs: function(attrs, buffer){
var buf = [];
var classes = [];
var classEscaping = [];
attrs.forEach(function(attr){
var key = attr.name;
var escaped = attr.escaped;
if (key === 'class') {
classes.push(attr.val);
classEscaping.push(attr.escaped);
} else if (isConstant(attr.val)) {
if (buffer) {
this.buffer(runtime.attr(key, toConstant(attr.val), escaped, this.terse));
} else {
var val = toConstant(attr.val);
if (escaped && !(key.indexOf('data') === 0 && typeof val !== 'string')) {
val = runtime.escape(val);
}
buf.push(JSON.stringify(key) + ': ' + JSON.stringify(val));
}
} else {
if (buffer) {
this.bufferExpression('jade.attr("' + key + '", ' + attr.val + ', ' + JSON.stringify(escaped) + ', ' + JSON.stringify(this.terse) + ')');
} else {
var val = attr.val;
if (escaped && !(key.indexOf('data') === 0)) {
val = 'jade.escape(' + val + ')';
} else if (escaped) {
val = '(typeof (jade.interp = ' + val + ') == "string" ? jade.escape(jade.interp) : jade.interp)"';
}
buf.push(JSON.stringify(key) + ': ' + val);
}
}
}.bind(this));
if (buffer) {
if (classes.every(isConstant)) {
this.buffer(runtime.cls(classes.map(toConstant), classEscaping));
} else {
this.bufferExpression('jade.cls([' + classes.join(',') + '], ' + JSON.stringify(classEscaping) + ')');
}
} else {
if (classes.every(isConstant)) {
classes = JSON.stringify(runtime.joinClasses(classes.map(toConstant).map(runtime.joinClasses).map(function (cls, i) {
return classEscaping[i] ? runtime.escape(cls) : cls;
})));
} else if (classes.length) {
classes = '(jade.interp = ' + JSON.stringify(classEscaping) + ',' +
' jade.joinClasses([' + classes.join(',') + '].map(jade.joinClasses).map(function (cls, i) {' +
' return jade.interp[i] ? jade.escape(cls) : cls' +
' }))' +
')';
}
if (classes.length)
buf.push('"class": ' + classes);
}
return '{' + buf.join(',') + '}';
}
};
},{"./doctypes":2,"./filters":3,"./nodes":16,"./runtime":24,"./self-closing":25,"./utils":26,"character-parser":33,"constantinople":34}],2:[function(require,module,exports){
'use strict';
module.exports = {
'default': '<!DOCTYPE html>'
, 'xml': '<?xml version="1.0" encoding="utf-8" ?>'
, 'transitional': '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
, 'strict': '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
, 'frameset': '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">'
, '1.1': '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'
, 'basic': '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">'
, 'mobile': '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">'
};
},{}],3:[function(require,module,exports){
'use strict';
module.exports = filter;
function filter(name, str, options) {
if (typeof filter[name] === 'function') {
var res = filter[name](str, options);
} else {
throw new Error('unknown filter ":' + name + '"');
}
return res;
}
filter.exists = function (name, str, options) {
return typeof filter[name] === 'function';
};
},{}],4:[function(require,module,exports){
'use strict';
module.exports = [
'a'
, 'abbr'
, 'acronym'
, 'b'
, 'br'
, 'code'
, 'em'
, 'font'
, 'i'
, 'img'
, 'ins'
, 'kbd'
, 'map'
, 'samp'
, 'small'
, 'span'
, 'strong'
, 'sub'
, 'sup'
];
},{}],5:[function(require,module,exports){
'use strict';
/*!
* Jade
* Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var Parser = require('./parser')
, Lexer = require('./lexer')
, Compiler = require('./compiler')
, runtime = require('./runtime')
, addWith = require('with')
, fs = require('fs');
/**
* Expose self closing tags.
*/
exports.selfClosing = require('./self-closing');
/**
* Default supported doctypes.
*/
exports.doctypes = require('./doctypes');
/**
* Text filters.
*/
exports.filters = require('./filters');
/**
* Utilities.
*/
exports.utils = require('./utils');
/**
* Expose `Compiler`.
*/
exports.Compiler = Compiler;
/**
* Expose `Parser`.
*/
exports.Parser = Parser;
/**
* Expose `Lexer`.
*/
exports.Lexer = Lexer;
/**
* Nodes.
*/
exports.nodes = require('./nodes');
/**
* Jade runtime helpers.
*/
exports.runtime = runtime;
/**
* Template function cache.
*/
exports.cache = {};
/**
* Parse the given `str` of jade and return a function body.
*
* @param {String} str
* @param {Object} options
* @return {String}
* @api private
*/
function parse(str, options){
try {
// Parse
var parser = new (options.parser || Parser)(str, options.filename, options);
// Compile
var compiler = new (options.compiler || Compiler)(parser.parse(), options)
, js = compiler.compile();
// Debug compiler
if (options.debug) {
console.error('\nCompiled Function:\n\n\u001b[90m%s\u001b[0m', js.replace(/^/gm, ' '));
}
var globals = options.globals && Array.isArray(options.globals) ? options.globals : [];
globals.push('jade');
globals.push('jade_mixins');
globals.push('jade_debug');
globals.push('buf');
return ''
+ 'var buf = [];\n'
+ 'var jade_mixins = {};\n'
+ (options.self
? 'var self = locals || {};\n' + js
: addWith('locals || {}', '\n' + js, globals)) + ';'
+ 'return buf.join("");';
} catch (err) {
parser = parser.context();
runtime.rethrow(err, parser.filename, parser.lexer.lineno, parser.input);
}
}
/**
* Compile a `Function` representation of the given jade `str`.
*
* Options:
*
* - `compileDebug` when `false` debugging code is stripped from the compiled
template, when it is explicitly `true`, the source code is included in
the compiled template for better accuracy.
* - `filename` used to improve errors when `compileDebug` is not `false` and to resolve imports/extends
*
* @param {String} str
* @param {Options} options
* @return {Function}
* @api public
*/
exports.compile = function(str, options){
var options = options || {}
, filename = options.filename
? JSON.stringify(options.filename)
: 'undefined'
, fn;
str = String(str);
if (options.compileDebug !== false) {
fn = [
'var jade_debug = [{ lineno: 1, filename: ' + filename + ' }];'
, 'try {'
, parse(str, options)
, '} catch (err) {'
, ' jade.rethrow(err, jade_debug[0].filename, jade_debug[0].lineno' + (options.compileDebug === true ? ',' + JSON.stringify(str) : '') + ');'
, '}'
].join('\n');
} else {
fn = parse(str, options);
}
fn = new Function('locals, jade', fn)
var res = function(locals){ return fn(locals, Object.create(runtime)) };
if (options.client) {
res.toString = function () {
var err = new Error('The `client` option is deprecated, use `jade.compileClient`');
console.error(err.stack || err.message);
return exports.compileClient(str, options);
};
}
return res;
};
/**
* Compile a JavaScript source representation of the given jade `str`.
*
* Options:
*
* - `compileDebug` When it is `true`, the source code is included in
the compiled template for better error messages.
* - `filename` used to improve errors when `compileDebug` is not `true` and to resolve imports/extends
*
* @param {String} str
* @param {Options} options
* @return {String}
* @api public
*/
exports.compileClient = function(str, options){
var options = options || {}
, filename = options.filename
? JSON.stringify(options.filename)
: 'undefined'
, fn;
str = String(str);
if (options.compileDebug) {
options.compileDebug = true;
fn = [
'var jade_debug = [{ lineno: 1, filename: ' + filename + ' }];'
, 'try {'
, parse(str, options)
, '} catch (err) {'
, ' jade.rethrow(err, jade_debug[0].filename, jade_debug[0].lineno, ' + JSON.stringify(str) + ');'
, '}'
].join('\n');
} else {
options.compileDebug = false;
fn = parse(str, options);
}
return 'function template(locals) {\n' + fn + '\n}';
};
/**
* Render the given `str` of jade.
*
* Options:
*
* - `cache` enable template caching
* - `filename` filename required for `include` / `extends` and caching
*
* @param {String} str
* @param {Object|Function} options or fn
* @param {Function|undefined} fn
* @returns {String}
* @api public
*/
exports.render = function(str, options, fn){
// support callback API
if ('function' == typeof options) {
fn = options, options = undefined;
}
if (typeof fn === 'function') {
var res
try {
res = exports.render(str, options);
} catch (ex) {
return fn(ex);
}
return fn(null, res);
}
options = options || {};
// cache requires .filename
if (options.cache && !options.filename) {
throw new Error('the "filename" option is required for caching');
}
var path = options.filename;
var tmpl = options.cache
? exports.cache[path] || (exports.cache[path] = exports.compile(str, options))
: exports.compile(str, options);
return tmpl(options);
};
/**
* Render a Jade file at the given `path`.
*
* @param {String} path
* @param {Object|Function} options or callback
* @param {Function|undefined} fn
* @returns {String}
* @api public
*/
exports.renderFile = function(path, options, fn){
// support callback API
if ('function' == typeof options) {
fn = options, options = undefined;
}
if (typeof fn === 'function') {
var res
try {
res = exports.renderFile(path, options);
} catch (ex) {
return fn(ex);
}
return fn(null, res);
}
options = options || {};
var key = path + ':string';
options.filename = path;
var str = options.cache
? exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8'))
: fs.readFileSync(path, 'utf8');
return exports.render(str, options);
};
/**
* Compile a Jade file at the given `path` for use on the client.
*
* @param {String} path
* @param {Object} options
* @returns {String}
* @api public
*/
exports.compileFileClient = function(path, options){
options = options || {};
var key = path + ':string';
options.filename = path;
var str = options.cache
? exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8'))
: fs.readFileSync(path, 'utf8');
return exports.compileClient(str, options);
};
/**
* Express support.
*/
exports.__express = exports.renderFile;
},{"./compiler":1,"./doctypes":2,"./filters":3,"./lexer":6,"./nodes":16,"./parser":23,"./runtime":24,"./self-closing":25,"./utils":26,"fs":27,"with":46}],6:[function(require,module,exports){
'use strict';
var utils = require('./utils');
var characterParser = require('character-parser');
/**
* Initialize `Lexer` with the given `str`.
*
* @param {String} str
* @param {String} filename
* @api private
*/
var Lexer = module.exports = function Lexer(str, filename) {
this.input = str.replace(/\r\n|\r/g, '\n');
this.filename = filename;
this.deferredTokens = [];
this.lastIndents = 0;
this.lineno = 1;
this.stash = [];
this.indentStack = [];
this.indentRe = null;
this.pipeless = false;
};
function assertExpression(exp) {
//this verifies that a JavaScript expression is valid
Function('', 'return (' + exp + ')');
}
function assertNestingCorrect(exp) {
//this verifies that code is properly nested, but allows
//invalid JavaScript such as the contents of `attributes`
var res = characterParser(exp)
if (res.isNesting()) {
throw new Error('Nesting must match on expression `' + exp + '`')
}
}
/**
* Lexer prototype.
*/
Lexer.prototype = {
/**
* Construct a token with the given `type` and `val`.
*
* @param {String} type
* @param {String} val
* @return {Object}
* @api private
*/
tok: function(type, val){
return {
type: type
, line: this.lineno
, val: val
}
},
/**
* Consume the given `len` of input.
*
* @param {Number} len
* @api private
*/
consume: function(len){
this.input = this.input.substr(len);
},
/**
* Scan for `type` with the given `regexp`.
*
* @param {String} type
* @param {RegExp} regexp
* @return {Object}
* @api private
*/
scan: function(regexp, type){
var captures;
if (captures = regexp.exec(this.input)) {
this.consume(captures[0].length);
return this.tok(type, captures[1]);
}
},
/**
* Defer the given `tok`.
*
* @param {Object} tok
* @api private
*/
defer: function(tok){
this.deferredTokens.push(tok);
},
/**
* Lookahead `n` tokens.
*
* @param {Number} n
* @return {Object}
* @api private
*/
lookahead: function(n){
var fetch = n - this.stash.length;
while (fetch-- > 0) this.stash.push(this.next());
return this.stash[--n];
},
/**
* Return the indexOf `(` or `{` or `[` / `)` or `}` or `]` delimiters.
*
* @return {Number}
* @api private
*/
bracketExpression: function(skip){
skip = skip || 0;
var start = this.input[skip];
if (start != '(' && start != '{' && start != '[') throw new Error('unrecognized start character');
var end = ({'(': ')', '{': '}', '[': ']'})[start];
var range = characterParser.parseMax(this.input, {start: skip + 1});
if (this.input[range.end] !== end) throw new Error('start character ' + start + ' does not match end character ' + this.input[range.end]);
return range;
},
/**
* Stashed token.
*/
stashed: function() {
return this.stash.length
&& this.stash.shift();
},
/**
* Deferred token.
*/
deferred: function() {
return this.deferredTokens.length
&& this.deferredTokens.shift();
},
/**
* end-of-source.
*/
eos: function() {
if (this.input.length) return;
if (this.indentStack.length) {
this.indentStack.shift();
return this.tok('outdent');
} else {
return this.tok('eos');
}
},
/**
* Blank line.
*/
blank: function() {
var captures;
if (captures = /^\n *\n/.exec(this.input)) {
this.consume(captures[0].length - 1);
++this.lineno;
if (this.pipeless) return this.tok('text', '');
return this.next();
}
},
/**
* Comment.
*/
comment: function() {
var captures;
if (captures = /^\/\/(-)?([^\n]*)/.exec(this.input)) {
this.consume(captures[0].length);
var tok = this.tok('comment', captures[2]);
tok.buffer = '-' != captures[1];
return tok;
}
},
/**
* Interpolated tag.
*/
interpolation: function() {
if (/^#\{/.test(this.input)) {
var match;
try {
match = this.bracketExpression(1);
} catch (ex) {
return;//not an interpolation expression, just an unmatched open interpolation
}
this.consume(match.end + 1);
return this.tok('interpolation', match.src);
}
},
/**
* Tag.
*/
tag: function() {
var captures;
if (captures = /^(\w[-:\w]*)(\/?)/.exec(this.input)) {
this.consume(captures[0].length);
var tok, name = captures[1];
if (':' == name[name.length - 1]) {
name = name.slice(0, -1);
tok = this.tok('tag', name);
this.defer(this.tok(':'));
while (' ' == this.input[0]) this.input = this.input.substr(1);
} else {
tok = this.tok('tag', name);
}
tok.selfClosing = !! captures[2];
return tok;
}
},
/**
* Filter.
*/
filter: function() {
return this.scan(/^:([\w\-]+)/, 'filter');
},
/**
* Doctype.
*/
doctype: function() {
if (this.scan(/^!!! *([^\n]+)?/, 'doctype')) {
throw new Error('`!!!` is deprecated, you must now use `doctype`');
}
var node = this.scan(/^(?:doctype) *([^\n]+)?/, 'doctype');
if (node && node.val && node.val.trim() === '5') {
throw new Error('`doctype 5` is deprecated, you must now use `doctype html`');
}
return node;
},
/**
* Id.
*/
id: function() {
return this.scan(/^#([\w-]+)/, 'id');
},
/**
* Class.
*/
className: function() {
return this.scan(/^\.([\w-]+)/, 'class');
},
/**
* Text.
*/
text: function() {
return this.scan(/^(?:\| ?| )([^\n]+)/, 'text') || this.scan(/^(<[^\n]*)/, 'text');
},
textFail: function () {
var tok;
if (tok = this.scan(/^([^\.\n][^\n]+)/, 'text')) {
console.warn('Warning: missing space before text for line ' + this.lineno +
' of jade file "' + this.filename + '"');
return tok;
}
},
/**
* Dot.
*/
dot: function() {
return this.scan(/^\./, 'dot');
},
/**
* Extends.
*/
"extends": function() {
return this.scan(/^extends? +([^\n]+)/, 'extends');
},
/**
* Block prepend.
*/
prepend: function() {
var captures;
if (captures = /^prepend +([^\n]+)/.exec(this.input)) {
this.consume(captures[0].length);
var mode = 'prepend'
, name = captures[1]
, tok = this.tok('block', name);
tok.mode = mode;
return tok;
}
},
/**
* Block append.
*/
append: function() {
var captures;
if (captures = /^append +([^\n]+)/.exec(this.input)) {
this.consume(captures[0].length);
var mode = 'append'
, name = captures[1]
, tok = this.tok('block', name);
tok.mode = mode;
return tok;
}
},
/**
* Block.
*/
block: function() {
var captures;
if (captures = /^block\b *(?:(prepend|append) +)?([^\n]+)/.exec(this.input)) {
this.consume(captures[0].length);
var mode = captures[1] || 'replace'
, name = captures[2]
, tok = this.tok('block', name);
tok.mode = mode;
return tok;
}
},
/**
* Mixin Block.
*/
mixinBlock: function() {
var captures;
if (captures = /^block\s*(\n|$)/.exec(this.input)) {
this.consume(captures[0].length - 1);
return this.tok('mixin-block');
}
},
/**
* Yield.
*/
yield: function() {
return this.scan(/^yield */, 'yield');
},
/**
* Include.
*/
include: function() {
return this.scan(/^include +([^\n]+)/, 'include');
},
/**
* Include with filter
*/
includeFiltered: function() {
var captures;
if (captures = /^include:([\w\-]+) +([^\n]+)/.exec(this.input)) {
this.consume(captures[0].length);
var filter = captures[1];
var path = captures[2];
var tok = this.tok('include', path);
tok.filter = filter;
return tok;
}
},
/**
* Case.
*/
"case": function() {
return this.scan(/^case +([^\n]+)/, 'case');
},
/**
* When.
*/
when: function() {
return this.scan(/^when +([^:\n]+)/, 'when');
},
/**
* Default.
*/
"default": function() {
return this.scan(/^default */, 'default');
},
/**
* Call mixin.
*/
call: function(){
var tok, captures;
if (captures = /^\+(([-\w]+)|(#\{))/.exec(this.input)) {
// try to consume simple or interpolated call
if (captures[2]) {
// simple call
this.consume(captures[0].length);
tok = this.tok('call', captures[2]);
} else {
// interpolated call
var match;
try {
match = this.bracketExpression(2);
} catch (ex) {
return;//not an interpolation expression, just an unmatched open interpolation
}
this.consume(match.end + 1);
assertExpression(match.src);
tok = this.tok('call', '#{'+match.src+'}');
}
// Check for args (not attributes)
if (captures = /^ *\(/.exec(this.input)) {
try {
var range = this.bracketExpression(captures[0].length - 1);
if (!/^ *[-\w]+ *=/.test(range.src)) { // not attributes
this.consume(range.end + 1);
tok.args = range.src;
}
} catch (ex) {
//not a bracket expcetion, just unmatched open parens
}
}
return tok;
}
},
/**
* Mixin.
*/
mixin: function(){
var captures;
if (captures = /^mixin +([-\w]+)(?: *\((.*)\))? */.exec(this.input)) {
this.consume(captures[0].length);
var tok = this.tok('mixin', captures[1]);
tok.args = captures[2];
return tok;
}
},
/**
* Conditional.
*/
conditional: function() {
var captures;
if (captures = /^(if|unless|else if|else)\b([^\n]*)/.exec(this.input)) {
this.consume(captures[0].length);
var type = captures[1]
, js = captures[2];
switch (type) {
case 'if':
assertExpression(js)
js = 'if (' + js + ')';
break;
case 'unless':
assertExpression(js)
js = 'if (!(' + js + '))';
break;
case 'else if':
assertExpression(js)
js = 'else if (' + js + ')';
break;
case 'else':
if (js && js.trim()) {
throw new Error('`else` cannot have a condition, perhaps you meant `else if`');
}
js = 'else';
break;
}
return this.tok('code', js);
}
},
/**
* While.
*/
"while": function() {
var captures;
if (captures = /^while +([^\n]+)/.exec(this.input)) {
this.consume(captures[0].length);
assertExpression(captures[1])
return this.tok('code', 'while (' + captures[1] + ')');
}
},
/**
* Each.
*/
each: function() {
var captures;
if (captures = /^(?:- *)?(?:each|for) +([a-zA-Z_$][\w$]*)(?: *, *([a-zA-Z_$][\w$]*))? * in *([^\n]+)/.exec(this.input)) {
this.consume(captures[0].length);
var tok = this.tok('each', captures[1]);
tok.key = captures[2] || '$index';
assertExpression(captures[3])
tok.code = captures[3];
return tok;
}
},
/**
* Code.
*/
code: function() {
var captures;
if (captures = /^(!?=|-)[ \t]*([^\n]+)/.exec(this.input)) {
this.consume(captures[0].length);
var flags = captures[1];
captures[1] = captures[2];
var tok = this.tok('code', captures[1]);
tok.escape = flags.charAt(0) === '=';
tok.buffer = flags.charAt(0) === '=' || flags.charAt(1) === '=';
if (tok.buffer) assertExpression(captures[1])
return tok;
}
},
/**
* Attributes.
*/
attrs: function() {
if ('(' == this.input.charAt(0)) {
var index = this.bracketExpression().end
, str = this.input.substr(1, index-1)
, tok = this.tok('attrs');
assertNestingCorrect(str);
var quote = '';
var interpolate = function (attr) {
return attr.replace(/(\\)?#\{(.+)/g, function(_, escape, expr){
if (escape) return _;
try {
var range = characterParser.parseMax(expr);
if (expr[range.end] !== '}') return _.substr(0, 2) + interpolate(_.substr(2));
assertExpression(range.src)
return quote + " + (" + range.src + ") + " + quote + interpolate(expr.substr(range.end + 1));
} catch (ex) {
return _.substr(0, 2) + interpolate(_.substr(2));
}
});
}
this.consume(index + 1);
tok.attrs = [];
var escapedAttr = true
var key = '';
var val = '';
var interpolatable = '';
var state = characterParser.defaultState();
var loc = 'key';
var isEndOfAttribute = function (i) {
if (key.trim() === '') return false;
if (i === str.length) return true;
if (loc === 'key') {
if (str[i] === ' ' || str[i] === '\n') {
for (var x = i; x < str.length; x++) {
if (str[x] != ' ' && str[x] != '\n') {
if (str[x] === '=' || str[x] === '!' || str[x] === ',') return false;
else return true;
}
}
}
return str[i] === ','
} else if (loc === 'value' && !state.isNesting()) {
try {
Function('', 'return (' + val + ');');
if (str[i] === ' ' || str[i] === '\n') {
for (var x = i; x < str.length; x++) {
if (str[x] != ' ' && str[x] != '\n') {
if (characterParser.isPunctuator(str[x]) && str[x] != '"' && str[x] != "'") return false;
else return true;
}
}
}
return str[i] === ',';
} catch (ex) {
return false;
}
}
}
this.lineno += str.split("\n").length - 1;
for (var i = 0; i <= str.length; i++) {
if (isEndOfAttribute(i)) {
val = val.trim();
if (val) assertExpression(val)
key = key.trim();
key = key.replace(/^['"]|['"]$/g, '');
tok.attrs.push({
name: key,
val: '' == val ? true : val,
escaped: escapedAttr
});
key = val = '';
loc = 'key';
escapedAttr = false;
} else {
switch (loc) {
case 'key-char':
if (str[i] === quote) {
loc = 'key';
if (i + 1 < str.length && [' ', ',', '!', '=', '\n'].indexOf(str[i + 1]) === -1)
throw new Error('Unexpected character ' + str[i + 1] + ' expected ` `, `\\n`, `,`, `!` or `=`');
} else if (loc === 'key-char') {
key += str[i];
}
break;
case 'key':
if (key === '' && (str[i] === '"' || str[i] === "'")) {
loc = 'key-char';
quote = str[i];
} else if (str[i] === '!' || str[i] === '=') {
escapedAttr = str[i] !== '!';
if (str[i] === '!') i++;
if (str[i] !== '=') throw new Error('Unexpected character ' + str[i] + ' expected `=`');
loc = 'value';
state = characterParser.defaultState();
} else {
key += str[i]
}
break;
case 'value':
state = characterParser.parseChar(str[i], state);
if (state.isString()) {
loc = 'string';
quote = str[i];
interpolatable = str[i];
} else {
val += str[i];
}
break;
case 'string':
state = characterParser.parseChar(str[i], state);
interpolatable += str[i];
if (!state.isString()) {
loc = 'value';
val += interpolate(interpolatable);
}
break;
}
}
}
if ('/' == this.input.charAt(0)) {
this.consume(1);
tok.selfClosing = true;
}
return tok;
}
},
/**
* &attributes block
*/
attributesBlock: function () {
var captures;
if (/^&attributes\b/.test(this.input)) {
this.consume(11);
var args = this.bracketExpression();
this.consume(args.end + 1);
return this.tok('&attributes', args.src);
}
},
/**
* Indent | Outdent | Newline.
*/
indent: function() {
var captures, re;
// established regexp
if (this.indentRe) {
captures = this.indentRe.exec(this.input);
// determine regexp
} else {
// tabs
re = /^\n(\t*) */;
captures = re.exec(this.input);
// spaces
if (captures && !captures[1].length) {
re = /^\n( *)/;
captures = re.exec(this.input);
}
// established
if (captures && captures[1].length) this.indentRe = re;
}
if (captures) {
var tok
, indents = captures[1].length;
++this.lineno;
this.consume(indents + 1);
if (' ' == this.input[0] || '\t' == this.input[0]) {
throw new Error('Invalid indentation, you can use tabs or spaces but not both');
}
// blank line
if ('\n' == this.input[0]) return this.tok('newline');
// outdent
if (this.indentStack.length && indents < this.indentStack[0]) {
while (this.indentStack.length && this.indentStack[0] > indents) {
this.stash.push(this.tok('outdent'));
this.indentStack.shift();
}
tok = this.stash.pop();
// indent
} else if (indents && indents != this.indentStack[0]) {
this.indentStack.unshift(indents);
tok = this.tok('indent', indents);
// newline
} else {
tok = this.tok('newline');
}
return tok;
}
},
/**
* Pipe-less text consumed only when
* pipeless is true;
*/
pipelessText: function() {
if (this.pipeless) {
if ('\n' == this.input[0]) return;
var i = this.input.indexOf('\n');
if (-1 == i) i = this.input.length;
var str = this.input.substr(0, i);
this.consume(str.length);
return this.tok('text', str);
}
},
/**
* ':'
*/
colon: function() {
return this.scan(/^: */, ':');
},
fail: function () {
if (/^ ($|\n)/.test(this.input)) {
this.consume(1);
return this.next();
}
throw new Error('unexpected text ' + this.input.substr(0, 5));
},
/**
* Return the next token object, or those
* previously stashed by lookahead.
*
* @return {Object}
* @api private
*/
advance: function(){
return this.stashed()
|| this.next();
},
/**
* Return the next token object.
*
* @return {Object}
* @api private
*/
next: function() {
return this.deferred()
|| this.blank()
|| this.eos()
|| this.pipelessText()
|| this.yield()
|| this.doctype()
|| this.interpolation()
|| this["case"]()
|| this.when()
|| this["default"]()
|| this["extends"]()
|| this.append()
|| this.prepend()
|| this.block()
|| this.mixinBlock()
|| this.include()
|| this.includeFiltered()
|| this.mixin()
|| this.call()
|| this.conditional()
|| this.each()
|| this["while"]()
|| this.tag()
|| this.filter()
|| this.code()
|| this.id()
|| this.className()
|| this.attrs()
|| this.attributesBlock()
|| this.indent()
|| this.text()
|| this.comment()
|| this.colon()
|| this.dot()
|| this.textFail()
|| this.fail();
}
};
},{"./utils":26,"character-parser":33}],7:[function(require,module,exports){
'use strict';
var Node = require('./node');
var Block = require('./block');
/**
* Initialize a `Attrs` node.
*
* @api public
*/
var Attrs = module.exports = function Attrs() {
this.attributeNames = [];
this.attrs = [];
this.attributeBlocks = [];
};
// Inherit from `Node`.
Attrs.prototype = Object.create(Node.prototype);
Attrs.prototype.constructor = Attrs;
Attrs.prototype.type = 'Attrs';
/**
* Set attribute `name` to `val`, keep in mind these become
* part of a raw js object literal, so to quote a value you must
* '"quote me"', otherwise or example 'user.name' is literal JavaScript.
*
* @param {String} name
* @param {String} val
* @param {Boolean} escaped
* @return {Tag} for chaining
* @api public
*/
Attrs.prototype.setAttribute = function(name, val, escaped){
this.attributeNames = this.attributeNames || [];
if (name !== 'class' && this.attributeNames.indexOf(name) !== -1) {
throw new Error('Duplicate attribute "' + name + '" is not allowed.');
}
this.attributeNames.push(name);
this.attrs.push({ name: name, val: val, escaped: escaped });
return this;
};
/**
* Remove attribute `name` when present.
*
* @param {String} name
* @api public
*/
Attrs.prototype.removeAttribute = function(name){
for (var i = 0, len = this.attrs.length; i < len; ++i) {
if (this.attrs[i] && this.attrs[i].name == name) {
delete this.attrs[i];
}
}
};
/**
* Get attribute value by `name`.
*
* @param {String} name
* @return {String}
* @api public
*/
Attrs.prototype.getAttribute = function(name){
for (var i = 0, len = this.attrs.length; i < len; ++i) {
if (this.attrs[i] && this.attrs[i].name == name) {
return this.attrs[i].val;
}
}
};
Attrs.prototype.addAttributes = function (src) {
this.attributeBlocks.push(src);
};
},{"./block":9,"./node":20}],8:[function(require,module,exports){
'use strict';
var Node = require('./node');
/**
* Initialize a `BlockComment` with the given `block`.
*
* @param {String} val
* @param {Block} block
* @param {Boolean} buffer
* @api public
*/
var BlockComment = module.exports = function BlockComment(val, block, buffer) {
this.block = block;
this.val = val;
this.buffer = buffer;
};
// Inherit from `Node`.
BlockComment.prototype = Object.create(Node.prototype);
BlockComment.prototype.constructor = BlockComment;
BlockComment.prototype.type = 'BlockComment';
},{"./node":20}],9:[function(require,module,exports){
'use strict';
var Node = require('./node');
/**
* Initialize a new `Block` with an optional `node`.
*
* @param {Node} node
* @api public
*/
var Block = module.exports = function Block(node){
this.nodes = [];
if (node) this.push(node);
};
// Inherit from `Node`.
Block.prototype = Object.create(Node.prototype);
Block.prototype.constructor = Block;
Block.prototype.type = 'Block';
/**
* Block flag.
*/
Block.prototype.isBlock = true;
/**
* Replace the nodes in `other` with the nodes
* in `this` block.
*
* @param {Block} other
* @api private
*/
Block.prototype.replace = function(other){
other.nodes = this.nodes;
};
/**
* Pust the given `node`.
*
* @param {Node} node
* @return {Number}
* @api public
*/
Block.prototype.push = function(node){
return this.nodes.push(node);
};
/**
* Check if this block is empty.
*
* @return {Boolean}
* @api public
*/
Block.prototype.isEmpty = function(){
return 0 == this.nodes.length;
};
/**
* Unshift the given `node`.
*
* @param {Node} node
* @return {Number}
* @api public
*/
Block.prototype.unshift = function(node){
return this.nodes.unshift(node);
};
/**
* Return the "last" block, or the first `yield` node.
*
* @return {Block}
* @api private
*/
Block.prototype.includeBlock = function(){
var ret = this
, node;
for (var i = 0, len = this.nodes.length; i < len; ++i) {
node = this.nodes[i];
if (node.yield) return node;
else if (node.textOnly) continue;
else if (node.includeBlock) ret = node.includeBlock();
else if (node.block && !node.block.isEmpty()) ret = node.block.includeBlock();
if (ret.yield) return ret;
}
return ret;
};
/**
* Return a clone of this block.
*
* @return {Block}
* @api private
*/
Block.prototype.clone = function(){
var clone = new Block;
for (var i = 0, len = this.nodes.length; i < len; ++i) {
clone.push(this.nodes[i].clone());
}
return clone;
};
},{"./node":20}],10:[function(require,module,exports){
'use strict';
var Node = require('./node');
/**
* Initialize a new `Case` with `expr`.
*
* @param {String} expr
* @api public
*/
var Case = exports = module.exports = function Case(expr, block){
this.expr = expr;
this.block = block;
};
// Inherit from `Node`.
Case.prototype = Object.create(Node.prototype);
Case.prototype.constructor = Case;
Case.prototype.type = 'Case';
var When = exports.When = function When(expr, block){
this.expr = expr;
this.block = block;
this.debug = false;
};
// Inherit from `Node`.
When.prototype = Object.create(Node.prototype);
When.prototype.constructor = When;
When.prototype.type = 'When';
},{"./node":20}],11:[function(require,module,exports){
'use strict';
var Node = require('./node');
/**
* Initialize a `Code` node with the given code `val`.
* Code may also be optionally buffered and escaped.
*
* @param {String} val
* @param {Boolean} buffer
* @param {Boolean} escape
* @api public
*/
var Code = module.exports = function Code(val, buffer, escape) {
this.val = val;
this.buffer = buffer;
this.escape = escape;
if (val.match(/^ *else/)) this.debug = false;
};
// Inherit from `Node`.
Code.prototype = Object.create(Node.prototype);
Code.prototype.constructor = Code;
Code.prototype.type = 'Code'; // prevent the minifiers removing this
},{"./node":20}],12:[function(require,module,exports){
'use strict';
var Node = require('./node');
/**
* Initialize a `Comment` with the given `val`, optionally `buffer`,
* otherwise the comment may render in the output.
*
* @param {String} val
* @param {Boolean} buffer
* @api public
*/
var Comment = module.exports = function Comment(val, buffer) {
this.val = val;
this.buffer = buffer;
};
// Inherit from `Node`.
Comment.prototype = Object.create(Node.prototype);
Comment.prototype.constructor = Comment;
Comment.prototype.type = 'Comment';
},{"./node":20}],13:[function(require,module,exports){
'use strict';
var Node = require('./node');
/**
* Initialize a `Doctype` with the given `val`.
*
* @param {String} val
* @api public
*/
var Doctype = module.exports = function Doctype(val) {
this.val = val;
};
// Inherit from `Node`.
Doctype.prototype = Object.create(Node.prototype);
Doctype.prototype.constructor = Doctype;
Doctype.prototype.type = 'Doctype';
},{"./node":20}],14:[function(require,module,exports){
'use strict';
var Node = require('./node');
/**
* Initialize an `Each` node, representing iteration
*
* @param {String} obj
* @param {String} val
* @param {String} key
* @param {Block} block
* @api public
*/
var Each = module.exports = function Each(obj, val, key, block) {
this.obj = obj;
this.val = val;
this.key = key;
this.block = block;
};
// Inherit from `Node`.
Each.prototype = Object.create(Node.prototype);
Each.prototype.constructor = Each;
Each.prototype.type = 'Each';
},{"./node":20}],15:[function(require,module,exports){
'use strict';
var Node = require('./node')
var Block = require('./block');
/**
* Initialize a `Filter` node with the given
* filter `name` and `block`.
*
* @param {String} name
* @param {Block|Node} block
* @api public
*/
var Filter = module.exports = function Filter(name, block, attrs) {
this.name = name;
this.block = block;
this.attrs = attrs;
};
// Inherit from `Node`.
Filter.prototype = Object.create(Node.prototype);
Filter.prototype.constructor = Filter;
Filter.prototype.type = 'Filter';
},{"./block":9,"./node":20}],16:[function(require,module,exports){
'use strict';
exports.Node = require('./node');
exports.Tag = require('./tag');
exports.Code = require('./code');
exports.Each = require('./each');
exports.Case = require('./case');
exports.Text = require('./text');
exports.Block = require('./block');
exports.MixinBlock = require('./mixin-block');
exports.Mixin = require('./mixin');
exports.Filter = require('./filter');
exports.Comment = require('./comment');
exports.Literal = require('./literal');
exports.BlockComment = require('./block-comment');
exports.Doctype = require('./doctype');
},{"./block":9,"./block-comment":8,"./case":10,"./code":11,"./comment":12,"./doctype":13,"./each":14,"./filter":15,"./literal":17,"./mixin":19,"./mixin-block":18,"./node":20,"./tag":21,"./text":22}],17:[function(require,module,exports){
'use strict';
var Node = require('./node');
/**
* Initialize a `Literal` node with the given `str.
*
* @param {String} str
* @api public
*/
var Literal = module.exports = function Literal(str) {
this.str = str;
};
// Inherit from `Node`.
Literal.prototype = Object.create(Node.prototype);
Literal.prototype.constructor = Literal;
Literal.prototype.type = 'Literal';
},{"./node":20}],18:[function(require,module,exports){
'use strict';
var Node = require('./node');
/**
* Initialize a new `Block` with an optional `node`.
*
* @param {Node} node
* @api public
*/
var MixinBlock = module.exports = function MixinBlock(){};
// Inherit from `Node`.
MixinBlock.prototype = Object.create(Node.prototype);
MixinBlock.prototype.constructor = MixinBlock;
MixinBlock.prototype.type = 'MixinBlock';
},{"./node":20}],19:[function(require,module,exports){
'use strict';
var Attrs = require('./attrs');
/**
* Initialize a new `Mixin` with `name` and `block`.
*
* @param {String} name
* @param {String} args
* @param {Block} block
* @api public
*/
var Mixin = module.exports = function Mixin(name, args, block, call){
this.name = name;
this.args = args;
this.block = block;
this.attrs = [];
this.attributeBlocks = [];
this.call = call;
};
// Inherit from `Attrs`.
Mixin.prototype = Object.create(Attrs.prototype);
Mixin.prototype.constructor = Mixin;
Mixin.prototype.type = 'Mixin';
},{"./attrs":7}],20:[function(require,module,exports){
'use strict';
var Node = module.exports = function Node(){};
/**
* Clone this node (return itself)
*
* @return {Node}
* @api private
*/
Node.prototype.clone = function(){
return this;
};
Node.prototype.type = '';
},{}],21:[function(require,module,exports){
'use strict';
var Attrs = require('./attrs');
var Block = require('./block');
var inlineTags = require('../inline-tags');
/**
* Initialize a `Tag` node with the given tag `name` and optional `block`.
*
* @param {String} name
* @param {Block} block
* @api public
*/
var Tag = module.exports = function Tag(name, block) {
this.name = name;
this.attrs = [];
this.attributeBlocks = [];
this.block = block || new Block;
};
// Inherit from `Attrs`.
Tag.prototype = Object.create(Attrs.prototype);
Tag.prototype.constructor = Tag;
Tag.prototype.type = 'Tag';
/**
* Clone this tag.
*
* @return {Tag}
* @api private
*/
Tag.prototype.clone = function(){
var clone = new Tag(this.name, this.block.clone());
clone.line = this.line;
clone.attrs = this.attrs;
clone.textOnly = this.textOnly;
return clone;
};
/**
* Check if this tag is an inline tag.
*
* @return {Boolean}
* @api private
*/
Tag.prototype.isInline = function(){
return ~inlineTags.indexOf(this.name);
};
/**
* Check if this tag's contents can be inlined. Used for pretty printing.
*
* @return {Boolean}
* @api private
*/
Tag.prototype.canInline = function(){
var nodes = this.block.nodes;
function isInline(node){
// Recurse if the node is a block
if (node.isBlock) return node.nodes.every(isInline);
return node.isText || (node.isInline && node.isInline());
}
// Empty tag
if (!nodes.length) return true;
// Text-only or inline-only tag
if (1 == nodes.length) return isInline(nodes[0]);
// Multi-line inline-only tag
if (this.block.nodes.every(isInline)) {
for (var i = 1, len = nodes.length; i < len; ++i) {
if (nodes[i-1].isText && nodes[i].isText)
return false;
}
return true;
}
// Mixed tag
return false;
};
},{"../inline-tags":4,"./attrs":7,"./block":9}],22:[function(require,module,exports){
'use strict';
var Node = require('./node');
/**
* Initialize a `Text` node with optional `line`.
*
* @param {String} line
* @api public
*/
var Text = module.exports = function Text(line) {
this.val = '';
if ('string' == typeof line) this.val = line;
};
// Inherit from `Node`.
Text.prototype = Object.create(Node.prototype);
Text.prototype.constructor = Text;
Text.prototype.type = 'Text';
/**
* Flag as text.
*/
Text.prototype.isText = true;
},{"./node":20}],23:[function(require,module,exports){
'use strict';
var Lexer = require('./lexer');
var nodes = require('./nodes');
var utils = require('./utils');
var filters = require('./filters');
var path = require('path');
var constantinople = require('constantinople');
var parseJSExpression = require('character-parser').parseMax;
var extname = path.extname;
/**
* Initialize `Parser` with the given input `str` and `filename`.
*
* @param {String} str
* @param {String} filename
* @param {Object} options
* @api public
*/
var Parser = exports = module.exports = function Parser(str, filename, options){
//Strip any UTF-8 BOM off of the start of `str`, if it exists.
this.input = str.replace(/^\uFEFF/, '');
this.lexer = new Lexer(this.input, filename);
this.filename = filename;
this.blocks = {};
this.mixins = {};
this.options = options;
this.contexts = [this];
this.inMixin = false;
};
/**
* Parser prototype.
*/
Parser.prototype = {
/**
* Save original constructor
*/
constructor: Parser,
/**
* Push `parser` onto the context stack,
* or pop and return a `Parser`.
*/
context: function(parser){
if (parser) {
this.contexts.push(parser);
} else {
return this.contexts.pop();
}
},
/**
* Return the next token object.
*
* @return {Object}
* @api private
*/
advance: function(){
return this.lexer.advance();
},
/**
* Skip `n` tokens.
*
* @param {Number} n
* @api private
*/
skip: function(n){
while (n--) this.advance();
},
/**
* Single token lookahead.
*
* @return {Object}
* @api private
*/
peek: function() {
return this.lookahead(1);
},
/**
* Return lexer lineno.
*
* @return {Number}
* @api private
*/
line: function() {
return this.lexer.lineno;
},
/**
* `n` token lookahead.
*
* @param {Number} n
* @return {Object}
* @api private
*/
lookahead: function(n){
return this.lexer.lookahead(n);
},
/**
* Parse input returning a string of js for evaluation.
*
* @return {String}
* @api public
*/
parse: function(){
var block = new nodes.Block, parser;
block.line = 0;
block.filename = this.filename;
while ('eos' != this.peek().type) {
if ('newline' == this.peek().type) {
this.advance();
} else {
var next = this.peek();
var expr = this.parseExpr();
expr.filename = expr.filename || this.filename;
expr.line = next.line;
block.push(expr);
}
}
if (parser = this.extending) {
this.context(parser);
var ast = parser.parse();
this.context();
// hoist mixins
for (var name in this.mixins)
ast.unshift(this.mixins[name]);
return ast;
}
return block;
},
/**
* Expect the given type, or throw an exception.
*
* @param {String} type
* @api private
*/
expect: function(type){
if (this.peek().type === type) {
return this.advance();
} else {
throw new Error('expected "' + type + '", but got "' + this.peek().type + '"');
}
},
/**
* Accept the given `type`.
*
* @param {String} type
* @api private
*/
accept: function(type){
if (this.peek().type === type) {
return this.advance();
}
},
/**
* tag
* | doctype
* | mixin
* | include
* | filter
* | comment
* | text
* | each
* | code
* | yield
* | id
* | class
* | interpolation
*/
parseExpr: function(){
switch (this.peek().type) {
case 'tag':
return this.parseTag();
case 'mixin':
return this.parseMixin();
case 'block':
return this.parseBlock();
case 'mixin-block':
return this.parseMixinBlock();
case 'case':
return this.parseCase();
case 'when':
return this.parseWhen();
case 'default':
return this.parseDefault();
case 'extends':
return this.parseExtends();
case 'include':
return this.parseInclude();
case 'doctype':
return this.parseDoctype();
case 'filter':
return this.parseFilter();
case 'comment':
return this.parseComment();
case 'text':
return this.parseText();
case 'each':
return this.parseEach();
case 'code':
return this.parseCode();
case 'call':
return this.parseCall();
case 'interpolation':
return this.parseInterpolation();
case 'yield':
this.advance();
var block = new nodes.Block;
block.yield = true;
return block;
case 'id':
case 'class':
var tok = this.advance();
this.lexer.defer(this.lexer.tok('tag', 'div'));
this.lexer.defer(tok);
return this.parseExpr();
default:
throw new Error('unexpected token "' + this.peek().type + '"');
}
},
/**
* Text
*/
parseText: function(){
var tok = this.expect('text');
var tokens = this.parseTextWithInlineTags(tok.val);
if (tokens.length === 1) return tokens[0];
var node = new nodes.Block;
for (var i = 0; i < tokens.length; i++) {
node.push(tokens[i]);
};
return node;
},
/**
* ':' expr
* | block
*/
parseBlockExpansion: function(){
if (':' == this.peek().type) {
this.advance();
return new nodes.Block(this.parseExpr());
} else {
return this.block();
}
},
/**
* case
*/
parseCase: function(){
var val = this.expect('case').val;
var node = new nodes.Case(val);
node.line = this.line();
node.block = this.block();
return node;
},
/**
* when
*/
parseWhen: function(){
var val = this.expect('when').val
return new nodes.Case.When(val, this.parseBlockExpansion());
},
/**
* default
*/
parseDefault: function(){
this.expect('default');
return new nodes.Case.When('default', this.parseBlockExpansion());
},
/**
* code
*/
parseCode: function(){
var tok = this.expect('code');
var node = new nodes.Code(tok.val, tok.buffer, tok.escape);
var block;
var i = 1;
node.line = this.line();
while (this.lookahead(i) && 'newline' == this.lookahead(i).type) ++i;
block = 'indent' == this.lookahead(i).type;
if (block) {
this.skip(i-1);
node.block = this.block();
}
return node;
},
/**
* comment
*/
parseComment: function(){
var tok = this.expect('comment');
var node;
if ('indent' == this.peek().type) {
this.lexer.pipeless = true;
node = new nodes.BlockComment(tok.val, this.parseTextBlock(), tok.buffer);
this.lexer.pipeless = false;
} else {
node = new nodes.Comment(tok.val, tok.buffer);
}
node.line = this.line();
return node;
},
/**
* doctype
*/
parseDoctype: function(){
var tok = this.expect('doctype');
var node = new nodes.Doctype(tok.val);
node.line = this.line();
return node;
},
/**
* filter attrs? text-block
*/
parseFilter: function(){
var tok = this.expect('filter');
var attrs = this.accept('attrs');
var block;
if ('indent' == this.peek().type) {
this.lexer.pipeless = true;
block = this.parseTextBlock();
this.lexer.pipeless = false;
} else {
block = new nodes.Block;
}
var options = {};
if (attrs) {
attrs.attrs.forEach(function (attribute) {
options[attribute.name] = constantinople.toConstant(attribute.val);
});
}
var node = new nodes.Filter(tok.val, block, options);
node.line = this.line();
return node;
},
/**
* each block
*/
parseEach: function(){
var tok = this.expect('each');
var node = new nodes.Each(tok.code, tok.val, tok.key);
node.line = this.line();
node.block = this.block();
if (this.peek().type == 'code' && this.peek().val == 'else') {
this.advance();
node.alternative = this.block();
}
return node;
},
/**
* Resolves a path relative to the template for use in
* includes and extends
*
* @param {String} path
* @param {String} purpose Used in error messages.
* @return {String}
* @api private
*/
resolvePath: function (path, purpose) {
var p = require('path');
var dirname = p.dirname;
var basename = p.basename;
var join = p.join;
if (path[0] !== '/' && !this.filename)
throw new Error('the "filename" option is required to use "' + purpose + '" with "relative" paths');
if (path[0] === '/' && !this.options.basedir)
throw new Error('the "basedir" option is required to use "' + purpose + '" with "absolute" paths');
path = join(path[0] === '/' ? this.options.basedir : dirname(this.filename), path);
if (basename(path).indexOf('.') === -1) path += '.jade';
return path;
},
/**
* 'extends' name
*/
parseExtends: function(){
var fs = require('fs');
var path = this.resolvePath(this.expect('extends').val.trim(), 'extends');
if ('.jade' != path.substr(-5)) path += '.jade';
var str = fs.readFileSync(path, 'utf8');
var parser = new this.constructor(str, path, this.options);
parser.blocks = this.blocks;
parser.contexts = this.contexts;
this.extending = parser;
// TODO: null node
return new nodes.Literal('');
},
/**
* 'block' name block
*/
parseBlock: function(){
var block = this.expect('block');
var mode = block.mode;
var name = block.val.trim();
block = 'indent' == this.peek().type
? this.block()
: new nodes.Block(new nodes.Literal(''));
var prev = this.blocks[name] || {prepended: [], appended: []}
if (prev.mode === 'replace') return this.blocks[name] = prev;
var allNodes = prev.prepended.concat(block.nodes).concat(prev.appended);
switch (mode) {
case 'append':
prev.appended = prev.parser === this ?
prev.appended.concat(block.nodes) :
block.nodes.concat(prev.appended);
break;
case 'prepend':
prev.prepended = prev.parser === this ?
block.nodes.concat(prev.prepended) :
prev.prepended.concat(block.nodes);
break;
}
block.nodes = allNodes;
block.appended = prev.appended;
block.prepended = prev.prepended;
block.mode = mode;
block.parser = this;
return this.blocks[name] = block;
},
parseMixinBlock: function () {
var block = this.expect('mixin-block');
if (!this.inMixin) {
throw new Error('Anonymous blocks are not allowed unless they are part of a mixin.');
}
return new nodes.MixinBlock();
},
/**
* include block?
*/
parseInclude: function(){
var fs = require('fs');
var tok = this.expect('include');
var path = this.resolvePath(tok.val.trim(), 'include');
// has-filter
if (tok.filter) {
var str = fs.readFileSync(path, 'utf8').replace(/\r/g, '');
str = filters(tok.filter, str, { filename: path });
return new nodes.Literal(str);
}
// non-jade
if ('.jade' != path.substr(-5)) {
var str = fs.readFileSync(path, 'utf8').replace(/\r/g, '');
return new nodes.Literal(str);
}
var str = fs.readFileSync(path, 'utf8');
var parser = new this.constructor(str, path, this.options);
parser.blocks = utils.merge({}, this.blocks);
parser.mixins = this.mixins;
this.context(parser);
var ast = parser.parse();
this.context();
ast.filename = path;
if ('indent' == this.peek().type) {
ast.includeBlock().push(this.block());
}
return ast;
},
/**
* call ident block
*/
parseCall: function(){
var tok = this.expect('call');
var name = tok.val;
var args = tok.args;
var mixin = new nodes.Mixin(name, args, new nodes.Block, true);
this.tag(mixin);
if (mixin.code) {
mixin.block.push(mixin.code);
mixin.code = null;
}
if (mixin.block.isEmpty()) mixin.block = null;
return mixin;
},
/**
* mixin block
*/
parseMixin: function(){
var tok = this.expect('mixin');
var name = tok.val;
var args = tok.args;
var mixin;
// definition
if ('indent' == this.peek().type) {
this.inMixin = true;
mixin = new nodes.Mixin(name, args, this.block(), false);
this.mixins[name] = mixin;
this.inMixin = false;
return mixin;
// call
} else {
return new nodes.Mixin(name, args, null, true);
}
},
parseTextWithInlineTags: function (str) {
var line = this.line();
var match = /(\\)?#\[((?:.|\n)*)$/.exec(str);
if (match) {
if (match[1]) { // escape
var text = new nodes.Text(str.substr(0, match.index) + '#[');
text.line = line;
var rest = this.parseTextWithInlineTags(match[2]);
if (rest[0].type === 'Text') {
text.val += rest[0].val;
rest.shift();
}
return [text].concat(rest);
} else {
var text = new nodes.Text(str.substr(0, match.index));
text.line = line;
var buffer = [text];
var rest = match[2];
var range = parseJSExpression(rest);
var inner = new Parser(range.src, this.filename, this.options);
buffer.push(inner.parse());
return buffer.concat(this.parseTextWithInlineTags(rest.substr(range.end + 1)));
}
} else {
var text = new nodes.Text(str);
text.line = line;
return [text];
}
},
/**
* indent (text | newline)* outdent
*/
parseTextBlock: function(){
var block = new nodes.Block;
block.line = this.line();
var spaces = this.expect('indent').val;
if (null == this._spaces) this._spaces = spaces;
var indent = Array(spaces - this._spaces + 1).join(' ');
while ('outdent' != this.peek().type) {
switch (this.peek().type) {
case 'newline':
this.advance();
break;
case 'indent':
this.parseTextBlock(true).nodes.forEach(function(node){
block.push(node);
});
break;
default:
var texts = this.parseTextWithInlineTags(indent + this.advance().val);
texts.forEach(function (text) {
block.push(text);
});
}
}
if (spaces == this._spaces) this._spaces = null;
this.expect('outdent');
return block;
},
/**
* indent expr* outdent
*/
block: function(){
var block = new nodes.Block;
block.line = this.line();
block.filename = this.filename;
this.expect('indent');
while ('outdent' != this.peek().type) {
if ('newline' == this.peek().type) {
this.advance();
} else {
var expr = this.parseExpr();
expr.filename = this.filename;
block.push(expr);
}
}
this.expect('outdent');
return block;
},
/**
* interpolation (attrs | class | id)* (text | code | ':')? newline* block?
*/
parseInterpolation: function(){
var tok = this.advance();
var tag = new nodes.Tag(tok.val);
tag.buffer = true;
return this.tag(tag);
},
/**
* tag (attrs | class | id)* (text | code | ':')? newline* block?
*/
parseTag: function(){
var tok = this.advance();
var tag = new nodes.Tag(tok.val);
tag.selfClosing = tok.selfClosing;
return this.tag(tag);
},
/**
* Parse tag.
*/
tag: function(tag){
tag.line = this.line();
var seenAttrs = false;
// (attrs | class | id)*
out:
while (true) {
switch (this.peek().type) {
case 'id':
case 'class':
var tok = this.advance();
tag.setAttribute(tok.type, "'" + tok.val + "'");
continue;
case 'attrs':
if (seenAttrs) {
console.warn('You should not have jade tags with multiple attributes.');
}
seenAttrs = true;
var tok = this.advance();
var attrs = tok.attrs;
if (tok.selfClosing) tag.selfClosing = true;
for (var i = 0; i < attrs.length; i++) {
tag.setAttribute(attrs[i].name, attrs[i].val, attrs[i].escaped);
}
continue;
case '&attributes':
var tok = this.advance();
tag.addAttributes(tok.val);
break;
default:
break out;
}
}
// check immediate '.'
if ('dot' == this.peek().type) {
tag.textOnly = true;
this.advance();
}
if (tag.selfClosing
&& ['newline', 'outdent', 'eos'].indexOf(this.peek().type) === -1
&& (this.peek().type !== 'text' || /^\s*$/.text(this.peek().val))) {
throw new Error(name + ' is self closing and should not have content.');
}
// (text | code | ':')?
switch (this.peek().type) {
case 'text':
tag.block.push(this.parseText());
break;
case 'code':
tag.code = this.parseCode();
break;
case ':':
this.advance();
tag.block = new nodes.Block;
tag.block.push(this.parseExpr());
break;
case 'newline':
case 'indent':
case 'outdent':
case 'eos':
break;
default:
throw new Error('Unexpected token `' + this.peek().type + '` expected `text`, `code`, `:`, `newline` or `eos`')
}
// newline*
while ('newline' == this.peek().type) this.advance();
// block?
if ('indent' == this.peek().type) {
if (tag.textOnly) {
this.lexer.pipeless = true;
tag.block = this.parseTextBlock();
this.lexer.pipeless = false;
} else {
var block = this.block();
if (tag.block) {
for (var i = 0, len = block.nodes.length; i < len; ++i) {
tag.block.push(block.nodes[i]);
}
} else {
tag.block = block;
}
}
}
return tag;
}
};
},{"./filters":3,"./lexer":6,"./nodes":16,"./utils":26,"character-parser":33,"constantinople":34,"fs":27,"path":30}],24:[function(require,module,exports){
'use strict';
/**
* Merge two attribute objects giving precedence
* to values in object `b`. Classes are special-cased
* allowing for arrays and merging/joining appropriately
* resulting in a string.
*
* @param {Object} a
* @param {Object} b
* @return {Object} a
* @api private
*/
exports.merge = function merge(a, b) {
if (arguments.length === 1) {
var attrs = a[0];
for (var i = 1; i < a.length; i++) {
attrs = merge(attrs, a[i]);
}
return attrs;
}
var ac = a['class'];
var bc = b['class'];
if (ac || bc) {
ac = ac || [];
bc = bc || [];
if (!Array.isArray(ac)) ac = [ac];
if (!Array.isArray(bc)) bc = [bc];
a['class'] = ac.concat(bc).filter(nulls);
}
for (var key in b) {
if (key != 'class') {
a[key] = b[key];
}
}
return a;
};
/**
* Filter null `val`s.
*
* @param {*} val
* @return {Boolean}
* @api private
*/
function nulls(val) {
return val != null && val !== '';
}
/**
* join array as classes.
*
* @param {*} val
* @return {String}
*/
exports.joinClasses = joinClasses;
function joinClasses(val) {
return Array.isArray(val) ? val.map(joinClasses).filter(nulls).join(' ') : val;
}
/**
* Render the given classes.
*
* @param {Array} classes
* @param {Array.<Boolean>} escaped
* @return {String}
*/
exports.cls = function cls(classes, escaped) {
var buf = [];
for (var i = 0; i < classes.length; i++) {
if (escaped && escaped[i]) {
buf.push(exports.escape(joinClasses([classes[i]])));
} else {
buf.push(joinClasses(classes[i]));
}
}
var text = joinClasses(buf);
if (text.length) {
return ' class="' + text + '"';
} else {
return '';
}
};
/**
* Render the given attribute.
*
* @param {String} key
* @param {String} val
* @param {Boolean} escaped
* @param {Boolean} terse
* @return {String}
*/
exports.attr = function attr(key, val, escaped, terse) {
if ('boolean' == typeof val || null == val) {
if (val) {
return ' ' + (terse ? key : key + '="' + key + '"');
} else {
return '';
}
} else if (0 == key.indexOf('data') && 'string' != typeof val) {
return ' ' + key + "='" + JSON.stringify(val).replace(/'/g, ''') + "'";
} else if (escaped) {
return ' ' + key + '="' + exports.escape(val) + '"';
} else {
return ' ' + key + '="' + val + '"';
}
};
/**
* Render the given attributes object.
*
* @param {Object} obj
* @param {Object} escaped
* @return {String}
*/
exports.attrs = function attrs(obj, terse){
var buf = [];
var keys = Object.keys(obj);
if (keys.length) {
for (var i = 0; i < keys.length; ++i) {
var key = keys[i]
, val = obj[key];
if ('class' == key) {
if (val = joinClasses(val)) {
buf.push(' ' + key + '="' + val + '"');
}
} else {
buf.push(exports.attr(key, val, false, terse));
}
}
}
return buf.join('');
};
/**
* Escape the given string of `html`.
*
* @param {String} html
* @return {String}
* @api private
*/
exports.escape = function escape(html){
var result = String(html)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
if (result === '' + html) return html;
else return result;
};
/**
* Re-throw the given `err` in context to the
* the jade in `filename` at the given `lineno`.
*
* @param {Error} err
* @param {String} filename
* @param {String} lineno
* @api private
*/
exports.rethrow = function rethrow(err, filename, lineno, str){
if (!(err instanceof Error)) throw err;
if ((typeof window != 'undefined' || !filename) && !str) {
err.message += ' on line ' + lineno;
throw err;
}
try {
str = str || require('fs').readFileSync(filename, 'utf8')
} catch (ex) {
rethrow(err, null, lineno)
}
var context = 3
, lines = str.split('\n')
, start = Math.max(lineno - context, 0)
, end = Math.min(lines.length, lineno + context);
// Error context
var context = lines.slice(start, end).map(function(line, i){
var curr = i + start + 1;
return (curr == lineno ? ' > ' : ' ')
+ curr
+ '| '
+ line;
}).join('\n');
// Alter exception message
err.path = filename;
err.message = (filename || 'Jade') + ':' + lineno
+ '\n' + context + '\n\n' + err.message;
throw err;
};
},{"fs":27}],25:[function(require,module,exports){
'use strict';
// source: http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements
module.exports = [
'area'
, 'base'
, 'br'
, 'col'
, 'embed'
, 'hr'
, 'img'
, 'input'
, 'keygen'
, 'link'
, 'menuitem'
, 'meta'
, 'param'
, 'source'
, 'track'
, 'wbr'
];
},{}],26:[function(require,module,exports){
'use strict';
/**
* Merge `b` into `a`.
*
* @param {Object} a
* @param {Object} b
* @return {Object}
* @api public
*/
exports.merge = function(a, b) {
for (var key in b) a[key] = b[key];
return a;
};
},{}],27:[function(require,module,exports){
},{}],28:[function(require,module,exports){
if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
});
};
} else {
// old school shim for old browsers
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
var TempCtor = function () {}
TempCtor.prototype = superCtor.prototype
ctor.prototype = new TempCtor()
ctor.prototype.constructor = ctor
}
}
},{}],29:[function(require,module,exports){
// shim for using process in browser
var process = module.exports = {};
process.nextTick = (function () {
var canSetImmediate = typeof window !== 'undefined'
&& window.setImmediate;
var canPost = typeof window !== 'undefined'
&& window.postMessage && window.addEventListener
;
if (canSetImmediate) {
return function (f) { return window.setImmediate(f) };
}
if (canPost) {
var queue = [];
window.addEventListener('message', function (ev) {
var source = ev.source;
if ((source === window || source === null) && ev.data === 'process-tick') {
ev.stopPropagation();
if (queue.length > 0) {
var fn = queue.shift();
fn();
}
}
}, true);
return function nextTick(fn) {
queue.push(fn);
window.postMessage('process-tick', '*');
};
}
return function nextTick(fn) {
setTimeout(fn, 0);
};
})();
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.binding = function (name) {
throw new Error('process.binding is not supported');
}
// TODO(shtylman)
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
},{}],30:[function(require,module,exports){
var process=require("__browserify_process");// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// resolves . and .. elements in a path array with directory names there
// must be no slashes, empty elements, or device names (c:\) in the array
// (so also no leading and trailing slashes - it does not distinguish
// relative and absolute paths)
function normalizeArray(parts, allowAboveRoot) {
// if the path tries to go above the root, `up` ends up > 0
var up = 0;
for (var i = parts.length - 1; i >= 0; i--) {
var last = parts[i];
if (last === '.') {
parts.splice(i, 1);
} else if (last === '..') {
parts.splice(i, 1);
up++;
} else if (up) {
parts.splice(i, 1);
up--;
}
}
// if the path is allowed to go above the root, restore leading ..s
if (allowAboveRoot) {
for (; up--; up) {
parts.unshift('..');
}
}
return parts;
}
// Split a filename into [root, dir, basename, ext], unix version
// 'root' is just a slash, or nothing.
var splitPathRe =
/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
var splitPath = function(filename) {
return splitPathRe.exec(filename).slice(1);
};
// path.resolve([from ...], to)
// posix version
exports.resolve = function() {
var resolvedPath = '',
resolvedAbsolute = false;
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
var path = (i >= 0) ? arguments[i] : process.cwd();
// Skip empty and invalid entries
if (typeof path !== 'string') {
throw new TypeError('Arguments to path.resolve must be strings');
} else if (!path) {
continue;
}
resolvedPath = path + '/' + resolvedPath;
resolvedAbsolute = path.charAt(0) === '/';
}
// At this point the path should be resolved to a full absolute path, but
// handle relative paths to be safe (might happen when process.cwd() fails)
// Normalize the path
resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
return !!p;
}), !resolvedAbsolute).join('/');
return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
};
// path.normalize(path)
// posix version
exports.normalize = function(path) {
var isAbsolute = exports.isAbsolute(path),
trailingSlash = substr(path, -1) === '/';
// Normalize the path
path = normalizeArray(filter(path.split('/'), function(p) {
return !!p;
}), !isAbsolute).join('/');
if (!path && !isAbsolute) {
path = '.';
}
if (path && trailingSlash) {
path += '/';
}
return (isAbsolute ? '/' : '') + path;
};
// posix version
exports.isAbsolute = function(path) {
return path.charAt(0) === '/';
};
// posix version
exports.join = function() {
var paths = Array.prototype.slice.call(arguments, 0);
return exports.normalize(filter(paths, function(p, index) {
if (typeof p !== 'string') {
throw new TypeError('Arguments to path.join must be strings');
}
return p;
}).join('/'));
};
// path.relative(from, to)
// posix version
exports.relative = function(from, to) {
from = exports.resolve(from).substr(1);
to = exports.resolve(to).substr(1);
function trim(arr) {
var start = 0;
for (; start < arr.length; start++) {
if (arr[start] !== '') break;
}
var end = arr.length - 1;
for (; end >= 0; end--) {
if (arr[end] !== '') break;
}
if (start > end) return [];
return arr.slice(start, end - start + 1);
}
var fromParts = trim(from.split('/'));
var toParts = trim(to.split('/'));
var length = Math.min(fromParts.length, toParts.length);
var samePartsLength = length;
for (var i = 0; i < length; i++) {
if (fromParts[i] !== toParts[i]) {
samePartsLength = i;
break;
}
}
var outputParts = [];
for (var i = samePartsLength; i < fromParts.length; i++) {
outputParts.push('..');
}
outputParts = outputParts.concat(toParts.slice(samePartsLength));
return outputParts.join('/');
};
exports.sep = '/';
exports.delimiter = ':';
exports.dirname = function(path) {
var result = splitPath(path),
root = result[0],
dir = result[1];
if (!root && !dir) {
// No dirname whatsoever
return '.';
}
if (dir) {
// It has a dirname, strip trailing slash
dir = dir.substr(0, dir.length - 1);
}
return root + dir;
};
exports.basename = function(path, ext) {
var f = splitPath(path)[2];
// TODO: make this comparison case-insensitive on windows?
if (ext && f.substr(-1 * ext.length) === ext) {
f = f.substr(0, f.length - ext.length);
}
return f;
};
exports.extname = function(path) {
return splitPath(path)[3];
};
function filter (xs, f) {
if (xs.filter) return xs.filter(f);
var res = [];
for (var i = 0; i < xs.length; i++) {
if (f(xs[i], i, xs)) res.push(xs[i]);
}
return res;
}
// String.prototype.substr - negative index don't work in IE8
var substr = 'ab'.substr(-1) === 'b'
? function (str, start, len) { return str.substr(start, len) }
: function (str, start, len) {
if (start < 0) start = str.length + start;
return str.substr(start, len);
}
;
},{"__browserify_process":29}],31:[function(require,module,exports){
module.exports = function isBuffer(arg) {
return arg && typeof arg === 'object'
&& typeof arg.copy === 'function'
&& typeof arg.fill === 'function'
&& typeof arg.readUInt8 === 'function';
}
},{}],32:[function(require,module,exports){
var process=require("__browserify_process"),global=typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var formatRegExp = /%[sdj%]/g;
exports.format = function(f) {
if (!isString(f)) {
var objects = [];
for (var i = 0; i < arguments.length; i++) {
objects.push(inspect(arguments[i]));
}
return objects.join(' ');
}
var i = 1;
var args = arguments;
var len = args.length;
var str = String(f).replace(formatRegExp, function(x) {
if (x === '%%') return '%';
if (i >= len) return x;
switch (x) {
case '%s': return String(args[i++]);
case '%d': return Number(args[i++]);
case '%j':
try {
return JSON.stringify(args[i++]);
} catch (_) {
return '[Circular]';
}
default:
return x;
}
});
for (var x = args[i]; i < len; x = args[++i]) {
if (isNull(x) || !isObject(x)) {
str += ' ' + x;
} else {
str += ' ' + inspect(x);
}
}
return str;
};
// Mark that a method should not be used.
// Returns a modified function which warns once by default.
// If --no-deprecation is set, then it is a no-op.
exports.deprecate = function(fn, msg) {
// Allow for deprecating things in the process of starting up.
if (isUndefined(global.process)) {
return function() {
return exports.deprecate(fn, msg).apply(this, arguments);
};
}
if (process.noDeprecation === true) {
return fn;
}
var warned = false;
function deprecated() {
if (!warned) {
if (process.throwDeprecation) {
throw new Error(msg);
} else if (process.traceDeprecation) {
console.trace(msg);
} else {
console.error(msg);
}
warned = true;
}
return fn.apply(this, arguments);
}
return deprecated;
};
var debugs = {};
var debugEnviron;
exports.debuglog = function(set) {
if (isUndefined(debugEnviron))
debugEnviron = process.env.NODE_DEBUG || '';
set = set.toUpperCase();
if (!debugs[set]) {
if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
var pid = process.pid;
debugs[set] = function() {
var msg = exports.format.apply(exports, arguments);
console.error('%s %d: %s', set, pid, msg);
};
} else {
debugs[set] = function() {};
}
}
return debugs[set];
};
/**
* Echos the value of a value. Trys to print the value out
* in the best way possible given the different types.
*
* @param {Object} obj The object to print out.
* @param {Object} opts Optional options object that alters the output.
*/
/* legacy: obj, showHidden, depth, colors*/
function inspect(obj, opts) {
// default options
var ctx = {
seen: [],
stylize: stylizeNoColor
};
// legacy...
if (arguments.length >= 3) ctx.depth = arguments[2];
if (arguments.length >= 4) ctx.colors = arguments[3];
if (isBoolean(opts)) {
// legacy...
ctx.showHidden = opts;
} else if (opts) {
// got an "options" object
exports._extend(ctx, opts);
}
// set default options
if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
if (isUndefined(ctx.depth)) ctx.depth = 2;
if (isUndefined(ctx.colors)) ctx.colors = false;
if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
if (ctx.colors) ctx.stylize = stylizeWithColor;
return formatValue(ctx, obj, ctx.depth);
}
exports.inspect = inspect;
// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
inspect.colors = {
'bold' : [1, 22],
'italic' : [3, 23],
'underline' : [4, 24],
'inverse' : [7, 27],
'white' : [37, 39],
'grey' : [90, 39],
'black' : [30, 39],
'blue' : [34, 39],
'cyan' : [36, 39],
'green' : [32, 39],
'magenta' : [35, 39],
'red' : [31, 39],
'yellow' : [33, 39]
};
// Don't use 'blue' not visible on cmd.exe
inspect.styles = {
'special': 'cyan',
'number': 'yellow',
'boolean': 'yellow',
'undefined': 'grey',
'null': 'bold',
'string': 'green',
'date': 'magenta',
// "name": intentionally not styling
'regexp': 'red'
};
function stylizeWithColor(str, styleType) {
var style = inspect.styles[styleType];
if (style) {
return '\u001b[' + inspect.colors[style][0] + 'm' + str +
'\u001b[' + inspect.colors[style][1] + 'm';
} else {
return str;
}
}
function stylizeNoColor(str, styleType) {
return str;
}
function arrayToHash(array) {
var hash = {};
array.forEach(function(val, idx) {
hash[val] = true;
});
return hash;
}
function formatValue(ctx, value, recurseTimes) {
// Provide a hook for user-specified inspect functions.
// Check that value is an object with an inspect function on it
if (ctx.customInspect &&
value &&
isFunction(value.inspect) &&
// Filter out the util module, it's inspect function is special
value.inspect !== exports.inspect &&
// Also filter out any prototype objects using the circular check.
!(value.constructor && value.constructor.prototype === value)) {
var ret = value.inspect(recurseTimes, ctx);
if (!isString(ret)) {
ret = formatValue(ctx, ret, recurseTimes);
}
return ret;
}
// Primitive types cannot have properties
var primitive = formatPrimitive(ctx, value);
if (primitive) {
return primitive;
}
// Look up the keys of the object.
var keys = Object.keys(value);
var visibleKeys = arrayToHash(keys);
if (ctx.showHidden) {
keys = Object.getOwnPropertyNames(value);
}
// IE doesn't make error fields non-enumerable
// http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
if (isError(value)
&& (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
return formatError(value);
}
// Some type of object without properties can be shortcutted.
if (keys.length === 0) {
if (isFunction(value)) {
var name = value.name ? ': ' + value.name : '';
return ctx.stylize('[Function' + name + ']', 'special');
}
if (isRegExp(value)) {
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
}
if (isDate(value)) {
return ctx.stylize(Date.prototype.toString.call(value), 'date');
}
if (isError(value)) {
return formatError(value);
}
}
var base = '', array = false, braces = ['{', '}'];
// Make Array say that they are Array
if (isArray(value)) {
array = true;
braces = ['[', ']'];
}
// Make functions say that they are functions
if (isFunction(value)) {
var n = value.name ? ': ' + value.name : '';
base = ' [Function' + n + ']';
}
// Make RegExps say that they are RegExps
if (isRegExp(value)) {
base = ' ' + RegExp.prototype.toString.call(value);
}
// Make dates with properties first say the date
if (isDate(value)) {
base = ' ' + Date.prototype.toUTCString.call(value);
}
// Make error with message first say the error
if (isError(value)) {
base = ' ' + formatError(value);
}
if (keys.length === 0 && (!array || value.length == 0)) {
return braces[0] + base + braces[1];
}
if (recurseTimes < 0) {
if (isRegExp(value)) {
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
} else {
return ctx.stylize('[Object]', 'special');
}
}
ctx.seen.push(value);
var output;
if (array) {
output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
} else {
output = keys.map(function(key) {
return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
});
}
ctx.seen.pop();
return reduceToSingleString(output, base, braces);
}
function formatPrimitive(ctx, value) {
if (isUndefined(value))
return ctx.stylize('undefined', 'undefined');
if (isString(value)) {
var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
.replace(/'/g, "\\'")
.replace(/\\"/g, '"') + '\'';
return ctx.stylize(simple, 'string');
}
if (isNumber(value))
return ctx.stylize('' + value, 'number');
if (isBoolean(value))
return ctx.stylize('' + value, 'boolean');
// For some reason typeof null is "object", so special case here.
if (isNull(value))
return ctx.stylize('null', 'null');
}
function formatError(value) {
return '[' + Error.prototype.toString.call(value) + ']';
}
function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
var output = [];
for (var i = 0, l = value.length; i < l; ++i) {
if (hasOwnProperty(value, String(i))) {
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
String(i), true));
} else {
output.push('');
}
}
keys.forEach(function(key) {
if (!key.match(/^\d+$/)) {
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
key, true));
}
});
return output;
}
function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
var name, str, desc;
desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
if (desc.get) {
if (desc.set) {
str = ctx.stylize('[Getter/Setter]', 'special');
} else {
str = ctx.stylize('[Getter]', 'special');
}
} else {
if (desc.set) {
str = ctx.stylize('[Setter]', 'special');
}
}
if (!hasOwnProperty(visibleKeys, key)) {
name = '[' + key + ']';
}
if (!str) {
if (ctx.seen.indexOf(desc.value) < 0) {
if (isNull(recurseTimes)) {
str = formatValue(ctx, desc.value, null);
} else {
str = formatValue(ctx, desc.value, recurseTimes - 1);
}
if (str.indexOf('\n') > -1) {
if (array) {
str = str.split('\n').map(function(line) {
return ' ' + line;
}).join('\n').substr(2);
} else {
str = '\n' + str.split('\n').map(function(line) {
return ' ' + line;
}).join('\n');
}
}
} else {
str = ctx.stylize('[Circular]', 'special');
}
}
if (isUndefined(name)) {
if (array && key.match(/^\d+$/)) {
return str;
}
name = JSON.stringify('' + key);
if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
name = name.substr(1, name.length - 2);
name = ctx.stylize(name, 'name');
} else {
name = name.replace(/'/g, "\\'")
.replace(/\\"/g, '"')
.replace(/(^"|"$)/g, "'");
name = ctx.stylize(name, 'string');
}
}
return name + ': ' + str;
}
function reduceToSingleString(output, base, braces) {
var numLinesEst = 0;
var length = output.reduce(function(prev, cur) {
numLinesEst++;
if (cur.indexOf('\n') >= 0) numLinesEst++;
return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
}, 0);
if (length > 60) {
return braces[0] +
(base === '' ? '' : base + '\n ') +
' ' +
output.join(',\n ') +
' ' +
braces[1];
}
return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
}
// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
function isArray(ar) {
return Array.isArray(ar);
}
exports.isArray = isArray;
function isBoolean(arg) {
return typeof arg === 'boolean';
}
exports.isBoolean = isBoolean;
function isNull(arg) {
return arg === null;
}
exports.isNull = isNull;
function isNullOrUndefined(arg) {
return arg == null;
}
exports.isNullOrUndefined = isNullOrUndefined;
function isNumber(arg) {
return typeof arg === 'number';
}
exports.isNumber = isNumber;
function isString(arg) {
return typeof arg === 'string';
}
exports.isString = isString;
function isSymbol(arg) {
return typeof arg === 'symbol';
}
exports.isSymbol = isSymbol;
function isUndefined(arg) {
return arg === void 0;
}
exports.isUndefined = isUndefined;
function isRegExp(re) {
return isObject(re) && objectToString(re) === '[object RegExp]';
}
exports.isRegExp = isRegExp;
function isObject(arg) {
return typeof arg === 'object' && arg !== null;
}
exports.isObject = isObject;
function isDate(d) {
return isObject(d) && objectToString(d) === '[object Date]';
}
exports.isDate = isDate;
function isError(e) {
return isObject(e) &&
(objectToString(e) === '[object Error]' || e instanceof Error);
}
exports.isError = isError;
function isFunction(arg) {
return typeof arg === 'function';
}
exports.isFunction = isFunction;
function isPrimitive(arg) {
return arg === null ||
typeof arg === 'boolean' ||
typeof arg === 'number' ||
typeof arg === 'string' ||
typeof arg === 'symbol' || // ES6 symbol
typeof arg === 'undefined';
}
exports.isPrimitive = isPrimitive;
exports.isBuffer = require('./support/isBuffer');
function objectToString(o) {
return Object.prototype.toString.call(o);
}
function pad(n) {
return n < 10 ? '0' + n.toString(10) : n.toString(10);
}
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
'Oct', 'Nov', 'Dec'];
// 26 Feb 16:19:34
function timestamp() {
var d = new Date();
var time = [pad(d.getHours()),
pad(d.getMinutes()),
pad(d.getSeconds())].join(':');
return [d.getDate(), months[d.getMonth()], time].join(' ');
}
// log is just a thin wrapper to console.log that prepends a timestamp
exports.log = function() {
console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
};
/**
* Inherit the prototype methods from one constructor into another.
*
* The Function.prototype.inherits from lang.js rewritten as a standalone
* function (not on Function.prototype). NOTE: If this file is to be loaded
* during bootstrapping this function needs to be rewritten using some native
* functions as prototype setup using normal JavaScript does not work as
* expected during bootstrapping (see mirror.js in r114903).
*
* @param {function} ctor Constructor function which needs to inherit the
* prototype.
* @param {function} superCtor Constructor function to inherit prototype from.
*/
exports.inherits = require('inherits');
exports._extend = function(origin, add) {
// Don't do anything if add isn't an object
if (!add || !isObject(add)) return origin;
var keys = Object.keys(add);
var i = keys.length;
while (i--) {
origin[keys[i]] = add[keys[i]];
}
return origin;
};
function hasOwnProperty(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}
},{"./support/isBuffer":31,"__browserify_process":29,"inherits":28}],33:[function(require,module,exports){
exports = (module.exports = parse);
exports.parse = parse;
function parse(src, state, options) {
options = options || {};
state = state || exports.defaultState();
var start = options.start || 0;
var end = options.end || src.length;
var index = start;
while (index < end) {
if (state.roundDepth < 0 || state.curlyDepth < 0 || state.squareDepth < 0) {
throw new SyntaxError('Mismatched Bracket: ' + src[index - 1]);
}
exports.parseChar(src[index++], state);
}
return state;
}
exports.parseMax = parseMax;
function parseMax(src, options) {
options = options || {};
var start = options.start || 0;
var index = start;
var state = exports.defaultState();
while (state.roundDepth >= 0 && state.curlyDepth >= 0 && state.squareDepth >= 0) {
if (index >= src.length) {
throw new Error('The end of the string was reached with no closing bracket found.');
}
exports.parseChar(src[index++], state);
}
var end = index - 1;
return {
start: start,
end: end,
src: src.substring(start, end)
};
}
exports.parseUntil = parseUntil;
function parseUntil(src, delimiter, options) {
options = options || {};
var includeLineComment = options.includeLineComment || false;
var start = options.start || 0;
var index = start;
var state = exports.defaultState();
while (state.isString() || state.regexp || state.blockComment ||
(!includeLineComment && state.lineComment) || !startsWith(src, delimiter, index)) {
exports.parseChar(src[index++], state);
}
var end = index;
return {
start: start,
end: end,
src: src.substring(start, end)
};
}
exports.parseChar = parseChar;
function parseChar(character, state) {
if (character.length !== 1) throw new Error('Character must be a string of length 1');
state = state || exports.defaultState();
var wasComment = state.blockComment || state.lineComment;
var lastChar = state.history ? state.history[0] : '';
if (state.lineComment) {
if (character === '\n') {
state.lineComment = false;
}
} else if (state.blockComment) {
if (state.lastChar === '*' && character === '/') {
state.blockComment = false;
}
} else if (state.singleQuote) {
if (character === '\'' && !state.escaped) {
state.singleQuote = false;
} else if (character === '\\' && !state.escaped) {
state.escaped = true;
} else {
state.escaped = false;
}
} else if (state.doubleQuote) {
if (character === '"' && !state.escaped) {
state.doubleQuote = false;
} else if (character === '\\' && !state.escaped) {
state.escaped = true;
} else {
state.escaped = false;
}
} else if (state.regexp) {
if (character === '/' && !state.escaped) {
state.regexp = false;
} else if (character === '\\' && !state.escaped) {
state.escaped = true;
} else {
state.escaped = false;
}
} else if (lastChar === '/' && character === '/') {
state.history = state.history.substr(1);
state.lineComment = true;
} else if (lastChar === '/' && character === '*') {
state.history = state.history.substr(1);
state.blockComment = true;
} else if (character === '/' && isRegexp(state.history)) {
state.regexp = true;
} else if (character === '\'') {
state.singleQuote = true;
} else if (character === '"') {
state.doubleQuote = true;
} else if (character === '(') {
state.roundDepth++;
} else if (character === ')') {
state.roundDepth--;
} else if (character === '{') {
state.curlyDepth++;
} else if (character === '}') {
state.curlyDepth--;
} else if (character === '[') {
state.squareDepth++;
} else if (character === ']') {
state.squareDepth--;
}
if (!state.blockComment && !state.lineComment && !wasComment) state.history = character + state.history;
return state;
}
exports.defaultState = function () { return new State() };
function State() {
this.lineComment = false;
this.blockComment = false;
this.singleQuote = false;
this.doubleQuote = false;
this.regexp = false;
this.escaped = false;
this.roundDepth = 0;
this.curlyDepth = 0;
this.squareDepth = 0;
this.history = ''
}
State.prototype.isString = function () {
return this.singleQuote || this.doubleQuote;
}
State.prototype.isComment = function () {
return this.lineComment || this.blockComment;
}
State.prototype.isNesting = function () {
return this.isString() || this.isComment() || this.regexp || this.roundDepth > 0 || this.curlyDepth > 0 || this.squareDepth > 0
}
function startsWith(str, start, i) {
return str.substr(i || 0, start.length) === start;
}
exports.isPunctuator = isPunctuator
function isPunctuator(c) {
var code = c.charCodeAt(0)
switch (code) {
case 46: // . dot
case 40: // ( open bracket
case 41: // ) close bracket
case 59: // ; semicolon
case 44: // , comma
case 123: // { open curly brace
case 125: // } close curly brace
case 91: // [
case 93: // ]
case 58: // :
case 63: // ?
case 126: // ~
case 37: // %
case 38: // &
case 42: // *:
case 43: // +
case 45: // -
case 47: // /
case 60: // <
case 62: // >
case 94: // ^
case 124: // |
case 33: // !
case 61: // =
return true;
default:
return false;
}
}
exports.isKeyword = isKeyword
function isKeyword(id) {
return (id === 'if') || (id === 'in') || (id === 'do') || (id === 'var') || (id === 'for') || (id === 'new') ||
(id === 'try') || (id === 'let') || (id === 'this') || (id === 'else') || (id === 'case') ||
(id === 'void') || (id === 'with') || (id === 'enum') || (id === 'while') || (id === 'break') || (id === 'catch') ||
(id === 'throw') || (id === 'const') || (id === 'yield') || (id === 'class') || (id === 'super') ||
(id === 'return') || (id === 'typeof') || (id === 'delete') || (id === 'switch') || (id === 'export') ||
(id === 'import') || (id === 'default') || (id === 'finally') || (id === 'extends') || (id === 'function') ||
(id === 'continue') || (id === 'debugger') || (id === 'package') || (id === 'private') || (id === 'interface') ||
(id === 'instanceof') || (id === 'implements') || (id === 'protected') || (id === 'public') || (id === 'static') ||
(id === 'yield') || (id === 'let');
}
function isRegexp(history) {
//could be start of regexp or divide sign
history = history.replace(/^\s*/, '');
//unless its an `if`, `while`, `for` or `with` it's a divide, so we assume it's a divide
if (history[0] === ')') return false;
//unless it's a function expression, it's a regexp, so we assume it's a regexp
if (history[0] === '}') return true;
//any punctuation means it's a regexp
if (isPunctuator(history[0])) return true;
//if the last thing was a keyword then it must be a regexp (e.g. `typeof /foo/`)
if (/^\w+\b/.test(history) && isKeyword(/^\w+\b/.exec(history)[0].split('').reverse().join(''))) return true;
return false;
}
},{}],34:[function(require,module,exports){
'use strict'
var uglify = require('uglify-js')
var lastSRC = '(null)'
var lastRes = true
module.exports = isConstant
function isConstant(src) {
src = '(' + src + ')'
if (lastSRC === src) return lastRes
lastSRC = src
try {
return lastRes = (detect(src).length === 0)
} catch (ex) {
return lastRes = false
}
}
isConstant.isConstant = isConstant
isConstant.toConstant = toConstant
function toConstant(src) {
if (!isConstant(src)) throw new Error(JSON.stringify(src) + ' is not constant.')
return Function('return (' + src + ')')()
}
function detect(src) {
var ast = uglify.parse(src.toString())
ast.figure_out_scope()
var globals = ast.globals
.map(function (node, name) {
return name
})
return globals
}
},{"uglify-js":45}],35:[function(require,module,exports){
/*
* Copyright 2009-2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE.txt or:
* http://opensource.org/licenses/BSD-3-Clause
*/
exports.SourceMapGenerator = require('./source-map/source-map-generator').SourceMapGenerator;
exports.SourceMapConsumer = require('./source-map/source-map-consumer').SourceMapConsumer;
exports.SourceNode = require('./source-map/source-node').SourceNode;
},{"./source-map/source-map-consumer":40,"./source-map/source-map-generator":41,"./source-map/source-node":42}],36:[function(require,module,exports){
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
if (typeof define !== 'function') {
var define = require('amdefine')(module, require);
}
define(function (require, exports, module) {
var util = require('./util');
/**
* A data structure which is a combination of an array and a set. Adding a new
* member is O(1), testing for membership is O(1), and finding the index of an
* element is O(1). Removing elements from the set is not supported. Only
* strings are supported for membership.
*/
function ArraySet() {
this._array = [];
this._set = {};
}
/**
* Static method for creating ArraySet instances from an existing array.
*/
ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
var set = new ArraySet();
for (var i = 0, len = aArray.length; i < len; i++) {
set.add(aArray[i], aAllowDuplicates);
}
return set;
};
/**
* Add the given string to this set.
*
* @param String aStr
*/
ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
var isDuplicate = this.has(aStr);
var idx = this._array.length;
if (!isDuplicate || aAllowDuplicates) {
this._array.push(aStr);
}
if (!isDuplicate) {
this._set[util.toSetString(aStr)] = idx;
}
};
/**
* Is the given string a member of this set?
*
* @param String aStr
*/
ArraySet.prototype.has = function ArraySet_has(aStr) {
return Object.prototype.hasOwnProperty.call(this._set,
util.toSetString(aStr));
};
/**
* What is the index of the given string in the array?
*
* @param String aStr
*/
ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
if (this.has(aStr)) {
return this._set[util.toSetString(aStr)];
}
throw new Error('"' + aStr + '" is not in the set.');
};
/**
* What is the element at the given index?
*
* @param Number aIdx
*/
ArraySet.prototype.at = function ArraySet_at(aIdx) {
if (aIdx >= 0 && aIdx < this._array.length) {
return this._array[aIdx];
}
throw new Error('No element indexed by ' + aIdx);
};
/**
* Returns the array representation of this set (which has the proper indices
* indicated by indexOf). Note that this is a copy of the internal array used
* for storing the members so that no one can mess with internal state.
*/
ArraySet.prototype.toArray = function ArraySet_toArray() {
return this._array.slice();
};
exports.ArraySet = ArraySet;
});
},{"./util":43,"amdefine":44}],37:[function(require,module,exports){
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*
* Based on the Base 64 VLQ implementation in Closure Compiler:
* https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
*
* Copyright 2011 The Closure Compiler Authors. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
if (typeof define !== 'function') {
var define = require('amdefine')(module, require);
}
define(function (require, exports, module) {
var base64 = require('./base64');
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
// length quantities we use in the source map spec, the first bit is the sign,
// the next four bits are the actual value, and the 6th bit is the
// continuation bit. The continuation bit tells us whether there are more
// digits in this value following this digit.
//
// Continuation
// | Sign
// | |
// V V
// 101011
var VLQ_BASE_SHIFT = 5;
// binary: 100000
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
// binary: 011111
var VLQ_BASE_MASK = VLQ_BASE - 1;
// binary: 100000
var VLQ_CONTINUATION_BIT = VLQ_BASE;
/**
* Converts from a two-complement value to a value where the sign bit is
* is placed in the least significant bit. For example, as decimals:
* 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
* 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
*/
function toVLQSigned(aValue) {
return aValue < 0
? ((-aValue) << 1) + 1
: (aValue << 1) + 0;
}
/**
* Converts to a two-complement value from a value where the sign bit is
* is placed in the least significant bit. For example, as decimals:
* 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
* 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
*/
function fromVLQSigned(aValue) {
var isNegative = (aValue & 1) === 1;
var shifted = aValue >> 1;
return isNegative
? -shifted
: shifted;
}
/**
* Returns the base 64 VLQ encoded value.
*/
exports.encode = function base64VLQ_encode(aValue) {
var encoded = "";
var digit;
var vlq = toVLQSigned(aValue);
do {
digit = vlq & VLQ_BASE_MASK;
vlq >>>= VLQ_BASE_SHIFT;
if (vlq > 0) {
// There are still more digits in this value, so we must make sure the
// continuation bit is marked.
digit |= VLQ_CONTINUATION_BIT;
}
encoded += base64.encode(digit);
} while (vlq > 0);
return encoded;
};
/**
* Decodes the next base 64 VLQ value from the given string and returns the
* value and the rest of the string.
*/
exports.decode = function base64VLQ_decode(aStr) {
var i = 0;
var strLen = aStr.length;
var result = 0;
var shift = 0;
var continuation, digit;
do {
if (i >= strLen) {
throw new Error("Expected more digits in base 64 VLQ value.");
}
digit = base64.decode(aStr.charAt(i++));
continuation = !!(digit & VLQ_CONTINUATION_BIT);
digit &= VLQ_BASE_MASK;
result = result + (digit << shift);
shift += VLQ_BASE_SHIFT;
} while (continuation);
return {
value: fromVLQSigned(result),
rest: aStr.slice(i)
};
};
});
},{"./base64":38,"amdefine":44}],38:[function(require,module,exports){
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
if (typeof define !== 'function') {
var define = require('amdefine')(module, require);
}
define(function (require, exports, module) {
var charToIntMap = {};
var intToCharMap = {};
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
.split('')
.forEach(function (ch, index) {
charToIntMap[ch] = index;
intToCharMap[index] = ch;
});
/**
* Encode an integer in the range of 0 to 63 to a single base 64 digit.
*/
exports.encode = function base64_encode(aNumber) {
if (aNumber in intToCharMap) {
return intToCharMap[aNumber];
}
throw new TypeError("Must be between 0 and 63: " + aNumber);
};
/**
* Decode a single base 64 digit to an integer.
*/
exports.decode = function base64_decode(aChar) {
if (aChar in charToIntMap) {
return charToIntMap[aChar];
}
throw new TypeError("Not a valid base 64 digit: " + aChar);
};
});
},{"amdefine":44}],39:[function(require,module,exports){
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
if (typeof define !== 'function') {
var define = require('amdefine')(module, require);
}
define(function (require, exports, module) {
/**
* Recursive implementation of binary search.
*
* @param aLow Indices here and lower do not contain the needle.
* @param aHigh Indices here and higher do not contain the needle.
* @param aNeedle The element being searched for.
* @param aHaystack The non-empty array being searched.
* @param aCompare Function which takes two elements and returns -1, 0, or 1.
*/
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) {
// This function terminates when one of the following is true:
//
// 1. We find the exact element we are looking for.
//
// 2. We did not find the exact element, but we can return the next
// closest element that is less than that element.
//
// 3. We did not find the exact element, and there is no next-closest
// element which is less than the one we are searching for, so we
// return null.
var mid = Math.floor((aHigh - aLow) / 2) + aLow;
var cmp = aCompare(aNeedle, aHaystack[mid], true);
if (cmp === 0) {
// Found the element we are looking for.
return aHaystack[mid];
}
else if (cmp > 0) {
// aHaystack[mid] is greater than our needle.
if (aHigh - mid > 1) {
// The element is in the upper half.
return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare);
}
// We did not find an exact match, return the next closest one
// (termination case 2).
return aHaystack[mid];
}
else {
// aHaystack[mid] is less than our needle.
if (mid - aLow > 1) {
// The element is in the lower half.
return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare);
}
// The exact needle element was not found in this haystack. Determine if
// we are in termination case (2) or (3) and return the appropriate thing.
return aLow < 0
? null
: aHaystack[aLow];
}
}
/**
* This is an implementation of binary search which will always try and return
* the next lowest value checked if there is no exact hit. This is because
* mappings between original and generated line/col pairs are single points,
* and there is an implicit region between each of them, so a miss just means
* that you aren't on the very start of a region.
*
* @param aNeedle The element you are looking for.
* @param aHaystack The array that is being searched.
* @param aCompare A function which takes the needle and an element in the
* array and returns -1, 0, or 1 depending on whether the needle is less
* than, equal to, or greater than the element, respectively.
*/
exports.search = function search(aNeedle, aHaystack, aCompare) {
return aHaystack.length > 0
? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare)
: null;
};
});
},{"amdefine":44}],40:[function(require,module,exports){
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
if (typeof define !== 'function') {
var define = require('amdefine')(module, require);
}
define(function (require, exports, module) {
var util = require('./util');
var binarySearch = require('./binary-search');
var ArraySet = require('./array-set').ArraySet;
var base64VLQ = require('./base64-vlq');
/**
* A SourceMapConsumer instance represents a parsed source map which we can
* query for information about the original file positions by giving it a file
* position in the generated source.
*
* The only parameter is the raw source map (either as a JSON string, or
* already parsed to an object). According to the spec, source maps have the
* following attributes:
*
* - version: Which version of the source map spec this map is following.
* - sources: An array of URLs to the original source files.
* - names: An array of identifiers which can be referrenced by individual mappings.
* - sourceRoot: Optional. The URL root from which all sources are relative.
* - sourcesContent: Optional. An array of contents of the original source files.
* - mappings: A string of base64 VLQs which contain the actual mappings.
* - file: The generated file this source map is associated with.
*
* Here is an example source map, taken from the source map spec[0]:
*
* {
* version : 3,
* file: "out.js",
* sourceRoot : "",
* sources: ["foo.js", "bar.js"],
* names: ["src", "maps", "are", "fun"],
* mappings: "AA,AB;;ABCDE;"
* }
*
* [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
*/
function SourceMapConsumer(aSourceMap) {
var sourceMap = aSourceMap;
if (typeof aSourceMap === 'string') {
sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
}
var version = util.getArg(sourceMap, 'version');
var sources = util.getArg(sourceMap, 'sources');
// Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
// requires the array) to play nice here.
var names = util.getArg(sourceMap, 'names', []);
var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
var mappings = util.getArg(sourceMap, 'mappings');
var file = util.getArg(sourceMap, 'file', null);
// Once again, Sass deviates from the spec and supplies the version as a
// string rather than a number, so we use loose equality checking here.
if (version != this._version) {
throw new Error('Unsupported version: ' + version);
}
// Pass `true` below to allow duplicate names and sources. While source maps
// are intended to be compressed and deduplicated, the TypeScript compiler
// sometimes generates source maps with duplicates in them. See Github issue
// #72 and bugzil.la/889492.
this._names = ArraySet.fromArray(names, true);
this._sources = ArraySet.fromArray(sources, true);
this.sourceRoot = sourceRoot;
this.sourcesContent = sourcesContent;
this._mappings = mappings;
this.file = file;
}
/**
* Create a SourceMapConsumer from a SourceMapGenerator.
*
* @param SourceMapGenerator aSourceMap
* The source map that will be consumed.
* @returns SourceMapConsumer
*/
SourceMapConsumer.fromSourceMap =
function SourceMapConsumer_fromSourceMap(aSourceMap) {
var smc = Object.create(SourceMapConsumer.prototype);
smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
smc.sourceRoot = aSourceMap._sourceRoot;
smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
smc.sourceRoot);
smc.file = aSourceMap._file;
smc.__generatedMappings = aSourceMap._mappings.slice()
.sort(util.compareByGeneratedPositions);
smc.__originalMappings = aSourceMap._mappings.slice()
.sort(util.compareByOriginalPositions);
return smc;
};
/**
* The version of the source mapping spec that we are consuming.
*/
SourceMapConsumer.prototype._version = 3;
/**
* The list of original sources.
*/
Object.defineProperty(SourceMapConsumer.prototype, 'sources', {
get: function () {
return this._sources.toArray().map(function (s) {
return this.sourceRoot ? util.join(this.sourceRoot, s) : s;
}, this);
}
});
// `__generatedMappings` and `__originalMappings` are arrays that hold the
// parsed mapping coordinates from the source map's "mappings" attribute. They
// are lazily instantiated, accessed via the `_generatedMappings` and
// `_originalMappings` getters respectively, and we only parse the mappings
// and create these arrays once queried for a source location. We jump through
// these hoops because there can be many thousands of mappings, and parsing
// them is expensive, so we only want to do it if we must.
//
// Each object in the arrays is of the form:
//
// {
// generatedLine: The line number in the generated code,
// generatedColumn: The column number in the generated code,
// source: The path to the original source file that generated this
// chunk of code,
// originalLine: The line number in the original source that
// corresponds to this chunk of generated code,
// originalColumn: The column number in the original source that
// corresponds to this chunk of generated code,
// name: The name of the original symbol which generated this chunk of
// code.
// }
//
// All properties except for `generatedLine` and `generatedColumn` can be
// `null`.
//
// `_generatedMappings` is ordered by the generated positions.
//
// `_originalMappings` is ordered by the original positions.
SourceMapConsumer.prototype.__generatedMappings = null;
Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
get: function () {
if (!this.__generatedMappings) {
this.__generatedMappings = [];
this.__originalMappings = [];
this._parseMappings(this._mappings, this.sourceRoot);
}
return this.__generatedMappings;
}
});
SourceMapConsumer.prototype.__originalMappings = null;
Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
get: function () {
if (!this.__originalMappings) {
this.__generatedMappings = [];
this.__originalMappings = [];
this._parseMappings(this._mappings, this.sourceRoot);
}
return this.__originalMappings;
}
});
/**
* Parse the mappings in a string in to a data structure which we can easily
* query (the ordered arrays in the `this.__generatedMappings` and
* `this.__originalMappings` properties).
*/
SourceMapConsumer.prototype._parseMappings =
function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
var generatedLine = 1;
var previousGeneratedColumn = 0;
var previousOriginalLine = 0;
var previousOriginalColumn = 0;
var previousSource = 0;
var previousName = 0;
var mappingSeparator = /^[,;]/;
var str = aStr;
var mapping;
var temp;
while (str.length > 0) {
if (str.charAt(0) === ';') {
generatedLine++;
str = str.slice(1);
previousGeneratedColumn = 0;
}
else if (str.charAt(0) === ',') {
str = str.slice(1);
}
else {
mapping = {};
mapping.generatedLine = generatedLine;
// Generated column.
temp = base64VLQ.decode(str);
mapping.generatedColumn = previousGeneratedColumn + temp.value;
previousGeneratedColumn = mapping.generatedColumn;
str = temp.rest;
if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) {
// Original source.
temp = base64VLQ.decode(str);
mapping.source = this._sources.at(previousSource + temp.value);
previousSource += temp.value;
str = temp.rest;
if (str.length === 0 || mappingSeparator.test(str.charAt(0))) {
throw new Error('Found a source, but no line and column');
}
// Original line.
temp = base64VLQ.decode(str);
mapping.originalLine = previousOriginalLine + temp.value;
previousOriginalLine = mapping.originalLine;
// Lines are stored 0-based
mapping.originalLine += 1;
str = temp.rest;
if (str.length === 0 || mappingSeparator.test(str.charAt(0))) {
throw new Error('Found a source and line, but no column');
}
// Original column.
temp = base64VLQ.decode(str);
mapping.originalColumn = previousOriginalColumn + temp.value;
previousOriginalColumn = mapping.originalColumn;
str = temp.rest;
if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) {
// Original name.
temp = base64VLQ.decode(str);
mapping.name = this._names.at(previousName + temp.value);
previousName += temp.value;
str = temp.rest;
}
}
this.__generatedMappings.push(mapping);
if (typeof mapping.originalLine === 'number') {
this.__originalMappings.push(mapping);
}
}
}
this.__originalMappings.sort(util.compareByOriginalPositions);
};
/**
* Find the mapping that best matches the hypothetical "needle" mapping that
* we are searching for in the given "haystack" of mappings.
*/
SourceMapConsumer.prototype._findMapping =
function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
aColumnName, aComparator) {
// To return the position we are searching for, we must first find the
// mapping for the given position and then return the opposite position it
// points to. Because the mappings are sorted, we can use binary search to
// find the best mapping.
if (aNeedle[aLineName] <= 0) {
throw new TypeError('Line must be greater than or equal to 1, got '
+ aNeedle[aLineName]);
}
if (aNeedle[aColumnName] < 0) {
throw new TypeError('Column must be greater than or equal to 0, got '
+ aNeedle[aColumnName]);
}
return binarySearch.search(aNeedle, aMappings, aComparator);
};
/**
* Returns the original source, line, and column information for the generated
* source's line and column positions provided. The only argument is an object
* with the following properties:
*
* - line: The line number in the generated source.
* - column: The column number in the generated source.
*
* and an object is returned with the following properties:
*
* - source: The original source file, or null.
* - line: The line number in the original source, or null.
* - column: The column number in the original source, or null.
* - name: The original identifier, or null.
*/
SourceMapConsumer.prototype.originalPositionFor =
function SourceMapConsumer_originalPositionFor(aArgs) {
var needle = {
generatedLine: util.getArg(aArgs, 'line'),
generatedColumn: util.getArg(aArgs, 'column')
};
var mapping = this._findMapping(needle,
this._generatedMappings,
"generatedLine",
"generatedColumn",
util.compareByGeneratedPositions);
if (mapping) {
var source = util.getArg(mapping, 'source', null);
if (source && this.sourceRoot) {
source = util.join(this.sourceRoot, source);
}
return {
source: source,
line: util.getArg(mapping, 'originalLine', null),
column: util.getArg(mapping, 'originalColumn', null),
name: util.getArg(mapping, 'name', null)
};
}
return {
source: null,
line: null,
column: null,
name: null
};
};
/**
* Returns the original source content. The only argument is the url of the
* original source file. Returns null if no original source content is
* availible.
*/
SourceMapConsumer.prototype.sourceContentFor =
function SourceMapConsumer_sourceContentFor(aSource) {
if (!this.sourcesContent) {
return null;
}
if (this.sourceRoot) {
aSource = util.relative(this.sourceRoot, aSource);
}
if (this._sources.has(aSource)) {
return this.sourcesContent[this._sources.indexOf(aSource)];
}
var url;
if (this.sourceRoot
&& (url = util.urlParse(this.sourceRoot))) {
// XXX: file:// URIs and absolute paths lead to unexpected behavior for
// many users. We can help them out when they expect file:// URIs to
// behave like it would if they were running a local HTTP server. See
// https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
var fileUriAbsPath = aSource.replace(/^file:\/\//, "");
if (url.scheme == "file"
&& this._sources.has(fileUriAbsPath)) {
return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
}
if ((!url.path || url.path == "/")
&& this._sources.has("/" + aSource)) {
return this.sourcesContent[this._sources.indexOf("/" + aSource)];
}
}
throw new Error('"' + aSource + '" is not in the SourceMap.');
};
/**
* Returns the generated line and column information for the original source,
* line, and column positions provided. The only argument is an object with
* the following properties:
*
* - source: The filename of the original source.
* - line: The line number in the original source.
* - column: The column number in the original source.
*
* and an object is returned with the following properties:
*
* - line: The line number in the generated source, or null.
* - column: The column number in the generated source, or null.
*/
SourceMapConsumer.prototype.generatedPositionFor =
function SourceMapConsumer_generatedPositionFor(aArgs) {
var needle = {
source: util.getArg(aArgs, 'source'),
originalLine: util.getArg(aArgs, 'line'),
originalColumn: util.getArg(aArgs, 'column')
};
if (this.sourceRoot) {
needle.source = util.relative(this.sourceRoot, needle.source);
}
var mapping = this._findMapping(needle,
this._originalMappings,
"originalLine",
"originalColumn",
util.compareByOriginalPositions);
if (mapping) {
return {
line: util.getArg(mapping, 'generatedLine', null),
column: util.getArg(mapping, 'generatedColumn', null)
};
}
return {
line: null,
column: null
};
};
SourceMapConsumer.GENERATED_ORDER = 1;
SourceMapConsumer.ORIGINAL_ORDER = 2;
/**
* Iterate over each mapping between an original source/line/column and a
* generated line/column in this source map.
*
* @param Function aCallback
* The function that is called with each mapping.
* @param Object aContext
* Optional. If specified, this object will be the value of `this` every
* time that `aCallback` is called.
* @param aOrder
* Either `SourceMapConsumer.GENERATED_ORDER` or
* `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
* iterate over the mappings sorted by the generated file's line/column
* order or the original's source/line/column order, respectively. Defaults to
* `SourceMapConsumer.GENERATED_ORDER`.
*/
SourceMapConsumer.prototype.eachMapping =
function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
var context = aContext || null;
var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
var mappings;
switch (order) {
case SourceMapConsumer.GENERATED_ORDER:
mappings = this._generatedMappings;
break;
case SourceMapConsumer.ORIGINAL_ORDER:
mappings = this._originalMappings;
break;
default:
throw new Error("Unknown order of iteration.");
}
var sourceRoot = this.sourceRoot;
mappings.map(function (mapping) {
var source = mapping.source;
if (source && sourceRoot) {
source = util.join(sourceRoot, source);
}
return {
source: source,
generatedLine: mapping.generatedLine,
generatedColumn: mapping.generatedColumn,
originalLine: mapping.originalLine,
originalColumn: mapping.originalColumn,
name: mapping.name
};
}).forEach(aCallback, context);
};
exports.SourceMapConsumer = SourceMapConsumer;
});
},{"./array-set":36,"./base64-vlq":37,"./binary-search":39,"./util":43,"amdefine":44}],41:[function(require,module,exports){
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
if (typeof define !== 'function') {
var define = require('amdefine')(module, require);
}
define(function (require, exports, module) {
var base64VLQ = require('./base64-vlq');
var util = require('./util');
var ArraySet = require('./array-set').ArraySet;
/**
* An instance of the SourceMapGenerator represents a source map which is
* being built incrementally. To create a new one, you must pass an object
* with the following properties:
*
* - file: The filename of the generated source.
* - sourceRoot: An optional root for all URLs in this source map.
*/
function SourceMapGenerator(aArgs) {
this._file = util.getArg(aArgs, 'file');
this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
this._sources = new ArraySet();
this._names = new ArraySet();
this._mappings = [];
this._sourcesContents = null;
}
SourceMapGenerator.prototype._version = 3;
/**
* Creates a new SourceMapGenerator based on a SourceMapConsumer
*
* @param aSourceMapConsumer The SourceMap.
*/
SourceMapGenerator.fromSourceMap =
function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
var sourceRoot = aSourceMapConsumer.sourceRoot;
var generator = new SourceMapGenerator({
file: aSourceMapConsumer.file,
sourceRoot: sourceRoot
});
aSourceMapConsumer.eachMapping(function (mapping) {
var newMapping = {
generated: {
line: mapping.generatedLine,
column: mapping.generatedColumn
}
};
if (mapping.source) {
newMapping.source = mapping.source;
if (sourceRoot) {
newMapping.source = util.relative(sourceRoot, newMapping.source);
}
newMapping.original = {
line: mapping.originalLine,
column: mapping.originalColumn
};
if (mapping.name) {
newMapping.name = mapping.name;
}
}
generator.addMapping(newMapping);
});
aSourceMapConsumer.sources.forEach(function (sourceFile) {
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
if (content) {
generator.setSourceContent(sourceFile, content);
}
});
return generator;
};
/**
* Add a single mapping from original source line and column to the generated
* source's line and column for this source map being created. The mapping
* object should have the following properties:
*
* - generated: An object with the generated line and column positions.
* - original: An object with the original line and column positions.
* - source: The original source file (relative to the sourceRoot).
* - name: An optional original token name for this mapping.
*/
SourceMapGenerator.prototype.addMapping =
function SourceMapGenerator_addMapping(aArgs) {
var generated = util.getArg(aArgs, 'generated');
var original = util.getArg(aArgs, 'original', null);
var source = util.getArg(aArgs, 'source', null);
var name = util.getArg(aArgs, 'name', null);
this._validateMapping(generated, original, source, name);
if (source && !this._sources.has(source)) {
this._sources.add(source);
}
if (name && !this._names.has(name)) {
this._names.add(name);
}
this._mappings.push({
generatedLine: generated.line,
generatedColumn: generated.column,
originalLine: original != null && original.line,
originalColumn: original != null && original.column,
source: source,
name: name
});
};
/**
* Set the source content for a source file.
*/
SourceMapGenerator.prototype.setSourceContent =
function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
var source = aSourceFile;
if (this._sourceRoot) {
source = util.relative(this._sourceRoot, source);
}
if (aSourceContent !== null) {
// Add the source content to the _sourcesContents map.
// Create a new _sourcesContents map if the property is null.
if (!this._sourcesContents) {
this._sourcesContents = {};
}
this._sourcesContents[util.toSetString(source)] = aSourceContent;
} else {
// Remove the source file from the _sourcesContents map.
// If the _sourcesContents map is empty, set the property to null.
delete this._sourcesContents[util.toSetString(source)];
if (Object.keys(this._sourcesContents).length === 0) {
this._sourcesContents = null;
}
}
};
/**
* Applies the mappings of a sub-source-map for a specific source file to the
* source map being generated. Each mapping to the supplied source file is
* rewritten using the supplied source map. Note: The resolution for the
* resulting mappings is the minimium of this map and the supplied map.
*
* @param aSourceMapConsumer The source map to be applied.
* @param aSourceFile Optional. The filename of the source file.
* If omitted, SourceMapConsumer's file property will be used.
*/
SourceMapGenerator.prototype.applySourceMap =
function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile) {
// If aSourceFile is omitted, we will use the file property of the SourceMap
if (!aSourceFile) {
aSourceFile = aSourceMapConsumer.file;
}
var sourceRoot = this._sourceRoot;
// Make "aSourceFile" relative if an absolute Url is passed.
if (sourceRoot) {
aSourceFile = util.relative(sourceRoot, aSourceFile);
}
// Applying the SourceMap can add and remove items from the sources and
// the names array.
var newSources = new ArraySet();
var newNames = new ArraySet();
// Find mappings for the "aSourceFile"
this._mappings.forEach(function (mapping) {
if (mapping.source === aSourceFile && mapping.originalLine) {
// Check if it can be mapped by the source map, then update the mapping.
var original = aSourceMapConsumer.originalPositionFor({
line: mapping.originalLine,
column: mapping.originalColumn
});
if (original.source !== null) {
// Copy mapping
if (sourceRoot) {
mapping.source = util.relative(sourceRoot, original.source);
} else {
mapping.source = original.source;
}
mapping.originalLine = original.line;
mapping.originalColumn = original.column;
if (original.name !== null && mapping.name !== null) {
// Only use the identifier name if it's an identifier
// in both SourceMaps
mapping.name = original.name;
}
}
}
var source = mapping.source;
if (source && !newSources.has(source)) {
newSources.add(source);
}
var name = mapping.name;
if (name && !newNames.has(name)) {
newNames.add(name);
}
}, this);
this._sources = newSources;
this._names = newNames;
// Copy sourcesContents of applied map.
aSourceMapConsumer.sources.forEach(function (sourceFile) {
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
if (content) {
if (sourceRoot) {
sourceFile = util.relative(sourceRoot, sourceFile);
}
this.setSourceContent(sourceFile, content);
}
}, this);
};
/**
* A mapping can have one of the three levels of data:
*
* 1. Just the generated position.
* 2. The Generated position, original position, and original source.
* 3. Generated and original position, original source, as well as a name
* token.
*
* To maintain consistency, we validate that any new mapping being added falls
* in to one of these categories.
*/
SourceMapGenerator.prototype._validateMapping =
function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
aName) {
if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
&& aGenerated.line > 0 && aGenerated.column >= 0
&& !aOriginal && !aSource && !aName) {
// Case 1.
return;
}
else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
&& aOriginal && 'line' in aOriginal && 'column' in aOriginal
&& aGenerated.line > 0 && aGenerated.column >= 0
&& aOriginal.line > 0 && aOriginal.column >= 0
&& aSource) {
// Cases 2 and 3.
return;
}
else {
throw new Error('Invalid mapping: ' + JSON.stringify({
generated: aGenerated,
source: aSource,
orginal: aOriginal,
name: aName
}));
}
};
/**
* Serialize the accumulated mappings in to the stream of base 64 VLQs
* specified by the source map format.
*/
SourceMapGenerator.prototype._serializeMappings =
function SourceMapGenerator_serializeMappings() {
var previousGeneratedColumn = 0;
var previousGeneratedLine = 1;
var previousOriginalColumn = 0;
var previousOriginalLine = 0;
var previousName = 0;
var previousSource = 0;
var result = '';
var mapping;
// The mappings must be guaranteed to be in sorted order before we start
// serializing them or else the generated line numbers (which are defined
// via the ';' separators) will be all messed up. Note: it might be more
// performant to maintain the sorting as we insert them, rather than as we
// serialize them, but the big O is the same either way.
this._mappings.sort(util.compareByGeneratedPositions);
for (var i = 0, len = this._mappings.length; i < len; i++) {
mapping = this._mappings[i];
if (mapping.generatedLine !== previousGeneratedLine) {
previousGeneratedColumn = 0;
while (mapping.generatedLine !== previousGeneratedLine) {
result += ';';
previousGeneratedLine++;
}
}
else {
if (i > 0) {
if (!util.compareByGeneratedPositions(mapping, this._mappings[i - 1])) {
continue;
}
result += ',';
}
}
result += base64VLQ.encode(mapping.generatedColumn
- previousGeneratedColumn);
previousGeneratedColumn = mapping.generatedColumn;
if (mapping.source) {
result += base64VLQ.encode(this._sources.indexOf(mapping.source)
- previousSource);
previousSource = this._sources.indexOf(mapping.source);
// lines are stored 0-based in SourceMap spec version 3
result += base64VLQ.encode(mapping.originalLine - 1
- previousOriginalLine);
previousOriginalLine = mapping.originalLine - 1;
result += base64VLQ.encode(mapping.originalColumn
- previousOriginalColumn);
previousOriginalColumn = mapping.originalColumn;
if (mapping.name) {
result += base64VLQ.encode(this._names.indexOf(mapping.name)
- previousName);
previousName = this._names.indexOf(mapping.name);
}
}
}
return result;
};
SourceMapGenerator.prototype._generateSourcesContent =
function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
return aSources.map(function (source) {
if (!this._sourcesContents) {
return null;
}
if (aSourceRoot) {
source = util.relative(aSourceRoot, source);
}
var key = util.toSetString(source);
return Object.prototype.hasOwnProperty.call(this._sourcesContents,
key)
? this._sourcesContents[key]
: null;
}, this);
};
/**
* Externalize the source map.
*/
SourceMapGenerator.prototype.toJSON =
function SourceMapGenerator_toJSON() {
var map = {
version: this._version,
file: this._file,
sources: this._sources.toArray(),
names: this._names.toArray(),
mappings: this._serializeMappings()
};
if (this._sourceRoot) {
map.sourceRoot = this._sourceRoot;
}
if (this._sourcesContents) {
map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
}
return map;
};
/**
* Render the source map being generated to a string.
*/
SourceMapGenerator.prototype.toString =
function SourceMapGenerator_toString() {
return JSON.stringify(this);
};
exports.SourceMapGenerator = SourceMapGenerator;
});
},{"./array-set":36,"./base64-vlq":37,"./util":43,"amdefine":44}],42:[function(require,module,exports){
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
if (typeof define !== 'function') {
var define = require('amdefine')(module, require);
}
define(function (require, exports, module) {
var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;
var util = require('./util');
/**
* SourceNodes provide a way to abstract over interpolating/concatenating
* snippets of generated JavaScript source code while maintaining the line and
* column information associated with the original source code.
*
* @param aLine The original line number.
* @param aColumn The original column number.
* @param aSource The original source's filename.
* @param aChunks Optional. An array of strings which are snippets of
* generated JS, or other SourceNodes.
* @param aName The original identifier.
*/
function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
this.children = [];
this.sourceContents = {};
this.line = aLine === undefined ? null : aLine;
this.column = aColumn === undefined ? null : aColumn;
this.source = aSource === undefined ? null : aSource;
this.name = aName === undefined ? null : aName;
if (aChunks != null) this.add(aChunks);
}
/**
* Creates a SourceNode from generated code and a SourceMapConsumer.
*
* @param aGeneratedCode The generated code
* @param aSourceMapConsumer The SourceMap for the generated code
*/
SourceNode.fromStringWithSourceMap =
function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer) {
// The SourceNode we want to fill with the generated code
// and the SourceMap
var node = new SourceNode();
// The generated code
// Processed fragments are removed from this array.
var remainingLines = aGeneratedCode.split('\n');
// We need to remember the position of "remainingLines"
var lastGeneratedLine = 1, lastGeneratedColumn = 0;
// The generate SourceNodes we need a code range.
// To extract it current and last mapping is used.
// Here we store the last mapping.
var lastMapping = null;
aSourceMapConsumer.eachMapping(function (mapping) {
if (lastMapping === null) {
// We add the generated code until the first mapping
// to the SourceNode without any mapping.
// Each line is added as separate string.
while (lastGeneratedLine < mapping.generatedLine) {
node.add(remainingLines.shift() + "\n");
lastGeneratedLine++;
}
if (lastGeneratedColumn < mapping.generatedColumn) {
var nextLine = remainingLines[0];
node.add(nextLine.substr(0, mapping.generatedColumn));
remainingLines[0] = nextLine.substr(mapping.generatedColumn);
lastGeneratedColumn = mapping.generatedColumn;
}
} else {
// We add the code from "lastMapping" to "mapping":
// First check if there is a new line in between.
if (lastGeneratedLine < mapping.generatedLine) {
var code = "";
// Associate full lines with "lastMapping"
do {
code += remainingLines.shift() + "\n";
lastGeneratedLine++;
lastGeneratedColumn = 0;
} while (lastGeneratedLine < mapping.generatedLine);
// When we reached the correct line, we add code until we
// reach the correct column too.
if (lastGeneratedColumn < mapping.generatedColumn) {
var nextLine = remainingLines[0];
code += nextLine.substr(0, mapping.generatedColumn);
remainingLines[0] = nextLine.substr(mapping.generatedColumn);
lastGeneratedColumn = mapping.generatedColumn;
}
// Create the SourceNode.
addMappingWithCode(lastMapping, code);
} else {
// There is no new line in between.
// Associate the code between "lastGeneratedColumn" and
// "mapping.generatedColumn" with "lastMapping"
var nextLine = remainingLines[0];
var code = nextLine.substr(0, mapping.generatedColumn -
lastGeneratedColumn);
remainingLines[0] = nextLine.substr(mapping.generatedColumn -
lastGeneratedColumn);
lastGeneratedColumn = mapping.generatedColumn;
addMappingWithCode(lastMapping, code);
}
}
lastMapping = mapping;
}, this);
// We have processed all mappings.
// Associate the remaining code in the current line with "lastMapping"
// and add the remaining lines without any mapping
addMappingWithCode(lastMapping, remainingLines.join("\n"));
// Copy sourcesContent into SourceNode
aSourceMapConsumer.sources.forEach(function (sourceFile) {
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
if (content) {
node.setSourceContent(sourceFile, content);
}
});
return node;
function addMappingWithCode(mapping, code) {
if (mapping === null || mapping.source === undefined) {
node.add(code);
} else {
node.add(new SourceNode(mapping.originalLine,
mapping.originalColumn,
mapping.source,
code,
mapping.name));
}
}
};
/**
* Add a chunk of generated JS to this source node.
*
* @param aChunk A string snippet of generated JS code, another instance of
* SourceNode, or an array where each member is one of those things.
*/
SourceNode.prototype.add = function SourceNode_add(aChunk) {
if (Array.isArray(aChunk)) {
aChunk.forEach(function (chunk) {
this.add(chunk);
}, this);
}
else if (aChunk instanceof SourceNode || typeof aChunk === "string") {
if (aChunk) {
this.children.push(aChunk);
}
}
else {
throw new TypeError(
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
);
}
return this;
};
/**
* Add a chunk of generated JS to the beginning of this source node.
*
* @param aChunk A string snippet of generated JS code, another instance of
* SourceNode, or an array where each member is one of those things.
*/
SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
if (Array.isArray(aChunk)) {
for (var i = aChunk.length-1; i >= 0; i--) {
this.prepend(aChunk[i]);
}
}
else if (aChunk instanceof SourceNode || typeof aChunk === "string") {
this.children.unshift(aChunk);
}
else {
throw new TypeError(
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
);
}
return this;
};
/**
* Walk over the tree of JS snippets in this node and its children. The
* walking function is called once for each snippet of JS and is passed that
* snippet and the its original associated source's line/column location.
*
* @param aFn The traversal function.
*/
SourceNode.prototype.walk = function SourceNode_walk(aFn) {
var chunk;
for (var i = 0, len = this.children.length; i < len; i++) {
chunk = this.children[i];
if (chunk instanceof SourceNode) {
chunk.walk(aFn);
}
else {
if (chunk !== '') {
aFn(chunk, { source: this.source,
line: this.line,
column: this.column,
name: this.name });
}
}
}
};
/**
* Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
* each of `this.children`.
*
* @param aSep The separator.
*/
SourceNode.prototype.join = function SourceNode_join(aSep) {
var newChildren;
var i;
var len = this.children.length;
if (len > 0) {
newChildren = [];
for (i = 0; i < len-1; i++) {
newChildren.push(this.children[i]);
newChildren.push(aSep);
}
newChildren.push(this.children[i]);
this.children = newChildren;
}
return this;
};
/**
* Call String.prototype.replace on the very right-most source snippet. Useful
* for trimming whitespace from the end of a source node, etc.
*
* @param aPattern The pattern to replace.
* @param aReplacement The thing to replace the pattern with.
*/
SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
var lastChild = this.children[this.children.length - 1];
if (lastChild instanceof SourceNode) {
lastChild.replaceRight(aPattern, aReplacement);
}
else if (typeof lastChild === 'string') {
this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
}
else {
this.children.push(''.replace(aPattern, aReplacement));
}
return this;
};
/**
* Set the source content for a source file. This will be added to the SourceMapGenerator
* in the sourcesContent field.
*
* @param aSourceFile The filename of the source file
* @param aSourceContent The content of the source file
*/
SourceNode.prototype.setSourceContent =
function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
};
/**
* Walk over the tree of SourceNodes. The walking function is called for each
* source file content and is passed the filename and source content.
*
* @param aFn The traversal function.
*/
SourceNode.prototype.walkSourceContents =
function SourceNode_walkSourceContents(aFn) {
for (var i = 0, len = this.children.length; i < len; i++) {
if (this.children[i] instanceof SourceNode) {
this.children[i].walkSourceContents(aFn);
}
}
var sources = Object.keys(this.sourceContents);
for (var i = 0, len = sources.length; i < len; i++) {
aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
}
};
/**
* Return the string representation of this source node. Walks over the tree
* and concatenates all the various snippets together to one string.
*/
SourceNode.prototype.toString = function SourceNode_toString() {
var str = "";
this.walk(function (chunk) {
str += chunk;
});
return str;
};
/**
* Returns the string representation of this source node along with a source
* map.
*/
SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
var generated = {
code: "",
line: 1,
column: 0
};
var map = new SourceMapGenerator(aArgs);
var sourceMappingActive = false;
var lastOriginalSource = null;
var lastOriginalLine = null;
var lastOriginalColumn = null;
var lastOriginalName = null;
this.walk(function (chunk, original) {
generated.code += chunk;
if (original.source !== null
&& original.line !== null
&& original.column !== null) {
if(lastOriginalSource !== original.source
|| lastOriginalLine !== original.line
|| lastOriginalColumn !== original.column
|| lastOriginalName !== original.name) {
map.addMapping({
source: original.source,
original: {
line: original.line,
column: original.column
},
generated: {
line: generated.line,
column: generated.column
},
name: original.name
});
}
lastOriginalSource = original.source;
lastOriginalLine = original.line;
lastOriginalColumn = original.column;
lastOriginalName = original.name;
sourceMappingActive = true;
} else if (sourceMappingActive) {
map.addMapping({
generated: {
line: generated.line,
column: generated.column
}
});
lastOriginalSource = null;
sourceMappingActive = false;
}
chunk.split('').forEach(function (ch) {
if (ch === '\n') {
generated.line++;
generated.column = 0;
} else {
generated.column++;
}
});
});
this.walkSourceContents(function (sourceFile, sourceContent) {
map.setSourceContent(sourceFile, sourceContent);
});
return { code: generated.code, map: map };
};
exports.SourceNode = SourceNode;
});
},{"./source-map-generator":41,"./util":43,"amdefine":44}],43:[function(require,module,exports){
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
if (typeof define !== 'function') {
var define = require('amdefine')(module, require);
}
define(function (require, exports, module) {
/**
* This is a helper function for getting values from parameter/options
* objects.
*
* @param args The object we are extracting values from
* @param name The name of the property we are getting.
* @param defaultValue An optional value to return if the property is missing
* from the object. If this is not specified and the property is missing, an
* error will be thrown.
*/
function getArg(aArgs, aName, aDefaultValue) {
if (aName in aArgs) {
return aArgs[aName];
} else if (arguments.length === 3) {
return aDefaultValue;
} else {
throw new Error('"' + aName + '" is a required argument.');
}
}
exports.getArg = getArg;
var urlRegexp = /([\w+\-.]+):\/\/((\w+:\w+)@)?([\w.]+)?(:(\d+))?(\S+)?/;
var dataUrlRegexp = /^data:.+\,.+/;
function urlParse(aUrl) {
var match = aUrl.match(urlRegexp);
if (!match) {
return null;
}
return {
scheme: match[1],
auth: match[3],
host: match[4],
port: match[6],
path: match[7]
};
}
exports.urlParse = urlParse;
function urlGenerate(aParsedUrl) {
var url = aParsedUrl.scheme + "://";
if (aParsedUrl.auth) {
url += aParsedUrl.auth + "@"
}
if (aParsedUrl.host) {
url += aParsedUrl.host;
}
if (aParsedUrl.port) {
url += ":" + aParsedUrl.port
}
if (aParsedUrl.path) {
url += aParsedUrl.path;
}
return url;
}
exports.urlGenerate = urlGenerate;
function join(aRoot, aPath) {
var url;
if (aPath.match(urlRegexp) || aPath.match(dataUrlRegexp)) {
return aPath;
}
if (aPath.charAt(0) === '/' && (url = urlParse(aRoot))) {
url.path = aPath;
return urlGenerate(url);
}
return aRoot.replace(/\/$/, '') + '/' + aPath;
}
exports.join = join;
/**
* Because behavior goes wacky when you set `__proto__` on objects, we
* have to prefix all the strings in our set with an arbitrary character.
*
* See https://github.com/mozilla/source-map/pull/31 and
* https://github.com/mozilla/source-map/issues/30
*
* @param String aStr
*/
function toSetString(aStr) {
return '$' + aStr;
}
exports.toSetString = toSetString;
function fromSetString(aStr) {
return aStr.substr(1);
}
exports.fromSetString = fromSetString;
function relative(aRoot, aPath) {
aRoot = aRoot.replace(/\/$/, '');
var url = urlParse(aRoot);
if (aPath.charAt(0) == "/" && url && url.path == "/") {
return aPath.slice(1);
}
return aPath.indexOf(aRoot + '/') === 0
? aPath.substr(aRoot.length + 1)
: aPath;
}
exports.relative = relative;
function strcmp(aStr1, aStr2) {
var s1 = aStr1 || "";
var s2 = aStr2 || "";
return (s1 > s2) - (s1 < s2);
}
/**
* Comparator between two mappings where the original positions are compared.
*
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
* mappings with the same original source/line/column, but different generated
* line and column the same. Useful when searching for a mapping with a
* stubbed out mapping.
*/
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
var cmp;
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp || onlyCompareOriginal) {
return cmp;
}
cmp = strcmp(mappingA.name, mappingB.name);
if (cmp) {
return cmp;
}
cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp) {
return cmp;
}
return mappingA.generatedColumn - mappingB.generatedColumn;
};
exports.compareByOriginalPositions = compareByOriginalPositions;
/**
* Comparator between two mappings where the generated positions are
* compared.
*
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
* mappings with the same generated line and column, but different
* source/name/original line and column the same. Useful when searching for a
* mapping with a stubbed out mapping.
*/
function compareByGeneratedPositions(mappingA, mappingB, onlyCompareGenerated) {
var cmp;
cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp || onlyCompareGenerated) {
return cmp;
}
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
};
exports.compareByGeneratedPositions = compareByGeneratedPositions;
});
},{"amdefine":44}],44:[function(require,module,exports){
var process=require("__browserify_process"),__filename="/../node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/amdefine.js";/** vim: et:ts=4:sw=4:sts=4
* @license amdefine 0.1.0 Copyright (c) 2011, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/amdefine for details
*/
/*jslint node: true */
/*global module, process */
'use strict';
/**
* Creates a define for node.
* @param {Object} module the "module" object that is defined by Node for the
* current module.
* @param {Function} [requireFn]. Node's require function for the current module.
* It only needs to be passed in Node versions before 0.5, when module.require
* did not exist.
* @returns {Function} a define function that is usable for the current node
* module.
*/
function amdefine(module, requireFn) {
'use strict';
var defineCache = {},
loaderCache = {},
alreadyCalled = false,
path = require('path'),
makeRequire, stringRequire;
/**
* Trims the . and .. from an array of path segments.
* It will keep a leading path segment if a .. will become
* the first path segment, to help with module name lookups,
* which act like paths, but can be remapped. But the end result,
* all paths that use this function should look normalized.
* NOTE: this method MODIFIES the input array.
* @param {Array} ary the array of path segments.
*/
function trimDots(ary) {
var i, part;
for (i = 0; ary[i]; i+= 1) {
part = ary[i];
if (part === '.') {
ary.splice(i, 1);
i -= 1;
} else if (part === '..') {
if (i === 1 && (ary[2] === '..' || ary[0] === '..')) {
//End of the line. Keep at least one non-dot
//path segment at the front so it can be mapped
//correctly to disk. Otherwise, there is likely
//no path mapping for a path starting with '..'.
//This can still fail, but catches the most reasonable
//uses of ..
break;
} else if (i > 0) {
ary.splice(i - 1, 2);
i -= 2;
}
}
}
}
function normalize(name, baseName) {
var baseParts;
//Adjust any relative paths.
if (name && name.charAt(0) === '.') {
//If have a base name, try to normalize against it,
//otherwise, assume it is a top-level require that will
//be relative to baseUrl in the end.
if (baseName) {
baseParts = baseName.split('/');
baseParts = baseParts.slice(0, baseParts.length - 1);
baseParts = baseParts.concat(name.split('/'));
trimDots(baseParts);
name = baseParts.join('/');
}
}
return name;
}
/**
* Create the normalize() function passed to a loader plugin's
* normalize method.
*/
function makeNormalize(relName) {
return function (name) {
return normalize(name, relName);
};
}
function makeLoad(id) {
function load(value) {
loaderCache[id] = value;
}
load.fromText = function (id, text) {
//This one is difficult because the text can/probably uses
//define, and any relative paths and requires should be relative
//to that id was it would be found on disk. But this would require
//bootstrapping a module/require fairly deeply from node core.
//Not sure how best to go about that yet.
throw new Error('amdefine does not implement load.fromText');
};
return load;
}
makeRequire = function (systemRequire, exports, module, relId) {
function amdRequire(deps, callback) {
if (typeof deps === 'string') {
//Synchronous, single module require('')
return stringRequire(systemRequire, exports, module, deps, relId);
} else {
//Array of dependencies with a callback.
//Convert the dependencies to modules.
deps = deps.map(function (depName) {
return stringRequire(systemRequire, exports, module, depName, relId);
});
//Wait for next tick to call back the require call.
process.nextTick(function () {
callback.apply(null, deps);
});
}
}
amdRequire.toUrl = function (filePath) {
if (filePath.indexOf('.') === 0) {
return normalize(filePath, path.dirname(module.filename));
} else {
return filePath;
}
};
return amdRequire;
};
//Favor explicit value, passed in if the module wants to support Node 0.4.
requireFn = requireFn || function req() {
return module.require.apply(module, arguments);
};
function runFactory(id, deps, factory) {
var r, e, m, result;
if (id) {
e = loaderCache[id] = {};
m = {
id: id,
uri: __filename,
exports: e
};
r = makeRequire(requireFn, e, m, id);
} else {
//Only support one define call per file
if (alreadyCalled) {
throw new Error('amdefine with no module ID cannot be called more than once per file.');
}
alreadyCalled = true;
//Use the real variables from node
//Use module.exports for exports, since
//the exports in here is amdefine exports.
e = module.exports;
m = module;
r = makeRequire(requireFn, e, m, module.id);
}
//If there are dependencies, they are strings, so need
//to convert them to dependency values.
if (deps) {
deps = deps.map(function (depName) {
return r(depName);
});
}
//Call the factory with the right dependencies.
if (typeof factory === 'function') {
result = factory.apply(m.exports, deps);
} else {
result = factory;
}
if (result !== undefined) {
m.exports = result;
if (id) {
loaderCache[id] = m.exports;
}
}
}
stringRequire = function (systemRequire, exports, module, id, relId) {
//Split the ID by a ! so that
var index = id.indexOf('!'),
originalId = id,
prefix, plugin;
if (index === -1) {
id = normalize(id, relId);
//Straight module lookup. If it is one of the special dependencies,
//deal with it, otherwise, delegate to node.
if (id === 'require') {
return makeRequire(systemRequire, exports, module, relId);
} else if (id === 'exports') {
return exports;
} else if (id === 'module') {
return module;
} else if (loaderCache.hasOwnProperty(id)) {
return loaderCache[id];
} else if (defineCache[id]) {
runFactory.apply(null, defineCache[id]);
return loaderCache[id];
} else {
if(systemRequire) {
return systemRequire(originalId);
} else {
throw new Error('No module with ID: ' + id);
}
}
} else {
//There is a plugin in play.
prefix = id.substring(0, index);
id = id.substring(index + 1, id.length);
plugin = stringRequire(systemRequire, exports, module, prefix, relId);
if (plugin.normalize) {
id = plugin.normalize(id, makeNormalize(relId));
} else {
//Normalize the ID normally.
id = normalize(id, relId);
}
if (loaderCache[id]) {
return loaderCache[id];
} else {
plugin.load(id, makeRequire(systemRequire, exports, module, relId), makeLoad(id), {});
return loaderCache[id];
}
}
};
//Create a define function specific to the module asking for amdefine.
function define(id, deps, factory) {
if (Array.isArray(id)) {
factory = deps;
deps = id;
id = undefined;
} else if (typeof id !== 'string') {
factory = id;
id = deps = undefined;
}
if (deps && !Array.isArray(deps)) {
factory = deps;
deps = undefined;
}
if (!deps) {
deps = ['require', 'exports', 'module'];
}
//Set up properties for this module. If an ID, then use
//internal cache. If no ID, then use the external variables
//for this node module.
if (id) {
//Put the module in deep freeze until there is a
//require call for it.
defineCache[id] = [id, deps, factory];
} else {
runFactory(id, deps, factory);
}
}
//define.require, which has access to all the values in the
//cache. Useful for AMD modules that all have IDs in the file,
//but need to finally export a value to node based on one of those
//IDs.
define.require = function (id) {
if (loaderCache[id]) {
return loaderCache[id];
}
if (defineCache[id]) {
runFactory.apply(null, defineCache[id]);
return loaderCache[id];
}
};
define.amd = {};
return define;
}
module.exports = amdefine;
},{"__browserify_process":29,"path":30}],45:[function(require,module,exports){
var sys = require("util");
var MOZ_SourceMap = require("source-map");
var UglifyJS = exports;
/***********************************************************************
A JavaScript tokenizer / parser / beautifier / compressor.
https://github.com/mishoo/UglifyJS2
-------------------------------- (C) ---------------------------------
Author: Mihai Bazon
<mihai.bazon@gmail.com>
http://mihai.bazon.net/blog
Distributed under the BSD license:
Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***********************************************************************/
"use strict";
function array_to_hash(a) {
var ret = Object.create(null);
for (var i = 0; i < a.length; ++i)
ret[a[i]] = true;
return ret;
};
function slice(a, start) {
return Array.prototype.slice.call(a, start || 0);
};
function characters(str) {
return str.split("");
};
function member(name, array) {
for (var i = array.length; --i >= 0;)
if (array[i] == name)
return true;
return false;
};
function find_if(func, array) {
for (var i = 0, n = array.length; i < n; ++i) {
if (func(array[i]))
return array[i];
}
};
function repeat_string(str, i) {
if (i <= 0) return "";
if (i == 1) return str;
var d = repeat_string(str, i >> 1);
d += d;
if (i & 1) d += str;
return d;
};
function DefaultsError(msg, defs) {
Error.call(this, msg);
this.msg = msg;
this.defs = defs;
};
DefaultsError.prototype = Object.create(Error.prototype);
DefaultsError.prototype.constructor = DefaultsError;
DefaultsError.croak = function(msg, defs) {
throw new DefaultsError(msg, defs);
};
function defaults(args, defs, croak) {
if (args === true)
args = {};
var ret = args || {};
if (croak) for (var i in ret) if (ret.hasOwnProperty(i) && !defs.hasOwnProperty(i))
DefaultsError.croak("`" + i + "` is not a supported option", defs);
for (var i in defs) if (defs.hasOwnProperty(i)) {
ret[i] = (args && args.hasOwnProperty(i)) ? args[i] : defs[i];
}
return ret;
};
function merge(obj, ext) {
for (var i in ext) if (ext.hasOwnProperty(i)) {
obj[i] = ext[i];
}
return obj;
};
function noop() {};
var MAP = (function(){
function MAP(a, f, backwards) {
var ret = [], top = [], i;
function doit() {
var val = f(a[i], i);
var is_last = val instanceof Last;
if (is_last) val = val.v;
if (val instanceof AtTop) {
val = val.v;
if (val instanceof Splice) {
top.push.apply(top, backwards ? val.v.slice().reverse() : val.v);
} else {
top.push(val);
}
}
else if (val !== skip) {
if (val instanceof Splice) {
ret.push.apply(ret, backwards ? val.v.slice().reverse() : val.v);
} else {
ret.push(val);
}
}
return is_last;
};
if (a instanceof Array) {
if (backwards) {
for (i = a.length; --i >= 0;) if (doit()) break;
ret.reverse();
top.reverse();
} else {
for (i = 0; i < a.length; ++i) if (doit()) break;
}
}
else {
for (i in a) if (a.hasOwnProperty(i)) if (doit()) break;
}
return top.concat(ret);
};
MAP.at_top = function(val) { return new AtTop(val) };
MAP.splice = function(val) { return new Splice(val) };
MAP.last = function(val) { return new Last(val) };
var skip = MAP.skip = {};
function AtTop(val) { this.v = val };
function Splice(val) { this.v = val };
function Last(val) { this.v = val };
return MAP;
})();
function push_uniq(array, el) {
if (array.indexOf(el) < 0)
array.push(el);
};
function string_template(text, props) {
return text.replace(/\{(.+?)\}/g, function(str, p){
return props[p];
});
};
function remove(array, el) {
for (var i = array.length; --i >= 0;) {
if (array[i] === el) array.splice(i, 1);
}
};
function mergeSort(array, cmp) {
if (array.length < 2) return array.slice();
function merge(a, b) {
var r = [], ai = 0, bi = 0, i = 0;
while (ai < a.length && bi < b.length) {
cmp(a[ai], b[bi]) <= 0
? r[i++] = a[ai++]
: r[i++] = b[bi++];
}
if (ai < a.length) r.push.apply(r, a.slice(ai));
if (bi < b.length) r.push.apply(r, b.slice(bi));
return r;
};
function _ms(a) {
if (a.length <= 1)
return a;
var m = Math.floor(a.length / 2), left = a.slice(0, m), right = a.slice(m);
left = _ms(left);
right = _ms(right);
return merge(left, right);
};
return _ms(array);
};
function set_difference(a, b) {
return a.filter(function(el){
return b.indexOf(el) < 0;
});
};
function set_intersection(a, b) {
return a.filter(function(el){
return b.indexOf(el) >= 0;
});
};
// this function is taken from Acorn [1], written by Marijn Haverbeke
// [1] https://github.com/marijnh/acorn
function makePredicate(words) {
if (!(words instanceof Array)) words = words.split(" ");
var f = "", cats = [];
out: for (var i = 0; i < words.length; ++i) {
for (var j = 0; j < cats.length; ++j)
if (cats[j][0].length == words[i].length) {
cats[j].push(words[i]);
continue out;
}
cats.push([words[i]]);
}
function compareTo(arr) {
if (arr.length == 1) return f += "return str === " + JSON.stringify(arr[0]) + ";";
f += "switch(str){";
for (var i = 0; i < arr.length; ++i) f += "case " + JSON.stringify(arr[i]) + ":";
f += "return true}return false;";
}
// When there are more than three length categories, an outer
// switch first dispatches on the lengths, to save on comparisons.
if (cats.length > 3) {
cats.sort(function(a, b) {return b.length - a.length;});
f += "switch(str.length){";
for (var i = 0; i < cats.length; ++i) {
var cat = cats[i];
f += "case " + cat[0].length + ":";
compareTo(cat);
}
f += "}";
// Otherwise, simply generate a flat `switch` statement.
} else {
compareTo(words);
}
return new Function("str", f);
};
function all(array, predicate) {
for (var i = array.length; --i >= 0;)
if (!predicate(array[i]))
return false;
return true;
};
function Dictionary() {
this._values = Object.create(null);
this._size = 0;
};
Dictionary.prototype = {
set: function(key, val) {
if (!this.has(key)) ++this._size;
this._values["$" + key] = val;
return this;
},
add: function(key, val) {
if (this.has(key)) {
this.get(key).push(val);
} else {
this.set(key, [ val ]);
}
return this;
},
get: function(key) { return this._values["$" + key] },
del: function(key) {
if (this.has(key)) {
--this._size;
delete this._values["$" + key];
}
return this;
},
has: function(key) { return ("$" + key) in this._values },
each: function(f) {
for (var i in this._values)
f(this._values[i], i.substr(1));
},
size: function() {
return this._size;
},
map: function(f) {
var ret = [];
for (var i in this._values)
ret.push(f(this._values[i], i.substr(1)));
return ret;
}
};
/***********************************************************************
A JavaScript tokenizer / parser / beautifier / compressor.
https://github.com/mishoo/UglifyJS2
-------------------------------- (C) ---------------------------------
Author: Mihai Bazon
<mihai.bazon@gmail.com>
http://mihai.bazon.net/blog
Distributed under the BSD license:
Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***********************************************************************/
"use strict";
function DEFNODE(type, props, methods, base) {
if (arguments.length < 4) base = AST_Node;
if (!props) props = [];
else props = props.split(/\s+/);
var self_props = props;
if (base && base.PROPS)
props = props.concat(base.PROPS);
var code = "return function AST_" + type + "(props){ if (props) { ";
for (var i = props.length; --i >= 0;) {
code += "this." + props[i] + " = props." + props[i] + ";";
}
var proto = base && new base;
if (proto && proto.initialize || (methods && methods.initialize))
code += "this.initialize();";
code += "}}";
var ctor = new Function(code)();
if (proto) {
ctor.prototype = proto;
ctor.BASE = base;
}
if (base) base.SUBCLASSES.push(ctor);
ctor.prototype.CTOR = ctor;
ctor.PROPS = props || null;
ctor.SELF_PROPS = self_props;
ctor.SUBCLASSES = [];
if (type) {
ctor.prototype.TYPE = ctor.TYPE = type;
}
if (methods) for (i in methods) if (methods.hasOwnProperty(i)) {
if (/^\$/.test(i)) {
ctor[i.substr(1)] = methods[i];
} else {
ctor.prototype[i] = methods[i];
}
}
ctor.DEFMETHOD = function(name, method) {
this.prototype[name] = method;
};
return ctor;
};
var AST_Token = DEFNODE("Token", "type value line col pos endpos nlb comments_before file", {
}, null);
var AST_Node = DEFNODE("Node", "start end", {
clone: function() {
return new this.CTOR(this);
},
$documentation: "Base class of all AST nodes",
$propdoc: {
start: "[AST_Token] The first token of this node",
end: "[AST_Token] The last token of this node"
},
_walk: function(visitor) {
return visitor._visit(this);
},
walk: function(visitor) {
return this._walk(visitor); // not sure the indirection will be any help
}
}, null);
AST_Node.warn_function = null;
AST_Node.warn = function(txt, props) {
if (AST_Node.warn_function)
AST_Node.warn_function(string_template(txt, props));
};
/* -----[ statements ]----- */
var AST_Statement = DEFNODE("Statement", null, {
$documentation: "Base class of all statements",
});
var AST_Debugger = DEFNODE("Debugger", null, {
$documentation: "Represents a debugger statement",
}, AST_Statement);
var AST_Directive = DEFNODE("Directive", "value scope", {
$documentation: "Represents a directive, like \"use strict\";",
$propdoc: {
value: "[string] The value of this directive as a plain string (it's not an AST_String!)",
scope: "[AST_Scope/S] The scope that this directive affects"
},
}, AST_Statement);
var AST_SimpleStatement = DEFNODE("SimpleStatement", "body", {
$documentation: "A statement consisting of an expression, i.e. a = 1 + 2",
$propdoc: {
body: "[AST_Node] an expression node (should not be instanceof AST_Statement)"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.body._walk(visitor);
});
}
}, AST_Statement);
function walk_body(node, visitor) {
if (node.body instanceof AST_Statement) {
node.body._walk(visitor);
}
else node.body.forEach(function(stat){
stat._walk(visitor);
});
};
var AST_Block = DEFNODE("Block", "body", {
$documentation: "A body of statements (usually bracketed)",
$propdoc: {
body: "[AST_Statement*] an array of statements"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
walk_body(this, visitor);
});
}
}, AST_Statement);
var AST_BlockStatement = DEFNODE("BlockStatement", null, {
$documentation: "A block statement",
}, AST_Block);
var AST_EmptyStatement = DEFNODE("EmptyStatement", null, {
$documentation: "The empty statement (empty block or simply a semicolon)",
_walk: function(visitor) {
return visitor._visit(this);
}
}, AST_Statement);
var AST_StatementWithBody = DEFNODE("StatementWithBody", "body", {
$documentation: "Base class for all statements that contain one nested body: `For`, `ForIn`, `Do`, `While`, `With`",
$propdoc: {
body: "[AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.body._walk(visitor);
});
}
}, AST_Statement);
var AST_LabeledStatement = DEFNODE("LabeledStatement", "label", {
$documentation: "Statement with a label",
$propdoc: {
label: "[AST_Label] a label definition"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.label._walk(visitor);
this.body._walk(visitor);
});
}
}, AST_StatementWithBody);
var AST_IterationStatement = DEFNODE("IterationStatement", null, {
$documentation: "Internal class. All loops inherit from it."
}, AST_StatementWithBody);
var AST_DWLoop = DEFNODE("DWLoop", "condition", {
$documentation: "Base class for do/while statements",
$propdoc: {
condition: "[AST_Node] the loop condition. Should not be instanceof AST_Statement"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.condition._walk(visitor);
this.body._walk(visitor);
});
}
}, AST_IterationStatement);
var AST_Do = DEFNODE("Do", null, {
$documentation: "A `do` statement",
}, AST_DWLoop);
var AST_While = DEFNODE("While", null, {
$documentation: "A `while` statement",
}, AST_DWLoop);
var AST_For = DEFNODE("For", "init condition step", {
$documentation: "A `for` statement",
$propdoc: {
init: "[AST_Node?] the `for` initialization code, or null if empty",
condition: "[AST_Node?] the `for` termination clause, or null if empty",
step: "[AST_Node?] the `for` update clause, or null if empty"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
if (this.init) this.init._walk(visitor);
if (this.condition) this.condition._walk(visitor);
if (this.step) this.step._walk(visitor);
this.body._walk(visitor);
});
}
}, AST_IterationStatement);
var AST_ForIn = DEFNODE("ForIn", "init name object", {
$documentation: "A `for ... in` statement",
$propdoc: {
init: "[AST_Node] the `for/in` initialization code",
name: "[AST_SymbolRef?] the loop variable, only if `init` is AST_Var",
object: "[AST_Node] the object that we're looping through"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.init._walk(visitor);
this.object._walk(visitor);
this.body._walk(visitor);
});
}
}, AST_IterationStatement);
var AST_With = DEFNODE("With", "expression", {
$documentation: "A `with` statement",
$propdoc: {
expression: "[AST_Node] the `with` expression"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.expression._walk(visitor);
this.body._walk(visitor);
});
}
}, AST_StatementWithBody);
/* -----[ scope and functions ]----- */
var AST_Scope = DEFNODE("Scope", "directives variables functions uses_with uses_eval parent_scope enclosed cname", {
$documentation: "Base class for all statements introducing a lexical scope",
$propdoc: {
directives: "[string*/S] an array of directives declared in this scope",
variables: "[Object/S] a map of name -> SymbolDef for all variables/functions defined in this scope",
functions: "[Object/S] like `variables`, but only lists function declarations",
uses_with: "[boolean/S] tells whether this scope uses the `with` statement",
uses_eval: "[boolean/S] tells whether this scope contains a direct call to the global `eval`",
parent_scope: "[AST_Scope?/S] link to the parent scope",
enclosed: "[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes",
cname: "[integer/S] current index for mangling variables (used internally by the mangler)",
},
}, AST_Block);
var AST_Toplevel = DEFNODE("Toplevel", "globals", {
$documentation: "The toplevel scope",
$propdoc: {
globals: "[Object/S] a map of name -> SymbolDef for all undeclared names",
},
wrap_enclose: function(arg_parameter_pairs) {
var self = this;
var args = [];
var parameters = [];
arg_parameter_pairs.forEach(function(pair) {
var split = pair.split(":");
args.push(split[0]);
parameters.push(split[1]);
});
var wrapped_tl = "(function(" + parameters.join(",") + "){ '$ORIG'; })(" + args.join(",") + ")";
wrapped_tl = parse(wrapped_tl);
wrapped_tl = wrapped_tl.transform(new TreeTransformer(function before(node){
if (node instanceof AST_Directive && node.value == "$ORIG") {
return MAP.splice(self.body);
}
}));
return wrapped_tl;
},
wrap_commonjs: function(name, export_all) {
var self = this;
var to_export = [];
if (export_all) {
self.figure_out_scope();
self.walk(new TreeWalker(function(node){
if (node instanceof AST_SymbolDeclaration && node.definition().global) {
if (!find_if(function(n){ return n.name == node.name }, to_export))
to_export.push(node);
}
}));
}
var wrapped_tl = "(function(exports, global){ global['" + name + "'] = exports; '$ORIG'; '$EXPORTS'; }({}, (function(){return this}())))";
wrapped_tl = parse(wrapped_tl);
wrapped_tl = wrapped_tl.transform(new TreeTransformer(function before(node){
if (node instanceof AST_SimpleStatement) {
node = node.body;
if (node instanceof AST_String) switch (node.getValue()) {
case "$ORIG":
return MAP.splice(self.body);
case "$EXPORTS":
var body = [];
to_export.forEach(function(sym){
body.push(new AST_SimpleStatement({
body: new AST_Assign({
left: new AST_Sub({
expression: new AST_SymbolRef({ name: "exports" }),
property: new AST_String({ value: sym.name }),
}),
operator: "=",
right: new AST_SymbolRef(sym),
}),
}));
});
return MAP.splice(body);
}
}
}));
return wrapped_tl;
}
}, AST_Scope);
var AST_Lambda = DEFNODE("Lambda", "name argnames uses_arguments", {
$documentation: "Base class for functions",
$propdoc: {
name: "[AST_SymbolDeclaration?] the name of this function",
argnames: "[AST_SymbolFunarg*] array of function arguments",
uses_arguments: "[boolean/S] tells whether this function accesses the arguments array"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
if (this.name) this.name._walk(visitor);
this.argnames.forEach(function(arg){
arg._walk(visitor);
});
walk_body(this, visitor);
});
}
}, AST_Scope);
var AST_Accessor = DEFNODE("Accessor", null, {
$documentation: "A setter/getter function. The `name` property is always null."
}, AST_Lambda);
var AST_Function = DEFNODE("Function", null, {
$documentation: "A function expression"
}, AST_Lambda);
var AST_Defun = DEFNODE("Defun", null, {
$documentation: "A function definition"
}, AST_Lambda);
/* -----[ JUMPS ]----- */
var AST_Jump = DEFNODE("Jump", null, {
$documentation: "Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)"
}, AST_Statement);
var AST_Exit = DEFNODE("Exit", "value", {
$documentation: "Base class for “exits” (`return` and `throw`)",
$propdoc: {
value: "[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return"
},
_walk: function(visitor) {
return visitor._visit(this, this.value && function(){
this.value._walk(visitor);
});
}
}, AST_Jump);
var AST_Return = DEFNODE("Return", null, {
$documentation: "A `return` statement"
}, AST_Exit);
var AST_Throw = DEFNODE("Throw", null, {
$documentation: "A `throw` statement"
}, AST_Exit);
var AST_LoopControl = DEFNODE("LoopControl", "label", {
$documentation: "Base class for loop control statements (`break` and `continue`)",
$propdoc: {
label: "[AST_LabelRef?] the label, or null if none",
},
_walk: function(visitor) {
return visitor._visit(this, this.label && function(){
this.label._walk(visitor);
});
}
}, AST_Jump);
var AST_Break = DEFNODE("Break", null, {
$documentation: "A `break` statement"
}, AST_LoopControl);
var AST_Continue = DEFNODE("Continue", null, {
$documentation: "A `continue` statement"
}, AST_LoopControl);
/* -----[ IF ]----- */
var AST_If = DEFNODE("If", "condition alternative", {
$documentation: "A `if` statement",
$propdoc: {
condition: "[AST_Node] the `if` condition",
alternative: "[AST_Statement?] the `else` part, or null if not present"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.condition._walk(visitor);
this.body._walk(visitor);
if (this.alternative) this.alternative._walk(visitor);
});
}
}, AST_StatementWithBody);
/* -----[ SWITCH ]----- */
var AST_Switch = DEFNODE("Switch", "expression", {
$documentation: "A `switch` statement",
$propdoc: {
expression: "[AST_Node] the `switch` “discriminant”"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.expression._walk(visitor);
walk_body(this, visitor);
});
}
}, AST_Block);
var AST_SwitchBranch = DEFNODE("SwitchBranch", null, {
$documentation: "Base class for `switch` branches",
}, AST_Block);
var AST_Default = DEFNODE("Default", null, {
$documentation: "A `default` switch branch",
}, AST_SwitchBranch);
var AST_Case = DEFNODE("Case", "expression", {
$documentation: "A `case` switch branch",
$propdoc: {
expression: "[AST_Node] the `case` expression"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.expression._walk(visitor);
walk_body(this, visitor);
});
}
}, AST_SwitchBranch);
/* -----[ EXCEPTIONS ]----- */
var AST_Try = DEFNODE("Try", "bcatch bfinally", {
$documentation: "A `try` statement",
$propdoc: {
bcatch: "[AST_Catch?] the catch block, or null if not present",
bfinally: "[AST_Finally?] the finally block, or null if not present"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
walk_body(this, visitor);
if (this.bcatch) this.bcatch._walk(visitor);
if (this.bfinally) this.bfinally._walk(visitor);
});
}
}, AST_Block);
var AST_Catch = DEFNODE("Catch", "argname", {
$documentation: "A `catch` node; only makes sense as part of a `try` statement",
$propdoc: {
argname: "[AST_SymbolCatch] symbol for the exception"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.argname._walk(visitor);
walk_body(this, visitor);
});
}
}, AST_Block);
var AST_Finally = DEFNODE("Finally", null, {
$documentation: "A `finally` node; only makes sense as part of a `try` statement"
}, AST_Block);
/* -----[ VAR/CONST ]----- */
var AST_Definitions = DEFNODE("Definitions", "definitions", {
$documentation: "Base class for `var` or `const` nodes (variable declarations/initializations)",
$propdoc: {
definitions: "[AST_VarDef*] array of variable definitions"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.definitions.forEach(function(def){
def._walk(visitor);
});
});
}
}, AST_Statement);
var AST_Var = DEFNODE("Var", null, {
$documentation: "A `var` statement"
}, AST_Definitions);
var AST_Const = DEFNODE("Const", null, {
$documentation: "A `const` statement"
}, AST_Definitions);
var AST_VarDef = DEFNODE("VarDef", "name value", {
$documentation: "A variable declaration; only appears in a AST_Definitions node",
$propdoc: {
name: "[AST_SymbolVar|AST_SymbolConst] name of the variable",
value: "[AST_Node?] initializer, or null of there's no initializer"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.name._walk(visitor);
if (this.value) this.value._walk(visitor);
});
}
});
/* -----[ OTHER ]----- */
var AST_Call = DEFNODE("Call", "expression args", {
$documentation: "A function call expression",
$propdoc: {
expression: "[AST_Node] expression to invoke as function",
args: "[AST_Node*] array of arguments"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.expression._walk(visitor);
this.args.forEach(function(arg){
arg._walk(visitor);
});
});
}
});
var AST_New = DEFNODE("New", null, {
$documentation: "An object instantiation. Derives from a function call since it has exactly the same properties"
}, AST_Call);
var AST_Seq = DEFNODE("Seq", "car cdr", {
$documentation: "A sequence expression (two comma-separated expressions)",
$propdoc: {
car: "[AST_Node] first element in sequence",
cdr: "[AST_Node] second element in sequence"
},
$cons: function(x, y) {
var seq = new AST_Seq(x);
seq.car = x;
seq.cdr = y;
return seq;
},
$from_array: function(array) {
if (array.length == 0) return null;
if (array.length == 1) return array[0].clone();
var list = null;
for (var i = array.length; --i >= 0;) {
list = AST_Seq.cons(array[i], list);
}
var p = list;
while (p) {
if (p.cdr && !p.cdr.cdr) {
p.cdr = p.cdr.car;
break;
}
p = p.cdr;
}
return list;
},
to_array: function() {
var p = this, a = [];
while (p) {
a.push(p.car);
if (p.cdr && !(p.cdr instanceof AST_Seq)) {
a.push(p.cdr);
break;
}
p = p.cdr;
}
return a;
},
add: function(node) {
var p = this;
while (p) {
if (!(p.cdr instanceof AST_Seq)) {
var cell = AST_Seq.cons(p.cdr, node);
return p.cdr = cell;
}
p = p.cdr;
}
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.car._walk(visitor);
if (this.cdr) this.cdr._walk(visitor);
});
}
});
var AST_PropAccess = DEFNODE("PropAccess", "expression property", {
$documentation: "Base class for property access expressions, i.e. `a.foo` or `a[\"foo\"]`",
$propdoc: {
expression: "[AST_Node] the “container” expression",
property: "[AST_Node|string] the property to access. For AST_Dot this is always a plain string, while for AST_Sub it's an arbitrary AST_Node"
}
});
var AST_Dot = DEFNODE("Dot", null, {
$documentation: "A dotted property access expression",
_walk: function(visitor) {
return visitor._visit(this, function(){
this.expression._walk(visitor);
});
}
}, AST_PropAccess);
var AST_Sub = DEFNODE("Sub", null, {
$documentation: "Index-style property access, i.e. `a[\"foo\"]`",
_walk: function(visitor) {
return visitor._visit(this, function(){
this.expression._walk(visitor);
this.property._walk(visitor);
});
}
}, AST_PropAccess);
var AST_Unary = DEFNODE("Unary", "operator expression", {
$documentation: "Base class for unary expressions",
$propdoc: {
operator: "[string] the operator",
expression: "[AST_Node] expression that this unary operator applies to"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.expression._walk(visitor);
});
}
});
var AST_UnaryPrefix = DEFNODE("UnaryPrefix", null, {
$documentation: "Unary prefix expression, i.e. `typeof i` or `++i`"
}, AST_Unary);
var AST_UnaryPostfix = DEFNODE("UnaryPostfix", null, {
$documentation: "Unary postfix expression, i.e. `i++`"
}, AST_Unary);
var AST_Binary = DEFNODE("Binary", "left operator right", {
$documentation: "Binary expression, i.e. `a + b`",
$propdoc: {
left: "[AST_Node] left-hand side expression",
operator: "[string] the operator",
right: "[AST_Node] right-hand side expression"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.left._walk(visitor);
this.right._walk(visitor);
});
}
});
var AST_Conditional = DEFNODE("Conditional", "condition consequent alternative", {
$documentation: "Conditional expression using the ternary operator, i.e. `a ? b : c`",
$propdoc: {
condition: "[AST_Node]",
consequent: "[AST_Node]",
alternative: "[AST_Node]"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.condition._walk(visitor);
this.consequent._walk(visitor);
this.alternative._walk(visitor);
});
}
});
var AST_Assign = DEFNODE("Assign", null, {
$documentation: "An assignment expression — `a = b + 5`",
}, AST_Binary);
/* -----[ LITERALS ]----- */
var AST_Array = DEFNODE("Array", "elements", {
$documentation: "An array literal",
$propdoc: {
elements: "[AST_Node*] array of elements"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.elements.forEach(function(el){
el._walk(visitor);
});
});
}
});
var AST_Object = DEFNODE("Object", "properties", {
$documentation: "An object literal",
$propdoc: {
properties: "[AST_ObjectProperty*] array of properties"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.properties.forEach(function(prop){
prop._walk(visitor);
});
});
}
});
var AST_ObjectProperty = DEFNODE("ObjectProperty", "key value", {
$documentation: "Base class for literal object properties",
$propdoc: {
key: "[string] the property name converted to a string for ObjectKeyVal. For setters and getters this is an arbitrary AST_Node.",
value: "[AST_Node] property value. For setters and getters this is an AST_Function."
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.value._walk(visitor);
});
}
});
var AST_ObjectKeyVal = DEFNODE("ObjectKeyVal", null, {
$documentation: "A key: value object property",
}, AST_ObjectProperty);
var AST_ObjectSetter = DEFNODE("ObjectSetter", null, {
$documentation: "An object setter property",
}, AST_ObjectProperty);
var AST_ObjectGetter = DEFNODE("ObjectGetter", null, {
$documentation: "An object getter property",
}, AST_ObjectProperty);
var AST_Symbol = DEFNODE("Symbol", "scope name thedef", {
$propdoc: {
name: "[string] name of this symbol",
scope: "[AST_Scope/S] the current scope (not necessarily the definition scope)",
thedef: "[SymbolDef/S] the definition of this symbol"
},
$documentation: "Base class for all symbols",
});
var AST_SymbolAccessor = DEFNODE("SymbolAccessor", null, {
$documentation: "The name of a property accessor (setter/getter function)"
}, AST_Symbol);
var AST_SymbolDeclaration = DEFNODE("SymbolDeclaration", "init", {
$documentation: "A declaration symbol (symbol in var/const, function name or argument, symbol in catch)",
$propdoc: {
init: "[AST_Node*/S] array of initializers for this declaration."
}
}, AST_Symbol);
var AST_SymbolVar = DEFNODE("SymbolVar", null, {
$documentation: "Symbol defining a variable",
}, AST_SymbolDeclaration);
var AST_SymbolConst = DEFNODE("SymbolConst", null, {
$documentation: "A constant declaration"
}, AST_SymbolDeclaration);
var AST_SymbolFunarg = DEFNODE("SymbolFunarg", null, {
$documentation: "Symbol naming a function argument",
}, AST_SymbolVar);
var AST_SymbolDefun = DEFNODE("SymbolDefun", null, {
$documentation: "Symbol defining a function",
}, AST_SymbolDeclaration);
var AST_SymbolLambda = DEFNODE("SymbolLambda", null, {
$documentation: "Symbol naming a function expression",
}, AST_SymbolDeclaration);
var AST_SymbolCatch = DEFNODE("SymbolCatch", null, {
$documentation: "Symbol naming the exception in catch",
}, AST_SymbolDeclaration);
var AST_Label = DEFNODE("Label", "references", {
$documentation: "Symbol naming a label (declaration)",
$propdoc: {
references: "[AST_LoopControl*] a list of nodes referring to this label"
},
initialize: function() {
this.references = [];
this.thedef = this;
}
}, AST_Symbol);
var AST_SymbolRef = DEFNODE("SymbolRef", null, {
$documentation: "Reference to some symbol (not definition/declaration)",
}, AST_Symbol);
var AST_LabelRef = DEFNODE("LabelRef", null, {
$documentation: "Reference to a label symbol",
}, AST_Symbol);
var AST_This = DEFNODE("This", null, {
$documentation: "The `this` symbol",
}, AST_Symbol);
var AST_Constant = DEFNODE("Constant", null, {
$documentation: "Base class for all constants",
getValue: function() {
return this.value;
}
});
var AST_String = DEFNODE("String", "value", {
$documentation: "A string literal",
$propdoc: {
value: "[string] the contents of this string"
}
}, AST_Constant);
var AST_Number = DEFNODE("Number", "value", {
$documentation: "A number literal",
$propdoc: {
value: "[number] the numeric value"
}
}, AST_Constant);
var AST_RegExp = DEFNODE("RegExp", "value", {
$documentation: "A regexp literal",
$propdoc: {
value: "[RegExp] the actual regexp"
}
}, AST_Constant);
var AST_Atom = DEFNODE("Atom", null, {
$documentation: "Base class for atoms",
}, AST_Constant);
var AST_Null = DEFNODE("Null", null, {
$documentation: "The `null` atom",
value: null
}, AST_Atom);
var AST_NaN = DEFNODE("NaN", null, {
$documentation: "The impossible value",
value: 0/0
}, AST_Atom);
var AST_Undefined = DEFNODE("Undefined", null, {
$documentation: "The `undefined` value",
value: (function(){}())
}, AST_Atom);
var AST_Hole = DEFNODE("Hole", null, {
$documentation: "A hole in an array",
value: (function(){}())
}, AST_Atom);
var AST_Infinity = DEFNODE("Infinity", null, {
$documentation: "The `Infinity` value",
value: 1/0
}, AST_Atom);
var AST_Boolean = DEFNODE("Boolean", null, {
$documentation: "Base class for booleans",
}, AST_Atom);
var AST_False = DEFNODE("False", null, {
$documentation: "The `false` atom",
value: false
}, AST_Boolean);
var AST_True = DEFNODE("True", null, {
$documentation: "The `true` atom",
value: true
}, AST_Boolean);
/* -----[ TreeWalker ]----- */
function TreeWalker(callback) {
this.visit = callback;
this.stack = [];
};
TreeWalker.prototype = {
_visit: function(node, descend) {
this.stack.push(node);
var ret = this.visit(node, descend ? function(){
descend.call(node);
} : noop);
if (!ret && descend) {
descend.call(node);
}
this.stack.pop();
return ret;
},
parent: function(n) {
return this.stack[this.stack.length - 2 - (n || 0)];
},
push: function (node) {
this.stack.push(node);
},
pop: function() {
return this.stack.pop();
},
self: function() {
return this.stack[this.stack.length - 1];
},
find_parent: function(type) {
var stack = this.stack;
for (var i = stack.length; --i >= 0;) {
var x = stack[i];
if (x instanceof type) return x;
}
},
has_directive: function(type) {
return this.find_parent(AST_Scope).has_directive(type);
},
in_boolean_context: function() {
var stack = this.stack;
var i = stack.length, self = stack[--i];
while (i > 0) {
var p = stack[--i];
if ((p instanceof AST_If && p.condition === self) ||
(p instanceof AST_Conditional && p.condition === self) ||
(p instanceof AST_DWLoop && p.condition === self) ||
(p instanceof AST_For && p.condition === self) ||
(p instanceof AST_UnaryPrefix && p.operator == "!" && p.expression === self))
{
return true;
}
if (!(p instanceof AST_Binary && (p.operator == "&&" || p.operator == "||")))
return false;
self = p;
}
},
loopcontrol_target: function(label) {
var stack = this.stack;
if (label) for (var i = stack.length; --i >= 0;) {
var x = stack[i];
if (x instanceof AST_LabeledStatement && x.label.name == label.name) {
return x.body;
}
} else for (var i = stack.length; --i >= 0;) {
var x = stack[i];
if (x instanceof AST_Switch || x instanceof AST_IterationStatement)
return x;
}
}
};
/***********************************************************************
A JavaScript tokenizer / parser / beautifier / compressor.
https://github.com/mishoo/UglifyJS2
-------------------------------- (C) ---------------------------------
Author: Mihai Bazon
<mihai.bazon@gmail.com>
http://mihai.bazon.net/blog
Distributed under the BSD license:
Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
Parser based on parse-js (http://marijn.haverbeke.nl/parse-js/).
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***********************************************************************/
"use strict";
var KEYWORDS = 'break case catch const continue debugger default delete do else finally for function if in instanceof new return switch throw try typeof var void while with';
var KEYWORDS_ATOM = 'false null true';
var RESERVED_WORDS = 'abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized this throws transient volatile'
+ " " + KEYWORDS_ATOM + " " + KEYWORDS;
var KEYWORDS_BEFORE_EXPRESSION = 'return new delete throw else case';
KEYWORDS = makePredicate(KEYWORDS);
RESERVED_WORDS = makePredicate(RESERVED_WORDS);
KEYWORDS_BEFORE_EXPRESSION = makePredicate(KEYWORDS_BEFORE_EXPRESSION);
KEYWORDS_ATOM = makePredicate(KEYWORDS_ATOM);
var OPERATOR_CHARS = makePredicate(characters("+-*&%=<>!?|~^"));
var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i;
var RE_OCT_NUMBER = /^0[0-7]+$/;
var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i;
var OPERATORS = makePredicate([
"in",
"instanceof",
"typeof",
"new",
"void",
"delete",
"++",
"--",
"+",
"-",
"!",
"~",
"&",
"|",
"^",
"*",
"/",
"%",
">>",
"<<",
">>>",
"<",
">",
"<=",
">=",
"==",
"===",
"!=",
"!==",
"?",
"=",
"+=",
"-=",
"/=",
"*=",
"%=",
">>=",
"<<=",
">>>=",
"|=",
"^=",
"&=",
"&&",
"||"
]);
var WHITESPACE_CHARS = makePredicate(characters(" \u00a0\n\r\t\f\u000b\u200b\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000"));
var PUNC_BEFORE_EXPRESSION = makePredicate(characters("[{(,.;:"));
var PUNC_CHARS = makePredicate(characters("[]{}(),;:"));
var REGEXP_MODIFIERS = makePredicate(characters("gmsiy"));
/* -----[ Tokenizer ]----- */
// regexps adapted from http://xregexp.com/plugins/#unicode
var UNICODE = {
letter: new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0523\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971\\u0972\\u097B-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D3D\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC\\u0EDD\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8B\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10D0-\\u10FA\\u10FC\\u1100-\\u1159\\u115F-\\u11A2\\u11A8-\\u11F9\\u1200-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u1676\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19A9\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u2094\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2C6F\\u2C71-\\u2C7D\\u2C80-\\u2CE4\\u2D00-\\u2D25\\u2D30-\\u2D65\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31B7\\u31F0-\\u31FF\\u3400\\u4DB5\\u4E00\\u9FC3\\uA000-\\uA48C\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA65F\\uA662-\\uA66E\\uA67F-\\uA697\\uA717-\\uA71F\\uA722-\\uA788\\uA78B\\uA78C\\uA7FB-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA90A-\\uA925\\uA930-\\uA946\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAC00\\uD7A3\\uF900-\\uFA2D\\uFA30-\\uFA6A\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),
non_spacing_mark: new RegExp("[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065E\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0900-\\u0902\\u093C\\u0941-\\u0948\\u094D\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09BC\\u09C1-\\u09C4\\u09CD\\u09E2\\u09E3\\u0A01\\u0A02\\u0A3C\\u0A41\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81\\u0A82\\u0ABC\\u0AC1-\\u0AC5\\u0AC7\\u0AC8\\u0ACD\\u0AE2\\u0AE3\\u0B01\\u0B3C\\u0B3F\\u0B41-\\u0B44\\u0B4D\\u0B56\\u0B62\\u0B63\\u0B82\\u0BC0\\u0BCD\\u0C3E-\\u0C40\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0CBC\\u0CBF\\u0CC6\\u0CCC\\u0CCD\\u0CE2\\u0CE3\\u0D41-\\u0D44\\u0D4D\\u0D62\\u0D63\\u0DCA\\u0DD2-\\u0DD4\\u0DD6\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F71-\\u0F7E\\u0F80-\\u0F84\\u0F86\\u0F87\\u0F90-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1030\\u1032-\\u1037\\u1039\\u103A\\u103D\\u103E\\u1058\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108D\\u109D\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B7-\\u17BD\\u17C6\\u17C9-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193B\\u1A17\\u1A18\\u1A56\\u1A58-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A6C\\u1A73-\\u1A7C\\u1A7F\\u1B00-\\u1B03\\u1B34\\u1B36-\\u1B3A\\u1B3C\\u1B42\\u1B6B-\\u1B73\\u1B80\\u1B81\\u1BA2-\\u1BA5\\u1BA8\\u1BA9\\u1C2C-\\u1C33\\u1C36\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE0\\u1CE2-\\u1CE8\\u1CED\\u1DC0-\\u1DE6\\u1DFD-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F\\uA67C\\uA67D\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA825\\uA826\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA951\\uA980-\\uA982\\uA9B3\\uA9B6-\\uA9B9\\uA9BC\\uAA29-\\uAA2E\\uAA31\\uAA32\\uAA35\\uAA36\\uAA43\\uAA4C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uABE5\\uABE8\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26]"),
space_combining_mark: new RegExp("[\\u0903\\u093E-\\u0940\\u0949-\\u094C\\u094E\\u0982\\u0983\\u09BE-\\u09C0\\u09C7\\u09C8\\u09CB\\u09CC\\u09D7\\u0A03\\u0A3E-\\u0A40\\u0A83\\u0ABE-\\u0AC0\\u0AC9\\u0ACB\\u0ACC\\u0B02\\u0B03\\u0B3E\\u0B40\\u0B47\\u0B48\\u0B4B\\u0B4C\\u0B57\\u0BBE\\u0BBF\\u0BC1\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCC\\u0BD7\\u0C01-\\u0C03\\u0C41-\\u0C44\\u0C82\\u0C83\\u0CBE\\u0CC0-\\u0CC4\\u0CC7\\u0CC8\\u0CCA\\u0CCB\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D40\\u0D46-\\u0D48\\u0D4A-\\u0D4C\\u0D57\\u0D82\\u0D83\\u0DCF-\\u0DD1\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0F3E\\u0F3F\\u0F7F\\u102B\\u102C\\u1031\\u1038\\u103B\\u103C\\u1056\\u1057\\u1062-\\u1064\\u1067-\\u106D\\u1083\\u1084\\u1087-\\u108C\\u108F\\u109A-\\u109C\\u17B6\\u17BE-\\u17C5\\u17C7\\u17C8\\u1923-\\u1926\\u1929-\\u192B\\u1930\\u1931\\u1933-\\u1938\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A19-\\u1A1B\\u1A55\\u1A57\\u1A61\\u1A63\\u1A64\\u1A6D-\\u1A72\\u1B04\\u1B35\\u1B3B\\u1B3D-\\u1B41\\u1B43\\u1B44\\u1B82\\u1BA1\\u1BA6\\u1BA7\\u1BAA\\u1C24-\\u1C2B\\u1C34\\u1C35\\u1CE1\\u1CF2\\uA823\\uA824\\uA827\\uA880\\uA881\\uA8B4-\\uA8C3\\uA952\\uA953\\uA983\\uA9B4\\uA9B5\\uA9BA\\uA9BB\\uA9BD-\\uA9C0\\uAA2F\\uAA30\\uAA33\\uAA34\\uAA4D\\uAA7B\\uABE3\\uABE4\\uABE6\\uABE7\\uABE9\\uABEA\\uABEC]"),
connector_punctuation: new RegExp("[\\u005F\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]")
};
function is_letter(code) {
return (code >= 97 && code <= 122)
|| (code >= 65 && code <= 90)
|| (code >= 0xaa && UNICODE.letter.test(String.fromCharCode(code)));
};
function is_digit(code) {
return code >= 48 && code <= 57; //XXX: find out if "UnicodeDigit" means something else than 0..9
};
function is_alphanumeric_char(code) {
return is_digit(code) || is_letter(code);
};
function is_unicode_combining_mark(ch) {
return UNICODE.non_spacing_mark.test(ch) || UNICODE.space_combining_mark.test(ch);
};
function is_unicode_connector_punctuation(ch) {
return UNICODE.connector_punctuation.test(ch);
};
function is_identifier(name) {
return !RESERVED_WORDS(name) && /^[a-z_$][a-z0-9_$]*$/i.test(name);
};
function is_identifier_start(code) {
return code == 36 || code == 95 || is_letter(code);
};
function is_identifier_char(ch) {
var code = ch.charCodeAt(0);
return is_identifier_start(code)
|| is_digit(code)
|| code == 8204 // \u200c: zero-width non-joiner <ZWNJ>
|| code == 8205 // \u200d: zero-width joiner <ZWJ> (in my ECMA-262 PDF, this is also 200c)
|| is_unicode_combining_mark(ch)
|| is_unicode_connector_punctuation(ch)
;
};
function is_identifier_string(str){
var i = str.length;
if (i == 0) return false;
if (!is_identifier_start(str.charCodeAt(0))) return false;
while (--i >= 0) {
if (!is_identifier_char(str.charAt(i)))
return false;
}
return true;
};
function parse_js_number(num) {
if (RE_HEX_NUMBER.test(num)) {
return parseInt(num.substr(2), 16);
} else if (RE_OCT_NUMBER.test(num)) {
return parseInt(num.substr(1), 8);
} else if (RE_DEC_NUMBER.test(num)) {
return parseFloat(num);
}
};
function JS_Parse_Error(message, line, col, pos) {
this.message = message;
this.line = line;
this.col = col;
this.pos = pos;
this.stack = new Error().stack;
};
JS_Parse_Error.prototype.toString = function() {
return this.message + " (line: " + this.line + ", col: " + this.col + ", pos: " + this.pos + ")" + "\n\n" + this.stack;
};
function js_error(message, filename, line, col, pos) {
throw new JS_Parse_Error(message, line, col, pos);
};
function is_token(token, type, val) {
return token.type == type && (val == null || token.value == val);
};
var EX_EOF = {};
function tokenizer($TEXT, filename, html5_comments) {
var S = {
text : $TEXT.replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/\uFEFF/g, ''),
filename : filename,
pos : 0,
tokpos : 0,
line : 1,
tokline : 0,
col : 0,
tokcol : 0,
newline_before : false,
regex_allowed : false,
comments_before : []
};
function peek() { return S.text.charAt(S.pos); };
function next(signal_eof, in_string) {
var ch = S.text.charAt(S.pos++);
if (signal_eof && !ch)
throw EX_EOF;
if (ch == "\n") {
S.newline_before = S.newline_before || !in_string;
++S.line;
S.col = 0;
} else {
++S.col;
}
return ch;
};
function forward(i) {
while (i-- > 0) next();
};
function looking_at(str) {
return S.text.substr(S.pos, str.length) == str;
};
function find(what, signal_eof) {
var pos = S.text.indexOf(what, S.pos);
if (signal_eof && pos == -1) throw EX_EOF;
return pos;
};
function start_token() {
S.tokline = S.line;
S.tokcol = S.col;
S.tokpos = S.pos;
};
var prev_was_dot = false;
function token(type, value, is_comment) {
S.regex_allowed = ((type == "operator" && !UNARY_POSTFIX(value)) ||
(type == "keyword" && KEYWORDS_BEFORE_EXPRESSION(value)) ||
(type == "punc" && PUNC_BEFORE_EXPRESSION(value)));
prev_was_dot = (type == "punc" && value == ".");
var ret = {
type : type,
value : value,
line : S.tokline,
col : S.tokcol,
pos : S.tokpos,
endpos : S.pos,
nlb : S.newline_before,
file : filename
};
if (!is_comment) {
ret.comments_before = S.comments_before;
S.comments_before = [];
// make note of any newlines in the comments that came before
for (var i = 0, len = ret.comments_before.length; i < len; i++) {
ret.nlb = ret.nlb || ret.comments_before[i].nlb;
}
}
S.newline_before = false;
return new AST_Token(ret);
};
function skip_whitespace() {
while (WHITESPACE_CHARS(peek()))
next();
};
function read_while(pred) {
var ret = "", ch, i = 0;
while ((ch = peek()) && pred(ch, i++))
ret += next();
return ret;
};
function parse_error(err) {
js_error(err, filename, S.tokline, S.tokcol, S.tokpos);
};
function read_num(prefix) {
var has_e = false, after_e = false, has_x = false, has_dot = prefix == ".";
var num = read_while(function(ch, i){
var code = ch.charCodeAt(0);
switch (code) {
case 120: case 88: // xX
return has_x ? false : (has_x = true);
case 101: case 69: // eE
return has_x ? true : has_e ? false : (has_e = after_e = true);
case 45: // -
return after_e || (i == 0 && !prefix);
case 43: // +
return after_e;
case (after_e = false, 46): // .
return (!has_dot && !has_x && !has_e) ? (has_dot = true) : false;
}
return is_alphanumeric_char(code);
});
if (prefix) num = prefix + num;
var valid = parse_js_number(num);
if (!isNaN(valid)) {
return token("num", valid);
} else {
parse_error("Invalid syntax: " + num);
}
};
function read_escaped_char(in_string) {
var ch = next(true, in_string);
switch (ch.charCodeAt(0)) {
case 110 : return "\n";
case 114 : return "\r";
case 116 : return "\t";
case 98 : return "\b";
case 118 : return "\u000b"; // \v
case 102 : return "\f";
case 48 : return "\0";
case 120 : return String.fromCharCode(hex_bytes(2)); // \x
case 117 : return String.fromCharCode(hex_bytes(4)); // \u
case 10 : return ""; // newline
default : return ch;
}
};
function hex_bytes(n) {
var num = 0;
for (; n > 0; --n) {
var digit = parseInt(next(true), 16);
if (isNaN(digit))
parse_error("Invalid hex-character pattern in string");
num = (num << 4) | digit;
}
return num;
};
var read_string = with_eof_error("Unterminated string constant", function(){
var quote = next(), ret = "";
for (;;) {
var ch = next(true);
if (ch == "\\") {
// read OctalEscapeSequence (XXX: deprecated if "strict mode")
// https://github.com/mishoo/UglifyJS/issues/178
var octal_len = 0, first = null;
ch = read_while(function(ch){
if (ch >= "0" && ch <= "7") {
if (!first) {
first = ch;
return ++octal_len;
}
else if (first <= "3" && octal_len <= 2) return ++octal_len;
else if (first >= "4" && octal_len <= 1) return ++octal_len;
}
return false;
});
if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8));
else ch = read_escaped_char(true);
}
else if (ch == quote) break;
ret += ch;
}
return token("string", ret);
});
function skip_line_comment(type) {
var regex_allowed = S.regex_allowed;
var i = find("\n"), ret;
if (i == -1) {
ret = S.text.substr(S.pos);
S.pos = S.text.length;
} else {
ret = S.text.substring(S.pos, i);
S.pos = i;
}
S.comments_before.push(token(type, ret, true));
S.regex_allowed = regex_allowed;
return next_token();
};
var skip_multiline_comment = with_eof_error("Unterminated multiline comment", function(){
var regex_allowed = S.regex_allowed;
var i = find("*/", true);
var text = S.text.substring(S.pos, i);
var a = text.split("\n"), n = a.length;
// update stream position
S.pos = i + 2;
S.line += n - 1;
if (n > 1) S.col = a[n - 1].length;
else S.col += a[n - 1].length;
S.col += 2;
var nlb = S.newline_before = S.newline_before || text.indexOf("\n") >= 0;
S.comments_before.push(token("comment2", text, true));
S.regex_allowed = regex_allowed;
S.newline_before = nlb;
return next_token();
});
function read_name() {
var backslash = false, name = "", ch, escaped = false, hex;
while ((ch = peek()) != null) {
if (!backslash) {
if (ch == "\\") escaped = backslash = true, next();
else if (is_identifier_char(ch)) name += next();
else break;
}
else {
if (ch != "u") parse_error("Expecting UnicodeEscapeSequence -- uXXXX");
ch = read_escaped_char();
if (!is_identifier_char(ch)) parse_error("Unicode char: " + ch.charCodeAt(0) + " is not valid in identifier");
name += ch;
backslash = false;
}
}
if (KEYWORDS(name) && escaped) {
hex = name.charCodeAt(0).toString(16).toUpperCase();
name = "\\u" + "0000".substr(hex.length) + hex + name.slice(1);
}
return name;
};
var read_regexp = with_eof_error("Unterminated regular expression", function(regexp){
var prev_backslash = false, ch, in_class = false;
while ((ch = next(true))) if (prev_backslash) {
regexp += "\\" + ch;
prev_backslash = false;
} else if (ch == "[") {
in_class = true;
regexp += ch;
} else if (ch == "]" && in_class) {
in_class = false;
regexp += ch;
} else if (ch == "/" && !in_class) {
break;
} else if (ch == "\\") {
prev_backslash = true;
} else {
regexp += ch;
}
var mods = read_name();
return token("regexp", new RegExp(regexp, mods));
});
function read_operator(prefix) {
function grow(op) {
if (!peek()) return op;
var bigger = op + peek();
if (OPERATORS(bigger)) {
next();
return grow(bigger);
} else {
return op;
}
};
return token("operator", grow(prefix || next()));
};
function handle_slash() {
next();
switch (peek()) {
case "/":
next();
return skip_line_comment("comment1");
case "*":
next();
return skip_multiline_comment();
}
return S.regex_allowed ? read_regexp("") : read_operator("/");
};
function handle_dot() {
next();
return is_digit(peek().charCodeAt(0))
? read_num(".")
: token("punc", ".");
};
function read_word() {
var word = read_name();
if (prev_was_dot) return token("name", word);
return KEYWORDS_ATOM(word) ? token("atom", word)
: !KEYWORDS(word) ? token("name", word)
: OPERATORS(word) ? token("operator", word)
: token("keyword", word);
};
function with_eof_error(eof_error, cont) {
return function(x) {
try {
return cont(x);
} catch(ex) {
if (ex === EX_EOF) parse_error(eof_error);
else throw ex;
}
};
};
function next_token(force_regexp) {
if (force_regexp != null)
return read_regexp(force_regexp);
skip_whitespace();
start_token();
if (html5_comments) {
if (looking_at("<!--")) {
forward(4);
return skip_line_comment("comment3");
}
if (looking_at("-->") && S.newline_before) {
forward(3);
return skip_line_comment("comment4");
}
}
var ch = peek();
if (!ch) return token("eof");
var code = ch.charCodeAt(0);
switch (code) {
case 34: case 39: return read_string();
case 46: return handle_dot();
case 47: return handle_slash();
}
if (is_digit(code)) return read_num();
if (PUNC_CHARS(ch)) return token("punc", next());
if (OPERATOR_CHARS(ch)) return read_operator();
if (code == 92 || is_identifier_start(code)) return read_word();
parse_error("Unexpected character '" + ch + "'");
};
next_token.context = function(nc) {
if (nc) S = nc;
return S;
};
return next_token;
};
/* -----[ Parser (constants) ]----- */
var UNARY_PREFIX = makePredicate([
"typeof",
"void",
"delete",
"--",
"++",
"!",
"~",
"-",
"+"
]);
var UNARY_POSTFIX = makePredicate([ "--", "++" ]);
var ASSIGNMENT = makePredicate([ "=", "+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=" ]);
var PRECEDENCE = (function(a, ret){
for (var i = 0; i < a.length; ++i) {
var b = a[i];
for (var j = 0; j < b.length; ++j) {
ret[b[j]] = i + 1;
}
}
return ret;
})(
[
["||"],
["&&"],
["|"],
["^"],
["&"],
["==", "===", "!=", "!=="],
["<", ">", "<=", ">=", "in", "instanceof"],
[">>", "<<", ">>>"],
["+", "-"],
["*", "/", "%"]
],
{}
);
var STATEMENTS_WITH_LABELS = array_to_hash([ "for", "do", "while", "switch" ]);
var ATOMIC_START_TOKEN = array_to_hash([ "atom", "num", "string", "regexp", "name" ]);
/* -----[ Parser ]----- */
function parse($TEXT, options) {
options = defaults(options, {
strict : false,
filename : null,
toplevel : null,
expression : false,
html5_comments : true,
});
var S = {
input : (typeof $TEXT == "string"
? tokenizer($TEXT, options.filename,
options.html5_comments)
: $TEXT),
token : null,
prev : null,
peeked : null,
in_function : 0,
in_directives : true,
in_loop : 0,
labels : []
};
S.token = next();
function is(type, value) {
return is_token(S.token, type, value);
};
function peek() { return S.peeked || (S.peeked = S.input()); };
function next() {
S.prev = S.token;
if (S.peeked) {
S.token = S.peeked;
S.peeked = null;
} else {
S.token = S.input();
}
S.in_directives = S.in_directives && (
S.token.type == "string" || is("punc", ";")
);
return S.token;
};
function prev() {
return S.prev;
};
function croak(msg, line, col, pos) {
var ctx = S.input.context();
js_error(msg,
ctx.filename,
line != null ? line : ctx.tokline,
col != null ? col : ctx.tokcol,
pos != null ? pos : ctx.tokpos);
};
function token_error(token, msg) {
croak(msg, token.line, token.col);
};
function unexpected(token) {
if (token == null)
token = S.token;
token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")");
};
function expect_token(type, val) {
if (is(type, val)) {
return next();
}
token_error(S.token, "Unexpected token " + S.token.type + " «" + S.token.value + "»" + ", expected " + type + " «" + val + "»");
};
function expect(punc) { return expect_token("punc", punc); };
function can_insert_semicolon() {
return !options.strict && (
S.token.nlb || is("eof") || is("punc", "}")
);
};
function semicolon() {
if (is("punc", ";")) next();
else if (!can_insert_semicolon()) unexpected();
};
function parenthesised() {
expect("(");
var exp = expression(true);
expect(")");
return exp;
};
function embed_tokens(parser) {
return function() {
var start = S.token;
var expr = parser();
var end = prev();
expr.start = start;
expr.end = end;
return expr;
};
};
function handle_regexp() {
if (is("operator", "/") || is("operator", "/=")) {
S.peeked = null;
S.token = S.input(S.token.value.substr(1)); // force regexp
}
};
var statement = embed_tokens(function() {
var tmp;
handle_regexp();
switch (S.token.type) {
case "string":
var dir = S.in_directives, stat = simple_statement();
// XXXv2: decide how to fix directives
if (dir && stat.body instanceof AST_String && !is("punc", ","))
return new AST_Directive({ value: stat.body.value });
return stat;
case "num":
case "regexp":
case "operator":
case "atom":
return simple_statement();
case "name":
return is_token(peek(), "punc", ":")
? labeled_statement()
: simple_statement();
case "punc":
switch (S.token.value) {
case "{":
return new AST_BlockStatement({
start : S.token,
body : block_(),
end : prev()
});
case "[":
case "(":
return simple_statement();
case ";":
next();
return new AST_EmptyStatement();
default:
unexpected();
}
case "keyword":
switch (tmp = S.token.value, next(), tmp) {
case "break":
return break_cont(AST_Break);
case "continue":
return break_cont(AST_Continue);
case "debugger":
semicolon();
return new AST_Debugger();
case "do":
return new AST_Do({
body : in_loop(statement),
condition : (expect_token("keyword", "while"), tmp = parenthesised(), semicolon(), tmp)
});
case "while":
return new AST_While({
condition : parenthesised(),
body : in_loop(statement)
});
case "for":
return for_();
case "function":
return function_(AST_Defun);
case "if":
return if_();
case "return":
if (S.in_function == 0)
croak("'return' outside of function");
return new AST_Return({
value: ( is("punc", ";")
? (next(), null)
: can_insert_semicolon()
? null
: (tmp = expression(true), semicolon(), tmp) )
});
case "switch":
return new AST_Switch({
expression : parenthesised(),
body : in_loop(switch_body_)
});
case "throw":
if (S.token.nlb)
croak("Illegal newline after 'throw'");
return new AST_Throw({
value: (tmp = expression(true), semicolon(), tmp)
});
case "try":
return try_();
case "var":
return tmp = var_(), semicolon(), tmp;
case "const":
return tmp = const_(), semicolon(), tmp;
case "with":
return new AST_With({
expression : parenthesised(),
body : statement()
});
default:
unexpected();
}
}
});
function labeled_statement() {
var label = as_symbol(AST_Label);
if (find_if(function(l){ return l.name == label.name }, S.labels)) {
// ECMA-262, 12.12: An ECMAScript program is considered
// syntactically incorrect if it contains a
// LabelledStatement that is enclosed by a
// LabelledStatement with the same Identifier as label.
croak("Label " + label.name + " defined twice");
}
expect(":");
S.labels.push(label);
var stat = statement();
S.labels.pop();
if (!(stat instanceof AST_IterationStatement)) {
// check for `continue` that refers to this label.
// those should be reported as syntax errors.
// https://github.com/mishoo/UglifyJS2/issues/287
label.references.forEach(function(ref){
if (ref instanceof AST_Continue) {
ref = ref.label.start;
croak("Continue label `" + label.name + "` refers to non-IterationStatement.",
ref.line, ref.col, ref.pos);
}
});
}
return new AST_LabeledStatement({ body: stat, label: label });
};
function simple_statement(tmp) {
return new AST_SimpleStatement({ body: (tmp = expression(true), semicolon(), tmp) });
};
function break_cont(type) {
var label = null, ldef;
if (!can_insert_semicolon()) {
label = as_symbol(AST_LabelRef, true);
}
if (label != null) {
ldef = find_if(function(l){ return l.name == label.name }, S.labels);
if (!ldef)
croak("Undefined label " + label.name);
label.thedef = ldef;
}
else if (S.in_loop == 0)
croak(type.TYPE + " not inside a loop or switch");
semicolon();
var stat = new type({ label: label });
if (ldef) ldef.references.push(stat);
return stat;
};
function for_() {
expect("(");
var init = null;
if (!is("punc", ";")) {
init = is("keyword", "var")
? (next(), var_(true))
: expression(true, true);
if (is("operator", "in")) {
if (init instanceof AST_Var && init.definitions.length > 1)
croak("Only one variable declaration allowed in for..in loop");
next();
return for_in(init);
}
}
return regular_for(init);
};
function regular_for(init) {
expect(";");
var test = is("punc", ";") ? null : expression(true);
expect(";");
var step = is("punc", ")") ? null : expression(true);
expect(")");
return new AST_For({
init : init,
condition : test,
step : step,
body : in_loop(statement)
});
};
function for_in(init) {
var lhs = init instanceof AST_Var ? init.definitions[0].name : null;
var obj = expression(true);
expect(")");
return new AST_ForIn({
init : init,
name : lhs,
object : obj,
body : in_loop(statement)
});
};
var function_ = function(ctor) {
var in_statement = ctor === AST_Defun;
var name = is("name") ? as_symbol(in_statement ? AST_SymbolDefun : AST_SymbolLambda) : null;
if (in_statement && !name)
unexpected();
expect("(");
return new ctor({
name: name,
argnames: (function(first, a){
while (!is("punc", ")")) {
if (first) first = false; else expect(",");
a.push(as_symbol(AST_SymbolFunarg));
}
next();
return a;
})(true, []),
body: (function(loop, labels){
++S.in_function;
S.in_directives = true;
S.in_loop = 0;
S.labels = [];
var a = block_();
--S.in_function;
S.in_loop = loop;
S.labels = labels;
return a;
})(S.in_loop, S.labels)
});
};
function if_() {
var cond = parenthesised(), body = statement(), belse = null;
if (is("keyword", "else")) {
next();
belse = statement();
}
return new AST_If({
condition : cond,
body : body,
alternative : belse
});
};
function block_() {
expect("{");
var a = [];
while (!is("punc", "}")) {
if (is("eof")) unexpected();
a.push(statement());
}
next();
return a;
};
function switch_body_() {
expect("{");
var a = [], cur = null, branch = null, tmp;
while (!is("punc", "}")) {
if (is("eof")) unexpected();
if (is("keyword", "case")) {
if (branch) branch.end = prev();
cur = [];
branch = new AST_Case({
start : (tmp = S.token, next(), tmp),
expression : expression(true),
body : cur
});
a.push(branch);
expect(":");
}
else if (is("keyword", "default")) {
if (branch) branch.end = prev();
cur = [];
branch = new AST_Default({
start : (tmp = S.token, next(), expect(":"), tmp),
body : cur
});
a.push(branch);
}
else {
if (!cur) unexpected();
cur.push(statement());
}
}
if (branch) branch.end = prev();
next();
return a;
};
function try_() {
var body = block_(), bcatch = null, bfinally = null;
if (is("keyword", "catch")) {
var start = S.token;
next();
expect("(");
var name = as_symbol(AST_SymbolCatch);
expect(")");
bcatch = new AST_Catch({
start : start,
argname : name,
body : block_(),
end : prev()
});
}
if (is("keyword", "finally")) {
var start = S.token;
next();
bfinally = new AST_Finally({
start : start,
body : block_(),
end : prev()
});
}
if (!bcatch && !bfinally)
croak("Missing catch/finally blocks");
return new AST_Try({
body : body,
bcatch : bcatch,
bfinally : bfinally
});
};
function vardefs(no_in, in_const) {
var a = [];
for (;;) {
a.push(new AST_VarDef({
start : S.token,
name : as_symbol(in_const ? AST_SymbolConst : AST_SymbolVar),
value : is("operator", "=") ? (next(), expression(false, no_in)) : null,
end : prev()
}));
if (!is("punc", ","))
break;
next();
}
return a;
};
var var_ = function(no_in) {
return new AST_Var({
start : prev(),
definitions : vardefs(no_in, false),
end : prev()
});
};
var const_ = function() {
return new AST_Const({
start : prev(),
definitions : vardefs(false, true),
end : prev()
});
};
var new_ = function() {
var start = S.token;
expect_token("operator", "new");
var newexp = expr_atom(false), args;
if (is("punc", "(")) {
next();
args = expr_list(")");
} else {
args = [];
}
return subscripts(new AST_New({
start : start,
expression : newexp,
args : args,
end : prev()
}), true);
};
function as_atom_node() {
var tok = S.token, ret;
switch (tok.type) {
case "name":
case "keyword":
ret = _make_symbol(AST_SymbolRef);
break;
case "num":
ret = new AST_Number({ start: tok, end: tok, value: tok.value });
break;
case "string":
ret = new AST_String({ start: tok, end: tok, value: tok.value });
break;
case "regexp":
ret = new AST_RegExp({ start: tok, end: tok, value: tok.value });
break;
case "atom":
switch (tok.value) {
case "false":
ret = new AST_False({ start: tok, end: tok });
break;
case "true":
ret = new AST_True({ start: tok, end: tok });
break;
case "null":
ret = new AST_Null({ start: tok, end: tok });
break;
}
break;
}
next();
return ret;
};
var expr_atom = function(allow_calls) {
if (is("operator", "new")) {
return new_();
}
var start = S.token;
if (is("punc")) {
switch (start.value) {
case "(":
next();
var ex = expression(true);
ex.start = start;
ex.end = S.token;
expect(")");
return subscripts(ex, allow_calls);
case "[":
return subscripts(array_(), allow_calls);
case "{":
return subscripts(object_(), allow_calls);
}
unexpected();
}
if (is("keyword", "function")) {
next();
var func = function_(AST_Function);
func.start = start;
func.end = prev();
return subscripts(func, allow_calls);
}
if (ATOMIC_START_TOKEN[S.token.type]) {
return subscripts(as_atom_node(), allow_calls);
}
unexpected();
};
function expr_list(closing, allow_trailing_comma, allow_empty) {
var first = true, a = [];
while (!is("punc", closing)) {
if (first) first = false; else expect(",");
if (allow_trailing_comma && is("punc", closing)) break;
if (is("punc", ",") && allow_empty) {
a.push(new AST_Hole({ start: S.token, end: S.token }));
} else {
a.push(expression(false));
}
}
next();
return a;
};
var array_ = embed_tokens(function() {
expect("[");
return new AST_Array({
elements: expr_list("]", !options.strict, true)
});
});
var object_ = embed_tokens(function() {
expect("{");
var first = true, a = [];
while (!is("punc", "}")) {
if (first) first = false; else expect(",");
if (!options.strict && is("punc", "}"))
// allow trailing comma
break;
var start = S.token;
var type = start.type;
var name = as_property_name();
if (type == "name" && !is("punc", ":")) {
if (name == "get") {
a.push(new AST_ObjectGetter({
start : start,
key : as_atom_node(),
value : function_(AST_Accessor),
end : prev()
}));
continue;
}
if (name == "set") {
a.push(new AST_ObjectSetter({
start : start,
key : as_atom_node(),
value : function_(AST_Accessor),
end : prev()
}));
continue;
}
}
expect(":");
a.push(new AST_ObjectKeyVal({
start : start,
key : name,
value : expression(false),
end : prev()
}));
}
next();
return new AST_Object({ properties: a });
});
function as_property_name() {
var tmp = S.token;
next();
switch (tmp.type) {
case "num":
case "string":
case "name":
case "operator":
case "keyword":
case "atom":
return tmp.value;
default:
unexpected();
}
};
function as_name() {
var tmp = S.token;
next();
switch (tmp.type) {
case "name":
case "operator":
case "keyword":
case "atom":
return tmp.value;
default:
unexpected();
}
};
function _make_symbol(type) {
var name = S.token.value;
return new (name == "this" ? AST_This : type)({
name : String(name),
start : S.token,
end : S.token
});
};
function as_symbol(type, noerror) {
if (!is("name")) {
if (!noerror) croak("Name expected");
return null;
}
var sym = _make_symbol(type);
next();
return sym;
};
var subscripts = function(expr, allow_calls) {
var start = expr.start;
if (is("punc", ".")) {
next();
return subscripts(new AST_Dot({
start : start,
expression : expr,
property : as_name(),
end : prev()
}), allow_calls);
}
if (is("punc", "[")) {
next();
var prop = expression(true);
expect("]");
return subscripts(new AST_Sub({
start : start,
expression : expr,
property : prop,
end : prev()
}), allow_calls);
}
if (allow_calls && is("punc", "(")) {
next();
return subscripts(new AST_Call({
start : start,
expression : expr,
args : expr_list(")"),
end : prev()
}), true);
}
return expr;
};
var maybe_unary = function(allow_calls) {
var start = S.token;
if (is("operator") && UNARY_PREFIX(start.value)) {
next();
handle_regexp();
var ex = make_unary(AST_UnaryPrefix, start.value, maybe_unary(allow_calls));
ex.start = start;
ex.end = prev();
return ex;
}
var val = expr_atom(allow_calls);
while (is("operator") && UNARY_POSTFIX(S.token.value) && !S.token.nlb) {
val = make_unary(AST_UnaryPostfix, S.token.value, val);
val.start = start;
val.end = S.token;
next();
}
return val;
};
function make_unary(ctor, op, expr) {
if ((op == "++" || op == "--") && !is_assignable(expr))
croak("Invalid use of " + op + " operator");
return new ctor({ operator: op, expression: expr });
};
var expr_op = function(left, min_prec, no_in) {
var op = is("operator") ? S.token.value : null;
if (op == "in" && no_in) op = null;
var prec = op != null ? PRECEDENCE[op] : null;
if (prec != null && prec > min_prec) {
next();
var right = expr_op(maybe_unary(true), prec, no_in);
return expr_op(new AST_Binary({
start : left.start,
left : left,
operator : op,
right : right,
end : right.end
}), min_prec, no_in);
}
return left;
};
function expr_ops(no_in) {
return expr_op(maybe_unary(true), 0, no_in);
};
var maybe_conditional = function(no_in) {
var start = S.token;
var expr = expr_ops(no_in);
if (is("operator", "?")) {
next();
var yes = expression(false);
expect(":");
return new AST_Conditional({
start : start,
condition : expr,
consequent : yes,
alternative : expression(false, no_in),
end : peek()
});
}
return expr;
};
function is_assignable(expr) {
if (!options.strict) return true;
if (expr instanceof AST_This) return false;
return (expr instanceof AST_PropAccess || expr instanceof AST_Symbol);
};
var maybe_assign = function(no_in) {
var start = S.token;
var left = maybe_conditional(no_in), val = S.token.value;
if (is("operator") && ASSIGNMENT(val)) {
if (is_assignable(left)) {
next();
return new AST_Assign({
start : start,
left : left,
operator : val,
right : maybe_assign(no_in),
end : prev()
});
}
croak("Invalid assignment");
}
return left;
};
var expression = function(commas, no_in) {
var start = S.token;
var expr = maybe_assign(no_in);
if (commas && is("punc", ",")) {
next();
return new AST_Seq({
start : start,
car : expr,
cdr : expression(true, no_in),
end : peek()
});
}
return expr;
};
function in_loop(cont) {
++S.in_loop;
var ret = cont();
--S.in_loop;
return ret;
};
if (options.expression) {
return expression(true);
}
return (function(){
var start = S.token;
var body = [];
while (!is("eof"))
body.push(statement());
var end = prev();
var toplevel = options.toplevel;
if (toplevel) {
toplevel.body = toplevel.body.concat(body);
toplevel.end = end;
} else {
toplevel = new AST_Toplevel({ start: start, body: body, end: end });
}
return toplevel;
})();
};
/***********************************************************************
A JavaScript tokenizer / parser / beautifier / compressor.
https://github.com/mishoo/UglifyJS2
-------------------------------- (C) ---------------------------------
Author: Mihai Bazon
<mihai.bazon@gmail.com>
http://mihai.bazon.net/blog
Distributed under the BSD license:
Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***********************************************************************/
"use strict";
// Tree transformer helpers.
function TreeTransformer(before, after) {
TreeWalker.call(this);
this.before = before;
this.after = after;
}
TreeTransformer.prototype = new TreeWalker;
(function(undefined){
function _(node, descend) {
node.DEFMETHOD("transform", function(tw, in_list){
var x, y;
tw.push(this);
if (tw.before) x = tw.before(this, descend, in_list);
if (x === undefined) {
if (!tw.after) {
x = this;
descend(x, tw);
} else {
tw.stack[tw.stack.length - 1] = x = this.clone();
descend(x, tw);
y = tw.after(x, in_list);
if (y !== undefined) x = y;
}
}
tw.pop();
return x;
});
};
function do_list(list, tw) {
return MAP(list, function(node){
return node.transform(tw, true);
});
};
_(AST_Node, noop);
_(AST_LabeledStatement, function(self, tw){
self.label = self.label.transform(tw);
self.body = self.body.transform(tw);
});
_(AST_SimpleStatement, function(self, tw){
self.body = self.body.transform(tw);
});
_(AST_Block, function(self, tw){
self.body = do_list(self.body, tw);
});
_(AST_DWLoop, function(self, tw){
self.condition = self.condition.transform(tw);
self.body = self.body.transform(tw);
});
_(AST_For, function(self, tw){
if (self.init) self.init = self.init.transform(tw);
if (self.condition) self.condition = self.condition.transform(tw);
if (self.step) self.step = self.step.transform(tw);
self.body = self.body.transform(tw);
});
_(AST_ForIn, function(self, tw){
self.init = self.init.transform(tw);
self.object = self.object.transform(tw);
self.body = self.body.transform(tw);
});
_(AST_With, function(self, tw){
self.expression = self.expression.transform(tw);
self.body = self.body.transform(tw);
});
_(AST_Exit, function(self, tw){
if (self.value) self.value = self.value.transform(tw);
});
_(AST_LoopControl, function(self, tw){
if (self.label) self.label = self.label.transform(tw);
});
_(AST_If, function(self, tw){
self.condition = self.condition.transform(tw);
self.body = self.body.transform(tw);
if (self.alternative) self.alternative = self.alternative.transform(tw);
});
_(AST_Switch, function(self, tw){
self.expression = self.expression.transform(tw);
self.body = do_list(self.body, tw);
});
_(AST_Case, function(self, tw){
self.expression = self.expression.transform(tw);
self.body = do_list(self.body, tw);
});
_(AST_Try, function(self, tw){
self.body = do_list(self.body, tw);
if (self.bcatch) self.bcatch = self.bcatch.transform(tw);
if (self.bfinally) self.bfinally = self.bfinally.transform(tw);
});
_(AST_Catch, function(self, tw){
self.argname = self.argname.transform(tw);
self.body = do_list(self.body, tw);
});
_(AST_Definitions, function(self, tw){
self.definitions = do_list(self.definitions, tw);
});
_(AST_VarDef, function(self, tw){
self.name = self.name.transform(tw);
if (self.value) self.value = self.value.transform(tw);
});
_(AST_Lambda, function(self, tw){
if (self.name) self.name = self.name.transform(tw);
self.argnames = do_list(self.argnames, tw);
self.body = do_list(self.body, tw);
});
_(AST_Call, function(self, tw){
self.expression = self.expression.transform(tw);
self.args = do_list(self.args, tw);
});
_(AST_Seq, function(self, tw){
self.car = self.car.transform(tw);
self.cdr = self.cdr.transform(tw);
});
_(AST_Dot, function(self, tw){
self.expression = self.expression.transform(tw);
});
_(AST_Sub, function(self, tw){
self.expression = self.expression.transform(tw);
self.property = self.property.transform(tw);
});
_(AST_Unary, function(self, tw){
self.expression = self.expression.transform(tw);
});
_(AST_Binary, function(self, tw){
self.left = self.left.transform(tw);
self.right = self.right.transform(tw);
});
_(AST_Conditional, function(self, tw){
self.condition = self.condition.transform(tw);
self.consequent = self.consequent.transform(tw);
self.alternative = self.alternative.transform(tw);
});
_(AST_Array, function(self, tw){
self.elements = do_list(self.elements, tw);
});
_(AST_Object, function(self, tw){
self.properties = do_list(self.properties, tw);
});
_(AST_ObjectProperty, function(self, tw){
self.value = self.value.transform(tw);
});
})();
/***********************************************************************
A JavaScript tokenizer / parser / beautifier / compressor.
https://github.com/mishoo/UglifyJS2
-------------------------------- (C) ---------------------------------
Author: Mihai Bazon
<mihai.bazon@gmail.com>
http://mihai.bazon.net/blog
Distributed under the BSD license:
Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***********************************************************************/
"use strict";
function SymbolDef(scope, index, orig) {
this.name = orig.name;
this.orig = [ orig ];
this.scope = scope;
this.references = [];
this.global = false;
this.mangled_name = null;
this.undeclared = false;
this.constant = false;
this.index = index;
};
SymbolDef.prototype = {
unmangleable: function(options) {
return (this.global && !(options && options.toplevel))
|| this.undeclared
|| (!(options && options.eval) && (this.scope.uses_eval || this.scope.uses_with));
},
mangle: function(options) {
if (!this.mangled_name && !this.unmangleable(options)) {
var s = this.scope;
if (!options.screw_ie8 && this.orig[0] instanceof AST_SymbolLambda)
s = s.parent_scope;
this.mangled_name = s.next_mangled(options, this);
}
}
};
AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
options = defaults(options, {
screw_ie8: false
});
// pass 1: setup scope chaining and handle definitions
var self = this;
var scope = self.parent_scope = null;
var defun = null;
var nesting = 0;
var tw = new TreeWalker(function(node, descend){
if (options.screw_ie8 && node instanceof AST_Catch) {
var save_scope = scope;
scope = new AST_Scope(node);
scope.init_scope_vars(nesting);
scope.parent_scope = save_scope;
descend();
scope = save_scope;
return true;
}
if (node instanceof AST_Scope) {
node.init_scope_vars(nesting);
var save_scope = node.parent_scope = scope;
var save_defun = defun;
defun = scope = node;
++nesting; descend(); --nesting;
scope = save_scope;
defun = save_defun;
return true; // don't descend again in TreeWalker
}
if (node instanceof AST_Directive) {
node.scope = scope;
push_uniq(scope.directives, node.value);
return true;
}
if (node instanceof AST_With) {
for (var s = scope; s; s = s.parent_scope)
s.uses_with = true;
return;
}
if (node instanceof AST_Symbol) {
node.scope = scope;
}
if (node instanceof AST_SymbolLambda) {
defun.def_function(node);
}
else if (node instanceof AST_SymbolDefun) {
// Careful here, the scope where this should be defined is
// the parent scope. The reason is that we enter a new
// scope when we encounter the AST_Defun node (which is
// instanceof AST_Scope) but we get to the symbol a bit
// later.
(node.scope = defun.parent_scope).def_function(node);
}
else if (node instanceof AST_SymbolVar
|| node instanceof AST_SymbolConst) {
var def = defun.def_variable(node);
def.constant = node instanceof AST_SymbolConst;
def.init = tw.parent().value;
}
else if (node instanceof AST_SymbolCatch) {
(options.screw_ie8 ? scope : defun)
.def_variable(node);
}
});
self.walk(tw);
// pass 2: find back references and eval
var func = null;
var globals = self.globals = new Dictionary();
var tw = new TreeWalker(function(node, descend){
if (node instanceof AST_Lambda) {
var prev_func = func;
func = node;
descend();
func = prev_func;
return true;
}
if (node instanceof AST_SymbolRef) {
var name = node.name;
var sym = node.scope.find_variable(name);
if (!sym) {
var g;
if (globals.has(name)) {
g = globals.get(name);
} else {
g = new SymbolDef(self, globals.size(), node);
g.undeclared = true;
g.global = true;
globals.set(name, g);
}
node.thedef = g;
if (name == "eval" && tw.parent() instanceof AST_Call) {
for (var s = node.scope; s && !s.uses_eval; s = s.parent_scope)
s.uses_eval = true;
}
if (func && name == "arguments") {
func.uses_arguments = true;
}
} else {
node.thedef = sym;
}
node.reference();
return true;
}
});
self.walk(tw);
});
AST_Scope.DEFMETHOD("init_scope_vars", function(nesting){
this.directives = []; // contains the directives defined in this scope, i.e. "use strict"
this.variables = new Dictionary(); // map name to AST_SymbolVar (variables defined in this scope; includes functions)
this.functions = new Dictionary(); // map name to AST_SymbolDefun (functions defined in this scope)
this.uses_with = false; // will be set to true if this or some nested scope uses the `with` statement
this.uses_eval = false; // will be set to true if this or nested scope uses the global `eval`
this.parent_scope = null; // the parent scope
this.enclosed = []; // a list of variables from this or outer scope(s) that are referenced from this or inner scopes
this.cname = -1; // the current index for mangling functions/variables
this.nesting = nesting; // the nesting level of this scope (0 means toplevel)
});
AST_Scope.DEFMETHOD("strict", function(){
return this.has_directive("use strict");
});
AST_Lambda.DEFMETHOD("init_scope_vars", function(){
AST_Scope.prototype.init_scope_vars.apply(this, arguments);
this.uses_arguments = false;
});
AST_SymbolRef.DEFMETHOD("reference", function() {
var def = this.definition();
def.references.push(this);
var s = this.scope;
while (s) {
push_uniq(s.enclosed, def);
if (s === def.scope) break;
s = s.parent_scope;
}
this.frame = this.scope.nesting - def.scope.nesting;
});
AST_Scope.DEFMETHOD("find_variable", function(name){
if (name instanceof AST_Symbol) name = name.name;
return this.variables.get(name)
|| (this.parent_scope && this.parent_scope.find_variable(name));
});
AST_Scope.DEFMETHOD("has_directive", function(value){
return this.parent_scope && this.parent_scope.has_directive(value)
|| (this.directives.indexOf(value) >= 0 ? this : null);
});
AST_Scope.DEFMETHOD("def_function", function(symbol){
this.functions.set(symbol.name, this.def_variable(symbol));
});
AST_Scope.DEFMETHOD("def_variable", function(symbol){
var def;
if (!this.variables.has(symbol.name)) {
def = new SymbolDef(this, this.variables.size(), symbol);
this.variables.set(symbol.name, def);
def.global = !this.parent_scope;
} else {
def = this.variables.get(symbol.name);
def.orig.push(symbol);
}
return symbol.thedef = def;
});
AST_Scope.DEFMETHOD("next_mangled", function(options){
var ext = this.enclosed;
out: while (true) {
var m = base54(++this.cname);
if (!is_identifier(m)) continue; // skip over "do"
// https://github.com/mishoo/UglifyJS2/issues/242 -- do not
// shadow a name excepted from mangling.
if (options.except.indexOf(m) >= 0) continue;
// we must ensure that the mangled name does not shadow a name
// from some parent scope that is referenced in this or in
// inner scopes.
for (var i = ext.length; --i >= 0;) {
var sym = ext[i];
var name = sym.mangled_name || (sym.unmangleable(options) && sym.name);
if (m == name) continue out;
}
return m;
}
});
AST_Function.DEFMETHOD("next_mangled", function(options, def){
// #179, #326
// in Safari strict mode, something like (function x(x){...}) is a syntax error;
// a function expression's argument cannot shadow the function expression's name
var tricky_def = def.orig[0] instanceof AST_SymbolFunarg && this.name && this.name.definition();
while (true) {
var name = AST_Lambda.prototype.next_mangled.call(this, options, def);
if (!(tricky_def && tricky_def.mangled_name == name))
return name;
}
});
AST_Scope.DEFMETHOD("references", function(sym){
if (sym instanceof AST_Symbol) sym = sym.definition();
return this.enclosed.indexOf(sym) < 0 ? null : sym;
});
AST_Symbol.DEFMETHOD("unmangleable", function(options){
return this.definition().unmangleable(options);
});
// property accessors are not mangleable
AST_SymbolAccessor.DEFMETHOD("unmangleable", function(){
return true;
});
// labels are always mangleable
AST_Label.DEFMETHOD("unmangleable", function(){
return false;
});
AST_Symbol.DEFMETHOD("unreferenced", function(){
return this.definition().references.length == 0
&& !(this.scope.uses_eval || this.scope.uses_with);
});
AST_Symbol.DEFMETHOD("undeclared", function(){
return this.definition().undeclared;
});
AST_LabelRef.DEFMETHOD("undeclared", function(){
return false;
});
AST_Label.DEFMETHOD("undeclared", function(){
return false;
});
AST_Symbol.DEFMETHOD("definition", function(){
return this.thedef;
});
AST_Symbol.DEFMETHOD("global", function(){
return this.definition().global;
});
AST_Toplevel.DEFMETHOD("_default_mangler_options", function(options){
return defaults(options, {
except : [],
eval : false,
sort : false,
toplevel : false,
screw_ie8 : false
});
});
AST_Toplevel.DEFMETHOD("mangle_names", function(options){
options = this._default_mangler_options(options);
// We only need to mangle declaration nodes. Special logic wired
// into the code generator will display the mangled name if it's
// present (and for AST_SymbolRef-s it'll use the mangled name of
// the AST_SymbolDeclaration that it points to).
var lname = -1;
var to_mangle = [];
var tw = new TreeWalker(function(node, descend){
if (node instanceof AST_LabeledStatement) {
// lname is incremented when we get to the AST_Label
var save_nesting = lname;
descend();
lname = save_nesting;
return true; // don't descend again in TreeWalker
}
if (node instanceof AST_Scope) {
var p = tw.parent(), a = [];
node.variables.each(function(symbol){
if (options.except.indexOf(symbol.name) < 0) {
a.push(symbol);
}
});
if (options.sort) a.sort(function(a, b){
return b.references.length - a.references.length;
});
to_mangle.push.apply(to_mangle, a);
return;
}
if (node instanceof AST_Label) {
var name;
do name = base54(++lname); while (!is_identifier(name));
node.mangled_name = name;
return true;
}
});
this.walk(tw);
to_mangle.forEach(function(def){ def.mangle(options) });
});
AST_Toplevel.DEFMETHOD("compute_char_frequency", function(options){
options = this._default_mangler_options(options);
var tw = new TreeWalker(function(node){
if (node instanceof AST_Constant)
base54.consider(node.print_to_string());
else if (node instanceof AST_Return)
base54.consider("return");
else if (node instanceof AST_Throw)
base54.consider("throw");
else if (node instanceof AST_Continue)
base54.consider("continue");
else if (node instanceof AST_Break)
base54.consider("break");
else if (node instanceof AST_Debugger)
base54.consider("debugger");
else if (node instanceof AST_Directive)
base54.consider(node.value);
else if (node instanceof AST_While)
base54.consider("while");
else if (node instanceof AST_Do)
base54.consider("do while");
else if (node instanceof AST_If) {
base54.consider("if");
if (node.alternative) base54.consider("else");
}
else if (node instanceof AST_Var)
base54.consider("var");
else if (node instanceof AST_Const)
base54.consider("const");
else if (node instanceof AST_Lambda)
base54.consider("function");
else if (node instanceof AST_For)
base54.consider("for");
else if (node instanceof AST_ForIn)
base54.consider("for in");
else if (node instanceof AST_Switch)
base54.consider("switch");
else if (node instanceof AST_Case)
base54.consider("case");
else if (node instanceof AST_Default)
base54.consider("default");
else if (node instanceof AST_With)
base54.consider("with");
else if (node instanceof AST_ObjectSetter)
base54.consider("set" + node.key);
else if (node instanceof AST_ObjectGetter)
base54.consider("get" + node.key);
else if (node instanceof AST_ObjectKeyVal)
base54.consider(node.key);
else if (node instanceof AST_New)
base54.consider("new");
else if (node instanceof AST_This)
base54.consider("this");
else if (node instanceof AST_Try)
base54.consider("try");
else if (node instanceof AST_Catch)
base54.consider("catch");
else if (node instanceof AST_Finally)
base54.consider("finally");
else if (node instanceof AST_Symbol && node.unmangleable(options))
base54.consider(node.name);
else if (node instanceof AST_Unary || node instanceof AST_Binary)
base54.consider(node.operator);
else if (node instanceof AST_Dot)
base54.consider(node.property);
});
this.walk(tw);
base54.sort();
});
var base54 = (function() {
var string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_0123456789";
var chars, frequency;
function reset() {
frequency = Object.create(null);
chars = string.split("").map(function(ch){ return ch.charCodeAt(0) });
chars.forEach(function(ch){ frequency[ch] = 0 });
}
base54.consider = function(str){
for (var i = str.length; --i >= 0;) {
var code = str.charCodeAt(i);
if (code in frequency) ++frequency[code];
}
};
base54.sort = function() {
chars = mergeSort(chars, function(a, b){
if (is_digit(a) && !is_digit(b)) return 1;
if (is_digit(b) && !is_digit(a)) return -1;
return frequency[b] - frequency[a];
});
};
base54.reset = reset;
reset();
base54.get = function(){ return chars };
base54.freq = function(){ return frequency };
function base54(num) {
var ret = "", base = 54;
do {
ret += String.fromCharCode(chars[num % base]);
num = Math.floor(num / base);
base = 64;
} while (num > 0);
return ret;
};
return base54;
})();
AST_Toplevel.DEFMETHOD("scope_warnings", function(options){
options = defaults(options, {
undeclared : false, // this makes a lot of noise
unreferenced : true,
assign_to_global : true,
func_arguments : true,
nested_defuns : true,
eval : true
});
var tw = new TreeWalker(function(node){
if (options.undeclared
&& node instanceof AST_SymbolRef
&& node.undeclared())
{
// XXX: this also warns about JS standard names,
// i.e. Object, Array, parseInt etc. Should add a list of
// exceptions.
AST_Node.warn("Undeclared symbol: {name} [{file}:{line},{col}]", {
name: node.name,
file: node.start.file,
line: node.start.line,
col: node.start.col
});
}
if (options.assign_to_global)
{
var sym = null;
if (node instanceof AST_Assign && node.left instanceof AST_SymbolRef)
sym = node.left;
else if (node instanceof AST_ForIn && node.init instanceof AST_SymbolRef)
sym = node.init;
if (sym
&& (sym.undeclared()
|| (sym.global() && sym.scope !== sym.definition().scope))) {
AST_Node.warn("{msg}: {name} [{file}:{line},{col}]", {
msg: sym.undeclared() ? "Accidental global?" : "Assignment to global",
name: sym.name,
file: sym.start.file,
line: sym.start.line,
col: sym.start.col
});
}
}
if (options.eval
&& node instanceof AST_SymbolRef
&& node.undeclared()
&& node.name == "eval") {
AST_Node.warn("Eval is used [{file}:{line},{col}]", node.start);
}
if (options.unreferenced
&& (node instanceof AST_SymbolDeclaration || node instanceof AST_Label)
&& node.unreferenced()) {
AST_Node.warn("{type} {name} is declared but not referenced [{file}:{line},{col}]", {
type: node instanceof AST_Label ? "Label" : "Symbol",
name: node.name,
file: node.start.file,
line: node.start.line,
col: node.start.col
});
}
if (options.func_arguments
&& node instanceof AST_Lambda
&& node.uses_arguments) {
AST_Node.warn("arguments used in function {name} [{file}:{line},{col}]", {
name: node.name ? node.name.name : "anonymous",
file: node.start.file,
line: node.start.line,
col: node.start.col
});
}
if (options.nested_defuns
&& node instanceof AST_Defun
&& !(tw.parent() instanceof AST_Scope)) {
AST_Node.warn("Function {name} declared in nested statement \"{type}\" [{file}:{line},{col}]", {
name: node.name.name,
type: tw.parent().TYPE,
file: node.start.file,
line: node.start.line,
col: node.start.col
});
}
});
this.walk(tw);
});
/***********************************************************************
A JavaScript tokenizer / parser / beautifier / compressor.
https://github.com/mishoo/UglifyJS2
-------------------------------- (C) ---------------------------------
Author: Mihai Bazon
<mihai.bazon@gmail.com>
http://mihai.bazon.net/blog
Distributed under the BSD license:
Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***********************************************************************/
"use strict";
function OutputStream(options) {
options = defaults(options, {
indent_start : 0,
indent_level : 4,
quote_keys : false,
space_colon : true,
ascii_only : false,
inline_script : false,
width : 80,
max_line_len : 32000,
beautify : false,
source_map : null,
bracketize : false,
semicolons : true,
comments : false,
preserve_line : false,
screw_ie8 : false,
preamble : null,
}, true);
var indentation = 0;
var current_col = 0;
var current_line = 1;
var current_pos = 0;
var OUTPUT = "";
function to_ascii(str, identifier) {
return str.replace(/[\u0080-\uffff]/g, function(ch) {
var code = ch.charCodeAt(0).toString(16);
if (code.length <= 2 && !identifier) {
while (code.length < 2) code = "0" + code;
return "\\x" + code;
} else {
while (code.length < 4) code = "0" + code;
return "\\u" + code;
}
});
};
function make_string(str) {
var dq = 0, sq = 0;
str = str.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029\0]/g, function(s){
switch (s) {
case "\\": return "\\\\";
case "\b": return "\\b";
case "\f": return "\\f";
case "\n": return "\\n";
case "\r": return "\\r";
case "\u2028": return "\\u2028";
case "\u2029": return "\\u2029";
case '"': ++dq; return '"';
case "'": ++sq; return "'";
case "\0": return "\\x00";
}
return s;
});
if (options.ascii_only) str = to_ascii(str);
if (dq > sq) return "'" + str.replace(/\x27/g, "\\'") + "'";
else return '"' + str.replace(/\x22/g, '\\"') + '"';
};
function encode_string(str) {
var ret = make_string(str);
if (options.inline_script)
ret = ret.replace(/<\x2fscript([>\/\t\n\f\r ])/gi, "<\\/script$1");
return ret;
};
function make_name(name) {
name = name.toString();
if (options.ascii_only)
name = to_ascii(name, true);
return name;
};
function make_indent(back) {
return repeat_string(" ", options.indent_start + indentation - back * options.indent_level);
};
/* -----[ beautification/minification ]----- */
var might_need_space = false;
var might_need_semicolon = false;
var last = null;
function last_char() {
return last.charAt(last.length - 1);
};
function maybe_newline() {
if (options.max_line_len && current_col > options.max_line_len)
print("\n");
};
var requireSemicolonChars = makePredicate("( [ + * / - , .");
function print(str) {
str = String(str);
var ch = str.charAt(0);
if (might_need_semicolon) {
if ((!ch || ";}".indexOf(ch) < 0) && !/[;]$/.test(last)) {
if (options.semicolons || requireSemicolonChars(ch)) {
OUTPUT += ";";
current_col++;
current_pos++;
} else {
OUTPUT += "\n";
current_pos++;
current_line++;
current_col = 0;
}
if (!options.beautify)
might_need_space = false;
}
might_need_semicolon = false;
maybe_newline();
}
if (!options.beautify && options.preserve_line && stack[stack.length - 1]) {
var target_line = stack[stack.length - 1].start.line;
while (current_line < target_line) {
OUTPUT += "\n";
current_pos++;
current_line++;
current_col = 0;
might_need_space = false;
}
}
if (might_need_space) {
var prev = last_char();
if ((is_identifier_char(prev)
&& (is_identifier_char(ch) || ch == "\\"))
|| (/^[\+\-\/]$/.test(ch) && ch == prev))
{
OUTPUT += " ";
current_col++;
current_pos++;
}
might_need_space = false;
}
var a = str.split(/\r?\n/), n = a.length - 1;
current_line += n;
if (n == 0) {
current_col += a[n].length;
} else {
current_col = a[n].length;
}
current_pos += str.length;
last = str;
OUTPUT += str;
};
var space = options.beautify ? function() {
print(" ");
} : function() {
might_need_space = true;
};
var indent = options.beautify ? function(half) {
if (options.beautify) {
print(make_indent(half ? 0.5 : 0));
}
} : noop;
var with_indent = options.beautify ? function(col, cont) {
if (col === true) col = next_indent();
var save_indentation = indentation;
indentation = col;
var ret = cont();
indentation = save_indentation;
return ret;
} : function(col, cont) { return cont() };
var newline = options.beautify ? function() {
print("\n");
} : noop;
var semicolon = options.beautify ? function() {
print(";");
} : function() {
might_need_semicolon = true;
};
function force_semicolon() {
might_need_semicolon = false;
print(";");
};
function next_indent() {
return indentation + options.indent_level;
};
function with_block(cont) {
var ret;
print("{");
newline();
with_indent(next_indent(), function(){
ret = cont();
});
indent();
print("}");
return ret;
};
function with_parens(cont) {
print("(");
//XXX: still nice to have that for argument lists
//var ret = with_indent(current_col, cont);
var ret = cont();
print(")");
return ret;
};
function with_square(cont) {
print("[");
//var ret = with_indent(current_col, cont);
var ret = cont();
print("]");
return ret;
};
function comma() {
print(",");
space();
};
function colon() {
print(":");
if (options.space_colon) space();
};
var add_mapping = options.source_map ? function(token, name) {
try {
if (token) options.source_map.add(
token.file || "?",
current_line, current_col,
token.line, token.col,
(!name && token.type == "name") ? token.value : name
);
} catch(ex) {
AST_Node.warn("Couldn't figure out mapping for {file}:{line},{col} → {cline},{ccol} [{name}]", {
file: token.file,
line: token.line,
col: token.col,
cline: current_line,
ccol: current_col,
name: name || ""
})
}
} : noop;
function get() {
return OUTPUT;
};
if (options.preamble) {
print(options.preamble.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g, "\n"));
}
var stack = [];
return {
get : get,
toString : get,
indent : indent,
indentation : function() { return indentation },
current_width : function() { return current_col - indentation },
should_break : function() { return options.width && this.current_width() >= options.width },
newline : newline,
print : print,
space : space,
comma : comma,
colon : colon,
last : function() { return last },
semicolon : semicolon,
force_semicolon : force_semicolon,
to_ascii : to_ascii,
print_name : function(name) { print(make_name(name)) },
print_string : function(str) { print(encode_string(str)) },
next_indent : next_indent,
with_indent : with_indent,
with_block : with_block,
with_parens : with_parens,
with_square : with_square,
add_mapping : add_mapping,
option : function(opt) { return options[opt] },
line : function() { return current_line },
col : function() { return current_col },
pos : function() { return current_pos },
push_node : function(node) { stack.push(node) },
pop_node : function() { return stack.pop() },
stack : function() { return stack },
parent : function(n) {
return stack[stack.length - 2 - (n || 0)];
}
};
};
/* -----[ code generators ]----- */
(function(){
/* -----[ utils ]----- */
function DEFPRINT(nodetype, generator) {
nodetype.DEFMETHOD("_codegen", generator);
};
AST_Node.DEFMETHOD("print", function(stream, force_parens){
var self = this, generator = self._codegen;
function doit() {
self.add_comments(stream);
self.add_source_map(stream);
generator(self, stream);
}
stream.push_node(self);
if (force_parens || self.needs_parens(stream)) {
stream.with_parens(doit);
} else {
doit();
}
stream.pop_node();
});
AST_Node.DEFMETHOD("print_to_string", function(options){
var s = OutputStream(options);
this.print(s);
return s.get();
});
/* -----[ comments ]----- */
AST_Node.DEFMETHOD("add_comments", function(output){
var c = output.option("comments"), self = this;
if (c) {
var start = self.start;
if (start && !start._comments_dumped) {
start._comments_dumped = true;
var comments = start.comments_before || [];
// XXX: ugly fix for https://github.com/mishoo/UglifyJS2/issues/112
// if this node is `return` or `throw`, we cannot allow comments before
// the returned or thrown value.
if (self instanceof AST_Exit && self.value
&& self.value.start.comments_before
&& self.value.start.comments_before.length > 0) {
comments = comments.concat(self.value.start.comments_before);
self.value.start.comments_before = [];
}
if (c.test) {
comments = comments.filter(function(comment){
return c.test(comment.value);
});
} else if (typeof c == "function") {
comments = comments.filter(function(comment){
return c(self, comment);
});
}
comments.forEach(function(c){
if (/comment[134]/.test(c.type)) {
output.print("//" + c.value + "\n");
output.indent();
}
else if (c.type == "comment2") {
output.print("/*" + c.value + "*/");
if (start.nlb) {
output.print("\n");
output.indent();
} else {
output.space();
}
}
});
}
}
});
/* -----[ PARENTHESES ]----- */
function PARENS(nodetype, func) {
nodetype.DEFMETHOD("needs_parens", func);
};
PARENS(AST_Node, function(){
return false;
});
// a function expression needs parens around it when it's provably
// the first token to appear in a statement.
PARENS(AST_Function, function(output){
return first_in_statement(output);
});
// same goes for an object literal, because otherwise it would be
// interpreted as a block of code.
PARENS(AST_Object, function(output){
return first_in_statement(output);
});
PARENS(AST_Unary, function(output){
var p = output.parent();
return p instanceof AST_PropAccess && p.expression === this;
});
PARENS(AST_Seq, function(output){
var p = output.parent();
return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4)
|| p instanceof AST_Unary // !(foo, bar, baz)
|| p instanceof AST_Binary // 1 + (2, 3) + 4 ==> 8
|| p instanceof AST_VarDef // var a = (1, 2), b = a + a; ==> b == 4
|| p instanceof AST_Dot // (1, {foo:2}).foo ==> 2
|| p instanceof AST_Array // [ 1, (2, 3), 4 ] ==> [ 1, 3, 4 ]
|| p instanceof AST_ObjectProperty // { foo: (1, 2) }.foo ==> 2
|| p instanceof AST_Conditional /* (false, true) ? (a = 10, b = 20) : (c = 30)
* ==> 20 (side effect, set a := 10 and b := 20) */
;
});
PARENS(AST_Binary, function(output){
var p = output.parent();
// (foo && bar)()
if (p instanceof AST_Call && p.expression === this)
return true;
// typeof (foo && bar)
if (p instanceof AST_Unary)
return true;
// (foo && bar)["prop"], (foo && bar).prop
if (p instanceof AST_PropAccess && p.expression === this)
return true;
// this deals with precedence: 3 * (2 + 1)
if (p instanceof AST_Binary) {
var po = p.operator, pp = PRECEDENCE[po];
var so = this.operator, sp = PRECEDENCE[so];
if (pp > sp
|| (pp == sp
&& this === p.right)) {
return true;
}
}
});
PARENS(AST_PropAccess, function(output){
var p = output.parent();
if (p instanceof AST_New && p.expression === this) {
// i.e. new (foo.bar().baz)
//
// if there's one call into this subtree, then we need
// parens around it too, otherwise the call will be
// interpreted as passing the arguments to the upper New
// expression.
try {
this.walk(new TreeWalker(function(node){
if (node instanceof AST_Call) throw p;
}));
} catch(ex) {
if (ex !== p) throw ex;
return true;
}
}
});
PARENS(AST_Call, function(output){
var p = output.parent(), p1;
if (p instanceof AST_New && p.expression === this)
return true;
// workaround for Safari bug.
// https://bugs.webkit.org/show_bug.cgi?id=123506
return this.expression instanceof AST_Function
&& p instanceof AST_PropAccess
&& p.expression === this
&& (p1 = output.parent(1)) instanceof AST_Assign
&& p1.left === p;
});
PARENS(AST_New, function(output){
var p = output.parent();
if (no_constructor_parens(this, output)
&& (p instanceof AST_PropAccess // (new Date).getTime(), (new Date)["getTime"]()
|| p instanceof AST_Call && p.expression === this)) // (new foo)(bar)
return true;
});
PARENS(AST_Number, function(output){
var p = output.parent();
if (this.getValue() < 0 && p instanceof AST_PropAccess && p.expression === this)
return true;
});
PARENS(AST_NaN, function(output){
var p = output.parent();
if (p instanceof AST_PropAccess && p.expression === this)
return true;
});
function assign_and_conditional_paren_rules(output) {
var p = output.parent();
// !(a = false) → true
if (p instanceof AST_Unary)
return true;
// 1 + (a = 2) + 3 → 6, side effect setting a = 2
if (p instanceof AST_Binary && !(p instanceof AST_Assign))
return true;
// (a = func)() —or— new (a = Object)()
if (p instanceof AST_Call && p.expression === this)
return true;
// (a = foo) ? bar : baz
if (p instanceof AST_Conditional && p.condition === this)
return true;
// (a = foo)["prop"] —or— (a = foo).prop
if (p instanceof AST_PropAccess && p.expression === this)
return true;
};
PARENS(AST_Assign, assign_and_conditional_paren_rules);
PARENS(AST_Conditional, assign_and_conditional_paren_rules);
/* -----[ PRINTERS ]----- */
DEFPRINT(AST_Directive, function(self, output){
output.print_string(self.value);
output.semicolon();
});
DEFPRINT(AST_Debugger, function(self, output){
output.print("debugger");
output.semicolon();
});
/* -----[ statements ]----- */
function display_body(body, is_toplevel, output) {
var last = body.length - 1;
body.forEach(function(stmt, i){
if (!(stmt instanceof AST_EmptyStatement)) {
output.indent();
stmt.print(output);
if (!(i == last && is_toplevel)) {
output.newline();
if (is_toplevel) output.newline();
}
}
});
};
AST_StatementWithBody.DEFMETHOD("_do_print_body", function(output){
force_statement(this.body, output);
});
DEFPRINT(AST_Statement, function(self, output){
self.body.print(output);
output.semicolon();
});
DEFPRINT(AST_Toplevel, function(self, output){
display_body(self.body, true, output);
output.print("");
});
DEFPRINT(AST_LabeledStatement, function(self, output){
self.label.print(output);
output.colon();
self.body.print(output);
});
DEFPRINT(AST_SimpleStatement, function(self, output){
self.body.print(output);
output.semicolon();
});
function print_bracketed(body, output) {
if (body.length > 0) output.with_block(function(){
display_body(body, false, output);
});
else output.print("{}");
};
DEFPRINT(AST_BlockStatement, function(self, output){
print_bracketed(self.body, output);
});
DEFPRINT(AST_EmptyStatement, function(self, output){
output.semicolon();
});
DEFPRINT(AST_Do, function(self, output){
output.print("do");
output.space();
self._do_print_body(output);
output.space();
output.print("while");
output.space();
output.with_parens(function(){
self.condition.print(output);
});
output.semicolon();
});
DEFPRINT(AST_While, function(self, output){
output.print("while");
output.space();
output.with_parens(function(){
self.condition.print(output);
});
output.space();
self._do_print_body(output);
});
DEFPRINT(AST_For, function(self, output){
output.print("for");
output.space();
output.with_parens(function(){
if (self.init) {
if (self.init instanceof AST_Definitions) {
self.init.print(output);
} else {
parenthesize_for_noin(self.init, output, true);
}
output.print(";");
output.space();
} else {
output.print(";");
}
if (self.condition) {
self.condition.print(output);
output.print(";");
output.space();
} else {
output.print(";");
}
if (self.step) {
self.step.print(output);
}
});
output.space();
self._do_print_body(output);
});
DEFPRINT(AST_ForIn, function(self, output){
output.print("for");
output.space();
output.with_parens(function(){
self.init.print(output);
output.space();
output.print("in");
output.space();
self.object.print(output);
});
output.space();
self._do_print_body(output);
});
DEFPRINT(AST_With, function(self, output){
output.print("with");
output.space();
output.with_parens(function(){
self.expression.print(output);
});
output.space();
self._do_print_body(output);
});
/* -----[ functions ]----- */
AST_Lambda.DEFMETHOD("_do_print", function(output, nokeyword){
var self = this;
if (!nokeyword) {
output.print("function");
}
if (self.name) {
output.space();
self.name.print(output);
}
output.with_parens(function(){
self.argnames.forEach(function(arg, i){
if (i) output.comma();
arg.print(output);
});
});
output.space();
print_bracketed(self.body, output);
});
DEFPRINT(AST_Lambda, function(self, output){
self._do_print(output);
});
/* -----[ exits ]----- */
AST_Exit.DEFMETHOD("_do_print", function(output, kind){
output.print(kind);
if (this.value) {
output.space();
this.value.print(output);
}
output.semicolon();
});
DEFPRINT(AST_Return, function(self, output){
self._do_print(output, "return");
});
DEFPRINT(AST_Throw, function(self, output){
self._do_print(output, "throw");
});
/* -----[ loop control ]----- */
AST_LoopControl.DEFMETHOD("_do_print", function(output, kind){
output.print(kind);
if (this.label) {
output.space();
this.label.print(output);
}
output.semicolon();
});
DEFPRINT(AST_Break, function(self, output){
self._do_print(output, "break");
});
DEFPRINT(AST_Continue, function(self, output){
self._do_print(output, "continue");
});
/* -----[ if ]----- */
function make_then(self, output) {
if (output.option("bracketize")) {
make_block(self.body, output);
return;
}
// The squeezer replaces "block"-s that contain only a single
// statement with the statement itself; technically, the AST
// is correct, but this can create problems when we output an
// IF having an ELSE clause where the THEN clause ends in an
// IF *without* an ELSE block (then the outer ELSE would refer
// to the inner IF). This function checks for this case and
// adds the block brackets if needed.
if (!self.body)
return output.force_semicolon();
if (self.body instanceof AST_Do
&& !output.option("screw_ie8")) {
// https://github.com/mishoo/UglifyJS/issues/#issue/57 IE
// croaks with "syntax error" on code like this: if (foo)
// do ... while(cond); else ... we need block brackets
// around do/while
make_block(self.body, output);
return;
}
var b = self.body;
while (true) {
if (b instanceof AST_If) {
if (!b.alternative) {
make_block(self.body, output);
return;
}
b = b.alternative;
}
else if (b instanceof AST_StatementWithBody) {
b = b.body;
}
else break;
}
force_statement(self.body, output);
};
DEFPRINT(AST_If, function(self, output){
output.print("if");
output.space();
output.with_parens(function(){
self.condition.print(output);
});
output.space();
if (self.alternative) {
make_then(self, output);
output.space();
output.print("else");
output.space();
force_statement(self.alternative, output);
} else {
self._do_print_body(output);
}
});
/* -----[ switch ]----- */
DEFPRINT(AST_Switch, function(self, output){
output.print("switch");
output.space();
output.with_parens(function(){
self.expression.print(output);
});
output.space();
if (self.body.length > 0) output.with_block(function(){
self.body.forEach(function(stmt, i){
if (i) output.newline();
output.indent(true);
stmt.print(output);
});
});
else output.print("{}");
});
AST_SwitchBranch.DEFMETHOD("_do_print_body", function(output){
if (this.body.length > 0) {
output.newline();
this.body.forEach(function(stmt){
output.indent();
stmt.print(output);
output.newline();
});
}
});
DEFPRINT(AST_Default, function(self, output){
output.print("default:");
self._do_print_body(output);
});
DEFPRINT(AST_Case, function(self, output){
output.print("case");
output.space();
self.expression.print(output);
output.print(":");
self._do_print_body(output);
});
/* -----[ exceptions ]----- */
DEFPRINT(AST_Try, function(self, output){
output.print("try");
output.space();
print_bracketed(self.body, output);
if (self.bcatch) {
output.space();
self.bcatch.print(output);
}
if (self.bfinally) {
output.space();
self.bfinally.print(output);
}
});
DEFPRINT(AST_Catch, function(self, output){
output.print("catch");
output.space();
output.with_parens(function(){
self.argname.print(output);
});
output.space();
print_bracketed(self.body, output);
});
DEFPRINT(AST_Finally, function(self, output){
output.print("finally");
output.space();
print_bracketed(self.body, output);
});
/* -----[ var/const ]----- */
AST_Definitions.DEFMETHOD("_do_print", function(output, kind){
output.print(kind);
output.space();
this.definitions.forEach(function(def, i){
if (i) output.comma();
def.print(output);
});
var p = output.parent();
var in_for = p instanceof AST_For || p instanceof AST_ForIn;
var avoid_semicolon = in_for && p.init === this;
if (!avoid_semicolon)
output.semicolon();
});
DEFPRINT(AST_Var, function(self, output){
self._do_print(output, "var");
});
DEFPRINT(AST_Const, function(self, output){
self._do_print(output, "const");
});
function parenthesize_for_noin(node, output, noin) {
if (!noin) node.print(output);
else try {
// need to take some precautions here:
// https://github.com/mishoo/UglifyJS2/issues/60
node.walk(new TreeWalker(function(node){
if (node instanceof AST_Binary && node.operator == "in")
throw output;
}));
node.print(output);
} catch(ex) {
if (ex !== output) throw ex;
node.print(output, true);
}
};
DEFPRINT(AST_VarDef, function(self, output){
self.name.print(output);
if (self.value) {
output.space();
output.print("=");
output.space();
var p = output.parent(1);
var noin = p instanceof AST_For || p instanceof AST_ForIn;
parenthesize_for_noin(self.value, output, noin);
}
});
/* -----[ other expressions ]----- */
DEFPRINT(AST_Call, function(self, output){
self.expression.print(output);
if (self instanceof AST_New && no_constructor_parens(self, output))
return;
output.with_parens(function(){
self.args.forEach(function(expr, i){
if (i) output.comma();
expr.print(output);
});
});
});
DEFPRINT(AST_New, function(self, output){
output.print("new");
output.space();
AST_Call.prototype._codegen(self, output);
});
AST_Seq.DEFMETHOD("_do_print", function(output){
this.car.print(output);
if (this.cdr) {
output.comma();
if (output.should_break()) {
output.newline();
output.indent();
}
this.cdr.print(output);
}
});
DEFPRINT(AST_Seq, function(self, output){
self._do_print(output);
// var p = output.parent();
// if (p instanceof AST_Statement) {
// output.with_indent(output.next_indent(), function(){
// self._do_print(output);
// });
// } else {
// self._do_print(output);
// }
});
DEFPRINT(AST_Dot, function(self, output){
var expr = self.expression;
expr.print(output);
if (expr instanceof AST_Number && expr.getValue() >= 0) {
if (!/[xa-f.]/i.test(output.last())) {
output.print(".");
}
}
output.print(".");
// the name after dot would be mapped about here.
output.add_mapping(self.end);
output.print_name(self.property);
});
DEFPRINT(AST_Sub, function(self, output){
self.expression.print(output);
output.print("[");
self.property.print(output);
output.print("]");
});
DEFPRINT(AST_UnaryPrefix, function(self, output){
var op = self.operator;
output.print(op);
if (/^[a-z]/i.test(op))
output.space();
self.expression.print(output);
});
DEFPRINT(AST_UnaryPostfix, function(self, output){
self.expression.print(output);
output.print(self.operator);
});
DEFPRINT(AST_Binary, function(self, output){
self.left.print(output);
output.space();
output.print(self.operator);
if (self.operator == "<"
&& self.right instanceof AST_UnaryPrefix
&& self.right.operator == "!"
&& self.right.expression instanceof AST_UnaryPrefix
&& self.right.expression.operator == "--") {
// space is mandatory to avoid outputting <!--
// http://javascript.spec.whatwg.org/#comment-syntax
output.print(" ");
} else {
// the space is optional depending on "beautify"
output.space();
}
self.right.print(output);
});
DEFPRINT(AST_Conditional, function(self, output){
self.condition.print(output);
output.space();
output.print("?");
output.space();
self.consequent.print(output);
output.space();
output.colon();
self.alternative.print(output);
});
/* -----[ literals ]----- */
DEFPRINT(AST_Array, function(self, output){
output.with_square(function(){
var a = self.elements, len = a.length;
if (len > 0) output.space();
a.forEach(function(exp, i){
if (i) output.comma();
exp.print(output);
// If the final element is a hole, we need to make sure it
// doesn't look like a trailing comma, by inserting an actual
// trailing comma.
if (i === len - 1 && exp instanceof AST_Hole)
output.comma();
});
if (len > 0) output.space();
});
});
DEFPRINT(AST_Object, function(self, output){
if (self.properties.length > 0) output.with_block(function(){
self.properties.forEach(function(prop, i){
if (i) {
output.print(",");
output.newline();
}
output.indent();
prop.print(output);
});
output.newline();
});
else output.print("{}");
});
DEFPRINT(AST_ObjectKeyVal, function(self, output){
var key = self.key;
if (output.option("quote_keys")) {
output.print_string(key + "");
} else if ((typeof key == "number"
|| !output.option("beautify")
&& +key + "" == key)
&& parseFloat(key) >= 0) {
output.print(make_num(key));
} else if (RESERVED_WORDS(key) ? output.option("screw_ie8") : is_identifier_string(key)) {
output.print_name(key);
} else {
output.print_string(key);
}
output.colon();
self.value.print(output);
});
DEFPRINT(AST_ObjectSetter, function(self, output){
output.print("set");
output.space();
self.key.print(output);
self.value._do_print(output, true);
});
DEFPRINT(AST_ObjectGetter, function(self, output){
output.print("get");
output.space();
self.key.print(output);
self.value._do_print(output, true);
});
DEFPRINT(AST_Symbol, function(self, output){
var def = self.definition();
output.print_name(def ? def.mangled_name || def.name : self.name);
});
DEFPRINT(AST_Undefined, function(self, output){
output.print("void 0");
});
DEFPRINT(AST_Hole, noop);
DEFPRINT(AST_Infinity, function(self, output){
output.print("1/0");
});
DEFPRINT(AST_NaN, function(self, output){
output.print("0/0");
});
DEFPRINT(AST_This, function(self, output){
output.print("this");
});
DEFPRINT(AST_Constant, function(self, output){
output.print(self.getValue());
});
DEFPRINT(AST_String, function(self, output){
output.print_string(self.getValue());
});
DEFPRINT(AST_Number, function(self, output){
output.print(make_num(self.getValue()));
});
DEFPRINT(AST_RegExp, function(self, output){
var str = self.getValue().toString();
if (output.option("ascii_only"))
str = output.to_ascii(str);
output.print(str);
var p = output.parent();
if (p instanceof AST_Binary && /^in/.test(p.operator) && p.left === self)
output.print(" ");
});
function force_statement(stat, output) {
if (output.option("bracketize")) {
if (!stat || stat instanceof AST_EmptyStatement)
output.print("{}");
else if (stat instanceof AST_BlockStatement)
stat.print(output);
else output.with_block(function(){
output.indent();
stat.print(output);
output.newline();
});
} else {
if (!stat || stat instanceof AST_EmptyStatement)
output.force_semicolon();
else
stat.print(output);
}
};
// return true if the node at the top of the stack (that means the
// innermost node in the current output) is lexically the first in
// a statement.
function first_in_statement(output) {
var a = output.stack(), i = a.length, node = a[--i], p = a[--i];
while (i > 0) {
if (p instanceof AST_Statement && p.body === node)
return true;
if ((p instanceof AST_Seq && p.car === node ) ||
(p instanceof AST_Call && p.expression === node && !(p instanceof AST_New) ) ||
(p instanceof AST_Dot && p.expression === node ) ||
(p instanceof AST_Sub && p.expression === node ) ||
(p instanceof AST_Conditional && p.condition === node ) ||
(p instanceof AST_Binary && p.left === node ) ||
(p instanceof AST_UnaryPostfix && p.expression === node ))
{
node = p;
p = a[--i];
} else {
return false;
}
}
};
// self should be AST_New. decide if we want to show parens or not.
function no_constructor_parens(self, output) {
return self.args.length == 0 && !output.option("beautify");
};
function best_of(a) {
var best = a[0], len = best.length;
for (var i = 1; i < a.length; ++i) {
if (a[i].length < len) {
best = a[i];
len = best.length;
}
}
return best;
};
function make_num(num) {
var str = num.toString(10), a = [ str.replace(/^0\./, ".").replace('e+', 'e') ], m;
if (Math.floor(num) === num) {
if (num >= 0) {
a.push("0x" + num.toString(16).toLowerCase(), // probably pointless
"0" + num.toString(8)); // same.
} else {
a.push("-0x" + (-num).toString(16).toLowerCase(), // probably pointless
"-0" + (-num).toString(8)); // same.
}
if ((m = /^(.*?)(0+)$/.exec(num))) {
a.push(m[1] + "e" + m[2].length);
}
} else if ((m = /^0?\.(0+)(.*)$/.exec(num))) {
a.push(m[2] + "e-" + (m[1].length + m[2].length),
str.substr(str.indexOf(".")));
}
return best_of(a);
};
function make_block(stmt, output) {
if (stmt instanceof AST_BlockStatement) {
stmt.print(output);
return;
}
output.with_block(function(){
output.indent();
stmt.print(output);
output.newline();
});
};
/* -----[ source map generators ]----- */
function DEFMAP(nodetype, generator) {
nodetype.DEFMETHOD("add_source_map", function(stream){
generator(this, stream);
});
};
// We could easily add info for ALL nodes, but it seems to me that
// would be quite wasteful, hence this noop in the base class.
DEFMAP(AST_Node, noop);
function basic_sourcemap_gen(self, output) {
output.add_mapping(self.start);
};
// XXX: I'm not exactly sure if we need it for all of these nodes,
// or if we should add even more.
DEFMAP(AST_Directive, basic_sourcemap_gen);
DEFMAP(AST_Debugger, basic_sourcemap_gen);
DEFMAP(AST_Symbol, basic_sourcemap_gen);
DEFMAP(AST_Jump, basic_sourcemap_gen);
DEFMAP(AST_StatementWithBody, basic_sourcemap_gen);
DEFMAP(AST_LabeledStatement, noop); // since the label symbol will mark it
DEFMAP(AST_Lambda, basic_sourcemap_gen);
DEFMAP(AST_Switch, basic_sourcemap_gen);
DEFMAP(AST_SwitchBranch, basic_sourcemap_gen);
DEFMAP(AST_BlockStatement, basic_sourcemap_gen);
DEFMAP(AST_Toplevel, noop);
DEFMAP(AST_New, basic_sourcemap_gen);
DEFMAP(AST_Try, basic_sourcemap_gen);
DEFMAP(AST_Catch, basic_sourcemap_gen);
DEFMAP(AST_Finally, basic_sourcemap_gen);
DEFMAP(AST_Definitions, basic_sourcemap_gen);
DEFMAP(AST_Constant, basic_sourcemap_gen);
DEFMAP(AST_ObjectProperty, function(self, output){
output.add_mapping(self.start, self.key);
});
})();
/***********************************************************************
A JavaScript tokenizer / parser / beautifier / compressor.
https://github.com/mishoo/UglifyJS2
-------------------------------- (C) ---------------------------------
Author: Mihai Bazon
<mihai.bazon@gmail.com>
http://mihai.bazon.net/blog
Distributed under the BSD license:
Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***********************************************************************/
"use strict";
function Compressor(options, false_by_default) {
if (!(this instanceof Compressor))
return new Compressor(options, false_by_default);
TreeTransformer.call(this, this.before, this.after);
this.options = defaults(options, {
sequences : !false_by_default,
properties : !false_by_default,
dead_code : !false_by_default,
drop_debugger : !false_by_default,
unsafe : false,
unsafe_comps : false,
conditionals : !false_by_default,
comparisons : !false_by_default,
evaluate : !false_by_default,
booleans : !false_by_default,
loops : !false_by_default,
unused : !false_by_default,
hoist_funs : !false_by_default,
hoist_vars : false,
if_return : !false_by_default,
join_vars : !false_by_default,
cascade : !false_by_default,
side_effects : !false_by_default,
pure_getters : false,
pure_funcs : null,
negate_iife : !false_by_default,
screw_ie8 : false,
drop_console : false,
warnings : true,
global_defs : {}
}, true);
};
Compressor.prototype = new TreeTransformer;
merge(Compressor.prototype, {
option: function(key) { return this.options[key] },
warn: function() {
if (this.options.warnings)
AST_Node.warn.apply(AST_Node, arguments);
},
before: function(node, descend, in_list) {
if (node._squeezed) return node;
var was_scope = false;
if (node instanceof AST_Scope) {
node = node.hoist_declarations(this);
was_scope = true;
}
descend(node, this);
node = node.optimize(this);
if (was_scope && node instanceof AST_Scope) {
node.drop_unused(this);
descend(node, this);
}
node._squeezed = true;
return node;
}
});
(function(){
function OPT(node, optimizer) {
node.DEFMETHOD("optimize", function(compressor){
var self = this;
if (self._optimized) return self;
var opt = optimizer(self, compressor);
opt._optimized = true;
if (opt === self) return opt;
return opt.transform(compressor);
});
};
OPT(AST_Node, function(self, compressor){
return self;
});
AST_Node.DEFMETHOD("equivalent_to", function(node){
// XXX: this is a rather expensive way to test two node's equivalence:
return this.print_to_string() == node.print_to_string();
});
function make_node(ctor, orig, props) {
if (!props) props = {};
if (orig) {
if (!props.start) props.start = orig.start;
if (!props.end) props.end = orig.end;
}
return new ctor(props);
};
function make_node_from_constant(compressor, val, orig) {
// XXX: WIP.
// if (val instanceof AST_Node) return val.transform(new TreeTransformer(null, function(node){
// if (node instanceof AST_SymbolRef) {
// var scope = compressor.find_parent(AST_Scope);
// var def = scope.find_variable(node);
// node.thedef = def;
// return node;
// }
// })).transform(compressor);
if (val instanceof AST_Node) return val.transform(compressor);
switch (typeof val) {
case "string":
return make_node(AST_String, orig, {
value: val
}).optimize(compressor);
case "number":
return make_node(isNaN(val) ? AST_NaN : AST_Number, orig, {
value: val
}).optimize(compressor);
case "boolean":
return make_node(val ? AST_True : AST_False, orig).optimize(compressor);
case "undefined":
return make_node(AST_Undefined, orig).optimize(compressor);
default:
if (val === null) {
return make_node(AST_Null, orig).optimize(compressor);
}
if (val instanceof RegExp) {
return make_node(AST_RegExp, orig).optimize(compressor);
}
throw new Error(string_template("Can't handle constant of type: {type}", {
type: typeof val
}));
}
};
function as_statement_array(thing) {
if (thing === null) return [];
if (thing instanceof AST_BlockStatement) return thing.body;
if (thing instanceof AST_EmptyStatement) return [];
if (thing instanceof AST_Statement) return [ thing ];
throw new Error("Can't convert thing to statement array");
};
function is_empty(thing) {
if (thing === null) return true;
if (thing instanceof AST_EmptyStatement) return true;
if (thing instanceof AST_BlockStatement) return thing.body.length == 0;
return false;
};
function loop_body(x) {
if (x instanceof AST_Switch) return x;
if (x instanceof AST_For || x instanceof AST_ForIn || x instanceof AST_DWLoop) {
return (x.body instanceof AST_BlockStatement ? x.body : x);
}
return x;
};
function tighten_body(statements, compressor) {
var CHANGED;
do {
CHANGED = false;
statements = eliminate_spurious_blocks(statements);
if (compressor.option("dead_code")) {
statements = eliminate_dead_code(statements, compressor);
}
if (compressor.option("if_return")) {
statements = handle_if_return(statements, compressor);
}
if (compressor.option("sequences")) {
statements = sequencesize(statements, compressor);
}
if (compressor.option("join_vars")) {
statements = join_consecutive_vars(statements, compressor);
}
} while (CHANGED);
if (compressor.option("negate_iife")) {
negate_iifes(statements, compressor);
}
return statements;
function eliminate_spurious_blocks(statements) {
var seen_dirs = [];
return statements.reduce(function(a, stat){
if (stat instanceof AST_BlockStatement) {
CHANGED = true;
a.push.apply(a, eliminate_spurious_blocks(stat.body));
} else if (stat instanceof AST_EmptyStatement) {
CHANGED = true;
} else if (stat instanceof AST_Directive) {
if (seen_dirs.indexOf(stat.value) < 0) {
a.push(stat);
seen_dirs.push(stat.value);
} else {
CHANGED = true;
}
} else {
a.push(stat);
}
return a;
}, []);
};
function handle_if_return(statements, compressor) {
var self = compressor.self();
var in_lambda = self instanceof AST_Lambda;
var ret = [];
loop: for (var i = statements.length; --i >= 0;) {
var stat = statements[i];
switch (true) {
case (in_lambda && stat instanceof AST_Return && !stat.value && ret.length == 0):
CHANGED = true;
// note, ret.length is probably always zero
// because we drop unreachable code before this
// step. nevertheless, it's good to check.
continue loop;
case stat instanceof AST_If:
if (stat.body instanceof AST_Return) {
//---
// pretty silly case, but:
// if (foo()) return; return; ==> foo(); return;
if (((in_lambda && ret.length == 0)
|| (ret[0] instanceof AST_Return && !ret[0].value))
&& !stat.body.value && !stat.alternative) {
CHANGED = true;
var cond = make_node(AST_SimpleStatement, stat.condition, {
body: stat.condition
});
ret.unshift(cond);
continue loop;
}
//---
// if (foo()) return x; return y; ==> return foo() ? x : y;
if (ret[0] instanceof AST_Return && stat.body.value && ret[0].value && !stat.alternative) {
CHANGED = true;
stat = stat.clone();
stat.alternative = ret[0];
ret[0] = stat.transform(compressor);
continue loop;
}
//---
// if (foo()) return x; [ return ; ] ==> return foo() ? x : undefined;
if ((ret.length == 0 || ret[0] instanceof AST_Return) && stat.body.value && !stat.alternative && in_lambda) {
CHANGED = true;
stat = stat.clone();
stat.alternative = ret[0] || make_node(AST_Return, stat, {
value: make_node(AST_Undefined, stat)
});
ret[0] = stat.transform(compressor);
continue loop;
}
//---
// if (foo()) return; [ else x... ]; y... ==> if (!foo()) { x...; y... }
if (!stat.body.value && in_lambda) {
CHANGED = true;
stat = stat.clone();
stat.condition = stat.condition.negate(compressor);
stat.body = make_node(AST_BlockStatement, stat, {
body: as_statement_array(stat.alternative).concat(ret)
});
stat.alternative = null;
ret = [ stat.transform(compressor) ];
continue loop;
}
//---
if (ret.length == 1 && in_lambda && ret[0] instanceof AST_SimpleStatement
&& (!stat.alternative || stat.alternative instanceof AST_SimpleStatement)) {
CHANGED = true;
ret.push(make_node(AST_Return, ret[0], {
value: make_node(AST_Undefined, ret[0])
}).transform(compressor));
ret = as_statement_array(stat.alternative).concat(ret);
ret.unshift(stat);
continue loop;
}
}
var ab = aborts(stat.body);
var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab.label) : null;
if (ab && ((ab instanceof AST_Return && !ab.value && in_lambda)
|| (ab instanceof AST_Continue && self === loop_body(lct))
|| (ab instanceof AST_Break && lct instanceof AST_BlockStatement && self === lct))) {
if (ab.label) {
remove(ab.label.thedef.references, ab);
}
CHANGED = true;
var body = as_statement_array(stat.body).slice(0, -1);
stat = stat.clone();
stat.condition = stat.condition.negate(compressor);
stat.body = make_node(AST_BlockStatement, stat, {
body: ret
});
stat.alternative = make_node(AST_BlockStatement, stat, {
body: body
});
ret = [ stat.transform(compressor) ];
continue loop;
}
var ab = aborts(stat.alternative);
var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab.label) : null;
if (ab && ((ab instanceof AST_Return && !ab.value && in_lambda)
|| (ab instanceof AST_Continue && self === loop_body(lct))
|| (ab instanceof AST_Break && lct instanceof AST_BlockStatement && self === lct))) {
if (ab.label) {
remove(ab.label.thedef.references, ab);
}
CHANGED = true;
stat = stat.clone();
stat.body = make_node(AST_BlockStatement, stat.body, {
body: as_statement_array(stat.body).concat(ret)
});
stat.alternative = make_node(AST_BlockStatement, stat.alternative, {
body: as_statement_array(stat.alternative).slice(0, -1)
});
ret = [ stat.transform(compressor) ];
continue loop;
}
ret.unshift(stat);
break;
default:
ret.unshift(stat);
break;
}
}
return ret;
};
function eliminate_dead_code(statements, compressor) {
var has_quit = false;
var orig = statements.length;
var self = compressor.self();
statements = statements.reduce(function(a, stat){
if (has_quit) {
extract_declarations_from_unreachable_code(compressor, stat, a);
} else {
if (stat instanceof AST_LoopControl) {
var lct = compressor.loopcontrol_target(stat.label);
if ((stat instanceof AST_Break
&& lct instanceof AST_BlockStatement
&& loop_body(lct) === self) || (stat instanceof AST_Continue
&& loop_body(lct) === self)) {
if (stat.label) {
remove(stat.label.thedef.references, stat);
}
} else {
a.push(stat);
}
} else {
a.push(stat);
}
if (aborts(stat)) has_quit = true;
}
return a;
}, []);
CHANGED = statements.length != orig;
return statements;
};
function sequencesize(statements, compressor) {
if (statements.length < 2) return statements;
var seq = [], ret = [];
function push_seq() {
seq = AST_Seq.from_array(seq);
if (seq) ret.push(make_node(AST_SimpleStatement, seq, {
body: seq
}));
seq = [];
};
statements.forEach(function(stat){
if (stat instanceof AST_SimpleStatement) seq.push(stat.body);
else push_seq(), ret.push(stat);
});
push_seq();
ret = sequencesize_2(ret, compressor);
CHANGED = ret.length != statements.length;
return ret;
};
function sequencesize_2(statements, compressor) {
function cons_seq(right) {
ret.pop();
var left = prev.body;
if (left instanceof AST_Seq) {
left.add(right);
} else {
left = AST_Seq.cons(left, right);
}
return left.transform(compressor);
};
var ret = [], prev = null;
statements.forEach(function(stat){
if (prev) {
if (stat instanceof AST_For) {
var opera = {};
try {
prev.body.walk(new TreeWalker(function(node){
if (node instanceof AST_Binary && node.operator == "in")
throw opera;
}));
if (stat.init && !(stat.init instanceof AST_Definitions)) {
stat.init = cons_seq(stat.init);
}
else if (!stat.init) {
stat.init = prev.body;
ret.pop();
}
} catch(ex) {
if (ex !== opera) throw ex;
}
}
else if (stat instanceof AST_If) {
stat.condition = cons_seq(stat.condition);
}
else if (stat instanceof AST_With) {
stat.expression = cons_seq(stat.expression);
}
else if (stat instanceof AST_Exit && stat.value) {
stat.value = cons_seq(stat.value);
}
else if (stat instanceof AST_Exit) {
stat.value = cons_seq(make_node(AST_Undefined, stat));
}
else if (stat instanceof AST_Switch) {
stat.expression = cons_seq(stat.expression);
}
}
ret.push(stat);
prev = stat instanceof AST_SimpleStatement ? stat : null;
});
return ret;
};
function join_consecutive_vars(statements, compressor) {
var prev = null;
return statements.reduce(function(a, stat){
if (stat instanceof AST_Definitions && prev && prev.TYPE == stat.TYPE) {
prev.definitions = prev.definitions.concat(stat.definitions);
CHANGED = true;
}
else if (stat instanceof AST_For
&& prev instanceof AST_Definitions
&& (!stat.init || stat.init.TYPE == prev.TYPE)) {
CHANGED = true;
a.pop();
if (stat.init) {
stat.init.definitions = prev.definitions.concat(stat.init.definitions);
} else {
stat.init = prev;
}
a.push(stat);
prev = stat;
}
else {
prev = stat;
a.push(stat);
}
return a;
}, []);
};
function negate_iifes(statements, compressor) {
statements.forEach(function(stat){
if (stat instanceof AST_SimpleStatement) {
stat.body = (function transform(thing) {
return thing.transform(new TreeTransformer(function(node){
if (node instanceof AST_Call && node.expression instanceof AST_Function) {
return make_node(AST_UnaryPrefix, node, {
operator: "!",
expression: node
});
}
else if (node instanceof AST_Call) {
node.expression = transform(node.expression);
}
else if (node instanceof AST_Seq) {
node.car = transform(node.car);
}
else if (node instanceof AST_Conditional) {
var expr = transform(node.condition);
if (expr !== node.condition) {
// it has been negated, reverse
node.condition = expr;
var tmp = node.consequent;
node.consequent = node.alternative;
node.alternative = tmp;
}
}
return node;
}));
})(stat.body);
}
});
};
};
function extract_declarations_from_unreachable_code(compressor, stat, target) {
compressor.warn("Dropping unreachable code [{file}:{line},{col}]", stat.start);
stat.walk(new TreeWalker(function(node){
if (node instanceof AST_Definitions) {
compressor.warn("Declarations in unreachable code! [{file}:{line},{col}]", node.start);
node.remove_initializers();
target.push(node);
return true;
}
if (node instanceof AST_Defun) {
target.push(node);
return true;
}
if (node instanceof AST_Scope) {
return true;
}
}));
};
/* -----[ boolean/negation helpers ]----- */
// methods to determine whether an expression has a boolean result type
(function (def){
var unary_bool = [ "!", "delete" ];
var binary_bool = [ "in", "instanceof", "==", "!=", "===", "!==", "<", "<=", ">=", ">" ];
def(AST_Node, function(){ return false });
def(AST_UnaryPrefix, function(){
return member(this.operator, unary_bool);
});
def(AST_Binary, function(){
return member(this.operator, binary_bool) ||
( (this.operator == "&&" || this.operator == "||") &&
this.left.is_boolean() && this.right.is_boolean() );
});
def(AST_Conditional, function(){
return this.consequent.is_boolean() && this.alternative.is_boolean();
});
def(AST_Assign, function(){
return this.operator == "=" && this.right.is_boolean();
});
def(AST_Seq, function(){
return this.cdr.is_boolean();
});
def(AST_True, function(){ return true });
def(AST_False, function(){ return true });
})(function(node, func){
node.DEFMETHOD("is_boolean", func);
});
// methods to determine if an expression has a string result type
(function (def){
def(AST_Node, function(){ return false });
def(AST_String, function(){ return true });
def(AST_UnaryPrefix, function(){
return this.operator == "typeof";
});
def(AST_Binary, function(compressor){
return this.operator == "+" &&
(this.left.is_string(compressor) || this.right.is_string(compressor));
});
def(AST_Assign, function(compressor){
return (this.operator == "=" || this.operator == "+=") && this.right.is_string(compressor);
});
def(AST_Seq, function(compressor){
return this.cdr.is_string(compressor);
});
def(AST_Conditional, function(compressor){
return this.consequent.is_string(compressor) && this.alternative.is_string(compressor);
});
def(AST_Call, function(compressor){
return compressor.option("unsafe")
&& this.expression instanceof AST_SymbolRef
&& this.expression.name == "String"
&& this.expression.undeclared();
});
})(function(node, func){
node.DEFMETHOD("is_string", func);
});
function best_of(ast1, ast2) {
return ast1.print_to_string().length >
ast2.print_to_string().length
? ast2 : ast1;
};
// methods to evaluate a constant expression
(function (def){
// The evaluate method returns an array with one or two
// elements. If the node has been successfully reduced to a
// constant, then the second element tells us the value;
// otherwise the second element is missing. The first element
// of the array is always an AST_Node descendant; if
// evaluation was successful it's a node that represents the
// constant; otherwise it's the original or a replacement node.
AST_Node.DEFMETHOD("evaluate", function(compressor){
if (!compressor.option("evaluate")) return [ this ];
try {
var val = this._eval(compressor);
return [ best_of(make_node_from_constant(compressor, val, this), this), val ];
} catch(ex) {
if (ex !== def) throw ex;
return [ this ];
}
});
def(AST_Statement, function(){
throw new Error(string_template("Cannot evaluate a statement [{file}:{line},{col}]", this.start));
});
def(AST_Function, function(){
// XXX: AST_Function inherits from AST_Scope, which itself
// inherits from AST_Statement; however, an AST_Function
// isn't really a statement. This could byte in other
// places too. :-( Wish JS had multiple inheritance.
throw def;
});
function ev(node, compressor) {
if (!compressor) throw new Error("Compressor must be passed");
return node._eval(compressor);
};
def(AST_Node, function(){
throw def; // not constant
});
def(AST_Constant, function(){
return this.getValue();
});
def(AST_UnaryPrefix, function(compressor){
var e = this.expression;
switch (this.operator) {
case "!": return !ev(e, compressor);
case "typeof":
// Function would be evaluated to an array and so typeof would
// incorrectly return 'object'. Hence making is a special case.
if (e instanceof AST_Function) return typeof function(){};
e = ev(e, compressor);
// typeof <RegExp> returns "object" or "function" on different platforms
// so cannot evaluate reliably
if (e instanceof RegExp) throw def;
return typeof e;
case "void": return void ev(e, compressor);
case "~": return ~ev(e, compressor);
case "-":
e = ev(e, compressor);
if (e === 0) throw def;
return -e;
case "+": return +ev(e, compressor);
}
throw def;
});
def(AST_Binary, function(c){
var left = this.left, right = this.right;
switch (this.operator) {
case "&&" : return ev(left, c) && ev(right, c);
case "||" : return ev(left, c) || ev(right, c);
case "|" : return ev(left, c) | ev(right, c);
case "&" : return ev(left, c) & ev(right, c);
case "^" : return ev(left, c) ^ ev(right, c);
case "+" : return ev(left, c) + ev(right, c);
case "*" : return ev(left, c) * ev(right, c);
case "/" : return ev(left, c) / ev(right, c);
case "%" : return ev(left, c) % ev(right, c);
case "-" : return ev(left, c) - ev(right, c);
case "<<" : return ev(left, c) << ev(right, c);
case ">>" : return ev(left, c) >> ev(right, c);
case ">>>" : return ev(left, c) >>> ev(right, c);
case "==" : return ev(left, c) == ev(right, c);
case "===" : return ev(left, c) === ev(right, c);
case "!=" : return ev(left, c) != ev(right, c);
case "!==" : return ev(left, c) !== ev(right, c);
case "<" : return ev(left, c) < ev(right, c);
case "<=" : return ev(left, c) <= ev(right, c);
case ">" : return ev(left, c) > ev(right, c);
case ">=" : return ev(left, c) >= ev(right, c);
case "in" : return ev(left, c) in ev(right, c);
case "instanceof" : return ev(left, c) instanceof ev(right, c);
}
throw def;
});
def(AST_Conditional, function(compressor){
return ev(this.condition, compressor)
? ev(this.consequent, compressor)
: ev(this.alternative, compressor);
});
def(AST_SymbolRef, function(compressor){
var d = this.definition();
if (d && d.constant && d.init) return ev(d.init, compressor);
throw def;
});
})(function(node, func){
node.DEFMETHOD("_eval", func);
});
// method to negate an expression
(function(def){
function basic_negation(exp) {
return make_node(AST_UnaryPrefix, exp, {
operator: "!",
expression: exp
});
};
def(AST_Node, function(){
return basic_negation(this);
});
def(AST_Statement, function(){
throw new Error("Cannot negate a statement");
});
def(AST_Function, function(){
return basic_negation(this);
});
def(AST_UnaryPrefix, function(){
if (this.operator == "!")
return this.expression;
return basic_negation(this);
});
def(AST_Seq, function(compressor){
var self = this.clone();
self.cdr = self.cdr.negate(compressor);
return self;
});
def(AST_Conditional, function(compressor){
var self = this.clone();
self.consequent = self.consequent.negate(compressor);
self.alternative = self.alternative.negate(compressor);
return best_of(basic_negation(this), self);
});
def(AST_Binary, function(compressor){
var self = this.clone(), op = this.operator;
if (compressor.option("unsafe_comps")) {
switch (op) {
case "<=" : self.operator = ">" ; return self;
case "<" : self.operator = ">=" ; return self;
case ">=" : self.operator = "<" ; return self;
case ">" : self.operator = "<=" ; return self;
}
}
switch (op) {
case "==" : self.operator = "!="; return self;
case "!=" : self.operator = "=="; return self;
case "===": self.operator = "!=="; return self;
case "!==": self.operator = "==="; return self;
case "&&":
self.operator = "||";
self.left = self.left.negate(compressor);
self.right = self.right.negate(compressor);
return best_of(basic_negation(this), self);
case "||":
self.operator = "&&";
self.left = self.left.negate(compressor);
self.right = self.right.negate(compressor);
return best_of(basic_negation(this), self);
}
return basic_negation(this);
});
})(function(node, func){
node.DEFMETHOD("negate", function(compressor){
return func.call(this, compressor);
});
});
// determine if expression has side effects
(function(def){
def(AST_Node, function(compressor){ return true });
def(AST_EmptyStatement, function(compressor){ return false });
def(AST_Constant, function(compressor){ return false });
def(AST_This, function(compressor){ return false });
def(AST_Call, function(compressor){
var pure = compressor.option("pure_funcs");
if (!pure) return true;
return pure.indexOf(this.expression.print_to_string()) < 0;
});
def(AST_Block, function(compressor){
for (var i = this.body.length; --i >= 0;) {
if (this.body[i].has_side_effects(compressor))
return true;
}
return false;
});
def(AST_SimpleStatement, function(compressor){
return this.body.has_side_effects(compressor);
});
def(AST_Defun, function(compressor){ return true });
def(AST_Function, function(compressor){ return false });
def(AST_Binary, function(compressor){
return this.left.has_side_effects(compressor)
|| this.right.has_side_effects(compressor);
});
def(AST_Assign, function(compressor){ return true });
def(AST_Conditional, function(compressor){
return this.condition.has_side_effects(compressor)
|| this.consequent.has_side_effects(compressor)
|| this.alternative.has_side_effects(compressor);
});
def(AST_Unary, function(compressor){
return this.operator == "delete"
|| this.operator == "++"
|| this.operator == "--"
|| this.expression.has_side_effects(compressor);
});
def(AST_SymbolRef, function(compressor){ return false });
def(AST_Object, function(compressor){
for (var i = this.properties.length; --i >= 0;)
if (this.properties[i].has_side_effects(compressor))
return true;
return false;
});
def(AST_ObjectProperty, function(compressor){
return this.value.has_side_effects(compressor);
});
def(AST_Array, function(compressor){
for (var i = this.elements.length; --i >= 0;)
if (this.elements[i].has_side_effects(compressor))
return true;
return false;
});
def(AST_Dot, function(compressor){
if (!compressor.option("pure_getters")) return true;
return this.expression.has_side_effects(compressor);
});
def(AST_Sub, function(compressor){
if (!compressor.option("pure_getters")) return true;
return this.expression.has_side_effects(compressor)
|| this.property.has_side_effects(compressor);
});
def(AST_PropAccess, function(compressor){
return !compressor.option("pure_getters");
});
def(AST_Seq, function(compressor){
return this.car.has_side_effects(compressor)
|| this.cdr.has_side_effects(compressor);
});
})(function(node, func){
node.DEFMETHOD("has_side_effects", func);
});
// tell me if a statement aborts
function aborts(thing) {
return thing && thing.aborts();
};
(function(def){
def(AST_Statement, function(){ return null });
def(AST_Jump, function(){ return this });
function block_aborts(){
var n = this.body.length;
return n > 0 && aborts(this.body[n - 1]);
};
def(AST_BlockStatement, block_aborts);
def(AST_SwitchBranch, block_aborts);
def(AST_If, function(){
return this.alternative && aborts(this.body) && aborts(this.alternative);
});
})(function(node, func){
node.DEFMETHOD("aborts", func);
});
/* -----[ optimizers ]----- */
OPT(AST_Directive, function(self, compressor){
if (self.scope.has_directive(self.value) !== self.scope) {
return make_node(AST_EmptyStatement, self);
}
return self;
});
OPT(AST_Debugger, function(self, compressor){
if (compressor.option("drop_debugger"))
return make_node(AST_EmptyStatement, self);
return self;
});
OPT(AST_LabeledStatement, function(self, compressor){
if (self.body instanceof AST_Break
&& compressor.loopcontrol_target(self.body.label) === self.body) {
return make_node(AST_EmptyStatement, self);
}
return self.label.references.length == 0 ? self.body : self;
});
OPT(AST_Block, function(self, compressor){
self.body = tighten_body(self.body, compressor);
return self;
});
OPT(AST_BlockStatement, function(self, compressor){
self.body = tighten_body(self.body, compressor);
switch (self.body.length) {
case 1: return self.body[0];
case 0: return make_node(AST_EmptyStatement, self);
}
return self;
});
AST_Scope.DEFMETHOD("drop_unused", function(compressor){
var self = this;
if (compressor.option("unused")
&& !(self instanceof AST_Toplevel)
&& !self.uses_eval
) {
var in_use = [];
var initializations = new Dictionary();
// pass 1: find out which symbols are directly used in
// this scope (not in nested scopes).
var scope = this;
var tw = new TreeWalker(function(node, descend){
if (node !== self) {
if (node instanceof AST_Defun) {
initializations.add(node.name.name, node);
return true; // don't go in nested scopes
}
if (node instanceof AST_Definitions && scope === self) {
node.definitions.forEach(function(def){
if (def.value) {
initializations.add(def.name.name, def.value);
if (def.value.has_side_effects(compressor)) {
def.value.walk(tw);
}
}
});
return true;
}
if (node instanceof AST_SymbolRef) {
push_uniq(in_use, node.definition());
return true;
}
if (node instanceof AST_Scope) {
var save_scope = scope;
scope = node;
descend();
scope = save_scope;
return true;
}
}
});
self.walk(tw);
// pass 2: for every used symbol we need to walk its
// initialization code to figure out if it uses other
// symbols (that may not be in_use).
for (var i = 0; i < in_use.length; ++i) {
in_use[i].orig.forEach(function(decl){
// undeclared globals will be instanceof AST_SymbolRef
var init = initializations.get(decl.name);
if (init) init.forEach(function(init){
var tw = new TreeWalker(function(node){
if (node instanceof AST_SymbolRef) {
push_uniq(in_use, node.definition());
}
});
init.walk(tw);
});
});
}
// pass 3: we should drop declarations not in_use
var tt = new TreeTransformer(
function before(node, descend, in_list) {
if (node instanceof AST_Lambda && !(node instanceof AST_Accessor)) {
for (var a = node.argnames, i = a.length; --i >= 0;) {
var sym = a[i];
if (sym.unreferenced()) {
a.pop();
compressor.warn("Dropping unused function argument {name} [{file}:{line},{col}]", {
name : sym.name,
file : sym.start.file,
line : sym.start.line,
col : sym.start.col
});
}
else break;
}
}
if (node instanceof AST_Defun && node !== self) {
if (!member(node.name.definition(), in_use)) {
compressor.warn("Dropping unused function {name} [{file}:{line},{col}]", {
name : node.name.name,
file : node.name.start.file,
line : node.name.start.line,
col : node.name.start.col
});
return make_node(AST_EmptyStatement, node);
}
return node;
}
if (node instanceof AST_Definitions && !(tt.parent() instanceof AST_ForIn)) {
var def = node.definitions.filter(function(def){
if (member(def.name.definition(), in_use)) return true;
var w = {
name : def.name.name,
file : def.name.start.file,
line : def.name.start.line,
col : def.name.start.col
};
if (def.value && def.value.has_side_effects(compressor)) {
def._unused_side_effects = true;
compressor.warn("Side effects in initialization of unused variable {name} [{file}:{line},{col}]", w);
return true;
}
compressor.warn("Dropping unused variable {name} [{file}:{line},{col}]", w);
return false;
});
// place uninitialized names at the start
def = mergeSort(def, function(a, b){
if (!a.value && b.value) return -1;
if (!b.value && a.value) return 1;
return 0;
});
// for unused names whose initialization has
// side effects, we can cascade the init. code
// into the next one, or next statement.
var side_effects = [];
for (var i = 0; i < def.length;) {
var x = def[i];
if (x._unused_side_effects) {
side_effects.push(x.value);
def.splice(i, 1);
} else {
if (side_effects.length > 0) {
side_effects.push(x.value);
x.value = AST_Seq.from_array(side_effects);
side_effects = [];
}
++i;
}
}
if (side_effects.length > 0) {
side_effects = make_node(AST_BlockStatement, node, {
body: [ make_node(AST_SimpleStatement, node, {
body: AST_Seq.from_array(side_effects)
}) ]
});
} else {
side_effects = null;
}
if (def.length == 0 && !side_effects) {
return make_node(AST_EmptyStatement, node);
}
if (def.length == 0) {
return side_effects;
}
node.definitions = def;
if (side_effects) {
side_effects.body.unshift(node);
node = side_effects;
}
return node;
}
if (node instanceof AST_For) {
descend(node, this);
if (node.init instanceof AST_BlockStatement) {
// certain combination of unused name + side effect leads to:
// https://github.com/mishoo/UglifyJS2/issues/44
// that's an invalid AST.
// We fix it at this stage by moving the `var` outside the `for`.
var body = node.init.body.slice(0, -1);
node.init = node.init.body.slice(-1)[0].body;
body.push(node);
return in_list ? MAP.splice(body) : make_node(AST_BlockStatement, node, {
body: body
});
}
}
if (node instanceof AST_Scope && node !== self)
return node;
}
);
self.transform(tt);
}
});
AST_Scope.DEFMETHOD("hoist_declarations", function(compressor){
var hoist_funs = compressor.option("hoist_funs");
var hoist_vars = compressor.option("hoist_vars");
var self = this;
if (hoist_funs || hoist_vars) {
var dirs = [];
var hoisted = [];
var vars = new Dictionary(), vars_found = 0, var_decl = 0;
// let's count var_decl first, we seem to waste a lot of
// space if we hoist `var` when there's only one.
self.walk(new TreeWalker(function(node){
if (node instanceof AST_Scope && node !== self)
return true;
if (node instanceof AST_Var) {
++var_decl;
return true;
}
}));
hoist_vars = hoist_vars && var_decl > 1;
var tt = new TreeTransformer(
function before(node) {
if (node !== self) {
if (node instanceof AST_Directive) {
dirs.push(node);
return make_node(AST_EmptyStatement, node);
}
if (node instanceof AST_Defun && hoist_funs) {
hoisted.push(node);
return make_node(AST_EmptyStatement, node);
}
if (node instanceof AST_Var && hoist_vars) {
node.definitions.forEach(function(def){
vars.set(def.name.name, def);
++vars_found;
});
var seq = node.to_assignments();
var p = tt.parent();
if (p instanceof AST_ForIn && p.init === node) {
if (seq == null) return node.definitions[0].name;
return seq;
}
if (p instanceof AST_For && p.init === node) {
return seq;
}
if (!seq) return make_node(AST_EmptyStatement, node);
return make_node(AST_SimpleStatement, node, {
body: seq
});
}
if (node instanceof AST_Scope)
return node; // to avoid descending in nested scopes
}
}
);
self = self.transform(tt);
if (vars_found > 0) {
// collect only vars which don't show up in self's arguments list
var defs = [];
vars.each(function(def, name){
if (self instanceof AST_Lambda
&& find_if(function(x){ return x.name == def.name.name },
self.argnames)) {
vars.del(name);
} else {
def = def.clone();
def.value = null;
defs.push(def);
vars.set(name, def);
}
});
if (defs.length > 0) {
// try to merge in assignments
for (var i = 0; i < self.body.length;) {
if (self.body[i] instanceof AST_SimpleStatement) {
var expr = self.body[i].body, sym, assign;
if (expr instanceof AST_Assign
&& expr.operator == "="
&& (sym = expr.left) instanceof AST_Symbol
&& vars.has(sym.name))
{
var def = vars.get(sym.name);
if (def.value) break;
def.value = expr.right;
remove(defs, def);
defs.push(def);
self.body.splice(i, 1);
continue;
}
if (expr instanceof AST_Seq
&& (assign = expr.car) instanceof AST_Assign
&& assign.operator == "="
&& (sym = assign.left) instanceof AST_Symbol
&& vars.has(sym.name))
{
var def = vars.get(sym.name);
if (def.value) break;
def.value = assign.right;
remove(defs, def);
defs.push(def);
self.body[i].body = expr.cdr;
continue;
}
}
if (self.body[i] instanceof AST_EmptyStatement) {
self.body.splice(i, 1);
continue;
}
if (self.body[i] instanceof AST_BlockStatement) {
var tmp = [ i, 1 ].concat(self.body[i].body);
self.body.splice.apply(self.body, tmp);
continue;
}
break;
}
defs = make_node(AST_Var, self, {
definitions: defs
});
hoisted.push(defs);
};
}
self.body = dirs.concat(hoisted, self.body);
}
return self;
});
OPT(AST_SimpleStatement, function(self, compressor){
if (compressor.option("side_effects")) {
if (!self.body.has_side_effects(compressor)) {
compressor.warn("Dropping side-effect-free statement [{file}:{line},{col}]", self.start);
return make_node(AST_EmptyStatement, self);
}
}
return self;
});
OPT(AST_DWLoop, function(self, compressor){
var cond = self.condition.evaluate(compressor);
self.condition = cond[0];
if (!compressor.option("loops")) return self;
if (cond.length > 1) {
if (cond[1]) {
return make_node(AST_For, self, {
body: self.body
});
} else if (self instanceof AST_While) {
if (compressor.option("dead_code")) {
var a = [];
extract_declarations_from_unreachable_code(compressor, self.body, a);
return make_node(AST_BlockStatement, self, { body: a });
}
}
}
return self;
});
function if_break_in_loop(self, compressor) {
function drop_it(rest) {
rest = as_statement_array(rest);
if (self.body instanceof AST_BlockStatement) {
self.body = self.body.clone();
self.body.body = rest.concat(self.body.body.slice(1));
self.body = self.body.transform(compressor);
} else {
self.body = make_node(AST_BlockStatement, self.body, {
body: rest
}).transform(compressor);
}
if_break_in_loop(self, compressor);
}
var first = self.body instanceof AST_BlockStatement ? self.body.body[0] : self.body;
if (first instanceof AST_If) {
if (first.body instanceof AST_Break
&& compressor.loopcontrol_target(first.body.label) === self) {
if (self.condition) {
self.condition = make_node(AST_Binary, self.condition, {
left: self.condition,
operator: "&&",
right: first.condition.negate(compressor),
});
} else {
self.condition = first.condition.negate(compressor);
}
drop_it(first.alternative);
}
else if (first.alternative instanceof AST_Break
&& compressor.loopcontrol_target(first.alternative.label) === self) {
if (self.condition) {
self.condition = make_node(AST_Binary, self.condition, {
left: self.condition,
operator: "&&",
right: first.condition,
});
} else {
self.condition = first.condition;
}
drop_it(first.body);
}
}
};
OPT(AST_While, function(self, compressor) {
if (!compressor.option("loops")) return self;
self = AST_DWLoop.prototype.optimize.call(self, compressor);
if (self instanceof AST_While) {
if_break_in_loop(self, compressor);
self = make_node(AST_For, self, self).transform(compressor);
}
return self;
});
OPT(AST_For, function(self, compressor){
var cond = self.condition;
if (cond) {
cond = cond.evaluate(compressor);
self.condition = cond[0];
}
if (!compressor.option("loops")) return self;
if (cond) {
if (cond.length > 1 && !cond[1]) {
if (compressor.option("dead_code")) {
var a = [];
if (self.init instanceof AST_Statement) {
a.push(self.init);
}
else if (self.init) {
a.push(make_node(AST_SimpleStatement, self.init, {
body: self.init
}));
}
extract_declarations_from_unreachable_code(compressor, self.body, a);
return make_node(AST_BlockStatement, self, { body: a });
}
}
}
if_break_in_loop(self, compressor);
return self;
});
OPT(AST_If, function(self, compressor){
if (!compressor.option("conditionals")) return self;
// if condition can be statically determined, warn and drop
// one of the blocks. note, statically determined implies
// “has no side effects”; also it doesn't work for cases like
// `x && true`, though it probably should.
var cond = self.condition.evaluate(compressor);
self.condition = cond[0];
if (cond.length > 1) {
if (cond[1]) {
compressor.warn("Condition always true [{file}:{line},{col}]", self.condition.start);
if (compressor.option("dead_code")) {
var a = [];
if (self.alternative) {
extract_declarations_from_unreachable_code(compressor, self.alternative, a);
}
a.push(self.body);
return make_node(AST_BlockStatement, self, { body: a }).transform(compressor);
}
} else {
compressor.warn("Condition always false [{file}:{line},{col}]", self.condition.start);
if (compressor.option("dead_code")) {
var a = [];
extract_declarations_from_unreachable_code(compressor, self.body, a);
if (self.alternative) a.push(self.alternative);
return make_node(AST_BlockStatement, self, { body: a }).transform(compressor);
}
}
}
if (is_empty(self.alternative)) self.alternative = null;
var negated = self.condition.negate(compressor);
var negated_is_best = best_of(self.condition, negated) === negated;
if (self.alternative && negated_is_best) {
negated_is_best = false; // because we already do the switch here.
self.condition = negated;
var tmp = self.body;
self.body = self.alternative || make_node(AST_EmptyStatement);
self.alternative = tmp;
}
if (is_empty(self.body) && is_empty(self.alternative)) {
return make_node(AST_SimpleStatement, self.condition, {
body: self.condition
}).transform(compressor);
}
if (self.body instanceof AST_SimpleStatement
&& self.alternative instanceof AST_SimpleStatement) {
return make_node(AST_SimpleStatement, self, {
body: make_node(AST_Conditional, self, {
condition : self.condition,
consequent : self.body.body,
alternative : self.alternative.body
})
}).transform(compressor);
}
if (is_empty(self.alternative) && self.body instanceof AST_SimpleStatement) {
if (negated_is_best) return make_node(AST_SimpleStatement, self, {
body: make_node(AST_Binary, self, {
operator : "||",
left : negated,
right : self.body.body
})
}).transform(compressor);
return make_node(AST_SimpleStatement, self, {
body: make_node(AST_Binary, self, {
operator : "&&",
left : self.condition,
right : self.body.body
})
}).transform(compressor);
}
if (self.body instanceof AST_EmptyStatement
&& self.alternative
&& self.alternative instanceof AST_SimpleStatement) {
return make_node(AST_SimpleStatement, self, {
body: make_node(AST_Binary, self, {
operator : "||",
left : self.condition,
right : self.alternative.body
})
}).transform(compressor);
}
if (self.body instanceof AST_Exit
&& self.alternative instanceof AST_Exit
&& self.body.TYPE == self.alternative.TYPE) {
return make_node(self.body.CTOR, self, {
value: make_node(AST_Conditional, self, {
condition : self.condition,
consequent : self.body.value || make_node(AST_Undefined, self.body).optimize(compressor),
alternative : self.alternative.value || make_node(AST_Undefined, self.alternative).optimize(compressor)
})
}).transform(compressor);
}
if (self.body instanceof AST_If
&& !self.body.alternative
&& !self.alternative) {
self.condition = make_node(AST_Binary, self.condition, {
operator: "&&",
left: self.condition,
right: self.body.condition
}).transform(compressor);
self.body = self.body.body;
}
if (aborts(self.body)) {
if (self.alternative) {
var alt = self.alternative;
self.alternative = null;
return make_node(AST_BlockStatement, self, {
body: [ self, alt ]
}).transform(compressor);
}
}
if (aborts(self.alternative)) {
var body = self.body;
self.body = self.alternative;
self.condition = negated_is_best ? negated : self.condition.negate(compressor);
self.alternative = null;
return make_node(AST_BlockStatement, self, {
body: [ self, body ]
}).transform(compressor);
}
return self;
});
OPT(AST_Switch, function(self, compressor){
if (self.body.length == 0 && compressor.option("conditionals")) {
return make_node(AST_SimpleStatement, self, {
body: self.expression
}).transform(compressor);
}
for(;;) {
var last_branch = self.body[self.body.length - 1];
if (last_branch) {
var stat = last_branch.body[last_branch.body.length - 1]; // last statement
if (stat instanceof AST_Break && loop_body(compressor.loopcontrol_target(stat.label)) === self)
last_branch.body.pop();
if (last_branch instanceof AST_Default && last_branch.body.length == 0) {
self.body.pop();
continue;
}
}
break;
}
var exp = self.expression.evaluate(compressor);
out: if (exp.length == 2) try {
// constant expression
self.expression = exp[0];
if (!compressor.option("dead_code")) break out;
var value = exp[1];
var in_if = false;
var in_block = false;
var started = false;
var stopped = false;
var ruined = false;
var tt = new TreeTransformer(function(node, descend, in_list){
if (node instanceof AST_Lambda || node instanceof AST_SimpleStatement) {
// no need to descend these node types
return node;
}
else if (node instanceof AST_Switch && node === self) {
node = node.clone();
descend(node, this);
return ruined ? node : make_node(AST_BlockStatement, node, {
body: node.body.reduce(function(a, branch){
return a.concat(branch.body);
}, [])
}).transform(compressor);
}
else if (node instanceof AST_If || node instanceof AST_Try) {
var save = in_if;
in_if = !in_block;
descend(node, this);
in_if = save;
return node;
}
else if (node instanceof AST_StatementWithBody || node instanceof AST_Switch) {
var save = in_block;
in_block = true;
descend(node, this);
in_block = save;
return node;
}
else if (node instanceof AST_Break && this.loopcontrol_target(node.label) === self) {
if (in_if) {
ruined = true;
return node;
}
if (in_block) return node;
stopped = true;
return in_list ? MAP.skip : make_node(AST_EmptyStatement, node);
}
else if (node instanceof AST_SwitchBranch && this.parent() === self) {
if (stopped) return MAP.skip;
if (node instanceof AST_Case) {
var exp = node.expression.evaluate(compressor);
if (exp.length < 2) {
// got a case with non-constant expression, baling out
throw self;
}
if (exp[1] === value || started) {
started = true;
if (aborts(node)) stopped = true;
descend(node, this);
return node;
}
return MAP.skip;
}
descend(node, this);
return node;
}
});
tt.stack = compressor.stack.slice(); // so that's able to see parent nodes
self = self.transform(tt);
} catch(ex) {
if (ex !== self) throw ex;
}
return self;
});
OPT(AST_Case, function(self, compressor){
self.body = tighten_body(self.body, compressor);
return self;
});
OPT(AST_Try, function(self, compressor){
self.body = tighten_body(self.body, compressor);
return self;
});
AST_Definitions.DEFMETHOD("remove_initializers", function(){
this.definitions.forEach(function(def){ def.value = null });
});
AST_Definitions.DEFMETHOD("to_assignments", function(){
var assignments = this.definitions.reduce(function(a, def){
if (def.value) {
var name = make_node(AST_SymbolRef, def.name, def.name);
a.push(make_node(AST_Assign, def, {
operator : "=",
left : name,
right : def.value
}));
}
return a;
}, []);
if (assignments.length == 0) return null;
return AST_Seq.from_array(assignments);
});
OPT(AST_Definitions, function(self, compressor){
if (self.definitions.length == 0)
return make_node(AST_EmptyStatement, self);
return self;
});
OPT(AST_Function, function(self, compressor){
self = AST_Lambda.prototype.optimize.call(self, compressor);
if (compressor.option("unused")) {
if (self.name && self.name.unreferenced()) {
self.name = null;
}
}
return self;
});
OPT(AST_Call, function(self, compressor){
if (compressor.option("unsafe")) {
var exp = self.expression;
if (exp instanceof AST_SymbolRef && exp.undeclared()) {
switch (exp.name) {
case "Array":
if (self.args.length != 1) {
return make_node(AST_Array, self, {
elements: self.args
}).transform(compressor);
}
break;
case "Object":
if (self.args.length == 0) {
return make_node(AST_Object, self, {
properties: []
});
}
break;
case "String":
if (self.args.length == 0) return make_node(AST_String, self, {
value: ""
});
if (self.args.length <= 1) return make_node(AST_Binary, self, {
left: self.args[0],
operator: "+",
right: make_node(AST_String, self, { value: "" })
}).transform(compressor);
break;
case "Number":
if (self.args.length == 0) return make_node(AST_Number, self, {
value: 0
});
if (self.args.length == 1) return make_node(AST_UnaryPrefix, self, {
expression: self.args[0],
operator: "+"
}).transform(compressor);
case "Boolean":
if (self.args.length == 0) return make_node(AST_False, self);
if (self.args.length == 1) return make_node(AST_UnaryPrefix, self, {
expression: make_node(AST_UnaryPrefix, null, {
expression: self.args[0],
operator: "!"
}),
operator: "!"
}).transform(compressor);
break;
case "Function":
if (all(self.args, function(x){ return x instanceof AST_String })) {
// quite a corner-case, but we can handle it:
// https://github.com/mishoo/UglifyJS2/issues/203
// if the code argument is a constant, then we can minify it.
try {
var code = "(function(" + self.args.slice(0, -1).map(function(arg){
return arg.value;
}).join(",") + "){" + self.args[self.args.length - 1].value + "})()";
var ast = parse(code);
ast.figure_out_scope({ screw_ie8: compressor.option("screw_ie8") });
var comp = new Compressor(compressor.options);
ast = ast.transform(comp);
ast.figure_out_scope({ screw_ie8: compressor.option("screw_ie8") });
ast.mangle_names();
var fun;
try {
ast.walk(new TreeWalker(function(node){
if (node instanceof AST_Lambda) {
fun = node;
throw ast;
}
}));
} catch(ex) {
if (ex !== ast) throw ex;
};
var args = fun.argnames.map(function(arg, i){
return make_node(AST_String, self.args[i], {
value: arg.print_to_string()
});
});
var code = OutputStream();
AST_BlockStatement.prototype._codegen.call(fun, fun, code);
code = code.toString().replace(/^\{|\}$/g, "");
args.push(make_node(AST_String, self.args[self.args.length - 1], {
value: code
}));
self.args = args;
return self;
} catch(ex) {
if (ex instanceof JS_Parse_Error) {
compressor.warn("Error parsing code passed to new Function [{file}:{line},{col}]", self.args[self.args.length - 1].start);
compressor.warn(ex.toString());
} else {
console.log(ex);
throw ex;
}
}
}
break;
}
}
else if (exp instanceof AST_Dot && exp.property == "toString" && self.args.length == 0) {
return make_node(AST_Binary, self, {
left: make_node(AST_String, self, { value: "" }),
operator: "+",
right: exp.expression
}).transform(compressor);
}
else if (exp instanceof AST_Dot && exp.expression instanceof AST_Array && exp.property == "join") EXIT: {
var separator = self.args.length == 0 ? "," : self.args[0].evaluate(compressor)[1];
if (separator == null) break EXIT; // not a constant
var elements = exp.expression.elements.reduce(function(a, el){
el = el.evaluate(compressor);
if (a.length == 0 || el.length == 1) {
a.push(el);
} else {
var last = a[a.length - 1];
if (last.length == 2) {
// it's a constant
var val = "" + last[1] + separator + el[1];
a[a.length - 1] = [ make_node_from_constant(compressor, val, last[0]), val ];
} else {
a.push(el);
}
}
return a;
}, []);
if (elements.length == 0) return make_node(AST_String, self, { value: "" });
if (elements.length == 1) return elements[0][0];
if (separator == "") {
var first;
if (elements[0][0] instanceof AST_String
|| elements[1][0] instanceof AST_String) {
first = elements.shift()[0];
} else {
first = make_node(AST_String, self, { value: "" });
}
return elements.reduce(function(prev, el){
return make_node(AST_Binary, el[0], {
operator : "+",
left : prev,
right : el[0],
});
}, first).transform(compressor);
}
// need this awkward cloning to not affect original element
// best_of will decide which one to get through.
var node = self.clone();
node.expression = node.expression.clone();
node.expression.expression = node.expression.expression.clone();
node.expression.expression.elements = elements.map(function(el){
return el[0];
});
return best_of(self, node);
}
}
if (compressor.option("side_effects")) {
if (self.expression instanceof AST_Function
&& self.args.length == 0
&& !AST_Block.prototype.has_side_effects.call(self.expression, compressor)) {
return make_node(AST_Undefined, self).transform(compressor);
}
}
if (compressor.option("drop_console")) {
if (self.expression instanceof AST_PropAccess &&
self.expression.expression instanceof AST_SymbolRef &&
self.expression.expression.name == "console" &&
self.expression.expression.undeclared()) {
return make_node(AST_Undefined, self).transform(compressor);
}
}
return self.evaluate(compressor)[0];
});
OPT(AST_New, function(self, compressor){
if (compressor.option("unsafe")) {
var exp = self.expression;
if (exp instanceof AST_SymbolRef && exp.undeclared()) {
switch (exp.name) {
case "Object":
case "RegExp":
case "Function":
case "Error":
case "Array":
return make_node(AST_Call, self, self).transform(compressor);
}
}
}
return self;
});
OPT(AST_Seq, function(self, compressor){
if (!compressor.option("side_effects"))
return self;
if (!self.car.has_side_effects(compressor)) {
// we shouldn't compress (1,eval)(something) to
// eval(something) because that changes the meaning of
// eval (becomes lexical instead of global).
var p;
if (!(self.cdr instanceof AST_SymbolRef
&& self.cdr.name == "eval"
&& self.cdr.undeclared()
&& (p = compressor.parent()) instanceof AST_Call
&& p.expression === self)) {
return self.cdr;
}
}
if (compressor.option("cascade")) {
if (self.car instanceof AST_Assign
&& !self.car.left.has_side_effects(compressor)) {
if (self.car.left.equivalent_to(self.cdr)) {
return self.car;
}
if (self.cdr instanceof AST_Call
&& self.cdr.expression.equivalent_to(self.car.left)) {
self.cdr.expression = self.car;
return self.cdr;
}
}
if (!self.car.has_side_effects(compressor)
&& !self.cdr.has_side_effects(compressor)
&& self.car.equivalent_to(self.cdr)) {
return self.car;
}
}
return self;
});
AST_Unary.DEFMETHOD("lift_sequences", function(compressor){
if (compressor.option("sequences")) {
if (this.expression instanceof AST_Seq) {
var seq = this.expression;
var x = seq.to_array();
this.expression = x.pop();
x.push(this);
seq = AST_Seq.from_array(x).transform(compressor);
return seq;
}
}
return this;
});
OPT(AST_UnaryPostfix, function(self, compressor){
return self.lift_sequences(compressor);
});
OPT(AST_UnaryPrefix, function(self, compressor){
self = self.lift_sequences(compressor);
var e = self.expression;
if (compressor.option("booleans") && compressor.in_boolean_context()) {
switch (self.operator) {
case "!":
if (e instanceof AST_UnaryPrefix && e.operator == "!") {
// !!foo ==> foo, if we're in boolean context
return e.expression;
}
break;
case "typeof":
// typeof always returns a non-empty string, thus it's
// always true in booleans
compressor.warn("Boolean expression always true [{file}:{line},{col}]", self.start);
return make_node(AST_True, self);
}
if (e instanceof AST_Binary && self.operator == "!") {
self = best_of(self, e.negate(compressor));
}
}
return self.evaluate(compressor)[0];
});
function has_side_effects_or_prop_access(node, compressor) {
var save_pure_getters = compressor.option("pure_getters");
compressor.options.pure_getters = false;
var ret = node.has_side_effects(compressor);
compressor.options.pure_getters = save_pure_getters;
return ret;
}
AST_Binary.DEFMETHOD("lift_sequences", function(compressor){
if (compressor.option("sequences")) {
if (this.left instanceof AST_Seq) {
var seq = this.left;
var x = seq.to_array();
this.left = x.pop();
x.push(this);
seq = AST_Seq.from_array(x).transform(compressor);
return seq;
}
if (this.right instanceof AST_Seq
&& this instanceof AST_Assign
&& !has_side_effects_or_prop_access(this.left, compressor)) {
var seq = this.right;
var x = seq.to_array();
this.right = x.pop();
x.push(this);
seq = AST_Seq.from_array(x).transform(compressor);
return seq;
}
}
return this;
});
var commutativeOperators = makePredicate("== === != !== * & | ^");
OPT(AST_Binary, function(self, compressor){
var reverse = compressor.has_directive("use asm") ? noop
: function(op, force) {
if (force || !(self.left.has_side_effects(compressor) || self.right.has_side_effects(compressor))) {
if (op) self.operator = op;
var tmp = self.left;
self.left = self.right;
self.right = tmp;
}
};
if (commutativeOperators(self.operator)) {
if (self.right instanceof AST_Constant
&& !(self.left instanceof AST_Constant)) {
// if right is a constant, whatever side effects the
// left side might have could not influence the
// result. hence, force switch.
if (!(self.left instanceof AST_Binary
&& PRECEDENCE[self.left.operator] >= PRECEDENCE[self.operator])) {
reverse(null, true);
}
}
if (/^[!=]==?$/.test(self.operator)) {
if (self.left instanceof AST_SymbolRef && self.right instanceof AST_Conditional) {
if (self.right.consequent instanceof AST_SymbolRef
&& self.right.consequent.definition() === self.left.definition()) {
if (/^==/.test(self.operator)) return self.right.condition;
if (/^!=/.test(self.operator)) return self.right.condition.negate(compressor);
}
if (self.right.alternative instanceof AST_SymbolRef
&& self.right.alternative.definition() === self.left.definition()) {
if (/^==/.test(self.operator)) return self.right.condition.negate(compressor);
if (/^!=/.test(self.operator)) return self.right.condition;
}
}
if (self.right instanceof AST_SymbolRef && self.left instanceof AST_Conditional) {
if (self.left.consequent instanceof AST_SymbolRef
&& self.left.consequent.definition() === self.right.definition()) {
if (/^==/.test(self.operator)) return self.left.condition;
if (/^!=/.test(self.operator)) return self.left.condition.negate(compressor);
}
if (self.left.alternative instanceof AST_SymbolRef
&& self.left.alternative.definition() === self.right.definition()) {
if (/^==/.test(self.operator)) return self.left.condition.negate(compressor);
if (/^!=/.test(self.operator)) return self.left.condition;
}
}
}
}
self = self.lift_sequences(compressor);
if (compressor.option("comparisons")) switch (self.operator) {
case "===":
case "!==":
if ((self.left.is_string(compressor) && self.right.is_string(compressor)) ||
(self.left.is_boolean() && self.right.is_boolean())) {
self.operator = self.operator.substr(0, 2);
}
// XXX: intentionally falling down to the next case
case "==":
case "!=":
if (self.left instanceof AST_String
&& self.left.value == "undefined"
&& self.right instanceof AST_UnaryPrefix
&& self.right.operator == "typeof"
&& compressor.option("unsafe")) {
if (!(self.right.expression instanceof AST_SymbolRef)
|| !self.right.expression.undeclared()) {
self.right = self.right.expression;
self.left = make_node(AST_Undefined, self.left).optimize(compressor);
if (self.operator.length == 2) self.operator += "=";
}
}
break;
}
if (compressor.option("booleans") && compressor.in_boolean_context()) switch (self.operator) {
case "&&":
var ll = self.left.evaluate(compressor);
var rr = self.right.evaluate(compressor);
if ((ll.length > 1 && !ll[1]) || (rr.length > 1 && !rr[1])) {
compressor.warn("Boolean && always false [{file}:{line},{col}]", self.start);
return make_node(AST_False, self);
}
if (ll.length > 1 && ll[1]) {
return rr[0];
}
if (rr.length > 1 && rr[1]) {
return ll[0];
}
break;
case "||":
var ll = self.left.evaluate(compressor);
var rr = self.right.evaluate(compressor);
if ((ll.length > 1 && ll[1]) || (rr.length > 1 && rr[1])) {
compressor.warn("Boolean || always true [{file}:{line},{col}]", self.start);
return make_node(AST_True, self);
}
if (ll.length > 1 && !ll[1]) {
return rr[0];
}
if (rr.length > 1 && !rr[1]) {
return ll[0];
}
break;
case "+":
var ll = self.left.evaluate(compressor);
var rr = self.right.evaluate(compressor);
if ((ll.length > 1 && ll[0] instanceof AST_String && ll[1]) ||
(rr.length > 1 && rr[0] instanceof AST_String && rr[1])) {
compressor.warn("+ in boolean context always true [{file}:{line},{col}]", self.start);
return make_node(AST_True, self);
}
break;
}
if (compressor.option("comparisons")) {
if (!(compressor.parent() instanceof AST_Binary)
|| compressor.parent() instanceof AST_Assign) {
var negated = make_node(AST_UnaryPrefix, self, {
operator: "!",
expression: self.negate(compressor)
});
self = best_of(self, negated);
}
switch (self.operator) {
case "<": reverse(">"); break;
case "<=": reverse(">="); break;
}
}
if (self.operator == "+" && self.right instanceof AST_String
&& self.right.getValue() === "" && self.left instanceof AST_Binary
&& self.left.operator == "+" && self.left.is_string(compressor)) {
return self.left;
}
if (compressor.option("evaluate")) {
if (self.operator == "+") {
if (self.left instanceof AST_Constant
&& self.right instanceof AST_Binary
&& self.right.operator == "+"
&& self.right.left instanceof AST_Constant
&& self.right.is_string(compressor)) {
self = make_node(AST_Binary, self, {
operator: "+",
left: make_node(AST_String, null, {
value: "" + self.left.getValue() + self.right.left.getValue(),
start: self.left.start,
end: self.right.left.end
}),
right: self.right.right
});
}
if (self.right instanceof AST_Constant
&& self.left instanceof AST_Binary
&& self.left.operator == "+"
&& self.left.right instanceof AST_Constant
&& self.left.is_string(compressor)) {
self = make_node(AST_Binary, self, {
operator: "+",
left: self.left.left,
right: make_node(AST_String, null, {
value: "" + self.left.right.getValue() + self.right.getValue(),
start: self.left.right.start,
end: self.right.end
})
});
}
if (self.left instanceof AST_Binary
&& self.left.operator == "+"
&& self.left.is_string(compressor)
&& self.left.right instanceof AST_Constant
&& self.right instanceof AST_Binary
&& self.right.operator == "+"
&& self.right.left instanceof AST_Constant
&& self.right.is_string(compressor)) {
self = make_node(AST_Binary, self, {
operator: "+",
left: make_node(AST_Binary, self.left, {
operator: "+",
left: self.left.left,
right: make_node(AST_String, null, {
value: "" + self.left.right.getValue() + self.right.left.getValue(),
start: self.left.right.start,
end: self.right.left.end
})
}),
right: self.right.right
});
}
}
}
// x * (y * z) ==> x * y * z
if (self.right instanceof AST_Binary
&& self.right.operator == self.operator
&& (self.operator == "*" || self.operator == "&&" || self.operator == "||"))
{
self.left = make_node(AST_Binary, self.left, {
operator : self.operator,
left : self.left,
right : self.right.left
});
self.right = self.right.right;
return self.transform(compressor);
}
return self.evaluate(compressor)[0];
});
OPT(AST_SymbolRef, function(self, compressor){
if (self.undeclared()) {
var defines = compressor.option("global_defs");
if (defines && defines.hasOwnProperty(self.name)) {
return make_node_from_constant(compressor, defines[self.name], self);
}
switch (self.name) {
case "undefined":
return make_node(AST_Undefined, self);
case "NaN":
return make_node(AST_NaN, self);
case "Infinity":
return make_node(AST_Infinity, self);
}
}
return self;
});
OPT(AST_Undefined, function(self, compressor){
if (compressor.option("unsafe")) {
var scope = compressor.find_parent(AST_Scope);
var undef = scope.find_variable("undefined");
if (undef) {
var ref = make_node(AST_SymbolRef, self, {
name : "undefined",
scope : scope,
thedef : undef
});
ref.reference();
return ref;
}
}
return self;
});
var ASSIGN_OPS = [ '+', '-', '/', '*', '%', '>>', '<<', '>>>', '|', '^', '&' ];
OPT(AST_Assign, function(self, compressor){
self = self.lift_sequences(compressor);
if (self.operator == "="
&& self.left instanceof AST_SymbolRef
&& self.right instanceof AST_Binary
&& self.right.left instanceof AST_SymbolRef
&& self.right.left.name == self.left.name
&& member(self.right.operator, ASSIGN_OPS)) {
self.operator = self.right.operator + "=";
self.right = self.right.right;
}
return self;
});
OPT(AST_Conditional, function(self, compressor){
if (!compressor.option("conditionals")) return self;
if (self.condition instanceof AST_Seq) {
var car = self.condition.car;
self.condition = self.condition.cdr;
return AST_Seq.cons(car, self);
}
var cond = self.condition.evaluate(compressor);
if (cond.length > 1) {
if (cond[1]) {
compressor.warn("Condition always true [{file}:{line},{col}]", self.start);
return self.consequent;
} else {
compressor.warn("Condition always false [{file}:{line},{col}]", self.start);
return self.alternative;
}
}
var negated = cond[0].negate(compressor);
if (best_of(cond[0], negated) === negated) {
self = make_node(AST_Conditional, self, {
condition: negated,
consequent: self.alternative,
alternative: self.consequent
});
}
var consequent = self.consequent;
var alternative = self.alternative;
if (consequent instanceof AST_Assign
&& alternative instanceof AST_Assign
&& consequent.operator == alternative.operator
&& consequent.left.equivalent_to(alternative.left)
) {
/*
* Stuff like this:
* if (foo) exp = something; else exp = something_else;
* ==>
* exp = foo ? something : something_else;
*/
self = make_node(AST_Assign, self, {
operator: consequent.operator,
left: consequent.left,
right: make_node(AST_Conditional, self, {
condition: self.condition,
consequent: consequent.right,
alternative: alternative.right
})
});
}
return self;
});
OPT(AST_Boolean, function(self, compressor){
if (compressor.option("booleans")) {
var p = compressor.parent();
if (p instanceof AST_Binary && (p.operator == "=="
|| p.operator == "!=")) {
compressor.warn("Non-strict equality against boolean: {operator} {value} [{file}:{line},{col}]", {
operator : p.operator,
value : self.value,
file : p.start.file,
line : p.start.line,
col : p.start.col,
});
return make_node(AST_Number, self, {
value: +self.value
});
}
return make_node(AST_UnaryPrefix, self, {
operator: "!",
expression: make_node(AST_Number, self, {
value: 1 - self.value
})
});
}
return self;
});
OPT(AST_Sub, function(self, compressor){
var prop = self.property;
if (prop instanceof AST_String && compressor.option("properties")) {
prop = prop.getValue();
if (RESERVED_WORDS(prop) ? compressor.option("screw_ie8") : is_identifier_string(prop)) {
return make_node(AST_Dot, self, {
expression : self.expression,
property : prop
});
}
}
return self;
});
function literals_in_boolean_context(self, compressor) {
if (compressor.option("booleans") && compressor.in_boolean_context()) {
return make_node(AST_True, self);
}
return self;
};
OPT(AST_Array, literals_in_boolean_context);
OPT(AST_Object, literals_in_boolean_context);
OPT(AST_RegExp, literals_in_boolean_context);
})();
/***********************************************************************
A JavaScript tokenizer / parser / beautifier / compressor.
https://github.com/mishoo/UglifyJS2
-------------------------------- (C) ---------------------------------
Author: Mihai Bazon
<mihai.bazon@gmail.com>
http://mihai.bazon.net/blog
Distributed under the BSD license:
Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***********************************************************************/
"use strict";
// a small wrapper around fitzgen's source-map library
function SourceMap(options) {
options = defaults(options, {
file : null,
root : null,
orig : null,
orig_line_diff : 0,
dest_line_diff : 0,
});
var generator = new MOZ_SourceMap.SourceMapGenerator({
file : options.file,
sourceRoot : options.root
});
var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig);
function add(source, gen_line, gen_col, orig_line, orig_col, name) {
if (orig_map) {
var info = orig_map.originalPositionFor({
line: orig_line,
column: orig_col
});
source = info.source;
orig_line = info.line;
orig_col = info.column;
name = info.name;
}
generator.addMapping({
generated : { line: gen_line + options.dest_line_diff, column: gen_col },
original : { line: orig_line + options.orig_line_diff, column: orig_col },
source : source,
name : name
});
};
return {
add : add,
get : function() { return generator },
toString : function() { return generator.toString() }
};
};
/***********************************************************************
A JavaScript tokenizer / parser / beautifier / compressor.
https://github.com/mishoo/UglifyJS2
-------------------------------- (C) ---------------------------------
Author: Mihai Bazon
<mihai.bazon@gmail.com>
http://mihai.bazon.net/blog
Distributed under the BSD license:
Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***********************************************************************/
"use strict";
(function(){
var MOZ_TO_ME = {
TryStatement : function(M) {
return new AST_Try({
start : my_start_token(M),
end : my_end_token(M),
body : from_moz(M.block).body,
bcatch : from_moz(M.handlers[0]),
bfinally : M.finalizer ? new AST_Finally(from_moz(M.finalizer)) : null
});
},
CatchClause : function(M) {
return new AST_Catch({
start : my_start_token(M),
end : my_end_token(M),
argname : from_moz(M.param),
body : from_moz(M.body).body
});
},
ObjectExpression : function(M) {
return new AST_Object({
start : my_start_token(M),
end : my_end_token(M),
properties : M.properties.map(function(prop){
var key = prop.key;
var name = key.type == "Identifier" ? key.name : key.value;
var args = {
start : my_start_token(key),
end : my_end_token(prop.value),
key : name,
value : from_moz(prop.value)
};
switch (prop.kind) {
case "init":
return new AST_ObjectKeyVal(args);
case "set":
args.value.name = from_moz(key);
return new AST_ObjectSetter(args);
case "get":
args.value.name = from_moz(key);
return new AST_ObjectGetter(args);
}
})
});
},
SequenceExpression : function(M) {
return AST_Seq.from_array(M.expressions.map(from_moz));
},
MemberExpression : function(M) {
return new (M.computed ? AST_Sub : AST_Dot)({
start : my_start_token(M),
end : my_end_token(M),
property : M.computed ? from_moz(M.property) : M.property.name,
expression : from_moz(M.object)
});
},
SwitchCase : function(M) {
return new (M.test ? AST_Case : AST_Default)({
start : my_start_token(M),
end : my_end_token(M),
expression : from_moz(M.test),
body : M.consequent.map(from_moz)
});
},
Literal : function(M) {
var val = M.value, args = {
start : my_start_token(M),
end : my_end_token(M)
};
if (val === null) return new AST_Null(args);
switch (typeof val) {
case "string":
args.value = val;
return new AST_String(args);
case "number":
args.value = val;
return new AST_Number(args);
case "boolean":
return new (val ? AST_True : AST_False)(args);
default:
args.value = val;
return new AST_RegExp(args);
}
},
UnaryExpression: From_Moz_Unary,
UpdateExpression: From_Moz_Unary,
Identifier: function(M) {
var p = FROM_MOZ_STACK[FROM_MOZ_STACK.length - 2];
return new (M.name == "this" ? AST_This
: p.type == "LabeledStatement" ? AST_Label
: p.type == "VariableDeclarator" && p.id === M ? (p.kind == "const" ? AST_SymbolConst : AST_SymbolVar)
: p.type == "FunctionExpression" ? (p.id === M ? AST_SymbolLambda : AST_SymbolFunarg)
: p.type == "FunctionDeclaration" ? (p.id === M ? AST_SymbolDefun : AST_SymbolFunarg)
: p.type == "CatchClause" ? AST_SymbolCatch
: p.type == "BreakStatement" || p.type == "ContinueStatement" ? AST_LabelRef
: AST_SymbolRef)({
start : my_start_token(M),
end : my_end_token(M),
name : M.name
});
}
};
function From_Moz_Unary(M) {
var prefix = "prefix" in M ? M.prefix
: M.type == "UnaryExpression" ? true : false;
return new (prefix ? AST_UnaryPrefix : AST_UnaryPostfix)({
start : my_start_token(M),
end : my_end_token(M),
operator : M.operator,
expression : from_moz(M.argument)
});
};
var ME_TO_MOZ = {};
map("Node", AST_Node);
map("Program", AST_Toplevel, "body@body");
map("Function", AST_Function, "id>name, params@argnames, body%body");
map("EmptyStatement", AST_EmptyStatement);
map("BlockStatement", AST_BlockStatement, "body@body");
map("ExpressionStatement", AST_SimpleStatement, "expression>body");
map("IfStatement", AST_If, "test>condition, consequent>body, alternate>alternative");
map("LabeledStatement", AST_LabeledStatement, "label>label, body>body");
map("BreakStatement", AST_Break, "label>label");
map("ContinueStatement", AST_Continue, "label>label");
map("WithStatement", AST_With, "object>expression, body>body");
map("SwitchStatement", AST_Switch, "discriminant>expression, cases@body");
map("ReturnStatement", AST_Return, "argument>value");
map("ThrowStatement", AST_Throw, "argument>value");
map("WhileStatement", AST_While, "test>condition, body>body");
map("DoWhileStatement", AST_Do, "test>condition, body>body");
map("ForStatement", AST_For, "init>init, test>condition, update>step, body>body");
map("ForInStatement", AST_ForIn, "left>init, right>object, body>body");
map("DebuggerStatement", AST_Debugger);
map("FunctionDeclaration", AST_Defun, "id>name, params@argnames, body%body");
map("VariableDeclaration", AST_Var, "declarations@definitions");
map("VariableDeclarator", AST_VarDef, "id>name, init>value");
map("ThisExpression", AST_This);
map("ArrayExpression", AST_Array, "elements@elements");
map("FunctionExpression", AST_Function, "id>name, params@argnames, body%body");
map("BinaryExpression", AST_Binary, "operator=operator, left>left, right>right");
map("AssignmentExpression", AST_Assign, "operator=operator, left>left, right>right");
map("LogicalExpression", AST_Binary, "operator=operator, left>left, right>right");
map("ConditionalExpression", AST_Conditional, "test>condition, consequent>consequent, alternate>alternative");
map("NewExpression", AST_New, "callee>expression, arguments@args");
map("CallExpression", AST_Call, "callee>expression, arguments@args");
/* -----[ tools ]----- */
function my_start_token(moznode) {
return new AST_Token({
file : moznode.loc && moznode.loc.source,
line : moznode.loc && moznode.loc.start.line,
col : moznode.loc && moznode.loc.start.column,
pos : moznode.start,
endpos : moznode.start
});
};
function my_end_token(moznode) {
return new AST_Token({
file : moznode.loc && moznode.loc.source,
line : moznode.loc && moznode.loc.end.line,
col : moznode.loc && moznode.loc.end.column,
pos : moznode.end,
endpos : moznode.end
});
};
function map(moztype, mytype, propmap) {
var moz_to_me = "function From_Moz_" + moztype + "(M){\n";
moz_to_me += "return new mytype({\n" +
"start: my_start_token(M),\n" +
"end: my_end_token(M)";
if (propmap) propmap.split(/\s*,\s*/).forEach(function(prop){
var m = /([a-z0-9$_]+)(=|@|>|%)([a-z0-9$_]+)/i.exec(prop);
if (!m) throw new Error("Can't understand property map: " + prop);
var moz = "M." + m[1], how = m[2], my = m[3];
moz_to_me += ",\n" + my + ": ";
if (how == "@") {
moz_to_me += moz + ".map(from_moz)";
} else if (how == ">") {
moz_to_me += "from_moz(" + moz + ")";
} else if (how == "=") {
moz_to_me += moz;
} else if (how == "%") {
moz_to_me += "from_moz(" + moz + ").body";
} else throw new Error("Can't understand operator in propmap: " + prop);
});
moz_to_me += "\n})}";
// moz_to_me = parse(moz_to_me).print_to_string({ beautify: true });
// console.log(moz_to_me);
moz_to_me = new Function("mytype", "my_start_token", "my_end_token", "from_moz", "return(" + moz_to_me + ")")(
mytype, my_start_token, my_end_token, from_moz
);
return MOZ_TO_ME[moztype] = moz_to_me;
};
var FROM_MOZ_STACK = null;
function from_moz(node) {
FROM_MOZ_STACK.push(node);
var ret = node != null ? MOZ_TO_ME[node.type](node) : null;
FROM_MOZ_STACK.pop();
return ret;
};
AST_Node.from_mozilla_ast = function(node){
var save_stack = FROM_MOZ_STACK;
FROM_MOZ_STACK = [];
var ast = from_moz(node);
FROM_MOZ_STACK = save_stack;
return ast;
};
})();
exports.sys = sys;
exports.MOZ_SourceMap = MOZ_SourceMap;
exports.UglifyJS = UglifyJS;
exports.array_to_hash = array_to_hash;
exports.slice = slice;
exports.characters = characters;
exports.member = member;
exports.find_if = find_if;
exports.repeat_string = repeat_string;
exports.DefaultsError = DefaultsError;
exports.defaults = defaults;
exports.merge = merge;
exports.noop = noop;
exports.MAP = MAP;
exports.push_uniq = push_uniq;
exports.string_template = string_template;
exports.remove = remove;
exports.mergeSort = mergeSort;
exports.set_difference = set_difference;
exports.set_intersection = set_intersection;
exports.makePredicate = makePredicate;
exports.all = all;
exports.Dictionary = Dictionary;
exports.DEFNODE = DEFNODE;
exports.AST_Token = AST_Token;
exports.AST_Node = AST_Node;
exports.AST_Statement = AST_Statement;
exports.AST_Debugger = AST_Debugger;
exports.AST_Directive = AST_Directive;
exports.AST_SimpleStatement = AST_SimpleStatement;
exports.walk_body = walk_body;
exports.AST_Block = AST_Block;
exports.AST_BlockStatement = AST_BlockStatement;
exports.AST_EmptyStatement = AST_EmptyStatement;
exports.AST_StatementWithBody = AST_StatementWithBody;
exports.AST_LabeledStatement = AST_LabeledStatement;
exports.AST_IterationStatement = AST_IterationStatement;
exports.AST_DWLoop = AST_DWLoop;
exports.AST_Do = AST_Do;
exports.AST_While = AST_While;
exports.AST_For = AST_For;
exports.AST_ForIn = AST_ForIn;
exports.AST_With = AST_With;
exports.AST_Scope = AST_Scope;
exports.AST_Toplevel = AST_Toplevel;
exports.AST_Lambda = AST_Lambda;
exports.AST_Accessor = AST_Accessor;
exports.AST_Function = AST_Function;
exports.AST_Defun = AST_Defun;
exports.AST_Jump = AST_Jump;
exports.AST_Exit = AST_Exit;
exports.AST_Return = AST_Return;
exports.AST_Throw = AST_Throw;
exports.AST_LoopControl = AST_LoopControl;
exports.AST_Break = AST_Break;
exports.AST_Continue = AST_Continue;
exports.AST_If = AST_If;
exports.AST_Switch = AST_Switch;
exports.AST_SwitchBranch = AST_SwitchBranch;
exports.AST_Default = AST_Default;
exports.AST_Case = AST_Case;
exports.AST_Try = AST_Try;
exports.AST_Catch = AST_Catch;
exports.AST_Finally = AST_Finally;
exports.AST_Definitions = AST_Definitions;
exports.AST_Var = AST_Var;
exports.AST_Const = AST_Const;
exports.AST_VarDef = AST_VarDef;
exports.AST_Call = AST_Call;
exports.AST_New = AST_New;
exports.AST_Seq = AST_Seq;
exports.AST_PropAccess = AST_PropAccess;
exports.AST_Dot = AST_Dot;
exports.AST_Sub = AST_Sub;
exports.AST_Unary = AST_Unary;
exports.AST_UnaryPrefix = AST_UnaryPrefix;
exports.AST_UnaryPostfix = AST_UnaryPostfix;
exports.AST_Binary = AST_Binary;
exports.AST_Conditional = AST_Conditional;
exports.AST_Assign = AST_Assign;
exports.AST_Array = AST_Array;
exports.AST_Object = AST_Object;
exports.AST_ObjectProperty = AST_ObjectProperty;
exports.AST_ObjectKeyVal = AST_ObjectKeyVal;
exports.AST_ObjectSetter = AST_ObjectSetter;
exports.AST_ObjectGetter = AST_ObjectGetter;
exports.AST_Symbol = AST_Symbol;
exports.AST_SymbolAccessor = AST_SymbolAccessor;
exports.AST_SymbolDeclaration = AST_SymbolDeclaration;
exports.AST_SymbolVar = AST_SymbolVar;
exports.AST_SymbolConst = AST_SymbolConst;
exports.AST_SymbolFunarg = AST_SymbolFunarg;
exports.AST_SymbolDefun = AST_SymbolDefun;
exports.AST_SymbolLambda = AST_SymbolLambda;
exports.AST_SymbolCatch = AST_SymbolCatch;
exports.AST_Label = AST_Label;
exports.AST_SymbolRef = AST_SymbolRef;
exports.AST_LabelRef = AST_LabelRef;
exports.AST_This = AST_This;
exports.AST_Constant = AST_Constant;
exports.AST_String = AST_String;
exports.AST_Number = AST_Number;
exports.AST_RegExp = AST_RegExp;
exports.AST_Atom = AST_Atom;
exports.AST_Null = AST_Null;
exports.AST_NaN = AST_NaN;
exports.AST_Undefined = AST_Undefined;
exports.AST_Hole = AST_Hole;
exports.AST_Infinity = AST_Infinity;
exports.AST_Boolean = AST_Boolean;
exports.AST_False = AST_False;
exports.AST_True = AST_True;
exports.TreeWalker = TreeWalker;
exports.KEYWORDS = KEYWORDS;
exports.KEYWORDS_ATOM = KEYWORDS_ATOM;
exports.RESERVED_WORDS = RESERVED_WORDS;
exports.KEYWORDS_BEFORE_EXPRESSION = KEYWORDS_BEFORE_EXPRESSION;
exports.OPERATOR_CHARS = OPERATOR_CHARS;
exports.RE_HEX_NUMBER = RE_HEX_NUMBER;
exports.RE_OCT_NUMBER = RE_OCT_NUMBER;
exports.RE_DEC_NUMBER = RE_DEC_NUMBER;
exports.OPERATORS = OPERATORS;
exports.WHITESPACE_CHARS = WHITESPACE_CHARS;
exports.PUNC_BEFORE_EXPRESSION = PUNC_BEFORE_EXPRESSION;
exports.PUNC_CHARS = PUNC_CHARS;
exports.REGEXP_MODIFIERS = REGEXP_MODIFIERS;
exports.UNICODE = UNICODE;
exports.is_letter = is_letter;
exports.is_digit = is_digit;
exports.is_alphanumeric_char = is_alphanumeric_char;
exports.is_unicode_combining_mark = is_unicode_combining_mark;
exports.is_unicode_connector_punctuation = is_unicode_connector_punctuation;
exports.is_identifier = is_identifier;
exports.is_identifier_start = is_identifier_start;
exports.is_identifier_char = is_identifier_char;
exports.is_identifier_string = is_identifier_string;
exports.parse_js_number = parse_js_number;
exports.JS_Parse_Error = JS_Parse_Error;
exports.js_error = js_error;
exports.is_token = is_token;
exports.EX_EOF = EX_EOF;
exports.tokenizer = tokenizer;
exports.UNARY_PREFIX = UNARY_PREFIX;
exports.UNARY_POSTFIX = UNARY_POSTFIX;
exports.ASSIGNMENT = ASSIGNMENT;
exports.PRECEDENCE = PRECEDENCE;
exports.STATEMENTS_WITH_LABELS = STATEMENTS_WITH_LABELS;
exports.ATOMIC_START_TOKEN = ATOMIC_START_TOKEN;
exports.parse = parse;
exports.TreeTransformer = TreeTransformer;
exports.SymbolDef = SymbolDef;
exports.base54 = base54;
exports.OutputStream = OutputStream;
exports.Compressor = Compressor;
exports.SourceMap = SourceMap;
exports.AST_Node.warn_function = function (txt) { if (typeof console != "undefined" && typeof console.warn === "function") console.warn(txt) }
exports.minify = function (files, options) {
options = UglifyJS.defaults(options, {
outSourceMap : null,
sourceRoot : null,
inSourceMap : null,
fromString : false,
warnings : false,
mangle : {},
output : null,
compress : {}
});
if (typeof files == "string")
files = [ files ];
UglifyJS.base54.reset();
// 1. parse
var toplevel = null;
files.forEach(function(file){
var code = options.fromString
? file
: fs.readFileSync(file, "utf8");
toplevel = UglifyJS.parse(code, {
filename: options.fromString ? "?" : file,
toplevel: toplevel
});
});
// 2. compress
if (options.compress) {
var compress = { warnings: options.warnings };
UglifyJS.merge(compress, options.compress);
toplevel.figure_out_scope();
var sq = UglifyJS.Compressor(compress);
toplevel = toplevel.transform(sq);
}
// 3. mangle
if (options.mangle) {
toplevel.figure_out_scope();
toplevel.compute_char_frequency();
toplevel.mangle_names(options.mangle);
}
// 4. output
var inMap = options.inSourceMap;
var output = {};
if (typeof options.inSourceMap == "string") {
inMap = fs.readFileSync(options.inSourceMap, "utf8");
}
if (options.outSourceMap) {
output.source_map = UglifyJS.SourceMap({
file: options.outSourceMap,
orig: inMap,
root: options.sourceRoot
});
}
if (options.output) {
UglifyJS.merge(output, options.output);
}
var stream = UglifyJS.OutputStream(output);
toplevel.print(stream);
return {
code : stream + "",
map : output.source_map + ""
};
};
exports.describe_ast = function () {
var out = UglifyJS.OutputStream({ beautify: true });
function doitem(ctor) {
out.print("AST_" + ctor.TYPE);
var props = ctor.SELF_PROPS.filter(function(prop){
return !/^\$/.test(prop);
});
if (props.length > 0) {
out.space();
out.with_parens(function(){
props.forEach(function(prop, i){
if (i) out.space();
out.print(prop);
});
});
}
if (ctor.documentation) {
out.space();
out.print_string(ctor.documentation);
}
if (ctor.SUBCLASSES.length > 0) {
out.space();
out.with_block(function(){
ctor.SUBCLASSES.forEach(function(ctor, i){
out.indent();
doitem(ctor);
out.newline();
});
});
}
};
doitem(UglifyJS.AST_Node);
return out + "";
};
},{"source-map":35,"util":32}],46:[function(require,module,exports){
var uglify = require('uglify-js')
var globalVars = require('./vars')
module.exports = addWith
function addWith(obj, src, exclude, environments) {
environments = environments || ['reservedVars', 'ecmaIdentifiers', 'nonstandard', 'node']
exclude = exclude || []
exclude = exclude.concat(detect(obj))
var vars = detect('(function () {' + src + '}())')//allows the `return` keyword
.filter(function (v) {
for (var i = 0; i < environments.length; i++) {
if (v in globalVars[environments[i]]) {
return false;
}
}
return exclude.indexOf(v) === -1
})
if (vars.length === 0) return src
var declareLocal = ''
var local = 'locals'
if (/^[a-zA-Z0-9$_]+$/.test(obj)) {
local = obj
} else {
while (vars.indexOf(local) != -1 || exclude.indexOf(local) != -1) {
local += '_'
}
declareLocal = local + ' = (' + obj + '),'
}
return 'var ' + declareLocal + vars
.map(function (v) {
return v + ' = ' + local + '.' + v
}).join(',') + ';' + src
}
function detect(src) {
var ast = uglify.parse(src.toString())
ast.figure_out_scope()
var globals = ast.globals
.map(function (node, name) {
return name
})
return globals;
}
},{"./vars":58,"uglify-js":57}],47:[function(require,module,exports){
arguments[4][35][0].apply(exports,arguments)
},{"./source-map/source-map-consumer":52,"./source-map/source-map-generator":53,"./source-map/source-node":54}],48:[function(require,module,exports){
arguments[4][36][0].apply(exports,arguments)
},{"./util":55,"amdefine":56}],49:[function(require,module,exports){
arguments[4][37][0].apply(exports,arguments)
},{"./base64":50,"amdefine":56}],50:[function(require,module,exports){
arguments[4][38][0].apply(exports,arguments)
},{"amdefine":56}],51:[function(require,module,exports){
arguments[4][39][0].apply(exports,arguments)
},{"amdefine":56}],52:[function(require,module,exports){
arguments[4][40][0].apply(exports,arguments)
},{"./array-set":48,"./base64-vlq":49,"./binary-search":51,"./util":55,"amdefine":56}],53:[function(require,module,exports){
arguments[4][41][0].apply(exports,arguments)
},{"./array-set":48,"./base64-vlq":49,"./util":55,"amdefine":56}],54:[function(require,module,exports){
arguments[4][42][0].apply(exports,arguments)
},{"./source-map-generator":53,"./util":55,"amdefine":56}],55:[function(require,module,exports){
arguments[4][43][0].apply(exports,arguments)
},{"amdefine":56}],56:[function(require,module,exports){
var process=require("__browserify_process"),__filename="/../node_modules/with/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/amdefine.js";/** vim: et:ts=4:sw=4:sts=4
* @license amdefine 0.1.0 Copyright (c) 2011, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/amdefine for details
*/
/*jslint node: true */
/*global module, process */
'use strict';
/**
* Creates a define for node.
* @param {Object} module the "module" object that is defined by Node for the
* current module.
* @param {Function} [requireFn]. Node's require function for the current module.
* It only needs to be passed in Node versions before 0.5, when module.require
* did not exist.
* @returns {Function} a define function that is usable for the current node
* module.
*/
function amdefine(module, requireFn) {
'use strict';
var defineCache = {},
loaderCache = {},
alreadyCalled = false,
path = require('path'),
makeRequire, stringRequire;
/**
* Trims the . and .. from an array of path segments.
* It will keep a leading path segment if a .. will become
* the first path segment, to help with module name lookups,
* which act like paths, but can be remapped. But the end result,
* all paths that use this function should look normalized.
* NOTE: this method MODIFIES the input array.
* @param {Array} ary the array of path segments.
*/
function trimDots(ary) {
var i, part;
for (i = 0; ary[i]; i+= 1) {
part = ary[i];
if (part === '.') {
ary.splice(i, 1);
i -= 1;
} else if (part === '..') {
if (i === 1 && (ary[2] === '..' || ary[0] === '..')) {
//End of the line. Keep at least one non-dot
//path segment at the front so it can be mapped
//correctly to disk. Otherwise, there is likely
//no path mapping for a path starting with '..'.
//This can still fail, but catches the most reasonable
//uses of ..
break;
} else if (i > 0) {
ary.splice(i - 1, 2);
i -= 2;
}
}
}
}
function normalize(name, baseName) {
var baseParts;
//Adjust any relative paths.
if (name && name.charAt(0) === '.') {
//If have a base name, try to normalize against it,
//otherwise, assume it is a top-level require that will
//be relative to baseUrl in the end.
if (baseName) {
baseParts = baseName.split('/');
baseParts = baseParts.slice(0, baseParts.length - 1);
baseParts = baseParts.concat(name.split('/'));
trimDots(baseParts);
name = baseParts.join('/');
}
}
return name;
}
/**
* Create the normalize() function passed to a loader plugin's
* normalize method.
*/
function makeNormalize(relName) {
return function (name) {
return normalize(name, relName);
};
}
function makeLoad(id) {
function load(value) {
loaderCache[id] = value;
}
load.fromText = function (id, text) {
//This one is difficult because the text can/probably uses
//define, and any relative paths and requires should be relative
//to that id was it would be found on disk. But this would require
//bootstrapping a module/require fairly deeply from node core.
//Not sure how best to go about that yet.
throw new Error('amdefine does not implement load.fromText');
};
return load;
}
makeRequire = function (systemRequire, exports, module, relId) {
function amdRequire(deps, callback) {
if (typeof deps === 'string') {
//Synchronous, single module require('')
return stringRequire(systemRequire, exports, module, deps, relId);
} else {
//Array of dependencies with a callback.
//Convert the dependencies to modules.
deps = deps.map(function (depName) {
return stringRequire(systemRequire, exports, module, depName, relId);
});
//Wait for next tick to call back the require call.
process.nextTick(function () {
callback.apply(null, deps);
});
}
}
amdRequire.toUrl = function (filePath) {
if (filePath.indexOf('.') === 0) {
return normalize(filePath, path.dirname(module.filename));
} else {
return filePath;
}
};
return amdRequire;
};
//Favor explicit value, passed in if the module wants to support Node 0.4.
requireFn = requireFn || function req() {
return module.require.apply(module, arguments);
};
function runFactory(id, deps, factory) {
var r, e, m, result;
if (id) {
e = loaderCache[id] = {};
m = {
id: id,
uri: __filename,
exports: e
};
r = makeRequire(requireFn, e, m, id);
} else {
//Only support one define call per file
if (alreadyCalled) {
throw new Error('amdefine with no module ID cannot be called more than once per file.');
}
alreadyCalled = true;
//Use the real variables from node
//Use module.exports for exports, since
//the exports in here is amdefine exports.
e = module.exports;
m = module;
r = makeRequire(requireFn, e, m, module.id);
}
//If there are dependencies, they are strings, so need
//to convert them to dependency values.
if (deps) {
deps = deps.map(function (depName) {
return r(depName);
});
}
//Call the factory with the right dependencies.
if (typeof factory === 'function') {
result = factory.apply(m.exports, deps);
} else {
result = factory;
}
if (result !== undefined) {
m.exports = result;
if (id) {
loaderCache[id] = m.exports;
}
}
}
stringRequire = function (systemRequire, exports, module, id, relId) {
//Split the ID by a ! so that
var index = id.indexOf('!'),
originalId = id,
prefix, plugin;
if (index === -1) {
id = normalize(id, relId);
//Straight module lookup. If it is one of the special dependencies,
//deal with it, otherwise, delegate to node.
if (id === 'require') {
return makeRequire(systemRequire, exports, module, relId);
} else if (id === 'exports') {
return exports;
} else if (id === 'module') {
return module;
} else if (loaderCache.hasOwnProperty(id)) {
return loaderCache[id];
} else if (defineCache[id]) {
runFactory.apply(null, defineCache[id]);
return loaderCache[id];
} else {
if(systemRequire) {
return systemRequire(originalId);
} else {
throw new Error('No module with ID: ' + id);
}
}
} else {
//There is a plugin in play.
prefix = id.substring(0, index);
id = id.substring(index + 1, id.length);
plugin = stringRequire(systemRequire, exports, module, prefix, relId);
if (plugin.normalize) {
id = plugin.normalize(id, makeNormalize(relId));
} else {
//Normalize the ID normally.
id = normalize(id, relId);
}
if (loaderCache[id]) {
return loaderCache[id];
} else {
plugin.load(id, makeRequire(systemRequire, exports, module, relId), makeLoad(id), {});
return loaderCache[id];
}
}
};
//Create a define function specific to the module asking for amdefine.
function define(id, deps, factory) {
if (Array.isArray(id)) {
factory = deps;
deps = id;
id = undefined;
} else if (typeof id !== 'string') {
factory = id;
id = deps = undefined;
}
if (deps && !Array.isArray(deps)) {
factory = deps;
deps = undefined;
}
if (!deps) {
deps = ['require', 'exports', 'module'];
}
//Set up properties for this module. If an ID, then use
//internal cache. If no ID, then use the external variables
//for this node module.
if (id) {
//Put the module in deep freeze until there is a
//require call for it.
defineCache[id] = [id, deps, factory];
} else {
runFactory(id, deps, factory);
}
}
//define.require, which has access to all the values in the
//cache. Useful for AMD modules that all have IDs in the file,
//but need to finally export a value to node based on one of those
//IDs.
define.require = function (id) {
if (loaderCache[id]) {
return loaderCache[id];
}
if (defineCache[id]) {
runFactory.apply(null, defineCache[id]);
return loaderCache[id];
}
};
define.amd = {};
return define;
}
module.exports = amdefine;
},{"__browserify_process":29,"path":30}],57:[function(require,module,exports){
var sys = require("util");
var MOZ_SourceMap = require("source-map");
var UglifyJS = exports;
/***********************************************************************
A JavaScript tokenizer / parser / beautifier / compressor.
https://github.com/mishoo/UglifyJS2
-------------------------------- (C) ---------------------------------
Author: Mihai Bazon
<mihai.bazon@gmail.com>
http://mihai.bazon.net/blog
Distributed under the BSD license:
Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***********************************************************************/
"use strict";
function array_to_hash(a) {
var ret = Object.create(null);
for (var i = 0; i < a.length; ++i)
ret[a[i]] = true;
return ret;
};
function slice(a, start) {
return Array.prototype.slice.call(a, start || 0);
};
function characters(str) {
return str.split("");
};
function member(name, array) {
for (var i = array.length; --i >= 0;)
if (array[i] == name)
return true;
return false;
};
function find_if(func, array) {
for (var i = 0, n = array.length; i < n; ++i) {
if (func(array[i]))
return array[i];
}
};
function repeat_string(str, i) {
if (i <= 0) return "";
if (i == 1) return str;
var d = repeat_string(str, i >> 1);
d += d;
if (i & 1) d += str;
return d;
};
function DefaultsError(msg, defs) {
this.msg = msg;
this.defs = defs;
};
function defaults(args, defs, croak) {
if (args === true)
args = {};
var ret = args || {};
if (croak) for (var i in ret) if (ret.hasOwnProperty(i) && !defs.hasOwnProperty(i))
throw new DefaultsError("`" + i + "` is not a supported option", defs);
for (var i in defs) if (defs.hasOwnProperty(i)) {
ret[i] = (args && args.hasOwnProperty(i)) ? args[i] : defs[i];
}
return ret;
};
function merge(obj, ext) {
for (var i in ext) if (ext.hasOwnProperty(i)) {
obj[i] = ext[i];
}
return obj;
};
function noop() {};
var MAP = (function(){
function MAP(a, f, backwards) {
var ret = [], top = [], i;
function doit() {
var val = f(a[i], i);
var is_last = val instanceof Last;
if (is_last) val = val.v;
if (val instanceof AtTop) {
val = val.v;
if (val instanceof Splice) {
top.push.apply(top, backwards ? val.v.slice().reverse() : val.v);
} else {
top.push(val);
}
}
else if (val !== skip) {
if (val instanceof Splice) {
ret.push.apply(ret, backwards ? val.v.slice().reverse() : val.v);
} else {
ret.push(val);
}
}
return is_last;
};
if (a instanceof Array) {
if (backwards) {
for (i = a.length; --i >= 0;) if (doit()) break;
ret.reverse();
top.reverse();
} else {
for (i = 0; i < a.length; ++i) if (doit()) break;
}
}
else {
for (i in a) if (a.hasOwnProperty(i)) if (doit()) break;
}
return top.concat(ret);
};
MAP.at_top = function(val) { return new AtTop(val) };
MAP.splice = function(val) { return new Splice(val) };
MAP.last = function(val) { return new Last(val) };
var skip = MAP.skip = {};
function AtTop(val) { this.v = val };
function Splice(val) { this.v = val };
function Last(val) { this.v = val };
return MAP;
})();
function push_uniq(array, el) {
if (array.indexOf(el) < 0)
array.push(el);
};
function string_template(text, props) {
return text.replace(/\{(.+?)\}/g, function(str, p){
return props[p];
});
};
function remove(array, el) {
for (var i = array.length; --i >= 0;) {
if (array[i] === el) array.splice(i, 1);
}
};
function mergeSort(array, cmp) {
if (array.length < 2) return array.slice();
function merge(a, b) {
var r = [], ai = 0, bi = 0, i = 0;
while (ai < a.length && bi < b.length) {
cmp(a[ai], b[bi]) <= 0
? r[i++] = a[ai++]
: r[i++] = b[bi++];
}
if (ai < a.length) r.push.apply(r, a.slice(ai));
if (bi < b.length) r.push.apply(r, b.slice(bi));
return r;
};
function _ms(a) {
if (a.length <= 1)
return a;
var m = Math.floor(a.length / 2), left = a.slice(0, m), right = a.slice(m);
left = _ms(left);
right = _ms(right);
return merge(left, right);
};
return _ms(array);
};
function set_difference(a, b) {
return a.filter(function(el){
return b.indexOf(el) < 0;
});
};
function set_intersection(a, b) {
return a.filter(function(el){
return b.indexOf(el) >= 0;
});
};
// this function is taken from Acorn [1], written by Marijn Haverbeke
// [1] https://github.com/marijnh/acorn
function makePredicate(words) {
if (!(words instanceof Array)) words = words.split(" ");
var f = "", cats = [];
out: for (var i = 0; i < words.length; ++i) {
for (var j = 0; j < cats.length; ++j)
if (cats[j][0].length == words[i].length) {
cats[j].push(words[i]);
continue out;
}
cats.push([words[i]]);
}
function compareTo(arr) {
if (arr.length == 1) return f += "return str === " + JSON.stringify(arr[0]) + ";";
f += "switch(str){";
for (var i = 0; i < arr.length; ++i) f += "case " + JSON.stringify(arr[i]) + ":";
f += "return true}return false;";
}
// When there are more than three length categories, an outer
// switch first dispatches on the lengths, to save on comparisons.
if (cats.length > 3) {
cats.sort(function(a, b) {return b.length - a.length;});
f += "switch(str.length){";
for (var i = 0; i < cats.length; ++i) {
var cat = cats[i];
f += "case " + cat[0].length + ":";
compareTo(cat);
}
f += "}";
// Otherwise, simply generate a flat `switch` statement.
} else {
compareTo(words);
}
return new Function("str", f);
};
function all(array, predicate) {
for (var i = array.length; --i >= 0;)
if (!predicate(array[i]))
return false;
return true;
};
function Dictionary() {
this._values = Object.create(null);
this._size = 0;
};
Dictionary.prototype = {
set: function(key, val) {
if (!this.has(key)) ++this._size;
this._values["$" + key] = val;
return this;
},
add: function(key, val) {
if (this.has(key)) {
this.get(key).push(val);
} else {
this.set(key, [ val ]);
}
return this;
},
get: function(key) { return this._values["$" + key] },
del: function(key) {
if (this.has(key)) {
--this._size;
delete this._values["$" + key];
}
return this;
},
has: function(key) { return ("$" + key) in this._values },
each: function(f) {
for (var i in this._values)
f(this._values[i], i.substr(1));
},
size: function() {
return this._size;
},
map: function(f) {
var ret = [];
for (var i in this._values)
ret.push(f(this._values[i], i.substr(1)));
return ret;
}
};
/***********************************************************************
A JavaScript tokenizer / parser / beautifier / compressor.
https://github.com/mishoo/UglifyJS2
-------------------------------- (C) ---------------------------------
Author: Mihai Bazon
<mihai.bazon@gmail.com>
http://mihai.bazon.net/blog
Distributed under the BSD license:
Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***********************************************************************/
"use strict";
function DEFNODE(type, props, methods, base) {
if (arguments.length < 4) base = AST_Node;
if (!props) props = [];
else props = props.split(/\s+/);
var self_props = props;
if (base && base.PROPS)
props = props.concat(base.PROPS);
var code = "return function AST_" + type + "(props){ if (props) { ";
for (var i = props.length; --i >= 0;) {
code += "this." + props[i] + " = props." + props[i] + ";";
}
var proto = base && new base;
if (proto && proto.initialize || (methods && methods.initialize))
code += "this.initialize();";
code += "}}";
var ctor = new Function(code)();
if (proto) {
ctor.prototype = proto;
ctor.BASE = base;
}
if (base) base.SUBCLASSES.push(ctor);
ctor.prototype.CTOR = ctor;
ctor.PROPS = props || null;
ctor.SELF_PROPS = self_props;
ctor.SUBCLASSES = [];
if (type) {
ctor.prototype.TYPE = ctor.TYPE = type;
}
if (methods) for (i in methods) if (methods.hasOwnProperty(i)) {
if (/^\$/.test(i)) {
ctor[i.substr(1)] = methods[i];
} else {
ctor.prototype[i] = methods[i];
}
}
ctor.DEFMETHOD = function(name, method) {
this.prototype[name] = method;
};
return ctor;
};
var AST_Token = DEFNODE("Token", "type value line col pos endpos nlb comments_before file", {
}, null);
var AST_Node = DEFNODE("Node", "start end", {
clone: function() {
return new this.CTOR(this);
},
$documentation: "Base class of all AST nodes",
$propdoc: {
start: "[AST_Token] The first token of this node",
end: "[AST_Token] The last token of this node"
},
_walk: function(visitor) {
return visitor._visit(this);
},
walk: function(visitor) {
return this._walk(visitor); // not sure the indirection will be any help
}
}, null);
AST_Node.warn_function = null;
AST_Node.warn = function(txt, props) {
if (AST_Node.warn_function)
AST_Node.warn_function(string_template(txt, props));
};
/* -----[ statements ]----- */
var AST_Statement = DEFNODE("Statement", null, {
$documentation: "Base class of all statements",
});
var AST_Debugger = DEFNODE("Debugger", null, {
$documentation: "Represents a debugger statement",
}, AST_Statement);
var AST_Directive = DEFNODE("Directive", "value scope", {
$documentation: "Represents a directive, like \"use strict\";",
$propdoc: {
value: "[string] The value of this directive as a plain string (it's not an AST_String!)",
scope: "[AST_Scope/S] The scope that this directive affects"
},
}, AST_Statement);
var AST_SimpleStatement = DEFNODE("SimpleStatement", "body", {
$documentation: "A statement consisting of an expression, i.e. a = 1 + 2",
$propdoc: {
body: "[AST_Node] an expression node (should not be instanceof AST_Statement)"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.body._walk(visitor);
});
}
}, AST_Statement);
function walk_body(node, visitor) {
if (node.body instanceof AST_Statement) {
node.body._walk(visitor);
}
else node.body.forEach(function(stat){
stat._walk(visitor);
});
};
var AST_Block = DEFNODE("Block", "body", {
$documentation: "A body of statements (usually bracketed)",
$propdoc: {
body: "[AST_Statement*] an array of statements"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
walk_body(this, visitor);
});
}
}, AST_Statement);
var AST_BlockStatement = DEFNODE("BlockStatement", null, {
$documentation: "A block statement",
}, AST_Block);
var AST_EmptyStatement = DEFNODE("EmptyStatement", null, {
$documentation: "The empty statement (empty block or simply a semicolon)",
_walk: function(visitor) {
return visitor._visit(this);
}
}, AST_Statement);
var AST_StatementWithBody = DEFNODE("StatementWithBody", "body", {
$documentation: "Base class for all statements that contain one nested body: `For`, `ForIn`, `Do`, `While`, `With`",
$propdoc: {
body: "[AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.body._walk(visitor);
});
}
}, AST_Statement);
var AST_LabeledStatement = DEFNODE("LabeledStatement", "label", {
$documentation: "Statement with a label",
$propdoc: {
label: "[AST_Label] a label definition"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.label._walk(visitor);
this.body._walk(visitor);
});
}
}, AST_StatementWithBody);
var AST_DWLoop = DEFNODE("DWLoop", "condition", {
$documentation: "Base class for do/while statements",
$propdoc: {
condition: "[AST_Node] the loop condition. Should not be instanceof AST_Statement"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.condition._walk(visitor);
this.body._walk(visitor);
});
}
}, AST_StatementWithBody);
var AST_Do = DEFNODE("Do", null, {
$documentation: "A `do` statement",
}, AST_DWLoop);
var AST_While = DEFNODE("While", null, {
$documentation: "A `while` statement",
}, AST_DWLoop);
var AST_For = DEFNODE("For", "init condition step", {
$documentation: "A `for` statement",
$propdoc: {
init: "[AST_Node?] the `for` initialization code, or null if empty",
condition: "[AST_Node?] the `for` termination clause, or null if empty",
step: "[AST_Node?] the `for` update clause, or null if empty"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
if (this.init) this.init._walk(visitor);
if (this.condition) this.condition._walk(visitor);
if (this.step) this.step._walk(visitor);
this.body._walk(visitor);
});
}
}, AST_StatementWithBody);
var AST_ForIn = DEFNODE("ForIn", "init name object", {
$documentation: "A `for ... in` statement",
$propdoc: {
init: "[AST_Node] the `for/in` initialization code",
name: "[AST_SymbolRef?] the loop variable, only if `init` is AST_Var",
object: "[AST_Node] the object that we're looping through"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.init._walk(visitor);
this.object._walk(visitor);
this.body._walk(visitor);
});
}
}, AST_StatementWithBody);
var AST_With = DEFNODE("With", "expression", {
$documentation: "A `with` statement",
$propdoc: {
expression: "[AST_Node] the `with` expression"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.expression._walk(visitor);
this.body._walk(visitor);
});
}
}, AST_StatementWithBody);
/* -----[ scope and functions ]----- */
var AST_Scope = DEFNODE("Scope", "directives variables functions uses_with uses_eval parent_scope enclosed cname", {
$documentation: "Base class for all statements introducing a lexical scope",
$propdoc: {
directives: "[string*/S] an array of directives declared in this scope",
variables: "[Object/S] a map of name -> SymbolDef for all variables/functions defined in this scope",
functions: "[Object/S] like `variables`, but only lists function declarations",
uses_with: "[boolean/S] tells whether this scope uses the `with` statement",
uses_eval: "[boolean/S] tells whether this scope contains a direct call to the global `eval`",
parent_scope: "[AST_Scope?/S] link to the parent scope",
enclosed: "[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes",
cname: "[integer/S] current index for mangling variables (used internally by the mangler)",
},
}, AST_Block);
var AST_Toplevel = DEFNODE("Toplevel", "globals", {
$documentation: "The toplevel scope",
$propdoc: {
globals: "[Object/S] a map of name -> SymbolDef for all undeclared names",
},
wrap_enclose: function(arg_parameter_pairs) {
var self = this;
var args = [];
var parameters = [];
arg_parameter_pairs.forEach(function(pair) {
var split = pair.split(":");
args.push(split[0]);
parameters.push(split[1]);
});
var wrapped_tl = "(function(" + parameters.join(",") + "){ '$ORIG'; })(" + args.join(",") + ")";
wrapped_tl = parse(wrapped_tl);
wrapped_tl = wrapped_tl.transform(new TreeTransformer(function before(node){
if (node instanceof AST_Directive && node.value == "$ORIG") {
return MAP.splice(self.body);
}
}));
return wrapped_tl;
},
wrap_commonjs: function(name, export_all) {
var self = this;
var to_export = [];
if (export_all) {
self.figure_out_scope();
self.walk(new TreeWalker(function(node){
if (node instanceof AST_SymbolDeclaration && node.definition().global) {
if (!find_if(function(n){ return n.name == node.name }, to_export))
to_export.push(node);
}
}));
}
var wrapped_tl = "(function(exports, global){ global['" + name + "'] = exports; '$ORIG'; '$EXPORTS'; }({}, (function(){return this}())))";
wrapped_tl = parse(wrapped_tl);
wrapped_tl = wrapped_tl.transform(new TreeTransformer(function before(node){
if (node instanceof AST_SimpleStatement) {
node = node.body;
if (node instanceof AST_String) switch (node.getValue()) {
case "$ORIG":
return MAP.splice(self.body);
case "$EXPORTS":
var body = [];
to_export.forEach(function(sym){
body.push(new AST_SimpleStatement({
body: new AST_Assign({
left: new AST_Sub({
expression: new AST_SymbolRef({ name: "exports" }),
property: new AST_String({ value: sym.name }),
}),
operator: "=",
right: new AST_SymbolRef(sym),
}),
}));
});
return MAP.splice(body);
}
}
}));
return wrapped_tl;
}
}, AST_Scope);
var AST_Lambda = DEFNODE("Lambda", "name argnames uses_arguments", {
$documentation: "Base class for functions",
$propdoc: {
name: "[AST_SymbolDeclaration?] the name of this function",
argnames: "[AST_SymbolFunarg*] array of function arguments",
uses_arguments: "[boolean/S] tells whether this function accesses the arguments array"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
if (this.name) this.name._walk(visitor);
this.argnames.forEach(function(arg){
arg._walk(visitor);
});
walk_body(this, visitor);
});
}
}, AST_Scope);
var AST_Accessor = DEFNODE("Accessor", null, {
$documentation: "A setter/getter function"
}, AST_Lambda);
var AST_Function = DEFNODE("Function", null, {
$documentation: "A function expression"
}, AST_Lambda);
var AST_Defun = DEFNODE("Defun", null, {
$documentation: "A function definition"
}, AST_Lambda);
/* -----[ JUMPS ]----- */
var AST_Jump = DEFNODE("Jump", null, {
$documentation: "Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)"
}, AST_Statement);
var AST_Exit = DEFNODE("Exit", "value", {
$documentation: "Base class for “exits” (`return` and `throw`)",
$propdoc: {
value: "[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return"
},
_walk: function(visitor) {
return visitor._visit(this, this.value && function(){
this.value._walk(visitor);
});
}
}, AST_Jump);
var AST_Return = DEFNODE("Return", null, {
$documentation: "A `return` statement"
}, AST_Exit);
var AST_Throw = DEFNODE("Throw", null, {
$documentation: "A `throw` statement"
}, AST_Exit);
var AST_LoopControl = DEFNODE("LoopControl", "label", {
$documentation: "Base class for loop control statements (`break` and `continue`)",
$propdoc: {
label: "[AST_LabelRef?] the label, or null if none",
},
_walk: function(visitor) {
return visitor._visit(this, this.label && function(){
this.label._walk(visitor);
});
}
}, AST_Jump);
var AST_Break = DEFNODE("Break", null, {
$documentation: "A `break` statement"
}, AST_LoopControl);
var AST_Continue = DEFNODE("Continue", null, {
$documentation: "A `continue` statement"
}, AST_LoopControl);
/* -----[ IF ]----- */
var AST_If = DEFNODE("If", "condition alternative", {
$documentation: "A `if` statement",
$propdoc: {
condition: "[AST_Node] the `if` condition",
alternative: "[AST_Statement?] the `else` part, or null if not present"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.condition._walk(visitor);
this.body._walk(visitor);
if (this.alternative) this.alternative._walk(visitor);
});
}
}, AST_StatementWithBody);
/* -----[ SWITCH ]----- */
var AST_Switch = DEFNODE("Switch", "expression", {
$documentation: "A `switch` statement",
$propdoc: {
expression: "[AST_Node] the `switch` “discriminant”"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.expression._walk(visitor);
walk_body(this, visitor);
});
}
}, AST_Block);
var AST_SwitchBranch = DEFNODE("SwitchBranch", null, {
$documentation: "Base class for `switch` branches",
}, AST_Block);
var AST_Default = DEFNODE("Default", null, {
$documentation: "A `default` switch branch",
}, AST_SwitchBranch);
var AST_Case = DEFNODE("Case", "expression", {
$documentation: "A `case` switch branch",
$propdoc: {
expression: "[AST_Node] the `case` expression"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.expression._walk(visitor);
walk_body(this, visitor);
});
}
}, AST_SwitchBranch);
/* -----[ EXCEPTIONS ]----- */
var AST_Try = DEFNODE("Try", "bcatch bfinally", {
$documentation: "A `try` statement",
$propdoc: {
bcatch: "[AST_Catch?] the catch block, or null if not present",
bfinally: "[AST_Finally?] the finally block, or null if not present"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
walk_body(this, visitor);
if (this.bcatch) this.bcatch._walk(visitor);
if (this.bfinally) this.bfinally._walk(visitor);
});
}
}, AST_Block);
// XXX: this is wrong according to ECMA-262 (12.4). the catch block
// should introduce another scope, as the argname should be visible
// only inside the catch block. However, doing it this way because of
// IE which simply introduces the name in the surrounding scope. If
// we ever want to fix this then AST_Catch should inherit from
// AST_Scope.
var AST_Catch = DEFNODE("Catch", "argname", {
$documentation: "A `catch` node; only makes sense as part of a `try` statement",
$propdoc: {
argname: "[AST_SymbolCatch] symbol for the exception"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.argname._walk(visitor);
walk_body(this, visitor);
});
}
}, AST_Block);
var AST_Finally = DEFNODE("Finally", null, {
$documentation: "A `finally` node; only makes sense as part of a `try` statement"
}, AST_Block);
/* -----[ VAR/CONST ]----- */
var AST_Definitions = DEFNODE("Definitions", "definitions", {
$documentation: "Base class for `var` or `const` nodes (variable declarations/initializations)",
$propdoc: {
definitions: "[AST_VarDef*] array of variable definitions"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.definitions.forEach(function(def){
def._walk(visitor);
});
});
}
}, AST_Statement);
var AST_Var = DEFNODE("Var", null, {
$documentation: "A `var` statement"
}, AST_Definitions);
var AST_Const = DEFNODE("Const", null, {
$documentation: "A `const` statement"
}, AST_Definitions);
var AST_VarDef = DEFNODE("VarDef", "name value", {
$documentation: "A variable declaration; only appears in a AST_Definitions node",
$propdoc: {
name: "[AST_SymbolVar|AST_SymbolConst] name of the variable",
value: "[AST_Node?] initializer, or null of there's no initializer"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.name._walk(visitor);
if (this.value) this.value._walk(visitor);
});
}
});
/* -----[ OTHER ]----- */
var AST_Call = DEFNODE("Call", "expression args", {
$documentation: "A function call expression",
$propdoc: {
expression: "[AST_Node] expression to invoke as function",
args: "[AST_Node*] array of arguments"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.expression._walk(visitor);
this.args.forEach(function(arg){
arg._walk(visitor);
});
});
}
});
var AST_New = DEFNODE("New", null, {
$documentation: "An object instantiation. Derives from a function call since it has exactly the same properties"
}, AST_Call);
var AST_Seq = DEFNODE("Seq", "car cdr", {
$documentation: "A sequence expression (two comma-separated expressions)",
$propdoc: {
car: "[AST_Node] first element in sequence",
cdr: "[AST_Node] second element in sequence"
},
$cons: function(x, y) {
var seq = new AST_Seq(x);
seq.car = x;
seq.cdr = y;
return seq;
},
$from_array: function(array) {
if (array.length == 0) return null;
if (array.length == 1) return array[0].clone();
var list = null;
for (var i = array.length; --i >= 0;) {
list = AST_Seq.cons(array[i], list);
}
var p = list;
while (p) {
if (p.cdr && !p.cdr.cdr) {
p.cdr = p.cdr.car;
break;
}
p = p.cdr;
}
return list;
},
to_array: function() {
var p = this, a = [];
while (p) {
a.push(p.car);
if (p.cdr && !(p.cdr instanceof AST_Seq)) {
a.push(p.cdr);
break;
}
p = p.cdr;
}
return a;
},
add: function(node) {
var p = this;
while (p) {
if (!(p.cdr instanceof AST_Seq)) {
var cell = AST_Seq.cons(p.cdr, node);
return p.cdr = cell;
}
p = p.cdr;
}
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.car._walk(visitor);
if (this.cdr) this.cdr._walk(visitor);
});
}
});
var AST_PropAccess = DEFNODE("PropAccess", "expression property", {
$documentation: "Base class for property access expressions, i.e. `a.foo` or `a[\"foo\"]`",
$propdoc: {
expression: "[AST_Node] the “container” expression",
property: "[AST_Node|string] the property to access. For AST_Dot this is always a plain string, while for AST_Sub it's an arbitrary AST_Node"
}
});
var AST_Dot = DEFNODE("Dot", null, {
$documentation: "A dotted property access expression",
_walk: function(visitor) {
return visitor._visit(this, function(){
this.expression._walk(visitor);
});
}
}, AST_PropAccess);
var AST_Sub = DEFNODE("Sub", null, {
$documentation: "Index-style property access, i.e. `a[\"foo\"]`",
_walk: function(visitor) {
return visitor._visit(this, function(){
this.expression._walk(visitor);
this.property._walk(visitor);
});
}
}, AST_PropAccess);
var AST_Unary = DEFNODE("Unary", "operator expression", {
$documentation: "Base class for unary expressions",
$propdoc: {
operator: "[string] the operator",
expression: "[AST_Node] expression that this unary operator applies to"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.expression._walk(visitor);
});
}
});
var AST_UnaryPrefix = DEFNODE("UnaryPrefix", null, {
$documentation: "Unary prefix expression, i.e. `typeof i` or `++i`"
}, AST_Unary);
var AST_UnaryPostfix = DEFNODE("UnaryPostfix", null, {
$documentation: "Unary postfix expression, i.e. `i++`"
}, AST_Unary);
var AST_Binary = DEFNODE("Binary", "left operator right", {
$documentation: "Binary expression, i.e. `a + b`",
$propdoc: {
left: "[AST_Node] left-hand side expression",
operator: "[string] the operator",
right: "[AST_Node] right-hand side expression"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.left._walk(visitor);
this.right._walk(visitor);
});
}
});
var AST_Conditional = DEFNODE("Conditional", "condition consequent alternative", {
$documentation: "Conditional expression using the ternary operator, i.e. `a ? b : c`",
$propdoc: {
condition: "[AST_Node]",
consequent: "[AST_Node]",
alternative: "[AST_Node]"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.condition._walk(visitor);
this.consequent._walk(visitor);
this.alternative._walk(visitor);
});
}
});
var AST_Assign = DEFNODE("Assign", null, {
$documentation: "An assignment expression — `a = b + 5`",
}, AST_Binary);
/* -----[ LITERALS ]----- */
var AST_Array = DEFNODE("Array", "elements", {
$documentation: "An array literal",
$propdoc: {
elements: "[AST_Node*] array of elements"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.elements.forEach(function(el){
el._walk(visitor);
});
});
}
});
var AST_Object = DEFNODE("Object", "properties", {
$documentation: "An object literal",
$propdoc: {
properties: "[AST_ObjectProperty*] array of properties"
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.properties.forEach(function(prop){
prop._walk(visitor);
});
});
}
});
var AST_ObjectProperty = DEFNODE("ObjectProperty", "key value", {
$documentation: "Base class for literal object properties",
$propdoc: {
key: "[string] the property name; it's always a plain string in our AST, no matter if it was a string, number or identifier in original code",
value: "[AST_Node] property value. For setters and getters this is an AST_Function."
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.value._walk(visitor);
});
}
});
var AST_ObjectKeyVal = DEFNODE("ObjectKeyVal", null, {
$documentation: "A key: value object property",
}, AST_ObjectProperty);
var AST_ObjectSetter = DEFNODE("ObjectSetter", null, {
$documentation: "An object setter property",
}, AST_ObjectProperty);
var AST_ObjectGetter = DEFNODE("ObjectGetter", null, {
$documentation: "An object getter property",
}, AST_ObjectProperty);
var AST_Symbol = DEFNODE("Symbol", "scope name thedef", {
$propdoc: {
name: "[string] name of this symbol",
scope: "[AST_Scope/S] the current scope (not necessarily the definition scope)",
thedef: "[SymbolDef/S] the definition of this symbol"
},
$documentation: "Base class for all symbols",
});
var AST_SymbolAccessor = DEFNODE("SymbolAccessor", null, {
$documentation: "The name of a property accessor (setter/getter function)"
}, AST_Symbol);
var AST_SymbolDeclaration = DEFNODE("SymbolDeclaration", "init", {
$documentation: "A declaration symbol (symbol in var/const, function name or argument, symbol in catch)",
$propdoc: {
init: "[AST_Node*/S] array of initializers for this declaration."
}
}, AST_Symbol);
var AST_SymbolVar = DEFNODE("SymbolVar", null, {
$documentation: "Symbol defining a variable",
}, AST_SymbolDeclaration);
var AST_SymbolConst = DEFNODE("SymbolConst", null, {
$documentation: "A constant declaration"
}, AST_SymbolDeclaration);
var AST_SymbolFunarg = DEFNODE("SymbolFunarg", null, {
$documentation: "Symbol naming a function argument",
}, AST_SymbolVar);
var AST_SymbolDefun = DEFNODE("SymbolDefun", null, {
$documentation: "Symbol defining a function",
}, AST_SymbolDeclaration);
var AST_SymbolLambda = DEFNODE("SymbolLambda", null, {
$documentation: "Symbol naming a function expression",
}, AST_SymbolDeclaration);
var AST_SymbolCatch = DEFNODE("SymbolCatch", null, {
$documentation: "Symbol naming the exception in catch",
}, AST_SymbolDeclaration);
var AST_Label = DEFNODE("Label", "references", {
$documentation: "Symbol naming a label (declaration)",
$propdoc: {
references: "[AST_LabelRef*] a list of nodes referring to this label"
}
}, AST_Symbol);
var AST_SymbolRef = DEFNODE("SymbolRef", null, {
$documentation: "Reference to some symbol (not definition/declaration)",
}, AST_Symbol);
var AST_LabelRef = DEFNODE("LabelRef", null, {
$documentation: "Reference to a label symbol",
}, AST_Symbol);
var AST_This = DEFNODE("This", null, {
$documentation: "The `this` symbol",
}, AST_Symbol);
var AST_Constant = DEFNODE("Constant", null, {
$documentation: "Base class for all constants",
getValue: function() {
return this.value;
}
});
var AST_String = DEFNODE("String", "value", {
$documentation: "A string literal",
$propdoc: {
value: "[string] the contents of this string"
}
}, AST_Constant);
var AST_Number = DEFNODE("Number", "value", {
$documentation: "A number literal",
$propdoc: {
value: "[number] the numeric value"
}
}, AST_Constant);
var AST_RegExp = DEFNODE("RegExp", "value", {
$documentation: "A regexp literal",
$propdoc: {
value: "[RegExp] the actual regexp"
}
}, AST_Constant);
var AST_Atom = DEFNODE("Atom", null, {
$documentation: "Base class for atoms",
}, AST_Constant);
var AST_Null = DEFNODE("Null", null, {
$documentation: "The `null` atom",
value: null
}, AST_Atom);
var AST_NaN = DEFNODE("NaN", null, {
$documentation: "The impossible value",
value: 0/0
}, AST_Atom);
var AST_Undefined = DEFNODE("Undefined", null, {
$documentation: "The `undefined` value",
value: (function(){}())
}, AST_Atom);
var AST_Hole = DEFNODE("Hole", null, {
$documentation: "A hole in an array",
value: (function(){}())
}, AST_Atom);
var AST_Infinity = DEFNODE("Infinity", null, {
$documentation: "The `Infinity` value",
value: 1/0
}, AST_Atom);
var AST_Boolean = DEFNODE("Boolean", null, {
$documentation: "Base class for booleans",
}, AST_Atom);
var AST_False = DEFNODE("False", null, {
$documentation: "The `false` atom",
value: false
}, AST_Boolean);
var AST_True = DEFNODE("True", null, {
$documentation: "The `true` atom",
value: true
}, AST_Boolean);
/* -----[ TreeWalker ]----- */
function TreeWalker(callback) {
this.visit = callback;
this.stack = [];
};
TreeWalker.prototype = {
_visit: function(node, descend) {
this.stack.push(node);
var ret = this.visit(node, descend ? function(){
descend.call(node);
} : noop);
if (!ret && descend) {
descend.call(node);
}
this.stack.pop();
return ret;
},
parent: function(n) {
return this.stack[this.stack.length - 2 - (n || 0)];
},
push: function (node) {
this.stack.push(node);
},
pop: function() {
return this.stack.pop();
},
self: function() {
return this.stack[this.stack.length - 1];
},
find_parent: function(type) {
var stack = this.stack;
for (var i = stack.length; --i >= 0;) {
var x = stack[i];
if (x instanceof type) return x;
}
},
has_directive: function(type) {
return this.find_parent(AST_Scope).has_directive(type);
},
in_boolean_context: function() {
var stack = this.stack;
var i = stack.length, self = stack[--i];
while (i > 0) {
var p = stack[--i];
if ((p instanceof AST_If && p.condition === self) ||
(p instanceof AST_Conditional && p.condition === self) ||
(p instanceof AST_DWLoop && p.condition === self) ||
(p instanceof AST_For && p.condition === self) ||
(p instanceof AST_UnaryPrefix && p.operator == "!" && p.expression === self))
{
return true;
}
if (!(p instanceof AST_Binary && (p.operator == "&&" || p.operator == "||")))
return false;
self = p;
}
},
loopcontrol_target: function(label) {
var stack = this.stack;
if (label) {
for (var i = stack.length; --i >= 0;) {
var x = stack[i];
if (x instanceof AST_LabeledStatement && x.label.name == label.name) {
return x.body;
}
}
} else {
for (var i = stack.length; --i >= 0;) {
var x = stack[i];
if (x instanceof AST_Switch
|| x instanceof AST_For
|| x instanceof AST_ForIn
|| x instanceof AST_DWLoop) return x;
}
}
}
};
/***********************************************************************
A JavaScript tokenizer / parser / beautifier / compressor.
https://github.com/mishoo/UglifyJS2
-------------------------------- (C) ---------------------------------
Author: Mihai Bazon
<mihai.bazon@gmail.com>
http://mihai.bazon.net/blog
Distributed under the BSD license:
Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
Parser based on parse-js (http://marijn.haverbeke.nl/parse-js/).
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***********************************************************************/
"use strict";
var KEYWORDS = 'break case catch const continue debugger default delete do else finally for function if in instanceof new return switch throw try typeof var void while with';
var KEYWORDS_ATOM = 'false null true';
var RESERVED_WORDS = 'abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized this throws transient volatile'
+ " " + KEYWORDS_ATOM + " " + KEYWORDS;
var KEYWORDS_BEFORE_EXPRESSION = 'return new delete throw else case';
KEYWORDS = makePredicate(KEYWORDS);
RESERVED_WORDS = makePredicate(RESERVED_WORDS);
KEYWORDS_BEFORE_EXPRESSION = makePredicate(KEYWORDS_BEFORE_EXPRESSION);
KEYWORDS_ATOM = makePredicate(KEYWORDS_ATOM);
var OPERATOR_CHARS = makePredicate(characters("+-*&%=<>!?|~^"));
var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i;
var RE_OCT_NUMBER = /^0[0-7]+$/;
var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i;
var OPERATORS = makePredicate([
"in",
"instanceof",
"typeof",
"new",
"void",
"delete",
"++",
"--",
"+",
"-",
"!",
"~",
"&",
"|",
"^",
"*",
"/",
"%",
">>",
"<<",
">>>",
"<",
">",
"<=",
">=",
"==",
"===",
"!=",
"!==",
"?",
"=",
"+=",
"-=",
"/=",
"*=",
"%=",
">>=",
"<<=",
">>>=",
"|=",
"^=",
"&=",
"&&",
"||"
]);
var WHITESPACE_CHARS = makePredicate(characters(" \u00a0\n\r\t\f\u000b\u200b\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000"));
var PUNC_BEFORE_EXPRESSION = makePredicate(characters("[{(,.;:"));
var PUNC_CHARS = makePredicate(characters("[]{}(),;:"));
var REGEXP_MODIFIERS = makePredicate(characters("gmsiy"));
/* -----[ Tokenizer ]----- */
// regexps adapted from http://xregexp.com/plugins/#unicode
var UNICODE = {
letter: new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0523\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971\\u0972\\u097B-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D3D\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC\\u0EDD\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8B\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10D0-\\u10FA\\u10FC\\u1100-\\u1159\\u115F-\\u11A2\\u11A8-\\u11F9\\u1200-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u1676\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19A9\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u2094\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2C6F\\u2C71-\\u2C7D\\u2C80-\\u2CE4\\u2D00-\\u2D25\\u2D30-\\u2D65\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31B7\\u31F0-\\u31FF\\u3400\\u4DB5\\u4E00\\u9FC3\\uA000-\\uA48C\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA65F\\uA662-\\uA66E\\uA67F-\\uA697\\uA717-\\uA71F\\uA722-\\uA788\\uA78B\\uA78C\\uA7FB-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA90A-\\uA925\\uA930-\\uA946\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAC00\\uD7A3\\uF900-\\uFA2D\\uFA30-\\uFA6A\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),
non_spacing_mark: new RegExp("[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065E\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0900-\\u0902\\u093C\\u0941-\\u0948\\u094D\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09BC\\u09C1-\\u09C4\\u09CD\\u09E2\\u09E3\\u0A01\\u0A02\\u0A3C\\u0A41\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81\\u0A82\\u0ABC\\u0AC1-\\u0AC5\\u0AC7\\u0AC8\\u0ACD\\u0AE2\\u0AE3\\u0B01\\u0B3C\\u0B3F\\u0B41-\\u0B44\\u0B4D\\u0B56\\u0B62\\u0B63\\u0B82\\u0BC0\\u0BCD\\u0C3E-\\u0C40\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0CBC\\u0CBF\\u0CC6\\u0CCC\\u0CCD\\u0CE2\\u0CE3\\u0D41-\\u0D44\\u0D4D\\u0D62\\u0D63\\u0DCA\\u0DD2-\\u0DD4\\u0DD6\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F71-\\u0F7E\\u0F80-\\u0F84\\u0F86\\u0F87\\u0F90-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1030\\u1032-\\u1037\\u1039\\u103A\\u103D\\u103E\\u1058\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108D\\u109D\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B7-\\u17BD\\u17C6\\u17C9-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193B\\u1A17\\u1A18\\u1A56\\u1A58-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A6C\\u1A73-\\u1A7C\\u1A7F\\u1B00-\\u1B03\\u1B34\\u1B36-\\u1B3A\\u1B3C\\u1B42\\u1B6B-\\u1B73\\u1B80\\u1B81\\u1BA2-\\u1BA5\\u1BA8\\u1BA9\\u1C2C-\\u1C33\\u1C36\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE0\\u1CE2-\\u1CE8\\u1CED\\u1DC0-\\u1DE6\\u1DFD-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F\\uA67C\\uA67D\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA825\\uA826\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA951\\uA980-\\uA982\\uA9B3\\uA9B6-\\uA9B9\\uA9BC\\uAA29-\\uAA2E\\uAA31\\uAA32\\uAA35\\uAA36\\uAA43\\uAA4C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uABE5\\uABE8\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26]"),
space_combining_mark: new RegExp("[\\u0903\\u093E-\\u0940\\u0949-\\u094C\\u094E\\u0982\\u0983\\u09BE-\\u09C0\\u09C7\\u09C8\\u09CB\\u09CC\\u09D7\\u0A03\\u0A3E-\\u0A40\\u0A83\\u0ABE-\\u0AC0\\u0AC9\\u0ACB\\u0ACC\\u0B02\\u0B03\\u0B3E\\u0B40\\u0B47\\u0B48\\u0B4B\\u0B4C\\u0B57\\u0BBE\\u0BBF\\u0BC1\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCC\\u0BD7\\u0C01-\\u0C03\\u0C41-\\u0C44\\u0C82\\u0C83\\u0CBE\\u0CC0-\\u0CC4\\u0CC7\\u0CC8\\u0CCA\\u0CCB\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D40\\u0D46-\\u0D48\\u0D4A-\\u0D4C\\u0D57\\u0D82\\u0D83\\u0DCF-\\u0DD1\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0F3E\\u0F3F\\u0F7F\\u102B\\u102C\\u1031\\u1038\\u103B\\u103C\\u1056\\u1057\\u1062-\\u1064\\u1067-\\u106D\\u1083\\u1084\\u1087-\\u108C\\u108F\\u109A-\\u109C\\u17B6\\u17BE-\\u17C5\\u17C7\\u17C8\\u1923-\\u1926\\u1929-\\u192B\\u1930\\u1931\\u1933-\\u1938\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A19-\\u1A1B\\u1A55\\u1A57\\u1A61\\u1A63\\u1A64\\u1A6D-\\u1A72\\u1B04\\u1B35\\u1B3B\\u1B3D-\\u1B41\\u1B43\\u1B44\\u1B82\\u1BA1\\u1BA6\\u1BA7\\u1BAA\\u1C24-\\u1C2B\\u1C34\\u1C35\\u1CE1\\u1CF2\\uA823\\uA824\\uA827\\uA880\\uA881\\uA8B4-\\uA8C3\\uA952\\uA953\\uA983\\uA9B4\\uA9B5\\uA9BA\\uA9BB\\uA9BD-\\uA9C0\\uAA2F\\uAA30\\uAA33\\uAA34\\uAA4D\\uAA7B\\uABE3\\uABE4\\uABE6\\uABE7\\uABE9\\uABEA\\uABEC]"),
connector_punctuation: new RegExp("[\\u005F\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]")
};
function is_letter(code) {
return (code >= 97 && code <= 122)
|| (code >= 65 && code <= 90)
|| (code >= 0xaa && UNICODE.letter.test(String.fromCharCode(code)));
};
function is_digit(code) {
return code >= 48 && code <= 57; //XXX: find out if "UnicodeDigit" means something else than 0..9
};
function is_alphanumeric_char(code) {
return is_digit(code) || is_letter(code);
};
function is_unicode_combining_mark(ch) {
return UNICODE.non_spacing_mark.test(ch) || UNICODE.space_combining_mark.test(ch);
};
function is_unicode_connector_punctuation(ch) {
return UNICODE.connector_punctuation.test(ch);
};
function is_identifier(name) {
return !RESERVED_WORDS(name) && /^[a-z_$][a-z0-9_$]*$/i.test(name);
};
function is_identifier_start(code) {
return code == 36 || code == 95 || is_letter(code);
};
function is_identifier_char(ch) {
var code = ch.charCodeAt(0);
return is_identifier_start(code)
|| is_digit(code)
|| code == 8204 // \u200c: zero-width non-joiner <ZWNJ>
|| code == 8205 // \u200d: zero-width joiner <ZWJ> (in my ECMA-262 PDF, this is also 200c)
|| is_unicode_combining_mark(ch)
|| is_unicode_connector_punctuation(ch)
;
};
function is_identifier_string(str){
var i = str.length;
if (i == 0) return false;
if (is_digit(str.charCodeAt(0))) return false;
while (--i >= 0) {
if (!is_identifier_char(str.charAt(i)))
return false;
}
return true;
};
function parse_js_number(num) {
if (RE_HEX_NUMBER.test(num)) {
return parseInt(num.substr(2), 16);
} else if (RE_OCT_NUMBER.test(num)) {
return parseInt(num.substr(1), 8);
} else if (RE_DEC_NUMBER.test(num)) {
return parseFloat(num);
}
};
function JS_Parse_Error(message, line, col, pos) {
this.message = message;
this.line = line;
this.col = col;
this.pos = pos;
this.stack = new Error().stack;
};
JS_Parse_Error.prototype.toString = function() {
return this.message + " (line: " + this.line + ", col: " + this.col + ", pos: " + this.pos + ")" + "\n\n" + this.stack;
};
function js_error(message, filename, line, col, pos) {
throw new JS_Parse_Error(message, line, col, pos);
};
function is_token(token, type, val) {
return token.type == type && (val == null || token.value == val);
};
var EX_EOF = {};
function tokenizer($TEXT, filename) {
var S = {
text : $TEXT.replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/\uFEFF/g, ''),
filename : filename,
pos : 0,
tokpos : 0,
line : 1,
tokline : 0,
col : 0,
tokcol : 0,
newline_before : false,
regex_allowed : false,
comments_before : []
};
function peek() { return S.text.charAt(S.pos); };
function next(signal_eof, in_string) {
var ch = S.text.charAt(S.pos++);
if (signal_eof && !ch)
throw EX_EOF;
if (ch == "\n") {
S.newline_before = S.newline_before || !in_string;
++S.line;
S.col = 0;
} else {
++S.col;
}
return ch;
};
function find(what, signal_eof) {
var pos = S.text.indexOf(what, S.pos);
if (signal_eof && pos == -1) throw EX_EOF;
return pos;
};
function start_token() {
S.tokline = S.line;
S.tokcol = S.col;
S.tokpos = S.pos;
};
function token(type, value, is_comment) {
S.regex_allowed = ((type == "operator" && !UNARY_POSTFIX(value)) ||
(type == "keyword" && KEYWORDS_BEFORE_EXPRESSION(value)) ||
(type == "punc" && PUNC_BEFORE_EXPRESSION(value)));
var ret = {
type : type,
value : value,
line : S.tokline,
col : S.tokcol,
pos : S.tokpos,
endpos : S.pos,
nlb : S.newline_before,
file : filename
};
if (!is_comment) {
ret.comments_before = S.comments_before;
S.comments_before = [];
// make note of any newlines in the comments that came before
for (var i = 0, len = ret.comments_before.length; i < len; i++) {
ret.nlb = ret.nlb || ret.comments_before[i].nlb;
}
}
S.newline_before = false;
return new AST_Token(ret);
};
function skip_whitespace() {
while (WHITESPACE_CHARS(peek()))
next();
};
function read_while(pred) {
var ret = "", ch, i = 0;
while ((ch = peek()) && pred(ch, i++))
ret += next();
return ret;
};
function parse_error(err) {
js_error(err, filename, S.tokline, S.tokcol, S.tokpos);
};
function read_num(prefix) {
var has_e = false, after_e = false, has_x = false, has_dot = prefix == ".";
var num = read_while(function(ch, i){
var code = ch.charCodeAt(0);
switch (code) {
case 120: case 88: // xX
return has_x ? false : (has_x = true);
case 101: case 69: // eE
return has_x ? true : has_e ? false : (has_e = after_e = true);
case 45: // -
return after_e || (i == 0 && !prefix);
case 43: // +
return after_e;
case (after_e = false, 46): // .
return (!has_dot && !has_x && !has_e) ? (has_dot = true) : false;
}
return is_alphanumeric_char(code);
});
if (prefix) num = prefix + num;
var valid = parse_js_number(num);
if (!isNaN(valid)) {
return token("num", valid);
} else {
parse_error("Invalid syntax: " + num);
}
};
function read_escaped_char(in_string) {
var ch = next(true, in_string);
switch (ch.charCodeAt(0)) {
case 110 : return "\n";
case 114 : return "\r";
case 116 : return "\t";
case 98 : return "\b";
case 118 : return "\u000b"; // \v
case 102 : return "\f";
case 48 : return "\0";
case 120 : return String.fromCharCode(hex_bytes(2)); // \x
case 117 : return String.fromCharCode(hex_bytes(4)); // \u
case 10 : return ""; // newline
default : return ch;
}
};
function hex_bytes(n) {
var num = 0;
for (; n > 0; --n) {
var digit = parseInt(next(true), 16);
if (isNaN(digit))
parse_error("Invalid hex-character pattern in string");
num = (num << 4) | digit;
}
return num;
};
var read_string = with_eof_error("Unterminated string constant", function(){
var quote = next(), ret = "";
for (;;) {
var ch = next(true);
if (ch == "\\") {
// read OctalEscapeSequence (XXX: deprecated if "strict mode")
// https://github.com/mishoo/UglifyJS/issues/178
var octal_len = 0, first = null;
ch = read_while(function(ch){
if (ch >= "0" && ch <= "7") {
if (!first) {
first = ch;
return ++octal_len;
}
else if (first <= "3" && octal_len <= 2) return ++octal_len;
else if (first >= "4" && octal_len <= 1) return ++octal_len;
}
return false;
});
if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8));
else ch = read_escaped_char(true);
}
else if (ch == quote) break;
ret += ch;
}
return token("string", ret);
});
function read_line_comment() {
next();
var i = find("\n"), ret;
if (i == -1) {
ret = S.text.substr(S.pos);
S.pos = S.text.length;
} else {
ret = S.text.substring(S.pos, i);
S.pos = i;
}
return token("comment1", ret, true);
};
var read_multiline_comment = with_eof_error("Unterminated multiline comment", function(){
next();
var i = find("*/", true);
var text = S.text.substring(S.pos, i);
var a = text.split("\n"), n = a.length;
// update stream position
S.pos = i + 2;
S.line += n - 1;
if (n > 1) S.col = a[n - 1].length;
else S.col += a[n - 1].length;
S.col += 2;
S.newline_before = S.newline_before || text.indexOf("\n") >= 0;
return token("comment2", text, true);
});
function read_name() {
var backslash = false, name = "", ch, escaped = false, hex;
while ((ch = peek()) != null) {
if (!backslash) {
if (ch == "\\") escaped = backslash = true, next();
else if (is_identifier_char(ch)) name += next();
else break;
}
else {
if (ch != "u") parse_error("Expecting UnicodeEscapeSequence -- uXXXX");
ch = read_escaped_char();
if (!is_identifier_char(ch)) parse_error("Unicode char: " + ch.charCodeAt(0) + " is not valid in identifier");
name += ch;
backslash = false;
}
}
if (KEYWORDS(name) && escaped) {
hex = name.charCodeAt(0).toString(16).toUpperCase();
name = "\\u" + "0000".substr(hex.length) + hex + name.slice(1);
}
return name;
};
var read_regexp = with_eof_error("Unterminated regular expression", function(regexp){
var prev_backslash = false, ch, in_class = false;
while ((ch = next(true))) if (prev_backslash) {
regexp += "\\" + ch;
prev_backslash = false;
} else if (ch == "[") {
in_class = true;
regexp += ch;
} else if (ch == "]" && in_class) {
in_class = false;
regexp += ch;
} else if (ch == "/" && !in_class) {
break;
} else if (ch == "\\") {
prev_backslash = true;
} else {
regexp += ch;
}
var mods = read_name();
return token("regexp", new RegExp(regexp, mods));
});
function read_operator(prefix) {
function grow(op) {
if (!peek()) return op;
var bigger = op + peek();
if (OPERATORS(bigger)) {
next();
return grow(bigger);
} else {
return op;
}
};
return token("operator", grow(prefix || next()));
};
function handle_slash() {
next();
var regex_allowed = S.regex_allowed;
switch (peek()) {
case "/":
S.comments_before.push(read_line_comment());
S.regex_allowed = regex_allowed;
return next_token();
case "*":
S.comments_before.push(read_multiline_comment());
S.regex_allowed = regex_allowed;
return next_token();
}
return S.regex_allowed ? read_regexp("") : read_operator("/");
};
function handle_dot() {
next();
return is_digit(peek().charCodeAt(0))
? read_num(".")
: token("punc", ".");
};
function read_word() {
var word = read_name();
return KEYWORDS_ATOM(word) ? token("atom", word)
: !KEYWORDS(word) ? token("name", word)
: OPERATORS(word) ? token("operator", word)
: token("keyword", word);
};
function with_eof_error(eof_error, cont) {
return function(x) {
try {
return cont(x);
} catch(ex) {
if (ex === EX_EOF) parse_error(eof_error);
else throw ex;
}
};
};
function next_token(force_regexp) {
if (force_regexp != null)
return read_regexp(force_regexp);
skip_whitespace();
start_token();
var ch = peek();
if (!ch) return token("eof");
var code = ch.charCodeAt(0);
switch (code) {
case 34: case 39: return read_string();
case 46: return handle_dot();
case 47: return handle_slash();
}
if (is_digit(code)) return read_num();
if (PUNC_CHARS(ch)) return token("punc", next());
if (OPERATOR_CHARS(ch)) return read_operator();
if (code == 92 || is_identifier_start(code)) return read_word();
parse_error("Unexpected character '" + ch + "'");
};
next_token.context = function(nc) {
if (nc) S = nc;
return S;
};
return next_token;
};
/* -----[ Parser (constants) ]----- */
var UNARY_PREFIX = makePredicate([
"typeof",
"void",
"delete",
"--",
"++",
"!",
"~",
"-",
"+"
]);
var UNARY_POSTFIX = makePredicate([ "--", "++" ]);
var ASSIGNMENT = makePredicate([ "=", "+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=" ]);
var PRECEDENCE = (function(a, ret){
for (var i = 0, n = 1; i < a.length; ++i, ++n) {
var b = a[i];
for (var j = 0; j < b.length; ++j) {
ret[b[j]] = n;
}
}
return ret;
})(
[
["||"],
["&&"],
["|"],
["^"],
["&"],
["==", "===", "!=", "!=="],
["<", ">", "<=", ">=", "in", "instanceof"],
[">>", "<<", ">>>"],
["+", "-"],
["*", "/", "%"]
],
{}
);
var STATEMENTS_WITH_LABELS = array_to_hash([ "for", "do", "while", "switch" ]);
var ATOMIC_START_TOKEN = array_to_hash([ "atom", "num", "string", "regexp", "name" ]);
/* -----[ Parser ]----- */
function parse($TEXT, options) {
options = defaults(options, {
strict : false,
filename : null,
toplevel : null,
expression : false
});
var S = {
input : typeof $TEXT == "string" ? tokenizer($TEXT, options.filename) : $TEXT,
token : null,
prev : null,
peeked : null,
in_function : 0,
in_directives : true,
in_loop : 0,
labels : []
};
S.token = next();
function is(type, value) {
return is_token(S.token, type, value);
};
function peek() { return S.peeked || (S.peeked = S.input()); };
function next() {
S.prev = S.token;
if (S.peeked) {
S.token = S.peeked;
S.peeked = null;
} else {
S.token = S.input();
}
S.in_directives = S.in_directives && (
S.token.type == "string" || is("punc", ";")
);
return S.token;
};
function prev() {
return S.prev;
};
function croak(msg, line, col, pos) {
var ctx = S.input.context();
js_error(msg,
ctx.filename,
line != null ? line : ctx.tokline,
col != null ? col : ctx.tokcol,
pos != null ? pos : ctx.tokpos);
};
function token_error(token, msg) {
croak(msg, token.line, token.col);
};
function unexpected(token) {
if (token == null)
token = S.token;
token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")");
};
function expect_token(type, val) {
if (is(type, val)) {
return next();
}
token_error(S.token, "Unexpected token " + S.token.type + " «" + S.token.value + "»" + ", expected " + type + " «" + val + "»");
};
function expect(punc) { return expect_token("punc", punc); };
function can_insert_semicolon() {
return !options.strict && (
S.token.nlb || is("eof") || is("punc", "}")
);
};
function semicolon() {
if (is("punc", ";")) next();
else if (!can_insert_semicolon()) unexpected();
};
function parenthesised() {
expect("(");
var exp = expression(true);
expect(")");
return exp;
};
function embed_tokens(parser) {
return function() {
var start = S.token;
var expr = parser();
var end = prev();
expr.start = start;
expr.end = end;
return expr;
};
};
var statement = embed_tokens(function() {
var tmp;
if (is("operator", "/") || is("operator", "/=")) {
S.peeked = null;
S.token = S.input(S.token.value.substr(1)); // force regexp
}
switch (S.token.type) {
case "string":
var dir = S.in_directives, stat = simple_statement();
// XXXv2: decide how to fix directives
if (dir && stat.body instanceof AST_String && !is("punc", ","))
return new AST_Directive({ value: stat.body.value });
return stat;
case "num":
case "regexp":
case "operator":
case "atom":
return simple_statement();
case "name":
return is_token(peek(), "punc", ":")
? labeled_statement()
: simple_statement();
case "punc":
switch (S.token.value) {
case "{":
return new AST_BlockStatement({
start : S.token,
body : block_(),
end : prev()
});
case "[":
case "(":
return simple_statement();
case ";":
next();
return new AST_EmptyStatement();
default:
unexpected();
}
case "keyword":
switch (tmp = S.token.value, next(), tmp) {
case "break":
return break_cont(AST_Break);
case "continue":
return break_cont(AST_Continue);
case "debugger":
semicolon();
return new AST_Debugger();
case "do":
return new AST_Do({
body : in_loop(statement),
condition : (expect_token("keyword", "while"), tmp = parenthesised(), semicolon(), tmp)
});
case "while":
return new AST_While({
condition : parenthesised(),
body : in_loop(statement)
});
case "for":
return for_();
case "function":
return function_(true);
case "if":
return if_();
case "return":
if (S.in_function == 0)
croak("'return' outside of function");
return new AST_Return({
value: ( is("punc", ";")
? (next(), null)
: can_insert_semicolon()
? null
: (tmp = expression(true), semicolon(), tmp) )
});
case "switch":
return new AST_Switch({
expression : parenthesised(),
body : in_loop(switch_body_)
});
case "throw":
if (S.token.nlb)
croak("Illegal newline after 'throw'");
return new AST_Throw({
value: (tmp = expression(true), semicolon(), tmp)
});
case "try":
return try_();
case "var":
return tmp = var_(), semicolon(), tmp;
case "const":
return tmp = const_(), semicolon(), tmp;
case "with":
return new AST_With({
expression : parenthesised(),
body : statement()
});
default:
unexpected();
}
}
});
function labeled_statement() {
var label = as_symbol(AST_Label);
if (find_if(function(l){ return l.name == label.name }, S.labels)) {
// ECMA-262, 12.12: An ECMAScript program is considered
// syntactically incorrect if it contains a
// LabelledStatement that is enclosed by a
// LabelledStatement with the same Identifier as label.
croak("Label " + label.name + " defined twice");
}
expect(":");
S.labels.push(label);
var stat = statement();
S.labels.pop();
return new AST_LabeledStatement({ body: stat, label: label });
};
function simple_statement(tmp) {
return new AST_SimpleStatement({ body: (tmp = expression(true), semicolon(), tmp) });
};
function break_cont(type) {
var label = null;
if (!can_insert_semicolon()) {
label = as_symbol(AST_LabelRef, true);
}
if (label != null) {
if (!find_if(function(l){ return l.name == label.name }, S.labels))
croak("Undefined label " + label.name);
}
else if (S.in_loop == 0)
croak(type.TYPE + " not inside a loop or switch");
semicolon();
return new type({ label: label });
};
function for_() {
expect("(");
var init = null;
if (!is("punc", ";")) {
init = is("keyword", "var")
? (next(), var_(true))
: expression(true, true);
if (is("operator", "in")) {
if (init instanceof AST_Var && init.definitions.length > 1)
croak("Only one variable declaration allowed in for..in loop");
next();
return for_in(init);
}
}
return regular_for(init);
};
function regular_for(init) {
expect(";");
var test = is("punc", ";") ? null : expression(true);
expect(";");
var step = is("punc", ")") ? null : expression(true);
expect(")");
return new AST_For({
init : init,
condition : test,
step : step,
body : in_loop(statement)
});
};
function for_in(init) {
var lhs = init instanceof AST_Var ? init.definitions[0].name : null;
var obj = expression(true);
expect(")");
return new AST_ForIn({
init : init,
name : lhs,
object : obj,
body : in_loop(statement)
});
};
var function_ = function(in_statement, ctor) {
var is_accessor = ctor === AST_Accessor;
var name = (is("name") ? as_symbol(in_statement
? AST_SymbolDefun
: is_accessor
? AST_SymbolAccessor
: AST_SymbolLambda)
: is_accessor && (is("string") || is("num")) ? as_atom_node()
: null);
if (in_statement && !name)
unexpected();
expect("(");
if (!ctor) ctor = in_statement ? AST_Defun : AST_Function;
return new ctor({
name: name,
argnames: (function(first, a){
while (!is("punc", ")")) {
if (first) first = false; else expect(",");
a.push(as_symbol(AST_SymbolFunarg));
}
next();
return a;
})(true, []),
body: (function(loop, labels){
++S.in_function;
S.in_directives = true;
S.in_loop = 0;
S.labels = [];
var a = block_();
--S.in_function;
S.in_loop = loop;
S.labels = labels;
return a;
})(S.in_loop, S.labels)
});
};
function if_() {
var cond = parenthesised(), body = statement(), belse = null;
if (is("keyword", "else")) {
next();
belse = statement();
}
return new AST_If({
condition : cond,
body : body,
alternative : belse
});
};
function block_() {
expect("{");
var a = [];
while (!is("punc", "}")) {
if (is("eof")) unexpected();
a.push(statement());
}
next();
return a;
};
function switch_body_() {
expect("{");
var a = [], cur = null, branch = null, tmp;
while (!is("punc", "}")) {
if (is("eof")) unexpected();
if (is("keyword", "case")) {
if (branch) branch.end = prev();
cur = [];
branch = new AST_Case({
start : (tmp = S.token, next(), tmp),
expression : expression(true),
body : cur
});
a.push(branch);
expect(":");
}
else if (is("keyword", "default")) {
if (branch) branch.end = prev();
cur = [];
branch = new AST_Default({
start : (tmp = S.token, next(), expect(":"), tmp),
body : cur
});
a.push(branch);
}
else {
if (!cur) unexpected();
cur.push(statement());
}
}
if (branch) branch.end = prev();
next();
return a;
};
function try_() {
var body = block_(), bcatch = null, bfinally = null;
if (is("keyword", "catch")) {
var start = S.token;
next();
expect("(");
var name = as_symbol(AST_SymbolCatch);
expect(")");
bcatch = new AST_Catch({
start : start,
argname : name,
body : block_(),
end : prev()
});
}
if (is("keyword", "finally")) {
var start = S.token;
next();
bfinally = new AST_Finally({
start : start,
body : block_(),
end : prev()
});
}
if (!bcatch && !bfinally)
croak("Missing catch/finally blocks");
return new AST_Try({
body : body,
bcatch : bcatch,
bfinally : bfinally
});
};
function vardefs(no_in, in_const) {
var a = [];
for (;;) {
a.push(new AST_VarDef({
start : S.token,
name : as_symbol(in_const ? AST_SymbolConst : AST_SymbolVar),
value : is("operator", "=") ? (next(), expression(false, no_in)) : null,
end : prev()
}));
if (!is("punc", ","))
break;
next();
}
return a;
};
var var_ = function(no_in) {
return new AST_Var({
start : prev(),
definitions : vardefs(no_in, false),
end : prev()
});
};
var const_ = function() {
return new AST_Const({
start : prev(),
definitions : vardefs(false, true),
end : prev()
});
};
var new_ = function() {
var start = S.token;
expect_token("operator", "new");
var newexp = expr_atom(false), args;
if (is("punc", "(")) {
next();
args = expr_list(")");
} else {
args = [];
}
return subscripts(new AST_New({
start : start,
expression : newexp,
args : args,
end : prev()
}), true);
};
function as_atom_node() {
var tok = S.token, ret;
switch (tok.type) {
case "name":
return as_symbol(AST_SymbolRef);
case "num":
ret = new AST_Number({ start: tok, end: tok, value: tok.value });
break;
case "string":
ret = new AST_String({ start: tok, end: tok, value: tok.value });
break;
case "regexp":
ret = new AST_RegExp({ start: tok, end: tok, value: tok.value });
break;
case "atom":
switch (tok.value) {
case "false":
ret = new AST_False({ start: tok, end: tok });
break;
case "true":
ret = new AST_True({ start: tok, end: tok });
break;
case "null":
ret = new AST_Null({ start: tok, end: tok });
break;
}
break;
}
next();
return ret;
};
var expr_atom = function(allow_calls) {
if (is("operator", "new")) {
return new_();
}
var start = S.token;
if (is("punc")) {
switch (start.value) {
case "(":
next();
var ex = expression(true);
ex.start = start;
ex.end = S.token;
expect(")");
return subscripts(ex, allow_calls);
case "[":
return subscripts(array_(), allow_calls);
case "{":
return subscripts(object_(), allow_calls);
}
unexpected();
}
if (is("keyword", "function")) {
next();
var func = function_(false);
func.start = start;
func.end = prev();
return subscripts(func, allow_calls);
}
if (ATOMIC_START_TOKEN[S.token.type]) {
return subscripts(as_atom_node(), allow_calls);
}
unexpected();
};
function expr_list(closing, allow_trailing_comma, allow_empty) {
var first = true, a = [];
while (!is("punc", closing)) {
if (first) first = false; else expect(",");
if (allow_trailing_comma && is("punc", closing)) break;
if (is("punc", ",") && allow_empty) {
a.push(new AST_Hole({ start: S.token, end: S.token }));
} else {
a.push(expression(false));
}
}
next();
return a;
};
var array_ = embed_tokens(function() {
expect("[");
return new AST_Array({
elements: expr_list("]", !options.strict, true)
});
});
var object_ = embed_tokens(function() {
expect("{");
var first = true, a = [];
while (!is("punc", "}")) {
if (first) first = false; else expect(",");
if (!options.strict && is("punc", "}"))
// allow trailing comma
break;
var start = S.token;
var type = start.type;
var name = as_property_name();
if (type == "name" && !is("punc", ":")) {
if (name == "get") {
a.push(new AST_ObjectGetter({
start : start,
key : name,
value : function_(false, AST_Accessor),
end : prev()
}));
continue;
}
if (name == "set") {
a.push(new AST_ObjectSetter({
start : start,
key : name,
value : function_(false, AST_Accessor),
end : prev()
}));
continue;
}
}
expect(":");
a.push(new AST_ObjectKeyVal({
start : start,
key : name,
value : expression(false),
end : prev()
}));
}
next();
return new AST_Object({ properties: a });
});
function as_property_name() {
var tmp = S.token;
next();
switch (tmp.type) {
case "num":
case "string":
case "name":
case "operator":
case "keyword":
case "atom":
return tmp.value;
default:
unexpected();
}
};
function as_name() {
var tmp = S.token;
next();
switch (tmp.type) {
case "name":
case "operator":
case "keyword":
case "atom":
return tmp.value;
default:
unexpected();
}
};
function as_symbol(type, noerror) {
if (!is("name")) {
if (!noerror) croak("Name expected");
return null;
}
var name = S.token.value;
var sym = new (name == "this" ? AST_This : type)({
name : String(S.token.value),
start : S.token,
end : S.token
});
next();
return sym;
};
var subscripts = function(expr, allow_calls) {
var start = expr.start;
if (is("punc", ".")) {
next();
return subscripts(new AST_Dot({
start : start,
expression : expr,
property : as_name(),
end : prev()
}), allow_calls);
}
if (is("punc", "[")) {
next();
var prop = expression(true);
expect("]");
return subscripts(new AST_Sub({
start : start,
expression : expr,
property : prop,
end : prev()
}), allow_calls);
}
if (allow_calls && is("punc", "(")) {
next();
return subscripts(new AST_Call({
start : start,
expression : expr,
args : expr_list(")"),
end : prev()
}), true);
}
return expr;
};
var maybe_unary = function(allow_calls) {
var start = S.token;
if (is("operator") && UNARY_PREFIX(start.value)) {
next();
var ex = make_unary(AST_UnaryPrefix, start.value, maybe_unary(allow_calls));
ex.start = start;
ex.end = prev();
return ex;
}
var val = expr_atom(allow_calls);
while (is("operator") && UNARY_POSTFIX(S.token.value) && !S.token.nlb) {
val = make_unary(AST_UnaryPostfix, S.token.value, val);
val.start = start;
val.end = S.token;
next();
}
return val;
};
function make_unary(ctor, op, expr) {
if ((op == "++" || op == "--") && !is_assignable(expr))
croak("Invalid use of " + op + " operator");
return new ctor({ operator: op, expression: expr });
};
var expr_op = function(left, min_prec, no_in) {
var op = is("operator") ? S.token.value : null;
if (op == "in" && no_in) op = null;
var prec = op != null ? PRECEDENCE[op] : null;
if (prec != null && prec > min_prec) {
next();
var right = expr_op(maybe_unary(true), prec, no_in);
return expr_op(new AST_Binary({
start : left.start,
left : left,
operator : op,
right : right,
end : right.end
}), min_prec, no_in);
}
return left;
};
function expr_ops(no_in) {
return expr_op(maybe_unary(true), 0, no_in);
};
var maybe_conditional = function(no_in) {
var start = S.token;
var expr = expr_ops(no_in);
if (is("operator", "?")) {
next();
var yes = expression(false);
expect(":");
return new AST_Conditional({
start : start,
condition : expr,
consequent : yes,
alternative : expression(false, no_in),
end : peek()
});
}
return expr;
};
function is_assignable(expr) {
if (!options.strict) return true;
if (expr instanceof AST_This) return false;
return (expr instanceof AST_PropAccess || expr instanceof AST_Symbol);
};
var maybe_assign = function(no_in) {
var start = S.token;
var left = maybe_conditional(no_in), val = S.token.value;
if (is("operator") && ASSIGNMENT(val)) {
if (is_assignable(left)) {
next();
return new AST_Assign({
start : start,
left : left,
operator : val,
right : maybe_assign(no_in),
end : prev()
});
}
croak("Invalid assignment");
}
return left;
};
var expression = function(commas, no_in) {
var start = S.token;
var expr = maybe_assign(no_in);
if (commas && is("punc", ",")) {
next();
return new AST_Seq({
start : start,
car : expr,
cdr : expression(true, no_in),
end : peek()
});
}
return expr;
};
function in_loop(cont) {
++S.in_loop;
var ret = cont();
--S.in_loop;
return ret;
};
if (options.expression) {
return expression(true);
}
return (function(){
var start = S.token;
var body = [];
while (!is("eof"))
body.push(statement());
var end = prev();
var toplevel = options.toplevel;
if (toplevel) {
toplevel.body = toplevel.body.concat(body);
toplevel.end = end;
} else {
toplevel = new AST_Toplevel({ start: start, body: body, end: end });
}
return toplevel;
})();
};
/***********************************************************************
A JavaScript tokenizer / parser / beautifier / compressor.
https://github.com/mishoo/UglifyJS2
-------------------------------- (C) ---------------------------------
Author: Mihai Bazon
<mihai.bazon@gmail.com>
http://mihai.bazon.net/blog
Distributed under the BSD license:
Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***********************************************************************/
"use strict";
// Tree transformer helpers.
function TreeTransformer(before, after) {
TreeWalker.call(this);
this.before = before;
this.after = after;
}
TreeTransformer.prototype = new TreeWalker;
(function(undefined){
function _(node, descend) {
node.DEFMETHOD("transform", function(tw, in_list){
var x, y;
tw.push(this);
if (tw.before) x = tw.before(this, descend, in_list);
if (x === undefined) {
if (!tw.after) {
x = this;
descend(x, tw);
} else {
tw.stack[tw.stack.length - 1] = x = this.clone();
descend(x, tw);
y = tw.after(x, in_list);
if (y !== undefined) x = y;
}
}
tw.pop();
return x;
});
};
function do_list(list, tw) {
return MAP(list, function(node){
return node.transform(tw, true);
});
};
_(AST_Node, noop);
_(AST_LabeledStatement, function(self, tw){
self.label = self.label.transform(tw);
self.body = self.body.transform(tw);
});
_(AST_SimpleStatement, function(self, tw){
self.body = self.body.transform(tw);
});
_(AST_Block, function(self, tw){
self.body = do_list(self.body, tw);
});
_(AST_DWLoop, function(self, tw){
self.condition = self.condition.transform(tw);
self.body = self.body.transform(tw);
});
_(AST_For, function(self, tw){
if (self.init) self.init = self.init.transform(tw);
if (self.condition) self.condition = self.condition.transform(tw);
if (self.step) self.step = self.step.transform(tw);
self.body = self.body.transform(tw);
});
_(AST_ForIn, function(self, tw){
self.init = self.init.transform(tw);
self.object = self.object.transform(tw);
self.body = self.body.transform(tw);
});
_(AST_With, function(self, tw){
self.expression = self.expression.transform(tw);
self.body = self.body.transform(tw);
});
_(AST_Exit, function(self, tw){
if (self.value) self.value = self.value.transform(tw);
});
_(AST_LoopControl, function(self, tw){
if (self.label) self.label = self.label.transform(tw);
});
_(AST_If, function(self, tw){
self.condition = self.condition.transform(tw);
self.body = self.body.transform(tw);
if (self.alternative) self.alternative = self.alternative.transform(tw);
});
_(AST_Switch, function(self, tw){
self.expression = self.expression.transform(tw);
self.body = do_list(self.body, tw);
});
_(AST_Case, function(self, tw){
self.expression = self.expression.transform(tw);
self.body = do_list(self.body, tw);
});
_(AST_Try, function(self, tw){
self.body = do_list(self.body, tw);
if (self.bcatch) self.bcatch = self.bcatch.transform(tw);
if (self.bfinally) self.bfinally = self.bfinally.transform(tw);
});
_(AST_Catch, function(self, tw){
self.argname = self.argname.transform(tw);
self.body = do_list(self.body, tw);
});
_(AST_Definitions, function(self, tw){
self.definitions = do_list(self.definitions, tw);
});
_(AST_VarDef, function(self, tw){
self.name = self.name.transform(tw);
if (self.value) self.value = self.value.transform(tw);
});
_(AST_Lambda, function(self, tw){
if (self.name) self.name = self.name.transform(tw);
self.argnames = do_list(self.argnames, tw);
self.body = do_list(self.body, tw);
});
_(AST_Call, function(self, tw){
self.expression = self.expression.transform(tw);
self.args = do_list(self.args, tw);
});
_(AST_Seq, function(self, tw){
self.car = self.car.transform(tw);
self.cdr = self.cdr.transform(tw);
});
_(AST_Dot, function(self, tw){
self.expression = self.expression.transform(tw);
});
_(AST_Sub, function(self, tw){
self.expression = self.expression.transform(tw);
self.property = self.property.transform(tw);
});
_(AST_Unary, function(self, tw){
self.expression = self.expression.transform(tw);
});
_(AST_Binary, function(self, tw){
self.left = self.left.transform(tw);
self.right = self.right.transform(tw);
});
_(AST_Conditional, function(self, tw){
self.condition = self.condition.transform(tw);
self.consequent = self.consequent.transform(tw);
self.alternative = self.alternative.transform(tw);
});
_(AST_Array, function(self, tw){
self.elements = do_list(self.elements, tw);
});
_(AST_Object, function(self, tw){
self.properties = do_list(self.properties, tw);
});
_(AST_ObjectProperty, function(self, tw){
self.value = self.value.transform(tw);
});
})();
/***********************************************************************
A JavaScript tokenizer / parser / beautifier / compressor.
https://github.com/mishoo/UglifyJS2
-------------------------------- (C) ---------------------------------
Author: Mihai Bazon
<mihai.bazon@gmail.com>
http://mihai.bazon.net/blog
Distributed under the BSD license:
Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***********************************************************************/
"use strict";
function SymbolDef(scope, index, orig) {
this.name = orig.name;
this.orig = [ orig ];
this.scope = scope;
this.references = [];
this.global = false;
this.mangled_name = null;
this.undeclared = false;
this.constant = false;
this.index = index;
};
SymbolDef.prototype = {
unmangleable: function(options) {
return (this.global && !(options && options.toplevel))
|| this.undeclared
|| (!(options && options.eval) && (this.scope.uses_eval || this.scope.uses_with));
},
mangle: function(options) {
if (!this.mangled_name && !this.unmangleable(options)) {
var s = this.scope;
if (this.orig[0] instanceof AST_SymbolLambda && !options.screw_ie8)
s = s.parent_scope;
this.mangled_name = s.next_mangled(options);
}
}
};
AST_Toplevel.DEFMETHOD("figure_out_scope", function(){
// This does what ast_add_scope did in UglifyJS v1.
//
// Part of it could be done at parse time, but it would complicate
// the parser (and it's already kinda complex). It's also worth
// having it separated because we might need to call it multiple
// times on the same tree.
// pass 1: setup scope chaining and handle definitions
var self = this;
var scope = self.parent_scope = null;
var labels = new Dictionary();
var nesting = 0;
var tw = new TreeWalker(function(node, descend){
if (node instanceof AST_Scope) {
node.init_scope_vars(nesting);
var save_scope = node.parent_scope = scope;
var save_labels = labels;
++nesting;
scope = node;
labels = new Dictionary();
descend();
labels = save_labels;
scope = save_scope;
--nesting;
return true; // don't descend again in TreeWalker
}
if (node instanceof AST_Directive) {
node.scope = scope;
push_uniq(scope.directives, node.value);
return true;
}
if (node instanceof AST_With) {
for (var s = scope; s; s = s.parent_scope)
s.uses_with = true;
return;
}
if (node instanceof AST_LabeledStatement) {
var l = node.label;
if (labels.has(l.name))
throw new Error(string_template("Label {name} defined twice", l));
labels.set(l.name, l);
descend();
labels.del(l.name);
return true; // no descend again
}
if (node instanceof AST_Symbol) {
node.scope = scope;
}
if (node instanceof AST_Label) {
node.thedef = node;
node.init_scope_vars();
}
if (node instanceof AST_SymbolLambda) {
scope.def_function(node);
}
else if (node instanceof AST_SymbolDefun) {
// Careful here, the scope where this should be defined is
// the parent scope. The reason is that we enter a new
// scope when we encounter the AST_Defun node (which is
// instanceof AST_Scope) but we get to the symbol a bit
// later.
(node.scope = scope.parent_scope).def_function(node);
}
else if (node instanceof AST_SymbolVar
|| node instanceof AST_SymbolConst) {
var def = scope.def_variable(node);
def.constant = node instanceof AST_SymbolConst;
def.init = tw.parent().value;
}
else if (node instanceof AST_SymbolCatch) {
// XXX: this is wrong according to ECMA-262 (12.4). the
// `catch` argument name should be visible only inside the
// catch block. For a quick fix AST_Catch should inherit
// from AST_Scope. Keeping it this way because of IE,
// which doesn't obey the standard. (it introduces the
// identifier in the enclosing scope)
scope.def_variable(node);
}
if (node instanceof AST_LabelRef) {
var sym = labels.get(node.name);
if (!sym) throw new Error(string_template("Undefined label {name} [{line},{col}]", {
name: node.name,
line: node.start.line,
col: node.start.col
}));
node.thedef = sym;
}
});
self.walk(tw);
// pass 2: find back references and eval
var func = null;
var globals = self.globals = new Dictionary();
var tw = new TreeWalker(function(node, descend){
if (node instanceof AST_Lambda) {
var prev_func = func;
func = node;
descend();
func = prev_func;
return true;
}
if (node instanceof AST_LabelRef) {
node.reference();
return true;
}
if (node instanceof AST_SymbolRef) {
var name = node.name;
var sym = node.scope.find_variable(name);
if (!sym) {
var g;
if (globals.has(name)) {
g = globals.get(name);
} else {
g = new SymbolDef(self, globals.size(), node);
g.undeclared = true;
g.global = true;
globals.set(name, g);
}
node.thedef = g;
if (name == "eval" && tw.parent() instanceof AST_Call) {
for (var s = node.scope; s && !s.uses_eval; s = s.parent_scope)
s.uses_eval = true;
}
if (name == "arguments") {
func.uses_arguments = true;
}
} else {
node.thedef = sym;
}
node.reference();
return true;
}
});
self.walk(tw);
});
AST_Scope.DEFMETHOD("init_scope_vars", function(nesting){
this.directives = []; // contains the directives defined in this scope, i.e. "use strict"
this.variables = new Dictionary(); // map name to AST_SymbolVar (variables defined in this scope; includes functions)
this.functions = new Dictionary(); // map name to AST_SymbolDefun (functions defined in this scope)
this.uses_with = false; // will be set to true if this or some nested scope uses the `with` statement
this.uses_eval = false; // will be set to true if this or nested scope uses the global `eval`
this.parent_scope = null; // the parent scope
this.enclosed = []; // a list of variables from this or outer scope(s) that are referenced from this or inner scopes
this.cname = -1; // the current index for mangling functions/variables
this.nesting = nesting; // the nesting level of this scope (0 means toplevel)
});
AST_Scope.DEFMETHOD("strict", function(){
return this.has_directive("use strict");
});
AST_Lambda.DEFMETHOD("init_scope_vars", function(){
AST_Scope.prototype.init_scope_vars.apply(this, arguments);
this.uses_arguments = false;
});
AST_SymbolRef.DEFMETHOD("reference", function() {
var def = this.definition();
def.references.push(this);
var s = this.scope;
while (s) {
push_uniq(s.enclosed, def);
if (s === def.scope) break;
s = s.parent_scope;
}
this.frame = this.scope.nesting - def.scope.nesting;
});
AST_Label.DEFMETHOD("init_scope_vars", function(){
this.references = [];
});
AST_LabelRef.DEFMETHOD("reference", function(){
this.thedef.references.push(this);
});
AST_Scope.DEFMETHOD("find_variable", function(name){
if (name instanceof AST_Symbol) name = name.name;
return this.variables.get(name)
|| (this.parent_scope && this.parent_scope.find_variable(name));
});
AST_Scope.DEFMETHOD("has_directive", function(value){
return this.parent_scope && this.parent_scope.has_directive(value)
|| (this.directives.indexOf(value) >= 0 ? this : null);
});
AST_Scope.DEFMETHOD("def_function", function(symbol){
this.functions.set(symbol.name, this.def_variable(symbol));
});
AST_Scope.DEFMETHOD("def_variable", function(symbol){
var def;
if (!this.variables.has(symbol.name)) {
def = new SymbolDef(this, this.variables.size(), symbol);
this.variables.set(symbol.name, def);
def.global = !this.parent_scope;
} else {
def = this.variables.get(symbol.name);
def.orig.push(symbol);
}
return symbol.thedef = def;
});
AST_Scope.DEFMETHOD("next_mangled", function(options){
var ext = this.enclosed;
out: while (true) {
var m = base54(++this.cname);
if (!is_identifier(m)) continue; // skip over "do"
// we must ensure that the mangled name does not shadow a name
// from some parent scope that is referenced in this or in
// inner scopes.
for (var i = ext.length; --i >= 0;) {
var sym = ext[i];
var name = sym.mangled_name || (sym.unmangleable(options) && sym.name);
if (m == name) continue out;
}
return m;
}
});
AST_Scope.DEFMETHOD("references", function(sym){
if (sym instanceof AST_Symbol) sym = sym.definition();
return this.enclosed.indexOf(sym) < 0 ? null : sym;
});
AST_Symbol.DEFMETHOD("unmangleable", function(options){
return this.definition().unmangleable(options);
});
// property accessors are not mangleable
AST_SymbolAccessor.DEFMETHOD("unmangleable", function(){
return true;
});
// labels are always mangleable
AST_Label.DEFMETHOD("unmangleable", function(){
return false;
});
AST_Symbol.DEFMETHOD("unreferenced", function(){
return this.definition().references.length == 0
&& !(this.scope.uses_eval || this.scope.uses_with);
});
AST_Symbol.DEFMETHOD("undeclared", function(){
return this.definition().undeclared;
});
AST_LabelRef.DEFMETHOD("undeclared", function(){
return false;
});
AST_Label.DEFMETHOD("undeclared", function(){
return false;
});
AST_Symbol.DEFMETHOD("definition", function(){
return this.thedef;
});
AST_Symbol.DEFMETHOD("global", function(){
return this.definition().global;
});
AST_Toplevel.DEFMETHOD("_default_mangler_options", function(options){
return defaults(options, {
except : [],
eval : false,
sort : false,
toplevel : false,
screw_ie8 : false
});
});
AST_Toplevel.DEFMETHOD("mangle_names", function(options){
options = this._default_mangler_options(options);
// We only need to mangle declaration nodes. Special logic wired
// into the code generator will display the mangled name if it's
// present (and for AST_SymbolRef-s it'll use the mangled name of
// the AST_SymbolDeclaration that it points to).
var lname = -1;
var to_mangle = [];
var tw = new TreeWalker(function(node, descend){
if (node instanceof AST_LabeledStatement) {
// lname is incremented when we get to the AST_Label
var save_nesting = lname;
descend();
lname = save_nesting;
return true; // don't descend again in TreeWalker
}
if (node instanceof AST_Scope) {
var p = tw.parent(), a = [];
node.variables.each(function(symbol){
if (options.except.indexOf(symbol.name) < 0) {
a.push(symbol);
}
});
if (options.sort) a.sort(function(a, b){
return b.references.length - a.references.length;
});
to_mangle.push.apply(to_mangle, a);
return;
}
if (node instanceof AST_Label) {
var name;
do name = base54(++lname); while (!is_identifier(name));
node.mangled_name = name;
return true;
}
});
this.walk(tw);
to_mangle.forEach(function(def){ def.mangle(options) });
});
AST_Toplevel.DEFMETHOD("compute_char_frequency", function(options){
options = this._default_mangler_options(options);
var tw = new TreeWalker(function(node){
if (node instanceof AST_Constant)
base54.consider(node.print_to_string());
else if (node instanceof AST_Return)
base54.consider("return");
else if (node instanceof AST_Throw)
base54.consider("throw");
else if (node instanceof AST_Continue)
base54.consider("continue");
else if (node instanceof AST_Break)
base54.consider("break");
else if (node instanceof AST_Debugger)
base54.consider("debugger");
else if (node instanceof AST_Directive)
base54.consider(node.value);
else if (node instanceof AST_While)
base54.consider("while");
else if (node instanceof AST_Do)
base54.consider("do while");
else if (node instanceof AST_If) {
base54.consider("if");
if (node.alternative) base54.consider("else");
}
else if (node instanceof AST_Var)
base54.consider("var");
else if (node instanceof AST_Const)
base54.consider("const");
else if (node instanceof AST_Lambda)
base54.consider("function");
else if (node instanceof AST_For)
base54.consider("for");
else if (node instanceof AST_ForIn)
base54.consider("for in");
else if (node instanceof AST_Switch)
base54.consider("switch");
else if (node instanceof AST_Case)
base54.consider("case");
else if (node instanceof AST_Default)
base54.consider("default");
else if (node instanceof AST_With)
base54.consider("with");
else if (node instanceof AST_ObjectSetter)
base54.consider("set" + node.key);
else if (node instanceof AST_ObjectGetter)
base54.consider("get" + node.key);
else if (node instanceof AST_ObjectKeyVal)
base54.consider(node.key);
else if (node instanceof AST_New)
base54.consider("new");
else if (node instanceof AST_This)
base54.consider("this");
else if (node instanceof AST_Try)
base54.consider("try");
else if (node instanceof AST_Catch)
base54.consider("catch");
else if (node instanceof AST_Finally)
base54.consider("finally");
else if (node instanceof AST_Symbol && node.unmangleable(options))
base54.consider(node.name);
else if (node instanceof AST_Unary || node instanceof AST_Binary)
base54.consider(node.operator);
else if (node instanceof AST_Dot)
base54.consider(node.property);
});
this.walk(tw);
base54.sort();
});
var base54 = (function() {
var string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_0123456789";
var chars, frequency;
function reset() {
frequency = Object.create(null);
chars = string.split("").map(function(ch){ return ch.charCodeAt(0) });
chars.forEach(function(ch){ frequency[ch] = 0 });
}
base54.consider = function(str){
for (var i = str.length; --i >= 0;) {
var code = str.charCodeAt(i);
if (code in frequency) ++frequency[code];
}
};
base54.sort = function() {
chars = mergeSort(chars, function(a, b){
if (is_digit(a) && !is_digit(b)) return 1;
if (is_digit(b) && !is_digit(a)) return -1;
return frequency[b] - frequency[a];
});
};
base54.reset = reset;
reset();
base54.get = function(){ return chars };
base54.freq = function(){ return frequency };
function base54(num) {
var ret = "", base = 54;
do {
ret += String.fromCharCode(chars[num % base]);
num = Math.floor(num / base);
base = 64;
} while (num > 0);
return ret;
};
return base54;
})();
AST_Toplevel.DEFMETHOD("scope_warnings", function(options){
options = defaults(options, {
undeclared : false, // this makes a lot of noise
unreferenced : true,
assign_to_global : true,
func_arguments : true,
nested_defuns : true,
eval : true
});
var tw = new TreeWalker(function(node){
if (options.undeclared
&& node instanceof AST_SymbolRef
&& node.undeclared())
{
// XXX: this also warns about JS standard names,
// i.e. Object, Array, parseInt etc. Should add a list of
// exceptions.
AST_Node.warn("Undeclared symbol: {name} [{file}:{line},{col}]", {
name: node.name,
file: node.start.file,
line: node.start.line,
col: node.start.col
});
}
if (options.assign_to_global)
{
var sym = null;
if (node instanceof AST_Assign && node.left instanceof AST_SymbolRef)
sym = node.left;
else if (node instanceof AST_ForIn && node.init instanceof AST_SymbolRef)
sym = node.init;
if (sym
&& (sym.undeclared()
|| (sym.global() && sym.scope !== sym.definition().scope))) {
AST_Node.warn("{msg}: {name} [{file}:{line},{col}]", {
msg: sym.undeclared() ? "Accidental global?" : "Assignment to global",
name: sym.name,
file: sym.start.file,
line: sym.start.line,
col: sym.start.col
});
}
}
if (options.eval
&& node instanceof AST_SymbolRef
&& node.undeclared()
&& node.name == "eval") {
AST_Node.warn("Eval is used [{file}:{line},{col}]", node.start);
}
if (options.unreferenced
&& (node instanceof AST_SymbolDeclaration || node instanceof AST_Label)
&& node.unreferenced()) {
AST_Node.warn("{type} {name} is declared but not referenced [{file}:{line},{col}]", {
type: node instanceof AST_Label ? "Label" : "Symbol",
name: node.name,
file: node.start.file,
line: node.start.line,
col: node.start.col
});
}
if (options.func_arguments
&& node instanceof AST_Lambda
&& node.uses_arguments) {
AST_Node.warn("arguments used in function {name} [{file}:{line},{col}]", {
name: node.name ? node.name.name : "anonymous",
file: node.start.file,
line: node.start.line,
col: node.start.col
});
}
if (options.nested_defuns
&& node instanceof AST_Defun
&& !(tw.parent() instanceof AST_Scope)) {
AST_Node.warn("Function {name} declared in nested statement \"{type}\" [{file}:{line},{col}]", {
name: node.name.name,
type: tw.parent().TYPE,
file: node.start.file,
line: node.start.line,
col: node.start.col
});
}
});
this.walk(tw);
});
/***********************************************************************
A JavaScript tokenizer / parser / beautifier / compressor.
https://github.com/mishoo/UglifyJS2
-------------------------------- (C) ---------------------------------
Author: Mihai Bazon
<mihai.bazon@gmail.com>
http://mihai.bazon.net/blog
Distributed under the BSD license:
Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***********************************************************************/
"use strict";
function OutputStream(options) {
options = defaults(options, {
indent_start : 0,
indent_level : 4,
quote_keys : false,
space_colon : true,
ascii_only : false,
inline_script : false,
width : 80,
max_line_len : 32000,
beautify : false,
source_map : null,
bracketize : false,
semicolons : true,
comments : false,
preserve_line : false,
screw_ie8 : false,
}, true);
var indentation = 0;
var current_col = 0;
var current_line = 1;
var current_pos = 0;
var OUTPUT = "";
function to_ascii(str, identifier) {
return str.replace(/[\u0080-\uffff]/g, function(ch) {
var code = ch.charCodeAt(0).toString(16);
if (code.length <= 2 && !identifier) {
while (code.length < 2) code = "0" + code;
return "\\x" + code;
} else {
while (code.length < 4) code = "0" + code;
return "\\u" + code;
}
});
};
function make_string(str) {
var dq = 0, sq = 0;
str = str.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029\0]/g, function(s){
switch (s) {
case "\\": return "\\\\";
case "\b": return "\\b";
case "\f": return "\\f";
case "\n": return "\\n";
case "\r": return "\\r";
case "\u2028": return "\\u2028";
case "\u2029": return "\\u2029";
case '"': ++dq; return '"';
case "'": ++sq; return "'";
case "\0": return "\\x00";
}
return s;
});
if (options.ascii_only) str = to_ascii(str);
if (dq > sq) return "'" + str.replace(/\x27/g, "\\'") + "'";
else return '"' + str.replace(/\x22/g, '\\"') + '"';
};
function encode_string(str) {
var ret = make_string(str);
if (options.inline_script)
ret = ret.replace(/<\x2fscript([>\/\t\n\f\r ])/gi, "<\\/script$1");
return ret;
};
function make_name(name) {
name = name.toString();
if (options.ascii_only)
name = to_ascii(name, true);
return name;
};
function make_indent(back) {
return repeat_string(" ", options.indent_start + indentation - back * options.indent_level);
};
/* -----[ beautification/minification ]----- */
var might_need_space = false;
var might_need_semicolon = false;
var last = null;
function last_char() {
return last.charAt(last.length - 1);
};
function maybe_newline() {
if (options.max_line_len && current_col > options.max_line_len)
print("\n");
};
var requireSemicolonChars = makePredicate("( [ + * / - , .");
function print(str) {
str = String(str);
var ch = str.charAt(0);
if (might_need_semicolon) {
if ((!ch || ";}".indexOf(ch) < 0) && !/[;]$/.test(last)) {
if (options.semicolons || requireSemicolonChars(ch)) {
OUTPUT += ";";
current_col++;
current_pos++;
} else {
OUTPUT += "\n";
current_pos++;
current_line++;
current_col = 0;
}
if (!options.beautify)
might_need_space = false;
}
might_need_semicolon = false;
maybe_newline();
}
if (!options.beautify && options.preserve_line && stack[stack.length - 1]) {
var target_line = stack[stack.length - 1].start.line;
while (current_line < target_line) {
OUTPUT += "\n";
current_pos++;
current_line++;
current_col = 0;
might_need_space = false;
}
}
if (might_need_space) {
var prev = last_char();
if ((is_identifier_char(prev)
&& (is_identifier_char(ch) || ch == "\\"))
|| (/^[\+\-\/]$/.test(ch) && ch == prev))
{
OUTPUT += " ";
current_col++;
current_pos++;
}
might_need_space = false;
}
var a = str.split(/\r?\n/), n = a.length - 1;
current_line += n;
if (n == 0) {
current_col += a[n].length;
} else {
current_col = a[n].length;
}
current_pos += str.length;
last = str;
OUTPUT += str;
};
var space = options.beautify ? function() {
print(" ");
} : function() {
might_need_space = true;
};
var indent = options.beautify ? function(half) {
if (options.beautify) {
print(make_indent(half ? 0.5 : 0));
}
} : noop;
var with_indent = options.beautify ? function(col, cont) {
if (col === true) col = next_indent();
var save_indentation = indentation;
indentation = col;
var ret = cont();
indentation = save_indentation;
return ret;
} : function(col, cont) { return cont() };
var newline = options.beautify ? function() {
print("\n");
} : noop;
var semicolon = options.beautify ? function() {
print(";");
} : function() {
might_need_semicolon = true;
};
function force_semicolon() {
might_need_semicolon = false;
print(";");
};
function next_indent() {
return indentation + options.indent_level;
};
function with_block(cont) {
var ret;
print("{");
newline();
with_indent(next_indent(), function(){
ret = cont();
});
indent();
print("}");
return ret;
};
function with_parens(cont) {
print("(");
//XXX: still nice to have that for argument lists
//var ret = with_indent(current_col, cont);
var ret = cont();
print(")");
return ret;
};
function with_square(cont) {
print("[");
//var ret = with_indent(current_col, cont);
var ret = cont();
print("]");
return ret;
};
function comma() {
print(",");
space();
};
function colon() {
print(":");
if (options.space_colon) space();
};
var add_mapping = options.source_map ? function(token, name) {
try {
if (token) options.source_map.add(
token.file || "?",
current_line, current_col,
token.line, token.col,
(!name && token.type == "name") ? token.value : name
);
} catch(ex) {
AST_Node.warn("Couldn't figure out mapping for {file}:{line},{col} → {cline},{ccol} [{name}]", {
file: token.file,
line: token.line,
col: token.col,
cline: current_line,
ccol: current_col,
name: name || ""
})
}
} : noop;
function get() {
return OUTPUT;
};
var stack = [];
return {
get : get,
toString : get,
indent : indent,
indentation : function() { return indentation },
current_width : function() { return current_col - indentation },
should_break : function() { return options.width && this.current_width() >= options.width },
newline : newline,
print : print,
space : space,
comma : comma,
colon : colon,
last : function() { return last },
semicolon : semicolon,
force_semicolon : force_semicolon,
to_ascii : to_ascii,
print_name : function(name) { print(make_name(name)) },
print_string : function(str) { print(encode_string(str)) },
next_indent : next_indent,
with_indent : with_indent,
with_block : with_block,
with_parens : with_parens,
with_square : with_square,
add_mapping : add_mapping,
option : function(opt) { return options[opt] },
line : function() { return current_line },
col : function() { return current_col },
pos : function() { return current_pos },
push_node : function(node) { stack.push(node) },
pop_node : function() { return stack.pop() },
stack : function() { return stack },
parent : function(n) {
return stack[stack.length - 2 - (n || 0)];
}
};
};
/* -----[ code generators ]----- */
(function(){
/* -----[ utils ]----- */
function DEFPRINT(nodetype, generator) {
nodetype.DEFMETHOD("_codegen", generator);
};
AST_Node.DEFMETHOD("print", function(stream, force_parens){
var self = this, generator = self._codegen;
function doit() {
self.add_comments(stream);
self.add_source_map(stream);
generator(self, stream);
}
stream.push_node(self);
if (force_parens || self.needs_parens(stream)) {
stream.with_parens(doit);
} else {
doit();
}
stream.pop_node();
});
AST_Node.DEFMETHOD("print_to_string", function(options){
var s = OutputStream(options);
this.print(s);
return s.get();
});
/* -----[ comments ]----- */
AST_Node.DEFMETHOD("add_comments", function(output){
var c = output.option("comments"), self = this;
if (c) {
var start = self.start;
if (start && !start._comments_dumped) {
start._comments_dumped = true;
var comments = start.comments_before;
// XXX: ugly fix for https://github.com/mishoo/UglifyJS2/issues/112
// if this node is `return` or `throw`, we cannot allow comments before
// the returned or thrown value.
if (self instanceof AST_Exit &&
self.value && self.value.start.comments_before.length > 0) {
comments = (comments || []).concat(self.value.start.comments_before);
self.value.start.comments_before = [];
}
if (c.test) {
comments = comments.filter(function(comment){
return c.test(comment.value);
});
} else if (typeof c == "function") {
comments = comments.filter(function(comment){
return c(self, comment);
});
}
comments.forEach(function(c){
if (c.type == "comment1") {
output.print("//" + c.value + "\n");
output.indent();
}
else if (c.type == "comment2") {
output.print("/*" + c.value + "*/");
if (start.nlb) {
output.print("\n");
output.indent();
} else {
output.space();
}
}
});
}
}
});
/* -----[ PARENTHESES ]----- */
function PARENS(nodetype, func) {
nodetype.DEFMETHOD("needs_parens", func);
};
PARENS(AST_Node, function(){
return false;
});
// a function expression needs parens around it when it's provably
// the first token to appear in a statement.
PARENS(AST_Function, function(output){
return first_in_statement(output);
});
// same goes for an object literal, because otherwise it would be
// interpreted as a block of code.
PARENS(AST_Object, function(output){
return first_in_statement(output);
});
PARENS(AST_Unary, function(output){
var p = output.parent();
return p instanceof AST_PropAccess && p.expression === this;
});
PARENS(AST_Seq, function(output){
var p = output.parent();
return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4)
|| p instanceof AST_Unary // !(foo, bar, baz)
|| p instanceof AST_Binary // 1 + (2, 3) + 4 ==> 8
|| p instanceof AST_VarDef // var a = (1, 2), b = a + a; ==> b == 4
|| p instanceof AST_Dot // (1, {foo:2}).foo ==> 2
|| p instanceof AST_Array // [ 1, (2, 3), 4 ] ==> [ 1, 3, 4 ]
|| p instanceof AST_ObjectProperty // { foo: (1, 2) }.foo ==> 2
|| p instanceof AST_Conditional /* (false, true) ? (a = 10, b = 20) : (c = 30)
* ==> 20 (side effect, set a := 10 and b := 20) */
;
});
PARENS(AST_Binary, function(output){
var p = output.parent();
// (foo && bar)()
if (p instanceof AST_Call && p.expression === this)
return true;
// typeof (foo && bar)
if (p instanceof AST_Unary)
return true;
// (foo && bar)["prop"], (foo && bar).prop
if (p instanceof AST_PropAccess && p.expression === this)
return true;
// this deals with precedence: 3 * (2 + 1)
if (p instanceof AST_Binary) {
var po = p.operator, pp = PRECEDENCE[po];
var so = this.operator, sp = PRECEDENCE[so];
if (pp > sp
|| (pp == sp
&& this === p.right
&& !(so == po &&
(so == "*" ||
so == "&&" ||
so == "||")))) {
return true;
}
}
});
PARENS(AST_PropAccess, function(output){
var p = output.parent();
if (p instanceof AST_New && p.expression === this) {
// i.e. new (foo.bar().baz)
//
// if there's one call into this subtree, then we need
// parens around it too, otherwise the call will be
// interpreted as passing the arguments to the upper New
// expression.
try {
this.walk(new TreeWalker(function(node){
if (node instanceof AST_Call) throw p;
}));
} catch(ex) {
if (ex !== p) throw ex;
return true;
}
}
});
PARENS(AST_Call, function(output){
var p = output.parent();
return p instanceof AST_New && p.expression === this;
});
PARENS(AST_New, function(output){
var p = output.parent();
if (no_constructor_parens(this, output)
&& (p instanceof AST_PropAccess // (new Date).getTime(), (new Date)["getTime"]()
|| p instanceof AST_Call && p.expression === this)) // (new foo)(bar)
return true;
});
PARENS(AST_Number, function(output){
var p = output.parent();
if (this.getValue() < 0 && p instanceof AST_PropAccess && p.expression === this)
return true;
});
PARENS(AST_NaN, function(output){
var p = output.parent();
if (p instanceof AST_PropAccess && p.expression === this)
return true;
});
function assign_and_conditional_paren_rules(output) {
var p = output.parent();
// !(a = false) → true
if (p instanceof AST_Unary)
return true;
// 1 + (a = 2) + 3 → 6, side effect setting a = 2
if (p instanceof AST_Binary && !(p instanceof AST_Assign))
return true;
// (a = func)() —or— new (a = Object)()
if (p instanceof AST_Call && p.expression === this)
return true;
// (a = foo) ? bar : baz
if (p instanceof AST_Conditional && p.condition === this)
return true;
// (a = foo)["prop"] —or— (a = foo).prop
if (p instanceof AST_PropAccess && p.expression === this)
return true;
};
PARENS(AST_Assign, assign_and_conditional_paren_rules);
PARENS(AST_Conditional, assign_and_conditional_paren_rules);
/* -----[ PRINTERS ]----- */
DEFPRINT(AST_Directive, function(self, output){
output.print_string(self.value);
output.semicolon();
});
DEFPRINT(AST_Debugger, function(self, output){
output.print("debugger");
output.semicolon();
});
/* -----[ statements ]----- */
function display_body(body, is_toplevel, output) {
var last = body.length - 1;
body.forEach(function(stmt, i){
if (!(stmt instanceof AST_EmptyStatement)) {
output.indent();
stmt.print(output);
if (!(i == last && is_toplevel)) {
output.newline();
if (is_toplevel) output.newline();
}
}
});
};
AST_StatementWithBody.DEFMETHOD("_do_print_body", function(output){
force_statement(this.body, output);
});
DEFPRINT(AST_Statement, function(self, output){
self.body.print(output);
output.semicolon();
});
DEFPRINT(AST_Toplevel, function(self, output){
display_body(self.body, true, output);
output.print("");
});
DEFPRINT(AST_LabeledStatement, function(self, output){
self.label.print(output);
output.colon();
self.body.print(output);
});
DEFPRINT(AST_SimpleStatement, function(self, output){
self.body.print(output);
output.semicolon();
});
function print_bracketed(body, output) {
if (body.length > 0) output.with_block(function(){
display_body(body, false, output);
});
else output.print("{}");
};
DEFPRINT(AST_BlockStatement, function(self, output){
print_bracketed(self.body, output);
});
DEFPRINT(AST_EmptyStatement, function(self, output){
output.semicolon();
});
DEFPRINT(AST_Do, function(self, output){
output.print("do");
output.space();
self._do_print_body(output);
output.space();
output.print("while");
output.space();
output.with_parens(function(){
self.condition.print(output);
});
output.semicolon();
});
DEFPRINT(AST_While, function(self, output){
output.print("while");
output.space();
output.with_parens(function(){
self.condition.print(output);
});
output.space();
self._do_print_body(output);
});
DEFPRINT(AST_For, function(self, output){
output.print("for");
output.space();
output.with_parens(function(){
if (self.init) {
if (self.init instanceof AST_Definitions) {
self.init.print(output);
} else {
parenthesize_for_noin(self.init, output, true);
}
output.print(";");
output.space();
} else {
output.print(";");
}
if (self.condition) {
self.condition.print(output);
output.print(";");
output.space();
} else {
output.print(";");
}
if (self.step) {
self.step.print(output);
}
});
output.space();
self._do_print_body(output);
});
DEFPRINT(AST_ForIn, function(self, output){
output.print("for");
output.space();
output.with_parens(function(){
self.init.print(output);
output.space();
output.print("in");
output.space();
self.object.print(output);
});
output.space();
self._do_print_body(output);
});
DEFPRINT(AST_With, function(self, output){
output.print("with");
output.space();
output.with_parens(function(){
self.expression.print(output);
});
output.space();
self._do_print_body(output);
});
/* -----[ functions ]----- */
AST_Lambda.DEFMETHOD("_do_print", function(output, nokeyword){
var self = this;
if (!nokeyword) {
output.print("function");
}
if (self.name) {
output.space();
self.name.print(output);
}
output.with_parens(function(){
self.argnames.forEach(function(arg, i){
if (i) output.comma();
arg.print(output);
});
});
output.space();
print_bracketed(self.body, output);
});
DEFPRINT(AST_Lambda, function(self, output){
self._do_print(output);
});
/* -----[ exits ]----- */
AST_Exit.DEFMETHOD("_do_print", function(output, kind){
output.print(kind);
if (this.value) {
output.space();
this.value.print(output);
}
output.semicolon();
});
DEFPRINT(AST_Return, function(self, output){
self._do_print(output, "return");
});
DEFPRINT(AST_Throw, function(self, output){
self._do_print(output, "throw");
});
/* -----[ loop control ]----- */
AST_LoopControl.DEFMETHOD("_do_print", function(output, kind){
output.print(kind);
if (this.label) {
output.space();
this.label.print(output);
}
output.semicolon();
});
DEFPRINT(AST_Break, function(self, output){
self._do_print(output, "break");
});
DEFPRINT(AST_Continue, function(self, output){
self._do_print(output, "continue");
});
/* -----[ if ]----- */
function make_then(self, output) {
if (output.option("bracketize")) {
make_block(self.body, output);
return;
}
// The squeezer replaces "block"-s that contain only a single
// statement with the statement itself; technically, the AST
// is correct, but this can create problems when we output an
// IF having an ELSE clause where the THEN clause ends in an
// IF *without* an ELSE block (then the outer ELSE would refer
// to the inner IF). This function checks for this case and
// adds the block brackets if needed.
if (!self.body)
return output.force_semicolon();
if (self.body instanceof AST_Do
&& !output.option("screw_ie8")) {
// https://github.com/mishoo/UglifyJS/issues/#issue/57 IE
// croaks with "syntax error" on code like this: if (foo)
// do ... while(cond); else ... we need block brackets
// around do/while
make_block(self.body, output);
return;
}
var b = self.body;
while (true) {
if (b instanceof AST_If) {
if (!b.alternative) {
make_block(self.body, output);
return;
}
b = b.alternative;
}
else if (b instanceof AST_StatementWithBody) {
b = b.body;
}
else break;
}
force_statement(self.body, output);
};
DEFPRINT(AST_If, function(self, output){
output.print("if");
output.space();
output.with_parens(function(){
self.condition.print(output);
});
output.space();
if (self.alternative) {
make_then(self, output);
output.space();
output.print("else");
output.space();
force_statement(self.alternative, output);
} else {
self._do_print_body(output);
}
});
/* -----[ switch ]----- */
DEFPRINT(AST_Switch, function(self, output){
output.print("switch");
output.space();
output.with_parens(function(){
self.expression.print(output);
});
output.space();
if (self.body.length > 0) output.with_block(function(){
self.body.forEach(function(stmt, i){
if (i) output.newline();
output.indent(true);
stmt.print(output);
});
});
else output.print("{}");
});
AST_SwitchBranch.DEFMETHOD("_do_print_body", function(output){
if (this.body.length > 0) {
output.newline();
this.body.forEach(function(stmt){
output.indent();
stmt.print(output);
output.newline();
});
}
});
DEFPRINT(AST_Default, function(self, output){
output.print("default:");
self._do_print_body(output);
});
DEFPRINT(AST_Case, function(self, output){
output.print("case");
output.space();
self.expression.print(output);
output.print(":");
self._do_print_body(output);
});
/* -----[ exceptions ]----- */
DEFPRINT(AST_Try, function(self, output){
output.print("try");
output.space();
print_bracketed(self.body, output);
if (self.bcatch) {
output.space();
self.bcatch.print(output);
}
if (self.bfinally) {
output.space();
self.bfinally.print(output);
}
});
DEFPRINT(AST_Catch, function(self, output){
output.print("catch");
output.space();
output.with_parens(function(){
self.argname.print(output);
});
output.space();
print_bracketed(self.body, output);
});
DEFPRINT(AST_Finally, function(self, output){
output.print("finally");
output.space();
print_bracketed(self.body, output);
});
/* -----[ var/const ]----- */
AST_Definitions.DEFMETHOD("_do_print", function(output, kind){
output.print(kind);
output.space();
this.definitions.forEach(function(def, i){
if (i) output.comma();
def.print(output);
});
var p = output.parent();
var in_for = p instanceof AST_For || p instanceof AST_ForIn;
var avoid_semicolon = in_for && p.init === this;
if (!avoid_semicolon)
output.semicolon();
});
DEFPRINT(AST_Var, function(self, output){
self._do_print(output, "var");
});
DEFPRINT(AST_Const, function(self, output){
self._do_print(output, "const");
});
function parenthesize_for_noin(node, output, noin) {
if (!noin) node.print(output);
else try {
// need to take some precautions here:
// https://github.com/mishoo/UglifyJS2/issues/60
node.walk(new TreeWalker(function(node){
if (node instanceof AST_Binary && node.operator == "in")
throw output;
}));
node.print(output);
} catch(ex) {
if (ex !== output) throw ex;
node.print(output, true);
}
};
DEFPRINT(AST_VarDef, function(self, output){
self.name.print(output);
if (self.value) {
output.space();
output.print("=");
output.space();
var p = output.parent(1);
var noin = p instanceof AST_For || p instanceof AST_ForIn;
parenthesize_for_noin(self.value, output, noin);
}
});
/* -----[ other expressions ]----- */
DEFPRINT(AST_Call, function(self, output){
self.expression.print(output);
if (self instanceof AST_New && no_constructor_parens(self, output))
return;
output.with_parens(function(){
self.args.forEach(function(expr, i){
if (i) output.comma();
expr.print(output);
});
});
});
DEFPRINT(AST_New, function(self, output){
output.print("new");
output.space();
AST_Call.prototype._codegen(self, output);
});
AST_Seq.DEFMETHOD("_do_print", function(output){
this.car.print(output);
if (this.cdr) {
output.comma();
if (output.should_break()) {
output.newline();
output.indent();
}
this.cdr.print(output);
}
});
DEFPRINT(AST_Seq, function(self, output){
self._do_print(output);
// var p = output.parent();
// if (p instanceof AST_Statement) {
// output.with_indent(output.next_indent(), function(){
// self._do_print(output);
// });
// } else {
// self._do_print(output);
// }
});
DEFPRINT(AST_Dot, function(self, output){
var expr = self.expression;
expr.print(output);
if (expr instanceof AST_Number && expr.getValue() >= 0) {
if (!/[xa-f.]/i.test(output.last())) {
output.print(".");
}
}
output.print(".");
// the name after dot would be mapped about here.
output.add_mapping(self.end);
output.print_name(self.property);
});
DEFPRINT(AST_Sub, function(self, output){
self.expression.print(output);
output.print("[");
self.property.print(output);
output.print("]");
});
DEFPRINT(AST_UnaryPrefix, function(self, output){
var op = self.operator;
output.print(op);
if (/^[a-z]/i.test(op))
output.space();
self.expression.print(output);
});
DEFPRINT(AST_UnaryPostfix, function(self, output){
self.expression.print(output);
output.print(self.operator);
});
DEFPRINT(AST_Binary, function(self, output){
self.left.print(output);
output.space();
output.print(self.operator);
output.space();
self.right.print(output);
});
DEFPRINT(AST_Conditional, function(self, output){
self.condition.print(output);
output.space();
output.print("?");
output.space();
self.consequent.print(output);
output.space();
output.colon();
self.alternative.print(output);
});
/* -----[ literals ]----- */
DEFPRINT(AST_Array, function(self, output){
output.with_square(function(){
var a = self.elements, len = a.length;
if (len > 0) output.space();
a.forEach(function(exp, i){
if (i) output.comma();
exp.print(output);
// If the final element is a hole, we need to make sure it
// doesn't look like a trailing comma, by inserting an actual
// trailing comma.
if (i === len - 1 && exp instanceof AST_Hole)
output.comma();
});
if (len > 0) output.space();
});
});
DEFPRINT(AST_Object, function(self, output){
if (self.properties.length > 0) output.with_block(function(){
self.properties.forEach(function(prop, i){
if (i) {
output.print(",");
output.newline();
}
output.indent();
prop.print(output);
});
output.newline();
});
else output.print("{}");
});
DEFPRINT(AST_ObjectKeyVal, function(self, output){
var key = self.key;
if (output.option("quote_keys")) {
output.print_string(key + "");
} else if ((typeof key == "number"
|| !output.option("beautify")
&& +key + "" == key)
&& parseFloat(key) >= 0) {
output.print(make_num(key));
} else if (RESERVED_WORDS(key) ? output.option("screw_ie8") : is_identifier_string(key)) {
output.print_name(key);
} else {
output.print_string(key);
}
output.colon();
self.value.print(output);
});
DEFPRINT(AST_ObjectSetter, function(self, output){
output.print("set");
self.value._do_print(output, true);
});
DEFPRINT(AST_ObjectGetter, function(self, output){
output.print("get");
self.value._do_print(output, true);
});
DEFPRINT(AST_Symbol, function(self, output){
var def = self.definition();
output.print_name(def ? def.mangled_name || def.name : self.name);
});
DEFPRINT(AST_Undefined, function(self, output){
output.print("void 0");
});
DEFPRINT(AST_Hole, noop);
DEFPRINT(AST_Infinity, function(self, output){
output.print("1/0");
});
DEFPRINT(AST_NaN, function(self, output){
output.print("0/0");
});
DEFPRINT(AST_This, function(self, output){
output.print("this");
});
DEFPRINT(AST_Constant, function(self, output){
output.print(self.getValue());
});
DEFPRINT(AST_String, function(self, output){
output.print_string(self.getValue());
});
DEFPRINT(AST_Number, function(self, output){
output.print(make_num(self.getValue()));
});
DEFPRINT(AST_RegExp, function(self, output){
var str = self.getValue().toString();
if (output.option("ascii_only"))
str = output.to_ascii(str);
output.print(str);
var p = output.parent();
if (p instanceof AST_Binary && /^in/.test(p.operator) && p.left === self)
output.print(" ");
});
function force_statement(stat, output) {
if (output.option("bracketize")) {
if (!stat || stat instanceof AST_EmptyStatement)
output.print("{}");
else if (stat instanceof AST_BlockStatement)
stat.print(output);
else output.with_block(function(){
output.indent();
stat.print(output);
output.newline();
});
} else {
if (!stat || stat instanceof AST_EmptyStatement)
output.force_semicolon();
else
stat.print(output);
}
};
// return true if the node at the top of the stack (that means the
// innermost node in the current output) is lexically the first in
// a statement.
function first_in_statement(output) {
var a = output.stack(), i = a.length, node = a[--i], p = a[--i];
while (i > 0) {
if (p instanceof AST_Statement && p.body === node)
return true;
if ((p instanceof AST_Seq && p.car === node ) ||
(p instanceof AST_Call && p.expression === node && !(p instanceof AST_New) ) ||
(p instanceof AST_Dot && p.expression === node ) ||
(p instanceof AST_Sub && p.expression === node ) ||
(p instanceof AST_Conditional && p.condition === node ) ||
(p instanceof AST_Binary && p.left === node ) ||
(p instanceof AST_UnaryPostfix && p.expression === node ))
{
node = p;
p = a[--i];
} else {
return false;
}
}
};
// self should be AST_New. decide if we want to show parens or not.
function no_constructor_parens(self, output) {
return self.args.length == 0 && !output.option("beautify");
};
function best_of(a) {
var best = a[0], len = best.length;
for (var i = 1; i < a.length; ++i) {
if (a[i].length < len) {
best = a[i];
len = best.length;
}
}
return best;
};
function make_num(num) {
var str = num.toString(10), a = [ str.replace(/^0\./, ".").replace('e+', 'e') ], m;
if (Math.floor(num) === num) {
if (num >= 0) {
a.push("0x" + num.toString(16).toLowerCase(), // probably pointless
"0" + num.toString(8)); // same.
} else {
a.push("-0x" + (-num).toString(16).toLowerCase(), // probably pointless
"-0" + (-num).toString(8)); // same.
}
if ((m = /^(.*?)(0+)$/.exec(num))) {
a.push(m[1] + "e" + m[2].length);
}
} else if ((m = /^0?\.(0+)(.*)$/.exec(num))) {
a.push(m[2] + "e-" + (m[1].length + m[2].length),
str.substr(str.indexOf(".")));
}
return best_of(a);
};
function make_block(stmt, output) {
if (stmt instanceof AST_BlockStatement) {
stmt.print(output);
return;
}
output.with_block(function(){
output.indent();
stmt.print(output);
output.newline();
});
};
/* -----[ source map generators ]----- */
function DEFMAP(nodetype, generator) {
nodetype.DEFMETHOD("add_source_map", function(stream){
generator(this, stream);
});
};
// We could easily add info for ALL nodes, but it seems to me that
// would be quite wasteful, hence this noop in the base class.
DEFMAP(AST_Node, noop);
function basic_sourcemap_gen(self, output) {
output.add_mapping(self.start);
};
// XXX: I'm not exactly sure if we need it for all of these nodes,
// or if we should add even more.
DEFMAP(AST_Directive, basic_sourcemap_gen);
DEFMAP(AST_Debugger, basic_sourcemap_gen);
DEFMAP(AST_Symbol, basic_sourcemap_gen);
DEFMAP(AST_Jump, basic_sourcemap_gen);
DEFMAP(AST_StatementWithBody, basic_sourcemap_gen);
DEFMAP(AST_LabeledStatement, noop); // since the label symbol will mark it
DEFMAP(AST_Lambda, basic_sourcemap_gen);
DEFMAP(AST_Switch, basic_sourcemap_gen);
DEFMAP(AST_SwitchBranch, basic_sourcemap_gen);
DEFMAP(AST_BlockStatement, basic_sourcemap_gen);
DEFMAP(AST_Toplevel, noop);
DEFMAP(AST_New, basic_sourcemap_gen);
DEFMAP(AST_Try, basic_sourcemap_gen);
DEFMAP(AST_Catch, basic_sourcemap_gen);
DEFMAP(AST_Finally, basic_sourcemap_gen);
DEFMAP(AST_Definitions, basic_sourcemap_gen);
DEFMAP(AST_Constant, basic_sourcemap_gen);
DEFMAP(AST_ObjectProperty, function(self, output){
output.add_mapping(self.start, self.key);
});
})();
/***********************************************************************
A JavaScript tokenizer / parser / beautifier / compressor.
https://github.com/mishoo/UglifyJS2
-------------------------------- (C) ---------------------------------
Author: Mihai Bazon
<mihai.bazon@gmail.com>
http://mihai.bazon.net/blog
Distributed under the BSD license:
Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***********************************************************************/
"use strict";
function Compressor(options, false_by_default) {
if (!(this instanceof Compressor))
return new Compressor(options, false_by_default);
TreeTransformer.call(this, this.before, this.after);
this.options = defaults(options, {
sequences : !false_by_default,
properties : !false_by_default,
dead_code : !false_by_default,
drop_debugger : !false_by_default,
unsafe : false,
unsafe_comps : false,
conditionals : !false_by_default,
comparisons : !false_by_default,
evaluate : !false_by_default,
booleans : !false_by_default,
loops : !false_by_default,
unused : !false_by_default,
hoist_funs : !false_by_default,
hoist_vars : false,
if_return : !false_by_default,
join_vars : !false_by_default,
cascade : !false_by_default,
side_effects : !false_by_default,
negate_iife : !false_by_default,
screw_ie8 : false,
warnings : true,
global_defs : {}
}, true);
};
Compressor.prototype = new TreeTransformer;
merge(Compressor.prototype, {
option: function(key) { return this.options[key] },
warn: function() {
if (this.options.warnings)
AST_Node.warn.apply(AST_Node, arguments);
},
before: function(node, descend, in_list) {
if (node._squeezed) return node;
if (node instanceof AST_Scope) {
node.drop_unused(this);
node = node.hoist_declarations(this);
}
descend(node, this);
node = node.optimize(this);
if (node instanceof AST_Scope) {
// dead code removal might leave further unused declarations.
// this'll usually save very few bytes, but the performance
// hit seems negligible so I'll just drop it here.
// no point to repeat warnings.
var save_warnings = this.options.warnings;
this.options.warnings = false;
node.drop_unused(this);
this.options.warnings = save_warnings;
}
node._squeezed = true;
return node;
}
});
(function(){
function OPT(node, optimizer) {
node.DEFMETHOD("optimize", function(compressor){
var self = this;
if (self._optimized) return self;
var opt = optimizer(self, compressor);
opt._optimized = true;
if (opt === self) return opt;
return opt.transform(compressor);
});
};
OPT(AST_Node, function(self, compressor){
return self;
});
AST_Node.DEFMETHOD("equivalent_to", function(node){
// XXX: this is a rather expensive way to test two node's equivalence:
return this.print_to_string() == node.print_to_string();
});
function make_node(ctor, orig, props) {
if (!props) props = {};
if (orig) {
if (!props.start) props.start = orig.start;
if (!props.end) props.end = orig.end;
}
return new ctor(props);
};
function make_node_from_constant(compressor, val, orig) {
// XXX: WIP.
// if (val instanceof AST_Node) return val.transform(new TreeTransformer(null, function(node){
// if (node instanceof AST_SymbolRef) {
// var scope = compressor.find_parent(AST_Scope);
// var def = scope.find_variable(node);
// node.thedef = def;
// return node;
// }
// })).transform(compressor);
if (val instanceof AST_Node) return val.transform(compressor);
switch (typeof val) {
case "string":
return make_node(AST_String, orig, {
value: val
}).optimize(compressor);
case "number":
return make_node(isNaN(val) ? AST_NaN : AST_Number, orig, {
value: val
}).optimize(compressor);
case "boolean":
return make_node(val ? AST_True : AST_False, orig).optimize(compressor);
case "undefined":
return make_node(AST_Undefined, orig).optimize(compressor);
default:
if (val === null) {
return make_node(AST_Null, orig).optimize(compressor);
}
if (val instanceof RegExp) {
return make_node(AST_RegExp, orig).optimize(compressor);
}
throw new Error(string_template("Can't handle constant of type: {type}", {
type: typeof val
}));
}
};
function as_statement_array(thing) {
if (thing === null) return [];
if (thing instanceof AST_BlockStatement) return thing.body;
if (thing instanceof AST_EmptyStatement) return [];
if (thing instanceof AST_Statement) return [ thing ];
throw new Error("Can't convert thing to statement array");
};
function is_empty(thing) {
if (thing === null) return true;
if (thing instanceof AST_EmptyStatement) return true;
if (thing instanceof AST_BlockStatement) return thing.body.length == 0;
return false;
};
function loop_body(x) {
if (x instanceof AST_Switch) return x;
if (x instanceof AST_For || x instanceof AST_ForIn || x instanceof AST_DWLoop) {
return (x.body instanceof AST_BlockStatement ? x.body : x);
}
return x;
};
function tighten_body(statements, compressor) {
var CHANGED;
do {
CHANGED = false;
statements = eliminate_spurious_blocks(statements);
if (compressor.option("dead_code")) {
statements = eliminate_dead_code(statements, compressor);
}
if (compressor.option("if_return")) {
statements = handle_if_return(statements, compressor);
}
if (compressor.option("sequences")) {
statements = sequencesize(statements, compressor);
}
if (compressor.option("join_vars")) {
statements = join_consecutive_vars(statements, compressor);
}
} while (CHANGED);
if (compressor.option("negate_iife")) {
negate_iifes(statements, compressor);
}
return statements;
function eliminate_spurious_blocks(statements) {
var seen_dirs = [];
return statements.reduce(function(a, stat){
if (stat instanceof AST_BlockStatement) {
CHANGED = true;
a.push.apply(a, eliminate_spurious_blocks(stat.body));
} else if (stat instanceof AST_EmptyStatement) {
CHANGED = true;
} else if (stat instanceof AST_Directive) {
if (seen_dirs.indexOf(stat.value) < 0) {
a.push(stat);
seen_dirs.push(stat.value);
} else {
CHANGED = true;
}
} else {
a.push(stat);
}
return a;
}, []);
};
function handle_if_return(statements, compressor) {
var self = compressor.self();
var in_lambda = self instanceof AST_Lambda;
var ret = [];
loop: for (var i = statements.length; --i >= 0;) {
var stat = statements[i];
switch (true) {
case (in_lambda && stat instanceof AST_Return && !stat.value && ret.length == 0):
CHANGED = true;
// note, ret.length is probably always zero
// because we drop unreachable code before this
// step. nevertheless, it's good to check.
continue loop;
case stat instanceof AST_If:
if (stat.body instanceof AST_Return) {
//---
// pretty silly case, but:
// if (foo()) return; return; ==> foo(); return;
if (((in_lambda && ret.length == 0)
|| (ret[0] instanceof AST_Return && !ret[0].value))
&& !stat.body.value && !stat.alternative) {
CHANGED = true;
var cond = make_node(AST_SimpleStatement, stat.condition, {
body: stat.condition
});
ret.unshift(cond);
continue loop;
}
//---
// if (foo()) return x; return y; ==> return foo() ? x : y;
if (ret[0] instanceof AST_Return && stat.body.value && ret[0].value && !stat.alternative) {
CHANGED = true;
stat = stat.clone();
stat.alternative = ret[0];
ret[0] = stat.transform(compressor);
continue loop;
}
//---
// if (foo()) return x; [ return ; ] ==> return foo() ? x : undefined;
if ((ret.length == 0 || ret[0] instanceof AST_Return) && stat.body.value && !stat.alternative && in_lambda) {
CHANGED = true;
stat = stat.clone();
stat.alternative = ret[0] || make_node(AST_Return, stat, {
value: make_node(AST_Undefined, stat)
});
ret[0] = stat.transform(compressor);
continue loop;
}
//---
// if (foo()) return; [ else x... ]; y... ==> if (!foo()) { x...; y... }
if (!stat.body.value && in_lambda) {
CHANGED = true;
stat = stat.clone();
stat.condition = stat.condition.negate(compressor);
stat.body = make_node(AST_BlockStatement, stat, {
body: as_statement_array(stat.alternative).concat(ret)
});
stat.alternative = null;
ret = [ stat.transform(compressor) ];
continue loop;
}
//---
if (ret.length == 1 && in_lambda && ret[0] instanceof AST_SimpleStatement
&& (!stat.alternative || stat.alternative instanceof AST_SimpleStatement)) {
CHANGED = true;
ret.push(make_node(AST_Return, ret[0], {
value: make_node(AST_Undefined, ret[0])
}).transform(compressor));
ret = as_statement_array(stat.alternative).concat(ret);
ret.unshift(stat);
continue loop;
}
}
var ab = aborts(stat.body);
var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab.label) : null;
if (ab && ((ab instanceof AST_Return && !ab.value && in_lambda)
|| (ab instanceof AST_Continue && self === loop_body(lct))
|| (ab instanceof AST_Break && lct instanceof AST_BlockStatement && self === lct))) {
if (ab.label) {
remove(ab.label.thedef.references, ab.label);
}
CHANGED = true;
var body = as_statement_array(stat.body).slice(0, -1);
stat = stat.clone();
stat.condition = stat.condition.negate(compressor);
stat.body = make_node(AST_BlockStatement, stat, {
body: ret
});
stat.alternative = make_node(AST_BlockStatement, stat, {
body: body
});
ret = [ stat.transform(compressor) ];
continue loop;
}
var ab = aborts(stat.alternative);
var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab.label) : null;
if (ab && ((ab instanceof AST_Return && !ab.value && in_lambda)
|| (ab instanceof AST_Continue && self === loop_body(lct))
|| (ab instanceof AST_Break && lct instanceof AST_BlockStatement && self === lct))) {
if (ab.label) {
remove(ab.label.thedef.references, ab.label);
}
CHANGED = true;
stat = stat.clone();
stat.body = make_node(AST_BlockStatement, stat.body, {
body: as_statement_array(stat.body).concat(ret)
});
stat.alternative = make_node(AST_BlockStatement, stat.alternative, {
body: as_statement_array(stat.alternative).slice(0, -1)
});
ret = [ stat.transform(compressor) ];
continue loop;
}
ret.unshift(stat);
break;
default:
ret.unshift(stat);
break;
}
}
return ret;
};
function eliminate_dead_code(statements, compressor) {
var has_quit = false;
var orig = statements.length;
var self = compressor.self();
statements = statements.reduce(function(a, stat){
if (has_quit) {
extract_declarations_from_unreachable_code(compressor, stat, a);
} else {
if (stat instanceof AST_LoopControl) {
var lct = compressor.loopcontrol_target(stat.label);
if ((stat instanceof AST_Break
&& lct instanceof AST_BlockStatement
&& loop_body(lct) === self) || (stat instanceof AST_Continue
&& loop_body(lct) === self)) {
if (stat.label) {
remove(stat.label.thedef.references, stat.label);
}
} else {
a.push(stat);
}
} else {
a.push(stat);
}
if (aborts(stat)) has_quit = true;
}
return a;
}, []);
CHANGED = statements.length != orig;
return statements;
};
function sequencesize(statements, compressor) {
if (statements.length < 2) return statements;
var seq = [], ret = [];
function push_seq() {
seq = AST_Seq.from_array(seq);
if (seq) ret.push(make_node(AST_SimpleStatement, seq, {
body: seq
}));
seq = [];
};
statements.forEach(function(stat){
if (stat instanceof AST_SimpleStatement) seq.push(stat.body);
else push_seq(), ret.push(stat);
});
push_seq();
ret = sequencesize_2(ret, compressor);
CHANGED = ret.length != statements.length;
return ret;
};
function sequencesize_2(statements, compressor) {
function cons_seq(right) {
ret.pop();
var left = prev.body;
if (left instanceof AST_Seq) {
left.add(right);
} else {
left = AST_Seq.cons(left, right);
}
return left.transform(compressor);
};
var ret = [], prev = null;
statements.forEach(function(stat){
if (prev) {
if (stat instanceof AST_For) {
var opera = {};
try {
prev.body.walk(new TreeWalker(function(node){
if (node instanceof AST_Binary && node.operator == "in")
throw opera;
}));
if (stat.init && !(stat.init instanceof AST_Definitions)) {
stat.init = cons_seq(stat.init);
}
else if (!stat.init) {
stat.init = prev.body;
ret.pop();
}
} catch(ex) {
if (ex !== opera) throw ex;
}
}
else if (stat instanceof AST_If) {
stat.condition = cons_seq(stat.condition);
}
else if (stat instanceof AST_With) {
stat.expression = cons_seq(stat.expression);
}
else if (stat instanceof AST_Exit && stat.value) {
stat.value = cons_seq(stat.value);
}
else if (stat instanceof AST_Exit) {
stat.value = cons_seq(make_node(AST_Undefined, stat));
}
else if (stat instanceof AST_Switch) {
stat.expression = cons_seq(stat.expression);
}
}
ret.push(stat);
prev = stat instanceof AST_SimpleStatement ? stat : null;
});
return ret;
};
function join_consecutive_vars(statements, compressor) {
var prev = null;
return statements.reduce(function(a, stat){
if (stat instanceof AST_Definitions && prev && prev.TYPE == stat.TYPE) {
prev.definitions = prev.definitions.concat(stat.definitions);
CHANGED = true;
}
else if (stat instanceof AST_For
&& prev instanceof AST_Definitions
&& (!stat.init || stat.init.TYPE == prev.TYPE)) {
CHANGED = true;
a.pop();
if (stat.init) {
stat.init.definitions = prev.definitions.concat(stat.init.definitions);
} else {
stat.init = prev;
}
a.push(stat);
prev = stat;
}
else {
prev = stat;
a.push(stat);
}
return a;
}, []);
};
function negate_iifes(statements, compressor) {
statements.forEach(function(stat){
if (stat instanceof AST_SimpleStatement) {
stat.body = (function transform(thing) {
return thing.transform(new TreeTransformer(function(node){
if (node instanceof AST_Call && node.expression instanceof AST_Function) {
return make_node(AST_UnaryPrefix, node, {
operator: "!",
expression: node
});
}
else if (node instanceof AST_Call) {
node.expression = transform(node.expression);
}
else if (node instanceof AST_Seq) {
node.car = transform(node.car);
}
else if (node instanceof AST_Conditional) {
var expr = transform(node.condition);
if (expr !== node.condition) {
// it has been negated, reverse
node.condition = expr;
var tmp = node.consequent;
node.consequent = node.alternative;
node.alternative = tmp;
}
}
return node;
}));
})(stat.body);
}
});
};
};
function extract_declarations_from_unreachable_code(compressor, stat, target) {
compressor.warn("Dropping unreachable code [{file}:{line},{col}]", stat.start);
stat.walk(new TreeWalker(function(node){
if (node instanceof AST_Definitions) {
compressor.warn("Declarations in unreachable code! [{file}:{line},{col}]", node.start);
node.remove_initializers();
target.push(node);
return true;
}
if (node instanceof AST_Defun) {
target.push(node);
return true;
}
if (node instanceof AST_Scope) {
return true;
}
}));
};
/* -----[ boolean/negation helpers ]----- */
// methods to determine whether an expression has a boolean result type
(function (def){
var unary_bool = [ "!", "delete" ];
var binary_bool = [ "in", "instanceof", "==", "!=", "===", "!==", "<", "<=", ">=", ">" ];
def(AST_Node, function(){ return false });
def(AST_UnaryPrefix, function(){
return member(this.operator, unary_bool);
});
def(AST_Binary, function(){
return member(this.operator, binary_bool) ||
( (this.operator == "&&" || this.operator == "||") &&
this.left.is_boolean() && this.right.is_boolean() );
});
def(AST_Conditional, function(){
return this.consequent.is_boolean() && this.alternative.is_boolean();
});
def(AST_Assign, function(){
return this.operator == "=" && this.right.is_boolean();
});
def(AST_Seq, function(){
return this.cdr.is_boolean();
});
def(AST_True, function(){ return true });
def(AST_False, function(){ return true });
})(function(node, func){
node.DEFMETHOD("is_boolean", func);
});
// methods to determine if an expression has a string result type
(function (def){
def(AST_Node, function(){ return false });
def(AST_String, function(){ return true });
def(AST_UnaryPrefix, function(){
return this.operator == "typeof";
});
def(AST_Binary, function(compressor){
return this.operator == "+" &&
(this.left.is_string(compressor) || this.right.is_string(compressor));
});
def(AST_Assign, function(compressor){
return (this.operator == "=" || this.operator == "+=") && this.right.is_string(compressor);
});
def(AST_Seq, function(compressor){
return this.cdr.is_string(compressor);
});
def(AST_Conditional, function(compressor){
return this.consequent.is_string(compressor) && this.alternative.is_string(compressor);
});
def(AST_Call, function(compressor){
return compressor.option("unsafe")
&& this.expression instanceof AST_SymbolRef
&& this.expression.name == "String"
&& this.expression.undeclared();
});
})(function(node, func){
node.DEFMETHOD("is_string", func);
});
function best_of(ast1, ast2) {
return ast1.print_to_string().length >
ast2.print_to_string().length
? ast2 : ast1;
};
// methods to evaluate a constant expression
(function (def){
// The evaluate method returns an array with one or two
// elements. If the node has been successfully reduced to a
// constant, then the second element tells us the value;
// otherwise the second element is missing. The first element
// of the array is always an AST_Node descendant; when
// evaluation was successful it's a node that represents the
// constant; otherwise it's the original node.
AST_Node.DEFMETHOD("evaluate", function(compressor){
if (!compressor.option("evaluate")) return [ this ];
try {
var val = this._eval(), ast = make_node_from_constant(compressor, val, this);
return [ best_of(ast, this), val ];
} catch(ex) {
if (ex !== def) throw ex;
return [ this ];
}
});
def(AST_Statement, function(){
throw new Error(string_template("Cannot evaluate a statement [{file}:{line},{col}]", this.start));
});
def(AST_Function, function(){
// XXX: AST_Function inherits from AST_Scope, which itself
// inherits from AST_Statement; however, an AST_Function
// isn't really a statement. This could byte in other
// places too. :-( Wish JS had multiple inheritance.
throw def;
});
function ev(node) {
return node._eval();
};
def(AST_Node, function(){
throw def; // not constant
});
def(AST_Constant, function(){
return this.getValue();
});
def(AST_UnaryPrefix, function(){
var e = this.expression;
switch (this.operator) {
case "!": return !ev(e);
case "typeof":
// Function would be evaluated to an array and so typeof would
// incorrectly return 'object'. Hence making is a special case.
if (e instanceof AST_Function) return typeof function(){};
e = ev(e);
// typeof <RegExp> returns "object" or "function" on different platforms
// so cannot evaluate reliably
if (e instanceof RegExp) throw def;
return typeof e;
case "void": return void ev(e);
case "~": return ~ev(e);
case "-":
e = ev(e);
if (e === 0) throw def;
return -e;
case "+": return +ev(e);
}
throw def;
});
def(AST_Binary, function(){
var left = this.left, right = this.right;
switch (this.operator) {
case "&&" : return ev(left) && ev(right);
case "||" : return ev(left) || ev(right);
case "|" : return ev(left) | ev(right);
case "&" : return ev(left) & ev(right);
case "^" : return ev(left) ^ ev(right);
case "+" : return ev(left) + ev(right);
case "*" : return ev(left) * ev(right);
case "/" : return ev(left) / ev(right);
case "%" : return ev(left) % ev(right);
case "-" : return ev(left) - ev(right);
case "<<" : return ev(left) << ev(right);
case ">>" : return ev(left) >> ev(right);
case ">>>" : return ev(left) >>> ev(right);
case "==" : return ev(left) == ev(right);
case "===" : return ev(left) === ev(right);
case "!=" : return ev(left) != ev(right);
case "!==" : return ev(left) !== ev(right);
case "<" : return ev(left) < ev(right);
case "<=" : return ev(left) <= ev(right);
case ">" : return ev(left) > ev(right);
case ">=" : return ev(left) >= ev(right);
case "in" : return ev(left) in ev(right);
case "instanceof" : return ev(left) instanceof ev(right);
}
throw def;
});
def(AST_Conditional, function(){
return ev(this.condition)
? ev(this.consequent)
: ev(this.alternative);
});
def(AST_SymbolRef, function(){
var d = this.definition();
if (d && d.constant && d.init) return ev(d.init);
throw def;
});
})(function(node, func){
node.DEFMETHOD("_eval", func);
});
// method to negate an expression
(function(def){
function basic_negation(exp) {
return make_node(AST_UnaryPrefix, exp, {
operator: "!",
expression: exp
});
};
def(AST_Node, function(){
return basic_negation(this);
});
def(AST_Statement, function(){
throw new Error("Cannot negate a statement");
});
def(AST_Function, function(){
return basic_negation(this);
});
def(AST_UnaryPrefix, function(){
if (this.operator == "!")
return this.expression;
return basic_negation(this);
});
def(AST_Seq, function(compressor){
var self = this.clone();
self.cdr = self.cdr.negate(compressor);
return self;
});
def(AST_Conditional, function(compressor){
var self = this.clone();
self.consequent = self.consequent.negate(compressor);
self.alternative = self.alternative.negate(compressor);
return best_of(basic_negation(this), self);
});
def(AST_Binary, function(compressor){
var self = this.clone(), op = this.operator;
if (compressor.option("unsafe_comps")) {
switch (op) {
case "<=" : self.operator = ">" ; return self;
case "<" : self.operator = ">=" ; return self;
case ">=" : self.operator = "<" ; return self;
case ">" : self.operator = "<=" ; return self;
}
}
switch (op) {
case "==" : self.operator = "!="; return self;
case "!=" : self.operator = "=="; return self;
case "===": self.operator = "!=="; return self;
case "!==": self.operator = "==="; return self;
case "&&":
self.operator = "||";
self.left = self.left.negate(compressor);
self.right = self.right.negate(compressor);
return best_of(basic_negation(this), self);
case "||":
self.operator = "&&";
self.left = self.left.negate(compressor);
self.right = self.right.negate(compressor);
return best_of(basic_negation(this), self);
}
return basic_negation(this);
});
})(function(node, func){
node.DEFMETHOD("negate", function(compressor){
return func.call(this, compressor);
});
});
// determine if expression has side effects
(function(def){
def(AST_Node, function(){ return true });
def(AST_EmptyStatement, function(){ return false });
def(AST_Constant, function(){ return false });
def(AST_This, function(){ return false });
def(AST_Block, function(){
for (var i = this.body.length; --i >= 0;) {
if (this.body[i].has_side_effects())
return true;
}
return false;
});
def(AST_SimpleStatement, function(){
return this.body.has_side_effects();
});
def(AST_Defun, function(){ return true });
def(AST_Function, function(){ return false });
def(AST_Binary, function(){
return this.left.has_side_effects()
|| this.right.has_side_effects();
});
def(AST_Assign, function(){ return true });
def(AST_Conditional, function(){
return this.condition.has_side_effects()
|| this.consequent.has_side_effects()
|| this.alternative.has_side_effects();
});
def(AST_Unary, function(){
return this.operator == "delete"
|| this.operator == "++"
|| this.operator == "--"
|| this.expression.has_side_effects();
});
def(AST_SymbolRef, function(){ return false });
def(AST_Object, function(){
for (var i = this.properties.length; --i >= 0;)
if (this.properties[i].has_side_effects())
return true;
return false;
});
def(AST_ObjectProperty, function(){
return this.value.has_side_effects();
});
def(AST_Array, function(){
for (var i = this.elements.length; --i >= 0;)
if (this.elements[i].has_side_effects())
return true;
return false;
});
// def(AST_Dot, function(){
// return this.expression.has_side_effects();
// });
// def(AST_Sub, function(){
// return this.expression.has_side_effects()
// || this.property.has_side_effects();
// });
def(AST_PropAccess, function(){
return true;
});
def(AST_Seq, function(){
return this.car.has_side_effects()
|| this.cdr.has_side_effects();
});
})(function(node, func){
node.DEFMETHOD("has_side_effects", func);
});
// tell me if a statement aborts
function aborts(thing) {
return thing && thing.aborts();
};
(function(def){
def(AST_Statement, function(){ return null });
def(AST_Jump, function(){ return this });
function block_aborts(){
var n = this.body.length;
return n > 0 && aborts(this.body[n - 1]);
};
def(AST_BlockStatement, block_aborts);
def(AST_SwitchBranch, block_aborts);
def(AST_If, function(){
return this.alternative && aborts(this.body) && aborts(this.alternative);
});
})(function(node, func){
node.DEFMETHOD("aborts", func);
});
/* -----[ optimizers ]----- */
OPT(AST_Directive, function(self, compressor){
if (self.scope.has_directive(self.value) !== self.scope) {
return make_node(AST_EmptyStatement, self);
}
return self;
});
OPT(AST_Debugger, function(self, compressor){
if (compressor.option("drop_debugger"))
return make_node(AST_EmptyStatement, self);
return self;
});
OPT(AST_LabeledStatement, function(self, compressor){
if (self.body instanceof AST_Break
&& compressor.loopcontrol_target(self.body.label) === self.body) {
return make_node(AST_EmptyStatement, self);
}
return self.label.references.length == 0 ? self.body : self;
});
OPT(AST_Block, function(self, compressor){
self.body = tighten_body(self.body, compressor);
return self;
});
OPT(AST_BlockStatement, function(self, compressor){
self.body = tighten_body(self.body, compressor);
switch (self.body.length) {
case 1: return self.body[0];
case 0: return make_node(AST_EmptyStatement, self);
}
return self;
});
AST_Scope.DEFMETHOD("drop_unused", function(compressor){
var self = this;
if (compressor.option("unused")
&& !(self instanceof AST_Toplevel)
&& !self.uses_eval
) {
var in_use = [];
var initializations = new Dictionary();
// pass 1: find out which symbols are directly used in
// this scope (not in nested scopes).
var scope = this;
var tw = new TreeWalker(function(node, descend){
if (node !== self) {
if (node instanceof AST_Defun) {
initializations.add(node.name.name, node);
return true; // don't go in nested scopes
}
if (node instanceof AST_Definitions && scope === self) {
node.definitions.forEach(function(def){
if (def.value) {
initializations.add(def.name.name, def.value);
if (def.value.has_side_effects()) {
def.value.walk(tw);
}
}
});
return true;
}
if (node instanceof AST_SymbolRef) {
push_uniq(in_use, node.definition());
return true;
}
if (node instanceof AST_Scope) {
var save_scope = scope;
scope = node;
descend();
scope = save_scope;
return true;
}
}
});
self.walk(tw);
// pass 2: for every used symbol we need to walk its
// initialization code to figure out if it uses other
// symbols (that may not be in_use).
for (var i = 0; i < in_use.length; ++i) {
in_use[i].orig.forEach(function(decl){
// undeclared globals will be instanceof AST_SymbolRef
var init = initializations.get(decl.name);
if (init) init.forEach(function(init){
var tw = new TreeWalker(function(node){
if (node instanceof AST_SymbolRef) {
push_uniq(in_use, node.definition());
}
});
init.walk(tw);
});
});
}
// pass 3: we should drop declarations not in_use
var tt = new TreeTransformer(
function before(node, descend, in_list) {
if (node instanceof AST_Lambda && !(node instanceof AST_Accessor)) {
for (var a = node.argnames, i = a.length; --i >= 0;) {
var sym = a[i];
if (sym.unreferenced()) {
a.pop();
compressor.warn("Dropping unused function argument {name} [{file}:{line},{col}]", {
name : sym.name,
file : sym.start.file,
line : sym.start.line,
col : sym.start.col
});
}
else break;
}
}
if (node instanceof AST_Defun && node !== self) {
if (!member(node.name.definition(), in_use)) {
compressor.warn("Dropping unused function {name} [{file}:{line},{col}]", {
name : node.name.name,
file : node.name.start.file,
line : node.name.start.line,
col : node.name.start.col
});
return make_node(AST_EmptyStatement, node);
}
return node;
}
if (node instanceof AST_Definitions && !(tt.parent() instanceof AST_ForIn)) {
var def = node.definitions.filter(function(def){
if (member(def.name.definition(), in_use)) return true;
var w = {
name : def.name.name,
file : def.name.start.file,
line : def.name.start.line,
col : def.name.start.col
};
if (def.value && def.value.has_side_effects()) {
def._unused_side_effects = true;
compressor.warn("Side effects in initialization of unused variable {name} [{file}:{line},{col}]", w);
return true;
}
compressor.warn("Dropping unused variable {name} [{file}:{line},{col}]", w);
return false;
});
// place uninitialized names at the start
def = mergeSort(def, function(a, b){
if (!a.value && b.value) return -1;
if (!b.value && a.value) return 1;
return 0;
});
// for unused names whose initialization has
// side effects, we can cascade the init. code
// into the next one, or next statement.
var side_effects = [];
for (var i = 0; i < def.length;) {
var x = def[i];
if (x._unused_side_effects) {
side_effects.push(x.value);
def.splice(i, 1);
} else {
if (side_effects.length > 0) {
side_effects.push(x.value);
x.value = AST_Seq.from_array(side_effects);
side_effects = [];
}
++i;
}
}
if (side_effects.length > 0) {
side_effects = make_node(AST_BlockStatement, node, {
body: [ make_node(AST_SimpleStatement, node, {
body: AST_Seq.from_array(side_effects)
}) ]
});
} else {
side_effects = null;
}
if (def.length == 0 && !side_effects) {
return make_node(AST_EmptyStatement, node);
}
if (def.length == 0) {
return side_effects;
}
node.definitions = def;
if (side_effects) {
side_effects.body.unshift(node);
node = side_effects;
}
return node;
}
if (node instanceof AST_For && node.init instanceof AST_BlockStatement) {
descend(node, this);
// certain combination of unused name + side effect leads to:
// https://github.com/mishoo/UglifyJS2/issues/44
// that's an invalid AST.
// We fix it at this stage by moving the `var` outside the `for`.
var body = node.init.body.slice(0, -1);
node.init = node.init.body.slice(-1)[0].body;
body.push(node);
return in_list ? MAP.splice(body) : make_node(AST_BlockStatement, node, {
body: body
});
}
if (node instanceof AST_Scope && node !== self)
return node;
}
);
self.transform(tt);
}
});
AST_Scope.DEFMETHOD("hoist_declarations", function(compressor){
var hoist_funs = compressor.option("hoist_funs");
var hoist_vars = compressor.option("hoist_vars");
var self = this;
if (hoist_funs || hoist_vars) {
var dirs = [];
var hoisted = [];
var vars = new Dictionary(), vars_found = 0, var_decl = 0;
// let's count var_decl first, we seem to waste a lot of
// space if we hoist `var` when there's only one.
self.walk(new TreeWalker(function(node){
if (node instanceof AST_Scope && node !== self)
return true;
if (node instanceof AST_Var) {
++var_decl;
return true;
}
}));
hoist_vars = hoist_vars && var_decl > 1;
var tt = new TreeTransformer(
function before(node) {
if (node !== self) {
if (node instanceof AST_Directive) {
dirs.push(node);
return make_node(AST_EmptyStatement, node);
}
if (node instanceof AST_Defun && hoist_funs) {
hoisted.push(node);
return make_node(AST_EmptyStatement, node);
}
if (node instanceof AST_Var && hoist_vars) {
node.definitions.forEach(function(def){
vars.set(def.name.name, def);
++vars_found;
});
var seq = node.to_assignments();
var p = tt.parent();
if (p instanceof AST_ForIn && p.init === node) {
if (seq == null) return node.definitions[0].name;
return seq;
}
if (p instanceof AST_For && p.init === node) {
return seq;
}
if (!seq) return make_node(AST_EmptyStatement, node);
return make_node(AST_SimpleStatement, node, {
body: seq
});
}
if (node instanceof AST_Scope)
return node; // to avoid descending in nested scopes
}
}
);
self = self.transform(tt);
if (vars_found > 0) {
// collect only vars which don't show up in self's arguments list
var defs = [];
vars.each(function(def, name){
if (self instanceof AST_Lambda
&& find_if(function(x){ return x.name == def.name.name },
self.argnames)) {
vars.del(name);
} else {
def = def.clone();
def.value = null;
defs.push(def);
vars.set(name, def);
}
});
if (defs.length > 0) {
// try to merge in assignments
for (var i = 0; i < self.body.length;) {
if (self.body[i] instanceof AST_SimpleStatement) {
var expr = self.body[i].body, sym, assign;
if (expr instanceof AST_Assign
&& expr.operator == "="
&& (sym = expr.left) instanceof AST_Symbol
&& vars.has(sym.name))
{
var def = vars.get(sym.name);
if (def.value) break;
def.value = expr.right;
remove(defs, def);
defs.push(def);
self.body.splice(i, 1);
continue;
}
if (expr instanceof AST_Seq
&& (assign = expr.car) instanceof AST_Assign
&& assign.operator == "="
&& (sym = assign.left) instanceof AST_Symbol
&& vars.has(sym.name))
{
var def = vars.get(sym.name);
if (def.value) break;
def.value = assign.right;
remove(defs, def);
defs.push(def);
self.body[i].body = expr.cdr;
continue;
}
}
if (self.body[i] instanceof AST_EmptyStatement) {
self.body.splice(i, 1);
continue;
}
if (self.body[i] instanceof AST_BlockStatement) {
var tmp = [ i, 1 ].concat(self.body[i].body);
self.body.splice.apply(self.body, tmp);
continue;
}
break;
}
defs = make_node(AST_Var, self, {
definitions: defs
});
hoisted.push(defs);
};
}
self.body = dirs.concat(hoisted, self.body);
}
return self;
});
OPT(AST_SimpleStatement, function(self, compressor){
if (compressor.option("side_effects")) {
if (!self.body.has_side_effects()) {
compressor.warn("Dropping side-effect-free statement [{file}:{line},{col}]", self.start);
return make_node(AST_EmptyStatement, self);
}
}
return self;
});
OPT(AST_DWLoop, function(self, compressor){
var cond = self.condition.evaluate(compressor);
self.condition = cond[0];
if (!compressor.option("loops")) return self;
if (cond.length > 1) {
if (cond[1]) {
return make_node(AST_For, self, {
body: self.body
});
} else if (self instanceof AST_While) {
if (compressor.option("dead_code")) {
var a = [];
extract_declarations_from_unreachable_code(compressor, self.body, a);
return make_node(AST_BlockStatement, self, { body: a });
}
}
}
return self;
});
function if_break_in_loop(self, compressor) {
function drop_it(rest) {
rest = as_statement_array(rest);
if (self.body instanceof AST_BlockStatement) {
self.body = self.body.clone();
self.body.body = rest.concat(self.body.body.slice(1));
self.body = self.body.transform(compressor);
} else {
self.body = make_node(AST_BlockStatement, self.body, {
body: rest
}).transform(compressor);
}
if_break_in_loop(self, compressor);
}
var first = self.body instanceof AST_BlockStatement ? self.body.body[0] : self.body;
if (first instanceof AST_If) {
if (first.body instanceof AST_Break
&& compressor.loopcontrol_target(first.body.label) === self) {
if (self.condition) {
self.condition = make_node(AST_Binary, self.condition, {
left: self.condition,
operator: "&&",
right: first.condition.negate(compressor),
});
} else {
self.condition = first.condition.negate(compressor);
}
drop_it(first.alternative);
}
else if (first.alternative instanceof AST_Break
&& compressor.loopcontrol_target(first.alternative.label) === self) {
if (self.condition) {
self.condition = make_node(AST_Binary, self.condition, {
left: self.condition,
operator: "&&",
right: first.condition,
});
} else {
self.condition = first.condition;
}
drop_it(first.body);
}
}
};
OPT(AST_While, function(self, compressor) {
if (!compressor.option("loops")) return self;
self = AST_DWLoop.prototype.optimize.call(self, compressor);
if (self instanceof AST_While) {
if_break_in_loop(self, compressor);
self = make_node(AST_For, self, self).transform(compressor);
}
return self;
});
OPT(AST_For, function(self, compressor){
var cond = self.condition;
if (cond) {
cond = cond.evaluate(compressor);
self.condition = cond[0];
}
if (!compressor.option("loops")) return self;
if (cond) {
if (cond.length > 1 && !cond[1]) {
if (compressor.option("dead_code")) {
var a = [];
if (self.init instanceof AST_Statement) {
a.push(self.init);
}
else if (self.init) {
a.push(make_node(AST_SimpleStatement, self.init, {
body: self.init
}));
}
extract_declarations_from_unreachable_code(compressor, self.body, a);
return make_node(AST_BlockStatement, self, { body: a });
}
}
}
if_break_in_loop(self, compressor);
return self;
});
OPT(AST_If, function(self, compressor){
if (!compressor.option("conditionals")) return self;
// if condition can be statically determined, warn and drop
// one of the blocks. note, statically determined implies
// “has no side effects”; also it doesn't work for cases like
// `x && true`, though it probably should.
var cond = self.condition.evaluate(compressor);
self.condition = cond[0];
if (cond.length > 1) {
if (cond[1]) {
compressor.warn("Condition always true [{file}:{line},{col}]", self.condition.start);
if (compressor.option("dead_code")) {
var a = [];
if (self.alternative) {
extract_declarations_from_unreachable_code(compressor, self.alternative, a);
}
a.push(self.body);
return make_node(AST_BlockStatement, self, { body: a }).transform(compressor);
}
} else {
compressor.warn("Condition always false [{file}:{line},{col}]", self.condition.start);
if (compressor.option("dead_code")) {
var a = [];
extract_declarations_from_unreachable_code(compressor, self.body, a);
if (self.alternative) a.push(self.alternative);
return make_node(AST_BlockStatement, self, { body: a }).transform(compressor);
}
}
}
if (is_empty(self.alternative)) self.alternative = null;
var negated = self.condition.negate(compressor);
var negated_is_best = best_of(self.condition, negated) === negated;
if (self.alternative && negated_is_best) {
negated_is_best = false; // because we already do the switch here.
self.condition = negated;
var tmp = self.body;
self.body = self.alternative || make_node(AST_EmptyStatement);
self.alternative = tmp;
}
if (is_empty(self.body) && is_empty(self.alternative)) {
return make_node(AST_SimpleStatement, self.condition, {
body: self.condition
}).transform(compressor);
}
if (self.body instanceof AST_SimpleStatement
&& self.alternative instanceof AST_SimpleStatement) {
return make_node(AST_SimpleStatement, self, {
body: make_node(AST_Conditional, self, {
condition : self.condition,
consequent : self.body.body,
alternative : self.alternative.body
})
}).transform(compressor);
}
if (is_empty(self.alternative) && self.body instanceof AST_SimpleStatement) {
if (negated_is_best) return make_node(AST_SimpleStatement, self, {
body: make_node(AST_Binary, self, {
operator : "||",
left : negated,
right : self.body.body
})
}).transform(compressor);
return make_node(AST_SimpleStatement, self, {
body: make_node(AST_Binary, self, {
operator : "&&",
left : self.condition,
right : self.body.body
})
}).transform(compressor);
}
if (self.body instanceof AST_EmptyStatement
&& self.alternative
&& self.alternative instanceof AST_SimpleStatement) {
return make_node(AST_SimpleStatement, self, {
body: make_node(AST_Binary, self, {
operator : "||",
left : self.condition,
right : self.alternative.body
})
}).transform(compressor);
}
if (self.body instanceof AST_Exit
&& self.alternative instanceof AST_Exit
&& self.body.TYPE == self.alternative.TYPE) {
return make_node(self.body.CTOR, self, {
value: make_node(AST_Conditional, self, {
condition : self.condition,
consequent : self.body.value || make_node(AST_Undefined, self.body).optimize(compressor),
alternative : self.alternative.value || make_node(AST_Undefined, self.alternative).optimize(compressor)
})
}).transform(compressor);
}
if (self.body instanceof AST_If
&& !self.body.alternative
&& !self.alternative) {
self.condition = make_node(AST_Binary, self.condition, {
operator: "&&",
left: self.condition,
right: self.body.condition
}).transform(compressor);
self.body = self.body.body;
}
if (aborts(self.body)) {
if (self.alternative) {
var alt = self.alternative;
self.alternative = null;
return make_node(AST_BlockStatement, self, {
body: [ self, alt ]
}).transform(compressor);
}
}
if (aborts(self.alternative)) {
var body = self.body;
self.body = self.alternative;
self.condition = negated_is_best ? negated : self.condition.negate(compressor);
self.alternative = null;
return make_node(AST_BlockStatement, self, {
body: [ self, body ]
}).transform(compressor);
}
return self;
});
OPT(AST_Switch, function(self, compressor){
if (self.body.length == 0 && compressor.option("conditionals")) {
return make_node(AST_SimpleStatement, self, {
body: self.expression
}).transform(compressor);
}
for(;;) {
var last_branch = self.body[self.body.length - 1];
if (last_branch) {
var stat = last_branch.body[last_branch.body.length - 1]; // last statement
if (stat instanceof AST_Break && loop_body(compressor.loopcontrol_target(stat.label)) === self)
last_branch.body.pop();
if (last_branch instanceof AST_Default && last_branch.body.length == 0) {
self.body.pop();
continue;
}
}
break;
}
var exp = self.expression.evaluate(compressor);
out: if (exp.length == 2) try {
// constant expression
self.expression = exp[0];
if (!compressor.option("dead_code")) break out;
var value = exp[1];
var in_if = false;
var in_block = false;
var started = false;
var stopped = false;
var ruined = false;
var tt = new TreeTransformer(function(node, descend, in_list){
if (node instanceof AST_Lambda || node instanceof AST_SimpleStatement) {
// no need to descend these node types
return node;
}
else if (node instanceof AST_Switch && node === self) {
node = node.clone();
descend(node, this);
return ruined ? node : make_node(AST_BlockStatement, node, {
body: node.body.reduce(function(a, branch){
return a.concat(branch.body);
}, [])
}).transform(compressor);
}
else if (node instanceof AST_If || node instanceof AST_Try) {
var save = in_if;
in_if = !in_block;
descend(node, this);
in_if = save;
return node;
}
else if (node instanceof AST_StatementWithBody || node instanceof AST_Switch) {
var save = in_block;
in_block = true;
descend(node, this);
in_block = save;
return node;
}
else if (node instanceof AST_Break && this.loopcontrol_target(node.label) === self) {
if (in_if) {
ruined = true;
return node;
}
if (in_block) return node;
stopped = true;
return in_list ? MAP.skip : make_node(AST_EmptyStatement, node);
}
else if (node instanceof AST_SwitchBranch && this.parent() === self) {
if (stopped) return MAP.skip;
if (node instanceof AST_Case) {
var exp = node.expression.evaluate(compressor);
if (exp.length < 2) {
// got a case with non-constant expression, baling out
throw self;
}
if (exp[1] === value || started) {
started = true;
if (aborts(node)) stopped = true;
descend(node, this);
return node;
}
return MAP.skip;
}
descend(node, this);
return node;
}
});
tt.stack = compressor.stack.slice(); // so that's able to see parent nodes
self = self.transform(tt);
} catch(ex) {
if (ex !== self) throw ex;
}
return self;
});
OPT(AST_Case, function(self, compressor){
self.body = tighten_body(self.body, compressor);
return self;
});
OPT(AST_Try, function(self, compressor){
self.body = tighten_body(self.body, compressor);
return self;
});
AST_Definitions.DEFMETHOD("remove_initializers", function(){
this.definitions.forEach(function(def){ def.value = null });
});
AST_Definitions.DEFMETHOD("to_assignments", function(){
var assignments = this.definitions.reduce(function(a, def){
if (def.value) {
var name = make_node(AST_SymbolRef, def.name, def.name);
a.push(make_node(AST_Assign, def, {
operator : "=",
left : name,
right : def.value
}));
}
return a;
}, []);
if (assignments.length == 0) return null;
return AST_Seq.from_array(assignments);
});
OPT(AST_Definitions, function(self, compressor){
if (self.definitions.length == 0)
return make_node(AST_EmptyStatement, self);
return self;
});
OPT(AST_Function, function(self, compressor){
self = AST_Lambda.prototype.optimize.call(self, compressor);
if (compressor.option("unused")) {
if (self.name && self.name.unreferenced()) {
self.name = null;
}
}
return self;
});
OPT(AST_Call, function(self, compressor){
if (compressor.option("unsafe")) {
var exp = self.expression;
if (exp instanceof AST_SymbolRef && exp.undeclared()) {
switch (exp.name) {
case "Array":
if (self.args.length != 1) {
return make_node(AST_Array, self, {
elements: self.args
});
}
break;
case "Object":
if (self.args.length == 0) {
return make_node(AST_Object, self, {
properties: []
});
}
break;
case "String":
if (self.args.length == 0) return make_node(AST_String, self, {
value: ""
});
return make_node(AST_Binary, self, {
left: self.args[0],
operator: "+",
right: make_node(AST_String, self, { value: "" })
});
case "Function":
if (all(self.args, function(x){ return x instanceof AST_String })) {
// quite a corner-case, but we can handle it:
// https://github.com/mishoo/UglifyJS2/issues/203
// if the code argument is a constant, then we can minify it.
try {
var code = "(function(" + self.args.slice(0, -1).map(function(arg){
return arg.value;
}).join(",") + "){" + self.args[self.args.length - 1].value + "})()";
var ast = parse(code);
ast.figure_out_scope();
var comp = new Compressor(compressor.options);
ast = ast.transform(comp);
ast.figure_out_scope();
ast.mangle_names();
var fun = ast.body[0].body.expression;
var args = fun.argnames.map(function(arg, i){
return make_node(AST_String, self.args[i], {
value: arg.print_to_string()
});
});
var code = OutputStream();
AST_BlockStatement.prototype._codegen.call(fun, fun, code);
code = code.toString().replace(/^\{|\}$/g, "");
args.push(make_node(AST_String, self.args[self.args.length - 1], {
value: code
}));
self.args = args;
return self;
} catch(ex) {
if (ex instanceof JS_Parse_Error) {
compressor.warn("Error parsing code passed to new Function [{file}:{line},{col}]", self.args[self.args.length - 1].start);
compressor.warn(ex.toString());
} else {
console.log(ex);
}
}
}
break;
}
}
else if (exp instanceof AST_Dot && exp.property == "toString" && self.args.length == 0) {
return make_node(AST_Binary, self, {
left: make_node(AST_String, self, { value: "" }),
operator: "+",
right: exp.expression
}).transform(compressor);
}
}
if (compressor.option("side_effects")) {
if (self.expression instanceof AST_Function
&& self.args.length == 0
&& !AST_Block.prototype.has_side_effects.call(self.expression)) {
return make_node(AST_Undefined, self).transform(compressor);
}
}
return self;
});
OPT(AST_New, function(self, compressor){
if (compressor.option("unsafe")) {
var exp = self.expression;
if (exp instanceof AST_SymbolRef && exp.undeclared()) {
switch (exp.name) {
case "Object":
case "RegExp":
case "Function":
case "Error":
case "Array":
return make_node(AST_Call, self, self).transform(compressor);
}
}
}
return self;
});
OPT(AST_Seq, function(self, compressor){
if (!compressor.option("side_effects"))
return self;
if (!self.car.has_side_effects()) {
// we shouldn't compress (1,eval)(something) to
// eval(something) because that changes the meaning of
// eval (becomes lexical instead of global).
var p;
if (!(self.cdr instanceof AST_SymbolRef
&& self.cdr.name == "eval"
&& self.cdr.undeclared()
&& (p = compressor.parent()) instanceof AST_Call
&& p.expression === self)) {
return self.cdr;
}
}
if (compressor.option("cascade")) {
if (self.car instanceof AST_Assign
&& !self.car.left.has_side_effects()
&& self.car.left.equivalent_to(self.cdr)) {
return self.car;
}
if (!self.car.has_side_effects()
&& !self.cdr.has_side_effects()
&& self.car.equivalent_to(self.cdr)) {
return self.car;
}
}
return self;
});
AST_Unary.DEFMETHOD("lift_sequences", function(compressor){
if (compressor.option("sequences")) {
if (this.expression instanceof AST_Seq) {
var seq = this.expression;
var x = seq.to_array();
this.expression = x.pop();
x.push(this);
seq = AST_Seq.from_array(x).transform(compressor);
return seq;
}
}
return this;
});
OPT(AST_UnaryPostfix, function(self, compressor){
return self.lift_sequences(compressor);
});
OPT(AST_UnaryPrefix, function(self, compressor){
self = self.lift_sequences(compressor);
var e = self.expression;
if (compressor.option("booleans") && compressor.in_boolean_context()) {
switch (self.operator) {
case "!":
if (e instanceof AST_UnaryPrefix && e.operator == "!") {
// !!foo ==> foo, if we're in boolean context
return e.expression;
}
break;
case "typeof":
// typeof always returns a non-empty string, thus it's
// always true in booleans
compressor.warn("Boolean expression always true [{file}:{line},{col}]", self.start);
return make_node(AST_True, self);
}
if (e instanceof AST_Binary && self.operator == "!") {
self = best_of(self, e.negate(compressor));
}
}
return self.evaluate(compressor)[0];
});
AST_Binary.DEFMETHOD("lift_sequences", function(compressor){
if (compressor.option("sequences")) {
if (this.left instanceof AST_Seq) {
var seq = this.left;
var x = seq.to_array();
this.left = x.pop();
x.push(this);
seq = AST_Seq.from_array(x).transform(compressor);
return seq;
}
if (this.right instanceof AST_Seq
&& !(this.operator == "||" || this.operator == "&&")
&& !this.left.has_side_effects()) {
var seq = this.right;
var x = seq.to_array();
this.right = x.pop();
x.push(this);
seq = AST_Seq.from_array(x).transform(compressor);
return seq;
}
}
return this;
});
var commutativeOperators = makePredicate("== === != !== * & | ^");
OPT(AST_Binary, function(self, compressor){
var reverse = compressor.has_directive("use asm") ? noop
: function(op, force) {
if (force || !(self.left.has_side_effects() || self.right.has_side_effects())) {
if (op) self.operator = op;
var tmp = self.left;
self.left = self.right;
self.right = tmp;
}
};
if (commutativeOperators(self.operator)) {
if (self.right instanceof AST_Constant
&& !(self.left instanceof AST_Constant)) {
// if right is a constant, whatever side effects the
// left side might have could not influence the
// result. hence, force switch.
reverse(null, true);
}
}
self = self.lift_sequences(compressor);
if (compressor.option("comparisons")) switch (self.operator) {
case "===":
case "!==":
if ((self.left.is_string(compressor) && self.right.is_string(compressor)) ||
(self.left.is_boolean() && self.right.is_boolean())) {
self.operator = self.operator.substr(0, 2);
}
// XXX: intentionally falling down to the next case
case "==":
case "!=":
if (self.left instanceof AST_String
&& self.left.value == "undefined"
&& self.right instanceof AST_UnaryPrefix
&& self.right.operator == "typeof"
&& compressor.option("unsafe")) {
if (!(self.right.expression instanceof AST_SymbolRef)
|| !self.right.expression.undeclared()) {
self.right = self.right.expression;
self.left = make_node(AST_Undefined, self.left).optimize(compressor);
if (self.operator.length == 2) self.operator += "=";
}
}
break;
}
if (compressor.option("booleans") && compressor.in_boolean_context()) switch (self.operator) {
case "&&":
var ll = self.left.evaluate(compressor);
var rr = self.right.evaluate(compressor);
if ((ll.length > 1 && !ll[1]) || (rr.length > 1 && !rr[1])) {
compressor.warn("Boolean && always false [{file}:{line},{col}]", self.start);
return make_node(AST_False, self);
}
if (ll.length > 1 && ll[1]) {
return rr[0];
}
if (rr.length > 1 && rr[1]) {
return ll[0];
}
break;
case "||":
var ll = self.left.evaluate(compressor);
var rr = self.right.evaluate(compressor);
if ((ll.length > 1 && ll[1]) || (rr.length > 1 && rr[1])) {
compressor.warn("Boolean || always true [{file}:{line},{col}]", self.start);
return make_node(AST_True, self);
}
if (ll.length > 1 && !ll[1]) {
return rr[0];
}
if (rr.length > 1 && !rr[1]) {
return ll[0];
}
break;
case "+":
var ll = self.left.evaluate(compressor);
var rr = self.right.evaluate(compressor);
if ((ll.length > 1 && ll[0] instanceof AST_String && ll[1]) ||
(rr.length > 1 && rr[0] instanceof AST_String && rr[1])) {
compressor.warn("+ in boolean context always true [{file}:{line},{col}]", self.start);
return make_node(AST_True, self);
}
break;
}
var exp = self.evaluate(compressor);
if (exp.length > 1) {
if (best_of(exp[0], self) !== self)
return exp[0];
}
if (compressor.option("comparisons")) {
if (!(compressor.parent() instanceof AST_Binary)
|| compressor.parent() instanceof AST_Assign) {
var negated = make_node(AST_UnaryPrefix, self, {
operator: "!",
expression: self.negate(compressor)
});
self = best_of(self, negated);
}
switch (self.operator) {
case "<": reverse(">"); break;
case "<=": reverse(">="); break;
}
}
if (self.operator == "+" && self.right instanceof AST_String
&& self.right.getValue() === "" && self.left instanceof AST_Binary
&& self.left.operator == "+" && self.left.is_string(compressor)) {
return self.left;
}
return self;
});
OPT(AST_SymbolRef, function(self, compressor){
if (self.undeclared()) {
var defines = compressor.option("global_defs");
if (defines && defines.hasOwnProperty(self.name)) {
return make_node_from_constant(compressor, defines[self.name], self);
}
switch (self.name) {
case "undefined":
return make_node(AST_Undefined, self);
case "NaN":
return make_node(AST_NaN, self);
case "Infinity":
return make_node(AST_Infinity, self);
}
}
return self;
});
OPT(AST_Undefined, function(self, compressor){
if (compressor.option("unsafe")) {
var scope = compressor.find_parent(AST_Scope);
var undef = scope.find_variable("undefined");
if (undef) {
var ref = make_node(AST_SymbolRef, self, {
name : "undefined",
scope : scope,
thedef : undef
});
ref.reference();
return ref;
}
}
return self;
});
var ASSIGN_OPS = [ '+', '-', '/', '*', '%', '>>', '<<', '>>>', '|', '^', '&' ];
OPT(AST_Assign, function(self, compressor){
self = self.lift_sequences(compressor);
if (self.operator == "="
&& self.left instanceof AST_SymbolRef
&& self.right instanceof AST_Binary
&& self.right.left instanceof AST_SymbolRef
&& self.right.left.name == self.left.name
&& member(self.right.operator, ASSIGN_OPS)) {
self.operator = self.right.operator + "=";
self.right = self.right.right;
}
return self;
});
OPT(AST_Conditional, function(self, compressor){
if (!compressor.option("conditionals")) return self;
if (self.condition instanceof AST_Seq) {
var car = self.condition.car;
self.condition = self.condition.cdr;
return AST_Seq.cons(car, self);
}
var cond = self.condition.evaluate(compressor);
if (cond.length > 1) {
if (cond[1]) {
compressor.warn("Condition always true [{file}:{line},{col}]", self.start);
return self.consequent;
} else {
compressor.warn("Condition always false [{file}:{line},{col}]", self.start);
return self.alternative;
}
}
var negated = cond[0].negate(compressor);
if (best_of(cond[0], negated) === negated) {
self = make_node(AST_Conditional, self, {
condition: negated,
consequent: self.alternative,
alternative: self.consequent
});
}
var consequent = self.consequent;
var alternative = self.alternative;
if (consequent instanceof AST_Assign
&& alternative instanceof AST_Assign
&& consequent.operator == alternative.operator
&& consequent.left.equivalent_to(alternative.left)
) {
/*
* Stuff like this:
* if (foo) exp = something; else exp = something_else;
* ==>
* exp = foo ? something : something_else;
*/
self = make_node(AST_Assign, self, {
operator: consequent.operator,
left: consequent.left,
right: make_node(AST_Conditional, self, {
condition: self.condition,
consequent: consequent.right,
alternative: alternative.right
})
});
}
return self;
});
OPT(AST_Boolean, function(self, compressor){
if (compressor.option("booleans")) {
var p = compressor.parent();
if (p instanceof AST_Binary && (p.operator == "=="
|| p.operator == "!=")) {
compressor.warn("Non-strict equality against boolean: {operator} {value} [{file}:{line},{col}]", {
operator : p.operator,
value : self.value,
file : p.start.file,
line : p.start.line,
col : p.start.col,
});
return make_node(AST_Number, self, {
value: +self.value
});
}
return make_node(AST_UnaryPrefix, self, {
operator: "!",
expression: make_node(AST_Number, self, {
value: 1 - self.value
})
});
}
return self;
});
OPT(AST_Sub, function(self, compressor){
var prop = self.property;
if (prop instanceof AST_String && compressor.option("properties")) {
prop = prop.getValue();
if (RESERVED_WORDS(prop) ? compressor.option("screw_ie8") : is_identifier_string(prop)) {
return make_node(AST_Dot, self, {
expression : self.expression,
property : prop
});
}
}
return self;
});
function literals_in_boolean_context(self, compressor) {
if (compressor.option("booleans") && compressor.in_boolean_context()) {
return make_node(AST_True, self);
}
return self;
};
OPT(AST_Array, literals_in_boolean_context);
OPT(AST_Object, literals_in_boolean_context);
OPT(AST_RegExp, literals_in_boolean_context);
})();
/***********************************************************************
A JavaScript tokenizer / parser / beautifier / compressor.
https://github.com/mishoo/UglifyJS2
-------------------------------- (C) ---------------------------------
Author: Mihai Bazon
<mihai.bazon@gmail.com>
http://mihai.bazon.net/blog
Distributed under the BSD license:
Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***********************************************************************/
"use strict";
// a small wrapper around fitzgen's source-map library
function SourceMap(options) {
options = defaults(options, {
file : null,
root : null,
orig : null,
});
var generator = new MOZ_SourceMap.SourceMapGenerator({
file : options.file,
sourceRoot : options.root
});
var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig);
function add(source, gen_line, gen_col, orig_line, orig_col, name) {
if (orig_map) {
var info = orig_map.originalPositionFor({
line: orig_line,
column: orig_col
});
source = info.source;
orig_line = info.line;
orig_col = info.column;
name = info.name;
}
generator.addMapping({
generated : { line: gen_line, column: gen_col },
original : { line: orig_line, column: orig_col },
source : source,
name : name
});
};
return {
add : add,
get : function() { return generator },
toString : function() { return generator.toString() }
};
};
/***********************************************************************
A JavaScript tokenizer / parser / beautifier / compressor.
https://github.com/mishoo/UglifyJS2
-------------------------------- (C) ---------------------------------
Author: Mihai Bazon
<mihai.bazon@gmail.com>
http://mihai.bazon.net/blog
Distributed under the BSD license:
Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***********************************************************************/
"use strict";
(function(){
var MOZ_TO_ME = {
TryStatement : function(M) {
return new AST_Try({
start : my_start_token(M),
end : my_end_token(M),
body : from_moz(M.block).body,
bcatch : from_moz(M.handlers[0]),
bfinally : M.finalizer ? new AST_Finally(from_moz(M.finalizer)) : null
});
},
CatchClause : function(M) {
return new AST_Catch({
start : my_start_token(M),
end : my_end_token(M),
argname : from_moz(M.param),
body : from_moz(M.body).body
});
},
ObjectExpression : function(M) {
return new AST_Object({
start : my_start_token(M),
end : my_end_token(M),
properties : M.properties.map(function(prop){
var key = prop.key;
var name = key.type == "Identifier" ? key.name : key.value;
var args = {
start : my_start_token(key),
end : my_end_token(prop.value),
key : name,
value : from_moz(prop.value)
};
switch (prop.kind) {
case "init":
return new AST_ObjectKeyVal(args);
case "set":
args.value.name = from_moz(key);
return new AST_ObjectSetter(args);
case "get":
args.value.name = from_moz(key);
return new AST_ObjectGetter(args);
}
})
});
},
SequenceExpression : function(M) {
return AST_Seq.from_array(M.expressions.map(from_moz));
},
MemberExpression : function(M) {
return new (M.computed ? AST_Sub : AST_Dot)({
start : my_start_token(M),
end : my_end_token(M),
property : M.computed ? from_moz(M.property) : M.property.name,
expression : from_moz(M.object)
});
},
SwitchCase : function(M) {
return new (M.test ? AST_Case : AST_Default)({
start : my_start_token(M),
end : my_end_token(M),
expression : from_moz(M.test),
body : M.consequent.map(from_moz)
});
},
Literal : function(M) {
var val = M.value, args = {
start : my_start_token(M),
end : my_end_token(M)
};
if (val === null) return new AST_Null(args);
switch (typeof val) {
case "string":
args.value = val;
return new AST_String(args);
case "number":
args.value = val;
return new AST_Number(args);
case "boolean":
return new (val ? AST_True : AST_False)(args);
default:
args.value = val;
return new AST_RegExp(args);
}
},
UnaryExpression: From_Moz_Unary,
UpdateExpression: From_Moz_Unary,
Identifier: function(M) {
var p = FROM_MOZ_STACK[FROM_MOZ_STACK.length - 2];
return new (M.name == "this" ? AST_This
: p.type == "LabeledStatement" ? AST_Label
: p.type == "VariableDeclarator" && p.id === M ? (p.kind == "const" ? AST_SymbolConst : AST_SymbolVar)
: p.type == "FunctionExpression" ? (p.id === M ? AST_SymbolLambda : AST_SymbolFunarg)
: p.type == "FunctionDeclaration" ? (p.id === M ? AST_SymbolDefun : AST_SymbolFunarg)
: p.type == "CatchClause" ? AST_SymbolCatch
: p.type == "BreakStatement" || p.type == "ContinueStatement" ? AST_LabelRef
: AST_SymbolRef)({
start : my_start_token(M),
end : my_end_token(M),
name : M.name
});
}
};
function From_Moz_Unary(M) {
var prefix = "prefix" in M ? M.prefix
: M.type == "UnaryExpression" ? true : false;
return new (prefix ? AST_UnaryPrefix : AST_UnaryPostfix)({
start : my_start_token(M),
end : my_end_token(M),
operator : M.operator,
expression : from_moz(M.argument)
});
};
var ME_TO_MOZ = {};
map("Node", AST_Node);
map("Program", AST_Toplevel, "body@body");
map("Function", AST_Function, "id>name, params@argnames, body%body");
map("EmptyStatement", AST_EmptyStatement);
map("BlockStatement", AST_BlockStatement, "body@body");
map("ExpressionStatement", AST_SimpleStatement, "expression>body");
map("IfStatement", AST_If, "test>condition, consequent>body, alternate>alternative");
map("LabeledStatement", AST_LabeledStatement, "label>label, body>body");
map("BreakStatement", AST_Break, "label>label");
map("ContinueStatement", AST_Continue, "label>label");
map("WithStatement", AST_With, "object>expression, body>body");
map("SwitchStatement", AST_Switch, "discriminant>expression, cases@body");
map("ReturnStatement", AST_Return, "argument>value");
map("ThrowStatement", AST_Throw, "argument>value");
map("WhileStatement", AST_While, "test>condition, body>body");
map("DoWhileStatement", AST_Do, "test>condition, body>body");
map("ForStatement", AST_For, "init>init, test>condition, update>step, body>body");
map("ForInStatement", AST_ForIn, "left>init, right>object, body>body");
map("DebuggerStatement", AST_Debugger);
map("FunctionDeclaration", AST_Defun, "id>name, params@argnames, body%body");
map("VariableDeclaration", AST_Var, "declarations@definitions");
map("VariableDeclarator", AST_VarDef, "id>name, init>value");
map("ThisExpression", AST_This);
map("ArrayExpression", AST_Array, "elements@elements");
map("FunctionExpression", AST_Function, "id>name, params@argnames, body%body");
map("BinaryExpression", AST_Binary, "operator=operator, left>left, right>right");
map("AssignmentExpression", AST_Assign, "operator=operator, left>left, right>right");
map("LogicalExpression", AST_Binary, "operator=operator, left>left, right>right");
map("ConditionalExpression", AST_Conditional, "test>condition, consequent>consequent, alternate>alternative");
map("NewExpression", AST_New, "callee>expression, arguments@args");
map("CallExpression", AST_Call, "callee>expression, arguments@args");
/* -----[ tools ]----- */
function my_start_token(moznode) {
return new AST_Token({
file : moznode.loc && moznode.loc.source,
line : moznode.loc && moznode.loc.start.line,
col : moznode.loc && moznode.loc.start.column,
pos : moznode.start,
endpos : moznode.start
});
};
function my_end_token(moznode) {
return new AST_Token({
file : moznode.loc && moznode.loc.source,
line : moznode.loc && moznode.loc.end.line,
col : moznode.loc && moznode.loc.end.column,
pos : moznode.end,
endpos : moznode.end
});
};
function map(moztype, mytype, propmap) {
var moz_to_me = "function From_Moz_" + moztype + "(M){\n";
moz_to_me += "return new mytype({\n" +
"start: my_start_token(M),\n" +
"end: my_end_token(M)";
if (propmap) propmap.split(/\s*,\s*/).forEach(function(prop){
var m = /([a-z0-9$_]+)(=|@|>|%)([a-z0-9$_]+)/i.exec(prop);
if (!m) throw new Error("Can't understand property map: " + prop);
var moz = "M." + m[1], how = m[2], my = m[3];
moz_to_me += ",\n" + my + ": ";
if (how == "@") {
moz_to_me += moz + ".map(from_moz)";
} else if (how == ">") {
moz_to_me += "from_moz(" + moz + ")";
} else if (how == "=") {
moz_to_me += moz;
} else if (how == "%") {
moz_to_me += "from_moz(" + moz + ").body";
} else throw new Error("Can't understand operator in propmap: " + prop);
});
moz_to_me += "\n})}";
// moz_to_me = parse(moz_to_me).print_to_string({ beautify: true });
// console.log(moz_to_me);
moz_to_me = new Function("mytype", "my_start_token", "my_end_token", "from_moz", "return(" + moz_to_me + ")")(
mytype, my_start_token, my_end_token, from_moz
);
return MOZ_TO_ME[moztype] = moz_to_me;
};
var FROM_MOZ_STACK = null;
function from_moz(node) {
FROM_MOZ_STACK.push(node);
var ret = node != null ? MOZ_TO_ME[node.type](node) : null;
FROM_MOZ_STACK.pop();
return ret;
};
AST_Node.from_mozilla_ast = function(node){
var save_stack = FROM_MOZ_STACK;
FROM_MOZ_STACK = [];
var ast = from_moz(node);
FROM_MOZ_STACK = save_stack;
return ast;
};
})();
exports.sys = sys;
exports.MOZ_SourceMap = MOZ_SourceMap;
exports.UglifyJS = UglifyJS;
exports.array_to_hash = array_to_hash;
exports.slice = slice;
exports.characters = characters;
exports.member = member;
exports.find_if = find_if;
exports.repeat_string = repeat_string;
exports.DefaultsError = DefaultsError;
exports.defaults = defaults;
exports.merge = merge;
exports.noop = noop;
exports.MAP = MAP;
exports.push_uniq = push_uniq;
exports.string_template = string_template;
exports.remove = remove;
exports.mergeSort = mergeSort;
exports.set_difference = set_difference;
exports.set_intersection = set_intersection;
exports.makePredicate = makePredicate;
exports.all = all;
exports.Dictionary = Dictionary;
exports.DEFNODE = DEFNODE;
exports.AST_Token = AST_Token;
exports.AST_Node = AST_Node;
exports.AST_Statement = AST_Statement;
exports.AST_Debugger = AST_Debugger;
exports.AST_Directive = AST_Directive;
exports.AST_SimpleStatement = AST_SimpleStatement;
exports.walk_body = walk_body;
exports.AST_Block = AST_Block;
exports.AST_BlockStatement = AST_BlockStatement;
exports.AST_EmptyStatement = AST_EmptyStatement;
exports.AST_StatementWithBody = AST_StatementWithBody;
exports.AST_LabeledStatement = AST_LabeledStatement;
exports.AST_DWLoop = AST_DWLoop;
exports.AST_Do = AST_Do;
exports.AST_While = AST_While;
exports.AST_For = AST_For;
exports.AST_ForIn = AST_ForIn;
exports.AST_With = AST_With;
exports.AST_Scope = AST_Scope;
exports.AST_Toplevel = AST_Toplevel;
exports.AST_Lambda = AST_Lambda;
exports.AST_Accessor = AST_Accessor;
exports.AST_Function = AST_Function;
exports.AST_Defun = AST_Defun;
exports.AST_Jump = AST_Jump;
exports.AST_Exit = AST_Exit;
exports.AST_Return = AST_Return;
exports.AST_Throw = AST_Throw;
exports.AST_LoopControl = AST_LoopControl;
exports.AST_Break = AST_Break;
exports.AST_Continue = AST_Continue;
exports.AST_If = AST_If;
exports.AST_Switch = AST_Switch;
exports.AST_SwitchBranch = AST_SwitchBranch;
exports.AST_Default = AST_Default;
exports.AST_Case = AST_Case;
exports.AST_Try = AST_Try;
exports.AST_Catch = AST_Catch;
exports.AST_Finally = AST_Finally;
exports.AST_Definitions = AST_Definitions;
exports.AST_Var = AST_Var;
exports.AST_Const = AST_Const;
exports.AST_VarDef = AST_VarDef;
exports.AST_Call = AST_Call;
exports.AST_New = AST_New;
exports.AST_Seq = AST_Seq;
exports.AST_PropAccess = AST_PropAccess;
exports.AST_Dot = AST_Dot;
exports.AST_Sub = AST_Sub;
exports.AST_Unary = AST_Unary;
exports.AST_UnaryPrefix = AST_UnaryPrefix;
exports.AST_UnaryPostfix = AST_UnaryPostfix;
exports.AST_Binary = AST_Binary;
exports.AST_Conditional = AST_Conditional;
exports.AST_Assign = AST_Assign;
exports.AST_Array = AST_Array;
exports.AST_Object = AST_Object;
exports.AST_ObjectProperty = AST_ObjectProperty;
exports.AST_ObjectKeyVal = AST_ObjectKeyVal;
exports.AST_ObjectSetter = AST_ObjectSetter;
exports.AST_ObjectGetter = AST_ObjectGetter;
exports.AST_Symbol = AST_Symbol;
exports.AST_SymbolAccessor = AST_SymbolAccessor;
exports.AST_SymbolDeclaration = AST_SymbolDeclaration;
exports.AST_SymbolVar = AST_SymbolVar;
exports.AST_SymbolConst = AST_SymbolConst;
exports.AST_SymbolFunarg = AST_SymbolFunarg;
exports.AST_SymbolDefun = AST_SymbolDefun;
exports.AST_SymbolLambda = AST_SymbolLambda;
exports.AST_SymbolCatch = AST_SymbolCatch;
exports.AST_Label = AST_Label;
exports.AST_SymbolRef = AST_SymbolRef;
exports.AST_LabelRef = AST_LabelRef;
exports.AST_This = AST_This;
exports.AST_Constant = AST_Constant;
exports.AST_String = AST_String;
exports.AST_Number = AST_Number;
exports.AST_RegExp = AST_RegExp;
exports.AST_Atom = AST_Atom;
exports.AST_Null = AST_Null;
exports.AST_NaN = AST_NaN;
exports.AST_Undefined = AST_Undefined;
exports.AST_Hole = AST_Hole;
exports.AST_Infinity = AST_Infinity;
exports.AST_Boolean = AST_Boolean;
exports.AST_False = AST_False;
exports.AST_True = AST_True;
exports.TreeWalker = TreeWalker;
exports.KEYWORDS = KEYWORDS;
exports.KEYWORDS_ATOM = KEYWORDS_ATOM;
exports.RESERVED_WORDS = RESERVED_WORDS;
exports.KEYWORDS_BEFORE_EXPRESSION = KEYWORDS_BEFORE_EXPRESSION;
exports.OPERATOR_CHARS = OPERATOR_CHARS;
exports.RE_HEX_NUMBER = RE_HEX_NUMBER;
exports.RE_OCT_NUMBER = RE_OCT_NUMBER;
exports.RE_DEC_NUMBER = RE_DEC_NUMBER;
exports.OPERATORS = OPERATORS;
exports.WHITESPACE_CHARS = WHITESPACE_CHARS;
exports.PUNC_BEFORE_EXPRESSION = PUNC_BEFORE_EXPRESSION;
exports.PUNC_CHARS = PUNC_CHARS;
exports.REGEXP_MODIFIERS = REGEXP_MODIFIERS;
exports.UNICODE = UNICODE;
exports.is_letter = is_letter;
exports.is_digit = is_digit;
exports.is_alphanumeric_char = is_alphanumeric_char;
exports.is_unicode_combining_mark = is_unicode_combining_mark;
exports.is_unicode_connector_punctuation = is_unicode_connector_punctuation;
exports.is_identifier = is_identifier;
exports.is_identifier_start = is_identifier_start;
exports.is_identifier_char = is_identifier_char;
exports.is_identifier_string = is_identifier_string;
exports.parse_js_number = parse_js_number;
exports.JS_Parse_Error = JS_Parse_Error;
exports.js_error = js_error;
exports.is_token = is_token;
exports.EX_EOF = EX_EOF;
exports.tokenizer = tokenizer;
exports.UNARY_PREFIX = UNARY_PREFIX;
exports.UNARY_POSTFIX = UNARY_POSTFIX;
exports.ASSIGNMENT = ASSIGNMENT;
exports.PRECEDENCE = PRECEDENCE;
exports.STATEMENTS_WITH_LABELS = STATEMENTS_WITH_LABELS;
exports.ATOMIC_START_TOKEN = ATOMIC_START_TOKEN;
exports.parse = parse;
exports.TreeTransformer = TreeTransformer;
exports.SymbolDef = SymbolDef;
exports.base54 = base54;
exports.OutputStream = OutputStream;
exports.Compressor = Compressor;
exports.SourceMap = SourceMap;
exports.AST_Node.warn_function = function (txt) { if (typeof console != "undefined" && typeof console.warn === "function") console.warn(txt) }
exports.minify = function (files, options) {
options = UglifyJS.defaults(options, {
outSourceMap : null,
sourceRoot : null,
inSourceMap : null,
fromString : false,
warnings : false,
mangle : {},
output : null,
compress : {}
});
if (typeof files == "string")
files = [ files ];
UglifyJS.base54.reset();
// 1. parse
var toplevel = null;
files.forEach(function(file){
var code = options.fromString
? file
: fs.readFileSync(file, "utf8");
toplevel = UglifyJS.parse(code, {
filename: options.fromString ? "?" : file,
toplevel: toplevel
});
});
// 2. compress
if (options.compress) {
var compress = { warnings: options.warnings };
UglifyJS.merge(compress, options.compress);
toplevel.figure_out_scope();
var sq = UglifyJS.Compressor(compress);
toplevel = toplevel.transform(sq);
}
// 3. mangle
if (options.mangle) {
toplevel.figure_out_scope();
toplevel.compute_char_frequency();
toplevel.mangle_names(options.mangle);
}
// 4. output
var inMap = options.inSourceMap;
var output = {};
if (typeof options.inSourceMap == "string") {
inMap = fs.readFileSync(options.inSourceMap, "utf8");
}
if (options.outSourceMap) {
output.source_map = UglifyJS.SourceMap({
file: options.outSourceMap,
orig: inMap,
root: options.sourceRoot
});
}
if (options.output) {
UglifyJS.merge(output, options.output);
}
var stream = UglifyJS.OutputStream(output);
toplevel.print(stream);
return {
code : stream + "",
map : output.source_map + ""
};
};
exports.describe_ast = function () {
var out = UglifyJS.OutputStream({ beautify: true });
function doitem(ctor) {
out.print("AST_" + ctor.TYPE);
var props = ctor.SELF_PROPS.filter(function(prop){
return !/^\$/.test(prop);
});
if (props.length > 0) {
out.space();
out.with_parens(function(){
props.forEach(function(prop, i){
if (i) out.space();
out.print(prop);
});
});
}
if (ctor.documentation) {
out.space();
out.print_string(ctor.documentation);
}
if (ctor.SUBCLASSES.length > 0) {
out.space();
out.with_block(function(){
ctor.SUBCLASSES.forEach(function(ctor, i){
out.indent();
doitem(ctor);
out.newline();
});
});
}
};
doitem(UglifyJS.AST_Node);
return out + "";
};
},{"source-map":47,"util":32}],58:[function(require,module,exports){
// jshint -W001
"use strict";
// Identifiers provided by the ECMAScript standard.
exports.reservedVars = {
arguments : false,
NaN : false
};
exports.ecmaIdentifiers = {
Array : false,
Boolean : false,
Date : false,
decodeURI : false,
decodeURIComponent : false,
encodeURI : false,
encodeURIComponent : false,
Error : false,
"eval" : false,
EvalError : false,
Function : false,
hasOwnProperty : false,
isFinite : false,
isNaN : false,
JSON : false,
Math : false,
Map : false,
Number : false,
Object : false,
parseInt : false,
parseFloat : false,
RangeError : false,
ReferenceError : false,
RegExp : false,
Set : false,
String : false,
SyntaxError : false,
TypeError : false,
URIError : false,
WeakMap : false
};
// Global variables commonly provided by a web browser environment.
exports.browser = {
Audio : false,
Blob : false,
addEventListener : false,
applicationCache : false,
atob : false,
blur : false,
btoa : false,
clearInterval : false,
clearTimeout : false,
close : false,
closed : false,
CustomEvent : false,
DOMParser : false,
defaultStatus : false,
document : false,
Element : false,
ElementTimeControl : false,
event : false,
FileReader : false,
FormData : false,
focus : false,
frames : false,
getComputedStyle : false,
HTMLElement : false,
HTMLAnchorElement : false,
HTMLBaseElement : false,
HTMLBlockquoteElement: false,
HTMLBodyElement : false,
HTMLBRElement : false,
HTMLButtonElement : false,
HTMLCanvasElement : false,
HTMLDirectoryElement : false,
HTMLDivElement : false,
HTMLDListElement : false,
HTMLFieldSetElement : false,
HTMLFontElement : false,
HTMLFormElement : false,
HTMLFrameElement : false,
HTMLFrameSetElement : false,
HTMLHeadElement : false,
HTMLHeadingElement : false,
HTMLHRElement : false,
HTMLHtmlElement : false,
HTMLIFrameElement : false,
HTMLImageElement : false,
HTMLInputElement : false,
HTMLIsIndexElement : false,
HTMLLabelElement : false,
HTMLLayerElement : false,
HTMLLegendElement : false,
HTMLLIElement : false,
HTMLLinkElement : false,
HTMLMapElement : false,
HTMLMenuElement : false,
HTMLMetaElement : false,
HTMLModElement : false,
HTMLObjectElement : false,
HTMLOListElement : false,
HTMLOptGroupElement : false,
HTMLOptionElement : false,
HTMLParagraphElement : false,
HTMLParamElement : false,
HTMLPreElement : false,
HTMLQuoteElement : false,
HTMLScriptElement : false,
HTMLSelectElement : false,
HTMLStyleElement : false,
HTMLTableCaptionElement: false,
HTMLTableCellElement : false,
HTMLTableColElement : false,
HTMLTableElement : false,
HTMLTableRowElement : false,
HTMLTableSectionElement: false,
HTMLTextAreaElement : false,
HTMLTitleElement : false,
HTMLUListElement : false,
HTMLVideoElement : false,
history : false,
Image : false,
length : false,
localStorage : false,
location : false,
MessageChannel : false,
MessageEvent : false,
MessagePort : false,
MouseEvent : false,
moveBy : false,
moveTo : false,
MutationObserver : false,
name : false,
Node : false,
NodeFilter : false,
navigator : false,
onbeforeunload : true,
onblur : true,
onerror : true,
onfocus : true,
onload : true,
onresize : true,
onunload : true,
open : false,
openDatabase : false,
opener : false,
Option : false,
parent : false,
print : false,
removeEventListener : false,
resizeBy : false,
resizeTo : false,
screen : false,
scroll : false,
scrollBy : false,
scrollTo : false,
sessionStorage : false,
setInterval : false,
setTimeout : false,
SharedWorker : false,
status : false,
SVGAElement : false,
SVGAltGlyphDefElement: false,
SVGAltGlyphElement : false,
SVGAltGlyphItemElement: false,
SVGAngle : false,
SVGAnimateColorElement: false,
SVGAnimateElement : false,
SVGAnimateMotionElement: false,
SVGAnimateTransformElement: false,
SVGAnimatedAngle : false,
SVGAnimatedBoolean : false,
SVGAnimatedEnumeration: false,
SVGAnimatedInteger : false,
SVGAnimatedLength : false,
SVGAnimatedLengthList: false,
SVGAnimatedNumber : false,
SVGAnimatedNumberList: false,
SVGAnimatedPathData : false,
SVGAnimatedPoints : false,
SVGAnimatedPreserveAspectRatio: false,
SVGAnimatedRect : false,
SVGAnimatedString : false,
SVGAnimatedTransformList: false,
SVGAnimationElement : false,
SVGCSSRule : false,
SVGCircleElement : false,
SVGClipPathElement : false,
SVGColor : false,
SVGColorProfileElement: false,
SVGColorProfileRule : false,
SVGComponentTransferFunctionElement: false,
SVGCursorElement : false,
SVGDefsElement : false,
SVGDescElement : false,
SVGDocument : false,
SVGElement : false,
SVGElementInstance : false,
SVGElementInstanceList: false,
SVGEllipseElement : false,
SVGExternalResourcesRequired: false,
SVGFEBlendElement : false,
SVGFEColorMatrixElement: false,
SVGFEComponentTransferElement: false,
SVGFECompositeElement: false,
SVGFEConvolveMatrixElement: false,
SVGFEDiffuseLightingElement: false,
SVGFEDisplacementMapElement: false,
SVGFEDistantLightElement: false,
SVGFEFloodElement : false,
SVGFEFuncAElement : false,
SVGFEFuncBElement : false,
SVGFEFuncGElement : false,
SVGFEFuncRElement : false,
SVGFEGaussianBlurElement: false,
SVGFEImageElement : false,
SVGFEMergeElement : false,
SVGFEMergeNodeElement: false,
SVGFEMorphologyElement: false,
SVGFEOffsetElement : false,
SVGFEPointLightElement: false,
SVGFESpecularLightingElement: false,
SVGFESpotLightElement: false,
SVGFETileElement : false,
SVGFETurbulenceElement: false,
SVGFilterElement : false,
SVGFilterPrimitiveStandardAttributes: false,
SVGFitToViewBox : false,
SVGFontElement : false,
SVGFontFaceElement : false,
SVGFontFaceFormatElement: false,
SVGFontFaceNameElement: false,
SVGFontFaceSrcElement: false,
SVGFontFaceUriElement: false,
SVGForeignObjectElement: false,
SVGGElement : false,
SVGGlyphElement : false,
SVGGlyphRefElement : false,
SVGGradientElement : false,
SVGHKernElement : false,
SVGICCColor : false,
SVGImageElement : false,
SVGLangSpace : false,
SVGLength : false,
SVGLengthList : false,
SVGLineElement : false,
SVGLinearGradientElement: false,
SVGLocatable : false,
SVGMPathElement : false,
SVGMarkerElement : false,
SVGMaskElement : false,
SVGMatrix : false,
SVGMetadataElement : false,
SVGMissingGlyphElement: false,
SVGNumber : false,
SVGNumberList : false,
SVGPaint : false,
SVGPathElement : false,
SVGPathSeg : false,
SVGPathSegArcAbs : false,
SVGPathSegArcRel : false,
SVGPathSegClosePath : false,
SVGPathSegCurvetoCubicAbs: false,
SVGPathSegCurvetoCubicRel: false,
SVGPathSegCurvetoCubicSmoothAbs: false,
SVGPathSegCurvetoCubicSmoothRel: false,
SVGPathSegCurvetoQuadraticAbs: false,
SVGPathSegCurvetoQuadraticRel: false,
SVGPathSegCurvetoQuadraticSmoothAbs: false,
SVGPathSegCurvetoQuadraticSmoothRel: false,
SVGPathSegLinetoAbs : false,
SVGPathSegLinetoHorizontalAbs: false,
SVGPathSegLinetoHorizontalRel: false,
SVGPathSegLinetoRel : false,
SVGPathSegLinetoVerticalAbs: false,
SVGPathSegLinetoVerticalRel: false,
SVGPathSegList : false,
SVGPathSegMovetoAbs : false,
SVGPathSegMovetoRel : false,
SVGPatternElement : false,
SVGPoint : false,
SVGPointList : false,
SVGPolygonElement : false,
SVGPolylineElement : false,
SVGPreserveAspectRatio: false,
SVGRadialGradientElement: false,
SVGRect : false,
SVGRectElement : false,
SVGRenderingIntent : false,
SVGSVGElement : false,
SVGScriptElement : false,
SVGSetElement : false,
SVGStopElement : false,
SVGStringList : false,
SVGStylable : false,
SVGStyleElement : false,
SVGSwitchElement : false,
SVGSymbolElement : false,
SVGTRefElement : false,
SVGTSpanElement : false,
SVGTests : false,
SVGTextContentElement: false,
SVGTextElement : false,
SVGTextPathElement : false,
SVGTextPositioningElement: false,
SVGTitleElement : false,
SVGTransform : false,
SVGTransformList : false,
SVGTransformable : false,
SVGURIReference : false,
SVGUnitTypes : false,
SVGUseElement : false,
SVGVKernElement : false,
SVGViewElement : false,
SVGViewSpec : false,
SVGZoomAndPan : false,
TimeEvent : false,
top : false,
WebSocket : false,
window : false,
Worker : false,
XMLHttpRequest : false,
XMLSerializer : false,
XPathEvaluator : false,
XPathException : false,
XPathExpression : false,
XPathNamespace : false,
XPathNSResolver : false,
XPathResult : false
};
exports.devel = {
alert : false,
confirm: false,
console: false,
Debug : false,
opera : false,
prompt : false
};
exports.worker = {
importScripts: true,
postMessage : true,
self : true
};
// Widely adopted global names that are not part of ECMAScript standard
exports.nonstandard = {
escape : false,
unescape: false
};
// Globals provided by popular JavaScript environments.
exports.couch = {
"require" : false,
respond : false,
getRow : false,
emit : false,
send : false,
start : false,
sum : false,
log : false,
exports : false,
module : false,
provides : false
};
exports.node = {
__filename : false,
__dirname : false,
Buffer : false,
console : false,
exports : true, // In Node it is ok to exports = module.exports = foo();
GLOBAL : false,
global : false,
module : false,
process : false,
require : false,
setTimeout : false,
clearTimeout : false,
setInterval : false,
clearInterval : false,
setImmediate : false, // v0.9.1+
clearImmediate: false // v0.9.1+
};
exports.phantom = {
phantom : true,
require : true,
WebPage : true,
console : true, // in examples, but undocumented
exports : true // v1.7+
};
exports.rhino = {
defineClass : false,
deserialize : false,
gc : false,
help : false,
importPackage: false,
"java" : false,
load : false,
loadClass : false,
print : false,
quit : false,
readFile : false,
readUrl : false,
runCommand : false,
seal : false,
serialize : false,
spawn : false,
sync : false,
toint32 : false,
version : false
};
exports.shelljs = {
target : false,
echo : false,
exit : false,
cd : false,
pwd : false,
ls : false,
find : false,
cp : false,
rm : false,
mv : false,
mkdir : false,
test : false,
cat : false,
sed : false,
grep : false,
which : false,
dirs : false,
pushd : false,
popd : false,
env : false,
exec : false,
chmod : false,
config : false,
error : false,
tempdir : false
};
exports.typed = {
ArrayBuffer : false,
ArrayBufferView : false,
DataView : false,
Float32Array : false,
Float64Array : false,
Int16Array : false,
Int32Array : false,
Int8Array : false,
Uint16Array : false,
Uint32Array : false,
Uint8Array : false,
Uint8ClampedArray : false
};
exports.wsh = {
ActiveXObject : true,
Enumerator : true,
GetObject : true,
ScriptEngine : true,
ScriptEngineBuildVersion : true,
ScriptEngineMajorVersion : true,
ScriptEngineMinorVersion : true,
VBArray : true,
WSH : true,
WScript : true,
XDomainRequest : true
};
// Globals provided by popular JavaScript libraries.
exports.dojo = {
dojo : false,
dijit : false,
dojox : false,
define : false,
"require": false
};
exports.jquery = {
"$" : false,
jQuery : false
};
exports.mootools = {
"$" : false,
"$$" : false,
Asset : false,
Browser : false,
Chain : false,
Class : false,
Color : false,
Cookie : false,
Core : false,
Document : false,
DomReady : false,
DOMEvent : false,
DOMReady : false,
Drag : false,
Element : false,
Elements : false,
Event : false,
Events : false,
Fx : false,
Group : false,
Hash : false,
HtmlTable : false,
Iframe : false,
IframeShim : false,
InputValidator: false,
instanceOf : false,
Keyboard : false,
Locale : false,
Mask : false,
MooTools : false,
Native : false,
Options : false,
OverText : false,
Request : false,
Scroller : false,
Slick : false,
Slider : false,
Sortables : false,
Spinner : false,
Swiff : false,
Tips : false,
Type : false,
typeOf : false,
URI : false,
Window : false
};
exports.prototypejs = {
"$" : false,
"$$" : false,
"$A" : false,
"$F" : false,
"$H" : false,
"$R" : false,
"$break" : false,
"$continue" : false,
"$w" : false,
Abstract : false,
Ajax : false,
Class : false,
Enumerable : false,
Element : false,
Event : false,
Field : false,
Form : false,
Hash : false,
Insertion : false,
ObjectRange : false,
PeriodicalExecuter: false,
Position : false,
Prototype : false,
Selector : false,
Template : false,
Toggle : false,
Try : false,
Autocompleter : false,
Builder : false,
Control : false,
Draggable : false,
Draggables : false,
Droppables : false,
Effect : false,
Sortable : false,
SortableObserver : false,
Sound : false,
Scriptaculous : false
};
exports.yui = {
YUI : false,
Y : false,
YUI_config: false
};
},{}]},{},[5])
(5)
});
|
seayou/cdnjs
|
ajax/libs/jade/1.1.5/jade.js
|
JavaScript
|
mit
| 774,647 |
#include "../ast.hpp"
#include "../context.hpp"
#include "../parser.hpp"
#include <string>
using namespace Sass;
Context ctx = Context(Context::Data());
Compound_Selector* compound_selector(std::string src)
{ return Parser::from_c_str(src.c_str(), ctx, "", Position()).parse_compound_selector(); }
Complex_Selector* complex_selector(std::string src)
{ return Parser::from_c_str(src.c_str(), ctx, "", Position()).parse_complex_selector(false); }
void check_compound(std::string s1, std::string s2)
{
std::cout << "Is "
<< s1
<< " a superselector of "
<< s2
<< "?\t"
<< compound_selector(s1 + ";")->is_superselector_of(compound_selector(s2 + ";"))
<< std::endl;
}
void check_complex(std::string s1, std::string s2)
{
std::cout << "Is "
<< s1
<< " a superselector of "
<< s2
<< "?\t"
<< complex_selector(s1 + ";")->is_superselector_of(complex_selector(s2 + ";"))
<< std::endl;
}
int main()
{
check_compound(".foo", ".foo.bar");
check_compound(".foo.bar", ".foo");
check_compound(".foo.bar", "div.foo");
check_compound(".foo", "div.foo");
check_compound("div.foo", ".foo");
check_compound("div.foo", "div.bar.foo");
check_compound("p.foo", "div.bar.foo");
check_compound(".hux", ".mumble");
std::cout << std::endl;
check_complex(".foo ~ .bar", ".foo + .bar");
check_complex(".foo .bar", ".foo + .bar");
check_complex(".foo .bar", ".foo > .bar");
check_complex(".foo .bar > .hux", ".foo.a .bar.b > .hux");
check_complex(".foo ~ .bar .hux", ".foo.a + .bar.b > .hux");
check_complex(".foo", ".bar .foo");
check_complex(".foo", ".foo.a");
check_complex(".foo.bar", ".foo");
check_complex(".foo .bar .hux", ".bar .hux");
check_complex(".foo ~ .bar .hux.x", ".foo.a + .bar.b > .hux.y");
check_complex(".foo ~ .bar .hux", ".foo.a + .bar.b > .mumble");
check_complex(".foo + .bar", ".foo ~ .bar");
check_complex("a c e", "a b c d e");
check_complex("c a e", "a b c d e");
return 0;
}
|
dmoore2/permanent-majority
|
node_modules/node-sass/src/libsass/test/test_superselector.cpp
|
C++
|
mit
| 2,020 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Intl\ResourceBundle\Transformer;
use Symfony\Component\Filesystem\Filesystem;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class StubbingContext implements StubbingContextInterface
{
/**
* @var string
*/
private $binaryDir;
/**
* @var string
*/
private $stubDir;
/**
* @var Filesystem
*/
private $filesystem;
/**
* @var string
*/
private $icuVersion;
public function __construct($binaryDir, $stubDir, Filesystem $filesystem, $icuVersion)
{
$this->binaryDir = $binaryDir;
$this->stubDir = $stubDir;
$this->filesystem = $filesystem;
$this->icuVersion = $icuVersion;
}
/**
* {@inheritdoc}
*/
public function getBinaryDir()
{
return $this->binaryDir;
}
/**
* {@inheritdoc}
*/
public function getStubDir()
{
return $this->stubDir;
}
/**
* {@inheritdoc}
*/
public function getFilesystem()
{
return $this->filesystem;
}
/**
* {@inheritdoc}
*/
public function getIcuVersion()
{
return $this->icuVersion;
}
}
|
gonzaparra/webankyrins
|
vendor/symfony/symfony/src/Symfony/Component/Intl/ResourceBundle/Transformer/StubbingContext.php
|
PHP
|
mit
| 1,442 |
/*
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("a11yhelp","ro",{title:"Instrucțiuni de accesibilitate",contents:"Cuprins. Pentru a închide acest dialog, apăsați tasta ESC.",legend:[{name:"General",items:[{name:"Editează bara instrumente.",legend:"Apasă ${toolbarFocus} pentru a naviga prin bara de instrumente. Pentru a te mișca prin grupurile de instrumente folosește tastele TAB și SHIFT-TAB. Pentru a te mișca intre diverse instrumente folosește tastele SĂGEATĂ DREAPTA sau SĂGEATĂ STÂNGA. Apasă butonul SPAȚIU sau ENTER pentru activarea instrumentului."},
{name:"Dialog editor",legend:"Într-un dialog, apasă TAB pentru a naviga spre câmpul următor de dialog, apasă SHIFT + TAB pentru a te duce la câmpul anterior, apasă ENTER pentru a trimite dialogul, apasă ESC pentru a anula dialogul. Pentru dialoguri care au mai multe subferestre, apasă ALT + F10 pentr a naviga în lista de subferestre. Treci la subferestrea următoare cu TAB sau SĂGEATĂ DREAPTA. Treci la subfereastra anterioară cu SHIFT + TAB sau SĂGEATĂ STÂNGA. Apasă SPAȚIU sau ENTER pentru a selecta subfereastra."},
{name:"Editor meniu contextual",legend:"Apasă ${contextMenu} sau TASTA MENIU pentru a deschide meniul contextual. Treci la următoarea opțiune din meniu cu TAB sau SĂGEATĂ JOS. Treci la opțiunea anterioară cu SHIFT+TAB sau SĂGEATĂ SUS. Apasă SPAȚIU sau ENTER pentru a selecta opțiunea din meniu. Deschide sub-meniul opțiunii curente cu SPAȚIU sau ENTER sau SĂGEATĂ DREAPTA. Revino la elementul din meniul părinte cu ESC sau SĂGEATĂ STÂNGA. Închide meniul de context cu ESC."},{name:"Editor Casetă Listă",
legend:"În interiorul unei liste, treci la următorull element cu TAB sau SĂGEATĂ JOS. Treci la elementul anterior din listă cu SHIFT + TAB sau SĂGEATĂ SUS. Apasă SPAȚIU sau ENTER pentru a selecta opțiunea din listă. Apasă ESC pentru a închide lista."},{name:"Editor Element Path Bar",legend:"Press ${elementsPathFocus} to navigate to the elements path bar. Move to next element button with TAB or RIGHT ARROW. Move to previous button with SHIFT+TAB or LEFT ARROW. Press SPACE or ENTER to select the element in editor."}]},
{name:"Commands",items:[{name:" Undo command",legend:"Press ${undo}"},{name:" Redo command",legend:"Press ${redo}"},{name:" Bold command",legend:"Press ${bold}"},{name:" Italic command",legend:"Press ${italic}"},{name:" Underline command",legend:"Press ${underline}"},{name:" Link command",legend:"Press ${link}"},{name:" Toolbar Collapse command",legend:"Press ${toolbarCollapse}"},{name:" Access previous focus space command",legend:"Press ${accessPreviousSpace} to access the closest unreachable focus space before the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces."},
{name:" Access next focus space command",legend:"Press ${accessNextSpace} to access the closest unreachable focus space after the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces."},{name:" Accessibility Help",legend:"Press ${a11yHelp}"}]}],backspace:"Backspace",tab:"Tab",enter:"Enter",shift:"Shift",ctrl:"Ctrl",alt:"Alt",pause:"Pause",capslock:"Caps Lock",escape:"Escape",pageUp:"Page Up",pageDown:"Page Down",end:"End",home:"Home",leftArrow:"Left Arrow",
upArrow:"Up Arrow",rightArrow:"Right Arrow",downArrow:"Down Arrow",insert:"Insert","delete":"Delete",leftWindowKey:"Left Windows key",rightWindowKey:"Right Windows key",selectKey:"Select key",numpad0:"Numpad 0",numpad1:"Numpad 1",numpad2:"Numpad 2",numpad3:"Numpad 3",numpad4:"Numpad 4",numpad5:"Numpad 5",numpad6:"Numpad 6",numpad7:"Numpad 7",numpad8:"Numpad 8",numpad9:"Numpad 9",multiply:"Multiply",add:"Add",subtract:"Subtract",decimalPoint:"Decimal Point",divide:"Divide",f1:"F1",f2:"F2",f3:"F3",
f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",numLock:"Num Lock",scrollLock:"Scroll Lock",semiColon:"Semicolon",equalSign:"Equal Sign",comma:"Comma",dash:"Dash",period:"Period",forwardSlash:"Forward Slash",graveAccent:"Grave Accent",openBracket:"Open Bracket",backSlash:"Backslash",closeBracket:"Close Bracket",singleQuote:"Single Quote"});
|
Teino1978-Corp/Teino1978-Corp-cdnjs
|
ajax/libs/ckeditor/4.3.2/plugins/a11yhelp/dialogs/lang/ro.js
|
JavaScript
|
mit
| 4,324 |
'use strict';
var $ = require('./$')
, $export = require('./$.export')
, DESCRIPTORS = require('./$.descriptors')
, createDesc = require('./$.property-desc')
, html = require('./$.html')
, cel = require('./$.dom-create')
, has = require('./$.has')
, cof = require('./$.cof')
, invoke = require('./$.invoke')
, fails = require('./$.fails')
, anObject = require('./$.an-object')
, aFunction = require('./$.a-function')
, isObject = require('./$.is-object')
, toObject = require('./$.to-object')
, toIObject = require('./$.to-iobject')
, toInteger = require('./$.to-integer')
, toIndex = require('./$.to-index')
, toLength = require('./$.to-length')
, IObject = require('./$.iobject')
, IE_PROTO = require('./$.uid')('__proto__')
, createArrayMethod = require('./$.array-methods')
, arrayIndexOf = require('./$.array-includes')(false)
, ObjectProto = Object.prototype
, ArrayProto = Array.prototype
, arraySlice = ArrayProto.slice
, arrayJoin = ArrayProto.join
, defineProperty = $.setDesc
, getOwnDescriptor = $.getDesc
, defineProperties = $.setDescs
, factories = {}
, IE8_DOM_DEFINE;
if(!DESCRIPTORS){
IE8_DOM_DEFINE = !fails(function(){
return defineProperty(cel('div'), 'a', {get: function(){ return 7; }}).a != 7;
});
$.setDesc = function(O, P, Attributes){
if(IE8_DOM_DEFINE)try {
return defineProperty(O, P, Attributes);
} catch(e){ /* empty */ }
if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
if('value' in Attributes)anObject(O)[P] = Attributes.value;
return O;
};
$.getDesc = function(O, P){
if(IE8_DOM_DEFINE)try {
return getOwnDescriptor(O, P);
} catch(e){ /* empty */ }
if(has(O, P))return createDesc(!ObjectProto.propertyIsEnumerable.call(O, P), O[P]);
};
$.setDescs = defineProperties = function(O, Properties){
anObject(O);
var keys = $.getKeys(Properties)
, length = keys.length
, i = 0
, P;
while(length > i)$.setDesc(O, P = keys[i++], Properties[P]);
return O;
};
}
$export($export.S + $export.F * !DESCRIPTORS, 'Object', {
// 19.1.2.6 / 15.2.3.3 Object.getOwnPropertyDescriptor(O, P)
getOwnPropertyDescriptor: $.getDesc,
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
defineProperty: $.setDesc,
// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
defineProperties: defineProperties
});
// IE 8- don't enum bug keys
var keys1 = ('constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,' +
'toLocaleString,toString,valueOf').split(',')
// Additional keys for getOwnPropertyNames
, keys2 = keys1.concat('length', 'prototype')
, keysLen1 = keys1.length;
// Create object with `null` prototype: use iframe Object with cleared prototype
var createDict = function(){
// Thrash, waste and sodomy: IE GC bug
var iframe = cel('iframe')
, i = keysLen1
, gt = '>'
, iframeDocument;
iframe.style.display = 'none';
html.appendChild(iframe);
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
// createDict = iframe.contentWindow.Object;
// html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write('<script>document.F=Object</script' + gt);
iframeDocument.close();
createDict = iframeDocument.F;
while(i--)delete createDict.prototype[keys1[i]];
return createDict();
};
var createGetKeys = function(names, length){
return function(object){
var O = toIObject(object)
, i = 0
, result = []
, key;
for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while(length > i)if(has(O, key = names[i++])){
~arrayIndexOf(result, key) || result.push(key);
}
return result;
};
};
var Empty = function(){};
$export($export.S, 'Object', {
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
getPrototypeOf: $.getProto = $.getProto || function(O){
O = toObject(O);
if(has(O, IE_PROTO))return O[IE_PROTO];
if(typeof O.constructor == 'function' && O instanceof O.constructor){
return O.constructor.prototype;
} return O instanceof Object ? ObjectProto : null;
},
// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
getOwnPropertyNames: $.getNames = $.getNames || createGetKeys(keys2, keys2.length, true),
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
create: $.create = $.create || function(O, /*?*/Properties){
var result;
if(O !== null){
Empty.prototype = anObject(O);
result = new Empty();
Empty.prototype = null;
// add "__proto__" for Object.getPrototypeOf shim
result[IE_PROTO] = O;
} else result = createDict();
return Properties === undefined ? result : defineProperties(result, Properties);
},
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
keys: $.getKeys = $.getKeys || createGetKeys(keys1, keysLen1, false)
});
var construct = function(F, len, args){
if(!(len in factories)){
for(var n = [], i = 0; i < len; i++)n[i] = 'a[' + i + ']';
factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
}
return factories[len](F, args);
};
// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)
$export($export.P, 'Function', {
bind: function bind(that /*, args... */){
var fn = aFunction(this)
, partArgs = arraySlice.call(arguments, 1);
var bound = function(/* args... */){
var args = partArgs.concat(arraySlice.call(arguments));
return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);
};
if(isObject(fn.prototype))bound.prototype = fn.prototype;
return bound;
}
});
// fallback for not array-like ES3 strings and DOM objects
$export($export.P + $export.F * fails(function(){
if(html)arraySlice.call(html);
}), 'Array', {
slice: function(begin, end){
var len = toLength(this.length)
, klass = cof(this);
end = end === undefined ? len : end;
if(klass == 'Array')return arraySlice.call(this, begin, end);
var start = toIndex(begin, len)
, upTo = toIndex(end, len)
, size = toLength(upTo - start)
, cloned = Array(size)
, i = 0;
for(; i < size; i++)cloned[i] = klass == 'String'
? this.charAt(start + i)
: this[start + i];
return cloned;
}
});
$export($export.P + $export.F * (IObject != Object), 'Array', {
join: function join(separator){
return arrayJoin.call(IObject(this), separator === undefined ? ',' : separator);
}
});
// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)
$export($export.S, 'Array', {isArray: require('./$.is-array')});
var createArrayReduce = function(isRight){
return function(callbackfn, memo){
aFunction(callbackfn);
var O = IObject(this)
, length = toLength(O.length)
, index = isRight ? length - 1 : 0
, i = isRight ? -1 : 1;
if(arguments.length < 2)for(;;){
if(index in O){
memo = O[index];
index += i;
break;
}
index += i;
if(isRight ? index < 0 : length <= index){
throw TypeError('Reduce of empty array with no initial value');
}
}
for(;isRight ? index >= 0 : length > index; index += i)if(index in O){
memo = callbackfn(memo, O[index], index, this);
}
return memo;
};
};
var methodize = function($fn){
return function(arg1/*, arg2 = undefined */){
return $fn(this, arg1, arguments[1]);
};
};
$export($export.P, 'Array', {
// 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])
forEach: $.each = $.each || methodize(createArrayMethod(0)),
// 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])
map: methodize(createArrayMethod(1)),
// 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
filter: methodize(createArrayMethod(2)),
// 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])
some: methodize(createArrayMethod(3)),
// 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])
every: methodize(createArrayMethod(4)),
// 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])
reduce: createArrayReduce(false),
// 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])
reduceRight: createArrayReduce(true),
// 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])
indexOf: methodize(arrayIndexOf),
// 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])
lastIndexOf: function(el, fromIndex /* = @[*-1] */){
var O = toIObject(this)
, length = toLength(O.length)
, index = length - 1;
if(arguments.length > 1)index = Math.min(index, toInteger(fromIndex));
if(index < 0)index = toLength(length + index);
for(;index >= 0; index--)if(index in O)if(O[index] === el)return index;
return -1;
}
});
// 20.3.3.1 / 15.9.4.4 Date.now()
$export($export.S, 'Date', {now: function(){ return +new Date; }});
var lz = function(num){
return num > 9 ? num : '0' + num;
};
// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
// PhantomJS / old WebKit has a broken implementations
$export($export.P + $export.F * (fails(function(){
return new Date(-5e13 - 1).toISOString() != '0385-07-25T07:06:39.999Z';
}) || !fails(function(){
new Date(NaN).toISOString();
})), 'Date', {
toISOString: function toISOString(){
if(!isFinite(this))throw RangeError('Invalid time value');
var d = this
, y = d.getUTCFullYear()
, m = d.getUTCMilliseconds()
, s = y < 0 ? '-' : y > 9999 ? '+' : '';
return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +
'-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +
'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +
':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';
}
});
|
JonHMChan/descartes
|
node_modules/babel-preset-es2015/node_modules/babel-plugin-transform-es2015-block-scoping/node_modules/babel-runtime/node_modules/core-js/library/modules/es5.js
|
JavaScript
|
mit
| 10,214 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"dimanche",
"lundi",
"mardi",
"mercredi",
"jeudi",
"vendredi",
"samedi"
],
"MONTH": [
"janvier",
"f\u00e9vrier",
"mars",
"avril",
"mai",
"juin",
"juillet",
"ao\u00fbt",
"septembre",
"octobre",
"novembre",
"d\u00e9cembre"
],
"SHORTDAY": [
"dim.",
"lun.",
"mar.",
"mer.",
"jeu.",
"ven.",
"sam."
],
"SHORTMONTH": [
"janv.",
"f\u00e9vr.",
"mars",
"avr.",
"mai",
"juin",
"juil.",
"ao\u00fbt",
"sept.",
"oct.",
"nov.",
"d\u00e9c."
],
"fullDate": "EEEE d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y HH:mm:ss",
"mediumDate": "d MMM y",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/yy HH:mm",
"shortDate": "dd/MM/yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(",
"negSuf": "\u00a0\u00a4)",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "fr-td",
"pluralCat": function (n) { if (n >= 0 && n <= 2 && n != 2) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
|
tmorin/cdnjs
|
ajax/libs/angular-i18n/1.2.20/angular-locale_fr-td.js
|
JavaScript
|
mit
| 1,998 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"domingo",
"segunda-feira",
"ter\u00e7a-feira",
"quarta-feira",
"quinta-feira",
"sexta-feira",
"s\u00e1bado"
],
"MONTH": [
"janeiro",
"fevereiro",
"mar\u00e7o",
"abril",
"maio",
"junho",
"julho",
"agosto",
"setembro",
"outubro",
"novembro",
"dezembro"
],
"SHORTDAY": [
"dom",
"seg",
"ter",
"qua",
"qui",
"sex",
"s\u00e1b"
],
"SHORTMONTH": [
"jan",
"fev",
"mar",
"abr",
"mai",
"jun",
"jul",
"ago",
"set",
"out",
"nov",
"dez"
],
"fullDate": "EEEE, d 'de' MMMM 'de' y",
"longDate": "d 'de' MMMM 'de' y",
"medium": "dd/MM/yyyy HH:mm:ss",
"mediumDate": "dd/MM/yyyy",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/yy HH:mm",
"shortDate": "dd/MM/yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "R$",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00a4",
"negSuf": ")",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "pt-mz",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
|
perfect-pixell/cdnjs
|
ajax/libs/angular-i18n/1.2.22/angular-locale_pt-mz.js
|
JavaScript
|
mit
| 1,983 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.