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
|
---|---|---|---|---|---|
'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": [
"atm",
"ptm"
],
"DAY": [
"diman\u0109o",
"lundo",
"mardo",
"merkredo",
"\u0135a\u016ddo",
"vendredo",
"sabato"
],
"ERANAMES": [
"aK",
"pK"
],
"ERAS": [
"aK",
"pK"
],
"FIRSTDAYOFWEEK": 0,
"MONTH": [
"januaro",
"februaro",
"marto",
"aprilo",
"majo",
"junio",
"julio",
"a\u016dgusto",
"septembro",
"oktobro",
"novembro",
"decembro"
],
"SHORTDAY": [
"di",
"lu",
"ma",
"me",
"\u0135a",
"ve",
"sa"
],
"SHORTMONTH": [
"jan",
"feb",
"mar",
"apr",
"maj",
"jun",
"jul",
"a\u016dg",
"sep",
"okt",
"nov",
"dec"
],
"STANDALONEMONTH": [
"januaro",
"februaro",
"marto",
"aprilo",
"majo",
"junio",
"julio",
"a\u016dgusto",
"septembro",
"oktobro",
"novembro",
"decembro"
],
"WEEKENDRANGE": [
5,
6
],
"fullDate": "EEEE, d-'a' 'de' MMMM y",
"longDate": "y-MMMM-dd",
"medium": "y-MMM-dd HH:mm:ss",
"mediumDate": "y-MMM-dd",
"mediumTime": "HH:mm:ss",
"short": "yy-MM-dd HH:mm",
"shortDate": "yy-MM-dd",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "$",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-\u00a4\u00a0",
"negSuf": "",
"posPre": "\u00a4\u00a0",
"posSuf": ""
}
]
},
"id": "eo",
"localeID": "eo",
"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;}
});
}]);
| shawnco/starfleet-staffing-services | assets/js/angular/i18n/angular-locale_eo.js | JavaScript | mit | 2,745 |
/*!
* iCheck v1.0.1, http://git.io/arlzeA
* =================================
* Powerful jQuery and Zepto plugin for checkboxes and radio buttons customization
*
* (c) 2013 Damir Sultanov, http://fronteed.com
* MIT Licensed
*/
(function($) {
// Cached vars
var _iCheck = 'iCheck',
_iCheckHelper = _iCheck + '-helper',
_checkbox = 'checkbox',
_radio = 'radio',
_checked = 'checked',
_unchecked = 'un' + _checked,
_disabled = 'disabled',
_determinate = 'determinate',
_indeterminate = 'in' + _determinate,
_update = 'update',
_type = 'type',
_click = 'click',
_touch = 'touchbegin.i touchend.i',
_add = 'addClass',
_remove = 'removeClass',
_callback = 'trigger',
_label = 'label',
_cursor = 'cursor',
_mobile = /ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);
// Plugin init
$.fn[_iCheck] = function(options, fire) {
// Walker
var handle = 'input[type="' + _checkbox + '"], input[type="' + _radio + '"]',
stack = $(),
walker = function(object) {
object.each(function() {
var self = $(this);
if (self.is(handle)) {
stack = stack.add(self);
} else {
stack = stack.add(self.find(handle));
}
});
};
// Check if we should operate with some method
if (/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(options)) {
// Normalize method's name
options = options.toLowerCase();
// Find checkboxes and radio buttons
walker(this);
return stack.each(function() {
var self = $(this);
if (options == 'destroy') {
tidy(self, 'ifDestroyed');
} else {
operate(self, true, options);
}
// Fire method's callback
if ($.isFunction(fire)) {
fire();
}
});
// Customization
} else if (typeof options == 'object' || !options) {
// Check if any options were passed
var settings = $.extend({
checkedClass: _checked,
disabledClass: _disabled,
indeterminateClass: _indeterminate,
labelHover: true,
aria: false
}, options),
selector = settings.handle,
hoverClass = settings.hoverClass || 'hover',
focusClass = settings.focusClass || 'focus',
activeClass = settings.activeClass || 'active',
labelHover = !!settings.labelHover,
labelHoverClass = settings.labelHoverClass || 'hover',
// Setup clickable area
area = ('' + settings.increaseArea).replace('%', '') | 0;
// Selector limit
if (selector == _checkbox || selector == _radio) {
handle = 'input[type="' + selector + '"]';
}
// Clickable area limit
if (area < -50) {
area = -50;
}
// Walk around the selector
walker(this);
return stack.each(function() {
var self = $(this);
// If already customized
tidy(self);
var node = this,
id = node.id,
// Layer styles
offset = -area + '%',
size = 100 + (area * 2) + '%',
layer = {
position: 'absolute',
top: offset,
left: offset,
display: 'block',
width: size,
height: size,
margin: 0,
padding: 0,
background: '#fff',
border: 0,
opacity: 0
},
// Choose how to hide input
hide = _mobile ? {
position: 'absolute',
visibility: 'hidden'
} : area ? layer : {
position: 'absolute',
opacity: 0
},
// Get proper class
className = node[_type] == _checkbox ? settings.checkboxClass || 'i' + _checkbox : settings.radioClass || 'i' + _radio,
// Find assigned labels
label = $(_label + '[for="' + id + '"]').add(self.closest(_label)),
// Check ARIA option
aria = !!settings.aria,
// Set ARIA placeholder
ariaID = _iCheck + '-' + Math.random().toString(36).replace('0.', ''),
// Parent & helper
parent = '<div class="' + className + '" ' + (aria ? 'role="' + node[_type] + '" ' : ''),
helper;
// Set ARIA "labelledby"
if (label.length && aria) {
label.each(function() {
parent += 'aria-labelledby="';
if (this.id) {
parent += this.id;
} else {
this.id = ariaID;
parent += ariaID;
}
parent += '"';
});
}
// Wrap input
parent = self.wrap(parent + '/>')[_callback]('ifCreated').parent().append(settings.insert);
// Layer addition
helper = $('<ins class="' + _iCheckHelper + '"/>').css(layer).appendTo(parent);
// Finalize customization
self.data(_iCheck, {o: settings, s: self.attr('style')}).css(hide);
!!settings.inheritClass && parent[_add](node.className || '');
!!settings.inheritID && id && parent.attr('id', _iCheck + '-' + id);
parent.css('position') == 'static' && parent.css('position', 'relative');
operate(self, true, _update);
// Label events
if (label.length) {
label.on(_click + '.i mouseover.i mouseout.i ' + _touch, function(event) {
var type = event[_type],
item = $(this);
// Do nothing if input is disabled
if (!node[_disabled]) {
// Click
if (type == _click) {
if ($(event.target).is('a')) {
return;
}
operate(self, false, true);
// Hover state
} else if (labelHover) {
// mouseout|touchend
if (/ut|nd/.test(type)) {
parent[_remove](hoverClass);
item[_remove](labelHoverClass);
} else {
parent[_add](hoverClass);
item[_add](labelHoverClass);
}
}
if (_mobile) {
event.stopPropagation();
} else {
return false;
}
}
});
}
// Input events
self.on(_click + '.i focus.i blur.i keyup.i keydown.i keypress.i', function(event) {
var type = event[_type],
key = event.keyCode;
// Click
if (type == _click) {
return false;
// Keydown
} else if (type == 'keydown' && key == 32) {
if (!(node[_type] == _radio && node[_checked])) {
if (node[_checked]) {
off(self, _checked);
} else {
on(self, _checked);
}
}
return false;
// Keyup
} else if (type == 'keyup' && node[_type] == _radio) {
!node[_checked] && on(self, _checked);
// Focus/blur
} else if (/us|ur/.test(type)) {
parent[type == 'blur' ? _remove : _add](focusClass);
}
});
// Helper events
helper.on(_click + ' mousedown mouseup mouseover mouseout ' + _touch, function(event) {
var type = event[_type],
// mousedown|mouseup
toggle = /wn|up/.test(type) ? activeClass : hoverClass;
// Do nothing if input is disabled
if (!node[_disabled]) {
// Click
if (type == _click) {
operate(self, false, true);
// Active and hover states
} else {
// State is on
if (/wn|er|in/.test(type)) {
// mousedown|mouseover|touchbegin
parent[_add](toggle);
// State is off
} else {
parent[_remove](toggle + ' ' + activeClass);
}
// Label hover
if (label.length && labelHover && toggle == hoverClass) {
// mouseout|touchend
label[/ut|nd/.test(type) ? _remove : _add](labelHoverClass);
}
}
if (_mobile) {
event.stopPropagation();
} else {
return false;
}
}
});
});
} else {
return this;
}
};
// Do something with inputs
function operate(input, direct, method) {
var node = input[0],
state = /er/.test(method) ? _indeterminate : /bl/.test(method) ? _disabled : _checked,
active = method == _update ? {
checked: node[_checked],
disabled: node[_disabled],
indeterminate: input.attr(_indeterminate) == 'true' || input.attr(_determinate) == 'false'
} : node[state];
// Check, disable or indeterminate
if (/^(ch|di|in)/.test(method) && !active) {
on(input, state);
// Uncheck, enable or determinate
} else if (/^(un|en|de)/.test(method) && active) {
off(input, state);
// Update
} else if (method == _update) {
// Handle states
for (var state in active) {
if (active[state]) {
on(input, state, true);
} else {
off(input, state, true);
}
}
} else if (!direct || method == 'toggle') {
// Helper or label was clicked
if (!direct) {
input[_callback]('ifClicked');
}
// Toggle checked state
if (active) {
if (node[_type] !== _radio) {
off(input, state);
}
} else {
on(input, state);
}
}
}
// Add checked, disabled or indeterminate state
function on(input, state, keep) {
var node = input[0],
parent = input.parent(),
checked = state == _checked,
indeterminate = state == _indeterminate,
disabled = state == _disabled,
callback = indeterminate ? _determinate : checked ? _unchecked : 'enabled',
regular = option(input, callback + capitalize(node[_type])),
specific = option(input, state + capitalize(node[_type]));
// Prevent unnecessary actions
if (node[state] !== true) {
// Toggle assigned radio buttons
if (!keep && state == _checked && node[_type] == _radio && node.name) {
var form = input.closest('form'),
inputs = 'input[name="' + node.name + '"]';
inputs = form.length ? form.find(inputs) : $(inputs);
inputs.each(function() {
if (this !== node && $(this).data(_iCheck)) {
off($(this), state);
}
});
}
// Indeterminate state
if (indeterminate) {
// Add indeterminate state
node[state] = true;
// Remove checked state
if (node[_checked]) {
off(input, _checked, 'force');
}
// Checked or disabled state
} else {
// Add checked or disabled state
if (!keep) {
node[state] = true;
}
// Remove indeterminate state
if (checked && node[_indeterminate]) {
off(input, _indeterminate, false);
}
}
// Trigger callbacks
callbacks(input, checked, state, keep);
}
// Add proper cursor
if (node[_disabled] && !!option(input, _cursor, true)) {
parent.find('.' + _iCheckHelper).css(_cursor, 'default');
}
// Add state class
parent[_add](specific || option(input, state) || '');
// Set ARIA attribute
disabled ? parent.attr('aria-disabled', 'true') : parent.attr('aria-checked', indeterminate ? 'mixed' : 'true');
// Remove regular state class
parent[_remove](regular || option(input, callback) || '');
}
// Remove checked, disabled or indeterminate state
function off(input, state, keep) {
var node = input[0],
parent = input.parent(),
checked = state == _checked,
indeterminate = state == _indeterminate,
disabled = state == _disabled,
callback = indeterminate ? _determinate : checked ? _unchecked : 'enabled',
regular = option(input, callback + capitalize(node[_type])),
specific = option(input, state + capitalize(node[_type]));
// Prevent unnecessary actions
if (node[state] !== false) {
// Toggle state
if (indeterminate || !keep || keep == 'force') {
node[state] = false;
}
// Trigger callbacks
callbacks(input, checked, callback, keep);
}
// Add proper cursor
if (!node[_disabled] && !!option(input, _cursor, true)) {
parent.find('.' + _iCheckHelper).css(_cursor, 'pointer');
}
// Remove state class
parent[_remove](specific || option(input, state) || '');
// Set ARIA attribute
disabled ? parent.attr('aria-disabled', 'false') : parent.attr('aria-checked', 'false');
// Add regular state class
parent[_add](regular || option(input, callback) || '');
}
// Remove all traces
function tidy(input, callback) {
if (input.data(_iCheck)) {
// Remove everything except input
input.parent().html(input.attr('style', input.data(_iCheck).s || ''));
// Callback
if (callback) {
input[_callback](callback);
}
// Unbind events
input.off('.i').unwrap();
$(_label + '[for="' + input[0].id + '"]').add(input.closest(_label)).off('.i');
}
}
// Get some option
function option(input, state, regular) {
if (input.data(_iCheck)) {
return input.data(_iCheck).o[state + (regular ? '' : 'Class')];
}
}
// Capitalize some string
function capitalize(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
// Executable handlers
function callbacks(input, checked, callback, keep) {
if (!keep) {
if (checked) {
input[_callback]('ifToggled');
}
input[_callback]('ifChanged')[_callback]('if' + capitalize(callback));
}
}
})(window.jQuery || window.Zepto);
| freddy94000/rodec | bower_components/admin-lte/plugins/iCheck/icheck.js | JavaScript | mit | 14,161 |
.cm-s-rubyblue.CodeMirror { background: #112435; color: white; }
.cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; }
.cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; }
.cm-s-rubyblue .CodeMirror-guttermarker { color: white; }
.cm-s-rubyblue .CodeMirror-guttermarker-subtle { color: #3E7087; }
.cm-s-rubyblue .CodeMirror-linenumber { color: white; }
.cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; }
.cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; }
.cm-s-rubyblue span.cm-atom { color: #F4C20B; }
.cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; }
.cm-s-rubyblue span.cm-keyword { color: #F0F; }
.cm-s-rubyblue span.cm-string { color: #F08047; }
.cm-s-rubyblue span.cm-meta { color: #F0F; }
.cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; }
.cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; }
.cm-s-rubyblue span.cm-bracket { color: #F0F; }
.cm-s-rubyblue span.cm-link { color: #F4C20B; }
.cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; }
.cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; }
.cm-s-rubyblue span.cm-error { color: #AF2018; }
.cm-s-rubyblue .CodeMirror-activeline-background {background: #173047 !important;}
| senekis/cdnjs | ajax/libs/codemirror/4.5.0/theme/rubyblue.css | CSS | mit | 1,402 |
import { Observable } from '../Observable';
import { isArray } from '../util/isArray';
import { ArrayObservable } from '../observable/ArrayObservable';
import { Operator } from '../Operator';
import { Subscriber } from '../Subscriber';
import { Subscription, TeardownLogic } from '../Subscription';
import { OuterSubscriber } from '../OuterSubscriber';
import { InnerSubscriber } from '../InnerSubscriber';
import { subscribeToResult } from '../util/subscribeToResult';
/* tslint:disable:max-line-length */
export function race<T>(this: Observable<T>, ...observables: Array<Observable<T> | Array<Observable<T>>>): Observable<T>;
export function race<T, R>(this: Observable<T>, ...observables: Array<Observable<any> | Array<Observable<T>>>): Observable<R>;
/* tslint:disable:max-line-length */
/**
* Returns an Observable that mirrors the first source Observable to emit an item
* from the combination of this Observable and supplied Observables
* @param {...Observables} ...observables sources used to race for which Observable emits first.
* @return {Observable} an Observable that mirrors the output of the first Observable to emit an item.
* @method race
* @owner Observable
*/
export function race<T>(this: Observable<T>, ...observables: Array<Observable<T> | Array<Observable<T>>>): Observable<T> {
// if the only argument is an array, it was most likely called with
// `pair([obs1, obs2, ...])`
if (observables.length === 1 && isArray(observables[0])) {
observables = <Array<Observable<T>>>observables[0];
}
return this.lift.call(raceStatic<T>(this, ...observables));
}
/**
* Returns an Observable that mirrors the first source Observable to emit an item.
* @param {...Observables} ...observables sources used to race for which Observable emits first.
* @return {Observable} an Observable that mirrors the output of the first Observable to emit an item.
* @static true
* @name race
* @owner Observable
*/
export function raceStatic<T>(...observables: Array<Observable<T> | Array<Observable<T>>>): Observable<T>;
export function raceStatic<T>(...observables: Array<Observable<any> | Array<Observable<any>>>): Observable<T> {
// if the only argument is an array, it was most likely called with
// `pair([obs1, obs2, ...])`
if (observables.length === 1) {
if (isArray(observables[0])) {
observables = <Array<Observable<any>>>observables[0];
} else {
return <Observable<any>>observables[0];
}
}
return new ArrayObservable<T>(<any>observables).lift(new RaceOperator<T>());
}
export class RaceOperator<T> implements Operator<T, T> {
call(subscriber: Subscriber<T>, source: any): TeardownLogic {
return source.subscribe(new RaceSubscriber(subscriber));
}
}
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
export class RaceSubscriber<T> extends OuterSubscriber<T, T> {
private hasFirst: boolean = false;
private observables: Observable<any>[] = [];
private subscriptions: Subscription[] = [];
constructor(destination: Subscriber<T>) {
super(destination);
}
protected _next(observable: any): void {
this.observables.push(observable);
}
protected _complete() {
const observables = this.observables;
const len = observables.length;
if (len === 0) {
this.destination.complete();
} else {
for (let i = 0; i < len && !this.hasFirst; i++) {
let observable = observables[i];
let subscription = subscribeToResult(this, observable, observable, i);
if (this.subscriptions) {
this.subscriptions.push(subscription);
}
this.add(subscription);
}
this.observables = null;
}
}
notifyNext(outerValue: T, innerValue: T,
outerIndex: number, innerIndex: number,
innerSub: InnerSubscriber<T, T>): void {
if (!this.hasFirst) {
this.hasFirst = true;
for (let i = 0; i < this.subscriptions.length; i++) {
if (i !== outerIndex) {
let subscription = this.subscriptions[i];
subscription.unsubscribe();
this.remove(subscription);
}
}
this.subscriptions = null;
}
this.destination.next(innerValue);
}
}
| choy1379/MoonEDM | node_modules/rxjs/src/operator/race.ts | TypeScript | mit | 4,234 |
tinyMCE.addI18n('gl.advlink_dlg',{"target_name":"Nome do obxetivo",classes:"Clases",style:"Estilo",id:"Id","popup_position":"Posici\u00f3n (X/Y)",langdir:"Direcci\u00f3n da lenguaxe","popup_size":"Tama\u00f1o","popup_dependent":"Dependentes (s\u00f3lo Mozilla/Firefox)","popup_resizable":"Permitir cambia-lo tama\u00f1o da vent\u00e1","popup_location":"Barra de localizaci\u00f3n","popup_menubar":"Barra de men\u00fa","popup_toolbar":"Barra de ferramentas","popup_statusbar":"Barra de estado","popup_scrollbars":"Barras de desprazamento","popup_return":"Insertar \'return false\'","popup_name":"Nome da vent\u00e1","popup_url":"URL da vent\u00e1 emerxente",popup:"Javascript popup","target_blank":"Abrir en vent\u00e1 nova","target_top":"Abrir no marco superior (reemplaza todo-los marcos)","target_parent":"Abrir na vent\u00e1 / marco padre","target_same":"Abrir nesta vent\u00e1 / marco","anchor_names":"\u00c1ncoras","popup_opts":"Opci\u00f3ns","advanced_props":"Propiedades avanzadas","event_props":"Eventos","popup_props":"Propiedades de vent\u00e1s emerxentes","general_props":"Propiedades xerales","advanced_tab":"Avanzado","events_tab":"Eventos","popup_tab":"Ventana emerxente","general_tab":"Xeral",list:"Lista de v\u00ednculos","is_external":"A URL introducida semella ser un v\u00ednculo externo, \u00bfDesexa engadi-lo prefixo necesario http://?","is_email":"A URL introducida semella ser un enderezo de e-mail, \u00bfDesexa engadi-lo prefixo necesario mailto:?",titlefield:"T\u00edtulo",target:"Destino",url:"URL do hiperv\u00ednculo",title:"Insertar/editar hiperv\u00ednculo","link_list":"Lista de v\u00ednculo",rtl:"Dereita a esquerda",ltr:"Esquerda a dereita",accesskey:"Tecla de acceso",tabindex:"\u00cdndice de tabulaci\u00f3n",rev:"Relaci\u00f3n obxetivo a p\u00e1xina",rel:"Relaci\u00f3n p\u00e1xina a obxetivo",mime:"Tipo MIME do obxetivo",encoding:"Codificaci\u00f3n de caracteres do obxetivo",langcode:"C\u00f3digo da lenguaxe","target_langcode":"Lenguaxe do obxetivo",width:"Width",height:"Height"}); | ezekielriva/Area4Kernel | web/bundles/stfalcontinymce/vendor/tiny_mce/plugins/advlink/langs/gl_dlg.js | JavaScript | mit | 2,024 |
!function(t,e){"use strict";function n(){var t=document.querySelector(".app-active");null!==t.querySelector("div.backdrop-popover")&&t.removeChild(a),l.style.visibility="hidden",l=null}function i(e,n){if(void 0===n&&(n="left"),c=!0,e.style.visibility="visible",e.querySelector("ul").scrollTop=0,l=e,!e.classList.contains("active")){var i=document.querySelector(".app-page.app-active"),o=i.currentStyle||t.getComputedStyle(i);if("title"===n||"title-left"===n){var r=i.querySelector(".header-bar");e.style.top=r.offsetHeight+"px","title"===n?e.style.left=r.clientWidth/2+parseInt(o.marginLeft)-e.clientWidth/2+"px":e.style.left=16+parseInt(o.marginLeft)+"px"}else if("left"===n||"right"===n)e.style.top="12px","left"===n?e.style.left=16+parseInt(o.marginLeft)+"px":(e.style.left="auto",e.style.right="16px");else{var s=document.querySelector('.btn-popover[data-popover-id="'+e.id+'"]'),d=s.getBoundingClientRect();e.style.width=s.clientWidth+"px",e.style.top=d.top+"px",e.style.left=d.left+"px"}e.classList.contains("active")||e.classList.add("active"),i.appendChild(a)}}function o(e){c=!1,l=e,e.classList.contains("active")&&(e.classList.toggle("active"),t.setTimeout(function(){n()},250))}var r=!1,l=null,c=!1,a=document.createElement("div");a.classList.add("backdrop-popover");var s=function(t){for(var e={target:null,id:null,direction:null};t&&t!==document;t=t.parentNode){var n=t.getAttribute("data-popover-id");if(null!==n){e.target=t,e.id=n,e.direction="left",!t.classList.contains("title")&&t.classList.contains("pull-left")?e.direction="left":!t.classList.contains("title")&&t.parentNode.classList.contains("pull-left")?e.direction="left":t.classList.contains("title")&&t.classList.contains("pull-left")?e.direction="title-left":t.parentNode&&t.parentNode.classList.contains("pull-left")&&t.classList.contains("title")?e.direction="title-left":t.classList.contains("pull-right")?e.direction="right":t.parentNode&&t.parentNode.classList.contains("pull-right")?e.direction="right":t.classList.contains("center")?e.direction="title":t.parentNode&&t.parentNode.classList.contains("center")?e.direction="title":e.direction="button";break}}return e},d=function(t){for(var e,n=document.querySelectorAll(".popover");t&&t!==document;t=t.parentNode)for(e=n.length;e--;)if(n[e]===t&&t.classList.contains("active"))return t},u=function(t){for(;t&&t!==document;t=t.parentNode)if(t===l)return!0;return!1};document.on(e.event.start,function(t){t=t.originalEvent||t;var e=d(t.target);!e&&c&&o(l),r=!1}),document.on(e.event.move,function(t){t=t.originalEvent||t,r=!0}),document.on(e.event.end,function(t){var e=t.target,n=s(e);if(n.target){var c=document.querySelector("#"+n.id);c&&(c.classList.contains("active")&&!r?o(c):i(c,n.direction))}if(null!==e.parentNode&&u(e)&&!r){o(l),t=new CustomEvent("itemchanged",{detail:{item:e.textContent,target:t.target},bubbles:!0,cancelable:!0});for(var a=document.querySelectorAll('[data-popover-id="'+l.id+'"]'),d=a.length-1;d>=0;d--){var n=a[d];"true"===n.getAttribute("data-autobind")&&("textContent"in n?n.textContent=e.textContent:n.innerText=e.innerText)}l.dispatchEvent(t)}}),e.popover=function(t){if("undefined"==typeof t)return{closeActive:function(){var t=!!l;return t&&o(l),t}};var e="string"==typeof t?document.querySelector(t):t;if(null===e)throw new Error("The popover with ID "+t+" does not exist");return{open:function(){i(e)},close:function(){o(e)}}},t.phonon=e,"object"==typeof exports?module.exports=e.popover:"function"==typeof define&&define.amd&&define(function(){return e.popover})}("undefined"!=typeof window?window:this,window.phonon||{}); | wout/cdnjs | ajax/libs/PhononJs/1.2.2/js/components/popovers.min.js | JavaScript | mit | 3,593 |
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
describe "Module#>=" do
it "returns true if self is a superclass of, the same as or included by given module" do
(ModuleSpecs::Parent >= ModuleSpecs::Child).should == true
(ModuleSpecs::Basic >= ModuleSpecs::Child).should == true
(ModuleSpecs::Super >= ModuleSpecs::Child).should == true
(ModuleSpecs::Basic >= ModuleSpecs::Super).should == true
(ModuleSpecs::Child >= ModuleSpecs::Child).should == true
(ModuleSpecs::Parent >= ModuleSpecs::Parent).should == true
(ModuleSpecs::Basic >= ModuleSpecs::Basic).should == true
(ModuleSpecs::Super >= ModuleSpecs::Super).should == true
end
it "returns nil if self is not related to the given module" do
(ModuleSpecs::Parent >= ModuleSpecs::Basic).should == nil
(ModuleSpecs::Parent >= ModuleSpecs::Super).should == nil
(ModuleSpecs::Basic >= ModuleSpecs::Parent).should == nil
(ModuleSpecs::Super >= ModuleSpecs::Parent).should == nil
end
it "returns false if self is a subclass of or includes the given module" do
(ModuleSpecs::Child >= ModuleSpecs::Parent).should == false
(ModuleSpecs::Child >= ModuleSpecs::Basic).should == false
(ModuleSpecs::Child >= ModuleSpecs::Super).should == false
(ModuleSpecs::Super >= ModuleSpecs::Basic).should == false
end
it "raises a TypeError if the argument is not a class/module" do
lambda { ModuleSpecs::Parent >= mock('x') }.should raise_error(TypeError)
end
end
| MagLev/rubyspec | core/module/gte_spec.rb | Ruby | mit | 1,560 |
# -*- coding: utf-8 -*-
"""
flask.jsonimpl
~~~~~~~~~~~~~~
Implementation helpers for the JSON support in Flask.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import io
import uuid
from datetime import date
from .globals import current_app, request
from ._compat import text_type, PY2
from werkzeug.http import http_date
from jinja2 import Markup
# Use the same json implementation as itsdangerous on which we
# depend anyways.
from itsdangerous import json as _json
# Figure out if simplejson escapes slashes. This behavior was changed
# from one version to another without reason.
_slash_escape = '\\/' not in _json.dumps('/')
__all__ = ['dump', 'dumps', 'load', 'loads', 'htmlsafe_dump',
'htmlsafe_dumps', 'JSONDecoder', 'JSONEncoder',
'jsonify']
def _wrap_reader_for_text(fp, encoding):
if isinstance(fp.read(0), bytes):
fp = io.TextIOWrapper(io.BufferedReader(fp), encoding)
return fp
def _wrap_writer_for_text(fp, encoding):
try:
fp.write('')
except TypeError:
fp = io.TextIOWrapper(fp, encoding)
return fp
class JSONEncoder(_json.JSONEncoder):
"""The default Flask JSON encoder. This one extends the default simplejson
encoder by also supporting ``datetime`` objects, ``UUID`` as well as
``Markup`` objects which are serialized as RFC 822 datetime strings (same
as the HTTP date format). In order to support more data types override the
:meth:`default` method.
"""
def default(self, o):
"""Implement this method in a subclass such that it returns a
serializable object for ``o``, or calls the base implementation (to
raise a :exc:`TypeError`).
For example, to support arbitrary iterators, you could implement
default like this::
def default(self, o):
try:
iterable = iter(o)
except TypeError:
pass
else:
return list(iterable)
return JSONEncoder.default(self, o)
"""
if isinstance(o, date):
return http_date(o.timetuple())
if isinstance(o, uuid.UUID):
return str(o)
if hasattr(o, '__html__'):
return text_type(o.__html__())
return _json.JSONEncoder.default(self, o)
class JSONDecoder(_json.JSONDecoder):
"""The default JSON decoder. This one does not change the behavior from
the default simplejson decoder. Consult the :mod:`json` documentation
for more information. This decoder is not only used for the load
functions of this module but also :attr:`~flask.Request`.
"""
def _dump_arg_defaults(kwargs):
"""Inject default arguments for dump functions."""
if current_app:
kwargs.setdefault('cls', current_app.json_encoder)
if not current_app.config['JSON_AS_ASCII']:
kwargs.setdefault('ensure_ascii', False)
kwargs.setdefault('sort_keys', current_app.config['JSON_SORT_KEYS'])
else:
kwargs.setdefault('sort_keys', True)
kwargs.setdefault('cls', JSONEncoder)
def _load_arg_defaults(kwargs):
"""Inject default arguments for load functions."""
if current_app:
kwargs.setdefault('cls', current_app.json_decoder)
else:
kwargs.setdefault('cls', JSONDecoder)
def dumps(obj, **kwargs):
"""Serialize ``obj`` to a JSON formatted ``str`` by using the application's
configured encoder (:attr:`~flask.Flask.json_encoder`) if there is an
application on the stack.
This function can return ``unicode`` strings or ascii-only bytestrings by
default which coerce into unicode strings automatically. That behavior by
default is controlled by the ``JSON_AS_ASCII`` configuration variable
and can be overridden by the simplejson ``ensure_ascii`` parameter.
"""
_dump_arg_defaults(kwargs)
encoding = kwargs.pop('encoding', None)
rv = _json.dumps(obj, **kwargs)
if encoding is not None and isinstance(rv, text_type):
rv = rv.encode(encoding)
return rv
def dump(obj, fp, **kwargs):
"""Like :func:`dumps` but writes into a file object."""
_dump_arg_defaults(kwargs)
encoding = kwargs.pop('encoding', None)
if encoding is not None:
fp = _wrap_writer_for_text(fp, encoding)
_json.dump(obj, fp, **kwargs)
def loads(s, **kwargs):
"""Unserialize a JSON object from a string ``s`` by using the application's
configured decoder (:attr:`~flask.Flask.json_decoder`) if there is an
application on the stack.
"""
_load_arg_defaults(kwargs)
if isinstance(s, bytes):
s = s.decode(kwargs.pop('encoding', None) or 'utf-8')
return _json.loads(s, **kwargs)
def load(fp, **kwargs):
"""Like :func:`loads` but reads from a file object.
"""
_load_arg_defaults(kwargs)
if not PY2:
fp = _wrap_reader_for_text(fp, kwargs.pop('encoding', None) or 'utf-8')
return _json.load(fp, **kwargs)
def htmlsafe_dumps(obj, **kwargs):
"""Works exactly like :func:`dumps` but is safe for use in ``<script>``
tags. It accepts the same arguments and returns a JSON string. Note that
this is available in templates through the ``|tojson`` filter which will
also mark the result as safe. Due to how this function escapes certain
characters this is safe even if used outside of ``<script>`` tags.
The following characters are escaped in strings:
- ``<``
- ``>``
- ``&``
- ``'``
This makes it safe to embed such strings in any place in HTML with the
notable exception of double quoted attributes. In that case single
quote your attributes or HTML escape it in addition.
.. versionchanged:: 0.10
This function's return value is now always safe for HTML usage, even
if outside of script tags or if used in XHTML. This rule does not
hold true when using this function in HTML attributes that are double
quoted. Always single quote attributes if you use the ``|tojson``
filter. Alternatively use ``|tojson|forceescape``.
"""
rv = dumps(obj, **kwargs) \
.replace(u'<', u'\\u003c') \
.replace(u'>', u'\\u003e') \
.replace(u'&', u'\\u0026') \
.replace(u"'", u'\\u0027')
if not _slash_escape:
rv = rv.replace('\\/', '/')
return rv
def htmlsafe_dump(obj, fp, **kwargs):
"""Like :func:`htmlsafe_dumps` but writes into a file object."""
fp.write(text_type(htmlsafe_dumps(obj, **kwargs)))
def jsonify(*args, **kwargs):
"""This function wraps :func:`dumps` to add a few enhancements that make
life easier. It turns the JSON output into a :class:`~flask.Response`
object with the :mimetype:`application/json` mimetype. For convenience, it
also converts multiple arguments into an array or multiple keyword arguments
into a dict. This means that both ``jsonify(1,2,3)`` and
``jsonify([1,2,3])`` serialize to ``[1,2,3]``.
For clarity, the JSON serialization behavior has the following differences
from :func:`dumps`:
1. Single argument: Passed straight through to :func:`dumps`.
2. Multiple arguments: Converted to an array before being passed to
:func:`dumps`.
3. Multiple keyword arguments: Converted to a dict before being passed to
:func:`dumps`.
4. Both args and kwargs: Behavior undefined and will throw an exception.
Example usage::
from flask import jsonify
@app.route('/_get_current_user')
def get_current_user():
return jsonify(username=g.user.username,
email=g.user.email,
id=g.user.id)
This will send a JSON response like this to the browser::
{
"username": "admin",
"email": "admin@localhost",
"id": 42
}
.. versionchanged:: 0.11
Added support for serializing top-level arrays. This introduces a
security risk in ancient browsers. See :ref:`json-security` for details.
This function's response will be pretty printed if it was not requested
with ``X-Requested-With: XMLHttpRequest`` to simplify debugging unless
the ``JSONIFY_PRETTYPRINT_REGULAR`` config parameter is set to false.
Compressed (not pretty) formatting currently means no indents and no
spaces after separators.
.. versionadded:: 0.2
"""
indent = None
separators = (',', ':')
if current_app.config['JSONIFY_PRETTYPRINT_REGULAR'] and not request.is_xhr:
indent = 2
separators = (', ', ': ')
if args and kwargs:
raise TypeError('jsonify() behavior undefined when passed both args and kwargs')
elif len(args) == 1: # single args are passed directly to dumps()
data = args[0]
else:
data = args or kwargs
return current_app.response_class(
(dumps(data, indent=indent, separators=separators), '\n'),
mimetype=current_app.config['JSONIFY_MIMETYPE']
)
def tojson_filter(obj, **kwargs):
return Markup(htmlsafe_dumps(obj, **kwargs))
| burzillibus/RobHome | venv/lib/python2.7/site-packages/flask/json.py | Python | mit | 9,183 |
<?php
/**
* Theme Installer List Table class.
*
* @package WordPress
* @subpackage List_Table
* @since 3.1.0
* @access private
*/
class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
var $features = array();
function ajax_user_can() {
return current_user_can( 'install_themes' );
}
function prepare_items() {
include( ABSPATH . 'wp-admin/includes/theme-install.php' );
global $tabs, $tab, $paged, $type, $theme_field_defaults;
wp_reset_vars( array( 'tab' ) );
$search_terms = array();
$search_string = '';
if ( ! empty( $_REQUEST['s'] ) ){
$search_string = strtolower( wp_unslash( $_REQUEST['s'] ) );
$search_terms = array_unique( array_filter( array_map( 'trim', explode( ',', $search_string ) ) ) );
}
if ( ! empty( $_REQUEST['features'] ) )
$this->features = $_REQUEST['features'];
$paged = $this->get_pagenum();
$per_page = 36;
// These are the tabs which are shown on the page,
$tabs = array();
$tabs['dashboard'] = __( 'Search' );
if ( 'search' == $tab )
$tabs['search'] = __( 'Search Results' );
$tabs['upload'] = __( 'Upload' );
$tabs['featured'] = _x( 'Featured','Theme Installer' );
//$tabs['popular'] = _x( 'Popular','Theme Installer' );
$tabs['new'] = _x( 'Newest','Theme Installer' );
$tabs['updated'] = _x( 'Recently Updated','Theme Installer' );
$nonmenu_tabs = array( 'theme-information' ); // Valid actions to perform which do not have a Menu item.
$tabs = apply_filters( 'install_themes_tabs', $tabs );
$nonmenu_tabs = apply_filters( 'install_themes_nonmenu_tabs', $nonmenu_tabs );
// If a non-valid menu tab has been selected, And it's not a non-menu action.
if ( empty( $tab ) || ( ! isset( $tabs[ $tab ] ) && ! in_array( $tab, (array) $nonmenu_tabs ) ) )
$tab = key( $tabs );
$args = array( 'page' => $paged, 'per_page' => $per_page, 'fields' => $theme_field_defaults );
switch ( $tab ) {
case 'search':
$type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';
switch ( $type ) {
case 'tag':
$args['tag'] = array_map( 'sanitize_key', $search_terms );
break;
case 'term':
$args['search'] = $search_string;
break;
case 'author':
$args['author'] = $search_string;
break;
}
if ( ! empty( $this->features ) ) {
$args['tag'] = $this->features;
$_REQUEST['s'] = implode( ',', $this->features );
$_REQUEST['type'] = 'tag';
}
add_action( 'install_themes_table_header', 'install_theme_search_form', 10, 0 );
break;
case 'featured':
//case 'popular':
case 'new':
case 'updated':
$args['browse'] = $tab;
break;
default:
$args = false;
}
if ( ! $args )
return;
$api = themes_api( 'query_themes', $args );
if ( is_wp_error( $api ) )
wp_die( $api->get_error_message() . '</p> <p><a href="#" onclick="document.location.reload(); return false;">' . __( 'Try again' ) . '</a>' );
$this->items = $api->themes;
$this->set_pagination_args( array(
'total_items' => $api->info['results'],
'per_page' => $per_page,
'infinite_scroll' => true,
) );
}
function no_items() {
_e( 'No themes match your request.' );
}
function get_views() {
global $tabs, $tab;
$display_tabs = array();
foreach ( (array) $tabs as $action => $text ) {
$class = ( $action == $tab ) ? ' class="current"' : '';
$href = self_admin_url('theme-install.php?tab=' . $action);
$display_tabs['theme-install-'.$action] = "<a href='$href'$class>$text</a>";
}
return $display_tabs;
}
function display() {
wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
?>
<div class="tablenav top themes">
<div class="alignleft actions">
<?php do_action( 'install_themes_table_header' ); ?>
</div>
<?php $this->pagination( 'top' ); ?>
<br class="clear" />
</div>
<div id="availablethemes">
<?php $this->display_rows_or_placeholder(); ?>
</div>
<?php
parent::tablenav( 'bottom' );
}
function display_rows() {
$themes = $this->items;
foreach ( $themes as $theme ) {
?>
<div class="available-theme installable-theme"><?php
$this->single_row( $theme );
?></div>
<?php } // end foreach $theme_names
$this->theme_installer();
}
/*
* Prints a theme from the WordPress.org API.
*
* @param object $theme An object that contains theme data returned by the WordPress.org API.
*
* Example theme data:
* object(stdClass)[59]
* public 'name' => string 'Magazine Basic'
* public 'slug' => string 'magazine-basic'
* public 'version' => string '1.1'
* public 'author' => string 'tinkerpriest'
* public 'preview_url' => string 'http://wp-themes.com/?magazine-basic'
* public 'screenshot_url' => string 'http://wp-themes.com/wp-content/themes/magazine-basic/screenshot.png'
* public 'rating' => float 80
* public 'num_ratings' => int 1
* public 'homepage' => string 'http://wordpress.org/themes/magazine-basic'
* public 'description' => string 'A basic magazine style layout with a fully customizable layout through a backend interface. Designed by <a href="http://bavotasan.com">c.bavota</a> of <a href="http://tinkerpriestmedia.com">Tinker Priest Media</a>.'
* public 'download_link' => string 'http://wordpress.org/themes/download/magazine-basic.1.1.zip'
*/
function single_row( $theme ) {
global $themes_allowedtags;
if ( empty( $theme ) )
return;
$name = wp_kses( $theme->name, $themes_allowedtags );
$author = wp_kses( $theme->author, $themes_allowedtags );
$preview_title = sprintf( __('Preview “%s”'), $name );
$preview_url = add_query_arg( array(
'tab' => 'theme-information',
'theme' => $theme->slug,
) );
$actions = array();
$install_url = add_query_arg( array(
'action' => 'install-theme',
'theme' => $theme->slug,
), self_admin_url( 'update.php' ) );
$update_url = add_query_arg( array(
'action' => 'upgrade-theme',
'theme' => $theme->slug,
), self_admin_url( 'update.php' ) );
$status = $this->_get_theme_status( $theme );
switch ( $status ) {
default:
case 'install':
$actions[] = '<a class="install-now" href="' . esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ) . '" title="' . esc_attr( sprintf( __( 'Install %s' ), $name ) ) . '">' . __( 'Install Now' ) . '</a>';
break;
case 'update_available':
$actions[] = '<a class="install-now" href="' . esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ) . '" title="' . esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ) . '">' . __( 'Update' ) . '</a>';
break;
case 'newer_installed':
case 'latest_installed':
$actions[] = '<span class="install-now" title="' . esc_attr__( 'This theme is already installed and is up to date' ) . '">' . _x( 'Installed', 'theme' ) . '</span>';
break;
}
$actions[] = '<a class="install-theme-preview" href="' . esc_url( $preview_url ) . '" title="' . esc_attr( sprintf( __( 'Preview %s' ), $name ) ) . '">' . __( 'Preview' ) . '</a>';
$actions = apply_filters( 'theme_install_actions', $actions, $theme );
?>
<a class="screenshot install-theme-preview" href="<?php echo esc_url( $preview_url ); ?>" title="<?php echo esc_attr( $preview_title ); ?>">
<img src='<?php echo esc_url( $theme->screenshot_url ); ?>' width='150' />
</a>
<h3><?php echo $name; ?></h3>
<div class="theme-author"><?php printf( __( 'By %s' ), $author ); ?></div>
<div class="action-links">
<ul>
<?php foreach ( $actions as $action ): ?>
<li><?php echo $action; ?></li>
<?php endforeach; ?>
<li class="hide-if-no-js"><a href="#" class="theme-detail"><?php _e('Details') ?></a></li>
</ul>
</div>
<?php
$this->install_theme_info( $theme );
}
/*
* Prints the wrapper for the theme installer.
*/
function theme_installer() {
?>
<div id="theme-installer" class="wp-full-overlay expanded">
<div class="wp-full-overlay-sidebar">
<div class="wp-full-overlay-header">
<a href="#" class="close-full-overlay"><?php _e( '← Close' ); ?></a>
</div>
<div class="wp-full-overlay-sidebar-content">
<div class="install-theme-info"></div>
</div>
<div class="wp-full-overlay-footer">
<a href="#" class="collapse-sidebar button-secondary" title="<?php esc_attr_e('Collapse Sidebar'); ?>">
<span class="collapse-sidebar-label"><?php _e('Collapse'); ?></span>
<span class="collapse-sidebar-arrow"></span>
</a>
</div>
</div>
<div class="wp-full-overlay-main"></div>
</div>
<?php
}
/*
* Prints the wrapper for the theme installer with a provided theme's data.
* Used to make the theme installer work for no-js.
*
* @param object $theme - A WordPress.org Theme API object.
*/
function theme_installer_single( $theme ) {
?>
<div id="theme-installer" class="wp-full-overlay single-theme">
<div class="wp-full-overlay-sidebar">
<?php $this->install_theme_info( $theme ); ?>
</div>
<div class="wp-full-overlay-main">
<iframe src="<?php echo esc_url( $theme->preview_url ); ?>"></iframe>
</div>
</div>
<?php
}
/*
* Prints the info for a theme (to be used in the theme installer modal).
*
* @param object $theme - A WordPress.org Theme API object.
*/
function install_theme_info( $theme ) {
global $themes_allowedtags;
if ( empty( $theme ) )
return;
$name = wp_kses( $theme->name, $themes_allowedtags );
$author = wp_kses( $theme->author, $themes_allowedtags );
$num_ratings = sprintf( _n( '(based on %s rating)', '(based on %s ratings)', $theme->num_ratings ), number_format_i18n( $theme->num_ratings ) );
$install_url = add_query_arg( array(
'action' => 'install-theme',
'theme' => $theme->slug,
), self_admin_url( 'update.php' ) );
$update_url = add_query_arg( array(
'action' => 'upgrade-theme',
'theme' => $theme->slug,
), self_admin_url( 'update.php' ) );
$status = $this->_get_theme_status( $theme );
?>
<div class="install-theme-info"><?php
switch ( $status ) {
default:
case 'install':
echo '<a class="theme-install button-primary" href="' . esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ) . '">' . __( 'Install' ) . '</a>';
break;
case 'update_available':
echo '<a class="theme-install button-primary" href="' . esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ) . '" title="' . esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ) . '">' . __( 'Update' ) . '</a>';
break;
case 'newer_installed':
case 'latest_installed':
echo '<span class="theme-install" title="' . esc_attr__( 'This theme is already installed and is up to date' ) . '">' . _x( 'Installed', 'theme' ) . '</span>';
break;
} ?>
<h3 class="theme-name"><?php echo $name; ?></h3>
<span class="theme-by"><?php printf( __( 'By %s' ), $author ); ?></span>
<?php if ( isset( $theme->screenshot_url ) ): ?>
<img class="theme-screenshot" src="<?php echo esc_url( $theme->screenshot_url ); ?>" />
<?php endif; ?>
<div class="theme-details">
<div class="star-holder" title="<?php echo esc_attr( $num_ratings ); ?>">
<div class="star-rating" style="width:<?php echo esc_attr( intval( $theme->rating ) . 'px' ); ?>;"></div>
</div>
<div class="theme-version">
<strong><?php _e('Version:') ?> </strong>
<?php echo wp_kses( $theme->version, $themes_allowedtags ); ?>
</div>
<div class="theme-description">
<?php echo wp_kses( $theme->description, $themes_allowedtags ); ?>
</div>
</div>
<input class="theme-preview-url" type="hidden" value="<?php echo esc_url( $theme->preview_url ); ?>" />
</div>
<?php
}
/**
* Send required variables to JavaScript land
*
* @since 3.4
* @access private
*
* @uses $tab Global; current tab within Themes->Install screen
* @uses $type Global; type of search.
*/
function _js_vars( $extra_args = array() ) {
global $tab, $type;
parent::_js_vars( compact( 'tab', 'type' ) );
}
/**
* Check to see if the theme is already installed.
*
* @since 3.4
* @access private
*
* @param object $theme - A WordPress.org Theme API object.
* @return string Theme status.
*/
private function _get_theme_status( $theme ) {
$status = 'install';
$installed_theme = wp_get_theme( $theme->slug );
if ( $installed_theme->exists() ) {
if ( version_compare( $installed_theme->get('Version'), $theme->version, '=' ) )
$status = 'latest_installed';
elseif ( version_compare( $installed_theme->get('Version'), $theme->version, '>' ) )
$status = 'newer_installed';
else
$status = 'update_available';
}
return $status;
}
}
| CodeForKids/websitesByKids | subdomains/siennabean/wp-admin/includes/class-wp-theme-install-list-table.php | PHP | mit | 12,848 |
//! moment.js locale configuration
//! locale : traditional chinese (zh-tw)
//! author : Ben : https://github.com/ben-lin
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['moment'], factory) :
factory(global.moment)
}(this, function (moment) { 'use strict';
var zh_tw = moment.defineLocale('zh-tw', {
months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'),
weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
longDateFormat : {
LT : 'Ah點mm分',
LTS : 'Ah點m分s秒',
L : 'YYYY年MMMD日',
LL : 'YYYY年MMMD日',
LLL : 'YYYY年MMMD日Ah點mm分',
LLLL : 'YYYY年MMMD日ddddAh點mm分',
l : 'YYYY年MMMD日',
ll : 'YYYY年MMMD日',
lll : 'YYYY年MMMD日Ah點mm分',
llll : 'YYYY年MMMD日ddddAh點mm分'
},
meridiemParse: /早上|上午|中午|下午|晚上/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === '早上' || meridiem === '上午') {
return hour;
} else if (meridiem === '中午') {
return hour >= 11 ? hour : hour + 12;
} else if (meridiem === '下午' || meridiem === '晚上') {
return hour + 12;
}
},
meridiem : function (hour, minute, isLower) {
var hm = hour * 100 + minute;
if (hm < 900) {
return '早上';
} else if (hm < 1130) {
return '上午';
} else if (hm < 1230) {
return '中午';
} else if (hm < 1800) {
return '下午';
} else {
return '晚上';
}
},
calendar : {
sameDay : '[今天]LT',
nextDay : '[明天]LT',
nextWeek : '[下]ddddLT',
lastDay : '[昨天]LT',
lastWeek : '[上]ddddLT',
sameElse : 'L'
},
ordinalParse: /\d{1,2}(日|月|週)/,
ordinal : function (number, period) {
switch (period) {
case 'd' :
case 'D' :
case 'DDD' :
return number + '日';
case 'M' :
return number + '月';
case 'w' :
case 'W' :
return number + '週';
default :
return number;
}
},
relativeTime : {
future : '%s內',
past : '%s前',
s : '幾秒',
m : '一分鐘',
mm : '%d分鐘',
h : '一小時',
hh : '%d小時',
d : '一天',
dd : '%d天',
M : '一個月',
MM : '%d個月',
y : '一年',
yy : '%d年'
}
});
return zh_tw;
})); | TEDxAmsterdam/TEDxbot | node_modules/moment/locale/zh-tw.js | JavaScript | mit | 3,479 |
/**
* Copyright 2013 Jeanfrancois Arcand
*
* 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.
*/
/*
* Highly inspired by Portal v1.0
* http://github.com/flowersinthesand/portal
*
* Copyright 2011-2013, Donghwan Kim
* Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*/
/**
* Official documentation of this library: https://github.com/Atmosphere/atmosphere/wiki/jQuery.atmosphere.js-API
*/
(function () {
"use strict";
var version = "2.1.2-javascript",
atmosphere = {},
guid,
requests = [],
callbacks = [],
uuid = 0,
hasOwn = Object.prototype.hasOwnProperty;
atmosphere = {
onError: function (response) {
},
onClose: function (response) {
},
onOpen: function (response) {
},
onReopen: function (response) {
},
onMessage: function (response) {
},
onReconnect: function (request, response) {
},
onMessagePublished: function (response) {
},
onTransportFailure: function (errorMessage, _request) {
},
onLocalMessage: function (response) {
},
onFailureToReconnect: function (request, response) {
},
onClientTimeout: function(request){
},
AtmosphereRequest: function (options) {
/**
* {Object} Request parameters.
*
* @private
*/
var _request = {
timeout: 300000,
method: 'GET',
headers: {},
contentType: '',
callback: null,
url: '',
data: '',
suspend: true,
maxRequest: -1,
reconnect: true,
maxStreamingLength: 10000000,
lastIndex: 0,
logLevel: 'info',
requestCount: 0,
fallbackMethod: 'GET',
fallbackTransport: 'streaming',
transport: 'long-polling',
webSocketImpl: null,
webSocketBinaryType: null,
dispatchUrl: null,
webSocketPathDelimiter: "@@",
enableXDR: false,
rewriteURL: false,
attachHeadersAsQueryString: true,
executeCallbackBeforeReconnect: false,
readyState: 0,
lastTimestamp: 0,
withCredentials: false,
trackMessageLength: false,
messageDelimiter: '|',
connectTimeout: -1,
reconnectInterval: 0,
dropHeaders: true,
uuid: 0,
async: true,
shared: false,
readResponsesHeaders: false,
maxReconnectOnClose: 5,
enableProtocol: true,
onError: function (response) {
},
onClose: function (response) {
},
onOpen: function (response) {
},
onMessage: function (response) {
},
onReopen: function (request, response) {
},
onReconnect: function (request, response) {
},
onMessagePublished: function (response) {
},
onTransportFailure: function (reason, request) {
},
onLocalMessage: function (request) {
},
onFailureToReconnect: function (request, response) {
},
onClientTimeout: function(request){
}
};
/**
* {Object} Request's last response.
*
* @private
*/
var _response = {
status: 200,
reasonPhrase: "OK",
responseBody: '',
messages: [],
headers: [],
state: "messageReceived",
transport: "polling",
error: null,
request: null,
partialMessage: "",
errorHandled: false,
closedByClientTimeout: false
};
/**
* {websocket} Opened web socket.
*
* @private
*/
var _websocket = null;
/**
* {SSE} Opened SSE.
*
* @private
*/
var _sse = null;
/**
* {XMLHttpRequest, ActiveXObject} Opened ajax request (in case of http-streaming or long-polling)
*
* @private
*/
var _activeRequest = null;
/**
* {Object} Object use for streaming with IE.
*
* @private
*/
var _ieStream = null;
/**
* {Object} Object use for jsonp transport.
*
* @private
*/
var _jqxhr = null;
/**
* {boolean} If request has been subscribed or not.
*
* @private
*/
var _subscribed = true;
/**
* {number} Number of test reconnection.
*
* @private
*/
var _requestCount = 0;
/**
* {boolean} If request is currently aborded.
*
* @private
*/
var _abordingConnection = false;
/**
* A local "channel' of communication.
*
* @private
*/
var _localSocketF = null;
/**
* The storage used.
*
* @private
*/
var _storageService;
/**
* Local communication
*
* @private
*/
var _localStorageService = null;
/**
* A Unique ID
*
* @private
*/
var guid = atmosphere.util.now();
/** Trace time */
var _traceTimer;
/** Key for connection sharing */
var _sharingKey;
// Automatic call to subscribe
_subscribe(options);
/**
* Initialize atmosphere request object.
*
* @private
*/
function _init() {
_subscribed = true;
_abordingConnection = false;
_requestCount = 0;
_websocket = null;
_sse = null;
_activeRequest = null;
_ieStream = null;
}
/**
* Re-initialize atmosphere object.
*
* @private
*/
function _reinit() {
_clearState();
_init();
}
/**
*
* @private
*/
function _verifyStreamingLength(ajaxRequest, rq) {
// Wait to be sure we have the full message before closing.
if (_response.partialMessage === "" && (rq.transport === 'streaming') && (ajaxRequest.responseText.length > rq.maxStreamingLength)) {
_response.messages = [];
_invokeClose(true);
_disconnect();
_clearState();
_reconnect(ajaxRequest, rq, 0);
}
}
/**
* Disconnect
*
* @private
*/
function _disconnect() {
if (_request.enableProtocol && !_request.firstMessage) {
var query = "X-Atmosphere-Transport=close&X-Atmosphere-tracking-id=" + _request.uuid;
atmosphere.util.each(_request.headers, function (name, value) {
var h = atmosphere.util.isFunction(value) ? value.call(this, _request, _request, _response) : value;
if (h != null) {
query += "&" + encodeURIComponent(name) + "=" + encodeURIComponent(h);
}
});
var url = _request.url.replace(/([?&])_=[^&]*/, query);
url = url + (url === _request.url ? (/\?/.test(_request.url) ? "&" : "?") + query : "");
var rq = {
connected: false
};
var closeR = new atmosphere.AtmosphereRequest(rq);
closeR.attachHeadersAsQueryString = false;
closeR.dropHeaders = true;
closeR.url = url;
closeR.contentType = "text/plain";
closeR.transport = 'polling';
closeR.async = false;
_pushOnClose("", closeR);
}
}
/**
* Close request.
*
* @private
*/
function _close() {
if (_request.reconnectId) {
clearTimeout(_request.reconnectId);
delete _request.reconnectId;
}
_request.reconnect = false;
_abordingConnection = true;
_response.request = _request;
_response.state = 'unsubscribe';
_response.responseBody = "";
_response.status = 408;
_response.partialMessage = "";
_invokeCallback();
_disconnect();
_clearState();
}
function _clearState() {
_response.partialMessage = "";
if (_request.id) {
clearTimeout(_request.id);
}
if (_ieStream != null) {
_ieStream.close();
_ieStream = null;
}
if (_jqxhr != null) {
_jqxhr.abort();
_jqxhr = null;
}
if (_activeRequest != null) {
_activeRequest.abort();
_activeRequest = null;
}
if (_websocket != null) {
if (_websocket.webSocketOpened) {
_websocket.close();
}
_websocket = null;
}
if (_sse != null) {
_sse.close();
_sse = null;
}
_clearStorage();
}
function _clearStorage() {
// Stop sharing a connection
if (_storageService != null) {
// Clears trace timer
clearInterval(_traceTimer);
// Removes the trace
document.cookie = _sharingKey + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/";
// The heir is the parent unless unloading
_storageService.signal("close", {
reason: "",
heir: !_abordingConnection ? guid : (_storageService.get("children") || [])[0]
});
_storageService.close();
}
if (_localStorageService != null) {
_localStorageService.close();
}
}
/**
* Subscribe request using request transport. <br>
* If request is currently opened, this one will be closed.
*
* @param {Object} Request parameters.
* @private
*/
function _subscribe(options) {
_reinit();
_request = atmosphere.util.extend(_request, options);
// Allow at least 1 request
_request.mrequest = _request.reconnect;
if (!_request.reconnect) {
_request.reconnect = true;
}
}
/**
* Check if web socket is supported (check for custom implementation provided by request object or browser implementation).
*
* @returns {boolean} True if web socket is supported, false otherwise.
* @private
*/
function _supportWebsocket() {
return _request.webSocketImpl != null || window.WebSocket || window.MozWebSocket;
}
/**
* Check if server side events (SSE) is supported (check for custom implementation provided by request object or browser implementation).
*
* @returns {boolean} True if web socket is supported, false otherwise.
* @private
*/
function _supportSSE() {
return window.EventSource;
}
/**
* Open request using request transport. <br>
* If request transport is 'websocket' but websocket can't be opened, request will automatically reconnect using fallback transport.
*
* @private
*/
function _execute() {
// Shared across multiple tabs/windows.
if (_request.shared) {
_localStorageService = _local(_request);
if (_localStorageService != null) {
if (_request.logLevel === 'debug') {
atmosphere.util.debug("Storage service available. All communication will be local");
}
if (_localStorageService.open(_request)) {
// Local connection.
return;
}
}
if (_request.logLevel === 'debug') {
atmosphere.util.debug("No Storage service available.");
}
// Wasn't local or an error occurred
_localStorageService = null;
}
// Protocol
_request.firstMessage = uuid == 0 ? true : false;
_request.isOpen = false;
_request.ctime = atmosphere.util.now();
// We carry any UUID set by the user or from a previous connection.
if (_request.uuid === 0) {
_request.uuid = uuid;
}
_response.closedByClientTimeout = false;
if (_request.transport !== 'websocket' && _request.transport !== 'sse') {
_executeRequest(_request);
} else if (_request.transport === 'websocket') {
if (!_supportWebsocket()) {
_reconnectWithFallbackTransport("Websocket is not supported, using request.fallbackTransport (" + _request.fallbackTransport
+ ")");
} else {
_executeWebSocket(false);
}
} else if (_request.transport === 'sse') {
if (!_supportSSE()) {
_reconnectWithFallbackTransport("Server Side Events(SSE) is not supported, using request.fallbackTransport ("
+ _request.fallbackTransport + ")");
} else {
_executeSSE(false);
}
}
}
function _local(request) {
var trace, connector, orphan, name = "atmosphere-" + request.url, connectors = {
storage: function () {
function onstorage(event) {
if (event.key === name && event.newValue) {
listener(event.newValue);
}
}
if (!atmosphere.util.storage) {
return;
}
var storage = window.localStorage,
get = function (key) {
return atmosphere.util.parseJSON(storage.getItem(name + "-" + key));
},
set = function (key, value) {
storage.setItem(name + "-" + key, atmosphere.util.stringifyJSON(value));
};
return {
init: function () {
set("children", get("children").concat([guid]));
atmosphere.util.on(window, "storage", onstorage);
return get("opened");
},
signal: function (type, data) {
storage.setItem(name, atmosphere.util.stringifyJSON({
target: "p",
type: type,
data: data
}));
},
close: function () {
var children = get("children");
atmosphere.util.off(window, "storage", onstorage);
if (children) {
if (removeFromArray(children, request.id)) {
set("children", children);
}
}
}
};
},
windowref: function () {
var win = window.open("", name.replace(/\W/g, ""));
if (!win || win.closed || !win.callbacks) {
return;
}
return {
init: function () {
win.callbacks.push(listener);
win.children.push(guid);
return win.opened;
},
signal: function (type, data) {
if (!win.closed && win.fire) {
win.fire(atmosphere.util.stringifyJSON({
target: "p",
type: type,
data: data
}));
}
},
close: function () {
// Removes traces only if the parent is alive
if (!orphan) {
removeFromArray(win.callbacks, listener);
removeFromArray(win.children, guid);
}
}
};
}
};
function removeFromArray(array, val) {
var i, length = array.length;
for (i = 0; i < length; i++) {
if (array[i] === val) {
array.splice(i, 1);
}
}
return length !== array.length;
}
// Receives open, close and message command from the parent
function listener(string) {
var command = atmosphere.util.parseJSON(string), data = command.data;
if (command.target === "c") {
switch (command.type) {
case "open":
_open("opening", 'local', _request);
break;
case "close":
if (!orphan) {
orphan = true;
if (data.reason === "aborted") {
_close();
} else {
// Gives the heir some time to reconnect
if (data.heir === guid) {
_execute();
} else {
setTimeout(function () {
_execute();
}, 100);
}
}
}
break;
case "message":
_prepareCallback(data, "messageReceived", 200, request.transport);
break;
case "localMessage":
_localMessage(data);
break;
}
}
}
function findTrace() {
var matcher = new RegExp("(?:^|; )(" + encodeURIComponent(name) + ")=([^;]*)").exec(document.cookie);
if (matcher) {
return atmosphere.util.parseJSON(decodeURIComponent(matcher[2]));
}
}
// Finds and validates the parent socket's trace from the cookie
trace = findTrace();
if (!trace || atmosphere.util.now() - trace.ts > 1000) {
return;
}
// Chooses a connector
connector = connectors.storage() || connectors.windowref();
if (!connector) {
return;
}
return {
open: function () {
var parentOpened;
// Checks the shared one is alive
_traceTimer = setInterval(function () {
var oldTrace = trace;
trace = findTrace();
if (!trace || oldTrace.ts === trace.ts) {
// Simulates a close signal
listener(atmosphere.util.stringifyJSON({
target: "c",
type: "close",
data: {
reason: "error",
heir: oldTrace.heir
}
}));
}
}, 1000);
parentOpened = connector.init();
if (parentOpened) {
// Firing the open event without delay robs the user of the opportunity to bind connecting event handlers
setTimeout(function () {
_open("opening", 'local', request);
}, 50);
}
return parentOpened;
},
send: function (event) {
connector.signal("send", event);
},
localSend: function (event) {
connector.signal("localSend", atmosphere.util.stringifyJSON({
id: guid,
event: event
}));
},
close: function () {
// Do not signal the parent if this method is executed by the unload event handler
if (!_abordingConnection) {
clearInterval(_traceTimer);
connector.signal("close");
connector.close();
}
}
};
}
function share() {
var storageService, name = "atmosphere-" + _request.url, servers = {
// Powered by the storage event and the localStorage
// http://www.w3.org/TR/webstorage/#event-storage
storage: function () {
function onstorage(event) {
// When a deletion, newValue initialized to null
if (event.key === name && event.newValue) {
listener(event.newValue);
}
}
if (!atmosphere.util.storage) {
return;
}
var storage = window.localStorage;
return {
init: function () {
// Handles the storage event
atmosphere.util.on(window, "storage", onstorage);
},
signal: function (type, data) {
storage.setItem(name, atmosphere.util.stringifyJSON({
target: "c",
type: type,
data: data
}));
},
get: function (key) {
return atmosphere.util.parseJSON(storage.getItem(name + "-" + key));
},
set: function (key, value) {
storage.setItem(name + "-" + key, atmosphere.util.stringifyJSON(value));
},
close: function () {
atmosphere.util.off(window, "storage", onstorage);
storage.removeItem(name);
storage.removeItem(name + "-opened");
storage.removeItem(name + "-children");
}
};
},
// Powered by the window.open method
// https://developer.mozilla.org/en/DOM/window.open
windowref: function () {
// Internet Explorer raises an invalid argument error
// when calling the window.open method with the name containing non-word characters
var neim = name.replace(/\W/g, ""), container = document.getElementById(neim), win;
if (!container) {
container = document.createElement("div");
container.id = neim;
container.style.display = "none";
container.innerHTML = '<iframe name="' + neim + '" />';
document.body.appendChild(container);
}
win = container.firstChild.contentWindow;
return {
init: function () {
// Callbacks from different windows
win.callbacks = [listener];
// In IE 8 and less, only string argument can be safely passed to the function in other window
win.fire = function (string) {
var i;
for (i = 0; i < win.callbacks.length; i++) {
win.callbacks[i](string);
}
};
},
signal: function (type, data) {
if (!win.closed && win.fire) {
win.fire(atmosphere.util.stringifyJSON({
target: "c",
type: type,
data: data
}));
}
},
get: function (key) {
return !win.closed ? win[key] : null;
},
set: function (key, value) {
if (!win.closed) {
win[key] = value;
}
},
close: function () {
}
};
}
};
// Receives send and close command from the children
function listener(string) {
var command = atmosphere.util.parseJSON(string), data = command.data;
if (command.target === "p") {
switch (command.type) {
case "send":
_push(data);
break;
case "localSend":
_localMessage(data);
break;
case "close":
_close();
break;
}
}
}
_localSocketF = function propagateMessageEvent(context) {
storageService.signal("message", context);
};
function leaveTrace() {
document.cookie = _sharingKey + "=" +
// Opera's JSON implementation ignores a number whose a last digit of 0 strangely
// but has no problem with a number whose a last digit of 9 + 1
encodeURIComponent(atmosphere.util.stringifyJSON({
ts: atmosphere.util.now() + 1,
heir: (storageService.get("children") || [])[0]
})) + "; path=/";
}
// Chooses a storageService
storageService = servers.storage() || servers.windowref();
storageService.init();
if (_request.logLevel === 'debug') {
atmosphere.util.debug("Installed StorageService " + storageService);
}
// List of children sockets
storageService.set("children", []);
if (storageService.get("opened") != null && !storageService.get("opened")) {
// Flag indicating the parent socket is opened
storageService.set("opened", false);
}
// Leaves traces
_sharingKey = encodeURIComponent(name);
leaveTrace();
_traceTimer = setInterval(leaveTrace, 1000);
_storageService = storageService;
}
/**
* @private
*/
function _open(state, transport, request) {
if (_request.shared && transport !== 'local') {
share();
}
if (_storageService != null) {
_storageService.set("opened", true);
}
request.close = function () {
_close();
};
if (_requestCount > 0 && state === 're-connecting') {
request.isReopen = true;
_tryingToReconnect(_response);
} else if (_response.error == null) {
_response.request = request;
var prevState = _response.state;
_response.state = state;
var prevTransport = _response.transport;
_response.transport = transport;
var _body = _response.responseBody;
_invokeCallback();
_response.responseBody = _body;
_response.state = prevState;
_response.transport = prevTransport;
}
}
/**
* Execute request using jsonp transport.
*
* @param request {Object} request Request parameters, if undefined _request object will be used.
* @private
*/
function _jsonp(request) {
// When CORS is enabled, make sure we force the proper transport.
request.transport = "jsonp";
var rq = _request, script;
if ((request != null) && (typeof (request) !== 'undefined')) {
rq = request;
}
_jqxhr = {
open: function () {
var callback = "atmosphere" + (++guid);
function poll() {
var url = rq.url;
if (rq.dispatchUrl != null) {
url += rq.dispatchUrl;
}
var data = rq.data;
if (rq.attachHeadersAsQueryString) {
url = _attachHeaders(rq);
if (data !== '') {
url += "&X-Atmosphere-Post-Body=" + encodeURIComponent(data);
}
data = '';
}
var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement;
script = document.createElement("script");
script.src = url + "&jsonpTransport=" + callback;
script.clean = function () {
script.clean = script.onerror = script.onload = script.onreadystatechange = null;
if (script.parentNode) {
script.parentNode.removeChild(script);
}
};
script.onload = script.onreadystatechange = function () {
if (!script.readyState || /loaded|complete/.test(script.readyState)) {
script.clean();
}
};
script.onerror = function () {
script.clean();
rq.lastIndex = 0;
if (rq.openId) {
clearTimeout(rq.openId);
}
if (rq.reconnect && _requestCount++ < rq.maxReconnectOnClose) {
_open('re-connecting', rq.transport, rq);
_reconnect(_jqxhr, rq, request.reconnectInterval);
rq.openId = setTimeout(function() {
_triggerOpen(rq);
}, rq.reconnectInterval + 1000);
} else {
_onError(0, "maxReconnectOnClose reached");
}
};
head.insertBefore(script, head.firstChild);
}
// Attaches callback
window[callback] = function (msg) {
if (rq.reconnect) {
if (rq.maxRequest === -1 || rq.requestCount++ < rq.maxRequest) {
// _readHeaders(_jqxhr, rq);
if (!rq.executeCallbackBeforeReconnect) {
_reconnect(_jqxhr, rq, 0);
}
if (msg != null && typeof msg !== 'string') {
try {
msg = msg.message;
} catch (err) {
// The message was partial
}
}
var skipCallbackInvocation = _trackMessageSize(msg, rq, _response);
if (!skipCallbackInvocation) {
_prepareCallback(_response.responseBody, "messageReceived", 200, rq.transport);
}
if (rq.executeCallbackBeforeReconnect) {
_reconnect(_jqxhr, rq, 0);
}
} else {
atmosphere.util.log(_request.logLevel, ["JSONP reconnect maximum try reached " + _request.requestCount]);
_onError(0, "maxRequest reached");
}
}
};
setTimeout(function () {
poll();
}, 50);
},
abort: function () {
if (script.clean) {
script.clean();
}
}
};
_jqxhr.open();
}
/**
* Build websocket object.
*
* @param location {string} Web socket url.
* @returns {websocket} Web socket object.
* @private
*/
function _getWebSocket(location) {
if (_request.webSocketImpl != null) {
return _request.webSocketImpl;
} else {
if (window.WebSocket) {
return new WebSocket(location);
} else {
return new MozWebSocket(location);
}
}
}
/**
* Build web socket url from request url.
*
* @return {string} Web socket url (start with "ws" or "wss" for secure web socket).
* @private
*/
function _buildWebSocketUrl() {
return atmosphere.util.getAbsoluteURL(_attachHeaders(_request)).replace(/^http/, "ws");
}
/**
* Build SSE url from request url.
*
* @return a url with Atmosphere's headers
* @private
*/
function _buildSSEUrl() {
var url = _attachHeaders(_request);
return url;
}
/**
* Open SSE. <br>
* Automatically use fallback transport if SSE can't be opened.
*
* @private
*/
function _executeSSE(sseOpened) {
_response.transport = "sse";
var location = _buildSSEUrl();
if (_request.logLevel === 'debug') {
atmosphere.util.debug("Invoking executeSSE");
atmosphere.util.debug("Using URL: " + location);
}
if (_request.enableProtocol && sseOpened) {
var time = atmosphere.util.now() - _request.ctime;
_request.lastTimestamp = Number(_request.stime) + Number(time);
}
if (sseOpened && !_request.reconnect) {
if (_sse != null) {
_clearState();
}
return;
}
try {
_sse = new EventSource(location, {
withCredentials: _request.withCredentials
});
} catch (e) {
_onError(0, e);
_reconnectWithFallbackTransport("SSE failed. Downgrading to fallback transport and resending");
return;
}
if (_request.connectTimeout > 0) {
_request.id = setTimeout(function () {
if (!sseOpened) {
_clearState();
}
}, _request.connectTimeout);
}
_sse.onopen = function (event) {
_timeout(_request);
if (_request.logLevel === 'debug') {
atmosphere.util.debug("SSE successfully opened");
}
if (!_request.enableProtocol) {
if (!sseOpened) {
_open('opening', "sse", _request);
} else {
_open('re-opening', "sse", _request);
}
} else if (_request.isReopen) {
_request.isReopen = false;
_open('re-opening', _request.transport, _request);
}
sseOpened = true;
if (_request.method === 'POST') {
_response.state = "messageReceived";
_sse.send(_request.data);
}
};
_sse.onmessage = function (message) {
_timeout(_request);
if (!_request.enableXDR && message.origin && message.origin !== window.location.protocol + "//" + window.location.host) {
atmosphere.util.log(_request.logLevel, ["Origin was not " + window.location.protocol + "//" + window.location.host]);
return;
}
_response.state = 'messageReceived';
_response.status = 200;
message = message.data;
var skipCallbackInvocation = _trackMessageSize(message, _request, _response);
// https://github.com/remy/polyfills/blob/master/EventSource.js
// Since we polling.
/* if (_sse.URL) {
_sse.interval = 100;
_sse.URL = _buildSSEUrl();
} */
if (!skipCallbackInvocation) {
_invokeCallback();
_response.responseBody = '';
_response.messages = [];
}
};
_sse.onerror = function (message) {
clearTimeout(_request.id);
if (_response.closedByClientTimeout) return;
_invokeClose(sseOpened);
_clearState();
if (_abordingConnection) {
atmosphere.util.log(_request.logLevel, ["SSE closed normally"]);
} else if (!sseOpened) {
_reconnectWithFallbackTransport("SSE failed. Downgrading to fallback transport and resending");
} else if (_request.reconnect && (_response.transport === 'sse')) {
if (_requestCount++ < _request.maxReconnectOnClose) {
_open('re-connecting', _request.transport, _request);
if (_request.reconnectInterval > 0) {
_request.reconnectId = setTimeout(function () {
_executeSSE(true);
}, _request.reconnectInterval);
} else {
_executeSSE(true);
}
_response.responseBody = "";
_response.messages = [];
} else {
atmosphere.util.log(_request.logLevel, ["SSE reconnect maximum try reached " + _requestCount]);
_onError(0, "maxReconnectOnClose reached");
}
}
};
}
/**
* Open web socket. <br>
* Automatically use fallback transport if web socket can't be opened.
*
* @private
*/
function _executeWebSocket(webSocketOpened) {
_response.transport = "websocket";
if (_request.enableProtocol && webSocketOpened) {
var time = atmosphere.util.now() - _request.ctime;
_request.lastTimestamp = Number(_request.stime) + Number(time);
}
var location = _buildWebSocketUrl(_request.url);
if (_request.logLevel === 'debug') {
atmosphere.util.debug("Invoking executeWebSocket");
atmosphere.util.debug("Using URL: " + location);
}
if (webSocketOpened && !_request.reconnect) {
if (_websocket != null) {
_clearState();
}
return;
}
_websocket = _getWebSocket(location);
if (_request.webSocketBinaryType != null) {
_websocket.binaryType = _request.webSocketBinaryType;
}
if (_request.connectTimeout > 0) {
_request.id = setTimeout(function () {
if (!webSocketOpened) {
var _message = {
code: 1002,
reason: "",
wasClean: false
};
_websocket.onclose(_message);
// Close it anyway
try {
_clearState();
} catch (e) {
}
return;
}
}, _request.connectTimeout);
}
_websocket.onopen = function (message) {
_timeout(_request);
if (_request.logLevel === 'debug') {
atmosphere.util.debug("Websocket successfully opened");
}
var reopening = webSocketOpened;
webSocketOpened = true;
if(_websocket != null) {
_websocket.webSocketOpened = webSocketOpened;
}
if (!_request.enableProtocol) {
if (reopening) {
_open('re-opening', "websocket", _request);
} else {
_open('opening', "websocket", _request);
}
}
if (_websocket != null) {
if (_request.method === 'POST') {
_response.state = "messageReceived";
_websocket.send(_request.data);
}
}
};
_websocket.onmessage = function (message) {
_timeout(_request);
_response.state = 'messageReceived';
_response.status = 200;
message = message.data;
var isString = typeof (message) === 'string';
if (isString) {
var skipCallbackInvocation = _trackMessageSize(message, _request, _response);
if (!skipCallbackInvocation) {
_invokeCallback();
_response.responseBody = '';
_response.messages = [];
}
} else {
if (!_handleProtocol(_request, message))
return;
_response.responseBody = message;
_invokeCallback();
_response.responseBody = null;
}
};
_websocket.onerror = function (message) {
clearTimeout(_request.id);
};
_websocket.onclose = function (message) {
clearTimeout(_request.id);
if (_response.state === 'closed')
return;
var reason = message.reason;
if (reason === "") {
switch (message.code) {
case 1000:
reason = "Normal closure; the connection successfully completed whatever purpose for which " + "it was created.";
break;
case 1001:
reason = "The endpoint is going away, either because of a server failure or because the "
+ "browser is navigating away from the page that opened the connection.";
break;
case 1002:
reason = "The endpoint is terminating the connection due to a protocol error.";
break;
case 1003:
reason = "The connection is being terminated because the endpoint received data of a type it "
+ "cannot accept (for example, a text-only endpoint received binary data).";
break;
case 1004:
reason = "The endpoint is terminating the connection because a data frame was received that " + "is too large.";
break;
case 1005:
reason = "Unknown: no status code was provided even though one was expected.";
break;
case 1006:
reason = "Connection was closed abnormally (that is, with no close frame being sent).";
break;
}
}
if (_request.logLevel === 'warn') {
atmosphere.util.warn("Websocket closed, reason: " + reason);
atmosphere.util.warn("Websocket closed, wasClean: " + message.wasClean);
}
if (_response.closedByClientTimeout) {
return;
}
_invokeClose(webSocketOpened);
_response.state = 'closed';
if (_abordingConnection) {
atmosphere.util.log(_request.logLevel, ["Websocket closed normally"]);
} else if (!webSocketOpened) {
_reconnectWithFallbackTransport("Websocket failed. Downgrading to Comet and resending");
} else if (_request.reconnect && _response.transport === 'websocket') {
_clearState();
if (_requestCount++ < _request.maxReconnectOnClose) {
_open('re-connecting', _request.transport, _request);
if (_request.reconnectInterval > 0) {
_request.reconnectId = setTimeout(function () {
_response.responseBody = "";
_response.messages = [];
_executeWebSocket(true);
}, _request.reconnectInterval);
} else {
_response.responseBody = "";
_response.messages = [];
_executeWebSocket(true);
}
} else {
atmosphere.util.log(_request.logLevel, ["Websocket reconnect maximum try reached " + _request.requestCount]);
if (_request.logLevel === 'warn') {
atmosphere.util.warn("Websocket error, reason: " + message.reason);
}
_onError(0, "maxReconnectOnClose reached");
}
}
};
if (_websocket.url === undefined) {
// Android 4.1 does not really support websockets and fails silently
_websocket.onclose({
reason: "Android 4.1 does not support websockets.",
wasClean: false
});
}
}
function _handleProtocol(request, message) {
// The first messages is always the uuid.
var b = true;
if (request.transport === 'polling') return b;
if (atmosphere.util.trim(message).length !== 0 && request.enableProtocol && request.firstMessage) {
request.firstMessage = false;
var messages = message.split(request.messageDelimiter);
var pos = messages.length === 2 ? 0 : 1;
request.uuid = atmosphere.util.trim(messages[pos]);
request.stime = atmosphere.util.trim(messages[pos + 1]);
b = false;
if (request.transport !== 'long-polling') {
_triggerOpen(request);
}
uuid = request.uuid;
} else if (request.enableProtocol && request.firstMessage) {
// In case we are getting some junk from IE
b = false;
} else {
_triggerOpen(request);
}
return b;
}
function _timeout(_request) {
clearTimeout(_request.id);
if (_request.timeout > 0 && _request.transport !== 'polling') {
_request.id = setTimeout(function () {
_onClientTimeout(_request);
_disconnect();
_clearState();
}, _request.timeout);
}
}
function _onClientTimeout(_request) {
_response.closedByClientTimeout = true;
_response.state = 'closedByClient';
_response.responseBody = "";
_response.status = 408;
_response.messages = [];
_invokeCallback();
}
function _onError(code, reason) {
_clearState();
clearTimeout(_request.id);
_response.state = 'error';
_response.reasonPhrase = reason;
_response.responseBody = "";
_response.status = code;
_response.messages = [];
_invokeCallback();
}
/**
* Track received message and make sure callbacks/functions are only invoked when the complete message has been received.
*
* @param message
* @param request
* @param response
*/
function _trackMessageSize(message, request, response) {
if (!_handleProtocol(request, message))
return true;
if (message.length === 0)
return true;
if (request.trackMessageLength) {
// prepend partialMessage if any
message = response.partialMessage + message;
var messages = [];
var messageStart = message.indexOf(request.messageDelimiter);
while (messageStart !== -1) {
var str = atmosphere.util.trim(message.substring(0, messageStart));
var messageLength = +str;
if (isNaN(messageLength))
throw new Error('message length "' + str + '" is not a number');
messageStart += request.messageDelimiter.length;
if (messageStart + messageLength > message.length) {
// message not complete, so there is no trailing messageDelimiter
messageStart = -1;
} else {
// message complete, so add it
messages.push(message.substring(messageStart, messageStart + messageLength));
// remove consumed characters
message = message.substring(messageStart + messageLength, message.length);
messageStart = message.indexOf(request.messageDelimiter);
}
}
/* keep any remaining data */
response.partialMessage = message;
if (messages.length !== 0) {
response.responseBody = messages.join(request.messageDelimiter);
response.messages = messages;
return false;
} else {
response.responseBody = "";
response.messages = [];
return true;
}
} else {
response.responseBody = message;
}
return false;
}
/**
* Reconnect request with fallback transport. <br>
* Used in case websocket can't be opened.
*
* @private
*/
function _reconnectWithFallbackTransport(errorMessage) {
atmosphere.util.log(_request.logLevel, [errorMessage]);
if (typeof (_request.onTransportFailure) !== 'undefined') {
_request.onTransportFailure(errorMessage, _request);
} else if (typeof (atmosphere.util.onTransportFailure) !== 'undefined') {
atmosphere.util.onTransportFailure(errorMessage, _request);
}
_request.transport = _request.fallbackTransport;
var reconnectInterval = _request.connectTimeout === -1 ? 0 : _request.connectTimeout;
if (_request.reconnect && _request.transport !== 'none' || _request.transport == null) {
_request.method = _request.fallbackMethod;
_response.transport = _request.fallbackTransport;
_request.fallbackTransport = 'none';
if (reconnectInterval > 0) {
_request.reconnectId = setTimeout(function () {
_execute();
}, reconnectInterval);
} else {
_execute();
}
} else {
_onError(500, "Unable to reconnect with fallback transport");
}
}
/**
* Get url from request and attach headers to it.
*
* @param request {Object} request Request parameters, if undefined _request object will be used.
*
* @returns {Object} Request object, if undefined, _request object will be used.
* @private
*/
function _attachHeaders(request, url) {
var rq = _request;
if ((request != null) && (typeof (request) !== 'undefined')) {
rq = request;
}
if (url == null) {
url = rq.url;
}
// If not enabled
if (!rq.attachHeadersAsQueryString)
return url;
// If already added
if (url.indexOf("X-Atmosphere-Framework") !== -1) {
return url;
}
url += (url.indexOf('?') !== -1) ? '&' : '?';
url += "X-Atmosphere-tracking-id=" + rq.uuid;
url += "&X-Atmosphere-Framework=" + version;
url += "&X-Atmosphere-Transport=" + rq.transport;
if (rq.trackMessageLength) {
url += "&X-Atmosphere-TrackMessageSize=" + "true";
}
if (rq.lastTimestamp != null) {
url += "&X-Cache-Date=" + rq.lastTimestamp;
} else {
url += "&X-Cache-Date=" + 0;
}
if (rq.contentType !== '') {
//Eurk!
url += "&Content-Type=" + rq.transport === 'websocket' ? rq.contentType : encodeURIComponent(rq.contentType);
}
if (rq.enableProtocol) {
url += "&X-atmo-protocol=true";
}
atmosphere.util.each(rq.headers, function (name, value) {
var h = atmosphere.util.isFunction(value) ? value.call(this, rq, request, _response) : value;
if (h != null) {
url += "&" + encodeURIComponent(name) + "=" + encodeURIComponent(h);
}
});
return url;
}
function _triggerOpen(rq) {
if (!rq.isOpen) {
rq.isOpen = true;
_open('opening', rq.transport, rq);
} else if (rq.isReopen) {
rq.isReopen = false;
_open('re-opening', rq.transport, rq);
}
}
/**
* Execute ajax request. <br>
*
* @param request {Object} request Request parameters, if undefined _request object will be used.
* @private
*/
function _executeRequest(request) {
var rq = _request;
if ((request != null) || (typeof (request) !== 'undefined')) {
rq = request;
}
rq.lastIndex = 0;
rq.readyState = 0;
// CORS fake using JSONP
if ((rq.transport === 'jsonp') || ((rq.enableXDR) && (atmosphere.util.checkCORSSupport()))) {
_jsonp(rq);
return;
}
if (atmosphere.util.browser.msie && +atmosphere.util.browser.version.split(".")[0] < 10) {
if ((rq.transport === 'streaming')) {
if (rq.enableXDR && window.XDomainRequest) {
_ieXDR(rq);
} else {
_ieStreaming(rq);
}
return;
}
if ((rq.enableXDR) && (window.XDomainRequest)) {
_ieXDR(rq);
return;
}
}
var reconnectF = function () {
rq.lastIndex = 0;
if (rq.reconnect && _requestCount++ < rq.maxReconnectOnClose) {
_open('re-connecting', request.transport, request);
_reconnect(ajaxRequest, rq, request.reconnectInterval);
} else {
_onError(0, "maxReconnectOnClose reached");
}
};
if (rq.force || (rq.reconnect && (rq.maxRequest === -1 || rq.requestCount++ < rq.maxRequest))) {
rq.force = false;
var ajaxRequest = atmosphere.util.xhr();
ajaxRequest.hasData = false;
_doRequest(ajaxRequest, rq, true);
if (rq.suspend) {
_activeRequest = ajaxRequest;
}
if (rq.transport !== 'polling') {
_response.transport = rq.transport;
ajaxRequest.onabort = function () {
_invokeClose(true);
};
ajaxRequest.onerror = function () {
_response.error = true;
try {
_response.status = XMLHttpRequest.status;
} catch (e) {
_response.status = 500;
}
if (!_response.status) {
_response.status = 500;
}
if (!_response.errorHandled) {
_clearState();
reconnectF();
}
};
}
ajaxRequest.onreadystatechange = function () {
if (_abordingConnection) {
return;
}
_response.error = null;
var skipCallbackInvocation = false;
var update = false;
if (rq.transport === 'streaming' && rq.readyState > 2 && ajaxRequest.readyState === 4) {
_clearState();
reconnectF();
return;
}
rq.readyState = ajaxRequest.readyState;
if (rq.transport === 'streaming' && ajaxRequest.readyState >= 3) {
update = true;
} else if (rq.transport === 'long-polling' && ajaxRequest.readyState === 4) {
update = true;
}
_timeout(_request);
if (rq.transport !== 'polling') {
// MSIE 9 and lower status can be higher than 1000, Chrome can be 0
var status = 200;
if (ajaxRequest.readyState === 4) {
status = ajaxRequest.status > 1000 ? 0 : ajaxRequest.status;
}
if (status >= 300 || status === 0) {
// Prevent onerror callback to be called
_response.errorHandled = true;
_clearState();
reconnectF();
return;
}
// Firefox incorrectly send statechange 0->2 when a reconnect attempt fails. The above checks ensure that onopen is not called for these
if ((!rq.enableProtocol || !request.firstMessage) && ajaxRequest.readyState === 2) {
_triggerOpen(rq);
}
} else if (ajaxRequest.readyState === 4) {
update = true;
}
if (update) {
var responseText = ajaxRequest.responseText;
if (atmosphere.util.trim(responseText).length === 0 && rq.transport === 'long-polling') {
// For browser that aren't support onabort
if (!ajaxRequest.hasData) {
_reconnect(ajaxRequest, rq, 0);
} else {
ajaxRequest.hasData = false;
}
return;
}
ajaxRequest.hasData = true;
_readHeaders(ajaxRequest, _request);
if (rq.transport === 'streaming') {
if (!atmosphere.util.browser.opera) {
var message = responseText.substring(rq.lastIndex, responseText.length);
skipCallbackInvocation = _trackMessageSize(message, rq, _response);
rq.lastIndex = responseText.length;
if (skipCallbackInvocation) {
return;
}
} else {
atmosphere.util.iterate(function () {
if (_response.status !== 500 && ajaxRequest.responseText.length > rq.lastIndex) {
try {
_response.status = ajaxRequest.status;
_response.headers = atmosphere.util.parseHeaders(ajaxRequest.getAllResponseHeaders());
_readHeaders(ajaxRequest, _request);
} catch (e) {
_response.status = 404;
}
_timeout(_request);
_response.state = "messageReceived";
var message = ajaxRequest.responseText.substring(rq.lastIndex);
rq.lastIndex = ajaxRequest.responseText.length;
skipCallbackInvocation = _trackMessageSize(message, rq, _response);
if (!skipCallbackInvocation) {
_invokeCallback();
}
_verifyStreamingLength(ajaxRequest, rq);
} else if (_response.status > 400) {
// Prevent replaying the last message.
rq.lastIndex = ajaxRequest.responseText.length;
return false;
}
}, 0);
}
} else {
skipCallbackInvocation = _trackMessageSize(responseText, rq, _response);
}
try {
_response.status = ajaxRequest.status;
_response.headers = atmosphere.util.parseHeaders(ajaxRequest.getAllResponseHeaders());
_readHeaders(ajaxRequest, rq);
} catch (e) {
_response.status = 404;
}
if (rq.suspend) {
_response.state = _response.status === 0 ? "closed" : "messageReceived";
} else {
_response.state = "messagePublished";
}
var isAllowedToReconnect = request.transport !== 'streaming' && request.transport !== 'polling';
if (isAllowedToReconnect && !rq.executeCallbackBeforeReconnect) {
_reconnect(ajaxRequest, rq, 0);
}
if (_response.responseBody.length !== 0 && !skipCallbackInvocation)
_invokeCallback();
if (isAllowedToReconnect && rq.executeCallbackBeforeReconnect) {
_reconnect(ajaxRequest, rq, 0);
}
_verifyStreamingLength(ajaxRequest, rq);
}
};
try {
ajaxRequest.send(rq.data);
_subscribed = true;
} catch (e) {
atmosphere.util.log(rq.logLevel, ["Unable to connect to " + rq.url]);
}
} else {
if (rq.logLevel === 'debug') {
atmosphere.util.log(rq.logLevel, ["Max re-connection reached."]);
}
_onError(0, "maxRequest reached");
}
}
/**
* Do ajax request.
*
* @param ajaxRequest Ajax request.
* @param request Request parameters.
* @param create If ajax request has to be open.
*/
function _doRequest(ajaxRequest, request, create) {
// Prevent Android to cache request
var url = request.url;
if (request.dispatchUrl != null && request.method === 'POST') {
url += request.dispatchUrl;
}
url = _attachHeaders(request, url);
url = atmosphere.util.prepareURL(url);
if (create) {
ajaxRequest.open(request.method, url, request.async);
if (request.connectTimeout > 0) {
request.id = setTimeout(function () {
if (request.requestCount === 0) {
_clearState();
_prepareCallback("Connect timeout", "closed", 200, request.transport);
}
}, request.connectTimeout);
}
}
if (_request.withCredentials) {
if ("withCredentials" in ajaxRequest) {
ajaxRequest.withCredentials = true;
}
}
if (!_request.dropHeaders) {
ajaxRequest.setRequestHeader("X-Atmosphere-Framework", atmosphere.util.version);
ajaxRequest.setRequestHeader("X-Atmosphere-Transport", request.transport);
if (request.lastTimestamp != null) {
ajaxRequest.setRequestHeader("X-Cache-Date", request.lastTimestamp);
} else {
ajaxRequest.setRequestHeader("X-Cache-Date", 0);
}
if (request.trackMessageLength) {
ajaxRequest.setRequestHeader("X-Atmosphere-TrackMessageSize", "true");
}
ajaxRequest.setRequestHeader("X-Atmosphere-tracking-id", request.uuid);
atmosphere.util.each(request.headers, function (name, value) {
var h = atmosphere.util.isFunction(value) ? value.call(this, ajaxRequest, request, create, _response) : value;
if (h != null) {
ajaxRequest.setRequestHeader(name, h);
}
});
}
if (request.contentType !== '') {
ajaxRequest.setRequestHeader("Content-Type", request.contentType);
}
}
function _reconnect(ajaxRequest, request, reconnectInterval) {
if (request.reconnect || (request.suspend && _subscribed)) {
var status = 0;
if (ajaxRequest && ajaxRequest.readyState !== 0) {
status = ajaxRequest.status > 1000 ? 0 : ajaxRequest.status;
}
_response.status = status === 0 ? 204 : status;
_response.reason = status === 0 ? "Server resumed the connection or down." : "OK";
clearTimeout(request.id);
if (request.reconnectId) {
clearTimeout(request.reconnectId);
delete request.reconnectId;
}
if (reconnectInterval > 0) {
// For whatever reason, never cancel a reconnect timeout as it is mandatory to reconnect.
_request.reconnectId = setTimeout(function () {
_executeRequest(request);
}, reconnectInterval);
} else {
_executeRequest(request);
}
}
}
function _tryingToReconnect(response) {
response.state = 're-connecting';
_invokeFunction(response);
}
function _ieXDR(request) {
if (request.transport !== "polling") {
_ieStream = _configureXDR(request);
_ieStream.open();
} else {
_configureXDR(request).open();
}
}
function _configureXDR(request) {
var rq = _request;
if ((request != null) && (typeof (request) !== 'undefined')) {
rq = request;
}
var transport = rq.transport;
var lastIndex = 0;
var xdr = new window.XDomainRequest();
var reconnect = function () {
if (rq.transport === "long-polling" && (rq.reconnect && (rq.maxRequest === -1 || rq.requestCount++ < rq.maxRequest))) {
xdr.status = 200;
_ieXDR(rq);
}
};
var rewriteURL = rq.rewriteURL || function (url) {
// Maintaining session by rewriting URL
// http://stackoverflow.com/questions/6453779/maintaining-session-by-rewriting-url
var match = /(?:^|;\s*)(JSESSIONID|PHPSESSID)=([^;]*)/.exec(document.cookie);
switch (match && match[1]) {
case "JSESSIONID":
return url.replace(/;jsessionid=[^\?]*|(\?)|$/, ";jsessionid=" + match[2] + "$1");
case "PHPSESSID":
return url.replace(/\?PHPSESSID=[^&]*&?|\?|$/, "?PHPSESSID=" + match[2] + "&").replace(/&$/, "");
}
return url;
};
// Handles open and message event
xdr.onprogress = function () {
handle(xdr);
};
// Handles error event
xdr.onerror = function () {
// If the server doesn't send anything back to XDR will fail with polling
if (rq.transport !== 'polling') {
_clearState();
if (_requestCount++ < rq.maxReconnectOnClose) {
if (rq.reconnectInterval > 0) {
rq.reconnectId = setTimeout(function () {
_open('re-connecting', request.transport, request);
_ieXDR(rq);
}, rq.reconnectInterval);
} else {
_open('re-connecting', request.transport, request);
_ieXDR(rq);
}
} else {
_onError(0, "maxReconnectOnClose reached");
}
}
};
// Handles close event
xdr.onload = function () {
};
var handle = function (xdr) {
clearTimeout(rq.id);
var message = xdr.responseText;
message = message.substring(lastIndex);
lastIndex += message.length;
if (transport !== 'polling') {
_timeout(rq);
var skipCallbackInvocation = _trackMessageSize(message, rq, _response);
if (transport === 'long-polling' && atmosphere.util.trim(message).length === 0)
return;
if (rq.executeCallbackBeforeReconnect) {
reconnect();
}
if (!skipCallbackInvocation) {
_prepareCallback(_response.responseBody, "messageReceived", 200, transport);
}
if (!rq.executeCallbackBeforeReconnect) {
reconnect();
}
}
};
return {
open: function () {
var url = rq.url;
if (rq.dispatchUrl != null) {
url += rq.dispatchUrl;
}
url = _attachHeaders(rq, url);
xdr.open(rq.method, rewriteURL(url));
if (rq.method === 'GET') {
xdr.send();
} else {
xdr.send(rq.data);
}
if (rq.connectTimeout > 0) {
rq.id = setTimeout(function () {
if (rq.requestCount === 0) {
_clearState();
_prepareCallback("Connect timeout", "closed", 200, rq.transport);
}
}, rq.connectTimeout);
}
},
close: function () {
xdr.abort();
}
};
}
function _ieStreaming(request) {
_ieStream = _configureIE(request);
_ieStream.open();
}
function _configureIE(request) {
var rq = _request;
if ((request != null) && (typeof (request) !== 'undefined')) {
rq = request;
}
var stop;
var doc = new window.ActiveXObject("htmlfile");
doc.open();
doc.close();
var url = rq.url;
if (rq.dispatchUrl != null) {
url += rq.dispatchUrl;
}
if (rq.transport !== 'polling') {
_response.transport = rq.transport;
}
return {
open: function () {
var iframe = doc.createElement("iframe");
url = _attachHeaders(rq);
if (rq.data !== '') {
url += "&X-Atmosphere-Post-Body=" + encodeURIComponent(rq.data);
}
// Finally attach a timestamp to prevent Android and IE caching.
url = atmosphere.util.prepareURL(url);
iframe.src = url;
doc.body.appendChild(iframe);
// For the server to respond in a consistent format regardless of user agent, we polls response text
var cdoc = iframe.contentDocument || iframe.contentWindow.document;
stop = atmosphere.util.iterate(function () {
try {
if (!cdoc.firstChild) {
return;
}
var res = cdoc.body ? cdoc.body.lastChild : cdoc;
var readResponse = function () {
// Clones the element not to disturb the original one
var clone = res.cloneNode(true);
// If the last character is a carriage return or a line feed, IE ignores it in the innerText property
// therefore, we add another non-newline character to preserve it
clone.appendChild(cdoc.createTextNode("."));
var text = clone.innerText;
text = text.substring(0, text.length - 1);
return text;
};
// To support text/html content type
if (!cdoc.body || !cdoc.body.firstChild || cdoc.body.firstChild.nodeName.toLowerCase() !== "pre") {
// Injects a plaintext element which renders text without interpreting the HTML and cannot be stopped
// it is deprecated in HTML5, but still works
var head = cdoc.head || cdoc.getElementsByTagName("head")[0] || cdoc.documentElement || cdoc;
var script = cdoc.createElement("script");
script.text = "document.write('<plaintext>')";
head.insertBefore(script, head.firstChild);
head.removeChild(script);
// The plaintext element will be the response container
res = cdoc.body.lastChild;
}
if (rq.closed) {
rq.isReopen = true;
}
// Handles message and close event
stop = atmosphere.util.iterate(function () {
var text = readResponse();
if (text.length > rq.lastIndex) {
_timeout(_request);
_response.status = 200;
_response.error = null;
// Empties response every time that it is handled
res.innerText = "";
var skipCallbackInvocation = _trackMessageSize(text, rq, _response);
if (skipCallbackInvocation) {
return "";
}
_prepareCallback(_response.responseBody, "messageReceived", 200, rq.transport);
}
rq.lastIndex = 0;
if (cdoc.readyState === "complete") {
_invokeClose(true);
_open('re-connecting', rq.transport, rq);
if (rq.reconnectInterval > 0) {
rq.reconnectId = setTimeout(function () {
_ieStreaming(rq);
}, rq.reconnectInterval);
} else {
_ieStreaming(rq);
}
return false;
}
}, null);
return false;
} catch (err) {
_response.error = true;
_open('re-connecting', rq.transport, rq);
if (_requestCount++ < rq.maxReconnectOnClose) {
if (rq.reconnectInterval > 0) {
rq.reconnectId = setTimeout(function () {
_ieStreaming(rq);
}, rq.reconnectInterval);
} else {
_ieStreaming(rq);
}
} else {
_onError(0, "maxReconnectOnClose reached");
}
doc.execCommand("Stop");
doc.close();
return false;
}
});
},
close: function () {
if (stop) {
stop();
}
doc.execCommand("Stop");
_invokeClose(true);
}
};
}
/**
* Send message. <br>
* Will be automatically dispatch to other connected.
*
* @param {Object, string} Message to send.
* @private
*/
function _push(message) {
if (_localStorageService != null) {
_pushLocal(message);
} else if (_activeRequest != null || _sse != null) {
_pushAjaxMessage(message);
} else if (_ieStream != null) {
_pushIE(message);
} else if (_jqxhr != null) {
_pushJsonp(message);
} else if (_websocket != null) {
_pushWebSocket(message);
} else {
_onError(0, "No suspended connection available");
atmosphere.util.error("No suspended connection available. Make sure atmosphere.subscribe has been called and request.onOpen invoked before invoking this method");
}
}
function _pushOnClose(message, rq) {
if (!rq) {
rq = _getPushRequest(message);
}
rq.transport = "polling";
rq.method = "GET";
rq.async = false;
rq.withCredentials = false;
rq.reconnect = false;
rq.force = true;
rq.suspend = false;
rq.timeout = 1000;
_executeRequest(rq);
}
function _pushLocal(message) {
_localStorageService.send(message);
}
function _intraPush(message) {
// IE 9 will crash if not.
if (message.length === 0)
return;
try {
if (_localStorageService) {
_localStorageService.localSend(message);
} else if (_storageService) {
_storageService.signal("localMessage", atmosphere.util.stringifyJSON({
id: guid,
event: message
}));
}
} catch (err) {
atmosphere.util.error(err);
}
}
/**
* Send a message using currently opened ajax request (using http-streaming or long-polling). <br>
*
* @param {string, Object} Message to send. This is an object, string message is saved in data member.
* @private
*/
function _pushAjaxMessage(message) {
var rq = _getPushRequest(message);
_executeRequest(rq);
}
/**
* Send a message using currently opened ie streaming (using http-streaming or long-polling). <br>
*
* @param {string, Object} Message to send. This is an object, string message is saved in data member.
* @private
*/
function _pushIE(message) {
if (_request.enableXDR && atmosphere.util.checkCORSSupport()) {
var rq = _getPushRequest(message);
// Do not reconnect since we are pushing.
rq.reconnect = false;
_jsonp(rq);
} else {
_pushAjaxMessage(message);
}
}
/**
* Send a message using jsonp transport. <br>
*
* @param {string, Object} Message to send. This is an object, string message is saved in data member.
* @private
*/
function _pushJsonp(message) {
_pushAjaxMessage(message);
}
function _getStringMessage(message) {
var msg = message;
if (typeof (msg) === 'object') {
msg = message.data;
}
return msg;
}
/**
* Build request use to push message using method 'POST' <br>. Transport is defined as 'polling' and 'suspend' is set to false.
*
* @return {Object} Request object use to push message.
* @private
*/
function _getPushRequest(message) {
var msg = _getStringMessage(message);
var rq = {
connected: false,
timeout: 60000,
method: 'POST',
url: _request.url,
contentType: _request.contentType,
headers: _request.headers,
reconnect: true,
callback: null,
data: msg,
suspend: false,
maxRequest: -1,
logLevel: 'info',
requestCount: 0,
withCredentials: _request.withCredentials,
async: _request.async,
transport: 'polling',
isOpen: true,
attachHeadersAsQueryString: true,
enableXDR: _request.enableXDR,
uuid: _request.uuid,
dispatchUrl: _request.dispatchUrl,
enableProtocol: false,
messageDelimiter: '|',
maxReconnectOnClose: _request.maxReconnectOnClose
};
if (typeof (message) === 'object') {
rq = atmosphere.util.extend(rq, message);
}
return rq;
}
/**
* Send a message using currently opened websocket. <br>
*
*/
function _pushWebSocket(message) {
var msg = atmosphere.util.isBinary(message) ? message : _getStringMessage(message);
var data;
try {
if (_request.dispatchUrl != null) {
data = _request.webSocketPathDelimiter + _request.dispatchUrl + _request.webSocketPathDelimiter + msg;
} else {
data = msg;
}
if (!_websocket.webSocketOpened) {
atmosphere.util.error("WebSocket not connected.");
return;
}
_websocket.send(data);
} catch (e) {
_websocket.onclose = function (message) {
};
_clearState();
_reconnectWithFallbackTransport("Websocket failed. Downgrading to Comet and resending " + message);
_pushAjaxMessage(message);
}
}
function _localMessage(message) {
var m = atmosphere.util.parseJSON(message);
if (m.id !== guid) {
if (typeof (_request.onLocalMessage) !== 'undefined') {
_request.onLocalMessage(m.event);
} else if (typeof (atmosphere.util.onLocalMessage) !== 'undefined') {
atmosphere.util.onLocalMessage(m.event);
}
}
}
function _prepareCallback(messageBody, state, errorCode, transport) {
_response.responseBody = messageBody;
_response.transport = transport;
_response.status = errorCode;
_response.state = state;
_invokeCallback();
}
function _readHeaders(xdr, request) {
if (!request.readResponsesHeaders) {
if (!request.enableProtocol) {
request.lastTimestamp = atmosphere.util.now();
request.uuid = guid;
}
}
else {
try {
var tempDate = xdr.getResponseHeader('X-Cache-Date');
if (tempDate && tempDate != null && tempDate.length > 0) {
request.lastTimestamp = tempDate.split(" ").pop();
}
var tempUUID = xdr.getResponseHeader('X-Atmosphere-tracking-id');
if (tempUUID && tempUUID != null) {
request.uuid = tempUUID.split(" ").pop();
}
} catch (e) {
}
}
}
function _invokeFunction(response) {
_f(response, _request);
// Global
_f(response, atmosphere.util);
}
function _f(response, f) {
switch (response.state) {
case "messageReceived":
_requestCount = 0;
if (typeof (f.onMessage) !== 'undefined')
f.onMessage(response);
break;
case "error":
if (typeof (f.onError) !== 'undefined')
f.onError(response);
break;
case "opening":
delete _request.closed;
if (typeof (f.onOpen) !== 'undefined')
f.onOpen(response);
break;
case "messagePublished":
if (typeof (f.onMessagePublished) !== 'undefined')
f.onMessagePublished(response);
break;
case "re-connecting":
if (typeof (f.onReconnect) !== 'undefined')
f.onReconnect(_request, response);
break;
case "closedByClient":
if (typeof (f.onClientTimeout) !== 'undefined')
f.onClientTimeout(_request);
break;
case "re-opening":
delete _request.closed;
if (typeof (f.onReopen) !== 'undefined')
f.onReopen(_request, response);
break;
case "fail-to-reconnect":
if (typeof (f.onFailureToReconnect) !== 'undefined')
f.onFailureToReconnect(_request, response);
break;
case "unsubscribe":
case "closed":
var closed = typeof (_request.closed) !== 'undefined' ? _request.closed : false;
if (typeof (f.onClose) !== 'undefined' && !closed)
f.onClose(response);
_request.closed = true;
break;
}
}
function _invokeClose(wasOpen) {
if (_response.state !== 'closed') {
_response.state = 'closed';
_response.responseBody = "";
_response.messages = [];
_response.status = !wasOpen ? 501 : 200;
_invokeCallback();
}
}
/**
* Invoke request callbacks.
*
* @private
*/
function _invokeCallback() {
var call = function (index, func) {
func(_response);
};
if (_localStorageService == null && _localSocketF != null) {
_localSocketF(_response.responseBody);
}
_request.reconnect = _request.mrequest;
var isString = typeof (_response.responseBody) === 'string';
var messages = (isString && _request.trackMessageLength) ? (_response.messages.length > 0 ? _response.messages : ['']) : new Array(
_response.responseBody);
for (var i = 0; i < messages.length; i++) {
if (messages.length > 1 && messages[i].length === 0) {
continue;
}
_response.responseBody = (isString) ? atmosphere.util.trim(messages[i]) : messages[i];
if (_localStorageService == null && _localSocketF != null) {
_localSocketF(_response.responseBody);
}
if (_response.responseBody.length === 0 && _response.state === "messageReceived") {
continue;
}
_invokeFunction(_response);
// Invoke global callbacks
if (callbacks.length > 0) {
if (_request.logLevel === 'debug') {
atmosphere.util.debug("Invoking " + callbacks.length + " global callbacks: " + _response.state);
}
try {
atmosphere.util.each(callbacks, call);
} catch (e) {
atmosphere.util.log(_request.logLevel, ["Callback exception" + e]);
}
}
// Invoke request callback
if (typeof (_request.callback) === 'function') {
if (_request.logLevel === 'debug') {
atmosphere.util.debug("Invoking request callbacks");
}
try {
_request.callback(_response);
} catch (e) {
atmosphere.util.log(_request.logLevel, ["Callback exception" + e]);
}
}
}
}
this.subscribe = function (options) {
_subscribe(options);
_execute();
};
this.execute = function () {
_execute();
};
this.close = function () {
_close();
};
this.disconnect = function () {
_disconnect();
};
this.getUrl = function () {
return _request.url;
};
this.push = function (message, dispatchUrl) {
if (dispatchUrl != null) {
var originalDispatchUrl = _request.dispatchUrl;
_request.dispatchUrl = dispatchUrl;
_push(message);
_request.dispatchUrl = originalDispatchUrl;
} else {
_push(message);
}
};
this.getUUID = function () {
return _request.uuid;
};
this.pushLocal = function (message) {
_intraPush(message);
};
this.enableProtocol = function (message) {
return _request.enableProtocol;
};
this.request = _request;
this.response = _response;
}
};
atmosphere.subscribe = function (url, callback, request) {
if (typeof (callback) === 'function') {
atmosphere.addCallback(callback);
}
// https://github.com/Atmosphere/atmosphere-javascript/issues/58
uuid = 0;
if (typeof (url) !== "string") {
request = url;
} else {
request.url = url;
}
var rq = new atmosphere.AtmosphereRequest(request);
rq.execute();
requests[requests.length] = rq;
return rq;
};
atmosphere.unsubscribe = function () {
if (requests.length > 0) {
var requestsClone = [].concat(requests);
for (var i = 0; i < requestsClone.length; i++) {
var rq = requestsClone[i];
rq.close();
clearTimeout(rq.response.request.id);
}
}
requests = [];
callbacks = [];
};
atmosphere.unsubscribeUrl = function (url) {
var idx = -1;
if (requests.length > 0) {
for (var i = 0; i < requests.length; i++) {
var rq = requests[i];
// Suppose you can subscribe once to an url
if (rq.getUrl() === url) {
rq.close();
clearTimeout(rq.response.request.id);
idx = i;
break;
}
}
}
if (idx >= 0) {
requests.splice(idx, 1);
}
};
atmosphere.addCallback = function (func) {
if (atmosphere.util.inArray(func, callbacks) === -1) {
callbacks.push(func);
}
};
atmosphere.removeCallback = function (func) {
var index = atmosphere.util.inArray(func, callbacks);
if (index !== -1) {
callbacks.splice(index, 1);
}
};
atmosphere.util = {
browser: {},
parseHeaders: function (headerString) {
var match, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, headers = {};
while (match = rheaders.exec(headerString)) {
headers[match[1]] = match[2];
}
return headers;
},
now: function () {
return new Date().getTime();
},
isArray: function (array) {
return Object.prototype.toString.call(array) === "[object Array]";
},
inArray: function (elem, array) {
if (!Array.prototype.indexOf) {
var len = array.length;
for (var i = 0; i < len; ++i) {
if (array[i] === elem) {
return i;
}
}
return -1;
}
return array.indexOf(elem);
},
isBinary: function (data) {
// True if data is an instance of Blob, ArrayBuffer or ArrayBufferView
return /^\[object\s(?:Blob|ArrayBuffer|.+Array)\]$/.test(Object.prototype.toString.call(data));
},
isFunction: function (fn) {
return Object.prototype.toString.call(fn) === "[object Function]";
},
getAbsoluteURL: function (url) {
var div = document.createElement("div");
// Uses an innerHTML property to obtain an absolute URL
div.innerHTML = '<a href="' + url + '"/>';
// encodeURI and decodeURI are needed to normalize URL between IE and non-IE,
// since IE doesn't encode the href property value and return it - http://jsfiddle.net/Yq9M8/1/
return encodeURI(decodeURI(div.firstChild.href));
},
prepareURL: function (url) {
// Attaches a time stamp to prevent caching
var ts = atmosphere.util.now();
var ret = url.replace(/([?&])_=[^&]*/, "$1_=" + ts);
return ret + (ret === url ? (/\?/.test(url) ? "&" : "?") + "_=" + ts : "");
},
trim: function (str) {
if (!String.prototype.trim) {
return str.toString().replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g, "").replace(/\s+/g, " ");
} else {
return str.toString().trim();
}
},
param: function (params) {
var prefix, s = [];
function add(key, value) {
value = atmosphere.util.isFunction(value) ? value() : (value == null ? "" : value);
s.push(encodeURIComponent(key) + "=" + encodeURIComponent(value));
}
function buildParams(prefix, obj) {
var name;
if (atmosphere.util.isArray(obj)) {
atmosphere.util.each(obj, function (i, v) {
if (/\[\]$/.test(prefix)) {
add(prefix, v);
} else {
buildParams(prefix + "[" + (typeof v === "object" ? i : "") + "]", v);
}
});
} else if (Object.prototype.toString.call(obj) === "[object Object]") {
for (name in obj) {
buildParams(prefix + "[" + name + "]", obj[name]);
}
} else {
add(prefix, obj);
}
}
for (prefix in params) {
buildParams(prefix, params[prefix]);
}
return s.join("&").replace(/%20/g, "+");
},
storage: !!(window.localStorage && window.StorageEvent),
iterate: function (fn, interval) {
var timeoutId;
// Though the interval is 0 for real-time application, there is a delay between setTimeout calls
// For detail, see https://developer.mozilla.org/en/window.setTimeout#Minimum_delay_and_timeout_nesting
interval = interval || 0;
(function loop() {
timeoutId = setTimeout(function () {
if (fn() === false) {
return;
}
loop();
}, interval);
})();
return function () {
clearTimeout(timeoutId);
};
},
each: function (obj, callback, args) {
if (!obj) return;
var value, i = 0, length = obj.length, isArray = atmosphere.util.isArray(obj);
if (args) {
if (isArray) {
for (; i < length; i++) {
value = callback.apply(obj[i], args);
if (value === false) {
break;
}
}
} else {
for (i in obj) {
value = callback.apply(obj[i], args);
if (value === false) {
break;
}
}
}
// A special, fast, case for the most common use of each
} else {
if (isArray) {
for (; i < length; i++) {
value = callback.call(obj[i], i, obj[i]);
if (value === false) {
break;
}
}
} else {
for (i in obj) {
value = callback.call(obj[i], i, obj[i]);
if (value === false) {
break;
}
}
}
}
return obj;
},
extend: function (target) {
var i, options, name;
for (i = 1; i < arguments.length; i++) {
if ((options = arguments[i]) != null) {
for (name in options) {
target[name] = options[name];
}
}
}
return target;
},
on: function (elem, type, fn) {
if (elem.addEventListener) {
elem.addEventListener(type, fn, false);
} else if (elem.attachEvent) {
elem.attachEvent("on" + type, fn);
}
},
off: function (elem, type, fn) {
if (elem.removeEventListener) {
elem.removeEventListener(type, fn, false);
} else if (elem.detachEvent) {
elem.detachEvent("on" + type, fn);
}
},
log: function (level, args) {
if (window.console) {
var logger = window.console[level];
if (typeof logger === 'function') {
logger.apply(window.console, args);
}
}
},
warn: function () {
atmosphere.util.log('warn', arguments);
},
info: function () {
atmosphere.util.log('info', arguments);
},
debug: function () {
atmosphere.util.log('debug', arguments);
},
error: function () {
atmosphere.util.log('error', arguments);
},
xhr: function () {
try {
return new window.XMLHttpRequest();
} catch (e1) {
try {
return new window.ActiveXObject("Microsoft.XMLHTTP");
} catch (e2) {
}
}
},
parseJSON: function (data) {
return !data ? null : window.JSON && window.JSON.parse ? window.JSON.parse(data) : new Function("return " + data)();
},
// http://github.com/flowersinthesand/stringifyJSON
stringifyJSON: function (value) {
var escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, meta = {
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"': '\\"',
'\\': '\\\\'
};
function quote(string) {
return '"' + string.replace(escapable, function (a) {
var c = meta[a];
return typeof c === "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
}) + '"';
}
function f(n) {
return n < 10 ? "0" + n : n;
}
return window.JSON && window.JSON.stringify ? window.JSON.stringify(value) : (function str(key, holder) {
var i, v, len, partial, value = holder[key], type = typeof value;
if (value && typeof value === "object" && typeof value.toJSON === "function") {
value = value.toJSON(key);
type = typeof value;
}
switch (type) {
case "string":
return quote(value);
case "number":
return isFinite(value) ? String(value) : "null";
case "boolean":
return String(value);
case "object":
if (!value) {
return "null";
}
switch (Object.prototype.toString.call(value)) {
case "[object Date]":
return isFinite(value.valueOf()) ? '"' + value.getUTCFullYear() + "-" + f(value.getUTCMonth() + 1) + "-"
+ f(value.getUTCDate()) + "T" + f(value.getUTCHours()) + ":" + f(value.getUTCMinutes()) + ":" + f(value.getUTCSeconds())
+ "Z" + '"' : "null";
case "[object Array]":
len = value.length;
partial = [];
for (i = 0; i < len; i++) {
partial.push(str(i, value) || "null");
}
return "[" + partial.join(",") + "]";
default:
partial = [];
for (i in value) {
if (hasOwn.call(value, i)) {
v = str(i, value);
if (v) {
partial.push(quote(i) + ":" + v);
}
}
}
return "{" + partial.join(",") + "}";
}
}
})("", {
"": value
});
},
checkCORSSupport: function () {
if (atmosphere.util.browser.msie && !window.XDomainRequest) {
return true;
} else if (atmosphere.util.browser.opera && atmosphere.util.browser.version < 12.0) {
return true;
}
// KreaTV 4.1 -> 4.4
else if (atmosphere.util.trim(navigator.userAgent).slice(0, 16) === "KreaTVWebKit/531") {
return true;
}
// KreaTV 3.8
else if (atmosphere.util.trim(navigator.userAgent).slice(-7).toLowerCase() === "kreatel") {
return true;
}
// Force Android to use CORS as some version like 2.2.3 fail otherwise
var ua = navigator.userAgent.toLowerCase();
var isAndroid = ua.indexOf("android") > -1;
if (isAndroid) {
return true;
}
return false;
}
};
guid = atmosphere.util.now();
// Browser sniffing
(function () {
var ua = navigator.userAgent.toLowerCase(),
match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
/(msie) ([\w.]+)/.exec(ua) ||
/(trident)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
[];
atmosphere.util.browser[match[1] || ""] = true;
atmosphere.util.browser.version = match[2] || "0";
// Trident is the layout engine of the Internet Explorer
// IE 11 has no "MSIE: 11.0" token
if (atmosphere.util.browser.trident) {
atmosphere.util.browser.msie = true;
}
// The storage event of Internet Explorer and Firefox 3 works strangely
if (atmosphere.util.browser.msie || (atmosphere.util.browser.mozilla && atmosphere.util.browser.version.split(".")[0] === "1")) {
atmosphere.util.storage = false;
}
})();
atmosphere.util.on(window, "unload", function (event) {
atmosphere.unsubscribe();
});
// Pressing ESC key in Firefox kills the connection
// for your information, this is fixed in Firefox 20
// https://bugzilla.mozilla.org/show_bug.cgi?id=614304
atmosphere.util.on(window, "keypress", function (event) {
if (event.charCode === 27 || event.keyCode === 27) {
if (event.preventDefault) {
event.preventDefault();
}
}
});
atmosphere.util.on(window, "offline", function () {
atmosphere.unsubscribe();
});
window.atmosphere = atmosphere;
})();
/* jshint eqnull:true, noarg:true, noempty:true, eqeqeq:true, evil:true, laxbreak:true, undef:true, browser:true, indent:false, maxerr:50 */
| stomita/cdnjs | ajax/libs/atmosphere/2.1.2/atmosphere.js | JavaScript | mit | 122,375 |
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2017, 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. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.3.1
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* HTML Table Generating Class
*
* Lets you create tables manually or from database result objects, or arrays.
*
* @package CodeIgniter
* @subpackage Libraries
* @category HTML Tables
* @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/libraries/table.html
*/
class CI_Table {
/**
* Data for table rows
*
* @var array
*/
public $rows = array();
/**
* Data for table heading
*
* @var array
*/
public $heading = array();
/**
* Whether or not to automatically create the table header
*
* @var bool
*/
public $auto_heading = TRUE;
/**
* Table caption
*
* @var string
*/
public $caption = NULL;
/**
* Table layout template
*
* @var array
*/
public $template = NULL;
/**
* Newline setting
*
* @var string
*/
public $newline = "\n";
/**
* Contents of empty cells
*
* @var string
*/
public $empty_cells = '';
/**
* Callback for custom table layout
*
* @var function
*/
public $function = NULL;
/**
* Set the template from the table config file if it exists
*
* @param array $config (default: array())
* @return void
*/
public function __construct($config = array())
{
// initialize config
foreach ($config as $key => $val)
{
$this->template[$key] = $val;
}
log_message('info', 'Table Class Initialized');
}
// --------------------------------------------------------------------
/**
* Set the template
*
* @param array $template
* @return bool
*/
public function set_template($template)
{
if ( ! is_array($template))
{
return FALSE;
}
$this->template = $template;
return TRUE;
}
// --------------------------------------------------------------------
/**
* Set the table heading
*
* Can be passed as an array or discreet params
*
* @param mixed
* @return CI_Table
*/
public function set_heading($args = array())
{
$this->heading = $this->_prep_args(func_get_args());
return $this;
}
// --------------------------------------------------------------------
/**
* Set columns. Takes a one-dimensional array as input and creates
* a multi-dimensional array with a depth equal to the number of
* columns. This allows a single array with many elements to be
* displayed in a table that has a fixed column count.
*
* @param array $array
* @param int $col_limit
* @return array
*/
public function make_columns($array = array(), $col_limit = 0)
{
if ( ! is_array($array) OR count($array) === 0 OR ! is_int($col_limit))
{
return FALSE;
}
// Turn off the auto-heading feature since it's doubtful we
// will want headings from a one-dimensional array
$this->auto_heading = FALSE;
if ($col_limit === 0)
{
return $array;
}
$new = array();
do
{
$temp = array_splice($array, 0, $col_limit);
if (count($temp) < $col_limit)
{
for ($i = count($temp); $i < $col_limit; $i++)
{
$temp[] = ' ';
}
}
$new[] = $temp;
}
while (count($array) > 0);
return $new;
}
// --------------------------------------------------------------------
/**
* Set "empty" cells
*
* Can be passed as an array or discreet params
*
* @param mixed $value
* @return CI_Table
*/
public function set_empty($value)
{
$this->empty_cells = $value;
return $this;
}
// --------------------------------------------------------------------
/**
* Add a table row
*
* Can be passed as an array or discreet params
*
* @param mixed
* @return CI_Table
*/
public function add_row($args = array())
{
$this->rows[] = $this->_prep_args(func_get_args());
return $this;
}
// --------------------------------------------------------------------
/**
* Prep Args
*
* Ensures a standard associative array format for all cell data
*
* @param array
* @return array
*/
protected function _prep_args($args)
{
// If there is no $args[0], skip this and treat as an associative array
// This can happen if there is only a single key, for example this is passed to table->generate
// array(array('foo'=>'bar'))
if (isset($args[0]) && count($args) === 1 && is_array($args[0]) && ! isset($args[0]['data']))
{
$args = $args[0];
}
foreach ($args as $key => $val)
{
is_array($val) OR $args[$key] = array('data' => $val);
}
return $args;
}
// --------------------------------------------------------------------
/**
* Add a table caption
*
* @param string $caption
* @return CI_Table
*/
public function set_caption($caption)
{
$this->caption = $caption;
return $this;
}
// --------------------------------------------------------------------
/**
* Generate the table
*
* @param mixed $table_data
* @return string
*/
public function generate($table_data = NULL)
{
// The table data can optionally be passed to this function
// either as a database result object or an array
if ( ! empty($table_data))
{
if ($table_data instanceof CI_DB_result)
{
$this->_set_from_db_result($table_data);
}
elseif (is_array($table_data))
{
$this->_set_from_array($table_data);
}
}
// Is there anything to display? No? Smite them!
if (empty($this->heading) && empty($this->rows))
{
return 'Undefined table data';
}
// Compile and validate the template date
$this->_compile_template();
// Validate a possibly existing custom cell manipulation function
if (isset($this->function) && ! is_callable($this->function))
{
$this->function = NULL;
}
// Build the table!
$out = $this->template['table_open'].$this->newline;
// Add any caption here
if ($this->caption)
{
$out .= '<caption>'.$this->caption.'</caption>'.$this->newline;
}
// Is there a table heading to display?
if ( ! empty($this->heading))
{
$out .= $this->template['thead_open'].$this->newline.$this->template['heading_row_start'].$this->newline;
foreach ($this->heading as $heading)
{
$temp = $this->template['heading_cell_start'];
foreach ($heading as $key => $val)
{
if ($key !== 'data')
{
$temp = str_replace('<th', '<th '.$key.'="'.$val.'"', $temp);
}
}
$out .= $temp.(isset($heading['data']) ? $heading['data'] : '').$this->template['heading_cell_end'];
}
$out .= $this->template['heading_row_end'].$this->newline.$this->template['thead_close'].$this->newline;
}
// Build the table rows
if ( ! empty($this->rows))
{
$out .= $this->template['tbody_open'].$this->newline;
$i = 1;
foreach ($this->rows as $row)
{
if ( ! is_array($row))
{
break;
}
// We use modulus to alternate the row colors
$name = fmod($i++, 2) ? '' : 'alt_';
$out .= $this->template['row_'.$name.'start'].$this->newline;
foreach ($row as $cell)
{
$temp = $this->template['cell_'.$name.'start'];
foreach ($cell as $key => $val)
{
if ($key !== 'data')
{
$temp = str_replace('<td', '<td '.$key.'="'.$val.'"', $temp);
}
}
$cell = isset($cell['data']) ? $cell['data'] : '';
$out .= $temp;
if ($cell === '' OR $cell === NULL)
{
$out .= $this->empty_cells;
}
elseif (isset($this->function))
{
$out .= call_user_func($this->function, $cell);
}
else
{
$out .= $cell;
}
$out .= $this->template['cell_'.$name.'end'];
}
$out .= $this->template['row_'.$name.'end'].$this->newline;
}
$out .= $this->template['tbody_close'].$this->newline;
}
$out .= $this->template['table_close'];
// Clear table class properties before generating the table
$this->clear();
return $out;
}
// --------------------------------------------------------------------
/**
* Clears the table arrays. Useful if multiple tables are being generated
*
* @return CI_Table
*/
public function clear()
{
$this->rows = array();
$this->heading = array();
$this->auto_heading = TRUE;
return $this;
}
// --------------------------------------------------------------------
/**
* Set table data from a database result object
*
* @param CI_DB_result $db_result Database result object
* @return void
*/
protected function _set_from_db_result($object)
{
// First generate the headings from the table column names
if ($this->auto_heading === TRUE && empty($this->heading))
{
$this->heading = $this->_prep_args($object->list_fields());
}
foreach ($object->result_array() as $row)
{
$this->rows[] = $this->_prep_args($row);
}
}
// --------------------------------------------------------------------
/**
* Set table data from an array
*
* @param array $data
* @return void
*/
protected function _set_from_array($data)
{
if ($this->auto_heading === TRUE && empty($this->heading))
{
$this->heading = $this->_prep_args(array_shift($data));
}
foreach ($data as &$row)
{
$this->rows[] = $this->_prep_args($row);
}
}
// --------------------------------------------------------------------
/**
* Compile Template
*
* @return void
*/
protected function _compile_template()
{
if ($this->template === NULL)
{
$this->template = $this->_default_template();
return;
}
$this->temp = $this->_default_template();
foreach (array('table_open', 'thead_open', 'thead_close', 'heading_row_start', 'heading_row_end', 'heading_cell_start', 'heading_cell_end', 'tbody_open', 'tbody_close', 'row_start', 'row_end', 'cell_start', 'cell_end', 'row_alt_start', 'row_alt_end', 'cell_alt_start', 'cell_alt_end', 'table_close') as $val)
{
if ( ! isset($this->template[$val]))
{
$this->template[$val] = $this->temp[$val];
}
}
}
// --------------------------------------------------------------------
/**
* Default Template
*
* @return array
*/
protected function _default_template()
{
return array(
'table_open' => '<table border="0" cellpadding="4" cellspacing="0">',
'thead_open' => '<thead>',
'thead_close' => '</thead>',
'heading_row_start' => '<tr>',
'heading_row_end' => '</tr>',
'heading_cell_start' => '<th>',
'heading_cell_end' => '</th>',
'tbody_open' => '<tbody>',
'tbody_close' => '</tbody>',
'row_start' => '<tr>',
'row_end' => '</tr>',
'cell_start' => '<td>',
'cell_end' => '</td>',
'row_alt_start' => '<tr>',
'row_alt_end' => '</tr>',
'cell_alt_start' => '<td>',
'cell_alt_end' => '</td>',
'table_close' => '</table>'
);
}
}
| ifabricadesoftwareprojects/empregofacil | system/libraries/Table.php | PHP | mit | 12,257 |
// Copyright 2015 Joyent, Inc.
var Key = require('./key');
var Fingerprint = require('./fingerprint');
var Signature = require('./signature');
var PrivateKey = require('./private-key');
var Certificate = require('./certificate');
var Identity = require('./identity');
var errs = require('./errors');
module.exports = {
/* top-level classes */
Key: Key,
parseKey: Key.parse,
Fingerprint: Fingerprint,
parseFingerprint: Fingerprint.parse,
Signature: Signature,
parseSignature: Signature.parse,
PrivateKey: PrivateKey,
parsePrivateKey: PrivateKey.parse,
Certificate: Certificate,
parseCertificate: Certificate.parse,
createSelfSignedCertificate: Certificate.createSelfSigned,
createCertificate: Certificate.create,
Identity: Identity,
identityFromDN: Identity.parseDN,
identityForHost: Identity.forHost,
identityForUser: Identity.forUser,
identityForEmail: Identity.forEmail,
/* errors */
FingerprintFormatError: errs.FingerprintFormatError,
InvalidAlgorithmError: errs.InvalidAlgorithmError,
KeyParseError: errs.KeyParseError,
SignatureParseError: errs.SignatureParseError,
KeyEncryptedError: errs.KeyEncryptedError,
CertificateParseError: errs.CertificateParseError
};
| csignsandgraphics/csignsandgraphics.github.io | _site/node_modules/sshpk/lib/index.js | JavaScript | mit | 1,196 |
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/querystring-stringify/querystring-stringify.js']) {
__coverage__['build/querystring-stringify/querystring-stringify.js'] = {"path":"build/querystring-stringify/querystring-stringify.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},"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,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],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0]},"f":{"1":0,"2":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}},"2":{"name":"(anonymous_2)","line":48,"loc":{"start":{"line":48,"column":24},"end":{"line":48,"column":48}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":106,"column":44}},"2":{"start":{"line":10,"column":0},"end":{"line":12,"column":15}},"3":{"start":{"line":25,"column":0},"end":{"line":25,"column":40}},"4":{"start":{"line":48,"column":0},"end":{"line":103,"column":2}},"5":{"start":{"line":49,"column":4},"end":{"line":52,"column":50}},"6":{"start":{"line":54,"column":4},"end":{"line":56,"column":5}},"7":{"start":{"line":55,"column":8},"end":{"line":55,"column":57}},"8":{"start":{"line":58,"column":4},"end":{"line":60,"column":5}},"9":{"start":{"line":59,"column":8},"end":{"line":59,"column":19}},"10":{"start":{"line":62,"column":4},"end":{"line":64,"column":5}},"11":{"start":{"line":63,"column":8},"end":{"line":63,"column":71}},"12":{"start":{"line":66,"column":4},"end":{"line":75,"column":5}},"13":{"start":{"line":67,"column":8},"end":{"line":67,"column":15}},"14":{"start":{"line":68,"column":8},"end":{"line":68,"column":39}},"15":{"start":{"line":69,"column":8},"end":{"line":69,"column":23}},"16":{"start":{"line":70,"column":8},"end":{"line":72,"column":9}},"17":{"start":{"line":71,"column":12},"end":{"line":71,"column":61}},"18":{"start":{"line":74,"column":8},"end":{"line":74,"column":27}},"19":{"start":{"line":79,"column":4},"end":{"line":83,"column":5}},"20":{"start":{"line":80,"column":8},"end":{"line":82,"column":9}},"21":{"start":{"line":81,"column":12},"end":{"line":81,"column":73}},"22":{"start":{"line":85,"column":4},"end":{"line":85,"column":20}},"23":{"start":{"line":86,"column":4},"end":{"line":86,"column":11}},"24":{"start":{"line":87,"column":4},"end":{"line":87,"column":35}},"25":{"start":{"line":88,"column":4},"end":{"line":88,"column":26}},"26":{"start":{"line":89,"column":4},"end":{"line":94,"column":5}},"27":{"start":{"line":90,"column":8},"end":{"line":93,"column":9}},"28":{"start":{"line":91,"column":12},"end":{"line":91,"column":32}},"29":{"start":{"line":92,"column":12},"end":{"line":92,"column":56}},"30":{"start":{"line":96,"column":4},"end":{"line":96,"column":16}},"31":{"start":{"line":97,"column":4},"end":{"line":97,"column":20}},"32":{"start":{"line":98,"column":4},"end":{"line":100,"column":5}},"33":{"start":{"line":99,"column":8},"end":{"line":99,"column":26}},"34":{"start":{"line":102,"column":4},"end":{"line":102,"column":13}}},"branchMap":{"1":{"line":50,"type":"cond-expr","locations":[{"start":{"line":50,"column":27},"end":{"line":50,"column":32}},{"start":{"line":50,"column":35},"end":{"line":50,"column":38}}]},"2":{"line":50,"type":"binary-expr","locations":[{"start":{"line":50,"column":14},"end":{"line":50,"column":15}},{"start":{"line":50,"column":19},"end":{"line":50,"column":24}}]},"3":{"line":51,"type":"cond-expr","locations":[{"start":{"line":51,"column":25},"end":{"line":51,"column":29}},{"start":{"line":51,"column":32},"end":{"line":51,"column":35}}]},"4":{"line":51,"type":"binary-expr","locations":[{"start":{"line":51,"column":13},"end":{"line":51,"column":14}},{"start":{"line":51,"column":18},"end":{"line":51,"column":22}}]},"5":{"line":52,"type":"cond-expr","locations":[{"start":{"line":52,"column":31},"end":{"line":52,"column":41}},{"start":{"line":52,"column":44},"end":{"line":52,"column":49}}]},"6":{"line":52,"type":"binary-expr","locations":[{"start":{"line":52,"column":13},"end":{"line":52,"column":14}},{"start":{"line":52,"column":18},"end":{"line":52,"column":28}}]},"7":{"line":54,"type":"if","locations":[{"start":{"line":54,"column":4},"end":{"line":54,"column":4}},{"start":{"line":54,"column":4},"end":{"line":54,"column":4}}]},"8":{"line":54,"type":"binary-expr","locations":[{"start":{"line":54,"column":8},"end":{"line":54,"column":21}},{"start":{"line":54,"column":25},"end":{"line":54,"column":43}},{"start":{"line":54,"column":47},"end":{"line":54,"column":64}}]},"9":{"line":55,"type":"cond-expr","locations":[{"start":{"line":55,"column":22},"end":{"line":55,"column":51}},{"start":{"line":55,"column":54},"end":{"line":55,"column":56}}]},"10":{"line":58,"type":"if","locations":[{"start":{"line":58,"column":4},"end":{"line":58,"column":4}},{"start":{"line":58,"column":4},"end":{"line":58,"column":4}}]},"11":{"line":58,"type":"binary-expr","locations":[{"start":{"line":58,"column":8},"end":{"line":58,"column":24}},{"start":{"line":58,"column":28},"end":{"line":58,"column":86}}]},"12":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":4},"end":{"line":62,"column":4}},{"start":{"line":62,"column":4},"end":{"line":62,"column":4}}]},"13":{"line":62,"type":"binary-expr","locations":[{"start":{"line":62,"column":8},"end":{"line":62,"column":23}},{"start":{"line":62,"column":27},"end":{"line":62,"column":42}}]},"14":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":4},"end":{"line":66,"column":4}},{"start":{"line":66,"column":4},"end":{"line":66,"column":4}}]},"15":{"line":68,"type":"cond-expr","locations":[{"start":{"line":68,"column":20},"end":{"line":68,"column":31}},{"start":{"line":68,"column":34},"end":{"line":68,"column":38}}]},"16":{"line":80,"type":"if","locations":[{"start":{"line":80,"column":8},"end":{"line":80,"column":8}},{"start":{"line":80,"column":8},"end":{"line":80,"column":8}}]},"17":{"line":87,"type":"cond-expr","locations":[{"start":{"line":87,"column":19},"end":{"line":87,"column":29}},{"start":{"line":87,"column":32},"end":{"line":87,"column":34}}]},"18":{"line":88,"type":"cond-expr","locations":[{"start":{"line":88,"column":17},"end":{"line":88,"column":20}},{"start":{"line":88,"column":23},"end":{"line":88,"column":25}}]},"19":{"line":90,"type":"if","locations":[{"start":{"line":90,"column":8},"end":{"line":90,"column":8}},{"start":{"line":90,"column":8},"end":{"line":90,"column":8}}]},"20":{"line":98,"type":"if","locations":[{"start":{"line":98,"column":4},"end":{"line":98,"column":4}},{"start":{"line":98,"column":4},"end":{"line":98,"column":4}}]},"21":{"line":98,"type":"binary-expr","locations":[{"start":{"line":98,"column":8},"end":{"line":98,"column":10}},{"start":{"line":98,"column":14},"end":{"line":98,"column":18}}]}},"code":["(function () { YUI.add('querystring-stringify', function (Y, NAME) {","","/**"," * Provides Y.QueryString.stringify method for converting objects to Query Strings."," *"," * @module querystring"," * @submodule querystring-stringify"," */","","var QueryString = Y.namespace(\"QueryString\"),"," stack = [],"," L = Y.Lang;","","/**"," * Provides Y.QueryString.escape method to be able to override default encoding"," * method. This is important in cases where non-standard delimiters are used, if"," * the delimiters would not normally be handled properly by the builtin"," * (en|de)codeURIComponent functions."," * Default: encodeURIComponent"," *"," * @method escape"," * @for QueryString"," * @static"," **/","QueryString.escape = encodeURIComponent;","","/**"," * <p>Converts an arbitrary value to a Query String representation.</p>"," *"," * <p>Objects with cyclical references will trigger an exception.</p>"," *"," * @method stringify"," * @for QueryString"," * @public"," * @param obj {Variant} any arbitrary value to convert to query string"," * @param cfg {Object} (optional) Configuration object. The three"," * supported configurations are:"," * <ul><li>sep: When defined, the value will be used as the key-value"," * separator. The default value is \"&\".</li>"," * <li>eq: When defined, the value will be used to join the key to"," * the value. The default value is \"=\".</li>"," * <li>arrayKey: When set to true, the key of an array will have the"," * '[]' notation appended to the key. The default value is false."," * </li></ul>"," * @param name {String} (optional) Name of the current key, for handling children recursively."," * @static"," */","QueryString.stringify = function (obj, c, name) {"," var begin, end, i, l, n, s,"," sep = c && c.sep ? c.sep : \"&\","," eq = c && c.eq ? c.eq : \"=\","," aK = c && c.arrayKey ? c.arrayKey : false;",""," if (L.isNull(obj) || L.isUndefined(obj) || L.isFunction(obj)) {"," return name ? QueryString.escape(name) + eq : '';"," }",""," if (L.isBoolean(obj) || Object.prototype.toString.call(obj) === '[object Boolean]') {"," obj =+ obj;"," }",""," if (L.isNumber(obj) || L.isString(obj)) {"," return QueryString.escape(name) + eq + QueryString.escape(obj);"," }",""," if (L.isArray(obj)) {"," s = [];"," name = aK ? name + '[]' : name;"," l = obj.length;"," for (i = 0; i < l; i++) {"," s.push( QueryString.stringify(obj[i], c, name) );"," }",""," return s.join(sep);"," }"," // now we know it's an object.",""," // Check for cyclical references in nested objects"," for (i = stack.length - 1; i >= 0; --i) {"," if (stack[i] === obj) {"," throw new Error(\"QueryString.stringify. Cyclical reference\");"," }"," }",""," stack.push(obj);"," s = [];"," begin = name ? name + '[' : '';"," end = name ? ']' : '';"," for (i in obj) {"," if (obj.hasOwnProperty(i)) {"," n = begin + i + end;"," s.push(QueryString.stringify(obj[i], c, n));"," }"," }",""," stack.pop();"," s = s.join(sep);"," if (!s && name) {"," return name + \"=\";"," }",""," return s;","};","","","}, '@VERSION@', {\"requires\": [\"yui-base\"]});","","}());"]};
}
var __cov_MF$vqAUJeR_umistRYm1qw = __coverage__['build/querystring-stringify/querystring-stringify.js'];
__cov_MF$vqAUJeR_umistRYm1qw.s['1']++;YUI.add('querystring-stringify',function(Y,NAME){__cov_MF$vqAUJeR_umistRYm1qw.f['1']++;__cov_MF$vqAUJeR_umistRYm1qw.s['2']++;var QueryString=Y.namespace('QueryString'),stack=[],L=Y.Lang;__cov_MF$vqAUJeR_umistRYm1qw.s['3']++;QueryString.escape=encodeURIComponent;__cov_MF$vqAUJeR_umistRYm1qw.s['4']++;QueryString.stringify=function(obj,c,name){__cov_MF$vqAUJeR_umistRYm1qw.f['2']++;__cov_MF$vqAUJeR_umistRYm1qw.s['5']++;var begin,end,i,l,n,s,sep=(__cov_MF$vqAUJeR_umistRYm1qw.b['2'][0]++,c)&&(__cov_MF$vqAUJeR_umistRYm1qw.b['2'][1]++,c.sep)?(__cov_MF$vqAUJeR_umistRYm1qw.b['1'][0]++,c.sep):(__cov_MF$vqAUJeR_umistRYm1qw.b['1'][1]++,'&'),eq=(__cov_MF$vqAUJeR_umistRYm1qw.b['4'][0]++,c)&&(__cov_MF$vqAUJeR_umistRYm1qw.b['4'][1]++,c.eq)?(__cov_MF$vqAUJeR_umistRYm1qw.b['3'][0]++,c.eq):(__cov_MF$vqAUJeR_umistRYm1qw.b['3'][1]++,'='),aK=(__cov_MF$vqAUJeR_umistRYm1qw.b['6'][0]++,c)&&(__cov_MF$vqAUJeR_umistRYm1qw.b['6'][1]++,c.arrayKey)?(__cov_MF$vqAUJeR_umistRYm1qw.b['5'][0]++,c.arrayKey):(__cov_MF$vqAUJeR_umistRYm1qw.b['5'][1]++,false);__cov_MF$vqAUJeR_umistRYm1qw.s['6']++;if((__cov_MF$vqAUJeR_umistRYm1qw.b['8'][0]++,L.isNull(obj))||(__cov_MF$vqAUJeR_umistRYm1qw.b['8'][1]++,L.isUndefined(obj))||(__cov_MF$vqAUJeR_umistRYm1qw.b['8'][2]++,L.isFunction(obj))){__cov_MF$vqAUJeR_umistRYm1qw.b['7'][0]++;__cov_MF$vqAUJeR_umistRYm1qw.s['7']++;return name?(__cov_MF$vqAUJeR_umistRYm1qw.b['9'][0]++,QueryString.escape(name)+eq):(__cov_MF$vqAUJeR_umistRYm1qw.b['9'][1]++,'');}else{__cov_MF$vqAUJeR_umistRYm1qw.b['7'][1]++;}__cov_MF$vqAUJeR_umistRYm1qw.s['8']++;if((__cov_MF$vqAUJeR_umistRYm1qw.b['11'][0]++,L.isBoolean(obj))||(__cov_MF$vqAUJeR_umistRYm1qw.b['11'][1]++,Object.prototype.toString.call(obj)==='[object Boolean]')){__cov_MF$vqAUJeR_umistRYm1qw.b['10'][0]++;__cov_MF$vqAUJeR_umistRYm1qw.s['9']++;obj=+obj;}else{__cov_MF$vqAUJeR_umistRYm1qw.b['10'][1]++;}__cov_MF$vqAUJeR_umistRYm1qw.s['10']++;if((__cov_MF$vqAUJeR_umistRYm1qw.b['13'][0]++,L.isNumber(obj))||(__cov_MF$vqAUJeR_umistRYm1qw.b['13'][1]++,L.isString(obj))){__cov_MF$vqAUJeR_umistRYm1qw.b['12'][0]++;__cov_MF$vqAUJeR_umistRYm1qw.s['11']++;return QueryString.escape(name)+eq+QueryString.escape(obj);}else{__cov_MF$vqAUJeR_umistRYm1qw.b['12'][1]++;}__cov_MF$vqAUJeR_umistRYm1qw.s['12']++;if(L.isArray(obj)){__cov_MF$vqAUJeR_umistRYm1qw.b['14'][0]++;__cov_MF$vqAUJeR_umistRYm1qw.s['13']++;s=[];__cov_MF$vqAUJeR_umistRYm1qw.s['14']++;name=aK?(__cov_MF$vqAUJeR_umistRYm1qw.b['15'][0]++,name+'[]'):(__cov_MF$vqAUJeR_umistRYm1qw.b['15'][1]++,name);__cov_MF$vqAUJeR_umistRYm1qw.s['15']++;l=obj.length;__cov_MF$vqAUJeR_umistRYm1qw.s['16']++;for(i=0;i<l;i++){__cov_MF$vqAUJeR_umistRYm1qw.s['17']++;s.push(QueryString.stringify(obj[i],c,name));}__cov_MF$vqAUJeR_umistRYm1qw.s['18']++;return s.join(sep);}else{__cov_MF$vqAUJeR_umistRYm1qw.b['14'][1]++;}__cov_MF$vqAUJeR_umistRYm1qw.s['19']++;for(i=stack.length-1;i>=0;--i){__cov_MF$vqAUJeR_umistRYm1qw.s['20']++;if(stack[i]===obj){__cov_MF$vqAUJeR_umistRYm1qw.b['16'][0]++;__cov_MF$vqAUJeR_umistRYm1qw.s['21']++;throw new Error('QueryString.stringify. Cyclical reference');}else{__cov_MF$vqAUJeR_umistRYm1qw.b['16'][1]++;}}__cov_MF$vqAUJeR_umistRYm1qw.s['22']++;stack.push(obj);__cov_MF$vqAUJeR_umistRYm1qw.s['23']++;s=[];__cov_MF$vqAUJeR_umistRYm1qw.s['24']++;begin=name?(__cov_MF$vqAUJeR_umistRYm1qw.b['17'][0]++,name+'['):(__cov_MF$vqAUJeR_umistRYm1qw.b['17'][1]++,'');__cov_MF$vqAUJeR_umistRYm1qw.s['25']++;end=name?(__cov_MF$vqAUJeR_umistRYm1qw.b['18'][0]++,']'):(__cov_MF$vqAUJeR_umistRYm1qw.b['18'][1]++,'');__cov_MF$vqAUJeR_umistRYm1qw.s['26']++;for(i in obj){__cov_MF$vqAUJeR_umistRYm1qw.s['27']++;if(obj.hasOwnProperty(i)){__cov_MF$vqAUJeR_umistRYm1qw.b['19'][0]++;__cov_MF$vqAUJeR_umistRYm1qw.s['28']++;n=begin+i+end;__cov_MF$vqAUJeR_umistRYm1qw.s['29']++;s.push(QueryString.stringify(obj[i],c,n));}else{__cov_MF$vqAUJeR_umistRYm1qw.b['19'][1]++;}}__cov_MF$vqAUJeR_umistRYm1qw.s['30']++;stack.pop();__cov_MF$vqAUJeR_umistRYm1qw.s['31']++;s=s.join(sep);__cov_MF$vqAUJeR_umistRYm1qw.s['32']++;if((__cov_MF$vqAUJeR_umistRYm1qw.b['21'][0]++,!s)&&(__cov_MF$vqAUJeR_umistRYm1qw.b['21'][1]++,name)){__cov_MF$vqAUJeR_umistRYm1qw.b['20'][0]++;__cov_MF$vqAUJeR_umistRYm1qw.s['33']++;return name+'=';}else{__cov_MF$vqAUJeR_umistRYm1qw.b['20'][1]++;}__cov_MF$vqAUJeR_umistRYm1qw.s['34']++;return s;};},'@VERSION@',{'requires':['yui-base']});
| wil93/cdnjs | ajax/libs/yui/3.11.0/querystring-stringify/querystring-stringify-coverage.js | JavaScript | mit | 14,868 |
<?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\Bundle\WebProfilerBundle\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Profiler\Profiler;
use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\WebProfilerBundle\Profiler\TemplateManager;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
/**
* ProfilerController.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class ProfilerController
{
private $templateManager;
private $generator;
private $profiler;
private $twig;
private $templates;
private $toolbarPosition;
/**
* Constructor.
*
* @param UrlGeneratorInterface $generator The URL Generator
* @param Profiler $profiler The profiler
* @param \Twig_Environment $twig The twig environment
* @param array $templates The templates
* @param string $toolbarPosition The toolbar position (top, bottom, normal, or null -- use the configuration)
*/
public function __construct(UrlGeneratorInterface $generator, Profiler $profiler = null, \Twig_Environment $twig, array $templates, $toolbarPosition = 'normal')
{
$this->generator = $generator;
$this->profiler = $profiler;
$this->twig = $twig;
$this->templates = $templates;
$this->toolbarPosition = $toolbarPosition;
}
/**
* Redirects to the last profiles.
*
* @return RedirectResponse A RedirectResponse instance
*
* @throws NotFoundHttpException
*/
public function homeAction()
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$this->profiler->disable();
return new RedirectResponse($this->generator->generate('_profiler_search_results', array('token' => 'empty', 'limit' => 10)), 302, array('Content-Type' => 'text/html'));
}
/**
* Renders a profiler panel for the given token.
*
* @param Request $request The current HTTP request
* @param string $token The profiler token
*
* @return Response A Response instance
*
* @throws NotFoundHttpException
*/
public function panelAction(Request $request, $token)
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$this->profiler->disable();
$panel = $request->query->get('panel', 'request');
$page = $request->query->get('page', 'home');
if (!$profile = $this->profiler->loadProfile($token)) {
return new Response($this->twig->render('@WebProfiler/Profiler/info.html.twig', array('about' => 'no_token', 'token' => $token)), 200, array('Content-Type' => 'text/html'));
}
if (!$profile->hasCollector($panel)) {
throw new NotFoundHttpException(sprintf('Panel "%s" is not available for token "%s".', $panel, $token));
}
return new Response($this->twig->render($this->getTemplateManager()->getName($profile, $panel), array(
'token' => $token,
'profile' => $profile,
'collector' => $profile->getCollector($panel),
'panel' => $panel,
'page' => $page,
'request' => $request,
'templates' => $this->getTemplateManager()->getTemplates($profile),
'is_ajax' => $request->isXmlHttpRequest(),
)), 200, array('Content-Type' => 'text/html'));
}
/**
* Exports data for a given token.
*
* @param string $token The profiler token
*
* @return Response A Response instance
*
* @throws NotFoundHttpException
*/
public function exportAction($token)
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$this->profiler->disable();
if (!$profile = $this->profiler->loadProfile($token)) {
throw new NotFoundHttpException(sprintf('Token "%s" does not exist.', $token));
}
return new Response($this->profiler->export($profile), 200, array(
'Content-Type' => 'text/plain',
'Content-Disposition' => 'attachment; filename= '.$token.'.txt',
));
}
/**
* Purges all tokens.
*
* @return Response A Response instance
*
* @throws NotFoundHttpException
*/
public function purgeAction()
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$this->profiler->disable();
$this->profiler->purge();
return new RedirectResponse($this->generator->generate('_profiler_info', array('about' => 'purge')), 302, array('Content-Type' => 'text/html'));
}
/**
* Imports token data.
*
* @param Request $request The current HTTP Request
*
* @return Response A Response instance
*
* @throws NotFoundHttpException
*/
public function importAction(Request $request)
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$this->profiler->disable();
$file = $request->files->get('file');
if (empty($file) || !$file->isValid()) {
return new RedirectResponse($this->generator->generate('_profiler_info', array('about' => 'upload_error')), 302, array('Content-Type' => 'text/html'));
}
if (!$profile = $this->profiler->import(file_get_contents($file->getPathname()))) {
return new RedirectResponse($this->generator->generate('_profiler_info', array('about' => 'already_exists')), 302, array('Content-Type' => 'text/html'));
}
return new RedirectResponse($this->generator->generate('_profiler', array('token' => $profile->getToken())), 302, array('Content-Type' => 'text/html'));
}
/**
* Displays information page.
*
* @param string $about The about message
*
* @return Response A Response instance
*
* @throws NotFoundHttpException
*/
public function infoAction($about)
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$this->profiler->disable();
return new Response($this->twig->render('@WebProfiler/Profiler/info.html.twig', array(
'about' => $about
)), 200, array('Content-Type' => 'text/html'));
}
/**
* Renders the Web Debug Toolbar.
*
* @param Request $request The current HTTP Request
* @param string $token The profiler token
*
* @return Response A Response instance
*
* @throws NotFoundHttpException
*/
public function toolbarAction(Request $request, $token)
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$session = $request->getSession();
if (null !== $session && $session->getFlashBag() instanceof AutoExpireFlashBag) {
// keep current flashes for one more request if using AutoExpireFlashBag
$session->getFlashBag()->setAll($session->getFlashBag()->peekAll());
}
if (null === $token) {
return new Response('', 200, array('Content-Type' => 'text/html'));
}
$this->profiler->disable();
if (!$profile = $this->profiler->loadProfile($token)) {
return new Response('', 200, array('Content-Type' => 'text/html'));
}
// the toolbar position (top, bottom, normal, or null -- use the configuration)
if (null === $position = $request->query->get('position')) {
$position = $this->toolbarPosition;
}
$url = null;
try {
$url = $this->generator->generate('_profiler', array('token' => $token));
} catch (\Exception $e) {
// the profiler is not enabled
}
return new Response($this->twig->render('@WebProfiler/Profiler/toolbar.html.twig', array(
'position' => $position,
'profile' => $profile,
'templates' => $this->getTemplateManager()->getTemplates($profile),
'profiler_url' => $url,
'token' => $token,
)), 200, array('Content-Type' => 'text/html'));
}
/**
* Renders the profiler search bar.
*
* @param Request $request The current HTTP Request
*
* @return Response A Response instance
*
* @throws NotFoundHttpException
*/
public function searchBarAction(Request $request)
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$this->profiler->disable();
if (null === $session = $request->getSession()) {
$ip =
$method =
$url =
$start =
$end =
$limit =
$token = null;
} else {
$ip = $session->get('_profiler_search_ip');
$method = $session->get('_profiler_search_method');
$url = $session->get('_profiler_search_url');
$start = $session->get('_profiler_search_start');
$end = $session->get('_profiler_search_end');
$limit = $session->get('_profiler_search_limit');
$token = $session->get('_profiler_search_token');
}
return new Response($this->twig->render('@WebProfiler/Profiler/search.html.twig', array(
'token' => $token,
'ip' => $ip,
'method' => $method,
'url' => $url,
'start' => $start,
'end' => $end,
'limit' => $limit,
)), 200, array('Content-Type' => 'text/html'));
}
/**
* Search results.
*
* @param Request $request The current HTTP Request
* @param string $token The token
*
* @return Response A Response instance
*
* @throws NotFoundHttpException
*/
public function searchResultsAction(Request $request, $token)
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$this->profiler->disable();
$profile = $this->profiler->loadProfile($token);
$ip = $request->query->get('ip');
$method = $request->query->get('method');
$url = $request->query->get('url');
$start = $request->query->get('start', null);
$end = $request->query->get('end', null);
$limit = $request->query->get('limit');
return new Response($this->twig->render('@WebProfiler/Profiler/results.html.twig', array(
'token' => $token,
'profile' => $profile,
'tokens' => $this->profiler->find($ip, $url, $limit, $method, $start, $end),
'ip' => $ip,
'method' => $method,
'url' => $url,
'start' => $start,
'end' => $end,
'limit' => $limit,
'panel' => null,
)), 200, array('Content-Type' => 'text/html'));
}
/**
* Narrow the search bar.
*
* @param Request $request The current HTTP Request
*
* @return Response A Response instance
*
* @throws NotFoundHttpException
*/
public function searchAction(Request $request)
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$this->profiler->disable();
$ip = preg_replace('/[^:\d\.]/', '', $request->query->get('ip'));
$method = $request->query->get('method');
$url = $request->query->get('url');
$start = $request->query->get('start', null);
$end = $request->query->get('end', null);
$limit = $request->query->get('limit');
$token = $request->query->get('token');
if (null !== $session = $request->getSession()) {
$session->set('_profiler_search_ip', $ip);
$session->set('_profiler_search_method', $method);
$session->set('_profiler_search_url', $url);
$session->set('_profiler_search_start', $start);
$session->set('_profiler_search_end', $end);
$session->set('_profiler_search_limit', $limit);
$session->set('_profiler_search_token', $token);
}
if (!empty($token)) {
return new RedirectResponse($this->generator->generate('_profiler', array('token' => $token)), 302, array('Content-Type' => 'text/html'));
}
$tokens = $this->profiler->find($ip, $url, $limit, $method, $start, $end);
return new RedirectResponse($this->generator->generate('_profiler_search_results', array(
'token' => $tokens ? $tokens[0]['token'] : 'empty',
'ip' => $ip,
'method' => $method,
'url' => $url,
'start' => $start,
'end' => $end,
'limit' => $limit,
)), 302, array('Content-Type' => 'text/html'));
}
/**
* Displays the PHP info.
*
* @return Response A Response instance
*
* @throws NotFoundHttpException
*/
public function phpinfoAction()
{
if (null === $this->profiler) {
throw new NotFoundHttpException('The profiler must be enabled.');
}
$this->profiler->disable();
ob_start();
phpinfo();
$phpinfo = ob_get_clean();
return new Response($phpinfo, 200, array('Content-Type' => 'text/html'));
}
/**
* Gets the Template Manager.
*
* @return TemplateManager The Template Manager
*/
protected function getTemplateManager()
{
if (null === $this->templateManager) {
$this->templateManager = new TemplateManager($this->profiler, $this->twig, $this->templates);
}
return $this->templateManager;
}
}
| efrax/IMDER | vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php | PHP | mit | 14,744 |
// History
(function($){
var history_menu,
history_handle_top;
$(function(){
$("body").on("pnotify.history-all", function(){
// Display all notices. (Disregarding non-history notices.)
$.each(PNotify.notices, function(){
if (this.modules.history.inHistory) {
if (this.elem.is(":visible")) {
// The hide variable controls whether the history pull down should
// queue a removal timer.
if (this.options.hide)
this.queueRemove();
} else if (this.open)
this.open();
}
});
}).on("pnotify.history-last", function(){
var pushTop = (PNotify.prototype.options.stack.push === "top");
// Look up the last history notice, and display it.
var i = (pushTop ? 0 : -1);
var notice;
do {
if (i === -1)
notice = PNotify.notices.slice(i);
else
notice = PNotify.notices.slice(i, i+1);
if (!notice[0])
return false;
i = (pushTop ? i + 1 : i - 1);
} while (!notice[0].modules.history.inHistory || notice[0].elem.is(":visible"));
if (notice[0].open)
notice[0].open();
});
});
PNotify.prototype.options.history = {
// Place the notice in the history.
history: true,
// Display a pull down menu to redisplay previous notices.
menu: false,
// Make the pull down menu fixed to the top of the viewport.
fixed: true,
// Maximum number of notifications to have onscreen.
maxonscreen: Infinity,
// The various displayed text, helps facilitating internationalization.
labels: {
redisplay: "Redisplay",
all: "All",
last: "Last"
}
};
PNotify.prototype.modules.history = {
// The history variable controls whether the notice gets redisplayed
// by the history pull down.
inHistory: false,
init: function(notice, options){
// Make sure that no notices get destroyed.
notice.options.destroy = false;
this.inHistory = options.history;
if (options.menu) {
// If there isn't a history pull down, create one.
if (typeof history_menu === "undefined") {
history_menu = $("<div />", {
"class": "ui-pnotify-history-container "+notice.styles.hi_menu,
"mouseleave": function(){
history_menu.animate({top: "-"+history_handle_top+"px"}, {duration: 100, queue: false});
}
})
.append($("<div />", {"class": "ui-pnotify-history-header", "text": options.labels.redisplay}))
.append($("<button />", {
"class": "ui-pnotify-history-all "+notice.styles.hi_btn,
"text": options.labels.all,
"mouseenter": function(){
$(this).addClass(notice.styles.hi_btnhov);
},
"mouseleave": function(){
$(this).removeClass(notice.styles.hi_btnhov);
},
"click": function(){
$(this).trigger("pnotify.history-all");
return false;
}
}))
.append($("<button />", {
"class": "ui-pnotify-history-last "+notice.styles.hi_btn,
"text": options.labels.last,
"mouseenter": function(){
$(this).addClass(notice.styles.hi_btnhov);
},
"mouseleave": function(){
$(this).removeClass(notice.styles.hi_btnhov);
},
"click": function(){
$(this).trigger("pnotify.history-last");
return false;
}
}))
.appendTo("body");
// Make a handle so the user can pull down the history tab.
var handle = $("<span />", {
"class": "ui-pnotify-history-pulldown "+notice.styles.hi_hnd,
"mouseenter": function(){
history_menu.animate({top: "0"}, {duration: 100, queue: false});
}
})
.appendTo(history_menu);
// Get the top of the handle.
console.log(handle.offset());
history_handle_top = handle.offset().top + 2;
// Hide the history pull down up to the top of the handle.
history_menu.css({top: "-"+history_handle_top+"px"});
// Apply the fixed styling.
if (options.fixed) {
history_menu.addClass('ui-pnotify-history-fixed');
}
}
}
},
update: function(notice, options){
// Update values for history menu access.
this.inHistory = options.history;
if (options.fixed && history_menu) {
history_menu.addClass('ui-pnotify-history-fixed');
} else if (history_menu) {
history_menu.removeClass('ui-pnotify-history-fixed');
}
},
beforeOpen: function(notice, options){
// Remove oldest notifications leaving only options.maxonscreen on screen
if (PNotify.notices && (PNotify.notices.length > options.maxonscreen)) {
// Oldest are normally in front of array, or if stack.push=="top" then
// they are at the end of the array! (issue #98)
var el;
if (notice.options.stack.push !== "top")
el = PNotify.notices.slice(0, PNotify.notices.length - options.maxonscreen);
else
el = PNotify.notices.slice(options.maxonscreen, PNotify.notices.length);
$.each(el, function(){
if (this.remove)
this.remove();
});
}
}
};
$.extend(PNotify.styling.jqueryui, {
hi_menu: "ui-state-default ui-corner-bottom",
hi_btn: "ui-state-default ui-corner-all",
hi_btnhov: "ui-state-hover",
hi_hnd: "ui-icon ui-icon-grip-dotted-horizontal"
});
$.extend(PNotify.styling.bootstrap2, {
hi_menu: "well",
hi_btn: "btn",
hi_btnhov: "",
hi_hnd: "icon-chevron-down"
});
$.extend(PNotify.styling.bootstrap3, {
hi_menu: "well",
hi_btn: "btn btn-default",
hi_btnhov: "",
hi_hnd: "glyphicon glyphicon-chevron-down"
});
$.extend(PNotify.styling.fontawesome, {
hi_menu: "well",
hi_btn: "btn btn-default",
hi_btnhov: "",
hi_hnd: "fa fa-chevron-down"
});
})(jQuery);
| chrisdavies/cdnjs | ajax/libs/pnotify/2.0.0/pnotify.history.js | JavaScript | mit | 5,564 |
/**
* jQRangeSlider
* A javascript slider selector that supports dates
*
* Copyright (C) Guillaume Gautreau 2012
* Dual licensed under the MIT or GPL Version 2 licenses.
*/
(function($, undefined){
"use strict";
$.widget("ui.rangeSliderDraggable", $.ui.rangeSliderMouseTouch, {
cache: null,
options: {
containment: null
},
_create: function(){
$.ui.rangeSliderMouseTouch.prototype._create.apply(this);
setTimeout($.proxy(this._initElementIfNotDestroyed, this), 10);
},
destroy: function(){
this.cache = null;
$.ui.rangeSliderMouseTouch.prototype.destroy.apply(this);
},
_initElementIfNotDestroyed: function(){
if (this._mouseInit){
this._initElement();
}
},
_initElement: function(){
this._mouseInit();
this._cache();
},
_setOption: function(key, value){
if (key === "containment"){
if (value === null || $(value).length === 0){
this.options.containment = null
}else{
this.options.containment = $(value);
}
}
},
/*
* UI mouse widget
*/
_mouseStart: function(event){
this._cache();
this.cache.click = {
left: event.pageX,
top: event.pageY
};
this.cache.initialOffset = this.element.offset();
this._triggerMouseEvent("mousestart");
return true;
},
_mouseDrag: function(event){
var position = event.pageX - this.cache.click.left;
position = this._constraintPosition(position + this.cache.initialOffset.left);
this._applyPosition(position);
this._triggerMouseEvent("sliderDrag");
return false;
},
_mouseStop: function(){
this._triggerMouseEvent("stop");
},
/*
* To be overriden
*/
_constraintPosition: function(position){
if (this.element.parent().length !== 0 && this.cache.parent.offset !== null){
position = Math.min(position,
this.cache.parent.offset.left + this.cache.parent.width - this.cache.width.outer);
position = Math.max(position, this.cache.parent.offset.left);
}
return position;
},
_applyPosition: function(position){
var offset = {
top: this.cache.offset.top,
left: position
}
this.element.offset({left:position});
this.cache.offset = offset;
},
/*
* Private utils
*/
_cacheIfNecessary: function(){
if (this.cache === null){
this._cache();
}
},
_cache: function(){
this.cache = {};
this._cacheMargins();
this._cacheParent();
this._cacheDimensions();
this.cache.offset = this.element.offset();
},
_cacheMargins: function(){
this.cache.margin = {
left: this._parsePixels(this.element, "marginLeft"),
right: this._parsePixels(this.element, "marginRight"),
top: this._parsePixels(this.element, "marginTop"),
bottom: this._parsePixels(this.element, "marginBottom")
};
},
_cacheParent: function(){
if (this.options.parent !== null){
var container = this.element.parent();
this.cache.parent = {
offset: container.offset(),
width: container.width()
}
}else{
this.cache.parent = null;
}
},
_cacheDimensions: function(){
this.cache.width = {
outer: this.element.outerWidth(),
inner: this.element.width()
}
},
_parsePixels: function(element, string){
return parseInt(element.css(string), 10) || 0;
},
_triggerMouseEvent: function(event){
var data = this._prepareEventData();
this.element.trigger(event, data);
},
_prepareEventData: function(){
return {
element: this.element,
offset: this.cache.offset || null
};
}
});
}(jQuery)); | extend1994/cdnjs | ajax/libs/jQRangeSlider/5.4.0/jQRangeSliderDraggable.js | JavaScript | mit | 3,553 |
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2017, 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. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 3.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* PDO PostgreSQL Forge Class
*
* @category Database
* @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/
*/
class CI_DB_pdo_pgsql_forge extends CI_DB_pdo_forge {
/**
* DROP TABLE IF statement
*
* @var string
*/
protected $_drop_table_if = 'DROP TABLE IF EXISTS';
/**
* UNSIGNED support
*
* @var array
*/
protected $_unsigned = array(
'INT2' => 'INTEGER',
'SMALLINT' => 'INTEGER',
'INT' => 'BIGINT',
'INT4' => 'BIGINT',
'INTEGER' => 'BIGINT',
'INT8' => 'NUMERIC',
'BIGINT' => 'NUMERIC',
'REAL' => 'DOUBLE PRECISION',
'FLOAT' => 'DOUBLE PRECISION'
);
/**
* NULL value representation in CREATE/ALTER TABLE statements
*
* @var string
*/
protected $_null = 'NULL';
// --------------------------------------------------------------------
/**
* Class constructor
*
* @param object &$db Database object
* @return void
*/
public function __construct(&$db)
{
parent::__construct($db);
if (version_compare($this->db->version(), '9.0', '>'))
{
$this->create_table_if = 'CREATE TABLE IF NOT EXISTS';
}
}
// --------------------------------------------------------------------
/**
* 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 (version_compare($this->db->version(), '8', '>=') && 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[] = $sql.' ALTER COLUMN '.$this->db->escape_identifiers($field[$i]['name'])
.($field[$i]['null'] === TRUE ? ' DROP NOT NULL' : ' SET NOT NULL');
}
if ( ! empty($field[$i]['new_name']))
{
$sqls[] = $sql.' RENAME COLUMN '.$this->db->escape_identifiers($field[$i]['name'])
.' TO '.$this->db->escape_identifiers($field[$i]['new_name']);
}
if ( ! empty($field[$i]['comment']))
{
$sqls[] = 'COMMENT ON COLUMN '
.$this->db->escape_identifiers($table).'.'.$this->db->escape_identifiers($field[$i]['name'])
.' IS '.$field[$i]['comment'];
}
}
return $sqls;
}
// --------------------------------------------------------------------
/**
* Field attribute TYPE
*
* Performs a data type mapping between different databases.
*
* @param array &$attributes
* @return void
*/
protected function _attr_type(&$attributes)
{
// Reset field lengths for data types that don't support it
if (isset($attributes['CONSTRAINT']) && stripos($attributes['TYPE'], 'int') !== FALSE)
{
$attributes['CONSTRAINT'] = NULL;
}
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 AUTO_INCREMENT
*
* @param array &$attributes
* @param array &$field
* @return void
*/
protected function _attr_auto_increment(&$attributes, &$field)
{
if ( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE)
{
$field['type'] = ($field['type'] === 'NUMERIC')
? 'BIGSERIAL'
: 'SERIAL';
}
}
}
| WilliamCauich10/Sistema | system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php | PHP | mit | 5,791 |
'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": [
"zondag",
"maandag",
"dinsdag",
"woensdag",
"donderdag",
"vrijdag",
"zaterdag"
],
"ERANAMES": [
"voor Christus",
"na Christus"
],
"ERAS": [
"v.Chr.",
"n.Chr."
],
"FIRSTDAYOFWEEK": 0,
"MONTH": [
"januari",
"februari",
"maart",
"april",
"mei",
"juni",
"juli",
"augustus",
"september",
"oktober",
"november",
"december"
],
"SHORTDAY": [
"zo",
"ma",
"di",
"wo",
"do",
"vr",
"za"
],
"SHORTMONTH": [
"jan.",
"feb.",
"mrt.",
"apr.",
"mei",
"jun.",
"jul.",
"aug.",
"sep.",
"okt.",
"nov.",
"dec."
],
"STANDALONEMONTH": [
"Januari",
"Februari",
"Maart",
"April",
"Mei",
"Juni",
"Juli",
"Augustus",
"September",
"Oktober",
"November",
"December"
],
"WEEKENDRANGE": [
5,
6
],
"fullDate": "EEEE d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y HH:mm:ss",
"mediumDate": "d MMM y",
"mediumTime": "HH:mm:ss",
"short": "dd-MM-yy HH:mm",
"shortDate": "dd-MM-yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "$",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4\u00a0-",
"negSuf": "",
"posPre": "\u00a4\u00a0",
"posSuf": ""
}
]
},
"id": "nl-sr",
"localeID": "nl_SR",
"pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
| kennynaoh/cdnjs | ajax/libs/angular.js/1.5.5/i18n/angular-locale_nl-sr.js | JavaScript | mit | 2,741 |
/*
* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
#include <Box2D/Dynamics/Contacts/b2PolygonContact.h>
#include <Box2D/Common/b2BlockAllocator.h>
#include <Box2D/Collision/b2TimeOfImpact.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <Box2D/Dynamics/b2WorldCallbacks.h>
#include <new>
using namespace std;
b2Contact* b2PolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator)
{
void* mem = allocator->Allocate(sizeof(b2PolygonContact));
return new (mem) b2PolygonContact(fixtureA, fixtureB);
}
void b2PolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator)
{
((b2PolygonContact*)contact)->~b2PolygonContact();
allocator->Free(contact, sizeof(b2PolygonContact));
}
b2PolygonContact::b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB)
: b2Contact(fixtureA, 0, fixtureB, 0)
{
b2Assert(m_fixtureA->GetType() == b2Shape::e_polygon);
b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon);
}
void b2PolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB)
{
b2CollidePolygons( manifold,
(b2PolygonShape*)m_fixtureA->GetShape(), xfA,
(b2PolygonShape*)m_fixtureB->GetShape(), xfB);
}
| NusantaraSoftware/TumeriQ | libs/Box2D/Dynamics/Contacts/b2PolygonContact.cpp | C++ | mit | 2,154 |
define(function (require) {
var SymbolDraw = require('../helper/SymbolDraw');
var LargeSymbolDraw = require('../helper/LargeSymbolDraw');
require('../../echarts').extendChartView({
type: 'scatter',
init: function () {
this._normalSymbolDraw = new SymbolDraw();
this._largeSymbolDraw = new LargeSymbolDraw();
},
render: function (seriesModel, ecModel, api) {
var data = seriesModel.getData();
var largeSymbolDraw = this._largeSymbolDraw;
var normalSymbolDraw = this._normalSymbolDraw;
var group = this.group;
var symbolDraw = seriesModel.get('large') && data.count() > seriesModel.get('largeThreshold')
? largeSymbolDraw : normalSymbolDraw;
this._symbolDraw = symbolDraw;
symbolDraw.updateData(data);
group.add(symbolDraw.group);
group.remove(
symbolDraw === largeSymbolDraw
? normalSymbolDraw.group : largeSymbolDraw.group
);
},
updateLayout: function (seriesModel) {
this._symbolDraw.updateLayout(seriesModel);
},
remove: function (ecModel, api) {
this._symbolDraw && this._symbolDraw.remove(api, true);
}
});
}); | jafarsidik/cepjeff | assets/vendors/echarts/src/chart/scatter/ScatterView.js | JavaScript | mit | 1,328 |
/*!
* froala_editor v1.2.3 (http://editor.froala.com)
* Copyright 2014-2014 Froala
*/
!function(a){a.Editable.DEFAULTS=a.extend(a.Editable.DEFAULTS,{maxCharacters:-1,countCharacters:!0}),a.Editable.prototype.validKeyCode=function(a,b){return b?!1:a>47&&58>a||32==a||13==a||a>64&&91>a||a>95&&112>a||a>185&&193>a||a>218&&223>a},a.Editable.prototype.charNumber=function(){return this.getText().length},a.Editable.prototype.checkCharNumber=function(a,b,c,d){return b.options.maxCharacters<0?!0:b.charNumber()<b.options.maxCharacters?!0:b.validKeyCode(c,d)?!1:!0},a.Editable.prototype.checkCharNumberOnPaste=function(b,c,d){if(c.options.maxCharacters<0)return!0;var e=a("<div>").html(d).text().length;return e+c.charNumber()<=c.options.maxCharacters?d:""},a.Editable.prototype.updateCharNumber=function(a,b){b.options.countCharacters&&b.$element.attr("data-chars",b.charNumber()+(b.options.maxCharacters>0?"/"+b.options.maxCharacters:""))},a.Editable.prototype.initCharNumber=function(){this.$original_element.on("editable.keydown",this.checkCharNumber),this.$original_element.on("editable.onPaste",this.checkCharNumberOnPaste),this.$original_element.on("editable.keyup",this.updateCharNumber),this.$original_element.on("editable.contentChanged",this.updateCharNumber),this.updateCharNumber(null,this)},a.Editable.initializers.push(a.Editable.prototype.initCharNumber)}(jQuery); | xubowenjx/cdnjs | ajax/libs/froala-editor/1.2.3/js/plugins/char_counter.min.js | JavaScript | mit | 1,376 |
/* SWFObject v2.2 <http://code.google.com/p/swfobject/>
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+encodeURI(O.location).toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}(); | 2947721120/adamant-waffle | files/wordpress/3.4/js/swfobject.js | JavaScript | mit | 10,234 |
/// <reference path="../../stats/stats.d.ts" />
/// <reference path="../physijs.d.ts" />
Physijs.scripts.worker = '../physijs_worker.js';
Physijs.scripts.ammo = 'examples/js/ammo.js';
var initScene, render, _boxes = [], spawnBox, inc_ready, renderer, render_stats, physics_stats, scene, ground_material, ground, light, camera;
var cubes = [];
var total_cubes = 0;
var total_ready = 0;
var max_on_screen = 100;
var spawn_per_tick = 25;
initScene = function() {
renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.shadowMapEnabled = true;
renderer.shadowMapSoft = true;
document.getElementById( 'viewport' ).appendChild( renderer.domElement );
render_stats = new Stats();
render_stats.domElement.style.position = 'absolute';
render_stats.domElement.style.top = '0px';
render_stats.domElement.style.zIndex = 100;
document.getElementById( 'viewport' ).appendChild( render_stats.domElement );
physics_stats = new Stats();
physics_stats.domElement.style.position = 'absolute';
physics_stats.domElement.style.top = '50px';
physics_stats.domElement.style.zIndex = 100;
document.getElementById( 'viewport' ).appendChild( physics_stats.domElement );
scene = new Physijs.Scene;
scene.setGravity(new THREE.Vector3( 0, -30, 0 ));
scene.addEventListener(
'update',
function() {
scene.simulate( undefined, 1 );
physics_stats.update();
while(cubes.length > max_on_screen) {
scene.remove(cubes[0]);
cubes[0].geometry.dispose();
cubes[0].material.dispose();
cubes.splice( 0, 1 );
}
document.getElementById( 'totalcubecount' ).textContent = ( total_cubes.toString() );
document.getElementById( 'currentcubecount' ).textContent = ( cubes.length.toString() );
document.getElementById( 'totalobjects' ).textContent = ( scene.__objects.length );
if(total_cubes > total_ready){
return;
}
for (var i=0;i<spawn_per_tick;i++) {
spawnBox();
}
}
);
camera = new THREE.PerspectiveCamera(
35,
window.innerWidth / window.innerHeight,
1,
1000
);
camera.position.set( 60, 50, 60 );
camera.lookAt( scene.position );
scene.add( camera );
// Light
light = new THREE.DirectionalLight( 0xFFFFFF );
light.position.set( 20, 40, -15 );
light.target.position.copy( scene.position );
light.castShadow = true;
light.shadowCameraLeft = -60;
light.shadowCameraTop = -60;
light.shadowCameraRight = 60;
light.shadowCameraBottom = 60;
light.shadowCameraNear = 20;
light.shadowCameraFar = 200;
light.shadowBias = -.0001
light.shadowMapWidth = light.shadowMapHeight = 2048;
light.shadowDarkness = .7;
scene.add( light );
// Ground
ground_material = Physijs.createMaterial(
new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/rocks.jpg' ) }),
.8, // high friction
.3 // low restitution
);
ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
ground_material.map.repeat.set( 3, 3 );
ground = new Physijs.BoxMesh(
new THREE.BoxGeometry(100, 1, 100),
ground_material,
0 // mass
);
ground.receiveShadow = true;
scene.add( ground );
spawnBox();
requestAnimationFrame( render );
scene.simulate();
};
spawnBox = (function() {
var box_geometry = new THREE.BoxGeometry( 4, 4, 4 ),
createBox = function() {
var box, material;
total_cubes++;
material = Physijs.createMaterial(
new THREE.MeshLambertMaterial({ opacity: .9, transparent: true }),
.6, // medium friction
.3 // low restitution
);
material.color.setRGB(Math.random() * 100 / 100, Math.random() * 100 / 100, Math.random() * 100 / 100);
box = new Physijs.ConvexMesh(
box_geometry,
material
);
box.collisions = 0;
box.position.set(
Math.random() * 15 - 7.5,
25,
Math.random() * 15 - 7.5
);
box.rotation.set(
Math.random() * Math.PI,
Math.random() * Math.PI,
Math.random() * Math.PI
);
box.castShadow = true;
box.addEventListener( 'ready', inc_ready );
cubes.push( box );
scene.add( box );
};
return function() {
createBox();
};
})();
inc_ready = function() {
total_ready++;
}
render = function() {
requestAnimationFrame( render );
renderer.render( scene, camera );
render_stats.update();
};
window.onload = initScene;
| mattanja/DefinitelyTyped | physijs/tests/memorytest-convex.ts | TypeScript | mit | 5,016 |
YUI.add("selector-native",function(A){(function(E){E.namespace("Selector");var C="compareDocumentPosition",D="ownerDocument";var B={_foundCache:[],useNative:true,_compare:("sourceIndex" in E.config.doc.documentElement)?function(I,H){var G=I.sourceIndex,F=H.sourceIndex;if(G===F){return 0;}else{if(G>F){return 1;}}return -1;}:(E.config.doc.documentElement[C]?function(G,F){if(G[C](F)&4){return -1;}else{return 1;}}:function(J,I){var H,F,G;if(J&&I){H=J[D].createRange();H.setStart(J,0);F=I[D].createRange();F.setStart(I,0);G=H.compareBoundaryPoints(1,F);}return G;}),_sort:function(F){if(F){F=E.Array(F,0,true);if(F.sort){F.sort(B._compare);}}return F;},_deDupe:function(F){var G=[],H,I;for(H=0;(I=F[H++]);){if(!I._found){G[G.length]=I;I._found=true;}}for(H=0;(I=G[H++]);){I._found=null;I.removeAttribute("_found");}return G;},query:function(G,N,O,F){N=N||E.config.doc;var K=[],H=(E.Selector.useNative&&E.config.doc.querySelector&&!F),J=[[G,N]],L,P,I,M=(H)?E.Selector._nativeQuery:E.Selector._bruteQuery;if(G&&M){if(!F&&(!H||N.tagName)){J=B._splitQueries(G,N);}for(I=0;(L=J[I++]);){P=M(L[0],L[1],O);if(!O){P=E.Array(P,0,true);}if(P){K=K.concat(P);}}if(J.length>1){K=B._sort(B._deDupe(K));}}return(O)?(K[0]||null):K;},_splitQueries:function(H,K){var G=H.split(","),I=[],L="",J,F;if(K){if(K.tagName){K.id=K.id||E.guid();L='[id="'+K.id+'"] ';}for(J=0,F=G.length;J<F;++J){H=L+G[J];I.push([H,K]);}}return I;},_nativeQuery:function(F,G,H){if(E.UA.webkit&&F.indexOf(":checked")>-1&&(E.Selector.pseudos&&E.Selector.pseudos.checked)){return E.Selector.query(F,G,H,true);}try{return G["querySelector"+(H?"":"All")](F);}catch(I){return E.Selector.query(F,G,H,true);}},filter:function(G,F){var H=[],I,J;if(G&&F){for(I=0;(J=G[I++]);){if(E.Selector.test(J,F)){H[H.length]=J;}}}else{}return H;},test:function(H,I,N){var L=false,G=I.split(","),F=false,O,R,M,Q,K,J,P;if(H&&H.tagName){if(!N&&!E.DOM.inDoc(H)){O=H.parentNode;if(O){N=O;}else{Q=H[D].createDocumentFragment();Q.appendChild(H);N=Q;F=true;}}N=N||H[D];if(!H.id){H.id=E.guid();}for(K=0;(P=G[K++]);){P+='[id="'+H.id+'"]';M=E.Selector.query(P,N);for(J=0;R=M[J++];){if(R===H){L=true;break;}}if(L){break;}}if(F){Q.removeChild(H);}}return L;},ancestor:function(G,F,H){return E.DOM.ancestor(G,function(I){return E.Selector.test(I,F);},H);}};E.mix(E.Selector,B,true);})(A);},"@VERSION@",{requires:["dom-base"]}); | jemmy655/cdnjs | ajax/libs/yui/3.2.0/dom/selector-native-min.js | JavaScript | mit | 2,344 |
/**
* The YUI module contains the components required for building the YUI seed
* file. This includes the script loading mechanism, a simple queue, and
* the core utilities for the library.
* @module yui
* @submodule yui-base
*/
if (typeof YUI != 'undefined') {
YUI._YUI = YUI;
}
/**
The YUI global namespace object. If YUI is already defined, the
existing YUI object will not be overwritten so that defined
namespaces are preserved. It is the constructor for the object
the end user interacts with. As indicated below, each instance
has full custom event support, but only if the event system
is available. This is a self-instantiable factory function. You
can invoke it directly like this:
YUI().use('*', function(Y) {
// ready
});
But it also works like this:
var Y = YUI();
Configuring the YUI object:
YUI({
debug: true,
combine: false
}).use('node', function(Y) {
//Node is ready to use
});
See the API docs for the <a href="config.html">Config</a> class
for the complete list of supported configuration properties accepted
by the YUI constuctor.
@class YUI
@constructor
@global
@uses EventTarget
@param [o]* {Object} 0..n optional configuration objects. these values
are store in Y.config. See <a href="config.html">Config</a> for the list of supported
properties.
*/
/*global YUI*/
/*global YUI_config*/
var YUI = function() {
var i = 0,
Y = this,
args = arguments,
l = args.length,
instanceOf = function(o, type) {
return (o && o.hasOwnProperty && (o instanceof type));
},
gconf = (typeof YUI_config !== 'undefined') && YUI_config;
if (!(instanceOf(Y, YUI))) {
Y = new YUI();
} else {
// set up the core environment
Y._init();
/**
YUI.GlobalConfig is a master configuration that might span
multiple contexts in a non-browser environment. It is applied
first to all instances in all contexts.
@property GlobalConfig
@type {Object}
@global
@static
@example
YUI.GlobalConfig = {
filter: 'debug'
};
YUI().use('node', function(Y) {
//debug files used here
});
YUI({
filter: 'min'
}).use('node', function(Y) {
//min files used here
});
*/
if (YUI.GlobalConfig) {
Y.applyConfig(YUI.GlobalConfig);
}
/**
YUI_config is a page-level config. It is applied to all
instances created on the page. This is applied after
YUI.GlobalConfig, and before the instance level configuration
objects.
@global
@property YUI_config
@type {Object}
@example
//Single global var to include before YUI seed file
YUI_config = {
filter: 'debug'
};
YUI().use('node', function(Y) {
//debug files used here
});
YUI({
filter: 'min'
}).use('node', function(Y) {
//min files used here
});
*/
if (gconf) {
Y.applyConfig(gconf);
}
// bind the specified additional modules for this instance
if (!l) {
Y._setup();
}
}
if (l) {
// Each instance can accept one or more configuration objects.
// These are applied after YUI.GlobalConfig and YUI_Config,
// overriding values set in those config files if there is a '
// matching property.
for (; i < l; i++) {
Y.applyConfig(args[i]);
}
Y._setup();
}
Y.instanceOf = instanceOf;
return Y;
};
(function() {
var proto, prop,
VERSION = '@VERSION@',
PERIOD = '.',
BASE = 'http://yui.yahooapis.com/',
DOC_LABEL = 'yui3-js-enabled',
CSS_STAMP_EL = 'yui3-css-stamp',
NOOP = function() {},
SLICE = Array.prototype.slice,
APPLY_TO_AUTH = { 'io.xdrReady': 1, // the functions applyTo
'io.xdrResponse': 1, // can call. this should
'SWF.eventHandler': 1 }, // be done at build time
hasWin = (typeof window != 'undefined'),
win = (hasWin) ? window : null,
doc = (hasWin) ? win.document : null,
docEl = doc && doc.documentElement,
docClass = docEl && docEl.className,
instances = {},
time = new Date().getTime(),
add = function(el, type, fn, capture) {
if (el && el.addEventListener) {
el.addEventListener(type, fn, capture);
} else if (el && el.attachEvent) {
el.attachEvent('on' + type, fn);
}
},
remove = function(el, type, fn, capture) {
if (el && el.removeEventListener) {
// this can throw an uncaught exception in FF
try {
el.removeEventListener(type, fn, capture);
} catch (ex) {}
} else if (el && el.detachEvent) {
el.detachEvent('on' + type, fn);
}
},
handleLoad = function() {
YUI.Env.windowLoaded = true;
YUI.Env.DOMReady = true;
if (hasWin) {
remove(window, 'load', handleLoad);
}
},
getLoader = function(Y, o) {
var loader = Y.Env._loader;
if (loader) {
//loader._config(Y.config);
loader.ignoreRegistered = false;
loader.onEnd = null;
loader.data = null;
loader.required = [];
loader.loadType = null;
} else {
loader = new Y.Loader(Y.config);
Y.Env._loader = loader;
}
YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, [ 'loader-base', 'loader-rollup', 'loader-yui3' ]));
return loader;
},
clobber = function(r, s) {
for (var i in s) {
if (s.hasOwnProperty(i)) {
r[i] = s[i];
}
}
},
ALREADY_DONE = { success: true };
// Stamp the documentElement (HTML) with a class of "yui-loaded" to
// enable styles that need to key off of JS being enabled.
if (docEl && docClass.indexOf(DOC_LABEL) == -1) {
if (docClass) {
docClass += ' ';
}
docClass += DOC_LABEL;
docEl.className = docClass;
}
if (VERSION.indexOf('@') > -1) {
VERSION = '3.3.0'; // dev time hack for cdn test
}
proto = {
/**
* Applies a new configuration object to the YUI instance config.
* This will merge new group/module definitions, and will also
* update the loader cache if necessary. Updating Y.config directly
* will not update the cache.
* @method applyConfig
* @param {Object} o the configuration object.
* @since 3.2.0
*/
applyConfig: function(o) {
o = o || NOOP;
var attr,
name,
// detail,
config = this.config,
mods = config.modules,
groups = config.groups,
aliases = config.aliases,
loader = this.Env._loader;
for (name in o) {
if (o.hasOwnProperty(name)) {
attr = o[name];
if (mods && name == 'modules') {
clobber(mods, attr);
} else if (aliases && name == 'aliases') {
clobber(aliases, attr);
} else if (groups && name == 'groups') {
clobber(groups, attr);
} else if (name == 'win') {
config[name] = (attr && attr.contentWindow) || attr;
config.doc = config[name] ? config[name].document : null;
} else if (name == '_yuid') {
// preserve the guid
} else {
config[name] = attr;
}
}
}
if (loader) {
loader._config(o);
}
},
/**
* Old way to apply a config to the instance (calls `applyConfig` under the hood)
* @private
* @method _config
* @param {Object} o The config to apply
*/
_config: function(o) {
this.applyConfig(o);
},
/**
* Initialize this YUI instance
* @private
* @method _init
*/
_init: function() {
var filter, el,
Y = this,
G_ENV = YUI.Env,
Env = Y.Env,
prop;
/**
* The version number of the YUI instance.
* @property version
* @type string
*/
Y.version = VERSION;
if (!Env) {
Y.Env = {
core: ['get','features','intl-base','yui-log', 'yui-log-nodejs', 'yui-later','loader-base', 'loader-rollup', 'loader-yui3'],
mods: {}, // flat module map
versions: {}, // version module map
base: BASE,
cdn: BASE + VERSION + '/build/',
// bootstrapped: false,
_idx: 0,
_used: {},
_attached: {},
_missed: [],
_yidx: 0,
_uidx: 0,
_guidp: 'y',
_loaded: {},
// serviced: {},
// Regex in English:
// I'll start at the \b(simpleyui).
// 1. Look in the test string for "simpleyui" or "yui" or
// "yui-base" or "yui-davglass" or "yui-foobar" that comes after a word break. That is, it
// can't match "foyui" or "i_heart_simpleyui". This can be anywhere in the string.
// 2. After #1 must come a forward slash followed by the string matched in #1, so
// "yui-base/yui-base" or "simpleyui/simpleyui" or "yui-pants/yui-pants".
// 3. The second occurence of the #1 token can optionally be followed by "-debug" or "-min",
// so "yui/yui-min", "yui/yui-debug", "yui-base/yui-base-debug". NOT "yui/yui-tshirt".
// 4. This is followed by ".js", so "yui/yui.js", "simpleyui/simpleyui-min.js"
// 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a "?" in the string,
// then capture the junk between the LAST "&" and the string in 1-4. So
// "blah?foo/yui/yui.js" will capture "foo/" and "blah?some/thing.js&3.3.0/build/yui-davglass/yui-davglass.js"
// will capture "3.3.0/build/"
//
// Regex Exploded:
// (?:\? Find a ?
// (?:[^&]*&) followed by 0..n characters followed by an &
// * in fact, find as many sets of characters followed by a & as you can
// ([^&]*) capture the stuff after the last & in \1
// )? but it's ok if all this ?junk&more_junk stuff isn't even there
// \b(simpleyui| after a word break find either the string "simpleyui" or
// yui(?:-\w+)? the string "yui" optionally followed by a -, then more characters
// ) and store the simpleyui or yui-* string in \2
// \/\2 then comes a / followed by the simpleyui or yui-* string in \2
// (?:-(min|debug))? optionally followed by "-min" or "-debug"
// .js and ending in ".js"
_BASE_RE: /(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,
parseBasePath: function(src, pattern) {
var match = src.match(pattern),
path, filter;
if (match) {
path = RegExp.leftContext || src.slice(0, src.indexOf(match[0]));
// this is to set up the path to the loader. The file
// filter for loader should match the yui include.
filter = match[3];
// extract correct path for mixed combo urls
// http://yuilibrary.com/projects/yui3/ticket/2528423
if (match[1]) {
path += '?' + match[1];
}
path = {
filter: filter,
path: path
}
}
return path;
},
getBase: G_ENV && G_ENV.getBase ||
function(pattern) {
var nodes = (doc && doc.getElementsByTagName('script')) || [],
path = Env.cdn, parsed,
i, len, src;
for (i = 0, len = nodes.length; i < len; ++i) {
src = nodes[i].src;
if (src) {
parsed = Y.Env.parseBasePath(src, pattern);
if (parsed) {
filter = parsed.filter;
path = parsed.path;
break;
}
}
}
// use CDN default
return path;
}
};
Env = Y.Env;
Env._loaded[VERSION] = {};
if (G_ENV && Y !== YUI) {
Env._yidx = ++G_ENV._yidx;
Env._guidp = ('yui_' + VERSION + '_' +
Env._yidx + '_' + time).replace(/\./g, '_');
} else if (YUI._YUI) {
G_ENV = YUI._YUI.Env;
Env._yidx += G_ENV._yidx;
Env._uidx += G_ENV._uidx;
for (prop in G_ENV) {
if (!(prop in Env)) {
Env[prop] = G_ENV[prop];
}
}
delete YUI._YUI;
}
Y.id = Y.stamp(Y);
instances[Y.id] = Y;
}
Y.constructor = YUI;
// configuration defaults
Y.config = Y.config || {
bootstrap: true,
cacheUse: true,
debug: true,
doc: doc,
fetchCSS: true,
throwFail: true,
useBrowserConsole: true,
useNativeES5: true,
win: win
};
//Register the CSS stamp element
if (doc && !doc.getElementById(CSS_STAMP_EL)) {
el = doc.createElement('div');
el.innerHTML = '<div id="' + CSS_STAMP_EL + '" style="position: absolute !important; visibility: hidden !important"></div>';
YUI.Env.cssStampEl = el.firstChild;
docEl.insertBefore(YUI.Env.cssStampEl, docEl.firstChild);
}
Y.config.lang = Y.config.lang || 'en-US';
Y.config.base = YUI.config.base || Y.Env.getBase(Y.Env._BASE_RE);
if (!filter || (!('mindebug').indexOf(filter))) {
filter = 'min';
}
filter = (filter) ? '-' + filter : filter;
Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js';
},
/**
* Finishes the instance setup. Attaches whatever modules were defined
* when the yui modules was registered.
* @method _setup
* @private
*/
_setup: function(o) {
var i, Y = this,
core = [],
mods = YUI.Env.mods,
//extras = Y.config.core || ['get','features','intl-base','yui-log', 'yui-log-nodejs', 'yui-later','loader-base', 'loader-rollup', 'loader-yui3'];
extras = Y.config.core || [].concat(YUI.Env.core); //Clone it..
for (i = 0; i < extras.length; i++) {
if (mods[extras[i]]) {
core.push(extras[i]);
}
}
Y._attach(['yui-base']);
Y._attach(core);
if (Y.Loader) {
getLoader(Y);
}
// Y.log(Y.id + ' initialized', 'info', 'yui');
},
/**
* Executes a method on a YUI instance with
* the specified id if the specified method is whitelisted.
* @method applyTo
* @param id {String} the YUI instance id.
* @param method {String} the name of the method to exectute.
* Ex: 'Object.keys'.
* @param args {Array} the arguments to apply to the method.
* @return {Object} the return value from the applied method or null.
*/
applyTo: function(id, method, args) {
if (!(method in APPLY_TO_AUTH)) {
this.log(method + ': applyTo not allowed', 'warn', 'yui');
return null;
}
var instance = instances[id], nest, m, i;
if (instance) {
nest = method.split('.');
m = instance;
for (i = 0; i < nest.length; i = i + 1) {
m = m[nest[i]];
if (!m) {
this.log('applyTo not found: ' + method, 'warn', 'yui');
}
}
return m && m.apply(instance, args);
}
return null;
},
/**
Registers a module with the YUI global. The easiest way to create a
first-class YUI module is to use the YUI component build tool.
http://yuilibrary.com/projects/builder
The build system will produce the `YUI.add` wrapper for you module, along
with any configuration info required for the module.
@method add
@param name {String} module name.
@param fn {Function} entry point into the module that is used to bind module to the YUI instance.
@param {YUI} fn.Y The YUI instance this module is executed in.
@param {String} fn.name The name of the module
@param version {String} version string.
@param details {Object} optional config data:
@param details.requires {Array} features that must be present before this module can be attached.
@param details.optional {Array} optional features that should be present if loadOptional
is defined. Note: modules are not often loaded this way in YUI 3,
but this field is still useful to inform the user that certain
features in the component will require additional dependencies.
@param details.use {Array} features that are included within this module which need to
be attached automatically when this module is attached. This
supports the YUI 3 rollup system -- a module with submodules
defined will need to have the submodules listed in the 'use'
config. The YUI component build tool does this for you.
@return {YUI} the YUI instance.
@example
YUI.add('davglass', function(Y, name) {
Y.davglass = function() {
alert('Dav was here!');
};
}, '3.4.0', { requires: ['yui-base', 'harley-davidson', 'mt-dew'] });
*/
add: function(name, fn, version, details) {
details = details || {};
var env = YUI.Env,
mod = {
name: name,
fn: fn,
version: version,
details: details
},
loader,
i, versions = env.versions;
env.mods[name] = mod;
versions[version] = versions[version] || {};
versions[version][name] = mod;
for (i in instances) {
if (instances.hasOwnProperty(i)) {
loader = instances[i].Env._loader;
if (loader) {
if (!loader.moduleInfo[name] || loader.moduleInfo[name].temp) {
loader.addModule(details, name);
}
}
}
}
return this;
},
/**
* Executes the function associated with each required
* module, binding the module to the YUI instance.
* @param {Array} r The array of modules to attach
* @param {Boolean} [moot=false] Don't throw a warning if the module is not attached
* @method _attach
* @private
*/
_attach: function(r, moot) {
var i, name, mod, details, req, use, after,
mods = YUI.Env.mods,
aliases = YUI.Env.aliases,
Y = this, j,
loader = Y.Env._loader,
done = Y.Env._attached,
len = r.length, loader,
c = [];
//Check for conditional modules (in a second+ instance) and add their requirements
//TODO I hate this entire method, it needs to be fixed ASAP (3.5.0) ^davglass
for (i = 0; i < len; i++) {
name = r[i];
mod = mods[name];
c.push(name);
if (loader && loader.conditions[name]) {
Y.Object.each(loader.conditions[name], function(def) {
var go = def && ((def.ua && Y.UA[def.ua]) || (def.test && def.test(Y)));
if (go) {
c.push(def.name);
}
});
}
}
r = c;
len = r.length;
for (i = 0; i < len; i++) {
if (!done[r[i]]) {
name = r[i];
mod = mods[name];
if (aliases && aliases[name]) {
Y._attach(aliases[name]);
continue;
}
if (!mod) {
if (loader && loader.moduleInfo[name]) {
mod = loader.moduleInfo[name];
moot = true;
}
// Y.log('no js def for: ' + name, 'info', 'yui');
//if (!loader || !loader.moduleInfo[name]) {
//if ((!loader || !loader.moduleInfo[name]) && !moot) {
if (!moot && name) {
if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {
Y.Env._missed.push(name);
Y.Env._missed = Y.Array.dedupe(Y.Env._missed);
Y.message('NOT loaded: ' + name, 'warn', 'yui');
}
}
} else {
done[name] = true;
//Don't like this, but in case a mod was asked for once, then we fetch it
//We need to remove it from the missed list ^davglass
for (j = 0; j < Y.Env._missed.length; j++) {
if (Y.Env._missed[j] === name) {
Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui');
Y.Env._missed.splice(j, 1);
}
}
details = mod.details;
req = details.requires;
use = details.use;
after = details.after;
if (req) {
for (j = 0; j < req.length; j++) {
if (!done[req[j]]) {
if (!Y._attach(req)) {
return false;
}
break;
}
}
}
if (after) {
for (j = 0; j < after.length; j++) {
if (!done[after[j]]) {
if (!Y._attach(after, true)) {
return false;
}
break;
}
}
}
if (mod.fn) {
try {
mod.fn(Y, name);
} catch (e) {
Y.error('Attach error: ' + name, e, name);
return false;
}
}
if (use) {
for (j = 0; j < use.length; j++) {
if (!done[use[j]]) {
if (!Y._attach(use)) {
return false;
}
break;
}
}
}
}
}
}
return true;
},
/**
* Attaches one or more modules to the YUI instance. When this
* is executed, the requirements are analyzed, and one of
* several things can happen:
*
* * All requirements are available on the page -- The modules
* are attached to the instance. If supplied, the use callback
* is executed synchronously.
*
* * Modules are missing, the Get utility is not available OR
* the 'bootstrap' config is false -- A warning is issued about
* the missing modules and all available modules are attached.
*
* * Modules are missing, the Loader is not available but the Get
* utility is and boostrap is not false -- The loader is bootstrapped
* before doing the following....
*
* * Modules are missing and the Loader is available -- The loader
* expands the dependency tree and fetches missing modules. When
* the loader is finshed the callback supplied to use is executed
* asynchronously.
*
* @method use
* @param modules* {String|Array} 1-n modules to bind (uses arguments array).
* @param [callback] {Function} callback function executed when
* the instance has the required functionality. If included, it
* must be the last parameter.
* @param callback.Y {YUI} The `YUI` instance created for this sandbox
* @param callback.data {Object} Object data returned from `Loader`.
*
* @example
* // loads and attaches dd and its dependencies
* YUI().use('dd', function(Y) {});
*
* // loads and attaches dd and node as well as all of their dependencies (since 3.4.0)
* YUI().use(['dd', 'node'], function(Y) {});
*
* // attaches all modules that are available on the page
* YUI().use('*', function(Y) {});
*
* // intrinsic YUI gallery support (since 3.1.0)
* YUI().use('gallery-yql', function(Y) {});
*
* // intrinsic YUI 2in3 support (since 3.1.0)
* YUI().use('yui2-datatable', function(Y) {});
*
* @return {YUI} the YUI instance.
*/
use: function() {
var args = SLICE.call(arguments, 0),
callback = args[args.length - 1],
Y = this,
i = 0,
a = [],
name,
Env = Y.Env,
provisioned = true;
// The last argument supplied to use can be a load complete callback
if (Y.Lang.isFunction(callback)) {
args.pop();
} else {
callback = null;
}
if (Y.Lang.isArray(args[0])) {
args = args[0];
}
if (Y.config.cacheUse) {
while ((name = args[i++])) {
if (!Env._attached[name]) {
provisioned = false;
break;
}
}
if (provisioned) {
if (args.length) {
Y.log('already provisioned: ' + args, 'info', 'yui');
}
Y._notify(callback, ALREADY_DONE, args);
return Y;
}
}
if (Y._loading) {
Y._useQueue = Y._useQueue || new Y.Queue();
Y._useQueue.add([args, callback]);
} else {
Y._use(args, function(Y, response) {
Y._notify(callback, response, args);
});
}
return Y;
},
/**
* Notify handler from Loader for attachment/load errors
* @method _notify
* @param callback {Function} The callback to pass to the `Y.config.loadErrorFn`
* @param response {Object} The response returned from Loader
* @param args {Array} The aruments passed from Loader
* @private
*/
_notify: function(callback, response, args) {
if (!response.success && this.config.loadErrorFn) {
this.config.loadErrorFn.call(this, this, callback, response, args);
} else if (callback) {
try {
callback(this, response);
} catch (e) {
this.error('use callback error', e, args);
}
}
},
/**
* This private method is called from the `use` method queue. To ensure that only one set of loading
* logic is performed at a time.
* @method _use
* @private
* @param args* {String} 1-n modules to bind (uses arguments array).
* @param *callback {Function} callback function executed when
* the instance has the required functionality. If included, it
* must be the last parameter.
*/
_use: function(args, callback) {
if (!this.Array) {
this._attach(['yui-base']);
}
var len, loader, handleBoot, handleRLS,
Y = this,
G_ENV = YUI.Env,
mods = G_ENV.mods,
Env = Y.Env,
used = Env._used,
aliases = G_ENV.aliases,
queue = G_ENV._loaderQueue,
firstArg = args[0],
YArray = Y.Array,
config = Y.config,
boot = config.bootstrap,
missing = [],
r = [],
ret = true,
fetchCSS = config.fetchCSS,
process = function(names, skip) {
var i = 0, a = [];
if (!names.length) {
return;
}
if (aliases) {
for (i = 0; i < names.length; i++) {
if (aliases[names[i]]) {
a = [].concat(a, aliases[names[i]]);
} else {
a.push(names[i]);
}
}
names = a;
}
YArray.each(names, function(name) {
// add this module to full list of things to attach
if (!skip) {
r.push(name);
}
// only attach a module once
if (used[name]) {
return;
}
var m = mods[name], req, use;
if (m) {
used[name] = true;
req = m.details.requires;
use = m.details.use;
} else {
// CSS files don't register themselves, see if it has
// been loaded
if (!G_ENV._loaded[VERSION][name]) {
missing.push(name);
} else {
used[name] = true; // probably css
}
}
// make sure requirements are attached
if (req && req.length) {
process(req);
}
// make sure we grab the submodule dependencies too
if (use && use.length) {
process(use, 1);
}
});
},
handleLoader = function(fromLoader) {
var response = fromLoader || {
success: true,
msg: 'not dynamic'
},
redo, origMissing,
ret = true,
data = response.data;
Y._loading = false;
if (data) {
origMissing = missing;
missing = [];
r = [];
process(data);
redo = missing.length;
if (redo) {
if (missing.sort().join() ==
origMissing.sort().join()) {
redo = false;
}
}
}
if (redo && data) {
Y._loading = true;
Y._use(missing, function() {
Y.log('Nested use callback: ' + data, 'info', 'yui');
if (Y._attach(data)) {
Y._notify(callback, response, data);
}
});
} else {
if (data) {
// Y.log('attaching from loader: ' + data, 'info', 'yui');
ret = Y._attach(data);
}
if (ret) {
Y._notify(callback, response, args);
}
}
if (Y._useQueue && Y._useQueue.size() && !Y._loading) {
Y._use.apply(Y, Y._useQueue.next());
}
};
// Y.log(Y.id + ': use called: ' + a + ' :: ' + callback, 'info', 'yui');
// YUI().use('*'); // bind everything available
if (firstArg === '*') {
ret = Y._attach(Y.Object.keys(mods));
if (ret) {
handleLoader();
}
return Y;
}
if (mods['loader'] && !Y.Loader) {
Y.log('Loader was found in meta, but it is not attached. Attaching..', 'info', 'yui');
Y._attach(['loader']);
}
// Y.log('before loader requirements: ' + args, 'info', 'yui');
// use loader to expand dependencies and sort the
// requirements if it is available.
if (boot && Y.Loader && args.length) {
loader = getLoader(Y);
loader.require(args);
loader.ignoreRegistered = true;
loader._boot = true;
loader.calculate(null, (fetchCSS) ? null : 'js');
args = loader.sorted;
loader._boot = false;
}
// process each requirement and any additional requirements
// the module metadata specifies
process(args);
len = missing.length;
if (len) {
missing = Y.Object.keys(YArray.hash(missing));
len = missing.length;
Y.log('Modules missing: ' + missing + ', ' + missing.length, 'info', 'yui');
}
// dynamic load
if (boot && len && Y.Loader) {
// Y.log('Using loader to fetch missing deps: ' + missing, 'info', 'yui');
Y.log('Using Loader', 'info', 'yui');
Y._loading = true;
loader = getLoader(Y);
loader.onEnd = handleLoader;
loader.context = Y;
loader.data = args;
loader.ignoreRegistered = false;
loader.require(args);
loader.insert(null, (fetchCSS) ? null : 'js');
} else if (boot && len && Y.Get && !Env.bootstrapped) {
Y._loading = true;
handleBoot = function() {
Y._loading = false;
queue.running = false;
Env.bootstrapped = true;
G_ENV._bootstrapping = false;
if (Y._attach(['loader'])) {
Y._use(args, callback);
}
};
if (G_ENV._bootstrapping) {
Y.log('Waiting for loader', 'info', 'yui');
queue.add(handleBoot);
} else {
G_ENV._bootstrapping = true;
Y.log('Fetching loader: ' + config.base + config.loaderPath, 'info', 'yui');
Y.Get.script(config.base + config.loaderPath, {
onEnd: handleBoot
});
}
} else {
Y.log('Attaching available dependencies: ' + args, 'info', 'yui');
ret = Y._attach(args);
if (ret) {
handleLoader();
}
}
return Y;
},
/**
Adds a namespace object onto the YUI global if called statically.
// creates YUI.your.namespace.here as nested objects
YUI.namespace("your.namespace.here");
If called as a method on a YUI <em>instance</em>, it creates the
namespace on the instance.
// creates Y.property.package
Y.namespace("property.package");
Dots in the input string cause `namespace` to create nested objects for
each token. If any part of the requested namespace already exists, the
current object will be left in place. This allows multiple calls to
`namespace` to preserve existing namespaced properties.
If the first token in the namespace string is "YAHOO", the token is
discarded.
Be careful with namespace tokens. Reserved words may work in some browsers
and not others. For instance, the following will fail in some browsers
because the supported version of JavaScript reserves the word "long":
Y.namespace("really.long.nested.namespace");
<em>Note: If you pass multiple arguments to create multiple namespaces, only
the last one created is returned from this function.</em>
@method namespace
@param {String} namespace* namespaces to create.
@return {Object} A reference to the last namespace object created.
**/
namespace: function() {
var a = arguments, o, i = 0, j, d, arg;
for (; i < a.length; i++) {
o = this; //Reset base object per argument or it will get reused from the last
arg = a[i];
if (arg.indexOf(PERIOD) > -1) { //Skip this if no "." is present
d = arg.split(PERIOD);
for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) {
o[d[j]] = o[d[j]] || {};
o = o[d[j]];
}
} else {
o[arg] = o[arg] || {};
o = o[arg]; //Reset base object to the new object so it's returned
}
}
return o;
},
// this is replaced if the log module is included
log: NOOP,
message: NOOP,
// this is replaced if the dump module is included
dump: function (o) { return ''+o; },
/**
* Report an error. The reporting mechanism is controlled by
* the `throwFail` configuration attribute. If throwFail is
* not specified, the message is written to the Logger, otherwise
* a JS error is thrown. If an `errorFn` is specified in the config
* it must return `true` to keep the error from being thrown.
* @method error
* @param msg {String} the error message.
* @param e {Error|String} Optional JS error that was caught, or an error string.
* @param src Optional additional info (passed to `Y.config.errorFn` and `Y.message`)
* and `throwFail` is specified, this error will be re-thrown.
* @return {YUI} this YUI instance.
*/
error: function(msg, e, src) {
//TODO Add check for window.onerror here
var Y = this, ret;
if (Y.config.errorFn) {
ret = Y.config.errorFn.apply(Y, arguments);
}
if (Y.config.throwFail && !ret) {
throw (e || new Error(msg));
} else {
Y.message(msg, 'error', ''+src); // don't scrub this one
}
return Y;
},
/**
* Generate an id that is unique among all YUI instances
* @method guid
* @param pre {String} optional guid prefix.
* @return {String} the guid.
*/
guid: function(pre) {
var id = this.Env._guidp + '_' + (++this.Env._uidx);
return (pre) ? (pre + id) : id;
},
/**
* Returns a `guid` associated with an object. If the object
* does not have one, a new one is created unless `readOnly`
* is specified.
* @method stamp
* @param o {Object} The object to stamp.
* @param readOnly {Boolean} if `true`, a valid guid will only
* be returned if the object has one assigned to it.
* @return {String} The object's guid or null.
*/
stamp: function(o, readOnly) {
var uid;
if (!o) {
return o;
}
// IE generates its own unique ID for dom nodes
// The uniqueID property of a document node returns a new ID
if (o.uniqueID && o.nodeType && o.nodeType !== 9) {
uid = o.uniqueID;
} else {
uid = (typeof o === 'string') ? o : o._yuid;
}
if (!uid) {
uid = this.guid();
if (!readOnly) {
try {
o._yuid = uid;
} catch (e) {
uid = null;
}
}
}
return uid;
},
/**
* Destroys the YUI instance
* @method destroy
* @since 3.3.0
*/
destroy: function() {
var Y = this;
if (Y.Event) {
Y.Event._unload();
}
delete instances[Y.id];
delete Y.Env;
delete Y.config;
}
/**
* instanceof check for objects that works around
* memory leak in IE when the item tested is
* window/document
* @method instanceOf
* @param o {Object} The object to check.
* @param type {Object} The class to check against.
* @since 3.3.0
*/
};
YUI.prototype = proto;
// inheritance utilities are not available yet
for (prop in proto) {
if (proto.hasOwnProperty(prop)) {
YUI[prop] = proto[prop];
}
}
/**
Static method on the Global YUI object to apply a config to all YUI instances.
It's main use case is "mashups" where several third party scripts are trying to write to
a global YUI config at the same time. This way they can all call `YUI.applyConfig({})` instead of
overwriting other scripts configs.
@static
@since 3.5.0
@method applyConfig
@param {Object} o the configuration object.
@example
YUI.applyConfig({
modules: {
davglass: {
fullpath: './davglass.js'
}
}
});
YUI.applyConfig({
modules: {
foo: {
fullpath: './foo.js'
}
}
});
YUI().use('davglass', function(Y) {
//Module davglass will be available here..
});
*/
YUI.applyConfig = function(o) {
if (!o) {
return;
}
//If there is a GlobalConfig, apply it first to set the defaults
if (YUI.GlobalConfig) {
this.prototype.applyConfig.call(this, YUI.GlobalConfig);
}
//Apply this config to it
this.prototype.applyConfig.call(this, o);
//Reset GlobalConfig to the combined config
YUI.GlobalConfig = this.config;
};
// set up the environment
YUI._init();
if (hasWin) {
// add a window load event at load time so we can capture
// the case where it fires before dynamic loading is
// complete.
add(window, 'load', handleLoad);
} else {
handleLoad();
}
YUI.Env.add = add;
YUI.Env.remove = remove;
/*global exports*/
// Support the CommonJS method for exporting our single global
if (typeof exports == 'object') {
exports.YUI = YUI;
}
}());
/**
* The config object contains all of the configuration options for
* the `YUI` instance. This object is supplied by the implementer
* when instantiating a `YUI` instance. Some properties have default
* values if they are not supplied by the implementer. This should
* not be updated directly because some values are cached. Use
* `applyConfig()` to update the config object on a YUI instance that
* has already been configured.
*
* @class config
* @static
*/
/**
* Allows the YUI seed file to fetch the loader component and library
* metadata to dynamically load additional dependencies.
*
* @property bootstrap
* @type boolean
* @default true
*/
/**
* Turns on writing Ylog messages to the browser console.
*
* @property debug
* @type boolean
* @default true
*/
/**
* Log to the browser console if debug is on and the browser has a
* supported console.
*
* @property useBrowserConsole
* @type boolean
* @default true
*/
/**
* A hash of log sources that should be logged. If specified, only
* log messages from these sources will be logged.
*
* @property logInclude
* @type object
*/
/**
* A hash of log sources that should be not be logged. If specified,
* all sources are logged if not on this list.
*
* @property logExclude
* @type object
*/
/**
* Set to true if the yui seed file was dynamically loaded in
* order to bootstrap components relying on the window load event
* and the `domready` custom event.
*
* @property injected
* @type boolean
* @default false
*/
/**
* If `throwFail` is set, `Y.error` will generate or re-throw a JS Error.
* Otherwise the failure is logged.
*
* @property throwFail
* @type boolean
* @default true
*/
/**
* The window/frame that this instance should operate in.
*
* @property win
* @type Window
* @default the window hosting YUI
*/
/**
* The document associated with the 'win' configuration.
*
* @property doc
* @type Document
* @default the document hosting YUI
*/
/**
* A list of modules that defines the YUI core (overrides the default list).
*
* @property core
* @type Array
* @default [ get,features,intl-base,yui-log,yui-later,loader-base, loader-rollup, loader-yui3 ]
*/
/**
* A list of languages in order of preference. This list is matched against
* the list of available languages in modules that the YUI instance uses to
* determine the best possible localization of language sensitive modules.
* Languages are represented using BCP 47 language tags, such as "en-GB" for
* English as used in the United Kingdom, or "zh-Hans-CN" for simplified
* Chinese as used in China. The list can be provided as a comma-separated
* list or as an array.
*
* @property lang
* @type string|string[]
*/
/**
* The default date format
* @property dateFormat
* @type string
* @deprecated use configuration in `DataType.Date.format()` instead.
*/
/**
* The default locale
* @property locale
* @type string
* @deprecated use `config.lang` instead.
*/
/**
* The default interval when polling in milliseconds.
* @property pollInterval
* @type int
* @default 20
*/
/**
* The number of dynamic nodes to insert by default before
* automatically removing them. This applies to script nodes
* because removing the node will not make the evaluated script
* unavailable. Dynamic CSS is not auto purged, because removing
* a linked style sheet will also remove the style definitions.
* @property purgethreshold
* @type int
* @default 20
*/
/**
* The default interval when polling in milliseconds.
* @property windowResizeDelay
* @type int
* @default 40
*/
/**
* Base directory for dynamic loading
* @property base
* @type string
*/
/*
* The secure base dir (not implemented)
* For dynamic loading.
* @property secureBase
* @type string
*/
/**
* The YUI combo service base dir. Ex: `http://yui.yahooapis.com/combo?`
* For dynamic loading.
* @property comboBase
* @type string
*/
/**
* The root path to prepend to module path for the combo service.
* Ex: 3.0.0b1/build/
* For dynamic loading.
* @property root
* @type string
*/
/**
* A filter to apply to result urls. This filter will modify the default
* path for all modules. The default path for the YUI library is the
* minified version of the files (e.g., event-min.js). The filter property
* can be a predefined filter or a custom filter. The valid predefined
* filters are:
* <dl>
* <dt>DEBUG</dt>
* <dd>Selects the debug versions of the library (e.g., event-debug.js).
* This option will automatically include the Logger widget</dd>
* <dt>RAW</dt>
* <dd>Selects the non-minified version of the library (e.g., event.js).</dd>
* </dl>
* You can also define a custom filter, which must be an object literal
* containing a search expression and a replace string:
*
* myFilter: {
* 'searchExp': "-min\\.js",
* 'replaceStr': "-debug.js"
* }
*
* For dynamic loading.
*
* @property filter
* @type string|object
*/
/**
* The `skin` config let's you configure application level skin
* customizations. It contains the following attributes which
* can be specified to override the defaults:
*
* // The default skin, which is automatically applied if not
* // overriden by a component-specific skin definition.
* // Change this in to apply a different skin globally
* defaultSkin: 'sam',
*
* // This is combined with the loader base property to get
* // the default root directory for a skin.
* base: 'assets/skins/',
*
* // Any component-specific overrides can be specified here,
* // making it possible to load different skins for different
* // components. It is possible to load more than one skin
* // for a given component as well.
* overrides: {
* slider: ['capsule', 'round']
* }
*
* For dynamic loading.
*
* @property skin
*/
/**
* Hash of per-component filter specification. If specified for a given
* component, this overrides the filter config.
*
* For dynamic loading.
*
* @property filters
*/
/**
* Use the YUI combo service to reduce the number of http connections
* required to load your dependencies. Turning this off will
* disable combo handling for YUI and all module groups configured
* with a combo service.
*
* For dynamic loading.
*
* @property combine
* @type boolean
* @default true if 'base' is not supplied, false if it is.
*/
/**
* A list of modules that should never be dynamically loaded
*
* @property ignore
* @type string[]
*/
/**
* A list of modules that should always be loaded when required, even if already
* present on the page.
*
* @property force
* @type string[]
*/
/**
* Node or id for a node that should be used as the insertion point for new
* nodes. For dynamic loading.
*
* @property insertBefore
* @type string
*/
/**
* Object literal containing attributes to add to dynamically loaded script
* nodes.
* @property jsAttributes
* @type string
*/
/**
* Object literal containing attributes to add to dynamically loaded link
* nodes.
* @property cssAttributes
* @type string
*/
/**
* Number of milliseconds before a timeout occurs when dynamically
* loading nodes. If not set, there is no timeout.
* @property timeout
* @type int
*/
/**
* Callback for the 'CSSComplete' event. When dynamically loading YUI
* components with CSS, this property fires when the CSS is finished
* loading but script loading is still ongoing. This provides an
* opportunity to enhance the presentation of a loading page a little
* bit before the entire loading process is done.
*
* @property onCSS
* @type function
*/
/**
* A hash of module definitions to add to the list of YUI components.
* These components can then be dynamically loaded side by side with
* YUI via the `use()` method. This is a hash, the key is the module
* name, and the value is an object literal specifying the metdata
* for the module. See `Loader.addModule` for the supported module
* metadata fields. Also see groups, which provides a way to
* configure the base and combo spec for a set of modules.
*
* modules: {
* mymod1: {
* requires: ['node'],
* fullpath: '/mymod1/mymod1.js'
* },
* mymod2: {
* requires: ['mymod1'],
* fullpath: '/mymod2/mymod2.js'
* },
* mymod3: '/js/mymod3.js',
* mycssmod: '/css/mycssmod.css'
* }
*
*
* @property modules
* @type object
*/
/**
* Aliases are dynamic groups of modules that can be used as
* shortcuts.
*
* YUI({
* aliases: {
* davglass: [ 'node', 'yql', 'dd' ],
* mine: [ 'davglass', 'autocomplete']
* }
* }).use('mine', function(Y) {
* //Node, YQL, DD & AutoComplete available here..
* });
*
* @property aliases
* @type object
*/
/**
* A hash of module group definitions. It for each group you
* can specify a list of modules and the base path and
* combo spec to use when dynamically loading the modules.
*
* groups: {
* yui2: {
* // specify whether or not this group has a combo service
* combine: true,
*
* // The comboSeperator to use with this group's combo handler
* comboSep: ';',
*
* // The maxURLLength for this server
* maxURLLength: 500,
*
* // the base path for non-combo paths
* base: 'http://yui.yahooapis.com/2.8.0r4/build/',
*
* // the path to the combo service
* comboBase: 'http://yui.yahooapis.com/combo?',
*
* // a fragment to prepend to the path attribute when
* // when building combo urls
* root: '2.8.0r4/build/',
*
* // the module definitions
* modules: {
* yui2_yde: {
* path: "yahoo-dom-event/yahoo-dom-event.js"
* },
* yui2_anim: {
* path: "animation/animation.js",
* requires: ['yui2_yde']
* }
* }
* }
* }
*
* @property groups
* @type object
*/
/**
* The loader 'path' attribute to the loader itself. This is combined
* with the 'base' attribute to dynamically load the loader component
* when boostrapping with the get utility alone.
*
* @property loaderPath
* @type string
* @default loader/loader-min.js
*/
/**
* Specifies whether or not YUI().use(...) will attempt to load CSS
* resources at all. Any truthy value will cause CSS dependencies
* to load when fetching script. The special value 'force' will
* cause CSS dependencies to be loaded even if no script is needed.
*
* @property fetchCSS
* @type boolean|string
* @default true
*/
/**
* The default gallery version to build gallery module urls
* @property gallery
* @type string
* @since 3.1.0
*/
/**
* The default YUI 2 version to build yui2 module urls. This is for
* intrinsic YUI 2 support via the 2in3 project. Also see the '2in3'
* config for pulling different revisions of the wrapped YUI 2
* modules.
* @since 3.1.0
* @property yui2
* @type string
* @default 2.9.0
*/
/**
* The 2in3 project is a deployment of the various versions of YUI 2
* deployed as first-class YUI 3 modules. Eventually, the wrapper
* for the modules will change (but the underlying YUI 2 code will
* be the same), and you can select a particular version of
* the wrapper modules via this config.
* @since 3.1.0
* @property 2in3
* @type string
* @default 4
*/
/**
* Alternative console log function for use in environments without
* a supported native console. The function is executed in the
* YUI instance context.
* @since 3.1.0
* @property logFn
* @type Function
*/
/**
* A callback to execute when Y.error is called. It receives the
* error message and an javascript error object if Y.error was
* executed because a javascript error was caught. The function
* is executed in the YUI instance context. Returning `true` from this
* function will stop the Error from being thrown.
*
* @since 3.2.0
* @property errorFn
* @type Function
*/
/**
* A callback to execute when the loader fails to load one or
* more resource. This could be because of a script load
* failure. It can also fail if a javascript module fails
* to register itself, but only when the 'requireRegistration'
* is true. If this function is defined, the use() callback will
* only be called when the loader succeeds, otherwise it always
* executes unless there was a javascript error when attaching
* a module.
*
* @since 3.3.0
* @property loadErrorFn
* @type Function
*/
/**
* When set to true, the YUI loader will expect that all modules
* it is responsible for loading will be first-class YUI modules
* that register themselves with the YUI global. If this is
* set to true, loader will fail if the module registration fails
* to happen after the script is loaded.
*
* @since 3.3.0
* @property requireRegistration
* @type boolean
* @default false
*/
/**
* Cache serviced use() requests.
* @since 3.3.0
* @property cacheUse
* @type boolean
* @default true
* @deprecated no longer used
*/
/**
* Whether or not YUI should use native ES5 functionality when available for
* features like `Y.Array.each()`, `Y.Object()`, etc. When `false`, YUI will
* always use its own fallback implementations instead of relying on ES5
* functionality, even when it's available.
*
* @method useNativeES5
* @type Boolean
* @default true
* @since 3.5.0
*/
YUI.add('yui-base', function(Y) {
/*
* YUI stub
* @module yui
* @submodule yui-base
*/
/**
* The YUI module contains the components required for building the YUI
* seed file. This includes the script loading mechanism, a simple queue,
* and the core utilities for the library.
* @module yui
* @submodule yui-base
*/
/**
* Provides core language utilites and extensions used throughout YUI.
*
* @class Lang
* @static
*/
var L = Y.Lang || (Y.Lang = {}),
STRING_PROTO = String.prototype,
TOSTRING = Object.prototype.toString,
TYPES = {
'undefined' : 'undefined',
'number' : 'number',
'boolean' : 'boolean',
'string' : 'string',
'[object Function]': 'function',
'[object RegExp]' : 'regexp',
'[object Array]' : 'array',
'[object Date]' : 'date',
'[object Error]' : 'error'
},
SUBREGEX = /\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,
TRIMREGEX = /^\s+|\s+$/g,
NATIVE_FN_REGEX = /\{\s*\[(?:native code|function)\]\s*\}/i;
// -- Protected Methods --------------------------------------------------------
/**
Returns `true` if the given function appears to be implemented in native code,
`false` otherwise. Will always return `false` -- even in ES5-capable browsers --
if the `useNativeES5` YUI config option is set to `false`.
This isn't guaranteed to be 100% accurate and won't work for anything other than
functions, but it can be useful for determining whether a function like
`Array.prototype.forEach` is native or a JS shim provided by another library.
There's a great article by @kangax discussing certain flaws with this technique:
<http://perfectionkills.com/detecting-built-in-host-methods/>
While his points are valid, it's still possible to benefit from this function
as long as it's used carefully and sparingly, and in such a way that false
negatives have minimal consequences. It's used internally to avoid using
potentially broken non-native ES5 shims that have been added to the page by
other libraries.
@method _isNative
@param {Function} fn Function to test.
@return {Boolean} `true` if _fn_ appears to be native, `false` otherwise.
@static
@protected
@since 3.5.0
**/
L._isNative = function (fn) {
return !!(Y.config.useNativeES5 && fn && NATIVE_FN_REGEX.test(fn));
};
// -- Public Methods -----------------------------------------------------------
/**
* Determines whether or not the provided item is an array.
*
* Returns `false` for array-like collections such as the function `arguments`
* collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to
* test for an array-like collection.
*
* @method isArray
* @param o The object to test.
* @return {boolean} true if o is an array.
* @static
*/
L.isArray = L._isNative(Array.isArray) ? Array.isArray : function (o) {
return L.type(o) === 'array';
};
/**
* Determines whether or not the provided item is a boolean.
* @method isBoolean
* @static
* @param o The object to test.
* @return {boolean} true if o is a boolean.
*/
L.isBoolean = function(o) {
return typeof o === 'boolean';
};
/**
* Determines whether or not the supplied item is a date instance.
* @method isDate
* @static
* @param o The object to test.
* @return {boolean} true if o is a date.
*/
L.isDate = function(o) {
return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o);
};
/**
* <p>
* Determines whether or not the provided item is a function.
* Note: Internet Explorer thinks certain functions are objects:
* </p>
*
* <pre>
* var obj = document.createElement("object");
* Y.Lang.isFunction(obj.getAttribute) // reports false in IE
*
* var input = document.createElement("input"); // append to body
* Y.Lang.isFunction(input.focus) // reports false in IE
* </pre>
*
* <p>
* You will have to implement additional tests if these functions
* matter to you.
* </p>
*
* @method isFunction
* @static
* @param o The object to test.
* @return {boolean} true if o is a function.
*/
L.isFunction = function(o) {
return L.type(o) === 'function';
};
/**
* Determines whether or not the provided item is null.
* @method isNull
* @static
* @param o The object to test.
* @return {boolean} true if o is null.
*/
L.isNull = function(o) {
return o === null;
};
/**
* Determines whether or not the provided item is a legal number.
* @method isNumber
* @static
* @param o The object to test.
* @return {boolean} true if o is a number.
*/
L.isNumber = function(o) {
return typeof o === 'number' && isFinite(o);
};
/**
* Determines whether or not the provided item is of type object
* or function. Note that arrays are also objects, so
* <code>Y.Lang.isObject([]) === true</code>.
* @method isObject
* @static
* @param o The object to test.
* @param failfn {boolean} fail if the input is a function.
* @return {boolean} true if o is an object.
* @see isPlainObject
*/
L.isObject = function(o, failfn) {
var t = typeof o;
return (o && (t === 'object' ||
(!failfn && (t === 'function' || L.isFunction(o))))) || false;
};
/**
* Determines whether or not the provided item is a string.
* @method isString
* @static
* @param o The object to test.
* @return {boolean} true if o is a string.
*/
L.isString = function(o) {
return typeof o === 'string';
};
/**
* Determines whether or not the provided item is undefined.
* @method isUndefined
* @static
* @param o The object to test.
* @return {boolean} true if o is undefined.
*/
L.isUndefined = function(o) {
return typeof o === 'undefined';
};
/**
* A convenience method for detecting a legitimate non-null value.
* Returns false for null/undefined/NaN, true for other values,
* including 0/false/''
* @method isValue
* @static
* @param o The item to test.
* @return {boolean} true if it is not null/undefined/NaN || false.
*/
L.isValue = function(o) {
var t = L.type(o);
switch (t) {
case 'number':
return isFinite(o);
case 'null': // fallthru
case 'undefined':
return false;
default:
return !!t;
}
};
/**
* Returns the current time in milliseconds.
*
* @method now
* @return {Number} Current time in milliseconds.
* @static
* @since 3.3.0
*/
L.now = Date.now || function () {
return new Date().getTime();
};
/**
* Lightweight version of <code>Y.substitute</code>. Uses the same template
* structure as <code>Y.substitute</code>, but doesn't support recursion,
* auto-object coersion, or formats.
* @method sub
* @param {string} s String to be modified.
* @param {object} o Object containing replacement values.
* @return {string} the substitute result.
* @static
* @since 3.2.0
*/
L.sub = function(s, o) {
return s.replace ? s.replace(SUBREGEX, function (match, key) {
return L.isUndefined(o[key]) ? match : o[key];
}) : s;
};
/**
* Returns a string without any leading or trailing whitespace. If
* the input is not a string, the input will be returned untouched.
* @method trim
* @static
* @param s {string} the string to trim.
* @return {string} the trimmed string.
*/
L.trim = STRING_PROTO.trim ? function(s) {
return s && s.trim ? s.trim() : s;
} : function (s) {
try {
return s.replace(TRIMREGEX, '');
} catch (e) {
return s;
}
};
/**
* Returns a string without any leading whitespace.
* @method trimLeft
* @static
* @param s {string} the string to trim.
* @return {string} the trimmed string.
*/
L.trimLeft = STRING_PROTO.trimLeft ? function (s) {
return s.trimLeft();
} : function (s) {
return s.replace(/^\s+/, '');
};
/**
* Returns a string without any trailing whitespace.
* @method trimRight
* @static
* @param s {string} the string to trim.
* @return {string} the trimmed string.
*/
L.trimRight = STRING_PROTO.trimRight ? function (s) {
return s.trimRight();
} : function (s) {
return s.replace(/\s+$/, '');
};
/**
Returns one of the following strings, representing the type of the item passed
in:
* "array"
* "boolean"
* "date"
* "error"
* "function"
* "null"
* "number"
* "object"
* "regexp"
* "string"
* "undefined"
Known issues:
* `typeof HTMLElementCollection` returns function in Safari, but
`Y.Lang.type()` reports "object", which could be a good thing --
but it actually caused the logic in <code>Y.Lang.isObject</code> to fail.
@method type
@param o the item to test.
@return {string} the detected type.
@static
**/
L.type = function(o) {
return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');
};
/**
@module yui
@submodule yui-base
*/
var Lang = Y.Lang,
Native = Array.prototype,
hasOwn = Object.prototype.hasOwnProperty;
/**
Provides utility methods for working with arrays. Additional array helpers can
be found in the `collection` and `array-extras` modules.
`Y.Array(thing)` returns a native array created from _thing_. Depending on
_thing_'s type, one of the following will happen:
* Arrays are returned unmodified unless a non-zero _startIndex_ is
specified.
* Array-like collections (see `Array.test()`) are converted to arrays.
* For everything else, a new array is created with _thing_ as the sole
item.
Note: elements that are also collections, such as `<form>` and `<select>`
elements, are not automatically converted to arrays. To force a conversion,
pass `true` as the value of the _force_ parameter.
@class Array
@constructor
@param {Any} thing The thing to arrayify.
@param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like
collection, a subset of items starting at the specified index will be
returned.
@param {Boolean} [force=false] If `true`, _thing_ will be treated as an
array-like collection no matter what.
@return {Array} A native array created from _thing_, according to the rules
described above.
**/
function YArray(thing, startIndex, force) {
var len, result;
startIndex || (startIndex = 0);
if (force || YArray.test(thing)) {
// IE throws when trying to slice HTMLElement collections.
try {
return Native.slice.call(thing, startIndex);
} catch (ex) {
result = [];
for (len = thing.length; startIndex < len; ++startIndex) {
result.push(thing[startIndex]);
}
return result;
}
}
return [thing];
}
Y.Array = YArray;
/**
Dedupes an array of strings, returning an array that's guaranteed to contain
only one copy of a given string.
This method differs from `Array.unique()` in that it's optimized for use only
with strings, whereas `unique` may be used with other types (but is slower).
Using `dedupe()` with non-string values may result in unexpected behavior.
@method dedupe
@param {String[]} array Array of strings to dedupe.
@return {Array} Deduped copy of _array_.
@static
@since 3.4.0
**/
YArray.dedupe = function (array) {
var hash = {},
results = [],
i, item, len;
for (i = 0, len = array.length; i < len; ++i) {
item = array[i];
if (!hasOwn.call(hash, item)) {
hash[item] = 1;
results.push(item);
}
}
return results;
};
/**
Executes the supplied function on each item in the array. This method wraps
the native ES5 `Array.forEach()` method if available.
@method each
@param {Array} array Array to iterate.
@param {Function} fn Function to execute on each item in the array. The function
will receive the following arguments:
@param {Any} fn.item Current array item.
@param {Number} fn.index Current array index.
@param {Array} fn.array Array being iterated.
@param {Object} [thisObj] `this` object to use when calling _fn_.
@return {YUI} The YUI instance.
@static
**/
YArray.each = YArray.forEach = Lang._isNative(Native.forEach) ? function (array, fn, thisObj) {
Native.forEach.call(array || [], fn, thisObj || Y);
return Y;
} : function (array, fn, thisObj) {
for (var i = 0, len = (array && array.length) || 0; i < len; ++i) {
if (i in array) {
fn.call(thisObj || Y, array[i], i, array);
}
}
return Y;
};
/**
Alias for `each()`.
@method forEach
@static
**/
/**
Returns an object using the first array as keys and the second as values. If
the second array is not provided, or if it doesn't contain the same number of
values as the first array, then `true` will be used in place of the missing
values.
@example
Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']);
// => {a: 'foo', b: 'bar', c: true}
@method hash
@param {String[]} keys Array of strings to use as keys.
@param {Array} [values] Array to use as values.
@return {Object} Hash using the first array as keys and the second as values.
@static
**/
YArray.hash = function (keys, values) {
var hash = {},
vlen = (values && values.length) || 0,
i, len;
for (i = 0, len = keys.length; i < len; ++i) {
if (i in keys) {
hash[keys[i]] = vlen > i && i in values ? values[i] : true;
}
}
return hash;
};
/**
Returns the index of the first item in the array that's equal (using a strict
equality check) to the specified _value_, or `-1` if the value isn't found.
This method wraps the native ES5 `Array.indexOf()` method if available.
@method indexOf
@param {Array} array Array to search.
@param {Any} value Value to search for.
@param {Number} [from=0] The index at which to begin the search.
@return {Number} Index of the item strictly equal to _value_, or `-1` if not
found.
@static
**/
YArray.indexOf = Lang._isNative(Native.indexOf) ? function (array, value, from) {
return Native.indexOf.call(array, value, from);
} : function (array, value, from) {
// http://es5.github.com/#x15.4.4.14
var len = array.length;
from = +from || 0;
from = (from > 0 || -1) * Math.floor(Math.abs(from));
if (from < 0) {
from += len;
if (from < 0) {
from = 0;
}
}
for (; from < len; ++from) {
if (from in array && array[from] === value) {
return from;
}
}
return -1;
};
/**
Numeric sort convenience function.
The native `Array.prototype.sort()` function converts values to strings and
sorts them in lexicographic order, which is unsuitable for sorting numeric
values. Provide `Array.numericSort` as a custom sort function when you want
to sort values in numeric order.
@example
[42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort);
// => [4, 8, 15, 16, 23, 42]
@method numericSort
@param {Number} a First value to compare.
@param {Number} b Second value to compare.
@return {Number} Difference between _a_ and _b_.
@static
**/
YArray.numericSort = function (a, b) {
return a - b;
};
/**
Executes the supplied function on each item in the array. Returning a truthy
value from the function will stop the processing of remaining items.
@method some
@param {Array} array Array to iterate over.
@param {Function} fn Function to execute on each item. The function will receive
the following arguments:
@param {Any} fn.value Current array item.
@param {Number} fn.index Current array index.
@param {Array} fn.array Array being iterated over.
@param {Object} [thisObj] `this` object to use when calling _fn_.
@return {Boolean} `true` if the function returns a truthy value on any of the
items in the array; `false` otherwise.
@static
**/
YArray.some = Lang._isNative(Native.some) ? function (array, fn, thisObj) {
return Native.some.call(array, fn, thisObj);
} : function (array, fn, thisObj) {
for (var i = 0, len = array.length; i < len; ++i) {
if (i in array && fn.call(thisObj, array[i], i, array)) {
return true;
}
}
return false;
};
/**
Evaluates _obj_ to determine if it's an array, an array-like collection, or
something else. This is useful when working with the function `arguments`
collection and `HTMLElement` collections.
Note: This implementation doesn't consider elements that are also
collections, such as `<form>` and `<select>`, to be array-like.
@method test
@param {Object} obj Object to test.
@return {Number} A number indicating the results of the test:
* 0: Neither an array nor an array-like collection.
* 1: Real array.
* 2: Array-like collection.
@static
**/
YArray.test = function (obj) {
var result = 0;
if (Lang.isArray(obj)) {
result = 1;
} else if (Lang.isObject(obj)) {
try {
// indexed, but no tagName (element) or alert (window),
// or functions without apply/call (Safari
// HTMLElementCollection bug).
if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {
result = 2;
}
} catch (ex) {}
}
return result;
};
/**
* The YUI module contains the components required for building the YUI
* seed file. This includes the script loading mechanism, a simple queue,
* and the core utilities for the library.
* @module yui
* @submodule yui-base
*/
/**
* A simple FIFO queue. Items are added to the Queue with add(1..n items) and
* removed using next().
*
* @class Queue
* @constructor
* @param {MIXED} item* 0..n items to seed the queue.
*/
function Queue() {
this._init();
this.add.apply(this, arguments);
}
Queue.prototype = {
/**
* Initialize the queue
*
* @method _init
* @protected
*/
_init: function() {
/**
* The collection of enqueued items
*
* @property _q
* @type Array
* @protected
*/
this._q = [];
},
/**
* Get the next item in the queue. FIFO support
*
* @method next
* @return {MIXED} the next item in the queue.
*/
next: function() {
return this._q.shift();
},
/**
* Get the last in the queue. LIFO support.
*
* @method last
* @return {MIXED} the last item in the queue.
*/
last: function() {
return this._q.pop();
},
/**
* Add 0..n items to the end of the queue.
*
* @method add
* @param {MIXED} item* 0..n items.
* @return {object} this queue.
*/
add: function() {
this._q.push.apply(this._q, arguments);
return this;
},
/**
* Returns the current number of queued items.
*
* @method size
* @return {Number} The size.
*/
size: function() {
return this._q.length;
}
};
Y.Queue = Queue;
YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue();
/**
The YUI module contains the components required for building the YUI seed file.
This includes the script loading mechanism, a simple queue, and the core
utilities for the library.
@module yui
@submodule yui-base
**/
var CACHED_DELIMITER = '__',
hasOwn = Object.prototype.hasOwnProperty,
isObject = Y.Lang.isObject;
/**
Returns a wrapper for a function which caches the return value of that function,
keyed off of the combined string representation of the argument values provided
when the wrapper is called.
Calling this function again with the same arguments will return the cached value
rather than executing the wrapped function.
Note that since the cache is keyed off of the string representation of arguments
passed to the wrapper function, arguments that aren't strings and don't provide
a meaningful `toString()` method may result in unexpected caching behavior. For
example, the objects `{}` and `{foo: 'bar'}` would both be converted to the
string `[object Object]` when used as a cache key.
@method cached
@param {Function} source The function to memoize.
@param {Object} [cache={}] Object in which to store cached values. You may seed
this object with pre-existing cached values if desired.
@param {any} [refetch] If supplied, this value is compared with the cached value
using a `==` comparison. If the values are equal, the wrapped function is
executed again even though a cached value exists.
@return {Function} Wrapped function.
@for YUI
**/
Y.cached = function (source, cache, refetch) {
cache || (cache = {});
return function (arg) {
var key = arguments.length > 1 ?
Array.prototype.join.call(arguments, CACHED_DELIMITER) :
String(arg);
if (!(key in cache) || (refetch && cache[key] == refetch)) {
cache[key] = source.apply(source, arguments);
}
return cache[key];
};
};
/**
Returns the `location` object from the window/frame in which this YUI instance
operates, or `undefined` when executing in a non-browser environment
(e.g. Node.js).
It is _not_ recommended to hold references to the `window.location` object
outside of the scope of a function in which its properties are being accessed or
its methods are being called. This is because of a nasty bug/issue that exists
in both Safari and MobileSafari browsers:
[WebKit Bug 34679](https://bugs.webkit.org/show_bug.cgi?id=34679).
@method getLocation
@return {location} The `location` object from the window/frame in which this YUI
instance operates.
@since 3.5.0
**/
Y.getLocation = function () {
// It is safer to look this up every time because yui-base is attached to a
// YUI instance before a user's config is applied; i.e. `Y.config.win` does
// not point the correct window object when this file is loaded.
var win = Y.config.win;
// It is not safe to hold a reference to the `location` object outside the
// scope in which it is being used. The WebKit engine used in Safari and
// MobileSafari will "disconnect" the `location` object from the `window`
// when a page is restored from back/forward history cache.
return win && win.location;
};
/**
Returns a new object containing all of the properties of all the supplied
objects. The properties from later objects will overwrite those in earlier
objects.
Passing in a single object will create a shallow copy of it. For a deep copy,
use `clone()`.
@method merge
@param {Object} objects* One or more objects to merge.
@return {Object} A new merged object.
**/
Y.merge = function () {
var args = arguments,
i = 0,
len = args.length,
result = {};
for (; i < len; ++i) {
Y.mix(result, args[i], true);
}
return result;
};
/**
Mixes _supplier_'s properties into _receiver_.
Properties on _receiver_ or _receiver_'s prototype will not be overwritten or
shadowed unless the _overwrite_ parameter is `true`, and will not be merged
unless the _merge_ parameter is `true`.
In the default mode (0), only properties the supplier owns are copied (prototype
properties are not copied). The following copying modes are available:
* `0`: _Default_. Object to object.
* `1`: Prototype to prototype.
* `2`: Prototype to prototype and object to object.
* `3`: Prototype to object.
* `4`: Object to prototype.
@method mix
@param {Function|Object} receiver The object or function to receive the mixed
properties.
@param {Function|Object} supplier The object or function supplying the
properties to be mixed.
@param {Boolean} [overwrite=false] If `true`, properties that already exist
on the receiver will be overwritten with properties from the supplier.
@param {String[]} [whitelist] An array of property names to copy. If
specified, only the whitelisted properties will be copied, and all others
will be ignored.
@param {Number} [mode=0] Mix mode to use. See above for available modes.
@param {Boolean} [merge=false] If `true`, objects and arrays that already
exist on the receiver will have the corresponding object/array from the
supplier merged into them, rather than being skipped or overwritten. When
both _overwrite_ and _merge_ are `true`, _merge_ takes precedence.
@return {Function|Object|YUI} The receiver, or the YUI instance if the
specified receiver is falsy.
**/
Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) {
var alwaysOverwrite, exists, from, i, key, len, to;
// If no supplier is given, we return the receiver. If no receiver is given,
// we return Y. Returning Y doesn't make much sense to me, but it's
// grandfathered in for backcompat reasons.
if (!receiver || !supplier) {
return receiver || Y;
}
if (mode) {
// In mode 2 (prototype to prototype and object to object), we recurse
// once to do the proto to proto mix. The object to object mix will be
// handled later on.
if (mode === 2) {
Y.mix(receiver.prototype, supplier.prototype, overwrite,
whitelist, 0, merge);
}
// Depending on which mode is specified, we may be copying from or to
// the prototypes of the supplier and receiver.
from = mode === 1 || mode === 3 ? supplier.prototype : supplier;
to = mode === 1 || mode === 4 ? receiver.prototype : receiver;
// If either the supplier or receiver doesn't actually have a
// prototype property, then we could end up with an undefined `from`
// or `to`. If that happens, we abort and return the receiver.
if (!from || !to) {
return receiver;
}
} else {
from = supplier;
to = receiver;
}
// If `overwrite` is truthy and `merge` is falsy, then we can skip a
// property existence check on each iteration and save some time.
alwaysOverwrite = overwrite && !merge;
if (whitelist) {
for (i = 0, len = whitelist.length; i < len; ++i) {
key = whitelist[i];
// We call `Object.prototype.hasOwnProperty` instead of calling
// `hasOwnProperty` on the object itself, since the object's
// `hasOwnProperty` method may have been overridden or removed.
// Also, some native objects don't implement a `hasOwnProperty`
// method.
if (!hasOwn.call(from, key)) {
continue;
}
// The `key in to` check here is (sadly) intentional for backwards
// compatibility reasons. It prevents undesired shadowing of
// prototype members on `to`.
exists = alwaysOverwrite ? false : key in to;
if (merge && exists && isObject(to[key], true)
&& isObject(from[key], true)) {
// If we're in merge mode, and the key is present on both
// objects, and the value on both objects is either an object or
// an array (but not a function), then we recurse to merge the
// `from` value into the `to` value instead of overwriting it.
//
// Note: It's intentional that the whitelist isn't passed to the
// recursive call here. This is legacy behavior that lots of
// code still depends on.
Y.mix(to[key], from[key], overwrite, null, 0, merge);
} else if (overwrite || !exists) {
// We're not in merge mode, so we'll only copy the `from` value
// to the `to` value if we're in overwrite mode or if the
// current key doesn't exist on the `to` object.
to[key] = from[key];
}
}
} else {
for (key in from) {
// The code duplication here is for runtime performance reasons.
// Combining whitelist and non-whitelist operations into a single
// loop or breaking the shared logic out into a function both result
// in worse performance, and Y.mix is critical enough that the byte
// tradeoff is worth it.
if (!hasOwn.call(from, key)) {
continue;
}
// The `key in to` check here is (sadly) intentional for backwards
// compatibility reasons. It prevents undesired shadowing of
// prototype members on `to`.
exists = alwaysOverwrite ? false : key in to;
if (merge && exists && isObject(to[key], true)
&& isObject(from[key], true)) {
Y.mix(to[key], from[key], overwrite, null, 0, merge);
} else if (overwrite || !exists) {
to[key] = from[key];
}
}
// If this is an IE browser with the JScript enumeration bug, force
// enumeration of the buggy properties by making a recursive call with
// the buggy properties as the whitelist.
if (Y.Object._hasEnumBug) {
Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge);
}
}
return receiver;
};
/**
* The YUI module contains the components required for building the YUI
* seed file. This includes the script loading mechanism, a simple queue,
* and the core utilities for the library.
* @module yui
* @submodule yui-base
*/
/**
* Adds utilities to the YUI instance for working with objects.
*
* @class Object
*/
var Lang = Y.Lang,
hasOwn = Object.prototype.hasOwnProperty,
UNDEFINED, // <-- Note the comma. We're still declaring vars.
/**
* Returns a new object that uses _obj_ as its prototype. This method wraps the
* native ES5 `Object.create()` method if available, but doesn't currently
* pass through `Object.create()`'s second argument (properties) in order to
* ensure compatibility with older browsers.
*
* @method ()
* @param {Object} obj Prototype object.
* @return {Object} New object using _obj_ as its prototype.
* @static
*/
O = Y.Object = Lang._isNative(Object.create) ? function (obj) {
// We currently wrap the native Object.create instead of simply aliasing it
// to ensure consistency with our fallback shim, which currently doesn't
// support Object.create()'s second argument (properties). Once we have a
// safe fallback for the properties arg, we can stop wrapping
// Object.create().
return Object.create(obj);
} : (function () {
// Reusable constructor function for the Object.create() shim.
function F() {}
// The actual shim.
return function (obj) {
F.prototype = obj;
return new F();
};
}()),
/**
* Property names that IE doesn't enumerate in for..in loops, even when they
* should be enumerable. When `_hasEnumBug` is `true`, it's necessary to
* manually enumerate these properties.
*
* @property _forceEnum
* @type String[]
* @protected
* @static
*/
forceEnum = O._forceEnum = [
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'toString',
'toLocaleString',
'valueOf'
],
/**
* `true` if this browser has the JScript enumeration bug that prevents
* enumeration of the properties named in the `_forceEnum` array, `false`
* otherwise.
*
* See:
* - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug>
* - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation>
*
* @property _hasEnumBug
* @type Boolean
* @protected
* @static
*/
hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'),
/**
* `true` if this browser incorrectly considers the `prototype` property of
* functions to be enumerable. Currently known to affect Opera 11.50.
*
* @property _hasProtoEnumBug
* @type Boolean
* @protected
* @static
*/
hasProtoEnumBug = O._hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),
/**
* Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or
* exists only on _obj_'s prototype. This is essentially a safer version of
* `obj.hasOwnProperty()`.
*
* @method owns
* @param {Object} obj Object to test.
* @param {String} key Property name to look for.
* @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise.
* @static
*/
owns = O.owns = function (obj, key) {
return !!obj && hasOwn.call(obj, key);
}; // <-- End of var declarations.
/**
* Alias for `owns()`.
*
* @method hasKey
* @param {Object} obj Object to test.
* @param {String} key Property name to look for.
* @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise.
* @static
*/
O.hasKey = owns;
/**
* Returns an array containing the object's enumerable keys. Does not include
* prototype keys or non-enumerable keys.
*
* Note that keys are returned in enumeration order (that is, in the same order
* that they would be enumerated by a `for-in` loop), which may not be the same
* as the order in which they were defined.
*
* This method is an alias for the native ES5 `Object.keys()` method if
* available.
*
* @example
*
* Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'});
* // => ['a', 'b', 'c']
*
* @method keys
* @param {Object} obj An object.
* @return {String[]} Array of keys.
* @static
*/
O.keys = Lang._isNative(Object.keys) ? Object.keys : function (obj) {
if (!Lang.isObject(obj)) {
throw new TypeError('Object.keys called on a non-object');
}
var keys = [],
i, key, len;
if (hasProtoEnumBug && typeof obj === 'function') {
for (key in obj) {
if (owns(obj, key) && key !== 'prototype') {
keys.push(key);
}
}
} else {
for (key in obj) {
if (owns(obj, key)) {
keys.push(key);
}
}
}
if (hasEnumBug) {
for (i = 0, len = forceEnum.length; i < len; ++i) {
key = forceEnum[i];
if (owns(obj, key)) {
keys.push(key);
}
}
}
return keys;
};
/**
* Returns an array containing the values of the object's enumerable keys.
*
* Note that values are returned in enumeration order (that is, in the same
* order that they would be enumerated by a `for-in` loop), which may not be the
* same as the order in which they were defined.
*
* @example
*
* Y.Object.values({a: 'foo', b: 'bar', c: 'baz'});
* // => ['foo', 'bar', 'baz']
*
* @method values
* @param {Object} obj An object.
* @return {Array} Array of values.
* @static
*/
O.values = function (obj) {
var keys = O.keys(obj),
i = 0,
len = keys.length,
values = [];
for (; i < len; ++i) {
values.push(obj[keys[i]]);
}
return values;
};
/**
* Returns the number of enumerable keys owned by an object.
*
* @method size
* @param {Object} obj An object.
* @return {Number} The object's size.
* @static
*/
O.size = function (obj) {
try {
return O.keys(obj).length;
} catch (ex) {
return 0; // Legacy behavior for non-objects.
}
};
/**
* Returns `true` if the object owns an enumerable property with the specified
* value.
*
* @method hasValue
* @param {Object} obj An object.
* @param {any} value The value to search for.
* @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise.
* @static
*/
O.hasValue = function (obj, value) {
return Y.Array.indexOf(O.values(obj), value) > -1;
};
/**
* Executes a function on each enumerable property in _obj_. The function
* receives the value, the key, and the object itself as parameters (in that
* order).
*
* By default, only properties owned by _obj_ are enumerated. To include
* prototype properties, set the _proto_ parameter to `true`.
*
* @method each
* @param {Object} obj Object to enumerate.
* @param {Function} fn Function to execute on each enumerable property.
* @param {mixed} fn.value Value of the current property.
* @param {String} fn.key Key of the current property.
* @param {Object} fn.obj Object being enumerated.
* @param {Object} [thisObj] `this` object to use when calling _fn_.
* @param {Boolean} [proto=false] Include prototype properties.
* @return {YUI} the YUI instance.
* @chainable
* @static
*/
O.each = function (obj, fn, thisObj, proto) {
var key;
for (key in obj) {
if (proto || owns(obj, key)) {
fn.call(thisObj || Y, obj[key], key, obj);
}
}
return Y;
};
/**
* Executes a function on each enumerable property in _obj_, but halts if the
* function returns a truthy value. The function receives the value, the key,
* and the object itself as paramters (in that order).
*
* By default, only properties owned by _obj_ are enumerated. To include
* prototype properties, set the _proto_ parameter to `true`.
*
* @method some
* @param {Object} obj Object to enumerate.
* @param {Function} fn Function to execute on each enumerable property.
* @param {mixed} fn.value Value of the current property.
* @param {String} fn.key Key of the current property.
* @param {Object} fn.obj Object being enumerated.
* @param {Object} [thisObj] `this` object to use when calling _fn_.
* @param {Boolean} [proto=false] Include prototype properties.
* @return {Boolean} `true` if any execution of _fn_ returns a truthy value,
* `false` otherwise.
* @static
*/
O.some = function (obj, fn, thisObj, proto) {
var key;
for (key in obj) {
if (proto || owns(obj, key)) {
if (fn.call(thisObj || Y, obj[key], key, obj)) {
return true;
}
}
}
return false;
};
/**
* Retrieves the sub value at the provided path,
* from the value object provided.
*
* @method getValue
* @static
* @param o The object from which to extract the property value.
* @param path {Array} A path array, specifying the object traversal path
* from which to obtain the sub value.
* @return {Any} The value stored in the path, undefined if not found,
* undefined if the source is not an object. Returns the source object
* if an empty path is provided.
*/
O.getValue = function(o, path) {
if (!Lang.isObject(o)) {
return UNDEFINED;
}
var i,
p = Y.Array(path),
l = p.length;
for (i = 0; o !== UNDEFINED && i < l; i++) {
o = o[p[i]];
}
return o;
};
/**
* Sets the sub-attribute value at the provided path on the
* value object. Returns the modified value object, or
* undefined if the path is invalid.
*
* @method setValue
* @static
* @param o The object on which to set the sub value.
* @param path {Array} A path array, specifying the object traversal path
* at which to set the sub value.
* @param val {Any} The new value for the sub-attribute.
* @return {Object} The modified object, with the new sub value set, or
* undefined, if the path was invalid.
*/
O.setValue = function(o, path, val) {
var i,
p = Y.Array(path),
leafIdx = p.length - 1,
ref = o;
if (leafIdx >= 0) {
for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) {
ref = ref[p[i]];
}
if (ref !== UNDEFINED) {
ref[p[i]] = val;
} else {
return UNDEFINED;
}
}
return o;
};
/**
* Returns `true` if the object has no enumerable properties of its own.
*
* @method isEmpty
* @param {Object} obj An object.
* @return {Boolean} `true` if the object is empty.
* @static
* @since 3.2.0
*/
O.isEmpty = function (obj) {
return !O.keys(Object(obj)).length;
};
/**
* The YUI module contains the components required for building the YUI seed
* file. This includes the script loading mechanism, a simple queue, and the
* core utilities for the library.
* @module yui
* @submodule yui-base
*/
/**
* YUI user agent detection.
* Do not fork for a browser if it can be avoided. Use feature detection when
* you can. Use the user agent as a last resort. For all fields listed
* as @type float, UA stores a version number for the browser engine,
* 0 otherwise. This value may or may not map to the version number of
* the browser using the engine. The value is presented as a float so
* that it can easily be used for boolean evaluation as well as for
* looking for a particular range of versions. Because of this,
* some of the granularity of the version info may be lost. The fields that
* are @type string default to null. The API docs list the values that
* these fields can have.
* @class UA
* @static
*/
/**
* Static method on `YUI.Env` for parsing a UA string. Called at instantiation
* to populate `Y.UA`.
*
* @static
* @method parseUA
* @param {String} [subUA=navigator.userAgent] UA string to parse
* @return {Object} The Y.UA object
*/
YUI.Env.parseUA = function(subUA) {
var numberify = function(s) {
var c = 0;
return parseFloat(s.replace(/\./g, function() {
return (c++ == 1) ? '' : '.';
}));
},
win = Y.config.win,
nav = win && win.navigator,
o = {
/**
* Internet Explorer version number or 0. Example: 6
* @property ie
* @type float
* @static
*/
ie: 0,
/**
* Opera version number or 0. Example: 9.2
* @property opera
* @type float
* @static
*/
opera: 0,
/**
* Gecko engine revision number. Will evaluate to 1 if Gecko
* is detected but the revision could not be found. Other browsers
* will be 0. Example: 1.8
* <pre>
* Firefox 1.0.0.4: 1.7.8 <-- Reports 1.7
* Firefox 1.5.0.9: 1.8.0.9 <-- 1.8
* Firefox 2.0.0.3: 1.8.1.3 <-- 1.81
* Firefox 3.0 <-- 1.9
* Firefox 3.5 <-- 1.91
* </pre>
* @property gecko
* @type float
* @static
*/
gecko: 0,
/**
* AppleWebKit version. KHTML browsers that are not WebKit browsers
* will evaluate to 1, other browsers 0. Example: 418.9
* <pre>
* Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the
* latest available for Mac OSX 10.3.
* Safari 2.0.2: 416 <-- hasOwnProperty introduced
* Safari 2.0.4: 418 <-- preventDefault fixed
* Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
* different versions of webkit
* Safari 2.0.4 (419.3): 419 <-- Tiger installations that have been
* updated, but not updated
* to the latest patch.
* Webkit 212 nightly: 522+ <-- Safari 3.0 precursor (with native
* SVG and many major issues fixed).
* Safari 3.0.4 (523.12) 523.12 <-- First Tiger release - automatic
* update from 2.x via the 10.4.11 OS patch.
* Webkit nightly 1/2008:525+ <-- Supports DOMContentLoaded event.
* yahoo.com user agent hack removed.
* </pre>
* http://en.wikipedia.org/wiki/Safari_version_history
* @property webkit
* @type float
* @static
*/
webkit: 0,
/**
* Safari will be detected as webkit, but this property will also
* be populated with the Safari version number
* @property safari
* @type float
* @static
*/
safari: 0,
/**
* Chrome will be detected as webkit, but this property will also
* be populated with the Chrome version number
* @property chrome
* @type float
* @static
*/
chrome: 0,
/**
* The mobile property will be set to a string containing any relevant
* user agent information when a modern mobile browser is detected.
* Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series
* devices with the WebKit-based browser, and Opera Mini.
* @property mobile
* @type string
* @default null
* @static
*/
mobile: null,
/**
* Adobe AIR version number or 0. Only populated if webkit is detected.
* Example: 1.0
* @property air
* @type float
*/
air: 0,
/**
* Detects Apple iPad's OS version
* @property ipad
* @type float
* @static
*/
ipad: 0,
/**
* Detects Apple iPhone's OS version
* @property iphone
* @type float
* @static
*/
iphone: 0,
/**
* Detects Apples iPod's OS version
* @property ipod
* @type float
* @static
*/
ipod: 0,
/**
* General truthy check for iPad, iPhone or iPod
* @property ios
* @type float
* @default null
* @static
*/
ios: null,
/**
* Detects Googles Android OS version
* @property android
* @type float
* @static
*/
android: 0,
/**
* Detects Kindle Silk
* @property silk
* @type float
* @static
*/
silk: 0,
/**
* Detects Kindle Silk Acceleration
* @property accel
* @type Boolean
* @static
*/
accel: false,
/**
* Detects Palms WebOS version
* @property webos
* @type float
* @static
*/
webos: 0,
/**
* Google Caja version number or 0.
* @property caja
* @type float
*/
caja: nav && nav.cajaVersion,
/**
* Set to true if the page appears to be in SSL
* @property secure
* @type boolean
* @static
*/
secure: false,
/**
* The operating system. Currently only detecting windows or macintosh
* @property os
* @type string
* @default null
* @static
*/
os: null,
/**
* The Nodejs Version
* @property nodejs
* @type float
* @default 0
* @static
*/
nodejs: 0
},
ua = subUA || nav && nav.userAgent,
loc = win && win.location,
href = loc && loc.href,
m;
/**
* The User Agent string that was parsed
* @property userAgent
* @type String
* @static
*/
o.userAgent = ua;
o.secure = href && (href.toLowerCase().indexOf('https') === 0);
if (ua) {
if ((/windows|win32/i).test(ua)) {
o.os = 'windows';
} else if ((/macintosh|mac_powerpc/i).test(ua)) {
o.os = 'macintosh';
} else if ((/android/i).test(ua)) {
o.os = 'android';
} else if ((/symbos/i).test(ua)) {
o.os = 'symbos';
} else if ((/linux/i).test(ua)) {
o.os = 'linux';
} else if ((/rhino/i).test(ua)) {
o.os = 'rhino';
}
// Modern KHTML browsers should qualify as Safari X-Grade
if ((/KHTML/).test(ua)) {
o.webkit = 1;
}
if ((/IEMobile|XBLWP7/).test(ua)) {
o.mobile = 'windows';
}
if ((/Fennec/).test(ua)) {
o.mobile = 'gecko';
}
// Modern WebKit browsers are at least X-Grade
m = ua.match(/AppleWebKit\/([^\s]*)/);
if (m && m[1]) {
o.webkit = numberify(m[1]);
o.safari = o.webkit;
// Mobile browser check
if (/ Mobile\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) {
o.mobile = 'Apple'; // iPhone or iPod Touch
m = ua.match(/OS ([^\s]*)/);
if (m && m[1]) {
m = numberify(m[1].replace('_', '.'));
}
o.ios = m;
o.os = 'ios';
o.ipad = o.ipod = o.iphone = 0;
m = ua.match(/iPad|iPod|iPhone/);
if (m && m[0]) {
o[m[0].toLowerCase()] = o.ios;
}
} else {
m = ua.match(/NokiaN[^\/]*|webOS\/\d\.\d/);
if (m) {
// Nokia N-series, webOS, ex: NokiaN95
o.mobile = m[0];
}
if (/webOS/.test(ua)) {
o.mobile = 'WebOS';
m = ua.match(/webOS\/([^\s]*);/);
if (m && m[1]) {
o.webos = numberify(m[1]);
}
}
if (/ Android/.test(ua)) {
if (/Mobile/.test(ua)) {
o.mobile = 'Android';
}
m = ua.match(/Android ([^\s]*);/);
if (m && m[1]) {
o.android = numberify(m[1]);
}
}
if (/Silk/.test(ua)) {
m = ua.match(/Silk\/([^\s]*)\)/);
if (m && m[1]) {
o.silk = numberify(m[1]);
}
if (!o.android) {
o.android = 2.34; //Hack for desktop mode in Kindle
o.os = 'Android';
}
if (/Accelerated=true/.test(ua)) {
o.accel = true;
}
}
}
m = ua.match(/(Chrome|CrMo)\/([^\s]*)/);
if (m && m[1] && m[2]) {
o.chrome = numberify(m[2]); // Chrome
o.safari = 0; //Reset safari back to 0
if (m[1] === 'CrMo') {
o.mobile = 'chrome';
}
} else {
m = ua.match(/AdobeAIR\/([^\s]*)/);
if (m) {
o.air = m[0]; // Adobe AIR 1.0 or better
}
}
}
if (!o.webkit) { // not webkit
// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
if (/Opera/.test(ua)) {
m = ua.match(/Opera[\s\/]([^\s]*)/);
if (m && m[1]) {
o.opera = numberify(m[1]);
}
m = ua.match(/Version\/([^\s]*)/);
if (m && m[1]) {
o.opera = numberify(m[1]); // opera 10+
}
if (/Opera Mobi/.test(ua)) {
o.mobile = 'opera';
m = ua.replace('Opera Mobi', '').match(/Opera ([^\s]*)/);
if (m && m[1]) {
o.opera = numberify(m[1]);
}
}
m = ua.match(/Opera Mini[^;]*/);
if (m) {
o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
}
} else { // not opera or webkit
m = ua.match(/MSIE\s([^;]*)/);
if (m && m[1]) {
o.ie = numberify(m[1]);
} else { // not opera, webkit, or ie
m = ua.match(/Gecko\/([^\s]*)/);
if (m) {
o.gecko = 1; // Gecko detected, look for revision
m = ua.match(/rv:([^\s\)]*)/);
if (m && m[1]) {
o.gecko = numberify(m[1]);
}
}
}
}
}
}
//It was a parsed UA, do not assign the global value.
if (!subUA) {
if (typeof process == 'object') {
if (process.versions && process.versions.node) {
//NodeJS
o.os = process.platform;
o.nodejs = process.versions.node;
}
}
YUI.Env.UA = o;
}
return o;
};
Y.UA = YUI.Env.UA || YUI.Env.parseUA();
YUI.Env.aliases = {
"anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],
"app": ["app-base","app-transitions","model","model-list","router","view"],
"attribute": ["attribute-base","attribute-complex"],
"autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],
"base": ["base-base","base-pluginhost","base-build"],
"cache": ["cache-base","cache-offline","cache-plugin"],
"collection": ["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],
"controller": ["router"],
"dataschema": ["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],
"datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],
"datatable": ["datatable-core","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],
"datatable-deprecated": ["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],
"datatype": ["datatype-number","datatype-date","datatype-xml"],
"datatype-date": ["datatype-date-parse","datatype-date-format"],
"datatype-number": ["datatype-number-parse","datatype-number-format"],
"datatype-xml": ["datatype-xml-parse","datatype-xml-format"],
"dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],
"dom": ["dom-base","dom-screen","dom-style","selector-native","selector"],
"editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],
"event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],
"event-custom": ["event-custom-base","event-custom-complex"],
"event-gestures": ["event-flick","event-move"],
"handlebars": ["handlebars-compiler"],
"highlight": ["highlight-base","highlight-accentfold"],
"history": ["history-base","history-hash","history-hash-ie","history-html5"],
"io": ["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],
"json": ["json-parse","json-stringify"],
"loader": ["loader-base","loader-rollup","loader-yui3"],
"node": ["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],
"pluginhost": ["pluginhost-base","pluginhost-config"],
"querystring": ["querystring-parse","querystring-stringify"],
"recordset": ["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],
"resize": ["resize-base","resize-proxy","resize-constrain"],
"slider": ["slider-base","slider-value-range","clickable-rail","range-slider"],
"text": ["text-accentfold","text-wordbreak"],
"widget": ["widget-base","widget-htmlparser","widget-skin","widget-uievents"]
};
}, '@VERSION@' );
YUI.add('get', function(Y) {
/**
* NodeJS specific Get module used to load remote resources. It contains the same signature as the default Get module so there is no code change needed.
* @module get-nodejs
* @class GetNodeJS
*/
var path = require('path'),
vm = require('vm'),
fs = require('fs'),
request = require('request');
Y.Get = function() {
};
//Setup the default config base path
Y.config.base = path.join(__dirname, '../');
YUI.require = require;
YUI.process = process;
/**
* Escape the path for Windows, they need to be double encoded when used as `__dirname` or `__filename`
* @method escapeWinPath
* @protected
* @param {String} p The path to modify
* @return {String} The encoded path
*/
var escapeWinPath = function(p) {
return p.replace(/\\/g, '\\\\');
};
/**
* Takes the raw JS files and wraps them to be executed in the YUI context so they can be loaded
* into the YUI object
* @method _exec
* @private
* @param {String} data The JS to execute
* @param {String} url The path to the file that was parsed
* @param {Callback} cb The callback to execute when this is completed
* @param {Error} cb.err=null Error object
* @param {String} cb.url The URL that was just parsed
*/
Y.Get._exec = function(data, url, cb) {
var dirName = escapeWinPath(path.dirname(url));
var fileName = escapeWinPath(url);
if (dirName.match(/^https?:\/\//)) {
dirName = '.';
fileName = 'remoteResource';
}
var mod = "(function(YUI) { var __dirname = '" + dirName + "'; "+
"var __filename = '" + fileName + "'; " +
"var process = YUI.process;" +
"var require = function(file) {" +
" if (file.indexOf('./') === 0) {" +
" file = __dirname + file.replace('./', '/'); }" +
" return YUI.require(file); }; " +
data + " ;return YUI; })";
//var mod = "(function(YUI) { " + data + ";return YUI; })";
var script = vm.createScript(mod, url);
var fn = script.runInThisContext(mod);
YUI = fn(YUI);
cb(null, url);
};
/**
* Fetches the content from a remote URL or a file from disc and passes the content
* off to `_exec` for parsing
* @method _include
* @private
* @param {String} url The URL/File path to fetch the content from
* @param {Callback} cb The callback to fire once the content has been executed via `_exec`
*/
Y.Get._include = function(url, cb) {
var self = this;
if (url.match(/^https?:\/\//)) {
var cfg = {
url: url,
timeout: self.timeout
};
request(cfg, function (err, response, body) {
if (err) {
Y.log(err, 'error', 'get');
cb(err, url);
} else {
Y.Get._exec(body, url, cb);
}
});
} else {
if (Y.config.useSync) {
//Needs to be in useSync
if (path.existsSync(url)) {
var mod = fs.readFileSync(url,'utf8');
Y.Get._exec(mod, url, cb);
} else {
cb('Path does not exist: ' + url, url);
}
} else {
fs.readFile(url, 'utf8', function(err, mod) {
if (err) {
cb(err, url);
} else {
Y.Get._exec(mod, url, cb);
}
});
}
}
};
var end = function(cb, msg, result) {
//Y.log('Get end: ' + cb.onEnd);
if (Y.Lang.isFunction(cb.onEnd)) {
cb.onEnd.call(Y, msg, result);
}
}, pass = function(cb) {
//Y.log('Get pass: ' + cb.onSuccess);
if (Y.Lang.isFunction(cb.onSuccess)) {
cb.onSuccess.call(Y, cb);
}
end(cb, 'success', 'success');
}, fail = function(cb, er) {
//Y.log('Get fail: ' + er);
if (Y.Lang.isFunction(cb.onFailure)) {
cb.onFailure.call(Y, er, cb);
}
end(cb, er, 'fail');
};
/**
* Override for Get.script for loading local or remote YUI modules.
* @method js
* @param {Array|String} s The URL's to load into this context
* @param {Object} options Transaction options
*/
Y.Get.js = function(s, options) {
var A = Y.Array,
self = this,
urls = A(s), url, i, l = urls.length, c= 0,
check = function() {
if (c === l) {
pass(options);
}
};
for (i=0; i<l; i++) {
url = urls[i];
if (Y.Lang.isObject(url)) {
url = url.url;
}
url = url.replace(/'/g, '%27');
Y.log('URL: ' + url, 'info', 'get');
Y.Get._include(url, function(err, url) {
if (!Y.config) {
Y.config = {
debug: true
};
}
if (options.onProgress) {
options.onProgress.call(options.context || Y, url);
}
Y.log('After Load: ' + url, 'info', 'get');
if (err) {
fail(options, err);
Y.log('----------------------------------------------------------', 'error', 'get');
Y.log(err, 'error', 'get');
Y.log('----------------------------------------------------------', 'error', 'get');
} else {
c++;
check();
}
});
}
};
/**
* Alias for `Y.Get.js`
* @method script
*/
Y.Get.script = Y.Get.js;
//Place holder for SS Dom access
Y.Get.css = function(s, cb) {
Y.log('Y.Get.css is not supported, just reporting that it has loaded but not fetching.', 'warn', 'get');
pass(cb);
};
}, '@VERSION@' ,{requires:['yui-base']});
YUI.add('features', function(Y) {
var feature_tests = {};
/**
Contains the core of YUI's feature test architecture.
@module features
*/
/**
* Feature detection
* @class Features
* @static
*/
Y.mix(Y.namespace('Features'), {
/**
* Object hash of all registered feature tests
* @property tests
* @type Object
*/
tests: feature_tests,
/**
* Add a test to the system
*
* ```
* Y.Features.add("load", "1", {});
* ```
*
* @method add
* @param {String} cat The category, right now only 'load' is supported
* @param {String} name The number sequence of the test, how it's reported in the URL or config: 1, 2, 3
* @param {Object} o Object containing test properties
* @param {String} o.name The name of the test
* @param {Function} o.test The test function to execute, the only argument to the function is the `Y` instance
* @param {String} o.trigger The module that triggers this test.
*/
add: function(cat, name, o) {
feature_tests[cat] = feature_tests[cat] || {};
feature_tests[cat][name] = o;
},
/**
* Execute all tests of a given category and return the serialized results
*
* ```
* caps=1:1;2:1;3:0
* ```
* @method all
* @param {String} cat The category to execute
* @param {Array} args The arguments to pass to the test function
* @return {String} A semi-colon separated string of tests and their success/failure: 1:1;2:1;3:0
*/
all: function(cat, args) {
var cat_o = feature_tests[cat],
// results = {};
result = [];
if (cat_o) {
Y.Object.each(cat_o, function(v, k) {
result.push(k + ':' + (Y.Features.test(cat, k, args) ? 1 : 0));
});
}
return (result.length) ? result.join(';') : '';
},
/**
* Run a sepecific test and return a Boolean response.
*
* ```
* Y.Features.test("load", "1");
* ```
*
* @method test
* @param {String} cat The category of the test to run
* @param {String} name The name of the test to run
* @param {Array} args The arguments to pass to the test function
* @return {Boolean} True or false if the test passed/failed.
*/
test: function(cat, name, args) {
args = args || [];
var result, ua, test,
cat_o = feature_tests[cat],
feature = cat_o && cat_o[name];
if (!feature) {
Y.log('Feature test ' + cat + ', ' + name + ' not found');
} else {
result = feature.result;
if (Y.Lang.isUndefined(result)) {
ua = feature.ua;
if (ua) {
result = (Y.UA[ua]);
}
test = feature.test;
if (test && ((!ua) || result)) {
result = test.apply(Y, args);
}
feature.result = result;
}
}
return result;
}
});
// Y.Features.add("load", "1", {});
// Y.Features.test("load", "1");
// caps=1:1;2:0;3:1;
/* This file is auto-generated by src/loader/scripts/meta_join.py */
var add = Y.Features.add;
// io-nodejs
add('load', '0', {
"name": "io-nodejs",
"trigger": "io-base",
"ua": "nodejs"
});
// graphics-canvas-default
add('load', '1', {
"name": "graphics-canvas-default",
"test": function(Y) {
var DOCUMENT = Y.config.doc,
useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
},
"trigger": "graphics"
});
// autocomplete-list-keys
add('load', '2', {
"name": "autocomplete-list-keys",
"test": function (Y) {
// Only add keyboard support to autocomplete-list if this doesn't appear to
// be an iOS or Android-based mobile device.
//
// There's currently no feasible way to actually detect whether a device has
// a hardware keyboard, so this sniff will have to do. It can easily be
// overridden by manually loading the autocomplete-list-keys module.
//
// Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari
// doesn't fire the keyboard events used by AutoCompleteList, so there's
// no point loading the -keys module even when a bluetooth keyboard may be
// available.
return !(Y.UA.ios || Y.UA.android);
},
"trigger": "autocomplete-list"
});
// graphics-svg
add('load', '3', {
"name": "graphics-svg",
"test": function(Y) {
var DOCUMENT = Y.config.doc,
useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
return svg && (useSVG || !canvas);
},
"trigger": "graphics"
});
// editor-para-ie
add('load', '4', {
"name": "editor-para-ie",
"trigger": "editor-para",
"ua": "ie",
"when": "instead"
});
// graphics-vml-default
add('load', '5', {
"name": "graphics-vml-default",
"test": function(Y) {
var DOCUMENT = Y.config.doc,
canvas = DOCUMENT && DOCUMENT.createElement("canvas");
return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
},
"trigger": "graphics"
});
// graphics-svg-default
add('load', '6', {
"name": "graphics-svg-default",
"test": function(Y) {
var DOCUMENT = Y.config.doc,
useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
return svg && (useSVG || !canvas);
},
"trigger": "graphics"
});
// history-hash-ie
add('load', '7', {
"name": "history-hash-ie",
"test": function (Y) {
var docMode = Y.config.doc && Y.config.doc.documentMode;
return Y.UA.ie && (!('onhashchange' in Y.config.win) ||
!docMode || docMode < 8);
},
"trigger": "history-hash"
});
// transition-timer
add('load', '8', {
"name": "transition-timer",
"test": function (Y) {
var DOCUMENT = Y.config.doc,
node = (DOCUMENT) ? DOCUMENT.documentElement: null,
ret = true;
if (node && node.style) {
ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);
}
return ret;
},
"trigger": "transition"
});
// dom-style-ie
add('load', '9', {
"name": "dom-style-ie",
"test": function (Y) {
var testFeature = Y.Features.test,
addFeature = Y.Features.add,
WINDOW = Y.config.win,
DOCUMENT = Y.config.doc,
DOCUMENT_ELEMENT = 'documentElement',
ret = false;
addFeature('style', 'computedStyle', {
test: function() {
return WINDOW && 'getComputedStyle' in WINDOW;
}
});
addFeature('style', 'opacity', {
test: function() {
return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;
}
});
ret = (!testFeature('style', 'opacity') &&
!testFeature('style', 'computedStyle'));
return ret;
},
"trigger": "dom-style"
});
// selector-css2
add('load', '10', {
"name": "selector-css2",
"test": function (Y) {
var DOCUMENT = Y.config.doc,
ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);
return ret;
},
"trigger": "selector"
});
// widget-base-ie
add('load', '11', {
"name": "widget-base-ie",
"trigger": "widget-base",
"ua": "ie"
});
// event-base-ie
add('load', '12', {
"name": "event-base-ie",
"test": function(Y) {
var imp = Y.config.doc && Y.config.doc.implementation;
return (imp && (!imp.hasFeature('Events', '2.0')));
},
"trigger": "node-base"
});
// dd-gestures
add('load', '13', {
"name": "dd-gestures",
"test": function(Y) {
return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));
},
"trigger": "dd-drag"
});
// scrollview-base-ie
add('load', '14', {
"name": "scrollview-base-ie",
"trigger": "scrollview-base",
"ua": "ie"
});
// app-transitions-native
add('load', '15', {
"name": "app-transitions-native",
"test": function (Y) {
var doc = Y.config.doc,
node = doc ? doc.documentElement : null;
if (node && node.style) {
return ('MozTransition' in node.style || 'WebkitTransition' in node.style);
}
return false;
},
"trigger": "app-transitions"
});
// graphics-canvas
add('load', '16', {
"name": "graphics-canvas",
"test": function(Y) {
var DOCUMENT = Y.config.doc,
useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
},
"trigger": "graphics"
});
// graphics-vml
add('load', '17', {
"name": "graphics-vml",
"test": function(Y) {
var DOCUMENT = Y.config.doc,
canvas = DOCUMENT && DOCUMENT.createElement("canvas");
return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
},
"trigger": "graphics"
});
}, '@VERSION@' ,{requires:['yui-base']});
YUI.add('intl-base', function(Y) {
/**
* The Intl utility provides a central location for managing sets of
* localized resources (strings and formatting patterns).
*
* @class Intl
* @uses EventTarget
* @static
*/
var SPLIT_REGEX = /[, ]/;
Y.mix(Y.namespace('Intl'), {
/**
* Returns the language among those available that
* best matches the preferred language list, using the Lookup
* algorithm of BCP 47.
* If none of the available languages meets the user's preferences,
* then "" is returned.
* Extended language ranges are not supported.
*
* @method lookupBestLang
* @param {String[] | String} preferredLanguages The list of preferred
* languages in descending preference order, represented as BCP 47
* language tags. A string array or a comma-separated list.
* @param {String[]} availableLanguages The list of languages
* that the application supports, represented as BCP 47 language
* tags.
*
* @return {String} The available language that best matches the
* preferred language list, or "".
* @since 3.1.0
*/
lookupBestLang: function(preferredLanguages, availableLanguages) {
var i, language, result, index;
// check whether the list of available languages contains language;
// if so return it
function scan(language) {
var i;
for (i = 0; i < availableLanguages.length; i += 1) {
if (language.toLowerCase() ===
availableLanguages[i].toLowerCase()) {
return availableLanguages[i];
}
}
}
if (Y.Lang.isString(preferredLanguages)) {
preferredLanguages = preferredLanguages.split(SPLIT_REGEX);
}
for (i = 0; i < preferredLanguages.length; i += 1) {
language = preferredLanguages[i];
if (!language || language === '*') {
continue;
}
// check the fallback sequence for one language
while (language.length > 0) {
result = scan(language);
if (result) {
return result;
} else {
index = language.lastIndexOf('-');
if (index >= 0) {
language = language.substring(0, index);
// one-character subtags get cut along with the
// following subtag
if (index >= 2 && language.charAt(index - 2) === '-') {
language = language.substring(0, index - 2);
}
} else {
// nothing available for this language
break;
}
}
}
}
return '';
}
});
}, '@VERSION@' ,{requires:['yui-base']});
YUI.add('yui-log', function(Y) {
/**
* Provides console log capability and exposes a custom event for
* console implementations. This module is a `core` YUI module, <a href="../classes/YUI.html#method_log">it's documentation is located under the YUI class</a>.
*
* @module yui
* @submodule yui-log
*/
var INSTANCE = Y,
LOGEVENT = 'yui:log',
UNDEFINED = 'undefined',
LEVELS = { debug: 1,
info: 1,
warn: 1,
error: 1 };
/**
* If the 'debug' config is true, a 'yui:log' event will be
* dispatched, which the Console widget and anything else
* can consume. If the 'useBrowserConsole' config is true, it will
* write to the browser console if available. YUI-specific log
* messages will only be present in the -debug versions of the
* JS files. The build system is supposed to remove log statements
* from the raw and minified versions of the files.
*
* @method log
* @for YUI
* @param {String} msg The message to log.
* @param {String} cat The log category for the message. Default
* categories are "info", "warn", "error", time".
* Custom categories can be used as well. (opt).
* @param {String} src The source of the the message (opt).
* @param {boolean} silent If true, the log event won't fire.
* @return {YUI} YUI instance.
*/
INSTANCE.log = function(msg, cat, src, silent) {
var bail, excl, incl, m, f,
Y = INSTANCE,
c = Y.config,
publisher = (Y.fire) ? Y : YUI.Env.globalEvents;
// suppress log message if the config is off or the event stack
// or the event call stack contains a consumer of the yui:log event
if (c.debug) {
// apply source filters
if (src) {
excl = c.logExclude;
incl = c.logInclude;
if (incl && !(src in incl)) {
bail = 1;
} else if (incl && (src in incl)) {
bail = !incl[src];
} else if (excl && (src in excl)) {
bail = excl[src];
}
}
if (!bail) {
if (c.useBrowserConsole) {
m = (src) ? src + ': ' + msg : msg;
if (Y.Lang.isFunction(c.logFn)) {
c.logFn.call(Y, msg, cat, src);
} else if (typeof console != UNDEFINED && console.log) {
f = (cat && console[cat] && (cat in LEVELS)) ? cat : 'log';
console[f](m);
} else if (typeof opera != UNDEFINED) {
opera.postError(m);
}
}
if (publisher && !silent) {
if (publisher == Y && (!publisher.getEvent(LOGEVENT))) {
publisher.publish(LOGEVENT, {
broadcast: 2
});
}
publisher.fire(LOGEVENT, {
msg: msg,
cat: cat,
src: src
});
}
}
}
return Y;
};
/**
* Write a system message. This message will be preserved in the
* minified and raw versions of the YUI files, unlike log statements.
* @method message
* @for YUI
* @param {String} msg The message to log.
* @param {String} cat The log category for the message. Default
* categories are "info", "warn", "error", time".
* Custom categories can be used as well. (opt).
* @param {String} src The source of the the message (opt).
* @param {boolean} silent If true, the log event won't fire.
* @return {YUI} YUI instance.
*/
INSTANCE.message = function() {
return INSTANCE.log.apply(INSTANCE, arguments);
};
}, '@VERSION@' ,{requires:['yui-base']});
YUI.add('yui-log-nodejs', function(Y) {
var sys = require(process.binding('natives').util ? 'util' : 'sys'),
hasColor = false;
try {
var stdio = require("stdio");
hasColor = stdio.isStderrATTY();
} catch (ex) {
hasColor = true;
}
Y.config.useColor = hasColor;
Y.consoleColor = function(str, num) {
if (!this.config.useColor) {
return str;
}
if (!num) {
num = '32';
}
return "\033[" + num +"m" + str + "\033[0m"
};
var logFn = function(str, t, m) {
var id = '';
if (this.id) {
id = '[' + this.id + ']:';
}
t = t || 'info';
m = (m) ? this.consoleColor(' (' + m.toLowerCase() + '):', 35) : '';
if (str === null) {
str = 'null';
}
if ((typeof str === 'object') || str instanceof Array) {
try {
//Should we use this?
if (str.tagName || str._yuid || str._query) {
str = str.toString();
} else {
str = sys.inspect(str);
}
} catch (e) {
//Fail catcher
}
}
var lvl = '37;40', mLvl = ((str) ? '' : 31);
t = t+''; //Force to a string..
switch (t.toLowerCase()) {
case 'error':
lvl = mLvl = 31;
break;
case 'warn':
lvl = 33;
break;
case 'debug':
lvl = 34;
break;
}
if (typeof str === 'string') {
if (str && str.indexOf("\n") !== -1) {
str = "\n" + str;
}
}
// output log messages to stderr
sys.error(this.consoleColor(t.toLowerCase() + ':', lvl) + m + ' ' + this.consoleColor(str, mLvl));
};
if (!Y.config.logFn) {
Y.config.logFn = logFn;
}
}, '@VERSION@' ,{requires:['yui-log']});
YUI.add('yui-later', function(Y) {
/**
* Provides a setTimeout/setInterval wrapper. This module is a `core` YUI module, <a href="../classes/YUI.html#method_later">it's documentation is located under the YUI class</a>.
*
* @module yui
* @submodule yui-later
*/
var NO_ARGS = [];
/**
* Executes the supplied function in the context of the supplied
* object 'when' milliseconds later. Executes the function a
* single time unless periodic is set to true.
* @for YUI
* @method later
* @param when {int} the number of milliseconds to wait until the fn
* is executed.
* @param o the context object.
* @param fn {Function|String} the function to execute or the name of
* the method in the 'o' object to execute.
* @param data [Array] data that is provided to the function. This
* accepts either a single item or an array. If an array is provided,
* the function is executed with one parameter for each array item.
* If you need to pass a single array parameter, it needs to be wrapped
* in an array [myarray].
*
* Note: native methods in IE may not have the call and apply methods.
* In this case, it will work, but you are limited to four arguments.
*
* @param periodic {boolean} if true, executes continuously at supplied
* interval until canceled.
* @return {object} a timer object. Call the cancel() method on this
* object to stop the timer.
*/
Y.later = function(when, o, fn, data, periodic) {
when = when || 0;
data = (!Y.Lang.isUndefined(data)) ? Y.Array(data) : NO_ARGS;
o = o || Y.config.win || Y;
var cancelled = false,
method = (o && Y.Lang.isString(fn)) ? o[fn] : fn,
wrapper = function() {
// IE 8- may execute a setInterval callback one last time
// after clearInterval was called, so in order to preserve
// the cancel() === no more runny-run, we have to jump through
// an extra hoop.
if (!cancelled) {
if (!method.apply) {
method(data[0], data[1], data[2], data[3]);
} else {
method.apply(o, data || NO_ARGS);
}
}
},
id = (periodic) ? setInterval(wrapper, when) : setTimeout(wrapper, when);
return {
id: id,
interval: periodic,
cancel: function() {
cancelled = true;
if (this.interval) {
clearInterval(id);
} else {
clearTimeout(id);
}
}
};
};
Y.Lang.later = Y.later;
}, '@VERSION@' ,{requires:['yui-base']});
YUI.add('loader-base', function(Y) {
/**
* The YUI loader core
* @module loader
* @submodule loader-base
*/
if (!YUI.Env[Y.version]) {
(function() {
var VERSION = Y.version,
BUILD = '/build/',
ROOT = VERSION + BUILD,
CDN_BASE = Y.Env.base,
GALLERY_VERSION = '${loader.gallery}',
TNT = '2in3',
TNT_VERSION = '${loader.tnt}',
YUI2_VERSION = '${loader.yui2}',
COMBO_BASE = CDN_BASE + 'combo?',
META = { version: VERSION,
root: ROOT,
base: Y.Env.base,
comboBase: COMBO_BASE,
skin: { defaultSkin: 'sam',
base: 'assets/skins/',
path: 'skin.css',
after: ['cssreset',
'cssfonts',
'cssgrids',
'cssbase',
'cssreset-context',
'cssfonts-context']},
groups: {},
patterns: {} },
groups = META.groups,
yui2Update = function(tnt, yui2, config) {
var root = TNT + '.' +
(tnt || TNT_VERSION) + '/' +
(yui2 || YUI2_VERSION) + BUILD,
base = (config && config.base) ? config.base : CDN_BASE,
combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;
groups.yui2.base = base + root;
groups.yui2.root = root;
groups.yui2.comboBase = combo;
},
galleryUpdate = function(tag, config) {
var root = (tag || GALLERY_VERSION) + BUILD,
base = (config && config.base) ? config.base : CDN_BASE,
combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;
groups.gallery.base = base + root;
groups.gallery.root = root;
groups.gallery.comboBase = combo;
};
groups[VERSION] = {};
groups.gallery = {
ext: false,
combine: true,
comboBase: COMBO_BASE,
update: galleryUpdate,
patterns: { 'gallery-': { },
'lang/gallery-': {},
'gallerycss-': { type: 'css' } }
};
groups.yui2 = {
combine: true,
ext: false,
comboBase: COMBO_BASE,
update: yui2Update,
patterns: {
'yui2-': {
configFn: function(me) {
if (/-skin|reset|fonts|grids|base/.test(me.name)) {
me.type = 'css';
me.path = me.path.replace(/\.js/, '.css');
// this makes skins in builds earlier than
// 2.6.0 work as long as combine is false
me.path = me.path.replace(/\/yui2-skin/,
'/assets/skins/sam/yui2-skin');
}
}
}
}
};
galleryUpdate();
yui2Update();
YUI.Env[VERSION] = META;
}());
}
/**
* Loader dynamically loads script and css files. It includes the dependency
* information for the version of the library in use, and will automatically pull in
* dependencies for the modules requested. It can also load the
* files from the Yahoo! CDN, and it can utilize the combo service provided on
* this network to reduce the number of http connections required to download
* YUI files.
*
* @module loader
* @main loader
* @submodule loader-base
*/
var NOT_FOUND = {},
NO_REQUIREMENTS = [],
MAX_URL_LENGTH = 1024,
GLOBAL_ENV = YUI.Env,
GLOBAL_LOADED = GLOBAL_ENV._loaded,
CSS = 'css',
JS = 'js',
INTL = 'intl',
VERSION = Y.version,
ROOT_LANG = '',
YObject = Y.Object,
oeach = YObject.each,
YArray = Y.Array,
_queue = GLOBAL_ENV._loaderQueue,
META = GLOBAL_ENV[VERSION],
SKIN_PREFIX = 'skin-',
L = Y.Lang,
ON_PAGE = GLOBAL_ENV.mods,
modulekey,
cache,
_path = function(dir, file, type, nomin) {
var path = dir + '/' + file;
if (!nomin) {
path += '-min';
}
path += '.' + (type || CSS);
return path;
};
/**
* The component metadata is stored in Y.Env.meta.
* Part of the loader module.
* @property meta
* @for YUI
*/
Y.Env.meta = META;
/**
* Loader dynamically loads script and css files. It includes the dependency
* info for the version of the library in use, and will automatically pull in
* dependencies for the modules requested. It can load the
* files from the Yahoo! CDN, and it can utilize the combo service provided on
* this network to reduce the number of http connections required to download
* YUI files. You can also specify an external, custom combo service to host
* your modules as well.
var Y = YUI();
var loader = new Y.Loader({
filter: 'debug',
base: '../../',
root: 'build/',
combine: true,
require: ['node', 'dd', 'console']
});
var out = loader.resolve(true);
* @constructor
* @class Loader
* @param {Object} config an optional set of configuration options.
* @param {String} config.base The base dir which to fetch this module from
* @param {String} config.comboBase The Combo service base path. Ex: `http://yui.yahooapis.com/combo?`
* @param {String} config.root The root path to prepend to module names for the combo service. Ex: `2.5.2/build/`
* @param {String|Object} config.filter A filter to apply to result urls. <a href="#property_filter">See filter property</a>
* @param {Object} config.filters Per-component filter specification. If specified for a given component, this overrides the filter config.
* @param {Boolean} config.combine Use a combo service to reduce the number of http connections required to load your dependencies
* @param {Array} config.ignore: A list of modules that should never be dynamically loaded
* @param {Array} config.force A list of modules that should always be loaded when required, even if already present on the page
* @param {HTMLElement|String} config.insertBefore Node or id for a node that should be used as the insertion point for new nodes
* @param {Object} config.jsAttributes Object literal containing attributes to add to script nodes
* @param {Object} config.cssAttributes Object literal containing attributes to add to link nodes
* @param {Number} config.timeout The number of milliseconds before a timeout occurs when dynamically loading nodes. If not set, there is no timeout
* @param {Object} config.context Execution context for all callbacks
* @param {Function} config.onSuccess Callback for the 'success' event
* @param {Function} config.onFailure Callback for the 'failure' event
* @param {Function} config.onCSS Callback for the 'CSSComplete' event. When loading YUI components with CSS the CSS is loaded first, then the script. This provides a moment you can tie into to improve the presentation of the page while the script is loading.
* @param {Function} config.onTimeout Callback for the 'timeout' event
* @param {Function} config.onProgress Callback executed each time a script or css file is loaded
* @param {Object} config.modules A list of module definitions. See <a href="#method_addModule">Loader.addModule</a> for the supported module metadata
* @param {Object} config.groups A list of group definitions. Each group can contain specific definitions for `base`, `comboBase`, `combine`, and accepts a list of `modules`.
* @param {String} config.2in3 The version of the YUI 2 in 3 wrapper to use. The intrinsic support for YUI 2 modules in YUI 3 relies on versions of the YUI 2 components inside YUI 3 module wrappers. These wrappers change over time to accomodate the issues that arise from running YUI 2 in a YUI 3 sandbox.
* @param {String} config.yui2 When using the 2in3 project, you can select the version of YUI 2 to use. Valid values are `2.2.2`, `2.3.1`, `2.4.1`, `2.5.2`, `2.6.0`, `2.7.0`, `2.8.0`, `2.8.1` and `2.9.0` [default] -- plus all versions of YUI 2 going forward.
*/
Y.Loader = function(o) {
var defaults = META.modules,
self = this;
//Catch no config passed.
o = o || {};
modulekey = META.md5;
/**
* Internal callback to handle multiple internal insert() calls
* so that css is inserted prior to js
* @property _internalCallback
* @private
*/
// self._internalCallback = null;
/**
* Callback that will be executed when the loader is finished
* with an insert
* @method onSuccess
* @type function
*/
// self.onSuccess = null;
/**
* Callback that will be executed if there is a failure
* @method onFailure
* @type function
*/
// self.onFailure = null;
/**
* Callback for the 'CSSComplete' event. When loading YUI components
* with CSS the CSS is loaded first, then the script. This provides
* a moment you can tie into to improve the presentation of the page
* while the script is loading.
* @method onCSS
* @type function
*/
// self.onCSS = null;
/**
* Callback executed each time a script or css file is loaded
* @method onProgress
* @type function
*/
// self.onProgress = null;
/**
* Callback that will be executed if a timeout occurs
* @method onTimeout
* @type function
*/
// self.onTimeout = null;
/**
* The execution context for all callbacks
* @property context
* @default {YUI} the YUI instance
*/
self.context = Y;
/**
* Data that is passed to all callbacks
* @property data
*/
// self.data = null;
/**
* Node reference or id where new nodes should be inserted before
* @property insertBefore
* @type string|HTMLElement
*/
// self.insertBefore = null;
/**
* The charset attribute for inserted nodes
* @property charset
* @type string
* @deprecated , use cssAttributes or jsAttributes.
*/
// self.charset = null;
/**
* An object literal containing attributes to add to link nodes
* @property cssAttributes
* @type object
*/
// self.cssAttributes = null;
/**
* An object literal containing attributes to add to script nodes
* @property jsAttributes
* @type object
*/
// self.jsAttributes = null;
/**
* The base directory.
* @property base
* @type string
* @default http://yui.yahooapis.com/[YUI VERSION]/build/
*/
self.base = Y.Env.meta.base + Y.Env.meta.root;
/**
* Base path for the combo service
* @property comboBase
* @type string
* @default http://yui.yahooapis.com/combo?
*/
self.comboBase = Y.Env.meta.comboBase;
/*
* Base path for language packs.
*/
// self.langBase = Y.Env.meta.langBase;
// self.lang = "";
/**
* If configured, the loader will attempt to use the combo
* service for YUI resources and configured external resources.
* @property combine
* @type boolean
* @default true if a base dir isn't in the config
*/
self.combine = o.base &&
(o.base.indexOf(self.comboBase.substr(0, 20)) > -1);
/**
* The default seperator to use between files in a combo URL
* @property comboSep
* @type {String}
* @default Ampersand
*/
self.comboSep = '&';
/**
* Max url length for combo urls. The default is 2048. This is the URL
* limit for the Yahoo! hosted combo servers. If consuming
* a different combo service that has a different URL limit
* it is possible to override this default by supplying
* the maxURLLength config option. The config option will
* only take effect if lower than the default.
*
* @property maxURLLength
* @type int
*/
self.maxURLLength = MAX_URL_LENGTH;
/**
* Ignore modules registered on the YUI global
* @property ignoreRegistered
* @default false
*/
//self.ignoreRegistered = false;
/**
* Root path to prepend to module path for the combo
* service
* @property root
* @type string
* @default [YUI VERSION]/build/
*/
self.root = Y.Env.meta.root;
/**
* Timeout value in milliseconds. If set, self value will be used by
* the get utility. the timeout event will fire if
* a timeout occurs.
* @property timeout
* @type int
*/
self.timeout = 0;
/**
* A list of modules that should not be loaded, even if
* they turn up in the dependency tree
* @property ignore
* @type string[]
*/
// self.ignore = null;
/**
* A list of modules that should always be loaded, even
* if they have already been inserted into the page.
* @property force
* @type string[]
*/
// self.force = null;
self.forceMap = {};
/**
* Should we allow rollups
* @property allowRollup
* @type boolean
* @default false
*/
self.allowRollup = false;
/**
* A filter to apply to result urls. This filter will modify the default
* path for all modules. The default path for the YUI library is the
* minified version of the files (e.g., event-min.js). The filter property
* can be a predefined filter or a custom filter. The valid predefined
* filters are:
* <dl>
* <dt>DEBUG</dt>
* <dd>Selects the debug versions of the library (e.g., event-debug.js).
* This option will automatically include the Logger widget</dd>
* <dt>RAW</dt>
* <dd>Selects the non-minified version of the library (e.g., event.js).
* </dd>
* </dl>
* You can also define a custom filter, which must be an object literal
* containing a search expression and a replace string:
*
* myFilter: {
* 'searchExp': "-min\\.js",
* 'replaceStr': "-debug.js"
* }
*
* @property filter
* @type string| {searchExp: string, replaceStr: string}
*/
// self.filter = null;
/**
* per-component filter specification. If specified for a given
* component, this overrides the filter config.
* @property filters
* @type object
*/
self.filters = {};
/**
* The list of requested modules
* @property required
* @type {string: boolean}
*/
self.required = {};
/**
* If a module name is predefined when requested, it is checked againsts
* the patterns provided in this property. If there is a match, the
* module is added with the default configuration.
*
* At the moment only supporting module prefixes, but anticipate
* supporting at least regular expressions.
* @property patterns
* @type Object
*/
// self.patterns = Y.merge(Y.Env.meta.patterns);
self.patterns = {};
/**
* The library metadata
* @property moduleInfo
*/
// self.moduleInfo = Y.merge(Y.Env.meta.moduleInfo);
self.moduleInfo = {};
self.groups = Y.merge(Y.Env.meta.groups);
/**
* Provides the information used to skin the skinnable components.
* The following skin definition would result in 'skin1' and 'skin2'
* being loaded for calendar (if calendar was requested), and
* 'sam' for all other skinnable components:
*
* skin: {
* // The default skin, which is automatically applied if not
* // overriden by a component-specific skin definition.
* // Change this in to apply a different skin globally
* defaultSkin: 'sam',
*
* // This is combined with the loader base property to get
* // the default root directory for a skin. ex:
* // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/
* base: 'assets/skins/',
*
* // Any component-specific overrides can be specified here,
* // making it possible to load different skins for different
* // components. It is possible to load more than one skin
* // for a given component as well.
* overrides: {
* calendar: ['skin1', 'skin2']
* }
* }
* @property skin
* @type {Object}
*/
self.skin = Y.merge(Y.Env.meta.skin);
/*
* Map of conditional modules
* @since 3.2.0
*/
self.conditions = {};
// map of modules with a hash of modules that meet the requirement
// self.provides = {};
self.config = o;
self._internal = true;
cache = GLOBAL_ENV._renderedMods;
if (cache) {
oeach(cache, function modCache(v, k) {
self.moduleInfo[k] = Y.merge(v);
});
cache = GLOBAL_ENV._conditions;
oeach(cache, function condCache(v, k) {
self.conditions[k] = Y.merge(v);
});
} else {
oeach(defaults, self.addModule, self);
}
/**
* Set when beginning to compute the dependency tree.
* Composed of what YUI reports to be loaded combined
* with what has been loaded by any instance on the page
* with the version number specified in the metadata.
* @property loaded
* @type {string: boolean}
*/
self.loaded = GLOBAL_LOADED[VERSION];
self._inspectPage();
self._internal = false;
self._config(o);
self.forceMap = (self.force) ? Y.Array.hash(self.force) : {};
self.testresults = null;
if (Y.config.tests) {
self.testresults = Y.config.tests;
}
/**
* List of rollup files found in the library metadata
* @property rollups
*/
// self.rollups = null;
/**
* Whether or not to load optional dependencies for
* the requested modules
* @property loadOptional
* @type boolean
* @default false
*/
// self.loadOptional = false;
/**
* All of the derived dependencies in sorted order, which
* will be populated when either calculate() or insert()
* is called
* @property sorted
* @type string[]
*/
self.sorted = [];
/*
* A list of modules to attach to the YUI instance when complete.
* If not supplied, the sorted list of dependencies are applied.
* @property attaching
*/
// self.attaching = null;
/**
* Flag to indicate the dependency tree needs to be recomputed
* if insert is called again.
* @property dirty
* @type boolean
* @default true
*/
self.dirty = true;
/**
* List of modules inserted by the utility
* @property inserted
* @type {string: boolean}
*/
self.inserted = {};
/**
* List of skipped modules during insert() because the module
* was not defined
* @property skipped
*/
self.skipped = {};
// Y.on('yui:load', self.loadNext, self);
self.tested = {};
/*
* Cached sorted calculate results
* @property results
* @since 3.2.0
*/
//self.results = {};
};
Y.Loader.prototype = {
/**
Regex that matches a CSS URL. Used to guess the file type when it's not
specified.
@property REGEX_CSS
@type RegExp
@final
@protected
@since 3.5.0
**/
REGEX_CSS: /\.css(?:[?;].*)?$/i,
/**
* Default filters for raw and debug
* @property FILTER_DEFS
* @type Object
* @final
* @protected
*/
FILTER_DEFS: {
RAW: {
'searchExp': '-min\\.js',
'replaceStr': '.js'
},
DEBUG: {
'searchExp': '-min\\.js',
'replaceStr': '-debug.js'
}
},
/*
* Check the pages meta-data and cache the result.
* @method _inspectPage
* @private
*/
_inspectPage: function() {
//Inspect the page for CSS only modules and mark them as loaded.
oeach(this.moduleInfo, function(v, k) {
if (v.type && v.type === CSS) {
if (this.isCSSLoaded(v.name)) {
Y.log('Found CSS module on page: ' + v.name, 'info', 'loader');
this.loaded[k] = true;
}
}
}, this);
oeach(ON_PAGE, function(v, k) {
if (v.details) {
var m = this.moduleInfo[k],
req = v.details.requires,
mr = m && m.requires;
if (m) {
if (!m._inspected && req && mr.length != req.length) {
// console.log('deleting ' + m.name);
delete m.expanded;
}
} else {
m = this.addModule(v.details, k);
}
m._inspected = true;
}
}, this);
},
/*
* returns true if b is not loaded, and is required directly or by means of modules it supersedes.
* @private
* @method _requires
* @param {String} mod1 The first module to compare
* @param {String} mod2 The second module to compare
*/
_requires: function(mod1, mod2) {
var i, rm, after_map, s,
info = this.moduleInfo,
m = info[mod1],
other = info[mod2];
if (!m || !other) {
return false;
}
rm = m.expanded_map;
after_map = m.after_map;
// check if this module should be sorted after the other
// do this first to short circut circular deps
if (after_map && (mod2 in after_map)) {
return true;
}
after_map = other.after_map;
// and vis-versa
if (after_map && (mod1 in after_map)) {
return false;
}
// check if this module requires one the other supersedes
s = info[mod2] && info[mod2].supersedes;
if (s) {
for (i = 0; i < s.length; i++) {
if (this._requires(mod1, s[i])) {
return true;
}
}
}
s = info[mod1] && info[mod1].supersedes;
if (s) {
for (i = 0; i < s.length; i++) {
if (this._requires(mod2, s[i])) {
return false;
}
}
}
// check if this module requires the other directly
// if (r && YArray.indexOf(r, mod2) > -1) {
if (rm && (mod2 in rm)) {
return true;
}
// external css files should be sorted below yui css
if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {
return true;
}
return false;
},
/**
* Apply a new config to the Loader instance
* @method _config
* @private
* @param {Object} o The new configuration
*/
_config: function(o) {
var i, j, val, f, group, groupName, self = this;
// apply config values
if (o) {
for (i in o) {
if (o.hasOwnProperty(i)) {
val = o[i];
if (i == 'require') {
self.require(val);
} else if (i == 'skin') {
//If the config.skin is a string, format to the expected object
if (typeof val === 'string') {
self.skin.defaultSkin = o.skin;
val = {
defaultSkin: val
};
}
Y.mix(self.skin, val, true);
} else if (i == 'groups') {
for (j in val) {
if (val.hasOwnProperty(j)) {
// Y.log('group: ' + j);
groupName = j;
group = val[j];
self.addGroup(group, groupName);
if (group.aliases) {
oeach(group.aliases, self.addAlias, self);
}
}
}
} else if (i == 'modules') {
// add a hash of module definitions
oeach(val, self.addModule, self);
} else if (i === 'aliases') {
oeach(val, self.addAlias, self);
} else if (i == 'gallery') {
this.groups.gallery.update(val, o);
} else if (i == 'yui2' || i == '2in3') {
this.groups.yui2.update(o['2in3'], o.yui2, o);
} else {
self[i] = val;
}
}
}
}
// fix filter
f = self.filter;
if (L.isString(f)) {
f = f.toUpperCase();
self.filterName = f;
self.filter = self.FILTER_DEFS[f];
if (f == 'DEBUG') {
self.require('yui-log', 'dump');
}
}
if (self.lang) {
//Removed this so that when Loader is invoked
//it doesn't request what it doesn't need.
//self.require('intl-base', 'intl');
}
},
/**
* Returns the skin module name for the specified skin name. If a
* module name is supplied, the returned skin module name is
* specific to the module passed in.
* @method formatSkin
* @param {string} skin the name of the skin.
* @param {string} mod optional: the name of a module to skin.
* @return {string} the full skin module name.
*/
formatSkin: function(skin, mod) {
var s = SKIN_PREFIX + skin;
if (mod) {
s = s + '-' + mod;
}
return s;
},
/**
* Adds the skin def to the module info
* @method _addSkin
* @param {string} skin the name of the skin.
* @param {string} mod the name of the module.
* @param {string} parent parent module if this is a skin of a
* submodule or plugin.
* @return {string} the module name for the skin.
* @private
*/
_addSkin: function(skin, mod, parent) {
var mdef, pkg, name, nmod,
info = this.moduleInfo,
sinf = this.skin,
ext = info[mod] && info[mod].ext;
// Add a module definition for the module-specific skin css
if (mod) {
name = this.formatSkin(skin, mod);
if (!info[name]) {
mdef = info[mod];
pkg = mdef.pkg || mod;
nmod = {
name: name,
group: mdef.group,
type: 'css',
after: sinf.after,
path: (parent || pkg) + '/' + sinf.base + skin +
'/' + mod + '.css',
ext: ext
};
if (mdef.base) {
nmod.base = mdef.base;
}
if (mdef.configFn) {
nmod.configFn = mdef.configFn;
}
this.addModule(nmod, name);
Y.log('Adding skin (' + name + '), ' + parent + ', ' + pkg + ', ' + info[name].path, 'info', 'loader');
}
}
return name;
},
/**
* Adds an alias module to the system
* @method addAlias
* @param {Array} use An array of modules that makes up this alias
* @param {String} name The name of the alias
* @example
* var loader = new Y.Loader({});
* loader.addAlias([ 'node', 'yql' ], 'davglass');
* loader.require(['davglass']);
* var out = loader.resolve(true);
*
* //out.js will contain Node and YQL modules
*/
addAlias: function(use, name) {
YUI.Env.aliases[name] = use;
this.addModule({
name: name,
use: use
});
},
/**
* Add a new module group
* @method addGroup
* @param {Object} config An object containing the group configuration data
* @param {String} config.name required, the group name
* @param {String} config.base The base directory for this module group
* @param {String} config.root The root path to add to each combo resource path
* @param {Boolean} config.combine Should the request be combined
* @param {String} config.comboBase Combo service base path
* @param {Object} config.modules The group of modules
* @param {String} name the group name.
* @example
* var loader = new Y.Loader({});
* loader.addGroup({
* name: 'davglass',
* combine: true,
* comboBase: '/combo?',
* root: '',
* modules: {
* //Module List here
* }
* }, 'davglass');
*/
addGroup: function(o, name) {
var mods = o.modules,
self = this;
name = name || o.name;
o.name = name;
self.groups[name] = o;
if (o.patterns) {
oeach(o.patterns, function(v, k) {
v.group = name;
self.patterns[k] = v;
});
}
if (mods) {
oeach(mods, function(v, k) {
if (typeof v === 'string') {
v = { name: k, fullpath: v };
}
v.group = name;
self.addModule(v, k);
}, self);
}
},
/**
* Add a new module to the component metadata.
* @method addModule
* @param {Object} config An object containing the module data.
* @param {String} config.name Required, the component name
* @param {String} config.type Required, the component type (js or css)
* @param {String} config.path Required, the path to the script from `base`
* @param {Array} config.requires Array of modules required by this component
* @param {Array} [config.optional] Array of optional modules for this component
* @param {Array} [config.supersedes] Array of the modules this component replaces
* @param {Array} [config.after] Array of modules the components which, if present, should be sorted above this one
* @param {Object} [config.after_map] Faster alternative to 'after' -- supply a hash instead of an array
* @param {Number} [config.rollup] The number of superseded modules required for automatic rollup
* @param {String} [config.fullpath] If `fullpath` is specified, this is used instead of the configured `base + path`
* @param {Boolean} [config.skinnable] Flag to determine if skin assets should automatically be pulled in
* @param {Object} [config.submodules] Hash of submodules
* @param {String} [config.group] The group the module belongs to -- this is set automatically when it is added as part of a group configuration.
* @param {Array} [config.lang] Array of BCP 47 language tags of languages for which this module has localized resource bundles, e.g., `["en-GB", "zh-Hans-CN"]`
* @param {Object} [config.condition] Specifies that the module should be loaded automatically if a condition is met. This is an object with up to three fields:
* @param {String} [config.condition.trigger] The name of a module that can trigger the auto-load
* @param {Function} [config.condition.test] A function that returns true when the module is to be loaded.
* @param {String} [config.condition.when] Specifies the load order of the conditional module
* with regard to the position of the trigger module.
* This should be one of three values: `before`, `after`, or `instead`. The default is `after`.
* @param {Object} [config.testresults] A hash of test results from `Y.Features.all()`
* @param {Function} [config.configFn] A function to exectute when configuring this module
* @param {Object} config.configFn.mod The module config, modifying this object will modify it's config. Returning false will delete the module's config.
* @param {String} [name] The module name, required if not in the module data.
* @return {Object} the module definition or null if the object passed in did not provide all required attributes.
*/
addModule: function(o, name) {
name = name || o.name;
if (typeof o === 'string') {
o = { name: name, fullpath: o };
}
//Only merge this data if the temp flag is set
//from an earlier pass from a pattern or else
//an override module (YUI_config) can not be used to
//replace a default module.
if (this.moduleInfo[name] && this.moduleInfo[name].temp) {
//This catches temp modules loaded via a pattern
// The module will be added twice, once from the pattern and
// Once from the actual add call, this ensures that properties
// that were added to the module the first time around (group: gallery)
// are also added the second time around too.
o = Y.merge(this.moduleInfo[name], o);
}
o.name = name;
if (!o || !o.name) {
return null;
}
if (!o.type) {
//Always assume it's javascript unless the CSS pattern is matched.
o.type = JS;
var p = o.path || o.fullpath;
if (p && this.REGEX_CSS.test(p)) {
Y.log('Auto determined module type as CSS', 'warn', 'loader');
o.type = CSS;
}
}
if (!o.path && !o.fullpath) {
o.path = _path(name, name, o.type);
}
o.supersedes = o.supersedes || o.use;
o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true;
// Handle submodule logic
var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,
j, langs, packName, supName, flatSup, flatLang, lang, ret,
overrides, skinname, when,
conditions = this.conditions, trigger;
// , existing = this.moduleInfo[name], newr;
this.moduleInfo[name] = o;
o.requires = o.requires || [];
if (o.skinnable) {
skinname = this._addSkin(this.skin.defaultSkin, name);
o.requires.unshift(skinname);
}
o.requires = this.filterRequires(o.requires) || [];
if (!o.langPack && o.lang) {
langs = YArray(o.lang);
for (j = 0; j < langs.length; j++) {
lang = langs[j];
packName = this.getLangPackName(lang, name);
smod = this.moduleInfo[packName];
if (!smod) {
smod = this._addLangPack(lang, o, packName);
}
}
}
if (subs) {
sup = o.supersedes || [];
l = 0;
for (i in subs) {
if (subs.hasOwnProperty(i)) {
s = subs[i];
s.path = s.path || _path(name, i, o.type);
s.pkg = name;
s.group = o.group;
if (s.supersedes) {
sup = sup.concat(s.supersedes);
}
smod = this.addModule(s, i);
sup.push(i);
if (smod.skinnable) {
o.skinnable = true;
overrides = this.skin.overrides;
if (overrides && overrides[i]) {
for (j = 0; j < overrides[i].length; j++) {
skinname = this._addSkin(overrides[i][j],
i, name);
sup.push(skinname);
}
}
skinname = this._addSkin(this.skin.defaultSkin,
i, name);
sup.push(skinname);
}
// looks like we are expected to work out the metadata
// for the parent module language packs from what is
// specified in the child modules.
if (s.lang && s.lang.length) {
langs = YArray(s.lang);
for (j = 0; j < langs.length; j++) {
lang = langs[j];
packName = this.getLangPackName(lang, name);
supName = this.getLangPackName(lang, i);
smod = this.moduleInfo[packName];
if (!smod) {
smod = this._addLangPack(lang, o, packName);
}
flatSup = flatSup || YArray.hash(smod.supersedes);
if (!(supName in flatSup)) {
smod.supersedes.push(supName);
}
o.lang = o.lang || [];
flatLang = flatLang || YArray.hash(o.lang);
if (!(lang in flatLang)) {
o.lang.push(lang);
}
// Y.log('pack ' + packName + ' should supersede ' + supName);
// Add rollup file, need to add to supersedes list too
// default packages
packName = this.getLangPackName(ROOT_LANG, name);
supName = this.getLangPackName(ROOT_LANG, i);
smod = this.moduleInfo[packName];
if (!smod) {
smod = this._addLangPack(lang, o, packName);
}
if (!(supName in flatSup)) {
smod.supersedes.push(supName);
}
// Y.log('pack ' + packName + ' should supersede ' + supName);
// Add rollup file, need to add to supersedes list too
}
}
l++;
}
}
//o.supersedes = YObject.keys(YArray.hash(sup));
o.supersedes = YArray.dedupe(sup);
if (this.allowRollup) {
o.rollup = (l < 4) ? l : Math.min(l - 1, 4);
}
}
plugins = o.plugins;
if (plugins) {
for (i in plugins) {
if (plugins.hasOwnProperty(i)) {
plug = plugins[i];
plug.pkg = name;
plug.path = plug.path || _path(name, i, o.type);
plug.requires = plug.requires || [];
plug.group = o.group;
this.addModule(plug, i);
if (o.skinnable) {
this._addSkin(this.skin.defaultSkin, i, name);
}
}
}
}
if (o.condition) {
t = o.condition.trigger;
if (YUI.Env.aliases[t]) {
t = YUI.Env.aliases[t];
}
if (!Y.Lang.isArray(t)) {
t = [t];
}
for (i = 0; i < t.length; i++) {
trigger = t[i];
when = o.condition.when;
conditions[trigger] = conditions[trigger] || {};
conditions[trigger][name] = o.condition;
// the 'when' attribute can be 'before', 'after', or 'instead'
// the default is after.
if (when && when != 'after') {
if (when == 'instead') { // replace the trigger
o.supersedes = o.supersedes || [];
o.supersedes.push(trigger);
} else { // before the trigger
// the trigger requires the conditional mod,
// so it should appear before the conditional
// mod if we do not intersede.
}
} else { // after the trigger
o.after = o.after || [];
o.after.push(trigger);
}
}
}
if (o.supersedes) {
o.supersedes = this.filterRequires(o.supersedes);
}
if (o.after) {
o.after = this.filterRequires(o.after);
o.after_map = YArray.hash(o.after);
}
// this.dirty = true;
if (o.configFn) {
ret = o.configFn(o);
if (ret === false) {
Y.log('Config function returned false for ' + name + ', skipping.', 'info', 'loader');
delete this.moduleInfo[name];
delete GLOBAL_ENV._renderedMods[name];
o = null;
}
}
//Add to global cache
if (o) {
if (!GLOBAL_ENV._renderedMods) {
GLOBAL_ENV._renderedMods = {};
}
GLOBAL_ENV._renderedMods[name] = Y.merge(o);
GLOBAL_ENV._conditions = conditions;
}
return o;
},
/**
* Add a requirement for one or more module
* @method require
* @param {string[] | string*} what the modules to load.
*/
require: function(what) {
var a = (typeof what === 'string') ? YArray(arguments) : what;
this.dirty = true;
this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));
this._explodeRollups();
},
/**
* Grab all the items that were asked for, check to see if the Loader
* meta-data contains a "use" array. If it doesm remove the asked item and replace it with
* the content of the "use".
* This will make asking for: "dd"
* Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"
* @private
* @method _explodeRollups
*/
_explodeRollups: function() {
var self = this, m,
r = self.required;
if (!self.allowRollup) {
oeach(r, function(v, name) {
m = self.getModule(name);
if (m && m.use) {
//delete r[name];
YArray.each(m.use, function(v) {
m = self.getModule(v);
if (m && m.use) {
//delete r[v];
YArray.each(m.use, function(v) {
r[v] = true;
});
} else {
r[v] = true;
}
});
}
});
self.required = r;
}
},
/**
* Explodes the required array to remove aliases and replace them with real modules
* @method filterRequires
* @param {Array} r The original requires array
* @return {Array} The new array of exploded requirements
*/
filterRequires: function(r) {
if (r) {
if (!Y.Lang.isArray(r)) {
r = [r];
}
r = Y.Array(r);
var c = [], i, mod, o, m;
for (i = 0; i < r.length; i++) {
mod = this.getModule(r[i]);
if (mod && mod.use) {
for (o = 0; o < mod.use.length; o++) {
//Must walk the other modules in case a module is a rollup of rollups (datatype)
m = this.getModule(mod.use[o]);
if (m && m.use) {
c = Y.Array.dedupe([].concat(c, this.filterRequires(m.use)));
} else {
c.push(mod.use[o]);
}
}
} else {
c.push(r[i]);
}
}
r = c;
}
return r;
},
/**
* Returns an object containing properties for all modules required
* in order to load the requested module
* @method getRequires
* @param {object} mod The module definition from moduleInfo.
* @return {array} the expanded requirement list.
*/
getRequires: function(mod) {
if (!mod) {
//console.log('returning no reqs for ' + mod.name);
return NO_REQUIREMENTS;
}
if (mod._parsed) {
//console.log('returning requires for ' + mod.name, mod.requires);
return mod.expanded || NO_REQUIREMENTS;
}
//TODO add modue cache here out of scope..
var i, m, j, add, packName, lang, testresults = this.testresults,
name = mod.name, cond,
adddef = ON_PAGE[name] && ON_PAGE[name].details,
d, k, m1,
r, old_mod,
o, skinmod, skindef, skinpar, skinname,
intl = mod.lang || mod.intl,
info = this.moduleInfo,
ftests = Y.Features && Y.Features.tests.load,
hash;
// console.log(name);
// pattern match leaves module stub that needs to be filled out
if (mod.temp && adddef) {
old_mod = mod;
mod = this.addModule(adddef, name);
mod.group = old_mod.group;
mod.pkg = old_mod.pkg;
delete mod.expanded;
}
// console.log('cache: ' + mod.langCache + ' == ' + this.lang);
// if (mod.expanded && (!mod.langCache || mod.langCache == this.lang)) {
if (mod.expanded && (!this.lang || mod.langCache === this.lang)) {
//Y.log('Already expanded ' + name + ', ' + mod.expanded);
return mod.expanded;
}
d = [];
hash = {};
r = this.filterRequires(mod.requires);
if (mod.lang) {
//If a module has a lang attribute, auto add the intl requirement.
d.unshift('intl');
r.unshift('intl');
intl = true;
}
o = this.filterRequires(mod.optional);
// Y.log("getRequires: " + name + " (dirty:" + this.dirty +
// ", expanded:" + mod.expanded + ")");
mod._parsed = true;
mod.langCache = this.lang;
for (i = 0; i < r.length; i++) {
//Y.log(name + ' requiring ' + r[i], 'info', 'loader');
if (!hash[r[i]]) {
d.push(r[i]);
hash[r[i]] = true;
m = this.getModule(r[i]);
if (m) {
add = this.getRequires(m);
intl = intl || (m.expanded_map &&
(INTL in m.expanded_map));
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
// get the requirements from superseded modules, if any
r = this.filterRequires(mod.supersedes);
if (r) {
for (i = 0; i < r.length; i++) {
if (!hash[r[i]]) {
// if this module has submodules, the requirements list is
// expanded to include the submodules. This is so we can
// prevent dups when a submodule is already loaded and the
// parent is requested.
if (mod.submodules) {
d.push(r[i]);
}
hash[r[i]] = true;
m = this.getModule(r[i]);
if (m) {
add = this.getRequires(m);
intl = intl || (m.expanded_map &&
(INTL in m.expanded_map));
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
}
if (o && this.loadOptional) {
for (i = 0; i < o.length; i++) {
if (!hash[o[i]]) {
d.push(o[i]);
hash[o[i]] = true;
m = info[o[i]];
if (m) {
add = this.getRequires(m);
intl = intl || (m.expanded_map &&
(INTL in m.expanded_map));
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
}
cond = this.conditions[name];
if (cond) {
//Set the module to not parsed since we have conditionals and this could change the dependency tree.
mod._parsed = false;
if (testresults && ftests) {
oeach(testresults, function(result, id) {
var condmod = ftests[id].name;
if (!hash[condmod] && ftests[id].trigger == name) {
if (result && ftests[id]) {
hash[condmod] = true;
d.push(condmod);
}
}
});
} else {
oeach(cond, function(def, condmod) {
if (!hash[condmod]) {
//first see if they've specfied a ua check
//then see if they've got a test fn & if it returns true
//otherwise just having a condition block is enough
var go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||
(def.test && def.test(Y, r)));
if (go) {
hash[condmod] = true;
d.push(condmod);
m = this.getModule(condmod);
if (m) {
add = this.getRequires(m);
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
}, this);
}
}
// Create skin modules
if (mod.skinnable) {
skindef = this.skin.overrides;
oeach(YUI.Env.aliases, function(o, n) {
if (Y.Array.indexOf(o, name) > -1) {
skinpar = n;
}
});
if (skindef && (skindef[name] || (skinpar && skindef[skinpar]))) {
skinname = name;
if (skindef[skinpar]) {
skinname = skinpar;
}
for (i = 0; i < skindef[skinname].length; i++) {
skinmod = this._addSkin(skindef[skinname][i], name);
if (!this.isCSSLoaded(skinmod, this._boot)) {
d.push(skinmod);
}
}
} else {
skinmod = this._addSkin(this.skin.defaultSkin, name);
if (!this.isCSSLoaded(skinmod, this._boot)) {
d.push(skinmod);
}
}
}
mod._parsed = false;
if (intl) {
if (mod.lang && !mod.langPack && Y.Intl) {
lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang);
//Y.log('Best lang: ' + lang + ', this.lang: ' + this.lang + ', mod.lang: ' + mod.lang);
packName = this.getLangPackName(lang, name);
if (packName) {
d.unshift(packName);
}
}
d.unshift(INTL);
}
mod.expanded_map = YArray.hash(d);
mod.expanded = YObject.keys(mod.expanded_map);
return mod.expanded;
},
/**
* Check to see if named css module is already loaded on the page
* @method isCSSLoaded
* @param {String} name The name of the css file
* @return Boolean
*/
isCSSLoaded: function(name, skip) {
//TODO - Make this call a batching call with name being an array
if (!name || !YUI.Env.cssStampEl || (!skip && this.ignoreRegistered)) {
Y.log('isCSSLoaded was skipped for ' + name, 'warn', 'loader');
return false;
}
var el = YUI.Env.cssStampEl,
ret = false,
style = el.currentStyle; //IE
//Add the classname to the element
el.className = name;
if (!style) {
style = Y.config.doc.defaultView.getComputedStyle(el, null);
}
if (style && style['display'] === 'none') {
ret = true;
}
Y.log('Has Skin? ' + name + ' : ' + ret, 'info', 'loader');
el.className = ''; //Reset the classname to ''
return ret;
},
/**
* Returns a hash of module names the supplied module satisfies.
* @method getProvides
* @param {string} name The name of the module.
* @return {object} what this module provides.
*/
getProvides: function(name) {
var m = this.getModule(name), o, s;
// supmap = this.provides;
if (!m) {
return NOT_FOUND;
}
if (m && !m.provides) {
o = {};
s = m.supersedes;
if (s) {
YArray.each(s, function(v) {
Y.mix(o, this.getProvides(v));
}, this);
}
o[name] = true;
m.provides = o;
}
return m.provides;
},
/**
* Calculates the dependency tree, the result is stored in the sorted
* property.
* @method calculate
* @param {object} o optional options object.
* @param {string} type optional argument to prune modules.
*/
calculate: function(o, type) {
if (o || type || this.dirty) {
if (o) {
this._config(o);
}
if (!this._init) {
this._setup();
}
this._explode();
if (this.allowRollup) {
this._rollup();
} else {
this._explodeRollups();
}
this._reduce();
this._sort();
}
},
/**
* Creates a "psuedo" package for languages provided in the lang array
* @method _addLangPack
* @private
* @param {String} lang The language to create
* @param {Object} m The module definition to create the language pack around
* @param {String} packName The name of the package (e.g: lang/datatype-date-en-US)
* @return {Object} The module definition
*/
_addLangPack: function(lang, m, packName) {
var name = m.name,
packPath, conf,
existing = this.moduleInfo[packName];
if (!existing) {
packPath = _path((m.pkg || name), packName, JS, true);
conf = {
path: packPath,
intl: true,
langPack: true,
ext: m.ext,
group: m.group,
supersedes: []
};
if (m.configFn) {
conf.configFn = m.configFn;
}
this.addModule(conf, packName);
if (lang) {
Y.Env.lang = Y.Env.lang || {};
Y.Env.lang[lang] = Y.Env.lang[lang] || {};
Y.Env.lang[lang][name] = true;
}
}
return this.moduleInfo[packName];
},
/**
* Investigates the current YUI configuration on the page. By default,
* modules already detected will not be loaded again unless a force
* option is encountered. Called by calculate()
* @method _setup
* @private
*/
_setup: function() {
var info = this.moduleInfo, name, i, j, m, l,
packName;
for (name in info) {
if (info.hasOwnProperty(name)) {
m = info[name];
if (m) {
// remove dups
//m.requires = YObject.keys(YArray.hash(m.requires));
m.requires = YArray.dedupe(m.requires);
// Create lang pack modules
if (m.lang && m.lang.length) {
// Setup root package if the module has lang defined,
// it needs to provide a root language pack
packName = this.getLangPackName(ROOT_LANG, name);
this._addLangPack(null, m, packName);
}
}
}
}
//l = Y.merge(this.inserted);
l = {};
// available modules
if (!this.ignoreRegistered) {
Y.mix(l, GLOBAL_ENV.mods);
}
// add the ignore list to the list of loaded packages
if (this.ignore) {
Y.mix(l, YArray.hash(this.ignore));
}
// expand the list to include superseded modules
for (j in l) {
if (l.hasOwnProperty(j)) {
Y.mix(l, this.getProvides(j));
}
}
// remove modules on the force list from the loaded list
if (this.force) {
for (i = 0; i < this.force.length; i++) {
if (this.force[i] in l) {
delete l[this.force[i]];
}
}
}
Y.mix(this.loaded, l);
this._init = true;
},
/**
* Builds a module name for a language pack
* @method getLangPackName
* @param {string} lang the language code.
* @param {string} mname the module to build it for.
* @return {string} the language pack module name.
*/
getLangPackName: function(lang, mname) {
return ('lang/' + mname + ((lang) ? '_' + lang : ''));
},
/**
* Inspects the required modules list looking for additional
* dependencies. Expands the required list to include all
* required modules. Called by calculate()
* @method _explode
* @private
*/
_explode: function() {
//TODO Move done out of scope
var r = this.required, m, reqs, done = {},
self = this;
// the setup phase is over, all modules have been created
self.dirty = false;
self._explodeRollups();
r = self.required;
oeach(r, function(v, name) {
if (!done[name]) {
done[name] = true;
m = self.getModule(name);
if (m) {
var expound = m.expound;
if (expound) {
r[expound] = self.getModule(expound);
reqs = self.getRequires(r[expound]);
Y.mix(r, YArray.hash(reqs));
}
reqs = self.getRequires(m);
Y.mix(r, YArray.hash(reqs));
}
}
});
// Y.log('After explode: ' + YObject.keys(r));
},
/**
* Get's the loader meta data for the requested module
* @method getModule
* @param {String} mname The module name to get
* @return {Object} The module metadata
*/
getModule: function(mname) {
//TODO: Remove name check - it's a quick hack to fix pattern WIP
if (!mname) {
return null;
}
var p, found, pname,
m = this.moduleInfo[mname],
patterns = this.patterns;
// check the patterns library to see if we should automatically add
// the module with defaults
if (!m) {
// Y.log('testing patterns ' + YObject.keys(patterns));
for (pname in patterns) {
if (patterns.hasOwnProperty(pname)) {
// Y.log('testing pattern ' + i);
p = patterns[pname];
//There is no test method, create a default one that tests
// the pattern against the mod name
if (!p.test) {
p.test = function(mname, pname) {
return (mname.indexOf(pname) > -1);
};
}
if (p.test(mname, pname)) {
// use the metadata supplied for the pattern
// as the module definition.
found = p;
break;
}
}
}
if (found) {
if (p.action) {
// Y.log('executing pattern action: ' + pname);
p.action.call(this, mname, pname);
} else {
Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
pname, 'info', 'loader');
// ext true or false?
m = this.addModule(Y.merge(found), mname);
m.temp = true;
}
}
}
return m;
},
// impl in rollup submodule
_rollup: function() { },
/**
* Remove superceded modules and loaded modules. Called by
* calculate() after we have the mega list of all dependencies
* @method _reduce
* @return {object} the reduced dependency hash.
* @private
*/
_reduce: function(r) {
r = r || this.required;
var i, j, s, m, type = this.loadType,
ignore = this.ignore ? YArray.hash(this.ignore) : false;
for (i in r) {
if (r.hasOwnProperty(i)) {
m = this.getModule(i);
// remove if already loaded
if (((this.loaded[i] || ON_PAGE[i]) &&
!this.forceMap[i] && !this.ignoreRegistered) ||
(type && m && m.type != type)) {
delete r[i];
}
if (ignore && ignore[i]) {
delete r[i];
}
// remove anything this module supersedes
s = m && m.supersedes;
if (s) {
for (j = 0; j < s.length; j++) {
if (s[j] in r) {
delete r[s[j]];
}
}
}
}
}
return r;
},
/**
* Handles the queue when a module has been loaded for all cases
* @method _finish
* @private
* @param {String} msg The message from Loader
* @param {Boolean} success A boolean denoting success or failure
*/
_finish: function(msg, success) {
Y.log('loader finishing: ' + msg + ', ' + Y.id + ', ' +
this.data, 'info', 'loader');
_queue.running = false;
var onEnd = this.onEnd;
if (onEnd) {
onEnd.call(this.context, {
msg: msg,
data: this.data,
success: success
});
}
this._continue();
},
/**
* The default Loader onSuccess handler, calls this.onSuccess with a payload
* @method _onSuccess
* @private
*/
_onSuccess: function() {
var self = this, skipped = Y.merge(self.skipped), fn,
failed = [], rreg = self.requireRegistration,
success, msg;
oeach(skipped, function(k) {
delete self.inserted[k];
});
self.skipped = {};
oeach(self.inserted, function(v, k) {
var mod = self.getModule(k);
if (mod && rreg && mod.type == JS && !(k in YUI.Env.mods)) {
failed.push(k);
} else {
Y.mix(self.loaded, self.getProvides(k));
}
});
fn = self.onSuccess;
msg = (failed.length) ? 'notregistered' : 'success';
success = !(failed.length);
if (fn) {
fn.call(self.context, {
msg: msg,
data: self.data,
success: success,
failed: failed,
skipped: skipped
});
}
self._finish(msg, success);
},
/**
* The default Loader onProgress handler, calls this.onProgress with a payload
* @method _onProgress
* @private
*/
_onProgress: function(e) {
var self = this;
if (self.onProgress) {
self.onProgress.call(self.context, {
name: e.url,
data: e.data
});
}
},
/**
* The default Loader onFailure handler, calls this.onFailure with a payload
* @method _onFailure
* @private
*/
_onFailure: function(o) {
var f = this.onFailure, msg = [], i = 0, len = o.errors.length;
for (i; i < len; i++) {
msg.push(o.errors[i].error);
}
msg = msg.join(',');
Y.log('load error: ' + msg + ', ' + Y.id, 'error', 'loader');
if (f) {
f.call(this.context, {
msg: msg,
data: this.data,
success: false
});
}
this._finish(msg, false);
},
/**
* The default Loader onTimeout handler, calls this.onTimeout with a payload
* @method _onTimeout
* @private
*/
_onTimeout: function() {
Y.log('loader timeout: ' + Y.id, 'error', 'loader');
var f = this.onTimeout;
if (f) {
f.call(this.context, {
msg: 'timeout',
data: this.data,
success: false
});
}
},
/**
* Sorts the dependency tree. The last step of calculate()
* @method _sort
* @private
*/
_sort: function() {
// create an indexed list
var s = YObject.keys(this.required),
// loaded = this.loaded,
//TODO Move this out of scope
done = {},
p = 0, l, a, b, j, k, moved, doneKey;
// keep going until we make a pass without moving anything
for (;;) {
l = s.length;
moved = false;
// start the loop after items that are already sorted
for (j = p; j < l; j++) {
// check the next module on the list to see if its
// dependencies have been met
a = s[j];
// check everything below current item and move if we
// find a requirement for the current item
for (k = j + 1; k < l; k++) {
doneKey = a + s[k];
if (!done[doneKey] && this._requires(a, s[k])) {
// extract the dependency so we can move it up
b = s.splice(k, 1);
// insert the dependency above the item that
// requires it
s.splice(j, 0, b[0]);
// only swap two dependencies once to short circut
// circular dependencies
done[doneKey] = true;
// keep working
moved = true;
break;
}
}
// jump out of loop if we moved something
if (moved) {
break;
// this item is sorted, move our pointer and keep going
} else {
p++;
}
}
// when we make it here and moved is false, we are
// finished sorting
if (!moved) {
break;
}
}
this.sorted = s;
},
/**
* Handles the actual insertion of script/link tags
* @method _insert
* @private
* @param {Object} source The YUI instance the request came from
* @param {Object} o The metadata to include
* @param {String} type JS or CSS
* @param {Boolean} [skipcalc=false] Do a Loader.calculate on the meta
*/
_insert: function(source, o, type, skipcalc) {
Y.log('private _insert() ' + (type || '') + ', ' + Y.id, "info", "loader");
// restore the state at the time of the request
if (source) {
this._config(source);
}
// build the dependency list
// don't include type so we can process CSS and script in
// one pass when the type is not specified.
if (!skipcalc) {
this.calculate(o);
}
var modules = this.resolve(),
self = this, comp = 0, actions = 0;
if (type) {
//Filter out the opposite type and reset the array so the checks later work
modules[((type === JS) ? CSS : JS)] = [];
}
if (modules.js.length) {
comp++;
}
if (modules.css.length) {
comp++;
}
//console.log('Resolved Modules: ', modules);
var complete = function(d) {
actions++;
var errs = {}, i = 0, u = '', fn;
if (d && d.errors) {
for (i = 0; i < d.errors.length; i++) {
if (d.errors[i].request) {
u = d.errors[i].request.url;
} else {
u = d.errors[i];
}
errs[u] = u;
}
}
if (d && d.data && d.data.length && (d.type === 'success')) {
for (i = 0; i < d.data.length; i++) {
self.inserted[d.data[i].name] = true;
}
}
if (actions === comp) {
self._loading = null;
Y.log('Loader actions complete!', 'info', 'loader');
if (d && d.fn) {
Y.log('Firing final Loader callback!', 'info', 'loader');
fn = d.fn;
delete d.fn;
fn.call(self, d);
}
}
};
this._loading = true;
if (!modules.js.length && !modules.css.length) {
Y.log('No modules resolved..', 'warn', 'loader');
actions = -1;
complete({
fn: self._onSuccess
});
return;
}
if (modules.css.length) { //Load CSS first
Y.log('Loading CSS modules', 'info', 'loader');
Y.Get.css(modules.css, {
data: modules.cssMods,
attributes: self.cssAttributes,
insertBefore: self.insertBefore,
charset: self.charset,
timeout: self.timeout,
context: self,
onProgress: function(e) {
self._onProgress.call(self, e);
},
onTimeout: function(d) {
self._onTimeout.call(self, d);
},
onSuccess: function(d) {
d.type = 'success';
d.fn = self._onSuccess;
complete.call(self, d);
},
onFailure: function(d) {
d.type = 'failure';
d.fn = self._onFailure;
complete.call(self, d);
}
});
}
if (modules.js.length) {
Y.log('Loading JS modules', 'info', 'loader');
Y.Get.js(modules.js, {
data: modules.jsMods,
insertBefore: self.insertBefore,
attributes: self.jsAttributes,
charset: self.charset,
timeout: self.timeout,
autopurge: false,
context: self,
async: true,
onProgress: function(e) {
self._onProgress.call(self, e);
},
onTimeout: function(d) {
self._onTimeout.call(self, d);
},
onSuccess: function(d) {
d.type = 'success';
d.fn = self._onSuccess;
complete.call(self, d);
},
onFailure: function(d) {
d.type = 'failure';
d.fn = self._onFailure;
complete.call(self, d);
}
});
}
},
/**
* Once a loader operation is completely finished, process any additional queued items.
* @method _continue
* @private
*/
_continue: function() {
if (!(_queue.running) && _queue.size() > 0) {
_queue.running = true;
_queue.next()();
}
},
/**
* inserts the requested modules and their dependencies.
* <code>type</code> can be "js" or "css". Both script and
* css are inserted if type is not provided.
* @method insert
* @param {object} o optional options object.
* @param {string} type the type of dependency to insert.
*/
insert: function(o, type, skipsort) {
Y.log('public insert() ' + (type || '') + ', ' +
Y.Object.keys(this.required), "info", "loader");
var self = this, copy = Y.merge(this);
delete copy.require;
delete copy.dirty;
_queue.add(function() {
self._insert(copy, o, type, skipsort);
});
this._continue();
},
/**
* Executed every time a module is loaded, and if we are in a load
* cycle, we attempt to load the next script. Public so that it
* is possible to call this if using a method other than
* Y.register to determine when scripts are fully loaded
* @method loadNext
* @deprecated
* @param {string} mname optional the name of the module that has
* been loaded (which is usually why it is time to load the next
* one).
*/
loadNext: function(mname) {
Y.log('loadNext was called..', 'error', 'loader');
return;
},
/**
* Apply filter defined for this instance to a url/path
* @method _filter
* @param {string} u the string to filter.
* @param {string} name the name of the module, if we are processing
* a single module as opposed to a combined url.
* @return {string} the filtered string.
* @private
*/
_filter: function(u, name, group) {
var f = this.filter,
hasFilter = name && (name in this.filters),
modFilter = hasFilter && this.filters[name],
groupName = group || (this.moduleInfo[name] ? this.moduleInfo[name].group : null);
if (groupName && this.groups[groupName] && this.groups[groupName].filter) {
modFilter = this.groups[groupName].filter;
hasFilter = true;
};
if (u) {
if (hasFilter) {
f = (L.isString(modFilter)) ?
this.FILTER_DEFS[modFilter.toUpperCase()] || null :
modFilter;
}
if (f) {
u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr);
}
}
return u;
},
/**
* Generates the full url for a module
* @method _url
* @param {string} path the path fragment.
* @param {String} name The name of the module
* @param {String} [base=self.base] The base url to use
* @return {string} the full url.
* @private
*/
_url: function(path, name, base) {
return this._filter((base || this.base || '') + path, name);
},
/**
* Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules.
* @method resolve
* @param {Boolean} [calc=false] Perform a loader.calculate() before anything else
* @param {Array} [s=loader.sorted] An override for the loader.sorted array
* @return {Object} Object hash (js and css) of two arrays of file lists
* @example This method can be used as an off-line dep calculator
*
* var Y = YUI();
* var loader = new Y.Loader({
* filter: 'debug',
* base: '../../',
* root: 'build/',
* combine: true,
* require: ['node', 'dd', 'console']
* });
* var out = loader.resolve(true);
*
*/
resolve: function(calc, s) {
var len, i, m, url, fn, msg, attr, group, groupName, j, frag,
comboSource, comboSources, mods, comboBase,
base, urls, u = [], tmpBase, baseLen, resCombos = {},
self = this, comboSep, maxURLLength, singles = [],
inserted = (self.ignoreRegistered) ? {} : self.inserted,
resolved = { js: [], jsMods: [], css: [], cssMods: [] },
type = self.loadType || 'js';
if (calc) {
self.calculate();
}
s = s || self.sorted;
var addSingle = function(m) {
if (m) {
group = (m.group && self.groups[m.group]) || NOT_FOUND;
//Always assume it's async
if (group.async === false) {
m.async = group.async;
}
url = (m.fullpath) ? self._filter(m.fullpath, s[i]) :
self._url(m.path, s[i], group.base || m.base);
if (m.attributes || m.async === false) {
url = {
url: url,
async: m.async
};
if (m.attributes) {
url.attributes = m.attributes
}
}
resolved[m.type].push(url);
resolved[m.type + 'Mods'].push(m);
} else {
Y.log('Undefined Module', 'warn', 'loader');
}
};
len = s.length;
// the default combo base
comboBase = self.comboBase;
url = comboBase;
comboSources = {};
for (i = 0; i < len; i++) {
comboSource = comboBase;
m = self.getModule(s[i]);
groupName = m && m.group;
group = self.groups[groupName];
if (groupName && group) {
if (!group.combine || m.fullpath) {
//This is not a combo module, skip it and load it singly later.
//singles.push(s[i]);
addSingle(m);
continue;
}
m.combine = true;
if (group.comboBase) {
comboSource = group.comboBase;
}
if ("root" in group && L.isValue(group.root)) {
m.root = group.root;
}
m.comboSep = group.comboSep || self.comboSep;
m.maxURLLength = group.maxURLLength || self.maxURLLength;
} else {
if (!self.combine) {
//This is not a combo module, skip it and load it singly later.
//singles.push(s[i]);
addSingle(m);
continue;
}
}
comboSources[comboSource] = comboSources[comboSource] || [];
comboSources[comboSource].push(m);
}
for (j in comboSources) {
if (comboSources.hasOwnProperty(j)) {
resCombos[j] = resCombos[j] || { js: [], jsMods: [], css: [], cssMods: [] };
url = j;
mods = comboSources[j];
len = mods.length;
if (len) {
for (i = 0; i < len; i++) {
if (inserted[mods[i]]) {
continue;
}
m = mods[i];
// Do not try to combine non-yui JS unless combo def
// is found
if (m && (m.combine || !m.ext)) {
resCombos[j].comboSep = m.comboSep;
resCombos[j].group = m.group;
resCombos[j].maxURLLength = m.maxURLLength;
frag = ((L.isValue(m.root)) ? m.root : self.root) + (m.path || m.fullpath);
frag = self._filter(frag, m.name);
resCombos[j][m.type].push(frag);
resCombos[j][m.type + 'Mods'].push(m);
} else {
//Add them to the next process..
if (mods[i]) {
//singles.push(mods[i].name);
addSingle(mods[i]);
}
}
}
}
}
}
for (j in resCombos) {
base = j;
comboSep = resCombos[base].comboSep || self.comboSep;
maxURLLength = resCombos[base].maxURLLength || self.maxURLLength;
Y.log('Using maxURLLength of ' + maxURLLength, 'info', 'loader');
for (type in resCombos[base]) {
if (type === JS || type === CSS) {
urls = resCombos[base][type];
mods = resCombos[base][type + 'Mods'];
len = urls.length;
tmpBase = base + urls.join(comboSep);
baseLen = tmpBase.length;
if (maxURLLength <= base.length) {
Y.log('maxURLLength (' + maxURLLength + ') is lower than the comboBase length (' + base.length + '), resetting to default (' + MAX_URL_LENGTH + ')', 'error', 'loader');
maxURLLength = MAX_URL_LENGTH;
}
if (len) {
if (baseLen > maxURLLength) {
Y.log('Exceeded maxURLLength (' + maxURLLength + ') for ' + type + ', splitting', 'info', 'loader');
u = [];
for (s = 0; s < len; s++) {
u.push(urls[s]);
tmpBase = base + u.join(comboSep);
if (tmpBase.length > maxURLLength) {
m = u.pop();
tmpBase = base + u.join(comboSep)
resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));
u = [];
if (m) {
u.push(m);
}
}
}
if (u.length) {
tmpBase = base + u.join(comboSep);
resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));
}
} else {
resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));
}
}
resolved[type + 'Mods'] = resolved[type + 'Mods'].concat(mods);
}
}
}
resCombos = null;
return resolved;
},
/**
Shortcut to calculate, resolve and load all modules.
var loader = new Y.Loader({
ignoreRegistered: true,
modules: {
mod: {
path: 'mod.js'
}
},
requires: [ 'mod' ]
});
loader.load(function() {
console.log('All modules have loaded..');
});
@method load
@param {Callback} cb Executed after all load operations are complete
*/
load: function(cb) {
if (!cb) {
Y.log('No callback supplied to load()', 'error', 'loader');
return;
}
var self = this,
out = self.resolve(true);
self.data = out;
self.onEnd = function() {
cb.apply(self.context || self, arguments);
};
self.insert();
}
};
}, '@VERSION@' ,{requires:['get', 'features']});
YUI.add('loader-rollup', function(Y) {
/**
* Optional automatic rollup logic for reducing http connections
* when not using a combo service.
* @module loader
* @submodule rollup
*/
/**
* Look for rollup packages to determine if all of the modules a
* rollup supersedes are required. If so, include the rollup to
* help reduce the total number of connections required. Called
* by calculate(). This is an optional feature, and requires the
* appropriate submodule to function.
* @method _rollup
* @for Loader
* @private
*/
Y.Loader.prototype._rollup = function() {
var i, j, m, s, r = this.required, roll,
info = this.moduleInfo, rolled, c, smod;
// find and cache rollup modules
if (this.dirty || !this.rollups) {
this.rollups = {};
for (i in info) {
if (info.hasOwnProperty(i)) {
m = this.getModule(i);
// if (m && m.rollup && m.supersedes) {
if (m && m.rollup) {
this.rollups[i] = m;
}
}
}
}
// make as many passes as needed to pick up rollup rollups
for (;;) {
rolled = false;
// go through the rollup candidates
for (i in this.rollups) {
if (this.rollups.hasOwnProperty(i)) {
// there can be only one, unless forced
if (!r[i] && ((!this.loaded[i]) || this.forceMap[i])) {
m = this.getModule(i);
s = m.supersedes || [];
roll = false;
// @TODO remove continue
if (!m.rollup) {
continue;
}
c = 0;
// check the threshold
for (j = 0; j < s.length; j++) {
smod = info[s[j]];
// if the superseded module is loaded, we can't
// load the rollup unless it has been forced.
if (this.loaded[s[j]] && !this.forceMap[s[j]]) {
roll = false;
break;
// increment the counter if this module is required.
// if we are beyond the rollup threshold, we will
// use the rollup module
} else if (r[s[j]] && m.type == smod.type) {
c++;
// Y.log("adding to thresh: " + c + ", " + s[j]);
roll = (c >= m.rollup);
if (roll) {
// Y.log("over thresh " + c + ", " + s[j]);
break;
}
}
}
if (roll) {
// Y.log("adding rollup: " + i);
// add the rollup
r[i] = true;
rolled = true;
// expand the rollup's dependencies
this.getRequires(m);
}
}
}
}
// if we made it here w/o rolling up something, we are done
if (!rolled) {
break;
}
}
};
}, '@VERSION@' ,{requires:['loader-base']});
YUI.add('loader-yui3', function(Y) {
/* This file is auto-generated by src/loader/scripts/meta_join.py */
/**
* YUI 3 module metadata
* @module loader
* @submodule yui3
*/
YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {
"align-plugin": {
"requires": [
"node-screen",
"node-pluginhost"
]
},
"anim": {
"use": [
"anim-base",
"anim-color",
"anim-curve",
"anim-easing",
"anim-node-plugin",
"anim-scroll",
"anim-xy"
]
},
"anim-base": {
"requires": [
"base-base",
"node-style"
]
},
"anim-color": {
"requires": [
"anim-base"
]
},
"anim-curve": {
"requires": [
"anim-xy"
]
},
"anim-easing": {
"requires": [
"anim-base"
]
},
"anim-node-plugin": {
"requires": [
"node-pluginhost",
"anim-base"
]
},
"anim-scroll": {
"requires": [
"anim-base"
]
},
"anim-shape-transform": {
"requires": [
"anim-base",
"anim-easing",
"matrix"
]
},
"anim-xy": {
"requires": [
"anim-base",
"node-screen"
]
},
"app": {
"use": [
"app-base",
"app-transitions",
"model",
"model-list",
"router",
"view"
]
},
"app-base": {
"requires": [
"classnamemanager",
"pjax-base",
"router",
"view"
]
},
"app-transitions": {
"requires": [
"app-base"
]
},
"app-transitions-css": {
"type": "css"
},
"app-transitions-native": {
"condition": {
"name": "app-transitions-native",
"test": function (Y) {
var doc = Y.config.doc,
node = doc ? doc.documentElement : null;
if (node && node.style) {
return ('MozTransition' in node.style || 'WebkitTransition' in node.style);
}
return false;
},
"trigger": "app-transitions"
},
"requires": [
"app-transitions",
"app-transitions-css",
"parallel",
"transition"
]
},
"array-extras": {
"requires": [
"yui-base"
]
},
"array-invoke": {
"requires": [
"yui-base"
]
},
"arraylist": {
"requires": [
"yui-base"
]
},
"arraylist-add": {
"requires": [
"arraylist"
]
},
"arraylist-filter": {
"requires": [
"arraylist"
]
},
"arraysort": {
"requires": [
"yui-base"
]
},
"async-queue": {
"requires": [
"event-custom"
]
},
"attribute": {
"use": [
"attribute-base",
"attribute-complex"
]
},
"attribute-base": {
"requires": [
"attribute-core",
"attribute-events",
"attribute-extras"
]
},
"attribute-complex": {
"requires": [
"attribute-base"
]
},
"attribute-core": {
"requires": [
"yui-base"
]
},
"attribute-events": {
"requires": [
"event-custom"
]
},
"attribute-extras": {
"requires": [
"yui-base"
]
},
"autocomplete": {
"use": [
"autocomplete-base",
"autocomplete-sources",
"autocomplete-list",
"autocomplete-plugin"
]
},
"autocomplete-base": {
"optional": [
"autocomplete-sources"
],
"requires": [
"array-extras",
"base-build",
"escape",
"event-valuechange",
"node-base"
]
},
"autocomplete-filters": {
"requires": [
"array-extras",
"text-wordbreak"
]
},
"autocomplete-filters-accentfold": {
"requires": [
"array-extras",
"text-accentfold",
"text-wordbreak"
]
},
"autocomplete-highlighters": {
"requires": [
"array-extras",
"highlight-base"
]
},
"autocomplete-highlighters-accentfold": {
"requires": [
"array-extras",
"highlight-accentfold"
]
},
"autocomplete-list": {
"after": [
"autocomplete-sources"
],
"lang": [
"en"
],
"requires": [
"autocomplete-base",
"event-resize",
"node-screen",
"selector-css3",
"shim-plugin",
"widget",
"widget-position",
"widget-position-align"
],
"skinnable": true
},
"autocomplete-list-keys": {
"condition": {
"name": "autocomplete-list-keys",
"test": function (Y) {
// Only add keyboard support to autocomplete-list if this doesn't appear to
// be an iOS or Android-based mobile device.
//
// There's currently no feasible way to actually detect whether a device has
// a hardware keyboard, so this sniff will have to do. It can easily be
// overridden by manually loading the autocomplete-list-keys module.
//
// Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari
// doesn't fire the keyboard events used by AutoCompleteList, so there's
// no point loading the -keys module even when a bluetooth keyboard may be
// available.
return !(Y.UA.ios || Y.UA.android);
},
"trigger": "autocomplete-list"
},
"requires": [
"autocomplete-list",
"base-build"
]
},
"autocomplete-plugin": {
"requires": [
"autocomplete-list",
"node-pluginhost"
]
},
"autocomplete-sources": {
"optional": [
"io-base",
"json-parse",
"jsonp",
"yql"
],
"requires": [
"autocomplete-base"
]
},
"base": {
"use": [
"base-base",
"base-pluginhost",
"base-build"
]
},
"base-base": {
"after": [
"attribute-complex"
],
"requires": [
"base-core",
"attribute-base"
]
},
"base-build": {
"requires": [
"base-base"
]
},
"base-core": {
"requires": [
"attribute-core"
]
},
"base-pluginhost": {
"requires": [
"base-base",
"pluginhost"
]
},
"button": {
"requires": [
"button-core",
"cssbutton",
"widget"
]
},
"button-core": {
"requires": [
"attribute-core",
"classnamemanager",
"node-base"
]
},
"button-group": {
"requires": [
"button-plugin",
"cssbutton",
"widget"
]
},
"button-plugin": {
"requires": [
"button-core",
"cssbutton",
"node-pluginhost"
]
},
"cache": {
"use": [
"cache-base",
"cache-offline",
"cache-plugin"
]
},
"cache-base": {
"requires": [
"base"
]
},
"cache-offline": {
"requires": [
"cache-base",
"json"
]
},
"cache-plugin": {
"requires": [
"plugin",
"cache-base"
]
},
"calendar": {
"lang": [
"de",
"en",
"fr",
"ja",
"nb-NO",
"pt-BR",
"ru",
"zh-HANT-TW"
],
"requires": [
"calendar-base",
"calendarnavigator"
],
"skinnable": true
},
"calendar-base": {
"lang": [
"de",
"en",
"fr",
"ja",
"nb-NO",
"pt-BR",
"ru",
"zh-HANT-TW"
],
"requires": [
"widget",
"substitute",
"datatype-date",
"datatype-date-math",
"cssgrids"
],
"skinnable": true
},
"calendarnavigator": {
"requires": [
"plugin",
"classnamemanager",
"datatype-date",
"node",
"substitute"
],
"skinnable": true
},
"charts": {
"requires": [
"charts-base"
]
},
"charts-base": {
"requires": [
"dom",
"datatype-number",
"datatype-date",
"event-custom",
"event-mouseenter",
"event-touch",
"widget",
"widget-position",
"widget-stack",
"graphics"
]
},
"charts-legend": {
"requires": [
"charts-base"
]
},
"classnamemanager": {
"requires": [
"yui-base"
]
},
"clickable-rail": {
"requires": [
"slider-base"
]
},
"collection": {
"use": [
"array-extras",
"arraylist",
"arraylist-add",
"arraylist-filter",
"array-invoke"
]
},
"console": {
"lang": [
"en",
"es",
"ja"
],
"requires": [
"yui-log",
"widget",
"substitute"
],
"skinnable": true
},
"console-filters": {
"requires": [
"plugin",
"console"
],
"skinnable": true
},
"controller": {
"use": [
"router"
]
},
"cookie": {
"requires": [
"yui-base"
]
},
"createlink-base": {
"requires": [
"editor-base"
]
},
"cssbase": {
"after": [
"cssreset",
"cssfonts",
"cssgrids",
"cssreset-context",
"cssfonts-context",
"cssgrids-context"
],
"type": "css"
},
"cssbase-context": {
"after": [
"cssreset",
"cssfonts",
"cssgrids",
"cssreset-context",
"cssfonts-context",
"cssgrids-context"
],
"type": "css"
},
"cssbutton": {
"type": "css"
},
"cssfonts": {
"type": "css"
},
"cssfonts-context": {
"type": "css"
},
"cssgrids": {
"optional": [
"cssreset",
"cssfonts"
],
"type": "css"
},
"cssgrids-base": {
"optional": [
"cssreset",
"cssfonts"
],
"type": "css"
},
"cssgrids-units": {
"optional": [
"cssreset",
"cssfonts"
],
"requires": [
"cssgrids-base"
],
"type": "css"
},
"cssreset": {
"type": "css"
},
"cssreset-context": {
"type": "css"
},
"dataschema": {
"use": [
"dataschema-base",
"dataschema-json",
"dataschema-xml",
"dataschema-array",
"dataschema-text"
]
},
"dataschema-array": {
"requires": [
"dataschema-base"
]
},
"dataschema-base": {
"requires": [
"base"
]
},
"dataschema-json": {
"requires": [
"dataschema-base",
"json"
]
},
"dataschema-text": {
"requires": [
"dataschema-base"
]
},
"dataschema-xml": {
"requires": [
"dataschema-base"
]
},
"datasource": {
"use": [
"datasource-local",
"datasource-io",
"datasource-get",
"datasource-function",
"datasource-cache",
"datasource-jsonschema",
"datasource-xmlschema",
"datasource-arrayschema",
"datasource-textschema",
"datasource-polling"
]
},
"datasource-arrayschema": {
"requires": [
"datasource-local",
"plugin",
"dataschema-array"
]
},
"datasource-cache": {
"requires": [
"datasource-local",
"plugin",
"cache-base"
]
},
"datasource-function": {
"requires": [
"datasource-local"
]
},
"datasource-get": {
"requires": [
"datasource-local",
"get"
]
},
"datasource-io": {
"requires": [
"datasource-local",
"io-base"
]
},
"datasource-jsonschema": {
"requires": [
"datasource-local",
"plugin",
"dataschema-json"
]
},
"datasource-local": {
"requires": [
"base"
]
},
"datasource-polling": {
"requires": [
"datasource-local"
]
},
"datasource-textschema": {
"requires": [
"datasource-local",
"plugin",
"dataschema-text"
]
},
"datasource-xmlschema": {
"requires": [
"datasource-local",
"plugin",
"dataschema-xml"
]
},
"datatable": {
"use": [
"datatable-core",
"datatable-head",
"datatable-body",
"datatable-base",
"datatable-column-widths",
"datatable-message",
"datatable-mutable",
"datatable-sort",
"datatable-datasource"
]
},
"datatable-base": {
"requires": [
"datatable-core",
"datatable-head",
"datatable-body",
"base-build",
"widget"
],
"skinnable": true
},
"datatable-base-deprecated": {
"requires": [
"recordset-base",
"widget",
"substitute",
"event-mouseenter"
],
"skinnable": true
},
"datatable-body": {
"requires": [
"datatable-core",
"view",
"classnamemanager"
]
},
"datatable-column-widths": {
"requires": [
"datatable-base"
]
},
"datatable-core": {
"requires": [
"escape",
"model-list",
"node-event-delegate"
]
},
"datatable-datasource": {
"requires": [
"datatable-base",
"plugin",
"datasource-local"
]
},
"datatable-datasource-deprecated": {
"requires": [
"datatable-base-deprecated",
"plugin",
"datasource-local"
]
},
"datatable-deprecated": {
"use": [
"datatable-base-deprecated",
"datatable-datasource-deprecated",
"datatable-sort-deprecated",
"datatable-scroll-deprecated"
]
},
"datatable-head": {
"requires": [
"datatable-core",
"view",
"classnamemanager"
]
},
"datatable-message": {
"lang": [
"en"
],
"requires": [
"datatable-base"
],
"skinnable": true
},
"datatable-mutable": {
"requires": [
"datatable-base"
]
},
"datatable-scroll": {
"requires": [
"datatable-base",
"datatable-column-widths",
"dom-screen"
],
"skinnable": true
},
"datatable-scroll-deprecated": {
"requires": [
"datatable-base-deprecated",
"plugin"
]
},
"datatable-sort": {
"lang": [
"en"
],
"requires": [
"datatable-base"
],
"skinnable": true
},
"datatable-sort-deprecated": {
"lang": [
"en"
],
"requires": [
"datatable-base-deprecated",
"plugin",
"recordset-sort"
]
},
"datatype": {
"use": [
"datatype-number",
"datatype-date",
"datatype-xml"
]
},
"datatype-date": {
"supersedes": [
"datatype-date-format"
],
"use": [
"datatype-date-parse",
"datatype-date-format"
]
},
"datatype-date-format": {
"lang": [
"ar",
"ar-JO",
"ca",
"ca-ES",
"da",
"da-DK",
"de",
"de-AT",
"de-DE",
"el",
"el-GR",
"en",
"en-AU",
"en-CA",
"en-GB",
"en-IE",
"en-IN",
"en-JO",
"en-MY",
"en-NZ",
"en-PH",
"en-SG",
"en-US",
"es",
"es-AR",
"es-BO",
"es-CL",
"es-CO",
"es-EC",
"es-ES",
"es-MX",
"es-PE",
"es-PY",
"es-US",
"es-UY",
"es-VE",
"fi",
"fi-FI",
"fr",
"fr-BE",
"fr-CA",
"fr-FR",
"hi",
"hi-IN",
"id",
"id-ID",
"it",
"it-IT",
"ja",
"ja-JP",
"ko",
"ko-KR",
"ms",
"ms-MY",
"nb",
"nb-NO",
"nl",
"nl-BE",
"nl-NL",
"pl",
"pl-PL",
"pt",
"pt-BR",
"ro",
"ro-RO",
"ru",
"ru-RU",
"sv",
"sv-SE",
"th",
"th-TH",
"tr",
"tr-TR",
"vi",
"vi-VN",
"zh-Hans",
"zh-Hans-CN",
"zh-Hant",
"zh-Hant-HK",
"zh-Hant-TW"
]
},
"datatype-date-math": {
"requires": [
"yui-base"
]
},
"datatype-date-parse": {},
"datatype-number": {
"use": [
"datatype-number-parse",
"datatype-number-format"
]
},
"datatype-number-format": {},
"datatype-number-parse": {},
"datatype-xml": {
"use": [
"datatype-xml-parse",
"datatype-xml-format"
]
},
"datatype-xml-format": {},
"datatype-xml-parse": {},
"dd": {
"use": [
"dd-ddm-base",
"dd-ddm",
"dd-ddm-drop",
"dd-drag",
"dd-proxy",
"dd-constrain",
"dd-drop",
"dd-scroll",
"dd-delegate"
]
},
"dd-constrain": {
"requires": [
"dd-drag"
]
},
"dd-ddm": {
"requires": [
"dd-ddm-base",
"event-resize"
]
},
"dd-ddm-base": {
"requires": [
"node",
"base",
"yui-throttle",
"classnamemanager"
]
},
"dd-ddm-drop": {
"requires": [
"dd-ddm"
]
},
"dd-delegate": {
"requires": [
"dd-drag",
"dd-drop-plugin",
"event-mouseenter"
]
},
"dd-drag": {
"requires": [
"dd-ddm-base"
]
},
"dd-drop": {
"requires": [
"dd-drag",
"dd-ddm-drop"
]
},
"dd-drop-plugin": {
"requires": [
"dd-drop"
]
},
"dd-gestures": {
"condition": {
"name": "dd-gestures",
"test": function(Y) {
return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));
},
"trigger": "dd-drag"
},
"requires": [
"dd-drag",
"event-synthetic",
"event-gestures"
]
},
"dd-plugin": {
"optional": [
"dd-constrain",
"dd-proxy"
],
"requires": [
"dd-drag"
]
},
"dd-proxy": {
"requires": [
"dd-drag"
]
},
"dd-scroll": {
"requires": [
"dd-drag"
]
},
"dial": {
"lang": [
"en",
"es"
],
"requires": [
"widget",
"dd-drag",
"substitute",
"event-mouseenter",
"event-move",
"event-key",
"transition",
"intl"
],
"skinnable": true
},
"dom": {
"use": [
"dom-base",
"dom-screen",
"dom-style",
"selector-native",
"selector"
]
},
"dom-base": {
"requires": [
"dom-core"
]
},
"dom-core": {
"requires": [
"oop",
"features"
]
},
"dom-deprecated": {
"requires": [
"dom-base"
]
},
"dom-screen": {
"requires": [
"dom-base",
"dom-style"
]
},
"dom-style": {
"requires": [
"dom-base"
]
},
"dom-style-ie": {
"condition": {
"name": "dom-style-ie",
"test": function (Y) {
var testFeature = Y.Features.test,
addFeature = Y.Features.add,
WINDOW = Y.config.win,
DOCUMENT = Y.config.doc,
DOCUMENT_ELEMENT = 'documentElement',
ret = false;
addFeature('style', 'computedStyle', {
test: function() {
return WINDOW && 'getComputedStyle' in WINDOW;
}
});
addFeature('style', 'opacity', {
test: function() {
return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;
}
});
ret = (!testFeature('style', 'opacity') &&
!testFeature('style', 'computedStyle'));
return ret;
},
"trigger": "dom-style"
},
"requires": [
"dom-style"
]
},
"dump": {
"requires": [
"yui-base"
]
},
"editor": {
"use": [
"frame",
"editor-selection",
"exec-command",
"editor-base",
"editor-para",
"editor-br",
"editor-bidi",
"editor-tab",
"createlink-base"
]
},
"editor-base": {
"requires": [
"base",
"frame",
"node",
"exec-command",
"editor-selection"
]
},
"editor-bidi": {
"requires": [
"editor-base"
]
},
"editor-br": {
"requires": [
"editor-base"
]
},
"editor-lists": {
"requires": [
"editor-base"
]
},
"editor-para": {
"requires": [
"editor-para-base"
]
},
"editor-para-base": {
"requires": [
"editor-base"
]
},
"editor-para-ie": {
"condition": {
"name": "editor-para-ie",
"trigger": "editor-para",
"ua": "ie",
"when": "instead"
},
"requires": [
"editor-para-base"
]
},
"editor-selection": {
"requires": [
"node"
]
},
"editor-tab": {
"requires": [
"editor-base"
]
},
"escape": {
"requires": [
"yui-base"
]
},
"event": {
"after": [
"node-base"
],
"use": [
"event-base",
"event-delegate",
"event-synthetic",
"event-mousewheel",
"event-mouseenter",
"event-key",
"event-focus",
"event-resize",
"event-hover",
"event-outside",
"event-touch",
"event-move",
"event-flick",
"event-valuechange"
]
},
"event-base": {
"after": [
"node-base"
],
"requires": [
"event-custom-base"
]
},
"event-base-ie": {
"after": [
"event-base"
],
"condition": {
"name": "event-base-ie",
"test": function(Y) {
var imp = Y.config.doc && Y.config.doc.implementation;
return (imp && (!imp.hasFeature('Events', '2.0')));
},
"trigger": "node-base"
},
"requires": [
"node-base"
]
},
"event-contextmenu": {
"requires": [
"event-synthetic",
"dom-screen"
]
},
"event-custom": {
"use": [
"event-custom-base",
"event-custom-complex"
]
},
"event-custom-base": {
"requires": [
"oop"
]
},
"event-custom-complex": {
"requires": [
"event-custom-base"
]
},
"event-delegate": {
"requires": [
"node-base"
]
},
"event-flick": {
"requires": [
"node-base",
"event-touch",
"event-synthetic"
]
},
"event-focus": {
"requires": [
"event-synthetic"
]
},
"event-gestures": {
"use": [
"event-flick",
"event-move"
]
},
"event-hover": {
"requires": [
"event-mouseenter"
]
},
"event-key": {
"requires": [
"event-synthetic"
]
},
"event-mouseenter": {
"requires": [
"event-synthetic"
]
},
"event-mousewheel": {
"requires": [
"node-base"
]
},
"event-move": {
"requires": [
"node-base",
"event-touch",
"event-synthetic"
]
},
"event-outside": {
"requires": [
"event-synthetic"
]
},
"event-resize": {
"requires": [
"node-base",
"event-synthetic"
]
},
"event-simulate": {
"requires": [
"event-base"
]
},
"event-synthetic": {
"requires": [
"node-base",
"event-custom-complex"
]
},
"event-touch": {
"requires": [
"node-base"
]
},
"event-valuechange": {
"requires": [
"event-focus",
"event-synthetic"
]
},
"exec-command": {
"requires": [
"frame"
]
},
"features": {
"requires": [
"yui-base"
]
},
"file": {
"requires": [
"file-flash",
"file-html5"
]
},
"file-flash": {
"requires": [
"base"
]
},
"file-html5": {
"requires": [
"base"
]
},
"frame": {
"requires": [
"base",
"node",
"selector-css3",
"substitute",
"yui-throttle"
]
},
"get": {
"requires": [
"yui-base"
]
},
"graphics": {
"requires": [
"node",
"event-custom",
"pluginhost",
"matrix"
]
},
"graphics-canvas": {
"condition": {
"name": "graphics-canvas",
"test": function(Y) {
var DOCUMENT = Y.config.doc,
useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
},
"trigger": "graphics"
},
"requires": [
"graphics"
]
},
"graphics-canvas-default": {
"condition": {
"name": "graphics-canvas-default",
"test": function(Y) {
var DOCUMENT = Y.config.doc,
useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
},
"trigger": "graphics"
}
},
"graphics-svg": {
"condition": {
"name": "graphics-svg",
"test": function(Y) {
var DOCUMENT = Y.config.doc,
useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
return svg && (useSVG || !canvas);
},
"trigger": "graphics"
},
"requires": [
"graphics"
]
},
"graphics-svg-default": {
"condition": {
"name": "graphics-svg-default",
"test": function(Y) {
var DOCUMENT = Y.config.doc,
useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
return svg && (useSVG || !canvas);
},
"trigger": "graphics"
}
},
"graphics-vml": {
"condition": {
"name": "graphics-vml",
"test": function(Y) {
var DOCUMENT = Y.config.doc,
canvas = DOCUMENT && DOCUMENT.createElement("canvas");
return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
},
"trigger": "graphics"
},
"requires": [
"graphics"
]
},
"graphics-vml-default": {
"condition": {
"name": "graphics-vml-default",
"test": function(Y) {
var DOCUMENT = Y.config.doc,
canvas = DOCUMENT && DOCUMENT.createElement("canvas");
return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
},
"trigger": "graphics"
}
},
"handlebars": {
"use": [
"handlebars-compiler"
]
},
"handlebars-base": {
"requires": [
"escape"
]
},
"handlebars-compiler": {
"requires": [
"handlebars-base"
]
},
"highlight": {
"use": [
"highlight-base",
"highlight-accentfold"
]
},
"highlight-accentfold": {
"requires": [
"highlight-base",
"text-accentfold"
]
},
"highlight-base": {
"requires": [
"array-extras",
"classnamemanager",
"escape",
"text-wordbreak"
]
},
"history": {
"use": [
"history-base",
"history-hash",
"history-hash-ie",
"history-html5"
]
},
"history-base": {
"requires": [
"event-custom-complex"
]
},
"history-hash": {
"after": [
"history-html5"
],
"requires": [
"event-synthetic",
"history-base",
"yui-later"
]
},
"history-hash-ie": {
"condition": {
"name": "history-hash-ie",
"test": function (Y) {
var docMode = Y.config.doc && Y.config.doc.documentMode;
return Y.UA.ie && (!('onhashchange' in Y.config.win) ||
!docMode || docMode < 8);
},
"trigger": "history-hash"
},
"requires": [
"history-hash",
"node-base"
]
},
"history-html5": {
"optional": [
"json"
],
"requires": [
"event-base",
"history-base",
"node-base"
]
},
"imageloader": {
"requires": [
"base-base",
"node-style",
"node-screen"
]
},
"intl": {
"requires": [
"intl-base",
"event-custom"
]
},
"intl-base": {
"requires": [
"yui-base"
]
},
"io": {
"use": [
"io-base",
"io-xdr",
"io-form",
"io-upload-iframe",
"io-queue"
]
},
"io-base": {
"requires": [
"event-custom-base",
"querystring-stringify-simple"
]
},
"io-form": {
"requires": [
"io-base",
"node-base"
]
},
"io-nodejs": {
"condition": {
"name": "io-nodejs",
"trigger": "io-base",
"ua": "nodejs"
},
"requires": [
"io-base"
]
},
"io-queue": {
"requires": [
"io-base",
"queue-promote"
]
},
"io-upload-iframe": {
"requires": [
"io-base",
"node-base"
]
},
"io-xdr": {
"requires": [
"io-base",
"datatype-xml-parse"
]
},
"json": {
"use": [
"json-parse",
"json-stringify"
]
},
"json-parse": {
"requires": [
"yui-base"
]
},
"json-stringify": {
"requires": [
"yui-base"
]
},
"jsonp": {
"requires": [
"get",
"oop"
]
},
"jsonp-url": {
"requires": [
"jsonp"
]
},
"loader": {
"use": [
"loader-base",
"loader-rollup",
"loader-yui3"
]
},
"loader-base": {
"requires": [
"get",
"features"
]
},
"loader-rollup": {
"requires": [
"loader-base"
]
},
"loader-yui3": {
"requires": [
"loader-base"
]
},
"matrix": {
"requires": [
"yui-base"
]
},
"model": {
"requires": [
"base-build",
"escape",
"json-parse"
]
},
"model-list": {
"requires": [
"array-extras",
"array-invoke",
"arraylist",
"base-build",
"escape",
"json-parse",
"model"
]
},
"node": {
"use": [
"node-base",
"node-event-delegate",
"node-pluginhost",
"node-screen",
"node-style"
]
},
"node-base": {
"requires": [
"event-base",
"node-core",
"dom-base"
]
},
"node-core": {
"requires": [
"dom-core",
"selector"
]
},
"node-deprecated": {
"requires": [
"node-base"
]
},
"node-event-delegate": {
"requires": [
"node-base",
"event-delegate"
]
},
"node-event-html5": {
"requires": [
"node-base"
]
},
"node-event-simulate": {
"requires": [
"node-base",
"event-simulate"
]
},
"node-flick": {
"requires": [
"classnamemanager",
"transition",
"event-flick",
"plugin"
],
"skinnable": true
},
"node-focusmanager": {
"requires": [
"attribute",
"node",
"plugin",
"node-event-simulate",
"event-key",
"event-focus"
]
},
"node-load": {
"requires": [
"node-base",
"io-base"
]
},
"node-menunav": {
"requires": [
"node",
"classnamemanager",
"plugin",
"node-focusmanager"
],
"skinnable": true
},
"node-pluginhost": {
"requires": [
"node-base",
"pluginhost"
]
},
"node-screen": {
"requires": [
"dom-screen",
"node-base"
]
},
"node-style": {
"requires": [
"dom-style",
"node-base"
]
},
"oop": {
"requires": [
"yui-base"
]
},
"overlay": {
"requires": [
"widget",
"widget-stdmod",
"widget-position",
"widget-position-align",
"widget-stack",
"widget-position-constrain"
],
"skinnable": true
},
"panel": {
"requires": [
"widget",
"widget-autohide",
"widget-buttons",
"widget-modality",
"widget-position",
"widget-position-align",
"widget-position-constrain",
"widget-stack",
"widget-stdmod"
],
"skinnable": true
},
"parallel": {
"requires": [
"yui-base"
]
},
"pjax": {
"requires": [
"pjax-base",
"io-base"
]
},
"pjax-base": {
"requires": [
"classnamemanager",
"node-event-delegate",
"router"
]
},
"pjax-plugin": {
"requires": [
"node-pluginhost",
"pjax",
"plugin"
]
},
"plugin": {
"requires": [
"base-base"
]
},
"pluginhost": {
"use": [
"pluginhost-base",
"pluginhost-config"
]
},
"pluginhost-base": {
"requires": [
"yui-base"
]
},
"pluginhost-config": {
"requires": [
"pluginhost-base"
]
},
"profiler": {
"requires": [
"yui-base"
]
},
"querystring": {
"use": [
"querystring-parse",
"querystring-stringify"
]
},
"querystring-parse": {
"requires": [
"yui-base",
"array-extras"
]
},
"querystring-parse-simple": {
"requires": [
"yui-base"
]
},
"querystring-stringify": {
"requires": [
"yui-base"
]
},
"querystring-stringify-simple": {
"requires": [
"yui-base"
]
},
"queue-promote": {
"requires": [
"yui-base"
]
},
"range-slider": {
"requires": [
"slider-base",
"slider-value-range",
"clickable-rail"
]
},
"recordset": {
"use": [
"recordset-base",
"recordset-sort",
"recordset-filter",
"recordset-indexer"
]
},
"recordset-base": {
"requires": [
"base",
"arraylist"
]
},
"recordset-filter": {
"requires": [
"recordset-base",
"array-extras",
"plugin"
]
},
"recordset-indexer": {
"requires": [
"recordset-base",
"plugin"
]
},
"recordset-sort": {
"requires": [
"arraysort",
"recordset-base",
"plugin"
]
},
"resize": {
"use": [
"resize-base",
"resize-proxy",
"resize-constrain"
]
},
"resize-base": {
"requires": [
"base",
"widget",
"substitute",
"event",
"oop",
"dd-drag",
"dd-delegate",
"dd-drop"
],
"skinnable": true
},
"resize-constrain": {
"requires": [
"plugin",
"resize-base"
]
},
"resize-plugin": {
"optional": [
"resize-constrain"
],
"requires": [
"resize-base",
"plugin"
]
},
"resize-proxy": {
"requires": [
"plugin",
"resize-base"
]
},
"rls": {
"requires": [
"get",
"features"
]
},
"router": {
"optional": [
"querystring-parse"
],
"requires": [
"array-extras",
"base-build",
"history"
]
},
"scrollview": {
"requires": [
"scrollview-base",
"scrollview-scrollbars"
]
},
"scrollview-base": {
"requires": [
"widget",
"event-gestures",
"event-mousewheel",
"transition"
],
"skinnable": true
},
"scrollview-base-ie": {
"condition": {
"name": "scrollview-base-ie",
"trigger": "scrollview-base",
"ua": "ie"
},
"requires": [
"scrollview-base"
]
},
"scrollview-list": {
"requires": [
"plugin",
"classnamemanager"
],
"skinnable": true
},
"scrollview-paginator": {
"requires": [
"plugin"
]
},
"scrollview-scrollbars": {
"requires": [
"classnamemanager",
"transition",
"plugin"
],
"skinnable": true
},
"selector": {
"requires": [
"selector-native"
]
},
"selector-css2": {
"condition": {
"name": "selector-css2",
"test": function (Y) {
var DOCUMENT = Y.config.doc,
ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);
return ret;
},
"trigger": "selector"
},
"requires": [
"selector-native"
]
},
"selector-css3": {
"requires": [
"selector-native",
"selector-css2"
]
},
"selector-native": {
"requires": [
"dom-base"
]
},
"shim-plugin": {
"requires": [
"node-style",
"node-pluginhost"
]
},
"slider": {
"use": [
"slider-base",
"slider-value-range",
"clickable-rail",
"range-slider"
]
},
"slider-base": {
"requires": [
"widget",
"dd-constrain",
"substitute",
"event-key"
],
"skinnable": true
},
"slider-value-range": {
"requires": [
"slider-base"
]
},
"sortable": {
"requires": [
"dd-delegate",
"dd-drop-plugin",
"dd-proxy"
]
},
"sortable-scroll": {
"requires": [
"dd-scroll",
"sortable"
]
},
"stylesheet": {
"requires": [
"yui-base"
]
},
"substitute": {
"optional": [
"dump"
],
"requires": [
"yui-base"
]
},
"swf": {
"requires": [
"event-custom",
"node",
"swfdetect",
"escape"
]
},
"swfdetect": {
"requires": [
"yui-base"
]
},
"tabview": {
"requires": [
"widget",
"widget-parent",
"widget-child",
"tabview-base",
"node-pluginhost",
"node-focusmanager"
],
"skinnable": true
},
"tabview-base": {
"requires": [
"node-event-delegate",
"classnamemanager",
"skin-sam-tabview"
]
},
"tabview-plugin": {
"requires": [
"tabview-base"
]
},
"test": {
"requires": [
"event-simulate",
"event-custom",
"substitute",
"json-stringify"
],
"skinnable": true
},
"test-console": {
"requires": [
"console-filters",
"test"
],
"skinnable": true
},
"text": {
"use": [
"text-accentfold",
"text-wordbreak"
]
},
"text-accentfold": {
"requires": [
"array-extras",
"text-data-accentfold"
]
},
"text-data-accentfold": {
"requires": [
"yui-base"
]
},
"text-data-wordbreak": {
"requires": [
"yui-base"
]
},
"text-wordbreak": {
"requires": [
"array-extras",
"text-data-wordbreak"
]
},
"transition": {
"requires": [
"node-style"
]
},
"transition-timer": {
"condition": {
"name": "transition-timer",
"test": function (Y) {
var DOCUMENT = Y.config.doc,
node = (DOCUMENT) ? DOCUMENT.documentElement: null,
ret = true;
if (node && node.style) {
ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);
}
return ret;
},
"trigger": "transition"
},
"requires": [
"transition"
]
},
"uploader": {
"requires": [
"uploader-html5",
"uploader-flash"
]
},
"uploader-deprecated": {
"requires": [
"event-custom",
"node",
"base",
"swf"
]
},
"uploader-flash": {
"requires": [
"swf",
"widget",
"substitute",
"base",
"cssbutton",
"node",
"event-custom",
"file-flash",
"uploader-queue"
]
},
"uploader-html5": {
"requires": [
"widget",
"node-event-simulate",
"substitute",
"file-html5",
"uploader-queue"
]
},
"uploader-queue": {
"requires": [
"base"
]
},
"view": {
"requires": [
"base-build",
"node-event-delegate"
]
},
"view-node-map": {
"requires": [
"view"
]
},
"widget": {
"use": [
"widget-base",
"widget-htmlparser",
"widget-skin",
"widget-uievents"
]
},
"widget-anim": {
"requires": [
"anim-base",
"plugin",
"widget"
]
},
"widget-autohide": {
"requires": [
"base-build",
"event-key",
"event-outside",
"widget"
]
},
"widget-base": {
"requires": [
"attribute",
"base-base",
"base-pluginhost",
"classnamemanager",
"event-focus",
"node-base",
"node-style"
],
"skinnable": true
},
"widget-base-ie": {
"condition": {
"name": "widget-base-ie",
"trigger": "widget-base",
"ua": "ie"
},
"requires": [
"widget-base"
]
},
"widget-buttons": {
"requires": [
"button-plugin",
"cssbutton",
"widget-stdmod"
]
},
"widget-child": {
"requires": [
"base-build",
"widget"
]
},
"widget-htmlparser": {
"requires": [
"widget-base"
]
},
"widget-locale": {
"requires": [
"widget-base"
]
},
"widget-modality": {
"requires": [
"base-build",
"event-outside",
"widget"
],
"skinnable": true
},
"widget-parent": {
"requires": [
"arraylist",
"base-build",
"widget"
]
},
"widget-position": {
"requires": [
"base-build",
"node-screen",
"widget"
]
},
"widget-position-align": {
"requires": [
"widget-position"
]
},
"widget-position-constrain": {
"requires": [
"widget-position"
]
},
"widget-skin": {
"requires": [
"widget-base"
]
},
"widget-stack": {
"requires": [
"base-build",
"widget"
],
"skinnable": true
},
"widget-stdmod": {
"requires": [
"base-build",
"widget"
]
},
"widget-uievents": {
"requires": [
"node-event-delegate",
"widget-base"
]
},
"yql": {
"requires": [
"jsonp",
"jsonp-url"
]
},
"yui": {},
"yui-base": {},
"yui-later": {
"requires": [
"yui-base"
]
},
"yui-log": {
"requires": [
"yui-base"
]
},
"yui-rls": {},
"yui-throttle": {
"requires": [
"yui-base"
]
}
};
YUI.Env[Y.version].md5 = 'f5a3bc9bda2441a3b15fb52c567fc1f7';
}, '@VERSION@' ,{requires:['loader-base']});
YUI.add('yui', function(Y){}, '@VERSION@' ,{use:['yui-base','get','features','intl-base','yui-log','yui-log-nodejs','yui-later','loader-base', 'loader-rollup', 'loader-yui3']});
| alkutin/cdnjs | ajax/libs/yui/3.5.0/yui-nodejs/yui-nodejs-debug.js | JavaScript | mit | 281,502 |
/**
* @license
* Lo-Dash 2.3.0 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
* Build: `lodash backbone -o ./dist/lodash.backbone.js`
*/
;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++t<e;)if(n[t]===r)return t;return-1}function r(n,r){var t=n.m,e=r.m;if(t!==e){if(t>e||typeof t=="undefined")return 1;if(t<e||typeof e=="undefined")return-1}return n.n-r.n}function t(n,r,t){r||(r=0),typeof t=="undefined"&&(t=n?n.length:0);var e=-1;t=t-r||0;for(var u=Array(0>t?0:t);++e<t;)u[e]=n[r+e];return u}function e(n){return n instanceof e?n:new u(n)}function u(n,r){this.__chain__=!!r,this.__wrapped__=n}function o(n){function r(){if(e){var n=e.slice();
cr.apply(n,arguments)}if(this instanceof r){var o=f(t.prototype),n=t.apply(o,n||arguments);return _(n)?n:o}return t.apply(u,n||arguments)}var t=n[0],e=n[2],u=n[4];return r}function f(n){return _(n)?pr(n):{}}function i(n,r,t){if(typeof n!="function")return D;if(typeof r=="undefined"||!("prototype"in n))return n;switch(t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,e){return n.call(r,t,e)};case 3:return function(t,e,u){return n.call(r,t,e,u)};case 4:return function(t,e,u,o){return n.call(r,t,e,u,o)
}}return N(n,r)}function a(n){function r(){var n=p?c:this;if(o){var g=o.slice();cr.apply(g,arguments)}return(i||v)&&(g||(g=t(arguments)),i&&cr.apply(g,i),v&&g.length<l)?(u|=16,a([e,h?u:-4&u,g,null,c,l])):(g||(g=arguments),s&&(e=n[y]),this instanceof r?(n=f(e.prototype),g=e.apply(n,g),_(g)?g:n):e.apply(n,g))}var e=n[0],u=n[1],o=n[2],i=n[3],c=n[4],l=n[5],p=1&u,s=2&u,v=4&u,h=8&u,y=e;return r}function c(n,r){for(var t=-1,e=y(),u=n?n.length:0,o=[];++t<u;){var f=n[t];0>e(r,f)&&o.push(f)}return o}function l(n,r,t,e){e=(e||0)-1;
for(var u=n?n.length:0,o=[];++e<u;){var f=n[e];if(f&&typeof f=="object"&&typeof f.length=="number"&&(br(f)||g(f))){r||(f=l(f,r,t));var i=-1,a=f.length,c=o.length;for(o.length+=a;++i<a;)o[c++]=f[i]}else t||o.push(f)}return o}function p(n,r,t,u){if(n===r)return 0!==n||1/n==1/r;if(n===n&&!(n&&Y[typeof n]||r&&Y[typeof r]))return false;if(null==n||null==r)return n===r;var o=or.call(n),f=or.call(r);if(o!=f)return false;switch(o){case K:case L:return+n==+r;case Q:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case W:case X:return n==r+""
}if(f=o==J,!f){var i=n instanceof e,a=r instanceof e;if(i||a)return p(i?n.__wrapped__:n,a?r.__wrapped__:r,t,u);if(o!=U)return false;if(o=n.constructor,i=r.constructor,o!=i&&!(d(o)&&o instanceof o&&d(i)&&i instanceof i)&&"constructor"in n&&"constructor"in r)return false}for(t||(t=[]),u||(u=[]),o=t.length;o--;)if(t[o]==n)return u[o]==r;var c=true,l=0;if(t.push(n),u.push(r),f){if(l=r.length,c=l==n.length)for(;l--&&(c=p(n[l],r[l],t,u)););return c}return wr(r,function(r,e,o){return ar.call(o,e)?(l++,!(c=ar.call(n,e)&&p(n[e],r,t,u))&&G):void 0
}),c&&wr(n,function(n,r,t){return ar.call(t,r)?!(c=-1<--l)&&G:void 0}),c}function s(n){return function(r,t,e){var u={};t=z(t,e,3),e=-1;var o=r?r.length:0;if(typeof o=="number")for(;++e<o;){var f=r[e];n(u,f,t(f,e,r),r)}else xr(r,function(r,e,o){n(u,r,t(r,e,o),o)});return u}}function v(n,r,t,e,u,f){var i=16&r,c=32&r;if(!(2&r||d(n)))throw new TypeError;return i&&!t.length&&(r&=-17,t=false),c&&!e.length&&(r&=-33,e=false),(1==r||17===r?o:a)([n,r,t,e,u,f])}function h(n){return _r[n]}function y(){var r=(r=e.indexOf)===q?n:r;
return r}function g(n){return n&&typeof n=="object"&&typeof n.length=="number"&&or.call(n)==H||false}function m(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)n[u]=e[u]}return n}function b(n){var r=[];return wr(n,function(n,t){d(n)&&r.push(t)}),r.sort()}function d(n){return typeof n=="function"}function _(n){return!(!n||!Y[typeof n])}function j(n){return typeof n=="string"||n&&typeof n=="object"&&or.call(n)==X||false}function w(n){for(var r=-1,t=dr(n),e=t.length,u=Array(e);++r<e;)u[r]=n[t[r]];
return u}function x(n,r){var t=y(),e=n?n.length:0,u=false;return e&&typeof e=="number"?u=-1<t(n,r):xr(n,function(n){return(u=n===r)&&G}),u}function A(n,r,t){var e=true;r=z(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&(e=!!r(n[t],t,n)););else xr(n,function(n,t,u){return!(e=!!r(n,t,u))&&G});return e}function O(n,r,t){var e=[];r=z(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u;){var o=n[t];r(o,t,n)&&e.push(o)}else xr(n,function(n,t,u){r(n,t,u)&&e.push(n)});return e}function E(n,r,t){r=z(r,t,3),t=-1;
var e=n?n.length:0;if(typeof e!="number"){var u;return xr(n,function(n,t,e){return r(n,t,e)?(u=n,G):void 0}),u}for(;++t<e;){var o=n[t];if(r(o,t,n))return o}}function R(n,r,t){var e=-1,u=n?n.length:0;if(r=r&&typeof t=="undefined"?r:i(r,t,3),typeof u=="number")for(;++e<u&&r(n[e],e,n)!==G;);else xr(n,r)}function k(n,r){var t=n?n.length:0;if(typeof t=="number")for(;t--&&false!==r(n[t],t,n););else{var e=dr(n),t=e.length;xr(n,function(n,u,o){return u=e?e[--t]:--t,false===r(o[u],u,o)&&G})}}function I(n,r,t){var e=-1,u=n?n.length:0;
if(r=z(r,t,3),typeof u=="number")for(var o=Array(u);++e<u;)o[e]=r(n[e],e,n);else o=[],xr(n,function(n,t,u){o[++e]=r(n,t,u)});return o}function S(n,r,t,e){if(!n)return t;var u=3>arguments.length;r=z(r,e,4);var o=-1,f=n.length;if(typeof f=="number")for(u&&(t=n[++o]);++o<f;)t=r(t,n[o],o,n);else xr(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)});return t}function B(n,r,t,e){var u=3>arguments.length;return r=z(r,e,4),k(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)}),t}function M(n,r,t){var e;r=z(r,t,3),t=-1;var u=n?n.length:0;
if(typeof u=="number")for(;++t<u&&!(e=r(n[t],t,n)););else xr(n,function(n,t,u){return(e=r(n,t,u))&&G});return!!e}function T(n,r,e){var u=0,o=n?n.length:0;if(typeof r!="number"&&null!=r){var f=-1;for(r=z(r,e,3);++f<o&&r(n[f],f,n);)u++}else if(u=r,null==u||e)return n?n[0]:V;return t(n,0,yr(hr(0,u),o))}function q(r,t,e){if(typeof e=="number"){var u=r?r.length:0;e=0>e?hr(0,u+e):e||0}else if(e)return e=F(r,t),r[e]===t?e:-1;return n(r,t,e)}function $(n,r,e){if(typeof r!="number"&&null!=r){var u=0,o=-1,f=n?n.length:0;
for(r=z(r,e,3);++o<f&&r(n[o],o,n);)u++}else u=null==r||e?1:hr(0,r);return t(n,u)}function F(n,r,t,e){var u=0,o=n?n.length:u;for(t=t?z(t,e,1):D,r=t(r);u<o;)e=u+o>>>1,t(n[e])<r?u=e+1:o=e;return u}function N(n,r){return 2<arguments.length?v(n,17,t(arguments,2),null,r):v(n,1,null,null,r)}function z(n,r,t){var e=typeof n;if(null==n||"function"==e)return i(n,r,t);if("object"!=e)return function(r){return r[n]};var u=dr(n);return function(r){for(var t=u.length,e=false;t--&&(e=r[u[t]]===n[u[t]]););return e}}function D(n){return n
}function P(n){R(b(n),function(r){var t=e[r]=n[r];e.prototype[r]=function(){var n=[this.__wrapped__];return cr.apply(n,arguments),n=t.apply(e,n),this.__chain__?new u(n,true):n}})}var V,C=0,G={},H="[object Arguments]",J="[object Array]",K="[object Boolean]",L="[object Date]",Q="[object Number]",U="[object Object]",W="[object RegExp]",X="[object String]",Y={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},Z=Y[typeof window]&&window||this,nr=Y[typeof exports]&&exports&&!exports.nodeType&&exports,rr=Y[typeof module]&&module&&!module.nodeType&&module,tr=rr&&rr.exports===nr&&nr,er=Y[typeof global]&&global;
!er||er.global!==er&&er.window!==er||(Z=er);var ur=[],er=Object.prototype,or=er.toString,fr=RegExp("^"+(or+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),ir=Math.floor,ar=er.hasOwnProperty,cr=ur.push,lr=er.propertyIsEnumerable,pr=fr.test(pr=Object.create)&&pr,sr=fr.test(sr=Array.isArray)&&sr,vr=fr.test(vr=Object.keys)&&vr,hr=Math.max,yr=Math.min,gr=Math.random;u.prototype=e.prototype;var mr={};!function(){var n={0:1,length:1};mr.spliceObjects=(ur.splice.call(n,0,1),!n[0])
}(1),pr||(f=function(){function n(){}return function(r){if(_(r)){n.prototype=r;var t=new n;n.prototype=null}return t||Z.Object()}}()),g(arguments)||(g=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ar.call(n,"callee")&&!lr.call(n,"callee")||false});var br=sr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&or.call(n)==J||false},sr=function(n){var r,t=[];if(!n||!Y[typeof n])return t;for(r in n)ar.call(n,r)&&t.push(r);return t},dr=vr?function(n){return _(n)?vr(n):[]
}:sr,_r={"&":"&","<":"<",">":">",'"':""","'":"'"},jr=RegExp("["+dr(_r).join("")+"]","g"),wr=function(n,r){var t;if(!n||!Y[typeof n])return n;for(t in n)if(r(n[t],t,n)===G)break;return n},xr=function(n,r){var t;if(!n||!Y[typeof n])return n;for(t in n)if(ar.call(n,t)&&r(n[t],t,n)===G)break;return n};d(/x/)&&(d=function(n){return typeof n=="function"&&"[object Function]"==or.call(n)}),sr=s(function(n,r,t){ar.call(n,t)?n[t]++:n[t]=1}),er=s(function(n,r,t){(ar.call(n,t)?n[t]:n[t]=[]).push(r)
}),e.bind=N,e.bindAll=function(n){for(var r=1<arguments.length?l(arguments,true,false,1):b(n),t=-1,e=r.length;++t<e;){var u=r[t];n[u]=v(n[u],1,null,null,n)}return n},e.chain=function(n){return n=new u(n),n.__chain__=true,n},e.countBy=sr,e.defaults=function(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)"undefined"==typeof n[u]&&(n[u]=e[u])}return n},e.difference=function(n){return c(n,l(arguments,true,true,1))},e.filter=O,e.forEach=R,e.functions=b,e.groupBy=er,e.initial=function(n,r,e){var u=0,o=n?n.length:0;
if(typeof r!="number"&&null!=r){var f=o;for(r=z(r,e,3);f--&&r(n[f],f,n);)u++}else u=null==r||e?1:r||u;return t(n,0,yr(hr(0,o-u),o))},e.invert=function(n){for(var r=-1,t=dr(n),e=t.length,u={};++r<e;){var o=t[r];u[n[o]]=o}return u},e.invoke=function(n,r){var e=t(arguments,2),u=-1,o=typeof r=="function",f=n?n.length:0,i=Array(typeof f=="number"?f:0);return R(n,function(n){i[++u]=(o?r:n[r]).apply(n,e)}),i},e.keys=dr,e.map=I,e.max=function(n,r,t){var e=-1/0,u=e;typeof r!="function"&&t&&t[r]===n&&(r=null);
var o=-1,f=n?n.length:0;if(null==r&&typeof f=="number")for(;++o<f;)t=n[o],t>u&&(u=t);else r=z(r,t,3),R(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u},e.min=function(n,r,t){var e=1/0,u=e;typeof r!="function"&&t&&t[r]===n&&(r=null);var o=-1,f=n?n.length:0;if(null==r&&typeof f=="number")for(;++o<f;)t=n[o],t<u&&(u=t);else r=z(r,t,3),R(n,function(n,t,o){t=r(n,t,o),t<e&&(e=t,u=n)});return u},e.omit=function(n){var r=[];wr(n,function(n,t){r.push(t)});for(var r=c(r,l(arguments,true,false,1)),t=-1,e=r.length,u={};++t<e;){var o=r[t];
u[o]=n[o]}return u},e.once=function(n){var r,t;if(!d(n))throw new TypeError;return function(){return r?t:(r=true,t=n.apply(this,arguments),n=null,t)}},e.pairs=function(n){for(var r=-1,t=dr(n),e=t.length,u=Array(e);++r<e;){var o=t[r];u[r]=[o,n[o]]}return u},e.pick=function(n){for(var r=-1,t=l(arguments,true,false,1),e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o])}return u},e.reject=function(n,r,t){return r=z(r,t,3),O(n,function(n,t,e){return!r(n,t,e)})},e.rest=$,e.shuffle=function(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);
return R(n,function(n){var t;t=++r,t=0+ir(gr()*(t-0+1)),e[r]=e[t],e[t]=n}),e},e.sortBy=function(n,t,e){var u=-1,o=n?n.length:0,f=Array(typeof o=="number"?o:0);for(t=z(t,e,3),R(n,function(n,r,e){f[++u]={m:t(n,r,e),n:u,o:n}}),o=f.length,f.sort(r);o--;)f[o]=f[o].o;return f},e.toArray=function(n){return br(n)?t(n):n&&typeof n.length=="number"?I(n):w(n)},e.values=w,e.without=function(n){return c(n,t(arguments,1))},e.collect=I,e.drop=$,e.each=R,e.extend=m,e.methods=b,e.select=O,e.tail=$,e.clone=function(n){return _(n)?br(n)?t(n):m({},n):n
},e.contains=x,e.escape=function(n){return null==n?"":(n+"").replace(jr,h)},e.every=A,e.find=E,e.has=function(n,r){return n?ar.call(n,r):false},e.identity=D,e.indexOf=q,e.isArguments=g,e.isArray=br,e.isEmpty=function(n){if(!n)return true;if(br(n)||j(n))return!n.length;for(var r in n)if(ar.call(n,r))return false;return true},e.isEqual=function(n,r){return p(n,r)},e.isFunction=d,e.isObject=_,e.isRegExp=function(n){return n&&Y[typeof n]&&or.call(n)==W||false},e.isString=j,e.lastIndexOf=function(n,r,t){var e=n?n.length:0;
for(typeof t=="number"&&(e=(0>t?hr(0,e+t):yr(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},e.mixin=P,e.reduce=S,e.reduceRight=B,e.result=function(n,r){if(n){var t=n[r];return d(t)?n[r]():t}},e.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:dr(n).length},e.some=M,e.sortedIndex=F,e.uniqueId=function(n){var r=++C+"";return n?n+r:r},e.all=A,e.any=M,e.detect=E,e.foldl=S,e.foldr=B,e.include=x,e.inject=S,e.first=T,e.last=function(n,r,e){var u=0,o=n?n.length:0;if(typeof r!="number"&&null!=r){var f=o;
for(r=z(r,e,3);f--&&r(n[f],f,n);)u++}else if(u=r,null==u||e)return n?n[o-1]:V;return t(n,hr(0,o-u))},e.take=T,e.head=T,P(e),e.VERSION="2.3.0",e.prototype.chain=function(){return this.__chain__=true,this},e.prototype.value=function(){return this.__wrapped__},R("pop push reverse shift sort splice unshift".split(" "),function(n){var r=ur[n];e.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),mr.spliceObjects||0!==n.length||delete n[0],this}}),R(["concat","join","slice"],function(n){var r=ur[n];
e.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new u(n),n.__chain__=true),n}}),nr&&rr?tr?(rr.exports=e)._=e:nr._=e:Z._=e}).call(this); | lxsli/cdnjs | ajax/libs/lodash.js/2.3.0/lodash.backbone.min.js | JavaScript | mit | 13,173 |
YUI.add('datatype-number-parse', function(Y) {
/**
* Parse number submodule.
*
* @module datatype
* @submodule datatype-number-parse
* @for DataType.Number
*/
var LANG = Y.Lang;
Y.mix(Y.namespace("DataType.Number"), {
/**
* Converts data to type Number.
*
* @method parse
* @param data {String | Number | Boolean} Data to convert. The following
* values return as null: null, undefined, NaN, "".
* @return {Number} A number, or null.
*/
parse: function(data) {
var number = (data === null) ? data : +data;
if(LANG.isNumber(number)) {
return number;
}
else {
Y.log("Could not parse data " + Y.dump(data) + " to type Number", "warn", "datatype-number");
return null;
}
}
});
// Add Parsers shortcut
Y.namespace("Parsers").number = Y.DataType.Number.parse;
}, '@VERSION@' );
YUI.add('datatype-number-format', function(Y) {
/**
* Number submodule.
*
* @module datatype
* @submodule datatype-number
*/
/**
* Format number submodule.
*
* @module datatype
* @submodule datatype-number-format
*/
/**
* DataType.Number provides a set of utility functions to operate against Number objects.
*
* @class DataType.Number
* @static
*/
var LANG = Y.Lang;
Y.mix(Y.namespace("DataType.Number"), {
/**
* Takes a Number and formats to string for display to user.
*
* @method format
* @param data {Number} Number.
* @param config {Object} (Optional) Optional configuration values:
* <dl>
* <dt>prefix {String}</dd>
* <dd>String prepended before each number, like a currency designator "$"</dd>
* <dt>decimalPlaces {Number}</dd>
* <dd>Number of decimal places to round. Must be a number 0 to 20.</dd>
* <dt>decimalSeparator {String}</dd>
* <dd>Decimal separator</dd>
* <dt>thousandsSeparator {String}</dd>
* <dd>Thousands separator</dd>
* <dt>suffix {String}</dd>
* <dd>String appended after each number, like " items" (note the space)</dd>
* </dl>
* @return {String} Formatted number for display. Note, the following values
* return as "": null, undefined, NaN, "".
*/
format: function(data, config) {
if(LANG.isNumber(data)) {
config = config || {};
var isNeg = (data < 0),
output = data + "",
decPlaces = config.decimalPlaces,
decSep = config.decimalSeparator || ".",
thouSep = config.thousandsSeparator,
decIndex,
newOutput, count, i;
// Decimal precision
if(LANG.isNumber(decPlaces) && (decPlaces >= 0) && (decPlaces <= 20)) {
// Round to the correct decimal place
output = data.toFixed(decPlaces);
}
// Decimal separator
if(decSep !== "."){
output = output.replace(".", decSep);
}
// Add the thousands separator
if(thouSep) {
// Find the dot or where it would be
decIndex = output.lastIndexOf(decSep);
decIndex = (decIndex > -1) ? decIndex : output.length;
// Start with the dot and everything to the right
newOutput = output.substring(decIndex);
// Working left, every third time add a separator, every time add a digit
for (count = 0, i=decIndex; i>0; i--) {
if ((count%3 === 0) && (i !== decIndex) && (!isNeg || (i > 1))) {
newOutput = thouSep + newOutput;
}
newOutput = output.charAt(i-1) + newOutput;
count++;
}
output = newOutput;
}
// Prepend prefix
output = (config.prefix) ? config.prefix + output : output;
// Append suffix
output = (config.suffix) ? output + config.suffix : output;
return output;
}
// Not a Number, just return as string
else {
Y.log("Could not format data " + Y.dump(data) + " from type Number", "warn", "datatype-number");
return (LANG.isValue(data) && data.toString) ? data.toString() : "";
}
}
});
}, '@VERSION@' );
YUI.add('datatype-number', function(Y){}, '@VERSION@' ,{use:['datatype-number-parse', 'datatype-number-format']});
| fbender/cdnjs | ajax/libs/yui/3.0.0/datatype/datatype-number-debug.js | JavaScript | mit | 4,503 |
YUI.add('datatype-xml-format', function(Y) {
/**
* Format XML submodule.
*
* @module datatype
* @submodule datatype-xml-format
*/
/**
* XML submodule.
*
* @module datatype
* @submodule datatype-xml
*/
/**
* DataType.XML provides a set of utility functions to operate against XML documents.
*
* @class DataType.XML
* @static
*/
var LANG = Y.Lang;
Y.mix(Y.namespace("DataType.XML"), {
/**
* Converts data to type XMLDocument.
*
* @method format
* @param data {XMLDoc} Data to convert.
* @return {String} String.
*/
format: function(data) {
try {
if(!LANG.isUndefined(XMLSerializer)) {
return (new XMLSerializer()).serializeToString(data);
}
}
catch(e) {
if(data && data.xml) {
return data.xml;
}
else {
Y.log("Could not format data " + Y.dump(data) + " from type XML", "warn", "datatype-xml");
return (LANG.isValue(data) && data.toString) ? data.toString() : "";
}
}
}
});
}, '@VERSION@' );
| sujonvidia/cdnjs | ajax/libs/yui/3.0.0/datatype/datatype-xml-format-debug.js | JavaScript | mit | 1,122 |
YUI.add('dd-drag', function(Y) {
/**
* Provides the ability to drag a Node.
* @module dd
* @submodule dd-drag
*/
/**
* Provides the ability to drag a Node.
* @class Drag
* @extends Base
* @constructor
* @namespace DD
*/
var DDM = Y.DD.DDM,
NODE = 'node',
DRAGGING = 'dragging',
DRAG_NODE = 'dragNode',
OFFSET_HEIGHT = 'offsetHeight',
OFFSET_WIDTH = 'offsetWidth',
/**
* @event drag:mouseup
* @description Handles the mouseup DOM event, does nothing internally just fires.
* @bubbles DDM
* @type {CustomEvent}
*/
/**
* @event drag:mouseDown
* @description Handles the mousedown DOM event, checks to see if you have a valid handle then starts the drag timers.
* @preventable _defMouseDownFn
* @param {EventFacade} event An Event Facade object with the following specific property added:
* <dl><dt>ev</dt><dd>The original mousedown event.</dd></dl>
* @bubbles DDM
* @type {CustomEvent}
*/
EV_MOUSE_DOWN = 'drag:mouseDown',
/**
* @event drag:afterMouseDown
* @description Fires after the mousedown event has been cleared.
* @param {EventFacade} event An Event Facade object with the following specific property added:
* <dl><dt>ev</dt><dd>The original mousedown event.</dd></dl>
* @bubbles DDM
* @type {CustomEvent}
*/
EV_AFTER_MOUSE_DOWN = 'drag:afterMouseDown',
/**
* @event drag:removeHandle
* @description Fires after a handle is removed.
* @param {EventFacade} event An Event Facade object with the following specific property added:
* <dl><dt>handle</dt><dd>The handle that was removed.</dd></dl>
* @bubbles DDM
* @type {CustomEvent}
*/
EV_REMOVE_HANDLE = 'drag:removeHandle',
/**
* @event drag:addHandle
* @description Fires after a handle is added.
* @param {EventFacade} event An Event Facade object with the following specific property added:
* <dl><dt>handle</dt><dd>The handle that was added.</dd></dl>
* @bubbles DDM
* @type {CustomEvent}
*/
EV_ADD_HANDLE = 'drag:addHandle',
/**
* @event drag:removeInvalid
* @description Fires after an invalid selector is removed.
* @param {EventFacade} event An Event Facade object with the following specific property added:
* <dl><dt>handle</dt><dd>The handle that was removed.</dd></dl>
* @bubbles DDM
* @type {CustomEvent}
*/
EV_REMOVE_INVALID = 'drag:removeInvalid',
/**
* @event drag:addInvalid
* @description Fires after an invalid selector is added.
* @param {EventFacade} event An Event Facade object with the following specific property added:
* <dl><dt>handle</dt><dd>The handle that was added.</dd></dl>
* @bubbles DDM
* @type {CustomEvent}
*/
EV_ADD_INVALID = 'drag:addInvalid',
/**
* @event drag:start
* @description Fires at the start of a drag operation.
* @param {EventFacade} event An Event Facade object with the following specific property added:
* <dl>
* <dt>pageX</dt><dd>The original node position X.</dd>
* <dt>pageY</dt><dd>The original node position Y.</dd>
* <dt>startTime</dt><dd>The startTime of the event. getTime on the current Date object.</dd>
* </dl>
* @bubbles DDM
* @type {CustomEvent}
*/
EV_START = 'drag:start',
/**
* @event drag:end
* @description Fires at the end of a drag operation.
* @param {EventFacade} event An Event Facade object with the following specific property added:
* <dl>
* <dt>pageX</dt><dd>The current node position X.</dd>
* <dt>pageY</dt><dd>The current node position Y.</dd>
* <dt>startTime</dt><dd>The startTime of the event, from the start event.</dd>
* <dt>endTime</dt><dd>The endTime of the event. getTime on the current Date object.</dd>
* </dl>
* @bubbles DDM
* @type {CustomEvent}
*/
EV_END = 'drag:end',
/**
* @event drag:drag
* @description Fires every mousemove during a drag operation.
* @param {EventFacade} event An Event Facade object with the following specific property added:
* <dl>
* <dt>pageX</dt><dd>The current node position X.</dd>
* <dt>pageY</dt><dd>The current node position Y.</dd>
* <dt>scroll</dt><dd>Should a scroll action occur.</dd>
* <dt>info</dt><dd>Object hash containing calculated XY arrays: start, xy, delta, offset</dd>
* </dl>
* @bubbles DDM
* @type {CustomEvent}
*/
EV_DRAG = 'drag:drag',
/**
* @event drag:align
* @preventable _defAlignFn
* @description Fires when this node is aligned.
* @param {EventFacade} event An Event Facade object with the following specific property added:
* <dl>
* <dt>pageX</dt><dd>The current node position X.</dd>
* <dt>pageY</dt><dd>The current node position Y.</dd>
* </dl>
* @bubbles DDM
* @type {CustomEvent}
*/
EV_ALIGN = 'drag:align',
/**
* @event drag:over
* @description Fires when this node is over a Drop Target. (Fired from dd-drop)
* @param {EventFacade} event An Event Facade object with the following specific property added:
* <dl>
* <dt>drop</dt><dd>The drop object at the time of the event.</dd>
* <dt>drag</dt><dd>The drag object at the time of the event.</dd>
* </dl>
* @bubbles DDM
* @type {CustomEvent}
*/
/**
* @event drag:enter
* @description Fires when this node enters a Drop Target. (Fired from dd-drop)
* @param {EventFacade} event An Event Facade object with the following specific property added:
* <dl>
* <dt>drop</dt><dd>The drop object at the time of the event.</dd>
* <dt>drag</dt><dd>The drag object at the time of the event.</dd>
* </dl>
* @bubbles DDM
* @type {CustomEvent}
*/
/**
* @event drag:exit
* @description Fires when this node exits a Drop Target. (Fired from dd-drop)
* @param {EventFacade} event An Event Facade object with the following specific property added:
* <dl>
* <dt>drop</dt><dd>The drop object at the time of the event.</dd>
* </dl>
* @bubbles DDM
* @type {CustomEvent}
*/
/**
* @event drag:drophit
* @description Fires when this node is dropped on a valid Drop Target. (Fired from dd-ddm-drop)
* @param {EventFacade} event An Event Facade object with the following specific property added:
* <dl>
* <dt>drop</dt><dd>The best guess on what was dropped on.</dd>
* <dt>drag</dt><dd>The drag object at the time of the event.</dd>
* <dt>others</dt><dd>An array of all the other drop targets that was dropped on.</dd>
* </dl>
* @bubbles DDM
* @type {CustomEvent}
*/
/**
* @event drag:dropmiss
* @description Fires when this node is dropped on an invalid Drop Target. (Fired from dd-ddm-drop)
* @param {EventFacade} event An Event Facade object with the following specific property added:
* <dl>
* <dt>pageX</dt><dd>The current node position X.</dd>
* <dt>pageY</dt><dd>The current node position Y.</dd>
* </dl>
* @bubbles DDM
* @type {CustomEvent}
*/
Drag = function(o) {
this._lazyAddAttrs = false;
Drag.superclass.constructor.apply(this, arguments);
var valid = DDM._regDrag(this);
if (!valid) {
Y.error('Failed to register node, already in use: ' + o.node);
}
};
Drag.NAME = 'drag';
/**
* This property defaults to "mousedown", but when drag-gestures is loaded, it is changed to "gesturemovestart"
* @static
* @property START_EVENT
*/
Drag.START_EVENT = 'mousedown';
Drag.ATTRS = {
/**
* @attribute node
* @description Y.Node instance to use as the element to initiate a drag operation
* @type Node
*/
node: {
setter: function(node) {
if (this._canDrag(node)) {
return node;
}
var n = Y.one(node);
if (!n) {
Y.error('DD.Drag: Invalid Node Given: ' + node);
}
return n;
}
},
/**
* @attribute dragNode
* @description Y.Node instance to use as the draggable element, defaults to node
* @type Node
*/
dragNode: {
setter: function(node) {
if (this._canDrag(node)) {
return node;
}
var n = Y.one(node);
if (!n) {
Y.error('DD.Drag: Invalid dragNode Given: ' + node);
}
return n;
}
},
/**
* @attribute offsetNode
* @description Offset the drag element by the difference in cursor position: default true
* @type Boolean
*/
offsetNode: {
value: true
},
/**
* @attribute startCentered
* @description Center the dragNode to the mouse position on drag:start: default false
* @type Boolean
*/
startCentered: {
value: false
},
/**
* @attribute clickPixelThresh
* @description The number of pixels to move to start a drag operation, default is 3.
* @type Number
*/
clickPixelThresh: {
value: DDM.get('clickPixelThresh')
},
/**
* @attribute clickTimeThresh
* @description The number of milliseconds a mousedown has to pass to start a drag operation, default is 1000.
* @type Number
*/
clickTimeThresh: {
value: DDM.get('clickTimeThresh')
},
/**
* @attribute lock
* @description Set to lock this drag element so that it can't be dragged: default false.
* @type Boolean
*/
lock: {
value: false,
setter: function(lock) {
if (lock) {
this.get(NODE).addClass(DDM.CSS_PREFIX + '-locked');
} else {
this.get(NODE).removeClass(DDM.CSS_PREFIX + '-locked');
}
return lock;
}
},
/**
* @attribute data
* @description A payload holder to store arbitrary data about this drag object, can be used to store any value.
* @type Mixed
*/
data: {
value: false
},
/**
* @attribute move
* @description If this is false, the drag element will not move with the cursor: default true. Can be used to "resize" the element.
* @type Boolean
*/
move: {
value: true
},
/**
* @attribute useShim
* @description Use the protective shim on all drag operations: default true. Only works with dd-ddm, not dd-ddm-base.
* @type Boolean
*/
useShim: {
value: true
},
/**
* @attribute activeHandle
* @description This config option is set by Drag to inform you of which handle fired the drag event (in the case that there are several handles): default false.
* @type Node
*/
activeHandle: {
value: false
},
/**
* @attribute primaryButtonOnly
* @description By default a drag operation will only begin if the mousedown occurred with the primary mouse button. Setting this to false will allow for all mousedown events to trigger a drag.
* @type Boolean
*/
primaryButtonOnly: {
value: true
},
/**
* @attribute dragging
* @description This attribute is not meant to be used by the implementor, it is meant to be used as an Event tracker so you can listen for it to change.
* @type Boolean
*/
dragging: {
value: false
},
parent: {
value: false
},
/**
* @attribute target
* @description This attribute only works if the dd-drop module has been loaded. It will make this node a drop target as well as draggable.
* @type Boolean
*/
target: {
value: false,
setter: function(config) {
this._handleTarget(config);
return config;
}
},
/**
* @attribute dragMode
* @description This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of this Drag instance.
* @type String
*/
dragMode: {
value: null,
setter: function(mode) {
return DDM._setDragMode(mode);
}
},
/**
* @attribute groups
* @description Array of groups to add this drag into.
* @type Array
*/
groups: {
value: ['default'],
getter: function() {
if (!this._groups) {
this._groups = {};
}
var ret = [];
Y.each(this._groups, function(v, k) {
ret[ret.length] = k;
});
return ret;
},
setter: function(g) {
this._groups = {};
Y.each(g, function(v, k) {
this._groups[v] = true;
}, this);
return g;
}
},
/**
* @attribute handles
* @description Array of valid handles to add. Adding something here will set all handles, even if previously added with addHandle
* @type Array
*/
handles: {
value: null,
setter: function(g) {
if (g) {
this._handles = {};
Y.each(g, function(v, k) {
var key = v;
if (v instanceof Y.Node || v instanceof Y.NodeList) {
key = v._yuid;
}
this._handles[key] = v;
}, this);
} else {
this._handles = null;
}
return g;
}
},
/**
* @deprecated
* @attribute bubbles
* @description Controls the default bubble parent for this Drag instance. Default: Y.DD.DDM. Set to false to disable bubbling. Use bubbleTargets in config
* @type Object
*/
bubbles: {
setter: function(t) {
Y.log('bubbles is deprecated use bubbleTargets: HOST', 'warn', 'dd');
this.addTarget(t);
return t;
}
},
/**
* @attribute haltDown
* @description Should the mousedown event be halted. Default: true
* @type Boolean
*/
haltDown: {
value: true
}
};
Y.extend(Drag, Y.Base, {
/**
* Checks the object for the methods needed to drag the object around.
* Normally this would be a node instance, but in the case of Graphics, it
* may be an SVG node or something similar.
* @method _canDrag
* @private
* @param {Object} n The object to check
* @return {Boolean} True or false if the Object contains the methods needed to Drag
*/
_canDrag: function(n) {
if (n && n.setXY && n.getXY && n.test && n.contains) {
return true;
}
return false;
},
/**
* @private
* @property _bubbleTargets
* @description The default bubbleTarget for this object. Default: Y.DD.DDM
*/
_bubbleTargets: Y.DD.DDM,
/**
* @method addToGroup
* @description Add this Drag instance to a group, this should be used for on-the-fly group additions.
* @param {String} g The group to add this Drag Instance to.
* @return {Self}
* @chainable
*/
addToGroup: function(g) {
this._groups[g] = true;
DDM._activateTargets();
return this;
},
/**
* @method removeFromGroup
* @description Remove this Drag instance from a group, this should be used for on-the-fly group removals.
* @param {String} g The group to remove this Drag Instance from.
* @return {Self}
* @chainable
*/
removeFromGroup: function(g) {
delete this._groups[g];
DDM._activateTargets();
return this;
},
/**
* @property target
* @description This will be a reference to the Drop instance associated with this drag if the target: true config attribute is set..
* @type {Object}
*/
target: null,
/**
* @private
* @method _handleTarget
* @description Attribute handler for the target config attribute.
* @param {Boolean/Object} config The Config
*/
_handleTarget: function(config) {
if (Y.DD.Drop) {
if (config === false) {
if (this.target) {
DDM._unregTarget(this.target);
this.target = null;
}
return false;
} else {
if (!Y.Lang.isObject(config)) {
config = {};
}
config.bubbleTargets = ('bubbleTargets' in config) ? config.bubbleTargets : Y.Object.values(this._yuievt.targets);
config.node = this.get(NODE);
config.groups = config.groups || this.get('groups');
this.target = new Y.DD.Drop(config);
}
} else {
return false;
}
},
/**
* @private
* @property _groups
* @description Storage Array for the groups this drag belongs to.
* @type {Array}
*/
_groups: null,
/**
* @private
* @method _createEvents
* @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling.
*/
_createEvents: function() {
this.publish(EV_MOUSE_DOWN, {
defaultFn: this._defMouseDownFn,
queuable: false,
emitFacade: true,
bubbles: true,
prefix: 'drag'
});
this.publish(EV_ALIGN, {
defaultFn: this._defAlignFn,
queuable: false,
emitFacade: true,
bubbles: true,
prefix: 'drag'
});
this.publish(EV_DRAG, {
defaultFn: this._defDragFn,
queuable: false,
emitFacade: true,
bubbles: true,
prefix: 'drag'
});
this.publish(EV_END, {
defaultFn: this._defEndFn,
preventedFn: this._prevEndFn,
queuable: false,
emitFacade: true,
bubbles: true,
prefix: 'drag'
});
var ev = [
EV_AFTER_MOUSE_DOWN,
EV_REMOVE_HANDLE,
EV_ADD_HANDLE,
EV_REMOVE_INVALID,
EV_ADD_INVALID,
EV_START,
'drag:drophit',
'drag:dropmiss',
'drag:over',
'drag:enter',
'drag:exit'
];
Y.each(ev, function(v, k) {
this.publish(v, {
type: v,
emitFacade: true,
bubbles: true,
preventable: false,
queuable: false,
prefix: 'drag'
});
}, this);
},
/**
* @private
* @property _ev_md
* @description A private reference to the mousedown DOM event
* @type {EventFacade}
*/
_ev_md: null,
/**
* @private
* @property _startTime
* @description The getTime of the mousedown event. Not used, just here in case someone wants/needs to use it.
* @type Date
*/
_startTime: null,
/**
* @private
* @property _endTime
* @description The getTime of the mouseup event. Not used, just here in case someone wants/needs to use it.
* @type Date
*/
_endTime: null,
/**
* @private
* @property _handles
* @description A private hash of the valid drag handles
* @type {Object}
*/
_handles: null,
/**
* @private
* @property _invalids
* @description A private hash of the invalid selector strings
* @type {Object}
*/
_invalids: null,
/**
* @private
* @property _invalidsDefault
* @description A private hash of the default invalid selector strings: {'textarea': true, 'input': true, 'a': true, 'button': true, 'select': true}
* @type {Object}
*/
_invalidsDefault: {'textarea': true, 'input': true, 'a': true, 'button': true, 'select': true },
/**
* @private
* @property _dragThreshMet
* @description Private flag to see if the drag threshhold was met
* @type {Boolean}
*/
_dragThreshMet: null,
/**
* @private
* @property _fromTimeout
* @description Flag to determine if the drag operation came from a timeout
* @type {Boolean}
*/
_fromTimeout: null,
/**
* @private
* @property _clickTimeout
* @description Holder for the setTimeout call
* @type {Boolean}
*/
_clickTimeout: null,
/**
* @property deltaXY
* @description The offset of the mouse position to the element's position
* @type {Array}
*/
deltaXY: null,
/**
* @property startXY
* @description The initial mouse position
* @type {Array}
*/
startXY: null,
/**
* @property nodeXY
* @description The initial element position
* @type {Array}
*/
nodeXY: null,
/**
* @property lastXY
* @description The position of the element as it's moving (for offset calculations)
* @type {Array}
*/
lastXY: null,
/**
* @property actXY
* @description The xy that the node will be set to. Changing this will alter the position as it's dragged.
* @type {Array}
*/
actXY: null,
/**
* @property realXY
* @description The real xy position of the node.
* @type {Array}
*/
realXY: null,
/**
* @property mouseXY
* @description The XY coords of the mousemove
* @type {Array}
*/
mouseXY: null,
/**
* @property region
* @description A region object associated with this drag, used for checking regions while dragging.
* @type Object
*/
region: null,
/**
* @private
* @method _handleMouseUp
* @description Handler for the mouseup DOM event
* @param {EventFacade} ev The Event
*/
_handleMouseUp: function(ev) {
this.fire('drag:mouseup');
this._fixIEMouseUp();
if (DDM.activeDrag) {
DDM._end();
}
},
/**
* @private
* @method _fixDragStart
* @description The function we use as the ondragstart handler when we start a drag in Internet Explorer. This keeps IE from blowing up on images as drag handles.
* @param {Event} e The Event
*/
_fixDragStart: function(e) {
e.preventDefault();
},
/**
* @private
* @method _ieSelectFix
* @description The function we use as the onselectstart handler when we start a drag in Internet Explorer
*/
_ieSelectFix: function() {
return false;
},
/**
* @private
* @property _ieSelectBack
* @description We will hold a copy of the current "onselectstart" method on this property, and reset it after we are done using it.
*/
_ieSelectBack: null,
/**
* @private
* @method _fixIEMouseDown
* @description This method copies the onselectstart listner on the document to the _ieSelectFix property
*/
_fixIEMouseDown: function(e) {
if (Y.UA.ie) {
this._ieSelectBack = Y.config.doc.body.onselectstart;
Y.config.doc.body.onselectstart = this._ieSelectFix;
}
},
/**
* @private
* @method _fixIEMouseUp
* @description This method copies the _ieSelectFix property back to the onselectstart listner on the document.
*/
_fixIEMouseUp: function() {
if (Y.UA.ie) {
Y.config.doc.body.onselectstart = this._ieSelectBack;
}
},
/**
* @private
* @method _handleMouseDownEvent
* @description Handler for the mousedown DOM event
* @param {EventFacade} ev The Event
*/
_handleMouseDownEvent: function(ev) {
this.fire(EV_MOUSE_DOWN, { ev: ev });
},
/**
* @private
* @method _defMouseDownFn
* @description Handler for the mousedown DOM event
* @param {EventFacade} e The Event
*/
_defMouseDownFn: function(e) {
var ev = e.ev;
this._dragThreshMet = false;
this._ev_md = ev;
if (this.get('primaryButtonOnly') && ev.button > 1) {
return false;
}
if (this.validClick(ev)) {
this._fixIEMouseDown(ev);
if (this.get('haltDown')) {
Y.log('Halting MouseDown', 'info', 'drag');
ev.halt();
} else {
Y.log('Preventing Default on MouseDown', 'info', 'drag');
ev.preventDefault();
}
this._setStartPosition([ev.pageX, ev.pageY]);
DDM.activeDrag = this;
this._clickTimeout = Y.later(this.get('clickTimeThresh'), this, this._timeoutCheck);
}
this.fire(EV_AFTER_MOUSE_DOWN, { ev: ev });
},
/**
* @method validClick
* @description Method first checks to see if we have handles, if so it validates the click against the handle. Then if it finds a valid handle, it checks it against the invalid handles list. Returns true if a good handle was used, false otherwise.
* @param {EventFacade} ev The Event
* @return {Boolean}
*/
validClick: function(ev) {
var r = false, n = false,
tar = ev.target,
hTest = null,
els = null,
nlist = null,
set = false;
if (this._handles) {
Y.each(this._handles, function(i, n) {
if (i instanceof Y.Node || i instanceof Y.NodeList) {
if (!r) {
nlist = i;
if (nlist instanceof Y.Node) {
nlist = new Y.NodeList(i._node);
}
nlist.each(function(nl) {
if (nl.contains(tar)) {
r = true;
}
});
}
} else if (Y.Lang.isString(n)) {
//Am I this or am I inside this
if (tar.test(n + ', ' + n + ' *') && !hTest) {
hTest = n;
r = true;
}
}
});
} else {
n = this.get(NODE);
if (n.contains(tar) || n.compareTo(tar)) {
r = true;
}
}
if (r) {
if (this._invalids) {
Y.each(this._invalids, function(i, n) {
if (Y.Lang.isString(n)) {
//Am I this or am I inside this
if (tar.test(n + ', ' + n + ' *')) {
r = false;
}
}
});
}
}
if (r) {
if (hTest) {
els = ev.currentTarget.all(hTest);
set = false;
els.each(function(n, i) {
if ((n.contains(tar) || n.compareTo(tar)) && !set) {
set = true;
this.set('activeHandle', n);
}
}, this);
} else {
this.set('activeHandle', this.get(NODE));
}
}
return r;
},
/**
* @private
* @method _setStartPosition
* @description Sets the current position of the Element and calculates the offset
* @param {Array} xy The XY coords to set the position to.
*/
_setStartPosition: function(xy) {
this.startXY = xy;
this.nodeXY = this.lastXY = this.realXY = this.get(NODE).getXY();
if (this.get('offsetNode')) {
this.deltaXY = [(this.startXY[0] - this.nodeXY[0]), (this.startXY[1] - this.nodeXY[1])];
} else {
this.deltaXY = [0, 0];
}
},
/**
* @private
* @method _timeoutCheck
* @description The method passed to setTimeout to determine if the clickTimeThreshold was met.
*/
_timeoutCheck: function() {
if (!this.get('lock') && !this._dragThreshMet && this._ev_md) {
this._fromTimeout = this._dragThreshMet = true;
this.start();
this._alignNode([this._ev_md.pageX, this._ev_md.pageY], true);
}
},
/**
* @method removeHandle
* @description Remove a Selector added by addHandle
* @param {String} str The selector for the handle to be removed.
* @return {Self}
* @chainable
*/
removeHandle: function(str) {
var key = str;
if (str instanceof Y.Node || str instanceof Y.NodeList) {
key = str._yuid;
}
if (this._handles[key]) {
delete this._handles[key];
this.fire(EV_REMOVE_HANDLE, { handle: str });
}
return this;
},
/**
* @method addHandle
* @description Add a handle to a drag element. Drag only initiates when a mousedown happens on this element.
* @param {String} str The selector to test for a valid handle. Must be a child of the element.
* @return {Self}
* @chainable
*/
addHandle: function(str) {
if (!this._handles) {
this._handles = {};
}
var key = str;
if (str instanceof Y.Node || str instanceof Y.NodeList) {
key = str._yuid;
}
this._handles[key] = str;
this.fire(EV_ADD_HANDLE, { handle: str });
return this;
},
/**
* @method removeInvalid
* @description Remove an invalid handle added by addInvalid
* @param {String} str The invalid handle to remove from the internal list.
* @return {Self}
* @chainable
*/
removeInvalid: function(str) {
if (this._invalids[str]) {
this._invalids[str] = null;
delete this._invalids[str];
this.fire(EV_REMOVE_INVALID, { handle: str });
}
return this;
},
/**
* @method addInvalid
* @description Add a selector string to test the handle against. If the test passes the drag operation will not continue.
* @param {String} str The selector to test against to determine if this is an invalid drag handle.
* @return {Self}
* @chainable
*/
addInvalid: function(str) {
if (Y.Lang.isString(str)) {
this._invalids[str] = true;
this.fire(EV_ADD_INVALID, { handle: str });
}
return this;
},
/**
* @private
* @method initializer
* @description Internal init handler
*/
initializer: function(cfg) {
this.get(NODE).dd = this;
if (!this.get(NODE).get('id')) {
var id = Y.stamp(this.get(NODE));
this.get(NODE).set('id', id);
}
this.actXY = [];
this._invalids = Y.clone(this._invalidsDefault, true);
this._createEvents();
if (!this.get(DRAG_NODE)) {
this.set(DRAG_NODE, this.get(NODE));
}
//Fix for #2528096
//Don't prep the DD instance until all plugins are loaded.
this.on('initializedChange', Y.bind(this._prep, this));
//Shouldn't have to do this..
this.set('groups', this.get('groups'));
},
/**
* @private
* @method _prep
* @description Attach event listners and add classname
*/
_prep: function() {
this._dragThreshMet = false;
var node = this.get(NODE);
node.addClass(DDM.CSS_PREFIX + '-draggable');
node.on(Drag.START_EVENT, Y.bind(this._handleMouseDownEvent, this));
node.on('mouseup', Y.bind(this._handleMouseUp, this));
node.on('dragstart', Y.bind(this._fixDragStart, this));
},
/**
* @private
* @method _unprep
* @description Detach event listeners and remove classname
*/
_unprep: function() {
var node = this.get(NODE);
node.removeClass(DDM.CSS_PREFIX + '-draggable');
node.detachAll();
},
/**
* @method start
* @description Starts the drag operation
* @return {Self}
* @chainable
*/
start: function() {
if (!this.get('lock') && !this.get(DRAGGING)) {
var node = this.get(NODE), ow, oh, xy;
this._startTime = (new Date()).getTime();
DDM._start();
node.addClass(DDM.CSS_PREFIX + '-dragging');
this.fire(EV_START, {
pageX: this.nodeXY[0],
pageY: this.nodeXY[1],
startTime: this._startTime
});
node = this.get(DRAG_NODE);
xy = this.nodeXY;
ow = node.get(OFFSET_WIDTH);
oh = node.get(OFFSET_HEIGHT);
if (this.get('startCentered')) {
this._setStartPosition([xy[0] + (ow / 2), xy[1] + (oh / 2)]);
}
this.region = {
'0': xy[0],
'1': xy[1],
area: 0,
top: xy[1],
right: xy[0] + ow,
bottom: xy[1] + oh,
left: xy[0]
};
this.set(DRAGGING, true);
}
return this;
},
/**
* @method end
* @description Ends the drag operation
* @return {Self}
* @chainable
*/
end: function() {
this._endTime = (new Date()).getTime();
if (this._clickTimeout) {
this._clickTimeout.cancel();
}
this._dragThreshMet = this._fromTimeout = false;
if (!this.get('lock') && this.get(DRAGGING)) {
this.fire(EV_END, {
pageX: this.lastXY[0],
pageY: this.lastXY[1],
startTime: this._startTime,
endTime: this._endTime
});
}
this.get(NODE).removeClass(DDM.CSS_PREFIX + '-dragging');
this.set(DRAGGING, false);
this.deltaXY = [0, 0];
return this;
},
/**
* @private
* @method _defEndFn
* @description Handler for fixing the selection in IE
*/
_defEndFn: function(e) {
this._fixIEMouseUp();
this._ev_md = null;
},
/**
* @private
* @method _prevEndFn
* @description Handler for preventing the drag:end event. It will reset the node back to it's start position
*/
_prevEndFn: function(e) {
this._fixIEMouseUp();
//Bug #1852577
this.get(DRAG_NODE).setXY(this.nodeXY);
this._ev_md = null;
this.region = null;
},
/**
* @private
* @method _align
* @description Calculates the offsets and set's the XY that the element will move to.
* @param {Array} xy The xy coords to align with.
*/
_align: function(xy) {
this.fire(EV_ALIGN, {pageX: xy[0], pageY: xy[1] });
},
/**
* @private
* @method _defAlignFn
* @description Calculates the offsets and set's the XY that the element will move to.
* @param {EventFacade} e The drag:align event.
*/
_defAlignFn: function(e) {
this.actXY = [e.pageX - this.deltaXY[0], e.pageY - this.deltaXY[1]];
},
/**
* @private
* @method _alignNode
* @description This method performs the alignment before the element move.
* @param {Array} eXY The XY to move the element to, usually comes from the mousemove DOM event.
*/
_alignNode: function(eXY) {
this._align(eXY);
this._moveNode();
},
/**
* @private
* @method _moveNode
* @description This method performs the actual element move.
*/
_moveNode: function(scroll) {
//if (!this.get(DRAGGING)) {
// return;
//}
var diffXY = [], diffXY2 = [], startXY = this.nodeXY, xy = this.actXY;
diffXY[0] = (xy[0] - this.lastXY[0]);
diffXY[1] = (xy[1] - this.lastXY[1]);
diffXY2[0] = (xy[0] - this.nodeXY[0]);
diffXY2[1] = (xy[1] - this.nodeXY[1]);
this.region = {
'0': xy[0],
'1': xy[1],
area: 0,
top: xy[1],
right: xy[0] + this.get(DRAG_NODE).get(OFFSET_WIDTH),
bottom: xy[1] + this.get(DRAG_NODE).get(OFFSET_HEIGHT),
left: xy[0]
};
this.fire(EV_DRAG, {
pageX: xy[0],
pageY: xy[1],
scroll: scroll,
info: {
start: startXY,
xy: xy,
delta: diffXY,
offset: diffXY2
}
});
this.lastXY = xy;
},
/**
* @private
* @method _defDragFn
* @description Default function for drag:drag. Fired from _moveNode.
* @param {EventFacade} ev The drag:drag event
*/
_defDragFn: function(e) {
if (this.get('move')) {
if (e.scroll) {
e.scroll.node.set('scrollTop', e.scroll.top);
e.scroll.node.set('scrollLeft', e.scroll.left);
}
this.get(DRAG_NODE).setXY([e.pageX, e.pageY]);
this.realXY = [e.pageX, e.pageY];
}
},
/**
* @private
* @method _move
* @description Fired from DragDropMgr (DDM) on mousemove.
* @param {EventFacade} ev The mousemove DOM event
*/
_move: function(ev) {
if (this.get('lock')) {
return false;
} else {
this.mouseXY = [ev.pageX, ev.pageY];
if (!this._dragThreshMet) {
var diffX = Math.abs(this.startXY[0] - ev.pageX),
diffY = Math.abs(this.startXY[1] - ev.pageY);
if (diffX > this.get('clickPixelThresh') || diffY > this.get('clickPixelThresh')) {
this._dragThreshMet = true;
this.start();
this._alignNode([ev.pageX, ev.pageY]);
}
} else {
if (this._clickTimeout) {
this._clickTimeout.cancel();
}
this._alignNode([ev.pageX, ev.pageY]);
}
}
},
/**
* @method stopDrag
* @description Method will forcefully stop a drag operation. For example calling this from inside an ESC keypress handler will stop this drag.
* @return {Self}
* @chainable
*/
stopDrag: function() {
if (this.get(DRAGGING)) {
DDM._end();
}
return this;
},
/**
* @private
* @method destructor
* @description Lifecycle destructor, unreg the drag from the DDM and remove listeners
*/
destructor: function() {
this._unprep();
this.detachAll();
if (this.target) {
this.target.destroy();
}
DDM._unregDrag(this);
}
});
Y.namespace('DD');
Y.DD.Drag = Drag;
}, '@VERSION@' ,{skinnable:false, requires:['dd-ddm-base']});
| khasinski/cdnjs | ajax/libs/yui/3.4.1/dd-drag/dd-drag-debug.js | JavaScript | mit | 43,528 |
.tablesorter-bootstrap{width:100%}.tablesorter-bootstrap tfoot td,.tablesorter-bootstrap tfoot th,.tablesorter-bootstrap thead td,.tablesorter-bootstrap thead th{font:700 14px/20px Arial,Sans-serif;padding:4px;margin:0 0 18px;background-color:#eee}.tablesorter-bootstrap .tablesorter-header{cursor:pointer}.tablesorter-bootstrap .tablesorter-header-inner{position:relative;padding:4px 18px 4px 4px}.tablesorter-bootstrap .tablesorter-header i.tablesorter-icon{font-size:11px;position:absolute;right:2px;top:50%;margin-top:-7px;width:14px;height:14px;background-repeat:no-repeat;line-height:14px;display:inline-block}.tablesorter-bootstrap .bootstrap-icon-unsorted{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOCAMAAADOvxanAAAAVFBMVEUAAABCQkJZWVkZGRnJyckgICAZGRkZGRn8/PweHh4dHR0aGhoaGhpUVFQbGxvQ0NDc3NxMTExSUlIbGxvr6+s4ODhKSkogICAtLS00NDQzMzMnJydSEPrQAAAAGHRSTlMA1ssZRLgdAQbDyisqsZo8QdXUq0r9xPepSRwiAAAAX0lEQVQI13XHSQKAIAwEwQAKxn13Ev7/T2Pu9qmarJKPXIicI4PH4hxaKNrhm2S8bJK5h4YzKHrzJNtK6yYT/TdXzpS5zuYg4MSQYF6i4IHExdw1UVRi05HPrrvT53a+qyMFC9t04gcAAAAASUVORK5CYII=)}.tablesorter-bootstrap .icon-white.bootstrap-icon-unsorted{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOBAMAAAALT/umAAAAKlBMVEUAAAD///////////////////////////////////////////////////+Gu8ovAAAADXRSTlMA4EXKBtQqvR0+sxmalc142gAAAFdJREFUCNdjYGDoamAAAjZbMxCVfvd6AgMDd+3du9UMDKx3hWSvMjBwXZww8RYDGuC53NB8h4GB8a617UUGBs7Yu3cjGRhYVO9eVQFKOskKOQApFmUgBwBZ+xXRTttNdAAAAABJRU5ErkJggg==)}.tablesorter-bootstrap>tbody>tr.odd>td,.tablesorter-bootstrap>tbody>tr.tablesorter-hasChildRow.odd:hover~tr.tablesorter-hasChildRow.odd~.tablesorter-childRow.odd>td{background-color:#f9f9f9}.tablesorter-bootstrap>tbody>tr.even:hover>td,.tablesorter-bootstrap>tbody>tr.odd:hover>td,.tablesorter-bootstrap>tbody>tr.tablesorter-hasChildRow.even:hover~.tablesorter-childRow.even>td,.tablesorter-bootstrap>tbody>tr.tablesorter-hasChildRow.odd:hover~.tablesorter-childRow.odd>td{background-color:#f5f5f5}.tablesorter-bootstrap>tbody>tr.even>td,.tablesorter-bootstrap>tbody>tr.tablesorter-hasChildRow.even:hover~tr.tablesorter-hasChildRow.even~.tablesorter-childRow.even>td{background-color:#fff}.tablesorter-bootstrap .tablesorter-processing{background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=);background-position:center center!important;background-repeat:no-repeat!important}.caption{background:#fff}.tablesorter-bootstrap .tablesorter-filter-row input.tablesorter-filter,.tablesorter-bootstrap .tablesorter-filter-row select.tablesorter-filter{width:98%;margin:0 auto;padding:4px 6px;color:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter-bootstrap .tablesorter-filter-row .tablesorter-filter.disabled{background-color:#eee;color:#555;cursor:not-allowed;border:1px solid #ccc;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.075) inset;box-sizing:border-box;transition:height .1s ease}.tablesorter-bootstrap .tablesorter-filter-row{background:#efefef}.tablesorter-bootstrap .tablesorter-filter-row td{background:#efefef;line-height:normal;text-align:center;padding:4px 6px;vertical-align:middle;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-bootstrap .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0}.tablesorter-bootstrap .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)}.tablesorter .filtered{display:none}.tablesorter-bootstrap .tablesorter-pager select{padding:4px 6px}.tablesorter-bootstrap .tablesorter-pager .pagedisplay{border:0}.tablesorter-bootstrap tfoot i{font-size:11px}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99} | jozefizso/cdnjs | ajax/libs/jquery.tablesorter/2.21.0/css/theme.bootstrap.min.css | CSS | mit | 4,492 |
'use strict';
var Stream = require('stream')
// from
//
// a stream that reads from an source.
// source may be an array, or a function.
// from handles pause behaviour for you.
module.exports =
function from (source) {
if(Array.isArray(source)) {
source = source.slice()
return from (function (i) {
if(source.length)
this.emit('data', source.shift())
else
this.emit('end')
return true
})
}
var s = new Stream(), i = 0
s.ended = false
s.started = false
s.readable = true
s.writable = false
s.paused = false
s.ended = false
s.pause = function () {
s.started = true
s.paused = true
}
function next () {
s.started = true
if(s.ended) return
while(!s.ended && !s.paused && source.call(s, i++, function () {
if(!s.ended && !s.paused)
next()
}))
;
}
s.resume = function () {
s.started = true
s.paused = false
next()
}
s.on('end', function () {
s.ended = true
s.readable = false
process.nextTick(s.destroy)
})
s.destroy = function () {
s.ended = true
s.emit('close')
}
/*
by default, the stream will start emitting at nextTick
if you want, you can pause it, after pipeing.
you can also resume before next tick, and that will also
work.
*/
process.nextTick(function () {
if(!s.started) s.resume()
})
return s
}
| katevontaine/myblog2 | node_modules/gulp-add-src/node_modules/event-stream/node_modules/from/index.js | JavaScript | mit | 1,399 |
'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"
],
"ERANAMES": [
"BC",
"AD"
],
"ERAS": [
"BC",
"AD"
],
"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,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"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;}
});
}]);
| freak3dot/cdnjs | ajax/libs/angular.js/1.3.16/i18n/angular-locale_fil-ph.js | JavaScript | mit | 2,526 |
'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"
],
"ERANAMES": [
"avant J\u00e9sus-Christ",
"apr\u00e8s J\u00e9sus-Christ"
],
"ERAS": [
"av. J.-C.",
"ap. J.-C."
],
"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": "CFA",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "fr-ne",
"pluralCat": function(n, opt_precision) { var i = n | 0; if (i == 0 || i == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
| jfatta/app-service-api-dotnet-contact-list | ContactsListWebApp/Scripts/i18n/angular-locale_fr-ne.js | JavaScript | mit | 2,123 |
'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"
],
"ERANAMES": [
"p\u0159. n. l.",
"n. l."
],
"ERAS": [
"p\u0159. n. l.",
"n. l."
],
"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,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "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;}
});
}]);
| sitic/cdnjs | ajax/libs/angular.js/1.3.16/i18n/angular-locale_cs-cz.js | JavaScript | mit | 2,677 |
'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"
],
"ERANAMES": [
"Before Christ",
"Anno Domini"
],
"ERAS": [
"BC",
"AD"
],
"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,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4-",
"negSuf": "",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "en-na",
"pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
| kennynaoh/cdnjs | ajax/libs/angular.js/1.3.17/i18n/angular-locale_en-na.js | JavaScript | mit | 2,393 |
'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": [
"\u4e0a\u5348",
"\u4e0b\u5348"
],
"DAY": [
"\u661f\u671f\u65e5",
"\u661f\u671f\u4e00",
"\u661f\u671f\u4e8c",
"\u661f\u671f\u4e09",
"\u661f\u671f\u56db",
"\u661f\u671f\u4e94",
"\u661f\u671f\u516d"
],
"ERANAMES": [
"\u516c\u5143\u524d",
"\u516c\u5143"
],
"ERAS": [
"BC",
"AD"
],
"MONTH": [
"1\u6708",
"2\u6708",
"3\u6708",
"4\u6708",
"5\u6708",
"6\u6708",
"7\u6708",
"8\u6708",
"9\u6708",
"10\u6708",
"11\u6708",
"12\u6708"
],
"SHORTDAY": [
"\u9031\u65e5",
"\u9031\u4e00",
"\u9031\u4e8c",
"\u9031\u4e09",
"\u9031\u56db",
"\u9031\u4e94",
"\u9031\u516d"
],
"SHORTMONTH": [
"1\u6708",
"2\u6708",
"3\u6708",
"4\u6708",
"5\u6708",
"6\u6708",
"7\u6708",
"8\u6708",
"9\u6708",
"10\u6708",
"11\u6708",
"12\u6708"
],
"fullDate": "y\u5e74MM\u6708dd\u65e5EEEE",
"longDate": "y\u5e74MM\u6708dd\u65e5",
"medium": "y\u5e74M\u6708d\u65e5 ah:mm:ss",
"mediumDate": "y\u5e74M\u6708d\u65e5",
"mediumTime": "ah:mm:ss",
"short": "yy\u5e74M\u6708d\u65e5 ah:mm",
"shortDate": "yy\u5e74M\u6708d\u65e5",
"shortTime": "ah:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "MOP",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4-",
"negSuf": "",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "zh-hant-mo",
"pluralCat": function(n, opt_precision) { return PLURAL_CATEGORY.OTHER;}
});
}]);
| AzureActivationDay/DevCamp | HOL/build-mobile-app-with-web-client/source/ContactList/ContactsList.Angular/Scripts/i18n/angular-locale_zh-hant-mo.js | JavaScript | mit | 2,265 |
'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"
],
"ERANAMES": [
"Before Christ",
"Anno Domini"
],
"ERAS": [
"BC",
"AD"
],
"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,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4-",
"negSuf": "",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "en-as",
"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;}
});
}]);
| Piicksarn/cdnjs | ajax/libs/angular.js/1.3.17/i18n/angular-locale_en-as.js | JavaScript | mit | 2,393 |
'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"
],
"ERANAMES": [
"Before Christ",
"Anno Domini"
],
"ERAS": [
"BC",
"AD"
],
"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,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4-",
"negSuf": "",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "en-mp",
"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;}
});
}]);
| oliver-feng/myazdocdb | app/lib/angular/i18n/angular-locale_en-mp.js | JavaScript | mit | 2,393 |
'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"
],
"ERANAMES": [
"avant J\u00e9sus-Christ",
"apr\u00e8s J\u00e9sus-Christ"
],
"ERAS": [
"av. J.-C.",
"ap. J.-C."
],
"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,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "fr-yt",
"pluralCat": function(n, opt_precision) { var i = n | 0; if (i == 0 || i == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
| paleozogt/cdnjs | ajax/libs/angular.js/1.3.16/i18n/angular-locale_fr-yt.js | JavaScript | mit | 2,126 |
'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": [
"nt\u0254\u0301ng\u0254\u0301",
"mp\u00f3kwa"
],
"DAY": [
"eyenga",
"mok\u0254l\u0254 mwa yambo",
"mok\u0254l\u0254 mwa m\u00edbal\u00e9",
"mok\u0254l\u0254 mwa m\u00eds\u00e1to",
"mok\u0254l\u0254 ya m\u00edn\u00e9i",
"mok\u0254l\u0254 ya m\u00edt\u00e1no",
"mp\u0254\u0301s\u0254"
],
"ERANAMES": [
"Yambo ya Y\u00e9zu Kr\u00eds",
"Nsima ya Y\u00e9zu Kr\u00eds"
],
"ERAS": [
"lib\u00f3so ya",
"nsima ya Y"
],
"MONTH": [
"s\u00e1nz\u00e1 ya yambo",
"s\u00e1nz\u00e1 ya m\u00edbal\u00e9",
"s\u00e1nz\u00e1 ya m\u00eds\u00e1to",
"s\u00e1nz\u00e1 ya m\u00ednei",
"s\u00e1nz\u00e1 ya m\u00edt\u00e1no",
"s\u00e1nz\u00e1 ya mot\u00f3b\u00e1",
"s\u00e1nz\u00e1 ya nsambo",
"s\u00e1nz\u00e1 ya mwambe",
"s\u00e1nz\u00e1 ya libwa",
"s\u00e1nz\u00e1 ya z\u00f3mi",
"s\u00e1nz\u00e1 ya z\u00f3mi na m\u0254\u030ck\u0254\u0301",
"s\u00e1nz\u00e1 ya z\u00f3mi na m\u00edbal\u00e9"
],
"SHORTDAY": [
"eye",
"ybo",
"mbl",
"mst",
"min",
"mtn",
"mps"
],
"SHORTMONTH": [
"yan",
"fbl",
"msi",
"apl",
"mai",
"yun",
"yul",
"agt",
"stb",
"\u0254tb",
"nvb",
"dsb"
],
"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/y HH:mm",
"shortDate": "d/M/y",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "FrCD",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "ln",
"pluralCat": function(n, opt_precision) { if (n >= 0 && n <= 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
| jackdoyle/cdnjs | ajax/libs/angular.js/1.3.18/i18n/angular-locale_ln.js | JavaScript | mit | 2,576 |
'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"
],
"ERANAMES": [
"Before Christ",
"Anno Domini"
],
"ERAS": [
"BC",
"AD"
],
"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": "MURs",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4-",
"negSuf": "",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "en-mu",
"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;}
});
}]);
| mscharl/cdnjs | ajax/libs/angular-i18n/1.3.16/angular-locale_en-mu.js | JavaScript | mit | 2,396 |
'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"
],
"ERANAMES": [
"\u0642\u0628\u0644 \u0627\u0644\u0645\u064a\u0644\u0627\u062f",
"\u0645\u064a\u0644\u0627\u062f\u064a"
],
"ERAS": [
"\u0642.\u0645",
"\u0645"
],
"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": "Rial",
"DECIMAL_SEP": "\u066b",
"GROUP_SEP": "\u066c",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 0,
"lgSize": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4-",
"negSuf": "",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "ar-sa",
"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;}
});
}]);
| quba/cdnjs | ajax/libs/angular-i18n/1.3.17/angular-locale_ar-sa.js | JavaScript | mit | 3,526 |
'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"
],
"ERANAMES": [
"avant J\u00e9sus-Christ",
"apr\u00e8s J\u00e9sus-Christ"
],
"ERAS": [
"av. J.-C.",
"ap. J.-C."
],
"FIRSTDAYOFWEEK": 0,
"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."
],
"STANDALONEMONTH": [
"Janvier",
"F\u00e9vrier",
"Mars",
"Avril",
"Mai",
"Juin",
"Juillet",
"Ao\u00fbt",
"Septembre",
"Octobre",
"Novembre",
"D\u00e9cembre"
],
"WEEKENDRANGE": [
5,
6
],
"fullDate": "EEEE d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y HH:mm:ss",
"mediumDate": "d MMM y",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/y HH:mm",
"shortDate": "dd/MM/y",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "fr-yt",
"localeID": "fr_YT",
"pluralCat": function(n, opt_precision) { var i = n | 0; if (i == 0 || i == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
| him2him2/cdnjs | ajax/libs/angular.js/1.4.14/i18n/angular-locale_fr-yt.js | JavaScript | mit | 2,459 |
'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",
"po podne"
],
"DAY": [
"nedelja",
"ponedeljak",
"utorak",
"sreda",
"\u010detvrtak",
"petak",
"subota"
],
"ERANAMES": [
"Pre nove ere",
"Nove ere"
],
"ERAS": [
"p. n. e.",
"n. e."
],
"FIRSTDAYOFWEEK": 0,
"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"
],
"STANDALONEMONTH": [
"januar",
"februar",
"mart",
"april",
"maj",
"jun",
"jul",
"avgust",
"septembar",
"oktobar",
"novembar",
"decembar"
],
"WEEKENDRANGE": [
5,
6
],
"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,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "sr-latn-rs",
"localeID": "sr_Latn_RS",
"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;}
});
}]);
| maruilian11/cdnjs | ajax/libs/angular-i18n/1.5.7/angular-locale_sr-latn-rs.js | JavaScript | mit | 3,005 |
'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"
],
"ERANAMES": [
"avant J\u00e9sus-Christ",
"apr\u00e8s J\u00e9sus-Christ"
],
"ERAS": [
"av. J.-C.",
"ap. J.-C."
],
"FIRSTDAYOFWEEK": 0,
"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."
],
"STANDALONEMONTH": [
"Janvier",
"F\u00e9vrier",
"Mars",
"Avril",
"Mai",
"Juin",
"Juillet",
"Ao\u00fbt",
"Septembre",
"Octobre",
"Novembre",
"D\u00e9cembre"
],
"WEEKENDRANGE": [
5,
6
],
"fullDate": "EEEE d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y HH:mm:ss",
"mediumDate": "d MMM y",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/y HH:mm",
"shortDate": "dd/MM/y",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "CFA",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "fr-ml",
"localeID": "fr_ML",
"pluralCat": function(n, opt_precision) { var i = n | 0; if (i == 0 || i == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
| viskin/cdnjs | ajax/libs/angular.js/1.5.3/i18n/angular-locale_fr-ml.js | JavaScript | mit | 2,456 |
'use strict';
/*jshint asi: true */
var test = require('tap').test
, rx = require('..')
, fs = require('fs')
, convert = require('..')
test('\nresolving a "/*# sourceMappingURL=map-file-comment.css.map*/" style comment inside a given css content', function (t) {
var css = fs.readFileSync(__dirname + '/fixtures/map-file-comment.css', 'utf8')
var conv = convert.fromMapFileSource(css, __dirname + '/fixtures');
var sm = conv.toObject();
t.deepEqual(
sm.sources
, [ './client/sass/core.scss',
'./client/sass/main.scss' ]
, 'resolves paths of original sources'
)
t.equal(sm.file, 'map-file-comment.css', 'includes filename of generated file')
t.equal(
sm.mappings
, 'AAAA,wBAAyB;EACvB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,iBAAiB;EAChC,KAAK,EAAE,OAAkB;;AAG3B,wBAAyB;EACvB,OAAO,EAAE,IAAI;;ACTf,gBAAiB;EACf,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,MAAM;;AAGf,kBAAmB;EACjB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,KAAK;;AAEd,kBAAmB;EACjB,KAAK,EAAE,KAAK;;AAGd,mBAAoB;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI'
, 'includes mappings'
)
t.end()
})
test('\nresolving a "//# sourceMappingURL=map-file-comment.css.map" style comment inside a given css content', function (t) {
var css = fs.readFileSync(__dirname + '/fixtures/map-file-comment-double-slash.css', 'utf8')
var conv = convert.fromMapFileSource(css, __dirname + '/fixtures');
var sm = conv.toObject();
t.deepEqual(
sm.sources
, [ './client/sass/core.scss',
'./client/sass/main.scss' ]
, 'resolves paths of original sources'
)
t.equal(sm.file, 'map-file-comment.css', 'includes filename of generated file')
t.equal(
sm.mappings
, 'AAAA,wBAAyB;EACvB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,iBAAiB;EAChC,KAAK,EAAE,OAAkB;;AAG3B,wBAAyB;EACvB,OAAO,EAAE,IAAI;;ACTf,gBAAiB;EACf,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,MAAM;;AAGf,kBAAmB;EACjB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,KAAK;;AAEd,kBAAmB;EACjB,KAAK,EAAE,KAAK;;AAGd,mBAAoB;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI'
, 'includes mappings'
)
t.end()
})
test('\nresolving a /*# sourceMappingURL=data:application/json;base64,... */ style comment inside a given css content', function(t) {
var css = fs.readFileSync(__dirname + '/fixtures/map-file-comment-inline.css', 'utf8')
var conv = convert.fromSource(css, __dirname + '/fixtures')
var sm = conv.toObject()
t.deepEqual(
sm.sources
, [ './client/sass/core.scss',
'./client/sass/main.scss' ]
, 'resolves paths of original sources'
)
t.equal(sm.file, 'map-file-comment.css', 'includes filename of generated file')
t.equal(
sm.mappings
, 'AAAA,wBAAyB;EACvB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,iBAAiB;EAChC,KAAK,EAAE,OAAkB;;AAG3B,wBAAyB;EACvB,OAAO,EAAE,IAAI;;ACTf,gBAAiB;EACf,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,MAAM;;AAGf,kBAAmB;EACjB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,KAAK;;AAEd,kBAAmB;EACjB,KAAK,EAAE,KAAK;;AAGd,mBAAoB;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI'
, 'includes mappings'
)
t.end()
})
| camunda-internal/bpmn-quiz | node_modules/convert-source-map/test/map-file-comment.js | JavaScript | mit | 3,379 |
jasmine.HtmlReporterHelpers = {};
jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
var el = document.createElement(type);
for (var i = 2; i < arguments.length; i++) {
var child = arguments[i];
if (typeof child === 'string') {
el.appendChild(document.createTextNode(child));
} else {
if (child) {
el.appendChild(child);
}
}
}
for (var attr in attrs) {
if (attr == "className") {
el[attr] = attrs[attr];
} else {
el.setAttribute(attr, attrs[attr]);
}
}
return el;
};
jasmine.HtmlReporterHelpers.getSpecStatus = function(child) {
var results = child.results();
var status = results.passed() ? 'passed' : 'failed';
if (results.skipped) {
status = 'skipped';
}
return status;
};
jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) {
var parentDiv = this.dom.summary;
var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';
var parent = child[parentSuite];
if (parent) {
if (typeof this.views.suites[parent.id] == 'undefined') {
this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);
}
parentDiv = this.views.suites[parent.id].element;
}
parentDiv.appendChild(childElement);
};
jasmine.HtmlReporterHelpers.addHelpers = function(ctor) {
for(var fn in jasmine.HtmlReporterHelpers) {
ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn];
}
};
jasmine.HtmlReporter = function(_doc) {
var self = this;
var doc = _doc || window.document;
var reporterView;
var dom = {};
// Jasmine Reporter Public Interface
self.logRunningSpecs = false;
self.reportRunnerStarting = function(runner) {
var specs = runner.specs() || [];
if (specs.length == 0) {
return;
}
createReporterDom(runner.env.versionString());
doc.body.appendChild(dom.reporter);
setExceptionHandling();
reporterView = new jasmine.HtmlReporter.ReporterView(dom);
reporterView.addSpecs(specs, self.specFilter);
};
self.reportRunnerResults = function(runner) {
reporterView && reporterView.complete();
};
self.reportSuiteResults = function(suite) {
reporterView.suiteComplete(suite);
};
self.reportSpecStarting = function(spec) {
if (self.logRunningSpecs) {
self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
}
};
self.reportSpecResults = function(spec) {
reporterView.specComplete(spec);
};
self.log = function() {
var console = jasmine.getGlobal().console;
if (console && console.log) {
if (console.log.apply) {
console.log.apply(console, arguments);
} else {
console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
}
}
};
self.specFilter = function(spec) {
if (!focusedSpecName()) {
return true;
}
return spec.getFullName().indexOf(focusedSpecName()) === 0;
};
return self;
function focusedSpecName() {
var specName;
(function memoizeFocusedSpec() {
if (specName) {
return;
}
var paramMap = [];
var params = jasmine.HtmlReporter.parameters(doc);
for (var i = 0; i < params.length; i++) {
var p = params[i].split('=');
paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
}
specName = paramMap.spec;
})();
return specName;
}
function createReporterDom(version) {
dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' },
dom.banner = self.createDom('div', { className: 'banner' },
self.createDom('span', { className: 'title' }, "Jasmine "),
self.createDom('span', { className: 'version' }, version)),
dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}),
dom.alert = self.createDom('div', {className: 'alert'},
self.createDom('span', { className: 'exceptions' },
self.createDom('label', { className: 'label', 'for': 'no_try_catch' }, 'No try/catch'),
self.createDom('input', { id: 'no_try_catch', type: 'checkbox' }))),
dom.results = self.createDom('div', {className: 'results'},
dom.summary = self.createDom('div', { className: 'summary' }),
dom.details = self.createDom('div', { id: 'details' }))
);
}
function noTryCatch() {
return window.location.search.match(/catch=false/);
}
function searchWithCatch() {
var params = jasmine.HtmlReporter.parameters(window.document);
var removed = false;
var i = 0;
while (!removed && i < params.length) {
if (params[i].match(/catch=/)) {
params.splice(i, 1);
removed = true;
}
i++;
}
if (jasmine.CATCH_EXCEPTIONS) {
params.push("catch=false");
}
return params.join("&");
}
function setExceptionHandling() {
var chxCatch = document.getElementById('no_try_catch');
if (noTryCatch()) {
chxCatch.setAttribute('checked', true);
jasmine.CATCH_EXCEPTIONS = false;
}
chxCatch.onclick = function() {
window.location.search = searchWithCatch();
};
}
};
jasmine.HtmlReporter.parameters = function(doc) {
var paramStr = doc.location.search.substring(1);
var params = [];
if (paramStr.length > 0) {
params = paramStr.split('&');
}
return params;
}
jasmine.HtmlReporter.sectionLink = function(sectionName) {
var link = '?';
var params = [];
if (sectionName) {
params.push('spec=' + encodeURIComponent(sectionName));
}
if (!jasmine.CATCH_EXCEPTIONS) {
params.push("catch=false");
}
if (params.length > 0) {
link += params.join("&");
}
return link;
};
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);
jasmine.HtmlReporter.ReporterView = function(dom) {
this.startedAt = new Date();
this.runningSpecCount = 0;
this.completeSpecCount = 0;
this.passedCount = 0;
this.failedCount = 0;
this.skippedCount = 0;
this.createResultsMenu = function() {
this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'},
this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'),
' | ',
this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing'));
this.summaryMenuItem.onclick = function() {
dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, '');
};
this.detailsMenuItem.onclick = function() {
showDetails();
};
};
this.addSpecs = function(specs, specFilter) {
this.totalSpecCount = specs.length;
this.views = {
specs: {},
suites: {}
};
for (var i = 0; i < specs.length; i++) {
var spec = specs[i];
this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views);
if (specFilter(spec)) {
this.runningSpecCount++;
}
}
};
this.specComplete = function(spec) {
this.completeSpecCount++;
if (isUndefined(this.views.specs[spec.id])) {
this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom);
}
var specView = this.views.specs[spec.id];
switch (specView.status()) {
case 'passed':
this.passedCount++;
break;
case 'failed':
this.failedCount++;
break;
case 'skipped':
this.skippedCount++;
break;
}
specView.refresh();
this.refresh();
};
this.suiteComplete = function(suite) {
var suiteView = this.views.suites[suite.id];
if (isUndefined(suiteView)) {
return;
}
suiteView.refresh();
};
this.refresh = function() {
if (isUndefined(this.resultsMenu)) {
this.createResultsMenu();
}
// currently running UI
if (isUndefined(this.runningAlert)) {
this.runningAlert = this.createDom('a', { href: jasmine.HtmlReporter.sectionLink(), className: "runningAlert bar" });
dom.alert.appendChild(this.runningAlert);
}
this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount);
// skipped specs UI
if (isUndefined(this.skippedAlert)) {
this.skippedAlert = this.createDom('a', { href: jasmine.HtmlReporter.sectionLink(), className: "skippedAlert bar" });
}
this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
if (this.skippedCount === 1 && isDefined(dom.alert)) {
dom.alert.appendChild(this.skippedAlert);
}
// passing specs UI
if (isUndefined(this.passedAlert)) {
this.passedAlert = this.createDom('span', { href: jasmine.HtmlReporter.sectionLink(), className: "passingAlert bar" });
}
this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount);
// failing specs UI
if (isUndefined(this.failedAlert)) {
this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"});
}
this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount);
if (this.failedCount === 1 && isDefined(dom.alert)) {
dom.alert.appendChild(this.failedAlert);
dom.alert.appendChild(this.resultsMenu);
}
// summary info
this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount);
this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing";
};
this.complete = function() {
dom.alert.removeChild(this.runningAlert);
this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
if (this.failedCount === 0) {
dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount)));
} else {
showDetails();
}
dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"));
};
return this;
function showDetails() {
if (dom.reporter.className.search(/showDetails/) === -1) {
dom.reporter.className += " showDetails";
}
}
function isUndefined(obj) {
return typeof obj === 'undefined';
}
function isDefined(obj) {
return !isUndefined(obj);
}
function specPluralizedFor(count) {
var str = count + " spec";
if (count > 1) {
str += "s"
}
return str;
}
};
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView);
jasmine.HtmlReporter.SpecView = function(spec, dom, views) {
this.spec = spec;
this.dom = dom;
this.views = views;
this.symbol = this.createDom('li', { className: 'pending' });
this.dom.symbolSummary.appendChild(this.symbol);
this.summary = this.createDom('div', { className: 'specSummary' },
this.createDom('a', {
className: 'description',
href: jasmine.HtmlReporter.sectionLink(this.spec.getFullName()),
title: this.spec.getFullName()
}, this.spec.description)
);
this.detail = this.createDom('div', { className: 'specDetail' },
this.createDom('a', {
className: 'description',
href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
title: this.spec.getFullName()
}, this.spec.getFullName())
);
};
jasmine.HtmlReporter.SpecView.prototype.status = function() {
return this.getSpecStatus(this.spec);
};
jasmine.HtmlReporter.SpecView.prototype.refresh = function() {
this.symbol.className = this.status();
switch (this.status()) {
case 'skipped':
break;
case 'passed':
this.appendSummaryToSuiteDiv();
break;
case 'failed':
this.appendSummaryToSuiteDiv();
this.appendFailureDetail();
break;
}
};
jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() {
this.summary.className += ' ' + this.status();
this.appendToSummary(this.spec, this.summary);
};
jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() {
this.detail.className += ' ' + this.status();
var resultItems = this.spec.results().getItems();
var messagesDiv = this.createDom('div', { className: 'messages' });
for (var i = 0; i < resultItems.length; i++) {
var result = resultItems[i];
if (result.type == 'log') {
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
} else if (result.type == 'expect' && result.passed && !result.passed()) {
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
if (result.trace.stack) {
messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
}
}
}
if (messagesDiv.childNodes.length > 0) {
this.detail.appendChild(messagesDiv);
this.dom.details.appendChild(this.detail);
}
};
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);jasmine.HtmlReporter.SuiteView = function(suite, dom, views) {
this.suite = suite;
this.dom = dom;
this.views = views;
this.element = this.createDom('div', { className: 'suite' },
this.createDom('a', { className: 'description', href: jasmine.HtmlReporter.sectionLink(this.suite.getFullName()) }, this.suite.description)
);
this.appendToSummary(this.suite, this.element);
};
jasmine.HtmlReporter.SuiteView.prototype.status = function() {
return this.getSpecStatus(this.suite);
};
jasmine.HtmlReporter.SuiteView.prototype.refresh = function() {
this.element.className += " " + this.status();
};
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView);
/* @deprecated Use jasmine.HtmlReporter instead
*/
jasmine.TrivialReporter = function(doc) {
this.document = doc || document;
this.suiteDivs = {};
this.logRunningSpecs = false;
};
jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
var el = document.createElement(type);
for (var i = 2; i < arguments.length; i++) {
var child = arguments[i];
if (typeof child === 'string') {
el.appendChild(document.createTextNode(child));
} else {
if (child) { el.appendChild(child); }
}
}
for (var attr in attrs) {
if (attr == "className") {
el[attr] = attrs[attr];
} else {
el.setAttribute(attr, attrs[attr]);
}
}
return el;
};
jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
var showPassed, showSkipped;
this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' },
this.createDom('div', { className: 'banner' },
this.createDom('div', { className: 'logo' },
this.createDom('span', { className: 'title' }, "Jasmine"),
this.createDom('span', { className: 'version' }, runner.env.versionString())),
this.createDom('div', { className: 'options' },
"Show ",
showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
)
),
this.runnerDiv = this.createDom('div', { className: 'runner running' },
this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
);
this.document.body.appendChild(this.outerDiv);
var suites = runner.suites();
for (var i = 0; i < suites.length; i++) {
var suite = suites[i];
var suiteDiv = this.createDom('div', { className: 'suite' },
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
this.suiteDivs[suite.id] = suiteDiv;
var parentDiv = this.outerDiv;
if (suite.parentSuite) {
parentDiv = this.suiteDivs[suite.parentSuite.id];
}
parentDiv.appendChild(suiteDiv);
}
this.startedAt = new Date();
var self = this;
showPassed.onclick = function(evt) {
if (showPassed.checked) {
self.outerDiv.className += ' show-passed';
} else {
self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
}
};
showSkipped.onclick = function(evt) {
if (showSkipped.checked) {
self.outerDiv.className += ' show-skipped';
} else {
self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
}
};
};
jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
var results = runner.results();
var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
this.runnerDiv.setAttribute("class", className);
//do it twice for IE
this.runnerDiv.setAttribute("className", className);
var specs = runner.specs();
var specCount = 0;
for (var i = 0; i < specs.length; i++) {
if (this.specFilter(specs[i])) {
specCount++;
}
}
var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
};
jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
var results = suite.results();
var status = results.passed() ? 'passed' : 'failed';
if (results.totalCount === 0) { // todo: change this to check results.skipped
status = 'skipped';
}
this.suiteDivs[suite.id].className += " " + status;
};
jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
if (this.logRunningSpecs) {
this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
}
};
jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
var results = spec.results();
var status = results.passed() ? 'passed' : 'failed';
if (results.skipped) {
status = 'skipped';
}
var specDiv = this.createDom('div', { className: 'spec ' + status },
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
this.createDom('a', {
className: 'description',
href: '?spec=' + encodeURIComponent(spec.getFullName()),
title: spec.getFullName()
}, spec.description));
var resultItems = results.getItems();
var messagesDiv = this.createDom('div', { className: 'messages' });
for (var i = 0; i < resultItems.length; i++) {
var result = resultItems[i];
if (result.type == 'log') {
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
} else if (result.type == 'expect' && result.passed && !result.passed()) {
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
if (result.trace.stack) {
messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
}
}
}
if (messagesDiv.childNodes.length > 0) {
specDiv.appendChild(messagesDiv);
}
this.suiteDivs[spec.suite.id].appendChild(specDiv);
};
jasmine.TrivialReporter.prototype.log = function() {
var console = jasmine.getGlobal().console;
if (console && console.log) {
if (console.log.apply) {
console.log.apply(console, arguments);
} else {
console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
}
}
};
jasmine.TrivialReporter.prototype.getLocation = function() {
return this.document.location;
};
jasmine.TrivialReporter.prototype.specFilter = function(spec) {
var paramMap = {};
var params = this.getLocation().search.substring(1).split('&');
for (var i = 0; i < params.length; i++) {
var p = params[i].split('=');
paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
}
if (!paramMap.spec) {
return true;
}
return spec.getFullName().indexOf(paramMap.spec) === 0;
};
| juaneduardo/m_edicion | www/test/lib/jasmine-1.3.1/jasmine-html.js | JavaScript | mit | 20,765 |
/**
* This is the web browser implementation of `debug()`.
*
* Expose `debug()` as the module.
*/
exports = module.exports = require('./debug');
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
/**
* Colors.
*/
exports.colors = [
'lightseagreen',
'forestgreen',
'goldenrod',
'dodgerblue',
'darkorchid',
'crimson'
];
/**
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
* and the Firebug extension (any Firefox version) are known
* to support "%c" CSS customizations.
*
* TODO: add a `localStorage` variable to explicitly enable/disable colors
*/
function useColors() {
// is webkit? http://stackoverflow.com/a/16459606/376773
return ('WebkitAppearance' in document.documentElement.style) ||
// is firebug? http://stackoverflow.com/a/398120/376773
(window.console && (console.firebug || (console.exception && console.table))) ||
// is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
(navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31);
}
/**
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
*/
exports.formatters.j = function(v) {
return JSON.stringify(v);
};
/**
* Colorize log arguments if enabled.
*
* @api public
*/
function formatArgs() {
var args = arguments;
var useColors = this.useColors;
args[0] = (useColors ? '%c' : '')
+ this.namespace
+ (useColors ? ' %c' : ' ')
+ args[0]
+ (useColors ? '%c ' : ' ')
+ '+' + exports.humanize(this.diff);
if (!useColors) return args;
var c = 'color: ' + this.color;
args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));
// the final "%c" is somewhat tricky, because there could be other
// arguments passed either before or after the %c, so we need to
// figure out the correct index to insert the CSS into
var index = 0;
var lastC = 0;
args[0].replace(/%[a-z%]/g, function(match) {
if ('%%' === match) return;
index++;
if ('%c' === match) {
// we only are interested in the *last* %c
// (the user may have provided their own)
lastC = index;
}
});
args.splice(lastC, 0, c);
return args;
}
/**
* Invokes `console.log()` when available.
* No-op when `console.log` is not a "function".
*
* @api public
*/
function log() {
// This hackery is required for IE8,
// where the `console.log` function doesn't have 'apply'
return 'object' == typeof console
&& 'function' == typeof console.log
&& Function.prototype.apply.call(console.log, console, arguments);
}
/**
* Save `namespaces`.
*
* @param {String} namespaces
* @api private
*/
function save(namespaces) {
try {
if (null == namespaces) {
localStorage.removeItem('debug');
} else {
localStorage.debug = namespaces;
}
} catch(e) {}
}
/**
* Load `namespaces`.
*
* @return {String} returns the previously persisted debug modes
* @api private
*/
function load() {
var r;
try {
r = localStorage.debug;
} catch(e) {}
return r;
}
/**
* Enable namespaces listed in `localStorage.debug` initially.
*/
exports.enable(load());
| mdixon47/JSP | node_modules/grunt-reload/node_modules/connect/node_modules/debug/browser.js | JavaScript | mit | 3,277 |
/**
* simplemde v1.5.1
* Copyright Next Step Webs, Inc.
* @link https://github.com/NextStepWebs/simplemde-markdown-editor
* @license MIT
*/
.CodeMirror{color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror,.CodeMirror-scroll{min-height:300px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected,.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.CodeMirror{height:auto;border:1px solid #ddd;border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding:10px;font:inherit}.CodeMirror-fullscreen{background:#fff;position:fixed!important;top:50px;left:0;right:0;bottom:0;height:auto;z-index:9}.editor-toolbar{position:relative;opacity:.6;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;padding:0 10px;border-top:1px solid #bbb;border-left:1px solid #bbb;border-right:1px solid #bbb;border-top-left-radius:4px;border-top-right-radius:4px}.editor-toolbar:after,.editor-toolbar:before{display:block;content:' ';height:1px}.editor-toolbar:before{margin-bottom:8px}.editor-toolbar:after{margin-top:8px}.editor-toolbar:hover,.editor-wrapper input.title:focus,.editor-wrapper input.title:hover{opacity:.8}.editor-toolbar.fullscreen{width:100%;background:#fff;border:0;position:fixed;top:0;left:0;opacity:1;z-index:9}.editor-toolbar a{display:inline-block;text-align:center;text-decoration:none!important;color:#2c3e50!important;width:30px;height:30px;margin:0;border:1px solid transparent;border-radius:3px;cursor:pointer}.editor-toolbar a.active,.editor-toolbar a:hover{background:#fcfcfc;border-color:#95a5a6}.editor-toolbar a:before{line-height:30px}.editor-toolbar i.separator{display:inline-block;width:0;border-left:1px solid #d9d9d9;border-right:1px solid #fff;color:transparent;text-indent:-10px;margin:0 6px}.editor-toolbar a.icon-fullscreen{position:absolute;right:10px}.editor-toolbar.disabled-for-preview a:not(.fa-eye):not(.fa-arrows-alt){pointer-events:none;background:#fff;border:none}.editor-statusbar{padding:8px 10px;font-size:12px;color:#959694;text-align:right}.editor-statusbar span{display:inline-block;min-width:4em;margin-left:1em}.editor-statusbar .lines:before{content:'lines: '}.editor-statusbar .words:before{content:'words: '}.editor-preview{padding:10px;position:absolute;width:100%;height:100%;top:0;left:0;background:#fafafa;z-index:9999;overflow:auto;display:none;box-sizing:border-box}.editor-preview-active{display:block}.editor-preview>p{margin-top:0}.editor-preview pre{background:#eee;margin-bottom:10px}.editor-preview table td,table th{border:1px solid #ddd;padding:5px}.CodeMirror .CodeMirror-selected{background:#d9d9d9}.CodeMirror .CodeMirror-code .cm-header-1{font-size:200%;line-height:200%}.CodeMirror .CodeMirror-code .cm-header-2{font-size:160%;line-height:160%}.CodeMirror .CodeMirror-code .cm-header-3{font-size:125%;line-height:125%}.CodeMirror .CodeMirror-code .cm-header-4{font-size:110%;line-height:110%}.CodeMirror .CodeMirror-code .cm-comment{background:rgba(0,0,0,.05);border-radius:2px}.CodeMirror .CodeMirror-code .cm-link{color:#7f8c8d}.CodeMirror .CodeMirror-code .cm-url{color:#aab2b3}.CodeMirror .CodeMirror-code .cm-strikethrough{text-decoration:line-through}.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment){background:rgba(255,0,0,.15)} | AdityaManohar/jsdelivr | files/simplemde/1.5.1/simplemde.min.css | CSS | mit | 8,295 |
/* crypto/asn1/i2d_pr.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/x509.h>
#include "asn1_locl.h"
int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp)
{
if (a->ameth && a->ameth->old_priv_encode) {
return a->ameth->old_priv_encode(a, pp);
}
if (a->ameth && a->ameth->priv_encode) {
PKCS8_PRIV_KEY_INFO *p8 = EVP_PKEY2PKCS8(a);
int ret = i2d_PKCS8_PRIV_KEY_INFO(p8, pp);
PKCS8_PRIV_KEY_INFO_free(p8);
return ret;
}
ASN1err(ASN1_F_I2D_PRIVATEKEY, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE);
return (-1);
}
| telecamera/opencvr | 3rdparty/openssl/crypto/asn1/i2d_pr.c | C | mit | 3,769 |
/*
The below work is licensed under Creative Commons GNU LGPL License.
Original work:
License: http://creativecommons.org/licenses/LGPL/2.1/
Author: Stefan Goessner/2006
Web: http://goessner.net/
Modifications made:
Version: 0.9-p5
Description: Restructured code, JSLint validated (no strict whitespaces),
added handling of empty arrays, empty strings, and int/floats values.
Author: Michael Schøler/2008-01-29
Web: http://michael.hinnerup.net/blog/2008/01/26/converting-json-to-xml-and-xml-to-json/
Description: json2xml added support to convert functions as CDATA
so it will be easy to write characters that cause some problems when convert
Author: Tony Tomov
*/
/*global alert */
var xmlJsonClass = {
// Param "xml": Element or document DOM node.
// Param "tab": Tab or indent string for pretty output formatting omit or use empty string "" to supress.
// Returns: JSON string
xml2json: function(xml, tab) {
if (xml.nodeType === 9) {
// document node
xml = xml.documentElement;
}
var nws = this.removeWhite(xml);
var obj = this.toObj(nws);
var json = this.toJson(obj, xml.nodeName, "\t");
return "{\n" + tab + (tab ? json.replace(/\t/g, tab) : json.replace(/\t|\n/g, "")) + "\n}";
},
// Param "o": JavaScript object
// Param "tab": tab or indent string for pretty output formatting omit or use empty string "" to supress.
// Returns: XML string
json2xml: function(o, tab) {
var toXml = function(v, name, ind) {
var xml = "";
var i, n;
if (v instanceof Array) {
if (v.length === 0) {
xml += ind + "<"+name+">__EMPTY_ARRAY_</"+name+">\n";
}
else {
for (i = 0, n = v.length; i < n; i += 1) {
var sXml = ind + toXml(v[i], name, ind+"\t") + "\n";
xml += sXml;
}
}
}
else if (typeof(v) === "object") {
var hasChild = false;
xml += ind + "<" + name;
var m;
for (m in v) if (v.hasOwnProperty(m)) {
if (m.charAt(0) === "@") {
xml += " " + m.substr(1) + "=\"" + v[m].toString() + "\"";
}
else {
hasChild = true;
}
}
xml += hasChild ? ">" : "/>";
if (hasChild) {
for (m in v) if (v.hasOwnProperty(m)) {
if (m === "#text") {
xml += v[m];
}
else if (m === "#cdata") {
xml += "<![CDATA[" + v[m] + "]]>";
}
else if (m.charAt(0) !== "@") {
xml += toXml(v[m], m, ind+"\t");
}
}
xml += (xml.charAt(xml.length - 1) === "\n" ? ind : "") + "</" + name + ">";
}
}
else if (typeof(v) === "function") {
xml += ind + "<" + name + ">" + "<![CDATA[" + v + "]]>" + "</" + name + ">";
}
else {
if (v === undefined ) { v = ""; }
if (v.toString() === "\"\"" || v.toString().length === 0) {
xml += ind + "<" + name + ">__EMPTY_STRING_</" + name + ">";
}
else {
xml += ind + "<" + name + ">" + v.toString() + "</" + name + ">";
}
}
return xml;
};
var xml = "";
var m;
for (m in o) if (o.hasOwnProperty(m)) {
xml += toXml(o[m], m, "");
}
return tab ? xml.replace(/\t/g, tab) : xml.replace(/\t|\n/g, "");
},
// Internal methods
toObj: function(xml) {
var o = {};
var FuncTest = /function/i;
if (xml.nodeType === 1) {
// element node ..
if (xml.attributes.length) {
// element with attributes ..
var i;
for (i = 0; i < xml.attributes.length; i += 1) {
o["@" + xml.attributes[i].nodeName] = (xml.attributes[i].nodeValue || "").toString();
}
}
if (xml.firstChild) {
// element has child nodes ..
var textChild = 0, cdataChild = 0, hasElementChild = false;
var n;
for (n = xml.firstChild; n; n = n.nextSibling) {
if (n.nodeType === 1) {
hasElementChild = true;
}
else if (n.nodeType === 3 && n.nodeValue.match(/[^ \f\n\r\t\v]/)) {
// non-whitespace text
textChild += 1;
}
else if (n.nodeType === 4) {
// cdata section node
cdataChild += 1;
}
}
if (hasElementChild) {
if (textChild < 2 && cdataChild < 2) {
// structured element with evtl. a single text or/and cdata node ..
this.removeWhite(xml);
for (n = xml.firstChild; n; n = n.nextSibling) {
if (n.nodeType === 3) {
// text node
o["#text"] = this.escape(n.nodeValue);
}
else if (n.nodeType === 4) {
// cdata node
if (FuncTest.test(n.nodeValue)) {
o[n.nodeName] = [o[n.nodeName], n.nodeValue];
} else {
o["#cdata"] = this.escape(n.nodeValue);
}
}
else if (o[n.nodeName]) {
// multiple occurence of element ..
if (o[n.nodeName] instanceof Array) {
o[n.nodeName][o[n.nodeName].length] = this.toObj(n);
}
else {
o[n.nodeName] = [o[n.nodeName], this.toObj(n)];
}
}
else {
// first occurence of element ..
o[n.nodeName] = this.toObj(n);
}
}
}
else {
// mixed content
if (!xml.attributes.length) {
o = this.escape(this.innerXml(xml));
}
else {
o["#text"] = this.escape(this.innerXml(xml));
}
}
}
else if (textChild) {
// pure text
if (!xml.attributes.length) {
o = this.escape(this.innerXml(xml));
if (o === "__EMPTY_ARRAY_") {
o = "[]";
} else if (o === "__EMPTY_STRING_") {
o = "";
}
}
else {
o["#text"] = this.escape(this.innerXml(xml));
}
}
else if (cdataChild) {
// cdata
if (cdataChild > 1) {
o = this.escape(this.innerXml(xml));
}
else {
for (n = xml.firstChild; n; n = n.nextSibling) {
if(FuncTest.test(xml.firstChild.nodeValue)) {
o = xml.firstChild.nodeValue;
break;
} else {
o["#cdata"] = this.escape(n.nodeValue);
}
}
}
}
}
if (!xml.attributes.length && !xml.firstChild) {
o = null;
}
}
else if (xml.nodeType === 9) {
// document.node
o = this.toObj(xml.documentElement);
}
else {
alert("unhandled node type: " + xml.nodeType);
}
return o;
},
toJson: function(o, name, ind, wellform) {
if(wellform === undefined) wellform = true;
var json = name ? ("\"" + name + "\"") : "", tab = "\t", newline = "\n";
if(!wellform) {
tab= ""; newline= "";
}
if (o === "[]") {
json += (name ? ":[]" : "[]");
}
else if (o instanceof Array) {
var n, i, ar=[];
for (i = 0, n = o.length; i < n; i += 1) {
ar[i] = this.toJson(o[i], "", ind + tab, wellform);
}
json += (name ? ":[" : "[") + (ar.length > 1 ? (newline + ind + tab + ar.join(","+newline + ind + tab) + newline + ind) : ar.join("")) + "]";
}
else if (o === null) {
json += (name && ":") + "null";
}
else if (typeof(o) === "object") {
var arr = [], m;
for (m in o) {
if (o.hasOwnProperty(m)) {
arr[arr.length] = this.toJson(o[m], m, ind + tab, wellform);
}
}
json += (name ? ":{" : "{") + (arr.length > 1 ? (newline + ind + tab + arr.join(","+newline + ind + tab) + newline + ind) : arr.join("")) + "}";
}
else if (typeof(o) === "string") {
/*
var objRegExp = /(^-?\d+\.?\d*$)/;
var FuncTest = /function/i;
var os = o.toString();
if (objRegExp.test(os) || FuncTest.test(os) || os==="false" || os==="true") {
// int or float
json += (name && ":") + "\"" +os + "\"";
}
else {
*/
json += (name && ":") + "\"" + o.replace(/\\/g,'\\\\').replace(/\"/g,'\\"') + "\"";
//}
}
else {
json += (name && ":") + o.toString();
}
return json;
},
innerXml: function(node) {
var s = "";
if ("innerHTML" in node) {
s = node.innerHTML;
}
else {
var asXml = function(n) {
var s = "", i;
if (n.nodeType === 1) {
s += "<" + n.nodeName;
for (i = 0; i < n.attributes.length; i += 1) {
s += " " + n.attributes[i].nodeName + "=\"" + (n.attributes[i].nodeValue || "").toString() + "\"";
}
if (n.firstChild) {
s += ">";
for (var c = n.firstChild; c; c = c.nextSibling) {
s += asXml(c);
}
s += "</" + n.nodeName + ">";
}
else {
s += "/>";
}
}
else if (n.nodeType === 3) {
s += n.nodeValue;
}
else if (n.nodeType === 4) {
s += "<![CDATA[" + n.nodeValue + "]]>";
}
return s;
};
for (var c = node.firstChild; c; c = c.nextSibling) {
s += asXml(c);
}
}
return s;
},
escape: function(txt) {
return txt.replace(/[\\]/g, "\\\\").replace(/[\"]/g, '\\"').replace(/[\n]/g, '\\n').replace(/[\r]/g, '\\r');
},
removeWhite: function(e) {
e.normalize();
var n;
for (n = e.firstChild; n; ) {
if (n.nodeType === 3) {
// text node
if (!n.nodeValue.match(/[^ \f\n\r\t\v]/)) {
// pure whitespace text node
var nxt = n.nextSibling;
e.removeChild(n);
n = nxt;
}
else {
n = n.nextSibling;
}
}
else if (n.nodeType === 1) {
// element node
this.removeWhite(n);
n = n.nextSibling;
}
else {
// any other node
n = n.nextSibling;
}
}
return e;
}
}; | renearias/progravityback | web/smartadmin-plugin/legacy/jqgrid/js/JsonXml.js | JavaScript | mit | 9,149 |
/*
* Piwik - Web Analytics
*
* JavaScript tracking client
*
* @link http://piwik.org
* @source http://dev.piwik.org/trac/browser/trunk/js/piwik.js
* @license http://www.opensource.org/licenses/bsd-license.php Simplified BSD
*/
if(!this.JSON2){this.JSON2={}}(function(){function d(f){return f<10?"0"+f:f}function l(n,m){var f=Object.prototype.toString.apply(n);if(f==="[object Date]"){return isFinite(n.valueOf())?n.getUTCFullYear()+"-"+d(n.getUTCMonth()+1)+"-"+d(n.getUTCDate())+"T"+d(n.getUTCHours())+":"+d(n.getUTCMinutes())+":"+d(n.getUTCSeconds())+"Z":null}if(f==="[object String]"||f==="[object Number]"||f==="[object Boolean]"){return n.valueOf()}if(f!=="[object Array]"&&typeof n.toJSON==="function"){return n.toJSON(m)}return n}var c=new RegExp("[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]","g"),e='\\\\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]',i=new RegExp("["+e,"g"),j,b,k={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},h;
function a(f){i.lastIndex=0;return i.test(f)?'"'+f.replace(i,function(m){var n=k[m];return typeof n==="string"?n:"\\u"+("0000"+m.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+f+'"'}function g(s,p){var n,m,t,f,q=j,o,r=p[s];if(r&&typeof r==="object"){r=l(r,s)}if(typeof h==="function"){r=h.call(p,s,r)}switch(typeof r){case"string":return a(r);case"number":return isFinite(r)?String(r):"null";case"boolean":case"null":return String(r);case"object":if(!r){return"null"}j+=b;o=[];if(Object.prototype.toString.apply(r)==="[object Array]"){f=r.length;for(n=0;n<f;n+=1){o[n]=g(n,r)||"null"}t=o.length===0?"[]":j?"[\n"+j+o.join(",\n"+j)+"\n"+q+"]":"["+o.join(",")+"]";j=q;return t}if(h&&typeof h==="object"){f=h.length;for(n=0;n<f;n+=1){if(typeof h[n]==="string"){m=h[n];t=g(m,r);if(t){o.push(a(m)+(j?": ":":")+t)}}}}else{for(m in r){if(Object.prototype.hasOwnProperty.call(r,m)){t=g(m,r);if(t){o.push(a(m)+(j?": ":":")+t)}}}}t=o.length===0?"{}":j?"{\n"+j+o.join(",\n"+j)+"\n"+q+"}":"{"+o.join(",")+"}";j=q;
return t}}if(typeof JSON2.stringify!=="function"){JSON2.stringify=function(o,m,n){var f;j="";b="";if(typeof n==="number"){for(f=0;f<n;f+=1){b+=" "}}else{if(typeof n==="string"){b=n}}h=m;if(m&&typeof m!=="function"&&(typeof m!=="object"||typeof m.length!=="number")){throw new Error("JSON.stringify")}return g("",{"":o})}}if(typeof JSON2.parse!=="function"){JSON2.parse=function(o,f){var n;function m(s,r){var q,p,t=s[r];if(t&&typeof t==="object"){for(q in t){if(Object.prototype.hasOwnProperty.call(t,q)){p=m(t,q);if(p!==undefined){t[q]=p}else{delete t[q]}}}}return f.call(s,r,t)}o=String(o);c.lastIndex=0;if(c.test(o)){o=o.replace(c,function(p){return"\\u"+("0000"+p.charCodeAt(0).toString(16)).slice(-4)})}if((new RegExp("^[\\],:{}\\s]*$")).test(o.replace(new RegExp('\\\\(?:["\\\\/bfnrt]|u[0-9a-fA-F]{4})',"g"),"@").replace(new RegExp('"[^"\\\\\n\r]*"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?',"g"),"]").replace(new RegExp("(?:^|:|,)(?:\\s*\\[)+","g"),""))){n=eval("("+o+")");
return typeof f==="function"?m({"":n},""):n}throw new SyntaxError("JSON.parse")}}}());var _paq=_paq||[],Piwik=Piwik||(function(){var m,w={},d=document,j=navigator,v=screen,H=window,h=false,C=[],e=H.encodeURIComponent,I=H.decodeURIComponent,G,D;function b(i){return typeof i!=="undefined"}function a(i){return typeof i==="function"}function n(i){return typeof i==="object"}function q(i){return typeof i==="string"||i instanceof String}function z(J){var i=J.shift();if(q(i)){G[i].apply(G,J)}else{i.apply(G,J)}}function t(L,K,J,i){if(L.addEventListener){L.addEventListener(K,J,i);return true}if(L.attachEvent){return L.attachEvent("on"+K,J)}L["on"+K]=J}function g(K,N){var J="",M,L;for(M in w){if(Object.prototype.hasOwnProperty.call(w,M)){L=w[M][K];if(a(L)){J+=L(N)}}}return J}function B(){var i;g("unload");if(m){do{i=new Date()}while(i.getTime()<m)}}function k(){var J;if(!h){h=true;g("load");for(J=0;J<C.length;J++){C[J]()}}return true}function x(){var J;if(d.addEventListener){t(d,"DOMContentLoaded",function i(){d.removeEventListener("DOMContentLoaded",i,false);
k()})}else{if(d.attachEvent){d.attachEvent("onreadystatechange",function i(){if(d.readyState==="complete"){d.detachEvent("onreadystatechange",i);k()}});if(d.documentElement.doScroll&&H===H.top){(function i(){if(!h){try{d.documentElement.doScroll("left")}catch(K){setTimeout(i,0);return}k()}}())}}}if((new RegExp("WebKit")).test(j.userAgent)){J=setInterval(function(){if(h||/loaded|complete/.test(d.readyState)){clearInterval(J);k()}},10)}t(H,"load",k,false)}function f(){var i="";try{i=H.top.document.referrer}catch(K){if(H.parent){try{i=H.parent.document.referrer}catch(J){i=""}}}if(i===""){i=d.referrer}return i}function A(i){var K=new RegExp("^([a-z]+):"),J=K.exec(i);return J?J[1]:null}function y(i){var K=new RegExp("^(?:(?:https?|ftp):)/*(?:[^@]+@)?([^:/#]+)"),J=K.exec(i);return J?J[1]:i}function p(K,J){var N=new RegExp("^(?:https?|ftp)(?::/*(?:[^?]+)[?])([^#]+)"),M=N.exec(K),L=new RegExp("(?:^|&)"+J+"=([^&]*)"),i=M?L.exec(M[1]):0;return i?I(i[1]):""}function s(O,L,K,N,J,M){var i;if(K){i=new Date();
i.setTime(i.getTime()+K)}d.cookie=O+"="+e(L)+(K?";expires="+i.toGMTString():"")+";path="+(N?N:"/")+(J?";domain="+J:"")+(M?";secure":"")}function F(K){var i=new RegExp("(^|;)[ ]*"+K+"=([^;]*)"),J=i.exec(d.cookie);return J?I(J[2]):0}function r(i){return unescape(e(i))}function u(Z){var L=function(W,i){return(W<<i)|(W>>>(32-i))},aa=function(ag){var af="",ae,W;for(ae=7;ae>=0;ae--){W=(ag>>>(ae*4))&15;af+=W.toString(16)}return af},O,ac,ab,K=[],S=1732584193,Q=4023233417,P=2562383102,N=271733878,M=3285377520,Y,X,V,U,T,ad,J,R=[];Z=r(Z);J=Z.length;for(ac=0;ac<J-3;ac+=4){ab=Z.charCodeAt(ac)<<24|Z.charCodeAt(ac+1)<<16|Z.charCodeAt(ac+2)<<8|Z.charCodeAt(ac+3);R.push(ab)}switch(J&3){case 0:ac=2147483648;break;case 1:ac=Z.charCodeAt(J-1)<<24|8388608;break;case 2:ac=Z.charCodeAt(J-2)<<24|Z.charCodeAt(J-1)<<16|32768;break;case 3:ac=Z.charCodeAt(J-3)<<24|Z.charCodeAt(J-2)<<16|Z.charCodeAt(J-1)<<8|128;break}R.push(ac);while((R.length&15)!==14){R.push(0)}R.push(J>>>29);R.push((J<<3)&4294967295);for(O=0;O<R.length;
O+=16){for(ac=0;ac<16;ac++){K[ac]=R[O+ac]}for(ac=16;ac<=79;ac++){K[ac]=L(K[ac-3]^K[ac-8]^K[ac-14]^K[ac-16],1)}Y=S;X=Q;V=P;U=N;T=M;for(ac=0;ac<=19;ac++){ad=(L(Y,5)+((X&V)|(~X&U))+T+K[ac]+1518500249)&4294967295;T=U;U=V;V=L(X,30);X=Y;Y=ad}for(ac=20;ac<=39;ac++){ad=(L(Y,5)+(X^V^U)+T+K[ac]+1859775393)&4294967295;T=U;U=V;V=L(X,30);X=Y;Y=ad}for(ac=40;ac<=59;ac++){ad=(L(Y,5)+((X&V)|(X&U)|(V&U))+T+K[ac]+2400959708)&4294967295;T=U;U=V;V=L(X,30);X=Y;Y=ad}for(ac=60;ac<=79;ac++){ad=(L(Y,5)+(X^V^U)+T+K[ac]+3395469782)&4294967295;T=U;U=V;V=L(X,30);X=Y;Y=ad}S=(S+Y)&4294967295;Q=(Q+X)&4294967295;P=(P+V)&4294967295;N=(N+U)&4294967295;M=(M+T)&4294967295}ad=aa(S)+aa(Q)+aa(P)+aa(N)+aa(M);return ad.toLowerCase()}function o(K,i,J){if(K==="translate.googleusercontent.com"){if(J===""){J=i}i=p(i,"u");K=y(i)}else{if(K==="cc.bingj.com"||K==="webcache.googleusercontent.com"||K.slice(0,5)==="74.6."){i=d.links[0].href;K=y(i)}}return[K,i,J]}function l(J){var i=J.length;if(J.charAt(--i)==="."){J=J.slice(0,i)}if(J.slice(0,2)==="*."){J=J.slice(1)
}return J}function E(aF,aD){var ao=o(d.domain,H.location.href,f()),aa=l(ao[0]),W=ao[1],aG=ao[2],L="GET",ad=aF||"",aZ=aD||"",aR,aY=d.title,aj="7z|aac|ar[cj]|as[fx]|avi|bin|csv|deb|dmg|doc|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|ms[ip]|od[bfgpst]|og[gv]|pdf|phps|png|ppt|qtm?|ra[mr]?|rpm|sea|sit|tar|t?bz2?|tgz|torrent|txt|wav|wm[av]|wpd||xls|xml|z|zip",aH=[aa],P=[],aI=[],aN=[],ac=500,K,am,an,aA,at=["pk_campaign","piwik_campaign","utm_campaign","utm_source","utm_medium"],aC=["pk_kwd","piwik_kwd","utm_term"],aJ="_pk_",S,aE,M,ax,a0=63072000000,ag=1800000,ab=15768000000,aW=d.location.protocol==="https",aO=false,U=100,aL=5,aq={},aw=false,T=false,Z,aV,au,aQ=u,aB,al;function aS(a1){var a2;if(an){a2=new RegExp("#.*");return a1.replace(a2,"")}return a1}function ai(a3,a1){var a4=A(a1),a2;if(a4){return a1}if(a1.slice(0,1)==="/"){return A(a3)+"://"+y(a3)+a1}a3=aS(a3);if((a2=a3.indexOf("?"))>=0){a3=a3.slice(0,a2)}if((a2=a3.lastIndexOf("/"))!==a3.length-1){a3=a3.slice(0,a2+1)}return a3+a1
}function av(a4){var a2,a1,a3;for(a2=0;a2<aH.length;a2++){a1=l(aH[a2].toLowerCase());if(a4===a1){return true}if(a1.slice(0,1)==="."){if(a4===a1.slice(1)){return true}a3=a4.length-a1.length;if((a3>0)&&(a4.slice(a3)===a1)){return true}}}return false}function i(a1){var a2=new Image(1,1);a2.onLoad=function(){};a2.src=ad+(ad.indexOf("?")<0?"?":"&")+a1}function Y(a1){try{var a3=H.XDomainRequest?new H.XDomainRequest():H.XMLHttpRequest?new H.XMLHttpRequest():H.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):null;a3.open("POST",ad,true);a3.onreadystatechange=function(){if(this.readyState===4&&this.status!==200){i(a1)}};a3.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");a3.send(a1)}catch(a2){i(a1)}}function aU(a3,a2){var a1=new Date();if(!M){if(L==="POST"){Y(a3)}else{i(a3)}m=a1.getTime()+a2}}function Q(a1){return aJ+a1+"."+aZ+"."+aB}function az(){var a1=Q("testcookie");if(!b(j.cookieEnabled)){s(a1,"1");return F(a1)==="1"?"1":"0"}return j.cookieEnabled?"1":"0"
}function ak(){aB=aQ((S||aa)+(aE||"/")).slice(0,4)}function X(){var a2=Q("cvar"),a1=F(a2);if(a1.length){a1=JSON2.parse(a1);if(n(a1)){return a1}}return{}}function aK(){if(aO===false){aO=X()}}function R(a1){var a2=new Date();Z=a2.getTime()}function N(a5,a2,a1,a4,a3){s(Q("id"),a5+"."+a2+"."+a1+"."+a4+"."+a3,a0,aE,S,aW)}function O(){var a2=new Date(),a1=Math.round(a2.getTime()/1000),a4=F(Q("id")),a3;if(a4){a3=a4.split(".");a3.unshift("0")}else{if(!al){al=aQ((j.userAgent||"")+(j.platform||"")+JSON2.stringify(aq)+a1).slice(0,16)}a3=["1",al,a1,0,a1,""]}return a3}function aM(){var a1=F(Q("ref"));if(a1.length){try{a1=JSON2.parse(a1);if(n(a1)){return a1}}catch(a2){}}return["","",0,""]}function ap(a3,bn,bo){var bl,a2=new Date(),a9=Math.round(a2.getTime()/1000),bq,bm,a5,bf,bi,a8,a6,bk,a4=1024,br,bc,bh=aO,be=Q("id"),ba=Q("ses"),bb=Q("ref"),bs=Q("cvar"),bg=O(),bd=F(ba),bj=aM(),bp=aR||W,a7,a1;if(M){s(be,"",-1,aE,S);s(ba,"",-1,aE,S);s(bs,"",-1,aE,S);s(bb,"",-1,aE,S);return""}bq=bg[0];bm=bg[1];bf=bg[2];
a5=bg[3];bi=bg[4];a8=bg[5];a7=bj[0];a1=bj[1];a6=bj[2];bk=bj[3];if(!bd){a5++;a8=bi;if(!ax||!a7.length){for(bl in at){if(Object.prototype.hasOwnProperty.call(at,bl)){a7=p(bp,at[bl]);if(a7.length){break}}}for(bl in aC){if(Object.prototype.hasOwnProperty.call(aC,bl)){a1=p(bp,aC[bl]);if(a1.length){break}}}}br=y(aG);bc=bk.length?y(bk):"";if(br.length&&!av(br)&&(!ax||!bc.length||av(bc))){bk=aG}if(bk.length||a7.length){a6=a9;bj=[a7,a1,a6,aS(bk.slice(0,a4))];s(bb,JSON2.stringify(bj),ab,aE,S,aW)}}a3+="&idsite="+aZ+"&rec=1&rand="+Math.random()+"&h="+a2.getHours()+"&m="+a2.getMinutes()+"&s="+a2.getSeconds()+"&url="+e(aS(bp))+"&urlref="+e(aS(aG))+"&_id="+bm+"&_idts="+bf+"&_idvc="+a5+"&_idn="+bq+"&_rcn="+e(a7)+"&_rck="+e(a1)+"&_refts="+a6+"&_viewts="+a8+"&_ref="+e(aS(bk.slice(0,a4)));for(bl in aq){if(Object.prototype.hasOwnProperty.call(aq,bl)){a3+="&"+bl+"="+aq[bl]}}if(bn){a3+="&data="+e(JSON2.stringify(bn))}else{if(aA){a3+="&data="+e(JSON2.stringify(aA))}}if(aO){a3+="&_cvar="+e(JSON2.stringify(aO));
for(bl in bh){if(Object.prototype.hasOwnProperty.call(bh,bl)){if(aO[bl][0]===""||aO[bl][1]===""){delete aO[bl]}}}s(bs,JSON2.stringify(aO),ag,aE,S,aW)}N(bm,bf,a5,a9,a8);s(ba,"*",ag,aE,S,aW);a3+=g(bo);return a3}function J(a4,a5){var a1=new Date(),a3=ap("action_name="+e(a4||aY),a5,"log");aU(a3,ac);if(K&&am&&!T){T=true;t(d,"click",R);t(d,"mouseup",R);t(d,"mousedown",R);t(d,"mousemove",R);t(d,"mousewheel",R);t(H,"DOMMouseScroll",R);t(H,"scroll",R);t(d,"keypress",R);t(d,"keydown",R);t(d,"keyup",R);t(H,"resize",R);t(H,"focus",R);t(H,"blur",R);Z=a1.getTime();setTimeout(function a2(){var a6=new Date(),a7;if((Z+am)>a6.getTime()){if(K<a6.getTime()){a7=ap("ping=1",a5,"ping");aU(a7,ac)}setTimeout(a2,am)}},am)}}function aT(a1,a4,a3){var a2=ap("idgoal="+a1+(a4?"&revenue="+a4:""),a3,"goal");aU(a2,ac)}function ah(a2,a1,a4){var a3=ap(a1+"="+e(aS(a2)),a4,"link");aU(a3,ac)}function ay(a3,a2){var a4,a1="(^| )(piwik[_-]"+a2;if(a3){for(a4=0;a4<a3.length;a4++){a1+="|"+a3[a4]}}a1+=")( |$)";return new RegExp(a1)
}function aX(a4,a1,a5){if(!a5){return"link"}var a3=ay(aI,"download"),a2=ay(aN,"link"),a6=new RegExp("\\.("+aj+")([?&#]|$)","i");return a2.test(a4)?"link":(a3.test(a4)||a6.test(a1)?"download":0)}function V(a6){var a4,a2,a1;while(!!(a4=a6.parentNode)&&((a2=a6.tagName)!=="A"&&a2!=="AREA")){a6=a4}if(b(a6.href)){var a7=a6.hostname||y(a6.href),a8=a7.toLowerCase(),a3=a6.href.replace(a7,a8),a5=new RegExp("^(javascript|vbscript|jscript|mocha|livescript|ecmascript):","i");if(!a5.test(a3)){a1=aX(a6.className,a3,av(a8));if(a1){ah(a3,a1)}}}}function ae(a1){var a2,a3;a1=a1||H.event;a2=a1.which||a1.button;a3=a1.target||a1.srcElement;if(a1.type==="click"){if(a3){V(a3)}}else{if(a1.type==="mousedown"){if((a2===1||a2===2)&&a3){aV=a2;au=a3}else{aV=au=null}}else{if(a1.type==="mouseup"){if(a2===aV&&a3===au){V(a3)}aV=au=null}}}}function aP(a2,a1){if(a1){t(a2,"mouseup",ae,false);t(a2,"mousedown",ae,false)}else{t(a2,"click",ae,false)}}function ar(a2){if(!aw){aw=true;var a3,a1=ay(P,"ignore"),a4=d.links;if(a4){for(a3=0;
a3<a4.length;a3++){if(!a1.test(a4[a3].className)){aP(a4[a3],a2)}}}}}function af(){var a1,a2,a3={pdf:"application/pdf",qt:"video/quicktime",realp:"audio/x-pn-realaudio-plugin",wma:"application/x-mplayer2",dir:"application/x-director",fla:"application/x-shockwave-flash",java:"application/x-java-vm",gears:"application/x-googlegears",ag:"application/x-silverlight"};if(j.mimeTypes&&j.mimeTypes.length){for(a1 in a3){if(Object.prototype.hasOwnProperty.call(a3,a1)){a2=j.mimeTypes[a3[a1]];aq[a1]=(a2&&a2.enabledPlugin)?"1":"0"}}}if(typeof navigator.javaEnabled!=="unknown"&&b(j.javaEnabled)&&j.javaEnabled()){aq.java="1"}if(a(H.GearsFactory)){aq.gears="1"}aq.res=v.width+"x"+v.height;aq.cookie=az()}af();ak();return{getVisitorId:function(){return(O())[1]},getVisitorInfo:function(){return O()},getAttributionInfo:function(){return aM()},getAttributionCampaignName:function(){return aM()[0]},getAttributionCampaignKeyword:function(){return aM()[1]},getAttributionReferrerTimestamp:function(){return aM()[2]
},getAttributionReferrerUrl:function(){return aM()[3]},setTrackerUrl:function(a1){ad=a1},setSiteId:function(a1){aZ=a1},setCustomData:function(a1,a2){if(n(a1)){aA=a1}else{if(!aA){aA=[]}aA[a1]=a2}},getCustomData:function(){return aA},setCustomVariable:function(a2,a1,a3){aK();if(a2>0&&a2<=aL){aO[a2]=[a1.slice(0,U),a3.slice(0,U)]}},getCustomVariable:function(a2){var a1;aK();a1=aO[a2];if(a1&&a1[0]===""){return}return aO[a2]},deleteCustomVariable:function(a1){if(this.getCustomVariable(a1)){this.setCustomVariable(a1,"","")}},setLinkTrackingTimer:function(a1){ac=a1},setDownloadExtensions:function(a1){aj=a1},addDownloadExtensions:function(a1){aj+="|"+a1},setDomains:function(a1){aH=q(a1)?[a1]:a1;aH.push(aa)},setIgnoreClasses:function(a1){P=q(a1)?[a1]:a1},setRequestMethod:function(a1){L=a1||"GET"},setReferrerUrl:function(a1){aG=a1},setCustomUrl:function(a1){aR=ai(W,a1)},setDocumentTitle:function(a1){aY=a1},setDownloadClasses:function(a1){aI=q(a1)?[a1]:a1},setLinkClasses:function(a1){aN=q(a1)?[a1]:a1
},setCampaignNameKey:function(a1){at=q(a1)?[a1]:a1},setCampaignKeywordKey:function(a1){aC=q(a1)?[a1]:a1},discardHashTag:function(a1){an=a1},setCookieNamePrefix:function(a1){aJ=a1;aO=X()},setCookieDomain:function(a1){S=l(a1);ak()},setCookiePath:function(a1){aE=a1;ak()},setVisitorCookieTimeout:function(a1){a0=a1*1000},setSessionCookieTimeout:function(a1){ag=a1*1000},setReferralCookieTimeout:function(a1){ab=a1*1000},setConversionAttributionFirstReferrer:function(a1){ax=a1},setDoNotTrack:function(a1){M=a1&&j.doNotTrack},addListener:function(a2,a1){aP(a2,a1)},enableLinkTracking:function(a1){if(h){ar(a1)}else{C.push(function(){ar(a1)})}},setHeartBeatTimer:function(a3,a2){var a1=new Date();K=a1.getTime()+a3*1000;am=a2*1000},killFrame:function(){if(H.location!==H.top.location){H.top.location=H.location}},redirectFile:function(a1){if(H.location.protocol==="file:"){H.location=a1}},trackGoal:function(a1,a3,a2){aT(a1,a3,a2)},trackLink:function(a2,a1,a3){ah(a2,a1,a3)},trackPageView:function(a1,a2){J(a1,a2)
}}}function c(){return{push:z}}t(H,"beforeunload",B,false);x();G=new E();for(D=0;D<_paq.length;D++){z(_paq[D])}_paq=new c();return{addPlugin:function(i,J){w[i]=J},getTracker:function(i,J){return new E(i,J)},getAsyncTracker:function(){return G}}}()),piwik_track,piwik_log=function(b,f,d,g){function a(h){try{return eval("piwik_"+h)}catch(i){}return}var c,e=Piwik.getTracker(d,f);e.setDocumentTitle(b);e.setCustomData(g);if(!!(c=a("tracker_pause"))){e.setLinkTrackingTimer(c)}if(!!(c=a("download_extensions"))){e.setDownloadExtensions(c)}if(!!(c=a("hosts_alias"))){e.setDomains(c)}if(!!(c=a("ignore_classes"))){e.setIgnoreClasses(c)}e.trackPageView();if((a("install_tracker"))){piwik_track=function(i,k,j,h){e.setSiteId(k);e.setTrackerUrl(j);e.trackLink(i,h)};e.enableLinkTracking()}}; | jozefizso/cdnjs | ajax/libs/piwik/1.4/piwik.js | JavaScript | mit | 17,047 |
/*!
* ui-select
* http://github.com/angular-ui/ui-select
* Version: 0.8.2 - 2014-10-09T23:29:49.713Z
* License: MIT
*/
(function () {
"use strict";
var KEY = {
TAB: 9,
ENTER: 13,
ESC: 27,
SPACE: 32,
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40,
SHIFT: 16,
CTRL: 17,
ALT: 18,
PAGE_UP: 33,
PAGE_DOWN: 34,
HOME: 36,
END: 35,
BACKSPACE: 8,
DELETE: 46,
COMMAND: 91,
isControl: function (e) {
var k = e.which;
switch (k) {
case KEY.COMMAND:
case KEY.SHIFT:
case KEY.CTRL:
case KEY.ALT:
return true;
}
if (e.metaKey) return true;
return false;
},
isFunctionKey: function (k) {
k = k.which ? k.which : k;
return k >= 112 && k <= 123;
},
isVerticalMovement: function (k){
return ~[KEY.UP, KEY.DOWN].indexOf(k);
},
isHorizontalMovement: function (k){
return ~[KEY.LEFT,KEY.RIGHT,KEY.BACKSPACE,KEY.DELETE].indexOf(k);
}
};
/**
* Add querySelectorAll() to jqLite.
*
* jqLite find() is limited to lookups by tag name.
* TODO This will change with future versions of AngularJS, to be removed when this happens
*
* See jqLite.find - why not use querySelectorAll? https://github.com/angular/angular.js/issues/3586
* See feat(jqLite): use querySelectorAll instead of getElementsByTagName in jqLite.find https://github.com/angular/angular.js/pull/3598
*/
if (angular.element.prototype.querySelectorAll === undefined) {
angular.element.prototype.querySelectorAll = function(selector) {
return angular.element(this[0].querySelectorAll(selector));
};
}
angular.module('ui.select', [])
.constant('uiSelectConfig', {
theme: 'bootstrap',
searchEnabled: true,
placeholder: '', // Empty by default, like HTML tag <select>
refreshDelay: 1000 // In milliseconds
})
// See Rename minErr and make it accessible from outside https://github.com/angular/angular.js/issues/6913
.service('uiSelectMinErr', function() {
var minErr = angular.$$minErr('ui.select');
return function() {
var error = minErr.apply(this, arguments);
var message = error.message.replace(new RegExp('\nhttp://errors.angularjs.org/.*'), '');
return new Error(message);
};
})
/**
* Parses "repeat" attribute.
*
* Taken from AngularJS ngRepeat source code
* See https://github.com/angular/angular.js/blob/v1.2.15/src/ng/directive/ngRepeat.js#L211
*
* Original discussion about parsing "repeat" attribute instead of fully relying on ng-repeat:
* https://github.com/angular-ui/ui-select/commit/5dd63ad#commitcomment-5504697
*/
.service('RepeatParser', ['uiSelectMinErr','$parse', function(uiSelectMinErr, $parse) {
var self = this;
/**
* Example:
* expression = "address in addresses | filter: {street: $select.search} track by $index"
* itemName = "address",
* source = "addresses | filter: {street: $select.search}",
* trackByExp = "$index",
*/
self.parse = function(expression) {
var match = expression.match(/^\s*(?:([\s\S]+?)\s+as\s+)?([\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);
if (!match) {
throw uiSelectMinErr('iexp', "Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",
expression);
}
return {
itemName: match[2], // (lhs) Left-hand side,
source: $parse(match[3]),
trackByExp: match[4],
modelMapper: $parse(match[1] || match[2])
};
};
self.getGroupNgRepeatExpression = function() {
return '$group in $select.groups';
};
self.getNgRepeatExpression = function(itemName, source, trackByExp, grouped) {
var expression = itemName + ' in ' + (grouped ? '$group.items' : source);
if (trackByExp) {
expression += ' track by ' + trackByExp;
}
return expression;
};
}])
/**
* Contains ui-select "intelligence".
*
* The goal is to limit dependency on the DOM whenever possible and
* put as much logic in the controller (instead of the link functions) as possible so it can be easily tested.
*/
.controller('uiSelectCtrl',
['$scope', '$element', '$timeout', 'RepeatParser', 'uiSelectMinErr',
function($scope, $element, $timeout, RepeatParser, uiSelectMinErr) {
var ctrl = this;
var EMPTY_SEARCH = '';
ctrl.placeholder = undefined;
ctrl.search = EMPTY_SEARCH;
ctrl.activeIndex = 0;
ctrl.activeMatchIndex = -1;
ctrl.items = [];
ctrl.selected = undefined;
ctrl.open = false;
ctrl.focus = false;
ctrl.focusser = undefined; //Reference to input element used to handle focus events
ctrl.disabled = undefined; // Initialized inside uiSelect directive link function
ctrl.searchEnabled = undefined; // Initialized inside uiSelect directive link function
ctrl.resetSearchInput = undefined; // Initialized inside uiSelect directive link function
ctrl.refreshDelay = undefined; // Initialized inside uiSelectChoices directive link function
ctrl.multiple = false; // Initialized inside uiSelect directive link function
ctrl.disableChoiceExpression = undefined; // Initialized inside uiSelect directive link function
ctrl.isEmpty = function() {
return angular.isUndefined(ctrl.selected) || ctrl.selected === null || ctrl.selected === '';
};
var _searchInput = $element.querySelectorAll('input.ui-select-search');
if (_searchInput.length !== 1) {
throw uiSelectMinErr('searchInput', "Expected 1 input.ui-select-search but got '{0}'.", _searchInput.length);
}
// Most of the time the user does not want to empty the search input when in typeahead mode
function _resetSearchInput() {
if (ctrl.resetSearchInput) {
ctrl.search = EMPTY_SEARCH;
//reset activeIndex
if (ctrl.selected && ctrl.items.length && !ctrl.multiple) {
ctrl.activeIndex = ctrl.items.indexOf(ctrl.selected);
}
}
}
// When the user clicks on ui-select, displays the dropdown list
ctrl.activate = function(initSearchValue, avoidReset) {
if (!ctrl.disabled && !ctrl.open) {
if(!avoidReset) _resetSearchInput();
ctrl.focusser.prop('disabled', true); //Will reactivate it on .close()
ctrl.open = true;
ctrl.activeMatchIndex = -1;
ctrl.activeIndex = ctrl.activeIndex >= ctrl.items.length ? 0 : ctrl.activeIndex;
// Give it time to appear before focus
$timeout(function() {
ctrl.search = initSearchValue || ctrl.search;
_searchInput[0].focus();
});
}
};
ctrl.findGroupByName = function(name) {
return ctrl.groups && ctrl.groups.filter(function(group) {
return group.name === name;
})[0];
};
ctrl.parseRepeatAttr = function(repeatAttr, groupByExp) {
function updateGroups(items) {
ctrl.groups = [];
angular.forEach(items, function(item) {
var groupFn = $scope.$eval(groupByExp);
var groupName = angular.isFunction(groupFn) ? groupFn(item) : item[groupFn];
var group = ctrl.findGroupByName(groupName);
if(group) {
group.items.push(item);
}
else {
ctrl.groups.push({name: groupName, items: [item]});
}
});
ctrl.items = [];
ctrl.groups.forEach(function(group) {
ctrl.items = ctrl.items.concat(group.items);
});
}
function setPlainItems(items) {
ctrl.items = items;
}
var setItemsFn = groupByExp ? updateGroups : setPlainItems;
ctrl.parserResult = RepeatParser.parse(repeatAttr);
ctrl.isGrouped = !!groupByExp;
ctrl.itemProperty = ctrl.parserResult.itemName;
// See https://github.com/angular/angular.js/blob/v1.2.15/src/ng/directive/ngRepeat.js#L259
$scope.$watchCollection(ctrl.parserResult.source, function(items) {
if (items === undefined || items === null) {
// If the user specifies undefined or null => reset the collection
// Special case: items can be undefined if the user did not initialized the collection on the scope
// i.e $scope.addresses = [] is missing
ctrl.items = [];
} else {
if (!angular.isArray(items)) {
throw uiSelectMinErr('items', "Expected an array but got '{0}'.", items);
} else {
if (ctrl.multiple){
//Remove already selected items (ex: while searching)
var filteredItems = items.filter(function(i) {return ctrl.selected.indexOf(i) < 0;});
setItemsFn(filteredItems);
}else{
setItemsFn(items);
}
ctrl.ngModel.$modelValue = null; //Force scope model value and ngModel value to be out of sync to re-run formatters
}
}
});
if (ctrl.multiple){
//Remove already selected items
$scope.$watchCollection('$select.selected', function(selectedItems){
var data = ctrl.parserResult.source($scope);
if (!selectedItems.length) {
setItemsFn(data);
}else{
var filteredItems = data.filter(function(i) {return selectedItems.indexOf(i) < 0;});
setItemsFn(filteredItems);
}
ctrl.sizeSearchInput();
});
}
};
var _refreshDelayPromise;
/**
* Typeahead mode: lets the user refresh the collection using his own function.
*
* See Expose $select.search for external / remote filtering https://github.com/angular-ui/ui-select/pull/31
*/
ctrl.refresh = function(refreshAttr) {
if (refreshAttr !== undefined) {
// Debounce
// See https://github.com/angular-ui/bootstrap/blob/0.10.0/src/typeahead/typeahead.js#L155
// FYI AngularStrap typeahead does not have debouncing: https://github.com/mgcrea/angular-strap/blob/v2.0.0-rc.4/src/typeahead/typeahead.js#L177
if (_refreshDelayPromise) {
$timeout.cancel(_refreshDelayPromise);
}
_refreshDelayPromise = $timeout(function() {
$scope.$eval(refreshAttr);
}, ctrl.refreshDelay);
}
};
ctrl.setActiveItem = function(item) {
ctrl.activeIndex = ctrl.items.indexOf(item);
};
ctrl.isActive = function(itemScope) {
return ctrl.open && ctrl.items.indexOf(itemScope[ctrl.itemProperty]) === ctrl.activeIndex;
};
ctrl.isDisabled = function(itemScope) {
if (!ctrl.open) return;
var itemIndex = ctrl.items.indexOf(itemScope[ctrl.itemProperty]);
var isDisabled = false;
var item;
if (itemIndex >= 0 && !angular.isUndefined(ctrl.disableChoiceExpression)) {
item = ctrl.items[itemIndex];
isDisabled = !!(itemScope.$eval(ctrl.disableChoiceExpression)); // force the boolean value
item._uiSelectChoiceDisabled = isDisabled; // store this for later reference
}
return isDisabled;
};
// When the user clicks on an item inside the dropdown
ctrl.select = function(item, skipFocusser) {
if (item === undefined || !item._uiSelectChoiceDisabled) {
var locals = {};
locals[ctrl.parserResult.itemName] = item;
ctrl.onSelectCallback($scope, {
$item: item,
$model: ctrl.parserResult.modelMapper($scope, locals)
});
if(ctrl.multiple){
ctrl.selected.push(item);
ctrl.sizeSearchInput();
} else {
ctrl.selected = item;
}
ctrl.close(skipFocusser);
}
};
// Closes the dropdown
ctrl.close = function(skipFocusser) {
if (!ctrl.open) return;
_resetSearchInput();
ctrl.open = false;
if (!ctrl.multiple){
$timeout(function(){
ctrl.focusser.prop('disabled', false);
if (!skipFocusser) ctrl.focusser[0].focus();
},0,false);
}
};
// Toggle dropdown
ctrl.toggle = function(e) {
if (ctrl.open) ctrl.close(); else ctrl.activate();
e.preventDefault();
e.stopPropagation();
};
// Remove item from multiple select
ctrl.removeChoice = function(index){
var removedChoice = ctrl.selected[index];
var locals = {};
locals[ctrl.parserResult.itemName] = removedChoice;
ctrl.selected.splice(index, 1);
ctrl.activeMatchIndex = -1;
ctrl.sizeSearchInput();
ctrl.onRemoveCallback($scope, {
$item: removedChoice,
$model: ctrl.parserResult.modelMapper($scope, locals)
});
};
ctrl.getPlaceholder = function(){
//Refactor single?
if(ctrl.multiple && ctrl.selected.length) return;
return ctrl.placeholder;
};
ctrl.sizeSearchInput = function(){
var input = _searchInput[0],
container = _searchInput.parent().parent()[0];
_searchInput.css('width','10px');
$timeout(function(){
var newWidth = container.clientWidth - input.offsetLeft - 10;
if(newWidth < 50) newWidth = container.clientWidth;
_searchInput.css('width',newWidth+'px');
}, 0, false);
};
function _handleDropDownSelection(key) {
var processed = true;
switch (key) {
case KEY.DOWN:
if (!ctrl.open && ctrl.multiple) ctrl.activate(false, true); //In case its the search input in 'multiple' mode
else if (ctrl.activeIndex < ctrl.items.length - 1) { ctrl.activeIndex++; }
break;
case KEY.UP:
if (!ctrl.open && ctrl.multiple) ctrl.activate(false, true); //In case its the search input in 'multiple' mode
else if (ctrl.activeIndex > 0) { ctrl.activeIndex--; }
break;
case KEY.TAB:
if (!ctrl.multiple || ctrl.open) ctrl.select(ctrl.items[ctrl.activeIndex], true);
break;
case KEY.ENTER:
if(ctrl.open){
ctrl.select(ctrl.items[ctrl.activeIndex]);
} else {
ctrl.activate(false, true); //In case its the search input in 'multiple' mode
}
break;
case KEY.ESC:
ctrl.close();
break;
default:
processed = false;
}
return processed;
}
// Handles selected options in "multiple" mode
function _handleMatchSelection(key){
var caretPosition = _getCaretPosition(_searchInput[0]),
length = ctrl.selected.length,
// none = -1,
first = 0,
last = length-1,
curr = ctrl.activeMatchIndex,
next = ctrl.activeMatchIndex+1,
prev = ctrl.activeMatchIndex-1,
newIndex = curr;
if(caretPosition > 0 || (ctrl.search.length && key == KEY.RIGHT)) return false;
ctrl.close();
function getNewActiveMatchIndex(){
switch(key){
case KEY.LEFT:
// Select previous/first item
if(~ctrl.activeMatchIndex) return prev;
// Select last item
else return last;
break;
case KEY.RIGHT:
// Open drop-down
if(!~ctrl.activeMatchIndex || curr === last){
ctrl.activate();
return false;
}
// Select next/last item
else return next;
break;
case KEY.BACKSPACE:
// Remove selected item and select previous/first
if(~ctrl.activeMatchIndex){
ctrl.removeChoice(curr);
return prev;
}
// Select last item
else return last;
break;
case KEY.DELETE:
// Remove selected item and select next item
if(~ctrl.activeMatchIndex){
ctrl.removeChoice(ctrl.activeMatchIndex);
return curr;
}
else return false;
}
}
newIndex = getNewActiveMatchIndex();
if(!ctrl.selected.length || newIndex === false) ctrl.activeMatchIndex = -1;
else ctrl.activeMatchIndex = Math.min(last,Math.max(first,newIndex));
return true;
}
// Bind to keyboard shortcuts
_searchInput.on('keydown', function(e) {
var key = e.which;
// if(~[KEY.ESC,KEY.TAB].indexOf(key)){
// //TODO: SEGURO?
// ctrl.close();
// }
$scope.$apply(function() {
var processed = false;
if(ctrl.multiple && KEY.isHorizontalMovement(key)){
processed = _handleMatchSelection(key);
}
if (!processed && ctrl.items.length > 0) {
processed = _handleDropDownSelection(key);
}
if (processed && key != KEY.TAB) {
//TODO Check si el tab selecciona aun correctamente
//Crear test
e.preventDefault();
e.stopPropagation();
}
});
if(KEY.isVerticalMovement(key) && ctrl.items.length > 0){
_ensureHighlightVisible();
}
});
_searchInput.on('blur', function() {
$timeout(function() {
ctrl.activeMatchIndex = -1;
});
});
function _getCaretPosition(el) {
if(angular.isNumber(el.selectionStart)) return el.selectionStart;
// selectionStart is not supported in IE8 and we don't want hacky workarounds so we compromise
else return el.value.length;
}
// See https://github.com/ivaynberg/select2/blob/3.4.6/select2.js#L1431
function _ensureHighlightVisible() {
var container = $element.querySelectorAll('.ui-select-choices-content');
var choices = container.querySelectorAll('.ui-select-choices-row');
if (choices.length < 1) {
throw uiSelectMinErr('choices', "Expected multiple .ui-select-choices-row but got '{0}'.", choices.length);
}
var highlighted = choices[ctrl.activeIndex];
var posY = highlighted.offsetTop + highlighted.clientHeight - container[0].scrollTop;
var height = container[0].offsetHeight;
if (posY > height) {
container[0].scrollTop += posY - height;
} else if (posY < highlighted.clientHeight) {
if (ctrl.isGrouped && ctrl.activeIndex === 0)
container[0].scrollTop = 0; //To make group header visible when going all the way up
else
container[0].scrollTop -= highlighted.clientHeight - posY;
}
}
$scope.$on('$destroy', function() {
_searchInput.off('keydown blur');
});
}])
.directive('uiSelect',
['$document', 'uiSelectConfig', 'uiSelectMinErr', '$compile', '$parse',
function($document, uiSelectConfig, uiSelectMinErr, $compile, $parse) {
return {
restrict: 'EA',
templateUrl: function(tElement, tAttrs) {
var theme = tAttrs.theme || uiSelectConfig.theme;
return theme + (angular.isDefined(tAttrs.multiple) ? '/select-multiple.tpl.html' : '/select.tpl.html');
},
replace: true,
transclude: true,
require: ['uiSelect', 'ngModel'],
scope: true,
controller: 'uiSelectCtrl',
controllerAs: '$select',
link: function(scope, element, attrs, ctrls, transcludeFn) {
var $select = ctrls[0];
var ngModel = ctrls[1];
var searchInput = element.querySelectorAll('input.ui-select-search');
$select.multiple = (angular.isDefined(attrs.multiple)) ? (attrs.multiple === '') ? true : (attrs.multiple.toLowerCase() === 'true') : false;
$select.onSelectCallback = $parse(attrs.onSelect);
$select.onRemoveCallback = $parse(attrs.onRemove);
//From view --> model
ngModel.$parsers.unshift(function (inputValue) {
var locals = {},
result;
if ($select.multiple){
var resultMultiple = [];
for (var j = $select.selected.length - 1; j >= 0; j--) {
locals = {};
locals[$select.parserResult.itemName] = $select.selected[j];
result = $select.parserResult.modelMapper(scope, locals);
resultMultiple.unshift(result);
}
return resultMultiple;
}else{
locals = {};
locals[$select.parserResult.itemName] = inputValue;
result = $select.parserResult.modelMapper(scope, locals);
return result;
}
});
//From model --> view
ngModel.$formatters.unshift(function (inputValue) {
var data = $select.parserResult.source (scope, { $select : {search:''}}), //Overwrite $search
locals = {},
result;
if (data){
if ($select.multiple){
var resultMultiple = [];
var checkFnMultiple = function(list, value){
if (!list || !list.length) return;
for (var p = list.length - 1; p >= 0; p--) {
locals[$select.parserResult.itemName] = list[p];
result = $select.parserResult.modelMapper(scope, locals);
if (result == value){
resultMultiple.unshift(list[p]);
return true;
}
}
return false;
};
if (!inputValue) return resultMultiple; //If ngModel was undefined
for (var k = inputValue.length - 1; k >= 0; k--) {
if (!checkFnMultiple($select.selected, inputValue[k])){
checkFnMultiple(data, inputValue[k]);
}
}
return resultMultiple;
}else{
var checkFnSingle = function(d){
locals[$select.parserResult.itemName] = d;
result = $select.parserResult.modelMapper(scope, locals);
return result == inputValue;
};
//If possible pass same object stored in $select.selected
if ($select.selected && checkFnSingle($select.selected)) {
return $select.selected;
}
for (var i = data.length - 1; i >= 0; i--) {
if (checkFnSingle(data[i])) return data[i];
}
}
}
return inputValue;
});
//Set reference to ngModel from uiSelectCtrl
$select.ngModel = ngModel;
//Idea from: https://github.com/ivaynberg/select2/blob/79b5bf6db918d7560bdd959109b7bcfb47edaf43/select2.js#L1954
var focusser = angular.element("<input ng-disabled='$select.disabled' class='ui-select-focusser ui-select-offscreen' type='text' aria-haspopup='true' role='button' />");
if(attrs.tabindex){
//tabindex might be an expression, wait until it contains the actual value before we set the focusser tabindex
attrs.$observe('tabindex', function(value) {
//If we are using multiple, add tabindex to the search input
if($select.multiple){
searchInput.attr("tabindex", value);
} else {
focusser.attr("tabindex", value);
}
//Remove the tabindex on the parent so that it is not focusable
element.removeAttr("tabindex");
});
}
$compile(focusser)(scope);
$select.focusser = focusser;
if (!$select.multiple){
element.append(focusser);
focusser.bind("focus", function(){
scope.$evalAsync(function(){
$select.focus = true;
});
});
focusser.bind("blur", function(){
scope.$evalAsync(function(){
$select.focus = false;
});
});
focusser.bind("keydown", function(e){
if (e.which === KEY.BACKSPACE) {
e.preventDefault();
e.stopPropagation();
$select.select(undefined);
scope.$apply();
return;
}
if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) || e.which === KEY.ESC) {
return;
}
if (e.which == KEY.DOWN || e.which == KEY.UP || e.which == KEY.ENTER || e.which == KEY.SPACE){
e.preventDefault();
e.stopPropagation();
$select.activate();
}
scope.$digest();
});
focusser.bind("keyup input", function(e){
if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) || e.which === KEY.ESC || e.which == KEY.ENTER || e.which === KEY.BACKSPACE) {
return;
}
$select.activate(focusser.val()); //User pressed some regular key, so we pass it to the search input
focusser.val('');
scope.$digest();
});
}
scope.$watch('searchEnabled', function() {
var searchEnabled = scope.$eval(attrs.searchEnabled);
$select.searchEnabled = searchEnabled !== undefined ? searchEnabled : true;
});
attrs.$observe('disabled', function() {
// No need to use $eval() (thanks to ng-disabled) since we already get a boolean instead of a string
$select.disabled = attrs.disabled !== undefined ? attrs.disabled : false;
});
attrs.$observe('resetSearchInput', function() {
// $eval() is needed otherwise we get a string instead of a boolean
var resetSearchInput = scope.$eval(attrs.resetSearchInput);
$select.resetSearchInput = resetSearchInput !== undefined ? resetSearchInput : true;
});
if ($select.multiple){
scope.$watchCollection('$select.selected', function() {
ngModel.$setViewValue(Date.now()); //Set timestamp as a unique string to force changes
});
focusser.prop('disabled', true); //Focusser isn't needed if multiple
}else{
scope.$watch('$select.selected', function(newValue) {
if (ngModel.$viewValue !== newValue) {
ngModel.$setViewValue(newValue);
}
});
}
ngModel.$render = function() {
if($select.multiple){
// Make sure that model value is array
if(!angular.isArray(ngModel.$viewValue)){
// Have tolerance for null or undefined values
if(angular.isUndefined(ngModel.$viewValue) || ngModel.$viewValue === null){
$select.selected = [];
} else {
throw uiSelectMinErr('multiarr', "Expected model value to be array but got '{0}'", ngModel.$viewValue);
}
}
}
$select.selected = ngModel.$viewValue;
};
function onDocumentClick(e) {
var contains = false;
if (window.jQuery) {
// Firefox 3.6 does not support element.contains()
// See Node.contains https://developer.mozilla.org/en-US/docs/Web/API/Node.contains
contains = window.jQuery.contains(element[0], e.target);
} else {
contains = element[0].contains(e.target);
}
if (!contains) {
$select.close();
scope.$digest();
}
}
// See Click everywhere but here event http://stackoverflow.com/questions/12931369
$document.on('click', onDocumentClick);
scope.$on('$destroy', function() {
$document.off('click', onDocumentClick);
});
// Move transcluded elements to their correct position in main template
transcludeFn(scope, function(clone) {
// See Transclude in AngularJS http://blog.omkarpatil.com/2012/11/transclude-in-angularjs.html
// One day jqLite will be replaced by jQuery and we will be able to write:
// var transcludedElement = clone.filter('.my-class')
// instead of creating a hackish DOM element:
var transcluded = angular.element('<div>').append(clone);
var transcludedMatch = transcluded.querySelectorAll('.ui-select-match');
transcludedMatch.removeAttr('ui-select-match'); //To avoid loop in case directive as attr
if (transcludedMatch.length !== 1) {
throw uiSelectMinErr('transcluded', "Expected 1 .ui-select-match but got '{0}'.", transcludedMatch.length);
}
element.querySelectorAll('.ui-select-match').replaceWith(transcludedMatch);
var transcludedChoices = transcluded.querySelectorAll('.ui-select-choices');
transcludedChoices.removeAttr('ui-select-choices'); //To avoid loop in case directive as attr
if (transcludedChoices.length !== 1) {
throw uiSelectMinErr('transcluded', "Expected 1 .ui-select-choices but got '{0}'.", transcludedChoices.length);
}
element.querySelectorAll('.ui-select-choices').replaceWith(transcludedChoices);
});
}
};
}])
.directive('uiSelectChoices',
['uiSelectConfig', 'RepeatParser', 'uiSelectMinErr', '$compile',
function(uiSelectConfig, RepeatParser, uiSelectMinErr, $compile) {
return {
restrict: 'EA',
require: '^uiSelect',
replace: true,
transclude: true,
templateUrl: function(tElement) {
// Gets theme attribute from parent (ui-select)
var theme = tElement.parent().attr('theme') || uiSelectConfig.theme;
return theme + '/choices.tpl.html';
},
compile: function(tElement, tAttrs) {
if (!tAttrs.repeat) throw uiSelectMinErr('repeat', "Expected 'repeat' expression.");
return function link(scope, element, attrs, $select, transcludeFn) {
// var repeat = RepeatParser.parse(attrs.repeat);
var groupByExp = attrs.groupBy;
$select.parseRepeatAttr(attrs.repeat, groupByExp); //Result ready at $select.parserResult
$select.disableChoiceExpression = attrs.uiDisableChoice;
if(groupByExp) {
var groups = element.querySelectorAll('.ui-select-choices-group');
if (groups.length !== 1) throw uiSelectMinErr('rows', "Expected 1 .ui-select-choices-group but got '{0}'.", groups.length);
groups.attr('ng-repeat', RepeatParser.getGroupNgRepeatExpression());
}
var choices = element.querySelectorAll('.ui-select-choices-row');
if (choices.length !== 1) {
throw uiSelectMinErr('rows', "Expected 1 .ui-select-choices-row but got '{0}'.", choices.length);
}
choices.attr('ng-repeat', RepeatParser.getNgRepeatExpression($select.parserResult.itemName, '$select.items', $select.parserResult.trackByExp, groupByExp))
.attr('ng-mouseenter', '$select.setActiveItem('+$select.parserResult.itemName +')')
.attr('ng-click', '$select.select(' + $select.parserResult.itemName + ')');
var rowsInner = element.querySelectorAll('.ui-select-choices-row-inner');
if (rowsInner.length !== 1) throw uiSelectMinErr('rows', "Expected 1 .ui-select-choices-row-inner but got '{0}'.", rowsInner.length);
rowsInner.attr('uis-transclude-append', ''); //Adding uisTranscludeAppend directive to row element after choices element has ngRepeat
$compile(element, transcludeFn)(scope); //Passing current transcludeFn to be able to append elements correctly from uisTranscludeAppend
scope.$watch('$select.search', function(newValue) {
if(newValue && !$select.open && $select.multiple) $select.activate(false, true);
$select.activeIndex = 0;
$select.refresh(attrs.refresh);
});
attrs.$observe('refreshDelay', function() {
// $eval() is needed otherwise we get a string instead of a number
var refreshDelay = scope.$eval(attrs.refreshDelay);
$select.refreshDelay = refreshDelay !== undefined ? refreshDelay : uiSelectConfig.refreshDelay;
});
};
}
};
}])
// Recreates old behavior of ng-transclude. Used internally.
.directive('uisTranscludeAppend', function () {
return {
link: function (scope, element, attrs, ctrl, transclude) {
transclude(scope, function (clone) {
element.append(clone);
});
}
};
})
.directive('uiSelectMatch', ['uiSelectConfig', function(uiSelectConfig) {
return {
restrict: 'EA',
require: '^uiSelect',
replace: true,
transclude: true,
templateUrl: function(tElement) {
// Gets theme attribute from parent (ui-select)
var theme = tElement.parent().attr('theme') || uiSelectConfig.theme;
var multi = tElement.parent().attr('multiple');
return theme + (multi ? '/match-multiple.tpl.html' : '/match.tpl.html');
},
link: function(scope, element, attrs, $select) {
attrs.$observe('placeholder', function(placeholder) {
$select.placeholder = placeholder !== undefined ? placeholder : uiSelectConfig.placeholder;
});
if($select.multiple){
$select.sizeSearchInput();
}
}
};
}])
/**
* Highlights text that matches $select.search.
*
* Taken from AngularUI Bootstrap Typeahead
* See https://github.com/angular-ui/bootstrap/blob/0.10.0/src/typeahead/typeahead.js#L340
*/
.filter('highlight', function() {
function escapeRegexp(queryToEscape) {
return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
}
return function(matchItem, query) {
return query && matchItem ? matchItem.replace(new RegExp(escapeRegexp(query), 'gi'), '<span class="ui-select-highlight">$&</span>') : matchItem;
};
});
}());
angular.module("ui.select").run(["$templateCache", function($templateCache) {$templateCache.put("bootstrap/choices.tpl.html","<ul class=\"ui-select-choices ui-select-choices-content dropdown-menu\" role=\"menu\" aria-labelledby=\"dLabel\" ng-show=\"$select.items.length > 0\"><li class=\"ui-select-choices-group\"><div class=\"divider\" ng-show=\"$select.isGrouped && $index > 0\"></div><div ng-show=\"$select.isGrouped\" class=\"ui-select-choices-group-label dropdown-header\">{{$group.name}}</div><div class=\"ui-select-choices-row\" ng-class=\"{active: $select.isActive(this), disabled: $select.isDisabled(this)}\"><a href=\"javascript:void(0)\" class=\"ui-select-choices-row-inner\"></a></div></li></ul>");
$templateCache.put("bootstrap/match-multiple.tpl.html","<span class=\"ui-select-match\"><span ng-repeat=\"$item in $select.selected\"><span style=\"margin-right: 3px;\" class=\"ui-select-match-item btn btn-default btn-xs\" tabindex=\"-1\" type=\"button\" ng-disabled=\"$select.disabled\" ng-click=\"$select.activeMatchIndex = $index;\" ng-class=\"{\'btn-primary\':$select.activeMatchIndex === $index}\"><span class=\"close ui-select-match-close\" ng-hide=\"$select.disabled\" ng-click=\"$select.removeChoice($index)\"> ×</span> <span uis-transclude-append=\"\"></span></span></span></span>");
$templateCache.put("bootstrap/match.tpl.html","<button type=\"button\" class=\"btn btn-default form-control ui-select-match\" tabindex=\"-1\" ng-hide=\"$select.open\" ng-disabled=\"$select.disabled\" ng-class=\"{\'btn-default-focus\':$select.focus}\" ;=\"\" ng-click=\"$select.activate()\"><span ng-show=\"$select.searchEnabled && $select.isEmpty()\" class=\"text-muted\">{{$select.placeholder}}</span> <span ng-hide=\"$select.isEmpty()\" ng-transclude=\"\"></span> <span class=\"caret ui-select-toggle\" ng-click=\"$select.toggle($event)\"></span></button>");
$templateCache.put("bootstrap/select-multiple.tpl.html","<div class=\"ui-select-multiple ui-select-bootstrap dropdown form-control\" ng-class=\"{open: $select.open}\"><div><div class=\"ui-select-match\"></div><input type=\"text\" autocomplete=\"off\" autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" class=\"ui-select-search input-xs\" placeholder=\"{{$select.getPlaceholder()}}\" ng-disabled=\"$select.disabled\" ng-hide=\"$select.disabled\" ng-click=\"$select.activate()\" ng-model=\"$select.search\"></div><div class=\"ui-select-choices\"></div></div>");
$templateCache.put("bootstrap/select.tpl.html","<div class=\"ui-select-bootstrap dropdown\" ng-class=\"{open: $select.open}\"><div class=\"ui-select-match\"></div><input type=\"text\" autocomplete=\"off\" tabindex=\"-1\" class=\"form-control ui-select-search\" placeholder=\"{{$select.placeholder}}\" ng-model=\"$select.search\" ng-show=\"$select.searchEnabled && $select.open\"><div class=\"ui-select-choices\"></div></div>");
$templateCache.put("select2/choices.tpl.html","<ul class=\"ui-select-choices ui-select-choices-content select2-results\"><li class=\"ui-select-choices-group\" ng-class=\"{\'select2-result-with-children\': $select.isGrouped}\"><div ng-show=\"$select.isGrouped\" class=\"ui-select-choices-group-label select2-result-label\">{{$group.name}}</div><ul ng-class=\"{\'select2-result-sub\': $select.isGrouped, \'select2-result-single\': !$select.isGrouped}\"><li class=\"ui-select-choices-row\" ng-class=\"{\'select2-highlighted\': $select.isActive(this), \'select2-disabled\': $select.isDisabled(this)}\"><div class=\"select2-result-label ui-select-choices-row-inner\"></div></li></ul></li></ul>");
$templateCache.put("select2/match-multiple.tpl.html","<span class=\"ui-select-match\"><li class=\"ui-select-match-item select2-search-choice\" ng-repeat=\"$item in $select.selected\" ng-class=\"{\'select2-search-choice-focus\':$select.activeMatchIndex === $index}\"><span uis-transclude-append=\"\"></span> <a href=\"javascript:;\" class=\"ui-select-match-close select2-search-choice-close\" ng-click=\"$select.removeChoice($index)\" tabindex=\"-1\"></a></li></span>");
$templateCache.put("select2/match.tpl.html","<a class=\"select2-choice ui-select-match\" ng-class=\"{\'select2-default\': $select.isEmpty()}\" ng-click=\"$select.activate()\"><span ng-show=\"$select.searchEnabled && $select.isEmpty()\" class=\"select2-chosen\">{{$select.placeholder}}</span> <span ng-hide=\"$select.isEmpty()\" class=\"select2-chosen\" ng-transclude=\"\"></span> <span class=\"select2-arrow ui-select-toggle\" ng-click=\"$select.toggle($event)\"><b></b></span></a>");
$templateCache.put("select2/select-multiple.tpl.html","<div class=\"ui-select-multiple select2 select2-container select2-container-multi\" ng-class=\"{\'select2-container-active select2-dropdown-open\': $select.open,\n \'select2-container-disabled\': $select.disabled}\"><ul class=\"select2-choices\"><span class=\"ui-select-match\"></span><li class=\"select2-search-field\"><input type=\"text\" autocomplete=\"off\" autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" class=\"select2-input ui-select-search\" placeholder=\"{{$select.getPlaceholder()}}\" ng-disabled=\"$select.disabled\" ng-hide=\"$select.disabled\" ng-model=\"$select.search\" ng-click=\"$select.activate()\" style=\"width: 34px;\"></li></ul><div class=\"select2-drop select2-with-searchbox select2-drop-active\" ng-class=\"{\'select2-display-none\': !$select.open}\"><div class=\"ui-select-choices\"></div></div></div>");
$templateCache.put("select2/select.tpl.html","<div class=\"select2 select2-container\" ng-class=\"{\'select2-container-active select2-dropdown-open\': $select.open,\n \'select2-container-disabled\': $select.disabled,\n \'select2-container-active\': $select.focus }\"><div class=\"ui-select-match\"></div><div class=\"select2-drop select2-with-searchbox select2-drop-active\" ng-class=\"{\'select2-display-none\': !$select.open}\"><div class=\"select2-search\" ng-show=\"$select.searchEnabled\"><input type=\"text\" autocomplete=\"off\" autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" class=\"ui-select-search select2-input\" ng-model=\"$select.search\"></div><div class=\"ui-select-choices\"></div></div></div>");
$templateCache.put("selectize/choices.tpl.html","<div ng-show=\"$select.open\" class=\"ui-select-choices selectize-dropdown single\"><div class=\"ui-select-choices-content selectize-dropdown-content\"><div class=\"ui-select-choices-group optgroup\"><div ng-show=\"$select.isGrouped\" class=\"ui-select-choices-group-label optgroup-header\">{{$group.name}}</div><div class=\"ui-select-choices-row\" ng-class=\"{active: $select.isActive(this), disabled: $select.isDisabled(this)}\"><div class=\"option ui-select-choices-row-inner\" data-selectable=\"\"></div></div></div></div></div>");
$templateCache.put("selectize/match.tpl.html","<div ng-hide=\"$select.searchEnabled && ($select.open || $select.isEmpty())\" class=\"ui-select-match\" ng-transclude=\"\"></div>");
$templateCache.put("selectize/select.tpl.html","<div class=\"selectize-control single\"><div class=\"selectize-input\" ng-class=\"{\'focus\': $select.open, \'disabled\': $select.disabled, \'selectize-focus\' : $select.focus}\" ng-click=\"$select.activate()\"><div class=\"ui-select-match\"></div><input type=\"text\" autocomplete=\"off\" tabindex=\"-1\" class=\"ui-select-search ui-select-toggle\" ng-click=\"$select.toggle($event)\" placeholder=\"{{$select.placeholder}}\" ng-model=\"$select.search\" ng-hide=\"!$select.searchEnabled || ($select.selected && !$select.open)\" ng-disabled=\"$select.disabled\"></div><div class=\"ui-select-choices\"></div></div>");}]); | yinghunglai/cdnjs | ajax/libs/angular-ui-select/0.8.2/select.js | JavaScript | mit | 41,462 |
/**
* angular-strap
* @version v2.0.0-beta.4 - 2014-01-20
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes <olivier@mg-crea.com>
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
'use strict';
angular.module('mgcrea.ngStrap.tab', []).run([
'$templateCache',
function ($templateCache) {
$templateCache.put('$pane', '{{pane.content}}');
var template = '<ul class="nav nav-tabs">' + '<li ng-repeat="pane in panes" ng-class="{active:$index==active}">' + '<a data-toggle="tab" ng-click="setActive($index, $event)" data-index="{{$index}}">{{pane.title}}</a>' + '</li>' + '</ul>' + '<div class="tab-content">' + '<div ng-repeat="pane in panes" class="tab-pane" ng-class="[$index==active?\'active\':\'\']" ng-include="pane.template || \'$pane\'"></div>' + '</div>';
$templateCache.put('$tabs', template);
}
]).provider('$tab', function () {
var defaults = this.defaults = {
animation: 'animation-fade',
template: '$tabs'
};
this.$get = function () {
return { defaults: defaults };
};
}).directive('bsTabs', [
'$window',
'$animate',
'$tab',
function ($window, $animate, $tab) {
var defaults = $tab.defaults;
return {
restrict: 'EAC',
scope: true,
require: '?ngModel',
templateUrl: function (element, attr) {
return attr.template || defaults.template;
},
link: function postLink(scope, element, attr, controller) {
var options = defaults;
angular.forEach(['animation'], function (key) {
if (angular.isDefined(attr[key]))
options[key] = attr[key];
});
attr.bsTabs && scope.$watch(attr.bsTabs, function (newValue, oldValue) {
scope.panes = newValue;
}, true);
element.addClass('tabs');
if (options.animation) {
element.addClass(options.animation);
}
scope.active = scope.activePane = 0;
scope.setActive = function (index, ev) {
scope.active = index;
if (controller) {
controller.$setViewValue(index);
}
};
if (controller) {
controller.$render = function () {
scope.active = controller.$modelValue * 1;
};
}
}
};
}
]); | gswalden/cdnjs | ajax/libs/angular-strap/2.0.0-beta.4/modules/tab.js | JavaScript | mit | 2,288 |
/// <reference path="kineticjs.d.ts"/>
// http://www.html5canvastutorials.com/kineticjs/html5-canvas-kineticjs-rect-tutorial/
module RectTutorial {
var stage = new Kinetic.Stage({
container: 'container',
width: 578,
height: 200
});
var layer = new Kinetic.Layer();
var rect = new Kinetic.Rect({
x: 239,
y: 75,
width: 100,
height: 50,
fill: 'green',
stroke: 'black',
strokeWidth: 4
});
// add the shape to the layer
layer.add(rect);
// add the layer to the stage
stage.add(layer);
}
// http://www.html5canvastutorials.com/kineticjs/html5-canvas-kineticjs-circle-tutorial/
module CircleTutorial {
var stage = new Kinetic.Stage({
container: 'container',
width: 578,
height: 200
});
var layer = new Kinetic.Layer();
var circle = new Kinetic.Circle({
x: stage.getWidth() / 2,
y: stage.getHeight() / 2,
radius: 70,
fill: 'red',
stroke: 'black',
strokeWidth: 4
});
// add the shape to the layer
layer.add(circle);
// add the layer to the stage
stage.add(layer);
}
| arueckle/DefinitelyTyped | kineticjs/kineticjs-tests.ts | TypeScript | mit | 1,191 |
/**
* angular-strap
* @version v2.0.0-beta.4 - 2014-01-20
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes <olivier@mg-crea.com>
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
'use strict';
angular.module('mgcrea.ngStrap.alert', []).run([
'$templateCache',
function ($templateCache) {
var template = '' + '<div class="alert" tabindex="-1" ng-class="[type ? \'alert-\' + type : null]">' + '<button type="button" class="close" ng-click="$hide()">×</button>' + '<strong ng-bind="title"></strong> <span ng-bind-html="content"></span>' + '</div>';
$templateCache.put('$alert', template);
}
]).provider('$alert', function () {
var defaults = this.defaults = {
animation: 'animation-fade',
prefixClass: 'alert',
placement: null,
template: '$alert',
container: false,
element: null,
backdrop: false,
keyboard: true,
show: true,
duration: false
};
this.$get = [
'$modal',
'$timeout',
function ($modal, $timeout) {
function AlertFactory(config) {
var $alert = {};
var options = angular.extend({}, defaults, config);
$alert = $modal(options);
if (!options.scope) {
angular.forEach(['type'], function (key) {
if (options[key])
$alert.$scope[key] = options[key];
});
}
var show = $alert.show;
if (options.duration) {
$alert.show = function () {
show();
$timeout(function () {
$alert.hide();
}, options.duration * 1000);
};
}
return $alert;
}
return AlertFactory;
}
];
}).directive('bsAlert', [
'$window',
'$location',
'$sce',
'$alert',
function ($window, $location, $sce, $alert) {
var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;
return {
restrict: 'EAC',
scope: true,
link: function postLink(scope, element, attr, transclusion) {
var options = {
scope: scope,
element: element,
show: false
};
angular.forEach([
'template',
'placement',
'keyboard',
'html',
'container',
'animation',
'duration'
], function (key) {
if (angular.isDefined(attr[key]))
options[key] = attr[key];
});
angular.forEach([
'title',
'content',
'type'
], function (key) {
attr[key] && attr.$observe(key, function (newValue, oldValue) {
scope[key] = newValue;
});
});
attr.bsAlert && scope.$watch(attr.bsAlert, function (newValue, oldValue) {
if (angular.isObject(newValue)) {
angular.extend(scope, newValue);
} else {
scope.content = newValue;
}
}, true);
var alert = $alert(options);
element.on(attr.trigger || 'click', alert.toggle);
scope.$on('$destroy', function () {
alert.destroy();
options = null;
alert = null;
});
}
};
}
]); | ankitjamuar/cdnjs | ajax/libs/angular-strap/2.0.0-beta.4/modules/alert.js | JavaScript | mit | 3,227 |
(function(d){var p={},e,a,h=document,i=window,f=h.documentElement,j=d.expando;d.event.special.inview={add:function(a){p[a.guid+"-"+this[j]]={data:a,$element:d(this)}},remove:function(a){try{delete p[a.guid+"-"+this[j]]}catch(d){}}};d(i).bind("scroll resize",function(){e=a=null});!f.addEventListener&&f.attachEvent&&f.attachEvent("onfocusin",function(){a=null});setInterval(function(){var k=d(),j,n=0;d.each(p,function(a,b){var c=b.data.selector,d=b.$element;k=k.add(c?d.find(c):d)});if(j=k.length){var b;
if(!(b=e)){var g={height:i.innerHeight,width:i.innerWidth};if(!g.height&&((b=h.compatMode)||!d.support.boxModel))b="CSS1Compat"===b?f:h.body,g={height:b.clientHeight,width:b.clientWidth};b=g}e=b;for(a=a||{top:i.pageYOffset||f.scrollTop||h.body.scrollTop,left:i.pageXOffset||f.scrollLeft||h.body.scrollLeft};n<j;n++)if(d.contains(f,k[n])){b=d(k[n]);var l=b.height(),m=b.width(),c=b.offset(),g=b.data("inview");if(!a||!e)break;c.top+l>a.top&&c.top<a.top+e.height&&c.left+m>a.left&&c.left<a.left+e.width?
(m=a.left>c.left?"right":a.left+e.width<c.left+m?"left":"both",l=a.top>c.top?"bottom":a.top+e.height<c.top+l?"top":"both",c=m+"-"+l,(!g||g!==c)&&b.data("inview",c).trigger("inview",[!0,m,l])):g&&b.data("inview",!1).trigger("inview",[!1])}}},250)})(jQuery); | jonobr1/cdnjs | ajax/libs/protonet-jquery.inview/1.0.0/jquery.inview.min.js | JavaScript | mit | 1,264 |
/**
* jqGrid Spanish Translation
* Traduccion jqGrid en Español por Yamil Bracho
* Traduccion corregida y ampliada por Faserline, S.L.
* http://www.faserline.com
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
/*jslint white: true */
/*global jQuery */
(function($){
"use strict";
var locInfo = {
isRTL: false,
defaults : {
recordtext: "Mostrando {0} - {1} de {2}",
emptyrecords: "Sin registros que mostrar",
loadtext: "Cargando...",
pgtext : "Página {0} de {1}",
pgfirst : "First Page",
pglast : "Last Page",
pgnext : "Next Page",
pgprev : "Previous Page",
pgrecs : "Records per Page",
showhide: "Toggle Expand Collapse Grid",
savetext: "Guardando..."
},
search : {
caption: "Búsqueda...",
Find: "Buscar",
Reset: "Limpiar",
odata: [{ oper:'eq', text:"igual "},{ oper:'ne', text:"no igual a"},{ oper:'lt', text:"menor que"},{ oper:'le', text:"menor o igual que"},{ oper:'gt', text:"mayor que"},{ oper:'ge', text:"mayor o igual a"},{ oper:'bw', text:"empiece por"},{ oper:'bn', text:"no empiece por"},{ oper:'in', text:"está en"},{ oper:'ni', text:"no está en"},{ oper:'ew', text:"termina por"},{ oper:'en', text:"no termina por"},{ oper:'cn', text:"contiene"},{ oper:'nc', text:"no contiene"},{ oper:'nu', text:'is null'},{ oper:'nn', text:'is not null'}],
groupOps: [ { op: "AND", text: "todo" }, { op: "OR", text: "cualquier" } ],
operandTitle : "Click to select search operation.",
resetTitle : "Reset Search Value"
},
edit : {
addCaption: "Agregar registro",
editCaption: "Modificar registro",
bSubmit: "Guardar",
bCancel: "Cancelar",
bClose: "Cerrar",
saveData: "Se han modificado los datos, ¿guardar cambios?",
bYes : "Si",
bNo : "No",
bExit : "Cancelar",
msg: {
required:"Campo obligatorio",
number:"Introduzca un número",
minValue:"El valor debe ser mayor o igual a ",
maxValue:"El valor debe ser menor o igual a ",
email: "no es una dirección de correo válida",
integer: "Introduzca un valor entero",
date: "Introduza una fecha correcta ",
url: "no es una URL válida. Prefijo requerido ('http://' or 'https://')",
nodefined : " no está definido.",
novalue : " valor de retorno es requerido.",
customarray : "La función personalizada debe devolver un array.",
customfcheck : "La función personalizada debe estar presente en el caso de validación personalizada."
}
},
view : {
caption: "Consultar registro",
bClose: "Cerrar"
},
del : {
caption: "Eliminar",
msg: "¿Desea eliminar los registros seleccionados?",
bSubmit: "Eliminar",
bCancel: "Cancelar"
},
nav : {
edittext: "",
edittitle: "Modificar fila seleccionada",
addtext: "",
addtitle: "Agregar nueva fila",
deltext: "",
deltitle: "Eliminar fila seleccionada",
searchtext: "",
searchtitle: "Buscar información",
refreshtext: "",
refreshtitle: "Recargar datos",
alertcap: "Aviso",
alerttext: "Seleccione una fila",
viewtext: "",
viewtitle: "Ver fila seleccionada"
},
col : {
caption: "Mostrar/ocultar columnas",
bSubmit: "Enviar",
bCancel: "Cancelar"
},
errors : {
errcap : "Error",
nourl : "No se ha especificado una URL",
norecords: "No hay datos para procesar",
model : "Las columnas de nombres son diferentes de las columnas de modelo"
},
formatter : {
integer : {thousandsSeparator: ".", defaultValue: '0'},
number : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, defaultValue: '0,00'},
currency : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
date : {
dayNames: [
"Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa",
"Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado"
],
monthNames: [
"Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic",
"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th';},
srcformat: 'Y-m-d',
newformat: 'd-m-Y',
masks : {
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
YearMonth: "F, Y"
}
}
}
};
$.jgrid = $.jgrid || {};
$.extend(true, $.jgrid, {
defaults: {
locale: "es"
},
locales: {
// In general the property name is free, but it's recommended to use the names based on
// http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
// http://rishida.net/utils/subtags/ and RFC 5646. See Appendix A of RFC 5646 for examples.
// One can use the lang attribute to specify language tags in HTML, and the xml:lang attribute for XML
// if it exists. See http://www.w3.org/International/articles/language-tags/#extlang
es: $.extend({}, locInfo, { name: "español", nameEnglish: "Spanish" }),
"es-ES": $.extend({}, locInfo, { name: "Español (España)", nameEnglish: "Spanish (Spain)" })
}
});
}(jQuery));
| wil93/cdnjs | ajax/libs/free-jqgrid/4.9.0/js/i18n/grid.locale-es.js | JavaScript | mit | 5,575 |
'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": [
"\u0628.\u0646",
"\u062f.\u0646"
],
"DAY": [
"\u06cc\u06d5\u06a9\u0634\u06d5\u0645\u0645\u06d5",
"\u062f\u0648\u0648\u0634\u06d5\u0645\u0645\u06d5",
"\u0633\u06ce\u0634\u06d5\u0645\u0645\u06d5",
"\u0686\u0648\u0627\u0631\u0634\u06d5\u0645\u0645\u06d5",
"\u067e\u06ce\u0646\u062c\u0634\u06d5\u0645\u0645\u06d5",
"\u06be\u06d5\u06cc\u0646\u06cc",
"\u0634\u06d5\u0645\u0645\u06d5"
],
"ERANAMES": [
"\u067e\u06ce\u0634 \u0632\u0627\u06cc\u06cc\u0646",
"\u0632\u0627\u06cc\u06cc\u0646\u06cc"
],
"ERAS": [
"\u067e\u06ce\u0634 \u0632\u0627\u06cc\u06cc\u06cc\u0646",
"\u0632"
],
"FIRSTDAYOFWEEK": 5,
"MONTH": [
"\u06a9\u0627\u0646\u0648\u0648\u0646\u06cc \u062f\u0648\u0648\u06d5\u0645",
"\u0634\u0648\u0628\u0627\u062a",
"\u0626\u0627\u0632\u0627\u0631",
"\u0646\u06cc\u0633\u0627\u0646",
"\u0626\u0627\u06cc\u0627\u0631",
"\u062d\u0648\u0632\u06d5\u06cc\u0631\u0627\u0646",
"\u062a\u06d5\u0645\u0648\u0648\u0632",
"\u0626\u0627\u0628",
"\u0626\u06d5\u06cc\u0644\u0648\u0648\u0644",
"\u062a\u0634\u0631\u06cc\u0646\u06cc \u06cc\u06d5\u06a9\u06d5\u0645",
"\u062a\u0634\u0631\u06cc\u0646\u06cc \u062f\u0648\u0648\u06d5\u0645",
"\u06a9\u0627\u0646\u0648\u0646\u06cc \u06cc\u06d5\u06a9\u06d5\u0645"
],
"SHORTDAY": [
"\u06cc\u06d5\u06a9\u0634\u06d5\u0645\u0645\u06d5",
"\u062f\u0648\u0648\u0634\u06d5\u0645\u0645\u06d5",
"\u0633\u06ce\u0634\u06d5\u0645\u0645\u06d5",
"\u0686\u0648\u0627\u0631\u0634\u06d5\u0645\u0645\u06d5",
"\u067e\u06ce\u0646\u062c\u0634\u06d5\u0645\u0645\u06d5",
"\u06be\u06d5\u06cc\u0646\u06cc",
"\u0634\u06d5\u0645\u0645\u06d5"
],
"SHORTMONTH": [
"\u06a9\u0627\u0646\u0648\u0648\u0646\u06cc \u062f\u0648\u0648\u06d5\u0645",
"\u0634\u0648\u0628\u0627\u062a",
"\u0626\u0627\u0632\u0627\u0631",
"\u0646\u06cc\u0633\u0627\u0646",
"\u0626\u0627\u06cc\u0627\u0631",
"\u062d\u0648\u0632\u06d5\u06cc\u0631\u0627\u0646",
"\u062a\u06d5\u0645\u0648\u0648\u0632",
"\u0626\u0627\u0628",
"\u0626\u06d5\u06cc\u0644\u0648\u0648\u0644",
"\u062a\u0634\u0631\u06cc\u0646\u06cc \u06cc\u06d5\u06a9\u06d5\u0645",
"\u062a\u0634\u0631\u06cc\u0646\u06cc \u062f\u0648\u0648\u06d5\u0645",
"\u06a9\u0627\u0646\u0648\u0646\u06cc \u06cc\u06d5\u06a9\u06d5\u0645"
],
"STANDALONEMONTH": [
"\u06a9\u0627\u0646\u0648\u0648\u0646\u06cc \u062f\u0648\u0648\u06d5\u0645",
"\u0634\u0648\u0628\u0627\u062a",
"\u0626\u0627\u0632\u0627\u0631",
"\u0646\u06cc\u0633\u0627\u0646",
"\u0626\u0627\u06cc\u0627\u0631",
"\u062d\u0648\u0632\u06d5\u06cc\u0631\u0627\u0646",
"\u062a\u06d5\u0645\u0648\u0648\u0632",
"\u0626\u0627\u0628",
"\u0626\u06d5\u06cc\u0644\u0648\u0648\u0644",
"\u062a\u0634\u0631\u06cc\u0646\u06cc \u06cc\u06d5\u06a9\u06d5\u0645",
"\u062a\u0634\u0631\u06cc\u0646\u06cc \u062f\u0648\u0648\u06d5\u0645",
"\u06a9\u0627\u0646\u0648\u0646\u06cc \u06cc\u06d5\u06a9\u06d5\u0645"
],
"WEEKENDRANGE": [
4,
5
],
"fullDate": "y MMMM d, EEEE",
"longDate": "d\u06cc MMMM\u06cc y",
"medium": "y MMM d HH:mm:ss",
"mediumDate": "y MMM d",
"mediumTime": "HH:mm:ss",
"short": "y-MM-dd HH:mm",
"shortDate": "y-MM-dd",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "din",
"DECIMAL_SEP": "\u066b",
"GROUP_SEP": "\u066c",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-\u00a4\u00a0",
"negSuf": "",
"posPre": "\u00a4\u00a0",
"posSuf": ""
}
]
},
"id": "ckb-arab",
"localeID": "ckb_Arab",
"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;}
});
}]);
| pombredanne/cdnjs | ajax/libs/angular.js/1.5.4/i18n/angular-locale_ckb-arab.js | JavaScript | mit | 4,859 |
/* global module:false */
module.exports = function(grunt) {
var port = grunt.option('port') || 8000;
// Project configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner:
'/*!\n' +
' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' +
' * http://lab.hakim.se/reveal-js\n' +
' * MIT licensed\n' +
' *\n' +
' * Copyright (C) 2014 Hakim El Hattab, http://hakim.se\n' +
' */'
},
qunit: {
files: [ 'test/*.html' ]
},
uglify: {
options: {
banner: '<%= meta.banner %>\n'
},
build: {
src: 'js/reveal.js',
dest: 'js/reveal.min.js'
}
},
cssmin: {
compress: {
files: {
'css/reveal.min.css': [ 'css/reveal.css' ]
}
}
},
sass: {
main: {
files: {
'css/theme/default.css': 'css/theme/source/default.scss',
'css/theme/beige.css': 'css/theme/source/beige.scss',
'css/theme/night.css': 'css/theme/source/night.scss',
'css/theme/serif.css': 'css/theme/source/serif.scss',
'css/theme/simple.css': 'css/theme/source/simple.scss',
'css/theme/sky.css': 'css/theme/source/sky.scss',
'css/theme/moon.css': 'css/theme/source/moon.scss',
'css/theme/solarized.css': 'css/theme/source/solarized.scss',
'css/theme/blood.css': 'css/theme/source/blood.scss'
}
}
},
jshint: {
options: {
curly: false,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
eqnull: true,
browser: true,
expr: true,
globals: {
head: false,
module: false,
console: false,
unescape: false
}
},
files: [ 'Gruntfile.js', 'js/reveal.js' ]
},
connect: {
server: {
options: {
port: port,
base: '.'
}
}
},
zip: {
'reveal-js-presentation.zip': [
'index.html',
'css/**',
'js/**',
'lib/**',
'images/**',
'plugin/**'
]
},
watch: {
main: {
files: [ 'Gruntfile.js', 'js/reveal.js', 'css/reveal.css' ],
tasks: 'default'
},
theme: {
files: [ 'css/theme/source/*.scss', 'css/theme/template/*.scss' ],
tasks: 'themes'
}
}
});
// Dependencies
grunt.loadNpmTasks( 'grunt-contrib-qunit' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-contrib-sass' );
grunt.loadNpmTasks( 'grunt-contrib-connect' );
grunt.loadNpmTasks( 'grunt-zip' );
// Default task
grunt.registerTask( 'default', [ 'jshint', 'cssmin', 'uglify', 'qunit' ] );
// Theme task
grunt.registerTask( 'themes', [ 'sass' ] );
// Package presentation to archive
grunt.registerTask( 'package', [ 'default', 'zip' ] );
// Serve presentation locally
grunt.registerTask( 'serve', [ 'connect', 'watch' ] );
// Run tests
grunt.registerTask( 'test', [ 'jshint', 'qunit' ] );
};
| dauidus/dislides.dev | Gruntfile.js | JavaScript | mit | 3,002 |
'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": [
"Sande",
"Orwokubanza",
"Orwakabiri",
"Orwakashatu",
"Orwakana",
"Orwakataano",
"Orwamukaaga"
],
"ERANAMES": [
"Kurisito Atakaijire",
"Kurisito Yaijire"
],
"ERAS": [
"BC",
"AD"
],
"FIRSTDAYOFWEEK": 0,
"MONTH": [
"Okwokubanza",
"Okwakabiri",
"Okwakashatu",
"Okwakana",
"Okwakataana",
"Okwamukaaga",
"Okwamushanju",
"Okwamunaana",
"Okwamwenda",
"Okwaikumi",
"Okwaikumi na kumwe",
"Okwaikumi na ibiri"
],
"SHORTDAY": [
"SAN",
"ORK",
"OKB",
"OKS",
"OKN",
"OKT",
"OMK"
],
"SHORTMONTH": [
"KBZ",
"KBR",
"KST",
"KKN",
"KTN",
"KMK",
"KMS",
"KMN",
"KMW",
"KKM",
"KNK",
"KNB"
],
"STANDALONEMONTH": [
"Okwokubanza",
"Okwakabiri",
"Okwakashatu",
"Okwakana",
"Okwakataana",
"Okwamukaaga",
"Okwamushanju",
"Okwamunaana",
"Okwamwenda",
"Okwaikumi",
"Okwaikumi na kumwe",
"Okwaikumi na ibiri"
],
"WEEKENDRANGE": [
5,
6
],
"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": "UGX",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-\u00a4",
"negSuf": "",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "nyn",
"localeID": "nyn",
"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;}
});
}]);
| dc-js/cdnjs | ajax/libs/angular-i18n/1.4.10/angular-locale_nyn.js | JavaScript | mit | 2,868 |
define([
"../core",
"./support",
"../core/init"
], function( jQuery, support ) {
var rreturn = /\r/g;
jQuery.fn.extend({
val: function( value ) {
var hooks, ret, isFunction,
elem = this[0];
if ( !arguments.length ) {
if ( elem ) {
hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
return ret;
}
ret = elem.value;
return typeof ret === "string" ?
// handle most common string cases
ret.replace(rreturn, "") :
// handle cases where value is null/undef or number
ret == null ? "" : ret;
}
return;
}
isFunction = jQuery.isFunction( value );
return this.each(function( i ) {
var val;
if ( this.nodeType !== 1 ) {
return;
}
if ( isFunction ) {
val = value.call( this, i, jQuery( this ).val() );
} else {
val = value;
}
// Treat null/undefined as ""; convert numbers to string
if ( val == null ) {
val = "";
} else if ( typeof val === "number" ) {
val += "";
} else if ( jQuery.isArray( val ) ) {
val = jQuery.map( val, function( value ) {
return value == null ? "" : value + "";
});
}
hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
// If set returns undefined, fall back to normal setting
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
this.value = val;
}
});
}
});
jQuery.extend({
valHooks: {
option: {
get: function( elem ) {
var val = jQuery.find.attr( elem, "value" );
return val != null ?
val :
// Support: IE10-11+
// option.text throws exceptions (#14686, #14858)
jQuery.trim( jQuery.text( elem ) );
}
},
select: {
get: function( elem ) {
var value, option,
options = elem.options,
index = elem.selectedIndex,
one = elem.type === "select-one" || index < 0,
values = one ? null : [],
max = one ? index + 1 : options.length,
i = index < 0 ?
max :
one ? index : 0;
// Loop through all the selected options
for ( ; i < max; i++ ) {
option = options[ i ];
// IE6-9 doesn't update selected after form reset (#2551)
if ( ( option.selected || i === index ) &&
// Don't return options that are disabled or in a disabled optgroup
( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) &&
( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
// Get the specific value for the option
value = jQuery( option ).val();
// We don't need an array for one selects
if ( one ) {
return value;
}
// Multi-Selects return an array
values.push( value );
}
}
return values;
},
set: function( elem, value ) {
var optionSet, option,
options = elem.options,
values = jQuery.makeArray( value ),
i = options.length;
while ( i-- ) {
option = options[ i ];
if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) {
optionSet = true;
}
}
// force browsers to behave consistently when non-matching value is set
if ( !optionSet ) {
elem.selectedIndex = -1;
}
return values;
}
}
}
});
// Radios and checkboxes getter/setter
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = {
set: function( elem, value ) {
if ( jQuery.isArray( value ) ) {
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
}
}
};
if ( !support.checkOn ) {
jQuery.valHooks[ this ].get = function( elem ) {
// Support: Webkit
// "" is returned instead of "on" if a value isn't specified
return elem.getAttribute("value") === null ? "on" : elem.value;
};
}
});
});
| gabrysiak/wp-tgbsboiler | js/libs/jquery/src/attributes/val.js | JavaScript | mit | 3,925 |
.yui3-g{letter-spacing:-0.31em;*letter-spacing:normal;*word-spacing:-0.43em;text-rendering:optimizespeed}.opera-only :-o-prefocus,.yui3-g{word-spacing:-0.43em}.yui3-u{display:inline-block;zoom:1;*display:inline;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.yui3-u-1,.yui3-u-1-2,.yui3-u-1-3,.yui3-u-2-3,.yui3-u-1-4,.yui3-u-3-4,.yui3-u-1-5,.yui3-u-2-5,.yui3-u-3-5,.yui3-u-4-5,.yui3-u-1-6,.yui3-u-5-6,.yui3-u-1-8,.yui3-u-3-8,.yui3-u-5-8,.yui3-u-7-8,.yui3-u-1-12,.yui3-u-5-12,.yui3-u-7-12,.yui3-u-11-12,.yui3-u-1-24,.yui3-u-5-24,.yui3-u-7-24,.yui3-u-11-24,.yui3-u-13-24,.yui3-u-17-24,.yui3-u-19-24,.yui3-u-23-24{display:inline-block;zoom:1;*display:inline;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.yui3-u-1{display:block}.yui3-u-1-2{width:50%}.yui3-u-1-3{width:33.33333%}.yui3-u-2-3{width:66.66666%}.yui3-u-1-4{width:25%}.yui3-u-3-4{width:75%}.yui3-u-1-5{width:20%}.yui3-u-2-5{width:40%}.yui3-u-3-5{width:60%}.yui3-u-4-5{width:80%}.yui3-u-1-6{width:16.656%}.yui3-u-5-6{width:83.33%}.yui3-u-1-8{width:12.5%}.yui3-u-3-8{width:37.5%}.yui3-u-5-8{width:62.5%}.yui3-u-7-8{width:87.5%}.yui3-u-1-12{width:8.3333%}.yui3-u-5-12{width:41.6666%}.yui3-u-7-12{width:58.3333%}.yui3-u-11-12{width:91.6666%}.yui3-u-1-24{width:4.1666%}.yui3-u-5-24{width:20.8333%}.yui3-u-7-24{width:29.1666%}.yui3-u-11-24{width:45.8333%}.yui3-u-13-24{width:54.1666%}.yui3-u-17-24{width:70.8333%}.yui3-u-19-24{width:79.1666%}.yui3-u-23-24{width:95.8333%}.yui3-g-r{letter-spacing:-0.31em;*letter-spacing:normal;*word-spacing:-0.43em}.opera-only :-o-prefocus,.yui3-g-r{word-spacing:-0.43em}.yui3-g-r img{max-width:100%}@media(min-width:980px){.yui3-visible-phone{display:none}.yui3-visible-tablet{display:none}.yui3-hidden-desktop{display:none}}@media(max-width:480px){.yui3-g-r>[class ^= "yui3-u"]{width:100%}}@media(max-width:767px){.yui3-g-r>[class ^= "yui3-u"]{width:100%}.yui3-hidden-phone{display:none}.yui3-visible-desktop{display:none}}@media(min-width:768px) and (max-width:979px){.yui3-hidden-tablet{display:none}.yui3-visible-desktop{display:none}}#yui3-css-stamp.cssgrids-responsive{display:none}
| saitheexplorer/cdnjs | ajax/libs/yui/3.11.0/cssgrids-responsive/cssgrids-responsive-min.css | CSS | mit | 2,143 |
.yui3-g{letter-spacing:-0.31em;*letter-spacing:normal;*word-spacing:-0.43em;text-rendering:optimizespeed}.opera-only :-o-prefocus,.yui3-g{word-spacing:-0.43em}.yui3-u{display:inline-block;zoom:1;*display:inline;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.yui3-u-1,.yui3-u-1-2,.yui3-u-1-3,.yui3-u-2-3,.yui3-u-1-4,.yui3-u-3-4,.yui3-u-1-5,.yui3-u-2-5,.yui3-u-3-5,.yui3-u-4-5,.yui3-u-1-6,.yui3-u-5-6,.yui3-u-1-8,.yui3-u-3-8,.yui3-u-5-8,.yui3-u-7-8,.yui3-u-1-12,.yui3-u-5-12,.yui3-u-7-12,.yui3-u-11-12,.yui3-u-1-24,.yui3-u-5-24,.yui3-u-7-24,.yui3-u-11-24,.yui3-u-13-24,.yui3-u-17-24,.yui3-u-19-24,.yui3-u-23-24{display:inline-block;zoom:1;*display:inline;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.yui3-u-1{display:block}.yui3-u-1-2{width:50%}.yui3-u-1-3{width:33.33333%}.yui3-u-2-3{width:66.66666%}.yui3-u-1-4{width:25%}.yui3-u-3-4{width:75%}.yui3-u-1-5{width:20%}.yui3-u-2-5{width:40%}.yui3-u-3-5{width:60%}.yui3-u-4-5{width:80%}.yui3-u-1-6{width:16.656%}.yui3-u-5-6{width:83.33%}.yui3-u-1-8{width:12.5%}.yui3-u-3-8{width:37.5%}.yui3-u-5-8{width:62.5%}.yui3-u-7-8{width:87.5%}.yui3-u-1-12{width:8.3333%}.yui3-u-5-12{width:41.6666%}.yui3-u-7-12{width:58.3333%}.yui3-u-11-12{width:91.6666%}.yui3-u-1-24{width:4.1666%}.yui3-u-5-24{width:20.8333%}.yui3-u-7-24{width:29.1666%}.yui3-u-11-24{width:45.8333%}.yui3-u-13-24{width:54.1666%}.yui3-u-17-24{width:70.8333%}.yui3-u-19-24{width:79.1666%}.yui3-u-23-24{width:95.8333%}#yui3-css-stamp.cssgrids{display:none}
| cluo/cdnjs | ajax/libs/yui/3.10.0/cssgrids/cssgrids-min.css | CSS | mit | 1,529 |
/**
* negotiator
* Copyright(c) 2012 Isaac Z. Schlueter
* Copyright(c) 2014 Federico Romero
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
module.exports = preferredMediaTypes;
preferredMediaTypes.preferredMediaTypes = preferredMediaTypes;
function parseAccept(accept) {
var accepts = splitMediaTypes(accept);
for (var i = 0, j = 0; i < accepts.length; i++) {
var mediaType = parseMediaType(accepts[i].trim(), i);
if (mediaType) {
accepts[j++] = mediaType;
}
}
// trim accepts
accepts.length = j;
return accepts;
};
function parseMediaType(s, i) {
var match = s.match(/\s*(\S+?)\/([^;\s]+)\s*(?:;(.*))?/);
if (!match) return null;
var type = match[1],
subtype = match[2],
full = "" + type + "/" + subtype,
params = {},
q = 1;
if (match[3]) {
params = match[3].split(';').map(function(s) {
return s.trim().split('=');
}).reduce(function (set, p) {
var name = p[0].toLowerCase();
var value = p[1];
set[name] = value && value[0] === '"' && value[value.length - 1] === '"'
? value.substr(1, value.length - 2)
: value;
return set;
}, params);
if (params.q != null) {
q = parseFloat(params.q);
delete params.q;
}
}
return {
type: type,
subtype: subtype,
params: params,
q: q,
i: i,
full: full
};
}
function getMediaTypePriority(type, accepted, index) {
var priority = {o: -1, q: 0, s: 0};
for (var i = 0; i < accepted.length; i++) {
var spec = specify(type, accepted[i], index);
if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
priority = spec;
}
}
return priority;
}
function specify(type, spec, index) {
var p = parseMediaType(type);
var s = 0;
if (!p) {
return null;
}
if(spec.type.toLowerCase() == p.type.toLowerCase()) {
s |= 4
} else if(spec.type != '*') {
return null;
}
if(spec.subtype.toLowerCase() == p.subtype.toLowerCase()) {
s |= 2
} else if(spec.subtype != '*') {
return null;
}
var keys = Object.keys(spec.params);
if (keys.length > 0) {
if (keys.every(function (k) {
return spec.params[k] == '*' || (spec.params[k] || '').toLowerCase() == (p.params[k] || '').toLowerCase();
})) {
s |= 1
} else {
return null
}
}
return {
i: index,
o: spec.i,
q: spec.q,
s: s,
}
}
function preferredMediaTypes(accept, provided) {
// RFC 2616 sec 14.2: no header = */*
var accepts = parseAccept(accept === undefined ? '*/*' : accept || '');
if (!provided) {
// sorted list of all types
return accepts.filter(isQuality).sort(compareSpecs).map(function getType(spec) {
return spec.full;
});
}
var priorities = provided.map(function getPriority(type, index) {
return getMediaTypePriority(type, accepts, index);
});
// sorted list of accepted types
return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) {
return provided[priorities.indexOf(priority)];
});
}
function compareSpecs(a, b) {
return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;
}
function isQuality(spec) {
return spec.q > 0;
}
function quoteCount(string) {
var count = 0;
var index = 0;
while ((index = string.indexOf('"', index)) !== -1) {
count++;
index++;
}
return count;
}
function splitMediaTypes(accept) {
var accepts = accept.split(',');
for (var i = 1, j = 0; i < accepts.length; i++) {
if (quoteCount(accepts[j]) % 2 == 0) {
accepts[++j] = accepts[i];
} else {
accepts[j] += ',' + accepts[i];
}
}
// trim accepts
accepts.length = j + 1;
return accepts;
}
| nimatra/vsaddin | node_modules/express/node_modules/accepts/node_modules/negotiator/lib/mediaType.js | JavaScript | mit | 3,766 |
YUI.add("dom-attrs",function(h){var e=h.config.doc.documentElement,b=h.DOM,a="tagName",g="ownerDocument",c="",f=h.Features.add,d=h.Features.test;h.mix(b,{getText:(e.textContent!==undefined)?function(j){var i="";if(j){i=j.textContent;}return i||"";}:function(j){var i="";if(j){i=j.innerText||j.nodeValue;}return i||"";},setText:(e.textContent!==undefined)?function(i,j){if(i){i.textContent=j;}}:function(i,j){if("innerText" in i){i.innerText=j;}else{if("nodeValue" in i){i.nodeValue=j;}}},CUSTOM_ATTRIBUTES:(!e.hasAttribute)?{"for":"htmlFor","class":"className"}:{"htmlFor":"for","className":"class"},setAttribute:function(k,i,l,j){if(k&&i&&k.setAttribute){i=b.CUSTOM_ATTRIBUTES[i]||i;k.setAttribute(i,l,j);}},getAttribute:function(l,i,k){k=(k!==undefined)?k:2;var j="";if(l&&i&&l.getAttribute){i=b.CUSTOM_ATTRIBUTES[i]||i;j=l.getAttribute(i,k);if(j===null){j="";}}return j;},VALUE_SETTERS:{},VALUE_GETTERS:{},getValue:function(k){var j="",i;if(k&&k[a]){i=b.VALUE_GETTERS[k[a].toLowerCase()];if(i){j=i(k);}else{j=k.value;}}if(j===c){j=c;}return(typeof j==="string")?j:"";},setValue:function(i,j){var k;if(i&&i[a]){k=b.VALUE_SETTERS[i[a].toLowerCase()];if(k){k(i,j);}else{i.value=j;}}},creators:{}});f("value-set","select",{test:function(){var i=h.config.doc.createElement("select");i.innerHTML="<option>1</option><option>2</option>";i.value="2";return(i.value&&i.value==="2");}});if(!d("value-set","select")){b.VALUE_SETTERS.select=function(m,n){for(var k=0,j=m.getElementsByTagName("option"),l;l=j[k++];){if(b.getValue(l)===n){l.selected=true;break;}}};}h.mix(b.VALUE_GETTERS,{button:function(i){return(i.attributes&&i.attributes.value)?i.attributes.value.value:"";}});h.mix(b.VALUE_SETTERS,{button:function(j,k){var i=j.attributes.value;if(!i){i=j[g].createAttribute("value");j.setAttributeNode(i);}i.value=k;}});h.mix(b.VALUE_GETTERS,{option:function(j){var i=j.attributes;return(i.value&&i.value.specified)?j.value:j.text;},select:function(j){var k=j.value,i=j.options;if(i&&i.length){if(j.multiple){}else{k=b.getValue(i[j.selectedIndex]);}}return k;}});},"@VERSION@",{requires:["dom-core"]}); | jonobr1/cdnjs | ajax/libs/yui/3.5.0pr6/dom-attrs/dom-attrs-min.js | JavaScript | mit | 2,096 |
webshims.validityMessages.en={typeMismatch:{defaultMessage:"Please enter a valid value.",email:"Please enter an email address.",url:"Please enter a URL."},badInput:{defaultMessage:"Please enter a valid value.",number:"Please enter a number.",date:"Please enter a date.",time:"Please enter a time.",range:"Invalid input.",month:"Please enter a valid value.","datetime-local":"Please enter a datetime."},rangeUnderflow:{defaultMessage:"Value must be greater than or equal to {%min}.",date:"Value must be at or after {%min}.",time:"Value must be at or after {%min}.","datetime-local":"Value must be at or after {%min}.",month:"Value must be at or after {%min}."},rangeOverflow:{defaultMessage:"Value must be less than or equal to {%max}.",date:"Value must be at or before {%max}.",time:"Value must be at or before {%max}.","datetime-local":"Value must be at or before {%max}.",month:"Value must be at or before {%max}."},stepMismatch:"Invalid input.",tooLong:"Please enter at most {%maxlength} character(s). You entered {%valueLen}.",tooShort:"Please enter at least {%minlength} character(s). You entered {%valueLen}.",patternMismatch:"Invalid input. {%title}",valueMissing:{defaultMessage:"Please fill out this field.",checkbox:"Please check this box if you want to proceed.",select:"Please select an option.",radio:"Please select an option."}},webshims.formcfg.en={numberFormat:{".":".",",":","},numberSigns:".",dateSigns:"/",timeSigns:":. ",dFormat:"/",patterns:{d:"mm/dd/yy"},meridian:["AM","PM"],month:{currentText:"This month"},time:{currentText:"Now"},date:{closeText:"Done",clear:"Clear",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""}}; | owcc/cdnjs | ajax/libs/webshim/1.15.0-RC2/minified/shims/i18n/formcfg-en.js | JavaScript | mit | 2,121 |
package cmd
import (
"os"
"path/filepath"
"runtime"
"strings"
)
// Project contains name, license and paths to projects.
type Project struct {
absPath string
cmdPath string
srcPath string
license License
name string
}
// NewProject returns Project with specified project name.
// If projectName is blank string, it returns nil.
func NewProject(projectName string) *Project {
if projectName == "" {
return nil
}
p := new(Project)
p.name = projectName
// 1. Find already created protect.
p.absPath = findPackage(projectName)
// 2. If there are no created project with this path, and user is in GOPATH,
// then use GOPATH/src/projectName.
if p.absPath == "" {
wd, err := os.Getwd()
if err != nil {
er(err)
}
for _, srcPath := range srcPaths {
goPath := filepath.Dir(srcPath)
if filepathHasPrefix(wd, goPath) {
p.absPath = filepath.Join(srcPath, projectName)
break
}
}
}
// 3. If user is not in GOPATH, then use (first GOPATH)/src/projectName.
if p.absPath == "" {
p.absPath = filepath.Join(srcPaths[0], projectName)
}
return p
}
// findPackage returns full path to existing go package in GOPATHs.
// findPackage returns "", if it can't find path.
// If packageName is "", findPackage returns "".
func findPackage(packageName string) string {
if packageName == "" {
return ""
}
for _, srcPath := range srcPaths {
packagePath := filepath.Join(srcPath, packageName)
if exists(packagePath) {
return packagePath
}
}
return ""
}
// NewProjectFromPath returns Project with specified absolute path to
// package.
// If absPath is blank string or if absPath is not actually absolute,
// it returns nil.
func NewProjectFromPath(absPath string) *Project {
if absPath == "" || !filepath.IsAbs(absPath) {
return nil
}
p := new(Project)
p.absPath = absPath
p.absPath = strings.TrimSuffix(p.absPath, findCmdDir(p.absPath))
p.name = filepath.ToSlash(trimSrcPath(p.absPath, p.SrcPath()))
return p
}
// trimSrcPath trims at the beginning of absPath the srcPath.
func trimSrcPath(absPath, srcPath string) string {
relPath, err := filepath.Rel(srcPath, absPath)
if err != nil {
er("Cobra supports project only within $GOPATH: " + err.Error())
}
return relPath
}
// License returns the License object of project.
func (p *Project) License() License {
if p.license.Text == "" && p.license.Name != "None" {
p.license = getLicense()
}
return p.license
}
// Name returns the name of project, e.g. "github.com/spf13/cobra"
func (p Project) Name() string {
return p.name
}
// CmdPath returns absolute path to directory, where all commands are located.
//
// CmdPath returns blank string, only if p.AbsPath() is a blank string.
func (p *Project) CmdPath() string {
if p.absPath == "" {
return ""
}
if p.cmdPath == "" {
p.cmdPath = filepath.Join(p.absPath, findCmdDir(p.absPath))
}
return p.cmdPath
}
// findCmdDir checks if base of absPath is cmd dir and returns it or
// looks for existing cmd dir in absPath.
// If the cmd dir doesn't exist, empty, or cannot be found,
// it returns "cmd".
func findCmdDir(absPath string) string {
if !exists(absPath) || isEmpty(absPath) {
return "cmd"
}
if isCmdDir(absPath) {
return filepath.Base(absPath)
}
files, _ := filepath.Glob(filepath.Join(absPath, "c*"))
for _, file := range files {
if isCmdDir(file) {
return filepath.Base(file)
}
}
return "cmd"
}
// isCmdDir checks if base of name is one of cmdDir.
func isCmdDir(name string) bool {
name = filepath.Base(name)
for _, cmdDir := range cmdDirs {
if name == cmdDir {
return true
}
}
return false
}
// AbsPath returns absolute path of project.
func (p Project) AbsPath() string {
return p.absPath
}
// SrcPath returns absolute path to $GOPATH/src where project is located.
func (p *Project) SrcPath() string {
if p.srcPath != "" {
return p.srcPath
}
if p.absPath == "" {
p.srcPath = srcPaths[0]
return p.srcPath
}
for _, srcPath := range srcPaths {
if filepathHasPrefix(p.absPath, srcPath) {
p.srcPath = srcPath
break
}
}
return p.srcPath
}
func filepathHasPrefix(path string, prefix string) bool {
if len(path) <= len(prefix) {
return false
}
if runtime.GOOS == "windows" {
// Paths in windows are case-insensitive.
return strings.EqualFold(path[0:len(prefix)], prefix)
}
return path[0:len(prefix)] == prefix
}
| DirtyHairy/moneypenny | vendor/github.com/spf13/cobra/cobra/cmd/project.go | GO | mit | 4,376 |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Xunit;
namespace System.Collections.Specialized.Tests
{
public class StringDictionaryItemTests
{
[Fact]
public void Item_Get_IsCaseInsensitive()
{
StringDictionary stringDictionary = new StringDictionary();
stringDictionary.Add("key", "value");
Assert.Equal("value", stringDictionary["KEY"]);
Assert.Equal("value", stringDictionary["kEy"]);
Assert.Equal("value", stringDictionary["key"]);
}
[Theory]
[InlineData(0)]
[InlineData(5)]
public void Item_Get_NoSuchKey_ReturnsNull(int count)
{
StringDictionary stringDictionary = Helpers.CreateStringDictionary(count);
Assert.Null(stringDictionary["non-existent-key"]);
}
[Fact]
public void Item_Get_DuplicateValues()
{
StringDictionary stringDictionary = new StringDictionary();
stringDictionary.Add("key1", "value");
stringDictionary.Add("key2", "different-value");
stringDictionary.Add("key3", "value");
Assert.Equal("value", stringDictionary["key1"]);
Assert.Equal("different-value", stringDictionary["key2"]);
Assert.Equal("value", stringDictionary["key3"]);
}
[Theory]
[InlineData(0)]
[InlineData(5)]
public void Item_Get_NullKey_ThrowsArgumentNullException(int count)
{
StringDictionary stringDictionary = Helpers.CreateStringDictionary(count);
AssertExtensions.Throws<ArgumentNullException>("key", () => stringDictionary[null]);
}
}
}
| jlin177/corefx | src/System.Collections.Specialized/tests/StringDictionary/StringDictionary.GetItemTests.cs | C# | mit | 1,866 |
/*
* # Semantic - Accordion
* http://github.com/jlukic/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ($, window, document, undefined) {
$.fn.accordion = function(parameters) {
var
$allModules = $(this),
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
invokedResponse
;
$allModules
.each(function() {
var
settings = ( $.isPlainObject(parameters) )
? $.extend(true, {}, $.fn.accordion.settings, parameters)
: $.extend({}, $.fn.accordion.settings),
className = settings.className,
namespace = settings.namespace,
selector = settings.selector,
error = settings.error,
eventNamespace = '.' + namespace,
moduleNamespace = 'module-' + namespace,
moduleSelector = $allModules.selector || '',
$module = $(this),
$title = $module.find(selector.title),
$content = $module.find(selector.content),
element = this,
instance = $module.data(moduleNamespace),
module
;
module = {
initialize: function() {
module.debug('Initializing accordion with bound events', $module);
// initializing
$title
.on('click' + eventNamespace, module.event.click)
;
module.instantiate();
},
instantiate: function() {
instance = module;
$module
.data(moduleNamespace, module)
;
},
destroy: function() {
module.debug('Destroying previous accordion for', $module);
$module
.removeData(moduleNamespace)
;
$title
.off(eventNamespace)
;
},
event: {
click: function() {
module.verbose('Title clicked', this);
var
$activeTitle = $(this),
index = $title.index($activeTitle)
;
module.toggle(index);
},
resetStyle: function() {
module.verbose('Resetting styles on element', this);
$(this)
.attr('style', '')
.removeAttr('style')
.children()
.attr('style', '')
.removeAttr('style')
;
}
},
toggle: function(index) {
module.debug('Toggling content content at index', index);
var
$activeTitle = $title.eq(index),
$activeContent = $activeTitle.next($content),
contentIsOpen = $activeContent.is(':visible')
;
if(contentIsOpen) {
if(settings.collapsible) {
module.close(index);
}
else {
module.debug('Cannot close accordion content collapsing is disabled');
}
}
else {
module.open(index);
}
},
open: function(index) {
var
$activeTitle = $title.eq(index),
$activeContent = $activeTitle.next($content),
$previousTitle = $title.filter('.' + className.active),
$previousContent = $previousTitle.next($title),
contentIsOpen = ($previousTitle.size() > 0)
;
if( !$activeContent.is(':animated') ) {
module.debug('Opening accordion content', $activeTitle);
if(settings.exclusive && contentIsOpen) {
$previousTitle
.removeClass(className.active)
;
$previousContent
.stop()
.children()
.animate({
opacity: 0
}, settings.duration, module.event.resetStyle)
.end()
.slideUp(settings.duration , settings.easing, function() {
$previousContent
.removeClass(className.active)
.attr('style', '')
.removeAttr('style')
.children()
.attr('style', '')
.removeAttr('style')
;
})
;
}
$activeTitle
.addClass(className.active)
;
$activeContent
.stop()
.children()
.attr('style', '')
.removeAttr('style')
.end()
.slideDown(settings.duration, settings.easing, function() {
$activeContent
.addClass(className.active)
.attr('style', '')
.removeAttr('style')
;
$.proxy(settings.onOpen, $activeContent)();
$.proxy(settings.onChange, $activeContent)();
})
;
}
},
close: function(index) {
var
$activeTitle = $title.eq(index),
$activeContent = $activeTitle.next($content)
;
module.debug('Closing accordion content', $activeTitle);
$activeTitle
.removeClass(className.active)
;
$activeContent
.removeClass(className.active)
.show()
.stop()
.children()
.animate({
opacity: 0
}, settings.duration, module.event.resetStyle)
.end()
.slideUp(settings.duration, settings.easing, function(){
$activeContent
.attr('style', '')
.removeAttr('style')
;
$.proxy(settings.onClose, $activeContent)();
$.proxy(settings.onChange, $activeContent)();
})
;
},
setting: function(name, value) {
module.debug('Changing setting', name, value);
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
module.debug('Changing internal', name, value);
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Element' : element,
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && instance !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
instance = instance[camelCaseValue];
}
else if( instance[value] !== undefined ) {
found = instance[value];
return false;
}
else if( instance[camelCaseValue] !== undefined ) {
found = instance[camelCaseValue];
return false;
}
else {
module.error(error.method);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(invokedResponse)) {
invokedResponse.push(response);
}
else if(typeof invokedResponse == 'string') {
invokedResponse = [invokedResponse, response];
}
else if(response !== undefined) {
invokedResponse = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
module.destroy();
}
module.initialize();
}
})
;
return (invokedResponse !== undefined)
? invokedResponse
: this
;
};
$.fn.accordion.settings = {
name : 'Accordion',
namespace : 'accordion',
debug : true,
verbose : true,
performance : true,
exclusive : true,
collapsible : true,
duration : 500,
easing : 'easeInOutQuint',
onOpen : function(){},
onClose : function(){},
onChange : function(){},
error: {
method : 'The method you called is not defined'
},
className : {
active : 'active'
},
selector : {
title : '.title',
content : '.content'
},
};
// Adds easing
$.extend( $.easing, {
easeInOutQuint: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
return c/2*((t-=2)*t*t*t*t + 2) + b;
}
});
})( jQuery, window , document );
/*
* # Semantic - API
* http://github.com/jlukic/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ( $, window, document, undefined ) {
$.api = $.fn.api = function(parameters) {
var
settings = $.extend(true, {}, $.api.settings, parameters),
// if this keyword isn't a jQuery object, create one
context = (typeof this != 'function')
? this
: $('<div/>'),
// context defines the element used for loading/error state
$context = (settings.stateContext)
? $(settings.stateContext)
: $(context),
// module is the thing that initiates the api action, can be independent of context
$module = typeof this == 'object'
? $(context)
: $context,
element = this,
time = new Date().getTime(),
performance = [],
moduleSelector = $module.selector || '',
moduleNamespace = settings.namespace + '-module',
className = settings.className,
metadata = settings.metadata,
error = settings.error,
instance = $module.data(moduleNamespace),
query = arguments[0],
methodInvoked = (instance !== undefined && typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
module,
invokedResponse
;
module = {
initialize: function() {
var
runSettings,
loadingTimer = new Date().getTime(),
loadingDelay,
promise,
url,
formData = {},
data,
ajaxSettings = {},
xhr
;
// serialize parent form if requested!
if(settings.serializeForm && $(this).toJSON() !== undefined) {
formData = module.get.formData();
module.debug('Adding form data to API Request', formData);
$.extend(true, settings.data, formData);
}
// let beforeSend change settings object
runSettings = $.proxy(settings.beforeSend, $module)(settings);
// check for exit conditions
if(runSettings !== undefined && !runSettings) {
module.error(error.beforeSend);
module.reset();
return;
}
// get real url from template
url = module.get.url( module.get.templateURL() );
// exit conditions reached from missing url parameters
if( !url ) {
module.error(error.missingURL);
module.reset();
return;
}
// promise handles notification on api request, so loading min. delay can occur for all notifications
promise =
$.Deferred()
.always(function() {
if(settings.stateContext) {
$context
.removeClass(className.loading)
;
}
$.proxy(settings.complete, $module)();
})
.done(function(response) {
module.debug('API request successful');
// take a stab at finding success state if json
if(settings.dataType == 'json') {
if (response.error !== undefined) {
$.proxy(settings.failure, $context)(response.error, settings, $module);
}
else if ($.isArray(response.errors)) {
$.proxy(settings.failure, $context)(response.errors[0], settings, $module);
}
else {
$.proxy(settings.success, $context)(response, settings, $module);
}
}
// otherwise
else {
$.proxy(settings.success, $context)(response, settings, $module);
}
})
.fail(function(xhr, status, httpMessage) {
var
errorMessage = (settings.error[status] !== undefined)
? settings.error[status]
: httpMessage,
response
;
// let em know unless request aborted
if(xhr !== undefined) {
// readyState 4 = done, anything less is not really sent
if(xhr.readyState !== undefined && xhr.readyState == 4) {
// if http status code returned and json returned error, look for it
if( xhr.status != 200 && httpMessage !== undefined && httpMessage !== '') {
module.error(error.statusMessage + httpMessage);
}
else {
if(status == 'error' && settings.dataType == 'json') {
try {
response = $.parseJSON(xhr.responseText);
if(response && response.error !== undefined) {
errorMessage = response.error;
}
}
catch(error) {
module.error(error.JSONParse);
}
}
}
$context
.removeClass(className.loading)
.addClass(className.error)
;
// show error state only for duration specified in settings
if(settings.errorLength > 0) {
setTimeout(function(){
$context
.removeClass(className.error)
;
}, settings.errorLength);
}
module.debug('API Request error:', errorMessage);
$.proxy(settings.failure, $context)(errorMessage, settings, this);
}
else {
module.debug('Request Aborted (Most likely caused by page change)');
}
}
})
;
// look for params in data
$.extend(true, ajaxSettings, settings, {
success : function(){},
failure : function(){},
complete : function(){},
type : settings.method || settings.type,
data : data,
url : url,
beforeSend : settings.beforeXHR
});
if(settings.stateContext) {
$context
.addClass(className.loading)
;
}
if(settings.progress) {
module.verbose('Adding progress events');
$.extend(true, ajaxSettings, {
xhr: function() {
var
xhr = new window.XMLHttpRequest()
;
xhr.upload.addEventListener('progress', function(event) {
var
percentComplete
;
if (event.lengthComputable) {
percentComplete = Math.round(event.loaded / event.total * 10000) / 100 + '%';
$.proxy(settings.progress, $context)(percentComplete, event);
}
}, false);
xhr.addEventListener('progress', function(event) {
var
percentComplete
;
if (event.lengthComputable) {
percentComplete = Math.round(event.loaded / event.total * 10000) / 100 + '%';
$.proxy(settings.progress, $context)(percentComplete, event);
}
}, false);
return xhr;
}
});
}
module.verbose('Creating AJAX request with settings: ', ajaxSettings);
xhr =
$.ajax(ajaxSettings)
.always(function() {
// calculate if loading time was below minimum threshold
loadingDelay = ( settings.loadingLength - (new Date().getTime() - loadingTimer) );
settings.loadingDelay = loadingDelay < 0
? 0
: loadingDelay
;
})
.done(function(response) {
var
context = this
;
setTimeout(function(){
promise.resolveWith(context, [response]);
}, settings.loadingDelay);
})
.fail(function(xhr, status, httpMessage) {
var
context = this
;
// page triggers abort on navigation, dont show error
if(status != 'abort') {
setTimeout(function(){
promise.rejectWith(context, [xhr, status, httpMessage]);
}, settings.loadingDelay);
}
else {
$context
.removeClass(className.error)
.removeClass(className.loading)
;
}
})
;
if(settings.stateContext) {
$module
.data(metadata.promise, promise)
.data(metadata.xhr, xhr)
;
}
},
get: {
formData: function() {
return $module
.closest('form')
.toJSON()
;
},
templateURL: function() {
var
action = $module.data(settings.metadata.action) || settings.action || false,
url
;
if(action) {
module.debug('Creating url for: ', action);
if(settings.api[action] !== undefined) {
url = settings.api[action];
}
else {
module.error(error.missingAction);
}
}
// override with url if specified
if(settings.url) {
url = settings.url;
module.debug('Getting url', url);
}
return url;
},
url: function(url, urlData) {
var
urlVariables
;
if(url) {
urlVariables = url.match(settings.regExpTemplate);
urlData = urlData || settings.urlData;
if(urlVariables) {
module.debug('Looking for URL variables', urlVariables);
$.each(urlVariables, function(index, templateValue){
var
term = templateValue.substr( 2, templateValue.length - 3),
termValue = ($.isPlainObject(urlData) && urlData[term] !== undefined)
? urlData[term]
: ($module.data(term) !== undefined)
? $module.data(term)
: urlData[term]
;
module.verbose('Looking for variable', term, $module, $module.data(term), urlData[term]);
// remove optional value
if(termValue === false) {
module.debug('Removing variable from URL', urlVariables);
url = url.replace('/' + templateValue, '');
}
// undefined condition
else if(termValue === undefined || !termValue) {
module.error(error.missingParameter + term);
url = false;
return false;
}
else {
url = url.replace(templateValue, termValue);
}
});
}
}
return url;
}
},
// reset api request
reset: function() {
$module
.data(metadata.promise, false)
.data(metadata.xhr, false)
;
$context
.removeClass(className.error)
.removeClass(className.loading)
;
},
setting: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Element' : element,
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && instance !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
instance = instance[camelCaseValue];
}
else if( instance[value] !== undefined ) {
found = instance[value];
return false;
}
else if( instance[camelCaseValue] !== undefined ) {
found = instance[camelCaseValue];
return false;
}
else {
module.error(error.method);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(invokedResponse)) {
invokedResponse.push(response);
}
else if(typeof invokedResponse == 'string') {
invokedResponse = [invokedResponse, response];
}
else if(response !== undefined) {
invokedResponse = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
module.destroy();
}
module.initialize();
}
return (invokedResponse !== undefined)
? invokedResponse
: this
;
};
// handle DOM attachment to API functionality
$.fn.apiButton = function(parameters) {
$(this)
.each(function(){
var
// if only function passed it is success callback
$module = $(this),
selector = $(this).selector || '',
settings = ( $.isFunction(parameters) )
? $.extend(true, {}, $.api.settings, $.fn.apiButton.settings, { stateContext: this, success: parameters })
: $.extend(true, {}, $.api.settings, $.fn.apiButton.settings, { stateContext: this}, parameters),
module
;
module = {
initialize: function() {
if(settings.context && selector !== '') {
$(settings.context)
.on(selector, 'click.' + settings.namespace, module.click)
;
}
else {
$module
.on('click.' + settings.namespace, module.click)
;
}
},
click: function() {
if(!settings.filter || $(this).filter(settings.filter).size() === 0) {
$.proxy( $.api, this )(settings);
}
}
};
module.initialize();
})
;
return this;
};
$.api.settings = {
name : 'API',
namespace : 'api',
debug : true,
verbose : true,
performance : true,
api : {},
beforeSend : function(settings) {
return settings;
},
beforeXHR : function(xhr) {},
success : function(response) {},
complete : function(response) {},
failure : function(errorCode) {},
progress : false,
error : {
missingAction : 'API action used but no url was defined',
missingURL : 'URL not specified for the API action',
missingParameter : 'Missing an essential URL parameter: ',
timeout : 'Your request timed out',
error : 'There was an error with your request',
parseError : 'There was an error parsing your request',
JSONParse : 'JSON could not be parsed during error handling',
statusMessage : 'Server gave an error: ',
beforeSend : 'The before send function has aborted the request',
exitConditions : 'API Request Aborted. Exit conditions met'
},
className: {
loading : 'loading',
error : 'error'
},
metadata: {
action : 'action',
promise : 'promise',
xhr : 'xhr'
},
regExpTemplate: /\{\$([A-z]+)\}/g,
action : false,
url : false,
urlData : false,
serializeForm : false,
stateContext : false,
method : 'get',
data : {},
dataType : 'json',
cache : true,
loadingLength : 200,
errorLength : 2000
};
$.fn.apiButton.settings = {
filter : '.disabled, .loading',
context : false,
stateContext : false
};
})( jQuery, window , document );
/*
* # Semantic - Colorize
* http://github.com/jlukic/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ( $, window, document, undefined ) {
$.fn.colorize = function(parameters) {
var
settings = $.extend(true, {}, $.fn.colorize.settings, parameters),
// hoist arguments
moduleArguments = arguments || false
;
$(this)
.each(function(instanceIndex) {
var
$module = $(this),
mainCanvas = $('<canvas />')[0],
imageCanvas = $('<canvas />')[0],
overlayCanvas = $('<canvas />')[0],
backgroundImage = new Image(),
// defs
mainContext,
imageContext,
overlayContext,
image,
imageName,
width,
height,
// shortucts
colors = settings.colors,
paths = settings.paths,
namespace = settings.namespace,
error = settings.error,
// boilerplate
instance = $module.data('module-' + namespace),
module
;
module = {
checkPreconditions: function() {
module.debug('Checking pre-conditions');
if( !$.isPlainObject(colors) || $.isEmptyObject(colors) ) {
module.error(error.undefinedColors);
return false;
}
return true;
},
async: function(callback) {
if(settings.async) {
setTimeout(callback, 0);
}
else {
callback();
}
},
getMetadata: function() {
module.debug('Grabbing metadata');
image = $module.data('image') || settings.image || undefined;
imageName = $module.data('name') || settings.name || instanceIndex;
width = settings.width || $module.width();
height = settings.height || $module.height();
if(width === 0 || height === 0) {
module.error(error.undefinedSize);
}
},
initialize: function() {
module.debug('Initializing with colors', colors);
if( module.checkPreconditions() ) {
module.async(function() {
module.getMetadata();
module.canvas.create();
module.draw.image(function() {
module.draw.colors();
module.canvas.merge();
});
$module
.data('module-' + namespace, module)
;
});
}
},
redraw: function() {
module.debug('Redrawing image');
module.async(function() {
module.canvas.clear();
module.draw.colors();
module.canvas.merge();
});
},
change: {
color: function(colorName, color) {
module.debug('Changing color', colorName);
if(colors[colorName] === undefined) {
module.error(error.missingColor);
return false;
}
colors[colorName] = color;
module.redraw();
}
},
canvas: {
create: function() {
module.debug('Creating canvases');
mainCanvas.width = width;
mainCanvas.height = height;
imageCanvas.width = width;
imageCanvas.height = height;
overlayCanvas.width = width;
overlayCanvas.height = height;
mainContext = mainCanvas.getContext('2d');
imageContext = imageCanvas.getContext('2d');
overlayContext = overlayCanvas.getContext('2d');
$module
.append( mainCanvas )
;
mainContext = $module.children('canvas')[0].getContext('2d');
},
clear: function(context) {
module.debug('Clearing canvas');
overlayContext.fillStyle = '#FFFFFF';
overlayContext.fillRect(0, 0, width, height);
},
merge: function() {
if( !$.isFunction(mainContext.blendOnto) ) {
module.error(error.missingPlugin);
return;
}
mainContext.putImageData( imageContext.getImageData(0, 0, width, height), 0, 0);
overlayContext.blendOnto(mainContext, 'multiply');
}
},
draw: {
image: function(callback) {
module.debug('Drawing image');
callback = callback || function(){};
if(image) {
backgroundImage.src = image;
backgroundImage.onload = function() {
imageContext.drawImage(backgroundImage, 0, 0);
callback();
};
}
else {
module.error(error.noImage);
callback();
}
},
colors: function() {
module.debug('Drawing color overlays', colors);
$.each(colors, function(colorName, color) {
settings.onDraw(overlayContext, imageName, colorName, color);
});
}
},
debug: function(message, variableName) {
if(settings.debug) {
if(variableName !== undefined) {
console.info(settings.name + ': ' + message, variableName);
}
else {
console.info(settings.name + ': ' + message);
}
}
},
error: function(errorMessage) {
console.warn(settings.name + ': ' + errorMessage);
},
invoke: function(methodName, context, methodArguments) {
var
method
;
methodArguments = methodArguments || Array.prototype.slice.call( arguments, 2 );
if(typeof methodName == 'string' && instance !== undefined) {
methodName = methodName.split('.');
$.each(methodName, function(index, name) {
if( $.isPlainObject( instance[name] ) ) {
instance = instance[name];
return true;
}
else if( $.isFunction( instance[name] ) ) {
method = instance[name];
return true;
}
module.error(settings.error.method);
return false;
});
}
return ( $.isFunction( method ) )
? method.apply(context, methodArguments)
: false
;
}
};
if(instance !== undefined && moduleArguments) {
// simpler than invoke realizing to invoke itself (and losing scope due prototype.call()
if(moduleArguments[0] == 'invoke') {
moduleArguments = Array.prototype.slice.call( moduleArguments, 1 );
}
return module.invoke(moduleArguments[0], this, Array.prototype.slice.call( moduleArguments, 1 ) );
}
// initializing
module.initialize();
})
;
return this;
};
$.fn.colorize.settings = {
name : 'Image Colorizer',
debug : true,
namespace : 'colorize',
onDraw : function(overlayContext, imageName, colorName, color) {},
// whether to block execution while updating canvas
async : true,
// object containing names and default values of color regions
colors : {},
metadata: {
image : 'image',
name : 'name'
},
error: {
noImage : 'No tracing image specified',
undefinedColors : 'No default colors specified.',
missingColor : 'Attempted to change color that does not exist',
missingPlugin : 'Blend onto plug-in must be included',
undefinedHeight : 'The width or height of image canvas could not be automatically determined. Please specify a height.'
}
};
})( jQuery, window , document );
/*
* # Semantic - Form Validation
* http://github.com/jlukic/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ( $, window, document, undefined ) {
$.fn.form = function(fields, parameters) {
var
$allModules = $(this),
settings = $.extend(true, {}, $.fn.form.settings, parameters),
validation = $.extend({}, $.fn.form.settings.defaults, fields),
namespace = settings.namespace,
metadata = settings.metadata,
selector = settings.selector,
className = settings.className,
error = settings.error,
eventNamespace = '.' + namespace,
moduleNamespace = 'module-' + namespace,
moduleSelector = $allModules.selector || '',
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
invokedResponse
;
$allModules
.each(function() {
var
$module = $(this),
$field = $(this).find(selector.field),
$group = $(this).find(selector.group),
$message = $(this).find(selector.message),
$prompt = $(this).find(selector.prompt),
$submit = $(this).find(selector.submit),
formErrors = [],
element = this,
instance = $module.data(moduleNamespace),
module
;
module = {
initialize: function() {
module.verbose('Initializing form validation', $module, validation, settings);
if(settings.keyboardShortcuts) {
$field
.on('keydown' + eventNamespace, module.event.field.keydown)
;
}
$module
.on('submit' + eventNamespace, module.validate.form)
;
$field
.on('blur' + eventNamespace, module.event.field.blur)
;
$submit
.on('click' + eventNamespace, module.submit)
;
$field
.on(module.get.changeEvent() + eventNamespace, module.event.field.change)
;
module.instantiate();
},
instantiate: function() {
module.verbose('Storing instance of module', module);
instance = module;
$module
.data(moduleNamespace, module)
;
},
destroy: function() {
module.verbose('Destroying previous module', instance);
$module
.off(eventNamespace)
.removeData(moduleNamespace)
;
},
refresh: function() {
module.verbose('Refreshing selector cache');
$field = $module.find(selector.field);
},
submit: function() {
module.verbose('Submitting form', $module);
$module
.submit()
;
},
event: {
field: {
keydown: function(event) {
var
$field = $(this),
key = event.which,
keyCode = {
enter : 13,
escape : 27
}
;
if( key == keyCode.escape) {
module.verbose('Escape key pressed blurring field');
$field
.blur()
;
}
if(!event.ctrlKey && key == keyCode.enter && $field.is(selector.input) ) {
module.debug('Enter key pressed, submitting form');
$submit
.addClass(className.down)
;
$field
.one('keyup' + eventNamespace, module.event.field.keyup)
;
event.preventDefault();
return false;
}
},
keyup: function() {
module.verbose('Doing keyboard shortcut form submit');
$submit.removeClass(className.down);
module.submit();
},
blur: function() {
var
$field = $(this),
$fieldGroup = $field.closest($group)
;
if( $fieldGroup.hasClass(className.error) ) {
module.debug('Revalidating field', $field, module.get.validation($field));
module.validate.field( module.get.validation($field) );
}
else if(settings.on == 'blur' || settings.on == 'change') {
module.validate.field( module.get.validation($field) );
}
},
change: function() {
var
$field = $(this),
$fieldGroup = $field.closest($group)
;
if( $fieldGroup.hasClass(className.error) ) {
module.debug('Revalidating field', $field, module.get.validation($field));
module.validate.field( module.get.validation($field) );
}
else if(settings.on == 'change') {
module.validate.field( module.get.validation($field) );
}
}
}
},
get: {
changeEvent: function() {
return (document.createElement('input').oninput !== undefined)
? 'input'
: (document.createElement('input').onpropertychange !== undefined)
? 'propertychange'
: 'keyup'
;
},
field: function(identifier) {
module.verbose('Finding field with identifier', identifier);
if( $field.filter('#' + identifier).size() > 0 ) {
return $field.filter('#' + identifier);
}
else if( $field.filter('[name="' + identifier +'"]').size() > 0 ) {
return $field.filter('[name="' + identifier +'"]');
}
else if( $field.filter('[data-' + metadata.validate + '="'+ identifier +'"]').size() > 0 ) {
return $field.filter('[data-' + metadata.validate + '="'+ identifier +'"]');
}
return $('<input/>');
},
validation: function($field) {
var
rules
;
$.each(validation, function(fieldName, field) {
if( module.get.field(field.identifier).get(0) == $field.get(0) ) {
rules = field;
}
});
return rules || false;
}
},
has: {
field: function(identifier) {
module.verbose('Checking for existence of a field with identifier', identifier);
if( $field.filter('#' + identifier).size() > 0 ) {
return true;
}
else if( $field.filter('[name="' + identifier +'"]').size() > 0 ) {
return true;
}
else if( $field.filter('[data-' + metadata.validate + '="'+ identifier +'"]').size() > 0 ) {
return true;
}
return false;
}
},
add: {
prompt: function(field, errors) {
var
$field = module.get.field(field.identifier),
$fieldGroup = $field.closest($group),
$prompt = $fieldGroup.find(selector.prompt),
promptExists = ($prompt.size() !== 0)
;
module.verbose('Adding inline error', field);
$fieldGroup
.addClass(className.error)
;
if(settings.inline) {
if(!promptExists) {
$prompt = settings.templates.prompt(errors);
$prompt
.appendTo($fieldGroup)
;
}
$prompt
.html(errors[0])
;
if(!promptExists) {
if(settings.transition && $.fn.transition !== undefined) {
module.verbose('Displaying error with css transition', settings.transition);
$prompt.transition(settings.transition + ' in', settings.duration);
}
else {
module.verbose('Displaying error with fallback javascript animation');
$prompt
.fadeIn(settings.duration)
;
}
}
}
},
errors: function(errors) {
module.debug('Adding form error messages', errors);
$message
.html( settings.templates.error(errors) )
;
}
},
remove: {
prompt: function(field) {
var
$field = module.get.field(field.identifier),
$fieldGroup = $field.closest($group),
$prompt = $fieldGroup.find(selector.prompt)
;
$fieldGroup
.removeClass(className.error)
;
if(settings.inline && $prompt.is(':visible')) {
module.verbose('Removing prompt for field', field);
if(settings.transition && $.fn.transition !== undefined) {
$prompt.transition(settings.transition + ' out', settings.duration, function() {
$prompt.remove();
});
}
else {
$prompt
.fadeOut(settings.duration, function(){
$prompt.remove();
})
;
}
}
}
},
validate: {
form: function(event) {
var
allValid = true
;
// reset errors
formErrors = [];
$.each(validation, function(fieldName, field) {
if( !( module.validate.field(field) ) ) {
allValid = false;
}
});
if(allValid) {
module.debug('Form has no validation errors, submitting');
$module
.removeClass(className.error)
.addClass(className.success)
;
$.proxy(settings.onSuccess, this)(event);
}
else {
module.debug('Form has errors');
$module.addClass(className.error);
if(!settings.inline) {
module.add.errors(formErrors);
}
return $.proxy(settings.onFailure, this)(formErrors);
}
},
// takes a validation object and returns whether field passes validation
field: function(field) {
var
$field = module.get.field(field.identifier),
fieldValid = true,
fieldErrors = []
;
if(field.rules !== undefined) {
$.each(field.rules, function(index, rule) {
if( module.has.field(field.identifier) && !( module.validate.rule(field, rule) ) ) {
module.debug('Field is invalid', field.identifier, rule.type);
fieldErrors.push(rule.prompt);
fieldValid = false;
}
});
}
if(fieldValid) {
module.remove.prompt(field, fieldErrors);
$.proxy(settings.onValid, $field)();
}
else {
formErrors = formErrors.concat(fieldErrors);
module.add.prompt(field, fieldErrors);
$.proxy(settings.onInvalid, $field)(fieldErrors);
return false;
}
return true;
},
// takes validation rule and returns whether field passes rule
rule: function(field, validation) {
var
$field = module.get.field(field.identifier),
type = validation.type,
value = $field.val(),
bracketRegExp = /\[(.*?)\]/i,
bracket = bracketRegExp.exec(type),
isValid = true,
ancillary,
functionType
;
// if bracket notation is used, pass in extra parameters
if(bracket !== undefined && bracket !== null) {
ancillary = bracket[1];
functionType = type.replace(bracket[0], '');
isValid = $.proxy(settings.rules[functionType], $module)(value, ancillary);
}
// normal notation
else {
isValid = $.proxy(settings.rules[type], $field)(value);
}
return isValid;
}
},
setting: function(name, value) {
module.debug('Changing setting', name, value);
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
module.debug('Changing internal', name, value);
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Element' : element,
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.size() > 1) {
title += ' ' + '(' + $allModules.size() + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && instance !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
instance = instance[camelCaseValue];
}
else if( instance[value] !== undefined ) {
found = instance[value];
return false;
}
else if( instance[camelCaseValue] !== undefined ) {
found = instance[camelCaseValue];
return false;
}
else {
module.error(error.method);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(invokedResponse)) {
invokedResponse.push(response);
}
else if(typeof invokedResponse == 'string') {
invokedResponse = [invokedResponse, response];
}
else if(response !== undefined) {
invokedResponse = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
module.destroy();
}
module.initialize();
}
})
;
return (invokedResponse !== undefined)
? invokedResponse
: this
;
};
$.fn.form.settings = {
name : 'Form',
namespace : 'form',
debug : true,
verbose : true,
performance : true,
keyboardShortcuts : true,
on : 'submit',
inline : false,
transition : 'scale',
duration : 150,
onValid : function() {},
onInvalid : function() {},
onSuccess : function() { return true; },
onFailure : function() { return false; },
metadata : {
validate: 'validate'
},
selector : {
message : '.error.message',
field : 'input, textarea, select',
group : '.field',
input : 'input',
prompt : '.prompt',
submit : '.submit'
},
className : {
error : 'error',
success : 'success',
down : 'down',
label : 'ui label prompt'
},
// errors
error: {
method : 'The method you called is not defined.'
},
templates: {
error: function(errors) {
var
html = '<ul class="list">'
;
$.each(errors, function(index, value) {
html += '<li>' + value + '</li>';
});
html += '</ul>';
return $(html);
},
prompt: function(errors) {
return $('<div/>')
.addClass('ui red pointing prompt label')
.html(errors[0])
;
}
},
rules: {
checked: function() {
return ($(this).filter(':checked').size() > 0);
},
empty: function(value) {
return !(value === undefined || '' === value);
},
email: function(value){
var
emailRegExp = new RegExp("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?")
;
return emailRegExp.test(value);
},
length: function(value, requiredLength) {
return (value !== undefined)
? (value.length >= requiredLength)
: false
;
},
not: function(value, notValue) {
return (value != notValue);
},
contains: function(value, text) {
return (value.search(text) !== -1);
},
is: function(value, text) {
return (value == text);
},
maxLength: function(value, maxLength) {
return (value !== undefined)
? (value.length <= maxLength)
: false
;
},
match: function(value, fieldIdentifier) {
// use either id or name of field
var
$form = $(this),
matchingValue
;
if($form.find('#' + fieldIdentifier).size() > 0) {
matchingValue = $form.find('#' + fieldIdentifier).val();
}
else if($form.find('[name=' + fieldIdentifier +']').size() > 0) {
matchingValue = $form.find('[name=' + fieldIdentifier + ']').val();
}
else if( $form.find('[data-validate="'+ fieldIdentifier +'"]').size() > 0 ) {
matchingValue = $form.find('[data-validate="'+ fieldIdentifier +'"]').val();
}
return (matchingValue !== undefined)
? ( value.toString() == matchingValue.toString() )
: false
;
},
url: function(value) {
var
urlRegExp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
;
return urlRegExp.test(value);
}
}
};
})( jQuery, window , document );
/*
* # Semantic - State
* http://github.com/jlukic/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ( $, window, document, undefined ) {
$.fn.state = function(parameters) {
var
$allModules = $(this),
settings = $.extend(true, {}, $.fn.state.settings, parameters),
moduleSelector = $allModules.selector || '',
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
// shortcuts
error = settings.error,
metadata = settings.metadata,
className = settings.className,
namespace = settings.namespace,
states = settings.states,
text = settings.text,
eventNamespace = '.' + namespace,
moduleNamespace = namespace + '-module',
invokedResponse
;
$allModules
.each(function() {
var
$module = $(this),
element = this,
instance = $module.data(moduleNamespace),
module
;
module = {
initialize: function() {
module.verbose('Initializing module');
// allow module to guess desired state based on element
if(settings.automatic) {
module.add.defaults();
}
// bind events with delegated events
if(settings.context && moduleSelector !== '') {
if( module.allows('hover') ) {
$(element, settings.context)
.on(moduleSelector, 'mouseenter' + eventNamespace, module.enable.hover)
.on(moduleSelector, 'mouseleave' + eventNamespace, module.disable.hover)
;
}
if( module.allows('down') ) {
$(element, settings.context)
.on(moduleSelector, 'mousedown' + eventNamespace, module.enable.down)
.on(moduleSelector, 'mouseup' + eventNamespace, module.disable.down)
;
}
if( module.allows('focus') ) {
$(element, settings.context)
.on(moduleSelector, 'focus' + eventNamespace, module.enable.focus)
.on(moduleSelector, 'blur' + eventNamespace, module.disable.focus)
;
}
$(settings.context)
.on(moduleSelector, 'mouseenter' + eventNamespace, module.change.text)
.on(moduleSelector, 'mouseleave' + eventNamespace, module.reset.text)
.on(moduleSelector, 'click' + eventNamespace, module.toggle.state)
;
}
else {
if( module.allows('hover') ) {
$module
.on('mouseenter' + eventNamespace, module.enable.hover)
.on('mouseleave' + eventNamespace, module.disable.hover)
;
}
if( module.allows('down') ) {
$module
.on('mousedown' + eventNamespace, module.enable.down)
.on('mouseup' + eventNamespace, module.disable.down)
;
}
if( module.allows('focus') ) {
$module
.on('focus' + eventNamespace, module.enable.focus)
.on('blur' + eventNamespace, module.disable.focus)
;
}
$module
.on('mouseenter' + eventNamespace, module.change.text)
.on('mouseleave' + eventNamespace, module.reset.text)
.on('click' + eventNamespace, module.toggle.state)
;
}
module.instantiate();
},
instantiate: function() {
module.verbose('Storing instance of module', module);
instance = module;
$module
.data(moduleNamespace, module)
;
},
destroy: function() {
module.verbose('Destroying previous module', instance);
$module
.off(eventNamespace)
.removeData(moduleNamespace)
;
},
refresh: function() {
module.verbose('Refreshing selector cache');
$module = $(element);
},
add: {
defaults: function() {
var
userStates = parameters && $.isPlainObject(parameters.states)
? parameters.states
: {}
;
$.each(settings.defaults, function(type, typeStates) {
if( module.is[type] !== undefined && module.is[type]() ) {
module.verbose('Adding default states', type, element);
$.extend(settings.states, typeStates, userStates);
}
});
}
},
is: {
active: function() {
return $module.hasClass(className.active);
},
loading: function() {
return $module.hasClass(className.loading);
},
inactive: function() {
return !( $module.hasClass(className.active) );
},
enabled: function() {
return !( $module.is(settings.filter.active) );
},
disabled: function() {
return ( $module.is(settings.filter.active) );
},
textEnabled: function() {
return !( $module.is(settings.filter.text) );
},
// definitions for automatic type detection
button: function() {
return $module.is('.button:not(a, .submit)');
},
input: function() {
return $module.is('input');
}
},
allow: function(state) {
module.debug('Now allowing state', state);
states[state] = true;
},
disallow: function(state) {
module.debug('No longer allowing', state);
states[state] = false;
},
allows: function(state) {
return states[state] || false;
},
enable: {
state: function(state) {
if(module.allows(state)) {
$module.addClass( className[state] );
}
},
// convenience
focus: function() {
$module.addClass(className.focus);
},
hover: function() {
$module.addClass(className.hover);
},
down: function() {
$module.addClass(className.down);
},
},
disable: {
state: function(state) {
if(module.allows(state)) {
$module.removeClass( className[state] );
}
},
// convenience
focus: function() {
$module.removeClass(className.focus);
},
hover: function() {
$module.removeClass(className.hover);
},
down: function() {
$module.removeClass(className.down);
},
},
toggle: {
state: function() {
var
apiRequest = $module.data(metadata.promise)
;
if( module.allows('active') && module.is.enabled() ) {
module.refresh();
if(apiRequest !== undefined) {
module.listenTo(apiRequest);
}
else {
module.change.state();
}
}
}
},
listenTo: function(apiRequest) {
module.debug('API request detected, waiting for state signal', apiRequest);
if(apiRequest) {
if(text.loading) {
module.update.text(text.loading);
}
$.when(apiRequest)
.then(function() {
if(apiRequest.state() == 'resolved') {
module.debug('API request succeeded');
settings.activateTest = function(){ return true; };
settings.deactivateTest = function(){ return true; };
}
else {
module.debug('API request failed');
settings.activateTest = function(){ return false; };
settings.deactivateTest = function(){ return false; };
}
module.change.state();
})
;
}
// xhr exists but set to false, beforeSend killed the xhr
else {
settings.activateTest = function(){ return false; };
settings.deactivateTest = function(){ return false; };
}
},
// checks whether active/inactive state can be given
change: {
state: function() {
module.debug('Determining state change direction');
// inactive to active change
if( module.is.inactive() ) {
module.activate();
}
else {
module.deactivate();
}
if(settings.sync) {
module.sync();
}
$.proxy(settings.onChange, element)();
},
text: function() {
if( module.is.textEnabled() ) {
if( module.is.active() ) {
if(text.hover) {
module.verbose('Changing text to hover text', text.hover);
module.update.text(text.hover);
}
else if(text.disable) {
module.verbose('Changing text to disable text', text.disable);
module.update.text(text.disable);
}
}
else {
if(text.hover) {
module.verbose('Changing text to hover text', text.disable);
module.update.text(text.hover);
}
else if(text.enable){
module.verbose('Changing text to enable text', text.enable);
module.update.text(text.enable);
}
}
}
}
},
activate: function() {
if( $.proxy(settings.activateTest, element)() ) {
module.debug('Setting state to active');
$module
.addClass(className.active)
;
module.update.text(text.active);
}
$.proxy(settings.onActivate, element)();
},
deactivate: function() {
if($.proxy(settings.deactivateTest, element)() ) {
module.debug('Setting state to inactive');
$module
.removeClass(className.active)
;
module.update.text(text.inactive);
}
$.proxy(settings.onDeactivate, element)();
},
sync: function() {
module.verbose('Syncing other buttons to current state');
if( module.is.active() ) {
$allModules
.not($module)
.state('activate');
}
else {
$allModules
.not($module)
.state('deactivate')
;
}
},
get: {
text: function() {
return (settings.selector.text)
? $module.find(settings.selector.text).text()
: $module.html()
;
},
textFor: function(state) {
return text[state] || false;
}
},
flash: {
text: function(text, duration) {
var
previousText = module.get.text()
;
module.debug('Flashing text message', text, duration);
text = text || settings.text.flash;
duration = duration || settings.flashDuration;
module.update.text(text);
setTimeout(function(){
module.update.text(previousText);
}, duration);
}
},
reset: {
// on mouseout sets text to previous value
text: function() {
var
activeText = text.active || $module.data(metadata.storedText),
inactiveText = text.inactive || $module.data(metadata.storedText)
;
if( module.is.textEnabled() ) {
if( module.is.active() && activeText) {
module.verbose('Resetting active text', activeText);
module.update.text(activeText);
}
else if(inactiveText) {
module.verbose('Resetting inactive text', activeText);
module.update.text(inactiveText);
}
}
}
},
update: {
text: function(text) {
var
currentText = module.get.text()
;
if(text && text !== currentText) {
module.debug('Updating text', text);
if(settings.selector.text) {
$module
.data(metadata.storedText, text)
.find(settings.selector.text)
.text(text)
;
}
else {
$module
.data(metadata.storedText, text)
.html(text)
;
}
}
else {
module.debug('Text is already sane, ignoring update', text);
}
}
},
setting: function(name, value) {
module.debug('Changing setting', name, value);
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
module.debug('Changing internal', name, value);
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Element' : element,
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.size() > 1) {
title += ' ' + '(' + $allModules.size() + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && instance !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
instance = instance[camelCaseValue];
}
else if( instance[value] !== undefined ) {
found = instance[value];
return false;
}
else if( instance[camelCaseValue] !== undefined ) {
found = instance[camelCaseValue];
return false;
}
else {
module.error(error.method);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(invokedResponse)) {
invokedResponse.push(response);
}
else if(typeof invokedResponse == 'string') {
invokedResponse = [invokedResponse, response];
}
else if(response !== undefined) {
invokedResponse = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
module.destroy();
}
module.initialize();
}
})
;
return (invokedResponse !== undefined)
? invokedResponse
: this
;
};
$.fn.state.settings = {
// module info
name : 'State',
// debug output
debug : true,
// verbose debug output
verbose : true,
// namespace for events
namespace : 'state',
// debug data includes performance
performance: true,
// callback occurs on state change
onActivate : function() {},
onDeactivate : function() {},
onChange : function() {},
// state test functions
activateTest : function() { return true; },
deactivateTest : function() { return true; },
// whether to automatically map default states
automatic : true,
// activate / deactivate changes all elements instantiated at same time
sync : false,
// default flash text duration, used for temporarily changing text of an element
flashDuration : 3000,
// selector filter
filter : {
text : '.loading, .disabled',
active : '.disabled'
},
context : false,
// error
error: {
method : 'The method you called is not defined.'
},
// metadata
metadata: {
promise : 'promise',
storedText : 'stored-text'
},
// change class on state
className: {
focus : 'focus',
hover : 'hover',
down : 'down',
active : 'active',
loading : 'loading'
},
selector: {
// selector for text node
text: false
},
defaults : {
input: {
hover : true,
focus : true,
down : true,
loading : false,
active : false
},
button: {
hover : true,
focus : false,
down : true,
active : true,
loading : true
}
},
states : {
hover : true,
focus : true,
down : true,
loading : false,
active : false
},
text : {
flash : false,
hover : false,
active : false,
inactive : false,
enable : false,
disable : false
}
};
})( jQuery, window , document );
/*
* # Semantic - Chatroom
* http://github.com/jlukic/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ($, window, document, undefined) {
$.fn.chatroom = function(parameters) {
var
// hoist arguments
moduleArguments = arguments || false
;
$(this)
.each(function() {
var
settings = $.extend(true, {}, $.fn.chatroom.settings, parameters),
className = settings.className,
namespace = settings.namespace,
selector = settings.selector,
error = settings.error,
$module = $(this),
$expandButton = $module.find(selector.expandButton),
$userListButton = $module.find(selector.userListButton),
$userList = $module.find(selector.userList),
$room = $module.find(selector.room),
$userCount = $module.find(selector.userCount),
$log = $module.find(selector.log),
$message = $module.find(selector.message),
$messageInput = $module.find(selector.messageInput),
$messageButton = $module.find(selector.messageButton),
instance = $module.data('module'),
html = '',
users = {},
channel,
loggedInUser,
message,
count,
height,
pusher,
module
;
module = {
width: {
log : $log.width(),
userList : $userList.outerWidth()
},
initialize: function() {
// check error conditions
if(Pusher === undefined) {
module.error(error.pusher);
}
if(settings.key === undefined || settings.channelName === undefined) {
module.error(error.key);
return false;
}
else if( !(settings.endpoint.message || settings.endpoint.authentication) ) {
module.error(error.endpoint);
return false;
}
// define pusher
pusher = new Pusher(settings.key);
Pusher.channel_auth_endpoint = settings.endpoint.authentication;
channel = pusher.subscribe(settings.channelName);
channel.bind('pusher:subscription_succeeded', module.user.list.create);
channel.bind('pusher:subscription_error', module.error);
channel.bind('pusher:member_added', module.user.joined);
channel.bind('pusher:member_removed', module.user.left);
channel.bind('update_messages', module.message.receive);
$.each(settings.customEvents, function(label, value) {
channel.bind(label, value);
});
// bind module events
$userListButton
.on('click.' + namespace, module.event.toggleUserList)
;
$expandButton
.on('click.' + namespace, module.event.toggleExpand)
;
$messageInput
.on('keydown.' + namespace, module.event.input.keydown)
.on('keyup.' + namespace, module.event.input.keyup)
;
$messageButton
.on('mouseenter.' + namespace, module.event.hover)
.on('mouseleave.' + namespace, module.event.hover)
.on('click.' + namespace, module.event.submit)
;
// scroll to bottom of chat log
$log
.animate({
scrollTop: $log.prop('scrollHeight')
}, 400)
;
$module
.data('module', module)
.addClass(className.loading)
;
},
// refresh module
refresh: function() {
// reset width calculations
$userListButton
.removeClass(className.active)
;
module.width = {
log : $log.width(),
userList : $userList.outerWidth()
};
if( $userListButton.hasClass(className.active) ) {
module.user.list.hide();
}
$module.data('module', module);
},
user: {
updateCount: function() {
if(settings.userCount) {
users = $module.data('users');
count = 0;
$.each(users, function() {
count++;
});
$userCount
.html( settings.templates.userCount(count) )
;
}
},
// add user to user list
joined: function(member) {
users = $module.data('users');
if(member.id != 'anonymous' && users[ member.id ] === undefined ) {
users[ member.id ] = member.info;
if(settings.randomColor && member.info.color === undefined) {
member.info.color = settings.templates.color(member.id);
}
html = settings.templates.userList(member.info);
if(member.info.isAdmin) {
$(html)
.prependTo($userList)
;
}
else {
$(html)
.appendTo($userList)
;
}
if(settings.partingMessages) {
$log
.append( settings.templates.joined(member.info) )
;
module.message.scroll.test();
}
module.user.updateCount();
}
},
// remove user from user list
left: function(member) {
users = $module.data('users');
if(member !== undefined && member.id !== 'anonymous') {
delete users[ member.id ];
$module
.data('users', users)
;
$userList
.find('[data-id='+ member.id + ']')
.remove()
;
if(settings.partingMessages) {
$log
.append( settings.templates.left(member.info) )
;
module.message.scroll.test();
}
module.user.updateCount();
}
},
list: {
// receives list of members and generates user list
create: function(members) {
users = {};
members.each(function(member) {
if(member.id !== 'anonymous' && member.id !== 'undefined') {
if(settings.randomColor && member.info.color === undefined) {
member.info.color = settings.templates.color(member.id);
}
// sort list with admin first
html = (member.info.isAdmin)
? settings.templates.userList(member.info) + html
: html + settings.templates.userList(member.info)
;
users[ member.id ] = member.info;
}
});
$module
.data('users', users)
.data('user', users[members.me.id] )
.removeClass(className.loading)
;
$userList
.html(html)
;
module.user.updateCount();
$.proxy(settings.onJoin, $userList.children())();
},
// shows user list
show: function() {
$log
.animate({
width: (module.width.log - module.width.userList)
}, {
duration : settings.speed,
easing : settings.easing,
complete : module.message.scroll.move
})
;
},
// hides user list
hide: function() {
$log
.stop()
.animate({
width: (module.width.log)
}, {
duration : settings.speed,
easing : settings.easing,
complete : module.message.scroll.move
})
;
}
}
},
message: {
// handles scrolling of chat log
scroll: {
test: function() {
height = $log.prop('scrollHeight') - $log.height();
if( Math.abs($log.scrollTop() - height) < settings.scrollArea) {
module.message.scroll.move();
}
},
move: function() {
height = $log.prop('scrollHeight') - $log.height();
$log
.scrollTop(height)
;
}
},
// sends chat message
send: function(message) {
if( !module.utils.emptyString(message) ) {
$.api({
url : settings.endpoint.message,
method : 'POST',
data : {
'message': {
content : message,
timestamp : new Date().getTime()
}
}
});
}
},
// receives chat response and processes
receive: function(response) {
message = response.data;
users = $module.data('users');
loggedInUser = $module.data('user');
if(users[ message.userID] !== undefined) {
// logged in user's messages already pushed instantly
if(loggedInUser === undefined || loggedInUser.id != message.userID) {
message.user = users[ message.userID ];
module.message.display(message);
}
}
},
// displays message in chat log
display: function(message) {
$log
.append( settings.templates.message(message) )
;
module.message.scroll.test();
$.proxy(settings.onMessage, $log.children().last() )();
}
},
expand: function() {
$module
.addClass(className.expand)
;
$.proxy(settings.onExpand, $module )();
module.refresh();
},
contract: function() {
$module
.removeClass(className.expand)
;
$.proxy(settings.onContract, $module )();
module.refresh();
},
event: {
input: {
keydown: function(event) {
if(event.which == 13) {
$messageButton
.addClass(className.down)
;
}
},
keyup: function(event) {
if(event.which == 13) {
$messageButton
.removeClass(className.down)
;
module.event.submit();
}
}
},
// handles message form submit
submit: function() {
var
message = $messageInput.val(),
loggedInUser = $module.data('user')
;
if(loggedInUser !== undefined && !module.utils.emptyString(message)) {
module.message.send(message);
// display immediately
module.message.display({
user: loggedInUser,
text: message
});
module.message.scroll.move();
$messageInput
.val('')
;
}
},
// handles button click on expand button
toggleExpand: function() {
if( !$module.hasClass(className.expand) ) {
$expandButton
.addClass(className.active)
;
module.expand();
}
else {
$expandButton
.removeClass(className.active)
;
module.contract();
}
},
// handles button click on user list button
toggleUserList: function() {
if( !$log.is(':animated') ) {
if( !$userListButton.hasClass(className.active) ) {
$userListButton
.addClass(className.active)
;
module.user.list.show();
}
else {
$userListButton
.removeClass('active')
;
module.user.list.hide();
}
}
}
},
utils: {
emptyString: function(string) {
if(typeof string == 'string') {
return (string.search(/\S/) == -1);
}
return false;
}
},
setting: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Element' : element,
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
title += ' ' + '(' + $allDropdowns.size() + ')';
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
maxDepth,
found
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && instance !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( instance[value] !== undefined ) {
found = instance[value];
}
else {
module.error(error.method);
}
});
}
if ( $.isFunction( found ) ) {
return found.apply(context, passedArguments);
}
return found || false;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
module.destroy();
}
module.initialize();
}
})
;
return (invokedResponse)
? invokedResponse
: this
;
};
$.fn.chatroom.settings = {
name : 'Chat',
debug : false,
namespace : 'chat',
channel : 'present-chat',
onJoin : function(){},
onMessage : function(){},
onExpand : function(){},
onContract : function(){},
customEvents : {},
partingMessages : false,
userCount : true,
randomColor : true,
speed : 300,
easing : 'easeOutQuint',
// pixels from bottom of chat log that should trigger auto scroll to bottom
scrollArea : 9999,
endpoint : {
message : false,
authentication : false
},
error: {
method : 'The method you called is not defined',
endpoint : 'Please define a message and authentication endpoint.',
key : 'You must specify a pusher key and channel.',
pusher : 'You must include the Pusher library.'
},
className : {
expand : 'expand',
active : 'active',
hover : 'hover',
down : 'down',
loading : 'loading'
},
selector : {
userCount : '.actions .message',
userListButton : '.actions .list.button',
expandButton : '.actions .expand.button',
room : '.room',
userList : '.room .list',
log : '.room .log',
message : '.room .log .message',
author : '.room log .message .author',
messageInput : '.talk input',
messageButton : '.talk .send.button'
},
templates: {
userCount: function(number) {
return number + ' users in chat';
},
color: function(userID) {
var
colors = [
'#000000',
'#333333',
'#666666',
'#999999',
'#CC9999',
'#CC6666',
'#CC3333',
'#993333',
'#663333',
'#CC6633',
'#CC9966',
'#CC9933',
'#999966',
'#CCCC66',
'#99CC66',
'#669933',
'#669966',
'#33A3CC',
'#336633',
'#33CCCC',
'#339999',
'#336666',
'#336699',
'#6666CC',
'#9966CC',
'#333399',
'#663366',
'#996699',
'#993366',
'#CC6699'
]
;
return colors[ Math.floor( Math.random() * colors.length) ];
},
message: function(message) {
var
html = ''
;
if(message.user.isAdmin) {
message.user.color = '#55356A';
html += '<div class="admin message">';
html += '<span class="quirky ui flag team"></span>';
}
/*
else if(message.user.isPro) {
html += '<div class="indent message">';
html += '<span class="quirky ui flag pro"></span>';
}
*/
else {
html += '<div class="message">';
}
html += '<p>';
if(message.user.color !== undefined) {
html += '<span class="author" style="color: ' + message.user.color + ';">' + message.user.name + '</span>: ';
}
else {
html += '<span class="author">' + message.user.name + '</span>: ';
}
html += ''
+ message.text
+ ' </p>'
+ '</div>'
;
return html;
},
joined: function(member) {
return (typeof member.name !== undefined)
? '<div class="status">' + member.name + ' has joined the chat.</div>'
: false
;
},
left: function(member) {
return (typeof member.name !== undefined)
? '<div class="status">' + member.name + ' has left the chat.</div>'
: false
;
},
userList: function(member) {
var
html = ''
;
if(member.isAdmin) {
member.color = '#55356A';
}
html += ''
+ '<div class="user" data-id="' + member.id + '">'
+ ' <div class="image">'
+ ' <img src="' + member.avatarURL + '">'
+ ' </div>'
;
if(member.color !== undefined) {
html += ' <p><a href="/users/' + member.id + '" target="_blank" style="color: ' + member.color + ';">' + member.name + '</a></p>';
}
else {
html += ' <p><a href="/users/' + member.id + '" target="_blank">' + member.name + '</a></p>';
}
html += '</div>';
return html;
}
}
};
})( jQuery, window , document );
/*
* # Semantic - Checkbox
* http://github.com/jlukic/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ( $, window, document, undefined ) {
$.fn.checkbox = function(parameters) {
var
$allModules = $(this),
moduleSelector = $allModules.selector || '',
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
invokedResponse
;
$allModules
.each(function() {
var
settings = $.extend(true, {}, $.fn.checkbox.settings, parameters),
className = settings.className,
namespace = settings.namespace,
error = settings.error,
eventNamespace = '.' + namespace,
moduleNamespace = 'module-' + namespace,
$module = $(this),
$label = $(this).next(settings.selector.label).first(),
$input = $(this).find(settings.selector.input),
selector = $module.selector || '',
instance = $module.data(moduleNamespace),
element = this,
module
;
module = {
initialize: function() {
module.verbose('Initializing checkbox', settings);
if(settings.context && selector !== '') {
module.verbose('Adding delegated events');
$(element, settings.context)
.on(selector, 'click' + eventNamespace, module.toggle)
.on(selector + ' + ' + settings.selector.label, 'click' + eventNamespace, module.toggle)
;
}
else {
$module
.on('click' + eventNamespace, module.toggle)
.data(moduleNamespace, module)
;
$label
.on('click' + eventNamespace, module.toggle)
;
}
module.instantiate();
},
instantiate: function() {
module.verbose('Storing instance of module', module);
instance = module;
$module
.data(moduleNamespace, module)
;
},
destroy: function() {
module.verbose('Destroying previous module');
$module
.off(eventNamespace)
.removeData(moduleNamespace)
;
},
is: {
radio: function() {
return $module.hasClass(className.radio);
}
},
can: {
disable: function() {
return (typeof settings.required === 'boolean')
? settings.required
: !module.is.radio()
;
}
},
enable: function() {
module.debug('Enabling checkbox', $input);
$input
.prop('checked', true)
;
$.proxy(settings.onChange, $input.get())();
$.proxy(settings.onEnable, $input.get())();
},
disable: function() {
module.debug('Disabling checkbox');
$input
.prop('checked', false)
;
$.proxy(settings.onChange, $input.get())();
$.proxy(settings.onDisable, $input.get())();
},
toggle: function(event) {
module.verbose('Determining new checkbox state');
if($input.prop('checked') === undefined || !$input.prop('checked')) {
module.enable();
}
else if( module.can.disable() ) {
module.disable();
}
},
setting: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Element' : element,
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && instance !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
instance = instance[camelCaseValue];
}
else if( instance[value] !== undefined ) {
found = instance[value];
return false;
}
else if( instance[camelCaseValue] !== undefined ) {
found = instance[camelCaseValue];
return false;
}
else {
module.error(error.method);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(invokedResponse)) {
invokedResponse.push(response);
}
else if(typeof invokedResponse == 'string') {
invokedResponse = [invokedResponse, response];
}
else if(response !== undefined) {
invokedResponse = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
module.destroy();
}
module.initialize();
}
})
;
return (invokedResponse !== undefined)
? invokedResponse
: this
;
};
$.fn.checkbox.settings = {
name : 'Checkbox',
namespace : 'checkbox',
verbose : true,
debug : true,
performance : true,
// delegated event context
context : false,
required : 'auto',
onChange : function(){},
onEnable : function(){},
onDisable : function(){},
error : {
method : 'The method you called is not defined.'
},
selector : {
input : 'input[type=checkbox], input[type=radio]',
label : 'label'
},
className : {
radio : 'radio'
}
};
})( jQuery, window , document );
/*
* # Semantic - Dimmer
* http://github.com/jlukic/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ( $, window, document, undefined ) {
$.fn.dimmer = function(parameters) {
var
$allModules = $(this),
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
invokedResponse
;
$allModules
.each(function() {
var
settings = ( $.isPlainObject(parameters) )
? $.extend(true, {}, $.fn.dimmer.settings, parameters)
: $.extend({}, $.fn.dimmer.settings),
selector = settings.selector,
namespace = settings.namespace,
className = settings.className,
error = settings.error,
eventNamespace = '.' + namespace,
moduleNamespace = 'module-' + namespace,
moduleSelector = $allModules.selector || '',
clickEvent = ('ontouchstart' in document.documentElement)
? 'touchstart'
: 'click',
$module = $(this),
$dimmer,
$dimmable,
element = this,
instance = $module.data(moduleNamespace),
module
;
module = {
preinitialize: function() {
if( module.is.dimmer() ) {
$dimmable = $module.parent();
$dimmer = $module;
}
else {
$dimmable = $module;
if( module.has.dimmer() ) {
$dimmer = $dimmable.children(selector.dimmer).first();
}
else {
$dimmer = module.create();
}
}
},
initialize: function() {
module.debug('Initializing dimmer', settings);
if(settings.on == 'hover') {
$dimmable
.on('mouseenter' + eventNamespace, module.show)
.on('mouseleave' + eventNamespace, module.hide)
;
}
else if(settings.on == 'click') {
$dimmable
.on(clickEvent + eventNamespace, module.toggle)
;
}
if( module.is.page() ) {
module.debug('Setting as a page dimmer', $dimmable);
module.set.pageDimmer();
}
if(settings.closable) {
module.verbose('Adding dimmer close event', $dimmer);
$dimmer
.on(clickEvent + eventNamespace, module.event.click)
;
}
module.set.dimmable();
module.instantiate();
},
instantiate: function() {
module.verbose('Storing instance of module', module);
instance = module;
$module
.data(moduleNamespace, instance)
;
},
destroy: function() {
module.verbose('Destroying previous module', $dimmer);
$module
.removeData(moduleNamespace)
;
$dimmable
.off(eventNamespace)
;
$dimmer
.off(eventNamespace)
;
},
event: {
click: function(event) {
module.verbose('Determining if event occured on dimmer', event);
if( $dimmer.find(event.target).size() === 0 || $(event.target).is(selector.content) ) {
module.hide();
event.stopImmediatePropagation();
}
}
},
addContent: function(element) {
var
$content = $(element).detach()
;
module.debug('Add content to dimmer', $content);
if($content.parent()[0] !== $dimmer[0]) {
$dimmer.append($content);
}
},
create: function() {
return $( settings.template.dimmer() ).appendTo($dimmable);
},
animate: {
show: function(callback) {
callback = callback || function(){};
module.set.dimmed();
if($.fn.transition !== undefined) {
$dimmer
.transition(settings.transition + ' in', module.get.duration(), function() {
module.set.active();
callback();
})
;
}
else {
module.verbose('Showing dimmer animation with javascript');
$dimmer
.stop()
.css({
opacity : 0,
width : '100%',
height : '100%'
})
.fadeTo(module.get.duration(), 1, function() {
$dimmer.removeAttr('style');
module.set.active();
callback();
})
;
}
},
hide: function(callback) {
callback = callback || function(){};
module.remove.dimmed();
if($.fn.transition !== undefined) {
module.verbose('Hiding dimmer with css');
$dimmer
.transition(settings.transition + ' out', module.get.duration(), function() {
module.remove.active();
callback();
})
;
}
else {
module.verbose('Hiding dimmer with javascript');
$dimmer
.stop()
.fadeOut(module.get.duration(), function() {
$dimmer.removeAttr('style');
module.remove.active();
callback();
})
;
}
}
},
get: {
dimmer: function() {
return $dimmer;
},
duration: function() {
if(typeof settings.duration == 'object') {
if( module.is.active() ) {
return settings.duration.hide;
}
else {
return settings.duration.show;
}
}
return settings.duration;
}
},
has: {
dimmer: function() {
return ( $module.children(selector.dimmer).size() > 0 );
}
},
is: {
dimmer: function() {
return $module.is(selector.dimmer);
},
dimmable: function() {
return $module.is(selector.dimmable);
},
active: function() {
return $dimmer.hasClass(className.active);
},
animating: function() {
return ( $dimmer.is(':animated') || $dimmer.hasClass(className.transition) );
},
page: function () {
return $dimmable.is('body');
},
enabled: function() {
return !$dimmable.hasClass(className.disabled);
},
disabled: function() {
return $dimmable.hasClass(className.disabled);
},
pageDimmer: function() {
return $dimmer.hasClass(className.pageDimmer);
}
},
can: {
show: function() {
return !$dimmer.hasClass(className.disabled);
}
},
set: {
active: function() {
$dimmer
.removeClass(className.transition)
.addClass(className.active)
;
},
dimmable: function() {
$dimmable.addClass(className.dimmable);
},
dimmed: function() {
$dimmable.addClass(className.dimmed);
},
pageDimmer: function() {
$dimmer.addClass(className.pageDimmer);
},
disabled: function() {
$dimmer.addClass(className.disabled);
}
},
remove: {
active: function() {
$dimmer
.removeClass(className.transition)
.removeClass(className.active)
;
},
dimmed: function() {
$dimmable.removeClass(className.dimmed);
},
disabled: function() {
$dimmer.removeClass(className.disabled);
}
},
show: function(callback) {
module.debug('Showing dimmer', $dimmer, settings);
if( !(module.is.active() || module.is.animating() ) && module.is.enabled() ) {
module.animate.show(callback);
$.proxy(settings.onShow, element)();
$.proxy(settings.onChange, element)();
}
else {
module.debug('Dimmer is already shown or disabled');
}
},
hide: function(callback) {
if( module.is.active() && !module.is.animating() ) {
module.debug('Hiding dimmer', $dimmer);
module.animate.hide(callback);
$.proxy(settings.onHide, element)();
$.proxy(settings.onChange, element)();
}
else {
module.debug('Dimmer is not visible');
}
},
toggle: function() {
module.verbose('Toggling dimmer visibility', $dimmer);
if( !module.is.active() ) {
module.show();
}
else {
module.hide();
}
},
setting: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Element' : element,
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.size() > 1) {
title += ' ' + '(' + $allModules.size() + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && instance !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
instance = instance[camelCaseValue];
}
else if( instance[value] !== undefined ) {
found = instance[value];
return false;
}
else if( instance[camelCaseValue] !== undefined ) {
found = instance[camelCaseValue];
return false;
}
else {
module.error(error.method);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(invokedResponse)) {
invokedResponse.push(response);
}
else if(typeof invokedResponse == 'string') {
invokedResponse = [invokedResponse, response];
}
else if(response !== undefined) {
invokedResponse = response;
}
return found;
}
};
module.preinitialize();
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
module.destroy();
}
module.initialize();
}
})
;
return (invokedResponse !== undefined)
? invokedResponse
: this
;
};
$.fn.dimmer.settings = {
name : 'Dimmer',
namespace : 'dimmer',
verbose : true,
debug : true,
performance : true,
transition : 'fade',
on : false,
closable : true,
duration : {
show : 500,
hide : 500
},
onChange : function(){},
onShow : function(){},
onHide : function(){},
error : {
method : 'The method you called is not defined.'
},
selector: {
dimmable : '.ui.dimmable',
dimmer : '.ui.dimmer',
content : '.ui.dimmer > .content, .ui.dimmer > .content > .center'
},
template: {
dimmer: function() {
return $('<div />').attr('class', 'ui dimmer');
}
},
className : {
active : 'active',
dimmable : 'ui dimmable',
dimmed : 'dimmed',
disabled : 'disabled',
pageDimmer : 'page',
hide : 'hide',
show : 'show',
transition : 'transition'
}
};
})( jQuery, window , document );
/*
* # Semantic - Dropdown
* http://github.com/jlukic/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ( $, window, document, undefined ) {
$.fn.dropdown = function(parameters) {
var
$allModules = $(this),
$document = $(document),
moduleSelector = $allModules.selector || '',
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
invokedResponse
;
$allModules
.each(function() {
var
settings = ( $.isPlainObject(parameters) )
? $.extend(true, {}, $.fn.dropdown.settings, parameters)
: $.extend({}, $.fn.dropdown.settings),
className = settings.className,
metadata = settings.metadata,
namespace = settings.namespace,
selector = settings.selector,
error = settings.error,
eventNamespace = '.' + namespace,
moduleNamespace = 'module-' + namespace,
isTouchDevice = ('ontouchstart' in document.documentElement),
$module = $(this),
$item = $module.find(selector.item),
$text = $module.find(selector.text),
$input = $module.find(selector.input),
$menu = $module.children(selector.menu),
element = this,
instance = $module.data(moduleNamespace),
module
;
module = {
initialize: function() {
module.debug('Initializing dropdown', settings);
if(isTouchDevice) {
$module
.on('touchstart' + eventNamespace, module.event.test.toggle)
;
}
else if(settings.on == 'click') {
$module
.on('click' + eventNamespace, module.event.test.toggle)
;
}
else if(settings.on == 'hover') {
$module
.on('mouseenter' + eventNamespace, module.delay.show)
.on('mouseleave' + eventNamespace, module.delay.hide)
;
}
else {
$module
.on(settings.on + eventNamespace, module.toggle)
;
}
if(settings.action == 'updateForm') {
module.set.selected();
}
$item
.on('mouseenter' + eventNamespace, module.event.item.mouseenter)
.on('mouseleave' + eventNamespace, module.event.item.mouseleave)
.on(module.get.selectEvent() + eventNamespace, module.event.item.click)
;
module.instantiate();
},
instantiate: function() {
module.verbose('Storing instance of dropdown', module);
instance = module;
$module
.data(moduleNamespace, module)
;
},
destroy: function() {
module.verbose('Destroying previous dropdown for', $module);
$item
.off(eventNamespace)
;
$module
.off(eventNamespace)
.removeData(moduleNamespace)
;
},
event: {
test: {
toggle: function(event) {
module.determine.intent(event, module.toggle);
event.stopImmediatePropagation();
},
hide: function(event) {
module.determine.intent(event, module.hide);
event.stopPropagation();
}
},
item: {
mouseenter: function(event) {
var
$currentMenu = $(this).find(selector.menu),
$otherMenus = $(this).siblings(selector.item).children(selector.menu)
;
if( $currentMenu.size() > 0 ) {
clearTimeout(module.itemTimer);
module.itemTimer = setTimeout(function() {
module.animate.hide(false, $otherMenus);
module.verbose('Showing sub-menu', $currentMenu);
module.animate.show(false, $currentMenu);
}, settings.delay.show * 2);
}
},
mouseleave: function(event) {
var
$currentMenu = $(this).find(selector.menu)
;
if($currentMenu.size() > 0) {
clearTimeout(module.itemTimer);
module.itemTimer = setTimeout(function() {
module.verbose('Hiding sub-menu', $currentMenu);
module.animate.hide(false, $currentMenu);
}, settings.delay.hide);
}
},
click: function (event) {
var
$choice = $(this),
text = $choice.data(metadata.text) || $choice.text(),
value = $choice.data(metadata.value) || text.toLowerCase()
;
if( $choice.find(selector.menu).size() === 0 ) {
module.verbose('Adding active state to selected item');
$item
.removeClass(className.active)
;
$choice
.addClass(className.active)
;
module.determine.selectAction(text, value);
$.proxy(settings.onChange, element)(value, text);
}
}
},
resetStyle: function() {
$(this).removeAttr('style');
}
},
determine: {
selectAction: function(text, value) {
module.verbose('Determining action', settings.action);
if(settings.action == 'auto') {
if(module.is.selection()) {
module.debug('Selection dropdown used updating form', text, value);
module.updateForm(text, value);
}
else {
module.debug('No action specified hiding dropdown', text, value);
module.hide();
}
}
else if( $.isFunction( module[settings.action] ) ) {
module.verbose('Triggering preset action', settings.action, text, value);
module[ settings.action ](text, value);
}
else if( $.isFunction(settings.action) ) {
module.verbose('Triggering user action', settings.action, text, value);
settings.action(text, value);
}
else {
module.error(error.action);
}
},
intent: function(event, callback) {
module.debug('Determining whether event occurred in dropdown', event.target);
callback = callback || function(){};
if( $(event.target).closest($menu).size() === 0 ) {
module.verbose('Triggering event', callback);
callback();
}
else {
module.verbose('Event occurred in dropdown, canceling callback');
}
}
},
bind: {
intent: function() {
module.verbose('Binding hide intent event to document');
$document
.on(module.get.selectEvent(), module.event.test.hide)
;
}
},
unbind: {
intent: function() {
module.verbose('Removing hide intent event from document');
$document
.off(module.get.selectEvent())
;
}
},
nothing: function() {},
changeText: function(text, value) {
module.set.text(text);
module.hide();
},
updateForm: function(text, value) {
module.set.text(text);
module.set.value(value);
module.hide();
},
get: {
selectEvent: function() {
return (isTouchDevice)
? 'touchstart'
: 'click'
;
},
text: function() {
return $text.text();
},
value: function() {
return $input.val();
},
item: function(value) {
var
$selectedItem
;
value = value || $input.val();
$item
.each(function() {
if( $(this).data(metadata.value) == value ) {
$selectedItem = $(this);
}
})
;
return $selectedItem || false;
}
},
set: {
text: function(text) {
module.debug('Changing text', text, $text);
$text.removeClass(className.placeholder);
$text.text(text);
},
value: function(value) {
module.debug('Adding selected value to hidden input', value, $input);
$input.val(value);
},
active: function() {
$module.addClass(className.active);
},
visible: function() {
$module.addClass(className.visible);
},
selected: function(value) {
var
$selectedItem = module.get.item(value),
selectedText
;
if($selectedItem) {
module.debug('Setting selected menu item to', $selectedItem);
selectedText = $selectedItem.data(metadata.text) || $selectedItem.text();
$item
.removeClass(className.active)
;
$selectedItem
.addClass(className.active)
;
module.set.text(selectedText);
}
}
},
remove: {
active: function() {
$module.removeClass(className.active);
},
visible: function() {
$module.removeClass(className.visible);
}
},
is: {
selection: function() {
return $module.hasClass(className.selection);
},
visible: function($subMenu) {
return ($subMenu)
? $subMenu.is(':animated, :visible')
: $menu.is(':animated, :visible')
;
},
hidden: function($subMenu) {
return ($subMenu)
? $subMenu.is(':not(:animated, :visible)')
: $menu.is(':not(:animated, :visible)')
;
}
},
can: {
click: function() {
return (isTouchDevice || settings.on == 'click');
},
show: function() {
return !$module.hasClass(className.disabled);
}
},
animate: {
show: function(callback, $subMenu) {
var
$currentMenu = $subMenu || $menu
;
callback = callback || function(){};
if( module.is.hidden($currentMenu) ) {
module.verbose('Doing menu show animation', $currentMenu);
if(settings.transition == 'none') {
callback();
}
else if($.fn.transition !== undefined) {
$currentMenu.transition({
animation : settings.transition + ' in',
duration : settings.duration,
complete : callback,
queue : false
});
}
else if(settings.transition == 'slide down') {
$currentMenu
.hide()
.clearQueue()
.children()
.clearQueue()
.css('opacity', 0)
.delay(50)
.animate({
opacity : 1
}, settings.duration, 'easeOutQuad', module.event.resetStyle)
.end()
.slideDown(100, 'easeOutQuad', function() {
$.proxy(module.event.resetStyle, this)();
callback();
})
;
}
else if(settings.transition == 'fade') {
$currentMenu
.hide()
.clearQueue()
.fadeIn(settings.duration, function() {
$.proxy(module.event.resetStyle, this)();
callback();
})
;
}
else {
module.error(error.transition);
}
}
},
hide: function(callback, $subMenu) {
var
$currentMenu = $subMenu || $menu
;
callback = callback || function(){};
if(module.is.visible($currentMenu) ) {
module.verbose('Doing menu hide animation', $currentMenu);
if($.fn.transition !== undefined) {
$currentMenu.transition({
animation : settings.transition + ' out',
duration : settings.duration,
complete : callback,
queue : false
});
}
else if(settings.transition == 'none') {
callback();
}
else if(settings.transition == 'slide down') {
$currentMenu
.show()
.clearQueue()
.children()
.clearQueue()
.css('opacity', 1)
.animate({
opacity : 0
}, 100, 'easeOutQuad', module.event.resetStyle)
.end()
.delay(50)
.slideUp(100, 'easeOutQuad', function() {
$.proxy(module.event.resetStyle, this)();
callback();
})
;
}
else if(settings.transition == 'fade') {
$currentMenu
.show()
.clearQueue()
.fadeOut(150, function() {
$.proxy(module.event.resetStyle, this)();
callback();
})
;
}
else {
module.error(error.transition);
}
}
}
},
show: function() {
module.debug('Checking if dropdown can show');
if( module.is.hidden() ) {
module.hideOthers();
module.set.active();
module.animate.show(module.set.visible);
if( module.can.click() ) {
module.bind.intent();
}
$.proxy(settings.onShow, element)();
}
},
hide: function() {
if( module.is.visible() ) {
module.debug('Hiding dropdown');
if( module.can.click() ) {
module.unbind.intent();
}
module.remove.active();
module.animate.hide(module.remove.visible);
$.proxy(settings.onHide, element)();
}
},
delay: {
show: function() {
module.verbose('Delaying show event to ensure user intent');
clearTimeout(module.timer);
module.timer = setTimeout(module.show, settings.delay.show);
},
hide: function() {
module.verbose('Delaying hide event to ensure user intent');
clearTimeout(module.timer);
module.timer = setTimeout(module.hide, settings.delay.hide);
}
},
hideOthers: function() {
module.verbose('Finding other dropdowns to hide');
$allModules
.not($module)
.has(selector.menu + ':visible')
.dropdown('hide')
;
},
toggle: function() {
module.verbose('Toggling menu visibility');
if( module.is.hidden() ) {
module.show();
}
else {
module.hide();
}
},
setting: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Element' : element,
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && instance !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
instance = instance[camelCaseValue];
}
else if( instance[value] !== undefined ) {
found = instance[value];
return false;
}
else if( instance[camelCaseValue] !== undefined ) {
found = instance[camelCaseValue];
return false;
}
else {
module.error(error.method);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(invokedResponse)) {
invokedResponse.push(response);
}
else if(typeof invokedResponse == 'string') {
invokedResponse = [invokedResponse, response];
}
else if(response !== undefined) {
invokedResponse = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
module.destroy();
}
module.initialize();
}
})
;
return (invokedResponse)
? invokedResponse
: this
;
};
$.fn.dropdown.settings = {
name : 'Dropdown',
namespace : 'dropdown',
verbose : true,
debug : true,
performance : true,
on : 'click',
action : 'auto',
delay: {
show: 200,
hide: 300
},
transition : 'slide down',
duration : 250,
onChange : function(){},
onShow : function(){},
onHide : function(){},
error : {
action : 'You called a dropdown action that was not defined',
method : 'The method you called is not defined.',
transition : 'The requested transition was not found'
},
metadata: {
text : 'text',
value : 'value'
},
selector : {
menu : '.menu',
item : '.menu > .item',
text : '> .text',
input : '> input[type="hidden"]'
},
className : {
active : 'active',
placeholder : 'default',
disabled : 'disabled',
visible : 'visible',
selection : 'selection'
}
};
})( jQuery, window , document );
/*
* # Semantic - Modal
* http://github.com/jlukic/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ( $, window, document, undefined ) {
$.fn.modal = function(parameters) {
var
$allModules = $(this),
$window = $(window),
$document = $(document),
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
invokedResponse
;
$allModules
.each(function() {
var
settings = ( $.isPlainObject(parameters) )
? $.extend(true, {}, $.fn.modal.settings, parameters)
: $.extend({}, $.fn.modal.settings),
selector = settings.selector,
className = settings.className,
namespace = settings.namespace,
error = settings.error,
eventNamespace = '.' + namespace,
moduleNamespace = 'module-' + namespace,
moduleSelector = $allModules.selector || '',
$module = $(this),
$context = $(settings.context),
$otherModals = $allModules.not($module),
$close = $module.find(selector.close),
$focusedElement,
$dimmable,
$dimmer,
element = this,
instance = $module.data(moduleNamespace),
module
;
module = {
initialize: function() {
module.verbose('Initializing dimmer', $context);
$dimmable = $context
.dimmer('add content', $module)
;
$dimmer = $context
.dimmer('get dimmer')
;
module.verbose('Attaching close events', $close);
$close
.on('click' + eventNamespace, module.event.close)
;
$window
.on('resize', function() {
module.event.debounce(module.refresh, 50);
})
;
module.instantiate();
},
instantiate: function() {
module.verbose('Storing instance of modal');
instance = module;
$module
.data(moduleNamespace, instance)
;
},
destroy: function() {
module.verbose('Destroying previous modal');
$module
.removeData(moduleNamespace)
.off(eventNamespace)
;
$close
.off(eventNamespace)
;
$context
.dimmer('destroy')
;
},
refresh: function() {
module.remove.scrolling();
module.cacheSizes();
module.set.type();
module.set.position();
},
attachEvents: function(selector, event) {
var
$toggle = $(selector)
;
event = $.isFunction(module[event])
? module[event]
: module.toggle
;
if($toggle.size() > 0) {
module.debug('Attaching modal events to element', selector, event);
$toggle
.off(eventNamespace)
.on('click' + eventNamespace, event)
;
}
else {
module.error(error.notFound);
}
},
event: {
close: function() {
module.verbose('Closing element pressed');
if( $(this).is(selector.approve) ) {
$.proxy(settings.onApprove, element)();
}
if( $(this).is(selector.deny) ) {
$.proxy(settings.onDeny, element)();
}
module.hide();
},
click: function(event) {
module.verbose('Determining if event occured on dimmer', event);
if( $dimmer.find(event.target).size() === 0 ) {
module.hide();
event.stopImmediatePropagation();
}
},
debounce: function(method, delay) {
clearTimeout(module.timer);
module.timer = setTimeout(method, delay);
},
keyboard: function(event) {
var
keyCode = event.which,
escapeKey = 27
;
if(keyCode == escapeKey) {
module.debug('Escape key pressed hiding modal');
module.hide();
event.preventDefault();
}
},
resize: function() {
if( $dimmable.dimmer('is active') ) {
module.refresh();
}
}
},
toggle: function() {
if( module.is.active() ) {
module.hide();
}
else {
module.show();
}
},
show: function() {
module.showDimmer();
module.cacheSizes();
module.set.position();
module.hideAll();
if(settings.transition && $.fn.transition !== undefined) {
$module
.transition(settings.transition + ' in', settings.duration, module.set.active)
;
}
else {
$module
.fadeIn(settings.duration, settings.easing, module.set.active)
;
}
module.debug('Triggering dimmer');
$.proxy(settings.onShow, element)();
},
showDimmer: function() {
module.debug('Showing modal');
module.set.dimmerSettings();
$dimmable.dimmer('show');
},
hide: function() {
if(settings.closable) {
$dimmer
.off('click' + eventNamespace)
;
}
if( $dimmable.dimmer('is active') ) {
$dimmable.dimmer('hide');
}
if( module.is.active() ) {
module.hideModal();
$.proxy(settings.onHide, element)();
}
else {
module.debug('Cannot hide modal, modal is not visible');
}
},
hideDimmer: function() {
module.debug('Hiding dimmer');
$dimmable.dimmer('hide');
},
hideModal: function() {
module.debug('Hiding modal');
module.remove.keyboardShortcuts();
if(settings.transition && $.fn.transition !== undefined) {
$module
.transition(settings.transition + ' out', settings.duration, function() {
module.remove.active();
module.restore.focus();
})
;
}
else {
$module
.fadeOut(settings.duration, settings.easing, function() {
module.remove.active();
module.restore.focus();
})
;
}
},
hideAll: function() {
$otherModals
.filter(':visible')
.modal('hide')
;
},
add: {
keyboardShortcuts: function() {
module.verbose('Adding keyboard shortcuts');
$document
.on('keyup' + eventNamespace, module.event.keyboard)
;
}
},
save: {
focus: function() {
$focusedElement = $(document.activeElement).blur();
}
},
restore: {
focus: function() {
if($focusedElement.size() > 0) {
$focusedElement.focus();
}
}
},
remove: {
active: function() {
$module.removeClass(className.active);
},
keyboardShortcuts: function() {
module.verbose('Removing keyboard shortcuts');
$document
.off('keyup' + eventNamespace)
;
},
scrolling: function() {
$dimmable.removeClass(className.scrolling);
$module.removeClass(className.scrolling);
}
},
cacheSizes: function() {
module.cache = {
height : $module.outerHeight() + settings.offset,
contextHeight : (settings.context == 'body')
? $(window).height()
: $dimmable.height()
};
module.debug('Caching modal and container sizes', module.cache);
},
can: {
fit: function() {
return (module.cache.height < module.cache.contextHeight);
}
},
is: {
active: function() {
return $module.hasClass(className.active);
}
},
set: {
active: function() {
module.add.keyboardShortcuts();
module.save.focus();
module.set.type();
$module
.addClass(className.active)
;
if(settings.closable) {
$dimmer
.on('click' + eventNamespace, module.event.click)
;
}
},
dimmerSettings: function() {
module.debug('Setting dimmer settings', $dimmable);
$dimmable
.dimmer({
closable: false,
show: settings.duration * 0.95,
hide: settings.duration * 1.05
})
;
},
scrolling: function() {
$dimmable.addClass(className.scrolling);
$module.addClass(className.scrolling);
},
type: function() {
if(module.can.fit()) {
module.verbose('Modal fits on screen');
module.remove.scrolling();
}
else {
module.verbose('Modal cannot fit on screen setting to scrolling');
module.set.scrolling();
}
},
position: function() {
module.verbose('Centering modal on page', module.cache, module.cache.height / 2);
if(module.can.fit()) {
$module
.css({
top: '',
marginTop: -(module.cache.height / 2)
})
;
}
else {
$module
.css({
marginTop : '1em',
top : $document.scrollTop()
})
;
}
}
},
setting: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Element' : element,
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && instance !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
instance = instance[camelCaseValue];
}
else if( instance[value] !== undefined ) {
found = instance[value];
return false;
}
else if( instance[camelCaseValue] !== undefined ) {
found = instance[camelCaseValue];
return false;
}
else {
module.error(error.method);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(invokedResponse)) {
invokedResponse.push(response);
}
else if(typeof invokedResponse == 'string') {
invokedResponse = [invokedResponse, response];
}
else if(response !== undefined) {
invokedResponse = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
module.destroy();
}
module.initialize();
}
})
;
return (invokedResponse !== undefined)
? invokedResponse
: this
;
};
$.fn.modal.settings = {
name : 'Modal',
namespace : 'modal',
verbose : true,
debug : true,
performance : true,
closable : true,
context : 'body',
duration : 500,
easing : 'easeOutExpo',
offset : 0,
transition : 'scale',
onShow : function(){},
onHide : function(){},
onApprove : function(){ console.log('approved'); },
onDeny : function(){ console.log('denied'); },
selector : {
close : '.close, .actions .button',
approve : '.actions .positive, .actions .approve',
deny : '.actions .negative, .actions .cancel'
},
error : {
method : 'The method you called is not defined.'
},
className : {
active : 'active',
scrolling : 'scrolling'
},
};
})( jQuery, window , document );
/*
* # Semantic - Nag
* http://github.com/jlukic/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ($, window, document, undefined) {
$.fn.nag = function(parameters) {
var
$allModules = $(this),
moduleSelector = $allModules.selector || '',
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
invokedResponse
;
$(this)
.each(function() {
var
settings = $.extend(true, {}, $.fn.nag.settings, parameters),
className = settings.className,
selector = settings.selector,
error = settings.error,
namespace = settings.namespace,
eventNamespace = '.' + namespace,
moduleNamespace = namespace + '-module',
$module = $(this),
$close = $module.find(selector.close),
$context = $(settings.context),
element = this,
instance = $module.data(moduleNamespace),
moduleOffset,
moduleHeight,
contextWidth,
contextHeight,
contextOffset,
yOffset,
yPosition,
timer,
module,
requestAnimationFrame = window.requestAnimationFrame
|| window.mozRequestAnimationFrame
|| window.webkitRequestAnimationFrame
|| window.msRequestAnimationFrame
|| function(callback) { setTimeout(callback, 0); }
;
module = {
initialize: function() {
module.verbose('Initializing element');
// calculate module offset once
moduleOffset = $module.offset();
moduleHeight = $module.outerHeight();
contextWidth = $context.outerWidth();
contextHeight = $context.outerHeight();
contextOffset = $context.offset();
$module
.data(moduleNamespace, module)
;
$close
.on('click' + eventNamespace, module.dismiss)
;
// lets avoid javascript if we dont need to reposition
if(settings.context == window && settings.position == 'fixed') {
$module
.addClass(className.fixed)
;
}
if(settings.sticky) {
module.verbose('Adding scroll events');
// retrigger on scroll for absolute
if(settings.position == 'absolute') {
$context
.on('scroll' + eventNamespace, module.event.scroll)
.on('resize' + eventNamespace, module.event.scroll)
;
}
// fixed is always relative to window
else {
$(window)
.on('scroll' + eventNamespace, module.event.scroll)
.on('resize' + eventNamespace, module.event.scroll)
;
}
// fire once to position on init
$.proxy(module.event.scroll, this)();
}
if(settings.displayTime > 0) {
setTimeout(module.hide, settings.displayTime);
}
if(module.should.show()) {
if( !$module.is(':visible') ) {
module.show();
}
}
else {
module.hide();
}
},
destroy: function() {
module.verbose('Destroying instance');
$module
.removeData(moduleNamespace)
.off(eventNamespace)
;
if(settings.sticky) {
$context
.off(eventNamespace)
;
}
},
refresh: function() {
module.debug('Refreshing cached calculations');
moduleOffset = $module.offset();
moduleHeight = $module.outerHeight();
contextWidth = $context.outerWidth();
contextHeight = $context.outerHeight();
contextOffset = $context.offset();
},
show: function() {
module.debug('Showing nag', settings.animation.show);
if(settings.animation.show == 'fade') {
$module
.fadeIn(settings.duration, settings.easing)
;
}
else {
$module
.slideDown(settings.duration, settings.easing)
;
}
},
hide: function() {
module.debug('Showing nag', settings.animation.hide);
if(settings.animation.show == 'fade') {
$module
.fadeIn(settings.duration, settings.easing)
;
}
else {
$module
.slideUp(settings.duration, settings.easing)
;
}
},
onHide: function() {
module.debug('Removing nag', settings.animation.hide);
$module.remove();
if (settings.onHide) {
settings.onHide();
}
},
stick: function() {
module.refresh();
if(settings.position == 'fixed') {
var
windowScroll = $(window).prop('pageYOffset') || $(window).scrollTop(),
fixedOffset = ( $module.hasClass(className.bottom) )
? contextOffset.top + (contextHeight - moduleHeight) - windowScroll
: contextOffset.top - windowScroll
;
$module
.css({
position : 'fixed',
top : fixedOffset,
left : contextOffset.left,
width : contextWidth - settings.scrollBarWidth
})
;
}
else {
$module
.css({
top : yPosition
})
;
}
},
unStick: function() {
$module
.css({
top : ''
})
;
},
dismiss: function(event) {
if(settings.storageMethod) {
module.storage.set(settings.storedKey, settings.storedValue);
}
module.hide();
event.stopImmediatePropagation();
event.preventDefault();
},
should: {
show: function() {
if(settings.persist) {
module.debug('Persistent nag is set, can show nag');
return true;
}
if(module.storage.get(settings.storedKey) != settings.storedValue) {
module.debug('Stored value is not set, can show nag', module.storage.get(settings.storedKey));
return true;
}
module.debug('Stored value is set, cannot show nag', module.storage.get(settings.storedKey));
return false;
},
stick: function() {
yOffset = $context.prop('pageYOffset') || $context.scrollTop();
yPosition = ( $module.hasClass(className.bottom) )
? (contextHeight - $module.outerHeight() ) + yOffset
: yOffset
;
// absolute position calculated when y offset met
if(yPosition > moduleOffset.top) {
return true;
}
else if(settings.position == 'fixed') {
return true;
}
return false;
}
},
storage: {
set: function(key, value) {
module.debug('Setting stored value', key, value, settings.storageMethod);
if(settings.storageMethod == 'local' && window.store !== undefined) {
window.store.set(key, value);
}
// store by cookie
else if($.cookie !== undefined) {
$.cookie(key, value);
}
else {
module.error(error.noStorage);
}
},
get: function(key) {
module.debug('Getting stored value', key, settings.storageMethod);
if(settings.storageMethod == 'local' && window.store !== undefined) {
return window.store.get(key);
}
// get by cookie
else if($.cookie !== undefined) {
return $.cookie(key);
}
else {
module.error(error.noStorage);
}
}
},
event: {
scroll: function() {
if(timer !== undefined) {
clearTimeout(timer);
}
timer = setTimeout(function() {
if(module.should.stick() ) {
requestAnimationFrame(module.stick);
}
else {
module.unStick();
}
}, settings.lag);
}
},
setting: function(name, value) {
module.debug('Changing setting', name, value);
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
module.debug('Changing internal', name, value);
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Element' : element,
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.size() > 1) {
title += ' ' + '(' + $allModules.size() + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && instance !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
instance = instance[camelCaseValue];
}
else if( instance[value] !== undefined ) {
found = instance[value];
return false;
}
else if( instance[camelCaseValue] !== undefined ) {
found = instance[camelCaseValue];
return false;
}
else {
module.error(error.method);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(invokedResponse)) {
invokedResponse.push(response);
}
else if(typeof invokedResponse == 'string') {
invokedResponse = [invokedResponse, response];
}
else if(response !== undefined) {
invokedResponse = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
module.destroy();
}
module.initialize();
}
})
;
return (invokedResponse !== undefined)
? invokedResponse
: this
;
};
$.fn.nag.settings = {
name : 'Nag',
verbose : true,
debug : true,
performance : true,
namespace : 'Nag',
// allows cookie to be overriden
persist : false,
// set to zero to manually dismiss, otherwise hides on its own
displayTime : 0,
animation : {
show: 'slide',
hide: 'slide'
},
// method of stickyness
position : 'fixed',
scrollBarWidth : 18,
// type of storage to use
storageMethod : 'cookie',
// value to store in dismissed localstorage/cookie
storedKey : 'nag',
storedValue : 'dismiss',
// need to calculate stickyness on scroll
sticky : false,
// how often to check scroll event
lag : 0,
// context for scroll event
context : window,
error: {
noStorage : 'Neither $.cookie or store is defined. A storage solution is required for storing state',
method : 'The method you called is not defined.'
},
className : {
bottom : 'bottom',
fixed : 'fixed'
},
selector : {
close: '.icon.close'
},
speed : 500,
easing : 'easeOutQuad',
onHide: function() {}
};
})( jQuery, window , document );
/*
* # Semantic - Popup
* http://github.com/jlukic/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ($, window, document, undefined) {
$.fn.popup = function(parameters) {
var
$allModules = $(this),
$document = $(document),
moduleSelector = $allModules.selector || '',
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
invokedResponse
;
$allModules
.each(function() {
var
settings = ( $.isPlainObject(parameters) )
? $.extend(true, {}, $.fn.popup.settings, parameters)
: $.extend({}, $.fn.popup.settings),
selector = settings.selector,
className = settings.className,
error = settings.error,
metadata = settings.metadata,
namespace = settings.namespace,
eventNamespace = '.' + settings.namespace,
moduleNamespace = 'module-' + namespace,
$module = $(this),
$window = $(window),
$offsetParent = $module.offsetParent(),
$popup = (settings.inline)
? $module.next(settings.selector.popup)
: $window.children(settings.selector.popup).last(),
searchDepth = 0,
element = this,
instance = $module.data(moduleNamespace),
module
;
module = {
// binds events
initialize: function() {
module.debug('Initializing module', $module);
if(settings.on == 'hover') {
$module
.on('mouseenter' + eventNamespace, module.event.mouseenter)
.on('mouseleave' + eventNamespace, module.event.mouseleave)
;
}
else {
$module
.on(settings.on + '' + eventNamespace, module.event[settings.on])
;
}
$window
.on('resize' + eventNamespace, module.event.resize)
;
module.instantiate();
},
instantiate: function() {
module.verbose('Storing instance of module', module);
instance = module;
$module
.data(moduleNamespace, instance)
;
},
refresh: function() {
$popup = (settings.inline)
? $module.next(selector.popup)
: $window.children(selector.popup).last()
;
$offsetParent = $module.offsetParent();
},
destroy: function() {
module.debug('Destroying previous module');
$window
.off(eventNamespace)
;
$module
.off(eventNamespace)
.removeData(moduleNamespace)
;
},
event: {
mouseenter: function(event) {
var element = this;
module.timer = setTimeout(function() {
$.proxy(module.toggle, element)();
if( $(element).hasClass(className.visible) ) {
event.stopPropagation();
}
}, settings.delay);
},
mouseleave: function() {
clearTimeout(module.timer);
if( $module.is(':visible') ) {
module.hide();
}
},
click: function(event) {
$.proxy(module.toggle, this)();
if( $(this).hasClass(className.visible) ) {
event.stopPropagation();
}
},
resize: function() {
if( $popup.is(':visible') ) {
module.position();
}
}
},
// generates popup html from metadata
create: function() {
module.debug('Creating pop-up html');
var
html = $module.data(metadata.html) || settings.html,
variation = $module.data(metadata.variation) || settings.variation,
title = $module.data(metadata.title) || settings.title,
content = $module.data(metadata.content) || $module.attr('title') || settings.content
;
if(html || content || title) {
if(!html) {
html = settings.template({
title : title,
content : content
});
}
$popup = $('<div/>')
.addClass(className.popup)
.addClass(variation)
.html(html)
;
if(settings.inline) {
module.verbose('Inserting popup element inline', $popup);
$popup
.insertAfter($module)
;
}
else {
module.verbose('Appending popup element to body', $popup);
$popup
.appendTo( $('body') )
;
}
$.proxy(settings.onCreate, $popup)();
}
else {
module.error(error.content);
}
},
remove: function() {
module.debug('Removing popup');
$popup
.remove()
;
},
get: {
offstagePosition: function() {
var
boundary = {
top : $(window).scrollTop(),
bottom : $(window).scrollTop() + $(window).height(),
left : 0,
right : $(window).width()
},
popup = {
width : $popup.width(),
height : $popup.outerHeight(),
position : $popup.offset()
},
offstage = {},
offstagePositions = []
;
if(popup.position) {
offstage = {
top : (popup.position.top < boundary.top),
bottom : (popup.position.top + popup.height > boundary.bottom),
right : (popup.position.left + popup.width > boundary.right),
left : (popup.position.left < boundary.left)
};
}
module.verbose('Checking if outside viewable area', popup.position);
// return only boundaries that have been surpassed
$.each(offstage, function(direction, isOffstage) {
if(isOffstage) {
offstagePositions.push(direction);
}
});
return (offstagePositions.length > 0)
? offstagePositions.join(' ')
: false
;
},
nextPosition: function(position) {
switch(position) {
case 'top left':
position = 'bottom left';
break;
case 'bottom left':
position = 'top right';
break;
case 'top right':
position = 'bottom right';
break;
case 'bottom right':
position = 'top center';
break;
case 'top center':
position = 'bottom center';
break;
case 'bottom center':
position = 'right center';
break;
case 'right center':
position = 'left center';
break;
case 'left center':
position = 'top center';
break;
}
return position;
}
},
// determines popup state
toggle: function() {
$module = $(this);
module.debug('Toggling pop-up');
// refresh state of module
module.refresh();
if( !$module.hasClass(className.visible) ) {
if(settings.on == 'click') {
module.hideAll();
}
module.show();
}
else {
// module.hide();
}
},
position: function(position, arrowOffset) {
var
windowWidth = $(window).width(),
windowHeight = $(window).height(),
width = $module.outerWidth(),
height = $module.outerHeight(),
popupWidth = $popup.width(),
popupHeight = $popup.outerHeight(),
offset = (settings.inline)
? $module.position()
: $module.offset(),
parentWidth = (settings.inline)
? $offsetParent.outerWidth()
: $window.outerWidth(),
parentHeight = (settings.inline)
? $offsetParent.outerHeight()
: $window.outerHeight(),
positioning,
offstagePosition
;
position = position || $module.data(metadata.position) || settings.position;
arrowOffset = arrowOffset || $module.data(metadata.arrowOffset) || settings.arrowOffset;
module.debug('Calculating offset for position', position);
switch(position) {
case 'top left':
positioning = {
bottom : parentHeight - offset.top + settings.distanceAway,
right : parentWidth - offset.left - width - arrowOffset,
top : 'auto',
left : 'auto'
};
break;
case 'top center':
positioning = {
bottom : parentHeight - offset.top + settings.distanceAway,
left : offset.left + (width / 2) - (popupWidth / 2) + arrowOffset,
top : 'auto',
right : 'auto'
};
break;
case 'top right':
positioning = {
top : 'auto',
bottom : parentHeight - offset.top + settings.distanceAway,
left : offset.left + arrowOffset
};
break;
case 'left center':
positioning = {
top : offset.top + (height / 2) - (popupHeight / 2),
right : parentWidth - offset.left + settings.distanceAway - arrowOffset,
left : 'auto',
bottom : 'auto'
};
break;
case 'right center':
positioning = {
top : offset.top + (height / 2) - (popupHeight / 2),
left : offset.left + width + settings.distanceAway + arrowOffset,
bottom : 'auto',
right : 'auto'
};
break;
case 'bottom left':
positioning = {
top : offset.top + height + settings.distanceAway,
right : parentWidth - offset.left - width - arrowOffset,
left : 'auto',
bottom : 'auto'
};
break;
case 'bottom center':
positioning = {
top : offset.top + height + settings.distanceAway,
left : offset.left + (width / 2) - (popupWidth / 2) + arrowOffset,
bottom : 'auto',
right : 'auto'
};
break;
case 'bottom right':
positioning = {
top : offset.top + height + settings.distanceAway,
left : offset.left + arrowOffset,
bottom : 'auto',
right : 'auto'
};
break;
}
// true width on popup, avoid rounding error
$.extend(positioning, {
width: $popup.width() + 1
});
// tentatively place on stage
$popup
.css(positioning)
.removeClass(className.position)
.addClass(position)
;
// check if is offstage
offstagePosition = module.get.offstagePosition();
// recursively find new positioning
if(offstagePosition) {
module.debug('Element is outside boundaries ', offstagePosition);
if(searchDepth < settings.maxSearchDepth) {
position = module.get.nextPosition(position);
searchDepth++;
module.debug('Trying new position: ', position);
return module.position(position);
}
else {
module.error(error.recursion);
searchDepth = 0;
return false;
}
}
else {
module.debug('Position is on stage', position);
searchDepth = 0;
return true;
}
},
show: function() {
module.debug('Showing pop-up', settings.transition);
if($popup.size() === 0) {
module.create();
}
module.position();
$module
.addClass(className.visible)
;
if(settings.transition && $.fn.transition !== undefined) {
$popup
.transition(settings.transition + ' in', settings.duration)
;
}
else {
$popup
.stop()
.fadeIn(settings.duration, settings.easing)
;
}
if(settings.on == 'click' && settings.clicktoClose) {
module.debug('Binding popup close event');
$document
.on('click.' + namespace, module.gracefully.hide)
;
}
$.proxy(settings.onShow, $popup)();
},
hideAll: function() {
$(selector.popup)
.filter(':visible')
.popup('hide')
;
},
hide: function() {
$module
.removeClass(className.visible)
;
if($popup.is(':visible') ) {
module.debug('Hiding pop-up');
if(settings.transition && $.fn.transition !== undefined) {
$popup
.transition(settings.transition + ' out', settings.duration, module.reset)
;
}
else {
$popup
.stop()
.fadeOut(settings.duration, settings.easing, module.reset)
;
}
}
if(settings.on == 'click' && settings.clicktoClose) {
$document
.off('click.' + namespace)
;
}
$.proxy(settings.onHide, $popup)();
},
reset: function() {
module.verbose('Resetting inline styles');
$popup
.attr('style', '')
.removeAttr('style')
;
if(!settings.inline) {
module.remove();
}
},
gracefully: {
hide: function(event) {
// don't close on clicks inside popup
if( $(event.target).closest(selector.popup).size() === 0) {
module.hide();
}
}
},
setting: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Element' : element,
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && instance !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
instance = instance[camelCaseValue];
}
else if( instance[value] !== undefined ) {
found = instance[value];
return false;
}
else if( instance[camelCaseValue] !== undefined ) {
found = instance[camelCaseValue];
return false;
}
else {
module.error(error.method);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(invokedResponse)) {
invokedResponse.push(response);
}
else if(typeof invokedResponse == 'string') {
invokedResponse = [invokedResponse, response];
}
else if(response !== undefined) {
invokedResponse = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
module.destroy();
}
module.initialize();
}
})
;
return (invokedResponse !== undefined)
? invokedResponse
: this
;
};
$.fn.popup.settings = {
name : 'Popup',
debug : true,
verbose : true,
performance : true,
namespace : 'popup',
onCreate : function(){},
onShow : function(){},
onHide : function(){},
variation : '',
content : false,
html : false,
title : false,
on : 'hover',
clicktoClose : true,
position : 'top center',
delay : 150,
inline : true,
duration : 150,
easing : 'easeOutQuint',
transition : 'scale',
distanceAway : 0,
arrowOffset : 0,
maxSearchDepth : 10,
error: {
content : 'Your popup has no content specified',
method : 'The method you called is not defined.',
recursion : 'Popup attempted to reposition element to fit, but could not find an adequate position.'
},
metadata: {
arrowOffset : 'arrowOffset',
content : 'content',
html : 'html',
position : 'position',
title : 'title',
variation : 'variation'
},
className : {
popup : 'ui popup',
visible : 'visible',
loading : 'loading',
position : 'top left center bottom right'
},
selector : {
popup : '.ui.popup'
},
template: function(text) {
var html = '';
if(typeof text !== undefined) {
if(typeof text.title !== undefined && text.title) {
html += '<div class="header">' + text.title + '</div class="header">';
}
if(typeof text.content !== undefined && text.content) {
html += '<div class="content">' + text.content + '</div>';
}
}
return html;
}
};
})( jQuery, window , document );
/*
* # Semantic - Rating
* http://github.com/jlukic/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ($, window, document, undefined) {
$.fn.rating = function(parameters) {
var
$allModules = $(this),
moduleSelector = $allModules.selector || '',
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
invokedResponse
;
$allModules
.each(function() {
var
settings = ( $.isPlainObject(parameters) )
? $.extend(true, {}, $.fn.rating.settings, parameters)
: $.extend({}, $.fn.rating.settings),
namespace = settings.namespace,
className = settings.className,
metadata = settings.metadata,
selector = settings.selector,
error = settings.error,
eventNamespace = '.' + namespace,
moduleNamespace = 'module-' + namespace,
element = this,
instance = $(this).data(moduleNamespace),
$module = $(this),
$icon = $module.find(selector.icon),
module
;
module = {
initialize: function() {
module.verbose('Initializing rating module', settings);
if(settings.interactive) {
module.enable();
}
else {
module.disable();
}
if(settings.initialRating) {
module.debug('Setting initial rating');
module.setRating(settings.initialRating);
}
if( $module.data(metadata.rating) ) {
module.debug('Rating found in metadata');
module.setRating( $module.data(metadata.rating) );
}
module.instantiate();
},
instantiate: function() {
module.verbose('Instantiating module', settings);
instance = module;
$module
.data(moduleNamespace, module)
;
},
destroy: function() {
module.verbose('Destroying previous instance', instance);
$module
.removeData(moduleNamespace)
;
$icon
.off(eventNamespace)
;
},
event: {
mouseenter: function() {
var
$activeIcon = $(this)
;
$activeIcon
.nextAll()
.removeClass(className.hover)
;
$module
.addClass(className.hover)
;
$activeIcon
.addClass(className.hover)
.prevAll()
.addClass(className.hover)
;
},
mouseleave: function() {
$module
.removeClass(className.hover)
;
$icon
.removeClass(className.hover)
;
},
click: function() {
var
$activeIcon = $(this),
currentRating = module.getRating(),
rating = $icon.index($activeIcon) + 1
;
if(settings.clearable && currentRating == rating) {
module.clearRating();
}
else {
module.setRating( rating );
}
}
},
clearRating: function() {
module.debug('Clearing current rating');
module.setRating(0);
},
getRating: function() {
var
currentRating = $icon.filter('.' + className.active).size()
;
module.verbose('Current rating retrieved', currentRating);
return currentRating;
},
enable: function() {
module.debug('Setting rating to interactive mode');
$icon
.on('mouseenter' + eventNamespace, module.event.mouseenter)
.on('mouseleave' + eventNamespace, module.event.mouseleave)
.on('click' + eventNamespace, module.event.click)
;
$module
.addClass(className.active)
;
},
disable: function() {
module.debug('Setting rating to read-only mode');
$icon
.off(eventNamespace)
;
$module
.removeClass(className.active)
;
},
setRating: function(rating) {
var
ratingIndex = (rating - 1 >= 0)
? (rating - 1)
: 0,
$activeIcon = $icon.eq(ratingIndex)
;
$module
.removeClass(className.hover)
;
$icon
.removeClass(className.hover)
.removeClass(className.active)
;
if(rating > 0) {
module.verbose('Setting current rating to', rating);
$activeIcon
.addClass(className.active)
.prevAll()
.addClass(className.active)
;
}
$.proxy(settings.onRate, element)(rating);
},
setting: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Element' : element,
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.size() > 1) {
title += ' ' + '(' + $allModules.size() + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && instance !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
instance = instance[camelCaseValue];
}
else if( instance[value] !== undefined ) {
found = instance[value];
return false;
}
else if( instance[camelCaseValue] !== undefined ) {
found = instance[camelCaseValue];
return false;
}
else {
module.error(error.method);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(invokedResponse)) {
invokedResponse.push(response);
}
else if(typeof invokedResponse == 'string') {
invokedResponse = [invokedResponse, response];
}
else if(response !== undefined) {
invokedResponse = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
module.destroy();
}
module.initialize();
}
})
;
return (invokedResponse !== undefined)
? invokedResponse
: this
;
};
$.fn.rating.settings = {
name : 'Rating',
namespace : 'rating',
verbose : true,
debug : true,
performance : true,
initialRating : 0,
interactive : true,
clearable : false,
onRate : function(rating){},
error : {
method : 'The method you called is not defined'
},
metadata: {
rating: 'rating'
},
className : {
active : 'active',
hover : 'hover',
loading : 'loading'
},
selector : {
icon : '.icon'
}
};
})( jQuery, window , document );
/*
* # Semantic - Search
* http://github.com/jlukic/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ($, window, document, undefined) {
$.fn.search = function(source, parameters) {
var
$allModules = $(this),
moduleSelector = $allModules.selector || '',
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
invokedResponse
;
$(this)
.each(function() {
var
settings = $.extend(true, {}, $.fn.search.settings, parameters),
className = settings.className,
selector = settings.selector,
error = settings.error,
namespace = settings.namespace,
eventNamespace = '.' + namespace,
moduleNamespace = namespace + '-module',
$module = $(this),
$prompt = $module.find(selector.prompt),
$searchButton = $module.find(selector.searchButton),
$results = $module.find(selector.results),
$result = $module.find(selector.result),
$category = $module.find(selector.category),
element = this,
instance = $module.data(moduleNamespace),
module
;
module = {
initialize: function() {
module.verbose('Initializing module');
var
prompt = $prompt[0],
inputEvent = (prompt.oninput !== undefined)
? 'input'
: (prompt.onpropertychange !== undefined)
? 'propertychange'
: 'keyup'
;
// attach events
$prompt
.on('focus' + eventNamespace, module.event.focus)
.on('blur' + eventNamespace, module.event.blur)
.on('keydown' + eventNamespace, module.handleKeyboard)
;
if(settings.automatic) {
$prompt
.on(inputEvent + eventNamespace, module.search.throttle)
;
}
$searchButton
.on('click' + eventNamespace, module.search.query)
;
$results
.on('click' + eventNamespace, selector.result, module.results.select)
;
module.instantiate();
},
instantiate: function() {
module.verbose('Storing instance of module', module);
instance = module;
$module
.data(moduleNamespace, module)
;
},
destroy: function() {
module.verbose('Destroying instance');
$module
.removeData(moduleNamespace)
;
},
event: {
focus: function() {
$module
.addClass(className.focus)
;
module.results.show();
},
blur: function() {
module.search.cancel();
$module
.removeClass(className.focus)
;
module.results.hide();
}
},
handleKeyboard: function(event) {
var
// force latest jq dom
$result = $module.find(selector.result),
$category = $module.find(selector.category),
keyCode = event.which,
keys = {
backspace : 8,
enter : 13,
escape : 27,
upArrow : 38,
downArrow : 40
},
activeClass = className.active,
currentIndex = $result.index( $result.filter('.' + activeClass) ),
resultSize = $result.size(),
newIndex
;
// search shortcuts
if(keyCode == keys.escape) {
module.verbose('Escape key pressed, blurring search field');
$prompt
.trigger('blur')
;
}
// result shortcuts
if($results.filter(':visible').size() > 0) {
if(keyCode == keys.enter) {
module.verbose('Enter key pressed, selecting active result');
if( $result.filter('.' + activeClass).exists() ) {
$.proxy(module.results.select, $result.filter('.' + activeClass) )();
event.preventDefault();
return false;
}
}
else if(keyCode == keys.upArrow) {
module.verbose('Up key pressed, changing active result');
newIndex = (currentIndex - 1 < 0)
? currentIndex
: currentIndex - 1
;
$category
.removeClass(activeClass)
;
$result
.removeClass(activeClass)
.eq(newIndex)
.addClass(activeClass)
.closest($category)
.addClass(activeClass)
;
event.preventDefault();
}
else if(keyCode == keys.downArrow) {
module.verbose('Down key pressed, changing active result');
newIndex = (currentIndex + 1 >= resultSize)
? currentIndex
: currentIndex + 1
;
$category
.removeClass(activeClass)
;
$result
.removeClass(activeClass)
.eq(newIndex)
.addClass(activeClass)
.closest($category)
.addClass(activeClass)
;
event.preventDefault();
}
}
else {
// query shortcuts
if(keyCode == keys.enter) {
module.verbose('Enter key pressed, executing query');
module.search.query();
$searchButton
.addClass(className.down)
;
$prompt
.one('keyup', function(){
$searchButton
.removeClass(className.down)
;
})
;
}
}
},
search: {
cancel: function() {
var
xhr = $module.data('xhr') || false
;
if( xhr && xhr.state() != 'resolved') {
module.debug('Cancelling last search');
xhr.abort();
}
},
throttle: function() {
var
searchTerm = $prompt.val(),
numCharacters = searchTerm.length
;
clearTimeout(module.timer);
if(numCharacters >= settings.minCharacters) {
module.timer = setTimeout(module.search.query, settings.searchThrottle);
}
else {
module.results.hide();
}
},
query: function() {
var
searchTerm = $prompt.val(),
cachedHTML = module.search.cache.read(searchTerm)
;
if(cachedHTML) {
module.debug("Reading result for '" + searchTerm + "' from cache");
module.results.add(cachedHTML);
}
else {
module.debug("Querying for '" + searchTerm + "'");
if(typeof source == 'object') {
module.search.local(searchTerm);
}
else {
module.search.remote(searchTerm);
}
$.proxy(settings.onSearchQuery, $module)(searchTerm);
}
},
local: function(searchTerm) {
var
results = [],
fullTextResults = [],
searchFields = $.isArray(settings.searchFields)
? settings.searchFields
: [settings.searchFields],
searchRegExp = new RegExp('(?:\s|^)' + searchTerm, 'i'),
fullTextRegExp = new RegExp(searchTerm, 'i'),
searchHTML
;
$module
.addClass(className.loading)
;
// iterate through search fields in array order
$.each(searchFields, function(index, field) {
$.each(source, function(label, thing) {
if(typeof thing[field] == 'string' && ($.inArray(thing, results) == -1) && ($.inArray(thing, fullTextResults) == -1) ) {
if( searchRegExp.test( thing[field] ) ) {
results.push(thing);
}
else if( fullTextRegExp.test( thing[field] ) ) {
fullTextResults.push(thing);
}
}
});
});
searchHTML = module.results.generate({
results: $.merge(results, fullTextResults)
});
$module
.removeClass(className.loading)
;
module.search.cache.write(searchTerm, searchHTML);
module.results.add(searchHTML);
},
remote: function(searchTerm) {
var
apiSettings = {
stateContext : $module,
url : source,
urlData: { query: searchTerm },
success : function(response) {
searchHTML = module.results.generate(response);
module.search.cache.write(searchTerm, searchHTML);
module.results.add(searchHTML);
},
failure : module.error
},
searchHTML
;
module.search.cancel();
module.debug('Executing search');
$.extend(true, apiSettings, settings.apiSettings);
$.api(apiSettings);
},
cache: {
read: function(name) {
var
cache = $module.data('cache')
;
return (settings.cache && (typeof cache == 'object') && (cache[name] !== undefined) )
? cache[name]
: false
;
},
write: function(name, value) {
var
cache = ($module.data('cache') !== undefined)
? $module.data('cache')
: {}
;
cache[name] = value;
$module
.data('cache', cache)
;
}
}
},
results: {
generate: function(response) {
module.debug('Generating html from response', response);
var
template = settings.templates[settings.type],
html = ''
;
if(($.isPlainObject(response.results) && !$.isEmptyObject(response.results)) || ($.isArray(response.results) && response.results.length > 0) ) {
if(settings.maxResults > 0) {
response.results = $.makeArray(response.results).slice(0, settings.maxResults);
}
if(response.results.length > 0) {
if($.isFunction(template)) {
html = template(response);
}
else {
module.error(error.noTemplate, false);
}
}
}
else {
html = module.message(error.noResults, 'empty');
}
$.proxy(settings.onResults, $module)(response);
return html;
},
add: function(html) {
if(settings.onResultsAdd == 'default' || $.proxy(settings.onResultsAdd, $results)(html) == 'default') {
$results
.html(html)
;
}
module.results.show();
},
show: function() {
if( ($results.filter(':visible').size() === 0) && ($prompt.filter(':focus').size() > 0) && $results.html() !== '') {
$results
.stop()
.fadeIn(200)
;
$.proxy(settings.onResultsOpen, $results)();
}
},
hide: function() {
if($results.filter(':visible').size() > 0) {
$results
.stop()
.fadeOut(200)
;
$.proxy(settings.onResultsClose, $results)();
}
},
select: function(event) {
module.debug('Search result selected');
var
$result = $(this),
$title = $result.find('.title'),
title = $title.html()
;
if(settings.onSelect == 'default' || $.proxy(settings.onSelect, this)(event) == 'default') {
var
$link = $result.find('a[href]').eq(0),
href = $link.attr('href') || false,
target = $link.attr('target') || false
;
module.results.hide();
$prompt
.val(title)
;
if(href) {
if(target == '_blank' || event.ctrlKey) {
window.open(href);
}
else {
window.location.href = (href);
}
}
}
}
},
setting: function(name, value) {
module.debug('Changing setting', name, value);
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
module.debug('Changing internal', name, value);
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Element' : element,
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.size() > 1) {
title += ' ' + '(' + $allModules.size() + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && instance !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
instance = instance[camelCaseValue];
}
else if( instance[value] !== undefined ) {
found = instance[value];
return false;
}
else if( instance[camelCaseValue] !== undefined ) {
found = instance[camelCaseValue];
return false;
}
else {
module.error(error.method);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(invokedResponse)) {
invokedResponse.push(response);
}
else if(typeof invokedResponse == 'string') {
invokedResponse = [invokedResponse, response];
}
else if(response !== undefined) {
invokedResponse = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
module.destroy();
}
module.initialize();
}
})
;
return (invokedResponse !== undefined)
? invokedResponse
: this
;
};
$.fn.search.settings = {
name : 'Search Module',
namespace : 'search',
debug : true,
verbose : true,
performance : true,
// onSelect default action is defined in module
onSelect : 'default',
onResultsAdd : 'default',
onSearchQuery : function(){},
onResults : function(response){},
onResultsOpen : function(){},
onResultsClose : function(){},
automatic : 'true',
type : 'simple',
minCharacters : 3,
searchThrottle : 300,
maxResults : 7,
cache : true,
searchFields : [
'title',
'description'
],
// api config
apiSettings: {
},
className: {
active : 'active',
down : 'down',
focus : 'focus',
empty : 'empty',
loading : 'loading'
},
error : {
noResults : 'Your search returned no results',
logging : 'Error in debug logging, exiting.',
noTemplate : 'A valid template name was not specified.',
serverError : 'There was an issue with querying the server.',
method : 'The method you called is not defined.'
},
selector : {
prompt : '.prompt',
searchButton : '.search.button',
results : '.results',
category : '.category',
result : '.result'
},
templates: {
message: function(message, type) {
var
html = ''
;
if(message !== undefined && type !== undefined) {
html += ''
+ '<div class="message ' + type +'">'
;
// message type
if(type == 'empty') {
html += ''
+ '<div class="header">No Results</div class="header">'
+ '<div class="description">' + message + '</div class="description">'
;
}
else {
html += ' <div class="description">' + message + '</div>';
}
html += '</div>';
}
return html;
},
categories: function(response) {
var
html = ''
;
if(response.results !== undefined) {
// each category
$.each(response.results, function(index, category) {
if(category.results !== undefined && category.results.length > 0) {
html += ''
+ '<div class="category">'
+ '<div class="name">' + category.name + '</div>'
;
// each item inside category
$.each(category.results, function(index, result) {
html += '<div class="result">';
html += '<a href="' + result.url + '"></a>';
if(result.image !== undefined) {
html+= ''
+ '<div class="image">'
+ ' <img src="' + result.image + '">'
+ '</div>'
;
}
html += '<div class="info">';
if(result.price !== undefined) {
html+= '<div class="price">' + result.price + '</div>';
}
if(result.title !== undefined) {
html+= '<div class="title">' + result.title + '</div>';
}
if(result.description !== undefined) {
html+= '<div class="description">' + result.description + '</div>';
}
html += ''
+ '</div>'
+ '</div>'
;
});
html += ''
+ '</div>'
;
}
});
if(response.resultPage) {
html += ''
+ '<a href="' + response.resultPage.url + '" class="all">'
+ response.resultPage.text
+ '</a>';
}
return html;
}
return false;
},
simple: function(response) {
var
html = ''
;
if(response.results !== undefined) {
// each result
$.each(response.results, function(index, result) {
html += '<a class="result" href="' + result.url + '">';
if(result.image !== undefined) {
html+= ''
+ '<div class="image">'
+ ' <img src="' + result.image + '">'
+ '</div>'
;
}
html += '<div class="info">';
if(result.price !== undefined) {
html+= '<div class="price">' + result.price + '</div>';
}
if(result.title !== undefined) {
html+= '<div class="title">' + result.title + '</div>';
}
if(result.description !== undefined) {
html+= '<div class="description">' + result.description + '</div>';
}
html += ''
+ '</div>'
+ '</a>'
;
});
if(response.resultPage) {
html += ''
+ '<a href="' + response.resultPage.url + '" class="all">'
+ response.resultPage.text
+ '</a>';
}
return html;
}
return false;
}
}
};
})( jQuery, window , document );
/*
* # Semantic - Shape
* http://github.com/jlukic/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ( $, window, document, undefined ) {
$.fn.shape = function(parameters) {
var
$allModules = $(this),
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
invokedResponse
;
$allModules
.each(function() {
var
moduleSelector = $allModules.selector || '',
settings = $.extend(true, {}, $.fn.shape.settings, parameters),
// internal aliases
namespace = settings.namespace,
selector = settings.selector,
error = settings.error,
className = settings.className,
// define namespaces for modules
eventNamespace = '.' + namespace,
moduleNamespace = 'module-' + namespace,
// selector cache
$module = $(this),
$sides = $module.find(selector.sides),
$side = $module.find(selector.side),
// private variables
$activeSide,
$nextSide,
// standard module
element = this,
instance = $module.data(moduleNamespace),
module
;
module = {
initialize: function() {
module.verbose('Initializing module for', element);
module.set.defaultSide();
module.instantiate();
},
instantiate: function() {
module.verbose('Storing instance of module', module);
instance = module;
$module
.data(moduleNamespace, instance)
;
},
destroy: function() {
module.verbose('Destroying previous module for', element);
$module
.removeData(moduleNamespace)
.off(eventNamespace)
;
},
refresh: function() {
module.verbose('Refreshing selector cache for', element);
$module = $(element);
$sides = $(this).find(selector.shape);
$side = $(this).find(selector.side);
},
repaint: function() {
module.verbose('Forcing repaint event');
var
shape = $sides.get(0) || document.createElement('div'),
fakeAssignment = shape.offsetWidth
;
},
animate: function(propertyObject, callback) {
module.verbose('Animating box with properties', propertyObject);
callback = callback || function(event) {
module.verbose('Executing animation callback');
if(event !== undefined) {
event.stopPropagation();
}
module.reset();
module.set.active();
};
if(settings.useCSS) {
if(module.get.transitionEvent()) {
module.verbose('Starting CSS animation');
$module
.addClass(className.animating)
;
module.set.stageSize();
module.repaint();
$module
.addClass(className.css)
;
$activeSide
.addClass(className.hidden)
;
$sides
.css(propertyObject)
.one(module.get.transitionEvent(), callback)
;
}
else {
callback();
}
}
else {
// not yet supported until .animate() is extended to allow RotateX/Y
module.verbose('Starting javascript animation');
$module
.addClass(className.animating)
.removeClass(className.css)
;
module.set.stageSize();
module.repaint();
$activeSide
.animate({
opacity: 0
}, settings.duration, settings.easing)
;
$sides
.animate(propertyObject, settings.duration, settings.easing, callback)
;
}
},
queue: function(method) {
module.debug('Queueing animation of', method);
$sides
.one(module.get.transitionEvent(), function() {
module.debug('Executing queued animation');
setTimeout(function(){
$module.shape(method);
}, 0);
})
;
},
reset: function() {
module.verbose('Animating states reset');
$module
.removeClass(className.css)
.removeClass(className.animating)
.attr('style', '')
.removeAttr('style')
;
// removeAttr style does not consistently work in safari
$sides
.attr('style', '')
.removeAttr('style')
;
$side
.attr('style', '')
.removeAttr('style')
.removeClass(className.hidden)
;
$nextSide
.removeClass(className.animating)
.attr('style', '')
.removeAttr('style')
;
},
is: {
animating: function() {
return $module.hasClass(className.animating);
}
},
get: {
transform: {
up: function() {
var
translate = {
y: -(($activeSide.outerHeight() - $nextSide.outerHeight()) / 2),
z: -($activeSide.outerHeight() / 2)
}
;
return {
transform: 'translateY(' + translate.y + 'px) translateZ('+ translate.z + 'px) rotateX(-90deg)'
};
},
down: function() {
var
translate = {
y: -(($activeSide.outerHeight() - $nextSide.outerHeight()) / 2),
z: -($activeSide.outerHeight() / 2)
}
;
return {
transform: 'translateY(' + translate.y + 'px) translateZ('+ translate.z + 'px) rotateX(90deg)'
};
},
left: function() {
var
translate = {
x : -(($activeSide.outerWidth() - $nextSide.outerWidth()) / 2),
z : -($activeSide.outerWidth() / 2)
}
;
return {
transform: 'translateX(' + translate.x + 'px) translateZ(' + translate.z + 'px) rotateY(90deg)'
};
},
right: function() {
var
translate = {
x : -(($activeSide.outerWidth() - $nextSide.outerWidth()) / 2),
z : -($activeSide.outerWidth() / 2)
}
;
return {
transform: 'translateX(' + translate.x + 'px) translateZ(' + translate.z + 'px) rotateY(-90deg)'
};
},
over: function() {
var
translate = {
x : -(($activeSide.outerWidth() - $nextSide.outerWidth()) / 2)
}
;
return {
transform: 'translateX(' + translate.x + 'px) rotateY(180deg)'
};
},
back: function() {
var
translate = {
x : -(($activeSide.outerWidth() - $nextSide.outerWidth()) / 2)
}
;
return {
transform: 'translateX(' + translate.x + 'px) rotateY(-180deg)'
};
}
},
transitionEvent: function() {
var
element = document.createElement('element'),
transitions = {
'transition' :'transitionend',
'OTransition' :'oTransitionEnd',
'MozTransition' :'transitionend',
'WebkitTransition' :'webkitTransitionEnd'
},
transition
;
for(transition in transitions){
if( element.style[transition] !== undefined ){
return transitions[transition];
}
}
},
nextSide: function() {
return ( $activeSide.next(selector.side).size() > 0 )
? $activeSide.next(selector.side)
: $module.find(selector.side).first()
;
}
},
set: {
defaultSide: function() {
$activeSide = $module.find('.' + settings.className.active);
$nextSide = ( $activeSide.next(selector.side).size() > 0 )
? $activeSide.next(selector.side)
: $module.find(selector.side).first()
;
module.verbose('Active side set to', $activeSide);
module.verbose('Next side set to', $nextSide);
},
stageSize: function() {
var
stage = {
width : $nextSide.outerWidth(),
height : $nextSide.outerHeight()
}
;
module.verbose('Resizing stage to fit new content', stage);
$module
.css({
width : stage.width,
height : stage.height
})
;
},
nextSide: function(selector) {
$nextSide = $module.find(selector);
if($nextSide.size() === 0) {
module.error(error.side);
}
module.verbose('Next side manually set to', $nextSide);
},
active: function() {
module.verbose('Setting new side to active', $nextSide);
$side
.removeClass(className.active)
;
$nextSide
.addClass(className.active)
;
$.proxy(settings.onChange, $nextSide)();
module.set.defaultSide();
}
},
flip: {
up: function() {
module.debug('Flipping up', $nextSide);
if( !module.is.animating() ) {
module.stage.above();
module.animate( module.get.transform.up() );
}
else {
module.queue('flip up');
}
},
down: function() {
module.debug('Flipping down', $nextSide);
if( !module.is.animating() ) {
module.stage.below();
module.animate( module.get.transform.down() );
}
else {
module.queue('flip down');
}
},
left: function() {
module.debug('Flipping left', $nextSide);
if( !module.is.animating() ) {
module.stage.left();
module.animate(module.get.transform.left() );
}
else {
module.queue('flip left');
}
},
right: function() {
module.debug('Flipping right', $nextSide);
if( !module.is.animating() ) {
module.stage.right();
module.animate(module.get.transform.right() );
}
else {
module.queue('flip right');
}
},
over: function() {
module.debug('Flipping over', $nextSide);
if( !module.is.animating() ) {
module.stage.behind();
module.animate(module.get.transform.over() );
}
else {
module.queue('flip over');
}
},
back: function() {
module.debug('Flipping back', $nextSide);
if( !module.is.animating() ) {
module.stage.behind();
module.animate(module.get.transform.back() );
}
else {
module.queue('flip back');
}
}
},
stage: {
above: function() {
var
box = {
origin : (($activeSide.outerHeight() - $nextSide.outerHeight()) / 2),
depth : {
active : ($nextSide.outerHeight() / 2),
next : ($activeSide.outerHeight() / 2)
}
}
;
module.verbose('Setting the initial animation position as above', $nextSide, box);
$activeSide
.css({
'transform' : 'rotateY(0deg) translateZ(' + box.depth.active + 'px)'
})
;
$nextSide
.addClass(className.animating)
.css({
'display' : 'block',
'top' : box.origin + 'px',
'transform' : 'rotateX(90deg) translateZ(' + box.depth.next + 'px)'
})
;
},
below: function() {
var
box = {
origin : (($activeSide.outerHeight() - $nextSide.outerHeight()) / 2),
depth : {
active : ($nextSide.outerHeight() / 2),
next : ($activeSide.outerHeight() / 2)
}
}
;
module.verbose('Setting the initial animation position as below', $nextSide, box);
$activeSide
.css({
'transform' : 'rotateY(0deg) translateZ(' + box.depth.active + 'px)'
})
;
$nextSide
.addClass(className.animating)
.css({
'display' : 'block',
'top' : box.origin + 'px',
'transform' : 'rotateX(-90deg) translateZ(' + box.depth.next + 'px)'
})
;
},
left: function() {
var
box = {
origin : ( ( $activeSide.outerWidth() - $nextSide.outerWidth() ) / 2),
depth : {
active : ($nextSide.outerWidth() / 2),
next : ($activeSide.outerWidth() / 2)
}
}
;
module.verbose('Setting the initial animation position as left', $nextSide, box);
$activeSide
.css({
'transform' : 'rotateY(0deg) translateZ(' + box.depth.active + 'px)'
})
;
$nextSide
.addClass(className.animating)
.css({
'display' : 'block',
'left' : box.origin + 'px',
'transform' : 'rotateY(-90deg) translateZ(' + box.depth.next + 'px)'
})
;
},
right: function() {
var
box = {
origin : ( ( $activeSide.outerWidth() - $nextSide.outerWidth() ) / 2),
depth : {
active : ($nextSide.outerWidth() / 2),
next : ($activeSide.outerWidth() / 2)
}
}
;
module.verbose('Setting the initial animation position as left', $nextSide, box);
$activeSide
.css({
'transform' : 'rotateY(0deg) translateZ(' + box.depth.active + 'px)'
})
;
$nextSide
.addClass(className.animating)
.css({
'display' : 'block',
'left' : box.origin + 'px',
'transform' : 'rotateY(90deg) translateZ(' + box.depth.next + 'px)'
})
;
},
behind: function() {
var
box = {
origin : ( ( $activeSide.outerWidth() - $nextSide.outerWidth() ) / 2),
depth : {
active : ($nextSide.outerWidth() / 2),
next : ($activeSide.outerWidth() / 2)
}
}
;
module.verbose('Setting the initial animation position as behind', $nextSide, box);
$activeSide
.css({
'transform' : 'rotateY(0deg)'
})
;
$nextSide
.addClass(className.animating)
.css({
'display' : 'block',
'left' : box.origin + 'px',
'transform' : 'rotateY(-180deg)'
})
;
}
},
setting: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Element' : element,
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.size() > 1) {
title += ' ' + '(' + $allModules.size() + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && instance !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
instance = instance[camelCaseValue];
}
else if( instance[value] !== undefined ) {
found = instance[value];
return false;
}
else if( instance[camelCaseValue] !== undefined ) {
found = instance[camelCaseValue];
return false;
}
else {
module.error(error.method);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(invokedResponse)) {
invokedResponse.push(response);
}
else if(typeof invokedResponse == 'string') {
invokedResponse = [invokedResponse, response];
}
else if(response !== undefined) {
invokedResponse = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
module.destroy();
}
module.initialize();
}
})
;
return (invokedResponse !== undefined)
? invokedResponse
: this
;
};
$.fn.shape.settings = {
// module info
name : 'Shape',
// debug content outputted to console
debug : true,
// verbose debug output
verbose : true,
// performance data output
performance: true,
// event namespace
namespace : 'shape',
// callback occurs on side change
beforeChange : function() {},
onChange : function() {},
// use css animation (currently only true is supported)
useCSS : true,
// animation duration (useful only with future js animations)
duration : 1000,
easing : 'easeInOutQuad',
// possible errors
error: {
side : 'You tried to switch to a side that does not exist.',
method : 'The method you called is not defined'
},
// classnames used
className : {
css : 'css',
animating : 'animating',
hidden : 'hidden',
active : 'active'
},
// selectors used
selector : {
sides : '.sides',
side : '.side'
}
};
})( jQuery, window , document );
/*
* # Semantic - Dropdown
* http://github.com/jlukic/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ( $, window, document, undefined ) {
$.fn.sidebar = function(parameters) {
var
$allModules = $(this),
moduleSelector = $allModules.selector || '',
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
invokedResponse
;
$allModules
.each(function() {
var
settings = ( $.isPlainObject(parameters) )
? $.extend(true, {}, $.fn.sidebar.settings, parameters)
: $.extend({}, $.fn.sidebar.settings),
selector = settings.selector,
className = settings.className,
namespace = settings.namespace,
error = settings.error,
eventNamespace = '.' + namespace,
moduleNamespace = 'module-' + namespace,
$module = $(this),
$body = $('body'),
$head = $('head'),
$style = $('style[title=' + namespace + ']'),
element = this,
instance = $module.data(moduleNamespace),
module
;
module = {
initialize: function() {
module.debug('Initializing sidebar', $module);
module.instantiate();
},
instantiate: function() {
module.verbose('Storing instance of module', module);
instance = module;
$module
.data(moduleNamespace, module)
;
},
destroy: function() {
module.verbose('Destroying previous module for', $module);
$module
.off(eventNamespace)
.removeData(moduleNamespace)
;
},
refresh: function() {
module.verbose('Refreshing selector cache');
$style = $('style[title=' + namespace + ']');
},
attachEvents: function(selector, event) {
var
$toggle = $(selector)
;
event = $.isFunction(module[event])
? module[event]
: module.toggle
;
if($toggle.size() > 0) {
module.debug('Attaching sidebar events to element', selector, event);
$toggle
.off(eventNamespace)
.on('click' + eventNamespace, event)
;
}
else {
module.error(error.notFound);
}
},
show: function() {
module.debug('Showing sidebar');
if(module.is.closed()) {
if(!settings.overlay) {
module.pushPage();
}
module.set.active();
}
else {
module.debug('Sidebar is already visible');
}
},
hide: function() {
if(module.is.open()) {
if(!settings.overlay) {
module.pullPage();
module.remove.pushed();
}
module.remove.active();
}
},
toggle: function() {
if(module.is.closed()) {
module.show();
}
else {
module.hide();
}
},
pushPage: function() {
var
direction = module.get.direction(),
distance = (module.is.vertical())
? $module.outerHeight()
: $module.outerWidth()
;
if(settings.useCSS) {
module.debug('Using CSS to animate body');
module.add.bodyCSS(direction, distance);
module.set.pushed();
}
else {
module.animatePage(direction, distance, module.set.pushed);
}
},
pullPage: function() {
var
direction = module.get.direction()
;
if(settings.useCSS) {
module.debug('Resetting body position css');
module.remove.bodyCSS();
}
else {
module.debug('Resetting body position using javascript');
module.animatePage(direction, 0);
}
module.remove.pushed();
},
animatePage: function(direction, distance) {
var
animateSettings = {}
;
animateSettings['padding-' + direction] = distance;
module.debug('Using javascript to animate body', animateSettings);
$body
.animate(animateSettings, settings.duration, module.set.pushed)
;
},
add: {
bodyCSS: function(direction, distance) {
var
style
;
if(direction !== className.bottom) {
style = ''
+ '<style title="' + namespace + '">'
+ 'body.pushed {'
+ ' margin-' + direction + ': ' + distance + 'px !important;'
+ '}'
+ '</style>'
;
}
$head.append(style);
module.debug('Adding body css to head', $style);
}
},
remove: {
bodyCSS: function() {
module.debug('Removing body css styles', $style);
module.refresh();
$style.remove();
},
active: function() {
$module.removeClass(className.active);
},
pushed: function() {
module.verbose('Removing body push state', module.get.direction());
$body
.removeClass(className[ module.get.direction() ])
.removeClass(className.pushed)
;
}
},
set: {
active: function() {
$module.addClass(className.active);
},
pushed: function() {
module.verbose('Adding body push state', module.get.direction());
$body
.addClass(className[ module.get.direction() ])
.addClass(className.pushed)
;
}
},
get: {
direction: function() {
if($module.hasClass(className.top)) {
return className.top;
}
else if($module.hasClass(className.right)) {
return className.right;
}
else if($module.hasClass(className.bottom)) {
return className.bottom;
}
else {
return className.left;
}
},
transitionEvent: function() {
var
element = document.createElement('element'),
transitions = {
'transition' :'transitionend',
'OTransition' :'oTransitionEnd',
'MozTransition' :'transitionend',
'WebkitTransition' :'webkitTransitionEnd'
},
transition
;
for(transition in transitions){
if( element.style[transition] !== undefined ){
return transitions[transition];
}
}
}
},
is: {
open: function() {
return $module.is(':animated') || $module.hasClass(className.active);
},
closed: function() {
return !module.is.open();
},
vertical: function() {
return $module.hasClass(className.top);
}
},
setting: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Element' : element,
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.size() > 1) {
title += ' ' + '(' + $allModules.size() + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && instance !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
instance = instance[camelCaseValue];
}
else if( instance[value] !== undefined ) {
found = instance[value];
return false;
}
else if( instance[camelCaseValue] !== undefined ) {
found = instance[camelCaseValue];
return false;
}
else {
module.error(error.method);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(invokedResponse)) {
invokedResponse.push(response);
}
else if(typeof invokedResponse == 'string') {
invokedResponse = [invokedResponse, response];
}
else if(response !== undefined) {
invokedResponse = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
module.destroy();
}
module.initialize();
}
})
;
return (invokedResponse !== undefined)
? invokedResponse
: this
;
};
$.fn.sidebar.settings = {
name : 'Sidebar',
namespace : 'sidebar',
verbose : true,
debug : true,
performance : true,
useCSS : true,
overlay : false,
duration : 300,
side : 'left',
onChange : function(){},
onShow : function(){},
onHide : function(){},
className: {
active : 'active',
pushed : 'pushed',
top : 'top',
left : 'left',
right : 'right',
bottom : 'bottom'
},
error : {
method : 'The method you called is not defined.',
notFound : 'There were no elements that matched the specified selector'
}
};
})( jQuery, window , document );
/*
* # Semantic - Tab
* http://github.com/jlukic/semantic-ui/
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ($, window, document, undefined) {
$.fn.tab = function(parameters) {
var
settings = $.extend(true, {}, $.fn.tab.settings, parameters),
$module = $(this),
$tabs = $(settings.context).find(settings.selector.tabs),
moduleSelector = $module.selector || '',
cache = {},
firstLoad = true,
recursionDepth = 0,
activeTabPath,
parameterArray,
historyEvent,
element = this,
time = new Date().getTime(),
performance = [],
className = settings.className,
metadata = settings.metadata,
error = settings.error,
eventNamespace = '.' + settings.namespace,
moduleNamespace = 'module-' + settings.namespace,
instance = $module.data(moduleNamespace),
query = arguments[0],
methodInvoked = (instance !== undefined && typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
module,
invokedResponse
;
module = {
initialize: function() {
module.debug('Initializing Tabs', $module);
// set up automatic routing
if(settings.auto) {
module.verbose('Setting up automatic tab retrieval from server');
settings.apiSettings = {
url: settings.path + '/{$tab}'
};
}
// attach history events
if(settings.history) {
if( $.address === undefined ) {
module.error(error.state);
return false;
}
else if(settings.path === false) {
module.error(error.path);
return false;
}
else {
module.verbose('Address library found adding state change event');
$.address
.state(settings.path)
.unbind('change')
.bind('change', module.event.history.change)
;
}
}
// attach events if navigation wasn't set to window
if( !$.isWindow( element ) ) {
module.debug('Attaching tab activation events to element', $module);
$module
.on('click' + eventNamespace, module.event.click)
;
}
module.instantiate();
},
instantiate: function () {
module.verbose('Storing instance of module', module);
$module
.data(moduleNamespace, module)
;
},
destroy: function() {
module.debug('Destroying tabs', $module);
$module
.removeData(moduleNamespace)
.off(eventNamespace)
;
},
event: {
click: function(event) {
module.debug('Navigation clicked');
var
tabPath = $(this).data(metadata.tab)
;
if(tabPath !== undefined) {
if(settings.history) {
$.address.value(tabPath);
}
else {
module.changeTab(tabPath);
}
event.preventDefault();
}
else {
module.debug('No tab specified');
}
},
history: {
change: function(event) {
var
tabPath = event.pathNames.join('/') || module.get.initialPath(),
pageTitle = settings.templates.determineTitle(tabPath) || false
;
module.debug('History change event', tabPath, event);
historyEvent = event;
if(tabPath !== undefined) {
module.changeTab(tabPath);
}
if(pageTitle) {
$.address.title(pageTitle);
}
}
}
},
refresh: function() {
if(activeTabPath) {
module.debug('Refreshing tab', activeTabPath);
module.changeTab(activeTabPath);
}
},
cache: {
read: function(cacheKey) {
return (cacheKey !== undefined)
? cache[cacheKey]
: false
;
},
add: function(cacheKey, content) {
cacheKey = cacheKey || activeTabPath;
module.debug('Adding cached content for', cacheKey);
cache[cacheKey] = content;
},
remove: function(cacheKey) {
cacheKey = cacheKey || activeTabPath;
module.debug('Removing cached content for', cacheKey);
delete cache[cacheKey];
}
},
changeTab: function(tabPath) {
var
pushStateAvailable = (window.history && window.history.pushState),
shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
remoteContent = (settings.auto || $.isPlainObject(settings.apiSettings) ),
// only get default path if not remote content
pathArray = (remoteContent && !shouldIgnoreLoad)
? module.utilities.pathToArray(tabPath)
: module.get.defaultPathArray(tabPath)
;
tabPath = module.utilities.arrayToPath(pathArray);
module.deactivate.all();
$.each(pathArray, function(index, tab) {
var
currentPathArray = pathArray.slice(0, index + 1),
currentPath = module.utilities.arrayToPath(currentPathArray),
isTab = module.is.tab(currentPath),
isLastIndex = (index + 1 == pathArray.length),
$tab = module.get.tabElement(currentPath),
nextPathArray,
nextPath,
isLastTab
;
module.verbose('Looking for tab', tab);
if(isTab) {
module.verbose('Tab was found', tab);
// scope up
activeTabPath = currentPath;
parameterArray = module.utilities.filterArray(pathArray, currentPathArray);
if(isLastIndex) {
isLastTab = true;
}
else {
nextPathArray = pathArray.slice(0, index + 2);
nextPath = module.utilities.arrayToPath(nextPathArray);
isLastTab = ( !module.is.tab(nextPath) );
if(isLastTab) {
module.verbose('Tab parameters found', nextPathArray);
}
}
if(isLastTab && remoteContent) {
if(!shouldIgnoreLoad) {
module.activate.navigation(currentPath);
module.content.fetch(currentPath, tabPath);
}
else {
module.debug('Ignoring remote content on first tab load', currentPath);
firstLoad = false;
module.cache.add(tabPath, $tab.html());
module.activate.all(currentPath);
$.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
}
return false;
}
else {
module.debug('Opened local tab', currentPath);
module.activate.all(currentPath);
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
}
}
else {
module.error(error.missingTab, tab);
return false;
}
});
},
content: {
fetch: function(tabPath, fullTabPath) {
var
$tab = module.get.tabElement(tabPath),
apiSettings = {
dataType : 'html',
stateContext : $tab,
success : function(response) {
module.cache.add(fullTabPath, response);
module.content.update(tabPath, response);
if(tabPath == activeTabPath) {
module.debug('Content loaded', tabPath);
module.activate.tab(tabPath);
}
else {
module.debug('Content loaded in background', tabPath);
}
$.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(tabPath, parameterArray, historyEvent);
},
urlData: { tab: fullTabPath }
},
request = $tab.data(metadata.promise) || false,
existingRequest = ( request && request.state() === 'pending' ),
requestSettings,
cachedContent
;
fullTabPath = fullTabPath || tabPath;
cachedContent = module.cache.read(fullTabPath);
if(settings.cache && cachedContent) {
module.debug('Showing existing content', fullTabPath);
module.content.update(tabPath, cachedContent);
module.activate.tab(tabPath);
$.proxy(settings.onTabLoad, $tab)(tabPath, parameterArray, historyEvent);
}
else if(existingRequest) {
module.debug('Content is already loading', fullTabPath);
$tab
.addClass(className.loading)
;
}
else if($.api !== undefined) {
console.log(settings.apiSettings);
requestSettings = $.extend(true, { headers: { 'X-Remote': true } }, settings.apiSettings, apiSettings);
module.debug('Retrieving remote content', fullTabPath, requestSettings);
$.api( requestSettings );
}
else {
module.error(error.api);
}
},
update: function(tabPath, html) {
module.debug('Updating html for', tabPath);
var
$tab = module.get.tabElement(tabPath)
;
$tab
.html(html)
;
}
},
activate: {
all: function(tabPath) {
module.activate.tab(tabPath);
module.activate.navigation(tabPath);
},
tab: function(tabPath) {
var
$tab = module.get.tabElement(tabPath)
;
module.verbose('Showing tab content for', $tab);
$tab.addClass(className.active);
},
navigation: function(tabPath) {
var
$navigation = module.get.navElement(tabPath)
;
module.verbose('Activating tab navigation for', $navigation, tabPath);
$navigation.addClass(className.active);
}
},
deactivate: {
all: function() {
module.deactivate.navigation();
module.deactivate.tabs();
},
navigation: function() {
$module
.removeClass(className.active)
;
},
tabs: function() {
$tabs
.removeClass(className.active + ' ' + className.loading)
;
}
},
is: {
tab: function(tabName) {
return (tabName !== undefined)
? ( module.get.tabElement(tabName).size() > 0 )
: false
;
}
},
get: {
initialPath: function() {
return $module.eq(0).data(metadata.tab) || $tabs.eq(0).data(metadata.tab);
},
path: function() {
return $.address.value();
},
// adds default tabs to tab path
defaultPathArray: function(tabPath) {
return module.utilities.pathToArray( module.get.defaultPath(tabPath) );
},
defaultPath: function(tabPath) {
var
$defaultNav = $module.filter('[data-' + metadata.tab + '^="' + tabPath + '/"]').eq(0),
defaultTab = $defaultNav.data(metadata.tab) || false
;
if( defaultTab ) {
module.debug('Found default tab', defaultTab);
if(recursionDepth < settings.maxDepth) {
recursionDepth++;
return module.get.defaultPath(defaultTab);
}
module.error(error.recursion);
}
else {
module.debug('No default tabs found for', tabPath, $tabs);
}
recursionDepth = 0;
return tabPath;
},
navElement: function(tabPath) {
tabPath = tabPath || activeTabPath;
return $module.filter('[data-' + metadata.tab + '="' + tabPath + '"]');
},
tabElement: function(tabPath) {
var
$fullPathTab,
$simplePathTab,
tabPathArray,
lastTab
;
tabPath = tabPath || activeTabPath;
tabPathArray = module.utilities.pathToArray(tabPath);
lastTab = module.utilities.last(tabPathArray);
$fullPathTab = $tabs.filter('[data-' + metadata.tab + '="' + lastTab + '"]');
$simplePathTab = $tabs.filter('[data-' + metadata.tab + '="' + tabPath + '"]');
return ($fullPathTab.size() > 0)
? $fullPathTab
: $simplePathTab
;
},
tab: function() {
return activeTabPath;
}
},
utilities: {
filterArray: function(keepArray, removeArray) {
return $.grep(keepArray, function(keepValue) {
return ( $.inArray(keepValue, removeArray) == -1);
});
},
last: function(array) {
return $.isArray(array)
? array[ array.length - 1]
: false
;
},
pathToArray: function(pathName) {
if(pathName === undefined) {
pathName = activeTabPath;
}
return typeof pathName == 'string'
? pathName.split('/')
: [pathName]
;
},
arrayToPath: function(pathArray) {
return $.isArray(pathArray)
? pathArray.join('/')
: false
;
}
},
setting: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Element' : element,
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && instance !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
instance = instance[camelCaseValue];
}
else if( instance[value] !== undefined ) {
found = instance[value];
return false;
}
else if( instance[camelCaseValue] !== undefined ) {
found = instance[camelCaseValue];
return false;
}
else {
module.error(error.method);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(invokedResponse)) {
invokedResponse.push(response);
}
else if(typeof invokedResponse == 'string') {
invokedResponse = [invokedResponse, response];
}
else if(response !== undefined) {
invokedResponse = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
module.destroy();
}
module.initialize();
}
return (invokedResponse !== undefined)
? invokedResponse
: this
;
};
// shortcut for tabbed content with no defined navigation
$.tab = function(settings) {
$(window).tab(settings);
};
$.fn.tab.settings = {
name : 'Tab',
verbose : true,
debug : true,
performance : true,
namespace : 'tab',
// only called first time a tab's content is loaded (when remote source)
onTabInit : function(tabPath, parameterArray, historyEvent) {},
// called on every load
onTabLoad : function(tabPath, parameterArray, historyEvent) {},
templates : {
determineTitle: function(tabArray) {}
},
// uses pjax style endpoints fetching content from same url with remote-content headers
auto : false,
history : false,
path : false,
context : 'body',
// max depth a tab can be nested
maxDepth : 25,
// dont load content on first load
ignoreFirstLoad : false,
// load tab content new every tab click
alwaysRefresh : false,
// cache the content requests to pull locally
cache : true,
// settings for api call
apiSettings : false,
error: {
api : 'You attempted to load content without API module',
method : 'The method you called is not defined',
missingTab : 'Tab cannot be found',
noContent : 'The tab you specified is missing a content url.',
path : 'History enabled, but no path was specified',
recursion : 'Max recursive depth reached',
state : 'The state library has not been initialized'
},
metadata : {
tab : 'tab',
loaded : 'loaded',
promise: 'promise'
},
className : {
loading : 'loading',
active : 'active'
},
selector : {
tabs : '.ui.tab'
}
};
})( jQuery, window , document );
/*
* # Semantic - Transition
* http://github.com/jlukic/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ( $, window, document, undefined ) {
$.fn.transition = function() {
var
$allModules = $(this),
moduleSelector = $allModules.selector || '',
time = new Date().getTime(),
performance = [],
moduleArguments = arguments,
query = moduleArguments[0],
queryArguments = [].slice.call(arguments, 1),
methodInvoked = (typeof query === 'string'),
requestAnimationFrame = window.requestAnimationFrame
|| window.mozRequestAnimationFrame
|| window.webkitRequestAnimationFrame
|| window.msRequestAnimationFrame
|| function(callback) { setTimeout(callback, 0); },
invokedResponse
;
$allModules
.each(function() {
var
$module = $(this),
element = this,
// set at run time
settings,
instance,
error,
className,
metadata,
animationEnd,
animationName,
namespace,
moduleNamespace,
module
;
module = {
initialize: function() {
// get settings
settings = module.get.settings.apply(element, moduleArguments);
module.verbose('Converted arguments into settings object', settings);
// set shortcuts
error = settings.error;
className = settings.className;
namespace = settings.namespace;
metadata = settings.metadata;
moduleNamespace = 'module-' + namespace;
animationEnd = module.get.animationEvent();
animationName = module.get.animationName();
instance = $module.data(moduleNamespace);
if(instance === undefined) {
module.instantiate();
}
if(methodInvoked) {
methodInvoked = module.invoke(query);
}
// no internal method was found matching query or query not made
if(methodInvoked === false) {
module.animate();
}
},
instantiate: function() {
module.verbose('Storing instance of module', module);
instance = module;
$module
.data(moduleNamespace, instance)
;
},
destroy: function() {
module.verbose('Destroying previous module for', element);
$module
.removeData(moduleNamespace)
;
},
animate: function(overrideSettings) {
settings = overrideSettings || settings;
module.debug('Preparing animation', settings.animation);
if(module.is.animating()) {
if(settings.queue) {
module.queue(settings.animation);
}
return false;
}
module.save.conditions();
module.set.duration(settings.duration);
module.set.animating();
module.repaint();
$module
.addClass(className.transition)
.addClass(settings.animation)
.one(animationEnd, module.complete)
;
if(!module.has.direction() && module.can.transition()) {
module.set.direction();
}
if(!module.can.animate()) {
module.restore.conditions();
module.error(error.noAnimation);
return false;
}
module.show();
module.debug('Starting tween', settings.animation, $module.attr('class'));
},
queue: function(animation) {
module.debug('Queueing animation of', animation);
instance.queuing = true;
$module
.one(animationEnd, function() {
instance.queuing = false;
module.animate.apply(this, settings);
})
;
},
complete: function () {
module.verbose('CSS animation complete', settings.animation);
if(!module.is.looping()) {
if($module.hasClass(className.outward)) {
module.restore.conditions();
module.hide();
}
else if($module.hasClass(className.inward)) {
module.restore.conditions();
module.show();
}
else {
module.restore.conditions();
}
module.remove.animating();
}
$.proxy(settings.complete, this)();
},
repaint: function(fakeAssignment) {
module.verbose('Forcing repaint event');
fakeAssignment = element.offsetWidth;
},
has: {
direction: function(animation) {
animation = animation || settings.animation;
if( $module.hasClass(className.inward) || $module.hasClass(className.outward) ) {
return true;
}
}
},
set: {
animating: function() {
$module.addClass(className.animating);
},
direction: function() {
if($module.is(':visible')) {
module.debug('Automatically determining the direction of animation', 'Outward');
$module
.addClass(className.outward)
.removeClass(className.inward)
;
}
else {
module.debug('Automatically determining the direction of animation', 'Inward');
$module
.addClass(className.inward)
.removeClass(className.outward)
;
}
},
looping: function() {
module.debug('Transition set to loop');
$module
.addClass(className.looping)
;
},
duration: function(duration) {
duration = duration || settings.duration;
duration = (typeof duration == 'number')
? duration + 'ms'
: duration
;
module.verbose('Setting animation duration', duration);
$module
.css({
'-webkit-animation-duration': duration,
'-moz-animation-duration': duration,
'-ms-animation-duration': duration,
'-o-animation-duration': duration,
'animation-duration': duration
})
;
}
},
save: {
conditions: function() {
module.cache = {
className : $module.attr('class'),
style : $module.attr('style')
};
module.verbose('Saving original attributes', module.cache);
}
},
restore: {
conditions: function() {
if(typeof module.cache === undefined) {
module.error(error.cache);
return false;
}
if(module.cache.className) {
$module.attr('class', module.cache.className);
}
else {
$module.removeAttr('class');
}
if(module.cache.style) {
$module.attr('style', module.cache.style);
}
else {
$module.removeAttr('style');
}
if(module.is.looping()) {
module.remove.looping();
}
module.verbose('Restoring original attributes', module.cache);
}
},
remove: {
animating: function() {
$module.removeClass(className.animating);
},
looping: function() {
module.debug('Transitions are no longer looping');
$module
.removeClass(className.looping)
;
module.repaint();
}
},
get: {
settings: function(animation, duration, complete) {
// single settings object
if($.isPlainObject(animation)) {
return $.extend(true, {}, $.fn.transition.settings, animation);
}
// all arguments provided
else if(typeof complete == 'function') {
return $.extend(true, {}, $.fn.transition.settings, {
animation : animation,
complete : complete,
duration : duration
});
}
// only duration provided
else if(typeof duration == 'string' || typeof duration == 'number') {
return $.extend(true, {}, $.fn.transition.settings, {
animation : animation,
duration : duration
});
}
// duration is actually settings object
else if(typeof duration == 'object') {
return $.extend(true, {}, $.fn.transition.settings, duration, {
animation : animation
});
}
// duration is actually callback
else if(typeof duration == 'function') {
return $.extend(true, {}, $.fn.transition.settings, {
animation : animation,
complete : duration
});
}
// only animation provided
else {
return $.extend(true, {}, $.fn.transition.settings, {
animation : animation
});
}
return $.extend({}, $.fn.transition.settings);
},
animationName: function() {
var
element = document.createElement('div'),
animations = {
'animation' :'animationName',
'OAnimation' :'oAnimationName',
'MozAnimation' :'mozAnimationName',
'WebkitAnimation' :'webkitAnimationName'
},
animation
;
for(animation in animations){
if( element.style[animation] !== undefined ){
module.verbose('Determining animation vendor name property', animations[animation]);
return animations[animation];
}
}
return false;
},
animationEvent: function() {
var
element = document.createElement('div'),
animations = {
'animation' :'animationend',
'OAnimation' :'oAnimationEnd',
'MozAnimation' :'mozAnimationEnd',
'WebkitAnimation' :'webkitAnimationEnd'
},
animation
;
for(animation in animations){
if( element.style[animation] !== undefined ){
module.verbose('Determining animation vendor end event', animations[animation]);
return animations[animation];
}
}
return false;
}
},
can: {
animate: function() {
if($module.css(animationName) !== 'none') {
module.debug('CSS definition found');
return true;
}
else {
module.debug('Unable to find css definition');
return false;
}
},
transition: function() {
var
$clone = $('<div>').addClass( $module.attr('class') ).appendTo($('body')),
currentAnimation = $clone.css(animationName),
inAnimation = $clone.addClass(className.inward).css(animationName)
;
if(currentAnimation != inAnimation) {
module.debug('In/out transitions exist');
$clone.remove();
return true;
}
else {
module.debug('Static animation found');
$clone.remove();
return false;
}
}
},
is: {
animating: function() {
return $module.hasClass(className.animating);
},
looping: function() {
return $module.hasClass(className.looping);
},
visible: function() {
return $module.is(':visible');
}
},
hide: function() {
module.verbose('Hiding element');
$module
.removeClass(className.visible)
.addClass(className.transition)
.addClass(className.hidden)
;
module.repaint();
},
show: function() {
module.verbose('Showing element');
$module
.removeClass(className.hidden)
.addClass(className.transition)
.addClass(className.visible)
;
module.repaint();
},
start: function() {
module.verbose('Starting animation');
$module.removeClass(className.disabled);
},
stop: function() {
module.debug('Stopping animation');
$module.addClass(className.disabled);
},
toggle: function() {
module.debug('Toggling play status');
$module.toggleClass(className.disabled);
},
setting: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Element' : element,
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.size() > 1) {
title += ' ' + '(' + $allModules.size() + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && instance !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
instance = instance[camelCaseValue];
}
else if( instance[value] !== undefined ) {
found = instance[value];
return false;
}
else if( instance[camelCaseValue] !== undefined ) {
found = instance[camelCaseValue];
return false;
}
else {
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(invokedResponse)) {
invokedResponse.push(response);
}
else if(typeof invokedResponse == 'string') {
invokedResponse = [invokedResponse, response];
}
else if(response !== undefined) {
invokedResponse = response;
}
return found || false;
}
};
module.initialize();
})
;
return (invokedResponse !== undefined)
? invokedResponse
: this
;
};
$.fn.transition.settings = {
// module info
name : 'Transition',
// debug content outputted to console
debug : false,
// verbose debug output
verbose : true,
// performance data output
performance : true,
// event namespace
namespace : 'transition',
// animation complete event
complete : function() {},
// animation duration
animation : 'fade',
duration : '700ms',
// queue up animations
queue : true,
className : {
animating : 'animating',
disabled : 'disabled',
hidden : 'hidden',
inward : 'in',
loading : 'loading',
looping : 'looping',
outward : 'out',
transition : 'ui transition',
visible : 'visible'
},
// possible errors
error: {
noAnimation : 'There is no css animation matching the one you specified.',
method : 'The method you called is not defined'
}
};
})( jQuery, window , document );
/* ******************************
Module - Video
Author: Jack Lukic
This is a video playlist and video embed plugin which helps
provide helpers for adding embed code for vimeo and youtube and
abstracting event handlers for each library
****************************** */
;(function ($, window, document, undefined) {
$.fn.video = function(parameters) {
var
$allModules = $(this),
moduleSelector = $allModules.selector || '',
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
invokedResponse
;
$allModules
.each(function() {
var
settings = ( $.isPlainObject(parameters) )
? $.extend(true, {}, $.fn.video.settings, parameters)
: $.extend({}, $.fn.video.settings),
selector = settings.selector,
className = settings.className,
error = settings.error,
metadata = settings.metadata,
namespace = settings.namespace,
eventNamespace = '.' + namespace,
moduleNamespace = 'module-' + namespace,
$module = $(this),
$placeholder = $module.find(selector.placeholder),
$playButton = $module.find(selector.playButton),
$embed = $module.find(selector.embed),
element = this,
instance = $module.data(moduleNamespace),
module
;
module = {
initialize: function() {
module.debug('Initializing video');
$placeholder
.on('click' + eventNamespace, module.play)
;
$playButton
.on('click' + eventNamespace, module.play)
;
module.instantiate();
},
instantiate: function() {
module.verbose('Storing instance of module', module);
instance = module;
$module
.data(moduleNamespace, module)
;
},
destroy: function() {
module.verbose('Destroying previous instance of video');
$module
.removeData(moduleNamespace)
.off(eventNamespace)
;
$placeholder
.off(eventNamespace)
;
$playButton
.off(eventNamespace)
;
},
// sets new video
change: function(source, id, url) {
module.debug('Changing video to ', source, id, url);
$module
.data(metadata.source, source)
.data(metadata.id, id)
.data(metadata.url, url)
;
settings.onChange();
},
// clears video embed
reset: function() {
module.debug('Clearing video embed and showing placeholder');
$module
.removeClass(className.active)
;
$embed
.html(' ')
;
$placeholder
.show()
;
settings.onReset();
},
// plays current video
play: function() {
module.debug('Playing video');
var
source = $module.data(metadata.source) || false,
url = $module.data(metadata.url) || false,
id = $module.data(metadata.id) || false
;
$embed
.html( module.generate.html(source, id, url) )
;
$module
.addClass(className.active)
;
settings.onPlay();
},
generate: {
// generates iframe html
html: function(source, id, url) {
module.debug('Generating embed html');
var
width = (settings.width == 'auto')
? $module.width()
: settings.width,
height = (settings.height == 'auto')
? $module.height()
: settings.height,
html
;
if(source && id) {
if(source == 'vimeo') {
html = ''
+ '<iframe src="http://player.vimeo.com/video/' + id + '?=' + module.generate.url(source) + '"'
+ ' width="' + width + '" height="' + height + '"'
+ ' frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'
;
}
else if(source == 'youtube') {
html = ''
+ '<iframe src="http://www.youtube.com/embed/' + id + '?=' + module.generate.url(source) + '"'
+ ' width="' + width + '" height="' + height + '"'
+ ' frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'
;
}
}
else if(url) {
html = ''
+ '<iframe src="' + url + '"'
+ ' width="' + width + '" height="' + height + '"'
+ ' frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'
;
}
else {
module.error(error.noVideo);
}
return html;
},
// generate url parameters
url: function(source) {
var
api = (settings.api)
? 1
: 0,
autoplay = (settings.autoplay)
? 1
: 0,
hd = (settings.hd)
? 1
: 0,
showUI = (settings.showUI)
? 1
: 0,
// opposite used for some params
hideUI = !(settings.showUI)
? 1
: 0,
url = ''
;
if(source == 'vimeo') {
url = ''
+ 'api=' + api
+ '&title=' + showUI
+ '&byline=' + showUI
+ '&portrait=' + showUI
+ '&autoplay=' + autoplay
;
if(settings.color) {
url += '&color=' + settings.color;
}
}
if(source == 'ustream') {
url = ''
+ 'autoplay=' + autoplay
;
if(settings.color) {
url += '&color=' + settings.color;
}
}
else if(source == 'youtube') {
url = ''
+ 'enablejsapi=' + api
+ '&autoplay=' + autoplay
+ '&autohide=' + hideUI
+ '&hq=' + hd
+ '&modestbranding=1'
;
if(settings.color) {
url += '&color=' + settings.color;
}
}
return url;
}
},
setting: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Element' : element,
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.size() > 1) {
title += ' ' + '(' + $allModules.size() + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && instance !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
instance = instance[camelCaseValue];
}
else if( instance[value] !== undefined ) {
found = instance[value];
return false;
}
else if( instance[camelCaseValue] !== undefined ) {
found = instance[camelCaseValue];
return false;
}
else {
module.error(error.method);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(invokedResponse)) {
invokedResponse.push(response);
}
else if(typeof invokedResponse == 'string') {
invokedResponse = [invokedResponse, response];
}
else if(response !== undefined) {
invokedResponse = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
module.destroy();
}
module.initialize();
}
})
;
return (invokedResponse !== undefined)
? invokedResponse
: this
;
};
$.fn.video.settings = {
name : 'Video',
namespace : 'video',
debug : true,
verbose : true,
performance : true,
metadata : {
source : 'source',
id : 'id',
url : 'url'
},
onPlay : function(){},
onReset : function(){},
onChange : function(){},
// callbacks not coded yet (needs to use jsapi)
onPause : function() {},
onStop : function() {},
width : 'auto',
height : 'auto',
autoplay : false,
color : '#442359',
hd : true,
showUI : false,
api : true,
error : {
noVideo : 'No video specified',
method : 'The method you called is not defined'
},
className : {
active : 'active'
},
selector : {
embed : '.embed',
placeholder : '.placeholder',
playButton : '.play'
}
};
})( jQuery, window , document );
| pzp1997/cdnjs | ajax/libs/semantic-ui/0.6.1/javascript/semantic.js | JavaScript | mit | 341,341 |
/** # Semantic UI
* Version: 0.6.2
* http://github.com/jlukic/semantic-ui
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
* Release Date: 10/15/2013
*/
!function(a,b,c,d){a.fn.accordion=function(b){var c,e=a(this),f=(new Date).getTime(),g=[],h=arguments[0],i="string"==typeof h,j=[].slice.call(arguments,1);return e.each(function(){var k,l=a.isPlainObject(b)?a.extend(!0,{},a.fn.accordion.settings,b):a.extend({},a.fn.accordion.settings),m=l.className,n=l.namespace,o=l.selector,p=l.error,q="."+n,r="module-"+n,s=e.selector||"",t=a(this),u=t.find(o.title),v=t.find(o.content),w=this,x=t.data(r);k={initialize:function(){k.debug("Initializing accordion with bound events",t),u.on("click"+q,k.event.click),k.instantiate()},instantiate:function(){x=k,t.data(r,k)},destroy:function(){k.debug("Destroying previous accordion for",t),t.removeData(r),u.off(q)},event:{click:function(){k.verbose("Title clicked",this);var b=a(this),c=u.index(b);k.toggle(c)},resetStyle:function(){k.verbose("Resetting styles on element",this),a(this).attr("style","").removeAttr("style").children().attr("style","").removeAttr("style")}},toggle:function(a){k.debug("Toggling content content at index",a);var b=u.eq(a),c=b.next(v),d=c.is(":visible");d?l.collapsible?k.close(a):k.debug("Cannot close accordion content collapsing is disabled"):k.open(a)},open:function(b){var c=u.eq(b),d=c.next(v),e=u.filter("."+m.active),f=e.next(u),g=e.size()>0;d.is(":animated")||(k.debug("Opening accordion content",c),l.exclusive&&g&&(e.removeClass(m.active),f.stop().children().animate({opacity:0},l.duration,k.event.resetStyle).end().slideUp(l.duration,l.easing,function(){f.removeClass(m.active).attr("style","").removeAttr("style").children().attr("style","").removeAttr("style")})),c.addClass(m.active),d.stop().children().attr("style","").removeAttr("style").end().slideDown(l.duration,l.easing,function(){d.addClass(m.active).attr("style","").removeAttr("style"),a.proxy(l.onOpen,d)(),a.proxy(l.onChange,d)()}))},close:function(b){var c=u.eq(b),d=c.next(v);k.debug("Closing accordion content",c),c.removeClass(m.active),d.removeClass(m.active).show().stop().children().animate({opacity:0},l.duration,k.event.resetStyle).end().slideUp(l.duration,l.easing,function(){d.attr("style","").removeAttr("style"),a.proxy(l.onClose,d)(),a.proxy(l.onChange,d)()})},setting:function(b,c){return k.debug("Changing setting",b,c),c===d?l[b]:(a.isPlainObject(b)?a.extend(!0,l,b):l[b]=c,void 0)},internal:function(b,c){return k.debug("Changing internal",b,c),c===d?k[b]:(a.isPlainObject(b)?a.extend(!0,k,b):k[b]=c,void 0)},debug:function(){l.debug&&(l.performance?k.performance.log(arguments):(k.debug=Function.prototype.bind.call(console.info,console,l.name+":"),k.debug.apply(console,arguments)))},verbose:function(){l.verbose&&l.debug&&(l.performance?k.performance.log(arguments):(k.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),k.verbose.apply(console,arguments)))},error:function(){k.error=Function.prototype.bind.call(console.error,console,l.name+":"),k.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;l.performance&&(b=(new Date).getTime(),d=f||b,c=b-d,f=b,g.push({Element:w,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(k.performance.timer),k.performance.timer=setTimeout(k.performance.display,100)},display:function(){var b=l.name+":",c=0;f=!1,clearTimeout(k.performance.timer),a.each(g,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",s&&(b+=" '"+s+"'"),(console.group!==d||console.table!==d)&&g.length>0&&(console.groupCollapsed(b),console.table?console.table(g):a.each(g,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),g=[]}},invoke:function(b,e,f){var g,h,i;return e=e||j,f=w||f,"string"==typeof b&&x!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(x[e])&&c!=g)x=x[e];else{if(!a.isPlainObject(x[f])||c==g)return x[e]!==d?(h=x[e],!1):x[f]!==d?(h=x[f],!1):(k.error(p.method),!1);x=x[f]}})),a.isFunction(h)?i=h.apply(f,e):h!==d&&(i=h),a.isArray(c)?c.push(i):"string"==typeof c?c=[c,i]:i!==d&&(c=i),h}},i?(x===d&&k.initialize(),k.invoke(h)):(x!==d&&k.destroy(),k.initialize())}),c!==d?c:this},a.fn.accordion.settings={name:"Accordion",namespace:"accordion",debug:!0,verbose:!0,performance:!0,exclusive:!0,collapsible:!0,duration:500,easing:"easeInOutQuint",onOpen:function(){},onClose:function(){},onChange:function(){},error:{method:"The method you called is not defined"},className:{active:"active"},selector:{title:".title",content:".content"}},a.extend(a.easing,{easeInOutQuint:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c}})}(jQuery,window,document),function(a,b,c,d){a.api=a.fn.api=function(c){var e,f,g=a.extend(!0,{},a.api.settings,c),h="function"!=typeof this?this:a("<div/>"),i=g.stateContext?a(g.stateContext):a(h),j="object"==typeof this?a(h):i,k=this,l=(new Date).getTime(),m=[],n=j.selector||"",o=g.namespace+"-module",p=g.className,q=g.metadata,r=g.error,s=j.data(o),t=arguments[0],u=s!==d&&"string"==typeof t,v=[].slice.call(arguments,1);return e={initialize:function(){var c,f,h,k,l,m,n=(new Date).getTime(),o={},s={};return g.serializeForm&&a(this).toJSON()!==d&&(o=e.get.formData(),e.debug("Adding form data to API Request",o),a.extend(!0,g.data,o)),c=a.proxy(g.beforeSend,j)(g),c===d||c?(k=e.get.url(e.get.templateURL()))?(h=a.Deferred().always(function(){g.stateContext&&i.removeClass(p.loading),a.proxy(g.complete,j)()}).done(function(b){e.debug("API request successful"),"json"==g.dataType?b.error!==d?a.proxy(g.failure,i)(b.error,g,j):a.isArray(b.errors)?a.proxy(g.failure,i)(b.errors[0],g,j):a.proxy(g.success,i)(b,g,j):a.proxy(g.success,i)(b,g,j)}).fail(function(b,c,f){var h,j=g.error[c]!==d?g.error[c]:f;if(b!==d)if(b.readyState!==d&&4==b.readyState){if(200!=b.status&&f!==d&&""!==f)e.error(k.statusMessage+f);else if("error"==c&&"json"==g.dataType)try{h=a.parseJSON(b.responseText),h&&h.error!==d&&(j=h.error)}catch(k){e.error(k.JSONParse)}i.removeClass(p.loading).addClass(p.error),g.errorLength>0&&setTimeout(function(){i.removeClass(p.error)},g.errorLength),e.debug("API Request error:",j),a.proxy(g.failure,i)(j,g,this)}else e.debug("Request Aborted (Most likely caused by page change)")}),a.extend(!0,s,g,{success:function(){},failure:function(){},complete:function(){},type:g.method||g.type,data:l,url:k,beforeSend:g.beforeXHR}),g.stateContext&&i.addClass(p.loading),g.progress&&(e.verbose("Adding progress events"),a.extend(!0,s,{xhr:function(){var c=new b.XMLHttpRequest;return c.upload.addEventListener("progress",function(b){var c;b.lengthComputable&&(c=Math.round(1e4*(b.loaded/b.total))/100+"%",a.proxy(g.progress,i)(c,b))},!1),c.addEventListener("progress",function(b){var c;b.lengthComputable&&(c=Math.round(1e4*(b.loaded/b.total))/100+"%",a.proxy(g.progress,i)(c,b))},!1),c}})),e.verbose("Creating AJAX request with settings: ",s),m=a.ajax(s).always(function(){f=g.loadingLength-((new Date).getTime()-n),g.loadingDelay=0>f?0:f}).done(function(a){var b=this;setTimeout(function(){h.resolveWith(b,[a])},g.loadingDelay)}).fail(function(a,b,c){var d=this;"abort"!=b?setTimeout(function(){h.rejectWith(d,[a,b,c])},g.loadingDelay):i.removeClass(p.error).removeClass(p.loading)}),g.stateContext&&j.data(q.promise,h).data(q.xhr,m),void 0):(e.error(r.missingURL),e.reset(),void 0):(e.error(r.beforeSend),e.reset(),void 0)},get:{formData:function(){return j.closest("form").toJSON()},templateURL:function(){var a,b=j.data(g.metadata.action)||g.action||!1;return b&&(e.debug("Creating url for: ",b),g.api[b]!==d?a=g.api[b]:e.error(r.missingAction)),g.url&&(a=g.url,e.debug("Getting url",a)),a},url:function(b,c){var f;return b&&(f=b.match(g.regExpTemplate),c=c||g.urlData,f&&(e.debug("Looking for URL variables",f),a.each(f,function(g,h){var i=h.substr(2,h.length-3),k=a.isPlainObject(c)&&c[i]!==d?c[i]:j.data(i)!==d?j.data(i):c[i];if(e.verbose("Looking for variable",i,j,j.data(i),c[i]),k===!1)e.debug("Removing variable from URL",f),b=b.replace("/"+h,"");else{if(k===d||!k)return e.error(r.missingParameter+i),b=!1,!1;b=b.replace(h,k)}}))),b}},reset:function(){j.data(q.promise,!1).data(q.xhr,!1),i.removeClass(p.error).removeClass(p.loading)},setting:function(b,c){return c===d?g[b]:(a.isPlainObject(b)?a.extend(!0,g,b):g[b]=c,void 0)},internal:function(b,c){return c===d?e[b]:(a.isPlainObject(b)?a.extend(!0,e,b):e[b]=c,void 0)},debug:function(){g.debug&&(g.performance?e.performance.log(arguments):(e.debug=Function.prototype.bind.call(console.info,console,g.name+":"),e.debug.apply(console,arguments)))},verbose:function(){g.verbose&&g.debug&&(g.performance?e.performance.log(arguments):(e.verbose=Function.prototype.bind.call(console.info,console,g.name+":"),e.verbose.apply(console,arguments)))},error:function(){e.error=Function.prototype.bind.call(console.error,console,g.name+":"),e.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;g.performance&&(b=(new Date).getTime(),d=l||b,c=b-d,l=b,m.push({Element:k,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(e.performance.timer),e.performance.timer=setTimeout(e.performance.display,100)},display:function(){var b=g.name+":",c=0;l=!1,clearTimeout(e.performance.timer),a.each(m,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",n&&(b+=" '"+n+"'"),(console.group!==d||console.table!==d)&&m.length>0&&(console.groupCollapsed(b),console.table?console.table(m):a.each(m,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),m=[]}},invoke:function(b,c,g){var h,i,j;return c=c||v,g=k||g,"string"==typeof b&&s!==d&&(b=b.split(/[\. ]/),h=b.length-1,a.each(b,function(c,f){var g=c!=h?f+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(s[f])&&c!=h)s=s[f];else{if(!a.isPlainObject(s[g])||c==h)return s[f]!==d?(i=s[f],!1):s[g]!==d?(i=s[g],!1):(e.error(r.method),!1);s=s[g]}})),a.isFunction(i)?j=i.apply(g,c):i!==d&&(j=i),a.isArray(f)?f.push(j):"string"==typeof f?f=[f,j]:j!==d&&(f=j),i}},u?(s===d&&e.initialize(),e.invoke(t)):(s!==d&&e.destroy(),e.initialize()),f!==d?f:this},a.fn.apiButton=function(b){return a(this).each(function(){var c,d=a(this),e=a(this).selector||"",f=a.isFunction(b)?a.extend(!0,{},a.api.settings,a.fn.apiButton.settings,{stateContext:this,success:b}):a.extend(!0,{},a.api.settings,a.fn.apiButton.settings,{stateContext:this},b);c={initialize:function(){f.context&&""!==e?a(f.context).on(e,"click."+f.namespace,c.click):d.on("click."+f.namespace,c.click)},click:function(){f.filter&&0!==a(this).filter(f.filter).size()||a.proxy(a.api,this)(f)}},c.initialize()}),this},a.api.settings={name:"API",namespace:"api",debug:!0,verbose:!0,performance:!0,api:{},beforeSend:function(a){return a},beforeXHR:function(){},success:function(){},complete:function(){},failure:function(){},progress:!1,error:{missingAction:"API action used but no url was defined",missingURL:"URL not specified for the API action",missingParameter:"Missing an essential URL parameter: ",timeout:"Your request timed out",error:"There was an error with your request",parseError:"There was an error parsing your request",JSONParse:"JSON could not be parsed during error handling",statusMessage:"Server gave an error: ",beforeSend:"The before send function has aborted the request",exitConditions:"API Request Aborted. Exit conditions met"},className:{loading:"loading",error:"error"},metadata:{action:"action",promise:"promise",xhr:"xhr"},regExpTemplate:/\{\$([A-z]+)\}/g,action:!1,url:!1,urlData:!1,serializeForm:!1,stateContext:!1,method:"get",data:{},dataType:"json",cache:!0,loadingLength:200,errorLength:2e3},a.fn.apiButton.settings={filter:".disabled, .loading",context:!1,stateContext:!1}}(jQuery,window,document),function(a,b,c,d){a.fn.colorize=function(b){var c=a.extend(!0,{},a.fn.colorize.settings,b),e=arguments||!1;return a(this).each(function(b){var f,g,h,i,j,k,l,m,n=a(this),o=a("<canvas />")[0],p=a("<canvas />")[0],q=a("<canvas />")[0],r=new Image,s=c.colors,t=(c.paths,c.namespace),u=c.error,v=n.data("module-"+t);return m={checkPreconditions:function(){return m.debug("Checking pre-conditions"),!a.isPlainObject(s)||a.isEmptyObject(s)?(m.error(u.undefinedColors),!1):!0},async:function(a){c.async?setTimeout(a,0):a()},getMetadata:function(){m.debug("Grabbing metadata"),i=n.data("image")||c.image||d,j=n.data("name")||c.name||b,k=c.width||n.width(),l=c.height||n.height(),(0===k||0===l)&&m.error(u.undefinedSize)},initialize:function(){m.debug("Initializing with colors",s),m.checkPreconditions()&&m.async(function(){m.getMetadata(),m.canvas.create(),m.draw.image(function(){m.draw.colors(),m.canvas.merge()}),n.data("module-"+t,m)})},redraw:function(){m.debug("Redrawing image"),m.async(function(){m.canvas.clear(),m.draw.colors(),m.canvas.merge()})},change:{color:function(a,b){return m.debug("Changing color",a),s[a]===d?(m.error(u.missingColor),!1):(s[a]=b,m.redraw(),void 0)}},canvas:{create:function(){m.debug("Creating canvases"),o.width=k,o.height=l,p.width=k,p.height=l,q.width=k,q.height=l,f=o.getContext("2d"),g=p.getContext("2d"),h=q.getContext("2d"),n.append(o),f=n.children("canvas")[0].getContext("2d")},clear:function(){m.debug("Clearing canvas"),h.fillStyle="#FFFFFF",h.fillRect(0,0,k,l)},merge:function(){return a.isFunction(f.blendOnto)?(f.putImageData(g.getImageData(0,0,k,l),0,0),h.blendOnto(f,"multiply"),void 0):(m.error(u.missingPlugin),void 0)}},draw:{image:function(a){m.debug("Drawing image"),a=a||function(){},i?(r.src=i,r.onload=function(){g.drawImage(r,0,0),a()}):(m.error(u.noImage),a())},colors:function(){m.debug("Drawing color overlays",s),a.each(s,function(a,b){c.onDraw(h,j,a,b)})}},debug:function(a,b){c.debug&&(b!==d?console.info(c.name+": "+a,b):console.info(c.name+": "+a))},error:function(a){console.warn(c.name+": "+a)},invoke:function(b,e,f){var g;return f=f||Array.prototype.slice.call(arguments,2),"string"==typeof b&&v!==d&&(b=b.split("."),a.each(b,function(b,d){return a.isPlainObject(v[d])?(v=v[d],!0):a.isFunction(v[d])?(g=v[d],!0):(m.error(c.error.method),!1)})),a.isFunction(g)?g.apply(e,f):!1}},v!==d&&e?("invoke"==e[0]&&(e=Array.prototype.slice.call(e,1)),m.invoke(e[0],this,Array.prototype.slice.call(e,1))):(m.initialize(),void 0)}),this},a.fn.colorize.settings={name:"Image Colorizer",debug:!0,namespace:"colorize",onDraw:function(){},async:!0,colors:{},metadata:{image:"image",name:"name"},error:{noImage:"No tracing image specified",undefinedColors:"No default colors specified.",missingColor:"Attempted to change color that does not exist",missingPlugin:"Blend onto plug-in must be included",undefinedHeight:"The width or height of image canvas could not be automatically determined. Please specify a height."}}}(jQuery,window,document),function(a,b,c,d){a.fn.form=function(b,e){var f,g=a(this),h=a.extend(!0,{},a.fn.form.settings,e),i=a.extend({},a.fn.form.settings.defaults,b),j=h.namespace,k=h.metadata,l=h.selector,m=h.className,n=h.error,o="."+j,p="module-"+j,q=g.selector||"",r=(new Date).getTime(),s=[],t=arguments[0],u="string"==typeof t,v=[].slice.call(arguments,1);return g.each(function(){var b,e=a(this),j=a(this).find(l.field),w=a(this).find(l.group),x=a(this).find(l.message),y=(a(this).find(l.prompt),a(this).find(l.submit)),z=[],A=this,B=e.data(p);b={initialize:function(){b.verbose("Initializing form validation",e,i,h),h.keyboardShortcuts&&j.on("keydown"+o,b.event.field.keydown),e.on("submit"+o,b.validate.form),j.on("blur"+o,b.event.field.blur),y.on("click"+o,b.submit),j.on(b.get.changeEvent()+o,b.event.field.change),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),B=b,e.data(p,b)},destroy:function(){b.verbose("Destroying previous module",B),e.off(o).removeData(p)},refresh:function(){b.verbose("Refreshing selector cache"),j=e.find(l.field)},submit:function(){b.verbose("Submitting form",e),e.submit()},event:{field:{keydown:function(c){var d=a(this),e=c.which,f={enter:13,escape:27};return e==f.escape&&(b.verbose("Escape key pressed blurring field"),d.blur()),!c.ctrlKey&&e==f.enter&&d.is(l.input)?(b.debug("Enter key pressed, submitting form"),y.addClass(m.down),d.one("keyup"+o,b.event.field.keyup),c.preventDefault(),!1):void 0},keyup:function(){b.verbose("Doing keyboard shortcut form submit"),y.removeClass(m.down),b.submit()},blur:function(){var c=a(this),d=c.closest(w);d.hasClass(m.error)?(b.debug("Revalidating field",c,b.get.validation(c)),b.validate.field(b.get.validation(c))):("blur"==h.on||"change"==h.on)&&b.validate.field(b.get.validation(c))},change:function(){var c=a(this),d=c.closest(w);d.hasClass(m.error)?(b.debug("Revalidating field",c,b.get.validation(c)),b.validate.field(b.get.validation(c))):"change"==h.on&&b.validate.field(b.get.validation(c))}}},get:{changeEvent:function(){return c.createElement("input").oninput!==d?"input":c.createElement("input").onpropertychange!==d?"propertychange":"keyup"},field:function(c){return b.verbose("Finding field with identifier",c),j.filter("#"+c).size()>0?j.filter("#"+c):j.filter('[name="'+c+'"]').size()>0?j.filter('[name="'+c+'"]'):j.filter("[data-"+k.validate+'="'+c+'"]').size()>0?j.filter("[data-"+k.validate+'="'+c+'"]'):a("<input/>")},validation:function(c){var d;return a.each(i,function(a,e){b.get.field(e.identifier).get(0)==c.get(0)&&(d=e)}),d||!1}},has:{field:function(a){return b.verbose("Checking for existence of a field with identifier",a),j.filter("#"+a).size()>0?!0:j.filter('[name="'+a+'"]').size()>0?!0:j.filter("[data-"+k.validate+'="'+a+'"]').size()>0?!0:!1}},add:{prompt:function(c,e){var f=b.get.field(c.identifier),g=f.closest(w),i=g.find(l.prompt),j=0!==i.size();b.verbose("Adding inline error",c),g.addClass(m.error),h.inline&&(j||(i=h.templates.prompt(e),i.appendTo(g)),i.html(e[0]),j||(h.transition&&a.fn.transition!==d?(b.verbose("Displaying error with css transition",h.transition),i.transition(h.transition+" in",h.duration)):(b.verbose("Displaying error with fallback javascript animation"),i.fadeIn(h.duration))))},errors:function(a){b.debug("Adding form error messages",a),x.html(h.templates.error(a))}},remove:{prompt:function(c){var e=b.get.field(c.identifier),f=e.closest(w),g=f.find(l.prompt);f.removeClass(m.error),h.inline&&g.is(":visible")&&(b.verbose("Removing prompt for field",c),h.transition&&a.fn.transition!==d?g.transition(h.transition+" out",h.duration,function(){g.remove()}):g.fadeOut(h.duration,function(){g.remove()}))}},validate:{form:function(c){var d=!0;return z=[],a.each(i,function(a,c){b.validate.field(c)||(d=!1)}),d?(b.debug("Form has no validation errors, submitting"),e.removeClass(m.error).addClass(m.success),a.proxy(h.onSuccess,this)(c),void 0):(b.debug("Form has errors"),e.addClass(m.error),h.inline||b.add.errors(z),a.proxy(h.onFailure,this)(z))},field:function(c){var e=b.get.field(c.identifier),f=!0,g=[];return c.rules!==d&&a.each(c.rules,function(a,d){b.has.field(c.identifier)&&!b.validate.rule(c,d)&&(b.debug("Field is invalid",c.identifier,d.type),g.push(d.prompt),f=!1)}),f?(b.remove.prompt(c,g),a.proxy(h.onValid,e)(),!0):(z=z.concat(g),b.add.prompt(c,g),a.proxy(h.onInvalid,e)(g),!1)},rule:function(c,f){var g,i,j=b.get.field(c.identifier),k=f.type,l=j.val(),m=/\[(.*?)\]/i,n=m.exec(k),o=!0;return n!==d&&null!==n?(g=n[1],i=k.replace(n[0],""),o=a.proxy(h.rules[i],e)(l,g)):o=a.proxy(h.rules[k],j)(l),o}},setting:function(c,e){return b.debug("Changing setting",c,e),e===d?h[c]:(a.isPlainObject(c)?a.extend(!0,h,c):h[c]=e,void 0)},internal:function(c,e){return b.debug("Changing internal",c,e),e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){h.debug&&(h.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,h.name+":"),b.debug.apply(console,arguments)))},verbose:function(){h.verbose&&h.debug&&(h.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,h.name+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;h.performance&&(c=(new Date).getTime(),e=r||c,d=c-e,r=c,s.push({Element:A,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=h.name+":",e=0;r=!1,clearTimeout(b.performance.timer),a.each(s,function(a,b){e+=b["Execution Time"]}),c+=" "+e+"ms",q&&(c+=" '"+q+"'"),g.size()>1&&(c+=" ("+g.size()+")"),(console.group!==d||console.table!==d)&&s.length>0&&(console.groupCollapsed(c),console.table?console.table(s):a.each(s,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(c,e,g){var h,i,j;return e=e||v,g=A||g,"string"==typeof c&&B!==d&&(c=c.split(/[\. ]/),h=c.length-1,a.each(c,function(e,f){var g=e!=h?f+c[e+1].charAt(0).toUpperCase()+c[e+1].slice(1):c;if(a.isPlainObject(B[f])&&e!=h)B=B[f];else{if(!a.isPlainObject(B[g])||e==h)return B[f]!==d?(i=B[f],!1):B[g]!==d?(i=B[g],!1):(b.error(n.method),!1);B=B[g]}})),a.isFunction(i)?j=i.apply(g,e):i!==d&&(j=i),a.isArray(f)?f.push(j):"string"==typeof f?f=[f,j]:j!==d&&(f=j),i}},u?(B===d&&b.initialize(),b.invoke(t)):(B!==d&&b.destroy(),b.initialize())}),f!==d?f:this},a.fn.form.settings={name:"Form",namespace:"form",debug:!0,verbose:!0,performance:!0,keyboardShortcuts:!0,on:"submit",inline:!1,transition:"scale",duration:150,onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},metadata:{validate:"validate"},selector:{message:".error.message",field:"input, textarea, select",group:".field",input:"input",prompt:".prompt",submit:".submit"},className:{error:"error",success:"success",down:"down",label:"ui label prompt"},error:{method:"The method you called is not defined."},templates:{error:function(b){var c='<ul class="list">';return a.each(b,function(a,b){c+="<li>"+b+"</li>"}),c+="</ul>",a(c)},prompt:function(b){return a("<div/>").addClass("ui red pointing prompt label").html(b[0])}},rules:{checked:function(){return a(this).filter(":checked").size()>0},empty:function(a){return!(a===d||""===a)},email:function(a){var b=new RegExp("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?");return b.test(a)},length:function(a,b){return a!==d?a.length>=b:!1},not:function(a,b){return a!=b},contains:function(a,b){return-1!==a.search(b)},is:function(a,b){return a==b},maxLength:function(a,b){return a!==d?a.length<=b:!1},match:function(b,c){var e,f=a(this);return f.find("#"+c).size()>0?e=f.find("#"+c).val():f.find("[name="+c+"]").size()>0?e=f.find("[name="+c+"]").val():f.find('[data-validate="'+c+'"]').size()>0&&(e=f.find('[data-validate="'+c+'"]').val()),e!==d?b.toString()==e.toString():!1},url:function(a){var b=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return b.test(a)}}}}(jQuery,window,document),function(a,b,c,d){a.fn.state=function(b){var c,e=a(this),f=a.extend(!0,{},a.fn.state.settings,b),g=e.selector||"",h=(new Date).getTime(),i=[],j=arguments[0],k="string"==typeof j,l=[].slice.call(arguments,1),m=f.error,n=f.metadata,o=f.className,p=f.namespace,q=f.states,r=f.text,s="."+p,t=p+"-module";return e.each(function(){var p,u=a(this),v=this,w=u.data(t);p={initialize:function(){p.verbose("Initializing module"),f.automatic&&p.add.defaults(),f.context&&""!==g?(p.allows("hover")&&a(v,f.context).on(g,"mouseenter"+s,p.enable.hover).on(g,"mouseleave"+s,p.disable.hover),p.allows("down")&&a(v,f.context).on(g,"mousedown"+s,p.enable.down).on(g,"mouseup"+s,p.disable.down),p.allows("focus")&&a(v,f.context).on(g,"focus"+s,p.enable.focus).on(g,"blur"+s,p.disable.focus),a(f.context).on(g,"mouseenter"+s,p.change.text).on(g,"mouseleave"+s,p.reset.text).on(g,"click"+s,p.toggle.state)):(p.allows("hover")&&u.on("mouseenter"+s,p.enable.hover).on("mouseleave"+s,p.disable.hover),p.allows("down")&&u.on("mousedown"+s,p.enable.down).on("mouseup"+s,p.disable.down),p.allows("focus")&&u.on("focus"+s,p.enable.focus).on("blur"+s,p.disable.focus),u.on("mouseenter"+s,p.change.text).on("mouseleave"+s,p.reset.text).on("click"+s,p.toggle.state)),p.instantiate()},instantiate:function(){p.verbose("Storing instance of module",p),w=p,u.data(t,p)},destroy:function(){p.verbose("Destroying previous module",w),u.off(s).removeData(t)},refresh:function(){p.verbose("Refreshing selector cache"),u=a(v)},add:{defaults:function(){var c=b&&a.isPlainObject(b.states)?b.states:{};a.each(f.defaults,function(b,e){p.is[b]!==d&&p.is[b]()&&(p.verbose("Adding default states",b,v),a.extend(f.states,e,c))})}},is:{active:function(){return u.hasClass(o.active)},loading:function(){return u.hasClass(o.loading)},inactive:function(){return!u.hasClass(o.active)},enabled:function(){return!u.is(f.filter.active)},disabled:function(){return u.is(f.filter.active)},textEnabled:function(){return!u.is(f.filter.text)},button:function(){return u.is(".button:not(a, .submit)")},input:function(){return u.is("input")}},allow:function(a){p.debug("Now allowing state",a),q[a]=!0},disallow:function(a){p.debug("No longer allowing",a),q[a]=!1},allows:function(a){return q[a]||!1},enable:{state:function(a){p.allows(a)&&u.addClass(o[a])},focus:function(){u.addClass(o.focus)},hover:function(){u.addClass(o.hover)},down:function(){u.addClass(o.down)}},disable:{state:function(a){p.allows(a)&&u.removeClass(o[a])},focus:function(){u.removeClass(o.focus)},hover:function(){u.removeClass(o.hover)},down:function(){u.removeClass(o.down)}},toggle:{state:function(){var a=u.data(n.promise);p.allows("active")&&p.is.enabled()&&(p.refresh(),a!==d?p.listenTo(a):p.change.state())}},listenTo:function(b){p.debug("API request detected, waiting for state signal",b),b?(r.loading&&p.update.text(r.loading),a.when(b).then(function(){"resolved"==b.state()?(p.debug("API request succeeded"),f.activateTest=function(){return!0},f.deactivateTest=function(){return!0}):(p.debug("API request failed"),f.activateTest=function(){return!1},f.deactivateTest=function(){return!1}),p.change.state()})):(f.activateTest=function(){return!1},f.deactivateTest=function(){return!1})},change:{state:function(){p.debug("Determining state change direction"),p.is.inactive()?p.activate():p.deactivate(),f.sync&&p.sync(),a.proxy(f.onChange,v)()},text:function(){p.is.textEnabled()&&(p.is.active()?r.hover?(p.verbose("Changing text to hover text",r.hover),p.update.text(r.hover)):r.disable&&(p.verbose("Changing text to disable text",r.disable),p.update.text(r.disable)):r.hover?(p.verbose("Changing text to hover text",r.disable),p.update.text(r.hover)):r.enable&&(p.verbose("Changing text to enable text",r.enable),p.update.text(r.enable)))}},activate:function(){a.proxy(f.activateTest,v)()&&(p.debug("Setting state to active"),u.addClass(o.active),p.update.text(r.active)),a.proxy(f.onActivate,v)()},deactivate:function(){a.proxy(f.deactivateTest,v)()&&(p.debug("Setting state to inactive"),u.removeClass(o.active),p.update.text(r.inactive)),a.proxy(f.onDeactivate,v)()},sync:function(){p.verbose("Syncing other buttons to current state"),p.is.active()?e.not(u).state("activate"):e.not(u).state("deactivate")},get:{text:function(){return f.selector.text?u.find(f.selector.text).text():u.html()},textFor:function(a){return r[a]||!1}},flash:{text:function(a,b){var c=p.get.text();p.debug("Flashing text message",a,b),a=a||f.text.flash,b=b||f.flashDuration,p.update.text(a),setTimeout(function(){p.update.text(c)},b)}},reset:{text:function(){var a=r.active||u.data(n.storedText),b=r.inactive||u.data(n.storedText);p.is.textEnabled()&&(p.is.active()&&a?(p.verbose("Resetting active text",a),p.update.text(a)):b&&(p.verbose("Resetting inactive text",a),p.update.text(b)))}},update:{text:function(a){var b=p.get.text();a&&a!==b?(p.debug("Updating text",a),f.selector.text?u.data(n.storedText,a).find(f.selector.text).text(a):u.data(n.storedText,a).html(a)):p.debug("Text is already sane, ignoring update",a)}},setting:function(b,c){return p.debug("Changing setting",b,c),c===d?f[b]:(a.isPlainObject(b)?a.extend(!0,f,b):f[b]=c,void 0)},internal:function(b,c){return p.debug("Changing internal",b,c),c===d?p[b]:(a.isPlainObject(b)?a.extend(!0,p,b):p[b]=c,void 0)},debug:function(){f.debug&&(f.performance?p.performance.log(arguments):(p.debug=Function.prototype.bind.call(console.info,console,f.name+":"),p.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?p.performance.log(arguments):(p.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),p.verbose.apply(console,arguments)))},error:function(){p.error=Function.prototype.bind.call(console.error,console,f.name+":"),p.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;f.performance&&(b=(new Date).getTime(),d=h||b,c=b-d,h=b,i.push({Element:v,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(p.performance.timer),p.performance.timer=setTimeout(p.performance.display,100)},display:function(){var b=f.name+":",c=0;h=!1,clearTimeout(p.performance.timer),a.each(i,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",g&&(b+=" '"+g+"'"),e.size()>1&&(b+=" ("+e.size()+")"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(b),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,e,f){var g,h,i;return e=e||l,f=v||f,"string"==typeof b&&w!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(w[e])&&c!=g)w=w[e];else{if(!a.isPlainObject(w[f])||c==g)return w[e]!==d?(h=w[e],!1):w[f]!==d?(h=w[f],!1):(p.error(m.method),!1);w=w[f]}})),a.isFunction(h)?i=h.apply(f,e):h!==d&&(i=h),a.isArray(c)?c.push(i):"string"==typeof c?c=[c,i]:i!==d&&(c=i),h}},k?(w===d&&p.initialize(),p.invoke(j)):(w!==d&&p.destroy(),p.initialize())}),c!==d?c:this},a.fn.state.settings={name:"State",debug:!0,verbose:!0,namespace:"state",performance:!0,onActivate:function(){},onDeactivate:function(){},onChange:function(){},activateTest:function(){return!0},deactivateTest:function(){return!0},automatic:!0,sync:!1,flashDuration:3e3,filter:{text:".loading, .disabled",active:".disabled"},context:!1,error:{method:"The method you called is not defined."},metadata:{promise:"promise",storedText:"stored-text"},className:{focus:"focus",hover:"hover",down:"down",active:"active",loading:"loading"},selector:{text:!1},defaults:{input:{hover:!0,focus:!0,down:!0,loading:!1,active:!1},button:{hover:!0,focus:!1,down:!0,active:!0,loading:!0}},states:{hover:!0,focus:!0,down:!0,loading:!1,active:!1},text:{flash:!1,hover:!1,active:!1,inactive:!1,enable:!1,disable:!1}}}(jQuery,window,document),function(a,b,c,d){a.fn.chatroom=function(b){return a(this).each(function(){var c,e,f,g,h,i,j,k=a.extend(!0,{},a.fn.chatroom.settings,b),l=k.className,m=k.namespace,n=k.selector,o=k.error,p=a(this),q=p.find(n.expandButton),r=p.find(n.userListButton),s=p.find(n.userList),t=(p.find(n.room),p.find(n.userCount)),u=p.find(n.log),v=(p.find(n.message),p.find(n.messageInput)),w=p.find(n.messageButton),x=p.data("module"),y="",z={};j={width:{log:u.width(),userList:s.outerWidth()},initialize:function(){return Pusher===d&&j.error(o.pusher),k.key===d||k.channelName===d?(j.error(o.key),!1):k.endpoint.message||k.endpoint.authentication?(i=new Pusher(k.key),Pusher.channel_auth_endpoint=k.endpoint.authentication,c=i.subscribe(k.channelName),c.bind("pusher:subscription_succeeded",j.user.list.create),c.bind("pusher:subscription_error",j.error),c.bind("pusher:member_added",j.user.joined),c.bind("pusher:member_removed",j.user.left),c.bind("update_messages",j.message.receive),a.each(k.customEvents,function(a,b){c.bind(a,b)}),r.on("click."+m,j.event.toggleUserList),q.on("click."+m,j.event.toggleExpand),v.on("keydown."+m,j.event.input.keydown).on("keyup."+m,j.event.input.keyup),w.on("mouseenter."+m,j.event.hover).on("mouseleave."+m,j.event.hover).on("click."+m,j.event.submit),u.animate({scrollTop:u.prop("scrollHeight")},400),p.data("module",j).addClass(l.loading),void 0):(j.error(o.endpoint),!1)
},refresh:function(){r.removeClass(l.active),j.width={log:u.width(),userList:s.outerWidth()},r.hasClass(l.active)&&j.user.list.hide(),p.data("module",j)},user:{updateCount:function(){k.userCount&&(z=p.data("users"),g=0,a.each(z,function(){g++}),t.html(k.templates.userCount(g)))},joined:function(b){z=p.data("users"),"anonymous"!=b.id&&z[b.id]===d&&(z[b.id]=b.info,k.randomColor&&b.info.color===d&&(b.info.color=k.templates.color(b.id)),y=k.templates.userList(b.info),b.info.isAdmin?a(y).prependTo(s):a(y).appendTo(s),k.partingMessages&&(u.append(k.templates.joined(b.info)),j.message.scroll.test()),j.user.updateCount())},left:function(a){z=p.data("users"),a!==d&&"anonymous"!==a.id&&(delete z[a.id],p.data("users",z),s.find("[data-id="+a.id+"]").remove(),k.partingMessages&&(u.append(k.templates.left(a.info)),j.message.scroll.test()),j.user.updateCount())},list:{create:function(b){z={},b.each(function(a){"anonymous"!==a.id&&"undefined"!==a.id&&(k.randomColor&&a.info.color===d&&(a.info.color=k.templates.color(a.id)),y=a.info.isAdmin?k.templates.userList(a.info)+y:y+k.templates.userList(a.info),z[a.id]=a.info)}),p.data("users",z).data("user",z[b.me.id]).removeClass(l.loading),s.html(y),j.user.updateCount(),a.proxy(k.onJoin,s.children())()},show:function(){u.animate({width:j.width.log-j.width.userList},{duration:k.speed,easing:k.easing,complete:j.message.scroll.move})},hide:function(){u.stop().animate({width:j.width.log},{duration:k.speed,easing:k.easing,complete:j.message.scroll.move})}}},message:{scroll:{test:function(){h=u.prop("scrollHeight")-u.height(),Math.abs(u.scrollTop()-h)<k.scrollArea&&j.message.scroll.move()},move:function(){h=u.prop("scrollHeight")-u.height(),u.scrollTop(h)}},send:function(b){j.utils.emptyString(b)||a.api({url:k.endpoint.message,method:"POST",data:{message:{content:b,timestamp:(new Date).getTime()}}})},receive:function(a){f=a.data,z=p.data("users"),e=p.data("user"),z[f.userID]!==d&&(e===d||e.id!=f.userID)&&(f.user=z[f.userID],j.message.display(f))},display:function(b){u.append(k.templates.message(b)),j.message.scroll.test(),a.proxy(k.onMessage,u.children().last())()}},expand:function(){p.addClass(l.expand),a.proxy(k.onExpand,p)(),j.refresh()},contract:function(){p.removeClass(l.expand),a.proxy(k.onContract,p)(),j.refresh()},event:{input:{keydown:function(a){13==a.which&&w.addClass(l.down)},keyup:function(a){13==a.which&&(w.removeClass(l.down),j.event.submit())}},submit:function(){var a=v.val(),b=p.data("user");b===d||j.utils.emptyString(a)||(j.message.send(a),j.message.display({user:b,text:a}),j.message.scroll.move(),v.val(""))},toggleExpand:function(){p.hasClass(l.expand)?(q.removeClass(l.active),j.contract()):(q.addClass(l.active),j.expand())},toggleUserList:function(){u.is(":animated")||(r.hasClass(l.active)?(r.removeClass("active"),j.user.list.hide()):(r.addClass(l.active),j.user.list.show()))}},utils:{emptyString:function(a){return"string"==typeof a?-1==a.search(/\S/):!1}},setting:function(b,c){return c===d?k[b]:(a.isPlainObject(b)?a.extend(!0,k,b):k[b]=c,void 0)},internal:function(b,c){return c===d?j[b]:(a.isPlainObject(b)?a.extend(!0,j,b):j[b]=c,void 0)},debug:function(){k.debug&&(k.performance?j.performance.log(arguments):(j.debug=Function.prototype.bind.call(console.info,console,k.name+":"),j.debug.apply(console,arguments)))},verbose:function(){k.verbose&&k.debug&&(k.performance?j.performance.log(arguments):(j.verbose=Function.prototype.bind.call(console.info,console,k.name+":"),j.verbose.apply(console,arguments)))},error:function(){j.error=Function.prototype.bind.call(console.error,console,k.name+":"),j.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;k.performance&&(b=(new Date).getTime(),d=time||b,c=b-d,time=b,performance.push({Element:element,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(j.performance.timer),j.performance.timer=setTimeout(j.performance.display,100)},display:function(){var b=k.name+":",c=0;time=!1,clearTimeout(j.performance.timer),a.each(performance,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",moduleSelector&&(b+=" '"+moduleSelector+"'"),b+=" ("+$allDropdowns.size()+")",(console.group!==d||console.table!==d)&&performance.length>0&&(console.groupCollapsed(b),console.table?console.table(performance):a.each(performance,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),performance=[]}},invoke:function(b,c,e){var f,g;return c=c||queryArguments,e=element||e,"string"==typeof b&&x!==d&&(b=b.split(/[\. ]/),f=b.length-1,a.each(b,function(b,c){a.isPlainObject(x[c])&&b!=f?x=x[c]:x[c]!==d?g=x[c]:j.error(o.method)})),a.isFunction(g)?g.apply(e,c):g||!1}},methodInvoked?(x===d&&j.initialize(),j.invoke(query)):(x!==d&&j.destroy(),j.initialize())}),invokedResponse?invokedResponse:this},a.fn.chatroom.settings={name:"Chat",debug:!1,namespace:"chat",channel:"present-chat",onJoin:function(){},onMessage:function(){},onExpand:function(){},onContract:function(){},customEvents:{},partingMessages:!1,userCount:!0,randomColor:!0,speed:300,easing:"easeOutQuint",scrollArea:9999,endpoint:{message:!1,authentication:!1},error:{method:"The method you called is not defined",endpoint:"Please define a message and authentication endpoint.",key:"You must specify a pusher key and channel.",pusher:"You must include the Pusher library."},className:{expand:"expand",active:"active",hover:"hover",down:"down",loading:"loading"},selector:{userCount:".actions .message",userListButton:".actions .list.button",expandButton:".actions .expand.button",room:".room",userList:".room .list",log:".room .log",message:".room .log .message",author:".room log .message .author",messageInput:".talk input",messageButton:".talk .send.button"},templates:{userCount:function(a){return a+" users in chat"},color:function(){var a=["#000000","#333333","#666666","#999999","#CC9999","#CC6666","#CC3333","#993333","#663333","#CC6633","#CC9966","#CC9933","#999966","#CCCC66","#99CC66","#669933","#669966","#33A3CC","#336633","#33CCCC","#339999","#336666","#336699","#6666CC","#9966CC","#333399","#663366","#996699","#993366","#CC6699"];return a[Math.floor(Math.random()*a.length)]},message:function(a){var b="";return a.user.isAdmin?(a.user.color="#55356A",b+='<div class="admin message">',b+='<span class="quirky ui flag team"></span>'):b+='<div class="message">',b+="<p>",b+=a.user.color!==d?'<span class="author" style="color: '+a.user.color+';">'+a.user.name+"</span>: ":'<span class="author">'+a.user.name+"</span>: ",b+=""+a.text+" </p>"+"</div>"},joined:function(a){return typeof a.name!==d?'<div class="status">'+a.name+" has joined the chat.</div>":!1},left:function(a){return typeof a.name!==d?'<div class="status">'+a.name+" has left the chat.</div>":!1},userList:function(a){var b="";return a.isAdmin&&(a.color="#55356A"),b+='<div class="user" data-id="'+a.id+'">'+' <div class="image">'+' <img src="'+a.avatarURL+'">'+" </div>",b+=a.color!==d?' <p><a href="/users/'+a.id+'" target="_blank" style="color: '+a.color+';">'+a.name+"</a></p>":' <p><a href="/users/'+a.id+'" target="_blank">'+a.name+"</a></p>",b+="</div>"}}}}(jQuery,window,document),function(a,b,c,d){a.fn.checkbox=function(b){var c,e=a(this),f=e.selector||"",g=(new Date).getTime(),h=[],i=arguments[0],j="string"==typeof i,k=[].slice.call(arguments,1);return e.each(function(){var e,l=a.extend(!0,{},a.fn.checkbox.settings,b),m=l.className,n=l.namespace,o=l.error,p="."+n,q="module-"+n,r=a(this),s=a(this).next(l.selector.label).first(),t=a(this).find(l.selector.input),u=r.selector||"",v=r.data(q),w=this;e={initialize:function(){e.verbose("Initializing checkbox",l),l.context&&""!==u?(e.verbose("Adding delegated events"),a(w,l.context).on(u,"click"+p,e.toggle).on(u+" + "+l.selector.label,"click"+p,e.toggle)):(r.on("click"+p,e.toggle).data(q,e),s.on("click"+p,e.toggle)),e.instantiate()},instantiate:function(){e.verbose("Storing instance of module",e),v=e,r.data(q,e)},destroy:function(){e.verbose("Destroying previous module"),r.off(p).removeData(q)},is:{radio:function(){return r.hasClass(m.radio)}},can:{disable:function(){return"boolean"==typeof l.required?l.required:!e.is.radio()}},enable:function(){e.debug("Enabling checkbox",t),t.prop("checked",!0),a.proxy(l.onChange,t.get())(),a.proxy(l.onEnable,t.get())()},disable:function(){e.debug("Disabling checkbox"),t.prop("checked",!1),a.proxy(l.onChange,t.get())(),a.proxy(l.onDisable,t.get())()},toggle:function(){e.verbose("Determining new checkbox state"),t.prop("checked")!==d&&t.prop("checked")?e.can.disable()&&e.disable():e.enable()},setting:function(b,c){return c===d?l[b]:(a.isPlainObject(b)?a.extend(!0,l,b):l[b]=c,void 0)},internal:function(b,c){return c===d?e[b]:(a.isPlainObject(b)?a.extend(!0,e,b):e[b]=c,void 0)},debug:function(){l.debug&&(l.performance?e.performance.log(arguments):(e.debug=Function.prototype.bind.call(console.info,console,l.name+":"),e.debug.apply(console,arguments)))},verbose:function(){l.verbose&&l.debug&&(l.performance?e.performance.log(arguments):(e.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),e.verbose.apply(console,arguments)))},error:function(){e.error=Function.prototype.bind.call(console.error,console,l.name+":"),e.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;l.performance&&(b=(new Date).getTime(),d=g||b,c=b-d,g=b,h.push({Element:w,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(e.performance.timer),e.performance.timer=setTimeout(e.performance.display,100)},display:function(){var b=l.name+":",c=0;g=!1,clearTimeout(e.performance.timer),a.each(h,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",f&&(b+=" '"+f+"'"),(console.group!==d||console.table!==d)&&h.length>0&&(console.groupCollapsed(b),console.table?console.table(h):a.each(h,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(b,f,g){var h,i,j;return f=f||k,g=w||g,"string"==typeof b&&v!==d&&(b=b.split(/[\. ]/),h=b.length-1,a.each(b,function(c,f){var g=c!=h?f+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(v[f])&&c!=h)v=v[f];else{if(!a.isPlainObject(v[g])||c==h)return v[f]!==d?(i=v[f],!1):v[g]!==d?(i=v[g],!1):(e.error(o.method),!1);v=v[g]}})),a.isFunction(i)?j=i.apply(g,f):i!==d&&(j=i),a.isArray(c)?c.push(j):"string"==typeof c?c=[c,j]:j!==d&&(c=j),i}},j?(v===d&&e.initialize(),e.invoke(i)):(v!==d&&e.destroy(),e.initialize())}),c!==d?c:this},a.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",verbose:!0,debug:!0,performance:!0,context:!1,required:"auto",onChange:function(){},onEnable:function(){},onDisable:function(){},error:{method:"The method you called is not defined."},selector:{input:"input[type=checkbox], input[type=radio]",label:"label"},className:{radio:"radio"}}}(jQuery,window,document),function(a,b,c,d){a.fn.dimmer=function(b){var e,f=a(this),g=(new Date).getTime(),h=[],i=arguments[0],j="string"==typeof i,k=[].slice.call(arguments,1);return f.each(function(){var l,m,n,o=a.isPlainObject(b)?a.extend(!0,{},a.fn.dimmer.settings,b):a.extend({},a.fn.dimmer.settings),p=o.selector,q=o.namespace,r=o.className,s=o.error,t="."+q,u="module-"+q,v=f.selector||"",w="ontouchstart"in c.documentElement?"touchstart":"click",x=a(this),y=this,z=x.data(u);n={preinitialize:function(){n.is.dimmer()?(m=x.parent(),l=x):(m=x,l=n.has.dimmer()?m.children(p.dimmer).first():n.create())},initialize:function(){n.debug("Initializing dimmer",o),"hover"==o.on?m.on("mouseenter"+t,n.show).on("mouseleave"+t,n.hide):"click"==o.on&&m.on(w+t,n.toggle),n.is.page()&&(n.debug("Setting as a page dimmer",m),n.set.pageDimmer()),o.closable&&(n.verbose("Adding dimmer close event",l),l.on(w+t,n.event.click)),n.set.dimmable(),n.instantiate()},instantiate:function(){n.verbose("Storing instance of module",n),z=n,x.data(u,z)},destroy:function(){n.verbose("Destroying previous module",l),x.removeData(u),m.off(t),l.off(t)},event:{click:function(b){n.verbose("Determining if event occured on dimmer",b),(0===l.find(b.target).size()||a(b.target).is(p.content))&&(n.hide(),b.stopImmediatePropagation())}},addContent:function(b){var c=a(b).detach();n.debug("Add content to dimmer",c),c.parent()[0]!==l[0]&&l.append(c)},create:function(){return a(o.template.dimmer()).appendTo(m)},animate:{show:function(b){b=b||function(){},n.set.dimmed(),a.fn.transition!==d?l.transition(o.transition+" in",n.get.duration(),function(){n.set.active(),b()}):(n.verbose("Showing dimmer animation with javascript"),l.stop().css({opacity:0,width:"100%",height:"100%"}).fadeTo(n.get.duration(),1,function(){l.removeAttr("style"),n.set.active(),b()}))},hide:function(b){b=b||function(){},n.remove.dimmed(),a.fn.transition!==d?(n.verbose("Hiding dimmer with css"),l.transition(o.transition+" out",n.get.duration(),function(){n.remove.active(),b()})):(n.verbose("Hiding dimmer with javascript"),l.stop().fadeOut(n.get.duration(),function(){l.removeAttr("style"),n.remove.active(),b()}))}},get:{dimmer:function(){return l},duration:function(){return"object"==typeof o.duration?n.is.active()?o.duration.hide:o.duration.show:o.duration}},has:{dimmer:function(){return x.children(p.dimmer).size()>0}},is:{dimmer:function(){return x.is(p.dimmer)},dimmable:function(){return x.is(p.dimmable)},active:function(){return l.hasClass(r.active)},animating:function(){return l.is(":animated")||l.hasClass(r.transition)},page:function(){return m.is("body")},enabled:function(){return!m.hasClass(r.disabled)},disabled:function(){return m.hasClass(r.disabled)},pageDimmer:function(){return l.hasClass(r.pageDimmer)}},can:{show:function(){return!l.hasClass(r.disabled)}},set:{active:function(){l.removeClass(r.transition).addClass(r.active)},dimmable:function(){m.addClass(r.dimmable)},dimmed:function(){m.addClass(r.dimmed)},pageDimmer:function(){l.addClass(r.pageDimmer)},disabled:function(){l.addClass(r.disabled)}},remove:{active:function(){l.removeClass(r.transition).removeClass(r.active)},dimmed:function(){m.removeClass(r.dimmed)},disabled:function(){l.removeClass(r.disabled)}},show:function(b){n.debug("Showing dimmer",l,o),n.is.active()||n.is.animating()||!n.is.enabled()?n.debug("Dimmer is already shown or disabled"):(n.animate.show(b),a.proxy(o.onShow,y)(),a.proxy(o.onChange,y)())},hide:function(b){n.is.active()&&!n.is.animating()?(n.debug("Hiding dimmer",l),n.animate.hide(b),a.proxy(o.onHide,y)(),a.proxy(o.onChange,y)()):n.debug("Dimmer is not visible")},toggle:function(){n.verbose("Toggling dimmer visibility",l),n.is.active()?n.hide():n.show()},setting:function(b,c){return c===d?o[b]:(a.isPlainObject(b)?a.extend(!0,o,b):o[b]=c,void 0)},internal:function(b,c){return c===d?n[b]:(a.isPlainObject(b)?a.extend(!0,n,b):n[b]=c,void 0)},debug:function(){o.debug&&(o.performance?n.performance.log(arguments):(n.debug=Function.prototype.bind.call(console.info,console,o.name+":"),n.debug.apply(console,arguments)))},verbose:function(){o.verbose&&o.debug&&(o.performance?n.performance.log(arguments):(n.verbose=Function.prototype.bind.call(console.info,console,o.name+":"),n.verbose.apply(console,arguments)))},error:function(){n.error=Function.prototype.bind.call(console.error,console,o.name+":"),n.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;o.performance&&(b=(new Date).getTime(),d=g||b,c=b-d,g=b,h.push({Element:y,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(n.performance.timer),n.performance.timer=setTimeout(n.performance.display,100)},display:function(){var b=o.name+":",c=0;g=!1,clearTimeout(n.performance.timer),a.each(h,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",v&&(b+=" '"+v+"'"),f.size()>1&&(b+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&h.length>0&&(console.groupCollapsed(b),console.table?console.table(h):a.each(h,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(b,c,f){var g,h,i;return c=c||k,f=y||f,"string"==typeof b&&z!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(z[e])&&c!=g)z=z[e];else{if(!a.isPlainObject(z[f])||c==g)return z[e]!==d?(h=z[e],!1):z[f]!==d?(h=z[f],!1):(n.error(s.method),!1);z=z[f]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):"string"==typeof e?e=[e,i]:i!==d&&(e=i),h}},n.preinitialize(),j?(z===d&&n.initialize(),n.invoke(i)):(z!==d&&n.destroy(),n.initialize())}),e!==d?e:this},a.fn.dimmer.settings={name:"Dimmer",namespace:"dimmer",verbose:!0,debug:!0,performance:!0,transition:"fade",on:!1,closable:!0,duration:{show:500,hide:500},onChange:function(){},onShow:function(){},onHide:function(){},error:{method:"The method you called is not defined."},selector:{dimmable:".ui.dimmable",dimmer:".ui.dimmer",content:".ui.dimmer > .content, .ui.dimmer > .content > .center"},template:{dimmer:function(){return a("<div />").attr("class","ui dimmer")}},className:{active:"active",dimmable:"ui dimmable",dimmed:"dimmed",disabled:"disabled",pageDimmer:"page",hide:"hide",show:"show",transition:"transition"}}}(jQuery,window,document),function(a,b,c,d){a.fn.dropdown=function(b){var e,f=a(this),g=a(c),h=f.selector||"",i="ontouchstart"in c.documentElement,j=(new Date).getTime(),k=[],l=arguments[0],m="string"==typeof l,n=[].slice.call(arguments,1);return f.each(function(){var c,o=a.isPlainObject(b)?a.extend(!0,{},a.fn.dropdown.settings,b):a.extend({},a.fn.dropdown.settings),p=o.className,q=o.metadata,r=o.namespace,s=o.selector,t=o.error,u="."+r,v="module-"+r,w=a(this),x=w.find(s.item),y=w.find(s.text),z=w.find(s.input),A=w.children(s.menu),B=this,C=w.data(v);c={initialize:function(){c.debug("Initializing dropdown",o),c.set.selected(),i&&c.bind.touchEvents(),c.bind.mouseEvents(),g.one("mousemove"+u,c.set.hasMouse),c.instantiate()},instantiate:function(){c.verbose("Storing instance of dropdown",c),C=c,w.data(v,c)},destroy:function(){c.verbose("Destroying previous dropdown for",w),x.off(u),w.off(u).removeData(v)},bind:{touchEvents:function(){c.debug("Touch device detected binding touch events"),w.on("touchstart"+u,c.event.test.toggle),x.on("touchstart"+u,c.event.item.mouseenter).on("touchstart"+u,c.event.item.click)},mouseEvents:function(){c.verbose("Mouse detected binding mouse events"),"click"==o.on?w.on("click"+u,c.event.test.toggle):"hover"==o.on?w.on("mouseenter"+u,c.delay.show).on("mouseleave"+u,c.delay.hide):w.on(o.on+u,c.toggle),x.on("mouseenter"+u,c.event.item.mouseenter).on("mouseleave"+u,c.event.item.mouseleave).on("click"+u,c.event.item.click)},intent:function(){c.verbose("Binding hide intent event to document"),i&&g.on("touchstart"+u,c.event.test.touch).on("touchmove"+u,c.event.test.touch),g.on("click"+u,c.event.test.hide)}},unbind:{intent:function(){c.verbose("Removing hide intent event from document"),i&&g.off("touchstart"+u),g.off("click"+u)}},event:{test:{toggle:function(a){c.determine.intent(a,c.toggle),a.preventDefault(),a.stopImmediatePropagation()},touch:function(a){c.determine.intent(a,function(){"touchstart"==a.type?c.timer=setTimeout(c.hide,50):"touchmove"==a.type&&clearTimeout(c.timer)}),a.stopPropagation()},hide:function(a){c.determine.intent(a,c.hide),a.stopPropagation()}},item:{mouseenter:function(b){var d=a(this).find(s.menu),e=a(this).siblings(s.item).children(s.menu);d.size()>0&&(clearTimeout(c.itemTimer),c.itemTimer=setTimeout(function(){c.animate.hide(!1,e),c.verbose("Showing sub-menu",d),c.animate.show(!1,d)},2*o.delay.show),b.preventDefault())},mouseleave:function(){var b=a(this).find(s.menu);b.size()>0&&(clearTimeout(c.itemTimer),c.itemTimer=setTimeout(function(){c.verbose("Hiding sub-menu",b),c.animate.hide(!1,b)},o.delay.hide))},click:function(b){var d=a(this),e=d.data(q.text)||d.text(),f=d.data(q.value)||e.toLowerCase();0===d.find(s.menu).size()&&(c.determine.selectAction(e,f),a.proxy(o.onChange,B)(f,e),b.preventDefault())}},resetStyle:function(){a(this).removeAttr("style")}},determine:{selectAction:function(b,d){c.verbose("Determining action",o.action),a.isFunction(c.action[o.action])?(c.verbose("Triggering preset action",o.action,b,d),c.action[o.action](b,d)):a.isFunction(o.action)?(c.verbose("Triggering user action",o.action,b,d),o.action(b,d)):c.error(t.action)},intent:function(b,d){c.debug("Determining whether event occurred in dropdown",b.target),d=d||function(){},0===a(b.target).closest(A).size()?(c.verbose("Triggering event",d),d()):c.verbose("Event occurred in dropdown, canceling callback")}},action:{nothing:function(){},hide:function(){c.hide()},activate:function(a,b){b=b||a,c.set.selected(b),c.set.value(b),c.hide()},auto:function(a,b){b=b||a,c.set.selected(b),c.set.value(b),c.hide()},changeText:function(a,b){b=b||a,c.set.selected(b),c.hide()},updateForm:function(a,b){b=b||a,c.set.selected(b),c.set.value(b),c.hide()}},get:{text:function(){return y.text()},value:function(){return z.val()},item:function(b){var d;return b=b||c.get.value()||c.get.text(),b?x.each(function(){var c=a(this),e=c.data(q.text)||c.text(),f=c.data(q.value)||e.toLowerCase();return f==b||e==b?(d=a(this),!1):void 0}):b=c.get.text(),d||!1}},set:{text:function(a){c.debug("Changing text",a,y),y.removeClass(p.placeholder),y.text(a)},value:function(a){c.debug("Adding selected value to hidden input",a,z),z.val(a)},active:function(){w.addClass(p.active)},visible:function(){w.addClass(p.visible)},selected:function(a){var b,d=c.get.item(a);d&&(c.debug("Setting selected menu item to",d),b=d.data(q.text)||d.text(),x.removeClass(p.active),d.addClass(p.active),c.set.text(b))}},remove:{active:function(){w.removeClass(p.active)},visible:function(){w.removeClass(p.visible)}},is:{selection:function(){return w.hasClass(p.selection)},visible:function(a){return a?a.is(":animated, :visible"):A.is(":animated, :visible")},hidden:function(a){return a?a.is(":not(:animated, :visible)"):A.is(":not(:animated, :visible)")}},can:{click:function(){return i||"click"==o.on},show:function(){return!w.hasClass(p.disabled)}},animate:{show:function(b,e){var f=e||A;b=b||function(){},c.is.hidden(f)&&(c.verbose("Doing menu show animation",f),"none"==o.transition?b():a.fn.transition!==d?f.transition({animation:o.transition+" in",duration:o.duration,complete:b,queue:!1}):"slide down"==o.transition?f.hide().clearQueue().children().clearQueue().css("opacity",0).delay(50).animate({opacity:1},o.duration,"easeOutQuad",c.event.resetStyle).end().slideDown(100,"easeOutQuad",function(){a.proxy(c.event.resetStyle,this)(),b()}):"fade"==o.transition?f.hide().clearQueue().fadeIn(o.duration,function(){a.proxy(c.event.resetStyle,this)(),b()}):c.error(t.transition))},hide:function(b,e){var f=e||A;b=b||function(){},c.is.visible(f)&&(c.verbose("Doing menu hide animation",f),a.fn.transition!==d?f.transition({animation:o.transition+" out",duration:o.duration,complete:b,queue:!1}):"none"==o.transition?b():"slide down"==o.transition?f.show().clearQueue().children().clearQueue().css("opacity",1).animate({opacity:0},100,"easeOutQuad",c.event.resetStyle).end().delay(50).slideUp(100,"easeOutQuad",function(){a.proxy(c.event.resetStyle,this)(),b()}):"fade"==o.transition?f.show().clearQueue().fadeOut(150,function(){a.proxy(c.event.resetStyle,this)(),b()}):c.error(t.transition))}},show:function(){c.debug("Checking if dropdown can show"),c.is.hidden()&&(c.hideOthers(),c.set.active(),c.animate.show(c.set.visible),c.can.click()&&c.bind.intent(),a.proxy(o.onShow,B)())},hide:function(){c.is.visible()&&(c.debug("Hiding dropdown"),c.can.click()&&c.unbind.intent(),c.remove.active(),c.animate.hide(c.remove.visible),a.proxy(o.onHide,B)())},delay:{show:function(){c.verbose("Delaying show event to ensure user intent"),clearTimeout(c.timer),c.timer=setTimeout(c.show,o.delay.show)},hide:function(){c.verbose("Delaying hide event to ensure user intent"),clearTimeout(c.timer),c.timer=setTimeout(c.hide,o.delay.hide)}},hideOthers:function(){c.verbose("Finding other dropdowns to hide"),f.not(w).has(s.menu+":visible").dropdown("hide")},toggle:function(){c.verbose("Toggling menu visibility"),c.is.hidden()?c.show():c.hide()},setting:function(b,c){return c===d?o[b]:(a.isPlainObject(b)?a.extend(!0,o,b):o[b]=c,void 0)},internal:function(b,e){return e===d?c[b]:(a.isPlainObject(b)?a.extend(!0,c,b):c[b]=e,void 0)},debug:function(){o.debug&&(o.performance?c.performance.log(arguments):(c.debug=Function.prototype.bind.call(console.info,console,o.name+":"),c.debug.apply(console,arguments)))},verbose:function(){o.verbose&&o.debug&&(o.performance?c.performance.log(arguments):(c.verbose=Function.prototype.bind.call(console.info,console,o.name+":"),c.verbose.apply(console,arguments)))},error:function(){c.error=Function.prototype.bind.call(console.error,console,o.name+":"),c.error.apply(console,arguments)},performance:{log:function(a){var b,d,e;o.performance&&(b=(new Date).getTime(),e=j||b,d=b-e,j=b,k.push({Element:B,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(c.performance.timer),c.performance.timer=setTimeout(c.performance.display,100)},display:function(){var b=o.name+":",e=0;j=!1,clearTimeout(c.performance.timer),a.each(k,function(a,b){e+=b["Execution Time"]}),b+=" "+e+"ms",h&&(b+=" '"+h+"'"),(console.group!==d||console.table!==d)&&k.length>0&&(console.groupCollapsed(b),console.table?console.table(k):a.each(k,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),k=[]}},invoke:function(b,f,g){var h,i,j;return f=f||n,g=B||g,"string"==typeof b&&C!==d&&(b=b.split(/[\. ]/),h=b.length-1,a.each(b,function(e,f){var g=e!=h?f+b[e+1].charAt(0).toUpperCase()+b[e+1].slice(1):b;if(a.isPlainObject(C[f])&&e!=h)C=C[f];else{if(!a.isPlainObject(C[g])||e==h)return C[f]!==d?(i=C[f],!1):C[g]!==d?(i=C[g],!1):(c.error(t.method),!1);C=C[g]}})),a.isFunction(i)?j=i.apply(g,f):i!==d&&(j=i),a.isArray(e)?e.push(j):"string"==typeof e?e=[e,j]:j!==d&&(e=j),i}},m?(C===d&&c.initialize(),c.invoke(l)):(C!==d&&c.destroy(),c.initialize())}),e?e:this},a.fn.dropdown.settings={name:"Dropdown",namespace:"dropdown",verbose:!0,debug:!0,performance:!0,on:"click",action:"activate",delay:{show:200,hide:300},transition:"slide down",duration:250,onChange:function(){},onShow:function(){},onHide:function(){},error:{action:"You called a dropdown action that was not defined",method:"The method you called is not defined.",transition:"The requested transition was not found"},metadata:{text:"text",value:"value"},selector:{menu:".menu",item:".menu > .item",text:"> .text",input:'> input[type="hidden"]'},className:{active:"active",placeholder:"default",disabled:"disabled",visible:"visible",selection:"selection"}}}(jQuery,window,document),function(a,b,c,d){a.fn.modal=function(e){var f,g=a(this),h=a(b),i=a(c),j=(new Date).getTime(),k=[],l=arguments[0],m="string"==typeof l,n=[].slice.call(arguments,1);return g.each(function(){var o,p,q,r,s=a.isPlainObject(e)?a.extend(!0,{},a.fn.modal.settings,e):a.extend({},a.fn.modal.settings),t=s.selector,u=s.className,v=s.namespace,w=s.error,x="."+v,y="module-"+v,z=g.selector||"",A=a(this),B=a(s.context),C=g.not(A),D=A.find(t.close),E=this,F=A.data(y);r={initialize:function(){r.verbose("Initializing dimmer",B),p=B.dimmer("add content",A),q=B.dimmer("get dimmer"),r.verbose("Attaching close events",D),D.on("click"+x,r.event.close),h.on("resize",function(){r.event.debounce(r.refresh,50)}),r.instantiate()},instantiate:function(){r.verbose("Storing instance of modal"),F=r,A.data(y,F)},destroy:function(){r.verbose("Destroying previous modal"),A.removeData(y).off(x),D.off(x),B.dimmer("destroy")},refresh:function(){r.remove.scrolling(),r.cacheSizes(),r.set.type(),r.set.position()},attachEvents:function(b,c){var d=a(b);c=a.isFunction(r[c])?r[c]:r.toggle,d.size()>0?(r.debug("Attaching modal events to element",b,c),d.off(x).on("click"+x,c)):r.error(w.notFound)},event:{close:function(){r.verbose("Closing element pressed"),a(this).is(t.approve)&&a.proxy(s.onApprove,E)(),a(this).is(t.deny)&&a.proxy(s.onDeny,E)(),r.hide()},click:function(a){r.verbose("Determining if event occured on dimmer",a),0===q.find(a.target).size()&&(r.hide(),a.stopImmediatePropagation())},debounce:function(a,b){clearTimeout(r.timer),r.timer=setTimeout(a,b)},keyboard:function(a){var b=a.which,c=27;b==c&&(r.debug("Escape key pressed hiding modal"),r.hide(),a.preventDefault())},resize:function(){p.dimmer("is active")&&r.refresh()}},toggle:function(){r.is.active()?r.hide():r.show()},show:function(){r.showDimmer(),r.cacheSizes(),r.set.position(),r.hideAll(),s.transition&&a.fn.transition!==d?A.transition(s.transition+" in",s.duration,r.set.active):A.fadeIn(s.duration,s.easing,r.set.active),r.debug("Triggering dimmer"),a.proxy(s.onShow,E)()},showDimmer:function(){r.debug("Showing modal"),r.set.dimmerSettings(),p.dimmer("show")},hide:function(){s.closable&&q.off("click"+x),p.dimmer("is active")&&p.dimmer("hide"),r.is.active()?(r.hideModal(),a.proxy(s.onHide,E)()):r.debug("Cannot hide modal, modal is not visible")},hideDimmer:function(){r.debug("Hiding dimmer"),p.dimmer("hide")},hideModal:function(){r.debug("Hiding modal"),r.remove.keyboardShortcuts(),s.transition&&a.fn.transition!==d?A.transition(s.transition+" out",s.duration,function(){r.remove.active(),r.restore.focus()}):A.fadeOut(s.duration,s.easing,function(){r.remove.active(),r.restore.focus()})},hideAll:function(){C.filter(":visible").modal("hide")},add:{keyboardShortcuts:function(){r.verbose("Adding keyboard shortcuts"),i.on("keyup"+x,r.event.keyboard)}},save:{focus:function(){o=a(c.activeElement).blur()}},restore:{focus:function(){o.size()>0&&o.focus()}},remove:{active:function(){A.removeClass(u.active)},keyboardShortcuts:function(){r.verbose("Removing keyboard shortcuts"),i.off("keyup"+x)},scrolling:function(){p.removeClass(u.scrolling),A.removeClass(u.scrolling)}},cacheSizes:function(){r.cache={height:A.outerHeight()+s.offset,contextHeight:"body"==s.context?a(b).height():p.height()},r.debug("Caching modal and container sizes",r.cache)},can:{fit:function(){return r.cache.height<r.cache.contextHeight}},is:{active:function(){return A.hasClass(u.active)}},set:{active:function(){r.add.keyboardShortcuts(),r.save.focus(),r.set.type(),A.addClass(u.active),s.closable&&q.on("click"+x,r.event.click)},dimmerSettings:function(){r.debug("Setting dimmer settings",p),p.dimmer({closable:!1,show:.95*s.duration,hide:1.05*s.duration})},scrolling:function(){p.addClass(u.scrolling),A.addClass(u.scrolling)},type:function(){r.can.fit()?(r.verbose("Modal fits on screen"),r.remove.scrolling()):(r.verbose("Modal cannot fit on screen setting to scrolling"),r.set.scrolling())},position:function(){r.verbose("Centering modal on page",r.cache,r.cache.height/2),r.can.fit()?A.css({top:"",marginTop:-(r.cache.height/2)}):A.css({marginTop:"1em",top:i.scrollTop()})}},setting:function(b,c){return c===d?s[b]:(a.isPlainObject(b)?a.extend(!0,s,b):s[b]=c,void 0)},internal:function(b,c){return c===d?r[b]:(a.isPlainObject(b)?a.extend(!0,r,b):r[b]=c,void 0)},debug:function(){s.debug&&(s.performance?r.performance.log(arguments):(r.debug=Function.prototype.bind.call(console.info,console,s.name+":"),r.debug.apply(console,arguments)))},verbose:function(){s.verbose&&s.debug&&(s.performance?r.performance.log(arguments):(r.verbose=Function.prototype.bind.call(console.info,console,s.name+":"),r.verbose.apply(console,arguments)))},error:function(){r.error=Function.prototype.bind.call(console.error,console,s.name+":"),r.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;s.performance&&(b=(new Date).getTime(),d=j||b,c=b-d,j=b,k.push({Element:E,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(r.performance.timer),r.performance.timer=setTimeout(r.performance.display,100)},display:function(){var b=s.name+":",c=0;j=!1,clearTimeout(r.performance.timer),a.each(k,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",z&&(b+=" '"+z+"'"),(console.group!==d||console.table!==d)&&k.length>0&&(console.groupCollapsed(b),console.table?console.table(k):a.each(k,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),k=[]
}},invoke:function(b,c,e){var g,h,i;return c=c||n,e=E||e,"string"==typeof b&&F!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(F[e])&&c!=g)F=F[e];else{if(!a.isPlainObject(F[f])||c==g)return F[e]!==d?(h=F[e],!1):F[f]!==d?(h=F[f],!1):(r.error(w.method),!1);F=F[f]}})),a.isFunction(h)?i=h.apply(e,c):h!==d&&(i=h),a.isArray(f)?f.push(i):"string"==typeof f?f=[f,i]:i!==d&&(f=i),h}},m?(F===d&&r.initialize(),r.invoke(l)):(F!==d&&r.destroy(),r.initialize())}),f!==d?f:this},a.fn.modal.settings={name:"Modal",namespace:"modal",verbose:!0,debug:!0,performance:!0,closable:!0,context:"body",duration:500,easing:"easeOutExpo",offset:0,transition:"scale",onShow:function(){},onHide:function(){},onApprove:function(){console.log("approved")},onDeny:function(){console.log("denied")},selector:{close:".close, .actions .button",approve:".actions .positive, .actions .approve",deny:".actions .negative, .actions .cancel"},error:{method:"The method you called is not defined."},className:{active:"active",scrolling:"scrolling"}}}(jQuery,window,document),function(a,b,c,d){a.fn.nag=function(c){var e,f=a(this),g=f.selector||"",h=(new Date).getTime(),i=[],j=arguments[0],k="string"==typeof j,l=[].slice.call(arguments,1);return a(this).each(function(){var m,n,o,p,q,r,s,t,u,v=a.extend(!0,{},a.fn.nag.settings,c),w=v.className,x=v.selector,y=v.error,z=v.namespace,A="."+z,B=z+"-module",C=a(this),D=C.find(x.close),E=a(v.context),F=this,G=C.data(B),H=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)};u={initialize:function(){u.verbose("Initializing element"),m=C.offset(),n=C.outerHeight(),o=E.outerWidth(),p=E.outerHeight(),q=E.offset(),C.data(B,u),D.on("click"+A,u.dismiss),v.context==b&&"fixed"==v.position&&C.addClass(w.fixed),v.sticky&&(u.verbose("Adding scroll events"),"absolute"==v.position?E.on("scroll"+A,u.event.scroll).on("resize"+A,u.event.scroll):a(b).on("scroll"+A,u.event.scroll).on("resize"+A,u.event.scroll),a.proxy(u.event.scroll,this)()),v.displayTime>0&&setTimeout(u.hide,v.displayTime),u.should.show()?C.is(":visible")||u.show():u.hide()},destroy:function(){u.verbose("Destroying instance"),C.removeData(B).off(A),v.sticky&&E.off(A)},refresh:function(){u.debug("Refreshing cached calculations"),m=C.offset(),n=C.outerHeight(),o=E.outerWidth(),p=E.outerHeight(),q=E.offset()},show:function(){u.debug("Showing nag",v.animation.show),"fade"==v.animation.show?C.fadeIn(v.duration,v.easing):C.slideDown(v.duration,v.easing)},hide:function(){u.debug("Showing nag",v.animation.hide),"fade"==v.animation.show?C.fadeIn(v.duration,v.easing):C.slideUp(v.duration,v.easing)},onHide:function(){u.debug("Removing nag",v.animation.hide),C.remove(),v.onHide&&v.onHide()},stick:function(){if(u.refresh(),"fixed"==v.position){var c=a(b).prop("pageYOffset")||a(b).scrollTop(),d=C.hasClass(w.bottom)?q.top+(p-n)-c:q.top-c;C.css({position:"fixed",top:d,left:q.left,width:o-v.scrollBarWidth})}else C.css({top:s})},unStick:function(){C.css({top:""})},dismiss:function(a){v.storageMethod&&u.storage.set(v.storedKey,v.storedValue),u.hide(),a.stopImmediatePropagation(),a.preventDefault()},should:{show:function(){return v.persist?(u.debug("Persistent nag is set, can show nag"),!0):u.storage.get(v.storedKey)!=v.storedValue?(u.debug("Stored value is not set, can show nag",u.storage.get(v.storedKey)),!0):(u.debug("Stored value is set, cannot show nag",u.storage.get(v.storedKey)),!1)},stick:function(){return r=E.prop("pageYOffset")||E.scrollTop(),s=C.hasClass(w.bottom)?p-C.outerHeight()+r:r,s>m.top?!0:"fixed"==v.position?!0:!1}},storage:{set:function(c,e){u.debug("Setting stored value",c,e,v.storageMethod),"local"==v.storageMethod&&b.store!==d?b.store.set(c,e):a.cookie!==d?a.cookie(c,e):u.error(y.noStorage)},get:function(c){return u.debug("Getting stored value",c,v.storageMethod),"local"==v.storageMethod&&b.store!==d?b.store.get(c):a.cookie!==d?a.cookie(c):(u.error(y.noStorage),void 0)}},event:{scroll:function(){t!==d&&clearTimeout(t),t=setTimeout(function(){u.should.stick()?H(u.stick):u.unStick()},v.lag)}},setting:function(b,c){return u.debug("Changing setting",b,c),c===d?v[b]:(a.isPlainObject(b)?a.extend(!0,v,b):v[b]=c,void 0)},internal:function(b,c){return u.debug("Changing internal",b,c),c===d?u[b]:(a.isPlainObject(b)?a.extend(!0,u,b):u[b]=c,void 0)},debug:function(){v.debug&&(v.performance?u.performance.log(arguments):(u.debug=Function.prototype.bind.call(console.info,console,v.name+":"),u.debug.apply(console,arguments)))},verbose:function(){v.verbose&&v.debug&&(v.performance?u.performance.log(arguments):(u.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),u.verbose.apply(console,arguments)))},error:function(){u.error=Function.prototype.bind.call(console.error,console,v.name+":"),u.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;v.performance&&(b=(new Date).getTime(),d=h||b,c=b-d,h=b,i.push({Element:F,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(u.performance.timer),u.performance.timer=setTimeout(u.performance.display,100)},display:function(){var b=v.name+":",c=0;h=!1,clearTimeout(u.performance.timer),a.each(i,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",g&&(b+=" '"+g+"'"),f.size()>1&&(b+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(b),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,c,f){var g,h,i;return c=c||l,f=F||f,"string"==typeof b&&G!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(G[e])&&c!=g)G=G[e];else{if(!a.isPlainObject(G[f])||c==g)return G[e]!==d?(h=G[e],!1):G[f]!==d?(h=G[f],!1):(u.error(y.method),!1);G=G[f]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):"string"==typeof e?e=[e,i]:i!==d&&(e=i),h}},k?(G===d&&u.initialize(),u.invoke(j)):(G!==d&&u.destroy(),u.initialize())}),e!==d?e:this},a.fn.nag.settings={name:"Nag",verbose:!0,debug:!0,performance:!0,namespace:"Nag",persist:!1,displayTime:0,animation:{show:"slide",hide:"slide"},position:"fixed",scrollBarWidth:18,storageMethod:"cookie",storedKey:"nag",storedValue:"dismiss",sticky:!1,lag:0,context:b,error:{noStorage:"Neither $.cookie or store is defined. A storage solution is required for storing state",method:"The method you called is not defined."},className:{bottom:"bottom",fixed:"fixed"},selector:{close:".icon.close"},speed:500,easing:"easeOutQuad",onHide:function(){}}}(jQuery,window,document),function(a,b,c,d){a.fn.popup=function(e){var f,g=a(this),h=a(c),i=g.selector||"",j=(new Date).getTime(),k=[],l=arguments[0],m="string"==typeof l,n=[].slice.call(arguments,1);return g.each(function(){var c,g=a.isPlainObject(e)?a.extend(!0,{},a.fn.popup.settings,e):a.extend({},a.fn.popup.settings),o=g.selector,p=g.className,q=g.error,r=g.metadata,s=g.namespace,t="."+g.namespace,u="module-"+s,v=a(this),w=a(b),x=v.offsetParent(),y=g.inline?v.next(g.selector.popup):w.children(g.selector.popup).last(),z=0,A=this,B=v.data(u);c={initialize:function(){c.debug("Initializing module",v),"hover"==g.on?v.on("mouseenter"+t,c.event.mouseenter).on("mouseleave"+t,c.event.mouseleave):v.on(g.on+""+t,c.event[g.on]),w.on("resize"+t,c.event.resize),c.instantiate()},instantiate:function(){c.verbose("Storing instance of module",c),B=c,v.data(u,B)},refresh:function(){y=g.inline?v.next(o.popup):w.children(o.popup).last(),x=v.offsetParent()},destroy:function(){c.debug("Destroying previous module"),w.off(t),v.off(t).removeData(u)},event:{mouseenter:function(b){var d=this;c.timer=setTimeout(function(){a.proxy(c.toggle,d)(),a(d).hasClass(p.visible)&&b.stopPropagation()},g.delay)},mouseleave:function(){clearTimeout(c.timer),v.is(":visible")&&c.hide()},click:function(b){a.proxy(c.toggle,this)(),a(this).hasClass(p.visible)&&b.stopPropagation()},resize:function(){y.is(":visible")&&c.position()}},create:function(){c.debug("Creating pop-up html");var b=v.data(r.html)||g.html,d=v.data(r.variation)||g.variation,e=v.data(r.title)||g.title,f=v.data(r.content)||v.attr("title")||g.content;b||f||e?(b||(b=g.template({title:e,content:f})),y=a("<div/>").addClass(p.popup).addClass(d).html(b),g.inline?(c.verbose("Inserting popup element inline",y),y.insertAfter(v)):(c.verbose("Appending popup element to body",y),y.appendTo(a("body"))),a.proxy(g.onCreate,y)()):c.error(q.content)},remove:function(){c.debug("Removing popup"),y.remove()},get:{offstagePosition:function(){var d={top:a(b).scrollTop(),bottom:a(b).scrollTop()+a(b).height(),left:0,right:a(b).width()},e={width:y.width(),height:y.outerHeight(),position:y.offset()},f={},g=[];return e.position&&(f={top:e.position.top<d.top,bottom:e.position.top+e.height>d.bottom,right:e.position.left+e.width>d.right,left:e.position.left<d.left}),c.verbose("Checking if outside viewable area",e.position),a.each(f,function(a,b){b&&g.push(a)}),g.length>0?g.join(" "):!1},nextPosition:function(a){switch(a){case"top left":a="bottom left";break;case"bottom left":a="top right";break;case"top right":a="bottom right";break;case"bottom right":a="top center";break;case"top center":a="bottom center";break;case"bottom center":a="right center";break;case"right center":a="left center";break;case"left center":a="top center"}return a}},toggle:function(){v=a(this),c.debug("Toggling pop-up"),c.refresh(),v.hasClass(p.visible)||("click"==g.on&&c.hideAll(),c.show())},position:function(d,e){var f,h,i=(a(b).width(),a(b).height(),v.outerWidth()),j=v.outerHeight(),k=y.width(),l=y.outerHeight(),m=g.inline?v.position():v.offset(),n=g.inline?x.outerWidth():w.outerWidth(),o=g.inline?x.outerHeight():w.outerHeight();switch(d=d||v.data(r.position)||g.position,e=e||v.data(r.arrowOffset)||g.arrowOffset,c.debug("Calculating offset for position",d),d){case"top left":f={bottom:o-m.top+g.distanceAway,right:n-m.left-i-e,top:"auto",left:"auto"};break;case"top center":f={bottom:o-m.top+g.distanceAway,left:m.left+i/2-k/2+e,top:"auto",right:"auto"};break;case"top right":f={top:"auto",bottom:o-m.top+g.distanceAway,left:m.left+e};break;case"left center":f={top:m.top+j/2-l/2,right:n-m.left+g.distanceAway-e,left:"auto",bottom:"auto"};break;case"right center":f={top:m.top+j/2-l/2,left:m.left+i+g.distanceAway+e,bottom:"auto",right:"auto"};break;case"bottom left":f={top:m.top+j+g.distanceAway,right:n-m.left-i-e,left:"auto",bottom:"auto"};break;case"bottom center":f={top:m.top+j+g.distanceAway,left:m.left+i/2-k/2+e,bottom:"auto",right:"auto"};break;case"bottom right":f={top:m.top+j+g.distanceAway,left:m.left+e,bottom:"auto",right:"auto"}}return a.extend(f,{width:y.width()+1}),y.css(f).removeClass(p.position).addClass(d),h=c.get.offstagePosition(),h?(c.debug("Element is outside boundaries ",h),z<g.maxSearchDepth?(d=c.get.nextPosition(d),z++,c.debug("Trying new position: ",d),c.position(d)):(c.error(q.recursion),z=0,!1)):(c.debug("Position is on stage",d),z=0,!0)},show:function(){c.debug("Showing pop-up",g.transition),0===y.size()&&c.create(),c.position(),v.addClass(p.visible),g.transition&&a.fn.transition!==d?y.transition(g.transition+" in",g.duration):y.stop().fadeIn(g.duration,g.easing),"click"==g.on&&g.clicktoClose&&(c.debug("Binding popup close event"),h.on("click."+s,c.gracefully.hide)),a.proxy(g.onShow,y)()},hideAll:function(){a(o.popup).filter(":visible").popup("hide")},hide:function(){v.removeClass(p.visible),y.is(":visible")&&(c.debug("Hiding pop-up"),g.transition&&a.fn.transition!==d?y.transition(g.transition+" out",g.duration,c.reset):y.stop().fadeOut(g.duration,g.easing,c.reset)),"click"==g.on&&g.clicktoClose&&h.off("click."+s),a.proxy(g.onHide,y)()},reset:function(){c.verbose("Resetting inline styles"),y.attr("style","").removeAttr("style"),g.inline||c.remove()},gracefully:{hide:function(b){0===a(b.target).closest(o.popup).size()&&c.hide()}},setting:function(b,c){return c===d?g[b]:(a.isPlainObject(b)?a.extend(!0,g,b):g[b]=c,void 0)},internal:function(b,e){return e===d?c[b]:(a.isPlainObject(b)?a.extend(!0,c,b):c[b]=e,void 0)},debug:function(){g.debug&&(g.performance?c.performance.log(arguments):(c.debug=Function.prototype.bind.call(console.info,console,g.name+":"),c.debug.apply(console,arguments)))},verbose:function(){g.verbose&&g.debug&&(g.performance?c.performance.log(arguments):(c.verbose=Function.prototype.bind.call(console.info,console,g.name+":"),c.verbose.apply(console,arguments)))},error:function(){c.error=Function.prototype.bind.call(console.error,console,g.name+":"),c.error.apply(console,arguments)},performance:{log:function(a){var b,d,e;g.performance&&(b=(new Date).getTime(),e=j||b,d=b-e,j=b,k.push({Element:A,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(c.performance.timer),c.performance.timer=setTimeout(c.performance.display,100)},display:function(){var b=g.name+":",e=0;j=!1,clearTimeout(c.performance.timer),a.each(k,function(a,b){e+=b["Execution Time"]}),b+=" "+e+"ms",i&&(b+=" '"+i+"'"),(console.group!==d||console.table!==d)&&k.length>0&&(console.groupCollapsed(b),console.table?console.table(k):a.each(k,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),k=[]}},invoke:function(b,e,g){var h,i,j;return e=e||n,g=A||g,"string"==typeof b&&B!==d&&(b=b.split(/[\. ]/),h=b.length-1,a.each(b,function(e,f){var g=e!=h?f+b[e+1].charAt(0).toUpperCase()+b[e+1].slice(1):b;if(a.isPlainObject(B[f])&&e!=h)B=B[f];else{if(!a.isPlainObject(B[g])||e==h)return B[f]!==d?(i=B[f],!1):B[g]!==d?(i=B[g],!1):(c.error(q.method),!1);B=B[g]}})),a.isFunction(i)?j=i.apply(g,e):i!==d&&(j=i),a.isArray(f)?f.push(j):"string"==typeof f?f=[f,j]:j!==d&&(f=j),i}},m?(B===d&&c.initialize(),c.invoke(l)):(B!==d&&c.destroy(),c.initialize())}),f!==d?f:this},a.fn.popup.settings={name:"Popup",debug:!0,verbose:!0,performance:!0,namespace:"popup",onCreate:function(){},onShow:function(){},onHide:function(){},variation:"",content:!1,html:!1,title:!1,on:"hover",clicktoClose:!0,position:"top center",delay:150,inline:!0,duration:150,easing:"easeOutQuint",transition:"scale",distanceAway:0,arrowOffset:0,maxSearchDepth:10,error:{content:"Your popup has no content specified",method:"The method you called is not defined.",recursion:"Popup attempted to reposition element to fit, but could not find an adequate position."},metadata:{arrowOffset:"arrowOffset",content:"content",html:"html",position:"position",title:"title",variation:"variation"},className:{popup:"ui popup",visible:"visible",loading:"loading",position:"top left center bottom right"},selector:{popup:".ui.popup"},template:function(a){var b="";return typeof a!==d&&(typeof a.title!==d&&a.title&&(b+='<div class="header">'+a.title+'</div class="header">'),typeof a.content!==d&&a.content&&(b+='<div class="content">'+a.content+"</div>")),b}}}(jQuery,window,document),function(a,b,c,d){a.fn.rating=function(b){var c,e=a(this),f=e.selector||"",g=(new Date).getTime(),h=[],i=arguments[0],j="string"==typeof i,k=[].slice.call(arguments,1);return e.each(function(){var l,m=a.isPlainObject(b)?a.extend(!0,{},a.fn.rating.settings,b):a.extend({},a.fn.rating.settings),n=m.namespace,o=m.className,p=m.metadata,q=m.selector,r=m.error,s="."+n,t="module-"+n,u=this,v=a(this).data(t),w=a(this),x=w.find(q.icon);l={initialize:function(){l.verbose("Initializing rating module",m),m.interactive?l.enable():l.disable(),m.initialRating&&(l.debug("Setting initial rating"),l.setRating(m.initialRating)),w.data(p.rating)&&(l.debug("Rating found in metadata"),l.setRating(w.data(p.rating))),l.instantiate()},instantiate:function(){l.verbose("Instantiating module",m),v=l,w.data(t,l)},destroy:function(){l.verbose("Destroying previous instance",v),w.removeData(t),x.off(s)},event:{mouseenter:function(){var b=a(this);b.nextAll().removeClass(o.hover),w.addClass(o.hover),b.addClass(o.hover).prevAll().addClass(o.hover)},mouseleave:function(){w.removeClass(o.hover),x.removeClass(o.hover)},click:function(){var b=a(this),c=l.getRating(),d=x.index(b)+1;m.clearable&&c==d?l.clearRating():l.setRating(d)}},clearRating:function(){l.debug("Clearing current rating"),l.setRating(0)},getRating:function(){var a=x.filter("."+o.active).size();return l.verbose("Current rating retrieved",a),a},enable:function(){l.debug("Setting rating to interactive mode"),x.on("mouseenter"+s,l.event.mouseenter).on("mouseleave"+s,l.event.mouseleave).on("click"+s,l.event.click),w.addClass(o.active)},disable:function(){l.debug("Setting rating to read-only mode"),x.off(s),w.removeClass(o.active)},setRating:function(b){var c=b-1>=0?b-1:0,d=x.eq(c);w.removeClass(o.hover),x.removeClass(o.hover).removeClass(o.active),b>0&&(l.verbose("Setting current rating to",b),d.addClass(o.active).prevAll().addClass(o.active)),a.proxy(m.onRate,u)(b)},setting:function(b,c){return c===d?m[b]:(a.isPlainObject(b)?a.extend(!0,m,b):m[b]=c,void 0)},internal:function(b,c){return c===d?l[b]:(a.isPlainObject(b)?a.extend(!0,l,b):l[b]=c,void 0)},debug:function(){m.debug&&(m.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,m.name+":"),l.debug.apply(console,arguments)))},verbose:function(){m.verbose&&m.debug&&(m.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),l.verbose.apply(console,arguments)))},error:function(){l.error=Function.prototype.bind.call(console.error,console,m.name+":"),l.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;m.performance&&(b=(new Date).getTime(),d=g||b,c=b-d,g=b,h.push({Element:u,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(l.performance.timer),l.performance.timer=setTimeout(l.performance.display,100)},display:function(){var b=m.name+":",c=0;g=!1,clearTimeout(l.performance.timer),a.each(h,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",f&&(b+=" '"+f+"'"),e.size()>1&&(b+=" ("+e.size()+")"),(console.group!==d||console.table!==d)&&h.length>0&&(console.groupCollapsed(b),console.table?console.table(h):a.each(h,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(b,e,f){var g,h,i;return e=e||k,f=u||f,"string"==typeof b&&v!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(v[e])&&c!=g)v=v[e];else{if(!a.isPlainObject(v[f])||c==g)return v[e]!==d?(h=v[e],!1):v[f]!==d?(h=v[f],!1):(l.error(r.method),!1);v=v[f]}})),a.isFunction(h)?i=h.apply(f,e):h!==d&&(i=h),a.isArray(c)?c.push(i):"string"==typeof c?c=[c,i]:i!==d&&(c=i),h}},j?(v===d&&l.initialize(),l.invoke(i)):(v!==d&&l.destroy(),l.initialize())}),c!==d?c:this},a.fn.rating.settings={name:"Rating",namespace:"rating",verbose:!0,debug:!0,performance:!0,initialRating:0,interactive:!0,clearable:!1,onRate:function(){},error:{method:"The method you called is not defined"},metadata:{rating:"rating"},className:{active:"active",hover:"hover",loading:"loading"},selector:{icon:".icon"}}}(jQuery,window,document),function(a,b,c,d){a.fn.search=function(c,e){var f,g=a(this),h=g.selector||"",i=(new Date).getTime(),j=[],k=arguments[0],l="string"==typeof k,m=[].slice.call(arguments,1);return a(this).each(function(){var n,o=a.extend(!0,{},a.fn.search.settings,e),p=o.className,q=o.selector,r=o.error,s=o.namespace,t="."+s,u=s+"-module",v=a(this),w=v.find(q.prompt),x=v.find(q.searchButton),y=v.find(q.results),z=(v.find(q.result),v.find(q.category),this),A=v.data(u);n={initialize:function(){n.verbose("Initializing module");var a=w[0],b=a.oninput!==d?"input":a.onpropertychange!==d?"propertychange":"keyup";w.on("focus"+t,n.event.focus).on("blur"+t,n.event.blur).on("keydown"+t,n.handleKeyboard),o.automatic&&w.on(b+t,n.search.throttle),x.on("click"+t,n.search.query),y.on("click"+t,q.result,n.results.select),n.instantiate()},instantiate:function(){n.verbose("Storing instance of module",n),A=n,v.data(u,n)},destroy:function(){n.verbose("Destroying instance"),v.removeData(u)},event:{focus:function(){v.addClass(p.focus),n.results.show()},blur:function(){n.search.cancel(),v.removeClass(p.focus),n.results.hide()}},handleKeyboard:function(b){var c,d=v.find(q.result),e=v.find(q.category),f=b.which,g={backspace:8,enter:13,escape:27,upArrow:38,downArrow:40},h=p.active,i=d.index(d.filter("."+h)),j=d.size();if(f==g.escape&&(n.verbose("Escape key pressed, blurring search field"),w.trigger("blur")),y.filter(":visible").size()>0)if(f==g.enter){if(n.verbose("Enter key pressed, selecting active result"),d.filter("."+h).exists())return a.proxy(n.results.select,d.filter("."+h))(),b.preventDefault(),!1}else f==g.upArrow?(n.verbose("Up key pressed, changing active result"),c=0>i-1?i:i-1,e.removeClass(h),d.removeClass(h).eq(c).addClass(h).closest(e).addClass(h),b.preventDefault()):f==g.downArrow&&(n.verbose("Down key pressed, changing active result"),c=i+1>=j?i:i+1,e.removeClass(h),d.removeClass(h).eq(c).addClass(h).closest(e).addClass(h),b.preventDefault());else f==g.enter&&(n.verbose("Enter key pressed, executing query"),n.search.query(),x.addClass(p.down),w.one("keyup",function(){x.removeClass(p.down)}))},search:{cancel:function(){var a=v.data("xhr")||!1;a&&"resolved"!=a.state()&&(n.debug("Cancelling last search"),a.abort())},throttle:function(){var a=w.val(),b=a.length;clearTimeout(n.timer),b>=o.minCharacters?n.timer=setTimeout(n.search.query,o.searchThrottle):n.results.hide()},query:function(){var b=w.val(),d=n.search.cache.read(b);d?(n.debug("Reading result for '"+b+"' from cache"),n.results.add(d)):(n.debug("Querying for '"+b+"'"),"object"==typeof c?n.search.local(b):n.search.remote(b),a.proxy(o.onSearchQuery,v)(b))},local:function(b){var d,e=[],f=[],g=a.isArray(o.searchFields)?o.searchFields:[o.searchFields],h=new RegExp("(?:s|^)"+b,"i"),i=new RegExp(b,"i");v.addClass(p.loading),a.each(g,function(b,d){a.each(c,function(b,c){"string"==typeof c[d]&&-1==a.inArray(c,e)&&-1==a.inArray(c,f)&&(h.test(c[d])?e.push(c):i.test(c[d])&&f.push(c))})}),d=n.results.generate({results:a.merge(e,f)}),v.removeClass(p.loading),n.search.cache.write(b,d),n.results.add(d)},remote:function(b){var d,e={stateContext:v,url:c,urlData:{query:b},success:function(a){d=n.results.generate(a),n.search.cache.write(b,d),n.results.add(d)},failure:n.error};n.search.cancel(),n.debug("Executing search"),a.extend(!0,e,o.apiSettings),a.api(e)},cache:{read:function(a){var b=v.data("cache");return o.cache&&"object"==typeof b&&b[a]!==d?b[a]:!1},write:function(a,b){var c=v.data("cache")!==d?v.data("cache"):{};c[a]=b,v.data("cache",c)}}},results:{generate:function(b){n.debug("Generating html from response",b);var c=o.templates[o.type],d="";return a.isPlainObject(b.results)&&!a.isEmptyObject(b.results)||a.isArray(b.results)&&b.results.length>0?(o.maxResults>0&&(b.results=a.makeArray(b.results).slice(0,o.maxResults)),b.results.length>0&&(a.isFunction(c)?d=c(b):n.error(r.noTemplate,!1))):d=n.message(r.noResults,"empty"),a.proxy(o.onResults,v)(b),d},add:function(b){("default"==o.onResultsAdd||"default"==a.proxy(o.onResultsAdd,y)(b))&&y.html(b),n.results.show()},show:function(){0===y.filter(":visible").size()&&w.filter(":focus").size()>0&&""!==y.html()&&(y.stop().fadeIn(200),a.proxy(o.onResultsOpen,y)())},hide:function(){y.filter(":visible").size()>0&&(y.stop().fadeOut(200),a.proxy(o.onResultsClose,y)())},select:function(c){n.debug("Search result selected");var d=a(this),e=d.find(".title"),f=e.html();if("default"==o.onSelect||"default"==a.proxy(o.onSelect,this)(c)){var g=d.find("a[href]").eq(0),h=g.attr("href")||!1,i=g.attr("target")||!1;n.results.hide(),w.val(f),h&&("_blank"==i||c.ctrlKey?b.open(h):b.location.href=h)}}},setting:function(b,c){return n.debug("Changing setting",b,c),c===d?o[b]:(a.isPlainObject(b)?a.extend(!0,o,b):o[b]=c,void 0)},internal:function(b,c){return n.debug("Changing internal",b,c),c===d?n[b]:(a.isPlainObject(b)?a.extend(!0,n,b):n[b]=c,void 0)},debug:function(){o.debug&&(o.performance?n.performance.log(arguments):(n.debug=Function.prototype.bind.call(console.info,console,o.name+":"),n.debug.apply(console,arguments)))},verbose:function(){o.verbose&&o.debug&&(o.performance?n.performance.log(arguments):(n.verbose=Function.prototype.bind.call(console.info,console,o.name+":"),n.verbose.apply(console,arguments)))},error:function(){n.error=Function.prototype.bind.call(console.error,console,o.name+":"),n.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;o.performance&&(b=(new Date).getTime(),d=i||b,c=b-d,i=b,j.push({Element:z,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(n.performance.timer),n.performance.timer=setTimeout(n.performance.display,100)},display:function(){var b=o.name+":",c=0;i=!1,clearTimeout(n.performance.timer),a.each(j,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",h&&(b+=" '"+h+"'"),g.size()>1&&(b+=" ("+g.size()+")"),(console.group!==d||console.table!==d)&&j.length>0&&(console.groupCollapsed(b),console.table?console.table(j):a.each(j,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),j=[]}},invoke:function(b,c,e){var g,h,i;return c=c||m,e=z||e,"string"==typeof b&&A!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(A[e])&&c!=g)A=A[e];else{if(!a.isPlainObject(A[f])||c==g)return A[e]!==d?(h=A[e],!1):A[f]!==d?(h=A[f],!1):(n.error(r.method),!1);A=A[f]}})),a.isFunction(h)?i=h.apply(e,c):h!==d&&(i=h),a.isArray(f)?f.push(i):"string"==typeof f?f=[f,i]:i!==d&&(f=i),h}},l?(A===d&&n.initialize(),n.invoke(k)):(A!==d&&n.destroy(),n.initialize())}),f!==d?f:this},a.fn.search.settings={name:"Search Module",namespace:"search",debug:!0,verbose:!0,performance:!0,onSelect:"default",onResultsAdd:"default",onSearchQuery:function(){},onResults:function(){},onResultsOpen:function(){},onResultsClose:function(){},automatic:"true",type:"simple",minCharacters:3,searchThrottle:300,maxResults:7,cache:!0,searchFields:["title","description"],apiSettings:{},className:{active:"active",down:"down",focus:"focus",empty:"empty",loading:"loading"},error:{noResults:"Your search returned no results",logging:"Error in debug logging, exiting.",noTemplate:"A valid template name was not specified.",serverError:"There was an issue with querying the server.",method:"The method you called is not defined."},selector:{prompt:".prompt",searchButton:".search.button",results:".results",category:".category",result:".result"},templates:{message:function(a,b){var c="";return a!==d&&b!==d&&(c+='<div class="message '+b+'">',c+="empty"==b?'<div class="header">No Results</div class="header"><div class="description">'+a+'</div class="description">':' <div class="description">'+a+"</div>",c+="</div>"),c},categories:function(b){var c="";return b.results!==d?(a.each(b.results,function(b,e){e.results!==d&&e.results.length>0&&(c+='<div class="category"><div class="name">'+e.name+"</div>",a.each(e.results,function(a,b){c+='<div class="result">',c+='<a href="'+b.url+'"></a>',b.image!==d&&(c+='<div class="image"> <img src="'+b.image+'">'+"</div>"),c+='<div class="info">',b.price!==d&&(c+='<div class="price">'+b.price+"</div>"),b.title!==d&&(c+='<div class="title">'+b.title+"</div>"),b.description!==d&&(c+='<div class="description">'+b.description+"</div>"),c+="</div></div>"}),c+="</div>")}),b.resultPage&&(c+='<a href="'+b.resultPage.url+'" class="all">'+b.resultPage.text+"</a>"),c):!1},simple:function(b){var c="";return b.results!==d?(a.each(b.results,function(a,b){c+='<a class="result" href="'+b.url+'">',b.image!==d&&(c+='<div class="image"> <img src="'+b.image+'">'+"</div>"),c+='<div class="info">',b.price!==d&&(c+='<div class="price">'+b.price+"</div>"),b.title!==d&&(c+='<div class="title">'+b.title+"</div>"),b.description!==d&&(c+='<div class="description">'+b.description+"</div>"),c+="</div></a>"}),b.resultPage&&(c+='<a href="'+b.resultPage.url+'" class="all">'+b.resultPage.text+"</a>"),c):!1}}}}(jQuery,window,document),function(a,b,c,d){a.fn.shape=function(b){var e,f=a(this),g=(new Date).getTime(),h=[],i=arguments[0],j="string"==typeof i,k=[].slice.call(arguments,1);return f.each(function(){var l,m,n,o=f.selector||"",p=a.extend(!0,{},a.fn.shape.settings,b),q=p.namespace,r=p.selector,s=p.error,t=p.className,u="."+q,v="module-"+q,w=a(this),x=w.find(r.sides),y=w.find(r.side),z=this,A=w.data(v);n={initialize:function(){n.verbose("Initializing module for",z),n.set.defaultSide(),n.instantiate()},instantiate:function(){n.verbose("Storing instance of module",n),A=n,w.data(v,A)},destroy:function(){n.verbose("Destroying previous module for",z),w.removeData(v).off(u)},refresh:function(){n.verbose("Refreshing selector cache for",z),w=a(z),x=a(this).find(r.shape),y=a(this).find(r.side)},repaint:function(){n.verbose("Forcing repaint event");var a=x.get(0)||c.createElement("div");a.offsetWidth},animate:function(a,b){n.verbose("Animating box with properties",a),b=b||function(a){n.verbose("Executing animation callback"),a!==d&&a.stopPropagation(),n.reset(),n.set.active()},p.useCSS?n.get.transitionEvent()?(n.verbose("Starting CSS animation"),w.addClass(t.animating),n.set.stageSize(),n.repaint(),w.addClass(t.css),l.addClass(t.hidden),x.css(a).one(n.get.transitionEvent(),b)):b():(n.verbose("Starting javascript animation"),w.addClass(t.animating).removeClass(t.css),n.set.stageSize(),n.repaint(),l.animate({opacity:0},p.duration,p.easing),x.animate(a,p.duration,p.easing,b))},queue:function(a){n.debug("Queueing animation of",a),x.one(n.get.transitionEvent(),function(){n.debug("Executing queued animation"),setTimeout(function(){w.shape(a)},0)})},reset:function(){n.verbose("Animating states reset"),w.removeClass(t.css).removeClass(t.animating).attr("style","").removeAttr("style"),x.attr("style","").removeAttr("style"),y.attr("style","").removeAttr("style").removeClass(t.hidden),m.removeClass(t.animating).attr("style","").removeAttr("style")},is:{animating:function(){return w.hasClass(t.animating)}},get:{transform:{up:function(){var a={y:-((l.outerHeight()-m.outerHeight())/2),z:-(l.outerHeight()/2)};return{transform:"translateY("+a.y+"px) translateZ("+a.z+"px) rotateX(-90deg)"}},down:function(){var a={y:-((l.outerHeight()-m.outerHeight())/2),z:-(l.outerHeight()/2)};return{transform:"translateY("+a.y+"px) translateZ("+a.z+"px) rotateX(90deg)"}},left:function(){var a={x:-((l.outerWidth()-m.outerWidth())/2),z:-(l.outerWidth()/2)};return{transform:"translateX("+a.x+"px) translateZ("+a.z+"px) rotateY(90deg)"}},right:function(){var a={x:-((l.outerWidth()-m.outerWidth())/2),z:-(l.outerWidth()/2)};return{transform:"translateX("+a.x+"px) translateZ("+a.z+"px) rotateY(-90deg)"}},over:function(){var a={x:-((l.outerWidth()-m.outerWidth())/2)};return{transform:"translateX("+a.x+"px) rotateY(180deg)"}},back:function(){var a={x:-((l.outerWidth()-m.outerWidth())/2)};return{transform:"translateX("+a.x+"px) rotateY(-180deg)"}}},transitionEvent:function(){var a,b=c.createElement("element"),e={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(a in e)if(b.style[a]!==d)return e[a]},nextSide:function(){return l.next(r.side).size()>0?l.next(r.side):w.find(r.side).first()}},set:{defaultSide:function(){l=w.find("."+p.className.active),m=l.next(r.side).size()>0?l.next(r.side):w.find(r.side).first(),n.verbose("Active side set to",l),n.verbose("Next side set to",m)},stageSize:function(){var a={width:m.outerWidth(),height:m.outerHeight()};n.verbose("Resizing stage to fit new content",a),w.css({width:a.width,height:a.height})},nextSide:function(a){m=w.find(a),0===m.size()&&n.error(s.side),n.verbose("Next side manually set to",m)},active:function(){n.verbose("Setting new side to active",m),y.removeClass(t.active),m.addClass(t.active),a.proxy(p.onChange,m)(),n.set.defaultSide()}},flip:{up:function(){n.debug("Flipping up",m),n.is.animating()?n.queue("flip up"):(n.stage.above(),n.animate(n.get.transform.up()))
},down:function(){n.debug("Flipping down",m),n.is.animating()?n.queue("flip down"):(n.stage.below(),n.animate(n.get.transform.down()))},left:function(){n.debug("Flipping left",m),n.is.animating()?n.queue("flip left"):(n.stage.left(),n.animate(n.get.transform.left()))},right:function(){n.debug("Flipping right",m),n.is.animating()?n.queue("flip right"):(n.stage.right(),n.animate(n.get.transform.right()))},over:function(){n.debug("Flipping over",m),n.is.animating()?n.queue("flip over"):(n.stage.behind(),n.animate(n.get.transform.over()))},back:function(){n.debug("Flipping back",m),n.is.animating()?n.queue("flip back"):(n.stage.behind(),n.animate(n.get.transform.back()))}},stage:{above:function(){var a={origin:(l.outerHeight()-m.outerHeight())/2,depth:{active:m.outerHeight()/2,next:l.outerHeight()/2}};n.verbose("Setting the initial animation position as above",m,a),l.css({transform:"rotateY(0deg) translateZ("+a.depth.active+"px)"}),m.addClass(t.animating).css({display:"block",top:a.origin+"px",transform:"rotateX(90deg) translateZ("+a.depth.next+"px)"})},below:function(){var a={origin:(l.outerHeight()-m.outerHeight())/2,depth:{active:m.outerHeight()/2,next:l.outerHeight()/2}};n.verbose("Setting the initial animation position as below",m,a),l.css({transform:"rotateY(0deg) translateZ("+a.depth.active+"px)"}),m.addClass(t.animating).css({display:"block",top:a.origin+"px",transform:"rotateX(-90deg) translateZ("+a.depth.next+"px)"})},left:function(){var a={origin:(l.outerWidth()-m.outerWidth())/2,depth:{active:m.outerWidth()/2,next:l.outerWidth()/2}};n.verbose("Setting the initial animation position as left",m,a),l.css({transform:"rotateY(0deg) translateZ("+a.depth.active+"px)"}),m.addClass(t.animating).css({display:"block",left:a.origin+"px",transform:"rotateY(-90deg) translateZ("+a.depth.next+"px)"})},right:function(){var a={origin:(l.outerWidth()-m.outerWidth())/2,depth:{active:m.outerWidth()/2,next:l.outerWidth()/2}};n.verbose("Setting the initial animation position as left",m,a),l.css({transform:"rotateY(0deg) translateZ("+a.depth.active+"px)"}),m.addClass(t.animating).css({display:"block",left:a.origin+"px",transform:"rotateY(90deg) translateZ("+a.depth.next+"px)"})},behind:function(){var a={origin:(l.outerWidth()-m.outerWidth())/2,depth:{active:m.outerWidth()/2,next:l.outerWidth()/2}};n.verbose("Setting the initial animation position as behind",m,a),l.css({transform:"rotateY(0deg)"}),m.addClass(t.animating).css({display:"block",left:a.origin+"px",transform:"rotateY(-180deg)"})}},setting:function(b,c){return c===d?p[b]:(a.isPlainObject(b)?a.extend(!0,p,b):p[b]=c,void 0)},internal:function(b,c){return c===d?n[b]:(a.isPlainObject(b)?a.extend(!0,n,b):n[b]=c,void 0)},debug:function(){p.debug&&(p.performance?n.performance.log(arguments):(n.debug=Function.prototype.bind.call(console.info,console,p.name+":"),n.debug.apply(console,arguments)))},verbose:function(){p.verbose&&p.debug&&(p.performance?n.performance.log(arguments):(n.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),n.verbose.apply(console,arguments)))},error:function(){n.error=Function.prototype.bind.call(console.error,console,p.name+":"),n.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;p.performance&&(b=(new Date).getTime(),d=g||b,c=b-d,g=b,h.push({Element:z,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(n.performance.timer),n.performance.timer=setTimeout(n.performance.display,100)},display:function(){var b=p.name+":",c=0;g=!1,clearTimeout(n.performance.timer),a.each(h,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",o&&(b+=" '"+o+"'"),f.size()>1&&(b+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&h.length>0&&(console.groupCollapsed(b),console.table?console.table(h):a.each(h,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(b,c,f){var g,h,i;return c=c||k,f=z||f,"string"==typeof b&&A!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(A[e])&&c!=g)A=A[e];else{if(!a.isPlainObject(A[f])||c==g)return A[e]!==d?(h=A[e],!1):A[f]!==d?(h=A[f],!1):(n.error(s.method),!1);A=A[f]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):"string"==typeof e?e=[e,i]:i!==d&&(e=i),h}},j?(A===d&&n.initialize(),n.invoke(i)):(A!==d&&n.destroy(),n.initialize())}),e!==d?e:this},a.fn.shape.settings={name:"Shape",debug:!0,verbose:!0,performance:!0,namespace:"shape",beforeChange:function(){},onChange:function(){},useCSS:!0,duration:1e3,easing:"easeInOutQuad",error:{side:"You tried to switch to a side that does not exist.",method:"The method you called is not defined"},className:{css:"css",animating:"animating",hidden:"hidden",active:"active"},selector:{sides:".sides",side:".side"}}}(jQuery,window,document),function(a,b,c,d){a.fn.sidebar=function(b){var e,f=a(this),g=f.selector||"",h=(new Date).getTime(),i=[],j=arguments[0],k="string"==typeof j,l=[].slice.call(arguments,1);return f.each(function(){var m,n=a.isPlainObject(b)?a.extend(!0,{},a.fn.sidebar.settings,b):a.extend({},a.fn.sidebar.settings),o=(n.selector,n.className),p=n.namespace,q=n.error,r="."+p,s="module-"+p,t=a(this),u=a("body"),v=a("head"),w=a("style[title="+p+"]"),x=this,y=t.data(s);m={initialize:function(){m.debug("Initializing sidebar",t),m.instantiate()},instantiate:function(){m.verbose("Storing instance of module",m),y=m,t.data(s,m)},destroy:function(){m.verbose("Destroying previous module for",t),t.off(r).removeData(s)},refresh:function(){m.verbose("Refreshing selector cache"),w=a("style[title="+p+"]")},attachEvents:function(b,c){var d=a(b);c=a.isFunction(m[c])?m[c]:m.toggle,d.size()>0?(m.debug("Attaching sidebar events to element",b,c),d.off(r).on("click"+r,c)):m.error(q.notFound)},show:function(){m.debug("Showing sidebar"),m.is.closed()?(n.overlay||m.pushPage(),m.set.active()):m.debug("Sidebar is already visible")},hide:function(){m.is.open()&&(n.overlay||(m.pullPage(),m.remove.pushed()),m.remove.active())},toggle:function(){m.is.closed()?m.show():m.hide()},pushPage:function(){var a=m.get.direction(),b=m.is.vertical()?t.outerHeight():t.outerWidth();n.useCSS?(m.debug("Using CSS to animate body"),m.add.bodyCSS(a,b),m.set.pushed()):m.animatePage(a,b,m.set.pushed)},pullPage:function(){var a=m.get.direction();n.useCSS?(m.debug("Resetting body position css"),m.remove.bodyCSS()):(m.debug("Resetting body position using javascript"),m.animatePage(a,0)),m.remove.pushed()},animatePage:function(a,b){var c={};c["padding-"+a]=b,m.debug("Using javascript to animate body",c),u.animate(c,n.duration,m.set.pushed)},add:{bodyCSS:function(a,b){var c;a!==o.bottom&&(c='<style title="'+p+'">'+"body.pushed {"+" margin-"+a+": "+b+"px !important;"+"}"+"</style>"),v.append(c),m.debug("Adding body css to head",w)}},remove:{bodyCSS:function(){m.debug("Removing body css styles",w),m.refresh(),w.remove()},active:function(){t.removeClass(o.active)},pushed:function(){m.verbose("Removing body push state",m.get.direction()),u.removeClass(o[m.get.direction()]).removeClass(o.pushed)}},set:{active:function(){t.addClass(o.active)},pushed:function(){m.verbose("Adding body push state",m.get.direction()),u.addClass(o[m.get.direction()]).addClass(o.pushed)}},get:{direction:function(){return t.hasClass(o.top)?o.top:t.hasClass(o.right)?o.right:t.hasClass(o.bottom)?o.bottom:o.left},transitionEvent:function(){var a,b=c.createElement("element"),e={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(a in e)if(b.style[a]!==d)return e[a]}},is:{open:function(){return t.is(":animated")||t.hasClass(o.active)},closed:function(){return!m.is.open()},vertical:function(){return t.hasClass(o.top)}},setting:function(b,c){return c===d?n[b]:(a.isPlainObject(b)?a.extend(!0,n,b):n[b]=c,void 0)},internal:function(b,c){return c===d?m[b]:(a.isPlainObject(b)?a.extend(!0,m,b):m[b]=c,void 0)},debug:function(){n.debug&&(n.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,n.name+":"),m.debug.apply(console,arguments)))},verbose:function(){n.verbose&&n.debug&&(n.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,n.name+":"),m.verbose.apply(console,arguments)))},error:function(){m.error=Function.prototype.bind.call(console.error,console,n.name+":"),m.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;n.performance&&(b=(new Date).getTime(),d=h||b,c=b-d,h=b,i.push({Element:x,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,100)},display:function(){var b=n.name+":",c=0;h=!1,clearTimeout(m.performance.timer),a.each(i,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",g&&(b+=" '"+g+"'"),f.size()>1&&(b+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(b),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,c,f){var g,h,i;return c=c||l,f=x||f,"string"==typeof b&&y!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(y[e])&&c!=g)y=y[e];else{if(!a.isPlainObject(y[f])||c==g)return y[e]!==d?(h=y[e],!1):y[f]!==d?(h=y[f],!1):(m.error(q.method),!1);y=y[f]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):"string"==typeof e?e=[e,i]:i!==d&&(e=i),h}},k?(y===d&&m.initialize(),m.invoke(j)):(y!==d&&m.destroy(),m.initialize())}),e!==d?e:this},a.fn.sidebar.settings={name:"Sidebar",namespace:"sidebar",verbose:!0,debug:!0,performance:!0,useCSS:!0,overlay:!1,duration:300,side:"left",onChange:function(){},onShow:function(){},onHide:function(){},className:{active:"active",pushed:"pushed",top:"top",left:"left",right:"right",bottom:"bottom"},error:{method:"The method you called is not defined.",notFound:"There were no elements that matched the specified selector"}}}(jQuery,window,document),function(a,b,c,d){a.fn.tab=function(c){var e,f,g,h,i,j=a.extend(!0,{},a.fn.tab.settings,c),k=a(this),l=a(j.context).find(j.selector.tabs),m=k.selector||"",n={},o=!0,p=0,q=this,r=(new Date).getTime(),s=[],t=j.className,u=j.metadata,v=j.error,w="."+j.namespace,x="module-"+j.namespace,y=k.data(x),z=arguments[0],A=y!==d&&"string"==typeof z,B=[].slice.call(arguments,1);return h={initialize:function(){if(h.debug("Initializing Tabs",k),j.auto&&(h.verbose("Setting up automatic tab retrieval from server"),j.apiSettings={url:j.path+"/{$tab}"}),j.history){if(a.address===d)return h.error(v.state),!1;if(j.path===!1)return h.error(v.path),!1;h.verbose("Address library found adding state change event"),a.address.state(j.path).unbind("change").bind("change",h.event.history.change)}a.isWindow(q)||(h.debug("Attaching tab activation events to element",k),k.on("click"+w,h.event.click)),h.instantiate()},instantiate:function(){h.verbose("Storing instance of module",h),k.data(x,h)},destroy:function(){h.debug("Destroying tabs",k),k.removeData(x).off(w)},event:{click:function(b){h.debug("Navigation clicked");var c=a(this).data(u.tab);c!==d?(j.history?a.address.value(c):h.changeTab(c),b.preventDefault()):h.debug("No tab specified")},history:{change:function(b){var c=b.pathNames.join("/")||h.get.initialPath(),e=j.templates.determineTitle(c)||!1;h.debug("History change event",c,b),g=b,c!==d&&h.changeTab(c),e&&a.address.title(e)}}},refresh:function(){e&&(h.debug("Refreshing tab",e),h.changeTab(e))},cache:{read:function(a){return a!==d?n[a]:!1},add:function(a,b){a=a||e,h.debug("Adding cached content for",a),n[a]=b},remove:function(a){a=a||e,h.debug("Removing cached content for",a),delete n[a]}},changeTab:function(c){var d=b.history&&b.history.pushState,i=d&&j.ignoreFirstLoad&&o,k=j.auto||a.isPlainObject(j.apiSettings),l=k&&!i?h.utilities.pathToArray(c):h.get.defaultPathArray(c);c=h.utilities.arrayToPath(l),h.deactivate.all(),a.each(l,function(b,d){var m,n,p,q=l.slice(0,b+1),r=h.utilities.arrayToPath(q),s=h.is.tab(r),t=b+1==l.length,u=h.get.tabElement(r);return h.verbose("Looking for tab",d),s?(h.verbose("Tab was found",d),e=r,f=h.utilities.filterArray(l,q),t?p=!0:(m=l.slice(0,b+2),n=h.utilities.arrayToPath(m),p=!h.is.tab(n),p&&h.verbose("Tab parameters found",m)),p&&k?(i?(h.debug("Ignoring remote content on first tab load",r),o=!1,h.cache.add(c,u.html()),h.activate.all(r),a.proxy(j.onTabInit,u)(r,f,g),a.proxy(j.onTabLoad,u)(r,f,g)):(h.activate.navigation(r),h.content.fetch(r,c)),!1):(h.debug("Opened local tab",r),h.activate.all(r),a.proxy(j.onTabLoad,u)(r,f,g),void 0)):(h.error(v.missingTab,d),!1)})},content:{fetch:function(b,c){var i,k,l=h.get.tabElement(b),m={dataType:"html",stateContext:l,success:function(d){h.cache.add(c,d),h.content.update(b,d),b==e?(h.debug("Content loaded",b),h.activate.tab(b)):h.debug("Content loaded in background",b),a.proxy(j.onTabInit,l)(b,f,g),a.proxy(j.onTabLoad,l)(b,f,g)},urlData:{tab:c}},n=l.data(u.promise)||!1,o=n&&"pending"===n.state();c=c||b,k=h.cache.read(c),j.cache&&k?(h.debug("Showing existing content",c),h.content.update(b,k),h.activate.tab(b),a.proxy(j.onTabLoad,l)(b,f,g)):o?(h.debug("Content is already loading",c),l.addClass(t.loading)):a.api!==d?(console.log(j.apiSettings),i=a.extend(!0,{headers:{"X-Remote":!0}},j.apiSettings,m),h.debug("Retrieving remote content",c,i),a.api(i)):h.error(v.api)},update:function(a,b){h.debug("Updating html for",a);var c=h.get.tabElement(a);c.html(b)}},activate:{all:function(a){h.activate.tab(a),h.activate.navigation(a)},tab:function(a){var b=h.get.tabElement(a);h.verbose("Showing tab content for",b),b.addClass(t.active)},navigation:function(a){var b=h.get.navElement(a);h.verbose("Activating tab navigation for",b,a),b.addClass(t.active)}},deactivate:{all:function(){h.deactivate.navigation(),h.deactivate.tabs()},navigation:function(){k.removeClass(t.active)},tabs:function(){l.removeClass(t.active+" "+t.loading)}},is:{tab:function(a){return a!==d?h.get.tabElement(a).size()>0:!1}},get:{initialPath:function(){return k.eq(0).data(u.tab)||l.eq(0).data(u.tab)},path:function(){return a.address.value()},defaultPathArray:function(a){return h.utilities.pathToArray(h.get.defaultPath(a))},defaultPath:function(a){var b=k.filter("[data-"+u.tab+'^="'+a+'/"]').eq(0),c=b.data(u.tab)||!1;if(c){if(h.debug("Found default tab",c),p<j.maxDepth)return p++,h.get.defaultPath(c);h.error(v.recursion)}else h.debug("No default tabs found for",a,l);return p=0,a},navElement:function(a){return a=a||e,k.filter("[data-"+u.tab+'="'+a+'"]')},tabElement:function(a){var b,c,d,f;return a=a||e,d=h.utilities.pathToArray(a),f=h.utilities.last(d),b=l.filter("[data-"+u.tab+'="'+f+'"]'),c=l.filter("[data-"+u.tab+'="'+a+'"]'),b.size()>0?b:c},tab:function(){return e}},utilities:{filterArray:function(b,c){return a.grep(b,function(b){return-1==a.inArray(b,c)})},last:function(b){return a.isArray(b)?b[b.length-1]:!1},pathToArray:function(a){return a===d&&(a=e),"string"==typeof a?a.split("/"):[a]},arrayToPath:function(b){return a.isArray(b)?b.join("/"):!1}},setting:function(b,c){return c===d?j[b]:(a.isPlainObject(b)?a.extend(!0,j,b):j[b]=c,void 0)},internal:function(b,c){return c===d?h[b]:(a.isPlainObject(b)?a.extend(!0,h,b):h[b]=c,void 0)},debug:function(){j.debug&&(j.performance?h.performance.log(arguments):(h.debug=Function.prototype.bind.call(console.info,console,j.name+":"),h.debug.apply(console,arguments)))},verbose:function(){j.verbose&&j.debug&&(j.performance?h.performance.log(arguments):(h.verbose=Function.prototype.bind.call(console.info,console,j.name+":"),h.verbose.apply(console,arguments)))},error:function(){h.error=Function.prototype.bind.call(console.error,console,j.name+":"),h.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;j.performance&&(b=(new Date).getTime(),d=r||b,c=b-d,r=b,s.push({Element:q,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(h.performance.timer),h.performance.timer=setTimeout(h.performance.display,100)},display:function(){var b=j.name+":",c=0;r=!1,clearTimeout(h.performance.timer),a.each(s,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",m&&(b+=" '"+m+"'"),(console.group!==d||console.table!==d)&&s.length>0&&(console.groupCollapsed(b),console.table?console.table(s):a.each(s,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(b,c,e){var f,g,j;return c=c||B,e=q||e,"string"==typeof b&&y!==d&&(b=b.split(/[\. ]/),f=b.length-1,a.each(b,function(c,e){var i=c!=f?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(y[e])&&c!=f)y=y[e];else{if(!a.isPlainObject(y[i])||c==f)return y[e]!==d?(g=y[e],!1):y[i]!==d?(g=y[i],!1):(h.error(v.method),!1);y=y[i]}})),a.isFunction(g)?j=g.apply(e,c):g!==d&&(j=g),a.isArray(i)?i.push(j):"string"==typeof i?i=[i,j]:j!==d&&(i=j),g}},A?(y===d&&h.initialize(),h.invoke(z)):(y!==d&&h.destroy(),h.initialize()),i!==d?i:this},a.tab=function(c){a(b).tab(c)},a.fn.tab.settings={name:"Tab",verbose:!0,debug:!0,performance:!0,namespace:"tab",onTabInit:function(){},onTabLoad:function(){},templates:{determineTitle:function(){}},auto:!1,history:!1,path:!1,context:"body",maxDepth:25,ignoreFirstLoad:!1,alwaysRefresh:!1,cache:!0,apiSettings:!1,error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Tab cannot be found",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",state:"The state library has not been initialized"},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab"}}}(jQuery,window,document),function(a,b,c,d){a.fn.transition=function(){var e,f=a(this),g=f.selector||"",h=(new Date).getTime(),i=[],j=arguments,k=j[0],l=[].slice.call(arguments,1),m="string"==typeof k;return b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)},f.each(function(){var b,n,o,p,q,r,s,t,u,v,w=a(this),x=this;v={initialize:function(){b=v.get.settings.apply(x,j),v.verbose("Converted arguments into settings object",b),o=b.error,p=b.className,t=b.namespace,q=b.metadata,u="module-"+t,r=v.get.animationEvent(),s=v.get.animationName(),n=w.data(u),n===d&&v.instantiate(),m&&(m=v.invoke(k)),m===!1&&v.animate()},instantiate:function(){v.verbose("Storing instance of module",v),n=v,w.data(u,n)},destroy:function(){v.verbose("Destroying previous module for",x),w.removeData(u)},animate:function(a){return b=a||b,v.debug("Preparing animation",b.animation),v.is.animating()?(b.queue&&v.queue(b.animation),!1):(v.save.conditions(),v.set.duration(b.duration),v.set.animating(),v.repaint(),w.addClass(p.transition).addClass(b.animation).one(r,v.complete),!v.has.direction()&&v.can.transition()&&v.set.direction(),v.can.animate()?(v.show(),v.debug("Starting tween",b.animation,w.attr("class")),void 0):(v.restore.conditions(),v.error(o.noAnimation),!1))},queue:function(a){v.debug("Queueing animation of",a),n.queuing=!0,w.one(r,function(){n.queuing=!1,v.animate.apply(this,b)})},complete:function(){v.verbose("CSS animation complete",b.animation),v.is.looping()||(w.hasClass(p.outward)?(v.restore.conditions(),v.hide()):w.hasClass(p.inward)?(v.restore.conditions(),v.show()):v.restore.conditions(),v.remove.animating()),a.proxy(b.complete,this)()},repaint:function(a){v.verbose("Forcing repaint event"),a=x.offsetWidth},has:{direction:function(a){return a=a||b.animation,w.hasClass(p.inward)||w.hasClass(p.outward)?!0:void 0}},set:{animating:function(){w.addClass(p.animating)},direction:function(){w.is(":visible")?(v.debug("Automatically determining the direction of animation","Outward"),w.addClass(p.outward).removeClass(p.inward)):(v.debug("Automatically determining the direction of animation","Inward"),w.addClass(p.inward).removeClass(p.outward))},looping:function(){v.debug("Transition set to loop"),w.addClass(p.looping)},duration:function(a){a=a||b.duration,a="number"==typeof a?a+"ms":a,v.verbose("Setting animation duration",a),w.css({"-webkit-animation-duration":a,"-moz-animation-duration":a,"-ms-animation-duration":a,"-o-animation-duration":a,"animation-duration":a})}},save:{conditions:function(){v.cache={className:w.attr("class"),style:w.attr("style")},v.verbose("Saving original attributes",v.cache)}},restore:{conditions:function(){return typeof v.cache===d?(v.error(o.cache),!1):(v.cache.className?w.attr("class",v.cache.className):w.removeAttr("class"),v.cache.style?w.attr("style",v.cache.style):w.removeAttr("style"),v.is.looping()&&v.remove.looping(),v.verbose("Restoring original attributes",v.cache),void 0)}},remove:{animating:function(){w.removeClass(p.animating)},looping:function(){v.debug("Transitions are no longer looping"),w.removeClass(p.looping),v.repaint()}},get:{settings:function(b,c,d){return a.isPlainObject(b)?a.extend(!0,{},a.fn.transition.settings,b):"function"==typeof d?a.extend(!0,{},a.fn.transition.settings,{animation:b,complete:d,duration:c}):"string"==typeof c||"number"==typeof c?a.extend(!0,{},a.fn.transition.settings,{animation:b,duration:c}):"object"==typeof c?a.extend(!0,{},a.fn.transition.settings,c,{animation:b}):"function"==typeof c?a.extend(!0,{},a.fn.transition.settings,{animation:b,complete:c}):a.extend(!0,{},a.fn.transition.settings,{animation:b})},animationName:function(){var a,b=c.createElement("div"),e={animation:"animationName",OAnimation:"oAnimationName",MozAnimation:"mozAnimationName",WebkitAnimation:"webkitAnimationName"};for(a in e)if(b.style[a]!==d)return v.verbose("Determining animation vendor name property",e[a]),e[a];return!1},animationEvent:function(){var a,b=c.createElement("div"),e={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(a in e)if(b.style[a]!==d)return v.verbose("Determining animation vendor end event",e[a]),e[a];return!1}},can:{animate:function(){return"none"!==w.css(s)?(v.debug("CSS definition found"),!0):(v.debug("Unable to find css definition"),!1)},transition:function(){var b=a("<div>").addClass(w.attr("class")).appendTo(a("body")),c=b.css(s),d=b.addClass(p.inward).css(s);return c!=d?(v.debug("In/out transitions exist"),b.remove(),!0):(v.debug("Static animation found"),b.remove(),!1)}},is:{animating:function(){return w.hasClass(p.animating)},looping:function(){return w.hasClass(p.looping)},visible:function(){return w.is(":visible")}},hide:function(){v.verbose("Hiding element"),w.removeClass(p.visible).addClass(p.transition).addClass(p.hidden),v.repaint()},show:function(){v.verbose("Showing element"),w.removeClass(p.hidden).addClass(p.transition).addClass(p.visible),v.repaint()},start:function(){v.verbose("Starting animation"),w.removeClass(p.disabled)},stop:function(){v.debug("Stopping animation"),w.addClass(p.disabled)},toggle:function(){v.debug("Toggling play status"),w.toggleClass(p.disabled)},setting:function(c,e){return e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},internal:function(b,c){return c===d?v[b]:(a.isPlainObject(b)?a.extend(!0,v,b):v[b]=c,void 0)},debug:function(){b.debug&&(b.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,b.name+":"),v.debug.apply(console,arguments)))},verbose:function(){b.verbose&&b.debug&&(b.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),v.verbose.apply(console,arguments)))},error:function(){v.error=Function.prototype.bind.call(console.error,console,b.name+":"),v.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;b.performance&&(c=(new Date).getTime(),e=h||c,d=c-e,h=c,i.push({Element:x,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(v.performance.timer),v.performance.timer=setTimeout(v.performance.display,100)},display:function(){var c=b.name+":",e=0;h=!1,clearTimeout(v.performance.timer),a.each(i,function(a,b){e+=b["Execution Time"]}),c+=" "+e+"ms",g&&(c+=" '"+g+"'"),f.size()>1&&(c+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(c),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,c,f){var g,h,i;return c=c||l,f=x||f,"string"==typeof b&&n!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(n[e])&&c!=g)n=n[e];else{if(!a.isPlainObject(n[f])||c==g)return n[e]!==d?(h=n[e],!1):n[f]!==d?(h=n[f],!1):!1;n=n[f]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):"string"==typeof e?e=[e,i]:i!==d&&(e=i),h||!1}},v.initialize()}),e!==d?e:this},a.fn.transition.settings={name:"Transition",debug:!1,verbose:!0,performance:!0,namespace:"transition",complete:function(){},animation:"fade",duration:"700ms",queue:!0,className:{animating:"animating",disabled:"disabled",hidden:"hidden",inward:"in",loading:"loading",looping:"looping",outward:"out",transition:"ui transition",visible:"visible"},error:{noAnimation:"There is no css animation matching the one you specified.",method:"The method you called is not defined"}}}(jQuery,window,document),function(a,b,c,d){a.fn.video=function(b){var c,e=a(this),f=e.selector||"",g=(new Date).getTime(),h=[],i=arguments[0],j="string"==typeof i,k=[].slice.call(arguments,1);return e.each(function(){var l,m=a.isPlainObject(b)?a.extend(!0,{},a.fn.video.settings,b):a.extend({},a.fn.video.settings),n=m.selector,o=m.className,p=m.error,q=m.metadata,r=m.namespace,s="."+r,t="module-"+r,u=a(this),v=u.find(n.placeholder),w=u.find(n.playButton),x=u.find(n.embed),y=this,z=u.data(t);l={initialize:function(){l.debug("Initializing video"),v.on("click"+s,l.play),w.on("click"+s,l.play),l.instantiate()},instantiate:function(){l.verbose("Storing instance of module",l),z=l,u.data(t,l)},destroy:function(){l.verbose("Destroying previous instance of video"),u.removeData(t).off(s),v.off(s),w.off(s)},change:function(a,b,c){l.debug("Changing video to ",a,b,c),u.data(q.source,a).data(q.id,b).data(q.url,c),m.onChange()},reset:function(){l.debug("Clearing video embed and showing placeholder"),u.removeClass(o.active),x.html(" "),v.show(),m.onReset()},play:function(){l.debug("Playing video");var a=u.data(q.source)||!1,b=u.data(q.url)||!1,c=u.data(q.id)||!1;x.html(l.generate.html(a,c,b)),u.addClass(o.active),m.onPlay()},generate:{html:function(a,b,c){l.debug("Generating embed html");var d,e="auto"==m.width?u.width():m.width,f="auto"==m.height?u.height():m.height;return a&&b?"vimeo"==a?d='<iframe src="http://player.vimeo.com/video/'+b+"?="+l.generate.url(a)+'"'+' width="'+e+'" height="'+f+'"'+' frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>':"youtube"==a&&(d='<iframe src="http://www.youtube.com/embed/'+b+"?="+l.generate.url(a)+'"'+' width="'+e+'" height="'+f+'"'+' frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'):c?d='<iframe src="'+c+'"'+' width="'+e+'" height="'+f+'"'+' frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>':l.error(p.noVideo),d},url:function(a){var b=m.api?1:0,c=m.autoplay?1:0,d=m.hd?1:0,e=m.showUI?1:0,f=m.showUI?0:1,g="";return"vimeo"==a&&(g="api="+b+"&title="+e+"&byline="+e+"&portrait="+e+"&autoplay="+c,m.color&&(g+="&color="+m.color)),"ustream"==a?(g="autoplay="+c,m.color&&(g+="&color="+m.color)):"youtube"==a&&(g="enablejsapi="+b+"&autoplay="+c+"&autohide="+f+"&hq="+d+"&modestbranding=1",m.color&&(g+="&color="+m.color)),g}},setting:function(b,c){return c===d?m[b]:(a.isPlainObject(b)?a.extend(!0,m,b):m[b]=c,void 0)},internal:function(b,c){return c===d?l[b]:(a.isPlainObject(b)?a.extend(!0,l,b):l[b]=c,void 0)},debug:function(){m.debug&&(m.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,m.name+":"),l.debug.apply(console,arguments)))},verbose:function(){m.verbose&&m.debug&&(m.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),l.verbose.apply(console,arguments)))},error:function(){l.error=Function.prototype.bind.call(console.error,console,m.name+":"),l.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;m.performance&&(b=(new Date).getTime(),d=g||b,c=b-d,g=b,h.push({Element:y,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(l.performance.timer),l.performance.timer=setTimeout(l.performance.display,100)},display:function(){var b=m.name+":",c=0;g=!1,clearTimeout(l.performance.timer),a.each(h,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",f&&(b+=" '"+f+"'"),e.size()>1&&(b+=" ("+e.size()+")"),(console.group!==d||console.table!==d)&&h.length>0&&(console.groupCollapsed(b),console.table?console.table(h):a.each(h,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(b,e,f){var g,h,i;return e=e||k,f=y||f,"string"==typeof b&&z!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(z[e])&&c!=g)z=z[e];else{if(!a.isPlainObject(z[f])||c==g)return z[e]!==d?(h=z[e],!1):z[f]!==d?(h=z[f],!1):(l.error(p.method),!1);z=z[f]}})),a.isFunction(h)?i=h.apply(f,e):h!==d&&(i=h),a.isArray(c)?c.push(i):"string"==typeof c?c=[c,i]:i!==d&&(c=i),h}},j?(z===d&&l.initialize(),l.invoke(i)):(z!==d&&l.destroy(),l.initialize())}),c!==d?c:this},a.fn.video.settings={name:"Video",namespace:"video",debug:!0,verbose:!0,performance:!0,metadata:{source:"source",id:"id",url:"url"},onPlay:function(){},onReset:function(){},onChange:function(){},onPause:function(){},onStop:function(){},width:"auto",height:"auto",autoplay:!1,color:"#442359",hd:!0,showUI:!1,api:!0,error:{noVideo:"No video specified",method:"The method you called is not defined"},className:{active:"active"},selector:{embed:".embed",placeholder:".placeholder",playButton:".play"}}}(jQuery,window,document); | aaqibrasheed/cdnjs | ajax/libs/semantic-ui/0.6.3/javascript/semantic.min.js | JavaScript | mit | 126,793 |
/*
* jQuery Mobile Framework Git Build: SHA1: b49cc06499abf8f987cf90f35349cfac0918c939 <> Date: Tue Oct 2 11:22:34 2012 -0700
* http://jquerymobile.com
*
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
*/
/* Swatches */
/* A
-----------------------------------------------------------------------------------------------------------*/
.ui-bar-a {
border: 1px solid #333 /*{a-bar-border}*/;
background: #111 /*{a-bar-background-color}*/;
color: #fff /*{a-bar-color}*/;
font-weight: bold;
text-shadow: 0 /*{a-bar-shadow-x}*/ -1px /*{a-bar-shadow-y}*/ 1px /*{a-bar-shadow-radius}*/ #000 /*{a-bar-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #3c3c3c /*{a-bar-background-start}*/), to( #111 /*{a-bar-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/);
}
.ui-bar-a,
.ui-bar-a input,
.ui-bar-a select,
.ui-bar-a textarea,
.ui-bar-a button {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-bar-a .ui-link-inherit {
color: #fff /*{a-bar-color}*/;
}
.ui-bar-a a.ui-link {
color: #7cc4e7 /*{a-bar-link-color}*/;
font-weight: bold;
}
.ui-bar-a a.ui-link:visited {
color: #2489ce /*{a-bar-link-visited}*/;
}
.ui-bar-a a.ui-link:hover {
color: #2489ce /*{a-bar-link-hover}*/;
}
.ui-bar-a a.ui-link:active {
color: #2489ce /*{a-bar-link-active}*/;
}
.ui-body-a,
.ui-overlay-a {
border: 1px solid #444 /*{a-body-border}*/;
background: #222 /*{a-body-background-color}*/;
color: #fff /*{a-body-color}*/;
text-shadow: 0 /*{a-body-shadow-x}*/ 1px /*{a-body-shadow-y}*/ 1px /*{a-body-shadow-radius}*/ #111 /*{a-body-shadow-color}*/;
font-weight: normal;
background-image: -webkit-gradient(linear, left top, left bottom, from( #444 /*{a-body-background-start}*/), to( #222 /*{a-body-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #444 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #444 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #444 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #444 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #444 /*{a-body-background-start}*/, #222 /*{a-body-background-end}*/);
}
.ui-overlay-a {
background-image: none;
border-width: 0;
}
.ui-body-a,
.ui-body-a input,
.ui-body-a select,
.ui-body-a textarea,
.ui-body-a button {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-body-a .ui-link-inherit {
color: #fff /*{a-body-color}*/;
}
.ui-body-a .ui-link {
color: #2489ce /*{a-body-link-color}*/;
font-weight: bold;
}
.ui-body-a .ui-link:visited {
color: #2489ce /*{a-body-link-visited}*/;
}
.ui-body-a .ui-link:hover {
color: #2489ce /*{a-body-link-hover}*/;
}
.ui-body-a .ui-link:active {
color: #2489ce /*{a-body-link-active}*/;
}
.ui-btn-up-a {
border: 1px solid #111 /*{a-bup-border}*/;
background: #333 /*{a-bup-background-color}*/;
font-weight: bold;
color: #fff /*{a-bup-color}*/;
text-shadow: 0 /*{a-bup-shadow-x}*/ 1px /*{a-bup-shadow-y}*/ 1px /*{a-bup-shadow-radius}*/ #111 /*{a-bup-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #444 /*{a-bup-background-start}*/), to( #2d2d2d /*{a-bup-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/);
}
.ui-btn-up-a:visited,
.ui-btn-up-a a.ui-link-inherit {
color: #fff /*{a-bup-color}*/;
}
.ui-btn-hover-a {
border: 1px solid #000 /*{a-bhover-border}*/;
background: #444 /*{a-bhover-background-color}*/;
font-weight: bold;
color: #fff /*{a-bhover-color}*/;
text-shadow: 0 /*{a-bhover-shadow-x}*/ 1px /*{a-bhover-shadow-y}*/ 1px /*{a-bhover-shadow-radius}*/ #111 /*{a-bhover-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #555 /*{a-bhover-background-start}*/), to( #383838 /*{a-bhover-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/);
}
.ui-btn-hover-a:visited,
.ui-btn-hover-a:hover,
.ui-btn-hover-a a.ui-link-inherit {
color: #fff /*{a-bhover-color}*/;
}
.ui-btn-down-a {
border: 1px solid #000 /*{a-bdown-border}*/;
background: #222 /*{a-bdown-background-color}*/;
font-weight: bold;
color: #fff /*{a-bdown-color}*/;
text-shadow: 0 /*{a-bdown-shadow-x}*/ 1px /*{a-bdown-shadow-y}*/ 1px /*{a-bdown-shadow-radius}*/ #111 /*{a-bdown-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #202020 /*{a-bdown-background-start}*/), to( #2c2c2c /*{a-bdown-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #202020 /*{a-bdown-background-start}*/, #2c2c2c /*{a-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #202020 /*{a-bdown-background-start}*/, #2c2c2c /*{a-bdown-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #202020 /*{a-bdown-background-start}*/, #2c2c2c /*{a-bdown-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #202020 /*{a-bdown-background-start}*/, #2c2c2c /*{a-bdown-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #202020 /*{a-bdown-background-start}*/, #2c2c2c /*{a-bdown-background-end}*/);
}
.ui-btn-down-a:visited,
.ui-btn-down-a:hover,
.ui-btn-down-a a.ui-link-inherit {
color: #fff /*{a-bdown-color}*/;
}
.ui-btn-up-a,
.ui-btn-hover-a,
.ui-btn-down-a {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
text-decoration: none;
}
/* B
-----------------------------------------------------------------------------------------------------------*/
.ui-bar-b {
border: 1px solid #456f9a /*{b-bar-border}*/;
background: #5e87b0 /*{b-bar-background-color}*/;
color: #fff /*{b-bar-color}*/;
font-weight: bold;
text-shadow: 0 /*{b-bar-shadow-x}*/ 1px /*{b-bar-shadow-y}*/ 1px /*{b-bar-shadow-radius}*/ #3e6790 /*{b-bar-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #6facd5 /*{b-bar-background-start}*/), to( #497bae /*{b-bar-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #6facd5 /*{b-bar-background-start}*/, #497bae /*{b-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #6facd5 /*{b-bar-background-start}*/, #497bae /*{b-bar-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #6facd5 /*{b-bar-background-start}*/, #497bae /*{b-bar-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #6facd5 /*{b-bar-background-start}*/, #497bae /*{b-bar-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #6facd5 /*{b-bar-background-start}*/, #497bae /*{b-bar-background-end}*/);
}
.ui-bar-b,
.ui-bar-b input,
.ui-bar-b select,
.ui-bar-b textarea,
.ui-bar-b button {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-bar-b .ui-link-inherit {
color: #fff /*{b-bar-color}*/;
}
.ui-bar-b a.ui-link {
color: #ddf0f8 /*{b-bar-link-color}*/;
font-weight: bold;
}
.ui-bar-b a.ui-link:visited {
color: #ddf0f8 /*{b-bar-link-visited}*/;
}
.ui-bar-b a.ui-link:hover {
color: #ddf0f8 /*{b-bar-link-hover}*/;
}
.ui-bar-b a.ui-link:active {
color: #ddf0f8 /*{b-bar-link-active}*/;
}
.ui-body-b,
.ui-overlay-b {
border: 1px solid #999 /*{b-body-border}*/;
background: #f3f3f3 /*{b-body-background-color}*/;
color: #222 /*{b-body-color}*/;
text-shadow: 0 /*{b-body-shadow-x}*/ 1px /*{b-body-shadow-y}*/ 0 /*{b-body-shadow-radius}*/ #fff /*{b-body-shadow-color}*/;
font-weight: normal;
background-image: -webkit-gradient(linear, left top, left bottom, from( #ddd /*{b-body-background-start}*/), to( #ccc /*{b-body-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #ddd /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #ddd /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #ddd /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #ddd /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #ddd /*{b-body-background-start}*/, #ccc /*{b-body-background-end}*/);
}
.ui-overlay-b {
background-image: none;
border-width: 0;
}
.ui-body-b,
.ui-body-b input,
.ui-body-b select,
.ui-body-b textarea,
.ui-body-b button {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-body-b .ui-link-inherit {
color: #333 /*{b-body-color}*/;
}
.ui-body-b .ui-link {
color: #2489ce /*{b-body-link-color}*/;
font-weight: bold;
}
.ui-body-b .ui-link:visited {
color: #2489ce /*{b-body-link-visited}*/;
}
.ui-body-b .ui-link:hover {
color: #2489ce /*{b-body-link-hover}*/;
}
.ui-body-b .ui-link:active {
color: #2489ce /*{b-body-link-active}*/;
}
.ui-btn-up-b {
border: 1px solid #044062 /*{b-bup-border}*/;
background: #396b9e /*{b-bup-background-color}*/;
font-weight: bold;
color: #fff /*{b-bup-color}*/;
text-shadow: 0 /*{b-bup-shadow-x}*/ 1px /*{b-bup-shadow-y}*/ 1px /*{b-bup-shadow-radius}*/ #194b7e /*{b-bup-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #5f9cc5 /*{b-bup-background-start}*/), to( #396b9e /*{b-bup-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/);
}
.ui-btn-up-b:visited,
.ui-btn-up-b a.ui-link-inherit {
color: #fff /*{b-bup-color}*/;
}
.ui-btn-hover-b {
border: 1px solid #00415e /*{b-bhover-border}*/;
background: #4b88b6 /*{b-bhover-background-color}*/;
font-weight: bold;
color: #fff /*{b-bhover-color}*/;
text-shadow: 0 /*{b-bhover-shadow-x}*/ 1px /*{b-bhover-shadow-y}*/ 1px /*{b-bhover-shadow-radius}*/ #194b7e /*{b-bhover-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #6facd5 /*{b-bhover-background-start}*/), to( #4272a4 /*{b-bhover-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #6facd5 /*{b-bhover-background-start}*/, #4272a4 /*{b-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #6facd5 /*{b-bhover-background-start}*/, #4272a4 /*{b-bhover-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #6facd5 /*{b-bhover-background-start}*/, #4272a4 /*{b-bhover-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #6facd5 /*{b-bhover-background-start}*/, #4272a4 /*{b-bhover-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #6facd5 /*{b-bhover-background-start}*/, #4272a4 /*{b-bhover-background-end}*/);
}
.ui-btn-hover-b:visited,
.ui-btn-hover-b:hover,
.ui-btn-hover-b a.ui-link-inherit {
color: #fff /*{b-bhover-color}*/;
}
.ui-btn-down-b {
border: 1px solid #225377 /*{b-bdown-border}*/;
background: #4e89c5 /*{b-bdown-background-color}*/;
font-weight: bold;
color: #fff /*{b-bdown-color}*/;
text-shadow: 0 /*{b-bdown-shadow-x}*/ 1px /*{b-bdown-shadow-y}*/ 1px /*{b-bdown-shadow-radius}*/ #194b7e /*{b-bdown-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #295b8e /*{b-bdown-background-start}*/), to( #3e79b5 /*{b-bdown-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #295b8e /*{b-bdown-background-start}*/, #3e79b5 /*{b-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #295b8e /*{b-bdown-background-start}*/, #3e79b5 /*{b-bdown-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #295b8e /*{b-bdown-background-start}*/, #3e79b5 /*{b-bdown-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #295b8e /*{b-bdown-background-start}*/, #3e79b5 /*{b-bdown-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #295b8e /*{b-bdown-background-start}*/, #3e79b5 /*{b-bdown-background-end}*/);
}
.ui-btn-down-b:visited,
.ui-btn-down-b:hover,
.ui-btn-down-b a.ui-link-inherit {
color: #fff /*{b-bdown-color}*/;
}
.ui-btn-up-b,
.ui-btn-hover-b,
.ui-btn-down-b {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
text-decoration: none;
}
/* C
-----------------------------------------------------------------------------------------------------------*/
.ui-bar-c {
border: 1px solid #b3b3b3 /*{c-bar-border}*/;
background: #eee /*{c-bar-background-color}*/;
color: #3e3e3e /*{c-bar-color}*/;
font-weight: bold;
text-shadow: 0 /*{c-bar-shadow-x}*/ 1px /*{c-bar-shadow-y}*/ 1px /*{c-bar-shadow-radius}*/ #fff /*{c-bar-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #f0f0f0 /*{c-bar-background-start}*/), to( #ddd /*{c-bar-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #f0f0f0 /*{c-bar-background-start}*/, #ddd /*{c-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #f0f0f0 /*{c-bar-background-start}*/, #ddd /*{c-bar-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #f0f0f0 /*{c-bar-background-start}*/, #ddd /*{c-bar-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #f0f0f0 /*{c-bar-background-start}*/, #ddd /*{c-bar-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #f0f0f0 /*{c-bar-background-start}*/, #ddd /*{c-bar-background-end}*/);
}
.ui-bar-c .ui-link-inherit {
color: #3e3e3e /*{c-bar-color}*/;
}
.ui-bar-c a.ui-link {
color: #7cc4e7 /*{c-bar-link-color}*/;
font-weight: bold;
}
.ui-bar-c a.ui-link:visited {
color: #2489ce /*{c-bar-link-visited}*/;
}
.ui-bar-c a.ui-link:hover {
color: #2489ce /*{c-bar-link-hover}*/;
}
.ui-bar-c a.ui-link:active {
color: #2489ce /*{c-bar-link-active}*/;
}
.ui-bar-c,
.ui-bar-c input,
.ui-bar-c select,
.ui-bar-c textarea,
.ui-bar-c button {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-body-c,
.ui-overlay-c {
border: 1px solid #aaa /*{c-body-border}*/;
color: #333 /*{c-body-color}*/;
text-shadow: 0 /*{c-body-shadow-x}*/ 1px /*{c-body-shadow-y}*/ 0 /*{c-body-shadow-radius}*/ #fff /*{c-body-shadow-color}*/;
background: #f9f9f9 /*{c-body-background-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #f9f9f9 /*{c-body-background-start}*/), to( #eee /*{c-body-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eee /*{c-body-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eee /*{c-body-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eee /*{c-body-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eee /*{c-body-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eee /*{c-body-background-end}*/);
}
.ui-overlay-c {
background-image: none;
border-width: 0;
}
.ui-body-c,
.ui-body-c input,
.ui-body-c select,
.ui-body-c textarea,
.ui-body-c button {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-body-c .ui-link-inherit {
color: #333 /*{c-body-color}*/;
}
.ui-body-c .ui-link {
color: #2489ce /*{c-body-link-color}*/;
font-weight: bold;
}
.ui-body-c .ui-link:visited {
color: #2489ce /*{c-body-link-visited}*/;
}
.ui-body-c .ui-link:hover {
color: #2489ce /*{c-body-link-hover}*/;
}
.ui-body-c .ui-link:active {
color: #2489ce /*{c-body-link-active}*/;
}
.ui-btn-up-c {
border: 1px solid #ccc /*{c-bup-border}*/;
background: #eee /*{c-bup-background-color}*/;
font-weight: bold;
color: #222 /*{c-bup-color}*/;
text-shadow: 0 /*{c-bup-shadow-x}*/ 1px /*{c-bup-shadow-y}*/ 0 /*{c-bup-shadow-radius}*/ #fff /*{c-bup-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #fff /*{c-bup-background-start}*/), to( #f1f1f1 /*{c-bup-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #fff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #fff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #fff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #fff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #fff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/);
}
.ui-btn-up-c:visited,
.ui-btn-up-c a.ui-link-inherit {
color: #2f3e46 /*{c-bup-color}*/;
}
.ui-btn-hover-c {
border: 1px solid #bbb /*{c-bhover-border}*/;
background: #dfdfdf /*{c-bhover-background-color}*/;
font-weight: bold;
color: #222 /*{c-bhover-color}*/;
text-shadow: 0 /*{c-bhover-shadow-x}*/ 1px /*{c-bhover-shadow-y}*/ 0 /*{c-bhover-shadow-radius}*/ #fff /*{c-bhover-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #f6f6f6 /*{c-bhover-background-start}*/), to( #e0e0e0 /*{c-bhover-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #f6f6f6 /*{c-bhover-background-start}*/, #e0e0e0 /*{c-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #f6f6f6 /*{c-bhover-background-start}*/, #e0e0e0 /*{c-bhover-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #f6f6f6 /*{c-bhover-background-start}*/, #e0e0e0 /*{c-bhover-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #f6f6f6 /*{c-bhover-background-start}*/, #e0e0e0 /*{c-bhover-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #f6f6f6 /*{c-bhover-background-start}*/, #e0e0e0 /*{c-bhover-background-end}*/);
}
.ui-btn-hover-c:visited,
.ui-btn-hover-c:hover,
.ui-btn-hover-c a.ui-link-inherit {
color: #2f3e46 /*{c-bhover-color}*/;
}
.ui-btn-down-c {
border: 1px solid #bbb /*{c-bdown-border}*/;
background: #d6d6d6 /*{c-bdown-background-color}*/;
font-weight: bold;
color: #222 /*{c-bdown-color}*/;
text-shadow: 0 /*{c-bdown-shadow-x}*/ 1px /*{c-bdown-shadow-y}*/ 0 /*{c-bdown-shadow-radius}*/ #fff /*{c-bdown-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #d0d0d0 /*{c-bdown-background-start}*/), to( #dfdfdf /*{c-bdown-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #d0d0d0 /*{c-bdown-background-start}*/, #dfdfdf /*{c-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #d0d0d0 /*{c-bdown-background-start}*/, #dfdfdf /*{c-bdown-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #d0d0d0 /*{c-bdown-background-start}*/, #dfdfdf /*{c-bdown-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #d0d0d0 /*{c-bdown-background-start}*/, #dfdfdf /*{c-bdown-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #d0d0d0 /*{c-bdown-background-start}*/, #dfdfdf /*{c-bdown-background-end}*/);
}
.ui-btn-down-c:visited,
.ui-btn-down-c:hover,
.ui-btn-down-c a.ui-link-inherit {
color: #2f3e46 /*{c-bdown-color}*/;
}
.ui-btn-up-c,
.ui-btn-hover-c,
.ui-btn-down-c {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
text-decoration: none;
}
/* D
-----------------------------------------------------------------------------------------------------------*/
.ui-bar-d {
border: 1px solid #bbb /*{d-bar-border}*/;
background: #bbb /*{d-bar-background-color}*/;
color: #333 /*{d-bar-color}*/;
font-weight: bold;
text-shadow: 0 /*{d-bar-shadow-x}*/ 1px /*{d-bar-shadow-y}*/ 0 /*{d-bar-shadow-radius}*/ #eee /*{d-bar-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #ddd /*{d-bar-background-start}*/), to( #bbb /*{d-bar-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/);
}
.ui-bar-d,
.ui-bar-d input,
.ui-bar-d select,
.ui-bar-d textarea,
.ui-bar-d button {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-bar-d .ui-link-inherit {
color: #333 /*{d-bar-color}*/;
}
.ui-bar-d a.ui-link {
color: #2489ce /*{d-bar-link-color}*/;
font-weight: bold;
}
.ui-bar-d a.ui-link:visited {
color: #2489ce /*{d-bar-link-visited}*/;
}
.ui-bar-d a.ui-link:hover {
color: #2489ce /*{d-bar-link-hover}*/;
}
.ui-bar-d a.ui-link:active {
color: #2489ce /*{d-bar-link-active}*/;
}
.ui-body-d,
.ui-overlay-d {
border: 1px solid #bbb /*{d-body-border}*/;
color: #333 /*{d-body-color}*/;
text-shadow: 0 /*{d-body-shadow-x}*/ 1px /*{d-body-shadow-y}*/ 0 /*{d-body-shadow-radius}*/ #fff /*{d-body-shadow-color}*/;
background: #fff /*{d-body-background-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #fff /*{d-body-background-start}*/), to( #fff /*{d-body-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/);
}
.ui-overlay-d {
background-image: none;
border-width: 0;
}
.ui-body-d,
.ui-body-d input,
.ui-body-d select,
.ui-body-d textarea,
.ui-body-d button {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-body-d .ui-link-inherit {
color: #333 /*{d-body-color}*/;
}
.ui-body-d .ui-link {
color: #2489ce /*{d-body-link-color}*/;
font-weight: bold;
}
.ui-body-d .ui-link:visited {
color: #2489ce /*{d-body-link-visited}*/;
}
.ui-body-d .ui-link:hover {
color: #2489ce /*{d-body-link-hover}*/;
}
.ui-body-d .ui-link:active {
color: #2489ce /*{d-body-link-active}*/;
}
.ui-btn-up-d {
border: 1px solid #bbb /*{d-bup-border}*/;
background: #fff /*{d-bup-background-color}*/;
font-weight: bold;
color: #333 /*{d-bup-color}*/;
text-shadow: 0 /*{d-bup-shadow-x}*/ 1px /*{d-bup-shadow-y}*/ 0 /*{d-bup-shadow-radius}*/ #fff /*{d-bup-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #fafafa /*{d-bup-background-start}*/), to( #f6f6f6 /*{d-bup-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #fafafa /*{d-bup-background-start}*/, #f6f6f6 /*{d-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #fafafa /*{d-bup-background-start}*/, #f6f6f6 /*{d-bup-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #fafafa /*{d-bup-background-start}*/, #f6f6f6 /*{d-bup-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #fafafa /*{d-bup-background-start}*/, #f6f6f6 /*{d-bup-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #fafafa /*{d-bup-background-start}*/, #f6f6f6 /*{d-bup-background-end}*/);
}
.ui-btn-up-d:visited,
.ui-btn-up-d a.ui-link-inherit {
color: #333 /*{d-bup-color}*/;
}
.ui-btn-hover-d {
border: 1px solid #aaa /*{d-bhover-border}*/;
background: #eee /*{d-bhover-background-color}*/;
font-weight: bold;
color: #333 /*{d-bhover-color}*/;
cursor: pointer;
text-shadow: 0 /*{d-bhover-shadow-x}*/ 1px /*{d-bhover-shadow-y}*/ 0 /*{d-bhover-shadow-radius}*/ #fff /*{d-bhover-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #eee /*{d-bhover-background-start}*/), to( #fff /*{d-bhover-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #eee /*{d-bhover-background-start}*/, #fff /*{d-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #eee /*{d-bhover-background-start}*/, #fff /*{d-bhover-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #eee /*{d-bhover-background-start}*/, #fff /*{d-bhover-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #eee /*{d-bhover-background-start}*/, #fff /*{d-bhover-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #eee /*{d-bhover-background-start}*/, #fff /*{d-bhover-background-end}*/);
}
.ui-btn-hover-d:visited,
.ui-btn-hover-d:hover,
.ui-btn-hover-d a.ui-link-inherit {
color: #333 /*{d-bhover-color}*/;
}
.ui-btn-down-d {
border: 1px solid #aaa /*{d-bdown-border}*/;
background: #eee /*{d-bdown-background-color}*/;
font-weight: bold;
color: #333 /*{d-bdown-color}*/;
text-shadow: 0 /*{d-bdown-shadow-x}*/ 1px /*{d-bdown-shadow-y}*/ 0 /*{d-bdown-shadow-radius}*/ #fff /*{d-bdown-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #e5e5e5 /*{d-bdown-background-start}*/), to( #f2f2f2 /*{d-bdown-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #e5e5e5 /*{d-bdown-background-start}*/, #f2f2f2 /*{d-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #e5e5e5 /*{d-bdown-background-start}*/, #f2f2f2 /*{d-bdown-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #e5e5e5 /*{d-bdown-background-start}*/, #f2f2f2 /*{d-bdown-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #e5e5e5 /*{d-bdown-background-start}*/, #f2f2f2 /*{d-bdown-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #e5e5e5 /*{d-bdown-background-start}*/, #f2f2f2 /*{d-bdown-background-end}*/);
}
.ui-btn-down-d:visited,
.ui-btn-down-d:hover,
.ui-btn-down-d a.ui-link-inherit {
color: #333 /*{d-bdown-color}*/;
}
.ui-btn-up-d,
.ui-btn-hover-d,
.ui-btn-down-d {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
text-decoration: none;
}
/* E
-----------------------------------------------------------------------------------------------------------*/
.ui-bar-e {
border: 1px solid #f7c942 /*{e-bar-border}*/;
background: #fadb4e /*{e-bar-background-color}*/;
color: #333 /*{e-bar-color}*/;
font-weight: bold;
text-shadow: 0 /*{e-bar-shadow-x}*/ 1px /*{e-bar-shadow-y}*/ 0 /*{e-bar-shadow-radius}*/ #fff /*{e-bar-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #fceda7 /*{e-bar-background-start}*/), to( #fbef7e /*{e-bar-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #fceda7 /*{e-bar-background-start}*/, #fbef7e /*{e-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #fceda7 /*{e-bar-background-start}*/, #fbef7e /*{e-bar-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #fceda7 /*{e-bar-background-start}*/, #fbef7e /*{e-bar-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #fceda7 /*{e-bar-background-start}*/, #fbef7e /*{e-bar-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #fceda7 /*{e-bar-background-start}*/, #fbef7e /*{e-bar-background-end}*/);
}
.ui-bar-e,
.ui-bar-e input,
.ui-bar-e select,
.ui-bar-e textarea,
.ui-bar-e button {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-bar-e .ui-link-inherit {
color: #333 /*{e-bar-color}*/;
}
.ui-bar-e a.ui-link {
color: #2489ce /*{e-bar-link-color}*/;
font-weight: bold;
}
.ui-bar-e a.ui-link:visited {
color: #2489ce /*{e-bar-link-visited}*/;
}
.ui-bar-e a.ui-link:hover {
color: #2489ce /*{e-bar-link-hover}*/;
}
.ui-bar-e a.ui-link:active {
color: #2489ce /*{e-bar-link-active}*/;
}
.ui-body-e,
.ui-overlay-e {
border: 1px solid #f7c942 /*{e-body-border}*/;
color: #222 /*{e-body-color}*/;
text-shadow: 0 /*{e-body-shadow-x}*/ 1px /*{e-body-shadow-y}*/ 0 /*{e-body-shadow-radius}*/ #fff /*{e-body-shadow-color}*/;
background: #fff9df /*{e-body-background-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #fffadf /*{e-body-background-start}*/), to( #fff3a5 /*{e-body-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #fffadf /*{e-body-background-start}*/, #fff3a5 /*{e-body-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #fffadf /*{e-body-background-start}*/, #fff3a5 /*{e-body-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #fffadf /*{e-body-background-start}*/, #fff3a5 /*{e-body-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #fffadf /*{e-body-background-start}*/, #fff3a5 /*{e-body-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #fffadf /*{e-body-background-start}*/, #fff3a5 /*{e-body-background-end}*/);
}
.ui-overlay-e {
background-image: none;
border-width: 0;
}
.ui-body-e,
.ui-body-e input,
.ui-body-e select,
.ui-body-e textarea,
.ui-body-e button {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-body-e .ui-link-inherit {
color: #222 /*{e-body-color}*/;
}
.ui-body-e .ui-link {
color: #2489ce /*{e-body-link-color}*/;
font-weight: bold;
}
.ui-body-e .ui-link:visited {
color: #2489ce /*{e-body-link-visited}*/;
}
.ui-body-e .ui-link:hover {
color: #2489ce /*{e-body-link-hover}*/;
}
.ui-body-e .ui-link:active {
color: #2489ce /*{e-body-link-active}*/;
}
.ui-btn-up-e {
border: 1px solid #f4c63f /*{e-bup-border}*/;
background: #fadb4e /*{e-bup-background-color}*/;
font-weight: bold;
color: #222 /*{e-bup-color}*/;
text-shadow: 0 /*{e-bup-shadow-x}*/ 1px /*{e-bup-shadow-y}*/ 0 /*{e-bup-shadow-radius}*/ #fff /*{e-bup-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #ffefaa /*{e-bup-background-start}*/), to( #ffe155 /*{e-bup-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #ffefaa /*{e-bup-background-start}*/, #ffe155 /*{e-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #ffefaa /*{e-bup-background-start}*/, #ffe155 /*{e-bup-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #ffefaa /*{e-bup-background-start}*/, #ffe155 /*{e-bup-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #ffefaa /*{e-bup-background-start}*/, #ffe155 /*{e-bup-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #ffefaa /*{e-bup-background-start}*/, #ffe155 /*{e-bup-background-end}*/);
}
.ui-btn-up-e:visited,
.ui-btn-up-e a.ui-link-inherit {
color: #222 /*{e-bup-color}*/;
}
.ui-btn-hover-e {
border: 1px solid #f2c43d /*{e-bhover-border}*/;
background: #fbe26f /*{e-bhover-background-color}*/;
font-weight: bold;
color: #111 /*{e-bhover-color}*/;
text-shadow: 0 /*{e-bhover-shadow-x}*/ 1px /*{e-bhover-shadow-y}*/ 0 /*{e-bhover-shadow-radius}*/ #fff /*{e-bhover-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #fff5ba /*{e-bhover-background-start}*/), to( #fbdd52 /*{e-bhover-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #fff5ba /*{e-bhover-background-start}*/, #fbdd52 /*{e-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #fff5ba /*{e-bhover-background-start}*/, #fbdd52 /*{e-bhover-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #fff5ba /*{e-bhover-background-start}*/, #fbdd52 /*{e-bhover-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #fff5ba /*{e-bhover-background-start}*/, #fbdd52 /*{e-bhover-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #fff5ba /*{e-bhover-background-start}*/, #fbdd52 /*{e-bhover-background-end}*/);
}
.ui-btn-hover-e:visited,
.ui-btn-hover-e:hover,
.ui-btn-hover-e a.ui-link-inherit {
color: #333 /*{e-bhover-color}*/;
}
.ui-btn-down-e {
border: 1px solid #f2c43d /*{e-bdown-border}*/;
background: #fceda7 /*{e-bdown-background-color}*/;
font-weight: bold;
color: #111 /*{e-bdown-color}*/;
text-shadow: 0 /*{e-bdown-shadow-x}*/ 1px /*{e-bdown-shadow-y}*/ 0 /*{e-bdown-shadow-radius}*/ #fff /*{e-bdown-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #f8d94c /*{e-bdown-background-start}*/), to( #fadb4e /*{e-bdown-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #f8d94c /*{e-bdown-background-start}*/, #fadb4e /*{e-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #f8d94c /*{e-bdown-background-start}*/, #fadb4e /*{e-bdown-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #f8d94c /*{e-bdown-background-start}*/, #fadb4e /*{e-bdown-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #f8d94c /*{e-bdown-background-start}*/, #fadb4e /*{e-bdown-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #f8d94c /*{e-bdown-background-start}*/, #fadb4e /*{e-bdown-background-end}*/);
}
.ui-btn-down-e:visited,
.ui-btn-down-e:hover,
.ui-btn-down-e a.ui-link-inherit {
color: #333 /*{e-bdown-color}*/;
}
.ui-btn-up-e,
.ui-btn-hover-e,
.ui-btn-down-e {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
text-decoration: none;
}
/* Structure */
/* links within "buttons"
-----------------------------------------------------------------------------------------------------------*/
a.ui-link-inherit {
text-decoration: none !important;
}
/* Active class used as the "on" state across all themes
-----------------------------------------------------------------------------------------------------------*/
.ui-btn-active {
border: 1px solid #2373a5 /*{global-active-border}*/;
background: #5393c5 /*{global-active-background-color}*/;
font-weight: bold;
color: #fff /*{global-active-color}*/;
cursor: pointer;
text-shadow: 0 /*{global-active-shadow-x}*/ 1px /*{global-active-shadow-y}*/ 1px /*{global-active-shadow-radius}*/ #3373a5 /*{global-active-shadow-color}*/;
text-decoration: none;
background-image: -webkit-gradient(linear, left top, left bottom, from( #5393c5 /*{global-active-background-start}*/), to( #6facd5 /*{global-active-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #5393c5 /*{global-active-background-start}*/, #6facd5 /*{global-active-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #5393c5 /*{global-active-background-start}*/, #6facd5 /*{global-active-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #5393c5 /*{global-active-background-start}*/, #6facd5 /*{global-active-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #5393c5 /*{global-active-background-start}*/, #6facd5 /*{global-active-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #5393c5 /*{global-active-background-start}*/, #6facd5 /*{global-active-background-end}*/);
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-btn-active:visited,
.ui-btn-active:hover,
.ui-btn-active a.ui-link-inherit {
color: #fff /*{global-active-color}*/;
}
/* button inner top highlight
-----------------------------------------------------------------------------------------------------------*/
.ui-btn-inner {
border-top: 1px solid #fff;
border-color: rgba(255,255,255,.3);
}
/* corner rounding classes
-----------------------------------------------------------------------------------------------------------*/
.ui-corner-tl {
-moz-border-radius-topleft: .6em /*{global-radii-blocks}*/;
-webkit-border-top-left-radius: .6em /*{global-radii-blocks}*/;
border-top-left-radius: .6em /*{global-radii-blocks}*/;
}
.ui-corner-tr {
-moz-border-radius-topright: .6em /*{global-radii-blocks}*/;
-webkit-border-top-right-radius: .6em /*{global-radii-blocks}*/;
border-top-right-radius: .6em /*{global-radii-blocks}*/;
}
.ui-corner-bl {
-moz-border-radius-bottomleft: .6em /*{global-radii-blocks}*/;
-webkit-border-bottom-left-radius: .6em /*{global-radii-blocks}*/;
border-bottom-left-radius: .6em /*{global-radii-blocks}*/;
}
.ui-corner-br {
-moz-border-radius-bottomright: .6em /*{global-radii-blocks}*/;
-webkit-border-bottom-right-radius: .6em /*{global-radii-blocks}*/;
border-bottom-right-radius: .6em /*{global-radii-blocks}*/;
}
.ui-corner-top {
-moz-border-radius-topleft: .6em /*{global-radii-blocks}*/;
-webkit-border-top-left-radius: .6em /*{global-radii-blocks}*/;
border-top-left-radius: .6em /*{global-radii-blocks}*/;
-moz-border-radius-topright: .6em /*{global-radii-blocks}*/;
-webkit-border-top-right-radius: .6em /*{global-radii-blocks}*/;
border-top-right-radius: .6em /*{global-radii-blocks}*/;
}
.ui-corner-bottom {
-moz-border-radius-bottomleft: .6em /*{global-radii-blocks}*/;
-webkit-border-bottom-left-radius: .6em /*{global-radii-blocks}*/;
border-bottom-left-radius: .6em /*{global-radii-blocks}*/;
-moz-border-radius-bottomright: .6em /*{global-radii-blocks}*/;
-webkit-border-bottom-right-radius: .6em /*{global-radii-blocks}*/;
border-bottom-right-radius: .6em /*{global-radii-blocks}*/;
}
.ui-corner-right {
-moz-border-radius-topright: .6em /*{global-radii-blocks}*/;
-webkit-border-top-right-radius: .6em /*{global-radii-blocks}*/;
border-top-right-radius: .6em /*{global-radii-blocks}*/;
-moz-border-radius-bottomright: .6em /*{global-radii-blocks}*/;
-webkit-border-bottom-right-radius: .6em /*{global-radii-blocks}*/;
border-bottom-right-radius: .6em /*{global-radii-blocks}*/;
}
.ui-corner-left {
-moz-border-radius-topleft: .6em /*{global-radii-blocks}*/;
-webkit-border-top-left-radius: .6em /*{global-radii-blocks}*/;
border-top-left-radius: .6em /*{global-radii-blocks}*/;
-moz-border-radius-bottomleft: .6em /*{global-radii-blocks}*/;
-webkit-border-bottom-left-radius: .6em /*{global-radii-blocks}*/;
border-bottom-left-radius: .6em /*{global-radii-blocks}*/;
}
.ui-corner-all {
-moz-border-radius: .6em /*{global-radii-blocks}*/;
-webkit-border-radius: .6em /*{global-radii-blocks}*/;
border-radius: .6em /*{global-radii-blocks}*/;
}
.ui-corner-none {
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
}
/* Form field separator
-----------------------------------------------------------------------------------------------------------*/
.ui-br {
border-bottom: rgb(130,130,130);
border-bottom: rgba(130,130,130,.3);
border-bottom-width: 1px;
border-bottom-style: solid;
}
/* Interaction cues
-----------------------------------------------------------------------------------------------------------*/
.ui-disabled {
filter: Alpha(Opacity=30);
opacity: .3;
zoom: 1;
}
.ui-disabled,
.ui-disabled a {
cursor: default !important;
pointer-events: none;
}
/* Icons
-----------------------------------------------------------------------------------------------------------*/
.ui-icon,
.ui-icon-searchfield:after {
background: #666 /*{global-icon-color}*/;
background: rgba(0,0,0,.4) /*{global-icon-disc}*/;
background-image: url(images/icons-18-white.png) /*{global-icon-set}*/;
background-repeat: no-repeat;
-moz-border-radius: 9px;
-webkit-border-radius: 9px;
border-radius: 9px;
}
/* Alt icon color
-----------------------------------------------------------------------------------------------------------*/
.ui-icon-alt {
background: #fff;
background: rgba(255,255,255,.3);
background-image: url(images/icons-18-black.png);
background-repeat: no-repeat;
}
/* HD/"retina" sprite
-----------------------------------------------------------------------------------------------------------*/
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (min-resolution: 240dpi) {
.ui-icon-plus, .ui-icon-minus, .ui-icon-delete, .ui-icon-arrow-r,
.ui-icon-arrow-l, .ui-icon-arrow-u, .ui-icon-arrow-d, .ui-icon-check,
.ui-icon-gear, .ui-icon-refresh, .ui-icon-forward, .ui-icon-back,
.ui-icon-grid, .ui-icon-star, .ui-icon-alert, .ui-icon-info, .ui-icon-home, .ui-icon-search, .ui-icon-searchfield:after,
.ui-icon-checkbox-off, .ui-icon-checkbox-on, .ui-icon-radio-off, .ui-icon-radio-on {
background-image: url(images/icons-36-white.png);
-moz-background-size: 776px 18px;
-o-background-size: 776px 18px;
-webkit-background-size: 776px 18px;
background-size: 776px 18px;
}
.ui-icon-alt {
background-image: url(images/icons-36-black.png);
}
}
/* plus minus */
.ui-icon-plus {
background-position: -0 50%;
}
.ui-icon-minus {
background-position: -36px 50%;
}
/* delete/close */
.ui-icon-delete {
background-position: -72px 50%;
}
/* arrows */
.ui-icon-arrow-r {
background-position: -108px 50%;
}
.ui-icon-arrow-l {
background-position: -144px 50%;
}
.ui-icon-arrow-u {
background-position: -180px 50%;
}
.ui-icon-arrow-d {
background-position: -216px 50%;
}
/* misc */
.ui-icon-check {
background-position: -252px 50%;
}
.ui-icon-gear {
background-position: -288px 50%;
}
.ui-icon-refresh {
background-position: -324px 50%;
}
.ui-icon-forward {
background-position: -360px 50%;
}
.ui-icon-back {
background-position: -396px 50%;
}
.ui-icon-grid {
background-position: -432px 50%;
}
.ui-icon-star {
background-position: -468px 50%;
}
.ui-icon-alert {
background-position: -504px 50%;
}
.ui-icon-info {
background-position: -540px 50%;
}
.ui-icon-home {
background-position: -576px 50%;
}
.ui-icon-search,
.ui-icon-searchfield:after {
background-position: -612px 50%;
}
.ui-icon-checkbox-off {
background-position: -684px 50%;
}
.ui-icon-checkbox-on {
background-position: -648px 50%;
}
.ui-icon-radio-off {
background-position: -756px 50%;
}
.ui-icon-radio-on {
background-position: -720px 50%;
}
/* checks,radios */
.ui-checkbox .ui-icon,
.ui-selectmenu-list .ui-icon {
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.ui-icon-checkbox-off,
.ui-icon-radio-off {
background-color: transparent;
}
.ui-checkbox-on .ui-icon,
.ui-radio-on .ui-icon {
background-color: #4596ce /*{global-active-background-color}*/; /* NOTE: this hex should match the active state color. It's repeated here for cascade */
}
/* loading icon */
.ui-icon-loading {
background: url(images/ajax-loader.gif);
background-size: 46px 46px;
}
/* Button corner classes
-----------------------------------------------------------------------------------------------------------*/
.ui-btn-corner-tl {
-moz-border-radius-topleft: 1em /*{global-radii-buttons}*/;
-webkit-border-top-left-radius: 1em /*{global-radii-buttons}*/;
border-top-left-radius: 1em /*{global-radii-buttons}*/;
}
.ui-btn-corner-tr {
-moz-border-radius-topright: 1em /*{global-radii-buttons}*/;
-webkit-border-top-right-radius: 1em /*{global-radii-buttons}*/;
border-top-right-radius: 1em /*{global-radii-buttons}*/;
}
.ui-btn-corner-bl {
-moz-border-radius-bottomleft: 1em /*{global-radii-buttons}*/;
-webkit-border-bottom-left-radius: 1em /*{global-radii-buttons}*/;
border-bottom-left-radius: 1em /*{global-radii-buttons}*/;
}
.ui-btn-corner-br {
-moz-border-radius-bottomright: 1em /*{global-radii-buttons}*/;
-webkit-border-bottom-right-radius: 1em /*{global-radii-buttons}*/;
border-bottom-right-radius: 1em /*{global-radii-buttons}*/;
}
.ui-btn-corner-top {
-moz-border-radius-topleft: 1em /*{global-radii-buttons}*/;
-webkit-border-top-left-radius: 1em /*{global-radii-buttons}*/;
border-top-left-radius: 1em /*{global-radii-buttons}*/;
-moz-border-radius-topright: 1em /*{global-radii-buttons}*/;
-webkit-border-top-right-radius: 1em /*{global-radii-buttons}*/;
border-top-right-radius: 1em /*{global-radii-buttons}*/;
}
.ui-btn-corner-bottom {
-moz-border-radius-bottomleft: 1em /*{global-radii-buttons}*/;
-webkit-border-bottom-left-radius: 1em /*{global-radii-buttons}*/;
border-bottom-left-radius: 1em /*{global-radii-buttons}*/;
-moz-border-radius-bottomright: 1em /*{global-radii-buttons}*/;
-webkit-border-bottom-right-radius: 1em /*{global-radii-buttons}*/;
border-bottom-right-radius: 1em /*{global-radii-buttons}*/;
}
.ui-btn-corner-right {
-moz-border-radius-topright: 1em /*{global-radii-buttons}*/;
-webkit-border-top-right-radius: 1em /*{global-radii-buttons}*/;
border-top-right-radius: 1em /*{global-radii-buttons}*/;
-moz-border-radius-bottomright: 1em /*{global-radii-buttons}*/;
-webkit-border-bottom-right-radius: 1em /*{global-radii-buttons}*/;
border-bottom-right-radius: 1em /*{global-radii-buttons}*/;
}
.ui-btn-corner-left {
-moz-border-radius-topleft: 1em /*{global-radii-buttons}*/;
-webkit-border-top-left-radius: 1em /*{global-radii-buttons}*/;
border-top-left-radius: 1em /*{global-radii-buttons}*/;
-moz-border-radius-bottomleft: 1em /*{global-radii-buttons}*/;
-webkit-border-bottom-left-radius: 1em /*{global-radii-buttons}*/;
border-bottom-left-radius: 1em /*{global-radii-buttons}*/;
}
.ui-btn-corner-all {
-moz-border-radius: 1em /*{global-radii-buttons}*/;
-webkit-border-radius: 1em /*{global-radii-buttons}*/;
border-radius: 1em /*{global-radii-buttons}*/;
}
/* radius clip workaround for cleaning up corner trapping */
.ui-corner-tl,
.ui-corner-tr,
.ui-corner-bl,
.ui-corner-br,
.ui-corner-top,
.ui-corner-bottom,
.ui-corner-right,
.ui-corner-left,
.ui-corner-all,
.ui-btn-corner-tl,
.ui-btn-corner-tr,
.ui-btn-corner-bl,
.ui-btn-corner-br,
.ui-btn-corner-top,
.ui-btn-corner-bottom,
.ui-btn-corner-right,
.ui-btn-corner-left,
.ui-btn-corner-all {
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
}
/* Overlay / modal
-----------------------------------------------------------------------------------------------------------*/
.ui-overlay {
background: #666;
filter: Alpha(Opacity=50);
opacity: .5;
position: absolute;
width: 100%;
height: 100%;
}
.ui-overlay-shadow {
-moz-box-shadow: 0px 0px 12px rgba(0,0,0,.6);
-webkit-box-shadow: 0px 0px 12px rgba(0,0,0,.6);
box-shadow: 0px 0px 12px rgba(0,0,0,.6);
}
.ui-shadow {
-moz-box-shadow: 0px 1px 4px /*{global-box-shadow-size}*/ rgba(0,0,0,.3) /*{global-box-shadow-color}*/;
-webkit-box-shadow: 0px 1px 4px /*{global-box-shadow-size}*/ rgba(0,0,0,.3) /*{global-box-shadow-color}*/;
box-shadow: 0px 1px 4px /*{global-box-shadow-size}*/ rgba(0,0,0,.3) /*{global-box-shadow-color}*/;
}
.ui-bar-a .ui-shadow,
.ui-bar-b .ui-shadow ,
.ui-bar-c .ui-shadow {
-moz-box-shadow: 0px 1px 0 rgba(255,255,255,.3);
-webkit-box-shadow: 0px 1px 0 rgba(255,255,255,.3);
box-shadow: 0px 1px 0 rgba(255,255,255,.3);
}
.ui-shadow-inset {
-moz-box-shadow: inset 0px 1px 4px rgba(0,0,0,.2);
-webkit-box-shadow: inset 0px 1px 4px rgba(0,0,0,.2);
box-shadow: inset 0px 1px 4px rgba(0,0,0,.2);
}
.ui-icon-shadow {
-moz-box-shadow: 0px 1px 0 rgba(255,255,255,.4) /*{global-icon-shadow}*/;
-webkit-box-shadow: 0px 1px 0 rgba(255,255,255,.4) /*{global-icon-shadow}*/;
box-shadow: 0px 1px 0 rgba(255,255,255,.4) /*{global-icon-shadow}*/;
}
/* Focus state - set here for specificity (note: these classes are added by JavaScript)
-----------------------------------------------------------------------------------------------------------*/
.ui-btn:focus, .ui-link-inherit:focus {
outline: 0;
}
.ui-btn.ui-focus {
z-index: 1;
}
.ui-focus,
.ui-btn:focus {
-moz-box-shadow: inset 0px 0px 3px #387bbe /*{global-active-background-color}*/, 0px 0px 9px #387bbe /*{global-active-background-color}*/;
-webkit-box-shadow: inset 0px 0px 3px #387bbe /*{global-active-background-color}*/, 0px 0px 9px #387bbe /*{global-active-background-color}*/;
box-shadow: inset 0px 0px 3px #387bbe /*{global-active-background-color}*/, 0px 0px 9px #387bbe /*{global-active-background-color}*/;
}
.ui-input-text.ui-focus,
.ui-input-search.ui-focus {
-moz-box-shadow: 0px 0px 12px #387bbe /*{global-active-background-color}*/;
-webkit-box-shadow: 0px 0px 12px #387bbe /*{global-active-background-color}*/;
box-shadow: 0px 0px 12px #387bbe /*{global-active-background-color}*/;
}
/* unset box shadow in browsers that don't do it right
-----------------------------------------------------------------------------------------------------------*/
.ui-mobile-nosupport-boxshadow * {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
}
/* ...and bring back focus */
.ui-mobile-nosupport-boxshadow .ui-focus,
.ui-mobile-nosupport-boxshadow .ui-btn:focus,
.ui-mobile-nosupport-boxshadow .ui-link-inherit:focus {
outline-width: 1px;
outline-style: auto;
}
| Download/cdnjs | ajax/libs/jquery-mobile/1.2.0/jquery.mobile.theme.css | CSS | mit | 53,215 |
var MapCache = require('../internal/MapCache');
/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';
/**
* Creates a function that memoizes the result of `func`. If `resolver` is
* provided it determines the cache key for storing the result based on the
* arguments provided to the memoized function. By default, the first argument
* provided to the memoized function is coerced to a string and used as the
* cache key. The `func` is invoked with the `this` binding of the memoized
* function.
*
* **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the [`Map`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-properties-of-the-map-prototype-object)
* method interface of `get`, `has`, and `set`.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to have its output memoized.
* @param {Function} [resolver] The function to resolve the cache key.
* @returns {Function} Returns the new memoizing function.
* @example
*
* var upperCase = _.memoize(function(string) {
* return string.toUpperCase();
* });
*
* upperCase('fred');
* // => 'FRED'
*
* // modifying the result cache
* upperCase.cache.set('fred', 'BARNEY');
* upperCase('fred');
* // => 'BARNEY'
*
* // replacing `_.memoize.Cache`
* var object = { 'user': 'fred' };
* var other = { 'user': 'barney' };
* var identity = _.memoize(_.identity);
*
* identity(object);
* // => { 'user': 'fred' }
* identity(other);
* // => { 'user': 'fred' }
*
* _.memoize.Cache = WeakMap;
* var identity = _.memoize(_.identity);
*
* identity(object);
* // => { 'user': 'fred' }
* identity(other);
* // => { 'user': 'barney' }
*/
function memoize(func, resolver) {
if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
throw new TypeError(FUNC_ERROR_TEXT);
}
var memoized = function() {
var args = arguments,
cache = memoized.cache,
key = resolver ? resolver.apply(this, args) : args[0];
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
cache.set(key, result);
return result;
};
memoized.cache = new memoize.Cache;
return memoized;
}
// Assign cache to `_.memoize`.
memoize.Cache = MapCache;
module.exports = memoize;
| DanielJRaine/employee-forms-auth | node_modules/jshint/node_modules/lodash/function/memoize.js | JavaScript | mit | 2,479 |
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("a11yhelp","sr",{title:"Accessibility Instructions",contents:"Help Contents. To close this dialog press ESC.",legend:[{name:"Опште",items:[{name:"Editor Toolbar",legend:"Press ${toolbarFocus} to navigate to the toolbar. Move to the next and previous toolbar group with TAB and SHIFT-TAB. Move to the next and previous toolbar button with RIGHT ARROW or LEFT ARROW. Press SPACE or ENTER to activate the toolbar button."},{name:"Editor Dialog",legend:"Inside a dialog, press TAB to navigate to next dialog field, press SHIFT + TAB to move to previous field, press ENTER to submit dialog, press ESC to cancel dialog. For dialogs that have multiple tab pages, press ALT + F10 to navigate to tab-list. Then move to next tab with TAB OR RIGTH ARROW. Move to previous tab with SHIFT + TAB or LEFT ARROW. Press SPACE or ENTER to select the tab page."},
{name:"Editor Context Menu",legend:"Press ${contextMenu} or APPLICATION KEY to open context-menu. Then move to next menu option with TAB or DOWN ARROW. Move to previous option with SHIFT+TAB or UP ARROW. Press SPACE or ENTER to select the menu option. Open sub-menu of current option with SPACE or ENTER or RIGHT ARROW. Go back to parent menu item with ESC or LEFT ARROW. Close context menu with ESC."},{name:"Editor List Box",legend:"Inside a list-box, move to next list item with TAB OR DOWN ARROW. Move to previous list item with SHIFT + TAB or UP ARROW. Press SPACE or ENTER to select the list option. Press ESC to close the list-box."},
{name:"Editor Element Path Bar",legend:"Press ${elementsPathFocus} to navigate to the elements path bar. Move to next element button with TAB or RIGHT ARROW. Move to previous button with SHIFT+TAB or LEFT ARROW. Press SPACE or ENTER to select the element in editor."}]},{name:"Commands",items:[{name:" Undo command",legend:"Press ${undo}"},{name:" Redo command",legend:"Press ${redo}"},{name:" Bold command",legend:"Press ${bold}"},{name:" Italic command",legend:"Press ${italic}"},{name:" Underline command",
legend:"Press ${underline}"},{name:" Link command",legend:"Press ${link}"},{name:" Toolbar Collapse command",legend:"Press ${toolbarCollapse}"},{name:" Access previous focus space command",legend:"Press ${accessPreviousSpace} to access the closest unreachable focus space before the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces."},{name:" Access next focus space command",legend:"Press ${accessNextSpace} to access the closest unreachable focus space after the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces."},
{name:" Accessibility Help",legend:"Press ${a11yHelp}"}]}]}); | jeansouza/prototipo-temp-bd | plugins/ckeditor/plugins/a11yhelp/dialogs/lang/sr.js | JavaScript | mit | 2,863 |
var apply = require('./_apply'),
createCtor = require('./_createCtor'),
createHybrid = require('./_createHybrid'),
createRecurry = require('./_createRecurry'),
getHolder = require('./_getHolder'),
replaceHolders = require('./_replaceHolders'),
root = require('./_root');
/**
* Creates a function that wraps `func` to enable currying.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {number} arity The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createCurry(func, bitmask, arity) {
var Ctor = createCtor(func);
function wrapper() {
var length = arguments.length,
args = Array(length),
index = length,
placeholder = getHolder(wrapper);
while (index--) {
args[index] = arguments[index];
}
var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
? []
: replaceHolders(args, placeholder);
length -= holders.length;
if (length < arity) {
return createRecurry(
func, bitmask, createHybrid, wrapper.placeholder, undefined,
args, holders, undefined, undefined, arity - length);
}
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return apply(fn, this, args);
}
return wrapper;
}
module.exports = createCurry;
| jessest/hugo-foundation-sass | node_modules/babel-plugin-transform-es2015-shorthand-properties/node_modules/babel-types/node_modules/lodash/_createCurry.js | JavaScript | mit | 1,447 |
define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/lang"),s=e("../lib/event"),o=".ace_search {background-color: #ddd;border: 1px solid #cbcbcb;border-top: 0 none;max-width: 325px;overflow: hidden;margin: 0;padding: 4px;padding-right: 6px;padding-bottom: 0;position: absolute;top: 0px;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {border-radius: 3px;border: 1px solid #cbcbcb;float: left;margin-bottom: 4px;overflow: hidden;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {background-color: white;border-right: 1px solid #cbcbcb;border: 0 none;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;float: left;height: 22px;outline: 0;padding: 0 7px;width: 214px;margin: 0;}.ace_searchbtn,.ace_replacebtn {background: #fff;border: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;float: left;height: 22px;margin: 0;position: relative;}.ace_searchbtn:last-child,.ace_replacebtn:last-child {border-top-right-radius: 3px;border-bottom-right-radius: 3px;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn {background-position: 50% 50%;background-repeat: no-repeat;width: 27px;}.ace_searchbtn.prev {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiSU1NZUAC/6E0I0yACYskCpsJiySKIiY0SUZk40FyTEgCjGgKwTRAgAEAQJUIPCE+qfkAAAAASUVORK5CYII=); }.ace_searchbtn.next {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNpiTE1NZQCC/0DMyIAKwGJMUAYDEo3M/s+EpvM/mkKwCQxYjIeLMaELoLMBAgwAU7UJObTKsvAAAAAASUVORK5CYII=); }.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;float: right;font: 16px/16px Arial;height: 14px;margin: 5px 1px 9px 5px;padding: 0;text-align: center;width: 14px;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_replacebtn.prev {width: 54px}.ace_replacebtn.next {width: 27px}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;-moz-box-sizing: border-box;box-sizing: border-box;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;}",u=e("../keyboard/hash_handler").HashHandler,a=e("../lib/keys");r.importCssString(o,"ace_searchbox");var f='<div class="ace_search right"> <button type="button" action="hide" class="ace_searchbtn_close"></button> <div class="ace_search_form"> <input class="ace_search_field" placeholder="Search for" spellcheck="false"></input> <button type="button" action="findNext" class="ace_searchbtn next"></button> <button type="button" action="findPrev" class="ace_searchbtn prev"></button> <button type="button" action="findAll" class="ace_searchbtn" title="Alt-Enter">All</button> </div> <div class="ace_replace_form"> <input class="ace_search_field" placeholder="Replace with" spellcheck="false"></input> <button type="button" action="replaceAndFindNext" class="ace_replacebtn">Replace</button> <button type="button" action="replaceAll" class="ace_replacebtn">All</button> </div> <div class="ace_search_options"> <span action="toggleRegexpMode" class="ace_button" title="RegExp Search">.*</span> <span action="toggleCaseSensitive" class="ace_button" title="CaseSensitive Search">Aa</span> <span action="toggleWholeWords" class="ace_button" title="Whole Word Search">\\b</span> </div></div>'.replace(/>\s+/g,">"),l=function(e,t,n){var i=r.createElement("div");i.innerHTML=f,this.element=i.firstChild,this.$init(),this.setEditor(e)};(function(){this.setEditor=function(e){e.searchBox=this,e.container.appendChild(this.element),this.editor=e},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOptions=e.querySelector(".ace_search_options"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;s.addListener(e,"mousedown",function(e){setTimeout(function(){t.activeInput.focus()},0),s.stopPropagation(e)}),s.addListener(e,"click",function(e){var n=e.target||e.srcElement,r=n.getAttribute("action");r&&t[r]?t[r]():t.$searchBarKb.commands[r]&&t.$searchBarKb.commands[r].exec(t),s.stopPropagation(e)}),s.addCommandKeyListener(e,function(e,n,r){var i=a.keyCodeToString(r),o=t.$searchBarKb.findKeyCommand(n,i);o&&o.exec&&(o.exec(t),s.stopEvent(e))}),this.$onChange=i.delayedCall(function(){t.find(!1,!1)}),s.addListener(this.searchInput,"input",function(){t.$onChange.schedule(20)}),s.addListener(this.searchInput,"focus",function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()}),s.addListener(this.replaceInput,"focus",function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()})},this.$closeSearchBarKb=new u([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new u,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.replaceBox.style.display="",e.replaceInput.focus()},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}}]),this.$syncOptions=function(){r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked),this.find(!1,!1)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,n){var i=this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n});r.setCssClass(this.searchBox,"ace_nomatch",!i&&this.searchInput.value),this.highlight()},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked}),t=!e&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",t),this.editor._emit("findSearchBox",{match:!t}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.element.style.display="",this.replaceBox.style.display=t?"":"none",this.isReplace=t,e&&(this.searchInput.value=e),this.find(!1,!1,!0),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(l.prototype),t.SearchBox=l,t.Search=function(e,t){var n=e.searchBox||new l(e);n.show(e.session.getTextRange(),t)}}),define("ace/ext/old_ie",["require","exports","module","ace/lib/useragent","ace/tokenizer","ace/ext/searchbox","ace/mode/text"],function(require,exports,module){"use strict";function patch(obj,name,regexp,replacement){eval("obj['"+name+"']="+obj[name].toString().replace(regexp,replacement))}var MAX_TOKEN_COUNT=1e3,useragent=require("../lib/useragent"),TokenizerModule=require("../tokenizer");useragent.isIE&&useragent.isIE<10&&window.top.document.compatMode==="BackCompat"&&(useragent.isOldIE=!0);if(typeof document!="undefined"&&!document.documentElement.querySelector){useragent.isOldIE=!0;var qs=function(e,t){if(t.charAt(0)==".")var n=t.slice(1);else var r=t.match(/(\w+)=(\w+)/),i=r&&r[1],s=r&&r[2];for(var o=0;o<e.all.length;o++){var u=e.all[o];if(n){if(u.className.indexOf(n)!=-1)return u}else if(i&&u.getAttribute(i)==s)return u}},sb=require("./searchbox").SearchBox.prototype;patch(sb,"$initElements",/([^\s=]*).querySelector\((".*?")\)/g,"qs($1, $2)")}var compliantExecNpcg=/()??/.exec("")[1]===undefined;if(compliantExecNpcg)return;var proto=TokenizerModule.Tokenizer.prototype;TokenizerModule.Tokenizer_orig=TokenizerModule.Tokenizer,proto.getLineTokens_orig=proto.getLineTokens,patch(TokenizerModule,"Tokenizer","ruleRegExps.push(adjustedregex);\n",function(e){return e+' if (state[i].next && RegExp(adjustedregex).test(""))\n rule._qre = RegExp(adjustedregex, "g");\n '}),TokenizerModule.Tokenizer.prototype=proto,patch(proto,"getLineTokens",/if \(match\[i \+ 1\] === undefined\)\s*continue;/,"if (!match[i + 1]) {\n if (value)continue;\n var qre = state[mapping[i]]._qre;\n if (!qre) continue;\n qre.lastIndex = lastIndex;\n if (!qre.exec(line) || qre.lastIndex != lastIndex)\n continue;\n }"),patch(require("../mode/text").Mode.prototype,"getTokenizer",/Tokenizer/,"TokenizerModule.Tokenizer"),useragent.isOldIE=!0});
(function() {
window.require(["ace/ext/old_ie"], function() {});
})();
| sancospi/jsdelivr | files/ace/1.2.4/min/ext-old_ie.js | JavaScript | mit | 11,846 |
<?php
/*
* This file is part of Psy Shell.
*
* (c) 2012-2017 Justin Hileman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Psy\TabCompletion\Matcher;
/**
* A MongoDB tab completion Matcher.
*
* This matcher provides completion for Mongo collection names.
*
* @author Marc Garcia <markcial@gmail.com>
*/
class MongoDatabaseMatcher extends AbstractContextAwareMatcher
{
/**
* {@inheritdoc}
*/
public function getMatches(array $tokens, array $info = array())
{
$input = $this->getInput($tokens);
$firstToken = array_pop($tokens);
if (self::tokenIs($firstToken, self::T_STRING)) {
// second token is the object operator
array_pop($tokens);
}
$objectToken = array_pop($tokens);
$objectName = str_replace('$', '', $objectToken[1]);
$object = $this->getVariable($objectName);
if (!$object instanceof \MongoDB) {
return array();
}
return array_filter(
$object->getCollectionNames(),
function ($var) use ($input) {
return AbstractMatcher::startsWith($input, $var);
}
);
}
/**
* {@inheritdoc}
*/
public function hasMatched(array $tokens)
{
$token = array_pop($tokens);
$prevToken = array_pop($tokens);
switch (true) {
case self::tokenIs($token, self::T_OBJECT_OPERATOR):
case self::tokenIs($prevToken, self::T_OBJECT_OPERATOR):
return true;
}
return false;
}
}
| frankent/nds-maengron | vendor/psy/psysh/src/Psy/TabCompletion/Matcher/MongoDatabaseMatcher.php | PHP | mit | 1,674 |
"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:["Tesiran","Teipa"],DAY:["Mderot ee are","Mderot ee kuni","Mderot ee ong’wan","Mderot ee inet","Mderot ee ile","Mderot ee sapa","Mderot ee kwe"],ERANAMES:["Kabla ya Christo","Baada ya Christo"],ERAS:["KK","BK"],FIRSTDAYOFWEEK:0,MONTH:["Lapa le obo","Lapa le waare","Lapa le okuni","Lapa le ong’wan","Lapa le imet","Lapa le ile","Lapa le sapa","Lapa le isiet","Lapa le saal","Lapa le tomon","Lapa le tomon obo","Lapa le tomon waare"],SHORTDAY:["Are","Kun","Ong","Ine","Ile","Sap","Kwe"],SHORTMONTH:["Obo","Waa","Oku","Ong","Ime","Ile","Sap","Isi","Saa","Tom","Tob","Tow"],WEEKENDRANGE:[5,6],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:"Ksh",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-¤",negSuf:"",posPre:"¤",posSuf:""}]},id:"saq",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}})}]);
| sympmarc/cdnjs | ajax/libs/angular-i18n/1.5.0-beta.2/angular-locale_saq.min.js | JavaScript | mit | 1,655 |
"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:["ب.ن","د.ن"],DAY:["یەکشەممە","دووشەممە","سێشەممە","چوارشەممە","پێنجشەممە","ھەینی","شەممە"],ERANAMES:["پێش زایین","زایینی"],ERAS:["پێش زاییین","ز"],FIRSTDAYOFWEEK:5,MONTH:["کانوونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمووز","ئاب","ئەیلوول","تشرینی یەکەم","تشرینی دووەم","کانونی یەکەم"],SHORTDAY:["یەکشەممە","دووشەممە","سێشەممە","چوارشەممە","پێنجشەممە","ھەینی","شەممە"],SHORTMONTH:["کانوونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمووز","ئاب","ئەیلوول","تشرینی یەکەم","تشرینی دووەم","کانونی یەکەم"],WEEKENDRANGE:[4,5],fullDate:"y MMMM d, EEEE",longDate:"dی MMMMی y",medium:"y MMM d HH:mm:ss",mediumDate:"y MMM d",mediumTime:"HH:mm:ss","short":"y-MM-dd HH:mm",shortDate:"y-MM-dd",shortTime:"HH:mm"},NUMBER_FORMATS:{CURRENCY_SYM:"din",DECIMAL_SEP:"٫",GROUP_SEP:"٬",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-¤ ",negSuf:"",posPre:"¤ ",posSuf:""}]},id:"ckb-iq",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}})}]);
| hanbyul-here/cdnjs | ajax/libs/angular-i18n/1.4.8/angular-locale_ckb-iq.min.js | JavaScript | mit | 1,924 |
"use strict";
const conversions = require("webidl-conversions");
const utils = require("./utils.js");
const HTMLElement = require("./HTMLElement.js");
const impl = utils.implSymbol;
function HTMLProgressElement() {
throw new TypeError("Illegal constructor");
}
HTMLProgressElement.prototype = Object.create(HTMLElement.interface.prototype);
HTMLProgressElement.prototype.constructor = HTMLProgressElement;
HTMLProgressElement.prototype.toString = function () {
if (this === HTMLProgressElement.prototype) {
return "[object HTMLProgressElementPrototype]";
}
return HTMLElement.interface.prototype.toString.call(this);
};
module.exports = {
mixedInto: [],
is(obj) {
if (obj) {
if (obj[impl] instanceof Impl.implementation) {
return true;
}
for (let i = 0; i < module.exports.mixedInto.length; ++i) {
if (obj instanceof module.exports.mixedInto[i]) {
return true;
}
}
}
return false;
},
isImpl(obj) {
if (obj) {
if (obj instanceof Impl.implementation) {
return true;
}
const wrapper = utils.wrapperForImpl(obj);
for (let i = 0; i < module.exports.mixedInto.length; ++i) {
if (wrapper instanceof module.exports.mixedInto[i]) {
return true;
}
}
}
return false;
},
create(constructorArgs, privateData) {
let obj = Object.create(HTMLProgressElement.prototype);
this.setup(obj, constructorArgs, privateData);
return obj;
},
createImpl(constructorArgs, privateData) {
let obj = Object.create(HTMLProgressElement.prototype);
this.setup(obj, constructorArgs, privateData);
return utils.implForWrapper(obj);
},
_internalSetup(obj) {
HTMLElement._internalSetup(obj);
},
setup(obj, constructorArgs, privateData) {
if (!privateData) privateData = {};
privateData.wrapper = obj;
this._internalSetup(obj);
obj[impl] = new Impl.implementation(constructorArgs, privateData);
obj[impl][utils.wrapperSymbol] = obj;
},
interface: HTMLProgressElement,
expose: {
Window: { HTMLProgressElement: HTMLProgressElement }
}
};
const Impl = require("../nodes/HTMLProgressElement-impl.js");
| aurimas-darguzis/react-intro | node_modules/jsdom/lib/jsdom/living/generated/HTMLProgressElement.js | JavaScript | mit | 2,212 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>A tiny, opensource, Bootstrap WYSIWYG rich text editor</title>
<link href="../bower_components/google-code-prettify/src/prettify.css" rel="stylesheet" />
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
<link href="http://netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.css" rel="stylesheet" />
<link href="../css/style.css" rel="stylesheet" />
</head>
<body>
<div class="container">
<h1>Simple HTML Editor</h1>
<div class="btn-toolbar" data-role="editor-toolbar"
data-target="#editor">
<div class="btn-group">
<a class="btn btn-default dropdown-toggle" data-toggle="dropdown" title="Font Size"><i class="fa fa-text-height"></i> <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a data-edit="fontSize 5" class="fs-Five">Huge</a></li>
<li><a data-edit="fontSize 3" class="fs-Three">Normal</a></li>
<li><a data-edit="fontSize 1" class="fs-One">Small</a></li>
</ul>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="bold" title="Bold (Ctrl/Cmd+B)"><i class="fa fa-bold"></i></a>
<a class="btn btn-default" data-edit="italic" title="Italic (Ctrl/Cmd+I)"><i class="fa fa-italic"></i></a>
<a class="btn btn-default" data-edit="strikethrough" title="Strikethrough"><i class="fa fa-strikethrough"></i></a>
<a class="btn btn-default" data-edit="underline" title="Underline (Ctrl/Cmd+U)"><i class="fa fa-underline"></i></a>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="insertunorderedlist" title="Bullet list"><i class="fa fa-list-ul"></i></a>
<a class="btn btn-default" data-edit="insertorderedlist" title="Number list"><i class="fa fa-list-ol"></i></a>
<a class="btn btn-default" data-edit="outdent" title="Reduce indent (Shift+Tab)"><i class="fa fa-outdent"></i></a>
<a class="btn btn-default" data-edit="indent" title="Indent (Tab)"><i class="fa fa-indent"></i></a>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="justifyleft" title="Align Left (Ctrl/Cmd+L)"><i class="fa fa-align-left"></i></a>
<a class="btn btn-default" data-edit="justifycenter" title="Center (Ctrl/Cmd+E)"><i class="fa fa-align-center"></i></a>
<a class="btn btn-default" data-edit="justifyright" title="Align Right (Ctrl/Cmd+R)"><i class="fa fa-align-right"></i></a>
<a class="btn btn-default" data-edit="justifyfull" title="Justify (Ctrl/Cmd+J)"><i class="fa fa-align-justify"></i></a>
</div>
<div class="btn-group">
<a class="btn btn-default dropdown-toggle" data-toggle="dropdown" title="Hyperlink"><i class="fa fa-link"></i></a>
<div class="dropdown-menu input-append">
<input placeholder="URL" type="text" data-edit="createLink" />
<button class="btn" type="button">Add</button>
</div>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="unlink" title="Remove Hyperlink"><i class="fa fa-unlink"></i></a>
<span class="btn btn-default" title="Insert picture (or just drag & drop)" id="pictureBtn"> <i class="fa fa-picture-o"></i>
<input class="imgUpload" type="file" data-role="magic-overlay" data-target="#pictureBtn" data-edit="insertImage" />
</span>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="undo" title="Undo (Ctrl/Cmd+Z)"><i class="fa fa-undo"></i></a>
<a class="btn btn-default" data-edit="redo" title="Redo (Ctrl/Cmd+Y)"><i class="fa fa-repeat"></i></a>
<a class="btn btn-default" data-edit="html" title="Clear Formatting"><i class='glyphicon glyphicon-pencil'></i></a>
</div>
</div>
<div id="editor" class="lead" data-placeholder="This is a basic example with a simple toolbar."></div>
<div id="editorPreview"></div>
<p style="text-align: center;">
<a class="btn btn-large btn-default jumbo" href="#!" onClick="$('#editorPreview').html($('#editor').cleanHtml());">Submit</a>
</p>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="../bower_components/jquery.hotkeys/jquery.hotkeys.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="../bower_components/google-code-prettify/src/prettify.js"></script>
<script src="../src/bootstrap-wysiwyg.js"></script>
<script type='text/javascript'>
$('#editor').wysiwyg();
$(".dropdown-menu > input").click(function (e) {
e.stopPropagation();
});
</script>
</body>
</html> | dharmendra25d/cgcolors-store | backassets/vendors/bootstrap-wysiwyg/examples/html-editor.html | HTML | mit | 4,809 |
'use strict';
/**
* This class is the "this" of the it/beforeEach/afterEach method.
* Responsibilities:
* - "this" for it/beforeEach/afterEach
* - keep state for single it/beforeEach/afterEach execution
* - keep track of all of the futures to execute
* - run single spec (execute each future)
*/
angular.scenario.SpecRunner = function() {
this.futures = [];
this.afterIndex = 0;
};
/**
* Executes a spec which is an it block with associated before/after functions
* based on the describe nesting.
*
* @param {Object} spec A spec object
* @param {function()} specDone function that is called when the spec finishes,
* of the form `Function(error, index)`
*/
angular.scenario.SpecRunner.prototype.run = function(spec, specDone) {
var self = this;
this.spec = spec;
this.emit('SpecBegin', spec);
try {
spec.before.call(this);
spec.body.call(this);
this.afterIndex = this.futures.length;
spec.after.call(this);
} catch (e) {
this.emit('SpecError', spec, e);
this.emit('SpecEnd', spec);
specDone();
return;
}
var handleError = function(error, done) {
if (self.error) {
return done();
}
self.error = true;
done(null, self.afterIndex);
};
asyncForEach(
this.futures,
function(future, futureDone) {
self.step = future;
self.emit('StepBegin', spec, future);
try {
future.execute(function(error) {
if (error) {
self.emit('StepFailure', spec, future, error);
self.emit('StepEnd', spec, future);
return handleError(error, futureDone);
}
self.emit('StepEnd', spec, future);
self.$window.setTimeout(function() { futureDone(); }, 0);
});
} catch (e) {
self.emit('StepError', spec, future, e);
self.emit('StepEnd', spec, future);
handleError(e, futureDone);
}
},
function(e) {
if (e) {
self.emit('SpecError', spec, e);
}
self.emit('SpecEnd', spec);
// Call done in a timeout so exceptions don't recursively
// call this function
self.$window.setTimeout(function() { specDone(); }, 0);
}
);
};
/**
* Adds a new future action.
*
* Note: Do not pass line manually. It happens automatically.
*
* @param {string} name Name of the future
* @param {function()} behavior Behavior of the future
* @param {function()} line fn() that returns file/line number
*/
angular.scenario.SpecRunner.prototype.addFuture = function(name, behavior, line) {
var future = new angular.scenario.Future(name, angular.bind(this, behavior), line);
this.futures.push(future);
return future;
};
/**
* Adds a new future action to be executed on the application window.
*
* Note: Do not pass line manually. It happens automatically.
*
* @param {string} name Name of the future
* @param {function()} behavior Behavior of the future
* @param {function()} line fn() that returns file/line number
*/
angular.scenario.SpecRunner.prototype.addFutureAction = function(name, behavior, line) {
var self = this;
var NG = /\[ng\\\:/;
return this.addFuture(name, function(done) {
this.application.executeAction(function($window, $document) {
//TODO(esprehn): Refactor this so it doesn't need to be in here.
$document.elements = function(selector) {
var args = Array.prototype.slice.call(arguments, 1);
selector = (self.selector || '') + ' ' + (selector || '');
selector = _jQuery.trim(selector) || '*';
angular.forEach(args, function(value, index) {
selector = selector.replace('$' + (index + 1), value);
});
var result = $document.find(selector);
if (selector.match(NG)) {
angular.forEach(['[ng-','[data-ng-','[x-ng-'], function(value, index) {
result = result.add(selector.replace(NG, value), $document);
});
}
if (!result.length) {
throw {
type: 'selector',
message: 'Selector ' + selector + ' did not match any elements.'
};
}
return result;
};
try {
behavior.call(self, $window, $document, done);
} catch (e) {
if (e.type && e.type === 'selector') {
done(e.message);
} else {
throw e;
}
}
});
}, line);
};
| Wheelskad/angular.js | src/ngScenario/SpecRunner.js | JavaScript | mit | 4,399 |
/*!
* jQuery UI CSS Framework 1.8.19
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*/
/* Layout helpers
----------------------------------*/
.ui-helper-hidden { display: none; }
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
.ui-helper-clearfix:after { clear: both; }
.ui-helper-clearfix { zoom: 1; }
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
/* Interaction Cues
----------------------------------*/
.ui-state-disabled { cursor: default !important; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
| nolsherry/cdnjs | ajax/libs/jqueryui/1.8.19/themes/hot-sneaks/jquery.ui.core.css | CSS | mit | 1,318 |
YUI.add('text-data-wordbreak', function(Y) {
Y.namespace('Text.Data').WordBreak = {
// The UnicodeSet utility is helpful for enumerating the specific code
// points covered by each of these regular expressions:
// http://unicode.org/cldr/utility/list-unicodeset.jsp
//
// The code sets from which these regexes were derived can be generated
// by the UnicodeSet utility using the links here:
// http://unicode.org/cldr/utility/properties.jsp?a=Word_Break#Word_Break
aletter : '[A-Za-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F3\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u10A0-\u10C5\u10D0-\u10FA\u10FC\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1A00-\u1A16\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BC0-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2D00-\u2D25\u2D30-\u2D65\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u303B\u303C\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790\uA791\uA7A0-\uA7A9\uA7FA-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]',
midnumlet : "['\\.\u2018\u2019\u2024\uFE52\uFF07\uFF0E]",
midletter : '[:\u00B7\u00B7\u05F4\u2027\uFE13\uFE55\uFF1A]',
midnum : '[,;;\u0589\u060C\u060D\u066C\u07F8\u2044\uFE10\uFE14\uFE50\uFE54\uFF0C\uFF1B]',
numeric : '[0-9\u0660-\u0669\u066B\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9]',
cr : '\\r',
lf : '\\n',
newline : '[\u000B\u000C\u0085\u2028\u2029]',
extend : '[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0900-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C82\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D02\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B6-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAA\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2\u1DC0-\u1DE6\u1DFC-\u1DFF\u200C\u200D\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA67C\uA67D\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE26\uFF9E\uFF9F]',
format : '[\u00AD\u0600-\u0603\u06DD\u070F\u17B4\u17B5\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\uFEFF\uFFF9-\uFFFB]',
katakana : '[\u3031-\u3035\u309B\u309C\u30A0-\u30FA\u30FC-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF9D]',
extendnumlet: '[_\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F]',
punctuation : '[!-#%-*,-\\/:;?@\\[-\\]_{}\u00A1\u00AB\u00B7\u00BB\u00BF;\u00B7\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1361-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u3008\u3009\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30\u2E31\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]'
};
}, '@VERSION@' ,{requires:['yui-base']});
| dlueth/cdnjs | ajax/libs/yui/3.6.0pr4/text-data-wordbreak/text-data-wordbreak.js | JavaScript | mit | 8,454 |
YUI.add('history-base', function(Y) {
/**
* Provides browser history management functionality using a simple
* add/replace/get paradigm. This can be used to ensure that the browser's back
* and forward buttons work as the user expects and to provide bookmarkable URLs
* that return the user to the current application state, even in an Ajax
* application that doesn't perform full-page refreshes.
*
* @module history
* @main history
* @since 3.2.0
*/
/**
* Provides global state management backed by an object, but with no browser
* history integration. For actual browser history integration and back/forward
* support, use the history-html5 or history-hash modules.
*
* @module history
* @submodule history-base
* @class HistoryBase
* @uses EventTarget
* @constructor
* @param {Object} config (optional) configuration object, which may contain
* zero or more of the following properties:
*
* <dl>
* <dt>force (Boolean)</dt>
* <dd>
* If `true`, a `history:change` event will be fired whenever the URL
* changes, even if there is no associated state change. Default is `false`.
* </dd>
*
* <dt>initialState (Object)</dt>
* <dd>
* Initial state to set, as an object hash of key/value pairs. This will be
* merged into the current global state.
* </dd>
* </dl>
*/
var Lang = Y.Lang,
Obj = Y.Object,
GlobalEnv = YUI.namespace('Env.History'),
YArray = Y.Array,
doc = Y.config.doc,
docMode = doc.documentMode,
win = Y.config.win,
DEFAULT_OPTIONS = {merge: true},
EVT_CHANGE = 'change',
SRC_ADD = 'add',
SRC_REPLACE = 'replace';
function HistoryBase() {
this._init.apply(this, arguments);
}
Y.augment(HistoryBase, Y.EventTarget, null, null, {
emitFacade : true,
prefix : 'history',
preventable: false,
queueable : true
});
if (!GlobalEnv._state) {
GlobalEnv._state = {};
}
// -- Private Methods ----------------------------------------------------------
/**
* Returns <code>true</code> if <i>value</i> is a simple object and not a
* function or an array.
*
* @method _isSimpleObject
* @param {mixed} value
* @return {Boolean}
* @private
*/
function _isSimpleObject(value) {
return Lang.type(value) === 'object';
}
// -- Public Static Properties -------------------------------------------------
/**
* Name of this component.
*
* @property NAME
* @type String
* @static
*/
HistoryBase.NAME = 'historyBase';
/**
* Constant used to identify state changes originating from the
* <code>add()</code> method.
*
* @property SRC_ADD
* @type String
* @static
* @final
*/
HistoryBase.SRC_ADD = SRC_ADD;
/**
* Constant used to identify state changes originating from the
* <code>replace()</code> method.
*
* @property SRC_REPLACE
* @type String
* @static
* @final
*/
HistoryBase.SRC_REPLACE = SRC_REPLACE;
/**
* Whether or not this browser supports the HTML5 History API.
*
* @property html5
* @type Boolean
* @static
*/
// All HTML5-capable browsers except Gecko 2+ (Firefox 4+) correctly return
// true for 'onpopstate' in win. In order to support Gecko 2, we fall back to a
// UA sniff for now. (current as of Firefox 4.0b2)
HistoryBase.html5 = !!(win.history && win.history.pushState &&
win.history.replaceState && ('onpopstate' in win || Y.UA.gecko >= 2) &&
(!Y.UA.android || Y.UA.android >= 2.4));
/**
* Whether or not this browser supports the <code>window.onhashchange</code>
* event natively. Note that even if this is <code>true</code>, you may
* still want to use HistoryHash's synthetic <code>hashchange</code> event
* since it normalizes implementation differences and fixes spec violations
* across various browsers.
*
* @property nativeHashChange
* @type Boolean
* @static
*/
// Most browsers that support hashchange expose it on the window. Opera 10.6+
// exposes it on the document (but you can still attach to it on the window).
//
// IE8 supports the hashchange event, but only in IE8 Standards
// Mode. However, IE8 in IE7 compatibility mode still defines the
// event but never fires it, so we can't just detect the event. We also can't
// just UA sniff for IE8, since other browsers support this event as well.
HistoryBase.nativeHashChange = ('onhashchange' in win || 'onhashchange' in doc) &&
(!docMode || docMode > 7);
Y.mix(HistoryBase.prototype, {
// -- Initialization -------------------------------------------------------
/**
* Initializes this HistoryBase instance. This method is called by the
* constructor.
*
* @method _init
* @param {Object} config configuration object
* @protected
*/
_init: function (config) {
var initialState;
/**
* Configuration object provided by the user on instantiation, or an
* empty object if one wasn't provided.
*
* @property _config
* @type Object
* @default {}
* @protected
*/
config = this._config = config || {};
/**
* If `true`, a `history:change` event will be fired whenever the URL
* changes, even if there is no associated state change.
*
* @property force
* @type Boolean
* @default false
*/
this.force = !!config.force;
/**
* Resolved initial state: a merge of the user-supplied initial state
* (if any) and any initial state provided by a subclass. This may
* differ from <code>_config.initialState</code>. If neither the config
* nor a subclass supplies an initial state, this property will be
* <code>null</code>.
*
* @property _initialState
* @type Object|null
* @default {}
* @protected
*/
initialState = this._initialState = this._initialState ||
config.initialState || null;
/**
* Fired when the state changes. To be notified of all state changes
* regardless of the History or YUI instance that generated them,
* subscribe to this event on <code>Y.Global</code>. If you would rather
* be notified only about changes generated by this specific History
* instance, subscribe to this event on the instance.
*
* @event history:change
* @param {EventFacade} e Event facade with the following additional
* properties:
*
* <dl>
* <dt>changed (Object)</dt>
* <dd>
* Object hash of state items that have been added or changed. The
* key is the item key, and the value is an object containing
* <code>newVal</code> and <code>prevVal</code> properties
* representing the values of the item both before and after the
* change. If the item was newly added, <code>prevVal</code> will be
* <code>undefined</code>.
* </dd>
*
* <dt>newVal (Object)</dt>
* <dd>
* Object hash of key/value pairs of all state items after the
* change.
* </dd>
*
* <dt>prevVal (Object)</dt>
* <dd>
* Object hash of key/value pairs of all state items before the
* change.
* </dd>
*
* <dt>removed (Object)</dt>
* <dd>
* Object hash of key/value pairs of state items that have been
* removed. Values are the old values prior to removal.
* </dd>
*
* <dt>src (String)</dt>
* <dd>
* The source of the event. This can be used to selectively ignore
* events generated by certain sources.
* </dd>
* </dl>
*/
this.publish(EVT_CHANGE, {
broadcast: 2,
defaultFn: this._defChangeFn
});
// If initialState was provided, merge it into the current state.
if (initialState) {
this.replace(initialState);
}
},
// -- Public Methods -------------------------------------------------------
/**
* Adds a state entry with new values for the specified keys. By default,
* the new state will be merged into the existing state, and new values will
* override existing values. Specifying a <code>null</code> or
* <code>undefined</code> value will cause that key to be removed from the
* new state entry.
*
* @method add
* @param {Object} state Object hash of key/value pairs.
* @param {Object} options (optional) Zero or more of the following options:
* <dl>
* <dt>merge (Boolean)</dt>
* <dd>
* <p>
* If <code>true</code> (the default), the new state will be merged
* into the existing state. New values will override existing values,
* and <code>null</code> or <code>undefined</code> values will be
* removed from the state.
* </p>
*
* <p>
* If <code>false</code>, the existing state will be discarded as a
* whole and the new state will take its place.
* </p>
* </dd>
* </dl>
* @chainable
*/
add: function () {
var args = YArray(arguments, 0, true);
args.unshift(SRC_ADD);
return this._change.apply(this, args);
},
/**
* Adds a state entry with a new value for a single key. By default, the new
* value will be merged into the existing state values, and will override an
* existing value with the same key if there is one. Specifying a
* <code>null</code> or <code>undefined</code> value will cause the key to
* be removed from the new state entry.
*
* @method addValue
* @param {String} key State parameter key.
* @param {String} value New value.
* @param {Object} options (optional) Zero or more options. See
* <code>add()</code> for a list of supported options.
* @chainable
*/
addValue: function (key, value, options) {
var state = {};
state[key] = value;
return this._change(SRC_ADD, state, options);
},
/**
* Returns the current value of the state parameter specified by <i>key</i>,
* or an object hash of key/value pairs for all current state parameters if
* no key is specified.
*
* @method get
* @param {String} key (optional) State parameter key.
* @return {Object|String} Value of the specified state parameter, or an
* object hash of key/value pairs for all current state parameters.
*/
get: function (key) {
var state = GlobalEnv._state,
isObject = _isSimpleObject(state);
if (key) {
return isObject && Obj.owns(state, key) ? state[key] : undefined;
} else {
return isObject ? Y.mix({}, state, true) : state; // mix provides a fast shallow clone.
}
},
/**
* Same as <code>add()</code> except that a new browser history entry will
* not be created. Instead, the current history entry will be replaced with
* the new state.
*
* @method replace
* @param {Object} state Object hash of key/value pairs.
* @param {Object} options (optional) Zero or more options. See
* <code>add()</code> for a list of supported options.
* @chainable
*/
replace: function () {
var args = YArray(arguments, 0, true);
args.unshift(SRC_REPLACE);
return this._change.apply(this, args);
},
/**
* Same as <code>addValue()</code> except that a new browser history entry
* will not be created. Instead, the current history entry will be replaced
* with the new state.
*
* @method replaceValue
* @param {String} key State parameter key.
* @param {String} value New value.
* @param {Object} options (optional) Zero or more options. See
* <code>add()</code> for a list of supported options.
* @chainable
*/
replaceValue: function (key, value, options) {
var state = {};
state[key] = value;
return this._change(SRC_REPLACE, state, options);
},
// -- Protected Methods ----------------------------------------------------
/**
* Changes the state. This method provides a common implementation shared by
* the public methods for changing state.
*
* @method _change
* @param {String} src Source of the change, for inclusion in event facades
* to facilitate filtering.
* @param {Object} state Object hash of key/value pairs.
* @param {Object} options (optional) Zero or more options. See
* <code>add()</code> for a list of supported options.
* @protected
* @chainable
*/
_change: function (src, state, options) {
options = options ? Y.merge(DEFAULT_OPTIONS, options) : DEFAULT_OPTIONS;
if (options.merge && _isSimpleObject(state) &&
_isSimpleObject(GlobalEnv._state)) {
state = Y.merge(GlobalEnv._state, state);
}
this._resolveChanges(src, state, options);
return this;
},
/**
* Called by _resolveChanges() when the state has changed. This method takes
* care of actually firing the necessary events.
*
* @method _fireEvents
* @param {String} src Source of the changes, for inclusion in event facades
* to facilitate filtering.
* @param {Object} changes Resolved changes.
* @param {Object} options Zero or more options. See <code>add()</code> for
* a list of supported options.
* @protected
*/
_fireEvents: function (src, changes, options) {
// Fire the global change event.
this.fire(EVT_CHANGE, {
_options: options,
changed : changes.changed,
newVal : changes.newState,
prevVal : changes.prevState,
removed : changes.removed,
src : src
});
// Fire change/remove events for individual items.
Obj.each(changes.changed, function (value, key) {
this._fireChangeEvent(src, key, value);
}, this);
Obj.each(changes.removed, function (value, key) {
this._fireRemoveEvent(src, key, value);
}, this);
},
/**
* Fires a dynamic "[key]Change" event.
*
* @method _fireChangeEvent
* @param {String} src source of the change, for inclusion in event facades
* to facilitate filtering
* @param {String} key key of the item that was changed
* @param {Object} value object hash containing <i>newVal</i> and
* <i>prevVal</i> properties for the changed item
* @protected
*/
_fireChangeEvent: function (src, key, value) {
/**
* <p>
* Dynamic event fired when an individual history item is added or
* changed. The name of this event depends on the name of the key that
* changed. To listen to change events for a key named "foo", subscribe
* to the <code>fooChange</code> event; for a key named "bar", subscribe
* to <code>barChange</code>, etc.
* </p>
*
* <p>
* Key-specific events are only fired for instance-level changes; that
* is, changes that were made via the same History instance on which the
* event is subscribed. To be notified of changes made by other History
* instances, subscribe to the global <code>history:change</code> event.
* </p>
*
* @event [key]Change
* @param {EventFacade} e Event facade with the following additional
* properties:
*
* <dl>
* <dt>newVal (mixed)</dt>
* <dd>
* The new value of the item after the change.
* </dd>
*
* <dt>prevVal (mixed)</dt>
* <dd>
* The previous value of the item before the change, or
* <code>undefined</code> if the item was just added and has no
* previous value.
* </dd>
*
* <dt>src (String)</dt>
* <dd>
* The source of the event. This can be used to selectively ignore
* events generated by certain sources.
* </dd>
* </dl>
*/
this.fire(key + 'Change', {
newVal : value.newVal,
prevVal: value.prevVal,
src : src
});
},
/**
* Fires a dynamic "[key]Remove" event.
*
* @method _fireRemoveEvent
* @param {String} src source of the change, for inclusion in event facades
* to facilitate filtering
* @param {String} key key of the item that was removed
* @param {mixed} value value of the item prior to its removal
* @protected
*/
_fireRemoveEvent: function (src, key, value) {
/**
* <p>
* Dynamic event fired when an individual history item is removed. The
* name of this event depends on the name of the key that was removed.
* To listen to remove events for a key named "foo", subscribe to the
* <code>fooRemove</code> event; for a key named "bar", subscribe to
* <code>barRemove</code>, etc.
* </p>
*
* <p>
* Key-specific events are only fired for instance-level changes; that
* is, changes that were made via the same History instance on which the
* event is subscribed. To be notified of changes made by other History
* instances, subscribe to the global <code>history:change</code> event.
* </p>
*
* @event [key]Remove
* @param {EventFacade} e Event facade with the following additional
* properties:
*
* <dl>
* <dt>prevVal (mixed)</dt>
* <dd>
* The value of the item before it was removed.
* </dd>
*
* <dt>src (String)</dt>
* <dd>
* The source of the event. This can be used to selectively ignore
* events generated by certain sources.
* </dd>
* </dl>
*/
this.fire(key + 'Remove', {
prevVal: value,
src : src
});
},
/**
* Resolves the changes (if any) between <i>newState</i> and the current
* state and fires appropriate events if things have changed.
*
* @method _resolveChanges
* @param {String} src source of the changes, for inclusion in event facades
* to facilitate filtering
* @param {Object} newState object hash of key/value pairs representing the
* new state
* @param {Object} options Zero or more options. See <code>add()</code> for
* a list of supported options.
* @protected
*/
_resolveChanges: function (src, newState, options) {
var changed = {},
isChanged,
prevState = GlobalEnv._state,
removed = {};
newState || (newState = {});
options || (options = {});
if (_isSimpleObject(newState) && _isSimpleObject(prevState)) {
// Figure out what was added or changed.
Obj.each(newState, function (newVal, key) {
var prevVal = prevState[key];
if (newVal !== prevVal) {
changed[key] = {
newVal : newVal,
prevVal: prevVal
};
isChanged = true;
}
}, this);
// Figure out what was removed.
Obj.each(prevState, function (prevVal, key) {
if (!Obj.owns(newState, key) || newState[key] === null) {
delete newState[key];
removed[key] = prevVal;
isChanged = true;
}
}, this);
} else {
isChanged = newState !== prevState;
}
if (isChanged || this.force) {
this._fireEvents(src, {
changed : changed,
newState : newState,
prevState: prevState,
removed : removed
}, options);
}
},
/**
* Stores the specified state. Don't call this method directly; go through
* _resolveChanges() to ensure that changes are resolved and all events are
* fired properly.
*
* @method _storeState
* @param {String} src source of the changes
* @param {Object} newState new state to store
* @param {Object} options Zero or more options. See <code>add()</code> for
* a list of supported options.
* @protected
*/
_storeState: function (src, newState) {
// Note: the src and options params aren't used here, but they are used
// by subclasses.
GlobalEnv._state = newState || {};
},
// -- Protected Event Handlers ---------------------------------------------
/**
* Default <code>history:change</code> event handler.
*
* @method _defChangeFn
* @param {EventFacade} e state change event facade
* @protected
*/
_defChangeFn: function (e) {
this._storeState(e.src, e.newVal, e._options);
}
}, true);
Y.HistoryBase = HistoryBase;
}, '@VERSION@' ,{requires:['event-custom-complex']});
| bsquochoaidownloadfolders/cdnjs | ajax/libs/yui/3.6.0/history-base/history-base.js | JavaScript | mit | 21,567 |
YUI.add('tabview', function(Y) {
/**
* The TabView module
*
* @module tabview
*/
var _queries = Y.TabviewBase._queries,
_classNames = Y.TabviewBase._classNames,
DOT = '.',
getClassName = Y.ClassNameManager.getClassName,
/**
* Provides a tabbed widget interface
* @param config {Object} Object literal specifying tabview configuration properties.
*
* @class TabView
* @constructor
* @extends Widget
* @uses WidgetParent
*/
TabView = Y.Base.create('tabView', Y.Widget, [Y.WidgetParent], {
_afterChildAdded: function(e) {
this.get('contentBox').focusManager.refresh();
},
_defListNodeValueFn: function() {
return Y.Node.create(TabView.LIST_TEMPLATE);
},
_defPanelNodeValueFn: function() {
return Y.Node.create(TabView.PANEL_TEMPLATE);
},
_afterChildRemoved: function(e) { // update the selected tab when removed
var i = e.index,
selection = this.get('selection');
if (!selection) { // select previous item if selection removed
selection = this.item(i - 1) || this.item(0);
if (selection) {
selection.set('selected', 1);
}
}
this.get('contentBox').focusManager.refresh();
},
_initAria: function() {
var contentBox = this.get('contentBox'),
tablist = contentBox.one(_queries.tabviewList);
if (tablist) {
tablist.setAttrs({
//'aria-labelledby':
role: 'tablist'
});
}
},
bindUI: function() {
// Use the Node Focus Manager to add keyboard support:
// Pressing the left and right arrow keys will move focus
// among each of the tabs.
this.get('contentBox').plug(Y.Plugin.NodeFocusManager, {
descendants: DOT + _classNames.tabLabel,
keys: { next: 'down:39', // Right arrow
previous: 'down:37' }, // Left arrow
circular: true
});
this.after('render', this._setDefSelection);
this.after('addChild', this._afterChildAdded);
this.after('removeChild', this._afterChildRemoved);
},
renderUI: function() {
var contentBox = this.get('contentBox');
this._renderListBox(contentBox);
this._renderPanelBox(contentBox);
this._childrenContainer = this.get('listNode');
this._renderTabs(contentBox);
},
_setDefSelection: function(contentBox) {
// If no tab is selected, select the first tab.
var selection = this.get('selection') || this.item(0);
this.some(function(tab) {
if (tab.get('selected')) {
selection = tab;
return true;
}
});
if (selection) {
// TODO: why both needed? (via widgetParent/Child)?
this.set('selection', selection);
selection.set('selected', 1);
}
},
_renderListBox: function(contentBox) {
var node = this.get('listNode');
if (!node.inDoc()) {
contentBox.append(node);
}
},
_renderPanelBox: function(contentBox) {
var node = this.get('panelNode');
if (!node.inDoc()) {
contentBox.append(node);
}
},
_renderTabs: function(contentBox) {
var tabs = contentBox.all(_queries.tab),
panelNode = this.get('panelNode'),
panels = (panelNode) ? this.get('panelNode').get('children') : null,
tabview = this;
if (tabs) { // add classNames and fill in Tab fields from markup when possible
tabs.addClass(_classNames.tab);
contentBox.all(_queries.tabLabel).addClass(_classNames.tabLabel);
contentBox.all(_queries.tabPanel).addClass(_classNames.tabPanel);
tabs.each(function(node, i) {
var panelNode = (panels) ? panels.item(i) : null;
tabview.add({
boundingBox: node,
contentBox: node.one(DOT + _classNames.tabLabel),
label: node.one(DOT + _classNames.tabLabel).get('text'),
panelNode: panelNode
});
});
}
}
}, {
LIST_TEMPLATE: '<ul class="' + _classNames.tabviewList + '"></ul>',
PANEL_TEMPLATE: '<div class="' + _classNames.tabviewPanel + '"></div>',
ATTRS: {
defaultChildType: {
value: 'Tab'
},
listNode: {
setter: function(node) {
node = Y.one(node);
if (node) {
node.addClass(_classNames.tabviewList);
}
return node;
},
valueFn: '_defListNodeValueFn'
},
panelNode: {
setter: function(node) {
node = Y.one(node);
if (node) {
node.addClass(_classNames.tabviewPanel);
}
return node;
},
valueFn: '_defPanelNodeValueFn'
},
tabIndex: {
value: null
//validator: '_validTabIndex'
}
},
HTML_PARSER: {
listNode: _queries.tabviewList,
panelNode: _queries.tabviewPanel
}
});
Y.TabView = TabView;
var Lang = Y.Lang,
_queries = Y.TabviewBase._queries,
_classNames = Y.TabviewBase._classNames,
getClassName = Y.ClassNameManager.getClassName;
/**
* Provides Tab instances for use with TabView
* @param config {Object} Object literal specifying tabview configuration properties.
*
* @class Tab
* @constructor
* @extends Widget
* @uses WidgetChild
*/
Y.Tab = Y.Base.create('tab', Y.Widget, [Y.WidgetChild], {
BOUNDING_TEMPLATE: '<li class="' + _classNames.tab + '"></li>',
CONTENT_TEMPLATE: '<a class="' + _classNames.tabLabel + '"></a>',
PANEL_TEMPLATE: '<div class="' + _classNames.tabPanel + '"></div>',
_uiSetSelectedPanel: function(selected) {
this.get('panelNode').toggleClass(_classNames.selectedPanel, selected);
},
_afterTabSelectedChange: function(event) {
this._uiSetSelectedPanel(event.newVal);
},
_afterParentChange: function(e) {
if (!e.newVal) {
this._remove();
} else {
this._add();
}
},
_initAria: function() {
var anchor = this.get('contentBox'),
id = anchor.get('id'),
panel = this.get('panelNode');
if (!id) {
id = Y.guid();
anchor.set('id', id);
}
// Apply the ARIA roles, states and properties to each tab
anchor.set('role', 'tab');
anchor.get('parentNode').set('role', 'presentation');
// Apply the ARIA roles, states and properties to each panel
panel.setAttrs({
role: 'tabpanel',
'aria-labelledby': id
});
},
syncUI: function() {
this.set('label', this.get('label'));
this.set('content', this.get('content'));
this._uiSetSelectedPanel(this.get('selected'));
},
bindUI: function() {
this.after('selectedChange', this._afterTabSelectedChange);
this.after('parentChange', this._afterParentChange);
},
renderUI: function() {
this._renderPanel();
this._initAria();
},
_renderPanel: function() {
this.get('parent').get('panelNode')
.appendChild(this.get('panelNode'));
},
_add: function() {
var parent = this.get('parent').get('contentBox'),
list = parent.get('listNode'),
panel = parent.get('panelNode');
if (list) {
list.appendChild(this.get('boundingBox'));
}
if (panel) {
panel.appendChild(this.get('panelNode'));
}
},
_remove: function() {
this.get('boundingBox').remove();
this.get('panelNode').remove();
},
_onActivate: function(e) {
if (e.target === this) {
// Prevent the browser from navigating to the URL specified by the
// anchor's href attribute.
e.domEvent.preventDefault();
e.target.set('selected', 1);
}
},
initializer: function() {
this.publish(this.get('triggerEvent'), {
defaultFn: this._onActivate
});
},
_defLabelSetter: function(label) {
this.get('contentBox').setContent(label);
return label;
},
_defContentSetter: function(content) {
this.get('panelNode').setContent(content);
return content;
},
_defContentGetter: function(content) {
return this.get('panelNode').getContent();
},
// find panel by ID mapping from label href
_defPanelNodeValueFn: function() {
var href = this.get('contentBox').get('href') || '',
parent = this.get('parent'),
hashIndex = href.indexOf('#'),
panel;
href = href.substr(hashIndex);
if (href.charAt(0) === '#') { // in-page nav, find by ID
panel = Y.one(href);
if (panel) {
panel.addClass(_classNames.tabPanel);
}
}
// use the one found by id, or else try matching indices
if (!panel && parent) {
panel = parent.get('panelNode')
.get('children').item(this.get('index'));
}
if (!panel) { // create if none found
panel = Y.Node.create(this.PANEL_TEMPLATE);
}
return panel;
}
}, {
ATTRS: {
/**
* @attribute triggerEvent
* @default "click"
* @type String
*/
triggerEvent: {
value: 'click'
},
/**
* @attribute label
* @type HTML
*/
label: {
setter: '_defLabelSetter',
validator: Lang.isString
},
/**
* @attribute content
* @type HTML
*/
content: {
setter: '_defContentSetter',
getter: '_defContentGetter'
},
/**
* @attribute panelNode
* @type Y.Node
*/
panelNode: {
setter: function(node) {
node = Y.one(node);
if (node) {
node.addClass(_classNames.tabPanel);
}
return node;
},
valueFn: '_defPanelNodeValueFn'
},
tabIndex: {
value: null,
validator: '_validTabIndex'
}
},
HTML_PARSER: {
selected: function(contentBox) {
var ret = (this.get('boundingBox').hasClass(_classNames.selectedTab)) ?
1 : 0;
return ret;
}
}
});
}, '@VERSION@' ,{requires:['node-pluginhost', 'node-focusmanager', 'tabview-base', 'widget', 'widget-parent', 'widget-child']});
| pc035860/cdnjs | ajax/libs/yui/3.5.0pr6/tabview/tabview.js | JavaScript | mit | 11,131 |
//
// FMDatabasePool.m
// fmdb
//
// Created by August Mueller on 6/22/11.
// Copyright 2011 Flying Meat Inc. All rights reserved.
//
#import "FMDatabasePool.h"
#import "FMDatabase.h"
@interface FMDatabasePool()
- (void)pushDatabaseBackInPool:(FMDatabase*)db;
- (FMDatabase*)db;
@end
@implementation FMDatabasePool
@synthesize path=_path;
@synthesize delegate=_delegate;
@synthesize maximumNumberOfDatabasesToCreate=_maximumNumberOfDatabasesToCreate;
@synthesize openFlags=_openFlags;
+ (instancetype)databasePoolWithPath:(NSString*)aPath {
return FMDBReturnAutoreleased([[self alloc] initWithPath:aPath]);
}
+ (instancetype)databasePoolWithPath:(NSString*)aPath flags:(int)openFlags {
return FMDBReturnAutoreleased([[self alloc] initWithPath:aPath flags:openFlags]);
}
- (instancetype)initWithPath:(NSString*)aPath flags:(int)openFlags {
self = [super init];
if (self != nil) {
_path = [aPath copy];
_lockQueue = dispatch_queue_create([[NSString stringWithFormat:@"fmdb.%@", self] UTF8String], NULL);
_databaseInPool = FMDBReturnRetained([NSMutableArray array]);
_databaseOutPool = FMDBReturnRetained([NSMutableArray array]);
_openFlags = openFlags;
}
return self;
}
- (instancetype)initWithPath:(NSString*)aPath
{
// default flags for sqlite3_open
return [self initWithPath:aPath flags:SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE];
}
- (instancetype)init {
return [self initWithPath:nil];
}
- (void)dealloc {
_delegate = 0x00;
FMDBRelease(_path);
FMDBRelease(_databaseInPool);
FMDBRelease(_databaseOutPool);
if (_lockQueue) {
FMDBDispatchQueueRelease(_lockQueue);
_lockQueue = 0x00;
}
#if ! __has_feature(objc_arc)
[super dealloc];
#endif
}
- (void)executeLocked:(void (^)(void))aBlock {
dispatch_sync(_lockQueue, aBlock);
}
- (void)pushDatabaseBackInPool:(FMDatabase*)db {
if (!db) { // db can be null if we set an upper bound on the # of databases to create.
return;
}
[self executeLocked:^() {
if ([_databaseInPool containsObject:db]) {
[[NSException exceptionWithName:@"Database already in pool" reason:@"The FMDatabase being put back into the pool is already present in the pool" userInfo:nil] raise];
}
[_databaseInPool addObject:db];
[_databaseOutPool removeObject:db];
}];
}
- (FMDatabase*)db {
__block FMDatabase *db;
[self executeLocked:^() {
db = [_databaseInPool lastObject];
BOOL shouldNotifyDelegate = NO;
if (db) {
[_databaseOutPool addObject:db];
[_databaseInPool removeLastObject];
}
else {
if (_maximumNumberOfDatabasesToCreate) {
NSUInteger currentCount = [_databaseOutPool count] + [_databaseInPool count];
if (currentCount >= _maximumNumberOfDatabasesToCreate) {
NSLog(@"Maximum number of databases (%ld) has already been reached!", (long)currentCount);
return;
}
}
db = [FMDatabase databaseWithPath:_path];
shouldNotifyDelegate = YES;
}
//This ensures that the db is opened before returning
#if SQLITE_VERSION_NUMBER >= 3005000
BOOL success = [db openWithFlags:_openFlags];
#else
BOOL success = [db open];
#endif
if (success) {
if ([_delegate respondsToSelector:@selector(databasePool:shouldAddDatabaseToPool:)] && ![_delegate databasePool:self shouldAddDatabaseToPool:db]) {
[db close];
db = 0x00;
}
else {
//It should not get added in the pool twice if lastObject was found
if (![_databaseOutPool containsObject:db]) {
[_databaseOutPool addObject:db];
if (shouldNotifyDelegate && [_delegate respondsToSelector:@selector(databasePool:didAddDatabase:)]) {
[_delegate databasePool:self didAddDatabase:db];
}
}
}
}
else {
NSLog(@"Could not open up the database at path %@", _path);
db = 0x00;
}
}];
return db;
}
- (NSUInteger)countOfCheckedInDatabases {
__block NSUInteger count;
[self executeLocked:^() {
count = [_databaseInPool count];
}];
return count;
}
- (NSUInteger)countOfCheckedOutDatabases {
__block NSUInteger count;
[self executeLocked:^() {
count = [_databaseOutPool count];
}];
return count;
}
- (NSUInteger)countOfOpenDatabases {
__block NSUInteger count;
[self executeLocked:^() {
count = [_databaseOutPool count] + [_databaseInPool count];
}];
return count;
}
- (void)releaseAllDatabases {
[self executeLocked:^() {
[_databaseOutPool removeAllObjects];
[_databaseInPool removeAllObjects];
}];
}
- (void)inDatabase:(void (^)(FMDatabase *db))block {
FMDatabase *db = [self db];
block(db);
[self pushDatabaseBackInPool:db];
}
- (void)beginTransaction:(BOOL)useDeferred withBlock:(void (^)(FMDatabase *db, BOOL *rollback))block {
BOOL shouldRollback = NO;
FMDatabase *db = [self db];
if (useDeferred) {
[db beginDeferredTransaction];
}
else {
[db beginTransaction];
}
block(db, &shouldRollback);
if (shouldRollback) {
[db rollback];
}
else {
[db commit];
}
[self pushDatabaseBackInPool:db];
}
- (void)inDeferredTransaction:(void (^)(FMDatabase *db, BOOL *rollback))block {
[self beginTransaction:YES withBlock:block];
}
- (void)inTransaction:(void (^)(FMDatabase *db, BOOL *rollback))block {
[self beginTransaction:NO withBlock:block];
}
#if SQLITE_VERSION_NUMBER >= 3007000
- (NSError*)inSavePoint:(void (^)(FMDatabase *db, BOOL *rollback))block {
static unsigned long savePointIdx = 0;
NSString *name = [NSString stringWithFormat:@"savePoint%ld", savePointIdx++];
BOOL shouldRollback = NO;
FMDatabase *db = [self db];
NSError *err = 0x00;
if (![db startSavePointWithName:name error:&err]) {
[self pushDatabaseBackInPool:db];
return err;
}
block(db, &shouldRollback);
if (shouldRollback) {
// We need to rollback and release this savepoint to remove it
[db rollbackToSavePointWithName:name error:&err];
}
[db releaseSavePointWithName:name error:&err];
[self pushDatabaseBackInPool:db];
return err;
}
#endif
@end
| davbeck/TNKData | Example/Pods/FMDB/src/FMDatabasePool.m | Matlab | mit | 6,918 |
// # Ghost Editor
//
// Ghost Editor contains a set of modules which make up the editor component
// It manages the left and right panes, and all of the communication between them
// Including scrolling,
/*global document, $, _, Ghost */
(function () {
'use strict';
var Editor = function () {
var self = this,
$document = $(document),
// Create all the needed editor components, passing them what they need to function
markdown = new Ghost.Editor.MarkdownEditor(),
uploadMgr = new Ghost.Editor.UploadManager(markdown),
preview = new Ghost.Editor.HTMLPreview(markdown, uploadMgr),
scrollHandler = new Ghost.Editor.ScrollHandler(markdown, preview),
unloadDirtyMessage,
handleChange,
handleDrag;
unloadDirtyMessage = function () {
return '==============================\n\n' +
'Hey there! It looks like you\'re in the middle of writing' +
' something and you haven\'t saved all of your content.' +
'\n\nSave before you go!\n\n' +
'==============================';
};
handleChange = function () {
self.setDirty(true);
preview.update();
};
handleDrag = function (e) {
e.preventDefault();
};
// Public API
_.extend(this, {
enable: function () {
// Listen for changes
$document.on('markdownEditorChange', handleChange);
// enable editing and scrolling
markdown.enable();
scrollHandler.enable();
},
disable: function () {
// Don't listen for changes
$document.off('markdownEditorChange', handleChange);
// disable editing and scrolling
markdown.disable();
scrollHandler.disable();
},
// Get the markdown value from the editor for saving
// Upload manager makes sure the upload markers are removed beforehand
value: function () {
return uploadMgr.value();
},
setDirty: function (dirty) {
window.onbeforeunload = dirty ? unloadDirtyMessage : null;
}
});
// Initialise
$document.on('drop dragover', handleDrag);
preview.update();
this.enable();
};
Ghost.Editor = Ghost.Editor || {};
Ghost.Editor.Main = Editor;
}()); | rstellar/rstellar.github.io | core/clientold/assets/lib/editor/index.js | JavaScript | mit | 2,580 |
<?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\Config\Definition\Dumper;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Definition\NodeInterface;
use Symfony\Component\Config\Definition\ArrayNode;
use Symfony\Component\Config\Definition\EnumNode;
use Symfony\Component\Config\Definition\PrototypedArrayNode;
/**
* Dumps a XML reference configuration for the given configuration/node instance.
*
* @author Wouter J <waldio.webdesign@gmail.com>
*/
class XmlReferenceDumper
{
private $reference;
public function dump(ConfigurationInterface $configuration, $namespace = null)
{
return $this->dumpNode($configuration->getConfigTreeBuilder()->buildTree(), $namespace);
}
public function dumpNode(NodeInterface $node, $namespace = null)
{
$this->reference = '';
$this->writeNode($node, 0, true, $namespace);
$ref = $this->reference;
$this->reference = null;
return $ref;
}
/**
* @param NodeInterface $node
* @param integer $depth
* @param Boolean $root If the node is the root node
* @param string $namespace The namespace of the node
*/
private function writeNode(NodeInterface $node, $depth = 0, $root = false, $namespace = null)
{
$rootName = ($root ? 'config' : $node->getName());
$rootNamespace = ($namespace ?: ($root ? 'http://example.org/schema/dic/'.$node->getName() : null));
// xml remapping
if ($node->getParent()) {
$remapping = array_filter($node->getParent()->getXmlRemappings(), function ($mapping) use ($rootName) {
return $rootName === $mapping[1];
});
if (count($remapping)) {
list($singular, $plural) = current($remapping);
$rootName = $singular;
}
}
$rootName = str_replace('_', '-', $rootName);
$rootAttributes = array();
$rootAttributeComments = array();
$rootChildren = array();
$rootComments = array();
if ($node instanceof ArrayNode) {
$children = $node->getChildren();
// comments about the root node
if ($rootInfo = $node->getInfo()) {
$rootComments[] = $rootInfo;
}
if ($rootNamespace) {
$rootComments[] = 'Namespace: '.$rootNamespace;
}
// render prototyped nodes
if ($node instanceof PrototypedArrayNode) {
array_unshift($rootComments, 'prototype');
if ($key = $node->getKeyAttribute()) {
$rootAttributes[$key] = str_replace('-', ' ', $rootName).' '.$key;
}
$prototype = $node->getPrototype();
if ($prototype instanceof ArrayNode) {
$children = $prototype->getChildren();
} else {
if ($prototype->hasDefaultValue()) {
$prototypeValue = $prototype->getDefaultValue();
} else {
switch (get_class($prototype)) {
case 'Symfony\Component\Config\Definition\ScalarNode':
$prototypeValue = 'scalar value';
break;
case 'Symfony\Component\Config\Definition\FloatNode':
case 'Symfony\Component\Config\Definition\IntegerNode':
$prototypeValue = 'numeric value';
break;
case 'Symfony\Component\Config\Definition\BooleanNode':
$prototypeValue = 'true|false';
break;
case 'Symfony\Component\Config\Definition\EnumNode':
$prototypeValue = implode('|', array_map('json_encode', $prototype->getValues()));
break;
default:
$prototypeValue = 'value';
}
}
}
}
// get attributes and elements
foreach ($children as $child) {
if (!$child instanceof ArrayNode) {
// get attributes
// metadata
$name = str_replace('_', '-', $child->getName());
$value = '%%%%not_defined%%%%'; // use a string which isn't used in the normal world
// comments
$comments = array();
if ($info = $child->getInfo()) {
$comments[] = $info;
}
if ($example = $child->getExample()) {
$comments[] = 'Example: '.$example;
}
if ($child->isRequired()) {
$comments[] = 'Required';
}
if ($child instanceof EnumNode) {
$comments[] = 'One of '.implode('; ', array_map('json_encode', $child->getValues()));
}
if (count($comments)) {
$rootAttributeComments[$name] = implode(";\n", $comments);
}
// default values
if ($child->hasDefaultValue()) {
$value = $child->getDefaultValue();
}
// append attribute
$rootAttributes[$name] = $value;
} else {
// get elements
$rootChildren[] = $child;
}
}
}
// render comments
// root node comment
if (count($rootComments)) {
foreach ($rootComments as $comment) {
$this->writeLine('<!-- '.$comment.' -->', $depth);
}
}
// attribute comments
if (count($rootAttributeComments)) {
foreach ($rootAttributeComments as $attrName => $comment) {
$commentDepth = $depth + 4 + strlen($attrName) + 2;
$commentLines = explode("\n", $comment);
$multiline = (count($commentLines) > 1);
$comment = implode(PHP_EOL.str_repeat(' ', $commentDepth), $commentLines);
if ($multiline) {
$this->writeLine('<!--', $depth);
$this->writeLine($attrName.': '.$comment, $depth + 4);
$this->writeLine('-->', $depth);
} else {
$this->writeLine('<!-- '.$attrName.': '.$comment.' -->', $depth);
}
}
}
// render start tag + attributes
$rootIsVariablePrototype = isset($prototypeValue);
$rootIsEmptyTag = (0 === count($rootChildren) && !$rootIsVariablePrototype);
$rootOpenTag = '<'.$rootName;
if (1 >= ($attributesCount = count($rootAttributes))) {
if (1 === $attributesCount) {
$rootOpenTag .= sprintf(' %s="%s"', current(array_keys($rootAttributes)), $this->writeValue(current($rootAttributes)));
}
$rootOpenTag .= $rootIsEmptyTag ? ' />' : '>';
if ($rootIsVariablePrototype) {
$rootOpenTag .= $prototypeValue.'</'.$rootName.'>';
}
$this->writeLine($rootOpenTag, $depth);
} else {
$this->writeLine($rootOpenTag, $depth);
$i = 1;
foreach ($rootAttributes as $attrName => $attrValue) {
$attr = sprintf('%s="%s"', $attrName, $this->writeValue($attrValue));
$this->writeLine($attr, $depth + 4);
if ($attributesCount === $i++) {
$this->writeLine($rootIsEmptyTag ? '/>' : '>', $depth);
if ($rootIsVariablePrototype) {
$rootOpenTag .= $prototypeValue.'</'.$rootName.'>';
}
}
}
}
// render children tags
foreach ($rootChildren as $child) {
$this->writeLine('');
$this->writeNode($child, $depth + 4);
}
// render end tag
if (!$rootIsEmptyTag && !$rootIsVariablePrototype) {
$this->writeLine('');
$rootEndTag = '</'.$rootName.'>';
$this->writeLine($rootEndTag, $depth);
}
}
/**
* Outputs a single config reference line
*
* @param string $text
* @param int $indent
*/
private function writeLine($text, $indent = 0)
{
$indent = strlen($text) + $indent;
$format = '%'.$indent.'s';
$this->reference .= sprintf($format, $text)."\n";
}
/**
* Renders the string conversion of the value.
*
* @param mixed $value
*
* @return string
*/
private function writeValue($value)
{
if ('%%%%not_defined%%%%' === $value) {
return '';
}
if (is_string($value) || is_numeric($value)) {
return $value;
}
if (false === $value) {
return 'false';
}
if (true === $value) {
return 'true';
}
if (null === $value) {
return 'null';
}
if (empty($value)) {
return '';
}
if (is_array($value)) {
return implode(',', $value);
}
}
}
| TuxCoffeeCorner/tcc | symfony/vendor/symfony/symfony/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php | PHP | mit | 9,862 |
/**
* SmoothScroll
* This helper script created by DWUser.com. Copyright 2013 DWUser.com.
* Dual-licensed under the GPL and MIT licenses.
* All individual scripts remain property of their copyrighters.
* Date: 10-Sep-2013
* Version: 1.0.1
*/
if (!window['jQuery']) alert('The jQuery library must be included before the smoothscroll.js file. The plugin will not work propery.');
/**
* jQuery.ScrollTo - Easy element scrolling using jQuery.
* Copyright (c) 2007-2013 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
* Dual licensed under MIT and GPL.
* @author Ariel Flesler
* @version 1.4.3.1
*/
;(function($){var h=$.scrollTo=function(a,b,c){$(window).scrollTo(a,b,c)};h.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1,limit:true};h.window=function(a){return $(window)._scrollable()};$.fn._scrollable=function(){return this.map(function(){var a=this,isWin=!a.nodeName||$.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)return a;var b=(a.contentWindow||a).document||a.ownerDocument||a;return/webkit/i.test(navigator.userAgent)||b.compatMode=='BackCompat'?b.body:b.documentElement})};$.fn.scrollTo=function(e,f,g){if(typeof f=='object'){g=f;f=0}if(typeof g=='function')g={onAfter:g};if(e=='max')e=9e9;g=$.extend({},h.defaults,g);f=f||g.duration;g.queue=g.queue&&g.axis.length>1;if(g.queue)f/=2;g.offset=both(g.offset);g.over=both(g.over);return this._scrollable().each(function(){if(e==null)return;var d=this,$elem=$(d),targ=e,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=$(targ,this);if(!targ.length)return;case'object':if(targ.is||targ.style)toff=(targ=$(targ)).offset()}$.each(g.axis.split(''),function(i,a){var b=a=='x'?'Left':'Top',pos=b.toLowerCase(),key='scroll'+b,old=d[key],max=h.max(d,a);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(g.margin){attr[key]-=parseInt(targ.css('margin'+b))||0;attr[key]-=parseInt(targ.css('border'+b+'Width'))||0}attr[key]+=g.offset[pos]||0;if(g.over[pos])attr[key]+=targ[a=='x'?'width':'height']()*g.over[pos]}else{var c=targ[pos];attr[key]=c.slice&&c.slice(-1)=='%'?parseFloat(c)/100*max:c}if(g.limit&&/^\d+$/.test(attr[key]))attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&g.queue){if(old!=attr[key])animate(g.onAfterFirst);delete attr[key]}});animate(g.onAfter);function animate(a){$elem.animate(attr,f,g.easing,a&&function(){a.call(this,e,g)})}}).end()};h.max=function(a,b){var c=b=='x'?'Width':'Height',scroll='scroll'+c;if(!$(a).is('html,body'))return a[scroll]-$(a)[c.toLowerCase()]();var d='client'+c,html=a.ownerDocument.documentElement,body=a.ownerDocument.body;return Math.max(html[scroll],body[scroll])-Math.min(html[d],body[d])};function both(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
/**
* jQuery.LocalScroll
* Copyright (c) 2007-2010 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
* Dual licensed under MIT and GPL.
* Date: 05/31/2010
* @author Ariel Flesler
* @version 1.2.8b
**/
;(function(b){function g(a,e,d){var h=e.hash.slice(1),f=document.getElementById(h)||document.getElementsByName(h)[0];if(f){a&&a.preventDefault();var c=b(d.target);if(!(d.lock&&c.is(":animated")||d.onBefore&&!1===d.onBefore(a,f,c))){d.stop&&c._scrollable().stop(!0);if(d.hash){var a=f.id==h?"id":"name",g=b("<a> </a>").attr(a,h).css({position:"absolute",top:b(window).scrollTop(),left:b(window).scrollLeft()});f[a]="";b("body").prepend(g);location=e.hash;g.remove();f[a]=h}c.scrollTo(f,d).trigger("notify.serialScroll",
[f])}}}var i=location.href.replace(/#.*/,""),c=b.localScroll=function(a){b("body").localScroll(a)};c.defaults={duration:1E3,axis:"y",event:"click",stop:!0,target:window,reset:!0};c.hash=function(a){if(location.hash){a=b.extend({},c.defaults,a);a.hash=!1;if(a.reset){var e=a.duration;delete a.duration;b(a.target).scrollTo(0,a);a.duration=e}g(0,location,a)}};b.fn.localScroll=function(a){function e(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,"")==i&&(!a.filter||b(this).is(a.filter))}
a=b.extend({},c.defaults,a);return a.lazy?this.bind(a.event,function(d){var c=b([d.target,d.target.parentNode]).filter(e)[0];c&&g(d,c,a)}):this.find("a,area").filter(e).bind(a.event,function(b){g(b,this,a)}).end().end()}})(jQuery);
// Initialize all .smoothScroll links
jQuery(function($){ $.localScroll({filter:'.smoothScroll'}); });
| ktoufique/shiny-glassdoor | assets/js/smoothscroll.js | JavaScript | mit | 4,474 |
// RequireJS Handlebars template plugin
// http://github.com/jfparadis/requirejs-handlebars
//
// An alternative to http://github.com/SlexAxton/require-handlebars-plugin/blob/master/hbs.js
//
// Using Handlebars Semantic templates at http://handlebarsjs.com
// Using and RequireJS text.js at http://requirejs.org/docs/api.html#text
// @author JF Paradis
// @version 0.0.2
//
// Released under the MIT license
define(["text","Handlebars"],function(text,Handlebars){var buildMap={},buildTemplateSource="define('{pluginName}!{moduleName}', ['Handlebars'], function (Handlebars) { return Handlebars.template({content}); });\n";return{version:"0.0.2",load:function(moduleName,parentRequire,onload,config){if(buildMap[moduleName])onload(buildMap[moduleName]);else{var ext=config.hbars&&config.hbars.extension||".html",path=config.hbars&&config.hbars.path||"",compileOptions=config.hbars&&config.hbars.compileOptions||
{};text.load(path+moduleName+ext,parentRequire,function(source){if(config.isBuild){buildMap[moduleName]=Handlebars.precompile(source,compileOptions);onload()}else{buildMap[moduleName]=Handlebars.compile(source);onload(buildMap[moduleName])}},config)}},write:function(pluginName,moduleName,write,config){var content=buildMap[moduleName];if(content)write.asModule(pluginName+"!"+moduleName,buildTemplateSource.replace("{pluginName}",pluginName).replace("{moduleName}",moduleName).replace("{content}",content))}}}); | justinelam/cdnjs | ajax/libs/requirejs-handlebars/0.0.2/hbars.min.js | JavaScript | mit | 1,424 |
<?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\Bundle\FrameworkBundle\Test;
use Symfony\Bundle\FrameworkBundle\Client;
/**
* WebTestCase is the base class for functional tests.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
abstract class WebTestCase extends KernelTestCase
{
/**
* Creates a Client.
*
* @param array $options An array of options to pass to the createKernel class
* @param array $server An array of server parameters
*
* @return Client A Client instance
*/
protected static function createClient(array $options = array(), array $server = array())
{
static::bootKernel($options);
$client = static::$kernel->getContainer()->get('test.client');
$client->setServerParameters($server);
return $client;
}
}
| dpp972/attractif | vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php | PHP | mit | 1,024 |
CodeMirror.defineMode("python", function(conf, parserConf) {
var ERRORCLASS = 'error';
function wordRegexp(words) {
return new RegExp("^((" + words.join(")|(") + "))\\b");
}
var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!]");
var singleDelimiters = parserConf.singleDelimiters || new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]');
var doubleOperators = parserConf.doubleOperators || new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))");
var doubleDelimiters = parserConf.doubleDelimiters || new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))");
var tripleDelimiters = parserConf.tripleDelimiters || new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");
var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z][_A-Za-z0-9]*");
var wordOperators = wordRegexp(['and', 'or', 'not', 'is', 'in']);
var commonkeywords = ['as', 'assert', 'break', 'class', 'continue',
'def', 'del', 'elif', 'else', 'except', 'finally',
'for', 'from', 'global', 'if', 'import',
'lambda', 'pass', 'raise', 'return',
'try', 'while', 'with', 'yield'];
var commonBuiltins = ['abs', 'all', 'any', 'bin', 'bool', 'bytearray', 'callable', 'chr',
'classmethod', 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod',
'enumerate', 'eval', 'filter', 'float', 'format', 'frozenset',
'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id',
'input', 'int', 'isinstance', 'issubclass', 'iter', 'len',
'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next',
'object', 'oct', 'open', 'ord', 'pow', 'property', 'range',
'repr', 'reversed', 'round', 'set', 'setattr', 'slice',
'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple',
'type', 'vars', 'zip', '__import__', 'NotImplemented',
'Ellipsis', '__debug__'];
var py2 = {'builtins': ['apply', 'basestring', 'buffer', 'cmp', 'coerce', 'execfile',
'file', 'intern', 'long', 'raw_input', 'reduce', 'reload',
'unichr', 'unicode', 'xrange', 'False', 'True', 'None'],
'keywords': ['exec', 'print']};
var py3 = {'builtins': ['ascii', 'bytes', 'exec', 'print'],
'keywords': ['nonlocal', 'False', 'True', 'None']};
if (!!parserConf.version && parseInt(parserConf.version, 10) === 3) {
commonkeywords = commonkeywords.concat(py3.keywords);
commonBuiltins = commonBuiltins.concat(py3.builtins);
var stringPrefixes = new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))", "i");
} else {
commonkeywords = commonkeywords.concat(py2.keywords);
commonBuiltins = commonBuiltins.concat(py2.builtins);
var stringPrefixes = new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i");
}
var keywords = wordRegexp(commonkeywords);
var builtins = wordRegexp(commonBuiltins);
var indentInfo = null;
// tokenizers
function tokenBase(stream, state) {
// Handle scope changes
if (stream.sol()) {
var scopeOffset = state.scopes[0].offset;
if (stream.eatSpace()) {
var lineOffset = stream.indentation();
if (lineOffset > scopeOffset) {
indentInfo = 'indent';
} else if (lineOffset < scopeOffset) {
indentInfo = 'dedent';
}
return null;
} else {
if (scopeOffset > 0) {
dedent(stream, state);
}
}
}
if (stream.eatSpace()) {
return null;
}
var ch = stream.peek();
// Handle Comments
if (ch === '#') {
stream.skipToEnd();
return 'comment';
}
// Handle Number Literals
if (stream.match(/^[0-9\.]/, false)) {
var floatLiteral = false;
// Floats
if (stream.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)) { floatLiteral = true; }
if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; }
if (stream.match(/^\.\d+/)) { floatLiteral = true; }
if (floatLiteral) {
// Float literals may be "imaginary"
stream.eat(/J/i);
return 'number';
}
// Integers
var intLiteral = false;
// Hex
if (stream.match(/^0x[0-9a-f]+/i)) { intLiteral = true; }
// Binary
if (stream.match(/^0b[01]+/i)) { intLiteral = true; }
// Octal
if (stream.match(/^0o[0-7]+/i)) { intLiteral = true; }
// Decimal
if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) {
// Decimal literals may be "imaginary"
stream.eat(/J/i);
// TODO - Can you have imaginary longs?
intLiteral = true;
}
// Zero by itself with no other piece of number.
if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; }
if (intLiteral) {
// Integer literals may be "long"
stream.eat(/L/i);
return 'number';
}
}
// Handle Strings
if (stream.match(stringPrefixes)) {
state.tokenize = tokenStringFactory(stream.current());
return state.tokenize(stream, state);
}
// Handle operators and Delimiters
if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) {
return null;
}
if (stream.match(doubleOperators)
|| stream.match(singleOperators)
|| stream.match(wordOperators)) {
return 'operator';
}
if (stream.match(singleDelimiters)) {
return null;
}
if (stream.match(keywords)) {
return 'keyword';
}
if (stream.match(builtins)) {
return 'builtin';
}
if (stream.match(identifiers)) {
return 'variable';
}
// Handle non-detected items
stream.next();
return ERRORCLASS;
}
function tokenStringFactory(delimiter) {
while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) {
delimiter = delimiter.substr(1);
}
var singleline = delimiter.length == 1;
var OUTCLASS = 'string';
function tokenString(stream, state) {
while (!stream.eol()) {
stream.eatWhile(/[^'"\\]/);
if (stream.eat('\\')) {
stream.next();
if (singleline && stream.eol()) {
return OUTCLASS;
}
} else if (stream.match(delimiter)) {
state.tokenize = tokenBase;
return OUTCLASS;
} else {
stream.eat(/['"]/);
}
}
if (singleline) {
if (parserConf.singleLineStringErrors) {
return ERRORCLASS;
} else {
state.tokenize = tokenBase;
}
}
return OUTCLASS;
}
tokenString.isString = true;
return tokenString;
}
function indent(stream, state, type) {
type = type || 'py';
var indentUnit = 0;
if (type === 'py') {
if (state.scopes[0].type !== 'py') {
state.scopes[0].offset = stream.indentation();
return;
}
for (var i = 0; i < state.scopes.length; ++i) {
if (state.scopes[i].type === 'py') {
indentUnit = state.scopes[i].offset + conf.indentUnit;
break;
}
}
} else {
indentUnit = stream.column() + stream.current().length;
}
state.scopes.unshift({
offset: indentUnit,
type: type
});
}
function dedent(stream, state, type) {
type = type || 'py';
if (state.scopes.length == 1) return;
if (state.scopes[0].type === 'py') {
var _indent = stream.indentation();
var _indent_index = -1;
for (var i = 0; i < state.scopes.length; ++i) {
if (_indent === state.scopes[i].offset) {
_indent_index = i;
break;
}
}
if (_indent_index === -1) {
return true;
}
while (state.scopes[0].offset !== _indent) {
state.scopes.shift();
}
return false;
} else {
if (type === 'py') {
state.scopes[0].offset = stream.indentation();
return false;
} else {
if (state.scopes[0].type != type) {
return true;
}
state.scopes.shift();
return false;
}
}
}
function tokenLexer(stream, state) {
indentInfo = null;
var style = state.tokenize(stream, state);
var current = stream.current();
// Handle '.' connected identifiers
if (current === '.') {
style = stream.match(identifiers, false) ? null : ERRORCLASS;
if (style === null && state.lastToken === 'meta') {
// Apply 'meta' style to '.' connected identifiers when
// appropriate.
style = 'meta';
}
return style;
}
// Handle decorators
if (current === '@') {
return stream.match(identifiers, false) ? 'meta' : ERRORCLASS;
}
if ((style === 'variable' || style === 'builtin')
&& state.lastToken === 'meta') {
style = 'meta';
}
// Handle scope changes.
if (current === 'pass' || current === 'return') {
state.dedent += 1;
}
if (current === 'lambda') state.lambda = true;
if ((current === ':' && !state.lambda && state.scopes[0].type == 'py')
|| indentInfo === 'indent') {
indent(stream, state);
}
var delimiter_index = '[({'.indexOf(current);
if (delimiter_index !== -1) {
indent(stream, state, '])}'.slice(delimiter_index, delimiter_index+1));
}
if (indentInfo === 'dedent') {
if (dedent(stream, state)) {
return ERRORCLASS;
}
}
delimiter_index = '])}'.indexOf(current);
if (delimiter_index !== -1) {
if (dedent(stream, state, current)) {
return ERRORCLASS;
}
}
if (state.dedent > 0 && stream.eol() && state.scopes[0].type == 'py') {
if (state.scopes.length > 1) state.scopes.shift();
state.dedent -= 1;
}
return style;
}
var external = {
startState: function(basecolumn) {
return {
tokenize: tokenBase,
scopes: [{offset:basecolumn || 0, type:'py'}],
lastToken: null,
lambda: false,
dedent: 0
};
},
token: function(stream, state) {
var style = tokenLexer(stream, state);
state.lastToken = style;
if (stream.eol() && stream.lambda) {
state.lambda = false;
}
return style;
},
indent: function(state) {
if (state.tokenize != tokenBase) {
return state.tokenize.isString ? CodeMirror.Pass : 0;
}
return state.scopes[0].offset;
},
lineComment: "#"
};
return external;
});
CodeMirror.defineMIME("text/x-python", "python");
| JackForbes/Audyo | node_modules/grunt-node-inspector/node_modules/node-inspector/front-end/cm/python.js | JavaScript | mit | 12,244 |
/*!
* Bootstrap v3.1.0 (http://getbootstrap.com)
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*! normalize.css v3.0.0 | MIT License | git.io/normalize */
html {
font-family: sans-serif;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
body {
margin: 0;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}
audio,
canvas,
progress,
video {
display: inline-block;
vertical-align: baseline;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden],
template {
display: none;
}
a {
background: transparent;
}
a:active,
a:hover {
outline: 0;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
dfn {
font-style: italic;
}
h1 {
margin: .67em 0;
font-size: 2em;
}
mark {
color: #000;
background: #ff0;
}
small {
font-size: 80%;
}
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
sup {
top: -.5em;
}
sub {
bottom: -.25em;
}
img {
border: 0;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 1em 40px;
}
hr {
height: 0;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
pre {
overflow: auto;
}
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
button,
input,
optgroup,
select,
textarea {
margin: 0;
font: inherit;
color: inherit;
}
button {
overflow: visible;
}
button,
select {
text-transform: none;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
}
button[disabled],
html input[disabled] {
cursor: default;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
padding: 0;
border: 0;
}
input {
line-height: normal;
}
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
padding: 0;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
input[type="search"] {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
-webkit-appearance: textfield;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
fieldset {
padding: .35em .625em .75em;
margin: 0 2px;
border: 1px solid #c0c0c0;
}
legend {
padding: 0;
border: 0;
}
textarea {
overflow: auto;
}
optgroup {
font-weight: bold;
}
table {
border-spacing: 0;
border-collapse: collapse;
}
td,
th {
padding: 0;
}
@media print {
* {
color: #000 !important;
text-shadow: none !important;
background: transparent !important;
box-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
abbr[title]:after {
content: " (" attr(title) ")";
}
a[href^="javascript:"]:after,
a[href^="#"]:after {
content: "";
}
pre,
blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
thead {
display: table-header-group;
}
tr,
img {
page-break-inside: avoid;
}
img {
max-width: 100% !important;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
page-break-after: avoid;
}
select {
background: #fff !important;
}
.navbar {
display: none;
}
.table td,
.table th {
background-color: #fff !important;
}
.btn > .caret,
.dropup > .btn > .caret {
border-top-color: #000 !important;
}
.label {
border: 1px solid #000;
}
.table {
border-collapse: collapse !important;
}
.table-bordered th,
.table-bordered td {
border: 1px solid #ddd !important;
}
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html {
font-size: 62.5%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.428571429;
color: #333;
background-color: #fff;
}
input,
button,
select,
textarea {
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
a {
color: #428bca;
text-decoration: none;
}
a:hover,
a:focus {
color: #2a6496;
text-decoration: underline;
}
a:focus {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
figure {
margin: 0;
}
img {
vertical-align: middle;
}
.img-responsive {
display: block;
max-width: 100%;
height: auto;
}
.img-rounded {
border-radius: 6px;
}
.img-thumbnail {
display: inline-block;
max-width: 100%;
height: auto;
padding: 4px;
line-height: 1.428571429;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 4px;
-webkit-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
.img-circle {
border-radius: 50%;
}
hr {
margin-top: 20px;
margin-bottom: 20px;
border: 0;
border-top: 1px solid #eee;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
font-family: inherit;
font-weight: 500;
line-height: 1.1;
color: inherit;
}
h1 small,
h2 small,
h3 small,
h4 small,
h5 small,
h6 small,
.h1 small,
.h2 small,
.h3 small,
.h4 small,
.h5 small,
.h6 small,
h1 .small,
h2 .small,
h3 .small,
h4 .small,
h5 .small,
h6 .small,
.h1 .small,
.h2 .small,
.h3 .small,
.h4 .small,
.h5 .small,
.h6 .small {
font-weight: normal;
line-height: 1;
color: #999;
}
h1,
.h1,
h2,
.h2,
h3,
.h3 {
margin-top: 20px;
margin-bottom: 10px;
}
h1 small,
.h1 small,
h2 small,
.h2 small,
h3 small,
.h3 small,
h1 .small,
.h1 .small,
h2 .small,
.h2 .small,
h3 .small,
.h3 .small {
font-size: 65%;
}
h4,
.h4,
h5,
.h5,
h6,
.h6 {
margin-top: 10px;
margin-bottom: 10px;
}
h4 small,
.h4 small,
h5 small,
.h5 small,
h6 small,
.h6 small,
h4 .small,
.h4 .small,
h5 .small,
.h5 .small,
h6 .small,
.h6 .small {
font-size: 75%;
}
h1,
.h1 {
font-size: 36px;
}
h2,
.h2 {
font-size: 30px;
}
h3,
.h3 {
font-size: 24px;
}
h4,
.h4 {
font-size: 18px;
}
h5,
.h5 {
font-size: 14px;
}
h6,
.h6 {
font-size: 12px;
}
p {
margin: 0 0 10px;
}
.lead {
margin-bottom: 20px;
font-size: 16px;
font-weight: 200;
line-height: 1.4;
}
@media (min-width: 768px) {
.lead {
font-size: 21px;
}
}
small,
.small {
font-size: 85%;
}
cite {
font-style: normal;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-center {
text-align: center;
}
.text-justify {
text-align: justify;
}
.text-muted {
color: #999;
}
.text-primary {
color: #428bca;
}
a.text-primary:hover {
color: #3071a9;
}
.text-success {
color: #3c763d;
}
a.text-success:hover {
color: #2b542c;
}
.text-info {
color: #31708f;
}
a.text-info:hover {
color: #245269;
}
.text-warning {
color: #8a6d3b;
}
a.text-warning:hover {
color: #66512c;
}
.text-danger {
color: #a94442;
}
a.text-danger:hover {
color: #843534;
}
.bg-primary {
color: #fff;
background-color: #428bca;
}
a.bg-primary:hover {
background-color: #3071a9;
}
.bg-success {
background-color: #dff0d8;
}
a.bg-success:hover {
background-color: #c1e2b3;
}
.bg-info {
background-color: #d9edf7;
}
a.bg-info:hover {
background-color: #afd9ee;
}
.bg-warning {
background-color: #fcf8e3;
}
a.bg-warning:hover {
background-color: #f7ecb5;
}
.bg-danger {
background-color: #f2dede;
}
a.bg-danger:hover {
background-color: #e4b9b9;
}
.page-header {
padding-bottom: 9px;
margin: 40px 0 20px;
border-bottom: 1px solid #eee;
}
ul,
ol {
margin-top: 0;
margin-bottom: 10px;
}
ul ul,
ol ul,
ul ol,
ol ol {
margin-bottom: 0;
}
.list-unstyled {
padding-left: 0;
list-style: none;
}
.list-inline {
padding-left: 0;
list-style: none;
}
.list-inline > li {
display: inline-block;
padding-right: 5px;
padding-left: 5px;
}
.list-inline > li:first-child {
padding-left: 0;
}
dl {
margin-top: 0;
margin-bottom: 20px;
}
dt,
dd {
line-height: 1.428571429;
}
dt {
font-weight: bold;
}
dd {
margin-left: 0;
}
@media (min-width: 768px) {
.dl-horizontal dt {
float: left;
width: 160px;
overflow: hidden;
clear: left;
text-align: right;
text-overflow: ellipsis;
white-space: nowrap;
}
.dl-horizontal dd {
margin-left: 180px;
}
}
abbr[title],
abbr[data-original-title] {
cursor: help;
border-bottom: 1px dotted #999;
}
.initialism {
font-size: 90%;
text-transform: uppercase;
}
blockquote {
padding: 10px 20px;
margin: 0 0 20px;
font-size: 17.5px;
border-left: 5px solid #eee;
}
blockquote p:last-child,
blockquote ul:last-child,
blockquote ol:last-child {
margin-bottom: 0;
}
blockquote footer,
blockquote small,
blockquote .small {
display: block;
font-size: 80%;
line-height: 1.428571429;
color: #999;
}
blockquote footer:before,
blockquote small:before,
blockquote .small:before {
content: '\2014 \00A0';
}
.blockquote-reverse,
blockquote.pull-right {
padding-right: 15px;
padding-left: 0;
text-align: right;
border-right: 5px solid #eee;
border-left: 0;
}
.blockquote-reverse footer:before,
blockquote.pull-right footer:before,
.blockquote-reverse small:before,
blockquote.pull-right small:before,
.blockquote-reverse .small:before,
blockquote.pull-right .small:before {
content: '';
}
.blockquote-reverse footer:after,
blockquote.pull-right footer:after,
.blockquote-reverse small:after,
blockquote.pull-right small:after,
.blockquote-reverse .small:after,
blockquote.pull-right .small:after {
content: '\00A0 \2014';
}
blockquote:before,
blockquote:after {
content: "";
}
address {
margin-bottom: 20px;
font-style: normal;
line-height: 1.428571429;
}
code,
kbd,
pre,
samp {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
code {
padding: 2px 4px;
font-size: 90%;
color: #c7254e;
white-space: nowrap;
background-color: #f9f2f4;
border-radius: 4px;
}
kbd {
padding: 2px 4px;
font-size: 90%;
color: #fff;
background-color: #333;
border-radius: 3px;
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
}
pre {
display: block;
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 1.428571429;
color: #333;
word-break: break-all;
word-wrap: break-word;
background-color: #f5f5f5;
border: 1px solid #ccc;
border-radius: 4px;
}
pre code {
padding: 0;
font-size: inherit;
color: inherit;
white-space: pre-wrap;
background-color: transparent;
border-radius: 0;
}
.pre-scrollable {
max-height: 340px;
overflow-y: scroll;
}
.container {
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
}
@media (min-width: 768px) {
.container {
width: 750px;
}
}
@media (min-width: 992px) {
.container {
width: 970px;
}
}
@media (min-width: 1200px) {
.container {
width: 1170px;
}
}
.container-fluid {
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
}
.row {
margin-right: -15px;
margin-left: -15px;
}
.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
position: relative;
min-height: 1px;
padding-right: 15px;
padding-left: 15px;
}
.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
float: left;
}
.col-xs-12 {
width: 100%;
}
.col-xs-11 {
width: 91.66666666666666%;
}
.col-xs-10 {
width: 83.33333333333334%;
}
.col-xs-9 {
width: 75%;
}
.col-xs-8 {
width: 66.66666666666666%;
}
.col-xs-7 {
width: 58.333333333333336%;
}
.col-xs-6 {
width: 50%;
}
.col-xs-5 {
width: 41.66666666666667%;
}
.col-xs-4 {
width: 33.33333333333333%;
}
.col-xs-3 {
width: 25%;
}
.col-xs-2 {
width: 16.666666666666664%;
}
.col-xs-1 {
width: 8.333333333333332%;
}
.col-xs-pull-12 {
right: 100%;
}
.col-xs-pull-11 {
right: 91.66666666666666%;
}
.col-xs-pull-10 {
right: 83.33333333333334%;
}
.col-xs-pull-9 {
right: 75%;
}
.col-xs-pull-8 {
right: 66.66666666666666%;
}
.col-xs-pull-7 {
right: 58.333333333333336%;
}
.col-xs-pull-6 {
right: 50%;
}
.col-xs-pull-5 {
right: 41.66666666666667%;
}
.col-xs-pull-4 {
right: 33.33333333333333%;
}
.col-xs-pull-3 {
right: 25%;
}
.col-xs-pull-2 {
right: 16.666666666666664%;
}
.col-xs-pull-1 {
right: 8.333333333333332%;
}
.col-xs-pull-0 {
right: 0;
}
.col-xs-push-12 {
left: 100%;
}
.col-xs-push-11 {
left: 91.66666666666666%;
}
.col-xs-push-10 {
left: 83.33333333333334%;
}
.col-xs-push-9 {
left: 75%;
}
.col-xs-push-8 {
left: 66.66666666666666%;
}
.col-xs-push-7 {
left: 58.333333333333336%;
}
.col-xs-push-6 {
left: 50%;
}
.col-xs-push-5 {
left: 41.66666666666667%;
}
.col-xs-push-4 {
left: 33.33333333333333%;
}
.col-xs-push-3 {
left: 25%;
}
.col-xs-push-2 {
left: 16.666666666666664%;
}
.col-xs-push-1 {
left: 8.333333333333332%;
}
.col-xs-push-0 {
left: 0;
}
.col-xs-offset-12 {
margin-left: 100%;
}
.col-xs-offset-11 {
margin-left: 91.66666666666666%;
}
.col-xs-offset-10 {
margin-left: 83.33333333333334%;
}
.col-xs-offset-9 {
margin-left: 75%;
}
.col-xs-offset-8 {
margin-left: 66.66666666666666%;
}
.col-xs-offset-7 {
margin-left: 58.333333333333336%;
}
.col-xs-offset-6 {
margin-left: 50%;
}
.col-xs-offset-5 {
margin-left: 41.66666666666667%;
}
.col-xs-offset-4 {
margin-left: 33.33333333333333%;
}
.col-xs-offset-3 {
margin-left: 25%;
}
.col-xs-offset-2 {
margin-left: 16.666666666666664%;
}
.col-xs-offset-1 {
margin-left: 8.333333333333332%;
}
.col-xs-offset-0 {
margin-left: 0;
}
@media (min-width: 768px) {
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
float: left;
}
.col-sm-12 {
width: 100%;
}
.col-sm-11 {
width: 91.66666666666666%;
}
.col-sm-10 {
width: 83.33333333333334%;
}
.col-sm-9 {
width: 75%;
}
.col-sm-8 {
width: 66.66666666666666%;
}
.col-sm-7 {
width: 58.333333333333336%;
}
.col-sm-6 {
width: 50%;
}
.col-sm-5 {
width: 41.66666666666667%;
}
.col-sm-4 {
width: 33.33333333333333%;
}
.col-sm-3 {
width: 25%;
}
.col-sm-2 {
width: 16.666666666666664%;
}
.col-sm-1 {
width: 8.333333333333332%;
}
.col-sm-pull-12 {
right: 100%;
}
.col-sm-pull-11 {
right: 91.66666666666666%;
}
.col-sm-pull-10 {
right: 83.33333333333334%;
}
.col-sm-pull-9 {
right: 75%;
}
.col-sm-pull-8 {
right: 66.66666666666666%;
}
.col-sm-pull-7 {
right: 58.333333333333336%;
}
.col-sm-pull-6 {
right: 50%;
}
.col-sm-pull-5 {
right: 41.66666666666667%;
}
.col-sm-pull-4 {
right: 33.33333333333333%;
}
.col-sm-pull-3 {
right: 25%;
}
.col-sm-pull-2 {
right: 16.666666666666664%;
}
.col-sm-pull-1 {
right: 8.333333333333332%;
}
.col-sm-pull-0 {
right: 0;
}
.col-sm-push-12 {
left: 100%;
}
.col-sm-push-11 {
left: 91.66666666666666%;
}
.col-sm-push-10 {
left: 83.33333333333334%;
}
.col-sm-push-9 {
left: 75%;
}
.col-sm-push-8 {
left: 66.66666666666666%;
}
.col-sm-push-7 {
left: 58.333333333333336%;
}
.col-sm-push-6 {
left: 50%;
}
.col-sm-push-5 {
left: 41.66666666666667%;
}
.col-sm-push-4 {
left: 33.33333333333333%;
}
.col-sm-push-3 {
left: 25%;
}
.col-sm-push-2 {
left: 16.666666666666664%;
}
.col-sm-push-1 {
left: 8.333333333333332%;
}
.col-sm-push-0 {
left: 0;
}
.col-sm-offset-12 {
margin-left: 100%;
}
.col-sm-offset-11 {
margin-left: 91.66666666666666%;
}
.col-sm-offset-10 {
margin-left: 83.33333333333334%;
}
.col-sm-offset-9 {
margin-left: 75%;
}
.col-sm-offset-8 {
margin-left: 66.66666666666666%;
}
.col-sm-offset-7 {
margin-left: 58.333333333333336%;
}
.col-sm-offset-6 {
margin-left: 50%;
}
.col-sm-offset-5 {
margin-left: 41.66666666666667%;
}
.col-sm-offset-4 {
margin-left: 33.33333333333333%;
}
.col-sm-offset-3 {
margin-left: 25%;
}
.col-sm-offset-2 {
margin-left: 16.666666666666664%;
}
.col-sm-offset-1 {
margin-left: 8.333333333333332%;
}
.col-sm-offset-0 {
margin-left: 0;
}
}
@media (min-width: 992px) {
.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
float: left;
}
.col-md-12 {
width: 100%;
}
.col-md-11 {
width: 91.66666666666666%;
}
.col-md-10 {
width: 83.33333333333334%;
}
.col-md-9 {
width: 75%;
}
.col-md-8 {
width: 66.66666666666666%;
}
.col-md-7 {
width: 58.333333333333336%;
}
.col-md-6 {
width: 50%;
}
.col-md-5 {
width: 41.66666666666667%;
}
.col-md-4 {
width: 33.33333333333333%;
}
.col-md-3 {
width: 25%;
}
.col-md-2 {
width: 16.666666666666664%;
}
.col-md-1 {
width: 8.333333333333332%;
}
.col-md-pull-12 {
right: 100%;
}
.col-md-pull-11 {
right: 91.66666666666666%;
}
.col-md-pull-10 {
right: 83.33333333333334%;
}
.col-md-pull-9 {
right: 75%;
}
.col-md-pull-8 {
right: 66.66666666666666%;
}
.col-md-pull-7 {
right: 58.333333333333336%;
}
.col-md-pull-6 {
right: 50%;
}
.col-md-pull-5 {
right: 41.66666666666667%;
}
.col-md-pull-4 {
right: 33.33333333333333%;
}
.col-md-pull-3 {
right: 25%;
}
.col-md-pull-2 {
right: 16.666666666666664%;
}
.col-md-pull-1 {
right: 8.333333333333332%;
}
.col-md-pull-0 {
right: 0;
}
.col-md-push-12 {
left: 100%;
}
.col-md-push-11 {
left: 91.66666666666666%;
}
.col-md-push-10 {
left: 83.33333333333334%;
}
.col-md-push-9 {
left: 75%;
}
.col-md-push-8 {
left: 66.66666666666666%;
}
.col-md-push-7 {
left: 58.333333333333336%;
}
.col-md-push-6 {
left: 50%;
}
.col-md-push-5 {
left: 41.66666666666667%;
}
.col-md-push-4 {
left: 33.33333333333333%;
}
.col-md-push-3 {
left: 25%;
}
.col-md-push-2 {
left: 16.666666666666664%;
}
.col-md-push-1 {
left: 8.333333333333332%;
}
.col-md-push-0 {
left: 0;
}
.col-md-offset-12 {
margin-left: 100%;
}
.col-md-offset-11 {
margin-left: 91.66666666666666%;
}
.col-md-offset-10 {
margin-left: 83.33333333333334%;
}
.col-md-offset-9 {
margin-left: 75%;
}
.col-md-offset-8 {
margin-left: 66.66666666666666%;
}
.col-md-offset-7 {
margin-left: 58.333333333333336%;
}
.col-md-offset-6 {
margin-left: 50%;
}
.col-md-offset-5 {
margin-left: 41.66666666666667%;
}
.col-md-offset-4 {
margin-left: 33.33333333333333%;
}
.col-md-offset-3 {
margin-left: 25%;
}
.col-md-offset-2 {
margin-left: 16.666666666666664%;
}
.col-md-offset-1 {
margin-left: 8.333333333333332%;
}
.col-md-offset-0 {
margin-left: 0;
}
}
@media (min-width: 1200px) {
.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
float: left;
}
.col-lg-12 {
width: 100%;
}
.col-lg-11 {
width: 91.66666666666666%;
}
.col-lg-10 {
width: 83.33333333333334%;
}
.col-lg-9 {
width: 75%;
}
.col-lg-8 {
width: 66.66666666666666%;
}
.col-lg-7 {
width: 58.333333333333336%;
}
.col-lg-6 {
width: 50%;
}
.col-lg-5 {
width: 41.66666666666667%;
}
.col-lg-4 {
width: 33.33333333333333%;
}
.col-lg-3 {
width: 25%;
}
.col-lg-2 {
width: 16.666666666666664%;
}
.col-lg-1 {
width: 8.333333333333332%;
}
.col-lg-pull-12 {
right: 100%;
}
.col-lg-pull-11 {
right: 91.66666666666666%;
}
.col-lg-pull-10 {
right: 83.33333333333334%;
}
.col-lg-pull-9 {
right: 75%;
}
.col-lg-pull-8 {
right: 66.66666666666666%;
}
.col-lg-pull-7 {
right: 58.333333333333336%;
}
.col-lg-pull-6 {
right: 50%;
}
.col-lg-pull-5 {
right: 41.66666666666667%;
}
.col-lg-pull-4 {
right: 33.33333333333333%;
}
.col-lg-pull-3 {
right: 25%;
}
.col-lg-pull-2 {
right: 16.666666666666664%;
}
.col-lg-pull-1 {
right: 8.333333333333332%;
}
.col-lg-pull-0 {
right: 0;
}
.col-lg-push-12 {
left: 100%;
}
.col-lg-push-11 {
left: 91.66666666666666%;
}
.col-lg-push-10 {
left: 83.33333333333334%;
}
.col-lg-push-9 {
left: 75%;
}
.col-lg-push-8 {
left: 66.66666666666666%;
}
.col-lg-push-7 {
left: 58.333333333333336%;
}
.col-lg-push-6 {
left: 50%;
}
.col-lg-push-5 {
left: 41.66666666666667%;
}
.col-lg-push-4 {
left: 33.33333333333333%;
}
.col-lg-push-3 {
left: 25%;
}
.col-lg-push-2 {
left: 16.666666666666664%;
}
.col-lg-push-1 {
left: 8.333333333333332%;
}
.col-lg-push-0 {
left: 0;
}
.col-lg-offset-12 {
margin-left: 100%;
}
.col-lg-offset-11 {
margin-left: 91.66666666666666%;
}
.col-lg-offset-10 {
margin-left: 83.33333333333334%;
}
.col-lg-offset-9 {
margin-left: 75%;
}
.col-lg-offset-8 {
margin-left: 66.66666666666666%;
}
.col-lg-offset-7 {
margin-left: 58.333333333333336%;
}
.col-lg-offset-6 {
margin-left: 50%;
}
.col-lg-offset-5 {
margin-left: 41.66666666666667%;
}
.col-lg-offset-4 {
margin-left: 33.33333333333333%;
}
.col-lg-offset-3 {
margin-left: 25%;
}
.col-lg-offset-2 {
margin-left: 16.666666666666664%;
}
.col-lg-offset-1 {
margin-left: 8.333333333333332%;
}
.col-lg-offset-0 {
margin-left: 0;
}
}
table {
max-width: 100%;
background-color: transparent;
}
th {
text-align: left;
}
.table {
width: 100%;
margin-bottom: 20px;
}
.table > thead > tr > th,
.table > tbody > tr > th,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > tbody > tr > td,
.table > tfoot > tr > td {
padding: 8px;
line-height: 1.428571429;
vertical-align: top;
border-top: 1px solid #ddd;
}
.table > thead > tr > th {
vertical-align: bottom;
border-bottom: 2px solid #ddd;
}
.table > caption + thead > tr:first-child > th,
.table > colgroup + thead > tr:first-child > th,
.table > thead:first-child > tr:first-child > th,
.table > caption + thead > tr:first-child > td,
.table > colgroup + thead > tr:first-child > td,
.table > thead:first-child > tr:first-child > td {
border-top: 0;
}
.table > tbody + tbody {
border-top: 2px solid #ddd;
}
.table .table {
background-color: #fff;
}
.table-condensed > thead > tr > th,
.table-condensed > tbody > tr > th,
.table-condensed > tfoot > tr > th,
.table-condensed > thead > tr > td,
.table-condensed > tbody > tr > td,
.table-condensed > tfoot > tr > td {
padding: 5px;
}
.table-bordered {
border: 1px solid #ddd;
}
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > tbody > tr > td,
.table-bordered > tfoot > tr > td {
border: 1px solid #ddd;
}
.table-bordered > thead > tr > th,
.table-bordered > thead > tr > td {
border-bottom-width: 2px;
}
.table-striped > tbody > tr:nth-child(odd) > td,
.table-striped > tbody > tr:nth-child(odd) > th {
background-color: #f9f9f9;
}
.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
background-color: #f5f5f5;
}
table col[class*="col-"] {
position: static;
display: table-column;
float: none;
}
table td[class*="col-"],
table th[class*="col-"] {
position: static;
display: table-cell;
float: none;
}
.table > thead > tr > td.active,
.table > tbody > tr > td.active,
.table > tfoot > tr > td.active,
.table > thead > tr > th.active,
.table > tbody > tr > th.active,
.table > tfoot > tr > th.active,
.table > thead > tr.active > td,
.table > tbody > tr.active > td,
.table > tfoot > tr.active > td,
.table > thead > tr.active > th,
.table > tbody > tr.active > th,
.table > tfoot > tr.active > th {
background-color: #f5f5f5;
}
.table-hover > tbody > tr > td.active:hover,
.table-hover > tbody > tr > th.active:hover,
.table-hover > tbody > tr.active:hover > td,
.table-hover > tbody > tr.active:hover > th {
background-color: #e8e8e8;
}
.table > thead > tr > td.success,
.table > tbody > tr > td.success,
.table > tfoot > tr > td.success,
.table > thead > tr > th.success,
.table > tbody > tr > th.success,
.table > tfoot > tr > th.success,
.table > thead > tr.success > td,
.table > tbody > tr.success > td,
.table > tfoot > tr.success > td,
.table > thead > tr.success > th,
.table > tbody > tr.success > th,
.table > tfoot > tr.success > th {
background-color: #dff0d8;
}
.table-hover > tbody > tr > td.success:hover,
.table-hover > tbody > tr > th.success:hover,
.table-hover > tbody > tr.success:hover > td,
.table-hover > tbody > tr.success:hover > th {
background-color: #d0e9c6;
}
.table > thead > tr > td.info,
.table > tbody > tr > td.info,
.table > tfoot > tr > td.info,
.table > thead > tr > th.info,
.table > tbody > tr > th.info,
.table > tfoot > tr > th.info,
.table > thead > tr.info > td,
.table > tbody > tr.info > td,
.table > tfoot > tr.info > td,
.table > thead > tr.info > th,
.table > tbody > tr.info > th,
.table > tfoot > tr.info > th {
background-color: #d9edf7;
}
.table-hover > tbody > tr > td.info:hover,
.table-hover > tbody > tr > th.info:hover,
.table-hover > tbody > tr.info:hover > td,
.table-hover > tbody > tr.info:hover > th {
background-color: #c4e3f3;
}
.table > thead > tr > td.warning,
.table > tbody > tr > td.warning,
.table > tfoot > tr > td.warning,
.table > thead > tr > th.warning,
.table > tbody > tr > th.warning,
.table > tfoot > tr > th.warning,
.table > thead > tr.warning > td,
.table > tbody > tr.warning > td,
.table > tfoot > tr.warning > td,
.table > thead > tr.warning > th,
.table > tbody > tr.warning > th,
.table > tfoot > tr.warning > th {
background-color: #fcf8e3;
}
.table-hover > tbody > tr > td.warning:hover,
.table-hover > tbody > tr > th.warning:hover,
.table-hover > tbody > tr.warning:hover > td,
.table-hover > tbody > tr.warning:hover > th {
background-color: #faf2cc;
}
.table > thead > tr > td.danger,
.table > tbody > tr > td.danger,
.table > tfoot > tr > td.danger,
.table > thead > tr > th.danger,
.table > tbody > tr > th.danger,
.table > tfoot > tr > th.danger,
.table > thead > tr.danger > td,
.table > tbody > tr.danger > td,
.table > tfoot > tr.danger > td,
.table > thead > tr.danger > th,
.table > tbody > tr.danger > th,
.table > tfoot > tr.danger > th {
background-color: #f2dede;
}
.table-hover > tbody > tr > td.danger:hover,
.table-hover > tbody > tr > th.danger:hover,
.table-hover > tbody > tr.danger:hover > td,
.table-hover > tbody > tr.danger:hover > th {
background-color: #ebcccc;
}
@media (max-width: 767px) {
.table-responsive {
width: 100%;
margin-bottom: 15px;
overflow-x: scroll;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
-ms-overflow-style: -ms-autohiding-scrollbar;
border: 1px solid #ddd;
}
.table-responsive > .table {
margin-bottom: 0;
}
.table-responsive > .table > thead > tr > th,
.table-responsive > .table > tbody > tr > th,
.table-responsive > .table > tfoot > tr > th,
.table-responsive > .table > thead > tr > td,
.table-responsive > .table > tbody > tr > td,
.table-responsive > .table > tfoot > tr > td {
white-space: nowrap;
}
.table-responsive > .table-bordered {
border: 0;
}
.table-responsive > .table-bordered > thead > tr > th:first-child,
.table-responsive > .table-bordered > tbody > tr > th:first-child,
.table-responsive > .table-bordered > tfoot > tr > th:first-child,
.table-responsive > .table-bordered > thead > tr > td:first-child,
.table-responsive > .table-bordered > tbody > tr > td:first-child,
.table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0;
}
.table-responsive > .table-bordered > thead > tr > th:last-child,
.table-responsive > .table-bordered > tbody > tr > th:last-child,
.table-responsive > .table-bordered > tfoot > tr > th:last-child,
.table-responsive > .table-bordered > thead > tr > td:last-child,
.table-responsive > .table-bordered > tbody > tr > td:last-child,
.table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0;
}
.table-responsive > .table-bordered > tbody > tr:last-child > th,
.table-responsive > .table-bordered > tfoot > tr:last-child > th,
.table-responsive > .table-bordered > tbody > tr:last-child > td,
.table-responsive > .table-bordered > tfoot > tr:last-child > td {
border-bottom: 0;
}
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
display: block;
width: 100%;
padding: 0;
margin-bottom: 20px;
font-size: 21px;
line-height: inherit;
color: #333;
border: 0;
border-bottom: 1px solid #e5e5e5;
}
label {
display: inline-block;
margin-bottom: 5px;
font-weight: bold;
}
input[type="search"] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
input[type="radio"],
input[type="checkbox"] {
margin: 4px 0 0;
margin-top: 1px \9;
/* IE8-9 */
line-height: normal;
}
input[type="file"] {
display: block;
}
input[type="range"] {
display: block;
width: 100%;
}
select[multiple],
select[size] {
height: auto;
}
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
output {
display: block;
padding-top: 7px;
font-size: 14px;
line-height: 1.428571429;
color: #555;
}
.form-control {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.form-control:focus {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
}
.form-control:-moz-placeholder {
color: #999;
}
.form-control::-moz-placeholder {
color: #999;
opacity: 1;
}
.form-control:-ms-input-placeholder {
color: #999;
}
.form-control::-webkit-input-placeholder {
color: #999;
}
.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
cursor: not-allowed;
background-color: #eee;
opacity: 1;
}
textarea.form-control {
height: auto;
}
input[type="date"] {
line-height: 34px;
}
.form-group {
margin-bottom: 15px;
}
.radio,
.checkbox {
display: block;
min-height: 20px;
padding-left: 20px;
margin-top: 10px;
margin-bottom: 10px;
}
.radio label,
.checkbox label {
display: inline;
font-weight: normal;
cursor: pointer;
}
.radio input[type="radio"],
.radio-inline input[type="radio"],
.checkbox input[type="checkbox"],
.checkbox-inline input[type="checkbox"] {
float: left;
margin-left: -20px;
}
.radio + .radio,
.checkbox + .checkbox {
margin-top: -5px;
}
.radio-inline,
.checkbox-inline {
display: inline-block;
padding-left: 20px;
margin-bottom: 0;
font-weight: normal;
vertical-align: middle;
cursor: pointer;
}
.radio-inline + .radio-inline,
.checkbox-inline + .checkbox-inline {
margin-top: 0;
margin-left: 10px;
}
input[type="radio"][disabled],
input[type="checkbox"][disabled],
.radio[disabled],
.radio-inline[disabled],
.checkbox[disabled],
.checkbox-inline[disabled],
fieldset[disabled] input[type="radio"],
fieldset[disabled] input[type="checkbox"],
fieldset[disabled] .radio,
fieldset[disabled] .radio-inline,
fieldset[disabled] .checkbox,
fieldset[disabled] .checkbox-inline {
cursor: not-allowed;
}
.input-sm {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
select.input-sm {
height: 30px;
line-height: 30px;
}
textarea.input-sm,
select[multiple].input-sm {
height: auto;
}
.input-lg {
height: 46px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
select.input-lg {
height: 46px;
line-height: 46px;
}
textarea.input-lg,
select[multiple].input-lg {
height: auto;
}
.has-feedback {
position: relative;
}
.has-feedback .form-control {
padding-right: 42.5px;
}
.has-feedback .form-control-feedback {
position: absolute;
top: 25px;
right: 0;
display: block;
width: 34px;
height: 34px;
line-height: 34px;
text-align: center;
}
.has-success .help-block,
.has-success .control-label,
.has-success .radio,
.has-success .checkbox,
.has-success .radio-inline,
.has-success .checkbox-inline {
color: #3c763d;
}
.has-success .form-control {
border-color: #3c763d;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
}
.has-success .form-control:focus {
border-color: #2b542c;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168;
}
.has-success .input-group-addon {
color: #3c763d;
background-color: #dff0d8;
border-color: #3c763d;
}
.has-success .form-control-feedback {
color: #3c763d;
}
.has-warning .help-block,
.has-warning .control-label,
.has-warning .radio,
.has-warning .checkbox,
.has-warning .radio-inline,
.has-warning .checkbox-inline {
color: #8a6d3b;
}
.has-warning .form-control {
border-color: #8a6d3b;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
}
.has-warning .form-control:focus {
border-color: #66512c;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b;
}
.has-warning .input-group-addon {
color: #8a6d3b;
background-color: #fcf8e3;
border-color: #8a6d3b;
}
.has-warning .form-control-feedback {
color: #8a6d3b;
}
.has-error .help-block,
.has-error .control-label,
.has-error .radio,
.has-error .checkbox,
.has-error .radio-inline,
.has-error .checkbox-inline {
color: #a94442;
}
.has-error .form-control {
border-color: #a94442;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
}
.has-error .form-control:focus {
border-color: #843534;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483;
}
.has-error .input-group-addon {
color: #a94442;
background-color: #f2dede;
border-color: #a94442;
}
.has-error .form-control-feedback {
color: #a94442;
}
.form-control-static {
margin-bottom: 0;
}
.help-block {
display: block;
margin-top: 5px;
margin-bottom: 10px;
color: #737373;
}
@media (min-width: 768px) {
.form-inline .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .form-control {
display: inline-block;
width: auto;
vertical-align: middle;
}
.form-inline .control-label {
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .radio,
.form-inline .checkbox {
display: inline-block;
padding-left: 0;
margin-top: 0;
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .radio input[type="radio"],
.form-inline .checkbox input[type="checkbox"] {
float: none;
margin-left: 0;
}
.form-inline .has-feedback .form-control-feedback {
top: 0;
}
}
.form-horizontal .control-label,
.form-horizontal .radio,
.form-horizontal .checkbox,
.form-horizontal .radio-inline,
.form-horizontal .checkbox-inline {
padding-top: 7px;
margin-top: 0;
margin-bottom: 0;
}
.form-horizontal .radio,
.form-horizontal .checkbox {
min-height: 27px;
}
.form-horizontal .form-group {
margin-right: -15px;
margin-left: -15px;
}
.form-horizontal .form-control-static {
padding-top: 7px;
}
@media (min-width: 768px) {
.form-horizontal .control-label {
text-align: right;
}
}
.form-horizontal .has-feedback .form-control-feedback {
top: 0;
right: 15px;
}
.btn {
display: inline-block;
padding: 6px 12px;
margin-bottom: 0;
font-size: 14px;
font-weight: normal;
line-height: 1.428571429;
text-align: center;
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
}
.btn:focus {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.btn:hover,
.btn:focus {
color: #333;
text-decoration: none;
}
.btn:active,
.btn.active {
background-image: none;
outline: 0;
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
}
.btn.disabled,
.btn[disabled],
fieldset[disabled] .btn {
pointer-events: none;
cursor: not-allowed;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
opacity: .65;
}
.btn-default {
color: #333;
background-color: #fff;
border-color: #ccc;
}
.btn-default:hover,
.btn-default:focus,
.btn-default:active,
.btn-default.active,
.open .dropdown-toggle.btn-default {
color: #333;
background-color: #ebebeb;
border-color: #adadad;
}
.btn-default:active,
.btn-default.active,
.open .dropdown-toggle.btn-default {
background-image: none;
}
.btn-default.disabled,
.btn-default[disabled],
fieldset[disabled] .btn-default,
.btn-default.disabled:hover,
.btn-default[disabled]:hover,
fieldset[disabled] .btn-default:hover,
.btn-default.disabled:focus,
.btn-default[disabled]:focus,
fieldset[disabled] .btn-default:focus,
.btn-default.disabled:active,
.btn-default[disabled]:active,
fieldset[disabled] .btn-default:active,
.btn-default.disabled.active,
.btn-default[disabled].active,
fieldset[disabled] .btn-default.active {
background-color: #fff;
border-color: #ccc;
}
.btn-default .badge {
color: #fff;
background-color: #333;
}
.btn-primary {
color: #fff;
background-color: #428bca;
border-color: #357ebd;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.open .dropdown-toggle.btn-primary {
color: #fff;
background-color: #3276b1;
border-color: #285e8e;
}
.btn-primary:active,
.btn-primary.active,
.open .dropdown-toggle.btn-primary {
background-image: none;
}
.btn-primary.disabled,
.btn-primary[disabled],
fieldset[disabled] .btn-primary,
.btn-primary.disabled:hover,
.btn-primary[disabled]:hover,
fieldset[disabled] .btn-primary:hover,
.btn-primary.disabled:focus,
.btn-primary[disabled]:focus,
fieldset[disabled] .btn-primary:focus,
.btn-primary.disabled:active,
.btn-primary[disabled]:active,
fieldset[disabled] .btn-primary:active,
.btn-primary.disabled.active,
.btn-primary[disabled].active,
fieldset[disabled] .btn-primary.active {
background-color: #428bca;
border-color: #357ebd;
}
.btn-primary .badge {
color: #428bca;
background-color: #fff;
}
.btn-success {
color: #fff;
background-color: #5cb85c;
border-color: #4cae4c;
}
.btn-success:hover,
.btn-success:focus,
.btn-success:active,
.btn-success.active,
.open .dropdown-toggle.btn-success {
color: #fff;
background-color: #47a447;
border-color: #398439;
}
.btn-success:active,
.btn-success.active,
.open .dropdown-toggle.btn-success {
background-image: none;
}
.btn-success.disabled,
.btn-success[disabled],
fieldset[disabled] .btn-success,
.btn-success.disabled:hover,
.btn-success[disabled]:hover,
fieldset[disabled] .btn-success:hover,
.btn-success.disabled:focus,
.btn-success[disabled]:focus,
fieldset[disabled] .btn-success:focus,
.btn-success.disabled:active,
.btn-success[disabled]:active,
fieldset[disabled] .btn-success:active,
.btn-success.disabled.active,
.btn-success[disabled].active,
fieldset[disabled] .btn-success.active {
background-color: #5cb85c;
border-color: #4cae4c;
}
.btn-success .badge {
color: #5cb85c;
background-color: #fff;
}
.btn-info {
color: #fff;
background-color: #5bc0de;
border-color: #46b8da;
}
.btn-info:hover,
.btn-info:focus,
.btn-info:active,
.btn-info.active,
.open .dropdown-toggle.btn-info {
color: #fff;
background-color: #39b3d7;
border-color: #269abc;
}
.btn-info:active,
.btn-info.active,
.open .dropdown-toggle.btn-info {
background-image: none;
}
.btn-info.disabled,
.btn-info[disabled],
fieldset[disabled] .btn-info,
.btn-info.disabled:hover,
.btn-info[disabled]:hover,
fieldset[disabled] .btn-info:hover,
.btn-info.disabled:focus,
.btn-info[disabled]:focus,
fieldset[disabled] .btn-info:focus,
.btn-info.disabled:active,
.btn-info[disabled]:active,
fieldset[disabled] .btn-info:active,
.btn-info.disabled.active,
.btn-info[disabled].active,
fieldset[disabled] .btn-info.active {
background-color: #5bc0de;
border-color: #46b8da;
}
.btn-info .badge {
color: #5bc0de;
background-color: #fff;
}
.btn-warning {
color: #fff;
background-color: #f0ad4e;
border-color: #eea236;
}
.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active,
.btn-warning.active,
.open .dropdown-toggle.btn-warning {
color: #fff;
background-color: #ed9c28;
border-color: #d58512;
}
.btn-warning:active,
.btn-warning.active,
.open .dropdown-toggle.btn-warning {
background-image: none;
}
.btn-warning.disabled,
.btn-warning[disabled],
fieldset[disabled] .btn-warning,
.btn-warning.disabled:hover,
.btn-warning[disabled]:hover,
fieldset[disabled] .btn-warning:hover,
.btn-warning.disabled:focus,
.btn-warning[disabled]:focus,
fieldset[disabled] .btn-warning:focus,
.btn-warning.disabled:active,
.btn-warning[disabled]:active,
fieldset[disabled] .btn-warning:active,
.btn-warning.disabled.active,
.btn-warning[disabled].active,
fieldset[disabled] .btn-warning.active {
background-color: #f0ad4e;
border-color: #eea236;
}
.btn-warning .badge {
color: #f0ad4e;
background-color: #fff;
}
.btn-danger {
color: #fff;
background-color: #d9534f;
border-color: #d43f3a;
}
.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-danger.active,
.open .dropdown-toggle.btn-danger {
color: #fff;
background-color: #d2322d;
border-color: #ac2925;
}
.btn-danger:active,
.btn-danger.active,
.open .dropdown-toggle.btn-danger {
background-image: none;
}
.btn-danger.disabled,
.btn-danger[disabled],
fieldset[disabled] .btn-danger,
.btn-danger.disabled:hover,
.btn-danger[disabled]:hover,
fieldset[disabled] .btn-danger:hover,
.btn-danger.disabled:focus,
.btn-danger[disabled]:focus,
fieldset[disabled] .btn-danger:focus,
.btn-danger.disabled:active,
.btn-danger[disabled]:active,
fieldset[disabled] .btn-danger:active,
.btn-danger.disabled.active,
.btn-danger[disabled].active,
fieldset[disabled] .btn-danger.active {
background-color: #d9534f;
border-color: #d43f3a;
}
.btn-danger .badge {
color: #d9534f;
background-color: #fff;
}
.btn-link {
font-weight: normal;
color: #428bca;
cursor: pointer;
border-radius: 0;
}
.btn-link,
.btn-link:active,
.btn-link[disabled],
fieldset[disabled] .btn-link {
background-color: transparent;
-webkit-box-shadow: none;
box-shadow: none;
}
.btn-link,
.btn-link:hover,
.btn-link:focus,
.btn-link:active {
border-color: transparent;
}
.btn-link:hover,
.btn-link:focus {
color: #2a6496;
text-decoration: underline;
background-color: transparent;
}
.btn-link[disabled]:hover,
fieldset[disabled] .btn-link:hover,
.btn-link[disabled]:focus,
fieldset[disabled] .btn-link:focus {
color: #999;
text-decoration: none;
}
.btn-lg {
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
.btn-sm {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.btn-xs {
padding: 1px 5px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.btn-block {
display: block;
width: 100%;
padding-right: 0;
padding-left: 0;
}
.btn-block + .btn-block {
margin-top: 5px;
}
input[type="submit"].btn-block,
input[type="reset"].btn-block,
input[type="button"].btn-block {
width: 100%;
}
.fade {
opacity: 0;
-webkit-transition: opacity .15s linear;
transition: opacity .15s linear;
}
.fade.in {
opacity: 1;
}
.collapse {
display: none;
}
.collapse.in {
display: block;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition: height .35s ease;
transition: height .35s ease;
}
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
.glyphicon {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings';
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.glyphicon-asterisk:before {
content: "\2a";
}
.glyphicon-plus:before {
content: "\2b";
}
.glyphicon-euro:before {
content: "\20ac";
}
.glyphicon-minus:before {
content: "\2212";
}
.glyphicon-cloud:before {
content: "\2601";
}
.glyphicon-envelope:before {
content: "\2709";
}
.glyphicon-pencil:before {
content: "\270f";
}
.glyphicon-glass:before {
content: "\e001";
}
.glyphicon-music:before {
content: "\e002";
}
.glyphicon-search:before {
content: "\e003";
}
.glyphicon-heart:before {
content: "\e005";
}
.glyphicon-star:before {
content: "\e006";
}
.glyphicon-star-empty:before {
content: "\e007";
}
.glyphicon-user:before {
content: "\e008";
}
.glyphicon-film:before {
content: "\e009";
}
.glyphicon-th-large:before {
content: "\e010";
}
.glyphicon-th:before {
content: "\e011";
}
.glyphicon-th-list:before {
content: "\e012";
}
.glyphicon-ok:before {
content: "\e013";
}
.glyphicon-remove:before {
content: "\e014";
}
.glyphicon-zoom-in:before {
content: "\e015";
}
.glyphicon-zoom-out:before {
content: "\e016";
}
.glyphicon-off:before {
content: "\e017";
}
.glyphicon-signal:before {
content: "\e018";
}
.glyphicon-cog:before {
content: "\e019";
}
.glyphicon-trash:before {
content: "\e020";
}
.glyphicon-home:before {
content: "\e021";
}
.glyphicon-file:before {
content: "\e022";
}
.glyphicon-time:before {
content: "\e023";
}
.glyphicon-road:before {
content: "\e024";
}
.glyphicon-download-alt:before {
content: "\e025";
}
.glyphicon-download:before {
content: "\e026";
}
.glyphicon-upload:before {
content: "\e027";
}
.glyphicon-inbox:before {
content: "\e028";
}
.glyphicon-play-circle:before {
content: "\e029";
}
.glyphicon-repeat:before {
content: "\e030";
}
.glyphicon-refresh:before {
content: "\e031";
}
.glyphicon-list-alt:before {
content: "\e032";
}
.glyphicon-lock:before {
content: "\e033";
}
.glyphicon-flag:before {
content: "\e034";
}
.glyphicon-headphones:before {
content: "\e035";
}
.glyphicon-volume-off:before {
content: "\e036";
}
.glyphicon-volume-down:before {
content: "\e037";
}
.glyphicon-volume-up:before {
content: "\e038";
}
.glyphicon-qrcode:before {
content: "\e039";
}
.glyphicon-barcode:before {
content: "\e040";
}
.glyphicon-tag:before {
content: "\e041";
}
.glyphicon-tags:before {
content: "\e042";
}
.glyphicon-book:before {
content: "\e043";
}
.glyphicon-bookmark:before {
content: "\e044";
}
.glyphicon-print:before {
content: "\e045";
}
.glyphicon-camera:before {
content: "\e046";
}
.glyphicon-font:before {
content: "\e047";
}
.glyphicon-bold:before {
content: "\e048";
}
.glyphicon-italic:before {
content: "\e049";
}
.glyphicon-text-height:before {
content: "\e050";
}
.glyphicon-text-width:before {
content: "\e051";
}
.glyphicon-align-left:before {
content: "\e052";
}
.glyphicon-align-center:before {
content: "\e053";
}
.glyphicon-align-right:before {
content: "\e054";
}
.glyphicon-align-justify:before {
content: "\e055";
}
.glyphicon-list:before {
content: "\e056";
}
.glyphicon-indent-left:before {
content: "\e057";
}
.glyphicon-indent-right:before {
content: "\e058";
}
.glyphicon-facetime-video:before {
content: "\e059";
}
.glyphicon-picture:before {
content: "\e060";
}
.glyphicon-map-marker:before {
content: "\e062";
}
.glyphicon-adjust:before {
content: "\e063";
}
.glyphicon-tint:before {
content: "\e064";
}
.glyphicon-edit:before {
content: "\e065";
}
.glyphicon-share:before {
content: "\e066";
}
.glyphicon-check:before {
content: "\e067";
}
.glyphicon-move:before {
content: "\e068";
}
.glyphicon-step-backward:before {
content: "\e069";
}
.glyphicon-fast-backward:before {
content: "\e070";
}
.glyphicon-backward:before {
content: "\e071";
}
.glyphicon-play:before {
content: "\e072";
}
.glyphicon-pause:before {
content: "\e073";
}
.glyphicon-stop:before {
content: "\e074";
}
.glyphicon-forward:before {
content: "\e075";
}
.glyphicon-fast-forward:before {
content: "\e076";
}
.glyphicon-step-forward:before {
content: "\e077";
}
.glyphicon-eject:before {
content: "\e078";
}
.glyphicon-chevron-left:before {
content: "\e079";
}
.glyphicon-chevron-right:before {
content: "\e080";
}
.glyphicon-plus-sign:before {
content: "\e081";
}
.glyphicon-minus-sign:before {
content: "\e082";
}
.glyphicon-remove-sign:before {
content: "\e083";
}
.glyphicon-ok-sign:before {
content: "\e084";
}
.glyphicon-question-sign:before {
content: "\e085";
}
.glyphicon-info-sign:before {
content: "\e086";
}
.glyphicon-screenshot:before {
content: "\e087";
}
.glyphicon-remove-circle:before {
content: "\e088";
}
.glyphicon-ok-circle:before {
content: "\e089";
}
.glyphicon-ban-circle:before {
content: "\e090";
}
.glyphicon-arrow-left:before {
content: "\e091";
}
.glyphicon-arrow-right:before {
content: "\e092";
}
.glyphicon-arrow-up:before {
content: "\e093";
}
.glyphicon-arrow-down:before {
content: "\e094";
}
.glyphicon-share-alt:before {
content: "\e095";
}
.glyphicon-resize-full:before {
content: "\e096";
}
.glyphicon-resize-small:before {
content: "\e097";
}
.glyphicon-exclamation-sign:before {
content: "\e101";
}
.glyphicon-gift:before {
content: "\e102";
}
.glyphicon-leaf:before {
content: "\e103";
}
.glyphicon-fire:before {
content: "\e104";
}
.glyphicon-eye-open:before {
content: "\e105";
}
.glyphicon-eye-close:before {
content: "\e106";
}
.glyphicon-warning-sign:before {
content: "\e107";
}
.glyphicon-plane:before {
content: "\e108";
}
.glyphicon-calendar:before {
content: "\e109";
}
.glyphicon-random:before {
content: "\e110";
}
.glyphicon-comment:before {
content: "\e111";
}
.glyphicon-magnet:before {
content: "\e112";
}
.glyphicon-chevron-up:before {
content: "\e113";
}
.glyphicon-chevron-down:before {
content: "\e114";
}
.glyphicon-retweet:before {
content: "\e115";
}
.glyphicon-shopping-cart:before {
content: "\e116";
}
.glyphicon-folder-close:before {
content: "\e117";
}
.glyphicon-folder-open:before {
content: "\e118";
}
.glyphicon-resize-vertical:before {
content: "\e119";
}
.glyphicon-resize-horizontal:before {
content: "\e120";
}
.glyphicon-hdd:before {
content: "\e121";
}
.glyphicon-bullhorn:before {
content: "\e122";
}
.glyphicon-bell:before {
content: "\e123";
}
.glyphicon-certificate:before {
content: "\e124";
}
.glyphicon-thumbs-up:before {
content: "\e125";
}
.glyphicon-thumbs-down:before {
content: "\e126";
}
.glyphicon-hand-right:before {
content: "\e127";
}
.glyphicon-hand-left:before {
content: "\e128";
}
.glyphicon-hand-up:before {
content: "\e129";
}
.glyphicon-hand-down:before {
content: "\e130";
}
.glyphicon-circle-arrow-right:before {
content: "\e131";
}
.glyphicon-circle-arrow-left:before {
content: "\e132";
}
.glyphicon-circle-arrow-up:before {
content: "\e133";
}
.glyphicon-circle-arrow-down:before {
content: "\e134";
}
.glyphicon-globe:before {
content: "\e135";
}
.glyphicon-wrench:before {
content: "\e136";
}
.glyphicon-tasks:before {
content: "\e137";
}
.glyphicon-filter:before {
content: "\e138";
}
.glyphicon-briefcase:before {
content: "\e139";
}
.glyphicon-fullscreen:before {
content: "\e140";
}
.glyphicon-dashboard:before {
content: "\e141";
}
.glyphicon-paperclip:before {
content: "\e142";
}
.glyphicon-heart-empty:before {
content: "\e143";
}
.glyphicon-link:before {
content: "\e144";
}
.glyphicon-phone:before {
content: "\e145";
}
.glyphicon-pushpin:before {
content: "\e146";
}
.glyphicon-usd:before {
content: "\e148";
}
.glyphicon-gbp:before {
content: "\e149";
}
.glyphicon-sort:before {
content: "\e150";
}
.glyphicon-sort-by-alphabet:before {
content: "\e151";
}
.glyphicon-sort-by-alphabet-alt:before {
content: "\e152";
}
.glyphicon-sort-by-order:before {
content: "\e153";
}
.glyphicon-sort-by-order-alt:before {
content: "\e154";
}
.glyphicon-sort-by-attributes:before {
content: "\e155";
}
.glyphicon-sort-by-attributes-alt:before {
content: "\e156";
}
.glyphicon-unchecked:before {
content: "\e157";
}
.glyphicon-expand:before {
content: "\e158";
}
.glyphicon-collapse-down:before {
content: "\e159";
}
.glyphicon-collapse-up:before {
content: "\e160";
}
.glyphicon-log-in:before {
content: "\e161";
}
.glyphicon-flash:before {
content: "\e162";
}
.glyphicon-log-out:before {
content: "\e163";
}
.glyphicon-new-window:before {
content: "\e164";
}
.glyphicon-record:before {
content: "\e165";
}
.glyphicon-save:before {
content: "\e166";
}
.glyphicon-open:before {
content: "\e167";
}
.glyphicon-saved:before {
content: "\e168";
}
.glyphicon-import:before {
content: "\e169";
}
.glyphicon-export:before {
content: "\e170";
}
.glyphicon-send:before {
content: "\e171";
}
.glyphicon-floppy-disk:before {
content: "\e172";
}
.glyphicon-floppy-saved:before {
content: "\e173";
}
.glyphicon-floppy-remove:before {
content: "\e174";
}
.glyphicon-floppy-save:before {
content: "\e175";
}
.glyphicon-floppy-open:before {
content: "\e176";
}
.glyphicon-credit-card:before {
content: "\e177";
}
.glyphicon-transfer:before {
content: "\e178";
}
.glyphicon-cutlery:before {
content: "\e179";
}
.glyphicon-header:before {
content: "\e180";
}
.glyphicon-compressed:before {
content: "\e181";
}
.glyphicon-earphone:before {
content: "\e182";
}
.glyphicon-phone-alt:before {
content: "\e183";
}
.glyphicon-tower:before {
content: "\e184";
}
.glyphicon-stats:before {
content: "\e185";
}
.glyphicon-sd-video:before {
content: "\e186";
}
.glyphicon-hd-video:before {
content: "\e187";
}
.glyphicon-subtitles:before {
content: "\e188";
}
.glyphicon-sound-stereo:before {
content: "\e189";
}
.glyphicon-sound-dolby:before {
content: "\e190";
}
.glyphicon-sound-5-1:before {
content: "\e191";
}
.glyphicon-sound-6-1:before {
content: "\e192";
}
.glyphicon-sound-7-1:before {
content: "\e193";
}
.glyphicon-copyright-mark:before {
content: "\e194";
}
.glyphicon-registration-mark:before {
content: "\e195";
}
.glyphicon-cloud-download:before {
content: "\e197";
}
.glyphicon-cloud-upload:before {
content: "\e198";
}
.glyphicon-tree-conifer:before {
content: "\e199";
}
.glyphicon-tree-deciduous:before {
content: "\e200";
}
.caret {
display: inline-block;
width: 0;
height: 0;
margin-left: 2px;
vertical-align: middle;
border-top: 4px solid;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
}
.dropdown {
position: relative;
}
.dropdown-toggle:focus {
outline: 0;
}
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
font-size: 14px;
list-style: none;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, .15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
}
.dropdown-menu.pull-right {
right: 0;
left: auto;
}
.dropdown-menu .divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.dropdown-menu > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.428571429;
color: #333;
white-space: nowrap;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
color: #262626;
text-decoration: none;
background-color: #f5f5f5;
}
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
color: #fff;
text-decoration: none;
background-color: #428bca;
outline: 0;
}
.dropdown-menu > .disabled > a,
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
color: #999;
}
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
text-decoration: none;
cursor: not-allowed;
background-color: transparent;
background-image: none;
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.open > .dropdown-menu {
display: block;
}
.open > a {
outline: 0;
}
.dropdown-menu-right {
right: 0;
left: auto;
}
.dropdown-menu-left {
right: auto;
left: 0;
}
.dropdown-header {
display: block;
padding: 3px 20px;
font-size: 12px;
line-height: 1.428571429;
color: #999;
}
.dropdown-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 990;
}
.pull-right > .dropdown-menu {
right: 0;
left: auto;
}
.dropup .caret,
.navbar-fixed-bottom .dropdown .caret {
content: "";
border-top: 0;
border-bottom: 4px solid;
}
.dropup .dropdown-menu,
.navbar-fixed-bottom .dropdown .dropdown-menu {
top: auto;
bottom: 100%;
margin-bottom: 1px;
}
@media (min-width: 768px) {
.navbar-right .dropdown-menu {
right: 0;
left: auto;
}
.navbar-right .dropdown-menu-left {
right: auto;
left: 0;
}
}
.btn-group,
.btn-group-vertical {
position: relative;
display: inline-block;
vertical-align: middle;
}
.btn-group > .btn,
.btn-group-vertical > .btn {
position: relative;
float: left;
}
.btn-group > .btn:hover,
.btn-group-vertical > .btn:hover,
.btn-group > .btn:focus,
.btn-group-vertical > .btn:focus,
.btn-group > .btn:active,
.btn-group-vertical > .btn:active,
.btn-group > .btn.active,
.btn-group-vertical > .btn.active {
z-index: 2;
}
.btn-group > .btn:focus,
.btn-group-vertical > .btn:focus {
outline: none;
}
.btn-group .btn + .btn,
.btn-group .btn + .btn-group,
.btn-group .btn-group + .btn,
.btn-group .btn-group + .btn-group {
margin-left: -1px;
}
.btn-toolbar {
margin-left: -5px;
}
.btn-toolbar .btn-group,
.btn-toolbar .input-group {
float: left;
}
.btn-toolbar > .btn,
.btn-toolbar > .btn-group,
.btn-toolbar > .input-group {
margin-left: 5px;
}
.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
border-radius: 0;
}
.btn-group > .btn:first-child {
margin-left: 0;
}
.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.btn-group > .btn:last-child:not(:first-child),
.btn-group > .dropdown-toggle:not(:first-child) {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.btn-group > .btn-group {
float: left;
}
.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.btn-group > .btn-group:first-child > .btn:last-child,
.btn-group > .btn-group:first-child > .dropdown-toggle {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.btn-group > .btn-group:last-child > .btn:first-child {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.btn-group .dropdown-toggle:active,
.btn-group.open .dropdown-toggle {
outline: 0;
}
.btn-group-xs > .btn {
padding: 1px 5px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.btn-group-sm > .btn {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.btn-group-lg > .btn {
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
.btn-group > .btn + .dropdown-toggle {
padding-right: 8px;
padding-left: 8px;
}
.btn-group > .btn-lg + .dropdown-toggle {
padding-right: 12px;
padding-left: 12px;
}
.btn-group.open .dropdown-toggle {
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
}
.btn-group.open .dropdown-toggle.btn-link {
-webkit-box-shadow: none;
box-shadow: none;
}
.btn .caret {
margin-left: 0;
}
.btn-lg .caret {
border-width: 5px 5px 0;
border-bottom-width: 0;
}
.dropup .btn-lg .caret {
border-width: 0 5px 5px;
}
.btn-group-vertical > .btn,
.btn-group-vertical > .btn-group,
.btn-group-vertical > .btn-group > .btn {
display: block;
float: none;
width: 100%;
max-width: 100%;
}
.btn-group-vertical > .btn-group > .btn {
float: none;
}
.btn-group-vertical > .btn + .btn,
.btn-group-vertical > .btn + .btn-group,
.btn-group-vertical > .btn-group + .btn,
.btn-group-vertical > .btn-group + .btn-group {
margin-top: -1px;
margin-left: 0;
}
.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
border-radius: 0;
}
.btn-group-vertical > .btn:first-child:not(:last-child) {
border-top-right-radius: 4px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.btn-group-vertical > .btn:last-child:not(:first-child) {
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-left-radius: 4px;
}
.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,
.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.btn-group-justified {
display: table;
width: 100%;
table-layout: fixed;
border-collapse: separate;
}
.btn-group-justified > .btn,
.btn-group-justified > .btn-group {
display: table-cell;
float: none;
width: 1%;
}
.btn-group-justified > .btn-group .btn {
width: 100%;
}
[data-toggle="buttons"] > .btn > input[type="radio"],
[data-toggle="buttons"] > .btn > input[type="checkbox"] {
display: none;
}
.input-group {
position: relative;
display: table;
border-collapse: separate;
}
.input-group[class*="col-"] {
float: none;
padding-right: 0;
padding-left: 0;
}
.input-group .form-control {
float: left;
width: 100%;
margin-bottom: 0;
}
.input-group-lg > .form-control,
.input-group-lg > .input-group-addon,
.input-group-lg > .input-group-btn > .btn {
height: 46px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
select.input-group-lg > .form-control,
select.input-group-lg > .input-group-addon,
select.input-group-lg > .input-group-btn > .btn {
height: 46px;
line-height: 46px;
}
textarea.input-group-lg > .form-control,
textarea.input-group-lg > .input-group-addon,
textarea.input-group-lg > .input-group-btn > .btn,
select[multiple].input-group-lg > .form-control,
select[multiple].input-group-lg > .input-group-addon,
select[multiple].input-group-lg > .input-group-btn > .btn {
height: auto;
}
.input-group-sm > .form-control,
.input-group-sm > .input-group-addon,
.input-group-sm > .input-group-btn > .btn {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
select.input-group-sm > .form-control,
select.input-group-sm > .input-group-addon,
select.input-group-sm > .input-group-btn > .btn {
height: 30px;
line-height: 30px;
}
textarea.input-group-sm > .form-control,
textarea.input-group-sm > .input-group-addon,
textarea.input-group-sm > .input-group-btn > .btn,
select[multiple].input-group-sm > .form-control,
select[multiple].input-group-sm > .input-group-addon,
select[multiple].input-group-sm > .input-group-btn > .btn {
height: auto;
}
.input-group-addon,
.input-group-btn,
.input-group .form-control {
display: table-cell;
}
.input-group-addon:not(:first-child):not(:last-child),
.input-group-btn:not(:first-child):not(:last-child),
.input-group .form-control:not(:first-child):not(:last-child) {
border-radius: 0;
}
.input-group-addon,
.input-group-btn {
width: 1%;
white-space: nowrap;
vertical-align: middle;
}
.input-group-addon {
padding: 6px 12px;
font-size: 14px;
font-weight: normal;
line-height: 1;
color: #555;
text-align: center;
background-color: #eee;
border: 1px solid #ccc;
border-radius: 4px;
}
.input-group-addon.input-sm {
padding: 5px 10px;
font-size: 12px;
border-radius: 3px;
}
.input-group-addon.input-lg {
padding: 10px 16px;
font-size: 18px;
border-radius: 6px;
}
.input-group-addon input[type="radio"],
.input-group-addon input[type="checkbox"] {
margin-top: 0;
}
.input-group .form-control:first-child,
.input-group-addon:first-child,
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .btn-group > .btn,
.input-group-btn:first-child > .dropdown-toggle,
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.input-group-addon:first-child {
border-right: 0;
}
.input-group .form-control:last-child,
.input-group-addon:last-child,
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .btn-group > .btn,
.input-group-btn:last-child > .dropdown-toggle,
.input-group-btn:first-child > .btn:not(:first-child),
.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.input-group-addon:last-child {
border-left: 0;
}
.input-group-btn {
position: relative;
font-size: 0;
white-space: nowrap;
}
.input-group-btn > .btn {
position: relative;
}
.input-group-btn > .btn + .btn {
margin-left: -1px;
}
.input-group-btn > .btn:hover,
.input-group-btn > .btn:focus,
.input-group-btn > .btn:active {
z-index: 2;
}
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .btn-group {
margin-right: -1px;
}
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .btn-group {
margin-left: -1px;
}
.nav {
padding-left: 0;
margin-bottom: 0;
list-style: none;
}
.nav > li {
position: relative;
display: block;
}
.nav > li > a {
position: relative;
display: block;
padding: 10px 15px;
}
.nav > li > a:hover,
.nav > li > a:focus {
text-decoration: none;
background-color: #eee;
}
.nav > li.disabled > a {
color: #999;
}
.nav > li.disabled > a:hover,
.nav > li.disabled > a:focus {
color: #999;
text-decoration: none;
cursor: not-allowed;
background-color: transparent;
}
.nav .open > a,
.nav .open > a:hover,
.nav .open > a:focus {
background-color: #eee;
border-color: #428bca;
}
.nav .nav-divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.nav > li > a > img {
max-width: none;
}
.nav-tabs {
border-bottom: 1px solid #ddd;
}
.nav-tabs > li {
float: left;
margin-bottom: -1px;
}
.nav-tabs > li > a {
margin-right: 2px;
line-height: 1.428571429;
border: 1px solid transparent;
border-radius: 4px 4px 0 0;
}
.nav-tabs > li > a:hover {
border-color: #eee #eee #ddd;
}
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
color: #555;
cursor: default;
background-color: #fff;
border: 1px solid #ddd;
border-bottom-color: transparent;
}
.nav-tabs.nav-justified {
width: 100%;
border-bottom: 0;
}
.nav-tabs.nav-justified > li {
float: none;
}
.nav-tabs.nav-justified > li > a {
margin-bottom: 5px;
text-align: center;
}
.nav-tabs.nav-justified > .dropdown .dropdown-menu {
top: auto;
left: auto;
}
@media (min-width: 768px) {
.nav-tabs.nav-justified > li {
display: table-cell;
width: 1%;
}
.nav-tabs.nav-justified > li > a {
margin-bottom: 0;
}
}
.nav-tabs.nav-justified > li > a {
margin-right: 0;
border-radius: 4px;
}
.nav-tabs.nav-justified > .active > a,
.nav-tabs.nav-justified > .active > a:hover,
.nav-tabs.nav-justified > .active > a:focus {
border: 1px solid #ddd;
}
@media (min-width: 768px) {
.nav-tabs.nav-justified > li > a {
border-bottom: 1px solid #ddd;
border-radius: 4px 4px 0 0;
}
.nav-tabs.nav-justified > .active > a,
.nav-tabs.nav-justified > .active > a:hover,
.nav-tabs.nav-justified > .active > a:focus {
border-bottom-color: #fff;
}
}
.nav-pills > li {
float: left;
}
.nav-pills > li > a {
border-radius: 4px;
}
.nav-pills > li + li {
margin-left: 2px;
}
.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
color: #fff;
background-color: #428bca;
}
.nav-stacked > li {
float: none;
}
.nav-stacked > li + li {
margin-top: 2px;
margin-left: 0;
}
.nav-justified {
width: 100%;
}
.nav-justified > li {
float: none;
}
.nav-justified > li > a {
margin-bottom: 5px;
text-align: center;
}
.nav-justified > .dropdown .dropdown-menu {
top: auto;
left: auto;
}
@media (min-width: 768px) {
.nav-justified > li {
display: table-cell;
width: 1%;
}
.nav-justified > li > a {
margin-bottom: 0;
}
}
.nav-tabs-justified {
border-bottom: 0;
}
.nav-tabs-justified > li > a {
margin-right: 0;
border-radius: 4px;
}
.nav-tabs-justified > .active > a,
.nav-tabs-justified > .active > a:hover,
.nav-tabs-justified > .active > a:focus {
border: 1px solid #ddd;
}
@media (min-width: 768px) {
.nav-tabs-justified > li > a {
border-bottom: 1px solid #ddd;
border-radius: 4px 4px 0 0;
}
.nav-tabs-justified > .active > a,
.nav-tabs-justified > .active > a:hover,
.nav-tabs-justified > .active > a:focus {
border-bottom-color: #fff;
}
}
.tab-content > .tab-pane {
display: none;
}
.tab-content > .active {
display: block;
}
.nav-tabs .dropdown-menu {
margin-top: -1px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.navbar {
position: relative;
min-height: 50px;
margin-bottom: 20px;
border: 1px solid transparent;
}
@media (min-width: 768px) {
.navbar {
border-radius: 4px;
}
}
@media (min-width: 768px) {
.navbar-header {
float: left;
}
}
.navbar-collapse {
max-height: 340px;
padding-right: 15px;
padding-left: 15px;
overflow-x: visible;
-webkit-overflow-scrolling: touch;
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}
.navbar-collapse.in {
overflow-y: auto;
}
@media (min-width: 768px) {
.navbar-collapse {
width: auto;
border-top: 0;
box-shadow: none;
}
.navbar-collapse.collapse {
display: block !important;
height: auto !important;
padding-bottom: 0;
overflow: visible !important;
}
.navbar-collapse.in {
overflow-y: visible;
}
.navbar-fixed-top .navbar-collapse,
.navbar-static-top .navbar-collapse,
.navbar-fixed-bottom .navbar-collapse {
padding-right: 0;
padding-left: 0;
}
}
.container > .navbar-header,
.container-fluid > .navbar-header,
.container > .navbar-collapse,
.container-fluid > .navbar-collapse {
margin-right: -15px;
margin-left: -15px;
}
@media (min-width: 768px) {
.container > .navbar-header,
.container-fluid > .navbar-header,
.container > .navbar-collapse,
.container-fluid > .navbar-collapse {
margin-right: 0;
margin-left: 0;
}
}
.navbar-static-top {
z-index: 1000;
border-width: 0 0 1px;
}
@media (min-width: 768px) {
.navbar-static-top {
border-radius: 0;
}
}
.navbar-fixed-top,
.navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
z-index: 1030;
}
@media (min-width: 768px) {
.navbar-fixed-top,
.navbar-fixed-bottom {
border-radius: 0;
}
}
.navbar-fixed-top {
top: 0;
border-width: 0 0 1px;
}
.navbar-fixed-bottom {
bottom: 0;
margin-bottom: 0;
border-width: 1px 0 0;
}
.navbar-brand {
float: left;
height: 20px;
padding: 15px 15px;
font-size: 18px;
line-height: 20px;
}
.navbar-brand:hover,
.navbar-brand:focus {
text-decoration: none;
}
@media (min-width: 768px) {
.navbar > .container .navbar-brand,
.navbar > .container-fluid .navbar-brand {
margin-left: -15px;
}
}
.navbar-toggle {
position: relative;
float: right;
padding: 9px 10px;
margin-top: 8px;
margin-right: 15px;
margin-bottom: 8px;
background-color: transparent;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
}
.navbar-toggle:focus {
outline: none;
}
.navbar-toggle .icon-bar {
display: block;
width: 22px;
height: 2px;
border-radius: 1px;
}
.navbar-toggle .icon-bar + .icon-bar {
margin-top: 4px;
}
@media (min-width: 768px) {
.navbar-toggle {
display: none;
}
}
.navbar-nav {
margin: 7.5px -15px;
}
.navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
line-height: 20px;
}
@media (max-width: 767px) {
.navbar-nav .open .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
background-color: transparent;
border: 0;
box-shadow: none;
}
.navbar-nav .open .dropdown-menu > li > a,
.navbar-nav .open .dropdown-menu .dropdown-header {
padding: 5px 15px 5px 25px;
}
.navbar-nav .open .dropdown-menu > li > a {
line-height: 20px;
}
.navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-nav .open .dropdown-menu > li > a:focus {
background-image: none;
}
}
@media (min-width: 768px) {
.navbar-nav {
float: left;
margin: 0;
}
.navbar-nav > li {
float: left;
}
.navbar-nav > li > a {
padding-top: 15px;
padding-bottom: 15px;
}
.navbar-nav.navbar-right:last-child {
margin-right: -15px;
}
}
@media (min-width: 768px) {
.navbar-left {
float: left !important;
}
.navbar-right {
float: right !important;
}
}
.navbar-form {
padding: 10px 15px;
margin-top: 8px;
margin-right: -15px;
margin-bottom: 8px;
margin-left: -15px;
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
}
@media (min-width: 768px) {
.navbar-form .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.navbar-form .form-control {
display: inline-block;
width: auto;
vertical-align: middle;
}
.navbar-form .control-label {
margin-bottom: 0;
vertical-align: middle;
}
.navbar-form .radio,
.navbar-form .checkbox {
display: inline-block;
padding-left: 0;
margin-top: 0;
margin-bottom: 0;
vertical-align: middle;
}
.navbar-form .radio input[type="radio"],
.navbar-form .checkbox input[type="checkbox"] {
float: none;
margin-left: 0;
}
.navbar-form .has-feedback .form-control-feedback {
top: 0;
}
}
@media (max-width: 767px) {
.navbar-form .form-group {
margin-bottom: 5px;
}
}
@media (min-width: 768px) {
.navbar-form {
width: auto;
padding-top: 0;
padding-bottom: 0;
margin-right: 0;
margin-left: 0;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
.navbar-form.navbar-right:last-child {
margin-right: -15px;
}
}
.navbar-nav > li > .dropdown-menu {
margin-top: 0;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.navbar-btn {
margin-top: 8px;
margin-bottom: 8px;
}
.navbar-btn.btn-sm {
margin-top: 10px;
margin-bottom: 10px;
}
.navbar-btn.btn-xs {
margin-top: 14px;
margin-bottom: 14px;
}
.navbar-text {
margin-top: 15px;
margin-bottom: 15px;
}
@media (min-width: 768px) {
.navbar-text {
float: left;
margin-right: 15px;
margin-left: 15px;
}
.navbar-text.navbar-right:last-child {
margin-right: 0;
}
}
.navbar-default {
background-color: #f8f8f8;
border-color: #e7e7e7;
}
.navbar-default .navbar-brand {
color: #777;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
color: #5e5e5e;
background-color: transparent;
}
.navbar-default .navbar-text {
color: #777;
}
.navbar-default .navbar-nav > li > a {
color: #777;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
color: #333;
background-color: transparent;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #555;
background-color: #e7e7e7;
}
.navbar-default .navbar-nav > .disabled > a,
.navbar-default .navbar-nav > .disabled > a:hover,
.navbar-default .navbar-nav > .disabled > a:focus {
color: #ccc;
background-color: transparent;
}
.navbar-default .navbar-toggle {
border-color: #ddd;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
background-color: #ddd;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #888;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
border-color: #e7e7e7;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
color: #555;
background-color: #e7e7e7;
}
@media (max-width: 767px) {
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #777;
}
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #333;
background-color: transparent;
}
.navbar-default .navbar-nav .open .dropdown-menu > .active > a,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #555;
background-color: #e7e7e7;
}
.navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
.navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #ccc;
background-color: transparent;
}
}
.navbar-default .navbar-link {
color: #777;
}
.navbar-default .navbar-link:hover {
color: #333;
}
.navbar-inverse {
background-color: #222;
border-color: #080808;
}
.navbar-inverse .navbar-brand {
color: #999;
}
.navbar-inverse .navbar-brand:hover,
.navbar-inverse .navbar-brand:focus {
color: #fff;
background-color: transparent;
}
.navbar-inverse .navbar-text {
color: #999;
}
.navbar-inverse .navbar-nav > li > a {
color: #999;
}
.navbar-inverse .navbar-nav > li > a:hover,
.navbar-inverse .navbar-nav > li > a:focus {
color: #fff;
background-color: transparent;
}
.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover,
.navbar-inverse .navbar-nav > .active > a:focus {
color: #fff;
background-color: #080808;
}
.navbar-inverse .navbar-nav > .disabled > a,
.navbar-inverse .navbar-nav > .disabled > a:hover,
.navbar-inverse .navbar-nav > .disabled > a:focus {
color: #444;
background-color: transparent;
}
.navbar-inverse .navbar-toggle {
border-color: #333;
}
.navbar-inverse .navbar-toggle:hover,
.navbar-inverse .navbar-toggle:focus {
background-color: #333;
}
.navbar-inverse .navbar-toggle .icon-bar {
background-color: #fff;
}
.navbar-inverse .navbar-collapse,
.navbar-inverse .navbar-form {
border-color: #101010;
}
.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .open > a:hover,
.navbar-inverse .navbar-nav > .open > a:focus {
color: #fff;
background-color: #080808;
}
@media (max-width: 767px) {
.navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
border-color: #080808;
}
.navbar-inverse .navbar-nav .open .dropdown-menu .divider {
background-color: #080808;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
color: #999;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
color: #fff;
background-color: transparent;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #fff;
background-color: #080808;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #444;
background-color: transparent;
}
}
.navbar-inverse .navbar-link {
color: #999;
}
.navbar-inverse .navbar-link:hover {
color: #fff;
}
.breadcrumb {
padding: 8px 15px;
margin-bottom: 20px;
list-style: none;
background-color: #f5f5f5;
border-radius: 4px;
}
.breadcrumb > li {
display: inline-block;
}
.breadcrumb > li + li:before {
padding: 0 5px;
color: #ccc;
content: "/\00a0";
}
.breadcrumb > .active {
color: #999;
}
.pagination {
display: inline-block;
padding-left: 0;
margin: 20px 0;
border-radius: 4px;
}
.pagination > li {
display: inline;
}
.pagination > li > a,
.pagination > li > span {
position: relative;
float: left;
padding: 6px 12px;
margin-left: -1px;
line-height: 1.428571429;
color: #428bca;
text-decoration: none;
background-color: #fff;
border: 1px solid #ddd;
}
.pagination > li:first-child > a,
.pagination > li:first-child > span {
margin-left: 0;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
.pagination > li:last-child > a,
.pagination > li:last-child > span {
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
.pagination > li > a:hover,
.pagination > li > span:hover,
.pagination > li > a:focus,
.pagination > li > span:focus {
color: #2a6496;
background-color: #eee;
border-color: #ddd;
}
.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover,
.pagination > .active > a:focus,
.pagination > .active > span:focus {
z-index: 2;
color: #fff;
cursor: default;
background-color: #428bca;
border-color: #428bca;
}
.pagination > .disabled > span,
.pagination > .disabled > span:hover,
.pagination > .disabled > span:focus,
.pagination > .disabled > a,
.pagination > .disabled > a:hover,
.pagination > .disabled > a:focus {
color: #999;
cursor: not-allowed;
background-color: #fff;
border-color: #ddd;
}
.pagination-lg > li > a,
.pagination-lg > li > span {
padding: 10px 16px;
font-size: 18px;
}
.pagination-lg > li:first-child > a,
.pagination-lg > li:first-child > span {
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
}
.pagination-lg > li:last-child > a,
.pagination-lg > li:last-child > span {
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
}
.pagination-sm > li > a,
.pagination-sm > li > span {
padding: 5px 10px;
font-size: 12px;
}
.pagination-sm > li:first-child > a,
.pagination-sm > li:first-child > span {
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
.pagination-sm > li:last-child > a,
.pagination-sm > li:last-child > span {
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
.pager {
padding-left: 0;
margin: 20px 0;
text-align: center;
list-style: none;
}
.pager li {
display: inline;
}
.pager li > a,
.pager li > span {
display: inline-block;
padding: 5px 14px;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 15px;
}
.pager li > a:hover,
.pager li > a:focus {
text-decoration: none;
background-color: #eee;
}
.pager .next > a,
.pager .next > span {
float: right;
}
.pager .previous > a,
.pager .previous > span {
float: left;
}
.pager .disabled > a,
.pager .disabled > a:hover,
.pager .disabled > a:focus,
.pager .disabled > span {
color: #999;
cursor: not-allowed;
background-color: #fff;
}
.label {
display: inline;
padding: .2em .6em .3em;
font-size: 75%;
font-weight: bold;
line-height: 1;
color: #fff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25em;
}
.label[href]:hover,
.label[href]:focus {
color: #fff;
text-decoration: none;
cursor: pointer;
}
.label:empty {
display: none;
}
.btn .label {
position: relative;
top: -1px;
}
.label-default {
background-color: #999;
}
.label-default[href]:hover,
.label-default[href]:focus {
background-color: #808080;
}
.label-primary {
background-color: #428bca;
}
.label-primary[href]:hover,
.label-primary[href]:focus {
background-color: #3071a9;
}
.label-success {
background-color: #5cb85c;
}
.label-success[href]:hover,
.label-success[href]:focus {
background-color: #449d44;
}
.label-info {
background-color: #5bc0de;
}
.label-info[href]:hover,
.label-info[href]:focus {
background-color: #31b0d5;
}
.label-warning {
background-color: #f0ad4e;
}
.label-warning[href]:hover,
.label-warning[href]:focus {
background-color: #ec971f;
}
.label-danger {
background-color: #d9534f;
}
.label-danger[href]:hover,
.label-danger[href]:focus {
background-color: #c9302c;
}
.badge {
display: inline-block;
min-width: 10px;
padding: 3px 7px;
font-size: 12px;
font-weight: bold;
line-height: 1;
color: #fff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
background-color: #999;
border-radius: 10px;
}
.badge:empty {
display: none;
}
.btn .badge {
position: relative;
top: -1px;
}
.btn-xs .badge {
top: 0;
padding: 1px 5px;
}
a.badge:hover,
a.badge:focus {
color: #fff;
text-decoration: none;
cursor: pointer;
}
a.list-group-item.active > .badge,
.nav-pills > .active > a > .badge {
color: #428bca;
background-color: #fff;
}
.nav-pills > li > a > .badge {
margin-left: 3px;
}
.jumbotron {
padding: 30px;
margin-bottom: 30px;
color: inherit;
background-color: #eee;
}
.jumbotron h1,
.jumbotron .h1 {
color: inherit;
}
.jumbotron p {
margin-bottom: 15px;
font-size: 21px;
font-weight: 200;
}
.container .jumbotron {
border-radius: 6px;
}
.jumbotron .container {
max-width: 100%;
}
@media screen and (min-width: 768px) {
.jumbotron {
padding-top: 48px;
padding-bottom: 48px;
}
.container .jumbotron {
padding-right: 60px;
padding-left: 60px;
}
.jumbotron h1,
.jumbotron .h1 {
font-size: 63px;
}
}
.thumbnail {
display: block;
padding: 4px;
margin-bottom: 20px;
line-height: 1.428571429;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 4px;
-webkit-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
.thumbnail > img,
.thumbnail a > img {
display: block;
max-width: 100%;
height: auto;
margin-right: auto;
margin-left: auto;
}
a.thumbnail:hover,
a.thumbnail:focus,
a.thumbnail.active {
border-color: #428bca;
}
.thumbnail .caption {
padding: 9px;
color: #333;
}
.alert {
padding: 15px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px;
}
.alert h4 {
margin-top: 0;
color: inherit;
}
.alert .alert-link {
font-weight: bold;
}
.alert > p,
.alert > ul {
margin-bottom: 0;
}
.alert > p + p {
margin-top: 5px;
}
.alert-dismissable {
padding-right: 35px;
}
.alert-dismissable .close {
position: relative;
top: -2px;
right: -21px;
color: inherit;
}
.alert-success {
color: #3c763d;
background-color: #dff0d8;
border-color: #d6e9c6;
}
.alert-success hr {
border-top-color: #c9e2b3;
}
.alert-success .alert-link {
color: #2b542c;
}
.alert-info {
color: #31708f;
background-color: #d9edf7;
border-color: #bce8f1;
}
.alert-info hr {
border-top-color: #a6e1ec;
}
.alert-info .alert-link {
color: #245269;
}
.alert-warning {
color: #8a6d3b;
background-color: #fcf8e3;
border-color: #faebcc;
}
.alert-warning hr {
border-top-color: #f7e1b5;
}
.alert-warning .alert-link {
color: #66512c;
}
.alert-danger {
color: #a94442;
background-color: #f2dede;
border-color: #ebccd1;
}
.alert-danger hr {
border-top-color: #e4b9c0;
}
.alert-danger .alert-link {
color: #843534;
}
@-webkit-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
.progress {
height: 20px;
margin-bottom: 20px;
overflow: hidden;
background-color: #f5f5f5;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
}
.progress-bar {
float: left;
width: 0;
height: 100%;
font-size: 12px;
line-height: 20px;
color: #fff;
text-align: center;
background-color: #428bca;
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
-webkit-transition: width .6s ease;
transition: width .6s ease;
}
.progress-striped .progress-bar {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
background-size: 40px 40px;
}
.progress.active .progress-bar {
-webkit-animation: progress-bar-stripes 2s linear infinite;
animation: progress-bar-stripes 2s linear infinite;
}
.progress-bar-success {
background-color: #5cb85c;
}
.progress-striped .progress-bar-success {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
}
.progress-bar-info {
background-color: #5bc0de;
}
.progress-striped .progress-bar-info {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
}
.progress-bar-warning {
background-color: #f0ad4e;
}
.progress-striped .progress-bar-warning {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
}
.progress-bar-danger {
background-color: #d9534f;
}
.progress-striped .progress-bar-danger {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
}
.media,
.media-body {
overflow: hidden;
zoom: 1;
}
.media,
.media .media {
margin-top: 15px;
}
.media:first-child {
margin-top: 0;
}
.media-object {
display: block;
}
.media-heading {
margin: 0 0 5px;
}
.media > .pull-left {
margin-right: 10px;
}
.media > .pull-right {
margin-left: 10px;
}
.media-list {
padding-left: 0;
list-style: none;
}
.list-group {
padding-left: 0;
margin-bottom: 20px;
}
.list-group-item {
position: relative;
display: block;
padding: 10px 15px;
margin-bottom: -1px;
background-color: #fff;
border: 1px solid #ddd;
}
.list-group-item:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.list-group-item:last-child {
margin-bottom: 0;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.list-group-item > .badge {
float: right;
}
.list-group-item > .badge + .badge {
margin-right: 5px;
}
a.list-group-item {
color: #555;
}
a.list-group-item .list-group-item-heading {
color: #333;
}
a.list-group-item:hover,
a.list-group-item:focus {
text-decoration: none;
background-color: #f5f5f5;
}
a.list-group-item.active,
a.list-group-item.active:hover,
a.list-group-item.active:focus {
z-index: 2;
color: #fff;
background-color: #428bca;
border-color: #428bca;
}
a.list-group-item.active .list-group-item-heading,
a.list-group-item.active:hover .list-group-item-heading,
a.list-group-item.active:focus .list-group-item-heading {
color: inherit;
}
a.list-group-item.active .list-group-item-text,
a.list-group-item.active:hover .list-group-item-text,
a.list-group-item.active:focus .list-group-item-text {
color: #e1edf7;
}
.list-group-item-success {
color: #3c763d;
background-color: #dff0d8;
}
a.list-group-item-success {
color: #3c763d;
}
a.list-group-item-success .list-group-item-heading {
color: inherit;
}
a.list-group-item-success:hover,
a.list-group-item-success:focus {
color: #3c763d;
background-color: #d0e9c6;
}
a.list-group-item-success.active,
a.list-group-item-success.active:hover,
a.list-group-item-success.active:focus {
color: #fff;
background-color: #3c763d;
border-color: #3c763d;
}
.list-group-item-info {
color: #31708f;
background-color: #d9edf7;
}
a.list-group-item-info {
color: #31708f;
}
a.list-group-item-info .list-group-item-heading {
color: inherit;
}
a.list-group-item-info:hover,
a.list-group-item-info:focus {
color: #31708f;
background-color: #c4e3f3;
}
a.list-group-item-info.active,
a.list-group-item-info.active:hover,
a.list-group-item-info.active:focus {
color: #fff;
background-color: #31708f;
border-color: #31708f;
}
.list-group-item-warning {
color: #8a6d3b;
background-color: #fcf8e3;
}
a.list-group-item-warning {
color: #8a6d3b;
}
a.list-group-item-warning .list-group-item-heading {
color: inherit;
}
a.list-group-item-warning:hover,
a.list-group-item-warning:focus {
color: #8a6d3b;
background-color: #faf2cc;
}
a.list-group-item-warning.active,
a.list-group-item-warning.active:hover,
a.list-group-item-warning.active:focus {
color: #fff;
background-color: #8a6d3b;
border-color: #8a6d3b;
}
.list-group-item-danger {
color: #a94442;
background-color: #f2dede;
}
a.list-group-item-danger {
color: #a94442;
}
a.list-group-item-danger .list-group-item-heading {
color: inherit;
}
a.list-group-item-danger:hover,
a.list-group-item-danger:focus {
color: #a94442;
background-color: #ebcccc;
}
a.list-group-item-danger.active,
a.list-group-item-danger.active:hover,
a.list-group-item-danger.active:focus {
color: #fff;
background-color: #a94442;
border-color: #a94442;
}
.list-group-item-heading {
margin-top: 0;
margin-bottom: 5px;
}
.list-group-item-text {
margin-bottom: 0;
line-height: 1.3;
}
.panel {
margin-bottom: 20px;
background-color: #fff;
border: 1px solid transparent;
border-radius: 4px;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
}
.panel-body {
padding: 15px;
}
.panel > .list-group {
margin-bottom: 0;
}
.panel > .list-group .list-group-item {
border-width: 1px 0;
border-radius: 0;
}
.panel > .list-group .list-group-item:first-child {
border-top: 0;
}
.panel > .list-group .list-group-item:last-child {
border-bottom: 0;
}
.panel > .list-group:first-child .list-group-item:first-child {
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
.panel > .list-group:last-child .list-group-item:last-child {
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.panel-heading + .list-group .list-group-item:first-child {
border-top-width: 0;
}
.panel > .table,
.panel > .table-responsive > .table {
margin-bottom: 0;
}
.panel > .table:first-child > thead:first-child > tr:first-child td:first-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child,
.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child,
.panel > .table:first-child > thead:first-child > tr:first-child th:first-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child,
.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child {
border-top-left-radius: 3px;
}
.panel > .table:first-child > thead:first-child > tr:first-child td:last-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child,
.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child,
.panel > .table:first-child > thead:first-child > tr:first-child th:last-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child,
.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child {
border-top-right-radius: 3px;
}
.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child {
border-bottom-left-radius: 3px;
}
.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child {
border-bottom-right-radius: 3px;
}
.panel > .panel-body + .table,
.panel > .panel-body + .table-responsive {
border-top: 1px solid #ddd;
}
.panel > .table > tbody:first-child > tr:first-child th,
.panel > .table > tbody:first-child > tr:first-child td {
border-top: 0;
}
.panel > .table-bordered,
.panel > .table-responsive > .table-bordered {
border: 0;
}
.panel > .table-bordered > thead > tr > th:first-child,
.panel > .table-responsive > .table-bordered > thead > tr > th:first-child,
.panel > .table-bordered > tbody > tr > th:first-child,
.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,
.panel > .table-bordered > tfoot > tr > th:first-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,
.panel > .table-bordered > thead > tr > td:first-child,
.panel > .table-responsive > .table-bordered > thead > tr > td:first-child,
.panel > .table-bordered > tbody > tr > td:first-child,
.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,
.panel > .table-bordered > tfoot > tr > td:first-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0;
}
.panel > .table-bordered > thead > tr > th:last-child,
.panel > .table-responsive > .table-bordered > thead > tr > th:last-child,
.panel > .table-bordered > tbody > tr > th:last-child,
.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,
.panel > .table-bordered > tfoot > tr > th:last-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,
.panel > .table-bordered > thead > tr > td:last-child,
.panel > .table-responsive > .table-bordered > thead > tr > td:last-child,
.panel > .table-bordered > tbody > tr > td:last-child,
.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,
.panel > .table-bordered > tfoot > tr > td:last-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0;
}
.panel > .table-bordered > thead > tr:first-child > th,
.panel > .table-responsive > .table-bordered > thead > tr:first-child > th,
.panel > .table-bordered > tbody > tr:first-child > th,
.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th,
.panel > .table-bordered > tfoot > tr:first-child > th,
.panel > .table-responsive > .table-bordered > tfoot > tr:first-child > th,
.panel > .table-bordered > thead > tr:first-child > td,
.panel > .table-responsive > .table-bordered > thead > tr:first-child > td,
.panel > .table-bordered > tbody > tr:first-child > td,
.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td,
.panel > .table-bordered > tfoot > tr:first-child > td,
.panel > .table-responsive > .table-bordered > tfoot > tr:first-child > td {
border-top: 0;
}
.panel > .table-bordered > thead > tr:last-child > th,
.panel > .table-responsive > .table-bordered > thead > tr:last-child > th,
.panel > .table-bordered > tbody > tr:last-child > th,
.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,
.panel > .table-bordered > tfoot > tr:last-child > th,
.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th,
.panel > .table-bordered > thead > tr:last-child > td,
.panel > .table-responsive > .table-bordered > thead > tr:last-child > td,
.panel > .table-bordered > tbody > tr:last-child > td,
.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,
.panel > .table-bordered > tfoot > tr:last-child > td,
.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td {
border-bottom: 0;
}
.panel > .table-responsive {
margin-bottom: 0;
border: 0;
}
.panel-heading {
padding: 10px 15px;
border-bottom: 1px solid transparent;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
.panel-heading > .dropdown .dropdown-toggle {
color: inherit;
}
.panel-title {
margin-top: 0;
margin-bottom: 0;
font-size: 16px;
color: inherit;
}
.panel-title > a {
color: inherit;
}
.panel-footer {
padding: 10px 15px;
background-color: #f5f5f5;
border-top: 1px solid #ddd;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.panel-group {
margin-bottom: 20px;
}
.panel-group .panel {
margin-bottom: 0;
overflow: hidden;
border-radius: 4px;
}
.panel-group .panel + .panel {
margin-top: 5px;
}
.panel-group .panel-heading {
border-bottom: 0;
}
.panel-group .panel-heading + .panel-collapse .panel-body {
border-top: 1px solid #ddd;
}
.panel-group .panel-footer {
border-top: 0;
}
.panel-group .panel-footer + .panel-collapse .panel-body {
border-bottom: 1px solid #ddd;
}
.panel-default {
border-color: #ddd;
}
.panel-default > .panel-heading {
color: #333;
background-color: #f5f5f5;
border-color: #ddd;
}
.panel-default > .panel-heading + .panel-collapse .panel-body {
border-top-color: #ddd;
}
.panel-default > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #ddd;
}
.panel-primary {
border-color: #428bca;
}
.panel-primary > .panel-heading {
color: #fff;
background-color: #428bca;
border-color: #428bca;
}
.panel-primary > .panel-heading + .panel-collapse .panel-body {
border-top-color: #428bca;
}
.panel-primary > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #428bca;
}
.panel-success {
border-color: #d6e9c6;
}
.panel-success > .panel-heading {
color: #3c763d;
background-color: #dff0d8;
border-color: #d6e9c6;
}
.panel-success > .panel-heading + .panel-collapse .panel-body {
border-top-color: #d6e9c6;
}
.panel-success > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #d6e9c6;
}
.panel-info {
border-color: #bce8f1;
}
.panel-info > .panel-heading {
color: #31708f;
background-color: #d9edf7;
border-color: #bce8f1;
}
.panel-info > .panel-heading + .panel-collapse .panel-body {
border-top-color: #bce8f1;
}
.panel-info > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #bce8f1;
}
.panel-warning {
border-color: #faebcc;
}
.panel-warning > .panel-heading {
color: #8a6d3b;
background-color: #fcf8e3;
border-color: #faebcc;
}
.panel-warning > .panel-heading + .panel-collapse .panel-body {
border-top-color: #faebcc;
}
.panel-warning > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #faebcc;
}
.panel-danger {
border-color: #ebccd1;
}
.panel-danger > .panel-heading {
color: #a94442;
background-color: #f2dede;
border-color: #ebccd1;
}
.panel-danger > .panel-heading + .panel-collapse .panel-body {
border-top-color: #ebccd1;
}
.panel-danger > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #ebccd1;
}
.well {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
}
.well blockquote {
border-color: #ddd;
border-color: rgba(0, 0, 0, .15);
}
.well-lg {
padding: 24px;
border-radius: 6px;
}
.well-sm {
padding: 9px;
border-radius: 3px;
}
.close {
float: right;
font-size: 21px;
font-weight: bold;
line-height: 1;
color: #000;
text-shadow: 0 1px 0 #fff;
filter: alpha(opacity=20);
opacity: .2;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
filter: alpha(opacity=50);
opacity: .5;
}
button.close {
-webkit-appearance: none;
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
}
.modal-open {
overflow: hidden;
}
.modal {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1050;
display: none;
overflow: auto;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
outline: 0;
}
.modal.fade .modal-dialog {
-webkit-transition: -webkit-transform .3s ease-out;
-moz-transition: -moz-transform .3s ease-out;
-o-transition: -o-transform .3s ease-out;
transition: transform .3s ease-out;
-webkit-transform: translate(0, -25%);
-ms-transform: translate(0, -25%);
transform: translate(0, -25%);
}
.modal.in .modal-dialog {
-webkit-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
}
.modal-dialog {
position: relative;
width: auto;
margin: 10px;
}
.modal-content {
position: relative;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #999;
border: 1px solid rgba(0, 0, 0, .2);
border-radius: 6px;
outline: none;
-webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
}
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
background-color: #000;
}
.modal-backdrop.fade {
filter: alpha(opacity=0);
opacity: 0;
}
.modal-backdrop.in {
filter: alpha(opacity=50);
opacity: .5;
}
.modal-header {
min-height: 16.428571429px;
padding: 15px;
border-bottom: 1px solid #e5e5e5;
}
.modal-header .close {
margin-top: -2px;
}
.modal-title {
margin: 0;
line-height: 1.428571429;
}
.modal-body {
position: relative;
padding: 20px;
}
.modal-footer {
padding: 19px 20px 20px;
margin-top: 15px;
text-align: right;
border-top: 1px solid #e5e5e5;
}
.modal-footer .btn + .btn {
margin-bottom: 0;
margin-left: 5px;
}
.modal-footer .btn-group .btn + .btn {
margin-left: -1px;
}
.modal-footer .btn-block + .btn-block {
margin-left: 0;
}
@media (min-width: 768px) {
.modal-dialog {
width: 600px;
margin: 30px auto;
}
.modal-content {
-webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
}
.modal-sm {
width: 300px;
}
.modal-lg {
width: 900px;
}
}
.tooltip {
position: absolute;
z-index: 1030;
display: block;
font-size: 12px;
line-height: 1.4;
visibility: visible;
filter: alpha(opacity=0);
opacity: 0;
}
.tooltip.in {
filter: alpha(opacity=90);
opacity: .9;
}
.tooltip.top {
padding: 5px 0;
margin-top: -3px;
}
.tooltip.right {
padding: 0 5px;
margin-left: 3px;
}
.tooltip.bottom {
padding: 5px 0;
margin-top: 3px;
}
.tooltip.left {
padding: 0 5px;
margin-left: -3px;
}
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: #fff;
text-align: center;
text-decoration: none;
background-color: #000;
border-radius: 4px;
}
.tooltip-arrow {
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.tooltip.top .tooltip-arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-width: 5px 5px 0;
border-top-color: #000;
}
.tooltip.top-left .tooltip-arrow {
bottom: 0;
left: 5px;
border-width: 5px 5px 0;
border-top-color: #000;
}
.tooltip.top-right .tooltip-arrow {
right: 5px;
bottom: 0;
border-width: 5px 5px 0;
border-top-color: #000;
}
.tooltip.right .tooltip-arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-width: 5px 5px 5px 0;
border-right-color: #000;
}
.tooltip.left .tooltip-arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-width: 5px 0 5px 5px;
border-left-color: #000;
}
.tooltip.bottom .tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000;
}
.tooltip.bottom-left .tooltip-arrow {
top: 0;
left: 5px;
border-width: 0 5px 5px;
border-bottom-color: #000;
}
.tooltip.bottom-right .tooltip-arrow {
top: 0;
right: 5px;
border-width: 0 5px 5px;
border-bottom-color: #000;
}
.popover {
position: absolute;
top: 0;
left: 0;
z-index: 1010;
display: none;
max-width: 276px;
padding: 1px;
text-align: left;
white-space: normal;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, .2);
border-radius: 6px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
}
.popover.top {
margin-top: -10px;
}
.popover.right {
margin-left: 10px;
}
.popover.bottom {
margin-top: 10px;
}
.popover.left {
margin-left: -10px;
}
.popover-title {
padding: 8px 14px;
margin: 0;
font-size: 14px;
font-weight: normal;
line-height: 18px;
background-color: #f7f7f7;
border-bottom: 1px solid #ebebeb;
border-radius: 5px 5px 0 0;
}
.popover-content {
padding: 9px 14px;
}
.popover .arrow,
.popover .arrow:after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.popover .arrow {
border-width: 11px;
}
.popover .arrow:after {
content: "";
border-width: 10px;
}
.popover.top .arrow {
bottom: -11px;
left: 50%;
margin-left: -11px;
border-top-color: #999;
border-top-color: rgba(0, 0, 0, .25);
border-bottom-width: 0;
}
.popover.top .arrow:after {
bottom: 1px;
margin-left: -10px;
content: " ";
border-top-color: #fff;
border-bottom-width: 0;
}
.popover.right .arrow {
top: 50%;
left: -11px;
margin-top: -11px;
border-right-color: #999;
border-right-color: rgba(0, 0, 0, .25);
border-left-width: 0;
}
.popover.right .arrow:after {
bottom: -10px;
left: 1px;
content: " ";
border-right-color: #fff;
border-left-width: 0;
}
.popover.bottom .arrow {
top: -11px;
left: 50%;
margin-left: -11px;
border-top-width: 0;
border-bottom-color: #999;
border-bottom-color: rgba(0, 0, 0, .25);
}
.popover.bottom .arrow:after {
top: 1px;
margin-left: -10px;
content: " ";
border-top-width: 0;
border-bottom-color: #fff;
}
.popover.left .arrow {
top: 50%;
right: -11px;
margin-top: -11px;
border-right-width: 0;
border-left-color: #999;
border-left-color: rgba(0, 0, 0, .25);
}
.popover.left .arrow:after {
right: 1px;
bottom: -10px;
content: " ";
border-right-width: 0;
border-left-color: #fff;
}
.carousel {
position: relative;
}
.carousel-inner {
position: relative;
width: 100%;
overflow: hidden;
}
.carousel-inner > .item {
position: relative;
display: none;
-webkit-transition: .6s ease-in-out left;
transition: .6s ease-in-out left;
}
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
display: block;
max-width: 100%;
height: auto;
line-height: 1;
}
.carousel-inner > .active,
.carousel-inner > .next,
.carousel-inner > .prev {
display: block;
}
.carousel-inner > .active {
left: 0;
}
.carousel-inner > .next,
.carousel-inner > .prev {
position: absolute;
top: 0;
width: 100%;
}
.carousel-inner > .next {
left: 100%;
}
.carousel-inner > .prev {
left: -100%;
}
.carousel-inner > .next.left,
.carousel-inner > .prev.right {
left: 0;
}
.carousel-inner > .active.left {
left: -100%;
}
.carousel-inner > .active.right {
left: 100%;
}
.carousel-control {
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 15%;
font-size: 20px;
color: #fff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
filter: alpha(opacity=50);
opacity: .5;
}
.carousel-control.left {
background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, .5) 0%), color-stop(rgba(0, 0, 0, .0001) 100%));
background-image: linear-gradient(to right, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
background-repeat: repeat-x;
}
.carousel-control.right {
right: 0;
left: auto;
background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, .0001) 0%), color-stop(rgba(0, 0, 0, .5) 100%));
background-image: linear-gradient(to right, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
background-repeat: repeat-x;
}
.carousel-control:hover,
.carousel-control:focus {
color: #fff;
text-decoration: none;
filter: alpha(opacity=90);
outline: none;
opacity: .9;
}
.carousel-control .icon-prev,
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-left,
.carousel-control .glyphicon-chevron-right {
position: absolute;
top: 50%;
z-index: 5;
display: inline-block;
}
.carousel-control .icon-prev,
.carousel-control .glyphicon-chevron-left {
left: 50%;
}
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-right {
right: 50%;
}
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 20px;
height: 20px;
margin-top: -10px;
margin-left: -10px;
font-family: serif;
}
.carousel-control .icon-prev:before {
content: '\2039';
}
.carousel-control .icon-next:before {
content: '\203a';
}
.carousel-indicators {
position: absolute;
bottom: 10px;
left: 50%;
z-index: 15;
width: 60%;
padding-left: 0;
margin-left: -30%;
text-align: center;
list-style: none;
}
.carousel-indicators li {
display: inline-block;
width: 10px;
height: 10px;
margin: 1px;
text-indent: -999px;
cursor: pointer;
background-color: #000 \9;
background-color: rgba(0, 0, 0, 0);
border: 1px solid #fff;
border-radius: 10px;
}
.carousel-indicators .active {
width: 12px;
height: 12px;
margin: 0;
background-color: #fff;
}
.carousel-caption {
position: absolute;
right: 15%;
bottom: 20px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #fff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.carousel-caption .btn {
text-shadow: none;
}
@media screen and (min-width: 768px) {
.carousel-control .glyphicons-chevron-left,
.carousel-control .glyphicons-chevron-right,
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 30px;
height: 30px;
margin-top: -15px;
margin-left: -15px;
font-size: 30px;
}
.carousel-caption {
right: 20%;
left: 20%;
padding-bottom: 30px;
}
.carousel-indicators {
bottom: 20px;
}
}
.clearfix:before,
.clearfix:after,
.container:before,
.container:after,
.container-fluid:before,
.container-fluid:after,
.row:before,
.row:after,
.form-horizontal .form-group:before,
.form-horizontal .form-group:after,
.btn-toolbar:before,
.btn-toolbar:after,
.btn-group-vertical > .btn-group:before,
.btn-group-vertical > .btn-group:after,
.nav:before,
.nav:after,
.navbar:before,
.navbar:after,
.navbar-header:before,
.navbar-header:after,
.navbar-collapse:before,
.navbar-collapse:after,
.pager:before,
.pager:after,
.panel-body:before,
.panel-body:after,
.modal-footer:before,
.modal-footer:after {
display: table;
content: " ";
}
.clearfix:after,
.container:after,
.container-fluid:after,
.row:after,
.form-horizontal .form-group:after,
.btn-toolbar:after,
.btn-group-vertical > .btn-group:after,
.nav:after,
.navbar:after,
.navbar-header:after,
.navbar-collapse:after,
.pager:after,
.panel-body:after,
.modal-footer:after {
clear: both;
}
.center-block {
display: block;
margin-right: auto;
margin-left: auto;
}
.pull-right {
float: right !important;
}
.pull-left {
float: left !important;
}
.hide {
display: none !important;
}
.show {
display: block !important;
}
.invisible {
visibility: hidden;
}
.text-hide {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.hidden {
display: none !important;
visibility: hidden !important;
}
.affix {
position: fixed;
}
@-ms-viewport {
width: device-width;
}
.visible-xs,
tr.visible-xs,
th.visible-xs,
td.visible-xs {
display: none !important;
}
@media (max-width: 767px) {
.visible-xs {
display: block !important;
}
table.visible-xs {
display: table;
}
tr.visible-xs {
display: table-row !important;
}
th.visible-xs,
td.visible-xs {
display: table-cell !important;
}
}
.visible-sm,
tr.visible-sm,
th.visible-sm,
td.visible-sm {
display: none !important;
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm {
display: block !important;
}
table.visible-sm {
display: table;
}
tr.visible-sm {
display: table-row !important;
}
th.visible-sm,
td.visible-sm {
display: table-cell !important;
}
}
.visible-md,
tr.visible-md,
th.visible-md,
td.visible-md {
display: none !important;
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md {
display: block !important;
}
table.visible-md {
display: table;
}
tr.visible-md {
display: table-row !important;
}
th.visible-md,
td.visible-md {
display: table-cell !important;
}
}
.visible-lg,
tr.visible-lg,
th.visible-lg,
td.visible-lg {
display: none !important;
}
@media (min-width: 1200px) {
.visible-lg {
display: block !important;
}
table.visible-lg {
display: table;
}
tr.visible-lg {
display: table-row !important;
}
th.visible-lg,
td.visible-lg {
display: table-cell !important;
}
}
@media (max-width: 767px) {
.hidden-xs,
tr.hidden-xs,
th.hidden-xs,
td.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-sm,
tr.hidden-sm,
th.hidden-sm,
td.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-md,
tr.hidden-md,
th.hidden-md,
td.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-lg,
tr.hidden-lg,
th.hidden-lg,
td.hidden-lg {
display: none !important;
}
}
.visible-print,
tr.visible-print,
th.visible-print,
td.visible-print {
display: none !important;
}
@media print {
.visible-print {
display: block !important;
}
table.visible-print {
display: table;
}
tr.visible-print {
display: table-row !important;
}
th.visible-print,
td.visible-print {
display: table-cell !important;
}
}
@media print {
.hidden-print,
tr.hidden-print,
th.hidden-print,
td.hidden-print {
display: none !important;
}
}
/*# sourceMappingURL=bootstrap.css.map */
| bjjb/cdnjs | ajax/libs/twitter-bootstrap/3.1.0/css/bootstrap.css | CSS | mit | 122,998 |
webshims.register("jmebase",function(a,b,c,d,e){"use strict";var f={},g={},h=Array.prototype.slice,i=0,j=a.extend({selector:".mediaplayer"},b.cfg.mediaelement.jme),k=j.selector;b.cfg.mediaelement.jme=j,a.jme||(a.jme={}),a.extend(a.jme,{pluginsClasses:[],pluginsSel:"",plugins:{},props:f,fns:g,data:function(b,c,d){var f=a(b).data("jme")||a.data(b,"jme",{});return d===e?c?f[c]:f:void(f[c]=d)},runPlugin:function(b){i&&a(document.querySelectorAll(k)).each(function(){var c=this.querySelectorAll(b);c.length&&a(this).jmeFn("addControls",c)})},registerPlugin:function(b,c){this.plugins[b]=c,c.nodeName||(c.nodeName=""),c.className||(c.className=b),this.pluginsClasses.push("."+c.className),this.pluginsSel=this.pluginsClasses.join(", "),j[b]=a.extend(c.options||{},j[b]),j[b]&&j[b].text?c.text=j[b].text:j.i18n&&j.i18n[b]&&(c.text=j.i18n[b]),this.runPlugin("."+c.className)},configmenuPlugins:{},addToConfigmenu:function(a,b){this.configmenuPlugins[a]=b},defineMethod:function(a,b){g[a]=b},defineProp:function(b,c){c||(c={}),c.set||(c.set=c.readonly?function(){throw b+" is readonly"}:a.noop),c.get||(c.get=function(c){return a.jme.data(c,b)}),f[b]=c},prop:function(b,c,d){if(!f[c])return a.prop(b,c,d);if(d===e)return f[c].get(b);var g=f[c].set(b,d);g===e&&(g=d),"noDataSet"!=g&&a.jme.data(b,c,g)}}),a.fn.jmeProp=function(b,c){return a.access(this,a.jme.prop,b,c,arguments.length>1)},a.fn.jmeFn=function(c){var d,f=h.call(arguments,1);return this.each(function(){return a.jme.data(this).media||(a(this).closest(k).jmePlayer(),b.warn("jmeFn called to early or on wrong element!")),d=(g[c]||a.prop(this,c)).apply(this,f),d!==e?!1:void 0}),d!==e?d:this};var l={emptied:1,pause:1},m={canplay:1,canplaythrough:1};a.jme.initJME=function(b,c){i+=a(b.querySelectorAll(k)).add(c.filter(k)).jmePlayer().length},a.jme.getDOMList=function(b){var c=[];return b||(b=[]),"string"==typeof b&&(b=b.split(" ")),a.each(b,function(a,b){b&&(b=document.getElementById(b),b&&c.push(b))}),c},a.jme.getButtonText=function(b,c){var d,e,f=function(f){e!==f&&(e=f,b.removeClass(c[f?0:1]).addClass(c[f]),d&&(b.prop("checked",!!f),(b.data("checkboxradio")||{refresh:a.noop}).refresh()))};return b.is('[type="checkbox"], [type="radio"]')?(b.prop("checked",function(){return this.defaultChecked}),d=!0):b.is("a")&&b.on("click",function(a){a.preventDefault()}),f},a.fn.jmePlayer=function(){return this.each(function(){var b,c,d,e,f,g,h,i=a("audio, video",this).eq(0),j=a(this),k=a.jme.data(this),n=a.jme.data(i[0]);j.addClass(i.prop("nodeName").toLowerCase()+"player"),n.player=j,n.media=i,k.media||(h=function(){j[0].className=j[0].className},d=function(){i.off("canplay",c),clearTimeout(e)},c=function(){var a=i.prop("paused")?"idle":"playing";j.attr("data-state",a)},b=function(b){var k,n,o=b.type;d(),m[o]&&"waiting"!=f||g&&"emptied"==o||("ended"==o||a.prop(this,"ended")?o="ended":"waiting"==o?a.prop(this,"readyState")>2?o="":(e=setTimeout(function(){i.prop("readyState")>2&&c()},9),i.on("canPlay",c)):l[o]?o="idle":(k=a.prop(this,"readyState"),n=a.prop(this,"paused"),o=!n&&3>k?"waiting":!n&&k>2?"playing":"idle"),"idle"==o&&j._seekpause&&(o=!1),o&&(f=o,j.attr("data-state",o),setTimeout(h)))},k.media=i,k.player=j,i.on("emptied waiting canplay canplaythrough playing ended pause mediaerror",b).on("volumechange updateJMEState",function(){var b=a.prop(this,"volume");j[!b||a.prop(this,"muted")?"addClass":"removeClass"]("state-muted"),b=.01>b?"no":.36>b?"low":.7>b?"medium":"high",j.attr("data-volume",b)}),a.jme.pluginsSel&&j.jmeFn("addControls",a(j[0].querySelectorAll(a.jme.pluginsSel))),b&&i.on("updateJMEState",b).triggerHandler("updateJMEState"))})},a.jme.defineProp("isPlaying",{get:function(b){return!a.prop(b,"ended")&&!a.prop(b,"paused")&&a.prop(b,"readyState")>1&&!a.data(b,"mediaerror")},readonly:!0}),a.jme.defineProp("player",{readonly:!0}),a.jme.defineProp("media",{readonly:!0}),a.jme.defineProp("srces",{get:function(b){var c,d=a.jme.data(b),e=d.media.prop("src");return e?[{src:e}]:c=a.map(a("source",d.media).get(),function(b){var c,d,e={src:a.prop(b,"src")},f=b.attributes;for(c=0,d=f.length;d>c;c++)"specified"in f[c]&&!f[c].specified||(e[f[c].nodeName]=f[c].nodeValue);return e})},set:function(b,c){var d=a.jme.data(b),e=function(b,c){"string"==typeof c&&(c={src:c}),a(document.createElement("source")).attr(c).appendTo(d.media)};return d.media.removeAttr("src").find("source").remove(),a.isArray(c)?a.each(c,e):e(0,c),d.media.jmeFn("load"),"noDataSet"}}),a.jme.defineMethod("togglePlay",function(){a(this).jmeFn(f.isPlaying.get(this)?"pause":"play")}),a.jme.defineMethod("addControls",function(b){var c=a.jme.data(this)||{};if(c.media){var d=a.jme.data(c.player[0],"controlElements")||a([]);b=a(b),a.jme.pluginsSel&&(b=b.find(a.jme.pluginsSel).add(b.filter(a.jme.pluginsSel))),b.length&&(a.each(a.jme.plugins,function(d,e){var f,g,h,i,j=b.filter("."+e.className);for(h=0;h<j.length;h++)if(f=a(j[h]),g=a.jme.data(j[h]),g.player=c.player,g.media=c.media,!g._rendered){if(g._rendered=!0,e.options)for(i in e.options)i in g||(g[i]=e.options[i]);e._create(f,c.media,c.player,g)}}),a.jme.data(c.player[0],"controlElements",d.add(b)),c.player.triggerHandler("controlsadded"))}}),b.ready("DOM mediaelement",function(){b.isReady("jme",!0),b.addReady(a.jme.initJME),b.isReady("jme-base",!0),b.cfg.debug!==!1&&document.getElementsByTagName("video").length&&!document.querySelector(k)&&b.warn("found video element but video wasn't wrapped inside a ."+k+" element. Will not add control UI")})}),webshims.register("mediacontrols",function(a,b,c){"use strict";var d=b.cfg.mediaelement.jme,e=d.selector,f=a.jme,g='<div class="{%class%}"></div>',h='<button class="{%class%}" type="button" aria-label="{%text%}"></button>',i='<div class="{%class%} media-range" aria-label="{%text%}"></div>',j='<div class="{%class%}">00:00</div>',k=function(){var a,b="";if(c.Audio)try{a=new Audio,a.volume=.55,b=Math.round(100*a.volume)/100==.55?"":" no-volume-api"}catch(d){}return b}(),l=function(){var a={},c=/\{\{(.+?)\}\}/gim;return function(e,h){return e||(e=d.barTemplate),(!a[e]||h)&&(a[e]=e.replace(c,function(a,c){var d=f.plugins[c];return d?(d.structure||(b.warn("no structure option provided for plugin: "+c+". Fallback to standard div"),d.structure=g),d.structure.replace("{%class%}",c).replace("{%text%}",d.text||"")):a})),a[e]||""}}(),m=/iP(hone|od|ad)/i.test(navigator.platform),n=m&&parseInt((navigator.appVersion.match(/OS (\d+)_\d+/)||["","8"])[1],10)<7,o=c.Modernizr,p=!(o&&o.videoautoplay||!m&&!/android/i.test(navigator.userAgent)),q=function(){q.loaded||(q.loaded=!0,b.loader.loadList(["mediacontrols-lazy","range-ui"]))},r=function(c){c||(c="_create");var d=function(e,f){var g=this,h=arguments;q(),b.ready("mediacontrols-lazy",function(){return d!=g[c]&&a.data(f[0])?g[c].apply(g,h):void b.error("stop too much recursion")})};return d};b.loader.addModule("mediacontrols-lazy",{src:"jme/mediacontrols-lazy",d:["dom-support"]});var s={_create:r()};f.plugins.useractivity=s,f.defineProp("controlbar",{set:function(e,g){g=!!g;var h,i,j=f.data(e),k=a("div.jme-mediaoverlay, div.jme-controlbar",j.player),m="";if(g&&!k[0])if(j._controlbar)j._controlbar.appendTo(j.player);else{n&&(j.media.removeAttr("controls"),j.media.mediaLoad()),p&&j.player.addClass("has-yt-bug"),j.media.prop("controls",!1),m=l(),j._controlbar=a(d.barStructure),k=j._controlbar.find("div.jme-cb-box").addClass("media-controls"),h=j._controlbar.filter(".jme-media-overlay"),h=h.add(k),a(m).appendTo(k),j._controlbar.appendTo(j.player),j.player.jmeFn("addControls",h),i=function(){var a={},b=[{size:290,name:"xx-small",names:"s xs xxs"},{size:380,name:"x-small",names:"s xs"},{size:478,name:"small",names:"s"},{size:756,name:"medium",names:"m"},{size:1024,name:"large",names:"l"},{size:Number.MAX_VALUE,name:"x-large",names:"l xl"}],c=b.length;return function(){var d,e=0,f=j.player.outerWidth(),g=Math.max(parseInt(j.player.css("fontSize"),10)||16,13);for(f*=16/g;c>e;e++)if(b[e].size>=f){d=b[e];break}a.name!=d.name&&(a=d,j.player.attr("data-playersize",d.name),j.player.attr("data-playersizes",d.names))}}();var o=a('<div class="ws-poster" />').insertAfter(j.media),q=function(){var a,b,d,e,f=c.swfmini&&swfmini.hasFlashPlayerVersion("10.0.3"),g=/youtube\.com\/[watch\?|v\/]+/i,h=j.media.prop("paused"),i=j.media.prop("ended");return h&&j.player.addClass("initial-state"),i&&j.player.addClass("ended-state"),"backgroundSize"in o[0].style||j.player.addClass("no-backgroundsize"),j.media.on("play playing waiting seeked seeking",function(a){a||(a.type="playing"),!h||e&&p&&"playing"!=a.type&&!j.media.prop("readyState")&&!j.media.prop("networkState")||(h=!1,j.player.removeClass("initial-state")),i&&(i=!1,j.player.removeClass("ended-state"))}),j.media.on("ended",function(){i||j.media.prop("loop")||!j.media.prop("ended")||(i=!0,j.player.addClass("ended-state"))}),function(){var c,k=j.media.attr("poster"),l=!!k,m=j.media.prop("currentSrc")||"";e=g.test(m),c=f&&l?!1:e,!l&&e&&(k=m.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i)||"",k&&(k="https://img.youtube.com/vi/"+k[1]+"/0.jpg",l=!!k)),d!==k&&(d=k,o[0].style.backgroundImage=k?"url("+k+")":""),a!==l&&(a=l,j.player[l?"removeClass":"addClass"]("no-poster")),j.media.prop("paused")&&(j.player.addClass("initial-state"),h=!0),i&&(i=!1,j.player.removeClass("ended-state")),j.player[e?"addClass":"removeClass"]("yt-video"),b!==c&&(b=c,j.player[c?"addClass":"removeClass"]("has-ytposter"))}}();s._create(j.player,j.media,j.player),j.media.on("emptied loadstart",function(){setTimeout(q)}),i(),q(),b.ready("dom-support",function(){j.player.onWSOff("updateshadowdom",i),h.add(j._controlbar).add(o).addClass(b.shadowClass),b.addShadowDom()})}else g||k.detach();return g}}),f.registerPlugin("play-pause",{structure:h,text:"play / pause",_create:r()}),f.registerPlugin("mute-unmute",{structure:h,text:"mute / unmute",_create:r()}),f.registerPlugin("jme-media-overlay",{_create:r()}),f.registerPlugin("volume-slider",{structure:i,text:"volume level",_create:r()}),f.registerPlugin("time-slider",{structure:i,options:{format:["mm","ss"]},text:"time position",_create:r()}),f.defineProp("format",{set:function(b,c){a.isArray(c)||(c=c.split(":"));var d=f.data(b);return d.format=c,a(b).triggerHandler("updatetimeformat"),d.player.triggerHandler("updatetimeformat"),"noDataSet"}}),f.registerPlugin("duration-display",{structure:j,options:{format:"mm:ss"},_create:r()}),f.defineProp("countdown",{set:function(b,c){var d=f.data(b);return d.countdown=!!c,a(b).triggerHandler("updatetimeformat"),d.player.triggerHandler("updatetimeformat"),"noDataSet"}}),f.registerPlugin("currenttime-display",{structure:j,options:{format:"mm:ss",countdown:!1},_create:r()}),f.registerPlugin("poster-display",{structure:"<div />",options:{},_create:r()}),f.registerPlugin("fullscreen",{options:{fullscreen:!0,autoplayfs:!1},structure:h,text:"enter fullscreen / exit fullscreen",_create:r()}),f.registerPlugin("mediaconfigmenu",{structure:h,text:"configuration",_create:r()}),f.registerPlugin("captions",{structure:h,text:"subtitles",_create:function(b,c,d){var e=c.find("track").filter(':not([kind]), [kind="subtitles"], [data-kind="subtitles"], [kind="captions"], [data-kind="captions"]');b.wsclonedcheckbox=a(b).clone().attr({role:"checkbox"}).insertBefore(b),d.attr("data-tracks",e.length>1?"many":e.length),b.attr("aria-haspopup","true"),r().apply(this,arguments)}}),f.registerPlugin("chapters",{structure:h,text:"chapters",_create:function(a,c,d){var e=c.find("track").filter('[kind="chapters"], [data-kind="chapters"]');a.attr("aria-haspopup","true"),e.length&&(b._polyfill(["track"]),d.addClass("has-chapter-tracks")),r().apply(this,arguments)}}),b.ready(b.cfg.mediaelement.plugins.concat(["mediaelement","jme-base"]),function(){d.barTemplate||(d.barTemplate='<div class="play-pause-container">{{play-pause}}</div><div class="playlist-container"><div class="playlist-box"><div class="playlist-button-container">{{playlist-prev}}</div><div class="playlist-button-container">{{playlist-next}}</div></div></div><div class="currenttime-container">{{currenttime-display}}</div><div class="progress-container">{{time-slider}}</div><div class="duration-container">{{duration-display}}</div><div class="mute-container">{{mute-unmute}}</div><div class="volume-container">{{volume-slider}}</div><div class="chapters-container"><div class="chapters-controls mediamenu-wrapper">{{chapters}}</div></div><div class="subtitle-container mediamenu-wrapper"><div class="subtitle-controls">{{captions}}</div></div><div class="mediaconfig-container"><div class="mediaconfig-controls mediamenu-wrapper">{{mediaconfigmenu}}</div></div><div class="fullscreen-container">{{fullscreen}}</div>'),d.barStructure||(d.barStructure='<div class="jme-media-overlay"></div><div class="jme-controlbar'+k+'" tabindex="-1"><div class="jme-cb-box"></div></div>'),b.addReady(function(b,c){a(e,b).add(c.filter(e)).jmeProp("controlbar",!0)})}),b.ready("WINDOWLOAD",q)}); | NMastracchio/cdnjs | ajax/libs/webshim/1.15.3-RC1/minified/shims/combos/99.js | JavaScript | mit | 12,962 |
/*
Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
(function () {
'use strict';
function isExpression(node) {
if (node == null) { return false; }
switch (node.type) {
case 'ArrayExpression':
case 'AssignmentExpression':
case 'BinaryExpression':
case 'CallExpression':
case 'ConditionalExpression':
case 'FunctionExpression':
case 'Identifier':
case 'Literal':
case 'LogicalExpression':
case 'MemberExpression':
case 'NewExpression':
case 'ObjectExpression':
case 'SequenceExpression':
case 'ThisExpression':
case 'UnaryExpression':
case 'UpdateExpression':
return true;
}
return false;
}
function isIterationStatement(node) {
if (node == null) { return false; }
switch (node.type) {
case 'DoWhileStatement':
case 'ForInStatement':
case 'ForStatement':
case 'WhileStatement':
return true;
}
return false;
}
function isStatement(node) {
if (node == null) { return false; }
switch (node.type) {
case 'BlockStatement':
case 'BreakStatement':
case 'ContinueStatement':
case 'DebuggerStatement':
case 'DoWhileStatement':
case 'EmptyStatement':
case 'ExpressionStatement':
case 'ForInStatement':
case 'ForStatement':
case 'IfStatement':
case 'LabeledStatement':
case 'ReturnStatement':
case 'SwitchStatement':
case 'ThrowStatement':
case 'TryStatement':
case 'VariableDeclaration':
case 'WhileStatement':
case 'WithStatement':
return true;
}
return false;
}
function isSourceElement(node) {
return isStatement(node) || node != null && node.type === 'FunctionDeclaration';
}
function trailingStatement(node) {
switch (node.type) {
case 'IfStatement':
if (node.alternate != null) {
return node.alternate;
}
return node.consequent;
case 'LabeledStatement':
case 'ForStatement':
case 'ForInStatement':
case 'WhileStatement':
case 'WithStatement':
return node.body;
}
return null;
}
function isProblematicIfStatement(node) {
var current;
if (node.type !== 'IfStatement') {
return false;
}
if (node.alternate == null) {
return false;
}
current = node.consequent;
do {
if (current.type === 'IfStatement') {
if (current.alternate == null) {
return true;
}
}
current = trailingStatement(current);
} while (current);
return false;
}
module.exports = {
isExpression: isExpression,
isStatement: isStatement,
isIterationStatement: isIterationStatement,
isSourceElement: isSourceElement,
isProblematicIfStatement: isProblematicIfStatement,
trailingStatement: trailingStatement
};
}());
/* vim: set sw=4 ts=4 et tw=80 : */
| hseifeddine/dashviz-mean | node_modules/esutils/lib/ast.js | JavaScript | mit | 4,728 |
/*
Name: 3024 day
Author: Jan T. Sott (http://github.com/idleberg)
CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror)
Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)
*/
.cm-s-3024-day.CodeMirror {background: #f7f7f7; color: #3a3432;}
.cm-s-3024-day div.CodeMirror-selected {background: #d6d5d4 !important;}
.cm-s-3024-day .CodeMirror-gutters {background: #f7f7f7; border-right: 0px;}
.cm-s-3024-day .CodeMirror-linenumber {color: #807d7c;}
.cm-s-3024-day .CodeMirror-cursor {border-left: 1px solid #5c5855 !important;}
.cm-s-3024-day span.cm-comment {color: #cdab53;}
.cm-s-3024-day span.cm-atom {color: #a16a94;}
.cm-s-3024-day span.cm-number {color: #a16a94;}
.cm-s-3024-day span.cm-property, .cm-s-3024-day span.cm-attribute {color: #01a252;}
.cm-s-3024-day span.cm-keyword {color: #db2d20;}
.cm-s-3024-day span.cm-string {color: #fded02;}
.cm-s-3024-day span.cm-variable {color: #01a252;}
.cm-s-3024-day span.cm-variable-2 {color: #01a0e4;}
.cm-s-3024-day span.cm-def {color: #e8bbd0;}
.cm-s-3024-day span.cm-bracket {color: #3a3432;}
.cm-s-3024-day span.cm-tag {color: #db2d20;}
.cm-s-3024-day span.cm-link {color: #a16a94;}
.cm-s-3024-day span.cm-error {background: #db2d20; color: #5c5855;}
.cm-s-3024-day .CodeMirror-activeline-background {background: #e8f2ff !important;}
.cm-s-3024-day .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
| kalkidanf/cdnjs | ajax/libs/codemirror/3.24.0/theme/3024-day.css | CSS | mit | 1,485 |
webshims.validityMessages.pl={typeMismatch:{defaultMessage:"Wprowad\u017a poprawn\u0105 warto\u015b\u0107.",email:"Wprowad\u017a poprawny adres e-mail.",url:"Wprowad\u017a poprawny adres URL."},badInput:{defaultMessage:"Wprowad\u017a poprawn\u0105 warto\u015b\u0107.",number:"Wprowad\u017a numer.",date:"Wprowad\u017a dat\u0119.",time:"Wprowad\u017a czas.",range:"Niepoprawny zakres.",month:"Wprowad\u017a poprawny miesi\u0105c.","datetime-local":"Wprowad\u017a dat\u0119 i czas."},rangeUnderflow:{defaultMessage:"Warto\u015b\u0107 musi by\u0107 wi\u0119ksza lub r\xf3wna {%min}.",date:"Warto\u015b\u0107 musi by\u0107 wi\u0119ksza lub r\xf3wna {%min}.",time:"Warto\u015b\u0107 musi by\u0107 wi\u0119ksza lub r\xf3wna {%min}.","datetime-local":"Warto\u015b\u0107 musi by\u0107 wi\u0119ksza lub r\xf3wna {%min}.",month:"Warto\u015b\u0107 musi by\u0107 wi\u0119ksza lub r\xf3wna {%min}."},rangeOverflow:{defaultMessage:"Warto\u015b\u0107 musi by\u0107 mniejsza lub r\xf3wna {%max}.",date:"Warto\u015b\u0107 musi by\u0107 mniejsza lub r\xf3wna {%max}.",time:"Warto\u015b\u0107 musi by\u0107 mniejsza lub r\xf3wna {%max}.","datetime-local":"Warto\u015b\u0107 musi by\u0107 mniejsza lub r\xf3wna {%max}.",month:"Warto\u015b\u0107 musi by\u0107 mniejsza lub r\xf3wna {%max}."},stepMismatch:"Nieprawid\u0142owe dane.",tooLong:"Mo\u017cna wpisa\u0107 maksymalnie {%maxlength} znaki(\xf3w). Wpisano {%valueLen}.",patternMismatch:"Niew\u0142a\u015bciwe dane. {%title}",valueMissing:{defaultMessage:"Prosz\u0119 wype\u0142ni\u0107 pole.",checkbox:"Zaznacz to pole je\u015bli chcesz przej\u015b\u0107 dalej.",select:"Wybierz opcj\u0119..",radio:"Zaznacz opcj\u0119."}},webshims.formcfg.pl={numberFormat:{".":".",",":","},numberSigns:".-",dateSigns:"-",timeSigns:":. ",dFormat:"-",patterns:{d:"yy-mm-dd"},month:{currentText:"Bie\u017c\u0105cy miesi\u0105c"},week:{currentText:"Bie\u017c\u0105cy tydzie\u0144"},date:{closeText:"Ok",clear:"Czy\u015b\u0107",prevText:"Poprzedni",nextText:"Nast\u0119pny",currentText:"Dzi\u015b",monthNames:["Stycze\u0144","Luty","Marzec","Kwiece\u0144","Maj","Czerwiec","Lipiec","Sierpie\u0144","Wrzesie\u0144","Pa\u017adziernik","Listopad","Grudzie\u0144"],monthNamesShort:["Sty","Lut","Mar","Kwi","Maj","Cze","Lip","Sie","Wrz","Pa\u017a","Lis","Gru"],dayNames:["Niedziela","Poniedzia\u0142ek","Wtorek","\u015aroda","Czwartek","Pi\u0105tek","Sobota"],dayNamesShort:["Nie","Pon","Wto","\u015aro","Czw","Pi\u0105","Sob"],dayNamesMin:["Nd","Pn","Wt","\u015ar","Cz","Pt","So"],weekHeader:"Tdz",firstDay:1,isRTL:!1,showMonthAfterYear:!0,yearSuffix:""}}; | fredericksilva/cdnjs | ajax/libs/webshim/1.13.1/minified/shims/i18n/formcfg-pl.js | JavaScript | mit | 2,566 |
webshims.validityMessages.sv={typeMismatch:{defaultMessage:"Fyll i det h\xe4r f\xe4ltet.",email:"Fyll i en e-postadress.",url:"Fyll i en URL."},badInput:{defaultMessage:"Fyll i det h\xe4r f\xe4ltet.",number:"Fyll i ett nummer.",date:"Fyll i en datum.",time:"Fyll i en tid.",range:"Felaktig inmatning.",month:"Fyll i en m\xe5nad.","datetime-local":"Fyll i datum och tid."},tooLong:"Fyll i max {%maxlength} tecken. Du fyllde i {%valueLen}.",tooShort:"Fyll i minst {%minlength} tecken. Du fyllde i {%valueLen}.",patternMismatch:"Felaktig inmatning. {%title}",valueMissing:{defaultMessage:"Fyll i detta f\xe4lt.",checkbox:"Bocka denna ruta f\xf6r att g\xe5 vidare.",select:"V\xe4lj n\xe5got ur listan.",radio:"V\xe4lj ett av valen."},rangeUnderflow:{defaultMessage:"V\xe4rdet m\xe5ste vara st\xf6rre eller lika med {%min}.",date:"Datumet m\xe5ste vara efter eller lika med {%min}.",time:"Tiden m\xe5ste vara efter eller lika med {%min}.","datetime-local":"V\xe4rdet m\xe5ste vara efter eller lika med {%min}.",month:"V\xe4rdet m\xe5ste vara efter eller lika med {%min}."},rangeOverflow:{defaultMessage:"V\xe4rdet m\xe5ste vara mindre eller lika med {%max}.",date:"Datumet m\xe5ste vara f\xf6re eller lika med {%max}.",time:"Tiden m\xe5ste vara f\xf6re eller lika med {%max}.","datetime-local":"V\xe4rdet m\xe5ste vara f\xf6re eller lika med {%max}.",month:"V\xe4rdet m\xe5ste vara f\xf6re eller lika med {%max}."},stepMismatch:"Felaktig inmatning."},webshims.formcfg.sv={numberFormat:{".":".",",":","},numberSigns:".",dateSigns:"-",timeSigns:":. ",dFormat:"-",patterns:{d:"yy-mm-dd"},date:{closeText:"St\xe4ng",clear:"Rensa",prevText:"«F\xf6rra",nextText:"N\xe4sta»",currentText:"Idag",monthNames:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],dayNamesShort:["S\xf6n","M\xe5n","Tis","Ons","Tor","Fre","L\xf6r"],dayNames:["S\xf6ndag","M\xe5ndag","Tisdag","Onsdag","Torsdag","Fredag","L\xf6rdag"],dayNamesMin:["S\xf6","M\xe5","Ti","On","To","Fr","L\xf6"],weekHeader:"Ve",dateFormat:"yy-mm-dd",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""}}; | featurist/cdnjs | ajax/libs/webshim/1.12.5-RC-1/minified/shims/i18n/formcfg-sv.js | JavaScript | mit | 2,210 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.