code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
const ASSERT = require('assert'); describe('SSL Specs', function () { const PATH = require('path'); let Acts = require('./../index'); let testcert = PATH.join(__dirname, 'certs', 'test.cert'); let testkey = PATH.join(__dirname, 'certs', 'test.key'); it('boot with testcertificate without chain', function() { return new Promise((resolve, reject) => { try { Acts.createServer(__dirname, { server: { address: 'localhost', port: 8086, ssl: { usessl: true, redirectnonsslrequests: true, privatekey: testkey, certificate: testcert, certificationauthority: [] } } }); Acts.start(function () { Acts.shutdown(); resolve(); }); } catch (e) { reject(e); } }); }); it('boot with testcertificate with chain', function() { return new Promise((resolve, reject) => { try { Acts.createServer(__dirname, { server: { address: 'localhost', port: 8086, ssl: { usessl: true, redirectnonsslrequests: true, privatekey: testkey, certificate: testcert, certificationauthority: [testcert] } } }); Acts.start(function () { Acts.shutdown(); resolve(); }); } catch (e) { reject(e); } }); }); });
nodejayes/acts
spec/ssl.spec.js
JavaScript
mit
1,998
<?php require "../zxcd9.php"; //$stmt = $db->prepare("SELECT * from fin_allotments where hrdbid=:id"); //$stmt->bindParam(':id', $_SESSION['id']); //$stmt->execute(); //$rowfa = $stmt->fetch(PDO::FETCH_ASSOC); //echo $rowfa['hrdbid']; // echo $_SESSION['id']; // while ($rowfa = $stmt->fetch(PDO::FETCH_ASSOC)) { // echo $rowfa['hrdbid'].'<br>'; // } $regionz = array("NCR", "CAR", "REGION I", "REGION II", "REGION III", "REGION IV-A", "REGION IV-B", "REGION V", "REGION VI", "REGION VII", "REGION VIII", "REGION IX", "REGION X", "REGION XI", "REGION XII", "CARAGA", "ARMM", "NIR"); //SELECT COUNT(region)as region,re FROM `fin_allotments` WHERE type="CMF" and region="NCR" $cmf = []; foreach ($regionz as $regvalue) { $stmt = $db->prepare("SELECT COUNT(region) as regioncount FROM fin_allotments WHERE region = '".$regvalue."' and type='CMF' "); $stmt->execute(); $row = $stmt->fetch(); $cmf[] = intval($row['regioncount']); } $dr = []; foreach ($regionz as $regvalue) { $stmt = $db->prepare("SELECT COUNT(region) as regioncount FROM fin_allotments WHERE region = '".$regvalue."' and type='DR'"); $stmt->execute(); $row = $stmt->fetch(); $dr[] = intval($row['regioncount']); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>SLP Online</title> <meta name="description" content="SLP DSWD Livelihood"/> <meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0"> <link rel="shortcut icon" href="../imgs/favicon.ico" type="image/x-icon"> <link rel="icon" href="../imgs/favicon.ico" type="image/x-icon"> <link rel="stylesheet" href="../css/flatbootstrap.css"/> <script src="../js/jquery-1.10.2.min.js"></script> <script src="../js/bootstrap.min.js"></script> <script src="https://code.highcharts.com/highcharts.js"></script> <script type="text/javascript" language="javascript" src="../js/jquery.dataTables.js"></script> <style> body { background-color: #f7f9fb; background-size: cover; font-family: "Lato"; } .navbar-nav > li > a, .navbar-brand { padding-top:15px !important; padding-bottom:0 !important; height: 40px; } .navbar {min-height:45px !important;background-color: #000} #bootstrapSelectForm .selectContainer .form-control-feedback { right: -15px; } .disabled { background:rgba(1,1,1,0.2); border:0px solid; cursor:progress; } .vcenter { min-height: 90%; min-height: 90vh; display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-box-align : center; -webkit-align-items : center; -moz-box-align : center; -ms-flex-align : center; align-items : center; width: 100%; -webkit-box-pack : center; -moz-box-pack : center; -ms-flex-pack : center; -webkit-justify-content : center; justify-content : center; } table { border-collapse: inherit; } .slpdrop { margin-bottom:1em; } .slpdropsub { background: #000; color:#fff; } .slpdropsub li a { background: #000; color:#fff; } -webkit-tap-highlight-color: rgba(0,0,0,0); button { outline: none; } .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus { background: #000; } .dashpanel { border:solid 1px #c5d6de;margin:1em;margin-top:0;background:#fff;text-align: center; height:100%; border-radius: 4px; } .bluetext { color: #00ADDe; } .padfix { padding-right: 0; margin-bottom:1em; margin-right: 1em; } .padfix2{ padding-right:0em; padding-left: 1em; } .padfix3 { padding-left:1em; padding-right:0; } .padfix4 { padding: 1em; padding-right:0; } .dashpanelheader { font-weight:900;padding-top:0.5em;padding-left:1em;font-size:18px; margin-bottom: 0;text-align: left; } @media (min-width: 990px) { .slpdrop { font-weight:900; font-size:22px; } .padfix { padding-right: 0; margin-right: 0; margin-bottom: 0; } .padfix2{ padding-right:0em; padding-left: 2em; } .padfix3 { padding-left:0; padding-right: 1em; } .padfix4 { padding: 1em; padding-right:1em; } } .dashpanelsubhead { text-align:left;padding-left:1.2em;margin-bottom:0;padding-bottom:0; } thead th { text-align: center; cursor: pointer; } .dataTables_paginate { line-height:22px; text-align:left; } h3 { font-weight: 400 } .nopad { margin:0; padding:0; padding-top:4px; } .nopad::after { color: #ccc; content: attr(data-bg-text); display: block; font-size: 12px; text-align:right; line-height: 1; padding:0; margin:0; margin-top: 0px; position: relative; bottom: 0px; right: 0px; } .labelhover:hover { background: #000; color: #fff; } tr { text-align: center; } .glyphcenter { font-size:12px; padding-right:2px; } .dataTables_filter, .dataTables_info { display: none; } </style> </head> <body> <?php require "navfin.php"; ?> <script> $(function () { var colors = Highcharts.getOptions().colors; regtot = [2,3,34,5,3,2,3,2,2,2,2,2,2,22,34]; regconf = [2,3,34,5,3,2,3,2,2,2,2,2,2,22,3]; $('#cont1').highcharts({ chart: { type: 'column', backgroundColor: null, height: 150 }, title: { text: '' }, subtitle: { text: '' }, credits: { enabled: false }, legend: { enabled: false }, tooltip: { formatter: function() { var point = this.point, s = '<b>'+this.x+'</b><br>Total: <b>'+point.total+'</b><br>'+point.series.name+': <b>'+point.y.toFixed(0)+'</b>'; return s; }, hideDelay: 0 }, xAxis: { categories: [ 'NCR', 'CAR', 'I', 'II', 'III', 'IV-A', 'IV-B', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII', 'CARAGA', 'ARMM', 'NIR' ], crosshair: true, minorGridLineWidth: 0, minorTickWidth: 0, tickWidth: 0, labels: { enabled: true, style: { fontSize:'5px' } } }, yAxis: { min: 0, gridLineWidth: 0, title: '', labels: { enabled: false } }, plotOptions: { column: { pointPadding: 0, borderWidth: 0 }, series: { stacking: 'normal' } }, // series: [{ // name: 'CMF', // color: colors[3], // data: [23,23,55,23,15,09,18,20,50,33,38,21,12,10,40,20] // },{ // name: 'DR', // color: colors[8], // data: [43,12,44,22,10,08,25,67,32,10,29,56,19,10,40,20] //}] series: [{ name: 'CMF', color: colors[3], data: [<?php echo $cmf[0].",".$cmf[1].",".$cmf[2].",".$cmf[3].",".$cmf[4].",".$cmf[5].",".$cmf[6].",".$cmf[7].",".$cmf[8].",".$cmf[9].",".$cmf[10].",".$cmf[11].",".$cmf[12].",".$cmf[13].",".$cmf[14].",".$cmf[15].",".$cmf[16].",".$cmf[17]; ?>] },{ name: 'DR', color: colors[8], data: [<?php echo $dr[0].",".$dr[1].",".$dr[2].",".$dr[3].",".$dr[4].",".$dr[5].",".$dr[6].",".$dr[7].",".$dr[8].",".$dr[9].",".$dr[10].",".$dr[11].",".$dr[12].",".$dr[13].",".$dr[14].",".$dr[15].",".$dr[16].",".$dr[17]; ?>] }] }); }); function delcom(xx) { var r = confirm("This will permanently delete this record. Are you sure?"); if (r == true) { var formData = { 'action' : 'delallo', 'delid' : xx }; $.ajax({ type: "POST", url: "func.php", data: formData, success: function(data) { $("#sucsubtext").html("Record deleted"); $('#myModal').modal(); $('#myModal').on('hidden.bs.modal', function () {location.href = "../finance/allotments_add.php"; }); location.reload(); } }); } } function allotview(ee) { var formData = { 'editid' : ee }; $.ajax({ type: "POST", url: "allotments_view.php?id="+ee, data: formData, success: function(data) { if (data == "visitpage") { location.href="allotments_view.php?id="+ee; } } }); } </script> <script type="text/javascript" language="javascript" class="init"> var oTable = ""; $(document).ready(function() { function toTitleCase(str) { return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); } function parselimit(strz) { var m = new String(strz); if (m.length > 32) { m = m.substring(0,32); m = m+".."; } return m; } function com(x) { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); } function parseStatus(str) { if (str == "0") { status = "<span class='label label-primary'>Open</span>"; } else if (str == "1") { status = "<span class='label label-primary'>Proposed</span>"; } else if (str == "2") { status = "<span class='label label-warning'>In Progress</span>"; } else if (str == "3") { status = "<span class='label label-info'>Completed</span>"; } return status; } $.fn.DataTable.ext.pager.numbers_length = 5; oTable = $('#viewdata').dataTable({ "aProcessing": true, "aServerSide": true, "orderCellsTop": true, "ajax": "dt_allotments.php", "dom": '<"top">rt<"bottom"ip><"clear">', "aaSorting": [9,'desc'], "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { $(nRow).attr('id', aData[0]); // $(nRow).attr('subfeed', aData[1]); return nRow; }, "aoColumnDefs": [ { "aTargets":[7], "mData": null, "mRender": function( data, type, full) { return '<td>&#8369;'+com(data[7])+'</td>'; } }, { "aTargets":[9], "mData": null, "mRender": function( data, type, full) { var id='<?php echo $_SESSION['id']; ?>'; var lvl='<?php echo $_SESSION['permlvl']; ?>'; var d9=data[9]; if(lvl>0 || d9==id) { return '<td><span class=" glyphicon glyphicon-search" onclick="allotview('+data[0]+')"></span>&nbsp;<span class="glyphicon glyphicon-remove" onclick="delcom('+data[0]+')"></span></td>'; } else { return '<td><span class=" glyphicon glyphicon-search" onclick="allotview('+data[0]+')"></span></td>'; } } }, { "bVisible": false, "aTargets":[0] } ] }); $(document).ready(function() { tableshown=false; $("#searchme").keyup(function() { if (tableshown==false) { tableshown=true; } oTable.fnFilter(this.value); }); }); }); </script> <div class="row" style="margin:0;padding:0"> <div class="col-md-2"> <?php require "nav_side.php"; ?> </div> <div class="col-md-10"> <div class="row"> <div class="col-md-12"> <div style="border:solid 1px #c5d6de;background:#fff;text-align:left;padding:2em;margin-bottom:2em"> <div class="row"> <div class="col-md-4"> <h2 style="font-size:36px;margin-bottom:0em;margin-top:0em">Fund Allotments</h2> Encoded by SLP-NPMO <br><br> <a href="allotments_add.php"><button class="btn btn-info btn-sm">Add Fund Allotment</button></a> <button class="btn btn-success btn-sm" onclick="showsearch()"><span class="glyphicon glyphicon-search"></span>&nbsp; Search</button> <br> </div> <div class="col-md-8" id="cont1" style=""> </div> </div> <div class="row" style="margin-top:1em;margin-bottom:1em;display:none;" id="searchfields"> <div class="row" style="padding:2em;padding-bottom:1em"> <input class="col-md-12 form-control" placeholder="Search keywords ..." id="searchme"> </div> <div class="col-md-4"> <select class="form-control"> <option>Filter by Region</option> </select> </div> <div class="col-md-4"> <select class="form-control"> <option>Filter by Type</option> <option>CMF</option> <option>DR</option> </select> </div> <div class="col-md-4"> <select class="form-control"> <option>Filter by Fund Source</option> <option>SLP GAA - MD</option> <option>SLP GAA - EF</option> <option>BUB</option> <option>RRP</option> </select> </div> </div> <table class="table table-bordered table-hover" style="margin-top:2em;line-height:0.9;vertical-align:middle;border-top:2;padding-bottom:0;margin-bottom:0" id="viewdata"> <thead style="background:#f6f8fa"> <th></th> <th>Region</th> <th>Type</th> <th>Sub-Type</th> <th>Sub-Aro</th> <th>UACS</th> <th>Fund Source</th> <th>Amount</th> <th>Date</th> <th></th> </thead> <!-- <tr> <td>Region IV-B</td> <td>CMF</td> <td>Grant</td> <td>2348712398</td> <td>-</td> <td>SLP-EF</td> <td>468,232.00</td> <td>06/17/2016</td> <td><span class="glyphicon glyphicon-edit"></span> <span class="glyphicon glyphicon-remove"></span></td> </tr> <tr> <td>Region IV-B</td> <td>CMF</td> <td>Grant</td> <td>3021000003</td> <td>-</td> <td>SLP-MD</td> <td>268,232.00</td> <td>06/17/2016</td> <td><span class="glyphicon glyphicon-edit"></span> <span class="glyphicon glyphicon-remove"></span></td> </tr> <tr> <td>Region IV-B</td> <td>DR</td> <td>Admin</td> <td>-</td> <td>Travelling Expense</td> <td>PAMANA</td> <td>568,232.00</td> <td>06/17/2016</td> <td><span class="glyphicon glyphicon-edit"></span> <span class="glyphicon glyphicon-remove"></span></td> </tr> <tr data-toggle="tooltip" title="<div style='text-align:left'>Realigned to: <span style='font-weight:normal'>Training Expenses</span><br>Amount: <font color=red>-20,000.00</font><br>Original Amount: 188,232.00<br>Date: 09/27/2016</div>" data-html="true" data-placement="left" data-container="body"> <td>Region IV-B</td> <td>DR</td> <td>Admin</td> <td>-</td> <td>Salary</td> <td>BUB</td> <td>168,232.00</td> <td>06/17/2016</td> <td><span class="glyphicon glyphicon-edit"></span> <span class="glyphicon glyphicon-remove"></span></td> </tr> <tr data-toggle="tooltip" title="<div style='text-align:left'>Realigned from: <span style='font-weight:normal'>Salary</span><br>Amount: <span class='colgreen'>+20,000.00</span><br>Original Amount: 1,444,232.00<br>Date: 09/27/2016</div>" data-html="true" data-placement="left" data-container="body"> <td>NCR</td> <td>CMF</td> <td>Admin</td> <td>-</td> <td>Training Expenses</td> <td>RRP</td> <td>1,468,232.00</td> <td>06/17/2016</td> <td><span class="glyphicon glyphicon-edit"></span> <span class="glyphicon glyphicon-remove"></span></td> </tr> <tr> <td>Region X</td> <td>CMF</td> <td>Admin</td> <td>-</td> <td>Mobile</td> <td>RSF</td> <td>868,232.00</td> <td>06/17/2016</td> <td><span class="glyphicon glyphicon-edit"></span> <span class="glyphicon glyphicon-remove"></span></td> </tr> --> </table> <button class="btn btn-primary btn-xs" style="margin-top:0.5em;margin-left:3px">Export to Excel</button> <div class="clearfix"></div> </div> </div> </div> </div> <!-- Modal --> <div class="modal fade" id="myModal" role="dialog" style="margin-top:3em"> <div class="modal-dialog modal-sm"> <div class="modal-content" style="padding:1em;padding-top:0.5em;"> <h3 style="color:#5cb85c;margin-bottom:6px">Success!</h3> <span style="font-size:13px" id="sucsubtext">Fund Allotments saved!</span><br><br> <button type="button" class="btn btn-primary pull-right" style="background:#5cb85c;border:0;margin-top:0;padding:5px 10px 5px 10px" id="okaybtn" data-dismiss="modal">Okay</button> <div class="clearfix"></div> </div> </div> </div> <!-- Modal --> <script> $('[data-toggle="tooltip"]').tooltip(); shown = false; function showsearch() { if (shown == true) { $('#searchfields').fadeOut(399); shown = false; } else { shown = true; $('#searchfields').slideDown(399); } } function getProv() { var formData = { 'action' : 'province', 'regionid' : $('#region option:selected').val() }; $.ajax({ type: "POST", url: "getLocations.php", data: formData, success: function(data) { $("#province").prop('disabled', false); $("#province").html(data); } }); } </script> </body> </html>
jmigdelacruz/SLPonline
finance/allotments.php
PHP
mit
18,757
package iso20022 type RepurchaseType6Code string
fgrid/iso20022
RepurchaseType6Code.go
GO
mit
50
<div class="sv-main-content"><div ui-view=""><div layout="row" layout-wrap="layout-wrap" ng-if="!mapView" style="max-width:1400px;margin: 0px auto"><div flex-sm="100" flex-gt-sm="50" flex-gt-md="33" flex-gt-lg="33" ng-repeat="agent in agents"><sv-broker-profile-thumb class="m"></sv-broker-profile-thumb></div></div></div></div>
SvitlanaShepitsena/remax16
app/scripts/brokers/views/brokersCtrl.html
HTML
mit
328
namespace XHTMLClassLibrary.AttributeDataTypes { /// <summary> /// One or more digits. /// </summary> public class Number : IAttributeDataType { private int? _number = null; public string Value { get { if (_number.HasValue) { return _number.ToString(); } return string.Empty; } set { _number = null; int temp; if(int.TryParse(value, out temp)) { _number = temp; } } } } }
LordKiRon/fb2converters
fb2epub/HTML5ClassLibrary/AttributeDataTypes/Number.cs
C#
mit
693
require "houston/releases/engine" require "houston/releases/configuration" module Houston module Releases extend self def dependencies [ :commits ] end def config(&block) @configuration ||= Releases::Configuration.new @configuration.instance_eval(&block) if block_given? @configuration end end # Extension Points # =========================================================================== # # Read more about extending Houston at: # https://github.com/houston/houston-core/wiki/Modules # Register events that will be raised by this module register_events {{ "release:create" => params("release").desc("A new release was created") }} # Add a link to feature that can be turned on for projects Houston.add_project_feature :releases do name "Releases" path { |project| Houston::Releases::Engine.routes.url_helpers.releases_path(project) } ability { |ability, project| ability.can?(:read, project.releases.build) } field "releases.environments" do name "Environments" html do |f| if @project.environments.none? "" else html = <<-HTML <p class="instructions"> Generate release notes for these environments: </p> HTML @project.environments.each do |environment| id = :"releases.ignore.#{environment}" value = f.object.public_send(id) || "0" html << f.label(id, class: "checkbox") do f.check_box(id, {checked: value == "0"}, "0", "1") + " #{environment.titleize}" end end html end end end end end
houston/houston-releases
lib/houston/releases.rb
Ruby
mit
1,708
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- from .sub_resource import SubResource class ApplicationGatewaySslPredefinedPolicy(SubResource): """An Ssl predefined policy. :param id: Resource ID. :type id: str :param name: Name of Ssl predefined policy. :type name: str :param cipher_suites: Ssl cipher suites to be enabled in the specified order for application gateway. :type cipher_suites: list[str or ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySslCipherSuite] :param min_protocol_version: Minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' :type min_protocol_version: str or ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySslProtocol """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'cipher_suites': {'key': 'properties.cipherSuites', 'type': '[str]'}, 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str'}, } def __init__(self, **kwargs): super(ApplicationGatewaySslPredefinedPolicy, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.cipher_suites = kwargs.get('cipher_suites', None) self.min_protocol_version = kwargs.get('min_protocol_version', None)
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_predefined_policy.py
Python
mit
1,826
const path = require('path'); const inquirer = require('inquirer'); const yargs = require('yargs'); const { sanitizeArgs, ui, invalidGitRepo, ingredients, addIngredients, promiseTimeout } = require('../common'); const { cloneRepo, deleteGitFolder, establishLocalGitBindings, addGitRemote, pushLocalGitToOrigin, stageChanges } = require('../tasks/git'); const { createEnvFile, checkForExistingFolder, executeCommand } = require('../tasks/filesystem'); const { readAndInitializeProjectRecipe, bakeProject } = require('../tasks/project'); const getDefaultProjectName = repoURL => { let projectName = path.basename(repoURL).toLowerCase(); projectName = projectName.replace(/\.git$/, ''); projectName = projectName.replace(/\.+/g, '-'); projectName = projectName.replace(/-+/g, '-'); return projectName; }; const getValidProjectName = name => { return name .replace(/\W+/g, ' ') // alphanumerics only .trimRight() .replace(/ /g, '-') .toLowerCase(); }; module.exports = { command: 'prepare', desc: 'creates a new scaffold from an ezbake project in a specified Git source', builder: yargs => { return yargs .option('n', { alias: 'projectName', describe: 'Alphanumeric project name' }) .option('r', { alias: 'gitRepoURL', describe: 'The URL of the source Git repo to ezbake' }) .option('b', { alias: 'gitRepoBranch', describe: 'The branch on the source repo which contains the .ezbake folder' }) .option('o', { alias: 'gitOriginURL', describe: 'The URL of the Git destination repo to push to as a remote origin' }) .option('s', { alias: 'simple', describe: 'Flag to indicate Whether to ask for authorName, authorEmail and projectDescription', type: 'boolean', default: false }); }, handler: async argv => { // console.log(argv); let args = sanitizeArgs(argv); // Sanitize Project Name, if passed in as parameter if (args['projectName']) { args['projectName'] = getValidProjectName(args['projectName']); } let baseIngredients = ingredients; const TIMEOUT = 20000; try { // Mise en place baseIngredients = baseIngredients.filter(ingredient => { if (ingredient.name === 'projectName') { // Override default project name if (!args[ingredient.name] && args['gitOriginURL']) { ingredient.default = getDefaultProjectName(args['gitOriginURL']); } } // Exclude fields for which the values have already been provided with the command if (args[ingredient.name]) { console.log(`> ${ingredient.name}: ${args[ingredient.name]}`); return false; } // Exclude some fields in case of simple setup if ( args['simple'] && ['authorName', 'authorEmail', 'projectDescription'].includes( ingredient.name ) ) { return false; } return true; }); let projectIngredients = await inquirer.prompt(baseIngredients); projectIngredients = Object.assign(projectIngredients, args); projectIngredients.projectName = await checkForExistingFolder( ui, projectIngredients.projectName ); // Check if the repo is valid await cloneRepo( ui, projectIngredients.gitRepoURL, projectIngredients.gitRepoBranch, projectIngredients.projectName ).catch(invalidGitRepo); let recipe = readAndInitializeProjectRecipe( ui, projectIngredients.projectName, projectIngredients.gitRepoURL, projectIngredients.gitRepoBranch ); // Remove git bindings await promiseTimeout( TIMEOUT, deleteGitFolder(ui, projectIngredients.projectName) ).catch(err => { throw new Error(`Error: ${err} while deleting cloned Git folder.`); }); // Ask away! let ingredients = await inquirer.prompt(recipe.ingredients); let allIngredients = Object.assign( { ...projectIngredients, ...ingredients }, { projectNameDocker: projectIngredients.projectName.replace(/-/g, '_'), projectAuthor: projectIngredients.authorName + ' <' + projectIngredients.authorEmail + '>' } ); bakeProject(ui, allIngredients, recipe); // .env file setup if (recipe.env) { let envAnswers = await inquirer.prompt(recipe.env); createEnvFile(ui, projectIngredients.projectName, envAnswers); } // Finally, establish a local .git binding // And optionally add the specified remote await promiseTimeout( TIMEOUT, establishLocalGitBindings(ui, projectIngredients.projectName) ).catch(err => { throw new Error(`Error: ${err} while establishing Git bindings.`); }); if (projectIngredients.gitOriginURL) { await addGitRemote( ui, projectIngredients.gitOriginURL, projectIngredients.projectName ); } if (recipe.icing && Array.isArray(recipe.icing)) { ui.log.write(`. Applying icing...`); let projectDir = path.join( process.cwd(), `./${projectIngredients.projectName}` ); process.chdir(projectDir); for (let icing of recipe.icing) { ui.log.write(` . ${icing.description}`); if (Array.isArray(icing.cmd)) { await executeCommand( addIngredients(icing.cmd, allIngredients), icing.cmdOptions ); } } ui.log.write(`. Icing applied!`); } // Finally, stage and commit the changes. // And optionally push to a remote repo await stageChanges( ui, '[ezbake] - initial commit', projectIngredients.projectName ); if (projectIngredients.gitOriginURL) { await pushLocalGitToOrigin( ui, projectIngredients.gitOriginURL, projectIngredients.projectName ); } ui.log.write(`. Your project is ready!`); process.exit(0); } catch (error) { ui.log.write(error.message); process.exit(-1); } } };
appirio-digital/ezbake
commands/prepare.js
JavaScript
mit
6,465
import React from 'react' import { useSelector } from 'react-redux' import Container from 'react-bootstrap/Container' import Row from 'react-bootstrap/Row' import Col from 'react-bootstrap/Col' import MoveSelector from '../containers/move-selector' import Footer from '../containers/footer' import Player from '../containers/player' import WelcomeDlg from '../containers/welcome-dlg' import History from '../features/history' import { GlobalState } from '../reducers/consts' const Game = () => { const showWelcome = useSelector(state => state.globalState === GlobalState.New) return ( <> <WelcomeDlg show={showWelcome} /> <Container> <Row> <Col> <Player color='white' /> </Col> <Col> <Player color='black' right /> </Col> </Row> <Row> <Col className='px-0'> <MoveSelector /> </Col> <Col sm='3' className='pr-0 pl-1'> <History /> </Col> </Row> <Row> <Col className='px-0'> <Footer /> </Col> </Row> </Container> </> ) } export default Game
koscelansky/Dama
src/components/game.js
JavaScript
mit
1,182
<!-- TOC --> - [General](#general) - [R](#r) - [Installazione](#installazione) - [Scraping](#scraping) - [scrape](#scrape) - [Installazione](#installazione-1) - [XML](#xml) - [xml2json](#xml2json) - [Installazione](#installazione-2) - [XMLStarlet](#xmlstarlet) - [Installazione](#installazione-3) - [JSON](#json) - [jq](#jq) - [Installazione](#installazione-4) - [CSV](#csv) - [csvkit](#csvkit) - [Installazione](#installazione-5) - [Miller](#miller) - [Installazione](#installazione-6) - [HTML](#html) - [pup](#pup) - [YAML](#yaml) - [yq](#yq) - [gestione date e tempo](#gestione-date-e-tempo) - [dateutils](#dateutils) <!-- /TOC --> # General ## R ### Installazione `sudo apt-get -y install r-base` # Scraping ## scrape > Extract HTML elements using an XPath query or CSS3 selector. URL: [https://github.com/jeroenjanssens/data-science-at-the-command-line/blob/master/tools/scrape](https://github.com/jeroenjanssens/data-science-at-the-command-line/blob/master/tools/scrape) ### Installazione È uno script `python` quindi è necessario che sia installato nella propria macchina. Richiede che sia preinstallato `lxml` (è un modulo python), che su una macchina LINUX si installa con: sudo apt-get install libxml2-dev libxslt1-dev python-dev e poi sudo apt-get install python-lxml E richiede anche il modulo python `cssselect`, che si installa con sudo pip install cssselect Devo scaricarlo, renderlo eseguibile e inserirlo nel PATH: ```bash # vado nella cartella home dell'utente cd ~ # scarico scrape, un tool di scraping curl -sL "https://github.com/jeroenjanssens/data-science-at-the-command-line/raw/master/tools/scrape" > scrape # rendo il file eseguibile chmod +x scrape # creo nella home dell'utente la cartella bin mkdir ~/bin # copio scrape nella cartella creata cp scrape ~/bin # modifico il file con le preferenze dell'utente # NOTA BENE: nano è un editor di testo a riga di comando. se non installato: sudo apt-get install nano nano ~/.bashrc # aggiungo nell'ultima riga la stringa di sotto export PATH=$PATH:~/bin # salvo ed esco da nano # passo all'ambiente le modifiche fatte ~/.bash_profile` ``` # XML ## xml2json Converte una fonte `XML` in `JSON`. URL: [https://github.com/Inist-CNRS/node-xml2json-command](https://github.com/Inist-CNRS/node-xml2json-command) ### Installazione È basato su `nodejs` e quindi lo richiede. Se `nodejs` è installato lanciare il comando `npm install xml2json-command`. Per installare `nodejs` su Linux (testato con Ubuntu 14.04): curl -sL https://deb.nodesource.com/setup | sudo bash - e poi sudo apt-get install nodejs ## XMLStarlet > XMLStarlet is a set of command line utilities (tools) which can be used to transform, query, validate, and edit XML documents and files using simple set of shell commands in similar way it is done for plain text files using UNIX grep, sed, awk, diff, patch, join, etc commands. URL: [http://xmlstar.sourceforge.net/](http://xmlstar.sourceforge.net/) ### Installazione Per windows è disponibile come eseguibile su [SourceForge](https://sourceforge.net/projects/xmlstar/files/). Su Linux (testato con Ubuntu 14.04) si installa con sudo apt-get update sudo apt-get install xmlstarlet # JSON ## jq > jq is like sed for JSON data - you can use it to slice and filter and map and transform structured data with the same ease that sed, awk, grep and friends let you play with text. URL: [https://stedolan.github.io/jq/](https://stedolan.github.io/jq/) ### Installazione Per Windows è possibile scaricare l'eseguibile. Su Linux (testato con Ubunut 14.04) si installa con sudo apt-get install jq # CSV ## csvkit > csvkit is a suite of command-line tools for converting to and working with CSV, the king of tabular file formats. URL: [https://csvkit.readthedocs.io](https://csvkit.readthedocs.io) ### Installazione È basata su Python, quindi lo richiede: sudo apt-get install python-dev python-pip python-setuptools build-essential Si installa con sudo pip install csvkit ## Miller Miller è "come awk, sed, cut, join, e sort" in un'unica applicazione. URL: [http://johnkerl.org/miller/doc/index.html](http://johnkerl.org/miller/doc/index.html) ### Installazione La modalità che consiglio è quella di scaricare l'ultimo eseguibile precompilato dalla sezione release del repo github: [https://github.com/johnkerl/miller/releases](https://github.com/johnkerl/miller/releases). **Nota**: non ho idea se sia compilabile per Windows. # HTML ## pup > pup is a command line tool for processing HTML. It reads from stdin, prints to stdout, and allows the user to filter parts of the page using CSS selectors. URL: [https://github.com/ericchiang/pup](https://github.com/ericchiang/pup) # YAML ## yq > Pure Python implementation of a subset of the features of jq for YAML documents. URL: [https://github.com/kislyuk/yq](https://github.com/kislyuk/yq) # gestione date e tempo ## dateutils Una comodissiam suite di utility per gestire date e tempo da riga di comando URL: [https://github.com/hroptatyr/dateutils](https://github.com/hroptatyr/dateutils)
aborruso/quaderno
datautilities/README.md
Markdown
mit
5,440
namespace EnergyTrading.MDM.Test.Contracts.Validators { using System; using System.Collections.Generic; using System.Linq; using EnergyTrading.MDM.ServiceHost.Unity.Configuration; using global::MDM.ServiceHost.Unity.Sample.Configuration; using Microsoft.Practices.Unity; using NUnit.Framework; using Moq; using EnergyTrading.MDM.Contracts.Validators; using EnergyTrading; using EnergyTrading.Data; using EnergyTrading.Validation; using EnergyTrading.MDM; using Broker = EnergyTrading.MDM.Contracts.Sample.Broker; [TestFixture] public partial class BrokerValidatorFixture : Fixture { [Test] public void ValidatorResolution() { var container = CreateContainer(); var meConfig = new SimpleMappingEngineConfiguration(container); meConfig.Configure(); var repository = new Mock<IRepository>(); container.RegisterInstance(repository.Object); var config = new BrokerConfiguration(container); config.Configure(); var validator = container.Resolve<IValidator<Broker>>("broker"); // Assert Assert.IsNotNull(validator, "Validator resolution failed"); } [Test] public void ValidBrokerPasses() { // Assert var start = new DateTime(1999, 1, 1); var system = new MDM.SourceSystem { Name = "Test" }; var systemList = new List<MDM.SourceSystem> { system }; var systemRepository = new Mock<IRepository>(); var repository = new StubValidatorRepository(); systemRepository.Setup(x => x.Queryable<MDM.SourceSystem>()).Returns(systemList.AsQueryable()); var identifier = new EnergyTrading.Mdm.Contracts.MdmId { SystemName = "Test", Identifier = "1", StartDate = start.AddHours(-10), EndDate = start.AddHours(-5) }; var validatorEngine = new Mock<IValidatorEngine>(); var validator = new BrokerValidator(validatorEngine.Object, repository); var broker = new Broker { Details = new EnergyTrading.MDM.Contracts.Sample.BrokerDetails{Name = "Test"}, Identifiers = new EnergyTrading.Mdm.Contracts.MdmIdList { identifier } }; this.AddRelatedEntities(broker); // Act var violations = new List<IRule>(); var result = validator.IsValid(broker, violations); // Assert Assert.IsTrue(result, "Validator failed"); Assert.AreEqual(0, violations.Count, "Violation count differs"); } [Test] public void OverlapsRangeFails() { // Assert var start = new DateTime(1999, 1, 1); var finish = new DateTime(2020, 12, 31); var validity = new DateRange(start, finish); var system = new MDM.SourceSystem { Name = "Test" }; var brokerMapping = new PartyRoleMapping { System = system, MappingValue = "1", Validity = validity }; var list = new List<PartyRoleMapping> { brokerMapping }; var repository = new Mock<IRepository>(); repository.Setup(x => x.Queryable<PartyRoleMapping>()).Returns(list.AsQueryable()); var systemList = new List<MDM.SourceSystem>(); var systemRepository = new Mock<IRepository>(); systemRepository.Setup(x => x.Queryable<MDM.SourceSystem>()).Returns(systemList.AsQueryable()); var overlapsRangeIdentifier = new EnergyTrading.Mdm.Contracts.MdmId { SystemName = "Test", Identifier = "1", StartDate = start.AddHours(10), EndDate = start.AddHours(15) }; var identifierValidator = new NexusIdValidator<PartyRoleMapping>(repository.Object); var validatorEngine = new Mock<IValidatorEngine>(); validatorEngine.Setup(x => x.IsValid(It.IsAny<EnergyTrading.Mdm.Contracts.MdmId>(), It.IsAny<IList<IRule>>())) .Returns((EnergyTrading.Mdm.Contracts.MdmId x, IList<IRule> y) => identifierValidator.IsValid(x, y)); var validator = new BrokerValidator(validatorEngine.Object, repository.Object); var broker = new Broker { Identifiers = new EnergyTrading.Mdm.Contracts.MdmIdList { overlapsRangeIdentifier } }; // Act var violations = new List<IRule>(); var result = validator.IsValid(broker, violations); // Assert Assert.IsFalse(result, "Validator succeeded"); } [Test] public void BadSystemFails() { // Assert var start = new DateTime(1999, 1, 1); var finish = new DateTime(2020, 12, 31); var validity = new DateRange(start, finish); var system = new MDM.SourceSystem { Name = "Test" }; var brokerMapping = new PartyRoleMapping { System = system, MappingValue = "1", Validity = validity }; var list = new List<PartyRoleMapping> { brokerMapping }; var repository = new Mock<IRepository>(); repository.Setup(x => x.Queryable<PartyRoleMapping>()).Returns(list.AsQueryable()); var badSystemIdentifier = new EnergyTrading.Mdm.Contracts.MdmId { SystemName = "Jim", Identifier = "1", StartDate = start.AddHours(-10), EndDate = start.AddHours(-5) }; var identifierValidator = new NexusIdValidator<PartyRoleMapping>(repository.Object); var validatorEngine = new Mock<IValidatorEngine>(); validatorEngine.Setup(x => x.IsValid(It.IsAny<EnergyTrading.Mdm.Contracts.MdmId>(), It.IsAny<IList<IRule>>())) .Returns((EnergyTrading.Mdm.Contracts.MdmId x, IList<IRule> y) => identifierValidator.IsValid(x, y)); var validator = new BrokerValidator(validatorEngine.Object, repository.Object); var broker = new Broker { Identifiers = new EnergyTrading.Mdm.Contracts.MdmIdList { badSystemIdentifier } }; // Act var violations = new List<IRule>(); var result = validator.IsValid(broker, violations); // Assert Assert.IsFalse(result, "Validator succeeded"); } partial void AddRelatedEntities(EnergyTrading.MDM.Contracts.Sample.Broker contract); } }
RWE-Nexus/EnergyTrading-MDM-Sample
Code/Service/MDM.UnitTest.Sample/Contracts/Validators/BrokerValidatorFixture.cs
C#
mit
6,568
## THIS REPO IS DEPRECATED (THIS PROJECT HAS BEEN MERGED)!! GO HERE, INSTEAD: https://github.com/apache/zeppelin/tree/master/elasticsearch # zeppelin-elasticsearch-interpreter Elasticsearch Interpreter for [Appache Zeppelin](https://zeppelin.incubator.apache.org/). ![Search pie](/docs/images/search_pie.png) ## Build It's a Maven project, so it's simple: ```bash mvn clean package ``` You should have a `elasticsearch-interpreter-jar-with-dependencies.jar` in the _target_ directory. ## Install `ZEPPELIN_HOME` is your Zeppelin installation directory. * Create a directory in <ZEPPELIN_HOME>/interpreters: ```bash cd <ZEPPELIN_HOME>/interpreters mkdir elasticsearch ``` * Copy the jar of elasticsearch-interpreter in the directory `<ZEPPELIN_HOME>/interpreters/elasticsearch`. * In `<ZEPPELIN HOME>/conf/zeppelin-site.xml`, add the interpreter class: ```xml <property> <name>zeppelin.interpreters</name> <value>__io.millesabords.zeppelin.elasticsearch.ElasticsearchInterpreter__,org.apache.zeppelin.spark.SparkInterpreter,...</value> <description>Comma separated interpreter configurations. First interpreter become a default</description> </property> ``` * Start Zeppelin: ```bash <ZEPPELIN_HOME>/bin/zeppelin-daemon.sh start ``` ## How to use the interpreter ### Configuration First, you have to configure the interpreter by setting the values of: * the name of the cluster * the host of a node * the port of node ![Config](/docs/images/config.png) ### Commands In a paragraph, use `%els` to select the Elasticsearch interpreter and then input all commands. #### get With the `get` command, you can get a document. ```bash | get /index/type/id ``` Example: ![Get](/docs/images/get.png) #### search With the `search` command, you can send a search query in Elasticsearch. ```bash | search /index1,index2,.../type1,type2,... <size of the response> <JSON document containing the query> ``` Example: * With a table containing the results: ![Search - table](/docs/images/search_table.png) * You can also use a predefined diagram: ![Search - table](/docs/images/search_pie.png) #### count With the `count` command, you can count documents in Elasticsearch. ```bash | count /index1,index2,.../type1,type2,... ``` Example: ![Count](/docs/images/count.png) #### index With the `index` command, you can index a new document in Elasticsearch. ```bash | index /index/type/id <JSON document> | index /index/type <JSON document> ``` #### get With the `delete` command, you can delete a document. ```bash | delete /index/type/id ``` ### Why 'commands' instead of using http methods ? Because, I think it's more easier to understand/write/maintain commands than HTTP requests. And it's closer to the Java API that uses XXXRequest, where XXX is Count, Search or Delete.
bbonnin/zeppelin-elasticsearch-interpreter
README.md
Markdown
mit
2,801
/**********************************************************\ | | | hprose | | | | Official WebSite: http://www.hprose.com/ | | http://www.hprose.org/ | | | \**********************************************************/ /**********************************************************\ * * * Callback.java * * * * Callback interface for Java. * * * * LastModified: Apr 10, 2016 * * Author: Ma Bingyao <[email protected]> * * * \**********************************************************/ package hprose.util.concurrent; public interface Callback<V> {}
mikeqian/hprose-java
src/main/java/hprose/util/concurrent/Callback.java
Java
mit
1,155
class LateMigration < ActiveRecord::Migration def up puts "Doing schema LateMigration" end def down puts "Undoing LateMigration" end end
ajvargo/data-migrate
spec/db/migrate/4.2/20131111111111_late_migration.rb
Ruby
mit
154
--- layout: tags title: merge ---
litejs/litejs.github.io
tags/merge.md
Markdown
mit
34
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `mk_bare_fn` fn in crate `rustc_typeck`."> <meta name="keywords" content="rust, rustlang, rust-lang, mk_bare_fn"> <title>rustc_typeck::middle::ty::mk_bare_fn - Rust</title> <link rel="stylesheet" type="text/css" href="../../../main.css"> <link rel="shortcut icon" href="http://www.rust-lang.org/favicon.ico"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <section class="sidebar"> <a href='../../../rustc_typeck/index.html'><img src='http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='' width='100'></a> <p class='location'><a href='../../index.html'>rustc_typeck</a>::<wbr><a href='../index.html'>middle</a>::<wbr><a href='index.html'>ty</a></p><script>window.sidebarCurrent = {name: 'mk_bare_fn', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> </section> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press 'S' to search, '?' for more options..." type="search"> </div> </form> </nav> <section id='main' class="content fn"> <h1 class='fqn'><span class='in-band'>Function <a href='../../index.html'>rustc_typeck</a>::<wbr><a href='../index.html'>middle</a>::<wbr><a href='index.html'>ty</a>::<wbr><a class='fn' href=''>mk_bare_fn</a><wbr><a class='stability Unstable' title=''>Unstable</a></span><span class='out-of-band'><span id='render-detail'> <a id="collapse-all" href="#">[-]</a>&nbsp;<a id="expand-all" href="#">[+]</a> </span><a id='src-218308' href='../../../rustc/middle/ty/fn.mk_bare_fn.html?gotosrc=218308'>[src]</a></span></h1> <pre class='rust fn'>pub fn mk_bare_fn(cx: &amp;<a class='struct' href='../../../rustc_typeck/middle/ty/struct.ctxt.html' title='rustc_typeck::middle::ty::ctxt'>ctxt</a>&lt;'tcx&gt;, opt_def_id: <a class='enum' href='../../../core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='struct' href='http://doc.rust-lang.org/nightly/syntax/ast/struct.DefId.html' title='syntax::ast::DefId'>DefId</a>&gt;, fty: &amp;'tcx <a class='struct' href='../../../rustc_typeck/middle/ty/struct.BareFnTy.html' title='rustc_typeck::middle::ty::BareFnTy'>BareFnTy</a>&lt;'tcx&gt;) -&gt; &amp;'tcx <a class='struct' href='../../../rustc_typeck/middle/ty/struct.TyS.html' title='rustc_typeck::middle::ty::TyS'>TyS</a>&lt;'tcx&gt;</pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <div id="help" class="hidden"> <div class="shortcuts"> <h1>Keyboard shortcuts</h1> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h1>Search tricks</h1> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>typedef</code> (or <code>tdef</code>). </p> </div> </div> <script> window.rootPath = "../../../"; window.currentCrate = "rustc_typeck"; window.playgroundUrl = ""; </script> <script src="../../../jquery.js"></script> <script src="../../../main.js"></script> <script async src="../../../search-index.js"></script> </body> </html>
ArcherSys/ArcherSys
Rust/share/doc/rust/html/rustc_typeck/middle/ty/fn.mk_bare_fn.html
HTML
mit
4,495
const fs = require('fs'); const path = require('path'); class Service { constructor() { this.getFileRecursevly = this.getFileRecursevly.bind(this); this.getFiles = this.getFiles.bind(this); } getFileRecursevly(folderPath, shortPath = '') { var files = []; var folder = fs.readdirSync(path.resolve(__dirname, folderPath)); var x = folder.forEach(file => { var filePath = path.resolve(folderPath, file); if (fs.lstatSync(filePath).isDirectory()) { files.push({ folder: file, files: this.getFileRecursevly(filePath, file) }) } else { files.push({ file: file, folder: shortPath }); } }) return files; } getFiles(path) { return new Promise((resolve, reject) => { var files = this.getFileRecursevly(path) resolve(files) }) } } module.exports = Service;
blckt/electron
app/src/TreeView/service.js
JavaScript
mit
1,003
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="MemoryStandardStream.Read.cs" company="Naos Project"> // Copyright (c) Naos Project 2019. All rights reserved. // </copyright> // -------------------------------------------------------------------------------------------------------------------- namespace Naos.Database.Domain { using System; using System.Collections.Generic; using System.Linq; using OBeautifulCode.Assertion.Recipes; using OBeautifulCode.Serialization; using static System.FormattableString; public partial class MemoryStandardStream { /// <inheritdoc /> public override IReadOnlyCollection<long> Execute( StandardGetInternalRecordIdsOp operation) { throw new NotImplementedException(); /* operation.MustForArg(nameof(operation)).NotBeNull(); var memoryDatabaseLocator = operation.GetSpecifiedLocatorConverted<MemoryDatabaseLocator>() ?? this.TryGetSingleLocator(); lock (this.streamLock) { IReadOnlyCollection<long> ProcessDefaultReturn() { switch (operation.RecordNotFoundStrategy) { case RecordNotFoundStrategy.ReturnDefault: return new long[0]; case RecordNotFoundStrategy.Throw: throw new InvalidOperationException(Invariant($"Expected stream {this.StreamRepresentation} to contain a matching record for {operation}, none was found and {nameof(operation.RecordNotFoundStrategy)} is '{operation.RecordNotFoundStrategy}'.")); default: throw new NotSupportedException(Invariant($"{nameof(RecordNotFoundStrategy)} {operation.RecordNotFoundStrategy} is not supported.")); } } this.locatorToRecordPartitionMap.TryGetValue(memoryDatabaseLocator, out var partition); if (partition == null) { return ProcessDefaultReturn(); } var result = partition .Where( _ => _.Metadata.FuzzyMatchTypes( operation.RecordFilter.IdTypes, operation.RecordFilter.ObjectTypes, operation.RecordFilter.VersionMatchStrategy)) .Select(_ => _.InternalRecordId) .Union( operation.RecordFilter.Ids.Any() partition .Where( _ => _.Metadata.FuzzyMatchTypesAndId( operation.StringSerializedId, operation.IdentifierType, operation.ObjectType, operation.VersionMatchStrategy)) .Select(_ => _.InternalRecordId)) .ToList(); if (result.Any()) { return result; } else { return ProcessDefaultReturn(); } } */ } /// <inheritdoc /> public override IReadOnlyCollection<StringSerializedIdentifier> Execute( StandardGetDistinctStringSerializedIdsOp operation) { operation.MustForArg(nameof(operation)).NotBeNull(); var result = new HashSet<StringSerializedIdentifier>(); lock (this.streamLock) { var locators = new List<MemoryDatabaseLocator>(); if (operation.SpecifiedResourceLocator != null) { locators.Add(operation.GetSpecifiedLocatorConverted<MemoryDatabaseLocator>()); } else { var allLocators = this.ResourceLocatorProtocols.Execute(new GetAllResourceLocatorsOp()); foreach (var locator in allLocators) { locators.Add(locator.ConfirmAndConvert<MemoryDatabaseLocator>()); } } foreach (var memoryDatabaseLocator in locators) { this.locatorToRecordPartitionMap.TryGetValue(memoryDatabaseLocator, out var partition); if (partition != null) { foreach (var streamRecord in partition) { if (streamRecord.Metadata.FuzzyMatchTypes( operation.RecordFilter.IdTypes, operation.RecordFilter.ObjectTypes, operation.RecordFilter.VersionMatchStrategy) && ((!operation.RecordFilter.Tags?.Any() ?? true) || streamRecord.Metadata.Tags.FuzzyMatchTags(operation.RecordFilter.Tags, operation.RecordFilter.TagMatchStrategy))) { result.Add( new StringSerializedIdentifier( streamRecord.Metadata.StringSerializedId, streamRecord.Metadata.TypeRepresentationOfId.GetTypeRepresentationByStrategy( operation.RecordFilter.VersionMatchStrategy))); } } } } } return result; } /// <inheritdoc /> public override StreamRecord Execute( StandardGetLatestRecordOp operation) { throw new NotImplementedException(); /* operation.MustForArg(nameof(operation)).NotBeNull(); var memoryDatabaseLocator = operation.GetSpecifiedLocatorConverted<MemoryDatabaseLocator>() ?? this.TryGetSingleLocator(); lock (this.streamLock) { this.locatorToRecordPartitionMap.TryGetValue(memoryDatabaseLocator, out var partition); var result = partition? .OrderByDescending(_ => _.InternalRecordId) .FirstOrDefault( _ => _.Metadata.FuzzyMatchTypes( operation.IdentifierType == null ? null : new[] { operation.IdentifierType, }, operation.ObjectType == null ? null : new[] { operation.ObjectType, }, operation.VersionMatchStrategy)); if (result != null) { return result; } switch (operation.RecordNotFoundStrategy) { case RecordNotFoundStrategy.ReturnDefault: return null; case RecordNotFoundStrategy.Throw: throw new InvalidOperationException(Invariant($"Expected stream {this.StreamRepresentation} to contain a matching record for {operation}, none was found and {nameof(operation.RecordNotFoundStrategy)} is '{operation.RecordNotFoundStrategy}'.")); default: throw new NotSupportedException(Invariant($"{nameof(RecordNotFoundStrategy)} {operation.RecordNotFoundStrategy} is not supported.")); } } */ } /// <inheritdoc /> public override string Execute( StandardGetLatestStringSerializedObjectOp operation) { operation.MustForArg(nameof(operation)).NotBeNull(); var delegatedOp = new StandardGetLatestRecordOp( operation.RecordFilter, operation.RecordNotFoundStrategy, StreamRecordItemsToInclude.MetadataAndPayload, operation.SpecifiedResourceLocator); var record = this.Execute(delegatedOp); string result; if (record == null) { result = null; } else { if (record.Payload is StringDescribedSerialization stringDescribedSerialization) { result = stringDescribedSerialization.SerializedPayload; } else { switch (operation.RecordNotFoundStrategy) { case RecordNotFoundStrategy.ReturnDefault: result = null; break; case RecordNotFoundStrategy.Throw: throw new NotSupportedException(Invariant($"record {nameof(SerializationFormat)} not {SerializationFormat.String}, it is {record.Payload.GetSerializationFormat()}, but {nameof(RecordNotFoundStrategy)} is not {nameof(RecordNotFoundStrategy.ReturnDefault)}")); default: throw new NotSupportedException(Invariant($"{nameof(RecordNotFoundStrategy)} {operation.RecordNotFoundStrategy} is not supported.")); } } } return result; } } }
NaosProject/Naos.Database
Naos.Database.Domain/Protocols/Classes/Stream/MemoryStandard/MemoryStandardStream.Read.cs
C#
mit
10,172
package com.falcon.cms.web.rest; import com.falcon.cms.web.rest.vm.LoggerVM; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.LoggerContext; import com.codahale.metrics.annotation.Timed; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.stream.Collectors; /** * Controller for view and managing Log Level at runtime. */ @RestController @RequestMapping("/management") public class LogsResource { @GetMapping("/logs") @Timed public List<LoggerVM> getList() { LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); return context.getLoggerList() .stream() .map(LoggerVM::new) .collect(Collectors.toList()); } @PutMapping("/logs") @ResponseStatus(HttpStatus.NO_CONTENT) @Timed public void changeLevel(@RequestBody LoggerVM jsonLogger) { LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); context.getLogger(jsonLogger.getName()).setLevel(Level.valueOf(jsonLogger.getLevel())); } }
dooma/falconcms
src/main/java/com/falcon/cms/web/rest/LogsResource.java
Java
mit
1,166
# Change Log All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). ## [3.0.3](https://github.com/sonata-project/SonataCoreBundle/compare/3.0.2...3.0.3) - 2016-06-17 ### Fixed - Add missing exporter service ## [3.0.2](https://github.com/sonata-project/SonataCoreBundle/compare/3.0.1...3.0.2) - 2016-06-06 ### Fixed - Fixed `EntityManagerMockFactory` calling protected methods. This class is used by other bundles for testing. ## [3.0.1](https://github.com/sonata-project/SonataCoreBundle/compare/3.0.0...3.0.1) - 2016-06-01 ### Changed - Updated Bootstrap from version 3.3.5 to version 3.3.6 - Updated Font-awesome from version 4.5.0 to version 4.6.3 ### Fixed - Typo on `choices_as_values` option for `EqualType`
firestorm23/gyrolab-ste
vendor/sonata-project/core-bundle/CHANGELOG.md
Markdown
mit
799
import DateParser from '../date-parser.js'; import ParsedInfo from '../../parsed-info'; import moment from 'moment'; Date.now = jest.fn(() => 1527130897000) test('Parses 12 Jan', () => { const dateParser = new DateParser(); dateParser.parse('12 Jan', ParsedInfo); const { value, startIndex, endIndex } = ParsedInfo.dateParser; expect({ value: value.unix(), startIndex, endIndex }) .toEqual({ value: 1515695400, startIndex: 0, endIndex: 6 }); }); test('Parses 22 May', () => { const dateParser = new DateParser(); dateParser.parse('22 May', ParsedInfo); const { value, startIndex, endIndex } = ParsedInfo.dateParser; expect({ value: value.unix(), startIndex, endIndex }) .toEqual({ value: 1526927400, startIndex: 0, endIndex: 6 }); });
p-v/samay.js
src/parser/english/__test__/date-parser.test.js
JavaScript
mit
758
package tranquvis.simplesmsremote.CommandManagement.Modules; /** * Created by Andreas Kaltenleitner on 31.10.2016. */ public class ModuleAudioTest extends ModuleTest { }
tranquvis/SimpleSmsRemote
app/src/androidTest/java/tranquvis/simplesmsremote/CommandManagement/Modules/ModuleAudioTest.java
Java
mit
172
--- topic: "Turtle Letters: 04" desc: "Planning your letters inside a bounding box (planning P and C)" indent: true --- {% include turtle_letters_header.html %} For each letter that you and your pair partner are going to draw, start by drawing a bounding box like this on on a piece of paper. <img src="BoundingBox.png" title="BoundingBox.png" alt="BoundingBox.png" height="200" /> For example, consider my name: "Phill Conrad". I might plan out bounding boxes like these. Here, I've chosen each of the important points, and labelled them. Note, though, that these are only examples. I don't expect that everyone with a P or a C in their name will make the same choices about how to shape the letters. In fact, I hope each of you will make slightly different choices. <img src="BoundingBoxP1.png" title="fig:BoundingBoxP1.png" alt="BoundingBoxP1.png" height="200" /> <img src="BoundingBoxC1.png" title="fig:BoundingBoxC1.png" alt="BoundingBoxC1.png" height="200" /> For instance, as an alternative, I might use bounding boxes like these: <img src="BoundingBoxP2.png" title="fig:BoundingBoxP2.png" alt="BoundingBoxP2.png" height="200" /> <img src="BoundingBoxC2.png" title="fig:BoundingBoxC2.png" alt="BoundingBoxC2.png" height="200" /> Or even these, if I get ambitious, and want to try to make rounded shapes using the turtle's [circle](http://docs.python.org/3.3/library/turtle.html#turtle.circle) function (note: that's a link to the documentation!) <img src="BoundingBoxP3.png" title="fig:BoundingBoxP3.png" alt="BoundingBoxP3.png" height="200" /> <img src="BoundingBoxC3.png" title="fig:BoundingBoxC3.png" alt="BoundingBoxC3.png" height="200" /> A warning about that last approach: although it may seem like it isn't that tough, there are some subtle traps. For example, in the C, what if we are drawing a short, fat C where height &gt; width? Then h-w will be negative, and there may be "issues". You might find that you would need more than one drawing, one for when (h-w)&gt;0, and a different approach when (h-w)&lt;0, and then use an if/else statement in your drawing code. It might be better to stick to approaches that don't involve interaction between height and width, which probably means straight lines. If you and your partner are up for the challenge of using curves and circles, you are welcome to try, but I advocate trying the straight line approach FIRST just to be safe. Once you've planned your letters on paper, you are ready to start coding.
ucsb-cs8/ucsb-cs8.github.io
_tutorials/turtle_letters_04.md
Markdown
mit
2,483
#include "stdafx.h" #include "record.hpp" namespace tc { namespace log { const char* record::type_acronym( void ) const { switch( type ) { case log::trace: return "T"; case log::debug: return "D"; case log::info: return "I"; case log::warn: return "W"; case log::error: return "E"; case log::fatal: return "F"; case log::all: return "A"; default: return "!"; } return "?"; } record::record( tc::log::type type , const tc::log::tag& tag ) : type(type) , tag(tag) , ts(tc::timestamp::now()) , tid(tc::threading::current_thread_id()) { } record::~record( void ) { } }}
aoziczero/deprecated-libtc
srcs/tc.log/record.cpp
C++
mit
591
/* Header Styles */ header.main{ background: rgb(252,252,252); /* Old browsers */ /* IE9 SVG, needs conditional override of 'filter' to 'none' */ background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZjZmNmYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmMmViZWEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); background: -moz-linear-gradient(top, rgba(252,252,252,1) 0%, rgba(242,235,234,1) 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(252,252,252,1)), color-stop(100%,rgba(242,235,234,1))); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, rgba(252,252,252,1) 0%,rgba(242,235,234,1) 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, rgba(252,252,252,1) 0%,rgba(242,235,234,1) 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, rgba(252,252,252,1) 0%,rgba(242,235,234,1) 100%); /* IE10+ */ background: linear-gradient(to bottom, rgba(252,252,252,1) 0%,rgba(242,235,234,1) 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfcfc', endColorstr='#f2ebea',GradientType=0 ); /* IE6-8 */ border-bottom:3px solid #c6065c; } header.main h1{margin:30px 0 0 0} header.main img{border:none;} /*header.main li{border-right:1px solid #222} header.main li:nth-child(1){border-left:1px solid #222} */ header.main nav li{list-style:none;} header.main nav li a{ padding:35px 8px 22px 8px; display:block; color:#ccc; } header.main nav li a:hover{ text-decoration: none; } header.main nav li span.nav-title, header.main nav li span.nav-sub-title{ font:bold 22px Arial, Helvetica, sans-serif; color:#c6065c; display:block; } header.main nav li span.nav-sub-title{ font:normal 11px Arial, Helvetica, sans-serif; color:#333; } header.main nav li.active, header.main nav li a:hover{background:#c6065c;} header.main nav li.active{ border-left:1px solid #e2f846; border-right:1px solid #e2f846; } header.main nav li.active a, header.main nav li.active span, header.main nav li a:hover, header.main nav li a:hover span{color:#fff;} /* Content */ /* General Content Styles */ div.main{ /*background:url(../images/bg-content.jpg) #000;*/ padding:20px 0; color:#333; line-height:22px; } div.main a{ color:#c6065c;} div.main.home .content{ box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 0 0 1px rgba(0, 0, 0, 0.15) inset, 0 1px 1px rgba(0, 0, 0, 0.2); border-right:1px solid #222; } /* sections default */ div.main section{ padding:10px; border-left:1px solid #999; border-top:1px solid #999; background:#ececec; } div.main section:hover { background:#cacaca; } div.main section.load-more{border-bottom:1px solid #999;} div.main section.load-more:hover{} div.main section.load-more{ padding:20px; margin:0 auto; width:100%; display:block; text-align:center; color:#c6065c; } div.main section.active img{opacity:1;} div.main section.active figure{} div.main section.active figcaption{} div.main section.active figcaption p{} div.main section.active figcaption h3{} div.main section footer{} div.main section footer div.fb-like, div.main section footer nav, div.main section footer address, div.main section footer nav ul{display:inline;} div.main section footer div.fb-like img{border:0;} /*div.main section img{ opacity: 0.9; -moz-opacity: 0.9; filter:alpha(opacity=9); }*/ div.main section.active img{ opacity: 1; -moz-opacity: 1; filter:alpha(opacity=1); } div.main section nav.post-stats{text-align:right;} div.main section nav.post-stats li{display:inline-block;} div.main section nav.post-stats li.star{ background:url(../images/star-sprite.png); height:21px; width:21px; } div.main section nav.post-stats li.star span{display:none;} div.main section nav.post-stats li a{ font:normal 14px Arial, Helvetica, sans-serif; padding:3px 5px; border-radius: 5px; } div.main section nav.post-stats li.pings a{ background:#c6065c; border:1px solid #2b1009; color:#fff; } div.main section nav.post-stats li.comments a{ background:#2b1009; border:1px solid #2b1009; color:#fff; } div.main section footer div.fb-like{ display:none; } /* Homepage Welcome - Social Box */ div.main div.welcome h1{ margin:5px 0; font:bold 24px Helvetica; } div.main div.home-chrome{ margin-bottom:10px; padding:5px; border:1px solid #333; background:#ececec; } /* Carousel Section */ section.carousel{ background:#fce6d3; height:400px; } section.carousel .carousel-button{ position:absolute; top:40%; display:none; /* initally hidden */ } section.carousel .carousel-button a{ display:block; padding:10px; margin:5px; border:1px solid #333; background:#222; color:#fff; font:bold 12px Arial, Helvetica, sans-serif; opacity: 0.7; -moz-opacity: 0.7; filter:alpha(opacity=7); } section.carousel .carousel-button a:hover{ background:#c6065c; border:1px solid #fff; } section.carousel .prev{left:0} section.carousel .next{right:0} section.carousel figure{ margin:0px 10px; border:5px solid #333; } section.carousel.active figure{border:5px solid #222;} section.carousel figcaption{ margin:-64px 0 0 0; background:#2b1009; opacity: 0.8; -moz-opacity: 0.8; filter:alpha(opacity=8); padding:10px; } section.carousel.active figcaption{background:#000;} section.carousel figcaption h3{ font:bold 16px Arial, Helvetica, sans-serif; color:#fff; margin:0; } section.carousel.active figcaption h3{} section.carousel figcaption p{ font:normal 12px Arial, Helvetica, sans-serif; color:#eee; margin:0; text-overflow: ellipsis; /* will make [...] at the end */ white-space: nowrap; /* paragraph to one line */ overflow:hidden; } section.carousel.active figcaption p{} section.carousel footer{ margin:0 15px; padding:2px 15px; } section.carousel footer span, section.carousel footer time, section.carousel footer address{} /* Box Section */ section.box, section.box.active{ height:400px; overflow:hidden; } section.box p{ margin:0; overflow:hidden; } section.box.active p{margin:0;} section.box span.more{ float:right; } section.box h3, section.box.active h3{ font:bold 18px Arial, Helvetica, sans-serif; color:#fff; margin:5px 0; line-height:18px; } section.box.active h3{} section.box div span, section.box div time, section.box div address{display:inline;} section.box footer{ padding:5px 0; width:100%; } section.box figure, section.box.active figure{ width:100%; height:200px; overflow:hidden; } section.box footer div{ position:absolute; top:185px; } section.box div.fb-like{ position:absolute; top:175px; display:none; } section.box div.like-convert{top:370px;} section.box div.details-convert{top:370px;} section.box div.video-thumbs{ display:none; } section.box div.video-thumbs img{padding:5px;} section.box nav.post-stats{ position:absolute; top:365px; right:10px; } /* Small Box Section */ section.small-box{height:200px;} section.small-box p{ line-height:22px; margin:0; display:none; width:200px; } section.small-box.active p{width:200px;} section.small-box h3{ font:bold 16px Arial, Helvetica, sans-serif; color:#fff; margin:5px 0; line-height:18px; } section.small-box nav.post-stats, section.small-box div.fb-like{ position:absolute; top:165px; } section.small-box nav.post-stats{right:10px;} section.small-box div.fb-like{left:10px;} section.small-box div.video-thumbs{display:none;} section.small-box div.post-details{visibility:hidden;} section.small-box span.more{display:none;} /* Skyscraper Section */ section.skyscraper{height:400px;} section.skyscraper h3{ font:bold 16px Arial, Helvetica, sans-serif; color:#fff; margin:5px 0; line-height:22px; } /* Listing Section */ div.main section.listing, div.main section.listing.active, div.main article.post section.load-more{ overflow:hidden; background:none; background:transparent; border:none; border-top:1px solid #cacaca; line-height:22px; } div.main article.post section.load-more{ border-bottom:2px solid #cacaca; } div.main article.post section.load-more:hover{ background:#ececec; } div.main section.listing:hover{ background:#ececec; } section.listing p{ margin:0 0 0 1em; overflow:hidden; } section.listing.active p{margin:0 0 0 1em;} section.listing span.more{display:none;} section.listing.active span.more{ text-align:right; display:block; } section.listing h3, section.listing.active h3{ font:bold 1.5em Arial, Helvetica, sans-serif; color:#fff; margin:5px 10px; line-height:18px; } section.listing.active h3{} section.listing div span, section.listing div time, section.listing div address{display:inline;} section.listing footer{ padding:20px 0 0 0; width:100%; } section.listing figure, section.listing.active figure{overflow:hidden;} section.listing footer div{ } section.listing div.fb-like{display:none;} section.listing div.video-thumbs{width:100%;} section.listing nav.post-stats{right:0;} section.listing footer div{font:italic 11px verdana;} section.listing footer div a{color:#aaa;} nav.post-carousel{ list-style:none; margin:0 auto; text-align:center; } nav.post-carousel ul li{ display:inline-block; font:bold 20px Arial, Helvetica, sans-serif; } /* Widgets Sidebar */ h3.widget-title{ color:#c6065c; } /* Sidebar Styles */ div.main aside.widget-area nav, div.main aside.widget-area div.fb-panel{ background:#000; border-right:5px solid #222; border-bottom::5px solid #222; color:#fff; height:400px; } div.main aside.widget-area ul { list-style: none; } div.main aside.widget-area div.fb-panel{ background:#222; } aside.widget-area h2{ font:bold 15px Arial, Helvetica, sans-serif; padding:5px 10px; margin:0; color:#fff; } aside.widget-area li.widget{ margin:0; } aside.widget-area li.widget{ background:#573615; list-style:none; border:5px solid #222; border-bottom:none; display:block; font:bold 12px Arial, Helvetica, sans-serif; } aside.widget-area li.widget ul{ padding:5px 15px; color:#fff; display:block; font:bold 12px Arial, Helvetica, sans-serif; } aside.widget-area li.widget ul{ margin:0; list-style:none; } aside.widget-area li.widget ul li{ background:#54260d; border:none; border-bottom:none; border-top:none; text-indent:15px; } aside.widget-area li.widget ul li a{ color:#fff; display:block; padding:3px 5px; font:normal 12px Arial, Helvetica, sans-serif; } aside.widget-area li.widget ul li a:hover{ color:#C6065C; } aside.widget-area li.widget.active-subnav{ width:100%; background:#C6065C; border:1px solid #C6065C; border-bottom:2px solid #C6065C; border-top:none; margin-top:5px; } aside.widget-area li.widget.active-subnav a{ color:#fff; } /*aside.widget-area li.widget_categories ul{ margin:0; } aside.widget-area li.widget_categories ul li.cat-item{ background:url(../images/icon-sprite.png) top left no-repeat; padding:0 0 0 25px; } aside.widget-area li.widget_categories ul li.cat-item{ background-position:0 -110px; } aside.widget-area li.widget_categories ul li.cat-item:hover, aside.widget-area li.widget_categories ul li.cat-item.active{ background-position:0 -88px; }*/ /* Single Post/Page Styles */ div.main.single .content{ background:transparent; } article.post{ background:transparent; line-height:18px; padding-right:20px; } div.main article.post section{ padding:10px; } article.post header{ padding:1em 0; } div.main article.post section header{ padding:0; } article.post h1{ color:#c6065c; font:bold 2em arial; margin:0; } article.post div.entry-content{ margin-bottom:50px; } article.post div.entry-content p{ padding:0; } article.post div.post-details{ margin:0 0 20px 0; } article.post footer.entry-meta{ padding:1em 3em 1em 3em; font:italic 11px verdana; } article.post footer.entry-meta a{ color:#aaa; } div#author-info{ border: 1px dotted #222; border-radius: 5px; padding: 1em 2em; margin: 2em 0; background: #ececec; } div#author-info div#author-avatar{ float:left; margin:0 1em 1em 0; } div#author-info div#author-avatar img{ border-radius: 48px; border: 2px solid #333; } div#author-info div#author-description{ padding-left:7em; font:normal 1em arial; line-height: 1.5em; color:#333; } div#author-info div#author-description h2{ font:bold 1em arial; color:#333; margin:0; } div#comments{ padding:10px; } div#comments ol.commentlist{ list-style: none; margin:0 0 0 50px; } div#comments h2{ font:bold 20px arial; color:#fff; margin:20px; } div#comments article.comment{ padding:10px; margin:10px 0; border-radius:5px; } div#comments div.comment-author img{ float:left; margin:0 1em 2em 0; border:2px solid #aaa; -webkit-box-shadow:0 5px 15px rgba(50, 50, 50, 0.75); -moz-box-shadow:0 5px 15px rgba(50, 50, 50, 0.75); box-shadow:0 5px 15px rgba(50, 50, 50, 0.75); background:#fff; } div#comments div.comment-author span.fn{ font:bold 22px arial; margin:0 10px 0 0 ; } div#comments div.comment-author time{ font:normal 12px arial; } div#comments div.comment-content{ min-height:70px; background:#777; padding:5px 5px 1px 5em; margin:0.5em 0 0 1em; color:#000; } div#respond{ padding:2em 4em; float:left; width: 100%; } div#respond h3#reply-title{ margin:0; color:#333; } div#respond form input#author, div#respond form input#email, div#respond form input#url, div#respond form textarea{ background:#ececec; color:#333; margin:0; border:1px dotted #cacaca; } div#respond form input#submit{display:none;} div#respond p.form-allowed-tags{ color:#333; font:normal 11px arial; } div#respond p{margin:0} div#respond code{ display:none; } aside aside{ padding: 0 10px; } ul.posts{ padding: 0 !important; list-style: none !important; } .navbar{ margin: 0; border: none; } /* Misc Styles */ pre{ padding: 10px !important; margin: 10px 0 !important; border: 2px dashed #ccc; background: #ececec; }
reengo/boxy
assets/themes/boxy/css/screen.css
CSS
mit
14,966
#!/bin/bash ## To avoid regression ensure that all of these do not return (unknown) # annot_t.js printf "annot_t.js:9:21 = " assert_ok "$FLOW" type-at-pos annot_t.js 9 21 --strip-root --pretty # any.js printf "any.js:3:15 = " assert_ok "$FLOW" type-at-pos any.js 3 15 --strip-root --pretty printf "any.js:4:2 = " assert_ok "$FLOW" type-at-pos any.js 4 2 --strip-root --pretty printf "any.js:4:6 = " assert_ok "$FLOW" type-at-pos any.js 4 6 --strip-root --pretty printf "any.js:5:5 = " assert_ok "$FLOW" type-at-pos any.js 5 5 --strip-root --pretty printf "any.js:7:13 = " assert_ok "$FLOW" type-at-pos any.js 7 13 --strip-root --pretty printf "any.js:8:5 = " assert_ok "$FLOW" type-at-pos any.js 8 5 --strip-root --pretty printf "any.js:8:10 = " assert_ok "$FLOW" type-at-pos any.js 8 10 --strip-root --pretty printf "any.js:9:10 = " assert_ok "$FLOW" type-at-pos any.js 9 10 --strip-root --pretty # array.js # TODO `Array` is not populated in type_tables # printf "array.js:3:18 = " # assert_ok "$FLOW" type-at-pos array.js 3 18 --strip-root --pretty # TODO `$ReadOnlyArray` is not populated in type_tables # printf "array.js:4:30 = " # assert_ok "$FLOW" type-at-pos array.js 4 30 --strip-root --pretty printf "array.js:6:15 = " assert_ok "$FLOW" type-at-pos array.js 6 15 --strip-root --pretty printf "array.js:10:15 = " assert_ok "$FLOW" type-at-pos array.js 10 15 --strip-root --pretty printf "array.js:15:4 = " assert_ok "$FLOW" type-at-pos array.js 15 4 --strip-root --pretty printf "array.js:19:4 = " assert_ok "$FLOW" type-at-pos array.js 19 4 --strip-root --pretty printf "array.js:23:4 = " assert_ok "$FLOW" type-at-pos array.js 23 4 --strip-root --pretty # new-array.js printf "new-array.js:3:15 = " assert_ok "$FLOW" type-at-pos new-array.js 3 15 --strip-root --pretty # class-0.js printf "class-0.js:3:7 = " assert_ok "$FLOW" type-at-pos class-0.js 3 7 --strip-root --pretty printf "class-0.js:4:3 = " assert_ok "$FLOW" type-at-pos class-0.js 4 3 --strip-root --pretty printf "class-0.js:4:10 = " assert_ok "$FLOW" type-at-pos class-0.js 4 10 --strip-root --pretty printf "class-0.js:9:5 = " assert_ok "$FLOW" type-at-pos class-0.js 9 5 --strip-root --pretty printf "class-0.js:12:5 = " assert_ok "$FLOW" type-at-pos class-0.js 12 5 --strip-root --pretty printf "class-0.js:15:5 = " assert_ok "$FLOW" type-at-pos class-0.js 15 5 --strip-root --pretty printf "class-0.js:21:5 = " assert_ok "$FLOW" type-at-pos class-0.js 21 5 --strip-root --pretty printf "class-0.js:24:5 = " assert_ok "$FLOW" type-at-pos class-0.js 24 5 --strip-root --pretty #class-1.js # TODO this is not the ideal type printf "class-1.js:4:3 = " assert_ok "$FLOW" type-at-pos class-1.js 4 3 --strip-root --pretty printf "class-1.js:8:3 = " assert_ok "$FLOW" type-at-pos class-1.js 8 3 --strip-root --pretty #class-2.js printf "class-2.js:4:3 = " assert_ok "$FLOW" type-at-pos class-2.js 4 3 --strip-root --pretty printf "class-2.js:9:9 = " assert_ok "$FLOW" type-at-pos class-2.js 9 9 --strip-root --pretty printf "class-2.js:10:9 = " assert_ok "$FLOW" type-at-pos class-2.js 10 9 --strip-root --pretty printf "class-2.js:12:7 = " assert_ok "$FLOW" type-at-pos class-2.js 12 7 --strip-root --pretty printf "class-2.js:13:7 = " assert_ok "$FLOW" type-at-pos class-2.js 13 7 --strip-root --pretty #class-3.js printf "class-3.js:4:3 = " assert_ok "$FLOW" type-at-pos class-3.js 4 3 --strip-root --pretty printf "class-3.js:9:9 = " assert_ok "$FLOW" type-at-pos class-3.js 9 9 --strip-root --pretty printf "class-3.js:10:9 = " assert_ok "$FLOW" type-at-pos class-3.js 10 9 --strip-root --pretty # class-bound.js printf "class-bound.js:4:6 = " assert_ok "$FLOW" type-at-pos class-bound.js 4 6 --strip-root --pretty # class-getters-setters.js printf "class-getters-setters.js:6:7 = " assert_ok "$FLOW" type-at-pos class-getters-setters.js 6 7 --strip-root --pretty printf "class-getters-setters.js:9:7 = " assert_ok "$FLOW" type-at-pos class-getters-setters.js 9 7 --strip-root --pretty # class-poly-0.js printf "class-poly-0.js:5:7 = " assert_ok "$FLOW" type-at-pos class-poly-0.js 5 7 --strip-root --pretty printf "class-poly-0.js:5:9 = " assert_ok "$FLOW" type-at-pos class-poly-0.js 5 9 --strip-root --pretty printf "class-poly-0.js:10:26 = " assert_ok "$FLOW" type-at-pos class-poly-0.js 10 26 --strip-root --pretty # TODO constructor # printf "class-poly-0.js:11:10 = " # assert_ok "$FLOW" type-at-pos class-poly-0.js 11 10 --strip-root --pretty printf "class-poly-0.js:12:7 = " assert_ok "$FLOW" type-at-pos class-poly-0.js 12 7 --strip-root --pretty printf "class-poly-0.js:16:7 = " assert_ok "$FLOW" type-at-pos class-poly-0.js 16 7 --strip-root --pretty printf "class-poly-0.js:16:10 = " assert_ok "$FLOW" type-at-pos class-poly-0.js 16 10 --strip-root --pretty printf "class-poly-0.js:17:7 = " assert_ok "$FLOW" type-at-pos class-poly-0.js 17 7 --strip-root --pretty #class-poly-1.js printf "class-poly-1.js:9:5 = " assert_ok "$FLOW" type-at-pos class-poly-1.js 9 5 --strip-root --pretty printf "class-poly-1.js:9:11 = " assert_ok "$FLOW" type-at-pos class-poly-1.js 9 11 --strip-root --pretty # class-statics.js printf "class-statics.js:4:10 = " assert_ok "$FLOW" type-at-pos class-statics.js 4 10 --strip-root --pretty printf "class-statics.js:8:10 = " assert_ok "$FLOW" type-at-pos class-statics.js 8 10 --strip-root --pretty printf "class-statics.js:9:7 = " assert_ok "$FLOW" type-at-pos class-statics.js 9 7 --strip-root --pretty printf "class-statics.js:11:8 = " assert_ok "$FLOW" type-at-pos class-statics.js 11 8 --strip-root --pretty printf "class-statics.js:16:5 = " assert_ok "$FLOW" type-at-pos class-statics.js 16 5 --strip-root --pretty printf "class-statics.js:17:5 = " assert_ok "$FLOW" type-at-pos class-statics.js 17 5 --strip-root --pretty # NOTE here Flow infers 'this', even though this is a static member printf "class-statics.js:20:11 = " assert_ok "$FLOW" type-at-pos class-statics.js 20 11 --strip-root --pretty # class-statics-poly.js printf "class-statics-poly.js:4:10 = " assert_ok "$FLOW" type-at-pos class-statics-poly.js 4 10 --strip-root --pretty printf "class-statics-poly.js:8:10 = " assert_ok "$FLOW" type-at-pos class-statics-poly.js 8 10 --strip-root --pretty # TODO the type 'Class<A>' is not parseable when 'A' is polymorphic printf "class-statics-poly.js:9:7 = " assert_ok "$FLOW" type-at-pos class-statics-poly.js 9 7 --strip-root --pretty printf "class-statics-poly.js:11:8 = " assert_ok "$FLOW" type-at-pos class-statics-poly.js 11 8 --strip-root --pretty printf "class-statics-poly.js:16:5 = " assert_ok "$FLOW" type-at-pos class-statics-poly.js 16 5 --strip-root --pretty printf "class-statics-poly.js:17:5 = " assert_ok "$FLOW" type-at-pos class-statics-poly.js 17 5 --strip-root --pretty # destructuring.js printf "destructuring.js:3:6 = " assert_ok "$FLOW" type-at-pos destructuring.js 3 6 --strip-root --pretty printf "destructuring.js:17:13 = " assert_ok "$FLOW" type-at-pos destructuring.js 17 13 --strip-root --pretty # exact.js printf "exact.js:4:6 = " assert_ok "$FLOW" type-at-pos exact.js 4 6 --strip-root --pretty printf "exact.js:5:13 = " assert_ok "$FLOW" type-at-pos exact.js 5 13 --strip-root --pretty printf "exact.js:6:13 = " assert_ok "$FLOW" type-at-pos exact.js 6 13 --strip-root --pretty printf "exact.js:7:13 = " assert_ok "$FLOW" type-at-pos exact.js 7 13 --strip-root --pretty printf "exact.js:9:17 = " assert_ok "$FLOW" type-at-pos exact.js 9 17 --strip-root --pretty printf "exact.js:10:7 = " assert_ok "$FLOW" type-at-pos exact.js 10 7 --strip-root --pretty printf "exact.js:13:13 = " assert_ok "$FLOW" type-at-pos exact.js 13 13 --strip-root --pretty printf "exact.js:16:13 = " assert_ok "$FLOW" type-at-pos exact.js 16 13 --strip-root --pretty printf "exact.js:18:6 = " assert_ok "$FLOW" type-at-pos exact.js 18 6 --strip-root --pretty printf "exact.js:19:6 = " assert_ok "$FLOW" type-at-pos exact.js 19 6 --strip-root --pretty # facebookism.js printf "facebookism.js:3:8 = " assert_ok "$FLOW" type-at-pos facebookism.js 3 8 --strip-root --pretty # TODO `require` # printf "facebookism.js:3:14 = " # assert_ok "$FLOW" type-at-pos facebookism.js 3 14 --strip-root --pretty # function.js printf "function.js:4:3 = " assert_ok "$FLOW" type-at-pos function.js 4 3 --strip-root --pretty printf "function.js:8:3 = " assert_ok "$FLOW" type-at-pos function.js 8 3 --strip-root --pretty printf "function.js:12:3 = " assert_ok "$FLOW" type-at-pos function.js 12 3 --strip-root --pretty printf "function.js:16:3 = " assert_ok "$FLOW" type-at-pos function.js 16 3 --strip-root --pretty # function-poly-0.js printf "function-poly-0.js:3:10 = " assert_ok "$FLOW" type-at-pos function-poly-0.js 3 10 --strip-root --pretty printf "function-poly-0.js:3:30 = " assert_ok "$FLOW" type-at-pos function-poly-0.js 3 30 --strip-root --pretty printf "function-poly-0.js:4:7 = " assert_ok "$FLOW" type-at-pos function-poly-0.js 4 7 --strip-root --pretty # function-poly-1.js printf "function-poly-1.js:3:10 = " assert_ok "$FLOW" type-at-pos function-poly-1.js 3 10 --strip-root --pretty printf "function-poly-1.js:3:3 = " assert_ok "$FLOW" type-at-pos function-poly-1.js 3 33 --strip-root --pretty printf "function-poly-1.js:4:7 = " assert_ok "$FLOW" type-at-pos function-poly-1.js 4 7 --strip-root --pretty # function-poly-2.js printf "function-poly-2.js:3:10 = " assert_ok "$FLOW" type-at-pos function-poly-2.js 3 10 --strip-root --pretty printf "function-poly-2.js:4:12 = " assert_ok "$FLOW" type-at-pos function-poly-2.js 4 12 --strip-root --pretty printf "function-poly-2.js:5:5 = " assert_ok "$FLOW" type-at-pos function-poly-2.js 5 5 --strip-root --pretty printf "function-poly-2.js:6:5 = " assert_ok "$FLOW" type-at-pos function-poly-2.js 6 5 --strip-root --pretty printf "function-poly-2.js:7:12 = " assert_ok "$FLOW" type-at-pos function-poly-2.js 7 12 --strip-root --pretty printf "function-poly-2.js:9:13 = " assert_ok "$FLOW" type-at-pos function-poly-2.js 9 13 --strip-root --pretty printf "function-poly-2.js:11:12 = " assert_ok "$FLOW" type-at-pos function-poly-2.js 11 12 --strip-root --pretty # function-poly-3.js printf "function-poly-3.js:8:1 = " assert_ok "$FLOW" type-at-pos function-poly-3.js 8 1 --strip-root --pretty # function-poly-4.js printf "function-poly-4.js:3:11 = " assert_ok "$FLOW" type-at-pos function-poly-4.js 3 11 --strip-root --pretty printf "function-poly-4.js:7:7 = " assert_ok "$FLOW" type-at-pos function-poly-4.js 7 7 --strip-root --pretty printf "function-poly-4.js:9:7 = " assert_ok "$FLOW" type-at-pos function-poly-4.js 9 7 --strip-root --pretty # function-poly-5.js printf "function-poly-5.js:3:10 = " assert_ok "$FLOW" type-at-pos function-poly-5.js 3 10 --strip-root --pretty # generics.js printf "generics.js:5:1 = " assert_ok "$FLOW" type-at-pos generics.js 5 1 --strip-root --pretty printf "generics.js:10:1 = " assert_ok "$FLOW" type-at-pos generics.js 10 1 --strip-root --pretty printf "generics.js:14:1 = " assert_ok "$FLOW" type-at-pos generics.js 14 1 --strip-root --pretty printf "generics.js:18:1 = " assert_ok "$FLOW" type-at-pos generics.js 18 1 --strip-root --pretty printf "generics.js:22:1 = " assert_ok "$FLOW" type-at-pos generics.js 22 1 --strip-root --pretty printf "generics.js:26:1 = " assert_ok "$FLOW" type-at-pos generics.js 26 1 --strip-root --pretty printf "generics.js:30:13 = " assert_ok "$FLOW" type-at-pos generics.js 30 13 --strip-root --pretty # implements.js printf "implements.js:7:8 = " assert_ok "$FLOW" type-at-pos implements.js 4 23 --strip-root --pretty # import_lib.js printf "import_lib.js:7:8 = " assert_ok "$FLOW" type-at-pos import_lib.js 7 8 --strip-root --pretty printf "import_lib.js:7:25 (--expand-json-output) = " assert_ok "$FLOW" type-at-pos import_lib.js 7 25 --strip-root --pretty --expand-json-output # import_lib_named.js printf "import_lib_named.js:3:15 (--expand-json-output) = " assert_ok "$FLOW" type-at-pos import_lib_named.js 3 15 --strip-root --pretty --expand-json-output printf "import_lib_named.js:3:27 (--expand-json-output) = " assert_ok "$FLOW" type-at-pos import_lib_named.js 3 27 --strip-root --pretty --expand-json-output # interface.js printf "interface.js:3:12 = " assert_ok "$FLOW" type-at-pos interface.js 3 12 --strip-root --pretty printf "interface.js:9:15 = " assert_ok "$FLOW" type-at-pos interface.js 9 15 --strip-root --pretty printf "interface.js:9:19 = " assert_ok "$FLOW" type-at-pos interface.js 9 19 --strip-root --pretty # # TODO: report specialized type # printf "interface.js:10:6 = " # assert_ok "$FLOW" type-at-pos interface.js 10 6 --strip-root --pretty # printf "interface.js:11:6 = " # assert_ok "$FLOW" type-at-pos interface.js 11 6 --strip-root --pretty # printf "interface.js:13:6 = " # assert_ok "$FLOW" type-at-pos interface.js 13 6 --strip-root --pretty printf "interface.js:17:7 = " assert_ok "$FLOW" type-at-pos interface.js 17 7 --strip-root --pretty printf "interface.js:18:7 = " assert_ok "$FLOW" type-at-pos interface.js 18 7 --strip-root --pretty # declare_class.js printf "declare_class.js:3:15 = " assert_ok "$FLOW" type-at-pos declare_class.js 3 15 --strip-root --pretty # mixed.js printf "mixed.js:18:17 = " assert_ok "$FLOW" type-at-pos mixed.js 18 17 --strip-root --pretty # exports.js printf "exports.js:3:24 = " assert_ok "$FLOW" type-at-pos exports.js 3 24 --strip-root --pretty printf "exports.js:5:25 = " assert_ok "$FLOW" type-at-pos exports.js 5 25 --strip-root --pretty # module-export.js printf "module-export.js:7:13 = " assert_ok "$FLOW" type-at-pos module-export.js 7 13 --strip-root --pretty # module-import.js printf "module-import.js:3:7 = " assert_ok "$FLOW" type-at-pos module-import.js 3 7 --strip-root --pretty # import-default.js printf "import-default.js:3:16 = " assert_ok "$FLOW" type-at-pos import-default.js 3 16 --strip-root --pretty # import-typeof-class.js printf "import-typeof-class.js:6:16 " assert_ok "$FLOW" type-at-pos import-typeof-class.js 6 16 --strip-root --pretty --expand-json-output printf "import-typeof-class.js:7:16 " assert_ok "$FLOW" type-at-pos import-typeof-class.js 7 16 --strip-root --pretty --expand-json-output # object.js printf "object.js:3:15 = " assert_ok "$FLOW" type-at-pos object.js 3 15 --strip-root --pretty printf "object.js:3:19 = " assert_ok "$FLOW" type-at-pos object.js 3 19 --strip-root --pretty printf "object.js:3:24 = " assert_ok "$FLOW" type-at-pos object.js 3 24 --strip-root --pretty printf "object.js:3:29 = " assert_ok "$FLOW" type-at-pos object.js 3 29 --strip-root --pretty printf "object.js:3:40 = " assert_ok "$FLOW" type-at-pos object.js 3 40 --strip-root --pretty printf "object.js:6:5 = " assert_ok "$FLOW" type-at-pos object.js 6 5 --strip-root --pretty printf "object.js:6:7 = " # TODO can we do better with duplication? assert_ok "$FLOW" type-at-pos object.js 6 7 --strip-root --pretty printf "object.js:7:10 = " assert_ok "$FLOW" type-at-pos object.js 7 10 --strip-root --pretty printf "object.js:7:12 = " assert_ok "$FLOW" type-at-pos object.js 7 12 --strip-root --pretty printf "object.js:8:14 = " assert_ok "$FLOW" type-at-pos object.js 8 14 --strip-root --pretty printf "object.js:8:16 = " assert_ok "$FLOW" type-at-pos object.js 8 16 --strip-root --pretty printf "object.js:9:18 = " assert_ok "$FLOW" type-at-pos object.js 9 18 --strip-root --pretty printf "object.js:9:34 = " assert_ok "$FLOW" type-at-pos object.js 9 34 --strip-root --pretty printf "object.js:15:3 = " assert_ok "$FLOW" type-at-pos object.js 15 3 --strip-root --pretty printf "object.js:16:3 = " assert_ok "$FLOW" type-at-pos object.js 16 3 --strip-root --pretty printf "object.js:19:3 = " assert_ok "$FLOW" type-at-pos object.js 19 3 --strip-root --pretty printf "object.js:19:7 = " assert_ok "$FLOW" type-at-pos object.js 19 7 --strip-root --pretty printf "object.js:20:7 = " assert_ok "$FLOW" type-at-pos object.js 20 7 --strip-root --pretty printf "object.js:21:7 = " assert_ok "$FLOW" type-at-pos object.js 21 7 --strip-root --pretty printf "object.js:22:7 = " assert_ok "$FLOW" type-at-pos object.js 22 7 --strip-root --pretty printf "object.js:35:1 = " assert_ok "$FLOW" type-at-pos object.js 35 1 --strip-root --pretty # object-resolution.js printf "object-resolution.js:5:2 = " assert_ok "$FLOW" type-at-pos object-resolution.js 5 2 --strip-root --pretty printf "object-resolution.js:10:2 = " assert_ok "$FLOW" type-at-pos object-resolution.js 10 2 --strip-root --pretty printf "object-resolution.js:13:5 = " assert_ok "$FLOW" type-at-pos object-resolution.js 13 5 --strip-root --pretty # optional.js printf "optional.js:4:10 = " assert_ok "$FLOW" type-at-pos optional.js 4 10 --strip-root --pretty printf "optional.js:7:2 = " assert_ok "$FLOW" type-at-pos optional.js 7 2 --strip-root --pretty printf "optional.js:10:11 = " assert_ok "$FLOW" type-at-pos optional.js 10 11 --strip-root --pretty printf "optional.js:10:14 = " assert_ok "$FLOW" type-at-pos optional.js 10 14 --strip-root --pretty printf "optional.js:14:10 = " assert_ok "$FLOW" type-at-pos optional.js 14 10 --strip-root --pretty # predicates.js # printf "predicates.js:4:12 (null) = " # assert_ok "$FLOW" type-at-pos predicates.js 4 12 --strip-root --pretty printf "predicates.js - undefined: " assert_ok "$FLOW" type-at-pos predicates.js 5 12 --strip-root --pretty printf "predicates.js - Array: " assert_ok "$FLOW" type-at-pos predicates.js 6 6 --strip-root --pretty printf "predicates.js - isArray: " assert_ok "$FLOW" type-at-pos predicates.js 6 15 --strip-root --pretty printf "predicates.js - y (refined obj): " assert_ok "$FLOW" type-at-pos predicates.js 8 5 --strip-root --pretty printf "predicates.js - if (y.FOO) obj: " assert_ok "$FLOW" type-at-pos predicates.js 9 5 --strip-root --pretty printf "predicates.js - if (y.FOO) prop: " assert_ok "$FLOW" type-at-pos predicates.js 9 8 --strip-root --pretty printf "predicates.js - if (y.FOO == '') obj: " assert_ok "$FLOW" type-at-pos predicates.js 10 5 --strip-root --pretty printf "predicates.js - if (y.FOO == '') prop: " assert_ok "$FLOW" type-at-pos predicates.js 10 8 --strip-root --pretty printf "predicates.js - if (y.FOO === '') obj: " assert_ok "$FLOW" type-at-pos predicates.js 11 5 --strip-root --pretty printf "predicates.js - if (y.FOO === '') prop: " assert_ok "$FLOW" type-at-pos predicates.js 11 8 --strip-root --pretty printf "predicates.js - if (y.FOO == null) prop: " assert_ok "$FLOW" type-at-pos predicates.js 12 8 --strip-root --pretty printf "predicates.js - if (y.FOO == undefined) prop: " assert_ok "$FLOW" type-at-pos predicates.js 13 8 --strip-root --pretty printf "predicates.js - if (Array.isArray(y.FOO)): " assert_ok "$FLOW" type-at-pos predicates.js 14 22 --strip-root --pretty # react_component.js printf "react_component.js:3:9 = " assert_ok "$FLOW" type-at-pos react_component.js 3 9 --strip-root --pretty printf "react_component.js:13:33 = " assert_ok "$FLOW" type-at-pos react_component.js 13 33 --strip-root --pretty printf "react_component.js:18:17 = " assert_ok "$FLOW" type-at-pos react_component.js 18 17 --strip-root --pretty printf "react_component.js:31:7 = " assert_ok "$FLOW" type-at-pos react_component.js 31 7 --strip-root --pretty --expand-json-output printf "react_component.js:32:13 = " assert_ok "$FLOW" type-at-pos react_component.js 32 13 --strip-root --pretty --expand-json-output printf "react_component.js:32:29 = " assert_ok "$FLOW" type-at-pos react_component.js 32 29 --strip-root --pretty --expand-json-output # react.js printf "react.js:2:7 = " assert_ok "$FLOW" type-at-pos react.js 2 7 --strip-root --pretty # recursive.js printf "recursive.js:3:25 = " assert_ok "$FLOW" type-at-pos recursive.js 3 25 --strip-root --pretty printf "recursive.js:6:11 = " assert_ok "$FLOW" type-at-pos recursive.js 6 11 --strip-root --pretty printf "recursive.js:13:12 = " assert_ok "$FLOW" type-at-pos recursive.js 13 12 --strip-root --pretty printf "recursive.js:23:12 = " assert_ok "$FLOW" type-at-pos recursive.js 23 12 --strip-root --pretty printf "recursive.js:38:2 = " assert_ok "$FLOW" type-at-pos recursive.js 38 2 --strip-root --pretty printf "recursive.js:41:17 = " assert_ok "$FLOW" type-at-pos recursive.js 41 17 --strip-root --pretty printf "recursive.js:58:1 = " assert_ok "$FLOW" type-at-pos recursive.js 58 1 --strip-root --pretty printf "recursive.js:60:6 = " assert_ok "$FLOW" type-at-pos recursive.js 60 6 --strip-root --pretty printf "recursive.js:60:31 = " assert_ok "$FLOW" type-at-pos recursive.js 60 31 --strip-root --pretty # refinement.js printf "refinement.js:7:25 = " assert_ok "$FLOW" type-at-pos refinement.js 7 25 --strip-root --pretty printf "refinement.js:8:25 = " assert_ok "$FLOW" type-at-pos refinement.js 8 25 --strip-root --pretty # require-class.js printf "require-class.js:5:16 = " assert_ok "$FLOW" type-at-pos require-class.js 5 16 --strip-root --expand-json-output --pretty printf "require-class.js:6:16 = " assert_ok "$FLOW" type-at-pos require-class.js 6 16 --strip-root --expand-json-output --pretty # test.js printf "test.js:5:1 = " assert_ok "$FLOW" type-at-pos test.js 5 1 --strip-root --pretty printf "test.js:8:7 = " assert_ok "$FLOW" type-at-pos test.js 8 7 --strip-root --pretty printf "test.js:10:7 = " assert_ok "$FLOW" type-at-pos test.js 10 7 --strip-root --pretty printf "test.js:12:7 = " assert_ok "$FLOW" type-at-pos test.js 12 7 --strip-root --pretty printf "test.js:14:7 = " assert_ok "$FLOW" type-at-pos test.js 14 7 --strip-root --pretty # templates.js # NOTE: not supported any more # printf "templates.js:2:7 = " # assert_ok "$FLOW" type-at-pos templates.js 2 7 --strip-root --pretty # trycatch.js # TODO track type reaching catch variable # printf "trycatch.js:5:10 = " # assert_ok "$FLOW" type-at-pos trycatch.js 5 10 --strip-root --pretty # type-destructor.js printf "type-destructor.js:3:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 3 6 --strip-root --pretty printf "type-destructor.js:4:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 4 6 --strip-root --pretty printf "type-destructor.js:5:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 5 6 --strip-root --pretty printf "type-destructor.js:8:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 8 6 --strip-root --pretty printf "type-destructor.js:10:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 10 6 --strip-root --pretty printf "type-destructor.js:12:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 12 6 --strip-root --pretty printf "type-destructor.js:13:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 13 6 --strip-root --pretty printf "type-destructor.js:15:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 15 6 --strip-root --pretty printf "type-destructor.js:16:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 16 6 --strip-root --pretty printf "type-destructor.js:17:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 17 6 --strip-root --pretty printf "type-destructor.js:19:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 19 6 --strip-root --pretty printf "type-destructor.js:20:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 20 6 --strip-root --pretty printf "type-destructor.js:21:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 21 6 --strip-root --pretty printf "type-destructor.js:23:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 23 6 --strip-root --pretty printf "type-destructor.js:27:5 = " assert_ok "$FLOW" type-at-pos type-destructor.js 27 5 --strip-root --pretty printf "type-destructor.js:28:5 = " assert_ok "$FLOW" type-at-pos type-destructor.js 28 5 --strip-root --pretty printf "type-destructor.js:29:5 = " assert_ok "$FLOW" type-at-pos type-destructor.js 28 5 --strip-root --pretty printf "type-destructor.js:33:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 33 6 --strip-root --pretty printf "type-destructor.js:34:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 34 6 --strip-root --pretty printf "type-destructor.js:36:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 36 6 --strip-root --pretty printf "type-destructor.js:37:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 37 6 --strip-root --pretty printf "type-destructor.js:41:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 41 6 --strip-root --pretty printf "type-destructor.js:42:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 42 6 --strip-root --pretty printf "type-destructor.js:44:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 44 6 --strip-root --pretty printf "type-destructor.js:45:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 45 6 --strip-root --pretty printf "type-destructor.js:47:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 47 6 --strip-root --pretty printf "type-destructor.js:48:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 48 6 --strip-root --pretty printf "type-destructor.js:62:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 62 6 --strip-root --pretty printf "type-destructor.js:63:6 = " assert_ok "$FLOW" type-at-pos type-destructor.js 63 6 --strip-root --pretty printf "type-destructor.js:68:13 = " assert_ok "$FLOW" type-at-pos type-destructor.js 68 13 --strip-root --pretty # unions.js printf "unions.js:9:3 = " assert_ok "$FLOW" type-at-pos unions.js 9 3 --strip-root --pretty printf "unions.js:15:2 = " assert_ok "$FLOW" type-at-pos unions.js 15 2 --strip-root --pretty printf "unions.js:24:3 = " assert_ok "$FLOW" type-at-pos unions.js 24 3 --strip-root --pretty printf "unions.js:43:3 = " assert_ok "$FLOW" type-at-pos unions.js 43 3 --strip-root --pretty printf "unions.js:44:3 = " assert_ok "$FLOW" type-at-pos unions.js 44 3 --strip-root --pretty printf "unions.js:49:1 = " assert_ok "$FLOW" type-at-pos unions.js 49 1 --strip-root --pretty printf "unions.js:52:1 = " assert_ok "$FLOW" type-at-pos unions.js 52 1 --strip-root --pretty printf "unions.js:57:5 = " assert_ok "$FLOW" type-at-pos unions.js 57 5 --strip-root --pretty printf "unions.js:59:18 = " assert_ok "$FLOW" type-at-pos unions.js 59 18 --strip-root --pretty # opaque.js printf "opaque.js:3:20 = " assert_ok "$FLOW" type-at-pos opaque.js 3 20 --strip-root --pretty printf "opaque.js:4:14 = " assert_ok "$FLOW" type-at-pos opaque.js 4 14 --strip-root --pretty printf "opaque.js:4:19 = " assert_ok "$FLOW" type-at-pos opaque.js 4 19 --strip-root --pretty printf "opaque.js:6:22 = " assert_ok "$FLOW" type-at-pos opaque.js 6 22 --strip-root --pretty printf "opaque.js:7:13 = " assert_ok "$FLOW" type-at-pos opaque.js 7 13 --strip-root --pretty printf "opaque.js:7:18 = " assert_ok "$FLOW" type-at-pos opaque.js 7 18 --strip-root --pretty printf "opaque.js:9:22 = " assert_ok "$FLOW" type-at-pos opaque.js 9 22 --strip-root --pretty printf "opaque.js:10:13 = " assert_ok "$FLOW" type-at-pos opaque.js 10 13 --strip-root --pretty printf "opaque.js:10:18 = " assert_ok "$FLOW" type-at-pos opaque.js 10 18 --strip-root --pretty printf "opaque.js:12:14 = " assert_ok "$FLOW" type-at-pos opaque.js 12 14 --strip-root --pretty printf "opaque.js:13:14 = " assert_ok "$FLOW" type-at-pos opaque.js 13 14 --strip-root --pretty printf "opaque.js:13:19 = " assert_ok "$FLOW" type-at-pos opaque.js 13 19 --strip-root --pretty printf "opaque.js:15:22 = " assert_ok "$FLOW" type-at-pos opaque.js 15 22 --strip-root --pretty printf "opaque.js:16:14 = " assert_ok "$FLOW" type-at-pos opaque.js 16 14 --strip-root --pretty printf "opaque.js:16:19 = " assert_ok "$FLOW" type-at-pos opaque.js 16 19 --strip-root --pretty printf "opaque.js:19:14 = " assert_ok "$FLOW" type-at-pos opaque.js 19 14 --strip-root --pretty printf "opaque.js:19:22 = " assert_ok "$FLOW" type-at-pos opaque.js 19 22 --strip-root --pretty printf "opaque.js:20:16 = " assert_ok "$FLOW" type-at-pos opaque.js 20 16 --strip-root --pretty printf "opaque.js:20:34 = " assert_ok "$FLOW" type-at-pos opaque.js 20 34 --strip-root --pretty printf "opaque.js:21:19 = " assert_ok "$FLOW" type-at-pos opaque.js 21 19 --strip-root --pretty printf "opaque.js:21:28 = " assert_ok "$FLOW" type-at-pos opaque.js 21 28 --strip-root --pretty printf "opaque.js:24:7 = " assert_ok "$FLOW" type-at-pos opaque.js 24 7 --strip-root --pretty # optional_chaining.js printf "optional_chaining.js:16:7 = " assert_ok "$FLOW" type-at-pos optional_chaining.js 16 7 --strip-root --pretty printf "optional_chaining.js:16:11 = " assert_ok "$FLOW" type-at-pos optional_chaining.js 16 11 --strip-root --pretty printf "optional_chaining.js:16:16 = " assert_ok "$FLOW" type-at-pos optional_chaining.js 16 16 --strip-root --pretty printf "optional_chaining.js:16:20 = " assert_ok "$FLOW" type-at-pos optional_chaining.js 16 20 --strip-root --pretty printf "optional_chaining.js:16:24 = " assert_ok "$FLOW" type-at-pos optional_chaining.js 16 24 --strip-root --pretty # type-alias.js printf "type-alias.js:3:6 = " assert_ok "$FLOW" type-at-pos type-alias.js 3 6 --strip-root --pretty printf "type-alias.js:4:6 = " assert_ok "$FLOW" type-at-pos type-alias.js 4 6 --strip-root --pretty printf "type-alias.js:5:6 = " assert_ok "$FLOW" type-at-pos type-alias.js 5 6 --strip-root --pretty printf "type-alias.js:6:6 = " assert_ok "$FLOW" type-at-pos type-alias.js 6 6 --strip-root --pretty printf "type-alias.js:7:6 = " assert_ok "$FLOW" type-at-pos type-alias.js 7 6 --strip-root --pretty printf "type-alias.js:7:6 (--expand-type-aliases) = " assert_ok "$FLOW" type-at-pos type-alias.js 7 6 --strip-root --pretty --expand-type-aliases printf "type-alias.js:8:6 = " assert_ok "$FLOW" type-at-pos type-alias.js 8 6 --strip-root --pretty printf "type-alias.js:12:12 " assert_ok "$FLOW" type-at-pos type-alias.js 12 12 --strip-root --pretty printf "type-alias.js:12:29 " assert_ok "$FLOW" type-at-pos type-alias.js 12 29 --strip-root --pretty # Test interaction with RPolyTest printf "type-alias.js:15:8 " assert_ok "$FLOW" type-at-pos type-alias.js 15 8 --strip-root --pretty printf "type-alias.js:16:8 " assert_ok "$FLOW" type-at-pos type-alias.js 16 8 --strip-root --pretty printf "type-alias.js:17:8 " assert_ok "$FLOW" type-at-pos type-alias.js 17 8 --strip-root --pretty printf "type-alias.js:18:8 " assert_ok "$FLOW" type-at-pos type-alias.js 18 8 --strip-root --pretty printf "type-alias.js:19:8 " assert_ok "$FLOW" type-at-pos type-alias.js 19 8 --strip-root --pretty printf "type-alias.js:20:8 " assert_ok "$FLOW" type-at-pos type-alias.js 20 8 --strip-root --pretty printf "type-alias.js:24:6 " assert_ok "$FLOW" type-at-pos type-alias.js 24 6 --strip-root --pretty --expand-type-aliases printf "type-alias.js:25:6 " assert_ok "$FLOW" type-at-pos type-alias.js 25 6 --strip-root --pretty --expand-type-aliases printf "type-alias.js:27:6 " assert_ok "$FLOW" type-at-pos type-alias.js 27 6 --strip-root --pretty --expand-type-aliases printf "type-alias.js:29:6 " assert_ok "$FLOW" type-at-pos type-alias.js 29 6 --strip-root --pretty --expand-type-aliases printf "type-alias.js:31:6 " assert_ok "$FLOW" type-at-pos type-alias.js 31 6 --strip-root --pretty --expand-type-aliases printf "type-alias.js:34:6 " assert_ok "$FLOW" type-at-pos type-alias.js 34 6 --strip-root --pretty --expand-json-output
JonathanUsername/flow
tests/type-at-pos/test.sh
Shell
mit
30,990
exports.LOADING = "LOADING"; exports.ERROR = "ERROR"; exports.SUCCESS = "SUCCESS"; exports.FETCH = "FETCH"; exports.CREATE = "CREATE"; exports.UPDATE = "UPDATE"; exports.DELETE = "DELETE"; exports.SET_EDIT_MODE = "SET_EDIT_MODE"; exports.SET_ADD_MODE = "SET_ADD_MODE"; exports.CLOSE_FORM = "CLOSE_FORM"; exports.SET_PAGE = "SET_PAGE"
Em-Ant/fcc-options-app
client/src/constants/actionTypes/modelActionTypes.js
JavaScript
mit
334
'use strict'; exports.ContainerBuilder = require('./CqrsContainerBuilder'); exports.EventStream = require('./EventStream'); exports.CommandBus = require('./CommandBus'); exports.EventStore = require('./EventStore'); exports.AbstractAggregate = require('./AbstractAggregate'); exports.AggregateCommandHandler = require('./AggregateCommandHandler'); exports.AbstractSaga = require('./AbstractSaga'); exports.SagaEventHandler = require('./SagaEventHandler'); exports.AbstractProjection = require('./AbstractProjection'); exports.InMemoryMessageBus = require('./infrastructure/InMemoryMessageBus'); exports.InMemoryEventStorage = require('./infrastructure/InMemoryEventStorage'); exports.InMemorySnapshotStorage = require('./infrastructure/InMemorySnapshotStorage'); exports.InMemoryView = require('./infrastructure/InMemoryView'); exports.getMessageHandlerNames = require('./utils/getMessageHandlerNames'); exports.subscribe = require('./subscribe');
snatalenko/node-cqrs
src/index.js
JavaScript
mit
953
<!DOCTYPE html> <html><head> <script type="text/javascript" src="lightgl.js"></script> <script type="text/javascript" src="csg.js"></script> <script type="text/javascript" src="openjscad.js"></script> <script type="text/javascript" src="braille.jscad" charset="utf-8"></script> <script type="text/javascript" src="jquery-1.10.1.min.js"></script> <style> body { font: 14px/20px 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif; max-width: 820px; margin: 0 auto; padding: 10px; } canvas { border: 1px solid black; margin: 0px 8px; } pre, code { font: 12px/20px Monaco, monospace; border: 1px solid #CCC; border-radius: 3px; background: #F9F9F9; padding: 0 3px; color: #555; } pre { padding: 10px; width: 100%; } textarea { font: 12px/20px Monaco, monospace; padding: 5px 8px; width: 300px; height: 100px; } td { vertical-align: top; } canvas { cursor: move; } </style> <link rel="stylesheet" href="openjscad.css" type="text/css" /> <script> var gProcessor=null; var detailsOffset = 4; var detailsAmount = 7; // Show all exceptions to the user: OpenJsCad.AlertUserOfUncaughtExceptions(); function onload() { gProcessor = new OpenJsCad.Processor(document.getElementById("viewer")); jQuery.get('braille.jscad', function(data) { gProcessor.setJsCad(data, "braille.jscad"); showDetails(false); }); adaptControls(); } function adaptControls() { if (gProcessor.viewer != null) gProcessor.viewer.gl.clearColor(1, 1, 0.97, 1); $("#viewer .viewer")[0].style.backgroundColor = "white"; $("#viewer .parametersdiv button")[0].onclick = parseParameters; var moreElement = "<hr/><p><a id='more'></a></p>"; $("#viewer .parametersdiv .parameterstable").after(moreElement); setLanguage("german"); } function setLanguage(lang) { if (lang == "german") { // var $statusBar = $("#viewer .statusdiv"); // $statusBar.children("span")[0].innerHTML = "Fertig." $("#viewer .parametersdiv button")[0].innerHTML = "3D Modell generieren"; } } function showDetails(show) { var tableRows = $("#viewer .parametersdiv .parameterstable tr"); for (var i=detailsOffset; i < tableRows.length && i < detailsOffset+detailsAmount; i++) { tableRows[i].style.display = (show) ? "table-row" : "none"; } var moreLink = $("#more")[0]; moreLink.innerHTML = (show) ? "simple Einstellungen" : "Details einstellen"; moreLink.href = "javascript:showDetails(" + !show + ");"; } function parseParameters() { var param_form_size = $("#viewer .parametersdiv .parameterstable tr:eq(4) td:eq(1) input")[0]; param_form_size.value = Math.min(Math.max(param_form_size.value, 0.0), 10.0); var param_dot_height = $("#viewer .parametersdiv .parameterstable tr:eq(5) td:eq(1) input")[0]; param_dot_height.value = Math.min(Math.max(param_dot_height.value, 0.5), 0.8); var param_dot_diameter = $("#viewer .parametersdiv .parameterstable tr:eq(6) td:eq(1) input")[0]; param_dot_diameter.value = Math.min(Math.max(param_dot_diameter.value, 1.4), 1.6); var param_plate_thickness = $("#viewer .parametersdiv .parameterstable tr:eq(7) td:eq(1) input")[0]; param_plate_thickness.value = Math.max(param_plate_thickness.value, 0.0); var param_resolution = $("#viewer .parametersdiv .parameterstable tr:eq(10) td:eq(1) input")[0]; var isnumber = !isNaN(parseInt(param_resolution.value)) && isFinite(param_resolution.value); var resolution = (isnumber) ? parseInt(param_resolution.value) : 0; resolution = Math.min(Math.max(param_resolution.value, 10), 30); resolution += (resolution % 2); param_resolution.value = resolution; gProcessor.rebuildSolid(); } </script> <title>Text to 3d printable Braille</title> </head> <body onload="onload()"> <h1>Text to 3d printable Braille</h1> <div id="viewer"></div> </body> </html>
v01pe/Text2Braille3d
index.html
HTML
mit
3,907
# Pull base image with batteries FROM buildpack-deps:jessie MAINTAINER EngageNExecute [email protected] # Install packages. RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y \ locales \ python-dev \ cmake \ libpq-dev \ python-pip \ git-core \ libopencv-dev \ postgresql-9.4 \ python-opencv \ python-numpy # Set UTF-8 as locales RUN dpkg-reconfigure locales && \ locale-gen C.UTF-8 && \ /usr/sbin/update-locale LANG=C.UTF-8 # ENV UTF-8 ENV LC_ALL C.UTF-8 # Disable warning driver1394 (camera) RUN ln /dev/null /dev/raw1394
EngageNExecute/opencv-python2
Dockerfile
Dockerfile
mit
649
'use strict'; var _ = require('./underscore-mixins.js'); var fnToNode = new Map(); exports.load = function (nodes, prefix) { let uuid = require('uuid'); if (prefix != null && prefix.length > 0) { prefix = prefix + ':'; } else { prefix = ''; } _(nodes).forEach(function (fn, name) { if (_.isFunction(fn)) { fnToNode.set(fn, { name: prefix + name, id: uuid.v4(), fn: fn, ingoingLinks: new Map(), outgoingLinks: new Map(), counter: 0 }); } else { exports.load(fn, name); } }); }; exports.clone = function (fn, name) { var node = fnToNode.get(fn); var newNodeLoader = {}; newNodeLoader[name] = node.fn.bind({}); exports.load(newNodeLoader); return newNodeLoader[name]; }; exports.debug = function () { fnToNode.forEach(function (node) { console.log( _(Array.from(node.ingoingLinks.keys())).pluck('name'), node.name, _(Array.from(node.outgoingLinks.keys())).pluck('name') ); }); }; var defaultLinkOptions = { primary: true }; exports.link = function (fn) { var node = fnToNode.get(fn); return { to: function (toFn, options) { options = _(options || {}).defaults(defaultLinkOptions); var toNode = fnToNode.get(toFn); toNode.ingoingLinks.set(node, options); node.outgoingLinks.set(toNode, options); } }; }; exports.unlink = function (fn) { var node = fnToNode.get(fn); return { from: function (fromFn) { var fromNode = fnToNode.get(fromFn); fromNode.ingoingLinks.delete(node); node.outgoingLinks.delete(fromNode); } }; }; exports.remove = function (fn) { var node = fnToNode.get(fn), todo = []; node.ingoingLinks.forEach(function (inOptions, inNode) { todo.push(function () { exports.unlink(inNode.fn).from(fn); }); node.outgoingLinks.forEach(function (outOptions, outNode) { todo.push(function () { exports.unlink(fn).from(outNode.fn); exports.link(inNode.fn).to(outNode.fn, outOptions); }); }); }); _(todo).invoke('call'); }; exports.replace = function (fn) { var node = fnToNode.get(fn), todo = []; return { by: function (byFn) { node.ingoingLinks.forEach(function (inOptions, inNode) { todo.push(function () { exports.unlink(inNode.fn).from(node.fn); exports.link(inNode.fn).to(byFn, inOptions); }); }); node.outgoingLinks.forEach(function (outOptions, outNode) { todo.push(function () { exports.unlink(node.fn).from(outNode.fn); exports.link(byFn).to(outNode.fn, outOptions); }); }); _(todo).invoke('call'); } } }; exports.before = function (fn) { var node = fnToNode.get(fn), todo = []; return { insert: function (beforeFn) { node.ingoingLinks.forEach(function (inOptions, inNode) { todo.push(function () { exports.unlink(inNode.fn).from(node.fn); exports.link(inNode.fn).to(beforeFn, inOptions); }); }); todo.push(function () { exports.link(beforeFn).to(node.fn); }); _(todo).invoke('call'); } }; }; exports.after = function (fn) { var node = fnToNode.get(fn), todo = []; return { insert: function (afterFn) { node.outgoingLinks.forEach(function (outOptions, outNode) { todo.push(function () { exports.unlink(node.fn).from(outNode.fn); exports.link(afterFn).to(outNode.fn, outOptions); }); }); todo.push(function () { exports.link(node.fn).to(afterFn); }); _(todo).invoke('call'); } }; }; var runEntryNode; function linksToStream(links) { let plumber = require('gulp-plumber'); return _(links).chain() .pluck('fn') .map(exports.run) .compact() .concatVinylStreams() .value() .pipe(plumber()); } exports.run = function (fn) { var result, node = fnToNode.get(fn); runEntryNode = runEntryNode || node; if (node.lastResult != null) { return node.lastResult; } var primaryStreams = [], secondaryStreams = []; node.ingoingLinks.forEach(function (options, node) { if (options.primary) { primaryStreams.push(node); } else { secondaryStreams.push(node); } }); var primaryStream = linksToStream(primaryStreams), secondaryStream = linksToStream(secondaryStreams); result = fn(primaryStream, secondaryStream); if (runEntryNode === node) { fnToNode.forEach(function (node) { delete node.lastResult; }); } else { node.lastResult = result; } return result; }; function isNotAlone(node) { return (node.ingoingLinks.size + node.outgoingLinks.size) > 0; } function isSource(node) { return node.ingoingLinks.size === 0; } function isOutput(node) { return node.outgoingLinks.size === 0; } exports.renderGraph = function (renderer, filepath, callback) { let graphdot = require('./graphdot.js'); var graph = graphdot.digraph('one_gulp_streams_graph'); graph.set('label', 'one-gulp streams graph\n\n'); graph.set('fontname', 'sans-serif'); graph.set('fontsize', '20'); graph.set('labelloc', 't'); graph.set('pad', '0.5,0.5'); graph.set('nodesep', '0.3'); graph.set('splines', 'spline'); graph.set('ranksep', '1'); graph.set('rankdir', 'LR'); var promises = []; fnToNode.forEach(function (node) { var nodeOptions = { label: node.name, shape: 'rectangle', fontname: 'sans-serif', style: 'bold', margin: '0.2,0.1' }; if (isSource(node)) { nodeOptions.shape = 'ellipse'; nodeOptions.color = 'lavender'; nodeOptions.fontcolor = 'lavender'; nodeOptions.margin = '0.1,0.1'; } if (isOutput(node)) { nodeOptions.color = 'limegreen'; nodeOptions.fontcolor = 'white'; nodeOptions.style = 'filled'; nodeOptions.margin = '0.25,0.25'; } if (isNotAlone(node)) { node.graphNode = graph.addNode(node.id, nodeOptions); if (isSource(node)) { var donePromise = new Promise(function (resolve, reject) { node.fn() .on('data', function () { node.counter += 1; node.graphNode.set('color', 'mediumslateblue'); node.graphNode.set('fontcolor', 'mediumslateblue'); node.graphNode.set('label', node.name + ' (' + node.counter + ')'); }) .on('error', reject) .on('end', resolve); }); promises.push(donePromise); } } }); Promise.all(promises).then(function () { fnToNode.forEach(function (node) { node.ingoingLinks.forEach(function (options, linkedNode) { var edgeOptions = {}; if (options.primary) { edgeOptions.penwidth = '1.5'; } else { edgeOptions.arrowhead = 'empty'; edgeOptions.style = 'dashed'; } if (isSource(linkedNode)) { edgeOptions.color = linkedNode.graphNode.get('color'); } graph.addEdge(linkedNode.graphNode, node.graphNode, edgeOptions); }); }); graphdot.renderToSvgFile(graph, renderer, filepath, callback); }); };
Alex-D/one-gulp
lib/dag.js
JavaScript
mit
8,407
Text Override === v.2.8.4 by: Matthew D. Jordan ### About A simple interface to modify a dimension's text override value directly. It even features shortcuts for frequently used overrides. Clear a text override by entering an empty string at the command line. If you want to use a chuck of text that includes space characters, use the Literal option. ### Use: Start Text Override by entering: ```command: textoverride``` ```Select dimension(s):``` it will only select dimensions, so feel free to select regular objects, they will not be affected.  You can also select your dimensions before you start the command. ```Enter Override Text:```  Guess what happens here?  You can also enter shortcuts (upper or lower-case) for commonly used dimension notes. These are listed below and at the prompt.  Also, you can clear a text override by entering nothing at the text prompt. ### Built-In Shortcuts: |Shortcut...|Means...| |:--:|--| |t|5'-0" TYP| |c|5'-0" OC| |ct|5'-0" OC TYP| |cc|5'-0" CTC| |cct|5'-0" CTC TYP| |nct|5'-0" <newline> OC TYP| |th|5'-0" THRU| |s|5'-0" (Skin)| |p|(5'-0")| |<none>|reset text override| ### GUI Helpers The file ```textOverride-GUI-helpers.lsp``` adds specific autocad command functions to allow gui elements (toolbar buttons, menu items, and ribbon controls) to access textOverride shortcuts directly.
mdjordan/text-override
readme.md
Markdown
mit
1,345
#!/bin/sh # # MediaWiki Setup Script # # This script will install and configure MediaWiki on # an Ubuntu 14.04 droplet export DEBIAN_FRONTEND=noninteractive; # Generate root and wordpress mysql passwords rootmysqlpass=`dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev | tr -dc 'a-zA-Z0-9'`; mwmysqlpass=`dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev | tr -dc 'a-zA-Z0-9'`; # Write passwords to file echo "MySQL Passwords for this droplet " > /etc/motd.tail; echo "-----------------------------------" >> /etc/motd.tail; echo "Root MySQL Password: $rootmysqlpass" >> /etc/motd.tail; echo "MediaWiki MySQL Database: mwdb" >> /etc/motd.tail; echo "Mediawiki MySQL Username: mwsql" >> /etc/motd.tail; echo "Mediawiki MySQL Password: $mwmysqlpass" >> /etc/motd.tail; echo "-----------------------------------" >> /etc/motd.tail; echo "You can remove this information with 'rm -f /etc/motd.tail'" >> /etc/motd.tail; apt-get update; apt-get -y install apache2 mysql-server libapache2-mod-auth-mysql php5-mysql php5 libapache2-mod-php5 php5-mcrypt php5-gd php5-intl php-pear php5-dev make libpcre3-dev php-apc; # Set up database user /usr/bin/mysqladmin -u root -h localhost create mwdb; /usr/bin/mysqladmin -u root -h localhost password $rootmysqlpass; /usr/bin/mysql -uroot -p$rootmysqlpass -e "CREATE USER mwsql@localhost IDENTIFIED BY '"$mwmysqlpass"'"; /usr/bin/mysql -uroot -p$rootmysqlpass -e "GRANT ALL PRIVILEGES ON mwdb.* TO mwsql@localhost"; rm -f /var/www/html/index.html; wget http://releases.wikimedia.org/mediawiki/1.25/mediawiki-1.25.1.tar.gz -O /root/mediawiki.tar.gz; cd /root; tar -zxf /root/mediawiki.tar.gz; cp -Rf /root/mediawiki-1.25.1/* /var/www/html/.; #rm /root/mediawiki.tar.gz; #rm -Rf /root/mediawiki-1.25.1; chown -Rf www-data.www-data /var/www/html; service apache2 restart; cat /etc/motd.tail > /var/run/motd.dynamic; chmod 0660 /var/run/motd.dynamic;
digitalocean/do_user_scripts
Ubuntu-14.04/cms/mediawiki.sh
Shell
mit
1,955
# Zensible Mongo Extension library to simplify working with mongo, it uses a builder pattern approach to performing calls to the mongo db, this allows for specific type of calls to be stored. # Motivation We all had to perform simple mongo actions but because of the mindboogling poor api of the offical mongo driver instead gone insane. For instance lets say we want to find a single document by id ``` var filter = Builders<BsonDocument>.Filter.Eq("_id", id); var result = collection.Find(filter); var document = await result.SingleOrDefaultAsync() ``` Alternative with zensible mongo ``` var document = await collection.ForId(id).PullAsync(); ``` Or lets assume you want to insert a document into mongo and get the id that it got inserted with ``` await collection.InsertOneAsync(document) <--- returns void ``` Hmm thats weired there doesn't seem to be a way to get the id... ofc it changes the id directly on the document you are passing it. Nice unsafe shared memory you got there! Alternative with zensible mongo ``` var documentWithID = await collection.Create(document).PushAsync() documentWithID.ShouldNotBe(document) //pass ``` ahh nice a cloned safe version that is different # How To ### Query For a look up simply chose a selector such as ForId, ForSingleWhere etc. To Fetch a single document based on a condition. ``` var document = await collection.ForSingleWhere(d => d.IsDue).PullAsync(); ``` ForSingleWhere should be be read: For a Single document Where (predicate) is true.. To fetch all documents based on a condition. ``` var document = await collection.ForAllWhere(d => d.IsDue).PullAsync(); ``` ForAllWhere should be be read: For All document Where (predicate) is true... To fetch all documents ``` var document = await collection.ForAllWhere(d => d.IsDue).PullAsync(); ``` ForAllWhere should be be read: For All document Where (predicate) is true... ### Update Like with the query we begin by ForId/ForSingleWhere/For.. ``` var document = await collection.ForId(id) .Set(d => d.Field, value) .PushAsync(); ``` BONUS: if the selection only refers to one document that document will be returned. To change multiple fields simply string them together ``` var document = await collection.ForId(id) .Set(d => d.Field1, value1) .Set(d => d.Field2, value2) .Set(d => d.Field3, value3) .. .. .PushAsync(); ``` ### Delete Like with query simply attach delete and the result will be a delete ``` var document = await collection.ForId(id).Delete().PushAsync(); ``` BONUS: if the selection only refers to one document that document will be returned. ### Create To insert a document in the mongo collection simply use Create ``` var newDocument = await collection.Create(document).PushAsync(); // newDocument != document ``` For multiple documents ``` var manyNewDocs = await collection.Create(doc1, doc2, ...).PushAsync(); ``` ## What is up with the Pull/Push? One of the features of this extension library is that actions can be stored and then used. for instance lets say I have a mail server and I want to define a query for all read mails. ``` var allReadMailsQuery = collection.ForAllWhere(m => m.IsRead) ``` Now when I need it I can either fetch it, delete it etc etc.. ``` var allReadMails = await allReadMailsQuery.PullAsync(); await allReadMailsQuery.Delete().PushAsync(); ... ... ```
trustpilot/ZensibleMongo
README.md
Markdown
mit
3,604
@echo off ipython notebook Numba_Demo_002.ipynb ipython nbconvert Numba_Demo_002.ipynb --to slides --post serve pause
rressi/MyNotebooks
Numba_Demo_002.bat
Batchfile
mit
117
import { connect } from 'react-redux'; import Main from './Main'; import * as userActions from '../../state/user/userActions'; const mapStateToProps = (state, ownProps) => { return { activeTab: ownProps.location.pathname.split('/')[2] }; }; const mapDispatchToProps = (dispatch) => { return { getUserData: () => dispatch(userActions.authRequest()) }; }; export default connect(mapStateToProps, mapDispatchToProps)(Main);
GerManson/bodymass
src/dashboard/components/Main/MainContainer.js
JavaScript
mit
440
import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { MembersComponent } from './members/members.component'; import { SeatingMapComponent } from './seating-map/seating-map.component'; const routes: Routes = [ { path: 'members', component: MembersComponent }, { path: 'seating-map', component: SeatingMapComponent }, { path: '', redirectTo: '/members', pathMatch: 'full' } ]; @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] }) export class AppRoutingModule { }
pedrorohr/crescer-cwi
src/app/app-routing.module.ts
TypeScript
mit
589
# Update the X font indexes: if [ -x /usr/bin/mkfontdir ]; then /usr/bin/mkfontscale /usr/share/fonts/TTF /usr/bin/mkfontdir /usr/share/fonts/TTF /usr/bin/mkfontscale /usr/share/fonts/OTF /usr/bin/mkfontdir /usr/share/fonts/OTF fi if [ -x /usr/bin/fc-cache ]; then /usr/bin/fc-cache -f fi
panosmdma/SlackOnly-SlackBuilds
system/linux-libertine-fonts/doinst.sh
Shell
mit
301
(function(angular) { 'use strict'; angular .module('jstube.chromeExtensionCleaner.popup') .directive('jstubeNavbar', jstubeNavbar); function jstubeNavbar() { return { restrict: 'E', templateUrl: 'nav/_navbar.html', controller: 'NavbarController', controllerAs: 'nav' }; } } (window.angular));
dayanand-saraswati/chrome-extension-cleaner
chromeExtensionCleaner/app/popup/nav/navbarDirective.js
JavaScript
mit
389
// Just re-export everything from the other files export * from './base-table-name'; export * from './compound-constraint'; export * from './constraint'; export * from './constraint-type'; export * from './default-value'; export * from './error-response'; export * from './filter-operation'; export * from './filter'; export * from './master-table-name'; export * from './raw-constraint'; export * from './paginated-response'; export * from './session-ping'; export * from './special-default-value'; export * from './sql-row'; export * from './table-data-type'; export * from './table-header'; export * from './table-insert'; export * from './table-meta'; export * from './table-tier'; export * from './transformed-name';
mattbdean/Helium
common/api/index.ts
TypeScript
mit
723
package com.dranawhite.mybatis.handler; import com.alibaba.fastjson.JSON; import com.dranawhite.mybatis.model.Address; import com.dranawhite.mybatis.model.FullAddress; import org.apache.ibatis.type.JdbcType; import org.apache.ibatis.type.MappedJdbcTypes; import org.apache.ibatis.type.MappedTypes; import org.apache.ibatis.type.TypeHandler; import java.sql.CallableStatement; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; /** * @author dranawhite 2018/1/2 * @version 1.0 */ @MappedTypes(FullAddress.class) @MappedJdbcTypes(JdbcType.VARCHAR) public class FullAddressJsonHandler implements TypeHandler<FullAddress> { @Override public void setParameter(PreparedStatement ps, int i, FullAddress parameter, JdbcType jdbcType) throws SQLException { String address = JSON.toJSONString(parameter); ps.setString(i, address); } @Override public FullAddress getResult(ResultSet rs, String columnName) throws SQLException { String address = rs.getString(columnName); return JSON.parseObject(address, FullAddress.class); } @Override public FullAddress getResult(ResultSet rs, int columnIndex) throws SQLException { String address = rs.getString(columnIndex); return JSON.parseObject(address, FullAddress.class); } @Override public FullAddress getResult(CallableStatement cs, int columnIndex) throws SQLException { String address = cs.getString(columnIndex); return JSON.parseObject(address, FullAddress.class); } }
dranawhite/test-java
test-framework/test-mybatis/src/main/java/com/dranawhite/mybatis/handler/FullAddressJsonHandler.java
Java
mit
1,582
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Login Page - Photon Admin Panel Theme</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"> <link rel="shortcut icon" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/favicon.ico" /> <link rel="apple-touch-icon" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/iosicon.png" /> <!-- DEVELOPMENT LESS --> <!-- <link rel="stylesheet/less" href="css/photon.less" media="all" /> <link rel="stylesheet/less" href="css/photon-responsive.less" media="all" /> --> <!-- PRODUCTION CSS --> <link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/css/css_compiled/photon-min.css?v1.1" media="all" /> <link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/css/css_compiled/photon-min-part2.css?v1.1" media="all" /> <link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/css/css_compiled/photon-responsive-min.css?v1.1" media="all" /> <!--[if IE]> <link rel="stylesheet" type="text/css" href="css/css_compiled/ie-only-min.css?v1.1" /> <![endif]--> <!--[if lt IE 9]> <link rel="stylesheet" type="text/css" href="css/css_compiled/ie8-only-min.css?v1.1" /> <script type="text/javascript" src="js/plugins/excanvas.js"></script> <script type="text/javascript" src="js/plugins/html5shiv.js"></script> <script type="text/javascript" src="js/plugins/respond.min.js"></script> <script type="text/javascript" src="js/plugins/fixFontIcons.js"></script> <![endif]--> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/bootstrap/bootstrap.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/modernizr.custom.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.pnotify.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/less-1.3.1.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/xbreadcrumbs.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.maskedinput-1.3.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.autotab-1.1b.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/charCount.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.textareaCounter.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/elrte.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/elrte.en.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/select2.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery-picklist.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.validate.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/additional-methods.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.form.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.metadata.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.mockjax.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.uniform.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.tagsinput.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.rating.pack.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/farbtastic.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.timeentry.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.dataTables.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.jstree.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/dataTables.bootstrap.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.mousewheel.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.mCustomScrollbar.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.flot.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.flot.stack.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.flot.pie.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.flot.resize.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/raphael.2.1.0.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/justgage.1.0.1.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.qrcode.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.clock.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.countdown.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.jqtweet.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/jquery.cookie.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/bootstrap-fileupload.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/prettify/prettify.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/bootstrapSwitch.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/plugins/mfupload.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/js/common.js"></script> </head> <body class="body-login"> <div class="nav-fixed-topright" style="visibility: hidden"> <ul class="nav nav-user-menu"> <li class="user-sub-menu-container"> <a href="javascript:;"> <i class="user-icon"></i><span class="nav-user-selection">Theme Options</span><i class="icon-menu-arrow"></i> </a> <ul class="nav user-sub-menu"> <li class="light"> <a href="javascript:;"> <i class='icon-photon stop'></i>Light Version </a> </li> <li class="dark"> <a href="javascript:;"> <i class='icon-photon stop'></i>Dark Version </a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-photon mail"></i> </a> </li> <li> <a href="javascript:;"> <i class="icon-photon comment_alt2_stroke"></i> <div class="notification-count">12</div> </a> </li> </ul> </div> <script> $(function(){ setTimeout(function(){ $('.nav-fixed-topright').removeAttr('style'); }, 300); $(window).scroll(function(){ if($('.breadcrumb-container').length){ var scrollState = $(window).scrollTop(); if (scrollState > 0) $('.nav-fixed-topright').addClass('nav-released'); else $('.nav-fixed-topright').removeClass('nav-released') } }); $('.user-sub-menu-container').on('click', function(){ $(this).toggleClass('active-user-menu'); }); $('.user-sub-menu .light').on('click', function(){ if ($('body').is('.light-version')) return; $('body').addClass('light-version'); setTimeout(function() { $.cookie('themeColor', 'light', { expires: 7, path: '/' }); }, 500); }); $('.user-sub-menu .dark').on('click', function(){ if ($('body').is('.light-version')) { $('body').removeClass('light-version'); $.cookie('themeColor', 'dark', { expires: 7, path: '/' }); } }); }); </script> <div class="container-login"> <div class="form-centering-wrapper"> <div class="form-window-login"> <div class="form-window-login-logo"> <div class="login-logo"> <img src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/images/photon/[email protected]" alt="Photon UI"/> </div> <h2 class="login-title">Welcome to Photon UI!</h2> <div class="login-member">Not a Member?&nbsp;<a href="photon-min.css-v1.1.html#">Sign Up &#187;</a> <a href="photon-min.css-v1.1.html#" class="btn btn-facebook"><i class="icon-fb"></i>Login with Facebook<i class="icon-fb-arrow"></i></a> </div> <div class="login-or">Or</div> <div class="login-input-area"> <form method="POST" action="dashboard.php"> <span class="help-block">Login With Your Photon Account</span> <input type="text" name="email" placeholder="Email"> <input type="password" name="password" placeholder="Password"> <button type="submit" class="btn btn-large btn-success btn-login">Login</button> </form> <a href="photon-min.css-v1.1.html#" class="forgot-pass">Forgot Your Password?</a> </div> </div> </div> </div> </div> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-1936460-27']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html>
user-tony/photon-rails
lib/assets/css/css_compiled/@{photonImagePath}plugins/elrte/js/plugins/prettify/js/plugins/prettify/css/css_compiled/css/css_compiled/photon-min.css-v1.1.html
HTML
mit
17,803
from util.tipo import tipo class S_PARTY_MEMBER_INTERVAL_POS_UPDATE(object): def __init__(self, tracker, time, direction, opcode, data): print(str(type(self)).split('.')[3]+'('+str(len(data))+'): '+ str(data.get_array_hex(1))[1:-1])
jeff-alves/Tera
game/message/unused/S_PARTY_MEMBER_INTERVAL_POS_UPDATE.py
Python
mit
246
/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(1); var React = __webpack_require__(2); var ReactDOM = __webpack_require__(3); var Hello_1 = __webpack_require__(4); var LabelTextbox_1 = __webpack_require__(5); var WebUser_1 = __webpack_require__(6); $(function () { var id = "target"; var container = document.getElementById(id); var model = new WebUser_1.default("James", null); function validate() { return model.validate(); } var wrapper = React.createElement("div", null, React.createElement(Hello_1.default, {class: "welcome", compiler: "TypeScript", framework: "ReactJS"}), React.createElement(LabelTextbox_1.default, {class: "field-username", type: "text", label: "Username", model: model}), React.createElement("button", {onClick: validate}, "Validate")); ReactDOM.render(wrapper, container); }); /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! * jQuery JavaScript Library v3.0.0 * https://jquery.com/ * * Includes Sizzle.js * https://sizzlejs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * https://jquery.org/license * * Date: 2016-06-09T18:02Z */ ( function( global, factory ) { "use strict"; if ( typeof module === "object" && typeof module.exports === "object" ) { // For CommonJS and CommonJS-like environments where a proper `window` // is present, execute the factory and get jQuery. // For environments that do not have a `window` with a `document` // (such as Node.js), expose a factory as module.exports. // This accentuates the need for the creation of a real `window`. // e.g. var jQuery = require("jquery")(window); // See ticket #14549 for more info. module.exports = global.document ? factory( global, true ) : function( w ) { if ( !w.document ) { throw new Error( "jQuery requires a window with a document" ); } return factory( w ); }; } else { factory( global ); } // Pass this if window is not defined yet }( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common // enough that all such attempts are guarded in a try block. "use strict"; var arr = []; var document = window.document; var getProto = Object.getPrototypeOf; var slice = arr.slice; var concat = arr.concat; var push = arr.push; var indexOf = arr.indexOf; var class2type = {}; var toString = class2type.toString; var hasOwn = class2type.hasOwnProperty; var fnToString = hasOwn.toString; var ObjectFunctionString = fnToString.call( Object ); var support = {}; function DOMEval( code, doc ) { doc = doc || document; var script = doc.createElement( "script" ); script.text = code; doc.head.appendChild( script ).parentNode.removeChild( script ); } var version = "3.0.0", // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' // Need init if jQuery is called (just allow error to be thrown if not included) return new jQuery.fn.init( selector, context ); }, // Support: Android <=4.0 only // Make sure we trim BOM and NBSP rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([a-z])/g, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: version, constructor: jQuery, // The default length of a jQuery object is 0 length: 0, toArray: function() { return slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num != null ? // Return just the one element from the set ( num < 0 ? this[ num + this.length ] : this[ num ] ) : // Return all the elements in a clean array slice.call( this ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. each: function( callback ) { return jQuery.each( this, callback ); }, map: function( callback ) { return this.pushStack( jQuery.map( this, function( elem, i ) { return callback.call( elem, i, elem ); } ) ); }, slice: function() { return this.pushStack( slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); }, end: function() { return this.prevObject || this.constructor(); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: push, sort: arr.sort, splice: arr.splice }; jQuery.extend = jQuery.fn.extend = function() { var options, name, src, copy, copyIsArray, clone, target = arguments[ 0 ] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; // Skip the boolean and the target target = arguments[ i ] || {}; i++; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { target = {}; } // Extend jQuery itself if only one argument is passed if ( i === length ) { target = this; i--; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( ( options = arguments[ i ] ) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject( copy ) || ( copyIsArray = jQuery.isArray( copy ) ) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray( src ) ? src : []; } else { clone = src && jQuery.isPlainObject( src ) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend( { // Unique for each copy of jQuery on the page expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), // Assume jQuery is ready without the ready module isReady: true, error: function( msg ) { throw new Error( msg ); }, noop: function() {}, isFunction: function( obj ) { return jQuery.type( obj ) === "function"; }, isArray: Array.isArray, isWindow: function( obj ) { return obj != null && obj === obj.window; }, isNumeric: function( obj ) { // As of jQuery 3.0, isNumeric is limited to // strings and numbers (primitives or objects) // that can be coerced to finite numbers (gh-2662) var type = jQuery.type( obj ); return ( type === "number" || type === "string" ) && // parseFloat NaNs numeric-cast false positives ("") // ...but misinterprets leading-number strings, particularly hex literals ("0x...") // subtraction forces infinities to NaN !isNaN( obj - parseFloat( obj ) ); }, isPlainObject: function( obj ) { var proto, Ctor; // Detect obvious negatives // Use toString instead of jQuery.type to catch host objects if ( !obj || toString.call( obj ) !== "[object Object]" ) { return false; } proto = getProto( obj ); // Objects with no prototype (e.g., `Object.create( null )`) are plain if ( !proto ) { return true; } // Objects with prototype are plain iff they were constructed by a global Object function Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, type: function( obj ) { if ( obj == null ) { return obj + ""; } // Support: Android <=2.3 only (functionish RegExp) return typeof obj === "object" || typeof obj === "function" ? class2type[ toString.call( obj ) ] || "object" : typeof obj; }, // Evaluates a script in a global context globalEval: function( code ) { DOMEval( code ); }, // Convert dashed to camelCase; used by the css and data modules // Support: IE <=9 - 11, Edge 12 - 13 // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, each: function( obj, callback ) { var length, i = 0; if ( isArrayLike( obj ) ) { length = obj.length; for ( ; i < length; i++ ) { if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { break; } } } else { for ( i in obj ) { if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { break; } } } return obj; }, // Support: Android <=4.0 only trim: function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArrayLike( Object( arr ) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { return arr == null ? -1 : indexOf.call( arr, elem, i ); }, // Support: Android <=4.0 only, PhantomJS 1 only // push.apply(_, arraylike) throws on ancient WebKit merge: function( first, second ) { var len = +second.length, j = 0, i = first.length; for ( ; j < len; j++ ) { first[ i++ ] = second[ j ]; } first.length = i; return first; }, grep: function( elems, callback, invert ) { var callbackInverse, matches = [], i = 0, length = elems.length, callbackExpect = !invert; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { callbackInverse = !callback( elems[ i ], i ); if ( callbackInverse !== callbackExpect ) { matches.push( elems[ i ] ); } } return matches; }, // arg is for internal usage only map: function( elems, callback, arg ) { var length, value, i = 0, ret = []; // Go through the array, translating each of the items to their new values if ( isArrayLike( elems ) ) { length = elems.length; for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } } // Flatten any nested arrays return concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var tmp, args, proxy; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, now: Date.now, // jQuery.support is not used in Core but other projects attach their // properties to it so it needs to exist. support: support } ); // JSHint would error on this code due to the Symbol not being defined in ES5. // Defining this global in .jshintrc would create a danger of using the global // unguarded in another place, it seems safer to just disable JSHint for these // three lines. /* jshint ignore: start */ if ( typeof Symbol === "function" ) { jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; } /* jshint ignore: end */ // Populate the class2type map jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), function( i, name ) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); } ); function isArrayLike( obj ) { // Support: real iOS 8.2 only (not reproducible in simulator) // `in` check used to prevent JIT error (gh-2145) // hasOwn isn't used here due to false negatives // regarding Nodelist length in IE var length = !!obj && "length" in obj && obj.length, type = jQuery.type( obj ); if ( type === "function" || jQuery.isWindow( obj ) ) { return false; } return type === "array" || length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj; } var Sizzle = /*! * Sizzle CSS Selector Engine v2.3.0 * https://sizzlejs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2016-01-04 */ (function( window ) { var i, support, Expr, getText, isXML, tokenize, compile, select, outermostContext, sortInput, hasDuplicate, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + 1 * new Date(), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; } return 0; }, // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf as it's faster than native // https://jsperf.com/thor-indexof-vs-for/5 indexOf = function( list, elem ) { var i = 0, len = list.length; for ( ; i < len; i++ ) { if ( list[i] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + // Operator (capture 2) "*([*^$|!~]?=)" + whitespace + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + identifier + ")(?:\\((" + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: // 1. quoted (capture 3; capture 4 or capture 5) "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + // 2. simple (capture 6) "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + // 3. anything else (capture 2) ".*" + ")\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rwhitespace = new RegExp( whitespace + "+", "g" ), rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + identifier + ")" ), "CLASS": new RegExp( "^\\.(" + identifier + ")" ), "TAG": new RegExp( "^(" + identifier + "|[*])" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, // CSS escapes // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox<24 // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : high < 0 ? // BMP codepoint String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }, // CSS string/identifier serialization // https://drafts.csswg.org/cssom/#common-serializing-idioms rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g, fcssescape = function( ch, asCodePoint ) { if ( asCodePoint ) { // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER if ( ch === "\0" ) { return "\uFFFD"; } // Control characters and (dependent upon position) numbers get escaped as code points return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; } // Other potentially-special ASCII characters get backslash-escaped return "\\" + ch; }, // Used for iframes // See setDocument() // Removing the function wrapper causes a "Permission Denied" // error in IE unloadHandler = function() { setDocument(); }, disabledAncestor = addCombinator( function( elem ) { return elem.disabled === true; }, { dir: "parentNode", next: "legend" } ); // Optimize for push.apply( _, NodeList ) try { push.apply( (arr = slice.call( preferredDoc.childNodes )), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { push_native.apply( target, slice.call(els) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( (target[j++] = els[i++]) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var m, i, elem, nid, match, groups, newSelector, newContext = context && context.ownerDocument, // nodeType defaults to 9, since context defaults to document nodeType = context ? context.nodeType : 9; results = results || []; // Return early from calls with invalid selector or context if ( typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { return results; } // Try to shortcut find operations (as opposed to filters) in HTML documents if ( !seed ) { if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; if ( documentIsHTML ) { // If the selector is sufficiently simple, try using a "get*By*" DOM method // (excepting DocumentFragment context, where the methods don't exist) if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { // ID selector if ( (m = match[1]) ) { // Document context if ( nodeType === 9 ) { if ( (elem = context.getElementById( m )) ) { // Support: IE, Opera, Webkit // TODO: identify versions // getElementById can match elements by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } // Element context } else { // Support: IE, Opera, Webkit // TODO: identify versions // getElementById can match elements by name instead of ID if ( newContext && (elem = newContext.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Type selector } else if ( match[2] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Class selector } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // Take advantage of querySelectorAll if ( support.qsa && !compilerCache[ selector + " " ] && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { if ( nodeType !== 1 ) { newContext = context; newSelector = selector; // qSA looks outside Element context, which is not what we want // Thanks to Andrew Dupont for this workaround technique // Support: IE <=8 // Exclude object elements } else if ( context.nodeName.toLowerCase() !== "object" ) { // Capture the context ID, setting it first if necessary if ( (nid = context.getAttribute( "id" )) ) { nid = nid.replace( rcssescape, fcssescape ); } else { context.setAttribute( "id", (nid = expando) ); } // Prefix every selector in the list groups = tokenize( selector ); i = groups.length; while ( i-- ) { groups[i] = "#" + nid + " " + toSelector( groups[i] ); } newSelector = groups.join( "," ); // Expand context for sibling selectors newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; } if ( newSelector ) { try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch ( qsaError ) { } finally { if ( nid === expando ) { context.removeAttribute( "id" ); } } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Create key-value caches of limited size * @returns {function(string, object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key + " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key + " " ] = value); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created element and returns a boolean result */ function assert( fn ) { var el = document.createElement("fieldset"); try { return !!fn( el ); } catch (e) { return false; } finally { // Remove from its parent by default if ( el.parentNode ) { el.parentNode.removeChild( el ); } // release memory in IE el = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { var arr = attrs.split("|"), i = arr.length; while ( i-- ) { Expr.attrHandle[ arr[i] ] = handler; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && a.sourceIndex - b.sourceIndex; // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } /** * Returns a function to use in pseudos for :enabled/:disabled * @param {Boolean} disabled true for :disabled; false for :enabled */ function createDisabledPseudo( disabled ) { // Known :disabled false positives: // IE: *[disabled]:not(button, input, select, textarea, optgroup, option, menuitem, fieldset) // not IE: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable return function( elem ) { // Check form elements and option elements for explicit disabling return "label" in elem && elem.disabled === disabled || "form" in elem && elem.disabled === disabled || // Check non-disabled form elements for fieldset[disabled] ancestors "form" in elem && elem.disabled === false && ( // Support: IE6-11+ // Ancestry is covered for us elem.isDisabled === disabled || // Otherwise, assume any non-<option> under fieldset[disabled] is disabled /* jshint -W018 */ elem.isDisabled !== !disabled && ("label" in elem || !disabledAncestor( elem )) !== disabled ); }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Checks a node for validity as a Sizzle context * @param {Element|Object=} context * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value */ function testContext( context ) { return context && typeof context.getElementsByTagName !== "undefined" && context; } // Expose support vars for convenience support = Sizzle.support = {}; /** * Detects XML nodes * @param {Element|Object} elem An element or a document * @returns {Boolean} True iff elem is a non-HTML XML node */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var hasCompare, subWindow, doc = node ? node.ownerDocument || node : preferredDoc; // Return early if doc is invalid or already selected if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Update global variables document = doc; docElem = document.documentElement; documentIsHTML = !isXML( document ); // Support: IE 9-11, Edge // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) if ( preferredDoc !== document && (subWindow = document.defaultView) && subWindow.top !== subWindow ) { // Support: IE 11, Edge if ( subWindow.addEventListener ) { subWindow.addEventListener( "unload", unloadHandler, false ); // Support: IE 9 - 10 only } else if ( subWindow.attachEvent ) { subWindow.attachEvent( "onunload", unloadHandler ); } } /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties // (excepting IE8 booleans) support.attributes = assert(function( el ) { el.className = "i"; return !el.getAttribute("className"); }); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert(function( el ) { el.appendChild( document.createComment("") ); return !el.getElementsByTagName("*").length; }); // Support: IE<9 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programmatically-set names, // so use a roundabout getElementsByName test support.getById = assert(function( el ) { docElem.appendChild( el ).id = expando; return !document.getElementsByName || !document.getElementsByName( expando ).length; }); // ID find and filter if ( support.getById ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { var m = context.getElementById( id ); return m ? [ m ] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { // Support: IE6/7 // getElementById is not reliable as a find shortcut delete Expr.find["ID"]; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== "undefined" ) { return context.getElementsByTagName( tag ); // DocumentFragment nodes don't have gEBTN } else if ( support.qsa ) { return context.querySelectorAll( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { return context.getElementsByClassName( className ); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See https://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( el ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // https://bugs.jquery.com/ticket/12359 docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" + "<select id='" + expando + "-\r\\' msallowcapture=''>" + "<option selected=''></option></select>"; // Support: IE8, Opera 11-12.16 // Nothing should be selected when empty strings follow ^= or $= or *= // The test attribute must be unknown in Opera but "safe" for WinRT // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section if ( el.querySelectorAll("[msallowcapture^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // Support: IE8 // Boolean attributes and "value" are not treated correctly if ( !el.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { rbuggyQSA.push("~="); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !el.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } // Support: Safari 8+, iOS 8+ // https://bugs.webkit.org/show_bug.cgi?id=136851 // In-page `selector#id sibling-combinator selector` fails if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { rbuggyQSA.push(".#.+[+~]"); } }); assert(function( el ) { el.innerHTML = "<a href='' disabled='disabled'></a>" + "<select disabled='disabled'><option/></select>"; // Support: Windows 8 Native Apps // The type and name attributes are restricted during .innerHTML assignment var input = document.createElement("input"); input.setAttribute( "type", "hidden" ); el.appendChild( input ).setAttribute( "name", "D" ); // Support: IE8 // Enforce case-sensitivity of name attribute if ( el.querySelectorAll("[name=d]").length ) { rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( el.querySelectorAll(":enabled").length !== 2 ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Support: IE9-11+ // IE's :disabled selector does not pick up the children of disabled fieldsets docElem.appendChild( el ).disabled = true; if ( el.querySelectorAll(":disabled").length !== 2 ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos el.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( el ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( el, "*" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( el, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); /* Contains ---------------------------------------------------------------------- */ hasCompare = rnative.test( docElem.compareDocumentPosition ); // Element contains another // Purposefully self-exclusive // As in, an element does not contain itself contains = hasCompare || rnative.test( docElem.contains ) ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Document order sorting sortOrder = hasCompare ? function( a, b ) { // Flag for duplicate removal if ( a === b ) { hasDuplicate = true; return 0; } // Sort on method existence if only one input has compareDocumentPosition var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; if ( compare ) { return compare; } // Calculate position if both inputs belong to the same document compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? a.compareDocumentPosition( b ) : // Otherwise we know they are disconnected 1; // Disconnected nodes if ( compare & 1 || (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // Choose the first element that is related to our preferred document if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { return -1; } if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { return 1; } // Maintain original order return sortInput ? ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; } : function( a, b ) { // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; } var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Parentless nodes are either documents or disconnected if ( !aup || !bup ) { return a === document ? -1 : b === document ? 1 : aup ? -1 : bup ? 1 : sortInput ? ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; return document; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); if ( support.matchesSelector && documentIsHTML && !compilerCache[ expr + " " ] && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch (e) {} } return Sizzle( expr, document, null, [ elem ] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], // Don't get fooled by Object.prototype properties (jQuery #13807) val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined; return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute( name ) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null; }; Sizzle.escape = function( sel ) { return (sel + "").replace( rcssescape, fcssescape ); }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice( 0 ); results.sort( sortOrder ); if ( hasDuplicate ) { while ( (elem = results[i++]) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } // Clear input after sorting to release objects // See https://github.com/jquery/sizzle/pull/225 sortInput = null; return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array while ( (node = elem[i++]) ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (jQuery #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[6] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[3] ) { match[2] = match[4] || match[5] || ""; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, uniqueCache, outerCache, node, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = false; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index // ...in a gzip-friendly way node = parent; outerCache = node[ expando ] || (node[ expando ] = {}); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || (outerCache[ node.uniqueID ] = {}); cache = uniqueCache[ type ] || []; nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; diff = nodeIndex && cache[ 2 ]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } } else { // Use previously-cached element index if available if ( useCache ) { // ...in a gzip-friendly way node = elem; outerCache = node[ expando ] || (node[ expando ] = {}); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || (outerCache[ node.uniqueID ] = {}); cache = uniqueCache[ type ] || []; nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; diff = nodeIndex; } // xml :nth-child(...) // or :nth-last-child(...) or :nth(-last)?-of-type(...) if ( diff === false ) { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { outerCache = node[ expando ] || (node[ expando ] = {}); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || (outerCache[ node.uniqueID ] = {}); uniqueCache[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); // Don't keep the element (issue #299) input[0] = null; return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { text = text.replace( runescape, funescape ); return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": createDisabledPseudo( false ), "disabled": createDisabledPseudo( true ), "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), // but not by others (comment: 8; processing instruction: 7; etc.) // nodeType < 6 works because attributes (2) do not appear as children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeType < 6 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && // Support: IE<8 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); tokenize = Sizzle.tokenize = function( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( (tokens = []) ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push({ value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) }); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push({ value: matched, type: type, matches: match }); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); }; function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, skip = combinator.next, key = skip || dir, checkNonElements = base && key === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var oldCache, uniqueCache, outerCache, newCache = [ dirruns, doneName ]; // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); if ( skip && skip === elem.nodeName.toLowerCase() ) { elem = elem[ dir ] || elem; } else if ( (oldCache = uniqueCache[ key ]) && oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { // Assign to newCache so results back-propagate to previous elements return (newCache[ 2 ] = oldCache[ 2 ]); } else { // Reuse newcache so results back-propagate to previous elements uniqueCache[ key ] = newCache; // A match means we're done; a fail means we have to keep checking if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); // Avoid hanging onto element (issue #299) checkContext = null; return ret; } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, outermost ) { var elem, j, matcher, matchedCount = 0, i = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, // We must always have either seed elements or outermost context elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), len = elems.length; if ( outermost ) { outermostContext = context === document || context || outermost; } // Add elements passing elementMatchers directly to results // Support: IE<9, Safari // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id for ( ; i !== len && (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; if ( !context && elem.ownerDocument !== document ) { setDocument( elem ); xml = !documentIsHTML; } while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context || document, xml) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // `i` is now the count of elements visited above, and adding it to `matchedCount` // makes the latter nonnegative. matchedCount += i; // Apply set filters to unmatched elements // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` // equals `i`), unless we didn't visit _any_ elements in the above loop because we have // no element matchers and no seed. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that // case, which will result in a "00" `matchedCount` that differs from `i` but is also // numerically zero. if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !match ) { match = tokenize( selector ); } i = match.length; while ( i-- ) { cached = matcherFromTokens( match[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); // Save selector and tokenization cached.selector = selector; } return cached; }; /** * A low-level selection function that works with Sizzle's compiled * selector functions * @param {String|Function} selector A selector or a pre-compiled * selector function built with Sizzle.compile * @param {Element} context * @param {Array} [results] * @param {Array} [seed] A set of elements to match against */ select = Sizzle.select = function( selector, context, results, seed ) { var i, tokens, token, type, find, compiled = typeof selector === "function" && selector, match = !seed && tokenize( (selector = compiled.selector || selector) ); results = results || []; // Try to minimize operations if there is only one selector in the list and no seed // (the latter of which guarantees us context) if ( match.length === 1 ) { // Reduce context if the leading compound selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; if ( !context ) { return results; // Precompiled matchers will still verify ancestry, so step up a level } else if ( compiled ) { context = context.parentNode; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, seed ); return results; } break; } } } } // Compile and execute a filtering function if one is not provided // Provide `match` to avoid retokenization if we modified the selector above ( compiled || compile( selector, match ) )( seed, context, !documentIsHTML, results, !context || rsibling.test( selector ) && testContext( context.parentNode ) || context ); return results; }; // One-time assignments // Sort stability support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; // Support: Chrome 14-35+ // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = !!hasDuplicate; // Initialize against the default document setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert(function( el ) { // Should return 1, but returns 4 (following) return el.compareDocumentPosition( document.createElement("fieldset") ) & 1; }); // Support: IE<8 // Prevent attribute/property "interpolation" // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !assert(function( el ) { el.innerHTML = "<a href='#'></a>"; return el.firstChild.getAttribute("href") === "#" ; }) ) { addHandle( "type|href|height|width", function( elem, name, isXML ) { if ( !isXML ) { return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } }); } // Support: IE<9 // Use defaultValue in place of getAttribute("value") if ( !support.attributes || !assert(function( el ) { el.innerHTML = "<input/>"; el.firstChild.setAttribute( "value", "" ); return el.firstChild.getAttribute( "value" ) === ""; }) ) { addHandle( "value", function( elem, name, isXML ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } }); } // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies if ( !assert(function( el ) { return el.getAttribute("disabled") == null; }) ) { addHandle( booleans, function( elem, name, isXML ) { var val; if ( !isXML ) { return elem[ name ] === true ? name.toLowerCase() : (val = elem.getAttributeNode( name )) && val.specified ? val.value : null; } }); } return Sizzle; })( window ); jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; // Deprecated jQuery.expr[ ":" ] = jQuery.expr.pseudos; jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; jQuery.escapeSelector = Sizzle.escape; var dir = function( elem, dir, until ) { var matched = [], truncate = until !== undefined; while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { if ( elem.nodeType === 1 ) { if ( truncate && jQuery( elem ).is( until ) ) { break; } matched.push( elem ); } } return matched; }; var siblings = function( n, elem ) { var matched = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { matched.push( n ); } } return matched; }; var rneedsContext = jQuery.expr.match.needsContext; var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); var risSimple = /^.[^:#\[\.,]*$/; // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; } ); } if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; } ); } if ( typeof qualifier === "string" ) { if ( risSimple.test( qualifier ) ) { return jQuery.filter( qualifier, elements, not ); } qualifier = jQuery.filter( qualifier, elements ); } return jQuery.grep( elements, function( elem ) { return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1; } ); } jQuery.filter = function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; } ) ); }; jQuery.fn.extend( { find: function( selector ) { var i, ret, len = this.length, self = this; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter( function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } } ) ); } ret = this.pushStack( [] ); for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } return len > 1 ? jQuery.uniqueSort( ret ) : ret; }, filter: function( selector ) { return this.pushStack( winnow( this, selector || [], false ) ); }, not: function( selector ) { return this.pushStack( winnow( this, selector || [], true ) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; } } ); // Initialize a jQuery object // A central reference to the root jQuery(document) var rootjQuery, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) // Shortcut simple #id case for speed rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, init = jQuery.fn.init = function( selector, context, root ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Method init() accepts an alternate rootjQuery // so migrate can support jQuery.sub (gh-2101) root = root || rootjQuery; // Handle HTML strings if ( typeof selector === "string" ) { if ( selector[ 0 ] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && ( match[ 1 ] || !context ) ) { // HANDLE: $(html) -> $(array) if ( match[ 1 ] ) { context = context instanceof jQuery ? context[ 0 ] : context; // Option to run scripts is true for back-compat // Intentionally let the error be thrown if parseHTML is not present jQuery.merge( this, jQuery.parseHTML( match[ 1 ], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[ 2 ] ); if ( elem ) { // Inject the element directly into the jQuery object this[ 0 ] = elem; this.length = 1; } return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || root ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this[ 0 ] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return root.ready !== undefined ? root.ready( selector ) : // Execute immediately if ready is not present selector( jQuery ); } return jQuery.makeArray( selector, this ); }; // Give the init function the jQuery prototype for later instantiation init.prototype = jQuery.fn; // Initialize central reference rootjQuery = jQuery( document ); var rparentsprev = /^(?:parents|prev(?:Until|All))/, // Methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend( { has: function( target ) { var targets = jQuery( target, this ), l = targets.length; return this.filter( function() { var i = 0; for ( ; i < l; i++ ) { if ( jQuery.contains( this, targets[ i ] ) ) { return true; } } } ); }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, matched = [], targets = typeof selectors !== "string" && jQuery( selectors ); // Positional selectors never match, since there's no _selection_ context if ( !rneedsContext.test( selectors ) ) { for ( ; i < l; i++ ) { for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && ( targets ? targets.index( cur ) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector( cur, selectors ) ) ) { matched.push( cur ); break; } } } } return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); }, // Determine the position of an element within the set index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; } // Index in selector if ( typeof elem === "string" ) { return indexOf.call( jQuery( elem ), this[ 0 ] ); } // Locate the position of the desired element return indexOf.call( this, // If it receives a jQuery object, the first element is used elem.jquery ? elem[ 0 ] : elem ); }, add: function( selector, context ) { return this.pushStack( jQuery.uniqueSort( jQuery.merge( this.get(), jQuery( selector, context ) ) ) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter( selector ) ); } } ); function sibling( cur, dir ) { while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} return cur; } jQuery.each( { parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return siblings( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return siblings( elem.firstChild ); }, contents: function( elem ) { return elem.contentDocument || jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var matched = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { matched = jQuery.filter( selector, matched ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { jQuery.uniqueSort( matched ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { matched.reverse(); } } return this.pushStack( matched ); }; } ); var rnotwhite = ( /\S+/g ); // Convert String-formatted options into Object-formatted ones function createOptions( options ) { var object = {}; jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; } ); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? createOptions( options ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value for non-forgettable lists memory, // Flag to know if list was already fired fired, // Flag to prevent firing locked, // Actual callback list list = [], // Queue of execution data for repeatable lists queue = [], // Index of currently firing callback (modified by add/remove as needed) firingIndex = -1, // Fire callbacks fire = function() { // Enforce single-firing locked = options.once; // Execute callbacks for all pending executions, // respecting firingIndex overrides and runtime changes fired = firing = true; for ( ; queue.length; firingIndex = -1 ) { memory = queue.shift(); while ( ++firingIndex < list.length ) { // Run callback and check for early termination if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && options.stopOnFalse ) { // Jump to end and forget the data so .add doesn't re-fire firingIndex = list.length; memory = false; } } } // Forget the data if we're done with it if ( !options.memory ) { memory = false; } firing = false; // Clean up if we're done firing for good if ( locked ) { // Keep an empty list if we have data for future add calls if ( memory ) { list = []; // Otherwise, this object is spent } else { list = ""; } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // If we have memory from a past run, we should fire after adding if ( memory && !firing ) { firingIndex = list.length - 1; queue.push( memory ); } ( function add( args ) { jQuery.each( args, function( _, arg ) { if ( jQuery.isFunction( arg ) ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { // Inspect recursively add( arg ); } } ); } )( arguments ); if ( memory && !firing ) { fire(); } } return this; }, // Remove a callback from the list remove: function() { jQuery.each( arguments, function( _, arg ) { var index; while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( index <= firingIndex ) { firingIndex--; } } } ); return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : list.length > 0; }, // Remove all callbacks from the list empty: function() { if ( list ) { list = []; } return this; }, // Disable .fire and .add // Abort any current/pending executions // Clear all callbacks and values disable: function() { locked = queue = []; list = memory = ""; return this; }, disabled: function() { return !list; }, // Disable .fire // Also disable .add unless we have memory (since it would have no effect) // Abort any pending executions lock: function() { locked = queue = []; if ( !memory && !firing ) { list = memory = ""; } return this; }, locked: function() { return !!locked; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { if ( !locked ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; queue.push( args ); if ( !firing ) { fire(); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; function Identity( v ) { return v; } function Thrower( ex ) { throw ex; } function adoptValue( value, resolve, reject ) { var method; try { // Check for promise aspect first to privilege synchronous behavior if ( value && jQuery.isFunction( ( method = value.promise ) ) ) { method.call( value ).done( resolve ).fail( reject ); // Other thenables } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) { method.call( value, resolve, reject ); // Other non-thenables } else { // Support: Android 4.0 only // Strict mode functions invoked without .call/.apply get global-object context resolve.call( undefined, value ); } // For Promises/A+, convert exceptions into rejections // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in // Deferred#then to conditionally suppress rejection. } catch ( /*jshint -W002 */ value ) { // Support: Android 4.0 only // Strict mode functions invoked without .call/.apply get global-object context reject.call( undefined, value ); } } jQuery.extend( { Deferred: function( func ) { var tuples = [ // action, add listener, callbacks, // ... .then handlers, argument index, [final state] [ "notify", "progress", jQuery.Callbacks( "memory" ), jQuery.Callbacks( "memory" ), 2 ], [ "resolve", "done", jQuery.Callbacks( "once memory" ), jQuery.Callbacks( "once memory" ), 0, "resolved" ], [ "reject", "fail", jQuery.Callbacks( "once memory" ), jQuery.Callbacks( "once memory" ), 1, "rejected" ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, "catch": function( fn ) { return promise.then( null, fn ); }, // Keep pipe for back-compat pipe: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred( function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { // Map tuples (progress, done, fail) to arguments (done, fail, progress) var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; // deferred.progress(function() { bind to newDefer or newDefer.notify }) // deferred.done(function() { bind to newDefer or newDefer.resolve }) // deferred.fail(function() { bind to newDefer or newDefer.reject }) deferred[ tuple[ 1 ] ]( function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .progress( newDefer.notify ) .done( newDefer.resolve ) .fail( newDefer.reject ); } else { newDefer[ tuple[ 0 ] + "With" ]( this, fn ? [ returned ] : arguments ); } } ); } ); fns = null; } ).promise(); }, then: function( onFulfilled, onRejected, onProgress ) { var maxDepth = 0; function resolve( depth, deferred, handler, special ) { return function() { var that = this, args = arguments, mightThrow = function() { var returned, then; // Support: Promises/A+ section 2.3.3.3.3 // https://promisesaplus.com/#point-59 // Ignore double-resolution attempts if ( depth < maxDepth ) { return; } returned = handler.apply( that, args ); // Support: Promises/A+ section 2.3.1 // https://promisesaplus.com/#point-48 if ( returned === deferred.promise() ) { throw new TypeError( "Thenable self-resolution" ); } // Support: Promises/A+ sections 2.3.3.1, 3.5 // https://promisesaplus.com/#point-54 // https://promisesaplus.com/#point-75 // Retrieve `then` only once then = returned && // Support: Promises/A+ section 2.3.4 // https://promisesaplus.com/#point-64 // Only check objects and functions for thenability ( typeof returned === "object" || typeof returned === "function" ) && returned.then; // Handle a returned thenable if ( jQuery.isFunction( then ) ) { // Special processors (notify) just wait for resolution if ( special ) { then.call( returned, resolve( maxDepth, deferred, Identity, special ), resolve( maxDepth, deferred, Thrower, special ) ); // Normal processors (resolve) also hook into progress } else { // ...and disregard older resolution values maxDepth++; then.call( returned, resolve( maxDepth, deferred, Identity, special ), resolve( maxDepth, deferred, Thrower, special ), resolve( maxDepth, deferred, Identity, deferred.notifyWith ) ); } // Handle all other returned values } else { // Only substitute handlers pass on context // and multiple values (non-spec behavior) if ( handler !== Identity ) { that = undefined; args = [ returned ]; } // Process the value(s) // Default process is resolve ( special || deferred.resolveWith )( that, args ); } }, // Only normal processors (resolve) catch and reject exceptions process = special ? mightThrow : function() { try { mightThrow(); } catch ( e ) { if ( jQuery.Deferred.exceptionHook ) { jQuery.Deferred.exceptionHook( e, process.stackTrace ); } // Support: Promises/A+ section 2.3.3.3.4.1 // https://promisesaplus.com/#point-61 // Ignore post-resolution exceptions if ( depth + 1 >= maxDepth ) { // Only substitute handlers pass on context // and multiple values (non-spec behavior) if ( handler !== Thrower ) { that = undefined; args = [ e ]; } deferred.rejectWith( that, args ); } } }; // Support: Promises/A+ section 2.3.3.3.1 // https://promisesaplus.com/#point-57 // Re-resolve promises immediately to dodge false rejection from // subsequent errors if ( depth ) { process(); } else { // Call an optional hook to record the stack, in case of exception // since it's otherwise lost when execution goes async if ( jQuery.Deferred.getStackHook ) { process.stackTrace = jQuery.Deferred.getStackHook(); } window.setTimeout( process ); } }; } return jQuery.Deferred( function( newDefer ) { // progress_handlers.add( ... ) tuples[ 0 ][ 3 ].add( resolve( 0, newDefer, jQuery.isFunction( onProgress ) ? onProgress : Identity, newDefer.notifyWith ) ); // fulfilled_handlers.add( ... ) tuples[ 1 ][ 3 ].add( resolve( 0, newDefer, jQuery.isFunction( onFulfilled ) ? onFulfilled : Identity ) ); // rejected_handlers.add( ... ) tuples[ 2 ][ 3 ].add( resolve( 0, newDefer, jQuery.isFunction( onRejected ) ? onRejected : Thrower ) ); } ).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 5 ]; // promise.progress = list.add // promise.done = list.add // promise.fail = list.add promise[ tuple[ 1 ] ] = list.add; // Handle state if ( stateString ) { list.add( function() { // state = "resolved" (i.e., fulfilled) // state = "rejected" state = stateString; }, // rejected_callbacks.disable // fulfilled_callbacks.disable tuples[ 3 - i ][ 2 ].disable, // progress_callbacks.lock tuples[ 0 ][ 2 ].lock ); } // progress_handlers.fire // fulfilled_handlers.fire // rejected_handlers.fire list.add( tuple[ 3 ].fire ); // deferred.notify = function() { deferred.notifyWith(...) } // deferred.resolve = function() { deferred.resolveWith(...) } // deferred.reject = function() { deferred.rejectWith(...) } deferred[ tuple[ 0 ] ] = function() { deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); return this; }; // deferred.notifyWith = list.fireWith // deferred.resolveWith = list.fireWith // deferred.rejectWith = list.fireWith deferred[ tuple[ 0 ] + "With" ] = list.fireWith; } ); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( singleValue ) { var // count of uncompleted subordinates remaining = arguments.length, // count of unprocessed arguments i = remaining, // subordinate fulfillment data resolveContexts = Array( i ), resolveValues = slice.call( arguments ), // the master Deferred master = jQuery.Deferred(), // subordinate callback factory updateFunc = function( i ) { return function( value ) { resolveContexts[ i ] = this; resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; if ( !( --remaining ) ) { master.resolveWith( resolveContexts, resolveValues ); } }; }; // Single- and empty arguments are adopted like Promise.resolve if ( remaining <= 1 ) { adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject ); // Use .then() to unwrap secondary thenables (cf. gh-3000) if ( master.state() === "pending" || jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { return master.then(); } } // Multiple arguments are aggregated like Promise.all array elements while ( i-- ) { adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); } return master.promise(); } } ); // These usually indicate a programmer mistake during development, // warn about them ASAP rather than swallowing them by default. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; jQuery.Deferred.exceptionHook = function( error, stack ) { // Support: IE 8 - 9 only // Console exists when dev tools are open, which can happen at any time if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); } }; // The deferred used on DOM ready var readyList = jQuery.Deferred(); jQuery.fn.ready = function( fn ) { readyList.then( fn ); return this; }; jQuery.extend( { // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); } } ); jQuery.ready.then = readyList.then; // The ready event handler and self cleanup method function completed() { document.removeEventListener( "DOMContentLoaded", completed ); window.removeEventListener( "load", completed ); jQuery.ready(); } // Catch cases where $(document).ready() is called // after the browser event has already occurred. // Support: IE <=9 - 10 only // Older IE sometimes signals "interactive" too soon if ( document.readyState === "complete" || ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { // Handle it asynchronously to allow scripts the opportunity to delay ready window.setTimeout( jQuery.ready ); } else { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed ); } // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, len = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { access( elems, fn, i, key[ i ], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < len; i++ ) { fn( elems[ i ], key, raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : len ? fn( elems[ 0 ], key ) : emptyGet; }; var acceptData = function( owner ) { // Accepts only: // - Node // - Node.ELEMENT_NODE // - Node.DOCUMENT_NODE // - Object // - Any /* jshint -W018 */ return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); }; function Data() { this.expando = jQuery.expando + Data.uid++; } Data.uid = 1; Data.prototype = { cache: function( owner ) { // Check if the owner object already has a cache var value = owner[ this.expando ]; // If not, create one if ( !value ) { value = {}; // We can accept data for non-element nodes in modern browsers, // but we should not, see #8335. // Always return an empty object. if ( acceptData( owner ) ) { // If it is a node unlikely to be stringify-ed or looped over // use plain assignment if ( owner.nodeType ) { owner[ this.expando ] = value; // Otherwise secure it in a non-enumerable property // configurable must be true to allow the property to be // deleted when data is removed } else { Object.defineProperty( owner, this.expando, { value: value, configurable: true } ); } } } return value; }, set: function( owner, data, value ) { var prop, cache = this.cache( owner ); // Handle: [ owner, key, value ] args // Always use camelCase key (gh-2257) if ( typeof data === "string" ) { cache[ jQuery.camelCase( data ) ] = value; // Handle: [ owner, { properties } ] args } else { // Copy the properties one-by-one to the cache object for ( prop in data ) { cache[ jQuery.camelCase( prop ) ] = data[ prop ]; } } return cache; }, get: function( owner, key ) { return key === undefined ? this.cache( owner ) : // Always use camelCase key (gh-2257) owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ]; }, access: function( owner, key, value ) { // In cases where either: // // 1. No key was specified // 2. A string key was specified, but no value provided // // Take the "read" path and allow the get method to determine // which value to return, respectively either: // // 1. The entire cache object // 2. The data stored at the key // if ( key === undefined || ( ( key && typeof key === "string" ) && value === undefined ) ) { return this.get( owner, key ); } // When the key is not a string, or both a key and value // are specified, set or extend (existing objects) with either: // // 1. An object of properties // 2. A key and value // this.set( owner, key, value ); // Since the "set" path can have two possible entry points // return the expected data based on which path was taken[*] return value !== undefined ? value : key; }, remove: function( owner, key ) { var i, cache = owner[ this.expando ]; if ( cache === undefined ) { return; } if ( key !== undefined ) { // Support array or space separated string of keys if ( jQuery.isArray( key ) ) { // If key is an array of keys... // We always set camelCase keys, so remove that. key = key.map( jQuery.camelCase ); } else { key = jQuery.camelCase( key ); // If a key with the spaces exists, use it. // Otherwise, create an array by matching non-whitespace key = key in cache ? [ key ] : ( key.match( rnotwhite ) || [] ); } i = key.length; while ( i-- ) { delete cache[ key[ i ] ]; } } // Remove the expando if there's no more data if ( key === undefined || jQuery.isEmptyObject( cache ) ) { // Support: Chrome <=35 - 45 // Webkit & Blink performance suffers when deleting properties // from DOM nodes, so set to undefined instead // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) if ( owner.nodeType ) { owner[ this.expando ] = undefined; } else { delete owner[ this.expando ]; } } }, hasData: function( owner ) { var cache = owner[ this.expando ]; return cache !== undefined && !jQuery.isEmptyObject( cache ); } }; var dataPriv = new Data(); var dataUser = new Data(); // Implementation Summary // // 1. Enforce API surface and semantic compatibility with 1.9.x branch // 2. Improve the module's maintainability by reducing the storage // paths to a single mechanism. // 3. Use the same single mechanism to support "private" and "user" data. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) // 5. Avoid exposing implementation details on user objects (eg. expando properties) // 6. Provide a clear path for implementation upgrade to WeakMap in 2014 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /[A-Z]/g; function dataAttr( elem, key, data ) { var name; // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? JSON.parse( data ) : data; } catch ( e ) {} // Make sure we set the data so it isn't changed later dataUser.set( elem, key, data ); } else { data = undefined; } } return data; } jQuery.extend( { hasData: function( elem ) { return dataUser.hasData( elem ) || dataPriv.hasData( elem ); }, data: function( elem, name, data ) { return dataUser.access( elem, name, data ); }, removeData: function( elem, name ) { dataUser.remove( elem, name ); }, // TODO: Now that all calls to _data and _removeData have been replaced // with direct calls to dataPriv methods, these can be deprecated. _data: function( elem, name, data ) { return dataPriv.access( elem, name, data ); }, _removeData: function( elem, name ) { dataPriv.remove( elem, name ); } } ); jQuery.fn.extend( { data: function( key, value ) { var i, name, data, elem = this[ 0 ], attrs = elem && elem.attributes; // Gets all values if ( key === undefined ) { if ( this.length ) { data = dataUser.get( elem ); if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { i = attrs.length; while ( i-- ) { // Support: IE 11 only // The attrs elements can be null (#14894) if ( attrs[ i ] ) { name = attrs[ i ].name; if ( name.indexOf( "data-" ) === 0 ) { name = jQuery.camelCase( name.slice( 5 ) ); dataAttr( elem, name, data[ name ] ); } } } dataPriv.set( elem, "hasDataAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each( function() { dataUser.set( this, key ); } ); } return access( this, function( value ) { var data; // The calling jQuery object (element matches) is not empty // (and therefore has an element appears at this[ 0 ]) and the // `value` parameter was not undefined. An empty jQuery object // will result in `undefined` for elem = this[ 0 ] which will // throw an exception if an attempt to read a data cache is made. if ( elem && value === undefined ) { // Attempt to get data from the cache // The key will always be camelCased in Data data = dataUser.get( elem, key ); if ( data !== undefined ) { return data; } // Attempt to "discover" the data in // HTML5 custom data-* attrs data = dataAttr( elem, key ); if ( data !== undefined ) { return data; } // We tried really hard, but the data doesn't exist. return; } // Set the data... this.each( function() { // We always store the camelCased key dataUser.set( this, key, value ); } ); }, null, value, arguments.length > 1, null, true ); }, removeData: function( key ) { return this.each( function() { dataUser.remove( this, key ); } ); } } ); jQuery.extend( { queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = dataPriv.get( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray( data ) ) { queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // Clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // Not public - generate a queueHooks object, or return the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { empty: jQuery.Callbacks( "once memory" ).add( function() { dataPriv.remove( elem, [ type + "queue", key ] ); } ) } ); } } ); jQuery.fn.extend( { queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[ 0 ], type ); } return data === undefined ? this : this.each( function() { var queue = jQuery.queue( this, type, data ); // Ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { jQuery.dequeue( this, type ); } } ); }, dequeue: function( type ) { return this.each( function() { jQuery.dequeue( this, type ); } ); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while ( i-- ) { tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } } ); var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; var isHiddenWithinTree = function( elem, el ) { // isHiddenWithinTree might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; // Inline style trumps all return elem.style.display === "none" || elem.style.display === "" && // Otherwise, check computed style // Support: Firefox <=43 - 45 // Disconnected elements can have computed display: none, so first confirm that elem is // in the document. jQuery.contains( elem.ownerDocument, elem ) && jQuery.css( elem, "display" ) === "none"; }; var swap = function( elem, options, callback, args ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; }; function adjustCSS( elem, prop, valueParts, tween ) { var adjusted, scale = 1, maxIterations = 20, currentValue = tween ? function() { return tween.cur(); } : function() { return jQuery.css( elem, prop, "" ); }, initial = currentValue(), unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), // Starting value computation is required for potential unit mismatches initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && rcssNum.exec( jQuery.css( elem, prop ) ); if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { // Trust units reported by jQuery.css unit = unit || initialInUnit[ 3 ]; // Make sure we update the tween properties later on valueParts = valueParts || []; // Iteratively approximate from a nonzero starting point initialInUnit = +initial || 1; do { // If previous iteration zeroed out, double until we get *something*. // Use string for doubling so we don't accidentally see scale as unchanged below scale = scale || ".5"; // Adjust and apply initialInUnit = initialInUnit / scale; jQuery.style( elem, prop, initialInUnit + unit ); // Update scale, tolerating zero or NaN from tween.cur() // Break the loop if scale is unchanged or perfect, or if we've just had enough. } while ( scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations ); } if ( valueParts ) { initialInUnit = +initialInUnit || +initial || 0; // Apply relative offset (+=/-=) if specified adjusted = valueParts[ 1 ] ? initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : +valueParts[ 2 ]; if ( tween ) { tween.unit = unit; tween.start = initialInUnit; tween.end = adjusted; } } return adjusted; } var defaultDisplayMap = {}; function getDefaultDisplay( elem ) { var temp, doc = elem.ownerDocument, nodeName = elem.nodeName, display = defaultDisplayMap[ nodeName ]; if ( display ) { return display; } temp = doc.body.appendChild( doc.createElement( nodeName ) ), display = jQuery.css( temp, "display" ); temp.parentNode.removeChild( temp ); if ( display === "none" ) { display = "block"; } defaultDisplayMap[ nodeName ] = display; return display; } function showHide( elements, show ) { var display, elem, values = [], index = 0, length = elements.length; // Determine new display value for elements that need to change for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } display = elem.style.display; if ( show ) { // Since we force visibility upon cascade-hidden elements, an immediate (and slow) // check is required in this first loop unless we have a nonempty display value (either // inline or about-to-be-restored) if ( display === "none" ) { values[ index ] = dataPriv.get( elem, "display" ) || null; if ( !values[ index ] ) { elem.style.display = ""; } } if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { values[ index ] = getDefaultDisplay( elem ); } } else { if ( display !== "none" ) { values[ index ] = "none"; // Remember what we're overwriting dataPriv.set( elem, "display", display ); } } } // Set the display of the elements in a second loop to avoid constant reflow for ( index = 0; index < length; index++ ) { if ( values[ index ] != null ) { elements[ index ].style.display = values[ index ]; } } return elements; } jQuery.fn.extend( { show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { if ( typeof state === "boolean" ) { return state ? this.show() : this.hide(); } return this.each( function() { if ( isHiddenWithinTree( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } } ); } } ); var rcheckableType = ( /^(?:checkbox|radio)$/i ); var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i ); var rscriptType = ( /^$|\/(?:java|ecma)script/i ); // We have to close these tags to support XHTML (#13200) var wrapMap = { // Support: IE <=9 only option: [ 1, "<select multiple='multiple'>", "</select>" ], // XHTML parsers do not magically insert elements in the // same way that tag soup parsers do. So we cannot shorten // this by omitting <tbody> or other required elements. thead: [ 1, "<table>", "</table>" ], col: [ 2, "<table><colgroup>", "</colgroup></table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], _default: [ 0, "", "" ] }; // Support: IE <=9 only wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; function getAll( context, tag ) { // Support: IE <=9 - 11 only // Use typeof to avoid zero-argument method invocation on host objects (#15151) var ret = typeof context.getElementsByTagName !== "undefined" ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== "undefined" ? context.querySelectorAll( tag || "*" ) : []; return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], ret ) : ret; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var i = 0, l = elems.length; for ( ; i < l; i++ ) { dataPriv.set( elems[ i ], "globalEval", !refElements || dataPriv.get( refElements[ i ], "globalEval" ) ); } } var rhtml = /<|&#?\w+;/; function buildFragment( elems, context, scripts, selection, ignored ) { var elem, tmp, tag, wrap, contains, j, fragment = context.createDocumentFragment(), nodes = [], i = 0, l = elems.length; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { // Support: Android <=4.0 only, PhantomJS 1 only // push.apply(_, arraylike) throws on ancient WebKit jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; // Descend through wrappers to the right content j = wrap[ 0 ]; while ( j-- ) { tmp = tmp.lastChild; } // Support: Android <=4.0 only, PhantomJS 1 only // push.apply(_, arraylike) throws on ancient WebKit jQuery.merge( nodes, tmp.childNodes ); // Remember the top-level container tmp = fragment.firstChild; // Ensure the created nodes are orphaned (#12392) tmp.textContent = ""; } } } // Remove wrapper from fragment fragment.textContent = ""; i = 0; while ( ( elem = nodes[ i++ ] ) ) { // Skip elements already in the context collection (trac-4087) if ( selection && jQuery.inArray( elem, selection ) > -1 ) { if ( ignored ) { ignored.push( elem ); } continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( fragment.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( ( elem = tmp[ j++ ] ) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } return fragment; } ( function() { var fragment = document.createDocumentFragment(), div = fragment.appendChild( document.createElement( "div" ) ), input = document.createElement( "input" ); // Support: Android 4.0 - 4.3 only // Check state lost if the name is set (#11217) // Support: Windows Web Apps (WWA) // `name` and `type` must use .setAttribute for WWA (#14901) input.setAttribute( "type", "radio" ); input.setAttribute( "checked", "checked" ); input.setAttribute( "name", "t" ); div.appendChild( input ); // Support: Android <=4.1 only // Older WebKit doesn't clone checked state correctly in fragments support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE <=11 only // Make sure textarea (and checkbox) defaultValue is properly cloned div.innerHTML = "<textarea>x</textarea>"; support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; } )(); var documentElement = document.documentElement; var rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, rtypenamespace = /^([^.]*)(?:\.(.+)|)/; function returnTrue() { return true; } function returnFalse() { return false; } // Support: IE <=9 only // See #13393 for more info function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } function on( elem, types, selector, data, fn, one ) { var origFn, type; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { on( elem, type, selector, data, types[ type ], one ); } return elem; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return elem; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return elem.each( function() { jQuery.event.add( this, types, fn, data, selector ); } ); } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var handleObjIn, eventHandle, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.get( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Ensure that invalid selectors throw exceptions at attach time // Evaluate against documentElement in case elem is a non-element node (e.g., document) if ( selector ) { jQuery.find.matchesSelector( documentElement, selector ); } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !( events = elemData.events ) ) { events = elemData.events = {}; } if ( !( eventHandle = elemData.handle ) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply( elem, arguments ) : undefined; }; } // Handle multiple events separated by a space types = ( types || "" ).match( rnotwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[ t ] ) || []; type = origType = tmp[ 1 ]; namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend( { type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join( "." ) }, handleObjIn ); // Init the event handler queue if we're the first if ( !( handlers = events[ type ] ) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, origCount, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); if ( !elemData || !( events = elemData.events ) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( rnotwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[ t ] ) || []; type = origType = tmp[ 1 ]; namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[ 2 ] && new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove data and the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { dataPriv.remove( elem, "handle events" ); } }, dispatch: function( nativeEvent ) { // Make a writable jQuery.Event from the native event object var event = jQuery.event.fix( nativeEvent ); var i, j, ret, matched, handleObj, handlerQueue, args = new Array( arguments.length ), handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[ 0 ] = event; for ( i = 1; i < arguments.length; i++ ) { args[ i ] = arguments[ i ]; } event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( ( handleObj = matched.handlers[ j++ ] ) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or 2) have namespace(s) // a subset or equal to those in the bound event (both can have no namespace). if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || handleObj.handler ).apply( matched.elem, args ); if ( ret !== undefined ) { if ( ( event.result = ret ) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var i, matches, sel, handleObj, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Support: IE <=9 // Find delegate handlers // Black-hole SVG <use> instance trees (#13180) // // Support: Firefox <=42 // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) if ( delegateCount && cur.nodeType && ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { for ( ; cur !== this; cur = cur.parentNode || this ) { // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) > -1 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push( { elem: cur, handlers: matches } ); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } ); } return handlerQueue; }, addProp: function( name, hook ) { Object.defineProperty( jQuery.Event.prototype, name, { enumerable: true, configurable: true, get: jQuery.isFunction( hook ) ? function() { if ( this.originalEvent ) { return hook( this.originalEvent ); } } : function() { if ( this.originalEvent ) { return this.originalEvent[ name ]; } }, set: function( value ) { Object.defineProperty( this, name, { enumerable: true, configurable: true, writable: true, value: value } ); } } ); }, fix: function( originalEvent ) { return originalEvent[ jQuery.expando ] ? originalEvent : new jQuery.Event( originalEvent ); }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { this.focus(); return false; } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === safeActiveElement() && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) { this.click(); return false; } }, // For cross-browser consistency, don't fire native .click() on links _default: function( event ) { return jQuery.nodeName( event.target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Support: Firefox 20+ // Firefox doesn't alert if the returnValue field is not set. if ( event.result !== undefined && event.originalEvent ) { event.originalEvent.returnValue = event.result; } } } } }; jQuery.removeEvent = function( elem, type, handle ) { // This "if" is needed for plain objects if ( elem.removeEventListener ) { elem.removeEventListener( type, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !( this instanceof jQuery.Event ) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && // Support: Android <=2.3 only src.returnValue === false ? returnTrue : returnFalse; // Create target properties // Support: Safari <=6 - 7 only // Target should not be a text node (#504, #13143) this.target = ( src.target && src.target.nodeType === 3 ) ? src.target.parentNode : src.target; this.currentTarget = src.currentTarget; this.relatedTarget = src.relatedTarget; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { constructor: jQuery.Event, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, isSimulated: false, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( e && !this.isSimulated ) { e.preventDefault(); } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( e && !this.isSimulated ) { e.stopPropagation(); } }, stopImmediatePropagation: function() { var e = this.originalEvent; this.isImmediatePropagationStopped = returnTrue; if ( e && !this.isSimulated ) { e.stopImmediatePropagation(); } this.stopPropagation(); } }; // Includes all common event props including KeyEvent and MouseEvent specific props jQuery.each( { altKey: true, bubbles: true, cancelable: true, changedTouches: true, ctrlKey: true, detail: true, eventPhase: true, metaKey: true, pageX: true, pageY: true, shiftKey: true, view: true, "char": true, charCode: true, key: true, keyCode: true, button: true, buttons: true, clientX: true, clientY: true, offsetX: true, offsetY: true, pointerId: true, pointerType: true, screenX: true, screenY: true, targetTouches: true, toElement: true, touches: true, which: function( event ) { var button = event.button; // Add which for key events if ( event.which == null && rkeyEvent.test( event.type ) ) { return event.charCode != null ? event.charCode : event.keyCode; } // Add which for click: 1 === left; 2 === middle; 3 === right if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { return ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event.which; } }, jQuery.event.addProp ); // Create mouseenter/leave events using mouseover/out and event-time checks // so that event delegation works in jQuery. // Do the same for pointerenter/pointerleave and pointerover/pointerout // // Support: Safari 7 only // Safari sends mouseenter too often; see: // https://bugs.chromium.org/p/chromium/issues/detail?id=470258 // for the description of the bug (it existed in older Chrome versions as well). jQuery.each( { mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mouseenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; } ); jQuery.fn.extend( { on: function( types, selector, data, fn ) { return on( this, types, selector, data, fn ); }, one: function( types, selector, data, fn ) { return on( this, types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each( function() { jQuery.event.remove( this, types, fn, selector ); } ); } } ); var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, // Support: IE <=10 - 11, Edge 12 - 13 // In IE/Edge using regex groups here causes severe slowdowns. // See https://connect.microsoft.com/IE/feedback/details/1736512/ rnoInnerhtml = /<script|<style|<link/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptTypeMasked = /^true\/(.*)/, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; function manipulationTarget( elem, content ) { if ( jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { return elem.getElementsByTagName( "tbody" )[ 0 ] || elem; } return elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[ 1 ]; } else { elem.removeAttribute( "type" ); } return elem; } function cloneCopyEvent( src, dest ) { var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; if ( dest.nodeType !== 1 ) { return; } // 1. Copy private data: events, handlers, etc. if ( dataPriv.hasData( src ) ) { pdataOld = dataPriv.access( src ); pdataCur = dataPriv.set( dest, pdataOld ); events = pdataOld.events; if ( events ) { delete pdataCur.handle; pdataCur.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } } // 2. Copy user data if ( dataUser.hasData( src ) ) { udataOld = dataUser.access( src ); udataCur = jQuery.extend( {}, udataOld ); dataUser.set( dest, udataCur ); } } // Fix IE bugs, see support tests function fixInput( src, dest ) { var nodeName = dest.nodeName.toLowerCase(); // Fails to persist the checked state of a cloned checkbox or radio button. if ( nodeName === "input" && rcheckableType.test( src.type ) ) { dest.checked = src.checked; // Fails to return the selected option to the default selected state when cloning options } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } function domManip( collection, args, callback, ignored ) { // Flatten any nested arrays args = concat.apply( [], args ); var fragment, first, scripts, hasScripts, node, doc, i = 0, l = collection.length, iNoClone = l - 1, value = args[ 0 ], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || ( l > 1 && typeof value === "string" && !support.checkClone && rchecked.test( value ) ) ) { return collection.each( function( index ) { var self = collection.eq( index ); if ( isFunction ) { args[ 0 ] = value.call( this, index, self.html() ); } domManip( self, args, callback, ignored ); } ); } if ( l ) { fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } // Require either new content or an interest in ignored elements to invoke the callback if ( first || ignored ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item // instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { // Support: Android <=4.0 only, PhantomJS 1 only // push.apply(_, arraylike) throws on ancient WebKit jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( collection[ i ], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !dataPriv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Optional AJAX dependency, but won't run scripts if not present if ( jQuery._evalUrl ) { jQuery._evalUrl( node.src ); } } else { DOMEval( node.textContent.replace( rcleanScript, "" ), doc ); } } } } } } return collection; } function remove( elem, selector, keepData ) { var node, nodes = selector ? jQuery.filter( selector, elem ) : elem, i = 0; for ( ; ( node = nodes[ i ] ) != null; i++ ) { if ( !keepData && node.nodeType === 1 ) { jQuery.cleanData( getAll( node ) ); } if ( node.parentNode ) { if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { setGlobalEval( getAll( node, "script" ) ); } node.parentNode.removeChild( node ); } } return elem; } jQuery.extend( { htmlPrefilter: function( html ) { return html.replace( rxhtmlTag, "<$1></$2>" ); }, clone: function( elem, dataAndEvents, deepDataAndEvents ) { var i, l, srcElements, destElements, clone = elem.cloneNode( true ), inPage = jQuery.contains( elem.ownerDocument, elem ); // Fix IE cloning issues if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) { // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); for ( i = 0, l = srcElements.length; i < l; i++ ) { fixInput( srcElements[ i ], destElements[ i ] ); } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0, l = srcElements.length; i < l; i++ ) { cloneCopyEvent( srcElements[ i ], destElements[ i ] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } // Return the cloned set return clone; }, cleanData: function( elems ) { var data, elem, type, special = jQuery.event.special, i = 0; for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { if ( acceptData( elem ) ) { if ( ( data = elem[ dataPriv.expando ] ) ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Support: Chrome <=35 - 45+ // Assign undefined instead of using delete, see Data#remove elem[ dataPriv.expando ] = undefined; } if ( elem[ dataUser.expando ] ) { // Support: Chrome <=35 - 45+ // Assign undefined instead of using delete, see Data#remove elem[ dataUser.expando ] = undefined; } } } } } ); jQuery.fn.extend( { detach: function( selector ) { return remove( this, selector, true ); }, remove: function( selector ) { return remove( this, selector ); }, text: function( value ) { return access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().each( function() { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { this.textContent = value; } } ); }, null, value, arguments.length ); }, append: function() { return domManip( this, arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } } ); }, prepend: function() { return domManip( this, arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } } ); }, before: function() { return domManip( this, arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } } ); }, after: function() { return domManip( this, arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } } ); }, empty: function() { var elem, i = 0; for ( ; ( elem = this[ i ] ) != null; i++ ) { if ( elem.nodeType === 1 ) { // Prevent memory leaks jQuery.cleanData( getAll( elem, false ) ); // Remove any remaining nodes elem.textContent = ""; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function() { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); } ); }, html: function( value ) { return access( this, function( value ) { var elem = this[ 0 ] || {}, i = 0, l = this.length; if ( value === undefined && elem.nodeType === 1 ) { return elem.innerHTML; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { value = jQuery.htmlPrefilter( value ); try { for ( ; i < l; i++ ) { elem = this[ i ] || {}; // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch ( e ) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var ignored = []; // Make the changes, replacing each non-ignored context element with the new content return domManip( this, arguments, function( elem ) { var parent = this.parentNode; if ( jQuery.inArray( this, ignored ) < 0 ) { jQuery.cleanData( getAll( this ) ); if ( parent ) { parent.replaceChild( elem, this ); } } // Force callback invocation }, ignored ); } } ); jQuery.each( { appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, ret = [], insert = jQuery( selector ), last = insert.length - 1, i = 0; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone( true ); jQuery( insert[ i ] )[ original ]( elems ); // Support: Android <=4.0 only, PhantomJS 1 only // .get() because push.apply(_, arraylike) throws on ancient WebKit push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; } ); var rmargin = ( /^margin/ ); var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); var getStyles = function( elem ) { // Support: IE <=11 only, Firefox <=30 (#15098, #14150) // IE throws on elements created in popups // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" var view = elem.ownerDocument.defaultView; if ( !view || !view.opener ) { view = window; } return view.getComputedStyle( elem ); }; ( function() { // Executing both pixelPosition & boxSizingReliable tests require only one layout // so they're executed at the same time to save the second computation. function computeStyleTests() { // This is a singleton, we need to execute it only once if ( !div ) { return; } div.style.cssText = "box-sizing:border-box;" + "position:relative;display:block;" + "margin:auto;border:1px;padding:1px;" + "top:1%;width:50%"; div.innerHTML = ""; documentElement.appendChild( container ); var divStyle = window.getComputedStyle( div ); pixelPositionVal = divStyle.top !== "1%"; // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 reliableMarginLeftVal = divStyle.marginLeft === "2px"; boxSizingReliableVal = divStyle.width === "4px"; // Support: Android 4.0 - 4.3 only // Some styles come back with percentage values, even though they shouldn't div.style.marginRight = "50%"; pixelMarginRightVal = divStyle.marginRight === "4px"; documentElement.removeChild( container ); // Nullify the div so it wouldn't be stored in the memory and // it will also be a sign that checks already performed div = null; } var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal, container = document.createElement( "div" ), div = document.createElement( "div" ); // Finish early in limited (non-browser) environments if ( !div.style ) { return; } // Support: IE <=9 - 11 only // Style of cloned element affects source element cloned (#8908) div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + "padding:0;margin-top:1px;position:absolute"; container.appendChild( div ); jQuery.extend( support, { pixelPosition: function() { computeStyleTests(); return pixelPositionVal; }, boxSizingReliable: function() { computeStyleTests(); return boxSizingReliableVal; }, pixelMarginRight: function() { computeStyleTests(); return pixelMarginRightVal; }, reliableMarginLeft: function() { computeStyleTests(); return reliableMarginLeftVal; } } ); } )(); function curCSS( elem, name, computed ) { var width, minWidth, maxWidth, ret, style = elem.style; computed = computed || getStyles( elem ); // Support: IE <=9 only // getPropertyValue is only needed for .css('filter') (#12537) if ( computed ) { ret = computed.getPropertyValue( name ) || computed[ name ]; if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } // A tribute to the "awesome hack by Dean Edwards" // Android Browser returns percentage for some values, // but width seems to be reliably pixels. // This is against the CSSOM draft spec: // https://drafts.csswg.org/cssom/#resolved-values if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret !== undefined ? // Support: IE <=9 - 11 only // IE returns zIndex value as an integer. ret + "" : ret; } function addGetHookIf( conditionFn, hookFn ) { // Define the hook, we'll check on the first run if it's really needed. return { get: function() { if ( conditionFn() ) { // Hook not needed (or it's not possible to use it due // to missing dependency), remove it. delete this.get; return; } // Hook needed; redefine it so that the support test is not executed again. return ( this.get = hookFn ).apply( this, arguments ); } }; } var // Swappable if display is none or starts with table // except "table", "table-cell", or "table-caption" // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: "0", fontWeight: "400" }, cssPrefixes = [ "Webkit", "Moz", "ms" ], emptyStyle = document.createElement( "div" ).style; // Return a css property mapped to a potentially vendor prefixed property function vendorPropName( name ) { // Shortcut for names that are not vendor prefixed if ( name in emptyStyle ) { return name; } // Check for vendor prefixed names var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in emptyStyle ) { return name; } } } function setPositiveNumber( elem, value, subtract ) { // Any relative (+/-) values have already been // normalized at this point var matches = rcssNum.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : value; } function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; i < 4; i += 2 ) { // Both box models exclude margin, so add it if we want it if ( extra === "margin" ) { val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); } if ( isBorderBox ) { // border-box includes padding, so remove it if we want content if ( extra === "content" ) { val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // At this point, extra isn't border nor margin, so remove border if ( extra !== "margin" ) { val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } else { // At this point, extra isn't content, so add padding val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // At this point, extra isn't content nor padding, so add border if ( extra !== "padding" ) { val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } return val; } function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var val, valueIsBorderBox = true, styles = getStyles( elem ), isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // Support: IE <=11 only // Running getBoundingClientRect on a disconnected node // in IE throws an error. if ( elem.getClientRects().length ) { val = elem.getBoundingClientRect()[ name ]; } // Some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if ( val <= 0 || val == null ) { // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name, styles ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test( val ) ) { return val; } // Check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] ); // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; } // Use the active box-sizing model to add/subtract irrelevant styles return ( val + augmentWidthOrHeight( elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles ) ) + "px"; } jQuery.extend( { // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Don't automatically add "px" to these possibly-unitless properties cssNumber: { "animationIterationCount": true, "columnCount": true, "fillOpacity": true, "flexGrow": true, "flexShrink": true, "fontWeight": true, "lineHeight": true, "opacity": true, "order": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { "float": "cssFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase( name ), style = elem.style; name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); // Gets hook for the prefixed version, then unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // Convert "+=" or "-=" to relative numbers (#7345) if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { value = adjustCSS( elem, name, ret ); // Fixes bug #9237 type = "number"; } // Make sure that null and NaN values aren't set (#7116) if ( value == null || value !== value ) { return; } // If a number was passed in, add the unit (except for certain CSS properties) if ( type === "number" ) { value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); } // background-* props affect original clone's values if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !( "set" in hooks ) || ( value = hooks.set( elem, value, extra ) ) !== undefined ) { style[ name ] = value; } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var val, num, hooks, origName = jQuery.camelCase( name ); // Make sure that we're working with the right name name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); // Try prefixed name followed by the unprefixed name hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } // Convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Make numeric if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || isFinite( num ) ? num || 0 : val; } return val; } } ); jQuery.each( [ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { // Certain elements can have dimension info if we invisibly show them // but it must have a current display style that would benefit return rdisplayswap.test( jQuery.css( elem, "display" ) ) && // Support: Safari 8+ // Table columns in Safari have non-zero offsetWidth & zero // getBoundingClientRect().width unless display is changed. // Support: IE <=11 only // Running getBoundingClientRect on a disconnected node // in IE throws an error. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); } ) : getWidthOrHeight( elem, name, extra ); } }, set: function( elem, value, extra ) { var matches, styles = extra && getStyles( elem ), subtract = extra && augmentWidthOrHeight( elem, name, extra, jQuery.css( elem, "boxSizing", false, styles ) === "border-box", styles ); // Convert to pixels if value adjustment is needed if ( subtract && ( matches = rcssNum.exec( value ) ) && ( matches[ 3 ] || "px" ) !== "px" ) { elem.style[ name ] = value; value = jQuery.css( elem, name ); } return setPositiveNumber( elem, value, subtract ); } }; } ); jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, function( elem, computed ) { if ( computed ) { return ( parseFloat( curCSS( elem, "marginLeft" ) ) || elem.getBoundingClientRect().left - swap( elem, { marginLeft: 0 }, function() { return elem.getBoundingClientRect().left; } ) ) + "px"; } } ); // These hooks are used by animate to expand properties jQuery.each( { margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i = 0, expanded = {}, // Assumes a single number if not a string parts = typeof value === "string" ? value.split( " " ) : [ value ]; for ( ; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; if ( !rmargin.test( prefix ) ) { jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } } ); jQuery.fn.extend( { css: function( name, value ) { return access( this, function( elem, name, value ) { var styles, len, map = {}, i = 0; if ( jQuery.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); } } ); function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function( elem, options, prop, end, easing, unit ) { this.elem = elem; this.prop = prop; this.easing = easing || jQuery.easing._default; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); }, cur: function() { var hooks = Tween.propHooks[ this.prop ]; return hooks && hooks.get ? hooks.get( this ) : Tween.propHooks._default.get( this ); }, run: function( percent ) { var eased, hooks = Tween.propHooks[ this.prop ]; if ( this.options.duration ) { this.pos = eased = jQuery.easing[ this.easing ]( percent, this.options.duration * percent, 0, 1, this.options.duration ); } else { this.pos = eased = percent; } this.now = ( this.end - this.start ) * eased + this.start; if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } if ( hooks && hooks.set ) { hooks.set( this ); } else { Tween.propHooks._default.set( this ); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function( tween ) { var result; // Use a property on the element directly when it is not a DOM element, // or when there is no matching style property that exists. if ( tween.elem.nodeType !== 1 || tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { return tween.elem[ tween.prop ]; } // Passing an empty string as a 3rd parameter to .css will automatically // attempt a parseFloat and fallback to a string if the parse fails. // Simple values such as "10px" are parsed to Float; // complex values such as "rotate(1rad)" are returned as-is. result = jQuery.css( tween.elem, tween.prop, "" ); // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function( tween ) { // Use step hook for back compat. // Use cssHook if its there. // Use .style if available and use plain properties where available. if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); } else if ( tween.elem.nodeType === 1 && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; } } } }; // Support: IE <=9 only // Panic based approach to setting things on disconnected nodes Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function( tween ) { if ( tween.elem.nodeType && tween.elem.parentNode ) { tween.elem[ tween.prop ] = tween.now; } } }; jQuery.easing = { linear: function( p ) { return p; }, swing: function( p ) { return 0.5 - Math.cos( p * Math.PI ) / 2; }, _default: "swing" }; jQuery.fx = Tween.prototype.init; // Back compat <1.8 extension point jQuery.fx.step = {}; var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/; function raf() { if ( timerId ) { window.requestAnimationFrame( raf ); jQuery.fx.tick(); } } // Animations created synchronously will run synchronously function createFxNow() { window.setTimeout( function() { fxNow = undefined; } ); return ( fxNow = jQuery.now() ); } // Generate parameters to create a standard animation function genFx( type, includeWidth ) { var which, i = 0, attrs = { height: type }; // If we include width, step value is 1 to do all cssExpand values, // otherwise step value is 2 to skip over Left and Right includeWidth = includeWidth ? 1 : 0; for ( ; i < 4 ; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; } function createTween( value, prop, animation ) { var tween, collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), index = 0, length = collection.length; for ( ; index < length; index++ ) { if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { // We're done with this property return tween; } } } function defaultPrefilter( elem, props, opts ) { /* jshint validthis: true */ var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, isBox = "width" in props || "height" in props, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHiddenWithinTree( elem ), dataShow = dataPriv.get( elem, "fxshow" ); // Queue-skipping animations hijack the fx hooks if ( !opts.queue ) { hooks = jQuery._queueHooks( elem, "fx" ); if ( hooks.unqueued == null ) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if ( !hooks.unqueued ) { oldfire(); } }; } hooks.unqueued++; anim.always( function() { // Ensure the complete handler is called before this completes anim.always( function() { hooks.unqueued--; if ( !jQuery.queue( elem, "fx" ).length ) { hooks.empty.fire(); } } ); } ); } // Detect show/hide animations for ( prop in props ) { value = props[ prop ]; if ( rfxtypes.test( value ) ) { delete props[ prop ]; toggle = toggle || value === "toggle"; if ( value === ( hidden ? "hide" : "show" ) ) { // Pretend to be hidden if this is a "show" and // there is still data from a stopped show/hide if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { hidden = true; // Ignore all other no-op show/hide data } else { continue; } } orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); } } // Bail out if this is a no-op like .hide().hide() propTween = !jQuery.isEmptyObject( props ); if ( !propTween && jQuery.isEmptyObject( orig ) ) { return; } // Restrict "overflow" and "display" styles during box animations if ( isBox && elem.nodeType === 1 ) { // Support: IE <=9 - 11, Edge 12 - 13 // Record all 3 overflow attributes because IE does not infer the shorthand // from identically-valued overflowX and overflowY opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; // Identify a display type, preferring old show/hide data over the CSS cascade restoreDisplay = dataShow && dataShow.display; if ( restoreDisplay == null ) { restoreDisplay = dataPriv.get( elem, "display" ); } display = jQuery.css( elem, "display" ); if ( display === "none" ) { if ( restoreDisplay ) { display = restoreDisplay; } else { // Get nonempty value(s) by temporarily forcing visibility showHide( [ elem ], true ); restoreDisplay = elem.style.display || restoreDisplay; display = jQuery.css( elem, "display" ); showHide( [ elem ] ); } } // Animate inline elements as inline-block if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { if ( jQuery.css( elem, "float" ) === "none" ) { // Restore the original display value at the end of pure show/hide animations if ( !propTween ) { anim.done( function() { style.display = restoreDisplay; } ); if ( restoreDisplay == null ) { display = style.display; restoreDisplay = display === "none" ? "" : display; } } style.display = "inline-block"; } } } if ( opts.overflow ) { style.overflow = "hidden"; anim.always( function() { style.overflow = opts.overflow[ 0 ]; style.overflowX = opts.overflow[ 1 ]; style.overflowY = opts.overflow[ 2 ]; } ); } // Implement show/hide animations propTween = false; for ( prop in orig ) { // General show/hide setup for this element animation if ( !propTween ) { if ( dataShow ) { if ( "hidden" in dataShow ) { hidden = dataShow.hidden; } } else { dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); } // Store hidden/visible for toggle so `.stop().toggle()` "reverses" if ( toggle ) { dataShow.hidden = !hidden; } // Show elements before animating them if ( hidden ) { showHide( [ elem ], true ); } /* jshint -W083 */ anim.done( function() { // The final step of a "hide" animation is actually hiding the element if ( !hidden ) { showHide( [ elem ] ); } dataPriv.remove( elem, "fxshow" ); for ( prop in orig ) { jQuery.style( elem, prop, orig[ prop ] ); } } ); } // Per-property setup propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); if ( !( prop in dataShow ) ) { dataShow[ prop ] = propTween.start; if ( hidden ) { propTween.end = propTween.start; propTween.start = 0; } } } } function propFilter( props, specialEasing ) { var index, name, easing, value, hooks; // camelCase, specialEasing and expand cssHook pass for ( index in props ) { name = jQuery.camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; if ( jQuery.isArray( value ) ) { easing = value[ 1 ]; value = props[ index ] = value[ 0 ]; } if ( index !== name ) { props[ name ] = value; delete props[ index ]; } hooks = jQuery.cssHooks[ name ]; if ( hooks && "expand" in hooks ) { value = hooks.expand( value ); delete props[ name ]; // Not quite $.extend, this won't overwrite existing keys. // Reusing 'index' because we have the correct "name" for ( index in value ) { if ( !( index in props ) ) { props[ index ] = value[ index ]; specialEasing[ index ] = easing; } } } else { specialEasing[ name ] = easing; } } } function Animation( elem, properties, options ) { var result, stopped, index = 0, length = Animation.prefilters.length, deferred = jQuery.Deferred().always( function() { // Don't match elem in the :animated selector delete tick.elem; } ), tick = function() { if ( stopped ) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), // Support: Android 2.3 only // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( percent ); } deferred.notifyWith( elem, [ animation, percent, remaining ] ); if ( percent < 1 && length ) { return remaining; } else { deferred.resolveWith( elem, [ animation ] ); return false; } }, animation = deferred.promise( { elem: elem, props: jQuery.extend( {}, properties ), opts: jQuery.extend( true, { specialEasing: {}, easing: jQuery.easing._default }, options ), originalProperties: properties, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function( prop, end ) { var tween = jQuery.Tween( elem, animation.opts, prop, end, animation.opts.specialEasing[ prop ] || animation.opts.easing ); animation.tweens.push( tween ); return tween; }, stop: function( gotoEnd ) { var index = 0, // If we are going to the end, we want to run all the tweens // otherwise we skip this part length = gotoEnd ? animation.tweens.length : 0; if ( stopped ) { return this; } stopped = true; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( 1 ); } // Resolve when we played the last frame; otherwise, reject if ( gotoEnd ) { deferred.notifyWith( elem, [ animation, 1, 0 ] ); deferred.resolveWith( elem, [ animation, gotoEnd ] ); } else { deferred.rejectWith( elem, [ animation, gotoEnd ] ); } return this; } } ), props = animation.props; propFilter( props, animation.opts.specialEasing ); for ( ; index < length ; index++ ) { result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); if ( result ) { if ( jQuery.isFunction( result.stop ) ) { jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = jQuery.proxy( result.stop, result ); } return result; } } jQuery.map( props, createTween, animation ); if ( jQuery.isFunction( animation.opts.start ) ) { animation.opts.start.call( elem, animation ); } jQuery.fx.timer( jQuery.extend( tick, { elem: elem, anim: animation, queue: animation.opts.queue } ) ); // attach callbacks from options return animation.progress( animation.opts.progress ) .done( animation.opts.done, animation.opts.complete ) .fail( animation.opts.fail ) .always( animation.opts.always ); } jQuery.Animation = jQuery.extend( Animation, { tweeners: { "*": [ function( prop, value ) { var tween = this.createTween( prop, value ); adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); return tween; } ] }, tweener: function( props, callback ) { if ( jQuery.isFunction( props ) ) { callback = props; props = [ "*" ]; } else { props = props.match( rnotwhite ); } var prop, index = 0, length = props.length; for ( ; index < length ; index++ ) { prop = props[ index ]; Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; Animation.tweeners[ prop ].unshift( callback ); } }, prefilters: [ defaultPrefilter ], prefilter: function( callback, prepend ) { if ( prepend ) { Animation.prefilters.unshift( callback ); } else { Animation.prefilters.push( callback ); } } } ); jQuery.speed = function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing }; // Go to the end state if fx are off or if document is hidden if ( jQuery.fx.off || document.hidden ) { opt.duration = 0; } else { opt.duration = typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; } // Normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function() { if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } }; return opt; }; jQuery.fn.extend( { fadeTo: function( speed, to, easing, callback ) { // Show any hidden elements after setting opacity to 0 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() // Animate to the value specified .end().animate( { opacity: to }, speed, easing, callback ); }, animate: function( prop, speed, easing, callback ) { var empty = jQuery.isEmptyObject( prop ), optall = jQuery.speed( speed, easing, callback ), doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation( this, jQuery.extend( {}, prop ), optall ); // Empty animations, or finishing resolves immediately if ( empty || dataPriv.get( this, "finish" ) ) { anim.stop( true ); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { var stopQueue = function( hooks ) { var stop = hooks.stop; delete hooks.stop; stop( gotoEnd ); }; if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue && type !== false ) { this.queue( type || "fx", [] ); } return this.each( function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = dataPriv.get( this ); if ( index ) { if ( data[ index ] && data[ index ].stop ) { stopQueue( data[ index ] ); } } else { for ( index in data ) { if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { stopQueue( data[ index ] ); } } } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && ( type == null || timers[ index ].queue === type ) ) { timers[ index ].anim.stop( gotoEnd ); dequeue = false; timers.splice( index, 1 ); } } // Start the next in the queue if the last step wasn't forced. // Timers currently will call their complete callbacks, which // will dequeue but only if they were gotoEnd. if ( dequeue || !gotoEnd ) { jQuery.dequeue( this, type ); } } ); }, finish: function( type ) { if ( type !== false ) { type = type || "fx"; } return this.each( function() { var index, data = dataPriv.get( this ), queue = data[ type + "queue" ], hooks = data[ type + "queueHooks" ], timers = jQuery.timers, length = queue ? queue.length : 0; // Enable finishing flag on private data data.finish = true; // Empty the queue first jQuery.queue( this, type, [] ); if ( hooks && hooks.stop ) { hooks.stop.call( this, true ); } // Look for any active animations, and finish them for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && timers[ index ].queue === type ) { timers[ index ].anim.stop( true ); timers.splice( index, 1 ); } } // Look for any animations in the old queue and finish them for ( index = 0; index < length; index++ ) { if ( queue[ index ] && queue[ index ].finish ) { queue[ index ].finish.call( this ); } } // Turn off finishing flag delete data.finish; } ); } } ); jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { return speed == null || typeof speed === "boolean" ? cssFn.apply( this, arguments ) : this.animate( genFx( name, true ), speed, easing, callback ); }; } ); // Generate shortcuts for custom animations jQuery.each( { slideDown: genFx( "show" ), slideUp: genFx( "hide" ), slideToggle: genFx( "toggle" ), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; } ); jQuery.timers = []; jQuery.fx.tick = function() { var timer, i = 0, timers = jQuery.timers; fxNow = jQuery.now(); for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Checks the timer has not already been removed if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } fxNow = undefined; }; jQuery.fx.timer = function( timer ) { jQuery.timers.push( timer ); if ( timer() ) { jQuery.fx.start(); } else { jQuery.timers.pop(); } }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( !timerId ) { timerId = window.requestAnimationFrame ? window.requestAnimationFrame( raf ) : window.setInterval( jQuery.fx.tick, jQuery.fx.interval ); } }; jQuery.fx.stop = function() { if ( window.cancelAnimationFrame ) { window.cancelAnimationFrame( timerId ); } else { window.clearInterval( timerId ); } timerId = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; // Based off of the plugin by Clint Helfers, with permission. // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ jQuery.fn.delay = function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = window.setTimeout( next, time ); hooks.stop = function() { window.clearTimeout( timeout ); }; } ); }; ( function() { var input = document.createElement( "input" ), select = document.createElement( "select" ), opt = select.appendChild( document.createElement( "option" ) ); input.type = "checkbox"; // Support: Android <=4.3 only // Default value for a checkbox should be "on" support.checkOn = input.value !== ""; // Support: IE <=11 only // Must access selectedIndex to make default options select support.optSelected = opt.selected; // Support: IE <=11 only // An input loses its value after becoming a radio input = document.createElement( "input" ); input.value = "t"; input.type = "radio"; support.radioValue = input.value === "t"; } )(); var boolHook, attrHandle = jQuery.expr.attrHandle; jQuery.fn.extend( { attr: function( name, value ) { return access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each( function() { jQuery.removeAttr( this, name ); } ); } } ); jQuery.extend( { attr: function( elem, name, value ) { var ret, hooks, nType = elem.nodeType; // Don't get/set attributes on text, comment and attribute nodes if ( nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === "undefined" ) { return jQuery.prop( elem, name, value ); } // Attribute hooks are determined by the lowercase version // Grab necessary hook if one is defined if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { hooks = jQuery.attrHooks[ name.toLowerCase() ] || ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); return; } if ( hooks && "set" in hooks && ( ret = hooks.set( elem, value, name ) ) !== undefined ) { return ret; } elem.setAttribute( name, value + "" ); return value; } if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { return ret; } ret = jQuery.find.attr( elem, name ); // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; }, attrHooks: { type: { set: function( elem, value ) { if ( !support.radioValue && value === "radio" && jQuery.nodeName( elem, "input" ) ) { var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } }, removeAttr: function( elem, value ) { var name, i = 0, attrNames = value && value.match( rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( ( name = attrNames[ i++ ] ) ) { elem.removeAttribute( name ); } } } } ); // Hooks for boolean attributes boolHook = { set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else { elem.setAttribute( name, name ); } return name; } }; jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { var getter = attrHandle[ name ] || jQuery.find.attr; attrHandle[ name ] = function( elem, name, isXML ) { var ret, handle, lowercaseName = name.toLowerCase(); if ( !isXML ) { // Avoid an infinite loop by temporarily removing this function from the getter handle = attrHandle[ lowercaseName ]; attrHandle[ lowercaseName ] = ret; ret = getter( elem, name, isXML ) != null ? lowercaseName : null; attrHandle[ lowercaseName ] = handle; } return ret; }; } ); var rfocusable = /^(?:input|select|textarea|button)$/i, rclickable = /^(?:a|area)$/i; jQuery.fn.extend( { prop: function( name, value ) { return access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { return this.each( function() { delete this[ jQuery.propFix[ name ] || name ]; } ); } } ); jQuery.extend( { prop: function( elem, name, value ) { var ret, hooks, nType = elem.nodeType; // Don't get/set properties on text, comment and attribute nodes if ( nType === 3 || nType === 8 || nType === 2 ) { return; } if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { if ( hooks && "set" in hooks && ( ret = hooks.set( elem, value, name ) ) !== undefined ) { return ret; } return ( elem[ name ] = value ); } if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { return ret; } return elem[ name ]; }, propHooks: { tabIndex: { get: function( elem ) { // Support: IE <=9 - 11 only // elem.tabIndex doesn't always return the // correct value when it hasn't been explicitly set // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr( elem, "tabindex" ); return tabindex ? parseInt( tabindex, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : -1; } } }, propFix: { "for": "htmlFor", "class": "className" } } ); // Support: IE <=11 only // Accessing the selectedIndex property // forces the browser to respect setting selected // on the option // The getter ensures a default option is selected // when in an optgroup if ( !support.optSelected ) { jQuery.propHooks.selected = { get: function( elem ) { var parent = elem.parentNode; if ( parent && parent.parentNode ) { parent.parentNode.selectedIndex; } return null; }, set: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } } }; } jQuery.each( [ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { jQuery.propFix[ this.toLowerCase() ] = this; } ); var rclass = /[\t\r\n\f]/g; function getClass( elem ) { return elem.getAttribute && elem.getAttribute( "class" ) || ""; } jQuery.fn.extend( { addClass: function( value ) { var classes, elem, cur, curValue, clazz, j, finalValue, i = 0; if ( jQuery.isFunction( value ) ) { return this.each( function( j ) { jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); } ); } if ( typeof value === "string" && value ) { classes = value.match( rnotwhite ) || []; while ( ( elem = this[ i++ ] ) ) { curValue = getClass( elem ); cur = elem.nodeType === 1 && ( " " + curValue + " " ).replace( rclass, " " ); if ( cur ) { j = 0; while ( ( clazz = classes[ j++ ] ) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } // Only assign if different to avoid unneeded rendering. finalValue = jQuery.trim( cur ); if ( curValue !== finalValue ) { elem.setAttribute( "class", finalValue ); } } } } return this; }, removeClass: function( value ) { var classes, elem, cur, curValue, clazz, j, finalValue, i = 0; if ( jQuery.isFunction( value ) ) { return this.each( function( j ) { jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); } ); } if ( !arguments.length ) { return this.attr( "class", "" ); } if ( typeof value === "string" && value ) { classes = value.match( rnotwhite ) || []; while ( ( elem = this[ i++ ] ) ) { curValue = getClass( elem ); // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( " " + curValue + " " ).replace( rclass, " " ); if ( cur ) { j = 0; while ( ( clazz = classes[ j++ ] ) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) > -1 ) { cur = cur.replace( " " + clazz + " ", " " ); } } // Only assign if different to avoid unneeded rendering. finalValue = jQuery.trim( cur ); if ( curValue !== finalValue ) { elem.setAttribute( "class", finalValue ); } } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value; if ( typeof stateVal === "boolean" && type === "string" ) { return stateVal ? this.addClass( value ) : this.removeClass( value ); } if ( jQuery.isFunction( value ) ) { return this.each( function( i ) { jQuery( this ).toggleClass( value.call( this, i, getClass( this ), stateVal ), stateVal ); } ); } return this.each( function() { var className, i, self, classNames; if ( type === "string" ) { // Toggle individual class names i = 0; self = jQuery( this ); classNames = value.match( rnotwhite ) || []; while ( ( className = classNames[ i++ ] ) ) { // Check each className given, space separated list if ( self.hasClass( className ) ) { self.removeClass( className ); } else { self.addClass( className ); } } // Toggle whole class name } else if ( value === undefined || type === "boolean" ) { className = getClass( this ); if ( className ) { // Store className if set dataPriv.set( this, "__className__", className ); } // If the element has a class name or if we're passed `false`, // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. if ( this.setAttribute ) { this.setAttribute( "class", className || value === false ? "" : dataPriv.get( this, "__className__" ) || "" ); } } } ); }, hasClass: function( selector ) { var className, elem, i = 0; className = " " + selector + " "; while ( ( elem = this[ i++ ] ) ) { if ( elem.nodeType === 1 && ( " " + getClass( elem ) + " " ).replace( rclass, " " ) .indexOf( className ) > -1 ) { return true; } } return false; } } ); var rreturn = /\r/g, rspaces = /[\x20\t\r\n\f]+/g; jQuery.fn.extend( { val: function( value ) { var hooks, ret, isFunction, elem = this[ 0 ]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && ( ret = hooks.get( elem, "value" ) ) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // Handle most common string cases ret.replace( rreturn, "" ) : // Handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each( function( i ) { var val; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, jQuery( this ).val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map( val, function( value ) { return value == null ? "" : value + ""; } ); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } } ); } } ); jQuery.extend( { valHooks: { option: { get: function( elem ) { var val = jQuery.find.attr( elem, "value" ); return val != null ? val : // Support: IE <=10 - 11 only // option.text throws exceptions (#14686, #14858) // Strip and collapse whitespace // https://html.spec.whatwg.org/#strip-and-collapse-whitespace jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " ); } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one", values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // Support: IE <=9 only // IE8-9 doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup !option.disabled && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var optionSet, option, options = elem.options, values = jQuery.makeArray( value ), i = options.length; while ( i-- ) { option = options[ i ]; if ( option.selected = jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 ) { optionSet = true; } } // Force browsers to behave consistently when non-matching value is set if ( !optionSet ) { elem.selectedIndex = -1; } return values; } } } } ); // Radios and checkboxes getter/setter jQuery.each( [ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); } } }; if ( !support.checkOn ) { jQuery.valHooks[ this ].get = function( elem ) { return elem.getAttribute( "value" ) === null ? "on" : elem.value; }; } } ); // Return jQuery for attributes-only inclusion var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/; jQuery.extend( jQuery.event, { trigger: function( event, data, elem, onlyHandlers ) { var i, cur, tmp, bubbleType, ontype, handle, special, eventPath = [ elem || document ], type = hasOwn.call( event, "type" ) ? event.type : event, namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf( "." ) > -1 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split( "." ); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf( ":" ) < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join( "." ); event.rnamespace = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === ( elem.ownerDocument || document ) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && dataPriv.get( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && handle.apply && acceptData( cur ) ) { event.result = handle.apply( cur, data ); if ( event.result === false ) { event.preventDefault(); } } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( ( !special._default || special._default.apply( eventPath.pop(), data ) === false ) && acceptData( elem ) ) { // Call a native DOM method on the target with the same name as the event. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; elem[ type ](); jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, // Piggyback on a donor event to simulate a different one // Used only for `focus(in | out)` events simulate: function( type, elem, event ) { var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true } ); jQuery.event.trigger( e, null, elem ); } } ); jQuery.fn.extend( { trigger: function( type, data ) { return this.each( function() { jQuery.event.trigger( type, data, this ); } ); }, triggerHandler: function( type, data ) { var elem = this[ 0 ]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } } ); jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup contextmenu" ).split( " " ), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; } ); jQuery.fn.extend( { hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); } } ); support.focusin = "onfocusin" in window; // Support: Firefox <=44 // Firefox doesn't have focus(in | out) events // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 // // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 // focus(in | out) events fire after focus & blur events, // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 if ( !support.focusin ) { jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler on the document while someone wants focusin/focusout var handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); }; jQuery.event.special[ fix ] = { setup: function() { var doc = this.ownerDocument || this, attaches = dataPriv.access( doc, fix ); if ( !attaches ) { doc.addEventListener( orig, handler, true ); } dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); }, teardown: function() { var doc = this.ownerDocument || this, attaches = dataPriv.access( doc, fix ) - 1; if ( !attaches ) { doc.removeEventListener( orig, handler, true ); dataPriv.remove( doc, fix ); } else { dataPriv.access( doc, fix, attaches ); } } }; } ); } var location = window.location; var nonce = jQuery.now(); var rquery = ( /\?/ ); // Cross-browser xml parsing jQuery.parseXML = function( data ) { var xml; if ( !data || typeof data !== "string" ) { return null; } // Support: IE 9 - 11 only // IE throws on parseFromString with invalid input. try { xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); } catch ( e ) { xml = undefined; } if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }; var rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; function buildParams( prefix, obj, traditional, add ) { var name; if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", v, traditional, add ); } } ); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } // Serialize an array of form elements or a set of // key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, valueOrFunction ) { // If value is a function, invoke it and use its return value var value = jQuery.isFunction( valueOrFunction ) ? valueOrFunction() : valueOrFunction; s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value == null ? "" : value ); }; // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); } ); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ); }; jQuery.fn.extend( { serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map( function() { // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; } ) .filter( function() { var type = this.type; // Use .is( ":disabled" ) so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !rcheckableType.test( type ) ); } ) .map( function( i, elem ) { var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val ) { return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; } ) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; } ).get(); } } ); var r20 = /%20/g, rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat( "*" ), // Anchor tag for parsing the document origin originAnchor = document.createElement( "a" ); originAnchor.href = location.href; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || []; if ( jQuery.isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( ( dataType = dataTypes[ i++ ] ) ) { // Prepend if requested if ( dataType[ 0 ] === "+" ) { dataType = dataType.slice( 1 ) || "*"; ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); // Otherwise append } else { ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } } ); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; } /* Handles responses to an ajax request: * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var ct, type, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process while ( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } /* Chain conversions given the request and the original response * Also sets the responseXXX fields on the jqXHR instance */ function ajaxConvert( s, response, jqXHR, isSuccess ) { var conv2, current, conv, tmp, prev, converters = {}, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } current = dataTypes.shift(); // Convert to each sequential dataType while ( current ) { if ( s.responseFields[ current ] ) { jqXHR[ s.responseFields[ current ] ] = response; } // Apply the dataFilter if provided if ( !prev && isSuccess && s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } prev = current; current = dataTypes.shift(); if ( current ) { // There's only work to do if current dataType is non-auto if ( current === "*" ) { current = prev; // Convert response if prev dataType is non-auto and differs from current } else if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split( " " ); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.unshift( tmp[ 1 ] ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s.throws ) { response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } } } return { state: "success", data: response }; } jQuery.extend( { // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: location.href, type: "GET", isLocal: rlocalProtocol.test( location.protocol ), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /\bxml\b/, html: /\bhtml/, json: /\bjson\b/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": JSON.parse, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { return settings ? // Building a settings object ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : // Extending ajaxSettings ajaxExtend( jQuery.ajaxSettings, target ); }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var transport, // URL without anti-cache param cacheURL, // Response headers responseHeadersString, responseHeaders, // timeout handle timeoutTimer, // Url cleanup var urlAnchor, // Request state (becomes false upon send and true upon completion) completed, // To know if global events are to be dispatched fireGlobals, // Loop variable i, // uncached part of the url uncached, // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks( "once memory" ), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( completed ) { if ( !responseHeaders ) { responseHeaders = {}; while ( ( match = rheaders.exec( responseHeadersString ) ) ) { responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match == null ? null : match; }, // Raw string getAllResponseHeaders: function() { return completed ? responseHeadersString : null; }, // Caches the header setRequestHeader: function( name, value ) { if ( completed == null ) { name = requestHeadersNames[ name.toLowerCase() ] = requestHeadersNames[ name.toLowerCase() ] || name; requestHeaders[ name ] = value; } return this; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( completed == null ) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function( map ) { var code; if ( map ) { if ( completed ) { // Execute the appropriate callbacks jqXHR.always( map[ jqXHR.status ] ); } else { // Lazy-add the new callbacks in a way that preserves old ones for ( code in map ) { statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; } } } return this; }, // Cancel the request abort: function( statusText ) { var finalText = statusText || strAbort; if ( transport ) { transport.abort( finalText ); } done( 0, finalText ); return this; } }; // Attach deferreds deferred.promise( jqXHR ); // Add protocol if not provided (prefilters might expect it) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ( ( url || s.url || location.href ) + "" ) .replace( rprotocol, location.protocol + "//" ); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ]; // A cross-domain request is in order when the origin doesn't match the current origin. if ( s.crossDomain == null ) { urlAnchor = document.createElement( "a" ); // Support: IE <=8 - 11, Edge 12 - 13 // IE throws exception on accessing the href property if url is malformed, // e.g. http://example.com:80x/ try { urlAnchor.href = s.url; // Support: IE <=8 - 11 only // Anchor's host property isn't correctly set when s.url is relative urlAnchor.href = urlAnchor.href; s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host; } catch ( e ) { // If there is an error parsing the URL, assume it is crossDomain, // it can be rejected by the transport if it is invalid s.crossDomain = true; } } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( completed ) { return jqXHR; } // We can fire global events as of now if asked to // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) fireGlobals = jQuery.event && s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger( "ajaxStart" ); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on // Remove hash to simplify url manipulation cacheURL = s.url.replace( rhash, "" ); // More options handling for requests with no content if ( !s.hasContent ) { // Remember the hash so we can put it back uncached = s.url.slice( cacheURL.length ); // If data is available, append data to url if ( s.data ) { cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add anti-cache in uncached url if needed if ( s.cache === false ) { cacheURL = cacheURL.replace( rts, "" ); uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; } // Put hash and anti-cache on the URL that will be requested (gh-1732) s.url = cacheURL + uncached; // Change '%20' to '+' if this is encoded form body content (gh-2658) } else if ( s.data && s.processData && ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { s.data = s.data.replace( r20, "+" ); } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[ cacheURL ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); } if ( jQuery.etag[ cacheURL ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? s.accepts[ s.dataTypes[ 0 ] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { // Abort if not done already and return return jqXHR.abort(); } // Aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds completeDeferred.add( s.complete ); jqXHR.done( s.success ); jqXHR.fail( s.error ); // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // If request was aborted inside ajaxSend, stop there if ( completed ) { return jqXHR; } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = window.setTimeout( function() { jqXHR.abort( "timeout" ); }, s.timeout ); } try { completed = false; transport.send( requestHeaders, done ); } catch ( e ) { // Rethrow post-completion exceptions if ( completed ) { throw e; } // Propagate others as results done( -1, e ); } } // Callback for when everything is done function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Ignore repeat invocations if ( completed ) { return; } completed = true; // Clear timeout if it exists if ( timeoutTimer ) { window.clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Determine if successful isSuccess = status >= 200 && status < 300 || status === 304; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // Convert no matter what (that way responseXXX fields are always set) response = ajaxConvert( s, response, jqXHR, isSuccess ); // If successful, handle type chaining if ( isSuccess ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader( "Last-Modified" ); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader( "etag" ); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 || s.type === "HEAD" ) { statusText = "nocontent"; // if not modified } else if ( status === 304 ) { statusText = "notmodified"; // If we have data, let's convert it } else { statusText = response.state; success = response.data; error = response.error; isSuccess = !error; } } else { // Extract error from statusText and normalize for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger( "ajaxStop" ); } } } return jqXHR; }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); }, getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); } } ); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // Shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } // The url can be an options object (which then must have .url) return jQuery.ajax( jQuery.extend( { url: url, type: method, dataType: type, data: data, success: callback }, jQuery.isPlainObject( url ) && url ) ); }; } ); jQuery._evalUrl = function( url ) { return jQuery.ajax( { url: url, // Make this explicit, since user can override this through ajaxSetup (#11264) type: "GET", dataType: "script", cache: true, async: false, global: false, "throws": true } ); }; jQuery.fn.extend( { wrapAll: function( html ) { var wrap; if ( this[ 0 ] ) { if ( jQuery.isFunction( html ) ) { html = html.call( this[ 0 ] ); } // The elements to wrap the target around wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); if ( this[ 0 ].parentNode ) { wrap.insertBefore( this[ 0 ] ); } wrap.map( function() { var elem = this; while ( elem.firstElementChild ) { elem = elem.firstElementChild; } return elem; } ).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each( function( i ) { jQuery( this ).wrapInner( html.call( this, i ) ); } ); } return this.each( function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } } ); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each( function( i ) { jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html ); } ); }, unwrap: function( selector ) { this.parent( selector ).not( "body" ).each( function() { jQuery( this ).replaceWith( this.childNodes ); } ); return this; } } ); jQuery.expr.pseudos.hidden = function( elem ) { return !jQuery.expr.pseudos.visible( elem ); }; jQuery.expr.pseudos.visible = function( elem ) { return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); }; jQuery.ajaxSettings.xhr = function() { try { return new window.XMLHttpRequest(); } catch ( e ) {} }; var xhrSuccessStatus = { // File protocol always yields status code 0, assume 200 0: 200, // Support: IE <=9 only // #1450: sometimes IE returns 1223 when it should be 204 1223: 204 }, xhrSupported = jQuery.ajaxSettings.xhr(); support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); support.ajax = xhrSupported = !!xhrSupported; jQuery.ajaxTransport( function( options ) { var callback, errorCallback; // Cross domain only allowed if supported through XMLHttpRequest if ( support.cors || xhrSupported && !options.crossDomain ) { return { send: function( headers, complete ) { var i, xhr = options.xhr(); xhr.open( options.type, options.url, options.async, options.username, options.password ); // Apply custom fields if provided if ( options.xhrFields ) { for ( i in options.xhrFields ) { xhr[ i ] = options.xhrFields[ i ]; } } // Override mime type if needed if ( options.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( options.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { headers[ "X-Requested-With" ] = "XMLHttpRequest"; } // Set headers for ( i in headers ) { xhr.setRequestHeader( i, headers[ i ] ); } // Callback callback = function( type ) { return function() { if ( callback ) { callback = errorCallback = xhr.onload = xhr.onerror = xhr.onabort = xhr.onreadystatechange = null; if ( type === "abort" ) { xhr.abort(); } else if ( type === "error" ) { // Support: IE <=9 only // On a manual native abort, IE9 throws // errors on any property access that is not readyState if ( typeof xhr.status !== "number" ) { complete( 0, "error" ); } else { complete( // File: protocol always yields status 0; see #8605, #14207 xhr.status, xhr.statusText ); } } else { complete( xhrSuccessStatus[ xhr.status ] || xhr.status, xhr.statusText, // Support: IE <=9 only // IE9 has no XHR2 but throws on binary (trac-11426) // For XHR2 non-text, let the caller handle it (gh-2498) ( xhr.responseType || "text" ) !== "text" || typeof xhr.responseText !== "string" ? { binary: xhr.response } : { text: xhr.responseText }, xhr.getAllResponseHeaders() ); } } }; }; // Listen to events xhr.onload = callback(); errorCallback = xhr.onerror = callback( "error" ); // Support: IE 9 only // Use onreadystatechange to replace onabort // to handle uncaught aborts if ( xhr.onabort !== undefined ) { xhr.onabort = errorCallback; } else { xhr.onreadystatechange = function() { // Check readyState before timeout as it changes if ( xhr.readyState === 4 ) { // Allow onerror to be called first, // but that will not handle a native abort // Also, save errorCallback to a variable // as xhr.onerror cannot be accessed window.setTimeout( function() { if ( callback ) { errorCallback(); } } ); } }; } // Create the abort callback callback = callback( "abort" ); try { // Do send the request (this may raise an exception) xhr.send( options.hasContent && options.data || null ); } catch ( e ) { // #14683: Only rethrow if this hasn't been notified as an error yet if ( callback ) { throw e; } } }, abort: function() { if ( callback ) { callback(); } } }; } } ); // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) jQuery.ajaxPrefilter( function( s ) { if ( s.crossDomain ) { s.contents.script = false; } } ); // Install script dataType jQuery.ajaxSetup( { accepts: { script: "text/javascript, application/javascript, " + "application/ecmascript, application/x-ecmascript" }, contents: { script: /\b(?:java|ecma)script\b/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } } ); // Handle cache's special case and crossDomain jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; } } ); // Bind script tag hack transport jQuery.ajaxTransport( "script", function( s ) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, callback; return { send: function( _, complete ) { script = jQuery( "<script>" ).prop( { charset: s.scriptCharset, src: s.url } ).on( "load error", callback = function( evt ) { script.remove(); callback = null; if ( evt ) { complete( evt.type === "error" ? 404 : 200, evt.type ); } } ); // Use native DOM manipulation to avoid our domManip AJAX trickery document.head.appendChild( script[ 0 ] ); }, abort: function() { if ( callback ) { callback(); } } }; } } ); var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; // Default jsonp settings jQuery.ajaxSetup( { jsonp: "callback", jsonpCallback: function() { var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); this[ callback ] = true; return callback; } } ); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? "url" : typeof s.data === "string" && ( s.contentType || "" ) .indexOf( "application/x-www-form-urlencoded" ) === 0 && rjsonp.test( s.data ) && "data" ); // Handle iff the expected data type is "jsonp" or we have a parameter to set if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { // Get callback name, remembering preexisting value associated with it callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback; // Insert callback into url or form data if ( jsonProp ) { s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); } else if ( s.jsonp !== false ) { s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; } // Use data converter to retrieve json after script execution s.converters[ "script json" ] = function() { if ( !responseContainer ) { jQuery.error( callbackName + " was not called" ); } return responseContainer[ 0 ]; }; // Force json dataType s.dataTypes[ 0 ] = "json"; // Install callback overwritten = window[ callbackName ]; window[ callbackName ] = function() { responseContainer = arguments; }; // Clean-up function (fires after converters) jqXHR.always( function() { // If previous value didn't exist - remove it if ( overwritten === undefined ) { jQuery( window ).removeProp( callbackName ); // Otherwise restore preexisting value } else { window[ callbackName ] = overwritten; } // Save back as free if ( s[ callbackName ] ) { // Make sure that re-using the options doesn't screw things around s.jsonpCallback = originalSettings.jsonpCallback; // Save the callback name for future use oldCallbacks.push( callbackName ); } // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( overwritten ) ) { overwritten( responseContainer[ 0 ] ); } responseContainer = overwritten = undefined; } ); // Delegate to script return "script"; } } ); // Support: Safari 8 only // In Safari 8 documents created via document.implementation.createHTMLDocument // collapse sibling forms: the second one becomes a child of the first one. // Because of that, this security measure has to be disabled in Safari 8. // https://bugs.webkit.org/show_bug.cgi?id=137337 support.createHTMLDocument = ( function() { var body = document.implementation.createHTMLDocument( "" ).body; body.innerHTML = "<form></form><form></form>"; return body.childNodes.length === 2; } )(); // Argument "data" should be string of html // context (optional): If specified, the fragment will be created in this context, // defaults to document // keepScripts (optional): If true, will include scripts passed in the html string jQuery.parseHTML = function( data, context, keepScripts ) { if ( typeof data !== "string" ) { return []; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } var base, parsed, scripts; if ( !context ) { // Stop scripts or inline event handlers from being executed immediately // by using document.implementation if ( support.createHTMLDocument ) { context = document.implementation.createHTMLDocument( "" ); // Set the base href for the created document // so any parsed elements with URLs // are based on the document's URL (gh-2965) base = context.createElement( "base" ); base.href = document.location.href; context.head.appendChild( base ); } else { context = document; } } parsed = rsingleTag.exec( data ); scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[ 1 ] ) ]; } parsed = buildFragment( [ data ], context, scripts ); if ( scripts && scripts.length ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }; /** * Load a url into a page */ jQuery.fn.load = function( url, params, callback ) { var selector, type, response, self = this, off = url.indexOf( " " ); if ( off > -1 ) { selector = jQuery.trim( url.slice( off ) ); url = url.slice( 0, off ); } // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( params && typeof params === "object" ) { type = "POST"; } // If we have elements to modify, make the request if ( self.length > 0 ) { jQuery.ajax( { url: url, // If "type" variable is undefined, then "GET" method will be used. // Make value of this field explicit since // user can override it through ajaxSetup method type: type || "GET", dataType: "html", data: params } ).done( function( responseText ) { // Save response for use in complete callback response = arguments; self.html( selector ? // If a selector was specified, locate the right elements in a dummy div // Exclude scripts to avoid IE 'Permission Denied' errors jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : // Otherwise use the full result responseText ); // If the request succeeds, this function gets "data", "status", "jqXHR" // but they are ignored because response was set above. // If it fails, this function gets "jqXHR", "status", "error" } ).always( callback && function( jqXHR, status ) { self.each( function() { callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); } ); } ); } return this; }; // Attach a bunch of functions for handling common AJAX events jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) { jQuery.fn[ type ] = function( fn ) { return this.on( type, fn ); }; } ); jQuery.expr.pseudos.animated = function( elem ) { return jQuery.grep( jQuery.timers, function( fn ) { return elem === fn.elem; } ).length; }; /** * Gets a window from an element */ function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView; } jQuery.offset = { setOffset: function( elem, options, i ) { var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, position = jQuery.css( elem, "position" ), curElem = jQuery( elem ), props = {}; // Set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } curOffset = curElem.offset(); curCSSTop = jQuery.css( elem, "top" ); curCSSLeft = jQuery.css( elem, "left" ); calculatePosition = ( position === "absolute" || position === "fixed" ) && ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; // Need to be able to calculate position if either // top or left is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( jQuery.isFunction( options ) ) { // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend( { offset: function( options ) { // Preserve chaining for setter if ( arguments.length ) { return options === undefined ? this : this.each( function( i ) { jQuery.offset.setOffset( this, options, i ); } ); } var docElem, win, rect, doc, elem = this[ 0 ]; if ( !elem ) { return; } // Support: IE <=11 only // Running getBoundingClientRect on a // disconnected node in IE throws an error if ( !elem.getClientRects().length ) { return { top: 0, left: 0 }; } rect = elem.getBoundingClientRect(); // Make sure element is not hidden (display: none) if ( rect.width || rect.height ) { doc = elem.ownerDocument; win = getWindow( doc ); docElem = doc.documentElement; return { top: rect.top + win.pageYOffset - docElem.clientTop, left: rect.left + win.pageXOffset - docElem.clientLeft }; } // Return zeros for disconnected and hidden elements (gh-2310) return rect; }, position: function() { if ( !this[ 0 ] ) { return; } var offsetParent, offset, elem = this[ 0 ], parentOffset = { top: 0, left: 0 }; // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, // because it is its only offset parent if ( jQuery.css( elem, "position" ) === "fixed" ) { // Assume getBoundingClientRect is there when computed position is fixed offset = elem.getBoundingClientRect(); } else { // Get *real* offsetParent offsetParent = this.offsetParent(); // Get correct offsets offset = this.offset(); if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { parentOffset = offsetParent.offset(); } // Add offsetParent borders parentOffset = { top: parentOffset.top + jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ), left: parentOffset.left + jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ) }; } // Subtract parent offsets and element margins return { top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) }; }, // This method will return documentElement in the following cases: // 1) For the element inside the iframe without offsetParent, this method will return // documentElement of the parent window // 2) For the hidden or detached element // 3) For body or html element, i.e. in case of the html node - it will return itself // // but those exceptions were never presented as a real life use-cases // and might be considered as more preferable results. // // This logic, however, is not guaranteed and can change at any point in the future offsetParent: function() { return this.map( function() { var offsetParent = this.offsetParent; while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { offsetParent = offsetParent.offsetParent; } return offsetParent || documentElement; } ); } } ); // Create scrollLeft and scrollTop methods jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { var top = "pageYOffset" === prop; jQuery.fn[ method ] = function( val ) { return access( this, function( elem, method, val ) { var win = getWindow( elem ); if ( val === undefined ) { return win ? win[ prop ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : win.pageXOffset, top ? val : win.pageYOffset ); } else { elem[ method ] = val; } }, method, val, arguments.length ); }; } ); // Support: Safari <=7 - 9.1, Chrome <=37 - 49 // Add the top/left cssHooks using jQuery.fn.position // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 // getComputedStyle returns percent when specified for top/left/bottom/right; // rather than make the css module depend on the offset module, just check for it here jQuery.each( [ "top", "left" ], function( i, prop ) { jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, function( elem, computed ) { if ( computed ) { computed = curCSS( elem, prop ); // If curCSS returns percentage, fallback to offset return rnumnonpx.test( computed ) ? jQuery( elem ).position()[ prop ] + "px" : computed; } } ); } ); // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { // Margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); return access( this, function( elem, type, value ) { var doc; if ( jQuery.isWindow( elem ) ) { // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) return funcName.indexOf( "outer" ) === 0 ? elem[ "inner" + name ] : elem.document.documentElement[ "client" + name ]; } // Get document width or height if ( elem.nodeType === 9 ) { doc = elem.documentElement; // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], // whichever is greatest return Math.max( elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ], doc[ "client" + name ] ); } return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : // Set width or height on the element jQuery.style( elem, type, value, extra ); }, type, chainable ? margin : undefined, chainable ); }; } ); } ); jQuery.fn.extend( { bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); } } ); jQuery.parseJSON = JSON.parse; // Register as a named AMD module, since jQuery can be concatenated with other // files that may use define, but not via a proper concatenation script that // understands anonymous AMD modules. A named AMD is safest and most robust // way to register. Lowercase jquery is used because AMD module names are // derived from file names, and jQuery is normally delivered in a lowercase // file name. Do this after creating the global so that if an AMD module wants // to call noConflict to hide this version of jQuery, it will work. // Note that for maximum portability, libraries that are not jQuery should // declare themselves as anonymous modules, and avoid setting a global if an // AMD loader is present. jQuery is a special case. For more information, see // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon if ( true ) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { return jQuery; }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } var // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$; jQuery.noConflict = function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }; // Expose jQuery and $ identifiers, even in AMD // (#7102#comment:10, https://github.com/jquery/jquery/pull/557) // and CommonJS for browser emulators (#13566) if ( !noGlobal ) { window.jQuery = window.$ = jQuery; } return jQuery; } ) ); /***/ }, /* 2 */ /***/ function(module, exports) { module.exports = React; /***/ }, /* 3 */ /***/ function(module, exports) { module.exports = ReactDOM; /***/ }, /* 4 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var React = __webpack_require__(2); var HelloComponent = (function (_super) { __extends(HelloComponent, _super); function HelloComponent() { _super.apply(this, arguments); } HelloComponent.prototype.render = function () { return React.createElement("div", {className: this.props.class}, this.props.framework); }; return HelloComponent; }(React.Component)); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = HelloComponent; /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var React = __webpack_require__(2); var LabelTextbox = (function (_super) { __extends(LabelTextbox, _super); function LabelTextbox() { _super.apply(this, arguments); } LabelTextbox.prototype.update = function (event) { var model = this.props.model; var box = this.refs["box"]; model.UserId = box.value; this.setState({ value: event.target.value }); }; LabelTextbox.prototype.render = function () { var _this = this; var classes = 'lb-txt ' + this.props.class; var model = this.props.model; return React.createElement("div", {className: classes}, React.createElement("div", {className: "label"}, this.props.label), React.createElement("div", {className: "txt-container"}, React.createElement("input", {ref: "box", className: "txt", type: this.props.type, onChange: function (e) { return _this.update(e); }, value: model.UserId}))); }; return LabelTextbox; }(React.Component)); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = LabelTextbox; /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { "use strict"; 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 validation_1 = __webpack_require__(7); var validation_2 = __webpack_require__(7); var validation_3 = __webpack_require__(7); var WebUser = (function () { function WebUser(userId, pwd) { this.UserId = userId; this.Pwd = pwd; } WebUser.prototype.validate = function () { return validation_3.validate(this)[0]; }; __decorate([ validation_1.required ], WebUser.prototype, "UserId", void 0); __decorate([ validation_1.required ], WebUser.prototype, "Pwd", void 0); WebUser = __decorate([ validation_2.validatable ], WebUser); return WebUser; }()); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = WebUser; /***/ }, /* 7 */ /***/ function(module, exports) { "use strict"; function validatable(target) { console.log("Validatable class annotation reached"); } exports.validatable = validatable; function init(target) { if (!target.validators) { target.validators = []; } } function required(target, prop) { console.log("Required property annotation reached"); init(target); target.validators.push(function (modelErrors) { if (!!this[prop]) { modelErrors.push(prop.toString().concat(' validation success!')); return true; } else { modelErrors.push(prop.toString().concat(' cannot be empty!')); return false; } }); } exports.required = required; function validate(target) { var rlt = true; var modelErrors = []; if (target.validators != null && target.validators.length > 0) { for (var _i = 0, _a = target.validators; _i < _a.length; _i++) { var v = _a[_i]; rlt = v.call(target, modelErrors) && rlt; } } console.log(modelErrors); return [rlt, modelErrors]; } exports.validate = validate; /***/ } /******/ ]); //# sourceMappingURL=demo.bundle.js.map
mind0n/hive
Frontend/demo/dist/demo.bundle.js
JavaScript
mit
281,070
export hom, hom_check """ `hom_check(G,H,d)` checks if the dictionary `d` is a graph homomorphism from `G` to `H`. """ function hom_check(G::SimpleGraph, H::SimpleGraph, d::Dict)::Bool for e in G.E v, w = e x = d[v] y = d[w] if !H[x, y] return false end end return true end """ `hom(G,H)` finds a graph homomorphism from `G` to `H`. """ function hom(G::SimpleGraph{S}, H::SimpleGraph{T}) where {S,T} m = Model(get_solver()) @variable(m, P[G.V, H.V], Bin) for v in G.V @constraint(m, sum(P[v, x] for x in H.V) == 1) end for e in G.E u, v = e for x in H.V for y in H.V if !H[x, y] @constraint(m, P[u, x] + P[v, y] <= 1) end end end end optimize!(m) status = Int(termination_status(m)) if status != 1 error("No homomorphism") end PP = Int.(value.(P)) result = Dict{S,T}() for v in G.V for x in H.V if PP[v, x] > 0 result[v] = x end end end return result end
scheinerman/SimpleGraphAlgorithms.jl
src/hom.jl
Julia
mit
1,166
"""Auto-generated file, do not edit by hand. BG metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_BG = PhoneMetadata(id='BG', country_code=359, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='[23567]\\d{5,7}|[489]\\d{6,8}', possible_number_pattern='\\d{5,9}'), fixed_line=PhoneNumberDesc(national_number_pattern='2(?:[0-8]\\d{5,6}|9\\d{4,6})|(?:[36]\\d|5[1-9]|8[1-6]|9[1-7])\\d{5,6}|(?:4(?:[124-7]\\d|3[1-6])|7(?:0[1-9]|[1-9]\\d))\\d{4,5}', possible_number_pattern='\\d{5,8}', example_number='2123456'), mobile=PhoneNumberDesc(national_number_pattern='(?:8[7-9]|98)\\d{7}|4(?:3[0789]|8\\d)\\d{5}', possible_number_pattern='\\d{8,9}', example_number='48123456'), toll_free=PhoneNumberDesc(national_number_pattern='800\\d{5}', possible_number_pattern='\\d{8}', example_number='80012345'), premium_rate=PhoneNumberDesc(national_number_pattern='90\\d{6}', possible_number_pattern='\\d{8}', example_number='90123456'), shared_cost=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'), personal_number=PhoneNumberDesc(national_number_pattern='700\\d{5}', possible_number_pattern='\\d{5,9}', example_number='70012345'), voip=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'), pager=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'), uan=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'), emergency=PhoneNumberDesc(national_number_pattern='1(?:12|50|6[06])', possible_number_pattern='\\d{3}', example_number='112'), voicemail=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'), short_code=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'), standard_rate=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'), no_international_dialling=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'), national_prefix='0', national_prefix_for_parsing='0', number_format=[NumberFormat(pattern='(2)(\\d{5})', format='\\1 \\2', leading_digits_pattern=['29'], national_prefix_formatting_rule='0\\1'), NumberFormat(pattern='(2)(\\d{3})(\\d{3,4})', format='\\1 \\2 \\3', leading_digits_pattern=['2'], national_prefix_formatting_rule='0\\1'), NumberFormat(pattern='(\\d{3})(\\d{4})', format='\\1 \\2', leading_digits_pattern=['43[124-7]|70[1-9]'], national_prefix_formatting_rule='0\\1'), NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{2})', format='\\1 \\2 \\3', leading_digits_pattern=['43[124-7]|70[1-9]'], national_prefix_formatting_rule='0\\1'), NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['[78]00'], national_prefix_formatting_rule='0\\1'), NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2,3})', format='\\1 \\2 \\3', leading_digits_pattern=['[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]'], national_prefix_formatting_rule='0\\1'), NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{3,4})', format='\\1 \\2 \\3', leading_digits_pattern=['48|8[7-9]|9[08]'], national_prefix_formatting_rule='0\\1')])
ayushgoel/FixGoogleContacts
phonenumbers/data/region_BG.py
Python
mit
3,204
/* * Copyright (C) 2013 The Android Open Source Project * * 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. */ package com.example.android.bluetoothlegatt; import android.app.Activity; import android.bluetooth.BluetoothGattCharacteristic; import android.bluetooth.BluetoothGattService; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.ServiceConnection; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.Bundle; import android.os.IBinder; import android.os.PowerManager; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.CompoundButton; import android.widget.ExpandableListView; import android.widget.SeekBar; import android.widget.SimpleExpandableListAdapter; import android.widget.Switch; import android.widget.TextView; import java.util.ArrayList; import java.util.HashMap; import java.util.List; /** * For a given BLE device, this Activity provides the user interface to connect, display data, * and display GATT services and characteristics supported by the device. The Activity * communicates with {@code BluetoothLeService}, which in turn interacts with the * Bluetooth LE API. */ public class DeviceControlActivity extends Activity implements SeekBar.OnSeekBarChangeListener ,SensorEventListener { private final static String TAG = DeviceControlActivity.class.getSimpleName(); public static final String EXTRAS_DEVICE_NAME = "DEVICE_NAME"; public static final String EXTRAS_DEVICE_ADDRESS = "DEVICE_ADDRESS"; public static String CLIENT_CHARACTERISTIC_MOTOR = "0000fff1-0000-1000-8000-00805f9b34fb"; private TextView mConnectionState; private TextView mDataField; private String mDeviceName; private String mDeviceAddress; private ExpandableListView mGattServicesList; private BluetoothLeService mBluetoothLeService; private ArrayList<ArrayList<BluetoothGattCharacteristic>> mGattCharacteristics = new ArrayList<ArrayList<BluetoothGattCharacteristic>>(); private boolean mConnected = false; private BluetoothGattCharacteristic mNotifyCharacteristic; private final String LIST_NAME = "NAME"; private final String LIST_UUID = "UUID"; private byte[] value = new byte[8]; private boolean motor_run = false; private TextView mShowSpeed0,mShowSpeed1,mShowSpeed2,mShowSpeed3; private SeekBar mSetSpeed0,mSetSpeed1,mSetSpeed2,mSetSpeed3; private BluetoothGattCharacteristic mMotorChars; private SensorManager mSensorManager; private Switch mDevState = null; private Switch mConState = null; private Switch mCtlState = null; private PowerManager pm = null; PowerManager.WakeLock wl = null; // Code to manage Service lifecycle. private final ServiceConnection mServiceConnection = new ServiceConnection() { @Override public void onServiceConnected(ComponentName componentName, IBinder service) { mBluetoothLeService = ((BluetoothLeService.LocalBinder) service).getService(); if (!mBluetoothLeService.initialize()) { Log.e(TAG, "Unable to initialize Bluetooth"); finish(); } // Automatically connects to the device upon successful start-up initialization. mBluetoothLeService.connect(mDeviceAddress); } @Override public void onServiceDisconnected(ComponentName componentName) { mBluetoothLeService = null; } }; // Handles various events fired by the Service. // ACTION_GATT_CONNECTED: connected to a GATT server. // ACTION_GATT_DISCONNECTED: disconnected from a GATT server. // ACTION_GATT_SERVICES_DISCOVERED: discovered GATT services. // ACTION_DATA_AVAILABLE: received data from the device. This can be a result of read // or notification operations. private final BroadcastReceiver mGattUpdateReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { final String action = intent.getAction(); if (BluetoothLeService.ACTION_GATT_CONNECTED.equals(action)) { mConnected = true; updateConnectionState(R.string.connected); invalidateOptionsMenu(); } else if (BluetoothLeService.ACTION_GATT_DISCONNECTED.equals(action)) { mConnected = false; updateConnectionState(R.string.disconnected); invalidateOptionsMenu(); clearUI(); } else if (BluetoothLeService.ACTION_GATT_SERVICES_DISCOVERED.equals(action)) { // Show all the supported services and characteristics on the user interface. displayGattServices(mBluetoothLeService.getSupportedGattServices()); } else if (BluetoothLeService.ACTION_DATA_AVAILABLE.equals(action)) { displayData(intent.getStringExtra(BluetoothLeService.EXTRA_DATA)); } } }; // If a given GATT characteristic is selected, check for supported features. This sample // demonstrates 'Read' and 'Notify' features. See // http://d.android.com/reference/android/bluetooth/BluetoothGatt.html for the complete // list of supported characteristic features. private final ExpandableListView.OnChildClickListener servicesListClickListner = new ExpandableListView.OnChildClickListener() { @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { if (mGattCharacteristics != null) { final BluetoothGattCharacteristic characteristic = mGattCharacteristics.get(groupPosition).get(childPosition); // final int charaProp = characteristic.getProperties(); // if ((charaProp | BluetoothGattCharacteristic.PROPERTY_READ) > 0) { // // If there is an active notification on a characteristic, clear // // it first so it doesn't update the data field on the user interface. // if (mNotifyCharacteristic != null) { // mBluetoothLeService.setCharacteristicNotification( // mNotifyCharacteristic, false); // mNotifyCharacteristic = null; // } // mBluetoothLeService.readCharacteristic(characteristic); // } // if ((charaProp | BluetoothGattCharacteristic.PROPERTY_NOTIFY) > 0) { // mNotifyCharacteristic = characteristic; // mBluetoothLeService.setCharacteristicNotification( // characteristic, true); // } if(characteristic.getUuid().toString().equals(CLIENT_CHARACTERISTIC_MOTOR)) { mMotorChars = characteristic; value[0] = 0x04; value[5] += 10; value[5] %= 100; value[6] += 10; value[6] %= 100; characteristic.setValue(value); mBluetoothLeService.writeCharacteristic(characteristic); Log.d("BLE_TEST", "Write Begin"); Log.d("BLE_TEST", "value" + value[7]); } return true; } return false; } }; private void clearUI() { mGattServicesList.setAdapter((SimpleExpandableListAdapter) null); mDataField.setText(R.string.no_data); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.gatt_services_characteristics); mShowSpeed0 = (TextView) findViewById(R.id.ShowSpeed0); mSetSpeed0 = (SeekBar) findViewById(R.id.SetSpeed0); mShowSpeed1 = (TextView) findViewById(R.id.ShowSpeed1); mSetSpeed1 = (SeekBar) findViewById(R.id.SetSpeed1); mShowSpeed2 = (TextView) findViewById(R.id.ShowSpeed2); mSetSpeed2 = (SeekBar) findViewById(R.id.SetSpeed2); mShowSpeed3 = (TextView) findViewById(R.id.ShowSpeed3); mSetSpeed3 = (SeekBar) findViewById(R.id.SetSpeed3); mDevState = (Switch) findViewById(R.id.DevState); mConState = (Switch) findViewById(R.id.ConState); mCtlState = (Switch) findViewById(R.id.CtlState); // mDevState.setEnabled(false); // 玩家模式 // mConState.setEnabled(true); // 连接状态 // mCtlState.setEnabled(false); // 停止控制 // 开发者模式 or 玩家模式 mDevState.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { SetPlayMode(b); } }); // 连接 or 断开 mConState.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { // TODO mBluetoothLeService.disconnect(); AppRun(); } }); // 开始控制 or 停止控制 mCtlState.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { // TODO } }); mShowSpeed0.setText("Ch0 PWM Duty " + 0); mSetSpeed0.setMax(100); mSetSpeed0.setProgress(0); mSetSpeed0.setOnSeekBarChangeListener(this); mShowSpeed1.setText("Ch1 PWM Duty " + 0); mSetSpeed1.setMax(100); mSetSpeed1.setProgress(0); mSetSpeed1.setOnSeekBarChangeListener(this); mShowSpeed2.setText("Ch2 PWM Duty " + 0); mSetSpeed2.setMax(100); mSetSpeed2.setProgress(0); mSetSpeed2.setOnSeekBarChangeListener(this); mShowSpeed3.setText("Ch3 PWM Duty " + 0); mSetSpeed3.setMax(100); mSetSpeed3.setProgress(0); mSetSpeed3.setOnSeekBarChangeListener(this); mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE); mSensorManager.registerListener(this, mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), //SensorManager.SENSOR_DELAY_NORMAL); 50000); final Intent intent = getIntent(); mDeviceName = intent.getStringExtra(EXTRAS_DEVICE_NAME); mDeviceAddress = intent.getStringExtra(EXTRAS_DEVICE_ADDRESS); // Sets up UI references. ((TextView) findViewById(R.id.device_address)).setText(mDeviceAddress); mGattServicesList = (ExpandableListView) findViewById(R.id.gatt_services_list); mGattServicesList.setOnChildClickListener(servicesListClickListner); mConnectionState = (TextView) findViewById(R.id.connection_state); mDataField = (TextView) findViewById(R.id.data_value); getActionBar().setTitle(mDeviceName); getActionBar().setDisplayHomeAsUpEnabled(true); Intent gattServiceIntent = new Intent(this, BluetoothLeService.class); bindService(gattServiceIntent, mServiceConnection, BIND_AUTO_CREATE); SetPlayMode(false); } private void AppRun() { Intent intent = new Intent(this, DeviceScanActivity.class); startActivity(intent); finish(); } private void SetPlayMode(boolean mode) { // true----developer mode // false---player mode TextView mText = null; if (true == mode) { // Address mText = (TextView) findViewById(R.id.device_address_0); mText.setVisibility(TextView.VISIBLE); mText = (TextView) findViewById(R.id.device_address); mText.setVisibility(TextView.VISIBLE); // Connect State mText = (TextView) findViewById(R.id.connection_state_0); mText.setVisibility(TextView.VISIBLE); mText = (TextView) findViewById(R.id.connection_state); mText.setVisibility(TextView.VISIBLE); // Data mText = (TextView) findViewById(R.id.data_value_0); mText.setVisibility(TextView.VISIBLE); mText = (TextView) findViewById(R.id.data_value); mText.setVisibility(TextView.VISIBLE); ExpandableListView mList = (ExpandableListView) findViewById(R.id.gatt_services_list); mList.setVisibility(ExpandableListView.VISIBLE); } else { // Address mText = (TextView) findViewById(R.id.device_address_0); mText.setVisibility(TextView.INVISIBLE); mText = (TextView) findViewById(R.id.device_address); mText.setVisibility(TextView.INVISIBLE); // Connect State mText = (TextView) findViewById(R.id.connection_state_0); mText.setVisibility(TextView.INVISIBLE); mText = (TextView) findViewById(R.id.connection_state); mText.setVisibility(TextView.INVISIBLE); // Data mText = (TextView) findViewById(R.id.data_value_0); mText.setVisibility(TextView.INVISIBLE); mText = (TextView) findViewById(R.id.data_value); mText.setVisibility(TextView.INVISIBLE); ExpandableListView mList = (ExpandableListView) findViewById(R.id.gatt_services_list); mList.setVisibility(ExpandableListView.INVISIBLE); } } @Override public void onProgressChanged(SeekBar var1, int var2, boolean var3) { /* value[0] = 0x04; if(mSetSpeed0 == var1) { value[4] = (byte) var1.getProgress(); mShowSpeed0.setText("Ch0 PWM Duty " + var1.getProgress()); } if(mSetSpeed1 == var1) { value[5] = (byte) var1.getProgress(); mShowSpeed1.setText("Ch1 PWM Duty " + var1.getProgress()); } if(mSetSpeed2 == var1) { value[6] = (byte) var1.getProgress(); mShowSpeed2.setText("Ch2 PWM Duty " + var1.getProgress()); } if(mSetSpeed3 == var1) { value[7] = (byte) var1.getProgress(); mShowSpeed3.setText("Ch3 PWM Duty " + var1.getProgress()); } */ //mMotorChars.setValue(value); //mBluetoothLeService.writeCharacteristic(mMotorChars); } @Override public void onStartTrackingTouch(SeekBar var1){ } @Override public void onStopTrackingTouch(SeekBar var1){ } @Override public void onSensorChanged(SensorEvent var1){ if (var1.sensor.getType() == Sensor.TYPE_ACCELEROMETER) { float[] values = var1.values; // Log.d("BLE_SENSOR", "Length" + values.length); // for(int i = 0; i < values.length; i++) { // Log.d("BLE_SENSOR", "value " + i + values[0]); // } // Control Car int speed_fb = (int)(-20*values[1]); int speed_rl = (int)(20*values[0]); //mShowSpeed0.setText("X Acc value " + speed_fb); //mShowSpeed1.setText("Y Acc value " + speed_rl); if(false == mCtlState.isChecked()){ RemoteCar(0, 0); } else { RemoteCar(speed_fb, speed_rl); } } } // Forward-Back +F-B // Right-Left +L-R void RemoteCar(int speed_fb, int speed_rl){ int speed_l = speed_fb+speed_rl/2; int speed_r = speed_fb-speed_rl/2; for(int i = 0; i < value.length; i++) { value[i] = 0; } if(speed_l > 100) speed_l = 100; if(speed_l < -100) speed_l = -100; if(speed_r > 100) speed_r = 100; if(speed_r < -100) speed_r = -100; value[0] = 0x04; if(speed_l > 0) { value[4] = (byte)speed_l; value[5] = 0; } else if(speed_l < 0){ value[4] = 0; value[5] = (byte)-speed_l; } else { // Do nothing } if(speed_r < 0) { value[6] = (byte)-speed_r; value[7] = 0; } else if(speed_r > 0){ value[6] = 0; value[7] = (byte)speed_r; } else { // Do nothing } /////// mShowSpeed0.setText("Ch0 PWM Duty " + value[4]); mShowSpeed1.setText("Ch1 PWM Duty " + value[5]); mShowSpeed2.setText("Ch2 PWM Duty " + value[6]); mShowSpeed3.setText("Ch3 PWM Duty " + value[7]); mSetSpeed0.setProgress(value[4]); mSetSpeed1.setProgress(value[5]); mSetSpeed2.setProgress(value[6]); mSetSpeed3.setProgress(value[7]); // int progress = (int)value[4]; // mSetSpeed0.setProgress(progress); // progress = (int)value[5]; // mSetSpeed1.setProgress(progress); // progress = (int)value[6]; // mSetSpeed2.setProgress(progress); // progress = (int)value[7]; // mSetSpeed3.setProgress(progress); if(null != mMotorChars) { mMotorChars.setValue(value); if(null != mBluetoothLeService) mBluetoothLeService.writeCharacteristic(mMotorChars); } else { Log.d("BLE_SENSOR", "Error"); } Log.d("BLE_SENSOR", "Update"); /////// } @Override public void onAccuracyChanged(Sensor var1, int var2){ // Do Nothing } @Override protected void onResume() { super.onResume(); if(null == pm) { pm = (PowerManager) getSystemService(Context.POWER_SERVICE); wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "My Tag"); wl.acquire(); } registerReceiver(mGattUpdateReceiver, makeGattUpdateIntentFilter()); if (mBluetoothLeService != null) { final boolean result = mBluetoothLeService.connect(mDeviceAddress); Log.d(TAG, "Connect request result=" + result); } if(null != mSensorManager) { mSensorManager.registerListener(this, mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), //SensorManager.SENSOR_DELAY_NORMAL); 2000000); } } @Override protected void onPause() { super.onPause(); unregisterReceiver(mGattUpdateReceiver); mSensorManager.unregisterListener(this); if(null != wl) { wl.release(); wl = null; } } @Override protected void onDestroy() { super.onDestroy(); unbindService(mServiceConnection); mBluetoothLeService = null; } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.gatt_services, menu); if (mConnected) { menu.findItem(R.id.menu_connect).setVisible(false); menu.findItem(R.id.menu_disconnect).setVisible(true); } else { menu.findItem(R.id.menu_connect).setVisible(true); menu.findItem(R.id.menu_disconnect).setVisible(false); } return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch(item.getItemId()) { case R.id.menu_connect: mBluetoothLeService.connect(mDeviceAddress); return true; case R.id.menu_disconnect: mBluetoothLeService.disconnect(); return true; case android.R.id.home: onBackPressed(); return true; } return super.onOptionsItemSelected(item); } private void updateConnectionState(final int resourceId) { runOnUiThread(new Runnable() { @Override public void run() { mConnectionState.setText(resourceId); } }); } private void displayData(String data) { if (data != null) { mDataField.setText(data); } } // Demonstrates how to iterate through the supported GATT Services/Characteristics. // In this sample, we populate the data structure that is bound to the ExpandableListView // on the UI. private void displayGattServices(List<BluetoothGattService> gattServices) { if (gattServices == null) return; String uuid = null; String unknownServiceString = getResources().getString(R.string.unknown_service); String unknownCharaString = getResources().getString(R.string.unknown_characteristic); ArrayList<HashMap<String, String>> gattServiceData = new ArrayList<HashMap<String, String>>(); ArrayList<ArrayList<HashMap<String, String>>> gattCharacteristicData = new ArrayList<ArrayList<HashMap<String, String>>>(); mGattCharacteristics = new ArrayList<ArrayList<BluetoothGattCharacteristic>>(); // Loops through available GATT Services. for (BluetoothGattService gattService : gattServices) { HashMap<String, String> currentServiceData = new HashMap<String, String>(); uuid = gattService.getUuid().toString(); currentServiceData.put( LIST_NAME, SampleGattAttributes.lookup(uuid, unknownServiceString)); currentServiceData.put(LIST_UUID, uuid); gattServiceData.add(currentServiceData); ArrayList<HashMap<String, String>> gattCharacteristicGroupData = new ArrayList<HashMap<String, String>>(); List<BluetoothGattCharacteristic> gattCharacteristics = gattService.getCharacteristics(); ArrayList<BluetoothGattCharacteristic> charas = new ArrayList<BluetoothGattCharacteristic>(); // Loops through available Characteristics. for (BluetoothGattCharacteristic gattCharacteristic : gattCharacteristics) { charas.add(gattCharacteristic); HashMap<String, String> currentCharaData = new HashMap<String, String>(); uuid = gattCharacteristic.getUuid().toString(); currentCharaData.put( LIST_NAME, SampleGattAttributes.lookup(uuid, unknownCharaString)); currentCharaData.put(LIST_UUID, uuid); gattCharacteristicGroupData.add(currentCharaData); // Set if(gattCharacteristic.getUuid().toString().equals(CLIENT_CHARACTERISTIC_MOTOR)) { mMotorChars = gattCharacteristic; } } mGattCharacteristics.add(charas); gattCharacteristicData.add(gattCharacteristicGroupData); } SimpleExpandableListAdapter gattServiceAdapter = new SimpleExpandableListAdapter( this, gattServiceData, android.R.layout.simple_expandable_list_item_2, new String[] {LIST_NAME, LIST_UUID}, new int[] { android.R.id.text1, android.R.id.text2 }, gattCharacteristicData, android.R.layout.simple_expandable_list_item_2, new String[] {LIST_NAME, LIST_UUID}, new int[] { android.R.id.text1, android.R.id.text2 } ); mGattServicesList.setAdapter(gattServiceAdapter); } private static IntentFilter makeGattUpdateIntentFilter() { final IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(BluetoothLeService.ACTION_GATT_CONNECTED); intentFilter.addAction(BluetoothLeService.ACTION_GATT_DISCONNECTED); intentFilter.addAction(BluetoothLeService.ACTION_GATT_SERVICES_DISCOVERED); intentFilter.addAction(BluetoothLeService.ACTION_DATA_AVAILABLE); return intentFilter; } }
cedar-renjun/RemoteControl-Car
App/BluetoothLeGatt/Application/src/main/java/com/example/android/bluetoothlegatt/DeviceControlActivity.java
Java
mit
25,314
package tasks // This file is generated by methodGenerator. // DO NOT MOTIFY THIS FILE. import ( "net/url" "github.com/kawaken/go-rtm/methods" ) // AddTags returns "rtm.tasks.addTags" method instance. func AddTags(timeline string, listID string, taskseriesID string, taskID string, tags string) *methods.Method { name := "rtm.tasks.addTags" p := url.Values{} p.Add("method", name) p.Add("timeline", timeline) p.Add("list_id", listID) p.Add("taskseries_id", taskseriesID) p.Add("task_id", taskID) p.Add("tags", tags) return &methods.Method{Name: name, Params: p} }
kawaken/go-rtm
methods/tasks/add_tags.go
GO
mit
582
require('babel-polyfill'); /* eslint-disable */ // Webpack config for creating the production bundle. var path = require('path'); var webpack = require('webpack'); var CleanPlugin = require('clean-webpack-plugin'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); var strip = require('strip-loader'); var projectRootPath = path.resolve(__dirname, '../'); var assetsPath = path.resolve(projectRootPath, './static/dist'); // https://github.com/halt-hammerzeit/webpack-isomorphic-tools var WebpackIsomorphicToolsPlugin = require('webpack-isomorphic-tools/plugin'); var webpackIsomorphicToolsPlugin = new WebpackIsomorphicToolsPlugin(require('./webpack-isomorphic-tools')); module.exports = { devtool: 'source-map', context: path.resolve(__dirname, '..'), entry: { 'main': [ 'bootstrap-sass!./src/theme/bootstrap.config.prod.js', 'font-awesome-webpack!./src/theme/font-awesome.config.prod.js', './src/client.js' ] }, output: { path: assetsPath, filename: '[name]-[chunkhash].js', chunkFilename: '[name]-[chunkhash].js', publicPath: '/dist/' }, module: { loaders: [ { test: /\.jsx?$/, exclude: /node_modules/, loaders: [strip.loader('debug'), 'babel']}, { test: /\.json$/, loader: 'json-loader' }, { test: /\.less$/, loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=2&sourceMap!autoprefixer?browsers=last 2 version!less?outputStyle=expanded&sourceMap=true&sourceMapContents=true') }, { test: /\.scss$/, loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=2&sourceMap!autoprefixer?browsers=last 2 version!sass?outputStyle=expanded&sourceMap=true&sourceMapContents=true') }, { test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff" }, { test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff" }, { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream" }, { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file" }, { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml" }, { test: webpackIsomorphicToolsPlugin.regular_expression('images'), loader: 'url-loader?limit=10240' } ] }, progress: true, resolve: { modulesDirectories: [ 'src', 'node_modules' ], extensions: ['', '.json', '.js', '.jsx'] }, plugins: [ new CleanPlugin([assetsPath], { root: projectRootPath }), // css files from the extract-text-plugin loader new ExtractTextPlugin('[name]-[chunkhash].css', {allChunks: true}), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: '"production"' }, __CLIENT__: true, __SERVER__: false, __DEVELOPMENT__: false, __DEVTOOLS__: false }), // ignore dev config new webpack.IgnorePlugin(/\.\/dev/, /\/config$/), // optimizations new webpack.optimize.DedupePlugin(), new webpack.optimize.OccurenceOrderPlugin(), new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }), webpackIsomorphicToolsPlugin ] };
chuson1996/frontend-advisor
webpack/prod.config.js
JavaScript
mit
3,197
from itertools import product import numpy as np from sympy import And import pytest from conftest import skipif, opts_tiling from devito import (ConditionalDimension, Grid, Function, TimeFunction, SparseFunction, # noqa Eq, Operator, Constant, Dimension, SubDimension, switchconfig, SubDomain, Lt, Le, Gt, Ge, Ne, Buffer) from devito.ir.iet import (Conditional, Expression, Iteration, FindNodes, retrieve_iteration_tree) from devito.symbolics import indexify, retrieve_functions, IntDiv from devito.types import Array class TestBufferedDimension(object): def test_multi_buffer(self): grid = Grid((3, 3)) f = TimeFunction(name="f", grid=grid) g = TimeFunction(name="g", grid=grid, save=Buffer(7)) op = Operator([Eq(f.forward, 1), Eq(g, f.forward)]) op(time_M=3) # f looped all time_order buffer and is 1 everywhere assert np.allclose(f.data, 1) # g looped indices 0 to 3, rest is still 0 assert np.allclose(g.data[0:4], 1) assert np.allclose(g.data[4:], 0) def test_multi_buffer_long_time(self): grid = Grid((3, 3)) time = grid.time_dim f = TimeFunction(name="f", grid=grid) g = TimeFunction(name="g", grid=grid, save=Buffer(7)) op = Operator([Eq(f.forward, time), Eq(g, time+1)]) op(time_M=20) # f[0] is time=19, f[1] is time=20 assert np.allclose(f.data[0], 19) assert np.allclose(f.data[1], 20) # g is time 15 to 21 (loop twice the 7 buffer then 15->21) for i in range(7): assert np.allclose(g.data[i], 14+i+1) class TestSubDimension(object): @pytest.mark.parametrize('opt', opts_tiling) def test_interior(self, opt): """ Tests application of an Operator consisting of a single equation over the ``interior`` subdomain. """ grid = Grid(shape=(4, 4, 4)) x, y, z = grid.dimensions interior = grid.interior u = TimeFunction(name='u', grid=grid) eqn = [Eq(u.forward, u + 2, subdomain=interior)] op = Operator(eqn, opt=opt) op.apply(time_M=2) assert np.all(u.data[1, 1:-1, 1:-1, 1:-1] == 6.) assert np.all(u.data[1, :, 0] == 0.) assert np.all(u.data[1, :, -1] == 0.) assert np.all(u.data[1, :, :, 0] == 0.) assert np.all(u.data[1, :, :, -1] == 0.) def test_domain_vs_interior(self): """ Tests application of an Operator consisting of two equations, one over the whole domain (default), and one over the ``interior`` subdomain. """ grid = Grid(shape=(4, 4, 4)) x, y, z = grid.dimensions t = grid.stepping_dim # noqa interior = grid.interior u = TimeFunction(name='u', grid=grid) # noqa eqs = [Eq(u.forward, u + 1), Eq(u.forward, u.forward + 2, subdomain=interior)] op = Operator(eqs, opt='noop') trees = retrieve_iteration_tree(op) assert len(trees) == 2 op.apply(time_M=1) assert np.all(u.data[1, 0, :, :] == 1) assert np.all(u.data[1, -1, :, :] == 1) assert np.all(u.data[1, :, 0, :] == 1) assert np.all(u.data[1, :, -1, :] == 1) assert np.all(u.data[1, :, :, 0] == 1) assert np.all(u.data[1, :, :, -1] == 1) assert np.all(u.data[1, 1:3, 1:3, 1:3] == 3) @pytest.mark.parametrize('opt', opts_tiling) def test_subdim_middle(self, opt): """ Tests that instantiating SubDimensions using the classmethod constructors works correctly. """ grid = Grid(shape=(4, 4, 4)) x, y, z = grid.dimensions t = grid.stepping_dim # noqa u = TimeFunction(name='u', grid=grid) # noqa xi = SubDimension.middle(name='xi', parent=x, thickness_left=1, thickness_right=1) eqs = [Eq(u.forward, u + 1)] eqs = [e.subs(x, xi) for e in eqs] op = Operator(eqs, opt=opt) u.data[:] = 1.0 op.apply(time_M=1) assert np.all(u.data[1, 0, :, :] == 1) assert np.all(u.data[1, -1, :, :] == 1) assert np.all(u.data[1, 1:3, :, :] == 2) def test_symbolic_size(self): """Check the symbolic size of all possible SubDimensions is as expected.""" grid = Grid(shape=(4,)) x, = grid.dimensions thickness = 4 xleft = SubDimension.left(name='xleft', parent=x, thickness=thickness) assert xleft.symbolic_size == xleft.thickness.left[0] xi = SubDimension.middle(name='xi', parent=x, thickness_left=thickness, thickness_right=thickness) assert xi.symbolic_size == (x.symbolic_max - x.symbolic_min - xi.thickness.left[0] - xi.thickness.right[0] + 1) xright = SubDimension.right(name='xright', parent=x, thickness=thickness) assert xright.symbolic_size == xright.thickness.right[0] @pytest.mark.parametrize('opt', opts_tiling) def test_bcs(self, opt): """ Tests application of an Operator consisting of multiple equations defined over different sub-regions, explicitly created through the use of SubDimensions. """ grid = Grid(shape=(20, 20)) x, y = grid.dimensions t = grid.stepping_dim thickness = 4 u = TimeFunction(name='u', save=None, grid=grid, space_order=0, time_order=1) xleft = SubDimension.left(name='xleft', parent=x, thickness=thickness) xi = SubDimension.middle(name='xi', parent=x, thickness_left=thickness, thickness_right=thickness) xright = SubDimension.right(name='xright', parent=x, thickness=thickness) yi = SubDimension.middle(name='yi', parent=y, thickness_left=thickness, thickness_right=thickness) t_in_centre = Eq(u[t+1, xi, yi], 1) leftbc = Eq(u[t+1, xleft, yi], u[t+1, xleft+1, yi] + 1) rightbc = Eq(u[t+1, xright, yi], u[t+1, xright-1, yi] + 1) op = Operator([t_in_centre, leftbc, rightbc], opt=opt) op.apply(time_m=1, time_M=1) assert np.all(u.data[0, :, 0:thickness] == 0.) assert np.all(u.data[0, :, -thickness:] == 0.) assert all(np.all(u.data[0, i, thickness:-thickness] == (thickness+1-i)) for i in range(thickness)) assert all(np.all(u.data[0, -i, thickness:-thickness] == (thickness+2-i)) for i in range(1, thickness + 1)) assert np.all(u.data[0, thickness:-thickness, thickness:-thickness] == 1.) def test_flow_detection_interior(self): """ Test detection of flow directions when SubDimensions are used (in this test they are induced by the ``interior`` subdomain). Stencil uses values at new timestep as well as those at previous ones This forces an evaluation order onto x. Weights are: x=0 x=1 x=2 x=3 t=N 2 ---3 v / t=N+1 o--+----4 Flow dependency should traverse x in the negative direction x=2 x=3 x=4 x=5 x=6 t=0 0 --- 0 -- 1 -- 0 v / v / v / t=1 44 -+--- 11 -+--- 2--+ -- 0 """ grid = Grid(shape=(10, 10)) x, y = grid.dimensions interior = grid.interior u = TimeFunction(name='u', grid=grid, save=10, time_order=1, space_order=0) step = Eq(u.forward, 2*u + 3*u.subs(x, x+x.spacing) + 4*u.forward.subs(x, x+x.spacing), subdomain=interior) op = Operator(step) u.data[0, 5, 5] = 1.0 op.apply(time_M=0) assert u.data[1, 5, 5] == 2 assert u.data[1, 4, 5] == 11 assert u.data[1, 3, 5] == 44 assert u.data[1, 2, 5] == 4*44 assert u.data[1, 1, 5] == 4*4*44 # This point isn't updated because of the `interior` selection assert u.data[1, 0, 5] == 0 assert np.all(u.data[1, 6:, :] == 0) assert np.all(u.data[1, :, 0:5] == 0) assert np.all(u.data[1, :, 6:] == 0) @pytest.mark.parametrize('exprs,expected,', [ # Carried dependence in both /t/ and /x/ (['Eq(u[t+1, x, y], u[t+1, x-1, y] + u[t, x, y])'], 'y'), (['Eq(u[t+1, x, y], u[t+1, x-1, y] + u[t, x, y], subdomain=interior)'], 'i0y'), # Carried dependence in both /t/ and /y/ (['Eq(u[t+1, x, y], u[t+1, x, y-1] + u[t, x, y])'], 'x'), (['Eq(u[t+1, x, y], u[t+1, x, y-1] + u[t, x, y], subdomain=interior)'], 'i0x'), # Carried dependence in /y/, leading to separate /y/ loops, one # going forward, the other backward (['Eq(u[t+1, x, y], u[t+1, x, y-1] + u[t, x, y], subdomain=interior)', 'Eq(u[t+1, x, y], u[t+1, x, y+1] + u[t, x, y], subdomain=interior)'], 'i0x'), ]) def test_iteration_property_parallel(self, exprs, expected): """Tests detection of sequental and parallel Iterations when applying equations over different subdomains.""" grid = Grid(shape=(20, 20)) x, y = grid.dimensions # noqa t = grid.time_dim # noqa interior = grid.interior # noqa u = TimeFunction(name='u', grid=grid, save=10, time_order=1) # noqa # List comprehension would need explicit locals/globals mappings to eval for i, e in enumerate(list(exprs)): exprs[i] = eval(e) op = Operator(exprs, opt='noop') iterations = FindNodes(Iteration).visit(op) assert all(i.is_Sequential for i in iterations if i.dim.name != expected) assert all(i.is_Parallel for i in iterations if i.dim.name == expected) @skipif(['device']) @pytest.mark.parametrize('exprs,expected,', [ # All parallel, the innermost Iteration gets vectorized (['Eq(u[time, x, yleft], u[time, x, yleft] + 1.)'], ['yleft']), # All outers are parallel, carried dependence in `yleft`, so the middle # Iteration over `x` gets vectorized (['Eq(u[time, x, yleft], u[time, x, yleft+1] + 1.)'], ['x']), # Only the middle Iteration is parallel, so no vectorization (the Iteration # is left non-vectorised for OpenMP parallelism) (['Eq(u[time+1, x, yleft], u[time, x, yleft+1] + u[time+1, x, yleft+1])'], []) ]) def test_iteration_property_vector(self, exprs, expected): """Tests detection of vector Iterations when using subdimensions.""" grid = Grid(shape=(20, 20)) x, y = grid.dimensions # noqa time = grid.time_dim # noqa # The leftmost 10 elements yleft = SubDimension.left(name='yleft', parent=y, thickness=10) # noqa u = TimeFunction(name='u', grid=grid, save=10, time_order=0, space_order=1) # noqa # List comprehension would need explicit locals/globals mappings to eval for i, e in enumerate(list(exprs)): exprs[i] = eval(e) op = Operator(exprs, opt='simd') iterations = FindNodes(Iteration).visit(op) vectorized = [i.dim.name for i in iterations if i.is_Vectorized] assert set(vectorized) == set(expected) @pytest.mark.parametrize('opt', opts_tiling) def test_subdimmiddle_parallel(self, opt): """ Tests application of an Operator consisting of a subdimension defined over different sub-regions, explicitly created through the use of SubDimensions. """ grid = Grid(shape=(20, 20)) x, y = grid.dimensions t = grid.stepping_dim thickness = 4 u = TimeFunction(name='u', save=None, grid=grid, space_order=0, time_order=1) xi = SubDimension.middle(name='xi', parent=x, thickness_left=thickness, thickness_right=thickness) yi = SubDimension.middle(name='yi', parent=y, thickness_left=thickness, thickness_right=thickness) # a 5 point stencil that can be computed in parallel centre = Eq(u[t+1, xi, yi], u[t, xi, yi] + u[t, xi-1, yi] + u[t, xi+1, yi] + u[t, xi, yi-1] + u[t, xi, yi+1]) u.data[0, 10, 10] = 1.0 op = Operator([centre], opt=opt) print(op.ccode) iterations = FindNodes(Iteration).visit(op) assert all(i.is_Affine and i.is_Parallel for i in iterations if i.dim in [xi, yi]) op.apply(time_m=0, time_M=0) assert np.all(u.data[1, 9:12, 10] == 1.0) assert np.all(u.data[1, 10, 9:12] == 1.0) # Other than those, it should all be 0 u.data[1, 9:12, 10] = 0.0 u.data[1, 10, 9:12] = 0.0 assert np.all(u.data[1, :] == 0) def test_subdimleft_parallel(self): """ Tests application of an Operator consisting of a subdimension defined over different sub-regions, explicitly created through the use of SubDimensions. This tests that flow direction is not being automatically inferred from whether the subdimension is on the left or right boundary. """ grid = Grid(shape=(20, 20)) x, y = grid.dimensions t = grid.stepping_dim thickness = 4 u = TimeFunction(name='u', save=None, grid=grid, space_order=0, time_order=1) xl = SubDimension.left(name='xl', parent=x, thickness=thickness) yi = SubDimension.middle(name='yi', parent=y, thickness_left=thickness, thickness_right=thickness) # Can be done in parallel eq = Eq(u[t+1, xl, yi], u[t, xl, yi] + 1) op = Operator([eq]) iterations = FindNodes(Iteration).visit(op) assert all(i.is_Affine and i.is_Parallel for i in iterations if i.dim in [xl, yi]) op.apply(time_m=0, time_M=0) assert np.all(u.data[1, 0:thickness, 0:thickness] == 0) assert np.all(u.data[1, 0:thickness, -thickness:] == 0) assert np.all(u.data[1, 0:thickness, thickness:-thickness] == 1) assert np.all(u.data[1, thickness+1:, :] == 0) def test_subdimmiddle_notparallel(self): """ Tests application of an Operator consisting of a subdimension defined over different sub-regions, explicitly created through the use of SubDimensions. Different from ``test_subdimmiddle_parallel`` because an interior dimension cannot be evaluated in parallel. """ grid = Grid(shape=(20, 20)) x, y = grid.dimensions t = grid.stepping_dim thickness = 4 u = TimeFunction(name='u', save=None, grid=grid, space_order=0, time_order=1) xi = SubDimension.middle(name='xi', parent=x, thickness_left=thickness, thickness_right=thickness) yi = SubDimension.middle(name='yi', parent=y, thickness_left=thickness, thickness_right=thickness) # flow dependencies in x and y which should force serial execution # in reverse direction centre = Eq(u[t+1, xi, yi], u[t, xi, yi] + u[t+1, xi+1, yi+1]) u.data[0, 10, 10] = 1.0 op = Operator([centre]) iterations = FindNodes(Iteration).visit(op) assert all(i.is_Affine and i.is_Sequential for i in iterations if i.dim == xi) assert all(i.is_Affine and i.is_Parallel for i in iterations if i.dim == yi) op.apply(time_m=0, time_M=0) for i in range(4, 11): assert u.data[1, i, i] == 1.0 u.data[1, i, i] = 0.0 assert np.all(u.data[1, :] == 0) def test_subdimleft_notparallel(self): """ Tests application of an Operator consisting of a subdimension defined over different sub-regions, explicitly created through the use of SubDimensions. This tests that flow direction is not being automatically inferred from whether the subdimension is on the left or right boundary. """ grid = Grid(shape=(20, 20)) x, y = grid.dimensions t = grid.stepping_dim thickness = 4 u = TimeFunction(name='u', save=None, grid=grid, space_order=1, time_order=0) xl = SubDimension.left(name='xl', parent=x, thickness=thickness) yi = SubDimension.middle(name='yi', parent=y, thickness_left=thickness, thickness_right=thickness) # Flows inward (i.e. forward) rather than outward eq = Eq(u[t+1, xl, yi], u[t+1, xl-1, yi] + 1) op = Operator([eq]) iterations = FindNodes(Iteration).visit(op) assert all(i.is_Affine and i.is_Sequential for i in iterations if i.dim == xl) assert all(i.is_Affine and i.is_Parallel for i in iterations if i.dim == yi) op.apply(time_m=1, time_M=1) assert all(np.all(u.data[0, :thickness, thickness+i] == [1, 2, 3, 4]) for i in range(12)) assert np.all(u.data[0, thickness:] == 0) assert np.all(u.data[0, :, thickness+12:] == 0) def test_subdim_fd(self): """ Test that the FD shortcuts are handled correctly with SubDimensions """ grid = Grid(shape=(20, 20)) x, y = grid.dimensions u = TimeFunction(name='u', save=None, grid=grid, space_order=1, time_order=1) u.data[:] = 2. # Flows inward (i.e. forward) rather than outward eq = [Eq(u.forward, u.dx + u.dy, subdomain=grid.interior)] op = Operator(eq) op.apply(time_M=0) assert np.all(u.data[1, -1, :] == 2.) assert np.all(u.data[1, :, 0] == 2.) assert np.all(u.data[1, :, -1] == 2.) assert np.all(u.data[1, 0, :] == 2.) assert np.all(u.data[1, 1:18, 1:18] == 0.) def test_arrays_defined_over_subdims(self): """ Check code generation when an Array uses a SubDimension. """ grid = Grid(shape=(3,)) x, = grid.dimensions xi, = grid.interior.dimensions f = Function(name='f', grid=grid) a = Array(name='a', dimensions=(xi,), dtype=grid.dtype) op = Operator([Eq(a[xi], 1), Eq(f, f + a[xi + 1], subdomain=grid.interior)], openmp=False) assert len(op.parameters) == 6 # neither `x_size` nor `xi_size` are expected here assert not any(i.name in ('x_size', 'xi_size') for i in op.parameters) # Try running it -- regardless of what it will produce, this should run # ie, this checks this error isn't raised: # "ValueError: No value found for parameter xi_size" op() @pytest.mark.parametrize('opt', opts_tiling) def test_expandingbox_like(self, opt): """ Make sure SubDimensions aren't an obstacle to expanding boxes. """ grid = Grid(shape=(8, 8)) x, y = grid.dimensions u = TimeFunction(name='u', grid=grid) xi = SubDimension.middle(name='xi', parent=x, thickness_left=2, thickness_right=2) yi = SubDimension.middle(name='yi', parent=y, thickness_left=2, thickness_right=2) eqn = Eq(u.forward, u + 1) eqn = eqn.subs({x: xi, y: yi}) op = Operator(eqn, opt=opt) op.apply(time=3, x_m=2, x_M=5, y_m=2, y_M=5, xi_ltkn=0, xi_rtkn=0, yi_ltkn=0, yi_rtkn=0) assert np.all(u.data[0, 2:-2, 2:-2] == 4.) assert np.all(u.data[1, 2:-2, 2:-2] == 3.) assert np.all(u.data[:, :2] == 0.) assert np.all(u.data[:, -2:] == 0.) assert np.all(u.data[:, :, :2] == 0.) assert np.all(u.data[:, :, -2:] == 0.) class TestConditionalDimension(object): """ A collection of tests to check the correct functioning of ConditionalDimensions. """ def test_basic(self): nt = 19 grid = Grid(shape=(11, 11)) time = grid.time_dim u = TimeFunction(name='u', grid=grid) assert(grid.stepping_dim in u.indices) u2 = TimeFunction(name='u2', grid=grid, save=nt) assert(time in u2.indices) factor = 4 time_subsampled = ConditionalDimension('t_sub', parent=time, factor=factor) usave = TimeFunction(name='usave', grid=grid, save=(nt+factor-1)//factor, time_dim=time_subsampled) assert(time_subsampled in usave.indices) eqns = [Eq(u.forward, u + 1.), Eq(u2.forward, u2 + 1.), Eq(usave, u)] op = Operator(eqns) op.apply(t_M=nt-2) assert np.all(np.allclose(u.data[(nt-1) % 3], nt-1)) assert np.all([np.allclose(u2.data[i], i) for i in range(nt)]) assert np.all([np.allclose(usave.data[i], i*factor) for i in range((nt+factor-1)//factor)]) def test_basic_shuffles(self): """ Like ``test_basic``, but with different equation orderings. Nevertheless, we assert against the same exact values as in ``test_basic``, since we save `u`, not `u.forward`. """ nt = 19 grid = Grid(shape=(11, 11)) time = grid.time_dim u = TimeFunction(name='u', grid=grid) u2 = TimeFunction(name='u2', grid=grid, save=nt) factor = 4 time_subsampled = ConditionalDimension('t_sub', parent=time, factor=factor) usave = TimeFunction(name='usave', grid=grid, save=(nt+factor-1)//factor, time_dim=time_subsampled) # Shuffle 1 eqns = [Eq(usave, u), Eq(u.forward, u + 1.), Eq(u2.forward, u2 + 1.)] op = Operator(eqns) op.apply(t_M=nt-2) assert np.all(np.allclose(u.data[(nt-1) % 3], nt-1)) assert np.all([np.allclose(u2.data[i], i) for i in range(nt)]) assert np.all([np.allclose(usave.data[i], i*factor) for i in range((nt+factor-1)//factor)]) # Shuffle 2 usave.data[:] = 0. u.data[:] = 0. u2.data[:] = 0. eqns = [Eq(u.forward, u + 1.), Eq(usave, u), Eq(u2.forward, u2 + 1.)] op = Operator(eqns) op.apply(t_M=nt-2) assert np.all(np.allclose(u.data[(nt-1) % 3], nt-1)) assert np.all([np.allclose(u2.data[i], i) for i in range(nt)]) assert np.all([np.allclose(usave.data[i], i*factor) for i in range((nt+factor-1)//factor)]) @pytest.mark.parametrize('opt', opts_tiling) def test_spacial_subsampling(self, opt): """ Test conditional dimension for the spatial ones. This test saves u every two grid points : u2[x, y] = u[2*x, 2*y] """ nt = 19 grid = Grid(shape=(11, 11)) time = grid.time_dim u = TimeFunction(name='u', grid=grid, save=nt) assert(grid.time_dim in u.indices) # Creates subsampled spatial dimensions and accordine grid dims = tuple([ConditionalDimension(d.name+'sub', parent=d, factor=2) for d in u.grid.dimensions]) grid2 = Grid((6, 6), dimensions=dims, time_dimension=time) u2 = TimeFunction(name='u2', grid=grid2, save=nt) assert(time in u2.indices) eqns = [Eq(u.forward, u + 1.), Eq(u2, u)] op = Operator(eqns, opt=opt) op.apply(time_M=nt-2) # Verify that u2[x,y]= u[2*x, 2*y] assert np.allclose(u.data[:-1, 0::2, 0::2], u2.data[:-1, :, :]) def test_time_subsampling_fd(self): nt = 19 grid = Grid(shape=(11, 11)) x, y = grid.dimensions time = grid.time_dim factor = 4 time_subsampled = ConditionalDimension('t_sub', parent=time, factor=factor) usave = TimeFunction(name='usave', grid=grid, save=(nt+factor-1)//factor, time_dim=time_subsampled, time_order=2) dx2 = [indexify(i) for i in retrieve_functions(usave.dt2.evaluate)] assert dx2 == [usave[time_subsampled - 1, x, y], usave[time_subsampled + 1, x, y], usave[time_subsampled, x, y]] def test_issue_1592(self): grid = Grid(shape=(11, 11)) time = grid.time_dim time_sub = ConditionalDimension('t_sub', parent=time, factor=2) v = TimeFunction(name="v", grid=grid, space_order=4, time_dim=time_sub, save=5) w = Function(name="w", grid=grid, space_order=4) Operator(Eq(w, v.dx))(time=6) op = Operator(Eq(v.forward, v.dx)) op.apply(time=6) exprs = FindNodes(Expression).visit(op) assert exprs[-1].expr.lhs.indices[0] == IntDiv(time, 2) + 1 def test_subsampled_fd(self): """ Test that the FD shortcuts are handled correctly with ConditionalDimensions """ grid = Grid(shape=(11, 11)) time = grid.time_dim # Creates subsampled spatial dimensions and accordine grid dims = tuple([ConditionalDimension(d.name+'sub', parent=d, factor=2) for d in grid.dimensions]) grid2 = Grid((6, 6), dimensions=dims, time_dimension=time) u2 = TimeFunction(name='u2', grid=grid2, space_order=2, time_order=1) u2.data.fill(2.) eqns = [Eq(u2.forward, u2.dx + u2.dy)] op = Operator(eqns) op.apply(time_M=0, x_M=11, y_M=11) # Verify that u2 contains subsampled fd values assert np.all(u2.data[0, :, :] == 2.) assert np.all(u2.data[1, 0, 0] == 0.) assert np.all(u2.data[1, -1, -1] == -20.) assert np.all(u2.data[1, 0, -1] == -10.) assert np.all(u2.data[1, -1, 0] == -10.) assert np.all(u2.data[1, 1:-1, 0] == 0.) assert np.all(u2.data[1, 0, 1:-1] == 0.) assert np.all(u2.data[1, 1:-1, -1] == -10.) assert np.all(u2.data[1, -1, 1:-1] == -10.) assert np.all(u2.data[1, 1:4, 1:4] == 0.) # This test generates an openmp loop form which makes older gccs upset @switchconfig(openmp=False) def test_nothing_in_negative(self): """Test the case where when the condition is false, there is nothing to do.""" nt = 4 grid = Grid(shape=(11, 11)) time = grid.time_dim u = TimeFunction(name='u', save=nt, grid=grid) assert(grid.time_dim in u.indices) factor = 4 time_subsampled = ConditionalDimension('t_sub', parent=time, factor=factor) usave = TimeFunction(name='usave', grid=grid, save=(nt+factor-1)//factor, time_dim=time_subsampled) assert(time_subsampled in usave.indices) eqns = [Eq(usave, u)] op = Operator(eqns) u.data[:] = 1.0 usave.data[:] = 0.0 op.apply(time_m=1, time_M=1) assert np.allclose(usave.data, 0.0) op.apply(time_m=0, time_M=0) assert np.allclose(usave.data, 1.0) def test_laplace(self): grid = Grid(shape=(20, 20, 20)) x, y, z = grid.dimensions time = grid.time_dim t = grid.stepping_dim tsave = ConditionalDimension(name='tsave', parent=time, factor=2) u = TimeFunction(name='u', grid=grid, save=None, time_order=2) usave = TimeFunction(name='usave', grid=grid, time_dim=tsave, time_order=0, space_order=0) steps = [] # save of snapshot steps.append(Eq(usave, u)) # standard laplace-like thing steps.append(Eq(u[t+1, x, y, z], u[t, x, y, z] - u[t-1, x, y, z] + u[t, x-1, y, z] + u[t, x+1, y, z] + u[t, x, y-1, z] + u[t, x, y+1, z] + u[t, x, y, z-1] + u[t, x, y, z+1])) op = Operator(steps) u.data[:] = 0.0 u.data[0, 10, 10, 10] = 1.0 op.apply(time_m=0, time_M=0) assert np.sum(u.data[0, :, :, :]) == 1.0 assert np.sum(u.data[1, :, :, :]) == 7.0 assert np.all(usave.data[0, :, :, :] == u.data[0, :, :, :]) def test_as_expr(self): nt = 19 grid = Grid(shape=(11, 11)) time = grid.time_dim u = TimeFunction(name='u', grid=grid) assert(grid.stepping_dim in u.indices) u2 = TimeFunction(name='u2', grid=grid, save=nt) assert(time in u2.indices) factor = 4 time_subsampled = ConditionalDimension('t_sub', parent=time, factor=factor) usave = TimeFunction(name='usave', grid=grid, save=(nt+factor-1)//factor, time_dim=time_subsampled) assert(time_subsampled in usave.indices) eqns = [Eq(u.forward, u + 1.), Eq(u2.forward, u2 + 1.), Eq(usave, time_subsampled * u)] op = Operator(eqns) op.apply(t=nt-2) assert np.all(np.allclose(u.data[(nt-1) % 3], nt-1)) assert np.all([np.allclose(u2.data[i], i) for i in range(nt)]) assert np.all([np.allclose(usave.data[i], i*factor*i) for i in range((nt+factor-1)//factor)]) def test_shifted(self): nt = 19 grid = Grid(shape=(11, 11)) time = grid.time_dim u = TimeFunction(name='u', grid=grid) assert(grid.stepping_dim in u.indices) u2 = TimeFunction(name='u2', grid=grid, save=nt) assert(time in u2.indices) factor = 4 time_subsampled = ConditionalDimension('t_sub', parent=time, factor=factor) usave = TimeFunction(name='usave', grid=grid, save=2, time_dim=time_subsampled) assert(time_subsampled in usave.indices) t_sub_shift = Constant(name='t_sub_shift', dtype=np.int32) eqns = [Eq(u.forward, u + 1.), Eq(u2.forward, u2 + 1.), Eq(usave.subs(time_subsampled, time_subsampled - t_sub_shift), u)] op = Operator(eqns) # Starting at time_m=10, so time_subsampled - t_sub_shift is in range op.apply(time_m=10, time_M=nt-2, t_sub_shift=3) assert np.all(np.allclose(u.data[0], 8)) assert np.all([np.allclose(u2.data[i], i - 10) for i in range(10, nt)]) assert np.all([np.allclose(usave.data[i], 2+i*factor) for i in range(2)]) def test_no_index(self): """Test behaviour when the ConditionalDimension is used as a symbol in an expression.""" nt = 19 grid = Grid(shape=(11, 11)) time = grid.time_dim u = TimeFunction(name='u', grid=grid) assert(grid.stepping_dim in u.indices) v = Function(name='v', grid=grid) factor = 4 time_subsampled = ConditionalDimension('t_sub', parent=time, factor=factor) eqns = [Eq(u.forward, u + 1), Eq(v, v + u*u*time_subsampled)] op = Operator(eqns) op.apply(t_M=nt-2) assert np.all(np.allclose(u.data[(nt-1) % 3], nt-1)) # expected result is 1024 # v = u[0]**2 * 0 + u[4]**2 * 1 + u[8]**2 * 2 + u[12]**2 * 3 + u[16]**2 * 4 # with u[t] = t # v = 16 * 1 + 64 * 2 + 144 * 3 + 256 * 4 = 1600 assert np.all(np.allclose(v.data, 1600)) def test_no_index_sparse(self): """Test behaviour when the ConditionalDimension is used as a symbol in an expression over sparse data objects.""" grid = Grid(shape=(4, 4), extent=(3.0, 3.0)) time = grid.time_dim f = TimeFunction(name='f', grid=grid, save=1) f.data[:] = 0. coordinates = [(0.5, 0.5), (0.5, 2.5), (2.5, 0.5), (2.5, 2.5)] sf = SparseFunction(name='sf', grid=grid, npoint=4, coordinates=coordinates) sf.data[:] = 1. sd = sf.dimensions[sf._sparse_position] # We want to write to `f` through `sf` so that we obtain the # following 4x4 grid (the '*' show the position of the sparse points) # We do that by emulating an injection # # 0 --- 0 --- 0 --- 0 # | * | | * | # 0 --- 1 --- 1 --- 0 # | | | | # 0 --- 1 --- 1 --- 0 # | * | | * | # 0 --- 0 --- 0 --- 0 radius = 1 indices = [(i, i+radius) for i in sf._coordinate_indices] bounds = [i.symbolic_size - radius for i in grid.dimensions] eqs = [] for e, i in enumerate(product(*indices)): args = [j > 0 for j in i] args.extend([j < k for j, k in zip(i, bounds)]) condition = And(*args, evaluate=False) cd = ConditionalDimension('sfc%d' % e, parent=sd, condition=condition) index = [time] + list(i) eqs.append(Eq(f[index], f[index] + sf[cd])) op = Operator(eqs) op.apply(time=0) assert np.all(f.data[0, 1:-1, 1:-1] == 1.) assert np.all(f.data[0, 0] == 0.) assert np.all(f.data[0, -1] == 0.) assert np.all(f.data[0, :, 0] == 0.) assert np.all(f.data[0, :, -1] == 0.) def test_symbolic_factor(self): """ Test ConditionalDimension with symbolic factor (provided as a Constant). """ g = Grid(shape=(4, 4, 4)) u = TimeFunction(name='u', grid=g, time_order=0) fact = Constant(name='fact', dtype=np.int32, value=4) tsub = ConditionalDimension(name='tsub', parent=g.time_dim, factor=fact) usave = TimeFunction(name='usave', grid=g, time_dim=tsub, save=4) op = Operator([Eq(u, u + 1), Eq(usave, u)]) op.apply(time=7) # Use `fact`'s default value, 4 assert np.all(usave.data[0] == 1) assert np.all(usave.data[1] == 5) u.data[:] = 0. op.apply(time=7, fact=2) assert np.all(usave.data[0] == 1) assert np.all(usave.data[1] == 3) assert np.all(usave.data[2] == 5) assert np.all(usave.data[3] == 7) def test_implicit_dims(self): """ Test ConditionalDimension as an implicit dimension for an equation. """ # This test makes an Operator that should create a vector of increasing # integers, but stop incrementing when a certain stop value is reached shape = (50,) stop_value = 20 time = Dimension(name='time') f = TimeFunction(name='f', shape=shape, dimensions=[time]) # The condition to stop incrementing cond = ConditionalDimension(name='cond', parent=time, condition=f[time] < stop_value) eqs = [Eq(f.forward, f), Eq(f.forward, f.forward + 1, implicit_dims=[cond])] op = Operator(eqs) op.apply(time_M=shape[0] - 2) # Make the same calculation in python to assert the result F = np.zeros(shape[0]) for i in range(shape[0]): F[i] = i if i < stop_value else stop_value assert np.all(f.data == F) def test_grouping(self): """ Test that Clusters over the same set of ConditionalDimensions fall within the same Conditional. This is a follow up to issue #1610. """ grid = Grid(shape=(10, 10)) time = grid.time_dim cond = ConditionalDimension(name='cond', parent=time, condition=time < 5) u = TimeFunction(name='u', grid=grid, space_order=4) # We use a SubDomain only to keep the two Eqs separated eqns = [Eq(u.forward, u + 1, subdomain=grid.interior), Eq(u.forward, u.dx.dx + 1., implicit_dims=[cond])] op = Operator(eqns, opt=('advanced-fsg', {'cire-mincost-sops': 1})) conds = FindNodes(Conditional).visit(op) assert len(conds) == 1 assert len(retrieve_iteration_tree(conds[0].then_body)) == 2 def test_stepping_dim_in_condition_lowering(self): """ Check that the compiler performs lowering on conditions with TimeDimensions and generates the expected code:: if (g[t][x + 1][y + 1] <= 10){ if (g[t0][x + 1][y + 1] <= 10){ ... --> ... } } This test increments a function by one at every timestep until it is less-or-equal to 10 (g<=10) while although operator runs for 13 timesteps. """ grid = Grid(shape=(4, 4)) _, y = grid.dimensions ths = 10 g = TimeFunction(name='g', grid=grid) ci = ConditionalDimension(name='ci', parent=y, condition=Le(g, ths)) op = Operator(Eq(g.forward, g + 1, implicit_dims=ci)) op.apply(time_M=ths+3) assert np.all(g.data[0, :, :] == ths) assert np.all(g.data[1, :, :] == ths + 1) assert 'if (g[t0][x + 1][y + 1] <= 10)\n' '{\n g[t1][x + 1][y + 1] = g[t0][x + 1][y + 1] + 1' in str(op.ccode) def test_expr_like_lowering(self): """ Test the lowering of an expr-like ConditionalDimension's condition. This test makes an Operator that should indexify and lower the condition passed in the Conditional Dimension """ grid = Grid(shape=(3, 3)) g1 = Function(name='g1', grid=grid) g2 = Function(name='g2', grid=grid) g1.data[:] = 0.49 g2.data[:] = 0.49 x, y = grid.dimensions ci = ConditionalDimension(name='ci', parent=y, condition=Le((g1 + g2), 1.01*(g1 + g2))) f = Function(name='f', shape=grid.shape, dimensions=(x, ci)) Operator(Eq(f, g1+g2)).apply() assert np.all(f.data[:] == g1.data[:] + g2.data[:]) @pytest.mark.parametrize('setup_rel, rhs, c1, c2, c3, c4', [ # Relation, RHS, c1 to c4 used as indexes in assert (Lt, 3, 2, 4, 4, -1), (Le, 2, 2, 4, 4, -1), (Ge, 3, 4, 6, 1, 4), (Gt, 2, 4, 6, 1, 4), (Ne, 5, 2, 6, 1, 2) ]) def test_relational_classes(self, setup_rel, rhs, c1, c2, c3, c4): """ Test ConditionalDimension using conditions based on Relations over SubDomains. """ class InnerDomain(SubDomain): name = 'inner' def define(self, dimensions): return {d: ('middle', 2, 2) for d in dimensions} inner_domain = InnerDomain() grid = Grid(shape=(8, 8), subdomains=(inner_domain,)) g = Function(name='g', grid=grid) g2 = Function(name='g2', grid=grid) for i in [g, g2]: i.data[:4, :4] = 1 i.data[4:, :4] = 2 i.data[4:, 4:] = 3 i.data[:4, 4:] = 4 xi, yi = grid.subdomains['inner'].dimensions cond = setup_rel(0.25*g + 0.75*g2, rhs, subdomain=grid.subdomains['inner']) ci = ConditionalDimension(name='ci', parent=yi, condition=cond) f = Function(name='f', shape=grid.shape, dimensions=(xi, ci)) eq1 = Eq(f, 0.4*g + 0.6*g2) eq2 = Eq(f, 5) Operator([eq1, eq2]).apply() assert np.all(f.data[2:6, c1:c2] == 5.) assert np.all(f.data[:, c3:c4] < 5.) def test_from_cond_to_param(self): """ Test that Functions appearing in the condition of a ConditionalDimension but not explicitly in an Eq are actually part of the Operator input (stems from issue #1298). """ grid = Grid(shape=(8, 8)) x, y = grid.dimensions g = Function(name='g', grid=grid) h = Function(name='h', grid=grid) ci = ConditionalDimension(name='ci', parent=y, condition=Lt(g, 2 + h)) f = Function(name='f', shape=grid.shape, dimensions=(x, ci)) for _ in range(5): # issue #1298 was non deterministic Operator(Eq(f, 5)).apply() @skipif('device') def test_no_fusion_simple(self): """ If ConditionalDimensions are present, then Clusters must not be fused so that ultimately Eqs get scheduled to different loop nests. """ grid = Grid(shape=(4, 4, 4)) time = grid.time_dim f = TimeFunction(name='f', grid=grid) g = Function(name='g', grid=grid) h = Function(name='h', grid=grid) # No ConditionalDimensions yet. Will be fused and optimized eqns = [Eq(f.forward, f + 1), Eq(h, f + 1), Eq(g, f + 1)] op = Operator(eqns) exprs = FindNodes(Expression).visit(op._func_table['bf0'].root) assert len(exprs) == 4 assert exprs[1].expr.rhs is exprs[0].output assert exprs[2].expr.rhs is exprs[0].output assert exprs[3].expr.rhs is exprs[0].output # Now with a ConditionalDimension. No fusion, no optimization ctime = ConditionalDimension(name='ctime', parent=time, condition=time > 4) eqns = [Eq(f.forward, f + 1), Eq(h, f + 1), Eq(g, f + 1, implicit_dims=[ctime])] op = Operator(eqns) exprs = FindNodes(Expression).visit(op._func_table['bf0'].root) assert len(exprs) == 3 assert exprs[1].expr.rhs is exprs[0].output assert exprs[2].expr.rhs is exprs[0].output exprs = FindNodes(Expression).visit(op._func_table['bf1'].root) assert len(exprs) == 1 @skipif('device') def test_no_fusion_convoluted(self): """ Conceptually like `test_no_fusion_simple`, but with more expressions and non-trivial data flow. """ grid = Grid(shape=(4, 4, 4)) time = grid.time_dim f = TimeFunction(name='f', grid=grid) g = Function(name='g', grid=grid) h = Function(name='h', grid=grid) ctime = ConditionalDimension(name='ctime', parent=time, condition=time > 4) eqns = [Eq(f.forward, f + 1), Eq(h, f + 1), Eq(g, f + 1, implicit_dims=[ctime]), Eq(f.forward, f + 1, implicit_dims=[ctime]), Eq(f.forward, f + 1), Eq(g, f + 1)] op = Operator(eqns) exprs = FindNodes(Expression).visit(op._func_table['bf0'].root) assert len(exprs) == 3 assert exprs[1].expr.rhs is exprs[0].output assert exprs[2].expr.rhs is exprs[0].output exprs = FindNodes(Expression).visit(op._func_table['bf1'].root) assert len(exprs) == 3 exprs = FindNodes(Expression).visit(op._func_table['bf2'].root) assert len(exprs) == 3 assert exprs[1].expr.rhs is exprs[0].output assert exprs[2].expr.rhs is exprs[0].output def test_affiness(self): """ Test for issue #1616. """ nt = 19 grid = Grid(shape=(11, 11)) time = grid.time_dim factor = 4 time_subsampled = ConditionalDimension('t_sub', parent=time, factor=factor) u = TimeFunction(name='u', grid=grid) usave = TimeFunction(name='usave', grid=grid, save=(nt+factor-1)//factor, time_dim=time_subsampled) eqns = [Eq(u.forward, u + 1.), Eq(usave, u)] op = Operator(eqns) iterations = [i for i in FindNodes(Iteration).visit(op) if i.dim is not time] assert all(i.is_Affine for i in iterations) class TestMashup(object): """ Check the correct functioning of the compiler in presence of many Dimension types. """ def test_topofusion_w_subdims_conddims(self): """ Check that topological fusion works across guarded Clusters over different iteration spaces and in presence of anti-dependences. This test uses both SubDimensions (via SubDomains) and ConditionalDimensions. """ grid = Grid(shape=(4, 4, 4)) time = grid.time_dim f = TimeFunction(name='f', grid=grid, time_order=2) g = TimeFunction(name='g', grid=grid, time_order=2) h = TimeFunction(name='h', grid=grid, time_order=2) fsave = TimeFunction(name='fsave', grid=grid, time_order=2, save=5) gsave = TimeFunction(name='gsave', grid=grid, time_order=2, save=5) ctime = ConditionalDimension(name='ctime', parent=time, condition=time > 4) eqns = [Eq(f.forward, f + 1), Eq(g.forward, g + 1), Eq(fsave, f.dt2, implicit_dims=[ctime]), Eq(h, f + g, subdomain=grid.interior), Eq(gsave, g.dt2, implicit_dims=[ctime])] op = Operator(eqns) # Check generated code -- expect the gsave equation to be scheduled together # in the same loop nest with the fsave equation assert len(op._func_table) == 3 exprs = FindNodes(Expression).visit(op._func_table['bf0'].root) assert len(exprs) == 2 assert exprs[0].write is f assert exprs[1].write is g exprs = FindNodes(Expression).visit(op._func_table['bf1'].root) assert len(exprs) == 3 assert exprs[1].write is fsave assert exprs[2].write is gsave exprs = FindNodes(Expression).visit(op._func_table['bf2'].root) assert len(exprs) == 1 assert exprs[0].write is h def test_topofusion_w_subdims_conddims_v2(self): """ Like `test_topofusion_w_subdims_conddims` but with more SubDomains, so we expect fewer loop nests. """ grid = Grid(shape=(4, 4, 4)) time = grid.time_dim f = TimeFunction(name='f', grid=grid, time_order=2) g = TimeFunction(name='g', grid=grid, time_order=2) h = TimeFunction(name='h', grid=grid, time_order=2) fsave = TimeFunction(name='fsave', grid=grid, time_order=2, save=5) gsave = TimeFunction(name='gsave', grid=grid, time_order=2, save=5) ctime = ConditionalDimension(name='ctime', parent=time, condition=time > 4) eqns = [Eq(f.forward, f + 1, subdomain=grid.interior), Eq(g.forward, g + 1, subdomain=grid.interior), Eq(fsave, f.dt2, implicit_dims=[ctime]), Eq(h, f + g, subdomain=grid.interior), Eq(gsave, g.dt2, implicit_dims=[ctime])] op = Operator(eqns) # Check generated code -- expect the gsave equation to be scheduled together # in the same loop nest with the fsave equation assert len(op._func_table) == 2 assert len(FindNodes(Expression).visit(op._func_table['bf0'].root)) == 3 assert len(FindNodes(Expression).visit(op._func_table['bf1'].root)) == 2 + 1 # r0 def test_topofusion_w_subdims_conddims_v3(self): """ Like `test_topofusion_w_subdims_conddims_v2` but with an extra anti-dependence, which causes scheduling over more loop nests. """ grid = Grid(shape=(4, 4, 4)) time = grid.time_dim f = TimeFunction(name='f', grid=grid, time_order=2) g = TimeFunction(name='g', grid=grid, time_order=2) h = TimeFunction(name='h', grid=grid, time_order=2) fsave = TimeFunction(name='fsave', grid=grid, time_order=2, save=5) gsave = TimeFunction(name='gsave', grid=grid, time_order=2, save=5) ctime = ConditionalDimension(name='ctime', parent=time, condition=time > 4) eqns = [Eq(f.forward, f + 1, subdomain=grid.interior), Eq(g.forward, g + 1, subdomain=grid.interior), Eq(fsave, f.dt2, implicit_dims=[ctime]), Eq(h, f.dt2.dx + g, subdomain=grid.interior), Eq(gsave, g.dt2, implicit_dims=[ctime])] op = Operator(eqns) # Check generated code -- expect the gsave equation to be scheduled together # in the same loop nest with the fsave equation assert len(op._func_table) == 3 exprs = FindNodes(Expression).visit(op._func_table['bf0'].root) assert len(exprs) == 2 assert exprs[0].write is f assert exprs[1].write is g exprs = FindNodes(Expression).visit(op._func_table['bf1'].root) assert len(exprs) == 3 assert exprs[1].write is fsave assert exprs[2].write is gsave exprs = FindNodes(Expression).visit(op._func_table['bf2'].root) assert len(exprs) == 2 assert exprs[1].write is h
opesci/devito
tests/test_dimension.py
Python
mit
47,982
App.SubPhotoInstance = DS.Model.extend({ width: DS.attr('number'), height: DS.attr('number'), url: DS.attr('string'), type: 'sub_photo_instance' });
Mause/tumblr-ember
src/js/app/models/photo_model/sub_photo_instance_model.js
JavaScript
mit
157
require "sendgrid-parse/version" require "sendgrid-parse/encodable_hash"
robforman/sendgrid-parse
lib/sendgrid-parse.rb
Ruby
mit
73
"""Kytos SDN Platform.""" from pkgutil import extend_path __path__ = extend_path(__path__, __name__)
kytos/kytos-utils
kytos/__init__.py
Python
mit
102
finApp.directive('brief', function () { return { restrict: 'E', templateUrl: 'views/directives/brief.html', controller: 'BriefController', controllerAs: 'bfc' }; });
ferpsanta/FinWallet
app/js/directives/brief.js
JavaScript
mit
185
// // XCPreferenceController.h // XCRegex // // Created by alexiuce  on 2017/6/22. // Copyright © 2017年 zhidier. All rights reserved. // #import <Cocoa/Cocoa.h> @interface XCPreferenceController : NSWindowController @end
Alexiuce/XCRegex
XCRegex/PreferenceController/XCPreferenceController.h
C
mit
237
using OpenTK; using OpenTK.Graphics.OpenGL; namespace p_1 { class Spritebatch { public static void DrawSprite(Texture2D texture, RectangleF rectangle) { DrawSprite(texture, new Vector2(rectangle.X, rectangle.Y), new Vector2(rectangle.Width / texture.Width, rectangle.Height / texture.Height), Color.White, Vector2.Zero); } public static void DrawSprite(Texture2D texture, RectangleF rectangle, Color color, RectangleF? sourceRec = null) { DrawSprite(texture, new Vector2(rectangle.X, rectangle.Y), new Vector2(rectangle.Width / texture.Width, rectangle.Height / texture.Height), color, Vector2.Zero, sourceRec); } public static void DrawSprite(Texture2D texture, Vector2 position) { DrawSprite(texture, position, Vector2.One, Color.White, Vector2.Zero); } public static void DrawSprite(Texture2D texture, Vector2 position, Vector2 scale) { DrawSprite(texture, position, scale, Color.White, Vector2.Zero); } public static void DrawSprite(Texture2D texture, Vector2 position, Vector2 scale, Color color) { DrawSprite(texture, position, scale, color, Vector2.Zero); } public static void DrawSprite(Texture2D texture, Vector2 position, Vector2 scale, Color color, Vector2 origin, RectangleF? sourceRec = null) { Vector2[] verts = new Vector2[4] { new Vector2(0, 0), new Vector2(1, 0), new Vector2(1, 1), new Vector2(0, 1), }; GL.BindTexture(TextureTarget.Texture2D, texture.ID); GL.Begin(PrimitiveType.Quads); for (int i = 0; i < 4; i++) { GL.Color3(color); if (sourceRec == null) { GL.TexCoord2(verts[i].X, verts[i].Y); } else { GL.TexCoord2( (sourceRec.Value.X + verts[i].X * sourceRec.Value.Width) / (float)texture.Width, (sourceRec.Value.Y + verts[i].Y * sourceRec.Value.Height) / (float)texture.Height); } verts[i].X *= texture.Width; verts[i].Y *= texture.Height; verts[i] -= origin; verts[i] *= scale; verts[i] += position; GL.Vertex2(verts[i]); } GL.End(); } public static void Begin(GameWindow window) { GL.MatrixMode(MatrixMode.Projection); GL.LoadIdentity(); GL.Ortho(-window.ClientSize.Width / 2f, window.ClientSize.Width / 2f, window.ClientSize.Height / 2f, -window.ClientSize.Height / 2f, 0, 1); } } }
doshaq/Dosha_Engine
SpriteBatch.cs
C#
mit
2,305
describe("grid-columns", function() { function createSuite(buffered) { describe(buffered ? "with buffered rendering" : "without buffered rendering", function() { var defaultColNum = 4, totalWidth = 1000, grid, view, colRef, store, column; function spyOnEvent(object, eventName, fn) { var obj = { fn: fn || Ext.emptyFn }, spy = spyOn(obj, "fn"); object.addListener(eventName, obj.fn); return spy; } function makeGrid(numCols, gridCfg, hiddenFn, lockedFn){ var cols, col, i; gridCfg = gridCfg || {}; colRef = []; if (!numCols || typeof numCols === 'number') { cols = []; numCols = numCols || defaultColNum; for (i = 0; i < numCols; ++i) { col = { itemId: 'col' + i, text: 'Col' + i, dataIndex: 'field' + i }; if (hiddenFn && hiddenFn(i)) { col.hidden = true; } if (lockedFn && lockedFn(i)) { col.locked = true; } col = new Ext.grid.column.Column(col); cols.push(col); } } else { cols = numCols; } store = new Ext.data.Store({ model: spec.TestModel, data: [{ field0: 'val1', field1: 'val2', field2: 'val3', field3: 'val4', field4: 'val5' }] }); grid = new Ext.grid.Panel(Ext.apply({ renderTo: Ext.getBody(), columns: cols, width: totalWidth, height: 500, border: false, store: store, bufferedRenderer: buffered, viewConfig: { mouseOverOutBuffer: 0 } }, gridCfg)); view = grid.view; colRef = grid.getColumnManager().getColumns(); } function getCell(rowIdx, colIdx) { return grid.getView().getCellInclusive({ row: rowIdx, column: colIdx }); } function getCellText(rowIdx, colIdx) { return getCellInner(rowIdx, colIdx).innerHTML; } function getCellInner(rowIdx, colIdx) { var cell = getCell(rowIdx, colIdx); return Ext.fly(cell).down(grid.getView().innerSelector).dom; } function hasCls(el, cls) { return Ext.fly(el).hasCls(cls); } function clickHeader(col) { // Offset so we're not on the edges to trigger a drag jasmine.fireMouseEvent(col.titleEl, 'click', 10); } function resizeColumn(column, by) { var colBox = column.el.getBox(), fromMx = colBox.x + colBox.width - 2, fromMy = colBox.y + colBox.height / 2, dragThresh = by > 0 ? Ext.dd.DragDropManager.clickPixelThresh + 1 : -Ext.dd.DragDropManager.clickPixelThresh - 1; // Mousedown on the header to drag jasmine.fireMouseEvent(column.el.dom, 'mouseover', fromMx, fromMy); jasmine.fireMouseEvent(column.el.dom, 'mousemove', fromMx, fromMy); jasmine.fireMouseEvent(column.el.dom, 'mousedown', fromMx, fromMy); // The initial move which tiggers the start of the drag jasmine.fireMouseEvent(column.el.dom, 'mousemove', fromMx + dragThresh, fromMy); // Move to resize jasmine.fireMouseEvent(column.el.dom, 'mousemove', fromMx + by + 2, fromMy); jasmine.fireMouseEvent(column.el.dom, 'mouseup', fromMx + by + 2, fromMy); } function setup() { Ext.define('spec.TestModel', { extend: 'Ext.data.Model', fields: ['field0', 'field1', 'field2', 'field3', 'field4'] }); } function tearDown() { Ext.destroy(grid, store, column); grid = view = store = colRef = column = null; Ext.undefine('spec.TestModel'); Ext.data.Model.schema.clear(); } beforeEach(setup); afterEach(tearDown); // https://sencha.jira.com/browse/EXTJS-19950 describe('force fit columns, shrinking width to where flexes tend to zero', function() { it('should work', function() { makeGrid([{ text : 'Col1', dataIndex : 'foo', flex : 1 }, { text : 'Col2', columns : [{ text : 'Col21', dataIndex : 'foo2', width: 140 }, { text : 'Col22', dataIndex : 'foo4', width : 160 }, { text : 'Col23', dataIndex : 'foo4', width : 100 }, { text : 'Col34', dataIndex : 'foo4', width : 85 }] }, { text : 'Col3', dataIndex : 'foo3', width : 110 }, { text : 'Col4', columns : [ { text : 'Col41', dataIndex : 'foo2', flex: 1 }, { text : 'Col42', dataIndex : 'foo4', width : 120 }] }], { autoScroll: true, forceFit: true, width: 1800 }); expect(function() { grid.setWidth(700); }).not.toThrow(); }); }); describe('as containers', function () { var leafCls = 'x-leaf-column-header', col; afterEach(function () { col = null; }); describe('group headers', function () { beforeEach(function () { makeGrid([{ itemId: 'main1', columns: [{ itemId: 'child1' }, { itemId: 'child2' }, { itemId: 'child3' }] }]); col = grid.down('#main1'); }); it('should be stamped as a container', function () { expect(col.isContainer).toBe(true); }); it('should not give the titleEl the leaf column class', function () { expect(col.titleEl.hasCls(leafCls)).toBe(false); }); }); describe('contains child items', function () { beforeEach(function () { makeGrid([{ text: 'Foo', dataIndex: 'field0', items: [{ xtype: 'textfield', itemId: 'foo' }] }]); col = grid.visibleColumnManager.getHeaderByDataIndex('field0'); }); it('should be stamped as a container', function () { expect(col.isContainer).toBe(true); }); it('should not give the titleEl the leaf column class', function () { expect(col.titleEl.hasCls(leafCls)).toBe(false); }); describe('focusing', function () { // See EXTJS-15757. it('should not throw when focusing', function () { expect(function () { grid.down('#foo').onFocus(); }).not.toThrow(); }); it('should return the items collection', function () { var col = grid.visibleColumnManager.getHeaderByDataIndex('field0'); expect(col.getFocusables()).toBe(col.items.items); }); }); }); }); describe("cell sizing", function() { it("should size the cells to match fixed header sizes", function() { makeGrid([{ width: 200 }, { width: 500 }]); expect(getCell(0, 0).getWidth()).toBe(200); expect(getCell(0, 1).getWidth()).toBe(500); }); it("should size the cells to match flex header sizes", function() { makeGrid([{ flex: 8 }, { flex: 2 }]); expect(getCell(0, 0).getWidth()).toBe(800); expect(getCell(0, 1).getWidth()).toBe(200); }); it("should size the cells to match an the text size in the header", function() { makeGrid([{ width: null, text: '<div style="width: 25px;"></div>' }, { width: null, text: '<div style="width: 75px;"></div>' }]); expect(getCell(0, 0).getWidth()).toBe(colRef[0].titleEl.getWidth() + colRef[0].el.getBorderWidth('lr')); expect(getCell(0, 1).getWidth()).toBe(colRef[1].titleEl.getWidth() + colRef[1].el.getBorderWidth('lr')); }); }); describe("initializing", function() { describe("normal", function() { it("should accept a column array", function() { makeGrid([{ text: 'Foo', dataIndex: 'field0' }]); expect(grid.getColumnManager().getHeaderAtIndex(0).text).toBe('Foo'); }); it("should accept a header config", function() { makeGrid({ margin: 5, items: [{ text: 'Foo', dataIndex: 'field0' }] }); expect(grid.getColumnManager().getHeaderAtIndex(0).text).toBe('Foo'); expect(grid.headerCt.margin).toBe(5); }); }); describe("locking", function() { it("should accept a column array, enabling locking if a column is configured with locked: true", function() { makeGrid([{ text: 'Foo', dataIndex: 'field0', locked: true }, { text: 'Bar', dataIndex: 'field1' }]); expect(grid.lockable).toBe(true); }); it("should accept a header config, enabling locking if any column is configured with locked: true", function() { makeGrid({ items: [{ text: 'Foo', dataIndex: 'field0', locked: true }, { text: 'Bar', dataIndex: 'field1' }] }); expect(grid.lockable).toBe(true); // Top level grid should return columns from both sides expect(grid.getVisibleColumns().length).toBe(2); expect(grid.getColumns().length).toBe(2); }); }); }); describe("column manager", function() { // Get all columns from the grid ref function ga() { return grid.getColumnManager().getColumns(); } // Get all manager function gam() { return grid.getColumnManager(); } // Get all visible columns from the grid ref function gv() { return grid.getVisibleColumnManager().getColumns(); } // Get visible manager function gvm() { return grid.getVisibleColumnManager(); } it("should provide a getColumnManager method", function(){ makeGrid(); expect(gam().$className).toBe('Ext.grid.ColumnManager'); }); it("should provide a getVisibleColumnManager method", function(){ makeGrid(); expect(gvm().$className).toBe('Ext.grid.ColumnManager'); }); describe("simple grid", function(){ beforeEach(function(){ makeGrid(); }); it("should return all leaf columns", function() { expect(gv().length).toBe(defaultColNum); }); it("should have the correct column order", function(){ var cols = gv(), i = 0, len = cols.length; for (; i < len; ++i) { expect(cols[i]).toBe(colRef[i]); } }); it("should update the order when moving columns", function(){ grid.headerCt.move(3, 1); var cols = gv(); expect(cols[0]).toBe(colRef[0]); expect(cols[1]).toBe(colRef[3]); expect(cols[2]).toBe(colRef[1]); expect(cols[3]).toBe(colRef[2]); }); it("should update the columns when removing a column", function(){ grid.headerCt.remove(1); var cols = gv(); expect(cols[0]).toBe(colRef[0]); expect(cols[1]).toBe(colRef[2]); expect(cols[2]).toBe(colRef[3]); }); it("should update the columns when adding a column", function(){ grid.headerCt.add({ text: 'Col4' }); expect(gv()[4].text).toBe('Col4'); }); describe("functions", function() { describe("getHeaderIndex", function() { it("should return the correct index for the header", function() { expect(gam().getHeaderIndex(colRef[3])).toBe(3); }); it("should return -1 if the column doesn't exist", function(){ column = new Ext.grid.column.Column(); expect(gam().getHeaderIndex(column)).toBe(-1); }); }); describe("getHeaderAtIndex", function(){ it("should return the column reference", function(){ expect(gam().getHeaderAtIndex(2)).toBe(colRef[2]); }); it("should return null if the index is out of bounds", function(){ expect(gam().getHeaderAtIndex(10)).toBeNull(); }); }); describe("getHeaderById", function(){ it("should return the column reference by id", function(){ expect(gam().getHeaderById('col1')).toBe(colRef[1]); }); it("should return null if the id doesn't exist", function() { expect(gam().getHeaderById('foo')).toBeNull(); }); }); it("should return the first item", function(){ expect(gam().getFirst()).toBe(colRef[0]); }); it("should return the last item", function(){ expect(gam().getLast()).toBe(colRef[3]); }); describe("getNextSibling", function(){ it("should return the next sibling", function(){ expect(gam().getNextSibling(colRef[1])).toBe(colRef[2]); }); it("should return the null if the next sibling doesn't exist", function(){ expect(gam().getNextSibling(colRef[3])).toBeNull(); }); }); describe("getPreviousSibling", function(){ it("should return the previous sibling", function(){ expect(gam().getPreviousSibling(colRef[2])).toBe(colRef[1]); }); it("should return the null if the previous sibling doesn't exist", function(){ expect(gam().getPreviousSibling(colRef[0])).toBeNull(); }); }); }); }); describe('getHeaderIndex', function () { var index, headerCtItems; beforeEach(function () { makeGrid([{ text: 'Name', width: 100, dataIndex: 'name', hidden: true },{ text: 'Email', width: 100, dataIndex: 'email' }, { text: 'Stock Price', columns: [{ text: 'Price', width: 75, dataIndex: 'price' }, { text: 'Phone', width: 80, dataIndex: 'phone', hidden: true }, { text: '% Change', width: 40, dataIndex: 'pctChange' }] }, { text: 'Foo', columns: [{ text: 'Foo Price', width: 75, dataIndex: 'price', hidden: true }, { text: 'Foo Phone', width: 80, dataIndex: 'phone' }, { text: 'Foo % Change', width: 40, dataIndex: 'pctChange' }] }]); headerCtItems = grid.headerCt.items; }); afterEach(function () { index = headerCtItems = null; }); describe('all columns', function () { describe('when argument is a column', function () { it('should return a valid index', function () { index = gam().getHeaderIndex(headerCtItems.items[0]); expect(index).not.toBe(-1); expect(index).toBe(0); }); it('should return the header regardless of visibility', function () { var header; header = headerCtItems.items[0]; index = gam().getHeaderIndex(header); expect(header.hidden).toBe(true); expect(index).toBe(0); }); it('should return the index of the header in its owner stack - rootHeader', function () { index = gam().getHeaderIndex(headerCtItems.items[3].items.items[0]); expect(index).toBe(5); }); it('should return the index of the header in its owner stack - groupHeader', function () { // Note that this spec is using the same header as the previous spec to demonstrate the difference. var groupHeader = headerCtItems.items[3]; index = groupHeader.columnManager.getHeaderIndex(groupHeader.items.items[0]); expect(index).toBe(0); }); }); describe('when argument is a group header', function () { it('should return a valid index', function () { index = gam().getHeaderIndex(headerCtItems.items[2]); expect(index).not.toBe(-1); expect(index).toBe(2); }); it('should return an index of the first leaf of group header', function () { var colMgrHeader; // First, get the index from the column mgr. It will retrieve it from the group header's column mgr. index = gam().getHeaderIndex(headerCtItems.items[2]); // Next, get a reference to the actual header (top-level col mgr will have a ref to all sub-level headers). colMgrHeader = gam().getHeaderAtIndex(index); // Remember, this is the index of the root header's visible col mgr. expect(index).toBe(2); expect(colMgrHeader.hidden).toBe(false); expect(colMgrHeader.dataIndex).toBe('price'); }); it("should be a reference to the first leaf header in the grouped header's columnn manager", function () { var groupedHeader, colMgrHeader, groupHeaderFirstHeader; groupedHeader = headerCtItems.items[2]; groupHeaderFirstHeader = groupedHeader.columnManager.getHeaderAtIndex(0); // First, get the index from the column mgr. It will retrieve it from the group header's column mgr. index = gam().getHeaderIndex(groupedHeader); // Next, get a reference to the actual header (top-level col mgr will have a ref to all sub-level headers). colMgrHeader = gam().getHeaderAtIndex(index); expect(colMgrHeader).toBe(groupHeaderFirstHeader); expect(colMgrHeader.hidden).toBe(groupHeaderFirstHeader.hidden); expect(colMgrHeader.dataIndex).toBe(groupHeaderFirstHeader.dataIndex); }); it('should return first sub-header regardless of visibility', function () { var groupedHeader, colMgrHeader, groupHeaderFirstHeader; groupedHeader = headerCtItems.items[3]; groupHeaderFirstHeader = groupedHeader.columnManager.getHeaderAtIndex(0); // First, get the index from the column mgr. It will retrieve it from the group header's column mgr. index = gam().getHeaderIndex(groupedHeader); // Next, get a reference to the actual header (top-level col mgr will have a ref to all sub-level headers). colMgrHeader = gam().getHeaderAtIndex(index); expect(colMgrHeader).toBe(groupHeaderFirstHeader); expect(colMgrHeader.hidden).toBe(true); expect(colMgrHeader.text).toBe('Foo Price'); }); }); }); describe('visible only', function () { describe('when argument is a column', function () { it('should return the correct index for the header', function() { expect(gvm().getHeaderIndex(headerCtItems.items[1])).toBe(0); }); it("should return -1 if the column doesn't exist", function() { column = new Ext.grid.column.Column(); expect(gvm().getHeaderIndex(column)).toBe(-1); }); it('should not return a hidden sub-header', function () { var header; header = headerCtItems.items[0]; index = gvm().getHeaderIndex(header); expect(header.hidden).toBe(true); expect(index).toBe(-1); }); it('should return a valid index', function () { index = gvm().getHeaderIndex(headerCtItems.items[1]); expect(index).not.toBe(-1); // Will filter out the first hidden column in the stack. expect(index).toBe(0); }); it('should return the index of the header in its owner stack - rootHeader', function () { index = gvm().getHeaderIndex(headerCtItems.items[3].items.items[2]); expect(index).toBe(4); }); it('should return the index of the header in its owner stack - groupHeader', function () { // Note that this spec is using the same header as the previous spec to demonstrate the difference. var groupHeader = headerCtItems.items[3]; index = groupHeader.visibleColumnManager.getHeaderIndex(groupHeader.items.items[2]); expect(index).toBe(1); }); }); describe('when argument is a group header', function () { it('should return a valid index', function () { index = gvm().getHeaderIndex(headerCtItems.items[2]); expect(index).not.toBe(-1); // Will filter out the second hidden column in the stack. expect(index).toBe(1); }); it('should return an index of the first leaf of group header', function () { var colMgrHeader; // First, get the index from the column mgr. It will retrieve it from the group header's column mgr. index = gvm().getHeaderIndex(headerCtItems.items[2]); // Next, get a reference to the actual header (top-level col mgr will have a ref to all sub-level headers). colMgrHeader = gvm().getHeaderAtIndex(index); // Remember, this is the index of the root header's visible col mgr. expect(index).toBe(1); expect(colMgrHeader.hidden).toBe(false); expect(colMgrHeader.dataIndex).toBe('price'); }); it("should be a reference to the first leaf header in the grouped header's columnn manager", function () { var groupedHeader, colMgrHeader, groupHeaderFirstHeader; groupedHeader = headerCtItems.items[2]; groupHeaderFirstHeader = headerCtItems.items[2].visibleColumnManager.getHeaderAtIndex(0); // First, get the index from the column mgr. It will retrieve it from the group header's column mgr. index = gvm().getHeaderIndex(groupedHeader); // Next, get a reference to the actual header (top-level col mgr will have a ref to all sub-level headers). colMgrHeader = gvm().getHeaderAtIndex(index); expect(colMgrHeader).toBe(groupHeaderFirstHeader); expect(colMgrHeader.hidden).toBe(groupHeaderFirstHeader.hidden); expect(colMgrHeader.dataIndex).toBe(groupHeaderFirstHeader.dataIndex); }); it('should not return a hidden sub-header', function () { var groupedHeader, colMgrHeader, groupHeaderFirstHeader; groupedHeader = headerCtItems.items[3]; groupHeaderFirstHeader = groupedHeader.visibleColumnManager.getHeaderAtIndex(0); // First, get the index from the column mgr. It will retrieve it from the group header's column mgr. index = gvm().getHeaderIndex(groupedHeader); // Next, get a reference to the actual header (top-level col mgr will have a ref to all sub-level headers). colMgrHeader = gvm().getHeaderAtIndex(index); expect(colMgrHeader).toBe(groupHeaderFirstHeader); expect(colMgrHeader.hidden).toBe(false); expect(colMgrHeader.text).toBe('Foo Phone'); }); }); }); }); describe('getHeaderAtIndex', function () { var header, headerCtItems; beforeEach(function () { makeGrid([{ text: 'Name', width: 100, dataIndex: 'name', hidden: true },{ text: 'Email', width: 100, dataIndex: 'email' }, { text: 'Stock Price', columns: [{ text: 'Price', width: 75, dataIndex: 'price' }, { text: 'Phone', width: 80, dataIndex: 'phone', hidden: true }, { text: '% Change', width: 40, dataIndex: 'pctChange' }] }, { text: 'Foo', columns: [{ text: 'Foo Price', width: 75, dataIndex: 'price', hidden: true }, { text: 'Foo Phone', width: 80, dataIndex: 'phone' }, { text: 'Foo % Change', width: 40, dataIndex: 'pctChange' }] }]); headerCtItems = grid.headerCt.items; }); afterEach(function () { header = headerCtItems = null; }); describe('all columns', function () { it('should return a valid header', function () { header = gam().getHeaderAtIndex(0); expect(header).not.toBe(null); expect(header.dataIndex).toBe('name'); }); it('should return the correct header from the index', function() { expect(gam().getHeaderAtIndex(0).dataIndex).toBe('name'); }); it("should return null if the column doesn't exist", function() { expect(gam().getHeaderAtIndex(50)).toBe(null); }); it('should return the header regardless of visibility', function () { var header2; header = gam().getHeaderAtIndex(0); header2 = gam().getHeaderAtIndex(1); expect(header).not.toBe(null); expect(header.hidden).toBe(true); expect(header2).not.toBe(null); expect(header2.hidden).toBe(false); }); it('should return the header in its owner stack - rootHeader', function () { header = gam().getHeaderAtIndex(0); expect(header.text).toBe('Name'); }); it('should return the index of the header in its owner stack - groupHeader', function () { // Note that this spec is using the index as the previous spec to demonstrate the difference. header = headerCtItems.items[3].columnManager.getHeaderAtIndex(0); expect(header.text).toBe('Foo Price'); }); }); describe('visible only', function () { it('should return the correct header from the index', function() { expect(gvm().getHeaderAtIndex(0).dataIndex).toBe('email'); }); it("should return null if the column doesn't exist", function() { expect(gvm().getHeaderAtIndex(50)).toBe(null); }); it('should not return a hidden sub-header', function () { header = gvm().getHeaderAtIndex(2); expect(header.hidden).toBe(false); expect(header.dataIndex).toBe('pctChange'); }); it('should return a valid header', function () { header = gvm().getHeaderAtIndex(0); expect(header).not.toBe(null); expect(header.dataIndex).toBe('email'); }); it('should return the header in its owner stack - rootHeader', function () { header = gvm().getHeaderAtIndex(0); expect(header.text).toBe('Email'); }); it('should return the index of the header in its owner stack - groupHeader', function () { // Note that this spec is using the same header as the previous spec to demonstrate the difference. var groupHeader = headerCtItems.items[3]; header = headerCtItems.items[3].visibleColumnManager.getHeaderAtIndex(0); expect(header.text).toBe('Foo Phone'); }); }); }); describe('hidden columns', function() { // Hidden at index 3/6 beforeEach(function(){ makeGrid(8, null, function(i){ return i > 0 && i % 3 === 0; }); }); it("should return all columns when using getColumnManager", function(){ expect(ga().length).toBe(8); }); it("should return only visible columns when using getVisibleColumnManager", function(){ expect(gv().length).toBe(6); }); it("should update the collection when hiding a column", function(){ colRef[0].hide(); expect(gv().length).toBe(5); }); it("should update the collection when showing a column", function(){ colRef[3].show(); expect(gv().length).toBe(7); }); describe("getHeaderAtIndex", function(){ it("should return the column reference", function(){ expect(gvm().getHeaderAtIndex(3)).toBe(colRef[4]); }); it("should return null if the index is out of bounds", function(){ expect(gvm().getHeaderAtIndex(7)).toBeNull(); }); }); describe("getHeaderById", function(){ it("should return the column reference by id", function(){ expect(gvm().getHeaderById('col1')).toBe(colRef[1]); }); it("should return null if the id doesn't exist", function() { expect(gvm().getHeaderById('col3')).toBeNull(); }); }); it("should return the first item", function(){ expect(gvm().getFirst()).toBe(colRef[0]); }); it("should return the last item", function(){ expect(gvm().getLast()).toBe(colRef[7]); }); describe("getNextSibling", function(){ it("should return the next sibling", function(){ expect(gvm().getNextSibling(colRef[2])).toBe(colRef[4]); }); it("should return the null if the next sibling doesn't exist", function(){ expect(gvm().getNextSibling(colRef[3])).toBeNull(); }); }); describe("getPreviousSibling", function(){ it("should return the previous sibling", function(){ expect(gvm().getPreviousSibling(colRef[7])).toBe(colRef[5]); }); it("should return the null if the previous sibling doesn't exist", function(){ expect(gvm().getPreviousSibling(colRef[6])).toBeNull(); }); }); }); describe("locking", function(){ // first 4 locked beforeEach(function(){ makeGrid(10, null, null, function(i){ return i <= 3; }); }); describe("global manager", function() { it("should return both sets of columns", function(){ expect(ga().length).toBe(10); }); it("should update the collection when adding to the locked side", function(){ grid.lockedGrid.headerCt.add({ text: 'Foo' }); expect(ga().length).toBe(11); }); it("should update the collection when adding to the unlocked side", function(){ grid.normalGrid.headerCt.add({ text: 'Foo' }); expect(ga().length).toBe(11); }); it("should update the collection when removing from the locked side", function(){ grid.lockedGrid.headerCt.remove(0); expect(ga().length).toBe(9); }); it("should update the collection when removing from the unlocked side", function(){ grid.normalGrid.headerCt.remove(0); expect(ga().length).toBe(9); }); it("should maintain the same size when locking an item", function(){ grid.lock(colRef[4]); expect(ga().length).toBe(10); }); it("should maintain the same size when unlocking an item", function(){ grid.unlock(colRef[0]); expect(ga().length).toBe(10); }); }); describe("locked side", function(){ var glm = function(){ return grid.lockedGrid.getColumnManager(); }; it("should only return the columns for this side", function(){ expect(glm().getColumns().length).toBe(4); }); it("should update the collection when adding an item to this side", function(){ grid.lock(colRef[9]); expect(glm().getColumns().length).toBe(5); }); it("should update the collection when removing an item from this side", function(){ grid.unlock(colRef[0]); expect(glm().getColumns().length).toBe(3); }); describe("function", function(){ describe("getHeaderIndex", function() { it("should return the correct index for the header", function() { expect(glm().getHeaderIndex(colRef[2])).toBe(2); }); it("should return -1 if the column doesn't exist", function(){ expect(glm().getHeaderIndex(colRef[5])).toBe(-1); }); }); describe("getHeaderAtIndex", function(){ it("should return the column reference", function(){ expect(glm().getHeaderAtIndex(3)).toBe(colRef[3]); }); it("should return null if the index is out of bounds", function(){ expect(glm().getHeaderAtIndex(6)).toBeNull(); }); }); describe("getHeaderById", function(){ it("should return the column reference by id", function(){ expect(glm().getHeaderById('col1')).toBe(colRef[1]); }); it("should return null if the id doesn't exist", function() { expect(glm().getHeaderById('col5')).toBeNull(); }); }); }); }); describe("unlocked side", function(){ var gum = function(){ return grid.normalGrid.getColumnManager(); }; it("should only return the columns for this side", function(){ expect(gum().getColumns().length).toBe(6); }); it("should update the collection when adding an item to this side", function(){ grid.unlock(colRef[1]); expect(gum().getColumns().length).toBe(7); }); it("should update the collection when removing an item from this side", function(){ grid.lock(colRef[7]); expect(gum().getColumns().length).toBe(5); }); describe("function", function(){ var offset = 4; describe("getHeaderIndex", function() { it("should return the correct index for the header", function() { expect(gum().getHeaderIndex(colRef[offset + 2])).toBe(2); }); it("should return -1 if the column doesn't exist", function(){ expect(gum().getHeaderIndex(colRef[0])).toBe(-1); }); }); describe("getHeaderAtIndex", function(){ it("should return the column reference", function(){ expect(gum().getHeaderAtIndex(3)).toBe(colRef[3 + offset]); }); it("should return null if the index is out of bounds", function(){ expect(gum().getHeaderAtIndex(6)).toBeNull(); }); }); describe("getHeaderById", function(){ it("should return the column reference by id", function(){ expect(gum().getHeaderById('col6')).toBe(colRef[6]); }); it("should return null if the id doesn't exist", function() { expect(gum().getHeaderById('col2')).toBeNull(); }); }); }); }); }); }); describe("menu", function() { it("should not allow menu to be shown when menuDisabled: true", function() { makeGrid([{ dataIndex: 'field0', width: 200, filter: 'string', menuDisabled: true }], { plugins: 'gridfilters' }); // menuDisabled=true, shouldn't have a trigger expect(colRef[0].triggerEl).toBeNull(); }); it("should not allow menu to be shown when grid is configured with enableColumnHide: false and sortableColumns: false", function() { makeGrid([{ dataIndex: 'field0', width: 200 }], { enableColumnHide: false, sortableColumns: false }); expect(colRef[0].triggerEl).toBeNull(); }); it("should allow menu to be shown when requiresMenu: true (from plugin) and grid is configured with enableColumnHide: false and sortableColumns: false", function() { makeGrid([{ dataIndex: 'field0', width: 200, filter: 'string' }], { enableColumnHide: false, sortableColumns: false, plugins: 'gridfilters' }); var col = colRef[0], menu; col.triggerEl.show(); jasmine.fireMouseEvent(col.triggerEl.dom, 'click'); menu = col.activeMenu; expect(menu.isVisible()).toBe(true); expect(col.requiresMenu).toBe(true); }); }); describe("sorting", function() { it("should sort by dataIndex when clicking on the header with sortable: true", function() { makeGrid([{ dataIndex: 'field0', sortable: true }]); clickHeader(colRef[0]); var sorters = store.getSorters(); expect(sorters.getCount()).toBe(1); expect(sorters.first().getProperty()).toBe('field0'); expect(sorters.first().getDirection()).toBe('ASC'); }); it("should invert the sort order when clicking on a sorted column", function() { makeGrid([{ dataIndex: 'field0', sortable: true }]); clickHeader(colRef[0]); var sorters = store.getSorters(); clickHeader(colRef[0]); expect(sorters.getCount()).toBe(1); expect(sorters.first().getProperty()).toBe('field0'); expect(sorters.first().getDirection()).toBe('DESC'); clickHeader(colRef[0]); expect(sorters.getCount()).toBe(1); expect(sorters.first().getProperty()).toBe('field0'); expect(sorters.first().getDirection()).toBe('ASC'); }); it("should not sort when configured with sortable false", function() { makeGrid([{ dataIndex: 'field0', sortable: false }]); clickHeader(colRef[0]); expect(store.getSorters().getCount()).toBe(0); }); it("should not sort when the grid is configured with sortableColumns: false", function() { makeGrid([{ dataIndex: 'field0' }], { sortableColumns: false }); clickHeader(colRef[0]); expect(store.getSorters().getCount()).toBe(0); }); }); describe("grouped columns", function() { var baseCols; function createGrid(cols, stateful) { if (grid) { grid.destroy(); grid = null; } makeGrid(cols, { renderTo: null, stateful: stateful, stateId: 'foo' }); } function getCol(id) { return grid.down('#' + id); } describe('when stateful', function () { var col; beforeEach(function () { new Ext.state.Provider(); makeGrid([{ itemId: 'main1', columns: [{ itemId: 'child1' }, { itemId: 'child2' }, { itemId: 'child3' }] }, { itemId: 'main2', columns: [{ itemId: 'child4' }, { itemId: 'child5' }, { itemId: 'child6' }] }], { stateful: true, stateId: 'foo' }); }); afterEach(function () { Ext.state.Manager.getProvider().clear(); col = null; }); it('should work when toggling visibility on the groups', function () { // See EXTJS-11661. col = grid.down('#main2'); col.hide(); // Trigger the bug. grid.saveState(); col.show(); // Now, select one of the col's children and query its hidden state. // Really, we can check anything here, b/c if the bug wasn't fixed then // a TypeError would be thrown in Ext.view.TableLayout#setColumnWidths. expect(grid.down('#child6').hidden).toBe(false); }); it('should not show a previously hidden subheader when the visibility of its group header is toggled', function () { var subheader = grid.down('#child4'); subheader.hide(); col = grid.down('#main2'); col.hide(); col.show(); expect(subheader.hidden).toBe(true); }); }); describe("column visibility", function() { var cells; afterEach(function () { cells = null; }); describe("hiding/show during construction", function() { it("should be able to show a column during construction", function() { expect(function() { makeGrid([{ dataIndex: 'field1', hidden: true, listeners: { added: function(c) { c.show(); } } }]); }).not.toThrow(); expect(grid.getVisibleColumnManager().getColumns()[0]).toBe(colRef[0]); }); it("should be able to hide a column during construction", function() { expect(function() { makeGrid([{ dataIndex: 'field1', listeners: { added: function(c) { c.hide(); } } }]); }).not.toThrow(); expect(grid.getVisibleColumnManager().getColumns().length).toBe(0); }); }); describe('when groupheader parent is hidden', function () { describe('hidden at config time', function () { beforeEach(function () { makeGrid([{ itemId: 'main1' }, { itemId: 'main2', hidden: true, columns: [{ itemId: 'child1' }, { itemId: 'child2' }] }]); cells = grid.view.body.query('.x-grid-row td'); }); it('should hide child columns at config time if the parent is hidden', function () { expect(grid.down('#child1').getInherited().hidden).toBe(true); expect(grid.down('#child2').getInherited().hidden).toBe(true); // Check the view. expect(cells.length).toBe(1); }); it('should not explicitly hide any child columns (they will be hierarchically hidden)', function () { expect(grid.down('#child1').hidden).toBe(false); expect(grid.down('#child2').hidden).toBe(false); // Check the view. expect(cells.length).toBe(1); }); }); describe('hidden at run time', function () { beforeEach(function () { makeGrid([{ itemId: 'main1' }, { itemId: 'main2', columns: [{ itemId: 'child1' }, { itemId: 'child2' }] }]); grid.down('#main2').hide(); cells = grid.view.body.query('.x-grid-row td'); }); it('should hide child columns at runtime if the parent is hidden', function () { expect(grid.down('#child1').getInherited().hidden).toBe(true); expect(grid.down('#child2').getInherited().hidden).toBe(true); // Check the view. expect(cells.length).toBe(1); }); it('should not explicitly hide any child columns (they will be hierarchically hidden)', function () { expect(grid.down('#child1').hidden).toBe(false); expect(grid.down('#child2').hidden).toBe(false); // Check the view. expect(cells.length).toBe(1); }); }); }); describe('when groupheader parent is shown', function () { describe('shown at config time', function () { beforeEach(function () { makeGrid([{ itemId: 'main1' }, { itemId: 'main2', columns: [{ itemId: 'child1' }, { itemId: 'child2' }] }]); cells = grid.view.body.query('.x-grid-row td'); }); it('should not hide child columns at config time if the parent is shown', function () { expect(grid.down('#child1').getInherited().hidden).not.toBeDefined(); expect(grid.down('#child2').getInherited().hidden).not.toBeDefined(); // Check the view. expect(cells.length).toBe(3); }); it('should not explicitly hide any child columns (they will be hierarchically shown)', function () { expect(grid.down('#child1').hidden).toBe(false); expect(grid.down('#child2').hidden).toBe(false); // Check the view. expect(cells.length).toBe(3); }); }); describe('shown at run time', function () { beforeEach(function () { makeGrid([{ itemId: 'main1' }, { itemId: 'main2', hidden: true, columns: [{ itemId: 'child1' }, { itemId: 'child2' }] }]); grid.down('#main2').show(); cells = grid.view.body.query('.x-grid-row td'); }); it('should show child columns at runtime if the parent is shown', function () { expect(grid.down('#child1').getInherited().hidden).not.toBeDefined(); expect(grid.down('#child2').getInherited().hidden).not.toBeDefined(); // Check the view. expect(cells.length).toBe(3); }); it('should not explicitly hide any child columns (they will be hierarchically shown)', function () { expect(grid.down('#child1').hidden).toBe(false); expect(grid.down('#child2').hidden).toBe(false); // Check the view. expect(cells.length).toBe(3); }); }); }); describe("hiding/showing children", function() { beforeEach(function() { baseCols = [{ itemId: 'col1', columns: [{ itemId: 'col11' }, { itemId: 'col12' }, { itemId: 'col13' }] }, { itemId: 'col2', columns: [{ itemId: 'col21' }, { itemId: 'col22' }, { itemId: 'col23' }] }]; }); it('should not show a previously hidden subheader when the visibility of its group header is toggled', function () { var subheader, col; makeGrid([{ itemId: 'main1' }, { itemId: 'main2', columns: [{ itemId: 'child1' }, { itemId: 'child2' }] }]); subheader = grid.down('#child1'); subheader.hide(); col = grid.down('#main2'); col.hide(); col.show(); expect(subheader.hidden).toBe(true); }); it('should allow any subheader to be reshown when all subheaders are currently hidden', function () { // There was a bug where a subheader could not be reshown when itself and all of its fellows were curently hidden. // See EXTJS-18515. var subheader; makeGrid([{ itemId: 'main1' }, { itemId: 'main2', columns: [{ itemId: 'child1' }, { itemId: 'child2' }, { itemId: 'child3' }] }]); grid.down('#child1').hide(); grid.down('#child2').hide(); subheader = grid.down('#child3'); // Toggling would reveal the bug. subheader.hide(); expect(subheader.hidden).toBe(true); subheader.show(); expect(subheader.hidden).toBe(false); }); it('should show the last hidden subheader if all subheaders are currently hidden when the group is reshown', function () { var groupheader, subheader1, subheader2, subheader3; makeGrid([{ itemId: 'main1' }, { itemId: 'main2', columns: [{ itemId: 'child1' }, { itemId: 'child2' }, { itemId: 'child3' }] }]); groupheader = grid.down('#main2'); subheader1 = grid.down('#child1').hide(); subheader3 = grid.down('#child3').hide(); subheader2 = grid.down('#child2') subheader2.hide(); expect(subheader2.hidden).toBe(true); groupheader.show(); // The last hidden subheader should now be shown. expect(subheader2.hidden).toBe(false); // Let's also demonstrate that the others are still hidden. expect(subheader1.hidden).toBe(true); expect(subheader3.hidden).toBe(true); }); describe("initial configuration", function() { it("should not hide the parent by default", function() { createGrid(baseCols); expect(getCol('col1').hidden).toBe(false); }); it("should not hide the parent if not all children are hidden", function() { baseCols[1].columns[2].hidden = baseCols[1].columns[0].hidden = true; createGrid(baseCols); expect(getCol('col2').hidden).toBe(false); }); it("should hide the parent if all children are hidden", function() { baseCols[1].columns[2].hidden = baseCols[1].columns[1].hidden = baseCols[1].columns[0].hidden = true; createGrid(baseCols); expect(getCol('col2').hidden).toBe(true); }); }); describe("before render", function() { it("should hide the parent when hiding all children", function() { createGrid(baseCols); getCol('col21').hide(); getCol('col22').hide(); getCol('col23').hide(); grid.render(Ext.getBody()); expect(getCol('col2').hidden).toBe(true); }); it("should show the parent when showing a hidden child", function() { baseCols[1].columns[2].hidden = baseCols[1].columns[1].hidden = baseCols[1].columns[0].hidden = true; createGrid(baseCols); getCol('col22').show(); grid.render(Ext.getBody()); expect(getCol('col2').hidden).toBe(false); }); }); describe("after render", function() { it("should hide the parent when hiding all children", function() { createGrid(baseCols); grid.render(Ext.getBody()); getCol('col21').hide(); getCol('col22').hide(); getCol('col23').hide(); expect(getCol('col2').hidden).toBe(true); }); it("should show the parent when showing a hidden child", function() { baseCols[1].columns[2].hidden = baseCols[1].columns[1].hidden = baseCols[1].columns[0].hidden = true; createGrid(baseCols); grid.render(Ext.getBody()); getCol('col22').show(); expect(getCol('col2').hidden).toBe(false); }); it("should only trigger a single layout when hiding the last leaf in a group", function() { baseCols[0].columns.splice(1, 2); createGrid(baseCols); grid.render(Ext.getBody()); var count = grid.componentLayoutCounter; getCol('col11').hide(); expect(grid.componentLayoutCounter).toBe(count + 1); }); it("should only trigger a single refresh when hiding the last leaf in a group", function() { baseCols[0].columns.splice(1, 2); createGrid(baseCols); grid.render(Ext.getBody()); var view = grid.getView(), count = view.refreshCounter; getCol('col11').hide(); expect(view.refreshCounter).toBe(count + 1); }); }); describe('nested stacked columns', function () { // Test stacked group headers where the only child is the next group header in the hierarchy. // The last (lowest in the stack) group header will contain multiple child items. // For example: // // +-----------------------------------+ // | col1 | // |-----------------------------------| // | col2 | // other |-----------------------------------| other // headers | col3 | headers // |-----------------------------------| // | col4 | // |-----------------------------------| // | Field1 | Field2 | Field3 | Field4 | // |===================================| // | view | // +-----------------------------------+ // function assertHiddenState(n, hiddenState) { while (n) { expect(getCol('col' + n).hidden).toBe(hiddenState); --n; } } describe('on hide', function () { beforeEach(function() { baseCols = [{ itemId: 'col1', columns: [{ itemId: 'col2', columns: [{ itemId: 'col3', columns: [{ itemId: 'col4', columns: [{ itemId: 'col41' }, { itemId: 'col42' }, { itemId: 'col43' }, { itemId: 'col44' }] }] }] }] }, { itemId: 'col5' }] }); it('should hide every group header above the target group header', function () { createGrid(baseCols); getCol('col4').hide(); assertHiddenState(4, true); tearDown(); setup(); createGrid(baseCols); getCol('col3').hide(); assertHiddenState(3, true); tearDown(); setup(); createGrid(baseCols); getCol('col2').hide(); assertHiddenState(2, true); }); it('should reshow every group header above the target group header when toggled', function () { createGrid(baseCols); getCol('col4').hide(); assertHiddenState(4, true); getCol('col4').show(); assertHiddenState(4, false); tearDown(); setup(); createGrid(baseCols); getCol('col3').hide(); assertHiddenState(3, true); getCol('col3').show(); assertHiddenState(3, false); tearDown(); setup(); createGrid(baseCols); getCol('col2').hide(); assertHiddenState(2, true); getCol('col2').show(); assertHiddenState(2, false); }); describe('subheaders', function () { it('should hide all ancestor group headers when hiding all subheaders in lowest group header', function () { createGrid(baseCols); getCol('col41').hide(); getCol('col42').hide(); getCol('col43').hide(); getCol('col44').hide(); assertHiddenState(4, true); }); }); }); describe('on show', function () { beforeEach(function() { baseCols = [{ itemId: 'col1', hidden: true, columns: [{ itemId: 'col2', hidden: true, columns: [{ itemId: 'col3', hidden: true, columns: [{ itemId: 'col4', hidden: true, columns: [{ itemId: 'col41' }, { itemId: 'col42' }, { itemId: 'col43' }, { itemId: 'col44' }] }] }] }] }, { itemId: 'col5' }] }); it('should show every group header above the target group header', function () { // Here we're showing that a header that is explicitly shown will have every header // above it shown as well. createGrid(baseCols); getCol('col4').show(); assertHiddenState(4, false); tearDown(); setup(); createGrid(baseCols); getCol('col3').show(); assertHiddenState(3, false); tearDown(); setup(); createGrid(baseCols); getCol('col2').show(); assertHiddenState(2, false); }); it('should show every group header in the chain no matter which group header is checked', function () { // Here we're showing that a header that is explicitly shown will have every header // in the chain shown, no matter which group header was clicked. // // Group headers are special in that they are auto-hidden when their subheaders are all // hidden and auto-shown when the first subheader is reshown. They are the only headers // that should now be auto-shown or -hidden. // // It follows that since group headers are dictated by some automation depending upon the // state of their child items that all group headers should be shown if anyone in the // hierarchy is shown since these special group headers only contain one child, which is // the next group header in the stack. createGrid(baseCols); getCol('col4').show(); assertHiddenState(4, false); tearDown(); setup(); createGrid(baseCols); getCol('col3').show(); assertHiddenState(4, false); tearDown(); setup(); createGrid(baseCols); getCol('col2').show(); assertHiddenState(4, false); tearDown(); setup(); createGrid(baseCols); getCol('col1').show(); assertHiddenState(4, false); }); it('should rehide every group header above the target group header when toggled', function () { createGrid(baseCols); getCol('col4').show(); assertHiddenState(4, false); getCol('col4').hide(); assertHiddenState(4, true); tearDown(); setup(); createGrid(baseCols); getCol('col3').show(); assertHiddenState(3, false); getCol('col3').hide(); assertHiddenState(3, true); tearDown(); setup(); createGrid(baseCols); getCol('col2').show(); assertHiddenState(2, false); getCol('col2').hide(); assertHiddenState(2, true); }); describe('subheaders', function () { it('should not show any ancestor group headers when hiding all subheaders in lowest group header', function () { createGrid(baseCols); getCol('col41').hide(); getCol('col42').hide(); getCol('col43').hide(); getCol('col44').hide(); assertHiddenState(4, true); }); it('should show all ancestor group headers when hiding all subheaders in lowest group header and then showing one', function () { createGrid(baseCols); getCol('col41').hide(); getCol('col42').hide(); getCol('col43').hide(); getCol('col44').hide(); assertHiddenState(4, true); getCol('col42').show(); assertHiddenState(4, false); }); it('should remember which subheader was last checked and restore its state when its group header is rechecked', function () { var col, subheader, headerCt; // Let's hide the 3rd menu item. makeGrid(baseCols); col = getCol('col4'); subheader = getCol('col43'); headerCt = grid.headerCt; getCol('col41').hide(); getCol('col42').hide(); getCol('col44').hide(); subheader.hide(); expect(col.hidden).toBe(true); // Get the menu item. headerCt.getMenuItemForHeader(headerCt.menu, col).setChecked(true); expect(subheader.hidden).toBe(false); // Now let's hide the 2nd menu item. tearDown(); setup(); makeGrid(baseCols); col = getCol('col4'); subheader = getCol('col42'); headerCt = grid.headerCt; getCol('col41').hide(); getCol('col43').hide(); getCol('col44').hide(); subheader.hide(); expect(col.hidden).toBe(true); // Get the menu item. headerCt.getMenuItemForHeader(headerCt.menu, col).setChecked(true); expect(subheader.hidden).toBe(false); }); it('should only show visible subheaders when all group headers are shown', function () { var col; createGrid(baseCols); col = getCol('col4'); // All subheaders are visible. col.show(); expect(col.visibleColumnManager.getColumns().length).toBe(4); // Hide the group header and hide two subheaders. col.hide(); getCol('col42').hide(); getCol('col43').hide(); // Only two subheaders should now be visible. col.show(); expect(col.visibleColumnManager.getColumns().length).toBe(2); }); }); }); }); }); describe("adding/removing children", function() { beforeEach(function() { baseCols = [{ itemId: 'col1', columns: [{ itemId: 'col11' }, { itemId: 'col12' }, { itemId: 'col13' }] }, { itemId: 'col2', columns: [{ itemId: 'col21' }, { itemId: 'col22' }, { itemId: 'col23' }] }]; }); describe("before render", function() { it("should hide the parent if removing the last hidden item", function() { baseCols[0].columns[0].hidden = baseCols[0].columns[1].hidden = true; createGrid(baseCols); getCol('col13').destroy(); grid.render(Ext.getBody()); expect(getCol('col1').hidden).toBe(true); }); it("should show the parent if adding a visible item and all items are hidden", function() { baseCols[0].columns[0].hidden = baseCols[0].columns[1].hidden = baseCols[0].columns[2].hidden = true; createGrid(baseCols); getCol('col1').add({ itemId: 'col14' }); grid.render(Ext.getBody()); expect(getCol('col1').hidden).toBe(false); }); }); describe("after render", function() { it("should hide the parent if removing the last hidden item", function() { baseCols[0].columns[0].hidden = baseCols[0].columns[1].hidden = true; createGrid(baseCols); grid.render(Ext.getBody()); getCol('col13').destroy(); expect(getCol('col1').hidden).toBe(true); }); it("should show the parent if adding a visible item and all items are hidden", function() { baseCols[0].columns[0].hidden = baseCols[0].columns[1].hidden = baseCols[0].columns[2].hidden = true; createGrid(baseCols); grid.render(Ext.getBody()); getCol('col1').add({ itemId: 'col14' }); expect(getCol('col1').hidden).toBe(false); }); }); }); }); describe("removing columns from group", function() { beforeEach(function() { baseCols = [{ itemId: 'col1', columns: [{ itemId: 'col11' }, { itemId: 'col12' }, { itemId: 'col13' }] }, { itemId: 'col2', columns: [{ itemId: 'col21' }, { itemId: 'col22' }, { itemId: 'col23' }] }]; createGrid(baseCols); }); describe("before render", function() { it("should destroy the group header when removing all columns", function() { var headerCt = grid.headerCt, col2 = getCol('col2'); expect(headerCt.items.indexOf(col2)).toBe(1); getCol('col21').destroy(); getCol('col22').destroy(); getCol('col23').destroy(); expect(col2.destroyed).toBe(true); expect(headerCt.items.indexOf(col2)).toBe(-1); }); }); describe("after render", function() { it("should destroy the group header when removing all columns", function() { createGrid(baseCols); grid.render(Ext.getBody()); var headerCt = grid.headerCt, col2 = getCol('col2'); expect(headerCt.items.indexOf(col2)).toBe(1); getCol('col21').destroy(); getCol('col22').destroy(); getCol('col23').destroy(); expect(col2.destroyed).toBe(true); expect(headerCt.items.indexOf(col2)).toBe(-1); }); }); }); }); describe("column operations & the view", function() { describe('', function () { beforeEach(function() { makeGrid(); }); it("should update the view when adding a new header", function() { grid.headerCt.insert(0, { dataIndex: 'field4' }); expect(getCellText(0, 0)).toBe('val5'); }); it("should update the view when moving an existing header", function() { grid.headerCt.insert(0, colRef[1]); expect(getCellText(0, 0)).toBe('val2'); }); it("should update the view when removing a header", function() { grid.headerCt.remove(1); expect(getCellText(0, 1)).toBe('val3'); }); it("should not refresh the view when doing a drag/drop move", function() { var called = false, header; grid.getView().on('refresh', function() { called = true; }); // Simulate a DD here header = colRef[0]; grid.headerCt.move(0, 3); expect(getCellText(0, 3)).toBe('val1'); expect(called).toBe(false); }); }); describe('toggling column visibility', function () { var refreshCounter; beforeEach(function () { makeGrid(); refreshCounter = view.refreshCounter; }); afterEach(function () { refreshCounter = null; }); describe('hiding', function () { it('should update the view', function () { colRef[0].hide(); expect(view.refreshCounter).toBe(refreshCounter + 1); }); }); describe('showing', function () { it('should update the view', function () { colRef[0].hide(); refreshCounter = view.refreshCounter; colRef[0].show(); expect(view.refreshCounter).toBe(refreshCounter + 1); }); }); }); }); describe("locked/normal grid visibility", function() { function expectVisible(locked, normal) { expect(grid.lockedGrid.isVisible()).toBe(locked); expect(grid.normalGrid.isVisible()).toBe(normal); } var failCount; beforeEach(function() { failCount = Ext.failedLayouts; }); afterEach(function() { expect(failCount).toBe(Ext.failedLayouts); failCount = null; }); describe("initial", function() { it("should have both sides visible", function() { makeGrid([{locked: true}, {}], { syncTaskDelay: 0 }); expectVisible(true, true); }); it("should have only the normal side visible if there are no locked columns", function() { makeGrid([{}, {}], { enableLocking: true, syncTaskDelay: 0 }); expectVisible(false, true); }); it("should have only the locked side visible if there are no normal columns", function() { makeGrid([{locked: true}, {locked: true}], { syncTaskDelay: 0 }); expectVisible(true, false); }); }); describe("dynamic", function() { beforeEach(function() { makeGrid([{ locked: true, itemId: 'col0' }, { locked: true, itemId: 'col1' }, { itemId: 'col2' }, { itemId: 'col3' }], { syncTaskDelay: 0 }); }); describe("normal side", function() { it("should not hide when removing a column but there are other normal columns", function() { grid.normalGrid.headerCt.remove('col2'); expectVisible(true, true); }); it("should hide when removing the last normal column", function() { grid.normalGrid.headerCt.remove('col2'); grid.normalGrid.headerCt.remove('col3'); expectVisible(true, false); }); it("should not hide when hiding a column but there are other visible normal columns", function() { colRef[2].hide(); expectVisible(true, true); }); it("should hide when hiding the last normal column", function() { colRef[2].hide(); colRef[3].hide(); expectVisible(true, false); }); }); describe("locked side", function() { it("should not hide when removing a column but there are other locked columns", function() { grid.lockedGrid.headerCt.remove('col0'); expectVisible(true, true); }); it("should hide when removing the last locked column", function() { grid.lockedGrid.headerCt.remove('col0'); grid.lockedGrid.headerCt.remove('col1'); expectVisible(false, true); }); it("should not hide when hiding a column but there are other visible locked columns", function() { colRef[0].hide(); expectVisible(true, true); }); it("should hide when hiding the last locked column", function() { colRef[0].hide(); colRef[1].hide(); expectVisible(false, true); }); }); }); }); describe("rendering", function() { beforeEach(function() { makeGrid(); }); describe("first/last", function() { it("should stamp x-grid-cell-first on the first column cell", function() { var cls = grid.getView().firstCls; expect(hasCls(getCell(0, 0), cls)).toBe(true); expect(hasCls(getCell(0, 1), cls)).toBe(false); expect(hasCls(getCell(0, 2), cls)).toBe(false); expect(hasCls(getCell(0, 3), cls)).toBe(false); }); it("should stamp x-grid-cell-last on the last column cell", function() { var cls = grid.getView().lastCls; expect(hasCls(getCell(0, 0), cls)).toBe(false); expect(hasCls(getCell(0, 1), cls)).toBe(false); expect(hasCls(getCell(0, 2), cls)).toBe(false); expect(hasCls(getCell(0, 3), cls)).toBe(true); }); it("should update the first class when moving the first column", function() { grid.headerCt.insert(0, colRef[1]); var cell = getCell(0, 0), view = grid.getView(), cls = view.firstCls; expect(getCellText(0, 0)).toBe('val2'); expect(hasCls(cell, cls)).toBe(true); expect(hasCls(getCell(0, 1), cls)).toBe(false); }); it("should update the last class when moving the last column", function() { // Suppress console warning about reusing existing id spyOn(Ext.log, 'warn'); grid.headerCt.add(colRef[1]); var cell = getCell(0, 3), view = grid.getView(), cls = view.lastCls; expect(getCellText(0, 3)).toBe('val2'); expect(hasCls(cell, cls)).toBe(true); expect(hasCls(getCell(0, 2), cls)).toBe(false); }); }); describe("id", function() { it("should stamp the id of the column in the cell", function() { expect(hasCls(getCell(0, 0), 'x-grid-cell-col0')).toBe(true); expect(hasCls(getCell(0, 1), 'x-grid-cell-col1')).toBe(true); expect(hasCls(getCell(0, 2), 'x-grid-cell-col2')).toBe(true); expect(hasCls(getCell(0, 3), 'x-grid-cell-col3')).toBe(true); }); }); }); describe("hiddenHeaders", function() { it("should lay out the hidden items so cells obtain correct width", function() { makeGrid([{ width: 100 }, { flex: 1 }, { width: 200 }], { hiddenHeaders: true }); expect(getCell(0, 0).getWidth()).toBe(100); expect(getCell(0, 1).getWidth()).toBe(totalWidth - 200 - 100); expect(getCell(0, 2).getWidth()).toBe(200); }); it("should lay out grouped column headers", function() { makeGrid([{ width: 100 }, { columns: [{ width: 200 }, { width: 400 }, { width: 100 }] }, { width: 200 }], { hiddenHeaders: true }); expect(getCell(0, 0).getWidth()).toBe(100); expect(getCell(0, 1).getWidth()).toBe(200); expect(getCell(0, 2).getWidth()).toBe(400); expect(getCell(0, 3).getWidth()).toBe(100); expect(getCell(0, 4).getWidth()).toBe(200); }); }); describe("emptyCellText config", function () { function expectEmptyText(column, rowIdx, colIdx) { var cell = getCellInner(rowIdx, colIdx), el = document.createElement('div'); // We're doing this because ' ' !== '&#160;'. By letting the browser decode the entity, we // can then do a comparison. el.innerHTML = column.emptyCellText; expect(cell.textContent || cell.innerText).toBe(el.textContent || el.innerText); } describe("rendering", function() { beforeEach(function () { makeGrid([{ width: 100 }, { emptyCellText: 'derp', width: 200 }]); }); it("should use the default html entity for when there is no emptyCellText given", function () { expectEmptyText(colRef[0], 0, 0); }); it("should use the value of emptyCellText when configured", function () { expectEmptyText(colRef[1], 0, 1); }); }); describe("column update", function() { describe("full row update", function() { it("should use the empty text on update", function() { makeGrid([{ width: 100, dataIndex: 'field0', renderer: function(v, meta, rec) { return v; } }]); // Renderer with >1 arg requires a full row redraw store.getAt(0).set('field0', ''); expectEmptyText(colRef[0], 0, 0); }); }); describe("cell update only", function() { describe("producesHTML: true", function() { it("should use the empty text on update", function() { makeGrid([{ width: 100, producesHTML: true, dataIndex: 'field0' }]); store.getAt(0).set('field0', ''); expectEmptyText(colRef[0], 0, 0); }); it("should use the empty text on update with a simple renderer", function() { makeGrid([{ width: 100, producesHTML: true, dataIndex: 'field0', renderer: Ext.identityFn }]); store.getAt(0).set('field0', ''); expectEmptyText(colRef[0], 0, 0); }); }); describe("producesHTML: false", function() { it("should use the empty text on update", function() { makeGrid([{ width: 100, producesHTML: false, dataIndex: 'field0' }]); store.getAt(0).set('field0', ''); expectEmptyText(colRef[0], 0, 0); }); it("should use the empty text on update with a simple renderer", function() { makeGrid([{ width: 100, producesHTML: false, dataIndex: 'field0', renderer: Ext.identityFn }]); store.getAt(0).set('field0', ''); expectEmptyText(colRef[0], 0, 0); }); }); }); }); }); describe("non-column items in the header", function() { it("should show non-columns as children", function() { makeGrid([{ width: 100, items: { xtype: 'textfield', itemId: 'foo' } }]); expect(grid.down('#foo').isVisible(true)).toBe(true); }); it("should have the hidden item as visible after showing an initially hidden column", function() { makeGrid([{ width: 100, items: { xtype: 'textfield' } }, { width: 100, hidden: true, items: { xtype: 'textfield', itemId: 'foo' } }]); var field = grid.down('#foo'); expect(field.isVisible(true)).toBe(false); field.ownerCt.show(); expect(field.isVisible(true)).toBe(true); }); }); describe("reconfiguring", function() { it("should destroy any old columns", function() { var o = {}; makeGrid(4); Ext.Array.forEach(colRef, function(col) { col.on('destroy', function(c) { o[col.getItemId()] = true; }); }); grid.reconfigure(null, []); expect(o).toEqual({ col0: true, col1: true, col2: true, col3: true }); }); describe("with locking", function() { it("should resize the locked part to match the grid size", function() { makeGrid(4, null, null, function(i) { return i === 0; }); var borderWidth = grid.lockedGrid.el.getBorderWidth('lr'); // Default column width expect(grid.lockedGrid.getWidth()).toBe(100 + borderWidth); grid.reconfigure(null, [{ locked: true, width: 120 }, { locked: true, width: 170 }, {}, {}]) expect(grid.lockedGrid.getWidth()).toBe(120 + 170 + borderWidth); }); }); }); describe('column header borders', function() { it('should show header borders by default, and turn them off dynamically', function() { makeGrid(); expect(colRef[0].el.getBorderWidth('r')).toBe(1); expect(colRef[1].el.getBorderWidth('r')).toBe(1); expect(colRef[2].el.getBorderWidth('r')).toBe(1); grid.setHeaderBorders(false); expect(colRef[0].el.getBorderWidth('r')).toBe(0); expect(colRef[1].el.getBorderWidth('r')).toBe(0); expect(colRef[2].el.getBorderWidth('r')).toBe(0); }); it('should have no borders if configured false, and should show them dynamically', function() { makeGrid(null, { headerBorders: false }); expect(colRef[0].el.getBorderWidth('r')).toBe(0); expect(colRef[1].el.getBorderWidth('r')).toBe(0); expect(colRef[2].el.getBorderWidth('r')).toBe(0); grid.setHeaderBorders(true); expect(colRef[0].el.getBorderWidth('r')).toBe(1); expect(colRef[1].el.getBorderWidth('r')).toBe(1); expect(colRef[2].el.getBorderWidth('r')).toBe(1); }); }); describe('column resize', function() { it('should not fire drag events on headercontainer during resize', function() { makeGrid(); var colWidth = colRef[0].getWidth(), dragSpy = spyOnEvent(grid.headerCt.el, 'drag'); resizeColumn(colRef[0], 10); expect(colRef[0].getWidth()).toBe(colWidth + 10); expect(dragSpy).not.toHaveBeenCalled(); }); }); }); } createSuite(false); createSuite(true); });
san4osq/bindformext
ext/classic/classic/test/specs/grid/grid-columns.js
JavaScript
mit
120,088
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pigame.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the # issue is really that Django is missing to avoid masking other # exceptions on Python 2. try: import django except ImportError: raise ImportError( "Couldn't import Django. Are you sure it's installed and " "available on your PYTHONPATH environment variable? Did you " "forget to activate a virtual environment?" ) raise execute_from_command_line(sys.argv)
MoonCheesez/stack
PiGame/pigame/manage.py
Python
mit
804
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSObject.h" @class IBConnection, NSSet, NSString; @interface IBDragConnectionContext : NSObject { NSString *connectionName; long long relationshipType; NSString *sourceClassName; id source; IBConnection *prototype; BOOL limitToInterfaceBuilder; NSSet *endPointProvidingDocuments; } @property(readonly) NSSet *endPointProvidingDocuments; // @synthesize endPointProvidingDocuments; @property(readonly) BOOL limitToInterfaceBuilder; // @synthesize limitToInterfaceBuilder; @property(readonly) NSString *connectionName; // @synthesize connectionName; @property(readonly) long long relationshipType; // @synthesize relationshipType; @property(readonly) NSString *sourceClassName; // @synthesize sourceClassName; @property(readonly) IBConnection *prototype; // @synthesize prototype; @property(readonly) id source; // @synthesize source; - (void).cxx_destruct; - (id)initWithConnectionName:(id)arg1 relationshipType:(long long)arg2 sourceClassName:(id)arg3 endPointProvidingDocuments:(id)arg4 limitedToInterfaceBuilder:(BOOL)arg5; - (id)initWithPrototype:(id)arg1 endPointProvidingDocuments:(id)arg2; - (id)initWithSource:(id)arg1 endPointProvidingDocuments:(id)arg2; @end
wczekalski/Distraction-Free-Xcode-plugin
Archived/v1/WCDistractionFreeXcodePlugin/Headers/PlugIns/IDEInterfaceBuilderKit/IBDragConnectionContext.h
C
mit
1,348
/* * Copyright 2011 Matt Crinklaw-Vogt * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package com.tantaman.commons.examples; import java.util.Collection; import java.util.LinkedList; import org.debian.alioth.shootout.u32.nbody.NBodySystem; import com.tantaman.commons.concurrent.Parallel; public class ParallelForDemo { public static void main(String[] args) { Collection<Integer> elems = new LinkedList<Integer>(); for (int i = 0; i < 40; ++i) { elems.add(i*55000 + 100); } Parallel.For(elems, new Parallel.Operation<Integer>() { public void perform(Integer pParameter) { // do something with the parameter }; }); Parallel.Operation<Integer> bodiesOp = new Parallel.Operation<Integer>() { @Override public void perform(Integer pParameter) { NBodySystem bodies = new NBodySystem(); for (int i = 0; i < pParameter; ++i) bodies.advance(0.01); } }; System.out.println("RUNNING THE Parallel.For vs Parallel.ForFJ performance comparison"); System.out.println("This could take a while."); // warm up.. it really does have a large impact. Parallel.ForFJ(elems, bodiesOp); long start = System.currentTimeMillis(); Parallel.For(elems, bodiesOp); long stop = System.currentTimeMillis(); System.out.println("DELTA TIME VIA NORMAL PARALLEL FOR: " + (stop - start)); start = System.currentTimeMillis(); Parallel.ForFJ(elems, bodiesOp); stop = System.currentTimeMillis(); System.out.println("DELTA TIME VIA FOR FORK JOIN: " + (stop - start)); System.out.println("Finished"); } }
tantaman/commons
src/examples/java/com/tantaman/commons/examples/ParallelForDemo.java
Java
mit
2,605
<!DOCTYPE html> <!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]--> <!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]--> <!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]--> <!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>{{ site.data.theme.name }} - {{ page.title }}</title> <meta name="author" content="{{ site.data.theme.name }}" /> <meta name="description" content="The blog of {{ site.data.theme.name }}" /> <link rel="canonical" href="{{ site.url }}{{ page.url | replace:'index.html','' }}" /> <link href="//fonts.googleapis.com/css?family=Open+Sans:600,800" rel="stylesheet" type="text/css"> <link rel="shortcut icon" href="/favicon.png"> <link rel="alternate" type="application/atom+xml" title="{{ site.data.theme.name }}" href="{{site.url}}/atom.xml" /> <link rel="stylesheet" href="/assets/css/all.css"> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.1/css/font-awesome.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script src="/assets/toc.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#toc').toc({headers: '.content h1, .content h2, .content h3'}); }); </script> </head> <body> <div class="container"> <div class="three columns sidebar"> {% include sidebar.html %} </div> <div class="nine columns content"> {{ content }} <div class="footer"> {% include footer.html %} </div> </div> </div> {% include analytics.html %} </body> </html>
dyno/dyno.github.io
_layouts/default.html
HTML
mit
1,691
<?php namespace Akamon\OAuth2\Server\Domain\Service\Token\TokenGranter; use Akamon\OAuth2\Server\Domain\Exception\OAuthError\GrantTypeNotFoundOAuthErrorException; use Akamon\OAuth2\Server\Domain\Exception\OAuthError\UnauthorizedClientForGrantTypeOAuthErrorException; use Akamon\OAuth2\Server\Domain\Exception\OAuthError\UnsupportedGrantTypeOAuthErrorException; use Akamon\OAuth2\Server\Domain\Service\Client\ClientObtainer\ClientObtainerInterface; use Akamon\OAuth2\Server\Domain\Service\Token\TokenGrantTypeProcessor\TokenGrantTypeProcessorInterface; use Symfony\Component\HttpFoundation\Request; use felpado as f; class TokenGranterByGrantType implements TokenGranterInterface { private $clientObtainer; private $processors = []; public function __construct(ClientObtainerInterface $clientObtainer, array $processors) { $this->clientObtainer = $clientObtainer; foreach ($processors as $name => $processor) { $this->addProcessor($name, $processor); } } private function addProcessor($name, TokenGrantTypeProcessorInterface $processor) { $this->processors[$name] = $processor; } public function grant(Request $request) { $client = $this->clientObtainer->getClient($request); $grantType = $this->getGrantTypeFromRequest($request); if (!$client->hasAllowedGrantType($grantType)) { throw new UnauthorizedClientForGrantTypeOAuthErrorException(); } $inputData = $this->getInputDataFromRequest($request); return $this->findProcessor($grantType)->process($client, $inputData); } private function getGrantTypeFromRequest(Request $request) { if (!$request->request->has('grant_type')) { throw new GrantTypeNotFoundOAuthErrorException(); } return $request->request->get('grant_type'); } /** * @return TokenGrantTypeProcessorInterface */ private function findProcessor($grantType) { if (f\contains($this->processors, $grantType)) { return f\get($this->processors, $grantType); } throw new UnsupportedGrantTypeOAuthErrorException(); } private function getInputDataFromRequest(Request $request) { return f\dissoc($request->request->all(), 'grant_type'); } }
Akamon/oauth2-server
src/Akamon/OAuth2/Server/Domain/Service/Token/TokenGranter/TokenGranterByGrantType.php
PHP
mit
2,338
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>metacoq-safechecker: 6 m 37 s</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.8.1 / metacoq-safechecker - 1.0~alpha+8.8</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> metacoq-safechecker <small> 1.0~alpha+8.8 <span class="label label-success">6 m 37 s</span> </small> </h1> <p><em><script>document.write(moment("2020-09-01 14:15:30 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-09-01 14:15:30 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.12 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-m4 1 Virtual package relying on m4 coq 8.8.1 Formal proof management system. num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.05.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.05.0 Official 4.05.0 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.8.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://metacoq.github.io/metacoq&quot; dev-repo: &quot;git+https://github.com/MetaCoq/metacoq.git#coq-8.8&quot; bug-reports: &quot;https://github.com/MetaCoq/metacoq/issues&quot; authors: [&quot;Abhishek Anand &lt;[email protected]&gt;&quot; &quot;Simon Boulier &lt;[email protected]&gt;&quot; &quot;Cyril Cohen &lt;[email protected]&gt;&quot; &quot;Yannick Forster &lt;[email protected]&gt;&quot; &quot;Fabian Kunze &lt;[email protected]&gt;&quot; &quot;Gregory Malecha &lt;[email protected]&gt;&quot; &quot;Matthieu Sozeau &lt;[email protected]&gt;&quot; &quot;Nicolas Tabareau &lt;[email protected]&gt;&quot; &quot;Théo Winterhalter &lt;[email protected]&gt;&quot; ] license: &quot;MIT&quot; build: [ [&quot;sh&quot; &quot;./configure.sh&quot;] [make &quot;-j%{jobs}%&quot; &quot;-C&quot; &quot;safechecker&quot;] ] install: [ [make &quot;-C&quot; &quot;safechecker&quot; &quot;install&quot;] ] depends: [ &quot;ocaml&quot; {&gt; &quot;4.02.3&quot;} &quot;coq&quot; {&gt;= &quot;8.8&quot; &amp; &lt; &quot;8.9~&quot;} &quot;coq-metacoq-template&quot; {= version} &quot;coq-metacoq-checker&quot; {= version} &quot;coq-metacoq-pcuic&quot; {= version} ] synopsis: &quot;Implementation and verification of safe conversion and typechecking algorithms for Coq&quot; description: &quot;&quot;&quot; MetaCoq is a meta-programming framework for Coq. The SafeChecker modules provides a correct implementation of weak-head reduction, conversion and typechecking of Coq definitions and global environments. &quot;&quot;&quot; url { src: &quot;https://github.com/MetaCoq/metacoq/archive/1.0-alpha+8.8.tar.gz&quot; checksum: &quot;sha256=c2fe122ad30849e99c1e5c100af5490cef0e94246f8eb83f6df3f2ccf9edfc04&quot; }</pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-metacoq-safechecker.1.0~alpha+8.8 coq.8.8.1</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 4000000; timeout 2h opam install -y --deps-only coq-metacoq-safechecker.1.0~alpha+8.8 coq.8.8.1</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>22 m 44 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 16000000; timeout 2h opam install -y -v coq-metacoq-safechecker.1.0~alpha+8.8 coq.8.8.1</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>6 m 37 s</dd> </dl> <h2>Installation size</h2> <p>Total: 23 M</p> <ul> <li>10 M <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/PCUICSafeConversion.vo</code></li> <li>7 M <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/PCUICSafeReduce.vo</code></li> <li>2 M <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/PCUICSafeChecker.vo</code></li> <li>1 M <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/PCUICSafeRetyping.vo</code></li> <li>678 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/metacoq_safechecker_plugin.cmxs</code></li> <li>646 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/SafeTemplateChecker.vo</code></li> <li>623 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/Extraction.vo</code></li> <li>456 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/PCUICSafeConversion.glob</code></li> <li>254 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/PCUICSafeChecker.glob</code></li> <li>144 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/PCUICSafeReduce.glob</code></li> <li>141 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/metacoq_safechecker_plugin.cmi</code></li> <li>115 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/PCUICSafeConversion.v</code></li> <li>59 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/metacoq_safechecker_plugin.cmx</code></li> <li>58 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/PCUICSafeChecker.v</code></li> <li>51 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/PCUICSafeRetyping.glob</code></li> <li>49 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/PCUICSafeReduce.v</code></li> <li>37 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/Loader.vo</code></li> <li>17 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/SafeTemplateChecker.glob</code></li> <li>11 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/PCUICSafeRetyping.v</code></li> <li>6 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/metacoq_safechecker_plugin.cmxa</code></li> <li>6 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/SafeTemplateChecker.v</code></li> <li>2 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/Extraction.v</code></li> <li>1 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/Extraction.glob</code></li> <li>1 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/Loader.glob</code></li> <li>1 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/MetaCoq/SafeChecker/Loader.v</code></li> </ul> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq-metacoq-safechecker.1.0~alpha+8.8</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small> </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.05.0-2.0.6/released/8.8.1/metacoq-safechecker/1.0~alpha+8.8.html
HTML
mit
10,957
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>jmlcoq: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.7.0 / jmlcoq - 8.13.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> jmlcoq <small> 8.13.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2021-12-26 20:28:19 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-12-26 20:28:19 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 1 Virtual package relying on perl coq 8.7.0 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.08.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.08.1 Official release 4.08.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://github.com/coq-community/jmlcoq&quot; dev-repo: &quot;git+https://github.com/coq-community/jmlcoq.git&quot; bug-reports: &quot;https://github.com/coq-community/jmlcoq/issues&quot; license: &quot;MIT&quot; synopsis: &quot;Coq definition of the JML specification language and a verified runtime assertion checker for JML&quot; description: &quot;&quot;&quot; A Coq formalization of the syntax and semantics of the Java-targeted JML specification language, along with a verified runtime assertion checker for JML.&quot;&quot;&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] depends: [ &quot;coq&quot; {&gt;= &quot;8.10&quot; &amp; &lt; &quot;8.15~&quot;} ] tags: [ &quot;category:Computer Science/Decision Procedures and Certified Algorithms/Correctness proofs of algorithms&quot; &quot;keyword:JML&quot; &quot;keyword:Java Modeling Language&quot; &quot;keyword:runtime verification&quot; &quot;logpath:JML&quot; &quot;date:2021-08-01&quot; ] authors: [ &quot;Hermann Lehner&quot; &quot;David Pichardie&quot; &quot;Andreas Kägi&quot; ] url { src: &quot;https://github.com/coq-community/jmlcoq/archive/v8.13.0.tar.gz&quot; checksum: &quot;sha512=3d2742d4c8e7f643a35f636aa14292c43b7a91e3d18bcf998c62ee6ee42e9969b59ae803c513d114224725099cb369e62cef8575c3efb0cf26886d8bb8638cca&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-jmlcoq.8.13.0 coq.8.7.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.7.0). The following dependencies couldn&#39;t be met: - coq-jmlcoq -&gt; coq &gt;= 8.10 Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-jmlcoq.8.13.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.08.1-2.0.5/released/8.7.0/jmlcoq/8.13.0.html
HTML
mit
7,120
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>propcalc: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.6 / propcalc - 8.9.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> propcalc <small> 8.9.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-01-01 06:30:20 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-01-01 06:30:20 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 1 Virtual package relying on perl coq 8.6 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.03.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.03.0 Official 4.03.0 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;http://arxiv.org/abs/1503.08744&quot; license: &quot;BSD&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/PropCalc&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.9&quot; &amp; &lt; &quot;8.10~&quot;} ] tags: [ &quot;keyword: propositional calculus&quot; &quot;keyword: classical logic&quot; &quot;keyword: completeness&quot; &quot;keyword: natural deduction&quot; &quot;keyword: sequent calculus&quot; &quot;keyword: cut elimination&quot; &quot;category: Mathematics/Logic/Foundations&quot; ] authors: [ &quot;Floris van Doorn &lt;[email protected]&gt; [http://www.contrib.andrew.cmu.edu/~fpv/]&quot; ] bug-reports: &quot;https://github.com/coq-contribs/propcalc/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/propcalc.git&quot; synopsis: &quot;Propositional Calculus&quot; description: &quot;&quot;&quot; Formalization of basic theorems about classical propositional logic. The main theorems are (1) the soundness and completeness of natural deduction calculus, (2) the equivalence between natural deduction calculus, Hilbert systems and sequent calculus and (3) cut elimination for sequent calculus.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/propcalc/archive/v8.9.0.tar.gz&quot; checksum: &quot;md5=026cadcf7d43c7ed9212266633005efd&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-propcalc.8.9.0 coq.8.6</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.6). The following dependencies couldn&#39;t be met: - coq-propcalc -&gt; coq &gt;= 8.9 -&gt; ocaml &gt;= 4.05.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-propcalc.8.9.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.03.0-2.0.5/released/8.6/propcalc/8.9.0.html
HTML
mit
7,394
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>karatsuba: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.7.1+1 / karatsuba - 8.6.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> karatsuba <small> 8.6.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2021-12-16 13:27:32 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-12-16 13:27:32 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 1 Virtual package relying on perl coq 8.7.1+1 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.07.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.07.1 Official release 4.07.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://github.com/coq-contribs/karatsuba&quot; license: &quot;Unknown&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/Karatsuba&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.6&quot; &amp; &lt; &quot;8.7~&quot;} ] tags: [ &quot;keyword: Karatsuba multiplication&quot; &quot;keyword: binary ring&quot; &quot;category: Mathematics/Arithmetic and Number Theory/Number theory&quot; &quot;date: 2005-09-15&quot; ] authors: [ &quot;Russell O&#39;Connor &lt;[email protected]&gt; [http://r6.ca/]&quot; ] bug-reports: &quot;https://github.com/coq-contribs/karatsuba/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/karatsuba.git&quot; synopsis: &quot;Karatsuba&#39;s Multiplication&quot; description: &quot;&quot;&quot; http://r6.ca/Karatsuba/ An implementation of Karatsuba&#39;s Multiplication algorithm&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/karatsuba/archive/v8.6.0.tar.gz&quot; checksum: &quot;md5=2d6f0f166881f47310c6b3f772f747ed&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-karatsuba.8.6.0 coq.8.7.1+1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1+1). The following dependencies couldn&#39;t be met: - coq-karatsuba -&gt; coq &lt; 8.7~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-karatsuba.8.6.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.07.1-2.0.6/released/8.7.1+1/karatsuba/8.6.0.html
HTML
mit
6,932
package com.flockinger.spongeblogSP.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.service.ApiInfo; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; @Configuration @EnableSwagger2 public class SwaggerConfig { ApiInfo apiInfo() { return new ApiInfoBuilder().title("SpongeblogSP API").description("Spongeblog blogging API") .license("").licenseUrl("http://unlicense.org").termsOfServiceUrl("").version("1.0.0") .build(); } @Bean public Docket customImplementation() { return new Docket(DocumentationType.SWAGGER_2).select() .apis(RequestHandlerSelectors.basePackage("com.flockinger.spongeblogSP.api.impl")).build() .directModelSubstitute(org.joda.time.LocalDate.class, java.sql.Date.class) .directModelSubstitute(org.joda.time.DateTime.class, java.util.Date.class) .apiInfo(apiInfo()); } }
daflockinger/spongeblogSP
src/main/java/com/flockinger/spongeblogSP/config/SwaggerConfig.java
Java
mit
1,216
--- title: "Does detecting a Minimally Conscious State in the ICU matter ?" date: 2017-11-22 00:00:00 categories: [Publi] tags: [Disorders of Consciousness, ICU, Consciousness, MyPublications] --- Our paper entitled **"Survival and consciousness recovery are better in the minimally conscious state than in the vegetative state"** showing how much it is important to detect Minimally Conscious State (MCS) even early after a brain injury (here <90 days in the ICU) is available online on [*Brain Injury*](http://www.tandfonline.com.gate2.inist.fr/doi/full/10.1080/02699052.2017.1364421). Survival and, more importantly, **recovery of consciousness with at least a partial autonomy** (GOSE>3) were more frequent if a patient was diagnosed MCS (47%, in comparison to only 3% for patients in a Vegetative State); see figure below). ![Brain_Injury]({{ site.url }}/images/Brain_injury/Brain_Injury.jpeg) ___ ![Fig-1]({{ site.url }}/images/MCS_prognosis/MCS_prog1.jpeg) ***Functional outcome in patients in the vegetative (VS/UWS) and the minimally conscious state (MCS).*** Histograms of vegetative state (aka Unresponsive Wakefulenss Syndrome - VS/UWS) and MCS outcomes evaluated with the [GOSE scale]({{ site.url }}/2017/Post_GOS-E/). Delay from acute brain injury and outcome was ~16 months. GOSE = 4 corresponds to a patient with a severe disability but conscious and who can be left at least 8h during the day without assistance. --- **Reference:** Faugeras F, Rohaut B, Valente M, Sitt J.D, Demeret S, Bolgert F, et al. *Survival and consciousness recovery are better in the minimally conscious state than in the vegetative state*. [Brain Injury](http://www.tandfonline.com.gate2.inist.fr/doi/full/10.1080/02699052.2017.1364421). 2018 Jan;32:72-77. <script type="text/javascript"> reddit_url = "https://doi.org/10.1080/02699052.2017.1364421"; reddit_title = "Survival and consciousness recovery are better in the minimally conscious state than in the vegetative state"; reddit_newwindow='1'; </script> <script type="text/javascript" src="//www.redditstatic.com/button/button3.js"></script> <script type='text/javascript' src='https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js'></script> <div data-badge-popover="right" class='altmetric-embed' data-badge-type='donut' data-hide-less-than='1' data-doi="/10.1080/02699052.2017.1364421"></div>
brohaut/brohaut.github.io
_posts/2017-11-22-Article-MCS_Prognosis.markdown
Markdown
mit
2,374
<nav class="navbar navbar-default navbar-fixed-top"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="/#/"><i class="fa fa-calendar-check-o"></i> BetterMe</a> </div> <div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li><a href="#/profile">Profile <span class="sr-only">(current)</span></a></li> <li><a href="#/calendar">Calendar</a></li> <li><a href="#/regimen">Regimens</a></li> <li><a href="#/invite">Invites</a></li> <li><a href="#/regimen/find">Find Regimens</a></li> <li class="active"><a href="#/admin">Admin</a></li> <li><a href="" ng-click="model.logout()">Logout</a></li> </ul> </div> </div> </nav> <h1>Admin</h1> <ul class="list-group col-md-6"> <input ng-model="model.userSearchTerm" class="form-control" placeholder="Search By User's Email" ng-change="model.updateDisplayedUsers()"> <table ng-if="model.displayedUsers.length" class="table table-hover"> <thead> <tr> <th></th> <th>Email</th> <th>First</th> <th>Last</th> <th>Admin</th> </tr> </thead> <tbody> <tr ng-repeat="user in model.displayedUsers" ng-click="model.redirectToUserDetails(user._id)"> <td ng-click="model.deleteUser(user._id)"><i class="fa fa-trash" aria-hidden="true"></i></td> <td>{{user.email}}</td> <td>{{user.firstName}}</td> <td>{{user.lastName}}</td> <td>{{user.admin}}</td> </tr> </tbody> </table> </ul> <ul class="list-group col-md-6"> <input ng-model="model.regimenSearchTerm" class="form-control" placeholder="Search By Regimen or Coach" ng-change="model.updateDisplayedRegimens()"> <table ng-if="model.displayedRegimens.length" class="table table-hover"> <thead> <tr> <th></th> <th>Title</th> <th>Coach</th> <th>Start</th> <th>End</th> </tr> </thead> <tbody> <tr ng-repeat="regimen in model.displayedRegimens" ng-click="model.redirectToRegimenDetails(regimen._id)"> <td ng-click="model.deleteRegimen(regimen._id)"><i class="fa fa-trash" aria-hidden="true"></i></td> <td>{{regimen.title}}</td> <td>{{regimen._coach.email}}</td> <td>{{model.displayDate(regimen.start)}}</td> <td>{{model.displayDate(regimen.end)}}</td> </tr> </tbody> </table> </ul>
RayOconnor/BetterMe
public/views/admin/templates/admin.view.client.html
HTML
mit
2,897
import {keccak256, bufferToHex} from "ethereumjs-util" export default class MerkleTree { constructor(elements) { // Filter empty strings and hash elements this.elements = elements.filter(el => el).map(el => keccak256(el)) // Deduplicate elements this.elements = this.bufDedup(this.elements) // Sort elements this.elements.sort(Buffer.compare) // Create layers this.layers = this.getLayers(this.elements) } getLayers(elements) { if (elements.length === 0) { return [[""]] } const layers = [] layers.push(elements) // Get next layer until we reach the root while (layers[layers.length - 1].length > 1) { layers.push(this.getNextLayer(layers[layers.length - 1])) } return layers } getNextLayer(elements) { return elements.reduce((layer, el, idx, arr) => { if (idx % 2 === 0) { // Hash the current element with its pair element layer.push(this.combinedHash(el, arr[idx + 1])) } return layer }, []) } combinedHash(first, second) { if (!first) { return second } if (!second) { return first } return keccak256(this.sortAndConcat(first, second)) } getRoot() { return this.layers[this.layers.length - 1][0] } getHexRoot() { return bufferToHex(this.getRoot()) } getProof(el) { let idx = this.bufIndexOf(el, this.elements) if (idx === -1) { throw new Error("Element does not exist in Merkle tree") } return this.layers.reduce((proof, layer) => { const pairElement = this.getPairElement(idx, layer) if (pairElement) { proof.push(pairElement) } idx = Math.floor(idx / 2) return proof }, []) } getHexProof(el) { const proof = this.getProof(el) return this.bufArrToHexArr(proof) } getPairElement(idx, layer) { const pairIdx = idx % 2 === 0 ? idx + 1 : idx - 1 if (pairIdx < layer.length) { return layer[pairIdx] } else { return null } } bufIndexOf(el, arr) { let hash // Convert element to 32 byte hash if it is not one already if (el.length !== 32 || !Buffer.isBuffer(el)) { hash = keccak256(el) } else { hash = el } for (let i = 0; i < arr.length; i++) { if (hash.equals(arr[i])) { return i } } return -1 } bufDedup(elements) { return elements.filter((el, idx) => { return this.bufIndexOf(el, elements) === idx }) } bufArrToHexArr(arr) { if (arr.some(el => !Buffer.isBuffer(el))) { throw new Error("Array is not an array of buffers") } return arr.map(el => "0x" + el.toString("hex")) } sortAndConcat(...args) { return Buffer.concat([...args].sort(Buffer.compare)) } }
livepeer/protocol
utils/merkleTree.js
JavaScript
mit
3,202
// // peas.js // // tree data structure in javascript // ////////////////////////// var peas = function() { // "sub" here is used as an object container for // operations related to sub nodes. // Each pea node will have a "sub" property // with an instance of "sub" var sub = function() {} // the current node is accesable as "this.pea", from // methods in the "sub" object sub.prototype.pea = null // first and last sub sub.prototype.first = null sub.prototype.last = null // number of sub nodes sub.prototype.n = 0 // get subnode at index position (0 index) sub.prototype.at = function( index ) { var pik,i if( index > this.pea.sub.n - 1 ) return null pik = this.pea.sub.first for( i=0; i<index; i++ ) pik = pik.next return pik } // add spare node at last position // returns the added node sub.prototype.add = function( spare ) { if( this.pea.sub.last ) { spare.prev = this.pea.sub.last this.pea.sub.last.next = spare this.pea.sub.last = spare } else { spare.prev = null this.pea.sub.first = spare this.pea.sub.last = spare } spare.top = this.pea spare.next = null this.pea.sub.n++ return spare } // insert sub node at index position // returns the inserted node sub.prototype.insertAt = function( spare, index ) { var pik // validate index given if( index < 0 ) throw "node insert failed, invalid index" if( index > this.pea.sub.n ) throw "node insert failed, given index exceeds valid places" // if insert at last+1, then just add if( index == this.pea.sub.n ) { this.pea.add( spare ) return } pik = this.pea.sub.at( index ) spare.prev = pik.prev spare.next = pik // if not inserting at first if( pik.prev ) { pik.prev.next = spare } else { // inserting as first pik.top.sub.first = spare } pik.prev = spare spare.top = this.pea this.pea.sub.n++ return spare } // executes function "action" on each direct // sub node (not recursive) sub.prototype.each = function( action ) { var node = this.pea.sub.first while( node ) { action( node ) node = node.next } } /////////////////////////// // constructor function for pea nodes peas = function( item ) { this.sub = new sub() this.sub.pea = this this.item = item } peas.prototype.item = null // top node peas.prototype.top = null // prev peas.prototype.prev = null // next peas.prototype.next = null // namespace for sub nodes peas.prototype.sub = {} // find the root node, of the tree // of this node peas.prototype.root = function() { var node = this while ( node.top ) node = node.top } // executes function func on all the tree // nodes below (recursively) peas.prototype.onAllBelow = function( action ) { var node = this.sub.first while( node ) { action( node ) if( node.sub.n > 0 ) nodeMethods.each( action ) node = node.next } } // removes this node from tree, leaving // other tree nodes in consistent state peas.prototype.rip = function() { if( ! this.top ) return this if( this.next ) this.next.prev = this.prev if( this.prev ) this.prev.next = this.next if( this.top.sub.last == this ) this.top.sub.last = this.prev if( this.top.sub.first == this ) this.top.sub.first = this.next this.top.sub.n-- this.top = null this.next = null this.prev = null return this } // returns an array containing all nodes below this, in the tree peas.prototype.flat = function() { var flat = [] var grab = function( node ) { flat.push( node ) } root.onAllBelow( grab ) return flat } // puts spare node in the tree, // before of this node. // returns the inserted node peas.prototype.putBefore = function( spare ) { if( ! this.top ) throw "not in a tree" if ( this.prev ) this.prev.next = spare if( this.top.sub.first == this ) this.top.sub.first = spare spare.next = this spare.prev = this.prev this.prev = spare spare.top = this.top this.top.sub.n++ return spare } return peas }()
nzonbi/peas.js
peas.js
JavaScript
mit
4,109
<!DOCTYPE html><html><head><meta charset="utf-8"><title>Untitled Document</title><style>/* * HTML5 ✰ Boilerplate * * What follows is the result of much research on cross-browser styling. * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal, * Kroc Camen, and the H5BP dev community and team. * * Detailed information about this CSS: h5bp.com/css */ /* * Ported to Stylus * by @flowonyx * * Any changes are released to the Public Domain. * */ [hidden] { display: none; } ::-moz-selection { background: #087185; color: #fff; text-shadow: none; } ::selection { background: #087185; color: #fff; text-shadow: none; } a:visited { color: #551a8b; } b { font-weight: bold; } dfn { font-style: italic; } hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; } ins { background: #ff9; color: #000; text-decoration: none; } mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; } pre, code, kbd, samp { font-family: monospace, serif; _font-family: 'courier new', monospace; } kbd, samp { font-size: 1em; } pre { word-wrap: break-word; } q { quotes: none; } q:before, q:after { content: none; } nav ul, nav ol, list-style: none { list-style-image: none; margin: 0; padding: 0; } img { vertical-align: middle; } svg:not(:root) { overflow: hidden; } figure { margin: 0; } label { cursor: pointer; } legend { *margin-left: -7px; white-space: normal; } button, input[type="button"], input[type="reset"], input[type="submit"] { *overflow: visible; } button[disabled], input[disabled] { cursor: default; } input[type="checkbox"], input[type="radio"] { box-sizing: border-box; padding: 0; *width: 13px; *height: 13px; } textarea { resize: vertical; } input:valid, textarea:valid, input:invalid, textarea:invalid { background-color: #f0dddd; } .chromeframe { margin: 0.2em 0; background: #ccc; color: #000; padding: 0.2em 0; } /* * Bootstrap v2.0.0 * * Copyright 2012 Twitter, Inc * Licensed under the Apache License v2.0 * http://www.apache.org/licenses/LICENSE-2.0 * * Designed and built with all the love in the world @twitter by @mdo and @fat. */ /* * Bootstrap v2.0.1 * * Copyright 2012 Twitter, Inc * Licensed under the Apache License v2.0 * http://www.apache.org/licenses/LICENSE-2.0 * * Designed and built with all the love in the world @twitter by @mdo and @fat. */ .clearfix { zoom: 1; } .clearfix:before, .clearfix:after { display: table; content: ""; zoom: 1; } .clearfix:after { clear: both; } .center-block { display: block; margin-left: auto; margin-right: auto; } .fixed-container { width: siteWidth; margin-left: auto; margin-right: auto; zoom: 1; } .fixed-container:before, .fixed-container:after { display: table; content: ""; zoom: 1; } .fixed-container:after { clear: both; } article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; } audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; } audio:not([controls]) { display: none; } html { font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } a:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } a:hover, a:active { outline: 0; } sub, sup { position: relative; font-size: 75%; line-height: 0; vertical-align: baseline; } sup { top: -0.5em; } sub { bottom: -0.25em; } img { max-width: 100%; height: auto; border: 0; -ms-interpolation-mode: bicubic; } button, input, select, textarea { margin: 0; font-size: 100%; vertical-align: middle; } button, input { *overflow: visible; line-height: normal; } button::-moz-focus-inner, input::-moz-focus-inner { padding: 0; border: 0; } button, input[type="button"], input[type="reset"], input[type="submit"] { cursor: pointer; -webkit-appearance: button; } input[type="search"] { -webkit-appearance: textfield; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; } input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; } textarea { overflow: auto; vertical-align: top; } .clearfix { *zoom: 1; } .clearfix:before, .clearfix:after { display: table; content: ""; } .clearfix:after { clear: both; } body { margin: 0; font-family: "Arvo", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18px; color: #444; background-color: #fff; } a { color: #525252; text-decoration: none; } a:hover { color: #464646; text-decoration: underline; } .row { margin-left: -20px; *zoom: 1; } .row:before, .row:after { display: table; content: ""; } .row:after { clear: both; } [class*="span"] { float: left; margin-left: 20px; } .span1 { width: 60px; } .span2 { width: 140px; } .span3 { width: 220px; } .span4 { width: 300px; } .span5 { width: 380px; } .span6 { width: 460px; } .span7 { width: 540px; } .span8 { width: 620px; } .span9 { width: 700px; } .span10 { width: 780px; } .span11 { width: 860px; } .span12, .container { width: 940px; } .offset1 { margin-left: 100px; } .offset2 { margin-left: 180px; } .offset3 { margin-left: 260px; } .offset4 { margin-left: 340px; } .offset5 { margin-left: 420px; } .offset6 { margin-left: 500px; } .offset7 { margin-left: 580px; } .offset8 { margin-left: 660px; } .offset9 { margin-left: 740px; } .offset10 { margin-left: 820px; } .offset11 { margin-left: 900px; } .row-fluid { width: 100%; *zoom: 1; } .row-fluid:before, .row-fluid:after { display: table; content: ""; } .row-fluid:after { clear: both; } .row-fluid > [class*="span"] { float: left; margin-left: 2.127659574%; } .row-fluid > [class*="span"]:first-child { margin-left: 0; } .row-fluid .span1 { width: 6.382978723%; } .row-fluid .span2 { width: 13.037573561812584%; } .row-fluid .span3 { width: 19.963784516437755%; } .row-fluid .span4 { width: 27.16161158687551%; } .row-fluid .span5 { width: 34.63105477312585%; } .row-fluid .span6 { width: 42.37211407518877%; } .row-fluid .span7 { width: 50.38478949306428%; } .row-fluid .span8 { width: 58.66908102675237%; } .row-fluid .span9 { width: 67.22498867625306%; } .row-fluid .span10 { width: 76.05251244156632%; } .row-fluid .span11 { width: 85.15165232269217%; } .row-fluid .span12 { width: 94.5224083196306%; } .container { width: 940px; margin-left: auto; margin-right: auto; *zoom: 1; } .container:before, .container:after { display: table; content: ""; } .container:after { clear: both; } .container-fluid { padding-left: 20px; padding-right: 20px; *zoom: 1; } .container-fluid:before, .container-fluid:after { display: table; content: ""; } .container-fluid:after { clear: both; } p { margin: 0 0 9px; font-family: "Arvo", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18px; } p small { font-size: 11px; color: #999; } .lead { margin-bottom: 18px; font-size: 20px; font-weight: 200; line-height: 27px; } h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: bold; color: #444; text-rendering: optimizelegibility; } h1 small, h2 small, h3 small, h4 small, h5 small, h6 small { font-weight: normal; color: #999; } h1 { font-size: 30px; line-height: 36px; } h1 small { font-size: 18px; } h2 { font-size: 24px; line-height: 36px; } h2 small { font-size: 18px; } h3 { line-height: 27px; font-size: 18px; } h3 small { font-size: 14px; } h4, h5, h6 { line-height: 18px; } h4 { font-size: 14px; } h4 small { font-size: 12px; } h5 { font-size: 12px; } h6 { font-size: 11px; color: #999; text-transform: uppercase; } .page-header { padding-bottom: 17px; margin: 18px 0; border-bottom: 1px solid #eee; } .page-header h1 { line-height: 1; } ul, ol { padding: 0; margin: 0 0 9px 25px; } ul ul, ul ol, ol ol, ol ul { margin-bottom: 0; } ul { list-style: disc; } ol { list-style: decimal; } li { line-height: 18px; } ul.unstyled, ol.unstyled { margin-left: 0; list-style: none; } dl { margin-bottom: 18px; } dt, dd { line-height: 18px; } dt { font-weight: bold; } dd { margin-left: 9px; } hr { margin: 18px 0; border: 0; border-top: 1px solid #eee; border-bottom: 1px solid #fff; } strong { font-weight: bold; } em { font-style: italic; } .muted { color: #999; } abbr { font-size: 90%; text-transform: uppercase; border-bottom: 1px dotted #ddd; cursor: help; } blockquote { padding: 0 0 0 15px; margin: 0 0 18px; border-left: 5px solid #eee; } blockquote p { margin-bottom: 0; font-size: 16px; font-weight: 300; line-height: 22.5px; } blockquote small { display: block; line-height: 18px; color: #999; } blockquote small:before { content: '\2014 \00A0'; } blockquote.pull-right { float: right; padding-left: 0; padding-right: 15px; border-left: 0; border-right: 5px solid #eee; } blockquote.pull-right p, blockquote.pull-right small { text-align: right; } q:before, q:after, blockquote:before, blockquote:after { content: ""; } address { display: block; margin-bottom: 18px; line-height: 18px; font-style: normal; } small { font-size: 100%; } cite { font-style: normal; } code, pre { padding: 0 3px 2px; font-family: Menlo, Monaco, "Courier New", monospace; font-size: 12px; color: #444; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } code { padding: 3px 4px; color: #d14; background-color: #f7f7f9; border: 1px solid #e1e1e8; } pre { display: block; padding: 8.5px; margin: 0 0 9px; font-size: 12px; line-height: 18px; background-color: #f5f5f5; border: 1px solid #ccc; border: 1px solid rgba(0,0,0,0.15); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; white-space: pre; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; } pre.prettyprint { margin-bottom: 18px; } pre code { padding: 0; color: inherit; background-color: transparent; border: 0; } .pre-scrollable { max-height: 340px; overflow-y scroll } .hljs { display: block; padding: 0.5em; color: #333; background: #f8f8f8; } .hljs-comment, .hljs-template_comment, .diff .hljs-header, .hljs-javadoc { color: #998; font-style: italic; } .hljs-keyword, .css .rule .hljs-keyword, .hljs-winutils, .javascript .hljs-title, .nginx .hljs-title, .hljs-subst, .hljs-request, .hljs-status { color: #333; font-weight: bold; } .hljs-number, .hljs-hexcolor, .ruby .hljs-constant { color: #099; } .hljs-string, .hljs-tag .hljs-value, .hljs-phpdoc, .tex .hljs-formula { color: #d14; } .hljs-title, .hljs-id, .coffeescript .hljs-params, .scss .hljs-preprocessor { color: #900; font-weight: bold; } .javascript .hljs-title, .lisp .hljs-title, .clojure .hljs-title, .hljs-subst { font-weight: normal; } .hljs-class .hljs-title, .haskell .hljs-type, .vhdl .hljs-literal, .tex .hljs-command { color: #458; font-weight: bold; } .hljs-tag, .hljs-tag .hljs-title, .hljs-rules .hljs-property, .django .hljs-tag .hljs-keyword { color: #000080; font-weight: normal; } .hljs-attribute, .hljs-variable, .lisp .hljs-body { color: #008080; } .hljs-regexp { color: #009926; } .hljs-symbol, .ruby .hljs-symbol .hljs-string, .lisp .hljs-keyword, .tex .hljs-special, .hljs-prompt { color: #990073; } .hljs-built_in, .lisp .hljs-title, .clojure .hljs-built_in { color: #0086b3; } .hljs-preprocessor, .hljs-pragma, .hljs-pi, .hljs-doctype, .hljs-shebang, .hljs-cdata { color: #999; font-weight: bold; } .hljs-deletion { background: #fdd; } .hljs-addition { background: #dfd; } .diff .hljs-change { background: #0086b3; } .hljs-chunk { color: #aaa; } code, pre { font-family: Consolas, "Liberation Mono", Courier, monospace !important; } form { margin: 0 0 18px; } fieldset { padding: 0; margin: 0; border: 0; } legend { display: block; width: 100%; padding: 0; margin-bottom: 27px; font-size: 19.5px; line-height: 36px; color: #444; border: 0; border-bottom: 1px solid #eee; } legend small { font-size: 13.5px; color: #999; } label, input, button, select, textarea { font-size: 13px; font-weight: normal; line-height: 18px; } input, button, select, textarea { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } label { display: block; margin-bottom: 5px; color: #444; } input, textarea, select, .uneditable-input { display: inline-block; width: 210px; height: 18px; padding: 4px; margin-bottom: 9px; font-size: 13px; line-height: 18px; color: #555; border: 1px solid #ccc; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .uneditable-textarea { width: auto; height: auto; } label input, label textarea, label select { display: block; } input[type="image"], input[type="checkbox"], input[type="radio"] { width: auto; height: auto; padding: 0; margin: 3px 0; *margin-top: 0; /* IE7 */ line-height: normal; cursor: pointer; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; border: 0 \9; /* IE9 and down */ } input[type="image"] { border: 0; } input[type="file"] { width: auto; padding: initial; line-height: initial; border: initial; background-color: #fff; background-color: initial; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } input[type="button"], input[type="reset"], input[type="submit"] { width: auto; height: auto; } select, input[type="file"] { height: 28px; /* In IE7, the height of the select element cannot be changed by height, only font-size */ *margin-top: 4px; /* For IE7, add top margin to align select with labels */ line-height: 28px; } input[type="file"] { line-height: 18px \9; } select { width: 220px; background-color: #fff; } select[multiple], select[size] { height: auto; } input[type="image"] { -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } textarea { height: auto; } input[type="hidden"] { display: none; } .radio, .checkbox { padding-left: 18px; } .radio input[type="radio"], .checkbox input[type="checkbox"] { float: left; margin-left: -18px; } .controls > .radio:first-child, .controls > .checkbox:first-child { padding-top: 5px; } .radio.inline, .checkbox.inline { display: inline-block; padding-top: 5px; margin-bottom: 0; vertical-align: middle; } .radio.inline + .radio.inline, .checkbox.inline + .checkbox.inline { margin-left: 10px; } input, textarea { -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; -moz-transition: border linear 0.2s, box-shadow linear 0.2s; -ms-transition: border linear 0.2s, box-shadow linear 0.2s; -o-transition: border linear 0.2s, box-shadow linear 0.2s; transition: border linear 0.2s, box-shadow linear 0.2s; } input:focus, textarea:focus { border-color: rgba(82,168,236,0.8); -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(82,168,236,0.6); -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(82,168,236,0.6); box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(82,168,236,0.6); outline: 0; outline: thin dotted \9; /* IE6-9 */ } input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus, select:focus { -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .input-mini { width: 60px; } .input-small { width: 90px; } .input-medium { width: 150px; } .input-large { width: 210px; } .input-xlarge { width: 270px; } .input-xxlarge { width: 530px; } input[class*="span"], select[class*="span"], textarea[class*="span"], .uneditable-input { float: none; margin-left: 0; } input.span1, textarea.span1, .uneditable-input.span1 { width: 50px; } input.span2, textarea.span2, .uneditable-input.span2 { width: 130px; } input.span3, textarea.span3, .uneditable-input.span3 { width: 210px; } input.span4, textarea.span4, .uneditable-input.span4 { width: 290px; } input.span5, textarea.span5, .uneditable-input.span5 { width: 370px; } input.span6, textarea.span6, .uneditable-input.span6 { width: 450px; } input.span7, textarea.span7, .uneditable-input.span7 { width: 530px; } input.span8, textarea.span8, .uneditable-input.span8 { width: 610px; } input.span9, textarea.span9, .uneditable-input.span9 { width: 690px; } input.span10, textarea.span10, .uneditable-input.span10 { width: 770px; } input.span11, textarea.span11, .uneditable-input.span11 { width: 850px; } input.span12, textarea.span12, .uneditable-input.span12 { width: 930px; } input[disabled], select[disabled], textarea[disabled], input[readonly], select[readonly], textarea[readonly] { background-color: #f5f5f5; border-color: #ddd; cursor: not-allowed; } .control-group.warning > label, .control-group.warning .help-block, .control-group.warning .help-inline { color: #c09853; } .control-group.warning input, .control-group.warning select, .control-group.warning textarea { color: #c09853; border-color: #c09853; } .control-group.warning input:focus, .control-group.warning select:focus, .control-group.warning textarea:focus { border-color: #b58b42; -webkit-box-shadow: 0 0 6px #cfb07b; -moz-box-shadow: 0 0 6px #cfb07b; box-shadow: 0 0 6px #cfb07b; } .control-group.warning .input-prepend .add-on, .control-group.warning .input-append .add-on { color: #c09853; background-color: #fcf8e3; border-color: #c09853; } .control-group.error > label, .control-group.error .help-block, .control-group.error .help-inline { color: #b94a48; } .control-group.error input, .control-group.error select, .control-group.error textarea { color: #b94a48; border-color: #b94a48; } .control-group.error input:focus, .control-group.error select:focus, .control-group.error textarea:focus { border-color: #a74240; -webkit-box-shadow: 0 0 6px #c76f6d; -moz-box-shadow: 0 0 6px #c76f6d; box-shadow: 0 0 6px #c76f6d; } .control-group.error .input-prepend .add-on, .control-group.error .input-append .add-on { color: #b94a48; background-color: #f2dede; border-color: #b94a48; } .control-group.success > label, .control-group.success .help-block, .control-group.success .help-inline { color: #468847; } .control-group.success input, .control-group.success select, .control-group.success textarea { color: #468847; border-color: #468847; } .control-group.success input:focus, .control-group.success select:focus, .control-group.success textarea:focus { border-color: #3f7a40; -webkit-box-shadow: 0 0 6px #54a355; -moz-box-shadow: 0 0 6px #54a355; box-shadow: 0 0 6px #54a355; } .control-group.success .input-prepend .add-on, .control-group.success .input-append .add-on { color: #468847; background-color: #dff0d8; border-color: #468847; } input:focus:required:invalid, textarea:focus:required:invalid, select:focus:required:invalid { color: #b94a48; border-color: #ee5f5b; } input:focus:required:invalid:focus, textarea:focus:required:invalid:focus, select:focus:required:invalid:focus { border-color: #eb423d; -webkit-box-shadow: 0 0 6px #f49997; -moz-box-shadow: 0 0 6px #f49997; box-shadow: 0 0 6px #f49997; } .form-actions { padding: 17px 20px 18px; margin-top: 18px; margin-bottom: 18px; background-color: #f5f5f5; border-top: 1px solid #ddd; } .uneditable-input { display: block; background-color: #fff; border-color: #eee; -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.025); -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.025); box-shadow: inset 0 1px 2px rgba(0,0,0,0.025); cursor: not-allowed; } :-moz-placeholder { color: #999; } ::-webkit-input-placeholder { color: #999; } .help-block { display: block; margin-top: 5px; margin-bottom: 0; color: #999; } .help-inline { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; margin-bottom: 9px; vertical-align: middle; padding-left: 5px; } .input-prepend, .input-append { margin-bottom: 5px; *zoom: 1; } .input-prepend:before, .input-append:before, .input-prepend:after, .input-append:after { display: table; content: ""; } .input-prepend:after, .input-append:after { clear: both; } .input-prepend input, .input-append input, .input-prepend .uneditable-input, .input-append .uneditable-input { -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; } .input-prepend input:focus, .input-append input:focus, .input-prepend .uneditable-input:focus, .input-append .uneditable-input:focus { position: relative; z-index: 2; } .input-prepend .uneditable-input, .input-append .uneditable-input { border-left-color: #ccc; } .input-prepend .add-on, .input-append .add-on { float: left; display: block; width: auto; min-width: 16px; height: 18px; margin-right: -1px; padding: 4px 5px; font-weight: normal; line-height: 18px; color: #999; text-align: center; text-shadow: 0 1px 0 #fff; background-color: #f5f5f5; border: 1px solid #ccc; -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; } .input-prepend .active, .input-append .active { background-color: #a9dba9; border-color: #46a546; } .input-prepend .add-on { *margin-top: 1px; /* IE6-7 */ } .input-append input, .input-append .uneditable-input { float: left; -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; } .input-append .uneditable-input { border-left-color: #eee; border-right-color: #ccc; } .input-append .add-on { margin-right: 0; margin-left: -1px; -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; } .input-append input:first-child { *margin-left: -160px; } .input-append input:first-child+.add-on { *margin-left: -21px; } .search-query { padding-left: 14px; padding-right: 14px; margin-bottom: 0; -webkit-border-radius: 14px; -moz-border-radius: 14px; border-radius: 14px; } .form-search input, .form-inline input, .form-horizontal input, .form-search textarea, .form-inline textarea, .form-horizontal textarea, .form-search select, .form-inline select, .form-horizontal select, .form-search .help-inline, .form-inline .help-inline, .form-horizontal .help-inline, .form-search .uneditable-input, .form-inline .uneditable-input, .form-horizontal .uneditable-input { display: inline-block; margin-bottom: 0; } .form-search .hide, .form-inline .hide, .form-horizontal .hide { display: none; } .form-search label, .form-inline label, .form-search .input-append, .form-inline .input-append, .form-search .input-prepend, .form-inline .input-prepend { display: inline-block; } .form-search .input-append .add-on, .form-inline .input-prepend .add-on, .form-search .input-append .add-on, .form-inline .input-prepend .add-on { vertical-align: middle; } .form-search .radio, .form-inline .radio, .form-search .checkbox, .form-inline .checkbox { margin-bottom: 0; vertical-align: middle; } .control-group { margin-bottom: 9px; } legend + .control-group { margin-top: 18px; -webkit-margin-top-collapse: separate; } .form-horizontal .control-group { margin-bottom: 18px; *zoom: 1; } .form-horizontal .control-group:before, .form-horizontal .control-group:after { display: table; content: ""; } .form-horizontal .control-group:after { clear: both; } .form-horizontal .control-label { float: left; width: 140px; padding-top: 5px; text-align: right; } .form-horizontal .controls { margin-left: 160px; } .form-horizontal .form-actions { padding-left: 160px; } table { max-width: 100%; border-collapse: collapse; border-spacing: 0; } .table { width: 100%; margin-bottom: 18px; } .table th, .table td { padding: 8px; line-height: 18px; text-align: left; vertical-align: top; border-top: 1px solid #ddd; } .table th { font-weight: bold; } .table thead th { vertical-align: bottom; } .table thead:first-child tr th, .table thead:first-child tr td { border-top: 0; } .table tbody + tbody { border-top: 2px solid #ddd; } .table-condensed th, .table-condensed td { padding: 4px 5px; } .table-bordered { border: 1px solid #ddd; border-collapse: separate; *border-collapse: collapsed; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .table-bordered th + th, .table-bordered td + td, .table-bordered th + td, .table-bordered td + th { border-left: 1px solid #ddd; } .table-bordered thead:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child td { border-top: 0; } .table-bordered thead:first-child tr:first-child th:first-child, .table-bordered tbody:first-child tr:first-child td:first-child { -webkit-border-radius: 4px 0 0 0; -moz-border-radius: 4px 0 0 0; border-radius: 4px 0 0 0; } .table-bordered thead:first-child tr:first-child th:last-child, .table-bordered tbody:first-child tr:first-child td:last-child { -webkit-border-radius: 0 4px 0 0; -moz-border-radius: 0 4px 0 0; border-radius: 0 4px 0 0; } .table-bordered thead:last-child tr:last-child th:first-child, .table-bordered tbody:last-child tr:last-child td:first-child { -webkit-border-radius: 0 0 0 4px; -moz-border-radius: 0 0 0 4px; border-radius: 0 0 0 4px; } .table-bordered thead:last-child tr:last-child th:last-child, .table-bordered tbody:last-child tr:last-child td:last-child { -webkit-border-radius: 0 0 4px 0; -moz-border-radius: 0 0 4px 0; border-radius: 0 0 4px 0; } .table-striped tbody tr:nth-child(odd) td, .table-striped tbody tr:nth-child(odd) th { background-color: #f9f9f9; } .table tbody tr:hover td, .table tbody tr:hover th { background-color: #f5f5f5; } table .span1 { float: none; width: 44px; margin-left: 0; } table .span2 { float: none; width: 124px; margin-left: 0; } table .span3 { float: none; width: 204px; margin-left: 0; } table .span4 { float: none; width: 284px; margin-left: 0; } table .span5 { float: none; width: 364px; margin-left: 0; } table .span6 { float: none; width: 444px; margin-left: 0; } table .span7 { float: none; width: 524px; margin-left: 0; } table .span8 { float: none; width: 604px; margin-left: 0; } table .span9 { float: none; width: 684px; margin-left: 0; } table .span10 { float: none; width: 764px; margin-left: 0; } table .span11 { float: none; width: 844px; margin-left: 0; } table .span12 { float: none; width: 924px; margin-left: 0; } [class^="icon-"], [class*=" icon-"] { display: inline-block; width: 14px; height: 14px; line-height: 14px; vertical-align: text-top; background-image: url("../img/glyphicons-halflings.png"); background-position: 14px 14px; background-repeat: no-repeat; *margin-right: 0.3em; } [class^="icon-"]:last-child, [class*=" icon-"]:last-child { *margin-left: 0; } .icon-white { background-image: url("../img/glyphicons-halflings-white.png"); } .icon-glass { background-position: 0 0; } .icon-music { background-position: -24px 0; } .icon-search { background-position: -48px 0; } .icon-envelope { background-position: -72px 0; } .icon-heart { background-position: -96px 0; } .icon-star { background-position: -120px 0; } .icon-star-empty { background-position: -144px 0; } .icon-user { background-position: -168px 0; } .icon-film { background-position: -192px 0; } .icon-th-large { background-position: -216px 0; } .icon-th { background-position: -240px 0; } .icon-th-list { background-position: -264px 0; } .icon-ok { background-position: -288px 0; } .icon-remove { background-position: -312px 0; } .icon-zoom-in { background-position: -336px 0; } .icon-zoom-out { background-position: -360px 0; } .icon-off { background-position: -384px 0; } .icon-signal { background-position: -408px 0; } .icon-cog { background-position: -432px 0; } .icon-trash { background-position: -456px 0; } .icon-home { background-position: 0 -24px; } .icon-file { background-position: -24px -24px; } .icon-time { background-position: -48px -24px; } .icon-road { background-position: -72px -24px; } .icon-download-alt { background-position: -96px -24px; } .icon-download { background-position: -120px -24px; } .icon-upload { background-position: -144px -24px; } .icon-inbox { background-position: -168px -24px; } .icon-play-circle { background-position: -192px -24px; } .icon-repeat { background-position: -216px -24px; } .icon-refresh { background-position: -240px -24px; } .icon-list-alt { background-position: -264px -24px; } .icon-lock { background-position: -287px -24px; } .icon-flag { background-position: -312px -24px; } .icon-headphones { background-position: -336px -24px; } .icon-volume-off { background-position: -360px -24px; } .icon-volume-down { background-position: -384px -24px; } .icon-volume-up { background-position: -408px -24px; } .icon-qrcode { background-position: -432px -24px; } .icon-barcode { background-position: -456px -24px; } .icon-tag { background-position: 0 -48px; } .icon-tags { background-position: -25px -48px; } .icon-book { background-position: -48px -48px; } .icon-bookmark { background-position: -72px -48px; } .icon-print { background-position: -96px -48px; } .icon-camera { background-position: -120px -48px; } .icon-font { background-position: -144px -48px; } .icon-bold { background-position: -167px -48px; } .icon-italic { background-position: -192px -48px; } .icon-text-height { background-position: -216px -48px; } .icon-text-width { background-position: -240px -48px; } .icon-align-left { background-position: -264px -48px; } .icon-align-center { background-position: -288px -48px; } .icon-align-right { background-position: -312px -48px; } .icon-align-justify { background-position: -336px -48px; } .icon-list { background-position: -360px -48px; } .icon-indent-left { background-position: -384px -48px; } .icon-indent-right { background-position: -408px -48px; } .icon-facetime-video { background-position: -432px -48px; } .icon-picture { background-position: -456px -48px; } .icon-pencil { background-position: 0 -72px; } .icon-map-marker { background-position: -24px -72px; } .icon-adjust { background-position: -48px -72px; } .icon-tint { background-position: -72px -72px; } .icon-edit { background-position: -96px -72px; } .icon-share { background-position: -120px -72px; } .icon-check { background-position: -144px -72px; } .icon-move { background-position: -168px -72px; } .icon-step-backward { background-position: -192px -72px; } .icon-fast-backward { background-position: -216px -72px; } .icon-backward { background-position: -240px -72px; } .icon-play { background-position: -264px -72px; } .icon-pause { background-position: -288px -72px; } .icon-stop { background-position: -312px -72px; } .icon-forward { background-position: -336px -72px; } .icon-fast-forward { background-position: -360px -72px; } .icon-step-forward { background-position: -384px -72px; } .icon-eject { background-position: -408px -72px; } .icon-chevron-left { background-position: -432px -72px; } .icon-chevron-right { background-position: -456px -72px; } .icon-plus-sign { background-position: 0 -96px; } .icon-minus-sign { background-position: -24px -96px; } .icon-remove-sign { background-position: -48px -96px; } .icon-ok-sign { background-position: -72px -96px; } .icon-question-sign { background-position: -96px -96px; } .icon-info-sign { background-position: -120px -96px; } .icon-screenshot { background-position: -144px -96px; } .icon-remove-circle { background-position: -168px -96px; } .icon-ok-circle { background-position: -192px -96px; } .icon-ban-circle { background-position: -216px -96px; } .icon-arrow-left { background-position: -240px -96px; } .icon-arrow-right { background-position: -264px -96px; } .icon-arrow-up { background-position: -289px -96px; } .icon-arrow-down { background-position: -312px -96px; } .icon-share-alt { background-position: -336px -96px; } .icon-resize-full { background-position: -360px -96px; } .icon-resize-small { background-position: -384px -96px; } .icon-plus { background-position: -408px -96px; } .icon-minus { background-position: -433px -96px; } .icon-asterisk { background-position: -456px -96px; } .icon-exclamation-sign { background-position: 0 -120px; } .icon-gift { background-position: -24px -120px; } .icon-leaf { background-position: -48px -120px; } .icon-fire { background-position: -72px -120px; } .icon-eye-open { background-position: -96px -120px; } .icon-eye-close { background-position: -120px -120px; } .icon-warning-sign { background-position: -144px -120px; } .icon-plane { background-position: -168px -120px; } .icon-calendar { background-position: -192px -120px; } .icon-random { background-position: -216px -120px; } .icon-comment { background-position: -240px -120px; } .icon-magnet { background-position: -264px -120px; } .icon-chevron-up { background-position: -288px -120px; } .icon-chevron-down { background-position: -313px -119px; } .icon-retweet { background-position: -336px -120px; } .icon-shopping-cart { background-position: -360px -120px; } .icon-folder-close { background-position: -384px -120px; } .icon-folder-open { background-position: -408px -120px; } .icon-resize-vertical { background-position: -432px -119px; } .icon-resize-horizontal { background-position: -456px -118px; } .icon-hdd { background-position: 0 -144px; } .dropdown { position: relative; } .dropdown-toggle { *margin-bottom: -3px; } .dropdown-toggle:active, .open .dropdown-toggle { outline: 0; } .caret { display: inline-block; width: 0; height: 0; text-indent: -99999px; *text-indent: 0; vertical-align: top; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid #000; opacity: 0.3; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=30); filter: alpha(opacity=30); content: "\2193"; } .dropdown .caret { margin-top: 8px; margin-left: 2px; } .dropdown:hover .caret, .open.dropdown .caret { opacity: 1; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); filter: alpha(opacity=100); } .dropdown-menu { position: absolute; top: 100%; left: 0; z-index: 1000; float: left; display: none; min-width: 160px; _width: 160px; padding: 4px 0; margin: 0; list-style: none; background-color: #fff; border-color: #ccc; border-color: rgba(0,0,0,0.2); border-style: solid; border-width: 1px; -webkit-background-clip: padding-box; -moz-background-clip: padding-box; background-clip: padding-box; *border-right-width: 2px; *border-bottom-width: 2px; } .dropdown-menu.bottom-up { top: auto; bottom: 100%; margin-bottom: 2px; } .dropdown-menu .divider { height: 1px; margin: 5px 1px; overflow: hidden; background-color: #e5e5e5; border-bottom: 1px solid #fff; *width: 100%; *margin: -5px 0 5px; } .dropdown-menu a { display: block; padding: 3px 15px; clear: both; font-weight: normal; line-height: 18px; color: #555; white-space: nowrap; } .dropdown-menu li > a:hover, .dropdown-menu .active > a, .dropdown-menu .active > a:hover { color: #fff; text-decoration: none; background-color: #525252; } .dropdown.open { *z-index: 1000; } .dropdown.open .dropdown-toggle { color: #fff; background: #ccc; background: rgba(0,0,0,0.3); } .dropdown.open .dropdown-menu { display: block; } .typeahead { margin-top: 2px; } .well { min-height: 20px; padding: 19px; margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #eee; border: 1px solid rgba(0,0,0,0.05); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.05); -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.05); box-shadow: inset 0 1px 1px rgba(0,0,0,0.05); } .well blockquote { border-color: #ddd; border-color: rgba(0,0,0,0.15); } .fade { -webkit-transition: opacity 0.15s linear; -moz-transition: opacity 0.15s linear; -ms-transition: opacity 0.15s linear; -o-transition: opacity 0.15s linear; transition: opacity 0.15s linear; opacity: 0; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); filter: alpha(opacity=0); } .fade.in { opacity: 1; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); filter: alpha(opacity=100); } .collapse { -webkit-transition: height 0.35s ease; -moz-transition: height 0.35s ease; -ms-transition: height 0.35s ease; -o-transition: height 0.35s ease; transition: height 0.35s ease; position: relative; overflow: hidden; height: 0; } .collapse.in { height: auto; } .close { float: right; font-size: 20px; font-weight: bold; line-height: 18px; color: #000; text-shadow: 0 1px 0 #fff; opacity: 0.2; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=20); filter: alpha(opacity=20); } .close:hover { color: #000; text-decoration: none; opacity: 0.4; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40); filter: alpha(opacity=40); cursor: pointer; } .btn { display: inline-block; padding: 4px 10px 4px; margin-bottom: 0; font-size: 13px; line-height: 18px; color: #444; text-align: center; text-shadow: 0 1px 1px rgba(255,255,255,0.75); vertical-align: middle; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); border-color: #e6e6e6 #e6e6e6 #c3c3c3; border-color: rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); border: 1px solid #ccc; border-bottom-color: #bbb; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05); -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05); box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05); cursor: pointer; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); *margin-left: 0.3em; } .btn:hover, .btn:active, .btn.active, .btn.disabled, .btn[disabled] { background-color: #e6e6e6; } .btn:active, .btn.active { background-color: #cfcfcf \9; } .btn:first-child { *margin-left: 0; } .btn:hover { color: #444; text-decoration: none; background-color: #e6e6e6; background-position: 0 -15px; -webkit-transition: background-position 0.1s linear; -moz-transition: background-position 0.1s linear; -ms-transition: background-position 0.1s linear; -o-transition: background-position 0.1s linear; transition: background-position 0.1s linear; } .btn:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .btn.active, .btn:active { background-image: none; -webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.05); -moz-box-shadow: inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.05); box-shadow: inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.05); background-color: #e6e6e6; background-color: #d9d9d9 \9; outline: 0; } .btn.disabled, .btn[disabled] { cursor: default; background-image: none; background-color: #e6e6e6; opacity: 0.65; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=65); filter: alpha(opacity=65); -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .btn-large { padding: 9px 14px; font-size: 15px; line-height: normal; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .btn-large [class^="icon-"] { margin-top: 1px; } .btn-small { padding: 5px 9px; font-size: 11px; line-height: 16px; } .btn-small [class^="icon-"] { margin-top: -1px; } .btn-mini { padding: 2px 6px; font-size: 11px; line-height: 14px; } .btn-primary, .btn-primary:hover, .btn-warning, .btn-warning:hover, .btn-danger, .btn-danger:hover, .btn-success, .btn-success:hover, .btn-info, .btn-info:hover, .btn-inverse, .btn-inverse:hover { text-shadow: 0 -1px 0 rgba(0,0,0,0.25); color: #fff; } .btn-primary.active, .btn-warning.active, .btn-danger.active, .btn-success.active, .btn-info.active, .btn-inverse.active { color: rgba(255,255,255,0.75); } .btn-primary { text-shadow: 0 -1px 0 rgba(0,0,0,0.25); border-color: #525252 #525252 #464646; border-color: rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-primary:hover, .btn-primary:active, .btn-primary.active, .btn-primary.disabled, .btn-primary[disabled] { background-color: #525252; } .btn-primary:active, .btn-primary.active { background-color: #4a4a4a \9; } .btn-warning { text-shadow: 0 -1px 0 rgba(0,0,0,0.25); border-color: #f89406 #f89406 #d37e05; border-color: rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-warning:hover, .btn-warning:active, .btn-warning.active, .btn-warning.disabled, .btn-warning[disabled] { background-color: #f89406; } .btn-warning:active, .btn-warning.active { background-color: #df8505 \9; } .btn-danger { text-shadow: 0 -1px 0 rgba(0,0,0,0.25); border-color: #bd362f #bd362f #a12e28; border-color: rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-danger:hover, .btn-danger:active, .btn-danger.active, .btn-danger.disabled, .btn-danger[disabled] { background-color: #bd362f; } .btn-danger:active, .btn-danger.active { background-color: #aa312a \9; } .btn-success { text-shadow: 0 -1px 0 rgba(0,0,0,0.25); border-color: #51a351 #51a351 #458b45; border-color: rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-success:hover, .btn-success:active, .btn-success.active, .btn-success.disabled, .btn-success[disabled] { background-color: #51a351; } .btn-success:active, .btn-success.active { background-color: #499349 \9; } .btn-info { text-shadow: 0 -1px 0 rgba(0,0,0,0.25); border-color: #2f96b4 #2f96b4 #287f99; border-color: rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-info:hover, .btn-info:active, .btn-info.active, .btn-info.disabled, .btn-info[disabled] { background-color: #2f96b4; } .btn-info:active, .btn-info.active { background-color: #2a87a2 \9; } .btn-inverse { text-shadow: 0 -1px 0 rgba(0,0,0,0.25); border-color: #262626 #262626 #202020; border-color: rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-inverse:hover, .btn-inverse:active, .btn-inverse.active, .btn-inverse.disabled, .btn-inverse[disabled] { background-color: #262626; } .btn-inverse:active, .btn-inverse.active { background-color: #222 \9; } button.btn, input[type="submit"].btn { *padding-top: 2px; *padding-bottom: 2px; } button.btn::-moz-focus-inner, input[type="submit"].btn::-moz-focus-inner { padding: 0; border: 0; } button.btn.large, input[type="submit"].btn.large { *padding-top: 7px; *padding-bottom: 7px; } button.btn.small, input[type="submit"].btn.small { *padding-top: 3px; *padding-bottom: 3px; } .btn-group { position: relative; *zoom: 1; *margin-left: 0.3em; } .btn-group:before, .btn-group:after { display: table; content: ""; } .btn-group:after { clear: both; } .btn-group:first-child { *margin-left: 0; } .btn-group + .btn-group { margin-left: 5px; } .btn-toolbar { margin-top: 9px; margin-bottom: 9px; } .btn-toolbar .btn-group { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; } .btn-group .btn { position: relative; float: left; margin-left: -1px; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .btn-group .btn:first-child { margin-left: 0; -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px; } .btn-group .btn:last-child, .btn-group .dropdown-toggle { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; -webkit-border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px; } .btn-group .btn.large:first-child { margin-left: 0; -webkit-border-top-left-radius: 6px; -moz-border-radius-topleft: 6px; border-top-left-radius: 6px; -webkit-border-bottom-left-radius: 6px; -moz-border-radius-bottomleft: 6px; border-bottom-left-radius: 6px; } .btn-group .btn.large:last-child, .btn-group .large.dropdown-toggle { -webkit-border-top-right-radius: 6px; -moz-border-radius-topright: 6px; border-top-right-radius: 6px; -webkit-border-bottom-right-radius: 6px; -moz-border-radius-bottomright: 6px; border-bottom-right-radius: 6px; } .btn-group .btn:hover, .btn-group .btn:focus, .btn-group .btn:active, .btn-group .btn.active { z-index: 2; } .btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { outline: 0; } .btn-group .dropdown-toggle { padding-left: 8px; padding-right: 8px; -webkit-box-shadow: inset 1px 0 0 rgba(255,255,255,0.125), inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05); -moz-box-shadow: inset 1px 0 0 rgba(255,255,255,0.125), inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05); box-shadow: inset 1px 0 0 rgba(255,255,255,0.125), inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05); *padding-top: 5px; *padding-bottom: 5px; } .btn-group.open { *z-index: 1000; } .btn-group.open .dropdown-menu { display: block; margin-top: 1px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .btn-group.open .dropdown-toggle { background-image: none; -webkit-box-shadow: inset 0 1px 6px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.05); -moz-box-shadow: inset 0 1px 6px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.05); box-shadow: inset 0 1px 6px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.05); } .btn .caret { margin-top: 7px; margin-left: 0; } .btn:hover .caret, .open.btn-group .caret { opacity: 1; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); filter: alpha(opacity=100); } .btn-primary .caret, .btn-danger .caret, .btn-info .caret, .btn-success .caret, .btn-inverse .caret { border-top-color: #fff; opacity: 0.75; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=75); filter: alpha(opacity=75); } .btn-small .caret { margin-top: 4px; } .alert { padding: 8px 35px 8px 14px; margin-bottom: 18px; text-shadow: 0 1px 0 rgba(255,255,255,0.5); background-color: #fcf8e3; border: 1px solid #fbefd6; } .alert, .alert-heading { color: #c09853; } .alert .close { position: relative; top: -2px; right: -21px; line-height: 18px; } .alert-success { background-color: #dff0d8; border-color: #d7eac8; } .alert-success, .alert-success .alert-heading { color: #468847; } .alert-danger, .alert-error { background-color: #f2dede; border-color: #eed4d8; } .alert-danger, .alert-error, .alert-danger .alert-heading, .alert-error .alert-heading { color: #b94a48; } .alert-info { background-color: #d9edf7; border-color: #bee9f1; } .alert-info, .alert-info .alert-heading { color: #3a87ad; } .alert-block { padding-top: 14px; padding-bottom: 14px; } .alert-block > p, .alert-block > ul { margin-bottom: 0; } .alert-block p + p { margin-top: 5px; } .nav { margin-left: 0; margin-bottom: 18px; list-style: none; } .nav > li > a { display: block; } .nav > li > a:hover { text-decoration: none; background-color: #eee; } .nav .nav-header { display: block; padding: 3px 15px; font-size: 11px; font-weight: bold; line-height: 18px; color: #999; text-shadow: 0 1px 0 rgba(255,255,255,0.5); text-transform: uppercase; } .nav li + .nav-header { margin-top: 9px; } .nav-list { padding-left: 14px; padding-right: 14px; margin-bottom: 0; } .nav-list > li > a, .nav-list .nav-header { margin-left: -15px; margin-right: -15px; text-shadow: 0 1px 0 rgba(255,255,255,0.5); } .nav-list > li > a { padding: 3px 15px; } .nav-list .active > a, .nav-list .active > a:hover { color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,0.2); background-color: #525252; } .nav-list [class^="icon-"] { margin-right: 2px; } .nav-tabs, .nav-pills { *zoom: 1; } .nav-tabs:before, .nav-pills:before, .nav-tabs:after, .nav-pills:after { display: table; content: ""; } .nav-tabs:after, .nav-pills:after { clear: both; } .nav-tabs > li, .nav-pills > li { float: left; } .nav-tabs > li > a, .nav-pills > li > a { padding-right: 12px; padding-left: 12px; margin-right: 2px; line-height: 14px; } .nav-tabs { border-bottom: 1px solid #ddd; } .nav-tabs > li { margin-bottom: -1px; } .nav-tabs > li > a { padding-top: 9px; padding-bottom: 9px; border: 1px solid transparent; } .nav-tabs > li > a:hover { border-color: #eee #eee #ddd; } .nav-tabs > .active > a, .nav-tabs > .active > a:hover { color: #555; background-color: #fff; border: 1px solid #ddd; border-bottom-color: transparent; cursor: default; } .nav-pills > li > a { padding-top: 8px; padding-bottom: 8px; margin-top: 2px; margin-bottom: 2px; } .nav-pills .active > a, .nav-pills .active > a:hover { color: #fff; background-color: #525252; } .nav-stacked > li { float: none; } .nav-stacked > li > a { margin-right: 0; } .nav-tabs.nav-stacked { border-bottom: 0; } .nav-tabs.nav-stacked > li > a { border: 1px solid #ddd; } .nav-tabs.nav-stacked > li > a:hover { border-color: #ddd; z-index: 2; } .nav-pills.nav-stacked > li > a { margin-bottom: 3px; } .nav-pills.nav-stacked > li:last-child > a { margin-bottom: 1px; } .nav-tabs .dropdown-menu, .nav-pills .dropdown-menu { margin-top: 1px; border-width: 1px; } .nav-tabs .dropdown-toggle .caret, .nav-pills .dropdown-toggle .caret { border-top-color: #525252; margin-top: 6px; } .nav-tabs .dropdown-toggle:hover .caret, .nav-pills .dropdown-toggle:hover .caret { border-top-color: #464646; } .nav-tabs .active .dropdown-toggle .caret, .nav-pills .active .dropdown-toggle .caret { border-top-color: #444; } .nav > .dropdown.active > a:hover { color: #000; cursor: pointer; } .nav-tabs .open .dropdown-toggle, .nav-pills .open .dropdown-toggle, .nav > .open.active > a:hover { color: #fff; background-color: #999; border-color: #999; } .nav .open .caret, .nav .open.active .caret, .nav .open a:hover .caret { border-top-color: #fff; opacity: 1; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); filter: alpha(opacity=100); } .tabs-stacked .open > a:hover { border-color: #999; } .tabbable { *zoom: 1; } .tabbable:before, .tabbable:after { display: table; content: ""; } .tabbable:after { clear: both; } .tab-content { overflow: hidden; } .tabs-below .nav-tabs, .tabs-right .nav-tabs, .tabs-left .nav-tabs { border-bottom: 0; } .tab-content > .tab-pane, .pill-content > .pill-pane { display: none; } .tab-content > .active, .pill-content > .active { display: block; } .tabs-below .nav-tabs { border-top: 1px solid #ddd; } .tabs-below .nav-tabs > li { margin-top: -1px; margin-bottom: 0; } .tabs-below .nav-tabs > li > a { -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; } .tabs-below .nav-tabs > li > a:hover { border-bottom-color: transparent; border-top-color: #ddd; } .tabs-below .nav-tabs .active > a, .tabs-below .nav-tabs .active > a:hover { border-color: transparent #ddd #ddd #ddd; } .tabs-left .nav-tabs > li, .tabs-right .nav-tabs > li { float: none; } .tabs-left .nav-tabs > li > a, .tabs-right .nav-tabs > li > a { min-width: 74px; margin-right: 0; margin-bottom: 3px; } .tabs-left .nav-tabs { float: left; margin-right: 19px; border-right: 1px solid #ddd; } .tabs-left .nav-tabs > li > a { margin-right: -1px; -webkit-border-radius: 4px 0 0 4px; -moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; } .tabs-left .nav-tabs > li > a:hover { border-color: #eee #ddd #eee #eee; } .tabs-left .nav-tabs .active > a, .tabs-left .nav-tabs .active > a:hover { border-color: #ddd transparent #ddd #ddd; *border-right-color: #fff; } .tabs-right .nav-tabs { float: right; margin-left: 19px; border-left: 1px solid #ddd; } .tabs-right .nav-tabs > li > a { margin-left: -1px; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; } .tabs-right .nav-tabs > li > a:hover { border-color: #eee #eee #eee #ddd; } .tabs-right .nav-tabs .active > a, .tabs-right .nav-tabs .active > a:hover { border-color: #ddd #ddd #ddd transparent; *border-left-color: #fff; } .navbar { overflow: visible; margin-bottom: 18px; } .navbar-inner { padding-left: 20px; padding-right: 20px; background: #333; } .btn-navbar { display: none; float: right; padding: 7px 10px; margin-left: 5px; margin-right: 5px; background: #333; } .btn-navbar .icon-bar { display: block; width: 18px; height: 2px; background-color: #f5f5f5; } .btn-navbar .icon-bar + .icon-bar { margin-top: 3px; } .nav-collapse.collapse { height: auto; } .navbar .brand:hover { text-decoration: none; } .navbar .brand { float: left; display: block; padding: 8px 20px 12px; margin-left: -20px; font-size: 20px; font-weight: 200; line-height: 1; color: #fff; } .navbar .navbar-text { margin-bottom: 0; line-height: 40px; color: #999; } .navbar .navbar-text a:hover { color: #fff; background-color: transparent; } .navbar .btn, .navbar .btn-group { margin-top: 5px; } .navbar .btn-group .btn { margin-top: 0; } .navbar-form { margin-bottom: 0; *zoom: 1; } .navbar-form:before, .navbar-form:after { display: table; content: ""; } .navbar-form:after { clear: both; } .navbar-form input, .navbar-form select { display: inline-block; margin-top: 5px; margin-bottom: 0; } .navbar-form .radio, .navbar-form .checkbox { margin-top: 5px; } .navbar-form input[type="image"], .navbar-form input[type="checkbox"], .navbar-form input[type="radio"] { margin-top: 3px; } .navbar-form .input-append, .navbar-form .input-prepend { margin-top: 6px; white-space: nowrap; } .navbar-form .input-append input, .navbar-form .input-prepend input { margin-top: 0; } .navbar-search { position: relative; float: left; margin-top: 6px; margin-bottom: 0; } .navbar-search .search-query { padding: 4px 9px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 13px; font-weight: normal; line-height: 1; color: #fff; color: rgba(255,255,255,0.75); background: #666; background: rgba(255,255,255,0.3); border: 1px solid #111; -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1), 0 1px 0px rgba(255,255,255,0.15); -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1), 0 1px 0px rgba(255,255,255,0.15); box-shadow: inset 0 1px 2px rgba(0,0,0,0.1), 0 1px 0px rgba(255,255,255,0.15); -webkit-transition: none; -moz-transition: none; -ms-transition: none; -o-transition: none; transition: none; } .navbar-search .search-query :-moz-placeholder { color: #eee; } .navbar-search .search-query ::-webkit-input-placeholder { color: #eee; } .navbar-search .search-query:hover { color: #fff; background-color: #999; background-color: rgba(255,255,255,0.5); } .navbar-search .search-query:focus, .navbar-search .search-query.focused { padding: 5px 10px; color: #444; text-shadow: 0 1px 0 #fff; background-color: #fff; border: 0; -webkit-box-shadow: 0 0 3px rgba(0,0,0,0.15); -moz-box-shadow: 0 0 3px rgba(0,0,0,0.15); box-shadow: 0 0 3px rgba(0,0,0,0.15); outline: 0; } .navbar-fixed-top { position: fixed; top: 0; right: 0; left: 0; z-index: 1030; } .navbar-fixed-top .navbar-inner { padding-left: 0; padding-right: 0; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .navbar .nav { position: relative; left: 0; display: block; float: left; margin: 0 10px 0 0; } .navbar .nav.pull-right { float: right; } .navbar .nav > li { display: block; float: left; } .navbar .nav > li > a { float: none; padding: 10px 10px 11px; line-height: 19px; color: #999; text-decoration: none; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); } .navbar .nav > li > a:hover { background-color: transparent; color: #fff; text-decoration: none; } .navbar .nav .active > a, .navbar .nav .active > a:hover { color: #fff; text-decoration: none; background-color: #333; } .navbar .divider-vertical { height: 40px; width: 1px; margin: 0 9px; overflow: hidden; background-color: #333; border-right: 1px solid #444; } .navbar .nav.pull-right { margin-left: 10px; margin-right: 0; } .navbar .dropdown-menu { margin-top: 1px; } .navbar .dropdown-menu:before { content: ''; display: inline-block; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 7px solid #ccc; border-bottom-color: rgba(0,0,0,0.2); position: absolute; top: -7px; left: 9px; } .navbar .dropdown-menu:after { content: ''; display: inline-block; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #fff; position: absolute; top: -6px; left: 10px; } .navbar .nav .dropdown-toggle .caret, .navbar .nav .open.dropdown .caret { border-top-color: #fff; } .navbar .nav .active .caret { opacity: 1; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); filter: alpha(opacity=100); } .navbar .nav .open > .dropdown-toggle, .navbar .nav .active > .dropdown-toggle, .navbar .nav .open.active > .dropdown-toggle { background-color: transparent; } .navbar .nav .active > .dropdown-toggle:hover { color: #fff; } .navbar .nav.pull-right .dropdown-menu { left: auto; right: 0; } .navbar .nav.pull-right .dropdown-menu:before { left: auto; right: 12px; } .navbar .nav.pull-right .dropdown-menu:after { left: auto; right: 13px; } .breadcrumb { padding: 7px 14px; margin: 0 0 18px; background-color: #f5f5f5; background-repeat: repeat-x; background-image: -khtml-gradient(linear, left top, left bottom, from(#fff), to(#f5f5f5)); background-image: -moz-linear-gradient(top, #fff, #f5f5f5); background-image: -ms-linear-gradient(top, #fff, #f5f5f5); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #f5f5f5)); background-image: -webkit-linear-gradient(top, #fff, #f5f5f5); background-image: -o-linear-gradient(top, #fff, #f5f5f5); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(1, #f5f5f5)); background-image: -webkit-linear-gradient(top, #fff 0%, #f5f5f5 100%); background-image: -moz-linear-gradient(top, #fff 0%, #f5f5f5 100%); background-image: -ms-linear-gradient(top, #fff 0%, #f5f5f5 100%); background-image: -o-linear-gradient(top, #fff 0%, #f5f5f5 100%); background-image: linear-gradient(top, #fff 0%, #f5f5f5 100%); border: 1px solid #ddd; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: inset 0 1px 0 #fff; -moz-box-shadow: inset 0 1px 0 #fff; box-shadow: inset 0 1px 0 #fff; } .breadcrumb li { display: inline-block; text-shadow: 0 1px 0 #fff; } .breadcrumb .divider { padding: 0 5px; color: #999; } .breadcrumb .active a { color: #444; } .pagination { height: 36px; margin: 18px 0; } .pagination ul { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; margin-left: 0; margin-bottom: 0; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.05); -moz-box-shadow: 0 1px 2px rgba(0,0,0,0.05); box-shadow: 0 1px 2px rgba(0,0,0,0.05); } .pagination li { display: inline; } .pagination a { float: left; padding: 0 14px; line-height: 34px; text-decoration: none; border: 1px solid #ddd; border-left-width: 0; } .pagination a:hover, .pagination .active a { background-color: #f5f5f5; } .pagination .active a { color: #999; cursor: default; } .pagination .disabled a, .pagination .disabled a:hover { color: #999; background-color: transparent; cursor: default; } .pagination li:first-child a { border-left-width: 1px; -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; } .pagination li:last-child a { -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; } .pagination-centered { text-align: center; } .pagination-right { text-align: right; } .pager { margin-left: 0; margin-bottom: 18px; list-style: none; text-align: center; *zoom: 1; } .pager:before, .pager:after { display: table; content: ""; } .pager:after { clear: both; } .pager li { display: inline; } .pager a { display: inline-block; padding: 5px 14px; background-color: #fff; border: 1px solid #ddd; -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; } .pager a:hover { text-decoration: none; background-color: #f5f5f5; } .pager .next a { float: right; } .pager .previous a { float: left; } .modal-open .dropdown-menu { z-index: 2050; } .modal-open .dropdown.open { *z-index: 2050; } .modal-open .popover { z-index: 2060; } .modal-open .tooltip { z-index: 2070; } .modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background-color: #000; } .modal-backdrop.fade { opacity: 0; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); filter: alpha(opacity=0); } .modal-backdrop, .modal-backdrop.fade.in { opacity: 0.8; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); filter: alpha(opacity=80); } .modal { position: fixed; left: 50%; z-index: 1050; overflow: auto; width: 600px; margin: 0 0 0 -300px; background-color: #fff; border: 1px solid #999; border: 1px solid rgba(0,0,0,0.3); *border: 1px solid #999; /* IE6-7 */ -webkit-background-clip: padding-box; -moz-background-clip: padding-box; background-clip: padding-box; } .modal.fade { -webkit-transition: opacity .3s linear, top .3s ease-out, bottom .3s ease-out; -moz-transition: opacity .3s linear, top .3s ease-out, bottom .3s ease-out; -ms-transition: opacity .3s linear, top .3s ease-out, bottom .3s ease-out; -o-transition: opacity .3s linear, top .3s ease-out, bottom .3s ease-out; transition: opacity .3s linear, top .3s ease-out, bottom .3s ease-out; top: -25%; bottom: 25%; } .modal.fade.in { top: 20px; bottom: 20px; } .modal-header { padding: 9px 15px; border-bottom: 1px solid #eee; } .modal-header .close { margin-top: 2px; } .modal-body { padding: 15px; } .modal-body ul { list-style-type: none; margin: 0; padding: 0; } .modal-body ul li { border-bottom: 1px solid #ccc; margin: 5px 0; } .modal-body ul li:last-child { border: none; } .modal-body ul li a { text-decoration: none; color: #000; } .modal-body ul li a.delete_local_file { float: right; background: none; } .modal-body ul li a.delete_local_file:hover { background: none; color: #f00; } .modal-body ul li a.delete_local_file:hover:before { content: "Delete "; } .modal-body ul li a:hover { background: #f6f6f6; } #myModalBody { position: absolute; width: 565px; top: 45px; bottom: 10px; } #modalBodyText { width: 100%; height: 100%; background-color: transparent; } .modal-body .modal-form { margin-bottom: 0; } .modal-footer { padding: 14px 15px 15px; margin-bottom: 0; background-color: #f5f5f5; border-top: 1px solid #ddd; *zoom: 1; } .modal-footer:before, .modal-footer:after { display: table; content: ""; } .modal-footer:after { clear: both; } .modal-footer .btn { float: right; margin-left: 5px; margin-bottom: 0; } .tooltip { position: absolute; z-index: 1020; display: block; visibility: visible; padding: 5px; font-size: 11px; opacity: 0; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); filter: alpha(opacity=0); } .tooltip.in { opacity: 0.8; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); filter: alpha(opacity=80); } .tooltip.top { margin-top: -2px; } .tooltip.right { margin-left: 2px; } .tooltip.bottom { margin-top: 2px; } .tooltip.left { margin-left: -2px; } .tooltip.top .tooltip-arrow { bottom: 0; left: 50%; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid #000; } .tooltip.left .tooltip-arrow { top: 50%; right: 0; margin-top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 5px solid #000; } .tooltip.bottom .tooltip-arrow { top: 0; left: 50%; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 5px solid #000; } .tooltip.right .tooltip-arrow { top: 50%; left: 0; margin-top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-right: 5px solid #000; } .tooltip-inner { max-width: 200px; padding: 3px 8px; color: #fff; text-align: center; text-decoration: none; background-color: #000; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .tooltip-arrow { position: absolute; width: 0; height: 0; } .popover { position: absolute; top: 0; left: 0; z-index: 1010; display: none; padding: 5px; } .popover.top { margin-top: -5px; } .popover.right { margin-left: 5px; } .popover.bottom { margin-top: 5px; } .popover.left { margin-left: -5px; } .popover.top .arrow { bottom: 0; left: 50%; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid #000; } .popover.right .arrow { top: 50%; left: 0; margin-top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-right: 5px solid #000; } .popover.bottom .arrow { top: 0; left: 50%; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 5px solid #000; } .popover.left .arrow { top: 50%; right: 0; margin-top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 5px solid #000; } .popover .arrow { position: absolute; width: 0; height: 0; } .popover-inner { padding: 3px; width: 280px; overflow: hidden; background: #000; background: rgba(0,0,0,0.8); -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; -webkit-box-shadow: 0 3px 7px rgba(0,0,0,0.3); -moz-box-shadow: 0 3px 7px rgba(0,0,0,0.3); box-shadow: 0 3px 7px rgba(0,0,0,0.3); } .popover-title { padding: 9px 15px; line-height: 1; background-color: #f5f5f5; border-bottom: 1px solid #eee; -webkit-border-radius: 3px 3px 0 0; -moz-border-radius: 3px 3px 0 0; border-radius: 3px 3px 0 0; } .popover-content { padding: 14px; background-color: #fff; -webkit-border-radius: 0 0 3px 3px; -moz-border-radius: 0 0 3px 3px; border-radius: 0 0 3px 3px; -webkit-background-clip: padding-box; -moz-background-clip: padding-box; background-clip: padding-box; } .popover-content p, .popover-content ul, .popover-content ol { margin-bottom: 0; } .thumbnails { margin-left: -20px; list-style: none; *zoom: 1; } .thumbnails:before, .thumbnails:after { display: table; content: ""; } .thumbnails:after { clear: both; } .thumbnails > li { float: left; margin: 0 0 18px 20px; } .thumbnail { display: block; padding: 4px; line-height: 1; border: 1px solid #ddd; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.075); -moz-box-shadow: 0 1px 1px rgba(0,0,0,0.075); box-shadow: 0 1px 1px rgba(0,0,0,0.075); } a.thumbnail:hover { border-color: #525252; -webkit-box-shadow: 0 1px 4px rgba(0,105,214,0.25); -moz-box-shadow: 0 1px 4px rgba(0,105,214,0.25); box-shadow: 0 1px 4px rgba(0,105,214,0.25); } .thumbnail > img { display: block; max-width: 100%; margin-left: auto; margin-right: auto; } .thumbnail .caption { padding: 9px; } .label { padding: 2px 4px 3px; font-size: 11.049999999999999px; font-weight: bold; color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); background-color: #999; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .label:hover { color: #fff; text-decoration: none; } .label-important { background-color: #b94a48; } .label-important:hover { background-color: #a74240; } .label-warning { background-color: #f89406; } .label-warning:hover { background-color: #df8505; } .label-success { background-color: #468847; } .label-success:hover { background-color: #3f7a40; } .label-info { background-color: #3a87ad; } .label-info:hover { background-color: #347a9c; } .label-inverse { background-color: #444; } .label-inverse:hover { background-color: #3d3d3d; } .badge { padding: 1px 9px 2px; font-size: 11.049999999999999px; font-weight: bold; white-space: nowrap; color: #fff; background-color: #999; -webkit-border-radius: 9px; -moz-border-radius: 9px; border-radius: 9px; } .badge:hover { color: #fff; text-decoration: none; cursor: pointer; } .badge-error { background-color: #b94a48; } .badge-error:hover { background-color: #a74240; } .badge-warning { background-color: #f89406; } .badge-warning:hover { background-color: #df8505; } .badge-success { background-color: #468847; } .badge-success:hover { background-color: #3f7a40; } .badge-info { background-color: #3a87ad; } .badge-info:hover { background-color: #347a9c; } .badge-inverse { background-color: #444; } .badge-inverse:hover { background-color: #3d3d3d; } .progress { overflow: hidden; height: 18px; margin-bottom: 18px; background-color: #f9f9f9; background-repeat: repeat-x; background-image: -khtml-gradient(linear, left top, left bottom, from(#f5f5f5), to(#f9f9f9)); background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: -ms-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f5f5f5), color-stop(100%, #f9f9f9)); background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f5f5f5), color-stop(1, #f9f9f9)); background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #f9f9f9 100%); background-image: -moz-linear-gradient(top, #f5f5f5 0%, #f9f9f9 100%); background-image: -ms-linear-gradient(top, #f5f5f5 0%, #f9f9f9 100%); background-image: -o-linear-gradient(top, #f5f5f5 0%, #f9f9f9 100%); background-image: linear-gradient(top, #f5f5f5 0%, #f9f9f9 100%); -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .progress .bar { width: 0%; height: 18px; color: #fff; font-size: 12px; text-align: center; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); background-color: #0480be; background-repeat: repeat-x; background-image: -khtml-gradient(linear, left top, left bottom, from(#149bdf), to(#0480be)); background-image: -moz-linear-gradient(top, #149bdf, #0480be); background-image: -ms-linear-gradient(top, #149bdf, #0480be); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #149bdf), color-stop(100%, #0480be)); background-image: -webkit-linear-gradient(top, #149bdf, #0480be); background-image: -o-linear-gradient(top, #149bdf, #0480be); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #149bdf), color-stop(1, #0480be)); background-image: -webkit-linear-gradient(top, #149bdf 0%, #0480be 100%); background-image: -moz-linear-gradient(top, #149bdf 0%, #0480be 100%); background-image: -ms-linear-gradient(top, #149bdf 0%, #0480be 100%); background-image: -o-linear-gradient(top, #149bdf 0%, #0480be 100%); background-image: linear-gradient(top, #149bdf 0%, #0480be 100%); -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15); -moz-box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15); box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15); -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-transition: width 0.6s ease; -moz-transition: width 0.6s ease; -ms-transition: width 0.6s ease; -o-transition: width 0.6s ease; transition: width 0.6s ease; } .progress-striped .bar { background-color: #62c462; background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0.25, rgba(255,255,255,0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255,255,255,0.15)), color-stop(0.75, rgba(255,255,255,0.15)), color-stop(0.75, transparent), color-stop(1, transparent)); background-image: -webkit-linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); background-image: -moz-linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); background-image: -ms-linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); background-image: -o-linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); background-image: linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); -webkit-background-size: 40px 40px; -moz-background-size: 40px 40px; -o-background-size: 40px 40px; background-size: 40px 40px; } .progress.active .bar { -webkit-animation: progress-bar-stripes 2s linear infinite; -moz-animation: progress-bar-stripes 2s linear infinite; animation: progress-bar-stripes 2s linear infinite; } .progress-danger .bar { background-color: #c43c35; background-repeat: repeat-x; background-image: -khtml-gradient(linear, left top, left bottom, from(#ee5f5b), to(#c43c35)); background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ee5f5b), color-stop(100%, #c43c35)); background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ee5f5b), color-stop(1, #c43c35)); background-image: -webkit-linear-gradient(top, #ee5f5b 0%, #c43c35 100%); background-image: -moz-linear-gradient(top, #ee5f5b 0%, #c43c35 100%); background-image: -ms-linear-gradient(top, #ee5f5b 0%, #c43c35 100%); background-image: -o-linear-gradient(top, #ee5f5b 0%, #c43c35 100%); background-image: linear-gradient(top, #ee5f5b 0%, #c43c35 100%); } .progress-danger.progress-striped .bar { background-color: #ee5f5b; background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0.25, rgba(255,255,255,0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255,255,255,0.15)), color-stop(0.75, rgba(255,255,255,0.15)), color-stop(0.75, transparent), color-stop(1, transparent)); background-image: -webkit-linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); background-image: -moz-linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); background-image: -ms-linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); background-image: -o-linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); background-image: linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); } .progress-success .bar { background-color: #57a957; background-repeat: repeat-x; background-image: -khtml-gradient(linear, left top, left bottom, from(#62c462), to(#57a957)); background-image: -moz-linear-gradient(top, #62c462, #57a957); background-image: -ms-linear-gradient(top, #62c462, #57a957); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #62c462), color-stop(100%, #57a957)); background-image: -webkit-linear-gradient(top, #62c462, #57a957); background-image: -o-linear-gradient(top, #62c462, #57a957); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #62c462), color-stop(1, #57a957)); background-image: -webkit-linear-gradient(top, #62c462 0%, #57a957 100%); background-image: -moz-linear-gradient(top, #62c462 0%, #57a957 100%); background-image: -ms-linear-gradient(top, #62c462 0%, #57a957 100%); background-image: -o-linear-gradient(top, #62c462 0%, #57a957 100%); background-image: linear-gradient(top, #62c462 0%, #57a957 100%); } .progress-success.progress-striped .bar { background-color: #62c462; background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0.25, rgba(255,255,255,0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255,255,255,0.15)), color-stop(0.75, rgba(255,255,255,0.15)), color-stop(0.75, transparent), color-stop(1, transparent)); background-image: -webkit-linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); background-image: -moz-linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); background-image: -ms-linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); background-image: -o-linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); background-image: linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); } .progress-info .bar { background-color: #339bb9; background-repeat: repeat-x; background-image: -khtml-gradient(linear, left top, left bottom, from(#5bc0de), to(#339bb9)); background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); background-image: -ms-linear-gradient(top, #5bc0de, #339bb9); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #5bc0de), color-stop(100%, #339bb9)); background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); background-image: -o-linear-gradient(top, #5bc0de, #339bb9); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #5bc0de), color-stop(1, #339bb9)); background-image: -webkit-linear-gradient(top, #5bc0de 0%, #339bb9 100%); background-image: -moz-linear-gradient(top, #5bc0de 0%, #339bb9 100%); background-image: -ms-linear-gradient(top, #5bc0de 0%, #339bb9 100%); background-image: -o-linear-gradient(top, #5bc0de 0%, #339bb9 100%); background-image: linear-gradient(top, #5bc0de 0%, #339bb9 100%); } .progress-info.progress-striped .bar { background-color: #5bc0de; background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0.25, rgba(255,255,255,0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255,255,255,0.15)), color-stop(0.75, rgba(255,255,255,0.15)), color-stop(0.75, transparent), color-stop(1, transparent)); background-image: -webkit-linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); background-image: -moz-linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); background-image: -ms-linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); background-image: -o-linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); background-image: linear-gradient(top left, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent 100%); } @-moz-keyframes progress-bar-stripes { 0% { background-position: 0 0; } 100% { background-position: 40px 0; } } @-webkit-keyframes progress-bar-stripes { 0% { background-position: 0 0; } 100% { background-position: 40px 0; } } @-o-keyframes progress-bar-stripes { 0% { background-position: 0 0; } 100% { background-position: 40px 0; } } @-ms-keyframes progress-bar-stripes { 0% { background-position: 0 0; } 100% { background-position: 40px 0; } } @keyframes progress-bar-stripes { 0% { background-position: 0 0; } 100% { background-position: 40px 0; } } .accordion { margin-bottom: 18px; } .accordion-group { margin-bottom: 2px; border: 1px solid #e5e5e5; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .accordion-heading { border-bottom: 0; } .accordion-heading .accordion-toggle { display: block; padding: 8px 15px; } .accordion-inner { padding: 9px 15px; border-top: 1px solid #e5e5e5; } .carousel { position: relative; margin-bottom: 18px; line-height: 1; } .carousel-inner { overflow: hidden; width: 100%; position: relative; } .carousel .item { display: none; position: relative; -webkit-transition: 0.6s ease-in-out left; -moz-transition: 0.6s ease-in-out left; -ms-transition: 0.6s ease-in-out left; -o-transition: 0.6s ease-in-out left; transition: 0.6s ease-in-out left; } .carousel .item > img { display: block; line-height: 1; } .carousel .active, .carousel .next, .carousel .prev { display: block; } .carousel .active { left: 0; } .carousel .next, .carousel .prev { position: absolute; top: 0; width: 100%; } .carousel .next { left: 100%; } .carousel .prev { left: -100%; } .carousel .next.left, .carousel .prev.right { left: 0; } .carousel .active.left { left: -100%; } .carousel .active.right { left: 100%; } .carousel-control { position: absolute; top: 40%; left: 15px; width: 40px; height: 40px; margin-top: -20px; font-size: 60px; font-weight: 100; line-height: 30px; color: #fff; text-align: center; background: #333; border: 3px solid #fff; -webkit-border-radius: 23px; -moz-border-radius: 23px; border-radius: 23px; opacity: 0.5; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); filter: alpha(opacity=50); } .carousel-control.right { left: auto; right: 15px; } .carousel-control:hover { color: #fff; text-decoration: none; opacity: 0.9; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=90); filter: alpha(opacity=90); } .carousel-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 15px 5px; background: #444; background: rgba(0,0,0,0.75); } .carousel-caption h4, .carousel-caption p { color: #fff; } .hero-unit { padding: 60px; margin-bottom: 30px; background-color: #f5f5f5; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; } .hero-unit h1 { margin-bottom: 0; font-size: 60px; line-height: 1; letter-spacing: -1px; } .hero-unit p { font-size: 18px; font-weight: 200; line-height: 27px; } .pull-right { float: right; } .pull-left { float: left; } .hide { display: none; } .show { display: block; } .invisible { visibility: hidden; } /* * Bootstrap Responsive v2.0.1 * * Copyright 2012 Twitter, Inc * Licensed under the Apache License v2.0 * http://www.apache.org/licenses/LICENSE-2.0 * * Designed and built with all the love in the world @twitter by @mdo and @fat. */ .hidden { display: none; visibility: hidden; } @media (max-width: 480px) { .nav-collapse { -webkit-transform: transform: translate(0, 0, 0);; } .page-header h1 small { display: block; line-height: 18px; } input[class*="span"], select[class*="span"], textarea[class*="span"], .uneditable-input { display: block; width: 100%; min-height: 28px; /* Make inputs at least the height of their button counterpart */ /* Makes inputs behave like true block-level elements */ -webkit-box-sizing: border-box; /* Older Webkit */ -moz-box-sizing: border-box; /* Older FF */ -ms-box-sizing: border-box; /* IE8 */ -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; /* CSS3 spec*/ } .input-prepend input[class*="span"], .input-append input[class*="span"] { width: auto; } input[type="checkbox"], input[type="radio"] { border: 1px solid #ccc; } .form-horizontal .control-group > label { float: none; width: auto; padding-top: 0; text-align: left; } .form-horizontal .controls { margin-left: 0; } .form-horizontal .control-list { padding-top: 0; } .form-horizontal .form-actions { padding-left: 10px; padding-right: 10px; } .modal { position: absolute; top: 10px; left: 10px; right: 10px; width: auto; margin: 0; } .modal.fade.in { top: auto; } .modal-header .close { padding: 10px; margin: -10px; } .carousel-caption { position: static; } } @media (max-width: 768px) { .container { width: auto; padding: 0 20px; } .row-fluid { width: 100%; } .row { margin-left: 0; } .row > [class*="span"], .row-fluid > [class*="span"] { float: none; display: block; width: auto; margin: 0; } } @media (min-width: 768px) and (max-width: 979px) { .row { margin-left: -20px; *zoom: 1; } .row:before, .row:after { display: table; content: ""; } .row:after { clear: both; } [class*="span"] { float: left; margin-left: 20px; } .span1 { width: 42px; } .span2 { width: 104px; } .span3 { width: 166px; } .span4 { width: 228px; } .span5 { width: 290px; } .span6 { width: 352px; } .span7 { width: 414px; } .span8 { width: 476px; } .span9 { width: 538px; } .span10 { width: 600px; } .span11 { width: 662px; } .span12, .container { width: 724px; } .offset1 { margin-left: 82px; } .offset2 { margin-left: 144px; } .offset3 { margin-left: 206px; } .offset4 { margin-left: 268px; } .offset5 { margin-left: 330px; } .offset6 { margin-left: 392px; } .offset7 { margin-left: 454px; } .offset8 { margin-left: 516px; } .offset9 { margin-left: 578px; } .offset10 { margin-left: 640px; } .offset11 { margin-left: 702px; } .row-fluid { width: 100%; *zoom: 1; } .row-fluid:before, .row-fluid:after { display: table; content: ""; } .row-fluid:after { clear: both; } .row-fluid > [class*="span"] { float: left; margin-left: 2.762430939%; } .row-fluid > [class*="span"]:first-child { margin-left: 0; } .row-fluid .span1 { width: 5.801104972%; } .row-fluid .span2 { width: 11.92271298110079%; } .row-fluid .span3 { width: 18.364824027302372%; } .row-fluid .span4 { width: 25.127438110604743%; } .row-fluid .span5 { width: 32.21055523100791%; } .row-fluid .span6 { width: 39.61417538851186%; } .row-fluid .span7 { width: 47.338298583116604%; } .row-fluid .span8 { width: 55.38292481482213%; } .row-fluid .span9 { width: 63.74805408362846%; } .row-fluid .span10 { width: 72.43368638953558%; } .row-fluid .span11 { width: 81.43982173254348%; } .row-fluid .span12 { width: 90.76646011265217%; } input.span1, textarea.span1, .uneditable-input.span1 { width: 32px; } input.span2, textarea.span2, .uneditable-input.span2 { width: 94px; } input.span3, textarea.span3, .uneditable-input.span3 { width: 156px; } input.span4, textarea.span4, .uneditable-input.span4 { width: 218px; } input.span5, textarea.span5, .uneditable-input.span5 { width: 280px; } input.span6, textarea.span6, .uneditable-input.span6 { width: 342px; } input.span7, textarea.span7, .uneditable-input.span7 { width: 404px; } input.span8, textarea.span8, .uneditable-input.span8 { width: 466px; } input.span9, textarea.span9, .uneditable-input.span9 { width: 528px; } input.span10, textarea.span10, .uneditable-input.span10 { width: 590px; } input.span11, textarea.span11, .uneditable-input.span11 { width: 652px; } input.span12, textarea.span12, .uneditable-input.span12 { width: 714px; } } @media (max-width: 979px) { body { padding-top: 0; } .navbar-fixed-top { position: static; margin-bottom: 18px; } .navbar-fixed-top .navbar-inner { padding: 5px; } .navbar .container { width: auto; padding: 0; } .navbar .brand { padding-left: 10px; padding-right: 10px; margin: 0 0 0 -5px; } .navbar .nav-collapse { clear: left; } .navbar .nav { float: none; margin: 0 0 9px; } .navbar .nav > li { float: none; } .navbar .nav > li > a { margin-bottom: 2px; } .navbar .nav > .divider-vertical { display: none; } .navbar .nav .nav-header { color: #999; text-shadow: none; } .navbar .nav > li > a, .navbar .dropdown-menu a { padding: 6px 15px; font-weight: bold; color: #999; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .navbar .dropdown-menu li + li a { margin-bottom: 2px; } .navbar .nav > li > a:hover, .navbar .dropdown-menu a:hover { background-color: #333; } .navbar .dropdown-menu { position: static; top: auto; left: auto; float: none; display: block; max-width: none; margin: 0 15px; padding: 0; background-color: transparent; border: none; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .navbar .dropdown-menu:before, .navbar .dropdown-menu:after { display: none; } .navbar .dropdown-menu .divider { display: none; } .navbar-form, .navbar-search { float: none; padding: 9px 15px; margin: 9px 0; border-top: 1px solid #333; border-bottom: 1px solid #333; -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 1px 0 rgba(255,255,255,0.1); -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 1px 0 rgba(255,255,255,0.1); box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 1px 0 rgba(255,255,255,0.1); } .navbar .nav.pull-right { float: none; margin-left: 0; } .navbar-static .navbar-inner { padding-left: 10px; padding-right: 10px; } .btn-navbar { display: block; } .nav-collapse { overflow: hidden; height: 0; } } @media (min-width: 980px) { .nav-collapse.collapse { height: auto !important; } } @media (min-width: 1200px) { .row { margin-left: -30px; *zoom: 1; } .row:before, .row:after { display: table; content: ""; } .row:after { clear: both; } [class*="span"] { float: left; margin-left: 30px; } .span1 { width: 70px; } .span2 { width: 170px; } .span3 { width: 270px; } .span4 { width: 370px; } .span5 { width: 470px; } .span6 { width: 570px; } .span7 { width: 670px; } .span8 { width: 770px; } .span9 { width: 870px; } .span10 { width: 970px; } .span11 { width: 1070px; } .span12, .container { width: 1170px; } .offset1 { margin-left: 130px; } .offset2 { margin-left: 230px; } .offset3 { margin-left: 330px; } .offset4 { margin-left: 430px; } .offset5 { margin-left: 530px; } .offset6 { margin-left: 630px; } .offset7 { margin-left: 730px; } .offset8 { margin-left: 830px; } .offset9 { margin-left: 930px; } .offset10 { margin-left: 1030px; } .offset11 { margin-left: 1130px; } .row-fluid { width: 100%; *zoom: 1; } .row-fluid:before, .row-fluid:after { display: table; content: ""; } .row-fluid:after { clear: both; } .row-fluid > [class*="span"] { float: left; margin-left: 2.564102564%; } .row-fluid > [class*="span"]:first-child { margin-left: 0; } .row-fluid .span1 { width: 5.982905983%; } .row-fluid .span2 { width: 12.272627657423625%; } .row-fluid .span3 { width: 18.869165023270874%; } .row-fluid .span4 { width: 25.77251808054175%; } .row-fluid .span5 { width: 32.98268682923625%; } .row-fluid .span6 { width: 40.49967126935437%; } .row-fluid .span7 { width: 48.32347140089612%; } .row-fluid .span8 { width: 56.4540872238615%; } .row-fluid .span9 { width: 64.8915187382505%; } .row-fluid .span10 { width: 73.63576594406312%; } .row-fluid .span11 { width: 82.68682884129936%; } .row-fluid .span12 { width: 92.04470742995923%; } input.span1, textarea.span1, .uneditable-input.span1 { width: 60px; } input.span2, textarea.span2, .uneditable-input.span2 { width: 160px; } input.span3, textarea.span3, .uneditable-input.span3 { width: 260px; } input.span4, textarea.span4, .uneditable-input.span4 { width: 360px; } input.span5, textarea.span5, .uneditable-input.span5 { width: 460px; } input.span6, textarea.span6, .uneditable-input.span6 { width: 560px; } input.span7, textarea.span7, .uneditable-input.span7 { width: 660px; } input.span8, textarea.span8, .uneditable-input.span8 { width: 760px; } input.span9, textarea.span9, .uneditable-input.span9 { width: 860px; } input.span10, textarea.span10, .uneditable-input.span10 { width: 960px; } input.span11, textarea.span11, .uneditable-input.span11 { width: 1060px; } input.span12, textarea.span12, .uneditable-input.span12 { width: 1160px; } .thumbnails { margin-left: -30px; } .thumbnails > li { margin-left: 30px; } } * { outline: 0; } html { overflow-y: hidden; } nav { text-align: left; padding: 12px 20px 12px 9px; } #app_wrap { top: 50px; left: 10px; bottom: 0; right: 10px; position: fixed; } noscript { z-index: 99999; position: absolute; top: 30px; width: 100%; } noscript p { color: #000; font-size: 24px; text-align: center; padding: 10px 0; } #app_wrap > #editor { position: absolute; margin-right: 5px; top: 50px; left: 10px; bottom: 10px; right: 50%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-box-flex: 1; -moz-box-flex: 1; -ms-box-flex: 1; -webkit-box-flex: 1; -moz-box-flex: 1; -ms-box-flex: 1; -o-box-flex: 1; box-flex: 1; } #app_wrap > #preview { position: absolute; margin-left: 5px; padding: 20px; left: 50%; bottom: 10px; right: 10px; top: 50px; overflow: auto; background: rgba(255,255,255,0.9) url("/img/notebook_paper_200x200.gif") repeat scroll top left; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-box-flex: 1; -moz-box-flex: 1; -ms-box-flex: 1; -webkit-box-flex: 1; -moz-box-flex: 1; -ms-box-flex: 1; -o-box-flex: 1; box-flex: 1; } #app_wrap > #preview a { text-decoration: underline; color: #00f; } #github-button { margin: 1% -3px 0 0; float: right; } #filename-counter-container { position: absolute; left: 10px; top: 5px; right: 50%; margin-right: 5px; z-index: 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } #right-top-pane { font-size: 16px; /* match with filename/wordcount input */ position: absolute; right: 10px; top: 5px; left: 50%; margin-left: 5px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } #filename-counter-container > #filename { width: 100%; } #filename-counter-container > #wordcounter { width: 18.5%; float: right; } #filename-counter-container > #filename > span, #wordcounter { overflow: hidden; font-size: 16px; font-style: normal; background: #f1eeee; height: 30px; line-height: 30px; padding: 0 6px; display: block; float: left; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } #filename-counter-container > #filename > span { width: 100%; } #filename-counter-container > #filename > span:focus { outline: 0; } #filename-counter-container > #filename.show-word-count-filename-adjust { width: 80%; display: block; margin: 0 0 0 0; } #notify_container { -webkit-user-select: none; -moz-user-select: none; position: fixed; top: -2px; width: 100%; height: auto; overflow: auto; text-align: center; z-index: 10001; } #notify { -webkit-user-select: none; -moz-user-select: none; width: 300px; margin: 0 auto; background-color: #6c6; background-repeat: repeat-x; background-image: -khtml-gradient(linear, left top, left bottom, from(#cfc), to(#6c6)); background-image: -moz-linear-gradient(top, #cfc, #6c6); background-image: -ms-linear-gradient(top, #cfc, #6c6); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #cfc), color-stop(100%, #6c6)); background-image: -webkit-linear-gradient(top, #cfc, #6c6); background-image: -o-linear-gradient(top, #cfc, #6c6); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #cfc), color-stop(1, #6c6)); background-image: -webkit-linear-gradient(top, #cfc 0%, #6c6 100%); background-image: -moz-linear-gradient(top, #cfc 0%, #6c6 100%); background-image: -ms-linear-gradient(top, #cfc 0%, #6c6 100%); background-image: -o-linear-gradient(top, #cfc 0%, #6c6 100%); background-image: linear-gradient(top, #cfc 0%, #6c6 100%); display: -webkit-box; -webkit-box-orient: horizontal; -webkit-box-pack: center; -webkit-box-align: center; display: -moz-box; -moz-box-orient: horizontal; -moz-box-pack: center; -moz-box-align: center; display: -webkit-box; display: -moz-box; display: -ms-box; display: -o-box; display: box; -webkit-box-orient: horizontal; -moz-box-orient: horizontal; -ms-box-orient: horizontal; -o-box-orient: horizontal; box-orient: horizontal; -webkit-box-pack: center; -moz-box-pack: center; -ms-box-pack: center; -o-box-pack: center; box-pack: center; -webkit-box-align: center; -moz-box-align: center; -ms-box-align: center; -o-box-align: center; box-align: center; border: 1px solid rgba(0,0,0,0.098); color: #444; font-weight: bold; height: auto; line-height: 1.5em; padding: 6px 8px; text-align: center; overflow: auto; display: none; } #main { opacity: 1; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); filter: alpha(opacity=100); -webkit-transition: opacity 0.15s linear; -moz-transition: opacity 0.15s linear; -ms-transition: opacity 0.15s linear; -o-transition: opacity 0.15s linear; transition: opacity 0.15s linear; -webkit-transition: opacity 0.15s linear; -moz-transition: opacity 0.15s linear; -o-transition: opacity 0.15s linear; -ms-transition: opacity 0.15s linear; } #main.bye { opacity: 0; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); filter: alpha(opacity=0); } #loading { position: absolute; top: 0; left: 0; width: 100%; height: 120%; background: #fff; text-align: center; z-index: 99998; } #loading p:first-child { color: #000; margin: 300px auto 0; text-align: center; font-size: 72px; } #loading p:last-child { color: #111; margin: 42px auto; text-align: center; font-size: 18px; } #loading.swift_top { top: -100%; -webkit-transition: top 0.25s ease-out; -moz-transition: top 0.25s ease-out; -ms-transition: top 0.25s ease-out; -o-transition: top 0.25s ease-out; transition: top 0.25s ease-out; -webkit-transition: top 0.25s ease-out; -moz-transition: top 0.25s ease-out; -o-transition: top 0.25s ease-out; -ms-transition: top 0.25s ease-out; } #loading.fade_slow, .fade_slow { -khtml-opacity: 0; -moz-opacity: 0; opacity: 0; -webkit-transition: opacity 0.15s ease-in; -moz-transition: opacity 0.15s ease-in; -o-transition: opacity 0.15s ease-in; -ms-transition: opacity 0.15s ease-in; -webkit-transition: opacity 0.15s ease-in; -moz-transition: opacity 0.15s ease-in; -ms-transition: opacity 0.15s ease-in; -o-transition: opacity 0.15s ease-in; transition: opacity 0.15s ease-in; } .slick { opacity: 1; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); filter: alpha(opacity=100); -webkit-transition: opacity bodyTransitiontime linear; -moz-transition: opacity bodyTransitiontime linear; -ms-transition: opacity bodyTransitiontime linear; -o-transition: opacity bodyTransitiontime linear; transition: opacity bodyTransitiontime linear; -webkit-transition: opacity 0.2s linear; -moz-transition: opacity 0.2s linear; -o-transition: opacity 0.2s linear; -ms-transition: opacity 0.2s linear; } .bye { opacity: 0; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); filter: alpha(opacity=0); } .modal-body ul { margin: 0; padding: 0 0 18px 25px; overflow: auto; } #preview iframe { border: 0px; width: 100%; height: 100%; } .pager .disabled>a, .pager .disabled>a:hover, .pager .disabled>a:focus, .pager .disabled>span { color: #999; background-color: #fff; cursor: not-allowed; } .private_repo { background: transparent url("/img/icon_lock_16x16.png") no-repeat scroll top left; } .private_repo .tree_file { padding-left: 20px; } .private_repo a:hover { background: #f6f6f6; padding-left: 0px; margin-left: 20px; } .topbar div ul { float: none; margin: 2px auto; } .topbar div .core_menu ul li { display: block; float: none; } .shadowbox { margin: 0 auto; } .opacity_ten { -khtml-opacity: 0.1; -moz-opacity: 0.1; opacity: 0.1; } .opacity_thirty { -khtml-opacity: 0.3; -moz-opacity: 0.3; opacity: 0.3; } .set_wrap { color: #ccc; display: block; line-height: 27px; font-size: 0; } .relative { position: relative; } .vendor, .save { padding-left: 30px; } .icon_vendor { position: absolute; } .icon_vendor.github { margin: 3px 0 0 6px; } .icon_vendor.dropbox { margin: 6px 0 0 9px; } .slide_out { margin-top: -60px; -webkit-transition: margin-top 0.2s ease-out; -moz-transition: margin-top 0.2s ease-out; -o-transition: margin-top 0.2s ease-out; -ms-transition: margin-top 0.2s ease-out; -webkit-transition: margin-top 0.2s ease-out; -moz-transition: margin-top 0.2s ease-out; -ms-transition: margin-top 0.2s ease-out; -o-transition: margin-top 0.2s ease-out; transition: margin-top 0.2s ease-out; } .slide_in { margin-top: 0px; -webkit-transition: margin-top 0.2s ease-in; -moz-transition: margin-top 0.2s ease-in; -o-transition: margin-top 0.2s ease-in; -ms-transition: margin-top 0.2s ease-in; -webkit-transition: margin-top 0.2s ease-in; -moz-transition: margin-top 0.2s ease-in; -ms-transition: margin-top 0.2s ease-in; -o-transition: margin-top 0.2s ease-in; transition: margin-top 0.2s ease-in; } .slide_left { margin-top: 0px; -webkit-transition: margin-top 0.2s ease-in; -moz-transition: margin-top 0.2s ease-in; -ms-transition: margin-top 0.2s ease-in; -o-transition: margin-top 0.2s ease-in; transition: margin-top 0.2s ease-in; -webkit-transition: margin-top 0.2s ease-in; -moz-transition: margin-top 0.2s ease-in; -o-transition: margin-top 0.2s ease-in; -ms-transition: margin-top 0.2s ease-in; } .slide_left { right: 25px; -webkit-transition: right 0.2s ease-out; -moz-transition: right 0.2s ease-out; -o-transition: right 0.2s ease-out; -ms-transition: right 0.2s ease-out; -webkit-transition: right 0.2s ease-out; -moz-transition: right 0.2s ease-out; -ms-transition: right 0.2s ease-out; -o-transition: right 0.2s ease-out; transition: right 0.2s ease-out; } .slide_right { right: -40px; -webkit-transition: right 0.2s ease-out; -moz-transition: right 0.2s ease-out; -o-transition: right 0.2s ease-out; -ms-transition: right 0.2s ease-out transition right 0.2s ease-out; } .main-error { margin: 2% auto; max-width: 660px; } .ir { display: block; border: 0; text-indent: -999em; overflow: hidden; background-color: transparent; background-repeat: no-repeat; text-align: left; direction: ltr; *line-height: 0; } .ir br { display: none; } .hidden { display: none; visibility: hidden; } .visuallyhidden.focusable:active, .visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; } @media print { * { background: transparent !important; color: #000 !important; -webkit-box-shadow: none !important; -moz-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; filter: none !important; -ms-filter: none !important; } a, a:visited { text-decoration: underline; } a[href]:after { content: " (" attr(href) ")"; } abbr[title]:after { content: " (" attr(title) ")"; } .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } thead { display: table-header-group; } tr, img { page-break-inside: avoid; } img { max-width: 100% !important; } @page { margin: 0.5cm; } p, h2, h3 { orphans: 3; widows: 3; } h2, h3 { page-break-after: avoid; } } </style></head><body> <h1 id="third-party-components">Third-party components</h1> <h2 id="sdwebimage">SDWebImage</h2> <p><a href="https://github.com/rs/SDWebImage">https://github.com/rs/SDWebImage</a> Copyright (c) Olivier Poitrey <a href="&#109;&#x61;&#x69;&#108;&#x74;&#x6f;&#58;&#x72;&#x73;&#64;&#x64;&#x61;&#x69;&#108;&#121;&#109;&#111;&#116;&#x69;&#x6f;&#x6e;&#46;&#x63;&#x6f;&#109;">&#x72;&#x73;&#64;&#x64;&#x61;&#x69;&#108;&#121;&#109;&#111;&#116;&#x69;&#x6f;&#x6e;&#46;&#x63;&#x6f;&#109;</a> License : <a href="https://github.com/rs/SDWebImage/blob/master/LICENSE">https://github.com/rs/SDWebImage/blob/master/LICENSE</a></p> <h2 id="toast">Toast</h2> <p><a href="https://github.com/scalessec/toast">https://github.com/scalessec/toast</a> Copyright (c) 2013 Charles Scalesse. MIT license</p> <h2 id="images">Images</h2> <p>If unspecified, all other assets are the property of Noco and used in iNoco with their agreement. You have to contact Noco (noco.tv) before reusing them, and before any new release using these assets.</p> <h3 id="wikimedia-commons">Wikimedia commons</h3> <p>Octicons Set : </p> <ul> <li><a href="http://commons.wikimedia.org/wiki/Category:Octicons?uselang=fr">http://commons.wikimedia.org/wiki/Category:Octicons?uselang=fr</a> Wikicons set : </li> <li><a href="http://commons.wikimedia.org/wiki/Category:Wikicons?uselang=fr">http://commons.wikimedia.org/wiki/Category:Wikicons?uselang=fr</a> Heart icons : </li> <li><a href="http://commons.wikimedia.org/wiki/File:Human-emblem-favorite-black-blue-128.png">http://commons.wikimedia.org/wiki/File:Human-emblem-favorite-black-blue-128.png</a></li> <li><a href="http://commons.wikimedia.org/wiki/File:Human-emblem-favorite-black-128.png">http://commons.wikimedia.org/wiki/File:Human-emblem-favorite-black-128.png</a></li> </ul> <h3 id="nolife">Nolife</h3> <p>Noco logo : </p> <ul> <li><a href="https://api.noco.tv/cdata/images/noco-splash.png">https://api.noco.tv/cdata/images/noco-splash.png</a></li> </ul> </body></html>
gizmhail/iNoco
iNoco/TestNoco/oss.html
HTML
mit
118,441
using System; using System.Linq; using System.Reflection; using System.Text; namespace Stealer { public class Spy { public string StealFieldInfo(string className, params string[] fieldsNames) { var sb = new StringBuilder(); sb.AppendLine($"Class under investigation: {className}"); var type = typeof(Hacker); var classInstance = Activator.CreateInstance(type, new object[] { }); var fieldsInfo = type.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static); foreach (FieldInfo field in fieldsInfo.Where(fld => fieldsNames.Contains(fld.Name))) { sb.AppendLine($"{field.Name} = {field.GetValue(classInstance)}"); } return sb.ToString(); } } }
BlueDress/School
C# OOP Advanced/Reflection/Stealer/Spy.cs
C#
mit
857
from .. import Provider as CompanyProvider class Provider(CompanyProvider): formats = ( "{{last_name}} {{company_suffix}}", "{{last_name}} {{last_name}} {{company_suffix}}", "{{large_company}}", ) large_companies = ( "AZAL", "Azergold", "SOCAR", "Socar Polymer", "Global Export Fruits", "Baku Steel Company", "Azersun", "Sun Food", "Azərbaycan Şəkər İstehsalat Birliyi", "Azərsu", "Xəzər Dəniz Gəmiçiliyi", "Azərenerji", "Bakıelektrikşəbəkə", "Azəralüminium", "Bravo", "Azərpambıq Aqrar Sənaye Kompleksi", "CTS-Agro", "Azərtütün Aqrar Sənaye Kompleksi", "Azəripək", "Azfruittrade", "AF Holding", "Azinko Holding", "Gilan Holding", "Azpetrol", "Azərtexnolayn", "Bakı Gəmiqayırma Zavodu", "Gəncə Tekstil Fabriki", "Mətanət A", "İrşad Electronics", ) company_suffixes = ( "ASC", "QSC", "MMC", ) def large_company(self): """ :example: 'SOCAR' """ return self.random_element(self.large_companies)
joke2k/faker
faker/providers/company/az_AZ/__init__.py
Python
mit
1,274
/* * engine.h * * Created on: Mar 9, 2017 * Author: sushil */ #ifndef ENGINE_H_ #define ENGINE_H_ class InputMgr; #include <GfxMgr.h> #include <inputMgr.h> #include <EntityMgr.h> #include <gameMgr.h> #include <Types.h> #include <UiMgr.h> #include <SoundMgr.h> #include <Grid.h> class EntityMgr; class Engine { private: public: Engine(); ~Engine(); EntityMgr* entityMgr; GfxMgr* gfxMgr; InputMgr* inputMgr; GameMgr* gameMgr; UiMgr* uiMgr; SoundMgr* soundMgr; Grid* gridMgr; //ControlMgr* controlMgr; void init(); void run(); void tickAll(float dt); void stop(); void shutdown(); void loadLevel(); // bool keepRunning; bool omegaOn; STATE theState;//Stores the current state that the engine is in float timeSinceLastEvent;//Stores the time (usually) since last state change }; #endif /* ENGINE_H_ */
dissolete/Cries
inc/engine.h
C
mit
900
import formatPhoneNumber, { formatPhoneNumberIntl } from './formatPhoneNumberDefaultMetadata' describe('formatPhoneNumberDefaultMetadata', () => { it('should format phone numbers', () => { formatPhoneNumber('+12133734253', 'NATIONAL').should.equal('(213) 373-4253') formatPhoneNumber('+12133734253', 'INTERNATIONAL').should.equal('+1 213 373 4253') formatPhoneNumberIntl('+12133734253').should.equal('+1 213 373 4253') }) })
halt-hammerzeit/react-phone-number-input
source/formatPhoneNumberDefaultMetadata.test.js
JavaScript
mit
433
import React from 'react'; import { withStyles } from '@material-ui/core/styles'; import { green } from '@material-ui/core/colors'; import Radio, { RadioProps } from '@material-ui/core/Radio'; import RadioButtonUncheckedIcon from '@material-ui/icons/RadioButtonUnchecked'; import RadioButtonCheckedIcon from '@material-ui/icons/RadioButtonChecked'; const GreenRadio = withStyles({ root: { color: green[400], '&$checked': { color: green[600], }, }, checked: {}, })((props: RadioProps) => <Radio color="default" {...props} />); export default function RadioButtons() { const [selectedValue, setSelectedValue] = React.useState('a'); const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => { setSelectedValue(event.target.value); }; return ( <div> <Radio checked={selectedValue === 'a'} onChange={handleChange} value="a" name="radio-button-demo" inputProps={{ 'aria-label': 'A' }} /> <Radio checked={selectedValue === 'b'} onChange={handleChange} value="b" name="radio-button-demo" inputProps={{ 'aria-label': 'B' }} /> <GreenRadio checked={selectedValue === 'c'} onChange={handleChange} value="c" name="radio-button-demo" inputProps={{ 'aria-label': 'C' }} /> <Radio checked={selectedValue === 'd'} onChange={handleChange} value="d" color="default" name="radio-button-demo" inputProps={{ 'aria-label': 'D' }} /> <Radio checked={selectedValue === 'e'} onChange={handleChange} value="e" color="default" name="radio-button-demo" inputProps={{ 'aria-label': 'E' }} icon={<RadioButtonUncheckedIcon fontSize="small" />} checkedIcon={<RadioButtonCheckedIcon fontSize="small" />} /> </div> ); }
kybarg/material-ui
docs/src/pages/components/radio-buttons/RadioButtons.tsx
TypeScript
mit
1,939
// // ViewController.h // Examples // // Created by Tim Moose on 2/11/14. // Copyright (c) 2014 Tractable Labs. All rights reserved. // #import <UIKit/UIKit.h> #import <TLIndexPathTools/TLTableViewController.h> @interface SelectorTableViewController : TLTableViewController @end
wtmoose/TuneKit
Examples/Examples/SelectorTableViewController.h
C
mit
286
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'><head><title>app/helpers/cars_helper.rb - C0 code coverage information</title> <style type='text/css'>body { background-color: rgb(240, 240, 245); }</style> <style type='text/css'>span.cross-ref-title { font-size: 140%; } span.cross-ref a { text-decoration: none; } span.cross-ref { background-color:#f3f7fa; border: 1px dashed #333; margin: 1em; padding: 0.5em; overflow: hidden; } a.crossref-toggle { text-decoration: none; } span.marked0 { background-color: rgb(185, 210, 200); display: block; } span.marked1 { background-color: rgb(190, 215, 205); display: block; } span.inferred0 { background-color: rgb(175, 200, 200); display: block; } span.inferred1 { background-color: rgb(180, 205, 205); display: block; } span.uncovered0 { background-color: rgb(225, 110, 110); display: block; } span.uncovered1 { background-color: rgb(235, 120, 120); display: block; } span.overview { border-bottom: 8px solid black; } div.overview { border-bottom: 8px solid black; } body { font-family: verdana, arial, helvetica; } div.footer { font-size: 68%; margin-top: 1.5em; } h1, h2, h3, h4, h5, h6 { margin-bottom: 0.5em; } h5 { margin-top: 0.5em; } .hidden { display: none; } div.separator { height: 10px; } /* Commented out for better readability, esp. on IE */ /* table tr td, table tr th { font-size: 68%; } td.value table tr td { font-size: 11px; } */ table.percent_graph { height: 12px; border: #808080 1px solid; empty-cells: show; } table.percent_graph td.covered { height: 10px; background: #00f000; } table.percent_graph td.uncovered { height: 10px; background: #e00000; } table.percent_graph td.NA { height: 10px; background: #eaeaea; } table.report { border-collapse: collapse; width: 100%; } table.report td.heading { background: #dcecff; border: #d0d0d0 1px solid; font-weight: bold; text-align: center; } table.report td.heading:hover { background: #c0ffc0; } table.report td.text { border: #d0d0d0 1px solid; } table.report td.value, table.report td.lines_total, table.report td.lines_code { text-align: right; border: #d0d0d0 1px solid; } table.report tr.light { background-color: rgb(240, 240, 245); } table.report tr.dark { background-color: rgb(230, 230, 235); } </style> <script type='text/javascript'> // <![CDATA[ function toggleCode( id ) { if ( document.getElementById ) elem = document.getElementById( id ); else if ( document.all ) elem = eval( "document.all." + id ); else return false; elemStyle = elem.style; if ( elemStyle.display != "block" ) { elemStyle.display = "block" } else { elemStyle.display = "none" } return true; } // Make cross-references hidden by default document.writeln( "<style type=\"text/css\">span.cross-ref { display: none }</style>" ) // ]]> </script> <style type='text/css'>span.run0 { background-color: rgb(178, 204, 255); display: block; } span.run1 { background-color: rgb(178, 206, 255); display: block; } span.run2 { background-color: rgb(178, 209, 255); display: block; } span.run3 { background-color: rgb(178, 211, 255); display: block; } span.run4 { background-color: rgb(178, 214, 255); display: block; } span.run5 { background-color: rgb(178, 218, 255); display: block; } span.run6 { background-color: rgb(178, 220, 255); display: block; } span.run7 { background-color: rgb(178, 223, 255); display: block; } span.run8 { background-color: rgb(178, 225, 255); display: block; } span.run9 { background-color: rgb(178, 228, 255); display: block; } span.run10 { background-color: rgb(178, 232, 255); display: block; } span.run11 { background-color: rgb(178, 234, 255); display: block; } span.run12 { background-color: rgb(178, 237, 255); display: block; } span.run13 { background-color: rgb(178, 239, 255); display: block; } span.run14 { background-color: rgb(178, 242, 255); display: block; } span.run15 { background-color: rgb(178, 246, 255); display: block; } span.run16 { background-color: rgb(178, 248, 255); display: block; } span.run17 { background-color: rgb(178, 251, 255); display: block; } span.run18 { background-color: rgb(178, 253, 255); display: block; } span.run19 { background-color: rgb(178, 255, 253); display: block; } span.run20 { background-color: rgb(178, 255, 249); display: block; } span.run21 { background-color: rgb(178, 255, 247); display: block; } span.run22 { background-color: rgb(178, 255, 244); display: block; } span.run23 { background-color: rgb(178, 255, 242); display: block; } span.run24 { background-color: rgb(178, 255, 239); display: block; } span.run25 { background-color: rgb(178, 255, 235); display: block; } span.run26 { background-color: rgb(178, 255, 233); display: block; } span.run27 { background-color: rgb(178, 255, 230); display: block; } span.run28 { background-color: rgb(178, 255, 228); display: block; } span.run29 { background-color: rgb(178, 255, 225); display: block; } span.run30 { background-color: rgb(178, 255, 221); display: block; } span.run31 { background-color: rgb(178, 255, 219); display: block; } span.run32 { background-color: rgb(178, 255, 216); display: block; } span.run33 { background-color: rgb(178, 255, 214); display: block; } span.run34 { background-color: rgb(178, 255, 211); display: block; } span.run35 { background-color: rgb(178, 255, 207); display: block; } span.run36 { background-color: rgb(178, 255, 205); display: block; } span.run37 { background-color: rgb(178, 255, 202); display: block; } span.run38 { background-color: rgb(178, 255, 200); display: block; } span.run39 { background-color: rgb(178, 255, 197); display: block; } span.run40 { background-color: rgb(178, 255, 193); display: block; } span.run41 { background-color: rgb(178, 255, 191); display: block; } span.run42 { background-color: rgb(178, 255, 188); display: block; } span.run43 { background-color: rgb(178, 255, 186); display: block; } span.run44 { background-color: rgb(178, 255, 183); display: block; } span.run45 { background-color: rgb(178, 255, 179); display: block; } span.run46 { background-color: rgb(179, 255, 178); display: block; } span.run47 { background-color: rgb(182, 255, 178); display: block; } span.run48 { background-color: rgb(184, 255, 178); display: block; } span.run49 { background-color: rgb(187, 255, 178); display: block; } span.run50 { background-color: rgb(191, 255, 178); display: block; } span.run51 { background-color: rgb(193, 255, 178); display: block; } span.run52 { background-color: rgb(196, 255, 178); display: block; } span.run53 { background-color: rgb(198, 255, 178); display: block; } span.run54 { background-color: rgb(201, 255, 178); display: block; } span.run55 { background-color: rgb(205, 255, 178); display: block; } span.run56 { background-color: rgb(207, 255, 178); display: block; } span.run57 { background-color: rgb(210, 255, 178); display: block; } span.run58 { background-color: rgb(212, 255, 178); display: block; } span.run59 { background-color: rgb(215, 255, 178); display: block; } span.run60 { background-color: rgb(219, 255, 178); display: block; } span.run61 { background-color: rgb(221, 255, 178); display: block; } span.run62 { background-color: rgb(224, 255, 178); display: block; } span.run63 { background-color: rgb(226, 255, 178); display: block; } span.run64 { background-color: rgb(229, 255, 178); display: block; } span.run65 { background-color: rgb(233, 255, 178); display: block; } span.run66 { background-color: rgb(235, 255, 178); display: block; } span.run67 { background-color: rgb(238, 255, 178); display: block; } span.run68 { background-color: rgb(240, 255, 178); display: block; } span.run69 { background-color: rgb(243, 255, 178); display: block; } span.run70 { background-color: rgb(247, 255, 178); display: block; } span.run71 { background-color: rgb(249, 255, 178); display: block; } span.run72 { background-color: rgb(252, 255, 178); display: block; } span.run73 { background-color: rgb(255, 255, 178); display: block; } span.run74 { background-color: rgb(255, 252, 178); display: block; } span.run75 { background-color: rgb(255, 248, 178); display: block; } span.run76 { background-color: rgb(255, 246, 178); display: block; } span.run77 { background-color: rgb(255, 243, 178); display: block; } span.run78 { background-color: rgb(255, 240, 178); display: block; } span.run79 { background-color: rgb(255, 238, 178); display: block; } span.run80 { background-color: rgb(255, 234, 178); display: block; } span.run81 { background-color: rgb(255, 232, 178); display: block; } span.run82 { background-color: rgb(255, 229, 178); display: block; } span.run83 { background-color: rgb(255, 226, 178); display: block; } span.run84 { background-color: rgb(255, 224, 178); display: block; } span.run85 { background-color: rgb(255, 220, 178); display: block; } span.run86 { background-color: rgb(255, 218, 178); display: block; } span.run87 { background-color: rgb(255, 215, 178); display: block; } span.run88 { background-color: rgb(255, 212, 178); display: block; } span.run89 { background-color: rgb(255, 210, 178); display: block; } span.run90 { background-color: rgb(255, 206, 178); display: block; } span.run91 { background-color: rgb(255, 204, 178); display: block; } span.run92 { background-color: rgb(255, 201, 178); display: block; } span.run93 { background-color: rgb(255, 198, 178); display: block; } span.run94 { background-color: rgb(255, 196, 178); display: block; } span.run95 { background-color: rgb(255, 192, 178); display: block; } span.run96 { background-color: rgb(255, 189, 178); display: block; } span.run97 { background-color: rgb(255, 187, 178); display: block; } span.run98 { background-color: rgb(255, 184, 178); display: block; } span.run99 { background-color: rgb(255, 182, 178); display: block; } span.run100 { background-color: rgb(255, 178, 178); display: block; } </style> </head> <body><h3>C0 code coverage information</h3> <p>Generated on Mon Jan 07 11:13:53 -0800 2008 with <a href='http://eigenclass.org/hiki/rcov'>rcov 0.8.1.2</a> </p> <hr/> <pre><span class='marked0'>Code reported as executed by Ruby looks like this... </span><span class='marked1'>and this: this line is also marked as covered. </span><span class='inferred0'>Lines considered as run by rcov, but not reported by Ruby, look like this, </span><span class='inferred1'>and this: these lines were inferred by rcov (using simple heuristics). </span><span class='uncovered0'>Finally, here&apos;s a line marked as not executed. </span></pre> <table class='report'><thead><tr><td class='heading'>Name</td> <td class='heading'>Total lines</td> <td class='heading'>Lines of code</td> <td class='heading'>Total coverage</td> <td class='heading'>Code coverage</td> </tr> </thead> <tbody><tr class='light'><td><a href='app-helpers-cars_helper_rb.html'>app/helpers/cars_helper.rb</a> </td> <td class='lines_total'><tt>2</tt> </td> <td class='lines_code'><tt>2</tt> </td> <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_total'>100.0%</tt> &nbsp;</td> <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='100'/> <td class='uncovered' width='0'/> </tr> </table> </td> </tr> </table> </td> <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_code'>100.0%</tt> &nbsp;</td> <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='100'/> <td class='uncovered' width='0'/> </tr> </table> </td> </tr> </table> </td> </tr> </tbody> </table> <pre><span class="marked1"><a name="line1"></a>1 module CarsHelper </span><span class="inferred0"><a name="line2"></a>2 end </span></pre><hr/> <p>Generated using the <a href='http://eigenclass.org/hiki.rb?rcov'>rcov code coverage analysis tool for Ruby</a> version 0.8.1.2.</p> <p><a href='http://validator.w3.org/check/referer'><img src='http://www.w3.org/Icons/valid-xhtml10' height='31' alt='Valid XHTML 1.0!' width='88'/> </a> <a href='http://jigsaw.w3.org/css-validator/check/referer'><img src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Valid CSS!' style='border:0;width:88px;height:31px'/> </a> </p> </body> </html>
jared/ygo_classic
coverage/app-helpers-cars_helper_rb.html
HTML
mit
13,184
class JeraPushGenerator < Rails::Generators::NamedBase desc "This generator creates an initializer file at config/initializers" source_root File.expand_path("../templates", __FILE__) MissingModel = Class.new(Thor::Error) def initializer_file template 'jera_push.rb', 'config/initializers/jera_push.rb' inject_into_file 'config/initializers/assets.rb', "\nRails.application.config.assets.precompile += %w( jera_push/jera_push.css jera_push/jera_push.js )", after: '# Precompile additional assets.' end def locale_file copy_file '../../../../config/locale/jera_push.pt-BR.yml', 'config/locales/jera_push.pt-BR.yml' end def generate_migrations unless model_exists? raise MissingModel, "\n\tModel \"#{file_name.titlecase}\" doesn't exists. Please, create your Model and try again." end inject_into_file model_path, "\n\thas_many :devices, as: :pushable, class_name: 'JeraPush::Device'", after: '< ActiveRecord::Base' inject_into_file model_path, "\n\thas_many :devices, as: :pushable, class_name: 'JeraPush::Device'", after: '< ApplicationRecord' case self.behavior when :invoke generate "active_record:jera_push", file_name when :revoke Rails::Generators.invoke "active_record:jera_push", [file_name], behavior: :revoke end end private def model_exists? File.exist?(File.join(destination_root, model_path)) end def model_path @model_path ||= File.join("app", "models", "#{file_path}.rb") end end
jera/jera-push
lib/generators/jera_push/jera_push_generator.rb
Ruby
mit
1,499
<!DOCTYPE HTML> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (11.0.10) on Thu Apr 15 10:34:57 CEST 2021 --> <title>Uses of Class com.wrapper.spotify.model_objects.miscellaneous.CurrentlyPlaying.Builder (Spotify Web API Java Client 6.5.3 API)</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="dc.created" content="2021-04-15"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <link rel="stylesheet" type="text/css" href="../../../../../../jquery/jquery-ui.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> <script type="text/javascript" src="../../../../../../jquery/jszip/dist/jszip.min.js"></script> <script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> <!--[if IE]> <script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> <![endif]--> <script type="text/javascript" src="../../../../../../jquery/jquery-3.5.1.js"></script> <script type="text/javascript" src="../../../../../../jquery/jquery-ui.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class com.wrapper.spotify.model_objects.miscellaneous.CurrentlyPlaying.Builder (Spotify Web API Java Client 6.5.3 API)"; } } catch(err) { } //--> var pathtoroot = "../../../../../../"; var useModuleDirectories = true; loadScripts(document, 'script');</script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <header role="banner"> <nav role="navigation"> <div class="fixedNav"> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a id="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../index.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../CurrentlyPlaying.Builder.html" title="class in com.wrapper.spotify.model_objects.miscellaneous">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses.html">All&nbsp;Classes</a></li> </ul> <ul class="navListSearch"> <li><label for="search">SEARCH:</label> <input type="text" id="search" value="search" disabled="disabled"> <input type="reset" id="reset" value="reset" disabled="disabled"> </li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <a id="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> </div> <div class="navPadding">&nbsp;</div> <script type="text/javascript"><!-- $('.navPadding').css('padding-top', $('.fixedNav').css("height")); //--> </script> </nav> </header> <main role="main"> <div class="header"> <h2 title="Uses of Class com.wrapper.spotify.model_objects.miscellaneous.CurrentlyPlaying.Builder" class="title">Uses of Class<br>com.wrapper.spotify.model_objects.miscellaneous.CurrentlyPlaying.Builder</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary"> <caption><span>Packages that use <a href="../CurrentlyPlaying.Builder.html" title="class in com.wrapper.spotify.model_objects.miscellaneous">CurrentlyPlaying.Builder</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <th class="colFirst" scope="row"><a href="#com.wrapper.spotify.model_objects.miscellaneous">com.wrapper.spotify.model_objects.miscellaneous</a></th> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"> <section role="region"><a id="com.wrapper.spotify.model_objects.miscellaneous"> <!-- --> </a> <h3>Uses of <a href="../CurrentlyPlaying.Builder.html" title="class in com.wrapper.spotify.model_objects.miscellaneous">CurrentlyPlaying.Builder</a> in <a href="../package-summary.html">com.wrapper.spotify.model_objects.miscellaneous</a></h3> <table class="useSummary"> <caption><span>Methods in <a href="../package-summary.html">com.wrapper.spotify.model_objects.miscellaneous</a> that return <a href="../CurrentlyPlaying.Builder.html" title="class in com.wrapper.spotify.model_objects.miscellaneous">CurrentlyPlaying.Builder</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colSecond" scope="col">Method</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../CurrentlyPlaying.Builder.html" title="class in com.wrapper.spotify.model_objects.miscellaneous">CurrentlyPlaying.Builder</a></code></td> <th class="colSecond" scope="row"><span class="typeNameLabel">CurrentlyPlaying.</span><code><span class="memberNameLink"><a href="../CurrentlyPlaying.html#builder()">builder</a></span>()</code></th> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../CurrentlyPlaying.Builder.html" title="class in com.wrapper.spotify.model_objects.miscellaneous">CurrentlyPlaying.Builder</a></code></td> <th class="colSecond" scope="row"><span class="typeNameLabel">CurrentlyPlaying.Builder.</span><code><span class="memberNameLink"><a href="../CurrentlyPlaying.Builder.html#setActions(com.wrapper.spotify.model_objects.special.Actions)">setActions</a></span>&#8203;(<a href="../../special/Actions.html" title="class in com.wrapper.spotify.model_objects.special">Actions</a>&nbsp;actions)</code></th> <td class="colLast"> <div class="block">The actions setter.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../CurrentlyPlaying.Builder.html" title="class in com.wrapper.spotify.model_objects.miscellaneous">CurrentlyPlaying.Builder</a></code></td> <th class="colSecond" scope="row"><span class="typeNameLabel">CurrentlyPlaying.Builder.</span><code><span class="memberNameLink"><a href="../CurrentlyPlaying.Builder.html#setContext(com.wrapper.spotify.model_objects.specification.Context)">setContext</a></span>&#8203;(<a href="../../specification/Context.html" title="class in com.wrapper.spotify.model_objects.specification">Context</a>&nbsp;context)</code></th> <td class="colLast"> <div class="block">The playing context setter.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../CurrentlyPlaying.Builder.html" title="class in com.wrapper.spotify.model_objects.miscellaneous">CurrentlyPlaying.Builder</a></code></td> <th class="colSecond" scope="row"><span class="typeNameLabel">CurrentlyPlaying.Builder.</span><code><span class="memberNameLink"><a href="../CurrentlyPlaying.Builder.html#setCurrentlyPlayingType(com.wrapper.spotify.enums.CurrentlyPlayingType)">setCurrentlyPlayingType</a></span>&#8203;(<a href="../../../enums/CurrentlyPlayingType.html" title="enum in com.wrapper.spotify.enums">CurrentlyPlayingType</a>&nbsp;currentlyPlayingType)</code></th> <td class="colLast"> <div class="block">The currently playing type setter.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../CurrentlyPlaying.Builder.html" title="class in com.wrapper.spotify.model_objects.miscellaneous">CurrentlyPlaying.Builder</a></code></td> <th class="colSecond" scope="row"><span class="typeNameLabel">CurrentlyPlaying.Builder.</span><code><span class="memberNameLink"><a href="../CurrentlyPlaying.Builder.html#setIs_playing(java.lang.Boolean)">setIs_playing</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang" class="externalLink">Boolean</a>&nbsp;is_playing)</code></th> <td class="colLast"> <div class="block">The playing state setter.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../CurrentlyPlaying.Builder.html" title="class in com.wrapper.spotify.model_objects.miscellaneous">CurrentlyPlaying.Builder</a></code></td> <th class="colSecond" scope="row"><span class="typeNameLabel">CurrentlyPlaying.Builder.</span><code><span class="memberNameLink"><a href="../CurrentlyPlaying.Builder.html#setItem(com.wrapper.spotify.model_objects.IPlaylistItem)">setItem</a></span>&#8203;(<a href="../../IPlaylistItem.html" title="interface in com.wrapper.spotify.model_objects">IPlaylistItem</a>&nbsp;item)</code></th> <td class="colLast"> <div class="block">The currently playing item setter.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../CurrentlyPlaying.Builder.html" title="class in com.wrapper.spotify.model_objects.miscellaneous">CurrentlyPlaying.Builder</a></code></td> <th class="colSecond" scope="row"><span class="typeNameLabel">CurrentlyPlaying.Builder.</span><code><span class="memberNameLink"><a href="../CurrentlyPlaying.Builder.html#setProgress_ms(java.lang.Integer)">setProgress_ms</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang" class="externalLink">Integer</a>&nbsp;progress_ms)</code></th> <td class="colLast"> <div class="block">The current track progress setter.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../CurrentlyPlaying.Builder.html" title="class in com.wrapper.spotify.model_objects.miscellaneous">CurrentlyPlaying.Builder</a></code></td> <th class="colSecond" scope="row"><span class="typeNameLabel">CurrentlyPlaying.Builder.</span><code><span class="memberNameLink"><a href="../CurrentlyPlaying.Builder.html#setTimestamp(java.lang.Long)">setTimestamp</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang" class="externalLink">Long</a>&nbsp;timestamp)</code></th> <td class="colLast"> <div class="block">The timestamp setter.</div> </td> </tr> </tbody> </table> </section> </li> </ul> </li> </ul> </div> </main> <footer role="contentinfo"> <nav role="navigation"> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a id="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../index.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../CurrentlyPlaying.Builder.html" title="class in com.wrapper.spotify.model_objects.miscellaneous">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <a id="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </nav> <p class="legalCopy"><small>Copyright &#169; 2021. All rights reserved.</small></p> </footer> </body> </html>
thelinmichael/spotify-web-api-java
docs/com/wrapper/spotify/model_objects/miscellaneous/class-use/CurrentlyPlaying.Builder.html
HTML
mit
12,430
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Copyright (c) 2011-2012 Litecoin Developers // Copyright (c) 2013 doriancoin Developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "wallet.h" #include "walletdb.h" #include "crypter.h" #include "ui_interface.h" #include "base58.h" using namespace std; ////////////////////////////////////////////////////////////////////////////// // // mapWallet // struct CompareValueOnly { bool operator()(const pair<int64, pair<const CWalletTx*, unsigned int> >& t1, const pair<int64, pair<const CWalletTx*, unsigned int> >& t2) const { return t1.first < t2.first; } }; CPubKey CWallet::GenerateNewKey() { bool fCompressed = CanSupportFeature(FEATURE_COMPRPUBKEY); // default to compressed public keys if we want 0.6.0 wallets RandAddSeedPerfmon(); CKey key; key.MakeNewKey(fCompressed); // Compressed public keys were introduced in version 0.6.0 if (fCompressed) SetMinVersion(FEATURE_COMPRPUBKEY); if (!AddKey(key)) throw std::runtime_error("CWallet::GenerateNewKey() : AddKey failed"); return key.GetPubKey(); } bool CWallet::AddKey(const CKey& key) { if (!CCryptoKeyStore::AddKey(key)) return false; if (!fFileBacked) return true; if (!IsCrypted()) return CWalletDB(strWalletFile).WriteKey(key.GetPubKey(), key.GetPrivKey()); return true; } bool CWallet::AddCryptedKey(const CPubKey &vchPubKey, const vector<unsigned char> &vchCryptedSecret) { if (!CCryptoKeyStore::AddCryptedKey(vchPubKey, vchCryptedSecret)) return false; if (!fFileBacked) return true; { LOCK(cs_wallet); if (pwalletdbEncryption) return pwalletdbEncryption->WriteCryptedKey(vchPubKey, vchCryptedSecret); else return CWalletDB(strWalletFile).WriteCryptedKey(vchPubKey, vchCryptedSecret); } return false; } bool CWallet::AddCScript(const CScript& redeemScript) { if (!CCryptoKeyStore::AddCScript(redeemScript)) return false; if (!fFileBacked) return true; return CWalletDB(strWalletFile).WriteCScript(Hash160(redeemScript), redeemScript); } bool CWallet::Unlock(const SecureString& strWalletPassphrase) { if (!IsLocked()) return false; CCrypter crypter; CKeyingMaterial vMasterKey; { LOCK(cs_wallet); BOOST_FOREACH(const MasterKeyMap::value_type& pMasterKey, mapMasterKeys) { if(!crypter.SetKeyFromPassphrase(strWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod)) return false; if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, vMasterKey)) return false; if (CCryptoKeyStore::Unlock(vMasterKey)) return true; } } return false; } bool CWallet::ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase, const SecureString& strNewWalletPassphrase) { bool fWasLocked = IsLocked(); { LOCK(cs_wallet); Lock(); CCrypter crypter; CKeyingMaterial vMasterKey; BOOST_FOREACH(MasterKeyMap::value_type& pMasterKey, mapMasterKeys) { if(!crypter.SetKeyFromPassphrase(strOldWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod)) return false; if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, vMasterKey)) return false; if (CCryptoKeyStore::Unlock(vMasterKey)) { int64 nStartTime = GetTimeMillis(); crypter.SetKeyFromPassphrase(strNewWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod); pMasterKey.second.nDeriveIterations = pMasterKey.second.nDeriveIterations * (100 / ((double)(GetTimeMillis() - nStartTime))); nStartTime = GetTimeMillis(); crypter.SetKeyFromPassphrase(strNewWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod); pMasterKey.second.nDeriveIterations = (pMasterKey.second.nDeriveIterations + pMasterKey.second.nDeriveIterations * 100 / ((double)(GetTimeMillis() - nStartTime))) / 2; if (pMasterKey.second.nDeriveIterations < 25000) pMasterKey.second.nDeriveIterations = 25000; printf("Wallet passphrase changed to an nDeriveIterations of %i\n", pMasterKey.second.nDeriveIterations); if (!crypter.SetKeyFromPassphrase(strNewWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod)) return false; if (!crypter.Encrypt(vMasterKey, pMasterKey.second.vchCryptedKey)) return false; CWalletDB(strWalletFile).WriteMasterKey(pMasterKey.first, pMasterKey.second); if (fWasLocked) Lock(); return true; } } } return false; } void CWallet::SetBestChain(const CBlockLocator& loc) { CWalletDB walletdb(strWalletFile); walletdb.WriteBestBlock(loc); } // This class implements an addrIncoming entry that causes pre-0.4 // clients to crash on startup if reading a private-key-encrypted wallet. class CCorruptAddress { public: IMPLEMENT_SERIALIZE ( if (nType & SER_DISK) READWRITE(nVersion); ) }; bool CWallet::SetMinVersion(enum WalletFeature nVersion, CWalletDB* pwalletdbIn, bool fExplicit) { if (nWalletVersion >= nVersion) return true; // when doing an explicit upgrade, if we pass the max version permitted, upgrade all the way if (fExplicit && nVersion > nWalletMaxVersion) nVersion = FEATURE_LATEST; nWalletVersion = nVersion; if (nVersion > nWalletMaxVersion) nWalletMaxVersion = nVersion; if (fFileBacked) { CWalletDB* pwalletdb = pwalletdbIn ? pwalletdbIn : new CWalletDB(strWalletFile); if (nWalletVersion >= 40000) { // Versions prior to 0.4.0 did not support the "minversion" record. // Use a CCorruptAddress to make them crash instead. CCorruptAddress corruptAddress; pwalletdb->WriteSetting("addrIncoming", corruptAddress); } if (nWalletVersion > 40000) pwalletdb->WriteMinVersion(nWalletVersion); if (!pwalletdbIn) delete pwalletdb; } return true; } bool CWallet::SetMaxVersion(int nVersion) { // cannot downgrade below current version if (nWalletVersion > nVersion) return false; nWalletMaxVersion = nVersion; return true; } bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase) { if (IsCrypted()) return false; CKeyingMaterial vMasterKey; RandAddSeedPerfmon(); vMasterKey.resize(WALLET_CRYPTO_KEY_SIZE); RAND_bytes(&vMasterKey[0], WALLET_CRYPTO_KEY_SIZE); CMasterKey kMasterKey; RandAddSeedPerfmon(); kMasterKey.vchSalt.resize(WALLET_CRYPTO_SALT_SIZE); RAND_bytes(&kMasterKey.vchSalt[0], WALLET_CRYPTO_SALT_SIZE); CCrypter crypter; int64 nStartTime = GetTimeMillis(); crypter.SetKeyFromPassphrase(strWalletPassphrase, kMasterKey.vchSalt, 25000, kMasterKey.nDerivationMethod); kMasterKey.nDeriveIterations = 2500000 / ((double)(GetTimeMillis() - nStartTime)); nStartTime = GetTimeMillis(); crypter.SetKeyFromPassphrase(strWalletPassphrase, kMasterKey.vchSalt, kMasterKey.nDeriveIterations, kMasterKey.nDerivationMethod); kMasterKey.nDeriveIterations = (kMasterKey.nDeriveIterations + kMasterKey.nDeriveIterations * 100 / ((double)(GetTimeMillis() - nStartTime))) / 2; if (kMasterKey.nDeriveIterations < 25000) kMasterKey.nDeriveIterations = 25000; printf("Encrypting Wallet with an nDeriveIterations of %i\n", kMasterKey.nDeriveIterations); if (!crypter.SetKeyFromPassphrase(strWalletPassphrase, kMasterKey.vchSalt, kMasterKey.nDeriveIterations, kMasterKey.nDerivationMethod)) return false; if (!crypter.Encrypt(vMasterKey, kMasterKey.vchCryptedKey)) return false; { LOCK(cs_wallet); mapMasterKeys[++nMasterKeyMaxID] = kMasterKey; if (fFileBacked) { pwalletdbEncryption = new CWalletDB(strWalletFile); if (!pwalletdbEncryption->TxnBegin()) return false; pwalletdbEncryption->WriteMasterKey(nMasterKeyMaxID, kMasterKey); } if (!EncryptKeys(vMasterKey)) { if (fFileBacked) pwalletdbEncryption->TxnAbort(); exit(1); //We now probably have half of our keys encrypted in memory, and half not...die and let the user reload their unencrypted wallet. } // Encryption was introduced in version 0.4.0 SetMinVersion(FEATURE_WALLETCRYPT, pwalletdbEncryption, true); if (fFileBacked) { if (!pwalletdbEncryption->TxnCommit()) exit(1); //We now have keys encrypted in memory, but no on disk...die to avoid confusion and let the user reload their unencrypted wallet. delete pwalletdbEncryption; pwalletdbEncryption = NULL; } Lock(); Unlock(strWalletPassphrase); NewKeyPool(); Lock(); // Need to completely rewrite the wallet file; if we don't, bdb might keep // bits of the unencrypted private key in slack space in the database file. CDB::Rewrite(strWalletFile); } NotifyStatusChanged(this); return true; } void CWallet::WalletUpdateSpent(const CTransaction &tx) { // Anytime a signature is successfully verified, it's proof the outpoint is spent. // Update the wallet spent flag if it doesn't know due to wallet.dat being // restored from backup or the user making copies of wallet.dat. { LOCK(cs_wallet); BOOST_FOREACH(const CTxIn& txin, tx.vin) { map<uint256, CWalletTx>::iterator mi = mapWallet.find(txin.prevout.hash); if (mi != mapWallet.end()) { CWalletTx& wtx = (*mi).second; if (!wtx.IsSpent(txin.prevout.n) && IsMine(wtx.vout[txin.prevout.n])) { printf("WalletUpdateSpent found spent coin %sbc %s\n", FormatMoney(wtx.GetCredit()).c_str(), wtx.GetHash().ToString().c_str()); wtx.MarkSpent(txin.prevout.n); wtx.WriteToDisk(); NotifyTransactionChanged(this, txin.prevout.hash, CT_UPDATED); } } } } } void CWallet::MarkDirty() { { LOCK(cs_wallet); BOOST_FOREACH(PAIRTYPE(const uint256, CWalletTx)& item, mapWallet) item.second.MarkDirty(); } } bool CWallet::AddToWallet(const CWalletTx& wtxIn) { uint256 hash = wtxIn.GetHash(); { LOCK(cs_wallet); // Inserts only if not already there, returns tx inserted or tx found pair<map<uint256, CWalletTx>::iterator, bool> ret = mapWallet.insert(make_pair(hash, wtxIn)); CWalletTx& wtx = (*ret.first).second; wtx.BindWallet(this); bool fInsertedNew = ret.second; if (fInsertedNew) wtx.nTimeReceived = GetAdjustedTime(); bool fUpdated = false; if (!fInsertedNew) { // Merge if (wtxIn.hashBlock != 0 && wtxIn.hashBlock != wtx.hashBlock) { wtx.hashBlock = wtxIn.hashBlock; fUpdated = true; } if (wtxIn.nIndex != -1 && (wtxIn.vMerkleBranch != wtx.vMerkleBranch || wtxIn.nIndex != wtx.nIndex)) { wtx.vMerkleBranch = wtxIn.vMerkleBranch; wtx.nIndex = wtxIn.nIndex; fUpdated = true; } if (wtxIn.fFromMe && wtxIn.fFromMe != wtx.fFromMe) { wtx.fFromMe = wtxIn.fFromMe; fUpdated = true; } fUpdated |= wtx.UpdateSpent(wtxIn.vfSpent); } //// debug print printf("AddToWallet %s %s%s\n", wtxIn.GetHash().ToString().substr(0,10).c_str(), (fInsertedNew ? "new" : ""), (fUpdated ? "update" : "")); // Write to disk if (fInsertedNew || fUpdated) if (!wtx.WriteToDisk()) return false; #ifndef QT_GUI // If default receiving address gets used, replace it with a new one CScript scriptDefaultKey; scriptDefaultKey.SetDestination(vchDefaultKey.GetID()); BOOST_FOREACH(const CTxOut& txout, wtx.vout) { if (txout.scriptPubKey == scriptDefaultKey) { CPubKey newDefaultKey; if (GetKeyFromPool(newDefaultKey, false)) { SetDefaultKey(newDefaultKey); SetAddressBookName(vchDefaultKey.GetID(), ""); } } } #endif // since AddToWallet is called directly for self-originating transactions, check for consumption of own coins WalletUpdateSpent(wtx); // Notify UI of new or updated transaction NotifyTransactionChanged(this, hash, fInsertedNew ? CT_NEW : CT_UPDATED); } return true; } // Add a transaction to the wallet, or update it. // pblock is optional, but should be provided if the transaction is known to be in a block. // If fUpdate is true, existing transactions will be updated. bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate, bool fFindBlock) { uint256 hash = tx.GetHash(); { LOCK(cs_wallet); bool fExisted = mapWallet.count(hash); if (fExisted && !fUpdate) return false; if (fExisted || IsMine(tx) || IsFromMe(tx)) { CWalletTx wtx(this,tx); // Get merkle branch if transaction was found in a block if (pblock) wtx.SetMerkleBranch(pblock); return AddToWallet(wtx); } else WalletUpdateSpent(tx); } return false; } bool CWallet::EraseFromWallet(uint256 hash) { if (!fFileBacked) return false; { LOCK(cs_wallet); if (mapWallet.erase(hash)) CWalletDB(strWalletFile).EraseTx(hash); } return true; } bool CWallet::IsMine(const CTxIn &txin) const { { LOCK(cs_wallet); map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(txin.prevout.hash); if (mi != mapWallet.end()) { const CWalletTx& prev = (*mi).second; if (txin.prevout.n < prev.vout.size()) if (IsMine(prev.vout[txin.prevout.n])) return true; } } return false; } int64 CWallet::GetDebit(const CTxIn &txin) const { { LOCK(cs_wallet); map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(txin.prevout.hash); if (mi != mapWallet.end()) { const CWalletTx& prev = (*mi).second; if (txin.prevout.n < prev.vout.size()) if (IsMine(prev.vout[txin.prevout.n])) return prev.vout[txin.prevout.n].nValue; } } return 0; } bool CWallet::IsChange(const CTxOut& txout) const { CTxDestination address; // TODO: fix handling of 'change' outputs. The assumption is that any // payment to a TX_PUBKEYHASH that is mine but isn't in the address book // is change. That assumption is likely to break when we implement multisignature // wallets that return change back into a multi-signature-protected address; // a better way of identifying which outputs are 'the send' and which are // 'the change' will need to be implemented (maybe extend CWalletTx to remember // which output, if any, was change). if (ExtractDestination(txout.scriptPubKey, address) && ::IsMine(*this, address)) { LOCK(cs_wallet); if (!mapAddressBook.count(address)) return true; } return false; } int64 CWalletTx::GetTxTime() const { return nTimeReceived; } int CWalletTx::GetRequestCount() const { // Returns -1 if it wasn't being tracked int nRequests = -1; { LOCK(pwallet->cs_wallet); if (IsCoinBase()) { // Generated block if (hashBlock != 0) { map<uint256, int>::const_iterator mi = pwallet->mapRequestCount.find(hashBlock); if (mi != pwallet->mapRequestCount.end()) nRequests = (*mi).second; } } else { // Did anyone request this transaction? map<uint256, int>::const_iterator mi = pwallet->mapRequestCount.find(GetHash()); if (mi != pwallet->mapRequestCount.end()) { nRequests = (*mi).second; // How about the block it's in? if (nRequests == 0 && hashBlock != 0) { map<uint256, int>::const_iterator mi = pwallet->mapRequestCount.find(hashBlock); if (mi != pwallet->mapRequestCount.end()) nRequests = (*mi).second; else nRequests = 1; // If it's in someone else's block it must have got out } } } } return nRequests; } void CWalletTx::GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, list<pair<CTxDestination, int64> >& listReceived, list<pair<CTxDestination, int64> >& listSent, int64& nFee, string& strSentAccount) const { nGeneratedImmature = nGeneratedMature = nFee = 0; listReceived.clear(); listSent.clear(); strSentAccount = strFromAccount; if (IsCoinBase()) { if (GetBlocksToMaturity() > 0) nGeneratedImmature = pwallet->GetCredit(*this); else nGeneratedMature = GetCredit(); return; } // Compute fee: int64 nDebit = GetDebit(); if (nDebit > 0) // debit>0 means we signed/sent this transaction { int64 nValueOut = GetValueOut(); nFee = nDebit - nValueOut; } // Sent/received. BOOST_FOREACH(const CTxOut& txout, vout) { CTxDestination address; vector<unsigned char> vchPubKey; if (!ExtractDestination(txout.scriptPubKey, address)) { printf("CWalletTx::GetAmounts: Unknown transaction type found, txid %s\n", this->GetHash().ToString().c_str()); } // Don't report 'change' txouts if (nDebit > 0 && pwallet->IsChange(txout)) continue; if (nDebit > 0) listSent.push_back(make_pair(address, txout.nValue)); if (pwallet->IsMine(txout)) listReceived.push_back(make_pair(address, txout.nValue)); } } void CWalletTx::GetAccountAmounts(const string& strAccount, int64& nGenerated, int64& nReceived, int64& nSent, int64& nFee) const { nGenerated = nReceived = nSent = nFee = 0; int64 allGeneratedImmature, allGeneratedMature, allFee; allGeneratedImmature = allGeneratedMature = allFee = 0; string strSentAccount; list<pair<CTxDestination, int64> > listReceived; list<pair<CTxDestination, int64> > listSent; GetAmounts(allGeneratedImmature, allGeneratedMature, listReceived, listSent, allFee, strSentAccount); if (strAccount == "") nGenerated = allGeneratedMature; if (strAccount == strSentAccount) { BOOST_FOREACH(const PAIRTYPE(CTxDestination,int64)& s, listSent) nSent += s.second; nFee = allFee; } { LOCK(pwallet->cs_wallet); BOOST_FOREACH(const PAIRTYPE(CTxDestination,int64)& r, listReceived) { if (pwallet->mapAddressBook.count(r.first)) { map<CTxDestination, string>::const_iterator mi = pwallet->mapAddressBook.find(r.first); if (mi != pwallet->mapAddressBook.end() && (*mi).second == strAccount) nReceived += r.second; } else if (strAccount.empty()) { nReceived += r.second; } } } } void CWalletTx::AddSupportingTransactions(CTxDB& txdb) { vtxPrev.clear(); const int COPY_DEPTH = 3; if (SetMerkleBranch() < COPY_DEPTH) { vector<uint256> vWorkQueue; BOOST_FOREACH(const CTxIn& txin, vin) vWorkQueue.push_back(txin.prevout.hash); // This critsect is OK because txdb is already open { LOCK(pwallet->cs_wallet); map<uint256, const CMerkleTx*> mapWalletPrev; set<uint256> setAlreadyDone; for (unsigned int i = 0; i < vWorkQueue.size(); i++) { uint256 hash = vWorkQueue[i]; if (setAlreadyDone.count(hash)) continue; setAlreadyDone.insert(hash); CMerkleTx tx; map<uint256, CWalletTx>::const_iterator mi = pwallet->mapWallet.find(hash); if (mi != pwallet->mapWallet.end()) { tx = (*mi).second; BOOST_FOREACH(const CMerkleTx& txWalletPrev, (*mi).second.vtxPrev) mapWalletPrev[txWalletPrev.GetHash()] = &txWalletPrev; } else if (mapWalletPrev.count(hash)) { tx = *mapWalletPrev[hash]; } else if (!fClient && txdb.ReadDiskTx(hash, tx)) { ; } else { printf("ERROR: AddSupportingTransactions() : unsupported transaction\n"); continue; } int nDepth = tx.SetMerkleBranch(); vtxPrev.push_back(tx); if (nDepth < COPY_DEPTH) { BOOST_FOREACH(const CTxIn& txin, tx.vin) vWorkQueue.push_back(txin.prevout.hash); } } } } reverse(vtxPrev.begin(), vtxPrev.end()); } bool CWalletTx::WriteToDisk() { return CWalletDB(pwallet->strWalletFile).WriteTx(GetHash(), *this); } // Scan the block chain (starting in pindexStart) for transactions // from or to us. If fUpdate is true, found transactions that already // exist in the wallet will be updated. int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate) { int ret = 0; CBlockIndex* pindex = pindexStart; { LOCK(cs_wallet); while (pindex) { CBlock block; block.ReadFromDisk(pindex, true); BOOST_FOREACH(CTransaction& tx, block.vtx) { if (AddToWalletIfInvolvingMe(tx, &block, fUpdate)) ret++; } pindex = pindex->pnext; } } return ret; } int CWallet::ScanForWalletTransaction(const uint256& hashTx) { CTransaction tx; tx.ReadFromDisk(COutPoint(hashTx, 0)); if (AddToWalletIfInvolvingMe(tx, NULL, true, true)) return 1; return 0; } void CWallet::ReacceptWalletTransactions() { CTxDB txdb("r"); bool fRepeat = true; while (fRepeat) { LOCK(cs_wallet); fRepeat = false; vector<CDiskTxPos> vMissingTx; BOOST_FOREACH(PAIRTYPE(const uint256, CWalletTx)& item, mapWallet) { CWalletTx& wtx = item.second; if (wtx.IsCoinBase() && wtx.IsSpent(0)) continue; CTxIndex txindex; bool fUpdated = false; if (txdb.ReadTxIndex(wtx.GetHash(), txindex)) { // Update fSpent if a tx got spent somewhere else by a copy of wallet.dat if (txindex.vSpent.size() != wtx.vout.size()) { printf("ERROR: ReacceptWalletTransactions() : txindex.vSpent.size() %d != wtx.vout.size() %d\n", txindex.vSpent.size(), wtx.vout.size()); continue; } for (unsigned int i = 0; i < txindex.vSpent.size(); i++) { if (wtx.IsSpent(i)) continue; if (!txindex.vSpent[i].IsNull() && IsMine(wtx.vout[i])) { wtx.MarkSpent(i); fUpdated = true; vMissingTx.push_back(txindex.vSpent[i]); } } if (fUpdated) { printf("ReacceptWalletTransactions found spent coin %sbc %s\n", FormatMoney(wtx.GetCredit()).c_str(), wtx.GetHash().ToString().c_str()); wtx.MarkDirty(); wtx.WriteToDisk(); } } else { // Reaccept any txes of ours that aren't already in a block if (!wtx.IsCoinBase()) wtx.AcceptWalletTransaction(txdb, false); } } if (!vMissingTx.empty()) { // TODO: optimize this to scan just part of the block chain? if (ScanForWalletTransactions(pindexGenesisBlock)) fRepeat = true; // Found missing transactions: re-do Reaccept. } } } void CWalletTx::RelayWalletTransaction(CTxDB& txdb) { BOOST_FOREACH(const CMerkleTx& tx, vtxPrev) { if (!tx.IsCoinBase()) { uint256 hash = tx.GetHash(); if (!txdb.ContainsTx(hash)) RelayMessage(CInv(MSG_TX, hash), (CTransaction)tx); } } if (!IsCoinBase()) { uint256 hash = GetHash(); if (!txdb.ContainsTx(hash)) { printf("Relaying wtx %s\n", hash.ToString().substr(0,10).c_str()); RelayMessage(CInv(MSG_TX, hash), (CTransaction)*this); } } } void CWalletTx::RelayWalletTransaction() { CTxDB txdb("r"); RelayWalletTransaction(txdb); } void CWallet::ResendWalletTransactions() { // Do this infrequently and randomly to avoid giving away // that these are our transactions. static int64 nNextTime; if (GetTime() < nNextTime) return; bool fFirst = (nNextTime == 0); nNextTime = GetTime() + GetRand(30 * 60); if (fFirst) return; // Only do it if there's been a new block since last time static int64 nLastTime; if (nTimeBestReceived < nLastTime) return; nLastTime = GetTime(); // Rebroadcast any of our txes that aren't in a block yet printf("ResendWalletTransactions()\n"); CTxDB txdb("r"); { LOCK(cs_wallet); // Sort them in chronological order multimap<unsigned int, CWalletTx*> mapSorted; BOOST_FOREACH(PAIRTYPE(const uint256, CWalletTx)& item, mapWallet) { CWalletTx& wtx = item.second; // Don't rebroadcast until it's had plenty of time that // it should have gotten in already by now. if (nTimeBestReceived - (int64)wtx.nTimeReceived > 5 * 60) mapSorted.insert(make_pair(wtx.nTimeReceived, &wtx)); } BOOST_FOREACH(PAIRTYPE(const unsigned int, CWalletTx*)& item, mapSorted) { CWalletTx& wtx = *item.second; wtx.RelayWalletTransaction(txdb); } } } ////////////////////////////////////////////////////////////////////////////// // // Actions // int64 CWallet::GetBalance() const { int64 nTotal = 0; { LOCK(cs_wallet); for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const CWalletTx* pcoin = &(*it).second; if (pcoin->IsFinal() && pcoin->IsConfirmed()) nTotal += pcoin->GetAvailableCredit(); } } return nTotal; } int64 CWallet::GetUnconfirmedBalance() const { int64 nTotal = 0; { LOCK(cs_wallet); for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const CWalletTx* pcoin = &(*it).second; if (!pcoin->IsFinal() || !pcoin->IsConfirmed()) nTotal += pcoin->GetAvailableCredit(); } } return nTotal; } int64 CWallet::GetImmatureBalance() const { int64 nTotal = 0; { LOCK(cs_wallet); for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const CWalletTx& pcoin = (*it).second; if (pcoin.IsCoinBase() && pcoin.GetBlocksToMaturity() > 0 && pcoin.GetDepthInMainChain() >= 2) nTotal += GetCredit(pcoin); } } return nTotal; } // populate vCoins with vector of spendable COutputs void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed) const { vCoins.clear(); { LOCK(cs_wallet); for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const CWalletTx* pcoin = &(*it).second; if (!pcoin->IsFinal()) continue; if (fOnlyConfirmed && !pcoin->IsConfirmed()) continue; if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0) continue; // If output is less than minimum value, then don't include transaction. // This is to help deal with dust spam clogging up create transactions. for (unsigned int i = 0; i < pcoin->vout.size(); i++) if (!(pcoin->IsSpent(i)) && IsMine(pcoin->vout[i]) && pcoin->vout[i].nValue >= nMinimumInputValue) vCoins.push_back(COutput(pcoin, i, pcoin->GetDepthInMainChain())); } } } static void ApproximateBestSubset(vector<pair<int64, pair<const CWalletTx*,unsigned int> > >vValue, int64 nTotalLower, int64 nTargetValue, vector<char>& vfBest, int64& nBest, int iterations = 1000) { vector<char> vfIncluded; vfBest.assign(vValue.size(), true); nBest = nTotalLower; for (int nRep = 0; nRep < iterations && nBest != nTargetValue; nRep++) { vfIncluded.assign(vValue.size(), false); int64 nTotal = 0; bool fReachedTarget = false; for (int nPass = 0; nPass < 2 && !fReachedTarget; nPass++) { for (unsigned int i = 0; i < vValue.size(); i++) { if (nPass == 0 ? rand() % 2 : !vfIncluded[i]) { nTotal += vValue[i].first; vfIncluded[i] = true; if (nTotal >= nTargetValue) { fReachedTarget = true; if (nTotal < nBest) { nBest = nTotal; vfBest = vfIncluded; } nTotal -= vValue[i].first; vfIncluded[i] = false; } } } } } } bool CWallet::SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfTheirs, vector<COutput> vCoins, set<pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet) const { setCoinsRet.clear(); nValueRet = 0; // List of values less than target pair<int64, pair<const CWalletTx*,unsigned int> > coinLowestLarger; coinLowestLarger.first = std::numeric_limits<int64>::max(); coinLowestLarger.second.first = NULL; vector<pair<int64, pair<const CWalletTx*,unsigned int> > > vValue; int64 nTotalLower = 0; random_shuffle(vCoins.begin(), vCoins.end(), GetRandInt); BOOST_FOREACH(COutput output, vCoins) { const CWalletTx *pcoin = output.tx; if (output.nDepth < (pcoin->IsFromMe() ? nConfMine : nConfTheirs)) continue; int i = output.i; int64 n = pcoin->vout[i].nValue; pair<int64,pair<const CWalletTx*,unsigned int> > coin = make_pair(n,make_pair(pcoin, i)); if (n == nTargetValue) { setCoinsRet.insert(coin.second); nValueRet += coin.first; return true; } else if (n < nTargetValue + CENT) { vValue.push_back(coin); nTotalLower += n; } else if (n < coinLowestLarger.first) { coinLowestLarger = coin; } } if (nTotalLower == nTargetValue) { for (unsigned int i = 0; i < vValue.size(); ++i) { setCoinsRet.insert(vValue[i].second); nValueRet += vValue[i].first; } return true; } if (nTotalLower < nTargetValue) { if (coinLowestLarger.second.first == NULL) return false; setCoinsRet.insert(coinLowestLarger.second); nValueRet += coinLowestLarger.first; return true; } // Solve subset sum by stochastic approximation sort(vValue.rbegin(), vValue.rend(), CompareValueOnly()); vector<char> vfBest; int64 nBest; ApproximateBestSubset(vValue, nTotalLower, nTargetValue, vfBest, nBest, 1000); if (nBest != nTargetValue && nTotalLower >= nTargetValue + CENT) ApproximateBestSubset(vValue, nTotalLower, nTargetValue + CENT, vfBest, nBest, 1000); // If we have a bigger coin and (either the stochastic approximation didn't find a good solution, // or the next bigger coin is closer), return the bigger coin if (coinLowestLarger.second.first && ((nBest != nTargetValue && nBest < nTargetValue + CENT) || coinLowestLarger.first <= nBest)) { setCoinsRet.insert(coinLowestLarger.second); nValueRet += coinLowestLarger.first; } else { for (unsigned int i = 0; i < vValue.size(); i++) if (vfBest[i]) { setCoinsRet.insert(vValue[i].second); nValueRet += vValue[i].first; } //// debug print printf("SelectCoins() best subset: "); for (unsigned int i = 0; i < vValue.size(); i++) if (vfBest[i]) printf("%s ", FormatMoney(vValue[i].first).c_str()); printf("total %s\n", FormatMoney(nBest).c_str()); } return true; } bool CWallet::SelectCoins(int64 nTargetValue, set<pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet) const { vector<COutput> vCoins; AvailableCoins(vCoins); return (SelectCoinsMinConf(nTargetValue, 1, 6, vCoins, setCoinsRet, nValueRet) || SelectCoinsMinConf(nTargetValue, 1, 1, vCoins, setCoinsRet, nValueRet) || SelectCoinsMinConf(nTargetValue, 0, 1, vCoins, setCoinsRet, nValueRet)); } bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet) { int64 nValue = 0; BOOST_FOREACH (const PAIRTYPE(CScript, int64)& s, vecSend) { if (nValue < 0) return false; nValue += s.second; } if (vecSend.empty() || nValue < 0) return false; wtxNew.BindWallet(this); { LOCK2(cs_main, cs_wallet); // txdb must be opened before the mapWallet lock CTxDB txdb("r"); { nFeeRet = nTransactionFee; loop { wtxNew.vin.clear(); wtxNew.vout.clear(); wtxNew.fFromMe = true; int64 nTotalValue = nValue + nFeeRet; double dPriority = 0; // vouts to the payees BOOST_FOREACH (const PAIRTYPE(CScript, int64)& s, vecSend) wtxNew.vout.push_back(CTxOut(s.second, s.first)); // Choose coins to use set<pair<const CWalletTx*,unsigned int> > setCoins; int64 nValueIn = 0; if (!SelectCoins(nTotalValue, setCoins, nValueIn)) return false; BOOST_FOREACH(PAIRTYPE(const CWalletTx*, unsigned int) pcoin, setCoins) { int64 nCredit = pcoin.first->vout[pcoin.second].nValue; dPriority += (double)nCredit * pcoin.first->GetDepthInMainChain(); } int64 nChange = nValueIn - nValue - nFeeRet; // if sub-cent change is required, the fee must be raised to at least MIN_TX_FEE // or until nChange becomes zero // NOTE: this depends on the exact behaviour of GetMinFee if (nFeeRet < MIN_TX_FEE && nChange > 0 && nChange < CENT) { int64 nMoveToFee = min(nChange, MIN_TX_FEE - nFeeRet); nChange -= nMoveToFee; nFeeRet += nMoveToFee; } if (nChange > 0) { // Note: We use a new key here to keep it from being obvious which side is the change. // The drawback is that by not reusing a previous key, the change may be lost if a // backup is restored, if the backup doesn't have the new private key for the change. // If we reused the old key, it would be possible to add code to look for and // rediscover unknown transactions that were written with keys of ours to recover // post-backup change. // Reserve a new key pair from key pool CPubKey vchPubKey = reservekey.GetReservedKey(); // assert(mapKeys.count(vchPubKey)); // Fill a vout to ourself // TODO: pass in scriptChange instead of reservekey so // change transaction isn't always pay-to-bitcoin-address CScript scriptChange; scriptChange.SetDestination(vchPubKey.GetID()); // Insert change txn at random position: vector<CTxOut>::iterator position = wtxNew.vout.begin()+GetRandInt(wtxNew.vout.size()); wtxNew.vout.insert(position, CTxOut(nChange, scriptChange)); } else reservekey.ReturnKey(); // Fill vin BOOST_FOREACH(const PAIRTYPE(const CWalletTx*,unsigned int)& coin, setCoins) wtxNew.vin.push_back(CTxIn(coin.first->GetHash(),coin.second)); // Sign int nIn = 0; BOOST_FOREACH(const PAIRTYPE(const CWalletTx*,unsigned int)& coin, setCoins) if (!SignSignature(*this, *coin.first, wtxNew, nIn++)) return false; // Limit size unsigned int nBytes = ::GetSerializeSize(*(CTransaction*)&wtxNew, SER_NETWORK, PROTOCOL_VERSION); if (nBytes >= MAX_BLOCK_SIZE_GEN/5) return false; dPriority /= nBytes; // Check that enough fee is included int64 nPayFee = nTransactionFee * (1 + (int64)nBytes / 1000); bool fAllowFree = CTransaction::AllowFree(dPriority); int64 nMinFee = wtxNew.GetMinFee(1, fAllowFree, GMF_SEND); if (nFeeRet < max(nPayFee, nMinFee)) { nFeeRet = max(nPayFee, nMinFee); continue; } // Fill vtxPrev by copying from previous transactions vtxPrev wtxNew.AddSupportingTransactions(txdb); wtxNew.fTimeReceivedIsTxTime = true; break; } } } return true; } bool CWallet::CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet) { vector< pair<CScript, int64> > vecSend; vecSend.push_back(make_pair(scriptPubKey, nValue)); return CreateTransaction(vecSend, wtxNew, reservekey, nFeeRet); } // Call after CreateTransaction unless you want to abort bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey) { { LOCK2(cs_main, cs_wallet); printf("CommitTransaction:\n%s", wtxNew.ToString().c_str()); { // This is only to keep the database open to defeat the auto-flush for the // duration of this scope. This is the only place where this optimization // maybe makes sense; please don't do it anywhere else. CWalletDB* pwalletdb = fFileBacked ? new CWalletDB(strWalletFile,"r") : NULL; // Take key pair from key pool so it won't be used again reservekey.KeepKey(); // Add tx to wallet, because if it has change it's also ours, // otherwise just for transaction history. AddToWallet(wtxNew); // Mark old coins as spent set<CWalletTx*> setCoins; BOOST_FOREACH(const CTxIn& txin, wtxNew.vin) { CWalletTx &coin = mapWallet[txin.prevout.hash]; coin.BindWallet(this); coin.MarkSpent(txin.prevout.n); coin.WriteToDisk(); NotifyTransactionChanged(this, coin.GetHash(), CT_UPDATED); } if (fFileBacked) delete pwalletdb; } // Track how many getdata requests our transaction gets mapRequestCount[wtxNew.GetHash()] = 0; // Broadcast if (!wtxNew.AcceptToMemoryPool()) { // This must not fail. The transaction has already been signed and recorded. printf("CommitTransaction() : Error: Transaction not valid"); return false; } wtxNew.RelayWalletTransaction(); } return true; } string CWallet::SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, bool fAskFee) { CReserveKey reservekey(this); int64 nFeeRequired; if (IsLocked()) { string strError = _("Error: Wallet locked, unable to create transaction "); printf("SendMoney() : %s", strError.c_str()); return strError; } if (!CreateTransaction(scriptPubKey, nValue, wtxNew, reservekey, nFeeRequired)) { string strError; if (nValue + nFeeRequired > GetBalance()) strError = strprintf(_("Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds "), FormatMoney(nFeeRequired).c_str()); else strError = _("Error: Transaction creation failed "); printf("SendMoney() : %s", strError.c_str()); return strError; } if (fAskFee && !uiInterface.ThreadSafeAskFee(nFeeRequired, _("Sending..."))) return "ABORTED"; if (!CommitTransaction(wtxNew, reservekey)) return _("Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."); return ""; } string CWallet::SendMoneyToDestination(const CTxDestination& address, int64 nValue, CWalletTx& wtxNew, bool fAskFee) { // Check amount if (nValue <= 0) return _("Invalid amount"); if (nValue + nTransactionFee > GetBalance()) return _("Insufficient funds"); // Parse Bitcoin address CScript scriptPubKey; scriptPubKey.SetDestination(address); return SendMoney(scriptPubKey, nValue, wtxNew, fAskFee); } int CWallet::LoadWallet(bool& fFirstRunRet) { if (!fFileBacked) return false; fFirstRunRet = false; int nLoadWalletRet = CWalletDB(strWalletFile,"cr+").LoadWallet(this); if (nLoadWalletRet == DB_NEED_REWRITE) { if (CDB::Rewrite(strWalletFile, "\x04pool")) { setKeyPool.clear(); // Note: can't top-up keypool here, because wallet is locked. // User will be prompted to unlock wallet the next operation // the requires a new key. } nLoadWalletRet = DB_NEED_REWRITE; } if (nLoadWalletRet != DB_LOAD_OK) return nLoadWalletRet; fFirstRunRet = !vchDefaultKey.IsValid(); CreateThread(ThreadFlushWalletDB, &strWalletFile); return DB_LOAD_OK; } bool CWallet::SetAddressBookName(const CTxDestination& address, const string& strName) { std::map<CTxDestination, std::string>::iterator mi = mapAddressBook.find(address); mapAddressBook[address] = strName; NotifyAddressBookChanged(this, address, strName, ::IsMine(*this, address), (mi == mapAddressBook.end()) ? CT_NEW : CT_UPDATED); if (!fFileBacked) return false; return CWalletDB(strWalletFile).WriteName(CBitcoinAddress(address).ToString(), strName); } bool CWallet::DelAddressBookName(const CTxDestination& address) { mapAddressBook.erase(address); NotifyAddressBookChanged(this, address, "", ::IsMine(*this, address), CT_DELETED); if (!fFileBacked) return false; return CWalletDB(strWalletFile).EraseName(CBitcoinAddress(address).ToString()); } void CWallet::PrintWallet(const CBlock& block) { { LOCK(cs_wallet); if (mapWallet.count(block.vtx[0].GetHash())) { CWalletTx& wtx = mapWallet[block.vtx[0].GetHash()]; printf(" mine: %d %d %d", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), wtx.GetCredit()); } } printf("\n"); } bool CWallet::GetTransaction(const uint256 &hashTx, CWalletTx& wtx) { { LOCK(cs_wallet); map<uint256, CWalletTx>::iterator mi = mapWallet.find(hashTx); if (mi != mapWallet.end()) { wtx = (*mi).second; return true; } } return false; } bool CWallet::SetDefaultKey(const CPubKey &vchPubKey) { if (fFileBacked) { if (!CWalletDB(strWalletFile).WriteDefaultKey(vchPubKey)) return false; } vchDefaultKey = vchPubKey; return true; } bool GetWalletFile(CWallet* pwallet, string &strWalletFileOut) { if (!pwallet->fFileBacked) return false; strWalletFileOut = pwallet->strWalletFile; return true; } // // Mark old keypool keys as used, // and generate all new keys // bool CWallet::NewKeyPool() { { LOCK(cs_wallet); CWalletDB walletdb(strWalletFile); BOOST_FOREACH(int64 nIndex, setKeyPool) walletdb.ErasePool(nIndex); setKeyPool.clear(); if (IsLocked()) return false; int64 nKeys = max(GetArg("-keypool", 100), (int64)0); for (int i = 0; i < nKeys; i++) { int64 nIndex = i+1; walletdb.WritePool(nIndex, CKeyPool(GenerateNewKey())); setKeyPool.insert(nIndex); } printf("CWallet::NewKeyPool wrote %"PRI64d" new keys\n", nKeys); } return true; } bool CWallet::TopUpKeyPool() { { LOCK(cs_wallet); if (IsLocked()) return false; CWalletDB walletdb(strWalletFile); // Top up key pool unsigned int nTargetSize = max(GetArg("-keypool", 100), 0LL); while (setKeyPool.size() < (nTargetSize + 1)) { int64 nEnd = 1; if (!setKeyPool.empty()) nEnd = *(--setKeyPool.end()) + 1; if (!walletdb.WritePool(nEnd, CKeyPool(GenerateNewKey()))) throw runtime_error("TopUpKeyPool() : writing generated key failed"); setKeyPool.insert(nEnd); printf("keypool added key %"PRI64d", size=%d\n", nEnd, setKeyPool.size()); } } return true; } void CWallet::ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool) { nIndex = -1; keypool.vchPubKey = CPubKey(); { LOCK(cs_wallet); if (!IsLocked()) TopUpKeyPool(); // Get the oldest key if(setKeyPool.empty()) return; CWalletDB walletdb(strWalletFile); nIndex = *(setKeyPool.begin()); setKeyPool.erase(setKeyPool.begin()); if (!walletdb.ReadPool(nIndex, keypool)) throw runtime_error("ReserveKeyFromKeyPool() : read failed"); if (!HaveKey(keypool.vchPubKey.GetID())) throw runtime_error("ReserveKeyFromKeyPool() : unknown key in key pool"); assert(keypool.vchPubKey.IsValid()); printf("keypool reserve %"PRI64d"\n", nIndex); } } int64 CWallet::AddReserveKey(const CKeyPool& keypool) { { LOCK2(cs_main, cs_wallet); CWalletDB walletdb(strWalletFile); int64 nIndex = 1 + *(--setKeyPool.end()); if (!walletdb.WritePool(nIndex, keypool)) throw runtime_error("AddReserveKey() : writing added key failed"); setKeyPool.insert(nIndex); return nIndex; } return -1; } void CWallet::KeepKey(int64 nIndex) { // Remove from key pool if (fFileBacked) { CWalletDB walletdb(strWalletFile); walletdb.ErasePool(nIndex); } printf("keypool keep %"PRI64d"\n", nIndex); } void CWallet::ReturnKey(int64 nIndex) { // Return to key pool { LOCK(cs_wallet); setKeyPool.insert(nIndex); } printf("keypool return %"PRI64d"\n", nIndex); } bool CWallet::GetKeyFromPool(CPubKey& result, bool fAllowReuse) { int64 nIndex = 0; CKeyPool keypool; { LOCK(cs_wallet); ReserveKeyFromKeyPool(nIndex, keypool); if (nIndex == -1) { if (fAllowReuse && vchDefaultKey.IsValid()) { result = vchDefaultKey; return true; } if (IsLocked()) return false; result = GenerateNewKey(); return true; } KeepKey(nIndex); result = keypool.vchPubKey; } return true; } int64 CWallet::GetOldestKeyPoolTime() { int64 nIndex = 0; CKeyPool keypool; ReserveKeyFromKeyPool(nIndex, keypool); if (nIndex == -1) return GetTime(); ReturnKey(nIndex); return keypool.nTime; } CPubKey CReserveKey::GetReservedKey() { if (nIndex == -1) { CKeyPool keypool; pwallet->ReserveKeyFromKeyPool(nIndex, keypool); if (nIndex != -1) vchPubKey = keypool.vchPubKey; else { printf("CReserveKey::GetReservedKey(): Warning: using default key instead of a new key, top up your keypool."); vchPubKey = pwallet->vchDefaultKey; } } assert(vchPubKey.IsValid()); return vchPubKey; } void CReserveKey::KeepKey() { if (nIndex != -1) pwallet->KeepKey(nIndex); nIndex = -1; vchPubKey = CPubKey(); } void CReserveKey::ReturnKey() { if (nIndex != -1) pwallet->ReturnKey(nIndex); nIndex = -1; vchPubKey = CPubKey(); } void CWallet::GetAllReserveKeys(set<CKeyID>& setAddress) { setAddress.clear(); CWalletDB walletdb(strWalletFile); LOCK2(cs_main, cs_wallet); BOOST_FOREACH(const int64& id, setKeyPool) { CKeyPool keypool; if (!walletdb.ReadPool(id, keypool)) throw runtime_error("GetAllReserveKeyHashes() : read failed"); assert(keypool.vchPubKey.IsValid()); CKeyID keyID = keypool.vchPubKey.GetID(); if (!HaveKey(keyID)) throw runtime_error("GetAllReserveKeyHashes() : unknown key in key pool"); setAddress.insert(keyID); } } void CWallet::UpdatedTransaction(const uint256 &hashTx) { { LOCK(cs_wallet); // Only notify UI if this transaction is in this wallet map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(hashTx); if (mi != mapWallet.end()) NotifyTransactionChanged(this, hashTx, CT_UPDATED); } }
doriancoin/doriancoin-v3
src/wallet.cpp
C++
mit
52,573
CREATE TABLE SM_STATE_DEFINITION( STATE_ID NUMBER NOT NULL, WORKFLOW_ID NUMBER NOT NULL, STATE_NAME VARCHAR2(256) NOT NULL, EMAIL_TO VARCHAR2(2048), PRIMARY KEY(STATE_ID), FOREIGN KEY(WORKFLOW_ID) REFERENCES SM_WORKFLOW_DEFINITION(WORKFLOW_ID) ); CREATE UNIQUE INDEX I_SM_STATE_DEFINITION ON SM_STATE_DEFINITION(WORKFLOW_ID, STATE_NAME); CREATE TABLE SM_WORKFLOW_STATE( STATE_ID NUMBER NOT NULL, NEXT_STATE_ID NUMBER, ACTION VARCHAR2(512), FOREIGN KEY(STATE_ID) REFERENCES STATE_DEFINITION(STATE_ID) FOREIGN KEY(NEXT_STATE_ID) REFERENCES STATE_DEFINITION(STATE_ID) ); CREATE TABLE SM_WORKFLOW_DEFINITION( WORKFLOW_ID NUMBER NOT NULL, WORKFLOW_TYPE VARCHAR2(256) NOT NULL, EMAIL_NOTIFICATION CHAR(1) DEFAULT 'N', EMAIL_SUBJECT VARCHAR2(1024), EMAIL_CONTENT VARCHAR2(2048), PRIMARY KEY(WORKFLOW_ID) ); CREATE TABLE SM_STATE_HISTORY ( ITEM_TYPE VARCHAr2(256) not null, ITEM_ID VARCHAR2(256) NOT NULL, STATE_ID NUMBER NOT NULL, NOTES VARCHAR2(2048), USERID VARCHAR2(100) NOT NULL, STATE_ACTION VARCHAR2(100) NOT NULL, USER_SUBSCRIPTION_NOTIFICATION VARCHAR2(100), INSERT_TS TIMESTAMP NOT NULL, FOREIGN KEY(STATE_ID) REFERENCES STATE_DEFINITION(STATE_ID) ); CREATE INDEX I_SM_STATE_HISTORY ON SM_STATE_HISTORY(ITEM_TYPE, ITEM_ID); CREATE TABLE SM_VERSION ( ITEM_TYPE VARCHAR2(256) NOT NULL, ITEM_ID VARCHAR2(256) NOT NULL, VERSION_NUMBER NUMBER NOT NULL, CREATED_TS DATETIME NOT NULL, PRIMARY KEY (ITEM_TYPE, VERSION_NUMBER) ); CREATE UNIQUE INDEX I_SM_VERSION ON SM_VERSION(ITEM_TYPE, ITEM_ID);
SasiAR/state-manager
resources/database-schema/required_tables.sql
SQL
mit
1,656
<?php /* Safe sample input : get the field UserData from the variable $_POST sanitize : settype (float) construction : use of sprintf via a %u with simple quote */ /*Copyright 2015 Bertrand STIVALET Permission is hereby granted, without written agreement or royalty fee, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following three paragraphs appear in all copies of this software. IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.*/ $tainted = $_POST['UserData']; if(settype($tainted, "float")) $tainted = $tainted ; else $tainted = 0.0 ; $query = sprintf("SELECT * FROM student where id='%u'", $tainted); $conn = mysql_connect('localhost', 'mysql_user', 'mysql_password'); // Connection to the database (address, user, password) mysql_select_db('dbname') ; echo "query : ". $query ."<br /><br />" ; $res = mysql_query($query); //execution while($data =mysql_fetch_array($res)){ print_r($data) ; echo "<br />" ; } mysql_close($conn); ?>
stivalet/PHP-Vulnerability-test-suite
Injection/CWE_89/safe/CWE_89__POST__CAST-func_settype_float__select_from_where-sprintf_%u_simple_quote.php
PHP
mit
1,590
var final_transcript = ''; var recognizing = false; //var socket = io.connect('http://collab.di.uniba.it:48922');//"http://collab.di.uniba.it/~iaffaldano:48922" //socket.emit('client_type', {text: "Speaker"}); if ('webkitSpeechRecognition' in window) { var recognition = new webkitSpeechRecognition(); recognition.continuous = true; recognition.interimResults = true; console.log("MAX ALTERNATIVES = "+ recognition.maxAlternatives); recognition.onstart = function () { recognizing = true; console.log("RECOGNITION STARTED"); }; recognition.onerror = function (event) { console.log("RECOGNITION ERROR: " + event.error); recognition.start(); }; recognition.onend = function () { console.log("RECOGNITION STOPPED"); if(recognizing){ recognition.start(); console.log("RECOGNITION RESTARTED"); } }; recognition.onresult = function (event) { var interim_transcript = ''; for (var i = event.resultIndex; i < event.results.length; ++i) { if (event.results[i].isFinal) { final_transcript += event.results[i][0].transcript; console.log("CONFIDENCE (" + event.results[i][0].transcript + ") = " + event.results[i][0].confidence); //recognition.stop(); //recognition.start(); socket.emit('client_message', {text: event.results[i][0].transcript}); } else { interim_transcript += event.results[i][0].transcript; } } final_transcript = capitalize(final_transcript); final_span.innerHTML = linebreak(final_transcript); interim_span.innerHTML = linebreak(interim_transcript); }; recognition.onaudiostart= function (event) { console.log("AUDIO START"); }; recognition.onsoundstart= function (event) { console.log("SOUND START"); }; recognition.onspeechstart= function (event) { console.log("SPEECH START"); }; recognition.onspeechend= function (event) { console.log("SPEECH END"); }; recognition.onsoundend= function (event) { console.log("SOUND END"); }; recognition.onnomatch= function (event) { console.log("NO MATCH"); }; } var two_line = /\n\n/g; var one_line = /\n/g; function linebreak(s) { return s.replace(two_line, '<p></p>').replace(one_line, '<br>'); } function capitalize(s) { return s.replace(s.substr(0, 1), function (m) { return m.toUpperCase(); }); } function startDictation(event) { if (recognizing) { recognition.stop(); recognizing=false; start_button.innerHTML = "START" return; } final_transcript = ''; recognition.lang = 'it-IT'; recognition.start(); start_button.innerHTML = "STOP" final_span.innerHTML = ''; interim_span.innerHTML = ''; }
collab-uniba/scriba
client/src/js/transcriptor.js
JavaScript
mit
2,613
/* eslint-disable promise/always-return */ import { runAuthenticatedQuery, runQuery } from "schema/v1/test/utils" describe("UpdateCollectorProfile", () => { it("updates and returns a collector profile", () => { /* eslint-disable max-len */ const mutation = ` mutation { updateCollectorProfile(input: { professional_buyer: true, loyalty_applicant: true, self_reported_purchases: "trust me i buy art", intents: [BUY_ART_AND_DESIGN] }) { id name email self_reported_purchases intents } } ` /* eslint-enable max-len */ const context = { updateCollectorProfileLoader: () => Promise.resolve({ id: "3", name: "Percy", email: "[email protected]", self_reported_purchases: "treats", intents: ["buy art & design"], }), } const expectedProfileData = { id: "3", name: "Percy", email: "[email protected]", self_reported_purchases: "treats", intents: ["buy art & design"], } expect.assertions(1) return runAuthenticatedQuery(mutation, context).then( ({ updateCollectorProfile }) => { expect(updateCollectorProfile).toEqual(expectedProfileData) } ) }) it("throws error when data loader is missing", () => { /* eslint-disable max-len */ const mutation = ` mutation { updateCollectorProfile(input: { professional_buyer: true, loyalty_applicant: true, self_reported_purchases: "trust me i buy art" }) { id name email self_reported_purchases intents } } ` /* eslint-enable max-len */ const errorResponse = "Missing Update Collector Profile Loader. Check your access token." expect.assertions(1) return runQuery(mutation) .then(() => { throw new Error("An error was not thrown but was expected.") }) .catch(error => { expect(error.message).toEqual(errorResponse) }) }) })
mzikherman/metaphysics-1
src/schema/v1/me/__tests__/update_collector_profile.test.js
JavaScript
mit
2,055
module.exports = require('./src/tracking');
JoshuaTang/jstracking
index.js
JavaScript
mit
44
<!DOCTYPE html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="keywords" content=" "> <title>Subscribe to Messaging Events | LivePerson Technical Documentation</title> <link rel="stylesheet" href="css/syntax.css"> <link rel="stylesheet" type="text/css" href="css/font-awesome-4.7.0/css/font-awesome.min.css"> <!--<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">--> <link rel="stylesheet" href="css/modern-business.css"> <link rel="stylesheet" href="css/lavish-bootstrap.css"> <link rel="stylesheet" href="css/customstyles.css"> <link rel="stylesheet" href="css/theme-blue.css"> <!-- <script src="assets/js/jsoneditor.js"></script> --> <script src="assets/js/jquery-3.1.0.min.js"></script> <!-- <link rel='stylesheet' id='theme_stylesheet' href='//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css'> --> <!-- <link rel='stylesheet' id='theme_stylesheet' href='//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css'> --> <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> --> <script src="assets/js/jquery.cookie-1.4.1.min.js"></script> <script src="js/jquery.navgoco.min.js"></script> <script src="assets/js/bootstrap-3.3.4.min.js"></script> <script src="assets/js/anchor-2.0.0.min.js"></script> <script src="js/toc.js"></script> <script src="js/customscripts.js"></script> <link rel="shortcut icon" href="images/favicon.ico"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> <link rel="alternate" type="application/rss+xml" title="" href="http://0.0.0.0:4005feed.xml"> <script> $(document).ready(function() { // Initialize navgoco with default options $("#mysidebar").navgoco({ caretHtml: '', accordion: true, openClass: 'active', // open save: false, // leave false or nav highlighting doesn't work right cookie: { name: 'navgoco', expires: false, path: '/' }, slide: { duration: 400, easing: 'swing' } }); $("#collapseAll").click(function(e) { e.preventDefault(); $("#mysidebar").navgoco('toggle', false); }); $("#expandAll").click(function(e) { e.preventDefault(); $("#mysidebar").navgoco('toggle', true); }); }); </script> <script> $(function () { $('[data-toggle="tooltip"]').tooltip() }) </script> </head> <body> <!-- Navigation --> <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container topnavlinks"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="fa fa-home fa-lg navbar-brand" href="index.html">&nbsp;<span class="projectTitle"> LivePerson Technical Documentation</span></a> </div> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> <!-- entries without drop-downs appear here --> <!-- entries with drop-downs appear here --> <!-- conditional logic to control which topnav appears for the audience defined in the configuration file.--> <li><a class="email" title="Submit feedback" href="https://github.com/LivePersonInc/dev-hub/issues" ><i class="fa fa-github"></i> Issues</a><li> <!--comment out this block if you want to hide search--> <li> <!--start search--> <div id="search-demo-container"> <input type="text" id="search-input" placeholder="search..."> <ul id="results-container"></ul> </div> <script src="js/jekyll-search.js" type="text/javascript"></script> <script type="text/javascript"> SimpleJekyllSearch.init({ searchInput: document.getElementById('search-input'), resultsContainer: document.getElementById('results-container'), dataSource: 'search.json', searchResultTemplate: '<li><a href="{url}" title="Subscribe to Messaging Events">{title}</a></li>', noResultsText: 'No results found.', limit: 10, fuzzy: true, }) </script> <!--end search--> </li> </ul> </div> </div> <!-- /.container --> </nav> <!-- Page Content --> <div class="container"> <div class="col-lg-12">&nbsp;</div> <!-- Content Row --> <div class="row"> <!-- Sidebar Column --> <div class="col-md-3"> <ul id="mysidebar" class="nav"> <li class="sidebarTitle"> </li> <li> <a href="#">Common Guidelines</a> <ul> <li class="subfolders"> <a href="#">Introduction</a> <ul> <li class="thirdlevel"><a href="index.html">Home</a></li> <li class="thirdlevel"><a href="getting-started.html">Getting Started with LiveEngage APIs</a></li> </ul> </li> <li class="subfolders"> <a href="#">Guides</a> <ul> <li class="thirdlevel"><a href="guides-customizedchat.html">Customized Chat Windows</a></li> </ul> </li> </ul> <li> <a href="#">Account Configuration</a> <ul> <li class="subfolders"> <a href="#">Predefined Content API</a> <ul> <li class="thirdlevel"><a href="account-configuration-predefined-content-overview.html">Overview</a></li> <li class="thirdlevel"><a href="account-configuration-predefined-content-methods.html">Methods</a></li> <li class="thirdlevel"><a href="account-configuration-predefined-content-get-items.html">Get Predefined Content Items</a></li> <li class="thirdlevel"><a href="account-configuration-predefined-content-get-by-id.html">Get Predefined Content by ID</a></li> <li class="thirdlevel"><a href="account-configuration-predefined-content-query-delta.html">Predefined Content Query Delta</a></li> <li class="thirdlevel"><a href="account-configuration-predefined-content-create-content.html">Create Predefined Content</a></li> <li class="thirdlevel"><a href="account-configuration-predefined-content-update-content.html">Update Predefined Content</a></li> <li class="thirdlevel"><a href="account-configuration-predefined-content-update-content-items.html">Update Predefined Content Items</a></li> <li class="thirdlevel"><a href="account-configuration-predefined-content-delete-content.html">Delete Predefined Content</a></li> <li class="thirdlevel"><a href="account-configuration-predefined-content-delete-content-items.html">Delete Predefined Content Items</a></li> <li class="thirdlevel"><a href="account-configuration-predefined-content-get-default-items.html">Get Default Predefined Content Items</a></li> <li class="thirdlevel"><a href="account-configuration-predefined-content-get-default-items-by-id.html">Get Default Predefined Content by ID</a></li> <li class="thirdlevel"><a href="account-configuration-predefined-content-appendix.html">Appendix</a></li> </ul> </li> <li class="subfolders"> <a href="#">Automatic Messages API</a> <ul> <li class="thirdlevel"><a href="account-configuration-automatic-messages-overview.html">Overview</a></li> <li class="thirdlevel"><a href="account-configuration-automatic-messages-methods.html">Methods</a></li> <li class="thirdlevel"><a href="account-configuration-automatic-messages-get-automatic-messages.html">Get Automatic Messages</a></li> <li class="thirdlevel"><a href="account-configuration-automatic-messages-get-automatic-message-by-id.html">Get Automatic Message by ID</a></li> <li class="thirdlevel"><a href="account-configuration-automatic-messages-update-an-automatic-message.html">Update an Automatic Message</a></li> <li class="thirdlevel"><a href="account-configuration-automatic-messages-appendix.html">Appendix</a></li> </ul> </li> </ul> <li> <a href="#">Administration</a> <ul> <li class="subfolders"> <a href="#">Users API</a> <ul> <li class="thirdlevel"><a href="administration-users-overview.html">Overview</a></li> <li class="thirdlevel"><a href="administration-users-methods.html">Methods</a></li> <li class="thirdlevel"><a href="administration-get-all-users.html">Get all users</a></li> <li class="thirdlevel"><a href="administration-get-user-by-id.html">Get user by ID</a></li> <li class="thirdlevel"><a href="administration-create-users.html">Create users</a></li> <li class="thirdlevel"><a href="administration-update-users.html">Update users</a></li> <li class="thirdlevel"><a href="administration-update-user.html">Update user</a></li> <li class="thirdlevel"><a href="administration-delete-users.html">Delete users</a></li> <li class="thirdlevel"><a href="administration-delete-user.html">Delete user</a></li> <li class="thirdlevel"><a href="administration-change-users-password.html">Change user's password</a></li> <li class="thirdlevel"><a href="administration-reset-users-password.html">Reset user's password</a></li> <li class="thirdlevel"><a href="administration-user-query-delta.html">User query delta</a></li> <li class="thirdlevel"><a href="administration-users-appendix.html">Appendix</a></li> </ul> </li> <li class="subfolders"> <a href="#">Skills API</a> <ul> <li class="thirdlevel"><a href="administration-skills-overview.html">Overview</a></li> <li class="thirdlevel"><a href="administration-skills-methods.html">Methods</a></li> <li class="thirdlevel"><a href="administration-get-all-skills.html">Get all skills</a></li> <li class="thirdlevel"><a href="administration-get-skill-by-id.html">Get skill by ID</a></li> <li class="thirdlevel"><a href="administration-create-skills.html">Create skills</a></li> <li class="thirdlevel"><a href="administration.update-skills.html">Update skills</a></li> <li class="thirdlevel"><a href="administration-update-skill.html">Update skill</a></li> <li class="thirdlevel"><a href="administration-delete-skills.html">Delete skills</a></li> <li class="thirdlevel"><a href="administration-delete-skill.html">Delete skill</a></li> <li class="thirdlevel"><a href="administration-skills-query-delta.html">Skills Query Delta</a></li> <li class="thirdlevel"><a href="administration-skills-appendix.html">Appendix</a></li> </ul> </li> <li class="subfolders"> <a href="#">Agent Groups API</a> <ul> <li class="thirdlevel"><a href="administration-agent-groups-overview.html">Overview</a></li> <li class="thirdlevel"><a href="administration-agent-groups-methods.html">Methods</a></li> <li class="thirdlevel"><a href="administration-get-all-agent-groups.html">Get all agent groups</a></li> <li class="thirdlevel"><a href="administration-get-agent-groups-by-id.html">Get agent group by ID</a></li> <li class="thirdlevel"><a href="administration-create-agent-groups.html">Create agent groups</a></li> <li class="thirdlevel"><a href="administration-update-agent-groups.html">Update agent groups</a></li> <li class="thirdlevel"><a href="administration-update-agent-group.html">Update agent group</a></li> <li class="thirdlevel"><a href="administration-delete-agent-groups.html">Delete agent groups</a></li> <li class="thirdlevel"><a href="administration-delete-agent-group.html">Delete agent group</a></li> <li class="thirdlevel"><a href="administration-get-subgroups-and-members.html">Get subgroups and members of an agent group</a></li> <li class="thirdlevel"><a href="administration-agent-groups-query-delta.html">Agent Groups Query Delta</a></li> </ul> </li> </ul> <li> <a href="#">Consumer Experience</a> <ul> <li class="subfolders"> <a href="#">JavaScript Chat API</a> <ul> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-getting-started.html">Getting Started</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-chat-states.html">Chat States</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-surveys.html">Surveys</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-creating-an-instance.html">Creating an Instance</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-methods.html">Methods</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-getestimatedwaittime.html">getEstimatedWaitTime</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-getprechatsurvey.html">getPreChatSurvey</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-getengagement.html">getEngagement</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-requestchat.html">requestChat</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-addline.html">addLine</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-setvisitortyping.html">setVisitorTyping</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-setvisitorname.html">setVisitorName</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-endchat.html">endChat</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-requesttranscript.html">requestTranscript</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-getexitsurvey.html">getExitSurvey</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-submitexitsurvey.html">submitExitSurvey</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-getofflinesurvey.html">getOfflineSurvey</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-submitofflinesurvey.html">submitOfflineSurvey</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-getstate.html">getState</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-getagentloginname.html">getAgentLoginName</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-getvisitorname.html">getVisitorName</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-getagentid.html">getAgentId</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-getrtsessionid.html">getRtSessionId</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-getsessionkey.html">getSessionKey</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-getagenttyping.html">getAgentTyping</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-events.html">Events</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-onload.html">onLoad</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-oninit.html">onInit</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-onestimatedwaittime.html">onEstimatedWaitTime</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-onengagement.html">onEngagement</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-onprechatsurvey.html">onPreChatSurvey</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-onstart.html">onStart</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-onstop.html">onStop</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-onrequestchat.html">onRequestChat</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-ontranscript.html">onTranscript</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-online.html">onLine</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-onstate.html">onState</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-oninfo.html">onInfo</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-onagenttyping.html">onAgentTyping</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-onexitsurvey.html">onExitSurvey</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-onaccounttoaccounttransfer.html">onAccountToAccountTransfer</a></li> <li class="thirdlevel"><a href="rt-interactions-example.html">Engagement Attributes Body Example</a></li> <li class="thirdlevel"><a href="consumer-experience-javascript-chat-demo.html">Demo App</a></li> </ul> </li> <li class="subfolders"> <a href="#">Server Chat API</a> <ul> <li class="thirdlevel"><a href="consumer-experience-server-chat-getting-started.html">Getting Started</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-methods.html">Methods</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-availability.html">Retrieve Availability</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-available-slots.html">Retrieve Available Slots</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-estimated-wait-time.html">Retrieve Estimated Wait Time</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-offline-survey.html">Retrieve an Offline Survey</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-start-chat.html">Start a Chat</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-chat-resources.html">Retrieve Chat Resources, Events and Information</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-chat-events.html">Retrieve Chat Events</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-add-lines.html">Add Lines / End Chat</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-chat-information.html">Retrieve Chat Information</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-visitor-name.html">Retrieve the Visitor's Name</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-set-visitor-name.html">Set the Visitor's Name</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-agent-typing-status.html">Retrieve the Agent's Typing Status</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-visitor-typing-status.html">Retrieve the Visitor's Typing Status</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-set-visitor-typing-status.html">Set the Visitor's Typing Status</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-retrieve-exit-survey-structure.html">Retrieve Exit Survey Structure</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-submit-survey-data.html">Submit Survey Data</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-send-transcript.html">Send a Transcript</a></li> <li class="thirdlevel"><a href="consumer-experience-server-chat-sample.html">Sample Postman Collection</a></li> </ul> </li> <li class="subfolders"> <a href="#">Push Service API</a> <ul> <li class="thirdlevel"><a href="push-service-overview.html">Overview</a></li> <li class="thirdlevel"><a href="push-service-tls-html">TLS Authentication</a></li> <li class="thirdlevel"><a href="push-service-codes-html">HTTP Response Codes</a></li> <li class="thirdlevel"><a href="push-service-configuration-html">Configuration of Push Proxy</a></li> </ul> </li> <li class="subfolders"> <a href="#">In-App Messaging SDK iOS (2.0)</a> <ul> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-quick-start.html">Quick Start</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-advanced-configurations.html">Advanced Configurations</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-methods.html">Methods</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-initialize.html">initialize</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-showconversation.html">showConversation</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-removeconversation.html">removeConversation</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-reconnect.html">reconnect</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-togglechatactions.html">toggleChatActions</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-checkactiveconversation.html">checkActiveConversation</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-markasurgent.html">markAsUrgent</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-isurgent.html">isUrgent</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-dismissurgent.html">dismissUrgent</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-resolveconversation.html">resolveConversation</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-clearhistory.html">clearHistory</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-logout.html">logout</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-destruct.html">destruct</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-handlepush.html">handlePush</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-registerpushnotifications.html">registerPushNotifications</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-setuserprofile.html">setUserProfile</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-getassignedagent.html">getAssignedAgent</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-subscribelogevents.html">subscribeLogEvents</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-getsdkversion.html">getSDKVersion</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-printalllocalizedkeys.html">printAllLocalizedKeys</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-printsupportedlanguages.html">printSupportedLanguages</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-getallsupportedlanguages.html">getAllSupportedLanguages</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-interfacedefinitions.html">Interface and Class Definitions</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-callbacks-index.html">Callbacks index</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-configuring-the-sdk.html">Configuring the SDK</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-attributes.html">Attributes</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-deprecated-attributes.html">Deprecated Attributes</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-stringlocalization.html">String localization in SDK</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-localizationkeys.html">Localization Keys</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-timestamps.html">Timestamps Formatting</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-createcertificate.html">OS Certificate Creation</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-advanced-csat.html">CSAT UI Content</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-photosharing.html">Photo Sharing (Beta)</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-pushnotifications.html">Configuring Push Notifications</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-opensource.html">Open Source List</a></li> <li class="thirdlevel"><a href="consumer-experience-ios-sdk-security.html">Security</a></li> </ul> </li> <li class="subfolders"> <a href="#">In-App Messaging SDK Android (2.0)</a> <ul> <li class="thirdlevel"><a href="android-overview.html">Overview</a></li> <li class="thirdlevel"><a href="android-prerequisites.html">Prerequisites</a></li> <li class="thirdlevel"><a href="android-download-and-unzip.html">Step 1: Download and Unzip the SDK</a></li> <li class="thirdlevel"><a href="android-configure-project-settings.html">Step 2: Configure project settings to connect LiveEngage SDK</a></li> <li class="thirdlevel"><a href="android-code-integration.html">Step 3: Code integration for basic deployment</a></li> <li class="thirdlevel"><a href="android-initialization.html">SDK Initialization and Lifecycle</a></li> <li class="thirdlevel"><a href="android-authentication.html">Authentication</a></li> <li class="thirdlevel"><a href="android-conversations-lifecycle.html">Conversations Lifecycle</a></li> <li class="thirdlevel"><a href="android-callbacks-interface.html">LivePerson Callbacks Interface</a></li> <li class="thirdlevel"><a href="android-notifications.html">Notifications</a></li> <li class="thirdlevel"><a href="android-user-data.html">User Data</a></li> <li class="thirdlevel"><a href="android-logs.html">Logs and Info</a></li> <li class="thirdlevel"><a href="android-methods.html">Methods</a></li> <li class="thirdlevel"><a href="android-initializedeprecated.html">initialize (Deprecated)</a></li> <li class="thirdlevel"><a href="android-initializeproperties.html">initialize (with SDK properties object)</a></li> <li class="thirdlevel"><a href="android-showconversation.html">showConversation</a></li> <li class="thirdlevel"><a href="android-showconversationauth.html">showConversation (with authentication support)</a></li> <li class="thirdlevel"><a href="android-hideconversation.html">hideConversation</a></li> <li class="thirdlevel"><a href="android-getconversationfrag.html">getConversationFragment</a></li> <li class="thirdlevel"><a href="android-getconversationfragauth.html">getConversationFragment with authentication support</a></li> <li class="thirdlevel"><a href="android-reconnect.html">reconnect</a></li> <li class="thirdlevel"><a href="android-setuserprofile.html">setUserProfile</a></li> <li class="thirdlevel"><a href="android-setuserprofiledeprecated.html">setUserProfile (Deprecated)</a></li> <li class="thirdlevel"><a href="android-registerlppusher.html">registerLPPusher</a></li> <li class="thirdlevel"><a href="android-unregisterlppusher.html">unregisterLPPusher</a></li> <li class="thirdlevel"><a href="android-handlepush.html">handlePush</a></li> <li class="thirdlevel"><a href="android-getsdkversion.html">getSDKVersion</a></li> <li class="thirdlevel"><a href="android-setcallback.html">setCallback</a></li> <li class="thirdlevel"><a href="android-removecallback.html">removeCallBack</a></li> <li class="thirdlevel"><a href="android-checkactiveconversation.html">checkActiveConversation</a></li> <li class="thirdlevel"><a href="android-checkagentid.html">checkAgentID</a></li> <li class="thirdlevel"><a href="android-markurgent.html">markConversationAsUrgent</a></li> <li class="thirdlevel"><a href="android-marknormal.html">markConversationAsNormal</a></li> <li class="thirdlevel"><a href="android-checkurgent.html">checkConversationIsMarkedAsUrgent</a></li> <li class="thirdlevel"><a href="android-resolveconversation.html">resolveConversation</a></li> <li class="thirdlevel"><a href="android-shutdown.html">shutDown</a></li> <li class="thirdlevel"><a href="android-shutdowndeprecated.html">shutDown (Deprecated)</a></li> <li class="thirdlevel"><a href="android-clearhistory.html">clearHistory</a></li> <li class="thirdlevel"><a href="android-logout.html">logOut</a></li> <li class="thirdlevel"><a href="android-callbacks-index.html">Callbacks Index</a></li> <li class="thirdlevel"><a href="android-configuring-sdk.html">Configuring the SDK</a></li> <li class="thirdlevel"><a href="android-attributes.html">Attributes</a></li> <li class="thirdlevel"><a href="android-configuring-edittext.html">Configuring the message’s EditText</a></li> <li class="thirdlevel"><a href="android-proguard.html">Proguard Configuration</a></li> <li class="thirdlevel"><a href="android-modifying-string.html">Modifying Strings</a></li> <li class="thirdlevel"><a href="android-modifying-resources.html">Modifying Resources</a></li> <li class="thirdlevel"><a href="android-plural-string.html">Plural String Resource Example</a></li> <li class="thirdlevel"><a href="android-timestamps.html">Timestamps Formatting</a></li> <li class="thirdlevel"><a href="android-off-hours.html">Date and Time</a></li> <li class="thirdlevel"><a href="android-bubble.html">Bubble Timestamp</a></li> <li class="thirdlevel"><a href="android-separator.html">Separator Timestamp</a></li> <li class="thirdlevel"><a href="android-resolve.html">Resolve Message</a></li> <li class="thirdlevel"><a href="android-csat.html">CSAT Behavior</a></li> <li class="thirdlevel"><a href="android-photo-sharing.html">Photo Sharing - Beta</a></li> <li class="thirdlevel"><a href="android-push-notifications.html">Enable Push Notifications</a></li> <li class="thirdlevel"><a href="android-appendix.html">Appendix</a></li> </ul> </li> </ul> <li> <a href="#">Real-time Interactions</a> <ul> <li class="subfolders"> <a href="#">Visit Information API</a> <ul> <li class="thirdlevel"><a href="rt-interactions-visit-information-overview.html">Overview</a></li> <li class="thirdlevel"><a href="rt-interactions-visit-information-visit-information.html">Visit Information</a></li> </ul> </li> <li class="subfolders"> <a href="#">App Engagement API</a> <ul> <li class="thirdlevel"><a href="rt-interactions-app-engagement-overview.html">Overview</a></li> <li class="thirdlevel"><a href="rt-interactions-app-engagement-methods.html">Methods</a></li> <li class="thirdlevel"><a href="rt-interactions-create-session.html">Create Session</a></li> <li class="thirdlevel"><a href="rt-interactions-update-session.html">Update Session</a></li> </ul> </li> <li class="subfolders"> <a href="#">Engagement Attributes</a> <ul> <li class="thirdlevel"><a href="rt-interactions-engagement-attributes-overview.html">Overview</a></li> <li class="thirdlevel"><a href="rt-interactions-engagement-attributes-engagement-attributes.html">Engagement Attributes</a></li> </ul> </li> <li class="subfolders"> <a href="#">IVR Engagement API</a> <ul> <li class="thirdlevel"><a href="rt-interactions-ivr-engagement-overview.html">Overview</a></li> <li class="thirdlevel"><a href="rt-interactions-ivr-engagement-methods.html">Methods</a></li> <li class="thirdlevel"><a href="rt-interactions-ivr-engagement-external engagement.html">External Engagement</a></li> </ul> </li> <li class="subfolders"> <a href="#">Validate Engagement</a> <ul> <li class="thirdlevel"><a href="rt-interactions-validate-engagement-overview.html">Overview</a></li> <li class="thirdlevel"><a href="rt-interactions-validate-engagement-validate-engagement.html">Validate Engagement API</a></li> </ul> </li> <li class="subfolders"> <a href="#">Engagement Trigger API</a> <ul> <li class="thirdlevel"><a href="trigger-overview.html">Overview</a></li> <li class="thirdlevel"><a href="trigger-methods.html">Methods</a></li> <li class="thirdlevel"><a href="trigger-click.html">Click</a></li> <li class="thirdlevel"><a href="trigger-getinfo.html">getEngagementInfo</a></li> <li class="thirdlevel"><a href="trigger-getstate.html">getEngagementState</a></li> </ul> </li> <li class="subfolders"> <a href="#">Engagement Window Widget SDK</a> <ul> <li class="thirdlevel"><a href="rt-interactions-window-sdk-overview.html">Overview</a></li> <li class="thirdlevel"><a href="rt-interactions-window-sdk-getting-started.html">Getting Started</a></li> <li class="thirdlevel"><a href="rt-interactions-window-sdk-limitations.html">Limitations</a></li> <li class="thirdlevel"><a href="rt-interactions-window-sdk-configuration.html">Configuration</a></li> <li class="thirdlevel"><a href="rt-interactions-window-sdk-how-to-use.html">How to use the SDK</a></li> <li class="thirdlevel"><a href="rt-interactions-window-sdk-code-examples.html">Code Examples</a></li> <li class="thirdlevel"><a href="rt-interactions-window-sdk-event-structure.html">Event Structure</a></li> </ul> </li> </ul> <li> <a href="#">Agent</a> <ul> <li class="subfolders"> <a href="#">Agent Workspace Widget SDK</a> <ul> <li class="thirdlevel"><a href="agent-workspace-sdk-overview.html">Overview</a></li> <li class="thirdlevel"><a href="agent-workspace-sdk-getting-started.html">Getting Started</a></li> <li class="thirdlevel"><a href="agent-workspace-sdk-limitations.html">Limitations</a></li> <li class="thirdlevel"><a href="agent-workspace-sdk-how-to-use.html">How to use the SDK</a></li> <li class="thirdlevel"><a href="agent-workspace-sdk-methods.html">Methods</a></li> <li class="thirdlevel"><a href="agent-workspace-sdk-public-model.html">Public Model Structure</a></li> <li class="thirdlevel"><a href="agent-workspace-sdk-public-properties.html">Public Properties</a></li> <li class="thirdlevel"><a href="agent-workspace-sdk-code-examples.html">Code Examples</a></li> </ul> </li> <li class="subfolders"> <a href="#">LivePerson Domain API</a> <ul> <li class="thirdlevel"><a href="agent-domain-domain-api.html">Domain API</a></li> </ul> </li> <li class="subfolders"> <a href="#">Login Service API</a> <ul> <li class="thirdlevel"><a href="login-getting-started.html">Getting Started</a></li> <li class="thirdlevel"><a href="agent-login-methods.html">Methods</a></li> <li class="thirdlevel"><a href="agent-login.html">Login</a></li> <li class="thirdlevel"><a href="agent-refresh.html">Refresh</a></li> <li class="thirdlevel"><a href="agent-refresh.html">Logout</a></li> </ul> </li> <li class="subfolders"> <a href="#">Chat Agent API</a> <ul> <li class="thirdlevel"><a href="chat-agent-getting-started.html">Getting Started</a></li> <li class="thirdlevel"><a href="agent-chat-agent-methods.html">Methods</a></li> <li class="thirdlevel"><a href="agent-start-agent-session.html">Start Agent Session</a></li> <li class="thirdlevel"><a href="agent-retrieve-current-availability.html">Retrieve Current Availability</a></li> <li class="thirdlevel"><a href="agent-set-agent-availability.html">Set Agent Availability</a></li> <li class="thirdlevel"><a href="agent-retrieve-available-agents.html">Retrieve Available Agents</a></li> <li class="thirdlevel"><a href="agent-retrieve-available-slots.html">Retrieve Available Slots</a></li> <li class="thirdlevel"><a href="agent-retrieve-agent-information.html">Retrieve Agent Information</a></li> <li class="thirdlevel"><a href="agent-determine-incoming.html">Determine Incoming Chat Requests</a></li> <li class="thirdlevel"><a href="agent-accept-chat.html">Accept a Chat</a></li> <li class="thirdlevel"><a href="agent-retrieve-chat-sessions.html">Retrieve Chat Sessions</a></li> <li class="thirdlevel"><a href="agent-retrieve-chat-resources.html">Retrieve Chat Resources, Events and Information</a></li> <li class="thirdlevel"><a href="agent-retrieve-data.html">Retrieve Data for Multiple Chats</a></li> <li class="thirdlevel"><a href="agent-retrieve-chat-events.html">Retrieve Chat Events</a></li> <li class="thirdlevel"><a href="agent-add-lines.html">Add Lines</a></li> <li class="thirdlevel"><a href="agent-end-chat.html">End Chat</a></li> <li class="thirdlevel"><a href="agent-retrieve-chat-info.html">Retrieve Chat Information</a></li> <li class="thirdlevel"><a href="">Retrieve Visitor’s Name</a></li> <li class="thirdlevel"><a href="agent-retrieve-agent-typing.html">Retrieve Agent's Typing Status</a></li> <li class="thirdlevel"><a href="agent-set-agent-typing.html">Set Agent’s Typing Status</a></li> <li class="thirdlevel"><a href="agent-retrieve-visitor-typing.html">Retrieve Visitor's Typing Status</a></li> <li class="thirdlevel"><a href="agent-chat-agent-retrieve-skills.html">Retrieve Available Skills</a></li> <li class="thirdlevel"><a href="agent-transfer-chat.html">Transfer a Chat</a></li> <li class="thirdlevel"><a href="agent-retrieve-survey-structure.html">Retrieve Agent Survey Structure</a></li> </ul> </li> <li class="subfolders"> <a href="#">Messaging Agent SDK</a> <ul> <li class="thirdlevel"><a href="messaging-agent-sdk-overview.html">Overview</a></li> </ul> </li> </ul> <li> <a href="#">Data</a> <ul> <li class="subfolders"> <a href="#">Data Access API (Beta)</a> <ul> <li class="thirdlevel"><a href="data-data-access-overview.html">Overview</a></li> <li class="thirdlevel"><a href="data-data-access-architecture.html">Architecture</a></li> <li class="thirdlevel"><a href="data-data-access-methods.html">Methods</a></li> <li class="thirdlevel"><a href="data-data-access-base-resource.html">Base Resource</a></li> <li class="thirdlevel"><a href="data-data-access-agent-activity.html">Agent Activity</a></li> <li class="thirdlevel"><a href="data-data-access-web-session.html">Web Session</a></li> <li class="thirdlevel"><a href="data-data-access-engagement.html">Engagement</a></li> <li class="thirdlevel"><a href="data-data-access-survey.html">Survey</a></li> <li class="thirdlevel"><a href="data-data-access-schema.html">Schema</a></li> <li class="thirdlevel"><a href="data-data-access-appendix.html">Appendix</a></li> </ul> </li> <li class="subfolders"> <a href="#">Messaging Operations API</a> <ul> <li class="thirdlevel"><a href="data-messaging-operations-overview.html">Overview</a></li> <li class="thirdlevel"><a href="data-messaging-operations-methods.html">Methods</a></li> <li class="thirdlevel"><a href="data-messaging-operations-messaging-conversation.html">Messaging Conversation</a></li> <li class="thirdlevel"><a href="data-messaging-operations-messaging-csat-distribution.html">Messaging CSAT Distribution</a></li> <li class="thirdlevel"><a href="data-messaging-operations-appendix.html">Appendix</a></li> </ul> </li> <li class="subfolders"> <a href="#">Messaging Interactions API (Beta)</a> <ul> <li class="thirdlevel"><a href="data-messaging-interactions-overview.html">Overview</a></li> <li class="thirdlevel"><a href="data-messaging-interactions-methods.html">Methods</a></li> <li class="thirdlevel"><a href="data-messaging-interactions-conversations.html">Conversations</a></li> <li class="thirdlevel"><a href="data-messaging-interactions-get-conversation-by-conversation-id.html">Get conversation by conversation ID</a></li> <li class="thirdlevel"><a href="data-messaging-interactions-get-conversations-by-consumer-id.html">Get Conversations by Consumer ID</a></li> <li class="thirdlevel"><a href="data-messaging-interactions-sample-code.html">Sample Code</a></li> <li class="thirdlevel"><a href="data-messaging-interactions-appendix.html">Appendix</a></li> </ul> </li> <li class="subfolders"> <a href="#">Engagement History API</a> <ul> <li class="thirdlevel"><a href="data-data-access-overview.html">Overview</a></li> <li class="thirdlevel"><a href="data-engagement-history-methods.html">Methods</a></li> <li class="thirdlevel"><a href="data-engagement-history-retrieve-engagement-list-by-criteria.html">Retrieve Engagement List by Criteria</a></li> <li class="thirdlevel"><a href="data-engagement-history-sample-code.html">Sample Code</a></li> <li class="thirdlevel"><a href="data-engagement-history-appendix.html">Appendix</a></li> </ul> </li> <li class="subfolders"> <a href="#">Operational Real-time API</a> <ul> <li class="thirdlevel"><a href="data-operational-realtime-overview.html">Overview</a></li> <li class="thirdlevel"><a href="data-operational-realtime-methods.html">Methods</a></li> <li class="thirdlevel"><a href="data-operational-realtime-queue-health.html">Queue Health</a></li> <li class="thirdlevel"><a href="data-operational-realtime-engagement-activity.html">Engagement Activity</a></li> <li class="thirdlevel"><a href="data-operational-realtime-agent-activity.html">Agent Activity</a></li> <li class="thirdlevel"><a href="data-operational-realtime-current-queue-state.html">Current Queue State</a></li> <li class="thirdlevel"><a href="data-operational-realtime-sla-histogram.html">SLA Histogram</a></li> <li class="thirdlevel"><a href="data-operational-realtime-sample-code.html">Sample Code</a></li> </ul> </li> </ul> <li> <a href="#">LiveEngage Tag</a> <ul> <li class="subfolders"> <a href="#">LE Tag Events</a> <ul> <li class="thirdlevel"><a href="lp-tag-tag-events-overview.html">Overview</a></li> <li class="thirdlevel"><a href="lp-tag-tag-events-how.html">How to use these Events</a></li> <li class="thirdlevel"><a href="lp-tag-tag-events-events.html">Events</a></li> <li class="thirdlevel"><a href="lp-tag-visitor-flow.html">Visitor Flow Events</a></li> <li class="thirdlevel"><a href="lp-tag-engagement.html">Engagement Events</a></li> <li class="thirdlevel"><a href="lp-tag-engagement-window.html">Engagement Window Events</a></li> </ul> </li> </ul> <li> <a href="#">Messaging Window API</a> <ul> <li class="subfolders"> <a href="#">Introduction</a> <ul> <li class="thirdlevel"><a href="consumer-interation-index.html">Home</a></li> <li class="thirdlevel"><a href="consumer-int-protocol-overview.html">Protocol Overview</a></li> <li class="thirdlevel"><a href="consumer-int-getting-started.html">Getting Started</a></li> </ul> </li> <li class="subfolders"> <a href="#">Tutorials</a> <ul> <li class="thirdlevel"><a href="consumer-int-get-msg.html">Get Messages</a></li> <li class="thirdlevel"><a href="consumer-int-conversation-md.html">Conversation Metadata</a></li> <li class="thirdlevel"><a href="consumer-int-readaccept-events.html">Read/Accept events</a></li> <li class="thirdlevel"><a href="consumer-int-authentication.html">Authentication</a></li> <li class="thirdlevel"><a href="consumer-int-agent-profile.html">Agent Profile</a></li> <li class="thirdlevel"><a href="consumer-int-post-survey.html">Post Conversation Survey</a></li> <li class="thirdlevel"><a href="consumer-int-client-props.html">Client Properties</a></li> <li class="thirdlevel"><a href="consumer-int-no-headers.html">Avoid Webqasocket Headers</a></li> </ul> </li> <li class="subfolders"> <a href="#">Samples</a> <ul> <li class="thirdlevel"><a href="consumer-int-js-sample.html">JavaScript Messenger</a></li> </ul> </li> <li class="subfolders"> <a href="#">API Reference</a> <ul> <li class="thirdlevel"><a href="consumer-int-api-reference.html">Overview</a></li> <li class="thirdlevel"><a href="consumer-int-msg-reqs.html">Request Builder</a></li> <li class="thirdlevel"><a href="consumer-int-msg-resps.html">Response Builder</a></li> <li class="thirdlevel"><a href="consumer-int-msg-notifications.html">Notification Builder</a></li> <li class="thirdlevel"><a href="consumer-int-msg-req-conv.html">New Conversation</a></li> <li class="thirdlevel"><a href="consumer-int-msg-close-conv.html">Close Conversation</a></li> <li class="thirdlevel"><a href="consumer-int-msg-conv-ttr.html">Urgent Conversation</a></li> <li class="thirdlevel"><a href="consumer-int-msg-csat-conv.html">Update CSAT</a></li> <li class="thirdlevel"><a href="consumer-int-msg-sub-conv.html">Subscribe Conversations Metadata</a></li> <li class="thirdlevel"><a href="consumer-int-msg-unsub-conv.html">Unsubscribe Conversations Metadata</a></li> <li class="thirdlevel"><a href="consumer-int-msg-text-cont.html">Publish Content</a></li> <li class="active thirdlevel"><a href="consumer-int-msg-sub-events.html">Subscribe Conversation Content</a></li> <li class="thirdlevel"><a href="consumer-int-msg-init-con.html">Browser Init Connection</a></li> </ul> </li> </ul> <!-- if you aren't using the accordion, uncomment this block: <p class="external"> <a href="#" id="collapseAll">Collapse All</a> | <a href="#" id="expandAll">Expand All</a> </p> --> </li> </ul> </div> <!-- this highlights the active parent class in the navgoco sidebar. this is critical so that the parent expands when you're viewing a page. This must appear below the sidebar code above. Otherwise, if placed inside customscripts.js, the script runs before the sidebar code runs and the class never gets inserted.--> <script>$("li.active").parents('li').toggleClass("active");</script> <!-- Content Column --> <div class="col-md-9"> <div class="post-header"> <h1 class="post-title-main">Subscribe to Messaging Events</h1> </div> <div class="post-content"> <!-- this handles the automatic toc. use ## for subheads to auto-generate the on-page minitoc. if you use html tags, you must supply an ID for the heading element in order for it to appear in the minitoc. --> <script> $( document ).ready(function() { // Handler for .ready() called. $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2' }); /* this offset helps account for the space taken up by the floating toolbar. */ $('#toc').on('click', 'a', function() { var target = $(this.getAttribute('href')) , scroll_target = target.offset().top $(window).scrollTop(scroll_target - 10); return false }) }); </script> <div id="toc"></div> <h2>Request </h2> <p><span class="label label-warning"> <i class="fa fa-user" aria-hidden="true"></i> <i class="fa fa-angle-double-right" aria-hidden="true"></i> <i class="fa fa-server" aria-hidden="true"></i> </span></p> <div id="req_editor"></div> <h4>JSON Output</h4> <p><button id="req_editorcopy" onclick=" document.getElementById('req_editoroutput').select(); document.execCommand('copy');">Copy to Clipboard</button> <span id="req_editorvalid_indicator"></span></p> <textarea id="req_editoroutput" style="width: 100%; height: 100px; font-family: monospace;" class="form-control"></textarea> <h4>Json Schema</h4> <p>You can find the json schema definition of this message here: <a href="assets/schema/ws/consumerRequests.json">assets/schema/ws/consumerRequests.json</a></p> <script src="assets/js/jsoneditor.js"></script> <script> var req_editor; $.getJSON( "assets/schema/ws/consumerRequests.json" , function( data ) { const fullpath = "assets/schema/ws/consumerRequests.json"; data.baseUrl = fullpath.substring(0, fullpath.lastIndexOf("/")); JSONEditor.defaults.editors.object.options.collapsed = true; req_editor = new JSONEditor(document.getElementById('req_editor'),{ ajax: true, schema: data, startval: {"type":"ms.SubscribeMessagingEvents","id":"2SA2","body":{"fromSeq":0,"dialogId":"__YOUR_CONVERSATION_ID__"}}, no_additional_properties: false, disable_edit_json: true, display_required_only: true, // form_name_root : "structure", keep_oneof_values: false, theme: 'bootstrap3', iconlib: "fontawesome4" }); req_editor.on('change',function() { if ('') { ''.split(" ").forEach(function(ro){ req_editor.getEditor(ro).disable() }); } if ('root') { 'root'.split(" ").forEach(function(ro){ req_editor.getEditor(ro).switcher.disabled = true }); } // Get an array of errors from the validator var errors = req_editor.validate(); var indicator = document.getElementById('req_editorvalid_indicator'); // Not valid if(errors.length) { indicator.style.color = 'red'; indicator.textContent = "not valid"; document.getElementById('req_editorcopy').disabled = true; document.getElementById('req_editoroutput').value = JSON.stringify(errors,null,2); } // Valid else { indicator.style.color = 'green'; indicator.textContent = "valid"; document.getElementById('req_editorcopy').disabled = false; document.getElementById('req_editoroutput').value = JSON.stringify(req_editor.getValue()); } }); }); </script> <h2>Response </h2> <p><span class="label label-success"> <i class="fa fa-user" aria-hidden="true"></i> <i class="fa fa-angle-double-left" aria-hidden="true"></i> <i class="fa fa-server" aria-hidden="true"></i> </span></p> <div id="resp_editor"></div> <h4>JSON Output</h4> <p><button id="resp_editorcopy" onclick=" document.getElementById('resp_editoroutput').select(); document.execCommand('copy');">Copy to Clipboard</button> <span id="resp_editorvalid_indicator"></span></p> <textarea id="resp_editoroutput" style="width: 100%; height: 100px; font-family: monospace;" class="form-control"></textarea> <h4>Json Schema</h4> <p>You can find the json schema definition of this message here: <a href="assets/schema/types/genericSubscribeResp.json">assets/schema/types/genericSubscribeResp.json</a></p> <script src="assets/js/jsoneditor.js"></script> <script> var resp_editor; $.getJSON( "assets/schema/types/genericSubscribeResp.json" , function( data ) { const fullpath = "assets/schema/types/genericSubscribeResp.json"; data.baseUrl = fullpath.substring(0, fullpath.lastIndexOf("/")); JSONEditor.defaults.editors.object.options.collapsed = true; resp_editor = new JSONEditor(document.getElementById('resp_editor'),{ ajax: true, schema: data, startval: { "reqId":"A3HC", "code":200 }, no_additional_properties: false, disable_edit_json: true, display_required_only: true, // form_name_root : "structure", keep_oneof_values: false, theme: 'bootstrap3', disable_properties: true, iconlib: "fontawesome4" }); resp_editor.on('change',function() { if ('root') { 'root'.split(" ").forEach(function(ro){ resp_editor.getEditor(ro).disable() }); } if ('') { ''.split(" ").forEach(function(ro){ resp_editor.getEditor(ro).switcher.disabled = true }); } // Get an array of errors from the validator var errors = resp_editor.validate(); var indicator = document.getElementById('resp_editorvalid_indicator'); // Not valid if(errors.length) { indicator.style.color = 'red'; indicator.textContent = "not valid"; document.getElementById('resp_editorcopy').disabled = true; document.getElementById('resp_editoroutput').value = JSON.stringify(errors,null,2); } // Valid else { indicator.style.color = 'green'; indicator.textContent = "valid"; document.getElementById('resp_editorcopy').disabled = false; document.getElementById('resp_editoroutput').value = JSON.stringify(resp_editor.getValue()); } }); }); </script> <h2>Notification </h2> <p><span class="label label-info"> <i class="fa fa-user" aria-hidden="true"></i> <i class="fa fa-angle-double-left" aria-hidden="true"></i> <i class="fa fa-server" aria-hidden="true"></i> </span></p> <div id="notif_editor"></div> <h4>JSON Output</h4> <p><button id="notif_editorcopy" onclick=" document.getElementById('notif_editoroutput').select(); document.execCommand('copy');">Copy to Clipboard</button> <span id="notif_editorvalid_indicator"></span></p> <textarea id="notif_editoroutput" style="width: 100%; height: 100px; font-family: monospace;" class="form-control"></textarea> <h4>Json Schema</h4> <p>You can find the json schema definition of this message here: <a href="assets/schema/ws/consumerNotifications.json">assets/schema/ws/consumerNotifications.json</a></p> <script src="assets/js/jsoneditor.js"></script> <script> var notif_editor; $.getJSON( "assets/schema/ws/consumerNotifications.json" , function( data ) { const fullpath = "assets/schema/ws/consumerNotifications.json"; data.baseUrl = fullpath.substring(0, fullpath.lastIndexOf("/")); JSONEditor.defaults.editors.object.options.collapsed = true; notif_editor = new JSONEditor(document.getElementById('notif_editor'),{ ajax: true, schema: data, startval: {"type":"ms.MessagingEventNotification","kind":"notification","body":{"changes":[{"sequence":0,"originatorId":"734d9867-40e3-52b9-a401-07e877676d64","serverTimestamp":1477840831162,"event":{"type":"ContentEvent","message":"message from the agent","contentType":"text/plain"},"dialogId":"__YOUR_CONVERSATION_ID__"}]}}, no_additional_properties: false, disable_edit_json: true, display_required_only: true, // form_name_root : "structure", keep_oneof_values: false, theme: 'bootstrap3', disable_properties: true, iconlib: "fontawesome4" }); notif_editor.on('change',function() { if ('') { ''.split(" ").forEach(function(ro){ notif_editor.getEditor(ro).disable() }); } if ('root') { 'root'.split(" ").forEach(function(ro){ notif_editor.getEditor(ro).switcher.disabled = true }); } // Get an array of errors from the validator var errors = notif_editor.validate(); var indicator = document.getElementById('notif_editorvalid_indicator'); // Not valid if(errors.length) { indicator.style.color = 'red'; indicator.textContent = "not valid"; document.getElementById('notif_editorcopy').disabled = true; document.getElementById('notif_editoroutput').value = JSON.stringify(errors,null,2); } // Valid else { indicator.style.color = 'green'; indicator.textContent = "valid"; document.getElementById('notif_editorcopy').disabled = false; document.getElementById('notif_editoroutput').value = JSON.stringify(notif_editor.getValue()); } }); }); </script> <div class="tags"> </div> </div> <hr class="shaded"/> <footer> <div class="row"> <div class="col-lg-12 footer"> &copy;2017 LivePerson. All rights reserved.<br />This documentation is subject to change without notice.<br /> Site last generated: Mar 9, 2017 <br /> <p><img src="img/company_logo.png" alt="Company logo"/></p> </div> </div> </footer> </div> <!-- /.row --> </div> <!-- /.container --> </div> </body> </html>
LivePersonInc/dev-hub
content7/consumer-int-msg-sub-events.html
HTML
mit
175,167
<?php namespace Sellsy\Tests\Sellsy\Criteria; use Sellsy\Criteria\CriteriaInterface; use Sellsy\Criteria\EmptyCriteria; /** * Class EmptyCriteriaTest * * @package Sellsy\Tests\Sellsy\Criteria */ class EmptyCriteriaTest extends \PHPUnit_Framework_TestCase { /** * @return EmptyCriteria */ public function testImplementCriteriaInterface() { $criteria = new EmptyCriteria(); $this->assertInstanceOf(CriteriaInterface::class, $criteria); return $criteria; } /** * @param EmptyCriteria $criteria * @return EmptyCriteria * * @depends testImplementCriteriaInterface * @covers Sellsy\Criteria\EmptyCriteria::getParameters */ public function testGetParametersIsArray(EmptyCriteria $criteria) { $this->assertInternalType('array', $criteria->getParameters()); return $criteria; } /** * @param EmptyCriteria $criteria * @return void * * @depends testGetParametersIsArray * @covers Sellsy\Criteria\EmptyCriteria::getParameters */ public function testGetParametersIsEmpty(EmptyCriteria $criteria) { $this->assertEquals(0, count($criteria->getParameters())); } }
mehdi-ghezal/sellsy-api
tests/Sellsy/Criteria/EmptyCriteriaTest.php
PHP
mit
1,225
/** * Created by Administrator on 2017/3/11. */ public class ReverseWordsInSequence { public void reverseSequence(String str) { if (str == null) return; String[] strArray = str.split(" "); StringBuilder sb = new StringBuilder(); for (int i = strArray.length-1; i >= 0; --i) sb.append(strArray[i] + " "); System.out.println(sb); } public static void main(String[] args) { ReverseWordsInSequence r = new ReverseWordsInSequence(); String str = "I am a Students."; r.reverseSequence(str); } } /** * Created by Administrator on 2017/3/11. */ public class ReverseWordsInSequence { public String reverseSequence(String str) { if (str == null || str.length() <= 1) return str; StringBuilder sb = new StringBuilder(str); reverse(sb, 0, str.length() - 1); int begin = 0, end = 0; while (end < str.length()) { while (end < str.length() && sb.charAt(end) != ' ') end++; reverse(sb, begin, end - 1); begin = end + 1; end = begin; } return sb.toString(); } public void reverse(StringBuilder sb, int start, int end) { if (sb == null || end <= start) return; while (start < end) { char temp = sb.charAt(start); sb.setCharAt(start, sb.charAt(end)); sb.setCharAt(end, temp); start++; end--; } } public static void main(String[] args) { ReverseWordsInSequence r = new ReverseWordsInSequence(); String str = "i am a students."; System.out.print(r.reverseSequence(str)); } }
RudyZH/Aim2Offer
042_ReverseWordsInSequence.java
Java
mit
1,796
<?php class Autoreportemail_model extends CI_Model { public function __construct() { parent::__construct(); } public function get_milist($where = array()) { $this->db->select('*'); $this->db->where($where); $query = $this->db->get('autoreport_email'); return $query->result_array(); } public function add_milist($data = array()) { $empty = $this->get_milist(array('email' => $data['email'], 'client' => $data['client'])); if(empty($empty)){ $data['user_c'] = $this->session->userdata('logged_in_data')['id']; $this->db->insert('autoreport_email',$data); if( $this->db->affected_rows() > 0) { return $this->db->insert_id(); } }else{ return false; } } public function edit_milist($data = array()) { $empty = $this->get_milist(array('email' => $data['email'], 'id !=' => $data['id'], 'client' => $data['client'])); if(empty($empty)){ $id = $data['id']; unset($data['id']); $this->db->where('id', $id); $this->db->update('autoreport_email', $data); return $this->db->affected_rows(); }else{ return false; } } public function update_milist($id,$data = array()) { $nempty = $this->get_milist(array('id' => $id)); if(!empty($nempty)){ $this->db->where('id', $id); $this->db->update('autoreport_email', $data); return TRUE; }else{ return false; } } public function remove_milist($id) { $data['status'] = 'inactive'; $this->db->where('id',$id); $this->db->update('phases',$data); if( $this->db->affected_rows() > 0) { return $this->db->affected_rows(); } return ; } public function reactivate_milist($id) { $data['status'] = 'active'; $this->db->where('id',$id); $this->db->update('phases',$data); if( $this->db->affected_rows() > 0) { return $this->db->affected_rows(); } return ; } }
garpepi/Mini-HRM
application/models/Autoreportemail_model.php
PHP
mit
2,189
--- layout: page title: Incoming webhooks permalink: /incoming_webhook order: 4 headings: - title: Posting a message with Incoming Webhooks --- ## Posting a message with Incoming Webhooks [Incoming webhooks](https://api.slack.com/incoming-webhooks) are an easy way to send notifications to a Slack channel with a minimum of setup. You'll need a webhook URL from a Slack app or a custom integration to use the `IncomingWebhook` class. ```javascript const { IncomingWebhook } = require('@slack/client'); const url = process.env.SLACK_WEBHOOK_URL; const webhook = new IncomingWebhook(url); // Send simple text to the webhook channel webhook.send('Hello there', function(err, res) { if (err) { console.log('Error:', err); } else { console.log('Message sent: ', res); } }); ```
brianv0/sqrbot
node_modules/@slack/client/docs/_pages/incoming_webhook.md
Markdown
mit
809
/* Configures webpack to build only assets required for integration environments. */ const webpack = require('webpack'); const merge = require('webpack-merge'); const { source, sourceAll } = require('../lib/path-helpers'); const ciBuildWorkflow = require('./workflow/build.ci'); const { entries } = require(source('fc-config')); // eslint-disable-line // remove the styleguide dll references const modify = (config) => { config.plugins = config.plugins.slice(1); return config; }; module.exports = modify(merge(ciBuildWorkflow, { entry: sourceAll(entries.ci), plugins: [ new webpack.DefinePlugin({ 'process.env.CI_MODE': true }) ] }));
connectivedx/fuzzy-chainsaw
build/webpack/webpack.config.build.ci.js
JavaScript
mit
671
/** * A null-safe function to repeat the source string the desired amount of times. * @private * @param {String} source * @param {Number} times * @returns {String} */ function _repeat (source, times) { var result = ""; for (var i = 0; i < times; i++) { result += source; } return result; } export default _repeat;
ascartabelli/lamb
src/privates/_repeat.js
JavaScript
mit
347
<!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>CTEArmorRicochet | demofile</title> <meta name="description" content="Documentation for demofile"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../assets/css/main.css"> </head> <body> <header> <div class="tsd-page-toolbar"> <div class="container"> <div class="table-wrap"> <div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base=".."> <div class="field"> <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label> <input id="tsd-search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> <a href="../index.html" class="title">demofile</a> </div> <div class="table-cell" id="tsd-widgets"> <div id="tsd-filter"> <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a> <div class="tsd-filter-group"> <div class="tsd-select" id="tsd-filter-visibility"> <span class="tsd-select-label">All</span> <ul class="tsd-select-list"> <li data-value="public">Public</li> <li data-value="protected">Public/Protected</li> <li data-value="private" class="selected">All</li> </ul> </div> <input type="checkbox" id="tsd-filter-inherited" checked /> <label class="tsd-widget" for="tsd-filter-inherited">Inherited</label> <input type="checkbox" id="tsd-filter-externals" checked /> <label class="tsd-widget" for="tsd-filter-externals">Externals</label> <input type="checkbox" id="tsd-filter-only-exported" /> <label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label> </div> </div> <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a> </div> </div> </div> </div> <div class="tsd-page-title"> <div class="container"> <ul class="tsd-breadcrumb"> <li> <a href="../globals.html">Globals</a> </li> <li> <a href="../modules/_sendtabletypes_.html">&quot;sendtabletypes&quot;</a> </li> <li> <a href="_sendtabletypes_.ctearmorricochet.html">CTEArmorRicochet</a> </li> </ul> <h1>Interface CTEArmorRicochet</h1> </div> </div> </header> <div class="container container-main"> <div class="row"> <div class="col-8 col-content"> <section class="tsd-panel tsd-hierarchy"> <h3>Hierarchy</h3> <ul class="tsd-hierarchy"> <li> <span class="target">CTEArmorRicochet</span> </li> </ul> </section> <section class="tsd-panel-group tsd-index-group"> <h2>Index</h2> <section class="tsd-panel tsd-index-panel"> <div class="tsd-index-content"> <section class="tsd-index-section "> <h3>Properties</h3> <ul class="tsd-index-list"> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_sendtabletypes_.ctearmorricochet.html#dt_temetalsparks" class="tsd-kind-icon">DT_<wbr>TEMetal<wbr>Sparks</a></li> </ul> </section> </div> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Properties</h2> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="dt_temetalsparks" class="tsd-anchor"></a> <h3>DT_<wbr>TEMetal<wbr>Sparks</h3> <div class="tsd-signature tsd-kind-icon">DT_<wbr>TEMetal<wbr>Sparks<span class="tsd-signature-symbol">:</span> <a href="_sendtabletypes_.dt_temetalsparks.html" class="tsd-signature-type">DT_TEMetalSparks</a></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/saul/demofile/blob/b4d2298/src/sendtabletypes.ts#L13833">src/sendtabletypes.ts:13833</a></li> </ul> </aside> </section> </section> </div> <div class="col-4 col-menu menu-sticky-wrap menu-highlight"> <nav class="tsd-navigation primary"> <ul> <li class="globals "> <a href="../globals.html"><em>Globals</em></a> </li> <li class="current tsd-kind-module"> <a href="../modules/_sendtabletypes_.html">&quot;sendtabletypes&quot;</a> </li> </ul> </nav> <nav class="tsd-navigation secondary menu-sticky"> <ul class="before-current"> </ul> <ul class="current"> <li class="current tsd-kind-interface tsd-parent-kind-module"> <a href="_sendtabletypes_.ctearmorricochet.html" class="tsd-kind-icon">CTEArmor<wbr>Ricochet</a> <ul> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_sendtabletypes_.ctearmorricochet.html#dt_temetalsparks" class="tsd-kind-icon">DT_<wbr>TEMetal<wbr>Sparks</a> </li> </ul> </li> </ul> <ul class="after-current"> </ul> </nav> </div> </div> </div> <footer class="with-border-bottom"> <div class="container"> <h2>Legend</h2> <div class="tsd-legend-group"> <ul class="tsd-legend"> <li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li> <li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li> <li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li> <li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li> <li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li> <li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li> <li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li> <li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li> <li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li> </ul> </div> </div> </footer> <div class="container tsd-generator"> <p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p> </div> <div class="overlay"></div> <script src="../assets/js/main.js"></script> </body> </html>
saul/demofile
docs/interfaces/_sendtabletypes_.ctearmorricochet.html
HTML
mit
6,739
(function(d,a){function b(a,b){var g=a.nodeName.toLowerCase();if("area"===g){var g=a.parentNode,i=g.name;if(!a.href||!i||g.nodeName.toLowerCase()!=="map")return!1;g=d("img[usemap=#"+i+"]")[0];return!!g&&e(g)}return(/input|select|textarea|button|object/.test(g)?!a.disabled:"a"==g?a.href||b:b)&&e(a)}function e(a){return!d(a).parents().andSelf().filter(function(){return d.curCSS(this,"visibility")==="hidden"||d.expr.filters.hidden(this)}).length}d.ui=d.ui||{};d.ui.version||(d.extend(d.ui,{version:"1.8.16", 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}}),d.fn.extend({propAttr:d.fn.prop||d.fn.attr,_focus:d.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var e= this;setTimeout(function(){d(e).focus();b&&b.call(e)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=d.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(d.curCSS(this,"position",1))&&/(auto|scroll)/.test(d.curCSS(this,"overflow",1)+d.curCSS(this,"overflow-y",1)+d.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(d.curCSS(this, "overflow",1)+d.curCSS(this,"overflow-y",1)+d.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?d(document):a},zIndex:function(b){if(b!==a)return this.css("zIndex",b);if(this.length)for(var b=d(this[0]),e;b.length&&b[0]!==document;){e=b.css("position");if(e==="absolute"||e==="relative"||e==="fixed")if(e=parseInt(b.css("zIndex"),10),!isNaN(e)&&e!==0)return e;b=b.parent()}return 0},disableSelection:function(){return this.bind((d.support.selectstart?"selectstart": "mousedown")+".ui-disableSelection",function(d){d.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),d.each(["Width","Height"],function(b,e){function g(a,b,e,h){d.each(i,function(){b-=parseFloat(d.curCSS(a,"padding"+this,!0))||0;e&&(b-=parseFloat(d.curCSS(a,"border"+this+"Width",!0))||0);h&&(b-=parseFloat(d.curCSS(a,"margin"+this,!0))||0)});return b}var i=e==="Width"?["Left","Right"]:["Top","Bottom"],j=e.toLowerCase(),k={innerWidth:d.fn.innerWidth,innerHeight:d.fn.innerHeight, outerWidth:d.fn.outerWidth,outerHeight:d.fn.outerHeight};d.fn["inner"+e]=function(i){return i===a?k["inner"+e].call(this):this.each(function(){d(this).css(j,g(this,i)+"px")})};d.fn["outer"+e]=function(a,i){return typeof a!=="number"?k["outer"+e].call(this,a):this.each(function(){d(this).css(j,g(this,a,!0,i)+"px")})}}),d.extend(d.expr[":"],{data:function(a,b,e){return!!d.data(a,e[3])},focusable:function(a){return b(a,!isNaN(d.attr(a,"tabindex")))},tabbable:function(a){var e=d.attr(a,"tabindex"),g= isNaN(e);return(g||e>=0)&&b(a,!g)}}),d(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));d.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});d.support.minHeight=b.offsetHeight===100;d.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"}),d.extend(d.ui,{plugin:{add:function(a,b,e){var a=d.ui[a].prototype,i;for(i in e)a.plugins[i]=a.plugins[i]||[],a.plugins[i].push([b,e[i]])},call:function(d,a,b){if((a=d.plugins[a])&&d.element[0].parentNode)for(var i= 0;i<a.length;i++)d.options[a[i][0]]&&a[i][1].apply(d.element,b)}},contains:function(d,a){return document.compareDocumentPosition?d.compareDocumentPosition(a)&16:d!==a&&d.contains(a)},hasScroll:function(a,b){if(d(a).css("overflow")==="hidden")return!1;var e=b&&b==="left"?"scrollLeft":"scrollTop",i=!1;if(a[e]>0)return!0;a[e]=1;i=a[e]>0;a[e]=0;return i},isOverAxis:function(d,a,b){return d>a&&d<a+b},isOver:function(a,b,e,i,j,k){return d.ui.isOverAxis(a,e,j)&&d.ui.isOverAxis(b,i,k)}}))})(jQuery); (function(d,a){if(d.cleanData){var b=d.cleanData;d.cleanData=function(a){for(var e=0,g;(g=a[e])!=null;e++)try{d(g).triggerHandler("remove")}catch(i){}b(a)}}else{var e=d.fn.remove;d.fn.remove=function(a,b){return this.each(function(){b||(!a||d.filter(a,[this]).length)&&d("*",this).add([this]).each(function(){try{d(this).triggerHandler("remove")}catch(a){}});return e.call(d(this),a,b)})}}d.widget=function(a,b,e){var i=a.split(".")[0],j,a=a.split(".")[1];j=i+"-"+a;if(!e)e=b,b=d.Widget;d.expr[":"][j]= function(b){return!!d.data(b,a)};d[i]=d[i]||{};d[i][a]=function(d,a){arguments.length&&this._createWidget(d,a)};b=new b;b.options=d.extend(!0,{},b.options);d[i][a].prototype=d.extend(!0,b,{namespace:i,widgetName:a,widgetEventPrefix:d[i][a].prototype.widgetEventPrefix||a,widgetBaseClass:j},e);d.widget.bridge(a,d[i][a])};d.widget.bridge=function(b,e){d.fn[b]=function(g){var i=typeof g==="string",j=Array.prototype.slice.call(arguments,1),k=this,g=!i&&j.length?d.extend.apply(null,[!0,g].concat(j)):g; if(i&&g.charAt(0)==="_")return k;i?this.each(function(){var i=d.data(this,b),e=i&&d.isFunction(i[g])?i[g].apply(i,j):i;if(e!==i&&e!==a)return k=e,!1}):this.each(function(){var a=d.data(this,b);a?a.option(g||{})._init():d.data(this,b,new e(g,this))});return k}};d.Widget=function(d,a){arguments.length&&this._createWidget(d,a)};d.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(a,b){d.data(b,this.widgetName,this);this.element=d(b);this.options=d.extend(!0, {},this.options,this._getCreateOptions(),a);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return d.metadata&&d.metadata.get(this.element[0])[this.widgetName]},_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(b,e){var g=b;if(arguments.length===0)return d.extend({},this.options);if(typeof b==="string"){if(e===a)return this.options[b];g={};g[b]=e}this._setOptions(g);return this},_setOptions:function(a){var b=this;d.each(a,function(d,a){b._setOption(d,a)});return this},_setOption:function(d,a){this.options[d]=a;d==="disabled"&&this.widget()[a?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled", a);return this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(a,b,e){var i=this.options[a],b=d.Event(b);b.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();e=e||{};if(b.originalEvent)for(var a=d.event.props.length,j;a;)j=d.event.props[--a],b[j]=b.originalEvent[j];this.element.trigger(b,e);return!(d.isFunction(i)&&i.call(this.element[0],b,e)===!1||b.isDefaultPrevented())}}})(jQuery); (function(d){var a=!1;d(document).mouseup(function(){a=!1});d.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(d){return a._mouseDown(d)}).bind("click."+this.widgetName,function(e){if(!0===d.data(e.target,a.widgetName+".preventClickEvent"))return d.removeData(e.target,a.widgetName+".preventClickEvent"),e.stopImmediatePropagation(),!1});this.started=!1},_mouseDestroy:function(){this.element.unbind("."+ this.widgetName)},_mouseDown:function(b){if(!a){this._mouseStarted&&this._mouseUp(b);this._mouseDownEvent=b;var e=this,f=b.which==1,h=typeof this.options.cancel=="string"&&b.target.nodeName?d(b.target).closest(this.options.cancel).length:!1;if(!f||h||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=!0},this.options.delay);if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted= this._mouseStart(b)!==!1,!this._mouseStarted))return b.preventDefault(),!0;!0===d.data(b.target,this.widgetName+".preventClickEvent")&&d.removeData(b.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(d){return e._mouseMove(d)};this._mouseUpDelegate=function(d){return e._mouseUp(d)};d(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);b.preventDefault();return a=!0}},_mouseMove:function(a){if(d.browser.msie&& !(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted)return this._mouseDrag(a),a.preventDefault();if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==!1)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){d(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted)this._mouseStarted= !1,a.target==this._mouseDownEvent.target&&d.data(a.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(a);return!1},_mouseDistanceMet:function(d){return Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery); (function(d){d.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:!0,clearStyle:!1,collapsible:!1,event:"click",fillSpace:!1,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,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||d(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||d(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||d(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||d(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 e=a.element.find("a").filter(b.navigationFilter).eq(0);if(e.length){var f=e.closest(".ui-accordion-header");a.active=f.length?f:e.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("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(d){return a._keydown(d)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);d.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(d){a._clickHandler.call(a,d,this);d.preventDefault()})},_createIcons:function(){var a= this.options;a.icons&&(d("<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("aria-selected").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");(a.autoHeight||a.fillHeight)&&b.css("height","");return d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);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=d.ui.keyCode,e=this.headers.length,f=this.headers.index(a.target),h=!1;switch(a.keyCode){case b.RIGHT:case b.DOWN:h=this.headers[(f+1)%e];break;case b.LEFT:case b.UP:h=this.headers[(f-1+e)%e];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target),a.preventDefault()}return h? (d(a.target).attr("tabIndex",-1),d(h).attr("tabIndex",0),h.focus(),!1):!0}},resize:function(){var a=this.options,b;if(a.fillSpace){if(d.browser.msie){var e=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();d.browser.msie&&this.element.parent().css("overflow",e);this.headers.each(function(){b-=d(this).outerHeight(!0)});this.headers.next().each(function(){d(this).height(Math.max(0,b-d(this).innerHeight()+d(this).height()))}).css("overflow", "auto")}else a.autoHeight&&(b=0,this.headers.next().each(function(){b=Math.max(b,d(this).height("").height())}).height(b));return this},activate:function(d){this.options.active=d;d=this._findActive(d)[0];this._clickHandler({target:d},d);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===!1?d([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var e=this.options;if(!e.disabled)if(a.target){var f=d(a.currentTarget|| b),h=f[0]===this.active[0];e.active=e.collapsible&&h?!1:this.headers.index(f);if(!(this.running||!e.collapsible&&h)){var g=this.active,i=f.next(),j=this.active.next(),k={options:e,newHeader:h&&e.collapsible?d([]):f,oldHeader:this.active,newContent:h&&e.collapsible?d([]):i,oldContent:j},l=this.headers.index(this.active[0])>this.headers.index(f[0]);this.active=h?d([]):f;this._toggle(i,j,k,h,l);g.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(e.icons.headerSelected).addClass(e.icons.header); h||(f.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(e.icons.header).addClass(e.icons.headerSelected),f.next().addClass("ui-accordion-content-active"))}}else if(e.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(e.icons.headerSelected).addClass(e.icons.header);this.active.next().addClass("ui-accordion-content-active");var j=this.active.next(), k={options:e,newHeader:d([]),oldHeader:e.active,newContent:d([]),oldContent:j},i=this.active=d([]);this._toggle(i,j,k)}},_toggle:function(a,b,e,f,h){var g=this,i=g.options;g.toShow=a;g.toHide=b;g.data=e;var j=function(){return!g?void 0:g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(i.animated){e={};e=i.collapsible&&f?{toShow:d([]),toHide:b,complete:j,down:h,autoHeight:i.autoHeight||i.fillSpace}:{toShow:a,toHide:b,complete:j,down:h, autoHeight:i.autoHeight||i.fillSpace};if(!i.proxied)i.proxied=i.animated;if(!i.proxiedDuration)i.proxiedDuration=i.duration;i.animated=d.isFunction(i.proxied)?i.proxied(e):i.proxied;i.duration=d.isFunction(i.proxiedDuration)?i.proxiedDuration(e):i.proxiedDuration;var f=d.ui.accordion.animations,k=i.duration,l=i.animated;l&&!f[l]&&!d.easing[l]&&(l="slide");f[l]||(f[l]=function(d){this.slide(d,{easing:l,duration:k||700})});f[l](e)}else i.collapsible&&f?a.toggle():(b.hide(),a.show()),j(!0);b.prev().attr({"aria-expanded":"false", "aria-selected":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(d){this.running=d?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});d.extend(d.ui.accordion,{version:"1.8.16", animations:{slide:function(a,b){a=d.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var e=a.toShow.css("overflow"),f=0,h={},g={},i,j=a.toShow;i=j[0].style.width;j.width(parseInt(j.parent().width(),10)-parseInt(j.css("paddingLeft"),10)-parseInt(j.css("paddingRight"),10)-(parseInt(j.css("borderLeftWidth"),10)||0)-(parseInt(j.css("borderRightWidth"),10)||0));d.each(["height","paddingTop","paddingBottom"],function(b,i){g[i]="hide";var e=(""+d.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/); h[i]={value:e[1],unit:e[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(g,{step:function(d,b){b.prop=="height"&&(f=b.end-b.start===0?0:(b.now-b.start)/(b.end-b.start));a.toShow[0].style[b.prop]=f*h[b.prop].value+h[b.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:i,overflow:e});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(d){this.slide(d,{easing:d.down?"easeOutBounce":"swing",duration:d.down?1E3:200})}}})})(jQuery); (function(d){var a=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,e=this.element[0].ownerDocument,f;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(e){if(!a.options.disabled&&!a.element.propAttr("readOnly")){f= !1;var g=d.ui.keyCode;switch(e.keyCode){case g.PAGE_UP:a._move("previousPage",e);break;case g.PAGE_DOWN:a._move("nextPage",e);break;case g.UP:a._move("previous",e);e.preventDefault();break;case g.DOWN:a._move("next",e);e.preventDefault();break;case g.ENTER:case g.NUMPAD_ENTER:a.menu.active&&(f=!0,e.preventDefault());case g.TAB:if(!a.menu.active)break;a.menu.select(e);break;case g.ESCAPE:a.element.val(a.term);a.close(e);break;default:clearTimeout(a.searching),a.searching=setTimeout(function(){if(a.term!= a.element.val())a.selectedItem=null,a.search(null,e)},a.options.delay)}}}).bind("keypress.autocomplete",function(d){f&&(f=!1,d.preventDefault())}).bind("focus.autocomplete",function(){if(!a.options.disabled)a.selectedItem=null,a.previous=a.element.val()}).bind("blur.autocomplete",function(d){if(!a.options.disabled)clearTimeout(a.searching),a.closing=setTimeout(function(){a.close(d);a._change(d)},150)});this._initSource();this.response=function(){return a._response.apply(a,arguments)};this.menu=d("<ul></ul>").addClass("ui-autocomplete").appendTo(d(this.options.appendTo|| "body",e)[0]).mousedown(function(e){var f=a.menu.element[0];d(e.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(i){i.target!==a.element[0]&&i.target!==f&&!d.ui.contains(f,i.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(d,e){var i=e.item.data("item.autocomplete");!1!==a._trigger("focus",d,{item:i})&&/^key/.test(d.originalEvent.type)&&a.element.val(i.value)},selected:function(d,f){var i=f.item.data("item.autocomplete"), j=a.previous;if(a.element[0]!==e.activeElement)a.element.focus(),a.previous=j,setTimeout(function(){a.previous=j;a.selectedItem=i},1);!1!==a._trigger("select",d,{item:i})&&a.element.val(i.value);a.term=a.element.val();a.close(d);a.selectedItem=i},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");d.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();d.Widget.prototype.destroy.call(this)},_setOption:function(a,e){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();a==="appendTo"&&this.menu.element.appendTo(d(e||"body",this.element[0].ownerDocument)[0]);a==="disabled"&&e&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,e,f;d.isArray(this.options.source)?(e=this.options.source,this.source=function(a,b){b(d.ui.autocomplete.filter(e,a.term))}):typeof this.options.source==="string"? (f=this.options.source,this.source=function(e,g){b.xhr&&b.xhr.abort();b.xhr=d.ajax({url:f,data:e,dataType:"json",autocompleteRequest:++a,success:function(d){this.autocompleteRequest===a&&g(d)},error:function(){this.autocompleteRequest===a&&g([])}})}):this.source=this.options.source},search:function(d,a){d=d!=null?d:this.element.val();this.term=this.element.val();if(d.length<this.options.minLength)return this.close(a);clearTimeout(this.closing);return this._trigger("search",a)===!1?void 0:this._search(d)}, _search:function(d){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:d},this.response)},_response:function(d){!this.options.disabled&&d&&d.length?(d=this._normalize(d),this._suggest(d),this._trigger("open")):this.close();this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(d){clearTimeout(this.closing);this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",d))},_change:function(d){this.previous!== this.element.val()&&this._trigger("change",d,{item:this.selectedItem})},_normalize:function(a){return a.length&&a[0].label&&a[0].value?a:d.map(a,function(a){return typeof a==="string"?{label:a,value:a}:d.extend({label:a.label||a.value,value:a.value||a.label},a)})},_suggest:function(a){var e=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(e,a);this.menu.deactivate();this.menu.refresh();e.show();this._resizeMenu();e.position(d.extend({of:this.element},this.options.position)); this.options.autoFocus&&this.menu.next(new d.Event("mouseover"))},_resizeMenu:function(){var d=this.menu.element;d.outerWidth(Math.max(d.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(a,e){var f=this;d.each(e,function(d,e){f._renderItem(a,e)})},_renderItem:function(a,e){return d("<li></li>").data("item.autocomplete",e).append(d("<a></a>").text(e.label)).appendTo(a)},_move:function(d,a){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(d)||this.menu.last()&& /^next/.test(d))this.element.val(this.term),this.menu.deactivate();else this.menu[d](a);else this.search(null,a)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(d){return d.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(a,e){var f=RegExp(d.ui.autocomplete.escapeRegex(e),"i");return d.grep(a,function(d){return f.test(d.label||d.value||d)})}})})(jQuery); (function(d){d.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){d(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,d(this).parent())}).mouseleave(function(){a.deactivate()})},activate:function(d,b){this.deactivate();if(this.hasScroll()){var e=b.offset().top-this.element.offset().top,f=this.element.scrollTop(),h=this.element.height();e<0?this.element.scrollTop(f+e):e>=h&&this.element.scrollTop(f+e-h+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",d,{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(d){this.move("next",".ui-menu-item:first",d)},previous:function(d){this.move("prev",".ui-menu-item:last",d)},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(d,b,e){this.active?(d=this.active[d+"All"](".ui-menu-item").eq(0),d.length?this.activate(e,d):this.activate(e,this.element.children(b))):this.activate(e,this.element.children(b))}, nextPage:function(a){if(this.hasScroll())if(!this.active||this.last())this.activate(a,this.element.children(".ui-menu-item:first"));else{var b=this.active.offset().top,e=this.element.height(),f=this.element.children(".ui-menu-item").filter(function(){var a=d(this).offset().top-b-e+d(this).height();return a<10&&a>-10});f.length||(f=this.element.children(".ui-menu-item:last"));this.activate(a,f)}else this.activate(a,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))}, previousPage:function(a){if(this.hasScroll())if(!this.active||this.first())this.activate(a,this.element.children(".ui-menu-item:last"));else{var b=this.active.offset().top,e=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var a=d(this).offset().top-b+e-d(this).height();return a<10&&a>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(a,result)}else this.activate(a,this.element.children(".ui-menu-item").filter(!this.active|| this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[d.fn.prop?"prop":"attr"]("scrollHeight")},select:function(d){this._trigger("selected",d,{item:this.active})}})})(jQuery); (function(d){var a,b,e,f,h=function(){var a=d(this).find(":ui-button");setTimeout(function(){a.button("refresh")},1)},g=function(a){var b=a.name,e=a.form,f=d([]);b&&(f=e?d(e).find("[name='"+b+"']"):d("[name='"+b+"']",a.ownerDocument).filter(function(){return!this.form}));return f};d.widget("ui.button",{options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",h);if(typeof this.options.disabled!== "boolean")this.options.disabled=this.element.propAttr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var i=this,j=this.options,k=this.type==="checkbox"||this.type==="radio",l="ui-state-hover"+(!k?" ui-state-active":"");if(j.label===null)j.label=this.buttonElement.html();if(this.element.is(":disabled"))j.disabled=!0;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){j.disabled|| (d(this).addClass("ui-state-hover"),this===a&&d(this).addClass("ui-state-active"))}).bind("mouseleave.button",function(){j.disabled||d(this).removeClass(l)}).bind("click.button",function(d){j.disabled&&(d.preventDefault(),d.stopImmediatePropagation())});this.element.bind("focus.button",function(){i.buttonElement.addClass("ui-state-focus")}).bind("blur.button",function(){i.buttonElement.removeClass("ui-state-focus")});k&&(this.element.bind("change.button",function(){f||i.refresh()}),this.buttonElement.bind("mousedown.button", function(d){if(!j.disabled)f=!1,b=d.pageX,e=d.pageY}).bind("mouseup.button",function(d){if(!j.disabled&&(b!==d.pageX||e!==d.pageY))f=!0}));this.type==="checkbox"?this.buttonElement.bind("click.button",function(){if(j.disabled||f)return!1;d(this).toggleClass("ui-state-active");i.buttonElement.attr("aria-pressed",i.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click.button",function(){if(j.disabled||f)return!1;d(this).addClass("ui-state-active");i.buttonElement.attr("aria-pressed", "true");var a=i.element[0];g(a).not(a).map(function(){return d(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown.button",function(){if(j.disabled)return!1;d(this).addClass("ui-state-active");a=this;d(document).one("mouseup",function(){a=null})}).bind("mouseup.button",function(){if(j.disabled)return!1;d(this).removeClass("ui-state-active")}).bind("keydown.button",function(a){if(j.disabled)return!1;(a.keyCode==d.ui.keyCode.SPACE|| a.keyCode==d.ui.keyCode.ENTER)&&d(this).addClass("ui-state-active")}).bind("keyup.button",function(){d(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(a){a.keyCode===d.ui.keyCode.SPACE&&d(this).click()}));this._setOption("disabled",j.disabled);this._resetButton()},_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"){var d=this.element.parents().filter(":last"),a="label[for='"+this.element.attr("id")+"']";this.buttonElement=d.find(a);if(!this.buttonElement.length&&(d=d.length?d.siblings():this.element.siblings(),this.buttonElement=d.filter(a),!this.buttonElement.length))this.buttonElement=d.find(a);this.element.addClass("ui-helper-hidden-accessible");(d=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",d)}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");d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="disabled"?b?this.element.propAttr("disabled",!0):this.element.propAttr("disabled",!1):this._resetButton()},refresh:function(){var a=this.element.is(":disabled");a!==this.options.disabled&&this._setOption("disabled",a);this.type==="radio"?g(this.element[0]).each(function(){d(this).is(":checked")?d(this).button("widget").addClass("ui-state-active").attr("aria-pressed", "true"):d(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):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 a=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"), b=d("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(),e=this.options.icons,f=e.primary&&e.secondary,h=[];e.primary||e.secondary?(this.options.text&&h.push("ui-button-text-icon"+(f?"s":e.primary?"-primary":"-secondary")),e.primary&&a.prepend("<span class='ui-button-icon-primary ui-icon "+e.primary+"'></span>"),e.secondary&&a.append("<span class='ui-button-icon-secondary ui-icon "+e.secondary+"'></span>"),this.options.text||(h.push(f?"ui-button-icons-only": "ui-button-icon-only"),this.hasTitle||a.attr("title",b))):h.push("ui-button-text-only");a.addClass(h.join(" "))}}});d.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(a,b){a==="disabled"&&this.buttons.button("option",a,b);d.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var a=this.element.css("direction")==="ltr"; this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return d(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(a?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(a?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return d(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"); d.Widget.prototype.destroy.call(this)}})})(jQuery); (function(d,a){function b(){this.debug=!1;this._curInst=null;this._keyEvent=!1;this._disabledInputs=[];this._inDialog=this._datepickerShowing=!1;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:!1,showMonthAfterYear:!1,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,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:!0,showButtonPanel:!1,autoSize:!1,disabled:!1};d.extend(this._defaults,this.regional[""]);this.dpDiv=e(d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function e(a){return a.bind("mouseout",function(a){a= d(a.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");a.length&&a.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!d.datepicker._isDisabledDatepicker(g.inline?a.parent()[0]:g.input[0])&&b.length)b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),b.addClass("ui-state-hover"), b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover"),b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")})}function f(i,b){d.extend(i,b);for(var e in b)if(b[e]==null||b[e]==a)i[e]=b[e];return i}d.extend(d.ui,{datepicker:{version:"1.8.16"}});var h=(new Date).getTime(),g;d.extend(b.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(d){f(this._defaults, d||{});return this},_attachDatepicker:function(a,b){var e=null,f;for(f in this._defaults){var h=a.getAttribute("date:"+f);if(h){e=e||{};try{e[f]=eval(h)}catch(g){e[f]=h}}}f=a.nodeName.toLowerCase();h=f=="div"||f=="span";if(!a.id)this.uuid+=1,a.id="dp"+this.uuid;var p=this._newInst(d(a),h);p.settings=d.extend({},b||{},e||{});f=="input"?this._connectDatepicker(a,p):h&&this._inlineDatepicker(a,p)},_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:e(d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(a,b){var e=d(a);b.append=d([]);b.trigger=d([]);e.hasClass(this.markerClassName)||(this._attachments(e,b),e.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(d,a,i){b.settings[a]=i}).bind("getData.datepicker", function(d,a){return this._get(b,a)}),this._autoSize(b),d.data(a,"datepicker",b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var e=this._get(b,"appendText"),f=this._get(b,"isRTL");b.append&&b.append.remove();if(e)b.append=d('<span class="'+this._appendClass+'">'+e+"</span>"),a[f?"before":"after"](b.append);a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"|| e=="both"){var e=this._get(b,"buttonText"),h=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:h,alt:e,title:e}):d('<button type="button"></button>').addClass(this._triggerClass).html(h==""?e:d("<img/>").attr({src:h,alt:e,title:e})));a[f?"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!1})}}, _autoSize:function(d){if(this._get(d,"autoSize")&&!d.inline){var a=new Date(2009,11,20),b=this._get(d,"dateFormat");if(b.match(/[DM]/)){var e=function(d){for(var a=0,b=0,i=0;i<d.length;i++)if(d[i].length>a)a=d[i].length,b=i;return b};a.setMonth(e(this._get(d,b.match(/MM/)?"monthNames":"monthNamesShort")));a.setDate(e(this._get(d,b.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())}d.input.attr("size",this._formatDate(d,a).length)}},_inlineDatepicker:function(a,b){var e=d(a);e.hasClass(this.markerClassName)|| (e.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(d,a,i){b.settings[a]=i}).bind("getData.datepicker",function(d,a){return this._get(b,a)}),d.data(a,"datepicker",b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,e,h,g){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,!1),a.settings={},d.data(this._dialogInput[0],"datepicker",a);f(a.settings,h||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=g?g.length?g:[g.pageX,g.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=e;this._inDialog=!0;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),e=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var f= a.nodeName.toLowerCase();d.removeData(a,"datepicker");f=="input"?(e.append.remove(),e.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(f=="div"||f=="span")&&b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),e=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var f=a.nodeName.toLowerCase();if(f=="input")a.disabled= !1,e.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(f=="div"||f=="span")b=b.children("."+this._inlineClass),b.children().removeClass("ui-state-disabled"),b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled");this._disabledInputs=d.map(this._disabledInputs,function(d){return d==a?null:d})}},_disableDatepicker:function(a){var b=d(a),e=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var f= a.nodeName.toLowerCase();if(f=="input")a.disabled=!0,e.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(f=="div"||f=="span")b=b.children("."+this._inlineClass),b.children().addClass("ui-state-disabled"),b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled");this._disabledInputs=d.map(this._disabledInputs,function(d){return d==a?null:d});this._disabledInputs[this._disabledInputs.length]= a}},_isDisabledDatepicker:function(d){if(!d)return!1;for(var a=0;a<this._disabledInputs.length;a++)if(this._disabledInputs[a]==d)return!0;return!1},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(b,e,h){var g=this._getInst(b);if(arguments.length==2&&typeof e=="string")return e=="defaults"?d.extend({},d.datepicker._defaults):g?e=="all"?d.extend({},g.settings):this._get(g,e):null;var m=e||{};typeof e=="string"&& (m={},m[e]=h);if(g){this._curInst==g&&this._hideDatepicker();var o=this._getDateDatepicker(b,!0),p=this._getMinMaxDate(g,"min"),n=this._getMinMaxDate(g,"max");f(g.settings,m);if(p!==null&&m.dateFormat!==a&&m.minDate===a)g.settings.minDate=this._formatDate(g,p);if(n!==null&&m.dateFormat!==a&&m.maxDate===a)g.settings.maxDate=this._formatDate(g,n);this._attachments(d(b),g);this._autoSize(g);this._setDate(g,o);this._updateAlternate(g);this._updateDatepicker(g)}},_changeDatepicker:function(d,a,b){this._optionDatepicker(d, a,b)},_refreshDatepicker:function(d){(d=this._getInst(d))&&this._updateDatepicker(d)},_setDateDatepicker:function(d,a){var b=this._getInst(d);b&&(this._setDate(b,a),this._updateDatepicker(b),this._updateAlternate(b))},_getDateDatepicker:function(d,a){var b=this._getInst(d);b&&!b.inline&&this._setDateFromField(b,a);return b?this._getDate(b):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),e=!0,f=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker(); e=!1;break;case 13:return e=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv),e[0]&&d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,e[0]),(a=d.datepicker._get(b,"onSelect"))?(e=d.datepicker._formatDate(b),a.apply(b.input?b.input[0]:null,[e,b])):d.datepicker._hideDatepicker(),!1;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:(a.ctrlKey||a.metaKey)&&d.datepicker._clearDate(a.target);e=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&d.datepicker._gotoToday(a.target);e=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,f?1:-1,"D");e=a.ctrlKey||a.metaKey;a.originalEvent.altKey&&d.datepicker._adjustDate(a.target,a.ctrlKey? -d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&d.datepicker._adjustDate(a.target,-7,"D");e=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,f?-1:1,"D");e=a.ctrlKey||a.metaKey;a.originalEvent.altKey&&d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&d.datepicker._adjustDate(a.target, 7,"D");e=a.ctrlKey||a.metaKey;break;default:e=!1}else a.keyCode==36&&a.ctrlKey?d.datepicker._showDatepicker(this):e=!1;e&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(b){var e=d.datepicker._getInst(b.target);if(d.datepicker._get(e,"constrainInput")){var e=d.datepicker._possibleChars(d.datepicker._get(e,"dateFormat")),f=String.fromCharCode(b.charCode==a?b.keyCode:b.charCode);return b.ctrlKey||b.metaKey||f<" "||!e||e.indexOf(f)>-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!0},_showDatepicker:function(a){a=a.target||a;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._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst),d.datepicker._curInst.dpDiv.stop(!0,!0));var e=d.datepicker._get(b,"beforeShow"),e=e?e.apply(a,[a,b]):{};if(e!==!1){f(b.settings,e);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 h=!1;d(a).parents().each(function(){h|= d(this).css("position")=="fixed";return!h});h&&d.browser.opera&&(d.datepicker._pos[0]-=document.documentElement.scrollLeft,d.datepicker._pos[1]-=document.documentElement.scrollTop);e={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);e=d.datepicker._checkOffset(b,e,h);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":h?"fixed":"absolute",display:"none", left:e.left+"px",top:e.top+"px"});if(!b.inline){var e=d.datepicker._get(b,"showAnim"),g=d.datepicker._get(b,"duration"),o=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(a.length){var e=d.datepicker._getBorders(b.dpDiv);a.css({left:-e[0],top:-e[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing=!0;if(d.effects&&d.effects[e])b.dpDiv.show(e,d.datepicker._get(b,"showOptions"),g,o);else b.dpDiv[e||"show"](e?g:null, o);(!e||!g)&&o();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);g=a;a.dpDiv.empty().append(this._generateHTML(a));var e=a.dpDiv.find("iframe.ui-datepicker-cover");e.length&&e.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);e=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""); e>1&&a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em");a.dpDiv[(b[0]!=1||b[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[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var f=a.yearshtml;setTimeout(function(){f===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml); f=a.yearshtml=null},0)}},_getBorders:function(a){var d=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(d(a.css("border-left-width"))),parseFloat(d(a.css("border-top-width")))]},_checkOffset:function(a,b,e){var f=a.dpDiv.outerWidth(),h=a.dpDiv.outerHeight(),g=a.input?a.input.outerWidth():0,p=a.input?a.input.outerHeight():0,n=document.documentElement.clientWidth+d(document).scrollLeft(),r=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")? f-g:0;b.left-=e&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=e&&b.top==a.input.offset().top+p?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+f>n&&n>f?Math.abs(b.left+f-n):0);b.top-=Math.min(b.top,b.top+h>r&&r>h?Math.abs(h+p):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_triggerOnClose:function(a){var d= this._get(a,"onClose");d&&d.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=this._curInst;if(b&&!(a&&b!=d.data(a,"datepicker"))&&this._datepickerShowing){var a=this._get(b,"showAnim"),e=this._get(b,"duration"),f=function(){d.datepicker._tidyDialog(b);this._curInst=null};if(d.effects&&d.effects[a])b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),e,f);else b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?e:null,f);a||f();d.datepicker._triggerOnClose(b); this._datepickerShowing=!1;this._lastInput=null;this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),d.blockUI&&(d.unblockUI(),d("body").append(this.dpDiv)));this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){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,e){var a=d(a),f=this._getInst(a[0]);this._isDisabledDatepicker(a[0])||(this._adjustInstDate(f,b+(e=="M"?this._get(f,"showCurrentAtPos"):0),e),this._updateDatepicker(f))},_gotoToday:function(a){var a=d(a),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 e=new Date;b.selectedDay=e.getDate();b.drawMonth=b.selectedMonth=e.getMonth();b.drawYear=b.selectedYear=e.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,e){var a=d(a),f=this._getInst(a[0]);f["selected"+(e=="M"?"Month":"Year")]=f["draw"+(e=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(f);this._adjustDate(a)},_selectDay:function(a,b,e,f){var h=d(a);if(!d(f).hasClass(this._unselectableClass)&& !this._isDisabledDatepicker(h[0]))h=this._getInst(h[0]),h.selectedDay=h.currentDay=d("a",f).html(),h.selectedMonth=h.currentMonth=b,h.selectedYear=h.currentYear=e,this._selectDate(a,this._formatDate(h,h.currentDay,h.currentMonth,h.currentYear))},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){var e=this._getInst(d(a)[0]),b=b!=null?b:this._formatDate(e);e.input&&e.input.val(b);this._updateAlternate(e);var f=this._get(e,"onSelect");f?f.apply(e.input? e.input[0]:null,[b,e]):e.input&&e.input.trigger("change");e.inline?this._updateDatepicker(e):(this._hideDatepicker(),this._lastInput=e.input[0],typeof e.input[0]!="object"&&e.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var e=this._get(a,"altFormat")||this._get(a,"dateFormat"),f=this._getDate(a),h=this.formatDate(e,f,this._getFormatConfig(a));d(b).each(function(){d(this).val(h)})}},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 d=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((d-a)/864E5)/7)+1},parseDate:function(a,b,e){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;for(var f=(e?e.shortYearCutoff:null)||this._defaults.shortYearCutoff,f=typeof f!="string"?f:(new Date).getFullYear()%100+parseInt(f,10),h=(e?e.dayNamesShort:null)||this._defaults.dayNamesShort,g=(e?e.dayNames:null)|| this._defaults.dayNames,p=(e?e.monthNamesShort:null)||this._defaults.monthNamesShort,n=(e?e.monthNames:null)||this._defaults.monthNames,r=e=-1,u=-1,x=-1,q=!1,w=function(d){(d=F+1<a.length&&a.charAt(F+1)==d)&&F++;return d},s=function(a){var d=w(a),a=b.substring(C).match(RegExp("^\\d{1,"+(a=="@"?14:a=="!"?20:a=="y"&&d?4:a=="o"?3:2)+"}"));if(!a)throw"Missing number at position "+C;C+=a[0].length;return parseInt(a[0],10)},v=function(a,e,f){var a=d.map(w(a)?f:e,function(a,d){return[[d,a]]}).sort(function(a, d){return-(a[1].length-d[1].length)}),i=-1;d.each(a,function(a,d){var e=d[1];if(b.substr(C,e.length).toLowerCase()==e.toLowerCase())return i=d[0],C+=e.length,!1});if(i!=-1)return i+1;else throw"Unknown name at position "+C;},z=function(){if(b.charAt(C)!=a.charAt(F))throw"Unexpected literal at position "+C;C++},C=0,F=0;F<a.length;F++)if(q)a.charAt(F)=="'"&&!w("'")?q=!1:z();else switch(a.charAt(F)){case "d":u=s("d");break;case "D":v("D",h,g);break;case "o":x=s("o");break;case "m":r=s("m");break;case "M":r= v("M",p,n);break;case "y":e=s("y");break;case "@":var B=new Date(s("@")),e=B.getFullYear(),r=B.getMonth()+1,u=B.getDate();break;case "!":B=new Date((s("!")-this._ticksTo1970)/1E4);e=B.getFullYear();r=B.getMonth()+1;u=B.getDate();break;case "'":w("'")?z():q=!0;break;default:z()}if(C<b.length)throw"Extra/unparsed characters found in date: "+b.substring(C);e==-1?e=(new Date).getFullYear():e<100&&(e+=(new Date).getFullYear()-(new Date).getFullYear()%100+(e<=f?0:-100));if(x>-1){r=1;u=x;do{f=this._getDaysInMonth(e, r-1);if(u<=f)break;r++;u-=f}while(1)}B=this._daylightSavingAdjust(new Date(e,r-1,u));if(B.getFullYear()!=e||B.getMonth()+1!=r||B.getDate()!=u)throw"Invalid date";return B},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))*864E9,formatDate:function(a,d,b){if(!d)return""; var e=(b?b.dayNamesShort:null)||this._defaults.dayNamesShort,f=(b?b.dayNames:null)||this._defaults.dayNames,h=(b?b.monthNamesShort:null)||this._defaults.monthNamesShort,b=(b?b.monthNames:null)||this._defaults.monthNames,g=function(d){(d=q+1<a.length&&a.charAt(q+1)==d)&&q++;return d},n=function(a,d,b){d=""+d;if(g(a))for(;d.length<b;)d="0"+d;return d},r=function(a,d,b,e){return g(a)?e[d]:b[d]},u="",x=!1;if(d)for(var q=0;q<a.length;q++)if(x)a.charAt(q)=="'"&&!g("'")?x=!1:u+=a.charAt(q);else switch(a.charAt(q)){case "d":u+= n("d",d.getDate(),2);break;case "D":u+=r("D",d.getDay(),e,f);break;case "o":u+=n("o",Math.round(((new Date(d.getFullYear(),d.getMonth(),d.getDate())).getTime()-(new Date(d.getFullYear(),0,0)).getTime())/864E5),3);break;case "m":u+=n("m",d.getMonth()+1,2);break;case "M":u+=r("M",d.getMonth(),h,b);break;case "y":u+=g("y")?d.getFullYear():(d.getYear()%100<10?"0":"")+d.getYear()%100;break;case "@":u+=d.getTime();break;case "!":u+=d.getTime()*1E4+this._ticksTo1970;break;case "'":g("'")?u+="'":x=!0;break; default:u+=a.charAt(q)}return u},_possibleChars:function(a){for(var d="",b=!1,e=function(d){(d=f+1<a.length&&a.charAt(f+1)==d)&&f++;return d},f=0;f<a.length;f++)if(b)a.charAt(f)=="'"&&!e("'")?b=!1:d+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":d+="0123456789";break;case "D":case "M":return null;case "'":e("'")?d+="'":b=!0;break;default:d+=a.charAt(f)}return d},_get:function(d,b){return d.settings[b]!==a?d.settings[b]:this._defaults[b]},_setDateFromField:function(a,d){if(a.input.val()!= a.lastVal){var b=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);var g=this._getFormatConfig(a);try{f=this.parseDate(b,e,g)||h}catch(n){this.log(n),e=d?"":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,e){var i;var f=function(a){var d=new Date;d.setDate(d.getDate()+a);return d};if(i=(b=b==null||b===""?e:typeof b=="string"?function(b){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),b,d.datepicker._getFormatConfig(a))}catch(e){}for(var f=(b.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,h=f.getFullYear(),g=f.getMonth(),f=f.getDate(),j=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=j.exec(b);k;){switch(k[2]|| "d"){case "d":case "D":f+=parseInt(k[1],10);break;case "w":case "W":f+=parseInt(k[1],10)*7;break;case "m":case "M":g+=parseInt(k[1],10);f=Math.min(f,d.datepicker._getDaysInMonth(h,g));break;case "y":case "Y":h+=parseInt(k[1],10),f=Math.min(f,d.datepicker._getDaysInMonth(h,g))}k=j.exec(b)}return new Date(h,g,f)}(b):typeof b=="number"?isNaN(b)?e:f(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?e:b,b=i)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,d,b){var e=!d,f=a.selectedMonth,h=a.selectedYear,d=this._restrictMinMax(a,this._determineDate(a,d,new Date));a.selectedDay=a.currentDay=d.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=d.getMonth();a.drawYear=a.selectedYear=a.currentYear=d.getFullYear();(f!=a.selectedMonth||h!=a.selectedYear)&&!b&&this._notifyChange(a);this._adjustInstDate(a);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())),e=this._get(a,"isRTL"),f=this._get(a,"showButtonPanel"),g=this._get(a,"hideIfNoPrevNext"),o=this._get(a,"navigationAsDateFormat"),p=this._getNumberOfMonths(a),n=this._get(a,"showCurrentAtPos"),r=this._get(a, "stepMonths"),u=p[0]!=1||p[1]!=1,x=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),q=this._getMinMaxDate(a,"min"),w=this._getMinMaxDate(a,"max"),n=a.drawMonth-n,s=a.drawYear;n<0&&(n+=12,s--);if(w)for(var v=this._daylightSavingAdjust(new Date(w.getFullYear(),w.getMonth()-p[0]*p[1]+1,w.getDate())),v=q&&v<q?q:v;this._daylightSavingAdjust(new Date(s,n,1))>v;)n--,n<0&&(n=11,s--);a.drawMonth=n;a.drawYear=s;var v=this._get(a,"prevText"),v= !o?v:this.formatDate(v,this._daylightSavingAdjust(new Date(s,n-r,1)),this._getFormatConfig(a)),v=this._canAdjustMonth(a,-1,s,n)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+h+".datepicker._adjustDate('#"+a.id+"', -"+r+", 'M');\" title=\""+v+'"><span class="ui-icon ui-icon-circle-triangle-'+(e?"e":"w")+'">'+v+"</span></a>":g?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+v+'"><span class="ui-icon ui-icon-circle-triangle-'+(e?"e":"w")+'">'+v+"</span></a>", z=this._get(a,"nextText"),z=!o?z:this.formatDate(z,this._daylightSavingAdjust(new Date(s,n+r,1)),this._getFormatConfig(a)),g=this._canAdjustMonth(a,1,s,n)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+h+".datepicker._adjustDate('#"+a.id+"', +"+r+", 'M');\" title=\""+z+'"><span class="ui-icon ui-icon-circle-triangle-'+(e?"w":"e")+'">'+z+"</span></a>":g?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+z+'"><span class="ui-icon ui-icon-circle-triangle-'+ (e?"w":"e")+'">'+z+"</span></a>",r=this._get(a,"currentText"),z=this._get(a,"gotoCurrent")&&a.currentDay?x:b,r=!o?r:this.formatDate(r,z,this._getFormatConfig(a)),o=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+h+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>":"",f=f?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(e?o:"")+(this._isInRange(a,z)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+ h+".datepicker._gotoToday('#"+a.id+"');\">"+r+"</button>":"")+(e?"":o)+"</div>":"",o=parseInt(this._get(a,"firstDay"),10),o=isNaN(o)?0:o,r=this._get(a,"showWeek"),z=this._get(a,"dayNames");this._get(a,"dayNamesShort");var C=this._get(a,"dayNamesMin"),F=this._get(a,"monthNames"),B=this._get(a,"monthNamesShort"),N=this._get(a,"beforeShowDay"),K=this._get(a,"showOtherMonths"),T=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var O=this._getDefaultDate(a),L="",H=0;H<p[0];H++){var P= "";this.maxRows=4;for(var I=0;I<p[1];I++){var Q=this._daylightSavingAdjust(new Date(s,n,a.selectedDay)),A=" ui-corner-all",D="";if(u){D+='<div class="ui-datepicker-group';if(p[1]>1)switch(I){case 0:D+=" ui-datepicker-group-first";A=" ui-corner-"+(e?"right":"left");break;case p[1]-1:D+=" ui-datepicker-group-last";A=" ui-corner-"+(e?"left":"right");break;default:D+=" ui-datepicker-group-middle",A=""}D+='">'}D+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+A+'">'+(/all|left/.test(A)&& H==0?e?g:v:"")+(/all|right/.test(A)&&H==0?e?v:g:"")+this._generateMonthYearHeader(a,n,s,q,w,H>0||I>0,F,B)+'</div><table class="ui-datepicker-calendar"><thead><tr>';for(var E=r?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"",A=0;A<7;A++){var y=(A+o)%7;E+="<th"+((A+o+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+z[y]+'">'+C[y]+"</span></th>"}D+=E+"</tr></thead><tbody>";E=this._getDaysInMonth(s,n);if(s==a.selectedYear&&n==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay, E);A=(this._getFirstDayOfMonth(s,n)-o+7)%7;E=Math.ceil((A+E)/7);this.maxRows=E=u?this.maxRows>E?this.maxRows:E:E;for(var y=this._daylightSavingAdjust(new Date(s,n,1-A)),R=0;R<E;R++){D+="<tr>";for(var S=!r?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(y)+"</td>",A=0;A<7;A++){var J=N?N.apply(a.input?a.input[0]:null,[y]):[!0,""],G=y.getMonth()!=n,M=G&&!T||!J[0]||q&&y<q||w&&y>w;S+='<td class="'+((A+o+6)%7>=5?" ui-datepicker-week-end":"")+(G?" ui-datepicker-other-month":"")+(y.getTime()== Q.getTime()&&n==a.selectedMonth&&a._keyEvent||O.getTime()==y.getTime()&&O.getTime()==Q.getTime()?" "+this._dayOverClass:"")+(M?" "+this._unselectableClass+" ui-state-disabled":"")+(G&&!K?"":" "+J[1]+(y.getTime()==x.getTime()?" "+this._currentClass:"")+(y.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!G||K)&&J[2]?' title="'+J[2]+'"':"")+(M?"":' onclick="DP_jQuery_'+h+".datepicker._selectDay('#"+a.id+"',"+y.getMonth()+","+y.getFullYear()+', this);return false;"')+">"+(G&&!K?"&#xa0;":M?'<span class="ui-state-default">'+ y.getDate()+"</span>":'<a class="ui-state-default'+(y.getTime()==b.getTime()?" ui-state-highlight":"")+(y.getTime()==x.getTime()?" ui-state-active":"")+(G?" ui-priority-secondary":"")+'" href="#">'+y.getDate()+"</a>")+"</td>";y.setDate(y.getDate()+1);y=this._daylightSavingAdjust(y)}D+=S+"</tr>"}n++;n>11&&(n=0,s++);D+="</tbody></table>"+(u?"</div>"+(p[0]>0&&I==p[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");P+=D}L+=P}L+=f+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>': "");a._keyEvent=!1;return L},_generateMonthYearHeader:function(a,d,b,e,f,g,p,n){var r=this._get(a,"changeMonth"),u=this._get(a,"changeYear"),x=this._get(a,"showMonthAfterYear"),q='<div class="ui-datepicker-title">',w="";if(g||!r)w+='<span class="ui-datepicker-month">'+p[d]+"</span>";else{var p=e&&e.getFullYear()==b,s=f&&f.getFullYear()==b;w+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+h+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" >";for(var v=0;v<12;v++)if((!p||v>=e.getMonth())&& (!s||v<=f.getMonth()))w+='<option value="'+v+'"'+(v==d?' selected="selected"':"")+">"+n[v]+"</option>";w+="</select>"}x||(q+=w+(g||!r||!u?"&#xa0;":""));if(!a.yearshtml)if(a.yearshtml="",g||!u)q+='<span class="ui-datepicker-year">'+b+"</span>";else{var n=this._get(a,"yearRange").split(":"),z=(new Date).getFullYear(),p=function(a){a=a.match(/c[+-].*/)?b+parseInt(a.substring(1),10):a.match(/[+-].*/)?z+parseInt(a,10):parseInt(a,10);return isNaN(a)?z:a},d=p(n[0]),n=Math.max(d,p(n[1]||"")),d=e?Math.max(d, e.getFullYear()):d,n=f?Math.min(n,f.getFullYear()):n;for(a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+h+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" >";d<=n;d++)a.yearshtml+='<option value="'+d+'"'+(d==b?' selected="selected"':"")+">"+d+"</option>";a.yearshtml+="</select>";q+=a.yearshtml;a.yearshtml=null}q+=this._get(a,"yearSuffix");x&&(q+=(g||!r||!u?"&#xa0;":"")+w);q+="</div>";return q},_adjustInstDate:function(a,d,b){var e=a.drawYear+(b=="Y"?d:0),f=a.drawMonth+ (b=="M"?d:0),d=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(b=="D"?d:0),e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,d)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();(b=="M"||b=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,d){var b=this._getMinMaxDate(a,"min"),e=this._getMinMaxDate(a,"max"),b=b&&d<b?b:d;return e&&b>e?e:b},_notifyChange:function(a){var d=this._get(a,"onChangeMonthYear");d&&d.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,d){return this._determineDate(a,this._get(a,d+"Date"),null)},_getDaysInMonth:function(a,d){return 32-this._daylightSavingAdjust(new Date(a,d,32)).getDate()},_getFirstDayOfMonth:function(a,d){return(new Date(a,d,1)).getDay()},_canAdjustMonth:function(a,d,b,e){var f=this._getNumberOfMonths(a),b=this._daylightSavingAdjust(new Date(b, e+(d<0?d:f[0]*f[1]),1));d<0&&b.setDate(this._getDaysInMonth(b.getFullYear(),b.getMonth()));return this._isInRange(a,b)},_isInRange:function(a,d){var b=this._getMinMaxDate(a,"min"),e=this._getMinMaxDate(a,"max");return(!b||d.getTime()>=b.getTime())&&(!e||d.getTime()<=e.getTime())},_getFormatConfig:function(a){var d=this._get(a,"shortYearCutoff"),d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);return{shortYearCutoff:d,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a, "dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,d,b,e){if(!d)a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear;d=d?typeof d=="object"?d:this._daylightSavingAdjust(new Date(e,b,d)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),d,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length)return this; if(!d.datepicker.initialized)d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv),d.datepicker.initialized=!0;var b=Array.prototype.slice.call(arguments,1);return typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget")?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b)):a=="option"&&arguments.length==2&&typeof arguments[1]=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b)):this.each(function(){typeof a== "string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new b;d.datepicker.initialized=!1;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.16";window["DP_jQuery_"+h]=d})(jQuery); (function(d,a){var b={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=d.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};d.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(a){var b= d(this).css(a).offset().top;b<0&&d(this).css("top",a.top-b)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,e=b.title||"&#160;",f=d.ui.dialog.getTitleId(a.element),k=(a.uiDialog=d("<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(e){b.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===d.ui.keyCode.ESCAPE&&(a.close(e),e.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(d){a.moveToTop(!1,d)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(k);var l=(a.uiDialogTitlebar=d("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k), m=d('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){m.addClass("ui-state-hover")},function(){m.removeClass("ui-state-hover")}).focus(function(){m.addClass("ui-state-focus")}).blur(function(){m.removeClass("ui-state-focus")}).click(function(d){a.close(d);return!1}).appendTo(l);(a.uiDialogTitlebarCloseText=d("<span></span>")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(m);d("<span></span>").addClass("ui-dialog-title").attr("id", f).html(e).prependTo(l);if(d.isFunction(b.beforeclose)&&!d.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;l.find("*").add(l).disableSelection();b.draggable&&d.fn.draggable&&a._makeDraggable();b.resizable&&d.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=!1;d.fn.bgiframe&&k.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){this.overlay&&this.overlay.destroy();this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); this.uiDialog.remove();this.originalTitle&&this.element.attr("title",this.originalTitle);return this},widget:function(){return this.uiDialog},close:function(a){var b=this,e,f;if(!1!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=!1;b.options.hide?b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)}):(b.uiDialog.hide(),b._trigger("close",a));d.ui.dialog.overlay.resize();if(b.options.modal)e=0,d(".ui-dialog").each(function(){this!== b.uiDialog[0]&&(f=d(this).css("z-index"),isNaN(f)||(e=Math.max(e,f)))}),d.ui.dialog.maxZ=e;return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var e=this.options;if(e.modal&&!a||!e.stack&&!e.modal)return this._trigger("focus",b);if(e.zIndex>d.ui.dialog.maxZ)d.ui.dialog.maxZ=e.zIndex;if(this.overlay)d.ui.dialog.maxZ+=1,this.overlay.$el.css("z-index",d.ui.dialog.overlay.maxZ=d.ui.dialog.maxZ);e={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()};d.ui.dialog.maxZ+= 1;this.uiDialog.css("z-index",d.ui.dialog.maxZ);this.element.attr(e);this._trigger("focus",b);return this},open:function(){if(!this._isOpen){var a=this.options,b=this.uiDialog;this.overlay=a.modal?new d.ui.dialog.overlay(this):null;this._size();this._position(a.position);b.show(a.show);this.moveToTop(!0);a.modal&&b.bind("keypress.ui-dialog",function(a){if(a.keyCode===d.ui.keyCode.TAB){var b=d(":tabbable",this),e=b.filter(":first"),b=b.filter(":last");if(a.target===b[0]&&!a.shiftKey)return e.focus(1), !1;else if(a.target===e[0]&&a.shiftKey)return b.focus(1),!1}});d(this.element.find(":tabbable").get().concat(b.find(".ui-dialog-buttonpane :tabbable").get().concat(b.get()))).eq(0).focus();this._isOpen=!0;this._trigger("open");return this}},_createButtons:function(a){var b=this,e=!1,j=d("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),k=d("<div></div>").addClass("ui-dialog-buttonset").appendTo(j);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&& a!==null&&d.each(a,function(){return!(e=!0)});e&&(d.each(a,function(a,e){var e=d.isFunction(e)?{click:e,text:a}:e,h=d('<button type="button"></button>').click(function(){e.click.apply(b.element[0],arguments)}).appendTo(k);d.each(e,function(a,d){if(a!=="click")if(a in f)h[a](d);else h.attr(a,d)});d.fn.button&&h.button()}),j.appendTo(b.uiDialog))},_makeDraggable:function(){function a(d){return{position:d.position,offset:d.offset}}var b=this,e=b.options,f=d(document),k;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close", handle:".ui-dialog-titlebar",containment:"document",start:function(f,m){k=e.height==="auto"?"auto":d(this).height();d(this).height(d(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(m))},drag:function(d,e){b._trigger("drag",d,a(e))},stop:function(l,m){e.position=[m.position.left-f.scrollLeft(),m.position.top-f.scrollTop()];d(this).removeClass("ui-dialog-dragging").height(k);b._trigger("dragStop",l,a(m));d.ui.dialog.overlay.resize()}})},_makeResizable:function(b){function e(a){return{originalPosition:a.originalPosition, originalSize:a.originalSize,position:a.position,size:a.size}}var b=b===a?this.options.resizable:b,f=this,j=f.options,k=f.uiDialog.css("position"),b=typeof b==="string"?b:"n,e,s,w,se,sw,ne,nw";f.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:f.element,maxWidth:j.maxWidth,maxHeight:j.maxHeight,minWidth:j.minWidth,minHeight:f._minHeight(),handles:b,start:function(a,b){d(this).addClass("ui-dialog-resizing");f._trigger("resizeStart",a,e(b))},resize:function(a,d){f._trigger("resize", a,e(d))},stop:function(a,b){d(this).removeClass("ui-dialog-resizing");j.height=d(this).height();j.width=d(this).width();f._trigger("resizeStop",a,e(b));d.ui.dialog.overlay.resize()}}).css("position",k).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=[],e=[0,0],f;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a)b=a.split?a.split(" "): [a[0],a[1]],b.length===1&&(b[1]=b[0]),d.each(["left","top"],function(a,d){+b[a]===b[a]&&(e[a]=b[a],b[a]=d)}),a={my:b.join(" "),at:b.join(" "),offset:e.join(" ")};a=d.extend({},d.ui.dialog.prototype.options.position,a)}else a=d.ui.dialog.prototype.options.position;(f=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(d.extend({of:window},a));f||this.uiDialog.hide()},_setOptions:function(a){var f=this,i={},j=!1;d.each(a,function(a,d){f._setOption(a,d);a in b&&(j=!0);a in e&&(i[a]=d)});j&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",i)},_setOption:function(a,b){var e=this.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":this._createButtons(b);break;case "closeText":this.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(this.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"): e.removeClass("ui-dialog-disabled");break;case "draggable":var f=e.is(":data(draggable)");f&&!b&&e.draggable("destroy");!f&&b&&this._makeDraggable();break;case "position":this._position(b);break;case "resizable":(f=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");f&&typeof b==="string"&&e.resizable("option","handles",b);!f&&b!==!1&&this._makeResizable(b);break;case "title":d(".ui-dialog-title",this.uiDialogTitlebar).html(""+(b||"&#160;"))}d.Widget.prototype._setOption.apply(this,arguments)}, _size:function(){var a=this.options,b,e,f=this.uiDialog.is(":visible");this.element.show().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();e=Math.max(0,a.minHeight-b);a.height==="auto"?d.support.minHeight?this.element.css({minHeight:e,height:"auto"}):(this.uiDialog.show(),a=this.element.css("height","auto").height(),f||this.uiDialog.hide(),this.element.height(Math.max(a,e))):this.element.height(Math.max(a.height- b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});d.extend(d.ui.dialog,{version:"1.8.16",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=d.ui.dialog.overlay.create(a)}});d.extend(d.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:d.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "), create:function(a){this.instances.length===0&&(setTimeout(function(){d.ui.dialog.overlay.instances.length&&d(document).bind(d.ui.dialog.overlay.events,function(a){if(d(a.target).zIndex()<d.ui.dialog.overlay.maxZ)return!1})},1),d(document).bind("keydown.dialog-overlay",function(b){a.options.closeOnEscape&&!b.isDefaultPrevented()&&b.keyCode&&b.keyCode===d.ui.keyCode.ESCAPE&&(a.close(b),b.preventDefault())}),d(window).bind("resize.dialog-overlay",d.ui.dialog.overlay.resize));var b=(this.oldInstances.pop()|| d("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});d.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=d.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&d([document,window]).unbind(".dialog-overlay");a.remove();var e=0;d.each(this.instances,function(){e=Math.max(e,this.css("z-index"))});this.maxZ=e},height:function(){var a,b;return d.browser.msie&& d.browser.version<7?(a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),a<b?d(window).height()+"px":a+"px"):d(document).height()+"px"},width:function(){var a,b;return d.browser.msie?(a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),b=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),a<b?d(window).width()+"px":a+"px"):d(document).width()+"px"},resize:function(){var a= d([]);d.each(d.ui.dialog.overlay.instances,function(){a=a.add(this)});a.css({width:0,height:0}).css({width:d.ui.dialog.overlay.width(),height:d.ui.dialog.overlay.height()})}});d.extend(d.ui.dialog.overlay.prototype,{destroy:function(){d.ui.dialog.overlay.destroy(this.$el)}})})(jQuery); (function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_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"))return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(a){var b=this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return!1; this.handle=this._getHandle(a);if(!this.handle)return!1;b.iframeFix&&d(b.iframeFix===!0?"iframe":b.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")});return!0},_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)===!1)return this._clear(),!1;this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,!0);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return!0},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute"); if(!b){var e=this._uiHash();if(this._trigger("drag",a,e)===!1)return this._mouseUp({}),!1;this.position=e.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!1},_mouseStop:function(a){var b=!1;d.ui.ddmanager&&!this.options.dropBehaviour&&(b=d.ui.ddmanager.drop(this,a));if(this.dropped)b=this.dropped,this.dropped= !1;if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===!0||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var e=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){e._trigger("stop",a)!==!1&&e._clear()})}else this._trigger("stop",a)!==!1&&this._clear();return!1},_mouseUp:function(a){this.options.iframeFix=== !0&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},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?!0:!1;d(this.options.handle,this.element).find("*").andSelf().each(function(){this==a.target&&(b=!0)});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().removeAttr("id"):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){typeof a=="string"&&(a=a.split(" "));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();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,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),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=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width- this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(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 a=d(a.containment),b=a[0];if(b){a.offset();var e=d(b).css("overflow")!="hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"), 10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(e?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-this.margins.right,(e?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-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor== Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;var e=a=="absolute"?1:-1,f=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=/(html|body)/i.test(f[0].tagName);return{top:b.top+this.offset.relative.top*e+this.offset.parent.top*e-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop(): h?0:f.scrollTop())*e),left:b.left+this.offset.relative.left*e+this.offset.parent.left*e-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:f.scrollLeft())*e)}},_generatePosition:function(a){var b=this.options,e=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(e[0].tagName),h=a.pageX,g=a.pageY; if(this.originalPosition){var i;if(this.containment)this.relative_container?(i=this.relative_container.offset(),i=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]):i=this.containment,a.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),a.pageY-this.offset.click.top<i[1]&&(g=i[1]+this.offset.click.top),a.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),a.pageY-this.offset.click.top>i[3]&&(g=i[3]+this.offset.click.top); b.grid&&(g=b.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY,g=i?!(g-this.offset.click.top<i[1]||g-this.offset.click.top>i[3])?g:!(g-this.offset.click.top<i[1])?g-b.grid[1]:g+b.grid[1]:g,h=b.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/b.grid[0])*b.grid[0]:this.originalPageX,h=i?!(h-this.offset.click.left<i[0]||h-this.offset.click.left>i[2])?h:!(h-this.offset.click.left<i[0])?h-b.grid[0]:h+b.grid[0]:h)}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:e.scrollTop()),left:h-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:e.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=!1},_trigger:function(a,b,e){e=e||this._uiHash();d.ui.plugin.call(this,a,[b,e]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,e)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.16"});d.ui.plugin.add("draggable", "connectToSortable",{start:function(a,b){var e=d(this).data("draggable"),f=e.options,h=d.extend({},b,{item:e.element});e.sortables=[];d(f.connectToSortable).each(function(){var b=d.data(this,"sortable");b&&!b.options.disabled&&(e.sortables.push({instance:b,shouldRevert:b.options.revert}),b.refreshPositions(),b._trigger("activate",a,h))})},stop:function(a,b){var e=d(this).data("draggable"),f=d.extend({},b,{item:e.element});d.each(e.sortables,function(){if(this.instance.isOver){this.instance.isOver= 0;e.cancelHelperRemoval=!0;this.instance.cancelHelperRemoval=!1;if(this.shouldRevert)this.instance.options.revert=!0;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;e.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",a,f)})},drag:function(a,b){var e=d(this).data("draggable"),f=this;d.each(e.sortables,function(){this.instance.positionAbs=e.positionAbs; this.instance.helperProportions=e.helperProportions;this.instance.offset.click=e.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver)this.instance.isOver=1,this.instance.currentItem=d(f).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),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, !0),this.instance._mouseStart(a,!0,!0),this.instance.offset.click.top=e.offset.click.top,this.instance.offset.click.left=e.offset.click.left,this.instance.offset.parent.left-=e.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=e.offset.parent.top-this.instance.offset.parent.top,e._trigger("toSortable",a),e.dropped=this.instance.element,e.currentItem=e.element,this.instance.fromOutside=e;this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver)this.instance.isOver= 0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",a,this.instance._uiHash(this.instance)),this.instance._mouseStop(a,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),e._trigger("fromSortable",a),e.dropped=!1})}});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","opacity",{start:function(a,b){var e=d(b.helper),f=d(this).data("draggable").options;if(e.css("opacity"))f._opacity=e.css("opacity");e.css("opacity",f.opacity)},stop:function(a,b){var e=d(this).data("draggable").options;e._opacity&&d(b.helper).css("opacity",e._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"),e=b.options,f=!1;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<e.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+e.scrollSpeed;else if(a.pageY-b.overflowOffset.top<e.scrollSensitivity)b.scrollParent[0].scrollTop= f=b.scrollParent[0].scrollTop-e.scrollSpeed;if(!e.axis||e.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<e.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+e.scrollSpeed;else if(a.pageX-b.overflowOffset.left<e.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-e.scrollSpeed}else{if(!e.axis||e.axis!="x")a.pageY-d(document).scrollTop()<e.scrollSensitivity?f=d(document).scrollTop(d(document).scrollTop()-e.scrollSpeed): d(window).height()-(a.pageY-d(document).scrollTop())<e.scrollSensitivity&&(f=d(document).scrollTop(d(document).scrollTop()+e.scrollSpeed));if(!e.axis||e.axis!="y")a.pageX-d(document).scrollLeft()<e.scrollSensitivity?f=d(document).scrollLeft(d(document).scrollLeft()-e.scrollSpeed):d(window).width()-(a.pageX-d(document).scrollLeft())<e.scrollSensitivity&&(f=d(document).scrollLeft(d(document).scrollLeft()+e.scrollSpeed))}f!==!1&&d.ui.ddmanager&&!e.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 b=d(this),f=b.offset();this!=a.element[0]&&a.snapElements.push({item:this,width:b.outerWidth(),height:b.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var e=d(this).data("draggable"),f=e.options,h=f.snapTolerance,g=b.offset.left,i=g+e.helperProportions.width,j=b.offset.top,k=j+e.helperProportions.height, l=e.snapElements.length-1;l>=0;l--){var m=e.snapElements[l].left,o=m+e.snapElements[l].width,p=e.snapElements[l].top,n=p+e.snapElements[l].height;if(m-h<g&&g<o+h&&p-h<j&&j<n+h||m-h<g&&g<o+h&&p-h<k&&k<n+h||m-h<i&&i<o+h&&p-h<j&&j<n+h||m-h<i&&i<o+h&&p-h<k&&k<n+h){if(f.snapMode!="inner"){var r=Math.abs(p-k)<=h,u=Math.abs(n-j)<=h,x=Math.abs(m-i)<=h,q=Math.abs(o-g)<=h;if(r)b.position.top=e._convertPositionTo("relative",{top:p-e.helperProportions.height,left:0}).top-e.margins.top;if(u)b.position.top=e._convertPositionTo("relative", {top:n,left:0}).top-e.margins.top;if(x)b.position.left=e._convertPositionTo("relative",{top:0,left:m-e.helperProportions.width}).left-e.margins.left;if(q)b.position.left=e._convertPositionTo("relative",{top:0,left:o}).left-e.margins.left}var w=r||u||x||q;if(f.snapMode!="outer"){r=Math.abs(p-j)<=h;u=Math.abs(n-k)<=h;x=Math.abs(m-g)<=h;q=Math.abs(o-i)<=h;if(r)b.position.top=e._convertPositionTo("relative",{top:p,left:0}).top-e.margins.top;if(u)b.position.top=e._convertPositionTo("relative",{top:n-e.helperProportions.height, left:0}).top-e.margins.top;if(x)b.position.left=e._convertPositionTo("relative",{top:0,left:m}).left-e.margins.left;if(q)b.position.left=e._convertPositionTo("relative",{top:0,left:o-e.helperProportions.width}).left-e.margins.left}!e.snapElements[l].snapping&&(r||u||x||q||w)&&e.options.snap.snap&&e.options.snap.snap.call(e.element,a,d.extend(e._uiHash(),{snapItem:e.snapElements[l].item}));e.snapElements[l].snapping=r||u||x||q||w}else e.snapElements[l].snapping&&e.options.snap.release&&e.options.snap.release.call(e.element, a,d.extend(e._uiHash(),{snapItem:e.snapElements[l].item})),e.snapElements[l].snapping=!1}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options,a=d.makeArray(d(a.stack)).sort(function(a,b){return(parseInt(d(a).css("zIndex"),10)||0)-(parseInt(d(b).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(a){this.style.zIndex=b+a});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a, b){var e=d(b.helper),f=d(this).data("draggable").options;if(e.css("zIndex"))f._zIndex=e.css("zIndex");e.css("zIndex",f.zIndex)},stop:function(a,b){var e=d(this).data("draggable").options;e._zIndex&&d(b.helper).css("zIndex",e._zIndex)}})})(jQuery); (function(d){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,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(a){return a.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(a){return a.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 e=b||d.ui.ddmanager.current;if(!e||(e.currentItem||e.element)[0]==this.element[0])return!1;var f=!1;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var a=d.data(this, "droppable");if(a.options.greedy&&!a.options.disabled&&a.options.scope==e.options.scope&&a.accept.call(a.element[0],e.currentItem||e.element)&&d.ui.intersect(e,d.extend(a,{offset:a.element.offset()}),a.options.tolerance))return f=!0,!1});return f?!1:this.accept.call(this.element[0],e.currentItem||e.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(e)),this.element): !1},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.16"});d.ui.intersect=function(a,b,e){if(!b.offset)return!1;var f=(a.positionAbs||a.position.absolute).left,h=f+a.helperProportions.width,g=(a.positionAbs||a.position.absolute).top,i=g+a.helperProportions.height,j=b.offset.left,k=j+b.proportions.width,l=b.offset.top,m=l+b.proportions.height;switch(e){case "fit":return j<=f&&h<=k&&l<=g&&i<=m; case "intersect":return j<f+a.helperProportions.width/2&&h-a.helperProportions.width/2<k&&l<g+a.helperProportions.height/2&&i-a.helperProportions.height/2<m;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,l,j,b.proportions.height,b.proportions.width);case "touch":return(g>=l&&g<=m||i>=l&&i<=m||g<l&&i>m)&&(f>=j&&f<=k||h>=j&&h<=k||f<j&&h>k);default:return!1}}; d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var e=d.ui.ddmanager.droppables[a.options.scope]||[],f=b?b.type:null,h=(a.currentItem||a.element).find(":data(droppable)").andSelf(),g=0;a:for(;g<e.length;g++)if(!(e[g].options.disabled||a&&!e[g].accept.call(e[g].element[0],a.currentItem||a.element))){for(var i=0;i<h.length;i++)if(h[i]==e[g].element[0]){e[g].proportions.height=0;continue a}e[g].visible=e[g].element.css("display")!="none";if(e[g].visible)f=="mousedown"&& e[g]._activate.call(e[g],b),e[g].offset=e[g].element.offset(),e[g].proportions={width:e[g].element[0].offsetWidth,height:e[g].element[0].offsetHeight}}},drop:function(a,b){var e=!1;d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(this.options&&(!this.options.disabled&&this.visible&&d.ui.intersect(a,this,this.options.tolerance)&&(e=e||this._drop.call(this,b)),!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 e},dragStart:function(a,b){a.element.parents(":not(body,html)").bind("scroll.droppable",function(){a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)})},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 e=d.ui.intersect(a,this,this.options.tolerance);if(e=!e&&this.isover==1?"isout":e&&this.isover== 0?"isover":null){var f;if(this.options.greedy){var h=this.element.parents(":data(droppable):eq(0)");if(h.length)f=d.data(h[0],"droppable"),f.greedyChild=e=="isover"?1:0}if(f&&e=="isover")f.isover=0,f.isout=1,f._out.call(f,b);this[e]=1;this[e=="isout"?"isover":"isout"]=0;this[e=="isover"?"_over":"_out"].call(this,b);if(f&&e=="isout")f.isout=0,f.isover=1,f._over.call(f,b)}}})},dragStop:function(a,b){a.element.parents(":not(body,html)").unbind("scroll.droppable");a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a, b)}}})(jQuery); (function(d){d.widget("ui.panel",{options:{event:"click",collapsible:!0,collapseType:"default",collapsed:!1,accordion:!1,collapseSpeed:"fast",draggable:!1,trueVerticalText:!0,vHeight:"220px",stackable:!0,width:"auto",controls:!1,cookie:null,widgetClass:"ui-helper-reset ui-widget ui-panel",headerClass:"ui-helper-reset ui-widget-header ui-panel-header ui-corner-top",contentClass:"ui-helper-reset ui-widget-content ui-panel-content ui-corner-bottom",contentTextClass:"ui-panel-content-text",rightboxClass:"ui-panel-rightbox", controlsClass:"ui-panel-controls",titleClass:"ui-panel-title",titleTextClass:"ui-panel-title-text",iconClass:"ui-icon",hoverClass:"ui-state-hover",collapsePnlClass:"ui-panel-clps-pnl",headerIconClpsd:"ui-icon-triangle-1-e",headerIcon:"ui-icon-triangle-1-s",slideRIconClpsd:"ui-icon-arrowthickstop-1-w",slideRIcon:"ui-icon-arrowthickstop-1-e",slideLIconClpsd:"ui-icon-arrowthickstop-1-e",slideLIcon:"ui-icon-arrowthickstop-1-w"},_init:function(){this._panelize()},_panelize:function(){if(this.element.is("div")){var a= this,b=this.options;this.panelBox=this.element;b.width=="auto"?b.width=this.panelBox.css("width"):this.panelBox.css("width",b.width);this.panelBox.attr("role","panel");b.id=this.panelBox.attr("id");this.headerBox=this.element.children(":first");this.contentBox=this.element.children().eq(1);b.content=this.contentBox.html();this.contentBox.wrapInner("<div/>");this.contentTextBox=this.contentBox.children(":first").addClass(b.contentTextClass);this.headerBox.wrapInner("<div><span/></div>");this.titleBox= this.headerBox.children(":first");this.titleTextBox=this.titleBox.children(":first");this.titleText=this.titleTextBox.html();this.headerBox.prepend("<span/>");this.rightBox=this.headerBox.children(":first").addClass(b.rightboxClass);b.controls!=!1?(this.rightBox.append("<span/>"),this.controlsBox=this.rightBox.children(":first").addClass(b.controlsClass).html(b.controls)):this.controlsBox=null;this.panelBox.addClass(b.widgetClass);this.headerBox.addClass(b.headerClass);this.titleBox.addClass(b.titleClass); this.titleTextBox.addClass(b.titleTextClass);this.contentBox.addClass(b.contentClass);if(b.collapsible){switch(b.collapseType){case "slide-right":var e=0;b.controls&&(e=1);this.rightBox.append("<span><span/></span>");this.collapsePanel=this.rightBox.children().eq(e).addClass(b.collapsePnlClass);this.collapseButton=this.collapsePanel.children(":first").addClass(b.slideRIcon);this.iconBtnClpsd=b.slideRIconClpsd;this.iconBtn=b.slideRIcon;this.ctrlBox=this.controlsBox;break;case "slide-left":this.headerBox.prepend("<span><span/></span>"); this.collapsePanel=this.headerBox.children(":first").addClass(b.collapsePnlClass);this.collapseButton=this.collapsePanel.children(":first").addClass(b.slideLIcon);this.iconBtnClpsd=b.slideLIconClpsd;this.iconBtn=b.slideLIcon;this.ctrlBox=this.rightBox;break;default:this.headerBox.prepend("<span><span/></span>"),this.collapseButton=this.headerBox.children(":first").addClass(b.headerIcon),this.iconBtnClpsd=b.headerIconClpsd,this.iconBtn=b.headerIcon,this.ctrlBox=this.controlsBox}this._buttonHover(this.collapseButton); this.collapseButton.addClass(b.iconClass);b.event&&(this.collapseButton.bind(b.event+".panel",function(d){return a._clickHandler.call(a,d,this)}),this.titleTextBox.bind(b.event+".panel",function(d){return a._clickHandler.call(a,d,this)}));if(b.accordion)b.collapsed=!0,b.trueVerticalText=!1;if(b.cookie)b.collapsed=a._cookie()==0?!1:!0;this.panelBox.data("collapsed",b.collapsed);if(b.stackable&&d.inArray(b.collapseType,["slide-right","slide-left"])>-1){this.panelDock=this.panelBox.siblings("div[role=panelDock]:first"); this.panelFrame=this.panelBox.siblings("div[role=panelFrame]:first");if(this.panelDock.length==0)this.panelDock=this.panelBox.parent(0).prepend("<div>").children(":first"),this.panelFrame=this.panelDock.after("<div>").next(":first"),this.panelDock.attr("role","panelDock").css("float",b.collapseType=="slide-left"?"left":"right"),this.panelFrame.attr("role","panelFrame").css({"float":b.collapseType=="slide-left"?"left":"right",overflow:"hidden"});b.collapsed?this.panelDock.append(this.panelBox):this.panelFrame.append(this.panelBox)}b.collapsed&& a.toggle(0,!0)}else this.titleTextBox.css("cursor","default");!b.accordion&&b.draggable&&d.fn.draggable&&this._makeDraggable();this.panelBox.show()}},_cookie:function(){var a=this.cookie||(this.cookie=this.options.cookie.name||"ui-panel-"+this.options.id);return d.cookie.apply(null,[a].concat(d.makeArray(arguments)))},_makeDraggable:function(){this.panelBox.draggable({containment:"document",handle:".ui-panel-header",cancel:".ui-panel-content",cursor:"move"});this.contentBox.css("position","absolute")}, _clickHandler:function(){var a=this.options;if(a.disabled)return!1;this.toggle(a.collapseSpeed);return!1},toggle:function(a,b){var e=this.options,f=this.panelBox,h=this.contentBox,g=this.headerBox,i=this.titleTextBox,j=this.titleText,k=this.ctrlBox,l=this.panelDock,m="";jQuery.support.leadingWhitespace||(m="-ie");h.css("display")=="none"?this._trigger("unfold"):this._trigger("fold");k&&k.toggle(0);e.collapseType=="default"?a==0?(k&&k.hide(),h.hide()):h.slideToggle(a):(a==0?(e.collapsed=!1,k&&k.hide(), h.hide()):h.toggle(),e.collapsed==!1?(e.trueVerticalText?(g.toggleClass("ui-panel-vtitle").css("height",e.vHeight),m==""&&(h="height:"+(parseInt(e.vHeight)-50)+"px;width:100%;position:absolute;bottom:0;left:0;",i.empty().append('<div style="'+h+'z-index:3;"></div><object style="'+h+'z-index:2;" type="image/svg+xml" data="data:image/svg+xml;charset=utf-8,<svg xmlns=\'http://www.w3.org/2000/svg\'><text x=\'-'+(parseInt(e.vHeight)-60)+"px' y='16px' style='font-weight:"+i.css("font-weight")+";font-family:"+ i.css("font-family").replace(/"/g,"")+";font-size:"+i.css("font-size")+";fill:"+i.css("color")+";' transform='rotate(-90)' text-rendering='optimizeSpeed'>"+j+'</text></svg>"></object>').css("height",e.vHeight)),i.toggleClass("ui-panel-vtext"+m)):(g.attr("align","center"),i.html(i.text().replace(/(.)/g,"$1<BR>"))),f.animate({width:"2.4em"},a),e.stackable&&(b?l.append(f):l.prepend(f))):(e.stackable&&this.panelFrame.append(f),e.trueVerticalText?(g.toggleClass("ui-panel-vtitle").css("height","auto"), i.empty().append(j),i.toggleClass("ui-panel-vtext"+m)):(g.attr("align","left"),i.html(i.text().replace(/<BR>/g," "))),f.animate({width:e.width},a)));if((a!=0||e.trueVerticalText)&&e.cookie==null||!b&&e.cookie!=null)e.collapsed=!e.collapsed;this.panelBox.data("collapsed",e.collapsed);b||(e.cookie&&this._cookie(Number(e.collapsed),e.cookie),e.accordion&&d("."+e.accordion+"[role='panel'][id!='"+e.id+"']:not(:data(collapsed))").panel("toggle",a,!0));this.collapseButton.toggleClass(this.iconBtnClpsd).toggleClass(this.iconBtn); g.toggleClass("ui-corner-all")},content:function(a){this.contentTextBox.html(a)},destroy:function(){var a=this.options;this.headerBox.html(this.titleText).removeAttr("align").removeAttr("style").removeClass("ui-panel-vtitle ui-corner-all "+a.headerClass);this.contentBox.removeClass(a.contentClass).removeAttr("style").html(a.content);this.panelBox.removeAttr("role").removeAttr("style").removeData("collapsed").unbind(".panel").removeClass(a.widgetClass);a.stackable&&d.inArray(a.collapseType,["slide-right", "slide-left"])>-1&&(this.panelDock.before(this.panelBox),this.panelDock.children("div[role=panel]").length==0&&this.panelFrame.children("div[role=panel]").length==0&&(this.panelDock.remove(),this.panelFrame.remove()));a.cookie&&this._cookie(null,a.cookie);return this},_buttonHover:function(a){var b=this.options;a.bind({mouseover:function(){d(this).addClass(b.hoverClass)},mouseout:function(){d(this).removeClass(b.hoverClass)}})}});d.extend(d.ui.panel,{version:"0.6"})})(jQuery); (function(d){d.ui=d.ui||{};var a=/left|center|right/,b=/top|center|bottom/,e=d.fn.position,f=d.fn.offset;d.fn.position=function(f){if(!f||!f.of)return e.apply(this,arguments);var f=d.extend({},f),g=d(f.of),i=g[0],j=(f.collision||"flip").split(" "),k=f.offset?f.offset.split(" "):[0,0],l,m,o;i.nodeType===9?(l=g.width(),m=g.height(),o={top:0,left:0}):i.setTimeout?(l=g.width(),m=g.height(),o={top:g.scrollTop(),left:g.scrollLeft()}):i.preventDefault?(f.at="left top",l=m=0,o={top:f.of.pageY,left:f.of.pageX}): (l=g.outerWidth(),m=g.outerHeight(),o=g.offset());d.each(["my","at"],function(){var d=(f[this]||"").split(" ");d.length===1&&(d=a.test(d[0])?d.concat(["center"]):b.test(d[0])?["center"].concat(d):["center","center"]);d[0]=a.test(d[0])?d[0]:"center";d[1]=b.test(d[1])?d[1]:"center";f[this]=d});j.length===1&&(j[1]=j[0]);k[0]=parseInt(k[0],10)||0;k.length===1&&(k[1]=k[0]);k[1]=parseInt(k[1],10)||0;f.at[0]==="right"?o.left+=l:f.at[0]==="center"&&(o.left+=l/2);f.at[1]==="bottom"?o.top+=m:f.at[1]==="center"&& (o.top+=m/2);o.left+=k[0];o.top+=k[1];return this.each(function(){var a=d(this),b=a.outerWidth(),e=a.outerHeight(),g=parseInt(d.curCSS(this,"marginLeft",!0))||0,i=parseInt(d.curCSS(this,"marginTop",!0))||0,q=b+g+(parseInt(d.curCSS(this,"marginRight",!0))||0),w=e+i+(parseInt(d.curCSS(this,"marginBottom",!0))||0),s=d.extend({},o),v;f.my[0]==="right"?s.left-=b:f.my[0]==="center"&&(s.left-=b/2);f.my[1]==="bottom"?s.top-=e:f.my[1]==="center"&&(s.top-=e/2);s.left=Math.round(s.left);s.top=Math.round(s.top); v={left:s.left-g,top:s.top-i};d.each(["left","top"],function(a,g){if(d.ui.position[j[a]])d.ui.position[j[a]][g](s,{targetWidth:l,targetHeight:m,elemWidth:b,elemHeight:e,collisionPosition:v,collisionWidth:q,collisionHeight:w,offset:k,my:f.my,at:f.at})});d.fn.bgiframe&&a.bgiframe();a.offset(d.extend(s,{using:f.using}))})};d.ui.position={fit:{left:function(a,b){var e=d(window),e=b.collisionPosition.left+b.collisionWidth-e.width()-e.scrollLeft();a.left=e>0?a.left-e:Math.max(a.left-b.collisionPosition.left, a.left)},top:function(a,b){var e=d(window),e=b.collisionPosition.top+b.collisionHeight-e.height()-e.scrollTop();a.top=e>0?a.top-e:Math.max(a.top-b.collisionPosition.top,a.top)}},flip:{left:function(a,b){if(b.at[0]!=="center"){var e=d(window),e=b.collisionPosition.left+b.collisionWidth-e.width()-e.scrollLeft(),f=b.my[0]==="left"?-b.elemWidth:b.my[0]==="right"?b.elemWidth:0,k=b.at[0]==="left"?b.targetWidth:-b.targetWidth,l=-2*b.offset[0];a.left+=b.collisionPosition.left<0?f+k+l:e>0?f+k+l:0}},top:function(a, b){if(b.at[1]!=="center"){var e=d(window),e=b.collisionPosition.top+b.collisionHeight-e.height()-e.scrollTop(),f=b.my[1]==="top"?-b.elemHeight:b.my[1]==="bottom"?b.elemHeight:0,k=b.at[1]==="top"?b.targetHeight:-b.targetHeight,l=-2*b.offset[1];a.top+=b.collisionPosition.top<0?f+k+l:e>0?f+k+l:0}}}};if(!d.offset.setOffset)d.offset.setOffset=function(a,b){if(/static/.test(d.curCSS(a,"position")))a.style.position="relative";var e=d(a),f=e.offset(),k=parseInt(d.curCSS(a,"top",!0),10)||0,l=parseInt(d.curCSS(a, "left",!0),10)||0,f={top:b.top-f.top+k,left:b.left-f.left+l};"using"in b?b.using.call(a,f):e.css(f)},d.fn.offset=function(a){var b=this[0];return!b||!b.ownerDocument?null:a?this.each(function(){d.offset.setOffset(this,a)}):f.call(this)}})(jQuery); (function(d,a){d.widget("ui.progressbar",{options:{value:0,max:100},min:0,_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.options.max,"aria-valuenow":this._value()});this.valueDiv=d("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();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();d.Widget.prototype.destroy.apply(this,arguments)},value:function(d){if(d===a)return this._value();this._setOption("value",d);return this},_setOption:function(a,e){if(a==="value")this.options.value=e,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete");d.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;typeof a!=="number"&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100* this._value()/this.options.max},_refreshValue:function(){var a=this.value(),d=this._percentage();if(this.oldValue!==a)this.oldValue=a,this._trigger("change");this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(d.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});d.extend(d.ui.progressbar,{version:"1.8.16"})})(jQuery); (function(d){d.widget("ui.resizable",d.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var a=this,b=this.options;this.element.addClass("ui-resizable");d.extend(this,{_aspectRatio:!!b.aspectRatio,aspectRatio:b.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[], _helper:b.helper||b.ghost||b.animate?b.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i))/relative/.test(this.element.css("position"))&&d.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"}),this.element.wrap(d('<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=!0,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=b.handles||(!d(".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 h=this.handles.split(",");this.handles={};for(var g=0;g<h.length;g++){var i=d.trim(h[g]),j=d('<div class="ui-resizable-handle ui-resizable-'+i+'"></div>');/sw|se|ne|nw/.test(i)&&j.css({zIndex:++b.zIndex});"se"==i&&j.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[i]=".ui-resizable-"+i;this.element.append(j)}}this._renderAxis=function(a){var a=a||this.element,b;for(b in this.handles){this.handles[b].constructor==String&&(this.handles[b]=d(this.handles[b], this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var e=d(this.handles[b],this.element),f=0,f=/sw|ne|nw|se|n|s/.test(b)?e.outerHeight():e.outerWidth(),e=["padding",/ne|nw|n/.test(b)?"Top":/se|sw|s/.test(b)?"Bottom":/^e$/.test(b)?"Right":"Left"].join("");a.css(e,f);this._proportionallyResize()}d(this.handles[b])}};this._renderAxis(this.element);this._handles=d(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!a.resizing){if(this.className)var d= this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);a.axis=d&&d[1]?d[1]:"se"}});b.autoHide&&(this._handles.hide(),d(this.element).addClass("ui-resizable-autohide").hover(function(){b.disabled||(d(this).removeClass("ui-resizable-autohide"),a._handles.show())},function(){!b.disabled&&!a.resizing&&(d(this).addClass("ui-resizable-autohide"),a._handles.hide())}));this._mouseInit()},destroy:function(){this._mouseDestroy();var a=function(a){d(a).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}; if(this.elementIsWrapper){a(this.element);var b=this.element;b.after(this.originalElement.css({position:b.css("position"),width:b.outerWidth(),height:b.outerHeight(),top:b.css("top"),left:b.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);a(this.originalElement);return this},_mouseCapture:function(a){var b=!1,h;for(h in this.handles)d(this.handles[h])[0]==a.target&&(b=!0);return!this.options.disabled&&b},_mouseStart:function(b){var f=this.options,h=this.element.position(), g=this.element;this.resizing=!0;this.documentScroll={top:d(document).scrollTop(),left:d(document).scrollLeft()};(g.is(".ui-draggable")||/absolute/.test(g.css("position")))&&g.css({position:"absolute",top:h.top,left:h.left});d.browser.opera&&/relative/.test(g.css("position"))&&g.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();var h=a(this.helper.css("left")),i=a(this.helper.css("top"));f.containment&&(h+=d(f.containment).scrollLeft()||0,i+=d(f.containment).scrollTop()||0);this.offset= this.helper.offset();this.position={left:h,top:i};this.size=this._helper?{width:g.outerWidth(),height:g.outerHeight()}:{width:g.width(),height:g.height()};this.originalSize=this._helper?{width:g.outerWidth(),height:g.outerHeight()}:{width:g.width(),height:g.height()};this.originalPosition={left:h,top:i};this.sizeDiff={width:g.outerWidth()-g.width(),height:g.outerHeight()-g.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof f.aspectRatio=="number"?f.aspectRatio: this.originalSize.width/this.originalSize.height||1;f=d(".ui-resizable-"+this.axis).css("cursor");d("body").css("cursor",f=="auto"?this.axis+"-resize":f);g.addClass("ui-resizable-resizing");this._propagate("start",b);return!0},_mouseDrag:function(a){var d=this.helper,b=this.originalMousePosition,g=this._change[this.axis];if(!g)return!1;b=g.apply(this,[a,a.pageX-b.left||0,a.pageY-b.top||0]);this._updateVirtualBoundaries(a.shiftKey);if(this._aspectRatio||a.shiftKey)b=this._updateRatio(b,a);b=this._respectSize(b, a);this._propagate("resize",a);d.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(b);this._trigger("resize",a,this.ui());return!1},_mouseStop:function(a){this.resizing=!1;var b=this.options;if(this._helper){var h=this._proportionallyResizeElements,g=h.length&&/textarea/i.test(h[0].nodeName),h=g&&d.ui.hasScroll(h[0],"left")?0: this.sizeDiff.height,g=g?0:this.sizeDiff.width,g={width:this.helper.width()-g,height:this.helper.height()-h},h=parseInt(this.element.css("left"),10)+(this.position.left-this.originalPosition.left)||null,i=parseInt(this.element.css("top"),10)+(this.position.top-this.originalPosition.top)||null;b.animate||this.element.css(d.extend(g,{top:i,left:h}));this.helper.height(this.size.height);this.helper.width(this.size.width);this._helper&&!b.animate&&this._proportionallyResize()}d("body").css("cursor","auto"); this.element.removeClass("ui-resizable-resizing");this._propagate("stop",a);this._helper&&this.helper.remove();return!1},_updateVirtualBoundaries:function(a){var d=this.options,h,g,i,d={minWidth:b(d.minWidth)?d.minWidth:0,maxWidth:b(d.maxWidth)?d.maxWidth:Infinity,minHeight:b(d.minHeight)?d.minHeight:0,maxHeight:b(d.maxHeight)?d.maxHeight:Infinity};if(this._aspectRatio||a){a=d.minHeight*this.aspectRatio;g=d.minWidth/this.aspectRatio;h=d.maxHeight*this.aspectRatio;i=d.maxWidth/this.aspectRatio;if(a> d.minWidth)d.minWidth=a;if(g>d.minHeight)d.minHeight=g;if(h<d.maxWidth)d.maxWidth=h;if(i<d.maxHeight)d.maxHeight=i}this._vBoundaries=d},_updateCache:function(a){this.offset=this.helper.offset();if(b(a.left))this.position.left=a.left;if(b(a.top))this.position.top=a.top;if(b(a.height))this.size.height=a.height;if(b(a.width))this.size.width=a.width},_updateRatio:function(a){var d=this.position,h=this.size,g=this.axis;if(b(a.height))a.width=a.height*this.aspectRatio;else if(b(a.width))a.height=a.width/ this.aspectRatio;if(g=="sw")a.left=d.left+(h.width-a.width),a.top=null;if(g=="nw")a.top=d.top+(h.height-a.height),a.left=d.left+(h.width-a.width);return a},_respectSize:function(a){var d=this._vBoundaries,h=this.axis,g=b(a.width)&&d.maxWidth&&d.maxWidth<a.width,i=b(a.height)&&d.maxHeight&&d.maxHeight<a.height,j=b(a.width)&&d.minWidth&&d.minWidth>a.width,k=b(a.height)&&d.minHeight&&d.minHeight>a.height;if(j)a.width=d.minWidth;if(k)a.height=d.minHeight;if(g)a.width=d.maxWidth;if(i)a.height=d.maxHeight; var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,o=/sw|nw|w/.test(h),h=/nw|ne|n/.test(h);if(j&&o)a.left=l-d.minWidth;if(g&&o)a.left=l-d.maxWidth;if(k&&h)a.top=m-d.minHeight;if(i&&h)a.top=m-d.maxHeight;if((d=!a.width&&!a.height)&&!a.left&&a.top)a.top=null;else if(d&&!a.top&&a.left)a.left=null;return a},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var a=this.helper||this.element,b=0;b<this._proportionallyResizeElements.length;b++){var h= this._proportionallyResizeElements[b];if(!this.borderDif){var g=[h.css("borderTopWidth"),h.css("borderRightWidth"),h.css("borderBottomWidth"),h.css("borderLeftWidth")],i=[h.css("paddingTop"),h.css("paddingRight"),h.css("paddingBottom"),h.css("paddingLeft")];this.borderDif=d.map(g,function(a,d){var b=parseInt(a,10)||0,e=parseInt(i[d],10)||0;return b+e})}if(!d.browser.msie||!d(a).is(":hidden")&&!d(a).parents(":hidden").length)h.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()- this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var a=this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||d('<div style="overflow:hidden;"></div>');var b=d.browser.msie&&d.browser.version<7,h=b?1:0,b=b?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+b,height:this.element.outerHeight()+b,position:"absolute",left:this.elementOffset.left-h+"px",top:this.elementOffset.top-h+"px",zIndex:++a.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper= this.element},_change:{e:function(a,d){return{width:this.originalSize.width+d}},w:function(a,d){return{left:this.originalPosition.left+d,width:this.originalSize.width-d}},n:function(a,d,b){return{top:this.originalPosition.top+b,height:this.originalSize.height-b}},s:function(a,d,b){return{height:this.originalSize.height+b}},se:function(a,b,h){return d.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[a,b,h]))},sw:function(a,b,h){return d.extend(this._change.s.apply(this,arguments), this._change.w.apply(this,[a,b,h]))},ne:function(a,b,h){return d.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[a,b,h]))},nw:function(a,b,h){return d.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[a,b,h]))}},_propagate:function(a,b){d.ui.plugin.call(this,a,[b,this.ui()]);a!="resize"&&this._trigger(a,b,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}}});d.extend(d.ui.resizable,{version:"1.8.16"});d.ui.plugin.add("resizable","alsoResize",{start:function(){var a=d(this).data("resizable").options,b=function(a){d(a).each(function(){var a=d(this);a.data("resizable-alsoresize",{width:parseInt(a.width(),10),height:parseInt(a.height(),10),left:parseInt(a.css("left"),10),top:parseInt(a.css("top"),10),position:a.css("position")})})};typeof a.alsoResize=="object"&&!a.alsoResize.parentNode? a.alsoResize.length?(a.alsoResize=a.alsoResize[0],b(a.alsoResize)):d.each(a.alsoResize,function(a){b(a)}):b(a.alsoResize)},resize:function(a,b){var h=d(this).data("resizable"),g=h.options,i=h.originalSize,j=h.originalPosition,k={height:h.size.height-i.height||0,width:h.size.width-i.width||0,top:h.position.top-j.top||0,left:h.position.left-j.left||0},l=function(a,e){d(a).each(function(){var a=d(this),g=d(this).data("resizable-alsoresize"),i={},m=e&&e.length?e:a.parents(b.originalElement[0]).length? ["width","height"]:["width","height","top","left"];d.each(m,function(a,d){var b=(g[d]||0)+(k[d]||0);b&&b>=0&&(i[d]=b||null)});if(d.browser.opera&&/relative/.test(a.css("position")))h._revertToRelativePosition=!0,a.css({position:"absolute",top:"auto",left:"auto"});a.css(i)})};typeof g.alsoResize=="object"&&!g.alsoResize.nodeType?d.each(g.alsoResize,function(a,d){l(a,d)}):l(g.alsoResize)},stop:function(){var a=d(this).data("resizable"),b=a.options,h=function(a){d(a).each(function(){var a=d(this);a.css({position:a.data("resizable-alsoresize").position})})}; if(a._revertToRelativePosition)a._revertToRelativePosition=!1,typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?d.each(b.alsoResize,function(a){h(a)}):h(b.alsoResize);d(this).removeData("resizable-alsoresize")}});d.ui.plugin.add("resizable","animate",{stop:function(a){var b=d(this).data("resizable"),h=b.options,g=b._proportionallyResizeElements,i=g.length&&/textarea/i.test(g[0].nodeName),j=i&&d.ui.hasScroll(g[0],"left")?0:b.sizeDiff.height,i={width:b.size.width-(i?0:b.sizeDiff.width),height:b.size.height- j},j=parseInt(b.element.css("left"),10)+(b.position.left-b.originalPosition.left)||null,k=parseInt(b.element.css("top"),10)+(b.position.top-b.originalPosition.top)||null;b.element.animate(d.extend(i,k&&j?{top:k,left:j}:{}),{duration:h.animateDuration,easing:h.animateEasing,step:function(){var h={width:parseInt(b.element.css("width"),10),height:parseInt(b.element.css("height"),10),top:parseInt(b.element.css("top"),10),left:parseInt(b.element.css("left"),10)};g&&g.length&&d(g[0]).css({width:h.width, height:h.height});b._updateCache(h);b._propagate("resize",a)}})}});d.ui.plugin.add("resizable","containment",{start:function(){var b=d(this).data("resizable"),f=b.element,h=b.options.containment;if(f=h instanceof d?h.get(0):/parent/.test(h)?f.parent().get(0):h)if(b.containerElement=d(f),/document/.test(h)||h==document)b.containerOffset={left:0,top:0},b.containerPosition={left:0,top:0},b.parentData={element:d(document),left:0,top:0,width:d(document).width(),height:d(document).height()||document.body.parentNode.scrollHeight}; else{var g=d(f),i=[];d(["Top","Right","Left","Bottom"]).each(function(d,b){i[d]=a(g.css("padding"+b))});b.containerOffset=g.offset();b.containerPosition=g.position();b.containerSize={height:g.innerHeight()-i[3],width:g.innerWidth()-i[1]};var h=b.containerOffset,j=b.containerSize.height,k=b.containerSize.width,k=d.ui.hasScroll(f,"left")?f.scrollWidth:k,j=d.ui.hasScroll(f)?f.scrollHeight:j;b.parentData={element:f,left:h.left,top:h.top,width:k,height:j}}},resize:function(a){var b=d(this).data("resizable"), h=b.options,g=b.containerOffset,i=b.position,a=b._aspectRatio||a.shiftKey,j={top:0,left:0},k=b.containerElement;k[0]!=document&&/static/.test(k.css("position"))&&(j=g);if(i.left<(b._helper?g.left:0)){b.size.width+=b._helper?b.position.left-g.left:b.position.left-j.left;if(a)b.size.height=b.size.width/h.aspectRatio;b.position.left=h.helper?g.left:0}if(i.top<(b._helper?g.top:0)){b.size.height+=b._helper?b.position.top-g.top:b.position.top;if(a)b.size.width=b.size.height*h.aspectRatio;b.position.top= b._helper?g.top:0}b.offset.left=b.parentData.left+b.position.left;b.offset.top=b.parentData.top+b.position.top;h=Math.abs((b._helper?b.offset.left-j.left:b.offset.left-j.left)+b.sizeDiff.width);g=Math.abs((b._helper?b.offset.top-j.top:b.offset.top-g.top)+b.sizeDiff.height);i=b.containerElement.get(0)==b.element.parent().get(0);j=/relative|absolute/.test(b.containerElement.css("position"));i&&j&&(h-=b.parentData.left);if(h+b.size.width>=b.parentData.width&&(b.size.width=b.parentData.width-h,a))b.size.height= b.size.width/b.aspectRatio;if(g+b.size.height>=b.parentData.height&&(b.size.height=b.parentData.height-g,a))b.size.width=b.size.height*b.aspectRatio},stop:function(){var a=d(this).data("resizable"),b=a.options,h=a.containerOffset,g=a.containerPosition,i=a.containerElement,j=d(a.helper),k=j.offset(),l=j.outerWidth()-a.sizeDiff.width,j=j.outerHeight()-a.sizeDiff.height;a._helper&&!b.animate&&/relative/.test(i.css("position"))&&d(this).css({left:k.left-g.left-h.left,width:l,height:j});a._helper&&!b.animate&& /static/.test(i.css("position"))&&d(this).css({left:k.left-g.left-h.left,width:l,height:j})}});d.ui.plugin.add("resizable","ghost",{start:function(){var a=d(this).data("resizable"),b=a.options,h=a.size;a.ghost=a.originalElement.clone();a.ghost.css({opacity:0.25,display:"block",position:"relative",height:h.height,width:h.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof b.ghost=="string"?b.ghost:"");a.ghost.appendTo(a.helper)},resize:function(){var a=d(this).data("resizable"); a.ghost&&a.ghost.css({position:"relative",height:a.size.height,width:a.size.width})},stop:function(){var a=d(this).data("resizable");a.ghost&&a.helper&&a.helper.get(0).removeChild(a.ghost.get(0))}});d.ui.plugin.add("resizable","grid",{resize:function(){var a=d(this).data("resizable"),b=a.options,h=a.size,g=a.originalSize,i=a.originalPosition,j=a.axis;b.grid=typeof b.grid=="number"?[b.grid,b.grid]:b.grid;var k=Math.round((h.width-g.width)/(b.grid[0]||1))*(b.grid[0]||1),b=Math.round((h.height-g.height)/ (b.grid[1]||1))*(b.grid[1]||1);/^(se|s|e)$/.test(j)?(a.size.width=g.width+k,a.size.height=g.height+b):/^(ne)$/.test(j)?(a.size.width=g.width+k,a.size.height=g.height+b,a.position.top=i.top-b):(/^(sw)$/.test(j)?(a.size.width=g.width+k,a.size.height=g.height+b):(a.size.width=g.width+k,a.size.height=g.height+b,a.position.top=i.top-b),a.position.left=i.left-k)}});var a=function(a){return parseInt(a,10)||0},b=function(a){return!isNaN(parseInt(a,10))}})(jQuery); (function(d){d.widget("ui.selectable",d.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var a=this;this.element.addClass("ui-selectable");this.dragged=!1;var b;this.refresh=function(){b=d(a.options.filter,a.element[0]);b.each(function(){var a=d(this),b=a.offset();d.data(this,"selectable-item",{element:this,$element:a,left:b.left,top:b.top,right:b.left+a.outerWidth(),bottom:b.top+a.outerHeight(),startselected:!1,selected:a.hasClass("ui-selected"), selecting:a.hasClass("ui-selecting"),unselecting:a.hasClass("ui-unselecting")})})};this.refresh();this.selectees=b.addClass("ui-selectee");this._mouseInit();this.helper=d("<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(a){var b=this;this.opos=[a.pageX, a.pageY];if(!this.options.disabled){var e=this.options;this.selectees=d(e.filter,this.element[0]);this._trigger("start",a);d(e.appendTo).append(this.helper);this.helper.css({left:a.clientX,top:a.clientY,width:0,height:0});e.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var e=d.data(this,"selectable-item");e.startselected=!0;if(!a.metaKey)e.$element.removeClass("ui-selected"),e.selected=!1,e.$element.addClass("ui-unselecting"),e.unselecting=!0,b._trigger("unselecting", a,{unselecting:e.element})});d(a.target).parents().andSelf().each(function(){var e=d.data(this,"selectable-item");if(e){var h=!a.metaKey||!e.$element.hasClass("ui-selected");e.$element.removeClass(h?"ui-unselecting":"ui-selected").addClass(h?"ui-selecting":"ui-unselecting");e.unselecting=!h;e.selecting=h;(e.selected=h)?b._trigger("selecting",a,{selecting:e.element}):b._trigger("unselecting",a,{unselecting:e.element});return!1}})}},_mouseDrag:function(a){var b=this;this.dragged=!0;if(!this.options.disabled){var e= this.options,f=this.opos[0],h=this.opos[1],g=a.pageX,i=a.pageY;if(f>g)var j=g,g=f,f=j;h>i&&(j=i,i=h,h=j);this.helper.css({left:f,top:h,width:g-f,height:i-h});this.selectees.each(function(){var j=d.data(this,"selectable-item");if(j&&j.element!=b.element[0]){var l=!1;e.tolerance=="touch"?l=!(j.left>g||j.right<f||j.top>i||j.bottom<h):e.tolerance=="fit"&&(l=j.left>f&&j.right<g&&j.top>h&&j.bottom<i);if(l){if(j.selected)j.$element.removeClass("ui-selected"),j.selected=!1;if(j.unselecting)j.$element.removeClass("ui-unselecting"), j.unselecting=!1;if(!j.selecting)j.$element.addClass("ui-selecting"),j.selecting=!0,b._trigger("selecting",a,{selecting:j.element})}else{if(j.selecting)if(a.metaKey&&j.startselected)j.$element.removeClass("ui-selecting"),j.selecting=!1,j.$element.addClass("ui-selected"),j.selected=!0;else{j.$element.removeClass("ui-selecting");j.selecting=!1;if(j.startselected)j.$element.addClass("ui-unselecting"),j.unselecting=!0;b._trigger("unselecting",a,{unselecting:j.element})}if(j.selected&&!a.metaKey&&!j.startselected)j.$element.removeClass("ui-selected"), j.selected=!1,j.$element.addClass("ui-unselecting"),j.unselecting=!0,b._trigger("unselecting",a,{unselecting:j.element})}}});return!1}},_mouseStop:function(a){var b=this;this.dragged=!1;d(".ui-unselecting",this.element[0]).each(function(){var e=d.data(this,"selectable-item");e.$element.removeClass("ui-unselecting");e.unselecting=!1;e.startselected=!1;b._trigger("unselected",a,{unselected:e.element})});d(".ui-selecting",this.element[0]).each(function(){var e=d.data(this,"selectable-item");e.$element.removeClass("ui-selecting").addClass("ui-selected"); e.selecting=!1;e.selected=!0;e.startselected=!0;b._trigger("selected",a,{selected:e.element})});this._trigger("stop",a);this.helper.remove();return!1}});d.extend(d.ui.selectable,{version:"1.8.16"})})(jQuery); (function(d){d.widget("ui.selectmenu",{getter:"value",version:"1.8",eventPrefix:"selectmenu",options:{transferClasses:!0,typeAhead:"sequential",style:"dropdown",positionOptions:{my:"left top",at:"left bottom",offset:null},width:null,menuWidth:null,handleWidth:26,maxHeight:null,icons:null,format:null,bgImage:function(){},wrapperElement:"<div />"},_create:function(){var a=this,b=this.options,e=this.element.attr("id")||"ui-selectmenu-"+Math.random().toString(16).slice(2,10);this.ids=[e+"-button",e+"-menu"]; this._safemouseup=!0;this.newelement=d("<a />",{"class":this.widgetBaseClass+" ui-widget ui-state-default ui-corner-all",id:this.ids[0],role:"button",href:"#",tabindex:this.element.attr("disabled")?1:0,"aria-haspopup":!0,"aria-owns":this.ids[1]});this.newelementWrap=d(b.wrapperElement).append(this.newelement).insertAfter(this.element);var f=this.element.attr("tabindex");f&&this.newelement.attr("tabindex",f);this.newelement.data("selectelement",this.element);this.selectmenuIcon=d('<span class="'+this.widgetBaseClass+ '-icon ui-icon"></span>').prependTo(this.newelement);this.newelement.prepend('<span class="'+a.widgetBaseClass+'-status" />');d('label[for="'+e+'"]').attr("for",this.ids[0]).bind("click.selectmenu",function(){a.newelement[0].focus();return!1});this.newelement.bind("mousedown.selectmenu",function(d){a._toggle(d,!0);if(b.style=="popup")a._safemouseup=!1,setTimeout(function(){a._safemouseup=!0},300);return!1}).bind("click.selectmenu",function(){return!1}).bind("keydown.selectmenu",function(b){var e= !1;switch(b.keyCode){case d.ui.keyCode.ENTER:e=!0;break;case d.ui.keyCode.SPACE:a._toggle(b);break;case d.ui.keyCode.UP:b.altKey?a.open(b):a._moveSelection(-1);break;case d.ui.keyCode.DOWN:b.altKey?a.open(b):a._moveSelection(1);break;case d.ui.keyCode.LEFT:a._moveSelection(-1);break;case d.ui.keyCode.RIGHT:a._moveSelection(1);break;case d.ui.keyCode.TAB:e=!0;break;default:e=!0}return e}).bind("keypress.selectmenu",function(b){a._typeAhead(b.which,"mouseup");return!0}).bind("mouseover.selectmenu focus.selectmenu", function(){b.disabled||d(this).addClass(a.widgetBaseClass+"-focus ui-state-hover")}).bind("mouseout.selectmenu blur.selectmenu",function(){b.disabled||d(this).removeClass(a.widgetBaseClass+"-focus ui-state-hover")});d(document).bind("mousedown.selectmenu",function(b){a.close(b)});this.element.bind("click.selectmenu",function(){a._refreshValue()}).bind("focus.selectmenu",function(){a.newelement&&a.newelement[0].focus()});if(!b.width)b.width=this.element.outerWidth();this.newelement.width(b.width); this.element.hide();this.list=d("<ul />",{"class":"ui-widget ui-widget-content","aria-hidden":!0,role:"listbox","aria-labelledby":this.ids[0],id:this.ids[1]});this.listWrap=d(b.wrapperElement).addClass(a.widgetBaseClass+"-menu").append(this.list).appendTo("body");this.list.bind("keydown.selectmenu",function(b){var e=!1;switch(b.keyCode){case d.ui.keyCode.UP:b.altKey?a.close(b,!0):a._moveFocus(-1);break;case d.ui.keyCode.DOWN:b.altKey?a.close(b,!0):a._moveFocus(1);break;case d.ui.keyCode.LEFT:a._moveFocus(-1); break;case d.ui.keyCode.RIGHT:a._moveFocus(1);break;case d.ui.keyCode.HOME:a._moveFocus(":first");break;case d.ui.keyCode.PAGE_UP:a._scrollPage("up");break;case d.ui.keyCode.PAGE_DOWN:a._scrollPage("down");break;case d.ui.keyCode.END:a._moveFocus(":last");break;case d.ui.keyCode.ENTER:case d.ui.keyCode.SPACE:a.close(b,!0);d(b.target).parents("li:eq(0)").trigger("mouseup");break;case d.ui.keyCode.TAB:e=!0;a.close(b,!0);d(b.target).parents("li:eq(0)").trigger("mouseup");break;case d.ui.keyCode.ESCAPE:a.close(b, !0);break;default:e=!0}return e}).bind("keypress.selectmenu",function(b){a._typeAhead(b.which,"focus");return!0}).bind("mousedown.selectmenu mouseup.selectmenu",function(){return!1})},_init:function(){var a=this,b=this.options,e=[];this.element.find("option").each(function(){var f=d(this);e.push({value:f.attr("value"),text:a._formatText(f.text()),selected:f.attr("selected"),disabled:f.attr("disabled"),classes:f.attr("class"),typeahead:f.attr("typeahead"),parentOptGroup:f.parent("optgroup"),bgImage:b.bgImage.call(f)})}); var f=a.options.style=="popup"?" ui-state-active":"";this.list.html("");if(e.length)for(var h=0;h<e.length;h++){var g={role:"presentation"};e[h].disabled&&(g["class"]=this.namespace+"-state-disabled");var i={html:e[h].text,href:"#",tabindex:-1,role:"option","aria-selected":!1};if(e[h].disabled)i["aria-disabled"]=e[h].disabled;if(e[h].typeahead)i.typeahead=e[h].typeahead;i=d("<a/>",i);g=d("<li/>",g).append(i).data("index",h).addClass(e[h].classes).data("optionClasses",e[h].classes||"").bind("mouseup.selectmenu", function(b){if(a._safemouseup&&!a._disabled(b.currentTarget)&&!a._disabled(d(b.currentTarget).parents("ul>li."+a.widgetBaseClass+"-group "))){var e=d(this).data("index")!=a._selectedIndex();a.index(d(this).data("index"));a.select(b);e&&a.change(b);a.close(b,!0)}return!1}).bind("click.selectmenu",function(){return!1}).bind("mouseover.selectmenu focus.selectmenu",function(b){!d(b.currentTarget).hasClass(a.namespace+"-state-disabled")&&!d(b.currentTarget).parent("ul").parent("li").hasClass(a.namespace+ "-state-disabled")&&(a._selectedOptionLi().addClass(f),a._focusedOptionLi().removeClass(a.widgetBaseClass+"-item-focus ui-state-hover"),d(this).removeClass("ui-state-active").addClass(a.widgetBaseClass+"-item-focus ui-state-hover"))}).bind("mouseout.selectmenu blur.selectmenu",function(){d(this).is(a._selectedOptionLi().selector)&&d(this).addClass(f);d(this).removeClass(a.widgetBaseClass+"-item-focus ui-state-hover")});e[h].parentOptGroup.length?(i=a.widgetBaseClass+"-group-"+this.element.find("optgroup").index(e[h].parentOptGroup), this.list.find("li."+i).length?this.list.find("li."+i+":last ul").append(g):d(' <li role="presentation" class="'+a.widgetBaseClass+"-group "+i+(e[h].parentOptGroup.attr("disabled")?" "+this.namespace+'-state-disabled" aria-disabled="true"':'"')+'><span class="'+a.widgetBaseClass+'-group-label">'+e[h].parentOptGroup.attr("label")+"</span><ul></ul></li> ").appendTo(this.list).find("ul").append(g)):g.appendTo(this.list);if(b.icons)for(var j in b.icons)g.is(b.icons[j].find)&&(g.data("optionClasses",e[h].classes+ " "+a.widgetBaseClass+"-hasIcon").addClass(a.widgetBaseClass+"-hasIcon"),i=b.icons[j].icon||"",g.find("a:eq(0)").prepend('<span class="'+a.widgetBaseClass+"-item-icon ui-icon "+i+'"></span>'),e[h].bgImage&&g.find("span").css("background-image",e[h].bgImage))}else d('<li role="presentation"><a href="#" tabindex="-1" role="option"></a></li>').appendTo(this.list);h=b.style=="dropdown";this.newelement.toggleClass(a.widgetBaseClass+"-dropdown",h).toggleClass(a.widgetBaseClass+"-popup",!h);this.list.toggleClass(a.widgetBaseClass+ "-menu-dropdown ui-corner-bottom",h).toggleClass(a.widgetBaseClass+"-menu-popup ui-corner-all",!h).find("li:first").toggleClass("ui-corner-top",!h).end().find("li:last").addClass("ui-corner-bottom");this.selectmenuIcon.toggleClass("ui-icon-triangle-1-s",h).toggleClass("ui-icon-triangle-2-n-s",!h);b.transferClasses&&(h=this.element.attr("class")||"",this.newelement.add(this.list).addClass(h));b.style=="dropdown"?this.list.width(b.menuWidth?b.menuWidth:b.width):this.list.width(b.menuWidth?b.menuWidth: b.width-b.handleWidth);this.list.css("height","auto");h=this.listWrap.height();b.maxHeight&&b.maxHeight<h?this.list.height(b.maxHeight):(j=d(window).height()/3,j<h&&this.list.height(j));this._optionLis=this.list.find("li:not(."+a.widgetBaseClass+"-group)");this.element.attr("disabled")?this.disable():this.enable();this.index(this._selectedIndex());window.setTimeout(function(){a._refreshPosition()},200)},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+ this.namespace+"-state-disabled").removeAttr("aria-disabled").unbind(".selectmenu");d(document).unbind(".selectmenu");d("label[for="+this.newelement.attr("id")+"]").attr("for",this.element.attr("id")).unbind(".selectmenu");this.newelementWrap.remove();this.listWrap.remove();this.element.show();d.Widget.prototype.destroy.apply(this,arguments)},_typeAhead:function(a,b){var e=this,f=!1,h=String.fromCharCode(a).toUpperCase();c=h.toLowerCase();if(e.options.typeAhead=="sequential"){window.clearTimeout("ui.selectmenu-"+ e.selectmenuId);var g=typeof e._prevChar=="undefined"?"":e._prevChar.join(""),i=function(a,h,g){f=!0;d(a).trigger(b);typeof e._prevChar=="undefined"?e._prevChar=[g]:e._prevChar[e._prevChar.length]=g};this.list.find("li a").each(function(a){if(!f){var b=d(this).attr("typeahead")||d(this).text();b.indexOf(g+h)===0?i(this,a,h):b.indexOf(g+c)===0&&i(this,a,c)}});window.setTimeout(function(){e._prevChar=void 0},1E3,e)}else{if(!e._prevChar)e._prevChar=["",0];f=!1;this.list.find("li a").each(function(a){if(!f){var g= d(this).text();if(g.indexOf(h)===0||g.indexOf(c)===0)e._prevChar[0]==h?e._prevChar[1]<a&&(f=!0,d(this).trigger(b),e._prevChar[1]=a):(f=!0,d(this).trigger(b),e._prevChar[1]=a)}});this._prevChar[0]=h}},_uiHash:function(){var a=this.index();return{index:a,option:d("option",this.element).get(a),value:this.element[0].value}},open:function(a){var b=this.options;this.newelement.attr("aria-disabled")!="true"&&(this._closeOthers(a),this.newelement.addClass("ui-state-active"),this.listWrap.appendTo(b.appendTo), this.list.attr("aria-hidden",!1),b.style=="dropdown"&&this.newelement.removeClass("ui-corner-all").addClass("ui-corner-top"),this.listWrap.addClass(this.widgetBaseClass+"-open"),d.browser.msie&&d.browser.version.substr(0,1)==7&&this._refreshPosition(),b=this.list.attr("aria-hidden",!1).find("li:not(."+this.widgetBaseClass+"-group):eq("+this._selectedIndex()+"):visible a"),b.length&&b[0].focus(),this._refreshPosition(),this._trigger("open",a,this._uiHash()))},close:function(a,b){this.newelement.is(".ui-state-active")&& (this.newelement.removeClass("ui-state-active"),this.listWrap.removeClass(this.widgetBaseClass+"-open"),this.list.attr("aria-hidden",!0),this.options.style=="dropdown"&&this.newelement.removeClass("ui-corner-top").addClass("ui-corner-all"),b&&this.newelement.focus(),this._trigger("close",a,this._uiHash()))},change:function(a){this.element.trigger("change");this._trigger("change",a,this._uiHash())},select:function(a){if(this._disabled(a.currentTarget))return!1;this._trigger("select",a,this._uiHash())}, _closeOthers:function(a){d("."+this.widgetBaseClass+".ui-state-active").not(this.newelement).each(function(){d(this).data("selectelement").selectmenu("close",a)});d("."+this.widgetBaseClass+".ui-state-hover").trigger("mouseout")},_toggle:function(a,b){this.list.is("."+this.widgetBaseClass+"-open")?this.close(a,b):this.open(a)},_formatText:function(a){return this.options.format?this.options.format(a):a},_selectedIndex:function(){return this.element[0].selectedIndex},_selectedOptionLi:function(){return this._optionLis.eq(this._selectedIndex())}, _focusedOptionLi:function(){return this.list.find("."+this.widgetBaseClass+"-item-focus")},_moveSelection:function(a,b){if(!this.options.disabled){var d=parseInt(this._selectedOptionLi().data("index")||0,10)+a;d<0&&(d=0);d>this._optionLis.size()-1&&(d=this._optionLis.size()-1);if(d===b)return!1;if(this._optionLis.eq(d).hasClass(this.namespace+"-state-disabled"))a>0?++a:--a,this._moveSelection(a,d);else return this._optionLis.eq(d).trigger("mouseup")}},_moveFocus:function(a,b){var d=isNaN(a)?parseInt(this._optionLis.filter(a).data("index"), 10):parseInt(this._focusedOptionLi().data("index")||0,10)+a;d<0&&(d=0);d>this._optionLis.size()-1&&(d=this._optionLis.size()-1);if(d===b)return!1;var f=this.widgetBaseClass+"-item-"+Math.round(Math.random()*1E3);this._focusedOptionLi().find("a:eq(0)").attr("id","");this._optionLis.eq(d).hasClass(this.namespace+"-state-disabled")?(a>0?++a:--a,this._moveFocus(a,d)):this._optionLis.eq(d).find("a:eq(0)").attr("id",f).focus();this.list.attr("aria-activedescendant",f)},_scrollPage:function(a){var b=Math.floor(this.list.outerHeight()/ this.list.find("li:first").outerHeight());this._moveFocus(a=="up"?-b:b)},_setOption:function(a,b){this.options[a]=b;a=="disabled"&&(this.close(),this.element.add(this.newelement).add(this.list)[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",b))},disable:function(a,b){typeof a=="undefined"?this._setOption("disabled",!0):b=="optgroup"?this._disableOptgroup(a):this._disableOption(a)},enable:function(a,b){typeof a=="undefined"?this._setOption("disabled", !1):b=="optgroup"?this._enableOptgroup(a):this._enableOption(a)},_disabled:function(a){return d(a).hasClass(this.namespace+"-state-disabled")},_disableOption:function(a){var b=this._optionLis.eq(a);b&&(b.addClass(this.namespace+"-state-disabled").find("a").attr("aria-disabled",!0),this.element.find("option").eq(a).attr("disabled","disabled"))},_enableOption:function(a){var b=this._optionLis.eq(a);b&&(b.removeClass(this.namespace+"-state-disabled").find("a").attr("aria-disabled",!1),this.element.find("option").eq(a).removeAttr("disabled"))}, _disableOptgroup:function(a){var b=this.list.find("li."+this.widgetBaseClass+"-group-"+a);b&&(b.addClass(this.namespace+"-state-disabled").attr("aria-disabled",!0),this.element.find("optgroup").eq(a).attr("disabled","disabled"))},_enableOptgroup:function(a){var b=this.list.find("li."+this.widgetBaseClass+"-group-"+a);b&&(b.removeClass(this.namespace+"-state-disabled").attr("aria-disabled",!1),this.element.find("optgroup").eq(a).removeAttr("disabled"))},index:function(a){if(arguments.length)if(this._disabled(d(this._optionLis[a])))return!1; else this.element[0].selectedIndex=a,this._refreshValue();else return this._selectedIndex()},value:function(a){if(arguments.length)this.element[0].value=a,this._refreshValue();else return this.element[0].value},_refreshValue:function(){var a=this.options.style=="popup"?" ui-state-active":"",b=this.widgetBaseClass+"-item-"+Math.round(Math.random()*1E3);this.list.find("."+this.widgetBaseClass+"-item-selected").removeClass(this.widgetBaseClass+"-item-selected"+a).find("a").attr("aria-selected","false").attr("id", "");this._selectedOptionLi().addClass(this.widgetBaseClass+"-item-selected"+a).find("a").attr("aria-selected","true").attr("id",b);var a=this.newelement.data("optionClasses")?this.newelement.data("optionClasses"):"",d=this._selectedOptionLi().data("optionClasses")?this._selectedOptionLi().data("optionClasses"):"";this.newelement.removeClass(a).data("optionClasses",d).addClass(d).find("."+this.widgetBaseClass+"-status").html(this._selectedOptionLi().find("a:eq(0)").html());this.list.attr("aria-activedescendant", b)},_refreshPosition:function(){var a=this.options;if(a.style=="popup"&&!a.positionOptions.offset)var b=this._selectedOptionLi(),b="0 -"+(b.outerHeight()+b.offset().top-this.list.offset().top);var d=this.element.zIndex();d&&this.listWrap.css("zIndex",d);this.listWrap.position({of:a.positionOptions.of||this.newelement,my:a.positionOptions.my,at:a.positionOptions.at,offset:a.positionOptions.offset||b,collision:a.positionOptions.collision||"flip"})}})})(jQuery); (function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var a=this,b=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=b.values&&b.values.length||1,h=[];this._mouseSliding=this._keySliding=!1;this._animateOff=!0;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?" ui-slider-disabled ui-disabled":""));this.range=d([]);if(b.range){if(b.range===!0){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]]}this.range=d("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(b.range==="min"||b.range==="max"?" ui-slider-range-"+b.range:""))}for(var g=e.length;g<f;g+=1)h.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>"); this.handles=e.add(d(h.join("")).appendTo(a.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){b.disabled?d(this).blur():(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(a){d(this).data("index.ui-slider-handle", a)});this.handles.keydown(function(b){var e=!0,f=d(this).data("index.ui-slider-handle"),h,g,o;if(!a.options.disabled){switch(b.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:if(e=!1,!a._keySliding&&(a._keySliding=!0,d(this).addClass("ui-state-active"),h=a._start(b,f),h===!1))return}o=a.options.step;h=a.options.values&&a.options.values.length?g=a.values(f): g=a.value();switch(b.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+o);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(h===a._valueMin())return;g=a._trimAlignValue(h-o)}a._slide(b, f,g);return e}}).keyup(function(b){var e=d(this).data("index.ui-slider-handle");if(a._keySliding)a._keySliding=!1,a._stop(b,e),a._change(b,e),d(this).removeClass("ui-state-active")});this._refreshValue();this._animateOff=!1},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,e,f,h,g,i;if(b.disabled)return!1;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();e=this._normValueFromMouse({x:a.pageX,y:a.pageY});f=this._valueMax()-this._valueMin()+1;g=this;this.handles.each(function(a){var b=Math.abs(e-g.values(a));f>b&&(f=b,h=d(this),i=a)});b.range===!0&&this.values(1)===b.min&&(i+=1,h=d(this.handles[i]));if(this._start(a,i)===!1)return!1;this._mouseSliding=!0;g._handleIndex=i;h.addClass("ui-state-active").focus(); b=h.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-h.width()/2,top:a.pageY-b.top-h.height()/2-(parseInt(h.css("borderTopWidth"),10)||0)-(parseInt(h.css("borderBottomWidth"),10)||0)+(parseInt(h.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(a,i,e);return this._animateOff=!0},_mouseStart:function(){return!0},_mouseDrag:function(a){var b=this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a, this._handleIndex,b);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=!1;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;this.orientation==="horizontal"?(b=this.elementSize.width,a=a.x-this.elementOffset.left-(this._clickOffset? this._clickOffset.left:0)):(b=this.elementSize.height,a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0));b=a/b;b>1&&(b=1);b<0&&(b=0);this.orientation==="vertical"&&(b=1-b);a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var d={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length)d.value=this.values(b),d.values=this.values();return this._trigger("start",a,d)},_slide:function(a, b,d){var f;if(this.options.values&&this.options.values.length){f=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===!0&&(b===0&&d>f||b===1&&d<f))d=f;d!==this.values(b)&&(f=this.values(),f[b]=d,a=this._trigger("slide",a,{handle:this.handles[b],value:d,values:f}),this.values(b?0:1),a!==!1&&this.values(b,d,!0))}else d!==this.value()&&(a=this._trigger("slide",a,{handle:this.handles[b],value:d}),a!==!1&&this.value(d))},_stop:function(a,b){var d={handle:this.handles[b],value:this.value()}; if(this.options.values&&this.options.values.length)d.value=this.values(b),d.values=this.values();this._trigger("stop",a,d)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var d={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length)d.value=this.values(b),d.values=this.values();this._trigger("change",a,d)}},value:function(a){if(arguments.length)this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0);else return this._value()}, values:function(a,b){var e,f,h;if(arguments.length>1)this.options.values[a]=this._trimAlignValue(b),this._refreshValue(),this._change(null,a);else if(arguments.length)if(d.isArray(arguments[0])){e=this.options.values;f=arguments[0];for(h=0;h<e.length;h+=1)e[h]=this._trimAlignValue(f[h]),this._change(null,h);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 e,f=0;if(d.isArray(this.options.values))f= this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(a){case "disabled":b?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),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=!0;this._refreshValue();this._change(null,0);this._animateOff=!1;break;case "values":this._animateOff=!0;this._refreshValue();for(e=0;e<f;e+=1)this._change(null,e);this._animateOff=!1}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a)},_values:function(a){var b,d;if(arguments.length)b=this.options.values[a],b=this._trimAlignValue(b);else{b=this.options.values.slice();for(d=0;d<b.length;d+=1)b[d]=this._trimAlignValue(b[d])}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,d=(a-this._valueMin())%b;a-=d;Math.abs(d)*2>=b&&(a+=d>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,e=this,f=!this._animateOff?b.animate:!1,h,g={},i,j,k,l;if(this.options.values&&this.options.values.length)this.handles.each(function(a){h= (e.values(a)-e._valueMin())/(e._valueMax()-e._valueMin())*100;g[e.orientation==="horizontal"?"left":"bottom"]=h+"%";d(this).stop(1,1)[f?"animate":"css"](g,b.animate);if(e.options.range===!0)if(e.orientation==="horizontal"){if(a===0)e.range.stop(1,1)[f?"animate":"css"]({left:h+"%"},b.animate);if(a===1)e.range[f?"animate":"css"]({width:h-i+"%"},{queue:!1,duration:b.animate})}else{if(a===0)e.range.stop(1,1)[f?"animate":"css"]({bottom:h+"%"},b.animate);if(a===1)e.range[f?"animate":"css"]({height:h-i+ "%"},{queue:!1,duration:b.animate})}i=h});else{j=this.value();k=this._valueMin();l=this._valueMax();h=l!==k?(j-k)/(l-k)*100:0;g[e.orientation==="horizontal"?"left":"bottom"]=h+"%";this.handle.stop(1,1)[f?"animate":"css"](g,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[f?"animate":"css"]({width:h+"%"},b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-h+"%"},{queue:!1,duration:b.animate});if(a==="min"&&this.orientation=== "vertical")this.range.stop(1,1)[f?"animate":"css"]({height:h+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-h+"%"},{queue:!1,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.16"})})(jQuery); (function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh(); this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1;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){a==="disabled"?(this.options[a]= b,this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")):d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(a);var e=null,f=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==f)return e=d(this),!1});d.data(a.target,"sortable-item")==f&&(e=d(a.target));if(!e)return!1;if(this.options.handle&&!b){var h=!1;d(this.options.handle, e).find("*").andSelf().each(function(){this==a.target&&(h=!0)});if(!h)return!1}this.currentItem=e;this._removeCurrentsFromItems();return!0},_mouseStart:function(a,b,e){b=this.options;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(!e)for(e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("activate",a,this._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=!0;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return!0},_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,e=!1;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=e=this.scrollParent[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top<b.scrollSensitivity)this.scrollParent[0].scrollTop=e=this.scrollParent[0].scrollTop- b.scrollSpeed;if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-a.pageX<b.scrollSensitivity)this.scrollParent[0].scrollLeft=e=this.scrollParent[0].scrollLeft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)this.scrollParent[0].scrollLeft=e=this.scrollParent[0].scrollLeft-b.scrollSpeed}else a.pageY-d(document).scrollTop()<b.scrollSensitivity?e=d(document).scrollTop(d(document).scrollTop()-b.scrollSpeed):d(window).height()-(a.pageY-d(document).scrollTop())<b.scrollSensitivity&& (e=d(document).scrollTop(d(document).scrollTop()+b.scrollSpeed)),a.pageX-d(document).scrollLeft()<b.scrollSensitivity?e=d(document).scrollLeft(d(document).scrollLeft()-b.scrollSpeed):d(window).width()-(a.pageX-d(document).scrollLeft())<b.scrollSensitivity&&(e=d(document).scrollLeft(d(document).scrollLeft()+b.scrollSpeed));e!==!1&&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--){var e=this.items[b],f=e.item[0],h=this._intersectsWithPointer(e);if(h&&f!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=f&&!d.ui.contains(this.placeholder[0],f)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],f):1)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e))this._rearrange(a, e);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!1},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var e=this,f=e.placeholder.offset();e.reverting=!0;d(this.helper).animate({left:f.left-this.offset.parent.left-e.margins.left+(this.offsetParent[0]==document.body? 0:this.offsetParent[0].scrollLeft),top:f.top-this.offset.parent.top-e.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){e._clear(a)})}else this._clear(a,b);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var a=this.containers.length-1;a>=0;a--)if(this.containers[a]._trigger("deactivate", null,this._uiHash(this)),this.containers[a].containerCache.over)this.containers[a]._trigger("out",null,this._uiHash(this)),this.containers[a].containerCache.over=0}this.placeholder&&(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:!1,reverting:!1,_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),e=[],a=a||{};d(b).each(function(){var b=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);b&&e.push((a.key||b[1]+"[]")+"="+(a.key&&a.expression?b[1]:b[2]))});!e.length&&a.key&&e.push(a.key+"=");return e.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),e=[],a=a||{};b.each(function(){e.push(d(a.item||this).attr(a.attribute|| "id")||"")});return e},_intersectsWith:function(a){var b=this.positionAbs.left,d=b+this.helperProportions.width,f=this.positionAbs.top,h=f+this.helperProportions.height,g=a.left,i=g+a.width,j=a.top,k=j+a.height,l=this.offset.click.top,m=this.offset.click.left;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?f+l>j&&f+l<k&&b+m>g&&b+m<i:g<b+this.helperProportions.width/ 2&&d-this.helperProportions.width/2<i&&j<f+this.helperProportions.height/2&&h-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(),e=this._getDragHorizontalDirection();return!b?!1:this.floating?e&&e=="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),e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return this.floating&&f?f=="right"&&a||f=="left"&&!a:e&&(e=="down"&&b||e=="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=[],e=[],f=this._connectWith();if(f&&a)for(a=f.length-1;a>=0;a--)for(var h=d(f[a]),g=h.length-1;g>=0;g--){var i=d.data(h[g],"sortable");i&&i!=this&&!i.options.disabled&&e.push([d.isFunction(i.options.items)?i.options.items.call(i.element): d(i.options.items,i.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),i])}e.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=e.length-1;a>=0;a--)e[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 d= 0;d<a.length;d++)a[d]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(a){this.items=[];this.containers=[this];var b=this.items,e=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):d(this.options.items,this.element),this]],f=this._connectWith();if(f)for(var h=f.length-1;h>=0;h--)for(var g=d(f[h]),i=g.length-1;i>=0;i--){var j=d.data(g[i],"sortable");j&&j!=this&&!j.options.disabled&&(e.push([d.isFunction(j.options.items)?j.options.items.call(j.element[0], a,{item:this.currentItem}):d(j.options.items,j.element),j]),this.containers.push(j))}for(h=e.length-1;h>=0;h--){a=e[h][1];f=e[h][0];i=0;for(g=f.length;i<g;i++)j=d(f[i]),j.data("sortable-item",a),b.push({item:j,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 e=this.items[b];if(!(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0])){var f= this.options.toleranceElement?d(this.options.toleranceElement,e.item):e.item;if(!a)e.width=f.outerWidth(),e.height=f.outerHeight();f=f.offset();e.left=f.left;e.top=f.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--)f=this.containers[b].element.offset(),this.containers[b].containerCache.left=f.left,this.containers[b].containerCache.top=f.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,e=b.options;if(!e.placeholder||e.placeholder.constructor==String){var f=e.placeholder;e.placeholder={element:function(){var a=d(document.createElement(b.currentItem[0].nodeName)).addClass(f||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!f)a.style.visibility="hidden";return a},update:function(a,d){if(!f||e.forcePlaceholderSize)d.height()|| d.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10)),d.width()||d.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}b.placeholder=d(e.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);e.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,e=null,f=this.containers.length- 1;f>=0;f--)if(!d.ui.contains(this.currentItem[0],this.containers[f].element[0]))if(this._intersectsWith(this.containers[f].containerCache)){if(!b||!d.ui.contains(this.containers[f].element[0],b.element[0]))b=this.containers[f],e=f}else if(this.containers[f].containerCache.over)this.containers[f]._trigger("out",a,this._uiHash(this)),this.containers[f].containerCache.over=0;if(b)if(this.containers.length===1)this.containers[e]._trigger("over",a,this._uiHash(this)),this.containers[e].containerCache.over= 1;else if(this.currentContainer!=this.containers[e]){for(var b=1E4,f=null,h=this.positionAbs[this.containers[e].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[e].element[0],this.items[g].item[0])){var i=this.items[g][this.containers[e].floating?"left":"top"];Math.abs(i-h)<b&&(b=Math.abs(i-h),f=this.items[g])}if(f||this.options.dropOnEmpty)this.currentContainer=this.containers[e],f?this._rearrange(a,f,null,!0):this._rearrange(a,null,this.containers[e].element, !0),this._trigger("change",a,this._uiHash()),this.containers[e]._trigger("change",a,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[e]._trigger("over",a,this._uiHash(this)),this.containers[e].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")};(a[0].style.width==""||b.forceHelperSize)&&a.width(this.currentItem.width());(a[0].style.height==""||b.forceHelperSize)&&a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){typeof a== "string"&&(a=a.split(" "));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();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(),e=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+(e?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+(e?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;var e=a=="absolute"?1:-1,f=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))? this.offsetParent:this.scrollParent,h=/(html|body)/i.test(f[0].tagName);return{top:b.top+this.offset.relative.top*e+this.offset.parent.top*e-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():h?0:f.scrollTop())*e),left:b.left+this.offset.relative.left*e+this.offset.parent.left*e-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:f.scrollLeft())*e)}},_generatePosition:function(a){var b= this.options,e=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(e[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();var h=a.pageX,g=a.pageY;this.originalPosition&&(this.containment&&(a.pageX-this.offset.click.left<this.containment[0]&&(h=this.containment[0]+ this.offset.click.left),a.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),a.pageX-this.offset.click.left>this.containment[2]&&(h=this.containment[2]+this.offset.click.left),a.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top)),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,h=this.originalPageX+Math.round((h-this.originalPageX)/b.grid[0])*b.grid[0],h=this.containment?!(h-this.offset.click.left<this.containment[0]||h-this.offset.click.left>this.containment[2])?h:!(h-this.offset.click.left<this.containment[0])?h-b.grid[0]:h+b.grid[0]:h));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(): f?0:e.scrollTop()),left:h-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():f?0:e.scrollLeft())}},_rearrange:function(a,b,d,f){d?d[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 h=this,g=this.counter;window.setTimeout(function(){g== h.counter&&h.refreshPositions(!f)},0)},_clear:function(a,b){this.reverting=!1;var e=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var f in this._storedCSS)if(this._storedCSS[f]=="auto"||this._storedCSS[f]=="static")this._storedCSS[f]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!b&&e.push(function(a){this._trigger("receive", a,this._uiHash(this.fromOutside))});(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!b&&e.push(function(a){this._trigger("update",a,this._uiHash())});if(!d.ui.contains(this.element[0],this.currentItem[0])){b||e.push(function(a){this._trigger("remove",a,this._uiHash())});for(f=this.containers.length-1;f>=0;f--)d.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!b&&(e.push(function(a){return function(b){a._trigger("receive", b,this._uiHash(this))}}.call(this,this.containers[f])),e.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(f=this.containers.length-1;f>=0;f--)if(b||e.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over)e.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over= 0;this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=!1;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(f=0;f<e.length;f++)e[f].call(this,a);this._trigger("stop",a,this._uiHash())}return!1}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(f=0;f<e.length;f++)e[f].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=!1;return!0},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===!1&&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.16"})})(jQuery); (function(d,a){var b=0,e=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,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&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(!0)},_setOption:function(a,b){a=="selected"?this.options.collapsible&&b==this.options.selected||this.select(b): (this.options[a]=b,this._tabify())},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+ ++b},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var a=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++e);return d.cookie.apply(null,[a].concat(d.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,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(b){function e(a,b){a.css("display","");!d.support.opacity&&b.opacity&&a[0].style.removeAttribute("filter")}var g=this,i=this.options,j=/^#.+/;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(a,b){var e=d(b).attr("href"),f=e.split("#")[0],h;if(f&&(f===location.toString().split("#")[0]|| (h=d("base")[0])&&f===h.href))e=b.hash,b.href=e;j.test(e)?g.panels=g.panels.add(g.element.find(g._sanitizeSelector(e))):e&&e!=="#"?(d.data(b,"href.tabs",e),d.data(b,"load.tabs",e.replace(/#.*$/,"")),e=g._tabId(b),b.href="#"+e,f=g.element.find("#"+e),f.length||(f=d(i.panelTemplate).attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(g.panels[a-1]||g.list),f.data("destroy.tabs",!0)),g.panels=g.panels.add(f)):i.disabled.push(a)});if(b){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(i.selected===a){location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash)return i.selected=a,!1});if(typeof i.selected!=="number"&&i.cookie)i.selected=parseInt(g._cookie(),10);if(typeof i.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)i.selected= this.lis.index(this.lis.filter(".ui-tabs-selected"));i.selected=i.selected||(this.lis.length?0:-1)}else if(i.selected===null)i.selected=-1;i.selected=i.selected>=0&&this.anchors[i.selected]||i.selected<0?i.selected:0;i.disabled=d.unique(i.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(a){return g.lis.index(a)}))).sort();d.inArray(i.selected,i.disabled)!=-1&&i.disabled.splice(d.inArray(i.selected,i.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); i.selected>=0&&this.anchors.length&&(g.element.find(g._sanitizeSelector(g.anchors[i.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(i.selected).addClass("ui-tabs-selected ui-state-active"),g.element.queue("tabs",function(){g._trigger("show",null,g._ui(g.anchors[i.selected],g.element.find(g._sanitizeSelector(g.anchors[i.selected].hash))[0]))}),this.load(i.selected));d(window).bind("unload",function(){g.lis.add(g.anchors).unbind(".tabs");g.lis=g.anchors=g.panels=null})}else i.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); this.element[i.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");i.cookie&&this._cookie(i.selected,i.cookie);for(var b=0,k;k=this.lis[b];b++)d(k)[d.inArray(b,i.disabled)!=-1&&!d(k).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");i.cache===!1&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(i.event!=="mouseover"){var l=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)};this.lis.bind("mouseover.tabs", function(){l("hover",d(this))});this.lis.bind("mouseout.tabs",function(){d(this).removeClass("ui-state-hover")});this.anchors.bind("focus.tabs",function(){l("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){d(this).closest("li").removeClass("ui-state-focus")})}var m,o;if(i.fx)d.isArray(i.fx)?(m=i.fx[0],o=i.fx[1]):m=o=i.fx;var p=o?function(a,b){d(a).closest("li").addClass("ui-tabs-selected ui-state-active");b.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal", function(){e(b,o);g._trigger("show",null,g._ui(a,b[0]))})}:function(a,b){d(a).closest("li").addClass("ui-tabs-selected ui-state-active");b.removeClass("ui-tabs-hide");g._trigger("show",null,g._ui(a,b[0]))},n=m?function(a,b){b.animate(m,m.duration||"normal",function(){g.lis.removeClass("ui-tabs-selected ui-state-active");b.addClass("ui-tabs-hide");e(b,m);g.element.dequeue("tabs")})}:function(a,b){g.lis.removeClass("ui-tabs-selected ui-state-active");b.addClass("ui-tabs-hide");g.element.dequeue("tabs")}; this.anchors.bind(i.event+".tabs",function(){var a=this,b=d(a).closest("li"),e=g.panels.filter(":not(.ui-tabs-hide)"),f=g.element.find(g._sanitizeSelector(a.hash));if(b.hasClass("ui-tabs-selected")&&!i.collapsible||b.hasClass("ui-state-disabled")||b.hasClass("ui-state-processing")||g.panels.filter(":animated").length||g._trigger("select",null,g._ui(this,f[0]))===!1)return this.blur(),!1;i.selected=g.anchors.index(this);g.abort();if(i.collapsible)if(b.hasClass("ui-tabs-selected"))return i.selected= -1,i.cookie&&g._cookie(i.selected,i.cookie),g.element.queue("tabs",function(){n(a,e)}).dequeue("tabs"),this.blur(),!1;else if(!e.length)return i.cookie&&g._cookie(i.selected,i.cookie),g.element.queue("tabs",function(){p(a,f)}),g.load(g.anchors.index(this)),this.blur(),!1;i.cookie&&g._cookie(i.selected,i.cookie);if(f.length)e.length&&g.element.queue("tabs",function(){n(a,e)}),g.element.queue("tabs",function(){p(a,f)}),g.load(g.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier."; d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){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 a= d.data(this,"href.tabs");if(a)this.href=a;var b=d(this).unbind(".tabs");d.each(["href","load","cache"],function(a,d){b.removeData(d+".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(b, e,g){if(g===a)g=this.anchors.length;var i=this,j=this.options,e=d(j.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e)),b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var k=i.element.find("#"+b);k.length||(k=d(j.panelTemplate).attr("id",b).data("destroy.tabs",!0));k.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");g>=this.lis.length?(e.appendTo(this.list),k.appendTo(this.list[0].parentNode)): (e.insertBefore(this.lis[g]),k.insertBefore(this.panels[g]));j.disabled=d.map(j.disabled,function(a){return a>=g?++a:a});this._tabify();if(this.anchors.length==1)j.selected=0,e.addClass("ui-tabs-selected ui-state-active"),k.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){i._trigger("show",null,i._ui(i.anchors[0],i.panels[0]))}),this.load(0);this._trigger("add",null,this._ui(this.anchors[g],this.panels[g]));return this},remove:function(a){var a=this._getIndex(a),b=this.options,e=this.lis.eq(a).remove(), i=this.panels.eq(a).remove();e.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(a+(a+1<this.anchors.length?1:-1));b.disabled=d.map(d.grep(b.disabled,function(b){return b!=a}),function(b){return b>=a?--b:b});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],i[0]));return this},enable:function(a){var a=this._getIndex(a),b=this.options;if(d.inArray(a,b.disabled)!=-1)return this.lis.eq(a).removeClass("ui-state-disabled"),b.disabled=d.grep(b.disabled,function(b){return b!= a}),this._trigger("enable",null,this._ui(this.anchors[a],this.panels[a])),this},disable:function(a){var a=this._getIndex(a),b=this.options;a!=b.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),b.disabled.push(a),b.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){var a=this._getIndex(a),b=this,e=this.options,i=this.anchors.eq(a)[0],j=d.data(i,"load.tabs");this.abort();if(!j||this.element.queue("tabs").length!==0&&d.data(i,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(a).addClass("ui-state-processing");if(e.spinner){var k=d("span",i);k.data("label.tabs",k.html()).html(e.spinner)}this.xhr=d.ajax(d.extend({},e.ajaxOptions,{url:j,success:function(j,m){b.element.find(b._sanitizeSelector(i.hash)).html(j);b._cleanup(); e.cache&&d.data(i,"cache.tabs",!0);b._trigger("load",null,b._ui(b.anchors[a],b.panels[a]));try{e.ajaxOptions.success(j,m)}catch(o){}},error:function(d,j){b._cleanup();b._trigger("load",null,b._ui(b.anchors[a],b.panels[a]));try{e.ajaxOptions.error(d,j,a,i)}catch(o){}}}));b.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(!1,!0);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));this.xhr&&(this.xhr.abort(),delete this.xhr);this._cleanup(); return this},url:function(a,b){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.16"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var d=this,e=this.options,j=d._rotate||(d._rotate=function(b){clearTimeout(d.rotation);d.rotation=setTimeout(function(){var a=e.selected;d.select(++a<d.anchors.length?a:0)},a);b&&b.stopPropagation()}),k=d._unrotate||(d._unrotate=!b?function(a){a.clientX&& d.rotate(null)}:function(){t=e.selected;j()});a?(this.element.bind("tabsshow",j),this.anchors.bind(e.event+".tabs",k),j()):(clearTimeout(d.rotation),this.element.unbind("tabsshow",j),this.anchors.unbind(e.event+".tabs",k),delete this._rotate,delete this._unrotate);return this}})})(jQuery); jQuery.effects||function(d,a){function b(a){var b;return a&&a.constructor==Array&&a.length==3?a:(b=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(a))?[parseInt(b[1],10),parseInt(b[2],10),parseInt(b[3],10)]:(b=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(a))?[parseFloat(b[1])*2.55,parseFloat(b[2])*2.55,parseFloat(b[3])*2.55]:(b=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(a))?[parseInt(b[1],16),parseInt(b[2], 16),parseInt(b[3],16)]:(b=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(a))?[parseInt(b[1]+b[1],16),parseInt(b[2]+b[2],16),parseInt(b[3]+b[3],16)]:/rgba\(0, 0, 0, 0\)/.exec(a)?j.transparent:j[d.trim(a).toLowerCase()]}function e(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},d,e;if(a&&a.length&&a[0]&&a[a[0]])for(var f=a.length;f--;)d=a[f],typeof a[d]=="string"&&(e=d.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[e]=a[d]);else for(d in a)typeof a[d]=== "string"&&(b[d]=a[d]);return b}function f(a){var b,e;for(b in a)e=a[b],(e==null||d.isFunction(e)||b in l||/scrollbar/.test(b)||!/color/i.test(b)&&isNaN(parseFloat(e)))&&delete a[b];return a}function h(a,b){var d={_:0},e;for(e in b)a[e]!=b[e]&&(d[e]=b[e]);return d}function g(a,b,e,f){if(typeof a=="object")f=b,e=null,b=a,a=b.effect;d.isFunction(b)&&(f=b,e=null,b={});if(typeof b=="number"||d.fx.speeds[b])f=e,e=b,b={};d.isFunction(e)&&(f=e,e=null);b=b||{};e=e||b.duration;e=d.fx.off?0:typeof e=="number"? e:e in d.fx.speeds?d.fx.speeds[e]:d.fx.speeds._default;f=f||b.complete;return[a,b,e,f]}function i(a){return!a||typeof a==="number"||d.fx.speeds[a]?!0:typeof a==="string"&&!d.effects[a]?!0:!1}d.effects={};d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(a,e){d.fx.step[e]=function(a){if(!a.colorInit){var f;f=a.elem;var g=e,h;do{h=d.curCSS(f,g);if(h!=""&&h!="transparent"||d.nodeName(f,"body"))break;g="backgroundColor"}while(f= f.parentNode);f=b(h);a.start=f;a.end=b(a.end);a.colorInit=!0}a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var j={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]},k=["add","remove","toggle"],l={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};d.effects.animateClass=function(a,b,g,i){d.isFunction(g)&&(i=g,g=null);return this.queue(function(){var j=d(this),l=j.attr("style")|| " ",x=f(e.call(this)),q,w=j.attr("class");d.each(k,function(b,d){if(a[d])j[d+"Class"](a[d])});q=f(e.call(this));j.attr("class",w);j.animate(h(x,q),{queue:!1,duration:b,easing:g,complete:function(){d.each(k,function(b,d){if(a[d])j[d+"Class"](a[d])});typeof j.attr("style")=="object"?(j.attr("style").cssText="",j.attr("style").cssText=l):j.attr("style",l);i&&i.apply(this,arguments);d.dequeue(this)}})})};d.fn.extend({_addClass:d.fn.addClass,addClass:function(a,b,e,f){return b?d.effects.animateClass.apply(this, [{add:a},b,e,f]):this._addClass(a)},_removeClass:d.fn.removeClass,removeClass:function(a,b,e,f){return b?d.effects.animateClass.apply(this,[{remove:a},b,e,f]):this._removeClass(a)},_toggleClass:d.fn.toggleClass,toggleClass:function(b,e,f,g,h){return typeof e=="boolean"||e===a?f?d.effects.animateClass.apply(this,[e?{add:b}:{remove:b},f,g,h]):this._toggleClass(b,e):d.effects.animateClass.apply(this,[{toggle:b},e,f,g])},switchClass:function(a,b,e,f,g){return d.effects.animateClass.apply(this,[{add:b, remove:a},e,f,g])}});d.extend(d.effects,{version:"1.8.16",save:function(a,b){for(var d=0;d<b.length;d++)b[d]!==null&&a.data("ec.storage."+b[d],a[0].style[b[d]])},restore:function(a,b){for(var d=0;d<b.length;d++)b[d]!==null&&a.css(b[d],a.data("ec.storage."+b[d]))},setMode:function(a,b){b=="toggle"&&(b=a.is(":hidden")?"show":"hide");return b},getBaseline:function(a,b){var d,e;switch(a[0]){case "top":d=0;break;case "middle":d=0.5;break;case "bottom":d=1;break;default:d=a[0]/b.height}switch(a[1]){case "left":e= 0;break;case "center":e=0.5;break;case "right":e=1;break;default:e=a[1]/b.width}return{x:e,y:d}},createWrapper:function(a){if(a.parent().is(".ui-effects-wrapper"))return a.parent();var b={width:a.outerWidth(!0),height:a.outerHeight(!0),"float":a.css("float")},e=d("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),f=document.activeElement;a.wrap(e);(a[0]===f||d.contains(a[0],f))&&d(f).focus();e=a.parent();a.css("position")== "static"?(e.css({position:"relative"}),a.css({position:"relative"})):(d.extend(b,{position:a.css("position"),zIndex:a.css("z-index")}),d.each(["top","left","bottom","right"],function(d,e){b[e]=a.css(e);isNaN(parseInt(b[e],10))&&(b[e]="auto")}),a.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return e.css(b).show()},removeWrapper:function(a){var b,e=document.activeElement;return a.parent().is(".ui-effects-wrapper")?(b=a.parent().replaceWith(a),(a[0]===e||d.contains(a[0],e))&&d(e).focus(), b):a},setTransition:function(a,b,e,f){f=f||{};d.each(b,function(b,d){unit=a.cssUnit(d);unit[0]>0&&(f[d]=unit[0]*e+unit[1])});return f}});d.fn.extend({effect:function(a,b,e,f){var h=g.apply(this,arguments),i={options:h[1],duration:h[2],callback:h[3]},h=i.options.mode,j=d.effects[a];return d.fx.off||!j?h?this[h](i.duration,i.callback):this.each(function(){i.callback&&i.callback.call(this)}):j.call(this,i)},_show:d.fn.show,show:function(a){if(i(a))return this._show.apply(this,arguments);else{var b=g.apply(this, arguments);b[1].mode="show";return this.effect.apply(this,b)}},_hide:d.fn.hide,hide:function(a){if(i(a))return this._hide.apply(this,arguments);else{var b=g.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)}},__toggle:d.fn.toggle,toggle:function(a){if(i(a)||typeof a==="boolean"||d.isFunction(a))return this.__toggle.apply(this,arguments);else{var b=g.apply(this,arguments);b[1].mode="toggle";return this.effect.apply(this,b)}},cssUnit:function(a){var b=this.css(a),e=[];d.each(["em", "px","%","pt"],function(a,d){b.indexOf(d)>0&&(e=[parseFloat(b),d])});return e}});d.easing.jswing=d.easing.swing;d.extend(d.easing,{def:"easeOutQuad",swing:function(a,b,e,f,g){return d.easing[d.easing.def](a,b,e,f,g)},easeInQuad:function(a,b,d,e,f){return e*(b/=f)*b+d},easeOutQuad:function(a,b,d,e,f){return-e*(b/=f)*(b-2)+d},easeInOutQuad:function(a,b,d,e,f){return(b/=f/2)<1?e/2*b*b+d:-e/2*(--b*(b-2)-1)+d},easeInCubic:function(a,b,d,e,f){return e*(b/=f)*b*b+d},easeOutCubic:function(a,b,d,e,f){return e* ((b=b/f-1)*b*b+1)+d},easeInOutCubic:function(a,b,d,e,f){return(b/=f/2)<1?e/2*b*b*b+d:e/2*((b-=2)*b*b+2)+d},easeInQuart:function(a,b,d,e,f){return e*(b/=f)*b*b*b+d},easeOutQuart:function(a,b,d,e,f){return-e*((b=b/f-1)*b*b*b-1)+d},easeInOutQuart:function(a,b,d,e,f){return(b/=f/2)<1?e/2*b*b*b*b+d:-e/2*((b-=2)*b*b*b-2)+d},easeInQuint:function(a,b,d,e,f){return e*(b/=f)*b*b*b*b+d},easeOutQuint:function(a,b,d,e,f){return e*((b=b/f-1)*b*b*b*b+1)+d},easeInOutQuint:function(a,b,d,e,f){return(b/=f/2)<1?e/2* b*b*b*b*b+d:e/2*((b-=2)*b*b*b*b+2)+d},easeInSine:function(a,b,d,e,f){return-e*Math.cos(b/f*(Math.PI/2))+e+d},easeOutSine:function(a,b,d,e,f){return e*Math.sin(b/f*(Math.PI/2))+d},easeInOutSine:function(a,b,d,e,f){return-e/2*(Math.cos(Math.PI*b/f)-1)+d},easeInExpo:function(a,b,d,e,f){return b==0?d:e*Math.pow(2,10*(b/f-1))+d},easeOutExpo:function(a,b,d,e,f){return b==f?d+e:e*(-Math.pow(2,-10*b/f)+1)+d},easeInOutExpo:function(a,b,d,e,f){return b==0?d:b==f?d+e:(b/=f/2)<1?e/2*Math.pow(2,10*(b-1))+d:e/ 2*(-Math.pow(2,-10*--b)+2)+d},easeInCirc:function(a,b,d,e,f){return-e*(Math.sqrt(1-(b/=f)*b)-1)+d},easeOutCirc:function(a,b,d,e,f){return e*Math.sqrt(1-(b=b/f-1)*b)+d},easeInOutCirc:function(a,b,d,e,f){return(b/=f/2)<1?-e/2*(Math.sqrt(1-b*b)-1)+d:e/2*(Math.sqrt(1-(b-=2)*b)+1)+d},easeInElastic:function(a,b,d,e,f){var a=1.70158,g=0,h=e;if(b==0)return d;if((b/=f)==1)return d+e;g||(g=f*0.3);h<Math.abs(e)?(h=e,a=g/4):a=g/(2*Math.PI)*Math.asin(e/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*f-a)*2*Math.PI/ g))+d},easeOutElastic:function(a,b,d,e,f){var a=1.70158,g=0,h=e;if(b==0)return d;if((b/=f)==1)return d+e;g||(g=f*0.3);h<Math.abs(e)?(h=e,a=g/4):a=g/(2*Math.PI)*Math.asin(e/h);return h*Math.pow(2,-10*b)*Math.sin((b*f-a)*2*Math.PI/g)+e+d},easeInOutElastic:function(a,b,d,e,f){var a=1.70158,g=0,h=e;if(b==0)return d;if((b/=f/2)==2)return d+e;g||(g=f*0.3*1.5);h<Math.abs(e)?(h=e,a=g/4):a=g/(2*Math.PI)*Math.asin(e/h);return b<1?-0.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*f-a)*2*Math.PI/g)+d:h*Math.pow(2,-10* (b-=1))*Math.sin((b*f-a)*2*Math.PI/g)*0.5+e+d},easeInBack:function(b,d,e,f,g,h){h==a&&(h=1.70158);return f*(d/=g)*d*((h+1)*d-h)+e},easeOutBack:function(b,d,e,f,g,h){h==a&&(h=1.70158);return f*((d=d/g-1)*d*((h+1)*d+h)+1)+e},easeInOutBack:function(b,d,e,f,h,g){g==a&&(g=1.70158);return(d/=h/2)<1?f/2*d*d*(((g*=1.525)+1)*d-g)+e:f/2*((d-=2)*d*(((g*=1.525)+1)*d+g)+2)+e},easeInBounce:function(a,b,e,f,g){return f-d.easing.easeOutBounce(a,g-b,0,f,g)+e},easeOutBounce:function(a,b,d,e,f){return(b/=f)<1/2.75? e*7.5625*b*b+d:b<2/2.75?e*(7.5625*(b-=1.5/2.75)*b+0.75)+d:b<2.5/2.75?e*(7.5625*(b-=2.25/2.75)*b+0.9375)+d:e*(7.5625*(b-=2.625/2.75)*b+0.984375)+d},easeInOutBounce:function(a,b,e,f,g){return b<g/2?d.easing.easeInBounce(a,b*2,0,f,g)*0.5+e:d.easing.easeOutBounce(a,b*2-g,0,f,g)*0.5+f*0.5+e}})}(jQuery); (function(d){d.effects.blind=function(a){return this.queue(function(){var b=d(this),e=["position","top","bottom","left","right"],f=d.effects.setMode(b,a.options.mode||"hide"),h=a.options.direction||"vertical";d.effects.save(b,e);b.show();var g=d.effects.createWrapper(b).css({overflow:"hidden"}),i=h=="vertical"?"height":"width",h=h=="vertical"?g.height():g.width();f=="show"&&g.css(i,0);var j={};j[i]=f=="show"?h:0;g.animate(j,a.duration,a.options.easing,function(){f=="hide"&&b.hide();d.effects.restore(b, e);d.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); (function(d){d.effects.bounce=function(a){return this.queue(function(){var b=d(this),e=["position","top","bottom","left","right"],f=d.effects.setMode(b,a.options.mode||"effect"),h=a.options.direction||"up",g=a.options.distance||20,i=a.options.times||5,j=a.duration||250;/show|hide/.test(f)&&e.push("opacity");d.effects.save(b,e);b.show();d.effects.createWrapper(b);var k=h=="up"||h=="down"?"top":"left",h=h=="up"||h=="left"?"pos":"neg",g=a.options.distance||(k=="top"?b.outerHeight({margin:!0})/3:b.outerWidth({margin:!0})/ 3);f=="show"&&b.css("opacity",0).css(k,h=="pos"?-g:g);f=="hide"&&(g/=i*2);f!="hide"&&i--;if(f=="show"){var l={opacity:1};l[k]=(h=="pos"?"+=":"-=")+g;b.animate(l,j/2,a.options.easing);g/=2;i--}for(l=0;l<i;l++){var m={},o={};m[k]=(h=="pos"?"-=":"+=")+g;o[k]=(h=="pos"?"+=":"-=")+g;b.animate(m,j/2,a.options.easing).animate(o,j/2,a.options.easing);g=f=="hide"?g*2:g/2}f=="hide"?(l={opacity:0},l[k]=(h=="pos"?"-=":"+=")+g,b.animate(l,j/2,a.options.easing,function(){b.hide();d.effects.restore(b,e);d.effects.removeWrapper(b); a.callback&&a.callback.apply(this,arguments)})):(m={},o={},m[k]=(h=="pos"?"-=":"+=")+g,o[k]=(h=="pos"?"+=":"-=")+g,b.animate(m,j/2,a.options.easing).animate(o,j/2,a.options.easing,function(){d.effects.restore(b,e);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments)}));b.queue("fx",function(){b.dequeue()});b.dequeue()})}})(jQuery); (function(d){d.effects.clip=function(a){return this.queue(function(){var b=d(this),e=["position","top","bottom","left","right","height","width"],f=d.effects.setMode(b,a.options.mode||"hide"),h=a.options.direction||"vertical";d.effects.save(b,e);b.show();var g=d.effects.createWrapper(b).css({overflow:"hidden"}),g=b[0].tagName=="IMG"?g:b,i={size:h=="vertical"?"height":"width",position:h=="vertical"?"top":"left"},h=h=="vertical"?g.height():g.width();f=="show"&&(g.css(i.size,0),g.css(i.position,h/2)); var j={};j[i.size]=f=="show"?h:0;j[i.position]=f=="show"?0:h/2;g.animate(j,{queue:!1,duration:a.duration,easing:a.options.easing,complete:function(){f=="hide"&&b.hide();d.effects.restore(b,e);d.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()}})})}})(jQuery); (function(d){d.effects.drop=function(a){return this.queue(function(){var b=d(this),e=["position","top","bottom","left","right","opacity"],f=d.effects.setMode(b,a.options.mode||"hide"),h=a.options.direction||"left";d.effects.save(b,e);b.show();d.effects.createWrapper(b);var g=h=="up"||h=="down"?"top":"left",h=h=="up"||h=="left"?"pos":"neg",i=a.options.distance||(g=="top"?b.outerHeight({margin:!0})/2:b.outerWidth({margin:!0})/2);f=="show"&&b.css("opacity",0).css(g,h=="pos"?-i:i);var j={opacity:f=="show"? 1:0};j[g]=(f=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i;b.animate(j,{queue:!1,duration:a.duration,easing:a.options.easing,complete:function(){f=="hide"&&b.hide();d.effects.restore(b,e);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments);b.dequeue()}})})}})(jQuery); (function(d){d.effects.explode=function(a){return this.queue(function(){var b=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3,e=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3;a.options.mode=a.options.mode=="toggle"?d(this).is(":visible")?"hide":"show":a.options.mode;var f=d(this).show().css("visibility","hidden"),h=f.offset();h.top-=parseInt(f.css("marginTop"),10)||0;h.left-=parseInt(f.css("marginLeft"),10)||0;for(var g=f.outerWidth(!0),i=f.outerHeight(!0),j=0;j<b;j++)for(var k= 0;k<e;k++)f.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-k*(g/e),top:-j*(i/b)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/e,height:i/b,left:h.left+k*(g/e)+(a.options.mode=="show"?(k-Math.floor(e/2))*(g/e):0),top:h.top+j*(i/b)+(a.options.mode=="show"?(j-Math.floor(b/2))*(i/b):0),opacity:a.options.mode=="show"?0:1}).animate({left:h.left+k*(g/e)+(a.options.mode=="show"?0:(k-Math.floor(e/2))*(g/e)),top:h.top+ j*(i/b)+(a.options.mode=="show"?0:(j-Math.floor(b/2))*(i/b)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?f.css({visibility:"visible"}):f.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(f[0]);f.dequeue();d("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); (function(d){d.effects.fade=function(a){return this.queue(function(){var b=d(this),e=d.effects.setMode(b,a.options.mode||"hide");b.animate({opacity:e},{queue:!1,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);b.dequeue()}})})}})(jQuery); (function(d){d.effects.fold=function(a){return this.queue(function(){var b=d(this),e=["position","top","bottom","left","right"],f=d.effects.setMode(b,a.options.mode||"hide"),h=a.options.size||15,g=!!a.options.horizFirst,i=a.duration?a.duration/2:d.fx.speeds._default/2;d.effects.save(b,e);b.show();var j=d.effects.createWrapper(b).css({overflow:"hidden"}),k=f=="show"!=g,l=k?["width","height"]:["height","width"],k=k?[j.width(),j.height()]:[j.height(),j.width()],m=/([0-9]+)%/.exec(h);m&&(h=parseInt(m[1], 10)/100*k[f=="hide"?0:1]);f=="show"&&j.css(g?{height:0,width:h}:{height:h,width:0});g={};m={};g[l[0]]=f=="show"?k[0]:h;m[l[1]]=f=="show"?k[1]:0;j.animate(g,i,a.options.easing).animate(m,i,a.options.easing,function(){f=="hide"&&b.hide();d.effects.restore(b,e);d.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); (function(d){d.effects.highlight=function(a){return this.queue(function(){var b=d(this),e=["backgroundImage","backgroundColor","opacity"],f=d.effects.setMode(b,a.options.mode||"show"),h={backgroundColor:b.css("backgroundColor")};if(f=="hide")h.opacity=0;d.effects.save(b,e);b.show().css({backgroundImage:"none",backgroundColor:a.options.color||"#ffff99"}).animate(h,{queue:!1,duration:a.duration,easing:a.options.easing,complete:function(){f=="hide"&&b.hide();d.effects.restore(b,e);f=="show"&&!d.support.opacity&& this.style.removeAttribute("filter");a.callback&&a.callback.apply(this,arguments);b.dequeue()}})})}})(jQuery); (function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),e=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;isVisible||(b.css("opacity",0).show(),animateTo=1);(e=="hide"&&isVisible||e=="show"&&!isVisible)&&times--;for(e=0;e<times;e++)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(d){d.effects.puff=function(a){return this.queue(function(){var b=d(this),e=d.effects.setMode(b,a.options.mode||"hide"),f=parseInt(a.options.percent,10)||150,h=f/100,g={height:b.height(),width:b.width()};d.extend(a.options,{fade:!0,mode:e,percent:e=="hide"?f:100,from:e=="hide"?g:{height:g.height*h,width:g.width*h}});b.effect("scale",a.options,a.duration,a.callback);b.dequeue()})};d.effects.scale=function(a){return this.queue(function(){var b=d(this),e=d.extend(!0,{},a.options),f=d.effects.setMode(b, a.options.mode||"effect"),h=parseInt(a.options.percent,10)||(parseInt(a.options.percent,10)==0?0:f=="hide"?0:100),g=a.options.direction||"both",i=a.options.origin;if(f!="effect")e.origin=i||["middle","center"],e.restore=!0;i={height:b.height(),width:b.width()};b.from=a.options.from||(f=="show"?{height:0,width:0}:i);h={y:g!="horizontal"?h/100:1,x:g!="vertical"?h/100:1};b.to={height:i.height*h.y,width:i.width*h.x};if(a.options.fade){if(f=="show")b.from.opacity=0,b.to.opacity=1;if(f=="hide")b.from.opacity= 1,b.to.opacity=0}e.from=b.from;e.to=b.to;e.mode=f;b.effect("size",e,a.duration,a.callback);b.dequeue()})};d.effects.size=function(a){return this.queue(function(){var b=d(this),e=["position","top","bottom","left","right","width","height","overflow","opacity"],f=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],g=["fontSize"],i=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],j=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"], k=d.effects.setMode(b,a.options.mode||"effect"),l=a.options.restore||!1,m=a.options.scale||"both",o=a.options.origin,p={height:b.height(),width:b.width()};b.from=a.options.from||p;b.to=a.options.to||p;if(o)o=d.effects.getBaseline(o,p),b.from.top=(p.height-b.from.height)*o.y,b.from.left=(p.width-b.from.width)*o.x,b.to.top=(p.height-b.to.height)*o.y,b.to.left=(p.width-b.to.width)*o.x;var n={from:{y:b.from.height/p.height,x:b.from.width/p.width},to:{y:b.to.height/p.height,x:b.to.width/p.width}};if(m== "box"||m=="both"){if(n.from.y!=n.to.y)e=e.concat(i),b.from=d.effects.setTransition(b,i,n.from.y,b.from),b.to=d.effects.setTransition(b,i,n.to.y,b.to);if(n.from.x!=n.to.x)e=e.concat(j),b.from=d.effects.setTransition(b,j,n.from.x,b.from),b.to=d.effects.setTransition(b,j,n.to.x,b.to)}if((m=="content"||m=="both")&&n.from.y!=n.to.y)e=e.concat(g),b.from=d.effects.setTransition(b,g,n.from.y,b.from),b.to=d.effects.setTransition(b,g,n.to.y,b.to);d.effects.save(b,l?e:f);b.show();d.effects.createWrapper(b); b.css("overflow","hidden").css(b.from);if(m=="content"||m=="both")i=i.concat(["marginTop","marginBottom"]).concat(g),j=j.concat(["marginLeft","marginRight"]),h=e.concat(i).concat(j),b.find("*[width]").each(function(){child=d(this);l&&d.effects.save(child,h);var b={height:child.height(),width:child.width()};child.from={height:b.height*n.from.y,width:b.width*n.from.x};child.to={height:b.height*n.to.y,width:b.width*n.to.x};if(n.from.y!=n.to.y)child.from=d.effects.setTransition(child,i,n.from.y,child.from), child.to=d.effects.setTransition(child,i,n.to.y,child.to);if(n.from.x!=n.to.x)child.from=d.effects.setTransition(child,j,n.from.x,child.from),child.to=d.effects.setTransition(child,j,n.to.x,child.to);child.css(child.from);child.animate(child.to,a.duration,a.options.easing,function(){l&&d.effects.restore(child,h)})});b.animate(b.to,{queue:!1,duration:a.duration,easing:a.options.easing,complete:function(){b.to.opacity===0&&b.css("opacity",b.from.opacity);k=="hide"&&b.hide();d.effects.restore(b,l?e: f);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments);b.dequeue()}})})}})(jQuery); (function(d){d.effects.shake=function(a){return this.queue(function(){var b=d(this),e=["position","top","bottom","left","right"];d.effects.setMode(b,a.options.mode||"effect");var f=a.options.direction||"left",h=a.options.distance||20,g=a.options.times||3,i=a.duration||a.options.duration||140;d.effects.save(b,e);b.show();d.effects.createWrapper(b);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",f={},l={},m={};f[j]=(k=="pos"?"-=":"+=")+h;l[j]=(k=="pos"?"+=":"-=")+h*2;m[j]=(k== "pos"?"-=":"+=")+h*2;b.animate(f,i,a.options.easing);for(h=1;h<g;h++)b.animate(l,i,a.options.easing).animate(m,i,a.options.easing);b.animate(l,i,a.options.easing).animate(f,i/2,a.options.easing,function(){d.effects.restore(b,e);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()});b.dequeue()})}})(jQuery); (function(d){d.effects.slide=function(a){return this.queue(function(){var b=d(this),e=["position","top","bottom","left","right"],f=d.effects.setMode(b,a.options.mode||"show"),h=a.options.direction||"left";d.effects.save(b,e);b.show();d.effects.createWrapper(b).css({overflow:"hidden"});var g=h=="up"||h=="down"?"top":"left",h=h=="up"||h=="left"?"pos":"neg",i=a.options.distance||(g=="top"?b.outerHeight({margin:!0}):b.outerWidth({margin:!0}));f=="show"&&b.css(g,h=="pos"?isNaN(i)?"-"+i:-i:i);var j={}; j[g]=(f=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i;b.animate(j,{queue:!1,duration:a.duration,easing:a.options.easing,complete:function(){f=="hide"&&b.hide();d.effects.restore(b,e);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments);b.dequeue()}})})}})(jQuery); (function(d){d.effects.transfer=function(a){return this.queue(function(){var b=d(this),e=d(a.options.to),f=e.offset(),e={top:f.top,left:f.left,height:e.innerHeight(),width:e.innerWidth()},f=b.offset(),h=d('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(a.options.className).css({top:f.top,left:f.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(e,a.duration,a.options.easing,function(){h.remove();a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);
kosmas58/compass-jquery-plugin
templates/jquery/jquery-ui.min.js
JavaScript
mit
222,205
/* * jQuery Cryptography Plug-in * version: 1.0.0 (24 Sep 2008) * copyright 2008 Scott Thompson http://www.itsyndicate.ca - [email protected] * http://www.opensource.org/licenses/mit-license.php * * A set of functions to do some basic cryptography encoding/decoding * I compiled from some javascripts I found into a jQuery plug-in. * Thanks go out to the original authors. * * Changelog: 1.1.0 * - rewrote plugin to use only one item in the namespace * * --- Base64 Encoding and Decoding code was written by * * Base64 code from Tyler Akins -- http://rumkin.com * and is placed in the public domain * * * --- MD5 and SHA1 Functions based upon Paul Johnston's javascript libraries. * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message * Digest Algorithm, as defined in RFC 1321. * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet * Distributed under the BSD License * See http://pajhome.org.uk/crypt/md5 for more info. * * xTea Encrypt and Decrypt * copyright 2000-2005 Chris Veness * http://www.movable-type.co.uk * * * Examples: * var md5 = $().crypt({method:"md5",source:$("#phrase").val()}); var sha1 = $().crypt({method:"sha1",source:$("#phrase").val()}); var b64 = $().crypt({method:"b64enc",source:$("#phrase").val()}); var b64dec = $().crypt({method:"b64dec",source:b64}); var xtea = $().crypt({method:"xteaenc",source:$("#phrase").val(),keyPass:$("#passPhrase").val()}); var xteadec = $().crypt({method:"xteadec",source:xtea,keyPass:$("#passPhrase").val()}); var xteab64 = $().crypt({method:"xteab64enc",source:$("#phrase").val(),keyPass:$("#passPhrase").val()}); var xteab64dec = $().crypt({method:"xteab64dec",source:xteab64,keyPass:$("#passPhrase").val()}); You can also pass source this way. var md5 = $("#idOfSource").crypt({method:"md5"}); * */ (function(s){s.fn.crypt=function(m){function t(g){var i="",j,k,f,c,l,a,b=0;do j=g.source.charCodeAt(b++),k=g.source.charCodeAt(b++),f=g.source.charCodeAt(b++),c=j>>2,j=(j&3)<<4|k>>4,l=(k&15)<<2|f>>6,a=f&63,isNaN(k)?l=a=64:isNaN(f)&&(a=64),i+=g.b64Str.charAt(c)+g.b64Str.charAt(j)+g.b64Str.charAt(l)+g.b64Str.charAt(a);while(b<g.source.length);return i}function u(g){var i="",j,k,f,c,l,a=0;g.source=g.source.replace(/[^A-Za-z0-9!_-]/g,"");do j=g.b64Str.indexOf(g.source.charAt(a++)),k=g.b64Str.indexOf(g.source.charAt(a++)), c=g.b64Str.indexOf(g.source.charAt(a++)),l=g.b64Str.indexOf(g.source.charAt(a++)),j=j<<2|k>>4,k=(k&15)<<4|c>>2,f=(c&3)<<6|l,i+=String.fromCharCode(j),64!=c&&(i+=String.fromCharCode(k)),64!=l&&(i+=String.fromCharCode(f));while(a<g.source.length);return i}function x(g){function i(c,f,a,b,d,e){c=o(o(f,c),o(b,e));return o(c<<d|c>>>32-d,a)}function j(c,f,a,b,d,e,h){return i(f&a|~f&b,c,f,d,e,h)}function k(c,f,a,b,d,e,h){return i(f&b|a&~b,c,f,d,e,h)}function f(c,f,a,b,d,e,h){return i(a^(f|~b),c,f,d,e,h)} return function(c){for(var f=g.hexcase?"0123456789ABCDEF":"0123456789abcdef",a="",b=0;b<4*c.length;b++)a+=f.charAt(c[b>>2]>>8*(b%4)+4&15)+f.charAt(c[b>>2]>>8*(b%4)&15);return a}(function(c,g){c[g>>5]|=128<<g%32;c[(g+64>>>9<<4)+14]=g;for(var a=1732584193,b=-271733879,d=-1732584194,e=271733878,h=0;h<c.length;h+=16)var m=a,p=b,q=d,n=e,a=j(a,b,d,e,c[h+0],7,-680876936),e=j(e,a,b,d,c[h+1],12,-389564586),d=j(d,e,a,b,c[h+2],17,606105819),b=j(b,d,e,a,c[h+3],22,-1044525330),a=j(a,b,d,e,c[h+4],7,-176418897), e=j(e,a,b,d,c[h+5],12,1200080426),d=j(d,e,a,b,c[h+6],17,-1473231341),b=j(b,d,e,a,c[h+7],22,-45705983),a=j(a,b,d,e,c[h+8],7,1770035416),e=j(e,a,b,d,c[h+9],12,-1958414417),d=j(d,e,a,b,c[h+10],17,-42063),b=j(b,d,e,a,c[h+11],22,-1990404162),a=j(a,b,d,e,c[h+12],7,1804603682),e=j(e,a,b,d,c[h+13],12,-40341101),d=j(d,e,a,b,c[h+14],17,-1502002290),b=j(b,d,e,a,c[h+15],22,1236535329),a=k(a,b,d,e,c[h+1],5,-165796510),e=k(e,a,b,d,c[h+6],9,-1069501632),d=k(d,e,a,b,c[h+11],14,643717713),b=k(b,d,e,a,c[h+0],20,-373897302), a=k(a,b,d,e,c[h+5],5,-701558691),e=k(e,a,b,d,c[h+10],9,38016083),d=k(d,e,a,b,c[h+15],14,-660478335),b=k(b,d,e,a,c[h+4],20,-405537848),a=k(a,b,d,e,c[h+9],5,568446438),e=k(e,a,b,d,c[h+14],9,-1019803690),d=k(d,e,a,b,c[h+3],14,-187363961),b=k(b,d,e,a,c[h+8],20,1163531501),a=k(a,b,d,e,c[h+13],5,-1444681467),e=k(e,a,b,d,c[h+2],9,-51403784),d=k(d,e,a,b,c[h+7],14,1735328473),b=k(b,d,e,a,c[h+12],20,-1926607734),a=i(b^d^e,a,b,c[h+5],4,-378558),e=i(a^b^d,e,a,c[h+8],11,-2022574463),d=i(e^a^b,d,e,c[h+11],16,1839030562), b=i(d^e^a,b,d,c[h+14],23,-35309556),a=i(b^d^e,a,b,c[h+1],4,-1530992060),e=i(a^b^d,e,a,c[h+4],11,1272893353),d=i(e^a^b,d,e,c[h+7],16,-155497632),b=i(d^e^a,b,d,c[h+10],23,-1094730640),a=i(b^d^e,a,b,c[h+13],4,681279174),e=i(a^b^d,e,a,c[h+0],11,-358537222),d=i(e^a^b,d,e,c[h+3],16,-722521979),b=i(d^e^a,b,d,c[h+6],23,76029189),a=i(b^d^e,a,b,c[h+9],4,-640364487),e=i(a^b^d,e,a,c[h+12],11,-421815835),d=i(e^a^b,d,e,c[h+15],16,530742520),b=i(d^e^a,b,d,c[h+2],23,-995338651),a=f(a,b,d,e,c[h+0],6,-198630844),e= f(e,a,b,d,c[h+7],10,1126891415),d=f(d,e,a,b,c[h+14],15,-1416354905),b=f(b,d,e,a,c[h+5],21,-57434055),a=f(a,b,d,e,c[h+12],6,1700485571),e=f(e,a,b,d,c[h+3],10,-1894986606),d=f(d,e,a,b,c[h+10],15,-1051523),b=f(b,d,e,a,c[h+1],21,-2054922799),a=f(a,b,d,e,c[h+8],6,1873313359),e=f(e,a,b,d,c[h+15],10,-30611744),d=f(d,e,a,b,c[h+6],15,-1560198380),b=f(b,d,e,a,c[h+13],21,1309151649),a=f(a,b,d,e,c[h+4],6,-145523070),e=f(e,a,b,d,c[h+11],10,-1120210379),d=f(d,e,a,b,c[h+2],15,718787259),b=f(b,d,e,a,c[h+9],21,-343485551), a=o(a,m),b=o(b,p),d=o(d,q),e=o(e,n);return[a,b,d,e]}(function(c){for(var f=[],a=(1<<g.chrsz)-1,b=0;b<c.length*g.chrsz;b+=g.chrsz)f[b>>5]|=(c.charCodeAt(b/g.chrsz)&a)<<b%32;return f}(g.source),g.source.length*g.chrsz))}function o(g,i){var j=(g&65535)+(i&65535);return(g>>16)+(i>>16)+(j>>16)<<16|j&65535}function y(g){return function(i){for(var j=g.hexcase?"0123456789ABCDEF":"0123456789abcdef",k="",f=0;f<4*i.length;f++)k+=j.charAt(i[f>>2]>>8*(3-f%4)+4&15)+j.charAt(i[f>>2]>>8*(3-f%4)&15);return k}(function(g, j){g[j>>5]|=128<<24-j%32;g[(j+64>>9<<4)+15]=j;for(var k=Array(80),f=1732584193,c=-271733879,l=-1732584194,a=271733878,b=-1009589776,d=0;d<g.length;d+=16){for(var e=f,h=c,m=l,p=a,q=b,n=0;80>n;n++){k[n]=16>n?g[d+n]:(k[n-3]^k[n-8]^k[n-14]^k[n-16])<<1|(k[n-3]^k[n-8]^k[n-14]^k[n-16])>>>31;var r=f<<5|f>>>27,s;s=20>n?c&l|~c&a:40>n?c^l^a:60>n?c&l|c&a|l&a:c^l^a;r=o(o(r,s),o(o(b,k[n]),20>n?1518500249:40>n?1859775393:60>n?-1894007588:-899497514));b=a;a=l;l=c<<30|c>>>2;c=f;f=r}f=o(f,e);c=o(c,h);l=o(l,m);a=o(a, p);b=o(b,q)}return[f,c,l,a,b]}(function(i){for(var j=[],k=(1<<g.chrsz)-1,f=0;f<i.length*g.chrsz;f+=g.chrsz)j[f>>5]|=(i.charCodeAt(f/g.chrsz)&k)<<32-g.chrsz-f%32;return j}(g.source),g.source.length*g.chrsz))}function v(g){var i=Array(2),j=Array(4),k="",f;g.source=escape(g.source);for(f=0;4>f;f++)j[f]=q(g.strKey.slice(4*f,4*(f+1)));for(f=0;f<g.source.length;f+=8){i[0]=q(g.source.slice(f,f+4));i[1]=q(g.source.slice(f+4,f+8));for(var c=i,l=c[0],a=c[1],b=0;84941944608!=b;)l+=(a<<4^a>>>5)+a^b+j[b&3],b+= 2654435769,a+=(l<<4^l>>>5)+l^b+j[b>>>11&3];c[0]=l;c[1]=a;k+=r(i[0])+r(i[1])}return z(k)}function w(g){var i=Array(2),j=Array(4),k="",f;for(f=0;4>f;f++)j[f]=q(g.strKey.slice(4*f,4*(f+1)));ciphertext=A(g.source);for(f=0;f<ciphertext.length;f+=8){i[0]=q(ciphertext.slice(f,f+4));i[1]=q(ciphertext.slice(f+4,f+8));for(var g=i,c=g[0],l=g[1],a=84941944608;0!=a;)l-=(c<<4^c>>>5)+c^a+j[a>>>11&3],a-=2654435769,c-=(l<<4^l>>>5)+l^a+j[a&3];g[0]=c;g[1]=l;k+=r(i[0])+r(i[1])}k=k.replace(/\0+$/,"");return unescape(k)} function q(g){for(var i=0,j=0;4>j;j++)i|=g.charCodeAt(j)<<8*j;return isNaN(i)?0:i}function r(g){return String.fromCharCode(g&255,g>>8&255,g>>16&255,g>>24&255)}function z(g){return g.replace(/[\0\t\n\v\f\r\xa0'"!]/g,function(g){return"!"+g.charCodeAt(0)+"!"})}function A(g){return g.replace(/!\d\d?\d?!/g,function(g){return String.fromCharCode(g.slice(1,-1))})}m=s.extend({b64Str:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!-_",strKey:"123",method:"md5",source:"",chrsz:8,hexcase:0}, m);if(!m.source){var p=s(this);if(p.html())m.source=p.html();else if(p.val())m.source=p.val();else return alert("Please provide source text"),!1}if("md5"==m.method)return x(m);if("sha1"==m.method)return y(m);if("b64enc"==m.method)return t(m);if("b64dec"==m.method)return u(m);if("xteaenc"==m.method)return v(m);if("xteadec"==m.method)return w(m);if("xteab64enc"==m.method)return p=v(m),m.method="b64enc",m.source=p,t(m);if("xteab64dec"==m.method)return p=u(m),m.method="xteadec",m.source=p,w(m)}})(jQuery);
ProJobless/nyus
themes/javascript/compressed/jquery/plugins/crypt.js
JavaScript
mit
8,625
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Handles backports of the standard library's `fractions.py`. The fractions module in 2.6 does not handle being instantiated using a float and then calculating an approximate fraction based on that. This functionality is required by the FITS unit format generator, since the FITS unit format handles only rational, not decimal point, powers. """ from __future__ import absolute_import import sys if sys.version_info[:2] == (2, 6): from ._fractions_py2 import * else: from fractions import *
piotroxp/scibibscan
scib/lib/python3.5/site-packages/astropy/utils/compat/fractions.py
Python
mit
568
/* eslint-disable func-names */ const { sampleUrls, shortSampleUrls, E2E_WAIT_TIME: WAIT_TIME, E2E_PRESENT_WAIT_TIME: PRESENT_WAIT_TIME } = require('../e2e_helper'); module.exports = { after(browser) { browser.end(); }, 'Go to top page': browser => { browser.page.index().navigate().waitForElementVisible('body', PRESENT_WAIT_TIME); }, 'Add musics': browser => { browser.page .index() .log('add musics') .setValue('@trackUrlField', sampleUrls.join(',')) .submitForm('@trackSubmitButton') .waitForElementPresent('a.playlist-content:nth-child(5)', PRESENT_WAIT_TIME) .assert.elementPresent('@playButton') .assert.hasPlaylistLength(5) .api.pause(WAIT_TIME); }, 'Play music': browser => { browser.page .index() .moveToElement('@playerBlock', 10, 10) .click('@playButton') .waitForElementPresent('@pauseButton', PRESENT_WAIT_TIME) .assert.elementPresent('@pauseButton') .assert.hasPlaylistLength(5) .assert.currentTrackNumEquals(1) .assert.currentTitleEquals(1) .api.pause(WAIT_TIME); }, 'Play next music': browser => { browser.page .index() .click('@nextButton') .waitForElementNotPresent('a.playlist-content:nth-child(5)', PRESENT_WAIT_TIME) // dequeue .assert.elementPresent('@pauseButton') .assert.hasPlaylistLength(4) .assert.currentTrackNumEquals(1) .assert.currentTitleEquals(1) .api.pause(WAIT_TIME); }, 'Has play prev music button?': browser => { browser.page.index().assert.cssClassPresent('@prevButton', 'deactivate'); }, 'Stop music': browser => { browser.page .index() .click('@pauseButton') .waitForElementPresent('@playButton', PRESENT_WAIT_TIME) .assert.elementPresent('@playButton') .assert.hasPlaylistLength(4) .assert.currentTrackNumEquals(1) .assert.title('jukebox') .api.pause(WAIT_TIME); }, 'Play specified music': browser => { browser.page .index() .click('a.playlist-content:nth-child(3)') .waitForElementPresent('@pauseButton', PRESENT_WAIT_TIME) .assert.elementPresent('@pauseButton') .assert.hasPlaylistLength(4) .assert.currentTrackNumEquals(3) .assert.currentTitleEquals(3) .api.pause(WAIT_TIME); }, 'Delete current music': browser => { browser.page .index() .click('a.playlist-content:nth-child(3) i[title=Delete]') .waitForElementPresent('@playButton', PRESENT_WAIT_TIME) .assert.elementPresent('@playButton') .assert.hasPlaylistLength(3) .assert.currentTrackNumEquals(3) .assert.title('jukebox') .api.pause(WAIT_TIME); }, 'Add short music': browser => { browser.page .index() .setValue('@trackUrlField', shortSampleUrls[0]) .submitForm('@trackSubmitButton') .waitForElementPresent('a.playlist-content:nth-child(4)', PRESENT_WAIT_TIME) .assert.hasPlaylistLength(4); }, 'Play short music': browser => { browser.page .index() .click('a.playlist-content:nth-child(4)') .waitForElementPresent('@pauseButton', PRESENT_WAIT_TIME); }, 'Wait till end': browser => { browser.page .index() .waitForElementNotPresent( '.playlist-content:nth-child(4) .thumbnail-wrapper i', PRESENT_WAIT_TIME ) .assert.elementPresent('@playButton') .assert.hasPlaylistLength(3); }, 'Clear playlist': browser => { browser.page .index() .click('@openClearModalButton') .waitForElementPresent('@clearModal', PRESENT_WAIT_TIME) .click('@clearButton') .waitForElementNotPresent('a.playlist-content', PRESENT_WAIT_TIME) .assert.hasPlaylistLength(0) .api.pause(WAIT_TIME); } };
unblee/jukebox
e2e/tests/index_test.js
JavaScript
mit
3,824
/*! * Bootstrap v3.3.7 (http://getbootstrap.com) * Copyright 2011-2016 Twitter, Inc. * Licensed under the MIT license */ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') } +function ($) { 'use strict'; var version = $.fn.jquery.split(' ')[0].split('.') if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) { throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4') } }(jQuery); /* ======================================================================== * Bootstrap: transition.js v3.3.7 * http://getbootstrap.com/javascript/#transitions * ======================================================================== * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) // ============================================================ function transitionEnd() { var el = document.createElement('bootstrap') var transEndEventNames = { WebkitTransition : 'webkitTransitionEnd', MozTransition : 'transitionend', OTransition : 'oTransitionEnd otransitionend', transition : 'transitionend' } for (var name in transEndEventNames) { if (el.style[name] !== undefined) { return { end: transEndEventNames[name] } } } return false // explicit for ie8 ( ._.) } // http://blog.alexmaccaw.com/css-transitions $.fn.emulateTransitionEnd = function (duration) { var called = false var $el = this $(this).one('bsTransitionEnd', function () { called = true }) var callback = function () { if (!called) $($el).trigger($.support.transition.end) } setTimeout(callback, duration) return this } $(function () { $.support.transition = transitionEnd() if (!$.support.transition) return $.event.special.bsTransitionEnd = { bindType: $.support.transition.end, delegateType: $.support.transition.end, handle: function (e) { if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) } } }) }(jQuery); /* ======================================================================== * Bootstrap: alert.js v3.3.7 * http://getbootstrap.com/javascript/#alerts * ======================================================================== * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // ALERT CLASS DEFINITION // ====================== var dismiss = '[data-dismiss="alert"]' var Alert = function (el) { $(el).on('click', dismiss, this.close) } Alert.VERSION = '3.3.7' Alert.TRANSITION_DURATION = 150 Alert.prototype.close = function (e) { var $this = $(this) var selector = $this.attr('data-target') if (!selector) { selector = $this.attr('href') selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } var $parent = $(selector === '#' ? [] : selector) if (e) e.preventDefault() if (!$parent.length) { $parent = $this.closest('.alert') } $parent.trigger(e = $.Event('close.bs.alert')) if (e.isDefaultPrevented()) return $parent.removeClass('in') function removeElement() { // detach from parent, fire event then clean up data $parent.detach().trigger('closed.bs.alert').remove() } $.support.transition && $parent.hasClass('fade') ? $parent .one('bsTransitionEnd', removeElement) .emulateTransitionEnd(Alert.TRANSITION_DURATION) : removeElement() } // ALERT PLUGIN DEFINITION // ======================= function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.alert') if (!data) $this.data('bs.alert', (data = new Alert(this))) if (typeof option == 'string') data[option].call($this) }) } var old = $.fn.alert $.fn.alert = Plugin $.fn.alert.Constructor = Alert // ALERT NO CONFLICT // ================= $.fn.alert.noConflict = function () { $.fn.alert = old return this } // ALERT DATA-API // ============== $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) }(jQuery); /* ======================================================================== * Bootstrap: button.js v3.3.7 * http://getbootstrap.com/javascript/#buttons * ======================================================================== * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // BUTTON PUBLIC CLASS DEFINITION // ============================== var Button = function (element, options) { this.$element = $(element) this.options = $.extend({}, Button.DEFAULTS, options) this.isLoading = false } Button.VERSION = '3.3.7' Button.DEFAULTS = { loadingText: 'loading...' } Button.prototype.setState = function (state) { var d = 'disabled' var $el = this.$element var val = $el.is('input') ? 'val' : 'html' var data = $el.data() state += 'Text' if (data.resetText == null) $el.data('resetText', $el[val]()) // push to event loop to allow forms to submit setTimeout($.proxy(function () { $el[val](data[state] == null ? this.options[state] : data[state]) if (state == 'loadingText') { this.isLoading = true $el.addClass(d).attr(d, d).prop(d, true) } else if (this.isLoading) { this.isLoading = false $el.removeClass(d).removeAttr(d).prop(d, false) } }, this), 0) } Button.prototype.toggle = function () { var changed = true var $parent = this.$element.closest('[data-toggle="buttons"]') if ($parent.length) { var $input = this.$element.find('input') if ($input.prop('type') == 'radio') { if ($input.prop('checked')) changed = false $parent.find('.active').removeClass('active') this.$element.addClass('active') } else if ($input.prop('type') == 'checkbox') { if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false this.$element.toggleClass('active') } $input.prop('checked', this.$element.hasClass('active')) if (changed) $input.trigger('change') } else { this.$element.attr('aria-pressed', !this.$element.hasClass('active')) this.$element.toggleClass('active') } } // BUTTON PLUGIN DEFINITION // ======================== function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.button') var options = typeof option == 'object' && option if (!data) $this.data('bs.button', (data = new Button(this, options))) if (option == 'toggle') data.toggle() else if (option) data.setState(option) }) } var old = $.fn.button $.fn.button = Plugin $.fn.button.Constructor = Button // BUTTON NO CONFLICT // ================== $.fn.button.noConflict = function () { $.fn.button = old return this } // BUTTON DATA-API // =============== $(document) .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { var $btn = $(e.target).closest('.btn') Plugin.call($btn, 'toggle') if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) { // Prevent double click on radios, and the double selections (so cancellation) on checkboxes e.preventDefault() // The target component still receive the focus if ($btn.is('input,button')) $btn.trigger('focus') else $btn.find('input:visible,button:visible').first().trigger('focus') } }) .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) }) }(jQuery); /* ======================================================================== * Bootstrap: carousel.js v3.3.7 * http://getbootstrap.com/javascript/#carousel * ======================================================================== * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // CAROUSEL CLASS DEFINITION // ========================= var Carousel = function (element, options) { this.$element = $(element) this.$indicators = this.$element.find('.carousel-indicators') this.options = options this.paused = null this.sliding = null this.interval = null this.$active = null this.$items = null this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) } Carousel.VERSION = '3.3.7' Carousel.TRANSITION_DURATION = 600 Carousel.DEFAULTS = { interval: 5000, pause: 'hover', wrap: true, keyboard: true } Carousel.prototype.keydown = function (e) { if (/input|textarea/i.test(e.target.tagName)) return switch (e.which) { case 37: this.prev(); break case 39: this.next(); break default: return } e.preventDefault() } Carousel.prototype.cycle = function (e) { e || (this.paused = false) this.interval && clearInterval(this.interval) this.options.interval && !this.paused && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) return this } Carousel.prototype.getItemIndex = function (item) { this.$items = item.parent().children('.item') return this.$items.index(item || this.$active) } Carousel.prototype.getItemForDirection = function (direction, active) { var activeIndex = this.getItemIndex(active) var willWrap = (direction == 'prev' && activeIndex === 0) || (direction == 'next' && activeIndex == (this.$items.length - 1)) if (willWrap && !this.options.wrap) return active var delta = direction == 'prev' ? -1 : 1 var itemIndex = (activeIndex + delta) % this.$items.length return this.$items.eq(itemIndex) } Carousel.prototype.to = function (pos) { var that = this var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) if (pos > (this.$items.length - 1) || pos < 0) return if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" if (activeIndex == pos) return this.pause().cycle() return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) } Carousel.prototype.pause = function (e) { e || (this.paused = true) if (this.$element.find('.next, .prev').length && $.support.transition) { this.$element.trigger($.support.transition.end) this.cycle(true) } this.interval = clearInterval(this.interval) return this } Carousel.prototype.next = function () { if (this.sliding) return return this.slide('next') } Carousel.prototype.prev = function () { if (this.sliding) return return this.slide('prev') } Carousel.prototype.slide = function (type, next) { var $active = this.$element.find('.item.active') var $next = next || this.getItemForDirection(type, $active) var isCycling = this.interval var direction = type == 'next' ? 'left' : 'right' var that = this if ($next.hasClass('active')) return (this.sliding = false) var relatedTarget = $next[0] var slideEvent = $.Event('slide.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) this.$element.trigger(slideEvent) if (slideEvent.isDefaultPrevented()) return this.sliding = true isCycling && this.pause() if (this.$indicators.length) { this.$indicators.find('.active').removeClass('active') var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]) $nextIndicator && $nextIndicator.addClass('active') } var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid" if ($.support.transition && this.$element.hasClass('slide')) { $next.addClass(type) $next[0].offsetWidth // force reflow $active.addClass(direction) $next.addClass(direction) $active .one('bsTransitionEnd', function () { $next.removeClass([type, direction].join(' ')).addClass('active') $active.removeClass(['active', direction].join(' ')) that.sliding = false setTimeout(function () { that.$element.trigger(slidEvent) }, 0) }) .emulateTransitionEnd(Carousel.TRANSITION_DURATION) } else { $active.removeClass('active') $next.addClass('active') this.sliding = false this.$element.trigger(slidEvent) } isCycling && this.cycle() return this } // CAROUSEL PLUGIN DEFINITION // ========================== function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.carousel') var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) var action = typeof option == 'string' ? option : options.slide if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) if (typeof option == 'number') data.to(option) else if (action) data[action]() else if (options.interval) data.pause().cycle() }) } var old = $.fn.carousel $.fn.carousel = Plugin $.fn.carousel.Constructor = Carousel // CAROUSEL NO CONFLICT // ==================== $.fn.carousel.noConflict = function () { $.fn.carousel = old return this } // CAROUSEL DATA-API // ================= var clickHandler = function (e) { var href var $this = $(this) var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 if (!$target.hasClass('carousel')) return var options = $.extend({}, $target.data(), $this.data()) var slideIndex = $this.attr('data-slide-to') if (slideIndex) options.interval = false Plugin.call($target, options) if (slideIndex) { $target.data('bs.carousel').to(slideIndex) } e.preventDefault() } $(document) .on('click.bs.carousel.data-api', '[data-slide]', clickHandler) .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler) $(window).on('load', function () { $('[data-ride="carousel"]').each(function () { var $carousel = $(this) Plugin.call($carousel, $carousel.data()) }) }) }(jQuery); /* ======================================================================== * Bootstrap: collapse.js v3.3.7 * http://getbootstrap.com/javascript/#collapse * ======================================================================== * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ /* jshint latedef: false */ +function ($) { 'use strict'; // COLLAPSE PUBLIC CLASS DEFINITION // ================================ var Collapse = function (element, options) { this.$element = $(element) this.options = $.extend({}, Collapse.DEFAULTS, options) this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + '[data-toggle="collapse"][data-target="#' + element.id + '"]') this.transitioning = null if (this.options.parent) { this.$parent = this.getParent() } else { this.addAriaAndCollapsedClass(this.$element, this.$trigger) } if (this.options.toggle) this.toggle() } Collapse.VERSION = '3.3.7' Collapse.TRANSITION_DURATION = 350 Collapse.DEFAULTS = { toggle: true } Collapse.prototype.dimension = function () { var hasWidth = this.$element.hasClass('width') return hasWidth ? 'width' : 'height' } Collapse.prototype.show = function () { if (this.transitioning || this.$element.hasClass('in')) return var activesData var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing') if (actives && actives.length) { activesData = actives.data('bs.collapse') if (activesData && activesData.transitioning) return } var startEvent = $.Event('show.bs.collapse') this.$element.trigger(startEvent) if (startEvent.isDefaultPrevented()) return if (actives && actives.length) { Plugin.call(actives, 'hide') activesData || actives.data('bs.collapse', null) } var dimension = this.dimension() this.$element .removeClass('collapse') .addClass('collapsing')[dimension](0) .attr('aria-expanded', true) this.$trigger .removeClass('collapsed') .attr('aria-expanded', true) this.transitioning = 1 var complete = function () { this.$element .removeClass('collapsing') .addClass('collapse in')[dimension]('') this.transitioning = 0 this.$element .trigger('shown.bs.collapse') } if (!$.support.transition) return complete.call(this) var scrollSize = $.camelCase(['scroll', dimension].join('-')) this.$element .one('bsTransitionEnd', $.proxy(complete, this)) .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) } Collapse.prototype.hide = function () { if (this.transitioning || !this.$element.hasClass('in')) return var startEvent = $.Event('hide.bs.collapse') this.$element.trigger(startEvent) if (startEvent.isDefaultPrevented()) return var dimension = this.dimension() this.$element[dimension](this.$element[dimension]())[0].offsetHeight this.$element .addClass('collapsing') .removeClass('collapse in') .attr('aria-expanded', false) this.$trigger .addClass('collapsed') .attr('aria-expanded', false) this.transitioning = 1 var complete = function () { this.transitioning = 0 this.$element .removeClass('collapsing') .addClass('collapse') .trigger('hidden.bs.collapse') } if (!$.support.transition) return complete.call(this) this.$element [dimension](0) .one('bsTransitionEnd', $.proxy(complete, this)) .emulateTransitionEnd(Collapse.TRANSITION_DURATION) } Collapse.prototype.toggle = function () { this[this.$element.hasClass('in') ? 'hide' : 'show']() } Collapse.prototype.getParent = function () { return $(this.options.parent) .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') .each($.proxy(function (i, element) { var $element = $(element) this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) }, this)) .end() } Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { var isOpen = $element.hasClass('in') $element.attr('aria-expanded', isOpen) $trigger .toggleClass('collapsed', !isOpen) .attr('aria-expanded', isOpen) } function getTargetFromTrigger($trigger) { var href var target = $trigger.attr('data-target') || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 return $(target) } // COLLAPSE PLUGIN DEFINITION // ========================== function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.collapse') var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) if (typeof option == 'string') data[option]() }) } var old = $.fn.collapse $.fn.collapse = Plugin $.fn.collapse.Constructor = Collapse // COLLAPSE NO CONFLICT // ==================== $.fn.collapse.noConflict = function () { $.fn.collapse = old return this } // COLLAPSE DATA-API // ================= $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { var $this = $(this) if (!$this.attr('data-target')) e.preventDefault() var $target = getTargetFromTrigger($this) var data = $target.data('bs.collapse') var option = data ? 'toggle' : $this.data() Plugin.call($target, option) }) }(jQuery); /* ======================================================================== * Bootstrap: dropdown.js v3.3.7 * http://getbootstrap.com/javascript/#dropdowns * ======================================================================== * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // DROPDOWN CLASS DEFINITION // ========================= var backdrop = '.dropdown-backdrop' var toggle = '[data-toggle="dropdown"]' var Dropdown = function (element) { $(element).on('click.bs.dropdown', this.toggle) } Dropdown.VERSION = '3.3.7' function getParent($this) { var selector = $this.attr('data-target') if (!selector) { selector = $this.attr('href') selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } var $parent = selector && $(selector) return $parent && $parent.length ? $parent : $this.parent() } function clearMenus(e) { if (e && e.which === 3) return $(backdrop).remove() $(toggle).each(function () { var $this = $(this) var $parent = getParent($this) var relatedTarget = { relatedTarget: this } if (!$parent.hasClass('open')) return if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) if (e.isDefaultPrevented()) return $this.attr('aria-expanded', 'false') $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget)) }) } Dropdown.prototype.toggle = function (e) { var $this = $(this) if ($this.is('.disabled, :disabled')) return var $parent = getParent($this) var isActive = $parent.hasClass('open') clearMenus() if (!isActive) { if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { // if mobile we use a backdrop because click events don't delegate $(document.createElement('div')) .addClass('dropdown-backdrop') .insertAfter($(this)) .on('click', clearMenus) } var relatedTarget = { relatedTarget: this } $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)) if (e.isDefaultPrevented()) return $this .trigger('focus') .attr('aria-expanded', 'true') $parent .toggleClass('open') .trigger($.Event('shown.bs.dropdown', relatedTarget)) } return false } Dropdown.prototype.keydown = function (e) { if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return var $this = $(this) e.preventDefault() e.stopPropagation() if ($this.is('.disabled, :disabled')) return var $parent = getParent($this) var isActive = $parent.hasClass('open') if (!isActive && e.which != 27 || isActive && e.which == 27) { if (e.which == 27) $parent.find(toggle).trigger('focus') return $this.trigger('click') } var desc = ' li:not(.disabled):visible a' var $items = $parent.find('.dropdown-menu' + desc) if (!$items.length) return var index = $items.index(e.target) if (e.which == 38 && index > 0) index-- // up if (e.which == 40 && index < $items.length - 1) index++ // down if (!~index) index = 0 $items.eq(index).trigger('focus') } // DROPDOWN PLUGIN DEFINITION // ========================== function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.dropdown') if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) if (typeof option == 'string') data[option].call($this) }) } var old = $.fn.dropdown $.fn.dropdown = Plugin $.fn.dropdown.Constructor = Dropdown // DROPDOWN NO CONFLICT // ==================== $.fn.dropdown.noConflict = function () { $.fn.dropdown = old return this } // APPLY TO STANDARD DROPDOWN ELEMENTS // =================================== $(document) .on('click.bs.dropdown.data-api', clearMenus) .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown) }(jQuery); /* ======================================================================== * Bootstrap: modal.js v3.3.7 * http://getbootstrap.com/javascript/#modals * ======================================================================== * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // MODAL CLASS DEFINITION // ====================== var Modal = function (element, options) { this.options = options this.$body = $(document.body) this.$element = $(element) this.$dialog = this.$element.find('.modal-dialog') this.$backdrop = null this.isShown = null this.originalBodyPad = null this.scrollbarWidth = 0 this.ignoreBackdropClick = false if (this.options.remote) { this.$element .find('.modal-content') .load(this.options.remote, $.proxy(function () { this.$element.trigger('loaded.bs.modal') }, this)) } } Modal.VERSION = '3.3.7' Modal.TRANSITION_DURATION = 300 Modal.BACKDROP_TRANSITION_DURATION = 150 Modal.DEFAULTS = { backdrop: true, keyboard: true, show: true } Modal.prototype.toggle = function (_relatedTarget) { return this.isShown ? this.hide() : this.show(_relatedTarget) } Modal.prototype.show = function (_relatedTarget) { var that = this var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) this.$element.trigger(e) if (this.isShown || e.isDefaultPrevented()) return this.isShown = true this.checkScrollbar() this.setScrollbar() this.$body.addClass('modal-open') this.escape() this.resize() this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) this.$dialog.on('mousedown.dismiss.bs.modal', function () { that.$element.one('mouseup.dismiss.bs.modal', function (e) { if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true }) }) this.backdrop(function () { var transition = $.support.transition && that.$element.hasClass('fade') if (!that.$element.parent().length) { that.$element.appendTo(that.$body) // don't move modals dom position } that.$element .show() .scrollTop(0) that.adjustDialog() if (transition) { that.$element[0].offsetWidth // force reflow } that.$element.addClass('in') that.enforceFocus() var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) transition ? that.$dialog // wait for modal to slide in .one('bsTransitionEnd', function () { that.$element.trigger('focus').trigger(e) }) .emulateTransitionEnd(Modal.TRANSITION_DURATION) : that.$element.trigger('focus').trigger(e) }) } Modal.prototype.hide = function (e) { if (e) e.preventDefault() e = $.Event('hide.bs.modal') this.$element.trigger(e) if (!this.isShown || e.isDefaultPrevented()) return this.isShown = false this.escape() this.resize() $(document).off('focusin.bs.modal') this.$element .removeClass('in') .off('click.dismiss.bs.modal') .off('mouseup.dismiss.bs.modal') this.$dialog.off('mousedown.dismiss.bs.modal') $.support.transition && this.$element.hasClass('fade') ? this.$element .one('bsTransitionEnd', $.proxy(this.hideModal, this)) .emulateTransitionEnd(Modal.TRANSITION_DURATION) : this.hideModal() } Modal.prototype.enforceFocus = function () { $(document) .off('focusin.bs.modal') // guard against infinite focus loop .on('focusin.bs.modal', $.proxy(function (e) { if (document !== e.target && this.$element[0] !== e.target && !this.$element.has(e.target).length) { this.$element.trigger('focus') } }, this)) } Modal.prototype.escape = function () { if (this.isShown && this.options.keyboard) { this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) { e.which == 27 && this.hide() }, this)) } else if (!this.isShown) { this.$element.off('keydown.dismiss.bs.modal') } } Modal.prototype.resize = function () { if (this.isShown) { $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this)) } else { $(window).off('resize.bs.modal') } } Modal.prototype.hideModal = function () { var that = this this.$element.hide() this.backdrop(function () { that.$body.removeClass('modal-open') that.resetAdjustments() that.resetScrollbar() that.$element.trigger('hidden.bs.modal') }) } Modal.prototype.removeBackdrop = function () { this.$backdrop && this.$backdrop.remove() this.$backdrop = null } Modal.prototype.backdrop = function (callback) { var that = this var animate = this.$element.hasClass('fade') ? 'fade' : '' if (this.isShown && this.options.backdrop) { var doAnimate = $.support.transition && animate this.$backdrop = $(document.createElement('div')) .addClass('modal-backdrop ' + animate) .appendTo(this.$body) this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { if (this.ignoreBackdropClick) { this.ignoreBackdropClick = false return } if (e.target !== e.currentTarget) return this.options.backdrop == 'static' ? this.$element[0].focus() : this.hide() }, this)) if (doAnimate) this.$backdrop[0].offsetWidth // force reflow this.$backdrop.addClass('in') if (!callback) return doAnimate ? this.$backdrop .one('bsTransitionEnd', callback) .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : callback() } else if (!this.isShown && this.$backdrop) { this.$backdrop.removeClass('in') var callbackRemove = function () { that.removeBackdrop() callback && callback() } $.support.transition && this.$element.hasClass('fade') ? this.$backdrop .one('bsTransitionEnd', callbackRemove) .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : callbackRemove() } else if (callback) { callback() } } // these following methods are used to handle overflowing modals Modal.prototype.handleUpdate = function () { this.adjustDialog() } Modal.prototype.adjustDialog = function () { var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight this.$element.css({ paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '', paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : '' }) } Modal.prototype.resetAdjustments = function () { this.$element.css({ paddingLeft: '', paddingRight: '' }) } Modal.prototype.checkScrollbar = function () { var fullWindowWidth = window.innerWidth if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8 var documentElementRect = document.documentElement.getBoundingClientRect() fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left) } this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth this.scrollbarWidth = this.measureScrollbar() } Modal.prototype.setScrollbar = function () { var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10) this.originalBodyPad = document.body.style.paddingRight || '' if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth) } Modal.prototype.resetScrollbar = function () { this.$body.css('padding-right', this.originalBodyPad) } Modal.prototype.measureScrollbar = function () { // thx walsh var scrollDiv = document.createElement('div') scrollDiv.className = 'modal-scrollbar-measure' this.$body.append(scrollDiv) var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth this.$body[0].removeChild(scrollDiv) return scrollbarWidth } // MODAL PLUGIN DEFINITION // ======================= function Plugin(option, _relatedTarget) { return this.each(function () { var $this = $(this) var data = $this.data('bs.modal') var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) if (!data) $this.data('bs.modal', (data = new Modal(this, options))) if (typeof option == 'string') data[option](_relatedTarget) else if (options.show) data.show(_relatedTarget) }) } var old = $.fn.modal $.fn.modal = Plugin $.fn.modal.Constructor = Modal // MODAL NO CONFLICT // ================= $.fn.modal.noConflict = function () { $.fn.modal = old return this } // MODAL DATA-API // ============== $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { var $this = $(this) var href = $this.attr('href') var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7 var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) if ($this.is('a')) e.preventDefault() $target.one('show.bs.modal', function (showEvent) { if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown $target.one('hidden.bs.modal', function () { $this.is(':visible') && $this.trigger('focus') }) }) Plugin.call($target, option, this) }) }(jQuery); /* ======================================================================== * Bootstrap: tooltip.js v3.3.7 * http://getbootstrap.com/javascript/#tooltip * Inspired by the original jQuery.tipsy by Jason Frame * ======================================================================== * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // TOOLTIP PUBLIC CLASS DEFINITION // =============================== var Tooltip = function (element, options) { this.type = null this.options = null this.enabled = null this.timeout = null this.hoverState = null this.$element = null this.inState = null this.init('tooltip', element, options) } Tooltip.VERSION = '3.3.7' Tooltip.TRANSITION_DURATION = 150 Tooltip.DEFAULTS = { animation: true, placement: 'top', selector: false, template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', trigger: 'hover focus', title: '', delay: 0, html: false, container: false, viewport: { selector: 'body', padding: 0 } } Tooltip.prototype.init = function (type, element, options) { this.enabled = true this.type = type this.$element = $(element) this.options = this.getOptions(options) this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport)) this.inState = { click: false, hover: false, focus: false } if (this.$element[0] instanceof document.constructor && !this.options.selector) { throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!') } var triggers = this.options.trigger.split(' ') for (var i = triggers.length; i--;) { var trigger = triggers[i] if (trigger == 'click') { this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) } else if (trigger != 'manual') { var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) } } this.options.selector ? (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : this.fixTitle() } Tooltip.prototype.getDefaults = function () { return Tooltip.DEFAULTS } Tooltip.prototype.getOptions = function (options) { options = $.extend({}, this.getDefaults(), this.$element.data(), options) if (options.delay && typeof options.delay == 'number') { options.delay = { show: options.delay, hide: options.delay } } return options } Tooltip.prototype.getDelegateOptions = function () { var options = {} var defaults = this.getDefaults() this._options && $.each(this._options, function (key, value) { if (defaults[key] != value) options[key] = value }) return options } Tooltip.prototype.enter = function (obj) { var self = obj instanceof this.constructor ? obj : $(obj.currentTarget).data('bs.' + this.type) if (!self) { self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) $(obj.currentTarget).data('bs.' + this.type, self) } if (obj instanceof $.Event) { self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true } if (self.tip().hasClass('in') || self.hoverState == 'in') { self.hoverState = 'in' return } clearTimeout(self.timeout) self.hoverState = 'in' if (!self.options.delay || !self.options.delay.show) return self.show() self.timeout = setTimeout(function () { if (self.hoverState == 'in') self.show() }, self.options.delay.show) } Tooltip.prototype.isInStateTrue = function () { for (var key in this.inState) { if (this.inState[key]) return true } return false } Tooltip.prototype.leave = function (obj) { var self = obj instanceof this.constructor ? obj : $(obj.currentTarget).data('bs.' + this.type) if (!self) { self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) $(obj.currentTarget).data('bs.' + this.type, self) } if (obj instanceof $.Event) { self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false } if (self.isInStateTrue()) return clearTimeout(self.timeout) self.hoverState = 'out' if (!self.options.delay || !self.options.delay.hide) return self.hide() self.timeout = setTimeout(function () { if (self.hoverState == 'out') self.hide() }, self.options.delay.hide) } Tooltip.prototype.show = function () { var e = $.Event('show.bs.' + this.type) if (this.hasContent() && this.enabled) { this.$element.trigger(e) var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]) if (e.isDefaultPrevented() || !inDom) return var that = this var $tip = this.tip() var tipId = this.getUID(this.type) this.setContent() $tip.attr('id', tipId) this.$element.attr('aria-describedby', tipId) if (this.options.animation) $tip.addClass('fade') var placement = typeof this.options.placement == 'function' ? this.options.placement.call(this, $tip[0], this.$element[0]) : this.options.placement var autoToken = /\s?auto?\s?/i var autoPlace = autoToken.test(placement) if (autoPlace) placement = placement.replace(autoToken, '') || 'top' $tip .detach() .css({ top: 0, left: 0, display: 'block' }) .addClass(placement) .data('bs.' + this.type, this) this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) this.$element.trigger('inserted.bs.' + this.type) var pos = this.getPosition() var actualWidth = $tip[0].offsetWidth var actualHeight = $tip[0].offsetHeight if (autoPlace) { var orgPlacement = placement var viewportDim = this.getPosition(this.$viewport) placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : placement $tip .removeClass(orgPlacement) .addClass(placement) } var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) this.applyPlacement(calculatedOffset, placement) var complete = function () { var prevHoverState = that.hoverState that.$element.trigger('shown.bs.' + that.type) that.hoverState = null if (prevHoverState == 'out') that.leave(that) } $.support.transition && this.$tip.hasClass('fade') ? $tip .one('bsTransitionEnd', complete) .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete() } } Tooltip.prototype.applyPlacement = function (offset, placement) { var $tip = this.tip() var width = $tip[0].offsetWidth var height = $tip[0].offsetHeight // manually read margins because getBoundingClientRect includes difference var marginTop = parseInt($tip.css('margin-top'), 10) var marginLeft = parseInt($tip.css('margin-left'), 10) // we must check for NaN for ie 8/9 if (isNaN(marginTop)) marginTop = 0 if (isNaN(marginLeft)) marginLeft = 0 offset.top += marginTop offset.left += marginLeft // $.fn.offset doesn't round pixel values // so we use setOffset directly with our own function B-0 $.offset.setOffset($tip[0], $.extend({ using: function (props) { $tip.css({ top: Math.round(props.top), left: Math.round(props.left) }) } }, offset), 0) $tip.addClass('in') // check to see if placing tip in new offset caused the tip to resize itself var actualWidth = $tip[0].offsetWidth var actualHeight = $tip[0].offsetHeight if (placement == 'top' && actualHeight != height) { offset.top = offset.top + height - actualHeight } var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight) if (delta.left) offset.left += delta.left else offset.top += delta.top var isVertical = /top|bottom/.test(placement) var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight' $tip.offset(offset) this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical) } Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) { this.arrow() .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') .css(isVertical ? 'top' : 'left', '') } Tooltip.prototype.setContent = function () { var $tip = this.tip() var title = this.getTitle() $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) $tip.removeClass('fade in top bottom left right') } Tooltip.prototype.hide = function (callback) { var that = this var $tip = $(this.$tip) var e = $.Event('hide.bs.' + this.type) function complete() { if (that.hoverState != 'in') $tip.detach() if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary. that.$element .removeAttr('aria-describedby') .trigger('hidden.bs.' + that.type) } callback && callback() } this.$element.trigger(e) if (e.isDefaultPrevented()) return $tip.removeClass('in') $.support.transition && $tip.hasClass('fade') ? $tip .one('bsTransitionEnd', complete) .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete() this.hoverState = null return this } Tooltip.prototype.fixTitle = function () { var $e = this.$element if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') { $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') } } Tooltip.prototype.hasContent = function () { return this.getTitle() } Tooltip.prototype.getPosition = function ($element) { $element = $element || this.$element var el = $element[0] var isBody = el.tagName == 'BODY' var elRect = el.getBoundingClientRect() if (elRect.width == null) { // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top }) } var isSvg = window.SVGElement && el instanceof window.SVGElement // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3. // See https://github.com/twbs/bootstrap/issues/20280 var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset()) var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() } var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null return $.extend({}, elRect, scroll, outerDims, elOffset) } Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } } Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) { var delta = { top: 0, left: 0 } if (!this.$viewport) return delta var viewportPadding = this.options.viewport && this.options.viewport.padding || 0 var viewportDimensions = this.getPosition(this.$viewport) if (/right|left/.test(placement)) { var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight if (topEdgeOffset < viewportDimensions.top) { // top overflow delta.top = viewportDimensions.top - topEdgeOffset } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset } } else { var leftEdgeOffset = pos.left - viewportPadding var rightEdgeOffset = pos.left + viewportPadding + actualWidth if (leftEdgeOffset < viewportDimensions.left) { // left overflow delta.left = viewportDimensions.left - leftEdgeOffset } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset } } return delta } Tooltip.prototype.getTitle = function () { var title var $e = this.$element var o = this.options title = $e.attr('data-original-title') || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) return title } Tooltip.prototype.getUID = function (prefix) { do prefix += ~~(Math.random() * 1000000) while (document.getElementById(prefix)) return prefix } Tooltip.prototype.tip = function () { if (!this.$tip) { this.$tip = $(this.options.template) if (this.$tip.length != 1) { throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!') } } return this.$tip } Tooltip.prototype.arrow = function () { return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')) } Tooltip.prototype.enable = function () { this.enabled = true } Tooltip.prototype.disable = function () { this.enabled = false } Tooltip.prototype.toggleEnabled = function () { this.enabled = !this.enabled } Tooltip.prototype.toggle = function (e) { var self = this if (e) { self = $(e.currentTarget).data('bs.' + this.type) if (!self) { self = new this.constructor(e.currentTarget, this.getDelegateOptions()) $(e.currentTarget).data('bs.' + this.type, self) } } if (e) { self.inState.click = !self.inState.click if (self.isInStateTrue()) self.enter(self) else self.leave(self) } else { self.tip().hasClass('in') ? self.leave(self) : self.enter(self) } } Tooltip.prototype.destroy = function () { var that = this clearTimeout(this.timeout) this.hide(function () { that.$element.off('.' + that.type).removeData('bs.' + that.type) if (that.$tip) { that.$tip.detach() } that.$tip = null that.$arrow = null that.$viewport = null that.$element = null }) } // TOOLTIP PLUGIN DEFINITION // ========================= function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.tooltip') var options = typeof option == 'object' && option if (!data && /destroy|hide/.test(option)) return if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) if (typeof option == 'string') data[option]() }) } var old = $.fn.tooltip $.fn.tooltip = Plugin $.fn.tooltip.Constructor = Tooltip // TOOLTIP NO CONFLICT // =================== $.fn.tooltip.noConflict = function () { $.fn.tooltip = old return this } }(jQuery); /* ======================================================================== * Bootstrap: popover.js v3.3.7 * http://getbootstrap.com/javascript/#popovers * ======================================================================== * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // POPOVER PUBLIC CLASS DEFINITION // =============================== var Popover = function (element, options) { this.init('popover', element, options) } if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') Popover.VERSION = '3.3.7' Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { placement: 'right', trigger: 'click', content: '', template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' }) // NOTE: POPOVER EXTENDS tooltip.js // ================================ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) Popover.prototype.constructor = Popover Popover.prototype.getDefaults = function () { return Popover.DEFAULTS } Popover.prototype.setContent = function () { var $tip = this.tip() var title = this.getTitle() var content = this.getContent() $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' ](content) $tip.removeClass('fade top bottom left right in') // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do // this manually by checking the contents. if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() } Popover.prototype.hasContent = function () { return this.getTitle() || this.getContent() } Popover.prototype.getContent = function () { var $e = this.$element var o = this.options return $e.attr('data-content') || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) } Popover.prototype.arrow = function () { return (this.$arrow = this.$arrow || this.tip().find('.arrow')) } // POPOVER PLUGIN DEFINITION // ========================= function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.popover') var options = typeof option == 'object' && option if (!data && /destroy|hide/.test(option)) return if (!data) $this.data('bs.popover', (data = new Popover(this, options))) if (typeof option == 'string') data[option]() }) } var old = $.fn.popover $.fn.popover = Plugin $.fn.popover.Constructor = Popover // POPOVER NO CONFLICT // =================== $.fn.popover.noConflict = function () { $.fn.popover = old return this } }(jQuery); /* ======================================================================== * Bootstrap: scrollspy.js v3.3.7 * http://getbootstrap.com/javascript/#scrollspy * ======================================================================== * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // SCROLLSPY CLASS DEFINITION // ========================== function ScrollSpy(element, options) { this.$body = $(document.body) this.$scrollElement = $(element).is(document.body) ? $(window) : $(element) this.options = $.extend({}, ScrollSpy.DEFAULTS, options) this.selector = (this.options.target || '') + ' .nav li > a' this.offsets = [] this.targets = [] this.activeTarget = null this.scrollHeight = 0 this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this)) this.refresh() this.process() } ScrollSpy.VERSION = '3.3.7' ScrollSpy.DEFAULTS = { offset: 10 } ScrollSpy.prototype.getScrollHeight = function () { return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) } ScrollSpy.prototype.refresh = function () { var that = this var offsetMethod = 'offset' var offsetBase = 0 this.offsets = [] this.targets = [] this.scrollHeight = this.getScrollHeight() if (!$.isWindow(this.$scrollElement[0])) { offsetMethod = 'position' offsetBase = this.$scrollElement.scrollTop() } this.$body .find(this.selector) .map(function () { var $el = $(this) var href = $el.data('target') || $el.attr('href') var $href = /^#./.test(href) && $(href) return ($href && $href.length && $href.is(':visible') && [[$href[offsetMethod]().top + offsetBase, href]]) || null }) .sort(function (a, b) { return a[0] - b[0] }) .each(function () { that.offsets.push(this[0]) that.targets.push(this[1]) }) } ScrollSpy.prototype.process = function () { var scrollTop = this.$scrollElement.scrollTop() + this.options.offset var scrollHeight = this.getScrollHeight() var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height() var offsets = this.offsets var targets = this.targets var activeTarget = this.activeTarget var i if (this.scrollHeight != scrollHeight) { this.refresh() } if (scrollTop >= maxScroll) { return activeTarget != (i = targets[targets.length - 1]) && this.activate(i) } if (activeTarget && scrollTop < offsets[0]) { this.activeTarget = null return this.clear() } for (i = offsets.length; i--;) { activeTarget != targets[i] && scrollTop >= offsets[i] && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1]) && this.activate(targets[i]) } } ScrollSpy.prototype.activate = function (target) { this.activeTarget = target this.clear() var selector = this.selector + '[data-target="' + target + '"],' + this.selector + '[href="' + target + '"]' var active = $(selector) .parents('li') .addClass('active') if (active.parent('.dropdown-menu').length) { active = active .closest('li.dropdown') .addClass('active') } active.trigger('activate.bs.scrollspy') } ScrollSpy.prototype.clear = function () { $(this.selector) .parentsUntil(this.options.target, '.active') .removeClass('active') } // SCROLLSPY PLUGIN DEFINITION // =========================== function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.scrollspy') var options = typeof option == 'object' && option if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) if (typeof option == 'string') data[option]() }) } var old = $.fn.scrollspy $.fn.scrollspy = Plugin $.fn.scrollspy.Constructor = ScrollSpy // SCROLLSPY NO CONFLICT // ===================== $.fn.scrollspy.noConflict = function () { $.fn.scrollspy = old return this } // SCROLLSPY DATA-API // ================== $(window).on('load.bs.scrollspy.data-api', function () { $('[data-spy="scroll"]').each(function () { var $spy = $(this) Plugin.call($spy, $spy.data()) }) }) }(jQuery); /* ======================================================================== * Bootstrap: tab.js v3.3.7 * http://getbootstrap.com/javascript/#tabs * ======================================================================== * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // TAB CLASS DEFINITION // ==================== var Tab = function (element) { // jscs:disable requireDollarBeforejQueryAssignment this.element = $(element) // jscs:enable requireDollarBeforejQueryAssignment } Tab.VERSION = '3.3.7' Tab.TRANSITION_DURATION = 150 Tab.prototype.show = function () { var $this = this.element var $ul = $this.closest('ul:not(.dropdown-menu)') var selector = $this.data('target') if (!selector) { selector = $this.attr('href') selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } if ($this.parent('li').hasClass('active')) return var $previous = $ul.find('.active:last a') var hideEvent = $.Event('hide.bs.tab', { relatedTarget: $this[0] }) var showEvent = $.Event('show.bs.tab', { relatedTarget: $previous[0] }) $previous.trigger(hideEvent) $this.trigger(showEvent) if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return var $target = $(selector) this.activate($this.closest('li'), $ul) this.activate($target, $target.parent(), function () { $previous.trigger({ type: 'hidden.bs.tab', relatedTarget: $this[0] }) $this.trigger({ type: 'shown.bs.tab', relatedTarget: $previous[0] }) }) } Tab.prototype.activate = function (element, container, callback) { var $active = container.find('> .active') var transition = callback && $.support.transition && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length) function next() { $active .removeClass('active') .find('> .dropdown-menu > .active') .removeClass('active') .end() .find('[data-toggle="tab"]') .attr('aria-expanded', false) element .addClass('active') .find('[data-toggle="tab"]') .attr('aria-expanded', true) if (transition) { element[0].offsetWidth // reflow for transition element.addClass('in') } else { element.removeClass('fade') } if (element.parent('.dropdown-menu').length) { element .closest('li.dropdown') .addClass('active') .end() .find('[data-toggle="tab"]') .attr('aria-expanded', true) } callback && callback() } $active.length && transition ? $active .one('bsTransitionEnd', next) .emulateTransitionEnd(Tab.TRANSITION_DURATION) : next() $active.removeClass('in') } // TAB PLUGIN DEFINITION // ===================== function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.tab') if (!data) $this.data('bs.tab', (data = new Tab(this))) if (typeof option == 'string') data[option]() }) } var old = $.fn.tab $.fn.tab = Plugin $.fn.tab.Constructor = Tab // TAB NO CONFLICT // =============== $.fn.tab.noConflict = function () { $.fn.tab = old return this } // TAB DATA-API // ============ var clickHandler = function (e) { e.preventDefault() Plugin.call($(this), 'show') } $(document) .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler) .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler) }(jQuery); /* ======================================================================== * Bootstrap: affix.js v3.3.7 * http://getbootstrap.com/javascript/#affix * ======================================================================== * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // AFFIX CLASS DEFINITION // ====================== var Affix = function (element, options) { this.options = $.extend({}, Affix.DEFAULTS, options) this.$target = $(this.options.target) .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) this.$element = $(element) this.affixed = null this.unpin = null this.pinnedOffset = null this.checkPosition() } Affix.VERSION = '3.3.7' Affix.RESET = 'affix affix-top affix-bottom' Affix.DEFAULTS = { offset: 0, target: window } Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) { var scrollTop = this.$target.scrollTop() var position = this.$element.offset() var targetHeight = this.$target.height() if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false if (this.affixed == 'bottom') { if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom' return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom' } var initializing = this.affixed == null var colliderTop = initializing ? scrollTop : position.top var colliderHeight = initializing ? targetHeight : height if (offsetTop != null && scrollTop <= offsetTop) return 'top' if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom' return false } Affix.prototype.getPinnedOffset = function () { if (this.pinnedOffset) return this.pinnedOffset this.$element.removeClass(Affix.RESET).addClass('affix') var scrollTop = this.$target.scrollTop() var position = this.$element.offset() return (this.pinnedOffset = position.top - scrollTop) } Affix.prototype.checkPositionWithEventLoop = function () { setTimeout($.proxy(this.checkPosition, this), 1) } Affix.prototype.checkPosition = function () { if (!this.$element.is(':visible')) return var height = this.$element.height() var offset = this.options.offset var offsetTop = offset.top var offsetBottom = offset.bottom var scrollHeight = Math.max($(document).height(), $(document.body).height()) if (typeof offset != 'object') offsetBottom = offsetTop = offset if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom) if (this.affixed != affix) { if (this.unpin != null) this.$element.css('top', '') var affixType = 'affix' + (affix ? '-' + affix : '') var e = $.Event(affixType + '.bs.affix') this.$element.trigger(e) if (e.isDefaultPrevented()) return this.affixed = affix this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null this.$element .removeClass(Affix.RESET) .addClass(affixType) .trigger(affixType.replace('affix', 'affixed') + '.bs.affix') } if (affix == 'bottom') { this.$element.offset({ top: scrollHeight - height - offsetBottom }) } } // AFFIX PLUGIN DEFINITION // ======================= function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.affix') var options = typeof option == 'object' && option if (!data) $this.data('bs.affix', (data = new Affix(this, options))) if (typeof option == 'string') data[option]() }) } var old = $.fn.affix $.fn.affix = Plugin $.fn.affix.Constructor = Affix // AFFIX NO CONFLICT // ================= $.fn.affix.noConflict = function () { $.fn.affix = old return this } // AFFIX DATA-API // ============== $(window).on('load', function () { $('[data-spy="affix"]').each(function () { var $spy = $(this) var data = $spy.data() data.offset = data.offset || {} if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom if (data.offsetTop != null) data.offset.top = data.offsetTop Plugin.call($spy, data) }) }) }(jQuery); $(function () { $('.button-checkbox').each(function () { // Settings var $widget = $(this), $button = $widget.find('button'), $checkbox = $widget.find('input:checkbox'), color = $button.data('color'), settings = { on: { icon: 'glyphicon glyphicon-check' }, off: { icon: 'fa fa-square-o' } }; // Event Handlers $button.on('click', function () { $checkbox.prop('checked', !$checkbox.is(':checked')); $checkbox.triggerHandler('change'); updateDisplay(); }); $checkbox.on('change', function () { updateDisplay(); }); // Actions function updateDisplay() { var isChecked = $checkbox.is(':checked'); // Set the button's state $button.data('state', (isChecked) ? "on" : "off"); // Set the button's icon $button.find('.state-icon') .removeClass() .addClass('state-icon ' + settings[$button.data('state')].icon); // Update the button's color if (isChecked) { $button .removeClass('btn-default') .addClass('btn-' + color + ' active'); } else { $button .removeClass('btn-' + color + ' active') .addClass('btn-default'); } } // Initialization function init() { updateDisplay(); // Inject the icon if applicable if ($button.find('.state-icon').length == 0) { $button.prepend('<i class="state-icon ' + settings[$button.data('state')].icon + '"></i> '); } } init(); }); });
austinxiao-ucsd/cogs120-webapp
js/bootstrap.js
JavaScript
mit
71,641