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
|
---|---|---|---|---|---|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>static</title>
<style type="text/css" media="screen">
body { margin: 1px; padding: 5px; }
div.static { position: static; top: 0; left: 0; margin: 1px; border: 2px solid #000; padding: 5px; width: 100px; height: 100px; background: #fff; overflow: hidden; }
#static-2 { top: 20px; left: 20px; }
#marker { position: absolute; border: 2px solid #000; width: 50px; height: 50px; background: #ccc; }
</style>
<script src="../../../dist/jquery.js"></script>
<script type="text/javascript" charset="utf-8">
jQuery(function($) {
$('.static').click(function() {
$('#marker').css( $(this).offset() );
var pos = $(this).position();
$(this).css({ position: 'absolute', top: pos.top, left: pos.left });
return false;
});
});
</script>
</head>
<body>
<div id="static-1" class="static"><div id="static-1-1" class="static"><div id="static-1-1-1" class="static"></div></div></div>
<div id="static-2" class="static"></div>
<div id="marker"></div>
<p class="instructions">Click the white box to move the marker to it. Clicking the box also changes the position to absolute (if not already) and sets the position according to the position method.</p>
</body>
</html>
| fat/jquery | test/data/offset/static.html | HTML | mit | 1,430 |
/**
* EventEmitter v4.0.5 - git.io/ee
* Oliver Caldwell
* MIT license
* @preserve
*/
(function(e){"use strict";function t(){}function n(e,t){if(r)return t.indexOf(e);for(var n=t.length;n--;)if(t[n]===e)return n;return-1}var i=t.prototype,r=Array.prototype.indexOf?!0:!1;i._getEvents=function(){return this._events||(this._events={})},i.getListeners=function(e){var t=this._getEvents();return t[e]||(t[e]=[])},i.addListener=function(e,t){var i=this.getListeners(e);return-1===n(t,i)&&i.push(t),this},i.on=i.addListener,i.removeListener=function(e,t){var i=this.getListeners(e),r=n(t,i);return-1!==r&&(i.splice(r,1),0===i.length&&this.removeEvent(e)),this},i.off=i.removeListener,i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,s=e?this.removeListener:this.addListener,o=e?this.removeListeners:this.addListeners;if("object"==typeof t)for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?s.call(this,i,r):o.call(this,i,r));else for(i=n.length;i--;)s.call(this,t,n[i]);return this},i.removeEvent=function(e){return e?delete this._getEvents()[e]:delete this._events,this},i.emitEvent=function(e,t){for(var n,i=this.getListeners(e),r=i.length;r--;)n=t?i[r].apply(null,t):i[r](),n===!0&&this.removeListener(e,i[r]);return this},i.trigger=i.emitEvent,i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},"function"==typeof define&&define.amd?define(function(){return t}):e.EventEmitter=t})(this); | mzdani/cdnjs | ajax/libs/EventEmitter/4.0.5/EventEmitter.min.js | JavaScript | mit | 1,585 |
<?php
/**
* Selector
*
* @package Less
* @subpackage tree
*/
class Less_Tree_Selector extends Less_Tree{
public $elements;
public $condition;
public $extendList = array();
public $_css;
public $index;
public $evaldCondition = false;
public $type = 'Selector';
public $currentFileInfo = array();
public $isReferenced;
public $mediaEmpty;
public $elements_len = 0;
public $_oelements;
public $_oelements_len;
public $cacheable = true;
/**
* @param boolean $isReferenced
*/
public function __construct( $elements, $extendList = array() , $condition = null, $index=null, $currentFileInfo=null, $isReferenced=null ){
$this->elements = $elements;
$this->elements_len = count($elements);
$this->extendList = $extendList;
$this->condition = $condition;
if( $currentFileInfo ){
$this->currentFileInfo = $currentFileInfo;
}
$this->isReferenced = $isReferenced;
if( !$condition ){
$this->evaldCondition = true;
}
$this->CacheElements();
}
public function accept($visitor) {
$this->elements = $visitor->visitArray($this->elements);
$this->extendList = $visitor->visitArray($this->extendList);
if( $this->condition ){
$this->condition = $visitor->visitObj($this->condition);
}
if( $visitor instanceof Less_Visitor_extendFinder ){
$this->CacheElements();
}
}
public function createDerived( $elements, $extendList = null, $evaldCondition = null ){
$newSelector = new Less_Tree_Selector( $elements, ($extendList ? $extendList : $this->extendList), null, $this->index, $this->currentFileInfo, $this->isReferenced);
$newSelector->evaldCondition = $evaldCondition ? $evaldCondition : $this->evaldCondition;
return $newSelector;
}
public function match( $other ){
if( !$other->_oelements || ($this->elements_len < $other->_oelements_len) ){
return 0;
}
for( $i = 0; $i < $other->_oelements_len; $i++ ){
if( $this->elements[$i]->value !== $other->_oelements[$i]) {
return 0;
}
}
return $other->_oelements_len; // return number of matched elements
}
public function CacheElements(){
$this->_oelements = array();
$css = '';
foreach($this->elements as $v){
$css .= $v->combinator;
if( !$v->value_is_object ){
$css .= $v->value;
continue;
}
if( !property_exists($v->value,'value') || !is_string($v->value->value) ){
$this->cacheable = false;
return;
}
$css .= $v->value->value;
}
$this->_oelements_len = preg_match_all('/[,&#\.\w-](?:[\w-]|(?:\\\\.))*/', $css, $matches);
if( $this->_oelements_len ){
$this->_oelements = $matches[0];
if( $this->_oelements[0] === '&' ){
array_shift($this->_oelements);
$this->_oelements_len--;
}
}
}
public function isJustParentSelector(){
return !$this->mediaEmpty &&
count($this->elements) === 1 &&
$this->elements[0]->value === '&' &&
($this->elements[0]->combinator === ' ' || $this->elements[0]->combinator === '');
}
public function compile($env) {
$elements = array();
foreach($this->elements as $el){
$elements[] = $el->compile($env);
}
$extendList = array();
foreach($this->extendList as $el){
$extendList[] = $el->compile($el);
}
$evaldCondition = false;
if( $this->condition ){
$evaldCondition = $this->condition->compile($env);
}
return $this->createDerived( $elements, $extendList, $evaldCondition );
}
/**
* @see Less_Tree::genCSS
*/
public function genCSS( $output, $firstSelector = true ){
if( !$firstSelector && $this->elements[0]->combinator === "" ){
$output->add(' ', $this->currentFileInfo, $this->index);
}
foreach($this->elements as $element){
$element->genCSS( $output );
}
}
public function markReferenced(){
$this->isReferenced = true;
}
public function getIsReferenced(){
return !isset($this->currentFileInfo['reference']) || !$this->currentFileInfo['reference'] || $this->isReferenced;
}
public function getIsOutput(){
return $this->evaldCondition;
}
}
| aymswick/chimehack-teacher | lib/lessphp/Tree/Selector.php | PHP | mit | 3,993 |
/**
* Sunlight menu plugin
*
* This creates the menu in the upper right corner for block-level elements.
* This plugin is not supported for IE6.
*
* Options:
* - showMenu: true/false (default is false)
* - autoCollapse: true/false (default is false)
*/
(function(sunlight, document, undefined){
if (sunlight === undefined) {
throw "Include sunlight.js before including plugin files";
}
//http://dean.edwards.name/weblog/2007/03/sniff/#comment83695
//eval()'d so that it compresses correctly
var ieVersion = eval("0 /*@cc_on+ScriptEngineMajorVersion()@*/");
function createLink(href, title, text) {
var link = document.createElement("a");
link.setAttribute("href", href);
link.setAttribute("title", title);
if (text) {
link.appendChild(document.createTextNode(text));
}
return link;
}
function getTextRecursive(node) {
var text = "",
i = 0;
if (node.nodeType === 3) {
return node.nodeValue;
}
text = "";
for (i = 0; i < node.childNodes.length; i++) {
text += getTextRecursive(node.childNodes[i]);
}
return text;
}
sunlight.bind("afterHighlightNode", function(context) {
var menu,
sunlightIcon,
ul,
collapse,
mDash,
collapseLink,
viewRaw,
viewRawLink,
about,
aboutLink,
icon;
if ((ieVersion && ieVersion < 7) || !this.options.showMenu || sunlight.util.getComputedStyle(context.node, "display") !== "block") {
return;
}
menu = document.createElement("div");
menu.className = this.options.classPrefix + "menu";
sunlightIcon =
"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJ" +
"cEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41Ljg3O4BdAAAAl0lEQVQ4jWP4" +
"P9n9PyWYgTYGzAr+///Q9P//Ty/HjhfEETDg1oH/YPDgNKbm4wsIuGBO+H84WJJKhhd2dkA0v3tEZhjcPQox4MVN" +
"7P7fUEHAgM112DX++Qkx+PEFMqPxwSmIAQenkWHAvCicAUucAbCAfX2PQCCCEtDGKkz86RXEgL39BAwAKcAFbh/6" +
"/39GIL3yAj0NAAB+LQeDCZ9tvgAAAABJRU5ErkJggg==";
ul = document.createElement("ul");
collapse = document.createElement("li");
mDash = String.fromCharCode(0x2014);
collapseLink = createLink("#", "collapse code block", mDash);
collapseLink.onclick = function() {
var originalHeight = sunlight.util.getComputedStyle(context.codeContainer, "height"),
originalOverflow = sunlight.util.getComputedStyle(context.codeContainer, "overflowY");
return function() {
var needsToExpand = sunlight.util.getComputedStyle(context.codeContainer, "height") !== originalHeight;
this.replaceChild(document.createTextNode(needsToExpand ? mDash : "+"), this.firstChild);
this.setAttribute("title", (needsToExpand ? "collapse" : "expand") + " clode block");
context.codeContainer.style.height = needsToExpand ? originalHeight : "0px";
context.codeContainer.style.overflowY = needsToExpand ? originalOverflow : "hidden";
return false;
}
}();
collapse.appendChild(collapseLink);
viewRaw = document.createElement("li");
viewRawLink = createLink("#", "view raw code", "raw");
viewRawLink.onclick = function() {
var textarea;
return function() {
var rawCode;
if (textarea) {
textarea.parentNode.removeChild(textarea);
textarea = null;
context.node.style.display = "block";
this.replaceChild(document.createTextNode("raw"), this.firstChild);
this.setAttribute("title", "view raw code");
} else {
//hide the codeContainer, flatten all text nodes, create a <textarea>, append it
rawCode = getTextRecursive(context.node);
textarea = document.createElement("textarea");
textarea.value = rawCode;
textarea.setAttribute("readonly", "readonly");
textarea.style.width = (parseInt(sunlight.util.getComputedStyle(context.node, "width")) - 5) + "px"; //IE, Safari and Chrome can't handle the actual width
textarea.style.height = sunlight.util.getComputedStyle(context.node, "height");
textarea.style.border = "none";
textarea.style.overflowX = "hidden"; //IE requires this
textarea.setAttribute("wrap", "off"); //prevent line wrapping lol
context.codeContainer.insertBefore(textarea, context.node);
context.node.style.display = "none";
this.replaceChild(document.createTextNode("highlighted"), this.firstChild);
this.setAttribute("title", "view highlighted code");
textarea.select(); //highlight everything
}
return false;
}
}();
viewRaw.appendChild(viewRawLink);
about = document.createElement("li");
aboutLink = createLink("http://sunlightjs.com/", "Sunlight: JavaScript syntax highlighter by Tommy Montgomery");
icon = document.createElement("img");
icon.setAttribute("src", "data:image/png;base64," + sunlightIcon);
icon.setAttribute("alt", "about");
aboutLink.appendChild(icon);
about.appendChild(aboutLink);
ul.appendChild(about);
ul.appendChild(viewRaw);
ul.appendChild(collapse);
menu.appendChild(ul);
context.container.insertBefore(menu, context.container.firstChild);
if (this.options.autoCollapse) {
collapseLink.onclick.call(collapseLink);
}
});
sunlight.globalOptions.showMenu = false;
sunlight.globalOptions.autoCollapse = false;
}(this["Sunlight"], document)); | kda1983/Phaser | resources/docstrap-master/template/static/scripts/sunlight-plugin.menu.js | JavaScript | mit | 5,265 |
<?php
/*
* This file is part of SwiftMailer.
* (c) 2004-2009 Chris Corbyn
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* An embedded file, in a multipart message.
*
* @author Chris Corbyn
*/
class Swift_Mime_EmbeddedFile extends Swift_Mime_Attachment
{
/**
* Creates a new Attachment with $headers and $encoder.
*
* @param Swift_Mime_HeaderSet $headers
* @param Swift_Mime_ContentEncoder $encoder
* @param Swift_KeyCache $cache
* @param Swift_Mime_Grammar $grammar
* @param array $mimeTypes optional
*/
public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_Mime_Grammar $grammar, $mimeTypes = array())
{
parent::__construct($headers, $encoder, $cache, $grammar, $mimeTypes);
$this->setDisposition('inline');
$this->setId($this->getId());
}
/**
* Get the nesting level of this EmbeddedFile.
*
* Returns {@see LEVEL_RELATED}.
*
* @return int
*/
public function getNestingLevel()
{
return self::LEVEL_RELATED;
}
}
| nguyentamvinhlong/antamu_v1 | vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EmbeddedFile.php | PHP | mit | 1,264 |
/*global exports, module, require, define, setTimeout*/
(function ()
{
'use strict';
var root, sNotDefined, oModules, oVars, _null_, bUnblockUI, _false_, sVersion, FakeModule, Hydra, bDebug, ErrorHandler, Module, Bus, oChannels, isNodeEnvironment, oObjProto;
/**
* Used to generate an unique key for instance ids that are not supplied by the user.
* @return {String}
*/
function generateUniqueKey()
{
var sFirstToken = +new Date() + '',
sSecondToken = Math.floor( Math.random() * (999999 - 1 + 1) ) + 1;
return sFirstToken + '_' + sSecondToken;
}
/**
* Return the length of properties of one object
* @param oObj
* @return {*}
*/
function getObjectLength( oObj )
{
var nLen, sKey;
if ( Object.keys )
{
nLen = Object.keys( oObj ).length;
}
else
{
nLen = 0;
for ( sKey in oObj )
{
if ( ownProp( oObj, sKey ) )
{
nLen++;
}
}
}
return nLen;
}
/**
* Check if Object.create exist, if not exist we create it to be used inside the code.
*/
if ( typeof Object.create !== 'function' )
{
Object.create = function ( oObject )
{
function Copy()
{
}
Copy.prototype = oObject;
return new Copy();
};
}
/**
* Check if Hydra.js is loaded in Node.js environment
* @type {Boolean}
*/
isNodeEnvironment = typeof exports === 'object' && typeof module === 'object' && typeof module.exports === 'object' && typeof require === 'function';
/**
* Cache 'undefined' string to test typeof
* @type {String}
*/
sNotDefined = 'undefined';
/**
* Cache of object prototype to use it in other functions
* @type {Object}
*/
oObjProto = Object.prototype;
/**
* set the correct root depending from the environment.
*/
root = this;
/**
* Contains a reference to null object to decrease final size
* @type {Object}
* @private
*/
_null_ = null;
/**
* Contains a reference to false to decrease final size
* @type {Boolean}
* @private
*/
_false_ = false;
/**
* Property that will save the registered modules
* @private
* @type {Object}
*/
oModules = {};
/**
* Version of Hydra
* @private
* @type {String}
*/
sVersion = '3.1.3';
/**
* Used to activate the debug mode
* @private
* @type {Boolean}
*/
bDebug = _false_;
/**
* Use to activate the unblock UI when notifies are executed.
* WARNING!!! This will not block your UI but could give problems with the order of execution.
* @type {Boolean}
*/
bUnblockUI = _false_;
/**
* Wrapper of Object.prototype.toString to detect type of object in cross browsing mode.
* @private
* @param {Object} oObject
* @return {String}
*/
function toString( oObject )
{
return oObjProto.toString.call( oObject );
}
/**
* isFunction is a function to know if the object passed as parameter is a Function object.
* @private
* @param {Object} fpCallback
* @return {Boolean}
*/
function isFunction( fpCallback )
{
return toString( fpCallback ) === '[object Function]';
}
/**
* isArray is a function to know if the object passed as parameter is an Array object.
* @private
* @param {String|Array|Object} aArray
* @return {Boolean}
*/
function isArray( aArray )
{
return toString( aArray ) === '[object Array]';
}
/**
* setDebug is a method to set the bDebug flag.
* @private
* @param {Boolean} _bDebug
*/
function setDebug( _bDebug )
{
bDebug = _bDebug;
}
/**
* setUnblockUI is a method to set the bUnblockUI flag.
* @private
* @param {Boolean} _bUnblockUI
*/
function setUnblockUI( _bUnblockUI )
{
bUnblockUI = _bUnblockUI;
}
/**
* Converts objects like node list to real array.
* @private
* @param {Object} oLikeArray
* @param {Number} nElements
* @return {Array}
*/
function slice( oLikeArray, nElements )
{
return [].slice.call( oLikeArray, nElements || 0 );
}
/**
* Wrapper of Object.hasOwnProperty
* @private
* @param {Object} oObj
* @param {String} sKey
* @return {Boolean}
*/
function ownProp( oObj, sKey )
{
return oObj.hasOwnProperty( sKey );
}
/**
* Method to modify the init method to use it for extend.
* @param oInstance
* @param oModifyInit
* @param oData
* @param bSingle
*/
function beforeInit(oInstance, oModifyInit, oData, bSingle){
var sKey;
for(sKey in oModifyInit){
if(oModifyInit.hasOwnProperty(sKey)){
if(oInstance[sKey] && typeof oModifyInit[sKey] === 'function'){
oModifyInit[sKey](oInstance, oData, bSingle);
}
}
}
}
/**
* startSingleModule is the method that will initialize the module.
* When start is called the module instance will be created and the init method is called.
* If bSingle is true and the module is started the module will be stopped before instance it again.
* This avoid execute the same listeners more than one time.
* @param {Object} oWrapper
* @param {String} sModuleId
* @param {String} sIdInstance
* @param {Object} oData
* @param {Boolean} bSingle
* @return {Module} instance of the module
* @private
*/
function startSingleModule( oWrapper, sModuleId, sIdInstance, oData, bSingle )
{
var oModule, oInstance;
oModule = oModules[sModuleId];
if ( bSingle && oWrapper.isModuleStarted( sModuleId, sIdInstance ) )
{
oWrapper.stop( sModuleId, sIdInstance );
}
if ( typeof oModule !== sNotDefined )
{
oInstance = createInstance( sModuleId );
oModule.instances[sIdInstance] = oInstance;
oInstance.__instance_id__ = sIdInstance;
beforeInit(oInstance, oWrapper.oModifyInit, oData, bSingle);
if ( typeof oData !== sNotDefined )
{
oInstance.init( oData );
}
else
{
oInstance.init();
}
}
return oInstance;
}
/**
* Do a simple merge of two objects overwriting the target properties with source properties
* @param {Object} oTarget
* @param {Object} oSource
* @private
*/
function simpleMerge( oTarget, oSource )
{
var sKey;
for ( sKey in oSource )
{
if ( ownProp( oSource, sKey ) )
{
oTarget[sKey] = oSource[sKey];
}
}
return oTarget;
}
/**
* wrapMethod is a method to wrap the original method to avoid failing code.
* This will be only called if bDebug flag is set to false.
* @private
* @param {Object} oInstance
* @param {String} sName
* @param {String} sModuleId
* @param {Function} fpMethod
*/
function wrapMethod( oInstance, sName, sModuleId, fpMethod )
{
oInstance[sName] = (function ( sName, fpMethod )
{
return function ()
{
var aArgs = slice( arguments, 0 );
try
{
return fpMethod.apply( this, aArgs );
}
catch ( erError )
{
ErrorHandler.log( sModuleId, sName, erError );
return false;
}
};
}( sName, fpMethod ));
}
/**
* Private object to save the channels for communicating event driven
* @private
* @type {Object}
*/
oChannels = {
global: {}
};
/**
* subscribersByEvent return all the subscribers of the event in the channel.
* @param {Object} oChannel
* @param {String} sEventName
* @return {Array}
* @private
*/
function subscribersByEvent( oChannel, sEventName )
{
var aSubscribers = [],
sEvent;
if ( typeof oChannel !== 'undefined' )
{
for ( sEvent in oChannel )
{
if ( ownProp( oChannel, sEvent ) && sEvent === sEventName )
{
aSubscribers = oChannel[sEvent];
}
}
}
return aSubscribers;
}
/**
* Bus is the object that must be used to manage the notifications by channels
* @constructor
*/
Bus = {
/**
* subscribers return the array of subscribers to one channel and event.
* @param {String} sChannelId
* @param {String} sEventName
* @return {Array}
*/
subscribers: function ( sChannelId, sEventName )
{
return subscribersByEvent( oChannels[sChannelId], sEventName );
},
/**
* _getChannelEvents return the events array in channel.
* @param aEventsParts
* @param sChannelId
* @param sEvent
* @return {Object}
* @private
*/
_getChannelEvents: function ( sChannelId, sEvent )
{
if ( typeof oChannels[sChannelId] === 'undefined' )
{
oChannels[sChannelId] = {};
}
if ( typeof oChannels[sChannelId][sEvent] === 'undefined' )
{
oChannels[sChannelId][sEvent] = [];
}
return oChannels[sChannelId][sEvent];
},
/**
* _addSubscribers add all the events of one channel from the subscriber
* @param oEventsCallbacks
* @param sChannelId
* @param oSubscriber
* @private
*/
_addSubscribers: function ( oEventsCallbacks, sChannelId, oSubscriber )
{
var sEvent;
for ( sEvent in oEventsCallbacks )
{
if ( ownProp( oEventsCallbacks, sEvent ) )
{
this.subscribeTo( sChannelId, sEvent, oEventsCallbacks[sEvent], oSubscriber );
}
}
},
/**
* Method to unsubscribe a subscriber from a channel and event type.
* It iterates in reverse order to avoid messing with array length when removing items.
* @param sChannelId
* @param sEventType
* @param oSubscriber
*/
unsubscribeFrom: function ( sChannelId, sEventType, oSubscriber )
{
var aChannelEvents = this._getChannelEvents( sChannelId, sEventType ),
oItem,
nEvent = aChannelEvents.length - 1;
for ( ; nEvent >= 0; nEvent-- )
{
oItem = aChannelEvents[nEvent];
if ( oItem.subscriber === oSubscriber )
{
aChannelEvents.splice( nEvent, 1 );
}
}
},
/**
* Method to add a single callback in one channel an in one event.
* @param sChannelId
* @param sEventType
* @param fpHandler
* @param oSubscriber
*/
subscribeTo: function ( sChannelId, sEventType, fpHandler, oSubscriber )
{
var aChannelEvents = this._getChannelEvents( sChannelId, sEventType );
aChannelEvents.push( {
subscriber: oSubscriber,
handler: fpHandler
} );
},
/**
* subscribe method gets the oEventsCallbacks object with all the handlers and add these handlers to the channel.
* @param {Module/Object} oSubscriber
* @return {Boolean}
*/
subscribe: function ( oSubscriber )
{
var sChannelId, oEventsCallbacks = oSubscriber.events;
if ( !oSubscriber || typeof oEventsCallbacks === 'undefined' )
{
return false;
}
for ( sChannelId in oEventsCallbacks )
{
if ( ownProp( oEventsCallbacks, sChannelId ) )
{
if ( typeof oChannels[sChannelId] === 'undefined' )
{
oChannels[sChannelId] = {};
}
this._addSubscribers( oEventsCallbacks[sChannelId], sChannelId, oSubscriber );
}
}
return true;
},
/**
* _removeSubscribers remove the subscribers to one channel and return the number of
* subscribers that have been unsubscribed.
* @param aSubscribers
* @param oSubscriber
* @return {Number}
* @private
*/
_removeSubscribers: function ( aSubscribers, oSubscriber )
{
var nLenSubscribers,
nIndex = 0,
nUnsubscribed = 0;
if ( typeof aSubscribers !== sNotDefined )
{
nLenSubscribers = aSubscribers.length;
for ( ; nIndex < nLenSubscribers; nIndex++ )
{
if ( aSubscribers[nIndex].subscriber === oSubscriber )
{
nUnsubscribed++;
aSubscribers.splice( nIndex, 1 );
}
}
}
return nUnsubscribed;
},
/**
* Loops per all the events to remove subscribers.
* @param oEventsCallbacks
* @param bOnlyGlobal
* @param sChannelId
* @param oSubscriber
* @return {*}
* @private
*/
_removeSubscribersPerEvent: function ( oEventsCallbacks, sChannelId, oSubscriber )
{
var sEvent, aEventsParts, sChannel, sEventType, nUnsubscribed = 0;
for ( sEvent in oEventsCallbacks )
{
if ( ownProp( oEventsCallbacks, sEvent ) )
{
aEventsParts = sEvent.split( ':' );
sChannel = sChannelId;
sEventType = sEvent;
if ( aEventsParts[0] === 'global' )
{
sChannel = aEventsParts[0];
sEventType = aEventsParts[1];
}
nUnsubscribed += this._removeSubscribers( oChannels[sChannel][sEventType], oSubscriber );
}
}
return nUnsubscribed;
},
/**
* unsubscribe gets the oEventsCallbacks methods and removes the handlers of the channel.
* @param {Module/Object} oSubscriber
* @return {Boolean}
*/
unsubscribe: function ( oSubscriber )
{
var nUnsubscribed = 0, sChannelId, oEventsCallbacks = oSubscriber.events;
if ( !oSubscriber || typeof oEventsCallbacks === 'undefined' )
{
return false;
}
for ( sChannelId in oEventsCallbacks )
{
if ( ownProp( oEventsCallbacks, sChannelId ) )
{
if ( typeof oChannels[sChannelId] === 'undefined' )
{
oChannels[sChannelId] = {};
}
nUnsubscribed = this._removeSubscribersPerEvent( oEventsCallbacks[sChannelId], sChannelId, oSubscriber );
}
}
return nUnsubscribed > 0;
},
/**
* Method to execute all the callbacks but without blocking the user interface.
* @private
* @param {Array} aSubscribers
* @param {Object} oData
* @param {String} sChannelId
* @param {String} sEvent
*/
_avoidBlockUI: function ( aSubscribers, oData, sChannelId, sEvent )
{
var oHandlerObject,
aSubs = aSubscribers.concat();
setTimeout( function recall()
{
var nStart = +new Date();
do {
oHandlerObject = aSubs.shift();
oHandlerObject.handler.call( oHandlerObject.subscriber, oData );
if ( bDebug )
{
ErrorHandler.log( sChannelId, sEvent, oHandlerObject );
}
}
while ( aSubs.length > 0 && ( +new Date() - nStart < 50 ) );
if ( aSubs.length > 0 )
{
setTimeout( recall, 25 );
}
}, 25 );
},
/**
* Publish the event in one channel.
* @param {String} sChannelId
* @param {String} sEvent
* @param {String} oData
*/
publish: function ( sChannelId, sEvent, oData )
{
var aSubscribers = this.subscribers( sChannelId, sEvent ).slice(),
nLenSubscribers = aSubscribers.length,
nIndex,
oHandlerObject;
if ( nLenSubscribers === 0 )
{
return false;
}
if ( bUnblockUI )
{
this._avoidBlockUI( aSubscribers, oData, sChannelId, sEvent );
}
else
{
for ( nIndex = 0; nIndex < nLenSubscribers; nIndex++ )
{
oHandlerObject = aSubscribers[nIndex];
oHandlerObject.handler.call( oHandlerObject.subscriber, oData );
if ( bDebug )
{
ErrorHandler.log( sChannelId, sEvent, oHandlerObject );
}
}
}
return true;
},
/**
* Reset channels
*/
reset: function ()
{
oChannels = {
global: {}
};
}
};
/**
* Add common properties and methods to avoid repeating code in modules
* @param {String} sModuleId
* @param {Object} Bus
*/
function addPropertiesAndMethodsToModule( sModuleId, Bus )
{
var oModule,
fpInitProxy;
oModule = oModules[sModuleId].creator( Bus );
oModule.__module_id__ = sModuleId;
fpInitProxy = oModule.init || function ()
{
};
oModule.__action__ = Bus;
oModule.events = oModule.events || {};
oModule.init = function ()
{
var aArgs = slice( arguments, 0 ).concat( oVars );
Bus.subscribe( oModule );
fpInitProxy.apply( this, aArgs );
};
oModule.handleAction = function ( oNotifier )
{
var fpCallback = this.events[oNotifier.type];
if ( typeof fpCallback === sNotDefined )
{
return;
}
fpCallback.call( this, oNotifier );
};
oModule.onDestroy = oModule.onDestroy || function ()
{
};
oModule.destroy = function ()
{
this.onDestroy();
Bus.unsubscribe( oModule );
};
return oModule;
}
/**
* createInstance is the method that will create the module instance and wrap the method if needed.
* @private
* @param {String} sModuleId
* @return {Object} Module instance
*/
function createInstance( sModuleId )
{
var oInstance, sName;
if ( typeof oModules[sModuleId] === sNotDefined )
{
throw new Error( 'The module ' + sModuleId + ' is not registered!' );
}
oInstance = addPropertiesAndMethodsToModule( sModuleId, Bus );
if ( !bDebug )
{
for ( sName in oInstance )
{
if ( ownProp( oInstance, sName ) && isFunction( oInstance[sName] ) )
{
wrapMethod( oInstance, sName, sModuleId, oInstance[sName] );
}
}
}
return oInstance;
}
/**
* Simple object to abstract the error handler, the most basic is to be the console object
*/
ErrorHandler = root.console || {
log: function ()
{
}
};
/**
* Class to manage the modules.
* @constructor
* @class Module
* @name Module
*/
Module = function ()
{
};
Module.prototype = {
/**
* type is a property to be able to know the class type.
* @member Module.prototype
* @type String
*/
type: 'Module',
/**
* Wrapper to use createInstance for plugins if needed.
*/
getInstance: createInstance,
/**
* oModifyInit is an object where save the extensions to modify the init function to use by extensions.
* @param sModuleId
* @param fpCreator
* @returns {*}
*/
oModifyInit: {},
/**
* register is the method that will add the new module to the oModules object.
* sModuleId will be the key where it will be stored.
* @member Module.prototype
* @param {String} sModuleId
* @param {Function} fpCreator
* @return {Module}
*/
register: function ( sModuleId, fpCreator )
{
oModules[sModuleId] = new FakeModule( sModuleId, fpCreator );
return oModules[sModuleId];
},
/**
* _setSuper add the __super__ support to access to the methods in parent module.
* @param oFinalModule
* @param oModuleBase
* @private
*/
_setSuper: function ( oFinalModule, oModuleBase )
{
oFinalModule.__super__ = {};
oFinalModule.__super__.__instance__ = oModuleBase;
oFinalModule.__super__.__call__ = function ( sKey, aArgs )
{
var oObject = this;
while ( ownProp( oObject, sKey ) === _false_ )
{
oObject = oObject.__instance__.__super__;
}
oObject[sKey].apply( oFinalModule, aArgs );
};
},
/**
* Callback that is used to call the methods in parent module.
* @private
* @param fpCallback
* @return {Function}
*/
_callInSuper: function ( fpCallback )
{
return function ()
{
var aArgs = slice( arguments, 0 );
fpCallback.apply( this, aArgs );
};
},
/**
* Adds the extended properties and methods to final module.
* @param oFinalModule
* @param oModuleExtended
* @private
*/
_mergeModuleExtended: function ( oFinalModule, oModuleExtended )
{
var sKey;
for ( sKey in oModuleExtended )
{
if ( ownProp( oModuleExtended, sKey ) )
{
if ( typeof oFinalModule.__super__ !== sNotDefined && isFunction( oFinalModule[sKey] ) )
{
oFinalModule.__super__[sKey] = (this._callInSuper( oFinalModule[sKey] ));
}
oFinalModule[sKey] = oModuleExtended[sKey];
}
}
},
/**
* Adds the base properties and methods to final module.
* @param oFinalModule
* @param oModuleBase
* @private
*/
_mergeModuleBase: function ( oFinalModule, oModuleBase )
{
var sKey;
for ( sKey in oModuleBase )
{
if ( ownProp( oModuleBase, sKey ) )
{
if ( sKey !== '__super__' )
{
oFinalModule[sKey] = oModuleBase[sKey];
}
}
}
},
/**
* _merge is the method that gets the base module and the extended and returns the merge of them
* @private
* @param {Object} oModuleBase
* @param {Object} oModuleExtended
* @return {Object}
*/
_merge: function ( oModuleBase, oModuleExtended )
{
var oFinalModule = {};
this._setSuper( oFinalModule, oModuleBase );
this._mergeModuleBase( oFinalModule, oModuleBase );
this._mergeModuleExtended( oFinalModule, oModuleExtended );
return oFinalModule;
},
/**
* extend is the method that will be used to extend a module with new features.
* can be used to remove some features too, without touching the original code.
* You can extend a module and create a extended module with a different name.
* @member Module.prototype
* @param {String} sModuleId
* @param {Function/String} oSecondParameter can be the name of the new module that extends the baseModule or a function if we want to extend an existent module.
* @param {Function} oThirdParameter [optional] this must exist only if we need to create a new module that extends the baseModule.
*/
extend: function ( sModuleId, oSecondParameter, oThirdParameter )
{
var oModule, sFinalModuleId, fpCreator, oBaseModule, oExtendedModule, oFinalModule, self;
self = this;
oModule = oModules[sModuleId];
sFinalModuleId = sModuleId;
fpCreator = function ()
{
};
// Function "overloading".
// If the 2nd parameter is a string,
if ( typeof oSecondParameter === 'string' )
{
sFinalModuleId = oSecondParameter;
fpCreator = oThirdParameter;
}
else
{
fpCreator = oSecondParameter;
}
if ( typeof oModule === sNotDefined )
{
return;
}
oExtendedModule = fpCreator( Bus );
oBaseModule = oModule.creator( Bus );
oModules[sFinalModuleId] = new FakeModule( sFinalModuleId, function ( Bus )
{
// If we extend the module with the different name, we
// create proxy class for the original methods.
oFinalModule = self._merge( oBaseModule, oExtendedModule );
// This gives access to the Action instance used to listen and notify.
oFinalModule.__action__ = Bus;
return oFinalModule;
} );
return oModules[sFinalModuleId];
},
/**
* Method to set an instance of a module
* @param {String} sModuleId
* @param {String} sIdInstance
* @param {Object} oInstance
* @return {Module}
*/
setInstance: function ( sModuleId, sIdInstance, oInstance )
{
var oModule = oModules[sModuleId];
if ( !oModule )
{
throw new Error( 'The module ' + sModuleId + ' is not registered!' );
}
oModule.instances[sIdInstance] = oInstance;
return oModule;
},
/**
* Sets an object of vars and add it's content to oVars private variable
* @param {Object} oVar
*/
setVars: function ( oVar )
{
if ( typeof oVars !== sNotDefined )
{
oVars = simpleMerge( oVars, oVar );
}
else
{
oVars = oVar;
}
},
/**
* Returns the private vars object by copy.
* @returns {Object} global vars.
*/
getVars: function ()
{
return simpleMerge( {}, oVars );
},
/**
* start more than one module at the same time.
* @param aModulesIds
* @param sIdInstance
* @param oData
* @param bSingle
* @private
*/
_multiModuleStart: function ( aModulesIds, sIdInstance, oData, bSingle )
{
var aInstancesIds, aData, aSingle, nIndex, nLenModules, sModuleId;
if ( isArray( sIdInstance ) )
{
aInstancesIds = sIdInstance.slice( 0 );
}
if ( isArray( oData ) )
{
aData = oData.slice( 0 );
}
if ( isArray( bSingle ) )
{
aSingle = bSingle.slice( 0 );
}
for ( nIndex = 0, nLenModules = aModulesIds.length; nIndex < nLenModules; nIndex++ )
{
sModuleId = aModulesIds[nIndex];
sIdInstance = aInstancesIds && aInstancesIds[nIndex] || generateUniqueKey();
oData = aData && aData[nIndex] || oData;
bSingle = aSingle && aSingle[nIndex] || bSingle;
startSingleModule( this, sModuleId, sIdInstance, oData, bSingle );
}
},
/**
* Start only one module.
* @param sModuleId
* @param sIdInstance
* @param oData
* @param bSingle
* @private
*/
_singleModuleStart: function ( sModuleId, sIdInstance, oData, bSingle )
{
if ( typeof sIdInstance !== 'string' )
{
oData = sIdInstance;
bSingle = oData;
sIdInstance = generateUniqueKey();
}
startSingleModule( this, sModuleId, sIdInstance, oData, bSingle );
},
/**
* start is the method that initialize the module/s
* If you use array instead of arrays you can start more than one module even adding the instance, the data and if it must be executed
* as single module start.
* @param {String/Array} sModuleId
* @param {String/Array} sIdInstance
* @param {Object/Array} oData
* @param {Boolean/Array} bSingle
*/
start: function ( sModuleId, sIdInstance, oData, bSingle )
{
var bStartMultipleModules = isArray( sModuleId );
if ( bStartMultipleModules )
{
this._multiModuleStart( sModuleId.slice( 0 ), sIdInstance, oData, bSingle );
}
else
{
this._singleModuleStart( sModuleId, sIdInstance, oData, bSingle );
}
},
/**
* Checks if module was already successfully started
* @member Module.prototype
* @param {String} sModuleId Name of the module
* @param {String} sInstanceId Id of the instance
* @return {Boolean}
*/
isModuleStarted: function ( sModuleId, sInstanceId )
{
var bStarted = false;
if ( typeof sInstanceId === sNotDefined )
{
bStarted = ( typeof oModules[sModuleId] !== sNotDefined && getObjectLength( oModules[sModuleId].instances ) > 0 );
}
else
{
bStarted = ( typeof oModules[sModuleId] !== sNotDefined && typeof oModules[sModuleId].instances[sInstanceId] !== sNotDefined );
}
return bStarted;
},
/**
* startAll is the method that will initialize all the registered modules.
* @member Module.prototype
*/
startAll: function ()
{
var sModuleId, oModule;
for ( sModuleId in oModules )
{
if ( ownProp( oModules, sModuleId ) )
{
oModule = oModules[sModuleId];
if ( typeof oModule !== sNotDefined )
{
this.start( sModuleId, generateUniqueKey() );
}
}
}
},
/**
* stop more than one module at the same time.
* @param oModule
* @private
*/
_multiModuleStop: function ( oModule )
{
var sKey,
oInstances = oModule.instances,
oInstance;
for ( sKey in oInstances )
{
if ( ownProp( oInstances, sKey ) )
{
oInstance = oInstances[sKey];
if ( typeof oModule !== sNotDefined && typeof oInstance !== sNotDefined )
{
oInstance.destroy();
}
}
}
oModule.instances = {};
},
/**
* Stop only one module.
* @param oModule
* @param sModuleId
* @param sInstanceId
* @private
*/
_singleModuleStop: function ( oModule, sModuleId, sInstanceId )
{
var oInstance = oModule.instances[sInstanceId];
if ( typeof oModule !== sNotDefined && typeof oInstance !== sNotDefined )
{
oInstance.destroy();
delete oModule.instances[sInstanceId];
}
},
/**
* stop is the method that will finish the module if it was registered and started.
* When stop is called the module will call the destroy method and will nullify the instance.
* @member Module.prototype
* @param {String} sModuleId
* @param {String} sInstanceId
* @return {Boolean}
*/
stop: function ( sModuleId, sInstanceId )
{
var oModule;
oModule = oModules[sModuleId];
if ( typeof oModule === sNotDefined )
{
return false;
}
if ( typeof sInstanceId !== sNotDefined )
{
this._singleModuleStop( oModule, sModuleId, sInstanceId );
}
else
{
this._multiModuleStop( oModule );
}
return true;
},
/**
* Loops over instances of modules to stop them.
* @param oInstances
* @param sModuleId
* @private
*/
_stopOneByOne: function ( oInstances, sModuleId )
{
var sInstanceId;
for ( sInstanceId in oInstances )
{
if ( ownProp( oInstances, sInstanceId ) )
{
this.stop( sModuleId, sInstanceId );
}
}
},
/**
* stopAll is the method that will finish all the registered and started modules.
* @member Module.prototype
*/
stopAll: function ()
{
var sModuleId;
for ( sModuleId in oModules )
{
if ( ownProp( oModules, sModuleId ) && typeof oModules[sModuleId] !== sNotDefined )
{
this._stopOneByOne( oModules[sModuleId].instances, sModuleId );
}
}
},
/**
* _delete is a wrapper method that will call the native delete javascript function
* It's important to test the full code.
* @member Module.prototype
* @param {String} sModuleId
*/
_delete: function ( sModuleId )
{
if ( typeof oModules[sModuleId] !== sNotDefined )
{
delete oModules[sModuleId];
}
},
/**
* remove is the method that will remove the full module from the oModules object
* @member Module.prototype
* @param {String} sModuleId
*/
remove: function ( sModuleId )
{
var oModule = oModules[sModuleId];
if ( typeof oModule === sNotDefined )
{
return null;
}
if ( typeof oModule !== sNotDefined )
{
try
{
return oModule;
}
finally
{
this._delete( sModuleId );
}
}
return null;
}
};
/**
* getErrorHandler is a method to gain access to the private ErrorHandler constructor.
* @private
* @return ErrorHandler class
*/
function getErrorHandler()
{
return ErrorHandler;
}
/**
* setErrorHandler is a method to set the ErrorHandler to a new object to add more logging logic.
* @private
* @param {Function} oErrorHandler
*/
function setErrorHandler( oErrorHandler )
{
ErrorHandler = oErrorHandler;
}
/**
* Hydra is the api that will be available to use by developers
* @constructor
* @class Hydra
* @name Hydra
*/
Hydra = function ()
{
};
/**
* Version number of Hydra.
* @static
* @member Hydra
* @type String
*/
Hydra.version = sVersion;
/**
* bus is a singleton instance of the bus to subscribe and publish content in channels.
* @type {Object}
*/
Hydra.bus = Bus;
/**
* Returns the actual ErrorHandler
* @static
* @member Hydra
* @type ErrorHandler
*/
Hydra.errorHandler = getErrorHandler;
/**
* Sets and overwrites the ErrorHandler object to log errors and messages
* @static
* @param ErrorHandler
* @member Hydra
*/
Hydra.setErrorHandler = setErrorHandler;
/**
* Return a singleton of Module
* @static
* @member Hydra
*/
Hydra.module = new Module();
/**
* Change the unblock UI mode to on/off
* @static
* @Member Hydra
*/
Hydra.setUnblockUI = setUnblockUI;
/**
* Change the debug mode to on/off
* @static
* @member Hydra
*/
Hydra.setDebug = setDebug;
/**
* Get the debug status
* @static
* @member Hydra
*/
Hydra.getDebug = function ()
{
return bDebug;
};
/**
* Extends Hydra object with new functionality
* @static
* @member Hydra
* @param {String} sIdExtension
* @param {Object} oExtension
*/
Hydra.extend = function ( sIdExtension, oExtension )
{
if ( typeof this[sIdExtension] === sNotDefined )
{
this[sIdExtension] = oExtension;
}
else
{
this[sIdExtension] = simpleMerge( this[sIdExtension], oExtension );
}
};
/**
* Adds an alias to parts of Hydra
* @static
* @member Hydra
* @param {String} sOldName
* @param {Object} oNewContext
* @param {String} sNewName
* @return {Boolean}
*/
Hydra.noConflict = function ( sOldName, oNewContext, sNewName )
{
if ( typeof this[sOldName] !== sNotDefined )
{
oNewContext[sNewName] = this[sOldName];
return true;
}
return false;
};
/**
* Merges an object to oModifyInit that will be executed before executing the init.
* {
* 'property_in_module_to_check': function(oModule){} // Callback to execute if the property exist
* }
* @param {Object} oVar
*/
Hydra.addExtensionBeforeInit = function(oVar){
Hydra.module.oModifyInit = simpleMerge( Hydra.module.oModifyInit, oVar );
};
/**
* Module to be stored, adds two methods to start and extend modules.
* @private
* @param {String} sModuleId
* @param {Function} fpCreator
* @constructor
*/
FakeModule = function ( sModuleId, fpCreator )
{
if ( typeof fpCreator === sNotDefined )
{
throw new Error( 'Something goes wrong!' );
}
this.creator = fpCreator;
this.instances = {};
this.sModuleId = sModuleId;
};
FakeModule.prototype = {
start: function ( oData )
{
Hydra.module.start( this.sModuleId, oData );
return this;
},
extend: function ( oSecondParameter, oThirdParameter )
{
Hydra.module.extend( this.sModuleId, oSecondParameter, oThirdParameter );
return this;
},
stop: function ()
{
Hydra.module.stop( this.sModuleId );
return this;
}
};
/*
* Expose Hydra to be used in node.js, as AMD module or as global
*/
root.Hydra = Hydra;
if ( isNodeEnvironment )
{
module.exports = Hydra;
}
else if ( typeof define !== 'undefined' )
{
define( 'hydra', [], function ()
{
return Hydra;
} );
}
}.call( this ));
| joeyparrish/cdnjs | ajax/libs/hydra.js/3.1.5/hydra.js | JavaScript | mit | 36,629 |
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/io-upload-iframe/io-upload-iframe.js']) {
__coverage__['build/io-upload-iframe/io-upload-iframe.js'] = {"path":"build/io-upload-iframe/io-upload-iframe.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},"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],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,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,"17":0,"18":0,"19":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":47}}},"2":{"name":"_cFrame","line":27,"loc":{"start":{"line":27,"column":0},"end":{"line":27,"column":27}}},"3":{"name":"(anonymous_3)","line":34,"loc":{"start":{"line":34,"column":17},"end":{"line":34,"column":28}}},"4":{"name":"_dFrame","line":45,"loc":{"start":{"line":45,"column":0},"end":{"line":45,"column":21}}},"5":{"name":"(anonymous_5)","line":61,"loc":{"start":{"line":61,"column":14},"end":{"line":61,"column":29}}},"6":{"name":"(anonymous_6)","line":92,"loc":{"start":{"line":92,"column":17},"end":{"line":92,"column":32}}},"7":{"name":"(anonymous_7)","line":110,"loc":{"start":{"line":110,"column":15},"end":{"line":110,"column":36}}},"8":{"name":"(anonymous_8)","line":125,"loc":{"start":{"line":125,"column":17},"end":{"line":125,"column":32}}},"9":{"name":"(anonymous_9)","line":126,"loc":{"start":{"line":126,"column":25},"end":{"line":126,"column":40}}},"10":{"name":"(anonymous_10)","line":146,"loc":{"start":{"line":146,"column":25},"end":{"line":146,"column":40}}},"11":{"name":"(anonymous_11)","line":150,"loc":{"start":{"line":150,"column":12},"end":{"line":150,"column":23}}},"12":{"name":"(anonymous_12)","line":165,"loc":{"start":{"line":165,"column":25},"end":{"line":165,"column":38}}},"13":{"name":"(anonymous_13)","line":181,"loc":{"start":{"line":181,"column":21},"end":{"line":181,"column":36}}},"14":{"name":"(anonymous_14)","line":211,"loc":{"start":{"line":211,"column":22},"end":{"line":211,"column":33}}},"15":{"name":"(anonymous_15)","line":224,"loc":{"start":{"line":224,"column":13},"end":{"line":224,"column":33}}},"16":{"name":"(anonymous_16)","line":256,"loc":{"start":{"line":256,"column":19},"end":{"line":256,"column":30}}},"17":{"name":"(anonymous_17)","line":268,"loc":{"start":{"line":268,"column":26},"end":{"line":268,"column":37}}},"18":{"name":"(anonymous_18)","line":275,"loc":{"start":{"line":275,"column":12},"end":{"line":275,"column":32}}},"19":{"name":"(anonymous_19)","line":280,"loc":{"start":{"line":280,"column":9},"end":{"line":280,"column":45}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":292,"column":56}},"2":{"start":{"line":11,"column":0},"end":{"line":15,"column":30}},"3":{"start":{"line":27,"column":0},"end":{"line":35,"column":1}},"4":{"start":{"line":28,"column":4},"end":{"line":28,"column":104}},"5":{"start":{"line":29,"column":8},"end":{"line":29,"column":44}},"6":{"start":{"line":30,"column":8},"end":{"line":30,"column":38}},"7":{"start":{"line":31,"column":8},"end":{"line":31,"column":39}},"8":{"start":{"line":32,"column":8},"end":{"line":32,"column":37}},"9":{"start":{"line":34,"column":4},"end":{"line":34,"column":80}},"10":{"start":{"line":34,"column":30},"end":{"line":34,"column":55}},"11":{"start":{"line":45,"column":0},"end":{"line":48,"column":1}},"12":{"start":{"line":46,"column":1},"end":{"line":46,"column":48}},"13":{"start":{"line":47,"column":1},"end":{"line":47,"column":53}},"14":{"start":{"line":50,"column":0},"end":{"line":289,"column":3}},"15":{"start":{"line":64,"column":8},"end":{"line":66,"column":9}},"16":{"start":{"line":65,"column":12},"end":{"line":65,"column":43}},"17":{"start":{"line":68,"column":8},"end":{"line":70,"column":17}},"18":{"start":{"line":72,"column":8},"end":{"line":78,"column":9}},"19":{"start":{"line":73,"column":12},"end":{"line":73,"column":44}},"20":{"start":{"line":74,"column":12},"end":{"line":74,"column":33}},"21":{"start":{"line":75,"column":12},"end":{"line":75,"column":70}},"22":{"start":{"line":76,"column":12},"end":{"line":76,"column":111}},"23":{"start":{"line":77,"column":12},"end":{"line":77,"column":32}},"24":{"start":{"line":80,"column":8},"end":{"line":80,"column":17}},"25":{"start":{"line":93,"column":8},"end":{"line":93,"column":17}},"26":{"start":{"line":95,"column":8},"end":{"line":97,"column":9}},"27":{"start":{"line":96,"column":12},"end":{"line":96,"column":32}},"28":{"start":{"line":111,"column":8},"end":{"line":111,"column":38}},"29":{"start":{"line":112,"column":8},"end":{"line":112,"column":41}},"30":{"start":{"line":113,"column":8},"end":{"line":113,"column":52}},"31":{"start":{"line":114,"column":8},"end":{"line":114,"column":89}},"32":{"start":{"line":126,"column":8},"end":{"line":133,"column":11}},"33":{"start":{"line":127,"column":12},"end":{"line":132,"column":13}},"34":{"start":{"line":128,"column":16},"end":{"line":128,"column":37}},"35":{"start":{"line":131,"column":16},"end":{"line":131,"column":37}},"36":{"start":{"line":147,"column":8},"end":{"line":147,"column":22}},"37":{"start":{"line":149,"column":8},"end":{"line":155,"column":26}},"38":{"start":{"line":151,"column":16},"end":{"line":151,"column":29}},"39":{"start":{"line":152,"column":16},"end":{"line":152,"column":41}},"40":{"start":{"line":153,"column":16},"end":{"line":153,"column":34}},"41":{"start":{"line":154,"column":16},"end":{"line":154,"column":29}},"42":{"start":{"line":166,"column":8},"end":{"line":166,"column":22}},"43":{"start":{"line":168,"column":8},"end":{"line":168,"column":40}},"44":{"start":{"line":169,"column":8},"end":{"line":169,"column":31}},"45":{"start":{"line":182,"column":8},"end":{"line":185,"column":14}},"46":{"start":{"line":187,"column":8},"end":{"line":189,"column":9}},"47":{"start":{"line":188,"column":12},"end":{"line":188,"column":41}},"48":{"start":{"line":191,"column":2},"end":{"line":204,"column":3}},"49":{"start":{"line":192,"column":3},"end":{"line":200,"column":4}},"50":{"start":{"line":195,"column":4},"end":{"line":195,"column":33}},"51":{"start":{"line":196,"column":4},"end":{"line":196,"column":57}},"52":{"start":{"line":199,"column":4},"end":{"line":199,"column":30}},"53":{"start":{"line":203,"column":3},"end":{"line":203,"column":26}},"54":{"start":{"line":206,"column":8},"end":{"line":206,"column":26}},"55":{"start":{"line":207,"column":8},"end":{"line":207,"column":21}},"56":{"start":{"line":211,"column":8},"end":{"line":211,"column":56}},"57":{"start":{"line":211,"column":35},"end":{"line":211,"column":49}},"58":{"start":{"line":225,"column":8},"end":{"line":232,"column":19}},"59":{"start":{"line":236,"column":8},"end":{"line":236,"column":35}},"60":{"start":{"line":237,"column":8},"end":{"line":239,"column":9}},"61":{"start":{"line":238,"column":12},"end":{"line":238,"column":44}},"62":{"start":{"line":243,"column":8},"end":{"line":245,"column":9}},"63":{"start":{"line":244,"column":12},"end":{"line":244,"column":41}},"64":{"start":{"line":248,"column":8},"end":{"line":248,"column":19}},"65":{"start":{"line":249,"column":8},"end":{"line":249,"column":23}},"66":{"start":{"line":250,"column":8},"end":{"line":252,"column":9}},"67":{"start":{"line":251,"column":12},"end":{"line":251,"column":38}},"68":{"start":{"line":254,"column":8},"end":{"line":272,"column":10}},"69":{"start":{"line":257,"column":16},"end":{"line":257,"column":29}},"70":{"start":{"line":258,"column":16},"end":{"line":258,"column":39}},"71":{"start":{"line":259,"column":16},"end":{"line":266,"column":17}},"72":{"start":{"line":260,"column":20},"end":{"line":260,"column":34}},"73":{"start":{"line":261,"column":20},"end":{"line":261,"column":38}},"74":{"start":{"line":262,"column":20},"end":{"line":262,"column":39}},"75":{"start":{"line":265,"column":20},"end":{"line":265,"column":33}},"76":{"start":{"line":269,"column":16},"end":{"line":269,"column":65}},"77":{"start":{"line":276,"column":8},"end":{"line":276,"column":28}},"78":{"start":{"line":277,"column":8},"end":{"line":277,"column":39}},"79":{"start":{"line":281,"column":8},"end":{"line":285,"column":9}},"80":{"start":{"line":282,"column":12},"end":{"line":282,"column":26}},"81":{"start":{"line":284,"column":12},"end":{"line":284,"column":36}},"82":{"start":{"line":287,"column":8},"end":{"line":287,"column":52}}},"branchMap":{"1":{"line":13,"type":"binary-expr","locations":[{"start":{"line":13,"column":12},"end":{"line":13,"column":26}},{"start":{"line":13,"column":30},"end":{"line":13,"column":49}}]},"2":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":8},"end":{"line":64,"column":8}},{"start":{"line":64,"column":8},"end":{"line":64,"column":8}}]},"3":{"line":76,"type":"cond-expr","locations":[{"start":{"line":76,"column":41},"end":{"line":76,"column":53}},{"start":{"line":76,"column":56},"end":{"line":76,"column":110}}]},"4":{"line":114,"type":"cond-expr","locations":[{"start":{"line":114,"column":42},"end":{"line":114,"column":52}},{"start":{"line":114,"column":55},"end":{"line":114,"column":64}}]},"5":{"line":114,"type":"binary-expr","locations":[{"start":{"line":114,"column":23},"end":{"line":114,"column":30}},{"start":{"line":114,"column":34},"end":{"line":114,"column":39}}]},"6":{"line":127,"type":"if","locations":[{"start":{"line":127,"column":12},"end":{"line":127,"column":12}},{"start":{"line":127,"column":12},"end":{"line":127,"column":12}}]},"7":{"line":187,"type":"if","locations":[{"start":{"line":187,"column":8},"end":{"line":187,"column":8}},{"start":{"line":187,"column":8},"end":{"line":187,"column":8}}]},"8":{"line":192,"type":"if","locations":[{"start":{"line":192,"column":3},"end":{"line":192,"column":3}},{"start":{"line":192,"column":3},"end":{"line":192,"column":3}}]},"9":{"line":196,"type":"cond-expr","locations":[{"start":{"line":196,"column":27},"end":{"line":196,"column":40}},{"start":{"line":196,"column":43},"end":{"line":196,"column":56}}]},"10":{"line":226,"type":"cond-expr","locations":[{"start":{"line":226,"column":50},"end":{"line":226,"column":77}},{"start":{"line":226,"column":80},"end":{"line":226,"column":89}}]},"11":{"line":237,"type":"if","locations":[{"start":{"line":237,"column":8},"end":{"line":237,"column":8}},{"start":{"line":237,"column":8},"end":{"line":237,"column":8}}]},"12":{"line":243,"type":"if","locations":[{"start":{"line":243,"column":8},"end":{"line":243,"column":8}},{"start":{"line":243,"column":8},"end":{"line":243,"column":8}}]},"13":{"line":250,"type":"if","locations":[{"start":{"line":250,"column":8},"end":{"line":250,"column":8}},{"start":{"line":250,"column":8},"end":{"line":250,"column":8}}]},"14":{"line":259,"type":"if","locations":[{"start":{"line":259,"column":16},"end":{"line":259,"column":16}},{"start":{"line":259,"column":16},"end":{"line":259,"column":16}}]},"15":{"line":269,"type":"cond-expr","locations":[{"start":{"line":269,"column":52},"end":{"line":269,"column":56}},{"start":{"line":269,"column":59},"end":{"line":269,"column":64}}]},"16":{"line":281,"type":"if","locations":[{"start":{"line":281,"column":8},"end":{"line":281,"column":8}},{"start":{"line":281,"column":8},"end":{"line":281,"column":8}}]},"17":{"line":281,"type":"binary-expr","locations":[{"start":{"line":281,"column":12},"end":{"line":281,"column":18}},{"start":{"line":281,"column":22},"end":{"line":281,"column":33}},{"start":{"line":281,"column":37},"end":{"line":281,"column":55}}]}},"code":["(function () { YUI.add('io-upload-iframe', function (Y, NAME) {","","/**","Extends the IO to enable file uploads, with HTML forms","using an iframe as the transport medium.","@module io","@submodule io-upload-iframe","@for IO","**/","","var w = Y.config.win,"," d = Y.config.doc,"," _std = (d.documentMode && d.documentMode >= 8),"," _d = decodeURIComponent,"," _end = Y.IO.prototype.end;","","/**"," * Creates the iframe transported used in file upload"," * transactions, and binds the response event handler."," *"," * @method _cFrame"," * @private"," * @param {Object} o Transaction object generated by _create()."," * @param {Object} c Configuration object passed to YUI.io()."," * @param {Object} io"," */","function _cFrame(o, c, io) {"," var i = Y.Node.create('<iframe src=\"#\" id=\"io_iframe' + o.id + '\" name=\"io_iframe' + o.id + '\" />');"," i._node.style.position = 'absolute';"," i._node.style.top = '-1000px';"," i._node.style.left = '-1000px';"," Y.one('body').appendChild(i);"," // Bind the onload handler to the iframe to detect the file upload response."," Y.on(\"load\", function() { io._uploadComplete(o, c); }, '#io_iframe' + o.id);","}","","/**"," * Removes the iframe transport used in the file upload"," * transaction."," *"," * @method _dFrame"," * @private"," * @param {Number} id The transaction ID used in the iframe's creation."," */","function _dFrame(id) {","\tY.Event.purgeElement('#io_iframe' + id, false);","\tY.one('body').removeChild(Y.one('#io_iframe' + id));","}","","Y.mix(Y.IO.prototype, {"," /**"," * Parses the POST data object and creates hidden form elements"," * for each key-value, and appends them to the HTML form object."," * @method appendData"," * @private"," * @static"," * @param {Object} f HTML form object."," * @param {String} s The key-value POST data."," * @return {Array} o Array of created fields."," */"," _addData: function(f, s) {"," // Serialize an object into a key-value string using"," // querystring-stringify-simple."," if (Y.Lang.isObject(s)) {"," s = Y.QueryString.stringify(s);"," }",""," var o = [],"," m = s.split('='),"," i, l;",""," for (i = 0, l = m.length - 1; i < l; i++) {"," o[i] = d.createElement('input');"," o[i].type = 'hidden';"," o[i].name = _d(m[i].substring(m[i].lastIndexOf('&') + 1));"," o[i].value = (i + 1 === l) ? _d(m[i + 1]) : _d(m[i + 1].substring(0, (m[i + 1].lastIndexOf('&'))));"," f.appendChild(o[i]);"," }",""," return o;"," },",""," /**"," * Removes the custom fields created to pass additional POST"," * data, along with the HTML form fields."," * @method _removeData"," * @private"," * @static"," * @param {Object} f HTML form object."," * @param {Object} o HTML form fields created from configuration.data."," */"," _removeData: function(f, o) {"," var i, l;",""," for (i = 0, l = o.length; i < l; i++) {"," f.removeChild(o[i]);"," }"," },",""," /**"," * Sets the appropriate attributes and values to the HTML"," * form, in preparation of a file upload transaction."," * @method _setAttrs"," * @private"," * @static"," * @param {Object} f HTML form object."," * @param {Object} id The Transaction ID."," * @param {Object} uri Qualified path to transaction resource."," */"," _setAttrs: function(f, id, uri) {"," f.setAttribute('action', uri);"," f.setAttribute('method', 'POST');"," f.setAttribute('target', 'io_iframe' + id );"," f.setAttribute(Y.UA.ie && !_std ? 'encoding' : 'enctype', 'multipart/form-data');"," },",""," /**"," * Reset the HTML form attributes to their original values."," * @method _resetAttrs"," * @private"," * @static"," * @param {Object} f HTML form object."," * @param {Object} a Object of original attributes."," */"," _resetAttrs: function(f, a) {"," Y.Object.each(a, function(v, p) {"," if (v) {"," f.setAttribute(p, v);"," }"," else {"," f.removeAttribute(p);"," }"," });"," },",""," /**"," * Starts timeout count if the configuration object"," * has a defined timeout property."," *"," * @method _startUploadTimeout"," * @private"," * @static"," * @param {Object} o Transaction object generated by _create()."," * @param {Object} c Configuration object passed to YUI.io()."," */"," _startUploadTimeout: function(o, c) {"," var io = this;",""," io._timeout[o.id] = w.setTimeout("," function() {"," o.status = 0;"," o.statusText = 'timeout';"," io.complete(o, c);"," io.end(o, c);"," }, c.timeout);"," },",""," /**"," * Clears the timeout interval started by _startUploadTimeout()."," * @method _clearUploadTimeout"," * @private"," * @static"," * @param {Number} id - Transaction ID."," */"," _clearUploadTimeout: function(id) {"," var io = this;",""," w.clearTimeout(io._timeout[id]);"," delete io._timeout[id];"," },",""," /**"," * Bound to the iframe's Load event and processes"," * the response data."," * @method _uploadComplete"," * @private"," * @static"," * @param {Object} o The transaction object"," * @param {Object} c Configuration object for the transaction."," */"," _uploadComplete: function(o, c) {"," var io = this,"," d = Y.one('#io_iframe' + o.id).get('contentWindow.document'),"," b = d.one('body'),"," p;",""," if (c.timeout) {"," io._clearUploadTimeout(o.id);"," }","","\t\ttry {","\t\t\tif (b) {","\t\t\t\t// When a response Content-Type of \"text/plain\" is used, Firefox and Safari","\t\t\t\t// will wrap the response string with <pre></pre>.","\t\t\t\tp = b.one('pre:first-child');","\t\t\t\to.c.responseText = p ? p.get('text') : b.get('text');","\t\t\t}","\t\t\telse {","\t\t\t\to.c.responseXML = d._node;","\t\t\t}","\t\t}","\t\tcatch (e) {","\t\t\to.e = \"upload failure\";","\t\t}",""," io.complete(o, c);"," io.end(o, c);"," // The transaction is complete, so call _dFrame to remove"," // the event listener bound to the iframe transport, and then"," // destroy the iframe."," w.setTimeout( function() { _dFrame(o.id); }, 0);"," },",""," /**"," * Uploads HTML form data, inclusive of files/attachments,"," * using the iframe created in _create to facilitate the transaction."," * @method _upload"," * @private"," * @static"," * @param {Object} o The transaction object"," * @param {Object} uri Qualified path to transaction resource."," * @param {Object} c Configuration object for the transaction."," */"," _upload: function(o, uri, c) {"," var io = this,"," f = (typeof c.form.id === 'string') ? d.getElementById(c.form.id) : c.form.id,"," // Track original HTML form attribute values."," attr = {"," action: f.getAttribute('action'),"," target: f.getAttribute('target')"," },"," fields;",""," // Initialize the HTML form properties in case they are"," // not defined in the HTML form."," io._setAttrs(f, o.id, uri);"," if (c.data) {"," fields = io._addData(f, c.data);"," }",""," // Start polling if a callback is present and the timeout"," // property has been defined."," if (c.timeout) {"," io._startUploadTimeout(o, c);"," }",""," // Start file upload."," f.submit();"," io.start(o, c);"," if (c.data) {"," io._removeData(f, fields);"," }",""," return {"," id: o.id,"," abort: function() {"," o.status = 0;"," o.statusText = 'abort';"," if (Y.one('#io_iframe' + o.id)) {"," _dFrame(o.id);"," io.complete(o, c);"," io.end(o, c, attr);"," }"," else {"," return false;"," }"," },"," isInProgress: function() {"," return Y.one('#io_iframe' + o.id) ? true : false;"," },"," io: io"," };"," },",""," upload: function(o, uri, c) {"," _cFrame(o, c, this);"," return this._upload(o, uri, c);"," },",""," end: function(transaction, config, attr) {"," if (config && config.form && config.form.upload) {"," var io = this;"," // Restore HTML form attributes to their original values."," io._resetAttrs(f, attr);"," }",""," return _end.call(this, transaction, config);"," }","});","","","}, '@VERSION@', {\"requires\": [\"io-base\", \"node-base\"]});","","}());"]};
}
var __cov_qyKMyH$gi2n6_r8dBYGRlg = __coverage__['build/io-upload-iframe/io-upload-iframe.js'];
__cov_qyKMyH$gi2n6_r8dBYGRlg.s['1']++;YUI.add('io-upload-iframe',function(Y,NAME){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['1']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['2']++;var w=Y.config.win,d=Y.config.doc,_std=(__cov_qyKMyH$gi2n6_r8dBYGRlg.b['1'][0]++,d.documentMode)&&(__cov_qyKMyH$gi2n6_r8dBYGRlg.b['1'][1]++,d.documentMode>=8),_d=decodeURIComponent,_end=Y.IO.prototype.end;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['3']++;function _cFrame(o,c,io){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['2']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['4']++;var i=Y.Node.create('<iframe src="#" id="io_iframe'+o.id+'" name="io_iframe'+o.id+'" />');__cov_qyKMyH$gi2n6_r8dBYGRlg.s['5']++;i._node.style.position='absolute';__cov_qyKMyH$gi2n6_r8dBYGRlg.s['6']++;i._node.style.top='-1000px';__cov_qyKMyH$gi2n6_r8dBYGRlg.s['7']++;i._node.style.left='-1000px';__cov_qyKMyH$gi2n6_r8dBYGRlg.s['8']++;Y.one('body').appendChild(i);__cov_qyKMyH$gi2n6_r8dBYGRlg.s['9']++;Y.on('load',function(){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['3']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['10']++;io._uploadComplete(o,c);},'#io_iframe'+o.id);}__cov_qyKMyH$gi2n6_r8dBYGRlg.s['11']++;function _dFrame(id){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['4']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['12']++;Y.Event.purgeElement('#io_iframe'+id,false);__cov_qyKMyH$gi2n6_r8dBYGRlg.s['13']++;Y.one('body').removeChild(Y.one('#io_iframe'+id));}__cov_qyKMyH$gi2n6_r8dBYGRlg.s['14']++;Y.mix(Y.IO.prototype,{_addData:function(f,s){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['5']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['15']++;if(Y.Lang.isObject(s)){__cov_qyKMyH$gi2n6_r8dBYGRlg.b['2'][0]++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['16']++;s=Y.QueryString.stringify(s);}else{__cov_qyKMyH$gi2n6_r8dBYGRlg.b['2'][1]++;}__cov_qyKMyH$gi2n6_r8dBYGRlg.s['17']++;var o=[],m=s.split('='),i,l;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['18']++;for(i=0,l=m.length-1;i<l;i++){__cov_qyKMyH$gi2n6_r8dBYGRlg.s['19']++;o[i]=d.createElement('input');__cov_qyKMyH$gi2n6_r8dBYGRlg.s['20']++;o[i].type='hidden';__cov_qyKMyH$gi2n6_r8dBYGRlg.s['21']++;o[i].name=_d(m[i].substring(m[i].lastIndexOf('&')+1));__cov_qyKMyH$gi2n6_r8dBYGRlg.s['22']++;o[i].value=i+1===l?(__cov_qyKMyH$gi2n6_r8dBYGRlg.b['3'][0]++,_d(m[i+1])):(__cov_qyKMyH$gi2n6_r8dBYGRlg.b['3'][1]++,_d(m[i+1].substring(0,m[i+1].lastIndexOf('&'))));__cov_qyKMyH$gi2n6_r8dBYGRlg.s['23']++;f.appendChild(o[i]);}__cov_qyKMyH$gi2n6_r8dBYGRlg.s['24']++;return o;},_removeData:function(f,o){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['6']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['25']++;var i,l;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['26']++;for(i=0,l=o.length;i<l;i++){__cov_qyKMyH$gi2n6_r8dBYGRlg.s['27']++;f.removeChild(o[i]);}},_setAttrs:function(f,id,uri){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['7']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['28']++;f.setAttribute('action',uri);__cov_qyKMyH$gi2n6_r8dBYGRlg.s['29']++;f.setAttribute('method','POST');__cov_qyKMyH$gi2n6_r8dBYGRlg.s['30']++;f.setAttribute('target','io_iframe'+id);__cov_qyKMyH$gi2n6_r8dBYGRlg.s['31']++;f.setAttribute((__cov_qyKMyH$gi2n6_r8dBYGRlg.b['5'][0]++,Y.UA.ie)&&(__cov_qyKMyH$gi2n6_r8dBYGRlg.b['5'][1]++,!_std)?(__cov_qyKMyH$gi2n6_r8dBYGRlg.b['4'][0]++,'encoding'):(__cov_qyKMyH$gi2n6_r8dBYGRlg.b['4'][1]++,'enctype'),'multipart/form-data');},_resetAttrs:function(f,a){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['8']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['32']++;Y.Object.each(a,function(v,p){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['9']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['33']++;if(v){__cov_qyKMyH$gi2n6_r8dBYGRlg.b['6'][0]++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['34']++;f.setAttribute(p,v);}else{__cov_qyKMyH$gi2n6_r8dBYGRlg.b['6'][1]++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['35']++;f.removeAttribute(p);}});},_startUploadTimeout:function(o,c){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['10']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['36']++;var io=this;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['37']++;io._timeout[o.id]=w.setTimeout(function(){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['11']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['38']++;o.status=0;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['39']++;o.statusText='timeout';__cov_qyKMyH$gi2n6_r8dBYGRlg.s['40']++;io.complete(o,c);__cov_qyKMyH$gi2n6_r8dBYGRlg.s['41']++;io.end(o,c);},c.timeout);},_clearUploadTimeout:function(id){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['12']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['42']++;var io=this;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['43']++;w.clearTimeout(io._timeout[id]);__cov_qyKMyH$gi2n6_r8dBYGRlg.s['44']++;delete io._timeout[id];},_uploadComplete:function(o,c){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['13']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['45']++;var io=this,d=Y.one('#io_iframe'+o.id).get('contentWindow.document'),b=d.one('body'),p;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['46']++;if(c.timeout){__cov_qyKMyH$gi2n6_r8dBYGRlg.b['7'][0]++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['47']++;io._clearUploadTimeout(o.id);}else{__cov_qyKMyH$gi2n6_r8dBYGRlg.b['7'][1]++;}__cov_qyKMyH$gi2n6_r8dBYGRlg.s['48']++;try{__cov_qyKMyH$gi2n6_r8dBYGRlg.s['49']++;if(b){__cov_qyKMyH$gi2n6_r8dBYGRlg.b['8'][0]++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['50']++;p=b.one('pre:first-child');__cov_qyKMyH$gi2n6_r8dBYGRlg.s['51']++;o.c.responseText=p?(__cov_qyKMyH$gi2n6_r8dBYGRlg.b['9'][0]++,p.get('text')):(__cov_qyKMyH$gi2n6_r8dBYGRlg.b['9'][1]++,b.get('text'));}else{__cov_qyKMyH$gi2n6_r8dBYGRlg.b['8'][1]++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['52']++;o.c.responseXML=d._node;}}catch(e){__cov_qyKMyH$gi2n6_r8dBYGRlg.s['53']++;o.e='upload failure';}__cov_qyKMyH$gi2n6_r8dBYGRlg.s['54']++;io.complete(o,c);__cov_qyKMyH$gi2n6_r8dBYGRlg.s['55']++;io.end(o,c);__cov_qyKMyH$gi2n6_r8dBYGRlg.s['56']++;w.setTimeout(function(){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['14']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['57']++;_dFrame(o.id);},0);},_upload:function(o,uri,c){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['15']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['58']++;var io=this,f=typeof c.form.id==='string'?(__cov_qyKMyH$gi2n6_r8dBYGRlg.b['10'][0]++,d.getElementById(c.form.id)):(__cov_qyKMyH$gi2n6_r8dBYGRlg.b['10'][1]++,c.form.id),attr={action:f.getAttribute('action'),target:f.getAttribute('target')},fields;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['59']++;io._setAttrs(f,o.id,uri);__cov_qyKMyH$gi2n6_r8dBYGRlg.s['60']++;if(c.data){__cov_qyKMyH$gi2n6_r8dBYGRlg.b['11'][0]++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['61']++;fields=io._addData(f,c.data);}else{__cov_qyKMyH$gi2n6_r8dBYGRlg.b['11'][1]++;}__cov_qyKMyH$gi2n6_r8dBYGRlg.s['62']++;if(c.timeout){__cov_qyKMyH$gi2n6_r8dBYGRlg.b['12'][0]++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['63']++;io._startUploadTimeout(o,c);}else{__cov_qyKMyH$gi2n6_r8dBYGRlg.b['12'][1]++;}__cov_qyKMyH$gi2n6_r8dBYGRlg.s['64']++;f.submit();__cov_qyKMyH$gi2n6_r8dBYGRlg.s['65']++;io.start(o,c);__cov_qyKMyH$gi2n6_r8dBYGRlg.s['66']++;if(c.data){__cov_qyKMyH$gi2n6_r8dBYGRlg.b['13'][0]++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['67']++;io._removeData(f,fields);}else{__cov_qyKMyH$gi2n6_r8dBYGRlg.b['13'][1]++;}__cov_qyKMyH$gi2n6_r8dBYGRlg.s['68']++;return{id:o.id,abort:function(){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['16']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['69']++;o.status=0;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['70']++;o.statusText='abort';__cov_qyKMyH$gi2n6_r8dBYGRlg.s['71']++;if(Y.one('#io_iframe'+o.id)){__cov_qyKMyH$gi2n6_r8dBYGRlg.b['14'][0]++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['72']++;_dFrame(o.id);__cov_qyKMyH$gi2n6_r8dBYGRlg.s['73']++;io.complete(o,c);__cov_qyKMyH$gi2n6_r8dBYGRlg.s['74']++;io.end(o,c,attr);}else{__cov_qyKMyH$gi2n6_r8dBYGRlg.b['14'][1]++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['75']++;return false;}},isInProgress:function(){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['17']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['76']++;return Y.one('#io_iframe'+o.id)?(__cov_qyKMyH$gi2n6_r8dBYGRlg.b['15'][0]++,true):(__cov_qyKMyH$gi2n6_r8dBYGRlg.b['15'][1]++,false);},io:io};},upload:function(o,uri,c){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['18']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['77']++;_cFrame(o,c,this);__cov_qyKMyH$gi2n6_r8dBYGRlg.s['78']++;return this._upload(o,uri,c);},end:function(transaction,config,attr){__cov_qyKMyH$gi2n6_r8dBYGRlg.f['19']++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['79']++;if((__cov_qyKMyH$gi2n6_r8dBYGRlg.b['17'][0]++,config)&&(__cov_qyKMyH$gi2n6_r8dBYGRlg.b['17'][1]++,config.form)&&(__cov_qyKMyH$gi2n6_r8dBYGRlg.b['17'][2]++,config.form.upload)){__cov_qyKMyH$gi2n6_r8dBYGRlg.b['16'][0]++;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['80']++;var io=this;__cov_qyKMyH$gi2n6_r8dBYGRlg.s['81']++;io._resetAttrs(f,attr);}else{__cov_qyKMyH$gi2n6_r8dBYGRlg.b['16'][1]++;}__cov_qyKMyH$gi2n6_r8dBYGRlg.s['82']++;return _end.call(this,transaction,config);}});},'@VERSION@',{'requires':['io-base','node-base']});
| ljharb/cdnjs | ajax/libs/yui/3.10.3/io-upload-iframe/io-upload-iframe-coverage.js | JavaScript | mit | 29,616 |
(function ( factory ) {
if ( typeof define === 'function' && define.amd )
{
// AMD. Register as an anonymous module.
define( [ 'jquery' ], factory );
}
else if ( typeof exports === 'object' )
{
// Node/CommonJS
factory( require( 'jquery' ) );
}
else
{
// Browser globals
factory( jQuery );
}
}( function ( jQuery ) {
/*
* jQuery mmenu toggles addon
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
* www.frebsite.nl
*/
!function(t){function n(t){return t}function s(t){return t}function e(){g=!0,o=t[r]._c,i=t[r]._d,a=t[r]._e,o.add("toggle"),l=t[r].glbl}var o,i,a,l,r="mmenu",d="toggles",g=!1;t[r].prototype["_addon_"+d]=function(){g||e(),this.opts[d]=n(this.opts[d]),this.conf[d]=s(this.conf[d]);var i=this;this.opts[d],this.conf[d],this.__refactorClass(t("input",this.$menu),this.conf.classNames[d].toggle,"toggle"),t("."+o.toggle,this.$menu).each(function(){var n=t(this),s=n.parent(),e=n.attr("id")||i.__getUniqueId();n.attr("id",e),s.prepend(n),t('<label for="'+e+'" class="'+o.toggle+'"><div></div></label>').insertBefore(s.children().last())})},t[r].addons=t[r].addons||[],t[r].addons.push(d),t[r].defaults[d]={},t[r].configuration.classNames[d]={toggle:"Toggle"}}(jQuery);
})); | rigdern/cdnjs | ajax/libs/jQuery.mmenu/4.3.2/js/umd/addons/jquery.mmenu.toggles.umd.js | JavaScript | mit | 1,283 |
<?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\Tests\Util;
use Symfony\Component\Intl\Util\Version;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class VersionTest extends \PHPUnit_Framework_TestCase
{
public function normalizeProvider()
{
return array(
array(null, '1', '1'),
array(null, '1.2', '1.2'),
array(null, '1.2.3', '1.2.3'),
array(null, '1.2.3.4', '1.2.3.4'),
array(1, '1', '1'),
array(1, '1.2', '1'),
array(1, '1.2.3', '1'),
array(1, '1.2.3.4', '1'),
array(2, '1', '1'),
array(2, '1.2', '1.2'),
array(2, '1.2.3', '1.2'),
array(2, '1.2.3.4', '1.2'),
array(3, '1', '1'),
array(3, '1.2', '1.2'),
array(3, '1.2.3', '1.2.3'),
array(3, '1.2.3.4', '1.2.3'),
array(4, '1', '1'),
array(4, '1.2', '1.2'),
array(4, '1.2.3', '1.2.3'),
array(4, '1.2.3.4', '1.2.3.4'),
);
}
/**
* @dataProvider normalizeProvider
*/
public function testNormalize($precision, $version, $result)
{
$this->assertSame($result, Version::normalize($version, $precision));
}
public function compareProvider()
{
return array(
array(null, '1', '==', '1', true),
array(null, '1.0', '==', '1.1', false),
array(null, '1.0.0', '==', '1.0.1', false),
array(null, '1.0.0.0', '==', '1.0.0.1', false),
array(1, '1', '==', '1', true),
array(1, '1.0', '==', '1.1', true),
array(1, '1.0.0', '==', '1.0.1', true),
array(1, '1.0.0.0', '==', '1.0.0.1', true),
array(2, '1', '==', '1', true),
array(2, '1.0', '==', '1.1', false),
array(2, '1.0.0', '==', '1.0.1', true),
array(2, '1.0.0.0', '==', '1.0.0.1', true),
array(3, '1', '==', '1', true),
array(3, '1.0', '==', '1.1', false),
array(3, '1.0.0', '==', '1.0.1', false),
array(3, '1.0.0.0', '==', '1.0.0.1', true),
);
}
/**
* @dataProvider compareProvider
*/
public function testCompare($precision, $version1, $operator, $version2, $result)
{
$this->assertSame($result, Version::compare($version1, $version2, $operator, $precision));
}
}
| razmo/symfony | src/Symfony/Component/Intl/Tests/Util/VersionTest.php | PHP | mit | 2,647 |
/*
AngularJS v1.2.17
(c) 2010-2014 Google, Inc. http://angularjs.org
License: MIT
*/
(function(u,f,P){'use strict';f.module("ngAnimate",["ng"]).factory("$$animateReflow",["$$rAF","$document",function(f,u){return function(e){return f(function(){e()})}}]).config(["$provide","$animateProvider",function(W,H){function e(f){for(var e=0;e<f.length;e++){var h=f[e];if(h.nodeType==aa)return h}}function C(h){return f.element(e(h))}var n=f.noop,h=f.forEach,Q=H.$$selectors,aa=1,k="$$ngAnimateState",K="ng-animate",g={running:!0};W.decorator("$animate",["$delegate","$injector","$sniffer","$rootElement",
"$$asyncCallback","$rootScope","$document",function(y,u,$,L,F,I,P){function R(a){if(a){var b=[],c={};a=a.substr(1).split(".");($.transitions||$.animations)&&b.push(u.get(Q[""]));for(var d=0;d<a.length;d++){var f=a[d],e=Q[f];e&&!c[f]&&(b.push(u.get(e)),c[f]=!0)}return b}}function M(a,b,c){function d(a,b){var c=a[b],d=a["before"+b.charAt(0).toUpperCase()+b.substr(1)];if(c||d)return"leave"==b&&(d=c,c=null),t.push({event:b,fn:c}),l.push({event:b,fn:d}),!0}function e(b,d,f){var q=[];h(b,function(a){a.fn&&
q.push(a)});var m=0;h(q,function(b,e){var h=function(){a:{if(d){(d[e]||n)();if(++m<q.length)break a;d=null}f()}};switch(b.event){case "setClass":d.push(b.fn(a,p,A,h));break;case "addClass":d.push(b.fn(a,p||c,h));break;case "removeClass":d.push(b.fn(a,A||c,h));break;default:d.push(b.fn(a,h))}});d&&0===d.length&&f()}var w=a[0];if(w){var k="setClass"==b,g=k||"addClass"==b||"removeClass"==b,p,A;f.isArray(c)&&(p=c[0],A=c[1],c=p+" "+A);var B=a.attr("class")+" "+c;if(T(B)){var r=n,v=[],l=[],x=n,m=[],t=[],
B=(" "+B).replace(/\s+/g,".");h(R(B),function(a){!d(a,b)&&k&&(d(a,"addClass"),d(a,"removeClass"))});return{node:w,event:b,className:c,isClassBased:g,isSetClassOperation:k,before:function(a){r=a;e(l,v,function(){r=n;a()})},after:function(a){x=a;e(t,m,function(){x=n;a()})},cancel:function(){v&&(h(v,function(a){(a||n)(!0)}),r(!0));m&&(h(m,function(a){(a||n)(!0)}),x(!0))}}}}}function z(a,b,c,d,e,w,g){function n(d){var e="$animate:"+d;x&&(x[e]&&0<x[e].length)&&F(function(){c.triggerHandler(e,{event:a,
className:b})})}function p(){n("before")}function A(){n("after")}function B(){n("close");g&&F(function(){g()})}function r(){r.hasBeenRun||(r.hasBeenRun=!0,w())}function v(){if(!v.hasBeenRun){v.hasBeenRun=!0;var d=c.data(k);d&&(l&&l.isClassBased?D(c,b):(F(function(){var d=c.data(k)||{};z==d.index&&D(c,b,a)}),c.data(k,d)));B()}}var l=M(c,a,b);if(l){b=l.className;var x=f.element._data(l.node),x=x&&x.events;d||(d=e?e.parent():c.parent());var m=c.data(k)||{};e=m.active||{};var t=m.totalActive||0,u=m.last;
if(l.isClassBased&&(m.disabled||u&&!u.isClassBased)||N(c,d))r(),p(),A(),v();else{d=!1;if(0<t){m=[];if(l.isClassBased)"setClass"==u.event?(m.push(u),D(c,b)):e[b]&&(y=e[b],y.event==a?d=!0:(m.push(y),D(c,b)));else if("leave"==a&&e["ng-leave"])d=!0;else{for(var y in e)m.push(e[y]),D(c,y);e={};t=0}0<m.length&&h(m,function(a){a.cancel()})}!l.isClassBased||(l.isSetClassOperation||d)||(d="addClass"==a==c.hasClass(b));if(d)r(),p(),A(),B();else{if("leave"==a)c.one("$destroy",function(a){a=f.element(this);var b=
a.data(k);b&&(b=b.active["ng-leave"])&&(b.cancel(),D(a,"ng-leave"))});c.addClass(K);var z=O++;t++;e[b]=l;c.data(k,{last:l,active:e,index:z,totalActive:t});p();l.before(function(d){var e=c.data(k);d=d||!e||!e.active[b]||l.isClassBased&&e.active[b].event!=a;r();!0===d?v():(A(),l.after(v))})}}}else r(),p(),A(),v()}function U(a){if(a=e(a))a=f.isFunction(a.getElementsByClassName)?a.getElementsByClassName(K):a.querySelectorAll("."+K),h(a,function(a){a=f.element(a);(a=a.data(k))&&a.active&&h(a.active,function(a){a.cancel()})})}
function D(a,b){if(e(a)==e(L))g.disabled||(g.running=!1,g.structural=!1);else if(b){var c=a.data(k)||{},d=!0===b;!d&&(c.active&&c.active[b])&&(c.totalActive--,delete c.active[b]);if(d||!c.totalActive)a.removeClass(K),a.removeData(k)}}function N(a,b){if(g.disabled)return!0;if(e(a)==e(L))return g.disabled||g.running;do{if(0===b.length)break;var c=e(b)==e(L),d=c?g:b.data(k),d=d&&(!!d.disabled||d.running||0<d.totalActive);if(c||d)return d;if(c)break}while(b=b.parent());return!0}var O=0;L.data(k,g);I.$$postDigest(function(){I.$$postDigest(function(){g.running=
!1})});var V=H.classNameFilter(),T=V?function(a){return V.test(a)}:function(){return!0};return{enter:function(a,b,c,d){a=f.element(a);b=b&&f.element(b);c=c&&f.element(c);this.enabled(!1,a);y.enter(a,b,c);I.$$postDigest(function(){a=C(a);z("enter","ng-enter",a,b,c,n,d)})},leave:function(a,b){a=f.element(a);U(a);this.enabled(!1,a);I.$$postDigest(function(){z("leave","ng-leave",C(a),null,null,function(){y.leave(a)},b)})},move:function(a,b,c,d){a=f.element(a);b=b&&f.element(b);c=c&&f.element(c);U(a);
this.enabled(!1,a);y.move(a,b,c);I.$$postDigest(function(){a=C(a);z("move","ng-move",a,b,c,n,d)})},addClass:function(a,b,c){a=f.element(a);a=C(a);z("addClass",b,a,null,null,function(){y.addClass(a,b)},c)},removeClass:function(a,b,c){a=f.element(a);a=C(a);z("removeClass",b,a,null,null,function(){y.removeClass(a,b)},c)},setClass:function(a,b,c,d){a=f.element(a);a=C(a);z("setClass",[b,c],a,null,null,function(){y.setClass(a,b,c)},d)},enabled:function(a,b){switch(arguments.length){case 2:if(a)D(b);else{var c=
b.data(k)||{};c.disabled=!0;b.data(k,c)}break;case 1:g.disabled=!a;break;default:a=!g.disabled}return!!a}}}]);H.register("",["$window","$sniffer","$timeout","$$animateReflow",function(k,g,C,L){function F(a,E){S&&S();X.push(E);S=L(function(){h(X,function(a){a()});X=[];S=null;q={}})}function I(a,E){var b=e(a);a=f.element(b);Y.push(a);b=Date.now()+E;b<=ea||(C.cancel(da),ea=b,da=C(function(){K(Y);Y=[]},E,!1))}function K(a){h(a,function(a){(a=a.data(m))&&(a.closeAnimationFn||n)()})}function R(a,E){var b=
E?q[E]:null;if(!b){var c=0,d=0,e=0,f=0,m,Z,s,g;h(a,function(a){if(a.nodeType==aa){a=k.getComputedStyle(a)||{};s=a[J+B];c=Math.max(M(s),c);g=a[J+r];m=a[J+v];d=Math.max(M(m),d);Z=a[p+v];f=Math.max(M(Z),f);var b=M(a[p+B]);0<b&&(b*=parseInt(a[p+l],10)||1);e=Math.max(b,e)}});b={total:0,transitionPropertyStyle:g,transitionDurationStyle:s,transitionDelayStyle:m,transitionDelay:d,transitionDuration:c,animationDelayStyle:Z,animationDelay:f,animationDuration:e};E&&(q[E]=b)}return b}function M(a){var b=0;a=
f.isString(a)?a.split(/\s*,\s*/):[];h(a,function(a){b=Math.max(parseFloat(a)||0,b)});return b}function z(a){var b=a.parent(),c=b.data(x);c||(b.data(x,++ca),c=ca);return c+"-"+e(a).getAttribute("class")}function U(a,b,c,d){var f=z(b),h=f+" "+c,k=q[h]?++q[h].total:0,g={};if(0<k){var l=c+"-stagger",g=f+" "+l;(f=!q[g])&&b.addClass(l);g=R(b,g);f&&b.removeClass(l)}d=d||function(a){return a()};b.addClass(c);var l=b.data(m)||{},s=d(function(){return R(b,h)});d=s.transitionDuration;f=s.animationDuration;if(0===
d&&0===f)return b.removeClass(c),!1;b.data(m,{running:l.running||0,itemIndex:k,stagger:g,timings:s,closeAnimationFn:n});a=0<l.running||"setClass"==a;0<d&&D(b,c,a);0<f&&(0<g.animationDelay&&0===g.animationDuration)&&(e(b).style[p]="none 0s");return!0}function D(a,b,c){"ng-enter"!=b&&("ng-move"!=b&&"ng-leave"!=b)&&c?a.addClass(t):e(a).style[J+r]="none"}function N(a,b){var c=J+r,d=e(a);d.style[c]&&0<d.style[c].length&&(d.style[c]="");a.removeClass(t)}function O(a){var b=p;a=e(a);a.style[b]&&0<a.style[b].length&&
(a.style[b]="")}function V(a,b,c,f){function g(a){b.off(z,l);b.removeClass(p);d(b,c);a=e(b);for(var fa in t)a.style.removeProperty(t[fa])}function l(a){a.stopPropagation();var b=a.originalEvent||a;a=b.$manualTimeStamp||b.timeStamp||Date.now();b=parseFloat(b.elapsedTime.toFixed(Q));Math.max(a-y,0)>=x&&b>=u&&f()}var k=e(b);a=b.data(m);if(-1!=k.getAttribute("class").indexOf(c)&&a){var p="";h(c.split(" "),function(a,b){p+=(0<b?" ":"")+a+"-active"});var n=a.stagger,s=a.timings,r=a.itemIndex,u=Math.max(s.transitionDuration,
s.animationDuration),v=Math.max(s.transitionDelay,s.animationDelay),x=v*ba,y=Date.now(),z=A+" "+H,q="",t=[];if(0<s.transitionDuration){var B=s.transitionPropertyStyle;-1==B.indexOf("all")&&(q+=w+"transition-property: "+B+";",q+=w+"transition-duration: "+s.transitionDurationStyle+";",t.push(w+"transition-property"),t.push(w+"transition-duration"))}0<r&&(0<n.transitionDelay&&0===n.transitionDuration&&(q+=w+"transition-delay: "+T(s.transitionDelayStyle,n.transitionDelay,r)+"; ",t.push(w+"transition-delay")),
0<n.animationDelay&&0===n.animationDuration&&(q+=w+"animation-delay: "+T(s.animationDelayStyle,n.animationDelay,r)+"; ",t.push(w+"animation-delay")));0<t.length&&(s=k.getAttribute("style")||"",k.setAttribute("style",s+"; "+q));b.on(z,l);b.addClass(p);a.closeAnimationFn=function(){g();f()};k=(r*(Math.max(n.animationDelay,n.transitionDelay)||0)+(v+u)*W)*ba;a.running++;I(b,k);return g}f()}function T(a,b,c){var d="";h(a.split(","),function(a,e){d+=(0<e?",":"")+(c*b+parseInt(a,10))+"s"});return d}function a(a,
b,c,e){if(U(a,b,c,e))return function(a){a&&d(b,c)}}function b(a,b,c,e){if(b.data(m))return V(a,b,c,e);d(b,c);e()}function c(c,d,e,f){var g=a(c,d,e);if(g){var h=g;F(d,function(){N(d,e);O(d);h=b(c,d,e,f)});return function(a){(h||n)(a)}}f()}function d(a,b){a.removeClass(b);var c=a.data(m);c&&(c.running&&c.running--,c.running&&0!==c.running||a.removeData(m))}function G(a,b){var c="";a=f.isArray(a)?a:a.split(/\s+/);h(a,function(a,d){a&&0<a.length&&(c+=(0<d?" ":"")+a+b)});return c}var w="",J,H,p,A;u.ontransitionend===
P&&u.onwebkittransitionend!==P?(w="-webkit-",J="WebkitTransition",H="webkitTransitionEnd transitionend"):(J="transition",H="transitionend");u.onanimationend===P&&u.onwebkitanimationend!==P?(w="-webkit-",p="WebkitAnimation",A="webkitAnimationEnd animationend"):(p="animation",A="animationend");var B="Duration",r="Property",v="Delay",l="IterationCount",x="$$ngAnimateKey",m="$$ngAnimateCSS3Data",t="ng-animate-block-transitions",Q=3,W=1.5,ba=1E3,q={},ca=0,X=[],S,da=null,ea=0,Y=[];return{enter:function(a,
b){return c("enter",a,"ng-enter",b)},leave:function(a,b){return c("leave",a,"ng-leave",b)},move:function(a,b){return c("move",a,"ng-move",b)},beforeSetClass:function(b,c,d,e){var f=G(d,"-remove")+" "+G(c,"-add"),g=a("setClass",b,f,function(a){var e=b.attr("class");b.removeClass(d);b.addClass(c);a=a();b.attr("class",e);return a});if(g)return F(b,function(){N(b,f);O(b);e()}),g;e()},beforeAddClass:function(b,c,d){var e=a("addClass",b,G(c,"-add"),function(a){b.addClass(c);a=a();b.removeClass(c);return a});
if(e)return F(b,function(){N(b,c);O(b);d()}),e;d()},setClass:function(a,c,d,e){d=G(d,"-remove");c=G(c,"-add");return b("setClass",a,d+" "+c,e)},addClass:function(a,c,d){return b("addClass",a,G(c,"-add"),d)},beforeRemoveClass:function(b,c,d){var e=a("removeClass",b,G(c,"-remove"),function(a){var d=b.attr("class");b.removeClass(c);a=a();b.attr("class",d);return a});if(e)return F(b,function(){N(b,c);O(b);d()}),e;d()},removeClass:function(a,c,d){return b("removeClass",a,G(c,"-remove"),d)}}}])}])})(window,
window.angular);
//# sourceMappingURL=angular-animate.min.js.map
| danut007ro/cdnjs | ajax/libs/ionic/1.0.0-beta.10-nightly-16570/js/angular/angular-animate.min.js | JavaScript | mit | 10,904 |
//! moment.js
//! version : 2.17.0
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.moment = factory()
}(this, (function () { 'use strict';
var hookCallback;
function hooks () {
return hookCallback.apply(null, arguments);
}
// This is done to register the method called with moment()
// without creating circular dependencies.
function setHookCallback (callback) {
hookCallback = callback;
}
function isArray(input) {
return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
}
function isObject(input) {
// IE8 will treat undefined and null as object if it wasn't for
// input != null
return input != null && Object.prototype.toString.call(input) === '[object Object]';
}
function isObjectEmpty(obj) {
var k;
for (k in obj) {
// even if its not own property I'd still call it non-empty
return false;
}
return true;
}
function isNumber(input) {
return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';
}
function isDate(input) {
return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
}
function map(arr, fn) {
var res = [], i;
for (i = 0; i < arr.length; ++i) {
res.push(fn(arr[i], i));
}
return res;
}
function hasOwnProp(a, b) {
return Object.prototype.hasOwnProperty.call(a, b);
}
function extend(a, b) {
for (var i in b) {
if (hasOwnProp(b, i)) {
a[i] = b[i];
}
}
if (hasOwnProp(b, 'toString')) {
a.toString = b.toString;
}
if (hasOwnProp(b, 'valueOf')) {
a.valueOf = b.valueOf;
}
return a;
}
function createUTC (input, format, locale, strict) {
return createLocalOrUTC(input, format, locale, strict, true).utc();
}
function defaultParsingFlags() {
// We need to deep clone this object.
return {
empty : false,
unusedTokens : [],
unusedInput : [],
overflow : -2,
charsLeftOver : 0,
nullInput : false,
invalidMonth : null,
invalidFormat : false,
userInvalidated : false,
iso : false,
parsedDateParts : [],
meridiem : null
};
}
function getParsingFlags(m) {
if (m._pf == null) {
m._pf = defaultParsingFlags();
}
return m._pf;
}
var some;
if (Array.prototype.some) {
some = Array.prototype.some;
} else {
some = function (fun) {
var t = Object(this);
var len = t.length >>> 0;
for (var i = 0; i < len; i++) {
if (i in t && fun.call(this, t[i], i, t)) {
return true;
}
}
return false;
};
}
var some$1 = some;
function isValid(m) {
if (m._isValid == null) {
var flags = getParsingFlags(m);
var parsedParts = some$1.call(flags.parsedDateParts, function (i) {
return i != null;
});
var isNowValid = !isNaN(m._d.getTime()) &&
flags.overflow < 0 &&
!flags.empty &&
!flags.invalidMonth &&
!flags.invalidWeekday &&
!flags.nullInput &&
!flags.invalidFormat &&
!flags.userInvalidated &&
(!flags.meridiem || (flags.meridiem && parsedParts));
if (m._strict) {
isNowValid = isNowValid &&
flags.charsLeftOver === 0 &&
flags.unusedTokens.length === 0 &&
flags.bigHour === undefined;
}
if (Object.isFrozen == null || !Object.isFrozen(m)) {
m._isValid = isNowValid;
}
else {
return isNowValid;
}
}
return m._isValid;
}
function createInvalid (flags) {
var m = createUTC(NaN);
if (flags != null) {
extend(getParsingFlags(m), flags);
}
else {
getParsingFlags(m).userInvalidated = true;
}
return m;
}
function isUndefined(input) {
return input === void 0;
}
// Plugins that add properties should also add the key here (null value),
// so we can properly clone ourselves.
var momentProperties = hooks.momentProperties = [];
function copyConfig(to, from) {
var i, prop, val;
if (!isUndefined(from._isAMomentObject)) {
to._isAMomentObject = from._isAMomentObject;
}
if (!isUndefined(from._i)) {
to._i = from._i;
}
if (!isUndefined(from._f)) {
to._f = from._f;
}
if (!isUndefined(from._l)) {
to._l = from._l;
}
if (!isUndefined(from._strict)) {
to._strict = from._strict;
}
if (!isUndefined(from._tzm)) {
to._tzm = from._tzm;
}
if (!isUndefined(from._isUTC)) {
to._isUTC = from._isUTC;
}
if (!isUndefined(from._offset)) {
to._offset = from._offset;
}
if (!isUndefined(from._pf)) {
to._pf = getParsingFlags(from);
}
if (!isUndefined(from._locale)) {
to._locale = from._locale;
}
if (momentProperties.length > 0) {
for (i in momentProperties) {
prop = momentProperties[i];
val = from[prop];
if (!isUndefined(val)) {
to[prop] = val;
}
}
}
return to;
}
var updateInProgress = false;
// Moment prototype object
function Moment(config) {
copyConfig(this, config);
this._d = new Date(config._d != null ? config._d.getTime() : NaN);
if (!this.isValid()) {
this._d = new Date(NaN);
}
// Prevent infinite loop in case updateOffset creates new moment
// objects.
if (updateInProgress === false) {
updateInProgress = true;
hooks.updateOffset(this);
updateInProgress = false;
}
}
function isMoment (obj) {
return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
}
function absFloor (number) {
if (number < 0) {
// -0 -> 0
return Math.ceil(number) || 0;
} else {
return Math.floor(number);
}
}
function toInt(argumentForCoercion) {
var coercedNumber = +argumentForCoercion,
value = 0;
if (coercedNumber !== 0 && isFinite(coercedNumber)) {
value = absFloor(coercedNumber);
}
return value;
}
// compare two arrays, return the number of differences
function compareArrays(array1, array2, dontConvert) {
var len = Math.min(array1.length, array2.length),
lengthDiff = Math.abs(array1.length - array2.length),
diffs = 0,
i;
for (i = 0; i < len; i++) {
if ((dontConvert && array1[i] !== array2[i]) ||
(!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
diffs++;
}
}
return diffs + lengthDiff;
}
function warn(msg) {
if (hooks.suppressDeprecationWarnings === false &&
(typeof console !== 'undefined') && console.warn) {
console.warn('Deprecation warning: ' + msg);
}
}
function deprecate(msg, fn) {
var firstTime = true;
return extend(function () {
if (hooks.deprecationHandler != null) {
hooks.deprecationHandler(null, msg);
}
if (firstTime) {
var args = [];
var arg;
for (var i = 0; i < arguments.length; i++) {
arg = '';
if (typeof arguments[i] === 'object') {
arg += '\n[' + i + '] ';
for (var key in arguments[0]) {
arg += key + ': ' + arguments[0][key] + ', ';
}
arg = arg.slice(0, -2); // Remove trailing comma and space
} else {
arg = arguments[i];
}
args.push(arg);
}
warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack);
firstTime = false;
}
return fn.apply(this, arguments);
}, fn);
}
var deprecations = {};
function deprecateSimple(name, msg) {
if (hooks.deprecationHandler != null) {
hooks.deprecationHandler(name, msg);
}
if (!deprecations[name]) {
warn(msg);
deprecations[name] = true;
}
}
hooks.suppressDeprecationWarnings = false;
hooks.deprecationHandler = null;
function isFunction(input) {
return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
}
function set (config) {
var prop, i;
for (i in config) {
prop = config[i];
if (isFunction(prop)) {
this[i] = prop;
} else {
this['_' + i] = prop;
}
}
this._config = config;
// Lenient ordinal parsing accepts just a number in addition to
// number + (possibly) stuff coming from _ordinalParseLenient.
this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source);
}
function mergeConfigs(parentConfig, childConfig) {
var res = extend({}, parentConfig), prop;
for (prop in childConfig) {
if (hasOwnProp(childConfig, prop)) {
if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
res[prop] = {};
extend(res[prop], parentConfig[prop]);
extend(res[prop], childConfig[prop]);
} else if (childConfig[prop] != null) {
res[prop] = childConfig[prop];
} else {
delete res[prop];
}
}
}
for (prop in parentConfig) {
if (hasOwnProp(parentConfig, prop) &&
!hasOwnProp(childConfig, prop) &&
isObject(parentConfig[prop])) {
// make sure changes to properties don't modify parent config
res[prop] = extend({}, res[prop]);
}
}
return res;
}
function Locale(config) {
if (config != null) {
this.set(config);
}
}
var keys;
if (Object.keys) {
keys = Object.keys;
} else {
keys = function (obj) {
var i, res = [];
for (i in obj) {
if (hasOwnProp(obj, i)) {
res.push(i);
}
}
return res;
};
}
var keys$1 = keys;
var defaultCalendar = {
sameDay : '[Today at] LT',
nextDay : '[Tomorrow at] LT',
nextWeek : 'dddd [at] LT',
lastDay : '[Yesterday at] LT',
lastWeek : '[Last] dddd [at] LT',
sameElse : 'L'
};
function calendar (key, mom, now) {
var output = this._calendar[key] || this._calendar['sameElse'];
return isFunction(output) ? output.call(mom, now) : output;
}
var defaultLongDateFormat = {
LTS : 'h:mm:ss A',
LT : 'h:mm A',
L : 'MM/DD/YYYY',
LL : 'MMMM D, YYYY',
LLL : 'MMMM D, YYYY h:mm A',
LLLL : 'dddd, MMMM D, YYYY h:mm A'
};
function longDateFormat (key) {
var format = this._longDateFormat[key],
formatUpper = this._longDateFormat[key.toUpperCase()];
if (format || !formatUpper) {
return format;
}
this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
return val.slice(1);
});
return this._longDateFormat[key];
}
var defaultInvalidDate = 'Invalid date';
function invalidDate () {
return this._invalidDate;
}
var defaultOrdinal = '%d';
var defaultOrdinalParse = /\d{1,2}/;
function ordinal (number) {
return this._ordinal.replace('%d', number);
}
var defaultRelativeTime = {
future : 'in %s',
past : '%s ago',
s : 'a few seconds',
m : 'a minute',
mm : '%d minutes',
h : 'an hour',
hh : '%d hours',
d : 'a day',
dd : '%d days',
M : 'a month',
MM : '%d months',
y : 'a year',
yy : '%d years'
};
function relativeTime (number, withoutSuffix, string, isFuture) {
var output = this._relativeTime[string];
return (isFunction(output)) ?
output(number, withoutSuffix, string, isFuture) :
output.replace(/%d/i, number);
}
function pastFuture (diff, output) {
var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
return isFunction(format) ? format(output) : format.replace(/%s/i, output);
}
var aliases = {};
function addUnitAlias (unit, shorthand) {
var lowerCase = unit.toLowerCase();
aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
}
function normalizeUnits(units) {
return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
}
function normalizeObjectUnits(inputObject) {
var normalizedInput = {},
normalizedProp,
prop;
for (prop in inputObject) {
if (hasOwnProp(inputObject, prop)) {
normalizedProp = normalizeUnits(prop);
if (normalizedProp) {
normalizedInput[normalizedProp] = inputObject[prop];
}
}
}
return normalizedInput;
}
var priorities = {};
function addUnitPriority(unit, priority) {
priorities[unit] = priority;
}
function getPrioritizedUnits(unitsObj) {
var units = [];
for (var u in unitsObj) {
units.push({unit: u, priority: priorities[u]});
}
units.sort(function (a, b) {
return a.priority - b.priority;
});
return units;
}
function makeGetSet (unit, keepTime) {
return function (value) {
if (value != null) {
set$1(this, unit, value);
hooks.updateOffset(this, keepTime);
return this;
} else {
return get(this, unit);
}
};
}
function get (mom, unit) {
return mom.isValid() ?
mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
}
function set$1 (mom, unit, value) {
if (mom.isValid()) {
mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
}
}
// MOMENTS
function stringGet (units) {
units = normalizeUnits(units);
if (isFunction(this[units])) {
return this[units]();
}
return this;
}
function stringSet (units, value) {
if (typeof units === 'object') {
units = normalizeObjectUnits(units);
var prioritized = getPrioritizedUnits(units);
for (var i = 0; i < prioritized.length; i++) {
this[prioritized[i].unit](units[prioritized[i].unit]);
}
} else {
units = normalizeUnits(units);
if (isFunction(this[units])) {
return this[units](value);
}
}
return this;
}
function zeroFill(number, targetLength, forceSign) {
var absNumber = '' + Math.abs(number),
zerosToFill = targetLength - absNumber.length,
sign = number >= 0;
return (sign ? (forceSign ? '+' : '') : '-') +
Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
}
var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
var formatFunctions = {};
var formatTokenFunctions = {};
// token: 'M'
// padded: ['MM', 2]
// ordinal: 'Mo'
// callback: function () { this.month() + 1 }
function addFormatToken (token, padded, ordinal, callback) {
var func = callback;
if (typeof callback === 'string') {
func = function () {
return this[callback]();
};
}
if (token) {
formatTokenFunctions[token] = func;
}
if (padded) {
formatTokenFunctions[padded[0]] = function () {
return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
};
}
if (ordinal) {
formatTokenFunctions[ordinal] = function () {
return this.localeData().ordinal(func.apply(this, arguments), token);
};
}
}
function removeFormattingTokens(input) {
if (input.match(/\[[\s\S]/)) {
return input.replace(/^\[|\]$/g, '');
}
return input.replace(/\\/g, '');
}
function makeFormatFunction(format) {
var array = format.match(formattingTokens), i, length;
for (i = 0, length = array.length; i < length; i++) {
if (formatTokenFunctions[array[i]]) {
array[i] = formatTokenFunctions[array[i]];
} else {
array[i] = removeFormattingTokens(array[i]);
}
}
return function (mom) {
var output = '', i;
for (i = 0; i < length; i++) {
output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
}
return output;
};
}
// format date using native date object
function formatMoment(m, format) {
if (!m.isValid()) {
return m.localeData().invalidDate();
}
format = expandFormat(format, m.localeData());
formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
return formatFunctions[format](m);
}
function expandFormat(format, locale) {
var i = 5;
function replaceLongDateFormatTokens(input) {
return locale.longDateFormat(input) || input;
}
localFormattingTokens.lastIndex = 0;
while (i >= 0 && localFormattingTokens.test(format)) {
format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
localFormattingTokens.lastIndex = 0;
i -= 1;
}
return format;
}
var match1 = /\d/; // 0 - 9
var match2 = /\d\d/; // 00 - 99
var match3 = /\d{3}/; // 000 - 999
var match4 = /\d{4}/; // 0000 - 9999
var match6 = /[+-]?\d{6}/; // -999999 - 999999
var match1to2 = /\d\d?/; // 0 - 99
var match3to4 = /\d\d\d\d?/; // 999 - 9999
var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
var match1to3 = /\d{1,3}/; // 0 - 999
var match1to4 = /\d{1,4}/; // 0 - 9999
var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
var matchUnsigned = /\d+/; // 0 - inf
var matchSigned = /[+-]?\d+/; // -inf - inf
var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
// any word (or two) characters or numbers including two/three word month in arabic.
// includes scottish gaelic two word and hyphenated months
var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
var regexes = {};
function addRegexToken (token, regex, strictRegex) {
regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
return (isStrict && strictRegex) ? strictRegex : regex;
};
}
function getParseRegexForToken (token, config) {
if (!hasOwnProp(regexes, token)) {
return new RegExp(unescapeFormat(token));
}
return regexes[token](config._strict, config._locale);
}
// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
function unescapeFormat(s) {
return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
return p1 || p2 || p3 || p4;
}));
}
function regexEscape(s) {
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
}
var tokens = {};
function addParseToken (token, callback) {
var i, func = callback;
if (typeof token === 'string') {
token = [token];
}
if (isNumber(callback)) {
func = function (input, array) {
array[callback] = toInt(input);
};
}
for (i = 0; i < token.length; i++) {
tokens[token[i]] = func;
}
}
function addWeekParseToken (token, callback) {
addParseToken(token, function (input, array, config, token) {
config._w = config._w || {};
callback(input, config._w, config, token);
});
}
function addTimeToArrayFromToken(token, input, config) {
if (input != null && hasOwnProp(tokens, token)) {
tokens[token](input, config._a, config, token);
}
}
var YEAR = 0;
var MONTH = 1;
var DATE = 2;
var HOUR = 3;
var MINUTE = 4;
var SECOND = 5;
var MILLISECOND = 6;
var WEEK = 7;
var WEEKDAY = 8;
var indexOf;
if (Array.prototype.indexOf) {
indexOf = Array.prototype.indexOf;
} else {
indexOf = function (o) {
// I know
var i;
for (i = 0; i < this.length; ++i) {
if (this[i] === o) {
return i;
}
}
return -1;
};
}
var indexOf$1 = indexOf;
function daysInMonth(year, month) {
return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
}
// FORMATTING
addFormatToken('M', ['MM', 2], 'Mo', function () {
return this.month() + 1;
});
addFormatToken('MMM', 0, 0, function (format) {
return this.localeData().monthsShort(this, format);
});
addFormatToken('MMMM', 0, 0, function (format) {
return this.localeData().months(this, format);
});
// ALIASES
addUnitAlias('month', 'M');
// PRIORITY
addUnitPriority('month', 8);
// PARSING
addRegexToken('M', match1to2);
addRegexToken('MM', match1to2, match2);
addRegexToken('MMM', function (isStrict, locale) {
return locale.monthsShortRegex(isStrict);
});
addRegexToken('MMMM', function (isStrict, locale) {
return locale.monthsRegex(isStrict);
});
addParseToken(['M', 'MM'], function (input, array) {
array[MONTH] = toInt(input) - 1;
});
addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
var month = config._locale.monthsParse(input, token, config._strict);
// if we didn't find a month name, mark the date as invalid.
if (month != null) {
array[MONTH] = month;
} else {
getParsingFlags(config).invalidMonth = input;
}
});
// LOCALES
var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
function localeMonths (m, format) {
if (!m) {
return this._months;
}
return isArray(this._months) ? this._months[m.month()] :
this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
}
var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
function localeMonthsShort (m, format) {
if (!m) {
return this._monthsShort;
}
return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
}
function handleStrictParse(monthName, format, strict) {
var i, ii, mom, llc = monthName.toLocaleLowerCase();
if (!this._monthsParse) {
// this is not used
this._monthsParse = [];
this._longMonthsParse = [];
this._shortMonthsParse = [];
for (i = 0; i < 12; ++i) {
mom = createUTC([2000, i]);
this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
}
}
if (strict) {
if (format === 'MMM') {
ii = indexOf$1.call(this._shortMonthsParse, llc);
return ii !== -1 ? ii : null;
} else {
ii = indexOf$1.call(this._longMonthsParse, llc);
return ii !== -1 ? ii : null;
}
} else {
if (format === 'MMM') {
ii = indexOf$1.call(this._shortMonthsParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf$1.call(this._longMonthsParse, llc);
return ii !== -1 ? ii : null;
} else {
ii = indexOf$1.call(this._longMonthsParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf$1.call(this._shortMonthsParse, llc);
return ii !== -1 ? ii : null;
}
}
}
function localeMonthsParse (monthName, format, strict) {
var i, mom, regex;
if (this._monthsParseExact) {
return handleStrictParse.call(this, monthName, format, strict);
}
if (!this._monthsParse) {
this._monthsParse = [];
this._longMonthsParse = [];
this._shortMonthsParse = [];
}
// TODO: add sorting
// Sorting makes sure if one month (or abbr) is a prefix of another
// see sorting in computeMonthsParse
for (i = 0; i < 12; i++) {
// make the regex if we don't have it already
mom = createUTC([2000, i]);
if (strict && !this._longMonthsParse[i]) {
this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
}
if (!strict && !this._monthsParse[i]) {
regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
}
// test the regex
if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
return i;
} else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
return i;
} else if (!strict && this._monthsParse[i].test(monthName)) {
return i;
}
}
}
// MOMENTS
function setMonth (mom, value) {
var dayOfMonth;
if (!mom.isValid()) {
// No op
return mom;
}
if (typeof value === 'string') {
if (/^\d+$/.test(value)) {
value = toInt(value);
} else {
value = mom.localeData().monthsParse(value);
// TODO: Another silent failure?
if (!isNumber(value)) {
return mom;
}
}
}
dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
return mom;
}
function getSetMonth (value) {
if (value != null) {
setMonth(this, value);
hooks.updateOffset(this, true);
return this;
} else {
return get(this, 'Month');
}
}
function getDaysInMonth () {
return daysInMonth(this.year(), this.month());
}
var defaultMonthsShortRegex = matchWord;
function monthsShortRegex (isStrict) {
if (this._monthsParseExact) {
if (!hasOwnProp(this, '_monthsRegex')) {
computeMonthsParse.call(this);
}
if (isStrict) {
return this._monthsShortStrictRegex;
} else {
return this._monthsShortRegex;
}
} else {
if (!hasOwnProp(this, '_monthsShortRegex')) {
this._monthsShortRegex = defaultMonthsShortRegex;
}
return this._monthsShortStrictRegex && isStrict ?
this._monthsShortStrictRegex : this._monthsShortRegex;
}
}
var defaultMonthsRegex = matchWord;
function monthsRegex (isStrict) {
if (this._monthsParseExact) {
if (!hasOwnProp(this, '_monthsRegex')) {
computeMonthsParse.call(this);
}
if (isStrict) {
return this._monthsStrictRegex;
} else {
return this._monthsRegex;
}
} else {
if (!hasOwnProp(this, '_monthsRegex')) {
this._monthsRegex = defaultMonthsRegex;
}
return this._monthsStrictRegex && isStrict ?
this._monthsStrictRegex : this._monthsRegex;
}
}
function computeMonthsParse () {
function cmpLenRev(a, b) {
return b.length - a.length;
}
var shortPieces = [], longPieces = [], mixedPieces = [],
i, mom;
for (i = 0; i < 12; i++) {
// make the regex if we don't have it already
mom = createUTC([2000, i]);
shortPieces.push(this.monthsShort(mom, ''));
longPieces.push(this.months(mom, ''));
mixedPieces.push(this.months(mom, ''));
mixedPieces.push(this.monthsShort(mom, ''));
}
// Sorting makes sure if one month (or abbr) is a prefix of another it
// will match the longer piece.
shortPieces.sort(cmpLenRev);
longPieces.sort(cmpLenRev);
mixedPieces.sort(cmpLenRev);
for (i = 0; i < 12; i++) {
shortPieces[i] = regexEscape(shortPieces[i]);
longPieces[i] = regexEscape(longPieces[i]);
}
for (i = 0; i < 24; i++) {
mixedPieces[i] = regexEscape(mixedPieces[i]);
}
this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
this._monthsShortRegex = this._monthsRegex;
this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
}
// FORMATTING
addFormatToken('Y', 0, 0, function () {
var y = this.year();
return y <= 9999 ? '' + y : '+' + y;
});
addFormatToken(0, ['YY', 2], 0, function () {
return this.year() % 100;
});
addFormatToken(0, ['YYYY', 4], 0, 'year');
addFormatToken(0, ['YYYYY', 5], 0, 'year');
addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
// ALIASES
addUnitAlias('year', 'y');
// PRIORITIES
addUnitPriority('year', 1);
// PARSING
addRegexToken('Y', matchSigned);
addRegexToken('YY', match1to2, match2);
addRegexToken('YYYY', match1to4, match4);
addRegexToken('YYYYY', match1to6, match6);
addRegexToken('YYYYYY', match1to6, match6);
addParseToken(['YYYYY', 'YYYYYY'], YEAR);
addParseToken('YYYY', function (input, array) {
array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
});
addParseToken('YY', function (input, array) {
array[YEAR] = hooks.parseTwoDigitYear(input);
});
addParseToken('Y', function (input, array) {
array[YEAR] = parseInt(input, 10);
});
// HELPERS
function daysInYear(year) {
return isLeapYear(year) ? 366 : 365;
}
function isLeapYear(year) {
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
}
// HOOKS
hooks.parseTwoDigitYear = function (input) {
return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
};
// MOMENTS
var getSetYear = makeGetSet('FullYear', true);
function getIsLeapYear () {
return isLeapYear(this.year());
}
function createDate (y, m, d, h, M, s, ms) {
//can't just apply() to create a date:
//http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply
var date = new Date(y, m, d, h, M, s, ms);
//the date constructor remaps years 0-99 to 1900-1999
if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {
date.setFullYear(y);
}
return date;
}
function createUTCDate (y) {
var date = new Date(Date.UTC.apply(null, arguments));
//the Date.UTC function remaps years 0-99 to 1900-1999
if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {
date.setUTCFullYear(y);
}
return date;
}
// start-of-first-week - start-of-year
function firstWeekOffset(year, dow, doy) {
var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
fwd = 7 + dow - doy,
// first-week day local weekday -- which local weekday is fwd
fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
return -fwdlw + fwd - 1;
}
//http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
var localWeekday = (7 + weekday - dow) % 7,
weekOffset = firstWeekOffset(year, dow, doy),
dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
resYear, resDayOfYear;
if (dayOfYear <= 0) {
resYear = year - 1;
resDayOfYear = daysInYear(resYear) + dayOfYear;
} else if (dayOfYear > daysInYear(year)) {
resYear = year + 1;
resDayOfYear = dayOfYear - daysInYear(year);
} else {
resYear = year;
resDayOfYear = dayOfYear;
}
return {
year: resYear,
dayOfYear: resDayOfYear
};
}
function weekOfYear(mom, dow, doy) {
var weekOffset = firstWeekOffset(mom.year(), dow, doy),
week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
resWeek, resYear;
if (week < 1) {
resYear = mom.year() - 1;
resWeek = week + weeksInYear(resYear, dow, doy);
} else if (week > weeksInYear(mom.year(), dow, doy)) {
resWeek = week - weeksInYear(mom.year(), dow, doy);
resYear = mom.year() + 1;
} else {
resYear = mom.year();
resWeek = week;
}
return {
week: resWeek,
year: resYear
};
}
function weeksInYear(year, dow, doy) {
var weekOffset = firstWeekOffset(year, dow, doy),
weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
}
// FORMATTING
addFormatToken('w', ['ww', 2], 'wo', 'week');
addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
// ALIASES
addUnitAlias('week', 'w');
addUnitAlias('isoWeek', 'W');
// PRIORITIES
addUnitPriority('week', 5);
addUnitPriority('isoWeek', 5);
// PARSING
addRegexToken('w', match1to2);
addRegexToken('ww', match1to2, match2);
addRegexToken('W', match1to2);
addRegexToken('WW', match1to2, match2);
addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
week[token.substr(0, 1)] = toInt(input);
});
// HELPERS
// LOCALES
function localeWeek (mom) {
return weekOfYear(mom, this._week.dow, this._week.doy).week;
}
var defaultLocaleWeek = {
dow : 0, // Sunday is the first day of the week.
doy : 6 // The week that contains Jan 1st is the first week of the year.
};
function localeFirstDayOfWeek () {
return this._week.dow;
}
function localeFirstDayOfYear () {
return this._week.doy;
}
// MOMENTS
function getSetWeek (input) {
var week = this.localeData().week(this);
return input == null ? week : this.add((input - week) * 7, 'd');
}
function getSetISOWeek (input) {
var week = weekOfYear(this, 1, 4).week;
return input == null ? week : this.add((input - week) * 7, 'd');
}
// FORMATTING
addFormatToken('d', 0, 'do', 'day');
addFormatToken('dd', 0, 0, function (format) {
return this.localeData().weekdaysMin(this, format);
});
addFormatToken('ddd', 0, 0, function (format) {
return this.localeData().weekdaysShort(this, format);
});
addFormatToken('dddd', 0, 0, function (format) {
return this.localeData().weekdays(this, format);
});
addFormatToken('e', 0, 0, 'weekday');
addFormatToken('E', 0, 0, 'isoWeekday');
// ALIASES
addUnitAlias('day', 'd');
addUnitAlias('weekday', 'e');
addUnitAlias('isoWeekday', 'E');
// PRIORITY
addUnitPriority('day', 11);
addUnitPriority('weekday', 11);
addUnitPriority('isoWeekday', 11);
// PARSING
addRegexToken('d', match1to2);
addRegexToken('e', match1to2);
addRegexToken('E', match1to2);
addRegexToken('dd', function (isStrict, locale) {
return locale.weekdaysMinRegex(isStrict);
});
addRegexToken('ddd', function (isStrict, locale) {
return locale.weekdaysShortRegex(isStrict);
});
addRegexToken('dddd', function (isStrict, locale) {
return locale.weekdaysRegex(isStrict);
});
addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
var weekday = config._locale.weekdaysParse(input, token, config._strict);
// if we didn't get a weekday name, mark the date as invalid
if (weekday != null) {
week.d = weekday;
} else {
getParsingFlags(config).invalidWeekday = input;
}
});
addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
week[token] = toInt(input);
});
// HELPERS
function parseWeekday(input, locale) {
if (typeof input !== 'string') {
return input;
}
if (!isNaN(input)) {
return parseInt(input, 10);
}
input = locale.weekdaysParse(input);
if (typeof input === 'number') {
return input;
}
return null;
}
function parseIsoWeekday(input, locale) {
if (typeof input === 'string') {
return locale.weekdaysParse(input) % 7 || 7;
}
return isNaN(input) ? null : input;
}
// LOCALES
var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
function localeWeekdays (m, format) {
if (!m) {
return this._weekdays;
}
return isArray(this._weekdays) ? this._weekdays[m.day()] :
this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];
}
var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
function localeWeekdaysShort (m) {
return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;
}
var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
function localeWeekdaysMin (m) {
return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;
}
function handleStrictParse$1(weekdayName, format, strict) {
var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
if (!this._weekdaysParse) {
this._weekdaysParse = [];
this._shortWeekdaysParse = [];
this._minWeekdaysParse = [];
for (i = 0; i < 7; ++i) {
mom = createUTC([2000, 1]).day(i);
this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
}
}
if (strict) {
if (format === 'dddd') {
ii = indexOf$1.call(this._weekdaysParse, llc);
return ii !== -1 ? ii : null;
} else if (format === 'ddd') {
ii = indexOf$1.call(this._shortWeekdaysParse, llc);
return ii !== -1 ? ii : null;
} else {
ii = indexOf$1.call(this._minWeekdaysParse, llc);
return ii !== -1 ? ii : null;
}
} else {
if (format === 'dddd') {
ii = indexOf$1.call(this._weekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf$1.call(this._shortWeekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf$1.call(this._minWeekdaysParse, llc);
return ii !== -1 ? ii : null;
} else if (format === 'ddd') {
ii = indexOf$1.call(this._shortWeekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf$1.call(this._weekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf$1.call(this._minWeekdaysParse, llc);
return ii !== -1 ? ii : null;
} else {
ii = indexOf$1.call(this._minWeekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf$1.call(this._weekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf$1.call(this._shortWeekdaysParse, llc);
return ii !== -1 ? ii : null;
}
}
}
function localeWeekdaysParse (weekdayName, format, strict) {
var i, mom, regex;
if (this._weekdaysParseExact) {
return handleStrictParse$1.call(this, weekdayName, format, strict);
}
if (!this._weekdaysParse) {
this._weekdaysParse = [];
this._minWeekdaysParse = [];
this._shortWeekdaysParse = [];
this._fullWeekdaysParse = [];
}
for (i = 0; i < 7; i++) {
// make the regex if we don't have it already
mom = createUTC([2000, 1]).day(i);
if (strict && !this._fullWeekdaysParse[i]) {
this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i');
this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i');
this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i');
}
if (!this._weekdaysParse[i]) {
regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
}
// test the regex
if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
return i;
} else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
return i;
} else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
return i;
} else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
return i;
}
}
}
// MOMENTS
function getSetDayOfWeek (input) {
if (!this.isValid()) {
return input != null ? this : NaN;
}
var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
if (input != null) {
input = parseWeekday(input, this.localeData());
return this.add(input - day, 'd');
} else {
return day;
}
}
function getSetLocaleDayOfWeek (input) {
if (!this.isValid()) {
return input != null ? this : NaN;
}
var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
return input == null ? weekday : this.add(input - weekday, 'd');
}
function getSetISODayOfWeek (input) {
if (!this.isValid()) {
return input != null ? this : NaN;
}
// behaves the same as moment#day except
// as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
// as a setter, sunday should belong to the previous week.
if (input != null) {
var weekday = parseIsoWeekday(input, this.localeData());
return this.day(this.day() % 7 ? weekday : weekday - 7);
} else {
return this.day() || 7;
}
}
var defaultWeekdaysRegex = matchWord;
function weekdaysRegex (isStrict) {
if (this._weekdaysParseExact) {
if (!hasOwnProp(this, '_weekdaysRegex')) {
computeWeekdaysParse.call(this);
}
if (isStrict) {
return this._weekdaysStrictRegex;
} else {
return this._weekdaysRegex;
}
} else {
if (!hasOwnProp(this, '_weekdaysRegex')) {
this._weekdaysRegex = defaultWeekdaysRegex;
}
return this._weekdaysStrictRegex && isStrict ?
this._weekdaysStrictRegex : this._weekdaysRegex;
}
}
var defaultWeekdaysShortRegex = matchWord;
function weekdaysShortRegex (isStrict) {
if (this._weekdaysParseExact) {
if (!hasOwnProp(this, '_weekdaysRegex')) {
computeWeekdaysParse.call(this);
}
if (isStrict) {
return this._weekdaysShortStrictRegex;
} else {
return this._weekdaysShortRegex;
}
} else {
if (!hasOwnProp(this, '_weekdaysShortRegex')) {
this._weekdaysShortRegex = defaultWeekdaysShortRegex;
}
return this._weekdaysShortStrictRegex && isStrict ?
this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
}
}
var defaultWeekdaysMinRegex = matchWord;
function weekdaysMinRegex (isStrict) {
if (this._weekdaysParseExact) {
if (!hasOwnProp(this, '_weekdaysRegex')) {
computeWeekdaysParse.call(this);
}
if (isStrict) {
return this._weekdaysMinStrictRegex;
} else {
return this._weekdaysMinRegex;
}
} else {
if (!hasOwnProp(this, '_weekdaysMinRegex')) {
this._weekdaysMinRegex = defaultWeekdaysMinRegex;
}
return this._weekdaysMinStrictRegex && isStrict ?
this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
}
}
function computeWeekdaysParse () {
function cmpLenRev(a, b) {
return b.length - a.length;
}
var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],
i, mom, minp, shortp, longp;
for (i = 0; i < 7; i++) {
// make the regex if we don't have it already
mom = createUTC([2000, 1]).day(i);
minp = this.weekdaysMin(mom, '');
shortp = this.weekdaysShort(mom, '');
longp = this.weekdays(mom, '');
minPieces.push(minp);
shortPieces.push(shortp);
longPieces.push(longp);
mixedPieces.push(minp);
mixedPieces.push(shortp);
mixedPieces.push(longp);
}
// Sorting makes sure if one weekday (or abbr) is a prefix of another it
// will match the longer piece.
minPieces.sort(cmpLenRev);
shortPieces.sort(cmpLenRev);
longPieces.sort(cmpLenRev);
mixedPieces.sort(cmpLenRev);
for (i = 0; i < 7; i++) {
shortPieces[i] = regexEscape(shortPieces[i]);
longPieces[i] = regexEscape(longPieces[i]);
mixedPieces[i] = regexEscape(mixedPieces[i]);
}
this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
this._weekdaysShortRegex = this._weekdaysRegex;
this._weekdaysMinRegex = this._weekdaysRegex;
this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
}
// FORMATTING
function hFormat() {
return this.hours() % 12 || 12;
}
function kFormat() {
return this.hours() || 24;
}
addFormatToken('H', ['HH', 2], 0, 'hour');
addFormatToken('h', ['hh', 2], 0, hFormat);
addFormatToken('k', ['kk', 2], 0, kFormat);
addFormatToken('hmm', 0, 0, function () {
return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
});
addFormatToken('hmmss', 0, 0, function () {
return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
zeroFill(this.seconds(), 2);
});
addFormatToken('Hmm', 0, 0, function () {
return '' + this.hours() + zeroFill(this.minutes(), 2);
});
addFormatToken('Hmmss', 0, 0, function () {
return '' + this.hours() + zeroFill(this.minutes(), 2) +
zeroFill(this.seconds(), 2);
});
function meridiem (token, lowercase) {
addFormatToken(token, 0, 0, function () {
return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
});
}
meridiem('a', true);
meridiem('A', false);
// ALIASES
addUnitAlias('hour', 'h');
// PRIORITY
addUnitPriority('hour', 13);
// PARSING
function matchMeridiem (isStrict, locale) {
return locale._meridiemParse;
}
addRegexToken('a', matchMeridiem);
addRegexToken('A', matchMeridiem);
addRegexToken('H', match1to2);
addRegexToken('h', match1to2);
addRegexToken('HH', match1to2, match2);
addRegexToken('hh', match1to2, match2);
addRegexToken('hmm', match3to4);
addRegexToken('hmmss', match5to6);
addRegexToken('Hmm', match3to4);
addRegexToken('Hmmss', match5to6);
addParseToken(['H', 'HH'], HOUR);
addParseToken(['a', 'A'], function (input, array, config) {
config._isPm = config._locale.isPM(input);
config._meridiem = input;
});
addParseToken(['h', 'hh'], function (input, array, config) {
array[HOUR] = toInt(input);
getParsingFlags(config).bigHour = true;
});
addParseToken('hmm', function (input, array, config) {
var pos = input.length - 2;
array[HOUR] = toInt(input.substr(0, pos));
array[MINUTE] = toInt(input.substr(pos));
getParsingFlags(config).bigHour = true;
});
addParseToken('hmmss', function (input, array, config) {
var pos1 = input.length - 4;
var pos2 = input.length - 2;
array[HOUR] = toInt(input.substr(0, pos1));
array[MINUTE] = toInt(input.substr(pos1, 2));
array[SECOND] = toInt(input.substr(pos2));
getParsingFlags(config).bigHour = true;
});
addParseToken('Hmm', function (input, array, config) {
var pos = input.length - 2;
array[HOUR] = toInt(input.substr(0, pos));
array[MINUTE] = toInt(input.substr(pos));
});
addParseToken('Hmmss', function (input, array, config) {
var pos1 = input.length - 4;
var pos2 = input.length - 2;
array[HOUR] = toInt(input.substr(0, pos1));
array[MINUTE] = toInt(input.substr(pos1, 2));
array[SECOND] = toInt(input.substr(pos2));
});
// LOCALES
function localeIsPM (input) {
// IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
// Using charAt should be more compatible.
return ((input + '').toLowerCase().charAt(0) === 'p');
}
var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
function localeMeridiem (hours, minutes, isLower) {
if (hours > 11) {
return isLower ? 'pm' : 'PM';
} else {
return isLower ? 'am' : 'AM';
}
}
// MOMENTS
// Setting the hour should keep the time, because the user explicitly
// specified which hour he wants. So trying to maintain the same hour (in
// a new timezone) makes sense. Adding/subtracting hours does not follow
// this rule.
var getSetHour = makeGetSet('Hours', true);
// months
// week
// weekdays
// meridiem
var baseConfig = {
calendar: defaultCalendar,
longDateFormat: defaultLongDateFormat,
invalidDate: defaultInvalidDate,
ordinal: defaultOrdinal,
ordinalParse: defaultOrdinalParse,
relativeTime: defaultRelativeTime,
months: defaultLocaleMonths,
monthsShort: defaultLocaleMonthsShort,
week: defaultLocaleWeek,
weekdays: defaultLocaleWeekdays,
weekdaysMin: defaultLocaleWeekdaysMin,
weekdaysShort: defaultLocaleWeekdaysShort,
meridiemParse: defaultLocaleMeridiemParse
};
// internal storage for locale config files
var locales = {};
var localeFamilies = {};
var globalLocale;
function normalizeLocale(key) {
return key ? key.toLowerCase().replace('_', '-') : key;
}
// pick the locale from the array
// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
function chooseLocale(names) {
var i = 0, j, next, locale, split;
while (i < names.length) {
split = normalizeLocale(names[i]).split('-');
j = split.length;
next = normalizeLocale(names[i + 1]);
next = next ? next.split('-') : null;
while (j > 0) {
locale = loadLocale(split.slice(0, j).join('-'));
if (locale) {
return locale;
}
if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
//the next array item is better than a shallower substring of this one
break;
}
j--;
}
i++;
}
return null;
}
function loadLocale(name) {
var oldLocale = null;
// TODO: Find a better way to register and load all the locales in Node
if (!locales[name] && (typeof module !== 'undefined') &&
module && module.exports) {
try {
oldLocale = globalLocale._abbr;
require('./locale/' + name);
// because defineLocale currently also sets the global locale, we
// want to undo that for lazy loaded locales
getSetGlobalLocale(oldLocale);
} catch (e) { }
}
return locales[name];
}
// This function will load locale and then set the global locale. If
// no arguments are passed in, it will simply return the current global
// locale key.
function getSetGlobalLocale (key, values) {
var data;
if (key) {
if (isUndefined(values)) {
data = getLocale(key);
}
else {
data = defineLocale(key, values);
}
if (data) {
// moment.duration._locale = moment._locale = data;
globalLocale = data;
}
}
return globalLocale._abbr;
}
function defineLocale (name, config) {
if (config !== null) {
var parentConfig = baseConfig;
config.abbr = name;
if (locales[name] != null) {
deprecateSimple('defineLocaleOverride',
'use moment.updateLocale(localeName, config) to change ' +
'an existing locale. moment.defineLocale(localeName, ' +
'config) should only be used for creating a new locale ' +
'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
parentConfig = locales[name]._config;
} else if (config.parentLocale != null) {
if (locales[config.parentLocale] != null) {
parentConfig = locales[config.parentLocale]._config;
} else {
if (!localeFamilies[config.parentLocale]) {
localeFamilies[config.parentLocale] = [];
}
localeFamilies[config.parentLocale].push({
name: name,
config: config
});
return null;
}
}
locales[name] = new Locale(mergeConfigs(parentConfig, config));
if (localeFamilies[name]) {
localeFamilies[name].forEach(function (x) {
defineLocale(x.name, x.config);
});
}
// backwards compat for now: also set the locale
// make sure we set the locale AFTER all child locales have been
// created, so we won't end up with the child locale set.
getSetGlobalLocale(name);
return locales[name];
} else {
// useful for testing
delete locales[name];
return null;
}
}
function updateLocale(name, config) {
if (config != null) {
var locale, parentConfig = baseConfig;
// MERGE
if (locales[name] != null) {
parentConfig = locales[name]._config;
}
config = mergeConfigs(parentConfig, config);
locale = new Locale(config);
locale.parentLocale = locales[name];
locales[name] = locale;
// backwards compat for now: also set the locale
getSetGlobalLocale(name);
} else {
// pass null for config to unupdate, useful for tests
if (locales[name] != null) {
if (locales[name].parentLocale != null) {
locales[name] = locales[name].parentLocale;
} else if (locales[name] != null) {
delete locales[name];
}
}
}
return locales[name];
}
// returns locale data
function getLocale (key) {
var locale;
if (key && key._locale && key._locale._abbr) {
key = key._locale._abbr;
}
if (!key) {
return globalLocale;
}
if (!isArray(key)) {
//short-circuit everything else
locale = loadLocale(key);
if (locale) {
return locale;
}
key = [key];
}
return chooseLocale(key);
}
function listLocales() {
return keys$1(locales);
}
function checkOverflow (m) {
var overflow;
var a = m._a;
if (a && getParsingFlags(m).overflow === -2) {
overflow =
a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
-1;
if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
overflow = DATE;
}
if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
overflow = WEEK;
}
if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
overflow = WEEKDAY;
}
getParsingFlags(m).overflow = overflow;
}
return m;
}
// iso 8601 regex
// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
var isoDates = [
['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
['GGGG-[W]WW', /\d{4}-W\d\d/, false],
['YYYY-DDD', /\d{4}-\d{3}/],
['YYYY-MM', /\d{4}-\d\d/, false],
['YYYYYYMMDD', /[+-]\d{10}/],
['YYYYMMDD', /\d{8}/],
// YYYYMM is NOT allowed by the standard
['GGGG[W]WWE', /\d{4}W\d{3}/],
['GGGG[W]WW', /\d{4}W\d{2}/, false],
['YYYYDDD', /\d{7}/]
];
// iso time formats and regexes
var isoTimes = [
['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
['HH:mm:ss', /\d\d:\d\d:\d\d/],
['HH:mm', /\d\d:\d\d/],
['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
['HHmmss', /\d\d\d\d\d\d/],
['HHmm', /\d\d\d\d/],
['HH', /\d\d/]
];
var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
// date from iso format
function configFromISO(config) {
var i, l,
string = config._i,
match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
allowTime, dateFormat, timeFormat, tzFormat;
if (match) {
getParsingFlags(config).iso = true;
for (i = 0, l = isoDates.length; i < l; i++) {
if (isoDates[i][1].exec(match[1])) {
dateFormat = isoDates[i][0];
allowTime = isoDates[i][2] !== false;
break;
}
}
if (dateFormat == null) {
config._isValid = false;
return;
}
if (match[3]) {
for (i = 0, l = isoTimes.length; i < l; i++) {
if (isoTimes[i][1].exec(match[3])) {
// match[2] should be 'T' or space
timeFormat = (match[2] || ' ') + isoTimes[i][0];
break;
}
}
if (timeFormat == null) {
config._isValid = false;
return;
}
}
if (!allowTime && timeFormat != null) {
config._isValid = false;
return;
}
if (match[4]) {
if (tzRegex.exec(match[4])) {
tzFormat = 'Z';
} else {
config._isValid = false;
return;
}
}
config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
configFromStringAndFormat(config);
} else {
config._isValid = false;
}
}
// date from iso format or fallback
function configFromString(config) {
var matched = aspNetJsonRegex.exec(config._i);
if (matched !== null) {
config._d = new Date(+matched[1]);
return;
}
configFromISO(config);
if (config._isValid === false) {
delete config._isValid;
hooks.createFromInputFallback(config);
}
}
hooks.createFromInputFallback = deprecate(
'value provided is not in a recognized ISO format. moment construction falls back to js Date(), ' +
'which is not reliable across all browsers and versions. Non ISO date formats are ' +
'discouraged and will be removed in an upcoming major release. Please refer to ' +
'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
function (config) {
config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
}
);
// Pick the first defined of two or three arguments.
function defaults(a, b, c) {
if (a != null) {
return a;
}
if (b != null) {
return b;
}
return c;
}
function currentDateArray(config) {
// hooks is actually the exported moment object
var nowValue = new Date(hooks.now());
if (config._useUTC) {
return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
}
return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
}
// convert an array to a date.
// the array should mirror the parameters below
// note: all values past the year are optional and will default to the lowest possible value.
// [year, month, day , hour, minute, second, millisecond]
function configFromArray (config) {
var i, date, input = [], currentDate, yearToUse;
if (config._d) {
return;
}
currentDate = currentDateArray(config);
//compute day of the year from weeks and weekdays
if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
dayOfYearFromWeekInfo(config);
}
//if the day of the year is set, figure out what it is
if (config._dayOfYear) {
yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
if (config._dayOfYear > daysInYear(yearToUse)) {
getParsingFlags(config)._overflowDayOfYear = true;
}
date = createUTCDate(yearToUse, 0, config._dayOfYear);
config._a[MONTH] = date.getUTCMonth();
config._a[DATE] = date.getUTCDate();
}
// Default to current date.
// * if no year, month, day of month are given, default to today
// * if day of month is given, default month and year
// * if month is given, default only year
// * if year is given, don't default anything
for (i = 0; i < 3 && config._a[i] == null; ++i) {
config._a[i] = input[i] = currentDate[i];
}
// Zero out whatever was not defaulted, including time
for (; i < 7; i++) {
config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
}
// Check for 24:00:00.000
if (config._a[HOUR] === 24 &&
config._a[MINUTE] === 0 &&
config._a[SECOND] === 0 &&
config._a[MILLISECOND] === 0) {
config._nextDay = true;
config._a[HOUR] = 0;
}
config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
// Apply timezone offset from input. The actual utcOffset can be changed
// with parseZone.
if (config._tzm != null) {
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
}
if (config._nextDay) {
config._a[HOUR] = 24;
}
}
function dayOfYearFromWeekInfo(config) {
var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
w = config._w;
if (w.GG != null || w.W != null || w.E != null) {
dow = 1;
doy = 4;
// TODO: We need to take the current isoWeekYear, but that depends on
// how we interpret now (local, utc, fixed offset). So create
// a now version of current config (take local/utc/offset flags, and
// create now).
weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);
week = defaults(w.W, 1);
weekday = defaults(w.E, 1);
if (weekday < 1 || weekday > 7) {
weekdayOverflow = true;
}
} else {
dow = config._locale._week.dow;
doy = config._locale._week.doy;
var curWeek = weekOfYear(createLocal(), dow, doy);
weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
// Default to current week.
week = defaults(w.w, curWeek.week);
if (w.d != null) {
// weekday -- low day numbers are considered next week
weekday = w.d;
if (weekday < 0 || weekday > 6) {
weekdayOverflow = true;
}
} else if (w.e != null) {
// local weekday -- counting starts from begining of week
weekday = w.e + dow;
if (w.e < 0 || w.e > 6) {
weekdayOverflow = true;
}
} else {
// default to begining of week
weekday = dow;
}
}
if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
getParsingFlags(config)._overflowWeeks = true;
} else if (weekdayOverflow != null) {
getParsingFlags(config)._overflowWeekday = true;
} else {
temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
config._a[YEAR] = temp.year;
config._dayOfYear = temp.dayOfYear;
}
}
// constant that refers to the ISO standard
hooks.ISO_8601 = function () {};
// date from string and format string
function configFromStringAndFormat(config) {
// TODO: Move this to another part of the creation flow to prevent circular deps
if (config._f === hooks.ISO_8601) {
configFromISO(config);
return;
}
config._a = [];
getParsingFlags(config).empty = true;
// This array is used to make a Date, either with `new Date` or `Date.UTC`
var string = '' + config._i,
i, parsedInput, tokens, token, skipped,
stringLength = string.length,
totalParsedInputLength = 0;
tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
for (i = 0; i < tokens.length; i++) {
token = tokens[i];
parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
// console.log('token', token, 'parsedInput', parsedInput,
// 'regex', getParseRegexForToken(token, config));
if (parsedInput) {
skipped = string.substr(0, string.indexOf(parsedInput));
if (skipped.length > 0) {
getParsingFlags(config).unusedInput.push(skipped);
}
string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
totalParsedInputLength += parsedInput.length;
}
// don't parse if it's not a known token
if (formatTokenFunctions[token]) {
if (parsedInput) {
getParsingFlags(config).empty = false;
}
else {
getParsingFlags(config).unusedTokens.push(token);
}
addTimeToArrayFromToken(token, parsedInput, config);
}
else if (config._strict && !parsedInput) {
getParsingFlags(config).unusedTokens.push(token);
}
}
// add remaining unparsed input length to the string
getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
if (string.length > 0) {
getParsingFlags(config).unusedInput.push(string);
}
// clear _12h flag if hour is <= 12
if (config._a[HOUR] <= 12 &&
getParsingFlags(config).bigHour === true &&
config._a[HOUR] > 0) {
getParsingFlags(config).bigHour = undefined;
}
getParsingFlags(config).parsedDateParts = config._a.slice(0);
getParsingFlags(config).meridiem = config._meridiem;
// handle meridiem
config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
configFromArray(config);
checkOverflow(config);
}
function meridiemFixWrap (locale, hour, meridiem) {
var isPm;
if (meridiem == null) {
// nothing to do
return hour;
}
if (locale.meridiemHour != null) {
return locale.meridiemHour(hour, meridiem);
} else if (locale.isPM != null) {
// Fallback
isPm = locale.isPM(meridiem);
if (isPm && hour < 12) {
hour += 12;
}
if (!isPm && hour === 12) {
hour = 0;
}
return hour;
} else {
// this is not supposed to happen
return hour;
}
}
// date from string and array of format strings
function configFromStringAndArray(config) {
var tempConfig,
bestMoment,
scoreToBeat,
i,
currentScore;
if (config._f.length === 0) {
getParsingFlags(config).invalidFormat = true;
config._d = new Date(NaN);
return;
}
for (i = 0; i < config._f.length; i++) {
currentScore = 0;
tempConfig = copyConfig({}, config);
if (config._useUTC != null) {
tempConfig._useUTC = config._useUTC;
}
tempConfig._f = config._f[i];
configFromStringAndFormat(tempConfig);
if (!isValid(tempConfig)) {
continue;
}
// if there is any input that was not parsed add a penalty for that format
currentScore += getParsingFlags(tempConfig).charsLeftOver;
//or tokens
currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
getParsingFlags(tempConfig).score = currentScore;
if (scoreToBeat == null || currentScore < scoreToBeat) {
scoreToBeat = currentScore;
bestMoment = tempConfig;
}
}
extend(config, bestMoment || tempConfig);
}
function configFromObject(config) {
if (config._d) {
return;
}
var i = normalizeObjectUnits(config._i);
config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
return obj && parseInt(obj, 10);
});
configFromArray(config);
}
function createFromConfig (config) {
var res = new Moment(checkOverflow(prepareConfig(config)));
if (res._nextDay) {
// Adding is smart enough around DST
res.add(1, 'd');
res._nextDay = undefined;
}
return res;
}
function prepareConfig (config) {
var input = config._i,
format = config._f;
config._locale = config._locale || getLocale(config._l);
if (input === null || (format === undefined && input === '')) {
return createInvalid({nullInput: true});
}
if (typeof input === 'string') {
config._i = input = config._locale.preparse(input);
}
if (isMoment(input)) {
return new Moment(checkOverflow(input));
} else if (isDate(input)) {
config._d = input;
} else if (isArray(format)) {
configFromStringAndArray(config);
} else if (format) {
configFromStringAndFormat(config);
} else {
configFromInput(config);
}
if (!isValid(config)) {
config._d = null;
}
return config;
}
function configFromInput(config) {
var input = config._i;
if (input === undefined) {
config._d = new Date(hooks.now());
} else if (isDate(input)) {
config._d = new Date(input.valueOf());
} else if (typeof input === 'string') {
configFromString(config);
} else if (isArray(input)) {
config._a = map(input.slice(0), function (obj) {
return parseInt(obj, 10);
});
configFromArray(config);
} else if (typeof(input) === 'object') {
configFromObject(config);
} else if (isNumber(input)) {
// from milliseconds
config._d = new Date(input);
} else {
hooks.createFromInputFallback(config);
}
}
function createLocalOrUTC (input, format, locale, strict, isUTC) {
var c = {};
if (locale === true || locale === false) {
strict = locale;
locale = undefined;
}
if ((isObject(input) && isObjectEmpty(input)) ||
(isArray(input) && input.length === 0)) {
input = undefined;
}
// object construction must be done this way.
// https://github.com/moment/moment/issues/1423
c._isAMomentObject = true;
c._useUTC = c._isUTC = isUTC;
c._l = locale;
c._i = input;
c._f = format;
c._strict = strict;
return createFromConfig(c);
}
function createLocal (input, format, locale, strict) {
return createLocalOrUTC(input, format, locale, strict, false);
}
var prototypeMin = deprecate(
'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
function () {
var other = createLocal.apply(null, arguments);
if (this.isValid() && other.isValid()) {
return other < this ? this : other;
} else {
return createInvalid();
}
}
);
var prototypeMax = deprecate(
'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
function () {
var other = createLocal.apply(null, arguments);
if (this.isValid() && other.isValid()) {
return other > this ? this : other;
} else {
return createInvalid();
}
}
);
// Pick a moment m from moments so that m[fn](other) is true for all
// other. This relies on the function fn to be transitive.
//
// moments should either be an array of moment objects or an array, whose
// first element is an array of moment objects.
function pickBy(fn, moments) {
var res, i;
if (moments.length === 1 && isArray(moments[0])) {
moments = moments[0];
}
if (!moments.length) {
return createLocal();
}
res = moments[0];
for (i = 1; i < moments.length; ++i) {
if (!moments[i].isValid() || moments[i][fn](res)) {
res = moments[i];
}
}
return res;
}
// TODO: Use [].sort instead?
function min () {
var args = [].slice.call(arguments, 0);
return pickBy('isBefore', args);
}
function max () {
var args = [].slice.call(arguments, 0);
return pickBy('isAfter', args);
}
var now = function () {
return Date.now ? Date.now() : +(new Date());
};
function Duration (duration) {
var normalizedInput = normalizeObjectUnits(duration),
years = normalizedInput.year || 0,
quarters = normalizedInput.quarter || 0,
months = normalizedInput.month || 0,
weeks = normalizedInput.week || 0,
days = normalizedInput.day || 0,
hours = normalizedInput.hour || 0,
minutes = normalizedInput.minute || 0,
seconds = normalizedInput.second || 0,
milliseconds = normalizedInput.millisecond || 0;
// representation for dateAddRemove
this._milliseconds = +milliseconds +
seconds * 1e3 + // 1000
minutes * 6e4 + // 1000 * 60
hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
// Because of dateAddRemove treats 24 hours as different from a
// day when working around DST, we need to store them separately
this._days = +days +
weeks * 7;
// It is impossible translate months into days without knowing
// which months you are are talking about, so we have to store
// it separately.
this._months = +months +
quarters * 3 +
years * 12;
this._data = {};
this._locale = getLocale();
this._bubble();
}
function isDuration (obj) {
return obj instanceof Duration;
}
function absRound (number) {
if (number < 0) {
return Math.round(-1 * number) * -1;
} else {
return Math.round(number);
}
}
// FORMATTING
function offset (token, separator) {
addFormatToken(token, 0, 0, function () {
var offset = this.utcOffset();
var sign = '+';
if (offset < 0) {
offset = -offset;
sign = '-';
}
return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
});
}
offset('Z', ':');
offset('ZZ', '');
// PARSING
addRegexToken('Z', matchShortOffset);
addRegexToken('ZZ', matchShortOffset);
addParseToken(['Z', 'ZZ'], function (input, array, config) {
config._useUTC = true;
config._tzm = offsetFromString(matchShortOffset, input);
});
// HELPERS
// timezone chunker
// '+10:00' > ['10', '00']
// '-1530' > ['-15', '30']
var chunkOffset = /([\+\-]|\d\d)/gi;
function offsetFromString(matcher, string) {
var matches = (string || '').match(matcher);
if (matches === null) {
return null;
}
var chunk = matches[matches.length - 1] || [];
var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
var minutes = +(parts[1] * 60) + toInt(parts[2]);
return minutes === 0 ?
0 :
parts[0] === '+' ? minutes : -minutes;
}
// Return a moment from input, that is local/utc/zone equivalent to model.
function cloneWithOffset(input, model) {
var res, diff;
if (model._isUTC) {
res = model.clone();
diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
// Use low-level api, because this fn is low-level api.
res._d.setTime(res._d.valueOf() + diff);
hooks.updateOffset(res, false);
return res;
} else {
return createLocal(input).local();
}
}
function getDateOffset (m) {
// On Firefox.24 Date#getTimezoneOffset returns a floating point.
// https://github.com/moment/moment/pull/1871
return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
}
// HOOKS
// This function will be called whenever a moment is mutated.
// It is intended to keep the offset in sync with the timezone.
hooks.updateOffset = function () {};
// MOMENTS
// keepLocalTime = true means only change the timezone, without
// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
// +0200, so we adjust the time as needed, to be valid.
//
// Keeping the time actually adds/subtracts (one hour)
// from the actual represented time. That is why we call updateOffset
// a second time. In case it wants us to change the offset again
// _changeInProgress == true case, then we have to adjust, because
// there is no such time in the given timezone.
function getSetOffset (input, keepLocalTime) {
var offset = this._offset || 0,
localAdjust;
if (!this.isValid()) {
return input != null ? this : NaN;
}
if (input != null) {
if (typeof input === 'string') {
input = offsetFromString(matchShortOffset, input);
if (input === null) {
return this;
}
} else if (Math.abs(input) < 16) {
input = input * 60;
}
if (!this._isUTC && keepLocalTime) {
localAdjust = getDateOffset(this);
}
this._offset = input;
this._isUTC = true;
if (localAdjust != null) {
this.add(localAdjust, 'm');
}
if (offset !== input) {
if (!keepLocalTime || this._changeInProgress) {
addSubtract(this, createDuration(input - offset, 'm'), 1, false);
} else if (!this._changeInProgress) {
this._changeInProgress = true;
hooks.updateOffset(this, true);
this._changeInProgress = null;
}
}
return this;
} else {
return this._isUTC ? offset : getDateOffset(this);
}
}
function getSetZone (input, keepLocalTime) {
if (input != null) {
if (typeof input !== 'string') {
input = -input;
}
this.utcOffset(input, keepLocalTime);
return this;
} else {
return -this.utcOffset();
}
}
function setOffsetToUTC (keepLocalTime) {
return this.utcOffset(0, keepLocalTime);
}
function setOffsetToLocal (keepLocalTime) {
if (this._isUTC) {
this.utcOffset(0, keepLocalTime);
this._isUTC = false;
if (keepLocalTime) {
this.subtract(getDateOffset(this), 'm');
}
}
return this;
}
function setOffsetToParsedOffset () {
if (this._tzm != null) {
this.utcOffset(this._tzm);
} else if (typeof this._i === 'string') {
var tZone = offsetFromString(matchOffset, this._i);
if (tZone != null) {
this.utcOffset(tZone);
}
else {
this.utcOffset(0, true);
}
}
return this;
}
function hasAlignedHourOffset (input) {
if (!this.isValid()) {
return false;
}
input = input ? createLocal(input).utcOffset() : 0;
return (this.utcOffset() - input) % 60 === 0;
}
function isDaylightSavingTime () {
return (
this.utcOffset() > this.clone().month(0).utcOffset() ||
this.utcOffset() > this.clone().month(5).utcOffset()
);
}
function isDaylightSavingTimeShifted () {
if (!isUndefined(this._isDSTShifted)) {
return this._isDSTShifted;
}
var c = {};
copyConfig(c, this);
c = prepareConfig(c);
if (c._a) {
var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
this._isDSTShifted = this.isValid() &&
compareArrays(c._a, other.toArray()) > 0;
} else {
this._isDSTShifted = false;
}
return this._isDSTShifted;
}
function isLocal () {
return this.isValid() ? !this._isUTC : false;
}
function isUtcOffset () {
return this.isValid() ? this._isUTC : false;
}
function isUtc () {
return this.isValid() ? this._isUTC && this._offset === 0 : false;
}
// ASP.NET json date format regex
var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
// and further modified to allow for strings containing both week and day
var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;
function createDuration (input, key) {
var duration = input,
// matching against regexp is expensive, do it on demand
match = null,
sign,
ret,
diffRes;
if (isDuration(input)) {
duration = {
ms : input._milliseconds,
d : input._days,
M : input._months
};
} else if (isNumber(input)) {
duration = {};
if (key) {
duration[key] = input;
} else {
duration.milliseconds = input;
}
} else if (!!(match = aspNetRegex.exec(input))) {
sign = (match[1] === '-') ? -1 : 1;
duration = {
y : 0,
d : toInt(match[DATE]) * sign,
h : toInt(match[HOUR]) * sign,
m : toInt(match[MINUTE]) * sign,
s : toInt(match[SECOND]) * sign,
ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match
};
} else if (!!(match = isoRegex.exec(input))) {
sign = (match[1] === '-') ? -1 : 1;
duration = {
y : parseIso(match[2], sign),
M : parseIso(match[3], sign),
w : parseIso(match[4], sign),
d : parseIso(match[5], sign),
h : parseIso(match[6], sign),
m : parseIso(match[7], sign),
s : parseIso(match[8], sign)
};
} else if (duration == null) {// checks for null or undefined
duration = {};
} else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));
duration = {};
duration.ms = diffRes.milliseconds;
duration.M = diffRes.months;
}
ret = new Duration(duration);
if (isDuration(input) && hasOwnProp(input, '_locale')) {
ret._locale = input._locale;
}
return ret;
}
createDuration.fn = Duration.prototype;
function parseIso (inp, sign) {
// We'd normally use ~~inp for this, but unfortunately it also
// converts floats to ints.
// inp may be undefined, so careful calling replace on it.
var res = inp && parseFloat(inp.replace(',', '.'));
// apply sign while we're at it
return (isNaN(res) ? 0 : res) * sign;
}
function positiveMomentsDifference(base, other) {
var res = {milliseconds: 0, months: 0};
res.months = other.month() - base.month() +
(other.year() - base.year()) * 12;
if (base.clone().add(res.months, 'M').isAfter(other)) {
--res.months;
}
res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
return res;
}
function momentsDifference(base, other) {
var res;
if (!(base.isValid() && other.isValid())) {
return {milliseconds: 0, months: 0};
}
other = cloneWithOffset(other, base);
if (base.isBefore(other)) {
res = positiveMomentsDifference(base, other);
} else {
res = positiveMomentsDifference(other, base);
res.milliseconds = -res.milliseconds;
res.months = -res.months;
}
return res;
}
// TODO: remove 'name' arg after deprecation is removed
function createAdder(direction, name) {
return function (val, period) {
var dur, tmp;
//invert the arguments, but complain about it
if (period !== null && !isNaN(+period)) {
deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
tmp = val; val = period; period = tmp;
}
val = typeof val === 'string' ? +val : val;
dur = createDuration(val, period);
addSubtract(this, dur, direction);
return this;
};
}
function addSubtract (mom, duration, isAdding, updateOffset) {
var milliseconds = duration._milliseconds,
days = absRound(duration._days),
months = absRound(duration._months);
if (!mom.isValid()) {
// No op
return;
}
updateOffset = updateOffset == null ? true : updateOffset;
if (milliseconds) {
mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
}
if (days) {
set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
}
if (months) {
setMonth(mom, get(mom, 'Month') + months * isAdding);
}
if (updateOffset) {
hooks.updateOffset(mom, days || months);
}
}
var add = createAdder(1, 'add');
var subtract = createAdder(-1, 'subtract');
function getCalendarFormat(myMoment, now) {
var diff = myMoment.diff(now, 'days', true);
return diff < -6 ? 'sameElse' :
diff < -1 ? 'lastWeek' :
diff < 0 ? 'lastDay' :
diff < 1 ? 'sameDay' :
diff < 2 ? 'nextDay' :
diff < 7 ? 'nextWeek' : 'sameElse';
}
function calendar$1 (time, formats) {
// We want to compare the start of today, vs this.
// Getting start-of-today depends on whether we're local/utc/offset or not.
var now = time || createLocal(),
sod = cloneWithOffset(now, this).startOf('day'),
format = hooks.calendarFormat(this, sod) || 'sameElse';
var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
}
function clone () {
return new Moment(this);
}
function isAfter (input, units) {
var localInput = isMoment(input) ? input : createLocal(input);
if (!(this.isValid() && localInput.isValid())) {
return false;
}
units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
if (units === 'millisecond') {
return this.valueOf() > localInput.valueOf();
} else {
return localInput.valueOf() < this.clone().startOf(units).valueOf();
}
}
function isBefore (input, units) {
var localInput = isMoment(input) ? input : createLocal(input);
if (!(this.isValid() && localInput.isValid())) {
return false;
}
units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
if (units === 'millisecond') {
return this.valueOf() < localInput.valueOf();
} else {
return this.clone().endOf(units).valueOf() < localInput.valueOf();
}
}
function isBetween (from, to, units, inclusivity) {
inclusivity = inclusivity || '()';
return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&
(inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));
}
function isSame (input, units) {
var localInput = isMoment(input) ? input : createLocal(input),
inputMs;
if (!(this.isValid() && localInput.isValid())) {
return false;
}
units = normalizeUnits(units || 'millisecond');
if (units === 'millisecond') {
return this.valueOf() === localInput.valueOf();
} else {
inputMs = localInput.valueOf();
return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
}
}
function isSameOrAfter (input, units) {
return this.isSame(input, units) || this.isAfter(input,units);
}
function isSameOrBefore (input, units) {
return this.isSame(input, units) || this.isBefore(input,units);
}
function diff (input, units, asFloat) {
var that,
zoneDelta,
delta, output;
if (!this.isValid()) {
return NaN;
}
that = cloneWithOffset(input, this);
if (!that.isValid()) {
return NaN;
}
zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
units = normalizeUnits(units);
if (units === 'year' || units === 'month' || units === 'quarter') {
output = monthDiff(this, that);
if (units === 'quarter') {
output = output / 3;
} else if (units === 'year') {
output = output / 12;
}
} else {
delta = this - that;
output = units === 'second' ? delta / 1e3 : // 1000
units === 'minute' ? delta / 6e4 : // 1000 * 60
units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60
units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
delta;
}
return asFloat ? output : absFloor(output);
}
function monthDiff (a, b) {
// difference in months
var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
// b is in (anchor - 1 month, anchor + 1 month)
anchor = a.clone().add(wholeMonthDiff, 'months'),
anchor2, adjust;
if (b - anchor < 0) {
anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
// linear across the month
adjust = (b - anchor) / (anchor - anchor2);
} else {
anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
// linear across the month
adjust = (b - anchor) / (anchor2 - anchor);
}
//check for negative zero, return zero if negative zero
return -(wholeMonthDiff + adjust) || 0;
}
hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
function toString () {
return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
}
function toISOString () {
var m = this.clone().utc();
if (0 < m.year() && m.year() <= 9999) {
if (isFunction(Date.prototype.toISOString)) {
// native implementation is ~50x faster, use it when we can
return this.toDate().toISOString();
} else {
return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
}
} else {
return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
}
}
/**
* Return a human readable representation of a moment that can
* also be evaluated to get a new moment which is the same
*
* @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
*/
function inspect () {
if (!this.isValid()) {
return 'moment.invalid(/* ' + this._i + ' */)';
}
var func = 'moment';
var zone = '';
if (!this.isLocal()) {
func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
zone = 'Z';
}
var prefix = '[' + func + '("]';
var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';
var datetime = '-MM-DD[T]HH:mm:ss.SSS';
var suffix = zone + '[")]';
return this.format(prefix + year + datetime + suffix);
}
function format (inputString) {
if (!inputString) {
inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
}
var output = formatMoment(this, inputString);
return this.localeData().postformat(output);
}
function from (time, withoutSuffix) {
if (this.isValid() &&
((isMoment(time) && time.isValid()) ||
createLocal(time).isValid())) {
return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
} else {
return this.localeData().invalidDate();
}
}
function fromNow (withoutSuffix) {
return this.from(createLocal(), withoutSuffix);
}
function to (time, withoutSuffix) {
if (this.isValid() &&
((isMoment(time) && time.isValid()) ||
createLocal(time).isValid())) {
return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
} else {
return this.localeData().invalidDate();
}
}
function toNow (withoutSuffix) {
return this.to(createLocal(), withoutSuffix);
}
// If passed a locale key, it will set the locale for this
// instance. Otherwise, it will return the locale configuration
// variables for this instance.
function locale (key) {
var newLocaleData;
if (key === undefined) {
return this._locale._abbr;
} else {
newLocaleData = getLocale(key);
if (newLocaleData != null) {
this._locale = newLocaleData;
}
return this;
}
}
var lang = deprecate(
'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
function (key) {
if (key === undefined) {
return this.localeData();
} else {
return this.locale(key);
}
}
);
function localeData () {
return this._locale;
}
function startOf (units) {
units = normalizeUnits(units);
// the following switch intentionally omits break keywords
// to utilize falling through the cases.
switch (units) {
case 'year':
this.month(0);
/* falls through */
case 'quarter':
case 'month':
this.date(1);
/* falls through */
case 'week':
case 'isoWeek':
case 'day':
case 'date':
this.hours(0);
/* falls through */
case 'hour':
this.minutes(0);
/* falls through */
case 'minute':
this.seconds(0);
/* falls through */
case 'second':
this.milliseconds(0);
}
// weeks are a special case
if (units === 'week') {
this.weekday(0);
}
if (units === 'isoWeek') {
this.isoWeekday(1);
}
// quarters are also special
if (units === 'quarter') {
this.month(Math.floor(this.month() / 3) * 3);
}
return this;
}
function endOf (units) {
units = normalizeUnits(units);
if (units === undefined || units === 'millisecond') {
return this;
}
// 'date' is an alias for 'day', so it should be considered as such.
if (units === 'date') {
units = 'day';
}
return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
}
function valueOf () {
return this._d.valueOf() - ((this._offset || 0) * 60000);
}
function unix () {
return Math.floor(this.valueOf() / 1000);
}
function toDate () {
return new Date(this.valueOf());
}
function toArray () {
var m = this;
return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
}
function toObject () {
var m = this;
return {
years: m.year(),
months: m.month(),
date: m.date(),
hours: m.hours(),
minutes: m.minutes(),
seconds: m.seconds(),
milliseconds: m.milliseconds()
};
}
function toJSON () {
// new Date(NaN).toJSON() === null
return this.isValid() ? this.toISOString() : null;
}
function isValid$1 () {
return isValid(this);
}
function parsingFlags () {
return extend({}, getParsingFlags(this));
}
function invalidAt () {
return getParsingFlags(this).overflow;
}
function creationData() {
return {
input: this._i,
format: this._f,
locale: this._locale,
isUTC: this._isUTC,
strict: this._strict
};
}
// FORMATTING
addFormatToken(0, ['gg', 2], 0, function () {
return this.weekYear() % 100;
});
addFormatToken(0, ['GG', 2], 0, function () {
return this.isoWeekYear() % 100;
});
function addWeekYearFormatToken (token, getter) {
addFormatToken(0, [token, token.length], 0, getter);
}
addWeekYearFormatToken('gggg', 'weekYear');
addWeekYearFormatToken('ggggg', 'weekYear');
addWeekYearFormatToken('GGGG', 'isoWeekYear');
addWeekYearFormatToken('GGGGG', 'isoWeekYear');
// ALIASES
addUnitAlias('weekYear', 'gg');
addUnitAlias('isoWeekYear', 'GG');
// PRIORITY
addUnitPriority('weekYear', 1);
addUnitPriority('isoWeekYear', 1);
// PARSING
addRegexToken('G', matchSigned);
addRegexToken('g', matchSigned);
addRegexToken('GG', match1to2, match2);
addRegexToken('gg', match1to2, match2);
addRegexToken('GGGG', match1to4, match4);
addRegexToken('gggg', match1to4, match4);
addRegexToken('GGGGG', match1to6, match6);
addRegexToken('ggggg', match1to6, match6);
addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
week[token.substr(0, 2)] = toInt(input);
});
addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
week[token] = hooks.parseTwoDigitYear(input);
});
// MOMENTS
function getSetWeekYear (input) {
return getSetWeekYearHelper.call(this,
input,
this.week(),
this.weekday(),
this.localeData()._week.dow,
this.localeData()._week.doy);
}
function getSetISOWeekYear (input) {
return getSetWeekYearHelper.call(this,
input, this.isoWeek(), this.isoWeekday(), 1, 4);
}
function getISOWeeksInYear () {
return weeksInYear(this.year(), 1, 4);
}
function getWeeksInYear () {
var weekInfo = this.localeData()._week;
return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
}
function getSetWeekYearHelper(input, week, weekday, dow, doy) {
var weeksTarget;
if (input == null) {
return weekOfYear(this, dow, doy).year;
} else {
weeksTarget = weeksInYear(input, dow, doy);
if (week > weeksTarget) {
week = weeksTarget;
}
return setWeekAll.call(this, input, week, weekday, dow, doy);
}
}
function setWeekAll(weekYear, week, weekday, dow, doy) {
var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
this.year(date.getUTCFullYear());
this.month(date.getUTCMonth());
this.date(date.getUTCDate());
return this;
}
// FORMATTING
addFormatToken('Q', 0, 'Qo', 'quarter');
// ALIASES
addUnitAlias('quarter', 'Q');
// PRIORITY
addUnitPriority('quarter', 7);
// PARSING
addRegexToken('Q', match1);
addParseToken('Q', function (input, array) {
array[MONTH] = (toInt(input) - 1) * 3;
});
// MOMENTS
function getSetQuarter (input) {
return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
}
// FORMATTING
addFormatToken('D', ['DD', 2], 'Do', 'date');
// ALIASES
addUnitAlias('date', 'D');
// PRIOROITY
addUnitPriority('date', 9);
// PARSING
addRegexToken('D', match1to2);
addRegexToken('DD', match1to2, match2);
addRegexToken('Do', function (isStrict, locale) {
return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;
});
addParseToken(['D', 'DD'], DATE);
addParseToken('Do', function (input, array) {
array[DATE] = toInt(input.match(match1to2)[0], 10);
});
// MOMENTS
var getSetDayOfMonth = makeGetSet('Date', true);
// FORMATTING
addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
// ALIASES
addUnitAlias('dayOfYear', 'DDD');
// PRIORITY
addUnitPriority('dayOfYear', 4);
// PARSING
addRegexToken('DDD', match1to3);
addRegexToken('DDDD', match3);
addParseToken(['DDD', 'DDDD'], function (input, array, config) {
config._dayOfYear = toInt(input);
});
// HELPERS
// MOMENTS
function getSetDayOfYear (input) {
var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
}
// FORMATTING
addFormatToken('m', ['mm', 2], 0, 'minute');
// ALIASES
addUnitAlias('minute', 'm');
// PRIORITY
addUnitPriority('minute', 14);
// PARSING
addRegexToken('m', match1to2);
addRegexToken('mm', match1to2, match2);
addParseToken(['m', 'mm'], MINUTE);
// MOMENTS
var getSetMinute = makeGetSet('Minutes', false);
// FORMATTING
addFormatToken('s', ['ss', 2], 0, 'second');
// ALIASES
addUnitAlias('second', 's');
// PRIORITY
addUnitPriority('second', 15);
// PARSING
addRegexToken('s', match1to2);
addRegexToken('ss', match1to2, match2);
addParseToken(['s', 'ss'], SECOND);
// MOMENTS
var getSetSecond = makeGetSet('Seconds', false);
// FORMATTING
addFormatToken('S', 0, 0, function () {
return ~~(this.millisecond() / 100);
});
addFormatToken(0, ['SS', 2], 0, function () {
return ~~(this.millisecond() / 10);
});
addFormatToken(0, ['SSS', 3], 0, 'millisecond');
addFormatToken(0, ['SSSS', 4], 0, function () {
return this.millisecond() * 10;
});
addFormatToken(0, ['SSSSS', 5], 0, function () {
return this.millisecond() * 100;
});
addFormatToken(0, ['SSSSSS', 6], 0, function () {
return this.millisecond() * 1000;
});
addFormatToken(0, ['SSSSSSS', 7], 0, function () {
return this.millisecond() * 10000;
});
addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
return this.millisecond() * 100000;
});
addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
return this.millisecond() * 1000000;
});
// ALIASES
addUnitAlias('millisecond', 'ms');
// PRIORITY
addUnitPriority('millisecond', 16);
// PARSING
addRegexToken('S', match1to3, match1);
addRegexToken('SS', match1to3, match2);
addRegexToken('SSS', match1to3, match3);
var token;
for (token = 'SSSS'; token.length <= 9; token += 'S') {
addRegexToken(token, matchUnsigned);
}
function parseMs(input, array) {
array[MILLISECOND] = toInt(('0.' + input) * 1000);
}
for (token = 'S'; token.length <= 9; token += 'S') {
addParseToken(token, parseMs);
}
// MOMENTS
var getSetMillisecond = makeGetSet('Milliseconds', false);
// FORMATTING
addFormatToken('z', 0, 0, 'zoneAbbr');
addFormatToken('zz', 0, 0, 'zoneName');
// MOMENTS
function getZoneAbbr () {
return this._isUTC ? 'UTC' : '';
}
function getZoneName () {
return this._isUTC ? 'Coordinated Universal Time' : '';
}
var proto = Moment.prototype;
proto.add = add;
proto.calendar = calendar$1;
proto.clone = clone;
proto.diff = diff;
proto.endOf = endOf;
proto.format = format;
proto.from = from;
proto.fromNow = fromNow;
proto.to = to;
proto.toNow = toNow;
proto.get = stringGet;
proto.invalidAt = invalidAt;
proto.isAfter = isAfter;
proto.isBefore = isBefore;
proto.isBetween = isBetween;
proto.isSame = isSame;
proto.isSameOrAfter = isSameOrAfter;
proto.isSameOrBefore = isSameOrBefore;
proto.isValid = isValid$1;
proto.lang = lang;
proto.locale = locale;
proto.localeData = localeData;
proto.max = prototypeMax;
proto.min = prototypeMin;
proto.parsingFlags = parsingFlags;
proto.set = stringSet;
proto.startOf = startOf;
proto.subtract = subtract;
proto.toArray = toArray;
proto.toObject = toObject;
proto.toDate = toDate;
proto.toISOString = toISOString;
proto.inspect = inspect;
proto.toJSON = toJSON;
proto.toString = toString;
proto.unix = unix;
proto.valueOf = valueOf;
proto.creationData = creationData;
// Year
proto.year = getSetYear;
proto.isLeapYear = getIsLeapYear;
// Week Year
proto.weekYear = getSetWeekYear;
proto.isoWeekYear = getSetISOWeekYear;
// Quarter
proto.quarter = proto.quarters = getSetQuarter;
// Month
proto.month = getSetMonth;
proto.daysInMonth = getDaysInMonth;
// Week
proto.week = proto.weeks = getSetWeek;
proto.isoWeek = proto.isoWeeks = getSetISOWeek;
proto.weeksInYear = getWeeksInYear;
proto.isoWeeksInYear = getISOWeeksInYear;
// Day
proto.date = getSetDayOfMonth;
proto.day = proto.days = getSetDayOfWeek;
proto.weekday = getSetLocaleDayOfWeek;
proto.isoWeekday = getSetISODayOfWeek;
proto.dayOfYear = getSetDayOfYear;
// Hour
proto.hour = proto.hours = getSetHour;
// Minute
proto.minute = proto.minutes = getSetMinute;
// Second
proto.second = proto.seconds = getSetSecond;
// Millisecond
proto.millisecond = proto.milliseconds = getSetMillisecond;
// Offset
proto.utcOffset = getSetOffset;
proto.utc = setOffsetToUTC;
proto.local = setOffsetToLocal;
proto.parseZone = setOffsetToParsedOffset;
proto.hasAlignedHourOffset = hasAlignedHourOffset;
proto.isDST = isDaylightSavingTime;
proto.isLocal = isLocal;
proto.isUtcOffset = isUtcOffset;
proto.isUtc = isUtc;
proto.isUTC = isUtc;
// Timezone
proto.zoneAbbr = getZoneAbbr;
proto.zoneName = getZoneName;
// Deprecations
proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
function createUnix (input) {
return createLocal(input * 1000);
}
function createInZone () {
return createLocal.apply(null, arguments).parseZone();
}
function preParsePostFormat (string) {
return string;
}
var proto$1 = Locale.prototype;
proto$1.calendar = calendar;
proto$1.longDateFormat = longDateFormat;
proto$1.invalidDate = invalidDate;
proto$1.ordinal = ordinal;
proto$1.preparse = preParsePostFormat;
proto$1.postformat = preParsePostFormat;
proto$1.relativeTime = relativeTime;
proto$1.pastFuture = pastFuture;
proto$1.set = set;
// Month
proto$1.months = localeMonths;
proto$1.monthsShort = localeMonthsShort;
proto$1.monthsParse = localeMonthsParse;
proto$1.monthsRegex = monthsRegex;
proto$1.monthsShortRegex = monthsShortRegex;
// Week
proto$1.week = localeWeek;
proto$1.firstDayOfYear = localeFirstDayOfYear;
proto$1.firstDayOfWeek = localeFirstDayOfWeek;
// Day of Week
proto$1.weekdays = localeWeekdays;
proto$1.weekdaysMin = localeWeekdaysMin;
proto$1.weekdaysShort = localeWeekdaysShort;
proto$1.weekdaysParse = localeWeekdaysParse;
proto$1.weekdaysRegex = weekdaysRegex;
proto$1.weekdaysShortRegex = weekdaysShortRegex;
proto$1.weekdaysMinRegex = weekdaysMinRegex;
// Hours
proto$1.isPM = localeIsPM;
proto$1.meridiem = localeMeridiem;
function get$1 (format, index, field, setter) {
var locale = getLocale();
var utc = createUTC().set(setter, index);
return locale[field](utc, format);
}
function listMonthsImpl (format, index, field) {
if (isNumber(format)) {
index = format;
format = undefined;
}
format = format || '';
if (index != null) {
return get$1(format, index, field, 'month');
}
var i;
var out = [];
for (i = 0; i < 12; i++) {
out[i] = get$1(format, i, field, 'month');
}
return out;
}
// ()
// (5)
// (fmt, 5)
// (fmt)
// (true)
// (true, 5)
// (true, fmt, 5)
// (true, fmt)
function listWeekdaysImpl (localeSorted, format, index, field) {
if (typeof localeSorted === 'boolean') {
if (isNumber(format)) {
index = format;
format = undefined;
}
format = format || '';
} else {
format = localeSorted;
index = format;
localeSorted = false;
if (isNumber(format)) {
index = format;
format = undefined;
}
format = format || '';
}
var locale = getLocale(),
shift = localeSorted ? locale._week.dow : 0;
if (index != null) {
return get$1(format, (index + shift) % 7, field, 'day');
}
var i;
var out = [];
for (i = 0; i < 7; i++) {
out[i] = get$1(format, (i + shift) % 7, field, 'day');
}
return out;
}
function listMonths (format, index) {
return listMonthsImpl(format, index, 'months');
}
function listMonthsShort (format, index) {
return listMonthsImpl(format, index, 'monthsShort');
}
function listWeekdays (localeSorted, format, index) {
return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
}
function listWeekdaysShort (localeSorted, format, index) {
return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
}
function listWeekdaysMin (localeSorted, format, index) {
return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
}
getSetGlobalLocale('en', {
ordinalParse: /\d{1,2}(th|st|nd|rd)/,
ordinal : function (number) {
var b = number % 10,
output = (toInt(number % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
return number + output;
}
});
// Side effect imports
hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);
hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);
var mathAbs = Math.abs;
function abs () {
var data = this._data;
this._milliseconds = mathAbs(this._milliseconds);
this._days = mathAbs(this._days);
this._months = mathAbs(this._months);
data.milliseconds = mathAbs(data.milliseconds);
data.seconds = mathAbs(data.seconds);
data.minutes = mathAbs(data.minutes);
data.hours = mathAbs(data.hours);
data.months = mathAbs(data.months);
data.years = mathAbs(data.years);
return this;
}
function addSubtract$1 (duration, input, value, direction) {
var other = createDuration(input, value);
duration._milliseconds += direction * other._milliseconds;
duration._days += direction * other._days;
duration._months += direction * other._months;
return duration._bubble();
}
// supports only 2.0-style add(1, 's') or add(duration)
function add$1 (input, value) {
return addSubtract$1(this, input, value, 1);
}
// supports only 2.0-style subtract(1, 's') or subtract(duration)
function subtract$1 (input, value) {
return addSubtract$1(this, input, value, -1);
}
function absCeil (number) {
if (number < 0) {
return Math.floor(number);
} else {
return Math.ceil(number);
}
}
function bubble () {
var milliseconds = this._milliseconds;
var days = this._days;
var months = this._months;
var data = this._data;
var seconds, minutes, hours, years, monthsFromDays;
// if we have a mix of positive and negative values, bubble down first
// check: https://github.com/moment/moment/issues/2166
if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
(milliseconds <= 0 && days <= 0 && months <= 0))) {
milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
days = 0;
months = 0;
}
// The following code bubbles up values, see the tests for
// examples of what that means.
data.milliseconds = milliseconds % 1000;
seconds = absFloor(milliseconds / 1000);
data.seconds = seconds % 60;
minutes = absFloor(seconds / 60);
data.minutes = minutes % 60;
hours = absFloor(minutes / 60);
data.hours = hours % 24;
days += absFloor(hours / 24);
// convert days to months
monthsFromDays = absFloor(daysToMonths(days));
months += monthsFromDays;
days -= absCeil(monthsToDays(monthsFromDays));
// 12 months -> 1 year
years = absFloor(months / 12);
months %= 12;
data.days = days;
data.months = months;
data.years = years;
return this;
}
function daysToMonths (days) {
// 400 years have 146097 days (taking into account leap year rules)
// 400 years have 12 months === 4800
return days * 4800 / 146097;
}
function monthsToDays (months) {
// the reverse of daysToMonths
return months * 146097 / 4800;
}
function as (units) {
var days;
var months;
var milliseconds = this._milliseconds;
units = normalizeUnits(units);
if (units === 'month' || units === 'year') {
days = this._days + milliseconds / 864e5;
months = this._months + daysToMonths(days);
return units === 'month' ? months : months / 12;
} else {
// handle milliseconds separately because of floating point math errors (issue #1867)
days = this._days + Math.round(monthsToDays(this._months));
switch (units) {
case 'week' : return days / 7 + milliseconds / 6048e5;
case 'day' : return days + milliseconds / 864e5;
case 'hour' : return days * 24 + milliseconds / 36e5;
case 'minute' : return days * 1440 + milliseconds / 6e4;
case 'second' : return days * 86400 + milliseconds / 1000;
// Math.floor prevents floating point math errors here
case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
default: throw new Error('Unknown unit ' + units);
}
}
}
// TODO: Use this.as('ms')?
function valueOf$1 () {
return (
this._milliseconds +
this._days * 864e5 +
(this._months % 12) * 2592e6 +
toInt(this._months / 12) * 31536e6
);
}
function makeAs (alias) {
return function () {
return this.as(alias);
};
}
var asMilliseconds = makeAs('ms');
var asSeconds = makeAs('s');
var asMinutes = makeAs('m');
var asHours = makeAs('h');
var asDays = makeAs('d');
var asWeeks = makeAs('w');
var asMonths = makeAs('M');
var asYears = makeAs('y');
function get$2 (units) {
units = normalizeUnits(units);
return this[units + 's']();
}
function makeGetter(name) {
return function () {
return this._data[name];
};
}
var milliseconds = makeGetter('milliseconds');
var seconds = makeGetter('seconds');
var minutes = makeGetter('minutes');
var hours = makeGetter('hours');
var days = makeGetter('days');
var months = makeGetter('months');
var years = makeGetter('years');
function weeks () {
return absFloor(this.days() / 7);
}
var round = Math.round;
var thresholds = {
s: 45, // seconds to minute
m: 45, // minutes to hour
h: 22, // hours to day
d: 26, // days to month
M: 11 // months to year
};
// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
}
function relativeTime$1 (posNegDuration, withoutSuffix, locale) {
var duration = createDuration(posNegDuration).abs();
var seconds = round(duration.as('s'));
var minutes = round(duration.as('m'));
var hours = round(duration.as('h'));
var days = round(duration.as('d'));
var months = round(duration.as('M'));
var years = round(duration.as('y'));
var a = seconds < thresholds.s && ['s', seconds] ||
minutes <= 1 && ['m'] ||
minutes < thresholds.m && ['mm', minutes] ||
hours <= 1 && ['h'] ||
hours < thresholds.h && ['hh', hours] ||
days <= 1 && ['d'] ||
days < thresholds.d && ['dd', days] ||
months <= 1 && ['M'] ||
months < thresholds.M && ['MM', months] ||
years <= 1 && ['y'] || ['yy', years];
a[2] = withoutSuffix;
a[3] = +posNegDuration > 0;
a[4] = locale;
return substituteTimeAgo.apply(null, a);
}
// This function allows you to set the rounding function for relative time strings
function getSetRelativeTimeRounding (roundingFunction) {
if (roundingFunction === undefined) {
return round;
}
if (typeof(roundingFunction) === 'function') {
round = roundingFunction;
return true;
}
return false;
}
// This function allows you to set a threshold for relative time strings
function getSetRelativeTimeThreshold (threshold, limit) {
if (thresholds[threshold] === undefined) {
return false;
}
if (limit === undefined) {
return thresholds[threshold];
}
thresholds[threshold] = limit;
return true;
}
function humanize (withSuffix) {
var locale = this.localeData();
var output = relativeTime$1(this, !withSuffix, locale);
if (withSuffix) {
output = locale.pastFuture(+this, output);
}
return locale.postformat(output);
}
var abs$1 = Math.abs;
function toISOString$1() {
// for ISO strings we do not use the normal bubbling rules:
// * milliseconds bubble up until they become hours
// * days do not bubble at all
// * months bubble up until they become years
// This is because there is no context-free conversion between hours and days
// (think of clock changes)
// and also not between days and months (28-31 days per month)
var seconds = abs$1(this._milliseconds) / 1000;
var days = abs$1(this._days);
var months = abs$1(this._months);
var minutes, hours, years;
// 3600 seconds -> 60 minutes -> 1 hour
minutes = absFloor(seconds / 60);
hours = absFloor(minutes / 60);
seconds %= 60;
minutes %= 60;
// 12 months -> 1 year
years = absFloor(months / 12);
months %= 12;
// inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
var Y = years;
var M = months;
var D = days;
var h = hours;
var m = minutes;
var s = seconds;
var total = this.asSeconds();
if (!total) {
// this is the same as C#'s (Noda) and python (isodate)...
// but not other JS (goog.date)
return 'P0D';
}
return (total < 0 ? '-' : '') +
'P' +
(Y ? Y + 'Y' : '') +
(M ? M + 'M' : '') +
(D ? D + 'D' : '') +
((h || m || s) ? 'T' : '') +
(h ? h + 'H' : '') +
(m ? m + 'M' : '') +
(s ? s + 'S' : '');
}
var proto$2 = Duration.prototype;
proto$2.abs = abs;
proto$2.add = add$1;
proto$2.subtract = subtract$1;
proto$2.as = as;
proto$2.asMilliseconds = asMilliseconds;
proto$2.asSeconds = asSeconds;
proto$2.asMinutes = asMinutes;
proto$2.asHours = asHours;
proto$2.asDays = asDays;
proto$2.asWeeks = asWeeks;
proto$2.asMonths = asMonths;
proto$2.asYears = asYears;
proto$2.valueOf = valueOf$1;
proto$2._bubble = bubble;
proto$2.get = get$2;
proto$2.milliseconds = milliseconds;
proto$2.seconds = seconds;
proto$2.minutes = minutes;
proto$2.hours = hours;
proto$2.days = days;
proto$2.weeks = weeks;
proto$2.months = months;
proto$2.years = years;
proto$2.humanize = humanize;
proto$2.toISOString = toISOString$1;
proto$2.toString = toISOString$1;
proto$2.toJSON = toISOString$1;
proto$2.locale = locale;
proto$2.localeData = localeData;
// Deprecations
proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);
proto$2.lang = lang;
// Side effect imports
// FORMATTING
addFormatToken('X', 0, 0, 'unix');
addFormatToken('x', 0, 0, 'valueOf');
// PARSING
addRegexToken('x', matchSigned);
addRegexToken('X', matchTimestamp);
addParseToken('X', function (input, array, config) {
config._d = new Date(parseFloat(input, 10) * 1000);
});
addParseToken('x', function (input, array, config) {
config._d = new Date(toInt(input));
});
// Side effect imports
hooks.version = '2.17.0';
setHookCallback(createLocal);
hooks.fn = proto;
hooks.min = min;
hooks.max = max;
hooks.now = now;
hooks.utc = createUTC;
hooks.unix = createUnix;
hooks.months = listMonths;
hooks.isDate = isDate;
hooks.locale = getSetGlobalLocale;
hooks.invalid = createInvalid;
hooks.duration = createDuration;
hooks.isMoment = isMoment;
hooks.weekdays = listWeekdays;
hooks.parseZone = createInZone;
hooks.localeData = getLocale;
hooks.isDuration = isDuration;
hooks.monthsShort = listMonthsShort;
hooks.weekdaysMin = listWeekdaysMin;
hooks.defineLocale = defineLocale;
hooks.updateLocale = updateLocale;
hooks.locales = listLocales;
hooks.weekdaysShort = listWeekdaysShort;
hooks.normalizeUnits = normalizeUnits;
hooks.relativeTimeRounding = getSetRelativeTimeRounding;
hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
hooks.calendarFormat = getCalendarFormat;
hooks.prototype = proto;
return hooks;
})));
| polonel/tdapp | www/lib/moment/moment.js | JavaScript | mit | 123,458 |
# Copyright 2011 Matt Chaput. All rights reserved.
#
# 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 above 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.
#
# THIS SOFTWARE IS PROVIDED BY MATT CHAPUT ``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 MATT CHAPUT 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 views and conclusions contained in the software and documentation are
# those of the authors and should not be interpreted as representing official
# policies, either expressed or implied, of Matt Chaput.
import sys, weakref
from whoosh import query
from whoosh.qparser.common import get_single_text, QueryParserError, attach
class SyntaxNode(object):
"""Base class for nodes that make up the abstract syntax tree (AST) of a
parsed user query string. The AST is an intermediate step, generated
from the query string, then converted into a :class:`whoosh.query.Query`
tree by calling the ``query()`` method on the nodes.
Instances have the following required attributes:
``has_fieldname``
True if this node has a ``fieldname`` attribute.
``has_text``
True if this node has a ``text`` attribute
``has_boost``
True if this node has a ``boost`` attribute.
``startchar``
The character position in the original text at which this node started.
``endchar``
The character position in the original text at which this node ended.
"""
has_fieldname = False
has_text = False
has_boost = False
_parent = None
def __repr__(self):
r = "<"
if self.has_fieldname:
r += "%r:" % self.fieldname
r += self.r()
if self.has_boost and self.boost != 1.0:
r += " ^%s" % self.boost
r += ">"
return r
def r(self):
"""Returns a basic representation of this node. The base class's
``__repr__`` method calls this, then does the extra busy work of adding
fieldname and boost where appropriate.
"""
return "%s %r" % (self.__class__.__name__, self.__dict__)
def apply(self, fn):
return self
def accept(self, fn):
def fn_wrapper(n):
return fn(n.apply(fn_wrapper))
return fn_wrapper(self)
def query(self, parser):
"""Returns a :class:`whoosh.query.Query` instance corresponding to this
syntax tree node.
"""
raise NotImplementedError(self.__class__.__name__)
def is_ws(self):
"""Returns True if this node is ignorable whitespace.
"""
return False
def is_text(self):
return False
def set_fieldname(self, name, override=False):
"""Sets the fieldname associated with this node. If ``override`` is
False (the default), the fieldname will only be replaced if this node
does not already have a fieldname set.
For nodes that don't have a fieldname, this is a no-op.
"""
if not self.has_fieldname:
return
if self.fieldname is None or override:
self.fieldname = name
return self
def set_boost(self, boost):
"""Sets the boost associated with this node.
For nodes that don't have a boost, this is a no-op.
"""
if not self.has_boost:
return
self.boost = boost
return self
def set_range(self, startchar, endchar):
"""Sets the character range associated with this node.
"""
self.startchar = startchar
self.endchar = endchar
return self
# Navigation methods
def parent(self):
if self._parent:
return self._parent()
def next_sibling(self):
p = self.parent()
if p:
return p.node_after(self)
def prev_sibling(self):
p = self.parent()
if p:
return p.node_before(self)
def bake(self, parent):
self._parent = weakref.ref(parent)
class MarkerNode(SyntaxNode):
"""Base class for nodes that only exist to mark places in the tree.
"""
def r(self):
return self.__class__.__name__
class Whitespace(MarkerNode):
"""Abstract syntax tree node for ignorable whitespace.
"""
def r(self):
return " "
def is_ws(self):
return True
class FieldnameNode(SyntaxNode):
"""Abstract syntax tree node for field name assignments.
"""
has_fieldname = True
def __init__(self, fieldname, original):
self.fieldname = fieldname
self.original = original
def __repr__(self):
return "<%r:>" % self.fieldname
class GroupNode(SyntaxNode):
"""Base class for abstract syntax tree node types that group together
sub-nodes.
Instances have the following attributes:
``merging``
True if side-by-side instances of this group can be merged into a
single group.
``qclass``
If a subclass doesn't override ``query()``, the base class will simply
wrap this class around the queries returned by the subnodes.
This class implements a number of list methods for operating on the
subnodes.
"""
has_boost = True
merging = True
qclass = None
def __init__(self, nodes=None, boost=1.0, **kwargs):
self.nodes = nodes or []
self.boost = boost
self.kwargs = kwargs
def r(self):
return "%s %s" % (self.__class__.__name__,
", ".join(repr(n) for n in self.nodes))
@property
def startchar(self):
if not self.nodes:
return None
return self.nodes[0].startchar
@property
def endchar(self):
if not self.nodes:
return None
return self.nodes[-1].endchar
def apply(self, fn):
return self.__class__(self.type, [fn(node) for node in self.nodes],
boost=self.boost, **self.kwargs)
def query(self, parser):
subs = []
for node in self.nodes:
subq = node.query(parser)
if subq is not None:
subs.append(subq)
q = self.qclass(subs, boost=self.boost, **self.kwargs)
return attach(q, self)
def empty_copy(self):
"""Returns an empty copy of this group.
This is used in the common pattern where a filter creates an new
group and then adds nodes from the input group to it if they meet
certain criteria, then returns the new group::
def remove_whitespace(parser, group):
newgroup = group.empty_copy()
for node in group:
if not node.is_ws():
newgroup.append(node)
return newgroup
"""
c = self.__class__(**self.kwargs)
if self.has_boost:
c.boost = self.boost
if self.has_fieldname:
c.fieldname = self.fieldname
if self.has_text:
c.text = self.text
return c
def set_fieldname(self, name, override=False):
SyntaxNode.set_fieldname(self, name, override=override)
for node in self.nodes:
node.set_fieldname(name, override=override)
def set_range(self, startchar, endchar):
for node in self.nodes:
node.set_range(startchar, endchar)
return self
# List-like methods
def __nonzero__(self):
return bool(self.nodes)
__bool__ = __nonzero__
def __iter__(self):
return iter(self.nodes)
def __len__(self):
return len(self.nodes)
def __getitem__(self, n):
return self.nodes.__getitem__(n)
def __setitem__(self, n, v):
self.nodes.__setitem__(n, v)
def __delitem__(self, n):
self.nodes.__delitem__(n)
def insert(self, n, v):
self.nodes.insert(n, v)
def append(self, v):
self.nodes.append(v)
def extend(self, vs):
self.nodes.extend(vs)
def pop(self, *args, **kwargs):
return self.nodes.pop(*args, **kwargs)
def reverse(self):
self.nodes.reverse()
def index(self, v):
return self.nodes.index(v)
# Navigation methods
def bake(self, parent):
SyntaxNode.bake(self, parent)
for node in self.nodes:
node.bake(self)
def node_before(self, n):
try:
i = self.nodes.index(n)
except ValueError:
return
if i > 0:
return self.nodes[i - 1]
def node_after(self, n):
try:
i = self.nodes.index(n)
except ValueError:
return
if i < len(self.nodes) - 2:
return self.nodes[i + 1]
class BinaryGroup(GroupNode):
"""Intermediate base class for group nodes that have two subnodes and
whose ``qclass`` initializer takes two arguments instead of a list.
"""
merging = False
has_boost = False
def query(self, parser):
assert len(self.nodes) == 2
qa = self.nodes[0].query(parser)
qb = self.nodes[1].query(parser)
if qa is None and qb is None:
q = query.NullQuery
elif qa is None:
q = qb
elif qb is None:
q = qa
else:
q = self.qclass(self.nodes[0].query(parser),
self.nodes[1].query(parser))
return attach(q, self)
class Wrapper(GroupNode):
"""Intermediate base class for nodes that wrap a single sub-node.
"""
merging = False
def query(self, parser):
q = self.nodes[0].query(parser)
if q:
return attach(self.qclass(q), self)
class ErrorNode(SyntaxNode):
def __init__(self, message, node=None):
self.message = message
self.node = node
def r(self):
return "ERR %r %r" % (self.node, self.message)
@property
def startchar(self):
return self.node.startchar
@property
def endchar(self):
return self.node.endchar
def query(self, parser):
if self.node:
q = self.node.query(parser)
else:
q = query.NullQuery
return attach(query.error_query(self.message, q), self)
class AndGroup(GroupNode):
qclass = query.And
class OrGroup(GroupNode):
qclass = query.Or
@classmethod
def factory(cls, scale=1.0):
def maker(nodes=None, **kwargs):
return cls(nodes=nodes, scale=scale, **kwargs)
return maker
class DisMaxGroup(GroupNode):
qclass = query.DisjunctionMax
class OrderedGroup(GroupNode):
qclass = query.Ordered
class AndNotGroup(BinaryGroup):
qclass = query.AndNot
class AndMaybeGroup(BinaryGroup):
qclass = query.AndMaybe
class RequireGroup(BinaryGroup):
qclass = query.Require
class NotGroup(Wrapper):
qclass = query.Not
class RangeNode(SyntaxNode):
"""Syntax node for range queries.
"""
has_fieldname = True
def __init__(self, start, end, startexcl, endexcl):
self.start = start
self.end = end
self.startexcl = startexcl
self.endexcl = endexcl
self.boost = 1.0
self.fieldname = None
self.kwargs = {}
def r(self):
b1 = "{" if self.startexcl else "["
b2 = "}" if self.endexcl else "]"
return "%s%r %r%s" % (b1, self.start, self.end, b2)
def query(self, parser):
fieldname = self.fieldname or parser.fieldname
start = self.start
end = self.end
if parser.schema and fieldname in parser.schema:
field = parser.schema[fieldname]
if field.self_parsing():
try:
q = field.parse_range(fieldname, start, end,
self.startexcl, self.endexcl,
boost=self.boost)
if q is not None:
return attach(q, self)
except QueryParserError:
e = sys.exc_info()[1]
return attach(query.error_query(e), self)
if start:
start = get_single_text(field, start, tokenize=False,
removestops=False)
if end:
end = get_single_text(field, end, tokenize=False,
removestops=False)
q = query.TermRange(fieldname, start, end, self.startexcl,
self.endexcl, boost=self.boost)
return attach(q, self)
class TextNode(SyntaxNode):
"""Intermediate base class for basic nodes that search for text, such as
term queries, wildcards, prefixes, etc.
Instances have the following attributes:
``qclass``
If a subclass does not override ``query()``, the base class will use
this class to construct the query.
``tokenize``
If True and the subclass does not override ``query()``, the node's text
will be tokenized before constructing the query
``removestops``
If True and the subclass does not override ``query()``, and the field's
analyzer has a stop word filter, stop words will be removed from the
text before constructing the query.
"""
has_fieldname = True
has_text = True
has_boost = True
qclass = None
tokenize = False
removestops = False
def __init__(self, text):
self.fieldname = None
self.text = text
self.boost = 1.0
def r(self):
return "%s %r" % (self.__class__.__name__, self.text)
def is_text(self):
return True
def query(self, parser):
fieldname = self.fieldname or parser.fieldname
termclass = self.qclass or parser.termclass
q = parser.term_query(fieldname, self.text, termclass,
boost=self.boost, tokenize=self.tokenize,
removestops=self.removestops)
return attach(q, self)
class WordNode(TextNode):
"""Syntax node for term queries.
"""
tokenize = True
removestops = True
def r(self):
return repr(self.text)
# Operators
class Operator(SyntaxNode):
"""Base class for PrefixOperator, PostfixOperator, and InfixOperator.
Operators work by moving the nodes they apply to (e.g. for prefix operator,
the previous node, for infix operator, the nodes on either side, etc.) into
a group node. The group provides the code for what to do with the nodes.
"""
def __init__(self, text, grouptype, leftassoc=True):
"""
:param text: the text of the operator in the query string.
:param grouptype: the type of group to create in place of the operator
and the node(s) it operates on.
:param leftassoc: for infix opeators, whether the operator is left
associative. use ``leftassoc=False`` for right-associative infix
operators.
"""
self.text = text
self.grouptype = grouptype
self.leftassoc = leftassoc
def r(self):
return "OP %r" % self.text
def replace_self(self, parser, group, position):
"""Called with the parser, a group, and the position at which the
operator occurs in that group. Should return a group with the operator
replaced by whatever effect the operator has (e.g. for an infix op,
replace the op and the nodes on either side with a sub-group).
"""
raise NotImplementedError
class PrefixOperator(Operator):
def replace_self(self, parser, group, position):
length = len(group)
del group[position]
if position < length - 1:
group[position] = self.grouptype([group[position]])
return position
class PostfixOperator(Operator):
def replace_self(self, parser, group, position):
del group[position]
if position > 0:
group[position - 1] = self.grouptype([group[position - 1]])
return position
class InfixOperator(Operator):
def replace_self(self, parser, group, position):
la = self.leftassoc
gtype = self.grouptype
merging = gtype.merging
if position > 0 and position < len(group) - 1:
left = group[position - 1]
right = group[position + 1]
# The first two clauses check whether the "strong" side is already
# a group of the type we are going to create. If it is, we just
# append the "weak" side to the "strong" side instead of creating
# a new group inside the existing one. This is necessary because
# we can quickly run into Python's recursion limit otherwise.
if merging and la and isinstance(left, gtype):
left.append(right)
del group[position:position + 2]
elif merging and not la and isinstance(right, gtype):
right.insert(0, left)
del group[position - 1:position + 1]
return position - 1
else:
# Replace the operator and the two surrounding objects
group[position - 1:position + 2] = [gtype([left, right])]
else:
del group[position]
return position
# Functions
def to_word(n):
node = WordNode(n.original)
node.startchar = n.startchar
node.endchar = n.endchar
return node
| jhona22baz/blog-flask | python2.7/lib/python2.7/site-packages/whoosh/qparser/syntax.py | Python | mit | 18,402 |
IntlPolyfill.__addLocaleData({locale:"gv-IM",date:{ca:["gregory","buddhist","chinese","coptic","dangi","ethioaa","ethiopic","generic","hebrew","indian","islamic","islamicc","japanese","persian","roc"],hourNo0:true,hour12:false,formats:{short:"{1} {0}",medium:"{1} {0}",full:"{1} {0}",long:"{1} {0}",availableFormats:{"d":"d","E":"ccc",Ed:"d, E",Ehm:"E h:mm a",EHm:"E HH:mm",Ehms:"E h:mm:ss a",EHms:"E HH:mm:ss",Gy:"G y",GyMMM:"G y MMM",GyMMMd:"G y MMM d",GyMMMEd:"G y MMM d, E","h":"h a","H":"HH",hm:"h:mm a",Hm:"HH:mm",hms:"h:mm:ss a",Hms:"HH:mm:ss",hmsv:"h:mm:ss a v",Hmsv:"HH:mm:ss v",hmv:"h:mm a v",Hmv:"HH:mm v","M":"L",Md:"MM-dd",MEd:"MM-dd, E",MMM:"LLL",MMMd:"MMM d",MMMEd:"MMM d, E",MMMMd:"MMMM d",ms:"mm:ss","y":"y",yM:"y-MM",yMd:"y-MM-dd",yMEd:"y-MM-dd, E",yMMM:"y MMM",yMMMd:"y MMM d",yMMMEd:"y MMM d, E",yMMMM:"y MMMM",yQQQ:"y QQQ",yQQQQ:"y QQQQ"},dateFormats:{yMMMMEEEEd:"y MMMM d, EEEE",yMMMMd:"y MMMM d",yMMMd:"y MMM d",yMd:"y-MM-dd"},timeFormats:{hmmsszzzz:"HH:mm:ss zzzz",hmsz:"HH:mm:ss z",hms:"HH:mm:ss",hm:"HH:mm"}},calendars:{buddhist:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["J-guer","T-arree","Mayrnt","Avrril","Boaldyn","M-souree","J-souree","Luanistyn","M-fouyir","J-fouyir","M-Houney","M-Nollick"],long:["Jerrey-geuree","Toshiaght-arree","Mayrnt","Averil","Boaldyn","Mean-souree","Jerrey-souree","Luanistyn","Mean-fouyir","Jerrey-fouyir","Mee Houney","Mee ny Nollick"]},days:{narrow:["S","M","T","W","T","F","S"],short:["Jed","Jel","Jem","Jerc","Jerd","Jeh","Jes"],long:["Jedoonee","Jelhein","Jemayrt","Jercean","Jerdein","Jeheiney","Jesarn"]},eras:{narrow:["BE"],short:["BE"],long:["BE"]},dayPeriods:{am:"a.m.",pm:"p.m."}},chinese:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"],long:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"]},days:{narrow:["S","M","T","W","T","F","S"],short:["Jed","Jel","Jem","Jerc","Jerd","Jeh","Jes"],long:["Jedoonee","Jelhein","Jemayrt","Jercean","Jerdein","Jeheiney","Jesarn"]},dayPeriods:{am:"a.m.",pm:"p.m."}},coptic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13"],short:["Tout","Baba","Hator","Kiahk","Toba","Amshir","Baramhat","Baramouda","Bashans","Paona","Epep","Mesra","Nasie"],long:["Tout","Baba","Hator","Kiahk","Toba","Amshir","Baramhat","Baramouda","Bashans","Paona","Epep","Mesra","Nasie"]},days:{narrow:["S","M","T","W","T","F","S"],short:["Jed","Jel","Jem","Jerc","Jerd","Jeh","Jes"],long:["Jedoonee","Jelhein","Jemayrt","Jercean","Jerdein","Jeheiney","Jesarn"]},eras:{narrow:["ERA0","ERA1"],short:["ERA0","ERA1"],long:["ERA0","ERA1"]},dayPeriods:{am:"a.m.",pm:"p.m."}},dangi:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"],long:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"]},days:{narrow:["S","M","T","W","T","F","S"],short:["Jed","Jel","Jem","Jerc","Jerd","Jeh","Jes"],long:["Jedoonee","Jelhein","Jemayrt","Jercean","Jerdein","Jeheiney","Jesarn"]},dayPeriods:{am:"a.m.",pm:"p.m."}},ethiopic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13"],short:["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"],long:["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"]},days:{narrow:["S","M","T","W","T","F","S"],short:["Jed","Jel","Jem","Jerc","Jerd","Jeh","Jes"],long:["Jedoonee","Jelhein","Jemayrt","Jercean","Jerdein","Jeheiney","Jesarn"]},eras:{narrow:["ERA0","ERA1"],short:["ERA0","ERA1"],long:["ERA0","ERA1"]},dayPeriods:{am:"a.m.",pm:"p.m."}},ethioaa:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13"],short:["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"],long:["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"]},days:{narrow:["S","M","T","W","T","F","S"],short:["Jed","Jel","Jem","Jerc","Jerd","Jeh","Jes"],long:["Jedoonee","Jelhein","Jemayrt","Jercean","Jerdein","Jeheiney","Jesarn"]},eras:{narrow:["ERA0"],short:["ERA0"],long:["ERA0"]},dayPeriods:{am:"a.m.",pm:"p.m."}},generic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"],long:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"]},days:{narrow:["S","M","T","W","T","F","S"],short:["Jed","Jel","Jem","Jerc","Jerd","Jeh","Jes"],long:["Jedoonee","Jelhein","Jemayrt","Jercean","Jerdein","Jeheiney","Jesarn"]},eras:{narrow:["ERA0","ERA1"],short:["ERA0","ERA1"],long:["ERA0","ERA1"]},dayPeriods:{am:"a.m.",pm:"p.m."}},gregory:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["J-guer","T-arree","Mayrnt","Avrril","Boaldyn","M-souree","J-souree","Luanistyn","M-fouyir","J-fouyir","M-Houney","M-Nollick"],long:["Jerrey-geuree","Toshiaght-arree","Mayrnt","Averil","Boaldyn","Mean-souree","Jerrey-souree","Luanistyn","Mean-fouyir","Jerrey-fouyir","Mee Houney","Mee ny Nollick"]},days:{narrow:["S","M","T","W","T","F","S"],short:["Jed","Jel","Jem","Jerc","Jerd","Jeh","Jes"],long:["Jedoonee","Jelhein","Jemayrt","Jercean","Jerdein","Jeheiney","Jesarn"]},eras:{narrow:["RC","AD","BCE","CE"],short:["RC","AD","BCE","CE"],long:["RC","AD","BCE","CE"]},dayPeriods:{am:"a.m.",pm:"p.m."}},hebrew:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13","7"],short:["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul","Adar II"],long:["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul","Adar II"]},days:{narrow:["S","M","T","W","T","F","S"],short:["Jed","Jel","Jem","Jerc","Jerd","Jeh","Jes"],long:["Jedoonee","Jelhein","Jemayrt","Jercean","Jerdein","Jeheiney","Jesarn"]},eras:{narrow:["AM"],short:["AM"],long:["AM"]},dayPeriods:{am:"a.m.",pm:"p.m."}},indian:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["Chaitra","Vaisakha","Jyaistha","Asadha","Sravana","Bhadra","Asvina","Kartika","Agrahayana","Pausa","Magha","Phalguna"],long:["Chaitra","Vaisakha","Jyaistha","Asadha","Sravana","Bhadra","Asvina","Kartika","Agrahayana","Pausa","Magha","Phalguna"]},days:{narrow:["S","M","T","W","T","F","S"],short:["Jed","Jel","Jem","Jerc","Jerd","Jeh","Jes"],long:["Jedoonee","Jelhein","Jemayrt","Jercean","Jerdein","Jeheiney","Jesarn"]},eras:{narrow:["Saka"],short:["Saka"],long:["Saka"]},dayPeriods:{am:"a.m.",pm:"p.m."}},islamic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],long:["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"]},days:{narrow:["S","M","T","W","T","F","S"],short:["Jed","Jel","Jem","Jerc","Jerd","Jeh","Jes"],long:["Jedoonee","Jelhein","Jemayrt","Jercean","Jerdein","Jeheiney","Jesarn"]},eras:{narrow:["AH"],short:["AH"],long:["AH"]},dayPeriods:{am:"a.m.",pm:"p.m."}},islamicc:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],long:["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"]},days:{narrow:["S","M","T","W","T","F","S"],short:["Jed","Jel","Jem","Jerc","Jerd","Jeh","Jes"],long:["Jedoonee","Jelhein","Jemayrt","Jercean","Jerdein","Jeheiney","Jesarn"]},eras:{narrow:["AH"],short:["AH"],long:["AH"]},dayPeriods:{am:"a.m.",pm:"p.m."}},japanese:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["J-guer","T-arree","Mayrnt","Avrril","Boaldyn","M-souree","J-souree","Luanistyn","M-fouyir","J-fouyir","M-Houney","M-Nollick"],long:["Jerrey-geuree","Toshiaght-arree","Mayrnt","Averil","Boaldyn","Mean-souree","Jerrey-souree","Luanistyn","Mean-fouyir","Jerrey-fouyir","Mee Houney","Mee ny Nollick"]},days:{narrow:["S","M","T","W","T","F","S"],short:["Jed","Jel","Jem","Jerc","Jerd","Jeh","Jes"],long:["Jedoonee","Jelhein","Jemayrt","Jercean","Jerdein","Jeheiney","Jesarn"]},eras:{narrow:["Taika (645–650)","Hakuchi (650–671)","Hakuhō (672–686)","Shuchō (686–701)","Taihō (701–704)","Keiun (704–708)","Wadō (708–715)","Reiki (715–717)","Yōrō (717–724)","Jinki (724–729)","Tenpyō (729–749)","Tenpyō-kampō (749-749)","Tenpyō-shōhō (749-757)","Tenpyō-hōji (757-765)","Tenpyō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770–780)","Ten-ō (781-782)","Enryaku (782–806)","Daidō (806–810)","Kōnin (810–824)","Tenchō (824–834)","Jōwa (834–848)","Kajō (848–851)","Ninju (851–854)","Saikō (854–857)","Ten-an (857-859)","Jōgan (859–877)","Gangyō (877–885)","Ninna (885–889)","Kanpyō (889–898)","Shōtai (898–901)","Engi (901–923)","Enchō (923–931)","Jōhei (931–938)","Tengyō (938–947)","Tenryaku (947–957)","Tentoku (957–961)","Ōwa (961–964)","Kōhō (964–968)","Anna (968–970)","Tenroku (970–973)","Ten’en (973–976)","Jōgen (976–978)","Tengen (978–983)","Eikan (983–985)","Kanna (985–987)","Eien (987–989)","Eiso (989–990)","Shōryaku (990–995)","Chōtoku (995–999)","Chōhō (999–1004)","Kankō (1004–1012)","Chōwa (1012–1017)","Kannin (1017–1021)","Jian (1021–1024)","Manju (1024–1028)","Chōgen (1028–1037)","Chōryaku (1037–1040)","Chōkyū (1040–1044)","Kantoku (1044–1046)","Eishō (1046–1053)","Tengi (1053–1058)","Kōhei (1058–1065)","Jiryaku (1065–1069)","Enkyū (1069–1074)","Shōho (1074–1077)","Shōryaku (1077–1081)","Eihō (1081–1084)","Ōtoku (1084–1087)","Kanji (1087–1094)","Kahō (1094–1096)","Eichō (1096–1097)","Jōtoku (1097–1099)","Kōwa (1099–1104)","Chōji (1104–1106)","Kashō (1106–1108)","Tennin (1108–1110)","Ten-ei (1110-1113)","Eikyū (1113–1118)","Gen’ei (1118–1120)","Hōan (1120–1124)","Tenji (1124–1126)","Daiji (1126–1131)","Tenshō (1131–1132)","Chōshō (1132–1135)","Hōen (1135–1141)","Eiji (1141–1142)","Kōji (1142–1144)","Ten’yō (1144–1145)","Kyūan (1145–1151)","Ninpei (1151–1154)","Kyūju (1154–1156)","Hōgen (1156–1159)","Heiji (1159–1160)","Eiryaku (1160–1161)","Ōho (1161–1163)","Chōkan (1163–1165)","Eiman (1165–1166)","Nin’an (1166–1169)","Kaō (1169–1171)","Shōan (1171–1175)","Angen (1175–1177)","Jishō (1177–1181)","Yōwa (1181–1182)","Juei (1182–1184)","Genryaku (1184–1185)","Bunji (1185–1190)","Kenkyū (1190–1199)","Shōji (1199–1201)","Kennin (1201–1204)","Genkyū (1204–1206)","Ken’ei (1206–1207)","Jōgen (1207–1211)","Kenryaku (1211–1213)","Kenpō (1213–1219)","Jōkyū (1219–1222)","Jōō (1222–1224)","Gennin (1224–1225)","Karoku (1225–1227)","Antei (1227–1229)","Kanki (1229–1232)","Jōei (1232–1233)","Tenpuku (1233–1234)","Bunryaku (1234–1235)","Katei (1235–1238)","Ryakunin (1238–1239)","En’ō (1239–1240)","Ninji (1240–1243)","Kangen (1243–1247)","Hōji (1247–1249)","Kenchō (1249–1256)","Kōgen (1256–1257)","Shōka (1257–1259)","Shōgen (1259–1260)","Bun’ō (1260–1261)","Kōchō (1261–1264)","Bun’ei (1264–1275)","Kenji (1275–1278)","Kōan (1278–1288)","Shōō (1288–1293)","Einin (1293–1299)","Shōan (1299–1302)","Kengen (1302–1303)","Kagen (1303–1306)","Tokuji (1306–1308)","Enkyō (1308–1311)","Ōchō (1311–1312)","Shōwa (1312–1317)","Bunpō (1317–1319)","Genō (1319–1321)","Genkō (1321–1324)","Shōchū (1324–1326)","Karyaku (1326–1329)","Gentoku (1329–1331)","Genkō (1331–1334)","Kenmu (1334–1336)","Engen (1336–1340)","Kōkoku (1340–1346)","Shōhei (1346–1370)","Kentoku (1370–1372)","Bunchū (1372–1375)","Tenju (1375–1379)","Kōryaku (1379–1381)","Kōwa (1381–1384)","Genchū (1384–1392)","Meitoku (1384–1387)","Kakei (1387–1389)","Kōō (1389–1390)","Meitoku (1390–1394)","Ōei (1394–1428)","Shōchō (1428–1429)","Eikyō (1429–1441)","Kakitsu (1441–1444)","Bun’an (1444–1449)","Hōtoku (1449–1452)","Kyōtoku (1452–1455)","Kōshō (1455–1457)","Chōroku (1457–1460)","Kanshō (1460–1466)","Bunshō (1466–1467)","Ōnin (1467–1469)","Bunmei (1469–1487)","Chōkyō (1487–1489)","Entoku (1489–1492)","Meiō (1492–1501)","Bunki (1501–1504)","Eishō (1504–1521)","Taiei (1521–1528)","Kyōroku (1528–1532)","Tenbun (1532–1555)","Kōji (1555–1558)","Eiroku (1558–1570)","Genki (1570–1573)","Tenshō (1573–1592)","Bunroku (1592–1596)","Keichō (1596–1615)","Genna (1615–1624)","Kan’ei (1624–1644)","Shōho (1644–1648)","Keian (1648–1652)","Jōō (1652–1655)","Meireki (1655–1658)","Manji (1658–1661)","Kanbun (1661–1673)","Enpō (1673–1681)","Tenna (1681–1684)","Jōkyō (1684–1688)","Genroku (1688–1704)","Hōei (1704–1711)","Shōtoku (1711–1716)","Kyōhō (1716–1736)","Genbun (1736–1741)","Kanpō (1741–1744)","Enkyō (1744–1748)","Kan’en (1748–1751)","Hōreki (1751–1764)","Meiwa (1764–1772)","An’ei (1772–1781)","Tenmei (1781–1789)","Kansei (1789–1801)","Kyōwa (1801–1804)","Bunka (1804–1818)","Bunsei (1818–1830)","Tenpō (1830–1844)","Kōka (1844–1848)","Kaei (1848–1854)","Ansei (1854–1860)","Man’en (1860–1861)","Bunkyū (1861–1864)","Genji (1864–1865)","Keiō (1865–1868)","M","T","S","H"],short:["Taika (645–650)","Hakuchi (650–671)","Hakuhō (672–686)","Shuchō (686–701)","Taihō (701–704)","Keiun (704–708)","Wadō (708–715)","Reiki (715–717)","Yōrō (717–724)","Jinki (724–729)","Tenpyō (729–749)","Tenpyō-kampō (749-749)","Tenpyō-shōhō (749-757)","Tenpyō-hōji (757-765)","Tenpyō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770–780)","Ten-ō (781-782)","Enryaku (782–806)","Daidō (806–810)","Kōnin (810–824)","Tenchō (824–834)","Jōwa (834–848)","Kajō (848–851)","Ninju (851–854)","Saikō (854–857)","Ten-an (857-859)","Jōgan (859–877)","Gangyō (877–885)","Ninna (885–889)","Kanpyō (889–898)","Shōtai (898–901)","Engi (901–923)","Enchō (923–931)","Jōhei (931–938)","Tengyō (938–947)","Tenryaku (947–957)","Tentoku (957–961)","Ōwa (961–964)","Kōhō (964–968)","Anna (968–970)","Tenroku (970–973)","Ten’en (973–976)","Jōgen (976–978)","Tengen (978–983)","Eikan (983–985)","Kanna (985–987)","Eien (987–989)","Eiso (989–990)","Shōryaku (990–995)","Chōtoku (995–999)","Chōhō (999–1004)","Kankō (1004–1012)","Chōwa (1012–1017)","Kannin (1017–1021)","Jian (1021–1024)","Manju (1024–1028)","Chōgen (1028–1037)","Chōryaku (1037–1040)","Chōkyū (1040–1044)","Kantoku (1044–1046)","Eishō (1046–1053)","Tengi (1053–1058)","Kōhei (1058–1065)","Jiryaku (1065–1069)","Enkyū (1069–1074)","Shōho (1074–1077)","Shōryaku (1077–1081)","Eihō (1081–1084)","Ōtoku (1084–1087)","Kanji (1087–1094)","Kahō (1094–1096)","Eichō (1096–1097)","Jōtoku (1097–1099)","Kōwa (1099–1104)","Chōji (1104–1106)","Kashō (1106–1108)","Tennin (1108–1110)","Ten-ei (1110-1113)","Eikyū (1113–1118)","Gen’ei (1118–1120)","Hōan (1120–1124)","Tenji (1124–1126)","Daiji (1126–1131)","Tenshō (1131–1132)","Chōshō (1132–1135)","Hōen (1135–1141)","Eiji (1141–1142)","Kōji (1142–1144)","Ten’yō (1144–1145)","Kyūan (1145–1151)","Ninpei (1151–1154)","Kyūju (1154–1156)","Hōgen (1156–1159)","Heiji (1159–1160)","Eiryaku (1160–1161)","Ōho (1161–1163)","Chōkan (1163–1165)","Eiman (1165–1166)","Nin’an (1166–1169)","Kaō (1169–1171)","Shōan (1171–1175)","Angen (1175–1177)","Jishō (1177–1181)","Yōwa (1181–1182)","Juei (1182–1184)","Genryaku (1184–1185)","Bunji (1185–1190)","Kenkyū (1190–1199)","Shōji (1199–1201)","Kennin (1201–1204)","Genkyū (1204–1206)","Ken’ei (1206–1207)","Jōgen (1207–1211)","Kenryaku (1211–1213)","Kenpō (1213–1219)","Jōkyū (1219–1222)","Jōō (1222–1224)","Gennin (1224–1225)","Karoku (1225–1227)","Antei (1227–1229)","Kanki (1229–1232)","Jōei (1232–1233)","Tenpuku (1233–1234)","Bunryaku (1234–1235)","Katei (1235–1238)","Ryakunin (1238–1239)","En’ō (1239–1240)","Ninji (1240–1243)","Kangen (1243–1247)","Hōji (1247–1249)","Kenchō (1249–1256)","Kōgen (1256–1257)","Shōka (1257–1259)","Shōgen (1259–1260)","Bun’ō (1260–1261)","Kōchō (1261–1264)","Bun’ei (1264–1275)","Kenji (1275–1278)","Kōan (1278–1288)","Shōō (1288–1293)","Einin (1293–1299)","Shōan (1299–1302)","Kengen (1302–1303)","Kagen (1303–1306)","Tokuji (1306–1308)","Enkyō (1308–1311)","Ōchō (1311–1312)","Shōwa (1312–1317)","Bunpō (1317–1319)","Genō (1319–1321)","Genkō (1321–1324)","Shōchū (1324–1326)","Karyaku (1326–1329)","Gentoku (1329–1331)","Genkō (1331–1334)","Kenmu (1334–1336)","Engen (1336–1340)","Kōkoku (1340–1346)","Shōhei (1346–1370)","Kentoku (1370–1372)","Bunchū (1372–1375)","Tenju (1375–1379)","Kōryaku (1379–1381)","Kōwa (1381–1384)","Genchū (1384–1392)","Meitoku (1384–1387)","Kakei (1387–1389)","Kōō (1389–1390)","Meitoku (1390–1394)","Ōei (1394–1428)","Shōchō (1428–1429)","Eikyō (1429–1441)","Kakitsu (1441–1444)","Bun’an (1444–1449)","Hōtoku (1449–1452)","Kyōtoku (1452–1455)","Kōshō (1455–1457)","Chōroku (1457–1460)","Kanshō (1460–1466)","Bunshō (1466–1467)","Ōnin (1467–1469)","Bunmei (1469–1487)","Chōkyō (1487–1489)","Entoku (1489–1492)","Meiō (1492–1501)","Bunki (1501–1504)","Eishō (1504–1521)","Taiei (1521–1528)","Kyōroku (1528–1532)","Tenbun (1532–1555)","Kōji (1555–1558)","Eiroku (1558–1570)","Genki (1570–1573)","Tenshō (1573–1592)","Bunroku (1592–1596)","Keichō (1596–1615)","Genna (1615–1624)","Kan’ei (1624–1644)","Shōho (1644–1648)","Keian (1648–1652)","Jōō (1652–1655)","Meireki (1655–1658)","Manji (1658–1661)","Kanbun (1661–1673)","Enpō (1673–1681)","Tenna (1681–1684)","Jōkyō (1684–1688)","Genroku (1688–1704)","Hōei (1704–1711)","Shōtoku (1711–1716)","Kyōhō (1716–1736)","Genbun (1736–1741)","Kanpō (1741–1744)","Enkyō (1744–1748)","Kan’en (1748–1751)","Hōreki (1751–1764)","Meiwa (1764–1772)","An’ei (1772–1781)","Tenmei (1781–1789)","Kansei (1789–1801)","Kyōwa (1801–1804)","Bunka (1804–1818)","Bunsei (1818–1830)","Tenpō (1830–1844)","Kōka (1844–1848)","Kaei (1848–1854)","Ansei (1854–1860)","Man’en (1860–1861)","Bunkyū (1861–1864)","Genji (1864–1865)","Keiō (1865–1868)","Meiji","Taishō","Shōwa","Heisei"],long:["Taika (645–650)","Hakuchi (650–671)","Hakuhō (672–686)","Shuchō (686–701)","Taihō (701–704)","Keiun (704–708)","Wadō (708–715)","Reiki (715–717)","Yōrō (717–724)","Jinki (724–729)","Tenpyō (729–749)","Tenpyō-kampō (749-749)","Tenpyō-shōhō (749-757)","Tenpyō-hōji (757-765)","Tenpyō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770–780)","Ten-ō (781-782)","Enryaku (782–806)","Daidō (806–810)","Kōnin (810–824)","Tenchō (824–834)","Jōwa (834–848)","Kajō (848–851)","Ninju (851–854)","Saikō (854–857)","Ten-an (857-859)","Jōgan (859–877)","Gangyō (877–885)","Ninna (885–889)","Kanpyō (889–898)","Shōtai (898–901)","Engi (901–923)","Enchō (923–931)","Jōhei (931–938)","Tengyō (938–947)","Tenryaku (947–957)","Tentoku (957–961)","Ōwa (961–964)","Kōhō (964–968)","Anna (968–970)","Tenroku (970–973)","Ten’en (973–976)","Jōgen (976–978)","Tengen (978–983)","Eikan (983–985)","Kanna (985–987)","Eien (987–989)","Eiso (989–990)","Shōryaku (990–995)","Chōtoku (995–999)","Chōhō (999–1004)","Kankō (1004–1012)","Chōwa (1012–1017)","Kannin (1017–1021)","Jian (1021–1024)","Manju (1024–1028)","Chōgen (1028–1037)","Chōryaku (1037–1040)","Chōkyū (1040–1044)","Kantoku (1044–1046)","Eishō (1046–1053)","Tengi (1053–1058)","Kōhei (1058–1065)","Jiryaku (1065–1069)","Enkyū (1069–1074)","Shōho (1074–1077)","Shōryaku (1077–1081)","Eihō (1081–1084)","Ōtoku (1084–1087)","Kanji (1087–1094)","Kahō (1094–1096)","Eichō (1096–1097)","Jōtoku (1097–1099)","Kōwa (1099–1104)","Chōji (1104–1106)","Kashō (1106–1108)","Tennin (1108–1110)","Ten-ei (1110-1113)","Eikyū (1113–1118)","Gen’ei (1118–1120)","Hōan (1120–1124)","Tenji (1124–1126)","Daiji (1126–1131)","Tenshō (1131–1132)","Chōshō (1132–1135)","Hōen (1135–1141)","Eiji (1141–1142)","Kōji (1142–1144)","Ten’yō (1144–1145)","Kyūan (1145–1151)","Ninpei (1151–1154)","Kyūju (1154–1156)","Hōgen (1156–1159)","Heiji (1159–1160)","Eiryaku (1160–1161)","Ōho (1161–1163)","Chōkan (1163–1165)","Eiman (1165–1166)","Nin’an (1166–1169)","Kaō (1169–1171)","Shōan (1171–1175)","Angen (1175–1177)","Jishō (1177–1181)","Yōwa (1181–1182)","Juei (1182–1184)","Genryaku (1184–1185)","Bunji (1185–1190)","Kenkyū (1190–1199)","Shōji (1199–1201)","Kennin (1201–1204)","Genkyū (1204–1206)","Ken’ei (1206–1207)","Jōgen (1207–1211)","Kenryaku (1211–1213)","Kenpō (1213–1219)","Jōkyū (1219–1222)","Jōō (1222–1224)","Gennin (1224–1225)","Karoku (1225–1227)","Antei (1227–1229)","Kanki (1229–1232)","Jōei (1232–1233)","Tenpuku (1233–1234)","Bunryaku (1234–1235)","Katei (1235–1238)","Ryakunin (1238–1239)","En’ō (1239–1240)","Ninji (1240–1243)","Kangen (1243–1247)","Hōji (1247–1249)","Kenchō (1249–1256)","Kōgen (1256–1257)","Shōka (1257–1259)","Shōgen (1259–1260)","Bun’ō (1260–1261)","Kōchō (1261–1264)","Bun’ei (1264–1275)","Kenji (1275–1278)","Kōan (1278–1288)","Shōō (1288–1293)","Einin (1293–1299)","Shōan (1299–1302)","Kengen (1302–1303)","Kagen (1303–1306)","Tokuji (1306–1308)","Enkyō (1308–1311)","Ōchō (1311–1312)","Shōwa (1312–1317)","Bunpō (1317–1319)","Genō (1319–1321)","Genkō (1321–1324)","Shōchū (1324–1326)","Karyaku (1326–1329)","Gentoku (1329–1331)","Genkō (1331–1334)","Kenmu (1334–1336)","Engen (1336–1340)","Kōkoku (1340–1346)","Shōhei (1346–1370)","Kentoku (1370–1372)","Bunchū (1372–1375)","Tenju (1375–1379)","Kōryaku (1379–1381)","Kōwa (1381–1384)","Genchū (1384–1392)","Meitoku (1384–1387)","Kakei (1387–1389)","Kōō (1389–1390)","Meitoku (1390–1394)","Ōei (1394–1428)","Shōchō (1428–1429)","Eikyō (1429–1441)","Kakitsu (1441–1444)","Bun’an (1444–1449)","Hōtoku (1449–1452)","Kyōtoku (1452–1455)","Kōshō (1455–1457)","Chōroku (1457–1460)","Kanshō (1460–1466)","Bunshō (1466–1467)","Ōnin (1467–1469)","Bunmei (1469–1487)","Chōkyō (1487–1489)","Entoku (1489–1492)","Meiō (1492–1501)","Bunki (1501–1504)","Eishō (1504–1521)","Taiei (1521–1528)","Kyōroku (1528–1532)","Tenbun (1532–1555)","Kōji (1555–1558)","Eiroku (1558–1570)","Genki (1570–1573)","Tenshō (1573–1592)","Bunroku (1592–1596)","Keichō (1596–1615)","Genna (1615–1624)","Kan’ei (1624–1644)","Shōho (1644–1648)","Keian (1648–1652)","Jōō (1652–1655)","Meireki (1655–1658)","Manji (1658–1661)","Kanbun (1661–1673)","Enpō (1673–1681)","Tenna (1681–1684)","Jōkyō (1684–1688)","Genroku (1688–1704)","Hōei (1704–1711)","Shōtoku (1711–1716)","Kyōhō (1716–1736)","Genbun (1736–1741)","Kanpō (1741–1744)","Enkyō (1744–1748)","Kan’en (1748–1751)","Hōreki (1751–1764)","Meiwa (1764–1772)","An’ei (1772–1781)","Tenmei (1781–1789)","Kansei (1789–1801)","Kyōwa (1801–1804)","Bunka (1804–1818)","Bunsei (1818–1830)","Tenpō (1830–1844)","Kōka (1844–1848)","Kaei (1848–1854)","Ansei (1854–1860)","Man’en (1860–1861)","Bunkyū (1861–1864)","Genji (1864–1865)","Keiō (1865–1868)","Meiji","Taishō","Shōwa","Heisei"]},dayPeriods:{am:"a.m.",pm:"p.m."}},persian:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],long:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"]},days:{narrow:["S","M","T","W","T","F","S"],short:["Jed","Jel","Jem","Jerc","Jerd","Jeh","Jes"],long:["Jedoonee","Jelhein","Jemayrt","Jercean","Jerdein","Jeheiney","Jesarn"]},eras:{narrow:["AP"],short:["AP"],long:["AP"]},dayPeriods:{am:"a.m.",pm:"p.m."}},roc:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["J-guer","T-arree","Mayrnt","Avrril","Boaldyn","M-souree","J-souree","Luanistyn","M-fouyir","J-fouyir","M-Houney","M-Nollick"],long:["Jerrey-geuree","Toshiaght-arree","Mayrnt","Averil","Boaldyn","Mean-souree","Jerrey-souree","Luanistyn","Mean-fouyir","Jerrey-fouyir","Mee Houney","Mee ny Nollick"]},days:{narrow:["S","M","T","W","T","F","S"],short:["Jed","Jel","Jem","Jerc","Jerd","Jeh","Jes"],long:["Jedoonee","Jelhein","Jemayrt","Jercean","Jerdein","Jeheiney","Jesarn"]},eras:{narrow:["Before R.O.C.","R.O.C."],short:["Before R.O.C.","R.O.C."],long:["Before R.O.C.","R.O.C."]},dayPeriods:{am:"a.m.",pm:"p.m."}}}},number:{nu:["latn"],patterns:{decimal:{positivePattern:"{number}",negativePattern:"{minusSign}{number}"},currency:{positivePattern:"{currency}{number}",negativePattern:"{minusSign}{currency}{number}"},percent:{positivePattern:"{number}{percentSign}",negativePattern:"{minusSign}{number}{percentSign}"}},symbols:{latn:{decimal:".",group:",",nan:"NaN",plusSign:"+",minusSign:"-",percentSign:"%",infinity:"∞"}},currencies:{AUD:"A$",BRL:"R$",CAD:"CA$",CNY:"CN¥",EUR:"€",GBP:"£",HKD:"HK$",ILS:"₪",INR:"₹",JPY:"JP¥",KRW:"₩",MXN:"MX$",NZD:"NZ$",TWD:"NT$",USD:"US$",VND:"₫",XAF:"FCFA",XCD:"EC$",XOF:"CFA",XPF:"CFPF"}}}); | MunGell/openshift-ghost-quickstart | node_modules/ghost/node_modules/intl/locale-data/jsonp/gv-IM.js | JavaScript | mit | 26,363 |
/* perfect-scrollbar v0.6.8 */
.ps-container {
-ms-touch-action: none;
overflow: hidden !important; }
.ps-container.ps-active-x > .ps-scrollbar-x-rail,
.ps-container.ps-active-y > .ps-scrollbar-y-rail {
display: block; }
.ps-container.ps-in-scrolling {
pointer-events: none; }
.ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail {
background-color: #eee;
opacity: 0.9; }
.ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail > .ps-scrollbar-x {
background-color: #999; }
.ps-container.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail {
background-color: #eee;
opacity: 0.9; }
.ps-container.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail > .ps-scrollbar-y {
background-color: #999; }
.ps-container > .ps-scrollbar-x-rail {
display: none;
position: absolute;
/* please don't change 'position' */
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px;
opacity: 0;
-webkit-transition: background-color 0.2s linear, opacity 0.2s linear;
-moz-transition: background-color 0.2s linear, opacity 0.2s linear;
-o-transition: background-color 0.2s linear, opacity 0.2s linear;
transition: background-color 0.2s linear, opacity 0.2s linear;
bottom: 3px;
/* there must be 'bottom' for ps-scrollbar-x-rail */
height: 8px; }
.ps-container > .ps-scrollbar-x-rail > .ps-scrollbar-x {
position: absolute;
/* please don't change 'position' */
background-color: #aaa;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px;
-webkit-transition: background-color 0.2s linear;
-moz-transition: background-color 0.2s linear;
-o-transition: background-color 0.2s linear;
transition: background-color 0.2s linear;
bottom: 0;
/* there must be 'bottom' for ps-scrollbar-x */
height: 8px; }
.ps-container > .ps-scrollbar-y-rail {
display: none;
position: absolute;
/* please don't change 'position' */
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px;
opacity: 0;
-webkit-transition: background-color 0.2s linear, opacity 0.2s linear;
-moz-transition: background-color 0.2s linear, opacity 0.2s linear;
-o-transition: background-color 0.2s linear, opacity 0.2s linear;
transition: background-color 0.2s linear, opacity 0.2s linear;
right: 3px;
/* there must be 'right' for ps-scrollbar-y-rail */
width: 8px; }
.ps-container > .ps-scrollbar-y-rail > .ps-scrollbar-y {
position: absolute;
/* please don't change 'position' */
background-color: #aaa;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px;
-webkit-transition: background-color 0.2s linear;
-moz-transition: background-color 0.2s linear;
-o-transition: background-color 0.2s linear;
transition: background-color 0.2s linear;
right: 0;
/* there must be 'right' for ps-scrollbar-y */
width: 8px; }
.ps-container:hover.ps-in-scrolling {
pointer-events: none; }
.ps-container:hover.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail {
background-color: #eee;
opacity: 0.9; }
.ps-container:hover.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail > .ps-scrollbar-x {
background-color: #999; }
.ps-container:hover.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail {
background-color: #eee;
opacity: 0.9; }
.ps-container:hover.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail > .ps-scrollbar-y {
background-color: #999; }
.ps-container:hover > .ps-scrollbar-x-rail,
.ps-container:hover > .ps-scrollbar-y-rail {
opacity: 0.6; }
.ps-container:hover > .ps-scrollbar-x-rail:hover {
background-color: #eee;
opacity: 0.9; }
.ps-container:hover > .ps-scrollbar-x-rail:hover > .ps-scrollbar-x {
background-color: #999; }
.ps-container:hover > .ps-scrollbar-y-rail:hover {
background-color: #eee;
opacity: 0.9; }
.ps-container:hover > .ps-scrollbar-y-rail:hover > .ps-scrollbar-y {
background-color: #999; }
| BenjaminVanRyseghem/cdnjs | ajax/libs/jquery.perfect-scrollbar/0.6.8/css/perfect-scrollbar.css | CSS | mit | 4,266 |
IntlPolyfill.__addLocaleData({locale:"uz-Latn",date:{ca:["gregory","buddhist","chinese","coptic","dangi","ethioaa","ethiopic","generic","hebrew","indian","islamic","islamicc","japanese","persian","roc"],hourNo0:true,hour12:false,formats:{short:"{1}, {0}",medium:"{1}, {0}",full:"{1}, {0}",long:"{1}, {0}",availableFormats:{"d":"d","E":"ccc",Ed:"d, E",Ehm:"E, h:mm a",EHm:"E, HH:mm",Ehms:"E, h:mm:ss a",EHms:"E, HH:mm:ss",Gy:"G y",GyMMM:"MMM, G y",GyMMMd:"d-MMM, G y",GyMMMEd:"E, d-MMM, G y","h":"h a","H":"HH",hm:"h:mm a",Hm:"HH:mm",hms:"h:mm:ss a",Hms:"HH:mm:ss",hmsv:"h:mm:ss (v)",Hmsv:"HH:mm:ss (v)",hmv:"h:mm (v)",Hmv:"HH:mm (v)","M":"LL",Md:"dd/MM",MEd:"E, dd/MM",MMM:"LLL",MMMd:"d-MMM",MMMEd:"E, d-MMM",MMMMd:"d-MMMM",ms:"mm:ss","y":"y",yM:"MM/y",yMd:"dd/MM/y",yMEd:"E, dd/MM/y",yMMM:"MMM, y",yMMMd:"d-MMM, y",yMMMEd:"E, d-MMM, y",yMMMM:"MMMM, y",yQQQ:"y, QQQ",yQQQQ:"y, QQQQ"},dateFormats:{yMMMMEEEEd:"EEEE, y MMMM dd",yMMMMd:"d-MMMM, y",yMMMd:"d-MMM, y",yMd:"dd/MM/yy"},timeFormats:{hmmsszzzz:"H:mm:ss (zzzz)",hmsz:"H:mm:ss (z)",hms:"HH:mm:ss",hm:"HH:mm"}},calendars:{buddhist:{months:{narrow:["Y","F","M","A","M","I","I","A","S","O","N","D"],short:["yan","fev","mar","apr","may","iyn","iyl","avg","sen","okt","noy","dek"],long:["yanvar","fevral","mart","aprel","may","iyun","iyul","avgust","Sentabr","Oktabr","noyabr","dekabr"]},days:{narrow:["Y","D","S","C","P","J","S"],short:["Ya","Du","Se","Ch","Pa","Ju","Sh"],long:["yakshanba","dushanba","seshanba","chorshanba","payshanba","juma","shanba"]},eras:{narrow:["BE"],short:["BE"],long:["BE"]},dayPeriods:{am:"TO",pm:"TK"}},chinese:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"],long:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"]},days:{narrow:["Y","D","S","C","P","J","S"],short:["Ya","Du","Se","Ch","Pa","Ju","Sh"],long:["yakshanba","dushanba","seshanba","chorshanba","payshanba","juma","shanba"]},dayPeriods:{am:"TO",pm:"TK"}},coptic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13"],short:["Tout","Baba","Hator","Kiahk","Toba","Amshir","Baramhat","Baramouda","Bashans","Paona","Epep","Mesra","Nasie"],long:["Tout","Baba","Hator","Kiahk","Toba","Amshir","Baramhat","Baramouda","Bashans","Paona","Epep","Mesra","Nasie"]},days:{narrow:["Y","D","S","C","P","J","S"],short:["Ya","Du","Se","Ch","Pa","Ju","Sh"],long:["yakshanba","dushanba","seshanba","chorshanba","payshanba","juma","shanba"]},eras:{narrow:["ERA0","ERA1"],short:["ERA0","ERA1"],long:["ERA0","ERA1"]},dayPeriods:{am:"TO",pm:"TK"}},dangi:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"],long:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"]},days:{narrow:["Y","D","S","C","P","J","S"],short:["Ya","Du","Se","Ch","Pa","Ju","Sh"],long:["yakshanba","dushanba","seshanba","chorshanba","payshanba","juma","shanba"]},dayPeriods:{am:"TO",pm:"TK"}},ethiopic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13"],short:["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"],long:["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"]},days:{narrow:["Y","D","S","C","P","J","S"],short:["Ya","Du","Se","Ch","Pa","Ju","Sh"],long:["yakshanba","dushanba","seshanba","chorshanba","payshanba","juma","shanba"]},eras:{narrow:["ERA0","ERA1"],short:["ERA0","ERA1"],long:["ERA0","ERA1"]},dayPeriods:{am:"TO",pm:"TK"}},ethioaa:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13"],short:["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"],long:["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"]},days:{narrow:["Y","D","S","C","P","J","S"],short:["Ya","Du","Se","Ch","Pa","Ju","Sh"],long:["yakshanba","dushanba","seshanba","chorshanba","payshanba","juma","shanba"]},eras:{narrow:["ERA0"],short:["ERA0"],long:["ERA0"]},dayPeriods:{am:"TO",pm:"TK"}},generic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"],long:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"]},days:{narrow:["Y","D","S","C","P","J","S"],short:["Ya","Du","Se","Ch","Pa","Ju","Sh"],long:["yakshanba","dushanba","seshanba","chorshanba","payshanba","juma","shanba"]},eras:{narrow:["ERA0","ERA1"],short:["ERA0","ERA1"],long:["ERA0","ERA1"]},dayPeriods:{am:"TO",pm:"TK"}},gregory:{months:{narrow:["Y","F","M","A","M","I","I","A","S","O","N","D"],short:["yan","fev","mar","apr","may","iyn","iyl","avg","sen","okt","noy","dek"],long:["yanvar","fevral","mart","aprel","may","iyun","iyul","avgust","Sentabr","Oktabr","noyabr","dekabr"]},days:{narrow:["Y","D","S","C","P","J","S"],short:["Ya","Du","Se","Ch","Pa","Ju","Sh"],long:["yakshanba","dushanba","seshanba","chorshanba","payshanba","juma","shanba"]},eras:{narrow:["m.a.","milodiy","e.a.","CE"],short:["m.a.","milodiy","e.a.","CE"],long:["miloddan avvalgi","milodiy","eramizdan avvalgi","CE"]},dayPeriods:{am:"TO",pm:"TK"}},hebrew:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13","7"],short:["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul","Adar II"],long:["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul","Adar II"]},days:{narrow:["Y","D","S","C","P","J","S"],short:["Ya","Du","Se","Ch","Pa","Ju","Sh"],long:["yakshanba","dushanba","seshanba","chorshanba","payshanba","juma","shanba"]},eras:{narrow:["AM"],short:["AM"],long:["AM"]},dayPeriods:{am:"TO",pm:"TK"}},indian:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["Chaitra","Vaisakha","Jyaistha","Asadha","Sravana","Bhadra","Asvina","Kartika","Agrahayana","Pausa","Magha","Phalguna"],long:["Chaitra","Vaisakha","Jyaistha","Asadha","Sravana","Bhadra","Asvina","Kartika","Agrahayana","Pausa","Magha","Phalguna"]},days:{narrow:["Y","D","S","C","P","J","S"],short:["Ya","Du","Se","Ch","Pa","Ju","Sh"],long:["yakshanba","dushanba","seshanba","chorshanba","payshanba","juma","shanba"]},eras:{narrow:["Saka"],short:["Saka"],long:["Saka"]},dayPeriods:{am:"TO",pm:"TK"}},islamic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],long:["Muharram","Safar","Robiʼ ul-avval","Robiʼ ul-oxir","Jumad ul-avval","Jumad ul-oxir","Rajab","Shaʼbon","Ramazon","Shavvol","Zul-qaʼda","Zul-hijja"]},days:{narrow:["Y","D","S","C","P","J","S"],short:["Ya","Du","Se","Ch","Pa","Ju","Sh"],long:["yakshanba","dushanba","seshanba","chorshanba","payshanba","juma","shanba"]},eras:{narrow:["AH"],short:["AH"],long:["AH"]},dayPeriods:{am:"TO",pm:"TK"}},islamicc:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],long:["Muharram","Safar","Robiʼ ul-avval","Robiʼ ul-oxir","Jumad ul-avval","Jumad ul-oxir","Rajab","Shaʼbon","Ramazon","Shavvol","Zul-qaʼda","Zul-hijja"]},days:{narrow:["Y","D","S","C","P","J","S"],short:["Ya","Du","Se","Ch","Pa","Ju","Sh"],long:["yakshanba","dushanba","seshanba","chorshanba","payshanba","juma","shanba"]},eras:{narrow:["AH"],short:["AH"],long:["AH"]},dayPeriods:{am:"TO",pm:"TK"}},japanese:{months:{narrow:["Y","F","M","A","M","I","I","A","S","O","N","D"],short:["yan","fev","mar","apr","may","iyn","iyl","avg","sen","okt","noy","dek"],long:["yanvar","fevral","mart","aprel","may","iyun","iyul","avgust","Sentabr","Oktabr","noyabr","dekabr"]},days:{narrow:["Y","D","S","C","P","J","S"],short:["Ya","Du","Se","Ch","Pa","Ju","Sh"],long:["yakshanba","dushanba","seshanba","chorshanba","payshanba","juma","shanba"]},eras:{narrow:["Taika (645–650)","Hakuchi (650–671)","Hakuhō (672–686)","Shuchō (686–701)","Taihō (701–704)","Keiun (704–708)","Wadō (708–715)","Reiki (715–717)","Yōrō (717–724)","Jinki (724–729)","Tenpyō (729–749)","Tenpyō-kampō (749-749)","Tenpyō-shōhō (749-757)","Tenpyō-hōji (757-765)","Tenpyō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770–780)","Ten-ō (781-782)","Enryaku (782–806)","Daidō (806–810)","Kōnin (810–824)","Tenchō (824–834)","Jōwa (834–848)","Kajō (848–851)","Ninju (851–854)","Saikō (854–857)","Ten-an (857-859)","Jōgan (859–877)","Gangyō (877–885)","Ninna (885–889)","Kanpyō (889–898)","Shōtai (898–901)","Engi (901–923)","Enchō (923–931)","Jōhei (931–938)","Tengyō (938–947)","Tenryaku (947–957)","Tentoku (957–961)","Ōwa (961–964)","Kōhō (964–968)","Anna (968–970)","Tenroku (970–973)","Ten’en (973–976)","Jōgen (976–978)","Tengen (978–983)","Eikan (983–985)","Kanna (985–987)","Eien (987–989)","Eiso (989–990)","Shōryaku (990–995)","Chōtoku (995–999)","Chōhō (999–1004)","Kankō (1004–1012)","Chōwa (1012–1017)","Kannin (1017–1021)","Jian (1021–1024)","Manju (1024–1028)","Chōgen (1028–1037)","Chōryaku (1037–1040)","Chōkyū (1040–1044)","Kantoku (1044–1046)","Eishō (1046–1053)","Tengi (1053–1058)","Kōhei (1058–1065)","Jiryaku (1065–1069)","Enkyū (1069–1074)","Shōho (1074–1077)","Shōryaku (1077–1081)","Eihō (1081–1084)","Ōtoku (1084–1087)","Kanji (1087–1094)","Kahō (1094–1096)","Eichō (1096–1097)","Jōtoku (1097–1099)","Kōwa (1099–1104)","Chōji (1104–1106)","Kashō (1106–1108)","Tennin (1108–1110)","Ten-ei (1110-1113)","Eikyū (1113–1118)","Gen’ei (1118–1120)","Hōan (1120–1124)","Tenji (1124–1126)","Daiji (1126–1131)","Tenshō (1131–1132)","Chōshō (1132–1135)","Hōen (1135–1141)","Eiji (1141–1142)","Kōji (1142–1144)","Ten’yō (1144–1145)","Kyūan (1145–1151)","Ninpei (1151–1154)","Kyūju (1154–1156)","Hōgen (1156–1159)","Heiji (1159–1160)","Eiryaku (1160–1161)","Ōho (1161–1163)","Chōkan (1163–1165)","Eiman (1165–1166)","Nin’an (1166–1169)","Kaō (1169–1171)","Shōan (1171–1175)","Angen (1175–1177)","Jishō (1177–1181)","Yōwa (1181–1182)","Juei (1182–1184)","Genryaku (1184–1185)","Bunji (1185–1190)","Kenkyū (1190–1199)","Shōji (1199–1201)","Kennin (1201–1204)","Genkyū (1204–1206)","Ken’ei (1206–1207)","Jōgen (1207–1211)","Kenryaku (1211–1213)","Kenpō (1213–1219)","Jōkyū (1219–1222)","Jōō (1222–1224)","Gennin (1224–1225)","Karoku (1225–1227)","Antei (1227–1229)","Kanki (1229–1232)","Jōei (1232–1233)","Tenpuku (1233–1234)","Bunryaku (1234–1235)","Katei (1235–1238)","Ryakunin (1238–1239)","En’ō (1239–1240)","Ninji (1240–1243)","Kangen (1243–1247)","Hōji (1247–1249)","Kenchō (1249–1256)","Kōgen (1256–1257)","Shōka (1257–1259)","Shōgen (1259–1260)","Bun’ō (1260–1261)","Kōchō (1261–1264)","Bun’ei (1264–1275)","Kenji (1275–1278)","Kōan (1278–1288)","Shōō (1288–1293)","Einin (1293–1299)","Shōan (1299–1302)","Kengen (1302–1303)","Kagen (1303–1306)","Tokuji (1306–1308)","Enkyō (1308–1311)","Ōchō (1311–1312)","Shōwa (1312–1317)","Bunpō (1317–1319)","Genō (1319–1321)","Genkō (1321–1324)","Shōchū (1324–1326)","Karyaku (1326–1329)","Gentoku (1329–1331)","Genkō (1331–1334)","Kenmu (1334–1336)","Engen (1336–1340)","Kōkoku (1340–1346)","Shōhei (1346–1370)","Kentoku (1370–1372)","Bunchū (1372–1375)","Tenju (1375–1379)","Kōryaku (1379–1381)","Kōwa (1381–1384)","Genchū (1384–1392)","Meitoku (1384–1387)","Kakei (1387–1389)","Kōō (1389–1390)","Meitoku (1390–1394)","Ōei (1394–1428)","Shōchō (1428–1429)","Eikyō (1429–1441)","Kakitsu (1441–1444)","Bun’an (1444–1449)","Hōtoku (1449–1452)","Kyōtoku (1452–1455)","Kōshō (1455–1457)","Chōroku (1457–1460)","Kanshō (1460–1466)","Bunshō (1466–1467)","Ōnin (1467–1469)","Bunmei (1469–1487)","Chōkyō (1487–1489)","Entoku (1489–1492)","Meiō (1492–1501)","Bunki (1501–1504)","Eishō (1504–1521)","Taiei (1521–1528)","Kyōroku (1528–1532)","Tenbun (1532–1555)","Kōji (1555–1558)","Eiroku (1558–1570)","Genki (1570–1573)","Tenshō (1573–1592)","Bunroku (1592–1596)","Keichō (1596–1615)","Genna (1615–1624)","Kan’ei (1624–1644)","Shōho (1644–1648)","Keian (1648–1652)","Jōō (1652–1655)","Meireki (1655–1658)","Manji (1658–1661)","Kanbun (1661–1673)","Enpō (1673–1681)","Tenna (1681–1684)","Jōkyō (1684–1688)","Genroku (1688–1704)","Hōei (1704–1711)","Shōtoku (1711–1716)","Kyōhō (1716–1736)","Genbun (1736–1741)","Kanpō (1741–1744)","Enkyō (1744–1748)","Kan’en (1748–1751)","Hōreki (1751–1764)","Meiwa (1764–1772)","An’ei (1772–1781)","Tenmei (1781–1789)","Kansei (1789–1801)","Kyōwa (1801–1804)","Bunka (1804–1818)","Bunsei (1818–1830)","Tenpō (1830–1844)","Kōka (1844–1848)","Kaei (1848–1854)","Ansei (1854–1860)","Man’en (1860–1861)","Bunkyū (1861–1864)","Genji (1864–1865)","Keiō (1865–1868)","M","T","S","H"],short:["Taika (645–650)","Hakuchi (650–671)","Hakuhō (672–686)","Shuchō (686–701)","Taihō (701–704)","Keiun (704–708)","Wadō (708–715)","Reiki (715–717)","Yōrō (717–724)","Jinki (724–729)","Tenpyō (729–749)","Tenpyō-kampō (749-749)","Tenpyō-shōhō (749-757)","Tenpyō-hōji (757-765)","Tenpyō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770–780)","Ten-ō (781-782)","Enryaku (782–806)","Daidō (806–810)","Kōnin (810–824)","Tenchō (824–834)","Jōwa (834–848)","Kajō (848–851)","Ninju (851–854)","Saikō (854–857)","Ten-an (857-859)","Jōgan (859–877)","Gangyō (877–885)","Ninna (885–889)","Kanpyō (889–898)","Shōtai (898–901)","Engi (901–923)","Enchō (923–931)","Jōhei (931–938)","Tengyō (938–947)","Tenryaku (947–957)","Tentoku (957–961)","Ōwa (961–964)","Kōhō (964–968)","Anna (968–970)","Tenroku (970–973)","Ten’en (973–976)","Jōgen (976–978)","Tengen (978–983)","Eikan (983–985)","Kanna (985–987)","Eien (987–989)","Eiso (989–990)","Shōryaku (990–995)","Chōtoku (995–999)","Chōhō (999–1004)","Kankō (1004–1012)","Chōwa (1012–1017)","Kannin (1017–1021)","Jian (1021–1024)","Manju (1024–1028)","Chōgen (1028–1037)","Chōryaku (1037–1040)","Chōkyū (1040–1044)","Kantoku (1044–1046)","Eishō (1046–1053)","Tengi (1053–1058)","Kōhei (1058–1065)","Jiryaku (1065–1069)","Enkyū (1069–1074)","Shōho (1074–1077)","Shōryaku (1077–1081)","Eihō (1081–1084)","Ōtoku (1084–1087)","Kanji (1087–1094)","Kahō (1094–1096)","Eichō (1096–1097)","Jōtoku (1097–1099)","Kōwa (1099–1104)","Chōji (1104–1106)","Kashō (1106–1108)","Tennin (1108–1110)","Ten-ei (1110-1113)","Eikyū (1113–1118)","Gen’ei (1118–1120)","Hōan (1120–1124)","Tenji (1124–1126)","Daiji (1126–1131)","Tenshō (1131–1132)","Chōshō (1132–1135)","Hōen (1135–1141)","Eiji (1141–1142)","Kōji (1142–1144)","Ten’yō (1144–1145)","Kyūan (1145–1151)","Ninpei (1151–1154)","Kyūju (1154–1156)","Hōgen (1156–1159)","Heiji (1159–1160)","Eiryaku (1160–1161)","Ōho (1161–1163)","Chōkan (1163–1165)","Eiman (1165–1166)","Nin’an (1166–1169)","Kaō (1169–1171)","Shōan (1171–1175)","Angen (1175–1177)","Jishō (1177–1181)","Yōwa (1181–1182)","Juei (1182–1184)","Genryaku (1184–1185)","Bunji (1185–1190)","Kenkyū (1190–1199)","Shōji (1199–1201)","Kennin (1201–1204)","Genkyū (1204–1206)","Ken’ei (1206–1207)","Jōgen (1207–1211)","Kenryaku (1211–1213)","Kenpō (1213–1219)","Jōkyū (1219–1222)","Jōō (1222–1224)","Gennin (1224–1225)","Karoku (1225–1227)","Antei (1227–1229)","Kanki (1229–1232)","Jōei (1232–1233)","Tenpuku (1233–1234)","Bunryaku (1234–1235)","Katei (1235–1238)","Ryakunin (1238–1239)","En’ō (1239–1240)","Ninji (1240–1243)","Kangen (1243–1247)","Hōji (1247–1249)","Kenchō (1249–1256)","Kōgen (1256–1257)","Shōka (1257–1259)","Shōgen (1259–1260)","Bun’ō (1260–1261)","Kōchō (1261–1264)","Bun’ei (1264–1275)","Kenji (1275–1278)","Kōan (1278–1288)","Shōō (1288–1293)","Einin (1293–1299)","Shōan (1299–1302)","Kengen (1302–1303)","Kagen (1303–1306)","Tokuji (1306–1308)","Enkyō (1308–1311)","Ōchō (1311–1312)","Shōwa (1312–1317)","Bunpō (1317–1319)","Genō (1319–1321)","Genkō (1321–1324)","Shōchū (1324–1326)","Karyaku (1326–1329)","Gentoku (1329–1331)","Genkō (1331–1334)","Kenmu (1334–1336)","Engen (1336–1340)","Kōkoku (1340–1346)","Shōhei (1346–1370)","Kentoku (1370–1372)","Bunchū (1372–1375)","Tenju (1375–1379)","Kōryaku (1379–1381)","Kōwa (1381–1384)","Genchū (1384–1392)","Meitoku (1384–1387)","Kakei (1387–1389)","Kōō (1389–1390)","Meitoku (1390–1394)","Ōei (1394–1428)","Shōchō (1428–1429)","Eikyō (1429–1441)","Kakitsu (1441–1444)","Bun’an (1444–1449)","Hōtoku (1449–1452)","Kyōtoku (1452–1455)","Kōshō (1455–1457)","Chōroku (1457–1460)","Kanshō (1460–1466)","Bunshō (1466–1467)","Ōnin (1467–1469)","Bunmei (1469–1487)","Chōkyō (1487–1489)","Entoku (1489–1492)","Meiō (1492–1501)","Bunki (1501–1504)","Eishō (1504–1521)","Taiei (1521–1528)","Kyōroku (1528–1532)","Tenbun (1532–1555)","Kōji (1555–1558)","Eiroku (1558–1570)","Genki (1570–1573)","Tenshō (1573–1592)","Bunroku (1592–1596)","Keichō (1596–1615)","Genna (1615–1624)","Kan’ei (1624–1644)","Shōho (1644–1648)","Keian (1648–1652)","Jōō (1652–1655)","Meireki (1655–1658)","Manji (1658–1661)","Kanbun (1661–1673)","Enpō (1673–1681)","Tenna (1681–1684)","Jōkyō (1684–1688)","Genroku (1688–1704)","Hōei (1704–1711)","Shōtoku (1711–1716)","Kyōhō (1716–1736)","Genbun (1736–1741)","Kanpō (1741–1744)","Enkyō (1744–1748)","Kan’en (1748–1751)","Hōreki (1751–1764)","Meiwa (1764–1772)","An’ei (1772–1781)","Tenmei (1781–1789)","Kansei (1789–1801)","Kyōwa (1801–1804)","Bunka (1804–1818)","Bunsei (1818–1830)","Tenpō (1830–1844)","Kōka (1844–1848)","Kaei (1848–1854)","Ansei (1854–1860)","Man’en (1860–1861)","Bunkyū (1861–1864)","Genji (1864–1865)","Keiō (1865–1868)","Meiji","Taishō","Shōwa","Heisei"],long:["Taika (645–650)","Hakuchi (650–671)","Hakuhō (672–686)","Shuchō (686–701)","Taihō (701–704)","Keiun (704–708)","Wadō (708–715)","Reiki (715–717)","Yōrō (717–724)","Jinki (724–729)","Tenpyō (729–749)","Tenpyō-kampō (749-749)","Tenpyō-shōhō (749-757)","Tenpyō-hōji (757-765)","Tenpyō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770–780)","Ten-ō (781-782)","Enryaku (782–806)","Daidō (806–810)","Kōnin (810–824)","Tenchō (824–834)","Jōwa (834–848)","Kajō (848–851)","Ninju (851–854)","Saikō (854–857)","Ten-an (857-859)","Jōgan (859–877)","Gangyō (877–885)","Ninna (885–889)","Kanpyō (889–898)","Shōtai (898–901)","Engi (901–923)","Enchō (923–931)","Jōhei (931–938)","Tengyō (938–947)","Tenryaku (947–957)","Tentoku (957–961)","Ōwa (961–964)","Kōhō (964–968)","Anna (968–970)","Tenroku (970–973)","Ten’en (973–976)","Jōgen (976–978)","Tengen (978–983)","Eikan (983–985)","Kanna (985–987)","Eien (987–989)","Eiso (989–990)","Shōryaku (990–995)","Chōtoku (995–999)","Chōhō (999–1004)","Kankō (1004–1012)","Chōwa (1012–1017)","Kannin (1017–1021)","Jian (1021–1024)","Manju (1024–1028)","Chōgen (1028–1037)","Chōryaku (1037–1040)","Chōkyū (1040–1044)","Kantoku (1044–1046)","Eishō (1046–1053)","Tengi (1053–1058)","Kōhei (1058–1065)","Jiryaku (1065–1069)","Enkyū (1069–1074)","Shōho (1074–1077)","Shōryaku (1077–1081)","Eihō (1081–1084)","Ōtoku (1084–1087)","Kanji (1087–1094)","Kahō (1094–1096)","Eichō (1096–1097)","Jōtoku (1097–1099)","Kōwa (1099–1104)","Chōji (1104–1106)","Kashō (1106–1108)","Tennin (1108–1110)","Ten-ei (1110-1113)","Eikyū (1113–1118)","Gen’ei (1118–1120)","Hōan (1120–1124)","Tenji (1124–1126)","Daiji (1126–1131)","Tenshō (1131–1132)","Chōshō (1132–1135)","Hōen (1135–1141)","Eiji (1141–1142)","Kōji (1142–1144)","Ten’yō (1144–1145)","Kyūan (1145–1151)","Ninpei (1151–1154)","Kyūju (1154–1156)","Hōgen (1156–1159)","Heiji (1159–1160)","Eiryaku (1160–1161)","Ōho (1161–1163)","Chōkan (1163–1165)","Eiman (1165–1166)","Nin’an (1166–1169)","Kaō (1169–1171)","Shōan (1171–1175)","Angen (1175–1177)","Jishō (1177–1181)","Yōwa (1181–1182)","Juei (1182–1184)","Genryaku (1184–1185)","Bunji (1185–1190)","Kenkyū (1190–1199)","Shōji (1199–1201)","Kennin (1201–1204)","Genkyū (1204–1206)","Ken’ei (1206–1207)","Jōgen (1207–1211)","Kenryaku (1211–1213)","Kenpō (1213–1219)","Jōkyū (1219–1222)","Jōō (1222–1224)","Gennin (1224–1225)","Karoku (1225–1227)","Antei (1227–1229)","Kanki (1229–1232)","Jōei (1232–1233)","Tenpuku (1233–1234)","Bunryaku (1234–1235)","Katei (1235–1238)","Ryakunin (1238–1239)","En’ō (1239–1240)","Ninji (1240–1243)","Kangen (1243–1247)","Hōji (1247–1249)","Kenchō (1249–1256)","Kōgen (1256–1257)","Shōka (1257–1259)","Shōgen (1259–1260)","Bun’ō (1260–1261)","Kōchō (1261–1264)","Bun’ei (1264–1275)","Kenji (1275–1278)","Kōan (1278–1288)","Shōō (1288–1293)","Einin (1293–1299)","Shōan (1299–1302)","Kengen (1302–1303)","Kagen (1303–1306)","Tokuji (1306–1308)","Enkyō (1308–1311)","Ōchō (1311–1312)","Shōwa (1312–1317)","Bunpō (1317–1319)","Genō (1319–1321)","Genkō (1321–1324)","Shōchū (1324–1326)","Karyaku (1326–1329)","Gentoku (1329–1331)","Genkō (1331–1334)","Kenmu (1334–1336)","Engen (1336–1340)","Kōkoku (1340–1346)","Shōhei (1346–1370)","Kentoku (1370–1372)","Bunchū (1372–1375)","Tenju (1375–1379)","Kōryaku (1379–1381)","Kōwa (1381–1384)","Genchū (1384–1392)","Meitoku (1384–1387)","Kakei (1387–1389)","Kōō (1389–1390)","Meitoku (1390–1394)","Ōei (1394–1428)","Shōchō (1428–1429)","Eikyō (1429–1441)","Kakitsu (1441–1444)","Bun’an (1444–1449)","Hōtoku (1449–1452)","Kyōtoku (1452–1455)","Kōshō (1455–1457)","Chōroku (1457–1460)","Kanshō (1460–1466)","Bunshō (1466–1467)","Ōnin (1467–1469)","Bunmei (1469–1487)","Chōkyō (1487–1489)","Entoku (1489–1492)","Meiō (1492–1501)","Bunki (1501–1504)","Eishō (1504–1521)","Taiei (1521–1528)","Kyōroku (1528–1532)","Tenbun (1532–1555)","Kōji (1555–1558)","Eiroku (1558–1570)","Genki (1570–1573)","Tenshō (1573–1592)","Bunroku (1592–1596)","Keichō (1596–1615)","Genna (1615–1624)","Kan’ei (1624–1644)","Shōho (1644–1648)","Keian (1648–1652)","Jōō (1652–1655)","Meireki (1655–1658)","Manji (1658–1661)","Kanbun (1661–1673)","Enpō (1673–1681)","Tenna (1681–1684)","Jōkyō (1684–1688)","Genroku (1688–1704)","Hōei (1704–1711)","Shōtoku (1711–1716)","Kyōhō (1716–1736)","Genbun (1736–1741)","Kanpō (1741–1744)","Enkyō (1744–1748)","Kan’en (1748–1751)","Hōreki (1751–1764)","Meiwa (1764–1772)","An’ei (1772–1781)","Tenmei (1781–1789)","Kansei (1789–1801)","Kyōwa (1801–1804)","Bunka (1804–1818)","Bunsei (1818–1830)","Tenpō (1830–1844)","Kōka (1844–1848)","Kaei (1848–1854)","Ansei (1854–1860)","Man’en (1860–1861)","Bunkyū (1861–1864)","Genji (1864–1865)","Keiō (1865–1868)","Meiji","Taishō","Shōwa","Heisei"]},dayPeriods:{am:"TO",pm:"TK"}},persian:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],long:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"]},days:{narrow:["Y","D","S","C","P","J","S"],short:["Ya","Du","Se","Ch","Pa","Ju","Sh"],long:["yakshanba","dushanba","seshanba","chorshanba","payshanba","juma","shanba"]},eras:{narrow:["AP"],short:["AP"],long:["AP"]},dayPeriods:{am:"TO",pm:"TK"}},roc:{months:{narrow:["Y","F","M","A","M","I","I","A","S","O","N","D"],short:["yan","fev","mar","apr","may","iyn","iyl","avg","sen","okt","noy","dek"],long:["yanvar","fevral","mart","aprel","may","iyun","iyul","avgust","Sentabr","Oktabr","noyabr","dekabr"]},days:{narrow:["Y","D","S","C","P","J","S"],short:["Ya","Du","Se","Ch","Pa","Ju","Sh"],long:["yakshanba","dushanba","seshanba","chorshanba","payshanba","juma","shanba"]},eras:{narrow:["Before R.O.C.","R.O.C."],short:["Before R.O.C.","R.O.C."],long:["Before R.O.C.","R.O.C."]},dayPeriods:{am:"TO",pm:"TK"}}}},number:{nu:["latn"],patterns:{decimal:{positivePattern:"{number}",negativePattern:"{minusSign}{number}"},currency:{positivePattern:"{number} {currency}",negativePattern:"{minusSign}{number} {currency}"},percent:{positivePattern:"{number}{percentSign}",negativePattern:"{minusSign}{number}{percentSign}"}},symbols:{latn:{decimal:",",group:" ",nan:"haqiqiy son emas",plusSign:"+",minusSign:"-",percentSign:"%",infinity:"∞"}},currencies:{AUD:"A$",BRL:"R$",CAD:"CA$",CNY:"CN¥",EUR:"€",GBP:"£",HKD:"HK$",ILS:"₪",INR:"₹",JPY:"JP¥",KRW:"₩",MXN:"MX$",NZD:"NZ$",TWD:"NT$",USD:"US$",UZS:"soʻm",VND:"₫",XAF:"FCFA",XCD:"EC$",XOF:"CFA",XPF:"CFPF"}}}); | EdwardStudy/myghostblog | versions/1.25.7/node_modules/intl/locale-data/jsonp/uz-Latn.js | JavaScript | mit | 25,879 |
<?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\HttpKernel\Tests\DataCollector;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Debug\Exception\SilencedErrorContext;
use Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector;
use Symfony\Component\VarDumper\Cloner\Data;
class LoggerDataCollectorTest extends TestCase
{
private static $data;
/**
* @dataProvider getCollectTestData
*/
public function testCollect($nb, $logs, $expectedLogs, $expectedDeprecationCount, $expectedScreamCount, $expectedPriorities = null)
{
$logger = $this->getMockBuilder('Symfony\Component\HttpKernel\Log\DebugLoggerInterface')->getMock();
$logger->expects($this->once())->method('countErrors')->will($this->returnValue($nb));
$logger->expects($this->exactly(2))->method('getLogs')->will($this->returnValue($logs));
// disable cloning the context, to ease fixtures creation.
$c = $this->getMockBuilder(LoggerDataCollector::class)
->setMethods(array('cloneVar'))
->setConstructorArgs(array($logger))
->getMock();
$c->expects($this->any())->method('cloneVar')->willReturn(self::$data);
$c->lateCollect();
$this->assertEquals('logger', $c->getName());
$this->assertEquals($nb, $c->countErrors());
$this->assertEquals($expectedLogs, $c->getLogs());
$this->assertEquals($expectedDeprecationCount, $c->countDeprecations());
$this->assertEquals($expectedScreamCount, $c->countScreams());
if (isset($expectedPriorities)) {
$this->assertSame($expectedPriorities, $c->getPriorities());
}
}
public function getCollectTestData()
{
if (null === self::$data) {
self::$data = new Data(array());
}
yield 'simple log' => array(
1,
array(array('message' => 'foo', 'context' => array(), 'priority' => 100, 'priorityName' => 'DEBUG')),
array(array('message' => 'foo', 'context' => array(), 'priority' => 100, 'priorityName' => 'DEBUG')),
0,
0,
);
yield 'log with a context' => array(
1,
array(array('message' => 'foo', 'context' => array('foo' => 'bar'), 'priority' => 100, 'priorityName' => 'DEBUG')),
array(array('message' => 'foo', 'context' => self::$data, 'priority' => 100, 'priorityName' => 'DEBUG')),
0,
0,
);
if (!class_exists(SilencedErrorContext::class)) {
return;
}
yield 'logs with some deprecations' => array(
1,
array(
array('message' => 'foo3', 'context' => array('exception' => new \ErrorException('warning', 0, E_USER_WARNING)), 'priority' => 100, 'priorityName' => 'DEBUG'),
array('message' => 'foo', 'context' => array('exception' => new \ErrorException('deprecated', 0, E_DEPRECATED)), 'priority' => 100, 'priorityName' => 'DEBUG'),
array('message' => 'foo2', 'context' => array('exception' => new \ErrorException('deprecated', 0, E_USER_DEPRECATED)), 'priority' => 100, 'priorityName' => 'DEBUG'),
),
array(
array('message' => 'foo3', 'context' => self::$data, 'priority' => 100, 'priorityName' => 'DEBUG'),
array('message' => 'foo', 'context' => self::$data, 'priority' => 100, 'priorityName' => 'DEBUG', 'errorCount' => 1, 'scream' => false),
array('message' => 'foo2', 'context' => self::$data, 'priority' => 100, 'priorityName' => 'DEBUG', 'errorCount' => 1, 'scream' => false),
),
2,
0,
array(100 => array('count' => 3, 'name' => 'DEBUG')),
);
yield 'logs with some silent errors' => array(
1,
array(
array('message' => 'foo3', 'context' => array('exception' => new \ErrorException('warning', 0, E_USER_WARNING)), 'priority' => 100, 'priorityName' => 'DEBUG'),
array('message' => 'foo3', 'context' => array('exception' => new SilencedErrorContext(E_USER_WARNING, __FILE__, __LINE__)), 'priority' => 100, 'priorityName' => 'DEBUG'),
),
array(
array('message' => 'foo3', 'context' => self::$data, 'priority' => 100, 'priorityName' => 'DEBUG'),
array('message' => 'foo3', 'context' => self::$data, 'priority' => 100, 'priorityName' => 'DEBUG', 'errorCount' => 1, 'scream' => true),
),
0,
1,
);
}
}
| AziziNidhal/formation | vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php | PHP | mit | 4,807 |
IntlPolyfill.__addLocaleData({locale:"guz",date:{ca:["gregory","buddhist","chinese","coptic","dangi","ethioaa","ethiopic","generic","hebrew","indian","islamic","islamicc","japanese","persian","roc"],hourNo0:true,hour12:false,formats:{short:"{1} {0}",medium:"{1} {0}",full:"{1} {0}",long:"{1} {0}",availableFormats:{"d":"d","E":"ccc",Ed:"d, E",Ehm:"E h:mm a",EHm:"E HH:mm",Ehms:"E h:mm:ss a",EHms:"E HH:mm:ss",Gy:"G y",GyMMM:"G y MMM",GyMMMd:"G y MMM d",GyMMMEd:"G y MMM d, E","h":"h a","H":"HH",hm:"h:mm a",Hm:"HH:mm",hms:"h:mm:ss a",Hms:"HH:mm:ss",hmsv:"h:mm:ss a v",Hmsv:"HH:mm:ss v",hmv:"h:mm a v",Hmv:"HH:mm v","M":"L",Md:"M/d",MEd:"E, M/d",MMM:"LLL",MMMd:"MMM d",MMMEd:"E, MMM d",MMMMd:"MMMM d",MMMMEd:"E, MMMM d",ms:"mm:ss","y":"y",yM:"M/y",yMd:"y-MM-dd",yMEd:"E, M/d/y",yMMM:"MMM y",yMMMd:"y MMM d",yMMMEd:"E, MMM d, y",yMMMM:"MMMM y",yQQQ:"QQQ y",yQQQQ:"QQQQ y"},dateFormats:{yMMMMEEEEd:"EEEE, d MMMM y",yMMMMd:"d MMMM y",yMMMd:"d MMM y",yMd:"dd/MM/y"},timeFormats:{hmmsszzzz:"HH:mm:ss zzzz",hmsz:"HH:mm:ss z",hms:"HH:mm:ss",hm:"HH:mm"}},calendars:{buddhist:{months:{narrow:["C","F","M","A","M","J","C","A","S","O","N","D"],short:["Can","Feb","Mac","Apr","Mei","Jun","Cul","Agt","Sep","Okt","Nob","Dis"],long:["Chanuari","Feburari","Machi","Apiriri","Mei","Juni","Chulai","Agosti","Septemba","Okitoba","Nobemba","Disemba"]},days:{narrow:["C","C","C","C","A","I","E"],short:["Cpr","Ctt","Cmn","Cmt","Ars","Icm","Est"],long:["Chumapiri","Chumatato","Chumaine","Chumatano","Aramisi","Ichuma","Esabato"]},eras:{narrow:["BE"],short:["BE"],long:["BE"]},dayPeriods:{am:"Ma/Mo",pm:"Mambia/Mog"}},chinese:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"],long:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"]},days:{narrow:["C","C","C","C","A","I","E"],short:["Cpr","Ctt","Cmn","Cmt","Ars","Icm","Est"],long:["Chumapiri","Chumatato","Chumaine","Chumatano","Aramisi","Ichuma","Esabato"]},dayPeriods:{am:"Ma/Mo",pm:"Mambia/Mog"}},coptic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13"],short:["Tout","Baba","Hator","Kiahk","Toba","Amshir","Baramhat","Baramouda","Bashans","Paona","Epep","Mesra","Nasie"],long:["Tout","Baba","Hator","Kiahk","Toba","Amshir","Baramhat","Baramouda","Bashans","Paona","Epep","Mesra","Nasie"]},days:{narrow:["C","C","C","C","A","I","E"],short:["Cpr","Ctt","Cmn","Cmt","Ars","Icm","Est"],long:["Chumapiri","Chumatato","Chumaine","Chumatano","Aramisi","Ichuma","Esabato"]},eras:{narrow:["ERA0","ERA1"],short:["ERA0","ERA1"],long:["ERA0","ERA1"]},dayPeriods:{am:"Ma/Mo",pm:"Mambia/Mog"}},dangi:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"],long:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"]},days:{narrow:["C","C","C","C","A","I","E"],short:["Cpr","Ctt","Cmn","Cmt","Ars","Icm","Est"],long:["Chumapiri","Chumatato","Chumaine","Chumatano","Aramisi","Ichuma","Esabato"]},dayPeriods:{am:"Ma/Mo",pm:"Mambia/Mog"}},ethiopic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13"],short:["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"],long:["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"]},days:{narrow:["C","C","C","C","A","I","E"],short:["Cpr","Ctt","Cmn","Cmt","Ars","Icm","Est"],long:["Chumapiri","Chumatato","Chumaine","Chumatano","Aramisi","Ichuma","Esabato"]},eras:{narrow:["ERA0","ERA1"],short:["ERA0","ERA1"],long:["ERA0","ERA1"]},dayPeriods:{am:"Ma/Mo",pm:"Mambia/Mog"}},ethioaa:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13"],short:["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"],long:["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"]},days:{narrow:["C","C","C","C","A","I","E"],short:["Cpr","Ctt","Cmn","Cmt","Ars","Icm","Est"],long:["Chumapiri","Chumatato","Chumaine","Chumatano","Aramisi","Ichuma","Esabato"]},eras:{narrow:["ERA0"],short:["ERA0"],long:["ERA0"]},dayPeriods:{am:"Ma/Mo",pm:"Mambia/Mog"}},generic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"],long:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"]},days:{narrow:["C","C","C","C","A","I","E"],short:["Cpr","Ctt","Cmn","Cmt","Ars","Icm","Est"],long:["Chumapiri","Chumatato","Chumaine","Chumatano","Aramisi","Ichuma","Esabato"]},eras:{narrow:["ERA0","ERA1"],short:["ERA0","ERA1"],long:["ERA0","ERA1"]},dayPeriods:{am:"Ma/Mo",pm:"Mambia/Mog"}},gregory:{months:{narrow:["C","F","M","A","M","J","C","A","S","O","N","D"],short:["Can","Feb","Mac","Apr","Mei","Jun","Cul","Agt","Sep","Okt","Nob","Dis"],long:["Chanuari","Feburari","Machi","Apiriri","Mei","Juni","Chulai","Agosti","Septemba","Okitoba","Nobemba","Disemba"]},days:{narrow:["C","C","C","C","A","I","E"],short:["Cpr","Ctt","Cmn","Cmt","Ars","Icm","Est"],long:["Chumapiri","Chumatato","Chumaine","Chumatano","Aramisi","Ichuma","Esabato"]},eras:{narrow:["YA","YK","BCE","CE"],short:["YA","YK","BCE","CE"],long:["Yeso ataiborwa","Yeso kaiboirwe","BCE","CE"]},dayPeriods:{am:"Ma/Mo",pm:"Mambia/Mog"}},hebrew:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13","7"],short:["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul","Adar II"],long:["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul","Adar II"]},days:{narrow:["C","C","C","C","A","I","E"],short:["Cpr","Ctt","Cmn","Cmt","Ars","Icm","Est"],long:["Chumapiri","Chumatato","Chumaine","Chumatano","Aramisi","Ichuma","Esabato"]},eras:{narrow:["AM"],short:["AM"],long:["AM"]},dayPeriods:{am:"Ma/Mo",pm:"Mambia/Mog"}},indian:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["Chaitra","Vaisakha","Jyaistha","Asadha","Sravana","Bhadra","Asvina","Kartika","Agrahayana","Pausa","Magha","Phalguna"],long:["Chaitra","Vaisakha","Jyaistha","Asadha","Sravana","Bhadra","Asvina","Kartika","Agrahayana","Pausa","Magha","Phalguna"]},days:{narrow:["C","C","C","C","A","I","E"],short:["Cpr","Ctt","Cmn","Cmt","Ars","Icm","Est"],long:["Chumapiri","Chumatato","Chumaine","Chumatano","Aramisi","Ichuma","Esabato"]},eras:{narrow:["Saka"],short:["Saka"],long:["Saka"]},dayPeriods:{am:"Ma/Mo",pm:"Mambia/Mog"}},islamic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],long:["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"]},days:{narrow:["C","C","C","C","A","I","E"],short:["Cpr","Ctt","Cmn","Cmt","Ars","Icm","Est"],long:["Chumapiri","Chumatato","Chumaine","Chumatano","Aramisi","Ichuma","Esabato"]},eras:{narrow:["AH"],short:["AH"],long:["AH"]},dayPeriods:{am:"Ma/Mo",pm:"Mambia/Mog"}},islamicc:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],long:["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"]},days:{narrow:["C","C","C","C","A","I","E"],short:["Cpr","Ctt","Cmn","Cmt","Ars","Icm","Est"],long:["Chumapiri","Chumatato","Chumaine","Chumatano","Aramisi","Ichuma","Esabato"]},eras:{narrow:["AH"],short:["AH"],long:["AH"]},dayPeriods:{am:"Ma/Mo",pm:"Mambia/Mog"}},japanese:{months:{narrow:["C","F","M","A","M","J","C","A","S","O","N","D"],short:["Can","Feb","Mac","Apr","Mei","Jun","Cul","Agt","Sep","Okt","Nob","Dis"],long:["Chanuari","Feburari","Machi","Apiriri","Mei","Juni","Chulai","Agosti","Septemba","Okitoba","Nobemba","Disemba"]},days:{narrow:["C","C","C","C","A","I","E"],short:["Cpr","Ctt","Cmn","Cmt","Ars","Icm","Est"],long:["Chumapiri","Chumatato","Chumaine","Chumatano","Aramisi","Ichuma","Esabato"]},eras:{narrow:["Taika (645–650)","Hakuchi (650–671)","Hakuhō (672–686)","Shuchō (686–701)","Taihō (701–704)","Keiun (704–708)","Wadō (708–715)","Reiki (715–717)","Yōrō (717–724)","Jinki (724–729)","Tenpyō (729–749)","Tenpyō-kampō (749-749)","Tenpyō-shōhō (749-757)","Tenpyō-hōji (757-765)","Tenpyō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770–780)","Ten-ō (781-782)","Enryaku (782–806)","Daidō (806–810)","Kōnin (810–824)","Tenchō (824–834)","Jōwa (834–848)","Kajō (848–851)","Ninju (851–854)","Saikō (854–857)","Ten-an (857-859)","Jōgan (859–877)","Gangyō (877–885)","Ninna (885–889)","Kanpyō (889–898)","Shōtai (898–901)","Engi (901–923)","Enchō (923–931)","Jōhei (931–938)","Tengyō (938–947)","Tenryaku (947–957)","Tentoku (957–961)","Ōwa (961–964)","Kōhō (964–968)","Anna (968–970)","Tenroku (970–973)","Ten’en (973–976)","Jōgen (976–978)","Tengen (978–983)","Eikan (983–985)","Kanna (985–987)","Eien (987–989)","Eiso (989–990)","Shōryaku (990–995)","Chōtoku (995–999)","Chōhō (999–1004)","Kankō (1004–1012)","Chōwa (1012–1017)","Kannin (1017–1021)","Jian (1021–1024)","Manju (1024–1028)","Chōgen (1028–1037)","Chōryaku (1037–1040)","Chōkyū (1040–1044)","Kantoku (1044–1046)","Eishō (1046–1053)","Tengi (1053–1058)","Kōhei (1058–1065)","Jiryaku (1065–1069)","Enkyū (1069–1074)","Shōho (1074–1077)","Shōryaku (1077–1081)","Eihō (1081–1084)","Ōtoku (1084–1087)","Kanji (1087–1094)","Kahō (1094–1096)","Eichō (1096–1097)","Jōtoku (1097–1099)","Kōwa (1099–1104)","Chōji (1104–1106)","Kashō (1106–1108)","Tennin (1108–1110)","Ten-ei (1110-1113)","Eikyū (1113–1118)","Gen’ei (1118–1120)","Hōan (1120–1124)","Tenji (1124–1126)","Daiji (1126–1131)","Tenshō (1131–1132)","Chōshō (1132–1135)","Hōen (1135–1141)","Eiji (1141–1142)","Kōji (1142–1144)","Ten’yō (1144–1145)","Kyūan (1145–1151)","Ninpei (1151–1154)","Kyūju (1154–1156)","Hōgen (1156–1159)","Heiji (1159–1160)","Eiryaku (1160–1161)","Ōho (1161–1163)","Chōkan (1163–1165)","Eiman (1165–1166)","Nin’an (1166–1169)","Kaō (1169–1171)","Shōan (1171–1175)","Angen (1175–1177)","Jishō (1177–1181)","Yōwa (1181–1182)","Juei (1182–1184)","Genryaku (1184–1185)","Bunji (1185–1190)","Kenkyū (1190–1199)","Shōji (1199–1201)","Kennin (1201–1204)","Genkyū (1204–1206)","Ken’ei (1206–1207)","Jōgen (1207–1211)","Kenryaku (1211–1213)","Kenpō (1213–1219)","Jōkyū (1219–1222)","Jōō (1222–1224)","Gennin (1224–1225)","Karoku (1225–1227)","Antei (1227–1229)","Kanki (1229–1232)","Jōei (1232–1233)","Tenpuku (1233–1234)","Bunryaku (1234–1235)","Katei (1235–1238)","Ryakunin (1238–1239)","En’ō (1239–1240)","Ninji (1240–1243)","Kangen (1243–1247)","Hōji (1247–1249)","Kenchō (1249–1256)","Kōgen (1256–1257)","Shōka (1257–1259)","Shōgen (1259–1260)","Bun’ō (1260–1261)","Kōchō (1261–1264)","Bun’ei (1264–1275)","Kenji (1275–1278)","Kōan (1278–1288)","Shōō (1288–1293)","Einin (1293–1299)","Shōan (1299–1302)","Kengen (1302–1303)","Kagen (1303–1306)","Tokuji (1306–1308)","Enkyō (1308–1311)","Ōchō (1311–1312)","Shōwa (1312–1317)","Bunpō (1317–1319)","Genō (1319–1321)","Genkō (1321–1324)","Shōchū (1324–1326)","Karyaku (1326–1329)","Gentoku (1329–1331)","Genkō (1331–1334)","Kenmu (1334–1336)","Engen (1336–1340)","Kōkoku (1340–1346)","Shōhei (1346–1370)","Kentoku (1370–1372)","Bunchū (1372–1375)","Tenju (1375–1379)","Kōryaku (1379–1381)","Kōwa (1381–1384)","Genchū (1384–1392)","Meitoku (1384–1387)","Kakei (1387–1389)","Kōō (1389–1390)","Meitoku (1390–1394)","Ōei (1394–1428)","Shōchō (1428–1429)","Eikyō (1429–1441)","Kakitsu (1441–1444)","Bun’an (1444–1449)","Hōtoku (1449–1452)","Kyōtoku (1452–1455)","Kōshō (1455–1457)","Chōroku (1457–1460)","Kanshō (1460–1466)","Bunshō (1466–1467)","Ōnin (1467–1469)","Bunmei (1469–1487)","Chōkyō (1487–1489)","Entoku (1489–1492)","Meiō (1492–1501)","Bunki (1501–1504)","Eishō (1504–1521)","Taiei (1521–1528)","Kyōroku (1528–1532)","Tenbun (1532–1555)","Kōji (1555–1558)","Eiroku (1558–1570)","Genki (1570–1573)","Tenshō (1573–1592)","Bunroku (1592–1596)","Keichō (1596–1615)","Genna (1615–1624)","Kan’ei (1624–1644)","Shōho (1644–1648)","Keian (1648–1652)","Jōō (1652–1655)","Meireki (1655–1658)","Manji (1658–1661)","Kanbun (1661–1673)","Enpō (1673–1681)","Tenna (1681–1684)","Jōkyō (1684–1688)","Genroku (1688–1704)","Hōei (1704–1711)","Shōtoku (1711–1716)","Kyōhō (1716–1736)","Genbun (1736–1741)","Kanpō (1741–1744)","Enkyō (1744–1748)","Kan’en (1748–1751)","Hōreki (1751–1764)","Meiwa (1764–1772)","An’ei (1772–1781)","Tenmei (1781–1789)","Kansei (1789–1801)","Kyōwa (1801–1804)","Bunka (1804–1818)","Bunsei (1818–1830)","Tenpō (1830–1844)","Kōka (1844–1848)","Kaei (1848–1854)","Ansei (1854–1860)","Man’en (1860–1861)","Bunkyū (1861–1864)","Genji (1864–1865)","Keiō (1865–1868)","M","T","S","H"],short:["Taika (645–650)","Hakuchi (650–671)","Hakuhō (672–686)","Shuchō (686–701)","Taihō (701–704)","Keiun (704–708)","Wadō (708–715)","Reiki (715–717)","Yōrō (717–724)","Jinki (724–729)","Tenpyō (729–749)","Tenpyō-kampō (749-749)","Tenpyō-shōhō (749-757)","Tenpyō-hōji (757-765)","Tenpyō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770–780)","Ten-ō (781-782)","Enryaku (782–806)","Daidō (806–810)","Kōnin (810–824)","Tenchō (824–834)","Jōwa (834–848)","Kajō (848–851)","Ninju (851–854)","Saikō (854–857)","Ten-an (857-859)","Jōgan (859–877)","Gangyō (877–885)","Ninna (885–889)","Kanpyō (889–898)","Shōtai (898–901)","Engi (901–923)","Enchō (923–931)","Jōhei (931–938)","Tengyō (938–947)","Tenryaku (947–957)","Tentoku (957–961)","Ōwa (961–964)","Kōhō (964–968)","Anna (968–970)","Tenroku (970–973)","Ten’en (973–976)","Jōgen (976–978)","Tengen (978–983)","Eikan (983–985)","Kanna (985–987)","Eien (987–989)","Eiso (989–990)","Shōryaku (990–995)","Chōtoku (995–999)","Chōhō (999–1004)","Kankō (1004–1012)","Chōwa (1012–1017)","Kannin (1017–1021)","Jian (1021–1024)","Manju (1024–1028)","Chōgen (1028–1037)","Chōryaku (1037–1040)","Chōkyū (1040–1044)","Kantoku (1044–1046)","Eishō (1046–1053)","Tengi (1053–1058)","Kōhei (1058–1065)","Jiryaku (1065–1069)","Enkyū (1069–1074)","Shōho (1074–1077)","Shōryaku (1077–1081)","Eihō (1081–1084)","Ōtoku (1084–1087)","Kanji (1087–1094)","Kahō (1094–1096)","Eichō (1096–1097)","Jōtoku (1097–1099)","Kōwa (1099–1104)","Chōji (1104–1106)","Kashō (1106–1108)","Tennin (1108–1110)","Ten-ei (1110-1113)","Eikyū (1113–1118)","Gen’ei (1118–1120)","Hōan (1120–1124)","Tenji (1124–1126)","Daiji (1126–1131)","Tenshō (1131–1132)","Chōshō (1132–1135)","Hōen (1135–1141)","Eiji (1141–1142)","Kōji (1142–1144)","Ten’yō (1144–1145)","Kyūan (1145–1151)","Ninpei (1151–1154)","Kyūju (1154–1156)","Hōgen (1156–1159)","Heiji (1159–1160)","Eiryaku (1160–1161)","Ōho (1161–1163)","Chōkan (1163–1165)","Eiman (1165–1166)","Nin’an (1166–1169)","Kaō (1169–1171)","Shōan (1171–1175)","Angen (1175–1177)","Jishō (1177–1181)","Yōwa (1181–1182)","Juei (1182–1184)","Genryaku (1184–1185)","Bunji (1185–1190)","Kenkyū (1190–1199)","Shōji (1199–1201)","Kennin (1201–1204)","Genkyū (1204–1206)","Ken’ei (1206–1207)","Jōgen (1207–1211)","Kenryaku (1211–1213)","Kenpō (1213–1219)","Jōkyū (1219–1222)","Jōō (1222–1224)","Gennin (1224–1225)","Karoku (1225–1227)","Antei (1227–1229)","Kanki (1229–1232)","Jōei (1232–1233)","Tenpuku (1233–1234)","Bunryaku (1234–1235)","Katei (1235–1238)","Ryakunin (1238–1239)","En’ō (1239–1240)","Ninji (1240–1243)","Kangen (1243–1247)","Hōji (1247–1249)","Kenchō (1249–1256)","Kōgen (1256–1257)","Shōka (1257–1259)","Shōgen (1259–1260)","Bun’ō (1260–1261)","Kōchō (1261–1264)","Bun’ei (1264–1275)","Kenji (1275–1278)","Kōan (1278–1288)","Shōō (1288–1293)","Einin (1293–1299)","Shōan (1299–1302)","Kengen (1302–1303)","Kagen (1303–1306)","Tokuji (1306–1308)","Enkyō (1308–1311)","Ōchō (1311–1312)","Shōwa (1312–1317)","Bunpō (1317–1319)","Genō (1319–1321)","Genkō (1321–1324)","Shōchū (1324–1326)","Karyaku (1326–1329)","Gentoku (1329–1331)","Genkō (1331–1334)","Kenmu (1334–1336)","Engen (1336–1340)","Kōkoku (1340–1346)","Shōhei (1346–1370)","Kentoku (1370–1372)","Bunchū (1372–1375)","Tenju (1375–1379)","Kōryaku (1379–1381)","Kōwa (1381–1384)","Genchū (1384–1392)","Meitoku (1384–1387)","Kakei (1387–1389)","Kōō (1389–1390)","Meitoku (1390–1394)","Ōei (1394–1428)","Shōchō (1428–1429)","Eikyō (1429–1441)","Kakitsu (1441–1444)","Bun’an (1444–1449)","Hōtoku (1449–1452)","Kyōtoku (1452–1455)","Kōshō (1455–1457)","Chōroku (1457–1460)","Kanshō (1460–1466)","Bunshō (1466–1467)","Ōnin (1467–1469)","Bunmei (1469–1487)","Chōkyō (1487–1489)","Entoku (1489–1492)","Meiō (1492–1501)","Bunki (1501–1504)","Eishō (1504–1521)","Taiei (1521–1528)","Kyōroku (1528–1532)","Tenbun (1532–1555)","Kōji (1555–1558)","Eiroku (1558–1570)","Genki (1570–1573)","Tenshō (1573–1592)","Bunroku (1592–1596)","Keichō (1596–1615)","Genna (1615–1624)","Kan’ei (1624–1644)","Shōho (1644–1648)","Keian (1648–1652)","Jōō (1652–1655)","Meireki (1655–1658)","Manji (1658–1661)","Kanbun (1661–1673)","Enpō (1673–1681)","Tenna (1681–1684)","Jōkyō (1684–1688)","Genroku (1688–1704)","Hōei (1704–1711)","Shōtoku (1711–1716)","Kyōhō (1716–1736)","Genbun (1736–1741)","Kanpō (1741–1744)","Enkyō (1744–1748)","Kan’en (1748–1751)","Hōreki (1751–1764)","Meiwa (1764–1772)","An’ei (1772–1781)","Tenmei (1781–1789)","Kansei (1789–1801)","Kyōwa (1801–1804)","Bunka (1804–1818)","Bunsei (1818–1830)","Tenpō (1830–1844)","Kōka (1844–1848)","Kaei (1848–1854)","Ansei (1854–1860)","Man’en (1860–1861)","Bunkyū (1861–1864)","Genji (1864–1865)","Keiō (1865–1868)","Meiji","Taishō","Shōwa","Heisei"],long:["Taika (645–650)","Hakuchi (650–671)","Hakuhō (672–686)","Shuchō (686–701)","Taihō (701–704)","Keiun (704–708)","Wadō (708–715)","Reiki (715–717)","Yōrō (717–724)","Jinki (724–729)","Tenpyō (729–749)","Tenpyō-kampō (749-749)","Tenpyō-shōhō (749-757)","Tenpyō-hōji (757-765)","Tenpyō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770–780)","Ten-ō (781-782)","Enryaku (782–806)","Daidō (806–810)","Kōnin (810–824)","Tenchō (824–834)","Jōwa (834–848)","Kajō (848–851)","Ninju (851–854)","Saikō (854–857)","Ten-an (857-859)","Jōgan (859–877)","Gangyō (877–885)","Ninna (885–889)","Kanpyō (889–898)","Shōtai (898–901)","Engi (901–923)","Enchō (923–931)","Jōhei (931–938)","Tengyō (938–947)","Tenryaku (947–957)","Tentoku (957–961)","Ōwa (961–964)","Kōhō (964–968)","Anna (968–970)","Tenroku (970–973)","Ten’en (973–976)","Jōgen (976–978)","Tengen (978–983)","Eikan (983–985)","Kanna (985–987)","Eien (987–989)","Eiso (989–990)","Shōryaku (990–995)","Chōtoku (995–999)","Chōhō (999–1004)","Kankō (1004–1012)","Chōwa (1012–1017)","Kannin (1017–1021)","Jian (1021–1024)","Manju (1024–1028)","Chōgen (1028–1037)","Chōryaku (1037–1040)","Chōkyū (1040–1044)","Kantoku (1044–1046)","Eishō (1046–1053)","Tengi (1053–1058)","Kōhei (1058–1065)","Jiryaku (1065–1069)","Enkyū (1069–1074)","Shōho (1074–1077)","Shōryaku (1077–1081)","Eihō (1081–1084)","Ōtoku (1084–1087)","Kanji (1087–1094)","Kahō (1094–1096)","Eichō (1096–1097)","Jōtoku (1097–1099)","Kōwa (1099–1104)","Chōji (1104–1106)","Kashō (1106–1108)","Tennin (1108–1110)","Ten-ei (1110-1113)","Eikyū (1113–1118)","Gen’ei (1118–1120)","Hōan (1120–1124)","Tenji (1124–1126)","Daiji (1126–1131)","Tenshō (1131–1132)","Chōshō (1132–1135)","Hōen (1135–1141)","Eiji (1141–1142)","Kōji (1142–1144)","Ten’yō (1144–1145)","Kyūan (1145–1151)","Ninpei (1151–1154)","Kyūju (1154–1156)","Hōgen (1156–1159)","Heiji (1159–1160)","Eiryaku (1160–1161)","Ōho (1161–1163)","Chōkan (1163–1165)","Eiman (1165–1166)","Nin’an (1166–1169)","Kaō (1169–1171)","Shōan (1171–1175)","Angen (1175–1177)","Jishō (1177–1181)","Yōwa (1181–1182)","Juei (1182–1184)","Genryaku (1184–1185)","Bunji (1185–1190)","Kenkyū (1190–1199)","Shōji (1199–1201)","Kennin (1201–1204)","Genkyū (1204–1206)","Ken’ei (1206–1207)","Jōgen (1207–1211)","Kenryaku (1211–1213)","Kenpō (1213–1219)","Jōkyū (1219–1222)","Jōō (1222–1224)","Gennin (1224–1225)","Karoku (1225–1227)","Antei (1227–1229)","Kanki (1229–1232)","Jōei (1232–1233)","Tenpuku (1233–1234)","Bunryaku (1234–1235)","Katei (1235–1238)","Ryakunin (1238–1239)","En’ō (1239–1240)","Ninji (1240–1243)","Kangen (1243–1247)","Hōji (1247–1249)","Kenchō (1249–1256)","Kōgen (1256–1257)","Shōka (1257–1259)","Shōgen (1259–1260)","Bun’ō (1260–1261)","Kōchō (1261–1264)","Bun’ei (1264–1275)","Kenji (1275–1278)","Kōan (1278–1288)","Shōō (1288–1293)","Einin (1293–1299)","Shōan (1299–1302)","Kengen (1302–1303)","Kagen (1303–1306)","Tokuji (1306–1308)","Enkyō (1308–1311)","Ōchō (1311–1312)","Shōwa (1312–1317)","Bunpō (1317–1319)","Genō (1319–1321)","Genkō (1321–1324)","Shōchū (1324–1326)","Karyaku (1326–1329)","Gentoku (1329–1331)","Genkō (1331–1334)","Kenmu (1334–1336)","Engen (1336–1340)","Kōkoku (1340–1346)","Shōhei (1346–1370)","Kentoku (1370–1372)","Bunchū (1372–1375)","Tenju (1375–1379)","Kōryaku (1379–1381)","Kōwa (1381–1384)","Genchū (1384–1392)","Meitoku (1384–1387)","Kakei (1387–1389)","Kōō (1389–1390)","Meitoku (1390–1394)","Ōei (1394–1428)","Shōchō (1428–1429)","Eikyō (1429–1441)","Kakitsu (1441–1444)","Bun’an (1444–1449)","Hōtoku (1449–1452)","Kyōtoku (1452–1455)","Kōshō (1455–1457)","Chōroku (1457–1460)","Kanshō (1460–1466)","Bunshō (1466–1467)","Ōnin (1467–1469)","Bunmei (1469–1487)","Chōkyō (1487–1489)","Entoku (1489–1492)","Meiō (1492–1501)","Bunki (1501–1504)","Eishō (1504–1521)","Taiei (1521–1528)","Kyōroku (1528–1532)","Tenbun (1532–1555)","Kōji (1555–1558)","Eiroku (1558–1570)","Genki (1570–1573)","Tenshō (1573–1592)","Bunroku (1592–1596)","Keichō (1596–1615)","Genna (1615–1624)","Kan’ei (1624–1644)","Shōho (1644–1648)","Keian (1648–1652)","Jōō (1652–1655)","Meireki (1655–1658)","Manji (1658–1661)","Kanbun (1661–1673)","Enpō (1673–1681)","Tenna (1681–1684)","Jōkyō (1684–1688)","Genroku (1688–1704)","Hōei (1704–1711)","Shōtoku (1711–1716)","Kyōhō (1716–1736)","Genbun (1736–1741)","Kanpō (1741–1744)","Enkyō (1744–1748)","Kan’en (1748–1751)","Hōreki (1751–1764)","Meiwa (1764–1772)","An’ei (1772–1781)","Tenmei (1781–1789)","Kansei (1789–1801)","Kyōwa (1801–1804)","Bunka (1804–1818)","Bunsei (1818–1830)","Tenpō (1830–1844)","Kōka (1844–1848)","Kaei (1848–1854)","Ansei (1854–1860)","Man’en (1860–1861)","Bunkyū (1861–1864)","Genji (1864–1865)","Keiō (1865–1868)","Meiji","Taishō","Shōwa","Heisei"]},dayPeriods:{am:"Ma/Mo",pm:"Mambia/Mog"}},persian:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],long:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"]},days:{narrow:["C","C","C","C","A","I","E"],short:["Cpr","Ctt","Cmn","Cmt","Ars","Icm","Est"],long:["Chumapiri","Chumatato","Chumaine","Chumatano","Aramisi","Ichuma","Esabato"]},eras:{narrow:["AP"],short:["AP"],long:["AP"]},dayPeriods:{am:"Ma/Mo",pm:"Mambia/Mog"}},roc:{months:{narrow:["C","F","M","A","M","J","C","A","S","O","N","D"],short:["Can","Feb","Mac","Apr","Mei","Jun","Cul","Agt","Sep","Okt","Nob","Dis"],long:["Chanuari","Feburari","Machi","Apiriri","Mei","Juni","Chulai","Agosti","Septemba","Okitoba","Nobemba","Disemba"]},days:{narrow:["C","C","C","C","A","I","E"],short:["Cpr","Ctt","Cmn","Cmt","Ars","Icm","Est"],long:["Chumapiri","Chumatato","Chumaine","Chumatano","Aramisi","Ichuma","Esabato"]},eras:{narrow:["Before R.O.C.","R.O.C."],short:["Before R.O.C.","R.O.C."],long:["Before R.O.C.","R.O.C."]},dayPeriods:{am:"Ma/Mo",pm:"Mambia/Mog"}}}},number:{nu:["latn"],patterns:{decimal:{positivePattern:"{number}",negativePattern:"{minusSign}{number}"},currency:{positivePattern:"{currency}{number}",negativePattern:"{minusSign}{currency}{number}"},percent:{positivePattern:"{number}{percentSign}",negativePattern:"{minusSign}{number}{percentSign}"}},symbols:{latn:{decimal:".",group:",",nan:"NaN",plusSign:"+",minusSign:"-",percentSign:"%",infinity:"∞"}},currencies:{AUD:"A$",BRL:"R$",CAD:"CA$",CNY:"CN¥",EUR:"€",GBP:"£",HKD:"HK$",ILS:"₪",INR:"₹",JPY:"JP¥",KES:"Ksh",KRW:"₩",MXN:"MX$",NZD:"NZ$",TWD:"NT$",USD:"US$",VND:"₫",XAF:"FCFA",XCD:"EC$",XOF:"CFA",XPF:"CFPF"}}}); | ilangorajagopal/ilangorajagopal.github.io | node_modules/intl/locale-data/jsonp/guz.js | JavaScript | mit | 26,122 |
/*! jQuery UI - v1.10.1 - 2013-02-15
* http://jqueryui.com
* Includes: jquery.ui.dialog.js
* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
(function(e,t){var n={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},r={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.10.1",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var n=this;if(!this._isOpen||this._trigger("beforeClose",t)===!1)return;this._isOpen=!1,this._destroyOverlay(),this.opener.filter(":focusable").focus().length||e(this.document[0].activeElement).blur(),this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",t)})},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,t){var n=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return n&&!t&&this._trigger("focus",e),n},open:function(){var t=this;if(this._isOpen){this._moveToTop()&&this._focusTabbable();return}this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._trigger("open")},_focusTabbable:function(){var e=this.element.find("[autofocus]");e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function n(){var t=this.document[0].activeElement,n=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);n||this._focusTabbable()}t.preventDefault(),n.call(this),this._delay(n)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE){t.preventDefault(),this.close(t);return}if(t.keyCode!==e.ui.keyCode.TAB)return;var n=this.uiDialog.find(":tabbable"),r=n.filter(":first"),i=n.filter(":last");t.target!==i[0]&&t.target!==this.uiDialog[0]||!!t.shiftKey?(t.target===r[0]||t.target===this.uiDialog[0])&&t.shiftKey&&(i.focus(1),t.preventDefault()):(r.focus(1),t.preventDefault())},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html(" "),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,n=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty();if(e.isEmptyObject(n)||e.isArray(n)&&!n.length){this.uiDialog.removeClass("ui-dialog-buttons");return}e.each(n,function(n,r){var i,s;r=e.isFunction(r)?{click:r,text:n}:r,r=e.extend({type:"button"},r),i=r.click,r.click=function(){i.apply(t.element[0],arguments)},s={icons:r.icons,text:r.showText},delete r.icons,delete r.showText,e("<button></button>",r).button(s).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)},_makeDraggable:function(){function r(e){return{position:e.position,offset:e.offset}}var t=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,i){e(this).addClass("ui-dialog-dragging"),t._blockFrames(),t._trigger("dragStart",n,r(i))},drag:function(e,n){t._trigger("drag",e,r(n))},stop:function(i,s){n.position=[s.position.left-t.document.scrollLeft(),s.position.top-t.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),t._unblockFrames(),t._trigger("dragStop",i,r(s))}})},_makeResizable:function(){function o(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var t=this,n=this.options,r=n.resizable,i=this.uiDialog.css("position"),s=typeof r=="string"?r:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:n.maxWidth,maxHeight:n.maxHeight,minWidth:n.minWidth,minHeight:this._minHeight(),handles:s,start:function(n,r){e(this).addClass("ui-dialog-resizing"),t._blockFrames(),t._trigger("resizeStart",n,o(r))},resize:function(e,n){t._trigger("resize",e,o(n))},stop:function(r,i){n.height=e(this).height(),n.width=e(this).width(),e(this).removeClass("ui-dialog-resizing"),t._unblockFrames(),t._trigger("resizeStop",r,o(i))}}).css("position",i)},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,o={};e.each(t,function(e,t){i._setOption(e,t),e in n&&(s=!0),e in r&&(o[e]=t)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(e,t){var n,r,i=this.uiDialog;e==="dialogClass"&&i.removeClass(this.options.dialogClass).addClass(t);if(e==="disabled")return;this._super(e,t),e==="appendTo"&&this.uiDialog.appendTo(this._appendTo()),e==="buttons"&&this._createButtons(),e==="closeText"&&this.uiDialogTitlebarClose.button({label:""+t}),e==="draggable"&&(n=i.is(":data(ui-draggable)"),n&&!t&&i.draggable("destroy"),!n&&t&&this._makeDraggable()),e==="position"&&this._position(),e==="resizable"&&(r=i.is(":data(ui-resizable)"),r&&!t&&i.resizable("destroy"),r&&typeof t=="string"&&i.resizable("option","handles",t),!r&&t!==!1&&this._makeResizable()),e==="title"&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title"))},_size:function(){var e,t,n,r=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),r.minWidth>r.width&&(r.width=r.minWidth),e=this.uiDialog.css({height:"auto",width:r.width}).outerHeight(),t=Math.max(0,r.minHeight-e),n=typeof r.maxHeight=="number"?Math.max(0,r.maxHeight-e):"none",r.height==="auto"?this.element.css({minHeight:t,maxHeight:n,height:"auto"}):this.element.height(Math.max(0,r.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_createOverlay:function(){if(!this.options.modal)return;e.ui.dialog.overlayInstances||this._delay(function(){e.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(t){!e(t.target).closest(".ui-dialog").length&&!e(t.target).closest(".ui-datepicker").length&&(t.preventDefault(),e(".ui-dialog:visible:last .ui-dialog-content").data("ui-dialog")._focusTabbable())})}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),e.ui.dialog.overlayInstances++},_destroyOverlay:function(){if(!this.options.modal)return;this.overlay&&(e.ui.dialog.overlayInstances--,e.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),e.ui.dialog.overlayInstances=0,e.uiBackCompat!==!1&&e.widget("ui.dialog",e.ui.dialog,{_position:function(){var t=this.options.position,n=[],r=[0,0],i;if(t){if(typeof t=="string"||typeof t=="object"&&"0"in t)n=t.split?t.split(" "):[t[0],t[1]],n.length===1&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(r[e]=n[e],n[e]=t)}),t={my:n[0]+(r[0]<0?r[0]:"+"+r[0])+" "+n[1]+(r[1]<0?r[1]:"+"+r[1]),at:n.join(" ")};t=e.extend({},e.ui.dialog.prototype.options.position,t)}else t=e.ui.dialog.prototype.options.position;i=this.uiDialog.is(":visible"),i||this.uiDialog.show(),this.uiDialog.position(t),i||this.uiDialog.hide()}})})(jQuery); | abrahammartin/django-ucamprojectlight | ucamprojectlight/campl_jquery_ui-static/development-bundle/ui/minified/jquery.ui.dialog.min.js | JavaScript | mit | 11,130 |
module Fog
module Storage
class InternetArchive
class Real
require 'fog/internet_archive/parsers/storage/get_service'
# List information about S3 buckets for authorized user
#
# @return [Excon::Response] response:
# * body [Hash]:
# * Buckets [Hash]:
# * Name [String] - Name of bucket
# * CreationTime [Time] - Timestamp of bucket creation
# * Owner [Hash]:
# * DisplayName [String] - Display name of bucket owner
# * ID [String] - Id of bucket owner
#
# @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTServiceGET.html
#
def get_service
request({
:expects => 200,
:headers => {},
:host => @host,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::Storage::InternetArchive::GetService.new
})
end
end
class Mock # :nodoc:all
def get_service
response = Excon::Response.new
response.headers['Status'] = 200
buckets = self.data[:buckets].values.map do |bucket|
bucket.reject do |key, value|
!['CreationDate', 'Name'].include?(key)
end
end
response.body = {
'Buckets' => buckets,
'Owner' => { 'DisplayName' => 'owner', 'ID' => 'some_id'}
}
response
end
end
end
end
end
| ralzate/Nuevo-Aerosanidad | vendor/bundle/ruby/2.1.0/gems/fog-1.35.0/lib/fog/internet_archive/requests/storage/get_service.rb | Ruby | mit | 1,544 |
/*! Respimg - Responsive Images that work today.
* Author: Alexander Farkas, 2014
* Author: Scott Jehl, Filament Group, 2012 ( new proposal implemented by Shawn Jansepar )
* License: MIT
* Spec: http://picture.responsiveimages.org/
*/
!function(a,b,c){"use strict";function d(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function e(){var b;T=!1,W=a.devicePixelRatio,U={},V={},b=(W||1)*E.xQuant,E.uT||(E.maxX=Math.max(1.3,E.maxX),b=Math.min(b,E.maxX),w.DPR=b),X.width=Math.max(a.innerWidth||0,C.clientWidth),X.height=Math.max(a.innerHeight||0,C.clientHeight),X.vw=X.width/100,X.vh=X.height/100,X.em=w.getEmValue(),X.rem=X.em,o=E.lazyFactor/2,o=o*b+o,q=.4+.1*b,l=.5+.2*b,m=.5+.25*b,p=b+1.3,(n=X.width>X.height)||(o*=.9),J&&(o*=.9),v=[X.width,X.height,b].join("-")}function f(a,b,c){var d=b*Math.pow(a-.4,1.9);return n||(d/=1.3),a+=d,a>c}function g(a){var b,c=w.getSet(a),d=!1;"pending"!=c&&(d=v,c&&(b=w.setRes(c),d=w.applySetCandidate(b,a))),a[w.ns].evaled=d}function h(a,b){return a.res-b.res}function i(a,b,c){var d;return!c&&b&&(c=a[w.ns].sets,c=c&&c[c.length-1]),d=j(b,c),d&&(b=w.makeUrl(b),a[w.ns].curSrc=b,a[w.ns].curCan=d,d.res||cb(d,d.set.sizes)),d}function j(a,b){var c,d,e;if(a&&b)for(e=w.parseSet(b),a=w.makeUrl(a),c=0;c<e.length;c++)if(a==w.makeUrl(e[c].url)){d=e[c];break}return d}function k(a,c){var d,e,f,g,h=a.getElementsByTagName("source");for(d=0,e=h.length;e>d;d++)f=h[d],f[w.ns]=!0,g=f.getAttribute("srcset"),RIDEBUG&&9!=b.documentMode&&f.parentNode!=a&&r("all source elements have to be a child of the picture element. For IE9 support wrap them in an audio/video element, BUT with conditional comments"),g&&c.push({srcset:g,media:f.getAttribute("media"),type:f.getAttribute("type"),sizes:f.getAttribute("sizes")}),RIDEBUG&&f.getAttribute("src")&&r("`src` on `source` invalid, use `srcset`.");if(RIDEBUG){var i=w.qsa(a,"source, img");"SOURCE"==i[i.length-1].nodeName.toUpperCase()&&r("all sources inside picture have to precede the img element")}}"undefined"==typeof RIDEBUG&&(a.RIDEBUG=!0);var l,m,n,o,p,q,r,s,t,u,v,w={},x=function(){},y=b.createElement("img"),z=y.getAttribute,A=y.setAttribute,B=y.removeAttribute,C=b.documentElement,D={},E={xQuant:1,lazyFactor:.4,maxX:2},F="data-risrc",G=F+"set",H="webkitBackfaceVisibility"in C.style,I=navigator.userAgent,J=/rident/.test(I)||/ecko/.test(I)&&I.match(/rv\:(\d+)/)&&RegExp.$1>35,K="currentSrc",L=/\s+\+?\d+(e\d+)?w/,M=/((?:\([^)]+\)(?:\s*and\s*|\s*or\s*|\s*not\s*)?)+)?\s*(.+)/,N=/^([\+eE\d\.]+)(w|x)$/,O=/\s*\d+h\s*/,P=a.respimgCFG,Q="https:"==location.protocol,R="position:absolute;left:0;visibility:hidden;display:block;padding:0;border:none;font-size:1em;width:1em;overflow:hidden;clip:rect(0px, 0px, 0px, 0px)",S="font-size:100%!important;",T=!0,U={},V={},W=a.devicePixelRatio,X={px:1,"in":96},Y=b.createElement("a"),Z=!1,$=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d||!1):a.attachEvent&&a.attachEvent("on"+b,c)},_=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d||!1):a.detachEvent&&a.detachEvent("on"+b,c)},ab=function(a){var b={};return function(c){return c in b||(b[c]=a(c)),b[c]}},bb=function(){var a=/^([\d\.]+)(em|vw|px)$/,b=function(){for(var a=arguments,b=0,c=a[0];++b in a;)c=c.replace(a[b],a[++b]);return c},c=ab(function(a){return"return "+b((a||"").toLowerCase(),/\band\b/g,"&&",/,/g,"||",/min-([a-z-\s]+):/g,"e.$1>=",/max-([a-z-\s]+):/g,"e.$1<=",/calc([^)]+)/g,"($1)",/(\d+[\.]*[\d]*)([a-z]+)/g,"($1 * e.$2)",/^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/gi,"")});return function(b,d){var e;if(!(b in U))if(U[b]=!1,d&&(e=b.match(a)))U[b]=e[1]*X[e[2]];else try{U[b]=new Function("e",c(b))(X)}catch(f){}return U[b]}}(),cb=function(a,b){return a.w?(a.cWidth=w.calcListLength(b||"100vw"),a.res=a.w/a.cWidth):a.res=a.x,a},db=function(c){var d,e,f,g=c||{};if(g.elements&&1==g.elements.nodeType&&("IMG"==g.elements.nodeName.toUpperCase()?g.elements=[g.elements]:(g.context=g.elements,g.elements=null)),g.reparse&&(g.reevaluate=!0,a.console&&console.warn&&console.warn("reparse was renamed to reevaluate!")),d=g.elements||w.qsa(g.context||b,g.reevaluate||g.reselect?w.sel:w.selShort),f=d.length){for(w.setupRun(g),Z=!0,e=0;f>e;e++)w.fillImg(d[e],g);w.teardownRun(g)}},eb=ab(function(a){var b=[1,"x"],c=d(a||"");return c&&(c=c.replace(O,""),c.match(N)?(b=[1*RegExp.$1,RegExp.$2],RIDEBUG&&(b[0]<0||isNaN(b[0])||"w"==b[1]&&/\./.test(""+b[0]))&&r("bad descriptor: "+a)):(b=!1,RIDEBUG&&r("unknown descriptor: "+a))),b});RIDEBUG&&(r=a.console&&console.warn?function(a){console.warn(a)}:x),K in y||(K="src"),D["image/jpeg"]=!0,D["image/gif"]=!0,D["image/png"]=!0,D["image/svg+xml"]=b.implementation.hasFeature("http://wwwindow.w3.org/TR/SVG11/feature#Image","1.1"),w.ns=("ri"+(new Date).getTime()).substr(0,9),w.supSrcset="srcset"in y,w.supSizes="sizes"in y,w.selShort="picture>img,img[srcset]",w.sel=w.selShort,w.cfg=E,w.supSrcset&&(w.sel+=",img["+G+"]"),w.DPR=W||1,w.u=X,w.types=D,t=w.supSrcset&&!w.supSizes,w.setSize=x,w.makeUrl=ab(function(a){return Y.href=a,Y.href}),w.qsa=function(a,b){return a.querySelectorAll(b)},w.matchesMedia=function(){return w.matchesMedia=a.matchMedia&&(matchMedia("(min-width: 0.1em)")||{}).matches?function(a){return!a||matchMedia(a).matches}:w.mMQ,w.matchesMedia.apply(this,arguments)},w.mMQ=function(a){return a?bb(a):!0},w.calcLength=function(a){var b=bb(a,!0)||!1;return 0>b&&(b=!1),RIDEBUG&&(b===!1||0>b)&&r("invalid source size: "+a),b},w.supportsType=function(a){return a?D[a]:!0},w.parseSize=ab(function(a){var b=(a||"").match(M);return{media:b&&b[1],length:b&&b[2]}}),w.parseSet=function(a){if(!a.cands){var b,c,d,e,f,g,h,i=a.srcset;for(a.cands=[];i;)i=i.replace(/^\s+/g,""),b=i.search(/\s/g),d=null,-1!=b?(c=i.slice(0,b),e=c.charAt(c.length-1),","!=e&&c||(c=c.replace(/,+$/,""),d=""),i=i.slice(b+1),null==d&&(f=i.indexOf(","),-1!=f?(d=i.slice(0,f),i=i.slice(f+1)):(d=i,i=""))):(c=i,i=""),c&&(d=eb(d))&&(RIDEBUG&&(h||(h=a.sizes?"w":d[1]),h!=d[1]&&r("mixing x with a w descriptor/sizes attribute in one srcset doesn't make sense in most cases and is invalid.")),g={url:c.replace(/^,+/,""),set:a},g[d[1]]=d[0],"x"==d[1]&&1==d[0]&&(a.has1x=!0),a.cands.push(g))}return a.cands},w.getEmValue=function(){var a;if(!s&&(a=b.body)){var c=b.createElement("div"),d=C.style.cssText,e=a.style.cssText;c.style.cssText=R,C.style.cssText=S,a.style.cssText=S,a.appendChild(c),s=c.offsetWidth,a.removeChild(c),s=parseFloat(s,10),C.style.cssText=d,a.style.cssText=e}return s||16},w.calcListLength=function(a){if(!(a in V)||E.uT){var b,c,e,f,g,h,i=d(a).split(/\s*,\s*/),j=!1;for(g=0,h=i.length;h>g&&(b=i[g],c=w.parseSize(b),e=c.length,f=c.media,!e||!w.matchesMedia(f)||(j=w.calcLength(e))===!1);g++);V[a]=j?j:X.width}return V[a]},w.setRes=function(a){var b;if(a){b=w.parseSet(a);for(var c=0,d=b.length;d>c;c++)cb(b[c],a.sizes)}return b},w.setRes.res=cb,w.applySetCandidate=function(a,b){if(a.length){var c,d,e,g,j,k,n,s,t,u,x,y,z,A=b[w.ns],B=v,C=o,D=q;if(s=A.curSrc||b[K],t=A.curCan||i(b,s,a[0].set),d=w.DPR,z=t&&t.res,!n&&s&&(y=J&&!b.complete&&t&&z-.2>d,y||t&&!(p>z)||(t&&d>z&&z>l&&(m>z&&(C*=.8,D+=.04*d),t.res+=C*Math.pow(z-D,2)),u=!A.pic||t&&t.set==a[0].set,t&&u&&t.res>=d&&(n=t))),!n)for(z&&(t.res=t.res-(t.res-z)/2),a.sort(h),k=a.length,n=a[k-1],e=0;k>e;e++)if(c=a[e],c.res>=d){g=e-1,n=a[g]&&(j=c.res-d)&&(y||s!=w.makeUrl(c.url))&&f(a[g].res,j,d)?a[g]:c;break}return z&&(t.res=z),n&&(x=w.makeUrl(n.url),A.curSrc=x,A.curCan=n,x!=s&&(w.setSrc(b,n),RIDEBUG&&(fb(b,n),Q&&!n.url.indexOf("http:")&&r("insecure: "+x))),w.setSize(b)),B}},w.setSrc=function(a,b){var c;a.src=b.url,H&&(c=a.style.zoom,a.style.zoom="0.999",a.style.zoom=c)},w.getSet=function(a){var b,c,d,e=!1,f=a[w.ns].sets;for(b=0;b<f.length&&!e;b++)if(c=f[b],c.srcset&&w.matchesMedia(c.media)&&(d=w.supportsType(c.type))){"pending"==d&&(c=d),e=c;break}return e},w.parseSets=function(a,b,d){var e,f,g,h,i="PICTURE"==b.nodeName.toUpperCase(),l=a[w.ns];(l.src===c||d.src)&&(l.src=z.call(a,"src"),l.src?A.call(a,F,l.src):B.call(a,F)),(l.srcset===c||!w.supSrcset||a.srcset||d.srcset)&&(e=z.call(a,"srcset"),l.srcset=e,h=!0),l.sets=[],i&&(l.pic=!0,k(b,l.sets)),l.srcset?(f={srcset:l.srcset,sizes:z.call(a,"sizes")},l.sets.push(f),g=(t||l.src)&&L.test(l.srcset||""),g||!l.src||j(l.src,f)||f.has1x||(f.srcset+=", "+l.src,f.cands.push({url:l.src,x:1,set:f})),RIDEBUG&&!i&&g&&l.src&&-1==f.srcset.indexOf(a[w.ns].src)&&r("The fallback candidate (`src`) isn't described inside the srcset attribute. Normally you want to describe all available candidates.")):l.src&&l.sets.push({srcset:l.src,sizes:null}),l.curCan=null,l.curSrc=c,l.supported=!(i||f&&!w.supSrcset||g),h&&w.supSrcset&&!l.supported&&(e?(A.call(a,G,e),a.srcset=""):B.call(a,G)),l.supported&&!l.srcset&&(!l.src&&a.src||a.src!=w.makeUrl(l.src))&&(null==l.src?a.removeAttribute("src"):a.src=l.src),RIDEBUG&&gb(l.sets,"source"),l.parsed=!0},w.fillImg=function(a,b){var c,d,e=b.reselect||b.reevaluate;if(a[w.ns]||(a[w.ns]={}),d=a[w.ns],e||d.evaled!=v){if(!d.parsed||b.reevaluate){if(c=a.parentNode,!c)return;w.parseSets(a,c,b)}d.supported?d.evaled=v:g(a)}},w.setupRun=function(b){(!Z||T||W!=a.devicePixelRatio)&&(e(),b.elements||b.context||clearTimeout(u))},a.HTMLPictureElement?(db=x,w.fillImg=x):(b.createElement("picture"),function(){var c,d=a.attachEvent?/d$|^c/:/d$|^c|^i/,e=function(){var a=b.readyState||"";h=setTimeout(e,"loading"==a?200:999),b.body&&(c=c||d.test(a),w.fillImgs(),c&&clearTimeout(h))},f=function(){w.fillImgs()},g=function(){clearTimeout(u),T=!0,u=setTimeout(f,99)},h=setTimeout(e,b.body?0:20);$(a,"resize",g),$(b,"readystatechange",e)}()),w.respimage=db,w.fillImgs=db,w.teardownRun=x,db._=w,a.respimage=db,a.respimgCFG={ri:w,push:function(a){var b=a.shift();"function"==typeof w[b]?w[b].apply(w,a):(E[b]=a[0],Z&&w.fillImgs({reselect:!0}))}};for(;P&&P.length;)a.respimgCFG.push(P.shift());if(RIDEBUG){r("Responsive image debugger active. Do not use in production, because it slows things down! extremly"),(!b.querySelector||(b.documentMode||9)<8)&&r("querySelector is needed. IE8 needs to be in strict, standard or edge mode: http://bit.ly/1yGgYU0 or try the ri.oldie.js plugin."),"<PICTURE>"==(b.getElementsByTagName("picture")[0]||{}).outerHTML&&r("IE8 needs to picture shived. Either include respimage.js in <head> or use html5shiv."),"BackCompat"==b.compatMode&&r("Browser is in quirksmode. Please make sure to be in strict mode.");var fb=function(a,b){var c=function(){var d,e,f=a.offsetWidth,g=a.naturalWidth,h=b.cWidth,i=w.DPR*E.xQuant,j=.84,k=i>1?.5:.75;!h&&g&&b.x&&(h=g/i),f&&h&&(f>h?(d=h/f,e=k):(d=f/h,e=j),Math.abs(f-h)>50&&(b.w&&.86>d?r("Check your sizes attribute: "+b.set.sizes+" was calculated to: "+h+"px. But your image is shown with a size of "+f+"px. img: "+b.url):b.x&&e>d)),_(a,"load",c)};$(a,"load",c)},gb=function(){var a={minw:/^\s*\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)\s*$/,maxw:/^\s*\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)\s*$/},b=function(a,b,c,d){var e,f;for(e=0;c>e&&e<b.length;e++)f=b[e],(a._min&&f._min&&a._min>=f._min||a._max&&f._max&&a._max<=f._max)&&r("source"==d?"Order of your source elements matters. Defining "+a.media+" after "+f.media+" doesn't make sense.":"Order inside your sizes attribute does matter. Defining "+a.media+" after "+f.media+" doesn't make sense.")},c=function(c,d){var e,f,g,h;for(h=c[c.length-1],h&&(h.media||h.type)&&r("source"==d?"The last src/srcset shouldn't have any type or media conditions. Use img[src] or img[srcset].":"Last sizes attribute shouldn't have any condition otherwise 100vw is used."),e=0,f=c.length;f>e;e++)g=c[e],g.media&&!g.type?(g._min=g.media.match(a.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),g._max=g.media.match(a.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),g._min&&(g._min=parseFloat(g._min,10)*(g._min.indexOf("em")>0?w.getEmValue():1)),g._max&&(g._max=parseFloat(g._max,10)*(g._max.indexOf("em")>0?w.getEmValue():1)),(g._min||g._max)&&b(g,c,e,d)):g.type||e==f-1||r("source"==d?"A source element without [media] and [type] doesn't make any sense. Last srcset can be used at the img element. Order is important!":"The order of your sizes attribute does matter! The sizes length without a media condition has to be defined as last entry.")};return function(a){var b,e,f,g,h;for(c(a,"source"),b=0,e=a.length;e>b;b++)if(f=d(a[b].sizes||"")){for(h=[],f=f.split(/\s*,\s*/),g=0;g<f.length;g++)f[g]&&h.push(w.parseSize(f[g]));h.length&&c(h,"sizes")}}}()}}(window,document),function(a){"use strict";var b,c=0,d=function(){window.respimage&&a(window.respimage),(window.respimage||c>9999)&&clearInterval(b),c++};b=setInterval(d,8),d()}(function(a,b){"use strict";var c=window.document,d=a._,e={},f=d.cfg,g=function(a,b,c){var d=c.curCan;a&&b.setAttribute("width",parseInt(a/d.res,10))},h=function(a,b,d){var f,h,i;a in e?g(e[a],b,d):(i=function(){d.pendingURLSize=null,f.onload=null,f.onerror=null,b=null,f=null},d.pendingURLSize=a,h=d.curCan,h.w&&g(h.w,b,d),f=c.createElement("img"),f.onload=function(){if(e[a]=f.naturalWidth||f.width,!e[a])try{c.body.appendChild(f),e[a]=f.offsetWidth||f.naturalWidth||f.width,c.body.removeChild(f)}catch(h){}a==b.src&&g(e[a],b,d),i()},f.onerror=i,f.src=a,f&&f.complete&&f.onload())},i=function(){var a,b,e=function(){var e,f,g,h=c.getElementsByTagName("img"),i={elements:[]};for(d.setupRun(i),a=!1,clearTimeout(b),e=0,f=h.length;f>e;e++)g=h[e][d.ns],g&&g.curCan&&(d.setRes.res(g.curCan,g.curCan.set.sizes),d.setSize(h[e]));d.teardownRun(i)};return function(){!a&&f.addSize&&(a=!0,clearTimeout(b),b=setTimeout(e))}}();d.setSize=function(a){var c,e=a[d.ns],g=e.curCan;e.dims===b&&(e.dims=a.getAttribute("height")&&a.getAttribute("width")),f.addSize&&g&&!e.dims&&(c=d.makeUrl(g.url),c==a.src&&c!==e.pendingURLSize&&h(c,a,e))},window.addEventListener&&!window.HTMLPictureElement&&addEventListener("resize",i,!1),f.addSize="addSize"in f?!!f.addSize:!0,i()}),function(a){"use strict";var b,c=0,d=function(){window.respimage&&a(window.respimage),(window.respimage||c>9999)&&clearInterval(b),c++};b=setInterval(d,8),d()}(function(a){"use strict";var b=a._,c=0,d=function(a,c){var d;for(d=0;d<a.length;d++)b.types[a[d]]=c};return window.HTMLPictureElement&&!b.cfg.uT?void(a.testTypeSupport=function(){}):(b.types["image/bmp"]=!0,b.types["image/x-bmp"]=!0,a.testTypeSupport=function(b,e,f,g){"string"==typeof b&&(b=b.split(/\s*\,*\s+/g));var h,i="pending",j=document.createElement("img"),k=function(){c--,d(b,i),1>c&&a({reevaluate:!0})};return g&&(h=document.createElement("canvas"),!h.getContext)?void d(b,!1):(j.onload=function(){var a;i=!0,f&&(i=j.width==f),g&&(a=h.getContext("2d"),a.drawImage(j,0,0),i=0===a.getImageData(0,0,1,1).data[3]),k()},j.onerror=function(){i=!1,k()},c++,d(b,"pending"),void(j.src=e))},a.testTypeSupport("image/webp","data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==",1),a.testTypeSupport("image/jp2 image/jpx image/jpm","data:image/jp2;base64,/0//UQAyAAAAAAABAAAAAgAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAEBwEBBwEBBwEBBwEB/1IADAAAAAEAAAQEAAH/XAAEQED/ZAAlAAFDcmVhdGVkIGJ5IE9wZW5KUEVHIHZlcnNpb24gMi4wLjD/kAAKAAAAAABYAAH/UwAJAQAABAQAAf9dAAUBQED/UwAJAgAABAQAAf9dAAUCQED/UwAJAwAABAQAAf9dAAUDQED/k8+kEAGvz6QQAa/PpBABr994EAk//9k=",1),a.testTypeSupport("image/vnd.ms-photo","data:image/vnd.ms-photo;base64,SUm8AQgAAAAFAAG8AQAQAAAASgAAAIC8BAABAAAAAQAAAIG8BAABAAAAAQAAAMC8BAABAAAAWgAAAMG8BAABAAAAHwAAAAAAAAAkw91vA07+S7GFPXd2jckNV01QSE9UTwAZAYBxAAAAABP/gAAEb/8AAQAAAQAAAA==",1),void a.testTypeSupport("video/vnd.mozilla.apng video/x-apng video/png video/apng video/x-mng video/x-png","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACGFjVEwAAAABAAAAAcMq2TYAAAANSURBVAiZY2BgYPgPAAEEAQB9ssjfAAAAGmZjVEwAAAAAAAAAAQAAAAEAAAAAAAAAAAD6A+gBAbNU+2sAAAARZmRBVAAAAAEImWNgYGBgAAAABQAB6MzFdgAAAABJRU5ErkJggg==",!1,!0))}),function(){webshim.isReady("picture",!0);var a="picture, img[srcset]";webshim.addReady(function(b){b.querySelector(a)&&window.respimage()})}(),/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */
window.matchMedia||(window.matchMedia=function(){"use strict";var a=window.styleMedia||window.media;if(!a){var b=document.createElement("style"),c=document.getElementsByTagName("script")[0],d=null;b.type="text/css",b.id="matchmediajs-test",c.parentNode.insertBefore(b,c),d="getComputedStyle"in window&&window.getComputedStyle(b,null)||b.currentStyle,a={matchMedium:function(a){var c="@media "+a+"{ #matchmediajs-test { width: 1px; } }";return b.styleSheet?b.styleSheet.cssText=c:b.textContent=c,"1px"===d.width}}}return function(b){return{matches:a.matchMedium(b||"all"),media:b||"all"}}}()),/*! matchMedia() polyfill addListener/removeListener extension. Author & copyright (c) 2012: Scott Jehl. Dual MIT/BSD license */
function(){if(window.matchMedia&&window.matchMedia("all").addListener)return!1;var a=window.matchMedia,b=a("only all").matches,c=!1,d=0,e=[],f=function(){clearTimeout(d),d=setTimeout(function(){for(var b=0,c=e.length;c>b;b++){var d=e[b].mql,f=e[b].listeners||[],g=a(d.media).matches;if(g!==d.matches){d.matches=g;for(var h=0,i=f.length;i>h;h++)f[h].call(window,d)}}},30)};window.matchMedia=function(d){var g=a(d),h=[],i=0;return g.addListener=function(a){b&&(c||(c=!0,window.addEventListener("resize",f,!0)),0===i&&(i=e.push({mql:g,listeners:h})),h.push(a))},g.removeListener=function(a){for(var b=0,c=h.length;c>b;b++)h[b]===a&&h.splice(b,1)},g}}(),webshim.isReady("matchMedia",!0); | sajochiu/cdnjs | ajax/libs/webshim/1.16.0/minified/shims/combos/18.js | JavaScript | mit | 17,454 |
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {"NUMBER_FORMATS":{"DECIMAL_SEP":".","GROUP_SEP":",","PATTERNS":[{"minInt":1,"minFrac":0,"macFrac":0,"posPre":"","posSuf":"","negPre":"-","negSuf":"","gSize":3,"lgSize":3,"maxFrac":3},{"minInt":1,"minFrac":2,"macFrac":0,"posPre":"\u00A4 ","posSuf":"","negPre":"\u00A4 -","negSuf":"","gSize":3,"lgSize":3,"maxFrac":2}],"CURRENCY_SYM":"P"},"pluralCat":function (n) { if (n == 0 || n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;},"DATETIME_FORMATS":{"MONTH":["Enero","Pebrero","Marso","Abril","Mayo","Hunyo","Hulyo","Agosto","Setyembre","Oktubre","Nobyembre","Disyembre"],"SHORTMONTH":["Ene","Peb","Mar","Abr","May","Hun","Hul","Ago","Set","Okt","Nob","Dis"],"DAY":["Linggo","Lunes","Martes","Miyerkules","Huwebes","Biyernes","Sabado"],"SHORTDAY":["Lin","Lun","Mar","Mye","Huw","Bye","Sab"],"AMPMS":["AM","PM"],"medium":"MMM d, y HH:mm:ss","short":"M/d/yy HH:mm","fullDate":"EEEE, MMMM dd y","longDate":"MMMM d, y","mediumDate":"MMM d, y","shortDate":"M/d/yy","mediumTime":"HH:mm:ss","shortTime":"HH:mm"},"id":"tl-ph"});
}]); | barisaydinoglu/jsdelivr | files/angularjs/1.0.3/i18n/angular-locale_tl-ph.js | JavaScript | mit | 1,251 |
/*! Dust - Asynchronous Templating - v2.4.0
* http://linkedin.github.io/dustjs/
* Copyright (c) 2014 Aleksander Williams; Released under the MIT License */
!function(root){function Context(a,b,c,d){this.stack=a,this.global=b,this.blocks=c,this.templateName=d}function Stack(a,b,c,d){this.tail=b,this.isObject=a&&"object"==typeof a,this.head=a,this.index=c,this.of=d}function Stub(a){this.head=new Chunk(this),this.callback=a,this.out=""}function Stream(){this.head=new Chunk(this)}function Chunk(a,b,c){this.root=a,this.next=b,this.data=[],this.flushable=!1,this.taps=c}function Tap(a,b){this.head=a,this.tail=b}var dust={},NONE="NONE",ERROR="ERROR",WARN="WARN",INFO="INFO",DEBUG="DEBUG",loggingLevels=[DEBUG,INFO,WARN,ERROR,NONE],EMPTY_FUNC=function(){},logger={},originalLog,loggerContext,hasOwnProperty=Object.prototype.hasOwnProperty,getResult;dust.debugLevel=NONE,getResult=function(a,b){return a&&hasOwnProperty.call(a,b)?a[b]:void 0},root&&root.console&&root.console.log&&(loggerContext=root.console,originalLog=root.console.log),logger.log=loggerContext?function(){logger.log="function"==typeof originalLog?function(){originalLog.apply(loggerContext,arguments)}:function(){var a=Array.prototype.slice.apply(arguments).join(" ");originalLog(a)},logger.log.apply(this,arguments)}:function(){},dust.log=function(a,b){b=b||INFO,dust.debugLevel!==NONE&&dust.indexInArray(loggingLevels,b)>=dust.indexInArray(loggingLevels,dust.debugLevel)&&(dust.logQueue||(dust.logQueue=[]),dust.logQueue.push({message:a,type:b}),logger.log("[DUST "+b+"]: "+a))},dust.helpers={},dust.cache={},dust.register=function(a,b){a&&(dust.cache[a]=b)},dust.render=function(a,b,c){var d=new Stub(c).head;try{dust.load(a,d,Context.wrap(b,a)).end()}catch(e){d.setError(e)}},dust.stream=function(a,b){var c=new Stream,d=c.head;return dust.nextTick(function(){try{dust.load(a,c.head,Context.wrap(b,a)).end()}catch(e){d.setError(e)}}),c},dust.renderSource=function(a,b,c){return dust.compileFn(a)(b,c)},dust.compileFn=function(a,b){b=b||null;var c=dust.loadSource(dust.compile(a,b));return function(a,d){var e=d?new Stub(d):new Stream;return dust.nextTick(function(){"function"==typeof c?c(e.head,Context.wrap(a,b)).end():dust.log(new Error("Template ["+b+"] cannot be resolved to a Dust function"),ERROR)}),e}},dust.load=function(a,b,c){var d=dust.cache[a];return d?d(b,c):dust.onLoad?b.map(function(b){dust.onLoad(a,function(d,e){return d?b.setError(d):(dust.cache[a]||dust.loadSource(dust.compile(e,a)),void dust.cache[a](b,c).end())})}):b.setError(new Error("Template Not Found: "+a))},dust.loadSource=function(source,path){return eval(source)},dust.isArray=Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},dust.indexInArray=function(a,b,c){if(c=+c||0,Array.prototype.indexOf)return a.indexOf(b,c);if(void 0===a||null===a)throw new TypeError('cannot call method "indexOf" of null');var d=a.length;for(1/0===Math.abs(c)&&(c=0),0>c&&(c+=d,0>c&&(c=0));d>c;c++)if(a[c]===b)return c;return-1},dust.nextTick=function(){return function(a){setTimeout(a,0)}}(),dust.isEmpty=function(a){return dust.isArray(a)&&!a.length?!0:0===a?!1:!a},dust.filter=function(a,b,c){if(c)for(var d=0,e=c.length;e>d;d++){var f=c[d];"s"===f?b=null:"function"==typeof dust.filters[f]?a=dust.filters[f](a):dust.log("Invalid filter ["+f+"]",WARN)}return b&&(a=dust.filters[b](a)),a},dust.filters={h:function(a){return dust.escapeHtml(a)},j:function(a){return dust.escapeJs(a)},u:encodeURI,uc:encodeURIComponent,js:function(a){return JSON?JSON.stringify(a):(dust.log("JSON is undefined. JSON stringify has not been used on ["+a+"]",WARN),a)},jp:function(a){return JSON?JSON.parse(a):(dust.log("JSON is undefined. JSON parse has not been used on ["+a+"]",WARN),a)}},dust.makeBase=function(a){return new Context(new Stack,a)},Context.wrap=function(a,b){return a instanceof Context?a:new Context(new Stack(a),{},null,b)},Context.prototype.get=function(a,b){return"string"==typeof a&&("."===a[0]&&(b=!0,a=a.substr(1)),a=a.split(".")),this._get(b,a)},Context.prototype._get=function(a,b){var c,d,e,f,g=this.stack,h=1;if(d=b[0],e=b.length,a&&0===e)f=g,g=g.head;else{if(a)g&&(g=getResult(g.head,d));else{for(;g&&(!g.isObject||(f=g.head,c=getResult(g.head,d),void 0===c));)g=g.tail;g=void 0!==c?c:getResult(this.global,d)}for(;g&&e>h;)f=g,g=getResult(g,b[h]),h++}return"function"==typeof g?function(){try{return g.apply(f,arguments)}catch(a){return dust.log(a,ERROR)}}:(void 0===g&&dust.log("Cannot find the value for reference [{"+b.join(".")+"}] in template ["+this.getTemplateName()+"]"),g)},Context.prototype.getPath=function(a,b){return this._get(a,b)},Context.prototype.push=function(a,b,c){return new Context(new Stack(a,this.stack,b,c),this.global,this.blocks,this.getTemplateName())},Context.prototype.rebase=function(a){return new Context(new Stack(a),this.global,this.blocks,this.getTemplateName())},Context.prototype.current=function(){return this.stack.head},Context.prototype.getBlock=function(a){if("function"==typeof a){var b=new Chunk;a=a(b,this).data.join("")}var c=this.blocks;if(!c)return void dust.log("No blocks for context[{"+a+"}] in template ["+this.getTemplateName()+"]",DEBUG);for(var d,e=c.length;e--;)if(d=c[e][a])return d},Context.prototype.shiftBlocks=function(a){var b,c=this.blocks;return a?(b=c?c.concat([a]):[a],new Context(this.stack,this.global,b,this.getTemplateName())):this},Context.prototype.getTemplateName=function(){return this.templateName},Stub.prototype.flush=function(){for(var a=this.head;a;){if(!a.flushable)return a.error?(this.callback(a.error),dust.log("Chunk error ["+a.error+"] thrown. Ceasing to render this template.",WARN),void(this.flush=EMPTY_FUNC)):void 0;this.out+=a.data.join(""),a=a.next,this.head=a}this.callback(null,this.out)},Stream.prototype.flush=function(){for(var a=this.head;a;){if(!a.flushable)return a.error?(this.emit("error",a.error),dust.log("Chunk error ["+a.error+"] thrown. Ceasing to render this template.",WARN),void(this.flush=EMPTY_FUNC)):void 0;this.emit("data",a.data.join("")),a=a.next,this.head=a}this.emit("end")},Stream.prototype.emit=function(a,b){if(!this.events)return dust.log("No events to emit",INFO),!1;var c=this.events[a];if(!c)return dust.log("Event type ["+a+"] does not exist",WARN),!1;if("function"==typeof c)c(b);else if(dust.isArray(c))for(var d=c.slice(0),e=0,f=d.length;f>e;e++)d[e](b);else dust.log("Event Handler ["+c+"] is not of a type that is handled by emit",WARN)},Stream.prototype.on=function(a,b){return this.events||(this.events={}),this.events[a]?"function"==typeof this.events[a]?this.events[a]=[this.events[a],b]:this.events[a].push(b):(dust.log("Event type ["+a+"] does not exist. Using just the specified callback.",WARN),b?this.events[a]=b:dust.log("Callback for type ["+a+"] does not exist. Listener not registered.",WARN)),this},Stream.prototype.pipe=function(a){return this.on("data",function(b){try{a.write(b,"utf8")}catch(c){dust.log(c,ERROR)}}).on("end",function(){try{return a.end()}catch(b){dust.log(b,ERROR)}}).on("error",function(b){a.error(b)}),this},Chunk.prototype.write=function(a){var b=this.taps;return b&&(a=b.go(a)),this.data.push(a),this},Chunk.prototype.end=function(a){return a&&this.write(a),this.flushable=!0,this.root.flush(),this},Chunk.prototype.map=function(a){var b=new Chunk(this.root,this.next,this.taps),c=new Chunk(this.root,b,this.taps);return this.next=c,this.flushable=!0,a(c),b},Chunk.prototype.tap=function(a){var b=this.taps;return this.taps=b?b.push(a):new Tap(a),this},Chunk.prototype.untap=function(){return this.taps=this.taps.tail,this},Chunk.prototype.render=function(a,b){return a(this,b)},Chunk.prototype.reference=function(a,b,c,d){return"function"==typeof a&&(a=a.apply(b.current(),[this,b,null,{auto:c,filters:d}]),a instanceof Chunk)?a:dust.isEmpty(a)?this:this.write(dust.filter(a,c,d))},Chunk.prototype.section=function(a,b,c,d){if("function"==typeof a&&(a=a.apply(b.current(),[this,b,c,d]),a instanceof Chunk))return a;var e=c.block,f=c["else"];if(d&&(b=b.push(d)),dust.isArray(a)){if(e){var g=a.length,h=this;if(g>0){b.stack.head&&(b.stack.head.$len=g);for(var i=0;g>i;i++)b.stack.head&&(b.stack.head.$idx=i),h=e(h,b.push(a[i],i,g));return b.stack.head&&(b.stack.head.$idx=void 0,b.stack.head.$len=void 0),h}if(f)return f(this,b)}}else if(a===!0){if(e)return e(this,b)}else if(a||0===a){if(e)return e(this,b.push(a))}else if(f)return f(this,b);return dust.log("Not rendering section (#) block in template ["+b.getTemplateName()+"], because above key was not found",DEBUG),this},Chunk.prototype.exists=function(a,b,c){var d=c.block,e=c["else"];if(dust.isEmpty(a)){if(e)return e(this,b)}else if(d)return d(this,b);return dust.log("Not rendering exists (?) block in template ["+b.getTemplateName()+"], because above key was not found",DEBUG),this},Chunk.prototype.notexists=function(a,b,c){var d=c.block,e=c["else"];if(dust.isEmpty(a)){if(d)return d(this,b)}else if(e)return e(this,b);return dust.log("Not rendering not exists (^) block check in template ["+b.getTemplateName()+"], because above key was found",DEBUG),this},Chunk.prototype.block=function(a,b,c){var d=c.block;return a&&(d=a),d?d(this,b):this},Chunk.prototype.partial=function(a,b,c){var d;d=dust.makeBase(b.global),d.blocks=b.blocks,b.stack&&b.stack.tail&&(d.stack=b.stack.tail),c&&(d=d.push(c)),"string"==typeof a&&(d.templateName=a),d=d.push(b.stack.head);var e;return e="function"==typeof a?this.capture(a,d,function(a,b){d.templateName=d.templateName||a,dust.load(a,b,d).end()}):dust.load(a,this,d)},Chunk.prototype.helper=function(a,b,c,d){var e=this;try{return dust.helpers[a]?dust.helpers[a](e,b,c,d):(dust.log("Invalid helper ["+a+"]",WARN),e)}catch(f){return e.setError(f),e}},Chunk.prototype.capture=function(a,b,c){return this.map(function(d){var e=new Stub(function(a,b){a?d.setError(a):c(b,d)});a(e.head,b).end()})},Chunk.prototype.setError=function(a){return this.error=a,this.root.flush(),this},Tap.prototype.push=function(a){return new Tap(a,this)},Tap.prototype.go=function(a){for(var b=this;b;)a=b.head(a),b=b.tail;return a};var HCHARS=new RegExp(/[&<>\"\']/),AMP=/&/g,LT=/</g,GT=/>/g,QUOT=/\"/g,SQUOT=/\'/g;dust.escapeHtml=function(a){return"string"==typeof a&&HCHARS.test(a)?a.replace(AMP,"&").replace(LT,"<").replace(GT,">").replace(QUOT,""").replace(SQUOT,"'"):a};var BS=/\\/g,FS=/\//g,CR=/\r/g,LS=/\u2028/g,PS=/\u2029/g,NL=/\n/g,LF=/\f/g,SQ=/'/g,DQ=/"/g,TB=/\t/g;dust.escapeJs=function(a){return"string"==typeof a?a.replace(BS,"\\\\").replace(FS,"\\/").replace(DQ,'\\"').replace(SQ,"\\'").replace(CR,"\\r").replace(LS,"\\u2028").replace(PS,"\\u2029").replace(NL,"\\n").replace(LF,"\\f").replace(TB,"\\t"):a},"object"==typeof exports?module.exports=dust:root.dust=dust}(function(){return this}()),function(a,b){"object"==typeof exports?module.exports=b(require("./dust")):b(a.dust)}(this,function(dust){var a=function(){function b(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g,escape)+'"'}var c={parse:function(c,d){function e(a){var b={};for(var c in a)b[c]=a[c];return b}function f(a,b){for(var d=a.offset+b,e=a.offset;d>e;e++){var f=c.charAt(e);"\n"===f?(a.seenCR||a.line++,a.column=1,a.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(a.line++,a.column=1,a.seenCR=!0):(a.column++,a.seenCR=!1)}a.offset+=b}function g(a){R.offset<T.offset||(R.offset>T.offset&&(T=e(R),U=[]),U.push(a))}function h(){var a,b,c;for(c=e(R),a=[],b=i();null!==b;)a.push(b),b=i();return null!==a&&(a=function(a,b,c,d){return["body"].concat(d).concat([["line",b],["col",c]])}(c.offset,c.line,c.column,a)),null===a&&(R=e(c)),a}function i(){var a;return a=G(),null===a&&(a=H(),null===a&&(a=j(),null===a&&(a=q(),null===a&&(a=s(),null===a&&(a=p(),null===a&&(a=D())))))),a}function j(){var a,b,d,i,j,m,n,p,q;if(S++,p=e(R),q=e(R),a=k(),null!==a){for(b=[],d=O();null!==d;)b.push(d),d=O();null!==b?(d=K(),null!==d?(i=h(),null!==i?(j=o(),null!==j?(m=l(),m=null!==m?m:"",null!==m?(n=function(a,b,c,d,e,f,g){if(!g||d[1].text!==g.text)throw new Error("Expected end tag for "+d[1].text+" but it was not found. At line : "+b+", column : "+c);return!0}(R.offset,R.line,R.column,a,i,j,m)?"":null,null!==n?a=[a,b,d,i,j,m,n]:(a=null,R=e(q))):(a=null,R=e(q))):(a=null,R=e(q))):(a=null,R=e(q))):(a=null,R=e(q))):(a=null,R=e(q))}else a=null,R=e(q);if(null!==a&&(a=function(a,b,c,d,e,f){return f.push(["param",["literal","block"],e]),d.push(f),d.concat([["line",b],["col",c]])}(p.offset,p.line,p.column,a[0],a[3],a[4],a[5])),null===a&&(R=e(p)),null===a){if(p=e(R),q=e(R),a=k(),null!==a){for(b=[],d=O();null!==d;)b.push(d),d=O();null!==b?(47===c.charCodeAt(R.offset)?(d="/",f(R,1)):(d=null,0===S&&g('"/"')),null!==d?(i=K(),null!==i?a=[a,b,d,i]:(a=null,R=e(q))):(a=null,R=e(q))):(a=null,R=e(q))}else a=null,R=e(q);null!==a&&(a=function(a,b,c,d){return d.push(["bodies"]),d.concat([["line",b],["col",c]])}(p.offset,p.line,p.column,a[0])),null===a&&(R=e(p))}return S--,0===S&&null===a&&g("section"),a}function k(){var a,b,d,h,i,j,k,l;if(k=e(R),l=e(R),a=J(),null!==a)if(/^[#?^<+@%]/.test(c.charAt(R.offset))?(b=c.charAt(R.offset),f(R,1)):(b=null,0===S&&g("[#?^<+@%]")),null!==b){for(d=[],h=O();null!==h;)d.push(h),h=O();null!==d?(h=t(),null!==h?(i=m(),null!==i?(j=n(),null!==j?a=[a,b,d,h,i,j]:(a=null,R=e(l))):(a=null,R=e(l))):(a=null,R=e(l))):(a=null,R=e(l))}else a=null,R=e(l);else a=null,R=e(l);return null!==a&&(a=function(a,b,c,d,e,f,g){return[d,e,f,g]}(k.offset,k.line,k.column,a[1],a[3],a[4],a[5])),null===a&&(R=e(k)),a}function l(){var a,b,d,h,i,j,k,l;if(S++,k=e(R),l=e(R),a=J(),null!==a)if(47===c.charCodeAt(R.offset)?(b="/",f(R,1)):(b=null,0===S&&g('"/"')),null!==b){for(d=[],h=O();null!==h;)d.push(h),h=O();if(null!==d)if(h=t(),null!==h){for(i=[],j=O();null!==j;)i.push(j),j=O();null!==i?(j=K(),null!==j?a=[a,b,d,h,i,j]:(a=null,R=e(l))):(a=null,R=e(l))}else a=null,R=e(l);else a=null,R=e(l)}else a=null,R=e(l);else a=null,R=e(l);return null!==a&&(a=function(a,b,c,d){return d}(k.offset,k.line,k.column,a[3])),null===a&&(R=e(k)),S--,0===S&&null===a&&g("end tag"),a}function m(){var a,b,d,h,i;return d=e(R),h=e(R),i=e(R),58===c.charCodeAt(R.offset)?(a=":",f(R,1)):(a=null,0===S&&g('":"')),null!==a?(b=t(),null!==b?a=[a,b]:(a=null,R=e(i))):(a=null,R=e(i)),null!==a&&(a=function(a,b,c,d){return d}(h.offset,h.line,h.column,a[1])),null===a&&(R=e(h)),a=null!==a?a:"",null!==a&&(a=function(a,b,c,d){return d?["context",d]:["context"]}(d.offset,d.line,d.column,a)),null===a&&(R=e(d)),a}function n(){var a,b,d,h,i,j,k,l;if(S++,j=e(R),a=[],k=e(R),l=e(R),d=O(),null!==d)for(b=[];null!==d;)b.push(d),d=O();else b=null;for(null!==b?(d=y(),null!==d?(61===c.charCodeAt(R.offset)?(h="=",f(R,1)):(h=null,0===S&&g('"="')),null!==h?(i=u(),null===i&&(i=t(),null===i&&(i=B())),null!==i?b=[b,d,h,i]:(b=null,R=e(l))):(b=null,R=e(l))):(b=null,R=e(l))):(b=null,R=e(l)),null!==b&&(b=function(a,b,c,d,e){return["param",["literal",d],e]}(k.offset,k.line,k.column,b[1],b[3])),null===b&&(R=e(k));null!==b;){if(a.push(b),k=e(R),l=e(R),d=O(),null!==d)for(b=[];null!==d;)b.push(d),d=O();else b=null;null!==b?(d=y(),null!==d?(61===c.charCodeAt(R.offset)?(h="=",f(R,1)):(h=null,0===S&&g('"="')),null!==h?(i=u(),null===i&&(i=t(),null===i&&(i=B())),null!==i?b=[b,d,h,i]:(b=null,R=e(l))):(b=null,R=e(l))):(b=null,R=e(l))):(b=null,R=e(l)),null!==b&&(b=function(a,b,c,d,e){return["param",["literal",d],e]}(k.offset,k.line,k.column,b[1],b[3])),null===b&&(R=e(k))}return null!==a&&(a=function(a,b,c,d){return["params"].concat(d)}(j.offset,j.line,j.column,a)),null===a&&(R=e(j)),S--,0===S&&null===a&&g("params"),a}function o(){var a,b,d,i,j,k,l,m,n;for(S++,l=e(R),a=[],m=e(R),n=e(R),b=J(),null!==b?(58===c.charCodeAt(R.offset)?(d=":",f(R,1)):(d=null,0===S&&g('":"')),null!==d?(i=y(),null!==i?(j=K(),null!==j?(k=h(),null!==k?b=[b,d,i,j,k]:(b=null,R=e(n))):(b=null,R=e(n))):(b=null,R=e(n))):(b=null,R=e(n))):(b=null,R=e(n)),null!==b&&(b=function(a,b,c,d,e){return["param",["literal",d],e]}(m.offset,m.line,m.column,b[2],b[4])),null===b&&(R=e(m));null!==b;)a.push(b),m=e(R),n=e(R),b=J(),null!==b?(58===c.charCodeAt(R.offset)?(d=":",f(R,1)):(d=null,0===S&&g('":"')),null!==d?(i=y(),null!==i?(j=K(),null!==j?(k=h(),null!==k?b=[b,d,i,j,k]:(b=null,R=e(n))):(b=null,R=e(n))):(b=null,R=e(n))):(b=null,R=e(n))):(b=null,R=e(n)),null!==b&&(b=function(a,b,c,d,e){return["param",["literal",d],e]}(m.offset,m.line,m.column,b[2],b[4])),null===b&&(R=e(m));return null!==a&&(a=function(a,b,c,d){return["bodies"].concat(d)}(l.offset,l.line,l.column,a)),null===a&&(R=e(l)),S--,0===S&&null===a&&g("bodies"),a}function p(){var a,b,c,d,f,h;return S++,f=e(R),h=e(R),a=J(),null!==a?(b=t(),null!==b?(c=r(),null!==c?(d=K(),null!==d?a=[a,b,c,d]:(a=null,R=e(h))):(a=null,R=e(h))):(a=null,R=e(h))):(a=null,R=e(h)),null!==a&&(a=function(a,b,c,d,e){return["reference",d,e].concat([["line",b],["col",c]])}(f.offset,f.line,f.column,a[1],a[2])),null===a&&(R=e(f)),S--,0===S&&null===a&&g("reference"),a}function q(){var a,b,d,h,i,j,k,l,o,p,q,r;if(S++,p=e(R),q=e(R),a=J(),null!==a)if(62===c.charCodeAt(R.offset)?(b=">",f(R,1)):(b=null,0===S&&g('">"')),null===b&&(43===c.charCodeAt(R.offset)?(b="+",f(R,1)):(b=null,0===S&&g('"+"'))),null!==b){for(d=[],h=O();null!==h;)d.push(h),h=O();if(null!==d)if(r=e(R),h=y(),null!==h&&(h=function(a,b,c,d){return["literal",d]}(r.offset,r.line,r.column,h)),null===h&&(R=e(r)),null===h&&(h=B()),null!==h)if(i=m(),null!==i)if(j=n(),null!==j){for(k=[],l=O();null!==l;)k.push(l),l=O();null!==k?(47===c.charCodeAt(R.offset)?(l="/",f(R,1)):(l=null,0===S&&g('"/"')),null!==l?(o=K(),null!==o?a=[a,b,d,h,i,j,k,l,o]:(a=null,R=e(q))):(a=null,R=e(q))):(a=null,R=e(q))}else a=null,R=e(q);else a=null,R=e(q);else a=null,R=e(q);else a=null,R=e(q)}else a=null,R=e(q);else a=null,R=e(q);return null!==a&&(a=function(a,b,c,d,e,f,g){var h=">"===d?"partial":d;return[h,e,f,g].concat([["line",b],["col",c]])}(p.offset,p.line,p.column,a[1],a[3],a[4],a[5])),null===a&&(R=e(p)),S--,0===S&&null===a&&g("partial"),a}function r(){var a,b,d,h,i,j;for(S++,h=e(R),a=[],i=e(R),j=e(R),124===c.charCodeAt(R.offset)?(b="|",f(R,1)):(b=null,0===S&&g('"|"')),null!==b?(d=y(),null!==d?b=[b,d]:(b=null,R=e(j))):(b=null,R=e(j)),null!==b&&(b=function(a,b,c,d){return d}(i.offset,i.line,i.column,b[1])),null===b&&(R=e(i));null!==b;)a.push(b),i=e(R),j=e(R),124===c.charCodeAt(R.offset)?(b="|",f(R,1)):(b=null,0===S&&g('"|"')),null!==b?(d=y(),null!==d?b=[b,d]:(b=null,R=e(j))):(b=null,R=e(j)),null!==b&&(b=function(a,b,c,d){return d}(i.offset,i.line,i.column,b[1])),null===b&&(R=e(i));return null!==a&&(a=function(a,b,c,d){return["filters"].concat(d)}(h.offset,h.line,h.column,a)),null===a&&(R=e(h)),S--,0===S&&null===a&&g("filters"),a}function s(){var a,b,d,h,i,j;return S++,i=e(R),j=e(R),a=J(),null!==a?(126===c.charCodeAt(R.offset)?(b="~",f(R,1)):(b=null,0===S&&g('"~"')),null!==b?(d=y(),null!==d?(h=K(),null!==h?a=[a,b,d,h]:(a=null,R=e(j))):(a=null,R=e(j))):(a=null,R=e(j))):(a=null,R=e(j)),null!==a&&(a=function(a,b,c,d){return["special",d].concat([["line",b],["col",c]])}(i.offset,i.line,i.column,a[2])),null===a&&(R=e(i)),S--,0===S&&null===a&&g("special"),a}function t(){var a,b;return S++,b=e(R),a=x(),null!==a&&(a=function(a,b,c,d){var e=["path"].concat(d);return e.text=d[1].join("."),e}(b.offset,b.line,b.column,a)),null===a&&(R=e(b)),null===a&&(b=e(R),a=y(),null!==a&&(a=function(a,b,c,d){var e=["key",d];return e.text=d,e}(b.offset,b.line,b.column,a)),null===a&&(R=e(b))),S--,0===S&&null===a&&g("identifier"),a}function u(){var a,b;return S++,b=e(R),a=v(),null===a&&(a=w()),null!==a&&(a=function(a,b,c,d){return["literal",d]}(b.offset,b.line,b.column,a)),null===a&&(R=e(b)),S--,0===S&&null===a&&g("number"),a}function v(){var a,b,d,h,i,j;if(S++,i=e(R),j=e(R),a=w(),null!==a)if(46===c.charCodeAt(R.offset)?(b=".",f(R,1)):(b=null,0===S&&g('"."')),null!==b){if(h=w(),null!==h)for(d=[];null!==h;)d.push(h),h=w();else d=null;null!==d?a=[a,b,d]:(a=null,R=e(j))}else a=null,R=e(j);else a=null,R=e(j);return null!==a&&(a=function(a,b,c,d,e){return parseFloat(d+"."+e.join(""))}(i.offset,i.line,i.column,a[0],a[2])),null===a&&(R=e(i)),S--,0===S&&null===a&&g("float"),a}function w(){var a,b,d;if(S++,d=e(R),/^[0-9]/.test(c.charAt(R.offset))?(b=c.charAt(R.offset),f(R,1)):(b=null,0===S&&g("[0-9]")),null!==b)for(a=[];null!==b;)a.push(b),/^[0-9]/.test(c.charAt(R.offset))?(b=c.charAt(R.offset),f(R,1)):(b=null,0===S&&g("[0-9]"));else a=null;return null!==a&&(a=function(a,b,c,d){return parseInt(d.join(""),10)}(d.offset,d.line,d.column,a)),null===a&&(R=e(d)),S--,0===S&&null===a&&g("integer"),a}function x(){var a,b,d,h,i;if(S++,h=e(R),i=e(R),a=y(),a=null!==a?a:"",null!==a){if(d=A(),null===d&&(d=z()),null!==d)for(b=[];null!==d;)b.push(d),d=A(),null===d&&(d=z());else b=null;null!==b?a=[a,b]:(a=null,R=e(i))}else a=null,R=e(i);if(null!==a&&(a=function(a,b,c,d,e){return e=e[0],d&&e?(e.unshift(d),[!1,e].concat([["line",b],["col",c]])):[!0,e].concat([["line",b],["col",c]])}(h.offset,h.line,h.column,a[0],a[1])),null===a&&(R=e(h)),null===a){if(h=e(R),i=e(R),46===c.charCodeAt(R.offset)?(a=".",f(R,1)):(a=null,0===S&&g('"."')),null!==a){for(b=[],d=A(),null===d&&(d=z());null!==d;)b.push(d),d=A(),null===d&&(d=z());null!==b?a=[a,b]:(a=null,R=e(i))}else a=null,R=e(i);null!==a&&(a=function(a,b,c,d){return d.length>0?[!0,d[0]].concat([["line",b],["col",c]]):[!0,[]].concat([["line",b],["col",c]])}(h.offset,h.line,h.column,a[1])),null===a&&(R=e(h))}return S--,0===S&&null===a&&g("path"),a}function y(){var a,b,d,h,i;if(S++,h=e(R),i=e(R),/^[a-zA-Z_$]/.test(c.charAt(R.offset))?(a=c.charAt(R.offset),f(R,1)):(a=null,0===S&&g("[a-zA-Z_$]")),null!==a){for(b=[],/^[0-9a-zA-Z_$\-]/.test(c.charAt(R.offset))?(d=c.charAt(R.offset),f(R,1)):(d=null,0===S&&g("[0-9a-zA-Z_$\\-]"));null!==d;)b.push(d),/^[0-9a-zA-Z_$\-]/.test(c.charAt(R.offset))?(d=c.charAt(R.offset),f(R,1)):(d=null,0===S&&g("[0-9a-zA-Z_$\\-]"));null!==b?a=[a,b]:(a=null,R=e(i))}else a=null,R=e(i);return null!==a&&(a=function(a,b,c,d,e){return d+e.join("")}(h.offset,h.line,h.column,a[0],a[1])),null===a&&(R=e(h)),S--,0===S&&null===a&&g("key"),a}function z(){var a,b,d,h,i,j,k,l;if(S++,h=e(R),i=e(R),j=e(R),k=e(R),a=L(),null!==a){if(l=e(R),/^[0-9]/.test(c.charAt(R.offset))?(d=c.charAt(R.offset),f(R,1)):(d=null,0===S&&g("[0-9]")),null!==d)for(b=[];null!==d;)b.push(d),/^[0-9]/.test(c.charAt(R.offset))?(d=c.charAt(R.offset),f(R,1)):(d=null,0===S&&g("[0-9]"));else b=null;null!==b&&(b=function(a,b,c,d){return d.join("")}(l.offset,l.line,l.column,b)),null===b&&(R=e(l)),null===b&&(b=t()),null!==b?(d=M(),null!==d?a=[a,b,d]:(a=null,R=e(k))):(a=null,R=e(k))}else a=null,R=e(k);return null!==a&&(a=function(a,b,c,d){return d}(j.offset,j.line,j.column,a[1])),null===a&&(R=e(j)),null!==a?(b=A(),b=null!==b?b:"",null!==b?a=[a,b]:(a=null,R=e(i))):(a=null,R=e(i)),null!==a&&(a=function(a,b,c,d,e){return e?e.unshift(d):e=[d],e}(h.offset,h.line,h.column,a[0],a[1])),null===a&&(R=e(h)),S--,0===S&&null===a&&g("array"),a}function A(){var a,b,d,h,i,j,k;if(S++,h=e(R),i=e(R),j=e(R),k=e(R),46===c.charCodeAt(R.offset)?(b=".",f(R,1)):(b=null,0===S&&g('"."')),null!==b?(d=y(),null!==d?b=[b,d]:(b=null,R=e(k))):(b=null,R=e(k)),null!==b&&(b=function(a,b,c,d){return d}(j.offset,j.line,j.column,b[1])),null===b&&(R=e(j)),null!==b)for(a=[];null!==b;)a.push(b),j=e(R),k=e(R),46===c.charCodeAt(R.offset)?(b=".",f(R,1)):(b=null,0===S&&g('"."')),null!==b?(d=y(),null!==d?b=[b,d]:(b=null,R=e(k))):(b=null,R=e(k)),null!==b&&(b=function(a,b,c,d){return d}(j.offset,j.line,j.column,b[1])),null===b&&(R=e(j));else a=null;return null!==a?(b=z(),b=null!==b?b:"",null!==b?a=[a,b]:(a=null,R=e(i))):(a=null,R=e(i)),null!==a&&(a=function(a,b,c,d,e){return e?d.concat(e):d}(h.offset,h.line,h.column,a[0],a[1])),null===a&&(R=e(h)),S--,0===S&&null===a&&g("array_part"),a}function B(){var a,b,d,h,i;if(S++,h=e(R),i=e(R),34===c.charCodeAt(R.offset)?(a='"',f(R,1)):(a=null,0===S&&g('"\\""')),null!==a?(34===c.charCodeAt(R.offset)?(b='"',f(R,1)):(b=null,0===S&&g('"\\""')),null!==b?a=[a,b]:(a=null,R=e(i))):(a=null,R=e(i)),null!==a&&(a=function(a,b,c){return["literal",""].concat([["line",b],["col",c]])}(h.offset,h.line,h.column)),null===a&&(R=e(h)),null===a&&(h=e(R),i=e(R),34===c.charCodeAt(R.offset)?(a='"',f(R,1)):(a=null,0===S&&g('"\\""')),null!==a?(b=E(),null!==b?(34===c.charCodeAt(R.offset)?(d='"',f(R,1)):(d=null,0===S&&g('"\\""')),null!==d?a=[a,b,d]:(a=null,R=e(i))):(a=null,R=e(i))):(a=null,R=e(i)),null!==a&&(a=function(a,b,c,d){return["literal",d].concat([["line",b],["col",c]])}(h.offset,h.line,h.column,a[1])),null===a&&(R=e(h)),null===a)){if(h=e(R),i=e(R),34===c.charCodeAt(R.offset)?(a='"',f(R,1)):(a=null,0===S&&g('"\\""')),null!==a){if(d=C(),null!==d)for(b=[];null!==d;)b.push(d),d=C();else b=null;null!==b?(34===c.charCodeAt(R.offset)?(d='"',f(R,1)):(d=null,0===S&&g('"\\""')),null!==d?a=[a,b,d]:(a=null,R=e(i))):(a=null,R=e(i))}else a=null,R=e(i);null!==a&&(a=function(a,b,c,d){return["body"].concat(d).concat([["line",b],["col",c]])}(h.offset,h.line,h.column,a[1])),null===a&&(R=e(h))}return S--,0===S&&null===a&&g("inline"),a}function C(){var a,b;return a=s(),null===a&&(a=p(),null===a&&(b=e(R),a=E(),null!==a&&(a=function(a,b,c,d){return["buffer",d]}(b.offset,b.line,b.column,a)),null===a&&(R=e(b)))),a}function D(){var a,b,d,h,i,j,k,l,m,n;if(S++,k=e(R),l=e(R),a=N(),null!==a){for(b=[],d=O();null!==d;)b.push(d),d=O();null!==b?a=[a,b]:(a=null,R=e(l))}else a=null,R=e(l);if(null!==a&&(a=function(a,b,c,d,e){return["format",d,e.join("")].concat([["line",b],["col",c]])}(k.offset,k.line,k.column,a[0],a[1])),null===a&&(R=e(k)),null===a){if(k=e(R),l=e(R),m=e(R),n=e(R),S++,b=I(),S--,null===b?b="":(b=null,R=e(n)),null!==b?(n=e(R),S++,d=G(),S--,null===d?d="":(d=null,R=e(n)),null!==d?(n=e(R),S++,h=H(),S--,null===h?h="":(h=null,R=e(n)),null!==h?(n=e(R),S++,i=N(),S--,null===i?i="":(i=null,R=e(n)),null!==i?(c.length>R.offset?(j=c.charAt(R.offset),f(R,1)):(j=null,0===S&&g("any character")),null!==j?b=[b,d,h,i,j]:(b=null,R=e(m))):(b=null,R=e(m))):(b=null,R=e(m))):(b=null,R=e(m))):(b=null,R=e(m)),null!==b&&(b=function(a,b,c,d){return d}(l.offset,l.line,l.column,b[4])),null===b&&(R=e(l)),null!==b)for(a=[];null!==b;)a.push(b),l=e(R),m=e(R),n=e(R),S++,b=I(),S--,null===b?b="":(b=null,R=e(n)),null!==b?(n=e(R),S++,d=G(),S--,null===d?d="":(d=null,R=e(n)),null!==d?(n=e(R),S++,h=H(),S--,null===h?h="":(h=null,R=e(n)),null!==h?(n=e(R),S++,i=N(),S--,null===i?i="":(i=null,R=e(n)),null!==i?(c.length>R.offset?(j=c.charAt(R.offset),f(R,1)):(j=null,0===S&&g("any character")),null!==j?b=[b,d,h,i,j]:(b=null,R=e(m))):(b=null,R=e(m))):(b=null,R=e(m))):(b=null,R=e(m))):(b=null,R=e(m)),null!==b&&(b=function(a,b,c,d){return d}(l.offset,l.line,l.column,b[4])),null===b&&(R=e(l));else a=null;null!==a&&(a=function(a,b,c,d){return["buffer",d.join("")].concat([["line",b],["col",c]])}(k.offset,k.line,k.column,a)),null===a&&(R=e(k))}return S--,0===S&&null===a&&g("buffer"),a}function E(){var a,b,d,h,i,j,k;if(S++,h=e(R),i=e(R),j=e(R),k=e(R),S++,b=I(),S--,null===b?b="":(b=null,R=e(k)),null!==b?(d=F(),null===d&&(/^[^"]/.test(c.charAt(R.offset))?(d=c.charAt(R.offset),f(R,1)):(d=null,0===S&&g('[^"]'))),null!==d?b=[b,d]:(b=null,R=e(j))):(b=null,R=e(j)),null!==b&&(b=function(a,b,c,d){return d}(i.offset,i.line,i.column,b[1])),null===b&&(R=e(i)),null!==b)for(a=[];null!==b;)a.push(b),i=e(R),j=e(R),k=e(R),S++,b=I(),S--,null===b?b="":(b=null,R=e(k)),null!==b?(d=F(),null===d&&(/^[^"]/.test(c.charAt(R.offset))?(d=c.charAt(R.offset),f(R,1)):(d=null,0===S&&g('[^"]'))),null!==d?b=[b,d]:(b=null,R=e(j))):(b=null,R=e(j)),null!==b&&(b=function(a,b,c,d){return d}(i.offset,i.line,i.column,b[1])),null===b&&(R=e(i));else a=null;return null!==a&&(a=function(a,b,c,d){return d.join("")}(h.offset,h.line,h.column,a)),null===a&&(R=e(h)),S--,0===S&&null===a&&g("literal"),a}function F(){var a,b;return b=e(R),'\\"'===c.substr(R.offset,2)?(a='\\"',f(R,2)):(a=null,0===S&&g('"\\\\\\""')),null!==a&&(a=function(){return'"'}(b.offset,b.line,b.column)),null===a&&(R=e(b)),a}function G(){var a,b,d,h,i,j,k,l,m;if(S++,i=e(R),j=e(R),"{`"===c.substr(R.offset,2)?(a="{`",f(R,2)):(a=null,0===S&&g('"{`"')),null!==a){for(b=[],k=e(R),l=e(R),m=e(R),S++,"`}"===c.substr(R.offset,2)?(d="`}",f(R,2)):(d=null,0===S&&g('"`}"')),S--,null===d?d="":(d=null,R=e(m)),null!==d?(c.length>R.offset?(h=c.charAt(R.offset),f(R,1)):(h=null,0===S&&g("any character")),null!==h?d=[d,h]:(d=null,R=e(l))):(d=null,R=e(l)),null!==d&&(d=function(a,b,c,d){return d}(k.offset,k.line,k.column,d[1])),null===d&&(R=e(k));null!==d;)b.push(d),k=e(R),l=e(R),m=e(R),S++,"`}"===c.substr(R.offset,2)?(d="`}",f(R,2)):(d=null,0===S&&g('"`}"')),S--,null===d?d="":(d=null,R=e(m)),null!==d?(c.length>R.offset?(h=c.charAt(R.offset),f(R,1)):(h=null,0===S&&g("any character")),null!==h?d=[d,h]:(d=null,R=e(l))):(d=null,R=e(l)),null!==d&&(d=function(a,b,c,d){return d}(k.offset,k.line,k.column,d[1])),null===d&&(R=e(k));null!==b?("`}"===c.substr(R.offset,2)?(d="`}",f(R,2)):(d=null,0===S&&g('"`}"')),null!==d?a=[a,b,d]:(a=null,R=e(j))):(a=null,R=e(j))}else a=null,R=e(j);return null!==a&&(a=function(a,b,c,d){return["raw",d.join("")].concat([["line",b],["col",c]])}(i.offset,i.line,i.column,a[1])),null===a&&(R=e(i)),S--,0===S&&null===a&&g("raw"),a}function H(){var a,b,d,h,i,j,k,l,m;if(S++,i=e(R),j=e(R),"{!"===c.substr(R.offset,2)?(a="{!",f(R,2)):(a=null,0===S&&g('"{!"')),null!==a){for(b=[],k=e(R),l=e(R),m=e(R),S++,"!}"===c.substr(R.offset,2)?(d="!}",f(R,2)):(d=null,0===S&&g('"!}"')),S--,null===d?d="":(d=null,R=e(m)),null!==d?(c.length>R.offset?(h=c.charAt(R.offset),f(R,1)):(h=null,0===S&&g("any character")),null!==h?d=[d,h]:(d=null,R=e(l))):(d=null,R=e(l)),null!==d&&(d=function(a,b,c,d){return d}(k.offset,k.line,k.column,d[1])),null===d&&(R=e(k));null!==d;)b.push(d),k=e(R),l=e(R),m=e(R),S++,"!}"===c.substr(R.offset,2)?(d="!}",f(R,2)):(d=null,0===S&&g('"!}"')),S--,null===d?d="":(d=null,R=e(m)),null!==d?(c.length>R.offset?(h=c.charAt(R.offset),f(R,1)):(h=null,0===S&&g("any character")),null!==h?d=[d,h]:(d=null,R=e(l))):(d=null,R=e(l)),null!==d&&(d=function(a,b,c,d){return d}(k.offset,k.line,k.column,d[1])),null===d&&(R=e(k));null!==b?("!}"===c.substr(R.offset,2)?(d="!}",f(R,2)):(d=null,0===S&&g('"!}"')),null!==d?a=[a,b,d]:(a=null,R=e(j))):(a=null,R=e(j))}else a=null,R=e(j);return null!==a&&(a=function(a,b,c,d){return["comment",d.join("")].concat([["line",b],["col",c]])}(i.offset,i.line,i.column,a[1])),null===a&&(R=e(i)),S--,0===S&&null===a&&g("comment"),a}function I(){var a,b,d,h,i,j,k,l,m,n,o;if(m=e(R),a=J(),null!==a){for(b=[],d=O();null!==d;)b.push(d),d=O();if(null!==b)if(/^[#?^><+%:@\/~%]/.test(c.charAt(R.offset))?(d=c.charAt(R.offset),f(R,1)):(d=null,0===S&&g("[#?^><+%:@\\/~%]")),null!==d){for(h=[],i=O();null!==i;)h.push(i),i=O();if(null!==h){if(n=e(R),o=e(R),S++,j=K(),S--,null===j?j="":(j=null,R=e(o)),null!==j?(o=e(R),S++,k=N(),S--,null===k?k="":(k=null,R=e(o)),null!==k?(c.length>R.offset?(l=c.charAt(R.offset),f(R,1)):(l=null,0===S&&g("any character")),null!==l?j=[j,k,l]:(j=null,R=e(n))):(j=null,R=e(n))):(j=null,R=e(n)),null!==j)for(i=[];null!==j;)i.push(j),n=e(R),o=e(R),S++,j=K(),S--,null===j?j="":(j=null,R=e(o)),null!==j?(o=e(R),S++,k=N(),S--,null===k?k="":(k=null,R=e(o)),null!==k?(c.length>R.offset?(l=c.charAt(R.offset),f(R,1)):(l=null,0===S&&g("any character")),null!==l?j=[j,k,l]:(j=null,R=e(n))):(j=null,R=e(n))):(j=null,R=e(n));else i=null;if(null!==i){for(j=[],k=O();null!==k;)j.push(k),k=O();null!==j?(k=K(),null!==k?a=[a,b,d,h,i,j,k]:(a=null,R=e(m))):(a=null,R=e(m))}else a=null,R=e(m)}else a=null,R=e(m)}else a=null,R=e(m);else a=null,R=e(m)}else a=null,R=e(m);return null===a&&(a=p()),a}function J(){var a;return 123===c.charCodeAt(R.offset)?(a="{",f(R,1)):(a=null,0===S&&g('"{"')),a}function K(){var a;return 125===c.charCodeAt(R.offset)?(a="}",f(R,1)):(a=null,0===S&&g('"}"')),a}function L(){var a;return 91===c.charCodeAt(R.offset)?(a="[",f(R,1)):(a=null,0===S&&g('"["')),a}function M(){var a;return 93===c.charCodeAt(R.offset)?(a="]",f(R,1)):(a=null,0===S&&g('"]"')),a}function N(){var a;return 10===c.charCodeAt(R.offset)?(a="\n",f(R,1)):(a=null,0===S&&g('"\\n"')),null===a&&("\r\n"===c.substr(R.offset,2)?(a="\r\n",f(R,2)):(a=null,0===S&&g('"\\r\\n"')),null===a&&(13===c.charCodeAt(R.offset)?(a="\r",f(R,1)):(a=null,0===S&&g('"\\r"')),null===a&&(8232===c.charCodeAt(R.offset)?(a="\u2028",f(R,1)):(a=null,0===S&&g('"\\u2028"')),null===a&&(8233===c.charCodeAt(R.offset)?(a="\u2029",f(R,1)):(a=null,0===S&&g('"\\u2029"')))))),a
}function O(){var a;return/^[\t\x0B\f \xA0\uFEFF]/.test(c.charAt(R.offset))?(a=c.charAt(R.offset),f(R,1)):(a=null,0===S&&g("[\\t\\x0B\\f \\xA0\\uFEFF]")),null===a&&(a=N()),a}function P(a){a.sort();for(var b=null,c=[],d=0;d<a.length;d++)a[d]!==b&&(c.push(a[d]),b=a[d]);return c}var Q={body:h,part:i,section:j,sec_tag_start:k,end_tag:l,context:m,params:n,bodies:o,reference:p,partial:q,filters:r,special:s,identifier:t,number:u,"float":v,integer:w,path:x,key:y,array:z,array_part:A,inline:B,inline_part:C,buffer:D,literal:E,esc:F,raw:G,comment:H,tag:I,ld:J,rd:K,lb:L,rb:M,eol:N,ws:O};if(void 0!==d){if(void 0===Q[d])throw new Error("Invalid rule name: "+b(d)+".")}else d="body";var R={offset:0,line:1,column:1,seenCR:!1},S=0,T={offset:0,line:1,column:1,seenCR:!1},U=[],V=Q[d]();if(null===V||R.offset!==c.length){var W=Math.max(R.offset,T.offset),X=W<c.length?c.charAt(W):null,Y=R.offset>T.offset?R:T;throw new a.SyntaxError(P(U),X,W,Y.line,Y.column)}return V},toSource:function(){return this._source}};return c.SyntaxError=function(a,c,d,e,f){function g(a,c){var d,e;switch(a.length){case 0:d="end of input";break;case 1:d=a[0];break;default:d=a.slice(0,a.length-1).join(", ")+" or "+a[a.length-1]}return e=c?b(c):"end of input","Expected "+d+" but "+e+" found."}this.name="SyntaxError",this.expected=a,this.found=c,this.message=g(a,c),this.offset=d,this.line=e,this.column=f},c.SyntaxError.prototype=Error.prototype,c}();return dust.parse=a.parse,a}),function(a,b){"object"==typeof exports?module.exports=b(require("./parser").parse,require("./dust")):b(a.dust.parse,a.dust)}(this,function(a,dust){function b(a){var b={};return n.filterNode(b,a)}function c(a,b){var c,d,e,f=[b[0]];for(c=1,d=b.length;d>c;c++)e=n.filterNode(a,b[c]),e&&f.push(e);return f}function d(a,b){var c,d,e,f,g=[b[0]];for(d=1,e=b.length;e>d;d++)f=n.filterNode(a,b[d]),f&&("buffer"===f[0]?c?c[1]+=f[1]:(c=f,g.push(f)):(c=null,g.push(f)));return g}function e(a,b){return["buffer",p[b[1]]]}function f(a,b){return b}function g(){}function h(a,b){var c={name:b,bodies:[],blocks:{},index:0,auto:"h"};return"(function(){dust.register("+(b?'"'+b+'"':"null")+","+n.compileNode(c,a)+");"+i(c)+j(c)+"return body_0;})();"}function i(a){var b,c=[],d=a.blocks;for(b in d)c.push('"'+b+'":'+d[b]);return c.length?(a.blocks="ctx=ctx.shiftBlocks(blocks);","var blocks={"+c.join(",")+"};"):a.blocks=""}function j(a){var b,c,d=[],e=a.bodies,f=a.blocks;for(b=0,c=e.length;c>b;b++)d[b]="function body_"+b+"(chk,ctx){"+f+"return chk"+e[b]+";}";return d.join("")}function k(a,b){var c,d,e="";for(c=1,d=b.length;d>c;c++)e+=n.compileNode(a,b[c]);return e}function l(a,b,c){return"."+c+"("+n.compileNode(a,b[1])+","+n.compileNode(a,b[2])+","+n.compileNode(a,b[4])+","+n.compileNode(a,b[3])+")"}function m(a){return a.replace(q,"\\\\").replace(r,'\\"').replace(s,"\\f").replace(t,"\\n").replace(u,"\\r").replace(v,"\\t")}var n={},o=dust.isArray;n.compile=function(c,d){if(!d&&null!==d)throw new Error("Template name parameter cannot be undefined when calling dust.compile");try{var e=b(a(c));return h(e,d)}catch(f){if(!f.line||!f.column)throw f;throw new SyntaxError(f.message+" At line : "+f.line+", column : "+f.column)}},n.filterNode=function(a,b){return n.optimizers[b[0]](a,b)},n.optimizers={body:d,buffer:f,special:e,format:g,reference:c,"#":c,"?":c,"^":c,"<":c,"+":c,"@":c,"%":c,partial:c,context:c,params:c,bodies:c,param:c,filters:f,key:f,path:f,literal:f,raw:f,comment:g,line:g,col:g},n.pragmas={esc:function(a,b,c){var d,e=a.auto;return b||(b="h"),a.auto="s"===b?"":b,d=k(a,c.block),a.auto=e,d}};var p={s:" ",n:"\n",r:"\r",lb:"{",rb:"}"};n.compileNode=function(a,b){return n.nodes[b[0]](a,b)},n.nodes={body:function(a,b){var c=a.index++,d="body_"+c;return a.bodies[c]=k(a,b),d},buffer:function(a,b){return".write("+w(b[1])+")"},format:function(a,b){return".write("+w(b[1]+b[2])+")"},reference:function(a,b){return".reference("+n.compileNode(a,b[1])+",ctx,"+n.compileNode(a,b[2])+")"},"#":function(a,b){return l(a,b,"section")},"?":function(a,b){return l(a,b,"exists")},"^":function(a,b){return l(a,b,"notexists")},"<":function(a,b){for(var c=b[4],d=1,e=c.length;e>d;d++){var f=c[d],g=f[1][1];if("block"===g)return a.blocks[b[1].text]=n.compileNode(a,f[2]),""}return""},"+":function(a,b){return"undefined"==typeof b[1].text&&"undefined"==typeof b[4]?".block(ctx.getBlock("+n.compileNode(a,b[1])+",chk, ctx),"+n.compileNode(a,b[2])+", {},"+n.compileNode(a,b[3])+")":".block(ctx.getBlock("+w(b[1].text)+"),"+n.compileNode(a,b[2])+","+n.compileNode(a,b[4])+","+n.compileNode(a,b[3])+")"},"@":function(a,b){return".helper("+w(b[1].text)+","+n.compileNode(a,b[2])+","+n.compileNode(a,b[4])+","+n.compileNode(a,b[3])+")"},"%":function(a,b){var c,d,e,f,g,h,i,j,k,l=b[1][1];if(!n.pragmas[l])return"";for(c=b[4],d={},j=1,k=c.length;k>j;j++)h=c[j],d[h[1][1]]=h[2];for(e=b[3],f={},j=1,k=e.length;k>j;j++)i=e[j],f[i[1][1]]=i[2][1];return g=b[2][1]?b[2][1].text:null,n.pragmas[l](a,g,d,f)},partial:function(a,b){return".partial("+n.compileNode(a,b[1])+","+n.compileNode(a,b[2])+","+n.compileNode(a,b[3])+")"},context:function(a,b){return b[1]?"ctx.rebase("+n.compileNode(a,b[1])+")":"ctx"},params:function(a,b){for(var c=[],d=1,e=b.length;e>d;d++)c.push(n.compileNode(a,b[d]));return c.length?"{"+c.join(",")+"}":"{}"},bodies:function(a,b){for(var c=[],d=1,e=b.length;e>d;d++)c.push(n.compileNode(a,b[d]));return"{"+c.join(",")+"}"},param:function(a,b){return n.compileNode(a,b[1])+":"+n.compileNode(a,b[2])},filters:function(a,b){for(var c=[],d=1,e=b.length;e>d;d++){var f=b[d];c.push('"'+f+'"')}return'"'+a.auto+'"'+(c.length?",["+c.join(",")+"]":"")},key:function(a,b){return'ctx.get(["'+b[1]+'"], false)'},path:function(a,b){for(var c=b[1],d=b[2],e=[],f=0,g=d.length;g>f;f++)e.push(o(d[f])?n.compileNode(a,d[f]):'"'+d[f]+'"');return"ctx.getPath("+c+", ["+e.join(",")+"])"},literal:function(a,b){return w(b[1])},raw:function(a,b){return".write("+w(b[1])+")"}};var q=/\\/g,r=/"/g,s=/\f/g,t=/\n/g,u=/\r/g,v=/\t/g,w="undefined"==typeof JSON?function(a){return'"'+m(a)+'"'}:JSON.stringify;return dust.compile=n.compile,dust.filterNode=n.filterNode,dust.optimizers=n.optimizers,dust.pragmas=n.pragmas,dust.compileNode=n.compileNode,dust.nodes=n.nodes,n}); | magoni/cdnjs | ajax/libs/dustjs-linkedin/2.4.0/dust-full.min.js | JavaScript | mit | 38,630 |
<?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\Bridge\Twig\Tests\Translation;
use Symfony\Bridge\Twig\Extension\TranslationExtension;
use Symfony\Bridge\Twig\Translation\TwigExtractor;
use Symfony\Component\Translation\MessageCatalogue;
class TwigExtractorTest extends \PHPUnit_Framework_TestCase
{
/**
* @dataProvider getExtractData
*/
public function testExtract($template, $messages)
{
$loader = new \Twig_Loader_Array(array());
$twig = new \Twig_Environment($loader, array(
'strict_variables' => true,
'debug' => true,
'cache' => false,
'autoescape' => false,
));
$twig->addExtension(new TranslationExtension($this->getMock('Symfony\Component\Translation\TranslatorInterface')));
$extractor = new TwigExtractor($twig);
$extractor->setPrefix('prefix');
$catalogue = new MessageCatalogue('en');
$m = new \ReflectionMethod($extractor, 'extractTemplate');
$m->setAccessible(true);
$m->invoke($extractor, $template, $catalogue);
foreach ($messages as $key => $domain) {
$this->assertTrue($catalogue->has($key, $domain));
$this->assertEquals('prefix'.$key, $catalogue->get($key, $domain));
}
}
public function getExtractData()
{
return array(
array('{{ "new key" | trans() }}', array('new key' => 'messages')),
array('{{ "new key" | trans() | upper }}', array('new key' => 'messages')),
array('{{ "new key" | trans({}, "domain") }}', array('new key' => 'domain')),
array('{{ "new key" | transchoice(1) }}', array('new key' => 'messages')),
array('{{ "new key" | transchoice(1) | upper }}', array('new key' => 'messages')),
array('{{ "new key" | transchoice(1, {}, "domain") }}', array('new key' => 'domain')),
array('{% trans %}new key{% endtrans %}', array('new key' => 'messages')),
array('{% trans %} new key {% endtrans %}', array('new key' => 'messages')),
array('{% trans from "domain" %}new key{% endtrans %}', array('new key' => 'domain')),
array('{% set foo = "new key" | trans %}', array('new key' => 'messages')),
array('{{ 1 ? "new key" | trans : "another key" | trans }}', array('new key' => 'messages', 'another key' => 'messages')),
// make sure 'trans_default_domain' tag is supported
array('{% trans_default_domain "domain" %}{{ "new key"|trans }}', array('new key' => 'domain')),
array('{% trans_default_domain "domain" %}{{ "new key"|transchoice }}', array('new key' => 'domain')),
array('{% trans_default_domain "domain" %}{% trans %}new key{% endtrans %}', array('new key' => 'domain')),
// make sure this works with twig's named arguments
array('{{ "new key" | trans(domain="domain") }}', array('new key' => 'domain')),
array('{{ "new key" | transchoice(domain="domain", count=1) }}', array('new key' => 'domain')),
);
}
}
| mimadl3a/Projet-Seniorita | vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Translation/TwigExtractorTest.php | PHP | mit | 3,300 |
YUI.add('widget-locale', function (Y, NAME) {
/**
* Provides string support for widget with BCP 47 language tag lookup. This module has been deprecated.
* It's replaced by the "intl" module which provides generic internationalization and BCP 47 language tag
* support with externalization.
*
* @module widget-locale
* @deprecated This module has been deprecated. It's replaced by the "intl" module which provides
* generic internationalization and BCP 47 language tag support with externalization.
*/
var TRUE = true,
LOCALE = "locale",
INIT_VALUE = "initValue",
HYPHEN = "-",
EMPTY_STR = "",
Widget = Y.Widget;
/**
* @attribute locale
* @deprecated Use Y.config.lang and Y.Intl externalization support
* @description
* The default locale for the widget. NOTE: Using get/set on the "strings" attribute will
* return/set strings for this locale.
* @default "en"
* @type String
*/
Widget.ATTRS[LOCALE] = {
value: "en"
};
// Since strings support with locale needs the private _strs setup
Widget.ATTRS.strings.lazyAdd = false;
Y.mix(Widget.prototype, {
/**
* Sets strings for a particular locale, merging with any existing
* strings which may already be defined for the locale.
*
* @method _setStrings
* @protected
* @param {Object} strings The hash of string key/values to set
* @param {Object} locale The locale for the string values being set
*/
_setStrings : function(strings, locale) {
var strs = this._strs;
locale = locale.toLowerCase();
if (!strs[locale]) {
strs[locale] = {};
}
Y.aggregate(strs[locale], strings, TRUE);
return strs[locale];
},
/**
* Returns the strings key/value hash for a paricular locale, without locale lookup applied.
*
* @method _getStrings
* @protected
* @param {Object} locale
*/
_getStrings : function(locale) {
return this._strs[locale.toLowerCase()];
},
/**
* Gets the entire strings hash for a particular locale, performing locale lookup.
* <p>
* If no values of the key are defined for a particular locale the value for the
* default locale (in initial locale set for the class) is returned.
* </p>
* @method getStrings
* @param {String} locale (optional) The locale for which the string value is required. Defaults to the current locale, if not provided.
*/
// TODO: Optimize/Cache. Clear cache on _setStrings call.
getStrings : function(locale) {
locale = (locale || this.get(LOCALE)).toLowerCase();
var defLocale = this.getDefaultLocale().toLowerCase(),
defStrs = this._getStrings(defLocale),
strs = (defStrs) ? Y.merge(defStrs) : {},
localeSegments = locale.split(HYPHEN),
localeStrs,
i, l,
lookup;
// If locale is different than the default, or needs lookup support
if (locale !== defLocale || localeSegments.length > 1) {
lookup = EMPTY_STR;
for (i = 0, l = localeSegments.length; i < l; ++i) {
lookup += localeSegments[i];
localeStrs = this._getStrings(lookup);
if (localeStrs) {
Y.aggregate(strs, localeStrs, TRUE);
}
lookup += HYPHEN;
}
}
return strs;
},
/**
* Gets the string for a particular key, for a particular locale, performing locale lookup.
* <p>
* If no values if defined for the key, for the given locale, the value for the
* default locale (in initial locale set for the class) is returned.
* </p>
* @method getString
* @param {String} key The key.
* @param {String} locale (optional) The locale for which the string value is required. Defaults to the current locale, if not provided.
*/
getString : function(key, locale) {
locale = (locale || this.get(LOCALE)).toLowerCase();
var defLocale = (this.getDefaultLocale()).toLowerCase(),
strs = this._getStrings(defLocale) || {},
str = strs[key],
idx = locale.lastIndexOf(HYPHEN);
// If locale is different than the default, or needs lookup support
if (locale !== defLocale || idx != -1) {
do {
strs = this._getStrings(locale);
if (strs && key in strs) {
str = strs[key];
break;
}
idx = locale.lastIndexOf(HYPHEN);
// Chop of last locale segment
if (idx != -1) {
locale = locale.substring(0, idx);
}
} while (idx != -1);
}
return str;
},
/**
* Returns the default locale for the widget (the locale value defined by the
* widget class, or provided by the user during construction).
*
* @method getDefaultLocale
* @return {String} The default locale for the widget
*/
getDefaultLocale : function() {
return this._state.get(LOCALE, INIT_VALUE);
},
_strSetter : function(val) {
return this._setStrings(val, this.get(LOCALE));
},
_strGetter : function(val) {
return this._getStrings(this.get(LOCALE));
}
}, true);
}, '@VERSION@', {"requires": ["widget-base"]});
| pombredanne/cdnjs | ajax/libs/yui/3.12.0/widget-locale/widget-locale.js | JavaScript | mit | 5,422 |
'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": [
"\u043f\u0440\u0435 \u043f\u043e\u0434\u043d\u0435",
"\u043f\u043e\u043f\u043e\u0434\u043d\u0435"
],
"DAY": [
"\u043d\u0435\u0434\u0435\u0459\u0430",
"\u043f\u043e\u043d\u0435\u0434\u0435\u0459\u0430\u043a",
"\u0443\u0442\u043e\u0440\u0430\u043a",
"\u0441\u0440\u0438\u0458\u0435\u0434\u0430",
"\u0447\u0435\u0442\u0432\u0440\u0442\u0430\u043a",
"\u043f\u0435\u0442\u0430\u043a",
"\u0441\u0443\u0431\u043e\u0442\u0430"
],
"MONTH": [
"\u0458\u0430\u043d\u0443\u0430\u0440",
"\u0444\u0435\u0431\u0440\u0443\u0430\u0440",
"\u043c\u0430\u0440\u0442",
"\u0430\u043f\u0440\u0438\u043b",
"\u043c\u0430\u0458",
"\u0458\u0443\u043d\u0438",
"\u0458\u0443\u043b\u0438",
"\u0430\u0432\u0433\u0443\u0441\u0442",
"\u0441\u0435\u043f\u0442\u0435\u043c\u0431\u0430\u0440",
"\u043e\u043a\u0442\u043e\u0431\u0430\u0440",
"\u043d\u043e\u0432\u0435\u043c\u0431\u0430\u0440",
"\u0434\u0435\u0446\u0435\u043c\u0431\u0430\u0440"
],
"SHORTDAY": [
"\u043d\u0435\u0434",
"\u043f\u043e\u043d",
"\u0443\u0442\u043e",
"\u0441\u0440\u0438",
"\u0447\u0435\u0442",
"\u043f\u0435\u0442",
"\u0441\u0443\u0431"
],
"SHORTMONTH": [
"\u0458\u0430\u043d",
"\u0444\u0435\u0431",
"\u043c\u0430\u0440",
"\u0430\u043f\u0440",
"\u043c\u0430\u0458",
"\u0458\u0443\u043d",
"\u0458\u0443\u043b",
"\u0430\u0432\u0433",
"\u0441\u0435\u043f",
"\u043e\u043a\u0442",
"\u043d\u043e\u0432",
"\u0434\u0435\u0446"
],
"fullDate": "EEEE, dd. MMMM y.",
"longDate": "dd. MMMM y.",
"medium": "y-MM-dd HH:mm:ss",
"mediumDate": "y-MM-dd",
"mediumTime": "HH:mm:ss",
"short": "yy-MM-dd HH:mm",
"shortDate": "yy-MM-dd",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "din",
"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": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "sr-cyrl-ba",
"pluralCat": function (n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (vf.v == 0 && i % 10 == 1 && i % 100 != 11 || vf.f % 10 == 1 && vf.f % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14) || vf.f % 10 >= 2 && vf.f % 10 <= 4 && (vf.f % 100 < 12 || vf.f % 100 > 14)) { return PLURAL_CATEGORY.FEW; } return PLURAL_CATEGORY.OTHER;}
});
}]); | calebmer/cdnjs | ajax/libs/angular.js/1.3.0-beta.17/i18n/angular-locale_sr-cyrl-ba.js | JavaScript | mit | 3,554 |
'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": [
"pre podne",
"popodne"
],
"DAY": [
"nedelja",
"ponedeljak",
"utorak",
"sreda",
"\u010detvrtak",
"petak",
"subota"
],
"MONTH": [
"januar",
"februar",
"mart",
"april",
"maj",
"jun",
"jul",
"avgust",
"septembar",
"oktobar",
"novembar",
"decembar"
],
"SHORTDAY": [
"ned",
"pon",
"uto",
"sre",
"\u010det",
"pet",
"sub"
],
"SHORTMONTH": [
"jan",
"feb",
"mar",
"apr",
"maj",
"jun",
"jul",
"avg",
"sep",
"okt",
"nov",
"dec"
],
"fullDate": "EEEE, dd. MMMM y.",
"longDate": "dd. MMMM y.",
"medium": "dd.MM.y. HH.mm.ss",
"mediumDate": "dd.MM.y.",
"mediumTime": "HH.mm.ss",
"short": "d.M.yy. HH.mm",
"shortDate": "d.M.yy.",
"shortTime": "HH.mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "din",
"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": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "sr-latn-ba",
"pluralCat": function (n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (vf.v == 0 && i % 10 == 1 && i % 100 != 11 || vf.f % 10 == 1 && vf.f % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14) || vf.f % 10 >= 2 && vf.f % 10 <= 4 && (vf.f % 100 < 12 || vf.f % 100 > 14)) { return PLURAL_CATEGORY.FEW; } return PLURAL_CATEGORY.OTHER;}
});
}]); | raszi/cdnjs | ajax/libs/angular.js/1.3.0-beta.12/i18n/angular-locale_sr-latn-ba.js | JavaScript | mit | 2,612 |
'use strict';
var escapeStringRegexp = require('escape-string-regexp');
var ansiStyles = require('ansi-styles');
var stripAnsi = require('strip-ansi');
var hasAnsi = require('has-ansi');
var supportsColor = require('supports-color');
var defineProps = Object.defineProperties;
var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM);
function Chalk(options) {
// detect mode if not set manually
this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled;
}
// use bright blue on Windows as the normal blue color is illegible
if (isSimpleWindowsTerm) {
ansiStyles.blue.open = '\u001b[94m';
}
var styles = (function () {
var ret = {};
Object.keys(ansiStyles).forEach(function (key) {
ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
ret[key] = {
get: function () {
return build.call(this, this._styles.concat(key));
}
};
});
return ret;
})();
var proto = defineProps(function chalk() {}, styles);
function build(_styles) {
var builder = function () {
return applyStyle.apply(builder, arguments);
};
builder._styles = _styles;
builder.enabled = this.enabled;
// __proto__ is used because we must return a function, but there is
// no way to create a function with a different prototype.
/* eslint-disable no-proto */
builder.__proto__ = proto;
return builder;
}
function applyStyle() {
// support varags, but simply cast to string in case there's only one arg
var args = arguments;
var argsLen = args.length;
var str = argsLen !== 0 && String(arguments[0]);
if (argsLen > 1) {
// don't slice `arguments`, it prevents v8 optimizations
for (var a = 1; a < argsLen; a++) {
str += ' ' + args[a];
}
}
if (!this.enabled || !str) {
return str;
}
var nestedStyles = this._styles;
var i = nestedStyles.length;
// Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
// see https://github.com/chalk/chalk/issues/58
// If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
var originalDim = ansiStyles.dim.open;
if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) {
ansiStyles.dim.open = '';
}
while (i--) {
var code = ansiStyles[nestedStyles[i]];
// Replace any instances already present with a re-opening code
// otherwise only the part of the string until said closing code
// will be colored, and the rest will simply be 'plain'.
str = code.open + str.replace(code.closeRe, code.open) + code.close;
}
// Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue.
ansiStyles.dim.open = originalDim;
return str;
}
function init() {
var ret = {};
Object.keys(styles).forEach(function (name) {
ret[name] = {
get: function () {
return build.call(this, [name]);
}
};
});
return ret;
}
defineProps(Chalk.prototype, init());
module.exports = new Chalk();
module.exports.styles = ansiStyles;
module.exports.hasColor = hasAnsi;
module.exports.stripColor = stripAnsi;
module.exports.supportsColor = supportsColor;
| evildj67/new-new-agentology-com | node_modules/squeak/node_modules/chalk/index.js | JavaScript | mit | 3,154 |
/**
* This is the common logic for both the Node.js and web browser
* implementations of `debug()`.
*
* Expose `debug()` as the module.
*/
exports = module.exports = debug;
exports.coerce = coerce;
exports.disable = disable;
exports.enable = enable;
exports.enabled = enabled;
exports.humanize = require('ms');
/**
* The currently active debug mode names, and names to skip.
*/
exports.names = [];
exports.skips = [];
/**
* Map of special "%n" handling functions, for the debug "format" argument.
*
* Valid key names are a single, lowercased letter, i.e. "n".
*/
exports.formatters = {};
/**
* Previously assigned color.
*/
var prevColor = 0;
/**
* Previous log timestamp.
*/
var prevTime;
/**
* Select a color.
*
* @return {Number}
* @api private
*/
function selectColor() {
return exports.colors[prevColor++ % exports.colors.length];
}
/**
* Create a debugger with the given `namespace`.
*
* @param {String} namespace
* @return {Function}
* @api public
*/
function debug(namespace) {
// define the `disabled` version
function disabled() {
}
disabled.enabled = false;
// define the `enabled` version
function enabled() {
var self = enabled;
// set `diff` timestamp
var curr = +new Date();
var ms = curr - (prevTime || curr);
self.diff = ms;
self.prev = prevTime;
self.curr = curr;
prevTime = curr;
// add the `color` if not set
if (null == self.useColors) self.useColors = exports.useColors();
if (null == self.color && self.useColors) self.color = selectColor();
var args = Array.prototype.slice.call(arguments);
args[0] = exports.coerce(args[0]);
if ('string' !== typeof args[0]) {
// anything else let's inspect with %o
args = ['%o'].concat(args);
}
// apply any `formatters` transformations
var index = 0;
args[0] = args[0].replace(/%([a-z%])/g, function(match, format) {
// if we encounter an escaped % then don't increase the array index
if (match === '%%') return match;
index++;
var formatter = exports.formatters[format];
if ('function' === typeof formatter) {
var val = args[index];
match = formatter.call(self, val);
// now we need to remove `args[index]` since it's inlined in the `format`
args.splice(index, 1);
index--;
}
return match;
});
if ('function' === typeof exports.formatArgs) {
args = exports.formatArgs.apply(self, args);
}
var logFn = enabled.log || exports.log || console.log.bind(console);
logFn.apply(self, args);
}
enabled.enabled = true;
var fn = exports.enabled(namespace) ? enabled : disabled;
fn.namespace = namespace;
return fn;
}
/**
* Enables a debug mode by namespaces. This can include modes
* separated by a colon and wildcards.
*
* @param {String} namespaces
* @api public
*/
function enable(namespaces) {
exports.save(namespaces);
var split = (namespaces || '').split(/[\s,]+/);
var len = split.length;
for (var i = 0; i < len; i++) {
if (!split[i]) continue; // ignore empty strings
namespaces = split[i].replace(/\*/g, '.*?');
if (namespaces[0] === '-') {
exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
} else {
exports.names.push(new RegExp('^' + namespaces + '$'));
}
}
}
/**
* Disable debug output.
*
* @api public
*/
function disable() {
exports.enable('');
}
/**
* Returns true if the given mode name is enabled, false otherwise.
*
* @param {String} name
* @return {Boolean}
* @api public
*/
function enabled(name) {
var i, len;
for (i = 0, len = exports.skips.length; i < len; i++) {
if (exports.skips[i].test(name)) {
return false;
}
}
for (i = 0, len = exports.names.length; i < len; i++) {
if (exports.names[i].test(name)) {
return true;
}
}
return false;
}
/**
* Coerce `val`.
*
* @param {Mixed} val
* @return {Mixed}
* @api private
*/
function coerce(val) {
if (val instanceof Error) return val.stack || val.message;
return val;
}
| sryandesign/marvel-api-app | node_modules/express-session/node_modules/debug/debug.js | JavaScript | mit | 4,096 |
/**
* This is the common logic for both the Node.js and web browser
* implementations of `debug()`.
*
* Expose `debug()` as the module.
*/
exports = module.exports = debug;
exports.coerce = coerce;
exports.disable = disable;
exports.enable = enable;
exports.enabled = enabled;
exports.humanize = require('ms');
/**
* The currently active debug mode names, and names to skip.
*/
exports.names = [];
exports.skips = [];
/**
* Map of special "%n" handling functions, for the debug "format" argument.
*
* Valid key names are a single, lowercased letter, i.e. "n".
*/
exports.formatters = {};
/**
* Previously assigned color.
*/
var prevColor = 0;
/**
* Previous log timestamp.
*/
var prevTime;
/**
* Select a color.
*
* @return {Number}
* @api private
*/
function selectColor() {
return exports.colors[prevColor++ % exports.colors.length];
}
/**
* Create a debugger with the given `namespace`.
*
* @param {String} namespace
* @return {Function}
* @api public
*/
function debug(namespace) {
// define the `disabled` version
function disabled() {
}
disabled.enabled = false;
// define the `enabled` version
function enabled() {
var self = enabled;
// set `diff` timestamp
var curr = +new Date();
var ms = curr - (prevTime || curr);
self.diff = ms;
self.prev = prevTime;
self.curr = curr;
prevTime = curr;
// add the `color` if not set
if (null == self.useColors) self.useColors = exports.useColors();
if (null == self.color && self.useColors) self.color = selectColor();
var args = Array.prototype.slice.call(arguments);
args[0] = exports.coerce(args[0]);
if ('string' !== typeof args[0]) {
// anything else let's inspect with %o
args = ['%o'].concat(args);
}
// apply any `formatters` transformations
var index = 0;
args[0] = args[0].replace(/%([a-z%])/g, function(match, format) {
// if we encounter an escaped % then don't increase the array index
if (match === '%%') return match;
index++;
var formatter = exports.formatters[format];
if ('function' === typeof formatter) {
var val = args[index];
match = formatter.call(self, val);
// now we need to remove `args[index]` since it's inlined in the `format`
args.splice(index, 1);
index--;
}
return match;
});
if ('function' === typeof exports.formatArgs) {
args = exports.formatArgs.apply(self, args);
}
var logFn = enabled.log || exports.log || console.log.bind(console);
logFn.apply(self, args);
}
enabled.enabled = true;
var fn = exports.enabled(namespace) ? enabled : disabled;
fn.namespace = namespace;
return fn;
}
/**
* Enables a debug mode by namespaces. This can include modes
* separated by a colon and wildcards.
*
* @param {String} namespaces
* @api public
*/
function enable(namespaces) {
exports.save(namespaces);
var split = (namespaces || '').split(/[\s,]+/);
var len = split.length;
for (var i = 0; i < len; i++) {
if (!split[i]) continue; // ignore empty strings
namespaces = split[i].replace(/\*/g, '.*?');
if (namespaces[0] === '-') {
exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
} else {
exports.names.push(new RegExp('^' + namespaces + '$'));
}
}
}
/**
* Disable debug output.
*
* @api public
*/
function disable() {
exports.enable('');
}
/**
* Returns true if the given mode name is enabled, false otherwise.
*
* @param {String} name
* @return {Boolean}
* @api public
*/
function enabled(name) {
var i, len;
for (i = 0, len = exports.skips.length; i < len; i++) {
if (exports.skips[i].test(name)) {
return false;
}
}
for (i = 0, len = exports.names.length; i < len; i++) {
if (exports.names[i].test(name)) {
return true;
}
}
return false;
}
/**
* Coerce `val`.
*
* @param {Mixed} val
* @return {Mixed}
* @api private
*/
function coerce(val) {
if (val instanceof Error) return val.stack || val.message;
return val;
}
| jemandez/astrokosmos | node_modules/debug/debug.js | JavaScript | mit | 4,096 |
(function ($) {
var methods = {
init : function(options) {
var defaults = {
menuWidth: 240,
edge: 'left',
closeOnClick: false
};
options = $.extend(defaults, options);
$(this).each(function(){
var $this = $(this);
var menu_id = $("#"+ $this.attr('data-activates'));
// Set to width
if (options.menuWidth != 240) {
menu_id.css('width', options.menuWidth);
}
// Add Touch Area
$('body').append($('<div class="drag-target"></div>'));
if (options.edge == 'left') {
menu_id.css('left', -1 * (options.menuWidth + 10));
$('.drag-target').css({'left': 0}); // Add Touch Area
}
else {
menu_id.addClass('right-aligned') // Change text-alignment to right
.css('right', -1 * (options.menuWidth + 10))
.css('left', '');
$('.drag-target').css({'right': 0}); // Add Touch Area
}
// If fixed sidenav, bring menu out
if (menu_id.hasClass('fixed')) {
if (window.innerWidth > 992) {
menu_id.css('left', 0);
}
}
// Window resize to reset on large screens fixed
if (menu_id.hasClass('fixed')) {
$(window).resize( function() {
if (window.innerWidth > 992) {
// Close menu if window is resized bigger than 992 and user has fixed sidenav
if ($('#sidenav-overlay').css('opacity') !== 0 && menuOut) {
removeMenu(true);
}
else {
menu_id.removeAttr('style');
menu_id.css('width', options.menuWidth);
}
}
else if (menuOut === false){
if (options.edge === 'left')
menu_id.css('left', -1 * (options.menuWidth + 10));
else
menu_id.css('right', -1 * (options.menuWidth + 10));
}
});
}
// if closeOnClick, then add close event for all a tags in side sideNav
if (options.closeOnClick === true) {
menu_id.on("click.itemclick", "a:not(.collapsible-header)", function(){
removeMenu();
});
}
function removeMenu(restoreNav) {
panning = false;
menuOut = false;
// Reenable scrolling
$('body').css('overflow', '');
$('#sidenav-overlay').velocity({opacity: 0}, {duration: 200, queue: false, easing: 'easeOutQuad',
complete: function() {
$(this).remove();
} });
if (options.edge === 'left') {
// Reset phantom div
$('.drag-target').css({width: '', right: '', left: '0'});
menu_id.velocity(
{left: -1 * (options.menuWidth + 10)},
{ duration: 200,
queue: false,
easing: 'easeOutCubic',
complete: function() {
if (restoreNav === true) {
// Restore Fixed sidenav
menu_id.removeAttr('style');
menu_id.css('width', options.menuWidth);
}
}
});
}
else {
// Reset phantom div
$('.drag-target').css({width: '', right: '0', left: ''});
menu_id.velocity(
{right: -1 * (options.menuWidth + 10)},
{ duration: 200,
queue: false,
easing: 'easeOutCubic',
complete: function() {
if (restoreNav === true) {
// Restore Fixed sidenav
menu_id.removeAttr('style');
menu_id.css('width', options.menuWidth);
}
}
});
}
}
// Touch Event
var panning = false;
var menuOut = false;
$('.drag-target').on('click', function(){
removeMenu();
});
$('.drag-target').hammer({
prevent_default: false
}).bind('pan', function(e) {
if (e.gesture.pointerType == "touch") {
var direction = e.gesture.direction;
var x = e.gesture.center.x;
var y = e.gesture.center.y;
var velocityX = e.gesture.velocityX;
// Disable Scrolling
$('body').css('overflow', 'hidden');
// If overlay does not exist, create one and if it is clicked, close menu
if ($('#sidenav-overlay').length === 0) {
var overlay = $('<div id="sidenav-overlay"></div>');
overlay.css('opacity', 0).click( function(){
removeMenu();
});
$('body').append(overlay);
}
// Keep within boundaries
if (options.edge === 'left') {
if (x > options.menuWidth) { x = options.menuWidth; }
else if (x < 0) { x = 0; }
}
if (options.edge === 'left') {
// Left Direction
if (x < (options.menuWidth / 2)) { menuOut = false; }
// Right Direction
else if (x >= (options.menuWidth / 2)) { menuOut = true; }
menu_id.css('left', (x - options.menuWidth));
}
else {
// Left Direction
if (x < (window.innerWidth - options.menuWidth / 2)) {
menuOut = true;
}
// Right Direction
else if (x >= (window.innerWidth - options.menuWidth / 2)) {
menuOut = false;
}
var rightPos = -1 *(x - options.menuWidth / 2);
if (rightPos > 0) {
rightPos = 0;
}
menu_id.css('right', rightPos);
}
// Percentage overlay
var overlayPerc;
if (options.edge === 'left') {
overlayPerc = x / options.menuWidth;
$('#sidenav-overlay').velocity({opacity: overlayPerc }, {duration: 50, queue: false, easing: 'easeOutQuad'});
}
else {
overlayPerc = Math.abs((x - window.innerWidth) / options.menuWidth);
$('#sidenav-overlay').velocity({opacity: overlayPerc }, {duration: 50, queue: false, easing: 'easeOutQuad'});
}
}
}).bind('panend', function(e) {
if (e.gesture.pointerType == "touch") {
var velocityX = e.gesture.velocityX;
panning = false;
if (options.edge === 'left') {
// If velocityX <= 0.3 then the user is flinging the menu closed so ignore menuOut
if ((menuOut && velocityX <= 0.3) || velocityX < -0.5) {
menu_id.velocity({left: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});
$('#sidenav-overlay').velocity({opacity: 1 }, {duration: 50, queue: false, easing: 'easeOutQuad'});
$('.drag-target').css({width: '50%', right: 0, left: ''});
}
else if (!menuOut || velocityX > 0.3) {
// Enable Scrolling
$('body').css('overflow', '');
// Slide menu closed
menu_id.velocity({left: -1 * (options.menuWidth + 10)}, {duration: 200, queue: false, easing: 'easeOutQuad'});
$('#sidenav-overlay').velocity({opacity: 0 }, {duration: 200, queue: false, easing: 'easeOutQuad',
complete: function () {
$(this).remove();
}});
$('.drag-target').css({width: '10px', right: '', left: 0});
}
}
else {
if ((menuOut && velocityX >= -0.3) || velocityX > 0.5) {
menu_id.velocity({right: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});
$('#sidenav-overlay').velocity({opacity: 1 }, {duration: 50, queue: false, easing: 'easeOutQuad'});
$('.drag-target').css({width: '50%', right: '', left: 0});
}
else if (!menuOut || velocityX < -0.3) {
// Enable Scrolling
$('body').css('overflow', '');
// Slide menu closed
menu_id.velocity({right: -1 * (options.menuWidth + 10)}, {duration: 200, queue: false, easing: 'easeOutQuad'});
$('#sidenav-overlay').velocity({opacity: 0 }, {duration: 200, queue: false, easing: 'easeOutQuad',
complete: function () {
$(this).remove();
}});
$('.drag-target').css({width: '10px', right: 0, left: ''});
}
}
}
});
$this.click(function() {
if (menuOut === true) {
menuOut = false;
panning = false;
removeMenu();
}
else {
// Disable Scrolling
$('body').css('overflow', 'hidden');
if (options.edge === 'left') {
$('.drag-target').css({width: '50%', right: 0, left: ''});
menu_id.velocity({left: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});
}
else {
$('.drag-target').css({width: '50%', right: '', left: 0});
menu_id.velocity({right: 0}, {duration: 300, queue: false, easing: 'easeOutQuad'});
menu_id.css('left','');
}
var overlay = $('<div id="sidenav-overlay"></div>');
overlay.css('opacity', 0)
.click(function(){
menuOut = false;
panning = false;
removeMenu();
overlay.velocity({opacity: 0}, {duration: 300, queue: false, easing: 'easeOutQuad',
complete: function() {
$(this).remove();
} });
});
$('body').append(overlay);
overlay.velocity({opacity: 1}, {duration: 300, queue: false, easing: 'easeOutQuad',
complete: function () {
menuOut = true;
panning = false;
}
});
}
return false;
});
});
},
show : function() {
this.trigger('click');
},
hide : function() {
$('#sidenav-overlay').trigger('click');
}
};
$.fn.sideNav = function(methodOrOptions) {
if ( methods[methodOrOptions] ) {
return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));
} else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {
// Default to "init"
return methods.init.apply( this, arguments );
} else {
$.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.sideNav' );
}
}; // Plugin end
}( jQuery ));
| zvaehn/hiimzvaehn-blog-theme | static/js/materialize/sideNav.js | JavaScript | mit | 11,041 |
/**
* @author: Dennis Hernández
* @webSite: http://djhvscf.github.io/Blog
* @version: v1.0.0
*/
!function ($) {
'use strict';
var isSearch = false;
var rowAttr = function (row, index) {
return {
id: 'customId_' + index
};
};
$.extend($.fn.bootstrapTable.defaults, {
reorderableRows: false,
onDragStyle: null,
onDropStyle: null,
onDragClass: "reorder_rows_onDragClass",
dragHandle: null,
useRowAttrFunc: false,
onReorderRowsDrag: function (table, row) {
return false;
},
onReorderRowsDrop: function (table, row) {
return false;
},
onReorderRow: function (newData) {
return false;
}
});
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
'reorder-row.bs.table': 'onReorderRow'
});
var BootstrapTable = $.fn.bootstrapTable.Constructor,
_init = BootstrapTable.prototype.init,
_initSearch = BootstrapTable.prototype.initSearch;
BootstrapTable.prototype.init = function () {
if (!this.options.reorderableRows) {
_init.apply(this, Array.prototype.slice.apply(arguments));
return;
}
var that = this;
if (this.options.useRowAttrFunc) {
this.options.rowAttributes = rowAttr;
}
var onPostBody = this.options.onPostBody;
this.options.onPostBody = function () {
setTimeout(function () {
that.makeRowsReorderable();
onPostBody.apply();
}, 1);
};
_init.apply(this, Array.prototype.slice.apply(arguments));
};
BootstrapTable.prototype.initSearch = function () {
_initSearch.apply(this, Array.prototype.slice.apply(arguments));
if (!this.options.reorderableRows) {
return;
}
//Known issue after search if you reorder the rows the data is not display properly
//isSearch = true;
};
BootstrapTable.prototype.makeRowsReorderable = function () {
if (this.options.cardView) {
return;
}
var that = this;
this.$el.tableDnD({
onDragStyle: that.options.onDragStyle,
onDropStyle: that.options.onDropStyle,
onDragClass: that.options.onDragClass,
onDrop: that.onDrop,
onDragStart: that.options.onReorderRowsDrag,
dragHandle: that.options.dragHandle
});
};
BootstrapTable.prototype.onDrop = function (table, droppedRow) {
var tableBs = $(table),
tableBsData = tableBs.data('bootstrap.table'),
tableBsOptions = tableBs.data('bootstrap.table').options,
row = null,
newData = [];
for (var i = 0; i < table.tBodies[0].rows.length; i++) {
row = $(table.tBodies[0].rows[i]);
newData.push(tableBsOptions.data[row.data('index')]);
row.data('index', i).attr('data-index', i);
}
tableBsOptions.data = newData;
//Call the user defined function
tableBsOptions.onReorderRowsDrop.apply(table, [table, droppedRow]);
//Call the event reorder-row
tableBsData.trigger('reorder-row', newData);
};
}(jQuery); | jesusignazio/sanitariohumanitario | vendors/bootstrap-table/dist/extensions/reorder-rows/bootstrap-table-reorder-rows.js | JavaScript | mit | 3,326 |
(function(e){var a,i,g,d,b;var c={menuStyle:{listStyle:"none",padding:"1px",margin:"0px",backgroundColor:"#fff",border:"1px solid #999",width:"100px"},itemStyle:{margin:"0px",color:"#000",display:"block",cursor:"default",padding:"3px",border:"1px solid #fff",backgroundColor:"transparent"},itemHoverStyle:{border:"1px solid #0a246a",backgroundColor:"#b6bdd2"},eventPosX:"pageX",eventPosY:"pageY",shadow:true,onContextMenu:null,onShowMenu:null};e.fn.contextMenu=function(l,k){if(!a){a=e('<div id="jqContextMenu"></div>').hide().css({position:"absolute",zIndex:"500"}).appendTo("body").bind("click",function(m){m.stopPropagation()})}if(!i){i=e("<div></div>").css({backgroundColor:"#000",position:"absolute",opacity:0.2,zIndex:499}).appendTo("body").hide()}d=d||[];d.push({id:l,menuStyle:e.extend({},c.menuStyle,k.menuStyle||{}),itemStyle:e.extend({},c.itemStyle,k.itemStyle||{}),itemHoverStyle:e.extend({},c.itemHoverStyle,k.itemHoverStyle||{}),bindings:k.bindings||{},shadow:k.shadow||k.shadow===false?k.shadow:c.shadow,onContextMenu:k.onContextMenu||c.onContextMenu,onShowMenu:k.onShowMenu||c.onShowMenu,eventPosX:k.eventPosX||c.eventPosX,eventPosY:k.eventPosY||c.eventPosY});var j=d.length-1;e(this).bind("contextmenu",function(n){var m=(!!d[j].onContextMenu)?d[j].onContextMenu(n):true;b=n.target;if(m){h(j,this,n);return false}});return this};function h(k,j,l){var m=d[k];g=e("#"+m.id).find("ul:first").clone(true);g.css(m.menuStyle).find("li").css(m.itemStyle).hover(function(){e(this).css(m.itemHoverStyle)},function(){e(this).css(m.itemStyle)}).find("img").css({verticalAlign:"middle",paddingRight:"2px"});a.html(g);if(!!m.onShowMenu){a=m.onShowMenu(l,a)}e.each(m.bindings,function(o,n){e("#"+o,a).bind("click",function(){f();n(j,b)})});a.css({left:l[m.eventPosX],top:l[m.eventPosY]}).show();if(m.shadow){i.css({width:a.width(),height:a.height(),left:l.pageX+2,top:l.pageY+2}).show()}e(document).one("click",f)}function f(){a.hide();i.hide()}e.contextMenu={defaults:function(j){e.each(j,function(k,l){if(typeof l=="object"&&c[k]){e.extend(c[k],l)}else{c[k]=l}})}}})(jQuery);$(function(){$("div.contextMenu").hide()}); | steadiest/cdnjs | ajax/libs/free-jqgrid/4.9.0-rc1/plugins/jquery.contextmenu.min.js | JavaScript | mit | 2,123 |
/*! UIkit 2.19.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-nestable",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";var e,s="ontouchstart"in window,i=t.$html,n=[],a=t.$win,l=function(){var t=document.createElement("div"),e=document.documentElement;if(!("pointerEvents"in t.style))return!1;t.style.pointerEvents="auto",t.style.pointerEvents="x",e.appendChild(t);var s=window.getComputedStyle&&"auto"===window.getComputedStyle(t,"").pointerEvents;return e.removeChild(t),!!s}(),o=s?"touchstart":"mousedown",h=s?"touchmove":"mousemove",r=s?"touchend":"mouseup",d=s?"touchcancel":"mouseup";return t.component("nestable",{defaults:{prefix:"uk-",listNodeName:"ul",itemNodeName:"li",listBaseClass:"{prefix}nestable",listClass:"{prefix}nestable-list",listitemClass:"{prefix}nestable-list-item",itemClass:"{prefix}nestable-item",dragClass:"{prefix}nestable-list-dragged",movingClass:"{prefix}nestable-moving",handleClass:"{prefix}nestable-handle",collapsedClass:"{prefix}collapsed",placeClass:"{prefix}nestable-placeholder",noDragClass:"{prefix}nestable-nodrag",emptyClass:"{prefix}nestable-empty",group:0,maxDepth:10,threshold:20},boot:function(){t.$html.on("mousemove touchmove",function(){if(e){var s=e.offset().top;s<t.$win.scrollTop()?t.$win.scrollTop(t.$win.scrollTop()-Math.ceil(e.height()/2)):s+e.height()>window.innerHeight+t.$win.scrollTop()&&t.$win.scrollTop(t.$win.scrollTop()+Math.ceil(e.height()/2))}}),t.ready(function(e){t.$("[data-uk-nestable]",e).each(function(){var e=t.$(this);if(!e.data("nestable")){t.nestable(e,t.Utils.options(e.attr("data-uk-nestable")))}})})},init:function(){var i=this;Object.keys(this.options).forEach(function(t){-1!=String(i.options[t]).indexOf("{prefix}")&&(i.options[t]=i.options[t].replace("{prefix}",i.options.prefix))}),this.tplempty='<div class="'+this.options.emptyClass+'"/>',this.find(">"+this.options.itemNodeName).addClass(this.options.listitemClass).end().find("ul:not(.ignore-list)").addClass(this.options.listClass).find(">li").addClass(this.options.listitemClass),this.element.children(this.options.itemNodeName).length||this.element.append(this.tplempty),this.element.data("nestable-id","ID"+(new Date).getTime()+"RAND"+Math.ceil(1e5*Math.random())),this.reset(),this.element.data("nestable-group",this.options.group),this.placeEl=t.$('<div class="'+this.options.placeClass+'"/>'),this.find(this.options.itemNodeName).each(function(){i.setParent(t.$(this))}),this.on("click","[data-nestable-action]",function(e){if(!i.dragEl&&(s||0===e.button)){e.preventDefault();var n=t.$(e.currentTarget),a=n.data("nestableAction"),l=n.closest(i.options.itemNodeName);"collapse"===a&&i.collapseItem(l),"expand"===a&&i.expandItem(l),"toggle"===a&&i.toggleItem(l)}});var n=function(e){var n=t.$(e.target);if(!n.hasClass(i.options.handleClass)){if(n.closest("."+i.options.noDragClass).length)return;n=n.closest("."+i.options.handleClass)}!n.length||i.dragEl||!s&&0!==e.button||s&&1!==e.touches.length||(e.preventDefault(),i.dragStart(s?e.touches[0]:e),i.trigger("start.uk.nestable",[i]))},l=function(t){i.dragEl&&(t.preventDefault(),i.dragMove(s?t.touches[0]:t),i.trigger("move.uk.nestable",[i]))},p=function(t){i.dragEl&&(t.preventDefault(),i.dragStop(s?t.touches[0]:t)),e=!1};s?(this.element[0].addEventListener(o,n,!1),window.addEventListener(h,l,!1),window.addEventListener(r,p,!1),window.addEventListener(d,p,!1)):(this.on(o,n),a.on(h,l),a.on(r,p))},serialize:function(){var e,s=0,i=this,n=function(e,s){var a=[],l=e.children(i.options.itemNodeName);return l.each(function(){for(var e,l=t.$(this),o={},h=l.children(i.options.listNodeName),r=0;r<l[0].attributes.length;r++)e=l[0].attributes[r],0===e.name.indexOf("data-")&&(o[e.name.substr(5)]=t.Utils.str2json(e.value));h.length&&(o.children=n(h,s+1)),a.push(o)}),a};return e=n(i.element,s)},list:function(e){var s=[],i=this,n=0,a=function(i,n,l){var o=i.children(e.itemNodeName);o.each(function(i){var o=t.$(this),h=t.$.extend({parent_id:l?l:null,depth:n,order:i},o.data()),r=o.children(e.listNodeName);s.push(h),r.length&&a(r,n+1,o.data(e.idProperty||"id"))})};return e=t.$.extend({},i.options,e),a(i.element,n),s},reset:function(){this.mouse={offsetX:0,offsetY:0,startX:0,startY:0,lastX:0,lastY:0,nowX:0,nowY:0,distX:0,distY:0,dirAx:0,dirX:0,dirY:0,lastDirX:0,lastDirY:0,distAxX:0,distAxY:0},this.moving=!1,this.dragEl=null,this.dragRootEl=null,this.dragDepth=0,this.hasNewRoot=!1,this.pointEl=null;for(var t=0;t<n.length;t++)this.checkEmptyList(n[t]);n=[]},toggleItem:function(t){this[t.hasClass(this.options.collapsedClass)?"expandItem":"collapseItem"](t)},expandItem:function(t){t.removeClass(this.options.collapsedClass)},collapseItem:function(t){var e=t.children(this.options.listNodeName);e.length&&t.addClass(this.options.collapsedClass)},expandAll:function(){var e=this;this.find(e.options.itemNodeName).each(function(){e.expandItem(t.$(this))})},collapseAll:function(){var e=this;this.find(e.options.itemNodeName).each(function(){e.collapseItem(t.$(this))})},setParent:function(t){t.children(this.options.listNodeName).length&&t.addClass("uk-parent")},unsetParent:function(t){t.removeClass("uk-parent "+this.options.collapsedClass),t.children(this.options.listNodeName).remove()},dragStart:function(s){var n=this.mouse,a=t.$(s.target),l=a.closest(this.options.itemNodeName),o=l.offset();this.placeEl.css("height",l.height()),n.offsetX=s.pageX-o.left,n.offsetY=s.pageY-o.top,n.startX=n.lastX=o.left,n.startY=n.lastY=o.top,this.dragRootEl=this.element,this.dragEl=t.$(document.createElement(this.options.listNodeName)).addClass(this.options.listClass+" "+this.options.dragClass),this.dragEl.css("width",l.width()),e=this.dragEl,this.tmpDragOnSiblings=[l[0].previousSibling,l[0].nextSibling],l.after(this.placeEl),l[0].parentNode.removeChild(l[0]),l.appendTo(this.dragEl),t.$body.append(this.dragEl),this.dragEl.css({left:o.left,top:o.top});var h,r,d=this.dragEl.find(this.options.itemNodeName);for(h=0;h<d.length;h++)r=t.$(d[h]).parents(this.options.listNodeName).length,r>this.dragDepth&&(this.dragDepth=r);i.addClass(this.options.movingClass)},dragStop:function(){var t=this.dragEl.children(this.options.itemNodeName).first(),e=this.placeEl.parents("."+this.options.listBaseClass+":first");t[0].parentNode.removeChild(t[0]),this.placeEl.replaceWith(t),this.dragEl.remove(),this.element[0]!==e[0]?(e.trigger("change.uk.nestable",[t,"added",e,e.data("nestable")]),this.element.trigger("change.uk.nestable",[t,"removed",this.element,this])):this.element.trigger("change.uk.nestable",[t,"moved",this.element,this]),this.trigger("stop.uk.nestable",[this,t]),this.reset(),i.removeClass(this.options.movingClass)},dragMove:function(e){var s,i,a,o,h,r=this.options,d=this.mouse;this.dragEl.css({left:e.pageX-d.offsetX,top:e.pageY-d.offsetY}),d.lastX=d.nowX,d.lastY=d.nowY,d.nowX=e.pageX,d.nowY=e.pageY,d.distX=d.nowX-d.lastX,d.distY=d.nowY-d.lastY,d.lastDirX=d.dirX,d.lastDirY=d.dirY,d.dirX=0===d.distX?0:d.distX>0?1:-1,d.dirY=0===d.distY?0:d.distY>0?1:-1;var p=Math.abs(d.distX)>Math.abs(d.distY)?1:0;if(!d.moving)return d.dirAx=p,d.moving=!0,void 0;d.dirAx!==p?(d.distAxX=0,d.distAxY=0):(d.distAxX+=Math.abs(d.distX),0!==d.dirX&&d.dirX!==d.lastDirX&&(d.distAxX=0),d.distAxY+=Math.abs(d.distY),0!==d.dirY&&d.dirY!==d.lastDirY&&(d.distAxY=0)),d.dirAx=p,d.dirAx&&d.distAxX>=r.threshold&&(d.distAxX=0,a=this.placeEl.prev(r.itemNodeName),d.distX>0&&a.length&&!a.hasClass(r.collapsedClass)&&(s=a.find(r.listNodeName).last(),h=this.placeEl.parents(r.listNodeName).length,h+this.dragDepth<=r.maxDepth&&(s.length?(s=a.children(r.listNodeName).last(),s.append(this.placeEl)):(s=t.$("<"+r.listNodeName+"/>").addClass(r.listClass),s.append(this.placeEl),a.append(s),this.setParent(a)))),d.distX<0&&(o=this.placeEl.next(r.itemNodeName),o.length||(i=this.placeEl.parent(),this.placeEl.closest(r.itemNodeName).after(this.placeEl),i.children().length||this.unsetParent(i.parent()))));var c=!1;if(l||(this.dragEl[0].style.visibility="hidden"),this.pointEl=t.$(document.elementFromPoint(e.pageX-document.body.scrollLeft,e.pageY-(window.pageYOffset||document.documentElement.scrollTop))),l||(this.dragEl[0].style.visibility="visible"),this.pointEl.hasClass(r.handleClass))this.pointEl=this.pointEl.closest(r.itemNodeName);else{var m=this.pointEl.closest("."+r.itemClass);m.length&&(this.pointEl=m.closest(r.itemNodeName))}if(this.pointEl.hasClass(r.emptyClass))c=!0;else if(this.pointEl.data("nestable")&&!this.pointEl.children().length)c=!0,this.pointEl=t.$(this.tplempty).appendTo(this.pointEl);else if(!this.pointEl.length||!this.pointEl.hasClass(r.listitemClass))return;var g=this.element,u=this.pointEl.closest("."+this.options.listBaseClass),f=g[0]!==this.pointEl.closest("."+this.options.listBaseClass)[0];if(!d.dirAx||f||c){if(f&&r.group!==u.data("nestable-group"))return;if(n.push(g),h=this.dragDepth-1+this.pointEl.parents(r.listNodeName).length,h>r.maxDepth)return;var E=e.pageY<this.pointEl.offset().top+this.pointEl.height()/2;i=this.placeEl.parent(),c?this.pointEl.replaceWith(this.placeEl):E?this.pointEl.before(this.placeEl):this.pointEl.after(this.placeEl),i.children().length||i.data("nestable")||this.unsetParent(i.parent()),this.checkEmptyList(this.dragRootEl),this.checkEmptyList(g),f&&(this.dragRootEl=u,this.hasNewRoot=this.element[0]!==this.dragRootEl[0])}},checkEmptyList:function(e){e=e?t.$(e):this.element,e.children().length||e.find("."+this.options.emptyClass).remove().end().append(this.tplempty)}}),t.nestable}); | raszi/cdnjs | ajax/libs/uikit/2.19.0/js/components/nestable.min.js | JavaScript | mit | 9,562 |
// this file handles outputting usage instructions,
// failures, etc. keeps logging in one place.
var cliui = require('cliui')
var decamelize = require('decamelize')
var stringWidth = require('string-width')
var wsize = require('window-size')
module.exports = function (yargs, y18n) {
var __ = y18n.__
var self = {}
// methods for ouputting/building failure message.
var fails = []
self.failFn = function (f) {
fails.push(f)
}
var failMessage = null
var showHelpOnFail = true
self.showHelpOnFail = function (enabled, message) {
if (typeof enabled === 'string') {
message = enabled
enabled = true
} else if (typeof enabled === 'undefined') {
enabled = true
}
failMessage = message
showHelpOnFail = enabled
return self
}
var failureOutput = false
self.fail = function (msg) {
if (fails.length) {
fails.forEach(function (f) {
f(msg)
})
} else {
// don't output failure message more than once
if (!failureOutput) {
failureOutput = true
if (showHelpOnFail) yargs.showHelp('error')
if (msg) console.error(msg)
if (failMessage) {
if (msg) console.error('')
console.error(failMessage)
}
}
if (yargs.getExitProcess()) {
process.exit(1)
} else {
throw new Error(msg)
}
}
}
// methods for ouputting/building help (usage) message.
var usage
self.usage = function (msg) {
usage = msg
}
var examples = []
self.example = function (cmd, description) {
examples.push([cmd, description || ''])
}
var commands = []
self.command = function (cmd, description) {
commands.push([cmd, description || ''])
}
self.getCommands = function () {
return commands
}
var descriptions = {}
self.describe = function (key, desc) {
if (typeof key === 'object') {
Object.keys(key).forEach(function (k) {
self.describe(k, key[k])
})
} else {
descriptions[key] = desc
}
}
self.getDescriptions = function () {
return descriptions
}
var epilog
self.epilog = function (msg) {
epilog = msg
}
var wrap = windowWidth()
self.wrap = function (cols) {
wrap = cols
}
var deferY18nLookupPrefix = '__yargsString__:'
self.deferY18nLookup = function (str) {
return deferY18nLookupPrefix + str
}
var defaultGroup = 'Options:'
self.help = function () {
normalizeAliases()
var demanded = yargs.getDemanded()
var groups = yargs.getGroups()
var options = yargs.getOptions()
var keys = Object.keys(
Object.keys(descriptions)
.concat(Object.keys(demanded))
.concat(Object.keys(options.default))
.reduce(function (acc, key) {
if (key !== '_') acc[key] = true
return acc
}, {})
)
var ui = cliui({
width: wrap,
wrap: !!wrap
})
// the usage string.
if (usage) {
var u = usage.replace(/\$0/g, yargs.$0)
ui.div(u + '\n')
}
// your application's commands, i.e., non-option
// arguments populated in '_'.
if (commands.length) {
ui.div(__('Commands:'))
commands.forEach(function (command) {
ui.div(
{text: command[0], padding: [0, 2, 0, 2], width: maxWidth(commands) + 4},
{text: command[1]}
)
})
ui.div()
}
// perform some cleanup on the keys array, making it
// only include top-level keys not their aliases.
var aliasKeys = (Object.keys(options.alias) || [])
.concat(Object.keys(yargs.parsed.newAliases) || [])
keys = keys.filter(function (key) {
return !yargs.parsed.newAliases[key] && aliasKeys.every(function (alias) {
return (options.alias[alias] || []).indexOf(key) === -1
})
})
// populate 'Options:' group with any keys that have not
// explicitly had a group set.
if (!groups[defaultGroup]) groups[defaultGroup] = []
addUngroupedKeys(keys, options.alias, groups)
// display 'Options:' table along with any custom tables:
Object.keys(groups).forEach(function (groupName) {
if (!groups[groupName].length) return
ui.div(__(groupName))
// if we've grouped the key 'f', but 'f' aliases 'foobar',
// normalizedKeys should contain only 'foobar'.
var normalizedKeys = groups[groupName].map(function (key) {
if (~aliasKeys.indexOf(key)) return key
for (var i = 0, aliasKey; (aliasKey = aliasKeys[i]) !== undefined; i++) {
if (~(options.alias[aliasKey] || []).indexOf(key)) return aliasKey
}
return key
})
// actually generate the switches string --foo, -f, --bar.
var switches = normalizedKeys.reduce(function (acc, key) {
acc[key] = [ key ].concat(options.alias[key] || [])
.map(function (sw) {
return (sw.length > 1 ? '--' : '-') + sw
})
.join(', ')
return acc
}, {})
normalizedKeys.forEach(function (key) {
var kswitch = switches[key]
var desc = descriptions[key] || ''
var type = null
if (~desc.lastIndexOf(deferY18nLookupPrefix)) desc = __(desc.substring(deferY18nLookupPrefix.length))
if (~options.boolean.indexOf(key)) type = '[' + __('boolean') + ']'
if (~options.count.indexOf(key)) type = '[' + __('count') + ']'
if (~options.string.indexOf(key)) type = '[' + __('string') + ']'
if (~options.normalize.indexOf(key)) type = '[' + __('string') + ']'
if (~options.array.indexOf(key)) type = '[' + __('array') + ']'
var extra = [
type,
demanded[key] ? '[' + __('required') + ']' : null,
options.choices && options.choices[key] ? '[' + __('choices:') + ' ' +
self.stringifiedValues(options.choices[key]) + ']' : null,
defaultString(options.default[key], options.defaultDescription[key])
].filter(Boolean).join(' ')
ui.span(
{text: kswitch, padding: [0, 2, 0, 2], width: maxWidth(switches) + 4},
desc
)
if (extra) ui.div({text: extra, padding: [0, 0, 0, 2], align: 'right'})
else ui.div()
})
ui.div()
})
// describe some common use-cases for your application.
if (examples.length) {
ui.div(__('Examples:'))
examples.forEach(function (example) {
example[0] = example[0].replace(/\$0/g, yargs.$0)
})
examples.forEach(function (example) {
ui.div(
{text: example[0], padding: [0, 2, 0, 2], width: maxWidth(examples) + 4},
example[1]
)
})
ui.div()
}
// the usage string.
if (epilog) {
var e = epilog.replace(/\$0/g, yargs.$0)
ui.div(e + '\n')
}
return ui.toString()
}
// return the maximum width of a string
// in the left-hand column of a table.
function maxWidth (table) {
var width = 0
// table might be of the form [leftColumn],
// or {key: leftColumn}}
if (!Array.isArray(table)) {
table = Object.keys(table).map(function (key) {
return [table[key]]
})
}
table.forEach(function (v) {
width = Math.max(stringWidth(v[0]), width)
})
// if we've enabled 'wrap' we should limit
// the max-width of the left-column.
if (wrap) width = Math.min(width, parseInt(wrap * 0.5, 10))
return width
}
// make sure any options set for aliases,
// are copied to the keys being aliased.
function normalizeAliases () {
var demanded = yargs.getDemanded()
var options = yargs.getOptions()
;(Object.keys(options.alias) || []).forEach(function (key) {
options.alias[key].forEach(function (alias) {
// copy descriptions.
if (descriptions[alias]) self.describe(key, descriptions[alias])
// copy demanded.
if (demanded[alias]) yargs.demand(key, demanded[alias].msg)
// type messages.
if (~options.boolean.indexOf(alias)) yargs.boolean(key)
if (~options.count.indexOf(alias)) yargs.count(key)
if (~options.string.indexOf(alias)) yargs.string(key)
if (~options.normalize.indexOf(alias)) yargs.normalize(key)
if (~options.array.indexOf(alias)) yargs.array(key)
})
})
}
// given a set of keys, place any keys that are
// ungrouped under the 'Options:' grouping.
function addUngroupedKeys (keys, aliases, groups) {
var groupedKeys = []
var toCheck = null
Object.keys(groups).forEach(function (group) {
groupedKeys = groupedKeys.concat(groups[group])
})
keys.forEach(function (key) {
toCheck = [key].concat(aliases[key])
if (!toCheck.some(function (k) {
return groupedKeys.indexOf(k) !== -1
})) {
groups[defaultGroup].push(key)
}
})
return groupedKeys
}
self.showHelp = function (level) {
level = level || 'error'
console[level](self.help())
}
self.functionDescription = function (fn) {
var description = fn.name ? decamelize(fn.name, '-') : __('generated-value')
return ['(', description, ')'].join('')
}
self.stringifiedValues = function (values, separator) {
var string = ''
var sep = separator || ', '
var array = [].concat(values)
if (!values || !array.length) return string
array.forEach(function (value) {
if (string.length) string += sep
string += JSON.stringify(value)
})
return string
}
// format the default-value-string displayed in
// the right-hand column.
function defaultString (value, defaultDescription) {
var string = '[' + __('default:') + ' '
if (value === undefined && !defaultDescription) return null
if (defaultDescription) {
string += defaultDescription
} else {
switch (typeof value) {
case 'string':
string += JSON.stringify(value)
break
case 'object':
string += JSON.stringify(value)
break
default:
string += value
}
}
return string + ']'
}
// guess the width of the console window, max-width 80.
function windowWidth () {
return wsize.width ? Math.min(80, wsize.width) : null
}
// logic for displaying application version.
var version = null
self.version = function (ver, opt, msg) {
version = ver
}
self.showVersion = function () {
if (typeof version === 'function') console.log(version())
else console.log(version)
}
return self
}
| pfnegrini/Bailey | server/app/node_modules/yargs/lib/usage.js | JavaScript | mit | 10,522 |
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/graphics/graphics.js"] = {
lines: {},
functions: {},
coveredLines: 0,
calledLines: 0,
coveredFunctions: 0,
calledFunctions: 0,
path: "build/graphics/graphics.js",
code: []
};
_yuitest_coverage["build/graphics/graphics.js"].code=["YUI.add('graphics', function (Y, NAME) {","","/**"," * "," * <p>The `Graphics` module provides a JavaScript API for creating shapes in a variety of formats across "," * a <a href=\"http://developer.yahoo.com/yui/articles/gbs\">browser test baseline</a>. "," * Based on device and browser capabilities, `Graphics` leverages <a href=\"http://www.w3.org/TR/SVG/\">SVG</a>, "," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> and <a href=\"http://www.w3.org/TR/NOTE-VML\">VML</a> "," * to render its graphical elements.</p>"," *"," * <p>The `Graphics` module features a <a href=\"../classes/Graphic.html\">`Graphic`</a> class that allows you to easily create and manage shapes. "," * Currently, a <a href=\"../classes/Graphic.html\">`Graphic`</a> instance can be used to create predifined shapes and free-form polygons with fill "," * and stroke properties.</p> "," *"," * <p>The `Graphics` module normalizes an API through the use of alias and implementation classes that share"," * interfaces. Each alias class points to an appropriate implementation class dependent on the browser's "," * capabilities. There should rarely, if ever, be a need to interact directly with an implementation class.</p>"," *"," * <p>Below is a list of available classes. "," * <ul>"," * <li><a href=\"../classes/Graphic.html\">`Graphic`</a>"," * <li><a href=\"../classes/Shape.html\">`Shape`</a>"," * <li><a href=\"../classes/Circle.html\">`Circle`</a>"," * <li><a href=\"../classes/Ellipse.html\">`Ellipse`</a>"," * <li><a href=\"../classes/Rect.html\">`Rect`</a>"," * <li><a href=\"../classes/Path.html\">`Path`</a>"," * </ul>"," * You can also extend the `Shape` class to create your own custom shape classes.</p>"," * @module graphics"," * @main graphics"," */","var SETTER = \"setter\","," PluginHost = Y.Plugin.Host,"," VALUE = \"value\","," VALUEFN = \"valueFn\","," READONLY = \"readOnly\","," Y_LANG = Y.Lang,"," STR = \"string\","," WRITE_ONCE = \"writeOnce\","," GraphicBase,"," AttributeLite;"," "," /**"," * AttributeLite provides Attribute-like getters and setters for shape classes in the Graphics module. It provides a get/set API without the event infastructure."," * This class is temporary and a work in progress."," *"," * @class AttributeLite"," * @constructor"," */"," AttributeLite = function()"," {"," var host = this; // help compression"," "," // Perf tweak - avoid creating event literals if not required."," host._ATTR_E_FACADE = {};"," "," Y.EventTarget.call(this, {emitFacade:true});"," host._state = {};"," host.prototype = Y.mix(AttributeLite.prototype, host.prototype);"," };",""," AttributeLite.prototype = {"," /**"," * Initializes the attributes for a shape. If an attribute config is passed into the constructor of the host, "," * the initial values will be overwritten."," *"," * @method addAttrs"," * @param {Object} cfg Optional object containing attributes key value pairs to be set."," */"," addAttrs: function(cfg)"," {"," var host = this,"," attrConfig = this.constructor.ATTRS, "," attr,"," i,"," fn,"," state = host._state;"," for(i in attrConfig)"," {"," if(attrConfig.hasOwnProperty(i))"," {"," attr = attrConfig[i];"," if(attr.hasOwnProperty(VALUE))"," {"," state[i] = attr.value;"," }"," else if(attr.hasOwnProperty(VALUEFN))"," {"," fn = attr.valueFn;"," if(Y_LANG.isString(fn))"," {"," state[i] = host[fn].apply(host);"," }"," else"," {"," state[i] = fn.apply(host);"," }"," }"," }"," }"," host._state = state;"," for(i in attrConfig)"," {"," if(attrConfig.hasOwnProperty(i))"," {"," attr = attrConfig[i];"," if(attr.hasOwnProperty(READONLY) && attr.readOnly)"," {"," continue;"," }",""," if(attr.hasOwnProperty(WRITE_ONCE) && attr.writeOnce)"," {"," attr.readOnly = true;"," }",""," if(cfg && cfg.hasOwnProperty(i))"," {"," if(attr.hasOwnProperty(SETTER))"," {"," host._state[i] = attr.setter.apply(host, [cfg[i]]);"," }"," else"," {"," host._state[i] = cfg[i];"," }"," }"," }"," }"," },",""," /**"," * For a given item, returns the value of the property requested, or undefined if not found."," *"," * @method get"," * @param name {String} The name of the item"," * @return {Any} The value of the supplied property."," */"," get: function(attr)"," {"," var host = this,"," getter,"," attrConfig = host.constructor.ATTRS;"," if(attrConfig && attrConfig[attr])"," {"," getter = attrConfig[attr].getter;"," if(getter)"," {"," if(typeof getter == STR)"," {"," return host[getter].apply(host);"," }"," return attrConfig[attr].getter.apply(host);"," }",""," return host._state[attr];"," }"," return null;"," },"," "," /**"," * Sets the value of an attribute."," *"," * @method set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," */"," set: function(attr, val)"," {"," var i;"," if(Y_LANG.isObject(attr))"," {"," for(i in attr)"," {"," if(attr.hasOwnProperty(i))"," {"," this._set(i, attr[i]);"," }"," }"," }"," else"," {"," this._set.apply(this, arguments);"," }"," },",""," /**"," * Provides setter logic. Used by `set`."," *"," * @method _set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," * @protected"," */"," _set: function(attr, val)"," {"," var host = this,"," setter,"," args,"," attrConfig = host.constructor.ATTRS;"," if(attrConfig && attrConfig.hasOwnProperty(attr))"," {"," setter = attrConfig[attr].setter;"," if(setter)"," {"," args = [val];"," if(typeof setter == STR)"," {"," val = host[setter].apply(host, args);"," }"," else"," {"," val = attrConfig[attr].setter.apply(host, args);"," }"," }"," host._state[attr] = val;"," }"," }"," };"," Y.mix(AttributeLite, Y.EventTarget, false, null, 1);"," Y.AttributeLite = AttributeLite;",""," /**"," * GraphicBase serves as the base class for the graphic layer. It serves the same purpose as"," * Base but uses a lightweight getter/setter class instead of Attribute."," * This class is temporary and a work in progress."," *"," * @class GraphicBase"," * @constructor"," * @param {Object} cfg Key value pairs for attributes"," */"," GraphicBase = function(cfg)"," {"," var host = this,"," PluginHost = Y.Plugin && Y.Plugin.Host; "," if (host._initPlugins && PluginHost) {"," PluginHost.call(host);"," }"," "," host.name = host.constructor.NAME;"," host._eventPrefix = host.constructor.EVENT_PREFIX || host.constructor.NAME;"," AttributeLite.call(host);"," host.addAttrs(cfg);"," host.init.apply(this, arguments);"," if (host._initPlugins) {"," // Need to initPlugins manually, to handle constructor parsing, static Plug parsing"," host._initPlugins(cfg);"," }"," host.initialized = true;"," };",""," GraphicBase.NAME = \"baseGraphic\";",""," GraphicBase.prototype = {"," /**"," * Init method, invoked during construction."," * Fires an init event after calling `initializer` on implementers."," *"," * @method init"," * @protected "," */"," init: function()"," {"," this.publish(\"init\", {"," fireOnce:true"," });"," this.initializer.apply(this, arguments);"," this.fire(\"init\", {cfg: arguments[0]});"," },",""," /**"," * Camel case concatanates two strings."," *"," * @method _camelCaseConcat"," * @param {String} prefix The first string"," * @param {String} name The second string"," * @return String"," * @private"," */"," _camelCaseConcat: function(prefix, name)"," {"," return prefix + name.charAt(0).toUpperCase() + name.slice(1);"," }"," };","//Straightup augment, no wrapper functions","Y.mix(GraphicBase, Y.AttributeLite, false, null, 1);","Y.mix(GraphicBase, PluginHost, false, null, 1);","GraphicBase.prototype.constructor = GraphicBase;","GraphicBase.plug = PluginHost.plug;","GraphicBase.unplug = PluginHost.unplug;","Y.GraphicBase = GraphicBase;","","","/**"," * `Drawing` provides a set of drawing methods used by `Path` and custom shape classes. "," * `Drawing` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGDrawing.html\">`SVGDrawing`</a></li>"," * <li><a href=\"VMLDrawing.html\">`VMLDrawing`</a></li>"," * <li><a href=\"CanvasDrawing.html\">`CanvasDrawing`</a></li>"," * </ul>"," *"," * @class Drawing"," * @constructor"," */"," /**"," * Draws a line segment using the current line style from the current drawing position to the specified x and y coordinates."," * "," * @method lineTo"," * @param {Number} point1 x-coordinate for the end point."," * @param {Number} point2 y-coordinate for the end point."," */"," /**"," * Moves the current drawing position to specified x and y coordinates."," *"," * @method moveTo"," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," /**"," * Draws a bezier curve."," *"," * @method curveTo"," * @param {Number} cp1x x-coordinate for the first control point."," * @param {Number} cp1y y-coordinate for the first control point."," * @param {Number} cp2x x-coordinate for the second control point."," * @param {Number} cp2y y-coordinate for the second control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," /**"," * Draws a quadratic bezier curve."," *"," * @method quadraticCurveTo"," * @param {Number} cpx x-coordinate for the control point."," * @param {Number} cpy y-coordinate for the control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," /**"," * Draws a rectangle."," *"," * @method drawRect"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," */"," /**"," * Draws a rectangle with rounded corners."," * "," * @method drawRoundRect"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," * @param {Number} ew width of the ellipse used to draw the rounded corners"," * @param {Number} eh height of the ellipse used to draw the rounded corners"," */"," /**"," * Completes a drawing operation. "," *"," * @method end"," */"," /**"," * Clears the path."," *"," * @method clear"," */","/**"," * <p>Base class for creating shapes.</p>"," * <p>`Shape` is an abstract class and is not meant to be used directly. The following classes extend"," * `Shape`."," *"," * <ul>"," * <li><a href=\"Circle.html\">`Circle`</a></li>"," * <li><a href=\"Ellipse.html\">`Ellipse`</a></li>"," * <li><a href=\"Rect.html\">`Rect`</a></li>"," * <li><a href=\"Path.html\">`Path`</a></li>"," * </ul>"," *"," * `Shape` can also be extended to create custom shape classes.</p>"," *"," * `Shape` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGShape.html\">`SVGShape`</a></li>"," * <li><a href=\"VMLShape.html\">`VMLShape`</a></li>"," * <li><a href=\"CanvasShape.html\">`CanvasShape`</a></li>"," * </ul>"," *"," * It is not necessary to interact with these classes directly. `Shape` will point to the appropriate implemention.</p>"," *"," * @class Shape"," * @constructor"," * @param {Object} cfg (optional) Attribute configs"," */"," /**"," * Init method, invoked during construction."," * Calls `initializer` method."," *"," * @method init"," * @protected"," */"," /**"," * Initializes the shape"," *"," * @private"," * @method initializer"," */"," /**"," * Add a class name to each node."," *"," * @method addClass"," * @param {String} className the class name to add to the node's class attribute "," */"," /**"," * Removes a class name from each node."," *"," * @method removeClass"," * @param {String} className the class name to remove from the node's class attribute"," */"," /**"," * Gets the current position of the node in page coordinates."," *"," * @method getXY"," * @return Array The XY position of the shape."," */"," /**"," * Set the position of the shape in page coordinates, regardless of how the node is positioned."," *"," * @method setXY"," * @param {Array} Contains x & y values for new position (coordinates are page-based)"," */"," /**"," * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy. "," *"," * @method contains"," * @param {Shape | HTMLElement} needle The possible node or descendent"," * @return Boolean Whether or not this shape is the needle or its ancestor."," */"," /**"," * Compares nodes to determine if they match."," * Node instances can be compared to each other and/or HTMLElements."," * @method compareTo"," * @param {HTMLElement | Node} refNode The reference node to compare to the node."," * @return {Boolean} True if the nodes match, false if they do not."," */"," /**"," * Test if the supplied node matches the supplied selector."," *"," * @method test"," * @param {String} selector The CSS selector to test against."," * @return Boolean Wheter or not the shape matches the selector."," */"," /**"," * Sets the value of an attribute."," *"," * @method set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," */"," /**"," * Specifies a 2d translation."," *"," * @method translate"," * @param {Number} x The value to transate on the x-axis."," * @param {Number} y The value to translate on the y-axis."," */"," /**"," * Translates the shape along the x-axis. When translating x and y coordinates,"," * use the `translate` method."," *"," * @method translateX"," * @param {Number} x The value to translate."," */"," /**"," * Translates the shape along the y-axis. When translating x and y coordinates,"," * use the `translate` method."," *"," * @method translateY"," * @param {Number} y The value to translate."," */"," /**"," * Skews the shape around the x-axis and y-axis."," *"," * @method skew"," * @param {Number} x The value to skew on the x-axis."," * @param {Number} y The value to skew on the y-axis."," */"," /**"," * Skews the shape around the x-axis."," *"," * @method skewX"," * @param {Number} x x-coordinate"," */"," /**"," * Skews the shape around the y-axis."," *"," * @method skewY"," * @param {Number} y y-coordinate"," */"," /**"," * Rotates the shape clockwise around it transformOrigin."," *"," * @method rotate"," * @param {Number} deg The degree of the rotation."," */"," /**"," * Specifies a 2d scaling operation."," *"," * @method scale"," * @param {Number} val"," */"," /**"," * Returns the bounds for a shape."," *"," * Calculates the a new bounding box from the original corner coordinates (base on size and position) and the transform matrix."," * The calculated bounding box is used by the graphic instance to calculate its viewBox. "," *"," * @method getBounds"," * @return Object"," */"," /**"," * Destroys the instance."," *"," * @method destroy"," */"," /**"," * An array of x, y values which indicates the transformOrigin in which to rotate the shape. Valid values range between 0 and 1 representing a "," * fraction of the shape's corresponding bounding box dimension. The default value is [0.5, 0.5]."," *"," * @config transformOrigin"," * @type Array"," */"," /**"," * <p>A string containing, in order, transform operations applied to the shape instance. The `transform` string can contain the following values:"," * "," * <dl>"," * <dt>rotate</dt><dd>Rotates the shape clockwise around it transformOrigin.</dd>"," * <dt>translate</dt><dd>Specifies a 2d translation.</dd>"," * <dt>skew</dt><dd>Skews the shape around the x-axis and y-axis.</dd>"," * <dt>scale</dt><dd>Specifies a 2d scaling operation.</dd>"," * <dt>translateX</dt><dd>Translates the shape along the x-axis.</dd>"," * <dt>translateY</dt><dd>Translates the shape along the y-axis.</dd>"," * <dt>skewX</dt><dd>Skews the shape around the x-axis.</dd>"," * <dt>skewY</dt><dd>Skews the shape around the y-axis.</dd>"," * </dl>"," * </p>"," * <p>Applying transforms through the transform attribute will reset the transform matrix and apply a new transform. The shape class also contains corresponding methods for each transform"," * that will apply the transform to the current matrix. The below code illustrates how you might use the `transform` attribute to instantiate a recangle with a rotation of 45 degrees.</p>"," var myRect = new Y.Rect({"," type:\"rect\","," width: 50,"," height: 40,"," transform: \"rotate(45)\""," };"," * <p>The code below would apply `translate` and `rotate` to an existing shape.</p>"," "," myRect.set(\"transform\", \"translate(40, 50) rotate(45)\");"," * @config transform"," * @type String "," */"," /**"," * Unique id for class instance."," *"," * @config id"," * @type String"," */"," /**"," * Indicates the x position of shape."," *"," * @config x"," * @type Number"," */"," /**"," * Indicates the y position of shape."," *"," * @config y"," * @type Number"," */"," /**"," * Indicates the width of the shape"," *"," * @config width"," * @type Number"," */"," /**"," * Indicates the height of the shape"," * "," * @config height"," * @type Number"," */"," /**"," * Indicates whether the shape is visible."," *"," * @config visible"," * @type Boolean"," */"," /**"," * Contains information about the fill of the shape. "," * <dl>"," * <dt>color</dt><dd>The color of the fill.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1.</dd>"," * <dt>type</dt><dd>Type of fill."," * <dl>"," * <dt>solid</dt><dd>Solid single color fill. (default)</dd>"," * <dt>linear</dt><dd>Linear gradient fill.</dd>"," * <dt>radial</dt><dd>Radial gradient fill.</dd>"," * </dl>"," * </dd>"," * </dl>"," * <p>If a `linear` or `radial` is specified as the fill type. The following additional property is used:"," * <dl>"," * <dt>stops</dt><dd>An array of objects containing the following properties:"," * <dl>"," * <dt>color</dt><dd>The color of the stop.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stop. The default value is 1. Note: No effect for IE 6 - 8</dd>"," * <dt>offset</dt><dd>Number between 0 and 1 indicating where the color stop is positioned.</dd> "," * </dl>"," * </dd>"," * <p>Linear gradients also have the following property:</p>"," * <dt>rotation</dt><dd>Linear gradients flow left to right by default. The rotation property allows you to change the flow by rotation. (e.g. A rotation of 180 would make the gradient pain from right to left.)</dd>"," * <p>Radial gradients have the following additional properties:</p>"," * <dt>r</dt><dd>Radius of the gradient circle.</dd>"," * <dt>fx</dt><dd>Focal point x-coordinate of the gradient.</dd>"," * <dt>fy</dt><dd>Focal point y-coordinate of the gradient.</dd>"," * <dt>cx</dt><dd>"," * <p>The x-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>"," * <p><strong>Note: </strong>Currently, this property is not implemented for corresponding `CanvasShape` and `VMLShape` classes which are used on Android or IE 6 - 8.</p>"," * </dd>"," * <dt>cy</dt><dd>"," * <p>The y-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>"," * <p><strong>Note: </strong>Currently, this property is not implemented for corresponding `CanvasShape` and `VMLShape` classes which are used on Android or IE 6 - 8.</p>"," * </dd>"," * </dl>"," *"," * @config fill"," * @type Object "," */"," /**"," * Contains information about the stroke of the shape."," * <dl>"," * <dt>color</dt><dd>The color of the stroke.</dd>"," * <dt>weight</dt><dd>Number that indicates the width of the stroke.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stroke. The default value is 1.</dd>"," * <dt>dashstyle</dt>Indicates whether to draw a dashed stroke. When set to \"none\", a solid stroke is drawn. When set to an array, the first index indicates the"," * length of the dash. The second index indicates the length of gap."," * <dt>linecap</dt><dd>Specifies the linecap for the stroke. The following values can be specified:"," * <dl>"," * <dt>butt (default)</dt><dd>Specifies a butt linecap.</dd>"," * <dt>square</dt><dd>Specifies a sqare linecap.</dd>"," * <dt>round</dt><dd>Specifies a round linecap.</dd>"," * </dl>"," * </dd>"," * <dt>linejoin</dt><dd>Specifies a linejoin for the stroke. The following values can be specified:"," * <dl>"," * <dt>round (default)</dt><dd>Specifies that the linejoin will be round.</dd>"," * <dt>bevel</dt><dd>Specifies a bevel for the linejoin.</dd>"," * <dt>miter limit</dt><dd>An integer specifying the miter limit of a miter linejoin. If you want to specify a linejoin of miter, you simply specify the limit as opposed to having"," * separate miter and miter limit values.</dd>"," * </dl>"," * </dd>"," * </dl>"," *"," * @config stroke"," * @type Object"," */"," /**"," * Dom node for the shape."," *"," * @config node"," * @type HTMLElement"," * @readOnly"," */"," /**"," * Represents an SVG Path string. This will be parsed and added to shape's API to represent the SVG data across all implementations. Note that when using VML or SVG "," * implementations, part of this content will be added to the DOM using respective VML/SVG attributes. If your content comes from an untrusted source, you will need "," * to ensure that no malicious code is included in that content. "," *"," * @config data"," * @type String"," */"," /**"," * Reference to the parent graphic instance"," *"," * @config graphic"," * @type Graphic"," * @readOnly"," */","","/**"," * <p>Creates circle shape with editable attributes.</p> "," * <p>`Circle` instances can be created using the <a href=\"Graphic.html#method_addShape\">`addShape`</a> method of the <a href=\"Graphic.html\">`Graphic`</a> class. "," * The method's `cfg` argument contains a `type` attribute. Assigning \"circle\" or `Y.Circle` to this attribute will create a `Circle` instance. Required attributes"," * for instantiating a `Circle` are `type` and `radius`. Optional attributes include:"," * <ul>"," * <li><a href=\"#attr_fill\">fill</a></li>"," * <li><a href=\"#attr_id\">id</a></li>"," * <li><a href=\"#attr_stroke\">stroke</a></li>"," * <li><a href=\"#attr_transform\">transform</a></li>"," * <li><a href=\"#attr_transformOrigin\">transformOrigin</a></li>"," * <li><a href=\"#attr_visible\">visible</a></li>"," * <li><a href=\"#attr_x\">x</a></li>"," * <li><a href=\"#attr_y\">y</a></li>"," * </ul>"," * "," * The below code creates a circle by defining the `type` attribute as \"circle\":</p>",""," var myCircle = myGraphic.addShape({"," type: \"circle\","," radius: 10,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });",""," * Below, this same circle is created by defining the `type` attribute with a class reference:"," *"," var myCircle = myGraphic.addShape({"," type: Y.Circle,"," radius: 10,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });"," * "," * <p>`Circle` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGCircle.html\">`SVGCircle`</a></li>"," * <li><a href=\"VMLCircle.html\">`VMLCircle`</a></li>"," * <li><a href=\"CanvasCircle.html\">`CanvasCircle`</a></li>"," * </ul>"," *"," * It is not necessary to interact with these classes directly. `Circle` will point to the appropriate implemention.</p>"," *"," * @class Circle"," * @extends Shape"," * @constructor"," */"," /**"," * Radius of the circle"," *"," * @config radius"," * @type Number"," */","/**"," * <p>Creates an ellipse shape with editable attributes.</p>"," * <p>`Ellipse` instances can be created using the <a href=\"Graphic.html#method_addShape\">`addShape`</a> method of the <a href=\"Graphic.html\">`Graphic`</a> class. "," * The method's `cfg` argument contains a `type` attribute. Assigning \"ellipse\" or `Y.Ellipse` to this attribute will create a `Ellipse` instance. Required attributes"," * for instantiating a `Ellipse` are `type`, `width` and `height`. Optional attributes include:"," * <ul>"," * <li><a href=\"#attr_fill\">fill</a></li>"," * <li><a href=\"#attr_id\">id</a></li>"," * <li><a href=\"#attr_stroke\">stroke</a></li>"," * <li><a href=\"#attr_transform\">transform</a></li>"," * <li><a href=\"#attr_transformOrigin\">transformOrigin</a></li>"," * <li><a href=\"#attr_visible\">visible</a></li>"," * <li><a href=\"#attr_x\">x</a></li>"," * <li><a href=\"#attr_y\">y</a></li>"," * </ul>"," * "," * The below code creates an ellipse by defining the `type` attribute as \"ellipse\":</p>",""," var myEllipse = myGraphic.addShape({"," type: \"ellipse\","," width: 20,"," height: 10,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });",""," * Below, the same ellipse is created by defining the `type` attribute with a class reference:"," *"," var myEllipse = myGraphic.addShape({"," type: Y.Ellipse,"," width: 20,"," height: 10,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });"," * "," * <p>`Ellipse` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGEllipse.html\">`SVGEllipse`</a></li>"," * <li><a href=\"VMLEllipse.html\">`VMLEllipse`</a></li>"," * <li><a href=\"CanvasEllipse.html\">`CanvasEllipse`</a></li>"," * </ul>"," *"," * It is not necessary to interact with these classes directly. `Ellipse` will point to the appropriate implemention.</p>"," *"," * @class Ellipse"," * @extends Shape"," * @constructor"," */","/**"," * <p>Creates an rectangle shape with editable attributes.</p>"," * <p>`Rect` instances can be created using the <a href=\"Graphic.html#method_addShape\">`addShape`</a> method of the <a href=\"Graphic.html\">`Graphic`</a> "," * class. The method's `cfg` argument contains a `type` attribute. Assigning \"rect\" or `Y.Rect` to this attribute will create a `Rect` instance. "," * Required attributes for instantiating a `Rect` are `type`, `width` and `height`. Optional attributes include:"," * <ul>"," * <li><a href=\"#attr_fill\">fill</a></li>"," * <li><a href=\"#attr_id\">id</a></li>"," * <li><a href=\"#attr_stroke\">stroke</a></li>"," * <li><a href=\"#attr_transform\">transform</a></li>"," * <li><a href=\"#attr_transformOrigin\">transformOrigin</a></li>"," * <li><a href=\"#attr_visible\">visible</a></li>"," * <li><a href=\"#attr_x\">x</a></li>"," * <li><a href=\"#attr_y\">y</a></li>"," * </ul>"," *"," * The below code creates a rectangle by defining the `type` attribute as \"rect\":</p>",""," var myRect = myGraphic.addShape({"," type: \"rect\","," width: 20,"," height: 10,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });",""," * Below, the same rectangle is created by defining the `type` attribute with a class reference:"," *"," var myRect = myGraphic.addShape({"," type: Y.Rect,"," width: 20,"," height: 10,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });"," *"," * <p>`Rect` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGRect.html\">`SVGRect`</a></li>"," * <li><a href=\"VMLRect.html\">`VMLRect`</a></li>"," * <li><a href=\"CanvasRect.html\">`CanvasRect`</a></li>"," * </ul>"," *"," * It is not necessary to interact with these classes directly. `Rect` will point to the appropriate implemention.</p>"," *"," * @class Rect"," * @extends Shape"," * @constructor"," */","/**"," * <p>The `Path` class creates a shape through the use of drawing methods. The `Path` class has the following drawing methods available:</p>"," * <ul>"," * <li><a href=\"#method_clear\">`clear`</a></li>"," * <li><a href=\"#method_curveTo\">`curveTo`</a></li>"," * <li><a href=\"#method_drawRect\">`drawRect`</a></li>"," * <li><a href=\"#method_drawRoundRect\">`drawRoundRect`</a></li>"," * <li><a href=\"#method_end\">`end`</a></li>"," * <li><a href=\"#method_lineTo\">`lineTo`</a></li>"," * <li><a href=\"#method_moveTo\">`moveTo`</a></li>"," * <li><a href=\"#method_quadraticCurveTo\">`quadraticCurveTo`</a></li>"," * </ul>"," *"," * <p>Like other shapes, `Path` elements are created using the <a href=\"Graphic.html#method_addShape\">`addShape`</a> method of the <a href=\"Graphic.html\">`Graphic`</a> "," * class. The method's `cfg` argument contains a `type` attribute. Assigning \"path\" or `Y.Path` to this attribute will create a `Path` instance."," * After instantiation, a series of drawing operations must be performed in order to render a shape. The below code instantiates a path element by defining the `type` "," * attribute as \"path\":</p>",""," var myPath = myGraphic.addShape({"," type: \"path\","," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });",""," * Below a `Path` element with the same properties is instantiated by defining the `type` attribute with a class reference:"," *"," var myPath = myGraphic.addShape({"," type: Y.Path,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });",""," * After instantiation, a shape or segment needs to be drawn for an element to render. After all draw operations are performed, the <a href=\"#method_end\">`end`</a>"," * method will render the shape. The code below will draw a triangle:"," "," myPath.moveTo(35, 5);"," myPath.lineTo(65, 65);"," myPath.lineTo(5, 65);"," myPath.lineTo(35, 5);"," myPath.end();"," *"," * <p>`Path` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGPath.html\">`SVGPath`</a></li>"," * <li><a href=\"VMLPath.html\">`VMLPath`</a></li>"," * <li><a href=\"CanvasPath.html\">`CanvasPath`</a></li>"," * </ul> "," * It is not necessary to interact with these classes directly. `Path` will point to the appropriate implemention.</p>"," *"," * @class Path"," * @extends Shape"," * @uses Drawing"," * @constructor"," */"," /**"," * Indicates the path used for the node."," *"," * @config path"," * @type String"," * @readOnly"," */","/**"," * `Graphic` acts a factory and container for shapes. You need at least one `Graphic` instance to create shapes for your application. "," * <p>The code block below creates a `Graphic` instance and appends it to an HTMLElement with the id 'mygraphiccontainer'.</p>"," "," var myGraphic = new Y.Graphic({render:\"#mygraphiccontainer\"});",""," * <p>Alternatively, you can add a `Graphic` instance to the DOM using the <a href=\"#method_render\">`render`</a> method.</p>"," var myGraphic = new Y.Graphic();"," myGraphic.render(\"#mygraphiccontainer\");",""," * `Graphic` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGGraphic.html\">`SVGGraphic`</a></li>"," * <li><a href=\"VMLGraphic.html\">`VMLGraphic`</a></li>"," * <li><a href=\"CanvasGraphic.html\">`CanvasGraphic`</a></li>"," * </ul>"," *"," * It is not necessary to interact with these classes directly. `Graphic` will point to the appropriate implemention.</p>"," *"," * @class Graphic"," * @constructor"," */"," /**"," * Whether or not to render the `Graphic` automatically after to a specified parent node after init. This can be a Node instance or a CSS selector string."," * "," * @config render"," * @type Node | String "," */"," /**"," * Unique id for class instance."," *"," * @config id"," * @type String"," */"," /**"," * Key value pairs in which a shape instance is associated with its id."," *"," * @config shapes"," * @type Object"," * @readOnly"," */"," /**"," * Object containing size and coordinate data for the content of a Graphic in relation to the coordSpace node."," *"," * @config contentBounds"," * @type Object "," * @readOnly"," */"," /**"," * The html element that represents to coordinate system of the Graphic instance."," *"," * @config node"," * @type HTMLElement"," * @readOnly"," */"," /**"," * Indicates the width of the `Graphic`. "," *"," * @config width"," * @type Number"," */"," /**"," * Indicates the height of the `Graphic`. "," *"," * @config height "," * @type Number"," */"," /**"," * Determines the sizing of the Graphic. "," *"," * <dl>"," * <dt>sizeContentToGraphic</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>"," * attributes or are determined by the dimensions of the parent element. The content contained in the Graphic will be sized to fit with in the Graphic instance's "," * dimensions. When using this setting, the <code>preserveAspectRatio</code> attribute will determine how the contents are sized.</dd>"," * <dt>sizeGraphicToContent</dt><dd>(Also accepts a value of true) The Graphic's width and height are determined by the size and positioning of the content.</dd>"," * <dt>false</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>"," * attributes or are determined by the dimensions of the parent element. The contents of the Graphic instance are not affected by this setting.</dd>"," * </dl>"," *"," *"," * @config autoSize"," * @type Boolean | String"," * @default false"," */"," /**"," * Determines how content is sized when <code>autoSize</code> is set to <code>sizeContentToGraphic</code>."," *"," * <dl>"," * <dt>none<dt><dd>Do not force uniform scaling. Scale the graphic content of the given element non-uniformly if necessary "," * such that the element's bounding box exactly matches the viewport rectangle.</dd>"," * <dt>xMinYMin</dt><dd>Force uniform scaling position along the top left of the Graphic's node.</dd>"," * <dt>xMidYMin</dt><dd>Force uniform scaling horizontally centered and positioned at the top of the Graphic's node.<dd>"," * <dt>xMaxYMin</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the top.</dd>"," * <dt>xMinYMid</dt>Force uniform scaling positioned horizontally from the left and vertically centered.</dd>"," * <dt>xMidYMid (the default)</dt><dd>Force uniform scaling with the content centered.</dd>"," * <dt>xMaxYMid</dt><dd>Force uniform scaling positioned horizontally from the right and vertically centered.</dd>"," * <dt>xMinYMax</dt><dd>Force uniform scaling positioned horizontally from the left and vertically from the bottom.</dd>"," * <dt>xMidYMax</dt><dd>Force uniform scaling horizontally centered and position vertically from the bottom.</dd>"," * <dt>xMaxYMax</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the bottom.</dd>"," * </dl>"," * "," * @config preserveAspectRatio"," * @type String"," * @default xMidYMid"," */"," /**"," * The contentBounds will resize to greater values but not to smaller values. (for performance)"," * When resizing the contentBounds down is desirable, set the resizeDown value to true."," *"," * @config resizeDown "," * @type Boolean"," */"," /**"," * Indicates the x-coordinate for the instance."," *"," * @config x"," * @type Number"," */"," /**"," * Indicates the y-coordinate for the instance."," *"," * @config y"," * @type Number"," */"," /**"," * Indicates whether or not the instance will automatically redraw after a change is made to a shape."," * This property will get set to false when batching operations."," *"," * @config autoDraw"," * @type Boolean"," * @default true"," * @private"," */"," /**"," * Indicates whether the `Graphic` and its children are visible."," *"," * @config visible"," * @type Boolean"," */"," /**"," * Gets the current position of the graphic instance in page coordinates."," *"," * @method getXY"," * @return Array The XY position of the shape."," */"," /**"," * Adds the graphics node to the dom."," * "," * @method render"," * @param {Node|String} parentNode node in which to render the graphics node into."," */"," /**"," * Removes all nodes."," *"," * @method destroy"," */"," /**"," * <p>Generates a shape instance by type. The method accepts an object that contain's the shape's"," * type and attributes to be customized. For example, the code below would create a rectangle:</p>"," *"," var myRect = myGraphic.addShape({"," type: \"rect\","," width: 40,"," height: 30,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });"," *"," * <p>The `Graphics` module includes a few basic shapes. More information on their creation "," * can be found in each shape's documentation:"," *"," * <ul>"," * <li><a href=\"Circle.html\">`Circle`</a></li>"," * <li><a href=\"Ellipse.html\">`Ellipse`</a></li>"," * <li><a href=\"Rect.html\">`Rect`</a></li>"," * <li><a href=\"Path.html\">`Path`</a></li>"," * </ul>"," *"," * The `Graphics` module also allows for the creation of custom shapes. If a custom shape"," * has been created, it can be instantiated with the `addShape` method as well. The attributes,"," * required and optional, would need to be defined in the custom shape."," *"," var myCustomShape = myGraphic.addShape({"," type: Y.MyCustomShape,"," width: 50,"," height: 50,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });"," *"," * @method addShape"," * @param {Object} cfg Object containing the shape's type and attributes. "," * @return Shape"," */"," /**"," * Removes a shape instance from from the graphic instance."," *"," * @method removeShape"," * @param {Shape|String} shape The instance or id of the shape to be removed."," */"," /**"," * Removes all shape instances from the dom."," *"," * @method removeAllShapes"," */"," /**"," * Returns a shape based on the id of its dom node."," *"," * @method getShapeById"," * @param {String} id Dom id of the shape's node attribute."," * @return Shape"," */"," /**"," * Allows for creating multiple shapes in order to batch appending and redraw operations."," *"," * @method batch"," * @param {Function} method Method to execute."," */","","","}, '@VERSION@', {\"requires\": [\"node\", \"event-custom\", \"pluginhost\", \"matrix\", \"classnamemanager\"]});"];
_yuitest_coverage["build/graphics/graphics.js"].lines = {"1":0,"32":0,"50":0,"52":0,"55":0,"57":0,"58":0,"59":0,"62":0,"72":0,"78":0,"80":0,"82":0,"83":0,"85":0,"87":0,"89":0,"90":0,"92":0,"96":0,"101":0,"102":0,"104":0,"106":0,"107":0,"109":0,"112":0,"114":0,"117":0,"119":0,"121":0,"125":0,"141":0,"144":0,"146":0,"147":0,"149":0,"151":0,"153":0,"156":0,"158":0,"172":0,"173":0,"175":0,"177":0,"179":0,"185":0,"201":0,"205":0,"207":0,"208":0,"210":0,"211":0,"213":0,"217":0,"220":0,"224":0,"225":0,"236":0,"238":0,"240":0,"241":0,"244":0,"245":0,"246":0,"247":0,"248":0,"249":0,"251":0,"253":0,"256":0,"258":0,"268":0,"271":0,"272":0,"286":0,"290":0,"291":0,"292":0,"293":0,"294":0,"295":0};
_yuitest_coverage["build/graphics/graphics.js"].functions = {"AttributeLite:50":0,"addAttrs:70":0,"get:139":0,"set:170":0,"_set:199":0,"GraphicBase:236":0,"init:266":0,"_camelCaseConcat:284":0,"(anonymous 1):1":0};
_yuitest_coverage["build/graphics/graphics.js"].coveredLines = 82;
_yuitest_coverage["build/graphics/graphics.js"].coveredFunctions = 9;
_yuitest_coverline("build/graphics/graphics.js", 1);
YUI.add('graphics', function (Y, NAME) {
/**
*
* <p>The `Graphics` module provides a JavaScript API for creating shapes in a variety of formats across
* a <a href="http://developer.yahoo.com/yui/articles/gbs">browser test baseline</a>.
* Based on device and browser capabilities, `Graphics` leverages <a href="http://www.w3.org/TR/SVG/">SVG</a>,
* <a href="http://www.w3.org/TR/html5/the-canvas-element.html">Canvas</a> and <a href="http://www.w3.org/TR/NOTE-VML">VML</a>
* to render its graphical elements.</p>
*
* <p>The `Graphics` module features a <a href="../classes/Graphic.html">`Graphic`</a> class that allows you to easily create and manage shapes.
* Currently, a <a href="../classes/Graphic.html">`Graphic`</a> instance can be used to create predifined shapes and free-form polygons with fill
* and stroke properties.</p>
*
* <p>The `Graphics` module normalizes an API through the use of alias and implementation classes that share
* interfaces. Each alias class points to an appropriate implementation class dependent on the browser's
* capabilities. There should rarely, if ever, be a need to interact directly with an implementation class.</p>
*
* <p>Below is a list of available classes.
* <ul>
* <li><a href="../classes/Graphic.html">`Graphic`</a>
* <li><a href="../classes/Shape.html">`Shape`</a>
* <li><a href="../classes/Circle.html">`Circle`</a>
* <li><a href="../classes/Ellipse.html">`Ellipse`</a>
* <li><a href="../classes/Rect.html">`Rect`</a>
* <li><a href="../classes/Path.html">`Path`</a>
* </ul>
* You can also extend the `Shape` class to create your own custom shape classes.</p>
* @module graphics
* @main graphics
*/
_yuitest_coverfunc("build/graphics/graphics.js", "(anonymous 1)", 1);
_yuitest_coverline("build/graphics/graphics.js", 32);
var SETTER = "setter",
PluginHost = Y.Plugin.Host,
VALUE = "value",
VALUEFN = "valueFn",
READONLY = "readOnly",
Y_LANG = Y.Lang,
STR = "string",
WRITE_ONCE = "writeOnce",
GraphicBase,
AttributeLite;
/**
* AttributeLite provides Attribute-like getters and setters for shape classes in the Graphics module. It provides a get/set API without the event infastructure.
* This class is temporary and a work in progress.
*
* @class AttributeLite
* @constructor
*/
_yuitest_coverline("build/graphics/graphics.js", 50);
AttributeLite = function()
{
_yuitest_coverfunc("build/graphics/graphics.js", "AttributeLite", 50);
_yuitest_coverline("build/graphics/graphics.js", 52);
var host = this; // help compression
// Perf tweak - avoid creating event literals if not required.
_yuitest_coverline("build/graphics/graphics.js", 55);
host._ATTR_E_FACADE = {};
_yuitest_coverline("build/graphics/graphics.js", 57);
Y.EventTarget.call(this, {emitFacade:true});
_yuitest_coverline("build/graphics/graphics.js", 58);
host._state = {};
_yuitest_coverline("build/graphics/graphics.js", 59);
host.prototype = Y.mix(AttributeLite.prototype, host.prototype);
};
_yuitest_coverline("build/graphics/graphics.js", 62);
AttributeLite.prototype = {
/**
* Initializes the attributes for a shape. If an attribute config is passed into the constructor of the host,
* the initial values will be overwritten.
*
* @method addAttrs
* @param {Object} cfg Optional object containing attributes key value pairs to be set.
*/
addAttrs: function(cfg)
{
_yuitest_coverfunc("build/graphics/graphics.js", "addAttrs", 70);
_yuitest_coverline("build/graphics/graphics.js", 72);
var host = this,
attrConfig = this.constructor.ATTRS,
attr,
i,
fn,
state = host._state;
_yuitest_coverline("build/graphics/graphics.js", 78);
for(i in attrConfig)
{
_yuitest_coverline("build/graphics/graphics.js", 80);
if(attrConfig.hasOwnProperty(i))
{
_yuitest_coverline("build/graphics/graphics.js", 82);
attr = attrConfig[i];
_yuitest_coverline("build/graphics/graphics.js", 83);
if(attr.hasOwnProperty(VALUE))
{
_yuitest_coverline("build/graphics/graphics.js", 85);
state[i] = attr.value;
}
else {_yuitest_coverline("build/graphics/graphics.js", 87);
if(attr.hasOwnProperty(VALUEFN))
{
_yuitest_coverline("build/graphics/graphics.js", 89);
fn = attr.valueFn;
_yuitest_coverline("build/graphics/graphics.js", 90);
if(Y_LANG.isString(fn))
{
_yuitest_coverline("build/graphics/graphics.js", 92);
state[i] = host[fn].apply(host);
}
else
{
_yuitest_coverline("build/graphics/graphics.js", 96);
state[i] = fn.apply(host);
}
}}
}
}
_yuitest_coverline("build/graphics/graphics.js", 101);
host._state = state;
_yuitest_coverline("build/graphics/graphics.js", 102);
for(i in attrConfig)
{
_yuitest_coverline("build/graphics/graphics.js", 104);
if(attrConfig.hasOwnProperty(i))
{
_yuitest_coverline("build/graphics/graphics.js", 106);
attr = attrConfig[i];
_yuitest_coverline("build/graphics/graphics.js", 107);
if(attr.hasOwnProperty(READONLY) && attr.readOnly)
{
_yuitest_coverline("build/graphics/graphics.js", 109);
continue;
}
_yuitest_coverline("build/graphics/graphics.js", 112);
if(attr.hasOwnProperty(WRITE_ONCE) && attr.writeOnce)
{
_yuitest_coverline("build/graphics/graphics.js", 114);
attr.readOnly = true;
}
_yuitest_coverline("build/graphics/graphics.js", 117);
if(cfg && cfg.hasOwnProperty(i))
{
_yuitest_coverline("build/graphics/graphics.js", 119);
if(attr.hasOwnProperty(SETTER))
{
_yuitest_coverline("build/graphics/graphics.js", 121);
host._state[i] = attr.setter.apply(host, [cfg[i]]);
}
else
{
_yuitest_coverline("build/graphics/graphics.js", 125);
host._state[i] = cfg[i];
}
}
}
}
},
/**
* For a given item, returns the value of the property requested, or undefined if not found.
*
* @method get
* @param name {String} The name of the item
* @return {Any} The value of the supplied property.
*/
get: function(attr)
{
_yuitest_coverfunc("build/graphics/graphics.js", "get", 139);
_yuitest_coverline("build/graphics/graphics.js", 141);
var host = this,
getter,
attrConfig = host.constructor.ATTRS;
_yuitest_coverline("build/graphics/graphics.js", 144);
if(attrConfig && attrConfig[attr])
{
_yuitest_coverline("build/graphics/graphics.js", 146);
getter = attrConfig[attr].getter;
_yuitest_coverline("build/graphics/graphics.js", 147);
if(getter)
{
_yuitest_coverline("build/graphics/graphics.js", 149);
if(typeof getter == STR)
{
_yuitest_coverline("build/graphics/graphics.js", 151);
return host[getter].apply(host);
}
_yuitest_coverline("build/graphics/graphics.js", 153);
return attrConfig[attr].getter.apply(host);
}
_yuitest_coverline("build/graphics/graphics.js", 156);
return host._state[attr];
}
_yuitest_coverline("build/graphics/graphics.js", 158);
return null;
},
/**
* Sets the value of an attribute.
*
* @method set
* @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can
* be passed in to set multiple attributes at once.
* @param {Any} value The value to set the attribute to. This value is ignored if an object is received as
* the name param.
*/
set: function(attr, val)
{
_yuitest_coverfunc("build/graphics/graphics.js", "set", 170);
_yuitest_coverline("build/graphics/graphics.js", 172);
var i;
_yuitest_coverline("build/graphics/graphics.js", 173);
if(Y_LANG.isObject(attr))
{
_yuitest_coverline("build/graphics/graphics.js", 175);
for(i in attr)
{
_yuitest_coverline("build/graphics/graphics.js", 177);
if(attr.hasOwnProperty(i))
{
_yuitest_coverline("build/graphics/graphics.js", 179);
this._set(i, attr[i]);
}
}
}
else
{
_yuitest_coverline("build/graphics/graphics.js", 185);
this._set.apply(this, arguments);
}
},
/**
* Provides setter logic. Used by `set`.
*
* @method _set
* @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can
* be passed in to set multiple attributes at once.
* @param {Any} value The value to set the attribute to. This value is ignored if an object is received as
* the name param.
* @protected
*/
_set: function(attr, val)
{
_yuitest_coverfunc("build/graphics/graphics.js", "_set", 199);
_yuitest_coverline("build/graphics/graphics.js", 201);
var host = this,
setter,
args,
attrConfig = host.constructor.ATTRS;
_yuitest_coverline("build/graphics/graphics.js", 205);
if(attrConfig && attrConfig.hasOwnProperty(attr))
{
_yuitest_coverline("build/graphics/graphics.js", 207);
setter = attrConfig[attr].setter;
_yuitest_coverline("build/graphics/graphics.js", 208);
if(setter)
{
_yuitest_coverline("build/graphics/graphics.js", 210);
args = [val];
_yuitest_coverline("build/graphics/graphics.js", 211);
if(typeof setter == STR)
{
_yuitest_coverline("build/graphics/graphics.js", 213);
val = host[setter].apply(host, args);
}
else
{
_yuitest_coverline("build/graphics/graphics.js", 217);
val = attrConfig[attr].setter.apply(host, args);
}
}
_yuitest_coverline("build/graphics/graphics.js", 220);
host._state[attr] = val;
}
}
};
_yuitest_coverline("build/graphics/graphics.js", 224);
Y.mix(AttributeLite, Y.EventTarget, false, null, 1);
_yuitest_coverline("build/graphics/graphics.js", 225);
Y.AttributeLite = AttributeLite;
/**
* GraphicBase serves as the base class for the graphic layer. It serves the same purpose as
* Base but uses a lightweight getter/setter class instead of Attribute.
* This class is temporary and a work in progress.
*
* @class GraphicBase
* @constructor
* @param {Object} cfg Key value pairs for attributes
*/
_yuitest_coverline("build/graphics/graphics.js", 236);
GraphicBase = function(cfg)
{
_yuitest_coverfunc("build/graphics/graphics.js", "GraphicBase", 236);
_yuitest_coverline("build/graphics/graphics.js", 238);
var host = this,
PluginHost = Y.Plugin && Y.Plugin.Host;
_yuitest_coverline("build/graphics/graphics.js", 240);
if (host._initPlugins && PluginHost) {
_yuitest_coverline("build/graphics/graphics.js", 241);
PluginHost.call(host);
}
_yuitest_coverline("build/graphics/graphics.js", 244);
host.name = host.constructor.NAME;
_yuitest_coverline("build/graphics/graphics.js", 245);
host._eventPrefix = host.constructor.EVENT_PREFIX || host.constructor.NAME;
_yuitest_coverline("build/graphics/graphics.js", 246);
AttributeLite.call(host);
_yuitest_coverline("build/graphics/graphics.js", 247);
host.addAttrs(cfg);
_yuitest_coverline("build/graphics/graphics.js", 248);
host.init.apply(this, arguments);
_yuitest_coverline("build/graphics/graphics.js", 249);
if (host._initPlugins) {
// Need to initPlugins manually, to handle constructor parsing, static Plug parsing
_yuitest_coverline("build/graphics/graphics.js", 251);
host._initPlugins(cfg);
}
_yuitest_coverline("build/graphics/graphics.js", 253);
host.initialized = true;
};
_yuitest_coverline("build/graphics/graphics.js", 256);
GraphicBase.NAME = "baseGraphic";
_yuitest_coverline("build/graphics/graphics.js", 258);
GraphicBase.prototype = {
/**
* Init method, invoked during construction.
* Fires an init event after calling `initializer` on implementers.
*
* @method init
* @protected
*/
init: function()
{
_yuitest_coverfunc("build/graphics/graphics.js", "init", 266);
_yuitest_coverline("build/graphics/graphics.js", 268);
this.publish("init", {
fireOnce:true
});
_yuitest_coverline("build/graphics/graphics.js", 271);
this.initializer.apply(this, arguments);
_yuitest_coverline("build/graphics/graphics.js", 272);
this.fire("init", {cfg: arguments[0]});
},
/**
* Camel case concatanates two strings.
*
* @method _camelCaseConcat
* @param {String} prefix The first string
* @param {String} name The second string
* @return String
* @private
*/
_camelCaseConcat: function(prefix, name)
{
_yuitest_coverfunc("build/graphics/graphics.js", "_camelCaseConcat", 284);
_yuitest_coverline("build/graphics/graphics.js", 286);
return prefix + name.charAt(0).toUpperCase() + name.slice(1);
}
};
//Straightup augment, no wrapper functions
_yuitest_coverline("build/graphics/graphics.js", 290);
Y.mix(GraphicBase, Y.AttributeLite, false, null, 1);
_yuitest_coverline("build/graphics/graphics.js", 291);
Y.mix(GraphicBase, PluginHost, false, null, 1);
_yuitest_coverline("build/graphics/graphics.js", 292);
GraphicBase.prototype.constructor = GraphicBase;
_yuitest_coverline("build/graphics/graphics.js", 293);
GraphicBase.plug = PluginHost.plug;
_yuitest_coverline("build/graphics/graphics.js", 294);
GraphicBase.unplug = PluginHost.unplug;
_yuitest_coverline("build/graphics/graphics.js", 295);
Y.GraphicBase = GraphicBase;
/**
* `Drawing` provides a set of drawing methods used by `Path` and custom shape classes.
* `Drawing` has the following implementations based on browser capability.
* <ul>
* <li><a href="SVGDrawing.html">`SVGDrawing`</a></li>
* <li><a href="VMLDrawing.html">`VMLDrawing`</a></li>
* <li><a href="CanvasDrawing.html">`CanvasDrawing`</a></li>
* </ul>
*
* @class Drawing
* @constructor
*/
/**
* Draws a line segment using the current line style from the current drawing position to the specified x and y coordinates.
*
* @method lineTo
* @param {Number} point1 x-coordinate for the end point.
* @param {Number} point2 y-coordinate for the end point.
*/
/**
* Moves the current drawing position to specified x and y coordinates.
*
* @method moveTo
* @param {Number} x x-coordinate for the end point.
* @param {Number} y y-coordinate for the end point.
*/
/**
* Draws a bezier curve.
*
* @method curveTo
* @param {Number} cp1x x-coordinate for the first control point.
* @param {Number} cp1y y-coordinate for the first control point.
* @param {Number} cp2x x-coordinate for the second control point.
* @param {Number} cp2y y-coordinate for the second control point.
* @param {Number} x x-coordinate for the end point.
* @param {Number} y y-coordinate for the end point.
*/
/**
* Draws a quadratic bezier curve.
*
* @method quadraticCurveTo
* @param {Number} cpx x-coordinate for the control point.
* @param {Number} cpy y-coordinate for the control point.
* @param {Number} x x-coordinate for the end point.
* @param {Number} y y-coordinate for the end point.
*/
/**
* Draws a rectangle.
*
* @method drawRect
* @param {Number} x x-coordinate
* @param {Number} y y-coordinate
* @param {Number} w width
* @param {Number} h height
*/
/**
* Draws a rectangle with rounded corners.
*
* @method drawRoundRect
* @param {Number} x x-coordinate
* @param {Number} y y-coordinate
* @param {Number} w width
* @param {Number} h height
* @param {Number} ew width of the ellipse used to draw the rounded corners
* @param {Number} eh height of the ellipse used to draw the rounded corners
*/
/**
* Completes a drawing operation.
*
* @method end
*/
/**
* Clears the path.
*
* @method clear
*/
/**
* <p>Base class for creating shapes.</p>
* <p>`Shape` is an abstract class and is not meant to be used directly. The following classes extend
* `Shape`.
*
* <ul>
* <li><a href="Circle.html">`Circle`</a></li>
* <li><a href="Ellipse.html">`Ellipse`</a></li>
* <li><a href="Rect.html">`Rect`</a></li>
* <li><a href="Path.html">`Path`</a></li>
* </ul>
*
* `Shape` can also be extended to create custom shape classes.</p>
*
* `Shape` has the following implementations based on browser capability.
* <ul>
* <li><a href="SVGShape.html">`SVGShape`</a></li>
* <li><a href="VMLShape.html">`VMLShape`</a></li>
* <li><a href="CanvasShape.html">`CanvasShape`</a></li>
* </ul>
*
* It is not necessary to interact with these classes directly. `Shape` will point to the appropriate implemention.</p>
*
* @class Shape
* @constructor
* @param {Object} cfg (optional) Attribute configs
*/
/**
* Init method, invoked during construction.
* Calls `initializer` method.
*
* @method init
* @protected
*/
/**
* Initializes the shape
*
* @private
* @method initializer
*/
/**
* Add a class name to each node.
*
* @method addClass
* @param {String} className the class name to add to the node's class attribute
*/
/**
* Removes a class name from each node.
*
* @method removeClass
* @param {String} className the class name to remove from the node's class attribute
*/
/**
* Gets the current position of the node in page coordinates.
*
* @method getXY
* @return Array The XY position of the shape.
*/
/**
* Set the position of the shape in page coordinates, regardless of how the node is positioned.
*
* @method setXY
* @param {Array} Contains x & y values for new position (coordinates are page-based)
*/
/**
* Determines whether the node is an ancestor of another HTML element in the DOM hierarchy.
*
* @method contains
* @param {Shape | HTMLElement} needle The possible node or descendent
* @return Boolean Whether or not this shape is the needle or its ancestor.
*/
/**
* Compares nodes to determine if they match.
* Node instances can be compared to each other and/or HTMLElements.
* @method compareTo
* @param {HTMLElement | Node} refNode The reference node to compare to the node.
* @return {Boolean} True if the nodes match, false if they do not.
*/
/**
* Test if the supplied node matches the supplied selector.
*
* @method test
* @param {String} selector The CSS selector to test against.
* @return Boolean Wheter or not the shape matches the selector.
*/
/**
* Sets the value of an attribute.
*
* @method set
* @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can
* be passed in to set multiple attributes at once.
* @param {Any} value The value to set the attribute to. This value is ignored if an object is received as
* the name param.
*/
/**
* Specifies a 2d translation.
*
* @method translate
* @param {Number} x The value to transate on the x-axis.
* @param {Number} y The value to translate on the y-axis.
*/
/**
* Translates the shape along the x-axis. When translating x and y coordinates,
* use the `translate` method.
*
* @method translateX
* @param {Number} x The value to translate.
*/
/**
* Translates the shape along the y-axis. When translating x and y coordinates,
* use the `translate` method.
*
* @method translateY
* @param {Number} y The value to translate.
*/
/**
* Skews the shape around the x-axis and y-axis.
*
* @method skew
* @param {Number} x The value to skew on the x-axis.
* @param {Number} y The value to skew on the y-axis.
*/
/**
* Skews the shape around the x-axis.
*
* @method skewX
* @param {Number} x x-coordinate
*/
/**
* Skews the shape around the y-axis.
*
* @method skewY
* @param {Number} y y-coordinate
*/
/**
* Rotates the shape clockwise around it transformOrigin.
*
* @method rotate
* @param {Number} deg The degree of the rotation.
*/
/**
* Specifies a 2d scaling operation.
*
* @method scale
* @param {Number} val
*/
/**
* Returns the bounds for a shape.
*
* Calculates the a new bounding box from the original corner coordinates (base on size and position) and the transform matrix.
* The calculated bounding box is used by the graphic instance to calculate its viewBox.
*
* @method getBounds
* @return Object
*/
/**
* Destroys the instance.
*
* @method destroy
*/
/**
* An array of x, y values which indicates the transformOrigin in which to rotate the shape. Valid values range between 0 and 1 representing a
* fraction of the shape's corresponding bounding box dimension. The default value is [0.5, 0.5].
*
* @config transformOrigin
* @type Array
*/
/**
* <p>A string containing, in order, transform operations applied to the shape instance. The `transform` string can contain the following values:
*
* <dl>
* <dt>rotate</dt><dd>Rotates the shape clockwise around it transformOrigin.</dd>
* <dt>translate</dt><dd>Specifies a 2d translation.</dd>
* <dt>skew</dt><dd>Skews the shape around the x-axis and y-axis.</dd>
* <dt>scale</dt><dd>Specifies a 2d scaling operation.</dd>
* <dt>translateX</dt><dd>Translates the shape along the x-axis.</dd>
* <dt>translateY</dt><dd>Translates the shape along the y-axis.</dd>
* <dt>skewX</dt><dd>Skews the shape around the x-axis.</dd>
* <dt>skewY</dt><dd>Skews the shape around the y-axis.</dd>
* </dl>
* </p>
* <p>Applying transforms through the transform attribute will reset the transform matrix and apply a new transform. The shape class also contains corresponding methods for each transform
* that will apply the transform to the current matrix. The below code illustrates how you might use the `transform` attribute to instantiate a recangle with a rotation of 45 degrees.</p>
var myRect = new Y.Rect({
type:"rect",
width: 50,
height: 40,
transform: "rotate(45)"
};
* <p>The code below would apply `translate` and `rotate` to an existing shape.</p>
myRect.set("transform", "translate(40, 50) rotate(45)");
* @config transform
* @type String
*/
/**
* Unique id for class instance.
*
* @config id
* @type String
*/
/**
* Indicates the x position of shape.
*
* @config x
* @type Number
*/
/**
* Indicates the y position of shape.
*
* @config y
* @type Number
*/
/**
* Indicates the width of the shape
*
* @config width
* @type Number
*/
/**
* Indicates the height of the shape
*
* @config height
* @type Number
*/
/**
* Indicates whether the shape is visible.
*
* @config visible
* @type Boolean
*/
/**
* Contains information about the fill of the shape.
* <dl>
* <dt>color</dt><dd>The color of the fill.</dd>
* <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1.</dd>
* <dt>type</dt><dd>Type of fill.
* <dl>
* <dt>solid</dt><dd>Solid single color fill. (default)</dd>
* <dt>linear</dt><dd>Linear gradient fill.</dd>
* <dt>radial</dt><dd>Radial gradient fill.</dd>
* </dl>
* </dd>
* </dl>
* <p>If a `linear` or `radial` is specified as the fill type. The following additional property is used:
* <dl>
* <dt>stops</dt><dd>An array of objects containing the following properties:
* <dl>
* <dt>color</dt><dd>The color of the stop.</dd>
* <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stop. The default value is 1. Note: No effect for IE 6 - 8</dd>
* <dt>offset</dt><dd>Number between 0 and 1 indicating where the color stop is positioned.</dd>
* </dl>
* </dd>
* <p>Linear gradients also have the following property:</p>
* <dt>rotation</dt><dd>Linear gradients flow left to right by default. The rotation property allows you to change the flow by rotation. (e.g. A rotation of 180 would make the gradient pain from right to left.)</dd>
* <p>Radial gradients have the following additional properties:</p>
* <dt>r</dt><dd>Radius of the gradient circle.</dd>
* <dt>fx</dt><dd>Focal point x-coordinate of the gradient.</dd>
* <dt>fy</dt><dd>Focal point y-coordinate of the gradient.</dd>
* <dt>cx</dt><dd>
* <p>The x-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>
* <p><strong>Note: </strong>Currently, this property is not implemented for corresponding `CanvasShape` and `VMLShape` classes which are used on Android or IE 6 - 8.</p>
* </dd>
* <dt>cy</dt><dd>
* <p>The y-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>
* <p><strong>Note: </strong>Currently, this property is not implemented for corresponding `CanvasShape` and `VMLShape` classes which are used on Android or IE 6 - 8.</p>
* </dd>
* </dl>
*
* @config fill
* @type Object
*/
/**
* Contains information about the stroke of the shape.
* <dl>
* <dt>color</dt><dd>The color of the stroke.</dd>
* <dt>weight</dt><dd>Number that indicates the width of the stroke.</dd>
* <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stroke. The default value is 1.</dd>
* <dt>dashstyle</dt>Indicates whether to draw a dashed stroke. When set to "none", a solid stroke is drawn. When set to an array, the first index indicates the
* length of the dash. The second index indicates the length of gap.
* <dt>linecap</dt><dd>Specifies the linecap for the stroke. The following values can be specified:
* <dl>
* <dt>butt (default)</dt><dd>Specifies a butt linecap.</dd>
* <dt>square</dt><dd>Specifies a sqare linecap.</dd>
* <dt>round</dt><dd>Specifies a round linecap.</dd>
* </dl>
* </dd>
* <dt>linejoin</dt><dd>Specifies a linejoin for the stroke. The following values can be specified:
* <dl>
* <dt>round (default)</dt><dd>Specifies that the linejoin will be round.</dd>
* <dt>bevel</dt><dd>Specifies a bevel for the linejoin.</dd>
* <dt>miter limit</dt><dd>An integer specifying the miter limit of a miter linejoin. If you want to specify a linejoin of miter, you simply specify the limit as opposed to having
* separate miter and miter limit values.</dd>
* </dl>
* </dd>
* </dl>
*
* @config stroke
* @type Object
*/
/**
* Dom node for the shape.
*
* @config node
* @type HTMLElement
* @readOnly
*/
/**
* Represents an SVG Path string. This will be parsed and added to shape's API to represent the SVG data across all implementations. Note that when using VML or SVG
* implementations, part of this content will be added to the DOM using respective VML/SVG attributes. If your content comes from an untrusted source, you will need
* to ensure that no malicious code is included in that content.
*
* @config data
* @type String
*/
/**
* Reference to the parent graphic instance
*
* @config graphic
* @type Graphic
* @readOnly
*/
/**
* <p>Creates circle shape with editable attributes.</p>
* <p>`Circle` instances can be created using the <a href="Graphic.html#method_addShape">`addShape`</a> method of the <a href="Graphic.html">`Graphic`</a> class.
* The method's `cfg` argument contains a `type` attribute. Assigning "circle" or `Y.Circle` to this attribute will create a `Circle` instance. Required attributes
* for instantiating a `Circle` are `type` and `radius`. Optional attributes include:
* <ul>
* <li><a href="#attr_fill">fill</a></li>
* <li><a href="#attr_id">id</a></li>
* <li><a href="#attr_stroke">stroke</a></li>
* <li><a href="#attr_transform">transform</a></li>
* <li><a href="#attr_transformOrigin">transformOrigin</a></li>
* <li><a href="#attr_visible">visible</a></li>
* <li><a href="#attr_x">x</a></li>
* <li><a href="#attr_y">y</a></li>
* </ul>
*
* The below code creates a circle by defining the `type` attribute as "circle":</p>
var myCircle = myGraphic.addShape({
type: "circle",
radius: 10,
fill: {
color: "#9aa"
},
stroke: {
weight: 1,
color: "#000"
}
});
* Below, this same circle is created by defining the `type` attribute with a class reference:
*
var myCircle = myGraphic.addShape({
type: Y.Circle,
radius: 10,
fill: {
color: "#9aa"
},
stroke: {
weight: 1,
color: "#000"
}
});
*
* <p>`Circle` has the following implementations based on browser capability.
* <ul>
* <li><a href="SVGCircle.html">`SVGCircle`</a></li>
* <li><a href="VMLCircle.html">`VMLCircle`</a></li>
* <li><a href="CanvasCircle.html">`CanvasCircle`</a></li>
* </ul>
*
* It is not necessary to interact with these classes directly. `Circle` will point to the appropriate implemention.</p>
*
* @class Circle
* @extends Shape
* @constructor
*/
/**
* Radius of the circle
*
* @config radius
* @type Number
*/
/**
* <p>Creates an ellipse shape with editable attributes.</p>
* <p>`Ellipse` instances can be created using the <a href="Graphic.html#method_addShape">`addShape`</a> method of the <a href="Graphic.html">`Graphic`</a> class.
* The method's `cfg` argument contains a `type` attribute. Assigning "ellipse" or `Y.Ellipse` to this attribute will create a `Ellipse` instance. Required attributes
* for instantiating a `Ellipse` are `type`, `width` and `height`. Optional attributes include:
* <ul>
* <li><a href="#attr_fill">fill</a></li>
* <li><a href="#attr_id">id</a></li>
* <li><a href="#attr_stroke">stroke</a></li>
* <li><a href="#attr_transform">transform</a></li>
* <li><a href="#attr_transformOrigin">transformOrigin</a></li>
* <li><a href="#attr_visible">visible</a></li>
* <li><a href="#attr_x">x</a></li>
* <li><a href="#attr_y">y</a></li>
* </ul>
*
* The below code creates an ellipse by defining the `type` attribute as "ellipse":</p>
var myEllipse = myGraphic.addShape({
type: "ellipse",
width: 20,
height: 10,
fill: {
color: "#9aa"
},
stroke: {
weight: 1,
color: "#000"
}
});
* Below, the same ellipse is created by defining the `type` attribute with a class reference:
*
var myEllipse = myGraphic.addShape({
type: Y.Ellipse,
width: 20,
height: 10,
fill: {
color: "#9aa"
},
stroke: {
weight: 1,
color: "#000"
}
});
*
* <p>`Ellipse` has the following implementations based on browser capability.
* <ul>
* <li><a href="SVGEllipse.html">`SVGEllipse`</a></li>
* <li><a href="VMLEllipse.html">`VMLEllipse`</a></li>
* <li><a href="CanvasEllipse.html">`CanvasEllipse`</a></li>
* </ul>
*
* It is not necessary to interact with these classes directly. `Ellipse` will point to the appropriate implemention.</p>
*
* @class Ellipse
* @extends Shape
* @constructor
*/
/**
* <p>Creates an rectangle shape with editable attributes.</p>
* <p>`Rect` instances can be created using the <a href="Graphic.html#method_addShape">`addShape`</a> method of the <a href="Graphic.html">`Graphic`</a>
* class. The method's `cfg` argument contains a `type` attribute. Assigning "rect" or `Y.Rect` to this attribute will create a `Rect` instance.
* Required attributes for instantiating a `Rect` are `type`, `width` and `height`. Optional attributes include:
* <ul>
* <li><a href="#attr_fill">fill</a></li>
* <li><a href="#attr_id">id</a></li>
* <li><a href="#attr_stroke">stroke</a></li>
* <li><a href="#attr_transform">transform</a></li>
* <li><a href="#attr_transformOrigin">transformOrigin</a></li>
* <li><a href="#attr_visible">visible</a></li>
* <li><a href="#attr_x">x</a></li>
* <li><a href="#attr_y">y</a></li>
* </ul>
*
* The below code creates a rectangle by defining the `type` attribute as "rect":</p>
var myRect = myGraphic.addShape({
type: "rect",
width: 20,
height: 10,
fill: {
color: "#9aa"
},
stroke: {
weight: 1,
color: "#000"
}
});
* Below, the same rectangle is created by defining the `type` attribute with a class reference:
*
var myRect = myGraphic.addShape({
type: Y.Rect,
width: 20,
height: 10,
fill: {
color: "#9aa"
},
stroke: {
weight: 1,
color: "#000"
}
});
*
* <p>`Rect` has the following implementations based on browser capability.
* <ul>
* <li><a href="SVGRect.html">`SVGRect`</a></li>
* <li><a href="VMLRect.html">`VMLRect`</a></li>
* <li><a href="CanvasRect.html">`CanvasRect`</a></li>
* </ul>
*
* It is not necessary to interact with these classes directly. `Rect` will point to the appropriate implemention.</p>
*
* @class Rect
* @extends Shape
* @constructor
*/
/**
* <p>The `Path` class creates a shape through the use of drawing methods. The `Path` class has the following drawing methods available:</p>
* <ul>
* <li><a href="#method_clear">`clear`</a></li>
* <li><a href="#method_curveTo">`curveTo`</a></li>
* <li><a href="#method_drawRect">`drawRect`</a></li>
* <li><a href="#method_drawRoundRect">`drawRoundRect`</a></li>
* <li><a href="#method_end">`end`</a></li>
* <li><a href="#method_lineTo">`lineTo`</a></li>
* <li><a href="#method_moveTo">`moveTo`</a></li>
* <li><a href="#method_quadraticCurveTo">`quadraticCurveTo`</a></li>
* </ul>
*
* <p>Like other shapes, `Path` elements are created using the <a href="Graphic.html#method_addShape">`addShape`</a> method of the <a href="Graphic.html">`Graphic`</a>
* class. The method's `cfg` argument contains a `type` attribute. Assigning "path" or `Y.Path` to this attribute will create a `Path` instance.
* After instantiation, a series of drawing operations must be performed in order to render a shape. The below code instantiates a path element by defining the `type`
* attribute as "path":</p>
var myPath = myGraphic.addShape({
type: "path",
fill: {
color: "#9aa"
},
stroke: {
weight: 1,
color: "#000"
}
});
* Below a `Path` element with the same properties is instantiated by defining the `type` attribute with a class reference:
*
var myPath = myGraphic.addShape({
type: Y.Path,
fill: {
color: "#9aa"
},
stroke: {
weight: 1,
color: "#000"
}
});
* After instantiation, a shape or segment needs to be drawn for an element to render. After all draw operations are performed, the <a href="#method_end">`end`</a>
* method will render the shape. The code below will draw a triangle:
myPath.moveTo(35, 5);
myPath.lineTo(65, 65);
myPath.lineTo(5, 65);
myPath.lineTo(35, 5);
myPath.end();
*
* <p>`Path` has the following implementations based on browser capability.
* <ul>
* <li><a href="SVGPath.html">`SVGPath`</a></li>
* <li><a href="VMLPath.html">`VMLPath`</a></li>
* <li><a href="CanvasPath.html">`CanvasPath`</a></li>
* </ul>
* It is not necessary to interact with these classes directly. `Path` will point to the appropriate implemention.</p>
*
* @class Path
* @extends Shape
* @uses Drawing
* @constructor
*/
/**
* Indicates the path used for the node.
*
* @config path
* @type String
* @readOnly
*/
/**
* `Graphic` acts a factory and container for shapes. You need at least one `Graphic` instance to create shapes for your application.
* <p>The code block below creates a `Graphic` instance and appends it to an HTMLElement with the id 'mygraphiccontainer'.</p>
var myGraphic = new Y.Graphic({render:"#mygraphiccontainer"});
* <p>Alternatively, you can add a `Graphic` instance to the DOM using the <a href="#method_render">`render`</a> method.</p>
var myGraphic = new Y.Graphic();
myGraphic.render("#mygraphiccontainer");
* `Graphic` has the following implementations based on browser capability.
* <ul>
* <li><a href="SVGGraphic.html">`SVGGraphic`</a></li>
* <li><a href="VMLGraphic.html">`VMLGraphic`</a></li>
* <li><a href="CanvasGraphic.html">`CanvasGraphic`</a></li>
* </ul>
*
* It is not necessary to interact with these classes directly. `Graphic` will point to the appropriate implemention.</p>
*
* @class Graphic
* @constructor
*/
/**
* Whether or not to render the `Graphic` automatically after to a specified parent node after init. This can be a Node instance or a CSS selector string.
*
* @config render
* @type Node | String
*/
/**
* Unique id for class instance.
*
* @config id
* @type String
*/
/**
* Key value pairs in which a shape instance is associated with its id.
*
* @config shapes
* @type Object
* @readOnly
*/
/**
* Object containing size and coordinate data for the content of a Graphic in relation to the coordSpace node.
*
* @config contentBounds
* @type Object
* @readOnly
*/
/**
* The html element that represents to coordinate system of the Graphic instance.
*
* @config node
* @type HTMLElement
* @readOnly
*/
/**
* Indicates the width of the `Graphic`.
*
* @config width
* @type Number
*/
/**
* Indicates the height of the `Graphic`.
*
* @config height
* @type Number
*/
/**
* Determines the sizing of the Graphic.
*
* <dl>
* <dt>sizeContentToGraphic</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>
* attributes or are determined by the dimensions of the parent element. The content contained in the Graphic will be sized to fit with in the Graphic instance's
* dimensions. When using this setting, the <code>preserveAspectRatio</code> attribute will determine how the contents are sized.</dd>
* <dt>sizeGraphicToContent</dt><dd>(Also accepts a value of true) The Graphic's width and height are determined by the size and positioning of the content.</dd>
* <dt>false</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>
* attributes or are determined by the dimensions of the parent element. The contents of the Graphic instance are not affected by this setting.</dd>
* </dl>
*
*
* @config autoSize
* @type Boolean | String
* @default false
*/
/**
* Determines how content is sized when <code>autoSize</code> is set to <code>sizeContentToGraphic</code>.
*
* <dl>
* <dt>none<dt><dd>Do not force uniform scaling. Scale the graphic content of the given element non-uniformly if necessary
* such that the element's bounding box exactly matches the viewport rectangle.</dd>
* <dt>xMinYMin</dt><dd>Force uniform scaling position along the top left of the Graphic's node.</dd>
* <dt>xMidYMin</dt><dd>Force uniform scaling horizontally centered and positioned at the top of the Graphic's node.<dd>
* <dt>xMaxYMin</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the top.</dd>
* <dt>xMinYMid</dt>Force uniform scaling positioned horizontally from the left and vertically centered.</dd>
* <dt>xMidYMid (the default)</dt><dd>Force uniform scaling with the content centered.</dd>
* <dt>xMaxYMid</dt><dd>Force uniform scaling positioned horizontally from the right and vertically centered.</dd>
* <dt>xMinYMax</dt><dd>Force uniform scaling positioned horizontally from the left and vertically from the bottom.</dd>
* <dt>xMidYMax</dt><dd>Force uniform scaling horizontally centered and position vertically from the bottom.</dd>
* <dt>xMaxYMax</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the bottom.</dd>
* </dl>
*
* @config preserveAspectRatio
* @type String
* @default xMidYMid
*/
/**
* The contentBounds will resize to greater values but not to smaller values. (for performance)
* When resizing the contentBounds down is desirable, set the resizeDown value to true.
*
* @config resizeDown
* @type Boolean
*/
/**
* Indicates the x-coordinate for the instance.
*
* @config x
* @type Number
*/
/**
* Indicates the y-coordinate for the instance.
*
* @config y
* @type Number
*/
/**
* Indicates whether or not the instance will automatically redraw after a change is made to a shape.
* This property will get set to false when batching operations.
*
* @config autoDraw
* @type Boolean
* @default true
* @private
*/
/**
* Indicates whether the `Graphic` and its children are visible.
*
* @config visible
* @type Boolean
*/
/**
* Gets the current position of the graphic instance in page coordinates.
*
* @method getXY
* @return Array The XY position of the shape.
*/
/**
* Adds the graphics node to the dom.
*
* @method render
* @param {Node|String} parentNode node in which to render the graphics node into.
*/
/**
* Removes all nodes.
*
* @method destroy
*/
/**
* <p>Generates a shape instance by type. The method accepts an object that contain's the shape's
* type and attributes to be customized. For example, the code below would create a rectangle:</p>
*
var myRect = myGraphic.addShape({
type: "rect",
width: 40,
height: 30,
fill: {
color: "#9aa"
},
stroke: {
weight: 1,
color: "#000"
}
});
*
* <p>The `Graphics` module includes a few basic shapes. More information on their creation
* can be found in each shape's documentation:
*
* <ul>
* <li><a href="Circle.html">`Circle`</a></li>
* <li><a href="Ellipse.html">`Ellipse`</a></li>
* <li><a href="Rect.html">`Rect`</a></li>
* <li><a href="Path.html">`Path`</a></li>
* </ul>
*
* The `Graphics` module also allows for the creation of custom shapes. If a custom shape
* has been created, it can be instantiated with the `addShape` method as well. The attributes,
* required and optional, would need to be defined in the custom shape.
*
var myCustomShape = myGraphic.addShape({
type: Y.MyCustomShape,
width: 50,
height: 50,
fill: {
color: "#9aa"
},
stroke: {
weight: 1,
color: "#000"
}
});
*
* @method addShape
* @param {Object} cfg Object containing the shape's type and attributes.
* @return Shape
*/
/**
* Removes a shape instance from from the graphic instance.
*
* @method removeShape
* @param {Shape|String} shape The instance or id of the shape to be removed.
*/
/**
* Removes all shape instances from the dom.
*
* @method removeAllShapes
*/
/**
* Returns a shape based on the id of its dom node.
*
* @method getShapeById
* @param {String} id Dom id of the shape's node attribute.
* @return Shape
*/
/**
* Allows for creating multiple shapes in order to batch appending and redraw operations.
*
* @method batch
* @param {Function} method Method to execute.
*/
}, '@VERSION@', {"requires": ["node", "event-custom", "pluginhost", "matrix", "classnamemanager"]});
| arkaindas/cdnjs | ajax/libs/yui/3.7.2/graphics/graphics-coverage.js | JavaScript | mit | 92,243 |
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/datatable-head/datatable-head.js"] = {
lines: {},
functions: {},
coveredLines: 0,
calledLines: 0,
coveredFunctions: 0,
calledFunctions: 0,
path: "build/datatable-head/datatable-head.js",
code: []
};
_yuitest_coverage["build/datatable-head/datatable-head.js"].code=["YUI.add('datatable-head', function (Y, NAME) {","","/**","View class responsible for rendering the `<thead>` section of a table. Used as","the default `headerView` for `Y.DataTable.Base` and `Y.DataTable` classes.","","@module datatable","@submodule datatable-head","@since 3.5.0","**/","var Lang = Y.Lang,"," fromTemplate = Lang.sub,"," isArray = Lang.isArray,"," toArray = Y.Array;","","/**","View class responsible for rendering the `<thead>` section of a table. Used as","the default `headerView` for `Y.DataTable.Base` and `Y.DataTable` classes.","","Translates the provided array of column configuration objects into a rendered","`<thead>` based on the data in those objects."," ","","The structure of the column data is expected to be a single array of objects,","where each object corresponds to a `<th>`. Those objects may contain a","`children` property containing a similarly structured array to indicate the","nested cells should be grouped under the parent column's colspan in a separate","row of header cells. E.g.","","<pre><code>","new Y.DataTable.HeaderView({"," container: tableNode,"," columns: ["," { key: 'id' }, // no nesting"," { key: 'name', children: ["," { key: 'firstName', label: 'First' },"," { key: 'lastName', label: 'Last' } ] }"," ]","}).render();","</code></pre>","","This would translate to the following visualization:","","<pre>","---------------------","| | name |","| |---------------","| id | First | Last |","---------------------","</pre>","","Supported properties of the column objects include:",""," * `label` - The HTML content of the header cell."," * `key` - If `label` is not specified, the `key` is used for content."," * `children` - Array of columns to appear below this column in the next"," row."," * `headerTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells in this"," column only."," * `abbr` - The content of the 'abbr' attribute of the `<th>`"," * `className` - Adds this string of CSS classes to the column header","","Through the life of instantiation and rendering, the column objects will have","the following properties added to them:",""," * `id` - (Defaulted by DataTable) The id to assign the rendered column"," * `_colspan` - To supply the `<th>` attribute"," * `_rowspan` - To supply the `<th>` attribute"," * `_parent` - (Added by DataTable) If the column is a child of another"," column, this points to its parent column","","The column object is also used to provide values for {placeholder} tokens in the","instance's `CELL_TEMPLATE`, so you can modify the template and include other","column object properties to populate them.","","@class HeaderView","@namespace DataTable","@extends View","@since 3.5.0","**/","Y.namespace('DataTable').HeaderView = Y.Base.create('tableHeader', Y.View, [], {"," // -- Instance properties -------------------------------------------------",""," /**"," Template used to create the table's header cell markup. Override this to"," customize how header cell markup is created.",""," @property CELL_TEMPLATE"," @type {HTML}"," @default '<th id=\"{id}\" colspan=\"{_colspan}\" rowspan=\"{_rowspan}\" class=\"{className}\" scope=\"col\" {_id}{abbr}>{content}</th>'"," @since 3.5.0"," **/"," CELL_TEMPLATE:"," '<th id=\"{id}\" colspan=\"{_colspan}\" rowspan=\"{_rowspan}\" class=\"{className}\" scope=\"col\" {_id}{abbr}>{content}</th>',",""," /**"," The data representation of the header rows to render. This is assigned by"," parsing the `columns` configuration array, and is used by the render()"," method.",""," @property columns"," @type {Array[]}"," @default (initially unset)"," @since 3.5.0"," **/"," //TODO: should this be protected?"," //columns: null,",""," /**"," Template used to create the table's header row markup. Override this to"," customize the row markup.",""," @property ROW_TEMPLATE"," @type {HTML}"," @default '<tr>{content}</tr>'"," @since 3.5.0"," **/"," ROW_TEMPLATE:"," '<tr>{content}</tr>',",""," /**"," The object that serves as the source of truth for column and row data."," This property is assigned at instantiation from the `source` property of"," the configuration object passed to the constructor.",""," @property source"," @type {Object}"," @default (initially unset)"," @since 3.5.0"," **/"," //TODO: should this be protected?"," //source: null,",""," /**"," HTML templates used to create the `<thead>` containing the table headers.",""," @property THEAD_TEMPLATE"," @type {HTML}"," @default '<thead class=\"{className}\">{content}</thead>'"," @since 3.6.0"," **/"," THEAD_TEMPLATE: '<thead class=\"{className}\"></thead>',",""," // -- Public methods ------------------------------------------------------",""," /**"," Returns the generated CSS classname based on the input. If the `host`"," attribute is configured, it will attempt to relay to its `getClassName`"," or use its static `NAME` property as a string base."," "," If `host` is absent or has neither method nor `NAME`, a CSS classname"," will be generated using this class's `NAME`.",""," @method getClassName"," @param {String} token* Any number of token strings to assemble the"," classname from."," @return {String}"," @protected"," **/"," getClassName: function () {"," // TODO: add attribute with setter? to host to use property this.host"," // for performance"," var host = this.host,"," NAME = (host && host.constructor.NAME) ||"," this.constructor.NAME;",""," if (host && host.getClassName) {"," return host.getClassName.apply(host, arguments);"," } else {"," return Y.ClassNameManager.getClassName"," .apply(Y.ClassNameManager,"," [NAME].concat(toArray(arguments, 0, true)));"," }"," },",""," /**"," Creates the `<thead>` Node content by assembling markup generated by"," populating the `ROW_TEMPLATE` and `CELL_TEMPLATE` templates with content"," from the `columns` property."," "," @method render"," @return {HeaderView} The instance"," @chainable"," @since 3.5.0"," **/"," render: function () {"," var table = this.get('container'),"," thead = this.theadNode ||"," (this.theadNode = this._createTHeadNode()),"," columns = this.columns,"," defaults = {"," _colspan: 1,"," _rowspan: 1,"," abbr: ''"," },"," i, len, j, jlen, col, html, content, values;",""," if (thead && columns) {"," html = '';",""," if (columns.length) {"," for (i = 0, len = columns.length; i < len; ++i) {"," content = '';",""," for (j = 0, jlen = columns[i].length; j < jlen; ++j) {"," col = columns[i][j];"," values = Y.merge("," defaults,"," col, {"," className: this.getClassName('header'),"," content : col.label || col.key ||"," (\"Column \" + (j + 1))"," }"," );",""," values._id = col._id ?"," ' data-yui3-col-id=\"' + col._id + '\"' : '';"," "," if (col.abbr) {"," values.abbr = ' abbr=\"' + col.abbr + '\"';"," }",""," if (col.className) {"," values.className += ' ' + col.className;"," }",""," if (col._first) {"," values.className += ' ' + this.getClassName('first', 'header');"," }",""," if (col._id) {"," values.className +="," ' ' + this.getClassName('col', col._id);"," }",""," content += fromTemplate("," col.headerTemplate || this.CELL_TEMPLATE, values);"," }",""," html += fromTemplate(this.ROW_TEMPLATE, {"," content: content"," });"," }"," }",""," thead.setHTML(html);",""," if (thead.get('parentNode') !== table) {"," table.insertBefore(thead, table.one('tfoot, tbody'));"," }"," }",""," this.bindUI();",""," return this;"," },",""," // -- Protected and private properties and methods ------------------------",""," /**"," Handles changes in the source's columns attribute. Redraws the headers.",""," @method _afterColumnsChange"," @param {EventFacade} e The `columnsChange` event object"," @protected"," @since 3.5.0"," **/"," _afterColumnsChange: function (e) {"," this.columns = this._parseColumns(e.newVal);",""," this.render();"," },",""," /**"," Binds event subscriptions from the UI and the source (if assigned).",""," @method bindUI"," @protected"," @since 3.5.0"," **/"," bindUI: function () {"," if (!this._eventHandles.columnsChange) {"," // TODO: How best to decouple this?"," this._eventHandles.columnsChange ="," this.after('columnsChange',"," Y.bind('_afterColumnsChange', this));"," }"," },",""," /**"," Creates the `<thead>` node that will store the header rows and cells.",""," @method _createTHeadNode"," @return {Node}"," @protected"," @since 3.6.0"," **/"," _createTHeadNode: function () {"," return Y.Node.create(fromTemplate(this.THEAD_TEMPLATE, {"," className: this.getClassName('columns')"," }));"," },"," "," /**"," Destroys the instance.",""," @method destructor"," @protected"," @since 3.5.0"," **/"," destructor: function () {"," (new Y.EventHandle(Y.Object.values(this._eventHandles))).detach();"," },",""," /**"," Holds the event subscriptions needing to be detached when the instance is"," `destroy()`ed.",""," @property _eventHandles"," @type {Object}"," @default undefined (initially unset)"," @protected"," @since 3.5.0"," **/"," //_eventHandles: null,",""," /**"," Initializes the instance. Reads the following configuration properties:",""," * `columns` - (REQUIRED) The initial column information"," * `host` - The object to serve as source of truth for column info",""," @method initializer"," @param {Object} config Configuration data"," @protected"," @since 3.5.0"," **/"," initializer: function (config) {"," this.host = config.host;"," this.columns = this._parseColumns(config.columns);",""," this._eventHandles = [];"," },",""," /**"," Translate the input column format into a structure useful for rendering a"," `<thead>`, rows, and cells. The structure of the input is expected to be a"," single array of objects, where each object corresponds to a `<th>`. Those"," objects may contain a `children` property containing a similarly structured"," array to indicate the nested cells should be grouped under the parent"," column's colspan in a separate row of header cells. E.g.",""," <pre><code>"," ["," { key: 'id' }, // no nesting"," { key: 'name', children: ["," { key: 'firstName', label: 'First' },"," { key: 'lastName', label: 'Last' } ] }"," ]"," </code></pre>",""," would indicate two header rows with the first column 'id' being assigned a"," `rowspan` of `2`, the 'name' column appearing in the first row with a"," `colspan` of `2`, and the 'firstName' and 'lastName' columns appearing in"," the second row, below the 'name' column.",""," <pre>"," ---------------------"," | | name |"," | |---------------"," | id | First | Last |"," ---------------------"," </pre>",""," Supported properties of the column objects include:",""," * `label` - The HTML content of the header cell."," * `key` - If `label` is not specified, the `key` is used for content."," * `children` - Array of columns to appear below this column in the next"," row."," * `abbr` - The content of the 'abbr' attribute of the `<th>`"," * `headerTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells"," in this column only.",""," The output structure is basically a simulation of the `<thead>` structure"," with arrays for rows and objects for cells. Column objects have the"," following properties added to them:"," "," * `id` - (Defaulted by DataTable) The id to assign the rendered"," column"," * `_colspan` - Per the `<th>` attribute"," * `_rowspan` - Per the `<th>` attribute"," * `_parent` - (Added by DataTable) If the column is a child of another"," column, this points to its parent column",""," The column object is also used to provide values for {placeholder}"," replacement in the `CELL_TEMPLATE`, so you can modify the template and"," include other column object properties to populate them.",""," @method _parseColumns"," @param {Object[]} data Array of column object data"," @return {Array[]} An array of arrays corresponding to the header row"," structure to render"," @protected"," @since 3.5.0"," **/"," _parseColumns: function (data) {"," var columns = [],"," stack = [],"," rowSpan = 1,"," entry, row, col, children, parent, i, len, j;"," "," if (isArray(data) && data.length) {"," // don't modify the input array"," data = data.slice();",""," // First pass, assign colspans and calculate row count for"," // non-nested headers' rowspan"," stack.push([data, -1]);",""," while (stack.length) {"," entry = stack[stack.length - 1];"," row = entry[0];"," i = entry[1] + 1;",""," for (len = row.length; i < len; ++i) {"," row[i] = col = Y.merge(row[i]);"," children = col.children;",""," Y.stamp(col);",""," if (!col.id) {"," col.id = Y.guid();"," }",""," if (isArray(children) && children.length) {"," stack.push([children, -1]);"," entry[1] = i;",""," rowSpan = Math.max(rowSpan, stack.length);",""," // break to let the while loop process the children"," break;"," } else {"," col._colspan = 1;"," }"," }",""," if (i >= len) {"," // All columns in this row are processed"," if (stack.length > 1) {"," entry = stack[stack.length - 2];"," parent = entry[0][entry[1]];",""," parent._colspan = 0;",""," for (i = 0, len = row.length; i < len; ++i) {"," // Can't use .length because in 3+ rows, colspan"," // needs to aggregate the colspans of children"," row[i]._parent = parent;"," parent._colspan += row[i]._colspan;"," }"," }"," stack.pop();"," }"," }",""," // Second pass, build row arrays and assign rowspan"," for (i = 0; i < rowSpan; ++i) {"," columns.push([]);"," }",""," stack.push([data, -1]);",""," while (stack.length) {"," entry = stack[stack.length - 1];"," row = entry[0];"," i = entry[1] + 1;",""," for (len = row.length; i < len; ++i) {"," col = row[i];"," children = col.children;",""," columns[stack.length - 1].push(col);",""," entry[1] = i;",""," // collect the IDs of parent cols"," col._headers = [col.id];",""," for (j = stack.length - 2; j >= 0; --j) {"," parent = stack[j][0][stack[j][1]];",""," col._headers.unshift(parent.id);"," }",""," if (children && children.length) {"," // parent cells must assume rowspan 1 (long story)",""," // break to let the while loop process the children"," stack.push([children, -1]);"," break;"," } else {"," col._rowspan = rowSpan - stack.length + 1;"," }"," }",""," if (i >= len) {"," // All columns in this row are processed"," stack.pop();"," }"," }"," }",""," for (i = 0, len = columns.length; i < len; i += col._rowspan) {"," col = columns[i][0];",""," col._first = true;"," }",""," return columns;"," }","});","","","}, '@VERSION@', {\"requires\": [\"datatable-core\", \"view\", \"classnamemanager\"]});"];
_yuitest_coverage["build/datatable-head/datatable-head.js"].lines = {"1":0,"11":0,"81":0,"163":0,"167":0,"168":0,"170":0,"187":0,"198":0,"199":0,"201":0,"202":0,"203":0,"205":0,"206":0,"207":0,"216":0,"219":0,"220":0,"223":0,"224":0,"227":0,"228":0,"231":0,"232":0,"236":0,"240":0,"246":0,"248":0,"249":0,"253":0,"255":0,"269":0,"271":0,"282":0,"284":0,"299":0,"312":0,"339":0,"340":0,"342":0,"408":0,"413":0,"415":0,"419":0,"421":0,"422":0,"423":0,"424":0,"426":0,"427":0,"428":0,"430":0,"432":0,"433":0,"436":0,"437":0,"438":0,"440":0,"443":0,"445":0,"449":0,"451":0,"452":0,"453":0,"455":0,"457":0,"460":0,"461":0,"464":0,"469":0,"470":0,"473":0,"475":0,"476":0,"477":0,"478":0,"480":0,"481":0,"482":0,"484":0,"486":0,"489":0,"491":0,"492":0,"494":0,"497":0,"501":0,"502":0,"504":0,"508":0,"510":0,"515":0,"516":0,"518":0,"521":0};
_yuitest_coverage["build/datatable-head/datatable-head.js"].functions = {"getClassName:160":0,"render:186":0,"_afterColumnsChange:268":0,"bindUI:281":0,"_createTHeadNode:298":0,"destructor:311":0,"initializer:338":0,"_parseColumns:407":0,"(anonymous 1):1":0};
_yuitest_coverage["build/datatable-head/datatable-head.js"].coveredLines = 96;
_yuitest_coverage["build/datatable-head/datatable-head.js"].coveredFunctions = 9;
_yuitest_coverline("build/datatable-head/datatable-head.js", 1);
YUI.add('datatable-head', function (Y, NAME) {
/**
View class responsible for rendering the `<thead>` section of a table. Used as
the default `headerView` for `Y.DataTable.Base` and `Y.DataTable` classes.
@module datatable
@submodule datatable-head
@since 3.5.0
**/
_yuitest_coverfunc("build/datatable-head/datatable-head.js", "(anonymous 1)", 1);
_yuitest_coverline("build/datatable-head/datatable-head.js", 11);
var Lang = Y.Lang,
fromTemplate = Lang.sub,
isArray = Lang.isArray,
toArray = Y.Array;
/**
View class responsible for rendering the `<thead>` section of a table. Used as
the default `headerView` for `Y.DataTable.Base` and `Y.DataTable` classes.
Translates the provided array of column configuration objects into a rendered
`<thead>` based on the data in those objects.
The structure of the column data is expected to be a single array of objects,
where each object corresponds to a `<th>`. Those objects may contain a
`children` property containing a similarly structured array to indicate the
nested cells should be grouped under the parent column's colspan in a separate
row of header cells. E.g.
<pre><code>
new Y.DataTable.HeaderView({
container: tableNode,
columns: [
{ key: 'id' }, // no nesting
{ key: 'name', children: [
{ key: 'firstName', label: 'First' },
{ key: 'lastName', label: 'Last' } ] }
]
}).render();
</code></pre>
This would translate to the following visualization:
<pre>
---------------------
| | name |
| |---------------
| id | First | Last |
---------------------
</pre>
Supported properties of the column objects include:
* `label` - The HTML content of the header cell.
* `key` - If `label` is not specified, the `key` is used for content.
* `children` - Array of columns to appear below this column in the next
row.
* `headerTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells in this
column only.
* `abbr` - The content of the 'abbr' attribute of the `<th>`
* `className` - Adds this string of CSS classes to the column header
Through the life of instantiation and rendering, the column objects will have
the following properties added to them:
* `id` - (Defaulted by DataTable) The id to assign the rendered column
* `_colspan` - To supply the `<th>` attribute
* `_rowspan` - To supply the `<th>` attribute
* `_parent` - (Added by DataTable) If the column is a child of another
column, this points to its parent column
The column object is also used to provide values for {placeholder} tokens in the
instance's `CELL_TEMPLATE`, so you can modify the template and include other
column object properties to populate them.
@class HeaderView
@namespace DataTable
@extends View
@since 3.5.0
**/
_yuitest_coverline("build/datatable-head/datatable-head.js", 81);
Y.namespace('DataTable').HeaderView = Y.Base.create('tableHeader', Y.View, [], {
// -- Instance properties -------------------------------------------------
/**
Template used to create the table's header cell markup. Override this to
customize how header cell markup is created.
@property CELL_TEMPLATE
@type {HTML}
@default '<th id="{id}" colspan="{_colspan}" rowspan="{_rowspan}" class="{className}" scope="col" {_id}{abbr}>{content}</th>'
@since 3.5.0
**/
CELL_TEMPLATE:
'<th id="{id}" colspan="{_colspan}" rowspan="{_rowspan}" class="{className}" scope="col" {_id}{abbr}>{content}</th>',
/**
The data representation of the header rows to render. This is assigned by
parsing the `columns` configuration array, and is used by the render()
method.
@property columns
@type {Array[]}
@default (initially unset)
@since 3.5.0
**/
//TODO: should this be protected?
//columns: null,
/**
Template used to create the table's header row markup. Override this to
customize the row markup.
@property ROW_TEMPLATE
@type {HTML}
@default '<tr>{content}</tr>'
@since 3.5.0
**/
ROW_TEMPLATE:
'<tr>{content}</tr>',
/**
The object that serves as the source of truth for column and row data.
This property is assigned at instantiation from the `source` property of
the configuration object passed to the constructor.
@property source
@type {Object}
@default (initially unset)
@since 3.5.0
**/
//TODO: should this be protected?
//source: null,
/**
HTML templates used to create the `<thead>` containing the table headers.
@property THEAD_TEMPLATE
@type {HTML}
@default '<thead class="{className}">{content}</thead>'
@since 3.6.0
**/
THEAD_TEMPLATE: '<thead class="{className}"></thead>',
// -- Public methods ------------------------------------------------------
/**
Returns the generated CSS classname based on the input. If the `host`
attribute is configured, it will attempt to relay to its `getClassName`
or use its static `NAME` property as a string base.
If `host` is absent or has neither method nor `NAME`, a CSS classname
will be generated using this class's `NAME`.
@method getClassName
@param {String} token* Any number of token strings to assemble the
classname from.
@return {String}
@protected
**/
getClassName: function () {
// TODO: add attribute with setter? to host to use property this.host
// for performance
_yuitest_coverfunc("build/datatable-head/datatable-head.js", "getClassName", 160);
_yuitest_coverline("build/datatable-head/datatable-head.js", 163);
var host = this.host,
NAME = (host && host.constructor.NAME) ||
this.constructor.NAME;
_yuitest_coverline("build/datatable-head/datatable-head.js", 167);
if (host && host.getClassName) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 168);
return host.getClassName.apply(host, arguments);
} else {
_yuitest_coverline("build/datatable-head/datatable-head.js", 170);
return Y.ClassNameManager.getClassName
.apply(Y.ClassNameManager,
[NAME].concat(toArray(arguments, 0, true)));
}
},
/**
Creates the `<thead>` Node content by assembling markup generated by
populating the `ROW_TEMPLATE` and `CELL_TEMPLATE` templates with content
from the `columns` property.
@method render
@return {HeaderView} The instance
@chainable
@since 3.5.0
**/
render: function () {
_yuitest_coverfunc("build/datatable-head/datatable-head.js", "render", 186);
_yuitest_coverline("build/datatable-head/datatable-head.js", 187);
var table = this.get('container'),
thead = this.theadNode ||
(this.theadNode = this._createTHeadNode()),
columns = this.columns,
defaults = {
_colspan: 1,
_rowspan: 1,
abbr: ''
},
i, len, j, jlen, col, html, content, values;
_yuitest_coverline("build/datatable-head/datatable-head.js", 198);
if (thead && columns) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 199);
html = '';
_yuitest_coverline("build/datatable-head/datatable-head.js", 201);
if (columns.length) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 202);
for (i = 0, len = columns.length; i < len; ++i) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 203);
content = '';
_yuitest_coverline("build/datatable-head/datatable-head.js", 205);
for (j = 0, jlen = columns[i].length; j < jlen; ++j) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 206);
col = columns[i][j];
_yuitest_coverline("build/datatable-head/datatable-head.js", 207);
values = Y.merge(
defaults,
col, {
className: this.getClassName('header'),
content : col.label || col.key ||
("Column " + (j + 1))
}
);
_yuitest_coverline("build/datatable-head/datatable-head.js", 216);
values._id = col._id ?
' data-yui3-col-id="' + col._id + '"' : '';
_yuitest_coverline("build/datatable-head/datatable-head.js", 219);
if (col.abbr) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 220);
values.abbr = ' abbr="' + col.abbr + '"';
}
_yuitest_coverline("build/datatable-head/datatable-head.js", 223);
if (col.className) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 224);
values.className += ' ' + col.className;
}
_yuitest_coverline("build/datatable-head/datatable-head.js", 227);
if (col._first) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 228);
values.className += ' ' + this.getClassName('first', 'header');
}
_yuitest_coverline("build/datatable-head/datatable-head.js", 231);
if (col._id) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 232);
values.className +=
' ' + this.getClassName('col', col._id);
}
_yuitest_coverline("build/datatable-head/datatable-head.js", 236);
content += fromTemplate(
col.headerTemplate || this.CELL_TEMPLATE, values);
}
_yuitest_coverline("build/datatable-head/datatable-head.js", 240);
html += fromTemplate(this.ROW_TEMPLATE, {
content: content
});
}
}
_yuitest_coverline("build/datatable-head/datatable-head.js", 246);
thead.setHTML(html);
_yuitest_coverline("build/datatable-head/datatable-head.js", 248);
if (thead.get('parentNode') !== table) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 249);
table.insertBefore(thead, table.one('tfoot, tbody'));
}
}
_yuitest_coverline("build/datatable-head/datatable-head.js", 253);
this.bindUI();
_yuitest_coverline("build/datatable-head/datatable-head.js", 255);
return this;
},
// -- Protected and private properties and methods ------------------------
/**
Handles changes in the source's columns attribute. Redraws the headers.
@method _afterColumnsChange
@param {EventFacade} e The `columnsChange` event object
@protected
@since 3.5.0
**/
_afterColumnsChange: function (e) {
_yuitest_coverfunc("build/datatable-head/datatable-head.js", "_afterColumnsChange", 268);
_yuitest_coverline("build/datatable-head/datatable-head.js", 269);
this.columns = this._parseColumns(e.newVal);
_yuitest_coverline("build/datatable-head/datatable-head.js", 271);
this.render();
},
/**
Binds event subscriptions from the UI and the source (if assigned).
@method bindUI
@protected
@since 3.5.0
**/
bindUI: function () {
_yuitest_coverfunc("build/datatable-head/datatable-head.js", "bindUI", 281);
_yuitest_coverline("build/datatable-head/datatable-head.js", 282);
if (!this._eventHandles.columnsChange) {
// TODO: How best to decouple this?
_yuitest_coverline("build/datatable-head/datatable-head.js", 284);
this._eventHandles.columnsChange =
this.after('columnsChange',
Y.bind('_afterColumnsChange', this));
}
},
/**
Creates the `<thead>` node that will store the header rows and cells.
@method _createTHeadNode
@return {Node}
@protected
@since 3.6.0
**/
_createTHeadNode: function () {
_yuitest_coverfunc("build/datatable-head/datatable-head.js", "_createTHeadNode", 298);
_yuitest_coverline("build/datatable-head/datatable-head.js", 299);
return Y.Node.create(fromTemplate(this.THEAD_TEMPLATE, {
className: this.getClassName('columns')
}));
},
/**
Destroys the instance.
@method destructor
@protected
@since 3.5.0
**/
destructor: function () {
_yuitest_coverfunc("build/datatable-head/datatable-head.js", "destructor", 311);
_yuitest_coverline("build/datatable-head/datatable-head.js", 312);
(new Y.EventHandle(Y.Object.values(this._eventHandles))).detach();
},
/**
Holds the event subscriptions needing to be detached when the instance is
`destroy()`ed.
@property _eventHandles
@type {Object}
@default undefined (initially unset)
@protected
@since 3.5.0
**/
//_eventHandles: null,
/**
Initializes the instance. Reads the following configuration properties:
* `columns` - (REQUIRED) The initial column information
* `host` - The object to serve as source of truth for column info
@method initializer
@param {Object} config Configuration data
@protected
@since 3.5.0
**/
initializer: function (config) {
_yuitest_coverfunc("build/datatable-head/datatable-head.js", "initializer", 338);
_yuitest_coverline("build/datatable-head/datatable-head.js", 339);
this.host = config.host;
_yuitest_coverline("build/datatable-head/datatable-head.js", 340);
this.columns = this._parseColumns(config.columns);
_yuitest_coverline("build/datatable-head/datatable-head.js", 342);
this._eventHandles = [];
},
/**
Translate the input column format into a structure useful for rendering a
`<thead>`, rows, and cells. The structure of the input is expected to be a
single array of objects, where each object corresponds to a `<th>`. Those
objects may contain a `children` property containing a similarly structured
array to indicate the nested cells should be grouped under the parent
column's colspan in a separate row of header cells. E.g.
<pre><code>
[
{ key: 'id' }, // no nesting
{ key: 'name', children: [
{ key: 'firstName', label: 'First' },
{ key: 'lastName', label: 'Last' } ] }
]
</code></pre>
would indicate two header rows with the first column 'id' being assigned a
`rowspan` of `2`, the 'name' column appearing in the first row with a
`colspan` of `2`, and the 'firstName' and 'lastName' columns appearing in
the second row, below the 'name' column.
<pre>
---------------------
| | name |
| |---------------
| id | First | Last |
---------------------
</pre>
Supported properties of the column objects include:
* `label` - The HTML content of the header cell.
* `key` - If `label` is not specified, the `key` is used for content.
* `children` - Array of columns to appear below this column in the next
row.
* `abbr` - The content of the 'abbr' attribute of the `<th>`
* `headerTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells
in this column only.
The output structure is basically a simulation of the `<thead>` structure
with arrays for rows and objects for cells. Column objects have the
following properties added to them:
* `id` - (Defaulted by DataTable) The id to assign the rendered
column
* `_colspan` - Per the `<th>` attribute
* `_rowspan` - Per the `<th>` attribute
* `_parent` - (Added by DataTable) If the column is a child of another
column, this points to its parent column
The column object is also used to provide values for {placeholder}
replacement in the `CELL_TEMPLATE`, so you can modify the template and
include other column object properties to populate them.
@method _parseColumns
@param {Object[]} data Array of column object data
@return {Array[]} An array of arrays corresponding to the header row
structure to render
@protected
@since 3.5.0
**/
_parseColumns: function (data) {
_yuitest_coverfunc("build/datatable-head/datatable-head.js", "_parseColumns", 407);
_yuitest_coverline("build/datatable-head/datatable-head.js", 408);
var columns = [],
stack = [],
rowSpan = 1,
entry, row, col, children, parent, i, len, j;
_yuitest_coverline("build/datatable-head/datatable-head.js", 413);
if (isArray(data) && data.length) {
// don't modify the input array
_yuitest_coverline("build/datatable-head/datatable-head.js", 415);
data = data.slice();
// First pass, assign colspans and calculate row count for
// non-nested headers' rowspan
_yuitest_coverline("build/datatable-head/datatable-head.js", 419);
stack.push([data, -1]);
_yuitest_coverline("build/datatable-head/datatable-head.js", 421);
while (stack.length) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 422);
entry = stack[stack.length - 1];
_yuitest_coverline("build/datatable-head/datatable-head.js", 423);
row = entry[0];
_yuitest_coverline("build/datatable-head/datatable-head.js", 424);
i = entry[1] + 1;
_yuitest_coverline("build/datatable-head/datatable-head.js", 426);
for (len = row.length; i < len; ++i) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 427);
row[i] = col = Y.merge(row[i]);
_yuitest_coverline("build/datatable-head/datatable-head.js", 428);
children = col.children;
_yuitest_coverline("build/datatable-head/datatable-head.js", 430);
Y.stamp(col);
_yuitest_coverline("build/datatable-head/datatable-head.js", 432);
if (!col.id) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 433);
col.id = Y.guid();
}
_yuitest_coverline("build/datatable-head/datatable-head.js", 436);
if (isArray(children) && children.length) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 437);
stack.push([children, -1]);
_yuitest_coverline("build/datatable-head/datatable-head.js", 438);
entry[1] = i;
_yuitest_coverline("build/datatable-head/datatable-head.js", 440);
rowSpan = Math.max(rowSpan, stack.length);
// break to let the while loop process the children
_yuitest_coverline("build/datatable-head/datatable-head.js", 443);
break;
} else {
_yuitest_coverline("build/datatable-head/datatable-head.js", 445);
col._colspan = 1;
}
}
_yuitest_coverline("build/datatable-head/datatable-head.js", 449);
if (i >= len) {
// All columns in this row are processed
_yuitest_coverline("build/datatable-head/datatable-head.js", 451);
if (stack.length > 1) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 452);
entry = stack[stack.length - 2];
_yuitest_coverline("build/datatable-head/datatable-head.js", 453);
parent = entry[0][entry[1]];
_yuitest_coverline("build/datatable-head/datatable-head.js", 455);
parent._colspan = 0;
_yuitest_coverline("build/datatable-head/datatable-head.js", 457);
for (i = 0, len = row.length; i < len; ++i) {
// Can't use .length because in 3+ rows, colspan
// needs to aggregate the colspans of children
_yuitest_coverline("build/datatable-head/datatable-head.js", 460);
row[i]._parent = parent;
_yuitest_coverline("build/datatable-head/datatable-head.js", 461);
parent._colspan += row[i]._colspan;
}
}
_yuitest_coverline("build/datatable-head/datatable-head.js", 464);
stack.pop();
}
}
// Second pass, build row arrays and assign rowspan
_yuitest_coverline("build/datatable-head/datatable-head.js", 469);
for (i = 0; i < rowSpan; ++i) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 470);
columns.push([]);
}
_yuitest_coverline("build/datatable-head/datatable-head.js", 473);
stack.push([data, -1]);
_yuitest_coverline("build/datatable-head/datatable-head.js", 475);
while (stack.length) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 476);
entry = stack[stack.length - 1];
_yuitest_coverline("build/datatable-head/datatable-head.js", 477);
row = entry[0];
_yuitest_coverline("build/datatable-head/datatable-head.js", 478);
i = entry[1] + 1;
_yuitest_coverline("build/datatable-head/datatable-head.js", 480);
for (len = row.length; i < len; ++i) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 481);
col = row[i];
_yuitest_coverline("build/datatable-head/datatable-head.js", 482);
children = col.children;
_yuitest_coverline("build/datatable-head/datatable-head.js", 484);
columns[stack.length - 1].push(col);
_yuitest_coverline("build/datatable-head/datatable-head.js", 486);
entry[1] = i;
// collect the IDs of parent cols
_yuitest_coverline("build/datatable-head/datatable-head.js", 489);
col._headers = [col.id];
_yuitest_coverline("build/datatable-head/datatable-head.js", 491);
for (j = stack.length - 2; j >= 0; --j) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 492);
parent = stack[j][0][stack[j][1]];
_yuitest_coverline("build/datatable-head/datatable-head.js", 494);
col._headers.unshift(parent.id);
}
_yuitest_coverline("build/datatable-head/datatable-head.js", 497);
if (children && children.length) {
// parent cells must assume rowspan 1 (long story)
// break to let the while loop process the children
_yuitest_coverline("build/datatable-head/datatable-head.js", 501);
stack.push([children, -1]);
_yuitest_coverline("build/datatable-head/datatable-head.js", 502);
break;
} else {
_yuitest_coverline("build/datatable-head/datatable-head.js", 504);
col._rowspan = rowSpan - stack.length + 1;
}
}
_yuitest_coverline("build/datatable-head/datatable-head.js", 508);
if (i >= len) {
// All columns in this row are processed
_yuitest_coverline("build/datatable-head/datatable-head.js", 510);
stack.pop();
}
}
}
_yuitest_coverline("build/datatable-head/datatable-head.js", 515);
for (i = 0, len = columns.length; i < len; i += col._rowspan) {
_yuitest_coverline("build/datatable-head/datatable-head.js", 516);
col = columns[i][0];
_yuitest_coverline("build/datatable-head/datatable-head.js", 518);
col._first = true;
}
_yuitest_coverline("build/datatable-head/datatable-head.js", 521);
return columns;
}
});
}, '@VERSION@', {"requires": ["datatable-core", "view", "classnamemanager"]});
| shelsonjava/cdnjs | ajax/libs/yui/3.7.0pr2/datatable-head/datatable-head-coverage.js | JavaScript | mit | 44,263 |
/**
* @license AngularJS v1.2.4
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, angular, undefined) {'use strict';
/**
* @ngdoc overview
* @name ngRoute
* @description
*
* # ngRoute
*
* The `ngRoute` module provides routing and deeplinking services and directives for angular apps.
*
* ## Example
* See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
*
* {@installModule route}
*
* <div doc-module-components="ngRoute"></div>
*/
/* global -ngRouteModule */
var ngRouteModule = angular.module('ngRoute', ['ng']).
provider('$route', $RouteProvider);
/**
* @ngdoc object
* @name ngRoute.$routeProvider
* @function
*
* @description
*
* Used for configuring routes.
*
* ## Example
* See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
*
* ## Dependencies
* Requires the {@link ngRoute `ngRoute`} module to be installed.
*/
function $RouteProvider(){
function inherit(parent, extra) {
return angular.extend(new (angular.extend(function() {}, {prototype:parent}))(), extra);
}
var routes = {};
/**
* @ngdoc method
* @name ngRoute.$routeProvider#when
* @methodOf ngRoute.$routeProvider
*
* @param {string} path Route path (matched against `$location.path`). If `$location.path`
* contains redundant trailing slash or is missing one, the route will still match and the
* `$location.path` will be updated to add or drop the trailing slash to exactly match the
* route definition.
*
* * `path` can contain named groups starting with a colon (`:name`). All characters up
* to the next slash are matched and stored in `$routeParams` under the given `name`
* when the route matches.
* * `path` can contain named groups starting with a colon and ending with a star (`:name*`).
* All characters are eagerly stored in `$routeParams` under the given `name`
* when the route matches.
* * `path` can contain optional named groups with a question mark (`:name?`).
*
* For example, routes like `/color/:color/largecode/:largecode*\/edit` will match
* `/color/brown/largecode/code/with/slashs/edit` and extract:
*
* * `color: brown`
* * `largecode: code/with/slashs`.
*
*
* @param {Object} route Mapping information to be assigned to `$route.current` on route
* match.
*
* Object properties:
*
* - `controller` – `{(string|function()=}` – Controller fn that should be associated with
* newly created scope or the name of a {@link angular.Module#controller registered
* controller} if passed as a string.
* - `controllerAs` – `{string=}` – A controller alias name. If present the controller will be
* published to scope under the `controllerAs` name.
* - `template` – `{string=|function()=}` – html template as a string or a function that
* returns an html template as a string which should be used by {@link
* ngRoute.directive:ngView ngView} or {@link ng.directive:ngInclude ngInclude} directives.
* This property takes precedence over `templateUrl`.
*
* If `template` is a function, it will be called with the following parameters:
*
* - `{Array.<Object>}` - route parameters extracted from the current
* `$location.path()` by applying the current route
*
* - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html
* template that should be used by {@link ngRoute.directive:ngView ngView}.
*
* If `templateUrl` is a function, it will be called with the following parameters:
*
* - `{Array.<Object>}` - route parameters extracted from the current
* `$location.path()` by applying the current route
*
* - `resolve` - `{Object.<string, function>=}` - An optional map of dependencies which should
* be injected into the controller. If any of these dependencies are promises, the router
* will wait for them all to be resolved or one to be rejected before the controller is
* instantiated.
* If all the promises are resolved successfully, the values of the resolved promises are
* injected and {@link ngRoute.$route#$routeChangeSuccess $routeChangeSuccess} event is
* fired. If any of the promises are rejected the
* {@link ngRoute.$route#$routeChangeError $routeChangeError} event is fired. The map object
* is:
*
* - `key` – `{string}`: a name of a dependency to be injected into the controller.
* - `factory` - `{string|function}`: If `string` then it is an alias for a service.
* Otherwise if function, then it is {@link api/AUTO.$injector#invoke injected}
* and the return value is treated as the dependency. If the result is a promise, it is
* resolved before its value is injected into the controller. Be aware that
* `ngRoute.$routeParams` will still refer to the previous route within these resolve
* functions. Use `$route.current.params` to access the new route parameters, instead.
*
* - `redirectTo` – {(string|function())=} – value to update
* {@link ng.$location $location} path with and trigger route redirection.
*
* If `redirectTo` is a function, it will be called with the following parameters:
*
* - `{Object.<string>}` - route parameters extracted from the current
* `$location.path()` by applying the current route templateUrl.
* - `{string}` - current `$location.path()`
* - `{Object}` - current `$location.search()`
*
* The custom `redirectTo` function is expected to return a string which will be used
* to update `$location.path()` and `$location.search()`.
*
* - `[reloadOnSearch=true]` - {boolean=} - reload route when only `$location.search()`
* or `$location.hash()` changes.
*
* If the option is set to `false` and url in the browser changes, then
* `$routeUpdate` event is broadcasted on the root scope.
*
* - `[caseInsensitiveMatch=false]` - {boolean=} - match routes without being case sensitive
*
* If the option is set to `true`, then the particular route can be matched without being
* case sensitive
*
* @returns {Object} self
*
* @description
* Adds a new route definition to the `$route` service.
*/
this.when = function(path, route) {
routes[path] = angular.extend(
{reloadOnSearch: true},
route,
path && pathRegExp(path, route)
);
// create redirection for trailing slashes
if (path) {
var redirectPath = (path[path.length-1] == '/')
? path.substr(0, path.length-1)
: path +'/';
routes[redirectPath] = angular.extend(
{redirectTo: path},
pathRegExp(redirectPath, route)
);
}
return this;
};
/**
* @param path {string} path
* @param opts {Object} options
* @return {?Object}
*
* @description
* Normalizes the given path, returning a regular expression
* and the original path.
*
* Inspired by pathRexp in visionmedia/express/lib/utils.js.
*/
function pathRegExp(path, opts) {
var insensitive = opts.caseInsensitiveMatch,
ret = {
originalPath: path,
regexp: path
},
keys = ret.keys = [];
path = path
.replace(/([().])/g, '\\$1')
.replace(/(\/)?:(\w+)([\?|\*])?/g, function(_, slash, key, option){
var optional = option === '?' ? option : null;
var star = option === '*' ? option : null;
keys.push({ name: key, optional: !!optional });
slash = slash || '';
return ''
+ (optional ? '' : slash)
+ '(?:'
+ (optional ? slash : '')
+ (star && '(.+?)' || '([^/]+)')
+ (optional || '')
+ ')'
+ (optional || '');
})
.replace(/([\/$\*])/g, '\\$1');
ret.regexp = new RegExp('^' + path + '$', insensitive ? 'i' : '');
return ret;
}
/**
* @ngdoc method
* @name ngRoute.$routeProvider#otherwise
* @methodOf ngRoute.$routeProvider
*
* @description
* Sets route definition that will be used on route change when no other route definition
* is matched.
*
* @param {Object} params Mapping information to be assigned to `$route.current`.
* @returns {Object} self
*/
this.otherwise = function(params) {
this.when(null, params);
return this;
};
this.$get = ['$rootScope',
'$location',
'$routeParams',
'$q',
'$injector',
'$http',
'$templateCache',
'$sce',
function($rootScope, $location, $routeParams, $q, $injector, $http, $templateCache, $sce) {
/**
* @ngdoc object
* @name ngRoute.$route
* @requires $location
* @requires $routeParams
*
* @property {Object} current Reference to the current route definition.
* The route definition contains:
*
* - `controller`: The controller constructor as define in route definition.
* - `locals`: A map of locals which is used by {@link ng.$controller $controller} service for
* controller instantiation. The `locals` contain
* the resolved values of the `resolve` map. Additionally the `locals` also contain:
*
* - `$scope` - The current route scope.
* - `$template` - The current route template HTML.
*
* @property {Array.<Object>} routes Array of all configured routes.
*
* @description
* `$route` is used for deep-linking URLs to controllers and views (HTML partials).
* It watches `$location.url()` and tries to map the path to an existing route definition.
*
* Requires the {@link ngRoute `ngRoute`} module to be installed.
*
* You can define routes through {@link ngRoute.$routeProvider $routeProvider}'s API.
*
* The `$route` service is typically used in conjunction with the
* {@link ngRoute.directive:ngView `ngView`} directive and the
* {@link ngRoute.$routeParams `$routeParams`} service.
*
* @example
This example shows how changing the URL hash causes the `$route` to match a route against the
URL, and the `ngView` pulls in the partial.
Note that this example is using {@link ng.directive:script inlined templates}
to get it working on jsfiddle as well.
<example module="ngViewExample" deps="angular-route.js">
<file name="index.html">
<div ng-controller="MainCntl">
Choose:
<a href="Book/Moby">Moby</a> |
<a href="Book/Moby/ch/1">Moby: Ch1</a> |
<a href="Book/Gatsby">Gatsby</a> |
<a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
<a href="Book/Scarlet">Scarlet Letter</a><br/>
<div ng-view></div>
<hr />
<pre>$location.path() = {{$location.path()}}</pre>
<pre>$route.current.templateUrl = {{$route.current.templateUrl}}</pre>
<pre>$route.current.params = {{$route.current.params}}</pre>
<pre>$route.current.scope.name = {{$route.current.scope.name}}</pre>
<pre>$routeParams = {{$routeParams}}</pre>
</div>
</file>
<file name="book.html">
controller: {{name}}<br />
Book Id: {{params.bookId}}<br />
</file>
<file name="chapter.html">
controller: {{name}}<br />
Book Id: {{params.bookId}}<br />
Chapter Id: {{params.chapterId}}
</file>
<file name="script.js">
angular.module('ngViewExample', ['ngRoute'])
.config(function($routeProvider, $locationProvider) {
$routeProvider.when('/Book/:bookId', {
templateUrl: 'book.html',
controller: BookCntl,
resolve: {
// I will cause a 1 second delay
delay: function($q, $timeout) {
var delay = $q.defer();
$timeout(delay.resolve, 1000);
return delay.promise;
}
}
});
$routeProvider.when('/Book/:bookId/ch/:chapterId', {
templateUrl: 'chapter.html',
controller: ChapterCntl
});
// configure html5 to get links working on jsfiddle
$locationProvider.html5Mode(true);
});
function MainCntl($scope, $route, $routeParams, $location) {
$scope.$route = $route;
$scope.$location = $location;
$scope.$routeParams = $routeParams;
}
function BookCntl($scope, $routeParams) {
$scope.name = "BookCntl";
$scope.params = $routeParams;
}
function ChapterCntl($scope, $routeParams) {
$scope.name = "ChapterCntl";
$scope.params = $routeParams;
}
</file>
<file name="scenario.js">
it('should load and compile correct template', function() {
element('a:contains("Moby: Ch1")').click();
var content = element('.doc-example-live [ng-view]').text();
expect(content).toMatch(/controller\: ChapterCntl/);
expect(content).toMatch(/Book Id\: Moby/);
expect(content).toMatch(/Chapter Id\: 1/);
element('a:contains("Scarlet")').click();
sleep(2); // promises are not part of scenario waiting
content = element('.doc-example-live [ng-view]').text();
expect(content).toMatch(/controller\: BookCntl/);
expect(content).toMatch(/Book Id\: Scarlet/);
});
</file>
</example>
*/
/**
* @ngdoc event
* @name ngRoute.$route#$routeChangeStart
* @eventOf ngRoute.$route
* @eventType broadcast on root scope
* @description
* Broadcasted before a route change. At this point the route services starts
* resolving all of the dependencies needed for the route change to occurs.
* Typically this involves fetching the view template as well as any dependencies
* defined in `resolve` route property. Once all of the dependencies are resolved
* `$routeChangeSuccess` is fired.
*
* @param {Object} angularEvent Synthetic event object.
* @param {Route} next Future route information.
* @param {Route} current Current route information.
*/
/**
* @ngdoc event
* @name ngRoute.$route#$routeChangeSuccess
* @eventOf ngRoute.$route
* @eventType broadcast on root scope
* @description
* Broadcasted after a route dependencies are resolved.
* {@link ngRoute.directive:ngView ngView} listens for the directive
* to instantiate the controller and render the view.
*
* @param {Object} angularEvent Synthetic event object.
* @param {Route} current Current route information.
* @param {Route|Undefined} previous Previous route information, or undefined if current is
* first route entered.
*/
/**
* @ngdoc event
* @name ngRoute.$route#$routeChangeError
* @eventOf ngRoute.$route
* @eventType broadcast on root scope
* @description
* Broadcasted if any of the resolve promises are rejected.
*
* @param {Object} angularEvent Synthetic event object
* @param {Route} current Current route information.
* @param {Route} previous Previous route information.
* @param {Route} rejection Rejection of the promise. Usually the error of the failed promise.
*/
/**
* @ngdoc event
* @name ngRoute.$route#$routeUpdate
* @eventOf ngRoute.$route
* @eventType broadcast on root scope
* @description
*
* The `reloadOnSearch` property has been set to false, and we are reusing the same
* instance of the Controller.
*/
var forceReload = false,
$route = {
routes: routes,
/**
* @ngdoc method
* @name ngRoute.$route#reload
* @methodOf ngRoute.$route
*
* @description
* Causes `$route` service to reload the current route even if
* {@link ng.$location $location} hasn't changed.
*
* As a result of that, {@link ngRoute.directive:ngView ngView}
* creates new scope, reinstantiates the controller.
*/
reload: function() {
forceReload = true;
$rootScope.$evalAsync(updateRoute);
}
};
$rootScope.$on('$locationChangeSuccess', updateRoute);
return $route;
/////////////////////////////////////////////////////
/**
* @param on {string} current url
* @param route {Object} route regexp to match the url against
* @return {?Object}
*
* @description
* Check if the route matches the current url.
*
* Inspired by match in
* visionmedia/express/lib/router/router.js.
*/
function switchRouteMatcher(on, route) {
var keys = route.keys,
params = {};
if (!route.regexp) return null;
var m = route.regexp.exec(on);
if (!m) return null;
for (var i = 1, len = m.length; i < len; ++i) {
var key = keys[i - 1];
var val = 'string' == typeof m[i]
? decodeURIComponent(m[i])
: m[i];
if (key && val) {
params[key.name] = val;
}
}
return params;
}
function updateRoute() {
var next = parseRoute(),
last = $route.current;
if (next && last && next.$$route === last.$$route
&& angular.equals(next.pathParams, last.pathParams)
&& !next.reloadOnSearch && !forceReload) {
last.params = next.params;
angular.copy(last.params, $routeParams);
$rootScope.$broadcast('$routeUpdate', last);
} else if (next || last) {
forceReload = false;
$rootScope.$broadcast('$routeChangeStart', next, last);
$route.current = next;
if (next) {
if (next.redirectTo) {
if (angular.isString(next.redirectTo)) {
$location.path(interpolate(next.redirectTo, next.params)).search(next.params)
.replace();
} else {
$location.url(next.redirectTo(next.pathParams, $location.path(), $location.search()))
.replace();
}
}
}
$q.when(next).
then(function() {
if (next) {
var locals = angular.extend({}, next.resolve),
template, templateUrl;
angular.forEach(locals, function(value, key) {
locals[key] = angular.isString(value) ?
$injector.get(value) : $injector.invoke(value);
});
if (angular.isDefined(template = next.template)) {
if (angular.isFunction(template)) {
template = template(next.params);
}
} else if (angular.isDefined(templateUrl = next.templateUrl)) {
if (angular.isFunction(templateUrl)) {
templateUrl = templateUrl(next.params);
}
templateUrl = $sce.getTrustedResourceUrl(templateUrl);
if (angular.isDefined(templateUrl)) {
next.loadedTemplateUrl = templateUrl;
template = $http.get(templateUrl, {cache: $templateCache}).
then(function(response) { return response.data; });
}
}
if (angular.isDefined(template)) {
locals['$template'] = template;
}
return $q.all(locals);
}
}).
// after route change
then(function(locals) {
if (next == $route.current) {
if (next) {
next.locals = locals;
angular.copy(next.params, $routeParams);
}
$rootScope.$broadcast('$routeChangeSuccess', next, last);
}
}, function(error) {
if (next == $route.current) {
$rootScope.$broadcast('$routeChangeError', next, last, error);
}
});
}
}
/**
* @returns the current active route, by matching it against the URL
*/
function parseRoute() {
// Match a route
var params, match;
angular.forEach(routes, function(route, path) {
if (!match && (params = switchRouteMatcher($location.path(), route))) {
match = inherit(route, {
params: angular.extend({}, $location.search(), params),
pathParams: params});
match.$$route = route;
}
});
// No route matched; fallback to "otherwise" route
return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}});
}
/**
* @returns interpolation of the redirect path with the parameters
*/
function interpolate(string, params) {
var result = [];
angular.forEach((string||'').split(':'), function(segment, i) {
if (i === 0) {
result.push(segment);
} else {
var segmentMatch = segment.match(/(\w+)(.*)/);
var key = segmentMatch[1];
result.push(params[key]);
result.push(segmentMatch[2] || '');
delete params[key];
}
});
return result.join('');
}
}];
}
ngRouteModule.provider('$routeParams', $RouteParamsProvider);
/**
* @ngdoc object
* @name ngRoute.$routeParams
* @requires $route
*
* @description
* The `$routeParams` service allows you to retrieve the current set of route parameters.
*
* Requires the {@link ngRoute `ngRoute`} module to be installed.
*
* The route parameters are a combination of {@link ng.$location `$location`}'s
* {@link ng.$location#methods_search `search()`} and {@link ng.$location#methods_path `path()`}.
* The `path` parameters are extracted when the {@link ngRoute.$route `$route`} path is matched.
*
* In case of parameter name collision, `path` params take precedence over `search` params.
*
* The service guarantees that the identity of the `$routeParams` object will remain unchanged
* (but its properties will likely change) even when a route change occurs.
*
* Note that the `$routeParams` are only updated *after* a route change completes successfully.
* This means that you cannot rely on `$routeParams` being correct in route resolve functions.
* Instead you can use `$route.current.params` to access the new route's parameters.
*
* @example
* <pre>
* // Given:
* // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby
* // Route: /Chapter/:chapterId/Section/:sectionId
* //
* // Then
* $routeParams ==> {chapterId:1, sectionId:2, search:'moby'}
* </pre>
*/
function $RouteParamsProvider() {
this.$get = function() { return {}; };
}
ngRouteModule.directive('ngView', ngViewFactory);
/**
* @ngdoc directive
* @name ngRoute.directive:ngView
* @restrict ECA
*
* @description
* # Overview
* `ngView` is a directive that complements the {@link ngRoute.$route $route} service by
* including the rendered template of the current route into the main layout (`index.html`) file.
* Every time the current route changes, the included view changes with it according to the
* configuration of the `$route` service.
*
* Requires the {@link ngRoute `ngRoute`} module to be installed.
*
* @animations
* enter - animation is used to bring new content into the browser.
* leave - animation is used to animate existing content away.
*
* The enter and leave animation occur concurrently.
*
* @scope
* @priority 400
* @example
<example module="ngViewExample" deps="angular-route.js" animations="true">
<file name="index.html">
<div ng-controller="MainCntl as main">
Choose:
<a href="Book/Moby">Moby</a> |
<a href="Book/Moby/ch/1">Moby: Ch1</a> |
<a href="Book/Gatsby">Gatsby</a> |
<a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
<a href="Book/Scarlet">Scarlet Letter</a><br/>
<div class="view-animate-container">
<div ng-view class="view-animate"></div>
</div>
<hr />
<pre>$location.path() = {{main.$location.path()}}</pre>
<pre>$route.current.templateUrl = {{main.$route.current.templateUrl}}</pre>
<pre>$route.current.params = {{main.$route.current.params}}</pre>
<pre>$route.current.scope.name = {{main.$route.current.scope.name}}</pre>
<pre>$routeParams = {{main.$routeParams}}</pre>
</div>
</file>
<file name="book.html">
<div>
controller: {{book.name}}<br />
Book Id: {{book.params.bookId}}<br />
</div>
</file>
<file name="chapter.html">
<div>
controller: {{chapter.name}}<br />
Book Id: {{chapter.params.bookId}}<br />
Chapter Id: {{chapter.params.chapterId}}
</div>
</file>
<file name="animations.css">
.view-animate-container {
position:relative;
height:100px!important;
position:relative;
background:white;
border:1px solid black;
height:40px;
overflow:hidden;
}
.view-animate {
padding:10px;
}
.view-animate.ng-enter, .view-animate.ng-leave {
-webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;
transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;
display:block;
width:100%;
border-left:1px solid black;
position:absolute;
top:0;
left:0;
right:0;
bottom:0;
padding:10px;
}
.view-animate.ng-enter {
left:100%;
}
.view-animate.ng-enter.ng-enter-active {
left:0;
}
.view-animate.ng-leave.ng-leave-active {
left:-100%;
}
</file>
<file name="script.js">
angular.module('ngViewExample', ['ngRoute', 'ngAnimate'],
function($routeProvider, $locationProvider) {
$routeProvider.when('/Book/:bookId', {
templateUrl: 'book.html',
controller: BookCntl,
controllerAs: 'book'
});
$routeProvider.when('/Book/:bookId/ch/:chapterId', {
templateUrl: 'chapter.html',
controller: ChapterCntl,
controllerAs: 'chapter'
});
// configure html5 to get links working on jsfiddle
$locationProvider.html5Mode(true);
});
function MainCntl($route, $routeParams, $location) {
this.$route = $route;
this.$location = $location;
this.$routeParams = $routeParams;
}
function BookCntl($routeParams) {
this.name = "BookCntl";
this.params = $routeParams;
}
function ChapterCntl($routeParams) {
this.name = "ChapterCntl";
this.params = $routeParams;
}
</file>
<file name="scenario.js">
it('should load and compile correct template', function() {
element('a:contains("Moby: Ch1")').click();
var content = element('.doc-example-live [ng-view]').text();
expect(content).toMatch(/controller\: ChapterCntl/);
expect(content).toMatch(/Book Id\: Moby/);
expect(content).toMatch(/Chapter Id\: 1/);
element('a:contains("Scarlet")').click();
content = element('.doc-example-live [ng-view]').text();
expect(content).toMatch(/controller\: BookCntl/);
expect(content).toMatch(/Book Id\: Scarlet/);
});
</file>
</example>
*/
/**
* @ngdoc event
* @name ngRoute.directive:ngView#$viewContentLoaded
* @eventOf ngRoute.directive:ngView
* @eventType emit on the current ngView scope
* @description
* Emitted every time the ngView content is reloaded.
*/
ngViewFactory.$inject = ['$route', '$anchorScroll', '$compile', '$controller', '$animate'];
function ngViewFactory( $route, $anchorScroll, $compile, $controller, $animate) {
return {
restrict: 'ECA',
terminal: true,
priority: 400,
transclude: 'element',
link: function(scope, $element, attr, ctrl, $transclude) {
var currentScope,
currentElement,
autoScrollExp = attr.autoscroll,
onloadExp = attr.onload || '';
scope.$on('$routeChangeSuccess', update);
update();
function cleanupLastView() {
if (currentScope) {
currentScope.$destroy();
currentScope = null;
}
if(currentElement) {
$animate.leave(currentElement);
currentElement = null;
}
}
function update() {
var locals = $route.current && $route.current.locals,
template = locals && locals.$template;
if (template) {
var newScope = scope.$new();
// Note: This will also link all children of ng-view that were contained in the original
// html. If that content contains controllers, ... they could pollute/change the scope.
// However, using ng-view on an element with additional content does not make sense...
// Note: We can't remove them in the cloneAttchFn of $transclude as that
// function is called before linking the content, which would apply child
// directives to non existing elements.
var clone = $transclude(newScope, angular.noop);
clone.html(template);
$animate.enter(clone, null, currentElement || $element, function onNgViewEnter () {
if (angular.isDefined(autoScrollExp)
&& (!autoScrollExp || scope.$eval(autoScrollExp))) {
$anchorScroll();
}
});
cleanupLastView();
var link = $compile(clone.contents()),
current = $route.current;
currentScope = current.scope = newScope;
currentElement = clone;
if (current.controller) {
locals.$scope = currentScope;
var controller = $controller(current.controller, locals);
if (current.controllerAs) {
currentScope[current.controllerAs] = controller;
}
clone.data('$ngControllerController', controller);
clone.children().data('$ngControllerController', controller);
}
link(currentScope);
currentScope.$emit('$viewContentLoaded');
currentScope.$eval(onloadExp);
} else {
cleanupLastView();
}
}
}
};
}
})(window, window.angular);
| mikesir87/cdnjs | ajax/libs/ionic/0.9.17-alpha/js/angular/angular-route.js | JavaScript | mit | 31,292 |
<?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\DomCrawler\Tests\Field;
use Symfony\Component\DomCrawler\Field\InputFormField;
class FormFieldTest extends FormFieldTestCase
{
public function testGetName()
{
$node = $this->createNode('input', '', array('type' => 'text', 'name' => 'name', 'value' => 'value'));
$field = new InputFormField($node);
$this->assertEquals('name', $field->getName(), '->getName() returns the name of the field');
}
public function testGetSetHasValue()
{
$node = $this->createNode('input', '', array('type' => 'text', 'name' => 'name', 'value' => 'value'));
$field = new InputFormField($node);
$this->assertEquals('value', $field->getValue(), '->getValue() returns the value of the field');
$field->setValue('foo');
$this->assertEquals('foo', $field->getValue(), '->setValue() sets the value of the field');
$this->assertTrue($field->hasValue(), '->hasValue() always returns true');
}
}
| alpatrick9/ChatPrototype | vendor/symfony/symfony/src/Symfony/Component/DomCrawler/Tests/Field/FormFieldTest.php | PHP | mit | 1,233 |
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2015, British Columbia Institute of Technology
*
* 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.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
* @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link http://codeigniter.com
* @since Version 3.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* PDO Firebird Forge Class
*
* @category Database
* @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_pdo_firebird_forge extends CI_DB_pdo_forge {
/**
* RENAME TABLE statement
*
* @var string
*/
protected $_rename_table = FALSE;
/**
* UNSIGNED support
*
* @var array
*/
protected $_unsigned = array(
'SMALLINT' => 'INTEGER',
'INTEGER' => 'INT64',
'FLOAT' => 'DOUBLE PRECISION'
);
/**
* NULL value representation in CREATE/ALTER TABLE statements
*
* @var string
*/
protected $_null = 'NULL';
// --------------------------------------------------------------------
/**
* Create database
*
* @param string $db_name
* @return string
*/
public function create_database($db_name)
{
// Firebird databases are flat files, so a path is required
// Hostname is needed for remote access
empty($this->db->hostname) OR $db_name = $this->hostname.':'.$db_name;
return parent::create_database('"'.$db_name.'"');
}
// --------------------------------------------------------------------
/**
* Drop database
*
* @param string $db_name (ignored)
* @return bool
*/
public function drop_database($db_name = '')
{
if ( ! ibase_drop_db($this->conn_id))
{
return ($this->db->db_debug) ? $this->db->display_error('db_unable_to_drop') : FALSE;
}
elseif ( ! empty($this->db->data_cache['db_names']))
{
$key = array_search(strtolower($this->db->database), array_map('strtolower', $this->db->data_cache['db_names']), TRUE);
if ($key !== FALSE)
{
unset($this->db->data_cache['db_names'][$key]);
}
}
return TRUE;
}
// --------------------------------------------------------------------
/**
* ALTER TABLE
*
* @param string $alter_type ALTER type
* @param string $table Table name
* @param mixed $field Column definition
* @return string|string[]
*/
protected function _alter_table($alter_type, $table, $field)
{
if (in_array($alter_type, array('DROP', 'ADD'), TRUE))
{
return parent::_alter_table($alter_type, $table, $field);
}
$sql = 'ALTER TABLE '.$this->db->escape_identifiers($table);
$sqls = array();
for ($i = 0, $c = count($field); $i < $c; $i++)
{
if ($field[$i]['_literal'] !== FALSE)
{
return FALSE;
}
if (isset($field[$i]['type']))
{
$sqls[] = $sql.' ALTER COLUMN '.$this->db->escape_identifiers($field[$i]['name'])
.' TYPE '.$field[$i]['type'].$field[$i]['length'];
}
if ( ! empty($field[$i]['default']))
{
$sqls[] = $sql.' ALTER COLUMN '.$this->db->escape_identifiers($field[$i]['name'])
.' SET DEFAULT '.$field[$i]['default'];
}
if (isset($field[$i]['null']))
{
$sqls[] = 'UPDATE "RDB$RELATION_FIELDS" SET "RDB$NULL_FLAG" = '
.($field[$i]['null'] === TRUE ? 'NULL' : '1')
.' WHERE "RDB$FIELD_NAME" = '.$this->db->escape($field[$i]['name'])
.' AND "RDB$RELATION_NAME" = '.$this->db->escape($table);
}
if ( ! empty($field[$i]['new_name']))
{
$sqls[] = $sql.' ALTER COLUMN '.$this->db->escape_identifiers($field[$i]['name'])
.' TO '.$this->db->escape_identifiers($field[$i]['new_name']);
}
}
return $sqls;
}
// --------------------------------------------------------------------
/**
* Process column
*
* @param array $field
* @return string
*/
protected function _process_column($field)
{
return $this->db->escape_identifiers($field['name'])
.' '.$field['type'].$field['length']
.$field['null']
.$field['unique']
.$field['default'];
}
// --------------------------------------------------------------------
/**
* Field attribute TYPE
*
* Performs a data type mapping between different databases.
*
* @param array &$attributes
* @return void
*/
protected function _attr_type(&$attributes)
{
switch (strtoupper($attributes['TYPE']))
{
case 'TINYINT':
$attributes['TYPE'] = 'SMALLINT';
$attributes['UNSIGNED'] = FALSE;
return;
case 'MEDIUMINT':
$attributes['TYPE'] = 'INTEGER';
$attributes['UNSIGNED'] = FALSE;
return;
case 'INT':
$attributes['TYPE'] = 'INTEGER';
return;
case 'BIGINT':
$attributes['TYPE'] = 'INT64';
return;
default: return;
}
}
// --------------------------------------------------------------------
/**
* Field attribute AUTO_INCREMENT
*
* @param array &$attributes
* @param array &$field
* @return void
*/
protected function _attr_auto_increment(&$attributes, &$field)
{
// Not supported
}
}
| codethejason/usersystem | system/database/drivers/pdo/subdrivers/pdo_firebird_forge.php | PHP | mit | 6,281 |
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2015, British Columbia Institute of Technology
*
* 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.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
* @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link http://codeigniter.com
* @since Version 3.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* PDO IBM DB2 Forge Class
*
* @category Database
* @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_pdo_ibm_forge extends CI_DB_pdo_forge {
/**
* RENAME TABLE IF statement
*
* @var string
*/
protected $_rename_table = 'RENAME TABLE %s TO %s';
/**
* UNSIGNED support
*
* @var array
*/
protected $_unsigned = array(
'SMALLINT' => 'INTEGER',
'INT' => 'BIGINT',
'INTEGER' => 'BIGINT'
);
/**
* DEFAULT value representation in CREATE/ALTER TABLE statements
*
* @var string
*/
protected $_default = FALSE;
// --------------------------------------------------------------------
/**
* ALTER TABLE
*
* @param string $alter_type ALTER type
* @param string $table Table name
* @param mixed $field Column definition
* @return string|string[]
*/
protected function _alter_table($alter_type, $table, $field)
{
if ($alter_type === 'CHANGE')
{
$alter_type = 'MODIFY';
}
return parent::_alter_table($alter_type, $table, $field);
}
// --------------------------------------------------------------------
/**
* Field attribute TYPE
*
* Performs a data type mapping between different databases.
*
* @param array &$attributes
* @return void
*/
protected function _attr_type(&$attributes)
{
switch (strtoupper($attributes['TYPE']))
{
case 'TINYINT':
$attributes['TYPE'] = 'SMALLINT';
$attributes['UNSIGNED'] = FALSE;
return;
case 'MEDIUMINT':
$attributes['TYPE'] = 'INTEGER';
$attributes['UNSIGNED'] = FALSE;
return;
default: return;
}
}
// --------------------------------------------------------------------
/**
* Field attribute UNIQUE
*
* @param array &$attributes
* @param array &$field
* @return void
*/
protected function _attr_unique(&$attributes, &$field)
{
if ( ! empty($attributes['UNIQUE']) && $attributes['UNIQUE'] === TRUE)
{
$field['unique'] = ' UNIQUE';
// UNIQUE must be used with NOT NULL
$field['null'] = ' NOT NULL';
}
}
// --------------------------------------------------------------------
/**
* Field attribute AUTO_INCREMENT
*
* @param array &$attributes
* @param array &$field
* @return void
*/
protected function _attr_auto_increment(&$attributes, &$field)
{
// Not supported
}
}
| cogliaWho/romec | system/database/drivers/pdo/subdrivers/pdo_ibm_forge.php | PHP | mit | 4,066 |
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2015, British Columbia Institute of Technology
*
* 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.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
* @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link http://codeigniter.com
* @since Version 3.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Interbase/Firebird Forge Class
*
* @category Database
* @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_ibase_forge extends CI_DB_forge {
/**
* CREATE TABLE IF statement
*
* @var string
*/
protected $_create_table_if = FALSE;
/**
* RENAME TABLE statement
*
* @var string
*/
protected $_rename_table = FALSE;
/**
* DROP TABLE IF statement
*
* @var string
*/
protected $_drop_table_if = FALSE;
/**
* UNSIGNED support
*
* @var array
*/
protected $_unsigned = array(
'SMALLINT' => 'INTEGER',
'INTEGER' => 'INT64',
'FLOAT' => 'DOUBLE PRECISION'
);
/**
* NULL value representation in CREATE/ALTER TABLE statements
*
* @var string
*/
protected $_null = 'NULL';
// --------------------------------------------------------------------
/**
* Create database
*
* @param string $db_name
* @return string
*/
public function create_database($db_name)
{
// Firebird databases are flat files, so a path is required
// Hostname is needed for remote access
empty($this->db->hostname) OR $db_name = $this->hostname.':'.$db_name;
return parent::create_database('"'.$db_name.'"');
}
// --------------------------------------------------------------------
/**
* Drop database
*
* @param string $db_name (ignored)
* @return bool
*/
public function drop_database($db_name = '')
{
if ( ! ibase_drop_db($this->conn_id))
{
return ($this->db->db_debug) ? $this->db->display_error('db_unable_to_drop') : FALSE;
}
elseif ( ! empty($this->db->data_cache['db_names']))
{
$key = array_search(strtolower($this->db->database), array_map('strtolower', $this->db->data_cache['db_names']), TRUE);
if ($key !== FALSE)
{
unset($this->db->data_cache['db_names'][$key]);
}
}
return TRUE;
}
// --------------------------------------------------------------------
/**
* ALTER TABLE
*
* @param string $alter_type ALTER type
* @param string $table Table name
* @param mixed $field Column definition
* @return string|string[]
*/
protected function _alter_table($alter_type, $table, $field)
{
if (in_array($alter_type, array('DROP', 'ADD'), TRUE))
{
return parent::_alter_table($alter_type, $table, $field);
}
$sql = 'ALTER TABLE '.$this->db->escape_identifiers($table);
$sqls = array();
for ($i = 0, $c = count($field); $i < $c; $i++)
{
if ($field[$i]['_literal'] !== FALSE)
{
return FALSE;
}
if (isset($field[$i]['type']))
{
$sqls[] = $sql.' ALTER COLUMN '.$this->db->escape_identififers($field[$i]['name'])
.' TYPE '.$field[$i]['type'].$field[$i]['length'];
}
if ( ! empty($field[$i]['default']))
{
$sqls[] = $sql.' ALTER COLUMN '.$this->db->escape_identifiers($field[$i]['name'])
.' SET DEFAULT '.$field[$i]['default'];
}
if (isset($field[$i]['null']))
{
$sqls[] = 'UPDATE "RDB$RELATION_FIELDS" SET "RDB$NULL_FLAG" = '
.($field[$i]['null'] === TRUE ? 'NULL' : '1')
.' WHERE "RDB$FIELD_NAME" = '.$this->db->escape($field[$i]['name'])
.' AND "RDB$RELATION_NAME" = '.$this->db->escape($table);
}
if ( ! empty($field[$i]['new_name']))
{
$sqls[] = $sql.' ALTER COLUMN '.$this->db->escape_identifiers($field[$i]['name'])
.' TO '.$this->db->escape_identifiers($field[$i]['new_name']);
}
}
return $sqls;
}
// --------------------------------------------------------------------
/**
* Process column
*
* @param array $field
* @return string
*/
protected function _process_column($field)
{
return $this->db->escape_identifiers($field['name'])
.' '.$field['type'].$field['length']
.$field['null']
.$field['unique']
.$field['default'];
}
// --------------------------------------------------------------------
/**
* Field attribute TYPE
*
* Performs a data type mapping between different databases.
*
* @param array &$attributes
* @return void
*/
protected function _attr_type(&$attributes)
{
switch (strtoupper($attributes['TYPE']))
{
case 'TINYINT':
$attributes['TYPE'] = 'SMALLINT';
$attributes['UNSIGNED'] = FALSE;
return;
case 'MEDIUMINT':
$attributes['TYPE'] = 'INTEGER';
$attributes['UNSIGNED'] = FALSE;
return;
case 'INT':
$attributes['TYPE'] = 'INTEGER';
return;
case 'BIGINT':
$attributes['TYPE'] = 'INT64';
return;
default: return;
}
}
// --------------------------------------------------------------------
/**
* Field attribute AUTO_INCREMENT
*
* @param array &$attributes
* @param array &$field
* @return void
*/
protected function _attr_auto_increment(&$attributes, &$field)
{
// Not supported
}
}
| rafikurnia/university-projects | Internship at CRIM/AGVControlPanel/system/database/drivers/ibase/ibase_forge.php | PHP | mit | 6,471 |
'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": [
"AM",
"PM"
],
"DAY": [
"Linggo",
"Lunes",
"Martes",
"Miyerkules",
"Huwebes",
"Biyernes",
"Sabado"
],
"MONTH": [
"Enero",
"Pebrero",
"Marso",
"Abril",
"Mayo",
"Hunyo",
"Hulyo",
"Agosto",
"Setyembre",
"Oktubre",
"Nobyembre",
"Disyembre"
],
"SHORTDAY": [
"Lin",
"Lun",
"Mar",
"Miy",
"Huw",
"Biy",
"Sab"
],
"SHORTMONTH": [
"Ene",
"Peb",
"Mar",
"Abr",
"May",
"Hun",
"Hul",
"Ago",
"Set",
"Okt",
"Nob",
"Dis"
],
"fullDate": "EEEE, MMMM d, y",
"longDate": "MMMM d, y",
"medium": "MMM d, y h:mm:ss a",
"mediumDate": "MMM d, y",
"mediumTime": "h:mm:ss a",
"short": "M/d/yy h:mm a",
"shortDate": "M/d/yy",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20b1",
"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": "fil-ph",
"pluralCat": function (n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (vf.v == 0 && (i == 1 || i == 2 || i == 3) || vf.v == 0 && i % 10 != 4 && i % 10 != 6 && i % 10 != 9 || vf.v != 0 && vf.f % 10 != 4 && vf.f % 10 != 6 && vf.f % 10 != 9) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | hare1039/cdnjs | ajax/libs/angular-i18n/1.3.0-beta.18/angular-locale_fil-ph.js | JavaScript | mit | 2,478 |
'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": [
"dop.",
"pop."
],
"DAY": [
"nedelja",
"ponedeljek",
"torek",
"sreda",
"\u010detrtek",
"petek",
"sobota"
],
"MONTH": [
"januar",
"februar",
"marec",
"april",
"maj",
"junij",
"julij",
"avgust",
"september",
"oktober",
"november",
"december"
],
"SHORTDAY": [
"ned.",
"pon.",
"tor.",
"sre.",
"\u010det.",
"pet.",
"sob."
],
"SHORTMONTH": [
"jan.",
"feb.",
"mar.",
"apr.",
"maj",
"jun.",
"jul.",
"avg.",
"sep.",
"okt.",
"nov.",
"dec."
],
"fullDate": "EEEE, dd. MMMM y",
"longDate": "dd. MMMM y",
"medium": "d. MMM y HH.mm.ss",
"mediumDate": "d. MMM y",
"mediumTime": "HH.mm.ss",
"short": "d. MM. yy HH.mm",
"shortDate": "d. MM. yy",
"shortTime": "HH.mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"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": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "sl-si",
"pluralCat": function (n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (vf.v == 0 && i % 100 == 1) { return PLURAL_CATEGORY.ONE; } if (vf.v == 0 && i % 100 == 2) { return PLURAL_CATEGORY.TWO; } if (vf.v == 0 && i % 100 >= 3 && i % 100 <= 4 || vf.v != 0) { return PLURAL_CATEGORY.FEW; } return PLURAL_CATEGORY.OTHER;}
});
}]); | viskin/cdnjs | ajax/libs/angular-i18n/1.3.0-beta.11/angular-locale_sl-si.js | JavaScript | mit | 2,544 |
'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": [
"\u0635",
"\u0645"
],
"DAY": [
"\u0627\u0644\u0623\u062d\u062f",
"\u0627\u0644\u0627\u062b\u0646\u064a\u0646",
"\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621",
"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
"\u0627\u0644\u062e\u0645\u064a\u0633",
"\u0627\u0644\u062c\u0645\u0639\u0629",
"\u0627\u0644\u0633\u0628\u062a"
],
"MONTH": [
"\u064a\u0646\u0627\u064a\u0631",
"\u0641\u0628\u0631\u0627\u064a\u0631",
"\u0645\u0627\u0631\u0633",
"\u0623\u0628\u0631\u064a\u0644",
"\u0645\u0627\u064a\u0648",
"\u064a\u0648\u0646\u064a\u0648",
"\u064a\u0648\u0644\u064a\u0648",
"\u0623\u063a\u0633\u0637\u0633",
"\u0633\u0628\u062a\u0645\u0628\u0631",
"\u0623\u0643\u062a\u0648\u0628\u0631",
"\u0646\u0648\u0641\u0645\u0628\u0631",
"\u062f\u064a\u0633\u0645\u0628\u0631"
],
"SHORTDAY": [
"\u0627\u0644\u0623\u062d\u062f",
"\u0627\u0644\u0627\u062b\u0646\u064a\u0646",
"\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621",
"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
"\u0627\u0644\u062e\u0645\u064a\u0633",
"\u0627\u0644\u062c\u0645\u0639\u0629",
"\u0627\u0644\u0633\u0628\u062a"
],
"SHORTMONTH": [
"\u064a\u0646\u0627\u064a\u0631",
"\u0641\u0628\u0631\u0627\u064a\u0631",
"\u0645\u0627\u0631\u0633",
"\u0623\u0628\u0631\u064a\u0644",
"\u0645\u0627\u064a\u0648",
"\u064a\u0648\u0646\u064a\u0648",
"\u064a\u0648\u0644\u064a\u0648",
"\u0623\u063a\u0633\u0637\u0633",
"\u0633\u0628\u062a\u0645\u0628\u0631",
"\u0623\u0643\u062a\u0648\u0628\u0631",
"\u0646\u0648\u0641\u0645\u0628\u0631",
"\u062f\u064a\u0633\u0645\u0628\u0631"
],
"fullDate": "EEEE\u060c d MMMM\u060c y",
"longDate": "d MMMM\u060c y",
"medium": "dd\u200f/MM\u200f/y h:mm:ss a",
"mediumDate": "dd\u200f/MM\u200f/y",
"mediumTime": "h:mm:ss a",
"short": "d\u200f/M\u200f/y h:mm a",
"shortDate": "d\u200f/M\u200f/y",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u00a3",
"DECIMAL_SEP": "\u066b",
"GROUP_SEP": "\u066c",
"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\u00a0-",
"negSuf": "",
"posPre": "\u00a4\u00a0",
"posSuf": ""
}
]
},
"id": "ar-001",
"pluralCat": function (n, opt_precision) { if (n == 0) { return PLURAL_CATEGORY.ZERO; } if (n == 1) { return PLURAL_CATEGORY.ONE; } if (n == 2) { return PLURAL_CATEGORY.TWO; } if (n % 100 >= 3 && n % 100 <= 10) { return PLURAL_CATEGORY.FEW; } if (n % 100 >= 11 && n % 100 <= 99) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
});
}]); | blairvanderhoof/cdnjs | ajax/libs/angular.js/1.3.0-beta.11/i18n/angular-locale_ar-001.js | JavaScript | mit | 3,385 |
'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"
],
"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."
],
"fullDate": "EEEE, d 'de' MMMM 'de' y",
"longDate": "d 'de' MMMM 'de' y",
"medium": "d/M/y H:mm:ss",
"mediumDate": "d/M/y",
"mediumTime": "H:mm:ss",
"short": "d/MM/yy H:mm",
"shortDate": "d/MM/yy",
"shortTime": "H:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"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": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "es-pe",
"pluralCat": function (n, opt_precision) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | ruo91/cdnjs | ajax/libs/angular.js/1.3.0-beta.11/i18n/angular-locale_es-pe.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"};
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": [
"domingo",
"luns",
"martes",
"m\u00e9rcores",
"xoves",
"venres",
"s\u00e1bado"
],
"MONTH": [
"xaneiro",
"febreiro",
"marzo",
"abril",
"maio",
"xu\u00f1o",
"xullo",
"agosto",
"setembro",
"outubro",
"novembro",
"decembro"
],
"SHORTDAY": [
"dom",
"lun",
"mar",
"m\u00e9r",
"xov",
"ven",
"s\u00e1b"
],
"SHORTMONTH": [
"xan",
"feb",
"mar",
"abr",
"mai",
"xu\u00f1",
"xul",
"ago",
"set",
"out",
"nov",
"dec"
],
"fullDate": "EEEE dd MMMM y",
"longDate": "dd 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": ".",
"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": "gl",
"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;}
});
}]); | alexmojaki/cdnjs | ajax/libs/angular-i18n/1.3.0-rc.1/angular-locale_gl.js | JavaScript | mit | 2,353 |
'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": [
"\u09b0\u09ac\u09bf\u09ac\u09be\u09b0",
"\u09b8\u09cb\u09ae\u09ac\u09be\u09b0",
"\u09ae\u0999\u09cd\u0997\u09b2\u09ac\u09be\u09b0",
"\u09ac\u09c1\u09a7\u09ac\u09be\u09b0",
"\u09ac\u09c3\u09b9\u09b7\u09cd\u09aa\u09a4\u09bf\u09ac\u09be\u09b0",
"\u09b6\u09c1\u0995\u09cd\u09b0\u09ac\u09be\u09b0",
"\u09b6\u09a8\u09bf\u09ac\u09be\u09b0"
],
"MONTH": [
"\u099c\u09be\u09a8\u09c1\u09af\u09bc\u09be\u09b0\u09c0",
"\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1\u09af\u09bc\u09be\u09b0\u09c0",
"\u09ae\u09be\u09b0\u09cd\u099a",
"\u098f\u09aa\u09cd\u09b0\u09bf\u09b2",
"\u09ae\u09c7",
"\u099c\u09c1\u09a8",
"\u099c\u09c1\u09b2\u09be\u0987",
"\u0986\u0997\u09b8\u09cd\u099f",
"\u09b8\u09c7\u09aa\u09cd\u099f\u09c7\u09ae\u09cd\u09ac\u09b0",
"\u0985\u0995\u09cd\u099f\u09cb\u09ac\u09b0",
"\u09a8\u09ad\u09c7\u09ae\u09cd\u09ac\u09b0",
"\u09a1\u09bf\u09b8\u09c7\u09ae\u09cd\u09ac\u09b0"
],
"SHORTDAY": [
"\u09b0\u09ac\u09bf",
"\u09b8\u09cb\u09ae",
"\u09ae\u0999\u09cd\u0997\u09b2",
"\u09ac\u09c1\u09a7",
"\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf",
"\u09b6\u09c1\u0995\u09cd\u09b0",
"\u09b6\u09a8\u09bf"
],
"SHORTMONTH": [
"\u099c\u09be\u09a8\u09c1\u09af\u09bc\u09be\u09b0\u09c0",
"\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1\u09af\u09bc\u09be\u09b0\u09c0",
"\u09ae\u09be\u09b0\u09cd\u099a",
"\u098f\u09aa\u09cd\u09b0\u09bf\u09b2",
"\u09ae\u09c7",
"\u099c\u09c1\u09a8",
"\u099c\u09c1\u09b2\u09be\u0987",
"\u0986\u0997\u09b8\u09cd\u099f",
"\u09b8\u09c7\u09aa\u09cd\u099f\u09c7\u09ae\u09cd\u09ac\u09b0",
"\u0985\u0995\u09cd\u099f\u09cb\u09ac\u09b0",
"\u09a8\u09ad\u09c7\u09ae\u09cd\u09ac\u09b0",
"\u09a1\u09bf\u09b8\u09c7\u09ae\u09cd\u09ac\u09b0"
],
"fullDate": "EEEE, d MMMM, y",
"longDate": "d MMMM, y",
"medium": "d MMM, y h:mm:ss a",
"mediumDate": "d MMM, y",
"mediumTime": "h:mm:ss a",
"short": "d/M/yy h:mm a",
"shortDate": "d/M/yy",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u09f3",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 2,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 2,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a4",
"posPre": "",
"posSuf": "\u00a4"
}
]
},
"id": "bn",
"pluralCat": function (n, opt_precision) { var i = n | 0; if (i == 0 || n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | tjbp/cdnjs | ajax/libs/angular-i18n/1.3.0-rc.0/angular-locale_bn.js | JavaScript | mit | 3,199 |
'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": [
"am",
"pm"
],
"DAY": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"MONTH": [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
"SHORTDAY": [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
],
"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": "\u00a3",
"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": "en-gb",
"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;}
});
}]); | dhowe/cdnjs | ajax/libs/angular.js/1.3.0-beta.16/i18n/angular-locale_en-gb.js | JavaScript | mit | 2,324 |
'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": [
"AM",
"PM"
],
"DAY": [
"nede\u013ea",
"pondelok",
"utorok",
"streda",
"\u0161tvrtok",
"piatok",
"sobota"
],
"MONTH": [
"janu\u00e1ra",
"febru\u00e1ra",
"marca",
"apr\u00edla",
"m\u00e1ja",
"j\u00fana",
"j\u00fala",
"augusta",
"septembra",
"okt\u00f3bra",
"novembra",
"decembra"
],
"SHORTDAY": [
"ne",
"po",
"ut",
"st",
"\u0161t",
"pi",
"so"
],
"SHORTMONTH": [
"jan",
"feb",
"mar",
"apr",
"m\u00e1j",
"j\u00fan",
"j\u00fal",
"aug",
"sep",
"okt",
"nov",
"dec"
],
"fullDate": "EEEE, d. MMMM y",
"longDate": "d. MMMM y",
"medium": "d.M.y H:mm:ss",
"mediumDate": "d.M.y",
"mediumTime": "H:mm:ss",
"short": "d.M.y H:mm",
"shortDate": "d.M.y",
"shortTime": "H: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": "sk-sk",
"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 (i >= 2 && i <= 4 && vf.v == 0) { return PLURAL_CATEGORY.FEW; } if (vf.v != 0) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
});
}]); | redmunds/cdnjs | ajax/libs/angular.js/1.3.0-beta.19/i18n/angular-locale_sk-sk.js | JavaScript | mit | 2,512 |
'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": [
"priek\u0161pusdien\u0101",
"p\u0113cpusdien\u0101"
],
"DAY": [
"sv\u0113tdiena",
"pirmdiena",
"otrdiena",
"tre\u0161diena",
"ceturtdiena",
"piektdiena",
"sestdiena"
],
"MONTH": [
"janv\u0101ris",
"febru\u0101ris",
"marts",
"apr\u012blis",
"maijs",
"j\u016bnijs",
"j\u016blijs",
"augusts",
"septembris",
"oktobris",
"novembris",
"decembris"
],
"SHORTDAY": [
"Sv",
"Pr",
"Ot",
"Tr",
"Ce",
"Pk",
"Se"
],
"SHORTMONTH": [
"janv.",
"febr.",
"marts",
"apr.",
"maijs",
"j\u016bn.",
"j\u016bl.",
"aug.",
"sept.",
"okt.",
"nov.",
"dec."
],
"fullDate": "EEEE, y. 'gada' d. MMMM",
"longDate": "y. 'gada' d. MMMM",
"medium": "y. 'gada' d. MMM HH:mm:ss",
"mediumDate": "y. 'gada' d. MMM",
"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": "\u00a4-",
"negSuf": "",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "lv-lv",
"pluralCat": function (n, opt_precision) { var vf = getVF(n, opt_precision); if (n % 10 == 0 || n % 100 >= 11 && n % 100 <= 19 || vf.v == 2 && vf.f % 100 >= 11 && vf.f % 100 <= 19) { return PLURAL_CATEGORY.ZERO; } if (n % 10 == 1 && n % 100 != 11 || vf.v == 2 && vf.f % 10 == 1 && vf.f % 100 != 11 || vf.v != 2 && vf.f % 10 == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | itvsai/cdnjs | ajax/libs/angular-i18n/1.3.0-beta.12/angular-locale_lv-lv.js | JavaScript | mit | 2,710 |
'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": [
"\u0635",
"\u0645"
],
"DAY": [
"\u0627\u0644\u0623\u062d\u062f",
"\u0627\u0644\u0627\u062b\u0646\u064a\u0646",
"\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621",
"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
"\u0627\u0644\u062e\u0645\u064a\u0633",
"\u0627\u0644\u062c\u0645\u0639\u0629",
"\u0627\u0644\u0633\u0628\u062a"
],
"MONTH": [
"\u064a\u0646\u0627\u064a\u0631",
"\u0641\u0628\u0631\u0627\u064a\u0631",
"\u0645\u0627\u0631\u0633",
"\u0623\u0628\u0631\u064a\u0644",
"\u0645\u0627\u064a\u0648",
"\u064a\u0648\u0646\u064a\u0648",
"\u064a\u0648\u0644\u064a\u0648",
"\u0623\u063a\u0633\u0637\u0633",
"\u0633\u0628\u062a\u0645\u0628\u0631",
"\u0623\u0643\u062a\u0648\u0628\u0631",
"\u0646\u0648\u0641\u0645\u0628\u0631",
"\u062f\u064a\u0633\u0645\u0628\u0631"
],
"SHORTDAY": [
"\u0627\u0644\u0623\u062d\u062f",
"\u0627\u0644\u0627\u062b\u0646\u064a\u0646",
"\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621",
"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
"\u0627\u0644\u062e\u0645\u064a\u0633",
"\u0627\u0644\u062c\u0645\u0639\u0629",
"\u0627\u0644\u0633\u0628\u062a"
],
"SHORTMONTH": [
"\u064a\u0646\u0627\u064a\u0631",
"\u0641\u0628\u0631\u0627\u064a\u0631",
"\u0645\u0627\u0631\u0633",
"\u0623\u0628\u0631\u064a\u0644",
"\u0645\u0627\u064a\u0648",
"\u064a\u0648\u0646\u064a\u0648",
"\u064a\u0648\u0644\u064a\u0648",
"\u0623\u063a\u0633\u0637\u0633",
"\u0633\u0628\u062a\u0645\u0628\u0631",
"\u0623\u0643\u062a\u0648\u0628\u0631",
"\u0646\u0648\u0641\u0645\u0628\u0631",
"\u062f\u064a\u0633\u0645\u0628\u0631"
],
"fullDate": "EEEE\u060c d MMMM\u060c y",
"longDate": "d MMMM\u060c y",
"medium": "dd\u200f/MM\u200f/y h:mm:ss a",
"mediumDate": "dd\u200f/MM\u200f/y",
"mediumTime": "h:mm:ss a",
"short": "d\u200f/M\u200f/y h:mm a",
"shortDate": "d\u200f/M\u200f/y",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u00a3",
"DECIMAL_SEP": "\u066b",
"GROUP_SEP": "\u066c",
"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\u00a0-",
"negSuf": "",
"posPre": "\u00a4\u00a0",
"posSuf": ""
}
]
},
"id": "ar-001",
"pluralCat": function (n, opt_precision) { if (n == 0) { return PLURAL_CATEGORY.ZERO; } if (n == 1) { return PLURAL_CATEGORY.ONE; } if (n == 2) { return PLURAL_CATEGORY.TWO; } if (n % 100 >= 3 && n % 100 <= 10) { return PLURAL_CATEGORY.FEW; } if (n % 100 >= 11 && n % 100 <= 99) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
});
}]); | dakshshah96/cdnjs | ajax/libs/angular-i18n/1.3.0-beta.17/angular-locale_ar-001.js | JavaScript | mit | 3,385 |
'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": [
"AM",
"PM"
],
"DAY": [
"Jumapili",
"Jumatatu",
"Jumanne",
"Jumatano",
"Alhamisi",
"Ijumaa",
"Jumamosi"
],
"MONTH": [
"Januari",
"Februari",
"Machi",
"Aprili",
"Mei",
"Juni",
"Julai",
"Agosti",
"Septemba",
"Oktoba",
"Novemba",
"Desemba"
],
"SHORTDAY": [
"Jumapili",
"Jumatatu",
"Jumanne",
"Jumatano",
"Alhamisi",
"Ijumaa",
"Jumamosi"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mac",
"Apr",
"Mei",
"Jun",
"Jul",
"Ago",
"Sep",
"Okt",
"Nov",
"Des"
],
"fullDate": "EEEE, d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y h:mm:ss a",
"mediumDate": "d MMM y",
"mediumTime": "h:mm:ss a",
"short": "dd/MM/y h:mm a",
"shortDate": "dd/MM/y",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "TSh",
"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": "sw-tz",
"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;}
});
}]); | jessepollak/cdnjs | ajax/libs/angular.js/1.3.0-beta.13/i18n/angular-locale_sw-tz.js | JavaScript | mit | 2,358 |
'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": [
"AM",
"PM"
],
"DAY": [
"nedjelja",
"ponedjeljak",
"utorak",
"srijeda",
"\u010detvrtak",
"petak",
"subota"
],
"MONTH": [
"sije\u010dnja",
"velja\u010de",
"o\u017eujka",
"travnja",
"svibnja",
"lipnja",
"srpnja",
"kolovoza",
"rujna",
"listopada",
"studenoga",
"prosinca"
],
"SHORTDAY": [
"ned",
"pon",
"uto",
"sri",
"\u010det",
"pet",
"sub"
],
"SHORTMONTH": [
"sij",
"velj",
"o\u017eu",
"tra",
"svi",
"lip",
"srp",
"kol",
"ruj",
"lis",
"stu",
"pro"
],
"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": "d.M.yy. HH:mm",
"shortDate": "d.M.yy.",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "kn",
"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": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "hr",
"pluralCat": function (n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (vf.v == 0 && i % 10 == 1 && i % 100 != 11 || vf.f % 10 == 1 && vf.f % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14) || vf.f % 10 >= 2 && vf.f % 10 <= 4 && (vf.f % 100 < 12 || vf.f % 100 > 14)) { return PLURAL_CATEGORY.FEW; } return PLURAL_CATEGORY.OTHER;}
});
}]); | sufuf3/cdnjs | ajax/libs/angular.js/1.3.0-beta.17/i18n/angular-locale_hr.js | JavaScript | mit | 2,633 |
'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": [
"AM",
"PM"
],
"DAY": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"MONTH": [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
"SHORTDAY": [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
],
"fullDate": "EEEE dd MMMM y",
"longDate": "dd MMMM y",
"medium": "dd-MMM-y HH:mm:ss",
"mediumDate": "dd-MMM-y",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/yy HH:mm",
"shortDate": "dd/MM/yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "$",
"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": "en-bz",
"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;}
});
}]); | ddeveloperr/cdnjs | ajax/libs/angular.js/1.3.0-beta.16/i18n/angular-locale_en-bz.js | JavaScript | mit | 2,324 |
'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": [
"AM",
"PM"
],
"DAY": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"MONTH": [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
"SHORTDAY": [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
],
"fullDate": "EEEE, MMMM d, y",
"longDate": "MMMM d, y",
"medium": "MMM d, y h:mm:ss a",
"mediumDate": "MMM d, y",
"mediumTime": "h:mm:ss a",
"short": "M/d/yy h:mm a",
"shortDate": "M/d/yy",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "$",
"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": "en-us",
"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;}
});
}]); | ankitjamuar/cdnjs | ajax/libs/angular.js/1.3.0-beta.12/i18n/angular-locale_en-us.js | JavaScript | mit | 2,325 |
'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": [
"AM",
"PM"
],
"DAY": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"MONTH": [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
"SHORTDAY": [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
],
"fullDate": "EEEE, MMMM d, y",
"longDate": "MMMM d, y",
"medium": "MMM d, y h:mm:ss a",
"mediumDate": "MMM d, y",
"mediumTime": "h:mm:ss a",
"short": "M/d/yy h:mm a",
"shortDate": "M/d/yy",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "$",
"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": "en-tt",
"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;}
});
}]); | skidding/cdnjs | ajax/libs/angular.js/1.3.0-beta.16/i18n/angular-locale_en-tt.js | JavaScript | mit | 2,325 |
'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": [
"AM",
"PM"
],
"DAY": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"MONTH": [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
"SHORTDAY": [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
],
"fullDate": "EEEE, y MMMM dd",
"longDate": "y MMMM d",
"medium": "y MMM d HH:mm:ss",
"mediumDate": "y MMM d",
"mediumTime": "HH:mm:ss",
"short": "yyyy-MM-dd HH:mm",
"shortDate": "yyyy-MM-dd",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "$",
"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": "en-iso",
"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;}
});
}]); | ericelliott/cdnjs | ajax/libs/angular.js/1.3.0-beta.12/i18n/angular-locale_en-iso.js | JavaScript | mit | 2,327 |
/**
* jPicker 1.1.6 modified for webshims
*
* jQuery Plugin for Photoshop style color picker
*
* Copyright (c) 2010 Christopher T. Tillman
* Digital Magic Productions, Inc. (http://www.digitalmagicpro.com/)
* MIT style license, FREE to use, alter, copy, sell, and especially ENHANCE
*
* Painstakingly ported from John Dyers' excellent work on his own color picker based on the Prototype framework.
*
* John Dyers' website: (http://johndyer.name)
* Color Picker page: (http://johndyer.name/post/2007/09/PhotoShop-like-JavaScript-Color-Picker.aspx)
*
*/
(function ($, version) {
"use strict";
if(!window.Modernizr || !('opacity' in Modernizr) || !('csstransitions' in Modernizr)){
$('html').addClass(('opacity' in document.documentElement.style) ? 'opacity' : 'no-opacity');
}
var mPrecision = function (value, precision) {
if (precision === undefined) precision = 0;
return Math.round(value * Math.pow(10, precision)) / Math.pow(10, precision);
};
var elemExtend = function (deep, elem, data) {
var ex = elem;
if (elem.nodeType) {
ex = $.data(elem, 'wsjPicker') || $.data(elem, 'wsjPicker', {});
}
if(deep){
$.extend(true, ex, data);
} else {
$.extend(ex, data);
}
};
var Slider = // encapsulate slider functionality for the ColorMap and ColorBar - could be useful to use a jQuery UI draggable for this with certain extensions
function (bar, options) {
var $this = this, // private properties, methods, and events - keep these variables and classes invisible to outside code
arrow = bar.find('img').eq(0), // the arrow image to drag
minX = 0,
maxX = 100,
rangeX = 100,
minY = 0,
maxY = 100,
rangeY = 100,
x = 0,
y = 0,
offset,
timeout,
changeEvents = new Array(),
fireChangeEvents = function (context) {
for (var i = 0; i < changeEvents.length; i++) changeEvents[i].call($this, $this, context);
},
mouseDown = // bind the mousedown to the bar not the arrow for quick snapping to the clicked location
function (e) {
var off = bar.offset();
offset = {
l: off.left | 0,
t: off.top | 0
};
clearTimeout(timeout);
timeout = setTimeout( // using setTimeout for visual updates - once the style is updated the browser will re-render internally allowing the next Javascript to run
function () {
setValuesFromMousePosition.call($this, e);
}, 0);
// Bind mousemove and mouseup event to the document so it responds when dragged of of the bar - we will unbind these when on mouseup to save processing
$(document).on('mousemove', mouseMove).on('mouseup', mouseUp);
e.preventDefault(); // don't try to select anything or drag the image to the desktop
},
mouseMove = // set the values as the mouse moves
function (e) {
clearTimeout(timeout);
timeout = setTimeout(function () {
setValuesFromMousePosition.call($this, e);
}, 0);
e.stopPropagation();
e.preventDefault();
return false;
},
mouseUp = // unbind the document events - they aren't needed when not dragging
function (e) {
$(document).off('mouseup', mouseUp).off('mousemove', mouseMove);
e.stopPropagation();
e.preventDefault();
return false;
},
setValuesFromMousePosition = // calculate mouse position and set value within the current range
function (e) {
var locX = e.pageX - offset.l,
locY = e.pageY - offset.t,
barW = bar.w, // local copies for YUI compressor
barH = bar.h;
// keep the arrow within the bounds of the bar
if (locX < 0) locX = 0;
else if (locX > barW) locX = barW;
if (locY < 0) locY = 0;
else if (locY > barH) locY = barH;
val.call($this, 'xy', {
x: ((locX / barW) * rangeX) + minX,
y: ((locY / barH) * rangeY) + minY
});
},
drawTimeout,
draw = function () {
var arrowOffsetX = 0,
arrowOffsetY = 0,
barW = bar.w,
barH = bar.h,
arrowW = arrow.w,
arrowH = arrow.h;
clearTimeout(drawTimeout);
drawTimeout = setTimeout(function () {
if (rangeX > 0) // range is greater than zero
{
// constrain to bounds
if (x == maxX) arrowOffsetX = barW;
else arrowOffsetX = ((x / rangeX) * barW) | 0;
}
if (rangeY > 0) // range is greater than zero
{
// constrain to bounds
if (y == maxY) arrowOffsetY = barH;
else arrowOffsetY = ((y / rangeY) * barH) | 0;
}
// if arrow width is greater than bar width, center arrow and prevent horizontal dragging
if (arrowW >= barW) arrowOffsetX = (barW >> 1) - (arrowW >> 1); // number >> 1 - superfast bitwise divide by two and truncate (move bits over one bit discarding lowest)
else arrowOffsetX -= arrowW >> 1;
// if arrow height is greater than bar height, center arrow and prevent vertical dragging
if (arrowH >= barH) arrowOffsetY = (barH >> 1) - (arrowH >> 1);
else arrowOffsetY -= arrowH >> 1;
// set the arrow position based on these offsets
arrow.css({
left: arrowOffsetX + 'px',
top: arrowOffsetY + 'px'
});
}, 0);
},
val = function (name, value, context) {
var set = value !== undefined;
if (!set) {
if (name === undefined || name == null) name = 'xy';
switch (name.toLowerCase()) {
case 'x':
return x;
case 'y':
return y;
case 'xy':
default:
return {
x: x,
y: y
};
}
}
if (context != null && context == $this) return;
var changed = false,
newX,
newY;
if (name == null) name = 'xy';
switch (name.toLowerCase()) {
case 'x':
newX = value && (value.x && value.x | 0 || value | 0) || 0;
break;
case 'y':
newY = value && (value.y && value.y | 0 || value | 0) || 0;
break;
case 'xy':
default:
newX = value && value.x && value.x | 0 || 0;
newY = value && value.y && value.y | 0 || 0;
break;
}
if (newX != null) {
if (newX < minX) newX = minX;
else if (newX > maxX) newX = maxX;
if (x != newX) {
x = newX;
changed = true;
}
}
if (newY != null) {
if (newY < minY) newY = minY;
else if (newY > maxY) newY = maxY;
if (y != newY) {
y = newY;
changed = true;
}
}
changed && fireChangeEvents.call($this, context || $this);
},
range = function (name, value) {
var set = value !== undefined;
if (!set) {
if (name === undefined || name == null) name = 'all';
switch (name.toLowerCase()) {
case 'minx':
return minX;
case 'maxx':
return maxX;
case 'rangex':
return {
minX: minX,
maxX: maxX,
rangeX: rangeX
};
case 'miny':
return minY;
case 'maxy':
return maxY;
case 'rangey':
return {
minY: minY,
maxY: maxY,
rangeY: rangeY
};
case 'all':
default:
return {
minX: minX,
maxX: maxX,
rangeX: rangeX,
minY: minY,
maxY: maxY,
rangeY: rangeY
};
}
}
var changed = false,
newMinX,
newMaxX,
newMinY,
newMaxY;
if (name == null) name = 'all';
switch (name.toLowerCase()) {
case 'minx':
newMinX = value && (value.minX && value.minX | 0 || value | 0) || 0;
break;
case 'maxx':
newMaxX = value && (value.maxX && value.maxX | 0 || value | 0) || 0;
break;
case 'rangex':
newMinX = value && value.minX && value.minX | 0 || 0;
newMaxX = value && value.maxX && value.maxX | 0 || 0;
break;
case 'miny':
newMinY = value && (value.minY && value.minY | 0 || value | 0) || 0;
break;
case 'maxy':
newMaxY = value && (value.maxY && value.maxY | 0 || value | 0) || 0;
break;
case 'rangey':
newMinY = value && value.minY && value.minY | 0 || 0;
newMaxY = value && value.maxY && value.maxY | 0 || 0;
break;
case 'all':
default:
newMinX = value && value.minX && value.minX | 0 || 0;
newMaxX = value && value.maxX && value.maxX | 0 || 0;
newMinY = value && value.minY && value.minY | 0 || 0;
newMaxY = value && value.maxY && value.maxY | 0 || 0;
break;
}
if (newMinX != null && minX != newMinX) {
minX = newMinX;
rangeX = maxX - minX;
}
if (newMaxX != null && maxX != newMaxX) {
maxX = newMaxX;
rangeX = maxX - minX;
}
if (newMinY != null && minY != newMinY) {
minY = newMinY;
rangeY = maxY - minY;
}
if (newMaxY != null && maxY != newMaxY) {
maxY = newMaxY;
rangeY = maxY - minY;
}
},
bind = function (callback) {
if ($.isFunction(callback)) changeEvents.push(callback);
},
unbind = function (callback) {
if (!$.isFunction(callback)) return;
var i;
while ((i = $.inArray(callback, changeEvents)) != -1) changeEvents.splice(i, 1);
},
destroy = function () {
// unbind all possible events and null objects
$(document).off('mouseup', mouseUp).off('mousemove', mouseMove);
bar.off('mousedown', mouseDown);
bar = null;
arrow = null;
changeEvents = null;
};
$.extend(true, $this, // public properties, methods, and event bindings - these we need to access from other controls
{
val: val,
range: range,
bind: bind,
unbind: unbind,
destroy: destroy
});
// initialize this control
arrow.src = options.arrow && options.arrow.image;
arrow.w = options.arrow && options.arrow.width || arrow.width();
arrow.h = options.arrow && options.arrow.height || arrow.height();
bar.w = options.map && options.map.width || bar.width();
bar.h = options.map && options.map.height || bar.height();
// bind mousedown event
bar.on('mousedown', mouseDown);
bind.call($this, draw);
},
ColorValuePicker = // controls for all the input elements for the typing in color values
function (picker, color, bindedHex, alphaPrecision) {
var $this = this, // private properties and methods
inputs = picker.find('td.Text input'),
red = inputs.eq(3),
green = inputs.eq(4),
blue = inputs.eq(5),
alpha = inputs.length > 7 ? inputs.eq(6) : null,
hue = inputs.eq(0),
saturation = inputs.eq(1),
value = inputs.eq(2),
hex = inputs.eq(inputs.length > 7 ? 7 : 6),
ahex = inputs.length > 7 ? inputs.eq(8) : null,
keyDown = // input box key down - use arrows to alter color
function (e) {
if (e.target.value == '' && e.target != hex.get(0) && (bindedHex != null && e.target != bindedHex.get(0) || bindedHex == null)) return;
if (!validateKey(e)) return e;
switch (e.target) {
case red.get(0):
switch (e.keyCode) {
case 38:
red.val(setValueInRange.call($this, (red.val() << 0) + 1, 0, 255));
color.val('r', red.val(), e.target);
return false;
case 40:
red.val(setValueInRange.call($this, (red.val() << 0) - 1, 0, 255));
color.val('r', red.val(), e.target);
return false;
}
break;
case green.get(0):
switch (e.keyCode) {
case 38:
green.val(setValueInRange.call($this, (green.val() << 0) + 1, 0, 255));
color.val('g', green.val(), e.target);
return false;
case 40:
green.val(setValueInRange.call($this, (green.val() << 0) - 1, 0, 255));
color.val('g', green.val(), e.target);
return false;
}
break;
case blue.get(0):
switch (e.keyCode) {
case 38:
blue.val(setValueInRange.call($this, (blue.val() << 0) + 1, 0, 255));
color.val('b', blue.val(), e.target);
return false;
case 40:
blue.val(setValueInRange.call($this, (blue.val() << 0) - 1, 0, 255));
color.val('b', blue.val(), e.target);
return false;
}
break;
case alpha && alpha.get(0):
switch (e.keyCode) {
case 38:
alpha.val(setValueInRange.call($this, parseFloat(alpha.val()) + 1, 0, 100));
color.val('a', mPrecision((alpha.val() * 255) / 100, alphaPrecision), e.target);
return false;
case 40:
alpha.val(setValueInRange.call($this, parseFloat(alpha.val()) - 1, 0, 100));
color.val('a', mPrecision((alpha.val() * 255) / 100, alphaPrecision), e.target);
return false;
}
break;
case hue.get(0):
switch (e.keyCode) {
case 38:
hue.val(setValueInRange.call($this, (hue.val() << 0) + 1, 0, 360));
color.val('h', hue.val(), e.target);
return false;
case 40:
hue.val(setValueInRange.call($this, (hue.val() << 0) - 1, 0, 360));
color.val('h', hue.val(), e.target);
return false;
}
break;
case saturation.get(0):
switch (e.keyCode) {
case 38:
saturation.val(setValueInRange.call($this, (saturation.val() << 0) + 1, 0, 100));
color.val('s', saturation.val(), e.target);
return false;
case 40:
saturation.val(setValueInRange.call($this, (saturation.val() << 0) - 1, 0, 100));
color.val('s', saturation.val(), e.target);
return false;
}
break;
case value.get(0):
switch (e.keyCode) {
case 38:
value.val(setValueInRange.call($this, (value.val() << 0) + 1, 0, 100));
color.val('v', value.val(), e.target);
return false;
case 40:
value.val(setValueInRange.call($this, (value.val() << 0) - 1, 0, 100));
color.val('v', value.val(), e.target);
return false;
}
break;
}
},
keyUp = // input box key up - validate value and set color
function (e) {
if (e.target.value == '' && e.target != hex.get(0) && (bindedHex != null && e.target != bindedHex.get(0) || bindedHex == null)) return;
if (!validateKey(e)) return e;
switch (e.target) {
case red.get(0):
red.val(setValueInRange.call($this, red.val(), 0, 255));
color.val('r', red.val(), e.target);
break;
case green.get(0):
green.val(setValueInRange.call($this, green.val(), 0, 255));
color.val('g', green.val(), e.target);
break;
case blue.get(0):
blue.val(setValueInRange.call($this, blue.val(), 0, 255));
color.val('b', blue.val(), e.target);
break;
case alpha && alpha.get(0):
alpha.val(setValueInRange.call($this, alpha.val(), 0, 100));
color.val('a', mPrecision((alpha.val() * 255) / 100, alphaPrecision), e.target);
break;
case hue.get(0):
hue.val(setValueInRange.call($this, hue.val(), 0, 360));
color.val('h', hue.val(), e.target);
break;
case saturation.get(0):
saturation.val(setValueInRange.call($this, saturation.val(), 0, 100));
color.val('s', saturation.val(), e.target);
break;
case value.get(0):
value.val(setValueInRange.call($this, value.val(), 0, 100));
color.val('v', value.val(), e.target);
break;
case hex.get(0):
hex.val(hex.val().replace(/[^a-fA-F0-9]/g, '').toLowerCase().substring(0, 6));
bindedHex && bindedHex.val(hex.val());
color.val('hex', hex.val() != '' ? hex.val() : null, e.target);
break;
case bindedHex && bindedHex.get(0):
bindedHex.val(bindedHex.val().replace(/[^a-fA-F0-9]/g, '').toLowerCase().substring(0, 6));
hex.val(bindedHex.val());
color.val('hex', bindedHex.val() != '' ? bindedHex.val() : null, e.target);
break;
case ahex && ahex.get(0):
ahex.val(ahex.val().replace(/[^a-fA-F0-9]/g, '').toLowerCase().substring(0, 2));
color.val('a', ahex.val() != null ? parseInt(ahex.val(), 16) : null, e.target);
break;
}
},
blur = // input box blur - reset to original if value empty
function (e) {
if (color.val() != null) {
switch (e.target) {
case red.get(0):
red.val(color.val('r'));
break;
case green.get(0):
green.val(color.val('g'));
break;
case blue.get(0):
blue.val(color.val('b'));
break;
case alpha && alpha.get(0):
alpha.val(mPrecision((color.val('a') * 100) / 255, alphaPrecision));
break;
case hue.get(0):
hue.val(color.val('h'));
break;
case saturation.get(0):
saturation.val(color.val('s'));
break;
case value.get(0):
value.val(color.val('v'));
break;
case hex.get(0):
case bindedHex && bindedHex.get(0):
hex.val(color.val('hex'));
bindedHex && bindedHex.val(color.val('hex'));
break;
case ahex && ahex.get(0):
ahex.val(color.val('ahex').substring(6));
break;
}
}
},
validateKey = // validate key
function (e) {
switch (e.keyCode) {
case 9:
case 16:
case 29:
case 37:
case 39:
return false;
case 'c'.charCodeAt():
case 'v'.charCodeAt():
if (e.ctrlKey) return false;
}
return true;
},
setValueInRange = // constrain value within range
function (value, min, max) {
if (value == '' || isNaN(value)) return min;
if (value > max) return max;
if (value < min) return min;
return value;
},
colorChanged = function (ui, context) {
var all = ui.val('all');
if (context != red.get(0)) red.val(all != null ? all.r : '');
if (context != green.get(0)) green.val(all != null ? all.g : '');
if (context != blue.get(0)) blue.val(all != null ? all.b : '');
if (alpha && context != alpha.get(0)) alpha.val(all != null ? mPrecision((all.a * 100) / 255, alphaPrecision) : '');
if (context != hue.get(0)) hue.val(all != null ? all.h : '');
if (context != saturation.get(0)) saturation.val(all != null ? all.s : '');
if (context != value.get(0)) value.val(all != null ? all.v : '');
if (context != hex.get(0) && (bindedHex && context != bindedHex.get(0) || !bindedHex)) hex.val(all != null ? all.hex : '');
if (bindedHex && context != bindedHex.get(0) && context != hex.get(0)) bindedHex.val(all != null ? all.hex : '');
if (ahex && context != ahex.get(0)) ahex.val(all != null ? all.ahex.substring(6) : '');
},
destroy = function () {
// unbind all events and null objects
red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).add(hex).add(bindedHex).add(ahex).off('keyup', keyUp).off('blur', blur);
red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).off('keydown', keyDown);
color.off(colorChanged);
red = null;
green = null;
blue = null;
alpha = null;
hue = null;
saturation = null;
value = null;
hex = null;
ahex = null;
};
elemExtend(true, $this, // public properties and methods
{
destroy: destroy
});
red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).add(hex).add(bindedHex).add(ahex).on('keyup', keyUp).on('blur', blur);
red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).on('keydown', keyDown);
color.bind(colorChanged);
};
$.wsjPicker = {
List: [], // array holding references to each active instance of the control
Color: // color object - we will be able to assign by any color space type or retrieve any color space info
// we want this public so we can optionally assign new color objects to initial values using inputs other than a string hex value (also supported)
function (init) {
var $this = this,
r,
g,
b,
a,
h,
s,
v,
changeEvents = new Array(),
fireChangeEvents = function (context) {
for (var i = 0; i < changeEvents.length; i++) changeEvents[i].call($this, $this, context);
},
val = function (name, value, context) {
var set = value !== undefined;
if (!set) {
if (name === undefined || name == null || name == '') name = 'all';
if (r == null) return null;
switch (name.toLowerCase()) {
case 'ahex':
return ColorMethods.rgbaToHex({
r: r,
g: g,
b: b,
a: a
});
case 'hex':
return val('ahex').substring(0, 6);
case 'all':
return {
r: r,
g: g,
b: b,
a: a,
h: h,
s: s,
v: v,
hex: val.call($this, 'hex'),
ahex: val.call($this, 'ahex')
};
default:
var ret = {};
for (var i = 0; i < name.length; i++) {
switch (name.charAt(i)) {
case 'r':
if (name.length == 1) ret = r;
else ret.r = r;
break;
case 'g':
if (name.length == 1) ret = g;
else ret.g = g;
break;
case 'b':
if (name.length == 1) ret = b;
else ret.b = b;
break;
case 'a':
if (name.length == 1) ret = a;
else ret.a = a;
break;
case 'h':
if (name.length == 1) ret = h;
else ret.h = h;
break;
case 's':
if (name.length == 1) ret = s;
else ret.s = s;
break;
case 'v':
if (name.length == 1) ret = v;
else ret.v = v;
break;
}
}
return ret == {} ? val.call($this, 'all') : ret;
break;
}
}
if (context != null && context == $this) return;
var changed = false;
if (name == null) name = '';
if (value == null) {
if (r != null) {
r = null;
changed = true;
}
if (g != null) {
g = null;
changed = true;
}
if (b != null) {
b = null;
changed = true;
}
if (a != null) {
a = null;
changed = true;
}
if (h != null) {
h = null;
changed = true;
}
if (s != null) {
s = null;
changed = true;
}
if (v != null) {
v = null;
changed = true;
}
changed && fireChangeEvents.call($this, context || $this);
return;
}
switch (name.toLowerCase()) {
case 'ahex':
case 'hex':
var ret = ColorMethods.hexToRgba(value && (value.ahex || value.hex) || value || '00000000');
val.call($this, 'rgba', {
r: ret.r,
g: ret.g,
b: ret.b,
a: name == 'ahex' ? ret.a : a != null ? a : 255
}, context);
break;
default:
if (value && (value.ahex != null || value.hex != null)) {
val.call($this, 'ahex', value.ahex || value.hex || '00000000', context);
return;
}
var newV = {}, rgb = false,
hsv = false;
if (value.r !== undefined && !name.indexOf('r') == -1) name += 'r';
if (value.g !== undefined && !name.indexOf('g') == -1) name += 'g';
if (value.b !== undefined && !name.indexOf('b') == -1) name += 'b';
if (value.a !== undefined && !name.indexOf('a') == -1) name += 'a';
if (value.h !== undefined && !name.indexOf('h') == -1) name += 'h';
if (value.s !== undefined && !name.indexOf('s') == -1) name += 's';
if (value.v !== undefined && !name.indexOf('v') == -1) name += 'v';
for (var i = 0; i < name.length; i++) {
switch (name.charAt(i)) {
case 'r':
if (hsv) continue;
rgb = true;
newV.r = value && value.r && value.r | 0 || value && value | 0 || 0;
if (newV.r < 0) newV.r = 0;
else if (newV.r > 255) newV.r = 255;
if (r != newV.r) {
r = newV.r;
changed = true;
}
break;
case 'g':
if (hsv) continue;
rgb = true;
newV.g = value && value.g && value.g | 0 || value && value | 0 || 0;
if (newV.g < 0) newV.g = 0;
else if (newV.g > 255) newV.g = 255;
if (g != newV.g) {
g = newV.g;
changed = true;
}
break;
case 'b':
if (hsv) continue;
rgb = true;
newV.b = value && value.b && value.b | 0 || value && value | 0 || 0;
if (newV.b < 0) newV.b = 0;
else if (newV.b > 255) newV.b = 255;
if (b != newV.b) {
b = newV.b;
changed = true;
}
break;
case 'a':
newV.a = value && value.a != null ? value.a | 0 : value != null ? value | 0 : 255;
if (newV.a < 0) newV.a = 0;
else if (newV.a > 255) newV.a = 255;
if (a != newV.a) {
a = newV.a;
changed = true;
}
break;
case 'h':
if (rgb) continue;
hsv = true;
newV.h = value && value.h && value.h | 0 || value && value | 0 || 0;
if (newV.h < 0) newV.h = 0;
else if (newV.h > 360) newV.h = 360;
if (h != newV.h) {
h = newV.h;
changed = true;
}
break;
case 's':
if (rgb) continue;
hsv = true;
newV.s = value && value.s != null ? value.s | 0 : value != null ? value | 0 : 100;
if (newV.s < 0) newV.s = 0;
else if (newV.s > 100) newV.s = 100;
if (s != newV.s) {
s = newV.s;
changed = true;
}
break;
case 'v':
if (rgb) continue;
hsv = true;
newV.v = value && value.v != null ? value.v | 0 : value != null ? value | 0 : 100;
if (newV.v < 0) newV.v = 0;
else if (newV.v > 100) newV.v = 100;
if (v != newV.v) {
v = newV.v;
changed = true;
}
break;
}
}
if (changed) {
if (rgb) {
r = r || 0;
g = g || 0;
b = b || 0;
var ret = ColorMethods.rgbToHsv({
r: r,
g: g,
b: b
});
h = ret.h;
s = ret.s;
v = ret.v;
} else if (hsv) {
h = h || 0;
s = s != null ? s : 100;
v = v != null ? v : 100;
var ret = ColorMethods.hsvToRgb({
h: h,
s: s,
v: v
});
r = ret.r;
g = ret.g;
b = ret.b;
}
a = a != null ? a : 255;
fireChangeEvents.call($this, context || $this);
}
break;
}
},
bind = function (callback) {
if ($.isFunction(callback)) changeEvents.push(callback);
},
unbind = function (callback) {
if (!$.isFunction(callback)) return;
var i;
while ((i = $.inArray(callback, changeEvents)) != -1) changeEvents.splice(i, 1);
},
destroy = function () {
changeEvents = null;
}
elemExtend(true, $this, // public properties and methods
{
val: val,
bind: bind,
unbind: unbind,
destroy: destroy
});
if (init) {
if (init.ahex != null) val('ahex', init);
else if (init.hex != null) val((init.a != null ? 'a' : '') + 'hex', init.a != null ? {
ahex: init.hex + ColorMethods.intToHex(init.a)
} : init);
else if (init.r != null && init.g != null && init.b != null) val('rgb' + (init.a != null ? 'a' : ''), init);
else if (init.h != null && init.s != null && init.v != null) val('hsv' + (init.a != null ? 'a' : ''), init);
}
},
ColorMethods: // color conversion methods - make public to give use to external scripts
{
hexToRgba: function (hex) {
hex = this.validateHex(hex);
if (hex == '') return {
r: null,
g: null,
b: null,
a: null
};
var r = '00',
g = '00',
b = '00',
a = '255';
if (hex.length == 6) hex += 'ff';
if (hex.length > 6) {
r = hex.substring(0, 2);
g = hex.substring(2, 4);
b = hex.substring(4, 6);
a = hex.substring(6, hex.length);
} else {
if (hex.length > 4) {
r = hex.substring(4, hex.length);
hex = hex.substring(0, 4);
}
if (hex.length > 2) {
g = hex.substring(2, hex.length);
hex = hex.substring(0, 2);
}
if (hex.length > 0) b = hex.substring(0, hex.length);
}
return {
r: this.hexToInt(r),
g: this.hexToInt(g),
b: this.hexToInt(b),
a: this.hexToInt(a)
};
},
validateHex: function (hex) {
hex = hex.toLowerCase().replace(/[^a-f0-9]/g, '');
if (hex.length > 8) hex = hex.substring(0, 8);
return hex;
},
rgbaToHex: function (rgba) {
return this.intToHex(rgba.r) + this.intToHex(rgba.g) + this.intToHex(rgba.b) + this.intToHex(rgba.a);
},
intToHex: function (dec) {
var result = (dec | 0).toString(16);
if (result.length == 1) result = ('0' + result);
return result.toLowerCase();
},
hexToInt: function (hex) {
return parseInt(hex, 16);
},
rgbToHsv: function (rgb) {
var r = rgb.r / 255,
g = rgb.g / 255,
b = rgb.b / 255,
hsv = {
h: 0,
s: 0,
v: 0
}, min = 0,
max = 0,
delta;
if (r >= g && r >= b) {
max = r;
min = g > b ? b : g;
} else if (g >= b && g >= r) {
max = g;
min = r > b ? b : r;
} else {
max = b;
min = g > r ? r : g;
}
hsv.v = max;
hsv.s = max ? (max - min) / max : 0;
if (!hsv.s) hsv.h = 0;
else {
delta = max - min;
if (r == max) hsv.h = (g - b) / delta;
else if (g == max) hsv.h = 2 + (b - r) / delta;
else hsv.h = 4 + (r - g) / delta;
hsv.h = parseInt(hsv.h * 60);
if (hsv.h < 0) hsv.h += 360;
}
hsv.s = (hsv.s * 100) | 0;
hsv.v = (hsv.v * 100) | 0;
return hsv;
},
hsvToRgb: function (hsv) {
var rgb = {
r: 0,
g: 0,
b: 0,
a: 100
}, h = hsv.h,
s = hsv.s,
v = hsv.v;
if (s == 0) {
if (v == 0) rgb.r = rgb.g = rgb.b = 0;
else rgb.r = rgb.g = rgb.b = (v * 255 / 100) | 0;
} else {
if (h == 360) h = 0;
h /= 60;
s = s / 100;
v = v / 100;
var i = h | 0,
f = h - i,
p = v * (1 - s),
q = v * (1 - (s * f)),
t = v * (1 - (s * (1 - f)));
switch (i) {
case 0:
rgb.r = v;
rgb.g = t;
rgb.b = p;
break;
case 1:
rgb.r = q;
rgb.g = v;
rgb.b = p;
break;
case 2:
rgb.r = p;
rgb.g = v;
rgb.b = t;
break;
case 3:
rgb.r = p;
rgb.g = q;
rgb.b = v;
break;
case 4:
rgb.r = t;
rgb.g = p;
rgb.b = v;
break;
case 5:
rgb.r = v;
rgb.g = p;
rgb.b = q;
break;
}
rgb.r = (rgb.r * 255) | 0;
rgb.g = (rgb.g * 255) | 0;
rgb.b = (rgb.b * 255) | 0;
}
return rgb;
}
}
};
var Color = $.wsjPicker.Color,
List = $.wsjPicker.List,
ColorMethods = $.wsjPicker.ColorMethods; // local copies for YUI compressor
$.fn.wsjPicker = function (options) {
var $arguments = arguments;
return this.each(function () {
var $this = this,
settings = $.extend(true, {}, $.fn.wsjPicker.defaults, options); // local copies for YUI compressor
settings.window.liveUpdate = false; // Basic control binding for inline use - You will need to override the liveCallback or commitCallback function to retrieve results
var container = null,
colorMapDiv = null,
colorBarDiv = null,
colorMapL1 = null, // different layers of colorMap and colorBar
colorMapL2 = null,
colorMapL3 = null,
colorBarL1 = null,
colorBarL2 = null,
colorBarL3 = null,
colorBarL4 = null,
colorBarL5 = null,
colorBarL6 = null,
colorMap = null, // color maps
colorBar = null,
colorPicker = null,
elementStartX = null, // Used to record the starting css positions for dragging the control
elementStartY = null,
pageStartX = null, // Used to record the mousedown coordinates for dragging the control
pageStartY = null,
activePreview = null, // color boxes above the radio buttons
currentPreview = null,
okButton = null,
cancelButton = null,
grid = null, // preset colors grid
moveBar = null, // drag bar
setColorMode = // set color mode and update visuals for the new color mode
function (colorMode) {
var active = color.active, // local copies for YUI compressor
clientPath = images.clientPath,
hex = active.val('hex'),
rgbMap,
rgbBar;
settings.color.mode = colorMode;
switch (colorMode) {
case 'h':
setTimeout(function () {
setBG.call($this, colorMapDiv, 'transparent');
setImgLoc.call($this, colorMapL1, 0);
setAlpha.call($this, colorMapL1, 100);
setImgLoc.call($this, colorMapL2, 260);
setAlpha.call($this, colorMapL2, 100);
setBG.call($this, colorBarDiv, 'transparent');
setImgLoc.call($this, colorBarL1, 0);
setAlpha.call($this, colorBarL1, 100);
setImgLoc.call($this, colorBarL2, 260);
setAlpha.call($this, colorBarL2, 100);
setImgLoc.call($this, colorBarL3, 260);
setAlpha.call($this, colorBarL3, 100);
setImgLoc.call($this, colorBarL4, 260);
setAlpha.call($this, colorBarL4, 100);
setImgLoc.call($this, colorBarL6, 260);
setAlpha.call($this, colorBarL6, 100);
}, 0);
colorMap.range('all', {
minX: 0,
maxX: 100,
minY: 0,
maxY: 100
});
colorBar.range('rangeY', {
minY: 0,
maxY: 360
});
if (active.val('ahex') == null) break;
colorMap.val('xy', {
x: active.val('s'),
y: 100 - active.val('v')
}, colorMap);
colorBar.val('y', 360 - active.val('h'), colorBar);
break;
case 's':
setTimeout(function () {
setBG.call($this, colorMapDiv, 'transparent');
setImgLoc.call($this, colorMapL1, -260);
setImgLoc.call($this, colorMapL2, -520);
setImgLoc.call($this, colorBarL1, -260);
setImgLoc.call($this, colorBarL2, -520);
setImgLoc.call($this, colorBarL6, 260);
setAlpha.call($this, colorBarL6, 100);
}, 0);
colorMap.range('all', {
minX: 0,
maxX: 360,
minY: 0,
maxY: 100
});
colorBar.range('rangeY', {
minY: 0,
maxY: 100
});
if (active.val('ahex') == null) break;
colorMap.val('xy', {
x: active.val('h'),
y: 100 - active.val('v')
}, colorMap);
colorBar.val('y', 100 - active.val('s'), colorBar);
break;
case 'v':
setTimeout(function () {
setBG.call($this, colorMapDiv, '000000');
setImgLoc.call($this, colorMapL1, -780);
setImgLoc.call($this, colorMapL2, 260);
setBG.call($this, colorBarDiv, hex);
setImgLoc.call($this, colorBarL1, -520);
setImgLoc.call($this, colorBarL2, 260);
setAlpha.call($this, colorBarL2, 100);
setImgLoc.call($this, colorBarL6, 260);
setAlpha.call($this, colorBarL6, 100);
}, 0);
colorMap.range('all', {
minX: 0,
maxX: 360,
minY: 0,
maxY: 100
});
colorBar.range('rangeY', {
minY: 0,
maxY: 100
});
if (active.val('ahex') == null) break;
colorMap.val('xy', {
x: active.val('h'),
y: 100 - active.val('s')
}, colorMap);
colorBar.val('y', 100 - active.val('v'), colorBar);
break;
case 'r':
rgbMap = -1040;
rgbBar = -780;
colorMap.range('all', {
minX: 0,
maxX: 255,
minY: 0,
maxY: 255
});
colorBar.range('rangeY', {
minY: 0,
maxY: 255
});
if (active.val('ahex') == null) break;
colorMap.val('xy', {
x: active.val('b'),
y: 255 - active.val('g')
}, colorMap);
colorBar.val('y', 255 - active.val('r'), colorBar);
break;
case 'g':
rgbMap = -1560;
rgbBar = -1820;
colorMap.range('all', {
minX: 0,
maxX: 255,
minY: 0,
maxY: 255
});
colorBar.range('rangeY', {
minY: 0,
maxY: 255
});
if (active.val('ahex') == null) break;
colorMap.val('xy', {
x: active.val('b'),
y: 255 - active.val('r')
}, colorMap);
colorBar.val('y', 255 - active.val('g'), colorBar);
break;
case 'b':
rgbMap = -2080;
rgbBar = -2860;
colorMap.range('all', {
minX: 0,
maxX: 255,
minY: 0,
maxY: 255
});
colorBar.range('rangeY', {
minY: 0,
maxY: 255
});
if (active.val('ahex') == null) break;
colorMap.val('xy', {
x: active.val('r'),
y: 255 - active.val('g')
}, colorMap);
colorBar.val('y', 255 - active.val('b'), colorBar);
break;
case 'a':
setTimeout(function () {
setBG.call($this, colorMapDiv, 'transparent');
setImgLoc.call($this, colorMapL1, -260);
setImgLoc.call($this, colorMapL2, -520);
setImgLoc.call($this, colorBarL1, 260);
setImgLoc.call($this, colorBarL2, 260);
setAlpha.call($this, colorBarL2, 100);
setImgLoc.call($this, colorBarL6, 0);
setAlpha.call($this, colorBarL6, 100);
}, 0);
colorMap.range('all', {
minX: 0,
maxX: 360,
minY: 0,
maxY: 100
});
colorBar.range('rangeY', {
minY: 0,
maxY: 255
});
if (active.val('ahex') == null) break;
colorMap.val('xy', {
x: active.val('h'),
y: 100 - active.val('v')
}, colorMap);
colorBar.val('y', 255 - active.val('a'), colorBar);
break;
default:
throw ('Invalid Mode');
break;
}
switch (colorMode) {
case 'h':
break;
case 's':
case 'v':
case 'a':
setTimeout(function () {
setAlpha.call($this, colorMapL1, 100);
setAlpha.call($this, colorBarL1, 100);
setImgLoc.call($this, colorBarL3, 260);
setAlpha.call($this, colorBarL3, 100);
setImgLoc.call($this, colorBarL4, 260);
setAlpha.call($this, colorBarL4, 100);
}, 0);
break;
case 'r':
case 'g':
case 'b':
setTimeout(function () {
setBG.call($this, colorMapDiv, 'transparent');
setBG.call($this, colorBarDiv, 'transparent');
setAlpha.call($this, colorBarL1, 100);
setAlpha.call($this, colorMapL1, 100);
setImgLoc.call($this, colorMapL1, rgbMap);
setImgLoc.call($this, colorMapL2, rgbMap - 260);
setImgLoc.call($this, colorBarL1, rgbBar - 780);
setImgLoc.call($this, colorBarL2, rgbBar - 520);
setImgLoc.call($this, colorBarL3, rgbBar);
setImgLoc.call($this, colorBarL4, rgbBar - 260);
setImgLoc.call($this, colorBarL6, 260);
setAlpha.call($this, colorBarL6, 100);
}, 0);
break;
}
if (active.val('ahex') == null) return;
activeColorChanged.call($this, active);
},
activeColorChanged = // Update color when user changes text values
function (ui, context) {
if (context == null || (context != colorBar && context != colorMap)) positionMapAndBarArrows.call($this, ui, context);
setTimeout(function () {
updatePreview.call($this, ui);
updateMapVisuals.call($this, ui);
updateBarVisuals.call($this, ui);
}, 0);
},
mapValueChanged = // user has dragged the ColorMap pointer
function (ui, context) {
var active = color.active;
if (context != colorMap && active.val() == null) return;
var xy = ui.val('all');
switch (settings.color.mode) {
case 'h':
active.val('sv', {
s: xy.x,
v: 100 - xy.y
}, context);
break;
case 's':
case 'a':
active.val('hv', {
h: xy.x,
v: 100 - xy.y
}, context);
break;
case 'v':
active.val('hs', {
h: xy.x,
s: 100 - xy.y
}, context);
break;
case 'r':
active.val('gb', {
g: 255 - xy.y,
b: xy.x
}, context);
break;
case 'g':
active.val('rb', {
r: 255 - xy.y,
b: xy.x
}, context);
break;
case 'b':
active.val('rg', {
r: xy.x,
g: 255 - xy.y
}, context);
break;
}
},
colorBarValueChanged = // user has dragged the ColorBar slider
function (ui, context) {
var active = color.active;
if (context != colorBar && active.val() == null) return;
switch (settings.color.mode) {
case 'h':
active.val('h', {
h: 360 - ui.val('y')
}, context);
break;
case 's':
active.val('s', {
s: 100 - ui.val('y')
}, context);
break;
case 'v':
active.val('v', {
v: 100 - ui.val('y')
}, context);
break;
case 'r':
active.val('r', {
r: 255 - ui.val('y')
}, context);
break;
case 'g':
active.val('g', {
g: 255 - ui.val('y')
}, context);
break;
case 'b':
active.val('b', {
b: 255 - ui.val('y')
}, context);
break;
case 'a':
active.val('a', 255 - ui.val('y'), context);
break;
}
},
positionMapAndBarArrows = // position map and bar arrows to match current color
function (ui, context) {
if (context != colorMap) {
switch (settings.color.mode) {
case 'h':
var sv = ui.val('sv');
colorMap.val('xy', {
x: sv != null ? sv.s : 100,
y: 100 - (sv != null ? sv.v : 100)
}, context);
break;
case 's':
case 'a':
var hv = ui.val('hv');
colorMap.val('xy', {
x: hv && hv.h || 0,
y: 100 - (hv != null ? hv.v : 100)
}, context);
break;
case 'v':
var hs = ui.val('hs');
colorMap.val('xy', {
x: hs && hs.h || 0,
y: 100 - (hs != null ? hs.s : 100)
}, context);
break;
case 'r':
var bg = ui.val('bg');
colorMap.val('xy', {
x: bg && bg.b || 0,
y: 255 - (bg && bg.g || 0)
}, context);
break;
case 'g':
var br = ui.val('br');
colorMap.val('xy', {
x: br && br.b || 0,
y: 255 - (br && br.r || 0)
}, context);
break;
case 'b':
var rg = ui.val('rg');
colorMap.val('xy', {
x: rg && rg.r || 0,
y: 255 - (rg && rg.g || 0)
}, context);
break;
}
}
if (context != colorBar) {
switch (settings.color.mode) {
case 'h':
colorBar.val('y', 360 - (ui.val('h') || 0), context);
break;
case 's':
var s = ui.val('s');
colorBar.val('y', 100 - (s != null ? s : 100), context);
break;
case 'v':
var v = ui.val('v');
colorBar.val('y', 100 - (v != null ? v : 100), context);
break;
case 'r':
colorBar.val('y', 255 - (ui.val('r') || 0), context);
break;
case 'g':
colorBar.val('y', 255 - (ui.val('g') || 0), context);
break;
case 'b':
colorBar.val('y', 255 - (ui.val('b') || 0), context);
break;
case 'a':
var a = ui.val('a');
colorBar.val('y', 255 - (a != null ? a : 255), context);
break;
}
}
},
updatePreview = function (ui) {
try {
var all = ui.val('all');
activePreview.css({
backgroundColor: all && '#' + all.hex || 'transparent'
});
setAlpha.call($this, activePreview, all && mPrecision((all.a * 100) / 255, 4) || 0);
} catch (e) {}
},
updateMapVisuals = function (ui) {
switch (settings.color.mode) {
case 'h':
setBG.call($this, colorMapDiv, new Color({
h: ui.val('h') || 0,
s: 100,
v: 100
}).val('hex'));
break;
case 's':
case 'a':
var s = ui.val('s');
setAlpha.call($this, colorMapL2, 100 - (s != null ? s : 100));
break;
case 'v':
var v = ui.val('v');
setAlpha.call($this, colorMapL1, v != null ? v : 100);
break;
case 'r':
setAlpha.call($this, colorMapL2, mPrecision((ui.val('r') || 0) / 255 * 100, 4));
break;
case 'g':
setAlpha.call($this, colorMapL2, mPrecision((ui.val('g') || 0) / 255 * 100, 4));
break;
case 'b':
setAlpha.call($this, colorMapL2, mPrecision((ui.val('b') || 0) / 255 * 100));
break;
}
var a = ui.val('a');
setAlpha.call($this, colorMapL3, mPrecision(((255 - (a || 0)) * 100) / 255, 4));
},
updateBarVisuals = function (ui) {
switch (settings.color.mode) {
case 'h':
var a = ui.val('a');
setAlpha.call($this, colorBarL5, mPrecision(((255 - (a || 0)) * 100) / 255, 4));
break;
case 's':
var hva = ui.val('hva'),
saturatedColor = new Color({
h: hva && hva.h || 0,
s: 100,
v: hva != null ? hva.v : 100
});
setBG.call($this, colorBarDiv, saturatedColor.val('hex'));
setAlpha.call($this, colorBarL2, 100 - (hva != null ? hva.v : 100));
setAlpha.call($this, colorBarL5, mPrecision(((255 - (hva && hva.a || 0)) * 100) / 255, 4));
break;
case 'v':
var hsa = ui.val('hsa'),
valueColor = new Color({
h: hsa && hsa.h || 0,
s: hsa != null ? hsa.s : 100,
v: 100
});
setBG.call($this, colorBarDiv, valueColor.val('hex'));
setAlpha.call($this, colorBarL5, mPrecision(((255 - (hsa && hsa.a || 0)) * 100) / 255, 4));
break;
case 'r':
case 'g':
case 'b':
var hValue = 0,
vValue = 0,
rgba = ui.val('rgba');
if (settings.color.mode == 'r') {
hValue = rgba && rgba.b || 0;
vValue = rgba && rgba.g || 0;
} else if (settings.color.mode == 'g') {
hValue = rgba && rgba.b || 0;
vValue = rgba && rgba.r || 0;
} else if (settings.color.mode == 'b') {
hValue = rgba && rgba.r || 0;
vValue = rgba && rgba.g || 0;
}
var middle = vValue > hValue ? hValue : vValue;
setAlpha.call($this, colorBarL2, hValue > vValue ? mPrecision(((hValue - vValue) / (255 - vValue)) * 100, 4) : 0);
setAlpha.call($this, colorBarL3, vValue > hValue ? mPrecision(((vValue - hValue) / (255 - hValue)) * 100, 4) : 0);
setAlpha.call($this, colorBarL4, mPrecision((middle / 255) * 100, 4));
setAlpha.call($this, colorBarL5, mPrecision(((255 - (rgba && rgba.a || 0)) * 100) / 255, 4));
break;
case 'a':
var a = ui.val('a');
setBG.call($this, colorBarDiv, ui.val('hex') || '000000');
setAlpha.call($this, colorBarL5, a != null ? 0 : 100);
setAlpha.call($this, colorBarL6, a != null ? 100 : 0);
break;
}
},
setBG = function (el, c) {
el.css({
backgroundColor: c && c.length == 6 && '#' + c || 'transparent'
});
},
setImg = function (img, src) {
img.css({
backgroundImage: 'url(\'' + src + '\')'
});
},
setImgLoc = function (img, y) {
img.css({
top: y + 'px'
});
},
setAlpha = function (obj, alpha) {
obj.css({
visibility: alpha > 0 ? 'visible' : 'hidden'
});
if (alpha > 0 && alpha < 100) {
obj.css({
opacity: mPrecision(alpha / 100, 4)
});
} else if (alpha == 0 || alpha == 100) {
obj.css({
opacity: ''
});
}
},
revertColor = // revert color to original color when opened
function () {
color.active.val('ahex', color.current.val('ahex'));
},
commitColor = // commit the color changes
function () {
color.current.val('ahex', color.active.val('ahex'));
},
radioClicked = function (e) {
container.find('input[type="radio"]:not([value="' + e.target.value + '"])').prop('checked', false);
setColorMode.call($this, e.target.value);
},
currentClicked = function () {
revertColor.call($this);
},
cancelClicked = function () {
revertColor.call($this);
$.isFunction(cancelCallback) && cancelCallback.call($this, color.active, cancelButton);
},
okClicked = function () {
commitColor.call($this);
$.isFunction(commitCallback) && commitCallback.call($this, color.active, okButton);
},
currentColorChanged = function (ui, context) {
var hex = ui.val('hex');
currentPreview.css({
backgroundColor: hex && '#' + hex || 'transparent'
});
setAlpha.call($this, currentPreview, mPrecision(((ui.val('a') || 0) * 100) / 255, 4));
},
moveBarMouseDown = function (e) {
elementStartX = parseInt(container.css('left'), 10) || 0;
elementStartY = parseInt(container.css('top'), 10) || 0;
pageStartX = e.pageX;
pageStartY = e.pageY;
// bind events to document to move window - we will unbind these on mouseup
$(document).on('mousemove', documentMouseMove).on('mouseup', documentMouseUp);
e.preventDefault(); // prevent attempted dragging of the column
},
documentMouseMove = function (e) {
container.css({
left: elementStartX - (pageStartX - e.pageX) + 'px',
top: elementStartY - (pageStartY - e.pageY) + 'px'
});
return false;
},
documentMouseUp = function (e) {
$(document).off('mousemove', documentMouseMove).off('mouseup', documentMouseUp);
return false;
},
quickPickClicked = function (e) {
color.active.val('ahex', $(this).attr('title') || null, e.target);
return false;
},
commitCallback = $.isFunction($arguments[1]) && $arguments[1] || null,
liveCallback = $.isFunction($arguments[2]) && $arguments[2] || null,
cancelCallback = $.isFunction($arguments[3]) && $arguments[3] || null,
show = function () {
color.current.val('ahex', color.active.val('ahex'));
},
hide = function () {
},
initialize = function () {
var win = settings.window,
popup = null;
container = $($this);
container.addClass('jPicker Container');
container.get(0).onselectstart = function (event) {
if (event.target.nodeName.toLowerCase() !== 'input') return false;
};
// inject html source code - we are using a single table for this control - I know tables are considered bad, but it takes care of equal height columns and
// this control really is tabular data, so I believe it is the right move
var all = color.active.val('all');
if (win.alphaPrecision < 0) win.alphaPrecision = 0;
else if (win.alphaPrecision > 2) win.alphaPrecision = 2;
var controlHtml = '<table class="jPicker" cellpadding="0" cellspacing="0"><tbody><tr><td rowspan="9"><div class="Map"><span class="Map1"> </span><span class="Map2"> </span><span class="Map3"> </span><img src="' + images.clientPath + images.colorMap.arrow.file + '" class="Arrow"/></div></td><td rowspan="9"><div class="Bar"><span class="Map1"> </span><span class="Map2"> </span><span class="Map3"> </span><span class="Map4"> </span><span class="Map5"> </span><span class="Map6"> </span><img src="' + images.clientPath + images.colorBar.arrow.file + '" class="Arrow"/></div></td><td colspan="2" class="Preview">' + localization.text.newColor + '<div><span class="Active" title="' + localization.tooltips.colors.newColor + '"> </span><span class="Current" title="' + localization.tooltips.colors.currentColor + '"> </span></div>' + localization.text.currentColor + '</td><td rowspan="9" class="Button"><input type="button" class="Ok" value="' + localization.text.ok + '" title="' + localization.tooltips.buttons.ok + '"/><input type="button" class="Cancel" value="' + localization.text.cancel + '" title="' + localization.tooltips.buttons.cancel + '"/><hr/><div class="Grid"> </div></td></tr><tr class="Hue"><td class="Radio"><label><input type="radio" aria-label="' + localization.tooltips.hue.radio + '" class="hue-radio" value="h"' + (settings.color.mode == 'h' ? ' checked="checked"' : '') + '/>H:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null ? all.h : '') + '" title="' + localization.tooltips.hue.textbox + '"/> °</td></tr><tr class="Saturation"><td class="Radio"><label><input type="radio" aria-label="' + localization.tooltips.saturation.radio + '" value="s"' + (settings.color.mode == 's' ? ' checked="checked"' : '') + '/>S:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null ? all.s : '') + '" title="' + localization.tooltips.saturation.textbox + '"/> %</td></tr><tr class="Value"><td class="Radio"><label><input type="radio" aria-label="' + localization.tooltips.value.radio + '" value="v"' + (settings.color.mode == 'v' ? ' checked="checked"' : '') + '/>V:</label><br/><br/></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null ? all.v : '') + '" title="' + localization.tooltips.value.textbox + '"/> %<br/><br/></td></tr><tr class="Red"><td class="Radio"><label><input type="radio" aria-label="' + localization.tooltips.red.radio + '" value="r"' + (settings.color.mode == 'r' ? ' checked="checked"' : '') + '/>R:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null ? all.r : '') + '" title="' + localization.tooltips.red.textbox + '"/></td></tr><tr class="Green"><td class="Radio"><label><input type="radio" title="' + localization.tooltips.green.radio + '" value="g"' + (settings.color.mode == 'g' ? ' checked="checked"' : '') + '/>G:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null ? all.g : '') + '" title="' + localization.tooltips.green.textbox + '"/></td></tr><tr class="Blue"><td class="Radio"><label><input type="radio" aria-label="' + localization.tooltips.blue.radio + '" value="b"' + (settings.color.mode == 'b' ? ' checked="checked"' : '') + '/>B:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null ? all.b : '') + '" title="' + localization.tooltips.blue.textbox + '"/></td></tr><tr class="Alpha"><td class="Radio"><label><input aria-label="' + localization.tooltips.alpha.radio + '" class="alpha-radio" type="radio" value="a"' + (settings.color.mode == 'a' ? ' checked="checked"' : '') + '/>A:</label></td><td class="Text"><input type="text" maxlength="' + (3 + win.alphaPrecision) + '" value="' + (all != null ? mPrecision((all.a * 100) / 255, win.alphaPrecision) : '') + '" title="' + localization.tooltips.alpha.textbox + '"/> %</td></tr><tr class="Hex"><td colspan="2" class="Text"><label>#:<input aria-label="' + localization.tooltips.hex.textbox + '" type="text" maxlength="6" class="Hex" value="' + (all != null ? all.hex : '') + '"/></label><input type="text" maxlength="2" class="AHex" value="' + (all != null ? all.ahex.substring(6) : '') + '" title="' + localization.tooltips.hex.alpha + '"/></td></tr></tbody></table>';
container = $($this);
container.html(controlHtml);
// initialize the objects to the source code just injected
var tbody = container.find('tbody').eq(0);
colorMapDiv = tbody.find('div.Map').eq(0);
colorBarDiv = tbody.find('div.Bar').eq(0);
var MapMaps = colorMapDiv.find('span'),
BarMaps = colorBarDiv.find('span');
colorMapL1 = MapMaps.filter('.Map1').eq(0);
colorMapL2 = MapMaps.filter('.Map2').eq(0);
colorMapL3 = MapMaps.filter('.Map3').eq(0);
colorBarL1 = BarMaps.filter('.Map1').eq(0);
colorBarL2 = BarMaps.filter('.Map2').eq(0);
colorBarL3 = BarMaps.filter('.Map3').eq(0);
colorBarL4 = BarMaps.filter('.Map4').eq(0);
colorBarL5 = BarMaps.filter('.Map5').eq(0);
colorBarL6 = BarMaps.filter('.Map6').eq(0);
// create color pickers and maps
colorMap = new Slider(colorMapDiv, {
map: {
width: images.colorMap.width,
height: images.colorMap.height
},
arrow: {
image: images.clientPath + images.colorMap.arrow.file,
width: images.colorMap.arrow.width,
height: images.colorMap.arrow.height
}
});
colorMap.bind(mapValueChanged);
colorBar = new Slider(colorBarDiv, {
map: {
width: images.colorBar.width,
height: images.colorBar.height
},
arrow: {
image: images.clientPath + images.colorBar.arrow.file,
width: images.colorBar.arrow.width,
height: images.colorBar.arrow.height
}
});
colorBar.bind(colorBarValueChanged);
colorPicker = new ColorValuePicker(tbody, color.active, null, win.alphaPrecision);
var hex = all != null ? all.hex : null,
preview = tbody.find('.Preview'),
button = tbody.find('.Button');
activePreview = preview.find('.Active').eq(0).css({
backgroundColor: hex && '#' + hex || 'transparent'
});
currentPreview = preview.find('.Current').eq(0).css({
backgroundColor: hex && '#' + hex || 'transparent'
}).on('click', currentClicked);
setAlpha.call($this, currentPreview, mPrecision(color.current.val('a') * 100) / 255, 4);
okButton = button.find('.Ok').eq(0).on('click', okClicked);
cancelButton = button.find('.Cancel').eq(0).on('click', cancelClicked);
grid = button.find('.Grid').eq(0);
setTimeout(function () {
setImg.call($this, colorMapL1, images.clientPath + 'Maps.png');
setImg.call($this, colorMapL2, images.clientPath + 'Maps.png');
setImg.call($this, colorMapL3, images.clientPath + 'map-opacity.png');
setImg.call($this, colorBarL1, images.clientPath + 'Bars.png');
setImg.call($this, colorBarL2, images.clientPath + 'Bars.png');
setImg.call($this, colorBarL3, images.clientPath + 'Bars.png');
setImg.call($this, colorBarL4, images.clientPath + 'Bars.png');
setImg.call($this, colorBarL5, images.clientPath + 'bar-opacity.png');
setImg.call($this, colorBarL6, images.clientPath + 'AlphaBar.png');
setImg.call($this, preview.find('div').eq(0), images.clientPath + 'preview-opacity.png');
}, 0);
tbody.find('td.Radio input').on('click', radioClicked);
// initialize quick list
if (color.quickList && color.quickList.length > 0) {
var html = '', i;
for (i = 0; i < color.quickList.length; i++) {
/* if default colors are hex strings, change them to color objects */
if ((typeof (color.quickList[i])).toString().toLowerCase() == 'string') color.quickList[i] = new Color({
hex: color.quickList[i]
});
var alpha = color.quickList[i].val('a');
var ahex = color.quickList[i].val('ahex');
if (!win.alphaSupport && ahex) ahex = ahex.substring(0, 6) + 'ff';
var quickHex = color.quickList[i].val('hex');
html += '<span class="QuickColor"' + (ahex && ' title="#' + ahex + '"' || '') + ' style="background-color:' + (quickHex && '#' + quickHex || '') + ';' + (quickHex ? '' : 'background-image:url(' + images.clientPath + 'NoColor.png)') + (win.alphaSupport && alpha && alpha < 255 ? ';opacity:' + mPrecision(alpha / 255, 4) + ';filter:Alpha(opacity=' + mPrecision(alpha / 2.55, 4) + ')' : '') + '"> </span>';
}
setImg.call($this, grid, images.clientPath + 'bar-opacity.png');
grid.html(html);
grid.find('.QuickColor').on('click', quickPickClicked);
}
setColorMode.call($this, settings.color.mode);
color.active.bind(activeColorChanged);
$.isFunction(liveCallback) && color.active.bind(liveCallback);
color.current.bind(currentColorChanged);
show.call($this);
},
destroy = function () {
var elemData = $.data($this, 'wsjPicker') || $this;
container.find('td.Radio input').off('click', radioClicked);
currentPreview.off('click', currentClicked);
cancelButton.off('click', cancelClicked);
okButton.off('click', okClicked);
container.find('.QuickColor').off('click', quickPickClicked);
colorMapDiv = null;
colorBarDiv = null;
colorMapL1 = null;
colorMapL2 = null;
colorMapL3 = null;
colorBarL1 = null;
colorBarL2 = null;
colorBarL3 = null;
colorBarL4 = null;
colorBarL5 = null;
colorBarL6 = null;
colorMap.destroy();
colorMap = null;
colorBar.destroy();
colorBar = null;
colorPicker.destroy();
colorPicker = null;
activePreview = null;
currentPreview = null;
okButton = null;
cancelButton = null;
grid = null;
commitCallback = null;
cancelCallback = null;
liveCallback = null;
container.html('');
for (i = 0; i < List.length; i++) {
if (List[i] == elemData) {
List.splice(i, 1);
break;
}
}
},
images = settings.images, // local copies for YUI compressor
localization = settings.localization,
color = {
active: (typeof (settings.color.active)).toString().toLowerCase() == 'string' ? new Color({
ahex: !settings.window.alphaSupport && settings.color.active ? settings.color.active.substring(0, 6) + 'ff' : settings.color.active
}) : new Color({
ahex: !settings.window.alphaSupport && settings.color.active.val('ahex') ? settings.color.active.val('ahex').substring(0, 6) + 'ff' : settings.color.active.val('ahex')
}),
current: (typeof (settings.color.active)).toString().toLowerCase() == 'string' ? new Color({
ahex: !settings.window.alphaSupport && settings.color.active ? settings.color.active.substring(0, 6) + 'ff' : settings.color.active
}) : new Color({
ahex: !settings.window.alphaSupport && settings.color.active.val('ahex') ? settings.color.active.val('ahex').substring(0, 6) + 'ff' : settings.color.active.val('ahex')
}),
quickList: settings.color.quickList
};
elemExtend(false, $this, // public properties, methods, and callbacks
{
commitCallback: commitCallback, // commitCallback function can be overridden to return the selected color to a method you specify when the user clicks "OK"
liveCallback: liveCallback, // liveCallback function can be overridden to return the selected color to a method you specify in live mode (continuous update)
cancelCallback: cancelCallback, // cancelCallback function can be overridden to a method you specify when the user clicks "Cancel"
color: color,
setColorMode: function(val){
$('input[type="radio"][value="'+val+'"]', container).prop('checked', true).triggerHandler('click');
},
settings: settings,
show: show,
hide: hide,
destroy: destroy // destroys this control entirely, removing all events and objects, and removing itself from the List
});
List.push($.data($this, 'wsjPicker') || $this);
setTimeout(function () {
initialize.call($this);
}, 0);
});
};
$.fn.wsjPicker.defaults = /* jPicker defaults - you can change anything in this section (such as the clientPath to your images) without fear of breaking the program */ {
window: {
liveUpdate: true,
/* set false if you want the user to have to click "OK" before the binded input box updates values (always "true" for expandable picker) */
alphaSupport: false,
/* set to true to enable alpha picking */
alphaPrecision: 0
/* set decimal precision for alpha percentage display - hex codes do not map directly to percentage integers - range 0-2 */
},
color: {
mode: 'h',
/* acceptabled values "h" (hue), "s" (saturation), "v" (value), "r" (red), "g" (green), "b" (blue), "a" (alpha) */
active: new Color({ahex: '#000000ff'}),
/* acceptable values are any declared $.jPicker.Color object or string HEX value (e.g. #ffc000) WITH OR WITHOUT the "#" prefix */
quickList: /* the quick pick color list */ [
new Color({
h: 360,
s: 33,
v: 100
}), /* acceptable values are any declared $.jPicker.Color object or string HEX value (e.g. #ffc000) WITH OR WITHOUT the "#" prefix */
new Color({
h: 360,
s: 66,
v: 100
}),
new Color({
h: 360,
s: 100,
v: 100
}),
new Color({
h: 360,
s: 100,
v: 75
}),
new Color({
h: 360,
s: 100,
v: 50
}),
new Color({
h: 180,
s: 0,
v: 100
}),
new Color({
h: 30,
s: 33,
v: 100
}),
new Color({
h: 30,
s: 66,
v: 100
}),
new Color({
h: 30,
s: 100,
v: 100
}),
new Color({
h: 30,
s: 100,
v: 75
}),
new Color({
h: 30,
s: 100,
v: 50
}),
new Color({
h: 180,
s: 0,
v: 90
}),
new Color({
h: 60,
s: 33,
v: 100
}),
new Color({
h: 60,
s: 66,
v: 100
}),
new Color({
h: 60,
s: 100,
v: 100
}),
new Color({
h: 60,
s: 100,
v: 75
}),
new Color({
h: 60,
s: 100,
v: 50
}),
new Color({
h: 180,
s: 0,
v: 80
}),
new Color({
h: 90,
s: 33,
v: 100
}),
new Color({
h: 90,
s: 66,
v: 100
}),
new Color({
h: 90,
s: 100,
v: 100
}),
new Color({
h: 90,
s: 100,
v: 75
}),
new Color({
h: 90,
s: 100,
v: 50
}),
new Color({
h: 180,
s: 0,
v: 70
}),
new Color({
h: 120,
s: 33,
v: 100
}),
new Color({
h: 120,
s: 66,
v: 100
}),
new Color({
h: 120,
s: 100,
v: 100
}),
new Color({
h: 120,
s: 100,
v: 75
}),
new Color({
h: 120,
s: 100,
v: 50
}),
new Color({
h: 180,
s: 0,
v: 60
}),
new Color({
h: 150,
s: 33,
v: 100
}),
new Color({
h: 150,
s: 66,
v: 100
}),
new Color({
h: 150,
s: 100,
v: 100
}),
new Color({
h: 150,
s: 100,
v: 75
}),
new Color({
h: 150,
s: 100,
v: 50
}),
new Color({
h: 180,
s: 0,
v: 50
}),
new Color({
h: 180,
s: 33,
v: 100
}),
new Color({
h: 180,
s: 66,
v: 100
}),
new Color({
h: 180,
s: 100,
v: 100
}),
new Color({
h: 180,
s: 100,
v: 75
}),
new Color({
h: 180,
s: 100,
v: 50
}),
new Color({
h: 180,
s: 0,
v: 40
}),
new Color({
h: 210,
s: 33,
v: 100
}),
new Color({
h: 210,
s: 66,
v: 100
}),
new Color({
h: 210,
s: 100,
v: 100
}),
new Color({
h: 210,
s: 100,
v: 75
}),
new Color({
h: 210,
s: 100,
v: 50
}),
new Color({
h: 180,
s: 0,
v: 30
}),
new Color({
h: 240,
s: 33,
v: 100
}),
new Color({
h: 240,
s: 66,
v: 100
}),
new Color({
h: 240,
s: 100,
v: 100
}),
new Color({
h: 240,
s: 100,
v: 75
}),
new Color({
h: 240,
s: 100,
v: 50
}),
new Color({
h: 180,
s: 0,
v: 20
}),
new Color({
h: 270,
s: 33,
v: 100
}),
new Color({
h: 270,
s: 66,
v: 100
}),
new Color({
h: 270,
s: 100,
v: 100
}),
new Color({
h: 270,
s: 100,
v: 75
}),
new Color({
h: 270,
s: 100,
v: 50
}),
new Color({
h: 180,
s: 0,
v: 10
}),
new Color({
h: 300,
s: 33,
v: 100
}),
new Color({
h: 300,
s: 66,
v: 100
}),
new Color({
h: 300,
s: 100,
v: 100
}),
new Color({
h: 300,
s: 100,
v: 75
}),
new Color({
h: 300,
s: 100,
v: 50
}),
new Color({
h: 180,
s: 0,
v: 0
}),
new Color({
h: 330,
s: 33,
v: 100
}),
new Color({
h: 330,
s: 66,
v: 100
}),
new Color({
h: 330,
s: 100,
v: 100
}),
new Color({
h: 330,
s: 100,
v: 75
}),
new Color({
h: 330,
s: 100,
v: 50
}),
new Color({
h: 180,
s: 0,
v: 0
})
]
},
images: {
clientPath: '/jPicker/images/',
/* Path to image files */
colorMap: {
width: 256,
height: 256,
arrow: {
file: 'mappoint.gif',
/* ColorMap arrow icon */
width: 15,
height: 15
}
},
colorBar: {
width: 20,
height: 256,
arrow: {
file: 'rangearrows.gif',
/* ColorBar arrow icon */
width: 20,
height: 7
}
}
},
localization: /* alter these to change the text presented by the picker (e.g. different language) */ {
text: {
title: 'Drag Markers To Pick A Color',
newColor: 'new',
currentColor: 'current',
ok: 'OK',
cancel: 'Cancel'
},
tooltips: {
colors: {
newColor: 'New Color - Press “OK” To Commit',
currentColor: 'Click To Revert To Original Color'
},
buttons: {
ok: 'Commit To This Color Selection',
cancel: 'Cancel And Revert To Original Color'
},
hue: {
radio: 'Set To “Hue” Color Mode',
textbox: 'Enter A “Hue” Value (0-360°)'
},
saturation: {
radio: 'Set To “Saturation” Color Mode',
textbox: 'Enter A “Saturation” Value (0-100%)'
},
value: {
radio: 'Set To “Value” Color Mode',
textbox: 'Enter A “Value” Value (0-100%)'
},
red: {
radio: 'Set To “Red” Color Mode',
textbox: 'Enter A “Red” Value (0-255)'
},
green: {
radio: 'Set To “Green” Color Mode',
textbox: 'Enter A “Green” Value (0-255)'
},
blue: {
radio: 'Set To “Blue” Color Mode',
textbox: 'Enter A “Blue” Value (0-255)'
},
alpha: {
radio: 'Set To “Alpha” Color Mode',
textbox: 'Enter A “Alpha” Value (0-100)'
},
hex: {
textbox: 'Enter A “Hex” Color Value (#000000-#ffffff)',
alpha: 'Enter A “Alpha” Value (#00-#ff)'
}
}
}
};
})(jQuery, '1.1.6wsmod');
webshims.register('color-picker', function($, webshims, window, document, undefined, options){
"use strict";
var picker = webshims.picker;
picker.commonColorInit = function(data){
var popover = data.popover;
popover.element.on({
wspopovershow: function(){
data.element.triggerHandler('wsupdatevalue');
picker._genericSetFocus.call(data, $('input.Hex', popover.element));
}
});
};
picker.color.showPickerContent = (function(){
var _init, curData;
var jpicker = $('<div class="ws-jpicker" />');
$.fn.wsjPicker.defaults.images.clientPath = webshims.cfg.basePath + 'jpicker/images/';
var jPickerApi;
var fns = {
setPicker: function(data){
var mode = $(data.orig).data('colormode') || 'h';
if(!data.alpha.length){
jpicker.addClass('no-alpha-picker');
if(mode == 'a'){
mode = 'h';
}
} else {
jpicker.removeClass('no-alpha-picker');
}
if(mode != jPickerApi.settings.color.mode){
jPickerApi.setColorMode(mode);
}
},
setInputColor: function(data){
var oldAlpha;
var colorData = jPickerApi.color.active.val();
var value = '#'+colorData.hex;
if(data.alpha.length){
oldAlpha = data.alpha.prop('value');
data.alpha.prop('value', colorData.a / (255 / (data.alpha.prop('max') || 1)));
}
$(data.orig).data('colormode', jPickerApi.settings.color.mode);
picker._actions.changeInput(value, data.popover, data);
if(data.alpha.length && oldAlpha != data.alpha.prop('value')){
data.alpha.trigger('input').trigger('change');
}
return value;
}
// ,
// triggerInputColor: function(data){
// var oldAlpha;
// var colorData = jPickerApi.color.active.val();
// var value = '#'+colorData.hex;
// if(data.alpha.length){
// oldAlpha = data.alpha.prop('value');
// data.alpha.prop('value', colorData.a / (255 / (data.alpha.prop('max') || 1)));
// }
// data.setInput(value);
// if(data.alpha.length && oldAlpha != data.alpha.prop('value')){
// data.alpha.triggerHandler('input');
// }
// return value;
// }
};
var pickerSet = function(fn, data, value){
if(data == curData && fns[fn]){
fns[fn](data);
}
};
var createPicker = function(data){
jPickerApi = jpicker.data('wsjPicker');
if(!jPickerApi){
jpicker.empty().wsjPicker(
{},
function(color){
if(curData){
pickerSet('setInputColor', curData);
}
},
false,
function(color){
if(curData){
picker._actions.cancel('#' + color.val().hex, curData.popover, curData);
}
}
);
jPickerApi = jpicker.data('wsjPicker');
}
};
var implementPickerFor = function(data){
createPicker();
if( data != curData){
if(curData){
curData.popover.hide();
}
curData = data;
data.popover.contentElement.html(jpicker);
pickerSet('setPicker', data);
}
};
return function(data){
if(!data._popoverinit){
picker.commonInit(data, data.popover);
picker.commonColorInit(data);
}
var value = data.parseValue();
implementPickerFor(data);
value += (data.alpha.length) ?
$.wsjPicker.ColorMethods.intToHex( (data.alpha.prop('value') || 1) * (255 / (data.alpha.prop('max') || 1)) ) :
'ff'
;
jPickerApi.color.active.val('ahex', value);
jPickerApi.color.current.val('ahex', value);
data._popoverinit = true;
};
})();
if(options && options._types && $.inArray('color', options._types) == -1){
webshims.error('[type="color"] used without adding it to the types config.');
}
document.createElement('img').src = webshims.cfg.basePath +'jpicker/images/Maps.png';
});
| gokuale/cdnjs | ajax/libs/webshim/1.14.1/dev/shims/color-picker.js | JavaScript | mit | 73,403 |
exports.valid = {
fullName : "John Doe",
age : 47,
state : "Massachusetts",
city : "Boston",
zip : 16417,
married : false,
dozen : 12,
dozenOrBakersDozen : 13,
favoriteEvenNumber : 14,
topThreeFavoriteColors : [ "red", "blue", "green" ],
favoriteSingleDigitWholeNumbers : [ 7 ],
favoriteFiveLetterWord : "coder",
emailAddresses :
[
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@letters-in-local.org",
"01234567890@numbers-in-local.net",
"&'*+-./=?^_{}~@other-valid-characters-in-local.net",
"mixed-1234-in-{+^}-local@sld.net",
"a@single-character-in-local.org",
"\"quoted\"@sld.com",
"\"\\e\\s\\c\\a\\p\\e\\d\"@sld.com",
"\"quoted-at-sign@sld.org\"@sld.com",
"\"escaped\\\"quote\"@sld.com",
"\"back\\slash\"@sld.com",
"one-character-third-level@a.example.com",
"single-character-in-sld@x.org",
"local@dash-in-sld.com",
"letters-in-sld@123.com",
"one-letter-sld@x.org",
"uncommon-tld@sld.museum",
"uncommon-tld@sld.travel",
"uncommon-tld@sld.mobi",
"country-code-tld@sld.uk",
"country-code-tld@sld.rw",
"local@sld.newTLD",
"the-total-length@of-an-entire-address.cannot-be-longer-than-two-hundred-and-fifty-four-characters.and-this-address-is-254-characters-exactly.so-it-should-be-valid.and-im-going-to-add-some-more-words-here.to-increase-the-lenght-blah-blah-blah-blah-bla.org",
"the-character-limit@for-each-part.of-the-domain.is-sixty-three-characters.this-is-exactly-sixty-three-characters-so-it-is-valid-blah-blah.com",
"local@sub.domains.com"
],
ipAddresses : [ "127.0.0.1", "24.48.64.2", "192.168.1.1", "209.68.44.3", "2.2.2.2" ]
}
exports.invalid = {
fullName : null,
age : -1,
state : 47,
city : false,
zip : [null],
married : "yes",
dozen : 50,
dozenOrBakersDozen : "over 9000",
favoriteEvenNumber : 15,
topThreeFavoriteColors : [ "red", 5 ],
favoriteSingleDigitWholeNumbers : [ 78, 2, 999 ],
favoriteFiveLetterWord : "codernaut",
emailAddresses : [],
ipAddresses : [ "999.0.099.1", "294.48.64.2346", false, "2221409.64214128.42414.235233", "124124.12412412" ]
}
exports.schema = { // from cosmic thingy
name : "test",
type : "object",
additionalProperties : false,
required : ["fullName", "age", "zip", "married", "dozen", "dozenOrBakersDozen", "favoriteEvenNumber", "topThreeFavoriteColors", "favoriteSingleDigitWholeNumbers", "favoriteFiveLetterWord", "emailAddresses", "ipAddresses"],
properties :
{
fullName : { type : "string" },
age : { type : "integer", minimum : 0 },
optionalItem : { type : "string" },
state : { type : "string" },
city : { type : "string" },
zip : { type : "integer", minimum : 0, maximum : 99999 },
married : { type : "boolean" },
dozen : { type : "integer", minimum : 12, maximum : 12 },
dozenOrBakersDozen : { type : "integer", minimum : 12, maximum : 13 },
favoriteEvenNumber : { type : "integer", multipleOf : 2 },
topThreeFavoriteColors : { type : "array", minItems : 3, maxItems : 3, uniqueItems : true, items : { type : "string" }},
favoriteSingleDigitWholeNumbers : { type : "array", minItems : 1, maxItems : 10, uniqueItems : true, items : { type : "integer", minimum : 0, maximum : 9 }},
favoriteFiveLetterWord : { type : "string", minLength : 5, maxLength : 5 },
emailAddresses : { type : "array", minItems : 1, uniqueItems : true, items : { type : "string", format : "email" }},
ipAddresses : { type : "array", uniqueItems : true, items : { type : "string", format : "ipv4" }},
}
} | BradBolander/Project4 | node_modules/osc/node_modules/serialport/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/fixtures/cosmic.js | JavaScript | mit | 3,900 |
.yui3-skin-sam .yui3-panel-content {
-webkit-box-shadow: 0 0 5px #333;
-moz-box-shadow: 0 0 5px #333;
box-shadow: 0 0 5px #333;
border: 1px solid black;
background: white;
}
.yui3-skin-sam .yui3-panel .yui3-widget-hd {
padding: 8px 28px 8px 8px; /* Room for close button. */
min-height: 13px; /* For the close button */
_height: 13px; /* IE6 */
color: white;
background-color: #3961c5;
background: -moz-linear-gradient(
0% 100% 90deg,
#2647a0 7%,
#3d67ce 50%,
#426fd9 100%
);
background: -webkit-gradient(
linear,
left bottom,
left top,
from(#2647a0),
color-stop(0.07, #2647a0),
color-stop(0.5, #3d67ce),
to(#426fd9)
);
/*
TODO: Add support for IE and W3C gradients
*/
}
.yui3-skin-sam .yui3-panel .yui3-widget-hd .yui3-widget-buttons {
padding: 8px;
}
.yui3-skin-sam .yui3-panel .yui3-widget-bd {
padding: 10px;
}
.yui3-skin-sam .yui3-panel .yui3-widget-ft {
background: #EDF5FF;
padding: 8px;
text-align: right;
}
.yui3-skin-sam .yui3-panel .yui3-widget-ft .yui3-button {
margin-left: 8px;
}
/*
Support for icon-based [x] "close" button in the header.
Nicolas Gallagher: "CSS image replacement with pseudo-elements (NIR)"
http://nicolasgallagher.com/css-image-replacement-with-pseudo-elements/
*/
.yui3-skin-sam .yui3-panel .yui3-widget-hd .yui3-button-close {
/* Reset base button styles */
background: transparent;
filter: none;
border: none;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
/* Structure */
width: 13px;
height: 13px;
padding: 0;
overflow: hidden;
vertical-align: top;
/* IE < 8 :( */
*font-size: 0;
*line-height: 0;
*letter-spacing: -1000px;
*color: #86A5EC;
*background: url(sprite_icons.png) no-repeat 1px 1px;
}
.yui3-skin-sam .yui3-panel .yui3-widget-hd .yui3-button-close:before {
/*
Displays the [x] icon in place of the "Close" text.
Note: The `width` of this pseudo element is the same as its "host" element.
*/
content: url(sprite_icons.png);
display: inline-block;
text-align: center;
font-size: 0;
line-height: 0;
width: 13px;
margin: 1px 0 0 1px;
}
.yui3-skin-sam .yui3-panel-hidden .yui3-widget-hd .yui3-button-close {
/* Required for IE > 7 to deal with pseudo :before element */
display: none;
}
| RobLoach/cdnjs | ajax/libs/yui/3.10.1/panel/assets/skins/sam/panel-skin.css | CSS | mit | 2,559 |
/* -*- 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
*/
/**
* Define a module along with a payload.
* @param {string} moduleName Name for the payload
* @param {ignored} deps Ignored. For compatibility with CommonJS AMD Spec
* @param {function} payload Function with (require, exports, module) params
*/
function define(moduleName, deps, payload) {
if (typeof moduleName != "string") {
throw new TypeError('Expected string, got: ' + moduleName);
}
if (arguments.length == 2) {
payload = deps;
}
if (moduleName in define.modules) {
throw new Error("Module already defined: " + moduleName);
}
define.modules[moduleName] = payload;
};
/**
* The global store of un-instantiated modules
*/
define.modules = {};
/**
* We invoke require() in the context of a Domain so we can have multiple
* sets of modules running separate from each other.
* This contrasts with JSMs which are singletons, Domains allows us to
* optionally load a CommonJS module twice with separate data each time.
* Perhaps you want 2 command lines with a different set of commands in each,
* for example.
*/
function Domain() {
this.modules = {};
this._currentModule = null;
}
(function () {
/**
* Lookup module names and resolve them by calling the definition function if
* needed.
* There are 2 ways to call this, either with an array of dependencies and a
* callback to call when the dependencies are found (which can happen
* asynchronously in an in-page context) or with a single string an no callback
* where the dependency is resolved synchronously and returned.
* The API is designed to be compatible with the CommonJS AMD spec and
* RequireJS.
* @param {string[]|string} deps A name, or names for the payload
* @param {function|undefined} callback Function to call when the dependencies
* are resolved
* @return {undefined|object} The module required or undefined for
* array/callback method
*/
Domain.prototype.require = function(deps, callback) {
if (Array.isArray(deps)) {
var params = deps.map(function(dep) {
return this.lookup(dep);
}, this);
if (callback) {
callback.apply(null, params);
}
return undefined;
}
else {
return this.lookup(deps);
}
};
function normalize(path) {
var bits = path.split('/');
var i = 1;
while (i < bits.length) {
if (bits[i] === '..') {
bits.splice(i-1, 1);
} else if (bits[i] === '.') {
bits.splice(i, 1);
} else {
i++;
}
}
return bits.join('/');
}
function join(a, b) {
a = a.trim();
b = b.trim();
if (/^\//.test(b)) {
return b;
} else {
return a.replace(/\/*$/, '/') + b;
}
}
function dirname(path) {
var bits = path.split('/');
bits.pop();
return bits.join('/');
}
/**
* Lookup module names and resolve them by calling the definition function if
* needed.
* @param {string} moduleName A name for the payload to lookup
* @return {object} The module specified by aModuleName or null if not found.
*/
Domain.prototype.lookup = function(moduleName) {
if (/^\./.test(moduleName)) {
moduleName = normalize(join(dirname(this._currentModule), moduleName));
}
if (moduleName in this.modules) {
var module = this.modules[moduleName];
return module;
}
if (!(moduleName in define.modules)) {
throw new Error("Module not defined: " + moduleName);
}
var module = define.modules[moduleName];
if (typeof module == "function") {
var exports = {};
var previousModule = this._currentModule;
this._currentModule = moduleName;
module(this.require.bind(this), exports, { id: moduleName, uri: "" });
this._currentModule = previousModule;
module = exports;
}
// cache the resulting module object for next time
this.modules[moduleName] = module;
return module;
};
}());
define.Domain = Domain;
define.globalDomain = new Domain();
var require = define.globalDomain.require.bind(define.globalDomain);
| jleonhard/angular2-webpack-jquery-bootstrap | node_modules/escodegen/node_modules/source-map/build/mini-require.js | JavaScript | mit | 4,268 |
/*
* canvas2png.js
*
* Copyright (c) 2010-2013 Shinya Muramatsu
* Released under the MIT License
* http://flashcanvas.net/
*/
(function(doc) {
var scripts = doc.getElementsByTagName("script");
var script = scripts[scripts.length - 1];
var url = script.getAttribute("src").replace(/[^\/]+$/, "save.php");
window.canvas2png = function(canvas, filename) {
var tagName = canvas.tagName.toLowerCase();
if (tagName !== "canvas") {
return;
}
if (typeof FlashCanvas !== "undefined") {
FlashCanvas.saveImage(canvas, filename);
} else {
var action = url;
if (filename) {
action += "?filename=" + filename;
}
var form = doc.createElement("form");
var input = doc.createElement("input");
form.setAttribute("action", action);
form.setAttribute("method", "post");
input.setAttribute("type", "hidden");
input.setAttribute("name", "dataurl");
input.setAttribute("value", canvas.toDataURL());
doc.body.appendChild(form);
form.appendChild(input);
form.submit();
form.removeChild(input);
doc.body.removeChild(form);
}
}
})(document);
| JohnKim/cdnjs | ajax/libs/webshim/1.15.6-RC1/dev/shims/FlashCanvasPro/canvas2png.js | JavaScript | mit | 1,210 |
(function(){var a=window.CustomEvent;if(!a||typeof a=="object"){a=function d(i,g){g=g||{};var h=document.createEvent("CustomEvent");h.initCustomEvent(i,!!g.bubbles,!!g.cancelable,g.detail||null);return h};a.prototype=window.Event.prototype}function f(g){while(g){if(g.nodeName.toUpperCase()=="DIALOG"){return(g)}g=g.parentElement}return null}function c(g,j){for(var h=0;h<g.length;++h){if(g[h]==j){return true}}return false}function b(g){this.dialog_=g;this.replacedStyleTop_=false;this.openAsModal_=false;g.show=this.show.bind(this);g.showModal=this.showModal.bind(this);g.close=this.close.bind(this);if(!("returnValue" in g)){g.returnValue=""}this.maybeHideModal=this.maybeHideModal.bind(this);if("MutationObserver" in window){var h=new MutationObserver(this.maybeHideModal);h.observe(g,{attributes:true,attributeFilter:["open"]})}else{g.addEventListener("DOMAttrModified",this.maybeHideModal)}Object.defineProperty(g,"open",{set:this.setOpen.bind(this),get:g.hasAttribute.bind(g,"open")});this.backdrop_=document.createElement("div");this.backdrop_.className="backdrop";this.backdropClick_=this.backdropClick_.bind(this)}b.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){if(!this.openAsModal_){return}if(this.dialog_.hasAttribute("open")&&document.body.contains(this.dialog_)){return}this.openAsModal_=false;this.dialog_.style.zIndex="";if(this.replacedStyleTop_){this.dialog_.style.top="";this.replacedStyleTop_=false}this.backdrop_.removeEventListener("click",this.backdropClick_);if(this.backdrop_.parentElement){this.backdrop_.parentElement.removeChild(this.backdrop_)}e.dm.removeDialog(this)},setOpen:function(g){if(g){this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open","")}else{this.dialog_.removeAttribute("open");this.maybeHideModal()}},backdropClick_:function(g){var h=document.createEvent("MouseEvents");h.initMouseEvent(g.type,g.bubbles,g.cancelable,window,g.detail,g.screenX,g.screenY,g.clientX,g.clientY,g.ctrlKey,g.altKey,g.shiftKey,g.metaKey,g.button,g.relatedTarget);this.dialog_.dispatchEvent(h);g.stopPropagation()},updateZIndex:function(g,h){this.backdrop_.style.zIndex=g;this.dialog_.style.zIndex=h},show:function(){this.setOpen(true)},showModal:function(){if(this.dialog_.hasAttribute("open")){throw"Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally."}if(!document.body.contains(this.dialog_)){throw"Failed to execute 'showModal' on dialog: The element is not in a Document."}if(!e.dm.pushDialog(this)){throw"Failed to execute 'showModal' on dialog: There are too many open modal dialogs."}this.show();this.openAsModal_=true;if(e.needsCentering(this.dialog_)){e.reposition(this.dialog_);this.replacedStyleTop_=true}else{this.replacedStyleTop_=false}this.backdrop_.addEventListener("click",this.backdropClick_);this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling);var i=this.dialog_.querySelector("[autofocus]:not([disabled])");if(!i){var g=["button","input","keygen","select","textarea"];var h=g.map(function(j){return j+":not([disabled])"}).join(", ");i=this.dialog_.querySelector(h)}document.activeElement&&document.activeElement.blur&&document.activeElement.blur();i&&i.focus()},close:function(h){if(!this.dialog_.hasAttribute("open")){throw"Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed."}this.setOpen(false);if(h!==undefined){this.dialog_.returnValue=h}var g=new a("close",{bubbles:false,cancelable:false});this.dialog_.dispatchEvent(g)}};var e={};e.reposition=function(g){var i=document.body.scrollTop||document.documentElement.scrollTop;var h=i+(window.innerHeight-g.offsetHeight)/2;g.style.top=Math.max(i,h)+"px"};e.isInlinePositionSetByStylesheet=function(k){for(var l=0;l<document.styleSheets.length;++l){var q=document.styleSheets[l];var n=null;try{n=q.cssRules}catch(m){}if(!n){continue}for(var h=0;h<n.length;++h){var p=n[h];var r=null;try{r=document.querySelectorAll(p.selectorText)}catch(m){}if(!r||!c(r,k)){continue}var g=p.style.getPropertyValue("top");var o=p.style.getPropertyValue("bottom");if((g&&g!="auto")||(o&&o!="auto")){return true}}}return false};e.needsCentering=function(h){var g=window.getComputedStyle(h);if(g.position!="absolute"){return false}if((h.style.top!="auto"&&h.style.top!="")||(h.style.bottom!="auto"&&h.style.bottom!="")){return false}return !e.isInlinePositionSetByStylesheet(h)};e.forceRegisterDialog=function(g){if(g.showModal){console.warn("This browser already supports <dialog>, the polyfill may not work correctly",g)}if(g.nodeName.toUpperCase()!="DIALOG"){throw"Failed to register dialog: The element is not a dialog."}new b((g))};e.registerDialog=function(g){if(g.showModal){console.warn("Can't upgrade <dialog>: already supported",g)}else{e.forceRegisterDialog(g)}};e.DialogManager=function(){this.pendingDialogStack=[];this.overlay=document.createElement("div");this.overlay.className="_dialog_overlay";this.overlay.addEventListener("click",function(g){g.stopPropagation()});this.handleKey_=this.handleKey_.bind(this);this.handleFocus_=this.handleFocus_.bind(this);this.handleRemove_=this.handleRemove_.bind(this);this.zIndexLow_=100000;this.zIndexHigh_=100000+150};e.DialogManager.prototype.topDialogElement=function(){if(this.pendingDialogStack.length){var g=this.pendingDialogStack[this.pendingDialogStack.length-1];return g.dialog}return null};e.DialogManager.prototype.blockDocument=function(){document.body.appendChild(this.overlay);document.body.addEventListener("focus",this.handleFocus_,true);document.addEventListener("keydown",this.handleKey_);document.addEventListener("DOMNodeRemoved",this.handleRemove_)};e.DialogManager.prototype.unblockDocument=function(){document.body.removeChild(this.overlay);document.body.removeEventListener("focus",this.handleFocus_,true);document.removeEventListener("keydown",this.handleKey_);document.removeEventListener("DOMNodeRemoved",this.handleRemove_)};e.DialogManager.prototype.updateStacking=function(){var h=this.zIndexLow_;for(var g=0;g<this.pendingDialogStack.length;g++){if(g==this.pendingDialogStack.length-1){this.overlay.style.zIndex=h++}this.pendingDialogStack[g].updateZIndex(h++,h++)}};e.DialogManager.prototype.handleFocus_=function(h){var g=f((h.target));if(g!=this.topDialogElement()){h.preventDefault();h.stopPropagation();h.target.blur();return false}};e.DialogManager.prototype.handleKey_=function(i){if(i.keyCode==27){i.preventDefault();i.stopPropagation();var h=new a("cancel",{bubbles:false,cancelable:true});var g=this.topDialogElement();if(g.dispatchEvent(h)){g.close()}}};e.DialogManager.prototype.handleRemove_=function(h){if(h.target.nodeName.toUpperCase()!="DIALOG"){return}var g=(h.target);if(!g.open){return}this.pendingDialogStack.some(function(i){if(i.dialog==g){i.maybeHideModal();return true}})};e.DialogManager.prototype.pushDialog=function(g){var h=(this.zIndexHigh_-this.zIndexLow_)/2-1;if(this.pendingDialogStack.length>=h){return false}this.pendingDialogStack.push(g);if(this.pendingDialogStack.length==1){this.blockDocument()}this.updateStacking();return true};e.DialogManager.prototype.removeDialog=function(h){var g=this.pendingDialogStack.indexOf(h);if(g==-1){return}this.pendingDialogStack.splice(g,1);this.updateStacking();if(this.pendingDialogStack.length==0){this.unblockDocument()}};e.dm=new e.DialogManager();document.addEventListener("submit",function(k){var l=k.target;if(!l||!l.hasAttribute("method")){return}if(l.getAttribute("method").toLowerCase()!="dialog"){return}k.preventDefault();var i=f((k.target));if(!i){return}var j;var g=[document.activeElement,k.explicitOriginalTarget];var h=["BUTTON","INPUT"];g.some(function(m){if(m&&m.form==k.target&&h.indexOf(m.nodeName.toUpperCase())!=-1){j=m.value;return true}});i.close(j)},true);window.dialogPolyfill=e;e.forceRegisterDialog=e.forceRegisterDialog;e.registerDialog=e.registerDialog})(); | wout/cdnjs | ajax/libs/dialog-polyfill/0.4.2/dialog-polyfill.min.js | JavaScript | mit | 7,912 |
/*! formstone v0.7.1 [upload.js] 2015-07-16 | MIT License | formstone.it */
!function(a,b){"use strict";function c(a){if(b.support.file){var c="";c+='<div class="'+p.target+'">',c+=a.label,c+="</div>",c+='<input class="'+p.input+'" type="file"',a.maxQueue>1&&(c+=" "+p.multiple),c+=">",this.addClass(p.base).append(c),a.$input=this.find(o.input),a.queue=[],a.total=0,a.uploading=!1,this.on(q.click,o.target,a,e).on(q.dragEnter,a,g).on(q.dragOver,a,h).on(q.dragLeave,a,i).on(q.drop,o.target,a,j),a.$input.on(q.change,a,f)}}function d(a){b.support.file&&(a.$input.off(q.namespace),this.off([q.click,q.dragEnter,q.dragOver,q.dragLeave,q.drop].join(" ")).removeClass(p.base).html(""))}function e(a){a.stopPropagation(),a.preventDefault();var b=a.data;b.$input.trigger(q.click)}function f(a){a.stopPropagation(),a.preventDefault();var b=a.data,c=b.$input[0].files;c.length&&k(b,c)}function g(a){a.stopPropagation(),a.preventDefault();var b=a.data;b.$el.addClass(p.dropping)}function h(a){a.stopPropagation(),a.preventDefault();var b=a.data;b.$el.addClass(p.dropping)}function i(a){a.stopPropagation(),a.preventDefault();var b=a.data;b.$el.removeClass(p.dropping)}function j(a){a.preventDefault();var b=a.data,c=a.originalEvent.dataTransfer.files;b.$el.removeClass(p.dropping),k(b,c)}function k(a,b){for(var c=[],d=0;d<b.length;d++){var e={index:a.total++,file:b[d],name:b[d].name,size:b[d].size,started:!1,complete:!1,error:!1,transfer:null};c.push(e),a.queue.push(e)}a.uploading||(r.on(q.beforeUnload,function(){return a.leave}),a.uploading=!0),a.$el.trigger(q.start,[c]),l(a)}function l(a){var b=0,c=[];for(var d in a.queue)!a.queue.hasOwnProperty(d)||a.queue[d].complete||a.queue[d].error||c.push(a.queue[d]);a.queue=c;for(var e in a.queue)if(a.queue.hasOwnProperty(e)){if(!a.queue[e].started){var f=new FormData;f.append(a.postKey,a.queue[e].file);for(var g in a.postData)a.postData.hasOwnProperty(g)&&f.append(g,a.postData[g]);m(a,a.queue[e],f)}if(b++,b>=a.maxQueue)return;d++}0===b&&(r.off(q.beforeUnload),a.uploading=!1,a.$el.trigger(q.complete))}function m(b,c,d){c.size>=b.maxSize?(c.error=!0,b.$el.trigger(q.fileError,[c,"Too large"]),l(b)):(c.started=!0,c.transfer=a.ajax({url:b.action,data:d,type:"POST",contentType:!1,processData:!1,cache:!1,xhr:function(){var d=a.ajaxSettings.xhr();return d.upload&&d.upload.addEventListener("progress",function(a){var d=0,e=a.loaded||a.position,f=a.total;a.lengthComputable&&(d=Math.ceil(e/f*100)),b.$el.trigger(q.fileProgress,[c,d])},!1),d},beforeSend:function(){b.$el.trigger(q.fileStart,[c])},success:function(a){c.complete=!0,b.$el.trigger(q.fileComplete,[c,a]),l(b)},error:function(a,d,e){c.error=!0,b.$el.trigger(q.fileError,[c,e]),l(b)}}))}var n=b.Plugin("upload",{widget:!0,defaults:{customClass:"",action:"",label:"Drag and drop files or click to select",leave:"You have uploads pending, are you sure you want to leave this page?",maxQueue:2,maxSize:5242880,postData:{},postKey:"file"},classes:["input","target","multiple","dropping"],methods:{_construct:c,_destruct:d}}),o=n.classes,p=o.raw,q=n.events,r=(n.functions,b.$window);q.complete="complete",q.fileStart="filestart",q.fileProgress="fileprogress",q.fileComplete="filecomplete",q.fileError="fileerror",q.start="start"}(jQuery,Formstone); | iamJoeTaylor/cdnjs | ajax/libs/formstone/0.7.1/js/upload.js | JavaScript | mit | 3,248 |
/**
* @module deprecate
*/
/**
* Prints out a deprecation warning to the console.warn with the format:
* `name` is deprecated, use `alternative` instead.
* It can also print out a stack trace with the line numbers.
* @param {String} name - Name of the thing that is deprecated.
* @param {String} alternative - Name of alternative that should be used instead.
* @param {Number} [stackTraceLimit] - depth of the stack trace to print out. Set to falsy value to disable stack.
*/
exports.deprecationWarning = function deprecationWarning(name, alternative, stackTraceLimit) {
if (stackTraceLimit) {
var depth = Error.stackTraceLimit;
Error.stackTraceLimit = stackTraceLimit;
}
if (typeof console !== "undefined" && typeof console.warn === "function") {
var stack = (stackTraceLimit ? new Error("").stack : "") ;
if(alternative) {
console.warn(name + " is deprecated, use " + alternative + " instead.", stack);
} else {
//name is a complete message
console.warn(name, stack);
}
}
if (stackTraceLimit) {
Error.stackTraceLimit = depth;
}
}
/**
* Provides a function that can replace a method that has been deprecated.
* Prints out a deprecation warning to the console.warn with the format:
* `name` is deprecated, use `alternative` instead.
* It will also print out a stack trace with the line numbers.
* @param {Object} scope - The object that will be used as the `this` when the `deprecatedFunction` is applied.
* @param {Function} deprecatedFunction - The function object that is deprecated.
* @param {String} name - Name of the method that is deprecated.
* @param {String} alternative - Name of alternative method that should be used instead.
* @returns {Function} deprecationWrapper
*/
exports.deprecateMethod = function deprecate(scope, deprecatedFunction, name, alternative) {
var deprecationWrapper = function () {
// stackTraceLimit = 3 // deprecationWarning + deprecate + caller of the deprecated method
deprecationWarning(name, alternative, 3);
return deprecatedFunction.apply(scope ? scope : this, arguments);
};
deprecationWrapper.deprecatedFunction = deprecatedFunction;
return deprecationWrapper;
}
| pj/q-io | deprecate.js | JavaScript | mit | 2,283 |
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Reflection;
using System.Reflection.Emit;
using Xunit;
namespace System.Reflection.Emit.Lightweight.Tests
{
public class DynamicMethodGetILGenerator1
{
private const string c_DYNAMIC_METHOD_NAME = "TestDynamicMethodA";
private readonly Type _DYNAMIC_METHOD_OWNER_TYPE = typeof(TestILGeneratorOwner1);
private const string c_FIELD_NAME = "_id";
public Module CurrentModule
{
get
{
return typeof(DynamicMethodGetILGenerator1).GetTypeInfo().Assembly.ManifestModule;
}
}
[Fact]
public void PosTest1()
{
DynamicMethod testDynMethod;
int streamSize;
TestILGeneratorOwner1 target = new TestILGeneratorOwner1();
int newId = 100;
bool actualResult = false;
FieldInfo fieldInfo = _DYNAMIC_METHOD_OWNER_TYPE.GetField(
c_FIELD_NAME,
BindingFlags.Instance |
BindingFlags.NonPublic);
testDynMethod = this.CreateDynMethod(_DYNAMIC_METHOD_OWNER_TYPE, true);
streamSize = 8;
ILGenerator dynMethodIL = testDynMethod.GetILGenerator(streamSize);
this.EmitDynMethodBody(dynMethodIL, fieldInfo);
ILUseLikeInstance1 instanceCallBack = (ILUseLikeInstance1)testDynMethod.CreateDelegate(
typeof(ILUseLikeInstance1),
target);
actualResult = this.VerifyILGenerator(instanceCallBack, target, newId);
Assert.True(actualResult, "Failed to get IL generator for dynamic method.");
}
[Fact]
public void PosTest2()
{
DynamicMethod testDynMethod;
int streamSize;
TestILGeneratorOwner1 target = new TestILGeneratorOwner1();
int newId = 100;
bool actualResult;
FieldInfo fieldInfo = _DYNAMIC_METHOD_OWNER_TYPE.GetField(
c_FIELD_NAME,
BindingFlags.Instance |
BindingFlags.NonPublic);
testDynMethod = this.CreateDynMethod(_DYNAMIC_METHOD_OWNER_TYPE, false);
streamSize = 8;
ILGenerator dynMethodIL = testDynMethod.GetILGenerator(streamSize);
this.EmitDynMethodBody(dynMethodIL, fieldInfo);
ILUseLikeInstance1 instanceCallBack = (ILUseLikeInstance1)testDynMethod.CreateDelegate(
typeof(ILUseLikeInstance1),
target);
actualResult = this.VerifyILGenerator(instanceCallBack, target, newId);
Assert.True(actualResult, "Failed to get IL generator for dynamic method.");
}
[Fact]
public void PosTest3()
{
DynamicMethod testDynMethod;
int streamSize;
TestILGeneratorOwner1 target = new TestILGeneratorOwner1();
int newId = 100;
bool actualResult;
FieldInfo fieldInfo = _DYNAMIC_METHOD_OWNER_TYPE.GetField(
c_FIELD_NAME,
BindingFlags.Instance |
BindingFlags.NonPublic);
testDynMethod = this.CreateDynMethod(this.CurrentModule, true);
streamSize = 8;
ILGenerator dynMethodIL = testDynMethod.GetILGenerator(streamSize);
this.EmitDynMethodBody(dynMethodIL, fieldInfo);
ILUseLikeInstance1 instanceCallBack = (ILUseLikeInstance1)testDynMethod.CreateDelegate(
typeof(ILUseLikeInstance1),
target);
actualResult = this.VerifyILGenerator(instanceCallBack, target, newId);
Assert.True(actualResult, "Failed to get IL generator for dynamic method.");
}
private DynamicMethod CreateDynMethod(Type dynMethodOwnerType, bool skipVisibility)
{
Type retType = typeof(int);
Type[] paramTypes = new Type[]
{
_DYNAMIC_METHOD_OWNER_TYPE,
typeof(int)
};
return new DynamicMethod(c_DYNAMIC_METHOD_NAME,
retType,
paramTypes,
dynMethodOwnerType,
skipVisibility);
}
private DynamicMethod CreateDynMethod(Module mod, bool skipVisibility)
{
Type retType = typeof(int);
Type[] paramTypes = new Type[]
{
_DYNAMIC_METHOD_OWNER_TYPE,
typeof(int)
};
return new DynamicMethod(c_DYNAMIC_METHOD_NAME,
retType,
paramTypes,
mod,
skipVisibility);
}
private void EmitDynMethodBody(ILGenerator methodIL, FieldInfo fld)
{
methodIL.Emit(OpCodes.Ldarg_0);
methodIL.Emit(OpCodes.Ldfld, fld);
methodIL.Emit(OpCodes.Ldarg_0);
methodIL.Emit(OpCodes.Ldarg_1);
methodIL.Emit(OpCodes.Stfld, fld);
methodIL.Emit(OpCodes.Ret);
}
private bool VerifyILGenerator(ILUseLikeInstance1 instanceCallBack,
TestILGeneratorOwner1 target,
int newId)
{
bool retVal = false;
retVal = target.ID == instanceCallBack(newId);
retVal = (target.ID == newId) && retVal;
return retVal;
}
}
internal class TestILGeneratorOwner1
{
private int _id; //c_FIELD_NAME
public TestILGeneratorOwner1(int id)
{
_id = id;
}
public TestILGeneratorOwner1() : this(0)
{
}
public int ID
{
get { return _id; }
}
}
internal delegate int ILUseLikeInstance1(int id);
} | anjumrizwi/corefx | src/System.Reflection.Emit.Lightweight/tests/DynamicMethodGetILGenerator1.cs | C# | mit | 7,024 |
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Dynamic.Utils;
using System.Reflection;
namespace System.Linq.Expressions
{
/// <summary>
/// Represents initializing members of a member of a newly created object.
/// </summary>
/// <remarks>
/// Use the <see cref="M:MemberBind"/> factory methods to create a <see cref="MemberMemberBinding"/>.
/// The value of the <see cref="P:MemberBinding.BindingType"/> property of a <see cref="MemberMemberBinding"/> object is <see cref="MemberBinding"/>.
/// </remarks>
public sealed class MemberMemberBinding : MemberBinding
{
private ReadOnlyCollection<MemberBinding> _bindings;
internal MemberMemberBinding(MemberInfo member, ReadOnlyCollection<MemberBinding> bindings)
#pragma warning disable 618
: base(MemberBindingType.MemberBinding, member)
{
#pragma warning restore 618
_bindings = bindings;
}
/// <summary>
/// Gets the bindings that describe how to initialize the members of a member.
/// </summary>
public ReadOnlyCollection<MemberBinding> Bindings
{
get { return _bindings; }
}
/// <summary>
/// Creates a new expression that is like this one, but using the
/// supplied children. If all of the children are the same, it will
/// return this expression.
/// </summary>
/// <param name="bindings">The <see cref="Bindings" /> property of the result.</param>
/// <returns>This expression if no children changed, or an expression with the updated children.</returns>
public MemberMemberBinding Update(IEnumerable<MemberBinding> bindings)
{
if (bindings == Bindings)
{
return this;
}
return Expression.MemberBind(Member, bindings);
}
}
public partial class Expression
{
/// <summary>
/// Creates a <see cref="MemberMemberBinding"/> that represents the recursive initialization of members of a field or property.
/// </summary>
/// <param name="member">The <see cref="MemberInfo"/> to set the <see cref="P:MemberBinding.Member"/> property equal to.</param>
/// <param name="bindings">An array of <see cref="MemberBinding"/> objects to use to populate the <see cref="P:MemberMemberBindings.Bindings"/> collection.</param>
/// <returns>A <see cref="MemberMemberBinding"/> that has the <see cref="P:MemberBinding.BindingType"/> property equal to <see cref="MemberBinding"/> and the <see cref="P:MemberBinding.Member"/> and <see cref="P:MemberMemberBindings.Bindings"/> properties set to the specified values.</returns>
public static MemberMemberBinding MemberBind(MemberInfo member, params MemberBinding[] bindings)
{
ContractUtils.RequiresNotNull(member, "member");
ContractUtils.RequiresNotNull(bindings, "bindings");
return MemberBind(member, (IEnumerable<MemberBinding>)bindings);
}
/// <summary>
/// Creates a <see cref="MemberMemberBinding"/> that represents the recursive initialization of members of a field or property.
/// </summary>
/// <param name="member">The <see cref="MemberInfo"/> to set the <see cref="P:MemberBinding.Member"/> property equal to.</param>
/// <param name="bindings">An <see cref="IEnumerable{T}"/> that contains <see cref="MemberBinding"/> objects to use to populate the <see cref="P:MemberMemberBindings.Bindings"/> collection.</param>
/// <returns>A <see cref="MemberMemberBinding"/> that has the <see cref="P:MemberBinding.BindingType"/> property equal to <see cref="MemberBinding"/> and the <see cref="P:MemberBinding.Member"/> and <see cref="P:MemberMemberBindings.Bindings"/> properties set to the specified values.</returns>
public static MemberMemberBinding MemberBind(MemberInfo member, IEnumerable<MemberBinding> bindings)
{
ContractUtils.RequiresNotNull(member, "member");
ContractUtils.RequiresNotNull(bindings, "bindings");
ReadOnlyCollection<MemberBinding> roBindings = bindings.ToReadOnly();
Type memberType;
ValidateGettableFieldOrPropertyMember(member, out memberType);
ValidateMemberInitArgs(memberType, roBindings);
return new MemberMemberBinding(member, roBindings);
}
/// <summary>
/// Creates a <see cref="MemberMemberBinding"/> that represents the recursive initialization of members of a member that is accessed by using a property accessor method.
/// </summary>
/// <param name="propertyAccessor">The <see cref="MemberInfo"/> that represents a property accessor method.</param>
/// <param name="bindings">An <see cref="IEnumerable{T}"/> that contains <see cref="MemberBinding"/> objects to use to populate the <see cref="P:MemberMemberBindings.Bindings"/> collection.</param>
/// <returns>
/// A <see cref="MemberMemberBinding"/> that has the <see cref="P:MemberBinding.BindingType"/> property equal to <see cref="MemberBinding"/>,
/// the Member property set to the <see cref="PropertyInfo"/> that represents the property accessed in <paramref name="propertyAccessor"/>,
/// and <see cref="P:MemberMemberBindings.Bindings"/> properties set to the specified values.
/// </returns>
public static MemberMemberBinding MemberBind(MethodInfo propertyAccessor, params MemberBinding[] bindings)
{
ContractUtils.RequiresNotNull(propertyAccessor, "propertyAccessor");
return MemberBind(GetProperty(propertyAccessor), bindings);
}
/// <summary>
/// Creates a <see cref="MemberMemberBinding"/> that represents the recursive initialization of members of a member that is accessed by using a property accessor method.
/// </summary>
/// <param name="propertyAccessor">The <see cref="MemberInfo"/> that represents a property accessor method.</param>
/// <param name="bindings">An <see cref="IEnumerable{T}"/> that contains <see cref="MemberBinding"/> objects to use to populate the <see cref="P:MemberMemberBindings.Bindings"/> collection.</param>
/// <returns>
/// A <see cref="MemberMemberBinding"/> that has the <see cref="P:MemberBinding.BindingType"/> property equal to <see cref="MemberBinding"/>,
/// the Member property set to the <see cref="PropertyInfo"/> that represents the property accessed in <paramref name="propertyAccessor"/>,
/// and <see cref="P:MemberMemberBindings.Bindings"/> properties set to the specified values.
/// </returns>
public static MemberMemberBinding MemberBind(MethodInfo propertyAccessor, IEnumerable<MemberBinding> bindings)
{
ContractUtils.RequiresNotNull(propertyAccessor, "propertyAccessor");
return MemberBind(GetProperty(propertyAccessor), bindings);
}
private static void ValidateGettableFieldOrPropertyMember(MemberInfo member, out Type memberType)
{
FieldInfo fi = member as FieldInfo;
if (fi == null)
{
PropertyInfo pi = member as PropertyInfo;
if (pi == null)
{
throw Error.ArgumentMustBeFieldInfoOrPropertInfo();
}
if (!pi.CanRead)
{
throw Error.PropertyDoesNotHaveGetter(pi);
}
memberType = pi.PropertyType;
}
else
{
memberType = fi.FieldType;
}
}
private static void ValidateMemberInitArgs(Type type, ReadOnlyCollection<MemberBinding> bindings)
{
for (int i = 0, n = bindings.Count; i < n; i++)
{
MemberBinding b = bindings[i];
ContractUtils.RequiresNotNull(b, "bindings");
if (!b.Member.DeclaringType.IsAssignableFrom(type))
{
throw Error.NotAMemberOfType(b.Member.Name, type);
}
}
}
}
} | Yanjing123/corefx | src/System.Linq.Expressions/src/System/Linq/Expressions/MemberMemberBinding.cs | C# | mit | 8,438 |
#import "EXPExpect.h"
#import "NSObject+Expecta.h"
#import "Expecta.h"
#import "EXPUnsupportedObject.h"
#import "EXPMatcher.h"
#import "EXPBlockDefinedMatcher.h"
#import <libkern/OSAtomic.h>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-designated-initializers"
@implementation EXPExpect
#pragma clang diagnostic pop
@dynamic
actual,
to,
toNot,
notTo,
will,
willNot,
after;
@synthesize
actualBlock=_actualBlock,
testCase=_testCase,
negative=_negative,
asynchronous=_asynchronous,
timeout=_timeout,
lineNumber=_lineNumber,
fileName=_fileName;
- (instancetype)initWithActualBlock:(id)actualBlock testCase:(id)testCase lineNumber:(int)lineNumber fileName:(const char *)fileName {
self = [super init];
if(self) {
self.actualBlock = actualBlock;
self.testCase = testCase;
self.negative = NO;
self.asynchronous = NO;
self.timeout = [Expecta asynchronousTestTimeout];
self.lineNumber = lineNumber;
self.fileName = fileName;
}
return self;
}
- (void)dealloc
{
[_actualBlock release];
_actualBlock = nil;
[super dealloc];
}
+ (EXPExpect *)expectWithActualBlock:(id)actualBlock testCase:(id)testCase lineNumber:(int)lineNumber fileName:(const char *)fileName {
return [[[EXPExpect alloc] initWithActualBlock:actualBlock testCase:(id)testCase lineNumber:lineNumber fileName:fileName] autorelease];
}
#pragma mark -
- (EXPExpect *)to {
return self;
}
- (EXPExpect *)toNot {
self.negative = !self.negative;
return self;
}
- (EXPExpect *)notTo {
return [self toNot];
}
- (EXPExpect *)will {
self.asynchronous = YES;
return self;
}
- (EXPExpect *)willNot {
return self.will.toNot;
}
- (EXPExpect *(^)(NSTimeInterval))after
{
EXPExpect * (^block)(NSTimeInterval) = [^EXPExpect *(NSTimeInterval timeout) {
self.asynchronous = YES;
self.timeout = timeout;
return self;
} copy];
return [block autorelease];
}
#pragma mark -
- (id)actual {
if(self.actualBlock) {
return self.actualBlock();
}
return nil;
}
- (void)applyMatcher:(id<EXPMatcher>)matcher
{
id actual = [self actual];
[self applyMatcher:matcher to:&actual];
}
- (void)applyMatcher:(id<EXPMatcher>)matcher to:(NSObject **)actual {
if([*actual isKindOfClass:[EXPUnsupportedObject class]]) {
EXPFail(self.testCase, self.lineNumber, self.fileName,
[NSString stringWithFormat:@"expecting a %@ is not supported", ((EXPUnsupportedObject *)*actual).type]);
} else {
BOOL failed = NO;
if([matcher respondsToSelector:@selector(meetsPrerequesiteFor:)] &&
![matcher meetsPrerequesiteFor:*actual]) {
failed = YES;
} else {
BOOL matchResult = NO;
if(self.asynchronous) {
NSTimeInterval timeOut = self.timeout;
NSDate *expiryDate = [NSDate dateWithTimeIntervalSinceNow:timeOut];
while(1) {
matchResult = [matcher matches:*actual];
failed = self.negative ? matchResult : !matchResult;
if(!failed || ([(NSDate *)[NSDate date] compare:expiryDate] == NSOrderedDescending)) {
break;
}
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.01]];
OSMemoryBarrier();
*actual = self.actual;
}
} else {
matchResult = [matcher matches:*actual];
}
failed = self.negative ? matchResult : !matchResult;
}
if(failed) {
NSString *message = nil;
if(self.negative) {
if ([matcher respondsToSelector:@selector(failureMessageForNotTo:)]) {
message = [matcher failureMessageForNotTo:*actual];
}
} else {
if ([matcher respondsToSelector:@selector(failureMessageForTo:)]) {
message = [matcher failureMessageForTo:*actual];
}
}
if (message == nil) {
message = @"Match Failed.";
}
EXPFail(self.testCase, self.lineNumber, self.fileName, message);
}
}
self.negative = NO;
}
#pragma mark - Dynamic predicate dispatch
- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector
{
if ([self.actual respondsToSelector:aSelector]) {
return [self.actual methodSignatureForSelector:aSelector];
}
return [super methodSignatureForSelector:aSelector];
}
- (void)forwardInvocation:(NSInvocation *)anInvocation
{
if ([self.actual respondsToSelector:anInvocation.selector]) {
EXPDynamicPredicateMatcher *matcher = [[EXPDynamicPredicateMatcher alloc] initWithExpectation:self selector:anInvocation.selector];
[anInvocation setSelector:@selector(dispatch)];
[anInvocation invokeWithTarget:matcher];
[matcher release];
}
else {
[super forwardInvocation:anInvocation];
}
}
@end
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-designated-initializers"
@implementation EXPDynamicPredicateMatcher
#pragma clang diagnostic pop
- (instancetype)initWithExpectation:(EXPExpect *)expectation selector:(SEL)selector
{
if ((self = [super init])) {
_expectation = expectation;
_selector = selector;
}
return self;
}
- (BOOL)matches:(id)actual
{
return (BOOL)[actual performSelector:_selector];
}
- (NSString *)failureMessageForTo:(id)actual
{
return [NSString stringWithFormat:@"expected %@ to be true", NSStringFromSelector(_selector)];
}
- (NSString *)failureMessageForNotTo:(id)actual
{
return [NSString stringWithFormat:@"expected %@ to be false", NSStringFromSelector(_selector)];
}
- (void (^)(void))dispatch
{
__block id blockExpectation = _expectation;
return [[^{
[blockExpectation applyMatcher:self];
} copy] autorelease];
}
@end
| BumbleB-IO/BumbleB-iOS | Example/Pods/Expecta/Expecta/EXPExpect.m | Matlab | mit | 5,624 |
<?php
namespace Doctrine\Tests\ORM\Tools;
use Doctrine\ORM\Events;
use Doctrine\ORM\Mapping\ClassMetadataFactory;
use Doctrine\ORM\Tools\ResolveTargetEntityListener;
require_once __DIR__ . '/../../TestInit.php';
class ResolveTargetEntityListenerTest extends \Doctrine\Tests\OrmTestCase
{
/**
* @var EntityManager
*/
private $em = null;
/**
* @var ResolveTargetEntityListener
*/
private $listener = null;
/**
* @var ClassMetadataFactory
*/
private $factory = null;
public function setUp()
{
$annotationDriver = $this->createAnnotationDriver();
$this->em = $this->_getTestEntityManager();
$this->em->getConfiguration()->setMetadataDriverImpl($annotationDriver);
$this->factory = new ClassMetadataFactory;
$this->factory->setEntityManager($this->em);
$this->listener = new ResolveTargetEntityListener;
}
/**
* @group DDC-1544
*/
public function testResolveTargetEntityListenerCanResolveTargetEntity()
{
$evm = $this->em->getEventManager();
$this->listener->addResolveTargetEntity(
'Doctrine\Tests\ORM\Tools\ResolveTargetInterface',
'Doctrine\Tests\ORM\Tools\ResolveTargetEntity',
array()
);
$this->listener->addResolveTargetEntity(
'Doctrine\Tests\ORM\Tools\TargetInterface',
'Doctrine\Tests\ORM\Tools\TargetEntity',
array()
);
$evm->addEventListener(Events::loadClassMetadata, $this->listener);
$cm = $this->factory->getMetadataFor('Doctrine\Tests\ORM\Tools\ResolveTargetEntity');
$meta = $cm->associationMappings;
$this->assertSame('Doctrine\Tests\ORM\Tools\TargetEntity', $meta['manyToMany']['targetEntity']);
$this->assertSame('Doctrine\Tests\ORM\Tools\ResolveTargetEntity', $meta['manyToOne']['targetEntity']);
$this->assertSame('Doctrine\Tests\ORM\Tools\ResolveTargetEntity', $meta['oneToMany']['targetEntity']);
$this->assertSame('Doctrine\Tests\ORM\Tools\TargetEntity', $meta['oneToOne']['targetEntity']);
}
/**
* @group DDC-2109
*/
public function testAssertTableColumnsAreNotAddedInManyToMany()
{
$evm = $this->em->getEventManager();
$this->listener->addResolveTargetEntity(
'Doctrine\Tests\ORM\Tools\ResolveTargetInterface',
'Doctrine\Tests\ORM\Tools\ResolveTargetEntity',
array()
);
$this->listener->addResolveTargetEntity(
'Doctrine\Tests\ORM\Tools\TargetInterface',
'Doctrine\Tests\ORM\Tools\TargetEntity',
array()
);
$evm->addEventListener(Events::loadClassMetadata, $this->listener);
$cm = $this->factory->getMetadataFor('Doctrine\Tests\ORM\Tools\ResolveTargetEntity');
$meta = $cm->associationMappings['manyToMany'];
$this->assertSame('Doctrine\Tests\ORM\Tools\TargetEntity', $meta['targetEntity']);
$this->assertEquals(array('resolvetargetentity_id', 'targetinterface_id'), $meta['joinTableColumns']);
}
}
interface ResolveTargetInterface
{
public function getId();
}
interface TargetInterface extends ResolveTargetInterface
{
}
/**
* @Entity
*/
class ResolveTargetEntity implements ResolveTargetInterface
{
/**
* @Id
* @Column(type="integer")
* @GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ManyToMany(targetEntity="Doctrine\Tests\ORM\Tools\TargetInterface")
*/
private $manyToMany;
/**
* @ManyToOne(targetEntity="Doctrine\Tests\ORM\Tools\ResolveTargetInterface", inversedBy="oneToMany")
*/
private $manyToOne;
/**
* @OneToMany(targetEntity="Doctrine\Tests\ORM\Tools\ResolveTargetInterface", mappedBy="manyToOne")
*/
private $oneToMany;
/**
* @OneToOne(targetEntity="Doctrine\Tests\ORM\Tools\TargetInterface")
* @JoinColumn(name="target_entity_id", referencedColumnName="id")
*/
private $oneToOne;
public function getId()
{
return $this->id;
}
}
/**
* @Entity
*/
class TargetEntity implements TargetInterface
{
/**
* @Id
* @Column(type="integer")
* @GeneratedValue(strategy="AUTO")
*/
private $id;
public function getId()
{
return $this->id;
}
}
| Numerico-Informatic-Systems-Pvt-Ltd/arnojobportal | vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/ResolveTargetEntityListenerTest.php | PHP | mit | 4,361 |
/*
Highstock JS v2.1.1 (2015-02-17)
Standalone Highcharts Framework
License: MIT License
*/
var HighchartsAdapter=function(){function p(c){function b(b,a,d){b.removeEventListener(a,d,!1)}function d(b,a,d){d=b.HCProxiedMethods[d.toString()];b.detachEvent("on"+a,d)}function a(a,c){var f=a.HCEvents,i,g,k,j;if(a.removeEventListener)i=b;else if(a.attachEvent)i=d;else return;c?(g={},g[c]=!0):g=f;for(j in g)if(f[j])for(k=f[j].length;k--;)i(a,j,f[j][k])}c.HCExtended||Highcharts.extend(c,{HCExtended:!0,HCEvents:{},bind:function(b,a){var d=this,c=this.HCEvents,g;if(d.addEventListener)d.addEventListener(b,
a,!1);else if(d.attachEvent){g=function(b){b.target=b.srcElement||window;a.call(d,b)};if(!d.HCProxiedMethods)d.HCProxiedMethods={};d.HCProxiedMethods[a.toString()]=g;d.attachEvent("on"+b,g)}c[b]===s&&(c[b]=[]);c[b].push(a)},unbind:function(c,h){var f,i;c?(f=this.HCEvents[c]||[],h?(i=HighchartsAdapter.inArray(h,f),i>-1&&(f.splice(i,1),this.HCEvents[c]=f),this.removeEventListener?b(this,c,h):this.attachEvent&&d(this,c,h)):(a(this,c),this.HCEvents[c]=[])):(a(this),this.HCEvents={})},trigger:function(b,
a){var d=this.HCEvents[b]||[],c=d.length,g,k,j;k=function(){a.defaultPrevented=!0};for(g=0;g<c;g++){j=d[g];if(a.stopped)break;a.preventDefault=k;a.target=this;if(!a.type)a.type=b;j.call(this,a)===!1&&a.preventDefault()}}});return c}var s,l=document,q=[],m=[],r,n={},o;Math.easeInOutSine=function(c,b,d,a){return-d/2*(Math.cos(Math.PI*c/a)-1)+b};return{init:function(c){if(!l.defaultView)this._getStyle=function(b,d){var a;return b.style[d]?b.style[d]:(d==="opacity"&&(d="filter"),a=b.currentStyle[d.replace(/\-(\w)/g,
function(b,a){return a.toUpperCase()})],d==="filter"&&(a=a.replace(/alpha\(opacity=([0-9]+)\)/,function(b,a){return a/100})),a===""?1:a)},this.adapterRun=function(b,d){var a={width:"clientWidth",height:"clientHeight"}[d];if(a)return b.style.zoom=1,b[a]-2*parseInt(HighchartsAdapter._getStyle(b,"padding"),10)};if(!Array.prototype.forEach)this.each=function(b,d){for(var a=0,c=b.length;a<c;a++)if(d.call(b[a],b[a],a,b)===!1)return a};if(!Array.prototype.indexOf)this.inArray=function(b,d){var a,c=0;if(d)for(a=
d.length;c<a;c++)if(d[c]===b)return c;return-1};if(!Array.prototype.filter)this.grep=function(b,d){for(var a=[],c=0,h=b.length;c<h;c++)d(b[c],c)&&a.push(b[c]);return a};o=function(b,c,a){this.options=c;this.elem=b;this.prop=a};o.prototype={update:function(){var b;b=this.paths;var d=this.elem,a=d.element;if(n[this.prop])n[this.prop](this);else b&&a?d.attr("d",c.step(b[0],b[1],this.now,this.toD)):d.attr?a&&d.attr(this.prop,this.now):(b={},b[this.prop]=this.now+this.unit,Highcharts.css(d,b));this.options.step&&
this.options.step.call(this.elem,this.now,this)},custom:function(b,c,a){var e=this,h=function(a){return e.step(a)},f;this.startTime=+new Date;this.start=b;this.end=c;this.unit=a;this.now=this.start;this.pos=this.state=0;h.elem=this.elem;h()&&m.push(h)===1&&(r=setInterval(function(){for(f=0;f<m.length;f++)m[f]()||m.splice(f--,1);m.length||clearInterval(r)},13))},step:function(b){var c=+new Date,a;a=this.options;var e=this.elem,h;if(e.stopAnimation||e.attr&&!e.element)a=!1;else if(b||c>=a.duration+
this.startTime){this.now=this.end;this.pos=this.state=1;this.update();b=this.options.curAnim[this.prop]=!0;for(h in a.curAnim)a.curAnim[h]!==!0&&(b=!1);b&&a.complete&&a.complete.call(e);a=!1}else e=c-this.startTime,this.state=e/a.duration,this.pos=a.easing(e,0,1,a.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update(),a=!0;return a}};this.animate=function(b,d,a){var e,h="",f,i,g;b.stopAnimation=!1;if(typeof a!=="object"||a===null)e=arguments,a={duration:e[2],easing:e[3],complete:e[4]};
if(typeof a.duration!=="number")a.duration=400;a.easing=Math[a.easing]||Math.easeInOutSine;a.curAnim=Highcharts.extend({},d);for(g in d)i=new o(b,a,g),f=null,g==="d"?(i.paths=c.init(b,b.d,d.d),i.toD=d.d,e=0,f=1):b.attr?e=b.attr(g):(e=parseFloat(HighchartsAdapter._getStyle(b,g))||0,g!=="opacity"&&(h="px")),f||(f=d[g]),i.custom(e,f,h)}},_getStyle:function(c,b){return window.getComputedStyle(c,void 0).getPropertyValue(b)},addAnimSetter:function(c,b){n[c]=b},getScript:function(c,b){var d=l.getElementsByTagName("head")[0],
a=l.createElement("script");a.type="text/javascript";a.src=c;a.onload=b;d.appendChild(a)},inArray:function(c,b){return b.indexOf?b.indexOf(c):q.indexOf.call(b,c)},adapterRun:function(c,b){return parseInt(HighchartsAdapter._getStyle(c,b),10)},grep:function(c,b){return q.filter.call(c,b)},map:function(c,b){for(var d=[],a=0,e=c.length;a<e;a++)d[a]=b.call(c[a],c[a],a,c);return d},offset:function(c){var b=document.documentElement,c=c.getBoundingClientRect();return{top:c.top+(window.pageYOffset||b.scrollTop)-
(b.clientTop||0),left:c.left+(window.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}},addEvent:function(c,b,d){p(c).bind(b,d)},removeEvent:function(c,b,d){p(c).unbind(b,d)},fireEvent:function(c,b,d,a){var e;l.createEvent&&(c.dispatchEvent||c.fireEvent)?(e=l.createEvent("Events"),e.initEvent(b,!0,!0),e.target=c,Highcharts.extend(e,d),c.dispatchEvent?c.dispatchEvent(e):c.fireEvent(b,e)):c.HCExtended===!0&&(d=d||{},c.trigger(b,d));d&&d.defaultPrevented&&(a=null);a&&a(d)},washMouseEvent:function(c){return c},
stop:function(c){c.stopAnimation=!0},each:function(c,b){return Array.prototype.forEach.call(c,b)}}}();
| yinghunglai/cdnjs | ajax/libs/highstock/2.1.1/adapters/standalone-framework.js | JavaScript | mit | 5,313 |
//! moment.js locale configuration
//! locale : Marathi (mr)
//! author : Harshad Kale : https://github.com/kalehv
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['moment'], factory) :
factory(global.moment)
}(this, function (moment) { 'use strict';
var symbolMap = {
'1': '१',
'2': '२',
'3': '३',
'4': '४',
'5': '५',
'6': '६',
'7': '७',
'8': '८',
'9': '९',
'0': '०'
},
numberMap = {
'१': '1',
'२': '2',
'३': '3',
'४': '4',
'५': '5',
'६': '6',
'७': '7',
'८': '8',
'९': '9',
'०': '0'
};
var mr = moment.defineLocale('mr', {
months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'),
monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'),
weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),
weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),
longDateFormat : {
LT : 'A h:mm वाजता',
LTS : 'A h:mm:ss वाजता',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY, A h:mm वाजता',
LLLL : 'dddd, D MMMM YYYY, A h:mm वाजता'
},
calendar : {
sameDay : '[आज] LT',
nextDay : '[उद्या] LT',
nextWeek : 'dddd, LT',
lastDay : '[काल] LT',
lastWeek: '[मागील] dddd, LT',
sameElse : 'L'
},
relativeTime : {
future : '%s नंतर',
past : '%s पूर्वी',
s : 'सेकंद',
m: 'एक मिनिट',
mm: '%d मिनिटे',
h : 'एक तास',
hh : '%d तास',
d : 'एक दिवस',
dd : '%d दिवस',
M : 'एक महिना',
MM : '%d महिने',
y : 'एक वर्ष',
yy : '%d वर्षे'
},
preparse: function (string) {
return string.replace(/[१२३४५६७८९०]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'रात्री') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'सकाळी') {
return hour;
} else if (meridiem === 'दुपारी') {
return hour >= 10 ? hour : hour + 12;
} else if (meridiem === 'सायंकाळी') {
return hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'रात्री';
} else if (hour < 10) {
return 'सकाळी';
} else if (hour < 17) {
return 'दुपारी';
} else if (hour < 20) {
return 'सायंकाळी';
} else {
return 'रात्री';
}
},
week : {
dow : 0, // Sunday is the first day of the week.
doy : 6 // The week that contains Jan 1st is the first week of the year.
}
});
return mr;
})); | ishg/Smile | www/lib/moment/locale/mr.js | JavaScript | mit | 4,554 |
// Load modules
var Utils = require('./utils');
// Declare internals
var internals = {
delimiter: '&',
depth: 5,
arrayLimit: 20,
parameterLimit: 1000
};
internals.parseValues = function (str, options) {
var obj = {};
var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit);
for (var i = 0, il = parts.length; i < il; ++i) {
var part = parts[i];
var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1;
if (pos === -1) {
obj[Utils.decode(part)] = '';
}
else {
var key = Utils.decode(part.slice(0, pos));
var val = Utils.decode(part.slice(pos + 1));
if (!obj.hasOwnProperty(key)) {
obj[key] = val;
}
else {
obj[key] = [].concat(obj[key]).concat(val);
}
}
}
return obj;
};
internals.parseObject = function (chain, val, options) {
if (!chain.length) {
return val;
}
var root = chain.shift();
var obj = {};
if (root === '[]') {
obj = [];
obj = obj.concat(internals.parseObject(chain, val, options));
}
else {
var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root;
var index = parseInt(cleanRoot, 10);
var indexString = '' + index;
if (!isNaN(index) &&
root !== cleanRoot &&
indexString === cleanRoot &&
index <= options.arrayLimit) {
obj = [];
obj[index] = internals.parseObject(chain, val, options);
}
else {
obj[cleanRoot] = internals.parseObject(chain, val, options);
}
}
return obj;
};
internals.parseKeys = function (key, val, options) {
if (!key) {
return;
}
// The regex chunks
var parent = /^([^\[\]]*)/;
var child = /(\[[^\[\]]*\])/g;
// Get the parent
var segment = parent.exec(key);
// Don't allow them to overwrite object prototype properties
if (Object.prototype.hasOwnProperty(segment[1])) {
return;
}
// Stash the parent if it exists
var keys = [];
if (segment[1]) {
keys.push(segment[1]);
}
// Loop through children appending to the array until we hit depth
var i = 0;
while ((segment = child.exec(key)) !== null && i < options.depth) {
++i;
if (!Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) {
keys.push(segment[1]);
}
}
// If there's a remainder, just add whatever is left
if (segment) {
keys.push('[' + key.slice(segment.index) + ']');
}
return internals.parseObject(keys, val, options);
};
module.exports = function (str, options) {
if (str === '' ||
str === null ||
typeof str === 'undefined') {
return {};
}
options = options || {};
options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter;
options.depth = typeof options.depth === 'number' ? options.depth : internals.depth;
options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit;
options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit;
var tempObj = typeof str === 'string' ? internals.parseValues(str, options) : str;
var obj = {};
// Iterate over the keys and setup the new object
var keys = Object.keys(tempObj);
for (var i = 0, il = keys.length; i < il; ++i) {
var key = keys[i];
var newObj = internals.parseKeys(key, tempObj[key], options);
obj = Utils.merge(obj, newObj);
}
return Utils.compact(obj);
};
| walgheraibi/StemCells | node_modules/karma/node_modules/connect/node_modules/qs/lib/parse.js | JavaScript | mit | 3,921 |
({"months-format-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"quarters-standAlone-narrow":["1","2","3","4"],"field-weekday":"jour de la semaine","dateFormatItem-yyQQQQ":"QQQQ yy","dateFormatItem-yQQQ":"QQQ y","dateFormatItem-yMEd":"EEE d/M/yyyy","dateFormatItem-MMMEd":"E d MMM","eraNarrow":["av. J.-C.","ap. J.-C."],"dateFormatItem-MMMdd":"dd MMM","dateFormat-long":"d MMMM y","months-format-wide":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],"dateTimeFormat-medium":"{1} {0}","dateFormatItem-EEEd":"d EEE","dateFormat-full":"EEEE d MMMM y","dateFormatItem-Md":"d/M","field-era":"ère","dateFormatItem-yM":"M/yyyy","months-standAlone-wide":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],"timeFormat-short":"HH:mm","quarters-format-wide":["1er trimestre","2e trimestre","3e trimestre","4e trimestre"],"timeFormat-long":"HH:mm:ss z","field-year":"année","dateFormatItem-yMMM":"MMM y","dateFormatItem-yQ":"'T'Q y","dateFormatItem-yyyyMMMM":"MMMM y","field-hour":"heure","dateFormatItem-MMdd":"dd/MM","months-format-abbr":["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],"dateFormatItem-yyQ":"'T'Q yy","timeFormat-full":"HH:mm:ss zzzz","am":"AM","months-standAlone-abbr":["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],"quarters-format-abbr":["T1","T2","T3","T4"],"quarters-standAlone-wide":["1er trimestre","2e trimestre","3e trimestre","4e trimestre"],"dateFormatItem-HHmmss":"HH:mm:ss","dateFormatItem-M":"L","days-standAlone-wide":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"dateFormatItem-MMMMd":"d MMMM","dateFormatItem-yyMMMEEEd":"EEE d MMM yy","dateFormatItem-yyMMM":"MMM yy","timeFormat-medium":"HH:mm:ss","dateFormatItem-Hm":"H:mm","quarters-standAlone-abbr":["T1","T2","T3","T4"],"eraAbbr":["av. J.-C.","ap. J.-C."],"field-minute":"minute","field-dayperiod":"cadran","days-standAlone-abbr":["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],"dateFormatItem-yyMMMd":"d MMM yy","dateFormatItem-d":"d","dateFormatItem-ms":"mm:ss","quarters-format-narrow":["T1","T2","T3","T4"],"dateTimeFormat-long":"{1} {0}","dateFormatItem-MMMd":"d MMM","dateFormatItem-MEd":"EEE d/M","dateFormatItem-yMMMM":"MMMM y","field-day":"jour","days-format-wide":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"field-zone":"fuseau horaire","dateFormatItem-y":"y","months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateFormatItem-yyMM":"MM/yy","days-format-abbr":["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],"eraNames":["avant Jésus-Christ","après Jésus-Christ"],"days-format-narrow":["D","L","M","M","J","V","S"],"field-month":"mois","days-standAlone-narrow":["D","L","M","M","J","V","S"],"dateFormatItem-MMM":"LLL","dateFormatItem-HHmm":"HH:mm","pm":"PM","dateFormatItem-MMMMEd":"EEE d MMMM","dateFormat-short":"dd/MM/yy","dateFormatItem-MMd":"d/MM","field-second":"seconde","dateFormatItem-yMMMEd":"EEE d MMM y","field-week":"semaine","dateFormat-medium":"d MMM y","dateFormatItem-mmss":"mm:ss","dateTimeFormat-short":"{1} {0}","dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","dateTimeFormats-appendItem-Era":"{0} {1}","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","dateTimeFormat-full":"{1} {0}","dateTimeFormats-appendItem-Day":"{0} ({2}: {1})","dateFormatItem-hm":"h:mm a","dateTimeFormats-appendItem-Year":"{0} {1}","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateTimeFormats-appendItem-Timezone":"{0} {1}","dateFormatItem-Hms":"H:mm:ss","dateFormatItem-hms":"h:mm:ss a"}) | seogi1004/cdnjs | ajax/libs/dojo/1.4.2/cldr/nls/fr/gregorian.js | JavaScript | mit | 3,908 |
({"field-hour":"Hora","field-dayperiod":"Período do dia","field-minute":"Minuto","timeFormat-full":"HH'h'mm'min'ss's' z","field-week":"Semana","field-weekday":"Dia da semana","field-second":"Segundo","dateFormat-medium":"dd/MM/yyyy","field-day":"Dia","timeFormat-long":"H'h'm'min's's' z","field-month":"Mês","field-year":"Ano","dateFormat-short":"dd/MM/yy","field-zone":"Fuso","months-format-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"quarters-standAlone-narrow":["1","2","3","4"],"dateFormatItem-yQQQ":"y QQQ","dateFormatItem-yMEd":"EEE, dd/MM/yyyy","dateFormatItem-MMMEd":"EEE, d 'de' MMM","eraNarrow":["a.C.","d.C."],"dateFormat-long":"d 'de' MMMM 'de' y","months-format-wide":["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],"dateTimeFormat-medium":"{1} {0}","dateFormatItem-EEEd":"EEE, d","dateFormat-full":"EEEE, d 'de' MMMM 'de' y","dateFormatItem-Md":"d/M","field-era":"Era","dateFormatItem-yM":"MM/yyyy","months-standAlone-wide":["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],"timeFormat-short":"HH:mm","quarters-format-wide":["1º trimestre","2º trimestre","3º trimestre","4º trimestre"],"dateFormatItem-yMMM":"MMM 'de' y","dateFormatItem-yQ":"yyyy Q","dateFormatItem-MMdd":"dd/MM","months-format-abbr":["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],"dateFormatItem-yyQ":"Q yy","am":"AM","months-standAlone-abbr":["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],"quarters-format-abbr":["T1","T2","T3","T4"],"quarters-standAlone-wide":["1º trimestre","2º trimestre","3º trimestre","4º trimestre"],"dateFormatItem-HHmmss":"H'h'mm'min'ss's'","dateFormatItem-M":"L","days-standAlone-wide":["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],"dateFormatItem-yyyyMMM":"MMM 'de' y","dateFormatItem-MMMMd":"d 'de' MMMM","dateFormatItem-yyMMMEEEd":"EEE, d 'de' MMM 'de' yy","dateFormatItem-yyMMM":"MMM 'de' yy","timeFormat-medium":"HH:mm:ss","dateFormatItem-Hm":"H'h'mm","quarters-standAlone-abbr":["T1","T2","T3","T4"],"eraAbbr":["a.C.","d.C."],"days-standAlone-abbr":["dom","seg","ter","qua","qui","sex","sáb"],"dateFormatItem-yyMMMd":"d 'de' MMM 'de' yy","dateFormatItem-d":"d","dateFormatItem-ms":"mm'min'ss's'","dateFormatItem-MMMd":"d 'de' MMM","dateFormatItem-MEd":"EEE, dd/MM","dateFormatItem-yMMMM":"MMMM 'de' y","days-format-wide":["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],"dateFormatItem-yyyyMM":"MM/yyyy","dateFormatItem-y":"y","months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateFormatItem-yyMM":"MM/yy","days-format-abbr":["dom","seg","ter","qua","qui","sex","sáb"],"eraNames":["Antes de Cristo","Ano do Senhor"],"days-format-narrow":["D","S","T","Q","Q","S","S"],"days-standAlone-narrow":["D","S","T","Q","Q","S","S"],"dateFormatItem-MMM":"LLL","dateFormatItem-HHmm":"HH'h'mm","pm":"PM","dateFormatItem-MMMMEd":"EEE, d 'de' MMMM","dateFormatItem-yMMMEd":"EEE, d 'de' MMM 'de' y","dateFormatItem-mmss":"mm'min'ss's'","dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","dateTimeFormats-appendItem-Era":"{0} {1}","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","quarters-format-narrow":["1","2","3","4"],"dateTimeFormat-long":"{1} {0}","dateTimeFormat-full":"{1} {0}","dateTimeFormats-appendItem-Day":"{0} ({2}: {1})","dateFormatItem-hm":"h:mm a","dateTimeFormats-appendItem-Year":"{0} {1}","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateTimeFormats-appendItem-Timezone":"{0} {1}","dateTimeFormat-short":"{1} {0}","dateFormatItem-Hms":"H:mm:ss","dateFormatItem-hms":"h:mm:ss a"}) | BitsyCode/cdnjs | ajax/libs/dojo/1.4.4/cldr/nls/pt-br/gregorian.js | JavaScript | mit | 3,961 |
/**
* Expose `Backoff`.
*/
module.exports = Backoff;
/**
* Initialize backoff timer with `opts`.
*
* - `min` initial timeout in milliseconds [100]
* - `max` max timeout [10000]
* - `jitter` [0]
* - `factor` [2]
*
* @param {Object} opts
* @api public
*/
function Backoff(opts) {
opts = opts || {};
this.ms = opts.min || 100;
this.max = opts.max || 10000;
this.factor = opts.factor || 2;
this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;
this.attempts = 0;
}
/**
* Return the backoff duration.
*
* @return {Number}
* @api public
*/
Backoff.prototype.duration = function(){
var ms = this.ms * Math.pow(this.factor, this.attempts++);
if (this.jitter) {
var rand = Math.random();
var deviation = Math.floor(rand * this.jitter * ms);
ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;
}
return Math.min(ms, this.max) | 0;
};
/**
* Reset the number of attempts.
*
* @api public
*/
Backoff.prototype.reset = function(){
this.attempts = 0;
};
/**
* Set the minimum duration
*
* @api public
*/
Backoff.prototype.setMin = function(min){
this.ms = min;
};
/**
* Set the maximum duration
*
* @api public
*/
Backoff.prototype.setMax = function(max){
this.max = max;
};
/**
* Set the jitter
*
* @api public
*/
Backoff.prototype.setJitter = function(jitter){
this.jitter = jitter;
};
| vithonghcm/g3c | node_modules/backo2/index.js | JavaScript | mit | 1,399 |
var enforcePrecision = require('./enforcePrecision');
var _defaultDict = {
thousand : 'K',
million : 'M',
billion : 'B'
};
/**
* Abbreviate number if bigger than 1000. (eg: 2.5K, 17.5M, 3.4B, ...)
*/
function abbreviateNumber(val, nDecimals, dict){
nDecimals = nDecimals != null? nDecimals : 1;
dict = dict || _defaultDict;
val = enforcePrecision(val, nDecimals);
var str, mod;
if (val < 1000000) {
mod = enforcePrecision(val / 1000, nDecimals);
// might overflow to next scale during rounding
str = mod < 1000? mod + dict.thousand : 1 + dict.million;
} else if (val < 1000000000) {
mod = enforcePrecision(val / 1000000, nDecimals);
str = mod < 1000? mod + dict.million : 1 + dict.billion;
} else {
str = enforcePrecision(val / 1000000000, nDecimals) + dict.billion;
}
return str;
}
module.exports = abbreviateNumber;
| cj1240/mycrm | static/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/abbreviate.js | JavaScript | mit | 1,028 |
'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": [
"AM",
"PM"
],
"DAY": [
"ned\u011ble",
"pond\u011bl\u00ed",
"\u00fater\u00fd",
"st\u0159eda",
"\u010dtvrtek",
"p\u00e1tek",
"sobota"
],
"MONTH": [
"ledna",
"\u00fanora",
"b\u0159ezna",
"dubna",
"kv\u011btna",
"\u010dervna",
"\u010dervence",
"srpna",
"z\u00e1\u0159\u00ed",
"\u0159\u00edjna",
"listopadu",
"prosince"
],
"SHORTDAY": [
"ne",
"po",
"\u00fat",
"st",
"\u010dt",
"p\u00e1",
"so"
],
"SHORTMONTH": [
"led",
"\u00fano",
"b\u0159e",
"dub",
"kv\u011b",
"\u010dvn",
"\u010dvc",
"srp",
"z\u00e1\u0159",
"\u0159\u00edj",
"lis",
"pro"
],
"fullDate": "EEEE d. MMMM y",
"longDate": "d. MMMM y",
"medium": "d. M. y H:mm:ss",
"mediumDate": "d. M. y",
"mediumTime": "H:mm:ss",
"short": "dd.MM.yy H:mm",
"shortDate": "dd.MM.yy",
"shortTime": "H:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "K\u010d",
"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": "cs-cz",
"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 (i >= 2 && i <= 4 && vf.v == 0) { return PLURAL_CATEGORY.FEW; } if (vf.v != 0) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
});
}]); | brix/cdnjs | ajax/libs/angular.js/1.3.0-beta.15/i18n/angular-locale_cs-cz.js | JavaScript | mit | 2,599 |
'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/y HH:mm",
"shortDate": "dd/MM/y",
"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-fr",
"pluralCat": function (n, opt_precision) { var i = n | 0; if (i == 0 || i == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | artch/cdnjs | ajax/libs/angular.js/1.3.0-beta.16/i18n/angular-locale_fr-fr.js | JavaScript | mit | 2,017 |
unused_funarg_1: {
options = { unused: true };
input: {
function f(a, b, c, d, e) {
return a + b;
}
}
expect: {
function f(a, b) {
return a + b;
}
}
}
unused_funarg_2: {
options = { unused: true };
input: {
function f(a, b, c, d, e) {
return a + c;
}
}
expect: {
function f(a, b, c) {
return a + c;
}
}
}
unused_nested_function: {
options = { unused: true };
input: {
function f(x, y) {
function g() {
something();
}
return x + y;
}
};
expect: {
function f(x, y) {
return x + y;
}
}
}
unused_circular_references_1: {
options = { unused: true };
input: {
function f(x, y) {
// circular reference
function g() {
return h();
}
function h() {
return g();
}
return x + y;
}
};
expect: {
function f(x, y) {
return x + y;
}
}
}
unused_circular_references_2: {
options = { unused: true };
input: {
function f(x, y) {
var foo = 1, bar = baz, baz = foo + bar, qwe = moo();
return x + y;
}
};
expect: {
function f(x, y) {
moo(); // keeps side effect
return x + y;
}
}
}
unused_circular_references_3: {
options = { unused: true };
input: {
function f(x, y) {
var g = function() { return h() };
var h = function() { return g() };
return x + y;
}
};
expect: {
function f(x, y) {
return x + y;
}
}
}
| Marlena/ipsum | node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/drop-unused.js | JavaScript | mit | 1,839 |
v\:oval,v\:shadow,v\:fill{behavior:url(#default#VML);display:inline-block;zoom:1;*display:inline}.yui3-dial{position:relative;display:-moz-inline-stack;display:inline-block;zoom:1;*display:inline}.yui3-dial-content,.yui3-dial-ring{position:relative}.yui3-dial-handle,.yui3-dial-marker,.yui3-dial-center-button,.yui3-dial-reset-string,.yui3-dial-handle-vml,.yui3-dial-marker-vml,.yui3-dial-center-button-vml,.yui3-dial-ring-vml v\:oval,.yui3-dial-center-button-vml v\:oval{position:absolute}.yui3-dial-center-button-vml v\:oval{font-size:1px;top:0;left:0}.yui3-dial-content .yui3-dial-ring .yui3-dial-hidden v\:oval,.yui3-dial-content .yui3-dial-ring .yui3-dial-hidden{opacity:0;filter:alpha(opacity=0)}.yui3-skin-night .yui3-dial{color:#fff}.yui3-skin-night .yui3-dial-handle{background:#439ede;opacity:.3;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.9) inset;-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.9) inset;box-shadow:1px 1px 1px rgba(0,0,0,0.9) inset;cursor:pointer;font-size:1px}.yui3-skin-night .yui3-dial-ring{background:#595b5b;background:-moz-linear-gradient(0% 100% 315deg,#5e6060,#2d2e2f);background:-webkit-gradient(linear,50% 0,100% 100%,from(#636666),to(#424344));-moz-box-shadow:1px 1px 2px rgba(0,0,0,0.7) inset;-webkit-box-shadow:1px 1px 3px rgba(0,0,0,0.7) inset;box-shadow:1px 1px 5px rgba(0,0,0,0.4) inset}.yui3-skin-night .yui3-dial-center-button{-moz-box-shadow:-1px -1px 2px rgba(0,0,0,0.3) inset,1px 1px 2px rgba(0,0,0,0.5);-webkit-box-shadow:-1px -1px 2px rgba(0,0,0,0.3) inset,1px 1px 2px rgba(0,0,0,0.5);box-shadow:-1px -1px 2px rgba(0,0,0,0.3) inset,1px 1px 2px rgba(0,0,0,0.5);background:#dddbd4;background:-moz-radial-gradient(30% 30% 0deg,circle farthest-side,#999c9c 24%,#898989 41%,#535555 87%) repeat scroll 0 0 transparent;background:-webkit-gradient(radial,15 15,15,30 30,40,from(#999c9c),to(#535555),color-stop(.2,#898989));cursor:pointer;opacity:.7}.yui3-skin-night .yui3-dial-reset-string{color:#fff;font-size:72%;text-decoration:none}.yui3-skin-night .yui3-dial-label{color:#cbcbcb;margin-bottom:.8em}.yui3-skin-night .yui3-dial-value-string{margin-left:.5em;color:#dcdcdc;font-size:130%}.yui3-skin-night .yui3-dial-value{visibility:hidden;position:absolute;top:0;left:102%;width:4em}.yui3-skin-night .yui3-dial-north-mark{position:absolute;border-left:2px solid #434343;height:5px;left:50%;top:-7px;font-size:1px}.yui3-skin-night .yui3-dial-marker{background-color:#a0d8ff;opacity:.2;font-size:1px}.yui3-skin-night .yui3-dial-marker-max-min{background-color:#ff0404;opacity:.6}.yui3-skin-night .yui3-dial-ring-vml,.yui3-skin-night .yui3-dial-center-button-vml,.yui3-skin-night .yui3-dial-marker v\:oval.yui3-dial-marker-max-min,.yui3-skin-night v\:oval.yui3-dial-marker-max-min,.yui3-skin-night .yui3-dial-marker-vml,.yui3-skin-night .yui3-dial-handle-vml{background:0;opacity:1}#yui3-css-stamp.skin-night-dial{display:none}
| chrillep/cdnjs | ajax/libs/yui/3.9.1/dial/assets/skins/night/dial.css | CSS | mit | 2,865 |
/* -*- 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[2],
host: match[3],
port: match[4],
path: match[5]
};
}
exports.urlParse = urlParse;
function urlGenerate(aParsedUrl) {
var url = '';
if (aParsedUrl.scheme) {
url += aParsedUrl.scheme + ':';
}
url += '//';
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;
/**
* Normalizes a path, or the path portion of a URL:
*
* - Replaces consequtive slashes with one slash.
* - Removes unnecessary '.' parts.
* - Removes unnecessary '<dir>/..' parts.
*
* Based on code in the Node.js 'path' core module.
*
* @param aPath The path or url to normalize.
*/
function normalize(aPath) {
var path = aPath;
var url = urlParse(aPath);
if (url) {
if (!url.path) {
return aPath;
}
path = url.path;
}
var isAbsolute = (path.charAt(0) === '/');
var parts = path.split(/\/+/);
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
part = parts[i];
if (part === '.') {
parts.splice(i, 1);
} else if (part === '..') {
up++;
} else if (up > 0) {
if (part === '') {
// The first part is blank if the path is absolute. Trying to go
// above the root is a no-op. Therefore we can remove all '..' parts
// directly after the root.
parts.splice(i + 1, up);
up = 0;
} else {
parts.splice(i, 2);
up--;
}
}
}
path = parts.join('/');
if (path === '') {
path = isAbsolute ? '/' : '.';
}
if (url) {
url.path = path;
return urlGenerate(url);
}
return path;
}
exports.normalize = normalize;
/**
* Joins two paths/URLs.
*
* @param aRoot The root path or URL.
* @param aPath The path or URL to be joined with the root.
*
* - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
* scheme-relative URL: Then the scheme of aRoot, if any, is prepended
* first.
* - Otherwise aPath is a path. If aRoot is a URL, then its path portion
* is updated with the result and aRoot is returned. Otherwise the result
* is returned.
* - If aPath is absolute, the result is aPath.
* - Otherwise the two paths are joined with a slash.
* - Joining for example 'http://' and 'www.example.com' is also supported.
*/
function join(aRoot, aPath) {
if (aRoot === "") {
aRoot = ".";
}
if (aPath === "") {
aPath = ".";
}
var aPathUrl = urlParse(aPath);
var aRootUrl = urlParse(aRoot);
if (aRootUrl) {
aRoot = aRootUrl.path || '/';
}
// `join(foo, '//www.example.org')`
if (aPathUrl && !aPathUrl.scheme) {
if (aRootUrl) {
aPathUrl.scheme = aRootUrl.scheme;
}
return urlGenerate(aPathUrl);
}
if (aPathUrl || aPath.match(dataUrlRegexp)) {
return aPath;
}
// `join('http://', 'www.example.com')`
if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
aRootUrl.host = aPath;
return urlGenerate(aRootUrl);
}
var joined = aPath.charAt(0) === '/'
? aPath
: normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
if (aRootUrl) {
aRootUrl.path = joined;
return urlGenerate(aRootUrl);
}
return joined;
}
exports.join = join;
/**
* Make a path relative to a URL or another path.
*
* @param aRoot The root path or URL.
* @param aPath The path or URL to be made relative to aRoot.
*/
function relative(aRoot, aPath) {
if (aRoot === "") {
aRoot = ".";
}
aRoot = aRoot.replace(/\/$/, '');
// It is possible for the path to be above the root. In this case, simply
// checking whether the root is a prefix of the path won't work. Instead, we
// need to remove components from the root one by one, until either we find
// a prefix that fits, or we run out of components to remove.
var level = 0;
while (aPath.indexOf(aRoot + '/') !== 0) {
var index = aRoot.lastIndexOf("/");
if (index < 0) {
return aPath;
}
// If the only part of the root that is left is the scheme (i.e. http://,
// file:///, etc.), one or more slashes (/), or simply nothing at all, we
// have exhausted all components, so the path is not relative to the root.
aRoot = aRoot.slice(0, index);
if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
return aPath;
}
++level;
}
// Make sure we add a "../" for each component we removed from the root.
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
}
exports.relative = relative;
/**
* 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;
/**
* 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 = mappingA.source - mappingB.source;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0 || onlyCompareOriginal) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
return mappingA.name - mappingB.name;
};
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 = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0 || onlyCompareGenerated) {
return cmp;
}
cmp = mappingA.source - mappingB.source;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0) {
return cmp;
}
return mappingA.name - mappingB.name;
};
exports.compareByGeneratedPositions = compareByGeneratedPositions;
});
| kpingul/Flickr-App | node_modules/gulp-concat/node_modules/concat-with-sourcemaps/node_modules/source-map/lib/source-map/util.js | JavaScript | mit | 8,972 |
var AssertionError = require('./assertion-error');
var util = require('./util');
/**
* should Assertion
* @param {*} obj Given object for assertion
* @constructor
* @memberOf should
* @static
*/
function Assertion(obj) {
this.obj = obj;
this.anyOne = false;
this.negate = false;
this.params = {actual: obj};
}
/**
* Way to extend Assertion function. It uses some logic
* to define only positive assertions and itself rule with negative assertion.
*
* All actions happen in subcontext and this method take care about negation.
* Potentially we can add some more modifiers that does not depends from state of assertion.
* @memberOf Assertion
* @category assertion
* @static
* @param {String} name Name of assertion. It will be used for defining method or getter on Assertion.prototype
* @param {Function} func Function that will be called on executing assertion
* @param {Boolean} [isGetter] If this assertion is getter. By default it is false.
* @example
*
* Assertion.add('asset', function() {
* this.params = { operator: 'to be asset' };
*
* this.obj.should.have.property('id').which.is.a.Number;
* this.obj.should.have.property('path');
* });
*/
Assertion.add = function(name, func, isGetter) {
var prop = {enumerable: true, configurable: true};
isGetter = !!isGetter;
prop[isGetter ? 'get' : 'value'] = function() {
var context = new Assertion(this.obj, this, name);
context.anyOne = this.anyOne;
try {
func.apply(context, arguments);
} catch(e) {
//check for fail
if(e instanceof AssertionError) {
//negative fail
if(this.negate) {
this.obj = context.obj;
this.negate = false;
return this.proxied();
}
if(context !== e.assertion) {
context.params.previous = e;
}
//positive fail
context.negate = false;
context.fail();
}
// throw if it is another exception
throw e;
}
//negative pass
if(this.negate) {
context.negate = true;//because .fail will set negate
context.params.details = 'false negative fail';
context.fail();
}
//positive pass
if(!this.params.operator) this.params = context.params;//shortcut
this.obj = context.obj;
this.negate = false;
return this.proxied();
};
Object.defineProperty(Assertion.prototype, name, prop);
};
Assertion.addChain = function(name, onCall) {
onCall = onCall || function() {
};
Object.defineProperty(Assertion.prototype, name, {
get: function() {
onCall();
return this.proxied();
},
enumerable: true
});
};
/**
* Create alias for some `Assertion` property
*
* @memberOf Assertion
* @category assertion
* @static
* @param {String} from Name of to map
* @param {String} to Name of alias
* @example
*
* Assertion.alias('true', 'True');
*/
Assertion.alias = function(from, to) {
var desc = Object.getOwnPropertyDescriptor(Assertion.prototype, from);
if(!desc) throw new Error('Alias ' + from + ' -> ' + to + ' could not be created as ' + from + ' not defined');
Object.defineProperty(Assertion.prototype, to, desc);
};
Assertion.prototype = {
constructor: Assertion,
/**
* Base method for assertions. Before calling this method need to fill Assertion#params object. This method usually called from other assertion methods.
* `Assertion#params` can contain such properties:
* * `operator` - required string containing description of this assertion
* * `obj` - optional replacement for this.obj, it usefull if you prepare more clear object then given
* * `message` - if this property filled with string any others will be ignored and this one used as assertion message
* * `expected` - any object used when you need to assert relation between given object and expected. Like given == expected (== is a relation)
* * `details` - additional string with details to generated message
*
* @memberOf Assertion
* @category assertion
* @param {*} expr Any expression that will be used as a condition for asserting.
* @example
*
* var a = new should.Assertion(42);
*
* a.params = {
* operator: 'to be magic number',
* }
*
* a.assert(false);
* //throws AssertionError: expected 42 to be magic number
*/
assert: function(expr) {
if(expr) return this.proxied();
var params = this.params;
if('obj' in params && !('actual' in params)) {
params.actual = params.obj;
} else if(!('obj' in params) && !('actual' in params)) {
params.actual = this.obj;
}
params.stackStartFunction = params.stackStartFunction || this.assert;
params.negate = this.negate;
params.assertion = this;
throw new AssertionError(params);
},
/**
* Shortcut for `Assertion#assert(false)`.
*
* @memberOf Assertion
* @category assertion
* @example
*
* var a = new should.Assertion(42);
*
* a.params = {
* operator: 'to be magic number',
* }
*
* a.fail();
* //throws AssertionError: expected 42 to be magic number
*/
fail: function() {
return this.assert(false);
},
/**
* Negation modifier. Current assertion chain become negated. Each call invert negation on current assertion.
*
* @memberOf Assertion
* @category assertion
*/
get not() {
this.negate = !this.negate;
return this.proxied();
},
/**
* Any modifier - it affect on execution of sequenced assertion to do not `check all`, but `check any of`.
*
* @memberOf Assertion
* @category assertion
*/
get any() {
this.anyOne = true;
return this.proxied();
},
proxied: function() {
if(typeof Proxy == 'function') {
return new Proxy(this, {
get: function(target, name) {
if(name in target) {
return target[name];
} else {
throw new Error('Assertion has no property ' + util.formatProp(name));
}
}
});
}
return this;
}
};
module.exports = Assertion;
| thomasalrin/Ghost | node_modules/should/lib/assertion.js | JavaScript | mit | 6,064 |
/**
* @author Mat Groves
*
* Big thanks to the very clever Matt DesLauriers <mattdesl> https://github.com/mattdesl/
* for creating the original pixi version!
* Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now share 4 bytes on the vertex buffer
*
* Heavily inspired by LibGDX's WebGLSpriteBatch:
* https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java
*/
/**
*
* @class WebGLSpriteBatch
* @private
* @constructor
*/
PIXI.WebGLSpriteBatch = function()
{
/**
* @property vertSize
* @type Number
*/
this.vertSize = 5;
/**
* The number of images in the SpriteBatch before it flushes
* @property size
* @type Number
*/
this.size = 2000;//Math.pow(2, 16) / this.vertSize;
//the total number of bytes in our batch
var numVerts = this.size * 4 * 4 * this.vertSize;
//the total number of indices in our batch
var numIndices = this.size * 6;
/**
* Holds the vertices
*
* @property vertices
* @type ArrayBuffer
*/
this.vertices = new PIXI.ArrayBuffer(numVerts);
/**
* View on the vertices as a Float32Array
*
* @property positions
* @type Float32Array
*/
this.positions = new PIXI.Float32Array(this.vertices);
/**
* View on the vertices as a Uint32Array
*
* @property colors
* @type Uint32Array
*/
this.colors = new PIXI.Uint32Array(this.vertices);
/**
* Holds the indices
*
* @property indices
* @type Uint16Array
*/
this.indices = new PIXI.Uint16Array(numIndices);
/**
* @property lastIndexCount
* @type Number
*/
this.lastIndexCount = 0;
for (var i=0, j=0; i < numIndices; i += 6, j += 4)
{
this.indices[i + 0] = j + 0;
this.indices[i + 1] = j + 1;
this.indices[i + 2] = j + 2;
this.indices[i + 3] = j + 0;
this.indices[i + 4] = j + 2;
this.indices[i + 5] = j + 3;
}
/**
* @property drawing
* @type Boolean
*/
this.drawing = false;
/**
* @property currentBatchSize
* @type Number
*/
this.currentBatchSize = 0;
/**
* @property currentBaseTexture
* @type BaseTexture
*/
this.currentBaseTexture = null;
/**
* @property dirty
* @type Boolean
*/
this.dirty = true;
/**
* @property textures
* @type Array
*/
this.textures = [];
/**
* @property blendModes
* @type Array
*/
this.blendModes = [];
/**
* @property shaders
* @type Array
*/
this.shaders = [];
/**
* @property sprites
* @type Array
*/
this.sprites = [];
/**
* @property defaultShader
* @type AbstractFilter
*/
this.defaultShader = new PIXI.AbstractFilter([
'precision lowp float;',
'varying vec2 vTextureCoord;',
'varying vec4 vColor;',
'uniform sampler2D uSampler;',
'void main(void) {',
' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;',
'}'
]);
};
/**
* @method setContext
* @param gl {WebGLContext} the current WebGL drawing context
*/
PIXI.WebGLSpriteBatch.prototype.setContext = function(gl)
{
this.gl = gl;
// create a couple of buffers
this.vertexBuffer = gl.createBuffer();
this.indexBuffer = gl.createBuffer();
// 65535 is max index, so 65535 / 6 = 10922.
//upload the index data
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW);
this.currentBlendMode = 99999;
var shader = new PIXI.PixiShader(gl);
shader.fragmentSrc = this.defaultShader.fragmentSrc;
shader.uniforms = {};
shader.init();
this.defaultShader.shaders[gl.id] = shader;
};
/**
* @method begin
* @param renderSession {Object} The RenderSession object
*/
PIXI.WebGLSpriteBatch.prototype.begin = function(renderSession)
{
this.renderSession = renderSession;
this.shader = this.renderSession.shaderManager.defaultShader;
this.start();
};
/**
* @method end
*/
PIXI.WebGLSpriteBatch.prototype.end = function()
{
this.flush();
};
/**
* @method render
* @param sprite {Sprite} the sprite to render when using this spritebatch
*/
PIXI.WebGLSpriteBatch.prototype.render = function(sprite)
{
var texture = sprite.texture;
//TODO set blend modes..
// check texture..
if(this.currentBatchSize >= this.size)
{
this.flush();
this.currentBaseTexture = texture.baseTexture;
}
// get the uvs for the texture
var uvs = texture._uvs;
// if the uvs have not updated then no point rendering just yet!
if(!uvs)return;
// TODO trim??
var aX = sprite.anchor.x;
var aY = sprite.anchor.y;
var w0, w1, h0, h1;
if (texture.trim)
{
// if the sprite is trimmed then we need to add the extra space before transforming the sprite coords..
var trim = texture.trim;
w1 = trim.x - aX * trim.width;
w0 = w1 + texture.crop.width;
h1 = trim.y - aY * trim.height;
h0 = h1 + texture.crop.height;
}
else
{
w0 = (texture.frame.width ) * (1-aX);
w1 = (texture.frame.width ) * -aX;
h0 = texture.frame.height * (1-aY);
h1 = texture.frame.height * -aY;
}
var index = this.currentBatchSize * 4 * this.vertSize;
var resolution = texture.baseTexture.resolution;
var worldTransform = sprite.worldTransform;
var a = worldTransform.a / resolution;
var b = worldTransform.b / resolution;
var c = worldTransform.c / resolution;
var d = worldTransform.d / resolution;
var tx = worldTransform.tx;
var ty = worldTransform.ty;
var colors = this.colors;
var positions = this.positions;
if(this.renderSession.roundPixels)
{
// xy
positions[index] = a * w1 + c * h1 + tx | 0;
positions[index+1] = d * h1 + b * w1 + ty | 0;
// xy
positions[index+5] = a * w0 + c * h1 + tx | 0;
positions[index+6] = d * h1 + b * w0 + ty | 0;
// xy
positions[index+10] = a * w0 + c * h0 + tx | 0;
positions[index+11] = d * h0 + b * w0 + ty | 0;
// xy
positions[index+15] = a * w1 + c * h0 + tx | 0;
positions[index+16] = d * h0 + b * w1 + ty | 0;
}
else
{
// xy
positions[index] = a * w1 + c * h1 + tx;
positions[index+1] = d * h1 + b * w1 + ty;
// xy
positions[index+5] = a * w0 + c * h1 + tx;
positions[index+6] = d * h1 + b * w0 + ty;
// xy
positions[index+10] = a * w0 + c * h0 + tx;
positions[index+11] = d * h0 + b * w0 + ty;
// xy
positions[index+15] = a * w1 + c * h0 + tx;
positions[index+16] = d * h0 + b * w1 + ty;
}
// uv
positions[index+2] = uvs.x0;
positions[index+3] = uvs.y0;
// uv
positions[index+7] = uvs.x1;
positions[index+8] = uvs.y1;
// uv
positions[index+12] = uvs.x2;
positions[index+13] = uvs.y2;
// uv
positions[index+17] = uvs.x3;
positions[index+18] = uvs.y3;
// color and alpha
var tint = sprite.tint;
colors[index+4] = colors[index+9] = colors[index+14] = colors[index+19] = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + (sprite.worldAlpha * 255 << 24);
// increment the batchsize
this.sprites[this.currentBatchSize++] = sprite;
};
/**
* Renders a TilingSprite using the spriteBatch.
*
* @method renderTilingSprite
* @param sprite {TilingSprite} the tilingSprite to render
*/
PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite)
{
var texture = tilingSprite.tilingTexture;
// check texture..
if(this.currentBatchSize >= this.size)
{
//return;
this.flush();
this.currentBaseTexture = texture.baseTexture;
}
// set the textures uvs temporarily
// TODO create a separate texture so that we can tile part of a texture
if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs();
var uvs = tilingSprite._uvs;
tilingSprite.tilePosition.x %= texture.baseTexture.width * tilingSprite.tileScaleOffset.x;
tilingSprite.tilePosition.y %= texture.baseTexture.height * tilingSprite.tileScaleOffset.y;
var offsetX = tilingSprite.tilePosition.x/(texture.baseTexture.width*tilingSprite.tileScaleOffset.x);
var offsetY = tilingSprite.tilePosition.y/(texture.baseTexture.height*tilingSprite.tileScaleOffset.y);
var scaleX = (tilingSprite.width / texture.baseTexture.width) / (tilingSprite.tileScale.x * tilingSprite.tileScaleOffset.x);
var scaleY = (tilingSprite.height / texture.baseTexture.height) / (tilingSprite.tileScale.y * tilingSprite.tileScaleOffset.y);
uvs.x0 = 0 - offsetX;
uvs.y0 = 0 - offsetY;
uvs.x1 = (1 * scaleX) - offsetX;
uvs.y1 = 0 - offsetY;
uvs.x2 = (1 * scaleX) - offsetX;
uvs.y2 = (1 * scaleY) - offsetY;
uvs.x3 = 0 - offsetX;
uvs.y3 = (1 * scaleY) - offsetY;
// get the tilingSprites current alpha and tint and combining them into a single color
var tint = tilingSprite.tint;
var color = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + (tilingSprite.alpha * 255 << 24);
var positions = this.positions;
var colors = this.colors;
var width = tilingSprite.width;
var height = tilingSprite.height;
// TODO trim??
var aX = tilingSprite.anchor.x;
var aY = tilingSprite.anchor.y;
var w0 = width * (1-aX);
var w1 = width * -aX;
var h0 = height * (1-aY);
var h1 = height * -aY;
var index = this.currentBatchSize * 4 * this.vertSize;
var resolution = texture.baseTexture.resolution;
var worldTransform = tilingSprite.worldTransform;
var a = worldTransform.a / resolution;//[0];
var b = worldTransform.b / resolution;//[3];
var c = worldTransform.c / resolution;//[1];
var d = worldTransform.d / resolution;//[4];
var tx = worldTransform.tx;//[2];
var ty = worldTransform.ty;//[5];
// xy
positions[index++] = a * w1 + c * h1 + tx;
positions[index++] = d * h1 + b * w1 + ty;
// uv
positions[index++] = uvs.x0;
positions[index++] = uvs.y0;
// color
colors[index++] = color;
// xy
positions[index++] = (a * w0 + c * h1 + tx);
positions[index++] = d * h1 + b * w0 + ty;
// uv
positions[index++] = uvs.x1;
positions[index++] = uvs.y1;
// color
colors[index++] = color;
// xy
positions[index++] = a * w0 + c * h0 + tx;
positions[index++] = d * h0 + b * w0 + ty;
// uv
positions[index++] = uvs.x2;
positions[index++] = uvs.y2;
// color
colors[index++] = color;
// xy
positions[index++] = a * w1 + c * h0 + tx;
positions[index++] = d * h0 + b * w1 + ty;
// uv
positions[index++] = uvs.x3;
positions[index++] = uvs.y3;
// color
colors[index++] = color;
// increment the batchsize
this.sprites[this.currentBatchSize++] = tilingSprite;
};
/**
* Renders the content and empties the current batch.
*
* @method flush
*/
PIXI.WebGLSpriteBatch.prototype.flush = function()
{
// If the batch is length 0 then return as there is nothing to draw
if (this.currentBatchSize===0)return;
var gl = this.gl;
var shader;
if(this.dirty)
{
this.dirty = false;
// bind the main texture
gl.activeTexture(gl.TEXTURE0);
// bind the buffers
gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
shader = this.defaultShader.shaders[gl.id];
// this is the same for each shader?
var stride = this.vertSize * 4;
gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0);
gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, stride, 2 * 4);
// color attributes will be interpreted as unsigned bytes and normalized
gl.vertexAttribPointer(shader.colorAttribute, 4, gl.UNSIGNED_BYTE, true, stride, 4 * 4);
}
// upload the verts to the buffer
if(this.currentBatchSize > ( this.size * 0.5 ) )
{
gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices);
}
else
{
var view = this.positions.subarray(0, this.currentBatchSize * 4 * this.vertSize);
gl.bufferSubData(gl.ARRAY_BUFFER, 0, view);
}
var nextTexture, nextBlendMode, nextShader;
var batchSize = 0;
var start = 0;
var currentBaseTexture = null;
var currentBlendMode = this.renderSession.blendModeManager.currentBlendMode;
var currentShader = null;
var blendSwap = false;
var shaderSwap = false;
var sprite;
for (var i = 0, j = this.currentBatchSize; i < j; i++) {
sprite = this.sprites[i];
nextTexture = sprite.texture.baseTexture;
nextBlendMode = sprite.blendMode;
nextShader = sprite.shader || this.defaultShader;
blendSwap = currentBlendMode !== nextBlendMode;
shaderSwap = currentShader !== nextShader; // should I use _UIDS???
if(currentBaseTexture !== nextTexture || blendSwap || shaderSwap)
{
this.renderBatch(currentBaseTexture, batchSize, start);
start = i;
batchSize = 0;
currentBaseTexture = nextTexture;
if( blendSwap )
{
currentBlendMode = nextBlendMode;
this.renderSession.blendModeManager.setBlendMode( currentBlendMode );
}
if( shaderSwap )
{
currentShader = nextShader;
shader = currentShader.shaders[gl.id];
if(!shader)
{
shader = new PIXI.PixiShader(gl);
shader.fragmentSrc =currentShader.fragmentSrc;
shader.uniforms =currentShader.uniforms;
shader.init();
currentShader.shaders[gl.id] = shader;
}
// set shader function???
this.renderSession.shaderManager.setShader(shader);
if(shader.dirty)shader.syncUniforms();
// both thease only need to be set if they are changing..
// set the projection
var projection = this.renderSession.projection;
gl.uniform2f(shader.projectionVector, projection.x, projection.y);
// TODO - this is temprorary!
var offsetVector = this.renderSession.offset;
gl.uniform2f(shader.offsetVector, offsetVector.x, offsetVector.y);
// set the pointers
}
}
batchSize++;
}
this.renderBatch(currentBaseTexture, batchSize, start);
// then reset the batch!
this.currentBatchSize = 0;
};
/**
* @method renderBatch
* @param texture {Texture}
* @param size {Number}
* @param startIndex {Number}
*/
PIXI.WebGLSpriteBatch.prototype.renderBatch = function(texture, size, startIndex)
{
if(size === 0)return;
var gl = this.gl;
// check if a texture is dirty..
if(texture._dirty[gl.id])
{
this.renderSession.renderer.updateTexture(texture);
}
else
{
// bind the current texture
gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]);
}
// now draw those suckas!
gl.drawElements(gl.TRIANGLES, size * 6, gl.UNSIGNED_SHORT, startIndex * 6 * 2);
// increment the draw count
this.renderSession.drawCount++;
};
/**
* @method stop
*/
PIXI.WebGLSpriteBatch.prototype.stop = function()
{
this.flush();
this.dirty = true;
};
/**
* @method start
*/
PIXI.WebGLSpriteBatch.prototype.start = function()
{
this.dirty = true;
};
/**
* Destroys the SpriteBatch.
*
* @method destroy
*/
PIXI.WebGLSpriteBatch.prototype.destroy = function()
{
this.vertices = null;
this.indices = null;
this.gl.deleteBuffer( this.vertexBuffer );
this.gl.deleteBuffer( this.indexBuffer );
this.currentBaseTexture = null;
this.gl = null;
}; | mshiltonj/asteroid-rescue | src/components/phaser/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js | JavaScript | mit | 16,481 |
# Copyright 2011 Matt Chaput. All rights reserved.
#
# 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 above 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.
#
# THIS SOFTWARE IS PROVIDED BY MATT CHAPUT ``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 MATT CHAPUT 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 views and conclusions contained in the software and documentation are
# those of the authors and should not be interpreted as representing official
# policies, either expressed or implied, of Matt Chaput.
"""
This module implements a general external merge sort for Python objects.
"""
from __future__ import with_statement
import os, tempfile
from heapq import heapify, heappop, heapreplace
from whoosh.compat import dump, load
## Python 3.2 had a bug that make marshal.load unusable
#if (hasattr(platform, "python_implementation")
# and platform.python_implementation() == "CPython"
# and platform.python_version() == "3.2.0"):
# # Use pickle instead of marshal on Python 3.2
# from whoosh.compat import dump as dump_pickle
# from whoosh.compat import load
#
# def dump(obj, f):
# dump_pickle(obj, f, -1)
#else:
# from marshal import dump, load
try:
from heapq import merge
def imerge(iterables):
return merge(*iterables)
except ImportError:
def imerge(iterables):
_hpop, _hreplace, _Stop = (heappop, heapreplace, StopIteration)
h = []
h_append = h.append
for itnum, it in enumerate(map(iter, iterables)):
try:
nx = it.next
h_append([nx(), itnum, nx])
except _Stop:
pass
heapify(h)
while 1:
try:
while 1:
v, itnum, nx = s = h[0]
yield v
s[0] = nx()
_hreplace(h, s)
except _Stop:
_hpop(h)
except IndexError:
return
class SortingPool(object):
"""This object implements a general K-way external merge sort for Python
objects.
>>> pool = MergePool()
>>> # Add an unlimited number of items in any order
>>> for item in my_items:
... pool.add(item)
...
>>> # Get the items back in sorted order
>>> for item in pool.items():
... print(item)
This class uses the `marshal` module to write the items to temporary files,
so you can only sort marshal-able types (generally: numbers, strings,
tuples, lists, and dicts).
"""
def __init__(self, maxsize=1000000, tempdir=None, prefix="",
suffix=".run"):
"""
:param maxsize: the maximum number of items to keep in memory at once.
:param tempdir: the path of a directory to use for temporary file
storage. The default is to use the system's temp directory.
:param prefix: a prefix to add to temporary filenames.
:param suffix: a suffix to add to temporary filenames.
"""
self.tempdir = tempdir
if maxsize < 1:
raise ValueError("maxsize=%s must be >= 1" % maxsize)
self.maxsize = maxsize
self.prefix = prefix
self.suffix = suffix
# Current run queue
self.current = []
# List of run filenames
self.runs = []
def _new_run(self):
fd, path = tempfile.mkstemp(prefix=self.prefix, suffix=self.suffix,
dir=self.tempdir)
f = os.fdopen(fd, "wb")
return path, f
def _open_run(self, path):
return open(path, "rb")
def _remove_run(self, path):
os.remove(path)
def _read_run(self, path):
f = self._open_run(path)
try:
while True:
yield load(f)
except EOFError:
return
finally:
f.close()
self._remove_run(path)
def _merge_runs(self, paths):
iters = [self._read_run(path) for path in paths]
for item in imerge(iters):
yield item
def add(self, item):
"""Adds `item` to the pool to be sorted.
"""
if len(self.current) >= self.maxsize:
self.save()
self.current.append(item)
def _write_run(self, f, items):
for item in items:
dump(item, f, -1)
f.close()
def _add_run(self, filename):
self.runs.append(filename)
def save(self):
current = self.current
if current:
current.sort()
path, f = self._new_run()
self._write_run(f, current)
self._add_run(path)
self.current = []
def cleanup(self):
for path in self.runs:
try:
os.remove(path)
except OSError:
pass
def reduce_to(self, target, k):
# Reduce the number of runs to "target" by merging "k" runs at a time
if k < 2:
raise ValueError("k=%s must be > 2" % k)
if target < 1:
raise ValueError("target=%s must be >= 1" % target)
runs = self.runs
while len(runs) > target:
newpath, f = self._new_run()
# Take k runs off the end of the run list
tomerge = []
while runs and len(tomerge) < k:
tomerge.append(runs.pop())
# Merge them into a new run and add it at the start of the list
self._write_run(f, self._merge_runs(tomerge))
runs.insert(0, newpath)
def items(self, maxfiles=128):
"""Returns a sorted list or iterator of the items in the pool.
:param maxfiles: maximum number of files to open at once.
"""
if maxfiles < 2:
raise ValueError("maxfiles=%s must be >= 2" % maxfiles)
if not self.runs:
# We never wrote a run to disk, so just sort the queue in memory
# and return that
return sorted(self.current)
# Write a new run with the leftover items in the queue
self.save()
# If we have more runs than allowed open files, merge some of the runs
if maxfiles < len(self.runs):
self.reduce_to(maxfiles, maxfiles)
# Take all the runs off the run list and merge them
runs = self.runs
self.runs = [] # Minor detail, makes this object reusable
return self._merge_runs(runs)
def sort(items, maxsize=100000, tempdir=None, maxfiles=128):
"""Sorts the given items using an external merge sort.
:param tempdir: the path of a directory to use for temporary file
storage. The default is to use the system's temp directory.
:param maxsize: the maximum number of items to keep in memory at once.
:param maxfiles: maximum number of files to open at once.
"""
p = SortingPool(maxsize=maxsize, tempdir=tempdir)
for item in items:
p.add(item)
return p.items(maxfiles=maxfiles)
| rosudrag/Freemium-winner | VirtualEnvironment/Lib/site-packages/whoosh/externalsort.py | Python | mit | 7,985 |
#!/usr/bin/env ruby -S rspec
require 'spec_helper'
describe Puppet::Parser::Functions.function(:has_interface_with) do
let(:scope) do
PuppetlabsSpec::PuppetInternals.scope
end
# The subject of these examples is the method itself.
subject do
function_name = Puppet::Parser::Functions.function(:has_interface_with)
scope.method(function_name)
end
# We need to mock out the Facts so we can specify how we expect this function
# to behave on different platforms.
context "On Mac OS X Systems" do
before :each do
scope.stubs(:lookupvar).with("interfaces").returns('lo0,gif0,stf0,en1,p2p0,fw0,en0,vmnet1,vmnet8,utun0')
end
it 'should have loopback (lo0)' do
expect(subject.call(['lo0'])).to be_truthy
end
it 'should not have loopback (lo)' do
expect(subject.call(['lo'])).to be_falsey
end
end
context "On Linux Systems" do
before :each do
scope.stubs(:lookupvar).with("interfaces").returns('eth0,lo')
scope.stubs(:lookupvar).with("ipaddress").returns('10.0.0.1')
scope.stubs(:lookupvar).with("ipaddress_lo").returns('127.0.0.1')
scope.stubs(:lookupvar).with("ipaddress_eth0").returns('10.0.0.1')
scope.stubs(:lookupvar).with('muppet').returns('kermit')
scope.stubs(:lookupvar).with('muppet_lo').returns('mspiggy')
scope.stubs(:lookupvar).with('muppet_eth0').returns('kermit')
end
it 'should have loopback (lo)' do
expect(subject.call(['lo'])).to be_truthy
end
it 'should not have loopback (lo0)' do
expect(subject.call(['lo0'])).to be_falsey
end
it 'should have ipaddress with 127.0.0.1' do
expect(subject.call(['ipaddress', '127.0.0.1'])).to be_truthy
end
it 'should have ipaddress with 10.0.0.1' do
expect(subject.call(['ipaddress', '10.0.0.1'])).to be_truthy
end
it 'should not have ipaddress with 10.0.0.2' do
expect(subject.call(['ipaddress', '10.0.0.2'])).to be_falsey
end
it 'should have muppet named kermit' do
expect(subject.call(['muppet', 'kermit'])).to be_truthy
end
it 'should have muppet named mspiggy' do
expect(subject.call(['muppet', 'mspiggy'])).to be_truthy
end
it 'should not have muppet named bigbird' do
expect(subject.call(['muppet', 'bigbird'])).to be_falsey
end
end
end
| dtomasi/symfony-box | puphpet/puppet/modules/rvm/spec/fixtures/modules/stdlib/spec/functions/has_interface_with_spec.rb | Ruby | mit | 2,331 |
topojson=function(){function t(t,e){function n(e){var n=t.arcs[e],r=n[0],a=[0,0];return n.forEach(function(t){a[0]+=t[0],a[1]+=t[1]}),[r,a]}var r={},a={},o={};e.forEach(function(t){var e=n(t);(r[e[0]]||(r[e[0]]=[])).push(t),(r[e[1]]||(r[e[1]]=[])).push(~t)}),e.forEach(function(t){var e,r,i=n(t),s=i[0],c=i[1];if(e=o[s])if(delete o[e.end],e.push(t),e.end=c,r=a[c]){delete a[r.start];var u=r===e?e:e.concat(r);a[u.start=e.start]=o[u.end=r.end]=u}else if(r=o[c]){delete a[r.start],delete o[r.end];var u=e.concat(r.map(function(t){return~t}).reverse());a[u.start=e.start]=o[u.end=r.start]=u}else a[e.start]=o[e.end]=e;else if(e=a[c])if(delete a[e.start],e.unshift(t),e.start=s,r=o[s]){delete o[r.end];var f=r===e?e:r.concat(e);a[f.start=r.start]=o[f.end=e.end]=f}else if(r=a[s]){delete a[r.start],delete o[r.end];var f=r.map(function(t){return~t}).reverse().concat(e);a[f.start=r.end]=o[f.end=e.end]=f}else a[e.start]=o[e.end]=e;else if(e=a[s])if(delete a[e.start],e.unshift(~t),e.start=c,r=o[c]){delete o[r.end];var f=r===e?e:r.concat(e);a[f.start=r.start]=o[f.end=e.end]=f}else if(r=a[c]){delete a[r.start],delete o[r.end];var f=r.map(function(t){return~t}).reverse().concat(e);a[f.start=r.end]=o[f.end=e.end]=f}else a[e.start]=o[e.end]=e;else if(e=o[c])if(delete o[e.end],e.push(~t),e.end=s,r=o[s]){delete a[r.start];var u=r===e?e:e.concat(r);a[u.start=e.start]=o[u.end=r.end]=u}else if(r=a[s]){delete a[r.start],delete o[r.end];var u=e.concat(r.map(function(t){return~t}).reverse());a[u.start=e.start]=o[u.end=r.start]=u}else a[e.start]=o[e.end]=e;else e=[t],a[e.start=s]=o[e.end=c]=e});var i=[];for(var s in o)i.push(o[s]);return i}function e(e,r,a){function o(t){0>t&&(t=~t),(l[t]||(l[t]=[])).push(f)}function i(t){t.forEach(o)}function s(t){t.forEach(i)}function c(t){t.type in d&&(f=t,d[t.type](t.arcs))}var u=[];if(arguments.length>1){var f,l=[],d={LineString:i,MultiLineString:s,Polygon:s,MultiPolygon:function(t){t.forEach(s)}};"GeometryCollection"===r.type?r.geometries.forEach(c):c(r),l.forEach(arguments.length<3?function(t,e){u.push([e])}:function(t,e){a(t[0],t[t.length-1])&&u.push([e])})}else for(var p=0,h=e.arcs.length;h>p;++p)u.push([p]);return n(e,{type:"MultiLineString",arcs:t(e,u)})}function n(t,e){function n(t,e){e.length&&e.pop();for(var n,a=h[0>t?~t:t],o=0,i=a.length,s=0,c=0;i>o;++o)e.push([(s+=(n=a[o])[0])*f+d,(c+=n[1])*l+p]);0>t&&r(e,i)}function a(t){return[t[0]*f+d,t[1]*l+p]}function o(t){for(var e=[],r=0,a=t.length;a>r;++r)n(t[r],e);return e.length<2&&e.push(e[0]),e}function i(t){for(var e=o(t);e.length<4;)e.push(e[0]);return e}function s(t){return t.map(i)}function c(t){var e=t.type,n="GeometryCollection"===e?{type:e,geometries:t.geometries.map(c)}:e in v?{type:e,coordinates:v[e](t)}:{type:null};return"id"in t&&(n.id=t.id),"properties"in t&&(n.properties=t.properties),n}var u=t.transform,f=u.scale[0],l=u.scale[1],d=u.translate[0],p=u.translate[1],h=t.arcs,v={Point:function(t){return a(t.coordinates)},MultiPoint:function(t){return t.coordinates.map(a)},LineString:function(t){return o(t.arcs)},MultiLineString:function(t){return t.arcs.map(o)},Polygon:function(t){return s(t.arcs)},MultiPolygon:function(t){return t.arcs.map(s)}};return c(e)}function r(t,e){for(var n,r=t.length,a=r-e;a<--r;)n=t[a],t[a++]=t[r],t[r]=n}function a(t,e){for(var n=0,r=t.length;r>n;){var a=n+r>>>1;t[a]<e?n=a+1:r=a}return n}function o(t){function e(t,e){t.forEach(function(t){0>t&&(t=~t);var n=o[t]||(o[t]=[]);n[e]||(n.forEach(function(t){var n,r;r=a(n=i[e],t),n[r]!==t&&n.splice(r,0,t),r=a(n=i[t],e),n[r]!==e&&n.splice(r,0,e)}),n[e]=e)})}function n(t,n){t.forEach(function(t){e(t,n)})}function r(t,e){t.type in s&&s[t.type](t.arcs,e)}var o=[],i=t.map(function(){return[]}),s={LineString:e,MultiLineString:n,Polygon:n,MultiPolygon:function(t,e){t.forEach(function(t){n(t,e)})}};return t.forEach(r),i}return{version:"0.0.24",mesh:e,object:n,neighbors:o}}(); | yinghunglai/cdnjs | ajax/libs/topojson/0.0.24/topojson.min.js | JavaScript | mit | 3,878 |
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)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.ReactRouter=e()}}(function(){var define;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&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}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(_dereq_,module){var LocationActions={PUSH:"push",REPLACE:"replace",POP:"pop"};module.exports=LocationActions},{}],2:[function(_dereq_,module){var LocationActions=_dereq_("../actions/LocationActions"),ImitateBrowserBehavior={updateScrollPosition:function(position,actionType){switch(actionType){case LocationActions.PUSH:case LocationActions.REPLACE:window.scrollTo(0,0);break;case LocationActions.POP:position?window.scrollTo(position.x,position.y):window.scrollTo(0,0)}}};module.exports=ImitateBrowserBehavior},{"../actions/LocationActions":1}],3:[function(_dereq_,module){var ScrollToTopBehavior={updateScrollPosition:function(){window.scrollTo(0,0)}};module.exports=ScrollToTopBehavior},{}],4:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,FakeNode=_dereq_("../mixins/FakeNode"),PropTypes=_dereq_("../utils/PropTypes"),DefaultRoute=React.createClass({displayName:"DefaultRoute",mixins:[FakeNode],propTypes:{name:React.PropTypes.string,path:PropTypes.falsy,handler:React.PropTypes.func.isRequired}});module.exports=DefaultRoute},{"../mixins/FakeNode":14,"../utils/PropTypes":23}],5:[function(_dereq_,module){function isLeftClickEvent(event){return 0===event.button}function isModifiedEvent(event){return!!(event.metaKey||event.altKey||event.ctrlKey||event.shiftKey)}var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,classSet=_dereq_("react/lib/cx"),assign=_dereq_("react/lib/Object.assign"),Navigation=_dereq_("../mixins/Navigation"),State=_dereq_("../mixins/State"),Link=React.createClass({displayName:"Link",mixins:[Navigation,State],propTypes:{activeClassName:React.PropTypes.string.isRequired,to:React.PropTypes.string.isRequired,params:React.PropTypes.object,query:React.PropTypes.object,onClick:React.PropTypes.func},getDefaultProps:function(){return{activeClassName:"active"}},handleClick:function(event){var clickResult,allowTransition=!0;this.props.onClick&&(clickResult=this.props.onClick(event)),!isModifiedEvent(event)&&isLeftClickEvent(event)&&((clickResult===!1||event.defaultPrevented===!0)&&(allowTransition=!1),event.preventDefault(),allowTransition&&this.transitionTo(this.props.to,this.props.params,this.props.query))},getHref:function(){return this.makeHref(this.props.to,this.props.params,this.props.query)},getClassName:function(){var classNames={};return this.props.className&&(classNames[this.props.className]=!0),this.isActive(this.props.to,this.props.params,this.props.query)&&(classNames[this.props.activeClassName]=!0),classSet(classNames)},render:function(){var props=assign({},this.props,{href:this.getHref(),className:this.getClassName(),onClick:this.handleClick});return React.DOM.a(props,this.props.children)}});module.exports=Link},{"../mixins/Navigation":15,"../mixins/State":18,"react/lib/Object.assign":38,"react/lib/cx":39}],6:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,FakeNode=_dereq_("../mixins/FakeNode"),PropTypes=_dereq_("../utils/PropTypes"),NotFoundRoute=React.createClass({displayName:"NotFoundRoute",mixins:[FakeNode],propTypes:{name:React.PropTypes.string,path:PropTypes.falsy,handler:React.PropTypes.func.isRequired}});module.exports=NotFoundRoute},{"../mixins/FakeNode":14,"../utils/PropTypes":23}],7:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,FakeNode=_dereq_("../mixins/FakeNode"),PropTypes=_dereq_("../utils/PropTypes"),Redirect=React.createClass({displayName:"Redirect",mixins:[FakeNode],propTypes:{path:React.PropTypes.string,from:React.PropTypes.string,to:React.PropTypes.string,handler:PropTypes.falsy}});module.exports=Redirect},{"../mixins/FakeNode":14,"../utils/PropTypes":23}],8:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,FakeNode=_dereq_("../mixins/FakeNode"),Route=React.createClass({displayName:"Route",mixins:[FakeNode],propTypes:{name:React.PropTypes.string,path:React.PropTypes.string,handler:React.PropTypes.func.isRequired,ignoreScrollBehavior:React.PropTypes.bool}});module.exports=Route},{"../mixins/FakeNode":14}],9:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,RouteHandler=React.createClass({displayName:"RouteHandler",getDefaultProps:function(){return{ref:"__routeHandler__"}},contextTypes:{getRouteAtDepth:React.PropTypes.func.isRequired,getRouteComponents:React.PropTypes.func.isRequired,routeHandlers:React.PropTypes.array.isRequired},childContextTypes:{routeHandlers:React.PropTypes.array.isRequired},getChildContext:function(){return{routeHandlers:this.context.routeHandlers.concat([this])}},getRouteDepth:function(){return this.context.routeHandlers.length-1},componentDidMount:function(){this._updateRouteComponent()},componentDidUpdate:function(){this._updateRouteComponent()},_updateRouteComponent:function(){var depth=this.getRouteDepth(),components=this.context.getRouteComponents();components[depth]=this.refs[this.props.ref]},render:function(){var route=this.context.getRouteAtDepth(this.getRouteDepth());return route?React.createElement(route.handler,this.props):null}});module.exports=RouteHandler},{}],10:[function(_dereq_,module,exports){exports.DefaultRoute=_dereq_("./components/DefaultRoute"),exports.Link=_dereq_("./components/Link"),exports.NotFoundRoute=_dereq_("./components/NotFoundRoute"),exports.Redirect=_dereq_("./components/Redirect"),exports.Route=_dereq_("./components/Route"),exports.RouteHandler=_dereq_("./components/RouteHandler"),exports.HashLocation=_dereq_("./locations/HashLocation"),exports.HistoryLocation=_dereq_("./locations/HistoryLocation"),exports.RefreshLocation=_dereq_("./locations/RefreshLocation"),exports.ImitateBrowserBehavior=_dereq_("./behaviors/ImitateBrowserBehavior"),exports.ScrollToTopBehavior=_dereq_("./behaviors/ScrollToTopBehavior"),exports.Navigation=_dereq_("./mixins/Navigation"),exports.State=_dereq_("./mixins/State"),exports.create=_dereq_("./utils/createRouter"),exports.run=_dereq_("./utils/runRouter")},{"./behaviors/ImitateBrowserBehavior":2,"./behaviors/ScrollToTopBehavior":3,"./components/DefaultRoute":4,"./components/Link":5,"./components/NotFoundRoute":6,"./components/Redirect":7,"./components/Route":8,"./components/RouteHandler":9,"./locations/HashLocation":11,"./locations/HistoryLocation":12,"./locations/RefreshLocation":13,"./mixins/Navigation":15,"./mixins/State":18,"./utils/createRouter":26,"./utils/runRouter":30}],11:[function(_dereq_,module){function getHashPath(){return invariant(canUseDOM,"getHashPath needs a DOM"),Path.decode(window.location.hash.substr(1))}function ensureSlash(){var path=getHashPath();return"/"===path.charAt(0)?!0:(HashLocation.replace("/"+path),!1)}function notifyChange(type){var change={path:getHashPath(),type:type};_changeListeners.forEach(function(listener){listener(change)})}function onHashChange(){ensureSlash()&&(notifyChange(_actionType||LocationActions.POP),_actionType=null)}var _actionType,invariant=_dereq_("react/lib/invariant"),canUseDOM=_dereq_("react/lib/ExecutionEnvironment").canUseDOM,LocationActions=_dereq_("../actions/LocationActions"),Path=_dereq_("../utils/Path"),_changeListeners=[],_isListening=!1,HashLocation={addChangeListener:function(listener){_changeListeners.push(listener),ensureSlash(),_isListening||(window.addEventListener?window.addEventListener("hashchange",onHashChange,!1):window.attachEvent("onhashchange",onHashChange),_isListening=!0)},push:function(path){_actionType=LocationActions.PUSH,window.location.hash=Path.encode(path)},replace:function(path){_actionType=LocationActions.REPLACE,window.location.replace(window.location.pathname+"#"+Path.encode(path))},pop:function(){_actionType=LocationActions.POP,window.history.back()},getCurrentPath:getHashPath,toString:function(){return"<HashLocation>"}};module.exports=HashLocation},{"../actions/LocationActions":1,"../utils/Path":21,"react/lib/ExecutionEnvironment":37,"react/lib/invariant":41}],12:[function(_dereq_,module){function getWindowPath(){return invariant(canUseDOM,"getWindowPath needs a DOM"),Path.decode(window.location.pathname+window.location.search)}function notifyChange(type){var change={path:getWindowPath(),type:type};_changeListeners.forEach(function(listener){listener(change)})}function onPopState(){notifyChange(LocationActions.POP)}var invariant=_dereq_("react/lib/invariant"),canUseDOM=_dereq_("react/lib/ExecutionEnvironment").canUseDOM,LocationActions=_dereq_("../actions/LocationActions"),Path=_dereq_("../utils/Path"),_changeListeners=[],_isListening=!1,HistoryLocation={addChangeListener:function(listener){_changeListeners.push(listener),_isListening||(window.addEventListener?window.addEventListener("popstate",onPopState,!1):window.attachEvent("popstate",onPopState),_isListening=!0)},push:function(path){window.history.pushState({path:path},"",Path.encode(path)),notifyChange(LocationActions.PUSH)},replace:function(path){window.history.replaceState({path:path},"",Path.encode(path)),notifyChange(LocationActions.REPLACE)},pop:function(){window.history.back()},getCurrentPath:getWindowPath,toString:function(){return"<HistoryLocation>"}};module.exports=HistoryLocation},{"../actions/LocationActions":1,"../utils/Path":21,"react/lib/ExecutionEnvironment":37,"react/lib/invariant":41}],13:[function(_dereq_,module){var HistoryLocation=_dereq_("./HistoryLocation"),Path=_dereq_("../utils/Path"),RefreshLocation={push:function(path){window.location=Path.encode(path)},replace:function(path){window.location.replace(Path.encode(path))},pop:function(){window.history.back()},getCurrentPath:HistoryLocation.getCurrentPath,toString:function(){return"<RefreshLocation>"}};module.exports=RefreshLocation},{"../utils/Path":21,"./HistoryLocation":12}],14:[function(_dereq_,module){var invariant=_dereq_("react/lib/invariant"),FakeNode={render:function(){invariant(!1,"%s elements should not be rendered",this.constructor.displayName)}};module.exports=FakeNode},{"react/lib/invariant":41}],15:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,Navigation={contextTypes:{makePath:React.PropTypes.func.isRequired,makeHref:React.PropTypes.func.isRequired,transitionTo:React.PropTypes.func.isRequired,replaceWith:React.PropTypes.func.isRequired,goBack:React.PropTypes.func.isRequired},makePath:function(to,params,query){return this.context.makePath(to,params,query)},makeHref:function(to,params,query){return this.context.makeHref(to,params,query)},transitionTo:function(to,params,query){this.context.transitionTo(to,params,query)},replaceWith:function(to,params,query){this.context.replaceWith(to,params,query)},goBack:function(){this.context.goBack()}};module.exports=Navigation},{}],16:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,NavigationContext={childContextTypes:{makePath:React.PropTypes.func.isRequired,makeHref:React.PropTypes.func.isRequired,transitionTo:React.PropTypes.func.isRequired,replaceWith:React.PropTypes.func.isRequired,goBack:React.PropTypes.func.isRequired},getChildContext:function(){return{makePath:this.constructor.makePath,makeHref:this.constructor.makeHref,transitionTo:this.constructor.transitionTo,replaceWith:this.constructor.replaceWith,goBack:this.constructor.goBack}}};module.exports=NavigationContext},{}],17:[function(_dereq_,module){function shouldUpdateScroll(state,prevState){if(!prevState)return!0;var path=state.path,routes=state.routes,prevPath=prevState.path,prevRoutes=prevState.routes;if(Path.withoutQuery(path)===Path.withoutQuery(prevPath))return!1;var sharedAncestorRoutes=routes.filter(function(route){return-1!==prevRoutes.indexOf(route)});return!sharedAncestorRoutes.some(function(route){return route.ignoreScrollBehavior})}var invariant=_dereq_("react/lib/invariant"),canUseDOM=_dereq_("react/lib/ExecutionEnvironment").canUseDOM,getWindowScrollPosition=_dereq_("../utils/getWindowScrollPosition"),Path=_dereq_("../utils/Path"),Scrolling={statics:{recordScrollPosition:function(path){this.scrollHistory||(this.scrollHistory={}),this.scrollHistory[path]=getWindowScrollPosition()},getScrollPosition:function(path){return this.scrollHistory||(this.scrollHistory={}),this.scrollHistory[path]||null}},componentWillMount:function(){invariant(null==this.getScrollBehavior()||canUseDOM,"Cannot use scroll behavior without a DOM")},componentDidMount:function(){this._updateScroll()},componentDidUpdate:function(prevProps,prevState){this._updateScroll(prevState)},_updateScroll:function(prevState){if(shouldUpdateScroll(this.state,prevState)){var scrollBehavior=this.getScrollBehavior();scrollBehavior&&scrollBehavior.updateScrollPosition(this.constructor.getScrollPosition(this.state.path),this.state.action)}}};module.exports=Scrolling},{"../utils/Path":21,"../utils/getWindowScrollPosition":28,"react/lib/ExecutionEnvironment":37,"react/lib/invariant":41}],18:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,State={contextTypes:{getCurrentPath:React.PropTypes.func.isRequired,getCurrentRoutes:React.PropTypes.func.isRequired,getCurrentParams:React.PropTypes.func.isRequired,getCurrentQuery:React.PropTypes.func.isRequired,isActive:React.PropTypes.func.isRequired},getPath:function(){return this.context.getCurrentPath()},getRoutes:function(){return this.context.getCurrentRoutes()},getParams:function(){return this.context.getCurrentParams()},getQuery:function(){return this.context.getCurrentQuery()},isActive:function(to,params,query){return this.context.isActive(to,params,query)}};module.exports=State},{}],19:[function(_dereq_,module){function routeIsActive(activeRoutes,routeName){return activeRoutes.some(function(route){return route.name===routeName})}function paramsAreActive(activeParams,params){for(var property in params)if(String(activeParams[property])!==String(params[property]))return!1;return!0}function queryIsActive(activeQuery,query){for(var property in query)if(String(activeQuery[property])!==String(query[property]))return!1;return!0}var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,assign=_dereq_("react/lib/Object.assign"),Path=_dereq_("../utils/Path"),StateContext={getCurrentPath:function(){return this.state.path},getCurrentRoutes:function(){return this.state.routes.slice(0)},getCurrentParams:function(){return assign({},this.state.params)},getCurrentQuery:function(){return assign({},this.state.query)},isActive:function(to,params,query){return Path.isAbsolute(to)?to===this.state.path:routeIsActive(this.state.routes,to)&¶msAreActive(this.state.params,params)&&(null==query||queryIsActive(this.state.query,query))},childContextTypes:{getCurrentPath:React.PropTypes.func.isRequired,getCurrentRoutes:React.PropTypes.func.isRequired,getCurrentParams:React.PropTypes.func.isRequired,getCurrentQuery:React.PropTypes.func.isRequired,isActive:React.PropTypes.func.isRequired},getChildContext:function(){return{getCurrentPath:this.getCurrentPath,getCurrentRoutes:this.getCurrentRoutes,getCurrentParams:this.getCurrentParams,getCurrentQuery:this.getCurrentQuery,isActive:this.isActive}}};module.exports=StateContext},{"../utils/Path":21,"react/lib/Object.assign":38}],20:[function(_dereq_,module){function Cancellation(){}module.exports=Cancellation},{}],21:[function(_dereq_,module){function compilePattern(pattern){if(!(pattern in _compiledPatterns)){var paramNames=[],source=pattern.replace(paramCompileMatcher,function(match,paramName){return paramName?(paramNames.push(paramName),"([^/?#]+)"):"*"===match?(paramNames.push("splat"),"(.*?)"):"\\"+match});_compiledPatterns[pattern]={matcher:new RegExp("^"+source+"$","i"),paramNames:paramNames}}return _compiledPatterns[pattern]}var invariant=_dereq_("react/lib/invariant"),merge=_dereq_("qs/lib/utils").merge,qs=_dereq_("qs"),paramCompileMatcher=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|[*.()\[\]\\+|{}^$]/g,paramInjectMatcher=/:([a-zA-Z_$][a-zA-Z0-9_$?]*[?]?)|[*]/g,paramInjectTrailingSlashMatcher=/\/\/\?|\/\?/g,queryMatcher=/\?(.+)/,_compiledPatterns={},Path={decode:function(path){return decodeURI(path.replace(/\+/g," "))},encode:function(path){return encodeURI(path).replace(/%20/g,"+")},extractParamNames:function(pattern){return compilePattern(pattern).paramNames},extractParams:function(pattern,path){var object=compilePattern(pattern),match=path.match(object.matcher);if(!match)return null;var params={};return object.paramNames.forEach(function(paramName,index){params[paramName]=match[index+1]}),params},injectParams:function(pattern,params){params=params||{};var splatIndex=0;return pattern.replace(paramInjectMatcher,function(match,paramName){if(paramName=paramName||"splat","?"!==paramName.slice(-1))invariant(null!=params[paramName],'Missing "'+paramName+'" parameter for path "'+pattern+'"');else if(paramName=paramName.slice(0,-1),null==params[paramName])return"";var segment;return"splat"===paramName&&Array.isArray(params[paramName])?(segment=params[paramName][splatIndex++],invariant(null!=segment,"Missing splat # "+splatIndex+' for path "'+pattern+'"')):segment=params[paramName],segment}).replace(paramInjectTrailingSlashMatcher,"/")},extractQuery:function(path){var match=path.match(queryMatcher);return match&&qs.parse(match[1])},withoutQuery:function(path){return path.replace(queryMatcher,"")},withQuery:function(path,query){var existingQuery=Path.extractQuery(path);existingQuery&&(query=query?merge(existingQuery,query):existingQuery);var queryString=query&&qs.stringify(query);return queryString?Path.withoutQuery(path)+"?"+queryString:path},isAbsolute:function(path){return"/"===path.charAt(0)},normalize:function(path){return path.replace(/^\/*/,"/")},join:function(a,b){return a.replace(/\/*$/,"/")+b}};module.exports=Path},{qs:32,"qs/lib/utils":36,"react/lib/invariant":41}],22:[function(_dereq_,module){var Promise=_dereq_("when/lib/Promise");module.exports=Promise},{"when/lib/Promise":43}],23:[function(_dereq_,module){var PropTypes={falsy:function(props,propName,elementName){return props[propName]?new Error("<"+elementName+'> may not have a "'+propName+'" prop'):void 0}};module.exports=PropTypes},{}],24:[function(_dereq_,module){function Redirect(to,params,query){this.to=to,this.params=params,this.query=query}module.exports=Redirect},{}],25:[function(_dereq_,module){function runHooks(hooks,callback){try{var promise=hooks.reduce(function(promise,hook){return promise?promise.then(hook):hook()},null)}catch(error){return callback(error)}promise?promise.then(function(){setTimeout(callback)},function(error){setTimeout(function(){callback(error)})}):callback()}function runTransitionFromHooks(transition,routes,components,callback){components=reversedArray(components);var hooks=reversedArray(routes).map(function(route,index){return function(){var handler=route.handler;if(!transition.isAborted&&handler.willTransitionFrom)return handler.willTransitionFrom(transition,components[index]);var promise=transition._promise;return transition._promise=null,promise}});runHooks(hooks,callback)}function runTransitionToHooks(transition,routes,params,query,callback){var hooks=routes.map(function(route){return function(){var handler=route.handler;!transition.isAborted&&handler.willTransitionTo&&handler.willTransitionTo(transition,params,query);var promise=transition._promise;return transition._promise=null,promise}});runHooks(hooks,callback)}function Transition(path,retry){this.path=path,this.abortReason=null,this.isAborted=!1,this.retry=retry.bind(this),this._promise=null}var assign=_dereq_("react/lib/Object.assign"),reversedArray=_dereq_("./reversedArray"),Redirect=_dereq_("./Redirect"),Promise=_dereq_("./Promise");assign(Transition.prototype,{abort:function(reason){this.isAborted||(this.abortReason=reason,this.isAborted=!0)},redirect:function(to,params,query){this.abort(new Redirect(to,params,query))},wait:function(value){this._promise=Promise.resolve(value)},from:function(routes,components,callback){return runTransitionFromHooks(this,routes,components,callback)},to:function(routes,params,query,callback){return runTransitionToHooks(this,routes,params,query,callback)}}),module.exports=Transition},{"./Promise":22,"./Redirect":24,"./reversedArray":29,"react/lib/Object.assign":38}],26:[function(_dereq_,module){function defaultErrorHandler(error){throw error}function defaultAbortHandler(abortReason,location){if("string"==typeof location)throw new Error("Unhandled aborted transition! Reason: "+abortReason);abortReason instanceof Cancellation||(abortReason instanceof Redirect?location.replace(this.makePath(abortReason.to,abortReason.params,abortReason.query)):location.pop())}function findMatch(pathname,routes,defaultRoute,notFoundRoute){for(var match,route,params,i=0,len=routes.length;len>i;++i){if(route=routes[i],match=findMatch(pathname,route.childRoutes,route.defaultRoute,route.notFoundRoute),null!=match)return match.routes.unshift(route),match;if(params=Path.extractParams(route.path,pathname))return createMatch(route,params)}return defaultRoute&&(params=Path.extractParams(defaultRoute.path,pathname))?createMatch(defaultRoute,params):notFoundRoute&&(params=Path.extractParams(notFoundRoute.path,pathname))?createMatch(notFoundRoute,params):match}function createMatch(route,params){return{routes:[route],params:params}}function hasMatch(routes,route,prevParams,nextParams){return routes.some(function(r){if(r!==route)return!1;for(var paramName,paramNames=route.paramNames,i=0,len=paramNames.length;len>i;++i)if(paramName=paramNames[i],nextParams[paramName]!==prevParams[paramName])return!1;return!0})}function createRouter(options){function updateState(){state=nextState,nextState={}}options=options||{},"function"==typeof options?options={routes:options}:Array.isArray(options)&&(options={routes:options});var routes=[],namedRoutes={},components=[],location=options.location||DEFAULT_LOCATION,scrollBehavior=options.scrollBehavior||DEFAULT_SCROLL_BEHAVIOR,onError=options.onError||defaultErrorHandler,onAbort=options.onAbort||defaultAbortHandler,state={},nextState={},pendingTransition=null;location!==HistoryLocation||supportsHistory()||(location=RefreshLocation);var router=React.createClass({displayName:"Router",mixins:[NavigationContext,StateContext,Scrolling],statics:{defaultRoute:null,notFoundRoute:null,addRoutes:function(children){routes.push.apply(routes,createRoutesFromChildren(children,this,namedRoutes))},makePath:function(to,params,query){var path;if(Path.isAbsolute(to))path=Path.normalize(to);else{var route=namedRoutes[to];invariant(route,'Unable to find <Route name="%s">',to),path=route.path}return Path.withQuery(Path.injectParams(path,params),query)},makeHref:function(to,params,query){var path=this.makePath(to,params,query);return location===HashLocation?"#"+path:path},transitionTo:function(to,params,query){invariant("string"!=typeof location,"You cannot use transitionTo with a static location");var path=this.makePath(to,params,query);pendingTransition?location.replace(path):location.push(path)},replaceWith:function(to,params,query){invariant("string"!=typeof location,"You cannot use replaceWith with a static location"),location.replace(this.makePath(to,params,query))},goBack:function(){invariant("string"!=typeof location,"You cannot use goBack with a static location"),location.pop()},match:function(path){return findMatch(Path.withoutQuery(path),routes,this.defaultRoute,this.notFoundRoute)||null},dispatch:function(path,action,callback){pendingTransition&&(pendingTransition.abort(new Cancellation),pendingTransition=null);var prevPath=state.path;if(prevPath!==path){prevPath&&action!==LocationActions.REPLACE&&this.recordScrollPosition(prevPath);var match=this.match(path);warning(null!=match,'No route matches path "%s". Make sure you have <Route path="%s"> somewhere in your routes',path,path),null==match&&(match={});var fromRoutes,toRoutes,prevRoutes=state.routes||[],prevParams=state.params||{},nextRoutes=match.routes||[],nextParams=match.params||{},nextQuery=Path.extractQuery(path)||{};prevRoutes.length?(fromRoutes=prevRoutes.filter(function(route){return!hasMatch(nextRoutes,route,prevParams,nextParams)}),toRoutes=nextRoutes.filter(function(route){return!hasMatch(prevRoutes,route,prevParams,nextParams)})):(fromRoutes=[],toRoutes=nextRoutes);var transition=new Transition(path,this.replaceWith.bind(this,path));pendingTransition=transition,transition.from(fromRoutes,components,function(error){return error||transition.isAborted?callback.call(router,error,transition):void transition.to(toRoutes,nextParams,nextQuery,function(error){return error||transition.isAborted?callback.call(router,error,transition):(nextState.path=path,nextState.action=action,nextState.routes=nextRoutes,nextState.params=nextParams,nextState.query=nextQuery,void callback.call(router,null,transition))})})}},run:function(callback){function dispatchHandler(error,transition){pendingTransition=null,error?onError.call(router,error):transition.isAborted?onAbort.call(router,transition.abortReason,location):callback.call(router,router,nextState)}function changeListener(change){router.dispatch(change.path,change.type,dispatchHandler)}"string"==typeof location?(warning(!canUseDOM||!1,"You should not use a static location in a DOM environment because the router will not be kept in sync with the current URL"),router.dispatch(location,null,dispatchHandler)):(invariant(canUseDOM,"You cannot use %s in a non-DOM environment",location),location.addChangeListener&&location.addChangeListener(changeListener),router.dispatch(location.getCurrentPath(),null,dispatchHandler))}},propTypes:{children:PropTypes.falsy},getLocation:function(){return location},getScrollBehavior:function(){return scrollBehavior},getRouteAtDepth:function(depth){var routes=this.state.routes;return routes&&routes[depth]},getRouteComponents:function(){return components},getInitialState:function(){return updateState(),state},componentWillReceiveProps:function(){updateState(),this.setState(state)},render:function(){return this.getRouteAtDepth(0)?React.createElement(RouteHandler,this.props):null},childContextTypes:{getRouteAtDepth:React.PropTypes.func.isRequired,getRouteComponents:React.PropTypes.func.isRequired,routeHandlers:React.PropTypes.array.isRequired},getChildContext:function(){return{getRouteComponents:this.getRouteComponents,getRouteAtDepth:this.getRouteAtDepth,routeHandlers:[this]}}});return options.routes&&router.addRoutes(options.routes),router}var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,warning=_dereq_("react/lib/warning"),invariant=_dereq_("react/lib/invariant"),canUseDOM=_dereq_("react/lib/ExecutionEnvironment").canUseDOM,ImitateBrowserBehavior=_dereq_("../behaviors/ImitateBrowserBehavior"),RouteHandler=_dereq_("../components/RouteHandler"),LocationActions=_dereq_("../actions/LocationActions"),HashLocation=_dereq_("../locations/HashLocation"),HistoryLocation=_dereq_("../locations/HistoryLocation"),RefreshLocation=_dereq_("../locations/RefreshLocation"),NavigationContext=_dereq_("../mixins/NavigationContext"),StateContext=_dereq_("../mixins/StateContext"),Scrolling=_dereq_("../mixins/Scrolling"),createRoutesFromChildren=_dereq_("./createRoutesFromChildren"),supportsHistory=_dereq_("./supportsHistory"),Transition=_dereq_("./Transition"),PropTypes=_dereq_("./PropTypes"),Redirect=_dereq_("./Redirect"),Cancellation=_dereq_("./Cancellation"),Path=_dereq_("./Path"),DEFAULT_LOCATION=canUseDOM?HashLocation:"/",DEFAULT_SCROLL_BEHAVIOR=canUseDOM?ImitateBrowserBehavior:null;module.exports=createRouter},{"../actions/LocationActions":1,"../behaviors/ImitateBrowserBehavior":2,"../components/RouteHandler":9,"../locations/HashLocation":11,"../locations/HistoryLocation":12,"../locations/RefreshLocation":13,"../mixins/NavigationContext":16,"../mixins/Scrolling":17,"../mixins/StateContext":19,"./Cancellation":20,"./Path":21,"./PropTypes":23,"./Redirect":24,"./Transition":25,"./createRoutesFromChildren":27,"./supportsHistory":31,"react/lib/ExecutionEnvironment":37,"react/lib/invariant":41,"react/lib/warning":42}],27:[function(_dereq_,module){function createRedirectHandler(to,_params,_query){return React.createClass({statics:{willTransitionTo:function(transition,params,query){transition.redirect(to,_params||params,_query||query)}},render:function(){return null}})}function checkPropTypes(componentName,propTypes,props){for(var propName in propTypes)if(propTypes.hasOwnProperty(propName)){var error=propTypes[propName](props,propName,componentName);error instanceof Error&&warning(!1,error.message)}}function createRoute(element,parentRoute,namedRoutes){var type=element.type,props=element.props,componentName=type&&type.displayName||"UnknownComponent";invariant(-1!==CONFIG_ELEMENT_TYPES.indexOf(type),'Unrecognized route configuration element "<%s>"',componentName),type.propTypes&&checkPropTypes(componentName,type.propTypes,props);var route={name:props.name};props.ignoreScrollBehavior&&(route.ignoreScrollBehavior=!0),type===Redirect.type?(route.handler=createRedirectHandler(props.to,props.params,props.query),props.path=props.path||props.from||"*"):route.handler=props.handler;var parentPath=parentRoute&&parentRoute.path||"/";if((props.path||props.name)&&type!==DefaultRoute.type&&type!==NotFoundRoute.type){var path=props.path||props.name;Path.isAbsolute(path)||(path=Path.join(parentPath,path)),route.path=Path.normalize(path)}else route.path=parentPath,type===NotFoundRoute.type&&(route.path+="*");return route.paramNames=Path.extractParamNames(route.path),parentRoute&&Array.isArray(parentRoute.paramNames)&&parentRoute.paramNames.forEach(function(paramName){invariant(-1!==route.paramNames.indexOf(paramName),'The nested route path "%s" is missing the "%s" parameter of its parent path "%s"',route.path,paramName,parentRoute.path)}),props.name&&(invariant(null==namedRoutes[props.name],'You cannot use the name "%s" for more than one route',props.name),namedRoutes[props.name]=route),type===NotFoundRoute.type?(invariant(parentRoute,"<NotFoundRoute> must have a parent <Route>"),invariant(null==parentRoute.notFoundRoute,"You may not have more than one <NotFoundRoute> per <Route>"),parentRoute.notFoundRoute=route,null):type===DefaultRoute.type?(invariant(parentRoute,"<DefaultRoute> must have a parent <Route>"),invariant(null==parentRoute.defaultRoute,"You may not have more than one <DefaultRoute> per <Route>"),parentRoute.defaultRoute=route,null):(route.childRoutes=createRoutesFromChildren(props.children,route,namedRoutes),route)}function createRoutesFromChildren(children,parentRoute,namedRoutes){var routes=[];return React.Children.forEach(children,function(child){(child=createRoute(child,parentRoute,namedRoutes))&&routes.push(child)}),routes}var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,warning=_dereq_("react/lib/warning"),invariant=_dereq_("react/lib/invariant"),DefaultRoute=_dereq_("../components/DefaultRoute"),NotFoundRoute=_dereq_("../components/NotFoundRoute"),Redirect=_dereq_("../components/Redirect"),Route=_dereq_("../components/Route"),Path=_dereq_("./Path"),CONFIG_ELEMENT_TYPES=[DefaultRoute.type,NotFoundRoute.type,Redirect.type,Route.type];
module.exports=createRoutesFromChildren},{"../components/DefaultRoute":4,"../components/NotFoundRoute":6,"../components/Redirect":7,"../components/Route":8,"./Path":21,"react/lib/invariant":41,"react/lib/warning":42}],28:[function(_dereq_,module){function getWindowScrollPosition(){return invariant(canUseDOM,"Cannot get current scroll position without a DOM"),{x:window.scrollX,y:window.scrollY}}var invariant=_dereq_("react/lib/invariant"),canUseDOM=_dereq_("react/lib/ExecutionEnvironment").canUseDOM;module.exports=getWindowScrollPosition},{"react/lib/ExecutionEnvironment":37,"react/lib/invariant":41}],29:[function(_dereq_,module){function reversedArray(array){return array.slice(0).reverse()}module.exports=reversedArray},{}],30:[function(_dereq_,module){function runRouter(routes,location,callback){"function"==typeof location&&(callback=location,location=null);var router=createRouter({routes:routes,location:location});return router.run(callback),router}var createRouter=_dereq_("./createRouter");module.exports=runRouter},{"./createRouter":26}],31:[function(_dereq_,module){function supportsHistory(){var ua=navigator.userAgent;return-1===ua.indexOf("Android 2.")&&-1===ua.indexOf("Android 4.0")||-1===ua.indexOf("Mobile Safari")||-1!==ua.indexOf("Chrome")?window.history&&"pushState"in window.history:!1}module.exports=supportsHistory},{}],32:[function(_dereq_,module){module.exports=_dereq_("./lib")},{"./lib":33}],33:[function(_dereq_,module){var Stringify=_dereq_("./stringify"),Parse=_dereq_("./parse");module.exports={stringify:Stringify,parse:Parse}},{"./parse":34,"./stringify":35}],34:[function(_dereq_,module){var Utils=_dereq_("./utils"),internals={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3};internals.parseValues=function(str,options){for(var obj={},parts=str.split(options.delimiter,1/0===options.parameterLimit?void 0:options.parameterLimit),i=0,il=parts.length;il>i;++i){var part=parts[i],pos=-1===part.indexOf("]=")?part.indexOf("="):part.indexOf("]=")+1;if(-1===pos)obj[Utils.decode(part)]="";else{var key=Utils.decode(part.slice(0,pos)),val=Utils.decode(part.slice(pos+1));obj[key]=obj[key]?[].concat(obj[key]).concat(val):val}}return obj},internals.parseObject=function(chain,val,options){if(!chain.length)return val;var root=chain.shift(),obj={};if("[]"===root)obj=[],obj=obj.concat(internals.parseObject(chain,val,options));else{var cleanRoot="["===root[0]&&"]"===root[root.length-1]?root.slice(1,root.length-1):root,index=parseInt(cleanRoot,10);!isNaN(index)&&root!==cleanRoot&&index<=options.arrayLimit?(obj=[],obj[index]=internals.parseObject(chain,val,options)):obj[cleanRoot]=internals.parseObject(chain,val,options)}return obj},internals.parseKeys=function(key,val,options){if(key){var parent=/^([^\[\]]*)/,child=/(\[[^\[\]]*\])/g,segment=parent.exec(key);if(!Object.prototype.hasOwnProperty(segment[1])){var keys=[];segment[1]&&keys.push(segment[1]);for(var i=0;null!==(segment=child.exec(key))&&i<options.depth;)++i,Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g,""))||keys.push(segment[1]);return segment&&keys.push("["+key.slice(segment.index)+"]"),internals.parseObject(keys,val,options)}}},module.exports=function(str,options){if(""===str||null===str||"undefined"==typeof str)return{};options=options||{},options.delimiter="string"==typeof options.delimiter||Utils.isRegExp(options.delimiter)?options.delimiter:internals.delimiter,options.depth="number"==typeof options.depth?options.depth:internals.depth,options.arrayLimit="number"==typeof options.arrayLimit?options.arrayLimit:internals.arrayLimit,options.parameterLimit="number"==typeof options.parameterLimit?options.parameterLimit:internals.parameterLimit;for(var tempObj="string"==typeof str?internals.parseValues(str,options):str,obj={},keys=Object.keys(tempObj),i=0,il=keys.length;il>i;++i){var key=keys[i],newObj=internals.parseKeys(key,tempObj[key],options);obj=Utils.merge(obj,newObj)}return Utils.compact(obj)}},{"./utils":36}],35:[function(_dereq_,module){var Utils=_dereq_("./utils"),internals={delimiter:"&"};internals.stringify=function(obj,prefix){if(Utils.isBuffer(obj)?obj=obj.toString():obj instanceof Date?obj=obj.toISOString():null===obj&&(obj=""),"string"==typeof obj||"number"==typeof obj||"boolean"==typeof obj)return[encodeURIComponent(prefix)+"="+encodeURIComponent(obj)];var values=[];for(var key in obj)obj.hasOwnProperty(key)&&(values=values.concat(internals.stringify(obj[key],prefix+"["+key+"]")));return values},module.exports=function(obj,options){options=options||{};var delimiter="undefined"==typeof options.delimiter?internals.delimiter:options.delimiter,keys=[];for(var key in obj)obj.hasOwnProperty(key)&&(keys=keys.concat(internals.stringify(obj[key],key)));return keys.join(delimiter)}},{"./utils":36}],36:[function(_dereq_,module,exports){exports.arrayToObject=function(source){for(var obj={},i=0,il=source.length;il>i;++i)"undefined"!=typeof source[i]&&(obj[i]=source[i]);return obj},exports.merge=function(target,source){if(!source)return target;if(Array.isArray(source)){for(var i=0,il=source.length;il>i;++i)"undefined"!=typeof source[i]&&(target[i]="object"==typeof target[i]?exports.merge(target[i],source[i]):source[i]);return target}if(Array.isArray(target)){if("object"!=typeof source)return target.push(source),target;target=exports.arrayToObject(target)}for(var keys=Object.keys(source),k=0,kl=keys.length;kl>k;++k){var key=keys[k],value=source[key];target[key]=value&&"object"==typeof value&&target[key]?exports.merge(target[key],value):value}return target},exports.decode=function(str){try{return decodeURIComponent(str.replace(/\+/g," "))}catch(e){return str}},exports.compact=function(obj,refs){if("object"!=typeof obj||null===obj)return obj;refs=refs||[];var lookup=refs.indexOf(obj);if(-1!==lookup)return refs[lookup];if(refs.push(obj),Array.isArray(obj)){for(var compacted=[],i=0,l=obj.length;l>i;++i)"undefined"!=typeof obj[i]&&compacted.push(obj[i]);return compacted}for(var keys=Object.keys(obj),i=0,il=keys.length;il>i;++i){var key=keys[i];obj[key]=exports.compact(obj[key],refs)}return obj},exports.isRegExp=function(obj){return"[object RegExp]"===Object.prototype.toString.call(obj)},exports.isBuffer=function(obj){return"undefined"!=typeof Buffer?Buffer.isBuffer(obj):!1}},{}],37:[function(_dereq_,module){"use strict";var canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),ExecutionEnvironment={canUseDOM:canUseDOM,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:canUseDOM&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:canUseDOM&&!!window.screen,isInWorker:!canUseDOM};module.exports=ExecutionEnvironment},{}],38:[function(_dereq_,module){function assign(target){if(null==target)throw new TypeError("Object.assign target cannot be null or undefined");for(var to=Object(target),hasOwnProperty=Object.prototype.hasOwnProperty,nextIndex=1;nextIndex<arguments.length;nextIndex++){var nextSource=arguments[nextIndex];if(null!=nextSource){var from=Object(nextSource);for(var key in from)hasOwnProperty.call(from,key)&&(to[key]=from[key])}}return to}module.exports=assign},{}],39:[function(_dereq_,module){function cx(classNames){return"object"==typeof classNames?Object.keys(classNames).filter(function(className){return classNames[className]}).join(" "):Array.prototype.join.call(arguments," ")}module.exports=cx},{}],40:[function(_dereq_,module){function makeEmptyFunction(arg){return function(){return arg}}function emptyFunction(){}emptyFunction.thatReturns=makeEmptyFunction,emptyFunction.thatReturnsFalse=makeEmptyFunction(!1),emptyFunction.thatReturnsTrue=makeEmptyFunction(!0),emptyFunction.thatReturnsNull=makeEmptyFunction(null),emptyFunction.thatReturnsThis=function(){return this},emptyFunction.thatReturnsArgument=function(arg){return arg},module.exports=emptyFunction},{}],41:[function(_dereq_,module){"use strict";var invariant=function(condition,format,a,b,c,d,e,f){if(!condition){var error;if(void 0===format)error=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var args=[a,b,c,d,e,f],argIndex=0;error=new Error("Invariant Violation: "+format.replace(/%s/g,function(){return args[argIndex++]}))}throw error.framesToPop=1,error}};module.exports=invariant},{}],42:[function(_dereq_,module){"use strict";var emptyFunction=_dereq_("./emptyFunction"),warning=emptyFunction;module.exports=warning},{"./emptyFunction":40}],43:[function(_dereq_,module){!function(define){"use strict";define(function(_dereq_){var makePromise=_dereq_("./makePromise"),Scheduler=_dereq_("./Scheduler"),async=_dereq_("./async");return makePromise({scheduler:new Scheduler(async)})})}("function"==typeof define&&define.amd?define:function(factory){module.exports=factory(_dereq_)})},{"./Scheduler":45,"./async":46,"./makePromise":47}],44:[function(_dereq_,module){!function(define){"use strict";define(function(){function Queue(capacityPow2){this.head=this.tail=this.length=0,this.buffer=new Array(1<<capacityPow2)}return Queue.prototype.push=function(x){return this.length===this.buffer.length&&this._ensureCapacity(2*this.length),this.buffer[this.tail]=x,this.tail=this.tail+1&this.buffer.length-1,++this.length,this.length},Queue.prototype.shift=function(){var x=this.buffer[this.head];return this.buffer[this.head]=void 0,this.head=this.head+1&this.buffer.length-1,--this.length,x},Queue.prototype._ensureCapacity=function(capacity){var len,head=this.head,buffer=this.buffer,newBuffer=new Array(capacity),i=0;if(0===head)for(len=this.length;len>i;++i)newBuffer[i]=buffer[i];else{for(capacity=buffer.length,len=this.tail;capacity>head;++i,++head)newBuffer[i]=buffer[head];for(head=0;len>head;++i,++head)newBuffer[i]=buffer[head]}this.buffer=newBuffer,this.head=0,this.tail=this.length},Queue})}("function"==typeof define&&define.amd?define:function(factory){module.exports=factory()})},{}],45:[function(_dereq_,module){!function(define){"use strict";define(function(_dereq_){function Scheduler(async){this._async=async,this._queue=new Queue(15),this._afterQueue=new Queue(5),this._running=!1;var self=this;this.drain=function(){self._drain()}}function runQueue(queue){for(;queue.length>0;)queue.shift().run()}var Queue=_dereq_("./Queue");return Scheduler.prototype.enqueue=function(task){this._add(this._queue,task)},Scheduler.prototype.afterQueue=function(task){this._add(this._afterQueue,task)},Scheduler.prototype._drain=function(){runQueue(this._queue),this._running=!1,runQueue(this._afterQueue)},Scheduler.prototype._add=function(queue,task){queue.push(task),this._running||(this._running=!0,this._async(this.drain))},Scheduler})}("function"==typeof define&&define.amd?define:function(factory){module.exports=factory(_dereq_)})},{"./Queue":44}],46:[function(_dereq_,module){!function(define){"use strict";define(function(_dereq_){var nextTick,MutationObs;return nextTick="undefined"!=typeof process&&null!==process&&"function"==typeof process.nextTick?function(f){process.nextTick(f)}:(MutationObs="function"==typeof MutationObserver&&MutationObserver||"function"==typeof WebKitMutationObserver&&WebKitMutationObserver)?function(document,MutationObserver){function run(){var f=scheduled;scheduled=void 0,f()}var scheduled,el=document.createElement("div"),o=new MutationObserver(run);return o.observe(el,{attributes:!0}),function(f){scheduled=f,el.setAttribute("class","x")}}(document,MutationObs):function(cjsRequire){var vertx;try{vertx=cjsRequire("vertx")}catch(ignore){}if(vertx){if("function"==typeof vertx.runOnLoop)return vertx.runOnLoop;if("function"==typeof vertx.runOnContext)return vertx.runOnContext}var capturedSetTimeout=setTimeout;return function(t){capturedSetTimeout(t,0)}}(_dereq_)})}("function"==typeof define&&define.amd?define:function(factory){module.exports=factory(_dereq_)})},{}],47:[function(_dereq_,module){!function(define){"use strict";define(function(){return function(environment){function Promise(resolver,handler){this._handler=resolver===Handler?handler:init(resolver)}function init(resolver){function promiseResolve(x){handler.resolve(x)}function promiseReject(reason){handler.reject(reason)}function promiseNotify(x){handler.notify(x)}var handler=new Pending;try{resolver(promiseResolve,promiseReject,promiseNotify)}catch(e){promiseReject(e)}return handler}function resolve(x){return isPromise(x)?x:new Promise(Handler,new Async(getHandler(x)))}function reject(x){return new Promise(Handler,new Async(new Rejected(x)))}function never(){return foreverPendingPromise}function defer(){return new Promise(Handler,new Pending)}function all(promises){function settleAt(i,x,resolver){this[i]=x,0===--pending&&resolver.become(new Fulfilled(this))}var i,h,x,s,resolver=new Pending,pending=promises.length>>>0,results=new Array(pending);for(i=0;i<promises.length;++i)if(x=promises[i],void 0!==x||i in promises)if(maybeThenable(x))if(h=getHandlerMaybeThenable(x),s=h.state(),0===s)h.fold(settleAt,i,results,resolver);else{if(!(s>0)){unreportRemaining(promises,i+1,h),resolver.become(h);break}results[i]=h.value,--pending}else results[i]=x,--pending;else--pending;return 0===pending&&resolver.become(new Fulfilled(results)),new Promise(Handler,resolver)}function unreportRemaining(promises,start,rejectedHandler){var i,h,x;for(i=start;i<promises.length;++i)x=promises[i],maybeThenable(x)&&(h=getHandlerMaybeThenable(x),h!==rejectedHandler&&h.visit(h,void 0,h._unreport))}function race(promises){if(Object(promises)===promises&&0===promises.length)return never();var i,x,h=new Pending;for(i=0;i<promises.length;++i)x=promises[i],void 0!==x&&i in promises&&getHandler(x).visit(h,h.resolve,h.reject);return new Promise(Handler,h)}function getHandler(x){return isPromise(x)?x._handler.join():maybeThenable(x)?getHandlerUntrusted(x):new Fulfilled(x)}function getHandlerMaybeThenable(x){return isPromise(x)?x._handler.join():getHandlerUntrusted(x)}function getHandlerUntrusted(x){try{var untrustedThen=x.then;return"function"==typeof untrustedThen?new Thenable(untrustedThen,x):new Fulfilled(x)}catch(e){return new Rejected(e)}}function Handler(){}function FailIfRejected(){}function Pending(receiver,inheritedContext){Promise.createContext(this,inheritedContext),this.consumers=void 0,this.receiver=receiver,this.handler=void 0,this.resolved=!1}function Async(handler){this.handler=handler}function Thenable(then,thenable){Pending.call(this),tasks.enqueue(new AssimilateTask(then,thenable,this))}function Fulfilled(x){Promise.createContext(this),this.value=x}function Rejected(x){Promise.createContext(this),this.id=++errorId,this.value=x,this.handled=!1,this.reported=!1,this._report()}function ReportTask(rejection,context){this.rejection=rejection,this.context=context}function UnreportTask(rejection){this.rejection=rejection}function cycle(){return new Rejected(new TypeError("Promise cycle"))}function ContinuationTask(continuation,handler){this.continuation=continuation,this.handler=handler}function ProgressTask(value,handler){this.handler=handler,this.value=value}function AssimilateTask(then,thenable,resolver){this._then=then,this.thenable=thenable,this.resolver=resolver}function tryAssimilate(then,thenable,resolve,reject,notify){try{then.call(thenable,resolve,reject,notify)}catch(e){reject(e)}}function isPromise(x){return x instanceof Promise}function maybeThenable(x){return("object"==typeof x||"function"==typeof x)&&null!==x}function runContinuation1(f,h,receiver,next){return"function"!=typeof f?next.become(h):(Promise.enterContext(h),tryCatchReject(f,h.value,receiver,next),void Promise.exitContext())}function runContinuation3(f,x,h,receiver,next){return"function"!=typeof f?next.become(h):(Promise.enterContext(h),tryCatchReject3(f,x,h.value,receiver,next),void Promise.exitContext())}function runNotify(f,x,h,receiver,next){return"function"!=typeof f?next.notify(x):(Promise.enterContext(h),tryCatchReturn(f,x,receiver,next),void Promise.exitContext())}function tryCatchReject(f,x,thisArg,next){try{next.become(getHandler(f.call(thisArg,x)))}catch(e){next.become(new Rejected(e))}}function tryCatchReject3(f,x,y,thisArg,next){try{f.call(thisArg,x,y,next)}catch(e){next.become(new Rejected(e))}}function tryCatchReturn(f,x,thisArg,next){try{next.notify(f.call(thisArg,x))}catch(e){next.notify(e)}}function inherit(Parent,Child){Child.prototype=objectCreate(Parent.prototype),Child.prototype.constructor=Child}function noop(){}var tasks=environment.scheduler,objectCreate=Object.create||function(proto){function Child(){}return Child.prototype=proto,new Child};Promise.resolve=resolve,Promise.reject=reject,Promise.never=never,Promise._defer=defer,Promise._handler=getHandler,Promise.prototype.then=function(onFulfilled,onRejected){var parent=this._handler,state=parent.join().state();if("function"!=typeof onFulfilled&&state>0||"function"!=typeof onRejected&&0>state)return new this.constructor(Handler,parent);var p=this._beget(),child=p._handler;return parent.chain(child,parent.receiver,onFulfilled,onRejected,arguments.length>2?arguments[2]:void 0),p},Promise.prototype["catch"]=function(onRejected){return this.then(void 0,onRejected)},Promise.prototype._beget=function(){var parent=this._handler,child=new Pending(parent.receiver,parent.join().context);return new this.constructor(Handler,child)},Promise.all=all,Promise.race=race,Handler.prototype.when=Handler.prototype.become=Handler.prototype.notify=Handler.prototype.fail=Handler.prototype._unreport=Handler.prototype._report=noop,Handler.prototype._state=0,Handler.prototype.state=function(){return this._state},Handler.prototype.join=function(){for(var h=this;void 0!==h.handler;)h=h.handler;return h},Handler.prototype.chain=function(to,receiver,fulfilled,rejected,progress){this.when({resolver:to,receiver:receiver,fulfilled:fulfilled,rejected:rejected,progress:progress})},Handler.prototype.visit=function(receiver,fulfilled,rejected,progress){this.chain(failIfRejected,receiver,fulfilled,rejected,progress)},Handler.prototype.fold=function(f,z,c,to){this.visit(to,function(x){f.call(c,z,x,this)},to.reject,to.notify)},inherit(Handler,FailIfRejected),FailIfRejected.prototype.become=function(h){h.fail()};var failIfRejected=new FailIfRejected;inherit(Handler,Pending),Pending.prototype._state=0,Pending.prototype.resolve=function(x){this.become(getHandler(x))},Pending.prototype.reject=function(x){this.resolved||this.become(new Rejected(x))},Pending.prototype.join=function(){if(!this.resolved)return this;for(var h=this;void 0!==h.handler;)if(h=h.handler,h===this)return this.handler=cycle();return h},Pending.prototype.run=function(){var q=this.consumers,handler=this.join();this.consumers=void 0;for(var i=0;i<q.length;++i)handler.when(q[i])},Pending.prototype.become=function(handler){this.resolved||(this.resolved=!0,this.handler=handler,void 0!==this.consumers&&tasks.enqueue(this),void 0!==this.context&&handler._report(this.context))},Pending.prototype.when=function(continuation){this.resolved?tasks.enqueue(new ContinuationTask(continuation,this.handler)):void 0===this.consumers?this.consumers=[continuation]:this.consumers.push(continuation)},Pending.prototype.notify=function(x){this.resolved||tasks.enqueue(new ProgressTask(x,this))},Pending.prototype.fail=function(context){var c="undefined"==typeof context?this.context:context;this.resolved&&this.handler.join().fail(c)},Pending.prototype._report=function(context){this.resolved&&this.handler.join()._report(context)},Pending.prototype._unreport=function(){this.resolved&&this.handler.join()._unreport()},inherit(Handler,Async),Async.prototype.when=function(continuation){tasks.enqueue(new ContinuationTask(continuation,this))},Async.prototype._report=function(context){this.join()._report(context)},Async.prototype._unreport=function(){this.join()._unreport()},inherit(Pending,Thenable),inherit(Handler,Fulfilled),Fulfilled.prototype._state=1,Fulfilled.prototype.fold=function(f,z,c,to){runContinuation3(f,z,this,c,to)},Fulfilled.prototype.when=function(cont){runContinuation1(cont.fulfilled,this,cont.receiver,cont.resolver)};var errorId=0;inherit(Handler,Rejected),Rejected.prototype._state=-1,Rejected.prototype.fold=function(f,z,c,to){to.become(this)},Rejected.prototype.when=function(cont){"function"==typeof cont.rejected&&this._unreport(),runContinuation1(cont.rejected,this,cont.receiver,cont.resolver)},Rejected.prototype._report=function(context){tasks.afterQueue(new ReportTask(this,context))},Rejected.prototype._unreport=function(){this.handled=!0,tasks.afterQueue(new UnreportTask(this))},Rejected.prototype.fail=function(context){Promise.onFatalRejection(this,void 0===context?this.context:context)},ReportTask.prototype.run=function(){this.rejection.handled||(this.rejection.reported=!0,Promise.onPotentiallyUnhandledRejection(this.rejection,this.context))},UnreportTask.prototype.run=function(){this.rejection.reported&&Promise.onPotentiallyUnhandledRejectionHandled(this.rejection)},Promise.createContext=Promise.enterContext=Promise.exitContext=Promise.onPotentiallyUnhandledRejection=Promise.onPotentiallyUnhandledRejectionHandled=Promise.onFatalRejection=noop;var foreverPendingHandler=new Handler,foreverPendingPromise=new Promise(Handler,foreverPendingHandler);return ContinuationTask.prototype.run=function(){this.handler.join().when(this.continuation)},ProgressTask.prototype.run=function(){var q=this.handler.consumers;if(void 0!==q)for(var c,i=0;i<q.length;++i)c=q[i],runNotify(c.progress,this.value,this.handler,c.receiver,c.resolver)},AssimilateTask.prototype.run=function(){function _resolve(x){h.resolve(x)}function _reject(x){h.reject(x)}function _notify(x){h.notify(x)}var h=this.resolver;tryAssimilate(this._then,this.thenable,_resolve,_reject,_notify)},Promise}})}("function"==typeof define&&define.amd?define:function(factory){module.exports=factory()})},{}]},{},[10])(10)}); | svenanders/cdnjs | ajax/libs/react-router/0.11.3/react-router.min.js | JavaScript | mit | 53,982 |
/*! Quill Editor v0.16.0
* https://quilljs.com/
* Copyright (c) 2014, Jason Chen
* Copyright (c) 2013, salesforce.com
*/
@font-face {
font-family: 'quill-snow';
font-style: normal;
font-weight: normal;
src: url("data:application/vnd.ms-fontobject;base64,0CsAACgrAAABAAIAAAAAAAIABQMAAAAAAAABAJABAAAAAExQAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAII/0LwAAAAAAAAAAAAAAAAAAAAAAABAAZgBvAG4AdABlAGwAbABvAAAADgBSAGUAZwB1AGwAYQByAAAAFgBWAGUAcgBzAGkAbwBuACAAMQAuADAAAAAQAGYAbwBuAHQAZQBsAGwAbwAAAAAAAAEAAAAOAIAAAwBgT1MvMj4pST4AAADsAAAAVmNtYXDQJBm2AAABRAAAAUpjdnQgBtf/BgAAISAAAAAcZnBnbYoKeDsAACE8AAAJkWdhc3AAAAAQAAAhGAAAAAhnbHlmUjOb7wAAApAAABnKaGVhZAJfdPkAABxcAAAANmhoZWEH3wOrAAAclAAAACRobXR4RKAAAAAAHLgAAABMbG9jYT9UREkAAB0EAAAAKG1heHABkgpOAAAdLAAAACBuYW1lzJ0aHAAAHUwAAALNcG9zdAmK/O4AACAcAAAA+nByZXCSoZr/AAAq0AAAAFYAAQOdAZAABQAIAnoCvAAAAIwCegK8AAAB4AAxAQIAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA6AHoEgNS/2oAWgNSAJYAAAABAAAAAAAAAAAAAwAAAAMAAAAcAAEAAAAAAEQAAwABAAAAHAAEACgAAAAGAAQAAQACAADoEv//AAAAAOgB//8AABgAAAEAAAAAAAAAAAEGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAA/7EDEgMKABAAIgBYAF9AXBsBBAMxHREDAgRIAQECDAEAASQBBgAFQjcBAwFBAAQDAgMEYAgBBwYHawAFAAMEBQNbAAIAAQACAVsAAAYGAE8AAAAGUwAGAAZHIyMjWCNYV1M8ODY0JCcmIQkTKyUWMzI+ATQnLgEjIgcVBxcUAxYzMjY1NCYjIgcUFxYVBxQXATc2NzY3Njc2NQMmJzQnNCcmJyYvAT8BMzIXFhceAhcUBgcGBx4BFRQHBgcOAQcGLwEmBwYBNiokSV4rFyFbXSkPAQIBGCVhZF9fHSwCAwEB/tIBGQ0rGgkCBQECAwYGCxwRLwKR9VQxORgeIDIWASQjDkZjZhAMHCVSSC5Bbi93EwESLk9+JTQkBlBhlgkBkQRIWT5UBxkSRFg3GBP+EDUFAgYLDw0lSAEVj1IxDAIFBwEBBy4DCA8HDxA0QCQoQBoMHxd2SSovIx8oKA0JAgMBBwIAAQAA/7ECOwMLAEUASEBFGAEBAjcUEwMAAQJCIQECQAABAz8AAAEFAQAFaAAFAwEFA2YEAQMDaQACAQECTwACAgFTAAECAUdDQT89OzogGRcVEQYQKxU3MjY3Nj8DNj8CNgc/AzUmJyYnNxcWMzI/ATY3Bg8BBgcGBwYHBgcGDwQGFxYfAQYPASIHBiMiJi8BIgcGCgJTFhAHDx8HBQUJDAIBEQkMBBc5EAUKsRYTJVImEwEBAgcfHiQUBwcFAhkMIhUYBwECJB4lAQMFCgMNCgUVR24XSipOMBYLFSNOlSQZFiYrBwFYI0scFQ0DAQE6CAEFAgEBCwscCwYJCREgGBZvO65YgxkECwkDBhAQFwEBBAgBBgQAAAIAAP+xA1kDCwBcAGwBfkuwCVBYQBEzDwIEARACAgAELSwCAwADQhtLsApQWEARMw8CBAEQAgIABC0sAgMCA0IbS7ALUFhADjMQDwIEAAEtLAIDAAJCG0ARMw8CBAEQAgIABC0sAgMAA0JZWVlLsAlQWEAtAAkHCgcJYAAKCmkABAABBE8FAQEIBgIDAAMBAFsAAwcHA08AAwMHUwAHAwdHG0uwClBYQDMAAAQCAgBgAAkHCgcJYAAKCmkABAABBE8FAQEIBgICAwECWwADBwcDTwADAwdTAAcDB0cbS7ALUFhAKAAJBwoHCWAACgppBQEBCAYEAgQAAwEAWwADBwcDTwADAwdTAAcDB0cbS7ASUFhALQAJBwoHCWAACgppAAQAAQRPBQEBCAYCAwADAQBbAAMHBwNPAAMDB1MABwMHRxtALgAJBwoHCQpoAAoKaQAEAAEETwUBAQgGAgMAAwEAWwADBwcDTwADAwdTAAcDB0dZWVlZQBRraGNgXFtSUD8+NzQyMCojshALEysTJi8BMzIXFjMyNzY3MjcHFwYjIgcGFR8BFhcWFxYzMjc2NzY3Njc2NTQuAS8BJicmDwEnNzMXFjcXFhUUBwYHBgcGHQEUFxYXFgcGBw4BBwYjIi4BJyY9ATQnJicBNTQmIyEiBh0BFBYzITI2GxUEAhYiHUoSMC5BER8RAQEhJCELBwEIAxkUIjExOjEfGBsKFAkMBAgEAgMKExg4CAEvcitDCgMCGRYpAwgBBQgDDAgPFVM8PVFdhEMNCQkORAM+Cgj8ywgKCggDNQgKAtYBATECBAICAQEIKQUOB0KhnEUrIRMaEAoSFBAfIClXLDhQMSElDBQBAQIwBgIIAhUHBA0HAQYDCQ4PCwYL0m09KhokQRETNFRDLFi6aQ4UAfzuJAgKCggkCAoKAAMAAP+xA+gDCwAPADEAXABeQFsiAQQDAUIKAQQDAAMEAGgABQEHAQUHaAAHCAEHCGYAAgADBAIDWwkBAAABBQABWwAIBgYITwAICAZTAAYIBkcQEAEAVlRNTEA+MzIQMRAxKCYYFgkGAA8BDgsPKwEyFh0BFAYjISImPQE0NjM3JicmNTQ2MzIXFhcWFxYVFA8BJyYnJiMiBhUUFhcWFxYXBzMWFRQHBgcGBwYHBiMiLwEmJyY9ATQnNTc1NxceARceAjMyPgE1NCcmA9YICgoI/DwICgoI/BANG5WRHEIkPgYGCAMHNhweMURAS0p3JjohFITmBBcNGxQpLCktREAtTiAIBQEBOREJBgQUMUQoJFUzLRMBXgoIJAcKCgckCAokExk2M2WPCwcUFS1EIgoPAgVTHzNBMSlMIgsZEA2PFh0+OR4cExobCgwNFwgHBQcIPBsmFBkBKBUUBSAoGB1EJi8oEAAAAAMAAP+6A5gDSQAcADkAWgCZQBo4AQkFVUUCAAQTCwIBBwNCVCsCCUQGAgcCQUuwClBYQDAABQMJBAVgAAEHAgABYAAJAAAHCQBbAAQABwEEB1wAAgAGAgZXAAMDCFMACAgKA0QbQDIABQMJAwUJaAABBwIHAQJoAAkAAAcJAFsABAAHAQQHXAACAAYCBlcAAwMIUwAICAoDRFlADVdWFxcaKBcYGSgUChgrJTQvASYiBxceAR8BFAYHIi4BLwEGFB8BFjI/ATYBNC8BJiIPAQYUHwEWMjcnLgI1NDYXMh4BHwE2ARQPAQYiLwEmNDcnBiIvASY0PwE2Mh8BFhQHFzYyHwEWAywPdBAuEBYDDAECIBYIDg4EFhMQcw8tEFIP/ngPcxAsEFIQEHQPLhEXAwoEHhcJDg4DFxIB9DBSLocucy4xMTCHL3QvL1Ivhi9yLzExMIcvdC+rFw90EBIWAxAGDxceAQQKBBYRLg90Dw9REAGfFhBzEA9SDywQdA8RFwMODgkWIAEECgMXEf6OQy5RLzBzL4cwMTEvdC+GLlIuL3QuiDAxMS90LwAABP///7EELwMLAAgADwAfAC8ASUBGFAEBAw8BAAEODQwJBAIAHAEEAgRCAAIABAACBGgABgADAQYDWwABAAACAQBbAAQFBQRPAAQEBVMABQQFRzU5NSUTExIHFisBFA4BJjQ2MhYBFSE1NxcBJSEiBgcRFBYzITI2JxE0JhcRFAYHISImNxE0NjchMhYBZT5aPj5aPgI8/O6yWgEdAR78gwcKAQwGA30HDAEKUTQl/IMkNgE0JQN9JTQCES0+AkJWQED+/vprs1kBHaEKCP1aCAoKCAKmBwwT/VolNAE2JAKmJTQBNgAAAAYAAP9qA+kDTQAfAD0ATQBdAG0AfQIdQDBaAQ8QWQEVD24BDhUwAQcIXi8qAwoTPhwCAwUdDgILBAYBAQIFAQABCUIXEwIDAUFLsAxQWEBmAA8QFRAPFWgWAQoTEgkKYAAEAwsDBGAAAgsBAwJgABUODRVPFxECDhQBDQgODVwACAAHEwgHWwATABIJExJbAAkABgUJBloAAwQFA08MAQUACwIFC1sAEBAKQwABAQBTAAAACwBEG0uwJVBYQGcADxAVEA8VaBYBChMSCQpgAAQDCwMEYAACCwELAgFoABUODRVPFxECDhQBDQgODVwACAAHEwgHWwATABIJExJbAAkABgUJBloAAwQFA08MAQUACwIFC1sAEBAKQwABAQBTAAAACwBEG0uwKlBYQGgADxAVEA8VaBYBChMSEwoSaAAEAwsDBGAAAgsBCwIBaAAVDg0VTxcRAg4UAQ0IDg1cAAgABxMIB1sAEwASCRMSWwAJAAYFCQZaAAMEBQNPDAEFAAsCBQtbABAQCkMAAQEAUwAAAAsARBtAaQAPEBUQDxVoFgEKExITChJoAAQDCwMEC2gAAgsBCwIBaAAVDg0VTxcRAg4UAQ0IDg1cAAgABxMIB1sAEwASCRMSWwAJAAYFCQZaAAMEBQNPDAEFAAsCBQtbABAQCkMAAQEAUwAAAAsARFlZWUAtTk4gIHx5dHJsaWRhTl1OXVxbV1ZSUVBPTElEQSA9ID08OyQbFhESJxMjIhgYKxcUBgciJzcWMzI2NTQHJzY/ATY3NSIGJxUjNTMVBx4BExUjJjU0PgM3NCYHIgcnPgEzMhYVFA4CBzM1BRUUBiMhIiY9ATQ2MyEyFgEVIzUzNTQ3NSMGByc3MxUFFRQGIyEiJj0BNDYzITIWAxUUBgchIiY9ATQ2MyEyFtU+LDwkHxwgEBg7DgQOGAoKCSQJO7o1HCIBygQcIigWAxINGRQvDTYgKDgmLiYBRwNNCgj9WggKCggCpgcM/O27PAEBBRcoTDsDTgoI/VoICgoIAqYHDAEKCP1aCAoKCAKmBww2LTIBJTEZEBAjBB8GEh8NCAECAR5VMUEGKgFCWRQKHS4eGBgNDhABICEcIC4oHC4aHg8ismsICgoIawgKDAHwODhELhUHChQqR+HYbAcKCgdsBwoKARZrBwoBDAZrCAoKAAAAAAYAAP/UA+kC5wAIABEAIQAqADoASgBaQFc7AQoLKwEICRIBBAUDQgALAAoGCwpbAAcABgMHBlsACQAIAgkIWwADAAIBAwJbAAEFAAFPAAUABAAFBFsAAQEAUwAAAQBHSUZBPzk2NRMUJiYTFBMSDBgrNxQGLgE0PgEWNRQGIiY0NjIWARUUBichIiY9ATQ2NyEyFgEUBiImNDYyFgEVFAYjISImPQE0NjMhMhYDFRQGByEiJj0BNDYzITIW1j5aPj5aPj5aPj5aPgMSCgj9WggKCggCpgcM/O0+Wj4+Wj4DEgoI/VoICgoIAqYHDAEKCP1aCAoKCAKmBwxALEACPFw8AkDyLT4+Wj4+/utrBwwBCghrBwoBDAIALT4+Wj4+/utsBwoKB2wHCgoBFmsHCgEMBmsICgoAAAX////4A+kDCwAOAB4ALgA+AE4AUUBORz8CCAk3LwIGAScfBwMABRcPAgIDBEIACQAIAQkIWwcBAQAGBQEGWwAFBAEAAwUAWwADAgIDTwADAwJTAAIDAkdNSzU1JiYmJigVFAoYKxMUDwEGIiY3ETQ2Mh8BFgEVFAYnISImNzU0NjchMhYnFRQGJyEiJjc1NDYXITIWJxUUBgchIiY3NTQ2MyEyFicVFAYjISImNzU0NjchMhbEBaAFDwwBChAFoAUDJAoI/DwHDAEKCAPEBwwBCgj9oQcMAQoIAl8HDAEKCP2hBwwBCggCXwcMAQoI/DwHDAEKCAPEBwwBgggFoQUKCAFBCAoFoAX+7GsHDAEKCGsHCgEM0GsHDAEKCGsHDAEKzmsHCgEMBmsICgrPawgKCghrBwoBDAAAAAAF////+APpAwsADQAdAC0APQBNAFBATUY+AggJNi4CBgEmHgIABRYOAgIDBEIACQAIAQkIWwcBAQAGBQEGWwAFBAEAAwUAWwADAgIDTwADAwJTAAIDAkdMSjU1JiYmJiYXEwoYKxMRFAYmLwEmND8BNjIWARUUBichIiY3NTQ2NyEyFicVFAYnISImNzU0NhchMhYnFRQGByEiJjc1NDYzITIWJxUUBiMhIiY3NTQ2NyEyFtYKDwWhBQWhBQ8KAxIKCPw8BwwBCggDxAcMAQoI/aEHDAEKCAJfBwwBCgj9oQcMAQoIAl8HDAEKCPw8BwwBCggDxAcMAiL+vwcMAQWhBRAFoAUK/kxrBwwBCghrBwoBDNBrBwwBCghrBwwBCs5rBwoBDAZrCAoKz2sICgoIawcKAQwAAAAEAAD/+QPoAwsADwAfAC8APwBJQEYwAQYHKAEEBRgQAgIDCAACAAEEQgAHAAYFBwZbAAUABAMFBFsAAwACAQMCWwABAAABTwABAQBTAAABAEc1NSY1JiYmJAgXKyUVFAYHISImJzU0NjchMhYnFRQGByEiJic1NDY3ITIWNxUUBiMhIiYnNTQ2FyEyFicVFAYnISImJzU0NjMhMhYD6BYO/GAPFAEWDgOgDxTVFg79Ng8UARYOAsoPFJAWDvynDxQBFg4DWQ4W1xQP/X0PFAEWDgKDDhZkRw8UARYORw8UARbIRw8UARYORw8UARbJSA4WFg5IDhYBFMdIDhYBFA9IDhYWAAQAAP/5A+gDCwAPAB8ALwA/AERAQTABBgcQAQIDCAACAAEDQgAHAAYFBwZbAAUABAMFBFsAAwACAQMCWwABAAABTwABAQBTAAABAEc1JiY1JiYmJAgXKyUVFAYHISImJzU0NjchMhY3FRQGByEiJj0BNDY3ITIWNxUUBiMhIiY9ATQ2FyEyFjcVFAYnISImNzU0NjMhMhYD6BYO/GAPFAEWDgOgDxQBFg79Ng4WFg4Cyg8UARYO/KcOFhYOA1kPFAEWDv19DhYBFA8Cgw8UZEcPFAEWDkcPFAEWyEcPFAEWDkcPFAEWyUgOFhYOSA4WARTHSA4WARQPSA4WFgAAAAAEAAD/+QPoAwsADwAfAC8APwBEQEEwAQYHEAECAwgAAgABA0IABwAGBQcGWwAFAAQDBQRbAAMAAgEDAlsAAQAAAU8AAQEAUwAAAQBHNTUmNSYmJiQIFyslFRQGByEiJic1NDY3ITIWJxUUBgchIiY9ATQ2NyEyFjcVFAYjISImPQE0NhchMhYnFRQGJyEiJjc1NDYzITIWA+gWDvxgDxQBFg4DoA8U1RYO/gwOFhYOAfQPFJAWDvzuDhYWDgMSDhbXFA/+mg4WARQPAWYOFmRHDxQBFg5HDxQBFshHDxQBFg5HDxQBFslIDhYWDkgOFgEUx0gOFgEUD0gOFhYAAAAABAAA//kD6AMLAA8AHwAvAD8ASUBGMAEGBygBBAUYEAICAwgAAgABBEIABwAGBQcGWwAFAAQDBQRbAAMAAgEDAlsAAQAAAU8AAQEAUwAAAQBHNSYmNSYmJiQIFyslFRQGByEiJic1NDY3ITIWNxUUBgchIiYnNTQ2NyEyFjcVFAYjISImJzU0NhchMhY3FRQGJyEiJic1NDYzITIWA+gWDvxgDxQBFg4DoA8UARYO/GAPFAEWDgOgDxQBFg78YA8UARYOA6APFAEWDvxgDxQBFg4DoA8UZEcPFAEWDkcPFAEWyEcPFAEWDkcPFAEWyUgOFhYOSA4WARTHSA4WARQPSA4WFgACAAD/+QNYAv8AIQBFAM9AEzYBCww1AQULJQEKBCAPAgEGBEJLsBxQWEBGEAEOBQ0NDmAABgoBCgYBaAABAwoBA2YADAALBQwLWwcBBQgBBAoFBFkADQAKBg0KWg8JAgMAAANNDwkCAwMAUQIBAAMARRtARxABDgUNBQ4NaAAGCgEKBgFoAAEDCgEDZgAMAAsFDAtbBwEFCAEECgUEWQANAAoGDQpaDwkCAwAAA00PCQIDAwBRAgEAAwBFWUAfIiIAACJFIkVEQzo5MjAkIwAhACERFBQREhEUFBERGCslFSMvASYnIwcGDwEjNTM3JyM1Mx8BFhczNj8CMxUjBxcBFSEnJjU0PgQ1NCYHIgcGByc2NzYyFhUUDgQHMzUB9YtZDQQCAgUFCVaQR25nTJpNDQQCAgEFDk6PRWdyAaD+4QEDHio0Kh4iFh0ZCAw7DxQueEwaLC4uHAOCVl2NFwUHDAsOi12imF5/GAUGBQYYf16VpQF7cw8QCiM8JCYWJhEVHAEVBw80FBEkQjgfNCIgGCISLQAAAAACAAD/agNZAe4AIQBDAMBAEDUgDwMLDDQBAwEmAQoNA0JLsBxQWEBAAAYEDAQGDGgAAQsDCwEDaBABDgANDQ5gBwEFCAEEBgUEWQAMAAsBDAtbDwkCAwIBAA4DAFkADQ0KUgAKCgsKRBtAQQAGBAwEBgxoAAELAwsBA2gQAQ4ADQAODWgHAQUIAQQGBQRZAAwACwEMC1sPCQIDAgEADgMAWQANDQpSAAoKCwpEWUAfIiIAACJDIkNCQTk4MS8kIwAhACERFBQREhEUFBERGCslFSMvASYnIwcGDwEjNTM3JyM1Mx8BFhczNj8CMxUjBxcFFSEvATQ+BDU0JgciBwYHJzY3NjIWFxQOAwczNQH1i1kNBAICBQUJVpBHbmdMmk0NBAICAQUOTo9FZ3IBof7hAgIeKjQqHiIWHRkIDDsPFC16SgEmODYsAYJWXY0XBQcMCw6LXaKYXn8YBQYFBhh/XpWleXMPGiM8JCYWJhEVHAEVBhA0FBEkQjglOiYgJhYtAAAABv///2oELwNSABEAMgA7AEQAVgBfAKi2Tw4CAwIBQkuwEVBYQDoHAQUAAQYFYAALCAELTw4BAw0BAAUDAFsPAQIMCgIBBgIBWxABCAgJUxEBCQkKQwAGBgRUAAQECwREG0A7BwEFAAEABQFoAAsIAQtPDgEDDQEABQMAWw8BAgwKAgEGAgFbEAEICAlTEQEJCQpDAAYGBFQABAQLBERZQB1eXVpZVlVSUEtKSUdDQj8+OjkZFRMpNyIjIRASGCsBBgcjIiY3NDMyHgE3MjcGFRQBFAYjISImJzQ+BTMyHgI+AT8BNjcyHgQXARQGIiY0NjIWARQGLgE+AhYFFAYnIyYnNjU0JxYzMj4BFzInFAYiJjQ2MhYBS1o6Sy1AAUUEKkIhJiUDAoNSQ/4YRFABBAwQICY6IQYkLkhQRhkpEAcjOCYgEA4B/cZUdlRUdlQBiX6wgAJ8tHoBQz4uSzlaLQMlJSFEKARFR1R2VFR2VAFeA0QsLMUWGgENFRBO/ltCTk5CHjhCODQmFhgcGgIWEBoKAhYmNDhCHAKPO1RUdlRU/u9ZfgJ6tngGhNMrLgFEA0FOEBUNGBgBjztUVHZUVAAAAAAC////1QI8AucADgAdACdAJAABAAEBQgADAAIBAwJbAAEAAAFPAAEBAFMAAAEARxU0JhQEEyslFA8BBiIvASY0NjchMhYnFAYjISIuAT8BNjIfARYCOwr6CxwL+gsWDgH0DhYBFA/+DA8UAgz6Ch4K+grzDwr6Cwv6Ch4UARbIDhYWHAv6Cwv6CgAAAAEAAAABAAAv9I8gXw889QALA+gAAAAAz4k0zAAAAADPiPyM////agQvA1IAAAAIAAIAAAAAAAAAAQAAA1L/agBaBC8AAP/+BDAAAQAAAAAAAAAAAAAAAAAAABMD6AAAAxEAAAI7AAADWQAAA+gAAAOgAAAELwAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAADWQAAA1kAAAQvAAACOwAAAAAAAAC0AUACnANQBCYEmgZWBvIHkAgsCK4JLgmuCjAK/Au+DKAM5QABAAAAEwB+AAYAAAAAAAIAMAA9AG4AAADaCZEAAAAAAAAAEgDeAAEAAAAAAAAANQAAAAEAAAAAAAEACAA1AAEAAAAAAAIABwA9AAEAAAAAAAMACABEAAEAAAAAAAQACABMAAEAAAAAAAUACwBUAAEAAAAAAAYACABfAAEAAAAAAAoAKwBnAAEAAAAAAAsAEwCSAAMAAQQJAAAAagClAAMAAQQJAAEAEAEPAAMAAQQJAAIADgEfAAMAAQQJAAMAEAEtAAMAAQQJAAQAEAE9AAMAAQQJAAUAFgFNAAMAAQQJAAYAEAFjAAMAAQQJAAoAVgFzAAMAAQQJAAsAJgHJQ29weXJpZ2h0IChDKSAyMDE0IGJ5IG9yaWdpbmFsIGF1dGhvcnMgQCBmb250ZWxsby5jb21mb250ZWxsb1JlZ3VsYXJmb250ZWxsb2ZvbnRlbGxvVmVyc2lvbiAxLjBmb250ZWxsb0dlbmVyYXRlZCBieSBzdmcydHRmIGZyb20gRm9udGVsbG8gcHJvamVjdC5odHRwOi8vZm9udGVsbG8uY29tAEMAbwBwAHkAcgBpAGcAaAB0ACAAKABDACkAIAAyADAAMQA0ACAAYgB5ACAAbwByAGkAZwBpAG4AYQBsACAAYQB1AHQAaABvAHIAcwAgAEAAIABmAG8AbgB0AGUAbABsAG8ALgBjAG8AbQBmAG8AbgB0AGUAbABsAG8AUgBlAGcAdQBsAGEAcgBmAG8AbgB0AGUAbABsAG8AZgBvAG4AdABlAGwAbABvAFYAZQByAHMAaQBvAG4AIAAxAC4AMABmAG8AbgB0AGUAbABsAG8ARwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABzAHYAZwAyAHQAdABmACAAZgByAG8AbQAgAEYAbwBuAHQAZQBsAGwAbwAgAHAAcgBvAGoAZQBjAHQALgBoAHQAdABwADoALwAvAGYAbwBuAHQAZQBsAGwAbwAuAGMAbwBtAAAAAAIAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEwAAAQIBAwEEAQUBBgEHAQgBCQEKAQsBDAENAQ4BDwEQAREBEgETBGJvbGQGaXRhbGljCXVuZGVybGluZQZzdHJpa2UEbGluawdwaWN0dXJlDWxpc3QtbnVtYmVyZWQLbGlzdC1idWxsZXQMaW5kZW50LXJpZ2h0C2luZGVudC1sZWZ0CmFsaWduLWxlZnQLYWxpZ24tcmlnaHQMYWxpZ24tY2VudGVyDWFsaWduLWp1c3RpZnkLc3VwZXJzY3JpcHQJc3Vic2NyaXB0BXVzZXJzBHNvcnQAAAAAAAEAAf//AA8AAAAAAAAAAAAAAAAAAAAAADIAMgNS/2oDUv9qsAAssCBgZi2wASwgZCCwwFCwBCZasARFW1ghIyEbilggsFBQWCGwQFkbILA4UFghsDhZWSCwCkVhZLAoUFghsApFILAwUFghsDBZGyCwwFBYIGYgiophILAKUFhgGyCwIFBYIbAKYBsgsDZQWCGwNmAbYFlZWRuwACtZWSOwAFBYZVlZLbACLCBFILAEJWFkILAFQ1BYsAUjQrAGI0IbISFZsAFgLbADLCMhIyEgZLEFYkIgsAYjQrIKAAIqISCwBkMgiiCKsAArsTAFJYpRWGBQG2FSWVgjWSEgsEBTWLAAKxshsEBZI7AAUFhlWS2wBCywB0MrsgACAENgQi2wBSywByNCIyCwACNCYbCAYrABYLAEKi2wBiwgIEUgsAJFY7ABRWJgRLABYC2wBywgIEUgsAArI7ECBCVgIEWKI2EgZCCwIFBYIbAAG7AwUFiwIBuwQFlZI7AAUFhlWbADJSNhRESwAWAtsAgssQUFRbABYUQtsAkssAFgICCwCUNKsABQWCCwCSNCWbAKQ0qwAFJYILAKI0JZLbAKLCC4BABiILgEAGOKI2GwC0NgIIpgILALI0IjLbALLEtUWLEHAURZJLANZSN4LbAMLEtRWEtTWLEHAURZGyFZJLATZSN4LbANLLEADENVWLEMDEOwAWFCsAorWbAAQ7ACJUKxCQIlQrEKAiVCsAEWIyCwAyVQWLEBAENgsAQlQoqKIIojYbAJKiEjsAFhIIojYbAJKiEbsQEAQ2CwAiVCsAIlYbAJKiFZsAlDR7AKQ0dgsIBiILACRWOwAUViYLEAABMjRLABQ7AAPrIBAQFDYEItsA4ssQAFRVRYALAMI0IgYLABYbUNDQEACwBCQopgsQ0FK7BtKxsiWS2wDyyxAA4rLbAQLLEBDistsBEssQIOKy2wEiyxAw4rLbATLLEEDistsBQssQUOKy2wFSyxBg4rLbAWLLEHDistsBcssQgOKy2wGCyxCQ4rLbAZLLAIK7EABUVUWACwDCNCIGCwAWG1DQ0BAAsAQkKKYLENBSuwbSsbIlktsBossQAZKy2wGyyxARkrLbAcLLECGSstsB0ssQMZKy2wHiyxBBkrLbAfLLEFGSstsCAssQYZKy2wISyxBxkrLbAiLLEIGSstsCMssQkZKy2wJCwgPLABYC2wJSwgYLANYCBDI7ABYEOwAiVhsAFgsCQqIS2wJiywJSuwJSotsCcsICBHICCwAkVjsAFFYmAjYTgjIIpVWCBHICCwAkVjsAFFYmAjYTgbIVktsCgssQAFRVRYALABFrAnKrABFTAbIlktsCkssAgrsQAFRVRYALABFrAnKrABFTAbIlktsCosIDWwAWAtsCssALADRWOwAUVisAArsAJFY7ABRWKwACuwABa0AAAAAABEPiM4sSoBFSotsCwsIDwgRyCwAkVjsAFFYmCwAENhOC2wLSwuFzwtsC4sIDwgRyCwAkVjsAFFYmCwAENhsAFDYzgtsC8ssQIAFiUgLiBHsAAjQrACJUmKikcjRyNhIFhiGyFZsAEjQrIuAQEVFCotsDAssAAWsAQlsAQlRyNHI2GwBkUrZYouIyAgPIo4LbAxLLAAFrAEJbAEJSAuRyNHI2EgsAQjQrAGRSsgsGBQWCCwQFFYswIgAyAbswImAxpZQkIjILAIQyCKI0cjRyNhI0ZgsARDsIBiYCCwACsgiophILACQ2BkI7ADQ2FkUFiwAkNhG7ADQ2BZsAMlsIBiYSMgILAEJiNGYTgbI7AIQ0awAiWwCENHI0cjYWAgsARDsIBiYCMgsAArI7AEQ2CwACuwBSVhsAUlsIBisAQmYSCwBCVgZCOwAyVgZFBYIRsjIVkjICCwBCYjRmE4WS2wMiywABYgICCwBSYgLkcjRyNhIzw4LbAzLLAAFiCwCCNCICAgRiNHsAArI2E4LbA0LLAAFrADJbACJUcjRyNhsABUWC4gPCMhG7ACJbACJUcjRyNhILAFJbAEJUcjRyNhsAYlsAUlSbACJWGwAUVjIyBYYhshWWOwAUViYCMuIyAgPIo4IyFZLbA1LLAAFiCwCEMgLkcjRyNhIGCwIGBmsIBiIyAgPIo4LbA2LCMgLkawAiVGUlggPFkusSYBFCstsDcsIyAuRrACJUZQWCA8WS6xJgEUKy2wOCwjIC5GsAIlRlJYIDxZIyAuRrACJUZQWCA8WS6xJgEUKy2wOSywMCsjIC5GsAIlRlJYIDxZLrEmARQrLbA6LLAxK4ogIDywBCNCijgjIC5GsAIlRlJYIDxZLrEmARQrsARDLrAmKy2wOyywABawBCWwBCYgLkcjRyNhsAZFKyMgPCAuIzixJgEUKy2wPCyxCAQlQrAAFrAEJbAEJSAuRyNHI2EgsAQjQrAGRSsgsGBQWCCwQFFYswIgAyAbswImAxpZQkIjIEewBEOwgGJgILAAKyCKimEgsAJDYGQjsANDYWRQWLACQ2EbsANDYFmwAyWwgGJhsAIlRmE4IyA8IzgbISAgRiNHsAArI2E4IVmxJgEUKy2wPSywMCsusSYBFCstsD4ssDErISMgIDywBCNCIzixJgEUK7AEQy6wJistsD8ssAAVIEewACNCsgABARUUEy6wLCotsEAssAAVIEewACNCsgABARUUEy6wLCotsEEssQABFBOwLSotsEIssC8qLbBDLLAAFkUjIC4gRoojYTixJgEUKy2wRCywCCNCsEMrLbBFLLIAADwrLbBGLLIAATwrLbBHLLIBADwrLbBILLIBATwrLbBJLLIAAD0rLbBKLLIAAT0rLbBLLLIBAD0rLbBMLLIBAT0rLbBNLLIAADkrLbBOLLIAATkrLbBPLLIBADkrLbBQLLIBATkrLbBRLLIAADsrLbBSLLIAATsrLbBTLLIBADsrLbBULLIBATsrLbBVLLIAAD4rLbBWLLIAAT4rLbBXLLIBAD4rLbBYLLIBAT4rLbBZLLIAADorLbBaLLIAATorLbBbLLIBADorLbBcLLIBATorLbBdLLAyKy6xJgEUKy2wXiywMiuwNistsF8ssDIrsDcrLbBgLLAAFrAyK7A4Ky2wYSywMysusSYBFCstsGIssDMrsDYrLbBjLLAzK7A3Ky2wZCywMyuwOCstsGUssDQrLrEmARQrLbBmLLA0K7A2Ky2wZyywNCuwNystsGgssDQrsDgrLbBpLLA1Ky6xJgEUKy2waiywNSuwNistsGsssDUrsDcrLbBsLLA1K7A4Ky2wbSwrsAhlsAMkUHiwARUwLQAAAEu4AMhSWLEBAY5ZuQgACABjILABI0SwAyNwsgQoCUVSRLIKAgcqsQYBRLEkAYhRWLBAiFixBgNEsSYBiFFYuAQAiFixBgFEWVlZWbgB/4WwBI2xBQBEAAA=") format('embedded-opentype'), url("data:application/font-woff;base64,d09GRgABAAAAABg0AA4AAAAAKygAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABRAAAAEQAAABWPilJPmNtYXAAAAGIAAAAOgAAAUrQJBm2Y3Z0IAAAAcQAAAAUAAAAHAbX/wZmcGdtAAAB2AAABPkAAAmRigp4O2dhc3AAAAbUAAAACAAAAAgAAAAQZ2x5ZgAABtwAAA4aAAAZylIzm+9oZWFkAAAU+AAAADYAAAA2Al90+WhoZWEAABUwAAAAIAAAACQH3wOraG10eAAAFVAAAAAnAAAATESgAABsb2NhAAAVeAAAACgAAAAoP1RESW1heHAAABWgAAAAIAAAACABkgpObmFtZQAAFcAAAAF3AAACzcydGhxwb3N0AAAXOAAAAKMAAAD6CYr87nByZXAAABfcAAAAVgAAAFaSoZr/eJxjYGSeyziBgZWBg6mKaQ8DA0MPhGZ8wGDIyMTAwMTAysyAFQSkuaYwOLxgfCHEHPQ/iyGKOYhhGlCYESQHAPXgC+V4nGNgYGBmgGAZBkYGEHAB8hjBfBYGDSDNBqQZGZgYGF4I/f8PUvCCEURLMEDVAwEjG8OIBwB31wbAAAB4nGNgQANGDEbMQf+zQBgAEdAD4XicnVXZdtNWFJU8ZHASOmSgoA7X3DhQ68qEKRgwaSrFdiEdHAitBB2kDHTkncc+62uOQrtWH/m07n09JLR0rbYsls++R1tn2DrnRhwjKn0aiGvUoZKXA6msPZZK90lc13Uvj5UMBnFdthJPSZuonSRKat3sUC7xWOsqWSdYJ+PlIFZPVZ5noAziFB5lSUQbRBuplyZJ4onjJ4kWZxAfJUkgJaMQp9LIUEI1GsRS1aFM6dCr1xNx00DKRqMedVhU90PFJ8c1p9SsA0YqVznCFevVRr4bpwMve5DEOsGzrYcxHnisfpQqkIqR6cg/dkpOlIaBVHHUoVbi6DCTX/eRTCrNQKaMYkWl7oG43f102xYxPXQ6vi5KlUaqurnOKJrt0fGogygP2cbppNzQ2fbw5RlTVKtdcbPtQGYNXErJbHSfRAAdJlLj6QFONZwCqRn1R8XZ588BEslclKo8VTKHegOZMzt7cTHtbiersnCknwcyb3Z2452HQ6dXh3/R+hdM4cxHj+Jifj5C+lBqfiJOJKVGWMzyp4YfcVcgQrkxiAsXyuBThDl0RdrZZl3jtTH2hs/5SqlhPQna6KP4fgr9TiQrHGdRo/VInM1j13Wt3GdQS7W7Fzsyr0OVIu7vCwuuM+eEYZ4WC1VfnvneBTT/Bohn/EDeNIVL+5YpSrRvm6JMu2iKCu0SVKVdNsUU7YoppmnPmmKG9h1TzNKeMzLj/8vc55H7HN7xkJv2XeSmfQ+5ad9HbtoPkJtWITdtHblpLyA3rUZu2lWjOnYEGgZpF1IVQdA0svph3Fab9UDWjDR8aWDyLmLI+upER521tcofxX914gsHcmmip7siF5viLq/bFj483e6rj5pG3bDV+MaR8jAeRnocmtBZ+c3hv+1N3S6a7jKqMugBFUwKwABl7UAC0zrbCaT1mqf48gdgXIZ4zkpDtVSfO4am7+V5X/exOfG+x+3GLrdcd3kJWdYNcmP28N9SZKrrH+UtrVQnR6wrJ49VaxhDKrwour6SlHu0tRu/KKmy8l6U1srnk5CbPYMbQlu27mGwI0xpyiUeXlOlKD3UUo6yQyxvKco84JSLC1qGxLgOdQ9qa8TpoXoYGwshhqG0vRBwSCldFd+0ynfxHqtr2Oj4xRXh6XpyEhGf4ir7UfBU10b96A7avGbdMoMpVaqn+4xPsa/b9lFZaaSOsxe3VAfXNOsaORXTT+Rr4HRvOGjdAz1UfDRBI1U1x+jGKGM0ljXl3wR0MVZ+w2jVYvs93E+dpFWsuUuY7JsT9+C0u/0q+7WcW0bW/dcGvW3kip8jMb8tCvw7B2K3ZA3UO5OBGAvIWdAYxhYmdxiug23EbfY/Jqf/34aFRXJXOxq7eerD1ZNRJXfZ8rjLTXZZ16M2R9VOGvsIjS0PN+bY4XIstsRgQbb+wf8x7gF3aVEC4NDIZZiI2nShnurh6h6rsW04VxIBds2x43QAegAuQd8cu9bzCYD13CPnLsB9cgh2yCH4lByCz8i5BfA5OQRfkEMwIIdgl5w7AA/IIXhIDsEeOQSPyNkE+JIcgq/IIYjJIUjIuQ3wmByCJ+QQfE0OwTdGrk5k/pYH2QD6zqKbQKmdGhzaOGRGrk3Y+zxY9oFFZB9aROqRkesT6lMeLPV7i0j9wSJSfzRyY0L9iQdL/dkiUn+xiNRnxpeZIymvDp7zjg7+BJfqrV4AAAAAAQAB//8AD3ictVlbbBzXeT7/OXOf3ZnZ3bksyeVy70vxssu986blcrkUJVEiJVKWtKQuNOLIVOS4gCUkjhs7RWTELYJW8YOLNAgQq0DTAgUK2y3y4D60D+ktBZoird2++qVN0NYt2gRoBYnqf2ZXMp1IthQn3MWZPXNu83///33nP0PCCLn7JgszjVgkRc6Si61zQyCw0nCIUeEwAA0AgQxIRGw3gMEiERhlwo4CsiRfISJhgsi2CSVAKGwTIklkneBlk0hEWkmn02fTZ89szk/Xq5l8LqlGxrNupdyEar4A6ZTsyJ7N8Ea9Vs1h1fZcBwto1HufGsvlq/jJ5XNFWIBK2XO9OPVsCdeOg2PjxcDnKEJOlqA+ljlyYdxLbp8/YAKFaPbJpy5eHJ6gDGDvBzAQHB9UqQiUSZIeCxXpqz85VZqJxhNlFzJp49CnLlmBWHbjcGHx2eLnIxAurL+UrWakE0/+tgqvCoe7zVPyQLhzthGN7Fk1kUq6GcweBufGRilARRlALjDFlE2r2sqMtgYDI97njowV0yOjo0EVn0Dm+CDOdI7pZJkcbi1HEdmGHWEEaDsJtEWALRACIhBxl4gMRHZJAMYuI6pA1wmlsIldYWVpceHg3GxiwHNCkjXuNMoI0wKrL9C6vMBqCFS+4SGgC1BvSCZwoPyPKUieOwJ4KyVL6RTCiVeNbrqWbI7IoqgGKITUgODNWKL2phvJbuQiuLA8Es/YsizSgUDKicpAM/EsMFFjQU10Vp71jo6tTbm6k157LTPg5sZlOJtejTlBhHxWAREfXddjuqSqoUTU/ZW5Pzp7fUDQVSZZlgcgKCAJBCOHx18XcTlHnoGXVt9QT5xthSomFcCilAiT6EHC2kOrb2g/20D9Bh0bjIqFLQT87rQ99IAput1ub/ZJosqarO4QTbtMcIywLgIoEu8EZJswWWbrhDF5k8hMXumvXCFEwMl2HjIWnUwfNJQ/2+i+MX5vAZ/0IUuFH//5WoVef2330QYgDt2WfWX3UzvntjdOLDQb1fLUWPotS4+MRzAwOMsqZaRfuSF7GCuy5IyAi8zr3e0Rs1oAZF0+Z0K+UfFcjDmfjfgZBpv37VMznSpAPncQOIeBkzyZ4j3cSrJcH3IE6qaGj4anCouhkRBAMpPUZVDYgJ0qlWZLI9EhzcaYVATKtEh0WoHic+NLGqMD7gGG4aWwgGI6m/MHT55/eSmoqkaHNTXl9t8qmqawmqLRdwFKFJ2GWBwQDbl985vL48nIoKWFbWskceDMxPSJUjIbsDHQpySqUEcWgjJITDVMXdJ/8NmDY4OZxVCkempp4uzblw0bbr+f4ZPzgvR084cYtyYpYexeaG2nUDehrWGJqkiQxiCDKO8SGcVSuYSRztCSbRU4zwmKpSJJyjpRFC6WirRiWUBOnzp+rNWslK2SVRrNRV1VIiYYujkOZRdxkxA/jma90kDwa3jlkuhy9NETeCudkhzbv+PJlfs+4X7w3cUdUWvUGl4cUEi5ENfQM+xdbtXteb+0gkOvvRprZ5r4cEyux+KlTmv16Odzs0n75X8RvOCQfWDiwGSnNbmWUDDKZkKqJNilzmjmicpkBC4gOrKmyQhRJjJQr3z6hi7bzmQnpZlU3BypLJYOHEvpA1bwhjvcnInHIoNDWiDoKbIoK/NDOXsARh1bTIxGhzu54qiFOwnH+W32dXaExMgM2SK/0xqcBlV8YhmJHdEpyKx9apyqHYnKdLFH1SkUUFUQd4ivu8hYQmQVeSAQGQT5HDpCotIZJISyiehrrDPUKvMhTFR3+RjUud2PH9RtBc+c9rzBUS86MGpr0fFsFTFOyYjtCHpKTnGKSDZyh6sx+I1m/0YjX6DoPa/M+9YBnSdxB1Ub+d4VB5Sxny17/pVNmNesguWyANCEqxiG4Easq+aktWHuPW9etSasDcu6ZhZCHtOEuKcaBvPC8OOpjcIrhauFUmnqleK1YnGj+JXic8V+7Q89nDLsMksy8YEFTXBDBfOaaZ604FuuddUyN8wJnBJnNAzVTWAP5oX2fmupcLI4dbX4ylSphJN8pbBRKF4r/HqvhgJ59+7dN4UickJBVoyQIjnSOoT0YibmEEYwoAqUxADVr41wCoQKu5glMGTcNt8eKdcqQRSFdSII4iYRBXGlNlPLRiJh2R0H20Bg6rhdO0kMYMiiksihnpLkQ9WcF0LMkR2NULXeSGK3Tze3mvil87fff2sLhiF++7qsQUBiL8oB0E5Ws7evZ9AtWfZitkpDk03aPt1q7e3duvLHXRi+qSl3tjgf6LflQOTOVrYK9Qz9Nr/w7AZj8jPsR+w42niQHCfnyWfJi3S4NbUFptUFx3wWDGcKSX+hOIbS1YxRJg4bVBcklBrc4kFtexHcMTBeAxivl4hpOZbp7LqgRcKqtoM5lo45FqE6MLpDHCPorHshigoUVIzgOURXjijyNomQsBoJb2OsSqIqbfm52HoAxUWnor5NLEtbIgBkEx9ZJx3cXbK42tMfsRryafcXuNwYLrf7oeUiWnj3l7Ve6/JDltJ3f9Fr8R10cm0tkfjiF64998zlp55cO792/tz2mdMbJ0+sHzvSWUwcTBycn8sMuaFwPpJORaPjPGtN5Ru9ZFfO13mGVktJeSddqziYzUacNAp6kzWqOTkl55u4D6N+G1Su1ERnn/Dz0OZjatVGLS3JuP06P93OnB4V7tXfaU7MZ0ZiCSs6ZwhGVNPUjDr3di2Wgu8JsdSoy8LBAbsYrCdGp3OFHKyw4/uj//Z//Ok8gOiNHptja/sbYH+lPlmGbGnAstLCiBQeCSqYrMafKC1KY9Du2tpwIR6NBg0LEslYojAaKwzGzdRbV/hoLALwX9PTnYIja/bYynv//AzfQXgB7hWfsrwf6fPuH9mP6L+i20IkScbILDlKtlpn5kDTx0FRw4Bua6OHNEnXtolMJCZL3KkKVRVMhFBjGKZpfPtdx7OLgBqz3XcrkJUjhxYXZuq1iJ3LRexIOBAdb9hSAapNcGu2lOqrjy3l+9j6MrO/4aOc8G5PjnpfFv4wwg+6+yF4WxMtOn9unrb+e9KfYu/frvg9fHwouXfzIciJqMv/i3qlE4PESYE0yRo52VpbWaCK2ihSCfIjMiOiZ2Iai9qMcAHChacaJAMgfqIAhIk8k8QOPJOkmwST75Xjq7VaDv9wz8b9L+JvY74A803rHlKNWg+p/L6616/L/XqlX0/v6/9d8XXRRBstvLIMz098i9l3e9Dc9C/04gNq+3t+WRFvipoCi4qG8+z9+z7Y/v7ebyz/7gO4vt+LSl7nMfcBdkEyTCZ9vT/ROn6oidjVC4hdLk6J6BqPCd2xoz3ocl6EQ4ebV+7exv+JkXtXM9Fo/JoaD6mfCzia2vszrOAkHH9t79jjAodHu7v/18+PeSawwHOBKTyRjiJHo3guYwp/a4CYIUtFzlLkI+N8vM9Swll6n52IF0cso3jj2T4A+X0A7a83+oDk9wGW79d9bv7QNW7vmDa4BnvdtN9xjTt1v0a/Z9pfw7bf77V1DfefbPPOi72264b71Ir/0y//et/vvzlsuK6BBdh/5Zcmv/EADDqtRY6BBX3z2aObn3uo+Y19UrPffF73+vX8vnj5KfOBm8+fn1sP3HpeYd1ey4u+OfS6aT+m8Q+MgU9g/8e7/2H25z/afnT/XoCbAD/uef993/6w7/y9b/gWwaXHdv4vhQMfHwQP40DjozkAj1x7TBioj8FZehf362Xy/VakDnqgBqKeBU1ImBQkob36RgwzxUMWGGIwaOwQSQNNwmwNmAbsEgkQXQzoKKqigucQUeiiFGtSUNsyVYrHQ3acXxk5iQcIRpaHWiv+RKIR3P1kM3VbI6kUIanl1HJnaXamPJVJoxHJkG2HwrwI4ZnPSfODdVqWTMCkrJHHgr8tqdQXaMVJyx6eVvhBvSnU/LwOE7Z6o+5ndgJmdvCTr3aDAqWiqJ7+2sqzTx/7xnFeBdFYu7H89HPw+t57wOJj1bF4yh0eUAJzpl14/tjgRKEQY18+ff43PVEO6MZXz//u1y98KSpKohT90oXXfg9+9appaen5TM7NhZwYOLJZtUOZ9vRINZWIpsKTPDapf4bpwvto0hL585ZVS5hMD1SBQQ60IOs7pUUkISBIAYRQZ3gc2UVsCXdSD0OJY4ioAqLKsUPgDEYQ1qC2QTRN1zAtX3zgFATd86hz3HPEUmqpvTgzXSr+HI4QnWQRfsYPnm2wR/DDzb33KP2wHyZfOAq56foEPNwPX7hqDu7zgmT1vJCdzSVyLneChLnFZ/C8vIHZbJnMkQ45TS6SP/jOusFRQA+E0AOzMk9XJXGH6Aro6wawIBCRkW0TaEBD/lDYtkBR1M0QqCoeUyRJOIUnaF1A7Of8wURECjz26G5r+ML5re7pJzZOrB49srLUXmjOzgw4kQONVDpphaPjKGRpVNVqpRyHRrkhOXb/DVW+2hTxJm0CP+WU44L3QZrMM+omdUVUo3Quj2ehvP8PAa+cv99ldWt2dbIFy8JYO5nLMnp9Y2kv2jkBQsBK5GaTUqZw+MShgQOWnJ7OJSwD7vzlqc+dwi/8xktv/Br94p+8AEvNwurM1iTLZpOdUWF5pd9+gXUmJv7CHYSgY63tbbfX1trx6fZ0NedGY4PUtQY16uaq0+0YvTHHB5za+8/uS/SF7zwvvfwP4wXosMU1ywlGo9Bv9nmEPnyHzuOZxMD8MN/KINwA7YcpuFPN2UJkPHv/lU9vB/NxK0D/vQ+d027pMf2WzvckX0r3AqZNA7e0uHZL+x8TW3X8zQUYJZZ3xOr/A2X8mIsAAAABAAAAAQAAL/STWF8PPPUACwPoAAAAAM+JNMwAAAAAz4j8jP///2oELwNSAAAACAACAAAAAAAAeJxjYGRgYA76n8UQxaLPwPD/H4sBA1AEBQgDAHG6BJJ4nGN+wcDALMjAwGQNpCOBGMRfwMDAog9l48OREAxSC9IPANK3C9oAAAAAAAC0AUACnANQBCYEmgZWBvIHkAgsCK4JLgmuCjAK/Au+DKAM5QABAAAAEwB+AAYAAAAAAAIAMAA9AG4AAADaCZEAAAAAeJx1kMtqwkAUhv/x0otCW1rotrMqSmm8YDeCIFh0026kuC0xxiQSMzIZBV+j79CH6Uv0WfqbjKUoTZjMd745c+ZkAFzjGwL588SRs8AZo5wLOEXPcpH+2XKJ/GK5jCreLJ/Qv1uu4AGB5Spu8MEKonTOaIFPywJX4tJyARfiznKR/tFyidyzXMateLV8Qu9ZrmAiUstV3IuvgVptdRSERtYGddlutjpyupWKKkrcWLprEyqdyr6cq8T4cawcTy33PPaDdezqfbifJ75OI5XIltPcq5Gf+No1/mxXPd0EbWPmcq7VUg5thlxptfA944TGrLqNxt/zMIDCCltoRLyqEAYSNdo65zaaaKFDmjJDMjPPipDARUzjYs0dYbaSMu5zzBkltD4zYrIDj9/lkR+TAu6PWUUfrR7GE9LujCjzkn057O4wa0RKskw3s7Pf3lNseFqb1nDXrkuddSUxPKgheR+7tQWNR+9kt2Jou2jw/ef/fgDdX4RLAHicbYxLEoIwEETTCigE/J6DQwmMOhojNZksvL0p4tJevdfVM2ZlchrzP2djsMIaBUpU2GCLGg0sWnTYYY8DjjjhXAxvN1WsF8djHf1E4thTFVT4SUXi52bmUaNQ5zho7+NrIKHJLjZE50hbTndee+HbXe1PHF21SV9vfkGbcZm0mcc0I+myPGJQvn5siDNJGIVnrUMcMpUxpLIIb1FjvoAxQk4AS7gAyFJYsQEBjlm5CAAIAGMgsAEjRLADI3CyBCgJRVJEsgoCByqxBgFEsSQBiFFYsECIWLEGA0SxJgGIUVi4BACIWLEGAURZWVlZuAH/hbAEjbEFAEQAAA==") format('woff');
}
.ql-toolbar-container {
box-sizing: border-box;
padding: 8px 8px 7px 8px;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
.ql-toolbar-container .ql-format-group {
display: inline-block;
margin-right: 15px;
vertical-align: middle;
}
.ql-toolbar-container .ql-format-separator {
box-sizing: border-box;
background-color: #ddd;
display: inline-block;
height: 18px;
margin-left: 4px;
margin-right: 4px;
vertical-align: middle;
width: 1px;
}
.ql-toolbar-container .ql-format-button {
box-sizing: border-box;
display: inline-block;
height: 24px;
line-height: 24px;
vertical-align: middle;
background-position: center center;
background-repeat: no-repeat;
box-sizing: border-box;
cursor: pointer;
font-family: 'quill-snow';
font-size: 12px;
margin-top: 1px;
text-align: center;
width: 24px;
}
.ql-toolbar-container .ql-format-button:hover,
.ql-toolbar-container .ql-format-button.ql-active,
.ql-toolbar-container .ql-format-button.ql-on {
color: #06c;
}
.ql-toolbar-container .ql-format-button.ql-bold:before {
content: "\e801";
}
.ql-toolbar-container .ql-format-button.ql-italic:before {
content: "\e802";
}
.ql-toolbar-container .ql-format-button.ql-underline:before {
content: "\e803";
}
.ql-toolbar-container .ql-format-button.ql-strike:before {
content: "\e804";
}
.ql-toolbar-container .ql-format-button.ql-link:before {
content: "\e805";
}
.ql-toolbar-container .ql-format-button.ql-image:before {
content: "\e806";
}
.ql-toolbar-container .ql-format-button.ql-list:before {
content: "\e807";
}
.ql-toolbar-container .ql-format-button.ql-bullet:before {
content: "\e808";
}
.ql-toolbar-container .ql-format-button.ql-indent:before {
content: "\e809";
}
.ql-toolbar-container .ql-format-button.ql-outdent:before {
content: "\e80A";
}
.ql-toolbar-container .ql-format-button.ql-superscript:before {
content: "\e80F";
}
.ql-toolbar-container .ql-format-button.ql-subscript:before {
content: "\e810";
}
.ql-toolbar-container .ql-format-button.ql-authorship:before {
content: "\e811";
}
/* Fix for iOS not losing hover state after click */
.ql-toolbar-container.ios .ql-format-button:hover {
color: inherit;
}
.ql-toolbar-container.ios .ql-format-button.ql-active,
.ql-toolbar-container.ios .ql-format-button.ql-on {
color: #06c;
}
.ql-picker {
box-sizing: border-box;
font-size: 13px;
display: inline-block;
font-family: 'Helvetica', 'Arial', sans-serif;
font-weight: bold;
position: relative;
}
.ql-picker .ql-picker-label {
box-sizing: border-box;
display: inline-block;
height: 24px;
line-height: 24px;
vertical-align: middle;
background-color: #fff;
border: 1px solid transparent;
cursor: pointer;
padding-left: 8px;
padding-right: 8px;
position: relative;
width: 100%;
}
.ql-picker .ql-picker-label:after {
content: "\e812";
float: right;
font-family: 'quill-snow';
font-size: 12px;
margin-left: 8px;
}
.ql-picker .ql-picker-label.ql-active,
.ql-picker .ql-picker-label:hover {
color: #06c;
}
.ql-picker .ql-picker-options {
background-color: #fff;
border: 1px solid transparent;
box-sizing: border-box;
display: none;
padding: 4px 8px;
position: absolute;
width: 100%;
}
.ql-picker .ql-picker-options .ql-picker-item {
box-sizing: border-box;
cursor: pointer;
display: block;
padding-bottom: 6px;
padding-top: 6px;
}
.ql-picker .ql-picker-options .ql-picker-item.selected,
.ql-picker .ql-picker-options .ql-picker-item:hover {
color: #06c;
}
.ql-picker.ql-expanded .ql-picker-label {
border-color: #ccc;
color: #ccc;
z-index: 2;
}
.ql-picker.ql-expanded .ql-picker-options {
border-color: #ccc;
box-shadow: rgba(0,0,0,0.2) 0 2px 8px;
display: block;
margin-top: -1px;
z-index: 1;
}
.ql-picker.ql-font {
width: 105px;
}
.ql-picker.ql-size {
width: 80px;
}
.ql-picker.ql-align {
font-family: 'quill-snow';
}
.ql-picker.ql-align .ql-picker-label {
margin-top: 1px;
}
.ql-picker.ql-align .ql-picker-label:after {
content: normal;
}
.ql-picker.ql-align .ql-picker-options {
width: 32px;
}
.ql-picker.ql-align .ql-picker-label[data-value=left]:before,
.ql-picker.ql-align .ql-picker-item[data-value=left]:before {
content: "\e80B";
}
.ql-picker.ql-align .ql-picker-label[data-value=right]:before,
.ql-picker.ql-align .ql-picker-item[data-value=right]:before {
content: "\e80C";
}
.ql-picker.ql-align .ql-picker-label[data-value=center]:before,
.ql-picker.ql-align .ql-picker-item[data-value=center]:before {
content: "\e80D";
}
.ql-picker.ql-align .ql-picker-label[data-value=justify]:before,
.ql-picker.ql-align .ql-picker-item[data-value=justify]:before {
content: "\e80E";
}
.ql-picker.ql-color-picker {
width: 32px;
}
.ql-picker.ql-color-picker .ql-picker-label {
background-position: center center;
background-repeat: no-repeat;
}
.ql-picker.ql-color-picker .ql-picker-label:after {
content: normal;
}
.ql-picker.ql-color-picker .ql-picker-options {
padding: 6px;
width: 154px;
}
.ql-picker.ql-color-picker .ql-picker-options .ql-picker-item {
border: 1px solid transparent;
float: left;
height: 16px;
margin: 2px;
padding: 0px;
width: 16px;
}
.ql-picker.ql-color-picker .ql-picker-options .ql-picker-item.ql-primary-color {
margin-bottom: 8px;
}
.ql-picker.ql-color-picker .ql-picker-options .ql-picker-item.selected,
.ql-picker.ql-color-picker .ql-picker-options .ql-picker-item:hover {
border-color: #000;
}
.ql-picker.ql-color .ql-picker-label {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAPNJREFUeNqkkzFOw0AQRd9agpaWBiFRubA4ABRuIhoqy5IpqSi4gntzA0TtylY6+wRJgaIcYE/ALRLJnyITQ0IU4fhLXzv7Z/RnVrvrJDEGASPhnHPH8h+2vp4ywTWwAi4tHmwwAZbAmcWDDWJgYSbxUIMbYA1cAF/AlWl/DZqmOaQ/AiHwDrwA56btoCzLzQRFUeznHoBn4N74aVqPPM9/jhBFEZK2nEq6lfRm+ztJT6ZNt3VhGG7eQdu2AEiiqirquu67ZFmG9x7vfa+laUqSJH3DHYPf7LruYLzPAJgBOpGz4Ngd/wNxAMxHGMzd2O/8PQB/SZTPHTSGPwAAAABJRU5ErkJggg==");
}
.ql-picker.ql-color .ql-picker-label.ql-active,
.ql-picker.ql-color .ql-picker-label:hover,
.ql-picker.ql-color.ql-expanded .ql-picker-label {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAJdJREFUeNqskyEOAjEQRd9NCIQDoDkKioTkuz0CF8ChUBgkBgGeNVziO05SBCM2JGxaBvHSmd/OS9OklFLIQFqAPMYh+H5mZHOCvEe+RN0s2CCvkG9RNwtOyFPkbdRNghnyEXmBvEa+R1Yt6JAfH3QtgivyfNDvIqsSnJGfsYK8jH6YVT1iHf8Q9MjlR3oSw2/SN8j+xtcA4sDVwxxfMTsAAAAASUVORK5CYII=");
}
.ql-picker.ql-background .ql-picker-label {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA/klEQVQ4T6WPvWoCQRSF3V4rxZ81AX/aFEJsBJs8hG5EkYQQm0Cq1HZ5BLHRztZSSCVY+lTrOcOZ5e5GRHHgm3vunTMHbi6O49w9uCsIgjIYglv0iw2INCRXaxvgU1+N6UlzQu3n3pNaoQJGqmSgjytxzjOyAWPz4HUDLMBOupf1ZFfgw0SV/Uz9n/Q/jw2ogqlqUeYNaIK5NGdcgR7ntwFv5qEPWmANOnrba5aXx/mzK9TAOyiBL3DIwFlBHoakVuDnD1X2W9CWJr+aea/z24BP83kJjqrsn9XbmfOnVsAJUbsyXIKekB+SAJwH8A3qt2gbEIFHCpyfa3UScA8nZ0rfoKKU4c8AAAAASUVORK5CYII=");
}
.ql-picker.ql-background .ql-picker-label.ql-active,
.ql-picker.ql-background .ql-picker-label:hover,
.ql-picker.ql-background.ql-expanded .ql-picker-label {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA+ElEQVQ4y2P4//8/AyUYQqTdEgPiMBLZjsgGhEMFxUhhww1AMjUCSZEOkpwOkngETDOyC8SBOBJKg3AoVHwOCONQE4lsQDSSBIytAMRTgXgrlG2JrgbdCyCJGLhE2q00KH8HiI1NDbILJIA4DkoLQ8WWALEiENeB2FCxSKgasHpkAxKQJGyAWAmI5wKxAVRuH1SMB6oGrB7dC5JAnAjEIkCcDcQH0TBIjBeqRgLdCyDNySAayl8LxMpIhreCxJDUgtUjG5CKpHk6EJ8E0VC+MZSPLIZQj2SLFBCbEEz7QDUgtehekAHiPCCWJoWNnhdkoewSktiUZmcAal4Wl39PVNwAAAAASUVORK5CYII=");
}
| idleberg/cdnjs | ajax/libs/quill/0.16.0/quill.snow.css | CSS | mit | 38,417 |
<?php
require_once 'Swift/Tests/SwiftUnitTestCase.php';
require_once 'Swift/Plugins/ReporterPlugin.php';
require_once 'Swift/Plugins/Reporter.php';
require_once 'Swift/Mime/Message.php';
require_once 'Swift/Events/SendEvent.php';
class Swift_Plugins_ReporterPluginTest extends Swift_Tests_SwiftUnitTestCase
{
public function testReportingPasses()
{
$message = $this->_createMessage();
$evt = $this->_createSendEvent();
$reporter = $this->_createReporter();
$this->_checking(Expectations::create()
-> allowing($message)->getTo() -> returns(array('foo@bar.tld' => 'Foo'))
-> allowing($evt)->getMessage() -> returns($message)
-> allowing($evt)->getFailedRecipients() -> returns(array())
-> one($reporter)->notify($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS)
-> ignoring($message)
-> ignoring($evt)
);
$plugin = new Swift_Plugins_ReporterPlugin($reporter);
$plugin->sendPerformed($evt);
}
public function testReportingFailedTo()
{
$message = $this->_createMessage();
$evt = $this->_createSendEvent();
$reporter = $this->_createReporter();
$this->_checking(Expectations::create()
-> allowing($message)->getTo() -> returns(array(
'foo@bar.tld' => 'Foo', 'zip@button' => 'Zip'
))
-> allowing($evt)->getMessage() -> returns($message)
-> allowing($evt)->getFailedRecipients() -> returns(array('zip@button'))
-> one($reporter)->notify($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS)
-> one($reporter)->notify($message, 'zip@button', Swift_Plugins_Reporter::RESULT_FAIL)
-> ignoring($message)
-> ignoring($evt)
);
$plugin = new Swift_Plugins_ReporterPlugin($reporter);
$plugin->sendPerformed($evt);
}
public function testReportingFailedCc()
{
$message = $this->_createMessage();
$evt = $this->_createSendEvent();
$reporter = $this->_createReporter();
$this->_checking(Expectations::create()
-> allowing($message)->getTo() -> returns(array(
'foo@bar.tld' => 'Foo'
))
-> allowing($message)->getCc() -> returns(array(
'zip@button' => 'Zip', 'test@test.com' => 'Test'
))
-> allowing($evt)->getMessage() -> returns($message)
-> allowing($evt)->getFailedRecipients() -> returns(array('zip@button'))
-> one($reporter)->notify($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS)
-> one($reporter)->notify($message, 'zip@button', Swift_Plugins_Reporter::RESULT_FAIL)
-> one($reporter)->notify($message, 'test@test.com', Swift_Plugins_Reporter::RESULT_PASS)
-> ignoring($message)
-> ignoring($evt)
);
$plugin = new Swift_Plugins_ReporterPlugin($reporter);
$plugin->sendPerformed($evt);
}
public function testReportingFailedBcc()
{
$message = $this->_createMessage();
$evt = $this->_createSendEvent();
$reporter = $this->_createReporter();
$this->_checking(Expectations::create()
-> allowing($message)->getTo() -> returns(array(
'foo@bar.tld' => 'Foo'
))
-> allowing($message)->getBcc() -> returns(array(
'zip@button' => 'Zip', 'test@test.com' => 'Test'
))
-> allowing($evt)->getMessage() -> returns($message)
-> allowing($evt)->getFailedRecipients() -> returns(array('zip@button'))
-> one($reporter)->notify($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS)
-> one($reporter)->notify($message, 'zip@button', Swift_Plugins_Reporter::RESULT_FAIL)
-> one($reporter)->notify($message, 'test@test.com', Swift_Plugins_Reporter::RESULT_PASS)
-> ignoring($message)
-> ignoring($evt)
);
$plugin = new Swift_Plugins_ReporterPlugin($reporter);
$plugin->sendPerformed($evt);
}
// -- Creation Methods
private function _createMessage()
{
return $this->_mock('Swift_Mime_Message');
}
private function _createSendEvent()
{
return $this->_mock('Swift_Events_SendEvent');
}
private function _createReporter()
{
return $this->_mock('Swift_Plugins_Reporter');
}
}
| AlexisChatillon/LO18_Secourut | vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ReporterPluginTest.php | PHP | mit | 4,577 |
(function(d,f,g,b){var e="tooltipster",c={animation:"fade",arrow:true,arrowColor:"",content:"",delay:200,fixedWidth:0,maxWidth:0,functionInit:function(m,n){n()},functionBefore:function(m,n){n()},functionReady:function(m,n){},functionAfter:function(m){},icon:"(?)",iconDesktop:false,iconTouch:false,iconTheme:".tooltipster-icon",interactive:false,interactiveTolerance:350,interactiveAutoClose:true,offsetX:0,offsetY:0,onlyOne:true,position:"top",speed:350,timer:0,theme:".tooltipster-default",touchDevices:true,trigger:"hover",updateAnimation:true};function j(n,m){this.element=n;this.options=d.extend({},c,m);this._defaults=c;this._name=e;this.init()}function k(){return !!("ontouchstart" in f)}function a(){var m=g.body||g.documentElement;var o=m.style;var q="transition";if(typeof o[q]=="string"){return true}v=["Moz","Webkit","Khtml","O","ms"],q=q.charAt(0).toUpperCase()+q.substr(1);for(var n=0;n<v.length;n++){if(typeof o[v[n]+q]=="string"){return true}}return false}var l=true;if(!a()){l=false}var h=k();d(f).on("mousemove.tooltipster",function(){h=false;d(f).off("mousemove.tooltipster")});j.prototype={init:function(){var p=d(this.element);var n=this;var o=true;if(!n.options.touchDevices&&h){o=false}if(g.all&&!g.querySelector){o=false}if(o){var m=d.trim(n.options.content).length>0?n.options.content:p.attr("title");p.data("tooltipsterContent",m);p.removeAttr("title");n.options.functionInit(p,function(){if((n.options.iconDesktop)&&(!h)||((n.options.iconTouch)&&(h))){var q=p.attr("title");p.removeAttr("title");var s=n.options.iconTheme;var r=d('<span class="'+s.replace(".","")+'" title="'+q+'">'+n.options.icon+"</span>");r.insertAfter(p);p.data("tooltipsterIcon",r);p=r}if((n.options.touchDevices)&&(h)&&((n.options.trigger=="click")||(n.options.trigger=="hover"))){p.bind("touchstart",function(u,t){n.showTooltip()})}else{if(n.options.trigger=="hover"){p.on("mouseenter.tooltipster",function(){n.showTooltip()});if(n.options.interactive){p.on("mouseleave.tooltipster",function(){var u=p.data("tooltipster");var w=false;if((u!==b)&&(u!=="")){u.mouseenter(function(){w=true});u.mouseleave(function(){w=false});var t=setTimeout(function(){if(w){if(n.options.interactiveAutoClose){u.find("select").on("change",function(){n.hideTooltip()});u.mouseleave(function(y){var x=d(y.target);if(x.parents(".tooltipster-base").length===0||x.hasClass("tooltipster-base")){n.hideTooltip()}else{x.on("mouseleave",function(z){n.hideTooltip()})}})}}else{n.hideTooltip()}},n.options.interactiveTolerance)}else{n.hideTooltip()}})}else{p.on("mouseleave.tooltipster",function(){n.hideTooltip()})}}if(n.options.trigger=="click"){p.on("click.tooltipster",function(){if((p.data("tooltipster")==="")||(p.data("tooltipster")===b)){n.showTooltip()}else{n.hideTooltip()}})}}})}},showTooltip:function(n){var o=d(this.element);var m=this;if(o.data("tooltipsterIcon")!==b){o=o.data("tooltipsterIcon")}if(!o.hasClass("tooltipster-disable")){if((d(".tooltipster-base").not(".tooltipster-dying").length>0)&&(m.options.onlyOne)){d(".tooltipster-base").not(".tooltipster-dying").not(o.data("tooltipster")).each(function(){d(this).addClass("tooltipster-kill");var p=d(this).data("origin");p.data("plugin_tooltipster").hideTooltip()})}o.clearQueue().delay(m.options.delay).queue(function(){m.options.functionBefore(o,function(){if((o.data("tooltipster")!==b)&&(o.data("tooltipster")!=="")){var y=o.data("tooltipster");if(!y.hasClass("tooltipster-kill")){var u="tooltipster-"+m.options.animation;y.removeClass("tooltipster-dying");if(l){y.clearQueue().addClass(u+"-show")}if(m.options.timer>0){var r=y.data("tooltipsterTimer");clearTimeout(r);r=setTimeout(function(){y.data("tooltipsterTimer",b);m.hideTooltip()},m.options.timer);y.data("tooltipsterTimer",r)}if((m.options.touchDevices)&&(h)){d("body").bind("touchstart",function(D){if(m.options.interactive){var F=d(D.target);var E=true;F.parents().each(function(){if(d(this).hasClass("tooltipster-base")){E=false}});if(E){m.hideTooltip();d("body").unbind("touchstart")}}else{m.hideTooltip();d("body").unbind("touchstart")}})}}}else{m.options._bodyOverflowX=d("body").css("overflow-x");d("body").css("overflow-x","hidden");var z=m.getContent(o);var x=m.options.theme;var A=x.replace(".","");var u="tooltipster-"+m.options.animation;var t="-webkit-transition-duration: "+m.options.speed+"ms; -webkit-animation-duration: "+m.options.speed+"ms; -moz-transition-duration: "+m.options.speed+"ms; -moz-animation-duration: "+m.options.speed+"ms; -o-transition-duration: "+m.options.speed+"ms; -o-animation-duration: "+m.options.speed+"ms; -ms-transition-duration: "+m.options.speed+"ms; -ms-animation-duration: "+m.options.speed+"ms; transition-duration: "+m.options.speed+"ms; animation-duration: "+m.options.speed+"ms;";var p=m.options.fixedWidth>0?"width:"+Math.round(m.options.fixedWidth)+"px;":"";var B=m.options.maxWidth>0?"max-width:"+Math.round(m.options.maxWidth)+"px;":"";var w=m.options.interactive?"pointer-events: auto;":"";var y=d('<div class="tooltipster-base '+A+" "+u+'" style="'+p+" "+B+" "+w+" "+t+'"></div>');var s=d('<div class="tooltipster-content"></div>');s.html(z);y.append(s);y.appendTo("body");o.data("tooltipster",y);y.data("origin",o);m.positionTooltip();m.options.functionReady(o,y);if(l){y.addClass(u+"-show")}else{y.css("display","none").removeClass(u).fadeIn(m.options.speed)}var C=z;var q=setInterval(function(){var D=m.getContent(o);if(d("body").find(o).length===0){y.addClass("tooltipster-dying");m.hideTooltip()}else{if((C!==D)&&(D!=="")){C=D;y.find(".tooltipster-content").html(D);if(m.options.updateAnimation){if(a()){y.css({width:"","-webkit-transition":"all "+m.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-moz-transition":"all "+m.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-o-transition":"all "+m.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-ms-transition":"all "+m.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms",transition:"all "+m.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms"}).addClass("tooltipster-content-changing");setTimeout(function(){y.removeClass("tooltipster-content-changing");setTimeout(function(){y.css({"-webkit-transition":m.options.speed+"ms","-moz-transition":m.options.speed+"ms","-o-transition":m.options.speed+"ms","-ms-transition":m.options.speed+"ms",transition:m.options.speed+"ms"})},m.options.speed)},m.options.speed)}else{y.fadeTo(m.options.speed,0.5,function(){y.fadeTo(m.options.speed,1)})}}m.positionTooltip()}}if((d("body").find(y).length===0)||(d("body").find(o).length===0)){clearInterval(q)}},200);if(m.options.timer>0){var r=setTimeout(function(){y.data("tooltipsterTimer",b);m.hideTooltip()},m.options.timer+m.options.speed);y.data("tooltipsterTimer",r)}if((m.options.touchDevices)&&(h)){d("body").bind("touchstart",function(D){if(m.options.interactive){var F=d(D.target);var E=true;F.parents().each(function(){if(d(this).hasClass("tooltipster-base")){E=false}});if(E){m.hideTooltip();d("body").unbind("touchstart")}}else{m.hideTooltip();d("body").unbind("touchstart")}})}}});o.dequeue()})}},hideTooltip:function(n){var q=d(this.element);var m=this;if(q.data("tooltipsterIcon")!==b){q=q.data("tooltipsterIcon")}var p=q.data("tooltipster");if(p===b){p=d(".tooltipster-dying")}q.clearQueue();if((p!==b)&&(p!=="")){var r=p.data("tooltipsterTimer");if(r!==b){clearTimeout(r)}var o="tooltipster-"+m.options.animation;if(l){p.clearQueue().removeClass(o+"-show").addClass("tooltipster-dying").delay(m.options.speed).queue(function(){p.remove();q.data("tooltipster","");d("body").css("overflow-x",m.options._bodyOverflowX);m.options.functionAfter(q)})}else{p.clearQueue().addClass("tooltipster-dying").fadeOut(m.options.speed,function(){p.remove();q.data("tooltipster","");d("body").css("overflow-x",m.options._bodyOverflowX);m.options.functionAfter(q)})}}},positionTooltip:function(P){var B=d(this.element);var ac=this;if(B.data("tooltipsterIcon")!==b){B=B.data("tooltipsterIcon")}if((B.data("tooltipster")!==b)&&(B.data("tooltipster")!=="")){var aj=B.data("tooltipster");aj.css("width","");var ak=d(f).width();var C=B.outerWidth(false);var ai=B.outerHeight(false);var an=aj.outerWidth(false);var n=aj.innerWidth()+1;var N=aj.outerHeight(false);var ab=B.offset();var aa=ab.top;var w=ab.left;var z=b;if(B.is("area")){var U=B.attr("shape");var ah=B.parent().attr("name");var Q=d('img[usemap="#'+ah+'"]');var o=Q.offset().left;var M=Q.offset().top;var X=B.attr("coords")!==b?B.attr("coords").split(","):b;if(U=="circle"){var O=parseInt(X[0]);var s=parseInt(X[1]);var E=parseInt(X[2]);ai=E*2;C=E*2;aa=M+s-E;w=o+O-E}else{if(U=="rect"){var O=parseInt(X[0]);var s=parseInt(X[1]);var r=parseInt(X[2]);var K=parseInt(X[3]);ai=K-s;C=r-O;aa=M+s;w=o+O}else{if(U=="poly"){var y=[];var ag=[];var I=0,H=0,ae=0,ad=0;var al="even";for(i=0;i<X.length;i++){var G=parseInt(X[i]);if(al=="even"){if(G>ae){ae=G;if(i===0){I=ae}}if(G<I){I=G}al="odd"}else{if(G>ad){ad=G;if(i==1){H=ad}}if(G<H){H=G}al="even"}}ai=ad-H;C=ae-I;aa=M+H;w=o+I}else{ai=Q.outerHeight(false);C=Q.outerWidth(false);aa=M;w=o}}}}if(ac.options.fixedWidth===0){aj.css({width:Math.round(n)+"px","padding-left":"0px","padding-right":"0px"})}var t=0,af=0,W=0;var Y=parseInt(ac.options.offsetY);var Z=parseInt(ac.options.offsetX);var q="";function x(){var ap=d(f).scrollLeft();if((t-ap)<0){var ao=t-ap;t=ap;aj.data("arrow-reposition",ao)}if(((t+an)-ap)>ak){var ao=t-((ak+ap)-an);t=(ak+ap)-an;aj.data("arrow-reposition",ao)}}function u(ap,ao){if(((aa-d(f).scrollTop()-N-Y-12)<0)&&(ao.indexOf("top")>-1)){ac.options.position=ap;z=ao}if(((aa+ai+N+12+Y)>(d(f).scrollTop()+d(f).height()))&&(ao.indexOf("bottom")>-1)){ac.options.position=ap;z=ao;W=(aa-N)-Y-12}}if(ac.options.position=="top"){var R=(w+an)-(w+C);t=(w+Z)-(R/2);W=(aa-N)-Y-12;x();u("bottom","top")}if(ac.options.position=="top-left"){t=w+Z;W=(aa-N)-Y-12;x();u("bottom-left","top-left")}if(ac.options.position=="top-right"){t=(w+C+Z)-an;W=(aa-N)-Y-12;x();u("bottom-right","top-right")}if(ac.options.position=="bottom"){var R=(w+an)-(w+C);t=w-(R/2)+Z;W=(aa+ai)+Y+12;x();u("top","bottom")}if(ac.options.position=="bottom-left"){t=w+Z;W=(aa+ai)+Y+12;x();u("top-left","bottom-left")}if(ac.options.position=="bottom-right"){t=(w+C+Z)-an;W=(aa+ai)+Y+12;x();u("top-right","bottom-right")}if(ac.options.position=="left"){t=w-Z-an-12;af=w+Z+C+12;var L=(aa+N)-(aa+B.outerHeight(false));W=aa-(L/2)-Y;if((t<0)&&((af+an)>ak)){var p=parseFloat(aj.css("border-width"))*2;var m=(an+t)-p;aj.css("width",m+"px");N=aj.outerHeight(false);t=w-Z-m-12-p;L=(aa+N)-(aa+B.outerHeight(false));W=aa-(L/2)-Y}else{if(t<0){t=w+Z+C+12;aj.data("arrow-reposition","left")}}}if(ac.options.position=="right"){t=w+Z+C+12;af=w-Z-an-12;var L=(aa+N)-(aa+B.outerHeight(false));W=aa-(L/2)-Y;if(((t+an)>ak)&&(af<0)){var p=parseFloat(aj.css("border-width"))*2;var m=(ak-t)-p;aj.css("width",m+"px");N=aj.outerHeight(false);L=(aa+N)-(aa+B.outerHeight(false));W=aa-(L/2)-Y}else{if((t+an)>ak){t=w-Z-an-12;aj.data("arrow-reposition","right")}}}if(ac.options.arrow){var J="tooltipster-arrow-"+ac.options.position;if(ac.options.arrowColor.length<1){var S=aj.css("background-color")}else{var S=ac.options.arrowColor}var am=aj.data("arrow-reposition");if(!am){am=""}else{if(am=="left"){J="tooltipster-arrow-right";am=""}else{if(am=="right"){J="tooltipster-arrow-left";am=""}else{am="left:"+Math.round(am)+"px;"}}}if((ac.options.position=="top")||(ac.options.position=="top-left")||(ac.options.position=="top-right")){var V=parseFloat(aj.css("border-bottom-width"));var A=aj.css("border-bottom-color")}else{if((ac.options.position=="bottom")||(ac.options.position=="bottom-left")||(ac.options.position=="bottom-right")){var V=parseFloat(aj.css("border-top-width"));var A=aj.css("border-top-color")}else{if(ac.options.position=="left"){var V=parseFloat(aj.css("border-right-width"));var A=aj.css("border-right-color")}else{if(ac.options.position=="right"){var V=parseFloat(aj.css("border-left-width"));var A=aj.css("border-left-color")}else{var V=parseFloat(aj.css("border-bottom-width"));var A=aj.css("border-bottom-color")}}}}if(V>1){V++}var F="";if(V!==0){var D="";var T="border-color: "+A+";";if(J.indexOf("bottom")!==-1){D="margin-top: -"+Math.round(V)+"px;"}else{if(J.indexOf("top")!==-1){D="margin-bottom: -"+Math.round(V)+"px;"}else{if(J.indexOf("left")!==-1){D="margin-right: -"+Math.round(V)+"px;"}else{if(J.indexOf("right")!==-1){D="margin-left: -"+Math.round(V)+"px;"}}}}F='<span class="tooltipster-arrow-border" style="'+D+" "+T+';"></span>'}aj.find(".tooltipster-arrow").remove();q='<div class="'+J+' tooltipster-arrow" style="'+am+'">'+F+'<span style="border-color:'+S+';"></span></div>';aj.append(q)}aj.css({top:Math.round(W)+"px",left:Math.round(t)+"px"});if(z!==b){ac.options.position=z}}},getContent:function(m){var n=m.data("tooltipsterContent");n=d(d.parseHTML("<div>"+n+"</div>")).html();return n}};d.fn[e]=function(o){if(o&&o==="setDefaults"){d.extend(c,arguments[1])}else{if(typeof o==="string"){var q=this;var m=arguments[1];var n=null;if(q.data("plugin_tooltipster")===b){var p=q.find("*");q=d();p.each(function(){if(d(this).data("plugin_tooltipster")!==b){q.push(d(this))}})}q.each(function(){switch(o.toLowerCase()){case"show":d(this).data("plugin_tooltipster").showTooltip();break;case"hide":d(this).data("plugin_tooltipster").hideTooltip();break;case"disable":d(this).addClass("tooltipster-disable");break;case"enable":d(this).removeClass("tooltipster-disable");break;case"destroy":d(this).data("plugin_tooltipster").hideTooltip();d(this).data("plugin_tooltipster","").attr("title",q.data("tooltipsterContent")).data("tooltipsterContent","").data("plugin_tooltipster","").off("mouseenter.tooltipster mouseleave.tooltipster click.tooltipster").unbind("touchstart");break;case"update":var r=m;if(d(this).data("tooltipsterIcon")===b){d(this).data("tooltipsterContent",r)}else{var s=d(this).data("tooltipsterIcon");s.data("tooltipsterContent",r)}break;case"reposition":d(this).data("plugin_tooltipster").positionTooltip();break;case"val":n=d(this).data("tooltipsterContent");return false}});return(n!==null)?n:this}else{return this.each(function(){if(!d.data(this,"plugin_"+e)){d.data(this,"plugin_"+e,new j(this,o))}var r=d(this).data("plugin_tooltipster").options;if((r.iconDesktop)&&(!h)||((r.iconTouch)&&(h))){var s=d(this).data("plugin_tooltipster");d(this).next().data("plugin_tooltipster",s)}})}}};if(h){f.addEventListener("orientationchange",function(){if(d(".tooltipster-base").length>0){d(".tooltipster-base").each(function(){var m=d(this).data("origin");m.data("plugin_tooltipster").hideTooltip()})}},false)}d(f).on("scroll.tooltipster",function(){var m=d(".tooltipster-base").data("origin");if(m){m.tooltipster("reposition")}});d(f).on("resize.tooltipster",function(){var m=d(".tooltipster-base").data("origin");if((m!==null)&&(m!==b)){m.tooltipster("reposition")}})})(jQuery,window,document); | francescoagati/cdnjs | ajax/libs/tooltipster/2.2.0/js/jquery.tooltipster.min.js | JavaScript | mit | 14,845 |
/*
* TableSorter 2.0 - Client-side table sorting with ease!
* Version 2.0.28 Minified using http://dean.edwards.name/packer/
* Copyright (c) 2007 Christian Bach
*/
!(function($){$.extend({tablesorter:new function(){var g=[],widgets=[],tbl;this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:false,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"mmddyyyy",onRenderHeader:null,selectorHeaders:'thead th',tableClass:'tablesorter',debug:false};function log(s){if(typeof console!=="undefined"&&typeof console.log!=="undefined"){console.log(s)}else{alert(s)}}function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms")}this.benchmark=benchmark;function getElementText(a,b,c){var d="",te=a.textExtraction;if(!b){return""}if(!a.supportsTextContent){a.supportsTextContent=b.textContent||false}if(te==="simple"){if(a.supportsTextContent){d=b.textContent}else{if(b.childNodes[0]&&b.childNodes[0].hasChildNodes()){d=b.childNodes[0].innerHTML}else{d=b.innerHTML}}}else{if(typeof(te)==="function"){d=te(b)}else if(typeof(te)==="object"&&te.hasOwnProperty(c)){d=te[c](b)}else{d=$(b).text()}}return d}function getParserById(a){var i,l=g.length;for(i=0;i<l;i++){if(g[i].id.toLowerCase()===a.toLowerCase()){return g[i]}}return false}function getNodeFromRowAndCellIndex(a,b,c){return a[b].cells[c]}function trimAndGetNodeText(a,b,c){return $.trim(getElementText(a,b,c))}function detectParserForColumn(a,b,c,d){var i,l=g.length,node=false,nodeValue='',keepLooking=true;while(nodeValue===''&&keepLooking){c++;if(b[c]){node=getNodeFromRowAndCellIndex(b,c,d);nodeValue=trimAndGetNodeText(a.config,node,d);if(a.config.debug){log('Checking if value was empty on row:'+c)}}else{keepLooking=false}}for(i=1;i<l;i++){if(g[i].is(nodeValue,a,node)){return g[i]}}return g[0]}function buildParserCache(a,b){if(a.tBodies.length===0){return}var c=a.tBodies[0].rows,list,cells,l,h,i,p,parsersDebug="";if(c[0]){list=[];cells=c[0].cells;l=cells.length;for(i=0;i<l;i++){p=false;h=$(b[i]);if($.metadata&&(h.metadata()&&h.metadata().sorter)){p=getParserById(h.metadata().sorter)}else if((a.config.headers[i]&&a.config.headers[i].sorter)){p=getParserById(a.config.headers[i].sorter)}else if(h.attr('class')&&h.attr('class').match('sorter-')){p=getParserById(h.attr('class').match(/sorter-(\w+)/)[1]||'')}if(!p){p=detectParserForColumn(a,c,-1,i)}if(a.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n"}list.push(p)}}if(a.config.debug){log(parsersDebug)}return list}function buildCache(a){var b=a.tBodies[0],totalRows=(b&&b.rows.length)||0,totalCells=(b.rows[0]&&b.rows[0].cells.length)||0,g=a.config.parsers,cache={row:[],normalized:[]},t,i,j,c,cols,cacheTime;if(a.config.debug){cacheTime=new Date()}for(i=0;i<totalRows;++i){c=$(b.rows[i]);cols=[];if(c.hasClass(a.config.cssChildRow)){cache.row[cache.row.length-1]=cache.row[cache.row.length-1].add(c);continue}cache.row.push(c);for(j=0;j<totalCells;++j){t=trimAndGetNodeText(a.config,c[0].cells[j],j);cols.push(t===''?'':g[j].format(t,a,c[0].cells[j],j))}cols.push(cache.normalized.length);cache.normalized.push(cols)}if(a.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime)}a.config.cache=cache;return cache}function initWidgets(a){var i,w,l=widgets.length;for(i=0;i<l;i++){w=widgets[i];if(w&&w.hasOwnProperty('init')){w.init(a,widgets,w)}}}function getWidgetById(a){var i,w,l=widgets.length;for(i=0;i<l;i++){w=widgets[i];if(w&&w.hasOwnProperty('id')&&w.id.toLowerCase()===a.toLowerCase()){return w}}}function applyWidget(a){var c=a.config.widgets,i,w,l=c.length;for(i=0;i<l;i++){w=getWidgetById(c[i]);if(w&&w.hasOwnProperty('format')){w.format(a)}}}function appendToTable(a,b){var c=a.config,r=b.row,n=b.normalized,totalRows=n.length,checkCell=totalRows?(n[0].length-1):0,rows=[],i,j,l,pos,appendTime;if(c.debug){appendTime=new Date()}for(i=0;i<totalRows;i++){pos=n[i][checkCell];rows.push(r[pos]);if(!c.appender||!c.removeRows){l=r[pos].length;for(j=0;j<l;j++){a.tBodies[0].appendChild(r[pos][j])}}}if(c.appender){c.appender(a,rows)}if(c.debug){benchmark("Rebuilt table:",appendTime)}applyWidget(a);setTimeout(function(){$(a).trigger("sortEnd",a)},0)}function computeTableHeaderCellIndexes(t){var a=[],lookup={},thead=t.getElementsByTagName('THEAD')[0],trs=thead.getElementsByTagName('TR'),i,j,k,l,c,cells,rowIndex,cellId,rowSpan,colSpan,firstAvailCol,matrixrow;for(i=0;i<trs.length;i++){cells=trs[i].cells;for(j=0;j<cells.length;j++){c=cells[j];rowIndex=c.parentNode.rowIndex;cellId=rowIndex+"-"+c.cellIndex;rowSpan=c.rowSpan||1;colSpan=c.colSpan||1;if(typeof(a[rowIndex])==="undefined"){a[rowIndex]=[]}for(k=0;k<a[rowIndex].length+1;k++){if(typeof(a[rowIndex][k])==="undefined"){firstAvailCol=k;break}}lookup[cellId]=firstAvailCol;for(k=rowIndex;k<rowIndex+rowSpan;k++){if(typeof(a[k])==="undefined"){a[k]=[]}matrixrow=a[k];for(l=firstAvailCol;l<firstAvailCol+colSpan;l++){matrixrow[l]="x"}}}}return lookup}function formatSortingOrder(v){if(typeof(v)!=="number"){return(v.toLowerCase().charAt(0)==="d")?1:0}else{return(v===1)?1:0}}function checkHeaderMetadata(a){return(($.metadata)&&($(a).metadata().sorter===false))}function checkHeaderOptions(a,i){return((a.config.headers[i])&&(a.config.headers[i].sorter===false))}function checkHeaderLocked(a,i){if((a.config.headers[i])&&(a.config.headers[i].lockedOrder!==null)){return a.config.headers[i].lockedOrder}return false}function checkHeaderOrder(a,i){if((a.config.headers[i])&&(a.config.headers[i].sortInitialOrder)){return a.config.headers[i].sortInitialOrder}return a.config.sortInitialOrder}function buildHeaders(b){var d=($.metadata)?true:false,header_index=computeTableHeaderCellIndexes(b),$th,lock,time,$tableHeaders,c=b.config;c.headerList=[];if(c.debug){time=new Date()}$tableHeaders=$(c.selectorHeaders,b).wrapInner("<span/>").each(function(a){this.column=header_index[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(checkHeaderOrder(b,a));this.count=this.order;if(checkHeaderMetadata(this)||checkHeaderOptions(b,a)||$(this).is('.sorter-false')){this.sortDisabled=true}this.lockedOrder=false;lock=checkHeaderLocked(b,a);if(typeof(lock)!=='undefined'&&lock!==false){this.order=this.lockedOrder=formatSortingOrder(lock)}if(!this.sortDisabled){$th=$(this).addClass(c.cssHeader);if(c.onRenderHeader){c.onRenderHeader.apply($th,[a])}}c.headerList[a]=this});if(c.debug){benchmark("Built headers:",time);log($tableHeaders)}return $tableHeaders}function checkCellColSpan(a,b,d){var i,cell,arr=[],r=a.tHead.rows,c=r[d].cells;for(i=0;i<c.length;i++){cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(a,b,d++))}else{if(a.tHead.length===1||(cell.rowSpan>1||!r[d+1])){arr.push(cell)}}}return arr}function isValueInArray(v,a){var i,l=a.length;for(i=0;i<l;i++){if(a[i][0]===v){return true}}return false}function setHeadersCss(b,c,d,e){c.removeClass(e[0]).removeClass(e[1]);var h=[],i,l;c.each(function(a){if(!this.sortDisabled){h[this.column]=$(this)}});l=d.length;for(i=0;i<l;i++){if(d[i][1]===2){continue}h[d[i][0]].addClass(e[d[i][1]])}}function fixColumnWidth(a,b){if(a.config.widthFixed){var c=$('<colgroup>');$("tr:first td",a.tBodies[0]).each(function(){c.append($('<col>').css('width',$(this).width()))});$(a).prepend(c)}}function updateHeaderSortCount(a,b){var i,s,o,c=a.config,l=b.length;for(i=0;i<l;i++){s=b[i];o=c.headerList[s[0]];o.count=s[1];o.count++}}function getCachedSortType(a,i){return(a)?a[i].type:''}function multisort(a,b,d){var f="var sortWrapper = function(a,b) {",col,mx=0,dir=0,tc=a.config,lc=d.normalized.length,l=b.length,sortTime,i,j,c,s,e,order,orgOrderCol;if(tc.debug){sortTime=new Date()}for(i=0;i<l;i++){c=b[i][0];order=b[i][1];s=(getCachedSortType(tc.parsers,c)==="text")?((order===0)?"sortText":"sortTextDesc"):((order===0)?"sortNumeric":"sortNumericDesc");e="e"+i;if(/Numeric/.test(s)&&tc.headers[c]&&tc.headers[c].string){for(j=0;j<lc;j++){col=Math.abs(parseFloat(d.normalized[j][c]));mx=Math.max(mx,isNaN(col)?0:col)}dir=(tc.headers[c])?tc.string[tc.headers[c].string]||0:0}f+="var "+e+" = "+s+"(a["+c+"],b["+c+"],"+mx+","+dir+"); ";f+="if ("+e+") { return "+e+"; } ";f+="else { "}orgOrderCol=(d.normalized&&d.normalized[0])?d.normalized[0].length-1:0;f+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(i=0;i<l;i++){f+="}; "}f+="return 0; ";f+="}; ";eval(f);d.normalized.sort(sortWrapper);if(tc.debug){benchmark("Sorting on "+b.toString()+" and dir "+order+" time:",sortTime)}return d}function sortText(a,b){if(a===''){return 1}if(b===''){return-1}if(a===b){return 0}if($.data(tbl[0],"tablesorter").sortLocaleCompare){return a.localeCompare(b)}try{var c=0,ax,t,x=/^(\.)?\d/,L=Math.min(a.length,b.length)+1;while(c<L&&a.charAt(c)===b.charAt(c)&&x.test(b.substring(c))===false&&x.test(a.substring(c))===false){c++}a=a.substring(c);b=b.substring(c);if(x.test(a)||x.test(b)){if(x.test(a)===false){return(a)?1:-1}else if(x.test(b)===false){return(b)?-1:1}else{t=parseFloat(a)-parseFloat(b);if(t!==0){return t}else{t=a.search(/[^\.\d]/)}if(t===-1){t=b.search(/[^\.\d]/)}a=a.substring(t);b=b.substring(t)}}return(a>b)?1:-1}catch(er){return 0}}function sortTextDesc(a,b){if(a===''){return 1}if(b===''){return-1}if(a===b){return 0}if($.data(tbl[0],"tablesorter").sortLocaleCompare){return b.localeCompare(a)}return-sortText(a,b)}function getTextValue(a,b,d){if(b){var i,l=a.length,n=b+d;for(i=0;i<l;i++){n+=a.charCodeAt(i)}return d*n}return 0}function sortNumeric(a,b,c,d){if(a===''){return 1}if(b===''){return-1}if(isNaN(a)){a=getTextValue(a,c,d)}if(isNaN(b)){b=getTextValue(b,c,d)}return a-b}function sortNumericDesc(a,b,c,d){if(a===''){return 1}if(b===''){return-1}if(isNaN(a)){a=getTextValue(a,c,d)}if(isNaN(b)){b=getTextValue(b,c,d)}return b-a}this.construct=function(d){return this.each(function(){if(!this.tHead||!this.tBodies){return}var c,$document,$headers,cache,config,shiftDown=0,sortOrder,sortCSS,totalRows,$cell,i,j,a,s,o;this.config={};config=$.extend(this.config,$.tablesorter.defaults,d);tbl=c=$(this).addClass(this.config.tableClass);$.data(this,"tablesorter",config);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);this.config.string={max:1,'max+':1,'max-':-1,none:0};cache=buildCache(this);sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){totalRows=(c[0].tBodies[0]&&c[0].tBodies[0].rows.length)||0;if(!this.sortDisabled){c.trigger("sortStart",tbl[0]);$cell=$(this);i=this.column;this.order=this.count++%(config.sortReset?3:2);if(typeof(this.lockedOrder)!=="undefined"&&this.lockedOrder!==false){this.order=this.lockedOrder}if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!==null){a=config.sortForce;for(j=0;j<a.length;j++){if(a[j][0]!==i){config.sortList.push(a[j])}}}if(this.order<2){config.sortList.push([i,this.order])}}else{if(isValueInArray(i,config.sortList)){for(j=0;j<config.sortList.length;j++){s=config.sortList[j];o=config.headerList[s[0]];if(s[0]===i){o.count=s[1];o.count++;s[1]=o.count%(config.sortReset?3:2);if(s[1]>=2){config.sortList.splice(j,1);o.count=0}}}}else{if(this.order<2){config.sortList.push([i,this.order])}}}if(config.sortAppend!==null){a=config.sortAppend;for(j=0;j<a.length;j++){if(a[j][0]!==i){config.sortList.push(a[j])}}}c.trigger("sortBegin",tbl[0]);setTimeout(function(){setHeadersCss(c[0],$headers,config.sortList,sortCSS);appendToTable(c[0],multisort(c[0],config.sortList,cache))},1);return false}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false}});c.bind("update",function(){var a=this;setTimeout(function(){a.config.parsers=buildParserCache(a,$headers);cache=buildCache(a);c.trigger("sorton",[a.config.sortList])},1)}).bind("updateCell",function(e,a){var b=this.config,pos=[(a.parentNode.rowIndex-1),a.cellIndex];cache.normalized[pos[0]][pos[1]]=b.parsers[pos[1]].format(getElementText(b,a,pos[1]),a);this.config.cache=cache;c.trigger("sorton",[b.sortList])}).bind("addRows",function(e,a){var i,config=this.config,rows=a.filter('tr').length,dat=[],l=a[0].cells.length;for(i=0;i<rows;i++){for(j=0;j<l;j++){dat[j]=config.parsers[j].format(getElementText(config,a[i].cells[j],j),a[i].cells[j])}dat.push(cache.row.length);cache.row.push([a[i]]);cache.normalized.push(dat);dat=[]}config.cache=cache;c.trigger("sorton",[config.sortList])}).bind("sorton",function(e,a){$(this).trigger("sortStart",tbl[0]);config.sortList=a;var b=config.sortList;updateHeaderSortCount(this,b);setHeadersCss(this,$headers,b,sortCSS);appendToTable(this,multisort(this,b,cache))}).bind("appendCache",function(){appendToTable(this,cache)}).bind("applyWidgetId",function(e,a){getWidgetById(a).format(this)}).bind("applyWidgets",function(){applyWidget(this)});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist}initWidgets(this);if(config.sortList.length>0){c.trigger("sorton",[config.sortList])}else{applyWidget(this)}})};this.addParser=function(b){var i,l=g.length,a=true;for(i=0;i<l;i++){if(g[i].id.toLowerCase()===b.id.toLowerCase()){a=false}}if(a){g.push(b)}};this.addWidget=function(a){widgets.push(a)};this.formatFloat=function(s){var i=parseFloat(s);return isNaN(i)?$.trim(s):i};this.isDigit=function(s){return(/^[\-+]?\d*$/).test($.trim(s.replace(/[,.']/g,'')))};this.clearTableBody=function(a){if($.browser.msie){var b=function(){while(this.firstChild){this.removeChild(this.firstChild)}};b.apply(a.tBodies[0])}else{a.tBodies[0].innerHTML=""}}}})();$.fn.extend({tablesorter:$.tablesorter.construct});var m=$.tablesorter;m.addParser({id:"text",is:function(s){return true},format:function(s){return $.trim(s.toLocaleLowerCase())},type:"text"});m.addParser({id:"digit",is:function(s){return $.tablesorter.isDigit(s.replace(/,/g,""))},format:function(s){return $.tablesorter.formatFloat(s.replace(/,/g,""))},type:"numeric"});m.addParser({id:"currency",is:function(s){return(/^[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]/).test(s)},format:function(s){return $.tablesorter.formatFloat(s.replace(/\,/g,'.').replace(new RegExp(/[^0-9. \-]/g),""))},type:"numeric"});m.addParser({id:"ipAddress",is:function(s){return(/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/).test(s)},format:function(s){var i,item,a=s.split("."),r="",l=a.length;for(i=0;i<l;i++){item=a[i];if(item.length===2){r+="0"+item}else{r+=item}}return $.tablesorter.formatFloat(r)},type:"numeric"});m.addParser({id:"url",is:function(s){return(/^(https?|ftp|file):\/\/$/).test(s)},format:function(s){return $.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''))},type:"text"});m.addParser({id:"isoDate",is:function(s){return(/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/).test(s)},format:function(s){return $.tablesorter.formatFloat((s!=="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0")},type:"numeric"});m.addParser({id:"percent",is:function(s){return(/\%$/).test($.trim(s))},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""))},type:"numeric"});m.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/))},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});m.addParser({id:"shortDate",is:function(s){return(/\d{1,4}[\/\-\,\.\s+]\d{1,4}[\/\-\.\,\s+]\d{1,4}/).test(s)},format:function(s,a,b,d){var c=a.config,format=(c.headers&&c.headers[d])?c.headers[d].dateFormat||c.dateFormat:c.dateFormat;s=s.replace(/\s+/g," ").replace(/[\-|\.|\,|\s]/g,"/");if(format==="mmddyyyy"){s=s.replace(/(\d{1,2})\/(\d{1,2})\/(\d{4})/,"$3/$1/$2")}else if(format==="ddmmyyyy"){s=s.replace(/(\d{1,2})\/(\d{1,2})\/(\d{4})/,"$3/$2/$1")}else if(format==="yyyymmdd"){s=s.replace(/(\d{4})\/(\d{1,2})\/(\d{1,2})/,"$1/$2/$3")}return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});m.addParser({id:"time",is:function(s){return(/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/).test(s)},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime())},type:"numeric"});m.addParser({id:"metadata",is:function(s){return false},format:function(s,a,b){var c=a.config,p=(!c.parserMetadataName)?'sortValue':c.parserMetadataName;return $(b).metadata()[p]},type:"numeric"});m.addWidget({id:"zebra",format:function(a){var b,row=0,even,time,child=a.config.cssChildRow,css=a.config.widgetZebra.css;if(a.config.debug){time=new Date()}$("tr:visible",a.tBodies[0]).each(function(i){b=$(this);if(!b.hasClass(child)){row++}even=(row%2===0);b.removeClass(css[even?1:0]).addClass(css[even?0:1])});if(a.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time)}}})})(jQuery);
| aashish24/cdnjs | ajax/libs/jquery.tablesorter/2.0.28.1/js/jquery.tablesorter.min.js | JavaScript | mit | 16,851 |
;modjewel.define("weinre/target/WiInspectorImpl", function(require, exports, module) { // Generated by CoffeeScript 1.8.0
var Timeline, Weinre, WiInspectorImpl;
Weinre = require('../common/Weinre');
Timeline = require('../target/Timeline');
module.exports = WiInspectorImpl = (function() {
function WiInspectorImpl() {}
WiInspectorImpl.prototype.reloadPage = function(callback) {
if (callback) {
Weinre.WeinreTargetCommands.sendClientCallback(callback);
}
return window.location.reload();
};
WiInspectorImpl.prototype.highlightDOMNode = function(nodeId, callback) {
var node;
node = Weinre.nodeStore.getNode(nodeId);
if (!node) {
Weinre.logWarning(arguments.callee.signature + " passed an invalid nodeId: " + nodeId);
return;
}
Weinre.elementHighlighter.on(node);
if (callback) {
return Weinre.WeinreTargetCommands.sendClientCallback(callback);
}
};
WiInspectorImpl.prototype.hideDOMNodeHighlight = function(callback) {
Weinre.elementHighlighter.off();
if (callback) {
return Weinre.WeinreTargetCommands.sendClientCallback(callback);
}
};
WiInspectorImpl.prototype.startTimelineProfiler = function(callback) {
Timeline.start();
Weinre.wi.TimelineNotify.timelineProfilerWasStarted();
if (callback) {
return Weinre.WeinreTargetCommands.sendClientCallback(callback);
}
};
WiInspectorImpl.prototype.stopTimelineProfiler = function(callback) {
Timeline.stop();
Weinre.wi.TimelineNotify.timelineProfilerWasStopped();
if (callback) {
return Weinre.WeinreTargetCommands.sendClientCallback(callback);
}
};
return WiInspectorImpl;
})();
require("../common/MethodNamer").setNamesForClass(module.exports);
});
| JAMS-ITCR/MyConcert | site/node_modules/weinre/web/weinre/target/WiInspectorImpl.amd.js | JavaScript | mit | 1,760 |
<!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>Getting Started With CodeIgniter — CodeIgniter 3.0.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/theme.css" type="text/css" />
<link rel="top" title="CodeIgniter 3.0.0 documentation" href="../index.html"/>
<link rel="up" title="CodeIgniter Overview" href="index.html"/>
<link rel="next" title="CodeIgniter at a Glance" href="at_a_glance.html"/>
<link rel="prev" title="CodeIgniter Overview" href="index.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 class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">CodeIgniter Overview</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="">Getting Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="at_a_glance.html">CodeIgniter at a Glance</a></li>
<li class="toctree-l2"><a class="reference internal" href="features.html">Supported Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="appflow.html">Application Flow Chart</a></li>
<li class="toctree-l2"><a class="reference internal" href="mvc.html">Model-View-Controller</a></li>
<li class="toctree-l2"><a class="reference internal" href="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>
<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">CodeIgniter Overview</a> »</li>
<li>Getting Started With CodeIgniter</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document">
<div class="section" id="getting-started-with-codeigniter">
<h1>Getting Started With CodeIgniter<a class="headerlink" href="#getting-started-with-codeigniter" title="Permalink to this headline">¶</a></h1>
<p>Any software application requires some effort to learn. We’ve done our
best to minimize the learning curve while making the process as
enjoyable as possible.</p>
<p>The first step is to <a class="reference internal" href="../installation/index.html"><em>install</em></a>
CodeIgniter, then read all the topics in the <strong>Introduction</strong> section of
the Table of Contents.</p>
<p>Next, read each of the <strong>General Topics</strong> pages in order. Each topic
builds on the previous one, and includes code examples that you are
encouraged to try.</p>
<p>Once you understand the basics you’ll be ready to explore the <strong>Class
Reference</strong> and <strong>Helper Reference</strong> pages to learn to utilize the
native libraries and helper files.</p>
<p>Feel free to take advantage of our <a class="reference external" href="http://forum.codeigniter.com/">Community
Forums</a> if you have questions or
problems, and our <a class="reference external" href="https://github.com/bcit-ci/CodeIgniter/wiki">Wiki</a> to see code
examples posted by other users.</p>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="at_a_glance.html" class="btn btn-neutral float-right" title="CodeIgniter at a Glance">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="index.html" class="btn btn-neutral" title="CodeIgniter Overview"><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 Mar 30, 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.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> | jaypatrickm/CODINGDOJO-CODEIGNITER-PokeCommerce | user_guide/overview/getting_started.html | HTML | mit | 19,189 |
/*
* /MathJax/jax/output/SVG/fonts/Neo-Euler/fontdata.js
*
* Copyright (c) 2009-2015 The MathJax Consortium
*
* 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.
*/
(function(w,e,B,m){var y="2.5.0";var b="NeoEulerMathJax_Alphabets",u="NeoEulerMathJax_Arrows",z="NeoEulerMathJax_Fraktur",t="NeoEulerMathJax_Main",k="NeoEulerMathJax_Marks",x="NeoEulerMathJax_NonUnicode",q="NeoEulerMathJax_Normal",A="NeoEulerMathJax_Operators",o="NeoEulerMathJax_Script",c="NeoEulerMathJax_Shapes",l="NeoEulerMathJax_Size1",j="NeoEulerMathJax_Size2",i="NeoEulerMathJax_Size3",g="NeoEulerMathJax_Size4",f="NeoEulerMathJax_Size5",s="NeoEulerMathJax_Symbols",n="NeoEulerMathJax_Variants",v="NeoEulerMathJax_Normal",a="NeoEulerMathJax_Normal",C="NeoEulerMathJax_Normal";var p="H",d="V",r={load:"extra",dir:p},h={load:"extra",dir:d};w.Augment({FONTDATA:{version:y,baselineskip:1200,lineH:800,lineD:200,FONTS:{NeoEulerMathJax_Alphabets:"Alphabets/Regular/Main.js",NeoEulerMathJax_Arrows:"Arrows/Regular/Main.js",NeoEulerMathJax_Fraktur:"Fraktur/Regular/Main.js",NeoEulerMathJax_Main:"Main/Regular/Main.js",NeoEulerMathJax_Marks:"Marks/Regular/Main.js",NeoEulerMathJax_NonUnicode:"NonUnicode/Regular/Main.js",NeoEulerMathJax_Normal:"Normal/Regular/Main.js",NeoEulerMathJax_Operators:"Operators/Regular/Main.js",NeoEulerMathJax_Script:"Script/Regular/Main.js",NeoEulerMathJax_Shapes:"Shapes/Regular/Main.js",NeoEulerMathJax_Size1:"Size1/Regular/Main.js",NeoEulerMathJax_Size2:"Size2/Regular/Main.js",NeoEulerMathJax_Size3:"Size3/Regular/Main.js",NeoEulerMathJax_Size4:"Size4/Regular/Main.js",NeoEulerMathJax_Size5:"Size5/Regular/Main.js",NeoEulerMathJax_Symbols:"Symbols/Regular/Main.js",NeoEulerMathJax_Variants:"Variants/Regular/Main.js"},VARIANT:{normal:{fonts:[t,q,b,k,u,A,s,c,n,x,l]},bold:{fonts:[t,q,b,k,u,A,s,c,n,x,l],bold:true,offsetA:119808,offsetG:120488,offsetN:120782},italic:{fonts:[t,q,b,k,u,A,s,c,n,x,l],italic:true},"bold-italic":{fonts:[t,q,b,k,u,A,s,c,n,x,l],bold:true,italic:true},"double-struck":{fonts:[v],offsetA:120120,offsetN:120792,remap:{120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484}},fraktur:{fonts:[z],offsetA:120068,remap:{120070:8493,120075:8460,120076:8465,120085:8476,120093:8488}},"bold-fraktur":{fonts:[z],bold:true,offsetA:120172},script:{fonts:[o],italic:true,offsetA:119964,remap:{119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500}},"bold-script":{fonts:[o],bold:true,italic:true,offsetA:120016},"sans-serif":{fonts:[a],offsetA:120224,offsetN:120802},"bold-sans-serif":{fonts:[a],bold:true,offsetA:120276,offsetN:120812,offsetG:120662},"sans-serif-italic":{fonts:[a],italic:true,offsetA:120328},"sans-serif-bold-italic":{fonts:[a],bold:true,italic:true,offsetA:120380,offsetG:120720},monospace:{fonts:[C],offsetA:120432,offsetN:120822},"-Neo-Euler-variant":{fonts:[n,t,q,b,k,u,A,s,c,x,l]},"-tex-caligraphic":{fonts:[t,q,b,k,u,A,s,c,n,x,l],italic:true},"-tex-oldstyle":{offsetN:57856,fonts:[n,t,q,b,k,u,A,s,c,x,l]},"-tex-caligraphic-bold":{fonts:[t,q,b,k,u,A,s,c,n,x,l],italic:true,bold:true},"-tex-oldstyle-bold":{fonts:[t,q,b,k,u,A,s,c,n,x,l],bold:true},"-tex-mathit":{fonts:[t,q,b,k,u,A,s,c,n,x,l],italic:true,noIC:true},"-largeOp":{fonts:[l,t]},"-smallOp":{}},RANGES:[{name:"alpha",low:97,high:122,offset:"A",add:26},{name:"Alpha",low:65,high:90,offset:"A"},{name:"number",low:48,high:57,offset:"N"},{name:"greek",low:945,high:969,offset:"G",add:26},{name:"Greek",low:913,high:1014,offset:"G",remap:{1013:52,977:53,1008:54,981:55,1009:56,982:57,1012:17}}],RULECHAR:175,REMAP:{8432:42,8226:8729,8931:"\u2292\u0338",8930:"\u2291\u0338",12296:10216,713:175,8215:95,8428:8641,8429:8637,10799:215,8400:8636,8401:8640,978:933,8212:175,8213:175,12297:10217,65079:9182,65080:9183,697:8242,10072:8739,8254:175},REMAPACCENT:{"\u007E":"\u0303","\u2192":"\u20D7","\u0060":"\u0300","\u005E":"\u0302","\u00B4":"\u0301","\u2032":"\u0301","\u2035":"\u0300"},REMAPACCENTUNDER:{},DELIMITERS:{40:{dir:d,HW:[[925,t],[1198,l],[1798,j],[1961,j,1.091],[2398,i],[2998,g]],stretch:{bot:[9117,s],ext:[9116,s],top:[9115,s]}},41:{dir:d,HW:[[925,t],[1198,l],[1798,j],[1961,j,1.091],[2398,i],[2998,g]],stretch:{bot:[9120,s],ext:[9119,s],top:[9118,s]}},45:{alias:175,dir:p},47:{dir:d,HW:[[912,t],[1199,l],[1799,j],[1961,j,1.09],[2399,i],[2999,g]]},61:{dir:p,HW:[[668,t]],stretch:{rep:[61,t]}},91:{dir:d,HW:[[866,t],[1199,l],[1799,j],[1961,j,1.09],[2399,i],[2999,g]],stretch:{bot:[9123,s],ext:[9122,s],top:[9121,s]}},92:{dir:d,HW:[[914,t],[1199,l],[1799,j],[1961,j,1.09],[2399,i],[2999,g]]},93:{dir:d,HW:[[866,t],[1199,l],[1799,j],[1961,j,1.09],[2399,i],[2999,g]],stretch:{bot:[9126,s],ext:[9125,s],top:[9124,s]}},95:{alias:175,dir:p},123:{dir:d,HW:[[908,t],[1199,l],[1799,j],[1961,j,1.09],[2399,i],[2999,g]],stretch:{bot:[9129,s],ext:[9130,s],mid:[9128,s],top:[9127,s]}},124:{dir:d,HW:[[905,t],[1505,l],[2105,j],[2706,i],[3306,g]],stretch:{bot:[57344,f],ext:[57345,f]}},125:{dir:d,HW:[[908,t],[1199,l],[1799,j],[1961,j,1.09],[2399,i],[2999,g]],stretch:{bot:[9133,s],ext:[9130,s],mid:[9132,s],top:[9131,s]}},175:{dir:p,HW:[[312,t]],stretch:{rep:[175,t]}},201:{alias:175,dir:p},818:{alias:175,dir:p},8213:{alias:175,dir:p},8214:{dir:d,HW:[[905,t],[1505,l],[2105,j],[2706,i],[3306,g]],stretch:{bot:[57346,f],ext:[57347,f]}},8215:{alias:175,dir:p},8254:{alias:175,dir:p},8260:h,8406:{dir:p,HW:[[418,k]],stretch:{left:[8406,k],rep:[57348,f]}},8407:{dir:p,HW:[[418,t]],stretch:{rep:[57348,f],right:[8407,t]}},8417:r,8430:r,8431:r,8592:{alias:8406,dir:p},8593:{dir:d,HW:[[887,t]],stretch:{top:[8593,t],ext:[124,t]}},8594:{alias:8407,dir:p},8595:{dir:d,HW:[[867,t]],stretch:{ext:[124,t],bot:[8595,t]}},8596:{alias:8417,dir:p},8597:{dir:d,HW:[[1042,t]],stretch:{top:[8593,t],ext:[124,t],bot:[8595,t]}},8656:{dir:p,HW:[[867,t],[1567,l]]},8657:{dir:p,HW:[[640,t]],stretch:{top:[8657,t],ext:[8214,t]}},8658:{dir:p,HW:[[867,t],[1567,l]]},8659:{dir:p,HW:[[640,t]],stretch:{ext:[8214,t],bot:[8659,t]}},8660:{dir:p,HW:[[867,t,null,8656],[1632,l]]},8661:{dir:p,HW:[[640,t]],stretch:{top:[8657,t],ext:[8214,t],bot:[8659,t]}},8719:h,8720:h,8721:h,8722:{alias:175,dir:p},8725:{dir:d,HW:[[912,t],[1199,l],[1799,j],[2399,i],[2999,g]]},8730:{dir:d,HW:[[989,t],[1209,l],[1801,j],[2403,i],[3003,g]],stretch:{bot:[57350,f],ext:[57351,f],top:[57352,f]}},8739:{dir:d,HW:[[795,t],[1505,l],[2105,j],[2706,i],[3306,g]]},8741:{dir:d,HW:[[905,t],[905,l],[1505,j],[2105,i],[2706,g],[3306,f]],stretch:{bot:[57346,f],ext:[57347,f]}},8743:h,8744:h,8745:h,8746:h,8747:h,8748:h,8749:h,8750:h,8846:h,8896:h,8897:h,8898:h,8899:h,8968:{dir:d,HW:[[980,t],[1199,l],[1799,j],[1961,j,1.09],[2399,i],[2999,g]],stretch:{ext:[9122,s],top:[9121,s]}},8969:{dir:d,HW:[[980,t],[1199,l],[1799,j],[1961,j,1.09],[2399,i],[2999,g]],stretch:{ext:[9125,s],top:[9124,s]}},8970:{dir:d,HW:[[980,t],[1199,l],[1799,j],[1961,j,1.09],[2399,i],[2999,g]],stretch:{bot:[9123,s],ext:[9122,s]}},8971:{dir:d,HW:[[980,t],[1199,l],[1799,j],[1961,j,1.09],[2399,i],[2999,g]],stretch:{bot:[9126,s],ext:[9125,s]}},9001:{dir:d,HW:[[974,s],[1176,l],[1770,j],[2366,i],[2958,g]]},9002:{dir:d,HW:[[974,s],[1176,l],[1770,j],[2366,i],[2958,g]]},9130:{dir:d,HW:[[320,s]],stretch:{ext:[9130,s]}},9135:{alias:175,dir:p},9136:{dir:d,HW:[[909,s,null,9127]],stretch:{top:[9127,s],ext:[9130,s],bot:[9133,s]}},9137:{dir:d,HW:[[909,s,null,9131]],stretch:{top:[9131,s],ext:[9130,s],bot:[9129,s]}},9168:{dir:d,HW:[[905,t,null,124],[1150,t,1.271,124],[1556,t,1.719,124],[1961,t,2.167,124],[2367,t,2.615,124]],stretch:{ext:[124,t]}},9180:r,9181:r,9182:{dir:p,HW:[[908,t],[1199,l],[1799,j],[2399,i],[2999,g]],stretch:{left:[57359,f],rep:[57360,f],mid:[57361,f],right:[57362,f]}},9183:{dir:p,HW:[[908,t],[1199,l],[1799,j],[2399,i],[2999,g]],stretch:{left:[57363,f],rep:[57364,f],mid:[57365,f],right:[57366,f]}},9472:{alias:175,dir:p},10072:{alias:9168,dir:d},10216:{dir:d,HW:[[974,t],[974,l],[1176,j],[1770,i],[2366,g],[2958,f]]},10217:{dir:d,HW:[[974,t],[974,l],[1176,j],[1770,i],[2366,g],[2958,f]]},10222:{alias:40,dir:d},10223:{alias:41,dir:d},10229:{alias:8406,dir:p},10230:{alias:8407,dir:p},10231:{alias:8417,dir:p},10232:{alias:8656,dir:p},10233:{alias:8658,dir:p},10234:{alias:8660,dir:p},10235:{alias:8406,dir:p},10236:{alias:8407,dir:p},10237:{alias:8656,dir:p},10238:{alias:8658,dir:p},10764:h,12296:{alias:10216,dir:d},12297:{alias:10217,dir:d},65079:{alias:9182,dir:p},65080:{alias:9183,dir:p}}}});MathJax.Hub.Register.LoadHook(w.fontDir+"/Size5/Regular/Main.js",function(){var D;D=w.FONTDATA.DELIMITERS[9182].stretch.rep[0];w.FONTDATA.FONTS[f][D][0]+=200;w.FONTDATA.FONTS[f][D][1]+=200;D=w.FONTDATA.DELIMITERS[9183].stretch.rep[0];w.FONTDATA.FONTS[f][D][0]+=200;w.FONTDATA.FONTS[f][D][1]+=200});B.loadComplete(w.fontDir+"/fontdata.js")})(MathJax.OutputJax.SVG,MathJax.ElementJax.mml,MathJax.Ajax,MathJax.Hub);
| Nadeermalangadan/cdnjs | ajax/libs/mathjax/2.5.1/jax/output/SVG/fonts/Neo-Euler/fontdata.js | JavaScript | mit | 9,348 |
//! moment.js locale configuration
//! locale : modern greek (el)
//! author : Aggelos Karalias : https://github.com/mehiel
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['moment'], factory) :
factory(global.moment)
}(this, function (moment) { 'use strict';
var el = moment.defineLocale('el', {
monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'),
monthsGenitiveEl : 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split('_'),
months : function (momentToFormat, format) {
if (/D/.test(format.substring(0, format.indexOf('MMMM')))) { // if there is a day number before 'MMMM'
return this._monthsGenitiveEl[momentToFormat.month()];
} else {
return this._monthsNominativeEl[momentToFormat.month()];
}
},
monthsShort : 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),
weekdays : 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'),
weekdaysShort : 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),
weekdaysMin : 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),
meridiem : function (hours, minutes, isLower) {
if (hours > 11) {
return isLower ? 'μμ' : 'ΜΜ';
} else {
return isLower ? 'πμ' : 'ΠΜ';
}
},
isPM : function (input) {
return ((input + '').toLowerCase()[0] === 'μ');
},
meridiemParse : /[ΠΜ]\.?Μ?\.?/i,
longDateFormat : {
LT : 'h:mm A',
LTS : 'h:mm:ss A',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY h:mm A',
LLLL : 'dddd, D MMMM YYYY h:mm A'
},
calendarEl : {
sameDay : '[Σήμερα {}] LT',
nextDay : '[Αύριο {}] LT',
nextWeek : 'dddd [{}] LT',
lastDay : '[Χθες {}] LT',
lastWeek : function () {
switch (this.day()) {
case 6:
return '[το προηγούμενο] dddd [{}] LT';
default:
return '[την προηγούμενη] dddd [{}] LT';
}
},
sameElse : 'L'
},
calendar : function (key, mom) {
var output = this._calendarEl[key],
hours = mom && mom.hours();
if (typeof output === 'function') {
output = output.apply(mom);
}
return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις'));
},
relativeTime : {
future : 'σε %s',
past : '%s πριν',
s : 'λίγα δευτερόλεπτα',
m : 'ένα λεπτό',
mm : '%d λεπτά',
h : 'μία ώρα',
hh : '%d ώρες',
d : 'μία μέρα',
dd : '%d μέρες',
M : 'ένας μήνας',
MM : '%d μήνες',
y : 'ένας χρόνος',
yy : '%d χρόνια'
},
ordinalParse: /\d{1,2}η/,
ordinal: '%dη',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4st is the first week of the year.
}
});
return el;
})); | GerHobbelt/jquery-handsontable | dist/moment/locale/el.js | JavaScript | mit | 4,024 |
'use strict';
var aFrom = require('es5-ext/array/from')
, nextTick = require('next-tick')
, join = Array.prototype.join;
module.exports = function (t, a) {
return {
"0": function () {
var i = 0, fn = function () { ++i; return 3; };
fn = t(fn);
a(fn(), 3, "First");
a(fn(1), 3, "Second");
a(fn(5), 3, "Third");
a(i, 1, "Called once");
},
"1": function () {
var i = 0, fn = function (x) { ++i; return x; };
fn = t(fn);
return {
"No arg": function () {
i = 0;
a(fn(), undefined, "First");
a(fn(), undefined, "Second");
a(fn(), undefined, "Third");
a(i, 1, "Called once");
},
Arg: function () {
var x = {};
i = 0;
a(fn(x, 8), x, "First");
a(fn(x, 4), x, "Second");
a(fn(x, 2), x, "Third");
a(i, 1, "Called once");
},
"Other Arg": function () {
var x = {};
i = 0;
a(fn(x, 2), x, "First");
a(fn(x, 9), x, "Second");
a(fn(x, 3), x, "Third");
a(i, 1, "Called once");
}
};
},
"3": function () {
var i = 0, fn = function (x, y, z) { ++i; return [x, y, z]; }, r;
fn = t(fn);
return {
"No args": function () {
i = 0;
a.deep(r = fn(), [undefined, undefined, undefined], "First");
a(fn(), r, "Second");
a(fn(), r, "Third");
a(i, 1, "Called once");
},
"Some Args": function () {
var x = {};
i = 0;
a.deep(r = fn(x, 8), [x, 8, undefined], "First");
a(fn(x, 8), r, "Second");
a(fn(x, 8), r, "Third");
a(i, 1, "Called once");
return {
Other: function () {
a.deep(r = fn(x, 5), [x, 5, undefined], "Second");
a(fn(x, 5), r, "Third");
a(i, 2, "Called once");
}
};
},
"Full stuff": function () {
var x = {};
i = 0;
a.deep(r = fn(x, 8, 23, 98), [x, 8, 23], "First");
a(fn(x, 8, 23, 43), r, "Second");
a(fn(x, 8, 23, 9), r, "Third");
a(i, 1, "Called once");
return {
Other: function () {
a.deep(r = fn(x, 23, 8, 13), [x, 23, 8], "Second");
a(fn(x, 23, 8, 22), r, "Third");
a(i, 2, "Called once");
}
};
}
};
},
"Normalizer function": function () {
var i = 0, fn = function () { ++i; return join.call(arguments, '|'); }, mfn;
mfn = t(fn, { normalizer: function (args) { return Boolean(args[0]); } });
a(mfn(false, 'raz'), 'false|raz', "#1");
a(mfn(0, 'dwa'), 'false|raz', "#2");
a(i, 1, "Called once");
a(mfn(34, 'bar'), '34|bar', "#3");
a(i, 2, "Called twice");
a(mfn(true, 'ola'), '34|bar', "#4");
a(i, 2, "Called twice #2");
},
Dynamic: function () {
var i = 0, fn = function () { ++i; return arguments; }, r;
fn = t(fn, { length: false });
return {
"No args": function () {
i = 0;
a.deep(aFrom(r = fn()), [], "First");
a(fn(), r, "Second");
a(fn(), r, "Third");
a(i, 1, "Called once");
},
"Some Args": function () {
var x = {};
i = 0;
a.deep(aFrom(r = fn(x, 8)), [x, 8], "First");
a(fn(x, 8), r, "Second");
a(fn(x, 8), r, "Third");
a(i, 1, "Called once");
},
"Many args": function () {
var x = {};
i = 0;
a.deep(aFrom(r = fn(x, 8, 23, 98)), [x, 8, 23, 98], "First");
a(fn(x, 8, 23, 98), r, "Second");
a(fn(x, 8, 23, 98), r, "Third");
a(i, 1, "Called once");
}
};
},
Resolvers: function () {
var i = 0, fn, r;
fn = t(function () { ++i; return arguments; },
{ length: 3, resolvers: [Boolean, String] });
return {
"No args": function () {
i = 0;
a.deep(aFrom(r = fn()), [false, 'undefined'], "First");
a(fn(), r, "Second");
a(fn(), r, "Third");
a(i, 1, "Called once");
},
"Some Args": function () {
var x = {};
i = 0;
a.deep(aFrom(r = fn(0, 34, x, 45)), [false, '34', x, 45],
"First");
a(fn(0, 34, x, 22), r, "Second");
a(fn(0, 34, x, false), r, "Third");
a(i, 1, "Called once");
return {
Other: function () {
a.deep(aFrom(r = fn(1, 34, x, 34)),
[true, '34', x, 34], "Second");
a(fn(1, 34, x, 89), r, "Third");
a(i, 2, "Called once");
}
};
}
};
},
"Clear Cache": {
Specific: function () {
var i = 0, fn, mfn, x = {};
fn = function (a, b, c) {
if (c === 3) {
++i;
}
return arguments;
};
mfn = t(fn);
mfn(1, x, 3);
mfn(1, x, 4);
mfn.delete(1, x, 4);
mfn(1, x, 3);
mfn(1, x, 3);
a(i, 1, "Pre clear");
mfn.delete(1, x, 3);
mfn(1, x, 3);
a(i, 2, "After clear");
i = 0;
mfn = t(fn, { length: false });
mfn(1, x, 3);
mfn(1, x, 3);
mfn();
mfn();
mfn.delete();
mfn(1, x, 3);
a(i, 1, "Proper no arguments clear");
},
All: function () {
var i = 0, fn, x = {};
fn = function () {
++i;
return arguments;
};
fn = t(fn, { length: 3 });
fn(1, x, 3);
fn(1, x, 4);
fn(1, x, 3);
fn(1, x, 4);
a(i, 2, "Pre clear");
fn.clear();
fn(1, x, 3);
fn(1, x, 4);
fn(1, x, 3);
fn(1, x, 4);
a(i, 4, "After clear");
}
},
Primitive: {
"No args": function (a) {
var i = 0, fn = function () { ++i; return arguments[0]; }, mfn;
mfn = t(fn, { primitive: true });
a(mfn('ble'), 'ble', "#1");
a(mfn({}), 'ble', "#2");
a(i, 1, "Called once");
},
"One arg": function (a) {
var i = 0, fn = function (x) { ++i; return x; }, mfn
, y = { toString: function () { return 'foo'; } };
mfn = t(fn, { primitive: true });
a(mfn(y), y, "#1");
a(mfn('foo'), y, "#2");
a(i, 1, "Called once");
},
"Many args": function (a) {
var i = 0, fn = function (x, y, z) { ++i; return x + y + z; }, mfn
, y = { toString: function () { return 'foo'; } };
mfn = t(fn, { primitive: true });
a(mfn(y, 'bar', 'zeta'), 'foobarzeta', "#1");
a(mfn('foo', 'bar', 'zeta'), 'foobarzeta', "#2");
a(i, 1, "Called once");
},
"Clear cache": function (a) {
var i = 0, fn = function (x, y, z) { ++i; return x + y + z; }, mfn
, y = { toString: function () { return 'foo'; } };
mfn = t(fn, { primitive: true });
a(mfn(y, 'bar', 'zeta'), 'foobarzeta', "#1");
a(mfn('foo', 'bar', 'zeta'), 'foobarzeta', "#2");
a(i, 1, "Called once");
mfn.delete('foo', { toString: function () { return 'bar'; } },
'zeta');
a(mfn(y, 'bar', 'zeta'), 'foobarzeta', "#3");
a(i, 2, "Called twice");
}
},
"Reference counter": {
Regular: function (a) {
var i = 0, fn = function (x, y, z) { ++i; return x + y + z; }, mfn;
mfn = t(fn, { refCounter: true });
a(mfn.deleteRef(3, 5, 7), null, "Clear before");
a(mfn(3, 5, 7), 15, "Initial");
a(mfn(3, 5, 7), 15, "Cache");
a(mfn.deleteRef(3, 5, 7), false, "Clear #1");
mfn(3, 5, 7);
a(mfn.deleteRef(3, 5, 7), false, "Clear #2");
mfn(3, 5, 7);
a(mfn.deleteRef(3, 5, 7), false, "Clear #3");
mfn(3, 5, 7);
a(i, 1, "Not cleared");
a(mfn.deleteRef(3, 5, 7), false, "Clear #4");
a(mfn.deleteRef(3, 5, 7), true, "Clear final");
mfn(3, 5, 7);
a(i, 2, "Restarted");
mfn(3, 5, 7);
a(i, 2, "Cached again");
},
Primitive: function (a) {
var i = 0, fn = function (x, y, z) { ++i; return x + y + z; }, mfn;
mfn = t(fn, { primitive: true, refCounter: true });
a(mfn.deleteRef(3, 5, 7), null, "Clear before");
a(mfn(3, 5, 7), 15, "Initial");
a(mfn(3, 5, 7), 15, "Cache");
a(mfn.deleteRef(3, 5, 7), false, "Clear #1");
mfn(3, 5, 7);
a(mfn.deleteRef(3, 5, 7), false, "Clear #2");
mfn(3, 5, 7);
a(mfn.deleteRef(3, 5, 7), false, "Clear #3");
mfn(3, 5, 7);
a(i, 1, "Not cleared");
a(mfn.deleteRef(3, 5, 7), false, "Clear #4");
a(mfn.deleteRef(3, 5, 7), true, "Clear final");
mfn(3, 5, 7);
a(i, 2, "Restarted");
mfn(3, 5, 7);
a(i, 2, "Cached again");
}
},
Async: {
Regular: {
Success: function (a, d) {
var mfn, fn, u = {}, i = 0, invoked = 0;
fn = function (x, y, cb) {
nextTick(function () {
++i;
cb(null, x + y);
});
return u;
};
mfn = t(fn, { async: true });
a(mfn(3, 7, function (err, res) {
++invoked;
a.deep([err, res], [null, 10], "Result #1");
}), u, "Initial");
a(mfn(3, 7, function (err, res) {
++invoked;
a.deep([err, res], [null, 10], "Result #2");
}), u, "Initial #2");
a(mfn(5, 8, function (err, res) {
++invoked;
a.deep([err, res], [null, 13], "Result B #1");
}), u, "Initial #2");
a(mfn(3, 7, function (err, res) {
++invoked;
a.deep([err, res], [null, 10], "Result #3");
}), u, "Initial #2");
a(mfn(5, 8, function (err, res) {
++invoked;
a.deep([err, res], [null, 13], "Result B #2");
}), u, "Initial #3");
nextTick(function () {
a(i, 2, "Init Called");
a(invoked, 5, "Cb Called");
a(mfn(3, 7, function (err, res) {
++invoked;
a.deep([err, res], [null, 10], "Again: Result");
}), u, "Again: Initial");
a(mfn(5, 8, function (err, res) {
++invoked;
a.deep([err, res], [null, 13], "Again B: Result");
}), u, "Again B: Initial");
nextTick(function () {
a(i, 2, "Init Called #2");
a(invoked, 7, "Cb Called #2");
mfn.delete(3, 7);
a(mfn(3, 7, function (err, res) {
++invoked;
a.deep([err, res], [null, 10], "Again: Result");
}), u, "Again: Initial");
a(mfn(5, 8, function (err, res) {
++invoked;
a.deep([err, res], [null, 13], "Again B: Result");
}), u, "Again B: Initial");
nextTick(function () {
a(i, 3, "Init After clear");
a(invoked, 9, "Cb After clear");
d();
});
});
});
},
"Reference counter": function (a, d) {
var mfn, fn, u = {}, i = 0;
fn = function (x, y, cb) {
nextTick(function () {
++i;
cb(null, x + y);
});
return u;
};
mfn = t(fn, { async: true, refCounter: true });
a(mfn.deleteRef(3, 7), null, "Clear ref before");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #1");
}), u, "Initial");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #2");
}), u, "Initial #2");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Result B #1");
}), u, "Initial #2");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #3");
}), u, "Initial #2");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Result B #2");
}), u, "Initial #3");
nextTick(function () {
a(i, 2, "Called #2");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Again: Result");
}), u, "Again: Initial");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Again B: Result");
}), u, "Again B: Initial");
nextTick(function () {
a(i, 2, "Again Called #2");
a(mfn.deleteRef(3, 7), false, "Clear ref #1");
a(mfn.deleteRef(3, 7), false, "Clear ref #2");
a(mfn.deleteRef(3, 7), false, "Clear ref #3");
a(mfn.deleteRef(3, 7), true, "Clear ref Final");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Again: Result");
}), u, "Again: Initial");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Again B: Result");
}), u, "Again B: Initial");
nextTick(function () {
a(i, 3, "Call After clear");
d();
});
});
});
},
Error: function (a, d) {
var mfn, fn, u = {}, i = 0, e = new Error("Test");
fn = function (x, y, cb) {
nextTick(function () {
++i;
cb(e);
});
return u;
};
mfn = t(fn, { async: true });
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [e, undefined], "Result #1");
}), u, "Initial");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [e, undefined], "Result #2");
}), u, "Initial #2");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [e, undefined], "Result B #1");
}), u, "Initial #2");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [e, undefined], "Result #3");
}), u, "Initial #2");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [e, undefined], "Result B #2");
}), u, "Initial #3");
nextTick(function () {
a(i, 2, "Called #2");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [e, undefined], "Again: Result");
}), u, "Again: Initial");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [e, undefined], "Again B: Result");
}), u, "Again B: Initial");
nextTick(function () {
a(i, 4, "Again Called #2");
d();
});
});
}
},
Primitive: {
Success: function (a, d) {
var mfn, fn, u = {}, i = 0;
fn = function (x, y, cb) {
nextTick(function () {
++i;
cb(null, x + y);
});
return u;
};
mfn = t(fn, { async: true, primitive: true });
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #1");
}), u, "Initial");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #2");
}), u, "Initial #2");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Result B #1");
}), u, "Initial #2");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #3");
}), u, "Initial #2");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Result B #2");
}), u, "Initial #3");
nextTick(function () {
a(i, 2, "Called #2");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Again: Result");
}), u, "Again: Initial");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Again B: Result");
}), u, "Again B: Initial");
nextTick(function () {
a(i, 2, "Again Called #2");
mfn.delete(3, 7);
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Again: Result");
}), u, "Again: Initial");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Again B: Result");
}), u, "Again B: Initial");
nextTick(function () {
a(i, 3, "Call After clear");
d();
});
});
});
},
"Reference counter": function (a, d) {
var mfn, fn, u = {}, i = 0;
fn = function (x, y, cb) {
nextTick(function () {
++i;
cb(null, x + y);
});
return u;
};
mfn = t(fn, { async: true, primitive: true, refCounter: true });
a(mfn.deleteRef(3, 7), null, "Clear ref before");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #1");
}), u, "Initial");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #2");
}), u, "Initial #2");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Result B #1");
}), u, "Initial #2");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #3");
}), u, "Initial #2");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Result B #2");
}), u, "Initial #3");
nextTick(function () {
a(i, 2, "Called #2");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Again: Result");
}), u, "Again: Initial");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Again B: Result");
}), u, "Again B: Initial");
nextTick(function () {
a(i, 2, "Again Called #2");
a(mfn.deleteRef(3, 7), false, "Clear ref #1");
a(mfn.deleteRef(3, 7), false, "Clear ref #2");
a(mfn.deleteRef(3, 7), false, "Clear ref #3");
a(mfn.deleteRef(3, 7), true, "Clear ref Final");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Again: Result");
}), u, "Again: Initial");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Again B: Result");
}), u, "Again B: Initial");
nextTick(function () {
a(i, 3, "Call After clear");
d();
});
});
});
},
Error: function (a, d) {
var mfn, fn, u = {}, i = 0, e = new Error("Test");
fn = function (x, y, cb) {
nextTick(function () {
++i;
cb(e);
});
return u;
};
mfn = t(fn, { async: true, primitive: true });
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [e, undefined], "Result #1");
}), u, "Initial");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [e, undefined], "Result #2");
}), u, "Initial #2");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [e, undefined], "Result B #1");
}), u, "Initial #2");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [e, undefined], "Result #3");
}), u, "Initial #2");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [e, undefined], "Result B #2");
}), u, "Initial #3");
nextTick(function () {
a(i, 2, "Called #2");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [e, undefined], "Again: Result");
}), u, "Again: Initial");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [e, undefined], "Again B: Result");
}), u, "Again B: Initial");
nextTick(function () {
a(i, 4, "Again Called #2");
d();
});
});
}
}
},
MaxAge: {
Regular: {
Sync: function (a, d) {
var mfn, fn, i = 0;
fn = function (x, y) {
++i;
return x + y;
};
mfn = t(fn, { maxAge: 100 });
a(mfn(3, 7), 10, "Result #1");
a(i, 1, "Called #1");
a(mfn(3, 7), 10, "Result #2");
a(i, 1, "Called #2");
a(mfn(5, 8), 13, "Result B #1");
a(i, 2, "Called B #1");
a(mfn(3, 7), 10, "Result #3");
a(i, 2, "Called #3");
a(mfn(5, 8), 13, "Result B #2");
a(i, 2, "Called B #2");
setTimeout(function () {
a(mfn(3, 7), 10, "Result: Wait");
a(i, 2, "Called: Wait");
a(mfn(5, 8), 13, "Result: Wait B");
a(i, 2, "Called: Wait B");
setTimeout(function () {
a(mfn(3, 7), 10, "Result: Wait After");
a(i, 3, "Called: Wait After");
a(mfn(5, 8), 13, "Result: Wait After B");
a(i, 4, "Called: Wait After B");
a(mfn(3, 7), 10, "Result: Wait After #2");
a(i, 4, "Called: Wait After #2");
a(mfn(5, 8), 13, "Result: Wait After B #2");
a(i, 4, "Called: Wait After B #2");
d();
}, 100);
}, 20);
},
Async: function (a, d) {
var mfn, fn, u = {}, i = 0;
fn = function (x, y, cb) {
nextTick(function () {
++i;
cb(null, x + y);
});
return u;
};
mfn = t(fn, { async: true, maxAge: 100 });
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #1");
}), u, "Initial");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #2");
}), u, "Initial #2");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Result B #1");
}), u, "Initial #2");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #3");
}), u, "Initial #2");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Result B #2");
}), u, "Initial #3");
setTimeout(function () {
a(i, 2, "Called #2");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Again: Result");
}), u, "Again: Initial");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Again B: Result");
}), u, "Again B: Initial");
setTimeout(function () {
a(i, 2, "Again Called #2");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Again: Result");
}), u, "Again: Initial");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Again B: Result");
}), u, "Again B: Initial");
nextTick(function () {
a(i, 4, "Call After clear");
d();
});
}, 100);
}, 20);
}
},
Primitive: {
Sync: function (a, d) {
var mfn, fn, i = 0;
fn = function (x, y) {
++i;
return x + y;
};
mfn = t(fn, { primitive: true, maxAge: 100 });
a(mfn(3, 7), 10, "Result #1");
a(i, 1, "Called #1");
a(mfn(3, 7), 10, "Result #2");
a(i, 1, "Called #2");
a(mfn(5, 8), 13, "Result B #1");
a(i, 2, "Called B #1");
a(mfn(3, 7), 10, "Result #3");
a(i, 2, "Called #3");
a(mfn(5, 8), 13, "Result B #2");
a(i, 2, "Called B #2");
setTimeout(function () {
a(mfn(3, 7), 10, "Result: Wait");
a(i, 2, "Called: Wait");
a(mfn(5, 8), 13, "Result: Wait B");
a(i, 2, "Called: Wait B");
setTimeout(function () {
a(mfn(3, 7), 10, "Result: Wait After");
a(i, 3, "Called: Wait After");
a(mfn(5, 8), 13, "Result: Wait After B");
a(i, 4, "Called: Wait After B");
a(mfn(3, 7), 10, "Result: Wait After #2");
a(i, 4, "Called: Wait After #2");
a(mfn(5, 8), 13, "Result: Wait After B #2");
a(i, 4, "Called: Wait After B #2");
d();
}, 100);
}, 20);
},
Async: function (a, d) {
var mfn, fn, u = {}, i = 0;
fn = function (x, y, cb) {
nextTick(function () {
++i;
cb(null, x + y);
});
return u;
};
mfn = t(fn, { async: true, primitive: true, maxAge: 100 });
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #1");
}), u, "Initial");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #2");
}), u, "Initial #2");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Result B #1");
}), u, "Initial #2");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #3");
}), u, "Initial #2");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Result B #2");
}), u, "Initial #3");
setTimeout(function () {
a(i, 2, "Called #2");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Again: Result");
}), u, "Again: Initial");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Again B: Result");
}), u, "Again B: Initial");
setTimeout(function () {
a(i, 2, "Again Called #2");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Again: Result");
}), u, "Again: Initial");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Again B: Result");
}), u, "Again B: Initial");
nextTick(function () {
a(i, 4, "Call After clear");
d();
});
}, 100);
}, 20);
}
}
},
Max: {
Regular: {
Sync: function (a) {
var mfn, fn, i = 0;
fn = function (x, y) {
++i;
return x + y;
};
mfn = t(fn, { max: 3 });
a(mfn(3, 7), 10, "Result #1");
a(i, 1, "Called #1");
a(mfn(3, 7), 10, "Result #2");
a(i, 1, "Called #2");
a(mfn(5, 8), 13, "Result B #1");
a(i, 2, "Called B #1");
a(mfn(3, 7), 10, "Result #3");
a(i, 2, "Called #3");
a(mfn(5, 8), 13, "Result B #2");
a(i, 2, "Called B #2");
a(mfn(12, 4), 16, "Result C #1");
a(i, 3, "Called C #1");
a(mfn(3, 7), 10, "Result #4");
a(i, 3, "Called #4");
a(mfn(5, 8), 13, "Result B #3");
a(i, 3, "Called B #3");
a(mfn(77, 11), 88, "Result D #1"); // Clear 12, 4
a(i, 4, "Called D #1");
a(mfn(5, 8), 13, "Result B #4");
a(i, 4, "Called B #4");
a(mfn(12, 4), 16, "Result C #2"); // Clear 3, 7
a(i, 5, "Called C #2");
a(mfn(3, 7), 10, "Result #5"); // Clear 77, 11
a(i, 6, "Called #5");
a(mfn(77, 11), 88, "Result D #2"); // Clear 5, 8
a(i, 7, "Called D #2");
a(mfn(12, 4), 16, "Result C #3");
a(i, 7, "Called C #3");
a(mfn(5, 8), 13, "Result B #5"); // Clear 3, 7
a(i, 8, "Called B #5");
a(mfn(77, 11), 88, "Result D #3");
a(i, 8, "Called D #3");
mfn.delete(77, 11);
a(mfn(77, 11), 88, "Result D #4");
a(i, 9, "Called D #4");
mfn.clear();
a(mfn(5, 8), 13, "Result B #6");
a(i, 10, "Called B #6");
a(mfn(77, 11), 88, "Result D #5");
a(i, 11, "Called D #5");
},
Async: function (a, d) {
var mfn, fn, u = {}, i = 0;
fn = function (x, y, cb) {
nextTick(function () {
++i;
cb(null, x + y);
});
return u;
};
mfn = t(fn, { async: true, max: 3 });
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #1");
a(i, 1, "Called #1");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #2");
a(i, 1, "Called #2");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Result B #1");
a(i, 2, "Called B #1");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #3");
a(i, 2, "Called #3");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Result B #2");
a(i, 2, "Called B #2");
a(mfn(12, 4, function (err, res) {
a.deep([err, res], [null, 16], "Result C #1");
a(i, 3, "Called C #1");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #4");
a(i, 3, "Called #4");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Result B #3");
a(i, 3, "Called B #3");
a(mfn(77, 11, function (err, res) {
a.deep([err, res], [null, 88], "Result D #1");
a(i, 4, "Called D #1");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Result B #4");
a(i, 4, "Called B #4");
a(mfn(12, 4, function (err, res) {
a.deep([err, res], [null, 16], "Result C #2");
a(i, 5, "Called C #2");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #5");
a(i, 6, "Called #5");
a(mfn(77, 11, function (err, res) {
a.deep([err, res], [null, 88],
"Result D #2");
a(i, 7, "Called D #2");
a(mfn(12, 4, function (err, res) {
a.deep([err, res], [null, 16],
"Result C #3");
a(i, 7, "Called C #3");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13],
"Result B #5");
a(i, 8, "Called B #5");
a(mfn(77, 11, function (err, res) {
a.deep([err, res], [null, 88],
"Result D #3");
a(i, 8, "Called D #3");
mfn.delete(77, 11);
a(mfn(77, 11, function (err, res) {
a.deep([err, res], [null, 88],
"Result D #4");
a(i, 9, "Called D #4");
mfn.clear();
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13],
"Result B #6");
a(i, 10, "Called B #6");
a(mfn(77, 11,
function (err, res) {
a.deep([err, res], [null, 88],
"Result D #5");
a(i, 11, "Called D #5");
d();
}), u, "Initial D #5");
}), u, "Initial B #6");
}), u, "Initial D #4");
}), u, "Initial D #3");
}), u, "Initial B #5");
}), u, "Initial C #3");
}), u, "Initial D #2");
}), u, "Initial #5");
}), u, "Initial C #2");
}), u, "Initial B #4");
}), u, "Initial D #1");
}), u, "Initial B #3");
}), u, "Initial #4");
}), u, "Initial C #1");
}), u, "Initial B #2");
}), u, "Initial #3");
}), u, "Initial B #1");
}), u, "Initial #2");
}), u, "Initial #1");
}
},
Primitive: {
Sync: function (a) {
var mfn, fn, i = 0;
fn = function (x, y) {
++i;
return x + y;
};
mfn = t(fn, { primitive: true, max: 3 });
a(mfn(3, 7), 10, "Result #1");
a(i, 1, "Called #1");
a(mfn(3, 7), 10, "Result #2");
a(i, 1, "Called #2");
a(mfn(5, 8), 13, "Result B #1");
a(i, 2, "Called B #1");
a(mfn(3, 7), 10, "Result #3");
a(i, 2, "Called #3");
a(mfn(5, 8), 13, "Result B #2");
a(i, 2, "Called B #2");
a(mfn(12, 4), 16, "Result C #1");
a(i, 3, "Called C #1");
a(mfn(3, 7), 10, "Result #4");
a(i, 3, "Called #4");
a(mfn(5, 8), 13, "Result B #3");
a(i, 3, "Called B #3");
a(mfn(77, 11), 88, "Result D #1"); // Clear 12, 4
a(i, 4, "Called D #1");
a(mfn(5, 8), 13, "Result B #4");
a(i, 4, "Called B #4");
a(mfn(12, 4), 16, "Result C #2"); // Clear 3, 7
a(i, 5, "Called C #2");
a(mfn(3, 7), 10, "Result #5"); // Clear 77, 11
a(i, 6, "Called #5");
a(mfn(77, 11), 88, "Result D #2"); // Clear 5, 8
a(i, 7, "Called D #2");
a(mfn(12, 4), 16, "Result C #3");
a(i, 7, "Called C #3");
a(mfn(5, 8), 13, "Result B #5"); // Clear 3, 7
a(i, 8, "Called B #5");
a(mfn(77, 11), 88, "Result D #3");
a(i, 8, "Called D #3");
mfn.delete(77, 11);
a(mfn(77, 11), 88, "Result D #4");
a(i, 9, "Called D #4");
mfn.clear();
a(mfn(5, 8), 13, "Result B #6");
a(i, 10, "Called B #6");
a(mfn(77, 11), 88, "Result D #5");
a(i, 11, "Called D #5");
},
Async: function (a, d) {
var mfn, fn, u = {}, i = 0;
fn = function (x, y, cb) {
nextTick(function () {
++i;
cb(null, x + y);
});
return u;
};
mfn = t(fn, { async: true, primitive: true, max: 3 });
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #1");
a(i, 1, "Called #1");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #2");
a(i, 1, "Called #2");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Result B #1");
a(i, 2, "Called B #1");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #3");
a(i, 2, "Called #3");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Result B #2");
a(i, 2, "Called B #2");
a(mfn(12, 4, function (err, res) {
a.deep([err, res], [null, 16], "Result C #1");
a(i, 3, "Called C #1");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #4");
a(i, 3, "Called #4");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Result B #3");
a(i, 3, "Called B #3");
a(mfn(77, 11, function (err, res) {
a.deep([err, res], [null, 88], "Result D #1");
a(i, 4, "Called D #1");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13], "Result B #4");
a(i, 4, "Called B #4");
a(mfn(12, 4, function (err, res) {
a.deep([err, res], [null, 16], "Result C #2");
a(i, 5, "Called C #2");
a(mfn(3, 7, function (err, res) {
a.deep([err, res], [null, 10], "Result #5");
a(i, 6, "Called #5");
a(mfn(77, 11, function (err, res) {
a.deep([err, res], [null, 88],
"Result D #2");
a(i, 7, "Called D #2");
a(mfn(12, 4, function (err, res) {
a.deep([err, res], [null, 16],
"Result C #3");
a(i, 7, "Called C #3");
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13],
"Result B #5");
a(i, 8, "Called B #5");
a(mfn(77, 11, function (err, res) {
a.deep([err, res], [null, 88],
"Result D #3");
a(i, 8, "Called D #3");
mfn.delete(77, 11);
a(mfn(77, 11, function (err, res) {
a.deep([err, res], [null, 88],
"Result D #4");
a(i, 9, "Called D #4");
mfn.clear();
a(mfn(5, 8, function (err, res) {
a.deep([err, res], [null, 13],
"Result B #6");
a(i, 10, "Called B #6");
a(mfn(77, 11,
function (err, res) {
a.deep([err, res], [null, 88],
"Result D #5");
a(i, 11, "Called D #5");
d();
}), u, "Initial D #5");
}), u, "Initial B #6");
}), u, "Initial D #4");
}), u, "Initial D #3");
}), u, "Initial B #5");
}), u, "Initial C #3");
}), u, "Initial D #2");
}), u, "Initial #5");
}), u, "Initial C #2");
}), u, "Initial B #4");
}), u, "Initial D #1");
}), u, "Initial B #3");
}), u, "Initial #4");
}), u, "Initial C #1");
}), u, "Initial B #2");
}), u, "Initial #3");
}), u, "Initial B #1");
}), u, "Initial #2");
}), u, "Initial #1");
}
}
},
Dispose: {
Regular: {
Sync: function (a) {
var mfn, fn, value = [], x, invoked;
fn = function (x, y) { return x + y; };
mfn = t(fn, { dispose: function (val) { value.push(val); } });
mfn(3, 7);
mfn(5, 8);
mfn(12, 4);
a.deep(value, [], "Pre");
mfn.delete(5, 8);
a.deep(value, [13], "#1");
value = [];
mfn.delete(12, 4);
a.deep(value, [16], "#2");
value = [];
mfn(77, 11);
mfn.clear();
a.deep(value, [10, 88], "Clear all");
x = {};
invoked = false;
mfn = t(function () { return x; },
{ dispose: function (val) { invoked = val; } });
mfn.delete();
a(invoked, false, "No args: Post invalid clear");
mfn();
a(invoked, false, "No args: Post cache");
mfn.delete();
a(invoked, x, "No args: Pre clear");
},
"Ref counter": function (a) {
var mfn, fn, value = [];
fn = function (x, y) { return x + y; };
mfn = t(fn, { refCounter: true,
dispose: function (val) { value.push(val); } });
mfn(3, 7);
mfn(5, 8);
mfn(12, 4);
a.deep(value, [], "Pre");
mfn(5, 8);
mfn.deleteRef(5, 8);
a.deep(value, [], "Pre");
mfn.deleteRef(5, 8);
a.deep(value, [13], "#1");
value = [];
mfn.deleteRef(12, 4);
a.deep(value, [16], "#2");
value = [];
mfn(77, 11);
mfn.clear();
a.deep(value, [10, 88], "Clear all");
},
Async: function (a, d) {
var mfn, fn, u = {}, value = [];
fn = function (x, y, cb) {
nextTick(function () { cb(null, x + y); });
return u;
};
mfn = t(fn, { async: true,
dispose: function (val) { value.push(val); } });
mfn(3, 7, function () {
mfn(5, 8, function () {
mfn(12, 4, function () {
a.deep(value, [], "Pre");
mfn.delete(5, 8);
a.deep(value, [13], "#1");
value = [];
mfn.delete(12, 4);
a.deep(value, [16], "#2");
value = [];
mfn(77, 11, function () {
mfn.clear();
a.deep(value, [10, 88], "Clear all");
d();
});
});
});
});
}
},
Primitive: {
Sync: function (a) {
var mfn, fn, value = [];
fn = function (x, y) { return x + y; };
mfn = t(fn, { dispose: function (val) { value.push(val); } });
mfn(3, 7);
mfn(5, 8);
mfn(12, 4);
a.deep(value, [], "Pre");
mfn.delete(5, 8);
a.deep(value, [13], "#1");
value = [];
mfn.delete(12, 4);
a.deep(value, [16], "#2");
value = [];
mfn(77, 11);
mfn.clear();
a.deep(value, [10, 88], "Clear all");
},
"Ref counter": function (a) {
var mfn, fn, value = [];
fn = function (x, y) { return x + y; };
mfn = t(fn, { refCounter: true,
dispose: function (val) { value.push(val); } });
mfn(3, 7);
mfn(5, 8);
mfn(12, 4);
a.deep(value, [], "Pre");
mfn(5, 8);
mfn.deleteRef(5, 8);
a.deep(value, [], "Pre");
mfn.deleteRef(5, 8);
a.deep(value, [13], "#1");
value = [];
mfn.deleteRef(12, 4);
a.deep(value, [16], "#2");
value = [];
mfn(77, 11);
mfn.clear();
a.deep(value, [10, 88], "Clear all");
},
Async: function (a, d) {
var mfn, fn, u = {}, value = [];
fn = function (x, y, cb) {
nextTick(function () { cb(null, x + y); });
return u;
};
mfn = t(fn, { async: true,
dispose: function (val) { value.push(val); } });
mfn(3, 7, function () {
mfn(5, 8, function () {
mfn(12, 4, function () {
a.deep(value, [], "Pre");
mfn.delete(5, 8);
a.deep(value, [13], "#1");
value = [];
mfn.delete(12, 4);
a.deep(value, [16], "#2");
value = [];
mfn(77, 11, function () {
mfn.clear();
a.deep(value, [10, 88], "Clear all");
d();
});
});
});
});
}
}
}
};
};
| JoseGMaestre/appBase | node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/test/index.js | JavaScript | mit | 38,717 |
<?php
/*
* This file is part of the Monolog package.
*
* (c) 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 Monolog\Handler;
use Monolog\Logger;
class SyslogHandlerTest extends \PHPUnit_Framework_TestCase
{
/**
* @covers Monolog\Handler\SyslogHandler::__construct
*/
public function testConstruct()
{
$handler = new SyslogHandler('test');
$this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler);
$handler = new SyslogHandler('test', LOG_USER);
$this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler);
$handler = new SyslogHandler('test', 'user');
$this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler);
$handler = new SyslogHandler('test', LOG_USER, Logger::DEBUG, true, LOG_PERROR);
$this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler);
}
/**
* @covers Monolog\Handler\SyslogHandler::__construct
*/
public function testConstructInvalidFacility()
{
$this->setExpectedException('UnexpectedValueException');
$handler = new SyslogHandler('test', 'unknown');
}
}
| rafaelcpalmeida/lerolero | vendor/monolog/monolog/tests/Monolog/Handler/SyslogHandlerTest.php | PHP | mit | 1,283 |
<?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\Routing\Matcher\Dumper;
use Symfony\Component\Routing\Route;
/**
* Container for a Route.
*
* @author Arnaud Le Blanc <arnaud.lb@gmail.com>
*/
class DumperRoute
{
/**
* @var string
*/
private $name;
/**
* @var Route
*/
private $route;
/**
* Constructor.
*
* @param string $name The route name
* @param Route $route The route
*/
public function __construct($name, Route $route)
{
$this->name = $name;
$this->route = $route;
}
/**
* Returns the route name.
*
* @return string The route name
*/
public function getName()
{
return $this->name;
}
/**
* Returns the route.
*
* @return Route The route
*/
public function getRoute()
{
return $this->route;
}
}
| WojciechMichna/CalendarProject | vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/Dumper/DumperRoute.php | PHP | mit | 1,111 |
'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": [
"fm",
"em"
],
"DAY": [
"s\u00f6ndag",
"m\u00e5ndag",
"tisdag",
"onsdag",
"torsdag",
"fredag",
"l\u00f6rdag"
],
"MONTH": [
"januari",
"februari",
"mars",
"april",
"maj",
"juni",
"juli",
"augusti",
"september",
"oktober",
"november",
"december"
],
"SHORTDAY": [
"s\u00f6n",
"m\u00e5n",
"tis",
"ons",
"tors",
"fre",
"l\u00f6r"
],
"SHORTMONTH": [
"jan",
"feb",
"mar",
"apr",
"maj",
"jun",
"jul",
"aug",
"sep",
"okt",
"nov",
"dec"
],
"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": "y-MM-dd HH:mm",
"shortDate": "y-MM-dd",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "kr",
"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": "sv",
"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;}
});
}]); | redmunds/cdnjs | ajax/libs/angular.js/1.3.0-beta.17/i18n/angular-locale_sv.js | JavaScript | mit | 2,357 |
'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": [
"de.",
"du."
],
"DAY": [
"vas\u00e1rnap",
"h\u00e9tf\u0151",
"kedd",
"szerda",
"cs\u00fct\u00f6rt\u00f6k",
"p\u00e9ntek",
"szombat"
],
"MONTH": [
"janu\u00e1r",
"febru\u00e1r",
"m\u00e1rcius",
"\u00e1prilis",
"m\u00e1jus",
"j\u00fanius",
"j\u00falius",
"augusztus",
"szeptember",
"okt\u00f3ber",
"november",
"december"
],
"SHORTDAY": [
"V",
"H",
"K",
"Sze",
"Cs",
"P",
"Szo"
],
"SHORTMONTH": [
"jan.",
"febr.",
"m\u00e1rc.",
"\u00e1pr.",
"m\u00e1j.",
"j\u00fan.",
"j\u00fal.",
"aug.",
"szept.",
"okt.",
"nov.",
"dec."
],
"fullDate": "y. MMMM d., EEEE",
"longDate": "y. MMMM d.",
"medium": "y. MMM d. H:mm:ss",
"mediumDate": "y. MMM d.",
"mediumTime": "H:mm:ss",
"short": "y. MM. dd. H:mm",
"shortDate": "y. MM. dd.",
"shortTime": "H:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "Ft",
"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": "hu",
"pluralCat": function (n, opt_precision) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | zimbatm/cdnjs | ajax/libs/angular.js/1.3.0-beta.18/i18n/angular-locale_hu.js | JavaScript | mit | 2,065 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.