code
stringlengths 2
1.05M
| repo_name
stringlengths 5
114
| path
stringlengths 4
991
| language
stringclasses 1
value | license
stringclasses 15
values | size
int32 2
1.05M
|
---|---|---|---|---|---|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S12.10_A1.4_T4;
* @section: 12.10;
* @assertion: The with statement adds a computed object to the front of the
* scope chain of the current execution context;
* @description: Using "with" statement within iteration statement, leading to completion by break;
* @strict_mode_negative
*/
this.p1 = 1;
this.p2 = 2;
this.p3 = 3;
var result = "result";
var myObj = {p1: 'a',
p2: 'b',
p3: 'c',
value: 'myObj_value',
valueOf : function(){return 'obj_valueOf';},
parseInt : function(){return 'obj_parseInt';},
NaN : 'obj_NaN',
Infinity : 'obj_Infinity',
eval : function(){return 'obj_eval';},
parseFloat : function(){return 'obj_parseFloat';},
isNaN : function(){return 'obj_isNaN';},
isFinite : function(){return 'obj_isFinite';}
}
var del;
var st_p1 = "p1";
var st_p2 = "p2";
var st_p3 = "p3";
var st_parseInt = "parseInt";
var st_NaN = "NaN";
var st_Infinity = "Infinity";
var st_eval = "eval";
var st_parseFloat = "parseFloat";
var st_isNaN = "isNaN";
var st_isFinite = "isFinite";
do{
with(myObj){
st_p1 = p1;
st_p2 = p2;
st_p3 = p3;
st_parseInt = parseInt;
st_NaN = NaN;
st_Infinity = Infinity;
st_eval = eval;
st_parseFloat = parseFloat;
st_isNaN = isNaN;
st_isFinite = isFinite;
p1 = 'x1';
this.p2 = 'x2';
del = delete p3;
var p4 = 'x4';
p5 = 'x5';
var value = 'value';
break;
}
}
while(false);
if(!(p1 === 1)){
$ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );
}
if(!(p2 === "x2")){
$ERROR('#2: p2 === "x2". Actual: p2 ==='+ p2 );
}
if(!(p3 === 3)){
$ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );
}
if(!(p4 === "x4")){
$ERROR('#4: p4 === "x4". Actual: p4 ==='+ p4 );
}
if(!(p5 === "x5")){
$ERROR('#5: p5 === "x5". Actual: p5 ==='+ p5 );
}
if(!(myObj.p1 === "x1")){
$ERROR('#6: myObj.p1 === "x1". Actual: myObj.p1 ==='+ myObj.p1 );
}
if(!(myObj.p2 === "b")){
$ERROR('#7: myObj.p2 === "b". Actual: myObj.p2 ==='+ myObj.p2 );
}
if(!(myObj.p3 === undefined)){
$ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );
}
if(!(myObj.p4 === undefined)){
$ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );
}
if(!(myObj.p5 === undefined)){
$ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );
}
if(!(st_parseInt !== parseInt)){
$ERROR('#11: myObj.parseInt !== parseInt');
}
if(!(st_NaN === "obj_NaN")){
$ERROR('#12: myObj.NaN !== NaN');
}
if(!(st_Infinity !== Infinity)){
$ERROR('#13: myObj.Infinity !== Infinity');
}
if(!(st_eval !== eval)){
$ERROR('#14: myObj.eval !== eval');
}
if(!(st_parseFloat !== parseFloat)){
$ERROR('#15: myObj.parseFloat !== parseFloat');
}
if(!(st_isNaN !== isNaN)){
$ERROR('#16: myObj.isNaN !== isNaN');
}
if(!(st_isFinite !== isFinite)){
$ERROR('#17: myObj.isFinite !== isFinite');
}
if(!(value === undefined)){
$ERROR('#18: value === undefined. Actual: value ==='+ value );
}
if(!(myObj.value === "value")){
$ERROR('#19: myObj.value === "value". Actual: myObj.value ==='+ myObj.value );
}
| rustoscript/js.rs | sputnik/12_Statement/12.10_The_with_Statement/S12.10_A1.4_T4.js | JavaScript | mit | 3,319 |
frappe.ui.form.ControlCurrency = frappe.ui.form.ControlFloat.extend({
format_for_input: function(value) {
var formatted_value = format_number(value, this.get_number_format(), this.get_precision());
return isNaN(parseFloat(value)) ? "" : formatted_value;
},
get_precision: function() {
// always round based on field precision or currency's precision
// this method is also called in this.parse()
if (!this.df.precision) {
if(frappe.boot.sysdefaults.currency_precision) {
this.df.precision = frappe.boot.sysdefaults.currency_precision;
} else {
this.df.precision = get_number_format_info(this.get_number_format()).precision;
}
}
return this.df.precision;
}
});
| vjFaLk/frappe | frappe/public/js/frappe/form/controls/currency.js | JavaScript | mit | 697 |
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon"));
var _jsxRuntime = require("react/jsx-runtime");
var _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
d: "M19 5c0-1.1-.9-2-2-2h-6.17c-.53 0-1.04.21-1.42.59L7.95 5.06 19 16.11V5zM3.09 4.44c-.39.39-.39 1.02 0 1.41L5 7.78V19c0 1.11.9 2 2 2h11.23l.91.91c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L4.5 4.44a.9959.9959 0 0 0-1.41 0z"
}), 'SignalCellularNoSimRounded');
exports.default = _default; | oliviertassinari/material-ui | packages/mui-icons-material/lib/SignalCellularNoSimRounded.js | JavaScript | mit | 704 |
describe('ngThrottleSpec', function() {
var $animate, body, $rootElement, $throttle, $timeout;
beforeEach(module('material.services.throttle', 'material.animations'));
beforeEach(inject(function(_$throttle_, _$timeout_, _$animate_, _$rootElement_, $document ){
$throttle = _$throttle_;
$timeout = _$timeout_;
$animate = _$animate_;
$rootElement = _$rootElement_;
body = angular.element($document[0].body);
body.append($rootElement);
}));
describe('use $throttle with no configurations', function() {
var finished, started, ended;
var done = function() { finished = true; };
beforeEach( function() { finished = started = ended = false; });
it("should start and end without configuration",function() {
var process = $throttle()( done );
$timeout.flush();
expect(finished).toBe(true);
});
it("should run process function without throttle configuration",function() {
var process = $throttle()( done );
process("a");
$timeout.flush();
expect(finished).toBe(true);
});
it("should start and end with `done` callbacks",function() {
var startFn = function(done){ started = true; done(); };
var process = $throttle({start:startFn})( done );
expect(process).toBeDefined();
expect(started).toBe(false);
$timeout.flush(); // flush start()
expect(started).toBe(true);
expect(finished).toBe(true);
});
it("should start and end withOUT `done` callbacks",function() {
var startFn = function(){ started = true; };
var endFn = function(){ ended = true; };
var process = $throttle({start:startFn, end:endFn})( done );
$timeout.flush(); // throttle()
expect(started).toBe(true);
expect(ended).toBe(true);
expect(finished).toBe(true);
});
it("should start without throttle or end calls specified",function() {
var startFn = function(){ started = true; };
var throttledFn = $throttle({start:startFn})();
$timeout.flush();
expect(started).toBe(true);
});
it("should start but NOT end if throttle does not complete",function() {
var startFn = function(){ started = true;},
endFn = function(){ ended = true;};
lockFn = function(done){ ; }, // do not callback for completion
$throttle({start:startFn, throttle:lockFn, end:endFn})();
$timeout.flush();
expect(started).toBe(true);
expect(ended).toBe(false);
});
});
describe('use $throttle with synchronous processing', function() {
it("should process n-times correctly",function() {
var wanted="The Hulk";
var sCount=0, title="",
startFn = function(){
sCount++;
},
processFn = function(text, done){
title += text;
if ( title == wanted ) {
// Conditional termination of throttle phase
done();
}
};
concat = $throttle({start:startFn, throttle:processFn})( );
concat("The ");
concat("Hulk");
$timeout.flush();
expect(title).toBe(wanted);
});
it("should properly process with report callbacks",function() {
var pCount= 10, total, callCount= 0,
processFn = function(count, done){
pCount -= count;
if ( pCount == 5 ) {
// Conditional termination of throttle phase
// report total value in callback
done(pCount);
}
},
/**
* only called when ALL processing is done
*/
reportFn = function(count){ total = count; callCount +=1;},
subtract = $throttle({throttle:processFn})( );
subtract(2, reportFn );
subtract(3, reportFn );
$timeout.flush();
expect(total).toBe(5);
expect(callCount).toBe(1);
});
it("should restart if already finished",function() {
var total= 0, started = 0,
startFn = function(){
started += 1;
},
processFn = function(count, done){
total += count;
done(); // !!finish throttling
},
add = $throttle({start:startFn, throttle:processFn})();
add(1); $timeout.flush(); // proceed to end()
add(1); $timeout.flush(); // proceed to end()
add(1); $timeout.flush(); // proceed to end()
expect(total).toBe(3);
expect(started).toBe(3); // restarted 1x
});
});
describe('use $throttle with exceptions', function() {
it("should report error within start()", function() {
var started = false;
var error = "";
var fn = $throttle({start:function(done){
started = true;
throw new Error("fault_with_start");
}})(null, function(fault){
error = fault;
});
$timeout.flush();
expect(started).toBe(true);
expect(error).toNotBe("");
});
it("should report error within end()", function() {
var ended = false, error = "";
var config = { end : function(done){
ended = true;
throw new Error("fault_with_end");
}};
var captureError = function(fault) { error = fault; };
$throttle(config)(null, captureError );
$timeout.flush();
expect(ended).toBe(true);
expect(error).toNotBe("");
});
it("should report error within throttle()", function() {
var count = 0, error = "";
var config = { throttle : function(done){
count += 1;
switch(count)
{
case 1 : break;
case 2 : throw new Error("fault_with_throttle"); break;
case 3 : done(); break;
}
}};
var captureError = function(fault) { error = fault; };
var fn = $throttle(config)(null, captureError );
$timeout.flush();
fn( 1 );
fn( 2 );
fn( 3 );
expect(count).toBe(2);
expect(error).toNotBe("");
});
});
describe('use $throttle with async processing', function() {
var finished = false;
var done = function() { finished = true; };
beforeEach( function() { finished = false; });
it("should pass with async start()",function() {
var sCount=0,
startFn = function(){
return $timeout(function(){
sCount++;
},100)
},
concat = $throttle({start:startFn})( done );
concat("The ");
concat("Hulk");
$timeout.flush();
expect(sCount).toBe(1);
});
it("should pass with async start(done)",function() {
var sCount=0,
startFn = function(done){
return $timeout(function(){
sCount++;
done();
},100)
},
concat = $throttle({start:startFn})( done );
concat("The ");
concat("Hulk");
$timeout.flush(); // flush to begin 1st deferred start()
expect(sCount).toBe(1);
});
it("should pass with async start(done) and end(done)",function() {
var sCount=3, eCount= 0,
startFn = function(done){
return $timeout(function(){
sCount--;
done();
},100)
},
endFn = function(done){
return $timeout(function(){
eCount++;
done();
},100)
};
$throttle({start:startFn, end:endFn})( done );
$timeout.flush(); // flush to begin 1st deferred start()
$timeout.flush(); // start()
$timeout.flush(); // end()
expect(sCount).toBe(2);
expect(eCount).toBe(1);
expect(finished).toBe(true);
});
it("should pass with async start(done) and process(done)",function() {
var title="",
startFn = function(){
return $timeout(function(){
done();
},200);
},
processFn = function(data, done){
$timeout(function(){
title += data;
},400);
},
concat = $throttle({start:startFn, throttle:processFn})( done );
$timeout.flush(); // start()
concat("The "); $timeout.flush(); // throttle(1)
concat("Hulk"); $timeout.flush(); // throttle(2)
expect(title).toBe("The Hulk");
});
it("should pass with async process(done) and restart with cancellable end",function() {
var content="", numStarts= 0, numEnds = 0,
startFn = function(done){
numStarts++;
done("start-done");
},
throttleFn = function(data, done){
$timeout(function(){
content += data;
if ( data == "e" ) {
done("throttle-done");
}
},400);
},
endFn = function(done){
numEnds++;
var procID = $timeout(function(){
done("end-done");
},500,false);
return function() {
$timeout.cancel( procID );
};
},
concat = $throttle({ start:startFn, throttle:throttleFn, end:endFn })( done );
$timeout.flush(); // flush to begin 1st start()
concat("a"); // Build string...
concat("b");
concat("c");
concat("d");
concat("e"); // forces end()
$timeout.flush(); // flush to throttle( 5x )
$timeout(function(){
concat("a"); // forces restart()
concat("e"); // forces end()
},400,false);
$timeout.flush(); // flush() 278
$timeout.flush(); // flush to throttle( 2x )
expect(content).toBe("abcdeae");
expect(numStarts).toBe(2);
expect(numEnds).toBe(2);
});
});
describe('use $throttle with inkRipple', function(){
var finished, started, ended;
var done = function() { finished = true; };
beforeEach( function() { finished = started = ended = false; });
function setup() {
var el;
var tmpl = '' +
'<div style="width:50px; height:50px;">'+
'<canvas class="material-ink-ripple" ></canvas>' +
'</div>';
inject(function($compile, $rootScope) {
el = $compile(tmpl)($rootScope);
$rootElement.append( el );
$rootScope.$apply();
});
return el;
}
it('should start, animate, and end.', inject(function($compile, $rootScope, $materialEffects) {
var cntr = setup(),
canvas = cntr.find('canvas'),
rippler, makeRipple, throttled = 0,
config = {
start : function() {
rippler = rippler || $materialEffects.inkRipple( canvas[0] );
cntr.on('mousedown', makeRipple);
started = true;
},
throttle : function(e, done) {
throttled += 1;
switch(e.type)
{
case 'mousedown' :
rippler.createAt( {x:25,y:25} );
rippler.draw( done );
break;
default:
break;
}
}
}
// prepare rippler wave function...
makeRipple = $throttle(config)(done);
$timeout.flush();
expect(started).toBe(true);
// trigger wave animation...
cntr.triggerHandler("mousedown");
// Allow animation to finish...
$timeout(function(){
expect(throttled).toBe(1);
expect(ended).toBe(true);
expect(finished).toBe(true);
},10);
// Remove from $rootElement
cntr.remove();
}));
});
});
| Hotell/ng-material-demo | src/services/throttle/throttle.spec.js | JavaScript | mit | 11,313 |
//Libraries
const React = require("react");
const _ = require("lodash");
const DataActions = require("../actions/data_actions");
const DataStore = require("../stores/data_store");
const FilterStore = require("../stores/filter_store");
const ColumnsStore = require("../stores/columns_store");
//Mixins
const cssMixins = require("morse-react-mixins").css_mixins;
const textMixins = require("morse-react-mixins").text_mixins;
class SearchFilters extends React.Component{
constructor(props) {
super(props);
this.dropdown = ["input-group-btn", {"open":false}];
this.state = {
dropdown:this.getClasses(this.dropdown),
expanded:"false",
selectedkey:"all",
searchVal:""
};
}
componentDidMount() {
this.quickSearch = (_.isBoolean(this.props.quickSearch)) ? this.props.quickSearch : true;
if(FilterStore.isSelectedKey(this.props.item)){
this.active = [{active:true}];
this.setState({active:this.getClasses(this.active)});
}
this.setState({searchVal:DataStore.getSearchVal()});
// FilterStore.addChangeListener("change_key", this._openDropdown.bind(this));
ColumnsStore.addChangeListener("adding", this._onAdd.bind(this));
}
componentWillUnmount() {
// FilterStore.removeChangeListener("change_key", this._openDropdown);
ColumnsStore.removeChangeListener("adding", this._onAdd);
}
_onAdd(){
this.setState({
keys:ColumnsStore.getSearchable()
});
}
_onChange(e){
if(this.quickSearch){
if(this.loop){
window.clearTimeout(this.loop);
}
this.loop = window.setTimeout((val)=>{
if(val.length > 2 || val === ""){
DataActions.searching(val);
}
}, 200, e.target.value);
this.setState({searchVal:e.target.value});
}
// _.defer((val)=>{
// DataActions.searching(val);
// }, e.target.value);
}
// _openDropdown(){
// this.dropdown = this.toggleCss(this.dropdown);
// let expanded = (this.state.expended === "true") ? "false" : "true";
// this.setState({
// dropdown:this.getClasses(this.dropdown),
// expanded:expanded,
// selectedkey:FilterStore.getSelectedKey()
// });
// }
_preventSubmit(e){
// console.log("submiting", e);
e.preventDefault();
}
// renderKeys(){
// if(this.state.keys){
// let items = this.state.keys.map(function(k){
// return (<Keys item={k} key={_.uniqueId("key")} />);
// });
// return items;
// }
// }
render() {
return (
<form onSubmit={this._preventSubmit.bind(this)} className="search-filter">
<input alt="Search" type="image" src={this.props.icon} />
<div className="fields-container">
<input type="text" name="querystr" id="querystr" placeholder="Search" value={this.state.searchVal} onChange={this._onChange.bind(this)} />
</div>
</form>
);
}
}
Object.assign(SearchFilters.prototype, cssMixins);
Object.assign(SearchFilters.prototype, textMixins);
module.exports = SearchFilters;
| djforth/walkabout-jobs-search | src/vanilla_components/searchfilter.js | JavaScript | mit | 3,083 |
/* State
* @class
* @classdesc This class reprensent an automata state, a sub-type of a generic Node */
k.data.State = (function(_super)
{
'use strict';
/* jshint latedef:false */
k.utils.obj.inherit(state, _super);
/*
* Constructor Automata State
*
* @constructor
* @param {[ItemRule]} options.items Array of item rules that initialy compone this state
* @param {[Object]} options.transitions Array of object that initialy compone this node
* @param {[Node]} options.nodes Array of State instances that are children of this State
*/
function state (options) {
_super.apply(this, arguments);
k.utils.obj.defineProperty(this, 'isAcceptanceState'); // This is set by the automata generator
k.utils.obj.defineProperty(this, '_items');
k.utils.obj.defineProperty(this, '_registerItems');
k.utils.obj.defineProperty(this, '_condencedView');
k.utils.obj.defineProperty(this, '_unprocessedItems');
this.isAcceptanceState = false;
this._items = options.items || [];
this._unprocessedItems = this._items.length ? k.utils.obj.shallowClone(this._items) : [];
options.items = null;
this._registerItems = {};
this._registerItemRules();
}
/* @method REgister the list of item rules of the current stateso they are assesible by its id
* @returns {Void} */
state.prototype._registerItemRules = function ()
{
k.utils.obj.each(this._items, function (itemRule)
{
this._registerItems[itemRule.getIdentity()] = itemRule;
}, this);
};
state.constants = {
AcceptanceStateName: 'AcceptanceState'
};
/* @method Get the next unprocessed item rule
* @returns {ItemRule} Next Item Rule */
state.prototype.getNextItem = function() {
return this._unprocessedItems.splice(0,1)[0];
};
/* @method Adds an array of item rule into the state. Only the rules that are not already present in the state will be added
* @param {[ItemRule]} itemRules Array of item rules to add into the state
* @param {Boolean} options.notMergeLookAhead If specified as true does not marge the lookAhead of the already existing items. Default: falsy
* @returns {void} Nothing */
state.prototype.addItems = function(itemRules, options) {
this._id = null;
k.utils.obj.each(itemRules, function (itemRule)
{
// The same item rule can be added more than once if the grammar has loops.
// For sample: (1)S -> A *EXPS B (2)EXPS -> *EXPS
if (!this._registerItems[itemRule.getIdentity()])
{
this._registerItems[itemRule.getIdentity()] = itemRule;
this._items.push(itemRule);
this._unprocessedItems.push(itemRule);
}
else if (!options || !options.notMergeLookAhead)
{
//As a way of generating a LALR(1) automata adds a item rule for each lookAhead we simply merge its lookAheads
var original_itemRule = this._registerItems[itemRule.getIdentity()];
if (itemRule.lookAhead && itemRule.lookAhead.length)
{
original_itemRule.lookAhead = original_itemRule.lookAhead || [];
itemRule.lookAhead = itemRule.lookAhead || [];
var mergedLookAheads = original_itemRule.lookAhead.concat(itemRule.lookAhead),
original_itemRule_lookAhead_length = this._registerItems[itemRule.getIdentity()].lookAhead.length;
this._registerItems[itemRule.getIdentity()].lookAhead = k.utils.obj.uniq(mergedLookAheads, function (item) { return item.name;});
var is_item_already_queued = k.utils.obj.filter(this._unprocessedItems, function (unprocessed_item)
{
return unprocessed_item.getIdentity() === itemRule.getIdentity();
}).length > 0;
//If there were changes in the lookAhead and the rule is not already queued.
if (original_itemRule_lookAhead_length !== this._registerItems[itemRule.getIdentity()].lookAhead.length && !is_item_already_queued)
{
this._unprocessedItems.push(itemRule);
}
}
}
}, this);
};
/* @method Convert the current state to its string representation
* @returns {String} formatted string */
state.prototype.toString = function() {
var strResult = 'ID: ' + this.getIdentity() + '\n' +
this._items.join('\n') +
'\nTRANSITIONS:\n';
k.utils.obj.each(this.transitions, function (transition)
{
strResult += '*--' + transition.symbol + '-->' + transition.state.getIdentity() + '\n';
});
return strResult;
};
/* @method Returns the condenced (one line) string that reprenset the current 'state' of the current state
* @returns {String} State Representation in one line */
state.prototype.getCondencedString = function() {
if(!this._condencedView)
{
this._condencedView = this._generateCondencedString();
}
return this._condencedView;
};
/* @method Internal method to generate a condenced (one line) string that reprenset the current 'state' of the current state
* @returns {String} State Representation in one line */
state.prototype._generateCondencedString = function() {
return k.utils.obj.map(
k.utils.obj.sortBy(this._items, function(item)
{
return item.rule.index;
}),
function (item) {
return item.rule.index;
}).join('-');
};
/* @method Generates an ID that identify this state from any other state
* @returns {String} Generated ID */
state.prototype._generateIdentity = function() {
if (this.isAcceptanceState)
{
return state.constants.AcceptanceStateName;
}
else if (!this._items.length)
{
return _super.prototype._generateIdentity.apply(this, arguments);
}
return k.utils.obj.reduce(
k.utils.obj.sortBy(this._items, function(item)
{
return item.rule.index;
}),
function (acc, item) {
return acc + item.getIdentity(); //.rule.index + '(' + item.dotLocation + ')';
}, '');
};
/* @method Returns a copy the items contained in the current state
* @returns {[ItemRule]} Array of cloned item rules */
state.prototype.getItems = function() {
return k.utils.obj.map(this._items, function(item) {
return item.clone();
});
};
/* @method Returns an orignal item rule based on its id.
This method is intended to be use as READ-ONLY, editing the returned items will affect the state and the rest of the automata at with this state belongs to.
* @returns {[ItemRule]} Array of current item rules */
state.prototype.getOriginalItems = function() {
return this._items;
};
/* @method Returns an orignal item rule based on its id.
This method is intended to be use as READ-ONLY, editing the returned items will affect the state and the rest of the automata at with this state belongs to.
* @returns {ItemRule} Item rule corresponding to the id passed in if present or null otherwise */
state.prototype.getOriginalItemById = function(id) {
return this._registerItems[id];
};
/** @method Get the list of all supported symbol which are valid to generata transition from the current state.
* @returns {[Object]} Array of object of the form: {symbol, items} where items have an array of item rules */
state.prototype.getSupportedTransitionSymbols = function() {
var itemsAux = {},
result = [],
symbol;
k.utils.obj.each(this._items, function (item)
{
symbol = item.getCurrentSymbol();
if (symbol)
{
if (itemsAux[symbol.name]) {
itemsAux[symbol.name].push(item);
}
else
{
itemsAux[symbol.name] = [item];
result.push({
symbol: symbol,
items: itemsAux[symbol.name]
});
}
}
});
return result;
};
/* @method Responsible of new transitions. We override this method to use the correct variable names and be more meanful
* @param {Symbol} symbol Symbol use to make the transition, like the name of the transition
* @param {State} state Destination state arrived when moving with the specified tranisiotn
* @returns {Object} Transition object */
state.prototype._generateNewTransition = function (symbol, state) {
return {
symbol: symbol,
state: state
};
};
/* @method Returns the list of item rules contained in the current state that are reduce item rules.
* @returns {[ItemRule]} Recude Item Rules */
state.prototype.getRecudeItems = function () {
return k.utils.obj.filter(this._items, function (item) {
return item.isReduce();
});
};
return state;
})(k.data.Node); | Mictian/kappa | src/data/state.js | JavaScript | mit | 8,200 |
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function (mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function (CodeMirror) {
"use strict";
CodeMirror.defineMode("dylan", function (_config) {
// Words
var words = {
// Words that introduce unnamed definitions like "define interface"
unnamedDefinition: ["interface"],
// Words that introduce simple named definitions like "define library"
namedDefinition: ["module", "library", "macro",
"C-struct", "C-union",
"C-function", "C-callable-wrapper"
],
// Words that introduce type definitions like "define class".
// These are also parameterized like "define method" and are
// appended to otherParameterizedDefinitionWords
typeParameterizedDefinition: ["class", "C-subtype", "C-mapped-subtype"],
// Words that introduce trickier definitions like "define method".
// These require special definitions to be added to startExpressions
otherParameterizedDefinition: ["method", "function",
"C-variable", "C-address"
],
// Words that introduce module constant definitions.
// These must also be simple definitions and are
// appended to otherSimpleDefinitionWords
constantSimpleDefinition: ["constant"],
// Words that introduce module variable definitions.
// These must also be simple definitions and are
// appended to otherSimpleDefinitionWords
variableSimpleDefinition: ["variable"],
// Other words that introduce simple definitions
// (without implicit bodies).
otherSimpleDefinition: ["generic", "domain",
"C-pointer-type",
"table"
],
// Words that begin statements with implicit bodies.
statement: ["if", "block", "begin", "method", "case",
"for", "select", "when", "unless", "until",
"while", "iterate", "profiling", "dynamic-bind"
],
// Patterns that act as separators in compound statements.
// This may include any general pattern that must be indented
// specially.
separator: ["finally", "exception", "cleanup", "else",
"elseif", "afterwards"
],
// Keywords that do not require special indentation handling,
// but which should be highlighted
other: ["above", "below", "by", "from", "handler", "in",
"instance", "let", "local", "otherwise", "slot",
"subclass", "then", "to", "keyed-by", "virtual"
],
// Condition signaling function calls
signalingCalls: ["signal", "error", "cerror",
"break", "check-type", "abort"
]
};
words["otherDefinition"] =
words["unnamedDefinition"]
.concat(words["namedDefinition"])
.concat(words["otherParameterizedDefinition"]);
words["definition"] =
words["typeParameterizedDefinition"]
.concat(words["otherDefinition"]);
words["parameterizedDefinition"] =
words["typeParameterizedDefinition"]
.concat(words["otherParameterizedDefinition"]);
words["simpleDefinition"] =
words["constantSimpleDefinition"]
.concat(words["variableSimpleDefinition"])
.concat(words["otherSimpleDefinition"]);
words["keyword"] =
words["statement"]
.concat(words["separator"])
.concat(words["other"]);
// Patterns
var symbolPattern = "[-_a-zA-Z?!*@<>$%]+";
var symbol = new RegExp("^" + symbolPattern);
var patterns = {
// Symbols with special syntax
symbolKeyword: symbolPattern + ":",
symbolClass: "<" + symbolPattern + ">",
symbolGlobal: "\\*" + symbolPattern + "\\*",
symbolConstant: "\\$" + symbolPattern
};
var patternStyles = {
symbolKeyword: "atom",
symbolClass: "tag",
symbolGlobal: "variable-2",
symbolConstant: "variable-3"
};
// Compile all patterns to regular expressions
for (var patternName in patterns)
if (patterns.hasOwnProperty(patternName))
patterns[patternName] = new RegExp("^" + patterns[patternName]);
// Names beginning "with-" and "without-" are commonly
// used as statement macro
patterns["keyword"] = [/^with(?:out)?-[-_a-zA-Z?!*@<>$%]+/];
var styles = {};
styles["keyword"] = "keyword";
styles["definition"] = "def";
styles["simpleDefinition"] = "def";
styles["signalingCalls"] = "builtin";
// protected words lookup table
var wordLookup = {};
var styleLookup = {};
[
"keyword",
"definition",
"simpleDefinition",
"signalingCalls"
].forEach(function (type) {
words[type].forEach(function (word) {
wordLookup[word] = type;
styleLookup[word] = styles[type];
});
});
function chain(stream, state, f) {
state.tokenize = f;
return f(stream, state);
}
function tokenBase(stream, state) {
// String
var ch = stream.peek();
if (ch == "'" || ch == '"') {
stream.next();
return chain(stream, state, tokenString(ch, "string"));
}
// Comment
else if (ch == "/") {
stream.next();
if (stream.eat("*")) {
return chain(stream, state, tokenComment);
} else if (stream.eat("/")) {
stream.skipToEnd();
return "comment";
}
stream.backUp(1);
}
// Decimal
else if (/[+\-\d\.]/.test(ch)) {
if (stream.match(/^[+-]?[0-9]*\.[0-9]*([esdx][+-]?[0-9]+)?/i) ||
stream.match(/^[+-]?[0-9]+([esdx][+-]?[0-9]+)/i) ||
stream.match(/^[+-]?\d+/)) {
return "number";
}
}
// Hash
else if (ch == "#") {
stream.next();
// Symbol with string syntax
ch = stream.peek();
if (ch == '"') {
stream.next();
return chain(stream, state, tokenString('"', "string"));
}
// Binary number
else if (ch == "b") {
stream.next();
stream.eatWhile(/[01]/);
return "number";
}
// Hex number
else if (ch == "x") {
stream.next();
stream.eatWhile(/[\da-f]/i);
return "number";
}
// Octal number
else if (ch == "o") {
stream.next();
stream.eatWhile(/[0-7]/);
return "number";
}
// Token concatenation in macros
else if (ch == '#') {
stream.next();
return "punctuation";
}
// Sequence literals
else if ((ch == '[') || (ch == '(')) {
stream.next();
return "bracket";
// Hash symbol
} else if (stream.match(/f|t|all-keys|include|key|next|rest/i)) {
return "atom";
} else {
stream.eatWhile(/[-a-zA-Z]/);
return "error";
}
} else if (ch == "~") {
stream.next();
ch = stream.peek();
if (ch == "=") {
stream.next();
ch = stream.peek();
if (ch == "=") {
stream.next();
return "operator";
}
return "operator";
}
return "operator";
} else if (ch == ":") {
stream.next();
ch = stream.peek();
if (ch == "=") {
stream.next();
return "operator";
} else if (ch == ":") {
stream.next();
return "punctuation";
}
} else if ("[](){}".indexOf(ch) != -1) {
stream.next();
return "bracket";
} else if (".,".indexOf(ch) != -1) {
stream.next();
return "punctuation";
} else if (stream.match("end")) {
return "keyword";
}
for (var name in patterns) {
if (patterns.hasOwnProperty(name)) {
var pattern = patterns[name];
if ((pattern instanceof Array && pattern.some(function (p) {
return stream.match(p);
})) || stream.match(pattern))
return patternStyles[name];
}
}
if (/[+\-*\/^=<>&|]/.test(ch)) {
stream.next();
return "operator";
}
if (stream.match("define")) {
return "def";
} else {
stream.eatWhile(/[\w\-]/);
// Keyword
if (wordLookup[stream.current()]) {
return styleLookup[stream.current()];
} else if (stream.current().match(symbol)) {
return "variable";
} else {
stream.next();
return "variable-2";
}
}
}
function tokenComment(stream, state) {
var maybeEnd = false, maybeNested = false, nestedCount = 0, ch;
while ((ch = stream.next())) {
if (ch == "/" && maybeEnd) {
if (nestedCount > 0) {
nestedCount--;
} else {
state.tokenize = tokenBase;
break;
}
} else if (ch == "*" && maybeNested) {
nestedCount++;
}
maybeEnd = (ch == "*");
maybeNested = (ch == "/");
}
return "comment";
}
function tokenString(quote, style) {
return function (stream, state) {
var escaped = false, next, end = false;
while ((next = stream.next()) != null) {
if (next == quote && !escaped) {
end = true;
break;
}
escaped = !escaped && next == "\\";
}
if (end || !escaped) {
state.tokenize = tokenBase;
}
return style;
};
}
// Interface
return {
startState: function () {
return {
tokenize: tokenBase,
currentIndent: 0
};
},
token: function (stream, state) {
if (stream.eatSpace())
return null;
var style = state.tokenize(stream, state);
return style;
},
blockCommentStart: "/*",
blockCommentEnd: "*/"
};
});
CodeMirror.defineMIME("text/x-dylan", "dylan");
});
| Kipsora/KitJudge | utility/js/mode/dylan/dylan.js | JavaScript | mit | 12,442 |
$(document).ready(function() {
$("#frmChangePass").submit(function() {
//get the url for the form
AJAX.post(
$("#frmChangePass").attr("action"),
{
_password_current : $("#currentPass").val(),
_password : $("#newPass").val(),
_password_confirm : $("#newPass2").val()
},
$("#msgbox_changepass"),
$("#btnChangepass"));
//we dont what the browser to submit the form
return false;
});
});
| c4d3r/mcsuite-application-eyeofender | src/Maxim/Theme/EOEBundle/Resources/public/theme/js/changepassword.js | JavaScript | mit | 425 |
/**
* Created by joonkukang on 2014. 1. 16..
*/
var math = require('./utils').math;
let optimize = module.exports;
optimize.hillclimb = function(options){
var domain = options['domain'];
var costf = options['costf'];
var i;
var vec = [];
for(i=0 ; i<domain.length ; i++)
vec.push(math.randInt(domain[i][0],domain[i][1]));
var current, best;
while(true) {
var neighbors = [];
var i,j;
for(i=0 ; i<domain.length ; i++) {
if(vec[i] > domain[i][0]) {
var newVec = [];
for(j=0 ; j<domain.length ; j++)
newVec.push(vec[j]);
newVec[i]-=1;
neighbors.push(newVec);
} else if (vec[i] < domain[i][1]) {
var newVec = [];
for(j=0 ; j<domain.length ; j++)
newVec.push(vec[j]);
newVec[i]+=1;
neighbors.push(newVec);
}
}
current = costf(vec);
best = current;
for(i=0 ; i<neighbors.length ; i++) {
var cost = costf(neighbors[i]);
if(cost < best) {
best = cost;
vec = neighbors[i];
}
}
if(best === current)
break;
}
return vec;
}
optimize.anneal = function(options){
var domain = options['domain'];
var costf = options['costf'];
var temperature = options['temperature'];
var cool = options['cool'];
var step = options['step'];
var callback
var i;
var vec = [];
for(i=0 ; i<domain.length ; i++)
vec.push(math.randInt(domain[i][0],domain[i][1]));
while(temperature > 0.1) {
var idx = math.randInt(0,domain.length - 1);
var dir = math.randInt(-step,step);
var newVec = [];
for(i=0; i<vec.length ; i++)
newVec.push(vec[i]);
newVec[idx]+=dir;
if(newVec[idx] < domain[idx][0]) newVec[idx] = domain[idx][0];
if(newVec[idx] > domain[idx][1]) newVec[idx] = domain[idx][1];
var ea = costf(vec);
var eb = costf(newVec);
var p = Math.exp(-1.*(eb-ea)/temperature);
if(eb < ea || Math.random() < p)
vec = newVec;
temperature *= cool;
}
return vec;
}
optimize.genetic = function(options){
var domain = options['domain'];
var costf = options['costf'];
var population = options['population'];
var q = options['q'] || 0.3;
var elite = options['elite'] || population * 0.04;
var epochs = options['epochs'] || 100;
var i,j;
// Initialize population array
var pop =[];
for(i=0; i<population; i++) {
var vec = [];
for(j=0; j<domain.length; j++)
vec.push(math.randInt(domain[j][0],domain[j][1]));
pop.push(vec);
}
pop.sort(function(a,b){return costf(a) - costf(b);});
for(i=0 ; i<epochs ; i++) {
// elitism
var newPop = [];
for(j=0;j<elite;j++)
newPop.push(pop[j]);
// compute fitnesses
var fitnesses = [];
for(j=0; j<pop.length; j++)
fitnesses[j] = q * Math.pow(1-q,j);
fitnesses = math.normalizeVec(fitnesses);
// crossover, mutate
for(j=0; j<pop.length - elite;j++) {
var idx1 = rouletteWheel(fitnesses);
var idx2 = rouletteWheel(fitnesses);
var crossovered = crossover(pop[idx1],pop[idx2]);
var mutated = mutate(crossovered);
newPop.push(mutated);
}
// replacement
pop = newPop;
pop.sort(function(a,b){return costf(a) - costf(b);});
//console.log("Current Cost : ",costf(pop[0]));
}
return pop[0];
function mutate(vec) {
var idx = math.randInt(0,domain.length - 1);
var newVec = [];
var i;
for(i=0; i<domain.length ; i++)
newVec.push(vec[i]);
newVec[idx] += (Math.random() < 0.5) ? 1 : -1;
if(newVec[idx] < domain[idx][0]) newVec[idx] = domain[idx][0];
if(newVec[idx] > domain[idx][1]) newVec[idx] = domain[idx][1];
return newVec;
}
function crossover(vec1,vec2) {
var idx = math.randInt(0,domain.length - 2);
var newVec = [];
var i;
for(i=0; i<idx ; i++)
newVec.push(vec1[i]);
for(i=idx; i<domain.length; i++)
newVec.push(vec2[i]);
return newVec;
}
function rouletteWheel(vec) {
var a = [0.0];
var i;
for(i=0;i<vec.length;i++) {
a.push(a[i] + vec[i]);
}
var rand = Math.random();
for(i=0;i< a.length;i++) {
if(rand > a[i] && rand <= a[i+1])
return i;
}
return -1;
}
};
| pulipulichen/blog-pulipuli-info-data-2017 | 06/generative_path/machine_learning-master/machine_learning-master/lib/optimize.js | JavaScript | mit | 4,797 |
System.register(['@angular/core', '@angular/router', '../user/user.service', './login.service', '../shared/alert/dtalert.component', '../shared/spinner/dtspinner.component'], function(exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1, router_1, user_service_1, login_service_1, dtalert_component_1, dtspinner_component_1;
var LoginComponent;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
},
function (router_1_1) {
router_1 = router_1_1;
},
function (user_service_1_1) {
user_service_1 = user_service_1_1;
},
function (login_service_1_1) {
login_service_1 = login_service_1_1;
},
function (dtalert_component_1_1) {
dtalert_component_1 = dtalert_component_1_1;
},
function (dtspinner_component_1_1) {
dtspinner_component_1 = dtspinner_component_1_1;
}],
execute: function() {
LoginComponent = (function () {
function LoginComponent(_loginService, _router, _userService) {
this._loginService = _loginService;
this._router = _router;
this._userService = _userService;
this.pageTitle = "Login";
this.EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;
this.dtAlert = new dtalert_component_1.DtAlertComponent();
}
LoginComponent.prototype.submit = function () {
var _this = this;
var isValid = this.validateEmailAndPassword();
if (!isValid) {
return;
}
var payload = { "email": this.email, "password": this.password };
this._loginService
.login(payload)
.subscribe(function (result) {
if (!result.success) {
_this.dtAlert.failure(result.message);
return;
}
_this._userService.add(result);
_this._router.navigate(['dashboard']);
}, function (error) { return _this.dtAlert.failure(error); });
};
LoginComponent.prototype.validateEmailAndPassword = function () {
if (this.email == null || this.email == "" || !this.EMAIL_REGEXP.test(this.email)) {
this.dtAlert.failure("Please enter a valid email");
return false;
}
if (this.password == null || this.password == "") {
this.dtAlert.failure("Please enter a password");
return false;
}
return true;
};
__decorate([
core_1.Input(),
__metadata('design:type', String)
], LoginComponent.prototype, "email", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', String)
], LoginComponent.prototype, "password", void 0);
LoginComponent = __decorate([
core_1.Component({
templateUrl: 'app/login/login.component.html',
directives: [dtalert_component_1.DtAlertComponent, dtspinner_component_1.DtSpinButtonComponent]
}),
__metadata('design:paramtypes', [login_service_1.LoginService, router_1.Router, user_service_1.UserService])
], LoginComponent);
return LoginComponent;
}());
exports_1("LoginComponent", LoginComponent);
}
}
});
//# sourceMappingURL=login.component.js.map | alphaCoder/DollarTracker.Web | app/login/login.component.js | JavaScript | mit | 4,925 |
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon"));
var _jsxRuntime = require("react/jsx-runtime");
var _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
d: "M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm2 16H5V5h11.17L19 7.83V19zm-7-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3zM6 6h9v4H6z"
}), 'SaveOutlined');
exports.default = _default; | oliviertassinari/material-ui | packages/mui-icons-material/lib/SaveOutlined.js | JavaScript | mit | 632 |
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: '<json:jquery-disqus.jquery.json>',
meta: {
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
},
concat: {
dist: {
src: ['<banner:meta.banner>', '<file_strip_banner:src/<%= pkg.name %>.js>'],
dest: 'dist/<%= pkg.name %>.js'
}
},
min: {
dist: {
src: ['<banner:meta.banner>', '<config:concat.dist.dest>'],
dest: 'dist/<%= pkg.name %>.min.js'
}
},
qunit: {
files: ['test/**/*.html']
},
lint: {
files: ['grunt.js', 'src/**/*.js', 'test/**/*.js']
},
watch: {
files: '<config:lint.files>',
tasks: 'lint qunit'
},
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
browser: true
},
globals: {
jQuery: true
}
},
uglify: {}
});
// Default task.
grunt.registerTask('default', 'lint qunit concat min');
};
| jhnlsn/jquery-disqus | grunt.js | JavaScript | mit | 1,490 |
define(['../lib/circle', '../lib/aura', './collision', '../lib/vector', '../lib/dictionary'],function(Circle, Aura, collision, Vector, Dictionary){
var Particle = function(world, options) {
var options = options || {}
Circle.call(this, options);
//TODO: implement singleton for the world
this.world = world;
this.mass = this.radius;
// this.energy = 100;
this.speed = options.speed || 3;
// todo: move this somewhere else
this.directions = new Dictionary({
n: new Vector(0, 1),
s: new Vector(0, -1),
e: new Vector(1, 0),
w: new Vector(-1, 0),
ne: new Vector(1, 1),
se: new Vector(1, -1),
nw: new Vector(-1, 1),
sw: new Vector(-1, -1)
});
this.setDirection(options.direction || this.directions.random());
this.aura = new Aura(this);
};
// inheritance
Particle.prototype = Object.create(Circle.prototype);
Particle.prototype.act = function() {
this.move();
};
/**
* Change position of object based on direction
* and speed
*/
Particle.prototype.move = function() {
var pos = this.position.add(new Vector(this.direction.normalize().x * this.speed, this.direction.normalize().y * this.speed));
this.setPosition(pos);
};
/**
* React to collision depending on the type of object
*/
Particle.prototype.reactToCollision = function(other) {
//TODO: fix this
//http://en.wikipedia.org/wiki/Elastic_collision
//http://www.gamasutra.com/view/feature/131424/pool_hall_lessons_fast_accurate_.php?page=3
var n = this.position.sub(other.prevPosition).normalize();
var a1 = this.direction.dot(n);
var a2 = other.prevDirection.dot(n);
var optimizedP = (2 * (a1 - a2)) / (this.mass + other.mass);
var newDir = this.direction.sub(n.mult(optimizedP * other.mass));
// this.setPosition(this.prevPosition);
this.setDirection(newDir);
// this.move();
};
/**
* Needed to keep track of the previous direction
*/
Particle.prototype.setDirection = function(vector){
this.prevDirection = this.direction || vector;
this.direction = vector;
};
/**
* Render
*/
Particle.prototype.render = function(){
this.aura.render();
this.constructor.prototype.render.call(this);
};
Particle.prototype.setPosition = function(pos){
this.prevPosition = this.position || pos;
this.constructor.prototype.setPosition.call(this, pos);
};
return Particle;
}); | dayllanmaza/particles | game/particle.js | JavaScript | mit | 2,363 |
/*
Copyright 2013-2015 ASIAL CORPORATION
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.
*/
import animit from '../../ons/animit';
import SplitterAnimator from './animator.js';
export default class PushSplitterAnimator extends SplitterAnimator {
_getSlidingElements() {
const slidingElements = [this._side, this._content];
if (this._oppositeSide && this._oppositeSide.mode === 'split') {
slidingElements.push(this._oppositeSide);
}
return slidingElements;
}
translate(distance) {
if (!this._slidingElements) {
this._slidingElements = this._getSlidingElements();
}
animit(this._slidingElements)
.queue({
transform: `translate3d(${this.minus + distance}px, 0px, 0px)`
})
.play();
}
/**
* @param {Function} done
*/
open(done) {console.log('opening');
const max = this._side.offsetWidth;
this._slidingElements = this._getSlidingElements();
animit.runAll(
animit(this._slidingElements)
.wait(this.delay)
.queue({
transform: `translate3d(${this.minus + max}px, 0px, 0px)`
}, {
duration: this.duration,
timing: this.timing
})
.queue(callback => {
this._slidingElements = null;
callback();
done && done();
}),
animit(this._mask)
.wait(this.delay)
.queue({
display: 'block'
})
);
}
/**
* @param {Function} done
*/
close(done) {
this._slidingElements = this._getSlidingElements();
animit.runAll(
animit(this._slidingElements)
.wait(this.delay)
.queue({
transform: 'translate3d(0px, 0px, 0px)'
}, {
duration: this.duration,
timing: this.timing
})
.queue(callback => {
this._slidingElements = null;
super.clearTransition();
done && done();
callback();
}),
animit(this._mask)
.wait(this.delay)
.queue({
display: 'none'
})
);
}
}
| nocommon/ecbook_app | www/lib/onsenui/core-src/elements/ons-splitter/push-animator.js | JavaScript | mit | 2,549 |
config.$inject = [ '$stateProvider' ];
function config ($stateProvider) {
$stateProvider
.state('main.admin-dashboard', {
url: '/inicio',
templateUrl: 'templates/components/main/dashboard/admin-dashboard.html',
controller: 'AdminDashboardController as vm',
onEnter: onStateEnter
})
.state('main.student-dashboard', {
url: '/inicio',
templateUrl: 'templates/components/main/dashboard/student-dashboard.html',
controller: 'StudentDashboardController as vm',
onEnter: onStateEnter
})
.state('main.professor-dashboard', {
url: '/inicio',
templateUrl: 'templates/components/main/dashboard/professor-dashboard.html',
controller: 'ProfessorDashboardController as vm',
onEnter: onStateEnter
});
}
const onStateEnter = [ '$rootScope',
rootScope => {
rootScope.viewTitle = "Vinculacion | Inicio";
rootScope.viewStyles = "main dashboard";
}
];
module.exports = config;
| Tribu-Anal/Vinculacion-Front-End | dev/app/components/main/dashboard/dashboard.config.js | JavaScript | mit | 929 |
;modjewel.define("weinre/target/SqlStepper", function(require, exports, module) { // Generated by CoffeeScript 1.3.3
var Binding, SqlStepper, executeSql, ourErrorCallback, runStep;
Binding = require('../common/Binding');
module.exports = SqlStepper = (function() {
function SqlStepper(steps) {
var context;
if (!(this instanceof SqlStepper)) {
return new SqlStepper(steps);
}
this.__context = {};
context = this.__context;
context.steps = steps;
}
SqlStepper.prototype.run = function(db, errorCallback) {
var context;
context = this.__context;
if (context.hasBeenRun) {
throw new Ex(arguments, "stepper has already been run");
}
context.hasBeenRun = true;
context.db = db;
context.errorCallback = errorCallback;
context.nextStep = 0;
context.ourErrorCallback = new Binding(this, ourErrorCallback);
context.runStep = new Binding(this, runStep);
this.executeSql = new Binding(this, executeSql);
return db.transaction(context.runStep);
};
SqlStepper.example = function(db, id) {
var errorCb, step1, step2, stepper;
step1 = function() {
return this.executeSql("SELECT name FROM sqlite_master WHERE type='table'");
};
step2 = function(resultSet) {
var i, name, result, rows;
rows = resultSet.rows;
result = [];
i = 0;
while (i < rows.length) {
name = rows.item(i).name;
if (name === "__WebKitDatabaseInfoTable__") {
i++;
continue;
}
result.push(name);
i++;
}
return console.log(("[" + this.id + "] table names: ") + result.join(", "));
};
errorCb = function(sqlError) {
return console.log(("[" + this.id + "] sql error:" + sqlError.code + ": ") + sqlError.message);
};
stepper = new SqlStepper([step1, step2]);
stepper.id = id;
return stepper.run(db, errorCb);
};
return SqlStepper;
})();
executeSql = function(statement, data) {
var context;
context = this.__context;
return context.tx.executeSql(statement, data, context.runStep, context.ourErrorCallback);
};
ourErrorCallback = function(tx, sqlError) {
var context;
context = this.__context;
return context.errorCallback.call(this, sqlError);
};
runStep = function(tx, resultSet) {
var context, step;
context = this.__context;
if (context.nextStep >= context.steps.length) {
return;
}
context.tx = tx;
context.currentStep = context.nextStep;
context.nextStep++;
step = context.steps[context.currentStep];
return step.call(this, resultSet);
};
require("../common/MethodNamer").setNamesForClass(module.exports);
});
| junlonghuo/ak47 | weinre/web/weinre/target/SqlStepper.amd.js | JavaScript | mit | 2,660 |
import {test} from '../qunit';
import {localeModule} from '../qunit-locale';
import moment from '../../moment';
localeModule('hu');
test('parse', function (assert) {
var tests = 'január jan_február feb_március márc_április ápr_május máj_június jún_július júl_augusztus aug_szeptember szept_október okt_november nov_december dec'.split('_'),
i;
function equalTest(input, mmm, i) {
assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
for (i = 0; i < 12; i++) {
tests[i] = tests[i].split(' ');
equalTest(tests[i][0], 'MMM', i);
equalTest(tests[i][1], 'MMM', i);
equalTest(tests[i][0], 'MMMM', i);
equalTest(tests[i][1], 'MMMM', i);
equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
}
});
test('format', function (assert) {
var a = [
['dddd, MMMM Do YYYY, HH:mm:ss', 'vasárnap, február 14. 2010, 15:25:50'],
['ddd, HH', 'vas, 15'],
['M Mo MM MMMM MMM', '2 2. 02 február feb'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14. 14'],
['d do dddd ddd dd', '0 0. vasárnap vas v'],
['DDD DDDo DDDD', '45 45. 045'],
['w wo ww', '6 6. 06'],
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['[az év] DDDo [napja]', 'az év 45. napja'],
['LTS', '15:25:50'],
['L', '2010.02.14.'],
['LL', '2010. február 14.'],
['LLL', '2010. február 14. 15:25'],
['LLLL', '2010. február 14., vasárnap 15:25'],
['l', '2010.2.14.'],
['ll', '2010. feb 14.'],
['lll', '2010. feb 14. 15:25'],
['llll', '2010. feb 14., vas 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
}
});
test('meridiem', function (assert) {
assert.equal(moment([2011, 2, 23, 0, 0]).format('a'), 'de', 'am');
assert.equal(moment([2011, 2, 23, 11, 59]).format('a'), 'de', 'am');
assert.equal(moment([2011, 2, 23, 12, 0]).format('a'), 'du', 'pm');
assert.equal(moment([2011, 2, 23, 23, 59]).format('a'), 'du', 'pm');
assert.equal(moment([2011, 2, 23, 0, 0]).format('A'), 'DE', 'AM');
assert.equal(moment([2011, 2, 23, 11, 59]).format('A'), 'DE', 'AM');
assert.equal(moment([2011, 2, 23, 12, 0]).format('A'), 'DU', 'PM');
assert.equal(moment([2011, 2, 23, 23, 59]).format('A'), 'DU', 'PM');
});
test('format ordinal', function (assert) {
assert.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
assert.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
assert.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
assert.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
assert.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
assert.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
assert.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
assert.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
assert.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
assert.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
assert.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
assert.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
assert.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
assert.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
assert.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
assert.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
assert.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
assert.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
assert.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
assert.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
assert.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
assert.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
assert.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
assert.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
assert.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
assert.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
assert.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
assert.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
assert.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
assert.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
assert.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
});
test('format month', function (assert) {
var expected = 'január jan_február feb_március márc_április ápr_május máj_június jún_július júl_augusztus aug_szeptember szept_október okt_november nov_december dec'.split('_'),
i;
for (i = 0; i < expected.length; i++) {
assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
});
test('format week', function (assert) {
var expected = 'vasárnap vas_hétfő hét_kedd kedd_szerda sze_csütörtök csüt_péntek pén_szombat szo'.split('_'),
i;
for (i = 0; i < expected.length; i++) {
assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
}
});
test('from', function (assert) {
var start = moment([2007, 1, 28]);
assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'néhány másodperc', '44 másodperc = néhány másodperc');
assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'egy perc', '45 másodperc = egy perc');
assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'egy perc', '89 másodperc = egy perc');
assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 perc', '90 másodperc = 2 perc');
assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 perc', '44 perc = 44 perc');
assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'egy óra', '45 perc = egy óra');
assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'egy óra', '89 perc = egy óra');
assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 óra', '90 perc = 2 óra');
assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 óra', '5 óra = 5 óra');
assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 óra', '21 óra = 21 óra');
assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'egy nap', '22 óra = egy nap');
assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'egy nap', '35 óra = egy nap');
assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 nap', '36 óra = 2 nap');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'egy nap', '1 nap = egy nap');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 nap', '5 nap = 5 nap');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 nap', '25 nap = 25 nap');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'egy hónap', '26 nap = egy hónap');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'egy hónap', '30 nap = egy hónap');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'egy hónap', '45 nap = egy hónap');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 hónap', '46 nap = 2 hónap');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 hónap', '75 nap = 2 hónap');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 hónap', '76 nap = 3 hónap');
assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'egy hónap', '1 hónap = egy hónap');
assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 hónap', '5 hónap = 5 hónap');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'egy év', '345 nap = egy év');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 év', '548 nap = 2 év');
assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'egy év', '1 év = egy év');
assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 év', '5 év = 5 év');
});
test('suffix', function (assert) {
assert.equal(moment(30000).from(0), 'néhány másodperc múlva', 'prefix');
assert.equal(moment(0).from(30000), 'néhány másodperce', 'suffix');
});
test('now from now', function (assert) {
assert.equal(moment().fromNow(), 'néhány másodperce', 'now from now should display as in the past');
});
test('fromNow', function (assert) {
assert.equal(moment().add({s: 30}).fromNow(), 'néhány másodperc múlva', 'néhány másodperc múlva');
assert.equal(moment().add({d: 5}).fromNow(), '5 nap múlva', '5 nap múlva');
});
test('calendar day', function (assert) {
var a = moment().hours(12).minutes(0).seconds(0);
assert.equal(moment(a).calendar(), 'ma 12:00-kor', 'today at the same time');
assert.equal(moment(a).add({m: 25}).calendar(), 'ma 12:25-kor', 'Now plus 25 min');
assert.equal(moment(a).add({h: 1}).calendar(), 'ma 13:00-kor', 'Now plus 1 hour');
assert.equal(moment(a).add({d: 1}).calendar(), 'holnap 12:00-kor', 'tomorrow at the same time');
assert.equal(moment(a).subtract({h: 1}).calendar(), 'ma 11:00-kor', 'Now minus 1 hour');
assert.equal(moment(a).subtract({d: 1}).calendar(), 'tegnap 12:00-kor', 'yesterday at the same time');
});
test('calendar next week', function (assert) {
var i, m, days = 'vasárnap_hétfőn_kedden_szerdán_csütörtökön_pénteken_szombaton'.split('_');
for (i = 2; i < 7; i++) {
m = moment().add({d: i});
assert.equal(m.calendar(), m.format('[' + days[m.day()] + '] LT[-kor]'), 'today + ' + i + ' days current time');
m.hours(0).minutes(0).seconds(0).milliseconds(0);
assert.equal(m.calendar(), m.format('[' + days[m.day()] + '] LT[-kor]'), 'today + ' + i + ' days beginning of day');
m.hours(23).minutes(59).seconds(59).milliseconds(999);
assert.equal(m.calendar(), m.format('[' + days[m.day()] + '] LT[-kor]'), 'today + ' + i + ' days end of day');
}
});
test('calendar last week', function (assert) {
var i, m, days = 'vasárnap_hétfőn_kedden_szerdán_csütörtökön_pénteken_szombaton'.split('_');
for (i = 2; i < 7; i++) {
m = moment().subtract({d: i});
assert.equal(m.calendar(), m.format('[múlt ' + days[m.day()] + '] LT[-kor]'), 'today - ' + i + ' days current time');
m.hours(0).minutes(0).seconds(0).milliseconds(0);
assert.equal(m.calendar(), m.format('[múlt ' + days[m.day()] + '] LT[-kor]'), 'today - ' + i + ' days beginning of day');
m.hours(23).minutes(59).seconds(59).milliseconds(999);
assert.equal(m.calendar(), m.format('[múlt ' + days[m.day()] + '] LT[-kor]'), 'today - ' + i + ' days end of day');
}
});
test('calendar all else', function (assert) {
var weeksAgo = moment().subtract({w: 1}),
weeksFromNow = moment().add({w: 1});
assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), 'egy héte');
assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'egy hét múlva');
weeksAgo = moment().subtract({w: 2});
weeksFromNow = moment().add({w: 2});
assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 hete');
assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '2 hét múlva');
});
test('weeks year starting sunday formatted', function (assert) {
assert.equal(moment([2011, 11, 26]).format('w ww wo'), '52 52 52.', 'Dec 26 2011 should be week 52');
assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52');
assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1');
assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1');
assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2');
});
| Oire/moment | src/test/locale/hu.js | JavaScript | mit | 13,562 |
// Break out the application running from the configuration definition to
// assist with testing.
require(['config'], function() {
// Kick off the application.
require(['app', 'router'], function(app, Router) {
// Define your master router on the application namespace and trigger all
// navigation from this instance.
app.router = new Router();
app.router.bind("all",function(route, router) {
$('#wrap').css('background-image', 'none');
$('.navbar').removeClass('bg').removeClass('bg-black');
$('.footer').removeClass('transparent');
$('.dropdown-menu').removeClass('bg-inverse');
});
// Trigger the initial route and enable HTML5 History API support, set the
// root folder to '/' by default. Change in app.js.
Backbone.history.start();
});
});
| nagyistoce/newedenfaces | app/main.js | JavaScript | mit | 812 |
const dec = () => {};
class Foo {
@dec #x() {}
bar() {
([...this.#x] = this.baz);
}
}
| babel/babel | packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc/setting-private-method-via-rest/input.js | JavaScript | mit | 98 |
(function () {
$(function () {
var _userService = abp.services.app.user;
var _$modal = $('#UserCreateModal');
var _$form = _$modal.find('form');
_$form.validate({
rules: {
Password: "required",
ConfirmPassword: {
equalTo: "#Password"
}
}
});
$('#RefreshButton').click(function () {
refreshUserList();
});
$('.delete-user').click(function () {
var userId = $(this).attr("data-user-id");
var userName = $(this).attr('data-user-name');
deleteUser(userId, userName);
});
$('.edit-user').click(function (e) {
var userId = $(this).attr("data-user-id");
e.preventDefault();
$.ajax({
url: abp.appPath + 'Users/EditUserModal?userId=' + userId,
type: 'POST',
contentType: 'application/html',
success: function (content) {
$('#UserEditModal div.modal-content').html(content);
},
error: function (e) { }
});
});
_$form.find('button[type="submit"]').click(function (e) {
e.preventDefault();
if (!_$form.valid()) {
return;
}
var user = _$form.serializeFormToObject(); //serializeFormToObject is defined in main.js
user.roleNames = [];
var _$roleCheckboxes = $("input[name='role']:checked");
if (_$roleCheckboxes) {
for (var roleIndex = 0; roleIndex < _$roleCheckboxes.length; roleIndex++) {
var _$roleCheckbox = $(_$roleCheckboxes[roleIndex]);
user.roleNames.push(_$roleCheckbox.attr('data-role-name'));
}
}
abp.ui.setBusy(_$modal);
_userService.create(user).done(function () {
_$modal.modal('hide');
location.reload(true); //reload page to see new user!
}).always(function () {
abp.ui.clearBusy(_$modal);
});
});
_$modal.on('shown.bs.modal', function () {
_$modal.find('input:not([type=hidden]):first').focus();
});
function refreshUserList() {
location.reload(true); //reload page to see new user!
}
function deleteUser(userId, userName) {
abp.message.confirm(
"Delete user '" + userName + "'?",
function (isConfirmed) {
if (isConfirmed) {
_userService.delete({
id: userId
}).done(function () {
refreshUserList();
});
}
}
);
}
});
})(); | zchhaenngg/IWI | src/ImproveX.Web/Views/Users/Index.js | JavaScript | mit | 2,949 |
//>>built
define({nomatchMessage:"Die Kennw\u00f6rter stimmen nicht \u00fcberein.",badPasswordMessage:"Ung\u00fcltiges Kennwort."}); | ycabon/presentations | 2020-devsummit/arcgis-js-api-road-ahead/js-api/dojox/form/nls/de/PasswordValidator.js | JavaScript | mit | 132 |
(function(){
if(!window.Prism) {
return;
}
function $$(expr, con) {
return Array.prototype.slice.call((con || document).querySelectorAll(expr));
}
var CRLF = crlf = /\r?\n|\r/g;
function highlightLines(pre, lines, classes) {
var ranges = lines.replace(/\s+/g, '').split(','),
offset = +pre.getAttribute('data-line-offset') || 0;
var lineHeight = parseFloat(getComputedStyle(pre).lineHeight);
for (var i=0, range; range = ranges[i++];) {
range = range.split('-');
var start = +range[0],
end = +range[1] || start;
var line = document.createElement('div');
line.textContent = Array(end - start + 2).join(' \r\n');
line.className = (classes || '') + ' line-highlight';
line.setAttribute('data-start', start);
if(end > start) {
line.setAttribute('data-end', end);
}
line.style.top = (start - offset - 1) * lineHeight + 'px';
(pre.querySelector('code') || pre).appendChild(line);
}
}
function applyHash() {
var hash = location.hash.slice(1);
// Remove pre-existing temporary lines
$$('.temporary.line-highlight').forEach(function (line) {
line.parentNode.removeChild(line);
});
var range = (hash.match(/\.([\d,-]+)$/) || [,''])[1];
if (!range || document.getElementById(hash)) {
return;
}
var id = hash.slice(0, hash.lastIndexOf('.')),
pre = document.getElementById(id);
if (!pre) {
return;
}
if (!pre.hasAttribute('data-line')) {
pre.setAttribute('data-line', '');
}
highlightLines(pre, range, 'temporary ');
document.querySelector('.temporary.line-highlight').scrollIntoView();
}
var fakeTimer = 0; // Hack to limit the number of times applyHash() runs
Prism.hooks.add('after-highlight', function(env) {
var pre = env.element.parentNode;
var lines = pre && pre.getAttribute('data-line');
if (!pre || !lines || !/pre/i.test(pre.nodeName)) {
return;
}
clearTimeout(fakeTimer);
$$('.line-highlight', pre).forEach(function (line) {
line.parentNode.removeChild(line);
});
highlightLines(pre, lines);
fakeTimer = setTimeout(applyHash, 1);
});
addEventListener('hashchange', applyHash);
})(); | inergex/meetups | 2014Q2/bower_components/prismjs/plugins/line-highlight/prism-line-highlight.js | JavaScript | mit | 2,089 |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var path = require("path");
var fs = require("fs");
var minify = require("jsonminify");
var js_beautify = require("js-beautify").js_beautify;
var css_beautify = require("js-beautify").css;
var html_beautify = require("js-beautify").html;
// Older versions of node have `existsSync` in the `path` module, not `fs`. Meh.
fs.existsSync = fs.existsSync || path.existsSync;
path.sep = path.sep || "/";
// The source file to be prettified, original source's path and some options.
var tempPath = process.argv[2] || "";
var filePath = process.argv[3] || "";
var pluginFolder = path.dirname(__dirname);
var sourceFolder = path.dirname(filePath);
var options = { html: {}, css: {}, js: {} };
var jsbeautifyrcPath;
// Try and get some persistent options from the plugin folder.
if (fs.existsSync(jsbeautifyrcPath = pluginFolder + path.sep + ".jsbeautifyrc")) {
setOptions(jsbeautifyrcPath, options);
}
// When a JSBeautify config file exists in the same directory as the source
// file, any directory above, or the user's home folder, then use that
// configuration to overwrite the default prefs.
var sourceFolderParts = path.resolve(sourceFolder).split(path.sep);
var pathsToLook = sourceFolderParts.map(function(value, key) {
return sourceFolderParts.slice(0, key + 1).join(path.sep);
});
// Start with the current directory first, end with the user's home folder.
pathsToLook.reverse();
pathsToLook.push(getUserHome());
pathsToLook.some(function(pathToLook) {
if (fs.existsSync(jsbeautifyrcPath = path.join(pathToLook, ".jsbeautifyrc"))) {
setOptions(jsbeautifyrcPath, options);
return true;
}
});
// Dump some diagnostics messages, parsed out by the plugin.
console.log("Using prettify options: " + JSON.stringify(options, null, 2));
// Read the source file and, when complete, beautify the code.
fs.readFile(tempPath, "utf8", function(err, data) {
if (err) {
return;
}
// Mark the output as being from this plugin.
console.log("*** HTMLPrettify output ***");
if (isCSS(filePath, data)) {
console.log(css_beautify(data, options["css"]));
}
else if (isHTML(filePath, data)) {
console.log(html_beautify(data, options["html"]));
}
else if (isJS(filePath, data)) {
console.log(js_beautify(data, options["js"]));
}
});
// Some handy utility functions.
function isTrue(value) {
return value == "true" || value == true;
}
function getUserHome() {
return process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE;
}
function parseJSON(file) {
try {
return JSON.parse(minify(fs.readFileSync(file, "utf8")));
} catch (e) {
console.log("Could not parse JSON at: " + file);
return {};
}
}
function setOptions(file, optionsStore) {
var obj = parseJSON(file);
for (var key in obj) {
var value = obj[key];
// Options are defined as an object for each format, with keys as prefs.
if (key != "html" && key != "css" && key != "js") {
continue;
}
for (var pref in value) {
// Special case "true" and "false" pref values as actually booleans.
// This avoids common accidents in .jsbeautifyrc json files.
if (value == "true" || value == "false") {
optionsStore[key][pref] = isTrue(value[pref]);
} else {
optionsStore[key][pref] = value[pref];
}
}
}
}
// Checks if a file type is allowed by regexing the file name and expecting a
// certain extension loaded from the settings file.
function isTypeAllowed(type, path) {
var allowedFileExtensions = options[type]["allowed_file_extensions"] || {
"html": ["htm", "html", "xhtml", "shtml", "xml", "svg"],
"css": ["css", "scss", "sass", "less"],
"js": ["js", "json", "jshintrc", "jsbeautifyrc"]
}[type];
for (var i = 0, len = allowedFileExtensions.length; i < len; i++) {
if (path.match(new RegExp("\\." + allowedFileExtensions[i] + "$"))) {
return true;
}
}
return false;
}
function isCSS(path, data) {
// If file unsaved, there's no good way to determine whether or not it's
// CSS based on the file contents.
if (path == "?") {
return false;
}
return isTypeAllowed("css", path);
}
function isHTML(path, data) {
// If file unsaved, check if first non-whitespace character is <
if (path == "?") {
return data.match(/^\s*</);
}
return isTypeAllowed("html", path);
}
function isJS(path, data) {
// If file unsaved, check if first non-whitespace character is NOT <
if (path == "?") {
return !data.match(/^\s*</);
}
return isTypeAllowed("js", path);
}
| micahwood/linux-dotfiles | sublime/Packages/HTML-CSS-JS Prettify/scripts/run.js | JavaScript | mit | 4,755 |
module.exports = {
ignorePatterns: ['bin', 'commitlint.config.js'],
extends: [
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.json', './test/tsconfig.json'],
tsconfigRootDir: './',
},
plugins: ['@typescript-eslint', 'prettier'],
rules: {
'arrow-body-style': ['warn', 'as-needed'],
'react/jsx-one-expression-per-line': 'off',
'react/jsx-wrap-multilines': 'off',
'no-param-reassign': ['error', { props: false }],
'import/prefer-default-export': 'off',
curly: ['error', 'all'],
'eol-last': ['error', 'always'],
'no-debugger': 'error',
'import/no-unresolved': 'off',
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/member-delimiter-style': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
}
| HospitalRun/hospitalrun-server | .eslintrc.js | JavaScript | mit | 1,063 |
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import _extends from "@babel/runtime/helpers/esm/extends";
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import { deepmerge } from '@material-ui/utils';
import { unstable_composeClasses as composeClasses } from '@material-ui/unstyled';
import Modal from '../Modal';
import Slide from '../Slide';
import Paper from '../Paper';
import capitalize from '../utils/capitalize';
import { duration } from '../styles/transitions';
import useTheme from '../styles/useTheme';
import useThemeProps from '../styles/useThemeProps';
import experimentalStyled from '../styles/experimentalStyled';
import drawerClasses, { getDrawerUtilityClass } from './drawerClasses';
const overridesResolver = (props, styles) => {
const {
styleProps
} = props;
return deepmerge(_extends({}, (styleProps.variant === 'permanent' || styleProps.variant === 'persistent') && styles.docked, styles.modal, {
[`& .${drawerClasses.paper}`]: _extends({}, styles.paper, styles[`paperAnchor${capitalize(styleProps.anchor)}`], styleProps.variant !== 'temporary' && styles[`paperAnchorDocked${capitalize(styleProps.anchor)}`])
}), styles.root || {});
};
const useUtilityClasses = styleProps => {
const {
classes,
anchor,
variant
} = styleProps;
const slots = {
root: ['root'],
docked: [(variant === 'permanent' || variant === 'persistent') && 'docked'],
modal: ['modal'],
paper: ['paper', `paperAnchor${capitalize(anchor)}`, variant !== 'temporary' && `paperAnchorDocked${capitalize(anchor)}`]
};
return composeClasses(slots, getDrawerUtilityClass, classes);
};
const DrawerRoot = experimentalStyled(Modal, {}, {
name: 'MuiDrawer',
slot: 'Root',
overridesResolver
})({});
const DrawerDockedRoot = experimentalStyled('div', {}, {
name: 'MuiDrawer',
slot: 'Docked',
overridesResolver
})({
/* Styles applied to the root element if `variant="permanent or persistent"`. */
flex: '0 0 auto'
});
const DrawerPaper = experimentalStyled(Paper, {}, {
name: 'MuiDrawer',
slot: 'Paper'
})(({
theme,
styleProps
}) => _extends({
/* Styles applied to the Paper component. */
overflowY: 'auto',
display: 'flex',
flexDirection: 'column',
height: '100%',
flex: '1 0 auto',
zIndex: theme.zIndex.drawer,
WebkitOverflowScrolling: 'touch',
// Add iOS momentum scrolling.
// temporary style
position: 'fixed',
top: 0,
// We disable the focus ring for mouse, touch and keyboard users.
// At some point, it would be better to keep it for keyboard users.
// :focus-ring CSS pseudo-class will help.
outline: 0
}, styleProps.anchor === 'left' && {
/* Styles applied to the Paper component if `anchor="left"`. */
left: 0,
right: 'auto'
}, styleProps.anchor === 'top' && {
/* Styles applied to the Paper component if `anchor="top"`. */
top: 0,
left: 0,
bottom: 'auto',
right: 0,
height: 'auto',
maxHeight: '100%'
}, styleProps.anchor === 'right' && {
/* Styles applied to the Paper component if `anchor="right"`. */
left: 'auto',
right: 0
}, styleProps.anchor === 'bottom' && {
/* Styles applied to the Paper component if `anchor="bottom"`. */
top: 'auto',
left: 0,
bottom: 0,
right: 0,
height: 'auto',
maxHeight: '100%'
}, styleProps.anchor === 'left' && styleProps.variant !== 'temporary' && {
/* Styles applied to the Paper component if `anchor="left"` and `variant` is not "temporary". */
borderRight: `1px solid ${theme.palette.divider}`
}, styleProps.anchor === 'top' && styleProps.variant !== 'temporary' && {
/* Styles applied to the Paper component if `anchor="top"` and `variant` is not "temporary". */
borderBottom: `1px solid ${theme.palette.divider}`
}, styleProps.anchor === 'right' && styleProps.variant !== 'temporary' && {
/* Styles applied to the Paper component if `anchor="right"` and `variant` is not "temporary". */
borderLeft: `1px solid ${theme.palette.divider}`
}, styleProps.anchor === 'bottom' && styleProps.variant !== 'temporary' && {
/* Styles applied to the Paper component if `anchor="bottom"` and `variant` is not "temporary". */
borderTop: `1px solid ${theme.palette.divider}`
}));
const oppositeDirection = {
left: 'right',
right: 'left',
top: 'down',
bottom: 'up'
};
export function isHorizontal(anchor) {
return ['left', 'right'].indexOf(anchor) !== -1;
}
export function getAnchor(theme, anchor) {
return theme.direction === 'rtl' && isHorizontal(anchor) ? oppositeDirection[anchor] : anchor;
}
const defaultTransitionDuration = {
enter: duration.enteringScreen,
exit: duration.leavingScreen
};
/**
* The props of the [Modal](/api/modal/) component are available
* when `variant="temporary"` is set.
*/
const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
const props = useThemeProps({
props: inProps,
name: 'MuiDrawer'
});
const {
anchor: anchorProp = 'left',
BackdropProps,
children,
className,
elevation = 16,
ModalProps: {
BackdropProps: BackdropPropsProp
} = {},
onClose,
open = false,
PaperProps = {},
SlideProps,
// eslint-disable-next-line react/prop-types
TransitionComponent = Slide,
transitionDuration = defaultTransitionDuration,
variant = 'temporary'
} = props,
ModalProps = _objectWithoutPropertiesLoose(props.ModalProps, ["BackdropProps"]),
other = _objectWithoutPropertiesLoose(props, ["anchor", "BackdropProps", "children", "className", "elevation", "ModalProps", "onClose", "open", "PaperProps", "SlideProps", "TransitionComponent", "transitionDuration", "variant"]);
const theme = useTheme(); // Let's assume that the Drawer will always be rendered on user space.
// We use this state is order to skip the appear transition during the
// initial mount of the component.
const mounted = React.useRef(false);
React.useEffect(() => {
mounted.current = true;
}, []);
const anchor = getAnchor(theme, anchorProp);
const styleProps = _extends({}, props, {
anchor,
elevation,
open,
variant
}, other);
const classes = useUtilityClasses(styleProps);
const drawer = /*#__PURE__*/React.createElement(DrawerPaper, _extends({
elevation: variant === 'temporary' ? elevation : 0,
square: true
}, PaperProps, {
className: clsx(classes.paper, PaperProps.className),
styleProps: styleProps
}), children);
if (variant === 'permanent') {
return /*#__PURE__*/React.createElement(DrawerDockedRoot, _extends({
className: clsx(classes.root, classes.docked, className),
styleProps: styleProps,
ref: ref
}, other), drawer);
}
const slidingDrawer = /*#__PURE__*/React.createElement(TransitionComponent, _extends({
in: open,
direction: oppositeDirection[anchor],
timeout: transitionDuration,
appear: mounted.current
}, SlideProps), drawer);
if (variant === 'persistent') {
return /*#__PURE__*/React.createElement(DrawerDockedRoot, _extends({
className: clsx(classes.root, classes.docked, className),
styleProps: styleProps,
ref: ref
}, other), slidingDrawer);
} // variant === temporary
return /*#__PURE__*/React.createElement(DrawerRoot, _extends({
BackdropProps: _extends({}, BackdropProps, BackdropPropsProp, {
transitionDuration
}),
className: clsx(classes.root, classes.modal, className),
open: open,
styleProps: styleProps,
onClose: onClose,
ref: ref
}, other, ModalProps), slidingDrawer);
});
process.env.NODE_ENV !== "production" ? Drawer.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* Side from which the drawer will appear.
* @default 'left'
*/
anchor: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
/**
* @ignore
*/
BackdropProps: PropTypes.object,
/**
* The content of the component.
*/
children: PropTypes.node,
/**
* Override or extend the styles applied to the component.
*/
classes: PropTypes.object,
/**
* @ignore
*/
className: PropTypes.string,
/**
* The elevation of the drawer.
* @default 16
*/
elevation: PropTypes.number,
/**
* Props applied to the [`Modal`](/api/modal/) element.
* @default {}
*/
ModalProps: PropTypes.object,
/**
* Callback fired when the component requests to be closed.
*
* @param {object} event The event source of the callback.
*/
onClose: PropTypes.func,
/**
* If `true`, the component is shown.
* @default false
*/
open: PropTypes.bool,
/**
* Props applied to the [`Paper`](/api/paper/) element.
* @default {}
*/
PaperProps: PropTypes.object,
/**
* Props applied to the [`Slide`](/api/slide/) element.
*/
SlideProps: PropTypes.object,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: PropTypes.object,
/**
* The duration for the transition, in milliseconds.
* You may specify a single timeout for all transitions, or individually with an object.
* @default { enter: duration.enteringScreen, exit: duration.leavingScreen }
*/
transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
appear: PropTypes.number,
enter: PropTypes.number,
exit: PropTypes.number
})]),
/**
* The variant to use.
* @default 'temporary'
*/
variant: PropTypes.oneOf(['permanent', 'persistent', 'temporary'])
} : void 0;
export default Drawer; | cdnjs/cdnjs | ajax/libs/material-ui/5.0.0-alpha.27/modern/Drawer/Drawer.js | JavaScript | mit | 9,817 |
/**
* simple
*/
var mysinleton = {
property1 : 'something',
property2 : 'something else',
method1 : function() {
console.log("hello world");
}
}
/***
* encapsulation like java get、set
*/
var mysinleton2 = function() {
var privateVariable = 'something private';
function showPrivate() {
console.log(privateVariable);
}
return {
publicMethod : function(){
showPrivate();
},
publicVar : "this is a public variable"
}
}
var mysinletonInstance = new mysinleton2();
mysinletonInstance.publicMethod();
console.log(mysinletonInstance.publicVar);
/***
*
* singleton realize
*/
var Mysingleton = (function(){
var _intstance ;
function getInstance() {
return _intstance;
};
function init() {
return {
publicMethod : function() {
console.log("this is public method");
},
publicProperty : 'test'
}
};
return {
getInstance : function() {
if(_intstance) {
return _intstance;
}else {
_intstance = init();
return _intstance;
}
}
}
})();
Mysingleton.getInstance().publicMethod();
var SingletonTester = (function () {
//参数:传递给单例的一个参数集合
function Singleton(args) {
//设置args变量为接收的参数或者为空(如果没有提供的话)
var args = args || {};
//设置name参数
this.name = 'SingletonTester';
//设置pointX的值
this.pointX = args.pointX || 6; //从接收的参数里获取,或者设置为默认值
//设置pointY的值
this.pointY = args.pointY || 10;
}
//实例容器
var instance;
var _static = {
name: 'SingletonTester',
//获取实例的方法
//返回Singleton的实例
getInstance: function (args) {
if (instance === undefined) {
instance = new Singleton(args);
}
return instance;
}
};
return _static;
})();
var singletonTest = SingletonTester.getInstance({ pointX: 5 });
console.log(singletonTest.pointX); // 输出 5 | tianzx/design-patterns | js/app/singleton/singleton.js | JavaScript | mit | 2,161 |
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @emails oncall+relay
* @flow strict-local
* @format
*/
// flowlint ambiguous-object-type:error
'use strict';
const useRelayEnvironment = require('./useRelayEnvironment');
const warning = require('warning');
const {getFragmentResourceForEnvironment} = require('./FragmentResource');
const {useEffect, useRef, useState} = require('react');
const {getFragmentIdentifier} = require('relay-runtime');
import type {ReaderFragment} from 'relay-runtime';
type ReturnType<TFragmentData: mixed> = {|
data: TFragmentData,
disableStoreUpdates: () => void,
enableStoreUpdates: () => void,
shouldUpdateGeneration: number | null,
|};
function useFragmentNode<TFragmentData: mixed>(
fragmentNode: ReaderFragment,
fragmentRef: mixed,
componentDisplayName: string,
): ReturnType<TFragmentData> {
const environment = useRelayEnvironment();
const FragmentResource = getFragmentResourceForEnvironment(environment);
const isMountedRef = useRef(false);
const [, forceUpdate] = useState(0);
const fragmentIdentifier = getFragmentIdentifier(fragmentNode, fragmentRef);
// The values of these React refs are counters that should be incremented
// under their respective conditions. This allows us to use the counters as
// memoization values to indicate if computations for useMemo or useEffect
// should be re-executed.
const mustResubscribeGenerationRef = useRef(0);
const shouldUpdateGenerationRef = useRef(0);
const environmentChanged = useHasChanged(environment);
const fragmentIdentifierChanged = useHasChanged(fragmentIdentifier);
// If the fragment identifier changes, it means that the variables on the
// fragment owner changed, or the fragment ref points to different records.
// In this case, we need to resubscribe to the Relay store.
const mustResubscribe = environmentChanged || fragmentIdentifierChanged;
// We only want to update the component consuming this fragment under the
// following circumstances:
// - We receive an update from the Relay store, indicating that the data
// the component is directly subscribed to has changed.
// - We need to subscribe and render /different/ data (i.e. the fragment refs
// now point to different records, or the context changed).
// Note that even if identity of the fragment ref objects changes, we
// don't consider them as different unless they point to a different data ID.
//
// This prevents unnecessary updates when a parent re-renders this component
// with the same props, which is a common case when the parent updates due
// to change in the data /it/ is subscribed to, but which doesn't affect the
// child.
if (mustResubscribe) {
shouldUpdateGenerationRef.current++;
mustResubscribeGenerationRef.current++;
}
// Read fragment data; this might suspend.
const fragmentResult = FragmentResource.readWithIdentifier(
fragmentNode,
fragmentRef,
fragmentIdentifier,
componentDisplayName,
);
const isListeningForUpdatesRef = useRef(true);
function enableStoreUpdates() {
isListeningForUpdatesRef.current = true;
const didMissUpdates = FragmentResource.checkMissedUpdates(
fragmentResult,
)[0];
if (didMissUpdates) {
handleDataUpdate();
}
}
function disableStoreUpdates() {
isListeningForUpdatesRef.current = false;
}
function handleDataUpdate() {
if (
isMountedRef.current === false ||
isListeningForUpdatesRef.current === false
) {
return;
}
// If we receive an update from the Relay store, we need to make sure the
// consuming component updates.
shouldUpdateGenerationRef.current++;
// React bails out on noop state updates as an optimization.
// If we want to force an update via setState, we need to pass an value.
// The actual value can be arbitrary though, e.g. an incremented number.
forceUpdate(count => count + 1);
}
// Establish Relay store subscriptions in the commit phase, only if
// rendering for the first time, or if we need to subscribe to new data
useEffect(() => {
isMountedRef.current = true;
const disposable = FragmentResource.subscribe(
fragmentResult,
handleDataUpdate,
);
return () => {
// When unmounting or resubscribing to new data, clean up current
// subscription. This will also make sure fragment data is no longer
// cached for the so next time it its read, it will be read fresh from the
// Relay store
isMountedRef.current = false;
disposable.dispose();
};
// NOTE: We disable react-hooks-deps warning because mustResubscribeGenerationRef
// is capturing all information about whether the effect should be re-ran.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [mustResubscribeGenerationRef.current]);
if (__DEV__) {
if (fragmentRef != null && fragmentResult.data == null) {
warning(
false,
'Relay: Expected to have been able to read non-null data for ' +
'fragment `%s` declared in ' +
'`%s`, since fragment reference was non-null. ' +
"Make sure that that `%s`'s parent isn't " +
'holding on to and/or passing a fragment reference for data that ' +
'has been deleted.',
fragmentNode.name,
componentDisplayName,
componentDisplayName,
);
}
}
return {
// $FlowFixMe
data: fragmentResult.data,
disableStoreUpdates,
enableStoreUpdates,
shouldUpdateGeneration: shouldUpdateGenerationRef.current,
};
}
function useHasChanged(value: mixed): boolean {
const [mirroredValue, setMirroredValue] = useState(value);
const valueChanged = mirroredValue !== value;
if (valueChanged) {
setMirroredValue(value);
}
return valueChanged;
}
module.exports = useFragmentNode;
| iamchenxin/relay | packages/relay-experimental/useFragmentNode.js | JavaScript | mit | 6,025 |
/**
* @providesModule Fabric
*/
'use strict';
module.exports.Crashlytics = require('./Crashlytics');
module.exports.Answers = require('./Answers');
| lrettig/react-native-fabric | index.js | JavaScript | mit | 150 |
'use strict';
describe('LoginController', function () {
// Load the parent app
beforeEach(module('demoSite'));
var $controller;
var $scope, controller, $window;
beforeEach(inject(function (_$controller_) {
$controller = _$controller_;
$scope = {};
$window = { location: {}, open: function () { } };
controller = $controller('LoginController', { $scope: $scope, $window: $window });
}));
describe('isTapIn variable', function () {
it('is true by default', function () {
expect($scope.isTapIn).toBe(true);
});
it('is true if that value is passed to initiateLogin', function () {
$scope.initiateLogin(true);
expect($scope.isTapIn).toBe(true);
});
it('is false if that value is passed to initiateLogin', function () {
$scope.initiateLogin(false);
expect($scope.isTapIn).toBe(false);
});
});
describe('popup creation', function () {
it('should pop up a new window when a new login is initiated', function () {
spyOn($window, 'open');
$scope.initiateLogin(true);
expect($window.open).toHaveBeenCalled();
})
})
describe('error message framework', function () {
it('should convert error codes to friendly messages', function () {
expect($scope.showError).toBe(false);
// Loop through each property in the errorMessages object and check that it is displayed properly.
for (var property in $scope.errorMessages) {
if ($scope.errorMessages.hasOwnProperty(property)) {
$scope.showErrorFromCode(property);
expect($scope.errorMessage).toBe($scope.errorMessages[property]);
expect($scope.showError).toBe(true);
}
}
});
it('should handle lack of connection to the server', function () {
expect($scope.showError).toBe(false);
$scope.handleGetURLError();
expect($scope.errorMessage).toBe($scope.errorMessages["no_connection"]);
expect($scope.showError).toBe(true);
});
it('should hide any errors when a new login is initiated', function () {
$scope.showError = true;
$scope.initiateLogin(true);
expect($scope.showError).toBe(false);
})
});
describe('polling framework', function () {
beforeEach(function () {
// Because the framework utilizes a popup, these variables are NOT inside the controller.
dataHasReturned = false;
returnedData = new Object();
});
it('should handle manually closing of the popup window', function () {
$scope.popupWindow = window.open();
$scope.popupWindow.close();
$scope.pollPopupForCompletedAuth();
expect(dataHasReturned).toBe(false);
});
it('should present an error if one comes back from the server', function () {
dataHasReturned = true;
returnedData.error = "access_denied";
expect($scope.showError).toBe(false);
$scope.pollPopupForCompletedAuth();
expect($scope.showError).toBe(true);
expect(dataHasReturned).toBe(false);
});
it('should redirect the user to the auth page when proper data has returned', function () {
dataHasReturned = true;
returnedData = {
subject: "1111-2222-3333-4444",
username: "Test User",
email: "[email protected]",
details: "Tech+Details"
};
$scope.pollPopupForCompletedAuth();
expect($window.location.href).toBe('/#/auth');
});
})
}); | privakey/privakey-nodejs | sample/assets/js/angular/login/login.module.spec.js | JavaScript | mit | 3,904 |
/* =========================================================
* bootstrap-datepicker.js
* http://www.eyecon.ro/bootstrap-datepicker
* =========================================================
* Copyright 2012 Stefan Petre
* Improvements by Andrew Rowls
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================= */
(function ($) {
var $window = $(window);
function UTCDate() {
return new Date(Date.UTC.apply(Date, arguments));
}
function UTCToday() {
var today = new Date();
return UTCDate(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate());
}
// Picker object
var Datepicker = function (element, options) {
var that = this;
this._process_options(options);
this.element = $(element);
this.isInline = false;
this.isInput = this.element.is('input');
this.component = this.element.is('.date') ? this.element.find('.add-on, .btn') : false;
this.hasInput = this.component && this.element.find('input').length;
if (this.component && this.component.length === 0)
this.component = false;
this.picker = $(DPGlobal.template);
this._buildEvents();
this._attachEvents();
if (this.isInline) {
this.picker.addClass('datepicker-inline').appendTo(this.element);
} else {
this.picker.addClass('datepicker-dropdown dropdown-menu');
}
if (this.o.rtl) {
this.picker.addClass('datepicker-rtl');
this.picker.find('.prev i, .next i')
.toggleClass('icon-arrow-left icon-arrow-right');
}
this.viewMode = this.o.startView;
if (this.o.calendarWeeks)
this.picker.find('tfoot th.today')
.attr('colspan', function (i, val) {
return parseInt(val) + 1;
});
this._allow_update = false;
this.setStartDate(this._o.startDate);
this.setEndDate(this._o.endDate);
this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled);
this.fillDow();
this.fillMonths();
this._allow_update = true;
this.update();
this.showMode();
if (this.isInline) {
this.show();
}
};
Datepicker.prototype = {
constructor: Datepicker,
_process_options: function (opts) {
// Store raw options for reference
this._o = $.extend({}, this._o, opts);
// Processed options
var o = this.o = $.extend({}, this._o);
// Check if "de-DE" style date is available, if not language should
// fallback to 2 letter code eg "de"
var lang = o.language;
if (!dates[lang]) {
lang = lang.split('-')[0];
if (!dates[lang])
lang = defaults.language;
}
o.language = lang;
switch (o.startView) {
case 2:
case 'decade':
o.startView = 2;
break;
case 1:
case 'year':
o.startView = 1;
break;
default:
o.startView = 0;
}
switch (o.minViewMode) {
case 1:
case 'months':
o.minViewMode = 1;
break;
case 2:
case 'years':
o.minViewMode = 2;
break;
default:
o.minViewMode = 0;
}
o.startView = Math.max(o.startView, o.minViewMode);
o.weekStart %= 7;
o.weekEnd = ((o.weekStart + 6) % 7);
var format = DPGlobal.parseFormat(o.format);
if (o.startDate !== -Infinity) {
if (!!o.startDate) {
if (o.startDate instanceof Date)
o.startDate = this._local_to_utc(this._zero_time(o.startDate));
else
o.startDate = DPGlobal.parseDate(o.startDate, format, o.language);
} else {
o.startDate = -Infinity;
}
}
if (o.endDate !== Infinity) {
if (!!o.endDate) {
if (o.endDate instanceof Date)
o.endDate = this._local_to_utc(this._zero_time(o.endDate));
else
o.endDate = DPGlobal.parseDate(o.endDate, format, o.language);
} else {
o.endDate = Infinity;
}
}
o.daysOfWeekDisabled = o.daysOfWeekDisabled || [];
if (!$.isArray(o.daysOfWeekDisabled))
o.daysOfWeekDisabled = o.daysOfWeekDisabled.split(/[,\s]*/);
o.daysOfWeekDisabled = $.map(o.daysOfWeekDisabled, function (d) {
return parseInt(d, 10);
});
var plc = String(o.orientation).toLowerCase().split(/\s+/g),
_plc = o.orientation.toLowerCase();
plc = $.grep(plc, function (word) {
return (/^auto|left|right|top|bottom$/).test(word);
});
o.orientation = { x: 'auto', y: 'auto' };
if (!_plc || _plc === 'auto')
; // no action
else if (plc.length === 1) {
switch (plc[0]) {
case 'top':
case 'bottom':
o.orientation.y = plc[0];
break;
case 'left':
case 'right':
o.orientation.x = plc[0];
break;
}
}
else {
_plc = $.grep(plc, function (word) {
return (/^left|right$/).test(word);
});
o.orientation.x = _plc[0] || 'auto';
_plc = $.grep(plc, function (word) {
return (/^top|bottom$/).test(word);
});
o.orientation.y = _plc[0] || 'auto';
}
},
_events: [],
_secondaryEvents: [],
_applyEvents: function (evs) {
for (var i = 0, el, ev; i < evs.length; i++) {
el = evs[i][0];
ev = evs[i][1];
el.on(ev);
}
},
_unapplyEvents: function (evs) {
for (var i = 0, el, ev; i < evs.length; i++) {
el = evs[i][0];
ev = evs[i][1];
el.off(ev);
}
},
_buildEvents: function () {
if (this.isInput) { // single input
this._events = [
[this.element, {
focus: $.proxy(this.show, this),
keyup: $.proxy(this.update, this),
keydown: $.proxy(this.keydown, this)
}]
];
}
else if (this.component && this.hasInput) { // component: input + button
this._events = [
// For components that are not readonly, allow keyboard nav
[this.element.find('input'), {
focus: $.proxy(this.show, this),
keyup: $.proxy(this.update, this),
keydown: $.proxy(this.keydown, this)
}],
[this.component, {
click: $.proxy(this.show, this)
}]
];
}
else if (this.element.is('div')) { // inline datepicker
this.isInline = true;
}
else {
this._events = [
[this.element, {
click: $.proxy(this.show, this)
}]
];
}
this._secondaryEvents = [
[this.picker, {
click: $.proxy(this.click, this)
}],
[$(window), {
resize: $.proxy(this.place, this)
}],
[$(document), {
mousedown: $.proxy(function (e) {
// Clicked outside the datepicker, hide it
if (!(
this.element.is(e.target) ||
this.element.find(e.target).length ||
this.picker.is(e.target) ||
this.picker.find(e.target).length
)) {
this.hide();
}
}, this)
}]
];
},
_attachEvents: function () {
this._detachEvents();
this._applyEvents(this._events);
},
_detachEvents: function () {
this._unapplyEvents(this._events);
},
_attachSecondaryEvents: function () {
this._detachSecondaryEvents();
this._applyEvents(this._secondaryEvents);
},
_detachSecondaryEvents: function () {
this._unapplyEvents(this._secondaryEvents);
},
_trigger: function (event, altdate) {
var date = altdate || this.date,
local_date = this._utc_to_local(date);
this.element.trigger({
type: event,
date: local_date,
format: $.proxy(function (altformat) {
var format = altformat || this.o.format;
return DPGlobal.formatDate(date, format, this.o.language);
}, this)
});
},
show: function (e) {
if (!this.isInline)
this.picker.appendTo('body');
this.picker.show();
this.height = this.component ? this.component.outerHeight() : this.element.outerHeight();
this.place();
this._attachSecondaryEvents();
if (e) {
e.preventDefault();
}
this._trigger('show');
},
hide: function (e) {
if (this.isInline) return;
if (!this.picker.is(':visible')) return;
this.picker.hide().detach();
this._detachSecondaryEvents();
this.viewMode = this.o.startView;
this.showMode();
if (
this.o.forceParse &&
(
this.isInput && this.element.val() ||
this.hasInput && this.element.find('input').val()
)
)
this.setValue();
this._trigger('hide');
},
remove: function () {
this.hide();
this._detachEvents();
this._detachSecondaryEvents();
this.picker.remove();
delete this.element.data().datepicker;
if (!this.isInput) {
delete this.element.data().date;
}
},
_utc_to_local: function (utc) {
return new Date(utc.getTime() + (utc.getTimezoneOffset() * 60000));
},
_local_to_utc: function (local) {
return new Date(local.getTime() - (local.getTimezoneOffset() * 60000));
},
_zero_time: function (local) {
return new Date(local.getFullYear(), local.getMonth(), local.getDate());
},
_zero_utc_time: function (utc) {
return new Date(Date.UTC(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate()));
},
getDate: function () {
return this._utc_to_local(this.getUTCDate());
},
getUTCDate: function () {
return this.date;
},
setDate: function (d) {
this.setUTCDate(this._local_to_utc(d));
},
setUTCDate: function (d) {
this.date = d;
this.setValue();
},
setValue: function () {
var formatted = this.getFormattedDate();
if (!this.isInput) {
if (this.component) {
this.element.find('input').val(formatted).change();
}
} else {
this.element.val(formatted).change();
}
},
getFormattedDate: function (format) {
if (format === undefined)
format = this.o.format;
return DPGlobal.formatDate(this.date, format, this.o.language);
},
setStartDate: function (startDate) {
this._process_options({ startDate: startDate });
this.update();
this.updateNavArrows();
},
setEndDate: function (endDate) {
this._process_options({ endDate: endDate });
this.update();
this.updateNavArrows();
},
setDaysOfWeekDisabled: function (daysOfWeekDisabled) {
this._process_options({ daysOfWeekDisabled: daysOfWeekDisabled });
this.update();
this.updateNavArrows();
},
place: function () {
if (this.isInline) return;
var calendarWidth = this.picker.outerWidth(),
calendarHeight = this.picker.outerHeight(),
visualPadding = 10,
windowWidth = $window.width(),
windowHeight = $window.height(),
scrollTop = $window.scrollTop();
var zIndex = parseInt(this.element.parents().filter(function () {
return $(this).css('z-index') != 'auto';
}).first().css('z-index')) + 10;
var offset = this.component ? this.component.parent().offset() : this.element.offset();
var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(false);
var width = this.component ? this.component.outerWidth(true) : this.element.outerWidth(false);
var left = offset.left,
top = offset.top;
this.picker.removeClass(
'datepicker-orient-top datepicker-orient-bottom ' +
'datepicker-orient-right datepicker-orient-left'
);
if (this.o.orientation.x !== 'auto') {
this.picker.addClass('datepicker-orient-' + this.o.orientation.x);
if (this.o.orientation.x === 'right')
left -= calendarWidth - width;
}
// auto x orientation is best-placement: if it crosses a window
// edge, fudge it sideways
else {
// Default to left
this.picker.addClass('datepicker-orient-left');
if (offset.left < 0)
left -= offset.left - visualPadding;
else if (offset.left + calendarWidth > windowWidth)
left = windowWidth - calendarWidth - visualPadding;
}
// auto y orientation is best-situation: top or bottom, no fudging,
// decision based on which shows more of the calendar
var yorient = this.o.orientation.y,
top_overflow, bottom_overflow;
if (yorient === 'auto') {
top_overflow = -scrollTop + offset.top - calendarHeight;
bottom_overflow = scrollTop + windowHeight - (offset.top + height + calendarHeight);
if (Math.max(top_overflow, bottom_overflow) === bottom_overflow)
yorient = 'top';
else
yorient = 'bottom';
}
this.picker.addClass('datepicker-orient-' + yorient);
if (yorient === 'top')
top += height;
else
top -= calendarHeight + parseInt(this.picker.css('padding-top'));
this.picker.css({
top: top,
left: left,
zIndex: zIndex
});
},
_allow_update: true,
update: function () {
if (!this._allow_update) return;
var oldDate = new Date(this.date),
date, fromArgs = false;
if (arguments && arguments.length && (typeof arguments[0] === 'string' || arguments[0] instanceof Date)) {
date = arguments[0];
if (date instanceof Date)
date = this._local_to_utc(date);
fromArgs = true;
} else {
date = this.isInput ? this.element.val() : this.element.data('date') || this.element.find('input').val();
delete this.element.data().date;
}
this.date = DPGlobal.parseDate(date, this.o.format, this.o.language);
if (fromArgs) {
// setting date by clicking
this.setValue();
} else if (date) {
// setting date by typing
if (oldDate.getTime() !== this.date.getTime())
this._trigger('changeDate');
} else {
// clearing date
this._trigger('clearDate');
}
if (this.date < this.o.startDate) {
this.viewDate = new Date(this.o.startDate);
this.date = new Date(this.o.startDate);
} else if (this.date > this.o.endDate) {
this.viewDate = new Date(this.o.endDate);
this.date = new Date(this.o.endDate);
} else {
this.viewDate = new Date(this.date);
this.date = new Date(this.date);
}
this.fill();
},
fillDow: function () {
var dowCnt = this.o.weekStart,
html = '<tr>';
if (this.o.calendarWeeks) {
var cell = '<th class="cw"> </th>';
html += cell;
this.picker.find('.datepicker-days thead tr:first-child').prepend(cell);
}
while (dowCnt < this.o.weekStart + 7) {
html += '<th class="dow">' + dates[this.o.language].daysMin[(dowCnt++) % 7] + '</th>';
}
html += '</tr>';
this.picker.find('.datepicker-days thead').append(html);
},
fillMonths: function () {
var html = '',
i = 0;
while (i < 12) {
html += '<span class="month">' + dates[this.o.language].monthsShort[i++] + '</span>';
}
this.picker.find('.datepicker-months td').html(html);
},
setRange: function (range) {
if (!range || !range.length)
delete this.range;
else
this.range = $.map(range, function (d) { return d.valueOf(); });
this.fill();
},
getClassNames: function (date) {
var cls = [],
year = this.viewDate.getUTCFullYear(),
month = this.viewDate.getUTCMonth(),
currentDate = this.date.valueOf(),
today = new Date();
if (date.getUTCFullYear() < year || (date.getUTCFullYear() == year && date.getUTCMonth() < month)) {
cls.push('old');
} else if (date.getUTCFullYear() > year || (date.getUTCFullYear() == year && date.getUTCMonth() > month)) {
cls.push('new');
}
// Compare internal UTC date with local today, not UTC today
if (this.o.todayHighlight &&
date.getUTCFullYear() == today.getFullYear() &&
date.getUTCMonth() == today.getMonth() &&
date.getUTCDate() == today.getDate()) {
cls.push('today');
}
if (currentDate && date.valueOf() == currentDate) {
cls.push('active');
}
if (date.valueOf() < this.o.startDate || date.valueOf() > this.o.endDate ||
$.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1) {
cls.push('disabled');
}
if (this.range) {
if (date > this.range[0] && date < this.range[this.range.length - 1]) {
cls.push('range');
}
if ($.inArray(date.valueOf(), this.range) != -1) {
cls.push('selected');
}
}
return cls;
},
fill: function () {
var d = new Date(this.viewDate),
year = d.getUTCFullYear(),
month = d.getUTCMonth(),
startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,
endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,
endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,
currentDate = this.date && this.date.valueOf(),
tooltip;
this.picker.find('.datepicker-days thead th.datepicker-switch')
.text(dates[this.o.language].months[month] + ' ' + year);
this.picker.find('tfoot th.today')
.text(dates[this.o.language].today)
.toggle(this.o.todayBtn !== false);
this.picker.find('tfoot th.clear')
.text(dates[this.o.language].clear)
.toggle(this.o.clearBtn !== false);
this.updateNavArrows();
this.fillMonths();
var prevMonth = UTCDate(year, month - 1, 28, 0, 0, 0, 0),
day = DPGlobal.getDaysInMonth(prevMonth.getUTCFullYear(), prevMonth.getUTCMonth());
prevMonth.setUTCDate(day);
prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7) % 7);
var nextMonth = new Date(prevMonth);
nextMonth.setUTCDate(nextMonth.getUTCDate() + 42);
nextMonth = nextMonth.valueOf();
var html = [];
var clsName;
while (prevMonth.valueOf() < nextMonth) {
if (prevMonth.getUTCDay() == this.o.weekStart) {
html.push('<tr>');
if (this.o.calendarWeeks) {
// ISO 8601: First week contains first thursday.
// ISO also states week starts on Monday, but we can be more abstract here.
var
// Start of current week: based on weekstart/current date
ws = new Date(+prevMonth + (this.o.weekStart - prevMonth.getUTCDay() - 7) % 7 * 864e5),
// Thursday of this week
th = new Date(+ws + (7 + 4 - ws.getUTCDay()) % 7 * 864e5),
// First Thursday of year, year from thursday
yth = new Date(+(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay()) % 7 * 864e5),
// Calendar week: ms between thursdays, div ms per day, div 7 days
calWeek = (th - yth) / 864e5 / 7 + 1;
html.push('<td class="cw">' + calWeek + '</td>');
}
}
clsName = this.getClassNames(prevMonth);
clsName.push('day');
if (this.o.beforeShowDay !== $.noop) {
var before = this.o.beforeShowDay(this._utc_to_local(prevMonth));
if (before === undefined)
before = {};
else if (typeof (before) === 'boolean')
before = { enabled: before };
else if (typeof (before) === 'string')
before = { classes: before };
if (before.enabled === false)
clsName.push('disabled');
if (before.classes)
clsName = clsName.concat(before.classes.split(/\s+/));
if (before.tooltip)
tooltip = before.tooltip;
}
clsName = $.unique(clsName);
html.push('<td class="' + clsName.join(' ') + '"' + (tooltip ? ' title="' + tooltip + '"' : '') + '>' + prevMonth.getUTCDate() + '</td>');
if (prevMonth.getUTCDay() == this.o.weekEnd) {
html.push('</tr>');
}
prevMonth.setUTCDate(prevMonth.getUTCDate() + 1);
}
this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
var currentYear = this.date && this.date.getUTCFullYear();
var months = this.picker.find('.datepicker-months')
.find('th:eq(1)')
.text(year)
.end()
.find('span').removeClass('active');
if (currentYear && currentYear == year) {
months.eq(this.date.getUTCMonth()).addClass('active');
}
if (year < startYear || year > endYear) {
months.addClass('disabled');
}
if (year == startYear) {
months.slice(0, startMonth).addClass('disabled');
}
if (year == endYear) {
months.slice(endMonth + 1).addClass('disabled');
}
html = '';
year = parseInt(year / 10, 10) * 10;
var yearCont = this.picker.find('.datepicker-years')
.find('th:eq(1)')
.text(year + '-' + (year + 9))
.end()
.find('td');
year -= 1;
for (var i = -1; i < 11; i++) {
html += '<span class="year' + (i == -1 ? ' old' : i == 10 ? ' new' : '') + (currentYear == year ? ' active' : '') + (year < startYear || year > endYear ? ' disabled' : '') + '">' + year + '</span>';
year += 1;
}
yearCont.html(html);
},
updateNavArrows: function () {
if (!this._allow_update) return;
var d = new Date(this.viewDate),
year = d.getUTCFullYear(),
month = d.getUTCMonth();
switch (this.viewMode) {
case 0:
if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear() && month <= this.o.startDate.getUTCMonth()) {
this.picker.find('.prev').css({ visibility: 'hidden' });
} else {
this.picker.find('.prev').css({ visibility: 'visible' });
}
if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear() && month >= this.o.endDate.getUTCMonth()) {
this.picker.find('.next').css({ visibility: 'hidden' });
} else {
this.picker.find('.next').css({ visibility: 'visible' });
}
break;
case 1:
case 2:
if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear()) {
this.picker.find('.prev').css({ visibility: 'hidden' });
} else {
this.picker.find('.prev').css({ visibility: 'visible' });
}
if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear()) {
this.picker.find('.next').css({ visibility: 'hidden' });
} else {
this.picker.find('.next').css({ visibility: 'visible' });
}
break;
}
},
click: function (e) {
e.preventDefault();
var target = $(e.target).closest('span, td, th');
if (target.length == 1) {
switch (target[0].nodeName.toLowerCase()) {
case 'th':
switch (target[0].className) {
case 'datepicker-switch':
this.showMode(1);
break;
case 'prev':
case 'next':
var dir = DPGlobal.modes[this.viewMode].navStep * (target[0].className == 'prev' ? -1 : 1);
switch (this.viewMode) {
case 0:
this.viewDate = this.moveMonth(this.viewDate, dir);
this._trigger('changeMonth', this.viewDate);
break;
case 1:
case 2:
this.viewDate = this.moveYear(this.viewDate, dir);
if (this.viewMode === 1)
this._trigger('changeYear', this.viewDate);
break;
}
this.fill();
break;
case 'today':
var date = new Date();
date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
this.showMode(-2);
var which = this.o.todayBtn == 'linked' ? null : 'view';
this._setDate(date, which);
break;
case 'clear':
var element;
if (this.isInput)
element = this.element;
else if (this.component)
element = this.element.find('input');
if (element)
element.val("").change();
this._trigger('changeDate');
this.update();
if (this.o.autoclose)
this.hide();
break;
}
break;
case 'span':
if (!target.is('.disabled')) {
this.viewDate.setUTCDate(1);
if (target.is('.month')) {
var day = 1;
var month = target.parent().find('span').index(target);
var year = this.viewDate.getUTCFullYear();
this.viewDate.setUTCMonth(month);
this._trigger('changeMonth', this.viewDate);
if (this.o.minViewMode === 1) {
this._setDate(UTCDate(year, month, day, 0, 0, 0, 0));
}
} else {
var year = parseInt(target.text(), 10) || 0;
var day = 1;
var month = 0;
this.viewDate.setUTCFullYear(year);
this._trigger('changeYear', this.viewDate);
if (this.o.minViewMode === 2) {
this._setDate(UTCDate(year, month, day, 0, 0, 0, 0));
}
}
this.showMode(-1);
this.fill();
}
break;
case 'td':
if (target.is('.day') && !target.is('.disabled')) {
var day = parseInt(target.text(), 10) || 1;
var year = this.viewDate.getUTCFullYear(),
month = this.viewDate.getUTCMonth();
if (target.is('.old')) {
if (month === 0) {
month = 11;
year -= 1;
} else {
month -= 1;
}
} else if (target.is('.new')) {
if (month == 11) {
month = 0;
year += 1;
} else {
month += 1;
}
}
this._setDate(UTCDate(year, month, day, 0, 0, 0, 0));
}
break;
}
}
},
_setDate: function (date, which) {
if (!which || which == 'date')
this.date = new Date(date);
if (!which || which == 'view')
this.viewDate = new Date(date);
this.fill();
this.setValue();
this._trigger('changeDate');
var element;
if (this.isInput) {
element = this.element;
} else if (this.component) {
element = this.element.find('input');
}
if (element) {
element.change();
}
if (this.o.autoclose && (!which || which == 'date')) {
this.hide();
}
},
moveMonth: function (date, dir) {
if (!dir) return date;
var new_date = new Date(date.valueOf()),
day = new_date.getUTCDate(),
month = new_date.getUTCMonth(),
mag = Math.abs(dir),
new_month, test;
dir = dir > 0 ? 1 : -1;
if (mag == 1) {
test = dir == -1
// If going back one month, make sure month is not current month
// (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02)
? function () { return new_date.getUTCMonth() == month; }
// If going forward one month, make sure month is as expected
// (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02)
: function () { return new_date.getUTCMonth() != new_month; };
new_month = month + dir;
new_date.setUTCMonth(new_month);
// Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11
if (new_month < 0 || new_month > 11)
new_month = (new_month + 12) % 12;
} else {
// For magnitudes >1, move one month at a time...
for (var i = 0; i < mag; i++)
// ...which might decrease the day (eg, Jan 31 to Feb 28, etc)...
new_date = this.moveMonth(new_date, dir);
// ...then reset the day, keeping it in the new month
new_month = new_date.getUTCMonth();
new_date.setUTCDate(day);
test = function () { return new_month != new_date.getUTCMonth(); };
}
// Common date-resetting loop -- if date is beyond end of month, make it
// end of month
while (test()) {
new_date.setUTCDate(--day);
new_date.setUTCMonth(new_month);
}
return new_date;
},
moveYear: function (date, dir) {
return this.moveMonth(date, dir * 12);
},
dateWithinRange: function (date) {
return date >= this.o.startDate && date <= this.o.endDate;
},
keydown: function (e) {
if (this.picker.is(':not(:visible)')) {
if (e.keyCode == 27) // allow escape to hide and re-show picker
this.show();
return;
}
var dateChanged = false,
dir, day, month,
newDate, newViewDate;
switch (e.keyCode) {
case 27: // escape
this.hide();
e.preventDefault();
break;
case 37: // left
case 39: // right
if (!this.o.keyboardNavigation) break;
dir = e.keyCode == 37 ? -1 : 1;
if (e.ctrlKey) {
newDate = this.moveYear(this.date, dir);
newViewDate = this.moveYear(this.viewDate, dir);
this._trigger('changeYear', this.viewDate);
} else if (e.shiftKey) {
newDate = this.moveMonth(this.date, dir);
newViewDate = this.moveMonth(this.viewDate, dir);
this._trigger('changeMonth', this.viewDate);
} else {
newDate = new Date(this.date);
newDate.setUTCDate(this.date.getUTCDate() + dir);
newViewDate = new Date(this.viewDate);
newViewDate.setUTCDate(this.viewDate.getUTCDate() + dir);
}
if (this.dateWithinRange(newDate)) {
this.date = newDate;
this.viewDate = newViewDate;
this.setValue();
this.update();
e.preventDefault();
dateChanged = true;
}
break;
case 38: // up
case 40: // down
if (!this.o.keyboardNavigation) break;
dir = e.keyCode == 38 ? -1 : 1;
if (e.ctrlKey) {
newDate = this.moveYear(this.date, dir);
newViewDate = this.moveYear(this.viewDate, dir);
this._trigger('changeYear', this.viewDate);
} else if (e.shiftKey) {
newDate = this.moveMonth(this.date, dir);
newViewDate = this.moveMonth(this.viewDate, dir);
this._trigger('changeMonth', this.viewDate);
} else {
newDate = new Date(this.date);
newDate.setUTCDate(this.date.getUTCDate() + dir * 7);
newViewDate = new Date(this.viewDate);
newViewDate.setUTCDate(this.viewDate.getUTCDate() + dir * 7);
}
if (this.dateWithinRange(newDate)) {
this.date = newDate;
this.viewDate = newViewDate;
this.setValue();
this.update();
e.preventDefault();
dateChanged = true;
}
break;
case 13: // enter
this.hide();
e.preventDefault();
break;
case 9: // tab
this.hide();
break;
}
if (dateChanged) {
this._trigger('changeDate');
var element;
if (this.isInput) {
element = this.element;
} else if (this.component) {
element = this.element.find('input');
}
if (element) {
element.change();
}
}
},
showMode: function (dir) {
if (dir) {
this.viewMode = Math.max(this.o.minViewMode, Math.min(2, this.viewMode + dir));
}
/*
vitalets: fixing bug of very special conditions:
jquery 1.7.1 + webkit + show inline datepicker in bootstrap popover.
Method show() does not set display css correctly and datepicker is not shown.
Changed to .css('display', 'block') solve the problem.
See https://github.com/vitalets/x-editable/issues/37
In jquery 1.7.2+ everything works fine.
*/
//this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show();
this.picker.find('>div').hide().filter('.datepicker-' + DPGlobal.modes[this.viewMode].clsName).css('display', 'block');
this.updateNavArrows();
}
};
var DateRangePicker = function (element, options) {
this.element = $(element);
this.inputs = $.map(options.inputs, function (i) { return i.jquery ? i[0] : i; });
delete options.inputs;
$(this.inputs)
.datepicker(options)
.bind('changeDate', $.proxy(this.dateUpdated, this));
this.pickers = $.map(this.inputs, function (i) { return $(i).data('datepicker'); });
this.updateDates();
};
DateRangePicker.prototype = {
updateDates: function () {
this.dates = $.map(this.pickers, function (i) { return i.date; });
this.updateRanges();
},
updateRanges: function () {
var range = $.map(this.dates, function (d) { return d.valueOf(); });
$.each(this.pickers, function (i, p) {
p.setRange(range);
});
},
dateUpdated: function (e) {
var dp = $(e.target).data('datepicker'),
new_date = dp.getUTCDate(),
i = $.inArray(e.target, this.inputs),
l = this.inputs.length;
if (i == -1) return;
if (new_date < this.dates[i]) {
// Date being moved earlier/left
while (i >= 0 && new_date < this.dates[i]) {
this.pickers[i--].setUTCDate(new_date);
}
}
else if (new_date > this.dates[i]) {
// Date being moved later/right
while (i < l && new_date > this.dates[i]) {
this.pickers[i++].setUTCDate(new_date);
}
}
this.updateDates();
},
remove: function () {
$.map(this.pickers, function (p) { p.remove(); });
delete this.element.data().datepicker;
}
};
function opts_from_el(el, prefix) {
// Derive options from element data-attrs
var data = $(el).data(),
out = {}, inkey,
replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])'),
prefix = new RegExp('^' + prefix.toLowerCase());
for (var key in data)
if (prefix.test(key)) {
inkey = key.replace(replace, function (_, a) { return a.toLowerCase(); });
out[inkey] = data[key];
}
return out;
}
function opts_from_locale(lang) {
// Derive options from locale plugins
var out = {};
// Check if "de-DE" style date is available, if not language should
// fallback to 2 letter code eg "de"
if (!dates[lang]) {
lang = lang.split('-')[0]
if (!dates[lang])
return;
}
var d = dates[lang];
$.each(locale_opts, function (i, k) {
if (k in d)
out[k] = d[k];
});
return out;
}
var old = $.fn.datepicker;
$.fn.datepicker = function (option) {
var args = Array.apply(null, arguments);
args.shift();
var internal_return,
this_return;
this.each(function () {
var $this = $(this),
data = $this.data('datepicker'),
options = typeof option == 'object' && option;
if (!data) {
var elopts = opts_from_el(this, 'date'),
// Preliminary otions
xopts = $.extend({}, defaults, elopts, options),
locopts = opts_from_locale(xopts.language),
// Options priority: js args, data-attrs, locales, defaults
opts = $.extend({}, defaults, locopts, elopts, options);
if ($this.is('.input-daterange') || opts.inputs) {
var ropts = {
inputs: opts.inputs || $this.find('input').toArray()
};
$this.data('datepicker', (data = new DateRangePicker(this, $.extend(opts, ropts))));
}
else {
$this.data('datepicker', (data = new Datepicker(this, opts)));
}
}
if (typeof option == 'string' && typeof data[option] == 'function') {
internal_return = data[option].apply(data, args);
if (internal_return !== undefined)
return false;
}
});
if (internal_return !== undefined)
return internal_return;
else
return this;
};
var defaults = $.fn.datepicker.defaults = {
autoclose: false,
beforeShowDay: $.noop,
calendarWeeks: false,
clearBtn: false,
daysOfWeekDisabled: [],
endDate: Infinity,
forceParse: true,
format: 'mm/dd/yyyy',
keyboardNavigation: true,
language: 'en',
minViewMode: 0,
orientation: "auto",
rtl: false,
startDate: -Infinity,
startView: 0,
todayBtn: false,
todayHighlight: false,
weekStart: 0
};
var locale_opts = $.fn.datepicker.locale_opts = [
'format',
'rtl',
'weekStart'
];
$.fn.datepicker.Constructor = Datepicker;
var dates = $.fn.datepicker.dates = {
en: {
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
today: "Today",
clear: "Clear"
}
};
var DPGlobal = {
modes: [
{
clsName: 'days',
navFnc: 'Month',
navStep: 1
},
{
clsName: 'months',
navFnc: 'FullYear',
navStep: 1
},
{
clsName: 'years',
navFnc: 'FullYear',
navStep: 10
}],
isLeapYear: function (year) {
return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0));
},
getDaysInMonth: function (year, month) {
return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
},
validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g,
nonpunctuation: /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,
parseFormat: function (format) {
// IE treats \0 as a string end in inputs (truncating the value),
// so it's a bad format delimiter, anyway
var separators = format.replace(this.validParts, '\0').split('\0'),
parts = format.match(this.validParts);
if (!separators || !separators.length || !parts || parts.length === 0) {
throw new Error("Invalid date format.");
}
return { separators: separators, parts: parts };
},
parseDate: function (date, format, language) {
if (date instanceof Date) return date;
if (typeof format === 'string')
format = DPGlobal.parseFormat(format);
if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)) {
var part_re = /([\-+]\d+)([dmwy])/,
parts = date.match(/([\-+]\d+)([dmwy])/g),
part, dir;
date = new Date();
for (var i = 0; i < parts.length; i++) {
part = part_re.exec(parts[i]);
dir = parseInt(part[1]);
switch (part[2]) {
case 'd':
date.setUTCDate(date.getUTCDate() + dir);
break;
case 'm':
date = Datepicker.prototype.moveMonth.call(Datepicker.prototype, date, dir);
break;
case 'w':
date.setUTCDate(date.getUTCDate() + dir * 7);
break;
case 'y':
date = Datepicker.prototype.moveYear.call(Datepicker.prototype, date, dir);
break;
}
}
return UTCDate(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0);
}
var parts = date && date.match(this.nonpunctuation) || [],
date = new Date(),
parsed = {},
setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'],
setters_map = {
yyyy: function (d, v) { return d.setUTCFullYear(v); },
yy: function (d, v) { return d.setUTCFullYear(2000 + v); },
m: function (d, v) {
if (isNaN(d))
return d;
v -= 1;
while (v < 0) v += 12;
v %= 12;
d.setUTCMonth(v);
while (d.getUTCMonth() != v)
d.setUTCDate(d.getUTCDate() - 1);
return d;
},
d: function (d, v) { return d.setUTCDate(v); }
},
val, filtered, part;
setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m'];
setters_map['dd'] = setters_map['d'];
date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
var fparts = format.parts.slice();
// Remove noop parts
if (parts.length != fparts.length) {
fparts = $(fparts).filter(function (i, p) {
return $.inArray(p, setters_order) !== -1;
}).toArray();
}
// Process remainder
if (parts.length == fparts.length) {
for (var i = 0, cnt = fparts.length; i < cnt; i++) {
val = parseInt(parts[i], 10);
part = fparts[i];
if (isNaN(val)) {
switch (part) {
case 'MM':
filtered = $(dates[language].months).filter(function () {
var m = this.slice(0, parts[i].length),
p = parts[i].slice(0, m.length);
return m == p;
});
val = $.inArray(filtered[0], dates[language].months) + 1;
break;
case 'M':
filtered = $(dates[language].monthsShort).filter(function () {
var m = this.slice(0, parts[i].length),
p = parts[i].slice(0, m.length);
return m == p;
});
val = $.inArray(filtered[0], dates[language].monthsShort) + 1;
break;
}
}
parsed[part] = val;
}
for (var i = 0, _date, s; i < setters_order.length; i++) {
s = setters_order[i];
if (s in parsed && !isNaN(parsed[s])) {
_date = new Date(date);
setters_map[s](_date, parsed[s]);
if (!isNaN(_date))
date = _date;
}
}
}
return date;
},
formatDate: function (date, format, language) {
if (typeof format === 'string')
format = DPGlobal.parseFormat(format);
var val = {
d: date.getUTCDate(),
D: dates[language].daysShort[date.getUTCDay()],
DD: dates[language].days[date.getUTCDay()],
m: date.getUTCMonth() + 1,
M: dates[language].monthsShort[date.getUTCMonth()],
MM: dates[language].months[date.getUTCMonth()],
yy: date.getUTCFullYear().toString().substring(2),
yyyy: date.getUTCFullYear()
};
val.dd = (val.d < 10 ? '0' : '') + val.d;
val.mm = (val.m < 10 ? '0' : '') + val.m;
var date = [],
seps = $.extend([], format.separators);
for (var i = 0, cnt = format.parts.length; i <= cnt; i++) {
if (seps.length)
date.push(seps.shift());
date.push(val[format.parts[i]]);
}
return date.join('');
},
headTemplate: '<thead>' +
'<tr>' +
'<th class="prev">«</th>' +
'<th colspan="5" class="datepicker-switch"></th>' +
'<th class="next">»</th>' +
'</tr>' +
'</thead>',
contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>',
footTemplate: '<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'
};
DPGlobal.template = '<div class="datepicker">' +
'<div class="datepicker-days">' +
'<table class=" table-condensed">' +
DPGlobal.headTemplate +
'<tbody></tbody>' +
DPGlobal.footTemplate +
'</table>' +
'</div>' +
'<div class="datepicker-months">' +
'<table class="table-condensed">' +
DPGlobal.headTemplate +
DPGlobal.contTemplate +
DPGlobal.footTemplate +
'</table>' +
'</div>' +
'<div class="datepicker-years">' +
'<table class="table-condensed">' +
DPGlobal.headTemplate +
DPGlobal.contTemplate +
DPGlobal.footTemplate +
'</table>' +
'</div>' +
'</div>';
$.fn.datepicker.DPGlobal = DPGlobal;
/* DATEPICKER NO CONFLICT
* =================== */
$.fn.datepicker.noConflict = function () {
$.fn.datepicker = old;
return this;
};
/* DATEPICKER DATA-API
* ================== */
$(document).on(
'focus.datepicker.data-api click.datepicker.data-api',
'[data-provide="datepicker"]',
function (e) {
var $this = $(this);
if ($this.data('datepicker')) return;
e.preventDefault();
// component click requires us to explicitly show it
$this.datepicker('show');
}
);
$(function () {
$('[data-provide="datepicker-inline"]').datepicker();
});
}(window.jQuery));
/**
* Arabic translation for bootstrap-datepicker
* Mohammed Alshehri <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['ar'] = {
days: ["الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت", "الأحد"],
daysShort: ["أحد", "اثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت", "أحد"],
daysMin: ["ح", "ن", "ث", "ع", "خ", "ج", "س", "ح"],
months: ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"],
monthsShort: ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"],
today: "هذا اليوم",
rtl: true
};
}(jQuery));
/**
* Bulgarian translation for bootstrap-datepicker
* Apostol Apostolov <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['bg'] = {
days: ["Неделя", "Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота", "Неделя"],
daysShort: ["Нед", "Пон", "Вто", "Сря", "Чет", "Пет", "Съб", "Нед"],
daysMin: ["Н", "П", "В", "С", "Ч", "П", "С", "Н"],
months: ["Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"],
monthsShort: ["Ян", "Фев", "Мар", "Апр", "Май", "Юни", "Юли", "Авг", "Сеп", "Окт", "Ное", "Дек"],
today: "днес"
};
}(jQuery));
/**
* Catalan translation for bootstrap-datepicker
* J. Garcia <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['ca'] = {
days: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte", "Diumenge"],
daysShort: ["Diu", "Dil", "Dmt", "Dmc", "Dij", "Div", "Dis", "Diu"],
daysMin: ["dg", "dl", "dt", "dc", "dj", "dv", "ds", "dg"],
months: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"],
monthsShort: ["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"],
today: "Avui"
};
}(jQuery));
/**
* Czech translation for bootstrap-datepicker
* Matěj Koubík <[email protected]>
* Fixes by Michal Remiš <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['cs'] = {
days: ["Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota", "Neděle"],
daysShort: ["Ned", "Pon", "Úte", "Stř", "Čtv", "Pát", "Sob", "Ned"],
daysMin: ["Ne", "Po", "Út", "St", "Čt", "Pá", "So", "Ne"],
months: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"],
monthsShort: ["Led", "Úno", "Bře", "Dub", "Kvě", "Čer", "Čnc", "Srp", "Zář", "Říj", "Lis", "Pro"],
today: "Dnes"
};
}(jQuery));
/**
* Danish translation for bootstrap-datepicker
* Christian Pedersen <http://github.com/chripede>
*/
; (function ($) {
$.fn.datepicker.dates['da'] = {
days: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag", "Søndag"],
daysShort: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør", "Søn"],
daysMin: ["Sø", "Ma", "Ti", "On", "To", "Fr", "Lø", "Sø"],
months: ["Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
today: "I Dag"
};
}(jQuery));
/**
* German translation for bootstrap-datepicker
* Sam Zurcher <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['de'] = {
days: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"],
daysShort: ["Son", "Mon", "Die", "Mit", "Don", "Fre", "Sam", "Son"],
daysMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"],
months: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"],
monthsShort: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"],
today: "Heute",
weekStart: 1,
format: "dd.mm.yyyy"
};
}(jQuery));
/**
* Greek translation for bootstrap-datepicker
*/
; (function ($) {
$.fn.datepicker.dates['el'] = {
days: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο", "Κυριακή"],
daysShort: ["Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ", "Κυρ"],
daysMin: ["Κυ", "Δε", "Τρ", "Τε", "Πε", "Πα", "Σα", "Κυ"],
months: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"],
monthsShort: ["Ιαν", "Φεβ", "Μαρ", "Απρ", "Μάι", "Ιουν", "Ιουλ", "Αυγ", "Σεπ", "Οκτ", "Νοε", "Δεκ"],
today: "Σήμερα"
};
}(jQuery));
/**
* Spanish translation for bootstrap-datepicker
* Bruno Bonamin <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['es'] = {
days: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo"],
daysShort: ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb", "Dom"],
daysMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa", "Do"],
months: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
monthsShort: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"],
today: "Hoy"
};
}(jQuery));
/**
* Estonian translation for bootstrap-datepicker
* Ando Roots <https://github.com/anroots>
*/
; (function ($) {
$.fn.datepicker.dates['et'] = {
days: ["Pühapäev", "Esmaspäev", "Teisipäev", "Kolmapäev", "Neljapäev", "Reede", "Laupäev", "Pühapäev"],
daysShort: ["Püh", "Esm", "Tei", "Kol", "Nel", "Ree", "Lau", "Sun"],
daysMin: ["P", "E", "T", "K", "N", "R", "L", "P"],
months: ["Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember"],
monthsShort: ["Jaan", "Veeb", "Märts", "Apr", "Mai", "Juuni", "Juuli", "Aug", "Sept", "Okt", "Nov", "Dets"],
today: "Täna"
};
}(jQuery));
/**
* Finnish translation for bootstrap-datepicker
* Jaakko Salonen <https://github.com/jsalonen>
*/
; (function ($) {
$.fn.datepicker.dates['fi'] = {
days: ["sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai", "sunnuntai"],
daysShort: ["sun", "maa", "tii", "kes", "tor", "per", "lau", "sun"],
daysMin: ["su", "ma", "ti", "ke", "to", "pe", "la", "su"],
months: ["tammikuu", "helmikuu", "maaliskuu", "huhtikuu", "toukokuu", "kesäkuu", "heinäkuu", "elokuu", "syyskuu", "lokakuu", "marraskuu", "joulukuu"],
monthsShort: ["tam", "hel", "maa", "huh", "tou", "kes", "hei", "elo", "syy", "lok", "mar", "jou"],
today: "tänään",
weekStart: 1,
format: "d.m.yyyy"
};
}(jQuery));
/**
* French translation for bootstrap-datepicker
* Nico Mollet <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['fr'] = {
days: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"],
daysShort: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam", "Dim"],
daysMin: ["D", "L", "Ma", "Me", "J", "V", "S", "D"],
months: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"],
monthsShort: ["Jan", "Fev", "Mar", "Avr", "Mai", "Jui", "Jul", "Aou", "Sep", "Oct", "Nov", "Dec"],
today: "Aujourd'hui",
clear: "Effacer",
weekStart: 1,
format: "dd/mm/yyyy"
};
}(jQuery));
/**
* Hebrew translation for bootstrap-datepicker
* Sagie Maoz <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['he'] = {
days: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת", "ראשון"],
daysShort: ["א", "ב", "ג", "ד", "ה", "ו", "ש", "א"],
daysMin: ["א", "ב", "ג", "ד", "ה", "ו", "ש", "א"],
months: ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"],
monthsShort: ["ינו", "פבר", "מרץ", "אפר", "מאי", "יונ", "יול", "אוג", "ספט", "אוק", "נוב", "דצמ"],
today: "היום",
rtl: true
};
}(jQuery));
/**
* Croatian localisation
*/
; (function ($) {
$.fn.datepicker.dates['hr'] = {
days: ["Nedjelja", "Ponedjelja", "Utorak", "Srijeda", "Četrtak", "Petak", "Subota", "Nedjelja"],
daysShort: ["Ned", "Pon", "Uto", "Srr", "Čet", "Pet", "Sub", "Ned"],
daysMin: ["Ne", "Po", "Ut", "Sr", "Če", "Pe", "Su", "Ne"],
months: ["Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac"],
monthsShort: ["Sije", "Velj", "Ožu", "Tra", "Svi", "Lip", "Jul", "Kol", "Ruj", "Lis", "Stu", "Pro"],
today: "Danas"
};
}(jQuery));
/**
* Hungarian translation for bootstrap-datepicker
* Sotus László <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['hu'] = {
days: ["Vasárnap", "Hétfő", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat", "Vasárnap"],
daysShort: ["Vas", "Hét", "Ked", "Sze", "Csü", "Pén", "Szo", "Vas"],
daysMin: ["Va", "Hé", "Ke", "Sz", "Cs", "Pé", "Sz", "Va"],
months: ["Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"],
monthsShort: ["Jan", "Feb", "Már", "Ápr", "Máj", "Jún", "Júl", "Aug", "Sze", "Okt", "Nov", "Dec"],
today: "Ma",
weekStart: 1,
format: "yyyy.mm.dd"
};
}(jQuery));
/**
* Bahasa translation for bootstrap-datepicker
* Azwar Akbar <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['id'] = {
days: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu", "Minggu"],
daysShort: ["Mgu", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab", "Mgu"],
daysMin: ["Mg", "Sn", "Sl", "Ra", "Ka", "Ju", "Sa", "Mg"],
months: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ags", "Sep", "Okt", "Nov", "Des"],
today: "Hari Ini",
clear: "Kosongkan"
};
}(jQuery));
/**
* Icelandic translation for bootstrap-datepicker
* Hinrik Örn Sigurðsson <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['is'] = {
days: ["Sunnudagur", "Mánudagur", "Þriðjudagur", "Miðvikudagur", "Fimmtudagur", "Föstudagur", "Laugardagur", "Sunnudagur"],
daysShort: ["Sun", "Mán", "Þri", "Mið", "Fim", "Fös", "Lau", "Sun"],
daysMin: ["Su", "Má", "Þr", "Mi", "Fi", "Fö", "La", "Su"],
months: ["Janúar", "Febrúar", "Mars", "Apríl", "Maí", "Júní", "Júlí", "Ágúst", "September", "Október", "Nóvember", "Desember"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "Maí", "Jún", "Júl", "Ágú", "Sep", "Okt", "Nóv", "Des"],
today: "Í Dag"
};
}(jQuery));
/**
* Italian translation for bootstrap-datepicker
* Enrico Rubboli <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['it'] = {
days: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato", "Domenica"],
daysShort: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab", "Dom"],
daysMin: ["Do", "Lu", "Ma", "Me", "Gi", "Ve", "Sa", "Do"],
months: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"],
monthsShort: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"],
today: "Oggi",
weekStart: 1,
format: "dd/mm/yyyy"
};
}(jQuery));
/**
* Japanese translation for bootstrap-datepicker
* Norio Suzuki <https://github.com/suzuki/>
*/
; (function ($) {
$.fn.datepicker.dates['ja'] = {
days: ["日曜", "月曜", "火曜", "水曜", "木曜", "金曜", "土曜", "日曜"],
daysShort: ["日", "月", "火", "水", "木", "金", "土", "日"],
daysMin: ["日", "月", "火", "水", "木", "金", "土", "日"],
months: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
monthsShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
today: "今日",
format: "yyyy/mm/dd"
};
}(jQuery));
/**
* Georgian translation for bootstrap-datepicker
* Levan Melikishvili <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['ka'] = {
days: ["კვირა", "ორშაბათი", "სამშაბათი", "ოთხშაბათი", "ხუთშაბათი", "პარასკევი", "შაბათი", "კვირა"],
daysShort: ["კვი", "ორშ", "სამ", "ოთხ", "ხუთ", "პარ", "შაბ", "კვი"],
daysMin: ["კვ", "ორ", "სა", "ოთ", "ხუ", "პა", "შა", "კვ"],
months: ["იანვარი", "თებერვალი", "მარტი", "აპრილი", "მაისი", "ივნისი", "ივლისი", "აგვისტო", "სექტემბერი", "ოქტომები", "ნოემბერი", "დეკემბერი"],
monthsShort: ["იან", "თებ", "მარ", "აპრ", "მაი", "ივნ", "ივლ", "აგვ", "სექ", "ოქტ", "ნოე", "დეკ"],
today: "დღეს",
clear: "გასუფთავება"
};
}(jQuery));
/**
* Korean translation for bootstrap-datepicker
* Gu Youn <http://github.com/guyoun>
*/
; (function ($) {
$.fn.datepicker.dates['kr'] = {
days: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일", "일요일"],
daysShort: ["일", "월", "화", "수", "목", "금", "토", "일"],
daysMin: ["일", "월", "화", "수", "목", "금", "토", "일"],
months: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"],
monthsShort: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"]
};
}(jQuery));
/**
* Lithuanian translation for bootstrap-datepicker
* Šarūnas Gliebus <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['lt'] = {
days: ["Sekmadienis", "Pirmadienis", "Antradienis", "Trečiadienis", "Ketvirtadienis", "Penktadienis", "Šeštadienis", "Sekmadienis"],
daysShort: ["S", "Pr", "A", "T", "K", "Pn", "Š", "S"],
daysMin: ["Sk", "Pr", "An", "Tr", "Ke", "Pn", "Št", "Sk"],
months: ["Sausis", "Vasaris", "Kovas", "Balandis", "Gegužė", "Birželis", "Liepa", "Rugpjūtis", "Rugsėjis", "Spalis", "Lapkritis", "Gruodis"],
monthsShort: ["Sau", "Vas", "Kov", "Bal", "Geg", "Bir", "Lie", "Rugp", "Rugs", "Spa", "Lap", "Gru"],
today: "Šiandien",
weekStart: 1
};
}(jQuery));
/**
* Latvian translation for bootstrap-datepicker
* Artis Avotins <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['lv'] = {
days: ["Svētdiena", "Pirmdiena", "Otrdiena", "Trešdiena", "Ceturtdiena", "Piektdiena", "Sestdiena", "Svētdiena"],
daysShort: ["Sv", "P", "O", "T", "C", "Pk", "S", "Sv"],
daysMin: ["Sv", "Pr", "Ot", "Tr", "Ce", "Pk", "St", "Sv"],
months: ["Janvāris", "Februāris", "Marts", "Aprīlis", "Maijs", "Jūnijs", "Jūlijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jūn", "Jūl", "Aug", "Sep", "Okt", "Nov", "Dec."],
today: "Šodien",
weekStart: 1
};
}(jQuery));
/**
* Macedonian translation for bootstrap-datepicker
* Marko Aleksic <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['mk'] = {
days: ["Недела", "Понеделник", "Вторник", "Среда", "Четврток", "Петок", "Сабота", "Недела"],
daysShort: ["Нед", "Пон", "Вто", "Сре", "Чет", "Пет", "Саб", "Нед"],
daysMin: ["Не", "По", "Вт", "Ср", "Че", "Пе", "Са", "Не"],
months: ["Јануари", "Февруари", "Март", "Април", "Мај", "Јуни", "Јули", "Август", "Септември", "Октомври", "Ноември", "Декември"],
monthsShort: ["Јан", "Фев", "Мар", "Апр", "Мај", "Јун", "Јул", "Авг", "Сеп", "Окт", "Ное", "Дек"],
today: "Денес"
};
}(jQuery));
/**
* Malay translation for bootstrap-datepicker
* Ateman Faiz <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['ms'] = {
days: ["Ahad", "Isnin", "Selasa", "Rabu", "Khamis", "Jumaat", "Sabtu", "Ahad"],
daysShort: ["Aha", "Isn", "Sel", "Rab", "Kha", "Jum", "Sab", "Aha"],
daysMin: ["Ah", "Is", "Se", "Ra", "Kh", "Ju", "Sa", "Ah"],
months: ["Januari", "Februari", "Mac", "April", "Mei", "Jun", "Julai", "Ogos", "September", "Oktober", "November", "Disember"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ogo", "Sep", "Okt", "Nov", "Dis"],
today: "Hari Ini"
};
}(jQuery));
/**
* Norwegian (bokmål) translation for bootstrap-datepicker
* Fredrik Sundmyhr <http://github.com/fsundmyhr>
*/
; (function ($) {
$.fn.datepicker.dates['nb'] = {
days: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag", "Søndag"],
daysShort: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør", "Søn"],
daysMin: ["Sø", "Ma", "Ti", "On", "To", "Fr", "Lø", "Sø"],
months: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"],
today: "I Dag"
};
}(jQuery));
/**
* Dutch translation for bootstrap-datepicker
* Reinier Goltstein <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['nl'] = {
days: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag", "Zondag"],
daysShort: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za", "Zo"],
daysMin: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za", "Zo"],
months: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"],
monthsShort: ["Jan", "Feb", "Mrt", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
today: "Vandaag"
};
}(jQuery));
/**
* Norwegian translation for bootstrap-datepicker
**/
; (function ($) {
$.fn.datepicker.dates['no'] = {
days: ['Søndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lørdag'],
daysShort: ['Søn', 'Man', 'Tir', 'Ons', 'Tor', 'Fre', 'Lør'],
daysMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø'],
months: ['Januar', 'Februar', 'Mars', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Desember'],
monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'],
today: 'I dag',
clear: 'Nullstill',
weekStart: 0
};
}(jQuery));
/**
* Polish translation for bootstrap-datepicker
* Robert <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['pl'] = {
days: ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota", "Niedziela"],
daysShort: ["Nie", "Pn", "Wt", "Śr", "Czw", "Pt", "So", "Nie"],
daysMin: ["N", "Pn", "Wt", "Śr", "Cz", "Pt", "So", "N"],
months: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"],
monthsShort: ["Sty", "Lu", "Mar", "Kw", "Maj", "Cze", "Lip", "Sie", "Wrz", "Pa", "Lis", "Gru"],
today: "Dzisiaj",
weekStart: 1
};
}(jQuery));
/**
* Brazilian translation for bootstrap-datepicker
* Cauan Cabral <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['pt-BR'] = {
days: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado", "Domingo"],
daysShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb", "Dom"],
daysMin: ["Do", "Se", "Te", "Qu", "Qu", "Se", "Sa", "Do"],
months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"],
today: "Hoje",
clear: "Limpar"
};
}(jQuery));
/**
* Portuguese translation for bootstrap-datepicker
* Original code: Cauan Cabral <[email protected]>
* Tiago Melo <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['pt'] = {
days: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado", "Domingo"],
daysShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb", "Dom"],
daysMin: ["Do", "Se", "Te", "Qu", "Qu", "Se", "Sa", "Do"],
months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"],
today: "Hoje",
clear: "Limpar"
};
}(jQuery));
/**
* Romanian translation for bootstrap-datepicker
* Cristian Vasile <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['ro'] = {
days: ["Duminică", "Luni", "Marţi", "Miercuri", "Joi", "Vineri", "Sâmbătă", "Duminică"],
daysShort: ["Dum", "Lun", "Mar", "Mie", "Joi", "Vin", "Sâm", "Dum"],
daysMin: ["Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sâ", "Du"],
months: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"],
monthsShort: ["Ian", "Feb", "Mar", "Apr", "Mai", "Iun", "Iul", "Aug", "Sep", "Oct", "Nov", "Dec"],
today: "Astăzi",
weekStart: 1
};
}(jQuery));
/**
* Serbian latin translation for bootstrap-datepicker
* Bojan Milosavlević <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['rs-latin'] = {
days: ["Nedelja", "Ponedeljak", "Utorak", "Sreda", "Četvrtak", "Petak", "Subota", "Nedelja"],
daysShort: ["Ned", "Pon", "Uto", "Sre", "Čet", "Pet", "Sub", "Ned"],
daysMin: ["N", "Po", "U", "Sr", "Č", "Pe", "Su", "N"],
months: ["Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Avg", "Sep", "Okt", "Nov", "Dec"],
today: "Danas"
};
}(jQuery));
/**
* Serbian cyrillic translation for bootstrap-datepicker
* Bojan Milosavlević <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['rs'] = {
days: ["Недеља", "Понедељак", "Уторак", "Среда", "Четвртак", "Петак", "Субота", "Недеља"],
daysShort: ["Нед", "Пон", "Уто", "Сре", "Чет", "Пет", "Суб", "Нед"],
daysMin: ["Н", "По", "У", "Ср", "Ч", "Пе", "Су", "Н"],
months: ["Јануар", "Фебруар", "Март", "Април", "Мај", "Јун", "Јул", "Август", "Септембар", "Октобар", "Новембар", "Децембар"],
monthsShort: ["Јан", "Феб", "Мар", "Апр", "Мај", "Јун", "Јул", "Авг", "Сеп", "Окт", "Нов", "Дец"],
today: "Данас"
};
}(jQuery));
/**
* Russian translation for bootstrap-datepicker
* Victor Taranenko <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['ru'] = {
days: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота", "Воскресенье"],
daysShort: ["Вск", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Суб", "Вск"],
daysMin: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"],
months: ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"],
monthsShort: ["Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек"],
today: "Сегодня",
weekStart: 1
};
}(jQuery));
/**
* Slovak translation for bootstrap-datepicker
* Marek Lichtner <[email protected]>
* Fixes by Michal Remiš <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates["sk"] = {
days: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota", "Nedeľa"],
daysShort: ["Ned", "Pon", "Uto", "Str", "Štv", "Pia", "Sob", "Ned"],
daysMin: ["Ne", "Po", "Ut", "St", "Št", "Pia", "So", "Ne"],
months: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "Máj", "Jún", "Júl", "Aug", "Sep", "Okt", "Nov", "Dec"],
today: "Dnes"
};
}(jQuery));
/**
* Slovene translation for bootstrap-datepicker
* Gregor Rudolf <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['sl'] = {
days: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota", "Nedelja"],
daysShort: ["Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob", "Ned"],
daysMin: ["Ne", "Po", "To", "Sr", "Če", "Pe", "So", "Ne"],
months: ["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Avg", "Sep", "Okt", "Nov", "Dec"],
today: "Danes"
};
}(jQuery));
/**
* Albanian translation for bootstrap-datepicker
* Tomor Pupovci <http://www.github.com/ttomor>
*/
; (function ($) {
$.fn.datepicker.dates['sq'] = {
days: ["E Diel", "E Hënë", "E martē", "E mërkurë", "E Enjte", "E Premte", "E Shtunë", "E Diel"],
daysShort: ["Die", "Hën", "Mar", "Mër", "Enj", "Pre", "Shtu", "Die"],
daysMin: ["Di", "Hë", "Ma", "Më", "En", "Pr", "Sht", "Di"],
months: ["Janar", "Shkurt", "Mars", "Prill", "Maj", "Qershor", "Korrik", "Gusht", "Shtator", "Tetor", "Nëntor", "Dhjetor"],
monthsShort: ["Jan", "Shk", "Mar", "Pri", "Maj", "Qer", "Korr", "Gu", "Sht", "Tet", "Nën", "Dhjet"],
today: "Sot"
};
}(jQuery));
/**
* Swedish translation for bootstrap-datepicker
* Patrik Ragnarsson <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['sv'] = {
days: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag", "Söndag"],
daysShort: ["Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör", "Sön"],
daysMin: ["Sö", "Må", "Ti", "On", "To", "Fr", "Lö", "Sö"],
months: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
today: "I Dag",
format: "yyyy-mm-dd",
weekStart: 1
};
}(jQuery));
/**
* Swahili translation for bootstrap-datepicker
* Edwin Mugendi <https://github.com/edwinmugendi>
* Source: http://scriptsource.org/cms/scripts/page.php?item_id=entry_detail&uid=xnfaqyzcku
*/
; (function ($) {
$.fn.datepicker.dates['sw'] = {
days: ["Jumapili", "Jumatatu", "Jumanne", "Jumatano", "Alhamisi", "Ijumaa", "Jumamosi", "Jumapili"],
daysShort: ["J2", "J3", "J4", "J5", "Alh", "Ij", "J1", "J2"],
daysMin: ["2", "3", "4", "5", "A", "I", "1", "2"],
months: ["Januari", "Februari", "Machi", "Aprili", "Mei", "Juni", "Julai", "Agosti", "Septemba", "Oktoba", "Novemba", "Desemba"],
monthsShort: ["Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ago", "Sep", "Okt", "Nov", "Des"],
today: "Leo"
};
}(jQuery));
/**
* Thai translation for bootstrap-datepicker
* Suchau Jiraprapot <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['th'] = {
days: ["อาทิตย์", "จันทร์", "อังคาร", "พุธ", "พฤหัส", "ศุกร์", "เสาร์", "อาทิตย์"],
daysShort: ["อา", "จ", "อ", "พ", "พฤ", "ศ", "ส", "อา"],
daysMin: ["อา", "จ", "อ", "พ", "พฤ", "ศ", "ส", "อา"],
months: ["มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม"],
monthsShort: ["ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค."],
today: "วันนี้"
};
}(jQuery));
/**
* Turkish translation for bootstrap-datepicker
* Serkan Algur <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['tr'] = {
days: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi", "Pazar"],
daysShort: ["Pz", "Pzt", "Sal", "Çrş", "Prş", "Cu", "Cts", "Pz"],
daysMin: ["Pz", "Pzt", "Sa", "Çr", "Pr", "Cu", "Ct", "Pz"],
months: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"],
monthsShort: ["Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara"],
today: "Bugün",
format: "dd.mm.yyyy"
};
}(jQuery));
/**
* Ukrainian translation for bootstrap-datepicker
* Andrey Vityuk <andrey [dot] vityuk [at] gmail.com>
*/
; (function ($) {
$.fn.datepicker.dates['uk'] = {
days: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота", "Неділя"],
daysShort: ["Нед", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Суб", "Нед"],
daysMin: ["Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Нд"],
months: ["Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"],
monthsShort: ["Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру"],
today: "Сьогодні"
};
}(jQuery));
/**
* Simplified Chinese translation for bootstrap-datepicker
* Yuan Cheung <[email protected]>
*/
; (function ($) {
$.fn.datepicker.dates['zh-CN'] = {
days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
today: "今日",
format: "yyyy年mm月dd日",
weekStart: 1
};
}(jQuery));
/**
* Traditional Chinese translation for bootstrap-datepicker
* Rung-Sheng Jang <[email protected]>
* FrankWu <[email protected]> Fix more appropriate use of Traditional Chinese habit
*/
; (function ($) {
$.fn.datepicker.dates['zh-TW'] = {
days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
daysShort: ["週日", "週一", "週二", "週三", "週四", "週五", "週六", "週日"],
daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
today: "今天",
format: "yyyy年mm月dd日",
weekStart: 1
};
}(jQuery));
var dp;
dp = angular.module('ng-bootstrap-datepicker', []);
dp.directive('ngDatepicker', function () {
return {
restrict: 'A',
replace: true,
scope: {
ngOptions: '=',
ngModel: '='
},
template: "<div class=\"input-append date\">\n <input type=\"text\"><span class=\"add-on\"><i class=\"icon-th\"></i></span>\n</div>",
link: function (scope, element) {
scope.inputHasFocus = false;
element.datepicker(scope.ngOptions).on('changeDate', function (e) {
var defaultFormat, defaultLanguage, format, language;
defaultFormat = $.fn.datepicker.defaults.format;
format = scope.ngOptions.format || defaultFormat;
defaultLanguage = $.fn.datepicker.defaults.language;
language = scope.ngOptions.language || defaultLanguage;
return scope.$apply(function () {
return scope.ngModel = $.fn.datepicker.DPGlobal.formatDate(e.date, format, language);
});
});
element.find('input').on('focus', function () {
return scope.inputHasFocus = true;
}).on('blur', function () {
return scope.inputHasFocus = false;
});
return scope.$watch('ngModel', function (newValue) {
if (!scope.inputHasFocus) {
return element.datepicker('update', newValue);
}
});
}
};
}); | andrepires/mymoney | Presentation/WebAPI/MyMoney.Presentation.WebAPI/scripts/angular-bootstrap-datepicker.js | JavaScript | mit | 90,258 |
// Insert your JS here | Malander/ReneJade | app/scripts/main.js | JavaScript | mit | 22 |
'use strict';
const path = require('path');
// This is a custom Jest transformer turning file imports into filenames.
// https://facebook.github.io/jest/docs/en/webpack.html
module.exports = {
process(src, filename) {
const assetFilename = JSON.stringify(path.basename(filename));
if (filename.match(/\.svg$/)) {
return `const React = require('react');
module.exports = {
__esModule: true,
default: ${assetFilename},
ReactComponent: React.forwardRef((props, ref) => ({
$$typeof: Symbol.for('react.element'),
type: 'svg',
ref: ref,
key: null,
props: Object.assign({}, props, {
children: ${assetFilename}
})
})),
};`;
}
return `module.exports = ${assetFilename};`;
},
};
| lgollut/material-ui | examples/preact/config/jest/fileTransform.js | JavaScript | mit | 816 |
var colors = require('colors');
colors.enabled = true;
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['../nodejs/jasmine-custom-message.spec.js', './test-jasmine-custom-message.js']
}; | damianfarina/jasmine-custom-message | specs/protractor/conf.js | JavaScript | mit | 218 |
import { Increment, Decrement } from '../actions'
export default (state = 0, action) => {
switch (action.constructor) {
case Increment:
return state + 1
case Decrement:
return state - 1
default:
return state
}
}
| jas-chen/typed-redux | examples/counter/src/reducers/index.js | JavaScript | mit | 247 |
import {
RECEIVE_ALL_JOBS, RECEIVE_JOB, REQUEST_ALL_JOBS, REQUEST_JOB,
RECEIVE_FILTERED_JOBS, REQUEST_FILTERED_JOBS, CREATE_JOBS,
PAGINATE_JOBS, UPDATE_JOB, DELETE_JOB } from './constants'
const initialState = {
fetchingSelected: false,
selected: null,
fetchingAll: false,
all: null,
filteredJobs: null,
filtered: false,
filter: null, // we persist user's search parameters between navigations to/from home and job detail pages
offset: 0,
pageNum: 1
}
const jobsReducer = (state = initialState, action) => {
switch (action.type) {
case REQUEST_ALL_JOBS: return {
fetchingSelected: false,
selected: null,
fetchingAll: true,
all: null,
filteredJobs: state.filteredJobs ? [...state.filteredJobs] : null,
filtered: false,
filter: null,
offset: 0,
pageNum: 1
}
case RECEIVE_ALL_JOBS: return {
fetchingSelected: false,
selected: null,
fetchingAll: false,
all: action.jobs,
filteredJobs: null,
filtered: false,
filter: null,
offset: 0,
pageNum: 1
}
case REQUEST_FILTERED_JOBS: return {
fetchingSelected: false,
selected: null,
fetchingAll: true,
all: state.all ? [...state.all] : null,
filteredJobs: null,
filtered: state.filteredJobs !== null,
filter: action.filter,
offset: 0,
pageNum: 1
}
case RECEIVE_FILTERED_JOBS: return {
fetchingSelected: false,
selected: null,
fetchingAll: false,
all: state.all ? [...state.all] : null,
filteredJobs: action.jobs,
filtered: true,
filter: {...state.filter},
offset: 0,
pageNum: 1
}
case PAGINATE_JOBS: return {
fetchingSelected: false,
selected: null,
fetchingAll: false,
all: state.all ? [...state.all] : null,
filteredJobs: state.filteredJobs ? [...state.filteredJobs] : null,
filtered: state.filteredJobs !== null,
filter: state.filter ? {...state.filter} : null,
offset: action.offset,
pageNum: action.pageNum
}
case REQUEST_JOB: return {
fetchingSelected: true,
selected: null,
fetchingAll: false,
all: state.all ? [...state.all] : null,
filteredJobs: state.filteredJobs ? [...state.filteredJobs] : null,
filtered: state.filteredJobs !== null,
filter: state.filter ? {...state.filter} : null,
offset: state.offset,
pageNum: state.pageNum
}
case RECEIVE_JOB: return {
fetchingSelected: false,
selected: action.job,
fetchingAll: false,
all: state.all ? [...state.all] : null,
filteredJobs: state.filteredJobs ? [...state.filteredJobs] : null,
filtered: state.filteredJobs !== null,
filter: state.filter ? {...state.filter} : null,
offset: state.offset,
pageNum: state.pageNum
}
case CREATE_JOBS: return {
fetchingSelected: false,
selected: state.selected ? {...state.selected} : null,
fetchingAll: true,
all: state.all ? [...state.all] : null,
filteredJobs: state.filteredJobs ? [...state.filteredJobs] : null,
filtered: false,
filter: null,
offset: 0,
pageNum: 1
}
case UPDATE_JOB: return {
fetchingSelected: true,
selected: state.selected ? {...state.selected} : null,
fetchingAll: false,
all: state.all ? [...state.all] : null,
filteredJobs: state.filteredJobs ? [...state.filteredJobs] : null,
filtered: false,
filter: null,
offset: 0,
pageNum: 1
}
case DELETE_JOB: return {
fetchingSelected: true,
selected: state.selected ? {...state.selected} : null,
fetchingAll: false,
all: state.all ? [...state.all] : null,
filteredJobs: state.filteredJobs ? [...state.filteredJobs] : null,
filtered: false,
filter: null,
offset: 0,
pageNum: 1
}
default: return state
}
}
export default jobsReducer
| jackson-/colorforcode | src/reducers/jobsReducer.js | JavaScript | mit | 3,987 |
module.exports = {
createUser: require('./create-user')
};
| larsbs/graysql | examples/simple/schema/types/user/mutations/index.js | JavaScript | mit | 61 |
/* global logger, processWebhookMessage */
import moment from 'moment';
RocketChat.integrations.triggerHandler = new class RocketChatIntegrationHandler {
constructor() {
this.vm = Npm.require('vm');
this.successResults = [200, 201, 202];
this.compiledScripts = {};
this.triggers = {};
RocketChat.models.Integrations.find({type: 'webhook-outgoing'}).observe({
added: (record) => {
this.addIntegration(record);
},
changed: (record) => {
this.removeIntegration(record);
this.addIntegration(record);
},
removed: (record) => {
this.removeIntegration(record);
}
});
}
addIntegration(record) {
logger.outgoing.debug(`Adding the integration ${ record.name } of the event ${ record.event }!`);
let channels;
if (record.event && !RocketChat.integrations.outgoingEvents[record.event].use.channel) {
logger.outgoing.debug('The integration doesnt rely on channels.');
//We don't use any channels, so it's special ;)
channels = ['__any'];
} else if (_.isEmpty(record.channel)) {
logger.outgoing.debug('The integration had an empty channel property, so it is going on all the public channels.');
channels = ['all_public_channels'];
} else {
logger.outgoing.debug('The integration is going on these channels:', record.channel);
channels = [].concat(record.channel);
}
for (const channel of channels) {
if (!this.triggers[channel]) {
this.triggers[channel] = {};
}
this.triggers[channel][record._id] = record;
}
}
removeIntegration(record) {
for (const trigger of Object.values(this.triggers)) {
delete trigger[record._id];
}
}
isTriggerEnabled(trigger) {
for (const trig of Object.values(this.triggers)) {
if (trig[trigger._id]) {
return trig[trigger._id].enabled;
}
}
return false;
}
updateHistory({ historyId, step, integration, event, data, triggerWord, ranPrepareScript, prepareSentMessage, processSentMessage, resultMessage, finished, url, httpCallData, httpError, httpResult, error, errorStack }) {
const history = {
type: 'outgoing-webhook',
step
};
// Usually is only added on initial insert
if (integration) {
history.integration = integration;
}
// Usually is only added on initial insert
if (event) {
history.event = event;
}
if (data) {
history.data = data;
if (data.user) {
history.data.user = _.omit(data.user, ['meta', '$loki', 'services']);
}
if (data.room) {
history.data.room = _.omit(data.room, ['meta', '$loki', 'usernames']);
history.data.room.usernames = ['this_will_be_filled_in_with_usernames_when_replayed'];
}
}
if (triggerWord) {
history.triggerWord = triggerWord;
}
if (typeof ranPrepareScript !== 'undefined') {
history.ranPrepareScript = ranPrepareScript;
}
if (prepareSentMessage) {
history.prepareSentMessage = prepareSentMessage;
}
if (processSentMessage) {
history.processSentMessage = processSentMessage;
}
if (resultMessage) {
history.resultMessage = resultMessage;
}
if (typeof finished !== 'undefined') {
history.finished = finished;
}
if (url) {
history.url = url;
}
if (typeof httpCallData !== 'undefined') {
history.httpCallData = httpCallData;
}
if (httpError) {
history.httpError = httpError;
}
if (typeof httpResult !== 'undefined') {
history.httpResult = httpResult;
}
if (typeof error !== 'undefined') {
history.error = error;
}
if (typeof errorStack !== 'undefined') {
history.errorStack = errorStack;
}
if (historyId) {
RocketChat.models.IntegrationHistory.update({ _id: historyId }, { $set: history });
return historyId;
} else {
history._createdAt = new Date();
return RocketChat.models.IntegrationHistory.insert(Object.assign({ _id: Random.id() }, history));
}
}
//Trigger is the trigger, nameOrId is a string which is used to try and find a room, room is a room, message is a message, and data contains "user_name" if trigger.impersonateUser is truthful.
sendMessage({ trigger, nameOrId = '', room, message, data }) {
let user;
//Try to find the user who we are impersonating
if (trigger.impersonateUser) {
user = RocketChat.models.Users.findOneByUsername(data.user_name);
}
//If they don't exist (aka the trigger didn't contain a user) then we set the user based upon the
//configured username for the integration since this is required at all times.
if (!user) {
user = RocketChat.models.Users.findOneByUsername(trigger.username);
}
let tmpRoom;
if (nameOrId || trigger.targetRoom) {
tmpRoom = RocketChat.getRoomByNameOrIdWithOptionToJoin({ currentUserId: user._id, nameOrId: nameOrId || trigger.targetRoom, errorOnEmpty: false }) || room;
} else {
tmpRoom = room;
}
//If no room could be found, we won't be sending any messages but we'll warn in the logs
if (!tmpRoom) {
logger.outgoing.warn(`The Integration "${ trigger.name }" doesn't have a room configured nor did it provide a room to send the message to.`);
return;
}
logger.outgoing.debug(`Found a room for ${ trigger.name } which is: ${ tmpRoom.name } with a type of ${ tmpRoom.t }`);
message.bot = { i: trigger._id };
const defaultValues = {
alias: trigger.alias,
avatar: trigger.avatar,
emoji: trigger.emoji
};
if (tmpRoom.t === 'd') {
message.channel = `@${ tmpRoom._id }`;
} else {
message.channel = `#${ tmpRoom._id }`;
}
message = processWebhookMessage(message, user, defaultValues);
return message;
}
buildSandbox(store = {}) {
const sandbox = {
_, s, console, moment,
Store: {
set: (key, val) => store[key] = val,
get: (key) => store[key]
},
HTTP: (method, url, options) => {
try {
return {
result: HTTP.call(method, url, options)
};
} catch (error) {
return { error };
}
}
};
Object.keys(RocketChat.models).filter(k => !k.startsWith('_')).forEach(k => {
sandbox[k] = RocketChat.models[k];
});
return { store, sandbox };
}
getIntegrationScript(integration) {
const compiledScript = this.compiledScripts[integration._id];
if (compiledScript && +compiledScript._updatedAt === +integration._updatedAt) {
return compiledScript.script;
}
const script = integration.scriptCompiled;
const { store, sandbox } = this.buildSandbox();
let vmScript;
try {
logger.outgoing.info('Will evaluate script of Trigger', integration.name);
logger.outgoing.debug(script);
vmScript = this.vm.createScript(script, 'script.js');
vmScript.runInNewContext(sandbox);
if (sandbox.Script) {
this.compiledScripts[integration._id] = {
script: new sandbox.Script(),
store,
_updatedAt: integration._updatedAt
};
return this.compiledScripts[integration._id].script;
}
} catch (e) {
logger.outgoing.error(`Error evaluating Script in Trigger ${ integration.name }:`);
logger.outgoing.error(script.replace(/^/gm, ' '));
logger.outgoing.error('Stack Trace:');
logger.outgoing.error(e.stack.replace(/^/gm, ' '));
throw new Meteor.Error('error-evaluating-script');
}
if (!sandbox.Script) {
logger.outgoing.error(`Class "Script" not in Trigger ${ integration.name }:`);
throw new Meteor.Error('class-script-not-found');
}
}
hasScriptAndMethod(integration, method) {
if (integration.scriptEnabled !== true || !integration.scriptCompiled || integration.scriptCompiled.trim() === '') {
return false;
}
let script;
try {
script = this.getIntegrationScript(integration);
} catch (e) {
return false;
}
return typeof script[method] !== 'undefined';
}
executeScript(integration, method, params, historyId) {
let script;
try {
script = this.getIntegrationScript(integration);
} catch (e) {
this.updateHistory({ historyId, step: 'execute-script-getting-script', error: true, errorStack: e });
return;
}
if (!script[method]) {
logger.outgoing.error(`Method "${ method }" no found in the Integration "${ integration.name }"`);
this.updateHistory({ historyId, step: `execute-script-no-method-${ method }` });
return;
}
try {
const { sandbox } = this.buildSandbox(this.compiledScripts[integration._id].store);
sandbox.script = script;
sandbox.method = method;
sandbox.params = params;
this.updateHistory({ historyId, step: `execute-script-before-running-${ method }` });
const result = this.vm.runInNewContext('script[method](params)', sandbox, { timeout: 3000 });
logger.outgoing.debug(`Script method "${ method }" result of the Integration "${ integration.name }" is:`);
logger.outgoing.debug(result);
return result;
} catch (e) {
this.updateHistory({ historyId, step: `execute-script-error-running-${ method }`, error: true, errorStack: e.stack.replace(/^/gm, ' ') });
logger.outgoing.error(`Error running Script in the Integration ${ integration.name }:`);
logger.outgoing.debug(integration.scriptCompiled.replace(/^/gm, ' ')); // Only output the compiled script if debugging is enabled, so the logs don't get spammed.
logger.outgoing.error('Stack:');
logger.outgoing.error(e.stack.replace(/^/gm, ' '));
return;
}
}
eventNameArgumentsToObject() {
const argObject = {
event: arguments[0]
};
switch (argObject.event) {
case 'sendMessage':
if (arguments.length >= 3) {
argObject.message = arguments[1];
argObject.room = arguments[2];
}
break;
case 'fileUploaded':
if (arguments.length >= 2) {
const arghhh = arguments[1];
argObject.user = arghhh.user;
argObject.room = arghhh.room;
argObject.message = arghhh.message;
}
break;
case 'roomArchived':
if (arguments.length >= 3) {
argObject.room = arguments[1];
argObject.user = arguments[2];
}
break;
case 'roomCreated':
if (arguments.length >= 3) {
argObject.owner = arguments[1];
argObject.room = arguments[2];
}
break;
case 'roomJoined':
case 'roomLeft':
if (arguments.length >= 3) {
argObject.user = arguments[1];
argObject.room = arguments[2];
}
break;
case 'userCreated':
if (arguments.length >= 2) {
argObject.user = arguments[1];
}
break;
default:
logger.outgoing.warn(`An Unhandled Trigger Event was called: ${ argObject.event }`);
argObject.event = undefined;
break;
}
logger.outgoing.debug(`Got the event arguments for the event: ${ argObject.event }`, argObject);
return argObject;
}
mapEventArgsToData(data, { event, message, room, owner, user }) {
switch (event) {
case 'sendMessage':
data.channel_id = room._id;
data.channel_name = room.name;
data.message_id = message._id;
data.timestamp = message.ts;
data.user_id = message.u._id;
data.user_name = message.u.username;
data.text = message.msg;
if (message.alias) {
data.alias = message.alias;
}
if (message.bot) {
data.bot = message.bot;
}
break;
case 'fileUploaded':
data.channel_id = room._id;
data.channel_name = room.name;
data.message_id = message._id;
data.timestamp = message.ts;
data.user_id = message.u._id;
data.user_name = message.u.username;
data.text = message.msg;
data.user = user;
data.room = room;
data.message = message;
if (message.alias) {
data.alias = message.alias;
}
if (message.bot) {
data.bot = message.bot;
}
break;
case 'roomCreated':
data.channel_id = room._id;
data.channel_name = room.name;
data.timestamp = room.ts;
data.user_id = owner._id;
data.user_name = owner.username;
data.owner = owner;
data.room = room;
break;
case 'roomArchived':
case 'roomJoined':
case 'roomLeft':
data.timestamp = new Date();
data.channel_id = room._id;
data.channel_name = room.name;
data.user_id = user._id;
data.user_name = user.username;
data.user = user;
data.room = room;
if (user.type === 'bot') {
data.bot = true;
}
break;
case 'userCreated':
data.timestamp = user.createdAt;
data.user_id = user._id;
data.user_name = user.username;
data.user = user;
if (user.type === 'bot') {
data.bot = true;
}
break;
default:
break;
}
}
executeTriggers() {
logger.outgoing.debug('Execute Trigger:', arguments[0]);
const argObject = this.eventNameArgumentsToObject(...arguments);
const { event, message, room } = argObject;
//Each type of event should have an event and a room attached, otherwise we
//wouldn't know how to handle the trigger nor would we have anywhere to send the
//result of the integration
if (!event) {
return;
}
const triggersToExecute = [];
logger.outgoing.debug('Starting search for triggers for the room:', room ? room._id : '__any');
if (room) {
switch (room.t) {
case 'd':
const id = room._id.replace(message.u._id, '');
const username = _.without(room.usernames, message.u.username)[0];
if (this.triggers[`@${ id }`]) {
for (const trigger of Object.values(this.triggers[`@${ id }`])) {
triggersToExecute.push(trigger);
}
}
if (this.triggers.all_direct_messages) {
for (const trigger of Object.values(this.triggers.all_direct_messages)) {
triggersToExecute.push(trigger);
}
}
if (id !== username && this.triggers[`@${ username }`]) {
for (const trigger of Object.values(this.triggers[`@${ username }`])) {
triggersToExecute.push(trigger);
}
}
break;
case 'c':
if (this.triggers.all_public_channels) {
for (const trigger of Object.values(this.triggers.all_public_channels)) {
triggersToExecute.push(trigger);
}
}
if (this.triggers[`#${ room._id }`]) {
for (const trigger of Object.values(this.triggers[`#${ room._id }`])) {
triggersToExecute.push(trigger);
}
}
if (room._id !== room.name && this.triggers[`#${ room.name }`]) {
for (const trigger of Object.values(this.triggers[`#${ room.name }`])) {
triggersToExecute.push(trigger);
}
}
break;
default:
if (this.triggers.all_private_groups) {
for (const trigger of Object.values(this.triggers.all_private_groups)) {
triggersToExecute.push(trigger);
}
}
if (this.triggers[`#${ room._id }`]) {
for (const trigger of Object.values(this.triggers[`#${ room._id }`])) {
triggersToExecute.push(trigger);
}
}
if (room._id !== room.name && this.triggers[`#${ room.name }`]) {
for (const trigger of Object.values(this.triggers[`#${ room.name }`])) {
triggersToExecute.push(trigger);
}
}
break;
}
}
if (this.triggers.__any) {
//For outgoing integration which don't rely on rooms.
for (const trigger of Object.values(this.triggers.__any)) {
triggersToExecute.push(trigger);
}
}
logger.outgoing.debug(`Found ${ triggersToExecute.length } to iterate over and see if the match the event.`);
for (const triggerToExecute of triggersToExecute) {
logger.outgoing.debug(`Is "${ triggerToExecute.name }" enabled, ${ triggerToExecute.enabled }, and what is the event? ${ triggerToExecute.event }`);
if (triggerToExecute.enabled === true && triggerToExecute.event === event) {
this.executeTrigger(triggerToExecute, argObject);
}
}
}
executeTrigger(trigger, argObject) {
for (const url of trigger.urls) {
this.executeTriggerUrl(url, trigger, argObject, 0);
}
}
executeTriggerUrl(url, trigger, { event, message, room, owner, user }, theHistoryId, tries = 0) {
if (!this.isTriggerEnabled(trigger)) {
logger.outgoing.warn(`The trigger "${ trigger.name }" is no longer enabled, stopping execution of it at try: ${ tries }`);
return;
}
logger.outgoing.debug(`Starting to execute trigger: ${ trigger.name } (${ trigger._id })`);
let word;
//Not all triggers/events support triggerWords
if (RocketChat.integrations.outgoingEvents[event].use.triggerWords) {
if (trigger.triggerWords && trigger.triggerWords.length > 0) {
for (const triggerWord of trigger.triggerWords) {
if (!trigger.triggerWordAnywhere && message.msg.indexOf(triggerWord) === 0) {
word = triggerWord;
break;
} else if (trigger.triggerWordAnywhere && message.msg.includes(triggerWord)) {
word = triggerWord;
break;
}
}
// Stop if there are triggerWords but none match
if (!word) {
logger.outgoing.debug(`The trigger word which "${ trigger.name }" was expecting could not be found, not executing.`);
return;
}
}
}
const historyId = this.updateHistory({ step: 'start-execute-trigger-url', integration: trigger, event });
const data = {
token: trigger.token,
bot: false
};
if (word) {
data.trigger_word = word;
}
this.mapEventArgsToData(data, { trigger, event, message, room, owner, user });
this.updateHistory({ historyId, step: 'mapped-args-to-data', data, triggerWord: word });
logger.outgoing.info(`Will be executing the Integration "${ trigger.name }" to the url: ${ url }`);
logger.outgoing.debug(data);
let opts = {
params: {},
method: 'POST',
url,
data,
auth: undefined,
npmRequestOptions: {
rejectUnauthorized: !RocketChat.settings.get('Allow_Invalid_SelfSigned_Certs'),
strictSSL: !RocketChat.settings.get('Allow_Invalid_SelfSigned_Certs')
},
headers: {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36'
}
};
if (this.hasScriptAndMethod(trigger, 'prepare_outgoing_request')) {
opts = this.executeScript(trigger, 'prepare_outgoing_request', { request: opts }, historyId);
}
this.updateHistory({ historyId, step: 'after-maybe-ran-prepare', ranPrepareScript: true });
if (!opts) {
this.updateHistory({ historyId, step: 'after-prepare-no-opts', finished: true });
return;
}
if (opts.message) {
const prepareMessage = this.sendMessage({ trigger, room, message: opts.message, data });
this.updateHistory({ historyId, step: 'after-prepare-send-message', prepareSentMessage: prepareMessage });
}
if (!opts.url || !opts.method) {
this.updateHistory({ historyId, step: 'after-prepare-no-url_or_method', finished: true });
return;
}
this.updateHistory({ historyId, step: 'pre-http-call', url: opts.url, httpCallData: opts.data });
HTTP.call(opts.method, opts.url, opts, (error, result) => {
if (!result) {
logger.outgoing.warn(`Result for the Integration ${ trigger.name } to ${ url } is empty`);
} else {
logger.outgoing.info(`Status code for the Integration ${ trigger.name } to ${ url } is ${ result.statusCode }`);
}
this.updateHistory({ historyId, step: 'after-http-call', httpError: error, httpResult: result });
if (this.hasScriptAndMethod(trigger, 'process_outgoing_response')) {
const sandbox = {
request: opts,
response: {
error,
status_code: result ? result.statusCode : undefined, //These values will be undefined to close issues #4175, #5762, and #5896
content: result ? result.data : undefined,
content_raw: result ? result.content : undefined,
headers: result ? result.headers : {}
}
};
const scriptResult = this.executeScript(trigger, 'process_outgoing_response', sandbox, historyId);
if (scriptResult && scriptResult.content) {
const resultMessage = this.sendMessage({ trigger, room, message: scriptResult.content, data });
this.updateHistory({ historyId, step: 'after-process-send-message', processSentMessage: resultMessage, finished: true });
return;
}
if (scriptResult === false) {
this.updateHistory({ historyId, step: 'after-process-false-result', finished: true });
return;
}
}
// if the result contained nothing or wasn't a successful statusCode
if (!result || !this.successResults.includes(result.statusCode)) {
if (error) {
logger.outgoing.error(`Error for the Integration "${ trigger.name }" to ${ url } is:`);
logger.outgoing.error(error);
}
if (result) {
logger.outgoing.error(`Error for the Integration "${ trigger.name }" to ${ url } is:`);
logger.outgoing.error(result);
if (result.statusCode === 410) {
this.updateHistory({ historyId, step: 'after-process-http-status-410', error: true });
logger.outgoing.error(`Disabling the Integration "${ trigger.name }" because the status code was 401 (Gone).`);
RocketChat.models.Integrations.update({ _id: trigger._id }, { $set: { enabled: false }});
return;
}
if (result.statusCode === 500) {
this.updateHistory({ historyId, step: 'after-process-http-status-500', error: true });
logger.outgoing.error(`Error "500" for the Integration "${ trigger.name }" to ${ url }.`);
logger.outgoing.error(result.content);
return;
}
}
if (trigger.retryFailedCalls) {
if (tries < trigger.retryCount && trigger.retryDelay) {
this.updateHistory({ historyId, error: true, step: `going-to-retry-${ tries + 1 }` });
let waitTime;
switch (trigger.retryDelay) {
case 'powers-of-ten':
// Try again in 0.1s, 1s, 10s, 1m40s, 16m40s, 2h46m40s, 27h46m40s, etc
waitTime = Math.pow(10, tries + 2);
break;
case 'powers-of-two':
// 2 seconds, 4 seconds, 8 seconds
waitTime = Math.pow(2, tries + 1) * 1000;
break;
case 'increments-of-two':
// 2 second, 4 seconds, 6 seconds, etc
waitTime = (tries + 1) * 2 * 1000;
break;
default:
const er = new Error('The integration\'s retryDelay setting is invalid.');
this.updateHistory({ historyId, step: 'failed-and-retry-delay-is-invalid', error: true, errorStack: er.stack });
return;
}
logger.outgoing.info(`Trying the Integration ${ trigger.name } to ${ url } again in ${ waitTime } milliseconds.`);
Meteor.setTimeout(() => {
this.executeTriggerUrl(url, trigger, { event, message, room, owner, user }, historyId, tries + 1);
}, waitTime);
} else {
this.updateHistory({ historyId, step: 'too-many-retries', error: true });
}
} else {
this.updateHistory({ historyId, step: 'failed-and-not-configured-to-retry', error: true });
}
return;
}
//process outgoing webhook response as a new message
if (result && this.successResults.includes(result.statusCode)) {
if (result && result.data && (result.data.text || result.data.attachments)) {
const resultMsg = this.sendMessage({ trigger, room, message: result.data, data });
this.updateHistory({ historyId, step: 'url-response-sent-message', resultMessage: resultMsg, finished: true });
}
}
});
}
replay(integration, history) {
if (!integration || integration.type !== 'webhook-outgoing') {
throw new Meteor.Error('integration-type-must-be-outgoing', 'The integration type to replay must be an outgoing webhook.');
}
if (!history || !history.data) {
throw new Meteor.Error('history-data-must-be-defined', 'The history data must be defined to replay an integration.');
}
const event = history.event;
const message = RocketChat.models.Messages.findOneById(history.data.message_id);
const room = RocketChat.models.Rooms.findOneById(history.data.channel_id);
const user = RocketChat.models.Users.findOneById(history.data.user_id);
let owner;
if (history.data.owner && history.data.owner._id) {
owner = RocketChat.models.Users.findOneById(history.data.owner._id);
}
this.executeTriggerUrl(history.url, integration, { event, message, room, owner, user });
}
};
| mwharrison/Rocket.Chat | packages/rocketchat-integrations/server/lib/triggerHandler.js | JavaScript | mit | 23,767 |
'use strict';
module.exports = function (t, a) {
t(document.createElement('p'));
};
| medikoo/site-tree | test/lib/fix-dynamic-style-sheets.js | JavaScript | mit | 86 |
import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<React.Fragment><path d="M11 17h10v-2H11v2zm-8-5l4 4V8l-4 4zm0 9h18v-2H3v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z" /></React.Fragment>
, 'FormatIndentDecreaseSharp');
| Kagami/material-ui | packages/material-ui-icons/src/FormatIndentDecreaseSharp.js | JavaScript | mit | 285 |
import { Button } from './button';
export { Button };
export default null;
| rs3d/fuse-box | playground/react_ssr_csr/src/client/components/button/index.js | JavaScript | mit | 77 |
/**
* @author Richard Davey <[email protected]>
* @copyright 2019 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var imageHeight = 0;
/**
* @function addFrame
* @private
* @since 3.0.0
*/
var addFrame = function (texture, sourceIndex, name, frame)
{
// The frame values are the exact coordinates to cut the frame out of the atlas from
var y = imageHeight - frame.y - frame.height;
texture.add(name, sourceIndex, frame.x, y, frame.width, frame.height);
// These are the original (non-trimmed) sprite values
/*
if (src.trimmed)
{
newFrame.setTrim(
src.sourceSize.w,
src.sourceSize.h,
src.spriteSourceSize.x,
src.spriteSourceSize.y,
src.spriteSourceSize.w,
src.spriteSourceSize.h
);
}
*/
};
/**
* Parses a Unity YAML File and creates Frames in the Texture.
* For more details about Sprite Meta Data see https://docs.unity3d.com/ScriptReference/SpriteMetaData.html
*
* @function Phaser.Textures.Parsers.UnityYAML
* @memberof Phaser.Textures.Parsers
* @private
* @since 3.0.0
*
* @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to.
* @param {integer} sourceIndex - The index of the TextureSource.
* @param {object} yaml - The YAML data.
*
* @return {Phaser.Textures.Texture} The Texture modified by this parser.
*/
var UnityYAML = function (texture, sourceIndex, yaml)
{
// Add in a __BASE entry (for the entire atlas)
var source = texture.source[sourceIndex];
texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height);
imageHeight = source.height;
var data = yaml.split('\n');
var lineRegExp = /^[ ]*(- )*(\w+)+[: ]+(.*)/;
var prevSprite = '';
var currentSprite = '';
var rect = { x: 0, y: 0, width: 0, height: 0 };
// var pivot = { x: 0, y: 0 };
// var border = { x: 0, y: 0, z: 0, w: 0 };
for (var i = 0; i < data.length; i++)
{
var results = data[i].match(lineRegExp);
if (!results)
{
continue;
}
var isList = (results[1] === '- ');
var key = results[2];
var value = results[3];
if (isList)
{
if (currentSprite !== prevSprite)
{
addFrame(texture, sourceIndex, currentSprite, rect);
prevSprite = currentSprite;
}
rect = { x: 0, y: 0, width: 0, height: 0 };
}
if (key === 'name')
{
// Start new list
currentSprite = value;
continue;
}
switch (key)
{
case 'x':
case 'y':
case 'width':
case 'height':
rect[key] = parseInt(value, 10);
break;
// case 'pivot':
// pivot = eval('var obj = ' + value);
// break;
// case 'border':
// border = eval('var obj = ' + value);
// break;
}
}
if (currentSprite !== prevSprite)
{
addFrame(texture, sourceIndex, currentSprite, rect);
}
return texture;
};
module.exports = UnityYAML;
/*
Example data:
TextureImporter:
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
spriteSheet:
sprites:
- name: asteroids_0
rect:
serializedVersion: 2
x: 5
y: 328
width: 65
height: 82
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
- name: asteroids_1
rect:
serializedVersion: 2
x: 80
y: 322
width: 53
height: 88
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
spritePackingTag: Asteroids
*/
| mahill/phaser | src/textures/parsers/UnityYAML.js | JavaScript | mit | 3,910 |
import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><g><path d="M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 9c-2.67 0-8 1.34-8 4v2c0 .55.45 1 1 1h14c.55 0 1-.45 1-1v-2c0-2.66-5.33-4-8-4z" /></g></React.Fragment>
, 'PersonOutlineRounded');
| Kagami/material-ui | packages/material-ui-icons/src/PersonOutlineRounded.js | JavaScript | mit | 509 |
'use strict';
var element = require('../element');
module.exports = function(node) {
var el = element('phpdbg');
el.innerHTML = node.nodeValue;
return el;
};
| ralt/phpdbg-ext | src/phpdbg/commands/phpdbg.js | JavaScript | mit | 172 |
$(function () {
// Prepare demo data
var data = [
{
"hc-key": "dm-lu",
"value": 0
},
{
"hc-key": "dm-ma",
"value": 1
},
{
"hc-key": "dm-pk",
"value": 2
},
{
"hc-key": "dm-da",
"value": 3
},
{
"hc-key": "dm-pl",
"value": 4
},
{
"hc-key": "dm-pr",
"value": 5
},
{
"hc-key": "dm-an",
"value": 6
},
{
"hc-key": "dm-go",
"value": 7
},
{
"hc-key": "dm-jn",
"value": 8
},
{
"hc-key": "dm-jh",
"value": 9
}
];
// Initiate the chart
$('#container').highcharts('Map', {
title : {
text : 'Highmaps basic demo'
},
subtitle : {
text : 'Source map: <a href="http://code.highcharts.com/mapdata/countries/dm/dm-all.js">Dominica</a>'
},
mapNavigation: {
enabled: true,
buttonOptions: {
verticalAlign: 'bottom'
}
},
colorAxis: {
min: 0
},
series : [{
data : data,
mapData: Highcharts.maps['countries/dm/dm-all'],
joinBy: 'hc-key',
name: 'Random data',
states: {
hover: {
color: '#BADA55'
}
},
dataLabels: {
enabled: true,
format: '{point.name}'
}
}]
});
});
| Oxyless/highcharts-export-image | lib/highcharts.com/samples/mapdata/countries/dm/dm-all/demo.js | JavaScript | mit | 1,719 |
/*global require: false, module: false, process: false */
"use strict";
var mod = function(
_,
Promise,
Options,
Logger
) {
var Log = Logger.create("AppContainer");
var WebAppContainer = function() {
this.initialize.apply(this, arguments);
};
_.extend(WebAppContainer.prototype, {
initialize: function(opts) {
opts = Options.fromObject(opts)
this._app = opts.getOrError("app");
},
start: Promise.method(function() {
return Promise
.bind(this)
.then(function() {
return this._app.start();
});
}),
stop: Promise.method(function(reason) {
return this._app.stop().then(function() {
if (reason) {
Log.error("Stopping due to reason:", reason);
}
});
})
});
return WebAppContainer;
};
module.exports = mod(
require("underscore"),
require("bluebird"),
require("../core/options"),
require("../core/logging/logger")
);
| maseb/thicket | src/web/thicket/appkit/web-app-container.js | JavaScript | mit | 963 |
"use strict";
const Base = require('yeoman-generator');
const generatorArguments = require('./arguments');
const generatorOptions = require('./options');
const generatorSteps = require('./steps');
module.exports = class ResponseGenerator extends Base {
constructor(args, options) {
super(args, options);
Object.keys(generatorArguments).forEach(key => this.argument(key, generatorArguments[key]));
Object.keys(generatorOptions).forEach(key => this.option(key, generatorOptions[key]));
this.description = 'Scaffold a new response';
}
get configuring() {
return generatorSteps.configuring;
}
get conflicts() {
return generatorSteps.conflicts;
}
get default() {
return generatorSteps.default;
}
get end() {
return generatorSteps.end;
}
get initializing() {
return generatorSteps.initializing
}
get install() {
return generatorSteps.install;
}
get prompting() {
return generatorSteps.prompting
}
get writing() {
return generatorSteps.writing;
}
};
| italoag/generator-sails-rest-api | generators/response/index.js | JavaScript | mit | 1,039 |
var _extend = function(obj, source) {
for (var prop in source) {
obj[prop] = source[prop];
}
return obj;
};
var STATUS = {
blank: 'blank',
booked: 'booked',
overflowing: 'overflowing'
};
var ACTION = {
initialBook: 'initialBook',
book: 'book'
};
/**
* SequenceObject
*/
var SequenceObject, so;
SequenceObject = so = function(o){
this.registry = o.registry;
this.config = o.config;
this.store = this.registry.store;
this.logger = this.registry.logger;
this.state = {};
this.state.key = this.config.key;
this.state.segment = this.config.segment;
this.state.prebook = this.config.prebook;
this.state.initialCursor = this.config.initialCursor;
this.state.cursor = null;
this.state.valve = null;
this.state.prebookValve = null;
this.state.nextValve = null;
this.state.status = STATUS.blank;
this.state.ready = false;
this.state.actioning = false;
};
so.STATUS = STATUS;
so.ACTION = ACTION;
so.build = function(o){
var config = _extend({}, so.defaults);
o.config = _extend(config, o.config);
return new so(o);
};
so.prototype.init = function(cb){
var seq = this;
this.store.book(this.state, function(action){
seq.update(action);
cb(action.successful);
});
};
so.prototype.book = function(){
var seq = this;
this.store.book(this.state, function(action){
seq.update(action);
});
};
so.prototype.update = function(action){
if(action.successful){
if(action.name==ACTION.initialBook){
this.state.cursor = this.config.initialCursor;
this.state.valve = action.valve;
this.state.prebookValve = this.state.cursor + this.config.prebook;
this.state.nextValve = null;
}
else{
if(this.state.status==STATUS.blank || this.state.status==STATUS.overflowing ){
this.state.cursor = action.valve - this.config.segment;
this.state.valve = action.valve;
this.state.prebookValve = this.state.cursor + this.config.prebook;
this.state.nextValve = null;
}
else{
this.state.nextValve = action.valve;
}
}
this.state.ready = true;
this.state.status = STATUS.booked;
this.logger.info('Process ' + process.pid + ': The sequence [' + this.state.key + '] successfully booked a new valve ' + action.valve);
}
else{
if(action.name==ACTION.initialBook){
this.state.ready = false;
}
else{
//leave state as it was
}
this.logger.warn('Process ' + process.pid + ': The sequence [' + this.state.key + '] failed to book a new valve. ' +
'And currently, its valve is ' + this.state.valve + ', and its cursor is ' + this.state.cursor);
}
this.state.actioning = false;
};
so.prototype.check = function(){
if(this.state.status==STATUS.booked){
if(!this.state.nextValve){
if(this.state.cursor < this.state.prebookValve){
//Do nothing
}
else if(this.state.cursor < this.state.valve){
this.book();
}
else{
this.onOverflow();
this.book();
}
}
else{
if(this.state.cursor < this.state.valve){
//Do nothing
}
else if(this.state.cursor == this.state.valve){
this.onStep();
}
else{
this.logger.warn('Process ' + process.pid + ': The sequence [' + this.state.key + '] is in a illegal status ' + this.state.status);
this.onOverflow();
this.book();
}
}
}
else if(this.state.status==STATUS.overflowing){
if(!this.state.nextValve){
this.book();
}
else{
this.onStep();
}
}
else{
this.logger.error('unknown status: ' + this.state.status);
this.book();
}
};
so.prototype.onStep = function(){
this.logger.info('Process ' + process.pid + ': The sequence [' + this.state.key + '] stepped in status ' + this.state.status);
this.state.cursor = this.state.nextValve - this.config.segment;
this.state.valve = this.state.nextValve;
this.state.prebookValve = this.state.cursor + this.config.prebook;
this.state.nextValve = null;
};
so.prototype.onOverflow = function(){
this.logger.info('Process ' + process.pid + ': The sequence [' + this.state.key + '] is ' + STATUS.overflowing);
this.state.status = STATUS.overflowing;
var base = (new Date().getTime())*1000;
this.state.cursor = base;
this.state.valve = base + this.config.segment;
this.state.nextValve = null;
this.logger.warn('Process ' + process.pid + ': overflow value ' + this.state.cursor);
};
so.prototype.next = function(){
if(this.state.ready){
this.val = this.state.cursor++;
////debug
//if(this.val>10000000){
// console.error('Process ' + process.pid + ': overflowed value: ' + this.val);
//}
this.check();
return this;
}
else{
throw new Error('Process ' + process.pid + ': The sequence [' + this.state.key + '] is not ready for generating value');
}
};
module.exports = so;
| henryleu/mysequence | src/sequence.js | JavaScript | mit | 5,414 |
'use strict';
const _ = require('lodash');
const moment = require('moment-timezone');
module.exports = BaseTypes => {
BaseTypes.ABSTRACT.prototype.dialectTypes = 'https://mariadb.com/kb/en/library/resultset/#field-types';
/**
* types: [buffer_type, ...]
* @see documentation : https://mariadb.com/kb/en/library/resultset/#field-types
* @see connector implementation : https://github.com/MariaDB/mariadb-connector-nodejs/blob/master/lib/const/field-type.js
*/
BaseTypes.DATE.types.mariadb = ['DATETIME'];
BaseTypes.STRING.types.mariadb = ['VAR_STRING'];
BaseTypes.CHAR.types.mariadb = ['STRING'];
BaseTypes.TEXT.types.mariadb = ['BLOB'];
BaseTypes.TINYINT.types.mariadb = ['TINY'];
BaseTypes.SMALLINT.types.mariadb = ['SHORT'];
BaseTypes.MEDIUMINT.types.mariadb = ['INT24'];
BaseTypes.INTEGER.types.mariadb = ['LONG'];
BaseTypes.BIGINT.types.mariadb = ['LONGLONG'];
BaseTypes.FLOAT.types.mariadb = ['FLOAT'];
BaseTypes.TIME.types.mariadb = ['TIME'];
BaseTypes.DATEONLY.types.mariadb = ['DATE'];
BaseTypes.BOOLEAN.types.mariadb = ['TINY'];
BaseTypes.BLOB.types.mariadb = ['TINYBLOB', 'BLOB', 'LONGBLOB'];
BaseTypes.DECIMAL.types.mariadb = ['NEWDECIMAL'];
BaseTypes.UUID.types.mariadb = false;
BaseTypes.ENUM.types.mariadb = false;
BaseTypes.REAL.types.mariadb = ['DOUBLE'];
BaseTypes.DOUBLE.types.mariadb = ['DOUBLE'];
BaseTypes.GEOMETRY.types.mariadb = ['GEOMETRY'];
BaseTypes.JSON.types.mariadb = ['JSON'];
class DECIMAL extends BaseTypes.DECIMAL {
toSql() {
let definition = super.toSql();
if (this._unsigned) {
definition += ' UNSIGNED';
}
if (this._zerofill) {
definition += ' ZEROFILL';
}
return definition;
}
}
class DATE extends BaseTypes.DATE {
toSql() {
return `DATETIME${this._length ? `(${this._length})` : ''}`;
}
_stringify(date, options) {
date = this._applyTimezone(date, options);
return date.format('YYYY-MM-DD HH:mm:ss.SSS');
}
static parse(value, options) {
value = value.string();
if (value === null) {
return value;
}
if (moment.tz.zone(options.timezone)) {
value = moment.tz(value, options.timezone).toDate();
}
else {
value = new Date(`${value} ${options.timezone}`);
}
return value;
}
}
class DATEONLY extends BaseTypes.DATEONLY {
static parse(value) {
return value.string();
}
}
class UUID extends BaseTypes.UUID {
toSql() {
return 'CHAR(36) BINARY';
}
}
class GEOMETRY extends BaseTypes.GEOMETRY {
constructor(type, srid) {
super(type, srid);
if (_.isEmpty(this.type)) {
this.sqlType = this.key;
}
else {
this.sqlType = this.type;
}
}
toSql() {
return this.sqlType;
}
}
class ENUM extends BaseTypes.ENUM {
toSql(options) {
return `ENUM(${this.values.map(value => options.escape(value)).join(', ')})`;
}
}
class JSONTYPE extends BaseTypes.JSON {
_stringify(value, options) {
return options.operation === 'where' && typeof value === 'string' ? value
: JSON.stringify(value);
}
}
return {
ENUM,
DATE,
DATEONLY,
UUID,
GEOMETRY,
DECIMAL,
JSON: JSONTYPE
};
};
| yjwong/sequelize | lib/dialects/mariadb/data-types.js | JavaScript | mit | 3,315 |
module.exports = function () {
var faker = require('faker');
var _ = require('lodash');
var getUserInfo = require('./mocks/getUserInfo.js');
var productName = function () {
return faker.commerce.productAdjective() +
' ' +
faker.commerce.productMaterial() +
' Widget';
};
var productImage = function () {
return faker.image.imageUrl();
};
// This is your json structurn each named object below can match a remote call
return {
getUserInfo: getUserInfo,
getSidebar: _.times(3, function (id) {
return {
id: id + 1,
name: 'Home',
icon: 'home',
iconBackground: faker.internet.color(),
sequence: id + 1
};
}),
products: _.times(9, function (id) {
var title = productName();
return {
id: id + 1,
title: title,
image: productImage(),
price: faker.commerce.price(),
description: faker.lorem.paragraph(),
summary: faker.lorem.paragraph()
};
}),
products6: _.times(6, function (id) {
var title = productName();
return {
id: id + 1,
title: title,
image: productImage(),
price: faker.commerce.price(),
description: faker.lorem.paragraph(),
summary: faker.lorem.paragraph()
};
})
};
};
| matt-newell/generator-force | generators/ng/templates/api/generate.js | JavaScript | mit | 1,333 |
/*jshint esversion: 6 */
import Service from '@ember/service';
export default Service.extend({
createCustomBlock(name, options, callback_to_change_block) {
options.colour = options.colour || '#4453ff';
if (Blockly.Blocks[name]) {
//console.warn(`Redefiniendo el bloque ${name}`);
}
Blockly.Blocks[name] = {
init: function () {
this.jsonInit(options);
if (callback_to_change_block) {
callback_to_change_block.call(this);
}
}
};
Blockly.Blocks[name].isCustomBlock = true;
if (!Blockly.MyLanguage) {
Blockly.MyLanguage = Blockly.JavaScript;
}
if (options.code) {
Blockly.MyLanguage[name] = function (block) {
let variables = options.code.match(/\$(\w+)/g);
let code = options.code;
if (variables) {
variables.forEach((v) => {
let regex = new RegExp('\\' + v, "g");
let variable_name = v.slice(1);
var variable_object = null;
if (variable_name === "DO") {
variable_object = Blockly.JavaScript.statementToCode(block, variable_name);
} else {
variable_object = Blockly.MyLanguage.valueToCode(block, variable_name) || block.getFieldValue(variable_name) || null;
}
code = code.replace(regex, variable_object);
});
}
return code;
};
}
return Blockly.Blocks[name];
},
createBlockWithAsyncDropdown(name, options) {
function callback_to_change_block() {
this.
appendDummyInput().
appendField(options.label || "").
appendField(new Blockly.FieldDropdown(options.callbackDropdown), 'DROPDOWN_VALUE');
}
return this.createCustomBlock(name, options, callback_to_change_block);
},
createCustomBlockWithHelper(name, options) {
let block_def = {
message0: options.descripcion,
colour: options.colour || '#4a6cd4',
previousStatement: true,
nextStatement: true,
args0: [],
code: options.code || `hacer(actor_id, "${options.comportamiento}", ${options.argumentos});`,
};
if (options.icono) {
block_def.message0 = `%1 ${options.descripcion}`;
block_def.args0.push({
"type": "field_image",
"src": `iconos/${options.icono}`,
"width": 16,
"height": 16,
"alt": "*"
});
}
return this.createCustomBlock(name, block_def);
},
createBlockValue(name, options) {
let block = this.createCustomBlock(name, {
message0: `%1 ${options.descripcion}`,
colour: options.colour || '#4a6cd4',
output: 'String',
args0: [
{
"type": "field_image",
"src": `iconos/${options.icono}`,
"width": 16,
"height": 16,
"alt": "*"
}
],
});
Blockly.MyLanguage[name] = function () {
return [`'${options.valor}'`, Blockly.JavaScript.ORDER_ATOMIC];
};
return block;
},
getBlocksList() {
return Object.keys(Blockly.Blocks);
},
getCustomBlocksList() {
return Object.keys(Blockly.Blocks).filter((e) => {
return Blockly.Blocks[e].isCustomBlock;
}
);
},
createAlias(new_name, original_block_name) {
let original_block = Blockly.Blocks[original_block_name];
Blockly.Blocks[new_name] = Object.assign({}, original_block);
let new_block = Blockly.Blocks[new_name];
new_block.isCustomBlock = true;
new_block.aliases = [original_block_name];
if (!original_block.aliases)
original_block.aliases = [];
original_block.aliases.push(new_name);
if (!Blockly.MyLanguage) {
Blockly.MyLanguage = Blockly.JavaScript;
}
Blockly.MyLanguage[new_name] = Blockly.JavaScript[original_block_name];
return Blockly.Blocks[new_name];
},
setStartHat(state) {
Blockly.BlockSvg.START_HAT = state;
}
});
| hugoruscitti/ember-blockly | addon/services/blockly.js | JavaScript | mit | 3,914 |
webpackJsonp([0],{
/***/ 109:
/***/ (function(module, exports) {
function webpackEmptyAsyncContext(req) {
// Here Promise.resolve().then() is used instead of new Promise() to prevent
// uncatched exception popping up in devtools
return Promise.resolve().then(function() {
throw new Error("Cannot find module '" + req + "'.");
});
}
webpackEmptyAsyncContext.keys = function() { return []; };
webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
module.exports = webpackEmptyAsyncContext;
webpackEmptyAsyncContext.id = 109;
/***/ }),
/***/ 150:
/***/ (function(module, exports) {
function webpackEmptyAsyncContext(req) {
// Here Promise.resolve().then() is used instead of new Promise() to prevent
// uncatched exception popping up in devtools
return Promise.resolve().then(function() {
throw new Error("Cannot find module '" + req + "'.");
});
}
webpackEmptyAsyncContext.keys = function() { return []; };
webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
module.exports = webpackEmptyAsyncContext;
webpackEmptyAsyncContext.id = 150;
/***/ }),
/***/ 193:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TabsPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__home_home__ = __webpack_require__(194);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__about_about__ = __webpack_require__(196);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__contact_contact__ = __webpack_require__(197);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var TabsPage = /** @class */ (function () {
function TabsPage() {
// this tells the tabs component which Pages
// should be each tab's root Page
this.tab1Root = __WEBPACK_IMPORTED_MODULE_1__home_home__["a" /* HomePage */];
this.tab2Root = __WEBPACK_IMPORTED_MODULE_2__about_about__["a" /* AboutPage */];
this.tab3Root = __WEBPACK_IMPORTED_MODULE_3__contact_contact__["a" /* ContactPage */];
}
TabsPage = __decorate([
Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({template:/*ion-inline-start:"/home/marcus/ionic2-camera-demo/src/pages/tabs/tabs.html"*/'<ion-tabs>\n <ion-tab [root]="tab1Root" tabTitle="Home" tabIcon="home"></ion-tab>\n <ion-tab [root]="tab2Root" tabTitle="About" tabIcon="information-circle"></ion-tab>\n <ion-tab [root]="tab3Root" tabTitle="Contact" tabIcon="contacts"></ion-tab>\n</ion-tabs>\n'/*ion-inline-end:"/home/marcus/ionic2-camera-demo/src/pages/tabs/tabs.html"*/
}),
__metadata("design:paramtypes", [])
], TabsPage);
return TabsPage;
}());
//# sourceMappingURL=tabs.js.map
/***/ }),
/***/ 194:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HomePage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(33);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_native_camera__ = __webpack_require__(195);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var HomePage = /** @class */ (function () {
function HomePage(navCtrl, camera) {
this.navCtrl = navCtrl;
this.camera = camera;
this.images = [];
}
HomePage.prototype.takePhoto = function () {
var _this = this;
var options = {
quality: 80,
destinationType: this.camera.DestinationType.DATA_URL,
sourceType: this.camera.PictureSourceType.CAMERA,
allowEdit: false,
encodingType: this.camera.EncodingType.JPEG,
saveToPhotoAlbum: false
};
this.camera.getPicture(options).then(function (imageData) {
// imageData is either a base64 encoded string or a file URI
// If it's base64:
var base64Image = 'data:image/jpeg;base64,' + imageData;
_this.images.unshift({
src: base64Image
});
}, function (err) {
// Handle error
});
};
HomePage = __decorate([
Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
selector: 'page-home',template:/*ion-inline-start:"/home/marcus/ionic2-camera-demo/src/pages/home/home.html"*/'<ion-header>\n <ion-navbar>\n <ion-title>Home</ion-title>\n </ion-navbar>\n</ion-header>\n<ion-content>\n <ion-slides style="height: 50vh">\n <ion-slide *ngFor="let image of images">\n <ion-card>\n <img [src]="image.src"/>\n </ion-card>\n </ion-slide>\n </ion-slides>\n <p>\n <button ion-button round icon-only block (click)="takePhoto()">\n <ion-icon name="camera"></ion-icon>\n </button>\n </p>\n</ion-content>\n'/*ion-inline-end:"/home/marcus/ionic2-camera-demo/src/pages/home/home.html"*/
}),
__metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["d" /* NavController */], __WEBPACK_IMPORTED_MODULE_2__ionic_native_camera__["a" /* Camera */]])
], HomePage);
return HomePage;
}());
//# sourceMappingURL=home.js.map
/***/ }),
/***/ 196:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AboutPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(33);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var AboutPage = /** @class */ (function () {
function AboutPage(navCtrl) {
this.navCtrl = navCtrl;
}
AboutPage = __decorate([
Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
selector: 'page-about',template:/*ion-inline-start:"/home/marcus/ionic2-camera-demo/src/pages/about/about.html"*/'<ion-header>\n <ion-navbar>\n <ion-title>\n About\n </ion-title>\n </ion-navbar>\n</ion-header>\n\n<ion-content padding>\n\n</ion-content>\n'/*ion-inline-end:"/home/marcus/ionic2-camera-demo/src/pages/about/about.html"*/
}),
__metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["d" /* NavController */]])
], AboutPage);
return AboutPage;
}());
//# sourceMappingURL=about.js.map
/***/ }),
/***/ 197:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ContactPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(33);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var ContactPage = /** @class */ (function () {
function ContactPage(navCtrl) {
this.navCtrl = navCtrl;
}
ContactPage = __decorate([
Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
selector: 'page-contact',template:/*ion-inline-start:"/home/marcus/ionic2-camera-demo/src/pages/contact/contact.html"*/'<ion-header>\n <ion-navbar>\n <ion-title>\n Contact\n </ion-title>\n </ion-navbar>\n</ion-header>\n\n<ion-content>\n <ion-list>\n <ion-list-header>Follow us on Twitter</ion-list-header>\n <ion-item>\n <ion-icon name="ionic" item-left></ion-icon>\n @ionicframework\n </ion-item>\n </ion-list>\n</ion-content>\n'/*ion-inline-end:"/home/marcus/ionic2-camera-demo/src/pages/contact/contact.html"*/
}),
__metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["d" /* NavController */]])
], ContactPage);
return ContactPage;
}());
//# sourceMappingURL=contact.js.map
/***/ }),
/***/ 198:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dynamic__ = __webpack_require__(199);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__app_module__ = __webpack_require__(221);
Object(__WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dynamic__["a" /* platformBrowserDynamic */])().bootstrapModule(__WEBPACK_IMPORTED_MODULE_1__app_module__["a" /* AppModule */]);
//# sourceMappingURL=main.js.map
/***/ }),
/***/ 221:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(33);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__app_component__ = __webpack_require__(264);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__pages_about_about__ = __webpack_require__(196);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pages_contact_contact__ = __webpack_require__(197);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__pages_home_home__ = __webpack_require__(194);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pages_tabs_tabs__ = __webpack_require__(193);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__angular_platform_browser__ = __webpack_require__(29);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__ionic_native_status_bar__ = __webpack_require__(190);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__ionic_native_splash_screen__ = __webpack_require__(192);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__ionic_native_camera__ = __webpack_require__(195);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var AppModule = /** @class */ (function () {
function AppModule() {
}
AppModule = __decorate([
Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["I" /* NgModule */])({
declarations: [
__WEBPACK_IMPORTED_MODULE_2__app_component__["a" /* MyApp */],
__WEBPACK_IMPORTED_MODULE_3__pages_about_about__["a" /* AboutPage */],
__WEBPACK_IMPORTED_MODULE_4__pages_contact_contact__["a" /* ContactPage */],
__WEBPACK_IMPORTED_MODULE_5__pages_home_home__["a" /* HomePage */],
__WEBPACK_IMPORTED_MODULE_6__pages_tabs_tabs__["a" /* TabsPage */]
],
imports: [
__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["c" /* IonicModule */].forRoot(__WEBPACK_IMPORTED_MODULE_2__app_component__["a" /* MyApp */], {}, {
links: []
}),
__WEBPACK_IMPORTED_MODULE_7__angular_platform_browser__["a" /* BrowserModule */]
],
bootstrap: [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["a" /* IonicApp */]],
entryComponents: [
__WEBPACK_IMPORTED_MODULE_2__app_component__["a" /* MyApp */],
__WEBPACK_IMPORTED_MODULE_3__pages_about_about__["a" /* AboutPage */],
__WEBPACK_IMPORTED_MODULE_4__pages_contact_contact__["a" /* ContactPage */],
__WEBPACK_IMPORTED_MODULE_5__pages_home_home__["a" /* HomePage */],
__WEBPACK_IMPORTED_MODULE_6__pages_tabs_tabs__["a" /* TabsPage */]
],
providers: [
__WEBPACK_IMPORTED_MODULE_8__ionic_native_status_bar__["a" /* StatusBar */],
__WEBPACK_IMPORTED_MODULE_9__ionic_native_splash_screen__["a" /* SplashScreen */],
__WEBPACK_IMPORTED_MODULE_10__ionic_native_camera__["a" /* Camera */],
{ provide: __WEBPACK_IMPORTED_MODULE_0__angular_core__["u" /* ErrorHandler */], useClass: __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["b" /* IonicErrorHandler */] }
]
})
], AppModule);
return AppModule;
}());
//# sourceMappingURL=app.module.js.map
/***/ }),
/***/ 264:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MyApp; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(33);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ionic_native_status_bar__ = __webpack_require__(190);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ionic_native_splash_screen__ = __webpack_require__(192);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pages_tabs_tabs__ = __webpack_require__(193);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var MyApp = /** @class */ (function () {
function MyApp(platform, statusBar, splashScreen) {
this.rootPage = __WEBPACK_IMPORTED_MODULE_4__pages_tabs_tabs__["a" /* TabsPage */];
platform.ready().then(function () {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
statusBar.styleDefault();
splashScreen.hide();
});
}
MyApp = __decorate([
Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({template:/*ion-inline-start:"/home/marcus/ionic2-camera-demo/src/app/app.html"*/'<ion-nav [root]="rootPage"></ion-nav>\n'/*ion-inline-end:"/home/marcus/ionic2-camera-demo/src/app/app.html"*/
}),
__metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["e" /* Platform */], __WEBPACK_IMPORTED_MODULE_2__ionic_native_status_bar__["a" /* StatusBar */], __WEBPACK_IMPORTED_MODULE_3__ionic_native_splash_screen__["a" /* SplashScreen */]])
], MyApp);
return MyApp;
}());
//# sourceMappingURL=app.component.js.map
/***/ })
},[198]);
//# sourceMappingURL=main.js.map | marcusasplund/ionic2-camera-demo | www/build/main.js | JavaScript | mit | 18,319 |
mf.include("chat_commands.js");
mf.include("assert.js");
mf.include("arrays.js");
/**
* Example:
* var id;
* var count = 0;
* task_manager.doLater(new task_manager.Task(function start() {
* id = mf.setInterval(function() {
* mf.debug("hello");
* if (++count === 10) {
* task_manager.done();
* }
* }, 1000);
* }, function stop() {
* mf.clearInterval(id);
* }, "saying hello 10 times");
*/
var task_manager = {};
(function() {
/**
* Constructor.
* @param start_func() called when the job starts or resumes
* @param stop_func() called when the job should pause or abort
* @param string either a toString function or a string used to display the task in a list
*/
task_manager.Task = function(start_func, stop_func, string, resume_func) {
assert.isFunction(start_func);
this.start = start_func;
assert.isFunction(stop_func);
this.stop = stop_func;
if (typeof string === "string") {
var old_string = string;
string = function() { return old_string; };
}
assert.isFunction(string);
this.toString = string;
if (resume_func !== undefined) {
assert.isFunction(resume_func);
this.resume = resume_func;
}
this.started = false;
};
var tasks = [];
function runNextCommand() {
if (tasks.length === 0) {
return;
}
if (tasks[0].started && tasks[0].resume !== undefined) {
tasks[0].resume();
} else {
tasks[0].started = true;
tasks[0].begin_time = new Date().getTime();
tasks[0].start();
}
};
task_manager.doLater = function(task) {
tasks.push(task);
task.started = false;
if (tasks.length === 1) {
runNextCommand();
}
};
task_manager.doNow = function(task) {
if (tasks.length !== 0) {
tasks[0].stop();
}
tasks.remove(task);
tasks.unshift(task);
runNextCommand();
};
task_manager.done = function() {
assert.isTrue(tasks.length !== 0);
var length = tasks.length;
tasks[0].started = false;
tasks.shift();
assert.isTrue(length !== tasks.length);
runNextCommand();
};
task_manager.postpone = function(min_timeout) {
var task = tasks[0];
tasks.remove(task);
if (min_timeout > 0) {
task.postponed = mf.setTimeout(function resume() {
task.postponed = undefined;
tasks.push(task);
if (tasks.length === 1) {
runNextCommand();
}
}, min_timeout);
} else {
tasks.push(task);
}
runNextCommand();
};
task_manager.remove = function(task) {
if (task === tasks[0]) {
task.stop();
tasks.remove(task);
runNextCommand();
} else {
tasks.remove(task);
if (task.postponed !== undefined) {
mf.clearTimeout(task.postponed);
task.postponed = undefined;
task.stop();
}
}
}
chat_commands.registerCommand("stop", function() {
if (tasks.length === 0) {
return;
}
tasks[0].stop();
tasks = [];
});
chat_commands.registerCommand("tasks",function(speaker,args,responder_fun) {
responder_fun("Tasks: " + tasks.join(", "));
});
chat_commands.registerCommand("reboot", function(speaker, args, responder_fun) {
if (tasks.length === 0) {
responder_fun("no tasks");
return;
}
tasks[0].stop();
tasks[0].start();
}),
})();
| crazy2be/mineflayer | mineflayer-script/lib/task_manager.js | JavaScript | mit | 3,848 |
/**
* Adds a new plugin to plugin.json, based on user prompts
*/
(function(){
var fs = require("fs"),
inquirer = require("inquirer"),
chalk = require("chalk"),
plugins = require("../plugins.json"),
banner = require("./banner.js"),
tags = require("./tags.js")(),
tagChoices = tags.getTags().map(function(tag){
return { name: tag };
}),
questions = [
{
type: "input",
name: "name",
message: "What is the name of your postcss plugin?",
validate: function( providedName ){
if( providedName.length < 1 ){
return "Please provide an actual name for your plugin."
}
var exists = plugins.filter(function( plugin ){
return plugin.name === providedName;
}).length;
if( exists ) {
return "This plugin has already been added to the list.";
}
if( providedName.indexOf("postcss-") === -1 ){
console.log( chalk.red("\nFYI: Plugin names usually start with 'postcss-' so they can easily be found on NPM.") );
}
return true;
}
},{
type: "input",
name: "description",
message: "Describe your plugin by finishing this sentence:\nPostCSS plugin...",
default: "eg: \"...that transforms your CSS.\""
},{
type: "input",
name: "url",
message: "What is the GitHub URL for your plugin?",
validate: function( providedName ){
if( providedName.indexOf("https://github.com/") > -1 )
return true;
else
return "Please provide a valid GitHub URL";
}
},{
type: "checkbox",
name: "tags",
message: "Choose at least one tag that describes your plugin.\nFor descriptions of the tags, please see the list in full:\nhttps://github.com/himynameisdave/postcss-plugins/blob/master/docs/tags.md",
choices: tagChoices,
validate: function( answer ) {
if ( answer.length < 1 ) {
return "You must choose at least one tag.";
}
return true;
}
}
];
// START DA SCRIPT
// 1. Hello
console.log( banner );
// 2. Da Questions
inquirer.prompt( questions, function(answers){
console.log( chalk.yellow("Adding a postcss plugin with the following properties:") );
console.log( chalk.cyan("name:\n ")+chalk.green(answers.name) );
console.log( chalk.cyan("description:\n ")+chalk.green(answers.description) );
console.log( chalk.cyan("url:\n ")+chalk.green(answers.url) );
console.log( chalk.cyan("tags:") );
answers.tags.forEach(function( tag ){
console.log( chalk.green(" - "+tag) );
});
// sets the author here
var newPlug = answers;
newPlug.author = newPlug.url.split("/")[3];
// push the new plugin right on there because it's formatted 👌👌👌
plugins.push( newPlug )
// write the plugins.json
fs.writeFile( "plugins.json", JSON.stringify( plugins, null, 2 ), function(err){
if(err) throw err;
console.log("Added the new plugin to plugins.json!");
require("./versionBump.js")(answers);
});
});
})();
| admdh/postcss-plugins | scripts/addNewPlugin.js | JavaScript | mit | 3,398 |
$(function() {
/* We're going to use these elements a lot, so let's save references to them
* here. All of these elements are already created by the HTML code produced
* by the items page. */
var $orderPanel = $('#order-panel');
var $orderPanelCloseButton = $('#order-panel-close-button');
var $itemName = $('#item-name');
var $itemDescription = $('#item-description');
var $itemQuantity = $('#item-quantity-input');
var $itemId = $('#item-id-input');
/* Show or hide the side panel. We do this by animating its `left` CSS
* property, causing it to slide off screen with a negative value when
* we want to hide it. */
var togglePanel = function(show) {
$orderPanel.animate({ right: show ? 0 : -$orderPanel.outerWidth()});
};
/* A function to show an alert box at the top of the page. */
var showAlert = function(message, type) {
/* This stuctured mess of code creates a Bootstrap-style alert box.
* Note the use of chainable jQuery methods. */
var $alert = (
$('<div>') // create a <div> element
.text(message) // set its text
.addClass('alert') // add some CSS classes and attributes
.addClass('alert-' + type)
.addClass('alert-dismissible')
.attr('role', 'alert')
.prepend( // prepend a close button to the inner HTML
$('<button>') // create a <button> element
.attr('type', 'button') // and so on...
.addClass('close')
.attr('data-dismiss', 'alert')
.html('×') // × is code for the x-symbol
)
.hide() // initially hide the alert so it will slide into view
);
/* Add the alert to the alert container. */
$('#alerts').append($alert);
/* Slide the alert into view with an animation. */
$alert.slideDown();
};
/* Close the panel when the close button is clicked. */
$('#order-panel-close-button').click(function() {
togglePanel(false);
});
/* Whenever an element with class `item-link` is clicked, copy over the item
* information to the side panel, then show the side panel. */
$('.item-link').click(function(event) {
// Prevent default link navigation
event.preventDefault();
var $this = $(this);
$itemName.text($this.find('.item-name').text());
$itemDescription.text($this.find('.item-description').text());
$itemId.val($this.attr('data-id'));
togglePanel(true);
});
/* A boring detail but an important one. When the size of the window changes,
* update the `left` property of the side menu so that it remains fully
* hidden. */
$(window).resize(function() {
if($orderPanel.offset().right < 0) {
$orderPanel.offset({ right: -$orderPanel.outerWidth() });
}
});
/* When the form is submitted (button is pressed or enter key is pressed),
* make the Ajax call to add the item to the current order. */
$('#item-add-form').submit(function(event) {
// Prevent default form submission
event.preventDefault();
/* No input validation... yet. */
var quantity = $itemQuantity.val();
//get orderid
var orderID;
$.ajax({
type: 'PUT',
url: '/orders/',
contentType: 'application/json',
data:JSON.stringify({
userID: 1
}),
async: false,
dataType: 'json'
}).done(function(data) {
orderID = data.orderID
//showAlert('Order created successfully', 'success');
}).fail(function() {
showAlert('Fail to get orderID', 'danger');
});
/* Send the data to `PUT /orders/:orderid/items/:itemid`. */
$.ajax({
/* The HTTP method. */
type: 'PUT',
/* The URL. Use a dummy order ID for now. */
url: '/orders/'+orderID+'/items/' + $itemId.val(),
/* The `Content-Type` header. This tells the server what format the body
* of our request is in. This sets the header as
* `Content-Type: application/json`. */
contentType: 'application/json',
/* The request body. `JSON.stringify` formats it as JSON. */
data: JSON.stringify({
quantity: quantity
}),
/* The `Accept` header. This tells the server that we want to receive
* JSON. This sets the header as something like
* `Accept: application/json`. */
dataType: 'json'
}).done(function() {
/* This is called if and when the server responds with a 2XX (success)
* status code. */
/* Show a success message. */
showAlert('Posted the order with id ' + orderID, 'success');
/* Close the side panel while we're at it. */
togglePanel(false);
}).fail(function() {
showAlert('Something went wrong.', 'danger');
});
});
});
| zyz29/yzhou9-webapps | hw4/api/js/items.js | JavaScript | mit | 4,719 |
// @flow
/* eslint-disable react/no-danger */
// $FlowMeteor
import { find, propEq } from "ramda";
import { Link } from "react-router";
import Split, {
Left,
Right,
} from "../../../components/@primitives/layout/split";
import Meta from "../../../components/shared/meta";
import AddToCart from "../../../components/giving/add-to-cart";
type ILayout = {
account: Object,
};
const Layout = ({ account }: ILayout) => (
<div>
<Split nav classes={["background--light-primary"]}>
<Meta
title={account.name}
description={account.summary}
image={
account.images
? find(propEq("fileLabel", "2:1"), account.images).cloudfront
: account.image
}
meta={[{ property: "og:type", content: "article" }]}
/>
<Right
background={
account.images
? find(propEq("fileLabel", "2:1"), account.images).cloudfront
: account.image
}
mobile
/>
<Right
background={
account.images
? find(propEq("fileLabel", "2:1"), account.images).cloudfront
: account.image
}
mobile={false}
/>
</Split>
<Left scroll classes={["background--light-primary"]}>
<Link
to="/give/now"
className={
"locked-top locked-left soft-double@lap-and-up soft " +
"h7 text-dark-secondary plain visuallyhidden@handheld"
}
>
<i
className="icon-arrow-back soft-half-right display-inline-block"
style={{ verticalAlign: "middle" }}
/>
<span
className="display-inline-block"
style={{ verticalAlign: "middle", marginTop: "5px" }}
>
Back
</span>
</Link>
<div className="soft@lap-and-up soft-double-top@lap-and-up">
<div className="soft soft-double-bottom soft-double-top@lap-and-up">
<h2>{account.name}</h2>
<div dangerouslySetInnerHTML={{ __html: account.description }} />
</div>
</div>
<div className="background--light-secondary">
<div className="constrain-copy soft-double@lap-and-up">
<div className="soft soft-double-bottom soft-double-top@lap-and-up">
<AddToCart accounts={[account]} donate />
</div>
</div>
</div>
</Left>
</div>
);
export default Layout;
| NewSpring/apollos-core | imports/pages/give/campaign/Layout.js | JavaScript | mit | 2,414 |
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon"));
var _jsxRuntime = require("react/jsx-runtime");
var _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
d: "M22 5.18 10.59 16.6l-4.24-4.24 1.41-1.41 2.83 2.83 10-10L22 5.18zm-2.21 5.04c.13.57.21 1.17.21 1.78 0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8c1.58 0 3.04.46 4.28 1.25l1.44-1.44C16.1 2.67 14.13 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.19-.22-2.33-.6-3.39l-1.61 1.61z"
}), 'TaskAltSharp');
exports.default = _default; | oliviertassinari/material-ui | packages/mui-icons-material/lib/TaskAltSharp.js | JavaScript | mit | 749 |
var API_PHP ="http://devtucompass.tk/pici/BackEnd/Clases/chatAdmin.php";
var API_REST = "http://devtucompass.tk/pici/API/";
$.support.cors = true;
$.mobile.allowCrossDomainPages = true;
function enviarInfo(){
$("#enviarInfo").click(function(){
$.ajax({
type: "POST",
url: API_PHP,
data: $("#info").serialize(), // serializes the form's elements.
error: function(jqXHR, textStatus, errorThrown){
console.log("hi");
console.log(jqXHR);
console.log(textStatus);
console.log(errorThrown);
//do stuff
},
cache:false
}).done( function (data){
localStorage.cedula= $("#cedula").val();
$("#cedulaH").attr('value',localStorage.cedula);
localStorage.useradmin = -1;
$.mobile.navigate( "#chat");
sendMessage();
});
});
}
function sendMessage(){
$("#send").click(function(){
$.ajax({
type: "POST",
url: API_PHP,
data: $("#messagechat").serialize(), // serializes the form's elements.
error: function(jqXHR, textStatus, errorThrown){
alert("hi");
alert(jqXHR);
alert(textStatus);
alert(errorThrown);
//do stuff
},
cache:false
}).done( function (data){
console.log("la informacion es: "+data);
});
});
$("#message").val("");
}
function getLogMessages() {
var cedula= localStorage.cedula ;
//alert("la Cedula es: "+cedula);
var content = "";
$.ajax({
type: "GET",
url: API_REST+"lastLogChat?cedula="+cedula,
error: function(jqXHR, textStatus, errorThrown){
console.log("hi");
console.log(jqXHR);
console.log(textStatus);
console.log(errorThrown);
//do stuff
},
cache:false,
format:"jsonp",
crossDomain: true,
async: true
}).done( function (data){
$.each( data, function ( i, item ){
//alert(item.id);
if(item.por ==='si'){
content+='<li data-theme="c">'+
'<a href="#">'+
'<h2>Consulta Sena PICI Dice: </h2>'+
'<p>'+item.mensaje+'</p>'+
'<p class="ui-li-aside"></p>'+
'</a>'+
'</li>';
}else{
content+='<li data-theme="e">'+
'<a href="#">'+
'<h2>Tu Dices: </h2>'+
'<p>'+item.mensaje+'</p>'+
'<p class="ui-li-aside"></p>'+
'</a>'+
'</li>';
}
});
$("#logMensajes").html(content);
$( "#logMensajes" ).listview( "refresh" );
});
}
| estigio/pici_prueba | js/chat.js | JavaScript | mit | 2,859 |
(function(jiglib) {
var MaterialProperties = jiglib.MaterialProperties;
var CachedImpulse = jiglib.CachedImpulse;
var PhysicsState = jiglib.PhysicsState;
var RigidBody = jiglib.RigidBody;
var HingeJoint = jiglib.HingeJoint;
var BodyPair = jiglib.BodyPair;
var PhysicsSystem = jiglib.PhysicsSystem;
var PhysicsController = function()
{
this._controllerEnabled = null; // Boolean
this._controllerEnabled = false;
}
PhysicsController.prototype.updateController = function(dt)
{
}
PhysicsController.prototype.enableController = function()
{
}
PhysicsController.prototype.disableController = function()
{
}
PhysicsController.prototype.get_controllerEnabled = function()
{
return this._controllerEnabled;
}
jiglib.PhysicsController = PhysicsController;
})(jiglib);
| charlieschwabacher/Walking | public/JigLibJS2/physics/PhysicsController.js | JavaScript | mit | 871 |
/*
* SameValue() (E5 Section 9.12).
*
* SameValue() is difficult to test indirectly. It appears in E5 Section
* 8.12.9, [[DefineOwnProperty]] several times.
*
* One relatively simple approach is to create a non-configurable, non-writable
* property, and attempt to use Object.defineProperty() to set a new value for
* the property. If SameValue(oldValue,newValue), no exception is thrown.
* Otherwise, reject (TypeError); see E5 Section 8.12.9, step 10.a.ii.1.
*/
function sameValue(x,y) {
var obj = {};
try {
Object.defineProperty(obj, 'test', {
writable: false,
enumerable: false,
configurable: false,
value: x
});
Object.defineProperty(obj, 'test', {
value: y
});
} catch (e) {
if (e.name === 'TypeError') {
return false;
} else {
throw e;
}
}
return true;
}
function test(x,y) {
print(sameValue(x,y));
}
/*===
test: different types, first undefined
false
false
false
false
false
false
===*/
/* Different types, first is undefined */
print('test: different types, first undefined')
test(undefined, null);
test(undefined, true);
test(undefined, false);
test(undefined, 123.0);
test(undefined, 'foo');
test(undefined, {});
/*===
test: different types, first null
false
false
false
false
false
false
===*/
/* Different types, first is null */
print('test: different types, first null')
test(null, undefined);
test(null, true);
test(null, false);
test(null, 123.0);
test(null, 'foo');
test(null, {});
/*===
test: different types, first boolean
false
false
false
false
false
false
false
false
false
false
===*/
/* Different types, first is boolean */
print('test: different types, first boolean')
test(true, undefined);
test(true, null);
test(true, 123.0);
test(true, 'foo');
test(true, {});
test(false, undefined);
test(false, null);
test(false, 123.0);
test(false, 'foo');
test(false, {});
/*===
test: different types, first number
false
false
false
false
false
false
===*/
/* Different types, first is number */
print('test: different types, first number')
test(123.0, undefined);
test(123.0, null);
test(123.0, true);
test(123.0, false);
test(123.0, 'foo');
test(123.0, {});
/*===
test: different types, first string
false
false
false
false
false
false
===*/
/* Different types, first is string */
print('test: different types, first string')
test('foo', undefined);
test('foo', null);
test('foo', true);
test('foo', false);
test('foo', 123.0);
test('foo', {});
/*===
test: different types, first object
false
false
false
false
false
false
===*/
/* Different types, first is object */
print('test: different types, first object')
test({}, undefined);
test({}, null);
test({}, true);
test({}, false);
test({}, 123.0);
test({}, 'foo');
/*===
test: same types, undefined
true
===*/
/* Same types: undefined */
print('test: same types, undefined')
test(undefined, undefined);
/*===
test: same types, null
true
===*/
/* Same types: null */
print('test: same types, null')
test(null, null);
/*===
test: same types, boolean
true
false
false
true
===*/
/* Same types: boolean */
print('test: same types, boolean')
test(true, true);
test(true, false);
test(false, true);
test(false, false);
/*===
test: same types, number
true
true
false
false
true
true
false
false
true
true
true
===*/
/* Same types: number */
print('test: same types, number')
test(NaN, NaN);
test(-0, -0);
test(-0, +0);
test(+0, -0);
test(+0, +0);
test(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY);
test(Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY);
test(Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY);
test(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY);
test(-123.0, -123.0);
test(123.0, 123.0);
/*===
test: same types, string
true
false
false
true
===*/
/* Same types: string */
print('test: same types, string')
test('', '');
test('foo', '')
test('', 'foo');
test('foo', 'foo');
/*===
test: same types, object
true
false
false
true
===*/
/* Same types: object */
var obj1 = {};
var obj2 = {};
print('test: same types, object')
test(obj1, obj1);
test(obj1, obj2);
test(obj2, obj1);
test(obj2, obj2);
| andoma/duktape | ecmascript-testcases/test-conv-samevalue.js | JavaScript | mit | 4,217 |
/**
* marked - a markdown parser
* Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
* https://github.com/chjj/marked
*/
(function () {
var block = {
newline: /^\n+/,
code: /^( {4}[^\n]+\n*)+/,
fences: noop,
hr: /^( *[-*_]){3,} *(?:\n+|$)/,
heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,
nptable: noop,
lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,
blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,
list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
html: /^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,
table: noop,
paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,
text: /^[^\n]+/
};
block.bullet = /(?:[*+-]|\d+\.)/;
block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;
block.item = replace(block.item, "gm")(/bull/g, block.bullet)();
block.list = replace(block.list)(/bull/g, block.bullet)("hr", "\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def", "\\n+(?=" + block.def.source + ")")();
block.blockquote = replace(block.blockquote)("def", block.def)();
block._tag = "(?!(?:" + "a|em|strong|small|s|cite|q|dfn|abbr|data|time|code" + "|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo" + "|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";
block.html = replace(block.html)("comment", /<!--[\s\S]*?-->/)("closed", /<(tag)[\s\S]+?<\/\1>/)("closing", /<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g, block._tag)();
block.paragraph = replace(block.paragraph)("hr", block.hr)("heading", block.heading)("lheading", block.lheading)("blockquote", block.blockquote)("tag", "<" + block._tag)("def", block.def)();
block.normal = merge({}, block);
block.gfm = merge({}, block.normal, {
fences: /^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,
paragraph: /^/
});
block.gfm.paragraph = replace(block.paragraph)("(?!", "(?!" + block.gfm.fences.source.replace("\\1", "\\2") + "|" + block.list.source.replace("\\1", "\\3") + "|")();
block.tables = merge({}, block.gfm, {
nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,
table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/
});
function Lexer(options) {
this.tokens = [];
this.tokens.links = {};
this.options = options || marked.defaults;
this.rules = block.normal;
if (this.options.gfm) {
if (this.options.tables) {
this.rules = block.tables
} else {
this.rules = block.gfm
}
}
}
Lexer.rules = block;
Lexer.lex = function (src, options) {
var lexer = new Lexer(options);
return lexer.lex(src)
};
Lexer.prototype.lex = function (src) {
src = src.replace(/\r\n|\r/g, "\n").replace(/\t/g, " ").replace(/\u00a0/g, " ").replace(/\u2424/g, "\n");
return this.token(src, true)
};
Lexer.prototype.token = function (src, top, bq) {
var src = src.replace(/^ +$/gm, ""), next, loose, cap, bull, b, item, space, i, l;
while (src) {
if (cap = this.rules.newline.exec(src)) {
src = src.substring(cap[0].length);
if (cap[0].length > 1) {
this.tokens.push({type: "space"})
}
}
if (cap = this.rules.code.exec(src)) {
src = src.substring(cap[0].length);
cap = cap[0].replace(/^ {4}/gm, "");
this.tokens.push({type: "code", text: !this.options.pedantic ? cap.replace(/\n+$/, "") : cap});
continue
}
if (cap = this.rules.fences.exec(src)) {
src = src.substring(cap[0].length);
this.tokens.push({type: "code", lang: cap[2], text: cap[3]});
continue
}
if (cap = this.rules.heading.exec(src)) {
src = src.substring(cap[0].length);
this.tokens.push({type: "heading", depth: cap[1].length, text: cap[2]});
continue
}
if (top && (cap = this.rules.nptable.exec(src))) {
src = src.substring(cap[0].length);
item = {
type: "table",
header: cap[1].replace(/^ *| *\| *$/g, "").split(/ *\| */),
align: cap[2].replace(/^ *|\| *$/g, "").split(/ *\| */),
cells: cap[3].replace(/\n$/, "").split("\n")
};
for (i = 0; i < item.align.length; i++) {
if (/^ *-+: *$/.test(item.align[i])) {
item.align[i] = "right"
} else if (/^ *:-+: *$/.test(item.align[i])) {
item.align[i] = "center"
} else if (/^ *:-+ *$/.test(item.align[i])) {
item.align[i] = "left"
} else {
item.align[i] = null
}
}
for (i = 0; i < item.cells.length; i++) {
item.cells[i] = item.cells[i].split(/ *\| */)
}
this.tokens.push(item);
continue
}
if (cap = this.rules.lheading.exec(src)) {
src = src.substring(cap[0].length);
this.tokens.push({type: "heading", depth: cap[2] === "=" ? 1 : 2, text: cap[1]});
continue
}
if (cap = this.rules.hr.exec(src)) {
src = src.substring(cap[0].length);
this.tokens.push({type: "hr"});
continue
}
if (cap = this.rules.blockquote.exec(src)) {
src = src.substring(cap[0].length);
this.tokens.push({type: "blockquote_start"});
cap = cap[0].replace(/^ *> ?/gm, "");
this.token(cap, top, true);
this.tokens.push({type: "blockquote_end"});
continue
}
if (cap = this.rules.list.exec(src)) {
src = src.substring(cap[0].length);
bull = cap[2];
this.tokens.push({type: "list_start", ordered: bull.length > 1});
cap = cap[0].match(this.rules.item);
next = false;
l = cap.length;
i = 0;
for (; i < l; i++) {
item = cap[i];
space = item.length;
item = item.replace(/^ *([*+-]|\d+\.) +/, "");
if (~item.indexOf("\n ")) {
space -= item.length;
item = !this.options.pedantic ? item.replace(new RegExp("^ {1," + space + "}", "gm"), "") : item.replace(/^ {1,4}/gm, "")
}
if (this.options.smartLists && i !== l - 1) {
b = block.bullet.exec(cap[i + 1])[0];
if (bull !== b && !(bull.length > 1 && b.length > 1)) {
src = cap.slice(i + 1).join("\n") + src;
i = l - 1
}
}
loose = next || /\n\n(?!\s*$)/.test(item);
if (i !== l - 1) {
next = item.charAt(item.length - 1) === "\n";
if (!loose)loose = next
}
this.tokens.push({type: loose ? "loose_item_start" : "list_item_start"});
this.token(item, false, bq);
this.tokens.push({type: "list_item_end"})
}
this.tokens.push({type: "list_end"});
continue
}
if (cap = this.rules.html.exec(src)) {
src = src.substring(cap[0].length);
this.tokens.push({
type: this.options.sanitize ? "paragraph" : "html",
pre: cap[1] === "pre" || cap[1] === "script" || cap[1] === "style",
text: cap[0]
});
continue
}
if (!bq && top && (cap = this.rules.def.exec(src))) {
src = src.substring(cap[0].length);
this.tokens.links[cap[1].toLowerCase()] = {href: cap[2], title: cap[3]};
continue
}
if (top && (cap = this.rules.table.exec(src))) {
src = src.substring(cap[0].length);
item = {
type: "table",
header: cap[1].replace(/^ *| *\| *$/g, "").split(/ *\| */),
align: cap[2].replace(/^ *|\| *$/g, "").split(/ *\| */),
cells: cap[3].replace(/(?: *\| *)?\n$/, "").split("\n")
};
for (i = 0; i < item.align.length; i++) {
if (/^ *-+: *$/.test(item.align[i])) {
item.align[i] = "right"
} else if (/^ *:-+: *$/.test(item.align[i])) {
item.align[i] = "center"
} else if (/^ *:-+ *$/.test(item.align[i])) {
item.align[i] = "left"
} else {
item.align[i] = null
}
}
for (i = 0; i < item.cells.length; i++) {
item.cells[i] = item.cells[i].replace(/^ *\| *| *\| *$/g, "").split(/ *\| */)
}
this.tokens.push(item);
continue
}
if (top && (cap = this.rules.paragraph.exec(src))) {
src = src.substring(cap[0].length);
this.tokens.push({
type: "paragraph",
text: cap[1].charAt(cap[1].length - 1) === "\n" ? cap[1].slice(0, -1) : cap[1]
});
continue
}
if (cap = this.rules.text.exec(src)) {
src = src.substring(cap[0].length);
this.tokens.push({type: "text", text: cap[0]});
continue
}
if (src) {
throw new Error("Infinite loop on byte: " + src.charCodeAt(0))
}
}
return this.tokens
};
var inline = {
escape: /^\\([\\`*{}\[\]()#+\-.!_>])/,
autolink: /^<([^ >]+(@|:\/)[^ >]+)>/,
url: noop,
tag: /^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,
link: /^!?\[(inside)\]\(href\)/,
reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/,
nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,
br: /^ {2,}\n(?!\s*$)/,
del: noop,
text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/
};
inline._inside = /(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;
inline._href = /\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;
inline.link = replace(inline.link)("inside", inline._inside)("href", inline._href)();
inline.reflink = replace(inline.reflink)("inside", inline._inside)();
inline.normal = merge({}, inline);
inline.pedantic = merge({}, inline.normal, {
strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/
});
inline.gfm = merge({}, inline.normal, {
escape: replace(inline.escape)("])", "~|])")(),
url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,
del: /^~~(?=\S)([\s\S]*?\S)~~/,
text: replace(inline.text)("]|", "~]|")("|", "|https?://|")()
});
inline.breaks = merge({}, inline.gfm, {
br: replace(inline.br)("{2,}", "*")(),
text: replace(inline.gfm.text)("{2,}", "*")()
});
function InlineLexer(links, options) {
this.options = options || marked.defaults;
this.links = links;
this.rules = inline.normal;
this.renderer = this.options.renderer || new Renderer;
this.renderer.options = this.options;
if (!this.links) {
throw new Error("Tokens array requires a `links` property.")
}
if (this.options.gfm) {
if (this.options.breaks) {
this.rules = inline.breaks
} else {
this.rules = inline.gfm
}
} else if (this.options.pedantic) {
this.rules = inline.pedantic
}
}
InlineLexer.rules = inline;
InlineLexer.output = function (src, links, options) {
var inline = new InlineLexer(links, options);
return inline.output(src)
};
InlineLexer.prototype.output = function (src) {
var out = "", link, text, href, cap;
while (src) {
if (cap = this.rules.escape.exec(src)) {
src = src.substring(cap[0].length);
out += cap[1];
continue
}
if (cap = this.rules.autolink.exec(src)) {
src = src.substring(cap[0].length);
if (cap[2] === "@") {
text = cap[1].charAt(6) === ":" ? this.mangle(cap[1].substring(7)) : this.mangle(cap[1]);
href = this.mangle("mailto:") + text
} else {
text = escape(cap[1]);
href = text
}
out += this.renderer.link(href, null, text);
continue
}
if (!this.inLink && (cap = this.rules.url.exec(src))) {
src = src.substring(cap[0].length);
text = escape(cap[1]);
href = text;
out += this.renderer.link(href, null, text);
continue
}
if (cap = this.rules.tag.exec(src)) {
if (!this.inLink && /^<a /i.test(cap[0])) {
this.inLink = true
} else if (this.inLink && /^<\/a>/i.test(cap[0])) {
this.inLink = false
}
src = src.substring(cap[0].length);
out += this.options.sanitize ? escape(cap[0]) : cap[0];
continue
}
if (cap = this.rules.link.exec(src)) {
src = src.substring(cap[0].length);
this.inLink = true;
out += this.outputLink(cap, {href: cap[2], title: cap[3]});
this.inLink = false;
continue
}
if ((cap = this.rules.reflink.exec(src)) || (cap = this.rules.nolink.exec(src))) {
src = src.substring(cap[0].length);
link = (cap[2] || cap[1]).replace(/\s+/g, " ");
link = this.links[link.toLowerCase()];
if (!link || !link.href) {
out += cap[0].charAt(0);
src = cap[0].substring(1) + src;
continue
}
this.inLink = true;
out += this.outputLink(cap, link);
this.inLink = false;
continue
}
if (cap = this.rules.strong.exec(src)) {
src = src.substring(cap[0].length);
out += this.renderer.strong(this.output(cap[2] || cap[1]));
continue
}
if (cap = this.rules.em.exec(src)) {
src = src.substring(cap[0].length);
out += this.renderer.em(this.output(cap[2] || cap[1]));
continue
}
if (cap = this.rules.code.exec(src)) {
src = src.substring(cap[0].length);
out += this.renderer.codespan(escape(cap[2], true));
continue
}
if (cap = this.rules.br.exec(src)) {
src = src.substring(cap[0].length);
out += this.renderer.br();
continue
}
if (cap = this.rules.del.exec(src)) {
src = src.substring(cap[0].length);
out += this.renderer.del(this.output(cap[1]));
continue
}
if (cap = this.rules.text.exec(src)) {
src = src.substring(cap[0].length);
out += escape(this.smartypants(cap[0]));
continue
}
if (src) {
throw new Error("Infinite loop on byte: " + src.charCodeAt(0))
}
}
return out
};
InlineLexer.prototype.outputLink = function (cap, link) {
var href = escape(link.href), title = link.title ? escape(link.title) : null;
return cap[0].charAt(0) !== "!" ? this.renderer.link(href, title, this.output(cap[1])) : this.renderer.image(href, title, escape(cap[1]))
};
InlineLexer.prototype.smartypants = function (text) {
if (!this.options.smartypants)return text;
return text.replace(/--/g, "—").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1‘").replace(/'/g, "’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1“").replace(/"/g, "”").replace(/\.{3}/g, "…")
};
InlineLexer.prototype.mangle = function (text) {
var out = "", l = text.length, i = 0, ch;
for (; i < l; i++) {
ch = text.charCodeAt(i);
if (Math.random() > .5) {
ch = "x" + ch.toString(16)
}
out += "&#" + ch + ";"
}
return out
};
function Renderer(options) {
this.options = options || {}
}
Renderer.prototype.code = function (code, lang, escaped) {
if (this.options.highlight) {
var out = this.options.highlight(code, lang);
if (out != null && out !== code) {
escaped = true;
code = out
}
}
if (!lang) {
return "<pre><code>" + (escaped ? code : escape(code, true)) + "\n</code></pre>"
}
return '<pre><code class="' + this.options.langPrefix + escape(lang, true) + '">' + (escaped ? code : escape(code, true)) + "\n</code></pre>\n"
};
Renderer.prototype.blockquote = function (quote) {
return "<blockquote>\n" + quote + "</blockquote>\n"
};
Renderer.prototype.html = function (html) {
return html
};
Renderer.prototype.heading = function (text, level, raw) {
return "<h" + level + ' id="' + this.options.headerPrefix + raw.toLowerCase().replace(/[^\w]+/g, "-") + '">' + text + "</h" + level + ">\n"
};
Renderer.prototype.hr = function () {
return this.options.xhtml ? "<hr/>\n" : "<hr>\n"
};
Renderer.prototype.list = function (body, ordered) {
var type = ordered ? "ol" : "ul";
return "<" + type + ">\n" + body + "</" + type + ">\n"
};
Renderer.prototype.listitem = function (text) {
return "<li>" + text + "</li>\n"
};
Renderer.prototype.paragraph = function (text) {
return "<p>" + text + "</p>\n"
};
Renderer.prototype.table = function (header, body) {
return "<table>\n" + "<thead>\n" + header + "</thead>\n" + "<tbody>\n" + body + "</tbody>\n" + "</table>\n"
};
Renderer.prototype.tablerow = function (content) {
return "<tr>\n" + content + "</tr>\n"
};
Renderer.prototype.tablecell = function (content, flags) {
var type = flags.header ? "th" : "td";
var tag = flags.align ? "<" + type + ' style="text-align:' + flags.align + '">' : "<" + type + ">";
return tag + content + "</" + type + ">\n"
};
Renderer.prototype.strong = function (text) {
return "<strong>" + text + "</strong>"
};
Renderer.prototype.em = function (text) {
return "<em>" + text + "</em>"
};
Renderer.prototype.codespan = function (text) {
return "<code>" + text + "</code>"
};
Renderer.prototype.br = function () {
return this.options.xhtml ? "<br/>" : "<br>"
};
Renderer.prototype.del = function (text) {
return "<del>" + text + "</del>"
};
Renderer.prototype.link = function (href, title, text) {
if (this.options.sanitize) {
try {
var prot = decodeURIComponent(unescape(href)).replace(/[^\w:]/g, "").toLowerCase()
} catch (e) {
return ""
}
if (prot.indexOf("javascript:") === 0) {
return ""
}
}
var out = '<a href="' + href + '"';
if (title) {
out += ' title="' + title + '"'
}
out += ">" + text + "</a>";
return out
};
Renderer.prototype.image = function (href, title, text) {
var out = '<img src="' + href + '" alt="' + text + '"';
if (title) {
out += ' title="' + title + '"'
}
out += this.options.xhtml ? "/>" : ">";
return out
};
function Parser(options) {
this.tokens = [];
this.token = null;
this.options = options || marked.defaults;
this.options.renderer = this.options.renderer || new Renderer;
this.renderer = this.options.renderer;
this.renderer.options = this.options
}
Parser.parse = function (src, options, renderer) {
var parser = new Parser(options, renderer);
return parser.parse(src)
};
Parser.prototype.parse = function (src) {
this.inline = new InlineLexer(src.links, this.options, this.renderer);
this.tokens = src.reverse();
var out = "";
while (this.next()) {
out += this.tok()
}
return out
};
Parser.prototype.next = function () {
return this.token = this.tokens.pop()
};
Parser.prototype.peek = function () {
return this.tokens[this.tokens.length - 1] || 0
};
Parser.prototype.parseText = function () {
var body = this.token.text;
while (this.peek().type === "text") {
body += "\n" + this.next().text
}
return this.inline.output(body)
};
Parser.prototype.tok = function () {
switch (this.token.type) {
case"space":
{
return ""
}
case"hr":
{
return this.renderer.hr()
}
case"heading":
{
return this.renderer.heading(this.inline.output(this.token.text), this.token.depth, this.token.text)
}
case"code":
{
return this.renderer.code(this.token.text, this.token.lang, this.token.escaped)
}
case"table":
{
var header = "", body = "", i, row, cell, flags, j;
cell = "";
for (i = 0; i < this.token.header.length; i++) {
flags = {header: true, align: this.token.align[i]};
cell += this.renderer.tablecell(this.inline.output(this.token.header[i]), {
header: true,
align: this.token.align[i]
})
}
header += this.renderer.tablerow(cell);
for (i = 0; i < this.token.cells.length; i++) {
row = this.token.cells[i];
cell = "";
for (j = 0; j < row.length; j++) {
cell += this.renderer.tablecell(this.inline.output(row[j]), {
header: false,
align: this.token.align[j]
})
}
body += this.renderer.tablerow(cell)
}
return this.renderer.table(header, body)
}
case"blockquote_start":
{
var body = "";
while (this.next().type !== "blockquote_end") {
body += this.tok()
}
return this.renderer.blockquote(body)
}
case"list_start":
{
var body = "", ordered = this.token.ordered;
while (this.next().type !== "list_end") {
body += this.tok()
}
return this.renderer.list(body, ordered)
}
case"list_item_start":
{
var body = "";
while (this.next().type !== "list_item_end") {
body += this.token.type === "text" ? this.parseText() : this.tok()
}
return this.renderer.listitem(body)
}
case"loose_item_start":
{
var body = "";
while (this.next().type !== "list_item_end") {
body += this.tok()
}
return this.renderer.listitem(body)
}
case"html":
{
var html = !this.token.pre && !this.options.pedantic ? this.inline.output(this.token.text) : this.token.text;
return this.renderer.html(html)
}
case"paragraph":
{
return this.renderer.paragraph(this.inline.output(this.token.text))
}
case"text":
{
return this.renderer.paragraph(this.parseText())
}
}
};
function escape(html, encode) {
return html.replace(!encode ? /&(?!#?\w+;)/g : /&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'")
}
function unescape(html) {
return html.replace(/&([#\w]+);/g, function (_, n) {
n = n.toLowerCase();
if (n === "colon")return ":";
if (n.charAt(0) === "#") {
return n.charAt(1) === "x" ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1))
}
return ""
})
}
function replace(regex, opt) {
regex = regex.source;
opt = opt || "";
return function self(name, val) {
if (!name)return new RegExp(regex, opt);
val = val.source || val;
val = val.replace(/(^|[^\[])\^/g, "$1");
regex = regex.replace(name, val);
return self
}
}
function noop() {
}
noop.exec = noop;
function merge(obj) {
var i = 1, target, key;
for (; i < arguments.length; i++) {
target = arguments[i];
for (key in target) {
if (Object.prototype.hasOwnProperty.call(target, key)) {
obj[key] = target[key]
}
}
}
return obj
}
function marked(src, opt, callback) {
if (callback || typeof opt === "function") {
if (!callback) {
callback = opt;
opt = null
}
opt = merge({}, marked.defaults, opt || {});
var highlight = opt.highlight, tokens, pending, i = 0;
try {
tokens = Lexer.lex(src, opt)
} catch (e) {
return callback(e)
}
pending = tokens.length;
var done = function (err) {
if (err) {
opt.highlight = highlight;
return callback(err)
}
var out;
try {
out = Parser.parse(tokens, opt)
} catch (e) {
err = e
}
opt.highlight = highlight;
return err ? callback(err) : callback(null, out)
};
if (!highlight || highlight.length < 3) {
return done()
}
delete opt.highlight;
if (!pending)return done();
for (; i < tokens.length; i++) {
(function (token) {
if (token.type !== "code") {
return --pending || done()
}
return highlight(token.text, token.lang, function (err, code) {
if (err)return done(err);
if (code == null || code === token.text) {
return --pending || done()
}
token.text = code;
token.escaped = true;
--pending || done()
})
})(tokens[i])
}
return
}
try {
if (opt)opt = merge({}, marked.defaults, opt);
return Parser.parse(Lexer.lex(src, opt), opt)
} catch (e) {
e.message += "\nPlease report this to https://github.com/chjj/marked.";
if ((opt || marked.defaults).silent) {
return "<p>An error occured:</p><pre>" + escape(e.message + "", true) + "</pre>"
}
throw e
}
}
marked.options = marked.setOptions = function (opt) {
merge(marked.defaults, opt);
return marked
};
marked.defaults = {
gfm: true,
tables: true,
breaks: false,
pedantic: false,
sanitize: false,
smartLists: false,
silent: false,
highlight: null,
langPrefix: "lang-",
smartypants: false,
headerPrefix: "",
renderer: new Renderer,
xhtml: false
};
marked.Parser = Parser;
marked.parser = Parser.parse;
marked.Renderer = Renderer;
marked.Lexer = Lexer;
marked.lexer = Lexer.lex;
marked.InlineLexer = InlineLexer;
marked.inlineLexer = InlineLexer.output;
marked.parse = marked;
if (typeof module !== "undefined" && typeof exports === "object") {
module.exports = marked
} else if (typeof define === "function" && define.amd) {
define(function () {
return marked
})
} else {
this.marked = marked
}
}).call(function () {
return this || (typeof window !== "undefined" ? window : global)
}()); | songziming/webmail | static/js/lib/marked.min.js | JavaScript | mit | 30,419 |
/*
* @name शेक बॉल बाउंस
* @description एक बॉल क्लास बनाएं, कई ऑब्जेक्ट्स को इंस्टेंट करें, इसे स्क्रीन के चारों ओर घुमाएं, और कैनवास के किनारे को छूने पर बाउंस करें।
* त्वरणX और त्वरण में कुल परिवर्तन के आधार पर शेक घटना का पता लगाएं और पता लगाने के आधार पर वस्तुओं को गति दें या धीमा करें।
*/
let balls = [];
let threshold = 30;
let accChangeX = 0;
let accChangeY = 0;
let accChangeT = 0;
function setup() {
createCanvas(displayWidth, displayHeight);
for (let i = 0; i < 20; i++) {
balls.push(new Ball());
}
}
function draw() {
background(0);
for (let i = 0; i < balls.length; i++) {
balls[i].move();
balls[i].display();
}
checkForShake();
}
function checkForShake() {
// Calculate total change in accelerationX and accelerationY
accChangeX = abs(accelerationX - pAccelerationX);
accChangeY = abs(accelerationY - pAccelerationY);
accChangeT = accChangeX + accChangeY;
// If shake
if (accChangeT >= threshold) {
for (let i = 0; i < balls.length; i++) {
balls[i].shake();
balls[i].turn();
}
}
// If not shake
else {
for (let i = 0; i < balls.length; i++) {
balls[i].stopShake();
balls[i].turn();
balls[i].move();
}
}
}
// Ball class
class Ball {
constructor() {
this.x = random(width);
this.y = random(height);
this.diameter = random(10, 30);
this.xspeed = random(-2, 2);
this.yspeed = random(-2, 2);
this.oxspeed = this.xspeed;
this.oyspeed = this.yspeed;
this.direction = 0.7;
}
move() {
this.x += this.xspeed * this.direction;
this.y += this.yspeed * this.direction;
}
// Bounce when touch the edge of the canvas
turn() {
if (this.x < 0) {
this.x = 0;
this.direction = -this.direction;
} else if (this.y < 0) {
this.y = 0;
this.direction = -this.direction;
} else if (this.x > width - 20) {
this.x = width - 20;
this.direction = -this.direction;
} else if (this.y > height - 20) {
this.y = height - 20;
this.direction = -this.direction;
}
}
// Add to xspeed and yspeed based on
// the change in accelerationX value
shake() {
this.xspeed += random(5, accChangeX / 3);
this.yspeed += random(5, accChangeX / 3);
}
// Gradually slows down
stopShake() {
if (this.xspeed > this.oxspeed) {
this.xspeed -= 0.6;
} else {
this.xspeed = this.oxspeed;
}
if (this.yspeed > this.oyspeed) {
this.yspeed -= 0.6;
} else {
this.yspeed = this.oyspeed;
}
}
display() {
ellipse(this.x, this.y, this.diameter, this.diameter);
}
}
| processing/p5.js-website | src/data/examples/hi/35_Mobile/03_Shake_Ball_Bounce.js | JavaScript | mit | 3,037 |
import { removeFromArray } from '../../../utils/array';
import fireEvent from '../../../events/fireEvent';
import Fragment from '../../Fragment';
import createFunction from '../../../shared/createFunction';
import { unbind } from '../../../shared/methodCallers';
import noop from '../../../utils/noop';
import resolveReference from '../../resolvers/resolveReference';
const eventPattern = /^event(?:\.(.+))?$/;
const argumentsPattern = /^arguments\.(\d*)$/;
const dollarArgsPattern = /^\$(\d*)$/;
export default class EventDirective {
constructor ( owner, event, template ) {
this.owner = owner;
this.event = event;
this.template = template;
this.ractive = owner.parentFragment.ractive;
this.parentFragment = owner.parentFragment;
this.context = null;
this.passthru = false;
// method calls
this.method = null;
this.resolvers = null;
this.models = null;
this.argsFn = null;
// handler directive
this.action = null;
this.args = null;
}
bind () {
this.context = this.parentFragment.findContext();
const template = this.template;
if ( template.m ) {
this.method = template.m;
if ( this.passthru = template.g ) {
// on-click="foo(...arguments)"
// no models or args, just pass thru values
}
else {
this.resolvers = [];
this.models = template.a.r.map( ( ref, i ) => {
if ( eventPattern.test( ref ) ) {
// on-click="foo(event.node)"
return {
event: true,
keys: ref.length > 5 ? ref.slice( 6 ).split( '.' ) : [],
unbind: noop
};
}
const argMatch = argumentsPattern.exec( ref );
if ( argMatch ) {
// on-click="foo(arguments[0])"
return {
argument: true,
index: argMatch[1]
};
}
const dollarMatch = dollarArgsPattern.exec( ref );
if ( dollarMatch ) {
// on-click="foo($1)"
return {
argument: true,
index: dollarMatch[1] - 1
};
}
let resolver;
const model = resolveReference( this.parentFragment, ref );
if ( !model ) {
resolver = this.parentFragment.resolve( ref, model => {
this.models[i] = model;
removeFromArray( this.resolvers, resolver );
});
this.resolvers.push( resolver );
}
return model;
});
this.argsFn = createFunction( template.a.s, template.a.r.length );
}
}
else {
// TODO deprecate this style of directive
this.action = typeof template === 'string' ? // on-click='foo'
template :
typeof template.n === 'string' ? // on-click='{{dynamic}}'
template.n :
new Fragment({
owner: this,
template: template.n
});
this.args = template.a ? // static arguments
( typeof template.a === 'string' ? [ template.a ] : template.a ) :
template.d ? // dynamic arguments
new Fragment({
owner: this,
template: template.d
}) :
[]; // no arguments
}
if ( this.template.n && typeof this.template.n !== 'string' ) this.action.bind();
if ( this.template.d ) this.args.bind();
}
bubble () {
if ( !this.dirty ) {
this.dirty = true;
this.owner.bubble();
}
}
fire ( event, passedArgs ) {
// augment event object
if ( event ) {
event.keypath = this.context.getKeypath();
event.context = this.context.get();
event.index = this.parentFragment.indexRefs;
if ( passedArgs ) passedArgs.unshift( event );
}
if ( this.method ) {
if ( typeof this.ractive[ this.method ] !== 'function' ) {
throw new Error( `Attempted to call a non-existent method ("${this.method}")` );
}
let args;
if ( this.passthru ) {
args = passedArgs;
}
else {
const values = this.models.map( model => {
if ( !model ) return undefined;
if ( model.event ) {
let obj = event;
let keys = model.keys.slice();
while ( keys.length ) obj = obj[ keys.shift() ];
return obj;
}
if ( model.argument ) {
return passedArgs ? passedArgs[ model.index ] : void 0;
}
if ( model.wrapper ) {
return model.wrapper.value;
}
return model.get();
});
args = this.argsFn.apply( null, values );
}
// make event available as `this.event`
const ractive = this.ractive;
const oldEvent = ractive.event;
ractive.event = event;
ractive[ this.method ].apply( ractive, args );
ractive.event = oldEvent;
}
else {
const action = this.action.toString();
let args = this.template.d ? this.args.getArgsList() : this.args;
if ( event ) event.name = action;
fireEvent( this.ractive, action, {
event,
args
});
}
}
rebind () {
throw new Error( 'EventDirective$rebind not yet implemented!' ); // TODO add tests
}
render () {
this.event.listen( this );
}
unbind () {
const template = this.template;
if ( template.m ) {
this.resolvers.forEach( unbind );
this.resolvers = [];
this.models.forEach( model => {
if ( model ) model.unbind();
});
}
else {
// TODO this is brittle and non-explicit, fix it
if ( this.action.unbind ) this.action.unbind();
if ( this.args.unbind ) this.args.unbind();
}
}
unrender () {
this.event.unlisten();
}
update () {
if ( this.method ) return; // nothing to do
// ugh legacy
if ( this.action.update ) this.action.update();
if ( this.template.d ) this.args.update();
this.dirty = false;
}
}
| magicdawn/ractive | src/view/items/shared/EventDirective.js | JavaScript | mit | 5,387 |
module.exports={"title":"TYPO3","hex":"FF8700","source":"https://typo3.com/fileadmin/assets/typo3logos/typo3_bullet_01.svg","svg":"<svg role=\"img\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><title>TYPO3 icon</title><path d=\"M18.08 16.539c-.356.105-.64.144-1.012.144-3.048 0-7.524-10.652-7.524-14.197 0-1.305.31-1.74.745-2.114C6.56.808 2.082 2.177.651 3.917c-.31.436-.497 1.12-.497 1.99C.154 11.442 6.06 24 10.228 24c1.928 0 5.178-3.168 7.852-7.46M16.134 0c3.855 0 7.713.622 7.713 2.798 0 4.415-2.8 9.765-4.23 9.765-2.549 0-5.72-7.09-5.72-10.635C13.897.31 14.518 0 16.134 0\"/></svg>","path":"M18.08 16.539c-.356.105-.64.144-1.012.144-3.048 0-7.524-10.652-7.524-14.197 0-1.305.31-1.74.745-2.114C6.56.808 2.082 2.177.651 3.917c-.31.436-.497 1.12-.497 1.99C.154 11.442 6.06 24 10.228 24c1.928 0 5.178-3.168 7.852-7.46M16.134 0c3.855 0 7.713.622 7.713 2.798 0 4.415-2.8 9.765-4.23 9.765-2.549 0-5.72-7.09-5.72-10.635C13.897.31 14.518 0 16.134 0"}; | cdnjs/cdnjs | ajax/libs/simple-icons/1.11.0/typo3.js | JavaScript | mit | 962 |
!function(){"use strict";!function(){if(void 0===window.Reflect||void 0===window.customElements||window.customElements.polyfillWrapFlushCallback)return;const t=HTMLElement;window.HTMLElement={HTMLElement:function(){return Reflect.construct(t,[],this.constructor)}}.HTMLElement,HTMLElement.prototype=t.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,t)}()}(); | cdnjs/cdnjs | ajax/libs/webcomponentsjs/2.5.0/custom-elements-es5-adapter.min.js | JavaScript | mit | 400 |
//>>built
define({"widgets/Splash/nls/strings":{_widgetLabel:"\u0e40\u0e01\u0e23\u0e34\u0e48\u0e19\u0e19\u0e33",welcomeMessage:"\u0e22\u0e34\u0e19\u0e14\u0e35\u0e15\u0e49\u0e2d\u0e19\u0e23\u0e31\u0e1a\u0e2a\u0e39\u0e48 ArcGIS Web Application!",licenceAgree:"\u0e09\u0e31\u0e19\u0e15\u0e01\u0e25\u0e07",licenceTerm:"\u0e40\u0e07\u0e37\u0e48\u0e2d\u0e19\u0e44\u0e02 ArcGIS Web Application",labelContinue:"\u0e15\u0e48\u0e2d\u0e44\u0e1b",errorString:"* \u0e04\u0e38\u0e13\u0e08\u0e33\u0e40\u0e1b\u0e47\u0e19\u0e15\u0e49\u0e2d\u0e07\u0e40\u0e2b\u0e47\u0e19\u0e14\u0e49\u0e27\u0e22\u0e01\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e2d\u0e19\u0e38\u0e0d\u0e32\u0e15\u0e43\u0e2b\u0e49\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23\u0e15\u0e48\u0e2d\u0e44\u0e1b",
notShowAgain:"\u0e44\u0e21\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e41\u0e2a\u0e14\u0e07\u0e2b\u0e19\u0e49\u0e32\u0e15\u0e48\u0e32\u0e07\u0e19\u0e35\u0e49\u0e2d\u0e35\u0e01",ok:"\u0e15\u0e01\u0e25\u0e07",cancel:"\u0e22\u0e01\u0e40\u0e25\u0e34\u0e01",_localized:{}}}); | pjdohertygis/MapSAROnline | Web Mapping Application/widgets/Splash/nls/Widget_th.js | JavaScript | cc0-1.0 | 1,012 |
/*******************************************************************************
* Copyright (c) 2019 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
var apiUtils = (function() {
"use strict";
var oauthProvider;
var __initOauthProvider = function() {
if (!oauthProvider) {
var pathname = window.location.pathname;
var urlToMatch = ".*/oidc/endpoint/([\\s\\S]*)/usersTokenManagement";
var regExpToMatch = new RegExp(urlToMatch, "g");
var groups = regExpToMatch.exec(pathname);
oauthProvider = groups[1];
}
};
var getAccountAppPasswords = function(userID) {
__initOauthProvider();
var deferred = new $.Deferred();
$.ajax({
url: "/oidc/endpoint/" + oauthProvider + "/app-passwords",
dataType: "json",
data: {user_id: encodeURIComponent(userID)},
headers: {
"Authorization": window.globalAuthHeader, // Basic clientID:clientSecret
"access_token" : window.globalAccessToken // The OAuth access_token acquired in OIDC login,
// which identifies an authenticated user.
},
success: function(response) {
deferred.resolve(response);
},
error: function(jqXHR) {
// Ajax request failed.
console.log('Error on GET for app-passwords: ' + jqXHR.responseText);
deferred.reject(jqXHR);
}
});
return deferred;
};
var getAccountAppTokens = function(userID) {
__initOauthProvider();
var deferred = new $.Deferred();
$.ajax({
url: "/oidc/endpoint/" + oauthProvider + "/app-tokens",
dataType: "json",
data: {user_id: encodeURIComponent(userID)},
headers: {
"Authorization": window.globalAuthHeader, // Basic clientID:clientSecret
"access_token" : window.globalAccessToken // The OAuth access_token acquired in OIDC login,
// which identifies an authenticated user.
},
success: function(response) {
deferred.resolve(response);
},
error: function(jqXHR) {
// Ajax request failed.
console.log('Error on GET for app-tokens: ' + jqXHR.responseText);
deferred.reject(jqXHR);
}
});
return deferred;
};
var deleteAcctAppPasswordToken = function(authID, authType, userID) {
__initOauthProvider();
var deferred = new $.Deferred();
var authTypes = authType + 's';
$.ajax({
url: "/oidc/endpoint/" + oauthProvider + "/" + authTypes + "/" + authID + "?user_id=" + encodeURIComponent(userID),
type: "DELETE",
contentType: "application/x-www-form-urlencoded",
headers: {
"Authorization": window.globalAuthHeader, // Basic clientID:clientSecret
"access_token" : window.globalAccessToken // The OAuth access_token acquired in OIDC login,
// which identifies an authenticated user.
},
success: function(response) {
deferred.resolve(response);
},
error: function(jqXHR) {
deferred.reject(jqXHR);
}
});
return deferred;
};
var deleteAllAppPasswordsTokens = function(userID, authType) {
__initOauthProvider();
var deferred = new $.Deferred();
var authTypes = authType + 's';
$.ajax({
url: "/oidc/endpoint/" + oauthProvider + "/" + authTypes + "?user_id=" + encodeURIComponent(userID),
type: "DELETE",
accept: "application/json",
headers: {
"Authorization": window.globalAuthHeader, // Basic clientID:clientSecret
"access_token" : window.globalAccessToken // The OAuth access_token acquired in OIDC login,
// which identifies an authenticated user.
},
success: function(response) {
deferred.resolve(response);
},
error: function(jqXHR) {
deferred.reject(jqXHR);
}
});
return deferred;
};
var deleteSelectedAppPasswordsTokens = function(authID, authType, name, userID) {
__initOauthProvider();
var deferred = new $.Deferred();
var authTypes = authType + 's';
$.ajax({
url: "/oidc/endpoint/" + oauthProvider + "/" + authTypes + "/" + authID + "?user_id=" + encodeURIComponent(userID),
type: "DELETE",
contentType: "application/x-www-form-urlencoded",
headers: {
"Authorization": window.globalAuthHeader, // Basic clientID:clientSecret
"access_token" : window.globalAccessToken // The OAuth access_token acquired in OIDC login,
// which identifies an authenticated user.
},
success: function(response) {
table.deleteTableRow(authID);
deferred.resolve();
},
error: function(jqXHR) {
// Record the authentication that had the error and return it for processing
var response = {status: "failure",
authType: authType,
authID: authID,
name: name
};
deferred.resolve(response);
}
});
return deferred;
};
return {
getAccountAppPasswords: getAccountAppPasswords,
getAccountAppTokens: getAccountAppTokens,
deleteAcctAppPasswordToken: deleteAcctAppPasswordToken,
deleteAllAppPasswordsTokens: deleteAllAppPasswordsTokens,
deleteSelectedAppPasswordsTokens: deleteSelectedAppPasswordsTokens
};
})();
| OpenLiberty/open-liberty | dev/com.ibm.ws.security.openidconnect.server/resources/WEB-CONTENT/tokenManager/js/apiUtils.js | JavaScript | epl-1.0 | 6,782 |
/*!
* Copyright 2010 - 2015 Pentaho Corporation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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.
*/
define([
"cdf/lib/CCC/def",
"./AbstractBarChart",
"../util"
], function(def, AbstractBarChart, util) {
return AbstractBarChart.extend({
methods: {
_rolesToCccDimensionsMap: {
'measuresLine': 'value' // maps to same dim group as 'measures' role
},
_noRoleInTooltipMeasureRoles: {'measures': true, 'measuresLine': true},
_options: {
plot2: true,
secondAxisIndependentScale: false,
// prevent default of -1 (which means last series) // TODO: is this needed??
secondAxisSeriesIndexes: null
},
_setNullInterpolationMode: function(options, value) {
options.plot2NullInterpolationMode = value;
},
_initAxes: function() {
this.base();
this._measureDiscrimGem || def.assert("Must exist to distinguish measures.");
var measureDiscrimCccDimName = this._measureDiscrimGem.cccDimName,
meaAxis = this.axes.measure,
barGems = meaAxis.gemsByRole[meaAxis.defaultRole],
barGemsById = def.query(barGems) // bar: measures, line: measuresLine
.uniqueIndex(function(gem) { return gem.id; });
// Create the dataPart dimension calculation
this.options.calculations.push({
names: 'dataPart',
calculation: function(datum, atoms) {
var meaGemId = datum.atoms[measureDiscrimCccDimName].value;
// Data part codes
// 0 -> bars
// 1 -> lines
atoms.dataPart = def.hasOwn(barGemsById, meaGemId) ? '0' : '1';
}
});
},
_readUserOptions: function(options, drawSpec) {
this.base(options, drawSpec);
var shape = drawSpec.shape;
if(shape && shape === 'none') {
options.pointDotsVisible = false;
} else {
options.pointDotsVisible = true;
options.extensionPoints.pointDot_shape = shape;
}
},
_configure: function() {
this.base();
this._configureAxisRange(/*isPrimary*/false, 'ortho2');
this._configureAxisTitle('ortho2',"");
this.options.plot2OrthoAxis = 2;
// Plot2 uses same color scale
// options.plot2ColorAxis = 2;
// options.color2AxisTransform = null;
},
_configureLabels: function(options, drawSpec) {
this.base.apply(this, arguments);
// Plot2
var lineLabelsAnchor = drawSpec.lineLabelsOption;
if(lineLabelsAnchor && lineLabelsAnchor !== 'none') {
options.plot2ValuesVisible = true;
options.plot2ValuesAnchor = lineLabelsAnchor;
options.plot2ValuesFont = util.defaultFont(util.readFont(drawSpec, 'label'));
options.extensionPoints.plot2Label_textStyle = drawSpec.labelColor;
}
},
_configureDisplayUnits: function() {
this.base();
this._configureAxisDisplayUnits(/*isPrimary*/false, 'ortho2');
}
}
});
});
| SteveSchafer-Innovent/innovent-pentaho-birt-plugin | js-lib/expanded/common-ui/visual/ccc/wrapper/charts/BarLineChart.js | JavaScript | epl-1.0 | 4,152 |
var deps = [
'common-ui/angular',
'test/karma/unit/angular-directives/templateUtil',
'common-ui/angular-ui-bootstrap',
'angular-mocks',
'common-ui/angular-directives/recurrence/recurrence'
];
define(deps, function (angular, templateUtil) {
describe('weeklyRecurrence', function () {
var $scope, httpBackend, templateCache;
beforeEach(module('recurrence', 'dateTimePicker'));
beforeEach(inject(function ($rootScope, $httpBackend, $templateCache) {
$scope = $rootScope;
httpBackend = $httpBackend;
templateCache = $templateCache;
templateUtil.addTemplate("common-ui/angular-directives/recurrence/weekly.html", httpBackend, templateCache);
templateUtil.addTemplate("common-ui/angular-directives/dateTimePicker/dateTimePicker.html", httpBackend, templateCache);
}));
describe('weekly', function () {
var scope, $compile;
var element;
beforeEach(inject(function (_$rootScope_, _$compile_) {
scope = _$rootScope_;
$compile = _$compile_;
}));
afterEach(function () {
element = scope = $compile = undefined;
});
describe('with static panels', function () {
beforeEach(function () {
var tpl = "<div weekly weekly-label='Run every week on' start-label='Start' until-label='Until' no-end-label='No end date' end-by-label='End by' weekly-recurrence-info='model'></div>";
element = angular.element(tpl);
$compile(element)(scope);
scope.$digest();
//Set model to initially have 2 days check along with dates set
scope.model.startTime = new Date();
scope.model.endTime = new Date();
scope.model.daysOfWeek = [0, 6];
scope.$apply();
});
afterEach(function () {
element.remove();
});
it('rehydrated model should reflect initial changes', function () {
expect(scope.model.daysOfWeek.length).toEqual(2);
expect(scope.model.endTime).toBeDefined();
expect(scope.model.startTime).toBeDefined();
//Grab first checkbox and un-check it
element.find('input.SUN').click();
//ensure that the first checkbox is unchecked
expect(scope.model.daysOfWeek.length).toBe(1);
//Grab last checkbox and un-check it
element.find('input.SAT').click();
//ensure that the last checkbox is unchecked
expect(scope.model.daysOfWeek.length).toBe(0);
});
it('should create weekly panel with content', function () {
expect(element.attr('weekly')).toBeDefined();
expect(element.attr('weekly-label')).toEqual("Run every week on");
expect(element.attr('start-label')).toEqual("Start");
expect(element.attr('until-label')).toEqual("Until");
expect(element.attr('no-end-label')).toEqual("No end date");
expect(element.attr('end-by-label')).toEqual("End by");
});
it('clicking checkbox set model on the scope', function () {
//Grab checkbox and check it
element.find('input.MON').click();
//ensure that the second checkbox is checked
expect(scope.model.daysOfWeek.length).toBe(3);
//Grab checkbox and check it
element.find('input.TUES').click();
//ensure that the third checkbox is checked
expect(scope.model.daysOfWeek.length).toBe(4);
//Grab checkbox and check it
element.find('input.WED').click();
//ensure that the fourth checkbox is checked
expect(scope.model.daysOfWeek.length).toBe(5);
//Grab checkbox and check it
element.find('input.THURS').click();
//ensure that the fifth checkbox is checked
expect(scope.model.daysOfWeek.length).toBe(6);
//Grab checkbox and check it
element.find('input.FRI').click();
//ensure that the sixth checkbox is checked
expect(scope.model.daysOfWeek.length).toBe(7);
//Click checkbox again to deselect it
element.find('input.WED').click();
//ensure that the seventh checkbox is deselected
expect(scope.model.daysOfWeek.length).toBe(6);
});
it('clicking radio button should update something', function () {
});
describe("start datetime directive initialization from scope", function () {
var startDatetime, isolateScope;
beforeEach(function () {
startDatetime = angular.element(element.find('div')[1]);
isolateScope = startDatetime.isolateScope();
});
it('should update model on the scope', function () {
//Change the start hour to 10 AM
isolateScope.hour = 10;
isolateScope.tod = "AM";
//Change the start minute to :00
isolateScope.minute = 59;
scope.$apply();
expect(scope.model.startTime.getHours()).toBe(10);
expect(scope.model.startTime.getMinutes()).toBe(59);
var myDate = new Date(2014,4,1,23,15,0);
isolateScope.selectedDate = myDate;
scope.$apply();
expect(scope.model.startTime).toBe(myDate);
});
});
});
describe("Weekly validation tests", function () {
var $myscope, isolateScope;
beforeEach(inject(function ($rootScope, $compile) {
var tpl = "<div weekly weekly-label='Run every week on' start-label='Start' until-label='Until' no-end-label='No end date' end-by-label='End by' weekly-recurrence-info='model'></div>";
$myscope = $rootScope.$new();
element = angular.element(tpl);
$compile(element)($myscope);
$myscope.$digest();
// get the isolate scope from the element
isolateScope = element.isolateScope();
$myscope.model = {};
$myscope.$apply();
}));
afterEach(function () {
element.remove();
});
it("should not be valid by default", function () {
var v = isolateScope.isValid();
expect(v).toBeFalsy();
});
it("should have at least one day selected considered valid", function () {
expect(isolateScope.isValid()).toBeFalsy();
// this should be defaulted to the current date/time
expect(isolateScope.startDate).toBeDefined();
expect(isolateScope.startDate).toBeLessThan(new Date());
element.find("input.SUN").click();
expect(isolateScope.isValid()).toBeTruthy();
element.find("input.SUN").click();
expect(isolateScope.isValid()).toBeFalsy();
element.find("input.SUN").click(); // turn it back on
expect(isolateScope.isValid()).toBeTruthy();
});
it("should have an end date after the start date to be valid", function () {
expect(isolateScope.isValid()).toBeFalsy();
element.find("input.SUN").click();
isolateScope.data.endDateDisabled = false; // select the end date radio
isolateScope.endDate = new Date();
expect(isolateScope.isValid()).toBeTruthy();
isolateScope.endDate = "2014-04-01"; // before now and a string version of the date
expect(isolateScope.isValid()).toBeFalsy();
});
it("should hydrate from strings for start and end time", function () {
$myscope.model = { startTime: "2014-04-01", endTime: "2014-04-02" };
$myscope.$apply();
element.find("input.SUN").click();
isolateScope.data.endDateDisabled = false; // select the end date radio
expect(isolateScope.isValid()).toBeTruthy();
});
});
describe("Weekly validation tests", function() {
var $myscope, isolateScope;
beforeEach(inject(function ($rootScope, $compile) {
var tpl = "<div weekly weekly-label='Run every week on' start-label='Start' until-label='Until' no-end-label='No end date' end-by-label='End by' weekly-recurrence-info='model'></div>";
$myscope = $rootScope.$new();
element = angular.element(tpl);
$compile(element)($myscope);
$myscope.$digest();
// get the isolate scope from the element
isolateScope = element.isolateScope();
$myscope.model = {};
$myscope.$apply();
}));
afterEach(function() {
element.remove();
});
it("should not be valid by default", function() {
var v = isolateScope.isValid();
expect(v).toBeFalsy();
});
it("should have at least one day selected considered valid", function() {
expect(isolateScope.isValid()).toBeFalsy();
// this should be defaulted to the current date/time
expect(isolateScope.startDate).toBeDefined();
expect(isolateScope.startDate).toBeLessThan(new Date());
element.find("input.SUN").click();
expect(isolateScope.isValid()).toBeTruthy();
element.find("input.SUN").click();
expect(isolateScope.isValid()).toBeFalsy();
element.find("input.SUN").click(); // turn it back on
expect(isolateScope.isValid()).toBeTruthy();
});
it("should have an end date after the start date to be valid", function() {
expect(isolateScope.isValid()).toBeFalsy();
element.find("input.SUN").click();
isolateScope.data.endDateDisabled = false; // select the end date radio
isolateScope.endDate = new Date();
expect(isolateScope.isValid()).toBeTruthy();
isolateScope.endDate = "2014-04-01"; // before now and a string version of the date
expect(isolateScope.isValid()).toBeFalsy();
});
it("should hydrate from strings for start and end time", function() {
$myscope.model = { startTime: "2014-04-01", endTime: "2014-04-02" };
$myscope.$apply();
element.find("input.SUN").click();
isolateScope.data.endDateDisabled = false; // select the end date radio
expect(isolateScope.isValid()).toBeTruthy();
});
});
});
});
}); | SteveSchafer-Innovent/innovent-pentaho-birt-plugin | js-lib/expanded/common-ui/test/karma/unit/angular-directives/weeklyRecurrenceSpec.js | JavaScript | epl-1.0 | 11,930 |
/**
* Metis - Bootstrap-Admin-Template v2.2.7
* Author : onokumus
* Copyright 2014
* Licensed under MIT (https://github.com/onokumus/Bootstrap-Admin-Template/blob/master/LICENSE.md)
*/
window.fakeStorage = {
_data: {
},
setItem: function (id, val) {
return this._data[id] = String(val);
},
getItem: function (id) {
return this._data.hasOwnProperty(id) ? this._data[id] : undefined;
},
removeItem: function (id) {
return delete this._data[id];
},
clear: function () {
return this._data = {
};
}
};
function LocalStorageManager() {
this.bgColor = 'bgColor';
this.fgcolor = 'fgcolor';
this.bgImage = 'bgImage';
var supported = this.localStorageSupported();
this.storage = supported ? window.localStorage : window.fakeStorage;
}
LocalStorageManager.prototype.localStorageSupported = function () {
var testKey = 'test';
var storage = window.localStorage;
try {
storage.setItem(testKey, '1');
storage.removeItem(testKey);
return true;
} catch (error) {
return false;
}
};
LocalStorageManager.prototype.getBgColor = function () {
return this.storage.getItem(this.bgColor) || '#333';
};
LocalStorageManager.prototype.setBgColor = function (color) {
this.storage.setItem(this.bgColor, color);
};
LocalStorageManager.prototype.getFgColor = function () {
return this.storage.getItem(this.fgColor) || '#fff';
};
LocalStorageManager.prototype.setFgColor = function (color) {
this.storage.setItem(this.fgColor, color);
};
LocalStorageManager.prototype.getBgImage = function () {
return this.storage.getItem(this.bgImage) || 'arches';
};
LocalStorageManager.prototype.setBgImage = function (image) {
this.storage.setItem(this.bgImage, image);
};
LocalStorageManager.prototype.clearItems = function () {
this.storage.removeItem(this.bgColor);
this.storage.removeItem(this.fgColor);
this.storage.removeItem(this.bgImage);
};
function InputTypeManager() {
var ci = this.colorTypeSupported();
this.ci = ci;
}
InputTypeManager.prototype.colorTypeSupported = function () {
var ci = document.createElement('input');
ci.setAttribute('type', 'color');
return ci.type !== 'text';
};
StyleSwitcher = function () {
this.inputManager = new InputTypeManager();
this.storageManager = new LocalStorageManager();
this.init();
};
StyleSwitcher.prototype.init = function () {
this.showChange();
this.build();
};
StyleSwitcher.prototype.showChange = function () {
this.bgColor = this.storageManager.getBgColor();
this.fgColor = this.storageManager.getFgColor();
this.bgImage = this.storageManager.getBgImage();
this.postLess(this.bgColor, this.fgColor, this.bgImage);
};
StyleSwitcher.prototype.build = function () {
var $this = this;
$this.storageManager = new LocalStorageManager();
var winlocpath = window.location.pathname.toString();
var imgPath = "";
if ($('body').css('direction') === "rtl") {
$('body').addClass('rtl');
}
if (winlocpath.indexOf("/rtl/") > -1) {
imgPath += "../";
}
$('body').css({
'background-image': 'url(' + imgPath + 'assets/img/pattern/' + $this.storageManager.getBgImage() + '.png)',
'background-repeat': ' repeat'
});
var modalHTML = '<div id="getCSSModal" class="modal fade">' +
'<div class="modal-dialog">' +
'<div class="modal-content">' +
'<div class="modal-header">' +
'<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>' +
'<h4 class="modal-title">Theme CSS</h4>' +
'<code>Copy textarea content and paste into theme.css</code>' +
'</div> ' +
'<div class="modal-body">' +
'<textarea class="form-control" name="cssbeautify" id="cssbeautify" readonly></textarea>' +
'</div> ' +
'<div class="modal-footer">' +
'<button aria-hidden="true" data-dismiss="modal" class="btn btn-danger">Close</button>' +
'</div> ' +
'</div>' +
'</div> ' +
'</div>';
$('body').append(modalHTML);
var switchDiv = $('<div />').attr('id', 'style-switcher').addClass('style-switcher hidden-xs');
var h5Ai = $('<i />').addClass('fa fa-cogs fa-2x');
var h5A = $('<a />').attr({
'href': '#',
'id': 'switcher-link'
}).on(Metis.buttonPressedEvent, function (e) {
e.preventDefault();
switchDiv.toggleClass('open');
$(this).find('i').toggleClass('fa-spin');
}).append(h5Ai);
var h5 = $('<h5 />').html('Style Switcher').append(h5A);
var colorList = $('<ul />').addClass('options').attr('data-type', 'colors');
var colors = [
{
'Hex': '#0088CC',
'colorName': 'Blue'
},
{
'Hex': '#4EB25C',
'colorName': 'Green'
},
{
'Hex': '#4A5B7D',
'colorName': 'Navy'
},
{
'Hex': '#E05048',
'colorName': 'Red'
},
{
'Hex': '#B8A279',
'colorName': 'Beige'
},
{
'Hex': '#c71c77',
'colorName': 'Pink'
},
{
'Hex': '#734BA9',
'colorName': 'Purple'
},
{
'Hex': '#2BAAB1',
'colorName': 'Cyan'
}
];
$.each(colors, function (i) {
var listElement = $('<li/>').append($('<a/>').css('background-color', colors[i].Hex).attr({
'data-color-hex': colors[i].Hex,
'data-color-name': colors[i].colorName,
'href': '#',
'title': colors[i].colorName
}).tooltip({
'placement': 'bottom'
})
);
colorList.append(listElement);
});
var colorSelector;
var itm = new InputTypeManager();
if (itm.ci) {
colorSelector = $('<input/>').addClass('color-picker-icon').attr({
'id': 'colorSelector',
'type': 'color'
}).val($this.storageManager.getBgColor());
colorSelector.on('change', function (ev) {
$this.storageManager.setBgColor($(this).val());
$this.showChange();
});
} else {
var colorSelStyle = $('<link/>')
.attr({
'rel': 'stylesheet',
'href': imgPath + 'assets/lib/colorpicker/css/colorpicker.css'
}),
colorSelHackStyle = $('<link/>').attr({
'rel': 'stylesheet',
'href': imgPath + 'assets/css/colorpicker_hack.css'
});
colorSelector = $('<div/>').addClass('color-picker').attr({
'id': 'colorSelector',
'data-color': $this.storageManager.getBgColor(),
'data-color-format': 'hex'
});
var url = imgPath + 'assets/lib/colorpicker/js/bootstrap-colorpicker.js';
$.getScript(url, function () {
$('head').append(colorSelStyle, colorSelHackStyle);
colorSelector.append(
$('<a/>')
.css({
'background-color': $this.storageManager.getBgColor()
})
.attr({
'href': '#',
'id': 'colorSelectorA'
})
);
colorSelector.colorpicker().on('changeColor', function (ev) {
colorSelector.find('a').css('background-color', ev.color.toHex());
$this.storageManager.setBgColor(ev.color.toHex());
$this.showChange();
});
});
}
var colorPicker = $('<li/>').append(colorSelector);
colorList.find('a').on(Metis.buttonPressedEvent, function (e) {
e.preventDefault();
$this.storageManager.setBgColor($(this).data('colorHex'));
$this.showChange();
colorSelector.attr('data-color', $(this).data('colorHex'));
colorSelector.val($(this).data('colorHex'));
colorSelector.find('a').css('background-color', $(this).data('colorHex'));
});
colorList.append(colorPicker);
var styleSwitcherWrap = $('<div />')
.addClass('style-switcher-wrap')
.append($('<h6 />').html('Background Colors'), colorList, $('<hr/>'));
var fgwbtn = $('<input/>').attr({
'type': 'radio',
'name': 'fgcolor'
}).val('#ffffff').on('change', function (e) {
$this.storageManager.setFgColor('#ffffff');
$this.showChange();
});
var fontWhite = $('<label/>').addClass('btn btn-xs btn-primary').html('White').append(fgwbtn);
var fgbbtn = $('<input/>').attr({
'type': 'radio',
'name': 'fgcolor'
}).val('#333333').on('change', function (e) {
$this.storageManager.setFgColor('#333333');
$this.showChange();
});
var fontBlack = $('<label/>').addClass('btn btn-xs btn-danger').html('Black').append(fgbbtn);
var fgBtnGroup = $('<div/>').addClass('btn-group').attr('data-toggle', 'buttons').append(fontWhite, fontBlack);
styleSwitcherWrap.append($('<div/>').addClass('options-link').append($('<h6/>').html('Font Colors'), fgBtnGroup));
var patternList = $('<ul />').addClass('options').attr('data-type', 'pattern');
var patternImages = [
{
'image': 'brillant',
'title': 'Brillant'
},
{
'image': 'always_grey',
'title': 'Always Grey'
},
{
'image': 'retina_wood',
'title': 'Retina Wood'
},
{
'image': 'low_contrast_linen',
'title': 'Low Constrat Linen'
},
{
'image': 'egg_shell',
'title': 'Egg Shel'
},
{
'image': 'cartographer',
'title': 'Cartographer'
},
{
'image': 'batthern',
'title': 'Batthern'
},
{
'image': 'noisy_grid',
'title': 'Noisy Grid'
},
{
'image': 'diamond_upholstery',
'title': 'Diamond Upholstery'
},
{
'image': 'greyfloral',
'title': 'Gray Floral'
},
{
'image': 'white_tiles',
'title': 'White Tiles'
},
{
'image': 'gplaypattern',
'title': 'GPlay'
},
{
'image': 'arches',
'title': 'Arches'
},
{
'image': 'purty_wood',
'title': 'Purty Wood'
},
{
'image': 'diagonal_striped_brick',
'title': 'Diagonal Striped Brick'
},
{
'image': 'large_leather',
'title': 'Large Leather'
},
{
'image': 'bo_play_pattern',
'title': 'BO Play'
},
{
'image': 'irongrip',
'title': 'Iron Grip'
},
{
'image': 'wood_1',
'title': 'Dark Wood'
},
{
'image': 'pool_table',
'title': 'Pool Table'
},
{
'image': 'crissXcross',
'title': 'crissXcross'
},
{
'image': 'rip_jobs',
'title': 'R.I.P Steve Jobs'
},
{
'image': 'random_grey_variations',
'title': 'Random Grey Variations'
},
{
'image': 'carbon_fibre',
'title': 'Carbon Fibre'
}
];
$.each(patternImages, function (i) {
var listElement = $('<li/>').append($('<a/>').css({
'background': 'url(' + imgPath + 'assets/img/pattern/' + patternImages[i].image + '.png) repeat'
}).attr({
'href': '#',
'title': patternImages[i].title,
'data-pattern-image': patternImages[i].image
}).tooltip({
'placement': 'bottom'
})
);
patternList.append(listElement);
});
patternList.find('a').on(Metis.buttonPressedEvent, function (e) {
e.preventDefault();
$('body').css({
'background-image': 'url(' + imgPath + 'assets/img/pattern/' + $(this).data('patternImage') + '.png)',
'background-repeat': ' repeat'
});
$this.patternImage = $(this).data('patternImage');
$this.storageManager.setBgImage($this.patternImage);
$this.showChange();
});
styleSwitcherWrap.append($('<div/>').addClass('pattern').append($('<h6/>').html('Background Pattern'), patternList
)
);
var resetLink = $('<a/>').html('Reset').attr('href', '#').on(Metis.buttonPressedEvent, function (e) {
$this.reset();
e.preventDefault();
});
var cssLink = $('<a/>').html('Get CSS').attr('href', '#').on(Metis.buttonPressedEvent, function (e) {
e.preventDefault();
$this.getCss();
});
styleSwitcherWrap.append($('<div/>').addClass('options-link').append($('<hr/>'), resetLink, cssLink
)
);
switchDiv.append(h5, styleSwitcherWrap);
$('body').append(switchDiv);
};
StyleSwitcher.prototype.postLess = function (bgColor, fgColor, bgImage) {
this.bgc = bgColor;
this.fgc = fgColor;
this.bgi = bgImage;
less.modifyVars({
'@bgColor': this.bgc,
'@fgColor': this.fgc,
'@bgImage': this.bgi
});
};
StyleSwitcher.prototype.getCss = function () {
var $this = this;
var raw = '',
options;
var isFixed = $('body').hasClass('fixed');
var cssBeautify = $('#cssbeautify');
if (isFixed) {
raw = 'body { background-image: url("../img/pattern/' + $this.patternImage + '.png"); }';
$('#boxedBodyAlert').removeClass('hide');
} else {
$('#boxedBodyAlert').addClass('hide');
}
cssBeautify.text('');
raw = raw + $('style[id^="less:"]').text();
cssBeautify.text(raw);
$('#getCSSModal').modal('show');
};
StyleSwitcher.prototype.reset = function () {
this.storageManager.clearItems();
this.showChange();
};
window.StyleSwitcher = new StyleSwitcher(); | simtsit/gtasks | dist/assets/js/style-switcher.js | JavaScript | gpl-2.0 | 14,257 |
/* Copyright (c) 2004-2005 The Dojo Foundation, Licensed under the Academic Free License version 2.1 or above */dojo.provide("dojo.reflect");
/*****************************************************************
reflect.js
v.1.5.0
(c) 2003-2004 Thomas R. Trenka, Ph.D.
Derived from the reflection functions of f(m).
http://dojotoolkit.org
http://fm.dept-z.com
There is a dependency on the variable dJ_global, which
should always refer to the global object.
******************************************************************/
if(!dj_global){ var dj_global = this; }
dojo.reflect = {} ;
dojo.reflect.$unknownType = function(){ } ;
dojo.reflect.ParameterInfo = function(name, type){
this.name = name ;
this.type = (type) ? type : dojo.reflect.$unknownType ;
} ;
dojo.reflect.PropertyInfo = function(name, type) {
this.name = name ;
this.type = (type) ? type : dojo.reflect.$unknownType ;
} ;
dojo.reflect.MethodInfo = function(name, fn){
var parse = function(f) {
var o = {} ;
var s = f.toString() ;
var param = ((s.substring(s.indexOf('(')+1, s.indexOf(')'))).replace(/\s+/g, "")).split(",") ;
o.parameters = [] ;
for (var i = 0; i < param.length; i++) {
o.parameters.push(new dojo.reflect.ParameterInfo(param[i])) ;
}
o.body = (s.substring(s.indexOf('{')+1, s.lastIndexOf('}'))).replace(/(^\s*)|(\s*$)/g, "") ;
return o ;
} ;
var tmp = parse(fn) ;
var p = tmp.parameters ;
var body = tmp.body ;
this.name = (name) ? name : "anonymous" ;
this.getParameters = function(){ return p ; } ;
this.getNullArgumentsObject = function() {
var a = [] ;
for (var i = 0; i < p.length; i++){
a.push(null);
}
return a ;
} ;
this.getBody = function() { return body ; } ;
this.type = Function ;
this.invoke = function(src, args){ return fn.apply(src, args) ; } ;
} ;
// Static object that can activate instances of the passed type.
dojo.reflect.Activator = new (function(){
this.createInstance = function(type, args) {
switch (typeof(type)) {
case "function" : {
var o = {} ;
type.apply(o, args) ;
return o ;
} ;
case "string" : {
var o = {} ;
(dojo.reflect.Reflector.getTypeFromString(type)).apply(o, args) ;
return o ;
} ;
}
throw new Error("dojo.reflect.Activator.createInstance(): no such type exists.");
}
})() ;
dojo.reflect.Reflector = new (function(){
this.getTypeFromString = function(s) {
var parts = s.split("."), i = 0, obj = dj_global ;
do { obj = obj[parts[i++]] ; } while (i < parts.length && obj) ;
return (obj != dj_global) ? obj : null ;
};
this.typeExists = function(s) {
var parts = s.split("."), i = 0, obj = dj_global ;
do { obj = obj[parts[i++]] ; } while (i < parts.length && obj) ;
return (obj && obj != dj_global) ;
};
this.getFieldsFromType = function(s) {
var type = s ;
if (typeof(s) == "string") {
type = this.getTypeFromString(s) ;
}
var nullArgs = (new dojo.reflect.MethodInfo(type)).getNullArgumentsObject() ;
return this.getFields(dojo.reflect.Activator.createInstance(s, nullArgs)) ;
};
this.getPropertiesFromType = function(s) {
var type = s ;
if (typeof(s) == "string") {
type = this.getTypeFromString(s);
}
var nullArgs = (new dojo.reflect.MethodInfo(type)).getNullArgumentsObject() ;
return this.getProperties(dojo.reflect.Activator.createInstance(s, nullArgs)) ;
};
this.getMethodsFromType = function(s) {
var type = s ;
if (typeof(s) == "string") {
type = this.getTypeFromString(s) ;
}
var nullArgs = (new dojo.reflect.MethodInfo(type)).getNullArgumentsObject() ;
return this.getMethods(dojo.reflect.Activator.createInstance(s, nullArgs)) ;
};
this.getType = function(o) { return o.constructor ; } ;
this.getFields = function(obj) {
var arr = [] ;
for (var p in obj) {
if(this.getType(obj[p]) != Function){
arr.push(new dojo.reflect.PropertyInfo(p, this.getType(obj[p]))) ;
}else{
arr.push(new dojo.reflect.MethodInfo(p, obj[p]));
}
}
return arr ;
};
this.getProperties = function(obj) {
var arr = [] ;
var fi = this.getFields(obj) ;
for (var i = 0; i < fi.length; i++){
if (this.isInstanceOf(fi[i], dojo.reflect.PropertyInfo)){
arr.push(fi[i]) ;
}
}
return arr ;
};
this.getMethods = function(obj) {
var arr = [] ;
var fi = this.getFields(obj) ;
for (var i = 0; i < fi.length; i++){
if (this.isInstanceOf(fi[i], dojo.reflect.MethodInfo)){
arr.push(fi[i]) ;
}
}
return arr ;
};
/*
this.implements = function(o, type) {
if (this.isSubTypeOf(o, type)) return false ;
var f = this.getFieldsFromType(type) ;
for (var i = 0; i < f.length; i++) {
if (typeof(o[(f[i].name)]) == "undefined"){
return false;
}
}
return true ;
};
*/
this.getBaseClass = function(o) {
if (o.getType().prototype.prototype.constructor){
return (o.getType()).prototype.prototype.constructor ;
}
return Object ;
} ;
this.isInstanceOf = function(o, type) {
return (this.getType(o) == type) ;
};
this.isSubTypeOf = function(o, type) {
return (o instanceof type) ;
};
this.isBaseTypeOf = function(o, type) {
return (type instanceof o);
};
})();
// back-compat
dojo.provide("dojo.reflect.reflection");
| BradNeuberg/hyperscope | prototype_1_basic_outline_viewspecs/trunk/src/client/lib/dojo/src/reflect/reflection.js | JavaScript | gpl-2.0 | 5,393 |
$(window).load(function(){FusionCharts.ready(function () {
var revenueChart = new FusionCharts({
type: 'column2d',
renderAt: 'chart-container',
width: '500',
height: '300',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Monthly Revenue",
"subCaption": "Last year",
"xAxisName": "Month",
"yAxisName": "Amount (In USD)",
"numberPrefix": "$",
"theme": "fint",
//Configure x-axis labels to display in staggered mode
"labelDisplay": "stagger",
"staggerLines": "3"
},
"data": [{
"label": "January",
"value": "420000"
}, {
"label": "February",
"value": "810000"
}, {
"label": "March",
"value": "720000"
}, {
"label": "April",
"value": "550000"
}, {
"label": "May",
"value": "910000"
}, {
"label": "June",
"value": "510000"
}, {
"label": "July",
"value": "680000"
}, {
"label": "August",
"value": "620000"
}, {
"label": "September",
"value": "610000"
}, {
"label": "October",
"value": "490000"
}, {
"label": "November",
"value": "900000"
}, {
"label": "December",
"value": "730000"
}]
}
}).render();
});}); | sguha-work/fiddletest | fiddles/Chart/Data-Labels/Configuring-x-axis-data-labels-display---staggered-mode_468/demo.js | JavaScript | gpl-2.0 | 1,780 |
/*
* ---------
* |.##> <##.| Open Smart Card Development Platform (www.openscdp.org)
* |# #|
* |# #| Copyright (c) 1999-2006 CardContact Software & System Consulting
* |'##> <##'| Andreas Schwier, 32429 Minden, Germany (www.cardcontact.de)
* ---------
*
* This file is part of OpenSCDP.
*
* OpenSCDP is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* OpenSCDP is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenSCDP; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Support for card verifiable certificates
*
*/
//
// Constructor for CVC object from binary data
//
function CVC(value) {
this.value = new ASN1(value);
// print(this.value);
}
// Some static configuration tables
CVC.prototype.Profiles = new Array();
CVC.prototype.Profiles[3] = new Array();
CVC.prototype.Profiles[3][0] = { name:"CPI", length:1 };
CVC.prototype.Profiles[3][1] = { name:"CAR", length:8 };
CVC.prototype.Profiles[3][2] = { name:"CHR", length:12 };
CVC.prototype.Profiles[3][3] = { name:"CHA", length:7 };
CVC.prototype.Profiles[3][4] = { name:"OID", length:7 };
CVC.prototype.Profiles[3][5] = { name:"MOD", length:128 };
CVC.prototype.Profiles[3][6] = { name:"EXP", length:4 };
CVC.prototype.Profiles[4] = new Array();
CVC.prototype.Profiles[4][0] = { name:"CPI", length:1 };
CVC.prototype.Profiles[4][1] = { name:"CAR", length:8 };
CVC.prototype.Profiles[4][2] = { name:"CHR", length:12 };
CVC.prototype.Profiles[4][3] = { name:"CHA", length:7 };
CVC.prototype.Profiles[4][4] = { name:"OID", length:6 };
CVC.prototype.Profiles[4][5] = { name:"MOD", length:128 };
CVC.prototype.Profiles[4][6] = { name:"EXP", length:4 };
CVC.prototype.Profiles[33] = new Array();
CVC.prototype.Profiles[33][0] = { name:"CPI", length:1 };
CVC.prototype.Profiles[33][1] = { name:"MOD", length:256 };
CVC.prototype.Profiles[33][2] = { name:"EXP", length:4 };
CVC.prototype.Profiles[33][3] = { name:"OID", length:7 };
CVC.prototype.Profiles[33][4] = { name:"CHR", length:8 };
CVC.prototype.Profiles[33][5] = { name:"CAR", length:8 };
CVC.prototype.Profiles[34] = new Array();
CVC.prototype.Profiles[34][0] = { name:"CPI", length:1 };
CVC.prototype.Profiles[34][1] = { name:"MOD", length:256 };
CVC.prototype.Profiles[34][2] = { name:"EXP", length:4 };
CVC.prototype.Profiles[34][3] = { name:"OID", length:6 };
CVC.prototype.Profiles[34][4] = { name:"CHA", length:7 };
CVC.prototype.Profiles[34][5] = { name:"CHR", length:12 };
CVC.prototype.Profiles[34][6] = { name:"CAR", length:8 };
//
// Verify CVC certificate with public key
//
CVC.prototype.verifyWith = function(puk) {
// Get signed content
var signedContent = this.value.get(0).value;
// Decrypt with public key
var crypto = new Crypto();
var plain = crypto.decrypt(puk, Crypto.RSA_ISO9796_2, signedContent);
print("Plain value:");
print(plain);
// Check prefix and postfix byte
if ((plain.byteAt(0) != 0x6A) || (plain.byteAt(plain.length - 1) != 0xBC)) {
throw new GPError("CVC", GPError.CRYPTO_FAILED, -1, "Decrypted CVC shows invalid padding. Probably wrong public key.");
}
this.plainContent = plain;
var cpi = plain.byteAt(1);
var hashlen = (cpi >= 0x20 ? 32 : 20); // Starting with G2 SHA-256 is used
// Extract hash
this.hash = plain.bytes(plain.length - (hashlen + 1), hashlen);
var publicKeyRemainder = this.getPublicKeyRemainder();
// Input to hash is everything in the signed area plus the data in the public key remainder
var certdata = plain.bytes(1, plain.length - (hashlen + 2));
certdata = certdata.concat(publicKeyRemainder);
if (cpi >= 0x20) {
var refhash = crypto.digest(Crypto.SHA_256, certdata);
} else {
var refhash = crypto.digest(Crypto.SHA_1, certdata);
}
if (!refhash.equals(this.hash)) {
print(" Hash = " + this.hash);
print("RefHash = " + refhash);
throw new GPError("CVC", GPError.CRYPTO_FAILED, -2, "Hash value of certificate failed in verification");
}
// Split certificate data into components according to profile
var profile = certdata.byteAt(0);
var profileTemplate = this.Profiles[profile];
var offset = 0;
for (var i = 0; i < profileTemplate.length; i++) {
var name = profileTemplate[i].name;
var len = profileTemplate[i].length;
var val = certdata.bytes(offset, len);
// print(" " + name + " : " + val);
offset += len;
this[name] = val;
}
this.certificateData = certdata;
if (cpi < 0x20) {
if (!this.CAR.equals(this.value.get(2).value)) {
print("Warning: CAR in signed area does not match outer CAR");
}
}
}
CVC.prototype.verifyWithOneOf = function(puklist) {
for (var i = 0; i < puklist.length; i++) {
try {
this.verifyWith(puklist[i]);
break;
}
catch(e) {
if ((e instanceof GPError) && (e.reason == -1)) {
print("Trying next key on the list...");
} else {
throw e;
}
}
}
if (i >= puklist.length) {
throw new GPError("CVC", GPError.CRYPTO_FAILED, -3, "List of possible public keys exhausted. CVC decryption failed.");
}
}
//
// Return signatur data object
//
CVC.prototype.getSignaturDataObject = function() {
return (this.value.get(0));
}
//
// Return the public key remainder
//
CVC.prototype.getPublicKeyRemainderDataObject = function() {
return (this.value.get(1));
}
//
// Return the public key remainder
//
CVC.prototype.getPublicKeyRemainder = function() {
return (this.value.get(1).value);
}
//
// Return the certification authority reference (CAR)
//
CVC.prototype.getCertificationAuthorityReference = function() {
if (this.value.elements > 2) {
return (this.value.get(2).value);
} else {
if (!this.CAR) {
throw new GPError("CVC", GPError.INVALID_USAGE, 0, "Must verify certificate before extracting CAR");
}
return this.CAR;
}
}
//
// Return the certificate holder reference (CHR)
//
CVC.prototype.getCertificateHolderReference = function() {
if (!this.CHR) {
throw new GPError("CVC", GPError.INVALID_USAGE, 0, "Must verify certificate before extracting CHR");
}
return this.CHR;
}
//
// Return public key from certificate
//
CVC.prototype.getPublicKey = function() {
if (!this.MOD) {
throw new GPError("CVC", GPError.INVALID_USAGE, 0, "Must verify certificate before extracting public key");
}
var key = new Key();
key.setType(Key.PUBLIC);
key.setComponent(Key.MODULUS, this.MOD);
key.setComponent(Key.EXPONENT, this.EXP);
return key;
}
//
// Dump content of certificate
//
CVC.prototype.dump = function() {
print(this.value);
if (this.certificateData) {
var profile = this.certificateData.byteAt(0);
var profileTemplate = this.Profiles[profile];
var offset = 0;
for (var i = 0; i < profileTemplate.length; i++) {
print(" " + profileTemplate[i].name + " : " + this.certificateData.bytes(offset, profileTemplate[i].length));
offset += profileTemplate[i].length;
}
print();
}
}
| wesee/scsh-scripts | eGK/cvc.js | JavaScript | gpl-2.0 | 7,514 |
/*
* Simplified Chinese translation
* By DavidHu
* 09 April 2007
*/
Ext.UpdateManager.defaults.indicatorText = '<div class="loading-indicator">加载中...</div>';
if(Ext.View){
Ext.View.prototype.emptyText = "";
}
if(Ext.grid.Grid){
Ext.grid.Grid.prototype.ddText = "{0} 选择行";
}
if(Ext.TabPanelItem){
Ext.TabPanelItem.prototype.closeText = "关闭";
}
if(Ext.form.Field){
Ext.form.Field.prototype.invalidText = "输入值非法";
}
Date.monthNames = [
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月"
];
Date.dayNames = [
"日",
"一",
"二",
"三",
"四",
"五",
"六"
];
if(Ext.MessageBox){
Ext.MessageBox.buttonText = {
ok : "确定",
cancel : "取消",
yes : "是",
no : "否"
};
}
if(Ext.util.Format){
Ext.util.Format.date = function(v, format){
if(!v) return "";
if(!(v instanceof Date)) v = new Date(Date.parse(v));
return v.dateFormat(format || "y年m月d日");
};
}
if(Ext.DatePicker){
Ext.apply(Ext.DatePicker.prototype, {
todayText : "今天",
minText : "日期在最小日期之前",
maxText : "日期在最大日期之后",
disabledDaysText : "",
disabledDatesText : "",
monthNames : Date.monthNames,
dayNames : Date.dayNames,
nextText : '下月 (Control+Right)',
prevText : '上月 (Control+Left)',
monthYearText : '选择一个月 (Control+Up/Down 来改变年)',
todayTip : "{0} (空格键选择)",
format : "y年m月d日"
});
}
if(Ext.PagingToolbar){
Ext.apply(Ext.PagingToolbar.prototype, {
beforePageText : "第",
afterPageText : "页,共 {0} 页",
firstText : "第一页",
prevText : "前一页",
nextText : "下一页",
lastText : "最后页",
refreshText : "刷新",
displayMsg : "显示 {0} - {1},共 {2} 条",
emptyMsg : '没有数据需要显示'
});
}
if(Ext.form.TextField){
Ext.apply(Ext.form.TextField.prototype, {
minLengthText : "该输入项的最小长度是 {0}",
maxLengthText : "该输入项的最大长度是 {0}",
blankText : "该输入项为必输项",
regexText : "",
emptyText : null
});
}
if(Ext.form.NumberField){
Ext.apply(Ext.form.NumberField.prototype, {
minText : "该输入项的最小值是 {0}",
maxText : "该输入项的最大值是 {0}",
nanText : "{0} 不是有效数值"
});
}
if(Ext.form.DateField){
Ext.apply(Ext.form.DateField.prototype, {
disabledDaysText : "禁用",
disabledDatesText : "禁用",
minText : "该输入项的日期必须在 {0} 之后",
maxText : "该输入项的日期必须在 {0} 之前",
invalidText : "{0} 是无效的日期 - 必须符合格式: {1}",
format : "y年m月d日"
});
}
if(Ext.form.ComboBox){
Ext.apply(Ext.form.ComboBox.prototype, {
loadingText : "加载...",
valueNotFoundText : undefined
});
}
if(Ext.form.VTypes){
Ext.apply(Ext.form.VTypes, {
emailText : '该输入项必须是电子邮件地址,格式如: "[email protected]"',
urlText : '该输入项必须是URL地址,格式如: "http:/'+'/www.domain.com"',
alphaText : '该输入项只能包含字符和_',
alphanumText : '该输入项只能包含字符,数字和_'
});
}
if(Ext.grid.GridView){
Ext.apply(Ext.grid.GridView.prototype, {
sortAscText : "正序",
sortDescText : "逆序",
lockText : "锁列",
unlockText : "解锁列",
columnsText : "列"
});
}
if(Ext.grid.PropertyColumnModel){
Ext.apply(Ext.grid.PropertyColumnModel.prototype, {
nameText : "名称",
valueText : "值",
dateFormat : "y年m月d日"
});
}
if(Ext.layout.BorderLayout.SplitRegion){
Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, {
splitTip : "拖动来改变尺寸.",
collapsibleSplitTip : "拖动来改变尺寸. 双击隐藏."
});
}
| jreadstone/zsyproject | WebRoot/resource/commonjs/ext-lang-zh_CN.js | JavaScript | gpl-2.0 | 4,293 |
/*
Copyright (c) 2004-2008, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
http://dojotoolkit.org/book/dojo-book-0-9/introduction/licensing
*/
if(!dojo._hasResource["dijit.form.TimeTextBox"]){
dojo._hasResource["dijit.form.TimeTextBox"]=true;
dojo.provide("dijit.form.TimeTextBox");
dojo.require("dijit._TimePicker");
dojo.require("dijit.form._DateTimeTextBox");
dojo.declare("dijit.form.TimeTextBox",dijit.form._DateTimeTextBox,{popupClass:"dijit._TimePicker",_selector:"time"});
}
| btribulski/girlsknowhow | sites/all/modules/civicrm/packages/dojo/dijit/form/TimeTextBox.js | JavaScript | gpl-2.0 | 623 |
var searchData=
[
['queuefree',['queueFree',['../struct_ticker_state.html#a942a4c5388669138ad9518b3e14c3cb4',1,'TickerState']]],
['queueused',['queueUsed',['../struct_ticker_state.html#a99d84731b9512a573efd4d40d1ce6b07',1,'TickerState']]]
];
| Code-Forge-Lab/Arduino | arduino library/libraries/SSD1306Ascii-SmallSize10/doc/html/search/functions_a.js | JavaScript | gpl-2.0 | 246 |
// JavaScript Document
jQuery(document).ready(function(){
var ap_methods = {
load_sub_items: function(type){
jQuery.post(ajaxurl, {action: 'ap_tax_types',"type":type}, function(response) {
response = jQuery.parseJSON(response);
if(response.msg){
var data = response.data;
var selected = response.selected;
var items = '';
jQuery.each(data, function(i, v){
var is_selected = '';
jQuery.each(selected, function(is, vs){
if(vs==i)
is_selected = 'selected="selected"';
});
items+='<option value="'+i+'" '+is_selected+'>'+v+'</option>';
});
jQuery('#tax_types_selector').html(items);
jQuery('div.ap_tax_types').show();
}
});
}
}
jQuery('#tax_selector').live('change',function(){
var type = jQuery(this).val();
if(type.length>0)
ap_methods.load_sub_items(type);
});
}); | inobrega/brasilprofissoes | wp-content/plugins/alphabetic-pagination/scripts.js | JavaScript | gpl-2.0 | 1,009 |
/**** MarketPress Checkout JS *********/
jQuery(document).ready(function($) {
//coupon codes
$('#coupon-link').click(function() {
$('#coupon-link').hide();
$('#coupon-code').show();
$('#coupon_code').focus();
return false;
});
//payment method choice
$('input.mp_choose_gateway').change(function() {
var gid = $('input.mp_choose_gateway:checked').val();
$('div.mp_gateway_form').hide();
$('div#' + gid).show();
});
//province field choice
$('#mp_country').change(function() {
$("#mp_province_field").html('<img src="'+MP_Ajax.imgUrl+'" alt="Loading..." />');
var country = $(this).val();
$.post(MP_Ajax.ajaxUrl, {action: 'mp-province-field', country: country}, function(data) {
$("#mp_province_field").html(data);
//remap listener
$('#mp_state').change(function() {
if ($('#mp_city').val() && $('#mp_state').val() && $('#mp_zip').val()) mp_refresh_shipping();
});
});
});
//shipping field choice
$('#mp-shipping-select').change(function() {mp_refresh_shipping();});
//refresh on blur if necessary 3 fields are set
$('#mp_shipping_form .mp_shipping_field').change(function() {
if ($('#mp_city').val() && $('#mp_state').val() && $('#mp_zip').val()) mp_refresh_shipping();
});
function mp_refresh_shipping() {
$("#mp-shipping-select-holder").html('<img src="'+MP_Ajax.imgUrl+'" alt="Loading..." />');
var serializedForm = $('form#mp_shipping_form').serialize();
$.post(MP_Ajax.ajaxUrl, serializedForm, function(data) {
$("#mp-shipping-select-holder").html(data);
});
}
}); | RomainGoncalves/Vmall | wp-content/plugins/marketpress/marketpress-includes/js/store.js | JavaScript | gpl-2.0 | 1,665 |
/*
* Copyright © 2020 Luciano Iam <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
import { ChildComponent } from '../base/component.js';
import { StateNode } from '../base/protocol.js';
import Strip from './strip.js';
export default class Mixer extends ChildComponent {
constructor (parent) {
super(parent);
this._strips = {};
this._ready = false;
}
get ready () {
return this._ready;
}
get strips () {
return Object.values(this._strips);
}
getStripByName (name) {
name = name.trim().toLowerCase();
return this.strips.find(strip => strip.name.trim().toLowerCase() == name);
}
handle (node, addr, val) {
if (node.startsWith('strip')) {
if (node == StateNode.STRIP_DESCRIPTION) {
this._strips[addr] = new Strip(this, addr, val);
this.notifyPropertyChanged('strips');
return true;
} else {
const stripAddr = [addr[0]];
if (stripAddr in this._strips) {
return this._strips[stripAddr].handle(node, addr, val);
}
}
} else {
// all initial strip description messages have been received at this point
if (!this._ready) {
this.updateLocal('ready', true);
// passthrough by allowing to return false
}
}
return false;
}
}
| Ardour/ardour | share/web_surfaces/shared/components/mixer.js | JavaScript | gpl-2.0 | 1,925 |
/*!
* VisualEditor MediaWiki Initialization class.
*
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* Initialization MediaWiki Target Analytics.
*
* @class
*
* @constructor
* @param {ve.init.mw.Target} target Target class to log events for
*/
ve.init.mw.TargetEvents = function VeInitMwTargetEvents( target ) {
this.target = target;
this.timings = { saveRetries: 0 };
// Events
this.target.connect( this, {
saveWorkflowBegin: 'onSaveWorkflowBegin',
saveWorkflowEnd: 'onSaveWorkflowEnd',
saveInitiated: 'onSaveInitated',
save: 'onSaveComplete',
saveReview: 'onSaveReview',
saveErrorEmpty: [ 'trackSaveError', 'empty' ],
saveErrorSpamBlacklist: [ 'trackSaveError', 'spamblacklist' ],
saveErrorAbuseFilter: [ 'trackSaveError', 'abusefilter' ],
saveErrorBadToken: [ 'trackSaveError', 'badtoken' ],
saveErrorNewUser: [ 'trackSaveError', 'newuser' ],
saveErrorPageDeleted: [ 'trackSaveError', 'pagedeleted' ],
saveErrorTitleBlacklist: [ 'trackSaveError', 'titleblacklist' ],
saveErrorCaptcha: [ 'trackSaveError', 'captcha' ],
saveErrorUnknown: [ 'trackSaveError', 'unknown' ],
editConflict: [ 'trackSaveError', 'editconflict' ],
surfaceReady: 'onSurfaceReady',
showChanges: 'onShowChanges',
showChangesError: 'onShowChangesError',
noChanges: 'onNoChanges',
serializeComplete: 'onSerializeComplete',
serializeError: 'onSerializeError'
} );
};
/**
* Target specific ve.track wrapper
*
* @param {string} topic Event name
* @param {Object} data Additional data describing the event, encoded as an object
*/
ve.init.mw.TargetEvents.prototype.track = function ( topic, data ) {
data.targetName = this.target.constructor.static.name;
ve.track( 'mwtiming.' + topic, data );
if ( topic.indexOf( 'performance.system.serializeforcache' ) === 0 ) {
// HACK: track serializeForCache duration here, because there's no event for that
this.timings.serializeForCache = data.duration;
}
};
/**
* Track when user begins the save workflow
*/
ve.init.mw.TargetEvents.prototype.onSaveWorkflowBegin = function () {
this.timings.saveWorkflowBegin = ve.now();
this.track( 'behavior.lastTransactionTillSaveDialogOpen', {
duration: this.timings.saveWorkflowBegin - this.timings.lastTransaction
} );
ve.track( 'mwedit.saveIntent' );
};
/**
* Track when user ends the save workflow
*/
ve.init.mw.TargetEvents.prototype.onSaveWorkflowEnd = function () {
this.track( 'behavior.saveDialogClose', { duration: ve.now() - this.timings.saveWorkflowBegin } );
this.timings.saveWorkflowBegin = null;
};
/**
* Track when document save is initiated
*/
ve.init.mw.TargetEvents.prototype.onSaveInitated = function () {
this.timings.saveInitiated = ve.now();
this.timings.saveRetries++;
this.track( 'behavior.saveDialogOpenTillSave', {
duration: this.timings.saveInitiated - this.timings.saveWorkflowBegin
} );
ve.track( 'mwedit.saveAttempt' );
};
/**
* Track when the save is complete
*
* @param {string} content
* @param {string} categoriesHtml
* @param {number} newRevId
*/
ve.init.mw.TargetEvents.prototype.onSaveComplete = function ( content, categoriesHtml, newRevId ) {
this.track( 'performance.user.saveComplete', { duration: ve.now() - this.timings.saveInitiated } );
this.timings.saveRetries = 0;
ve.track( 'mwedit.saveSuccess', {
timing: ve.now() - this.timings.saveInitiated + ( this.timings.serializeForCache || 0 ),
'page.revid': newRevId
} );
};
/**
* Track a save error by type
*
* @method
* @param {string} type Text for error type
*/
ve.init.mw.TargetEvents.prototype.trackSaveError = function ( type ) {
var key, data,
failureArguments = [],
// Maps mwtiming types to mwedit types
typeMap = {
badtoken: 'userBadToken',
newuser: 'userNewUser',
abusefilter: 'extensionAbuseFilter',
captcha: 'extensionCaptcha',
spamblacklist: 'extensionSpamBlacklist',
empty: 'responseEmpty',
unknown: 'responseUnknown',
pagedeleted: 'editPageDeleted',
titleblacklist: 'extensionTitleBlacklist',
editconflict: 'editConflict'
},
// Types that are logged as performance.user.saveError.{type}
// (for historical reasons; this sucks)
specialTypes = [ 'editconflict' ];
if ( arguments ) {
failureArguments = Array.prototype.slice.call( arguments, 1 );
}
key = 'performance.user.saveError';
if ( specialTypes.indexOf( type ) !== -1 ) {
key += '.' + type;
}
this.track( key, {
duration: ve.now() - this.timings.saveInitiated,
retries: this.timings.saveRetries,
type: type
} );
data = {
type: typeMap[ type ] || 'responseUnknown',
timing: ve.now() - this.timings.saveInitiated + ( this.timings.serializeForCache || 0 )
};
if ( type === 'unknown' && failureArguments[ 1 ].error && failureArguments[ 1 ].error.code ) {
data.message = failureArguments[ 1 ].error.code;
}
ve.track( 'mwedit.saveFailure', data );
};
/**
* Record activation having started.
*
* @param {number} [startTime] Timestamp activation started. Defaults to current time
*/
ve.init.mw.TargetEvents.prototype.trackActivationStart = function ( startTime ) {
this.timings.activationStart = startTime || ve.now();
};
/**
* Record activation being complete.
*/
ve.init.mw.TargetEvents.prototype.trackActivationComplete = function () {
this.track( 'performance.system.activation', { duration: ve.now() - this.timings.activationStart } );
};
/**
* Record the time of the last transaction in response to a 'transact' event on the document.
*/
ve.init.mw.TargetEvents.prototype.recordLastTransactionTime = function () {
this.timings.lastTransaction = ve.now();
};
/**
* Track time elapsed from beginning of save workflow to review
*/
ve.init.mw.TargetEvents.prototype.onSaveReview = function () {
this.timings.saveReview = ve.now();
this.track( 'behavior.saveDialogOpenTillReview', {
duration: this.timings.saveReview - this.timings.saveWorkflowBegin
} );
};
ve.init.mw.TargetEvents.prototype.onSurfaceReady = function () {
this.target.surface.getModel().getDocument().connect( this, {
transact: 'recordLastTransactionTime'
} );
};
/**
* Track when the user enters the review workflow
*/
ve.init.mw.TargetEvents.prototype.onShowChanges = function () {
this.track( 'performance.user.reviewComplete', { duration: ve.now() - this.timings.saveReview } );
};
/**
* Track when the diff request fails in the review workflow
*/
ve.init.mw.TargetEvents.prototype.onShowChangesError = function () {
this.track( 'performance.user.reviewError', { duration: ve.now() - this.timings.saveReview } );
};
/**
* Track when the diff request detects no changes
*/
ve.init.mw.TargetEvents.prototype.onNoChanges = function () {
this.track( 'performance.user.reviewComplete', { duration: ve.now() - this.timings.saveReview } );
};
/**
* Track whe serilization is complete in review workflow
*/
ve.init.mw.TargetEvents.prototype.onSerializeComplete = function () {
this.track( 'performance.user.reviewComplete', { duration: ve.now() - this.timings.saveReview } );
};
/**
* Track when there is a serlization error
*/
ve.init.mw.TargetEvents.prototype.onSerializeError = function () {
if ( this.timings.saveWorkflowBegin ) {
// This function can be called by the switch to wikitext button as well, so only log
// reviewError if we actually got here from the save workflow
this.track( 'performance.user.reviewError', { duration: ve.now() - this.timings.saveReview } );
}
};
| tbs-sct/gcpedia | extensions/VisualEditor/modules/ve-mw/init/ve.init.mw.TargetEvents.js | JavaScript | gpl-2.0 | 7,477 |
diamondApp.service('scrollSvc', function () {
this.scrollTo = function (eID) {
// This scrolling function
// is from http://www.itnewb.com/tutorial/Creating-the-Smooth-Scroll-Effect-with-JavaScript
var startY = currentYPosition();
var stopY = elmYPosition(eID);
var distance = stopY > startY ? stopY - startY : startY - stopY;
if (distance < 100) {
scrollTo(0, stopY);
return;
}
var speed = Math.round(distance / 10);
if (speed >= 20) speed = 20;
var step = Math.round(distance / 25);
var leapY = stopY > startY ? startY + step : startY - step;
var timer = 0;
if (stopY > startY) {
for (var i = startY; i < stopY; i += step) {
setTimeout("window.scrollTo(0, " + leapY + ")", timer * speed);
leapY += step;
if (leapY > stopY) leapY = stopY;
timer++;
}
return;
}
for (var i = startY; i > stopY; i -= step) {
setTimeout("window.scrollTo(0, " + leapY + ")", timer * speed);
leapY -= step;
if (leapY < stopY) leapY = stopY;
timer++;
}
function currentYPosition() {
// Firefox, Chrome, Opera, Safari
if (self.pageYOffset) return self.pageYOffset;
// Internet Explorer 6 - standards mode
if (document.documentElement && document.documentElement.scrollTop) return document.documentElement.scrollTop;
// Internet Explorer 6, 7 and 8
if (document.body.scrollTop) return document.body.scrollTop;
return 0;
}
function elmYPosition(eID) {
var elm = document.getElementById(eID);
var y = elm.offsetTop;
var node = elm;
while (node.offsetParent && node.offsetParent != document.body) {
node = node.offsetParent;
y += node.offsetTop;
}
return y;
}
};
}); | leadershipdiamond/leadershipdiamond | wp-content/themes/leadership-diamond-theme/js/app/services/scrollSvc.js | JavaScript | gpl-2.0 | 2,069 |
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.logging.Logger");
dojo.provide("dojo.logging.LogFilter");
dojo.provide("dojo.logging.Record");
dojo.provide("dojo.log");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.declare");
/* This is the dojo logging facility, which is imported from nWidgets
(written by Alex Russell, CLA on file), which is patterned on the
Python logging module, which in turn has been heavily influenced by
log4j (execpt with some more pythonic choices, which we adopt as well).
While the dojo logging facilities do provide a set of familiar
interfaces, many of the details are changed to reflect the constraints
of the browser environment. Mainly, file and syslog-style logging
facilites are not provided, with HTTP POST and GET requests being the
only ways of getting data from the browser back to a server. Minimal
support for this (and XML serialization of logs) is provided, but may
not be of practical use in a deployment environment.
The Dojo logging classes are agnostic of any environment, and while
default loggers are provided for browser-based interpreter
environments, this file and the classes it define are explicitly
designed to be portable to command-line interpreters and other
ECMA-262v3 envrionments.
the logger needs to accomidate:
log "levels"
type identifiers
file?
message
tic/toc?
The logger should ALWAYS record:
time/date logged
message
type
level
*/
// TODO: define DTD for XML-formatted log messages
// TODO: write XML Formatter class
// TODO: write HTTP Handler which uses POST to send log lines/sections
dojo.logging.Record = function(/*Integer*/logLevel, /*String||Array*/message){
// summary:
// A simple data structure class that stores information for and about
// a logged event. Objects of this type are created automatically when
// an event is logged and are the internal format in which information
// about log events is kept.
// logLevel:
// Integer mapped via the dojo.logging.log.levels object from a
// string. This mapping also corresponds to an instance of
// dojo.logging.Logger
// message:
// The contents of the message represented by this log record.
this.level = logLevel;
this.message = "";
this.msgArgs = [];
this.time = new Date();
if(dojo.lang.isArray(message)){
if(message.length > 0 && dojo.lang.isString(message[0])){
this.message=message.shift();
}
this.msgArgs = message;
}else{
this.message = message;
}
// FIXME: what other information can we receive/discover here?
}
dojo.logging.LogFilter = function(loggerChain){
// summary:
// An empty parent (abstract) class which concrete filters should
// inherit from. Filters should have only a single method, filter(),
// which processes a record and returns true or false to denote
// whether or not it should be handled by the next step in a filter
// chain.
this.passChain = loggerChain || "";
this.filter = function(record){
// FIXME: need to figure out a way to enforce the loggerChain
// restriction
return true; // pass all records
}
}
dojo.logging.Logger = function(){
this.cutOffLevel = 0;
this.propagate = true;
this.parent = null;
// storage for dojo.logging.Record objects seen and accepted by this logger
this.data = [];
this.filters = [];
this.handlers = [];
}
dojo.extend(dojo.logging.Logger,{
_argsToArr: function(args){
var ret = [];
for(var x=0; x<args.length; x++){
ret.push(args[x]);
}
return ret;
},
setLevel: function(/*Integer*/lvl){
// summary:
// set the logging level for this logger.
// lvl:
// the logging level to set the cutoff for, as derived from the
// dojo.logging.log.levels object. Any messages below the
// specified level are dropped on the floor
this.cutOffLevel = parseInt(lvl);
},
isEnabledFor: function(/*Integer*/lvl){
// summary:
// will a message at the specified level be emitted?
return parseInt(lvl) >= this.cutOffLevel; // boolean
},
getEffectiveLevel: function(){
// summary:
// gets the effective cutoff level, including that of any
// potential parent loggers in the chain.
if((this.cutOffLevel==0)&&(this.parent)){
return this.parent.getEffectiveLevel(); // Integer
}
return this.cutOffLevel; // Integer
},
addFilter: function(/*dojo.logging.LogFilter*/flt){
// summary:
// registers a new LogFilter object. All records will be passed
// through this filter from now on.
this.filters.push(flt);
return this.filters.length-1; // Integer
},
removeFilterByIndex: function(/*Integer*/fltIndex){
// summary:
// removes the filter at the specified index from the filter
// chain. Returns whether or not removal was successful.
if(this.filters[fltIndex]){
delete this.filters[fltIndex];
return true; // boolean
}
return false; // boolean
},
removeFilter: function(/*dojo.logging.LogFilter*/fltRef){
// summary:
// removes the passed LogFilter. Returns whether or not removal
// was successful.
for(var x=0; x<this.filters.length; x++){
if(this.filters[x]===fltRef){
delete this.filters[x];
return true;
}
}
return false;
},
removeAllFilters: function(){
// summary: clobbers all the registered filters.
this.filters = []; // clobber all of them
},
filter: function(/*dojo.logging.Record*/rec){
// summary:
// runs the passed Record through the chain of registered filters.
// Returns a boolean indicating whether or not the Record should
// be emitted.
for(var x=0; x<this.filters.length; x++){
if((this.filters[x]["filter"])&&
(!this.filters[x].filter(rec))||
(rec.level<this.cutOffLevel)){
return false; // boolean
}
}
return true; // boolean
},
addHandler: function(/*dojo.logging.LogHandler*/hdlr){
// summary: adds as LogHandler to the chain
this.handlers.push(hdlr);
return this.handlers.length-1;
},
handle: function(/*dojo.logging.Record*/rec){
// summary:
// if the Record survives filtering, pass it down to the
// registered handlers. Returns a boolean indicating whether or
// not the record was successfully handled. If the message is
// culled for some reason, returns false.
if((!this.filter(rec))||(rec.level<this.cutOffLevel)){ return false; } // boolean
for(var x=0; x<this.handlers.length; x++){
if(this.handlers[x]["handle"]){
this.handlers[x].handle(rec);
}
}
// FIXME: not sure what to do about records to be propagated that may have
// been modified by the handlers or the filters at this logger. Should
// parents always have pristine copies? or is passing the modified record
// OK?
// if((this.propagate)&&(this.parent)){ this.parent.handle(rec); }
return true; // boolean
},
// the heart and soul of the logging system
log: function(/*integer*/lvl, /*string*/msg){
// summary:
// log a message at the specified log level
if( (this.propagate)&&(this.parent)&&
(this.parent.rec.level>=this.cutOffLevel)){
this.parent.log(lvl, msg);
return false;
}
// FIXME: need to call logging providers here!
this.handle(new dojo.logging.Record(lvl, msg));
return true;
},
// logger helpers
debug:function(/*string*/msg){
// summary:
// log the msg and any other arguments at the "debug" logging
// level.
return this.logType("DEBUG", this._argsToArr(arguments));
},
info: function(msg){
// summary:
// log the msg and any other arguments at the "info" logging
// level.
return this.logType("INFO", this._argsToArr(arguments));
},
warning: function(msg){
// summary:
// log the msg and any other arguments at the "warning" logging
// level.
return this.logType("WARNING", this._argsToArr(arguments));
},
error: function(msg){
// summary:
// log the msg and any other arguments at the "error" logging
// level.
return this.logType("ERROR", this._argsToArr(arguments));
},
critical: function(msg){
// summary:
// log the msg and any other arguments at the "critical" logging
// level.
return this.logType("CRITICAL", this._argsToArr(arguments));
},
exception: function(/*string*/msg, /*Error*/e, /*boolean*/squelch){
// summary:
// logs the error and the message at the "exception" logging
// level. If squelch is true, also prevent bubbling of the
// exception.
// FIXME: this needs to be modified to put the exception in the msg
// if we're on Moz, we can get the following from the exception object:
// lineNumber
// message
// fileName
// stack
// name
// on IE, we get:
// name
// message (from MDA?)
// number
// description (same as message!)
if(e){
var eparts = [e.name, (e.description||e.message)];
if(e.fileName){
eparts.push(e.fileName);
eparts.push("line "+e.lineNumber);
// eparts.push(e.stack);
}
msg += " "+eparts.join(" : ");
}
this.logType("ERROR", msg);
if(!squelch){
throw e;
}
},
logType: function(/*string*/type, /*array*/args){
// summary:
// a more "user friendly" version of the log() function. Takes the
// named log level instead of the corresponding integer.
return this.log.apply(this, [dojo.logging.log.getLevel(type),
args]);
},
warn:function(){
// summary: shorthand for warning()
this.warning.apply(this,arguments);
},
err:function(){
// summary: shorthand for error()
this.error.apply(this,arguments);
},
crit:function(){
// summary: shorthand for critical()
this.critical.apply(this,arguments);
}
});
// the Handler class
dojo.logging.LogHandler = function(level){
this.cutOffLevel = (level) ? level : 0;
this.formatter = null; // FIXME: default formatter?
this.data = [];
this.filters = [];
}
dojo.lang.extend(dojo.logging.LogHandler,{
setFormatter:function(formatter){
dojo.unimplemented("setFormatter");
},
flush:function(){
// summary:
// Unimplemented. Should be implemented by subclasses to handle
// finishing a transaction or otherwise comitting pending log
// messages to whatevery underlying transport or storage system is
// available.
},
close:function(){
// summary:
// Unimplemented. Should be implemented by subclasses to handle
// shutting down the logger, including a call to flush()
},
handleError:function(){
// summary:
// Unimplemented. Should be implemented by subclasses.
dojo.deprecated("dojo.logging.LogHandler.handleError", "use handle()", "0.6");
},
handle:function(/*dojo.logging.Record*/record){
// summary:
// Emits the record object passed in should the record meet the
// current logging level cuttof, as specified in cutOffLevel.
if((this.filter(record))&&(record.level>=this.cutOffLevel)){
this.emit(record);
}
},
emit:function(/*dojo.logging.Record*/record){
// summary:
// Unimplemented. Should be implemented by subclasses to handle
// an individual record. Subclasses may batch records and send
// them to their "substrate" only when flush() is called, but this
// is generally not a good idea as losing logging messages may
// make debugging significantly more difficult. Tuning the volume
// of logging messages written to storage should be accomplished
// with log levels instead.
dojo.unimplemented("emit");
}
});
// set aliases since we don't want to inherit from dojo.logging.Logger
void(function(){ // begin globals protection closure
var names = [
"setLevel", "addFilter", "removeFilterByIndex", "removeFilter",
"removeAllFilters", "filter"
];
var tgt = dojo.logging.LogHandler.prototype;
var src = dojo.logging.Logger.prototype;
for(var x=0; x<names.length; x++){
tgt[names[x]] = src[names[x]];
}
})(); // end globals protection closure
dojo.logging.log = new dojo.logging.Logger();
// an associative array of logger objects. This object inherits from
// a list of level names with their associated numeric levels
dojo.logging.log.levels = [ {"name": "DEBUG", "level": 1},
{"name": "INFO", "level": 2},
{"name": "WARNING", "level": 3},
{"name": "ERROR", "level": 4},
{"name": "CRITICAL", "level": 5} ];
dojo.logging.log.loggers = {};
dojo.logging.log.getLogger = function(/*string*/name){
// summary:
// returns a named dojo.logging.Logger instance. If one is not already
// available with that name in the global map, one is created and
// returne.
if(!this.loggers[name]){
this.loggers[name] = new dojo.logging.Logger();
this.loggers[name].parent = this;
}
return this.loggers[name]; // dojo.logging.Logger
}
dojo.logging.log.getLevelName = function(/*integer*/lvl){
// summary: turns integer logging level into a human-friendly name
for(var x=0; x<this.levels.length; x++){
if(this.levels[x].level == lvl){
return this.levels[x].name; // string
}
}
return null;
}
dojo.logging.log.getLevel = function(/*string*/name){
// summary: name->integer conversion for log levels
for(var x=0; x<this.levels.length; x++){
if(this.levels[x].name.toUpperCase() == name.toUpperCase()){
return this.levels[x].level; // integer
}
}
return null;
}
// a default handler class, it simply saves all of the handle()'d records in
// memory. Useful for attaching to with dojo.event.connect()
dojo.declare("dojo.logging.MemoryLogHandler",
dojo.logging.LogHandler,
{
initializer: function(level, recordsToKeep, postType, postInterval){
// mixin style inheritance
dojo.logging.LogHandler.call(this, level);
// default is unlimited
this.numRecords = (typeof djConfig['loggingNumRecords'] != 'undefined') ? djConfig['loggingNumRecords'] : ((recordsToKeep) ? recordsToKeep : -1);
// 0=count, 1=time, -1=don't post TODO: move this to a better location for prefs
this.postType = (typeof djConfig['loggingPostType'] != 'undefined') ? djConfig['loggingPostType'] : ( postType || -1);
// milliseconds for time, interger for number of records, -1 for non-posting,
this.postInterval = (typeof djConfig['loggingPostInterval'] != 'undefined') ? djConfig['loggingPostInterval'] : ( postType || -1);
},
emit: function(record){
if(!djConfig.isDebug){ return; }
var logStr = String(dojo.log.getLevelName(record.level)+": "
+record.time.toLocaleTimeString())+": "+record.message;
if(!dj_undef("println", dojo.hostenv)){
dojo.hostenv.println(logStr, record.msgArgs);
}
this.data.push(record);
if(this.numRecords != -1){
while(this.data.length>this.numRecords){
this.data.shift();
}
}
}
}
);
dojo.logging.logQueueHandler = new dojo.logging.MemoryLogHandler(0,50,0,10000);
dojo.logging.log.addHandler(dojo.logging.logQueueHandler);
dojo.log = dojo.logging.log;
| smee/elateXam | taskmodel/taskmodel-core-view/src/main/webapp/dojo/src/logging/Logger.js | JavaScript | gpl-3.0 | 15,366 |
/**
* @class Ext.sparkline.Shape
* @private
*/
Ext.define('Ext.sparkline.Shape', {
constructor: function (target, id, type, args) {
this.target = target;
this.id = id;
this.type = type;
this.args = args;
},
append: function () {
this.target.appendShape(this);
return this;
}
});
| tlaitinen/sms | frontend/ext/src/sparkline/Shape.js | JavaScript | gpl-3.0 | 346 |
/**
* @package omeka
* @subpackage neatline
* @copyright 2014 Rector and Board of Visitors, University of Virginia
* @license http://www.apache.org/licenses/LICENSE-2.0.html
*/
Neatline.module('Editor.Exhibit.Records', function(Records) {
Records.Controller = Neatline.Shared.Controller.extend({
slug: 'EDITOR:EXHIBIT:RECORDS',
commands: [
'display',
'load',
'ingest',
'navToList'
],
requests: [
'getModel'
],
/**
* Create the router, collection, and view.
*/
init: function() {
this.router = new Records.Router();
this.view = new Records.View({ slug: this.slug });
},
/**
* Append the list to the editor container.
*
* @param {Object} container: The container element.
*/
display: function(container) {
this.view.showIn(container);
},
/**
* Query for new records.
*
* @param {Object} params: The query parameters.
*/
load: function(params) {
this.view.load(params);
},
/**
* Render a records collection in the list.
*
* @param {Object} records: The collection of records.
*/
ingest: function(records) {
this.view.ingest(records);
},
/**
* Navigate to the record list.
*/
navToList: function() {
this.router.navigate('records', true);
},
/**
* Get a record model from the collection.
*
* @param {Number} id: The record id.
* @param {Function} cb: A callback, called with the model.
*/
getModel: function(id, cb) {
this.view.records.getOrFetch(id, cb);
}
});
});
| elotroalex/devlib | plugins/Neatline/views/shared/javascripts/src/editor/exhibit/records/records.controller.js | JavaScript | gpl-3.0 | 1,675 |
/**
* OpenEyes
*
* (C) Moorfields Eye Hospital NHS Foundation Trust, 2008-2011
* (C) OpenEyes Foundation, 2011-2013
* This file is part of OpenEyes.
* OpenEyes is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
* OpenEyes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with OpenEyes in a file titled COPYING. If not, see <http://www.gnu.org/licenses/>.
*
* @package OpenEyes
* @link http://www.openeyes.org.uk
* @author OpenEyes <[email protected]>
* @copyright Copyright (c) 2008-2011, Moorfields Eye Hospital NHS Foundation Trust
* @copyright Copyright (c) 2011-2013, OpenEyes Foundation
* @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0
*/
/**
* Cutter Peripheral iridectomy
*
* @class CutterPI
* @property {String} className Name of doodle subclass
* @param {Drawing} _drawing
* @param {Object} _parameterJSON
*/
ED.CutterPI = function(_drawing, _parameterJSON) {
// Set classname
this.className = "CutterPI";
// Saved parameters
this.savedParameterArray = ['rotation'];
// Call superclass constructor
ED.Doodle.call(this, _drawing, _parameterJSON);
}
/**
* Sets superclass and constructor
*/
ED.CutterPI.prototype = new ED.Doodle;
ED.CutterPI.prototype.constructor = ED.CutterPI;
ED.CutterPI.superclass = ED.Doodle.prototype;
/**
* Sets default properties
*/
ED.CutterPI.prototype.setPropertyDefaults = function() {
this.isScaleable = false;
this.isMoveable = false;
}
/**
* Sets default parameters
*/
ED.CutterPI.prototype.setParameterDefaults = function() {
this.setRotationWithDisplacements(160, 40);
}
/**
* Draws doodle or performs a hit test if a Point parameter is passed
*
* @param {Point} _point Optional point in canvas plane, passed if performing hit test
*/
ED.CutterPI.prototype.draw = function(_point) {
// Get context
var ctx = this.drawing.context;
// Call draw method in superclass
ED.CutterPI.superclass.draw.call(this, _point);
// Boundary path
ctx.beginPath();
// Draw base
ctx.arc(0, -324, 40, 0, 2 * Math.PI, true);
// Colour of fill
ctx.fillStyle = "rgba(255,255,255,1)";
// Set line attributes
ctx.lineWidth = 4;
// Colour of outer line is dark gray
ctx.strokeStyle = "rgba(120,120,120,0.75)";;
// Draw boundary path (also hit testing)
this.drawBoundary(_point);
// Return value indicating successful hittest
return this.isClicked;
}
/**
* Returns a string containing a text description of the doodle
*
* @returns {String} Description of doodle
*/
ED.CutterPI.prototype.groupDescription = function() {
return "Cutter iridectomy/s";
}
| openeyesarchive/eyedraw | src/ED/Doodles/Oph/CutterPI.js | JavaScript | gpl-3.0 | 3,009 |
function loadText()
{
var txtLang = document.getElementsByName("txtLang");
txtLang[0].innerHTML = "K\u00E4lla";
txtLang[1].innerHTML = "Alternativ text";
txtLang[2].innerHTML = "Mellanrum";
txtLang[3].innerHTML = "Placering";
txtLang[4].innerHTML = "\u00D6verst";
txtLang[5].innerHTML = "Bildram";
txtLang[6].innerHTML = "Nederst";
txtLang[7].innerHTML = "Bredd";
txtLang[8].innerHTML = "V\u00E4nster";
txtLang[9].innerHTML = "H\u00F6jd";
txtLang[10].innerHTML = "H\u00F6ger";
var optLang = document.getElementsByName("optLang");
optLang[0].text = "Abs. nederst";
optLang[1].text = "Abs. mitten";
optLang[2].text = "Baslinje";
optLang[3].text = "Nederst";
optLang[4].text = "V\u00E4nster";
optLang[5].text = "Mitten";
optLang[6].text = "H\u00F6ger";
optLang[7].text = "Text-topp";
optLang[8].text = "\u00D6verst";
document.getElementById("btnBorder").value = " Kantlinje ";
document.getElementById("btnReset").value = "\u00C5terst\u00E4ll";
document.getElementById("btnCancel").value = "Avbryt";
document.getElementById("btnInsert").value = "Infoga";
document.getElementById("btnApply").value = "Verkst\u00E4ll";
document.getElementById("btnOk").value = " OK ";
}
function writeTitle()
{
document.write("<title>Bild</title>")
} | Alex-Bond/Core-package | tests/editors/iseditor2/scripts/language/finnish/image.js | JavaScript | gpl-3.0 | 1,371 |
/*! jQuery UI - v1.10.4 - 2014-01-17
* http://jqueryui.com
* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
jQuery(function(t){t.datepicker.regional.it={closeText:"Chiudi",prevText:"<Prec",nextText:"Succ>",currentText:"Oggi",monthNames:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthNamesShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],dayNames:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"],dayNamesShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],dayNamesMin:["Do","Lu","Ma","Me","Gi","Ve","Sa"],weekHeader:"Sm",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.datepicker.setDefaults(t.datepicker.regional.it)}); | guatajuk/sirUSI | includes/jquery-ui-1.10.4/development-bundle/ui/minified/i18n/jquery.ui.datepicker-it.min.js | JavaScript | gpl-3.0 | 825 |
/* Global variables */
var _languagesHashOld = new Array();
var _languagesHash = new Array();
var _languagesRegexHash = new Array();
/* Initialize the languages arrays */
/* Order alphabetically by _languagesHash key */
/* Based in ISO 639-3 codes */
/* source: http://www-01.sil.org/iso639-3/iso-639-3.tab */
/* alt source: https://github.com/wikimedia/mediawiki/blob/7458dc32d99e6dd569b1629762443d074b6a3c52/languages/Names.php */
_languagesHash = {
'aar': 'Afaraf',
'arz': 'اللغة المصرية العامية',
'abk': 'аҧсуа бызшәа, аҧсшәа',
'ace': 'بهسا اچيه',
'aeb': 'زَوُن',
'afr': 'Afrikaans',
'aka': 'Akan',
'amh': 'አማርኛ',
'ang': 'Old English',
'ara': 'العربية',
'arg': 'Aragonés',
'asm': 'অসমীয়া',
'ava': 'авар мацӀ, магӀарул мацӀ',
'ave': 'avesta',
'aym': 'aymar aru',
'ary': 'الدارجة',
'arc': 'Imperial Aramaic',
'ast': 'Asturianu',
'aze': 'azərbaycanca',
'azb': 'South Azerbaijani',
'bak': 'Bašqort',
'bar': 'Boarisch',
'bam': 'Bamanankan',
'bpy': 'বিষ্ণুপ্রিয়া মণিপুরী',
'bcl': 'Bikol Sentral',
'bel': 'Беларуская',
'ben': 'বাংলা',
'bho': 'भोजपुरी',
'bis': 'Bislama',
'bod': 'བོད་ཡིག',
'bos': 'bosanski jezik',
'bre': 'Brezhoneg',
'bul': 'Български',
'bus': 'Bisã',
'bxr': 'буряад хэлэн',
'bcc': 'balojî Balójí',
'bel-tasrask': 'тарашкевіца, клясычны правапіс',
'bjn': 'Bahasa Banjar',
'cat': 'Català',
'cdo': '平話',
'ces': 'Česky',
'ceb': 'Sinugboanon',
'cha': 'Chamoru',
'che': 'нохчийн мотт',
'chy': 'Tsėhésenėstsestȯtse',
'chu': 'ѩзыкъ словѣньскъ',
'chv': 'Чӑвашла',
'cbk-zam': 'Chavacano',
'cor': 'Kernewek',
'cos': 'corsu, lingua corsa',
'cre': 'ᓀᐦᐃᔭᐍᐏᐣ',
'cym': 'Cymraeg',
'chr': 'ᏣᎳᎩ ᎦᏬᏂᎯᏍᏗ',
'crh': 'Къырымтатарджа',
'ckb': 'کوردیی ناوەندی',
'csb': 'Kaszëbsczi jãzëk',
'dan': 'Dansk',
'dsb': 'Dolnoserbski',
'deu': 'Deutsch',
'div': 'ދިވެހި',
'dzo': ' རྫོང་ཁ',
'ell': 'Ελληνικά',
'eng': 'English',
'epo': 'Esperanto',
'est': 'Eesti',
'eus': 'euskara',
'ewe': 'Eʋegbe',
'ext': 'estremeñu',
'eml': 'emiliân-rumagnōl',
'ebn': 'বাংলা',
'fao': 'Føroyskt',
'fas': 'فارسی',
'fij': 'vosa Vakaviti',
'fin': 'Suomi',
'fra': 'Français',
'fry': 'Frysk',
'ful': 'Fulfulde',
'fur': 'Furlan',
'frp': 'Provençau',
'frr': 'Nordfriisk',
'gag': 'Gagauz dili',
'gan': '贛語',
'gla': 'Gàidhlig',
'gle': 'Gaeilge',
'glg': 'Galego',
'glv': 'Gaelg',
'glk': 'گیلکی',
'got': 'Gothic',
'grn': 'Avañe\'ẽ',
'guj': 'ગુજરાતી',
'gsw': 'Schwyzerdütsch',
'hak': '客家語/Hak-kâ-ngî',
'haw': 'ʻŌlelo Hawaiʻi',
'hat': 'Kreyol ayisyen',
'hau': 'Hausa',
'heb': 'עברית',
'her': 'Otjiherero',
'hin': 'हिन्दी',
'hmo': 'Hiri Motu',
'hrv': 'Олык Марий',
'hun': 'Magyar',
'hye': 'Հայերեն',
'hif-latn': 'Fiji Baat',
'hif': 'फिजी बात',
'hrx': 'Riograndenser Hunsrückisch',
'hsb': 'Hornjoserbsce',
'ibo': 'Asụsụ Igbo',
'ido': 'Ido',
'iii': 'ꆈꌠ꒿ Nuosuhxop',
'iku': 'ᐃᓄᒃᑎᑐᑦ',
'ile': 'Interlingue',
'ina': 'Interlingua',
'ind': 'Bahasa Indonesia',
'ipk': 'Iñupiaq',
'isl': 'Íslenska',
'ita': 'Italiano',
'ilo': 'Ilokano',
'jav': 'Basa Jawa',
'jpn': '日本語',
'jbo': 'la .lojban.',
'kaa': 'Қарақалпақ тили',
'kal': 'Kalaallisut',
'kan': 'ಕನ್ನಡ',
'kas': 'कश्मीरी',
'kat': 'ქართული',
'kau': 'Kanuri',
'kaz': 'Қазақша',
'khm': 'ភាសាខ្មែរ',
'kik': 'Gĩkũyũ',
'kin': 'Ikinyarwanda',
'kir': 'قىرعىز تىلى',
'kom': 'коми кыв',
'kon': 'Kikongo',
'kor': '한국어',
'kor-kp': '조선어',
'kua': 'Kuanyama',
'kur': 'kurdî',
'ksh': 'Ripoarisch',
'kab': 'Taqbaylit',
'kbd': 'Адыгэбзэ',
'koi': 'Перем коми кыв',
'krc': 'Къарачай-Малкъар тил',
'lad': 'Judeo-Español',
'lbe': 'лакку маз',
'lez': 'Лезги чӏал Lezgi č’al',
'lij': 'Lìgure, Zenéize',
'lki': 'لوری',
'lmo': 'Lumbaart',
'ltg': 'latgalīšu volūda',
'lzh': '古文',
'mai': 'मैथिली, মৈথিলী',
'mdf': 'Мокшень кяль / mokšenj kälj',
'mhr': 'Meadow Mari',
'min': 'باسو مينڠكاباو',
'mrj': 'Мары йӹлмӹ',
'mwl': 'Mirandés',
'myv': 'Morafa',
'mzn': 'مازندرانی',
'nah': 'Asteca',
'nan': '閩南語 / 闽南语',
'nap': 'Napulitano',
'nds': 'Plattdüütsch',
'nds-nl': 'Nederlaands Leegsaksies',
'nov': 'Novial',
'nrm': 'Narom',
'nso': 'Pedi',
'pag': 'Pangasinense',
'pam': 'Amánung Sísuan',
'pap': 'Papiamentu',
'pfl': 'Pfälzisch',
'pih': 'Pitkern-Norfolk',
'lao': 'ພາສາລາວ',
'lat': 'Lingua Latīna',
'lav': 'Latviešu',
'lim': 'Limburgs',
'lin': 'Lingála',
'lit': 'Lietuvių',
'ltz': 'Lëtzebuergesch',
'lub': 'Tshiluba',
'lug': 'Luganda',
'mah': 'Kajin M̧ajeļ',
'mal': 'മലയാളം',
'mar': 'मराठी',
'map-bms': 'Basa Banyumasan',
'mkd': 'Македонски',
'mlg': 'Malagasy',
'mlt': 'Malti',
'mon': 'Монгол хэл',
'mri': 'Te reo Māori',
'msa': 'Bahasa Melayu',
'mul': 'multilingual',
'mya': 'မြန်မာဘာသာ',
'nau': 'Ekakairũ Naoero',
'nav': 'Diné bizaad',
'nbl': 'isiNdebele',
'nde': 'isiNdebele',
'ndo': 'Owambo',
'nep': 'नेपाली',
'nld': 'Nederlands',
'nno': 'Norsk (nynorsk)',
'nob': 'Norsk (bokmål)',
'nor': 'Norsk (bokmål)',
'nya': 'ChiCheŵa',
'new': 'नेपाल भाषा',
'oci': 'Occitan',
'oji': 'ᐊᓂᔑᓈᐯᒧᐎᓐ',
'ori': 'ଓଡ଼ିଆ',
'orm': 'Afaan Oromoo',
'oss': 'ирон æвзаг',
'pan': 'ਪੰਜਾਬੀ',
'pcd': 'Picard',
'pli': 'पाऴि',
'pol': 'Język polski',
'por': 'Português',
'por-pt': 'Português do Brasil',
'pus': 'پښتو',
'pdc': 'Pennsilfaanisch Deitsch',
'pms': 'Piemontèis',
'que': 'Runa Simi',
'roh': 'Rumantsch',
'ron': 'Română',
'run': 'Ikirundi',
'rus': 'Русский',
'rue': 'Русиньскый',
'pnb': 'شاہ مکھی پنجابی',
'pnt': 'ποντιακά',
'rmy': 'Vlax Romani',
'roa-tara': 'Tarandíne',
'rup': 'armãneashce, armãneashti, rrãmãneshti',
'sah': 'Саха тыла',
'scn': 'Sicilianu',
'sco': '(Braid) Scots, Lallans',
'sgs': 'Žemaičių tarmė',
'srn': 'Sranan Tongo',
'stq': 'Seeltersk',
'szl': 'ślōnskŏ gŏdka',
'tet': 'Lia-Tetun',
'tpi': 'Tok Pisin',
'tum': 'chiTumbuka',
'tyv': 'тыва дыл tyva dyl',
'udm': 'удмурт кыл udmurt kyl',
'vep': 'vepsän kel’',
'vls': 'West-Vlaams',
'vro': 'võro kiil',
'wuu': '吳語/吴语',
'xal': 'ᡆᡕᡅᠷᠠᡑ ᡘᡄᠯᡄᠨ',
'xmf': 'მარგალური ნინა',
'yue': '廣州話 / 广州话',
'zea': 'Zeêuws',
'zh-min-nan': '閩南語 / 闽南语',
'sag': 'yângâ tî sängö',
'san': 'संस्कृतम्',
'sin': 'සිංහල',
'skr': 'सराइकी',
'slk': 'Slovenčina',
'slv': 'Slovenščina',
'sme': 'Davvisámegiella',
'smo': 'gagana fa\'a Samoa',
'sna': 'chiShona',
'snd': 'सिन्धी',
'som': 'Soomaaliga',
'sot': 'Sesotho',
'spa': 'Español',
'sqi': 'Mirësevini',
'tha': 'ภาษาไทย',
'srd': 'sardu',
'srp': 'Српски',
'srp-ec': 'Српски (ћирилица)',
'srp-el': 'Srpski (latinica)',
'ssw': 'SiSwati',
'sun': 'Basa Sunda',
'swa': 'Kiswahili',
'swe': 'Svenska',
'ses': 'Koyraboro Senni',
'sh': 'Srpskohrvatski / Српскохрватски',
'tah': 'Reo Tahiti',
'tam': 'தமிழ்',
'tat': 'татар теле',
'tel': 'తెలుగు',
'tgk': 'тоҷикӣ',
'tgl': 'Wikang Tagalog',
'tir': 'ትግርኛ',
'ton': 'faka Tonga',
'tsn': 'Setswana',
'tso': 'Xitsonga',
'tuk': 'Türkmen dili',
'tur': 'Türkçe',
'twi': 'Twi',
'tcy': 'ತುಳು',
'tly': 'толышә зывон',
'tt-cyrl': 'Татарча',
'uig': 'ئۇيغۇرچە',
'ug-arab': 'ئۇيغۇرچە',
'ukr': 'Українська',
'urd': 'اردو',
'uzb': 'Oʻzbekcha',
'ven': 'Tshivenḓa',
'vec': 'Vèneto',
'vie': 'Tiếng Việt',
'vol': 'Volapük',
'wln': 'walon',
'wol': 'Wolof',
'xho': 'isiXhosa',
'yid': 'ייִדיש',
'yor': 'Yorùbá',
'zha': 'Saɯ cueŋƅ',
'zho': '中文',
'zho-hans': '中文(简体)',
'zho-hant': '中文(繁體)',
'zho-hk': '中文(香港)',
'zul': 'isiZulu',
'zza': 'Zāzākī'
};
/* Based in ISO 639-1 and 639-2 codes */
_languagesHashOld = {
'ay': _languagesHash.aym,
'aa': _languagesHash.aar,
'ab': _languagesHash.abk,
'af': _languagesHash.afr,
'ak': _languagesHash.aka,
'am': _languagesHash.amh,
'an': _languagesHash.arg,
'ar': _languagesHash.ara,
'as': _languagesHash.asm,
'az': _languagesHash.aze,
'ba': _languagesHash.bak,
'bh': _languagesHash.bho,
'bm': _languagesHash.bam,
'be': _languagesHash.bel,
'bi': _languagesHash.bis,
'bo': _languagesHash.bod,
'bn': _languagesHash.ben,
'br': _languagesHash.bre,
'bs': _languagesHash.bos,
'bg': _languagesHash.bul,
'be-tarask': _languagesHash['bel-tasrask'],
'ca': _languagesHash.cat,
'ce': _languagesHash.che,
'co': _languagesHash.cos,
'cs': _languagesHash.ces,
'cv': _languagesHash.chv,
'cy': _languagesHash.cym,
'cu': _languagesHash.chu,
'cr': _languagesHash.cre,
'crh-latn': _languagesHash.crh,
'ch': _languagesHash.cha,
'da': _languagesHash.dan,
'de': _languagesHash.deu,
'dv': _languagesHash.div,
'dz': _languagesHash.dzo,
'ee': _languagesHash.ewe,
'el': _languagesHash.ell,
'en': _languagesHash.eng,
'eo': _languagesHash.epo,
'eu': _languagesHash.eus,
'et': _languagesHash.est,
'fo': _languagesHash.fao,
'fa': _languagesHash.fas,
'fi': _languagesHash.fin,
'fy': _languagesHash.fry,
'fj': _languagesHash.fij,
'fr': _languagesHash.fra,
'ff': _languagesHash.ful,
'gl': _languagesHash.glg,
'gd': _languagesHash.gla,
'ga': _languagesHash.gle,
'gn': _languagesHash.grn,
'gu': _languagesHash.guj,
'gv': _languagesHash.glv,
'ht': _languagesHash.hat,
'ha': _languagesHash.hau,
'he': _languagesHash.heb,
'hi': _languagesHash.hin,
'hr': _languagesHash.hrv,
'hu': _languagesHash.hun,
'hy': _languagesHash.hye,
'ie': _languagesHash.ile,
'ig': _languagesHash.ibo,
'ia': _languagesHash.ina,
'id': _languagesHash.ind,
'it': _languagesHash.ita,
'ik': _languagesHash.ipk,
'io': _languagesHash.ido,
'iu': _languagesHash.iku,
'is': _languagesHash.isl,
'jv': _languagesHash.jav,
'ja': _languagesHash.jpn,
'kn': _languagesHash.kan,
'ki': _languagesHash.kik,
'kv': _languagesHash.kom,
'kw': _languagesHash.cor,
'lg': _languagesHash.lug,
'ln': _languagesHash.lin,
'lo': _languagesHash.lao,
'mi': _languagesHash.mri,
'na': _languagesHash.nau,
'nv': _languagesHash.nav,
'ny': _languagesHash.nya,
'om': _languagesHash.orm,
'os': _languagesHash.oss,
'pa': _languagesHash.pan,
'pi': _languagesHash.pli,
'ka': _languagesHash.kat,
'kk': _languagesHash.kaz,
'km': _languagesHash.khm,
'ky': _languagesHash.kir,
'ko-kp': _languagesHash['kor-kp'],
'ku': _languagesHash.kur,
'kg': _languagesHash.kon,
'kl': _languagesHash.kal,
'ks': _languagesHash.kas,
'la': _languagesHash.lat,
'lv': _languagesHash.lav,
'li': _languagesHash.lim,
'lt': _languagesHash.lit,
'lb': _languagesHash.ltz,
'ml': _languagesHash.mal,
'mr': _languagesHash.mar,
'mk': _languagesHash.mkd,
'mg': _languagesHash.mlg,
'mt': _languagesHash.mlt,
'mn': _languagesHash.mon,
'ms': _languagesHash.msa,
'my': _languagesHash.mya,
'ne': _languagesHash.nep,
'nl': _languagesHash.nld,
'nn': _languagesHash.nno,
'nb': _languagesHash.nob,
'no': _languagesHash.nor,
'oc': _languagesHash.oci,
'or': _languagesHash.ori,
'pl': _languagesHash.pol,
'pt': _languagesHash.por,
'pt-br': _languagesHash['por-pt'],
'ps': _languagesHash.pus,
'qu': _languagesHash.que,
'rm': _languagesHash.roh,
'ro': _languagesHash.ron,
'ru': _languagesHash.rus,
'rn': _languagesHash.run,
'rw': _languagesHash.kin,
'sc': _languagesHash.srd,
'sd': _languagesHash.snd,
'se': _languagesHash.sme,
'sg': _languagesHash.sag,
'sm': _languagesHash.smo,
'sn': _languagesHash.sna,
'so': _languagesHash.som,
'ss': _languagesHash.ssw,
'st': _languagesHash.sot,
'tg': _languagesHash.tgk,
'ti': _languagesHash.tir,
'tn': _languagesHash.tsn,
'to': _languagesHash.ton,
'ts': _languagesHash.tso,
'tt': _languagesHash.tat,
'tw': _languagesHash.twi,
'ty': _languagesHash.tah,
'ug': _languagesHash.uig,
've': _languagesHash.ven,
'wa': _languagesHash.wln,
'wo': _languagesHash.wol,
'xh': _languagesHash.xho,
'za': _languagesHash.zha,
'zu': _languagesHash.zul,
'sa': _languagesHash.san,
'si': _languagesHash.sin,
'sk': _languagesHash.slk,
'sl': _languagesHash.slv,
'es': _languagesHash.spa,
'sq': _languagesHash.sqi,
'sr': _languagesHash.srp,
'sr-ec': _languagesHash['srp-ec'],
'sr-el': _languagesHash['srp-el'],
'su': _languagesHash.sun,
'sw': _languagesHash.swa,
'sv': _languagesHash.swe,
'ta': _languagesHash.tam,
'te': _languagesHash.tel,
'tl': _languagesHash.tgl,
'th': _languagesHash.tha,
'tk': _languagesHash.tuk,
'tr': _languagesHash.tur,
'uk': _languagesHash.ukr,
'ur': _languagesHash.urd,
'uz': _languagesHash.uzb,
'vi': _languagesHash.vie,
'yo': _languagesHash.wol,
'yi': _languagesHash.yid,
'zh': _languagesHash.zho,
'zh-hans': _languagesHash['zho-hans'],
'zh-hant': _languagesHash['zho-hant'],
'zh-hk': _languagesHash['zho-hk'],
'diq': _languagesHash.zza
};
function getLanguageNameFromISO(code) {
var language = _languagesHash[code] || _languagesHashOld[code] || '';
if (!language && code) {
/* This js code might be used js runtime engine where
* the dump() method is not available */
try {
dump('"' + code + '" is not available in languages.js.\n');
} catch (error) {}
}
return language;
}
function getLanguageNameFromISOCodes(codes) {
var result = "";
var codeArray = codes.split(',');
for (var i in codeArray) {
result += getLanguageNameFromISO(codeArray[i]);
if (i < codeArray.length - 1) {
result += ', ';
}
}
return result;
}
/* Be careful, this function returns false, also if undefined - that
* means nothing because the table _languagesHashOld is not complete */
function isOldLanguageCode(code) {
return _languagesHashOld[iso] ? true : false;
}
function buildLanguagesRegexHash() {
var code;
for (code in _languagesHash) {
_languagesRegexHash[_languagesHash[code]] = code;
}
for (code in _languagesHashOld) {
var regex = _languagesRegexHash[_languagesHashOld[code]];
_languagesRegexHash[_languagesHashOld[code]] = '^(' + (regex ? regex + '|' : '') + code + ')$';
}
}
function getLanguageRegex(language) {
return _languagesRegexHash[language] || '';
}
| kiwix/kiwix_mirror | kiwix/chrome/content/main/js/languages.js | JavaScript | gpl-3.0 | 16,530 |
/* YUI 3.9.0pr1 (build 202) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
YUI.add('dataschema-json', function (Y, NAME) {
/**
Provides a DataSchema implementation which can be used to work with JSON data.
@module dataschema
@submodule dataschema-json
**/
/**
Provides a DataSchema implementation which can be used to work with JSON data.
See the `apply` method for usage.
@class DataSchema.JSON
@extends DataSchema.Base
@static
**/
var LANG = Y.Lang,
isFunction = LANG.isFunction,
isObject = LANG.isObject,
isArray = LANG.isArray,
// TODO: I don't think the calls to Base.* need to be done via Base since
// Base is mixed into SchemaJSON. Investigate for later.
Base = Y.DataSchema.Base,
SchemaJSON;
SchemaJSON = {
/////////////////////////////////////////////////////////////////////////////
//
// DataSchema.JSON static methods
//
/////////////////////////////////////////////////////////////////////////////
/**
* Utility function converts JSON locator strings into walkable paths
*
* @method getPath
* @param locator {String} JSON value locator.
* @return {String[]} Walkable path to data value.
* @static
*/
getPath: function(locator) {
var path = null,
keys = [],
i = 0;
if (locator) {
// Strip the ["string keys"] and [1] array indexes
// TODO: the first two steps can probably be reduced to one with
// /\[\s*(['"])?(.*?)\1\s*\]/g, but the array indices would be
// stored as strings. This is not likely an issue.
locator = locator.
replace(/\[\s*(['"])(.*?)\1\s*\]/g,
function (x,$1,$2) {keys[i]=$2;return '.@'+(i++);}).
replace(/\[(\d+)\]/g,
function (x,$1) {keys[i]=parseInt($1,10)|0;return '.@'+(i++);}).
replace(/^\./,''); // remove leading dot
// Validate against problematic characters.
// commented out because the path isn't sent to eval, so it
// should be safe. I'm not sure what makes a locator invalid.
//if (!/[^\w\.\$@]/.test(locator)) {
path = locator.split('.');
for (i=path.length-1; i >= 0; --i) {
if (path[i].charAt(0) === '@') {
path[i] = keys[parseInt(path[i].substr(1),10)];
}
}
/*}
else {
Y.log("Invalid locator: " + locator, "error", "dataschema-json");
}
*/
}
return path;
},
/**
* Utility function to walk a path and return the value located there.
*
* @method getLocationValue
* @param path {String[]} Locator path.
* @param data {String} Data to traverse.
* @return {Object} Data value at location.
* @static
*/
getLocationValue: function (path, data) {
var i = 0,
len = path.length;
for (;i<len;i++) {
if (isObject(data) && (path[i] in data)) {
data = data[path[i]];
} else {
data = undefined;
break;
}
}
return data;
},
/**
Applies a schema to an array of data located in a JSON structure, returning
a normalized object with results in the `results` property. Additional
information can be parsed out of the JSON for inclusion in the `meta`
property of the response object. If an error is encountered during
processing, an `error` property will be added.
The input _data_ is expected to be an object or array. If it is a string,
it will be passed through `Y.JSON.parse()`.
If _data_ contains an array of data records to normalize, specify the
_schema.resultListLocator_ as a dot separated path string just as you would
reference it in JavaScript. So if your _data_ object has a record array at
_data.response.results_, use _schema.resultListLocator_ =
"response.results". Bracket notation can also be used for array indices or
object properties (e.g. "response['results']"); This is called a "path
locator"
Field data in the result list is extracted with field identifiers in
_schema.resultFields_. Field identifiers are objects with the following
properties:
* `key` : <strong>(required)</strong> The path locator (String)
* `parser`: A function or the name of a function on `Y.Parsers` used
to convert the input value into a normalized type. Parser
functions are passed the value as input and are expected to
return a value.
If no value parsing is needed, you can use path locators (strings)
instead of field identifiers (objects) -- see example below.
If no processing of the result list array is needed, _schema.resultFields_
can be omitted; the `response.results` will point directly to the array.
If the result list contains arrays, `response.results` will contain an
array of objects with key:value pairs assuming the fields in
_schema.resultFields_ are ordered in accordance with the data array
values.
If the result list contains objects, the identified _schema.resultFields_
will be used to extract a value from those objects for the output result.
To extract additional information from the JSON, include an array of
path locators in _schema.metaFields_. The collected values will be
stored in `response.meta`.
@example
// Process array of arrays
var schema = {
resultListLocator: 'produce.fruit',
resultFields: [ 'name', 'color' ]
},
data = {
produce: {
fruit: [
[ 'Banana', 'yellow' ],
[ 'Orange', 'orange' ],
[ 'Eggplant', 'purple' ]
]
}
};
var response = Y.DataSchema.JSON.apply(schema, data);
// response.results[0] is { name: "Banana", color: "yellow" }
// Process array of objects + some metadata
schema.metaFields = [ 'lastInventory' ];
data = {
produce: {
fruit: [
{ name: 'Banana', color: 'yellow', price: '1.96' },
{ name: 'Orange', color: 'orange', price: '2.04' },
{ name: 'Eggplant', color: 'purple', price: '4.31' }
]
},
lastInventory: '2011-07-19'
};
response = Y.DataSchema.JSON.apply(schema, data);
// response.results[0] is { name: "Banana", color: "yellow" }
// response.meta.lastInventory is '2001-07-19'
// Use parsers
schema.resultFields = [
{
key: 'name',
parser: function (val) { return val.toUpperCase(); }
},
{
key: 'price',
parser: 'number' // Uses Y.Parsers.number
}
];
response = Y.DataSchema.JSON.apply(schema, data);
// Note price was converted from a numeric string to a number
// response.results[0] looks like { fruit: "BANANA", price: 1.96 }
@method apply
@param {Object} [schema] Schema to apply. Supported configuration
properties are:
@param {String} [schema.resultListLocator] Path locator for the
location of the array of records to flatten into `response.results`
@param {Array} [schema.resultFields] Field identifiers to
locate/assign values in the response records. See above for
details.
@param {Array} [schema.metaFields] Path locators to extract extra
non-record related information from the data object.
@param {Object|Array|String} data JSON data or its string serialization.
@return {Object} An Object with properties `results` and `meta`
@static
**/
apply: function(schema, data) {
var data_in = data,
data_out = { results: [], meta: {} };
// Convert incoming JSON strings
if (!isObject(data)) {
try {
data_in = Y.JSON.parse(data);
}
catch(e) {
data_out.error = e;
return data_out;
}
}
if (isObject(data_in) && schema) {
// Parse results data
data_out = SchemaJSON._parseResults.call(this, schema, data_in, data_out);
// Parse meta data
if (schema.metaFields !== undefined) {
data_out = SchemaJSON._parseMeta(schema.metaFields, data_in, data_out);
}
}
else {
Y.log("JSON data could not be schema-parsed: " + Y.dump(data) + " " + Y.dump(data), "error", "dataschema-json");
data_out.error = new Error("JSON schema parse failure");
}
return data_out;
},
/**
* Schema-parsed list of results from full data
*
* @method _parseResults
* @param schema {Object} Schema to parse against.
* @param json_in {Object} JSON to parse.
* @param data_out {Object} In-progress parsed data to update.
* @return {Object} Parsed data object.
* @static
* @protected
*/
_parseResults: function(schema, json_in, data_out) {
var getPath = SchemaJSON.getPath,
getValue = SchemaJSON.getLocationValue,
path = getPath(schema.resultListLocator),
results = path ?
(getValue(path, json_in) ||
// Fall back to treat resultListLocator as a simple key
json_in[schema.resultListLocator]) :
// Or if no resultListLocator is supplied, use the input
json_in;
if (isArray(results)) {
// if no result fields are passed in, then just take
// the results array whole-hog Sometimes you're getting
// an array of strings, or want the whole object, so
// resultFields don't make sense.
if (isArray(schema.resultFields)) {
data_out = SchemaJSON._getFieldValues.call(this, schema.resultFields, results, data_out);
} else {
data_out.results = results;
}
} else if (schema.resultListLocator) {
data_out.results = [];
data_out.error = new Error("JSON results retrieval failure");
Y.log("JSON data could not be parsed: " + Y.dump(json_in), "error", "dataschema-json");
}
return data_out;
},
/**
* Get field data values out of list of full results
*
* @method _getFieldValues
* @param fields {Array} Fields to find.
* @param array_in {Array} Results to parse.
* @param data_out {Object} In-progress parsed data to update.
* @return {Object} Parsed data object.
* @static
* @protected
*/
_getFieldValues: function(fields, array_in, data_out) {
var results = [],
len = fields.length,
i, j,
field, key, locator, path, parser, val,
simplePaths = [], complexPaths = [], fieldParsers = [],
result, record;
// First collect hashes of simple paths, complex paths, and parsers
for (i=0; i<len; i++) {
field = fields[i]; // A field can be a simple string or a hash
key = field.key || field; // Find the key
locator = field.locator || key; // Find the locator
// Validate and store locators for later
path = SchemaJSON.getPath(locator);
if (path) {
if (path.length === 1) {
simplePaths.push({
key : key,
path: path[0]
});
} else {
complexPaths.push({
key : key,
path : path,
locator: locator
});
}
} else {
Y.log("Invalid key syntax: " + key, "warn", "dataschema-json");
}
// Validate and store parsers for later
//TODO: use Y.DataSchema.parse?
parser = (isFunction(field.parser)) ?
field.parser :
Y.Parsers[field.parser + ''];
if (parser) {
fieldParsers.push({
key : key,
parser: parser
});
}
}
// Traverse list of array_in, creating records of simple fields,
// complex fields, and applying parsers as necessary
for (i=array_in.length-1; i>=0; --i) {
record = {};
result = array_in[i];
if(result) {
// Cycle through complexLocators
for (j=complexPaths.length - 1; j>=0; --j) {
path = complexPaths[j];
val = SchemaJSON.getLocationValue(path.path, result);
if (val === undefined) {
val = SchemaJSON.getLocationValue([path.locator], result);
// Fail over keys like "foo.bar" from nested parsing
// to single token parsing if a value is found in
// results["foo.bar"]
if (val !== undefined) {
simplePaths.push({
key: path.key,
path: path.locator
});
// Don't try to process the path as complex
// for further results
complexPaths.splice(i,1);
continue;
}
}
record[path.key] = Base.parse.call(this,
(SchemaJSON.getLocationValue(path.path, result)), path);
}
// Cycle through simpleLocators
for (j = simplePaths.length - 1; j >= 0; --j) {
path = simplePaths[j];
// Bug 1777850: The result might be an array instead of object
record[path.key] = Base.parse.call(this,
((result[path.path] === undefined) ?
result[j] : result[path.path]), path);
}
// Cycle through fieldParsers
for (j=fieldParsers.length-1; j>=0; --j) {
key = fieldParsers[j].key;
record[key] = fieldParsers[j].parser.call(this, record[key]);
// Safety net
if (record[key] === undefined) {
record[key] = null;
}
}
results[i] = record;
}
}
data_out.results = results;
return data_out;
},
/**
* Parses results data according to schema
*
* @method _parseMeta
* @param metaFields {Object} Metafields definitions.
* @param json_in {Object} JSON to parse.
* @param data_out {Object} In-progress parsed data to update.
* @return {Object} Schema-parsed meta data.
* @static
* @protected
*/
_parseMeta: function(metaFields, json_in, data_out) {
if (isObject(metaFields)) {
var key, path;
for(key in metaFields) {
if (metaFields.hasOwnProperty(key)) {
path = SchemaJSON.getPath(metaFields[key]);
if (path && json_in) {
data_out.meta[key] = SchemaJSON.getLocationValue(path, json_in);
}
}
}
}
else {
data_out.error = new Error("JSON meta data retrieval failure");
}
return data_out;
}
};
// TODO: Y.Object + mix() might be better here
Y.DataSchema.JSON = Y.mix(SchemaJSON, Base);
}, '3.9.0pr1', {"requires": ["dataschema-base", "json"]});
| rochestb/Adventurly | node_modules/grunt-contrib-yuidoc/node_modules/yuidocjs/node_modules/yui/dataschema-json/dataschema-json-debug.js | JavaScript | gpl-3.0 | 16,312 |
import React, { Component, PropTypes } from 'react';
import {
View,
Image,
Text,
StyleSheet
} from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
const glassPrimary = '#d5d2da';
const glassSecondary = '#bb2130';
class ProfilePicture extends Component {
render() {
const profileImage = this.props.image;
return (
<View style={Styles.container}>
<Image
source={profileImage}
resizeMode='contain'
style={Styles.profilePic}>
</Image>
<LinearGradient
colors={[glassPrimary, glassSecondary, glassPrimary]}
start={{x: 0.0, y: 0.1}} end={{x: 0.5, y: 1.0}}
style={Styles.frame}>
</LinearGradient>
</View>
)
}
}
const Styles = StyleSheet.create({
container: {
height: 120,
width: 70,
shadowColor: '#000',
shadowOffset: { width: 2, height: 2 },
shadowOpacity: 0.7,
shadowRadius: 2,
elevation: 3,
backgroundColor: 'transparent'
},
profilePic: {
height: 120,
width: 70,
shadowRadius: 2,
shadowOpacity: 0.7,
shadowColor: '#000000',
borderColor: '#320f1c',
borderWidth: 1,
},
frame: {
position: 'absolute',
top: 0,
height: 120,
width: 70,
opacity: 0.25,
}
});
export default ProfilePicture;
| TekkenChicken/t7-chicken-native | src/components/CharacterProfile/ProfilePicture.js | JavaScript | gpl-3.0 | 1,316 |
function helloWorld() {
return 'Hello World';
}
| hacktoberfest17/programming | hello_world/js/Hello-world.js | JavaScript | gpl-3.0 | 50 |
(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h=
h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"||
h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La,
"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this,
e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a,
"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+
a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,
C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j,
s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this,
j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length},
toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j===
-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false;
if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--;
if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload",
b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&&
!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&&
l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z],
z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j,
s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v=
s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)||
[];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u,
false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"),
k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false,
scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent=
false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom=
1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display=
"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h=
c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando);
else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this,
a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e=
c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,
a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",
colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===
1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "),
l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,
"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";
if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r=
a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},
attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&
b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0};
c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,
arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid=
d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+
c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b=
w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===
8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k===
"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+
d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this,
Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=
c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U};
var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!==
"form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V,
xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired=
B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type===
"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]===
0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d,
a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d=
1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d===
"object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}});
c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});
(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i,
[y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3];
break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr,
q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h=
l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*"));
return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!==
B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()===
i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=
i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g,
"")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n,
m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===
true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===
g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]-
0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n===
"first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===
i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]];
if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m,
g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1;
for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"),
i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g);
n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&&
function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F||
p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g=
t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition?
function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML;
c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})},
not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h=
h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context):
c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,
2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,
b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&
e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1,
"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null;
else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=
c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a,
b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")):
this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",
prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument||
b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length-
1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script"))));
d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i,
jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,
zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b),
h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b);
if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f=
d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left;
e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b===
"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&
!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})},
getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",
script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data||
!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache=
false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset;
A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type",
b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&&
c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d||
c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]=
encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess",
[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),
e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}});
if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show",
3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay",
d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b,
d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)===
"inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L||
1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b,
d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a*
Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)}
var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;
this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide||
this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=
c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===
b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&&
h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle;
for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+=
parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",
height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells=
f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a,
"marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a,
e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&&
c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();
c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+
b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window);
/*!
* jQuery UI 1.8.4
*
* Copyright 2010, 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
*/
(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.4",plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,
b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,
CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable",
"off").css("MozUserSelect","")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none")},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,
"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"));if(!isNaN(b)&&b!=0)return b}a=a.parent()}}return 0}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=
parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c.style(this,h,d(this,f)+"px")})};c.fn["outer"+
b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c.style(this,h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==
b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}})}})(jQuery);
;/*!
* jQuery UI Widget 1.8.4
*
* Copyright 2010, 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/Widget
*/
(function(b,j){var k=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return k.call(b(this),a,c)})};b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);
b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.substring(0,1)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):
this.each(function(){var g=b.data(this,a);if(g){d&&g.option(d);g._init()}else b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(c)[this.widgetName],a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});
this._create();this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a,e=this;if(arguments.length===0)return b.extend({},e.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}b.each(d,function(f,
h){e._setOption(f,h)});return e},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=
b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
;/*!
* jQuery UI Mouse 1.8.4
*
* Copyright 2010, 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/Mouse
*
* Depends:
* jquery.ui.widget.js
*/
(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(a._preventClickEvent){a._preventClickEvent=false;b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&&
this._mouseUp(a);this._mouseDownEvent=a;var b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();
return true}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);c.browser.safari||a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&
this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=a.target==this._mouseDownEvent.target;this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-
a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
;/*
* jQuery UI Position 1.8.4
*
* Copyright 2010, 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/Position
*/
(function(c){c.ui=c.ui||{};var m=/left|center|right/,n=/top|center|bottom/,p=c.fn.position,q=c.fn.offset;c.fn.position=function(a){if(!a||!a.of)return p.apply(this,arguments);a=c.extend({},a);var b=c(a.of),d=(a.collision||"flip").split(" "),e=a.offset?a.offset.split(" "):[0,0],g,h,i;if(a.of.nodeType===9){g=b.width();h=b.height();i={top:0,left:0}}else if(a.of.scrollTo&&a.of.document){g=b.width();h=b.height();i={top:b.scrollTop(),left:b.scrollLeft()}}else if(a.of.preventDefault){a.at="left top";g=h=
0;i={top:a.of.pageY,left:a.of.pageX}}else{g=b.outerWidth();h=b.outerHeight();i=b.offset()}c.each(["my","at"],function(){var f=(a[this]||"").split(" ");if(f.length===1)f=m.test(f[0])?f.concat(["center"]):n.test(f[0])?["center"].concat(f):["center","center"];f[0]=m.test(f[0])?f[0]:"center";f[1]=n.test(f[1])?f[1]:"center";a[this]=f});if(d.length===1)d[1]=d[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(a.at[0]==="right")i.left+=g;else if(a.at[0]==="center")i.left+=
g/2;if(a.at[1]==="bottom")i.top+=h;else if(a.at[1]==="center")i.top+=h/2;i.left+=e[0];i.top+=e[1];return this.each(function(){var f=c(this),k=f.outerWidth(),l=f.outerHeight(),j=c.extend({},i);if(a.my[0]==="right")j.left-=k;else if(a.my[0]==="center")j.left-=k/2;if(a.my[1]==="bottom")j.top-=l;else if(a.my[1]==="center")j.top-=l/2;j.left=parseInt(j.left);j.top=parseInt(j.top);c.each(["left","top"],function(o,r){c.ui.position[d[o]]&&c.ui.position[d[o]][r](j,{targetWidth:g,targetHeight:h,elemWidth:k,
elemHeight:l,offset:e,my:a.my,at:a.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(j,{using:a.using}))})};c.ui.position={fit:{left:function(a,b){var d=c(window);b=a.left+b.elemWidth-d.width()-d.scrollLeft();a.left=b>0?a.left-b:Math.max(0,a.left)},top:function(a,b){var d=c(window);b=a.top+b.elemHeight-d.height()-d.scrollTop();a.top=b>0?a.top-b:Math.max(0,a.top)}},flip:{left:function(a,b){if(b.at[0]!=="center"){var d=c(window);d=a.left+b.elemWidth-d.width()-d.scrollLeft();var e=b.my[0]==="left"?
-b.elemWidth:b.my[0]==="right"?b.elemWidth:0,g=-2*b.offset[0];a.left+=a.left<0?e+b.targetWidth+g:d>0?e-b.targetWidth+g:0}},top:function(a,b){if(b.at[1]!=="center"){var d=c(window);d=a.top+b.elemHeight-d.height()-d.scrollTop();var e=b.my[1]==="top"?-b.elemHeight:b.my[1]==="bottom"?b.elemHeight:0,g=b.at[1]==="top"?b.targetHeight:-b.targetHeight,h=-2*b.offset[1];a.top+=a.top<0?e+b.targetHeight+h:d>0?e+g+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(a,b){if(/static/.test(c.curCSS(a,"position")))a.style.position=
"relative";var d=c(a),e=d.offset(),g=parseInt(c.curCSS(a,"top",true),10)||0,h=parseInt(c.curCSS(a,"left",true),10)||0;e={top:b.top-e.top+g,left:b.left-e.left+h};"using"in b?b.using.call(a,e):d.css(e)};c.fn.offset=function(a){var b=this[0];if(!b||!b.ownerDocument)return null;if(a)return this.each(function(){c.offset.setOffset(this,a)});return q.call(this)}}})(jQuery);
;
(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-
this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();
d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||
this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode)return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,
b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==
a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||
0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],
this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-
(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment==
"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&
a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),
10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],
this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():
f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])e=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+
this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;e=this.originalPageX+
Math.round((e-this.originalPageX)/b.grid[0])*b.grid[0];e=this.containment?!(e-this.offset.click.left<this.containment[0]||e-this.offset.click.left>this.containment[2])?e:!(e-this.offset.click.left<this.containment[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-
this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=
this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.4"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var g=d.data(this,"sortable");
if(g&&!g.options.disabled){c.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;
c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=
1;this.instance.currentItem=d(f).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;
this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=
this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","iframeFix",{start:function(){var a=
d(this).data("draggable").options;d(a.iframeFix===true?"iframe":a.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;
if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!=
"HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-
b.overflowOffset.left<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()-
c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable","snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this,
width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),f=c.options,e=f.snapTolerance,g=b.offset.left,n=g+c.helperProportions.width,m=b.offset.top,o=m+c.helperProportions.height,h=c.snapElements.length-1;h>=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e<g&&g<k+e&&j-e<m&&m<l+e||i-e<g&&g<k+e&&j-e<o&&o<l+e||i-e<n&&n<k+e&&j-e<m&&m<l+e||i-e<n&&n<k+e&&j-e<o&&
o<l+e){if(f.snapMode!="inner"){var p=Math.abs(j-o)<=e,q=Math.abs(l-m)<=e,r=Math.abs(i-n)<=e,s=Math.abs(k-g)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:j-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k}).left-c.margins.left}var t=
p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(j-m)<=e;q=Math.abs(l-o)<=e;r=Math.abs(i-g)<=e;s=Math.abs(k-n)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:j,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l-c.helperProportions.height,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[h].snapping&&
(p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=p||q||r||s||t}else{c.snapElements[h].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),
10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);
;
(function(d){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,b=a.accept;this.isover=0;this.isout=1;this.accept=d.isFunction(b)?b:function(c){return c.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};d.ui.ddmanager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[];d.ui.ddmanager.droppables[a.scope].push(this);
a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var a=d.ui.ddmanager.droppables[this.options.scope],b=0;b<a.length;b++)a[b]==this&&a.splice(b,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(a,b){if(a=="accept")this.accept=d.isFunction(b)?b:function(c){return c.is(b)};d.Widget.prototype._setOption.apply(this,arguments)},_activate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&
this.element.addClass(this.options.activeClass);b&&this._trigger("activate",a,this.ui(b))},_deactivate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);b&&this._trigger("deactivate",a,this.ui(b))},_over:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);
this._trigger("over",a,this.ui(b))}},_out:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",a,this.ui(b))}},_drop:function(a,b){var c=b||d.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return false;var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g=
d.data(this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==c.options.scope&&g.accept.call(g.element[0],c.currentItem||c.element)&&d.ui.intersect(c,d.extend(g,{offset:g.element.offset()}),g.options.tolerance)){e=true;return false}});if(e)return false;if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",
a,this.ui(c));return this.element}return false},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}});d.extend(d.ui.droppable,{version:"1.8.4"});d.ui.intersect=function(a,b,c){if(!b.offset)return false;var e=(a.positionAbs||a.position.absolute).left,g=e+a.helperProportions.width,f=(a.positionAbs||a.position.absolute).top,h=f+a.helperProportions.height,i=b.offset.left,k=i+b.proportions.width,j=b.offset.top,l=j+b.proportions.height;
switch(c){case "fit":return i<=e&&g<=k&&j<=f&&h<=l;case "intersect":return i<e+a.helperProportions.width/2&&g-a.helperProportions.width/2<k&&j<f+a.helperProportions.height/2&&h-a.helperProportions.height/2<l;case "pointer":return d.ui.isOver((a.positionAbs||a.position.absolute).top+(a.clickOffset||a.offset.click).top,(a.positionAbs||a.position.absolute).left+(a.clickOffset||a.offset.click).left,j,i,b.proportions.height,b.proportions.width);case "touch":return(f>=j&&f<=l||h>=j&&h<=l||f<j&&h>l)&&(e>=
i&&e<=k||g>=i&&g<=k||e<i&&g>k);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f<c.length;f++)if(!(c[f].options.disabled||a&&!c[f].accept.call(c[f].element[0],a.currentItem||a.element))){for(var h=0;h<g.length;h++)if(g[h]==c[f].element[0]){c[f].proportions.height=0;continue a}c[f].visible=c[f].element.css("display")!=
"none";if(c[f].visible){c[f].offset=c[f].element.offset();c[f].proportions={width:c[f].element[0].offsetWidth,height:c[f].element[0].offsetHeight};e=="mousedown"&&c[f]._activate.call(c[f],b)}}},drop:function(a,b){var c=false;d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&d.ui.intersect(a,this,this.options.tolerance))c=c||this._drop.call(this,b);if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],a.currentItem||
a.element)){this.isout=1;this.isover=0;this._deactivate.call(this,b)}}});return c},drag:function(a,b){a.options.refreshPositions&&d.ui.ddmanager.prepareOffsets(a,b);d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var c=d.ui.intersect(a,this,this.options.tolerance);if(c=!c&&this.isover==1?"isout":c&&this.isover==0?"isover":null){var e;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.length){e=
d.data(g[0],"droppable");e.greedyChild=c=="isover"?1:0}}if(e&&c=="isover"){e.isover=0;e.isout=1;e._out.call(e,b)}this[c]=1;this[c=="isout"?"isover":"isout"]=0;this[c=="isover"?"_over":"_out"].call(this,b);if(e&&c=="isout"){e.isout=0;e.isover=1;e._over.call(e,b)}}}})}}})(jQuery);
;
(function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,
_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),
top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=
this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",
nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d<c.length;d++){var f=e.trim(c[d]),g=e('<div class="ui-resizable-handle '+("ui-resizable-"+f)+'"></div>');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor==
String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),k=0;k=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,k);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection();
this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){e(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};
if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),
d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=
this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:
this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",
b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;
f={width:c.size.width-(f?0:c.sizeDiff.width),height:c.size.height-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",
b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(l(b.left))this.position.left=b.left;if(l(b.top))this.position.top=b.top;if(l(b.height))this.size.height=b.height;if(l(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top=
a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,d=l(b.width)&&a.maxWidth&&a.maxWidth<b.width,f=l(b.height)&&a.maxHeight&&a.maxHeight<b.height,g=l(b.width)&&a.minWidth&&a.minWidth>b.width,h=l(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height,
k=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&k)b.left=i-a.minWidth;if(d&&k)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a<this._proportionallyResizeElements.length;a++){var c=this._proportionallyResizeElements[a];if(!this.borderDif){var d=[c.css("borderTopWidth"),
c.css("borderRightWidth"),c.css("borderBottomWidth"),c.css("borderLeftWidth")],f=[c.css("paddingTop"),c.css("paddingRight"),c.css("paddingBottom"),c.css("paddingLeft")];this.borderDif=e.map(d,function(g,h){g=parseInt(g,10)||0;h=parseInt(f[h],10)||0;return g+h})}e.browser.msie&&(e(b).is(":hidden")||e(b).parents(":hidden").length)||c.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.options;this.elementOffset=
this.element.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+
a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,
arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,
{version:"1.8.4"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,
function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var k=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:k.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n=
(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(k.css("position"))){c._revertToRelativePosition=true;k.css({position:"absolute",top:"auto",left:"auto"})}k.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition=
false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left-
a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",
b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top",
"Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset,
f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left=
a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+
a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&&
e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",
height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=
d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},l=function(b){return!isNaN(parseInt(b,10))}})(jQuery);
;
(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),
selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX,
c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting",
c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d=
this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.right<b||a.top>i||a.bottom<g);else if(d.tolerance=="fit")k=a.left>b&&a.right<h&&a.top>g&&a.bottom<i;if(k){if(a.selected){a.$element.removeClass("ui-selected");a.selected=false}if(a.unselecting){a.$element.removeClass("ui-unselecting");
a.unselecting=false}if(!a.selecting){a.$element.addClass("ui-selecting");a.selecting=true;f._trigger("selecting",c,{selecting:a.element})}}else{if(a.selecting)if(c.metaKey&&a.startselected){a.$element.removeClass("ui-selecting");a.selecting=false;a.$element.addClass("ui-selected");a.selected=true}else{a.$element.removeClass("ui-selecting");a.selecting=false;if(a.startselected){a.$element.addClass("ui-unselecting");a.unselecting=true}f._trigger("unselecting",c,{unselecting:a.element})}if(a.selected)if(!c.metaKey&&
!a.startselected){a.$element.removeClass("ui-selected");a.selected=false;a.$element.addClass("ui-unselecting");a.unselecting=true;f._trigger("unselecting",c,{unselecting:a.element})}}}});return false}},_mouseStop:function(c){var f=this;this.dragged=false;e(".ui-unselecting",this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("ui-unselecting");d.unselecting=false;d.startselected=false;f._trigger("unselected",c,{unselected:d.element})});e(".ui-selecting",this.element[0]).each(function(){var d=
e.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected");d.selecting=false;d.selected=true;d.startselected=true;f._trigger("selected",c,{selected:d.element})});this._trigger("stop",c);this.helper.remove();return false}});e.extend(e.ui.selectable,{version:"1.8.4"})})(jQuery);
;
(function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable");
this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,
arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=
c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,
{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();
if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",
a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");
if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-b.scrollSpeed;if(this.overflowOffset.left+
this.scrollParent[0].offsetWidth-a.pageX<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-b.scrollSpeed}else{if(a.pageY-d(document).scrollTop()<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()-b.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()+
b.scrollSpeed);if(a.pageX-d(document).scrollLeft()<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()-b.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()+b.scrollSpeed)}c!==false&&d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+
"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(b=this.items.length-1;b>=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,
c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==
document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp();this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",
null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):
d(this.domPosition.parent).prepend(this.currentItem);return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||
"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+j<k&&b+l>g&&b+l<h;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?j:g<b+
this.helperProportions.width/2&&c-this.helperProportions.width/2<h&&i<e+this.helperProportions.height/2&&f-this.helperProportions.height/2<k},_intersectsWithPointer:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width);b=b&&a;a=this._getDragVerticalDirection();var c=this._getDragHorizontalDirection();if(!b)return false;return this.floating?c&&c=="right"||a=="down"?2:1:a&&(a=="down"?
2:1)},_intersectsWithSides:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width);var c=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?e=="right"&&a||e=="left"&&!a:c&&(c=="down"&&b||c=="up"&&!b)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},
_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=
this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=
this.currentItem.find(":data(sortable-item)"),b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(a){this.items=[];this.containers=[this];var b=this.items,c=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):d(this.options.items,this.element),this]],e=this._connectWith();if(e)for(var f=e.length-1;f>=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");
if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h<g;h++){i=d(e[h]);i.data("sortable-item",a);b.push({item:i,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){if(this.offsetParent&&this.helper)this.offset.parent=this._getParentOffset();for(var b=this.items.length-1;b>=
0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=
this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},
update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=
null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));
this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)<b){b=Math.abs(h-f);e=this.items[g]}}if(e||this.options.dropOnEmpty){this.currentContainer=this.containers[c];e?this._rearrange(a,e,null,true):this._rearrange(a,
null,this.containers[c].element,true);this._trigger("change",a,this._uiHash());this.containers[c]._trigger("change",a,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}}},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a,this.currentItem])):b.helper=="clone"?this.currentItem.clone():this.currentItem;a.parents("body").length||
d(b.appendTo!="parent"?b.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]);if(a[0]==this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(a[0].style.width==""||b.forceHelperSize)a.width(this.currentItem.width());if(a[0].style.height==""||b.forceHelperSize)a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){if(typeof a==
"string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition==
"absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition==
"relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},
_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-
this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)){var b=d(a.containment)[0];a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),
10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?
this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=
this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();var f=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])f=this.containment[0]+
this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?
g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;f=this.originalPageX+Math.round((f-this.originalPageX)/b.grid[0])*b.grid[0];f=this.containment?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-b.grid[0]:f+b.grid[0]:f}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():
e?0:c.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())}},_rearrange:function(a,b,c,e){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var f=this,g=this.counter;window.setTimeout(function(){g==
f.counter&&f.refreshPositions(!e)},0)},_clear:function(a,b){this.reverting=false;var c=[];!this._noFinalSort&&this.currentItem[0].parentNode&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!b&&c.push(function(f){this._trigger("receive",
f,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!b)c.push(function(f){this._trigger("update",f,this._uiHash())});if(!d.ui.contains(this.element[0],this.currentItem[0])){b||c.push(function(f){this._trigger("remove",f,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",
g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=
0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}return false}b||this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!b){for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},_uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),position:b.position,originalPosition:b.originalPosition,offset:b.positionAbs,item:b.currentItem,sender:a?a.element:null}}});
d.extend(d.ui.sortable,{version:"1.8.4"})})(jQuery);
;
(function(c){c.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");
a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var f=d.closest(".ui-accordion-header");a.active=f.length?f:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion",function(g){return a._keydown(g)}).next().attr("role",
"tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(g){a._clickHandler.call(a,g,this);g.preventDefault()})},_createIcons:function(){var a=this.options;if(a.icons){c("<span></span>").addClass("ui-icon "+a.icons.header).prependTo(this.headers);
this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex");
this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons();
b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,f=this.headers.index(a.target),g=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:g=this.headers[(f+1)%d];break;case b.LEFT:case b.UP:g=this.headers[(f-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target);
a.preventDefault()}if(g){c(a.target).attr("tabIndex",-1);c(g).attr("tabIndex",0);g.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+
c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options;
if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);
a.next().addClass("ui-accordion-content-active")}h=a.next();f=this.active.next();g={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):h,oldContent:f};d=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(h,f,g,b,d)}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);
this.active.next().addClass("ui-accordion-content-active");var f=this.active.next(),g={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:f},h=this.active=c([]);this._toggle(h,f,g)}},_toggle:function(a,b,d,f,g){var h=this,e=h.options;h.toShow=a;h.toHide=b;h.data=d;var j=function(){if(h)return h._completed.apply(h,arguments)};h._trigger("changestart",null,h.data);h.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&f?{toShow:c([]),toHide:b,complete:j,
down:g,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:g,autoHeight:e.autoHeight||e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;f=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!f[k]&&!c.easing[k])k="slide";f[k]||(f[k]=function(l){this.slide(l,{easing:k,duration:i||700})});
f[k](d)}else{if(e.collapsible&&f)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.4",animations:{slide:function(a,
b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),f=0,g={},h={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){h[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/);g[i]={value:j[1],
unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(h,{step:function(j,i){if(i.prop=="height")f=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=f*g[i.prop].value+g[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide",paddingTop:"hide",
paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery);
;
(function(e){e.widget("ui.autocomplete",{options:{appendTo:"body",delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},_create:function(){var a=this,b=this.element[0].ownerDocument;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!a.options.disabled){var d=e.ui.keyCode;switch(c.keyCode){case d.PAGE_UP:a._move("previousPage",
c);break;case d.PAGE_DOWN:a._move("nextPage",c);break;case d.UP:a._move("previous",c);c.preventDefault();break;case d.DOWN:a._move("next",c);c.preventDefault();break;case d.ENTER:case d.NUMPAD_ENTER:a.menu.element.is(":visible")&&c.preventDefault();case d.TAB:if(!a.menu.active)return;a.menu.select(c);break;case d.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);
break}}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)};this.menu=e("<ul></ul>").addClass("ui-autocomplete").appendTo(e(this.options.appendTo||"body",b)[0]).mousedown(function(c){var d=a.menu.element[0];
c.target===d&&setTimeout(function(){e(document).one("mousedown",function(f){f.target!==a.element[0]&&f.target!==d&&!e.ui.contains(d,f.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,d){d=d.item.data("item.autocomplete");false!==a._trigger("focus",null,{item:d})&&/^key/.test(c.originalEvent.type)&&a.element.val(d.value)},selected:function(c,d){d=d.item.data("item.autocomplete");var f=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();
a.previous=f}false!==a._trigger("select",c,{item:d})&&a.element.val(d.value);a.close(c);a.selectedItem=d},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");e.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();
e.Widget.prototype.destroy.call(this)},_setOption:function(a,b){e.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(e(b||"body",this.element[0].ownerDocument)[0])},_initSource:function(){var a,b;if(e.isArray(this.options.source)){a=this.options.source;this.source=function(c,d){d(e.ui.autocomplete.filter(a,c.term))}}else if(typeof this.options.source==="string"){b=this.options.source;this.source=function(c,d){e.getJSON(b,
c,d)}}else this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search")!==false)return this._search(a)},_search:function(a){this.term=this.element.addClass("ui-autocomplete-loading").val();this.source({term:a},this.response)},_response:function(a){if(a.length){a=this._normalize(a);this._suggest(a);this._trigger("open")}else this.close();this.element.removeClass("ui-autocomplete-loading")},
close:function(a){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this._trigger("close",a);this.menu.element.hide();this.menu.deactivate()}},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(a){if(a.length&&a[0].label&&a[0].value)return a;return e.map(a,function(b){if(typeof b==="string")return{label:b,value:b};return e.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(a){var b=
this.menu.element.empty().zIndex(this.element.zIndex()+1),c;this._renderMenu(b,a);this.menu.deactivate();this.menu.refresh();this.menu.element.show().position(e.extend({of:this.element},this.options.position));a=b.width("").outerWidth();c=this.element.outerWidth();b.outerWidth(Math.max(a,c))},_renderMenu:function(a,b){var c=this;e.each(b,function(d,f){c._renderItem(a,f)})},_renderItem:function(a,b){return e("<li></li>").data("item.autocomplete",b).append(e("<a></a>").text(b.label)).appendTo(a)},_move:function(a,
b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}});e.extend(e.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(a,b){var c=new RegExp(e.ui.autocomplete.escapeRegex(b),"i");return e.grep(a,function(d){return c.test(d.label||d.value||
d)})}})})(jQuery);
(function(e){e.widget("ui.menu",{_create:function(){var a=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(b){if(e(b.target).closest(".ui-menu-item a").length){b.preventDefault();a.select(b)}});this.refresh()},refresh:function(){var a=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(b){a.activate(b,
e(this).parent())}).mouseleave(function(){a.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.attr("scrollTop"),f=this.element.height();if(c<0)this.element.attr("scrollTop",d+c);else c>f&&this.element.attr("scrollTop",d+c-f+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",a,{item:b})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");
this._trigger("blur");this.active=null}},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(this.active){a=this.active[a+"All"](".ui-menu-item").eq(0);a.length?this.activate(c,a):this.activate(c,this.element.children(b))}else this.activate(c,
this.element.children(b))},nextPage:function(a){if(this.hasScroll())if(!this.active||this.last())this.activate(a,this.element.children(":first"));else{var b=this.active.offset().top,c=this.element.height(),d=this.element.children("li").filter(function(){var f=e(this).offset().top-b-c+e(this).height();return f<10&&f>-10});d.length||(d=this.element.children(":last"));this.activate(a,d)}else this.activate(a,this.element.children(!this.active||this.last()?":first":":last"))},previousPage:function(a){if(this.hasScroll())if(!this.active||
this.first())this.activate(a,this.element.children(":last"));else{var b=this.active.offset().top,c=this.element.height();result=this.element.children("li").filter(function(){var d=e(this).offset().top-b+c-e(this).height();return d<10&&d>-10});result.length||(result=this.element.children(":first"));this.activate(a,result)}else this.activate(a,this.element.children(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element.attr("scrollHeight")},select:function(a){this._trigger("selected",
a,{item:this.active})}})})(jQuery);
;
(function(a){var g,i=function(b){a(":ui-button",b.target.form).each(function(){var c=a(this).data("button");setTimeout(function(){c.refresh()},1)})},h=function(b){var c=b.name,d=b.form,e=a([]);if(c)e=d?a(d).find("[name='"+c+"']"):a("[name='"+c+"']",b.ownerDocument).filter(function(){return!this.form});return e};a.widget("ui.button",{options:{text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",i);this._determineButtonType();
this.hasTitle=!!this.buttonElement.attr("title");var b=this,c=this.options,d=this.type==="checkbox"||this.type==="radio",e="ui-state-hover"+(!d?" ui-state-active":"");if(c.label===null)c.label=this.buttonElement.html();if(this.element.is(":disabled"))c.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!c.disabled){a(this).addClass("ui-state-hover");this===g&&a(this).addClass("ui-state-active")}}).bind("mouseleave.button",
function(){c.disabled||a(this).removeClass(e)}).bind("focus.button",function(){a(this).addClass("ui-state-focus")}).bind("blur.button",function(){a(this).removeClass("ui-state-focus")});d&&this.element.bind("change.button",function(){b.refresh()});if(this.type==="checkbox")this.buttonElement.bind("click.button",function(){if(c.disabled)return false;a(this).toggleClass("ui-state-active");b.buttonElement.attr("aria-pressed",b.element[0].checked)});else if(this.type==="radio")this.buttonElement.bind("click.button",
function(){if(c.disabled)return false;a(this).addClass("ui-state-active");b.buttonElement.attr("aria-pressed",true);var f=b.element[0];h(f).not(f).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed",false)});else{this.buttonElement.bind("mousedown.button",function(){if(c.disabled)return false;a(this).addClass("ui-state-active");g=this;a(document).one("mouseup",function(){g=null})}).bind("mouseup.button",function(){if(c.disabled)return false;a(this).removeClass("ui-state-active")}).bind("keydown.button",
function(f){if(c.disabled)return false;if(f.keyCode==a.ui.keyCode.SPACE||f.keyCode==a.ui.keyCode.ENTER)a(this).addClass("ui-state-active")}).bind("keyup.button",function(){a(this).removeClass("ui-state-active")});this.buttonElement.is("a")&&this.buttonElement.keyup(function(f){f.keyCode===a.ui.keyCode.SPACE&&a(this).click()})}this._setOption("disabled",c.disabled)},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?
"input":"button";if(this.type==="checkbox"||this.type==="radio"){this.buttonElement=this.element.parents().last().find("label[for="+this.element.attr("id")+"]");this.element.addClass("ui-helper-hidden-accessible");var b=this.element.is(":checked");b&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",b)}else this.buttonElement=this.element},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());
this.hasTitle||this.buttonElement.removeAttr("title");a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);if(b==="disabled")c?this.element.attr("disabled",true):this.element.removeAttr("disabled");this._resetButton()},refresh:function(){var b=this.element.is(":disabled");b!==this.options.disabled&&this._setOption("disabled",b);if(this.type==="radio")h(this.element[0]).each(function(){a(this).is(":checked")?a(this).button("widget").addClass("ui-state-active").attr("aria-pressed",
true):a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed",false)});else if(this.type==="checkbox")this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed",true):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed",false)},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var b=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only"),
c=a("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary;if(d.primary||d.secondary){b.addClass("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary"));d.primary&&b.prepend("<span class='ui-button-icon-primary ui-icon "+d.primary+"'></span>");d.secondary&&b.append("<span class='ui-button-icon-secondary ui-icon "+d.secondary+"'></span>");if(!this.options.text){b.addClass(e?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary");
this.hasTitle||b.attr("title",c)}}else b.addClass("ui-button-text-only")}}});a.widget("ui.buttonset",{_create:function(){this.element.addClass("ui-buttonset");this._init()},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(":button, :submit, :reset, :checkbox, :radio, a, :data(button)").filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end()},
destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");a.Widget.prototype.destroy.call(this)}})})(jQuery);
;
(function(c,j){c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",of:window,collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");
if(typeof this.originalTitle!=="string")this.originalTitle="";var a=this,b=a.options,d=b.title||a.originalTitle||" ",f=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(i){a.moveToTop(false,
i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var e=(a.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),h=c('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);
return false}).appendTo(e);(a.uiDialogTitlebarCloseText=c("<span></span>")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("<span></span>").addClass("ui-dialog-title").attr("id",f).html(d).prependTo(e);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;e.find("*").add(e).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&
g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");
b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!==b.uiDialog[0])d=Math.max(d,c(this).css("z-index"))});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,f=d.options;if(f.modal&&!a||!f.stack&&!f.modal)return d._trigger("focus",b);if(f.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=
f.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=1;d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;d.next().length&&d.appendTo("body");a._size();a._position(b.position);d.show(b.show);
a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(f){if(f.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),e=g.filter(":first");g=g.filter(":last");if(f.target===g[0]&&!f.shiftKey){e.focus(1);return false}else if(f.target===e[0]&&f.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._trigger("open");a._isOpen=true;return a}},_createButtons:function(a){var b=this,d=false,
f=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("<div></div>").addClass("ui-dialog-buttonset").appendTo(f);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,function(){return!(d=true)});if(d){c.each(a,function(e,h){e=c('<button type="button"></button>').text(e).click(function(){h.apply(b.element[0],arguments)}).appendTo(g);c.fn.button&&e.button()});f.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(e){return{position:e.position,
offset:e.offset}}var b=this,d=b.options,f=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(e,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",e,a(h))},drag:function(e,h){b._trigger("drag",e,a(h))},stop:function(e,h){d.position=[h.position.left-f.scrollLeft(),h.position.top-f.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);
b._trigger("dragStop",e,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}a=a===j?this.options.resizable:a;var d=this,f=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:d._minHeight(),
handles:a,start:function(e,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",e,b(h))},resize:function(e,h){d._trigger("resize",e,b(h))},stop:function(e,h){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();d._trigger("resizeStop",e,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,
a.height)},_position:function(a){var b=[],d=[0,0],f;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):[a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,e){if(+b[g]===b[g]){d[g]=b[g];b[g]=e}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(f=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(a);
f||this.uiDialog.hide()},_setOption:function(a,b){var d=this,f=d.uiDialog,g=f.is(":data(resizable)"),e=false;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);e=true;break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":f.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case "draggable":b?
d._makeDraggable():f.draggable("destroy");break;case "height":e=true;break;case "maxHeight":g&&f.resizable("option","maxHeight",b);e=true;break;case "maxWidth":g&&f.resizable("option","maxWidth",b);e=true;break;case "minHeight":g&&f.resizable("option","minHeight",b);e=true;break;case "minWidth":g&&f.resizable("option","minWidth",b);e=true;break;case "position":d._position(b);break;case "resizable":g&&!b&&f.resizable("destroy");g&&typeof b==="string"&&f.resizable("option","handles",b);!g&&b!==false&&
d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break;case "width":e=true;break}c.Widget.prototype._setOption.apply(d,arguments);e&&d._size()},_size:function(){var a=this.options,b;this.element.css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();this.element.css(a.height==="auto"?{minHeight:Math.max(a.minHeight-b,0),height:"auto"}:{minHeight:0,height:Math.max(a.height-
b,0)}).show();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.4",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),
create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){return c(d.target).zIndex()>=c.ui.dialog.overlay.maxZ})},1);c(document).bind("keydown.dialog-overlay",function(d){if(a.options.closeOnEscape&&d.keyCode&&d.keyCode===c.ui.keyCode.ESCAPE){a.close(d);d.preventDefault()}});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var b=(this.oldInstances.pop()||c("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),
height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){this.oldInstances.push(this.instances.splice(c.inArray(a,this.instances),1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var b=0;c.each(this.instances,function(){b=Math.max(b,this.css("z-index"))});this.maxZ=b},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);
b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a<b?c(window).height()+"px":a+"px"}else return c(document).height()+"px"},width:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);b=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return a<b?c(window).width()+"px":a+"px"}else return c(document).width()+"px"},resize:function(){var a=c([]);c.each(c.ui.dialog.overlay.instances,
function(){a=a.add(this)});a.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
;
(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var a=this,b=this.options;this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");b.disabled&&this.element.addClass("ui-slider-disabled ui-disabled");
this.range=d([]);if(b.range){if(b.range===true){this.range=d("<div></div>");if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}else this.range=d("<div></div>");this.range.appendTo(this.element).addClass("ui-slider-range");if(b.range==="min"||b.range==="max")this.range.addClass("ui-slider-range-"+b.range);this.range.addClass("ui-widget-header")}d(".ui-slider-handle",this.element).length===0&&d("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");
if(b.values&&b.values.length)for(;d(".ui-slider-handle",this.element).length<b.values.length;)d("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");this.handles=d(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur();
else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(c){d(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var e=true,f=d(this).data("index.ui-slider-handle"),h,g,i;if(!a.options.disabled){switch(c.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:e=
false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");h=a._start(c,f);if(h===false)return}break}i=a.options.step;h=a.options.values&&a.options.values.length?(g=a.values(f)):(g=a.value());switch(c.keyCode){case d.ui.keyCode.HOME:g=a._valueMin();break;case d.ui.keyCode.END:g=a._valueMax();break;case d.ui.keyCode.PAGE_UP:g=a._trimAlignValue(h+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:g=a._trimAlignValue(h-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(h===
a._valueMax())return;g=a._trimAlignValue(h+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(h===a._valueMin())return;g=a._trimAlignValue(h-i);break}a._slide(c,f,g);return e}}).keyup(function(c){var e=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(c,e);a._change(c,e);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");
this._mouseDestroy();return this},_mouseCapture:function(a){var b=this.options,c,e,f,h,g;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});e=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(i){var j=Math.abs(c-h.values(i));if(e>j){e=j;f=d(this);g=i}});if(b.range===true&&this.values(1)===b.min){g+=1;f=d(this.handles[g])}if(this._start(a,
g)===false)return false;this._mouseSliding=true;h._handleIndex=g;f.addClass("ui-state-active").focus();b=f.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-f.width()/2,top:a.pageY-b.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};this._slide(a,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(a){var b=
this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;if(this.orientation==="horizontal"){b=
this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);
c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var e;if(this.options.values&&this.options.values.length){e=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>e||b===1&&c<e))c=e;if(c!==this.values(b)){e=this.values();e[b]=c;a=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e});this.values(b?0:1);a!==false&&this.values(b,c,true)}}else if(c!==this.value()){a=this._trigger("slide",a,{handle:this.handles[b],value:c});
a!==false&&this.value(c)}},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("change",a,c)}},value:function(a){if(arguments.length){this.options.value=
this._trimAlignValue(a);this._refreshValue();this._change(null,0)}return this._value()},values:function(a,b){var c,e,f;if(arguments.length>1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;e=arguments[0];for(f=0;f<c.length;f+=1){c[f]=this._trimAlignValue(e[f]);this._change(null,f)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(a):this.value();
else return this._values()},_setOption:function(a,b){var c,e=0;if(d.isArray(this.options.values))e=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(a){case "disabled":if(b){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation();
this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(c=0;c<e;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a)},_values:function(a){var b,c;if(arguments.length){b=this.options.values[a];
return b=this._trimAlignValue(b)}else{b=this.options.values.slice();for(c=0;c<b.length;c+=1)b[c]=this._trimAlignValue(b[c]);return b}},_trimAlignValue:function(a){if(a<this._valueMin())return this._valueMin();if(a>this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=a%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a=
this.options.range,b=this.options,c=this,e=!this._animateOff?b.animate:false,f,h={},g,i,j,l;if(this.options.values&&this.options.values.length)this.handles.each(function(k){f=(c.values(k)-c._valueMin())/(c._valueMax()-c._valueMin())*100;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";d(this).stop(1,1)[e?"animate":"css"](h,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(k===0)c.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},b.animate);if(k===1)c.range[e?"animate":"css"]({width:f-
g+"%"},{queue:false,duration:b.animate})}else{if(k===0)c.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},b.animate);if(k===1)c.range[e?"animate":"css"]({height:f-g+"%"},{queue:false,duration:b.animate})}g=f});else{i=this.value();j=this._valueMin();l=this._valueMax();f=l!==j?(i-j)/(l-j)*100:0;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](h,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},
b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.4"})})(jQuery);
;
(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading…</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(a,e){if(a=="selected")this.options.collapsible&&
e==this.options.selected||this.select(e);else{this.options[a]=e;this._tabify()}},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var a=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[a].concat(d.makeArray(arguments)))},_ui:function(a,e){return{tab:a,panel:e,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var a=
d(this);a.html(a.data("label.tabs")).removeData("label.tabs")})},_tabify:function(a){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var b=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var j=d(f).attr("href"),l=j.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]||
(q=d("base")[0])&&l===q.href)){j=f.hash;f.href=j}if(h.test(j))b.panels=b.panels.add(b._sanitizeSelector(j));else if(j!=="#"){d.data(f,"href.tabs",j);d.data(f,"load.tabs",j.replace(/#.*$/,""));j=b._tabId(f);f.href="#"+j;f=d("#"+j);if(!f.length){f=d(c.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(b.panels[g-1]||b.list);f.data("destroy.tabs",true)}b.panels=b.panels.add(f)}else c.disabled.push(g)});if(a){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");
this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(b._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected=
this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return b.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");
if(c.selected>=0&&this.anchors.length){this.panels.eq(c.selected).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");b.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[c.selected],b.panels[c.selected]))});this.load(c.selected)}d(window).bind("unload",function(){b.lis.add(b.anchors).unbind(".tabs");b.lis=b.anchors=b.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));this.element[c.collapsible?"addClass":
"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);a=0;for(var i;i=this.lis[a];a++)d(i)[d.inArray(a,c.disabled)!=-1&&!d(i).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+g)};this.lis.bind("mouseover.tabs",
function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal",function(){e(f,o);b._trigger("show",
null,b._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");b._trigger("show",null,b._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){b.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);b.element.dequeue("tabs")})}:function(g,f){b.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");b.element.dequeue("tabs")};this.anchors.bind(c.event+".tabs",
function(){var g=this,f=d(g).closest("li"),j=b.panels.filter(":not(.ui-tabs-hide)"),l=d(b._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||b._trigger("select",null,b._ui(this,l[0]))===false){this.blur();return false}c.selected=b.anchors.index(this);b.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected=-1;c.cookie&&b._cookie(c.selected,c.cookie);b.element.queue("tabs",function(){s(g,
j)}).dequeue("tabs");this.blur();return false}else if(!j.length){c.cookie&&b._cookie(c.selected,c.cookie);b.element.queue("tabs",function(){r(g,l)});b.load(b.anchors.index(this));this.blur();return false}c.cookie&&b._cookie(c.selected,c.cookie);if(l.length){j.length&&b.element.queue("tabs",function(){s(g,j)});b.element.queue("tabs",function(){r(g,l)});b.load(b.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",
function(){return false})},_getIndex:function(a){if(typeof a=="string")a=this.anchors.index(this.anchors.filter("[href$="+a+"]"));return a},destroy:function(){var a=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e=d.data(this,"href.tabs");if(e)this.href=
e;var b=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){b.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});a.cookie&&this._cookie(null,a.cookie);return this},add:function(a,e,b){if(b===p)b=this.anchors.length;
var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,a).replace(/#\{label\}/g,e));a=!a.indexOf("#")?a.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var i=d("#"+a);i.length||(i=d(h.panelTemplate).attr("id",a).data("destroy.tabs",true));i.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(b>=this.lis.length){e.appendTo(this.list);i.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[b]);
i.insertBefore(this.panels[b])}h.disabled=d.map(h.disabled,function(k){return k>=b?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");i.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[b],this.panels[b]));return this},remove:function(a){a=this._getIndex(a);var e=this.options,b=this.lis.eq(a).remove(),c=this.panels.eq(a).remove();
if(b.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(a+(a+1<this.anchors.length?1:-1));e.disabled=d.map(d.grep(e.disabled,function(h){return h!=a}),function(h){return h>=a?--h:h});this._tabify();this._trigger("remove",null,this._ui(b.find("a")[0],c[0]));return this},enable:function(a){a=this._getIndex(a);var e=this.options;if(d.inArray(a,e.disabled)!=-1){this.lis.eq(a).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(b){return b!=a});this._trigger("enable",null,
this._ui(this.anchors[a],this.panels[a]));return this}},disable:function(a){a=this._getIndex(a);var e=this.options;if(a!=e.selected){this.lis.eq(a).addClass("ui-state-disabled");e.disabled.push(a);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a]))}return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this},
load:function(a){a=this._getIndex(a);var e=this,b=this.options,c=this.anchors.eq(a)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(a).addClass("ui-state-processing");if(b.spinner){var i=d("span",c);i.data("label.tabs",i.html()).html(b.spinner)}this.xhr=d.ajax(d.extend({},b.ajaxOptions,{url:h,success:function(k,n){d(e._sanitizeSelector(c.hash)).html(k);e._cleanup();b.cache&&d.data(c,"cache.tabs",
true);e._trigger("load",null,e._ui(e.anchors[a],e.panels[a]));try{b.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[a],e.panels[a]));try{b.ajaxOptions.error(k,n,a,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(a,
e){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.4"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(a,e){var b=this,c=this.options,h=b._rotate||(b._rotate=function(i){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var k=c.selected;b.select(++k<b.anchors.length?k:0)},a);i&&i.stopPropagation()});e=b._unrotate||(b._unrotate=!e?function(i){i.clientX&&b.rotate(null)}:
function(){t=c.selected;h()});if(a){this.element.bind("tabsshow",h);this.anchors.bind(c.event+".tabs",e);h()}else{clearTimeout(b.rotation);this.element.unbind("tabsshow",h);this.anchors.unbind(c.event+".tabs",e);delete this._rotate;delete this._unrotate}return this}})})(jQuery);
;
(function(d,G){function L(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",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",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>')}function E(a,b){d.extend(a,
b);for(var c in b)if(b[c]==null||b[c]==G)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.4"}});var y=(new Date).getTime();d.extend(L.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){E(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=
f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}},
_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&
b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==
""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,
c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),
true);this._updateDatepicker(b);this._updateAlternate(b)}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}E(a.settings,e||{});b=b&&b.constructor==
Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);
d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},
_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=
d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;
for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return true;return false},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?d.extend({},e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&
this._hideDatepicker();var h=this._getDateDatepicker(a,true);E(e.settings,f);this._attachments(d(a),e);this._autoSize(e);this._setDateDatepicker(a,h);this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,b);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&
!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass,b.dpDiv).add(d("td."+d.datepicker._currentClass,b.dpDiv));c[0]?d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]):d.datepicker._hideDatepicker();
return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.datepicker._clearDate(a.target);c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||
a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,
a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);else c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));
var c=String.fromCharCode(a.charCode==G?a.keyCode:a.charCode);return a.ctrlKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||
a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");E(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);
d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&
d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=d.datepicker._getBorders(b.dpDiv);b.dpDiv.find("iframe.ui-datepicker-cover").css({left:-i[0],top:-i[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,
h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a)).find("iframe.ui-datepicker-cover").css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){d(this).removeClass("ui-state-hover");
this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).addClass("ui-datepicker-prev-hover");
this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);var e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");
a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input.focus()},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),
k=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>k&&k>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1);)a=a[b?"previousSibling":"nextSibling"];
a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val():
"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&
!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;
b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=
this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=
d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,
"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b==
"object"?b.toString():b+"";if(b=="")return null;for(var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff,f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,k=c=-1,l=-1,u=-1,j=false,o=function(p){(p=z+1<a.length&&a.charAt(z+1)==p)&&z++;return p},m=function(p){o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"?4:p=="o"?
3:2)+"}");p=b.substring(s).match(p);if(!p)throw"Missing number at position "+s;s+=p[0].length;return parseInt(p[0],10)},n=function(p,w,H){p=o(p)?H:w;for(w=0;w<p.length;w++)if(b.substr(s,p[w].length)==p[w]){s+=p[w].length;return w+1}throw"Unknown name at position "+s;},r=function(){if(b.charAt(s)!=a.charAt(z))throw"Unexpected literal at position "+s;s++},s=0,z=0;z<a.length;z++)if(j)if(a.charAt(z)=="'"&&!o("'"))j=false;else r();else switch(a.charAt(z)){case "d":l=m("d");break;case "D":n("D",f,h);break;
case "o":u=m("o");break;case "m":k=m("m");break;case "M":k=n("M",i,g);break;case "y":c=m("y");break;case "@":var v=new Date(m("@"));c=v.getFullYear();k=v.getMonth()+1;l=v.getDate();break;case "!":v=new Date((m("!")-this._ticksTo1970)/1E4);c=v.getFullYear();k=v.getMonth()+1;l=v.getDate();break;case "'":if(o("'"))r();else j=true;break;default:r()}if(c==-1)c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);if(u>-1){k=1;l=u;do{e=this._getDaysInMonth(c,
k-1);if(l<=e)break;k++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,k-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=k||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";
var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=j+1<a.length&&a.charAt(j+1)==o)&&j++;return o},g=function(o,m,n){m=""+m;if(i(o))for(;m.length<n;)m="0"+m;return m},k=function(o,m,n,r){return i(o)?r[m]:n[m]},l="",u=false;if(b)for(var j=0;j<a.length;j++)if(u)if(a.charAt(j)=="'"&&!i("'"))u=false;else l+=a.charAt(j);
else switch(a.charAt(j)){case "d":l+=g("d",b.getDate(),2);break;case "D":l+=k("D",b.getDay(),e,f);break;case "o":l+=g("o",(b.getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864E5,3);break;case "m":l+=g("m",b.getMonth()+1,2);break;case "M":l+=k("M",b.getMonth(),h,c);break;case "y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case "@":l+=b.getTime();break;case "!":l+=b.getTime()*1E4+this._ticksTo1970;break;case "'":if(i("'"))l+="'";else u=true;break;default:l+=a.charAt(j)}return l},
_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f=0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+="0123456789";break;case "D":case "M":return null;case "'":if(e("'"))b+="'";else c=true;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==G?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=
a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,
this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date;i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,k=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,j=u.exec(h);j;){switch(j[2]||"d"){case "d":case "D":g+=parseInt(j[1],
10);break;case "w":case "W":g+=parseInt(j[1],10)*7;break;case "m":case "M":l+=parseInt(j[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(k,l));break;case "y":case "Y":k+=parseInt(j[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(k,l));break}j=u.exec(h)}return new Date(k,l,g)};if(b=(b=b==null?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):b)&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;
a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||
a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),k=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?
new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),j=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=j&&n<j?j:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-k,1)),this._getFormatConfig(a));
n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._adjustDate('#"+a.id+"', -"+k+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m,
g+k,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._adjustDate('#"+a.id+"', +"+k+", 'M');\" title=\""+r+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+r+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+r+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+r+"</span></a>";k=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&&
a.currentDay?u:b;k=!h?k:this.formatDate(k,r,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+y+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,r)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+
y+".datepicker._gotoToday('#"+a.id+"');\">"+k+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;k=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),w=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var M=this._getDefaultDate(a),I="",C=0;C<i[0];C++){for(var N=
"",D=0;D<i[1];D++){var J=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",x="";if(l){x+='<div class="ui-datepicker-group';if(i[1]>1)switch(D){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&C==0?c?
f:n:"")+(/all|right/.test(t)&&C==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,j,o,C>0||D>0,z,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var A=k?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(t=0;t<7;t++){var q=(t+h)%7;A+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+r[q]+'">'+s[q]+"</span></th>"}x+=A+"</tr></thead><tbody>";A=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,
A);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;A=l?6:Math.ceil((t+A)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var O=0;O<A;O++){x+="<tr>";var P=!k?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(q)+"</td>";for(t=0;t<7;t++){var F=p?p.apply(a.input?a.input[0]:null,[q]):[true,""],B=q.getMonth()!=g,K=B&&!H||!F[0]||j&&q<j||o&&q>o;P+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(B?" ui-datepicker-other-month":"")+(q.getTime()==J.getTime()&&g==a.selectedMonth&&
a._keyEvent||M.getTime()==q.getTime()&&M.getTime()==J.getTime()?" "+this._dayOverClass:"")+(K?" "+this._unselectableClass+" ui-state-disabled":"")+(B&&!w?"":" "+F[1]+(q.getTime()==u.getTime()?" "+this._currentClass:"")+(q.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!B||w)&&F[2]?' title="'+F[2]+'"':"")+(K?"":' onclick="DP_jQuery_'+y+".datepicker._selectDay('#"+a.id+"',"+q.getMonth()+","+q.getFullYear()+', this);return false;"')+">"+(B&&!w?" ":K?'<span class="ui-state-default">'+q.getDate()+
"</span>":'<a class="ui-state-default'+(q.getTime()==b.getTime()?" ui-state-highlight":"")+(q.getTime()==J.getTime()?" ui-state-active":"")+(B?" ui-priority-secondary":"")+'" href="#">'+q.getDate()+"</a>")+"</td>";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+=P+"</tr>"}g++;if(g>11){g=0;m++}x+="</tbody></table>"+(l?"</div>"+(i[0]>0&&D==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");N+=x}I+=N}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':
"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var k=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),j='<div class="ui-datepicker-title">',o="";if(h||!k)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+y+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" onclick=\"DP_jQuery_"+y+".datepicker._clickMonthYear('#"+
a.id+"');\">";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&&(!m||n<=f.getMonth()))o+='<option value="'+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";o+="</select>"}u||(j+=o+(h||!(k&&l)?" ":""));if(h||!l)j+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b,
i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(j+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+y+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" onclick=\"DP_jQuery_"+y+".datepicker._clickMonthYear('#"+a.id+"');\">";b<=g;b++)j+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";j+="</select>"}j+=this._get(a,"yearSuffix");if(u)j+=(h||!(k&&l)?" ":"")+o;j+="</div>";return j},_adjustInstDate:function(a,b,c){var e=
a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,
"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);
c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,
"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=
function(a){if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));
return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new L;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.4";window["DP_jQuery_"+y]=d})(jQuery);
;
(function(b,c){b.widget("ui.progressbar",{options:{value:0},min:0,max:100,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.max,"aria-valuenow":this._value()});this.valueDiv=b("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");
this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===c)return this._value();this._setOption("value",a);return this},_setOption:function(a,d){if(a==="value"){this.options.value=d;this._refreshValue();this._trigger("change")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.max,Math.max(this.min,a))},_refreshValue:function(){var a=this.value();this.valueDiv.toggleClass("ui-corner-right",
a===this.max).width(a+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.4"})})(jQuery);
;
jQuery.effects||function(f,j){function l(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1],
16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return m.transparent;return m[f.trim(c).toLowerCase()]}function r(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return l(b)}function n(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,
a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function o(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in s||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function t(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d=
a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:f.fx.speeds[b]||f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=r(b.elem,a);b.end=l(b.end);b.colorInit=
true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var m={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,
183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,
165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},p=["add","remove","toggle"],s={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,d){if(f.isFunction(b)){d=b;b=null}return this.each(function(){var e=f(this),g=e.attr("style")||" ",h=o(n.call(this)),q,u=e.attr("className");f.each(p,function(v,
i){c[i]&&e[i+"Class"](c[i])});q=o(n.call(this));e.attr("className",u);e.animate(t(h,q),a,b,function(){f.each(p,function(v,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments)})})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?
f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.4",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==
null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,a){var b;switch(c[0]){case "top":b=0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();
var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});
c.css({position:"relative",top:0,left:0})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments);a={options:a[1],duration:a[2],callback:a[3]};var b=f.effects[c];return b&&!f.fx.off?b.call(this,a):this},_show:f.fn.show,show:function(c){if(!c||
typeof c=="number"||f.fx.speeds[c])return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(!c||typeof c=="number"||f.fx.speeds[c])return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(!c||typeof c=="number"||f.fx.speeds[c]||typeof c=="boolean"||f.isFunction(c))return this.__toggle.apply(this,
arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,
a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+
b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,
10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*
a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,
a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);if(a<1)return-0.5*h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,
a,b,d,e,g){if(g==j)g=1.70158;if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,a,b,d,e){return d-f.easing.easeOutBounce(c,e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+
b;return f.easing.easeOutBounce(c,a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);
;
(function(b){b.effects.blind=function(c){return this.queue(function(){var a=b(this),g=["position","top","left"],f=b.effects.setMode(a,c.options.mode||"hide"),d=c.options.direction||"vertical";b.effects.save(a,g);a.show();var e=b.effects.createWrapper(a).css({overflow:"hidden"}),h=d=="vertical"?"height":"width";d=d=="vertical"?e.height():e.width();f=="show"&&e.css(h,0);var i={};i[h]=f=="show"?d:0;e.animate(i,c.duration,c.options.easing,function(){f=="hide"&&a.hide();b.effects.restore(a,g);b.effects.removeWrapper(a);
c.callback&&c.callback.apply(a[0],arguments);a.dequeue()})})}})(jQuery);
;
(function(e){e.effects.bounce=function(b){return this.queue(function(){var a=e(this),l=["position","top","left"],h=e.effects.setMode(a,b.options.mode||"effect"),d=b.options.direction||"up",c=b.options.distance||20,m=b.options.times||5,i=b.duration||250;/show|hide/.test(h)&&l.push("opacity");e.effects.save(a,l);a.show();e.effects.createWrapper(a);var f=d=="up"||d=="down"?"top":"left";d=d=="up"||d=="left"?"pos":"neg";c=b.options.distance||(f=="top"?a.outerHeight({margin:true})/3:a.outerWidth({margin:true})/
3);if(h=="show")a.css("opacity",0).css(f,d=="pos"?-c:c);if(h=="hide")c/=m*2;h!="hide"&&m--;if(h=="show"){var g={opacity:1};g[f]=(d=="pos"?"+=":"-=")+c;a.animate(g,i/2,b.options.easing);c/=2;m--}for(g=0;g<m;g++){var j={},k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing);c=h=="hide"?c*2:c/2}if(h=="hide"){g={opacity:0};g[f]=(d=="pos"?"-=":"+=")+c;a.animate(g,i/2,b.options.easing,function(){a.hide();e.effects.restore(a,l);e.effects.removeWrapper(a);
b.callback&&b.callback.apply(this,arguments)})}else{j={};k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing,function(){e.effects.restore(a,l);e.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments)})}a.queue("fx",function(){a.dequeue()});a.dequeue()})}})(jQuery);
;
(function(b){b.effects.clip=function(e){return this.queue(function(){var a=b(this),i=["position","top","left","height","width"],f=b.effects.setMode(a,e.options.mode||"hide"),c=e.options.direction||"vertical";b.effects.save(a,i);a.show();var d=b.effects.createWrapper(a).css({overflow:"hidden"});d=a[0].tagName=="IMG"?d:a;var g={size:c=="vertical"?"height":"width",position:c=="vertical"?"top":"left"};c=c=="vertical"?d.height():d.width();if(f=="show"){d.css(g.size,0);d.css(g.position,c/2)}var h={};h[g.size]=
f=="show"?c:0;h[g.position]=f=="show"?0:c/2;d.animate(h,{queue:false,duration:e.duration,easing:e.options.easing,complete:function(){f=="hide"&&a.hide();b.effects.restore(a,i);b.effects.removeWrapper(a);e.callback&&e.callback.apply(a[0],arguments);a.dequeue()}})})}})(jQuery);
;
(function(c){c.effects.drop=function(d){return this.queue(function(){var a=c(this),h=["position","top","left","opacity"],e=c.effects.setMode(a,d.options.mode||"hide"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a);var f=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margin:true})/2:a.outerWidth({margin:true})/2);if(e=="show")a.css("opacity",0).css(f,b=="pos"?-g:g);var i={opacity:e=="show"?1:
0};i[f]=(e=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
;
(function(j){j.effects.explode=function(a){return this.queue(function(){var c=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3,d=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3;a.options.mode=a.options.mode=="toggle"?j(this).is(":visible")?"hide":"show":a.options.mode;var b=j(this).show().css("visibility","hidden"),g=b.offset();g.top-=parseInt(b.css("marginTop"),10)||0;g.left-=parseInt(b.css("marginLeft"),10)||0;for(var h=b.outerWidth(true),i=b.outerHeight(true),e=0;e<c;e++)for(var f=
0;f<d;f++)b.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+
e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery);
;
(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","left"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],10)/100*
f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);
;
(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&&
this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
;
(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c<times;c++){b.animate({opacity:animateTo},duration,a.options.easing);animateTo=(animateTo+1)%2}b.animate({opacity:animateTo},duration,
a.options.easing,function(){animateTo==0&&b.hide();a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()}).dequeue()})}})(jQuery);
;
(function(c){c.effects.puff=function(b){return this.queue(function(){var a=c(this),e=c.effects.setMode(a,b.options.mode||"hide"),g=parseInt(b.options.percent,10)||150,h=g/100,i={height:a.height(),width:a.width()};c.extend(b.options,{fade:true,mode:e,percent:e=="hide"?g:100,from:e=="hide"?i:{height:i.height*h,width:i.width*h}});a.effect("scale",b.options,b.duration,b.callback);a.dequeue()})};c.effects.scale=function(b){return this.queue(function(){var a=c(this),e=c.extend(true,{},b.options),g=c.effects.setMode(a,
b.options.mode||"effect"),h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:g=="hide"?0:100),i=b.options.direction||"both",f=b.options.origin;if(g!="effect"){e.origin=f||["middle","center"];e.restore=true}f={height:a.height(),width:a.width()};a.from=b.options.from||(g=="show"?{height:0,width:0}:f);h={y:i!="horizontal"?h/100:1,x:i!="vertical"?h/100:1};a.to={height:f.height*h.y,width:f.width*h.x};if(b.options.fade){if(g=="show"){a.from.opacity=0;a.to.opacity=1}if(g=="hide"){a.from.opacity=
1;a.to.opacity=0}}e.from=a.from;e.to=a.to;e.mode=g;a.effect("size",e,b.duration,b.callback);a.dequeue()})};c.effects.size=function(b){return this.queue(function(){var a=c(this),e=["position","top","left","width","height","overflow","opacity"],g=["position","top","left","overflow","opacity"],h=["width","height","overflow"],i=["fontSize"],f=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],k=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=c.effects.setMode(a,
b.options.mode||"effect"),n=b.options.restore||false,m=b.options.scale||"both",l=b.options.origin,j={height:a.height(),width:a.width()};a.from=b.options.from||j;a.to=b.options.to||j;if(l){l=c.effects.getBaseline(l,j);a.from.top=(j.height-a.from.height)*l.y;a.from.left=(j.width-a.from.width)*l.x;a.to.top=(j.height-a.to.height)*l.y;a.to.left=(j.width-a.to.width)*l.x}var d={from:{y:a.from.height/j.height,x:a.from.width/j.width},to:{y:a.to.height/j.height,x:a.to.width/j.width}};if(m=="box"||m=="both"){if(d.from.y!=
d.to.y){e=e.concat(f);a.from=c.effects.setTransition(a,f,d.from.y,a.from);a.to=c.effects.setTransition(a,f,d.to.y,a.to)}if(d.from.x!=d.to.x){e=e.concat(k);a.from=c.effects.setTransition(a,k,d.from.x,a.from);a.to=c.effects.setTransition(a,k,d.to.x,a.to)}}if(m=="content"||m=="both")if(d.from.y!=d.to.y){e=e.concat(i);a.from=c.effects.setTransition(a,i,d.from.y,a.from);a.to=c.effects.setTransition(a,i,d.to.y,a.to)}c.effects.save(a,n?e:g);a.show();c.effects.createWrapper(a);a.css("overflow","hidden").css(a.from);
if(m=="content"||m=="both"){f=f.concat(["marginTop","marginBottom"]).concat(i);k=k.concat(["marginLeft","marginRight"]);h=e.concat(f).concat(k);a.find("*[width]").each(function(){child=c(this);n&&c.effects.save(child,h);var o={height:child.height(),width:child.width()};child.from={height:o.height*d.from.y,width:o.width*d.from.x};child.to={height:o.height*d.to.y,width:o.width*d.to.x};if(d.from.y!=d.to.y){child.from=c.effects.setTransition(child,f,d.from.y,child.from);child.to=c.effects.setTransition(child,
f,d.to.y,child.to)}if(d.from.x!=d.to.x){child.from=c.effects.setTransition(child,k,d.from.x,child.from);child.to=c.effects.setTransition(child,k,d.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){n&&c.effects.restore(child,h)})})}a.animate(a.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){a.to.opacity===0&&a.css("opacity",a.from.opacity);p=="hide"&&a.hide();c.effects.restore(a,n?e:g);c.effects.removeWrapper(a);b.callback&&
b.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
;
(function(d){d.effects.shake=function(a){return this.queue(function(){var b=d(this),j=["position","top","left"];d.effects.setMode(b,a.options.mode||"effect");var c=a.options.direction||"left",e=a.options.distance||20,l=a.options.times||3,f=a.duration||a.options.duration||140;d.effects.save(b,j);b.show();d.effects.createWrapper(b);var g=c=="up"||c=="down"?"top":"left",h=c=="up"||c=="left"?"pos":"neg";c={};var i={},k={};c[g]=(h=="pos"?"-=":"+=")+e;i[g]=(h=="pos"?"+=":"-=")+e*2;k[g]=(h=="pos"?"-=":"+=")+
e*2;b.animate(c,f,a.options.easing);for(e=1;e<l;e++)b.animate(i,f,a.options.easing).animate(k,f,a.options.easing);b.animate(i,f,a.options.easing).animate(c,f/2,a.options.easing,function(){d.effects.restore(b,j);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()});b.dequeue()})}})(jQuery);
;
(function(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this),h=["position","top","left"],e=c.effects.setMode(a,d.options.mode||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a).css({overflow:"hidden"});var f=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margin:true}):a.outerWidth({margin:true}));if(e=="show")a.css(f,b=="pos"?-g:g);var i={};i[f]=(e=="show"?b=="pos"?
"+=":"-=":b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
;
(function(e){e.effects.transfer=function(a){return this.queue(function(){var b=e(this),c=e(a.options.to),d=c.offset();c={top:d.top,left:d.left,height:c.innerHeight(),width:c.innerWidth()};d=b.offset();var f=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments);
b.dequeue()})})}})(jQuery);
;
(function(c,h){c.fn.jPlayer=function(a){var b=typeof a==="string",d=Array.prototype.slice.call(arguments,1),f=this;a=!b&&d.length?c.extend.apply(null,[true,a].concat(d)):a;if(b&&a.charAt(0)==="_")return f;b?this.each(function(){var e=c.data(this,"jPlayer"),g=e&&c.isFunction(e[a])?e[a].apply(e,d):e;if(g!==e&&g!==h){f=g;return false}}):this.each(function(){var e=c.data(this,"jPlayer");if(e){e.option(a||{})._init();e.option(a||{})}else c.data(this,"jPlayer",new c.jPlayer(a,this))});return f};c.jPlayer=
function(a,b){if(arguments.length){this.element=c(b);this.options=c.extend(true,{},this.options,a);var d=this;this.element.bind("remove.jPlayer",function(){d.destroy()});this._init()}};c.jPlayer.event={ready:"jPlayer_ready",resize:"jPlayer_resize",error:"jPlayer_error",warning:"jPlayer_warning",loadstart:"jPlayer_loadstart",progress:"jPlayer_progress",suspend:"jPlayer_suspend",abort:"jPlayer_abort",emptied:"jPlayer_emptied",stalled:"jPlayer_stalled",play:"jPlayer_play",pause:"jPlayer_pause",loadedmetadata:"jPlayer_loadedmetadata",
loadeddata:"jPlayer_loadeddata",waiting:"jPlayer_waiting",playing:"jPlayer_playing",canplay:"jPlayer_canplay",canplaythrough:"jPlayer_canplaythrough",seeking:"jPlayer_seeking",seeked:"jPlayer_seeked",timeupdate:"jPlayer_timeupdate",ended:"jPlayer_ended",ratechange:"jPlayer_ratechange",durationchange:"jPlayer_durationchange",volumechange:"jPlayer_volumechange"};c.jPlayer.htmlEvent=["loadstart","abort","emptied","stalled","loadedmetadata","loadeddata","canplaythrough","ratechange"];c.jPlayer.pause=
function(){c.each(c.jPlayer.prototype.instances,function(a,b){b.data("jPlayer").status.srcSet&&b.jPlayer("pause")})};c.jPlayer.timeFormat={showHour:false,showMin:true,showSec:true,padHour:false,padMin:true,padSec:true,sepHour:":",sepMin:":",sepSec:""};c.jPlayer.convertTime=function(a){a=new Date(a*1E3);var b=a.getUTCHours(),d=a.getUTCMinutes();a=a.getUTCSeconds();b=c.jPlayer.timeFormat.padHour&&b<10?"0"+b:b;d=c.jPlayer.timeFormat.padMin&&d<10?"0"+d:d;a=c.jPlayer.timeFormat.padSec&&a<10?"0"+a:a;return(c.jPlayer.timeFormat.showHour?
b+c.jPlayer.timeFormat.sepHour:"")+(c.jPlayer.timeFormat.showMin?d+c.jPlayer.timeFormat.sepMin:"")+(c.jPlayer.timeFormat.showSec?a+c.jPlayer.timeFormat.sepSec:"")};c.jPlayer.uaMatch=function(a){a=a.toLowerCase();var b=/(opera)(?:.*version)?[ \/]([\w.]+)/,d=/(msie) ([\w.]+)/,f=/(mozilla)(?:.*? rv:([\w.]+))?/;a=/(webkit)[ \/]([\w.]+)/.exec(a)||b.exec(a)||d.exec(a)||a.indexOf("compatible")<0&&f.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}};c.jPlayer.browser={};var m=c.jPlayer.uaMatch(navigator.userAgent);
if(m.browser){c.jPlayer.browser[m.browser]=true;c.jPlayer.browser.version=m.version}c.jPlayer.prototype={count:0,version:{script:"2.0.0",needFlash:"2.0.0",flash:"unknown"},options:{swfPath:"js",solution:"html, flash",supplied:"mp3",preload:"metadata",volume:0.8,muted:false,backgroundColor:"#000000",cssSelectorAncestor:"#jp_interface_1",cssSelector:{videoPlay:".jp-video-play",play:".jp-play",pause:".jp-pause",stop:".jp-stop",seekBar:".jp-seek-bar",playBar:".jp-play-bar",mute:".jp-mute",unmute:".jp-unmute",
volumeBar:".jp-volume-bar",volumeBarValue:".jp-volume-bar-value",currentTime:".jp-current-time",duration:".jp-duration"},idPrefix:"jp",errorAlerts:false,warningAlerts:false},instances:{},status:{src:"",media:{},paused:true,format:{},formatType:"",waitForPlay:true,waitForLoad:true,srcSet:false,video:false,seekPercent:0,currentPercentRelative:0,currentPercentAbsolute:0,currentTime:0,duration:0},_status:{volume:h,muted:false,width:0,height:0},internal:{ready:false,instance:h,htmlDlyCmdId:h},solution:{html:true,
flash:true},format:{mp3:{codec:'audio/mpeg; codecs="mp3"',flashCanPlay:true,media:"audio"},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:true,media:"audio"},oga:{codec:'audio/ogg; codecs="vorbis"',flashCanPlay:false,media:"audio"},wav:{codec:'audio/wav; codecs="1"',flashCanPlay:false,media:"audio"},webma:{codec:'audio/webm; codecs="vorbis"',flashCanPlay:false,media:"audio"},m4v:{codec:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:true,media:"video"},ogv:{codec:'video/ogg; codecs="theora, vorbis"',
flashCanPlay:false,media:"video"},webmv:{codec:'video/webm; codecs="vorbis, vp8"',flashCanPlay:false,media:"video"}},_init:function(){var a=this;this.element.empty();this.status=c.extend({},this.status,this._status);this.internal=c.extend({},this.internal);this.formats=[];this.solutions=[];this.require={};this.htmlElement={};this.html={};this.html.audio={};this.html.video={};this.flash={};this.css={};this.css.cs={};this.css.jq={};this.status.volume=this._limitValue(this.options.volume,0,1);this.status.muted=
this.options.muted;this.status.width=this.element.css("width");this.status.height=this.element.css("height");this.element.css({"background-color":this.options.backgroundColor});c.each(this.options.supplied.toLowerCase().split(","),function(e,g){var i=g.replace(/^\s+|\s+$/g,"");if(a.format[i]){var j=false;c.each(a.formats,function(n,k){if(i===k){j=true;return false}});j||a.formats.push(i)}});c.each(this.options.solution.toLowerCase().split(","),function(e,g){var i=g.replace(/^\s+|\s+$/g,"");if(a.solution[i]){var j=
false;c.each(a.solutions,function(n,k){if(i===k){j=true;return false}});j||a.solutions.push(i)}});this.internal.instance="jp_"+this.count;this.instances[this.internal.instance]=this.element;this.element.attr("id")===""&&this.element.attr("id",this.options.idPrefix+"_jplayer_"+this.count);this.internal.self=c.extend({},{id:this.element.attr("id"),jq:this.element});this.internal.audio=c.extend({},{id:this.options.idPrefix+"_audio_"+this.count,jq:h});this.internal.video=c.extend({},{id:this.options.idPrefix+
"_video_"+this.count,jq:h});this.internal.flash=c.extend({},{id:this.options.idPrefix+"_flash_"+this.count,jq:h,swf:this.options.swfPath+(this.options.swfPath!==""&&this.options.swfPath.slice(-1)!=="/"?"/":"")+"Jplayer.swf"});this.internal.poster=c.extend({},{id:this.options.idPrefix+"_poster_"+this.count,jq:h});c.each(c.jPlayer.event,function(e,g){if(a.options[e]!==h){a.element.bind(g+".jPlayer",a.options[e]);a.options[e]=h}});this.htmlElement.poster=document.createElement("img");this.htmlElement.poster.id=
this.internal.poster.id;this.htmlElement.poster.onload=function(){if(!a.status.video||a.status.waitForPlay)a.internal.poster.jq.show()};this.element.append(this.htmlElement.poster);this.internal.poster.jq=c("#"+this.internal.poster.id);this.internal.poster.jq.css({width:this.status.width,height:this.status.height});this.internal.poster.jq.hide();this.require.audio=false;this.require.video=false;c.each(this.formats,function(e,g){a.require[a.format[g].media]=true});this.html.audio.available=false;if(this.require.audio){this.htmlElement.audio=
document.createElement("audio");this.htmlElement.audio.id=this.internal.audio.id;this.html.audio.available=!!this.htmlElement.audio.canPlayType}this.html.video.available=false;if(this.require.video){this.htmlElement.video=document.createElement("video");this.htmlElement.video.id=this.internal.video.id;this.html.video.available=!!this.htmlElement.video.canPlayType}this.flash.available=this._checkForFlash(10);this.html.canPlay={};this.flash.canPlay={};c.each(this.formats,function(e,g){a.html.canPlay[g]=
a.html[a.format[g].media].available&&""!==a.htmlElement[a.format[g].media].canPlayType(a.format[g].codec);a.flash.canPlay[g]=a.format[g].flashCanPlay&&a.flash.available});this.html.desired=false;this.flash.desired=false;c.each(this.solutions,function(e,g){if(e===0)a[g].desired=true;else{var i=false,j=false;c.each(a.formats,function(n,k){if(a[a.solutions[0]].canPlay[k])if(a.format[k].media==="video")j=true;else i=true});a[g].desired=a.require.audio&&!i||a.require.video&&!j}});this.html.support={};
this.flash.support={};c.each(this.formats,function(e,g){a.html.support[g]=a.html.canPlay[g]&&a.html.desired;a.flash.support[g]=a.flash.canPlay[g]&&a.flash.desired});this.html.used=false;this.flash.used=false;c.each(this.solutions,function(e,g){c.each(a.formats,function(i,j){if(a[g].support[j]){a[g].used=true;return false}})});this.html.used||this.flash.used||this._error({type:c.jPlayer.error.NO_SOLUTION,context:"{solution:'"+this.options.solution+"', supplied:'"+this.options.supplied+"'}",message:c.jPlayer.errorMsg.NO_SOLUTION,
hint:c.jPlayer.errorHint.NO_SOLUTION});this.html.active=false;this.html.audio.gate=false;this.html.video.gate=false;this.flash.active=false;this.flash.gate=false;if(this.flash.used){var b="id="+escape(this.internal.self.id)+"&vol="+this.status.volume+"&muted="+this.status.muted;if(c.browser.msie&&Number(c.browser.version)<=8){var d='<object id="'+this.internal.flash.id+'"';d+=' classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"';d+=' codebase="'+document.URL.substring(0,document.URL.indexOf(":"))+
'://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"';d+=' type="application/x-shockwave-flash"';d+=' width="0" height="0">';d+="</object>";var f=[];f[0]='<param name="movie" value="'+this.internal.flash.swf+'" />';f[1]='<param name="quality" value="high" />';f[2]='<param name="FlashVars" value="'+b+'" />';f[3]='<param name="allowScriptAccess" value="always" />';f[4]='<param name="bgcolor" value="'+this.options.backgroundColor+'" />';b=document.createElement(d);for(d=0;d<f.length;d++)b.appendChild(document.createElement(f[d]));
this.element.append(b)}else{f='<embed name="'+this.internal.flash.id+'" id="'+this.internal.flash.id+'" src="'+this.internal.flash.swf+'"';f+=' width="0" height="0" bgcolor="'+this.options.backgroundColor+'"';f+=' quality="high" FlashVars="'+b+'"';f+=' allowScriptAccess="always"';f+=' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';this.element.append(f)}this.internal.flash.jq=c("#"+this.internal.flash.id);this.internal.flash.jq.css({width:"0px",
height:"0px"})}if(this.html.used){if(this.html.audio.available){this._addHtmlEventListeners(this.htmlElement.audio,this.html.audio);this.element.append(this.htmlElement.audio);this.internal.audio.jq=c("#"+this.internal.audio.id)}if(this.html.video.available){this._addHtmlEventListeners(this.htmlElement.video,this.html.video);this.element.append(this.htmlElement.video);this.internal.video.jq=c("#"+this.internal.video.id);this.internal.video.jq.css({width:"0px",height:"0px"})}}this.html.used&&!this.flash.used&&
window.setTimeout(function(){a.internal.ready=true;a.version.flash="n/a";a._trigger(c.jPlayer.event.ready)},100);c.each(this.options.cssSelector,function(e,g){a._cssSelector(e,g)});this._updateInterface();this._updateButtons(false);this._updateVolume(this.status.volume);this._updateMute(this.status.muted);this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide();c.jPlayer.prototype.count++},destroy:function(){this._resetStatus();this._updateInterface();this._seeked();this.css.jq.currentTime.length&&
this.css.jq.currentTime.text("");this.css.jq.duration.length&&this.css.jq.duration.text("");this.status.srcSet&&this.pause();c.each(this.css.jq,function(a,b){b.unbind(".jPlayer")});this.element.removeData("jPlayer");this.element.unbind(".jPlayer");this.element.empty();this.instances[this.internal.instance]=h},enable:function(){},disable:function(){},_addHtmlEventListeners:function(a,b){var d=this;a.preload=this.options.preload;a.muted=this.options.muted;a.addEventListener("progress",function(){if(b.gate&&
!d.status.waitForLoad){d._getHtmlStatus(a);d._updateInterface();d._trigger(c.jPlayer.event.progress)}},false);a.addEventListener("timeupdate",function(){if(b.gate&&!d.status.waitForLoad){d._getHtmlStatus(a);d._updateInterface();d._trigger(c.jPlayer.event.timeupdate)}},false);a.addEventListener("durationchange",function(){if(b.gate&&!d.status.waitForLoad){d.status.duration=this.duration;d._getHtmlStatus(a);d._updateInterface();d._trigger(c.jPlayer.event.durationchange)}},false);a.addEventListener("play",
function(){if(b.gate&&!d.status.waitForLoad){d._updateButtons(true);d._trigger(c.jPlayer.event.play)}},false);a.addEventListener("playing",function(){if(b.gate&&!d.status.waitForLoad){d._updateButtons(true);d._seeked();d._trigger(c.jPlayer.event.playing)}},false);a.addEventListener("pause",function(){if(b.gate&&!d.status.waitForLoad){d._updateButtons(false);d._trigger(c.jPlayer.event.pause)}},false);a.addEventListener("waiting",function(){if(b.gate&&!d.status.waitForLoad){d._seeking();d._trigger(c.jPlayer.event.waiting)}},
false);a.addEventListener("canplay",function(){if(b.gate&&!d.status.waitForLoad){a.volume=d._volumeFix(d.status.volume);d._trigger(c.jPlayer.event.canplay)}},false);a.addEventListener("seeking",function(){if(b.gate&&!d.status.waitForLoad){d._seeking();d._trigger(c.jPlayer.event.seeking)}},false);a.addEventListener("seeked",function(){if(b.gate&&!d.status.waitForLoad){d._seeked();d._trigger(c.jPlayer.event.seeked)}},false);a.addEventListener("suspend",function(){if(b.gate&&!d.status.waitForLoad){d._seeked();
d._trigger(c.jPlayer.event.suspend)}},false);a.addEventListener("ended",function(){if(b.gate&&!d.status.waitForLoad){if(!c.jPlayer.browser.webkit)d.htmlElement.media.currentTime=0;d.htmlElement.media.pause();d._updateButtons(false);d._getHtmlStatus(a,true);d._updateInterface();d._trigger(c.jPlayer.event.ended)}},false);a.addEventListener("error",function(){if(b.gate&&!d.status.waitForLoad){d._updateButtons(false);d._seeked();if(d.status.srcSet){d.status.waitForLoad=true;d.status.waitForPlay=true;
d.status.video&&d.internal.video.jq.css({width:"0px",height:"0px"});d._validString(d.status.media.poster)&&d.internal.poster.jq.show();d.css.jq.videoPlay.length&&d.css.jq.videoPlay.show();d._error({type:c.jPlayer.error.URL,context:d.status.src,message:c.jPlayer.errorMsg.URL,hint:c.jPlayer.errorHint.URL})}}},false);c.each(c.jPlayer.htmlEvent,function(f,e){a.addEventListener(this,function(){b.gate&&!d.status.waitForLoad&&d._trigger(c.jPlayer.event[e])},false)})},_getHtmlStatus:function(a,b){var d=0,
f=0,e=0,g=0;d=a.currentTime;f=this.status.duration>0?100*d/this.status.duration:0;if(typeof a.seekable==="object"&&a.seekable.length>0){e=this.status.duration>0?100*a.seekable.end(a.seekable.length-1)/this.status.duration:100;g=100*a.currentTime/a.seekable.end(a.seekable.length-1)}else{e=100;g=f}if(b)f=g=d=0;this.status.seekPercent=e;this.status.currentPercentRelative=g;this.status.currentPercentAbsolute=f;this.status.currentTime=d},_resetStatus:function(){this.status=c.extend({},this.status,c.jPlayer.prototype.status)},
_trigger:function(a,b,d){a=c.Event(a);a.jPlayer={};a.jPlayer.version=c.extend({},this.version);a.jPlayer.status=c.extend(true,{},this.status);a.jPlayer.html=c.extend(true,{},this.html);a.jPlayer.flash=c.extend(true,{},this.flash);if(b)a.jPlayer.error=c.extend({},b);if(d)a.jPlayer.warning=c.extend({},d);this.element.trigger(a)},jPlayerFlashEvent:function(a,b){if(a===c.jPlayer.event.ready&&!this.internal.ready){this.internal.ready=true;this.version.flash=b.version;this.version.needFlash!==this.version.flash&&
this._error({type:c.jPlayer.error.VERSION,context:this.version.flash,message:c.jPlayer.errorMsg.VERSION+this.version.flash,hint:c.jPlayer.errorHint.VERSION});this._trigger(a)}if(this.flash.gate)switch(a){case c.jPlayer.event.progress:this._getFlashStatus(b);this._updateInterface();this._trigger(a);break;case c.jPlayer.event.timeupdate:this._getFlashStatus(b);this._updateInterface();this._trigger(a);break;case c.jPlayer.event.play:this._seeked();this._updateButtons(true);this._trigger(a);break;case c.jPlayer.event.pause:this._updateButtons(false);
this._trigger(a);break;case c.jPlayer.event.ended:this._updateButtons(false);this._trigger(a);break;case c.jPlayer.event.error:this.status.waitForLoad=true;this.status.waitForPlay=true;this.status.video&&this.internal.flash.jq.css({width:"0px",height:"0px"});this._validString(this.status.media.poster)&&this.internal.poster.jq.show();this.css.jq.videoPlay.length&&this.css.jq.videoPlay.show();this.status.video?this._flash_setVideo(this.status.media):this._flash_setAudio(this.status.media);this._error({type:c.jPlayer.error.URL,
context:b.src,message:c.jPlayer.errorMsg.URL,hint:c.jPlayer.errorHint.URL});break;case c.jPlayer.event.seeking:this._seeking();this._trigger(a);break;case c.jPlayer.event.seeked:this._seeked();this._trigger(a);break;default:this._trigger(a)}return false},_getFlashStatus:function(a){this.status.seekPercent=a.seekPercent;this.status.currentPercentRelative=a.currentPercentRelative;this.status.currentPercentAbsolute=a.currentPercentAbsolute;this.status.currentTime=a.currentTime;this.status.duration=a.duration},
_updateButtons:function(a){this.status.paused=!a;if(this.css.jq.play.length&&this.css.jq.pause.length)if(a){this.css.jq.play.hide();this.css.jq.pause.show()}else{this.css.jq.play.show();this.css.jq.pause.hide()}},_updateInterface:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.width(this.status.seekPercent+"%");this.css.jq.playBar.length&&this.css.jq.playBar.width(this.status.currentPercentRelative+"%");this.css.jq.currentTime.length&&this.css.jq.currentTime.text(c.jPlayer.convertTime(this.status.currentTime));
this.css.jq.duration.length&&this.css.jq.duration.text(c.jPlayer.convertTime(this.status.duration))},_seeking:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.addClass("jp-seeking-bg")},_seeked:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.removeClass("jp-seeking-bg")},setMedia:function(a){var b=this;this._seeked();clearTimeout(this.internal.htmlDlyCmdId);var d=this.html.audio.gate,f=this.html.video.gate,e=false;c.each(this.formats,function(g,i){var j=b.format[i].media==="video";
c.each(b.solutions,function(n,k){if(b[k].support[i]&&b._validString(a[i])){var l=k==="html";if(j)if(l){b.html.audio.gate=false;b.html.video.gate=true;b.flash.gate=false}else{b.html.audio.gate=false;b.html.video.gate=false;b.flash.gate=true}else if(l){b.html.audio.gate=true;b.html.video.gate=false;b.flash.gate=false}else{b.html.audio.gate=false;b.html.video.gate=false;b.flash.gate=true}if(b.flash.active||b.html.active&&b.flash.gate||d===b.html.audio.gate&&f===b.html.video.gate)b.clearMedia();else if(d!==
b.html.audio.gate&&f!==b.html.video.gate){b._html_pause();b.status.video&&b.internal.video.jq.css({width:"0px",height:"0px"});b._resetStatus()}if(j){if(l){b._html_setVideo(a);b.html.active=true;b.flash.active=false}else{b._flash_setVideo(a);b.html.active=false;b.flash.active=true}b.css.jq.videoPlay.length&&b.css.jq.videoPlay.show();b.status.video=true}else{if(l){b._html_setAudio(a);b.html.active=true;b.flash.active=false}else{b._flash_setAudio(a);b.html.active=false;b.flash.active=true}b.css.jq.videoPlay.length&&
b.css.jq.videoPlay.hide();b.status.video=false}e=true;return false}});if(e)return false});if(e){if(this._validString(a.poster))if(this.htmlElement.poster.src!==a.poster)this.htmlElement.poster.src=a.poster;else this.internal.poster.jq.show();else this.internal.poster.jq.hide();this.status.srcSet=true;this.status.media=c.extend({},a);this._updateButtons(false);this._updateInterface()}else{this.status.srcSet&&!this.status.waitForPlay&&this.pause();this.html.audio.gate=false;this.html.video.gate=false;
this.flash.gate=false;this.html.active=false;this.flash.active=false;this._resetStatus();this._updateInterface();this._updateButtons(false);this.internal.poster.jq.hide();this.html.used&&this.require.video&&this.internal.video.jq.css({width:"0px",height:"0px"});this.flash.used&&this.internal.flash.jq.css({width:"0px",height:"0px"});this._error({type:c.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:c.jPlayer.errorMsg.NO_SUPPORT,hint:c.jPlayer.errorHint.NO_SUPPORT})}},
clearMedia:function(){this._resetStatus();this._updateButtons(false);this.internal.poster.jq.hide();clearTimeout(this.internal.htmlDlyCmdId);if(this.html.active)this._html_clearMedia();else this.flash.active&&this._flash_clearMedia()},load:function(){if(this.status.srcSet)if(this.html.active)this._html_load();else this.flash.active&&this._flash_load();else this._urlNotSetError("load")},play:function(a){a=typeof a==="number"?a:NaN;if(this.status.srcSet)if(this.html.active)this._html_play(a);else this.flash.active&&
this._flash_play(a);else this._urlNotSetError("play")},videoPlay:function(){this.play()},pause:function(a){a=typeof a==="number"?a:NaN;if(this.status.srcSet)if(this.html.active)this._html_pause(a);else this.flash.active&&this._flash_pause(a);else this._urlNotSetError("pause")},pauseOthers:function(){var a=this;c.each(this.instances,function(b,d){a.element!==d&&d.data("jPlayer").status.srcSet&&d.jPlayer("pause")})},stop:function(){if(this.status.srcSet)if(this.html.active)this._html_pause(0);else this.flash.active&&
this._flash_pause(0);else this._urlNotSetError("stop")},playHead:function(a){a=this._limitValue(a,0,100);if(this.status.srcSet)if(this.html.active)this._html_playHead(a);else this.flash.active&&this._flash_playHead(a);else this._urlNotSetError("playHead")},mute:function(){this.status.muted=true;this.html.used&&this._html_mute(true);this.flash.used&&this._flash_mute(true);this._updateMute(true);this._updateVolume(0);this._trigger(c.jPlayer.event.volumechange)},unmute:function(){this.status.muted=false;
this.html.used&&this._html_mute(false);this.flash.used&&this._flash_mute(false);this._updateMute(false);this._updateVolume(this.status.volume);this._trigger(c.jPlayer.event.volumechange)},_updateMute:function(a){if(this.css.jq.mute.length&&this.css.jq.unmute.length)if(a){this.css.jq.mute.hide();this.css.jq.unmute.show()}else{this.css.jq.mute.show();this.css.jq.unmute.hide()}},volume:function(a){a=this._limitValue(a,0,1);this.status.volume=a;this.html.used&&this._html_volume(a);this.flash.used&&this._flash_volume(a);
this.status.muted||this._updateVolume(a);this._trigger(c.jPlayer.event.volumechange)},volumeBar:function(a){if(!this.status.muted&&this.css.jq.volumeBar){var b=this.css.jq.volumeBar.offset();a=a.pageX-b.left;b=this.css.jq.volumeBar.width();this.volume(a/b)}},volumeBarValue:function(a){this.volumeBar(a)},_updateVolume:function(a){this.css.jq.volumeBarValue.length&&this.css.jq.volumeBarValue.width(a*100+"%")},_volumeFix:function(a){var b=0.0010*Math.random();return a+(a<0.5?b:-b)},_cssSelectorAncestor:function(a,
b){this.options.cssSelectorAncestor=a;b&&c.each(this.options.cssSelector,function(d,f){self._cssSelector(d,f)})},_cssSelector:function(a,b){var d=this;if(typeof b==="string")if(c.jPlayer.prototype.options.cssSelector[a]){this.css.jq[a]&&this.css.jq[a].length&&this.css.jq[a].unbind(".jPlayer");this.options.cssSelector[a]=b;this.css.cs[a]=this.options.cssSelectorAncestor+" "+b;this.css.jq[a]=b?c(this.css.cs[a]):[];this.css.jq[a].length&&this.css.jq[a].bind("click.jPlayer",function(f){d[a](f);c(this).blur();
return false});b&&this.css.jq[a].length!==1&&this._warning({type:c.jPlayer.warning.CSS_SELECTOR_COUNT,context:this.css.cs[a],message:c.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.css.jq[a].length+" found for "+a+" method.",hint:c.jPlayer.warningHint.CSS_SELECTOR_COUNT})}else this._warning({type:c.jPlayer.warning.CSS_SELECTOR_METHOD,context:a,message:c.jPlayer.warningMsg.CSS_SELECTOR_METHOD,hint:c.jPlayer.warningHint.CSS_SELECTOR_METHOD});else this._warning({type:c.jPlayer.warning.CSS_SELECTOR_STRING,
context:b,message:c.jPlayer.warningMsg.CSS_SELECTOR_STRING,hint:c.jPlayer.warningHint.CSS_SELECTOR_STRING})},seekBar:function(a){if(this.css.jq.seekBar){var b=this.css.jq.seekBar.offset();a=a.pageX-b.left;b=this.css.jq.seekBar.width();this.playHead(100*a/b)}},playBar:function(a){this.seekBar(a)},currentTime:function(){},duration:function(){},option:function(a,b){var d=a;if(arguments.length===0)return c.extend(true,{},this.options);if(typeof a==="string"){var f=a.split(".");if(b===h){for(var e=c.extend(true,
{},this.options),g=0;g<f.length;g++)if(e[f[g]]!==h)e=e[f[g]];else{this._warning({type:c.jPlayer.warning.OPTION_KEY,context:a,message:c.jPlayer.warningMsg.OPTION_KEY,hint:c.jPlayer.warningHint.OPTION_KEY});return h}return e}e=d={};for(g=0;g<f.length;g++)if(g<f.length-1){e[f[g]]={};e=e[f[g]]}else e[f[g]]=b}this._setOptions(d);return this},_setOptions:function(a){var b=this;c.each(a,function(d,f){b._setOption(d,f)});return this},_setOption:function(a,b){var d=this;switch(a){case "cssSelectorAncestor":this.options[a]=
b;c.each(d.options.cssSelector,function(f,e){d._cssSelector(f,e)});break;case "cssSelector":c.each(b,function(f,e){d._cssSelector(f,e)})}return this},resize:function(a){this.html.active&&this._resizeHtml(a);this.flash.active&&this._resizeFlash(a);this._trigger(c.jPlayer.event.resize)},_resizePoster:function(){},_resizeHtml:function(){},_resizeFlash:function(a){this.internal.flash.jq.css({width:a.width,height:a.height})},_html_initMedia:function(){this.status.srcSet&&!this.status.waitForPlay&&this.htmlElement.media.pause();
this.options.preload!=="none"&&this._html_load();this._trigger(c.jPlayer.event.timeupdate)},_html_setAudio:function(a){var b=this;c.each(this.formats,function(d,f){if(b.html.support[f]&&a[f]){b.status.src=a[f];b.status.format[f]=true;b.status.formatType=f;return false}});this.htmlElement.media=this.htmlElement.audio;this._html_initMedia()},_html_setVideo:function(a){var b=this;c.each(this.formats,function(d,f){if(b.html.support[f]&&a[f]){b.status.src=a[f];b.status.format[f]=true;b.status.formatType=
f;return false}});this.htmlElement.media=this.htmlElement.video;this._html_initMedia()},_html_clearMedia:function(){if(this.htmlElement.media){this.htmlElement.media.id===this.internal.video.id&&this.internal.video.jq.css({width:"0px",height:"0px"});this.htmlElement.media.pause();this.htmlElement.media.src="";c.browser.msie&&Number(c.browser.version)>=9||this.htmlElement.media.load()}},_html_load:function(){if(this.status.waitForLoad){this.status.waitForLoad=false;this.htmlElement.media.src=this.status.src;
try{this.htmlElement.media.load()}catch(a){}}clearTimeout(this.internal.htmlDlyCmdId)},_html_play:function(a){var b=this;this._html_load();this.htmlElement.media.play();if(!isNaN(a))try{this.htmlElement.media.currentTime=a}catch(d){this.internal.htmlDlyCmdId=setTimeout(function(){b.play(a)},100);return}this._html_checkWaitForPlay()},_html_pause:function(a){var b=this;a>0?this._html_load():clearTimeout(this.internal.htmlDlyCmdId);this.htmlElement.media.pause();if(!isNaN(a))try{this.htmlElement.media.currentTime=
a}catch(d){this.internal.htmlDlyCmdId=setTimeout(function(){b.pause(a)},100);return}a>0&&this._html_checkWaitForPlay()},_html_playHead:function(a){var b=this;this._html_load();try{if(typeof this.htmlElement.media.seekable==="object"&&this.htmlElement.media.seekable.length>0)this.htmlElement.media.currentTime=a*this.htmlElement.media.seekable.end(this.htmlElement.media.seekable.length-1)/100;else if(this.htmlElement.media.duration>0&&!isNaN(this.htmlElement.media.duration))this.htmlElement.media.currentTime=
a*this.htmlElement.media.duration/100;else throw"e";}catch(d){this.internal.htmlDlyCmdId=setTimeout(function(){b.playHead(a)},100);return}this.status.waitForLoad||this._html_checkWaitForPlay()},_html_checkWaitForPlay:function(){if(this.status.waitForPlay){this.status.waitForPlay=false;this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide();if(this.status.video){this.internal.poster.jq.hide();this.internal.video.jq.css({width:this.status.width,height:this.status.height})}}},_html_volume:function(a){if(this.html.audio.available)this.htmlElement.audio.volume=
a;if(this.html.video.available)this.htmlElement.video.volume=a},_html_mute:function(a){if(this.html.audio.available)this.htmlElement.audio.muted=a;if(this.html.video.available)this.htmlElement.video.muted=a},_flash_setAudio:function(a){var b=this;try{c.each(this.formats,function(f,e){if(b.flash.support[e]&&a[e]){switch(e){case "m4a":b._getMovie().fl_setAudio_m4a(a[e]);break;case "mp3":b._getMovie().fl_setAudio_mp3(a[e])}b.status.src=a[e];b.status.format[e]=true;b.status.formatType=e;return false}});
if(this.options.preload==="auto"){this._flash_load();this.status.waitForLoad=false}}catch(d){this._flashError(d)}},_flash_setVideo:function(a){var b=this;try{c.each(this.formats,function(f,e){if(b.flash.support[e]&&a[e]){switch(e){case "m4v":b._getMovie().fl_setVideo_m4v(a[e])}b.status.src=a[e];b.status.format[e]=true;b.status.formatType=e;return false}});if(this.options.preload==="auto"){this._flash_load();this.status.waitForLoad=false}}catch(d){this._flashError(d)}},_flash_clearMedia:function(){this.internal.flash.jq.css({width:"0px",
height:"0px"});try{this._getMovie().fl_clearMedia()}catch(a){this._flashError(a)}},_flash_load:function(){try{this._getMovie().fl_load()}catch(a){this._flashError(a)}this.status.waitForLoad=false},_flash_play:function(a){try{this._getMovie().fl_play(a)}catch(b){this._flashError(b)}this.status.waitForLoad=false;this._flash_checkWaitForPlay()},_flash_pause:function(a){try{this._getMovie().fl_pause(a)}catch(b){this._flashError(b)}if(a>0){this.status.waitForLoad=false;this._flash_checkWaitForPlay()}},
_flash_playHead:function(a){try{this._getMovie().fl_play_head(a)}catch(b){this._flashError(b)}this.status.waitForLoad||this._flash_checkWaitForPlay()},_flash_checkWaitForPlay:function(){if(this.status.waitForPlay){this.status.waitForPlay=false;this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide();if(this.status.video){this.internal.poster.jq.hide();this.internal.flash.jq.css({width:this.status.width,height:this.status.height})}}},_flash_volume:function(a){try{this._getMovie().fl_volume(a)}catch(b){this._flashError(b)}},
_flash_mute:function(a){try{this._getMovie().fl_mute(a)}catch(b){this._flashError(b)}},_getMovie:function(){return document[this.internal.flash.id]},_checkForFlash:function(a){var b=false,d;if(window.ActiveXObject)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+a);b=true}catch(f){}else if(navigator.plugins&&navigator.mimeTypes.length>0)if(d=navigator.plugins["Shockwave Flash"])if(navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/,"$1")>=a)b=true;return c.browser.msie&&
Number(c.browser.version)>=9?false:b},_validString:function(a){return a&&typeof a==="string"},_limitValue:function(a,b,d){return a<b?b:a>d?d:a},_urlNotSetError:function(a){this._error({type:c.jPlayer.error.URL_NOT_SET,context:a,message:c.jPlayer.errorMsg.URL_NOT_SET,hint:c.jPlayer.errorHint.URL_NOT_SET})},_flashError:function(a){this._error({type:c.jPlayer.error.FLASH,context:this.internal.flash.swf,message:c.jPlayer.errorMsg.FLASH+a.message,hint:c.jPlayer.errorHint.FLASH})},_error:function(a){this._trigger(c.jPlayer.event.error,
a);if(this.options.errorAlerts)this._alert("Error!"+(a.message?"\n\n"+a.message:"")+(a.hint?"\n\n"+a.hint:"")+"\n\nContext: "+a.context)},_warning:function(a){this._trigger(c.jPlayer.event.warning,h,a);if(this.options.errorAlerts)this._alert("Warning!"+(a.message?"\n\n"+a.message:"")+(a.hint?"\n\n"+a.hint:"")+"\n\nContext: "+a.context)},_alert:function(a){alert("jPlayer "+this.version.script+" : id='"+this.internal.self.id+"' : "+a)}};c.jPlayer.error={FLASH:"e_flash",NO_SOLUTION:"e_no_solution",NO_SUPPORT:"e_no_support",
URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"};c.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",
VERSION:"jPlayer "+c.jPlayer.prototype.version.script+" needs Jplayer.swf version "+c.jPlayer.prototype.version.needFlash+" but found "};c.jPlayer.errorHint={FLASH:"Check your swfPath option and that Jplayer.swf is there.",NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."};c.jPlayer.warning=
{CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"};c.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of methodCssSelectors found did not equal one: ",CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",OPTION_KEY:"The option requested in jPlayer('option') is undefined."};
c.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."}})(jQuery);
/**
* Unobtrusive scripting adapter for jQuery
*
* Requires jQuery 1.4.4 or later.
* https://github.com/rails/jquery-ujs
* Uploading file using rails.js
* =============================
*
* By default, browsers do not allow files to be uploaded via AJAX. As a result, if there are any non-blank file fields
* in the remote form, this adapter aborts the AJAX submission and allows the form to submit through standard means.
*
* The `ajax:aborted:file` event allows you to bind your own handler to process the form submission however you wish.
*
* Ex:
* $('form').live('ajax:aborted:file', function(event, elements){
* // Implement own remote file-transfer handler here for non-blank file inputs passed in `elements`.
* // Returning false in this handler tells rails.js to disallow standard form submission
* return false;
* });
*
* The `ajax:aborted:file` event is fired when a file-type input is detected with a non-blank value.
*
* Third-party tools can use this hook to detect when an AJAX file upload is attempted, and then use
* techniques like the iframe method to upload the file instead.
*
* Required fields in rails.js
* ===========================
*
* If any blank required inputs (required="required") are detected in the remote form, the whole form submission
* is canceled. Note that this is unlike file inputs, which still allow standard (non-AJAX) form submission.
*
* The `ajax:aborted:required` event allows you to bind your own handler to inform the user of blank required inputs.
*
* !! Note that Opera does not fire the form's submit event if there are blank required inputs, so this event may never
* get fired in Opera. This event is what causes other browsers to exhibit the same submit-aborting behavior.
*
* Ex:
* $('form').live('ajax:aborted:required', function(event, elements){
* // Returning false in this handler tells rails.js to submit the form anyway.
* // The blank required inputs are passed to this function in `elements`.
* return ! confirm("Would you like to submit the form with missing info?");
* });
*/
(function($, undefined) {
// Shorthand to make it a little easier to call public rails functions from within rails.js
var rails;
$.rails = rails = {
// Link elements bound by jquery-ujs
linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]',
// Form elements bound by jquery-ujs
formSubmitSelector: 'form',
// Form input elements bound by jquery-ujs
formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not([type])',
// Form input elements disabled during form submission
disableSelector: 'input[data-disable-with], button[data-disable-with], textarea[data-disable-with]',
// Form input elements re-enabled after form submission
enableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled',
// Form required input elements
requiredInputSelector: 'input[name][required]:not([disabled]),textarea[name][required]:not([disabled])',
// Form file input elements
fileInputSelector: 'input:file',
// Make sure that every Ajax request sends the CSRF token
CSRFProtection: function(xhr) {
var token = $('meta[name="csrf-token"]').attr('content');
if (token) xhr.setRequestHeader('X-CSRF-Token', token);
},
// Triggers an event on an element and returns false if the event result is false
fire: function(obj, name, data) {
var event = $.Event(name);
obj.trigger(event, data);
return event.result !== false;
},
// Default confirm dialog, may be overridden with custom confirm dialog in $.rails.confirm
confirm: function(message) {
return confirm(message);
},
// Default ajax function, may be overridden with custom function in $.rails.ajax
ajax: function(options) {
return $.ajax(options);
},
// Submits "remote" forms and links with ajax
handleRemote: function(element) {
var method, url, data,
crossDomain = element.data('cross-domain') || null,
dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType);
if (rails.fire(element, 'ajax:before')) {
if (element.is('form')) {
method = element.attr('method');
url = element.attr('action');
data = element.serializeArray();
// memoized value from clicked submit button
var button = element.data('ujs:submit-button');
if (button) {
data.push(button);
element.data('ujs:submit-button', null);
}
} else {
method = element.data('method');
url = element.attr('href');
data = element.data('params') || null;
}
rails.ajax({
url: url, type: method || 'GET', data: data, dataType: dataType, crossDomain: crossDomain,
// stopping the "ajax:beforeSend" event will cancel the ajax request
beforeSend: function(xhr, settings) {
if (settings.dataType === undefined) {
xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
}
element.trigger('ajax:loading', [xhr]);
return rails.fire(element, 'ajax:beforeSend', [xhr, settings]);
},
success: function(data, status, xhr) {
element.trigger('ajax:success', [data, status, xhr]);
var patUsers = "users";
var patPrograms = "programs";
var patVolunteers = "volunteers";
var patNewPlaylists = "playlists/new/search";
var patReviews = "reviews";
if ((url.match(/\d$/) && url.match(patUsers)) || (url.match(/\d$/) && url.match(patPrograms)) || (url.match(/\d$/) && url.match(patVolunteers)) || (url.match(patNewPlaylists)) ){
}else{
$.address.value(url);
}
},
complete: function(xhr, status) {
element.trigger('ajax:complete', [xhr, status]);
},
error: function(xhr, status, error) {
element.trigger('ajax:error', [xhr, status, error]);
}
});
}
},
// Handles "data-method" on links such as:
// <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a>
handleMethod: function(link) {
var href = link.attr('href'),
method = link.data('method'),
csrf_token = $('meta[name=csrf-token]').attr('content'),
csrf_param = $('meta[name=csrf-param]').attr('content'),
form = $('<form method="post" action="' + href + '"></form>'),
metadata_input = '<input name="_method" value="' + method + '" type="hidden" />';
if (csrf_param !== undefined && csrf_token !== undefined) {
metadata_input += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />';
}
form.hide().append(metadata_input).appendTo('body');
form.submit();
},
/* Disables form elements:
- Caches element value in 'ujs:enable-with' data store
- Replaces element text with value of 'data-disable-with' attribute
- Adds disabled=disabled attribute
*/
disableFormElements: function(form) {
form.find(rails.disableSelector).each(function() {
var element = $(this), method = element.is('button') ? 'html' : 'val';
element.data('ujs:enable-with', element[method]());
element[method](element.data('disable-with'));
element.attr('disabled', 'disabled');
});
},
/* Re-enables disabled form elements:
- Replaces element text with cached value from 'ujs:enable-with' data store (created in `disableFormElements`)
- Removes disabled attribute
*/
enableFormElements: function(form) {
form.find(rails.enableSelector).each(function() {
var element = $(this), method = element.is('button') ? 'html' : 'val';
if (element.data('ujs:enable-with')) element[method](element.data('ujs:enable-with'));
element.removeAttr('disabled');
});
},
/* For 'data-confirm' attribute:
- Fires `confirm` event
- Shows the confirmation dialog
- Fires the `confirm:complete` event
Returns `true` if no function stops the chain and user chose yes; `false` otherwise.
Attaching a handler to the element's `confirm` event that returns a `falsy` value cancels the confirmation dialog.
Attaching a handler to the element's `confirm:complete` event that returns a `falsy` value makes this function
return false. The `confirm:complete` event is fired whether or not the user answered true or false to the dialog.
*/
allowAction: function(element) {
var message = element.data('confirm'),
answer = false, callback;
if (!message) { return true; }
if (rails.fire(element, 'confirm')) {
answer = rails.confirm(message);
callback = rails.fire(element, 'confirm:complete', [answer]);
}
return answer && callback;
},
// Helper function which checks for blank inputs in a form that match the specified CSS selector
blankInputs: function(form, specifiedSelector, nonBlank) {
var inputs = $(), input,
selector = specifiedSelector || 'input,textarea';
form.find(selector).each(function() {
input = $(this);
// Collect non-blank inputs if nonBlank option is true, otherwise, collect blank inputs
if (nonBlank ? input.val() : !input.val()) {
inputs = inputs.add(input);
}
});
return inputs.length ? inputs : false;
},
// Helper function which checks for non-blank inputs in a form that match the specified CSS selector
nonBlankInputs: function(form, specifiedSelector) {
return rails.blankInputs(form, specifiedSelector, true); // true specifies nonBlank
},
// Helper function, needed to provide consistent behavior in IE
stopEverything: function(e) {
$(e.target).trigger('ujs:everythingStopped');
e.stopImmediatePropagation();
return false;
},
// find all the submit events directly bound to the form and
// manually invoke them. If anyone returns false then stop the loop
callFormSubmitBindings: function(form) {
var events = form.data('events'), continuePropagation = true;
if (events !== undefined && events['submit'] !== undefined) {
$.each(events['submit'], function(i, obj){
if (typeof obj.handler === 'function') return continuePropagation = obj.handler(obj.data);
});
}
return continuePropagation;
}
};
// ajaxPrefilter is a jQuery 1.5 feature
if ('ajaxPrefilter' in $) {
$.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }});
} else {
$(document).ajaxSend(function(e, xhr, options){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }});
}
$(rails.linkClickSelector).live('click.rails', function(e) {
var link = $(this);
if (!rails.allowAction(link)) return rails.stopEverything(e);
if (link.data('remote') !== undefined) {
rails.handleRemote(link);
return false;
} else if (link.data('method')) {
rails.handleMethod(link);
return false;
}
});
$(rails.formSubmitSelector).live('submit.rails', function(e) {
var form = $(this),
remote = form.data('remote') !== undefined,
blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector),
nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector);
if (!rails.allowAction(form)) return rails.stopEverything(e);
// skip other logic when required values are missing or file upload is present
if (blankRequiredInputs && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) {
return rails.stopEverything(e);
}
if (remote) {
if (nonBlankFileInputs) {
return rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]);
}
// If browser does not support submit bubbling, then this live-binding will be called before direct
// bindings. Therefore, we should directly call any direct bindings before remotely submitting form.
if (!$.support.submitBubbles && rails.callFormSubmitBindings(form) === false) return rails.stopEverything(e);
rails.handleRemote(form);
return false;
} else {
// slight timeout so that the submit button gets properly serialized
setTimeout(function(){ rails.disableFormElements(form); }, 13);
}
});
$(rails.formInputClickSelector).live('click.rails', function(event) {
var button = $(this);
if (!rails.allowAction(button)) return rails.stopEverything(event);
// register the pressed submit button
var name = button.attr('name'),
data = name ? {name:name, value:button.val()} : null;
button.closest('form').data('ujs:submit-button', data);
});
$(rails.formSubmitSelector).live('ajax:beforeSend.rails', function(event) {
if (this == event.target) rails.disableFormElements($(this));
});
$(rails.formSubmitSelector).live('ajax:complete.rails', function(event) {
if (this == event.target) rails.enableFormElements($(this));
});
})( jQuery );
// =======================================================================
// PageLess - endless page
//
// Pageless is a jQuery plugin.
// As you scroll down you see more results coming back at you automatically.
// It provides an automatic pagination in an accessible way : if javascript
// is disabled your standard pagination is supposed to work.
//
// Licensed under the MIT:
// http://www.opensource.org/licenses/mit-license.php
//
// Parameters:
// currentPage: current page (params[:page])
// distance: distance to the end of page in px when ajax query is fired
// loader: selector of the loader div (ajax activity indicator)
// loaderHtml: html code of the div if loader not used
// loaderImage: image inside the loader
// loaderMsg: displayed ajax message
// pagination: selector of the paginator divs.
// if javascript is disabled paginator is provided
// params: paramaters for the ajax query, you can pass auth_token here
// totalPages: total number of pages
// url: URL used to request more data
//
// Callback Parameters:
// scrape: A function to modify the incoming data.
// complete: A function to call when a new page has been loaded (optional)
// end: A function to call when the last page has been loaded (optional)
//
// Usage:
// $('#results').pageless({ totalPages: 10
// , url: '/articles/'
// , loaderMsg: 'Loading more results'
// });
//
// Requires: jquery
//
// Author: Jean-Sébastien Ney (https://github.com/jney)
//
// Contributors:
// Alexander Lang (https://github.com/langalex)
// Lukas Rieder (https://github.com/Overbryd)
//
// Thanks to:
// * codemonky.com/post/34940898
// * www.unspace.ca/discover/pageless/
// * famspam.com/facebox
// =======================================================================
(function($) {
var FALSE = !1
, TRUE = !FALSE
, element
, isLoading = FALSE
, loader
, namespace = '.pageless'
, SCROLL = 'scroll' + namespace
, RESIZE = 'resize' + namespace
, settings = { container: window
, currentPage: 1
, distance: 100
, loadHidden: false
, pagination: '.pagination'
, params: {}
, url: location.href
, loaderImage: "/images/load.gif"
}
, container
, $container;
$.pageless = function(opts) {
$.isFunction(opts) ? settings.call() : init(opts);
};
var loaderHtml = function () {
return settings.loaderHtml || '\
<div id="pageless-loader" style="display:none;text-align:center;width:100%;">\
<div class="msg" style="color:#696969;font-size:2em"></div>\
<img src="' + settings.loaderImage + '" alt="loading more results" style="margin:10px auto" />\
</div>';
};
// settings params: totalPages
var init = function (opts) {
if (settings.inited) return;
settings.inited = TRUE;
if (opts) $.extend(settings, opts);
container = settings.container;
$container = $(container);
// for accessibility we can keep pagination links
// but since we have javascript enabled we remove pagination links
if(settings.pagination) $(settings.pagination).remove();
// start the listener
startListener();
};
$.fn.pageless = function (opts) {
var $el = $(this)
, $loader = $(opts.loader, $el);
init(opts);
element = $el;
// loader element
if (opts.loader && $loader.length) {
loader = $loader;
} else {
loader = $(loaderHtml());
$el.append(loader);
// if we use the default loader, set the message
if (!opts.loaderHtml) {
$('#pageless-loader .msg').html(opts.loaderMsg);
}
}
};
//
var loading = function (bool) {
(isLoading = bool)
? (loader && loader.fadeIn('normal'))
: (loader && loader.fadeOut('normal'));
};
// distance to end of the container
var distanceToBottom = function () {
return (container === window)
? $(document).height()
- $container.scrollTop()
- $container.height()
: $container[0].scrollHeight
- $container.scrollTop()
- $container.height();
};
var stopListener = function() {
$container.unbind(namespace);
};
// * bind a scroll event
// * trigger is once in case of reload
var startListener = function() {
$container.bind(SCROLL+' '+RESIZE, watch)
.trigger(SCROLL);
};
var watch = function() {
// listener was stopped or we've run out of pages
if (settings.totalPages <= settings.currentPage) {
stopListener();
// if there is a afterStopListener callback we call it
if (settings.end) settings.end.call();
return;
}
// check to see if element is hidden before loading
if (!settings.loadHidden){
var elVisible = $(element).is(":visible");
}else{
var elVisible = true
}
// if slider past our scroll offset, then fire a request for more data
if(!isLoading && elVisible && (distanceToBottom() < settings.distance)) {
loading(TRUE);
// move to next page
settings.currentPage++;
// set up ajax query params
$.extend( settings.params
, { page: settings.currentPage });
// finally ajax query
$.get( settings.url
, settings.params
, function (data) {
$.isFunction(settings.scrape) ? settings.scrape(data) : data;
loader ? loader.before(data) : element.append(data);
loading(FALSE);
// if there is a complete callback we call it
if (settings.complete) settings.complete.call();
}, 'html');
}
};
})(jQuery);
/**
* jQuery lightBox plugin
* This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
* and adapted to me for use like a plugin from jQuery.
* @name jquery-lightbox-0.5.js
* @author Leandro Vieira Pinho - http://leandrovieira.com
* @version 0.5
* @date April 11, 2008
* @category jQuery plugin
* @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
* @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US
* @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
*/
// Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias
(function($) {
/**
* $ is an alias to jQuery object
*
*/
$.fn.lightBox = function(settings) {
// Settings to configure the jQuery lightBox plugin how you like
settings = jQuery.extend({
// Configuration related to overlay
overlayBgColor: '#000', // (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color.
overlayOpacity: 0.8, // (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9
// Configuration related to navigation
fixedNavigation: false, // (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
// Configuration related to images
imageLoading: '/images/lightbox-ico-loading.gif', // (string) Path and the name of the loading icon
imageBtnPrev: '/images/lightbox-btn-prev.gif', // (string) Path and the name of the prev button image
imageBtnNext: '/images/lightbox-btn-next.gif', // (string) Path and the name of the next button image
imageBtnClose: '/images/lightbox-btn-close.gif', // (string) Path and the name of the close btn
imageBlank: '/images/lightbox-blank.gif', // (string) Path and the name of a blank image (one pixel)
// Configuration related to container image box
containerBorderSize: 10, // (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value
containerResizeSpeed: 400, // (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.
// Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts.
txtImage: 'Image', // (string) Specify text "Image"
txtOf: 'of', // (string) Specify text "of"
// Configuration related to keyboard navigation
keyToClose: 'c', // (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to.
keyToPrev: 'p', // (string) (p = previous) Letter to show the previous image
keyToNext: 'n', // (string) (n = next) Letter to show the next image.
// Don´t alter these variables in any way
imageArray: [],
activeImage: 0
},settings);
// Caching the jQuery object with all elements matched
var jQueryMatchedObj = this; // This, in this context, refer to jQuery object
/**
* Initializing the plugin calling the start function
*
* @return boolean false
*/
function _initialize() {
_start(this,jQueryMatchedObj); // This, in this context, refer to object (link) which the user have clicked
return false; // Avoid the browser following the link
}
/**
* Start the jQuery lightBox plugin
*
* @param object objClicked The object (link) whick the user have clicked
* @param object jQueryMatchedObj The jQuery object with all elements matched
*/
function _start(objClicked,jQueryMatchedObj) {
// Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
$('embed, object, select').css({ 'visibility' : 'hidden' });
// Call the function to create the markup structure; style some elements; assign events in some elements.
_set_interface();
// Unset total images in imageArray
settings.imageArray.length = 0;
// Unset image active information
settings.activeImage = 0;
// We have an image set? Or just an image? Let´s see it.
if ( jQueryMatchedObj.length == 1 ) {
settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));
} else {
// Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references
for ( var i = 0; i < jQueryMatchedObj.length; i++ ) {
settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));
}
}
while ( settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href') ) {
settings.activeImage++;
}
// Call the function that prepares image exibition
_set_image_to_view();
}
/**
* Create the jQuery lightBox plugin interface
*
* The HTML markup will be like that:
<div id="jquery-overlay"></div>
<div id="jquery-lightbox">
<div id="lightbox-container-image-box">
<div id="lightbox-container-image">
<img src="../fotos/XX.jpg" id="lightbox-image">
<div id="lightbox-nav">
<a href="#" id="lightbox-nav-btnPrev"></a>
<a href="#" id="lightbox-nav-btnNext"></a>
</div>
<div id="lightbox-loading">
<a href="#" id="lightbox-loading-link">
<img src="../images/lightbox-ico-loading.gif">
</a>
</div>
</div>
</div>
<div id="lightbox-container-image-data-box">
<div id="lightbox-container-image-data">
<div id="lightbox-image-details">
<span id="lightbox-image-details-caption"></span>
<span id="lightbox-image-details-currentNumber"></span>
</div>
<div id="lightbox-secNav">
<a href="#" id="lightbox-secNav-btnClose">
<img src="../images/lightbox-btn-close.gif">
</a>
</div>
</div>
</div>
</div>
*
*/
function _set_interface() {
// Apply the HTML markup into body tag
$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="' + settings.imageBtnClose + '"></a></div></div></div></div>');
// Get page sizes
var arrPageSizes = ___getPageSize();
// Style overlay and show it
$('#jquery-overlay').css({
backgroundColor: settings.overlayBgColor,
opacity: settings.overlayOpacity,
width: arrPageSizes[0],
height: arrPageSizes[1]
}).fadeIn();
// Get page scroll
var arrPageScroll = ___getPageScroll();
// Calculate top and left offset for the jquery-lightbox div object and show it
$('#jquery-lightbox').css({
top: arrPageScroll[1] + (arrPageSizes[3] / 10),
left: arrPageScroll[0]
}).show();
// Assigning click events in elements to close overlay
$('#jquery-overlay,#jquery-lightbox').click(function() {
_finish();
});
// Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects
$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() {
_finish();
return false;
});
// If window was resized, calculate the new overlay dimensions
$(window).resize(function() {
// Get page sizes
var arrPageSizes = ___getPageSize();
// Style overlay and show it
$('#jquery-overlay').css({
width: arrPageSizes[0],
height: arrPageSizes[1]
});
// Get page scroll
var arrPageScroll = ___getPageScroll();
// Calculate top and left offset for the jquery-lightbox div object and show it
$('#jquery-lightbox').css({
top: arrPageScroll[1] + (arrPageSizes[3] / 10),
left: arrPageScroll[0]
});
});
}
/**
* Prepares image exibition; doing a image´s preloader to calculate it´s size
*
*/
function _set_image_to_view() { // show the loading
// Show the loading
$('#lightbox-loading').show();
if ( settings.fixedNavigation ) {
$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
} else {
// Hide some elements
$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
}
// Image preload process
var objImagePreloader = new Image();
objImagePreloader.onload = function() {
$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);
// Perfomance an effect in the image container resizing it
_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);
// clear onLoad, IE behaves irratically with animated gifs otherwise
objImagePreloader.onload=function(){};
};
objImagePreloader.src = settings.imageArray[settings.activeImage][0];
};
/**
* Perfomance an effect in the image container resizing it
*
* @param integer intImageWidth The image´s width that will be showed
* @param integer intImageHeight The image´s height that will be showed
*/
function _resize_container_image_box(intImageWidth,intImageHeight) {
// Get current width and height
var intCurrentWidth = $('#lightbox-container-image-box').width();
var intCurrentHeight = $('#lightbox-container-image-box').height();
// Get the width and height of the selected image plus the padding
var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the image´s width and the left and right padding value
var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the image´s height and the left and right padding value
// Diferences
var intDiffW = intCurrentWidth - intWidth;
var intDiffH = intCurrentHeight - intHeight;
// Perfomance the effect
$('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight },settings.containerResizeSpeed,function() { _show_image(); });
if ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) {
if ( $.browser.msie ) {
___pause(250);
} else {
___pause(100);
}
}
$('#lightbox-container-image-data-box').css({ width: intImageWidth });
$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) });
};
/**
* Show the prepared image
*
*/
function _show_image() {
$('#lightbox-loading').hide();
$('#lightbox-image').fadeIn(function() {
_show_image_data();
_set_navigation();
});
_preload_neighbor_images();
};
/**
* Show the image information
*
*/
function _show_image_data() {
$('#lightbox-container-image-data-box').slideDown('fast');
$('#lightbox-image-details-caption').hide();
if ( settings.imageArray[settings.activeImage][1] ) {
$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();
}
// If we have a image set, display 'Image X of X'
if ( settings.imageArray.length > 1 ) {
$('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();
}
}
/**
* Display the button navigations
*
*/
function _set_navigation() {
$('#lightbox-nav').show();
// Instead to define this configuration in CSS file, we define here. And it´s need to IE. Just.
$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
// Show the prev button, if not the first image in set
if ( settings.activeImage != 0 ) {
if ( settings.fixedNavigation ) {
$('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' })
.unbind()
.bind('click',function() {
settings.activeImage = settings.activeImage - 1;
_set_image_to_view();
return false;
});
} else {
// Show the images button for Next buttons
$('#lightbox-nav-btnPrev').unbind().hover(function() {
$(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' });
},function() {
$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
}).show().bind('click',function() {
settings.activeImage = settings.activeImage - 1;
_set_image_to_view();
return false;
});
}
}
// Show the next button, if not the last image in set
if ( settings.activeImage != ( settings.imageArray.length -1 ) ) {
if ( settings.fixedNavigation ) {
$('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' })
.unbind()
.bind('click',function() {
settings.activeImage = settings.activeImage + 1;
_set_image_to_view();
return false;
});
} else {
// Show the images button for Next buttons
$('#lightbox-nav-btnNext').unbind().hover(function() {
$(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' });
},function() {
$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
}).show().bind('click',function() {
settings.activeImage = settings.activeImage + 1;
_set_image_to_view();
return false;
});
}
}
// Enable keyboard navigation
_enable_keyboard_navigation();
}
/**
* Enable a support to keyboard navigation
*
*/
function _enable_keyboard_navigation() {
$(document).keydown(function(objEvent) {
_keyboard_action(objEvent);
});
}
/**
* Disable the support to keyboard navigation
*
*/
function _disable_keyboard_navigation() {
$(document).unbind();
}
/**
* Perform the keyboard actions
*
*/
function _keyboard_action(objEvent) {
// To ie
if ( objEvent == null ) {
keycode = event.keyCode;
escapeKey = 27;
// To Mozilla
} else {
keycode = objEvent.keyCode;
escapeKey = objEvent.DOM_VK_ESCAPE;
}
// Get the key in lower case form
key = String.fromCharCode(keycode).toLowerCase();
// Verify the keys to close the ligthBox
if ( ( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey ) ) {
_finish();
}
// Verify the key to show the previous image
if ( ( key == settings.keyToPrev ) || ( keycode == 37 ) ) {
// If we´re not showing the first image, call the previous
if ( settings.activeImage != 0 ) {
settings.activeImage = settings.activeImage - 1;
_set_image_to_view();
_disable_keyboard_navigation();
}
}
// Verify the key to show the next image
if ( ( key == settings.keyToNext ) || ( keycode == 39 ) ) {
// If we´re not showing the last image, call the next
if ( settings.activeImage != ( settings.imageArray.length - 1 ) ) {
settings.activeImage = settings.activeImage + 1;
_set_image_to_view();
_disable_keyboard_navigation();
}
}
}
/**
* Preload prev and next images being showed
*
*/
function _preload_neighbor_images() {
if ( (settings.imageArray.length -1) > settings.activeImage ) {
objNext = new Image();
objNext.src = settings.imageArray[settings.activeImage + 1][0];
}
if ( settings.activeImage > 0 ) {
objPrev = new Image();
objPrev.src = settings.imageArray[settings.activeImage -1][0];
}
}
/**
* Remove jQuery lightBox plugin HTML markup
*
*/
function _finish() {
$('#jquery-lightbox').remove();
$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });
// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
$('embed, object, select').css({ 'visibility' : 'visible' });
}
/**
/ THIRD FUNCTION
* getPageSize() by quirksmode.com
*
* @return Array Return an array with page width, height and window width, height
*/
function ___getPageSize() {
var xScroll, yScroll;
if (window.innerHeight && window.scrollMaxY) {
xScroll = window.innerWidth + window.scrollMaxX;
yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
xScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight;
}
var windowWidth, windowHeight;
if (self.innerHeight) { // all except Explorer
if(document.documentElement.clientWidth){
windowWidth = document.documentElement.clientWidth;
} else {
windowWidth = self.innerWidth;
}
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
} else if (document.body) { // other Explorers
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
}
// for small pages with total height less then height of the viewport
if(yScroll < windowHeight){
pageHeight = windowHeight;
} else {
pageHeight = yScroll;
}
// for small pages with total width less then width of the viewport
if(xScroll < windowWidth){
pageWidth = xScroll;
} else {
pageWidth = windowWidth;
}
arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
return arrayPageSize;
};
/**
/ THIRD FUNCTION
* getPageScroll() by quirksmode.com
*
* @return Array Return an array with x,y page scroll values.
*/
function ___getPageScroll() {
var xScroll, yScroll;
if (self.pageYOffset) {
yScroll = self.pageYOffset;
xScroll = self.pageXOffset;
} else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
yScroll = document.documentElement.scrollTop;
xScroll = document.documentElement.scrollLeft;
} else if (document.body) {// all other Explorers
yScroll = document.body.scrollTop;
xScroll = document.body.scrollLeft;
}
arrayPageScroll = new Array(xScroll,yScroll);
return arrayPageScroll;
};
/**
* Stop the code execution from a escified time in milisecond
*
*/
function ___pause(ms) {
var date = new Date();
curDate = null;
do { var curDate = new Date(); }
while ( curDate - date < ms);
};
// Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
return this.unbind('click').click(_initialize);
};
})(jQuery); // Call and execute the function immediately passing the jQuery object
function _ajax_loader_black(){
return "<div id='loader' class='black-ajax-loader'><span class='magenta-text bebas sixteen-pt'>Loading</span><br/><img src='/images/v3/loadinfo.gif'></div>"
}
function get_unique_id(){
var dateObject = new Date();
var uniqueId =
dateObject.getFullYear() + '' +
dateObject.getMonth() + '' +
dateObject.getDate() + '' +
dateObject.getTime();
return uniqueId;
}
(function($) {
$.fn.clippy = function(text, bgcolor) {
if (!bgcolor) {
var node = $(this);
while (node.css('background-color') == 'transparent' && node.length) {
node = node.parent();
}
if (!node.length) {
bgcolor = '#ffffff';
} else {
bgcolor = node.css('background-color');
}
}
var m = bgcolor.match(/^rgb\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*\)$/i)
if (m) {
var r = parseInt(m[1], 10),
g = parseInt(m[2], 10),
b = parseInt(m[3], 10);
bgcolor = '#'+r.toString(16)+g.toString(16)+b.toString(16);
}
$(this)
.after($('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="110" height="14" id="clippy"> <param name="movie" value="/files/clippy.swf"/> <param name="allowScriptAccess" value="always" /> <param name="quality" value="high" /> <param name="scale" value="noscale" /> <param NAME="FlashVars" value="text='+escape(text)+'> <param name="bgcolor" value="'+bgcolor+'"> <embed src="/files/clippy.swf" width="110" height="14" name="clippy" quality="high" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" FlashVars="text='+escape(text)+'" bgcolor="'+bgcolor+'" /> </object>'))
.after(' ');
};
})(jQuery);
| mzemel/kpsu.org | public/javascripts/production.js | JavaScript | gpl-3.0 | 346,421 |
/*
Copyright 2010, Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
var GdataExtension = {};
GdataExtension.isAuthorized = function() {
return $.cookie('authsub_token') !== null;
};
GdataExtension.showAuthorizationDialog = function(onAuthorized, onNotAuthorized) {
if (window.name) {
var windowName = window.name;
} else {
var windowName = "openrefine" + new Date().getTime();
window.name = windowName;
}
var callbackName = "cb" + new Date().getTime();
var callback = function(evt) {
delete window[callbackName];
if (GdataExtension.isAuthorized()) {
onAuthorized();
} else if (onNotAuthorized) {
onNotAuthorized();
}
window.setTimeout(function() { win.close(); }, 100);
};
window[callbackName] = callback;
var url = ModuleWirings['gdata'] + "authorize?winname=" + escape(windowName) + "&callback=" + escape(callbackName);
var win = window.open(url, "openrefinegdataauth", "resizable=1,width=800,height=600");
};
| WGBH/AMS | OpenRefine/extensions/gdata/module/scripts/gdata-extension.js | JavaScript | gpl-3.0 | 2,422 |
module.exports = {
'code': 1100,
'type': 'UserExtTokenAlreadyRegistered',
'message': 'The provided external authentification is already used',
'http': 400
}; | Tuxkowo/api.life.tl | wrappers/LifeErrors/UserExtTokenAlreadyRegistered.js | JavaScript | gpl-3.0 | 178 |
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* EspoCRM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
Espo.define('Views.Email.Record.DetailQuick', 'Views.Email.Record.Detail', function (Dep, Detail) {
return Dep.extend({
isWide: true,
sideView: false,
init: function () {
Dep.prototype.init.call(this);
this.columnCount = 2;
},
setup: function () {
Dep.prototype.setup.call(this);
},
});
});
| onerinas/espocrm-3.4.2 | frontend/client/src/views/email/record/detail-quick.js | JavaScript | gpl-3.0 | 1,356 |
/*global module */
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
//define the string to go between each file in the concat'd output
separator: ';'
},
dist: {
//files to concatenate
src: ['src/**/*.js'],
//destination js file
dest: 'build/js/<%= pkg.name %>.js'
}
},
uglify: {
options: {
// the banner to stamp at top of output
banner: '/* <%= pkg.name %> <%= grunt.template.today("dd-mm-yy") %> /* \n'
},
dist: {
files: {
'build/js/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
}
}
},
jshint: {
//files to lint
files: ['Gruntfile.js', 'src/**/*.js'],
options: {
globals: {
jQuery: true,
console: true,
module: true
}
}
},
compass: {
dist: {
options: {
sassDir: 'src/sass',
cssDir: 'build/css'
}
}
},
watch: {
css: {
files: 'src/sass/*.scss',
tasks: ['compass']
},
js: {
files: ['src/js/*.js'],
tasks: ['jshint', 'uglify', 'concat']
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'compass']);
}; //exports | fredericksilva/Mobile-Dropbox-Website-Builder | Gruntfile.js | JavaScript | gpl-3.0 | 1,990 |
dojo.provide("dojo.widget.DropdownTimePicker");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.DropdownContainer");
dojo.require("dojo.widget.TimePicker");
dojo.require("dojo.event.*");
dojo.require("dojo.html.*");
dojo.require("dojo.date.format");
dojo.require("dojo.date.serialize");
dojo.require("dojo.i18n.common");
dojo.requireLocalization("dojo.widget", "DropdownTimePicker");
dojo.widget.defineWidget(
"dojo.widget.DropdownTimePicker",
dojo.widget.DropdownContainer,
{
/*
summary:
A form input for entering times with a pop-up dojo.widget.TimePicker to aid in selection
description:
This is TimePicker in a DropdownContainer, it supports all features of TimeePicker.
It is possible to customize the user-visible formatting with either the formatLength or
displayFormat attributes. The value sent to the server is typically a locale-independent
value in a hidden field as defined by the name attribute. RFC3339 representation is used
by default, but other options are available with saveFormat.
usage:
var dtp = dojo.widget.createWidget("DropdownTimePicker", {},
dojo.byId("DropdownTimePickerNode"));
<input dojoType="DropdownTimePicker">
*/
// iconURL: URL
// path of icon for button to display time picker widget
iconURL: dojo.uri.moduleUri("dojo.widget", "templates/images/timeIcon.gif"),
// formatLength: String
// Type of formatting used for visual display, appropriate to locale (choice of long, short, medium or full)
// See dojo.date.format for details.
formatLength: "short",
// displayFormat: String
// A pattern used for the visual display of the formatted date.
// Setting this overrides the default locale-specific settings as well as the formatLength
// attribute. See dojo.date.format for a reference which defines the formatting patterns.
displayFormat: "",
timeFormat: "", // deprecated, will be removed for 0.5
//FIXME: need saveFormat attribute support
// saveFormat: String
// Formatting scheme used when submitting the form element. This formatting is used in a hidden
// field (name) intended for server use, and is therefore typically locale-independent.
// By default, uses rfc3339 style date formatting (rfc)
// Use a pattern string like displayFormat or one of the following:
// rfc|iso|posix|unix
saveFormat: "",
// value: String|Date
// form value property in rfc3339 format. ex: 12:00
value: "",
// name: String
// name of the form element, used to create a hidden field by this name for form element submission.
name: "",
postMixInProperties: function() {
// summary: see dojo.widget.DomWidget
dojo.widget.DropdownTimePicker.superclass.postMixInProperties.apply(this, arguments);
var messages = dojo.i18n.getLocalization("dojo.widget", "DropdownTimePicker", this.lang);
this.iconAlt = messages.selectTime;
//FIXME: should this be if/else/else?
if(typeof(this.value)=='string'&&this.value.toLowerCase()=='today'){
this.value = new Date();
}
if(this.value && isNaN(this.value)){
var orig = this.value;
this.value = dojo.date.fromRfc3339(this.value);
if(!this.value){
var d = dojo.date.format(new Date(), { selector: "dateOnly", datePattern: "yyyy-MM-dd" });
var c = orig.split(":");
for(var i = 0; i < c.length; ++i){
if(c[i].length == 1) c[i] = "0" + c[i];
}
orig = c.join(":");
this.value = dojo.date.fromRfc3339(d + "T" + orig);
dojo.deprecated("dojo.widget.DropdownTimePicker", "time attributes must be passed in Rfc3339 format", "0.5");
}
}
if(this.value && !isNaN(this.value)){
this.value = new Date(this.value);
}
},
fillInTemplate: function(){
// summary: see dojo.widget.DomWidget
dojo.widget.DropdownTimePicker.superclass.fillInTemplate.apply(this, arguments);
var value = "";
if(this.value instanceof Date) {
value = this.value;
} else if(this.value) {
var orig = this.value;
var d = dojo.date.format(new Date(), { selector: "dateOnly", datePattern: "yyyy-MM-dd" });
var c = orig.split(":");
for(var i = 0; i < c.length; ++i){
if(c[i].length == 1) c[i] = "0" + c[i];
}
orig = c.join(":");
value = dojo.date.fromRfc3339(d + "T" + orig);
}
var tpArgs = { widgetContainerId: this.widgetId, lang: this.lang, value: value };
this.timePicker = dojo.widget.createWidget("TimePicker", tpArgs, this.containerNode, "child");
dojo.event.connect(this.timePicker, "onValueChanged", this, "_updateText");
if(this.value){
this._updateText();
}
this.containerNode.style.zIndex = this.zIndex;
this.containerNode.explodeClassName = "timeContainer";
this.valueNode.name = this.name;
},
getValue: function(){
// summary: return current time in time-only portion of RFC 3339 format
return this.valueNode.value; /*String*/
},
getTime: function(){
// summary: return current time as a Date object
return this.timePicker.storedTime; /*Date*/
},
setValue: function(/*Date|String*/rfcDate){
//summary: set the current time from RFC 3339 formatted string or a date object, synonymous with setTime
this.setTime(rfcDate);
},
setTime: function(/*Date|String*/dateObj){
// summary: set the current time and update the UI
var value = "";
if(dateObj instanceof Date) {
value = dateObj;
} else if(this.value) {
var orig = this.value;
var d = dojo.date.format(new Date(), { selector: "dateOnly", datePattern: "yyyy-MM-dd" });
var c = orig.split(":");
for(var i = 0; i < c.length; ++i){
if(c[i].length == 1) c[i] = "0" + c[i];
}
orig = c.join(":");
value = dojo.date.fromRfc3339(d + "T" + orig);
}
this.timePicker.setTime(value);
this._syncValueNode();
},
_updateText: function(){
// summary: updates the <input> field according to the current value (ie, displays the formatted date)
if(this.timePicker.selectedTime.anyTime){
this.inputNode.value = "";
}else if(this.timeFormat){
dojo.deprecated("dojo.widget.DropdownTimePicker",
"Must use displayFormat attribute instead of timeFormat. See dojo.date.format for specification.", "0.5");
this.inputNode.value = dojo.date.strftime(this.timePicker.time, this.timeFormat, this.lang);
}else{
this.inputNode.value = dojo.date.format(this.timePicker.time,
{formatLength:this.formatLength, timePattern:this.displayFormat, selector:'timeOnly', locale:this.lang});
}
this._syncValueNode();
this.onValueChanged(this.getTime());
this.hideContainer();
},
onValueChanged: function(/*Date*/dateObj){
// summary: triggered when this.value is changed
},
onInputChange: function(){
// summary: callback when user manually types a time into the <input> field
if(this.dateFormat){
dojo.deprecated("dojo.widget.DropdownTimePicker",
"Cannot parse user input. Must use displayFormat attribute instead of dateFormat. See dojo.date.format for specification.", "0.5");
}else{
var input = dojo.string.trim(this.inputNode.value);
if(input){
var inputTime = dojo.date.parse(input,
{formatLength:this.formatLength, timePattern:this.displayFormat, selector:'timeOnly', locale:this.lang});
if(inputTime){
this.setTime(inputTime);
}
} else {
this.valueNode.value = input;
}
}
// If the time entered didn't parse, reset to the old time. KISS, for now.
//TODO: usability? should we provide more feedback somehow? an error notice?
// seems redundant to do this if the parse failed, but at least until we have validation,
// this will fix up the display of entries like 01/32/2006
if(input){ this._updateText(); }
},
_syncValueNode: function(){
var time = this.timePicker.time;
var value;
switch(this.saveFormat.toLowerCase()){
case "rfc": case "iso": case "":
value = dojo.date.toRfc3339(time, 'timeOnly');
break;
case "posix": case "unix":
value = Number(time);
break;
default:
value = dojo.date.format(time, {datePattern:this.saveFormat, selector:'timeOnly', locale:this.lang});
}
this.valueNode.value = value;
},
destroy: function(/*Boolean*/finalize){
this.timePicker.destroy(finalize);
dojo.widget.DropdownTimePicker.superclass.destroy.apply(this, arguments);
}
}
);
| idega/org.chiba.web | resources/javascript/dojo-0.4.4/src/widget/DropdownTimePicker.js | JavaScript | gpl-3.0 | 8,387 |
var debug = require('debug')('openframe:model:Frame');
module.exports = function(Frame) {
Frame.disableRemoteMethodByName('createChangeStream');
// Remove sensitive data from Artworks being returned
// in public frames
// Frame.afterRemote('**', function(ctx, resultInstance, next) {
// debug('ctx.methodString', ctx.methodString);
// function updateResult(result) {
// if (result.current_artwork) {
// let newArtwork = {
// title: result.current_artwork.title,
// author_name: result.current_artwork.author_name
// };
// if (result.current_artwork.is_public) {
// newArtwork.id = result.current_artwork.id;
// }
// result.current_artwork(newArtwork);
// // debug(result.current_artwork);
// }
// }
// if (ctx.result) {
// if (Array.isArray(resultInstance)) {
// debug('isArray', resultInstance.length);
// ctx.result.forEach(function(result) {
// updateResult(result);
// });
// } else {
// updateResult(ctx.result);
// }
// }
// next();
// });
// Never save 'current_artwork' object into DB -- it comes from relation, via currentArtworkId
// TODO: I think this is a(nother) loopback bug, since with strict on we should be enforcing
// properties, but since this property is the name of a relation it's allowing it to be saved (?)
Frame.observe('before save', function(ctx, next) {
debug('before save', typeof ctx.instance);
if (ctx.instance) {
ctx.instance.unsetAttribute('current_artwork');
} else {
delete ctx.data.current_artwork;
}
debug('before save - MODIFIED', ctx.instance);
next();
});
// whenever a Frame model is saved, broadcast an update event
Frame.observe('after save', function(ctx, next) {
if (ctx.instance && Frame.app.pubsub) {
debug('Saved %s %s', ctx.Model.modelName, ctx.instance.id);
if (ctx.isNewInstance) {
debug('New Frame, publishing: /user/' + ctx.instance.ownerId + '/frame/new');
Frame.app.pubsub.publish('/user/' + ctx.instance.ownerId + '/frame/new', ctx.instance.id);
} else {
debug('Existing Frame, publishing: /frame/' + ctx.instance.id + '/db_updated');
// debug(ctx.instance);
Frame.findById(ctx.instance.id, { include: 'current_artwork' }, function(err, frame) {
debug(err, frame);
Frame.app.pubsub.publish('/frame/' + frame.id + '/db_updated', frame);
});
}
}
next();
});
// Ouch. Ow. Yowsers. Serisously?
function removeManagers(frame, managers) {
return new Promise((resolve, reject) => {
frame.managers(function(err, current_managers) {
debug(current_managers);
if (current_managers.length) {
var count = 0,
total = current_managers.length;
current_managers.forEach(function(cur_man) {
debug(cur_man);
if (managers.indexOf(cur_man.username) === -1) {
debug('removing %s', cur_man.username);
frame.managers.remove(cur_man, function(err) {
if (err) debug(err);
count++;
if (count === total) {
// all who are no longer present in the new list have been removed
resolve();
}
});
} else {
count++;
if (count === total) {
// all who are no longer present in the new list have been removed
resolve();
}
}
});
} else {
// there are no current managers
resolve();
}
});
});
}
// Painful painful painful -- so gross. Why loopback, why!?
function addManagers(frame, managers) {
var OpenframeUser = Frame.app.models.OpenframeUser;
return new Promise((resolve, reject) => {
OpenframeUser.find({ where: { username: { inq: managers }}}, function(err, users) {
if (err) {
debug(err);
}
var count = 0,
total = users.length;
if (total === 0) {
// no managers found by username, return frame including current managers
Frame.findById(frame.id, {include: 'managers'}, function(err, frame) {
debug(err, frame);
resolve(frame);
});
} else {
// managers found by username, add them to frame, then
// return frame including current managers
// XXX: Unfortunately loopback doesn't seem to provide a way to batch
// update hasAndBelongsToMany relationships :/
users.forEach(function(user) {
frame.managers.add(user, function(err) {
count++;
if (count === total) {
Frame.findById(frame.id, {include: 'managers'}, function(err, frame) {
debug(err, frame);
resolve(frame);
});
}
});
});
}
});
});
}
// Update managers by username
//
// XXX: This is incredibly ugly. Loopback doesn't provide a good way to update
// this type of relationship all in one go, which makes it a huge messy pain. Given
// time, I may fix this.
Frame.prototype.update_managers_by_username = function(managers, cb) {
debug(managers);
var self = this;
removeManagers(self, managers)
.then(function() {
addManagers(self, managers)
.then(function(frame) {
cb(null, frame);
})
.catch(debug);
}).catch(debug);
};
// Expose update_managers_by_username remote method
Frame.remoteMethod(
'prototype.update_managers_by_username', {
description: 'Add a related item by username for managers.',
accepts: {
arg: 'managers',
type: 'array',
http: {
source: 'body'
}
},
http: {
verb: 'put',
path: '/managers/by_username'
},
returns: {
arg: 'frame',
type: 'Object'
}
}
);
/**
* Update the current artwork by artwork ID
* @param {String} currentArtworkId
* @param {Function} callback
*/
Frame.prototype.update_current_artwork = function(currentArtworkId, cb) {
debug('update_current_artwork', currentArtworkId);
var self = this;
self.updateAttribute('currentArtworkId', currentArtworkId, function(err, instance) {
cb(err, instance);
});
};
Frame.remoteMethod(
'prototype.update_current_artwork', {
description: 'Set the current artwork for this frame',
accepts: {
arg: 'currentArtworkId',
type: 'any',
required: true,
http: {
source: 'path'
}
},
http: {
verb: 'put',
path: '/current_artwork/:currentArtworkId'
},
returns: {
arg: 'frame',
type: 'Object'
}
}
);
/**
* Override toJSON in order to remove inclusion of email address for users that are
* not the currently logged-in user.
*
* @return {Object} Plain JS Object which will be transformed to JSON for output.
*/
// Frame.prototype.toJSON = function() {
// // TODO: this seems awfully fragile... not very clear when context is available
// var ctx = loopback.getCurrentContext(),
// user = ctx.get('currentUser'),
// userId = user && user.id,
// obj = this.toObject(false, true, false);
// debug('FRAME toJSON', userId, obj);
// // Remove email from managers
// if (obj.managers && obj.managers.length) {
// obj.managers.forEach((manager) => {
// delete manager.email;
// });
// }
// // Remove email from owner unless it's the currently logged in user.
// if (obj.owner && userId !== obj.owner.id) {
// delete obj.owner.email;
// }
// return obj;
// };
};
| OpenframeProject/Openframe-API | common/models/frame.js | JavaScript | gpl-3.0 | 9,543 |
define(
[
'views/AlertMessageView',
'lib/Mediator'
],
function (AlertMessageView, Mediator) {
describe('AlertMessageView', function () {
var resultsCollection, view, mediator;
beforeEach(function () {
resultsCollection = new Backbone.Collection();
mediator = new Mediator();
});
it('should initially be hidden', function () {
view = new AlertMessageView().render();
expect(view.$el.find('.alert')).toHaveClass('hidden');
});
it('should become visible when a new message arrives', function () {
view = new AlertMessageView();
view.setMediator(mediator);
mediator.trigger('app:alert', {title: 'x', content: 'y'});
expect(view.$el.find('.alert')).not.toHaveClass('hidden');
});
it('should close it when a user clicks the X', function () {
view = new AlertMessageView().render();
view.setMediator(mediator);
view.removeAlertMessage();
expect(view.$el.find('.alert')).toHaveClass('hidden');
});
});
});
| nsidc/search-interface | spec/views/AlertMessageView_spec.js | JavaScript | gpl-3.0 | 1,079 |
(function (angular) {
'use strict';
describe('adminStoreApi', function () {
var $firebaseObjectMock;
var firebaseObjectResult;
var firebaseRef;
var adminStoreApi;
beforeEach(module('movieClub'));
beforeEach(function () {
firebaseObjectResult = {'$loaded': angular.noop};
$firebaseObjectMock = jasmine.createSpy('$firebaseObject');
$firebaseObjectMock.and.returnValue(firebaseObjectResult);
module(function ($provide) {
$provide.value('$firebaseObject', $firebaseObjectMock);
});
});
beforeEach(inject(function (_firebaseRef_, _adminStoreApi_) {
firebaseRef = _firebaseRef_;
adminStoreApi = _adminStoreApi_;
}));
describe('get', function () {
it('should get a firebase adminStore object', function () {
spyOn(firebaseRef, 'child');
adminStoreApi.get();
expect(firebaseRef.child).toHaveBeenCalledWith('adminStore');
});
});
});
}(window.angular));
| BrandonCKrueger/movie-club | src/adminStore/adminStoreApi.service.spec.js | JavaScript | gpl-3.0 | 1,129 |
//= require ./map | cloudtm/geograph | geograph/app/assets/javascripts/map_lib/index.js | JavaScript | gpl-3.0 | 17 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.