code
stringlengths 2
1.05M
| repo_name
stringlengths 5
114
| path
stringlengths 4
991
| language
stringclasses 1
value | license
stringclasses 15
values | size
int32 2
1.05M
|
---|---|---|---|---|---|
(function(ht) {
function plotChart() {
$.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=aapl-c.json&callback=?', function (data) {
// Create the chart
ht.StockChart(
{
chart : {
renderTo : 'chart'
},
rangeSelector : {
selected : 1
},
title : {
text : 'AAPL Stock Price'
},
series : [{
name : 'AAPL',
data : data,
tooltip: {
valueDecimals: 2
}
}]
});
});
}
module.exports = {plot : plotChart};
}(ht)); | trnsriram/webpack-highcharts | app/scripts/plugins/trial.js | JavaScript | mit | 790 |
import test from "tape";
import glob from "glob";
import path from "path";
import load from "load-json-file";
import write from "write-json-file";
import truncate from "@turf/truncate";
import { featureEach } from "@turf/meta";
import { featureCollection } from "@turf/helpers";
import pointOnFeature from "./index";
test("turf-point-on-feature", (t) => {
glob
.sync(path.join(__dirname, "test", "in", "*.json"))
.forEach((filepath) => {
const { name } = path.parse(filepath);
const geojson = load.sync(filepath);
const ptOnFeature = pointOnFeature(geojson);
// Style Results
const results = featureCollection([]);
featureEach(geojson, (feature) => results.features.push(feature));
ptOnFeature.properties["marker-color"] = "#F00";
ptOnFeature.properties["marker-style"] = "star";
results.features.push(truncate(ptOnFeature));
// Save Tests
const out = filepath.replace(
path.join("test", "in"),
path.join("test", "out")
);
if (process.env.REGEN) write.sync(out, results);
t.deepEqual(results, load.sync(out), name);
});
t.end();
});
| dpmcmlxxvi/turf | packages/turf-point-on-feature/test.js | JavaScript | mit | 1,152 |
import React from 'react'
class Radix extends React.Component {
render() {
return (
<div>Radix</div>
)
}
}
export default Radix | hyy1115/react-redux-webpack3 | src/pages/sorting/Radix/Radix.js | JavaScript | mit | 145 |
// @flow weak
/* eslint import/namespace: ['error', { allowComputed: true }] */
/**
* Important: This test also serves as a point to
* import the entire lib for coverage reporting
*/
import { assert } from 'chai';
import * as MaterialUI from './index';
describe('Material-UI', () => {
it('should have exports', () => assert.ok(MaterialUI));
it('should not do undefined exports', () => {
Object.keys(MaterialUI).forEach(exportKey => assert.ok(MaterialUI[exportKey]));
});
});
| dsslimshaddy/material-ui | src/index.spec.js | JavaScript | mit | 491 |
var _concat = require('./internal/_concat');
var _curry2 = require('./internal/_curry2');
var _reduce = require('./internal/_reduce');
var map = require('./map');
/**
* ap applies a list of functions to a list of values.
*
* Dispatches to the `ap` method of the second argument, if present. Also
* treats curried functions as applicatives.
*
* @func
* @memberOf R
* @since v0.3.0
* @category Function
* @sig [a -> b] -> [a] -> [b]
* @sig Apply f => f (a -> b) -> f a -> f b
* @sig (a -> b -> c) -> (a -> b) -> (a -> c)
* @param {*} applyF
* @param {*} applyX
* @return {*}
* @example
*
* R.ap([R.multiply(2), R.add(3)], [1,2,3]); //=> [2, 4, 6, 4, 5, 6]
* R.ap([R.concat('tasty '), R.toUpper], ['pizza', 'salad']); //=> ["tasty pizza", "tasty salad", "PIZZA", "SALAD"]
*
* // R.ap can also be used as S combinator
* // when only two functions are passed
* R.ap(R.concat, R.toUpper)('Ramda') //=> 'RamdaRAMDA'
* @symb R.ap([f, g], [a, b]) = [f(a), f(b), g(a), g(b)]
*/
module.exports = _curry2(function ap(applyF, applyX) {
return (
typeof applyX['fantasy-land/ap'] === 'function' ?
applyX['fantasy-land/ap'](applyF) :
typeof applyF.ap === 'function' ?
applyF.ap(applyX) :
typeof applyF === 'function' ?
function(x) { return applyF(x)(applyX(x)); } :
// else
_reduce(function(acc, f) { return _concat(acc, map(f, applyX)); }, [], applyF)
);
});
| jimf/ramda | src/ap.js | JavaScript | mit | 1,440 |
$(function () {
// Prepare demo data
var data = [
{
"hc-key": "qa-ms",
"value": 0
},
{
"hc-key": "qa-us",
"value": 1
},
{
"hc-key": "qa-dy",
"value": 2
},
{
"hc-key": "qa-da",
"value": 3
},
{
"hc-key": "qa-ra",
"value": 4
},
{
"hc-key": "qa-wa",
"value": 5
},
{
"hc-key": "qa-kh",
"value": 6
}
];
// Initiate the chart
$('#container').highcharts('Map', {
title : {
text : 'Highmaps basic demo'
},
subtitle : {
text : 'Source map: <a href="http://code.highcharts.com/mapdata/countries/qa/qa-all.js">Qatar</a>'
},
mapNavigation: {
enabled: true,
buttonOptions: {
verticalAlign: 'bottom'
}
},
colorAxis: {
min: 0
},
series : [{
data : data,
mapData: Highcharts.maps['countries/qa/qa-all'],
joinBy: 'hc-key',
name: 'Random data',
states: {
hover: {
color: '#BADA55'
}
},
dataLabels: {
enabled: true,
format: '{point.name}'
}
}]
});
});
| Oxyless/highcharts-export-image | lib/highcharts.com/samples/mapdata/countries/qa/qa-all/demo.js | JavaScript | mit | 1,491 |
import * as React from 'react';
import { expect } from 'chai';
import renderToStaticMarkup from '../../../src/renderer/renderToStaticMarkup';
import App from './includes/App';
import FailureApp from './includes/FailureApp';
describe('renderToStaticMarkup', () => {
it('should do render to static markup', function (done) {
this.timeout(15000);
renderToStaticMarkup(<App/>)
.then(({ html, state, modules }) => {
expect(html).to.equal('<div><div>foobar</div></div>');
expect(state).to.deep.equal({ '1': { message: 'foobar' }});
expect(modules).to.have.lengthOf(1);
done();
})
});
it('should handle errors properly', () => {
renderToStaticMarkup(<FailureApp/>)
.then(() => {
throw new Error('should not be called')
})
.catch(e => {
expect(e.message).to.equal('aw snap!')
})
})
});
| gabrielbull/react-router-server | test/tests/renderer/renderToStaticMarkup.js | JavaScript | mit | 883 |
<%- banner %>
import { module } from 'angular';
Controller.$inject = [ '$scope' ];
function Controller( $scope ) {
// TODO: add your implementation here
}
export const name = module( '<%= angularModuleName %>', [] )
.controller( '<%= angularControllerName %>', Controller ).name;
| LaxarJS/generator-laxarjs2 | generators/widget/templates/angular.widget.controller.js | JavaScript | mit | 290 |
// settings.js
// ===========
// This file contains settings for VSCP websocket and other JavaScript examples
//
// The vscpkey is the same key as set in the general/security settings of the
// VSCP server found in /etc/vscp/.vscp.key It should always be 32 bytes (64 charcater)
// in length and be kept secret.
//
// /vscp/ws1 is websocket interface 1
var settings = {
user: "admin",
password: "secret",
vscpkey: "2DBB079A38985AF00EBEEFE22F9FFA0E7F72DF06EBE44563EDF4A1073CABC7D4",
url: "ws://localhost:8884/ws1" // Local server
//url: "ws://192.168.1.9:8884/ws1" // Non SSL (to be able to use from remote machine)
//url: "wss://192.168.1.9:8843/ws1" // SSL (to be able to use from remote machine)
//url: "ws://demo.vscp.org:8884/ws1" // Demoserver
};
| grodansparadis/vscp_html5 | js/settings.js | JavaScript | mit | 801 |
// Define libraries
require.config({
baseUrl: 'js/',
paths: {
jquery: '../../../assets/jquery.min',
ember: 'lib/ember-latest.min',
handlebars: '../../../assets/handlebars.min',
text: 'lib/require/text',
jasmine: '../../../assets/jasmine/jasmine',
jasmine_html: '../../../assets/jasmine/jasmine-html'
}
});
// Load our app
define( 'app', [
'app/router',
'app/models/store',
'app/controllers/entries',
'app/views/application',
'jquery',
'handlebars',
'ember'
], function( Router, Store, EntriesController, ApplicationView ) {
var App = Ember.Application.create({
VERSION: '1.0',
rootElement: '#todoapp',
// Load routes
Router: Router,
// Extend to inherit outlet support
ApplicationController: Ember.Controller.extend(),
ApplicationView: ApplicationView,
entriesController: EntriesController.create({
store: new Store('todos-emberjs')
}),
ready: function() {
this.initialize();
}
});
// Expose the application globally
return window.Todos = App;
}
);
| jsoverson/todomvc | dependency-examples/emberjs_require/js/app.js | JavaScript | mit | 1,024 |
$(function () {
// Prepare demo data
var data = [
{
"hc-key": "us-ca-083",
"value": 0
},
{
"hc-key": "us-fl-087",
"value": 1
},
{
"hc-key": "us-mi-033",
"value": 2
},
{
"hc-key": "us-al-097",
"value": 3
},
{
"hc-key": "us-co-014",
"value": 4
},
{
"hc-key": "us-wi-003",
"value": 5
},
{
"hc-key": "us-ma-007",
"value": 6
},
{
"hc-key": "us-ma-019",
"value": 7
},
{
"hc-key": "us-fl-037",
"value": 8
},
{
"hc-key": "us-or-007",
"value": 9
},
{
"hc-key": "us-co-031",
"value": 10
},
{
"hc-key": "us-co-005",
"value": 11
},
{
"hc-key": "us-ny-085",
"value": 12
},
{
"hc-key": "us-nj-029",
"value": 13
},
{
"hc-key": "us-sc-019",
"value": 14
},
{
"hc-key": "us-wa-033",
"value": 15
},
{
"hc-key": "us-wa-055",
"value": 16
},
{
"hc-key": "us-me-015",
"value": 17
},
{
"hc-key": "us-me-009",
"value": 18
},
{
"hc-key": "us-wa-035",
"value": 19
},
{
"hc-key": "us-wa-057",
"value": 20
},
{
"hc-key": "us-nc-019",
"value": 21
},
{
"hc-key": "us-ga-191",
"value": 22
},
{
"hc-key": "us-wa-053",
"value": 23
},
{
"hc-key": "us-va-600",
"value": 24
},
{
"hc-key": "us-va-059",
"value": 25
},
{
"hc-key": "us-nm-003",
"value": 26
},
{
"hc-key": "us-nm-017",
"value": 27
},
{
"hc-key": "us-nd-019",
"value": 28
},
{
"hc-key": "us-ut-003",
"value": 29
},
{
"hc-key": "us-nv-007",
"value": 30
},
{
"hc-key": "us-or-037",
"value": 31
},
{
"hc-key": "us-ca-049",
"value": 32
},
{
"hc-key": "us-sd-121",
"value": 33
},
{
"hc-key": "us-sd-095",
"value": 34
},
{
"hc-key": "us-wa-047",
"value": 35
},
{
"hc-key": "us-tx-371",
"value": 36
},
{
"hc-key": "us-tx-043",
"value": 37
},
{
"hc-key": "us-mi-141",
"value": 38
},
{
"hc-key": "us-mt-005",
"value": 39
},
{
"hc-key": "us-mt-041",
"value": 40
},
{
"hc-key": "us-mn-075",
"value": 41
},
{
"hc-key": "us-nm-031",
"value": 42
},
{
"hc-key": "us-az-001",
"value": 43
},
{
"hc-key": "us-tx-243",
"value": 44
},
{
"hc-key": "us-tx-377",
"value": 45
},
{
"hc-key": "us-tn-043",
"value": 46
},
{
"hc-key": "us-mt-019",
"value": 47
},
{
"hc-key": "us-or-035",
"value": 48
},
{
"hc-key": "us-or-029",
"value": 49
},
{
"hc-key": "us-va-750",
"value": 50
},
{
"hc-key": "us-tn-105",
"value": 51
},
{
"hc-key": "us-va-580",
"value": 52
},
{
"hc-key": "us-nd-023",
"value": 53
},
{
"hc-key": "us-co-097",
"value": 54
},
{
"hc-key": "us-co-045",
"value": 55
},
{
"hc-key": "us-co-113",
"value": 56
},
{
"hc-key": "us-co-085",
"value": 57
},
{
"hc-key": "us-va-690",
"value": 58
},
{
"hc-key": "us-la-113",
"value": 59
},
{
"hc-key": "us-ca-069",
"value": 60
},
{
"hc-key": "us-ca-053",
"value": 61
},
{
"hc-key": "us-mn-135",
"value": 62
},
{
"hc-key": "us-tx-323",
"value": 63
},
{
"hc-key": "us-nh-007",
"value": 64
},
{
"hc-key": "us-tx-261",
"value": 65
},
{
"hc-key": "us-nc-029",
"value": 66
},
{
"hc-key": "us-nc-053",
"value": 67
},
{
"hc-key": "us-wy-001",
"value": 68
},
{
"hc-key": "us-wy-007",
"value": 69
},
{
"hc-key": "us-ca-027",
"value": 70
},
{
"hc-key": "us-ca-071",
"value": 71
},
{
"hc-key": "us-id-013",
"value": 72
},
{
"hc-key": "us-id-063",
"value": 73
},
{
"hc-key": "us-va-515",
"value": 74
},
{
"hc-key": "us-nm-025",
"value": 75
},
{
"hc-key": "us-nm-015",
"value": 76
},
{
"hc-key": "us-in-033",
"value": 77
},
{
"hc-key": "us-in-151",
"value": 78
},
{
"hc-key": "us-wa-029",
"value": 79
},
{
"hc-key": "us-va-153",
"value": 80
},
{
"hc-key": "us-va-179",
"value": 81
},
{
"hc-key": "us-wa-065",
"value": 82
},
{
"hc-key": "us-ga-097",
"value": 83
},
{
"hc-key": "us-ga-067",
"value": 84
},
{
"hc-key": "us-wa-051",
"value": 85
},
{
"hc-key": "us-mt-053",
"value": 86
},
{
"hc-key": "us-id-021",
"value": 87
},
{
"hc-key": "us-ga-145",
"value": 88
},
{
"hc-key": "us-ga-285",
"value": 89
},
{
"hc-key": "us-wi-107",
"value": 90
},
{
"hc-key": "us-wi-119",
"value": 91
},
{
"hc-key": "us-in-025",
"value": 92
},
{
"hc-key": "us-wa-037",
"value": 93
},
{
"hc-key": "us-wa-007",
"value": 94
},
{
"hc-key": "us-va-820",
"value": 95
},
{
"hc-key": "us-va-790",
"value": 96
},
{
"hc-key": "us-va-540",
"value": 97
},
{
"hc-key": "us-md-037",
"value": 98
},
{
"hc-key": "us-mt-101",
"value": 99
},
{
"hc-key": "us-nv-021",
"value": 100
},
{
"hc-key": "us-nv-001",
"value": 101
},
{
"hc-key": "us-va-595",
"value": 102
},
{
"hc-key": "us-tn-037",
"value": 103
},
{
"hc-key": "us-wi-007",
"value": 104
},
{
"hc-key": "us-wi-031",
"value": 105
},
{
"hc-key": "us-oh-065",
"value": 106
},
{
"hc-key": "us-oh-091",
"value": 107
},
{
"hc-key": "us-va-678",
"value": 108
},
{
"hc-key": "us-va-530",
"value": 109
},
{
"hc-key": "us-ok-045",
"value": 110
},
{
"hc-key": "us-ok-129",
"value": 111
},
{
"hc-key": "us-va-720",
"value": 112
},
{
"hc-key": "us-id-073",
"value": 113
},
{
"hc-key": "us-or-045",
"value": 114
},
{
"hc-key": "us-ny-057",
"value": 115
},
{
"hc-key": "us-ny-035",
"value": 116
},
{
"hc-key": "us-nd-075",
"value": 117
},
{
"hc-key": "us-nd-009",
"value": 118
},
{
"hc-key": "us-ca-011",
"value": 119
},
{
"hc-key": "us-ca-033",
"value": 120
},
{
"hc-key": "us-az-017",
"value": 121
},
{
"hc-key": "us-ut-037",
"value": 122
},
{
"hc-key": "us-co-011",
"value": 123
},
{
"hc-key": "us-co-061",
"value": 124
},
{
"hc-key": "us-or-049",
"value": 125
},
{
"hc-key": "us-or-059",
"value": 126
},
{
"hc-key": "us-mt-071",
"value": 127
},
{
"hc-key": "us-va-660",
"value": 128
},
{
"hc-key": "us-va-683",
"value": 129
},
{
"hc-key": "us-ut-019",
"value": 130
},
{
"hc-key": "us-va-840",
"value": 131
},
{
"hc-key": "us-mt-105",
"value": 132
},
{
"hc-key": "us-ca-099",
"value": 133
},
{
"hc-key": "us-ca-047",
"value": 134
},
{
"hc-key": "us-nd-001",
"value": 135
},
{
"hc-key": "us-nd-011",
"value": 136
},
{
"hc-key": "us-co-033",
"value": 137
},
{
"hc-key": "us-co-083",
"value": 138
},
{
"hc-key": "us-co-067",
"value": 139
},
{
"hc-key": "us-mt-081",
"value": 140
},
{
"hc-key": "us-mt-039",
"value": 141
},
{
"hc-key": "us-az-027",
"value": 142
},
{
"hc-key": "us-az-019",
"value": 143
},
{
"hc-key": "us-az-013",
"value": 144
},
{
"hc-key": "us-nv-033",
"value": 145
},
{
"hc-key": "us-nv-011",
"value": 146
},
{
"hc-key": "us-mt-063",
"value": 147
},
{
"hc-key": "us-mt-047",
"value": 148
},
{
"hc-key": "us-ca-111",
"value": 149
},
{
"hc-key": "us-ca-075",
"value": 150
},
{
"hc-key": "us-ca-041",
"value": 151
},
{
"hc-key": "us-ri-009",
"value": 152
},
{
"hc-key": "us-fl-086",
"value": 153
},
{
"hc-key": "us-fl-053",
"value": 154
},
{
"hc-key": "us-mi-019",
"value": 155
},
{
"hc-key": "us-mi-089",
"value": 156
},
{
"hc-key": "us-mi-163",
"value": 157
},
{
"hc-key": "us-fl-017",
"value": 158
},
{
"hc-key": "us-ny-103",
"value": 159
},
{
"hc-key": "us-ny-059",
"value": 160
},
{
"hc-key": "us-co-069",
"value": 161
},
{
"hc-key": "us-co-013",
"value": 162
},
{
"hc-key": "us-co-059",
"value": 163
},
{
"hc-key": "us-nc-049",
"value": 164
},
{
"hc-key": "us-nc-031",
"value": 165
},
{
"hc-key": "us-tx-007",
"value": 166
},
{
"hc-key": "us-wi-113",
"value": 167
},
{
"hc-key": "us-la-087",
"value": 168
},
{
"hc-key": "us-md-025",
"value": 169
},
{
"hc-key": "us-md-005",
"value": 170
},
{
"hc-key": "us-wa-031",
"value": 171
},
{
"hc-key": "us-md-041",
"value": 172
},
{
"hc-key": "us-md-019",
"value": 173
},
{
"hc-key": "us-md-045",
"value": 174
},
{
"hc-key": "us-or-057",
"value": 175
},
{
"hc-key": "us-co-001",
"value": 176
},
{
"hc-key": "us-co-035",
"value": 177
},
{
"hc-key": "us-co-093",
"value": 178
},
{
"hc-key": "us-tx-167",
"value": 179
},
{
"hc-key": "us-tx-071",
"value": 180
},
{
"hc-key": "us-tx-201",
"value": 181
},
{
"hc-key": "us-ga-039",
"value": 182
},
{
"hc-key": "us-la-075",
"value": 183
},
{
"hc-key": "us-me-031",
"value": 184
},
{
"hc-key": "us-me-027",
"value": 185
},
{
"hc-key": "us-fl-071",
"value": 186
},
{
"hc-key": "us-fl-015",
"value": 187
},
{
"hc-key": "us-nj-025",
"value": 188
},
{
"hc-key": "us-co-075",
"value": 189
},
{
"hc-key": "us-co-123",
"value": 190
},
{
"hc-key": "us-ga-179",
"value": 191
},
{
"hc-key": "us-fl-075",
"value": 192
},
{
"hc-key": "us-nc-095",
"value": 193
},
{
"hc-key": "us-nc-055",
"value": 194
},
{
"hc-key": "us-md-047",
"value": 195
},
{
"hc-key": "us-md-039",
"value": 196
},
{
"hc-key": "us-va-001",
"value": 197
},
{
"hc-key": "us-la-051",
"value": 198
},
{
"hc-key": "us-la-057",
"value": 199
},
{
"hc-key": "us-nc-129",
"value": 200
},
{
"hc-key": "us-wa-069",
"value": 201
},
{
"hc-key": "us-wa-049",
"value": 202
},
{
"hc-key": "us-fl-021",
"value": 203
},
{
"hc-key": "us-fl-051",
"value": 204
},
{
"hc-key": "us-ms-059",
"value": 205
},
{
"hc-key": "us-ms-047",
"value": 206
},
{
"hc-key": "us-la-109",
"value": 207
},
{
"hc-key": "us-la-101",
"value": 208
},
{
"hc-key": "us-ny-005",
"value": 209
},
{
"hc-key": "us-ny-061",
"value": 210
},
{
"hc-key": "us-ny-047",
"value": 211
},
{
"hc-key": "us-mi-097",
"value": 212
},
{
"hc-key": "us-me-003",
"value": 213
},
{
"hc-key": "us-me-029",
"value": 214
},
{
"hc-key": "us-me-013",
"value": 215
},
{
"hc-key": "us-mi-029",
"value": 216
},
{
"hc-key": "us-ri-005",
"value": 217
},
{
"hc-key": "us-wa-045",
"value": 218
},
{
"hc-key": "us-wa-067",
"value": 219
},
{
"hc-key": "us-va-131",
"value": 220
},
{
"hc-key": "us-ga-127",
"value": 221
},
{
"hc-key": "us-nj-001",
"value": 222
},
{
"hc-key": "us-nj-009",
"value": 223
},
{
"hc-key": "us-wi-029",
"value": 224
},
{
"hc-key": "us-md-033",
"value": 225
},
{
"hc-key": "us-tx-057",
"value": 226
},
{
"hc-key": "us-tx-391",
"value": 227
},
{
"hc-key": "us-tx-321",
"value": 228
},
{
"hc-key": "us-az-011",
"value": 229
},
{
"hc-key": "us-nv-015",
"value": 230
},
{
"hc-key": "us-wy-031",
"value": 231
},
{
"hc-key": "us-wy-021",
"value": 232
},
{
"hc-key": "us-tn-149",
"value": 233
},
{
"hc-key": "us-ne-031",
"value": 234
},
{
"hc-key": "us-nv-023",
"value": 235
},
{
"hc-key": "us-nv-017",
"value": 236
},
{
"hc-key": "us-nv-003",
"value": 237
},
{
"hc-key": "us-ut-027",
"value": 238
},
{
"hc-key": "us-fl-029",
"value": 239
},
{
"hc-key": "us-fl-067",
"value": 240
},
{
"hc-key": "us-fl-121",
"value": 241
},
{
"hc-key": "us-ut-023",
"value": 242
},
{
"hc-key": "us-wa-019",
"value": 243
},
{
"hc-key": "us-wa-073",
"value": 244
},
{
"hc-key": "us-oh-003",
"value": 245
},
{
"hc-key": "us-oh-137",
"value": 246
},
{
"hc-key": "us-in-135",
"value": 247
},
{
"hc-key": "us-in-065",
"value": 248
},
{
"hc-key": "us-in-177",
"value": 249
},
{
"hc-key": "us-tx-443",
"value": 250
},
{
"hc-key": "us-tx-105",
"value": 251
},
{
"hc-key": "us-tn-125",
"value": 252
},
{
"hc-key": "us-va-685",
"value": 253
},
{
"hc-key": "us-in-119",
"value": 254
},
{
"hc-key": "us-in-105",
"value": 255
},
{
"hc-key": "us-in-093",
"value": 256
},
{
"hc-key": "us-in-071",
"value": 257
},
{
"hc-key": "us-in-101",
"value": 258
},
{
"hc-key": "us-co-009",
"value": 259
},
{
"hc-key": "us-co-071",
"value": 260
},
{
"hc-key": "us-nc-137",
"value": 261
},
{
"hc-key": "us-nc-013",
"value": 262
},
{
"hc-key": "us-nm-043",
"value": 263
},
{
"hc-key": "us-pa-101",
"value": 264
},
{
"hc-key": "us-nj-007",
"value": 265
},
{
"hc-key": "us-nc-133",
"value": 266
},
{
"hc-key": "us-nc-103",
"value": 267
},
{
"hc-key": "us-md-035",
"value": 268
},
{
"hc-key": "us-wi-117",
"value": 269
},
{
"hc-key": "us-ne-105",
"value": 270
},
{
"hc-key": "us-co-125",
"value": 271
},
{
"hc-key": "us-tx-389",
"value": 272
},
{
"hc-key": "us-nc-187",
"value": 273
},
{
"hc-key": "us-sc-015",
"value": 274
},
{
"hc-key": "us-tn-021",
"value": 275
},
{
"hc-key": "us-la-095",
"value": 276
},
{
"hc-key": "us-ma-005",
"value": 277
},
{
"hc-key": "us-ri-001",
"value": 278
},
{
"hc-key": "us-ma-023",
"value": 279
},
{
"hc-key": "us-wa-041",
"value": 280
},
{
"hc-key": "us-wa-027",
"value": 281
},
{
"hc-key": "us-mt-091",
"value": 282
},
{
"hc-key": "us-md-003",
"value": 283
},
{
"hc-key": "us-al-095",
"value": 284
},
{
"hc-key": "us-al-071",
"value": 285
},
{
"hc-key": "us-tn-051",
"value": 286
},
{
"hc-key": "us-tn-031",
"value": 287
},
{
"hc-key": "us-tn-145",
"value": 288
},
{
"hc-key": "us-ga-293",
"value": 289
},
{
"hc-key": "us-ga-231",
"value": 290
},
{
"hc-key": "us-va-191",
"value": 291
},
{
"hc-key": "us-va-520",
"value": 292
},
{
"hc-key": "us-ga-249",
"value": 293
},
{
"hc-key": "us-ga-269",
"value": 294
},
{
"hc-key": "us-ga-079",
"value": 295
},
{
"hc-key": "us-ga-197",
"value": 296
},
{
"hc-key": "us-va-095",
"value": 297
},
{
"hc-key": "us-va-830",
"value": 298
},
{
"hc-key": "us-ga-273",
"value": 299
},
{
"hc-key": "us-ga-037",
"value": 300
},
{
"hc-key": "us-ga-177",
"value": 301
},
{
"hc-key": "us-oh-063",
"value": 302
},
{
"hc-key": "us-oh-173",
"value": 303
},
{
"hc-key": "us-oh-175",
"value": 304
},
{
"hc-key": "us-ut-033",
"value": 305
},
{
"hc-key": "us-wy-023",
"value": 306
},
{
"hc-key": "us-wy-037",
"value": 307
},
{
"hc-key": "us-id-007",
"value": 308
},
{
"hc-key": "us-wy-039",
"value": 309
},
{
"hc-key": "us-id-081",
"value": 310
},
{
"hc-key": "us-la-023",
"value": 311
},
{
"hc-key": "us-la-019",
"value": 312
},
{
"hc-key": "us-tx-361",
"value": 313
},
{
"hc-key": "us-mi-007",
"value": 314
},
{
"hc-key": "us-tn-137",
"value": 315
},
{
"hc-key": "us-ky-053",
"value": 316
},
{
"hc-key": "us-ky-231",
"value": 317
},
{
"hc-key": "us-fl-129",
"value": 318
},
{
"hc-key": "us-fl-131",
"value": 319
},
{
"hc-key": "us-fl-059",
"value": 320
},
{
"hc-key": "us-fl-133",
"value": 321
},
{
"hc-key": "us-ne-059",
"value": 322
},
{
"hc-key": "us-ne-035",
"value": 323
},
{
"hc-key": "us-ne-181",
"value": 324
},
{
"hc-key": "us-ne-129",
"value": 325
},
{
"hc-key": "us-ks-157",
"value": 326
},
{
"hc-key": "us-ne-001",
"value": 327
},
{
"hc-key": "us-mi-109",
"value": 328
},
{
"hc-key": "us-mi-103",
"value": 329
},
{
"hc-key": "us-mi-043",
"value": 330
},
{
"hc-key": "us-mi-003",
"value": 331
},
{
"hc-key": "us-wy-041",
"value": 332
},
{
"hc-key": "us-sd-067",
"value": 333
},
{
"hc-key": "us-sd-043",
"value": 334
},
{
"hc-key": "us-in-069",
"value": 335
},
{
"hc-key": "us-in-003",
"value": 336
},
{
"hc-key": "us-ga-025",
"value": 337
},
{
"hc-key": "us-ga-049",
"value": 338
},
{
"hc-key": "us-ga-015",
"value": 339
},
{
"hc-key": "us-ga-129",
"value": 340
},
{
"hc-key": "us-ga-115",
"value": 341
},
{
"hc-key": "us-ga-233",
"value": 342
},
{
"hc-key": "us-ne-089",
"value": 343
},
{
"hc-key": "us-ne-015",
"value": 344
},
{
"hc-key": "us-ne-103",
"value": 345
},
{
"hc-key": "us-mo-083",
"value": 346
},
{
"hc-key": "us-mo-101",
"value": 347
},
{
"hc-key": "us-mo-107",
"value": 348
},
{
"hc-key": "us-wi-093",
"value": 349
},
{
"hc-key": "us-wi-033",
"value": 350
},
{
"hc-key": "us-co-109",
"value": 351
},
{
"hc-key": "us-co-003",
"value": 352
},
{
"hc-key": "us-co-027",
"value": 353
},
{
"hc-key": "us-wi-063",
"value": 354
},
{
"hc-key": "us-wi-053",
"value": 355
},
{
"hc-key": "us-ny-101",
"value": 356
},
{
"hc-key": "us-ny-003",
"value": 357
},
{
"hc-key": "us-ny-121",
"value": 358
},
{
"hc-key": "us-ny-051",
"value": 359
},
{
"hc-key": "us-ga-063",
"value": 360
},
{
"hc-key": "us-ga-089",
"value": 361
},
{
"hc-key": "us-ks-111",
"value": 362
},
{
"hc-key": "us-ks-073",
"value": 363
},
{
"hc-key": "us-ks-031",
"value": 364
},
{
"hc-key": "us-ks-207",
"value": 365
},
{
"hc-key": "us-in-111",
"value": 366
},
{
"hc-key": "us-il-091",
"value": 367
},
{
"hc-key": "us-in-073",
"value": 368
},
{
"hc-key": "us-in-131",
"value": 369
},
{
"hc-key": "us-in-149",
"value": 370
},
{
"hc-key": "us-in-007",
"value": 371
},
{
"hc-key": "us-tx-245",
"value": 372
},
{
"hc-key": "us-al-049",
"value": 373
},
{
"hc-key": "us-al-019",
"value": 374
},
{
"hc-key": "us-mt-065",
"value": 375
},
{
"hc-key": "us-mt-087",
"value": 376
},
{
"hc-key": "us-co-017",
"value": 377
},
{
"hc-key": "us-ks-199",
"value": 378
},
{
"hc-key": "us-co-111",
"value": 379
},
{
"hc-key": "us-ut-057",
"value": 380
},
{
"hc-key": "us-ut-005",
"value": 381
},
{
"hc-key": "us-id-041",
"value": 382
},
{
"hc-key": "us-tx-327",
"value": 383
},
{
"hc-key": "us-tx-413",
"value": 384
},
{
"hc-key": "us-me-023",
"value": 385
},
{
"hc-key": "us-me-001",
"value": 386
},
{
"hc-key": "us-me-011",
"value": 387
},
{
"hc-key": "us-mt-059",
"value": 388
},
{
"hc-key": "us-mt-097",
"value": 389
},
{
"hc-key": "us-ok-095",
"value": 390
},
{
"hc-key": "us-tx-181",
"value": 391
},
{
"hc-key": "us-wv-103",
"value": 392
},
{
"hc-key": "us-pa-059",
"value": 393
},
{
"hc-key": "us-pa-051",
"value": 394
},
{
"hc-key": "us-al-091",
"value": 395
},
{
"hc-key": "us-al-065",
"value": 396
},
{
"hc-key": "us-al-105",
"value": 397
},
{
"hc-key": "us-ky-209",
"value": 398
},
{
"hc-key": "us-ky-017",
"value": 399
},
{
"hc-key": "us-il-113",
"value": 400
},
{
"hc-key": "us-il-147",
"value": 401
},
{
"hc-key": "us-il-203",
"value": 402
},
{
"hc-key": "us-il-019",
"value": 403
},
{
"hc-key": "us-il-053",
"value": 404
},
{
"hc-key": "us-il-139",
"value": 405
},
{
"hc-key": "us-al-063",
"value": 406
},
{
"hc-key": "us-id-051",
"value": 407
},
{
"hc-key": "us-id-033",
"value": 408
},
{
"hc-key": "us-nc-037",
"value": 409
},
{
"hc-key": "us-nc-063",
"value": 410
},
{
"hc-key": "us-ia-151",
"value": 411
},
{
"hc-key": "us-ia-187",
"value": 412
},
{
"hc-key": "us-ia-025",
"value": 413
},
{
"hc-key": "us-ia-027",
"value": 414
},
{
"hc-key": "us-tx-147",
"value": 415
},
{
"hc-key": "us-tx-119",
"value": 416
},
{
"hc-key": "us-tn-159",
"value": 417
},
{
"hc-key": "us-tn-169",
"value": 418
},
{
"hc-key": "us-or-019",
"value": 419
},
{
"hc-key": "us-tx-127",
"value": 420
},
{
"hc-key": "us-tx-507",
"value": 421
},
{
"hc-key": "us-fl-011",
"value": 422
},
{
"hc-key": "us-mi-151",
"value": 423
},
{
"hc-key": "us-nc-145",
"value": 424
},
{
"hc-key": "us-ms-151",
"value": 425
},
{
"hc-key": "us-ms-055",
"value": 426
},
{
"hc-key": "us-la-035",
"value": 427
},
{
"hc-key": "us-ms-125",
"value": 428
},
{
"hc-key": "us-ar-085",
"value": 429
},
{
"hc-key": "us-ar-001",
"value": 430
},
{
"hc-key": "us-tx-027",
"value": 431
},
{
"hc-key": "us-tx-309",
"value": 432
},
{
"hc-key": "us-fl-099",
"value": 433
},
{
"hc-key": "us-ga-073",
"value": 434
},
{
"hc-key": "us-ga-181",
"value": 435
},
{
"hc-key": "us-ga-189",
"value": 436
},
{
"hc-key": "us-ky-003",
"value": 437
},
{
"hc-key": "us-tn-165",
"value": 438
},
{
"hc-key": "us-or-051",
"value": 439
},
{
"hc-key": "us-or-005",
"value": 440
},
{
"hc-key": "us-tn-115",
"value": 441
},
{
"hc-key": "us-tn-061",
"value": 442
},
{
"hc-key": "us-in-179",
"value": 443
},
{
"hc-key": "us-in-009",
"value": 444
},
{
"hc-key": "us-va-121",
"value": 445
},
{
"hc-key": "us-va-063",
"value": 446
},
{
"hc-key": "us-ms-145",
"value": 447
},
{
"hc-key": "us-ms-009",
"value": 448
},
{
"hc-key": "us-ia-109",
"value": 449
},
{
"hc-key": "us-ia-147",
"value": 450
},
{
"hc-key": "us-ia-063",
"value": 451
},
{
"hc-key": "us-ia-059",
"value": 452
},
{
"hc-key": "us-ia-053",
"value": 453
},
{
"hc-key": "us-ia-159",
"value": 454
},
{
"hc-key": "us-nc-001",
"value": 455
},
{
"hc-key": "us-nc-151",
"value": 456
},
{
"hc-key": "us-in-171",
"value": 457
},
{
"hc-key": "us-ne-109",
"value": 458
},
{
"hc-key": "us-ne-151",
"value": 459
},
{
"hc-key": "us-ia-031",
"value": 460
},
{
"hc-key": "us-ia-045",
"value": 461
},
{
"hc-key": "us-va-073",
"value": 462
},
{
"hc-key": "us-va-097",
"value": 463
},
{
"hc-key": "us-va-119",
"value": 464
},
{
"hc-key": "us-pa-123",
"value": 465
},
{
"hc-key": "us-pa-053",
"value": 466
},
{
"hc-key": "us-pa-065",
"value": 467
},
{
"hc-key": "us-in-089",
"value": 468
},
{
"hc-key": "us-il-197",
"value": 469
},
{
"hc-key": "us-tn-003",
"value": 470
},
{
"hc-key": "us-tn-027",
"value": 471
},
{
"hc-key": "us-wa-013",
"value": 472
},
{
"hc-key": "us-or-063",
"value": 473
},
{
"hc-key": "us-id-049",
"value": 474
},
{
"hc-key": "us-or-001",
"value": 475
},
{
"hc-key": "us-ky-127",
"value": 476
},
{
"hc-key": "us-ky-175",
"value": 477
},
{
"hc-key": "us-il-025",
"value": 478
},
{
"hc-key": "us-il-049",
"value": 479
},
{
"hc-key": "us-il-051",
"value": 480
},
{
"hc-key": "us-il-035",
"value": 481
},
{
"hc-key": "us-tn-123",
"value": 482
},
{
"hc-key": "us-in-157",
"value": 483
},
{
"hc-key": "us-in-107",
"value": 484
},
{
"hc-key": "us-in-063",
"value": 485
},
{
"hc-key": "us-tx-277",
"value": 486
},
{
"hc-key": "us-nd-035",
"value": 487
},
{
"hc-key": "us-nd-099",
"value": 488
},
{
"hc-key": "us-nd-067",
"value": 489
},
{
"hc-key": "us-ks-071",
"value": 490
},
{
"hc-key": "us-co-099",
"value": 491
},
{
"hc-key": "us-ks-075",
"value": 492
},
{
"hc-key": "us-mo-057",
"value": 493
},
{
"hc-key": "us-mo-167",
"value": 494
},
{
"hc-key": "us-mo-109",
"value": 495
},
{
"hc-key": "us-il-029",
"value": 496
},
{
"hc-key": "us-il-033",
"value": 497
},
{
"hc-key": "us-il-079",
"value": 498
},
{
"hc-key": "us-ia-073",
"value": 499
},
{
"hc-key": "us-pa-031",
"value": 500
},
{
"hc-key": "us-in-117",
"value": 501
},
{
"hc-key": "us-in-037",
"value": 502
},
{
"hc-key": "us-in-027",
"value": 503
},
{
"hc-key": "us-in-083",
"value": 504
},
{
"hc-key": "us-in-123",
"value": 505
},
{
"hc-key": "us-in-173",
"value": 506
},
{
"hc-key": "us-in-147",
"value": 507
},
{
"hc-key": "us-in-163",
"value": 508
},
{
"hc-key": "us-va-057",
"value": 509
},
{
"hc-key": "us-mn-043",
"value": 510
},
{
"hc-key": "us-mn-147",
"value": 511
},
{
"hc-key": "us-mn-047",
"value": 512
},
{
"hc-key": "us-ia-195",
"value": 513
},
{
"hc-key": "us-va-167",
"value": 514
},
{
"hc-key": "us-va-027",
"value": 515
},
{
"hc-key": "us-wv-047",
"value": 516
},
{
"hc-key": "us-co-089",
"value": 517
},
{
"hc-key": "us-ok-089",
"value": 518
},
{
"hc-key": "us-ok-079",
"value": 519
},
{
"hc-key": "us-ok-135",
"value": 520
},
{
"hc-key": "us-ok-101",
"value": 521
},
{
"hc-key": "us-mo-043",
"value": 522
},
{
"hc-key": "us-mo-067",
"value": 523
},
{
"hc-key": "us-mo-215",
"value": 524
},
{
"hc-key": "us-in-115",
"value": 525
},
{
"hc-key": "us-in-137",
"value": 526
},
{
"hc-key": "us-in-031",
"value": 527
},
{
"hc-key": "us-in-139",
"value": 528
},
{
"hc-key": "us-la-021",
"value": 529
},
{
"hc-key": "us-la-049",
"value": 530
},
{
"hc-key": "us-mt-015",
"value": 531
},
{
"hc-key": "us-mt-013",
"value": 532
},
{
"hc-key": "us-mt-073",
"value": 533
},
{
"hc-key": "us-ct-007",
"value": 534
},
{
"hc-key": "us-ct-011",
"value": 535
},
{
"hc-key": "us-ct-015",
"value": 536
},
{
"hc-key": "us-in-161",
"value": 537
},
{
"hc-key": "us-oh-017",
"value": 538
},
{
"hc-key": "us-oh-165",
"value": 539
},
{
"hc-key": "us-mo-145",
"value": 540
},
{
"hc-key": "us-mo-119",
"value": 541
},
{
"hc-key": "us-ne-033",
"value": 542
},
{
"hc-key": "us-ne-007",
"value": 543
},
{
"hc-key": "us-ne-157",
"value": 544
},
{
"hc-key": "us-wy-015",
"value": 545
},
{
"hc-key": "us-ne-165",
"value": 546
},
{
"hc-key": "us-ga-263",
"value": 547
},
{
"hc-key": "us-al-081",
"value": 548
},
{
"hc-key": "us-nd-081",
"value": 549
},
{
"hc-key": "us-nd-021",
"value": 550
},
{
"hc-key": "us-mn-085",
"value": 551
},
{
"hc-key": "us-mn-143",
"value": 552
},
{
"hc-key": "us-ga-171",
"value": 553
},
{
"hc-key": "us-ca-097",
"value": 554
},
{
"hc-key": "us-ca-045",
"value": 555
},
{
"hc-key": "us-id-065",
"value": 556
},
{
"hc-key": "us-id-019",
"value": 557
},
{
"hc-key": "us-ga-297",
"value": 558
},
{
"hc-key": "us-ga-013",
"value": 559
},
{
"hc-key": "us-ok-115",
"value": 560
},
{
"hc-key": "us-ok-035",
"value": 561
},
{
"hc-key": "us-ks-021",
"value": 562
},
{
"hc-key": "us-pa-033",
"value": 563
},
{
"hc-key": "us-il-167",
"value": 564
},
{
"hc-key": "us-il-135",
"value": 565
},
{
"hc-key": "us-il-005",
"value": 566
},
{
"hc-key": "us-ms-071",
"value": 567
},
{
"hc-key": "us-ms-115",
"value": 568
},
{
"hc-key": "us-mn-055",
"value": 569
},
{
"hc-key": "us-mn-045",
"value": 570
},
{
"hc-key": "us-ia-191",
"value": 571
},
{
"hc-key": "us-mn-099",
"value": 572
},
{
"hc-key": "us-mn-109",
"value": 573
},
{
"hc-key": "us-mn-039",
"value": 574
},
{
"hc-key": "us-sd-097",
"value": 575
},
{
"hc-key": "us-sd-087",
"value": 576
},
{
"hc-key": "us-sd-099",
"value": 577
},
{
"hc-key": "us-sd-101",
"value": 578
},
{
"hc-key": "us-al-017",
"value": 579
},
{
"hc-key": "us-in-047",
"value": 580
},
{
"hc-key": "us-mn-121",
"value": 581
},
{
"hc-key": "us-mn-067",
"value": 582
},
{
"hc-key": "us-tx-177",
"value": 583
},
{
"hc-key": "us-tx-149",
"value": 584
},
{
"hc-key": "us-tx-011",
"value": 585
},
{
"hc-key": "us-tx-045",
"value": 586
},
{
"hc-key": "us-mi-071",
"value": 587
},
{
"hc-key": "us-mi-131",
"value": 588
},
{
"hc-key": "us-mn-133",
"value": 589
},
{
"hc-key": "us-mn-105",
"value": 590
},
{
"hc-key": "us-ia-119",
"value": 591
},
{
"hc-key": "us-la-111",
"value": 592
},
{
"hc-key": "us-la-061",
"value": 593
},
{
"hc-key": "us-la-027",
"value": 594
},
{
"hc-key": "us-pa-043",
"value": 595
},
{
"hc-key": "us-pa-097",
"value": 596
},
{
"hc-key": "us-pa-067",
"value": 597
},
{
"hc-key": "us-pa-099",
"value": 598
},
{
"hc-key": "us-pa-071",
"value": 599
},
{
"hc-key": "us-pa-041",
"value": 600
},
{
"hc-key": "us-ok-027",
"value": 601
},
{
"hc-key": "us-ok-017",
"value": 602
},
{
"hc-key": "us-ok-015",
"value": 603
},
{
"hc-key": "us-wv-079",
"value": 604
},
{
"hc-key": "us-wv-011",
"value": 605
},
{
"hc-key": "us-ar-137",
"value": 606
},
{
"hc-key": "us-ar-141",
"value": 607
},
{
"hc-key": "us-co-119",
"value": 608
},
{
"hc-key": "us-co-065",
"value": 609
},
{
"hc-key": "us-co-117",
"value": 610
},
{
"hc-key": "us-ny-089",
"value": 611
},
{
"hc-key": "us-ny-045",
"value": 612
},
{
"hc-key": "us-ny-041",
"value": 613
},
{
"hc-key": "us-ny-091",
"value": 614
},
{
"hc-key": "us-va-005",
"value": 615
},
{
"hc-key": "us-va-045",
"value": 616
},
{
"hc-key": "us-va-023",
"value": 617
},
{
"hc-key": "us-mo-081",
"value": 618
},
{
"hc-key": "us-ga-045",
"value": 619
},
{
"hc-key": "us-ga-223",
"value": 620
},
{
"hc-key": "us-tn-041",
"value": 621
},
{
"hc-key": "us-tn-141",
"value": 622
},
{
"hc-key": "us-nd-013",
"value": 623
},
{
"hc-key": "us-nd-101",
"value": 624
},
{
"hc-key": "us-ma-027",
"value": 625
},
{
"hc-key": "us-nh-011",
"value": 626
},
{
"hc-key": "us-nh-005",
"value": 627
},
{
"hc-key": "us-ny-111",
"value": 628
},
{
"hc-key": "us-ny-027",
"value": 629
},
{
"hc-key": "us-tx-225",
"value": 630
},
{
"hc-key": "us-tx-313",
"value": 631
},
{
"hc-key": "us-tx-041",
"value": 632
},
{
"hc-key": "us-tx-477",
"value": 633
},
{
"hc-key": "us-co-101",
"value": 634
},
{
"hc-key": "us-co-041",
"value": 635
},
{
"hc-key": "us-mo-105",
"value": 636
},
{
"hc-key": "us-sc-033",
"value": 637
},
{
"hc-key": "us-nc-155",
"value": 638
},
{
"hc-key": "us-nc-051",
"value": 639
},
{
"hc-key": "us-mi-001",
"value": 640
},
{
"hc-key": "us-ca-067",
"value": 641
},
{
"hc-key": "us-ca-017",
"value": 642
},
{
"hc-key": "us-ca-061",
"value": 643
},
{
"hc-key": "us-ca-115",
"value": 644
},
{
"hc-key": "us-ar-129",
"value": 645
},
{
"hc-key": "us-nc-093",
"value": 646
},
{
"hc-key": "us-nc-165",
"value": 647
},
{
"hc-key": "us-mo-005",
"value": 648
},
{
"hc-key": "us-ia-071",
"value": 649
},
{
"hc-key": "us-mo-087",
"value": 650
},
{
"hc-key": "us-ne-131",
"value": 651
},
{
"hc-key": "us-pa-023",
"value": 652
},
{
"hc-key": "us-sd-073",
"value": 653
},
{
"hc-key": "us-sd-015",
"value": 654
},
{
"hc-key": "us-sd-023",
"value": 655
},
{
"hc-key": "us-tn-177",
"value": 656
},
{
"hc-key": "us-tn-185",
"value": 657
},
{
"hc-key": "us-il-023",
"value": 658
},
{
"hc-key": "us-sc-035",
"value": 659
},
{
"hc-key": "us-ks-139",
"value": 660
},
{
"hc-key": "us-oh-133",
"value": 661
},
{
"hc-key": "us-oh-155",
"value": 662
},
{
"hc-key": "us-oh-007",
"value": 663
},
{
"hc-key": "us-oh-085",
"value": 664
},
{
"hc-key": "us-pa-019",
"value": 665
},
{
"hc-key": "us-pa-005",
"value": 666
},
{
"hc-key": "us-pa-073",
"value": 667
},
{
"hc-key": "us-pa-007",
"value": 668
},
{
"hc-key": "us-ks-113",
"value": 669
},
{
"hc-key": "us-ks-115",
"value": 670
},
{
"hc-key": "us-mo-225",
"value": 671
},
{
"hc-key": "us-mn-033",
"value": 672
},
{
"hc-key": "us-al-057",
"value": 673
},
{
"hc-key": "us-al-125",
"value": 674
},
{
"hc-key": "us-al-099",
"value": 675
},
{
"hc-key": "us-al-013",
"value": 676
},
{
"hc-key": "us-al-035",
"value": 677
},
{
"hc-key": "us-al-131",
"value": 678
},
{
"hc-key": "us-al-025",
"value": 679
},
{
"hc-key": "us-ms-015",
"value": 680
},
{
"hc-key": "us-ms-097",
"value": 681
},
{
"hc-key": "us-ne-099",
"value": 682
},
{
"hc-key": "us-il-161",
"value": 683
},
{
"hc-key": "us-ar-113",
"value": 684
},
{
"hc-key": "us-ar-133",
"value": 685
},
{
"hc-key": "us-wy-043",
"value": 686
},
{
"hc-key": "us-wy-013",
"value": 687
},
{
"hc-key": "us-ny-097",
"value": 688
},
{
"hc-key": "us-ar-069",
"value": 689
},
{
"hc-key": "us-wi-123",
"value": 690
},
{
"hc-key": "us-wi-111",
"value": 691
},
{
"hc-key": "us-wi-049",
"value": 692
},
{
"hc-key": "us-wi-025",
"value": 693
},
{
"hc-key": "us-wi-043",
"value": 694
},
{
"hc-key": "us-mo-123",
"value": 695
},
{
"hc-key": "us-mo-093",
"value": 696
},
{
"hc-key": "us-tx-289",
"value": 697
},
{
"hc-key": "us-tx-005",
"value": 698
},
{
"hc-key": "us-ks-195",
"value": 699
},
{
"hc-key": "us-ks-051",
"value": 700
},
{
"hc-key": "us-ks-165",
"value": 701
},
{
"hc-key": "us-ks-187",
"value": 702
},
{
"hc-key": "us-tx-463",
"value": 703
},
{
"hc-key": "us-tx-325",
"value": 704
},
{
"hc-key": "us-tx-019",
"value": 705
},
{
"hc-key": "us-tx-029",
"value": 706
},
{
"hc-key": "us-tx-013",
"value": 707
},
{
"hc-key": "us-mn-063",
"value": 708
},
{
"hc-key": "us-mn-165",
"value": 709
},
{
"hc-key": "us-ok-063",
"value": 710
},
{
"hc-key": "us-ok-029",
"value": 711
},
{
"hc-key": "us-tx-103",
"value": 712
},
{
"hc-key": "us-tx-461",
"value": 713
},
{
"hc-key": "us-in-051",
"value": 714
},
{
"hc-key": "us-in-129",
"value": 715
},
{
"hc-key": "us-va-510",
"value": 716
},
{
"hc-key": "us-dc-001",
"value": 717
},
{
"hc-key": "us-va-013",
"value": 718
},
{
"hc-key": "us-co-037",
"value": 719
},
{
"hc-key": "us-fl-109",
"value": 720
},
{
"hc-key": "us-ms-019",
"value": 721
},
{
"hc-key": "us-mo-079",
"value": 722
},
{
"hc-key": "us-mo-117",
"value": 723
},
{
"hc-key": "us-mi-123",
"value": 724
},
{
"hc-key": "us-mi-085",
"value": 725
},
{
"hc-key": "us-mi-133",
"value": 726
},
{
"hc-key": "us-il-031",
"value": 727
},
{
"hc-key": "us-il-059",
"value": 728
},
{
"hc-key": "us-al-033",
"value": 729
},
{
"hc-key": "us-ms-141",
"value": 730
},
{
"hc-key": "us-ms-003",
"value": 731
},
{
"hc-key": "us-ms-139",
"value": 732
},
{
"hc-key": "us-wv-051",
"value": 733
},
{
"hc-key": "us-wv-035",
"value": 734
},
{
"hc-key": "us-id-037",
"value": 735
},
{
"hc-key": "us-id-039",
"value": 736
},
{
"hc-key": "us-oh-131",
"value": 737
},
{
"hc-key": "us-oh-145",
"value": 738
},
{
"hc-key": "us-oh-087",
"value": 739
},
{
"hc-key": "us-oh-001",
"value": 740
},
{
"hc-key": "us-oh-015",
"value": 741
},
{
"hc-key": "us-fl-055",
"value": 742
},
{
"hc-key": "us-fl-027",
"value": 743
},
{
"hc-key": "us-mo-209",
"value": 744
},
{
"hc-key": "us-ar-015",
"value": 745
},
{
"hc-key": "us-va-089",
"value": 746
},
{
"hc-key": "us-nc-169",
"value": 747
},
{
"hc-key": "us-nc-157",
"value": 748
},
{
"hc-key": "us-ia-121",
"value": 749
},
{
"hc-key": "us-ia-039",
"value": 750
},
{
"hc-key": "us-tx-203",
"value": 751
},
{
"hc-key": "us-tx-401",
"value": 752
},
{
"hc-key": "us-ia-181",
"value": 753
},
{
"hc-key": "us-oh-161",
"value": 754
},
{
"hc-key": "us-oh-125",
"value": 755
},
{
"hc-key": "us-fl-043",
"value": 756
},
{
"hc-key": "us-ga-199",
"value": 757
},
{
"hc-key": "us-ga-077",
"value": 758
},
{
"hc-key": "us-co-007",
"value": 759
},
{
"hc-key": "us-co-105",
"value": 760
},
{
"hc-key": "us-co-023",
"value": 761
},
{
"hc-key": "us-tx-099",
"value": 762
},
{
"hc-key": "us-mo-019",
"value": 763
},
{
"hc-key": "us-mo-089",
"value": 764
},
{
"hc-key": "us-mi-139",
"value": 765
},
{
"hc-key": "us-mi-009",
"value": 766
},
{
"hc-key": "us-nc-153",
"value": 767
},
{
"hc-key": "us-sc-069",
"value": 768
},
{
"hc-key": "us-nc-007",
"value": 769
},
{
"hc-key": "us-id-055",
"value": 770
},
{
"hc-key": "us-id-009",
"value": 771
},
{
"hc-key": "us-il-011",
"value": 772
},
{
"hc-key": "us-il-073",
"value": 773
},
{
"hc-key": "us-il-037",
"value": 774
},
{
"hc-key": "us-il-103",
"value": 775
},
{
"hc-key": "us-ne-127",
"value": 776
},
{
"hc-key": "us-mi-035",
"value": 777
},
{
"hc-key": "us-mi-143",
"value": 778
},
{
"hc-key": "us-ca-091",
"value": 779
},
{
"hc-key": "us-ca-035",
"value": 780
},
{
"hc-key": "us-fl-081",
"value": 781
},
{
"hc-key": "us-co-015",
"value": 782
},
{
"hc-key": "us-co-043",
"value": 783
},
{
"hc-key": "us-ia-089",
"value": 784
},
{
"hc-key": "us-ia-037",
"value": 785
},
{
"hc-key": "us-ia-017",
"value": 786
},
{
"hc-key": "us-ia-065",
"value": 787
},
{
"hc-key": "us-ia-043",
"value": 788
},
{
"hc-key": "us-il-093",
"value": 789
},
{
"hc-key": "us-nd-089",
"value": 790
},
{
"hc-key": "us-nd-057",
"value": 791
},
{
"hc-key": "us-nd-025",
"value": 792
},
{
"hc-key": "us-mi-095",
"value": 793
},
{
"hc-key": "us-mi-153",
"value": 794
},
{
"hc-key": "us-ok-019",
"value": 795
},
{
"hc-key": "us-ok-099",
"value": 796
},
{
"hc-key": "us-nm-055",
"value": 797
},
{
"hc-key": "us-ar-017",
"value": 798
},
{
"hc-key": "us-ms-011",
"value": 799
},
{
"hc-key": "us-wv-027",
"value": 800
},
{
"hc-key": "us-md-001",
"value": 801
},
{
"hc-key": "us-wv-057",
"value": 802
},
{
"hc-key": "us-pa-057",
"value": 803
},
{
"hc-key": "us-tx-077",
"value": 804
},
{
"hc-key": "us-tx-237",
"value": 805
},
{
"hc-key": "us-tx-367",
"value": 806
},
{
"hc-key": "us-id-069",
"value": 807
},
{
"hc-key": "us-mo-221",
"value": 808
},
{
"hc-key": "us-ny-109",
"value": 809
},
{
"hc-key": "us-ny-011",
"value": 810
},
{
"hc-key": "us-ny-075",
"value": 811
},
{
"hc-key": "us-ny-053",
"value": 812
},
{
"hc-key": "us-tx-363",
"value": 813
},
{
"hc-key": "us-tx-143",
"value": 814
},
{
"hc-key": "us-tx-133",
"value": 815
},
{
"hc-key": "us-tx-059",
"value": 816
},
{
"hc-key": "us-tx-417",
"value": 817
},
{
"hc-key": "us-tx-207",
"value": 818
},
{
"hc-key": "us-va-085",
"value": 819
},
{
"hc-key": "us-va-075",
"value": 820
},
{
"hc-key": "us-oh-033",
"value": 821
},
{
"hc-key": "us-oh-139",
"value": 822
},
{
"hc-key": "us-il-067",
"value": 823
},
{
"hc-key": "us-il-001",
"value": 824
},
{
"hc-key": "us-il-009",
"value": 825
},
{
"hc-key": "us-il-075",
"value": 826
},
{
"hc-key": "us-ga-113",
"value": 827
},
{
"hc-key": "us-ga-265",
"value": 828
},
{
"hc-key": "us-ga-141",
"value": 829
},
{
"hc-key": "us-tx-091",
"value": 830
},
{
"hc-key": "us-tx-259",
"value": 831
},
{
"hc-key": "us-ny-001",
"value": 832
},
{
"hc-key": "us-ny-039",
"value": 833
},
{
"hc-key": "us-ga-019",
"value": 834
},
{
"hc-key": "us-ga-277",
"value": 835
},
{
"hc-key": "us-ga-155",
"value": 836
},
{
"hc-key": "us-ga-321",
"value": 837
},
{
"hc-key": "us-ga-287",
"value": 838
},
{
"hc-key": "us-ga-081",
"value": 839
},
{
"hc-key": "us-ga-075",
"value": 840
},
{
"hc-key": "us-sd-025",
"value": 841
},
{
"hc-key": "us-sd-077",
"value": 842
},
{
"hc-key": "us-sd-005",
"value": 843
},
{
"hc-key": "us-ny-043",
"value": 844
},
{
"hc-key": "us-ny-065",
"value": 845
},
{
"hc-key": "us-mi-053",
"value": 846
},
{
"hc-key": "us-mn-027",
"value": 847
},
{
"hc-key": "us-mn-005",
"value": 848
},
{
"hc-key": "us-mn-107",
"value": 849
},
{
"hc-key": "us-mn-057",
"value": 850
},
{
"hc-key": "us-tn-013",
"value": 851
},
{
"hc-key": "us-tn-173",
"value": 852
},
{
"hc-key": "us-tn-057",
"value": 853
},
{
"hc-key": "us-nd-015",
"value": 854
},
{
"hc-key": "us-nd-029",
"value": 855
},
{
"hc-key": "us-nd-047",
"value": 856
},
{
"hc-key": "us-tx-039",
"value": 857
},
{
"hc-key": "us-tx-157",
"value": 858
},
{
"hc-key": "us-tx-481",
"value": 859
},
{
"hc-key": "us-tn-009",
"value": 860
},
{
"hc-key": "us-mt-031",
"value": 861
},
{
"hc-key": "us-ga-143",
"value": 862
},
{
"hc-key": "us-il-041",
"value": 863
},
{
"hc-key": "us-va-177",
"value": 864
},
{
"hc-key": "us-va-137",
"value": 865
},
{
"hc-key": "us-va-079",
"value": 866
},
{
"hc-key": "us-wi-027",
"value": 867
},
{
"hc-key": "us-wi-055",
"value": 868
},
{
"hc-key": "us-wi-047",
"value": 869
},
{
"hc-key": "us-wi-137",
"value": 870
},
{
"hc-key": "us-ar-049",
"value": 871
},
{
"hc-key": "us-ar-065",
"value": 872
},
{
"hc-key": "us-ar-063",
"value": 873
},
{
"hc-key": "us-ca-107",
"value": 874
},
{
"hc-key": "us-ca-031",
"value": 875
},
{
"hc-key": "us-ca-087",
"value": 876
},
{
"hc-key": "us-mo-125",
"value": 877
},
{
"hc-key": "us-mo-131",
"value": 878
},
{
"hc-key": "us-nc-005",
"value": 879
},
{
"hc-key": "us-nc-193",
"value": 880
},
{
"hc-key": "us-nc-189",
"value": 881
},
{
"hc-key": "us-nc-027",
"value": 882
},
{
"hc-key": "us-ks-043",
"value": 883
},
{
"hc-key": "us-mo-021",
"value": 884
},
{
"hc-key": "us-mo-003",
"value": 885
},
{
"hc-key": "us-mo-165",
"value": 886
},
{
"hc-key": "us-mo-047",
"value": 887
},
{
"hc-key": "us-ks-005",
"value": 888
},
{
"hc-key": "us-ne-177",
"value": 889
},
{
"hc-key": "us-ia-085",
"value": 890
},
{
"hc-key": "us-ne-021",
"value": 891
},
{
"hc-key": "us-ia-009",
"value": 892
},
{
"hc-key": "us-ia-165",
"value": 893
},
{
"hc-key": "us-md-013",
"value": 894
},
{
"hc-key": "us-ia-023",
"value": 895
},
{
"hc-key": "us-ia-013",
"value": 896
},
{
"hc-key": "us-ia-011",
"value": 897
},
{
"hc-key": "us-ky-129",
"value": 898
},
{
"hc-key": "us-ky-189",
"value": 899
},
{
"hc-key": "us-ky-051",
"value": 900
},
{
"hc-key": "us-pa-015",
"value": 901
},
{
"hc-key": "us-pa-117",
"value": 902
},
{
"hc-key": "us-oh-029",
"value": 903
},
{
"hc-key": "us-wv-029",
"value": 904
},
{
"hc-key": "us-mo-051",
"value": 905
},
{
"hc-key": "us-mi-159",
"value": 906
},
{
"hc-key": "us-mi-027",
"value": 907
},
{
"hc-key": "us-mi-021",
"value": 908
},
{
"hc-key": "us-in-091",
"value": 909
},
{
"hc-key": "us-in-127",
"value": 910
},
{
"hc-key": "us-pa-061",
"value": 911
},
{
"hc-key": "us-va-141",
"value": 912
},
{
"hc-key": "us-mi-119",
"value": 913
},
{
"hc-key": "us-mi-135",
"value": 914
},
{
"hc-key": "us-nm-007",
"value": 915
},
{
"hc-key": "us-il-133",
"value": 916
},
{
"hc-key": "us-il-163",
"value": 917
},
{
"hc-key": "us-il-189",
"value": 918
},
{
"hc-key": "us-pa-009",
"value": 919
},
{
"hc-key": "us-pa-013",
"value": 920
},
{
"hc-key": "us-ar-083",
"value": 921
},
{
"hc-key": "us-ar-047",
"value": 922
},
{
"hc-key": "us-ar-127",
"value": 923
},
{
"hc-key": "us-nc-003",
"value": 924
},
{
"hc-key": "us-vt-025",
"value": 925
},
{
"hc-key": "us-nh-019",
"value": 926
},
{
"hc-key": "us-vt-027",
"value": 927
},
{
"hc-key": "us-nh-013",
"value": 928
},
{
"hc-key": "us-mn-089",
"value": 929
},
{
"hc-key": "us-mn-113",
"value": 930
},
{
"hc-key": "us-va-101",
"value": 931
},
{
"hc-key": "us-co-055",
"value": 932
},
{
"hc-key": "us-tx-255",
"value": 933
},
{
"hc-key": "us-tx-123",
"value": 934
},
{
"hc-key": "us-ut-029",
"value": 935
},
{
"hc-key": "us-ut-011",
"value": 936
},
{
"hc-key": "us-tx-397",
"value": 937
},
{
"hc-key": "us-tx-113",
"value": 938
},
{
"hc-key": "us-tx-257",
"value": 939
},
{
"hc-key": "us-tn-087",
"value": 940
},
{
"hc-key": "us-il-159",
"value": 941
},
{
"hc-key": "us-il-047",
"value": 942
},
{
"hc-key": "us-il-191",
"value": 943
},
{
"hc-key": "us-il-185",
"value": 944
},
{
"hc-key": "us-al-009",
"value": 945
},
{
"hc-key": "us-mt-051",
"value": 946
},
{
"hc-key": "us-tx-311",
"value": 947
},
{
"hc-key": "us-tx-131",
"value": 948
},
{
"hc-key": "us-tx-247",
"value": 949
},
{
"hc-key": "us-tx-215",
"value": 950
},
{
"hc-key": "us-tx-047",
"value": 951
},
{
"hc-key": "us-mo-163",
"value": 952
},
{
"hc-key": "us-mo-173",
"value": 953
},
{
"hc-key": "us-tx-251",
"value": 954
},
{
"hc-key": "us-or-023",
"value": 955
},
{
"hc-key": "us-tx-159",
"value": 956
},
{
"hc-key": "us-ny-113",
"value": 957
},
{
"hc-key": "us-va-157",
"value": 958
},
{
"hc-key": "us-va-113",
"value": 959
},
{
"hc-key": "us-ga-057",
"value": 960
},
{
"hc-key": "us-fl-095",
"value": 961
},
{
"hc-key": "us-fl-069",
"value": 962
},
{
"hc-key": "us-ok-111",
"value": 963
},
{
"hc-key": "us-in-099",
"value": 964
},
{
"hc-key": "us-in-049",
"value": 965
},
{
"hc-key": "us-in-169",
"value": 966
},
{
"hc-key": "us-mn-169",
"value": 967
},
{
"hc-key": "us-ms-149",
"value": 968
},
{
"hc-key": "us-ms-021",
"value": 969
},
{
"hc-key": "us-la-107",
"value": 970
},
{
"hc-key": "us-mo-147",
"value": 971
},
{
"hc-key": "us-mo-139",
"value": 972
},
{
"hc-key": "us-ks-099",
"value": 973
},
{
"hc-key": "us-nc-131",
"value": 974
},
{
"hc-key": "us-nc-083",
"value": 975
},
{
"hc-key": "us-ky-193",
"value": 976
},
{
"hc-key": "us-ky-133",
"value": 977
},
{
"hc-key": "us-pa-035",
"value": 978
},
{
"hc-key": "us-ok-131",
"value": 979
},
{
"hc-key": "us-ok-147",
"value": 980
},
{
"hc-key": "us-ok-113",
"value": 981
},
{
"hc-key": "us-wv-061",
"value": 982
},
{
"hc-key": "us-wv-077",
"value": 983
},
{
"hc-key": "us-wv-023",
"value": 984
},
{
"hc-key": "us-wv-071",
"value": 985
},
{
"hc-key": "us-wi-135",
"value": 986
},
{
"hc-key": "us-wi-115",
"value": 987
},
{
"hc-key": "us-wi-087",
"value": 988
},
{
"hc-key": "us-tx-435",
"value": 989
},
{
"hc-key": "us-tx-137",
"value": 990
},
{
"hc-key": "us-tx-265",
"value": 991
},
{
"hc-key": "us-tx-271",
"value": 992
},
{
"hc-key": "us-mo-153",
"value": 993
},
{
"hc-key": "us-tx-473",
"value": 994
},
{
"hc-key": "us-al-053",
"value": 995
},
{
"hc-key": "us-vt-009",
"value": 996
},
{
"hc-key": "us-nh-009",
"value": 997
},
{
"hc-key": "us-vt-017",
"value": 998
},
{
"hc-key": "us-ga-137",
"value": 999
},
{
"hc-key": "us-ga-139",
"value": 1000
},
{
"hc-key": "us-ga-157",
"value": 1001
},
{
"hc-key": "us-ga-135",
"value": 1002
},
{
"hc-key": "us-ga-279",
"value": 1003
},
{
"hc-key": "us-ga-283",
"value": 1004
},
{
"hc-key": "us-ga-061",
"value": 1005
},
{
"hc-key": "us-wi-125",
"value": 1006
},
{
"hc-key": "us-wi-041",
"value": 1007
},
{
"hc-key": "us-mn-007",
"value": 1008
},
{
"hc-key": "us-mn-077",
"value": 1009
},
{
"hc-key": "us-md-009",
"value": 1010
},
{
"hc-key": "us-nm-001",
"value": 1011
},
{
"hc-key": "us-nm-006",
"value": 1012
},
{
"hc-key": "us-nm-045",
"value": 1013
},
{
"hc-key": "us-nm-049",
"value": 1014
},
{
"hc-key": "us-nm-028",
"value": 1015
},
{
"hc-key": "us-nm-057",
"value": 1016
},
{
"hc-key": "us-nj-005",
"value": 1017
},
{
"hc-key": "us-ga-099",
"value": 1018
},
{
"hc-key": "us-nd-083",
"value": 1019
},
{
"hc-key": "us-nd-049",
"value": 1020
},
{
"hc-key": "us-nd-045",
"value": 1021
},
{
"hc-key": "us-id-023",
"value": 1022
},
{
"hc-key": "us-nd-043",
"value": 1023
},
{
"hc-key": "us-nd-103",
"value": 1024
},
{
"hc-key": "us-tx-273",
"value": 1025
},
{
"hc-key": "us-tx-489",
"value": 1026
},
{
"hc-key": "us-il-055",
"value": 1027
},
{
"hc-key": "us-il-065",
"value": 1028
},
{
"hc-key": "us-il-081",
"value": 1029
},
{
"hc-key": "us-ar-051",
"value": 1030
},
{
"hc-key": "us-ar-105",
"value": 1031
},
{
"hc-key": "us-ar-029",
"value": 1032
},
{
"hc-key": "us-ar-149",
"value": 1033
},
{
"hc-key": "us-ks-181",
"value": 1034
},
{
"hc-key": "us-ks-023",
"value": 1035
},
{
"hc-key": "us-ks-153",
"value": 1036
},
{
"hc-key": "us-ia-185",
"value": 1037
},
{
"hc-key": "us-tx-165",
"value": 1038
},
{
"hc-key": "us-tx-317",
"value": 1039
},
{
"hc-key": "us-ar-091",
"value": 1040
},
{
"hc-key": "us-ar-073",
"value": 1041
},
{
"hc-key": "us-tx-037",
"value": 1042
},
{
"hc-key": "us-mo-127",
"value": 1043
},
{
"hc-key": "us-mo-111",
"value": 1044
},
{
"hc-key": "us-ia-061",
"value": 1045
},
{
"hc-key": "us-ia-097",
"value": 1046
},
{
"hc-key": "us-nd-005",
"value": 1047
},
{
"hc-key": "us-nd-063",
"value": 1048
},
{
"hc-key": "us-ny-019",
"value": 1049
},
{
"hc-key": "us-ny-031",
"value": 1050
},
{
"hc-key": "us-oh-079",
"value": 1051
},
{
"hc-key": "us-oh-163",
"value": 1052
},
{
"hc-key": "us-oh-073",
"value": 1053
},
{
"hc-key": "us-oh-129",
"value": 1054
},
{
"hc-key": "us-oh-045",
"value": 1055
},
{
"hc-key": "us-al-085",
"value": 1056
},
{
"hc-key": "us-ia-113",
"value": 1057
},
{
"hc-key": "us-ga-215",
"value": 1058
},
{
"hc-key": "us-tx-003",
"value": 1059
},
{
"hc-key": "us-tx-495",
"value": 1060
},
{
"hc-key": "us-oh-149",
"value": 1061
},
{
"hc-key": "us-oh-021",
"value": 1062
},
{
"hc-key": "us-oh-109",
"value": 1063
},
{
"hc-key": "us-oh-023",
"value": 1064
},
{
"hc-key": "us-tx-117",
"value": 1065
},
{
"hc-key": "us-nm-037",
"value": 1066
},
{
"hc-key": "us-tx-359",
"value": 1067
},
{
"hc-key": "us-ok-133",
"value": 1068
},
{
"hc-key": "us-sc-081",
"value": 1069
},
{
"hc-key": "us-sc-003",
"value": 1070
},
{
"hc-key": "us-ga-251",
"value": 1071
},
{
"hc-key": "us-ga-033",
"value": 1072
},
{
"hc-key": "us-ga-165",
"value": 1073
},
{
"hc-key": "us-ga-245",
"value": 1074
},
{
"hc-key": "us-tx-305",
"value": 1075
},
{
"hc-key": "us-tx-169",
"value": 1076
},
{
"hc-key": "us-wi-079",
"value": 1077
},
{
"hc-key": "us-wi-089",
"value": 1078
},
{
"hc-key": "us-sc-047",
"value": 1079
},
{
"hc-key": "us-sc-059",
"value": 1080
},
{
"hc-key": "us-sc-045",
"value": 1081
},
{
"hc-key": "us-sc-001",
"value": 1082
},
{
"hc-key": "us-sd-019",
"value": 1083
},
{
"hc-key": "us-wy-011",
"value": 1084
},
{
"hc-key": "us-wy-005",
"value": 1085
},
{
"hc-key": "us-mt-011",
"value": 1086
},
{
"hc-key": "us-mt-025",
"value": 1087
},
{
"hc-key": "us-ma-013",
"value": 1088
},
{
"hc-key": "us-ma-015",
"value": 1089
},
{
"hc-key": "us-tx-055",
"value": 1090
},
{
"hc-key": "us-tx-209",
"value": 1091
},
{
"hc-key": "us-al-111",
"value": 1092
},
{
"hc-key": "us-al-027",
"value": 1093
},
{
"hc-key": "us-al-037",
"value": 1094
},
{
"hc-key": "us-ky-095",
"value": 1095
},
{
"hc-key": "us-ks-161",
"value": 1096
},
{
"hc-key": "us-ks-061",
"value": 1097
},
{
"hc-key": "us-tn-163",
"value": 1098
},
{
"hc-key": "us-tn-019",
"value": 1099
},
{
"hc-key": "us-va-111",
"value": 1100
},
{
"hc-key": "us-va-037",
"value": 1101
},
{
"hc-key": "us-tn-179",
"value": 1102
},
{
"hc-key": "us-tn-073",
"value": 1103
},
{
"hc-key": "us-sc-071",
"value": 1104
},
{
"hc-key": "us-va-181",
"value": 1105
},
{
"hc-key": "us-va-093",
"value": 1106
},
{
"hc-key": "us-va-175",
"value": 1107
},
{
"hc-key": "us-va-800",
"value": 1108
},
{
"hc-key": "us-va-550",
"value": 1109
},
{
"hc-key": "us-nc-073",
"value": 1110
},
{
"hc-key": "us-or-069",
"value": 1111
},
{
"hc-key": "us-va-061",
"value": 1112
},
{
"hc-key": "us-nv-005",
"value": 1113
},
{
"hc-key": "us-in-035",
"value": 1114
},
{
"hc-key": "us-wi-131",
"value": 1115
},
{
"hc-key": "us-pa-085",
"value": 1116
},
{
"hc-key": "us-pa-039",
"value": 1117
},
{
"hc-key": "us-il-193",
"value": 1118
},
{
"hc-key": "us-il-039",
"value": 1119
},
{
"hc-key": "us-il-115",
"value": 1120
},
{
"hc-key": "us-il-173",
"value": 1121
},
{
"hc-key": "us-il-137",
"value": 1122
},
{
"hc-key": "us-ut-039",
"value": 1123
},
{
"hc-key": "us-mn-049",
"value": 1124
},
{
"hc-key": "us-nc-173",
"value": 1125
},
{
"hc-key": "us-nc-099",
"value": 1126
},
{
"hc-key": "us-fl-103",
"value": 1127
},
{
"hc-key": "us-fl-101",
"value": 1128
},
{
"hc-key": "us-fl-119",
"value": 1129
},
{
"hc-key": "us-nd-091",
"value": 1130
},
{
"hc-key": "us-nd-003",
"value": 1131
},
{
"hc-key": "us-nd-073",
"value": 1132
},
{
"hc-key": "us-nd-097",
"value": 1133
},
{
"hc-key": "us-nc-011",
"value": 1134
},
{
"hc-key": "us-wv-107",
"value": 1135
},
{
"hc-key": "us-wv-073",
"value": 1136
},
{
"hc-key": "us-wi-097",
"value": 1137
},
{
"hc-key": "us-sc-063",
"value": 1138
},
{
"hc-key": "us-md-510",
"value": 1139
},
{
"hc-key": "us-wi-039",
"value": 1140
},
{
"hc-key": "us-ok-059",
"value": 1141
},
{
"hc-key": "us-ok-151",
"value": 1142
},
{
"hc-key": "us-ok-003",
"value": 1143
},
{
"hc-key": "us-ks-007",
"value": 1144
},
{
"hc-key": "us-ky-063",
"value": 1145
},
{
"hc-key": "us-ma-003",
"value": 1146
},
{
"hc-key": "us-mo-041",
"value": 1147
},
{
"hc-key": "us-mo-195",
"value": 1148
},
{
"hc-key": "us-ks-167",
"value": 1149
},
{
"hc-key": "us-tn-111",
"value": 1150
},
{
"hc-key": "us-ar-023",
"value": 1151
},
{
"hc-key": "us-id-003",
"value": 1152
},
{
"hc-key": "us-id-045",
"value": 1153
},
{
"hc-key": "us-ma-021",
"value": 1154
},
{
"hc-key": "us-pa-037",
"value": 1155
},
{
"hc-key": "us-pa-107",
"value": 1156
},
{
"hc-key": "us-nc-109",
"value": 1157
},
{
"hc-key": "us-nc-045",
"value": 1158
},
{
"hc-key": "us-ar-019",
"value": 1159
},
{
"hc-key": "us-ar-059",
"value": 1160
},
{
"hc-key": "us-il-169",
"value": 1161
},
{
"hc-key": "us-il-057",
"value": 1162
},
{
"hc-key": "us-ca-051",
"value": 1163
},
{
"hc-key": "us-nm-013",
"value": 1164
},
{
"hc-key": "us-nd-039",
"value": 1165
},
{
"hc-key": "us-ca-055",
"value": 1166
},
{
"hc-key": "us-ca-095",
"value": 1167
},
{
"hc-key": "us-tx-449",
"value": 1168
},
{
"hc-key": "us-nc-125",
"value": 1169
},
{
"hc-key": "us-ks-009",
"value": 1170
},
{
"hc-key": "us-nd-087",
"value": 1171
},
{
"hc-key": "us-la-083",
"value": 1172
},
{
"hc-key": "us-ne-041",
"value": 1173
},
{
"hc-key": "us-ne-071",
"value": 1174
},
{
"hc-key": "us-al-119",
"value": 1175
},
{
"hc-key": "us-ms-069",
"value": 1176
},
{
"hc-key": "us-al-093",
"value": 1177
},
{
"hc-key": "us-al-133",
"value": 1178
},
{
"hc-key": "us-fl-117",
"value": 1179
},
{
"hc-key": "us-ms-131",
"value": 1180
},
{
"hc-key": "us-ms-109",
"value": 1181
},
{
"hc-key": "us-ms-035",
"value": 1182
},
{
"hc-key": "us-ms-073",
"value": 1183
},
{
"hc-key": "us-mi-037",
"value": 1184
},
{
"hc-key": "us-mi-065",
"value": 1185
},
{
"hc-key": "us-ks-149",
"value": 1186
},
{
"hc-key": "us-ks-177",
"value": 1187
},
{
"hc-key": "us-sd-061",
"value": 1188
},
{
"hc-key": "us-sd-035",
"value": 1189
},
{
"hc-key": "us-mn-061",
"value": 1190
},
{
"hc-key": "us-co-073",
"value": 1191
},
{
"hc-key": "us-co-063",
"value": 1192
},
{
"hc-key": "us-ny-025",
"value": 1193
},
{
"hc-key": "us-ny-077",
"value": 1194
},
{
"hc-key": "us-ny-115",
"value": 1195
},
{
"hc-key": "us-in-005",
"value": 1196
},
{
"hc-key": "us-in-081",
"value": 1197
},
{
"hc-key": "us-tx-445",
"value": 1198
},
{
"hc-key": "us-al-121",
"value": 1199
},
{
"hc-key": "us-ia-021",
"value": 1200
},
{
"hc-key": "us-ia-035",
"value": 1201
},
{
"hc-key": "us-nc-197",
"value": 1202
},
{
"hc-key": "us-nc-067",
"value": 1203
},
{
"hc-key": "us-nc-081",
"value": 1204
},
{
"hc-key": "us-nc-057",
"value": 1205
},
{
"hc-key": "us-nv-510",
"value": 1206
},
{
"hc-key": "us-ga-193",
"value": 1207
},
{
"hc-key": "us-ga-261",
"value": 1208
},
{
"hc-key": "us-mo-023",
"value": 1209
},
{
"hc-key": "us-mo-223",
"value": 1210
},
{
"hc-key": "us-mo-179",
"value": 1211
},
{
"hc-key": "us-co-081",
"value": 1212
},
{
"hc-key": "us-wy-025",
"value": 1213
},
{
"hc-key": "us-wy-009",
"value": 1214
},
{
"hc-key": "us-wi-065",
"value": 1215
},
{
"hc-key": "us-il-177",
"value": 1216
},
{
"hc-key": "us-wi-045",
"value": 1217
},
{
"hc-key": "us-wi-105",
"value": 1218
},
{
"hc-key": "us-mi-087",
"value": 1219
},
{
"hc-key": "us-la-015",
"value": 1220
},
{
"hc-key": "us-la-119",
"value": 1221
},
{
"hc-key": "us-ar-027",
"value": 1222
},
{
"hc-key": "us-ms-119",
"value": 1223
},
{
"hc-key": "us-ms-143",
"value": 1224
},
{
"hc-key": "us-ms-135",
"value": 1225
},
{
"hc-key": "us-ms-161",
"value": 1226
},
{
"hc-key": "us-la-053",
"value": 1227
},
{
"hc-key": "us-la-039",
"value": 1228
},
{
"hc-key": "us-la-079",
"value": 1229
},
{
"hc-key": "us-tn-023",
"value": 1230
},
{
"hc-key": "us-tn-071",
"value": 1231
},
{
"hc-key": "us-tn-077",
"value": 1232
},
{
"hc-key": "us-tn-069",
"value": 1233
},
{
"hc-key": "us-az-003",
"value": 1234
},
{
"hc-key": "us-nm-023",
"value": 1235
},
{
"hc-key": "us-ok-009",
"value": 1236
},
{
"hc-key": "us-ok-055",
"value": 1237
},
{
"hc-key": "us-ok-057",
"value": 1238
},
{
"hc-key": "us-tx-075",
"value": 1239
},
{
"hc-key": "us-mo-011",
"value": 1240
},
{
"hc-key": "us-mo-097",
"value": 1241
},
{
"hc-key": "us-mo-039",
"value": 1242
},
{
"hc-key": "us-ar-103",
"value": 1243
},
{
"hc-key": "us-oh-037",
"value": 1244
},
{
"hc-key": "us-in-075",
"value": 1245
},
{
"hc-key": "us-sd-045",
"value": 1246
},
{
"hc-key": "us-sd-129",
"value": 1247
},
{
"hc-key": "us-sd-041",
"value": 1248
},
{
"hc-key": "us-sd-137",
"value": 1249
},
{
"hc-key": "us-sd-055",
"value": 1250
},
{
"hc-key": "us-ms-111",
"value": 1251
},
{
"hc-key": "us-ms-041",
"value": 1252
},
{
"hc-key": "us-ms-039",
"value": 1253
},
{
"hc-key": "us-ca-013",
"value": 1254
},
{
"hc-key": "us-va-087",
"value": 1255
},
{
"hc-key": "us-ny-119",
"value": 1256
},
{
"hc-key": "us-ny-087",
"value": 1257
},
{
"hc-key": "us-ny-071",
"value": 1258
},
{
"hc-key": "us-nj-003",
"value": 1259
},
{
"hc-key": "us-mo-017",
"value": 1260
},
{
"hc-key": "us-wv-059",
"value": 1261
},
{
"hc-key": "us-wv-033",
"value": 1262
},
{
"hc-key": "us-wv-049",
"value": 1263
},
{
"hc-key": "us-nc-077",
"value": 1264
},
{
"hc-key": "us-ne-179",
"value": 1265
},
{
"hc-key": "us-ne-139",
"value": 1266
},
{
"hc-key": "us-sc-005",
"value": 1267
},
{
"hc-key": "us-nd-051",
"value": 1268
},
{
"hc-key": "us-ne-023",
"value": 1269
},
{
"hc-key": "us-ne-185",
"value": 1270
},
{
"hc-key": "us-ne-143",
"value": 1271
},
{
"hc-key": "us-ne-141",
"value": 1272
},
{
"hc-key": "us-nc-185",
"value": 1273
},
{
"hc-key": "us-nc-069",
"value": 1274
},
{
"hc-key": "us-de-005",
"value": 1275
},
{
"hc-key": "us-mo-175",
"value": 1276
},
{
"hc-key": "us-mo-137",
"value": 1277
},
{
"hc-key": "us-ks-035",
"value": 1278
},
{
"hc-key": "us-ks-015",
"value": 1279
},
{
"hc-key": "us-mi-105",
"value": 1280
},
{
"hc-key": "us-il-007",
"value": 1281
},
{
"hc-key": "us-il-201",
"value": 1282
},
{
"hc-key": "us-wi-127",
"value": 1283
},
{
"hc-key": "us-sc-007",
"value": 1284
},
{
"hc-key": "us-sc-077",
"value": 1285
},
{
"hc-key": "us-in-011",
"value": 1286
},
{
"hc-key": "us-in-097",
"value": 1287
},
{
"hc-key": "us-in-023",
"value": 1288
},
{
"hc-key": "us-in-015",
"value": 1289
},
{
"hc-key": "us-in-057",
"value": 1290
},
{
"hc-key": "us-in-095",
"value": 1291
},
{
"hc-key": "us-il-027",
"value": 1292
},
{
"hc-key": "us-id-067",
"value": 1293
},
{
"hc-key": "us-id-031",
"value": 1294
},
{
"hc-key": "us-id-053",
"value": 1295
},
{
"hc-key": "us-ms-127",
"value": 1296
},
{
"hc-key": "us-ms-121",
"value": 1297
},
{
"hc-key": "us-tx-345",
"value": 1298
},
{
"hc-key": "us-tx-101",
"value": 1299
},
{
"hc-key": "us-tx-125",
"value": 1300
},
{
"hc-key": "us-tx-153",
"value": 1301
},
{
"hc-key": "us-or-039",
"value": 1302
},
{
"hc-key": "us-ok-137",
"value": 1303
},
{
"hc-key": "us-ok-033",
"value": 1304
},
{
"hc-key": "us-tx-485",
"value": 1305
},
{
"hc-key": "us-mi-155",
"value": 1306
},
{
"hc-key": "us-ks-089",
"value": 1307
},
{
"hc-key": "us-ks-123",
"value": 1308
},
{
"hc-key": "us-ks-029",
"value": 1309
},
{
"hc-key": "us-ms-091",
"value": 1310
},
{
"hc-key": "us-il-085",
"value": 1311
},
{
"hc-key": "us-in-059",
"value": 1312
},
{
"hc-key": "us-va-620",
"value": 1313
},
{
"hc-key": "us-tx-329",
"value": 1314
},
{
"hc-key": "us-ks-101",
"value": 1315
},
{
"hc-key": "us-ks-171",
"value": 1316
},
{
"hc-key": "us-mt-049",
"value": 1317
},
{
"hc-key": "us-il-199",
"value": 1318
},
{
"hc-key": "us-mt-029",
"value": 1319
},
{
"hc-key": "us-ks-189",
"value": 1320
},
{
"hc-key": "us-ky-067",
"value": 1321
},
{
"hc-key": "us-ky-151",
"value": 1322
},
{
"hc-key": "us-ky-203",
"value": 1323
},
{
"hc-key": "us-sd-013",
"value": 1324
},
{
"hc-key": "us-wv-001",
"value": 1325
},
{
"hc-key": "us-tn-055",
"value": 1326
},
{
"hc-key": "us-tn-099",
"value": 1327
},
{
"hc-key": "us-ne-045",
"value": 1328
},
{
"hc-key": "us-ne-013",
"value": 1329
},
{
"hc-key": "us-pa-109",
"value": 1330
},
{
"hc-key": "us-tx-469",
"value": 1331
},
{
"hc-key": "us-tx-239",
"value": 1332
},
{
"hc-key": "us-mi-147",
"value": 1333
},
{
"hc-key": "us-ne-173",
"value": 1334
},
{
"hc-key": "us-vt-011",
"value": 1335
},
{
"hc-key": "us-va-067",
"value": 1336
},
{
"hc-key": "us-ok-011",
"value": 1337
},
{
"hc-key": "us-ok-039",
"value": 1338
},
{
"hc-key": "us-wv-093",
"value": 1339
},
{
"hc-key": "us-wi-023",
"value": 1340
},
{
"hc-key": "us-ia-157",
"value": 1341
},
{
"hc-key": "us-ia-123",
"value": 1342
},
{
"hc-key": "us-ia-125",
"value": 1343
},
{
"hc-key": "us-ia-051",
"value": 1344
},
{
"hc-key": "us-ia-179",
"value": 1345
},
{
"hc-key": "us-ia-135",
"value": 1346
},
{
"hc-key": "us-ks-091",
"value": 1347
},
{
"hc-key": "us-ks-045",
"value": 1348
},
{
"hc-key": "us-ks-059",
"value": 1349
},
{
"hc-key": "us-ky-059",
"value": 1350
},
{
"hc-key": "us-ky-237",
"value": 1351
},
{
"hc-key": "us-ky-197",
"value": 1352
},
{
"hc-key": "us-or-061",
"value": 1353
},
{
"hc-key": "us-ga-151",
"value": 1354
},
{
"hc-key": "us-nd-041",
"value": 1355
},
{
"hc-key": "us-sd-105",
"value": 1356
},
{
"hc-key": "us-nd-085",
"value": 1357
},
{
"hc-key": "us-pa-063",
"value": 1358
},
{
"hc-key": "us-pa-021",
"value": 1359
},
{
"hc-key": "us-tn-107",
"value": 1360
},
{
"hc-key": "us-mi-093",
"value": 1361
},
{
"hc-key": "us-mi-075",
"value": 1362
},
{
"hc-key": "us-co-087",
"value": 1363
},
{
"hc-key": "us-pa-127",
"value": 1364
},
{
"hc-key": "us-pa-069",
"value": 1365
},
{
"hc-key": "us-ok-123",
"value": 1366
},
{
"hc-key": "us-ok-037",
"value": 1367
},
{
"hc-key": "us-ok-081",
"value": 1368
},
{
"hc-key": "us-tn-175",
"value": 1369
},
{
"hc-key": "us-ok-125",
"value": 1370
},
{
"hc-key": "us-ct-013",
"value": 1371
},
{
"hc-key": "us-ga-003",
"value": 1372
},
{
"hc-key": "us-tx-145",
"value": 1373
},
{
"hc-key": "us-ks-033",
"value": 1374
},
{
"hc-key": "us-ky-113",
"value": 1375
},
{
"hc-key": "us-ky-171",
"value": 1376
},
{
"hc-key": "us-ok-075",
"value": 1377
},
{
"hc-key": "us-sd-079",
"value": 1378
},
{
"hc-key": "us-nc-033",
"value": 1379
},
{
"hc-key": "us-al-003",
"value": 1380
},
{
"hc-key": "us-fl-033",
"value": 1381
},
{
"hc-key": "us-va-127",
"value": 1382
},
{
"hc-key": "us-ga-053",
"value": 1383
},
{
"hc-key": "us-ny-049",
"value": 1384
},
{
"hc-key": "us-in-077",
"value": 1385
},
{
"hc-key": "us-va-019",
"value": 1386
},
{
"hc-key": "us-va-009",
"value": 1387
},
{
"hc-key": "us-va-011",
"value": 1388
},
{
"hc-key": "us-va-161",
"value": 1389
},
{
"hc-key": "us-va-775",
"value": 1390
},
{
"hc-key": "us-nm-033",
"value": 1391
},
{
"hc-key": "us-ne-077",
"value": 1392
},
{
"hc-key": "us-ne-011",
"value": 1393
},
{
"hc-key": "us-mo-149",
"value": 1394
},
{
"hc-key": "us-tn-161",
"value": 1395
},
{
"hc-key": "us-tn-083",
"value": 1396
},
{
"hc-key": "us-pa-113",
"value": 1397
},
{
"hc-key": "us-pa-131",
"value": 1398
},
{
"hc-key": "us-in-167",
"value": 1399
},
{
"hc-key": "us-il-045",
"value": 1400
},
{
"hc-key": "us-in-165",
"value": 1401
},
{
"hc-key": "us-mi-149",
"value": 1402
},
{
"hc-key": "us-in-039",
"value": 1403
},
{
"hc-key": "us-in-087",
"value": 1404
},
{
"hc-key": "us-tx-189",
"value": 1405
},
{
"hc-key": "us-tx-303",
"value": 1406
},
{
"hc-key": "us-tx-107",
"value": 1407
},
{
"hc-key": "us-mn-171",
"value": 1408
},
{
"hc-key": "us-mn-093",
"value": 1409
},
{
"hc-key": "us-oh-005",
"value": 1410
},
{
"hc-key": "us-ne-119",
"value": 1411
},
{
"hc-key": "us-ne-167",
"value": 1412
},
{
"hc-key": "us-fl-085",
"value": 1413
},
{
"hc-key": "us-ga-227",
"value": 1414
},
{
"hc-key": "us-ga-085",
"value": 1415
},
{
"hc-key": "us-ga-319",
"value": 1416
},
{
"hc-key": "us-ga-167",
"value": 1417
},
{
"hc-key": "us-ar-095",
"value": 1418
},
{
"hc-key": "us-ar-117",
"value": 1419
},
{
"hc-key": "us-ar-147",
"value": 1420
},
{
"hc-key": "us-mo-059",
"value": 1421
},
{
"hc-key": "us-mo-169",
"value": 1422
},
{
"hc-key": "us-va-143",
"value": 1423
},
{
"hc-key": "us-ks-145",
"value": 1424
},
{
"hc-key": "us-ks-137",
"value": 1425
},
{
"hc-key": "us-ks-147",
"value": 1426
},
{
"hc-key": "us-ks-065",
"value": 1427
},
{
"hc-key": "us-ks-063",
"value": 1428
},
{
"hc-key": "us-ks-109",
"value": 1429
},
{
"hc-key": "us-la-099",
"value": 1430
},
{
"hc-key": "us-la-097",
"value": 1431
},
{
"hc-key": "us-la-055",
"value": 1432
},
{
"hc-key": "us-oh-095",
"value": 1433
},
{
"hc-key": "us-oh-123",
"value": 1434
},
{
"hc-key": "us-oh-069",
"value": 1435
},
{
"hc-key": "us-ar-031",
"value": 1436
},
{
"hc-key": "us-ar-093",
"value": 1437
},
{
"hc-key": "us-ar-035",
"value": 1438
},
{
"hc-key": "us-ky-117",
"value": 1439
},
{
"hc-key": "us-ky-081",
"value": 1440
},
{
"hc-key": "us-ky-077",
"value": 1441
},
{
"hc-key": "us-ky-097",
"value": 1442
},
{
"hc-key": "us-ky-001",
"value": 1443
},
{
"hc-key": "us-ky-217",
"value": 1444
},
{
"hc-key": "us-nc-075",
"value": 1445
},
{
"hc-key": "us-va-071",
"value": 1446
},
{
"hc-key": "us-wv-055",
"value": 1447
},
{
"hc-key": "us-nm-035",
"value": 1448
},
{
"hc-key": "us-ne-049",
"value": 1449
},
{
"hc-key": "us-ne-101",
"value": 1450
},
{
"hc-key": "us-ne-135",
"value": 1451
},
{
"hc-key": "us-ne-117",
"value": 1452
},
{
"hc-key": "us-ks-039",
"value": 1453
},
{
"hc-key": "us-ne-145",
"value": 1454
},
{
"hc-key": "us-ne-149",
"value": 1455
},
{
"hc-key": "us-tn-081",
"value": 1456
},
{
"hc-key": "us-tn-085",
"value": 1457
},
{
"hc-key": "us-il-125",
"value": 1458
},
{
"hc-key": "us-il-107",
"value": 1459
},
{
"hc-key": "us-va-077",
"value": 1460
},
{
"hc-key": "us-va-197",
"value": 1461
},
{
"hc-key": "us-ga-303",
"value": 1462
},
{
"hc-key": "us-wi-035",
"value": 1463
},
{
"hc-key": "us-tn-153",
"value": 1464
},
{
"hc-key": "us-tn-007",
"value": 1465
},
{
"hc-key": "us-tn-065",
"value": 1466
},
{
"hc-key": "us-tx-471",
"value": 1467
},
{
"hc-key": "us-tx-407",
"value": 1468
},
{
"hc-key": "us-tx-291",
"value": 1469
},
{
"hc-key": "us-ks-191",
"value": 1470
},
{
"hc-key": "us-ok-071",
"value": 1471
},
{
"hc-key": "us-mi-127",
"value": 1472
},
{
"hc-key": "us-mn-001",
"value": 1473
},
{
"hc-key": "us-mn-065",
"value": 1474
},
{
"hc-key": "us-mn-115",
"value": 1475
},
{
"hc-key": "us-ca-003",
"value": 1476
},
{
"hc-key": "us-il-105",
"value": 1477
},
{
"hc-key": "us-oh-135",
"value": 1478
},
{
"hc-key": "us-ma-025",
"value": 1479
},
{
"hc-key": "us-ma-017",
"value": 1480
},
{
"hc-key": "us-tx-115",
"value": 1481
},
{
"hc-key": "us-ny-069",
"value": 1482
},
{
"hc-key": "us-ks-121",
"value": 1483
},
{
"hc-key": "us-mo-037",
"value": 1484
},
{
"hc-key": "us-mo-095",
"value": 1485
},
{
"hc-key": "us-ga-153",
"value": 1486
},
{
"hc-key": "us-ga-023",
"value": 1487
},
{
"hc-key": "us-ga-091",
"value": 1488
},
{
"hc-key": "us-ny-023",
"value": 1489
},
{
"hc-key": "us-mi-161",
"value": 1490
},
{
"hc-key": "us-in-113",
"value": 1491
},
{
"hc-key": "us-ga-225",
"value": 1492
},
{
"hc-key": "us-ga-311",
"value": 1493
},
{
"hc-key": "us-ga-163",
"value": 1494
},
{
"hc-key": "us-wi-099",
"value": 1495
},
{
"hc-key": "us-wi-085",
"value": 1496
},
{
"hc-key": "us-wi-067",
"value": 1497
},
{
"hc-key": "us-wi-078",
"value": 1498
},
{
"hc-key": "us-wi-083",
"value": 1499
},
{
"hc-key": "us-wa-063",
"value": 1500
},
{
"hc-key": "us-wa-043",
"value": 1501
},
{
"hc-key": "us-nj-039",
"value": 1502
},
{
"hc-key": "us-nj-017",
"value": 1503
},
{
"hc-key": "us-oh-075",
"value": 1504
},
{
"hc-key": "us-oh-169",
"value": 1505
},
{
"hc-key": "us-oh-151",
"value": 1506
},
{
"hc-key": "us-oh-019",
"value": 1507
},
{
"hc-key": "us-tx-187",
"value": 1508
},
{
"hc-key": "us-md-017",
"value": 1509
},
{
"hc-key": "us-va-033",
"value": 1510
},
{
"hc-key": "us-va-630",
"value": 1511
},
{
"hc-key": "us-va-099",
"value": 1512
},
{
"hc-key": "us-va-193",
"value": 1513
},
{
"hc-key": "us-de-003",
"value": 1514
},
{
"hc-key": "us-pa-029",
"value": 1515
},
{
"hc-key": "us-nj-015",
"value": 1516
},
{
"hc-key": "us-nj-033",
"value": 1517
},
{
"hc-key": "us-nj-011",
"value": 1518
},
{
"hc-key": "us-pa-011",
"value": 1519
},
{
"hc-key": "us-pa-077",
"value": 1520
},
{
"hc-key": "us-pa-095",
"value": 1521
},
{
"hc-key": "us-md-015",
"value": 1522
},
{
"hc-key": "us-md-029",
"value": 1523
},
{
"hc-key": "us-ia-101",
"value": 1524
},
{
"hc-key": "us-ia-177",
"value": 1525
},
{
"hc-key": "us-ne-137",
"value": 1526
},
{
"hc-key": "us-ne-073",
"value": 1527
},
{
"hc-key": "us-ms-087",
"value": 1528
},
{
"hc-key": "us-ms-095",
"value": 1529
},
{
"hc-key": "us-fl-113",
"value": 1530
},
{
"hc-key": "us-tx-439",
"value": 1531
},
{
"hc-key": "us-va-169",
"value": 1532
},
{
"hc-key": "us-ok-085",
"value": 1533
},
{
"hc-key": "us-ga-289",
"value": 1534
},
{
"hc-key": "us-oh-099",
"value": 1535
},
{
"hc-key": "us-tx-381",
"value": 1536
},
{
"hc-key": "us-tx-375",
"value": 1537
},
{
"hc-key": "us-tx-437",
"value": 1538
},
{
"hc-key": "us-mo-151",
"value": 1539
},
{
"hc-key": "us-il-089",
"value": 1540
},
{
"hc-key": "us-il-043",
"value": 1541
},
{
"hc-key": "us-sc-031",
"value": 1542
},
{
"hc-key": "us-sc-055",
"value": 1543
},
{
"hc-key": "us-sc-057",
"value": 1544
},
{
"hc-key": "us-nc-119",
"value": 1545
},
{
"hc-key": "us-nc-139",
"value": 1546
},
{
"hc-key": "us-or-033",
"value": 1547
},
{
"hc-key": "us-pa-089",
"value": 1548
},
{
"hc-key": "us-ar-101",
"value": 1549
},
{
"hc-key": "us-ar-071",
"value": 1550
},
{
"hc-key": "us-ks-135",
"value": 1551
},
{
"hc-key": "us-la-047",
"value": 1552
},
{
"hc-key": "us-la-077",
"value": 1553
},
{
"hc-key": "us-la-121",
"value": 1554
},
{
"hc-key": "us-ne-067",
"value": 1555
},
{
"hc-key": "us-ne-095",
"value": 1556
},
{
"hc-key": "us-al-115",
"value": 1557
},
{
"hc-key": "us-ms-101",
"value": 1558
},
{
"hc-key": "us-ms-099",
"value": 1559
},
{
"hc-key": "us-ms-123",
"value": 1560
},
{
"hc-key": "us-ga-095",
"value": 1561
},
{
"hc-key": "us-id-017",
"value": 1562
},
{
"hc-key": "us-ga-047",
"value": 1563
},
{
"hc-key": "us-md-027",
"value": 1564
},
{
"hc-key": "us-md-021",
"value": 1565
},
{
"hc-key": "us-ut-035",
"value": 1566
},
{
"hc-key": "us-ct-003",
"value": 1567
},
{
"hc-key": "us-ct-009",
"value": 1568
},
{
"hc-key": "us-oh-157",
"value": 1569
},
{
"hc-key": "us-oh-067",
"value": 1570
},
{
"hc-key": "us-oh-081",
"value": 1571
},
{
"hc-key": "us-oh-013",
"value": 1572
},
{
"hc-key": "us-oh-111",
"value": 1573
},
{
"hc-key": "us-oh-059",
"value": 1574
},
{
"hc-key": "us-oh-047",
"value": 1575
},
{
"hc-key": "us-oh-027",
"value": 1576
},
{
"hc-key": "us-oh-071",
"value": 1577
},
{
"hc-key": "us-mn-071",
"value": 1578
},
{
"hc-key": "us-id-077",
"value": 1579
},
{
"hc-key": "us-id-011",
"value": 1580
},
{
"hc-key": "us-id-029",
"value": 1581
},
{
"hc-key": "us-wi-121",
"value": 1582
},
{
"hc-key": "us-sd-117",
"value": 1583
},
{
"hc-key": "us-sd-071",
"value": 1584
},
{
"hc-key": "us-va-036",
"value": 1585
},
{
"hc-key": "us-va-149",
"value": 1586
},
{
"hc-key": "us-va-041",
"value": 1587
},
{
"hc-key": "us-al-023",
"value": 1588
},
{
"hc-key": "us-al-129",
"value": 1589
},
{
"hc-key": "us-in-055",
"value": 1590
},
{
"hc-key": "us-ne-047",
"value": 1591
},
{
"hc-key": "us-ne-111",
"value": 1592
},
{
"hc-key": "us-nd-105",
"value": 1593
},
{
"hc-key": "us-nd-017",
"value": 1594
},
{
"hc-key": "us-il-151",
"value": 1595
},
{
"hc-key": "us-il-069",
"value": 1596
},
{
"hc-key": "us-ne-005",
"value": 1597
},
{
"hc-key": "us-tx-163",
"value": 1598
},
{
"hc-key": "us-ia-103",
"value": 1599
},
{
"hc-key": "us-ks-001",
"value": 1600
},
{
"hc-key": "us-ks-133",
"value": 1601
},
{
"hc-key": "us-ky-089",
"value": 1602
},
{
"hc-key": "us-ne-087",
"value": 1603
},
{
"hc-key": "us-ne-085",
"value": 1604
},
{
"hc-key": "us-ne-063",
"value": 1605
},
{
"hc-key": "us-ne-057",
"value": 1606
},
{
"hc-key": "us-co-115",
"value": 1607
},
{
"hc-key": "us-co-095",
"value": 1608
},
{
"hc-key": "us-ky-101",
"value": 1609
},
{
"hc-key": "us-ms-105",
"value": 1610
},
{
"hc-key": "us-md-023",
"value": 1611
},
{
"hc-key": "us-mi-059",
"value": 1612
},
{
"hc-key": "us-oh-171",
"value": 1613
},
{
"hc-key": "us-oh-051",
"value": 1614
},
{
"hc-key": "us-ky-177",
"value": 1615
},
{
"hc-key": "us-ky-149",
"value": 1616
},
{
"hc-key": "us-ky-141",
"value": 1617
},
{
"hc-key": "us-nh-015",
"value": 1618
},
{
"hc-key": "us-nh-017",
"value": 1619
},
{
"hc-key": "us-pa-133",
"value": 1620
},
{
"hc-key": "us-ne-097",
"value": 1621
},
{
"hc-key": "us-sd-075",
"value": 1622
},
{
"hc-key": "us-nd-007",
"value": 1623
},
{
"hc-key": "us-ne-003",
"value": 1624
},
{
"hc-key": "us-mo-073",
"value": 1625
},
{
"hc-key": "us-ky-061",
"value": 1626
},
{
"hc-key": "us-ky-031",
"value": 1627
},
{
"hc-key": "us-ga-211",
"value": 1628
},
{
"hc-key": "us-ms-033",
"value": 1629
},
{
"hc-key": "us-ms-137",
"value": 1630
},
{
"hc-key": "us-ar-107",
"value": 1631
},
{
"hc-key": "us-al-117",
"value": 1632
},
{
"hc-key": "us-ok-149",
"value": 1633
},
{
"hc-key": "us-nc-135",
"value": 1634
},
{
"hc-key": "us-in-103",
"value": 1635
},
{
"hc-key": "us-in-017",
"value": 1636
},
{
"hc-key": "us-in-181",
"value": 1637
},
{
"hc-key": "us-wi-061",
"value": 1638
},
{
"hc-key": "us-ny-029",
"value": 1639
},
{
"hc-key": "us-ny-063",
"value": 1640
},
{
"hc-key": "us-ny-009",
"value": 1641
},
{
"hc-key": "us-md-031",
"value": 1642
},
{
"hc-key": "us-va-610",
"value": 1643
},
{
"hc-key": "us-va-035",
"value": 1644
},
{
"hc-key": "us-il-083",
"value": 1645
},
{
"hc-key": "us-mo-183",
"value": 1646
},
{
"hc-key": "us-mo-071",
"value": 1647
},
{
"hc-key": "us-ks-013",
"value": 1648
},
{
"hc-key": "us-ga-029",
"value": 1649
},
{
"hc-key": "us-ga-031",
"value": 1650
},
{
"hc-key": "us-ga-109",
"value": 1651
},
{
"hc-key": "us-ky-119",
"value": 1652
},
{
"hc-key": "us-ky-071",
"value": 1653
},
{
"hc-key": "us-ky-159",
"value": 1654
},
{
"hc-key": "us-ga-309",
"value": 1655
},
{
"hc-key": "us-nc-107",
"value": 1656
},
{
"hc-key": "us-tx-483",
"value": 1657
},
{
"hc-key": "us-tx-211",
"value": 1658
},
{
"hc-key": "us-tx-393",
"value": 1659
},
{
"hc-key": "us-tx-295",
"value": 1660
},
{
"hc-key": "us-ok-007",
"value": 1661
},
{
"hc-key": "us-ks-175",
"value": 1662
},
{
"hc-key": "us-or-009",
"value": 1663
},
{
"hc-key": "us-sc-041",
"value": 1664
},
{
"hc-key": "us-ut-053",
"value": 1665
},
{
"hc-key": "us-ut-021",
"value": 1666
},
{
"hc-key": "us-ut-025",
"value": 1667
},
{
"hc-key": "us-wy-033",
"value": 1668
},
{
"hc-key": "us-wy-003",
"value": 1669
},
{
"hc-key": "us-mt-003",
"value": 1670
},
{
"hc-key": "us-pa-047",
"value": 1671
},
{
"hc-key": "us-pa-083",
"value": 1672
},
{
"hc-key": "us-ms-031",
"value": 1673
},
{
"hc-key": "us-in-013",
"value": 1674
},
{
"hc-key": "us-ky-065",
"value": 1675
},
{
"hc-key": "us-tx-087",
"value": 1676
},
{
"hc-key": "us-tx-089",
"value": 1677
},
{
"hc-key": "us-il-063",
"value": 1678
},
{
"hc-key": "us-mn-073",
"value": 1679
},
{
"hc-key": "us-sd-051",
"value": 1680
},
{
"hc-key": "us-sd-039",
"value": 1681
},
{
"hc-key": "us-mn-081",
"value": 1682
},
{
"hc-key": "us-mn-083",
"value": 1683
},
{
"hc-key": "us-ga-043",
"value": 1684
},
{
"hc-key": "us-tx-497",
"value": 1685
},
{
"hc-key": "us-ga-307",
"value": 1686
},
{
"hc-key": "us-ga-159",
"value": 1687
},
{
"hc-key": "us-ga-169",
"value": 1688
},
{
"hc-key": "us-ga-009",
"value": 1689
},
{
"hc-key": "us-ga-021",
"value": 1690
},
{
"hc-key": "us-ny-079",
"value": 1691
},
{
"hc-key": "us-va-199",
"value": 1692
},
{
"hc-key": "us-va-735",
"value": 1693
},
{
"hc-key": "us-va-700",
"value": 1694
},
{
"hc-key": "us-ok-065",
"value": 1695
},
{
"hc-key": "us-tx-173",
"value": 1696
},
{
"hc-key": "us-tx-431",
"value": 1697
},
{
"hc-key": "us-tx-335",
"value": 1698
},
{
"hc-key": "us-tx-415",
"value": 1699
},
{
"hc-key": "us-tx-383",
"value": 1700
},
{
"hc-key": "us-ok-093",
"value": 1701
},
{
"hc-key": "us-nd-055",
"value": 1702
},
{
"hc-key": "us-or-027",
"value": 1703
},
{
"hc-key": "us-ia-081",
"value": 1704
},
{
"hc-key": "us-ia-197",
"value": 1705
},
{
"hc-key": "us-tx-419",
"value": 1706
},
{
"hc-key": "us-tx-403",
"value": 1707
},
{
"hc-key": "us-mo-055",
"value": 1708
},
{
"hc-key": "us-va-091",
"value": 1709
},
{
"hc-key": "us-wv-075",
"value": 1710
},
{
"hc-key": "us-va-017",
"value": 1711
},
{
"hc-key": "us-mn-111",
"value": 1712
},
{
"hc-key": "us-ms-017",
"value": 1713
},
{
"hc-key": "us-ms-081",
"value": 1714
},
{
"hc-key": "us-la-067",
"value": 1715
},
{
"hc-key": "us-al-047",
"value": 1716
},
{
"hc-key": "us-al-001",
"value": 1717
},
{
"hc-key": "us-tx-093",
"value": 1718
},
{
"hc-key": "us-tx-425",
"value": 1719
},
{
"hc-key": "us-mn-153",
"value": 1720
},
{
"hc-key": "us-mn-021",
"value": 1721
},
{
"hc-key": "us-co-079",
"value": 1722
},
{
"hc-key": "us-nm-039",
"value": 1723
},
{
"hc-key": "us-ms-163",
"value": 1724
},
{
"hc-key": "us-mo-177",
"value": 1725
},
{
"hc-key": "us-oh-041",
"value": 1726
},
{
"hc-key": "us-oh-117",
"value": 1727
},
{
"hc-key": "us-nd-031",
"value": 1728
},
{
"hc-key": "us-ar-033",
"value": 1729
},
{
"hc-key": "us-ok-001",
"value": 1730
},
{
"hc-key": "us-ok-041",
"value": 1731
},
{
"hc-key": "us-tx-053",
"value": 1732
},
{
"hc-key": "us-tx-411",
"value": 1733
},
{
"hc-key": "us-tx-299",
"value": 1734
},
{
"hc-key": "us-il-109",
"value": 1735
},
{
"hc-key": "us-il-187",
"value": 1736
},
{
"hc-key": "us-il-071",
"value": 1737
},
{
"hc-key": "us-ar-067",
"value": 1738
},
{
"hc-key": "us-ar-037",
"value": 1739
},
{
"hc-key": "us-tx-067",
"value": 1740
},
{
"hc-key": "us-tx-315",
"value": 1741
},
{
"hc-key": "us-ky-083",
"value": 1742
},
{
"hc-key": "us-tn-079",
"value": 1743
},
{
"hc-key": "us-tn-005",
"value": 1744
},
{
"hc-key": "us-nc-087",
"value": 1745
},
{
"hc-key": "us-nc-115",
"value": 1746
},
{
"hc-key": "us-mn-037",
"value": 1747
},
{
"hc-key": "us-or-025",
"value": 1748
},
{
"hc-key": "us-or-013",
"value": 1749
},
{
"hc-key": "us-nv-013",
"value": 1750
},
{
"hc-key": "us-wi-001",
"value": 1751
},
{
"hc-key": "us-wi-077",
"value": 1752
},
{
"hc-key": "us-mo-045",
"value": 1753
},
{
"hc-key": "us-mo-103",
"value": 1754
},
{
"hc-key": "us-mo-001",
"value": 1755
},
{
"hc-key": "us-mo-199",
"value": 1756
},
{
"hc-key": "us-ky-015",
"value": 1757
},
{
"hc-key": "us-ky-079",
"value": 1758
},
{
"hc-key": "us-ky-021",
"value": 1759
},
{
"hc-key": "us-ky-229",
"value": 1760
},
{
"hc-key": "us-la-115",
"value": 1761
},
{
"hc-key": "us-la-009",
"value": 1762
},
{
"hc-key": "us-la-059",
"value": 1763
},
{
"hc-key": "us-mo-227",
"value": 1764
},
{
"hc-key": "us-ne-163",
"value": 1765
},
{
"hc-key": "us-sd-021",
"value": 1766
},
{
"hc-key": "us-sd-063",
"value": 1767
},
{
"hc-key": "us-mi-057",
"value": 1768
},
{
"hc-key": "us-ia-001",
"value": 1769
},
{
"hc-key": "us-ia-175",
"value": 1770
},
{
"hc-key": "us-ne-017",
"value": 1771
},
{
"hc-key": "us-ne-171",
"value": 1772
},
{
"hc-key": "us-ne-113",
"value": 1773
},
{
"hc-key": "us-ne-121",
"value": 1774
},
{
"hc-key": "us-ky-039",
"value": 1775
},
{
"hc-key": "us-in-021",
"value": 1776
},
{
"hc-key": "us-in-109",
"value": 1777
},
{
"hc-key": "us-tx-139",
"value": 1778
},
{
"hc-key": "us-tx-213",
"value": 1779
},
{
"hc-key": "us-in-053",
"value": 1780
},
{
"hc-key": "us-fl-035",
"value": 1781
},
{
"hc-key": "us-ms-077",
"value": 1782
},
{
"hc-key": "us-la-127",
"value": 1783
},
{
"hc-key": "us-il-131",
"value": 1784
},
{
"hc-key": "us-il-175",
"value": 1785
},
{
"hc-key": "us-sd-029",
"value": 1786
},
{
"hc-key": "us-ga-259",
"value": 1787
},
{
"hc-key": "us-ar-121",
"value": 1788
},
{
"hc-key": "us-ar-021",
"value": 1789
},
{
"hc-key": "us-ar-045",
"value": 1790
},
{
"hc-key": "us-ia-107",
"value": 1791
},
{
"hc-key": "us-il-061",
"value": 1792
},
{
"hc-key": "us-il-171",
"value": 1793
},
{
"hc-key": "us-ca-105",
"value": 1794
},
{
"hc-key": "us-ca-023",
"value": 1795
},
{
"hc-key": "us-mn-025",
"value": 1796
},
{
"hc-key": "us-mn-003",
"value": 1797
},
{
"hc-key": "us-sd-009",
"value": 1798
},
{
"hc-key": "us-sd-135",
"value": 1799
},
{
"hc-key": "us-tn-059",
"value": 1800
},
{
"hc-key": "us-va-183",
"value": 1801
},
{
"hc-key": "us-in-141",
"value": 1802
},
{
"hc-key": "us-ga-119",
"value": 1803
},
{
"hc-key": "us-ga-257",
"value": 1804
},
{
"hc-key": "us-ar-005",
"value": 1805
},
{
"hc-key": "us-ms-007",
"value": 1806
},
{
"hc-key": "us-ks-011",
"value": 1807
},
{
"hc-key": "us-va-049",
"value": 1808
},
{
"hc-key": "us-va-147",
"value": 1809
},
{
"hc-key": "us-va-145",
"value": 1810
},
{
"hc-key": "us-sc-085",
"value": 1811
},
{
"hc-key": "us-wv-045",
"value": 1812
},
{
"hc-key": "us-wv-109",
"value": 1813
},
{
"hc-key": "us-wv-005",
"value": 1814
},
{
"hc-key": "us-ca-029",
"value": 1815
},
{
"hc-key": "us-tx-097",
"value": 1816
},
{
"hc-key": "us-sc-075",
"value": 1817
},
{
"hc-key": "us-ia-131",
"value": 1818
},
{
"hc-key": "us-mn-101",
"value": 1819
},
{
"hc-key": "us-mn-117",
"value": 1820
},
{
"hc-key": "us-ri-007",
"value": 1821
},
{
"hc-key": "us-mo-161",
"value": 1822
},
{
"hc-key": "us-ms-117",
"value": 1823
},
{
"hc-key": "us-ky-121",
"value": 1824
},
{
"hc-key": "us-ky-235",
"value": 1825
},
{
"hc-key": "us-ky-013",
"value": 1826
},
{
"hc-key": "us-tx-491",
"value": 1827
},
{
"hc-key": "us-ga-107",
"value": 1828
},
{
"hc-key": "us-la-025",
"value": 1829
},
{
"hc-key": "us-pa-025",
"value": 1830
},
{
"hc-key": "us-ne-133",
"value": 1831
},
{
"hc-key": "us-tn-171",
"value": 1832
},
{
"hc-key": "us-sc-083",
"value": 1833
},
{
"hc-key": "us-sc-021",
"value": 1834
},
{
"hc-key": "us-nc-161",
"value": 1835
},
{
"hc-key": "us-wi-005",
"value": 1836
},
{
"hc-key": "us-wi-073",
"value": 1837
},
{
"hc-key": "us-wv-101",
"value": 1838
},
{
"hc-key": "us-wv-007",
"value": 1839
},
{
"hc-key": "us-wv-015",
"value": 1840
},
{
"hc-key": "us-wv-067",
"value": 1841
},
{
"hc-key": "us-mo-085",
"value": 1842
},
{
"hc-key": "us-mo-009",
"value": 1843
},
{
"hc-key": "us-mn-123",
"value": 1844
},
{
"hc-key": "us-ar-081",
"value": 1845
},
{
"hc-key": "us-nv-019",
"value": 1846
},
{
"hc-key": "us-ms-085",
"value": 1847
},
{
"hc-key": "us-ms-005",
"value": 1848
},
{
"hc-key": "us-ms-113",
"value": 1849
},
{
"hc-key": "us-ms-147",
"value": 1850
},
{
"hc-key": "us-la-105",
"value": 1851
},
{
"hc-key": "us-id-085",
"value": 1852
},
{
"hc-key": "us-id-059",
"value": 1853
},
{
"hc-key": "us-ky-091",
"value": 1854
},
{
"hc-key": "us-ky-183",
"value": 1855
},
{
"hc-key": "us-ia-137",
"value": 1856
},
{
"hc-key": "us-ia-129",
"value": 1857
},
{
"hc-key": "us-ne-153",
"value": 1858
},
{
"hc-key": "us-ne-025",
"value": 1859
},
{
"hc-key": "us-ne-055",
"value": 1860
},
{
"hc-key": "us-ga-071",
"value": 1861
},
{
"hc-key": "us-il-157",
"value": 1862
},
{
"hc-key": "us-mo-157",
"value": 1863
},
{
"hc-key": "us-va-173",
"value": 1864
},
{
"hc-key": "us-nm-011",
"value": 1865
},
{
"hc-key": "us-nm-041",
"value": 1866
},
{
"hc-key": "us-nm-027",
"value": 1867
},
{
"hc-key": "us-pa-111",
"value": 1868
},
{
"hc-key": "us-oh-101",
"value": 1869
},
{
"hc-key": "us-il-149",
"value": 1870
},
{
"hc-key": "us-al-107",
"value": 1871
},
{
"hc-key": "us-il-145",
"value": 1872
},
{
"hc-key": "us-ia-075",
"value": 1873
},
{
"hc-key": "us-co-107",
"value": 1874
},
{
"hc-key": "us-co-049",
"value": 1875
},
{
"hc-key": "us-co-019",
"value": 1876
},
{
"hc-key": "us-co-103",
"value": 1877
},
{
"hc-key": "us-nj-035",
"value": 1878
},
{
"hc-key": "us-nj-023",
"value": 1879
},
{
"hc-key": "us-il-087",
"value": 1880
},
{
"hc-key": "us-il-127",
"value": 1881
},
{
"hc-key": "us-co-053",
"value": 1882
},
{
"hc-key": "us-co-091",
"value": 1883
},
{
"hc-key": "us-mn-059",
"value": 1884
},
{
"hc-key": "us-pa-049",
"value": 1885
},
{
"hc-key": "us-ms-029",
"value": 1886
},
{
"hc-key": "us-ky-161",
"value": 1887
},
{
"hc-key": "us-mn-095",
"value": 1888
},
{
"hc-key": "us-tx-179",
"value": 1889
},
{
"hc-key": "us-tx-129",
"value": 1890
},
{
"hc-key": "us-fl-013",
"value": 1891
},
{
"hc-key": "us-fl-005",
"value": 1892
},
{
"hc-key": "us-tn-181",
"value": 1893
},
{
"hc-key": "us-al-077",
"value": 1894
},
{
"hc-key": "us-al-083",
"value": 1895
},
{
"hc-key": "us-in-045",
"value": 1896
},
{
"hc-key": "us-oh-115",
"value": 1897
},
{
"hc-key": "us-oh-127",
"value": 1898
},
{
"hc-key": "us-va-590",
"value": 1899
},
{
"hc-key": "us-ga-011",
"value": 1900
},
{
"hc-key": "us-ga-229",
"value": 1901
},
{
"hc-key": "us-ga-305",
"value": 1902
},
{
"hc-key": "us-ok-109",
"value": 1903
},
{
"hc-key": "us-ok-069",
"value": 1904
},
{
"hc-key": "us-ok-005",
"value": 1905
},
{
"hc-key": "us-ut-043",
"value": 1906
},
{
"hc-key": "us-ut-013",
"value": 1907
},
{
"hc-key": "us-nv-027",
"value": 1908
},
{
"hc-key": "us-ky-023",
"value": 1909
},
{
"hc-key": "us-ky-201",
"value": 1910
},
{
"hc-key": "us-wi-037",
"value": 1911
},
{
"hc-key": "us-mn-159",
"value": 1912
},
{
"hc-key": "us-ky-043",
"value": 1913
},
{
"hc-key": "us-nc-097",
"value": 1914
},
{
"hc-key": "us-nc-159",
"value": 1915
},
{
"hc-key": "us-nc-025",
"value": 1916
},
{
"hc-key": "us-nc-167",
"value": 1917
},
{
"hc-key": "us-va-083",
"value": 1918
},
{
"hc-key": "us-nc-091",
"value": 1919
},
{
"hc-key": "us-or-021",
"value": 1920
},
{
"hc-key": "us-ar-009",
"value": 1921
},
{
"hc-key": "us-tx-433",
"value": 1922
},
{
"hc-key": "us-tx-253",
"value": 1923
},
{
"hc-key": "us-tx-083",
"value": 1924
},
{
"hc-key": "us-tx-185",
"value": 1925
},
{
"hc-key": "us-mi-157",
"value": 1926
},
{
"hc-key": "us-mi-049",
"value": 1927
},
{
"hc-key": "us-la-007",
"value": 1928
},
{
"hc-key": "us-la-093",
"value": 1929
},
{
"hc-key": "us-la-005",
"value": 1930
},
{
"hc-key": "us-ms-013",
"value": 1931
},
{
"hc-key": "us-mt-055",
"value": 1932
},
{
"hc-key": "us-mt-033",
"value": 1933
},
{
"hc-key": "us-mt-017",
"value": 1934
},
{
"hc-key": "us-il-141",
"value": 1935
},
{
"hc-key": "us-nd-077",
"value": 1936
},
{
"hc-key": "us-sd-109",
"value": 1937
},
{
"hc-key": "us-wi-095",
"value": 1938
},
{
"hc-key": "us-ca-015",
"value": 1939
},
{
"hc-key": "us-ok-127",
"value": 1940
},
{
"hc-key": "us-wa-061",
"value": 1941
},
{
"hc-key": "us-ny-105",
"value": 1942
},
{
"hc-key": "us-nc-149",
"value": 1943
},
{
"hc-key": "us-nc-163",
"value": 1944
},
{
"hc-key": "us-nc-085",
"value": 1945
},
{
"hc-key": "us-nc-105",
"value": 1946
},
{
"hc-key": "us-in-159",
"value": 1947
},
{
"hc-key": "us-in-067",
"value": 1948
},
{
"hc-key": "us-ks-027",
"value": 1949
},
{
"hc-key": "us-ok-145",
"value": 1950
},
{
"hc-key": "us-ok-097",
"value": 1951
},
{
"hc-key": "us-ar-003",
"value": 1952
},
{
"hc-key": "us-ar-043",
"value": 1953
},
{
"hc-key": "us-ar-041",
"value": 1954
},
{
"hc-key": "us-ar-079",
"value": 1955
},
{
"hc-key": "us-tn-135",
"value": 1956
},
{
"hc-key": "us-mn-163",
"value": 1957
},
{
"hc-key": "us-va-740",
"value": 1958
},
{
"hc-key": "us-tx-235",
"value": 1959
},
{
"hc-key": "us-mo-025",
"value": 1960
},
{
"hc-key": "us-mo-049",
"value": 1961
},
{
"hc-key": "us-fl-007",
"value": 1962
},
{
"hc-key": "us-fl-107",
"value": 1963
},
{
"hc-key": "us-fl-083",
"value": 1964
},
{
"hc-key": "us-ky-163",
"value": 1965
},
{
"hc-key": "us-ne-161",
"value": 1966
},
{
"hc-key": "us-ne-075",
"value": 1967
},
{
"hc-key": "us-id-071",
"value": 1968
},
{
"hc-key": "us-id-035",
"value": 1969
},
{
"hc-key": "us-mn-035",
"value": 1970
},
{
"hc-key": "us-az-021",
"value": 1971
},
{
"hc-key": "us-az-009",
"value": 1972
},
{
"hc-key": "us-ar-123",
"value": 1973
},
{
"hc-key": "us-ks-183",
"value": 1974
},
{
"hc-key": "us-fl-065",
"value": 1975
},
{
"hc-key": "us-ms-037",
"value": 1976
},
{
"hc-key": "us-la-037",
"value": 1977
},
{
"hc-key": "us-la-091",
"value": 1978
},
{
"hc-key": "us-ar-097",
"value": 1979
},
{
"hc-key": "us-mi-025",
"value": 1980
},
{
"hc-key": "us-mi-077",
"value": 1981
},
{
"hc-key": "us-mi-015",
"value": 1982
},
{
"hc-key": "us-al-029",
"value": 1983
},
{
"hc-key": "us-ca-089",
"value": 1984
},
{
"hc-key": "us-ia-153",
"value": 1985
},
{
"hc-key": "us-ia-049",
"value": 1986
},
{
"hc-key": "us-ga-183",
"value": 1987
},
{
"hc-key": "us-tn-187",
"value": 1988
},
{
"hc-key": "us-wa-003",
"value": 1989
},
{
"hc-key": "us-wa-023",
"value": 1990
},
{
"hc-key": "us-mn-155",
"value": 1991
},
{
"hc-key": "us-mn-167",
"value": 1992
},
{
"hc-key": "us-mn-051",
"value": 1993
},
{
"hc-key": "us-il-017",
"value": 1994
},
{
"hc-key": "us-ga-247",
"value": 1995
},
{
"hc-key": "us-ok-049",
"value": 1996
},
{
"hc-key": "us-la-031",
"value": 1997
},
{
"hc-key": "us-ca-019",
"value": 1998
},
{
"hc-key": "us-ga-147",
"value": 1999
},
{
"hc-key": "us-ga-105",
"value": 2000
},
{
"hc-key": "us-al-005",
"value": 2001
},
{
"hc-key": "us-al-109",
"value": 2002
},
{
"hc-key": "us-al-011",
"value": 2003
},
{
"hc-key": "us-nc-017",
"value": 2004
},
{
"hc-key": "us-tn-035",
"value": 2005
},
{
"hc-key": "us-tn-129",
"value": 2006
},
{
"hc-key": "us-mi-137",
"value": 2007
},
{
"hc-key": "us-ia-161",
"value": 2008
},
{
"hc-key": "us-ut-041",
"value": 2009
},
{
"hc-key": "us-ut-015",
"value": 2010
},
{
"hc-key": "us-mt-083",
"value": 2011
},
{
"hc-key": "us-mt-109",
"value": 2012
},
{
"hc-key": "us-nm-053",
"value": 2013
},
{
"hc-key": "us-ok-021",
"value": 2014
},
{
"hc-key": "us-mn-173",
"value": 2015
},
{
"hc-key": "us-tx-231",
"value": 2016
},
{
"hc-key": "us-tx-223",
"value": 2017
},
{
"hc-key": "us-tx-467",
"value": 2018
},
{
"hc-key": "us-tx-353",
"value": 2019
},
{
"hc-key": "us-tx-499",
"value": 2020
},
{
"hc-key": "us-ks-019",
"value": 2021
},
{
"hc-key": "us-nc-039",
"value": 2022
},
{
"hc-key": "us-ga-291",
"value": 2023
},
{
"hc-key": "us-ga-111",
"value": 2024
},
{
"hc-key": "us-ky-195",
"value": 2025
},
{
"hc-key": "us-fl-041",
"value": 2026
},
{
"hc-key": "us-nc-035",
"value": 2027
},
{
"hc-key": "us-ky-025",
"value": 2028
},
{
"hc-key": "us-mo-181",
"value": 2029
},
{
"hc-key": "us-il-179",
"value": 2030
},
{
"hc-key": "us-tx-109",
"value": 2031
},
{
"hc-key": "us-ar-135",
"value": 2032
},
{
"hc-key": "us-nc-177",
"value": 2033
},
{
"hc-key": "us-mn-131",
"value": 2034
},
{
"hc-key": "us-mn-161",
"value": 2035
},
{
"hc-key": "us-mn-139",
"value": 2036
},
{
"hc-key": "us-mn-019",
"value": 2037
},
{
"hc-key": "us-mo-219",
"value": 2038
},
{
"hc-key": "us-ky-227",
"value": 2039
},
{
"hc-key": "us-la-017",
"value": 2040
},
{
"hc-key": "us-ia-127",
"value": 2041
},
{
"hc-key": "us-ia-083",
"value": 2042
},
{
"hc-key": "us-ia-169",
"value": 2043
},
{
"hc-key": "us-ok-141",
"value": 2044
},
{
"hc-key": "us-ok-031",
"value": 2045
},
{
"hc-key": "us-nc-113",
"value": 2046
},
{
"hc-key": "us-wv-063",
"value": 2047
},
{
"hc-key": "us-in-155",
"value": 2048
},
{
"hc-key": "us-al-061",
"value": 2049
},
{
"hc-key": "us-il-155",
"value": 2050
},
{
"hc-key": "us-il-099",
"value": 2051
},
{
"hc-key": "us-ia-055",
"value": 2052
},
{
"hc-key": "us-ia-105",
"value": 2053
},
{
"hc-key": "us-ks-127",
"value": 2054
},
{
"hc-key": "us-id-015",
"value": 2055
},
{
"hc-key": "us-nc-143",
"value": 2056
},
{
"hc-key": "us-ga-101",
"value": 2057
},
{
"hc-key": "us-fl-047",
"value": 2058
},
{
"hc-key": "us-ms-045",
"value": 2059
},
{
"hc-key": "us-ga-315",
"value": 2060
},
{
"hc-key": "us-la-081",
"value": 2061
},
{
"hc-key": "us-tn-093",
"value": 2062
},
{
"hc-key": "us-tn-089",
"value": 2063
},
{
"hc-key": "us-ks-209",
"value": 2064
},
{
"hc-key": "us-ga-281",
"value": 2065
},
{
"hc-key": "us-ms-129",
"value": 2066
},
{
"hc-key": "us-ms-061",
"value": 2067
},
{
"hc-key": "us-id-075",
"value": 2068
},
{
"hc-key": "us-id-079",
"value": 2069
},
{
"hc-key": "us-ia-067",
"value": 2070
},
{
"hc-key": "us-ky-145",
"value": 2071
},
{
"hc-key": "us-ky-225",
"value": 2072
},
{
"hc-key": "us-ky-055",
"value": 2073
},
{
"hc-key": "us-sd-125",
"value": 2074
},
{
"hc-key": "us-tn-029",
"value": 2075
},
{
"hc-key": "us-tn-067",
"value": 2076
},
{
"hc-key": "us-sc-089",
"value": 2077
},
{
"hc-key": "us-sc-067",
"value": 2078
},
{
"hc-key": "us-la-117",
"value": 2079
},
{
"hc-key": "us-mo-207",
"value": 2080
},
{
"hc-key": "us-ga-093",
"value": 2081
},
{
"hc-key": "us-mn-145",
"value": 2082
},
{
"hc-key": "us-mn-009",
"value": 2083
},
{
"hc-key": "us-ne-155",
"value": 2084
},
{
"hc-key": "us-mn-141",
"value": 2085
},
{
"hc-key": "us-tn-025",
"value": 2086
},
{
"hc-key": "us-tx-337",
"value": 2087
},
{
"hc-key": "us-tx-049",
"value": 2088
},
{
"hc-key": "us-tx-333",
"value": 2089
},
{
"hc-key": "us-wi-101",
"value": 2090
},
{
"hc-key": "us-wi-059",
"value": 2091
},
{
"hc-key": "us-wi-009",
"value": 2092
},
{
"hc-key": "us-ok-103",
"value": 2093
},
{
"hc-key": "us-ok-083",
"value": 2094
},
{
"hc-key": "us-ok-121",
"value": 2095
},
{
"hc-key": "us-wv-017",
"value": 2096
},
{
"hc-key": "us-wv-087",
"value": 2097
},
{
"hc-key": "us-wv-105",
"value": 2098
},
{
"hc-key": "us-me-017",
"value": 2099
},
{
"hc-key": "us-nh-003",
"value": 2100
},
{
"hc-key": "us-wv-095",
"value": 2101
},
{
"hc-key": "us-mn-079",
"value": 2102
},
{
"hc-key": "us-wa-017",
"value": 2103
},
{
"hc-key": "us-wi-133",
"value": 2104
},
{
"hc-key": "us-ks-151",
"value": 2105
},
{
"hc-key": "us-al-045",
"value": 2106
},
{
"hc-key": "us-al-069",
"value": 2107
},
{
"hc-key": "us-al-067",
"value": 2108
},
{
"hc-key": "us-ca-109",
"value": 2109
},
{
"hc-key": "us-ca-039",
"value": 2110
},
{
"hc-key": "us-mo-075",
"value": 2111
},
{
"hc-key": "us-ne-009",
"value": 2112
},
{
"hc-key": "us-ut-009",
"value": 2113
},
{
"hc-key": "us-nc-071",
"value": 2114
},
{
"hc-key": "us-nm-019",
"value": 2115
},
{
"hc-key": "us-mt-027",
"value": 2116
},
{
"hc-key": "us-mt-037",
"value": 2117
},
{
"hc-key": "us-nc-195",
"value": 2118
},
{
"hc-key": "us-nc-101",
"value": 2119
},
{
"hc-key": "us-ca-085",
"value": 2120
},
{
"hc-key": "us-il-183",
"value": 2121
},
{
"hc-key": "us-mo-189",
"value": 2122
},
{
"hc-key": "us-ca-103",
"value": 2123
},
{
"hc-key": "us-ca-021",
"value": 2124
},
{
"hc-key": "us-tx-151",
"value": 2125
},
{
"hc-key": "us-la-085",
"value": 2126
},
{
"hc-key": "us-ga-235",
"value": 2127
},
{
"hc-key": "us-nc-015",
"value": 2128
},
{
"hc-key": "us-tn-143",
"value": 2129
},
{
"hc-key": "us-nc-079",
"value": 2130
},
{
"hc-key": "us-ky-131",
"value": 2131
},
{
"hc-key": "us-il-123",
"value": 2132
},
{
"hc-key": "us-tx-081",
"value": 2133
},
{
"hc-key": "us-tn-133",
"value": 2134
},
{
"hc-key": "us-mi-063",
"value": 2135
},
{
"hc-key": "us-mi-129",
"value": 2136
},
{
"hc-key": "us-mi-069",
"value": 2137
},
{
"hc-key": "us-ga-069",
"value": 2138
},
{
"hc-key": "us-ga-299",
"value": 2139
},
{
"hc-key": "us-nd-037",
"value": 2140
},
{
"hc-key": "us-la-103",
"value": 2141
},
{
"hc-key": "us-oh-057",
"value": 2142
},
{
"hc-key": "us-mn-137",
"value": 2143
},
{
"hc-key": "us-oh-043",
"value": 2144
},
{
"hc-key": "us-oh-093",
"value": 2145
},
{
"hc-key": "us-ia-015",
"value": 2146
},
{
"hc-key": "us-tx-373",
"value": 2147
},
{
"hc-key": "us-sd-027",
"value": 2148
},
{
"hc-key": "us-ne-051",
"value": 2149
},
{
"hc-key": "us-ne-043",
"value": 2150
},
{
"hc-key": "us-sd-127",
"value": 2151
},
{
"hc-key": "us-sc-037",
"value": 2152
},
{
"hc-key": "us-va-133",
"value": 2153
},
{
"hc-key": "us-wi-015",
"value": 2154
},
{
"hc-key": "us-mi-067",
"value": 2155
},
{
"hc-key": "us-tn-095",
"value": 2156
},
{
"hc-key": "us-tn-131",
"value": 2157
},
{
"hc-key": "us-ky-105",
"value": 2158
},
{
"hc-key": "us-ky-035",
"value": 2159
},
{
"hc-key": "us-va-015",
"value": 2160
},
{
"hc-key": "us-va-003",
"value": 2161
},
{
"hc-key": "us-va-029",
"value": 2162
},
{
"hc-key": "us-tn-147",
"value": 2163
},
{
"hc-key": "us-va-043",
"value": 2164
},
{
"hc-key": "us-ky-109",
"value": 2165
},
{
"hc-key": "us-sc-073",
"value": 2166
},
{
"hc-key": "us-la-033",
"value": 2167
},
{
"hc-key": "us-mi-081",
"value": 2168
},
{
"hc-key": "us-nc-147",
"value": 2169
},
{
"hc-key": "us-mt-009",
"value": 2170
},
{
"hc-key": "us-mt-111",
"value": 2171
},
{
"hc-key": "us-ne-039",
"value": 2172
},
{
"hc-key": "us-ga-001",
"value": 2173
},
{
"hc-key": "us-ia-099",
"value": 2174
},
{
"hc-key": "us-ms-153",
"value": 2175
},
{
"hc-key": "us-ms-023",
"value": 2176
},
{
"hc-key": "us-tx-155",
"value": 2177
},
{
"hc-key": "us-tx-275",
"value": 2178
},
{
"hc-key": "us-fl-105",
"value": 2179
},
{
"hc-key": "us-fl-097",
"value": 2180
},
{
"hc-key": "us-al-087",
"value": 2181
},
{
"hc-key": "us-al-123",
"value": 2182
},
{
"hc-key": "us-or-003",
"value": 2183
},
{
"hc-key": "us-or-043",
"value": 2184
},
{
"hc-key": "us-or-017",
"value": 2185
},
{
"hc-key": "us-ia-155",
"value": 2186
},
{
"hc-key": "us-ia-145",
"value": 2187
},
{
"hc-key": "us-mo-229",
"value": 2188
},
{
"hc-key": "us-ny-107",
"value": 2189
},
{
"hc-key": "us-tx-287",
"value": 2190
},
{
"hc-key": "us-ga-121",
"value": 2191
},
{
"hc-key": "us-tx-073",
"value": 2192
},
{
"hc-key": "us-mo-007",
"value": 2193
},
{
"hc-key": "us-sc-029",
"value": 2194
},
{
"hc-key": "us-ar-055",
"value": 2195
},
{
"hc-key": "us-tx-191",
"value": 2196
},
{
"hc-key": "us-wi-013",
"value": 2197
},
{
"hc-key": "us-wi-129",
"value": 2198
},
{
"hc-key": "us-nc-141",
"value": 2199
},
{
"hc-key": "us-nc-061",
"value": 2200
},
{
"hc-key": "us-tx-221",
"value": 2201
},
{
"hc-key": "us-sd-119",
"value": 2202
},
{
"hc-key": "us-nv-031",
"value": 2203
},
{
"hc-key": "us-ky-007",
"value": 2204
},
{
"hc-key": "us-tx-009",
"value": 2205
},
{
"hc-key": "us-tx-503",
"value": 2206
},
{
"hc-key": "us-tx-023",
"value": 2207
},
{
"hc-key": "us-tx-405",
"value": 2208
},
{
"hc-key": "us-nv-029",
"value": 2209
},
{
"hc-key": "us-ct-001",
"value": 2210
},
{
"hc-key": "us-ca-009",
"value": 2211
},
{
"hc-key": "us-ca-077",
"value": 2212
},
{
"hc-key": "us-ms-159",
"value": 2213
},
{
"hc-key": "us-ky-167",
"value": 2214
},
{
"hc-key": "us-ne-183",
"value": 2215
},
{
"hc-key": "us-ky-135",
"value": 2216
},
{
"hc-key": "us-mn-149",
"value": 2217
},
{
"hc-key": "us-ms-053",
"value": 2218
},
{
"hc-key": "us-ms-051",
"value": 2219
},
{
"hc-key": "us-ks-017",
"value": 2220
},
{
"hc-key": "us-ky-143",
"value": 2221
},
{
"hc-key": "us-ky-033",
"value": 2222
},
{
"hc-key": "us-ky-221",
"value": 2223
},
{
"hc-key": "us-sd-003",
"value": 2224
},
{
"hc-key": "us-ne-061",
"value": 2225
},
{
"hc-key": "us-ks-037",
"value": 2226
},
{
"hc-key": "us-mn-023",
"value": 2227
},
{
"hc-key": "us-sc-049",
"value": 2228
},
{
"hc-key": "us-sc-013",
"value": 2229
},
{
"hc-key": "us-id-043",
"value": 2230
},
{
"hc-key": "us-va-053",
"value": 2231
},
{
"hc-key": "us-va-081",
"value": 2232
},
{
"hc-key": "us-fl-111",
"value": 2233
},
{
"hc-key": "us-fl-061",
"value": 2234
},
{
"hc-key": "us-ny-073",
"value": 2235
},
{
"hc-key": "us-ny-055",
"value": 2236
},
{
"hc-key": "us-sd-083",
"value": 2237
},
{
"hc-key": "us-wi-017",
"value": 2238
},
{
"hc-key": "us-ky-157",
"value": 2239
},
{
"hc-key": "us-ga-065",
"value": 2240
},
{
"hc-key": "us-ga-185",
"value": 2241
},
{
"hc-key": "us-mi-099",
"value": 2242
},
{
"hc-key": "us-tx-331",
"value": 2243
},
{
"hc-key": "us-ky-087",
"value": 2244
},
{
"hc-key": "us-ky-099",
"value": 2245
},
{
"hc-key": "us-ky-137",
"value": 2246
},
{
"hc-key": "us-va-710",
"value": 2247
},
{
"hc-key": "us-va-155",
"value": 2248
},
{
"hc-key": "us-nc-179",
"value": 2249
},
{
"hc-key": "us-nd-061",
"value": 2250
},
{
"hc-key": "us-nd-053",
"value": 2251
},
{
"hc-key": "us-fl-091",
"value": 2252
},
{
"hc-key": "us-ca-001",
"value": 2253
},
{
"hc-key": "us-il-013",
"value": 2254
},
{
"hc-key": "us-in-085",
"value": 2255
},
{
"hc-key": "us-ms-103",
"value": 2256
},
{
"hc-key": "us-mt-045",
"value": 2257
},
{
"hc-key": "us-mt-107",
"value": 2258
},
{
"hc-key": "us-nc-121",
"value": 2259
},
{
"hc-key": "us-or-053",
"value": 2260
},
{
"hc-key": "us-or-041",
"value": 2261
},
{
"hc-key": "us-or-065",
"value": 2262
},
{
"hc-key": "us-or-047",
"value": 2263
},
{
"hc-key": "us-ia-173",
"value": 2264
},
{
"hc-key": "us-oh-039",
"value": 2265
},
{
"hc-key": "us-wv-039",
"value": 2266
},
{
"hc-key": "us-wv-019",
"value": 2267
},
{
"hc-key": "us-wv-025",
"value": 2268
},
{
"hc-key": "us-il-121",
"value": 2269
},
{
"hc-key": "us-va-051",
"value": 2270
},
{
"hc-key": "us-va-007",
"value": 2271
},
{
"hc-key": "us-ga-243",
"value": 2272
},
{
"hc-key": "us-nm-029",
"value": 2273
},
{
"hc-key": "us-tx-355",
"value": 2274
},
{
"hc-key": "us-tx-409",
"value": 2275
},
{
"hc-key": "us-wy-045",
"value": 2276
},
{
"hc-key": "us-sd-081",
"value": 2277
},
{
"hc-key": "us-sd-093",
"value": 2278
},
{
"hc-key": "us-sd-033",
"value": 2279
},
{
"hc-key": "us-al-089",
"value": 2280
},
{
"hc-key": "us-tn-189",
"value": 2281
},
{
"hc-key": "us-tx-063",
"value": 2282
},
{
"hc-key": "us-tx-459",
"value": 2283
},
{
"hc-key": "us-ok-067",
"value": 2284
},
{
"hc-key": "us-wv-085",
"value": 2285
},
{
"hc-key": "us-wv-021",
"value": 2286
},
{
"hc-key": "us-la-045",
"value": 2287
},
{
"hc-key": "us-tx-349",
"value": 2288
},
{
"hc-key": "us-tx-161",
"value": 2289
},
{
"hc-key": "us-pa-087",
"value": 2290
},
{
"hc-key": "us-tx-399",
"value": 2291
},
{
"hc-key": "us-tx-465",
"value": 2292
},
{
"hc-key": "us-ks-193",
"value": 2293
},
{
"hc-key": "us-ga-161",
"value": 2294
},
{
"hc-key": "us-ar-145",
"value": 2295
},
{
"hc-key": "us-ms-083",
"value": 2296
},
{
"hc-key": "us-mo-053",
"value": 2297
},
{
"hc-key": "us-nm-009",
"value": 2298
},
{
"hc-key": "us-tx-369",
"value": 2299
},
{
"hc-key": "us-sd-011",
"value": 2300
},
{
"hc-key": "us-ms-027",
"value": 2301
},
{
"hc-key": "us-ia-057",
"value": 2302
},
{
"hc-key": "us-ia-087",
"value": 2303
},
{
"hc-key": "us-ia-163",
"value": 2304
},
{
"hc-key": "us-ks-143",
"value": 2305
},
{
"hc-key": "us-fl-023",
"value": 2306
},
{
"hc-key": "us-ny-095",
"value": 2307
},
{
"hc-key": "us-ok-117",
"value": 2308
},
{
"hc-key": "us-ny-007",
"value": 2309
},
{
"hc-key": "us-oh-009",
"value": 2310
},
{
"hc-key": "us-wv-083",
"value": 2311
},
{
"hc-key": "us-ca-057",
"value": 2312
},
{
"hc-key": "us-mn-017",
"value": 2313
},
{
"hc-key": "us-ky-199",
"value": 2314
},
{
"hc-key": "us-nc-065",
"value": 2315
},
{
"hc-key": "us-tx-241",
"value": 2316
},
{
"hc-key": "us-ut-031",
"value": 2317
},
{
"hc-key": "us-ut-017",
"value": 2318
},
{
"hc-key": "us-ut-001",
"value": 2319
},
{
"hc-key": "us-tn-011",
"value": 2320
},
{
"hc-key": "us-tn-139",
"value": 2321
},
{
"hc-key": "us-ga-213",
"value": 2322
},
{
"hc-key": "us-mi-107",
"value": 2323
},
{
"hc-key": "us-mi-117",
"value": 2324
},
{
"hc-key": "us-ny-083",
"value": 2325
},
{
"hc-key": "us-ga-017",
"value": 2326
},
{
"hc-key": "us-ga-271",
"value": 2327
},
{
"hc-key": "us-ar-077",
"value": 2328
},
{
"hc-key": "us-fl-003",
"value": 2329
},
{
"hc-key": "us-fl-031",
"value": 2330
},
{
"hc-key": "us-ga-173",
"value": 2331
},
{
"hc-key": "us-al-015",
"value": 2332
},
{
"hc-key": "us-ky-057",
"value": 2333
},
{
"hc-key": "us-ms-107",
"value": 2334
},
{
"hc-key": "us-ga-239",
"value": 2335
},
{
"hc-key": "us-tx-199",
"value": 2336
},
{
"hc-key": "us-ct-005",
"value": 2337
},
{
"hc-key": "us-oh-143",
"value": 2338
},
{
"hc-key": "us-oh-147",
"value": 2339
},
{
"hc-key": "us-il-153",
"value": 2340
},
{
"hc-key": "us-ok-107",
"value": 2341
},
{
"hc-key": "us-mi-145",
"value": 2342
},
{
"hc-key": "us-vt-015",
"value": 2343
},
{
"hc-key": "us-vt-005",
"value": 2344
},
{
"hc-key": "us-il-119",
"value": 2345
},
{
"hc-key": "us-tx-085",
"value": 2346
},
{
"hc-key": "us-ne-053",
"value": 2347
},
{
"hc-key": "us-fl-115",
"value": 2348
},
{
"hc-key": "us-pa-091",
"value": 2349
},
{
"hc-key": "us-id-061",
"value": 2350
},
{
"hc-key": "us-nj-037",
"value": 2351
},
{
"hc-key": "us-nj-027",
"value": 2352
},
{
"hc-key": "us-mo-211",
"value": 2353
},
{
"hc-key": "us-ne-029",
"value": 2354
},
{
"hc-key": "us-oh-113",
"value": 2355
},
{
"hc-key": "us-tx-447",
"value": 2356
},
{
"hc-key": "us-ga-059",
"value": 2357
},
{
"hc-key": "us-ga-221",
"value": 2358
},
{
"hc-key": "us-mi-017",
"value": 2359
},
{
"hc-key": "us-tn-157",
"value": 2360
},
{
"hc-key": "us-ca-113",
"value": 2361
},
{
"hc-key": "us-ca-007",
"value": 2362
},
{
"hc-key": "us-tx-021",
"value": 2363
},
{
"hc-key": "us-wa-039",
"value": 2364
},
{
"hc-key": "us-wa-005",
"value": 2365
},
{
"hc-key": "us-wa-071",
"value": 2366
},
{
"hc-key": "us-ks-205",
"value": 2367
},
{
"hc-key": "us-ks-049",
"value": 2368
},
{
"hc-key": "us-ks-125",
"value": 2369
},
{
"hc-key": "us-la-043",
"value": 2370
},
{
"hc-key": "us-la-069",
"value": 2371
},
{
"hc-key": "us-mi-011",
"value": 2372
},
{
"hc-key": "us-ia-111",
"value": 2373
},
{
"hc-key": "us-ks-141",
"value": 2374
},
{
"hc-key": "us-ks-105",
"value": 2375
},
{
"hc-key": "us-ks-053",
"value": 2376
},
{
"hc-key": "us-ny-099",
"value": 2377
},
{
"hc-key": "us-ny-123",
"value": 2378
},
{
"hc-key": "us-ky-125",
"value": 2379
},
{
"hc-key": "us-tn-121",
"value": 2380
},
{
"hc-key": "us-mo-213",
"value": 2381
},
{
"hc-key": "us-co-047",
"value": 2382
},
{
"hc-key": "us-ok-087",
"value": 2383
},
{
"hc-key": "us-wv-031",
"value": 2384
},
{
"hc-key": "us-va-171",
"value": 2385
},
{
"hc-key": "us-va-139",
"value": 2386
},
{
"hc-key": "us-ok-061",
"value": 2387
},
{
"hc-key": "us-wv-089",
"value": 2388
},
{
"hc-key": "us-nj-013",
"value": 2389
},
{
"hc-key": "us-mo-115",
"value": 2390
},
{
"hc-key": "us-ga-209",
"value": 2391
},
{
"hc-key": "us-or-055",
"value": 2392
},
{
"hc-key": "us-ga-133",
"value": 2393
},
{
"hc-key": "us-sd-017",
"value": 2394
},
{
"hc-key": "us-sd-085",
"value": 2395
},
{
"hc-key": "us-sd-053",
"value": 2396
},
{
"hc-key": "us-tx-135",
"value": 2397
},
{
"hc-key": "us-tx-475",
"value": 2398
},
{
"hc-key": "us-tx-293",
"value": 2399
},
{
"hc-key": "us-wv-037",
"value": 2400
},
{
"hc-key": "us-wv-003",
"value": 2401
},
{
"hc-key": "us-mt-067",
"value": 2402
},
{
"hc-key": "us-tx-121",
"value": 2403
},
{
"hc-key": "us-nc-199",
"value": 2404
},
{
"hc-key": "us-tx-387",
"value": 2405
},
{
"hc-key": "us-ga-301",
"value": 2406
},
{
"hc-key": "us-tx-197",
"value": 2407
},
{
"hc-key": "us-mo-099",
"value": 2408
},
{
"hc-key": "us-mo-186",
"value": 2409
},
{
"hc-key": "us-ky-085",
"value": 2410
},
{
"hc-key": "us-ga-149",
"value": 2411
},
{
"hc-key": "us-al-079",
"value": 2412
},
{
"hc-key": "us-al-043",
"value": 2413
},
{
"hc-key": "us-ms-093",
"value": 2414
},
{
"hc-key": "us-ks-025",
"value": 2415
},
{
"hc-key": "us-ks-081",
"value": 2416
},
{
"hc-key": "us-la-013",
"value": 2417
},
{
"hc-key": "us-ga-295",
"value": 2418
},
{
"hc-key": "us-ia-095",
"value": 2419
},
{
"hc-key": "us-ne-019",
"value": 2420
},
{
"hc-key": "us-ne-093",
"value": 2421
},
{
"hc-key": "us-tx-357",
"value": 2422
},
{
"hc-key": "us-wa-015",
"value": 2423
},
{
"hc-key": "us-tx-297",
"value": 2424
},
{
"hc-key": "us-mo-135",
"value": 2425
},
{
"hc-key": "us-ok-043",
"value": 2426
},
{
"hc-key": "us-nc-023",
"value": 2427
},
{
"hc-key": "us-nc-191",
"value": 2428
},
{
"hc-key": "us-ar-061",
"value": 2429
},
{
"hc-key": "us-nc-059",
"value": 2430
},
{
"hc-key": "us-nc-111",
"value": 2431
},
{
"hc-key": "us-ar-099",
"value": 2432
},
{
"hc-key": "us-co-121",
"value": 2433
},
{
"hc-key": "us-tx-385",
"value": 2434
},
{
"hc-key": "us-oh-011",
"value": 2435
},
{
"hc-key": "us-oh-107",
"value": 2436
},
{
"hc-key": "us-in-001",
"value": 2437
},
{
"hc-key": "us-ks-169",
"value": 2438
},
{
"hc-key": "us-ky-153",
"value": 2439
},
{
"hc-key": "us-tx-017",
"value": 2440
},
{
"hc-key": "us-mo-027",
"value": 2441
},
{
"hc-key": "us-wy-029",
"value": 2442
},
{
"hc-key": "us-pa-093",
"value": 2443
},
{
"hc-key": "us-ny-081",
"value": 2444
},
{
"hc-key": "us-mi-031",
"value": 2445
},
{
"hc-key": "us-mi-047",
"value": 2446
},
{
"hc-key": "us-mi-051",
"value": 2447
},
{
"hc-key": "us-mi-111",
"value": 2448
},
{
"hc-key": "us-ky-173",
"value": 2449
},
{
"hc-key": "us-sc-023",
"value": 2450
},
{
"hc-key": "us-ky-123",
"value": 2451
},
{
"hc-key": "us-ia-193",
"value": 2452
},
{
"hc-key": "us-ia-093",
"value": 2453
},
{
"hc-key": "us-fl-123",
"value": 2454
},
{
"hc-key": "us-mo-201",
"value": 2455
},
{
"hc-key": "us-il-003",
"value": 2456
},
{
"hc-key": "us-il-181",
"value": 2457
},
{
"hc-key": "us-mo-113",
"value": 2458
},
{
"hc-key": "us-ga-051",
"value": 2459
},
{
"hc-key": "us-fl-125",
"value": 2460
},
{
"hc-key": "us-ny-037",
"value": 2461
},
{
"hc-key": "us-ia-141",
"value": 2462
},
{
"hc-key": "us-ia-041",
"value": 2463
},
{
"hc-key": "us-sd-107",
"value": 2464
},
{
"hc-key": "us-me-005",
"value": 2465
},
{
"hc-key": "us-ks-095",
"value": 2466
},
{
"hc-key": "us-ga-241",
"value": 2467
},
{
"hc-key": "us-wv-097",
"value": 2468
},
{
"hc-key": "us-ar-119",
"value": 2469
},
{
"hc-key": "us-ia-047",
"value": 2470
},
{
"hc-key": "us-oh-055",
"value": 2471
},
{
"hc-key": "us-ny-117",
"value": 2472
},
{
"hc-key": "us-va-163",
"value": 2473
},
{
"hc-key": "us-nd-095",
"value": 2474
},
{
"hc-key": "us-pa-045",
"value": 2475
},
{
"hc-key": "us-vt-021",
"value": 2476
},
{
"hc-key": "us-vt-003",
"value": 2477
},
{
"hc-key": "us-fl-019",
"value": 2478
},
{
"hc-key": "us-nc-183",
"value": 2479
},
{
"hc-key": "us-oh-061",
"value": 2480
},
{
"hc-key": "us-az-015",
"value": 2481
},
{
"hc-key": "us-mt-085",
"value": 2482
},
{
"hc-key": "us-ia-019",
"value": 2483
},
{
"hc-key": "us-sd-047",
"value": 2484
},
{
"hc-key": "us-mn-069",
"value": 2485
},
{
"hc-key": "us-ga-219",
"value": 2486
},
{
"hc-key": "us-tx-493",
"value": 2487
},
{
"hc-key": "us-fl-079",
"value": 2488
},
{
"hc-key": "us-in-153",
"value": 2489
},
{
"hc-key": "us-ga-027",
"value": 2490
},
{
"hc-key": "us-ks-185",
"value": 2491
},
{
"hc-key": "us-ks-159",
"value": 2492
},
{
"hc-key": "us-mi-115",
"value": 2493
},
{
"hc-key": "us-ky-139",
"value": 2494
},
{
"hc-key": "us-tn-103",
"value": 2495
},
{
"hc-key": "us-ky-103",
"value": 2496
},
{
"hc-key": "us-ky-211",
"value": 2497
},
{
"hc-key": "us-pa-001",
"value": 2498
},
{
"hc-key": "us-sc-009",
"value": 2499
},
{
"hc-key": "us-ut-047",
"value": 2500
},
{
"hc-key": "us-ut-049",
"value": 2501
},
{
"hc-key": "us-mo-141",
"value": 2502
},
{
"hc-key": "us-mo-015",
"value": 2503
},
{
"hc-key": "us-ia-143",
"value": 2504
},
{
"hc-key": "us-in-079",
"value": 2505
},
{
"hc-key": "us-in-143",
"value": 2506
},
{
"hc-key": "us-id-083",
"value": 2507
},
{
"hc-key": "us-il-165",
"value": 2508
},
{
"hc-key": "us-sc-061",
"value": 2509
},
{
"hc-key": "us-wy-019",
"value": 2510
},
{
"hc-key": "us-mi-165",
"value": 2511
},
{
"hc-key": "us-mi-055",
"value": 2512
},
{
"hc-key": "us-mi-079",
"value": 2513
},
{
"hc-key": "us-la-003",
"value": 2514
},
{
"hc-key": "us-la-011",
"value": 2515
},
{
"hc-key": "us-sd-069",
"value": 2516
},
{
"hc-key": "us-sc-027",
"value": 2517
},
{
"hc-key": "us-mt-095",
"value": 2518
},
{
"hc-key": "us-ky-219",
"value": 2519
},
{
"hc-key": "us-tn-183",
"value": 2520
},
{
"hc-key": "us-tn-017",
"value": 2521
},
{
"hc-key": "us-mo-077",
"value": 2522
},
{
"hc-key": "us-ne-159",
"value": 2523
},
{
"hc-key": "us-ny-015",
"value": 2524
},
{
"hc-key": "us-ca-043",
"value": 2525
},
{
"hc-key": "us-nj-041",
"value": 2526
},
{
"hc-key": "us-al-103",
"value": 2527
},
{
"hc-key": "us-ky-027",
"value": 2528
},
{
"hc-key": "us-ms-043",
"value": 2529
},
{
"hc-key": "us-ky-213",
"value": 2530
},
{
"hc-key": "us-vt-013",
"value": 2531
},
{
"hc-key": "us-va-125",
"value": 2532
},
{
"hc-key": "us-fl-093",
"value": 2533
},
{
"hc-key": "us-ar-053",
"value": 2534
},
{
"hc-key": "us-ga-175",
"value": 2535
},
{
"hc-key": "us-ar-007",
"value": 2536
},
{
"hc-key": "us-ar-143",
"value": 2537
},
{
"hc-key": "us-fl-127",
"value": 2538
},
{
"hc-key": "us-fl-009",
"value": 2539
},
{
"hc-key": "us-va-135",
"value": 2540
},
{
"hc-key": "us-ny-021",
"value": 2541
},
{
"hc-key": "us-ok-023",
"value": 2542
},
{
"hc-key": "us-ks-041",
"value": 2543
},
{
"hc-key": "us-tx-427",
"value": 2544
},
{
"hc-key": "us-ga-103",
"value": 2545
},
{
"hc-key": "us-wi-103",
"value": 2546
},
{
"hc-key": "us-tx-079",
"value": 2547
},
{
"hc-key": "us-al-075",
"value": 2548
},
{
"hc-key": "us-tn-117",
"value": 2549
},
{
"hc-key": "us-ar-087",
"value": 2550
},
{
"hc-key": "us-pa-055",
"value": 2551
},
{
"hc-key": "us-pa-079",
"value": 2552
},
{
"hc-key": "us-mi-039",
"value": 2553
},
{
"hc-key": "us-al-113",
"value": 2554
},
{
"hc-key": "us-va-065",
"value": 2555
},
{
"hc-key": "us-il-097",
"value": 2556
},
{
"hc-key": "us-ga-195",
"value": 2557
},
{
"hc-key": "us-ar-039",
"value": 2558
},
{
"hc-key": "us-co-057",
"value": 2559
},
{
"hc-key": "us-id-001",
"value": 2560
},
{
"hc-key": "us-wi-141",
"value": 2561
},
{
"hc-key": "us-ny-013",
"value": 2562
},
{
"hc-key": "us-tn-091",
"value": 2563
},
{
"hc-key": "us-nc-009",
"value": 2564
},
{
"hc-key": "us-va-195",
"value": 2565
},
{
"hc-key": "us-mo-035",
"value": 2566
},
{
"hc-key": "us-ok-013",
"value": 2567
},
{
"hc-key": "us-ia-033",
"value": 2568
},
{
"hc-key": "us-ky-205",
"value": 2569
},
{
"hc-key": "us-mo-031",
"value": 2570
},
{
"hc-key": "us-mo-133",
"value": 2571
},
{
"hc-key": "us-ky-075",
"value": 2572
},
{
"hc-key": "us-mo-143",
"value": 2573
},
{
"hc-key": "us-ar-139",
"value": 2574
},
{
"hc-key": "us-ar-013",
"value": 2575
},
{
"hc-key": "us-ar-025",
"value": 2576
},
{
"hc-key": "us-la-073",
"value": 2577
},
{
"hc-key": "us-ia-007",
"value": 2578
},
{
"hc-key": "us-mo-197",
"value": 2579
},
{
"hc-key": "us-al-059",
"value": 2580
},
{
"hc-key": "us-ky-041",
"value": 2581
},
{
"hc-key": "us-tx-267",
"value": 2582
},
{
"hc-key": "us-tx-095",
"value": 2583
},
{
"hc-key": "us-tx-441",
"value": 2584
},
{
"hc-key": "us-tx-307",
"value": 2585
},
{
"hc-key": "us-tx-217",
"value": 2586
},
{
"hc-key": "us-ks-055",
"value": 2587
},
{
"hc-key": "us-sc-039",
"value": 2588
},
{
"hc-key": "us-mn-091",
"value": 2589
},
{
"hc-key": "us-tn-155",
"value": 2590
},
{
"hc-key": "us-tx-263",
"value": 2591
},
{
"hc-key": "us-mt-099",
"value": 2592
},
{
"hc-key": "us-ne-069",
"value": 2593
},
{
"hc-key": "us-il-117",
"value": 2594
},
{
"hc-key": "us-oh-141",
"value": 2595
},
{
"hc-key": "us-il-195",
"value": 2596
},
{
"hc-key": "us-tx-141",
"value": 2597
},
{
"hc-key": "us-tx-229",
"value": 2598
},
{
"hc-key": "us-tx-301",
"value": 2599
},
{
"hc-key": "us-oh-167",
"value": 2600
},
{
"hc-key": "us-mo-091",
"value": 2601
},
{
"hc-key": "us-ks-047",
"value": 2602
},
{
"hc-key": "us-in-061",
"value": 2603
},
{
"hc-key": "us-in-043",
"value": 2604
},
{
"hc-key": "us-ky-111",
"value": 2605
},
{
"hc-key": "us-ky-029",
"value": 2606
},
{
"hc-key": "us-in-019",
"value": 2607
},
{
"hc-key": "us-il-129",
"value": 2608
},
{
"hc-key": "us-wi-139",
"value": 2609
},
{
"hc-key": "us-ks-079",
"value": 2610
},
{
"hc-key": "us-ks-155",
"value": 2611
},
{
"hc-key": "us-wv-091",
"value": 2612
},
{
"hc-key": "us-ky-093",
"value": 2613
},
{
"hc-key": "us-sd-057",
"value": 2614
},
{
"hc-key": "us-wi-069",
"value": 2615
},
{
"hc-key": "us-ny-033",
"value": 2616
},
{
"hc-key": "us-wv-081",
"value": 2617
},
{
"hc-key": "us-ca-065",
"value": 2618
},
{
"hc-key": "us-ca-059",
"value": 2619
},
{
"hc-key": "us-ca-037",
"value": 2620
},
{
"hc-key": "us-az-023",
"value": 2621
},
{
"hc-key": "us-il-101",
"value": 2622
},
{
"hc-key": "us-in-125",
"value": 2623
},
{
"hc-key": "us-ky-107",
"value": 2624
},
{
"hc-key": "us-ky-047",
"value": 2625
},
{
"hc-key": "us-mi-045",
"value": 2626
},
{
"hc-key": "us-ms-157",
"value": 2627
},
{
"hc-key": "us-ms-079",
"value": 2628
},
{
"hc-key": "us-ms-025",
"value": 2629
},
{
"hc-key": "us-in-029",
"value": 2630
},
{
"hc-key": "us-in-175",
"value": 2631
},
{
"hc-key": "us-la-125",
"value": 2632
},
{
"hc-key": "us-fl-063",
"value": 2633
},
{
"hc-key": "us-ga-253",
"value": 2634
},
{
"hc-key": "us-va-115",
"value": 2635
},
{
"hc-key": "us-tx-283",
"value": 2636
},
{
"hc-key": "us-mt-075",
"value": 2637
},
{
"hc-key": "us-wi-091",
"value": 2638
},
{
"hc-key": "us-mn-157",
"value": 2639
},
{
"hc-key": "us-mo-121",
"value": 2640
},
{
"hc-key": "us-tx-279",
"value": 2641
},
{
"hc-key": "us-ks-097",
"value": 2642
},
{
"hc-key": "us-tx-015",
"value": 2643
},
{
"hc-key": "us-mo-061",
"value": 2644
},
{
"hc-key": "us-ga-087",
"value": 2645
},
{
"hc-key": "us-ga-201",
"value": 2646
},
{
"hc-key": "us-mi-101",
"value": 2647
},
{
"hc-key": "us-tx-195",
"value": 2648
},
{
"hc-key": "us-tx-233",
"value": 2649
},
{
"hc-key": "us-ks-129",
"value": 2650
},
{
"hc-key": "us-ok-139",
"value": 2651
},
{
"hc-key": "us-ok-153",
"value": 2652
},
{
"hc-key": "us-ia-003",
"value": 2653
},
{
"hc-key": "us-ca-101",
"value": 2654
},
{
"hc-key": "us-pa-105",
"value": 2655
},
{
"hc-key": "us-ks-077",
"value": 2656
},
{
"hc-key": "us-ia-133",
"value": 2657
},
{
"hc-key": "us-ny-017",
"value": 2658
},
{
"hc-key": "us-il-143",
"value": 2659
},
{
"hc-key": "us-ia-091",
"value": 2660
},
{
"hc-key": "us-pa-003",
"value": 2661
},
{
"hc-key": "us-mo-205",
"value": 2662
},
{
"hc-key": "us-oh-097",
"value": 2663
},
{
"hc-key": "us-ks-201",
"value": 2664
},
{
"hc-key": "us-id-087",
"value": 2665
},
{
"hc-key": "us-mi-113",
"value": 2666
},
{
"hc-key": "us-nd-093",
"value": 2667
},
{
"hc-key": "us-mo-203",
"value": 2668
},
{
"hc-key": "us-tx-423",
"value": 2669
},
{
"hc-key": "us-ok-143",
"value": 2670
},
{
"hc-key": "us-ok-091",
"value": 2671
},
{
"hc-key": "us-tx-395",
"value": 2672
},
{
"hc-key": "us-tx-171",
"value": 2673
},
{
"hc-key": "us-mi-125",
"value": 2674
},
{
"hc-key": "us-nd-033",
"value": 2675
},
{
"hc-key": "us-wy-027",
"value": 2676
},
{
"hc-key": "us-wa-025",
"value": 2677
},
{
"hc-key": "us-mn-129",
"value": 2678
},
{
"hc-key": "us-fl-001",
"value": 2679
},
{
"hc-key": "us-ne-091",
"value": 2680
},
{
"hc-key": "us-ut-007",
"value": 2681
},
{
"hc-key": "us-pa-017",
"value": 2682
},
{
"hc-key": "us-nj-019",
"value": 2683
},
{
"hc-key": "us-sd-059",
"value": 2684
},
{
"hc-key": "us-pa-081",
"value": 2685
},
{
"hc-key": "us-id-057",
"value": 2686
},
{
"hc-key": "us-ga-237",
"value": 2687
},
{
"hc-key": "us-va-640",
"value": 2688
},
{
"hc-key": "us-nm-059",
"value": 2689
},
{
"hc-key": "us-ok-025",
"value": 2690
},
{
"hc-key": "us-tx-111",
"value": 2691
},
{
"hc-key": "us-tx-269",
"value": 2692
},
{
"hc-key": "us-tx-451",
"value": 2693
},
{
"hc-key": "us-fl-049",
"value": 2694
},
{
"hc-key": "us-ky-037",
"value": 2695
},
{
"hc-key": "us-oh-025",
"value": 2696
},
{
"hc-key": "us-tx-501",
"value": 2697
},
{
"hc-key": "us-or-071",
"value": 2698
},
{
"hc-key": "us-ia-115",
"value": 2699
},
{
"hc-key": "us-oh-121",
"value": 2700
},
{
"hc-key": "us-oh-119",
"value": 2701
},
{
"hc-key": "us-pa-075",
"value": 2702
},
{
"hc-key": "us-mn-087",
"value": 2703
},
{
"hc-key": "us-nj-031",
"value": 2704
},
{
"hc-key": "us-tx-033",
"value": 2705
},
{
"hc-key": "us-ok-073",
"value": 2706
},
{
"hc-key": "us-tx-051",
"value": 2707
},
{
"hc-key": "us-ms-133",
"value": 2708
},
{
"hc-key": "us-mn-053",
"value": 2709
},
{
"hc-key": "us-pa-027",
"value": 2710
},
{
"hc-key": "us-tx-025",
"value": 2711
},
{
"hc-key": "us-ia-171",
"value": 2712
},
{
"hc-key": "us-ne-147",
"value": 2713
},
{
"hc-key": "us-il-021",
"value": 2714
},
{
"hc-key": "us-fl-089",
"value": 2715
},
{
"hc-key": "us-ga-007",
"value": 2716
},
{
"hc-key": "us-ga-205",
"value": 2717
},
{
"hc-key": "us-ga-275",
"value": 2718
},
{
"hc-key": "us-ky-005",
"value": 2719
},
{
"hc-key": "us-ky-185",
"value": 2720
},
{
"hc-key": "us-nd-065",
"value": 2721
},
{
"hc-key": "us-tn-109",
"value": 2722
},
{
"hc-key": "us-vt-007",
"value": 2723
},
{
"hc-key": "us-ia-139",
"value": 2724
},
{
"hc-key": "us-ky-223",
"value": 2725
},
{
"hc-key": "us-ga-055",
"value": 2726
},
{
"hc-key": "us-sc-051",
"value": 2727
},
{
"hc-key": "us-ks-131",
"value": 2728
},
{
"hc-key": "us-ne-083",
"value": 2729
},
{
"hc-key": "us-ks-179",
"value": 2730
},
{
"hc-key": "us-ne-065",
"value": 2731
},
{
"hc-key": "us-ky-009",
"value": 2732
},
{
"hc-key": "us-ca-005",
"value": 2733
},
{
"hc-key": "us-tn-049",
"value": 2734
},
{
"hc-key": "us-mi-023",
"value": 2735
},
{
"hc-key": "us-va-031",
"value": 2736
},
{
"hc-key": "us-oh-105",
"value": 2737
},
{
"hc-key": "us-ok-053",
"value": 2738
},
{
"hc-key": "us-sd-115",
"value": 2739
},
{
"hc-key": "us-tx-455",
"value": 2740
},
{
"hc-key": "us-ky-147",
"value": 2741
},
{
"hc-key": "us-ky-191",
"value": 2742
},
{
"hc-key": "us-ky-215",
"value": 2743
},
{
"hc-key": "us-ne-175",
"value": 2744
},
{
"hc-key": "us-tx-069",
"value": 2745
},
{
"hc-key": "us-md-043",
"value": 2746
},
{
"hc-key": "us-va-680",
"value": 2747
},
{
"hc-key": "us-ar-125",
"value": 2748
},
{
"hc-key": "us-wv-053",
"value": 2749
},
{
"hc-key": "us-ms-063",
"value": 2750
},
{
"hc-key": "us-nd-079",
"value": 2751
},
{
"hc-key": "us-mt-103",
"value": 2752
},
{
"hc-key": "us-ky-049",
"value": 2753
},
{
"hc-key": "us-mi-005",
"value": 2754
},
{
"hc-key": "us-mn-015",
"value": 2755
},
{
"hc-key": "us-va-109",
"value": 2756
},
{
"hc-key": "us-in-145",
"value": 2757
},
{
"hc-key": "us-oh-049",
"value": 2758
},
{
"hc-key": "us-ks-093",
"value": 2759
},
{
"hc-key": "us-ia-117",
"value": 2760
},
{
"hc-key": "us-ky-239",
"value": 2761
},
{
"hc-key": "us-sc-053",
"value": 2762
},
{
"hc-key": "us-sc-065",
"value": 2763
},
{
"hc-key": "us-sc-087",
"value": 2764
},
{
"hc-key": "us-mn-103",
"value": 2765
},
{
"hc-key": "us-wi-075",
"value": 2766
},
{
"hc-key": "us-wa-011",
"value": 2767
},
{
"hc-key": "us-wa-059",
"value": 2768
},
{
"hc-key": "us-wi-051",
"value": 2769
},
{
"hc-key": "us-la-123",
"value": 2770
},
{
"hc-key": "us-fl-077",
"value": 2771
},
{
"hc-key": "us-ks-083",
"value": 2772
},
{
"hc-key": "us-ks-069",
"value": 2773
},
{
"hc-key": "us-ks-057",
"value": 2774
},
{
"hc-key": "us-ks-119",
"value": 2775
},
{
"hc-key": "us-ms-001",
"value": 2776
},
{
"hc-key": "us-ms-057",
"value": 2777
},
{
"hc-key": "us-ky-073",
"value": 2778
},
{
"hc-key": "us-ga-217",
"value": 2779
},
{
"hc-key": "us-sd-049",
"value": 2780
},
{
"hc-key": "us-mi-061",
"value": 2781
},
{
"hc-key": "us-tn-127",
"value": 2782
},
{
"hc-key": "us-la-029",
"value": 2783
},
{
"hc-key": "us-la-063",
"value": 2784
},
{
"hc-key": "us-ma-009",
"value": 2785
},
{
"hc-key": "us-sc-079",
"value": 2786
},
{
"hc-key": "us-sc-017",
"value": 2787
},
{
"hc-key": "us-wv-009",
"value": 2788
},
{
"hc-key": "us-wv-013",
"value": 2789
},
{
"hc-key": "us-va-021",
"value": 2790
},
{
"hc-key": "us-wv-043",
"value": 2791
},
{
"hc-key": "us-ga-131",
"value": 2792
},
{
"hc-key": "us-co-021",
"value": 2793
},
{
"hc-key": "us-az-005",
"value": 2794
},
{
"hc-key": "us-ut-055",
"value": 2795
},
{
"hc-key": "us-in-133",
"value": 2796
},
{
"hc-key": "us-id-047",
"value": 2797
},
{
"hc-key": "us-tn-167",
"value": 2798
},
{
"hc-key": "us-tn-075",
"value": 2799
},
{
"hc-key": "us-tn-097",
"value": 2800
},
{
"hc-key": "us-mo-171",
"value": 2801
},
{
"hc-key": "us-nd-059",
"value": 2802
},
{
"hc-key": "us-nc-041",
"value": 2803
},
{
"hc-key": "us-nc-021",
"value": 2804
},
{
"hc-key": "us-nc-089",
"value": 2805
},
{
"hc-key": "us-ca-063",
"value": 2806
},
{
"hc-key": "us-ar-115",
"value": 2807
},
{
"hc-key": "us-tx-183",
"value": 2808
},
{
"hc-key": "us-ar-089",
"value": 2809
},
{
"hc-key": "us-mo-187",
"value": 2810
},
{
"hc-key": "us-co-025",
"value": 2811
},
{
"hc-key": "us-tx-487",
"value": 2812
},
{
"hc-key": "us-or-015",
"value": 2813
},
{
"hc-key": "us-ut-051",
"value": 2814
},
{
"hc-key": "us-ar-011",
"value": 2815
},
{
"hc-key": "us-tx-193",
"value": 2816
},
{
"hc-key": "us-md-011",
"value": 2817
},
{
"hc-key": "us-mn-041",
"value": 2818
},
{
"hc-key": "us-mt-077",
"value": 2819
},
{
"hc-key": "us-mt-043",
"value": 2820
},
{
"hc-key": "us-mt-023",
"value": 2821
},
{
"hc-key": "us-mt-001",
"value": 2822
},
{
"hc-key": "us-tn-001",
"value": 2823
},
{
"hc-key": "us-oh-077",
"value": 2824
},
{
"hc-key": "us-ga-005",
"value": 2825
},
{
"hc-key": "us-de-001",
"value": 2826
},
{
"hc-key": "us-il-095",
"value": 2827
},
{
"hc-key": "us-tn-015",
"value": 2828
},
{
"hc-key": "us-me-007",
"value": 2829
},
{
"hc-key": "us-ky-165",
"value": 2830
},
{
"hc-key": "us-sd-089",
"value": 2831
},
{
"hc-key": "us-co-051",
"value": 2832
},
{
"hc-key": "us-mn-151",
"value": 2833
},
{
"hc-key": "us-ga-267",
"value": 2834
},
{
"hc-key": "us-tx-429",
"value": 2835
},
{
"hc-key": "us-nc-117",
"value": 2836
},
{
"hc-key": "us-ga-317",
"value": 2837
},
{
"hc-key": "us-ca-081",
"value": 2838
},
{
"hc-key": "us-oh-159",
"value": 2839
},
{
"hc-key": "us-oh-035",
"value": 2840
},
{
"hc-key": "us-oh-153",
"value": 2841
},
{
"hc-key": "us-oh-103",
"value": 2842
},
{
"hc-key": "us-tx-285",
"value": 2843
},
{
"hc-key": "us-ok-105",
"value": 2844
},
{
"hc-key": "us-ga-125",
"value": 2845
},
{
"hc-key": "us-sd-113",
"value": 2846
},
{
"hc-key": "us-ks-117",
"value": 2847
},
{
"hc-key": "us-la-065",
"value": 2848
},
{
"hc-key": "us-ga-313",
"value": 2849
},
{
"hc-key": "us-ks-203",
"value": 2850
},
{
"hc-key": "us-ne-027",
"value": 2851
},
{
"hc-key": "us-il-111",
"value": 2852
},
{
"hc-key": "us-mt-069",
"value": 2853
},
{
"hc-key": "us-mo-033",
"value": 2854
},
{
"hc-key": "us-wa-021",
"value": 2855
},
{
"hc-key": "us-wa-075",
"value": 2856
},
{
"hc-key": "us-ne-169",
"value": 2857
},
{
"hc-key": "us-tn-033",
"value": 2858
},
{
"hc-key": "us-tn-053",
"value": 2859
},
{
"hc-key": "us-ia-079",
"value": 2860
},
{
"hc-key": "us-ga-255",
"value": 2861
},
{
"hc-key": "us-ks-107",
"value": 2862
},
{
"hc-key": "us-mo-217",
"value": 2863
},
{
"hc-key": "us-in-121",
"value": 2864
},
{
"hc-key": "us-ia-069",
"value": 2865
},
{
"hc-key": "us-ga-035",
"value": 2866
},
{
"hc-key": "us-tx-035",
"value": 2867
},
{
"hc-key": "us-nd-069",
"value": 2868
},
{
"hc-key": "us-il-015",
"value": 2869
},
{
"hc-key": "us-or-031",
"value": 2870
},
{
"hc-key": "us-al-051",
"value": 2871
},
{
"hc-key": "us-ga-187",
"value": 2872
},
{
"hc-key": "us-oh-083",
"value": 2873
},
{
"hc-key": "us-tx-175",
"value": 2874
},
{
"hc-key": "us-tx-065",
"value": 2875
},
{
"hc-key": "us-tx-379",
"value": 2876
},
{
"hc-key": "us-ks-067",
"value": 2877
},
{
"hc-key": "us-va-105",
"value": 2878
},
{
"hc-key": "us-nm-051",
"value": 2879
},
{
"hc-key": "us-ne-123",
"value": 2880
},
{
"hc-key": "us-ar-109",
"value": 2881
},
{
"hc-key": "us-co-077",
"value": 2882
},
{
"hc-key": "us-mo-065",
"value": 2883
},
{
"hc-key": "us-va-185",
"value": 2884
},
{
"hc-key": "us-pa-103",
"value": 2885
},
{
"hc-key": "us-pa-115",
"value": 2886
},
{
"hc-key": "us-tx-343",
"value": 2887
},
{
"hc-key": "us-pa-125",
"value": 2888
},
{
"hc-key": "us-vt-001",
"value": 2889
},
{
"hc-key": "us-vt-023",
"value": 2890
},
{
"hc-key": "us-ks-103",
"value": 2891
},
{
"hc-key": "us-ks-087",
"value": 2892
},
{
"hc-key": "us-mi-121",
"value": 2893
},
{
"hc-key": "us-ms-049",
"value": 2894
},
{
"hc-key": "us-tx-281",
"value": 2895
},
{
"hc-key": "us-va-107",
"value": 2896
},
{
"hc-key": "us-mo-185",
"value": 2897
},
{
"hc-key": "us-mo-129",
"value": 2898
},
{
"hc-key": "us-nc-127",
"value": 2899
},
{
"hc-key": "us-mo-159",
"value": 2900
},
{
"hc-key": "us-mt-089",
"value": 2901
},
{
"hc-key": "us-va-047",
"value": 2902
},
{
"hc-key": "us-wv-069",
"value": 2903
},
{
"hc-key": "us-wv-065",
"value": 2904
},
{
"hc-key": "us-va-165",
"value": 2905
},
{
"hc-key": "us-in-183",
"value": 2906
},
{
"hc-key": "us-ca-093",
"value": 2907
},
{
"hc-key": "us-sd-037",
"value": 2908
},
{
"hc-key": "us-la-071",
"value": 2909
},
{
"hc-key": "us-al-127",
"value": 2910
},
{
"hc-key": "us-mo-063",
"value": 2911
},
{
"hc-key": "us-fl-039",
"value": 2912
},
{
"hc-key": "us-ga-083",
"value": 2913
},
{
"hc-key": "us-va-187",
"value": 2914
},
{
"hc-key": "us-tn-113",
"value": 2915
},
{
"hc-key": "us-oh-089",
"value": 2916
},
{
"hc-key": "us-al-101",
"value": 2917
},
{
"hc-key": "us-al-041",
"value": 2918
},
{
"hc-key": "us-ky-155",
"value": 2919
},
{
"hc-key": "us-ms-067",
"value": 2920
},
{
"hc-key": "us-wi-021",
"value": 2921
},
{
"hc-key": "us-mn-029",
"value": 2922
},
{
"hc-key": "us-ks-163",
"value": 2923
},
{
"hc-key": "us-in-041",
"value": 2924
},
{
"hc-key": "us-ne-079",
"value": 2925
},
{
"hc-key": "us-ne-081",
"value": 2926
},
{
"hc-key": "us-ne-115",
"value": 2927
},
{
"hc-key": "us-al-007",
"value": 2928
},
{
"hc-key": "us-al-021",
"value": 2929
},
{
"hc-key": "us-ms-075",
"value": 2930
},
{
"hc-key": "us-mn-011",
"value": 2931
},
{
"hc-key": "us-mn-013",
"value": 2932
},
{
"hc-key": "us-mi-041",
"value": 2933
},
{
"hc-key": "us-ar-131",
"value": 2934
},
{
"hc-key": "us-ga-207",
"value": 2935
},
{
"hc-key": "us-mo-069",
"value": 2936
},
{
"hc-key": "us-ga-117",
"value": 2937
},
{
"hc-key": "us-tx-249",
"value": 2938
},
{
"hc-key": "us-mi-073",
"value": 2939
},
{
"hc-key": "us-tx-421",
"value": 2940
},
{
"hc-key": "us-tx-341",
"value": 2941
},
{
"hc-key": "us-wy-035",
"value": 2942
},
{
"hc-key": "us-ky-069",
"value": 2943
},
{
"hc-key": "us-wi-019",
"value": 2944
},
{
"hc-key": "us-sc-091",
"value": 2945
},
{
"hc-key": "us-pa-119",
"value": 2946
},
{
"hc-key": "us-va-570",
"value": 2947
},
{
"hc-key": "us-va-670",
"value": 2948
},
{
"hc-key": "us-va-730",
"value": 2949
},
{
"hc-key": "us-la-001",
"value": 2950
},
{
"hc-key": "us-sd-123",
"value": 2951
},
{
"hc-key": "us-ia-077",
"value": 2952
},
{
"hc-key": "us-ia-183",
"value": 2953
},
{
"hc-key": "us-sd-111",
"value": 2954
},
{
"hc-key": "us-ok-051",
"value": 2955
},
{
"hc-key": "us-wi-109",
"value": 2956
},
{
"hc-key": "us-pa-121",
"value": 2957
},
{
"hc-key": "us-tx-479",
"value": 2958
},
{
"hc-key": "us-nc-123",
"value": 2959
},
{
"hc-key": "us-ms-065",
"value": 2960
},
{
"hc-key": "us-tx-031",
"value": 2961
},
{
"hc-key": "us-va-025",
"value": 2962
},
{
"hc-key": "us-tn-045",
"value": 2963
},
{
"hc-key": "us-ar-075",
"value": 2964
},
{
"hc-key": "us-nd-027",
"value": 2965
},
{
"hc-key": "us-wi-057",
"value": 2966
},
{
"hc-key": "us-wi-081",
"value": 2967
},
{
"hc-key": "us-tn-151",
"value": 2968
},
{
"hc-key": "us-sd-031",
"value": 2969
},
{
"hc-key": "us-nc-181",
"value": 2970
},
{
"hc-key": "us-sc-011",
"value": 2971
},
{
"hc-key": "us-tn-039",
"value": 2972
},
{
"hc-key": "us-al-055",
"value": 2973
},
{
"hc-key": "us-id-025",
"value": 2974
},
{
"hc-key": "us-tn-119",
"value": 2975
},
{
"hc-key": "us-il-077",
"value": 2976
},
{
"hc-key": "us-sc-043",
"value": 2977
},
{
"hc-key": "us-ut-045",
"value": 2978
},
{
"hc-key": "us-va-650",
"value": 2979
},
{
"hc-key": "us-wi-011",
"value": 2980
},
{
"hc-key": "us-va-069",
"value": 2981
},
{
"hc-key": "us-wv-041",
"value": 2982
},
{
"hc-key": "us-mn-119",
"value": 2983
},
{
"hc-key": "us-mn-127",
"value": 2984
},
{
"hc-key": "us-tn-047",
"value": 2985
},
{
"hc-key": "us-la-089",
"value": 2986
},
{
"hc-key": "us-ar-111",
"value": 2987
},
{
"hc-key": "us-fl-045",
"value": 2988
},
{
"hc-key": "us-tn-063",
"value": 2989
},
{
"hc-key": "us-tx-351",
"value": 2990
},
{
"hc-key": "us-tx-219",
"value": 2991
},
{
"hc-key": "us-nc-175",
"value": 2992
},
{
"hc-key": "us-nc-171",
"value": 2993
},
{
"hc-key": "us-al-031",
"value": 2994
},
{
"hc-key": "us-id-027",
"value": 2995
},
{
"hc-key": "us-fl-073",
"value": 2996
},
{
"hc-key": "us-ok-119",
"value": 2997
},
{
"hc-key": "us-al-039",
"value": 2998
},
{
"hc-key": "us-ky-045",
"value": 2999
},
{
"hc-key": "us-ky-169",
"value": 3000
},
{
"hc-key": "us-ky-207",
"value": 3001
},
{
"hc-key": "us-me-019",
"value": 3002
},
{
"hc-key": "us-me-025",
"value": 3003
},
{
"hc-key": "us-ky-179",
"value": 3004
},
{
"hc-key": "us-ky-187",
"value": 3005
},
{
"hc-key": "us-mo-155",
"value": 3006
},
{
"hc-key": "us-ne-125",
"value": 3007
},
{
"hc-key": "us-tx-365",
"value": 3008
},
{
"hc-key": "us-ky-011",
"value": 3009
},
{
"hc-key": "us-ia-167",
"value": 3010
},
{
"hc-key": "us-mo-510",
"value": 3011
},
{
"hc-key": "us-sd-091",
"value": 3012
},
{
"hc-key": "us-ne-107",
"value": 3013
},
{
"hc-key": "us-mt-079",
"value": 3014
},
{
"hc-key": "us-ia-005",
"value": 3015
},
{
"hc-key": "us-tx-061",
"value": 3016
},
{
"hc-key": "us-tx-339",
"value": 3017
},
{
"hc-key": "us-tx-319",
"value": 3018
},
{
"hc-key": "us-nc-043",
"value": 3019
},
{
"hc-key": "us-ny-093",
"value": 3020
},
{
"hc-key": "us-ks-197",
"value": 3021
},
{
"hc-key": "us-ky-181",
"value": 3022
},
{
"hc-key": "us-wi-071",
"value": 3023
},
{
"hc-key": "us-nc-047",
"value": 3024
},
{
"hc-key": "us-oh-053",
"value": 3025
},
{
"hc-key": "us-oh-031",
"value": 3026
},
{
"hc-key": "us-tx-205",
"value": 3027
},
{
"hc-key": "us-ia-189",
"value": 3028
},
{
"hc-key": "us-tx-505",
"value": 3029
},
{
"hc-key": "us-ky-019",
"value": 3030
},
{
"hc-key": "us-ne-037",
"value": 3031
},
{
"hc-key": "us-sc-025",
"value": 3032
},
{
"hc-key": "us-tn-101",
"value": 3033
},
{
"hc-key": "us-or-067",
"value": 3034
},
{
"hc-key": "us-va-810",
"value": 3035
},
{
"hc-key": "us-mt-057",
"value": 3036
},
{
"hc-key": "us-va-103",
"value": 3037
},
{
"hc-key": "us-mo-013",
"value": 3038
},
{
"hc-key": "us-nh-001",
"value": 3039
},
{
"hc-key": "us-va-159",
"value": 3040
},
{
"hc-key": "us-ks-173",
"value": 3041
},
{
"hc-key": "us-tx-453",
"value": 3042
},
{
"hc-key": "us-fl-057",
"value": 3043
},
{
"hc-key": "us-nj-021",
"value": 3044
},
{
"hc-key": "us-pa-129",
"value": 3045
},
{
"hc-key": "us-ia-029",
"value": 3046
},
{
"hc-key": "us-ky-115",
"value": 3047
},
{
"hc-key": "us-ri-003",
"value": 3048
},
{
"hc-key": "us-vt-019",
"value": 3049
},
{
"hc-key": "us-ks-085",
"value": 3050
},
{
"hc-key": "us-la-041",
"value": 3051
},
{
"hc-key": "us-ms-155",
"value": 3052
},
{
"hc-key": "us-ma-011",
"value": 3053
},
{
"hc-key": "us-sd-007",
"value": 3054
},
{
"hc-key": "us-mt-093",
"value": 3055
},
{
"hc-key": "us-ar-057",
"value": 3056
},
{
"hc-key": "us-mo-029",
"value": 3057
},
{
"hc-key": "us-va-117",
"value": 3058
},
{
"hc-key": "us-ky-233",
"value": 3059
},
{
"hc-key": "us-ok-047",
"value": 3060
},
{
"hc-key": "us-mi-091",
"value": 3061
},
{
"hc-key": "us-ga-123",
"value": 3062
},
{
"hc-key": "us-ms-089",
"value": 3063
},
{
"hc-key": "us-tx-227",
"value": 3064
},
{
"hc-key": "us-wv-099",
"value": 3065
},
{
"hc-key": "us-mi-013",
"value": 3066
},
{
"hc-key": "us-va-760",
"value": 3067
},
{
"hc-key": "us-ca-079",
"value": 3068
},
{
"hc-key": "us-tx-001",
"value": 3069
},
{
"hc-key": "us-nd-071",
"value": 3070
},
{
"hc-key": "us-co-029",
"value": 3071
},
{
"hc-key": "us-nm-021",
"value": 3072
},
{
"hc-key": "us-mt-007",
"value": 3073
},
{
"hc-key": "us-tx-457",
"value": 3074
},
{
"hc-key": "us-wa-077",
"value": 3075
},
{
"hc-key": "us-tx-347",
"value": 3076
},
{
"hc-key": "us-mt-061",
"value": 3077
},
{
"hc-key": "us-nm-047",
"value": 3078
},
{
"hc-key": "us-sd-103",
"value": 3079
},
{
"hc-key": "us-ia-149",
"value": 3080
},
{
"hc-key": "us-id-005",
"value": 3081
},
{
"hc-key": "us-az-025",
"value": 3082
},
{
"hc-key": "us-az-012",
"value": 3083
},
{
"hc-key": "us-sd-065",
"value": 3084
},
{
"hc-key": "us-ok-077",
"value": 3085
},
{
"hc-key": "us-ny-067",
"value": 3086
},
{
"hc-key": "us-mn-097",
"value": 3087
},
{
"hc-key": "us-wa-001",
"value": 3088
},
{
"hc-key": "us-co-039",
"value": 3089
},
{
"hc-key": "us-al-073",
"value": 3090
},
{
"hc-key": "us-nm-061",
"value": 3091
},
{
"hc-key": "us-mi-083",
"value": 3092
},
{
"hc-key": "us-or-011",
"value": 3093
},
{
"hc-key": "us-ca-025",
"value": 3094
},
{
"hc-key": "us-ks-003",
"value": 3095
},
{
"hc-key": "us-va-770",
"value": 3096
},
{
"hc-key": "us-ma-001",
"value": 3097
},
{
"hc-key": "us-ca-073",
"value": 3098
},
{
"hc-key": "us-nv-009",
"value": 3099
},
{
"hc-key": "us-mn-031",
"value": 3100
},
{
"hc-key": "us-wa-009",
"value": 3101
},
{
"hc-key": "us-mt-035",
"value": 3102
},
{
"hc-key": "us-nm-005",
"value": 3103
},
{
"hc-key": "us-az-007",
"value": 3104
},
{
"hc-key": "us-me-021",
"value": 3105
},
{
"hc-key": "us-mt-021",
"value": 3106
},
{
"hc-key": "us-mn-125",
"value": 3107
},
{
"hc-key": "us-wy-017",
"value": 3108
},
{
"value": 3109
},
{
"hc-key": "us-hi-003",
"value": 3110
},
{
"hc-key": "us-hi-007",
"value": 3111
},
{
"hc-key": "us-hi-009",
"value": 3112
},
{
"hc-key": "us-hi-001",
"value": 3113
},
{
"hc-key": "us-hi-005",
"value": 3114
},
{
"value": 3115
},
{
"hc-key": "us-ak-110",
"value": 3116
},
{
"hc-key": "us-ak-261",
"value": 3117
},
{
"hc-key": "us-ak-070",
"value": 3118
},
{
"hc-key": "us-ak-013",
"value": 3119
},
{
"hc-key": "us-ak-180",
"value": 3120
},
{
"hc-key": "us-ak-016",
"value": 3121
},
{
"hc-key": "us-ak-150",
"value": 3122
},
{
"hc-key": "us-ak-290",
"value": 3123
},
{
"hc-key": "us-ak-105",
"value": 3124
},
{
"hc-key": "us-ak-122",
"value": 3125
},
{
"hc-key": "us-ak-050",
"value": 3126
},
{
"hc-key": "us-ak-164",
"value": 3127
},
{
"hc-key": "us-ak-060",
"value": 3128
},
{
"hc-key": "us-ak-130",
"value": 3129
},
{
"hc-key": "us-ak-170",
"value": 3130
},
{
"hc-key": "us-ak-090",
"value": 3131
},
{
"hc-key": "us-ak-068",
"value": 3132
},
{
"hc-key": "us-ak-020",
"value": 3133
},
{
"hc-key": "us-ak-198",
"value": 3134
},
{
"hc-key": "us-ak-195",
"value": 3135
},
{
"hc-key": "us-ak-100",
"value": 3136
},
{
"hc-key": "us-ak-230",
"value": 3137
},
{
"hc-key": "us-ak-240",
"value": 3138
},
{
"hc-key": "us-ak-220",
"value": 3139
},
{
"hc-key": "us-ak-188",
"value": 3140
},
{
"hc-key": "us-ak-270",
"value": 3141
},
{
"hc-key": "us-ak-185",
"value": 3142
},
{
"hc-key": "us-ak-282",
"value": 3143
},
{
"hc-key": "us-ak-275",
"value": 3144
},
{
"value": 3145
},
{
"value": 3146
}
];
// Initiate the chart
$('#container').highcharts('Map', {
title : {
text : 'Highmaps basic demo'
},
subtitle : {
text : 'Source map: <a href="http://code.highcharts.com/mapdata/countries/us/us-all-all.js">United States of America, admin2</a>'
},
mapNavigation: {
enabled: true,
buttonOptions: {
verticalAlign: 'bottom'
}
},
colorAxis: {
min: 0
},
series : [{
data : data,
mapData: Highcharts.maps['countries/us/us-all-all'],
joinBy: 'hc-key',
name: 'Random data',
states: {
hover: {
color: '#BADA55'
}
},
dataLabels: {
enabled: true,
format: '{point.name}'
}
}, {
name: 'Separators',
type: 'mapline',
data: Highcharts.geojson(Highcharts.maps['countries/us/us-all-all'], 'mapline'),
color: 'silver',
showInLegend: false,
enableMouseTracking: false
}]
});
});
| Oxyless/highcharts-export-image | lib/highcharts.com/samples/mapdata/countries/us/us-all-all/demo.js | JavaScript | mit | 258,073 |
import { ɵɵdefineInjectable, Injectable } from '@angular/core';
class Angulartics2GoogleAnalyticsEnhancedEcommerce {
/**
* Add impression in GA enhanced ecommerce tracking
* @link https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce#measuring-activities
*/
ecAddImpression(properties) {
ga('ec:addImpression', properties);
}
/**
* Add product in GA enhanced ecommerce tracking
* @link https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce
*/
ecAddProduct(product) {
ga('ec:addProduct', product);
}
/**
* Set action in GA enhanced ecommerce tracking
* @link https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce
*/
ecSetAction(action, properties) {
ga('ec:setAction', action, properties);
}
}
Angulartics2GoogleAnalyticsEnhancedEcommerce.ɵprov = ɵɵdefineInjectable({ factory: function Angulartics2GoogleAnalyticsEnhancedEcommerce_Factory() { return new Angulartics2GoogleAnalyticsEnhancedEcommerce(); }, token: Angulartics2GoogleAnalyticsEnhancedEcommerce, providedIn: "root" });
Angulartics2GoogleAnalyticsEnhancedEcommerce.decorators = [
{ type: Injectable, args: [{ providedIn: 'root' },] }
];
/**
* Generated bundle index. Do not edit.
*/
export { Angulartics2GoogleAnalyticsEnhancedEcommerce };
//# sourceMappingURL=angulartics2-ga-enhanced-ecom.js.map
| cdnjs/cdnjs | ajax/libs/angulartics2/10.1.0/ga-enhanced-ecom/fesm2015/angulartics2-ga-enhanced-ecom.js | JavaScript | mit | 1,473 |
//
// config file
// --------------------------------------------------
//
// customize the template function via this file.
//
// but for the contact form and subscribe, please check the documentation
//
//
// overlay
// --------------------------------------------------
//
// overlay color doesnt mean home section bckground color
var _site_bg_overlay_color = 'rgba(33, 33, 33, 0.6)'; // overlay color, rgba format
var _site_bg_overlay_disable = false; // [true, false] - force disable overlay, sometime we dont need it, disable by this variable
//
// map (google map)
// https://maps.google.com/
// --------------------------------------------------
//
// [true, false] - enable or disable google map
var _map_toggle = true;
// change 'ABCDE12345' to be your google map api key, more info - https://developers.google.com/maps/documentation/javascript/
var _map_api = 'ABCDE12345';
// map latitude
var _map_latitude_longitude = [35.6046472, 140.2642208];
// map water color
var _map_water_color = '#786de4';
//
// background
// --------------------------------------------------
//
// choose background version for both desktop and mobile :)
//
// for desktop
var _bg_style_desktop = 6;
// 0 = flat color
// 1 = flat color (mp3 audio) - audio place at /audio/audio.mp3
// 2 = image
// 3 = image (mp3 audio) - audio place at /audio/audio.mp3
// 4 = slideshow
// 5 = slideshow (mp3 audio) - audio place at /audio/audio.mp3
// 6 = slideshow (kenburn)
// 7 = slideshow (kenburn, mp3 audio) - audio place at /audio/audio.mp3
// 8 = html5 video (mute) - video file place at /video/video.mp4
// 9 = html5 video (video audio)
// 10 = html5 video (mp3 audio, audio place at /audio/audio.mp3)
// 11 = youtube video (mute)
// 12 = youtube video (video audio)
// 13 = youtube video (youtube + mp3 audio) - audio place at /audio/audio.mp3
// for mobile
var _bg_style_mobile = 6;
// 0 = flat color
// 1 = flat color (mp3 audio) - audio place at /audio/audio.mp3
// 2 = image
// 3 = image (mp3 audio) - audio place at /audio/audio.mp3
// 4 = slideshow
// 5 = slideshow (mp3 audio, audio place at /audio/audio.mp3)
// 6 = slideshow (kenburn)
// 7 = slideshow (kenburn, mp3 audio) - audio place at /audio/audio.mp3
// if _bg_style == 4 - 7 (slideshow)
var _bg_slideshow_image_amount = 2; // slideshow image amount
var _bg_slideshow_duration = 9000; // millisecond
// if _bg_style_desktop == 11 - 13 (youtube video)
var _bg_video_youtube_url = 'gme8UgbTLHE'; // youtube video url id - https://www.youtube.com/watch?v=gme8UgbTLHE
var _bg_video_youtube_quality = 'hightres'; // hightres, hd1080, hd720, default - youtube video quality
var _bg_video_youtube_start = 1; // seconds - video start time
var _bg_video_youtube_end = 0; // seconds - video end time, 0 to ignored
var _bg_video_youtube_loop = true; // true, false - video loop
//
// background effect (constellation, parallax star star, particles)
// --------------------------------------------------
var _site_bg_effect = 1; // 0 = disable, 1 = constellation, 2 = parallax star star, 3 = particles
var _side_bg_effect_parallax = true; // [true, false] - enable parallax effect on effect 1,2 its force disable on mobile, and not work with outdated browser
// if _bg_effect == 1 (constellation)
var _constellation_color = 'rgba(255, 255, 255, .9)';// [rgba format] - constellation color
var _constellation_width = 1.5; // [px] - constellation width
// if _bg_effect == 2 (parallax star)
var _parallax_star_opacity = 1; // [0.1 to 1] - parallax star opacity
// if _bg_effect == 3 (particles)
var _particles_opacity = .5; // [0.1 to 1] - particles opacity
var _particles_link_opacity = .4; // [0.1 to 1] - particles link opacity | jeffthemaximum/jeffline | templates/jeffline-landing/template/purple-version/slideshow-constellation/assets/js/variable.js | JavaScript | mit | 5,378 |
import Ringa from '../../src/index';
class CommandFail extends Ringa.Command {
execute(error, kill) {
this.fail(error, kill);
}
}
export default CommandFail; | jung-digital/ringa | tests/shared/CommandFail.js | JavaScript | mit | 167 |
const path = require('path');
const express = require('express');
const bodyParser = require('body-parser');
const errorController = require('./controllers/error');
const sequelize = require('./util/database');
const Product = require('./models/product');
const User = require('./models/user');
const app = express();
app.set('view engine', 'ejs');
app.set('views', 'views');
const adminRoutes = require('./routes/admin');
const shopRoutes = require('./routes/shop');
app.use(bodyParser.urlencoded({ extended: false }));
app.use(express.static(path.join(__dirname, 'public')));
app.use((req, res, next) => {
User.findById(1)
.then(user => {
req.user = user;
next();
})
.catch(err => console.log(err));
});
app.use('/admin', adminRoutes);
app.use(shopRoutes);
app.use(errorController.get404);
Product.belongsTo(User, { constraints: true, onDelete: 'CASCADE' });
User.hasMany(Product);
sequelize
// .sync({ force: true })
.sync()
.then(result => {
return User.findById(1);
// console.log(result);
})
.then(user => {
if (!user) {
return User.create({ name: 'Max', email: '[email protected]' });
}
return user;
})
.then(user => {
// console.log(user);
app.listen(3000);
})
.catch(err => {
console.log(err);
});
| tarsoqueiroz/NodeJS | Udemy/NodeJS - The Complete Guide/Recursos/11/08-fetching-related-products/app.js | JavaScript | mit | 1,298 |
gereji.entities = {
" " : " ",
"¡" : "¡",
"¢" : "¢",
"£" : "£",
"¤" : "¤",
"¥" : "¥",
"¦" : "¦",
"§" : "§",
"¨" : "¨",
"©" : "©",
"ª" : "ª",
"«" : "«",
"¬" : "¬",
"­" : "­",
"®" : "®",
"¯" : "¯",
"°" : "°",
"±" : "±",
"²" : "²",
"³" : "³",
"´" : "´",
"µ" : "µ",
"¶" : "¶",
"·" : "·",
"¸" : "¸",
"¹" : "¹",
"º" : "º",
"»" : "»",
"¼" : "¼",
"½" : "½",
"¾" : "¾",
"¿" : "¿",
"À" : "À",
"Á" : "Á",
"Â" : "Â",
"Ã" : "Ã",
"Ä" : "Ä",
"Å" : "Å",
"Æ" : "Æ",
"Ç" : "Ç",
"È" : "È",
"É" : "É",
"Ê" : "Ê",
"Ë" : "Ë",
"Ì" : "Ì",
"Í" : "Í",
"Î" : "Î",
"Ï" : "Ï",
"Ð" : "Ð",
"Ñ" : "Ñ",
"Ò" : "Ò",
"Ó" : "Ó",
"Ô" : "Ô",
"Õ" : "Õ",
"Ö" : "Ö",
"×" : "×",
"Ø" : "Ø",
"Ù" : "Ù",
"Ú" : "Ú",
"Û" : "Û",
"Ü" : "Ü",
"Ý" : "Ý",
"Þ" : "Þ",
"ß" : "ß",
"à" : "à",
"á" : "á",
"â" : "â",
"ã" : "ã",
"ä" : "ä",
"å" : "å",
"æ" : "æ",
"ç" : "ç",
"è" : "è",
"é" : "é",
"ê" : "ê",
"ë" : "ë",
"ì" : "ì",
"í" : "í",
"î" : "î",
"ï" : "ï",
"ð" : "ð",
"ñ" : "ñ",
"ò" : "ò",
"ó" : "ó",
"ô" : "ô",
"õ" : "õ",
"ö" : "ö",
"÷" : "÷",
"ø" : "ø",
"ù" : "ù",
"ú" : "ú",
"û" : "û",
"ü" : "ü",
"ý" : "ý",
"þ" : "þ",
"ÿ" : "ÿ",
"ƒ" : "ƒ",
"Α" : "Α",
"Β" : "Β",
"Γ" : "Γ",
"Δ" : "Δ",
"Ε" : "Ε",
"Ζ" : "Ζ",
"Η" : "Η",
"Θ" : "Θ",
"Ι" : "Ι",
"Κ" : "Κ",
"Λ" : "Λ",
"Μ" : "Μ",
"Ν" : "Ν",
"Ξ" : "Ξ",
"Ο" : "Ο",
"Π" : "Π",
"Ρ" : "Ρ",
"Σ" : "Σ",
"Τ" : "Τ",
"Υ" : "Υ",
"Φ" : "Φ",
"Χ" : "Χ",
"Ψ" : "Ψ",
"Ω" : "Ω",
"α" : "α",
"β" : "β",
"γ" : "γ",
"δ" : "δ",
"ε" : "ε",
"ζ" : "ζ",
"η" : "η",
"θ" : "θ",
"ι" : "ι",
"κ" : "κ",
"λ" : "λ",
"μ" : "μ",
"ν" : "ν",
"ξ" : "ξ",
"ο" : "ο",
"π" : "π",
"ρ" : "ρ",
"ς" : "ς",
"σ" : "σ",
"τ" : "τ",
"υ" : "υ",
"φ" : "φ",
"χ" : "χ",
"ψ" : "ψ",
"ω" : "ω",
"ϑ" : "ϑ",
"ϒ" : "ϒ",
"ϖ" : "ϖ",
"•" : "•",
"…" : "…",
"′" : "′",
"″" : "″",
"‾" : "‾",
"⁄" : "⁄",
"℘" : "℘",
"ℑ" : "ℑ",
"ℜ" : "ℜ",
"™" : "™",
"ℵ" : "ℵ",
"←" : "←",
"↑" : "↑",
"→" : "→",
"↓" : "↓",
"↔" : "↔",
"↵" : "↵",
"⇐" : "⇐",
"⇑" : "⇑",
"⇒" : "⇒",
"⇓" : "⇓",
"⇔" : "⇔",
"∀" : "∀",
"∂" : "∂",
"∃" : "∃",
"∅" : "∅",
"∇" : "∇",
"∈" : "∈",
"∉" : "∉",
"∋" : "∋",
"∏" : "∏",
"∑" : "∑",
"−" : "−",
"∗" : "∗",
"√" : "√",
"∝" : "∝",
"∞" : "∞",
"∠" : "∠",
"∧" : "∧",
"∨" : "∨",
"∩" : "∩",
"∪" : "∪",
"∫" : "∫",
"∴" : "∴",
"∼" : "∼",
"≅" : "≅",
"≈" : "≈",
"≠" : "≠",
"≡" : "≡",
"≤" : "≤",
"≥" : "≥",
"⊂" : "⊂",
"⊃" : "⊃",
"⊄" : "⊄",
"⊆" : "⊆",
"⊇" : "⊇",
"⊕" : "⊕",
"⊗" : "⊗",
"⊥" : "⊥",
"⋅" : "⋅",
"⌈" : "⌈",
"⌉" : "⌉",
"⌊" : "⌊",
"⌋" : "⌋",
"⟨" : "〈",
"⟩" : "〉",
"◊" : "◊",
"♠" : "♠",
"♣" : "♣",
"♥" : "♥",
"♦" : "♦",
""" : """,
"&" : "&",
"<" : "<",
">" : ">",
"Œ" : "Œ",
"œ" : "œ",
"Š" : "Š",
"š" : "š",
"Ÿ" : "Ÿ",
"ˆ" : "ˆ",
"˜" : "˜",
" " : " ",
" " : " ",
" " : " ",
"‌" : "‌",
"‍" : "‍",
"‎" : "‎",
"‏" : "‏",
"–" : "–",
"—" : "—",
"‘" : "‘",
"’" : "’",
"‚" : "‚",
"“" : "“",
"”" : "”",
"„" : "„",
"†" : "†",
"‡" : "‡",
"‰" : "‰",
"‹" : "‹",
"›" : "›",
"€" : "€"
};
| dnjuguna/refunite-todos | sites/todos/static/javascripts/core/gereji.entities.js | JavaScript | mit | 6,062 |
define(["./ToggleButtonBaseComponent","../lib/jquery"],function(e){var n=e.extend({getValue:function(){return"undefined"!=this.currentVal&&null!=this.currentVal?this.currentVal:this.placeholder("."+this.name+":checked").val()
}});return n}); | SteveSchafer-Innovent/innovent-pentaho-birt-plugin | js-lib/expanded/cdf/js/compressed/components/RadioComponent.js | JavaScript | epl-1.0 | 241 |
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update });
var filter;
var filter2;
var sprite;
function preload() {
// From http://glslsandbox.com/e#20450.0
game.load.shader('blueDots', 'assets/shaders/blue-dots.frag');
game.load.shader('bacteria', 'assets/shaders/bacteria.frag');
}
function create() {
filter = new Phaser.Filter(game, null, game.cache.getShader('blueDots'));
filter.setResolution(400, 600);
sprite = game.add.sprite();
sprite.width = 400;
sprite.height = 600;
sprite.filters = [ filter ];
filter2 = new Phaser.Filter(game, null, game.cache.getShader('bacteria'));
filter2.setResolution(400, 600);
var sprite2 = game.add.sprite(400);
sprite2.width = 400;
sprite2.height = 600;
sprite2.filters = [ filter2 ];
}
function update() {
filter.update();
filter2.update();
}
| boniatillo-com/PhaserEditor | source/phasereditor/phasereditor.resources.phaser.examples/phaser-examples-master/examples/filters/multiple shaders.js | JavaScript | epl-1.0 | 939 |
/*
* Copyright (c) 2015-2016 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Codenvy, S.A. - initial API and implementation
*/
'use strict';
/**
* @ngdoc controller
* @name workspaces.create.workspace.controller:CreateWorkspaceCtrl
* @description This class is handling the controller for workspace creation
* @author Ann Shumilova
* @author Oleksii Orel
*/
export class CreateWorkspaceCtrl {
/**
* Default constructor that is using resource
* @ngInject for Dependency injection
*/
constructor($location, cheAPI, cheNotification, lodash) {
this.$location = $location;
this.cheAPI = cheAPI;
this.cheNotification = cheNotification;
this.lodash = lodash;
this.selectSourceOption = 'select-source-recipe';
this.stack = {};
this.workspace = {};
// default RAM value for workspaces
this.workspaceRam = 1000;
this.editorOptions = {
lineWrapping: true,
lineNumbers: false,
matchBrackets: true,
mode: 'application/json'
};
// fetch default recipe if we haven't one
if (!cheAPI.getRecipeTemplate().getDefaultRecipe()) {
cheAPI.getRecipeTemplate().fetchDefaultRecipe();
}
this.stack = null;
this.recipeUrl = null;
this.recipeScript = null;
this.importWorkspace = '';
this.defaultWorkspaceName = null;
cheAPI.cheWorkspace.fetchWorkspaces();
}
/**
* Callback when tab has been change
* @param tabName the select tab name
*/
setStackTab(tabName) {
if (tabName === 'custom-stack') {
this.isCustomStack = true;
this.generateWorkspaceName();
}
}
/**
* Callback when stack has been set
* @param stack the selected stack
*/
cheStackLibrarySelecter(stack) {
if (stack) {
this.isCustomStack = false;
this.recipeUrl = null;
}
if (this.stack !== stack && stack && stack.workspaceConfig && stack.workspaceConfig.name) {
this.setWorkspaceName(stack.workspaceConfig.name);
} else {
this.generateWorkspaceName();
}
this.stack = stack;
}
/**
* Set workspace name
* @param name
*/
setWorkspaceName(name) {
if (!name) {
return;
}
if (!this.defaultWorkspaceName || this.defaultWorkspaceName === this.workspaceName) {
this.defaultWorkspaceName = name;
this.workspaceName = angular.copy(name);
}
}
/**
* Generates a default workspace name
*/
generateWorkspaceName() {
// starts with wksp
let name = 'wksp';
name += '-' + (('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4)); // jshint ignore:line
this.setWorkspaceName(name);
}
/**
* Create a new workspace
*/
createWorkspace() {
if (this.isCustomStack) {
this.stack = null;
if (this.recipeUrl && this.recipeUrl.length > 0) {
this.submitWorkspace();
} else {
let recipeName = 'rcp-' + (('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4)); // jshint ignore:line
// needs to get recipe URL from custom recipe
let promise = this.submitRecipe(recipeName, this.recipeScript);
promise.then((recipe) => {
let findLink = this.lodash.find(recipe.links, function (link) {
return link.rel === 'get recipe script';
});
if (findLink) {
this.recipeUrl = findLink.href;
this.submitWorkspace();
}
}, (error) => {
this.cheNotification.showError(error.data.message ? error.data.message : 'Error during recipe creation.');
});
}
} else if (this.selectSourceOption === 'select-source-import') {
let workspaceConfig = this.importWorkspace.length > 0 ? angular.fromJson(this.importWorkspace).config : {};
let creationPromise = this.cheAPI.getWorkspace().createWorkspaceFromConfig(null, workspaceConfig);
this.redirectAfterSubmitWorkspace(creationPromise);
} else {
//check predefined recipe location
if (this.stack && this.stack.source && this.stack.source.type === 'location') {
this.recipeUrl = this.stack.source.origin;
this.submitWorkspace();
} else {
// needs to get recipe URL from stack
let promise = this.computeRecipeForStack(this.stack);
promise.then((recipe) => {
let findLink = this.lodash.find(recipe.links, function (link) {
return link.rel === 'get recipe script';
});
if (findLink) {
this.recipeUrl = findLink.href;
this.submitWorkspace();
}
}, (error) => {
this.cheNotification.showError(error.data.message ? error.data.message : 'Error during recipe creation.');
});
}
}
}
/**
* User has selected a stack. needs to find or add recipe for that stack
* @param stack the selected stack
* @returns {*} the promise
*/
computeRecipeForStack(stack) {
let recipeSource = stack.source;
// look at recipe
let recipeName = 'generated-' + stack.name;
let recipeScript;
// what is type of source ?
switch (recipeSource.type.toLowerCase()) {
case 'image':
recipeScript = 'FROM ' + recipeSource.origin;
break;
case 'dockerfile':
recipeScript = recipeSource.origin;
break;
default:
throw 'Not implemented';
}
let promise = this.submitRecipe(recipeName, recipeScript);
return promise;
}
/**
* Create a new recipe
* @param recipeName the recipe name
* @param recipeScript the recipe script
* @returns {*} the promise
*/
submitRecipe(recipeName, recipeScript) {
let recipe = angular.copy(this.cheAPI.getRecipeTemplate().getDefaultRecipe());
if (!recipe) {
return;
}
recipe.name = recipeName;
recipe.script = recipeScript;
let promise = this.cheAPI.getRecipe().create(recipe);
return promise;
}
/**
* Submit a new workspace from current workspace name, recipe url and workspace ram
*/
submitWorkspace() {
let attributes = this.stack ? {stackId: this.stack.id} : {};
let creationPromise = this.cheAPI.getWorkspace().createWorkspace(null, this.workspaceName, this.recipeUrl, this.workspaceRam, attributes);
this.redirectAfterSubmitWorkspace(creationPromise);
}
/**
* Handle the redirect for the given promise after workspace has been created
* @param promise used to gather workspace data
*/
redirectAfterSubmitWorkspace(promise) {
promise.then((workspaceData) => {
let infoMessage = 'Workspace ' + workspaceData.config.name + ' successfully created.';
this.cheNotification.showInfo(infoMessage);
this.$location.path('/workspace/' + workspaceData.id);
}, (error) => {
let errorMessage = error.data.message ? error.data.message : 'Error during workspace creation.';
this.cheNotification.showError(errorMessage);
});
}
}
| alexVengrovsk/che | dashboard/src/app/workspaces/create-workspace/create-workspace.controller.js | JavaScript | epl-1.0 | 7,151 |
/*jslint browser: true */ /*global jQuery: true */
/**
* jQuery Cookie plugin
*
* Copyright (c) 2010 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
// TODO JsDoc
/**
* Create a cookie with the given key and value and other optional parameters.
*
* @example $.cookie( 'the_cookie', 'the_value' );
* @desc Set the value of a cookie.
* @example $.cookie( 'the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
* @desc Create a cookie with all available options.
* @example $.cookie( 'the_cookie', 'the_value' );
* @desc Create a session cookie.
* @example $.cookie( 'the_cookie', null);
* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
* used when the cookie was set.
*
* @param String key The key of the cookie.
* @param String value The value of the cookie.
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
* If set to null or omitted, the cookie will be a session cookie and will not be retained
* when the the browser exits.
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
* require a secure protocol (like HTTPS).
* @type undefined
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/[email protected]
*/
/**
* Get the value of a cookie with the given key.
*
* @example $.cookie( 'the_cookie' );
* @desc Get the value of a cookie.
*
* @param String key The key of the cookie.
* @return The value of the cookie.
* @type String
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/[email protected]
*/
jQuery.cookie = function (key, value, options) {
// key and value given, set cookie...
if (arguments.length > 1 && (value === null || typeof value !== "object")) {
options = jQuery.extend({}, options);
if (value === null) {
options.expires = -1;
}
if (typeof options.expires === 'number' ) {
var days = options.expires, t = options.expires = new Date();
t.setDate(t.getDate() + days);
}
return (document.cookie = [
encodeURIComponent(key), '=',
options.raw ? String(value) : encodeURIComponent(String(value)),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join( '' ));
}
// key and possibly options given, get cookie...
options = value || {};
var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
return (result = new RegExp( '(?:^|; )' + encodeURIComponent(key) + '=([^;]*)' ).exec(document.cookie)) ? decode(result[1]) : null;
};
jQuery( document ).ready(function() {
jQuery( document ).on( 'updated_checkout', function() {
jQuery( '#cielo-tabs' ).tabs( { cookie: { name: 'cielo-tabs', expires: 30 } } );
});
});
| ibrahimcesar/comercio-de-servicos | wp-content/plugins/cielo-woocommerce/js/jquery.cookie.js | JavaScript | gpl-2.0 | 3,868 |
/*
* (C) Copyright ${year} Nuxeo SA (http://nuxeo.com/) and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser General Public License
* (LGPL) version 2.1 which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-2.1.html
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"a.m.",
"p.m."
],
"DAY": [
"domingo",
"lunes",
"martes",
"mi\u00e9rcoles",
"jueves",
"viernes",
"s\u00e1bado"
],
"MONTH": [
"enero",
"febrero",
"marzo",
"abril",
"mayo",
"junio",
"julio",
"agosto",
"septiembre",
"octubre",
"noviembre",
"diciembre"
],
"SHORTDAY": [
"dom",
"lun",
"mar",
"mi\u00e9",
"jue",
"vie",
"s\u00e1b"
],
"SHORTMONTH": [
"ene",
"feb",
"mar",
"abr",
"may",
"jun",
"jul",
"ago",
"sep",
"oct",
"nov",
"dic"
],
"fullDate": "EEEE, d 'de' MMMM 'de' y",
"longDate": "d 'de' MMMM 'de' y",
"medium": "dd/MM/yyyy H:mm:ss",
"mediumDate": "dd/MM/yyyy",
"mediumTime": "H:mm:ss",
"short": "dd/MM/yy H:mm",
"shortDate": "dd/MM/yy",
"shortTime": "H:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "es-ec",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
| zhangzuoqiang/GoodHuddle | src/main/resources/static/admin/lib/angular-1.2.22/i18n/angular-locale_es-ec.js | JavaScript | gpl-2.0 | 2,576 |
'use strict';
var assert = require('chai').assert;
var Joi = require('joi');
var _ = require('../../../src/scripts/vendor/minified')._;
var HTML = require('../../../src/scripts/vendor/minified').HTML;
var components = require('../../../src/scripts/components');
var manipulators = require('../../../src/scripts/lib/manipulators');
var fixture = require('../../fixture');
var sinon = require('sinon');
var componentSchema = Joi.object().keys({
name: Joi.string().required(),
template: Joi.string().required(),
style: Joi.string().optional(),
manipulator: Joi.alternatives().try(
Joi.string().valid(Object.keys(manipulators)),
Joi.object().keys({
get: Joi.func().required(),
set: Joi.func().required()
}).required().unknown(true)
),
defaults: Joi.object().optional(),
initialize: Joi.func().optional()
}).unknown(true);
describe('components', function() {
_.eachObj(components, function(name, component) {
describe(name, function() {
it('has the correct structure', function() {
Joi.assert(component, componentSchema);
});
it('has all the necessary defaults', function() {
assert.doesNotThrow(function() {
HTML(component.template.trim(), component.defaults);
});
});
it('is able to be passed to ClayConfig', function() {
fixture.clayConfig([component.name]);
});
it('only has one $manipulatorTarget', function() {
var configItem = fixture.clayConfig([component.name]).getAllItems()[0];
assert.strictEqual(configItem.$manipulatorTarget.length, 1);
});
it('only dispatches change events once', function() {
var configItem = fixture.clayConfig([component.name]).getAllItems()[0];
var handler = sinon.spy();
configItem.on('change', handler);
configItem.trigger('change');
assert.strictEqual(handler.callCount, 1);
});
});
});
});
| keegan-lillo/pebble-clay | test/spec/components/index.js | JavaScript | gpl-2.0 | 1,940 |
describe("Sync.fetch",function(){
beforeEach(function(){
this.sync = new Sync({chunk:10});
this.sync.request = function(){
return new Promise(function(resolve,reject){
});
}
})
it("accept coordinates and return a Promise",function(){
expect(this.sync.fetch(0,0)).to.be.instanceof(Promise);
})
it("return the same promise while chain called",function(){
var p1 = this.sync.fetch(0,0);
var p2 = this.sync.fetch(0,0);
expect(p1).to.deep.equal(p2);
})
it("doesn't fire Sync.request twice",function(done){
this.sync.request = function(x,y){
done();
return true;
}
var p1 = this.sync.fetch(0,0);
var p2 = this.sync.fetch(0,0);
})
})
| klepthys/Maya | test/client/tests/test_sync_fetch.js | JavaScript | gpl-2.0 | 711 |
/*
Copyright (c) 2013, Oracle and/or its affiliates. All rights
reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2 of
the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
*/
"use strict";
var adapter = require(path.join(build_dir, "ndb_adapter.node")),
udebug = unified_debug.getLogger("NdbConnection.js"),
stats_module = require(path.join(api_dir,"stats.js")),
stats = stats_module.getWriter(["spi","ndb","NdbConnection"]),
QueuedAsyncCall = require("../common/QueuedAsyncCall.js").QueuedAsyncCall,
logReadyNodes;
/* NdbConnection represents a single connection to MySQL Cluster.
This connection may be shared by multiple DBConnectionPool objects
(for instance with different connection properties, or from different
application modules). Over in NdbConnectionPool.js, a table manages
a single back-end NdbConnection per unique NDB connect string, and
maintains the referenceCount stored here.
*/
function NdbConnection(connectString) {
var Ndb_cluster_connection = adapter.ndb.ndbapi.Ndb_cluster_connection;
this.ndb_cluster_connection = new Ndb_cluster_connection(connectString);
this.referenceCount = 1;
this.asyncNdbContext = null;
this.pendingConnections = [];
this.isConnected = false;
this.isDisconnecting = false;
this.execQueue = [];
this.ndb_cluster_connection.set_name("nodejs");
}
function logReadyNodes(ndb_cluster_connection, nnodes) {
var node_id;
if(nnodes < 0) {
stats.incr( [ "wait_until_ready","timeouts" ] );
}
else {
node_id = ndb_cluster_connection.node_id();
if(nnodes > 0) {
udebug.log_notice("Warning: only", nnodes, "data nodes are running.");
}
udebug.log_notice("Connected to cluster as node id:", node_id);
stats.push( [ "node_ids" ] , node_id);
}
return nnodes;
}
NdbConnection.prototype.connect = function(properties, callback) {
var self = this;
function runCallbacks(a, b) {
var i;
for(i = 0 ; i < self.pendingConnections.length ; i++) {
self.pendingConnections[i](a, b);
}
}
function onReady(cb_err, nnodes) {
logReadyNodes(self.ndb_cluster_connection, nnodes);
if(nnodes < 0) {
runCallbacks("Timeout waiting for cluster to become ready.", self);
}
else {
self.isConnected = true;
runCallbacks(null, self);
}
}
function onConnected(cb_err, rval) {
var err;
udebug.log("connect() onConnected rval =", rval);
if(rval === 0) {
stats.incr( [ "connections","successful" ]);
self.ndb_cluster_connection.wait_until_ready(1, 1, onReady);
}
else {
stats.incr( [ "connections","failed" ]);
err = new Error(self.ndb_cluster_connection.get_latest_error_msg());
err.sqlstate = "08000";
runCallbacks(err, self);
}
}
/* connect() starts here */
if(this.isConnected) {
stats.incr( [ "connect", "join" ] );
callback(null, this);
}
else {
this.pendingConnections.push(callback);
if(this.pendingConnections.length === 1) {
stats.incr( ["connect"] );
this.ndb_cluster_connection.connect(
properties.ndb_connect_retries, properties.ndb_connect_delay,
properties.ndb_connect_verbose, onConnected);
}
else {
stats.incr( [ "connect","queued" ] );
}
}
};
NdbConnection.prototype.getAsyncContext = function() {
var AsyncNdbContext = adapter.ndb.impl.AsyncNdbContext;
if(adapter.ndb.impl.MULTIWAIT_ENABLED) {
if(! this.asyncNdbContext) {
this.asyncNdbContext = new AsyncNdbContext(this.ndb_cluster_connection);
}
}
else if(this.asyncNdbContext == null) {
udebug.log_notice("NDB Async API support is disabled at build-time for " +
"MySQL Cluster 7.3.1 - 7.3.2. Async API will not be used."
);
this.asyncNdbContext = false;
}
return this.asyncNdbContext;
};
NdbConnection.prototype.close = function(userCallback) {
var self = this;
var nodeId = self.ndb_cluster_connection.node_id();
var apiCall;
function disconnect() {
if(self.asyncNdbContext) {
self.asyncNdbContext.delete(); // C++ Destructor
self.asyncNdbContext = null;
}
udebug.log_notice("Node", nodeId, "disconnecting.");
self.isConnected = false;
if(self.ndb_cluster_connection) {
apiCall = new QueuedAsyncCall(self.execQueue, userCallback);
apiCall.description = "DeleteNdbClusterConnection";
apiCall.ndb_cluster_connection = self.ndb_cluster_connection;
apiCall.run = function() {
this.ndb_cluster_connection.delete(this.callback);
};
apiCall.enqueue();
}
}
/* close() starts here */
if(! this.isConnected) {
disconnect(); /* Free Resources anyway */
}
else if(this.isDisconnecting) {
stats.incr("very_strange_simultaneous_disconnects");
}
else {
this.isDisconnecting = true;
/* Start by sending a "shutdown" message to the async listener thread */
if(this.asyncNdbContext) { this.asyncNdbContext.shutdown(); }
/* The AsyncNdbContext destructor is synchronous, in that it calls
pthread_join() on the listener thread. Nonetheless we want to
sleep here hoping the final async results will make their way
back to JavaScript.
*/
setTimeout(disconnect, 100); // milliseconds
}
};
module.exports = NdbConnection;
| ForcerKing/ShaoqunXu-mysql5.7 | storage/ndb/nodejs/Adapter/impl/ndb/NdbConnection.js | JavaScript | gpl-2.0 | 6,000 |
$(window).load(function(){FusionCharts.ready(function () {
var cpuGauge = new FusionCharts({
type: 'hlineargauge',
renderAt: 'chart-container',
id: 'cpu-linear-gauge',
width: '400',
height: '170',
dataFormat: 'json',
dataSource: {
"chart": {
"theme": "fint",
"caption": "Server CPU Utilization",
"lowerLimit": "0",
"upperLimit": "100",
"numberSuffix": "%",
"chartBottomMargin": "40",
"valueFontSize": "11",
"valueFontBold": "0",
"showValue": "0",
"gaugeFillMix":"{light-10},{light-70},{dark-10}",
"gaugeFillRatio":"40,20,40"
},
"colorRange": {
"color": [
{
"minValue": "0",
"maxValue": "35",
"label": "Low",
},
{
"minValue": "35",
"maxValue": "70",
"label": "Moderate",
},
{
"minValue": "70",
"maxValue": "100",
"label": "High",
}
]
},
"pointers": {
"pointer": [
{
"value": "75"
}
]
},
"annotations": {
"origw": "400",
"origh": "190",
"autoscale": "1",
"groups": [
{
"id": "range",
"items": [
{
"id": "rangeBg",
"type": "rectangle",
"x" : "$chartCenterX-70",
"y": "$chartEndY-35",
"tox": "$chartCenterX +70",
"toy": "$chartEndY-15",
"fillcolor": "#ff6650"
},
{
"id": "rangeText",
"type": "Text",
"fontSize": "11",
"fillcolor": "#000000",
"text": "Currently Utilizing 75%",
"x" : "$chartCenterX",
"y": "$chartEndY-25"
}
]
}
]
}
},
"events": {
"rendered" : function (evtObj, argObj){
var intervalVar = setInterval(function () {
var prcnt = 65 + parseInt( Math.floor(Math.random() * 10), 10);
FusionCharts.items["cpu-linear-gauge"].feedData("value="+prcnt);
}, 5000);
},
"realTimeUpdateComplete" : function (evt, arg){
var annotations = evt.sender.annotations,
percentValue = evt.sender.getData(1),
colorVal = "#" + ((percentValue > 70) ? "ff6650": "f6bd11" );
annotations && annotations.update('rangeText', {"text" : "Currently Utilizing "+percentValue+"%"});
annotations && annotations.update('rangeBg', {"fillcolor" : colorVal});
}
}
})
.render();
});}); | sguha-work/fiddletest | fiddles/Gauge/Listening-to-Events/Configuring-a-real-time-linear-gauge_213/demo.js | JavaScript | gpl-2.0 | 3,793 |
$('#google_map').gmap3(
{ action:'init',
options:{
center:[40.710443,-73.993996],
address: "Manhattan, NY 10002 30 ft N",
zoom: 16
}
},
{ action: 'addMarkers',
markers:[
{lat:40.710443, lng:-73.993996, data:'Manhattan, NY 10002 30 ft N'}
],
marker:{
options:{
draggable: false,
icon:new google.maps.MarkerImage("images/icons/Flag2LeftRed.png", new google.maps.Size(64, 64))
},
events:{
click: function(marker, event, data){
alert(data);
}
}
}
}
);
| devthuan/ffm | templates/fastfox/js/gmap.init.js | JavaScript | gpl-2.0 | 509 |
/**
* Kunena Component
* @package Kunena.Template.Crypsis
*
* @copyright (C) 2008 - 2017 Kunena Team. All rights reserved.
* @license https://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link https://www.kunena.org
**/
jQuery(document).ready(function($) {
/* Provide autocomplete user list in search form and in user list */
if ( $( '#kurl_users' ).length > 0 ) {
var users_url = $( '#kurl_users' ).val();
$('#kusersearch').atwho({
at: "",
displayTpl: '<li data-value="${name}"><img src="${photo}" width="20px" /> ${name} <small>(${name})</small></li>',
limit: 5,
callbacks: {
remoteFilter: function(query, callback) {
$.ajax({
url: users_url,
data: {
search : query
},
success: function(data) {
callback(data);
}
});
}
}
});
}
/* Hide search form when there are search results found */
if ( $('#kunena_search_results').is(':visible') ) {
$('#search').collapse("hide");
}
if (jQuery.fn.datepicker != undefined) {
jQuery('#searchatdate .input-append.date').datepicker({
orientation: "top auto"
});
}
});
| xsocket/knss | components/com_kunena/template/crypsis/assets/js/search.js | JavaScript | gpl-2.0 | 1,114 |
self.on("context", function (node) {
if(!window.bbsfox) {
return false;
}
//TODO: bbsfox.buf.PageState always == 0, if mouse browsering == false
let bbsfox = window.bbsfox;
let prefs = bbsfox.prefs;
if(!window.getSelection().isCollapsed && prefs.enableBlacklist && prefs.blacklistMenu) {
//check blacklist id
let selstr = window.getSelection().toString().toLowerCase();
if(selstr && selstr.indexOf('\n') == -1) {
selstr = selstr.replace(/^\s+|\s+$/g,'');
let userid = '';
let selection = bbsfox.view.getSelectionColRow();
//if(selection.start.row)
let rowText = bbsfox.buf.getRowText(selection.start.row, 0, bbsfox.buf.cols);
if (bbsfox.buf.PageState === 3 && bbsfox.isPTT()) {
userid = parsePushthreadForUserId(rowText);//
}
else if (bbsfox.buf.PageState === 2) {
userid = parseThreadForUserId(rowText);//
}
if (userid && selstr == userid) {
if( prefs.blacklistedUserIds.indexOf(userid) === -1 ) {
//not in blacklist, show item 'add to blacklist'
return true;
}
}
}
}
return false;
});
self.on("click", function(node, data) {
window.bbsfox.overlaycmd.exec({command:"addToBlacklist"});
});
| ettoolong/BBSFox-E10S | data/js/context-menu/blacklistAdd.js | JavaScript | gpl-2.0 | 1,247 |
/*
Copyright (c) 2004-2008, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
dojo._xdResourceLoaded(function(dojo, dijit, dojox){
return {depends: [["provide", "dijit.form.MultiSelect"],
["require", "dijit.form._FormWidget"]],
defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dijit.form.MultiSelect"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.form.MultiSelect"] = true;
dojo.provide("dijit.form.MultiSelect");
dojo.require("dijit.form._FormWidget");
dojo.declare("dijit.form.MultiSelect",dijit.form._FormWidget,{
// summary: Wrapper for a native select multiple="true" element to
// interact with dijit.form.Form
// size: Number
// Number of elements to display on a page
// NOTE: may be removed in version 2.0, since elements may have variable height;
// set the size via style="..." or CSS class names instead.
size: 7,
templateString: "<select multiple='true' name='${name}' dojoAttachPoint='containerNode,focusNode' dojoAttachEvent='onchange: _onChange'></select>",
attributeMap: dojo.mixin(dojo.clone(dijit.form._FormWidget.prototype.attributeMap),
{size:"focusNode"}),
reset: function(){
// TODO: once we inherit from FormValueWidget this won't be needed
this._hasBeenBlurred = false;
this._setValueAttr(this._resetValue, true);
},
addSelected: function(/* dijit.form.MultiSelect */select){
// summary: Move the selected nodes af an passed Select widget
// instance to this Select widget.
//
// example:
// | // move all the selected values from "bar" to "foo"
// | dijit.byId("foo").addSelected(dijit.byId("bar"));
select.getSelected().forEach(function(n){
this.containerNode.appendChild(n);
if(dojo.isIE){ // tweak the node to force IE to refresh (aka _layoutHack on FF2)
var s = dojo.getComputedStyle(n);
if(s){
var filter = s.filter;
n.style.filter = "alpha(opacity=99)";
n.style.filter = filter;
}
}
// scroll to bottom to see item
// cannot use scrollIntoView since <option> tags don't support all attributes
// does not work on IE due to a bug where <select> always shows scrollTop = 0
this.domNode.scrollTop = this.domNode.offsetHeight; // overshoot will be ignored
// scrolling the source select is trickier esp. on safari who forgets to change the scrollbar size
var oldscroll = select.domNode.scrollTop;
select.domNode.scrollTop = 0;
select.domNode.scrollTop = oldscroll;
},this);
},
getSelected: function(){
// summary: Access the NodeList of the selected options directly
return dojo.query("option",this.containerNode).filter(function(n){
return n.selected; // Boolean
});
},
_getValueAttr: function(){
// summary:
// Hook so attr('value') works.
// description:
// Returns an array of the selected options' values.
return this.getSelected().map(function(n){
return n.value;
});
},
_multiValue: true, // for Form
_setValueAttr: function(/* Array */values){
// summary:
// Hook so attr('value', values) works.
// description:
// Set the value(s) of this Select based on passed values
dojo.query("option",this.containerNode).forEach(function(n){
n.selected = (dojo.indexOf(values,n.value) != -1);
});
},
invertSelection: function(onChange){
// summary: Invert the selection
// onChange: Boolean
// If null, onChange is not fired.
dojo.query("option",this.containerNode).forEach(function(n){
n.selected = !n.selected;
});
this._handleOnChange(this.attr('value'), onChange==true);
},
_onChange: function(/*Event*/ e){
this._handleOnChange(this.attr('value'), true);
},
// for layout widgets:
resize: function(/* Object */size){
if(size){
dojo.marginBox(this.domNode, size);
}
},
postCreate: function(){
this._onChange();
}
});
}
}};});
| fedora-infra/packagedb | pkgdb/static/js/dijit/form/MultiSelect.xd.js | JavaScript | gpl-2.0 | 3,982 |
define({
root: ({
label: "Layer",
show: "Show",
actions: "Configure Layer Fields",
field: "Field",
alias: "Alias",
visible: "Visible",
linkField: "Link Field",
noLayers: "No feature layers are available",
back: "Back",
exportCSV: "Allow exporting to CSV",
restore: "Restore to default value",
ok: "OK",
result: "Saved successfully",
warning: "Check to show the layer in the table first.",
fieldCheckWarning: "At least one field must be selected.",
unsupportQueryWarning: "The layer needs to support query operation to display in Attribute Table widget. Make sure the query capability in the service is turned on.",
unsupportQueryLayers: "The following layer needs to support query operation to display in Attribute Table widget. Make sure the query capability in the service is turned on.",
fieldName: "Name",
fieldAlias: "Alias",
fieldVisibility: "Visibility",
fieldActions: "Actions"
}),
"ar": 1,
"cs": 1,
"da": 1,
"de": 1,
"el": 1,
"es": 1,
"et": 1,
"fi": 1,
"fr": 1,
"he": 1,
"it": 1,
"ja": 1,
"ko": 1,
"lt": 1,
"lv": 1,
"nb": 1,
"nl": 1,
"pl": 1,
"pt-br": 1,
"pt-pt": 1,
"ro": 1,
"ru": 1,
"sv": 1,
"th": 1,
"tr": 1,
"vi": 1,
"zh-cn": 1
}); | johnaagudelo/ofertaquequieres | visor-oferta/widgets/AttributeTable/setting/nls/strings.js | JavaScript | gpl-2.0 | 1,287 |
var searchData=
[
['open',['open',['../structdcdfort__reader_1_1dcdfile.html#adc8a28a9e2fd6a7178e31d06d1cfa29c',1,'dcdfort_reader::dcdfile::open()'],['../structdcdfort__writer_1_1dcdwriter.html#a369acf578a55fc421a094cf1000c4856',1,'dcdfort_writer::dcdwriter::open()'],['../structdcdfort__trajectory_1_1trajectory.html#ac721e469da3345e1138836a6a4772748',1,'dcdfort_trajectory::trajectory::open()']]]
];
| wesbarnett/dcdfort | docs/html/search/functions_7.js | JavaScript | gpl-2.0 | 404 |
/*
Copyright (c) 2004-2008, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit.layout.ContentPane"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.layout.ContentPane"] = true;
dojo.provide("dijit.layout.ContentPane");
dojo.require("dijit._Widget");
dojo.require("dijit.layout._LayoutWidget");
dojo.require("dojo.parser");
dojo.require("dojo.string");
dojo.require("dojo.html");
dojo.requireLocalization("dijit", "loading", null, "nb,ja,sk,sl,el,fr,da,pl,pt,he,fi,ko,th,zh,ru,de,zh-tw,cs,sv,ROOT,pt-pt,it,ar,nl,hu,es,tr,ca");
dojo.declare(
"dijit.layout.ContentPane",
dijit._Widget,
{
// summary:
// A widget that acts as a Container for other widgets, and includes a ajax interface
// description:
// A widget that can be used as a standalone widget
// or as a baseclass for other widgets
// Handles replacement of document fragment using either external uri or javascript
// generated markup or DOM content, instantiating widgets within that content.
// Don't confuse it with an iframe, it only needs/wants document fragments.
// It's useful as a child of LayoutContainer, SplitContainer, or TabContainer.
// But note that those classes can contain any widget as a child.
// example:
// Some quick samples:
// To change the innerHTML use .attr('content', '<b>new content</b>')
//
// Or you can send it a NodeList, .attr('content', dojo.query('div [class=selected]', userSelection))
// please note that the nodes in NodeList will copied, not moved
//
// To do a ajax update use .attr('href', url)
// href: String
// The href of the content that displays now.
// Set this at construction if you want to load data externally when the
// pane is shown. (Set preload=true to load it immediately.)
// Changing href after creation doesn't have any effect; use attr('href', ...);
href: "",
/*=====
// content: String
// The innerHTML of the ContentPane.
// Note that the initialization parameter / argument to attr("content", ...)
// can be a String, DomNode, Nodelist, or widget.
content: "",
=====*/
// extractContent: Boolean
// Extract visible content from inside of <body> .... </body>
extractContent: false,
// parseOnLoad: Boolean
// parse content and create the widgets, if any
parseOnLoad: true,
// preventCache: Boolean
// Cache content retreived externally
preventCache: false,
// preload: Boolean
// Force load of data even if pane is hidden.
preload: false,
// refreshOnShow: Boolean
// Refresh (re-download) content when pane goes from hidden to shown
refreshOnShow: false,
// loadingMessage: String
// Message that shows while downloading
loadingMessage: "<span class='dijitContentPaneLoading'>${loadingState}</span>",
// errorMessage: String
// Message that shows if an error occurs
errorMessage: "<span class='dijitContentPaneError'>${errorState}</span>",
// isLoaded: Boolean
// Tells loading status see onLoad|onUnload for event hooks
isLoaded: false,
baseClass: "dijitContentPane",
// doLayout: Boolean
// - false - don't adjust size of children
// - true - if there is a single visible child widget, set it's size to
// however big the ContentPane is
doLayout: true,
postMixInProperties: function(){
this.inherited(arguments);
var messages = dojo.i18n.getLocalization("dijit", "loading", this.lang);
this.loadingMessage = dojo.string.substitute(this.loadingMessage, messages);
this.errorMessage = dojo.string.substitute(this.errorMessage, messages);
},
buildRendering: function(){
this.inherited(arguments);
if(!this.containerNode){
// make getDescendants() work
this.containerNode = this.domNode;
}
},
postCreate: function(){
// remove the title attribute so it doesn't show up when i hover
// over a node
this.domNode.title = "";
if (!dijit.hasWaiRole(this.domNode)){
dijit.setWaiRole(this.domNode, "group");
}
dojo.addClass(this.domNode, this.baseClass);
},
startup: function(){
if(this._started){ return; }
if(this.doLayout != "false" && this.doLayout !== false){
this._checkIfSingleChild();
if(this._singleChild){
this._singleChild.startup();
}
}
this._loadCheck();
this.inherited(arguments);
},
_checkIfSingleChild: function(){
// summary:
// Test if we have exactly one visible widget as a child,
// and if so assume that we are a container for that widget,
// and should propogate startup() and resize() calls to it.
// Skips over things like data stores since they aren't visible.
var childNodes = dojo.query(">", this.containerNode),
childWidgetNodes = childNodes.filter(function(node){
return dojo.hasAttr(node, "dojoType") || dojo.hasAttr(node, "widgetId");
}),
candidateWidgets = dojo.filter(childWidgetNodes.map(dijit.byNode), function(widget){
return widget && widget.domNode && widget.resize;
});
if(
// all child nodes are widgets
childNodes.length == childWidgetNodes.length &&
// all but one are invisible (like dojo.data)
candidateWidgets.length == 1
){
this.isContainer = true;
this._singleChild = candidateWidgets[0];
}else{
delete this.isContainer;
delete this._singleChild;
}
},
refresh: function(){
// summary:
// Force a refresh (re-download) of content, be sure to turn off cache
// we return result of _prepareLoad here to avoid code dup. in dojox.layout.ContentPane
return this._prepareLoad(true);
},
setHref: function(/*String|Uri*/ href){
dojo.deprecated("dijit.layout.ContentPane.setHref() is deprecated. Use attr('href', ...) instead.", "", "2.0");
return this.attr("href", href);
},
_setHrefAttr: function(/*String|Uri*/ href){
// summary:
// Hook so attr("href", ...) works.
// description:
// Reset the (external defined) content of this pane and replace with new url
// Note: It delays the download until widget is shown if preload is false.
// href:
// url to the page you want to get, must be within the same domain as your mainpage
this.href = href;
// _setHrefAttr() is called during creation and by the user, after creation.
// only in the second case do we actually load the URL; otherwise it's done in startup()
if(this._created){
// we return result of _prepareLoad here to avoid code dup. in dojox.layout.ContentPane
return this._prepareLoad();
}
},
setContent: function(/*String|DomNode|Nodelist*/data){
dojo.deprecated("dijit.layout.ContentPane.setContent() is deprecated. Use attr('content', ...) instead.", "", "2.0");
this.attr("content", data);
},
_setContentAttr: function(/*String|DomNode|Nodelist*/data){
// summary:
// Hook to make attr("content", ...) work.
// Replaces old content with data content, include style classes from old content
// data:
// the new Content may be String, DomNode or NodeList
//
// if data is a NodeList (or an array of nodes) nodes are copied
// so you can import nodes from another document implicitly
// clear href so we cant run refresh and clear content
// refresh should only work if we downloaded the content
if(!this._isDownloaded){
this.href = "";
}
this._setContent(data || "");
this._isDownloaded = false; // must be set after _setContent(..), pathadjust in dojox.layout.ContentPane
if(this.doLayout != "false" && this.doLayout !== false){
this._checkIfSingleChild();
if(this._singleChild && this._singleChild.resize){
this._singleChild.startup();
var cb = this._contentBox || dojo.contentBox(this.containerNode);
this._singleChild.resize({w: cb.w, h: cb.h});
}
}
this._onLoadHandler();
},
_getContentAttr: function(){
// summary: hook to make attr("content") work
return this.containerNode.innerHTML;
},
cancel: function(){
// summary:
// Cancels a inflight download of content
if(this._xhrDfd && (this._xhrDfd.fired == -1)){
this._xhrDfd.cancel();
}
delete this._xhrDfd; // garbage collect
},
destroyRecursive: function(/*Boolean*/ preserveDom){
// summary:
// Destroy the ContentPane and it's contents
// if we have multiple controllers destroying us, bail after the first
if(this._beingDestroyed){
return;
}
this._beingDestroyed = true;
this.inherited(arguments);
},
resize: function(size){
dojo.marginBox(this.domNode, size);
// Compute content box size in case we [later] need to size child
// If either height or width wasn't specified by the user, then query node for it.
// But note that setting the margin box and then immediately querying dimensions may return
// inaccurate results, so try not to depend on it.
var node = this.containerNode,
mb = dojo.mixin(dojo.marginBox(node), size||{});
var cb = this._contentBox = dijit.layout.marginBox2contentBox(node, mb);
// If we have a single widget child then size it to fit snugly within my borders
if(this._singleChild && this._singleChild.resize){
// note: if widget has padding this._contentBox will have l and t set,
// but don't pass them to resize() or it will doubly-offset the child
this._singleChild.resize({w: cb.w, h: cb.h});
}
},
_prepareLoad: function(forceLoad){
// sets up for a xhrLoad, load is deferred until widget onShow
// cancels a inflight download
this.cancel();
this.isLoaded = false;
this._loadCheck(forceLoad);
},
_isShown: function(){
// summary: returns true if the content is currently shown
if("open" in this){
return this.open; // for TitlePane, etc.
}else{
var node = this.domNode;
return (node.style.display != 'none') && (node.style.visibility != 'hidden');
}
},
_loadCheck: function(/*Boolean*/ forceLoad){
// call this when you change onShow (onSelected) status when selected in parent container
// it's used as a trigger for href download when this.domNode.display != 'none'
// sequence:
// if no href -> bail
// forceLoad -> always load
// this.preload -> load when download not in progress, domNode display doesn't matter
// this.refreshOnShow -> load when download in progress bails, domNode display !='none' AND
// this.open !== false (undefined is ok), isLoaded doesn't matter
// else -> load when download not in progress, if this.open !== false (undefined is ok) AND
// domNode display != 'none', isLoaded must be false
var displayState = this._isShown();
if(this.href &&
(
forceLoad ||
(this.preload && !this.isLoaded && !this._xhrDfd) ||
(this.refreshOnShow && displayState && !this._xhrDfd) ||
(!this.isLoaded && displayState && !this._xhrDfd)
)
){
this._downloadExternalContent();
}
},
_downloadExternalContent: function(){
// display loading message
this._setContent(
this.onDownloadStart.call(this)
);
var self = this;
var getArgs = {
preventCache: (this.preventCache || this.refreshOnShow),
url: this.href,
handleAs: "text"
};
if(dojo.isObject(this.ioArgs)){
dojo.mixin(getArgs, this.ioArgs);
}
var hand = this._xhrDfd = (this.ioMethod || dojo.xhrGet)(getArgs);
hand.addCallback(function(html){
try{
self._isDownloaded = true;
self.attr.call(self, 'content', html); // onload event is called from here
self.onDownloadEnd.call(self);
}catch(err){
self._onError.call(self, 'Content', err); // onContentError
}
delete self._xhrDfd;
return html;
});
hand.addErrback(function(err){
if(!hand.cancelled){
// show error message in the pane
self._onError.call(self, 'Download', err); // onDownloadError
}
delete self._xhrDfd;
return err;
});
},
_onLoadHandler: function(){
// summary:
// This is called whenever new content is being loaded
this.isLoaded = true;
try{
this.onLoad.call(this);
}catch(e){
console.error('Error '+this.widgetId+' running custom onLoad code');
}
},
_onUnloadHandler: function(){
// summary:
// This is called whenever the content is being unloaded
this.isLoaded = false;
this.cancel();
try{
this.onUnload.call(this);
}catch(e){
console.error('Error '+this.widgetId+' running custom onUnload code');
}
},
destroyDescendants: function(){
// summary:
// Destroy all the widgets inside the ContentPane and empty containerNode
// Make sure we call onUnload
// TODO: this shouldn't be called when we are simply destroying a "Loading..." message
this._onUnloadHandler();
// dojo.html._ContentSetter keeps track of child widgets, so we should use it to
// destroy them.
//
// Only exception is when those child widgets were specified in original page markup
// and created by the parser (in which case _ContentSetter doesn't know what the widgets
// are). Then we need to call Widget.destroyDescendants().
//
// Note that calling Widget.destroyDescendants() has various issues (#6954),
// namely that popup widgets aren't destroyed (#2056, #4980)
// and the widgets in templates are destroyed twice (#7706)
var setter = this._contentSetter;
if(setter){
// calling empty destroys all child widgets as well as emptying the containerNode
setter.empty();
}else{
this.inherited(arguments);
dojo.html._emptyNode(this.containerNode);
}
},
_setContent: function(cont){
// summary:
// Insert the content into the container node
// first get rid of child widgets
this.destroyDescendants();
// dojo.html.set will take care of the rest of the details
// we provide an overide for the error handling to ensure the widget gets the errors
// configure the setter instance with only the relevant widget instance properties
// NOTE: unless we hook into attr, or provide property setters for each property,
// we need to re-configure the ContentSetter with each use
var setter = this._contentSetter;
if(! (setter && setter instanceof dojo.html._ContentSetter)) {
setter = this._contentSetter = new dojo.html._ContentSetter({
node: this.containerNode,
_onError: dojo.hitch(this, this._onError),
onContentError: dojo.hitch(this, function(e){
// fires if a domfault occurs when we are appending this.errorMessage
// like for instance if domNode is a UL and we try append a DIV
var errMess = this.onContentError(e);
try{
this.containerNode.innerHTML = errMess;
}catch(e){
console.error('Fatal '+this.id+' could not change content due to '+e.message, e);
}
})/*,
_onError */
});
};
var setterParams = dojo.mixin({
cleanContent: this.cleanContent,
extractContent: this.extractContent,
parseContent: this.parseOnLoad
}, this._contentSetterParams || {});
dojo.mixin(setter, setterParams);
setter.set( (dojo.isObject(cont) && cont.domNode) ? cont.domNode : cont );
// setter params must be pulled afresh from the ContentPane each time
delete this._contentSetterParams;
},
_onError: function(type, err, consoleText){
// shows user the string that is returned by on[type]Error
// overide on[type]Error and return your own string to customize
var errText = this['on' + type + 'Error'].call(this, err);
if(consoleText){
console.error(consoleText, err);
}else if(errText){// a empty string won't change current content
this._setContent.call(this, errText);
}
},
_createSubWidgets: function(){
// summary: scan my contents and create subwidgets
try{
dojo.parser.parse(this.containerNode, true);
}catch(e){
this._onError('Content', e, "Couldn't create widgets in "+this.id
+(this.href ? " from "+this.href : ""));
}
},
// EVENT's, should be overide-able
onLoad: function(e){
// summary:
// Event hook, is called after everything is loaded and widgetified
},
onUnload: function(e){
// summary:
// Event hook, is called before old content is cleared
},
onDownloadStart: function(){
// summary:
// called before download starts
// the string returned by this function will be the html
// that tells the user we are loading something
// override with your own function if you want to change text
return this.loadingMessage;
},
onContentError: function(/*Error*/ error){
// summary:
// called on DOM faults, require fault etc in content
// default is to display errormessage inside pane
},
onDownloadError: function(/*Error*/ error){
// summary:
// Called when download error occurs, default is to display
// errormessage inside pane. Overide function to change that.
// The string returned by this function will be the html
// that tells the user a error happend
return this.errorMessage;
},
onDownloadEnd: function(){
// summary:
// called when download is finished
}
});
}
| fedora-infra/packagedb | pkgdb/static/js/dijit/layout/ContentPane.js | JavaScript | gpl-2.0 | 16,808 |
Drupal.behaviors.mn_core_behavior_popup = function(context) {
var data = $(context).data('openlayers');
if (data && data.map.behaviors.mn_core_behavior_popup) {
// Collect vector layers
var vector_layers = [];
for (var key in data.openlayers.layers) {
var layer = data.openlayers.layers[key];
if (layer.isVector === true) {
vector_layers.push(layer);
}
}
// Add control
var control = new OpenLayers.Control.SelectFeature(
vector_layers,
{
activeByDefault: true,
highlightOnly: false,
multiple: false,
hover: false,
callbacks: {
'over': Drupal.mn_core_behavior_popup.over,
'out': Drupal.mn_core_behavior_popup.out,
'click': Drupal.mn_core_behavior_popup.openPopup
}
}
);
data.openlayers.addControl(control);
control.activate();
}
else if ($(context).is('.openlayers-popupbox')) {
// Popup close
$('a.popup-close', context).click(function() {
$(this).parents('.openlayers-popupbox').fadeOut('fast', function() { $(this).remove(); });
return false;
});
// Set initial pager state
Drupal.mn_core_behavior_popup.pager(context, 'set');
// Next link
$('ul.popup-links a.next', context).click(function() {
var context = $(this).parents('.openlayers-popupbox');
Drupal.mn_core_behavior_popup.pager(context, 'next');
});
// Prev link
$('ul.popup-links a.prev', context).click(function() {
var context = $(this).parents('.openlayers-popupbox');
Drupal.mn_core_behavior_popup.pager(context, 'prev');
});
}
};
Drupal.mn_core_behavior_popup = {
// Pager actions
'pager': function(context, op) {
var active = $('li.openlayers-popupbox-active', context);
var index = $('div.item-list > ul > li', context).index(active);
var total = $('div.item-list > ul > li', context).size();
switch (op) {
case 'set':
if (active.size() === 0) {
index = 0;
$('div.item-list > ul > li', context).hide();
$('div.item-list > ul > li:first', context).addClass('openlayers-popupbox-active').show();
$('ul.popup-links a.prev', context).addClass('disabled');
if (total <= 1) {
$('ul.popup-links', context).hide();
}
}
else {
if (index === 0) {
$('ul.popup-links a.prev', context).addClass('disabled');
$('ul.popup-links a.next', context).removeClass('disabled');
}
else if (index == (total - 1)) {
$('ul.popup-links a.next', context).addClass('disabled');
$('ul.popup-links a.prev', context).removeClass('disabled');
}
else {
$('ul.popup-links a.next', context).removeClass('disabled');
$('ul.popup-links a.prev', context).removeClass('disabled');
}
}
var count = parseInt(index + 1, 10) + ' / ' + parseInt(total, 10);
$('span.count', context).text(count);
break;
case 'next':
if (index < (total - 1)) {
active.removeClass('openlayers-popupbox-active').hide()
.next('li').addClass('openlayers-popupbox-active').show();
Drupal.mn_core_behavior_popup.pager(context, 'set');
}
break;
case 'prev':
if (index > 0) {
active.removeClass('openlayers-popupbox-active').hide()
.prev('li').addClass('openlayers-popupbox-active').show();
Drupal.mn_core_behavior_popup.pager(context, 'set');
}
break;
}
},
// Click state
'openPopup': function(feature) {
var context = $(feature.layer.map.div);
// Initialize popup
if (!$('.openlayers-popupbox', context).size()) {
context.append("<div class='openlayers-popupbox popup'></div>");
}
else {
$('.openlayers-popupbox:not(.popup)').addClass('popup');
}
// Hide the layer switcher if it's open.
for (var key in context.data('openlayers').openlayers.controls) {
if (context.data('openlayers').openlayers.controls[key].CLASS_NAME == "OpenLayers.Control.LayerSwitcherPlus") {
context.data('openlayers').openlayers.controls[key].minimizeControl();
}
}
var text;
text = "<a href='#close' class='popup-close'>X</a>";
text += "<h2 class='popup-title'>" + feature.attributes.name + "</h2>";
text += "<div class='popup-content'>" + feature.attributes.description + "</div>";
text += "<div class='popup-pager'><ul class='links popup-links'><li><a class='prev' href='#prev'>Prev</a></li><li><a class='next' href='#next'>Next</a></li></ul><span class='count'></span></div>";
$('.openlayers-popupbox', context).html(text).show();
Drupal.attachBehaviors($('.openlayers-popupbox', context));
},
// Callback for hover state
// Only show tooltips on hover if the story popup is not open.
'over': function(feature) {
var context = $(feature.layer.map.div);
if (!$('.openlayers-popupbox.popup', context).size()) {
if (feature.attributes.name) {
var text = "<div class='openlayers-popupbox'>";
text += "<h2 class='popup-title'>" + feature.attributes.name + "</h2>";
text += "<div class='popup-count'>" + parseInt(feature.attributes.count, 10) + "</div>";
text += "</div>";
context.append(text);
}
}
},
// Call back for out state.
'out': function(feature) {
var context = $(feature.layer.map.div);
$('.openlayers-popupbox:not(.popup)', context).fadeOut('fast', function() { $(this).remove(); });
}
};
| zzolo/drupaldaze.com | profiles/managingnews/modules/features/mn_core/behaviors/mn_core_behavior_popup.js | JavaScript | gpl-2.0 | 5,637 |
var util = require("util");
var choreography = require("temboo/core/choreography");
/*
CreateRun
Creates an action that represents a user running a course.
*/
var CreateRun = function(session) {
/*
Create a new instance of the CreateRun Choreo. A TembooSession object, containing a valid
set of Temboo credentials, must be supplied.
*/
var location = "/Library/Facebook/Actions/Fitness/Runs/CreateRun"
CreateRun.super_.call(this, session, location);
/*
Define a callback that will be used to appropriately format the results of this Choreo.
*/
var newResultSet = function(resultStream) {
return new CreateRunResultSet(resultStream);
}
/*
Obtain a new InputSet object, used to specify the input values for an execution of this Choreo.
*/
this.newInputSet = function() {
return new CreateRunInputSet();
}
/*
Execute this Choreo with the specified inputs, calling the specified callback upon success,
and the specified errorCallback upon error.
*/
this.execute = function(inputs, callback, errorCallback) {
this._execute(inputs, newResultSet, callback, errorCallback);
}
}
/*
An InputSet with methods appropriate for specifying the inputs to the CreateRun
Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
*/
var CreateRunInputSet = function() {
CreateRunInputSet.super_.call(this);
/*
Set the value of the AccessToken input for this Choreo. ((required, string) The access token retrieved from the final step of the OAuth process.)
*/
this.set_AccessToken = function(value) {
this.setInput("AccessToken", value);
}
/*
Set the value of the Course input for this Choreo. ((required, string) The URL or ID for an Open Graph object representing the course.)
*/
this.set_Course = function(value) {
this.setInput("Course", value);
}
/*
Set the value of the CreatedTime input for this Choreo. ((optional, date) The time that the action was created (e.g. 2013-06-24T18:53:35+0000).)
*/
this.set_CreatedTime = function(value) {
this.setInput("CreatedTime", value);
}
/*
Set the value of the EndTime input for this Choreo. ((optional, date) The time that the user ended the action (e.g. 2013-06-24T18:53:35+0000).)
*/
this.set_EndTime = function(value) {
this.setInput("EndTime", value);
}
/*
Set the value of the ExpiresIn input for this Choreo. ((optional, integer) The amount of time (in milliseconds) from the publish_time that the action will expire.)
*/
this.set_ExpiresIn = function(value) {
this.setInput("ExpiresIn", value);
}
/*
Set the value of the ExplicitlyShared input for this Choreo. ((optional, boolean) Indicates that the user is explicitly sharing this action. Requires the explicitly_shared capability to be enabled.)
*/
this.set_ExplicitlyShared = function(value) {
this.setInput("ExplicitlyShared", value);
}
/*
Set the value of the ExplicityShared input for this Choreo. ((optional, boolean) Deprecated (retained for backward compatibility only).)
*/
this.set_ExplicityShared = function(value) {
this.setInput("ExplicityShared", value);
}
/*
Set the value of the Message input for this Choreo. ((optional, string) A message attached to this action. Setting this parameter requires enabling of message capabilities.)
*/
this.set_Message = function(value) {
this.setInput("Message", value);
}
/*
Set the value of the NoFeedStory input for this Choreo. ((optional, boolean) Whether or not this action should be posted to the users feed.)
*/
this.set_NoFeedStory = function(value) {
this.setInput("NoFeedStory", value);
}
/*
Set the value of the Place input for this Choreo. ((optional, string) The URL or ID for an Open Graph object representing the location associated with this action.)
*/
this.set_Place = function(value) {
this.setInput("Place", value);
}
/*
Set the value of the ProfileID input for this Choreo. ((optional, string) The id of the user's profile. Defaults to "me" indicating the authenticated user.)
*/
this.set_ProfileID = function(value) {
this.setInput("ProfileID", value);
}
/*
Set the value of the Reference input for this Choreo. ((optional, string) A string identifier up to 50 characters used for tracking and insights.)
*/
this.set_Reference = function(value) {
this.setInput("Reference", value);
}
/*
Set the value of the ResponseFormat input for this Choreo. ((optional, string) The format that the response should be in. Can be set to xml or json. Defaults to json.)
*/
this.set_ResponseFormat = function(value) {
this.setInput("ResponseFormat", value);
}
/*
Set the value of the StartTime input for this Choreo. ((optional, date) The time that the user started the action (e.g. 2013-06-24T18:53:35+0000).)
*/
this.set_StartTime = function(value) {
this.setInput("StartTime", value);
}
/*
Set the value of the Tags input for this Choreo. ((optional, string) A comma separated list of other profile IDs that also performed this action.)
*/
this.set_Tags = function(value) {
this.setInput("Tags", value);
}
}
/*
A ResultSet with methods tailored to the values returned by the CreateRun Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution.
*/
var CreateRunResultSet = function(resultStream) {
CreateRunResultSet.super_.call(this, resultStream);
/*
Retrieve the value for the "Response" output from this Choreo execution. (The response from Facebook. Corresponds to the ResponseFormat input. Defaults to JSON.)
*/
this.get_Response = function() {
return this.getResult("Response");
}
/*
Retrieve the value for the "ActivityURL" output from this Choreo execution. ((string) The URL for the newly created action.)
*/
this.get_ActivityURL = function() {
return this.getResult("ActivityURL");
}
}
util.inherits(CreateRun, choreography.Choreography);
util.inherits(CreateRunInputSet, choreography.InputSet);
util.inherits(CreateRunResultSet, choreography.ResultSet);
exports.CreateRun = CreateRun;
/*
DeleteRun
Deletes a given run action.
*/
var DeleteRun = function(session) {
/*
Create a new instance of the DeleteRun Choreo. A TembooSession object, containing a valid
set of Temboo credentials, must be supplied.
*/
var location = "/Library/Facebook/Actions/Fitness/Runs/DeleteRun"
DeleteRun.super_.call(this, session, location);
/*
Define a callback that will be used to appropriately format the results of this Choreo.
*/
var newResultSet = function(resultStream) {
return new DeleteRunResultSet(resultStream);
}
/*
Obtain a new InputSet object, used to specify the input values for an execution of this Choreo.
*/
this.newInputSet = function() {
return new DeleteRunInputSet();
}
/*
Execute this Choreo with the specified inputs, calling the specified callback upon success,
and the specified errorCallback upon error.
*/
this.execute = function(inputs, callback, errorCallback) {
this._execute(inputs, newResultSet, callback, errorCallback);
}
}
/*
An InputSet with methods appropriate for specifying the inputs to the DeleteRun
Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
*/
var DeleteRunInputSet = function() {
DeleteRunInputSet.super_.call(this);
/*
Set the value of the AccessToken input for this Choreo. ((required, string) The access token retrieved from the final step of the OAuth process.)
*/
this.set_AccessToken = function(value) {
this.setInput("AccessToken", value);
}
/*
Set the value of the ActionID input for this Choreo. ((required, string) The id of an action to delete.)
*/
this.set_ActionID = function(value) {
this.setInput("ActionID", value);
}
}
/*
A ResultSet with methods tailored to the values returned by the DeleteRun Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution.
*/
var DeleteRunResultSet = function(resultStream) {
DeleteRunResultSet.super_.call(this, resultStream);
/*
Retrieve the value for the "Response" output from this Choreo execution. ((boolean) The response from Facebook. Returns "true" on success.)
*/
this.get_Response = function() {
return this.getResult("Response");
}
}
util.inherits(DeleteRun, choreography.Choreography);
util.inherits(DeleteRunInputSet, choreography.InputSet);
util.inherits(DeleteRunResultSet, choreography.ResultSet);
exports.DeleteRun = DeleteRun;
/*
ReadRuns
Retrieves one or more run actions.
*/
var ReadRuns = function(session) {
/*
Create a new instance of the ReadRuns Choreo. A TembooSession object, containing a valid
set of Temboo credentials, must be supplied.
*/
var location = "/Library/Facebook/Actions/Fitness/Runs/ReadRuns"
ReadRuns.super_.call(this, session, location);
/*
Define a callback that will be used to appropriately format the results of this Choreo.
*/
var newResultSet = function(resultStream) {
return new ReadRunsResultSet(resultStream);
}
/*
Obtain a new InputSet object, used to specify the input values for an execution of this Choreo.
*/
this.newInputSet = function() {
return new ReadRunsInputSet();
}
/*
Execute this Choreo with the specified inputs, calling the specified callback upon success,
and the specified errorCallback upon error.
*/
this.execute = function(inputs, callback, errorCallback) {
this._execute(inputs, newResultSet, callback, errorCallback);
}
}
/*
An InputSet with methods appropriate for specifying the inputs to the ReadRuns
Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
*/
var ReadRunsInputSet = function() {
ReadRunsInputSet.super_.call(this);
/*
Set the value of the AccessToken input for this Choreo. ((required, string) The access token retrieved from the final step of the OAuth process.)
*/
this.set_AccessToken = function(value) {
this.setInput("AccessToken", value);
}
/*
Set the value of the ActionID input for this Choreo. ((optional, string) The id of an action to retrieve. If an id is not provided, a list of all run actions will be returned.)
*/
this.set_ActionID = function(value) {
this.setInput("ActionID", value);
}
/*
Set the value of the Fields input for this Choreo. ((optional, string) A comma separated list of fields to return (i.e. id,name).)
*/
this.set_Fields = function(value) {
this.setInput("Fields", value);
}
/*
Set the value of the Limit input for this Choreo. ((optional, integer) Used to page through results. Limits the number of records returned in the response.)
*/
this.set_Limit = function(value) {
this.setInput("Limit", value);
}
/*
Set the value of the Offset input for this Choreo. ((optional, integer) Used to page through results. Returns results starting from the specified number.)
*/
this.set_Offset = function(value) {
this.setInput("Offset", value);
}
/*
Set the value of the ProfileID input for this Choreo. ((optional, string) The id of the user's profile. Defaults to "me" indicating the authenticated user.)
*/
this.set_ProfileID = function(value) {
this.setInput("ProfileID", value);
}
/*
Set the value of the ResponseFormat input for this Choreo. ((optional, string) The format that the response should be in. Can be set to xml or json. Defaults to json.)
*/
this.set_ResponseFormat = function(value) {
this.setInput("ResponseFormat", value);
}
}
/*
A ResultSet with methods tailored to the values returned by the ReadRuns Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution.
*/
var ReadRunsResultSet = function(resultStream) {
ReadRunsResultSet.super_.call(this, resultStream);
/*
Retrieve the value for the "Response" output from this Choreo execution. (The response from Facebook. Corresponds to the ResponseFormat input. Defaults to JSON.)
*/
this.get_Response = function() {
return this.getResult("Response");
}
/*
Retrieve the value for the "HasNext" output from this Choreo execution. ((boolean) A boolean flag indicating that a next page exists.)
*/
this.get_HasNext = function() {
return this.getResult("HasNext");
}
/*
Retrieve the value for the "HasPrevious" output from this Choreo execution. ((boolean) A boolean flag indicating that a previous page exists.)
*/
this.get_HasPrevious = function() {
return this.getResult("HasPrevious");
}
}
util.inherits(ReadRuns, choreography.Choreography);
util.inherits(ReadRunsInputSet, choreography.InputSet);
util.inherits(ReadRunsResultSet, choreography.ResultSet);
exports.ReadRuns = ReadRuns;
/*
UpdateRun
Updates an existing run action.
*/
var UpdateRun = function(session) {
/*
Create a new instance of the UpdateRun Choreo. A TembooSession object, containing a valid
set of Temboo credentials, must be supplied.
*/
var location = "/Library/Facebook/Actions/Fitness/Runs/UpdateRun"
UpdateRun.super_.call(this, session, location);
/*
Define a callback that will be used to appropriately format the results of this Choreo.
*/
var newResultSet = function(resultStream) {
return new UpdateRunResultSet(resultStream);
}
/*
Obtain a new InputSet object, used to specify the input values for an execution of this Choreo.
*/
this.newInputSet = function() {
return new UpdateRunInputSet();
}
/*
Execute this Choreo with the specified inputs, calling the specified callback upon success,
and the specified errorCallback upon error.
*/
this.execute = function(inputs, callback, errorCallback) {
this._execute(inputs, newResultSet, callback, errorCallback);
}
}
/*
An InputSet with methods appropriate for specifying the inputs to the UpdateRun
Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
*/
var UpdateRunInputSet = function() {
UpdateRunInputSet.super_.call(this);
/*
Set the value of the AccessToken input for this Choreo. ((required, string) The access token retrieved from the final step of the OAuth process.)
*/
this.set_AccessToken = function(value) {
this.setInput("AccessToken", value);
}
/*
Set the value of the ActionID input for this Choreo. ((required, string) The id of the action to update.)
*/
this.set_ActionID = function(value) {
this.setInput("ActionID", value);
}
/*
Set the value of the Course input for this Choreo. ((optional, string) The URL or ID for an Open Graph object representing the course.)
*/
this.set_Course = function(value) {
this.setInput("Course", value);
}
/*
Set the value of the EndTime input for this Choreo. ((optional, date) The time that the user ended the action (e.g. 2013-06-24T18:53:35+0000).)
*/
this.set_EndTime = function(value) {
this.setInput("EndTime", value);
}
/*
Set the value of the ExpiresIn input for this Choreo. ((optional, integer) The amount of time (in milliseconds) from the publish_time that the action will expire.)
*/
this.set_ExpiresIn = function(value) {
this.setInput("ExpiresIn", value);
}
/*
Set the value of the Message input for this Choreo. ((optional, string) A message attached to this action. Setting this parameter requires enabling of message capabilities.)
*/
this.set_Message = function(value) {
this.setInput("Message", value);
}
/*
Set the value of the Place input for this Choreo. ((optional, string) The URL or ID for an Open Graph object representing the location associated with this action.)
*/
this.set_Place = function(value) {
this.setInput("Place", value);
}
/*
Set the value of the Tags input for this Choreo. ((optional, string) A comma separated list of other profile IDs that also performed this action.)
*/
this.set_Tags = function(value) {
this.setInput("Tags", value);
}
}
/*
A ResultSet with methods tailored to the values returned by the UpdateRun Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution.
*/
var UpdateRunResultSet = function(resultStream) {
UpdateRunResultSet.super_.call(this, resultStream);
/*
Retrieve the value for the "Response" output from this Choreo execution. ((boolean) The response from Facebook.)
*/
this.get_Response = function() {
return this.getResult("Response");
}
}
util.inherits(UpdateRun, choreography.Choreography);
util.inherits(UpdateRunInputSet, choreography.InputSet);
util.inherits(UpdateRunResultSet, choreography.ResultSet);
exports.UpdateRun = UpdateRun;
| shoultzy/tempProject | node_modules/temboo/Library/Facebook/Actions/Fitness/Runs.js | JavaScript | gpl-2.0 | 18,378 |
Ext.ns('ezScrum');
ezScrum.ProjectLeftPanel = Ext.extend(ezScrum.projectLeftTree.treePanel, {
collapsible : true,
collapseMode :'mini',
animCollapse : false,
animate : false,
hideCollapseTool: true,
id : 'projectleftside',
ref : 'projectleftside_refID',
lines : false,
rootVisible : false,
autoScroll : true,
root: {
nodeType : 'node',
text : 'Root',
expanded : true,
draggable : false
},
loader: new Ext.tree.TreeLoader({
dataUrl: 'GetProjectLeftTreeItem.do'
}),
initComponent : function() {
ezScrum.ProjectLeftPanel.superclass.initComponent.apply(this, arguments);
this.loadDataModel();
},
loadDataModel: function() {
this.getLoader().load(this.root);
}
}); | ezScrum/ezScrum | WebContent/javascript/ezScrumLayout/ProjectLeftTreePanel.js | JavaScript | gpl-2.0 | 738 |
/**
* String tests based on profiled data.
*/
var stringWeighted = {
version: 1,
init: function() {
},
run: function() {
var s0 = "Nulla blandit congue odio. Cras rutrum nulla a est. Sed eros ligula, blandit in, aliquet id.";
var s1 = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
var s2 = "Proin varius justo vitae dolor.";
var s3 = "Aliquam sed eros. Maecenas viverra. Duis risus enim, rhoncus posuere, sagittis tincidunt.";
var s4 = "Ullamcorper at, purus. Quisque in lectus vitae tortor rhoncus dictum. Ut molestie semper sapien. ";
var s5 = "Suspendisse potenti. Sed quis elit. Suspendisse potenti. Aenean sodales.";
var s6 = "Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. ";
var s7 = "Phasellus pulvinar venenatis augue. Suspendisse mi. Suspendisse id velit. ";
var s8 = "Proin eleifend pharetra augue. Praesent vestibulum metus vitae pede.";
var s9 = "Cras augue lectus, venenatis sed, molestie viverra, ornare at, justo. ";
// Higlight word.
var r = "tortor";
var r2 = "<b>tortor</b>";
s0.replace(r, r2);
s1.replace(r, r2);
s2.replace(r, r2);
s3.replace(r, r2);
s4.replace(r, r2);
s5.replace(r, r2);
s6.replace(r, r2);
s7.replace(r, r2);
s8.replace(r, r2);
s9.replace(r, r2);
// Split to words.
var words = s0.split(" ");
var words = s1.split(" ");
var words = s2.split(" ");
var words = s3.split(" ");
var words = s4.split(" ");
var words = s5.split(" ");
var words = s6.split(" ");
var words = s7.split(" ");
var words = s8.split(" ");
var words = s9.split(" ");
// Look for words.
var f0 = s0.indexOf("odio");
var f1 = s1.indexOf("dolor");
var f2 = s2.indexOf("vitae");
var f3 = s3.indexOf("eros");
var f4 = s4.indexOf("ad");
}
}
| sloanyang/BrowserBenchmark | Peacekeeper/peacekeeper2/js/tests/string/stringWeighted.js | JavaScript | gpl-2.0 | 1,811 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/*!
* Copyright 2016 Amazon.com,
* Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Amazon Software License (the "License").
* You may not use this file except in compliance with the
* License. A copy of the License is located at
*
* http://aws.amazon.com/asl/
*
* or in the "license" file accompanying this file. This file is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, express or implied. See the License
* for the specific language governing permissions and
* limitations under the License.
*/
var monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
var weekNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
/** @class */
var DateHelper = function () {
function DateHelper() {
_classCallCheck(this, DateHelper);
}
/**
* @returns {string} The current time in "ddd MMM D HH:mm:ss UTC YYYY" format.
*/
DateHelper.prototype.getNowString = function getNowString() {
var now = new Date();
var weekDay = weekNames[now.getUTCDay()];
var month = monthNames[now.getUTCMonth()];
var day = now.getUTCDate();
var hours = now.getUTCHours();
if (hours < 10) {
hours = '0' + hours;
}
var minutes = now.getUTCMinutes();
if (minutes < 10) {
minutes = '0' + minutes;
}
var seconds = now.getUTCSeconds();
if (seconds < 10) {
seconds = '0' + seconds;
}
var year = now.getUTCFullYear();
// ddd MMM D HH:mm:ss UTC YYYY
var dateNow = weekDay + ' ' + month + ' ' + day + ' ' + hours + ':' + minutes + ':' + seconds + ' UTC ' + year;
return dateNow;
};
return DateHelper;
}();
export default DateHelper; | ElucidataInc/ElMaven | bin/node_modules/amazon-cognito-identity-js/es/DateHelper.js | JavaScript | gpl-2.0 | 1,889 |
// For react-testing-library helpers, overrides, and utilities
// All elements from react-testing-library can be imported from this wrapper.
// See https://testing-library.com/docs/react-testing-library/setup for more info
import React from 'react';
import thunk from 'redux-thunk';
import Immutable from 'seamless-immutable';
import { APIMiddleware, reducers as apiReducer } from 'foremanReact/redux/API';
import { reducers as fillReducers } from 'foremanReact/components/common/Fill';
import { reducers as foremanModalReducer } from 'foremanReact/components/ForemanModal';
import { STATUS } from 'foremanReact/constants';
import { render, waitFor, waitForElementToBeRemoved } from '@testing-library/react';
import { createStore, applyMiddleware, combineReducers } from 'redux';
import { Provider } from 'react-redux';
import { MemoryRouter, BrowserRouter } from 'react-router-dom';
import { initialSettingsState } from '../scenes/Settings/SettingsReducer';
import allKatelloReducers from '../redux/reducers/index.js';
// r-t-lib's print limit for debug() is quite small, setting it to a much higher char max here.
// See https://github.com/testing-library/react-testing-library/issues/503 for more info.
process.env.DEBUG_PRINT_LIMIT = 99999;
// Renders testable component with redux and react-router according to Katello's usage
// This should be used when you want a fully connected component with Redux state and actions.
function renderWithRedux(
component,
{
apiNamespace, // namespace if using API middleware
initialApiState = { response: {}, status: STATUS.PENDING }, // Default state for API middleware
initialState = {}, // Override full state
routerParams = {},
} = {},
) {
// Adding the reducer in the expected namespaced format
const combinedReducers = combineReducers({
katello: allKatelloReducers,
...apiReducer,
...foremanModalReducer,
...fillReducers,
});
// Namespacing the initial state as well
const initialFullState = Immutable({
API: {
[apiNamespace]: initialApiState,
},
katello: {
settings: {
settings: initialSettingsState,
},
},
extendable: {},
...initialState,
});
const middlewares = applyMiddleware(thunk, APIMiddleware);
const store = createStore(combinedReducers, initialFullState, middlewares);
const connectedComponent = (
<Provider store={store}>
<MemoryRouter {...routerParams} >{component}</MemoryRouter>
</Provider>
);
return { ...render(connectedComponent), store };
}
// When you actually need to change browser history
const renderWithRouter = (ui, { route = '/' } = {}) => {
window.history.pushState({}, 'Test page', route);
return render(ui, { wrapper: BrowserRouter });
};
// When the tests run slower, they can hit the default waitFor timeout, which is 1000ms
// There doesn't seem to be a way to set it globally for r-t-lib, so using this wrapper function
const rtlTimeout = 5000;
export const patientlyWaitFor = waitForFunc => waitFor(waitForFunc, { timeout: rtlTimeout });
export const patientlyWaitForRemoval = waitForFunc =>
waitForElementToBeRemoved(waitForFunc, { timeout: rtlTimeout });
// re-export everything, so the library can be used from this wrapper.
export * from '@testing-library/react';
export { renderWithRedux, renderWithRouter };
| snagoor/katello | webpack/test-utils/react-testing-lib-wrapper.js | JavaScript | gpl-2.0 | 3,336 |
/*
* Copyright (C) 2016 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
const MinimumScrubberWidth = 168;
const ElapsedTimeLabelLeftMargin = -2;
const ElapsedTimeLabelWidth = 40;
const RemainingTimeLabelWidth = 49;
const AdditionalTimeLabelWidthOverAnHour = 22;
const ScrubberMargin = 5;
class TimeControl extends LayoutItem
{
constructor(layoutDelegate)
{
super({
element: `<div class="time-control"></div>`,
layoutDelegate
});
this.elapsedTimeLabel = new TimeLabel;
this.scrubber = new Scrubber(layoutDelegate);
this.remainingTimeLabel = new TimeLabel;
this.children = [this.elapsedTimeLabel, this.scrubber, this.remainingTimeLabel];
this._labelsMayDisplayTimesOverAnHour = false;
}
// Public
get labelsMayDisplayTimesOverAnHour()
{
return this._labelsMayDisplayTimesOverAnHour;
}
set labelsMayDisplayTimesOverAnHour(flag)
{
if (this._labelsMayDisplayTimesOverAnHour === flag)
return;
this._labelsMayDisplayTimesOverAnHour = flag;
this.layout();
}
get width()
{
return super.width;
}
set width(width)
{
super.width = width;
const extraWidth = this._labelsMayDisplayTimesOverAnHour ? AdditionalTimeLabelWidthOverAnHour : 0;
const elapsedTimeLabelWidth = ElapsedTimeLabelWidth + extraWidth;
const remainingTimeLabelWidth = RemainingTimeLabelWidth + extraWidth;
this.elapsedTimeLabel.x = ElapsedTimeLabelLeftMargin;
this.elapsedTimeLabel.width = elapsedTimeLabelWidth;
this.scrubber.x = this.elapsedTimeLabel.x + elapsedTimeLabelWidth + ScrubberMargin;
this.scrubber.width = this._width - elapsedTimeLabelWidth - ScrubberMargin - remainingTimeLabelWidth;
this.remainingTimeLabel.x = this.scrubber.x + this.scrubber.width + ScrubberMargin;
}
get isSufficientlyWide()
{
return this.scrubber.width >= MinimumScrubberWidth;
}
}
| Debian/openjfx | modules/web/src/main/native/Source/WebCore/Modules/modern-media-controls/controls/time-control.js | JavaScript | gpl-2.0 | 3,286 |
"use strict";
var htmlparser = require("htmlparser2");
function parseIndentDescriptor(indentDescriptor) {
var match = /^(\+)?(tab|\d+)$/.exec(indentDescriptor);
if (!match) {
return { relative: false, spaces: "auto" };
}
return {
relative: match[1] === "+",
spaces: match[2] === "tab" ? "\t" : Array(Number(match[2]) + 1).join(" "),
};
}
function iterateScripts(code, onScript) {
var index = 0;
var currentScript = null;
var parser = new htmlparser.Parser({
onopentag: function (name, attrs) {
// Test if current tag is a valid <script> tag.
if (name !== "script") {
return;
}
if (attrs.type && !/^(application|text)\/(x-)?(javascript|babel)$/i.test(attrs.type)) {
return;
}
currentScript = "";
},
onclosetag: function (name) {
if (name !== "script" || currentScript === null) {
return;
}
onScript(code.slice(index, parser.startIndex - currentScript.length), currentScript);
index = parser.startIndex;
currentScript = null;
},
ontext: function (data) {
if (currentScript === null) {
return;
}
currentScript += data;
},
});
parser.parseComplete(code);
}
function extract(code, rawIndentDescriptor, reportBadIndentation) {
var indentDescriptor = parseIndentDescriptor(rawIndentDescriptor);
var resultCode = "";
var map = [];
var lineNumber = 1;
var badIndentationLines = [];
iterateScripts(code, function (previousCode, scriptCode) {
// Mark that we're inside a <script> a tag and push all new lines
// in between the last </script> tag and this <script> tag to preserve
// location information.
var newLines = previousCode.match(/\r\n|\n|\r/g);
if (newLines) {
resultCode += newLines.map(function (newLine) {
return "//eslint-disable-line spaced-comment" + newLine
}).join("");
lineNumber += newLines.length;
map[lineNumber] = previousCode.match(/[^\n\r]*$/)[0].length;
}
var currentScriptIndent = previousCode.match(/([^\n\r]*)<[^<]*$/)[1];
var indent;
if (indentDescriptor.spaces === "auto") {
var indentMatch = /[\n\r]+([ \t]*)/.exec(scriptCode);
indent = indentMatch ? indentMatch[1] : "";
}
else {
indent = indentDescriptor.spaces;
if (indentDescriptor.relative) {
indent = currentScriptIndent + indent;
}
}
var hadNonEmptyLine = false;
resultCode += scriptCode
.replace(/(\r\n|\n|\r)([ \t]*)(.*)/g, function (_, newLineChar, lineIndent, lineText) {
lineNumber += 1;
var isNonEmptyLine = Boolean(lineText);
var isFirstNonEmptyLine = isNonEmptyLine && !hadNonEmptyLine;
var badIndentation =
// Be stricter on the first line
isFirstNonEmptyLine ?
indent !== lineIndent :
lineIndent.indexOf(indent) !== 0;
if (badIndentation) {
// Don't report line if the line is empty
if (reportBadIndentation && isNonEmptyLine) {
badIndentationLines.push(lineNumber);
}
map[lineNumber] = 0;
}
else {
// Dedent code
lineIndent = lineIndent.slice(indent.length);
map[lineNumber] = indent.length;
}
if (isNonEmptyLine) {
hadNonEmptyLine = true;
}
return newLineChar + lineIndent + lineText;
})
.replace(/[ \t]*$/, ""); // Remove spaces on the last line
});
return {
map: map,
code: resultCode,
badIndentationLines: badIndentationLines,
};
}
module.exports = extract;
| yodfz/JS | react/projectResize/node_modules/eslint-plugin-html/src/extract.js | JavaScript | gpl-2.0 | 3,654 |
/*
Test the #error directive
© 2016 - Guillaume Gonnet
License GPLv2
Sources at https://github.com/ParksProjets/C-Preprocessor
*/
// Create the test
var utils = require('../utils.js'),
test = utils.test('#error');
// Expected the rsult
var text = 'Math is the life !';
// Store error and success functions
var error = test.error,
success = test.success;
// Override error function for checking if the right error is called
test.error = function(err) {
var msg = 'compiler error -> (line 3 in "main") ' + text;
if (err == msg)
success.call(test);
else
error.call(test, "we didn't get the right message");
};
// Override success function
test.success = function(err) {
error.call(test, 'no error raised');
};
// Run the test
test.run(`
#error ${text}
`);
| ParksProjets/Compile-JS-like-C | test/tests/error.js | JavaScript | gpl-2.0 | 786 |
FusionCharts.ready(function () {
var adjustTickCB = document.getElementById('tMarkCB'),
cpuGauge = new FusionCharts({
type: 'hlineargauge',
renderAt: 'chart-container',
id: 'cpu-linear-gauge',
width: '400',
height: '170',
dataFormat: 'json',
dataSource: {
"chart": {
"theme": "fint",
"caption": "Server CPU Utilization",
"lowerLimit": "0",
"upperLimit": "100",
"numberSuffix": "%",
"chartBottomMargin": "20",
"valueFontSize": "11",
"valueFontBold": "0",
//To set the number of major tickmarks
"majorTMNumber":"9",
//To set the number of minor tick marks
//in between major tick marks
"minorTMNumber":"5",
//To adjust the tickmark and values automatically
//to a best feasible value
"adjustTM": "1",
"gaugeFillMix":"{light-10},{light-70},{dark-10}",
"gaugeFillRatio":"40,20,40"
},
"colorRange": {
"color": [
{
"minValue": "0",
"maxValue": "35",
"label": "Low",
},
{
"minValue": "35",
"maxValue": "70",
"label": "Moderate",
},
{
"minValue": "70",
"maxValue": "100",
"label": "High",
}
]
},
"pointers": {
"pointer": [
{
"value": "75"
}
]
}
}
})
.render();
//Set event listener for check boxes
adjustTickCB.addEventListener && adjustTickCB.addEventListener("click", adjustTicks);
//Function to show/hide labels
function adjustTicks(evt, obj) {
//Using adjustTM attribute to adjust the
//number of major ticks to a best feasible value
if(adjustTickCB.checked) {
cpuGauge.setChartAttribute('adjustTM', 1);
}
else{
cpuGauge.setChartAttribute('adjustTM', 0);
}
}
}); | sguha-work/fiddletest | backup/fiddles/Gauge/Tick_Marks/Configuring_major_minor_tick_marks_in_linear_gauge/demo.js | JavaScript | gpl-2.0 | 2,468 |
FusionCharts.ready(function () {
var stockChart = new FusionCharts({
type: 'candlestick',
renderAt: 'chart-container',
id: 'myChart',
width: '600',
height: '400',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Daily Stock Price HRYS",
"subCaption": "Last 2 months",
"numberprefix":"$",
"pyaxisname":"Price",
"vyaxisname":"Volume (In Millions)",
"showVolumeChart": "0",
"theme": "fint",
},
"categories":[{
"category":[
{
"label":"2 month ago",
"x":"1"
},
{
"label":"1 month ago",
"x":"31"
},
{
"label":"Today",
"x":"60"
}
]
}],
"dataset": [{
"data": [
{
"open":"18.74",
"high":"19.16",
"low":"18.67 ",
"close":"18.99",
"x":"1",
"volume":"4991285"
},
{
"open":"18.74",
"high":"19.06",
"low":"18.54",
"close":"18.82",
"x":"2",
"volume":"3615889"
},
{
"open":"19.21",
"high":"19.3",
"low":"18.59 ",
"close":"18.65",
"x":"3",
"volume":"4749586"
},
{
"open":"19.85",
"high":"19.86",
"low":"19.12",
"close":"19.4",
"x":"4",
"volume":"4366740"
},
{
"open":"20.19",
"high":"20.21",
"low":"19.57",
"close":"19.92",
"x":"5",
"volume":"3982709"
},
{
"open":"20.47",
"high":"20.64",
"low":"20.15",
"close":"20.16",
"x":"6",
"volume":"2289403"
},
{
"open":"20.36",
"high":"20.52",
"low":"20.29",
"close":"20.48",
"x":"7",
"volume":"1950919"
},
{
"open":"20.21",
"high":"20.25",
"low":"19.91",
"close":"20.15",
"x":"8",
"volume":"2391070"
},
{
"open":"19.46",
"high":"20.54",
"low":"19.46",
"close":"20.22",
"x":"9",
"volume":"4548422"
},
{
"open":"19.24",
"high":"19.5",
"low":"19.13",
"close":"19.44",
"x":"10",
"volume":"1889811"
},
{
"open":"19.25",
"high":"19.41",
"low":"18.99",
"close":"19.22",
"x":"11",
"volume":"2543355"
},
{
"open":"18.85",
"high":"19.45",
"low":"18.8",
"close":"19.24",
"x":"12",
"volume":"2134393"
},
{
"open":"18.97",
"high":"19.01",
"low":"18.68",
"close":"18.95",
"x":"13",
"volume":"1740852"
},
{
"open":"18.69",
"high":"19",
"low":"18.35",
"close":"18.97",
"x":"14",
"volume":"2701392"
},
{
"open":"19.02",
"high":"19.1",
"low":"18.68",
"close":"18.7",
"x":"15",
"volume":"2198755"
},
{
"open":"19.29",
"high":"19.38",
"low":"18.88",
"close":"19.05",
"x":"16",
"volume":"2464958"
},
{
"open":"18.64",
"high":"19.35",
"low":"18.53",
"close":"19.33",
"x":"17",
"volume":"2962994"
},
{
"open":"18.14",
"high":"18.58",
"low":"18.08",
"close":"18.52",
"x":"18",
"volume":"1964932"
},
{
"open":"18.49",
"high":"18.92",
"low":"18.19",
"close":"18.26",
"x":"19",
"volume":"3013102"
},
{
"open":"18.71",
"high":"18.84",
"low":"18",
"close":"18.51",
"x":"20",
"volume":"4435894"
},
{
"open":"19.17",
"high":"19.35",
"low":"18.61",
"close":"18.66",
"x":"21",
"volume":"3245851"
},
{
"open":"19.12",
"high":"19.41",
"low":"18.92",
"close":"19.2",
"x":"22",
"volume":"2259792"
},
{
"open":"19.43",
"high":"19.58",
"low":"19.16",
"close":"19.33",
"x":"23",
"volume":"3531327"
},
{
"open":"19.72",
"high":"19.81",
"low":"19.04",
"close":"19.27",
"x":"24",
"volume":"5834733"
},
{
"open":"19.7",
"high":"19.94",
"low":"19.49",
"close":"19.77",
"x":"25",
"volume":"2009987"
},
{
"open":"19.84",
"high":"19.98",
"low":"19.39",
"close":"19.88",
"x":"26",
"volume":"2767592"
},
{
"open":"20.71",
"high":"20.73",
"low":"19.16",
"close":"19.63",
"x":"27",
"volume":"673358"
},
{
"open":"21.14",
"high":"21.14",
"low":"20.55",
"close":"20.65",
"x":"28",
"volume":"3164006"
},
{
"open":"21.5",
"high":"21.86",
"low":"21.2",
"close":"21.33",
"x":"29",
"volume":"7986466"
},
{
"open":"20.45",
"high":"21.08",
"low":"20.1",
"close":"20.56",
"x":"30",
"volume":"5813040"
},
{
"open":"20.07",
"high":"20.69",
"low":"20.04",
"close":"20.36",
"x":"31",
"volume":"3440002"
},
{
"open":"19.88",
"high":"20.11",
"low":"19.51",
"close":"20.03",
"x":"32",
"volume":"2779171"
},
{
"open":"19.76",
"high":"20.13",
"low":"19.65",
"close":"19.88",
"x":"33",
"volume":"2918115"
},
{
"open":"19.77",
"high":"19.97",
"low":"19.27",
"close":"19.9",
"x":"34",
"volume":"3850357"
},
{
"open":"19.43",
"high":"19.72",
"low":"18.88",
"close":"19.5",
"x":"35",
"volume":"5047378"
},
{
"open":"19.69",
"high":"19.84",
"low":"19.17",
"close":"19.43",
"x":"36",
"volume":"3479017"
},
{
"open":"19.59",
"high":"20.02",
"low":"19.02",
"close":"19.41",
"x":"37",
"volume":"5749874"
},
{
"open":"20.95",
"high":"21.09",
"low":"19.64",
"close":"19.83",
"x":"38",
"volume":"6319111"
},
{
"open":"20.52",
"high":"21.03",
"low":"20.45",
"close":"21",
"x":"39",
"volume":"4412413"
},
{
"open":"20.36",
"high":"20.96",
"low":"20.2",
"close":"20.44",
"x":"40",
"volume":"5948318"
},
{
"open":"21.45",
"high":"21.48",
"low":"19.63",
"close":"20.3",
"x":"41",
"volume":"11935440"
},
{
"open":"23.49",
"high":"23.57",
"low":"21.12",
"close":"21.63",
"x":"42",
"volume":"10523910"
},
{
"open":"24.04",
"high":"24.21",
"low":"23.04",
"close":"23.28",
"x":"43",
"volume":"3843797"
},
{
"open":"23.6",
"high":"24.065",
"low":"23.51",
"close":"23.94",
"x":"44",
"volume":"3691404"
},
{
"open":"22.87",
"high":"23.49",
"low":"22.86",
"close":"23.48",
"x":"45",
"volume":"3387393"
},
{
"open":"22.35",
"high":"22.89",
"low":"22.35",
"close":"22.74",
"x":"46",
"volume":"3737330"
},
{
"open":"22.11",
"high":"22.5",
"low":"21.9",
"close":"22.24",
"x":"47",
"volume":"4630397"
},
{
"open":"22.58",
"high":"22.80",
"low":"22.25",
"close":"22.42",
"x":"48",
"volume":"3024711"
},
{
"open":"23.54",
"high":"23.76",
"low":"22.6",
"close":"22.68",
"x":"49",
"volume":"3984508"
},
{
"open":"23.66",
"high":"24.09",
"low":"23.09",
"close":"23.46",
"x":"50",
"volume":"3420204"
},
{
"open":"24.36",
"high":"24.42",
"low":"22.90",
"close":"23.6",
"x":"51",
"volume":"5151096"
},
{
"open":"24.34",
"high":"24.6",
"low":"23.73",
"close":"24.15",
"x":"52",
"volume":"5999654"
},
{
"open":"23.38",
"high":"24.8",
"low":"23.36",
"close":"24.1",
"x":"53",
"volume":"5382049"
},
{
"open":"23.76",
"high":"23.84",
"low":"23.23",
"close":"23.47",
"x":"54",
"volume":"3508510"
},
{
"open":"23.64",
"high":"23.94",
"low":"23.48",
"close":"23.76",
"x":"55",
"volume":"2718428"
},
{
"open":"23.99",
"high":"24.18",
"low":"23.59",
"close":"23.66",
"x":"56",
"volume":"2859391"
},
{
"open":"23.32",
"high":"24.26",
"low":"23.32",
"close":"23.79",
"x":"57",
"volume":"4138618"
},
{
"open":"24.08",
"high":"24.4",
"low":"23.26",
"close":"23.39",
"x":"58",
"volume":"4477478"
},
{
"open":"22.84",
"high":"23.96",
"low":"22.83",
"close":"23.88",
"x":"59",
"volume":"4822378"
},
{
"open":"23.38",
"high":"23.78",
"low":"22.94",
"close":"23.01",
"x":"60",
"volume":"4037312"
},
{
"open":"23.97",
"high":"23.99",
"low":"23.14",
"close":"23.32",
"x":"61",
"volume":"4879546"
}
]
}],
"trendset": [{
"name": "High trends",
"color": "#0000CC",
"thickness": "1",
"includeInLegend": "1",
"set": [
{
"value":"19.16",
"x":"1"
},
{
"value":"19.06",
"x":"2"
},
{
"value":"19.3",
"x":"3"
},
{
"value":"19.86",
"x":"4"
},
{
"value":"20.21",
"x":"5"
},
{
"value":"20.64",
"x":"6"
},
{
"value":"20.52",
"x":"7"
},
{
"value":"20.25",
"x":"8"
},
{
"value":"20.54",
"x":"9"
},
{
"value":"19.5",
"x":"10"
},
{
"value":"19.41",
"x":"11"
},
{
"value":"19.45",
"x":"12"
},
{
"value":"19.01",
"x":"13"
},
{
"value":"19",
"x":"14"
},
{
"value":"19.1",
"x":"15"
},
{
"value":"19.38",
"x":"16"
},
{
"value":"19.35",
"x":"17"
},
{
"value":"18.58",
"x":"18"
},
{
"value":"18.92",
"x":"19"
},
{
"value":"18.84",
"x":"20"
},
{
"value":"19.35",
"x":"21"
},
{
"value":"19.41",
"x":"22"
},
{
"value":"19.58",
"x":"23"
},
{
"value":"19.81",
"x":"24"
},
{
"value":"19.94",
"x":"25"
},
{
"value":"19.98",
"x":"26"
},
{
"value":"20.73",
"x":"27"
},
{
"value":"21.14",
"x":"28"
},
{
"value":"21.86",
"x":"29"
},
{
"value":"21.08",
"x":"30"
},
{
"value":"20.69",
"x":"31"
},
{
"value":"20.11",
"x":"32"
},
{
"value":"20.13",
"x":"33"
},
{
"value":"19.97",
"x":"34"
},
{
"value":"19.72",
"x":"35"
},
{
"value":"19.84",
"x":"36"
},
{
"value":"20.02",
"x":"37"
},
{
"value":"21.09",
"x":"38"
},
{
"value":"21.03",
"x":"39"
},
{
"value":"20.96",
"x":"40"
},
{
"value":"21.48",
"x":"41"
},
{
"value":"23.57",
"x":"42"
},
{
"value":"24.21",
"x":"43"
},
{
"value":"24.065",
"x":"44"
},
{
"value":"23.49",
"x":"45"
},
{
"value":"22.89",
"x":"46"
},
{
"value":"22.5",
"x":"47"
},
{
"value":"22.80",
"x":"48"
},
{
"value":"23.76",
"x":"49"
},
{
"value":"24.09",
"x":"50"
},
{
"value":"24.42",
"x":"51"
},
{
"value":"24.6",
"x":"52"
},
{
"value":"24.8",
"x":"53"
},
{
"value":"23.84",
"x":"54"
},
{
"value":"23.94",
"x":"55"
},
{
"value":"24.18",
"x":"56"
},
{
"value":"24.26",
"x":"57"
},
{
"value":"24.4",
"x":"58"
},
{
"value":"23.96",
"x":"59"
},
{
"value":"23.78",
"x":"60"
},
{
"value":"23.99",
"x":"61"
}
]
}]
}
}).render();
}); | sguha-work/fiddletest | backup/fiddles/Chart/Trend_Sets/Configuring_trend_sets_in_CandleStick_chart/demo.js | JavaScript | gpl-2.0 | 28,871 |
//Slot implementations and slot-signal connections for $BASEFILENAME$ form
/*$SPECIALIZATION$*/
| serghei/kde3-kdevelop | languages/kjssupport/subclassing_template/subclass_template.js | JavaScript | gpl-2.0 | 96 |
(function() {
/**
* Synchronously load relevant platform PhoneGap scripts during startup.
*/
// Is there a way that PhoneGap can more reliably identify its presence and platform before deviceready?
var platform = 'unknown',
includes = ['platform.js'],
ua = navigator.userAgent;
if (ua.match(/; Android /)) {
// Mozilla/5.0 (Linux; U; Android 2.3.6; en-us; Nexus One Build/GRK39F) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
platform = 'android';
} else if (ua.match(/\((iPhone|iPod|iPad)/)) {
// Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8H7
platform = 'ios';
}
if (platform == 'unknown') {
// Assume we're a generic web browser.
platform = 'web';
} else {
includes.push('phonegap-1.3.0.js');
var plugins = {
android: [
'menu/menu.android.js',
'urlcache/URLCache.js',
'softkeyboard/softkeyboard.js',
'toast/phonegap-toast.js',
'share/share.js',
'cachemode/cachemode.js',
'webintent/webintent.js',
'globalization/globalization.js',
'preferences/preferences.js'
],
ios: [
'ActionSheet.js',
'ShareKitPlugin.js'
],
};
if (platform in plugins) {
$.each(plugins[platform], function(i, path) {
includes.push('plugins/' + path);
})
}
}
function includePlatformFile(name) {
var path = platform + '/' + name,
line = '<script type="text/javascript" charset="utf-8" src="' + path + '"></script>';
document.writeln(line);
}
$.each(includes, function(i, path) {
includePlatformFile(path);
});
})();
| debloper/WikipediaMobile | assets/www/js/platform-stub.js | JavaScript | gpl-2.0 | 1,567 |
'use strict';
angular.module('cookeat-recipe', [
'cookeat-couchdb',
'angularModalService',
'cookeat-recipe'
]).factory(
'RecipeService',
[
'$resource', '$routeParams', 'ModalService', 'CouchdbService',
function($resource, $routeParams, Modal, Couch) {
return {
list: function() {
return Couch.list('recipe', 'list');
},
get: function(id) {
return Couch.doc($routeParams.id).catch(function(error) {
console.error('Cannot show recipe with id', $routeParams.id,
', error:', error);
});
},
update : function() {
Modal.showModal({
templateUrl : "module/recipe/partial/create.html",
controller : "RecipeCreateCtrl"
}).then(function(modal) {
console.log('In modal', modal);
Couch.update('recipe', {}).then(function(response) {
console.log('Update', response);
}).catch(function(error) {
console.error('Error:', error);
});
// The modal object has the element built, if this is a bootstrap
// modal
// you can call 'modal' to show it, if it's a custom modal just
// show or hide
// it as you need to.
modal.element.modal();
modal.close.then(function(result) {
// $scope.message = result ? "You said Yes" : "You said No";
console.log('Modal closed', result);
});
});
},
};
}
]);
| showi/cookeat | couch/cookeat/vendor/cookeat/_attachments/module/recipe/service.js | JavaScript | gpl-2.0 | 1,628 |
/*
* VPDB - Virtual Pinball Database
* Copyright (C) 2019 freezy <[email protected]>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
"use strict"; /*global describe, before, after, it*/
const request = require('superagent');
const superagentTest = require('../../test/legacy/superagent-test');
const hlp = require('../../test/legacy/helper');
superagentTest(request);
describe('The ACLs of the `Profile` API', function() {
before(function(done) {
hlp.setupUsers(request, {
member: { roles: [ 'member' ], _plan: 'subscribed'},
contributor: { roles: [ 'contributor' ]},
moderator: { roles: [ 'moderator' ]},
admin: { roles: [ 'admin' ]},
root: { roles: [ 'root' ]},
}, done);
});
after(function(done) {
hlp.teardownUsers(request, done);
});
describe('for anonymous clients', function() {
it('should deny access to user profile', function(done) {
request.get('/api/v1/profile').saveResponse({ path: 'user/view' }).end(hlp.status(401, done));
});
it('should deny access to user logs', function(done) {
request.get('/api/v1/profile/logs').end(hlp.status(401, done));
});
it('should deny updates of user profile', function(done) {
request.patch('/api/v1/profile').send({}).end(hlp.status(401, done));
});
it('should allow password reset requests', function(done) {
request.post('/api/v1/profile/request-password-reset').send({}).end(hlp.status(422, done));
});
it('should allow password resets', function(done) {
request.post('/api/v1/profile/password-reset').send({}).end(hlp.status(422, done));
});
});
describe('for logged clients (role member)', function() {
it('should allow access to user profile', function(done) {
request.get('/api/v1/profile').save({ path: 'user/view' }).as('member').end(hlp.status(200, done));
});
it('should allow access to user logs', function(done) {
request.get('/api/v1/profile/logs').as('member').end(hlp.status(200, done));
});
it('should allow password reset requests', function(done) {
request.post('/api/v1/profile/request-password-reset').as('member').send({}).end(hlp.status(422, done));
});
it('should allow password resets', function(done) {
request.post('/api/v1/profile/password-reset').as('member').send({}).end(hlp.status(422, done));
});
});
describe('for members with the `contributor` role', function() {
it('should allow access to user profile', function(done) {
request.get('/api/v1/profile').as('contributor').end(hlp.status(200, done));
});
});
describe('for members with the `moderator` role', function() {
it('should allow access to user profile', function(done) {
request.get('/api/v1/profile').as('moderator').end(hlp.status(200, done));
});
});
describe('for members with the `admin` role', function() {
it('should allow access to user profile', function(done) {
request.get('/api/v1/profile').as('admin').end(hlp.status(200, done));
});
});
describe('for members with the `root` role', function() {
it('should allow access to user profile', function(done) {
request.get('/api/v1/profile').as('root').end(hlp.status(200, done));
});
});
}); | freezy/node-vpdb | src/app/profile/profile.api.acl.spec.js | JavaScript | gpl-2.0 | 3,824 |
(function(jQuery){jQuery.extend({progressBar:new function(){this.defaults={steps:20,stepDuration:20,max:100,showText:true,textFormat:'percentage',width:120,height:12,callback:null,boxImage:'images/progressbar.gif',barImage:{0:'images/progressbg_red.gif',30:'images/progressbg_orange.gif',70:'images/progressbg_green.gif'},running_value:0,value:0,image:null};this.construct=function(arg1,arg2){var argvalue=null;var argconfig=null;if(arg1!=null){if(!isNaN(arg1)){argvalue=arg1;if(arg2!=null){argconfig=arg2;}}else{argconfig=arg1;}}
return this.each(function(child){var pb=this;var config=this.config;if(argvalue!=null&&this.bar!=null&&this.config!=null){this.config.value=parseInt(argvalue)
if(argconfig!=null)
pb.config=jQuery.extend(this.config,argconfig);config=pb.config;}else{var jQuerythis=jQuery(this);var config=jQuery.extend({},jQuery.progressBar.defaults,argconfig);config.id=jQuerythis.attr('id')?jQuerythis.attr('id'):Math.ceil(Math.random()*100000);if(argvalue==null)
argvalue=jQuerythis.html().replace("%","")
config.value=parseInt(argvalue);config.running_value=0;config.image=getBarImage(config);var numeric=['steps','stepDuration','max','width','height','running_value','value'];for(var i=0;i<numeric.length;i++)
config[numeric[i]]=parseInt(config[numeric[i]]);jQuerythis.html("");var bar=document.createElement('img');var text=document.createElement('span');var jQuerybar=jQuery(bar);var jQuerytext=jQuery(text);pb.bar=jQuerybar;jQuerybar.attr('id',config.id+"_pbImage");jQuerytext.attr('id',config.id+"_pbText");jQuerytext.html(getText(config));jQuerybar.attr('title',getText(config));jQuerybar.attr('alt',getText(config));jQuerybar.attr('src',config.boxImage);jQuerybar.attr('width',config.width);jQuerybar.css("width",config.width+"px");jQuerybar.css("height",config.height+"px");jQuerybar.css("background-image","url("+config.image+")");jQuerybar.css("background-position",((config.width*-1))+'px 50%');jQuerybar.css("padding","0");jQuerybar.css("margin","0");jQuerythis.append(jQuerybar);jQuerythis.append(jQuerytext);}
function getPercentage(config){return config.running_value*100/config.max;}
function getBarImage(config){var image=config.barImage;if(typeof(config.barImage)=='object'){for(var i in config.barImage){if(config.running_value>=parseInt(i)){image=config.barImage[i];}else{break;}}}
return image;}
function getText(config){if(config.showText){if(config.textFormat=='percentage'){return" "+Math.round(config.running_value)+"%";}else if(config.textFormat=='fraction'){return" "+config.running_value+'/'+config.max;}}}
config.increment=Math.round((config.value-config.running_value)/config.steps);if(config.increment<0)
config.increment*=-1;if(config.increment<1)
config.increment=1;var t=setInterval(function(){var pixels=config.width/100;if(config.running_value>config.value){if(config.running_value-config.increment<config.value){config.running_value=config.value;}else{config.running_value-=config.increment;}}
else if(config.running_value<config.value){if(config.running_value+config.increment>config.value){config.running_value=config.value;}else{config.running_value+=config.increment;}}
if(config.running_value==config.value)
clearInterval(t);var jQuerybar=jQuery("#"+config.id+"_pbImage");var jQuerytext=jQuery("#"+config.id+"_pbText");var image=getBarImage(config);if(image!=config.image){jQuerybar.css("background-image","url("+image+")");config.image=image;}
jQuerybar.css("background-position",(((config.width*-1))+(getPercentage(config)*pixels))+'px 50%');jQuerybar.attr('title',getText(config));jQuerytext.html(getText(config));if(config.callback!=null&&typeof(config.callback)=='function')
config.callback(config);pb.config=config;},config.stepDuration);});};}});jQuery.fn.extend({progressBar:jQuery.progressBar.construct});})(jQuery); | slavam/adult-childhood | wp-content/plugins/lazyest-gallery/js/jquery.progressbar.js | JavaScript | gpl-2.0 | 3,786 |
/**
* Created by David on 14/05/2015.
*/
(function (){
window.onload = function() {
var notification = document.getElementById("notification");
var emailInput = document.getElementById('email');
var temperatureInput = document.getElementById("temperatureThreshold");
var humidityInput = document.getElementById("humidityThreshold");
var lightInput = document.getElementById("lightThreshold");
var data = new FormData();
var request = new XMLHttpRequest();
request.open("POST", "/add",true);
request.onload = function () {
console.log(emailInput.value());
console.log(temperatureInput.value());
console.log(humidityInput.value());
console.log(lightInput.value);
data.append("email", emailInput.value());
data.append("temperatureThreshold", temperatureInput.value());
data.append("humidityThreshold", humidityInput.value());
data.append("lightThreshold", humidityInput.value());
};
request.send(data);
};
}()); | DRGC/weatherTrackingSystemARM | weatherTrackingServerlet/web/javascript/notificationsController.js | JavaScript | gpl-2.0 | 1,197 |
/* This file is part of Indico.
* Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
*
* Indico is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Indico is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Indico; if not, see <http://www.gnu.org/licenses/>.
*/
(function($) {
'use strict';
/*
* This provides an untility for checkboxes (usually switch widgets) which immediately
* save the state using an AJAX request. The checkbox is disabled during the AJAX request
* to avoid the user from clicking multiple times and spamming unnecessary AJAX requests.
*
* The following data attributes may be set on the checkbox to configure the behavior:
* - href: required unless specified in the function call, URL for the AJAX request
* - method: optional, method for the AJAX request if it's not POST
* - confirm_enable: optional, show confirmation prompt when checking the checkbox if set
* - confirm_disable: optional, show confirmation prompt when unchecking the checkbox if set
*/
$.fn.ajaxCheckbox = function ajaxCheckbox(options) {
options = $.extend({
sendData: true, // if `enabled: '1/0'` should be sent in the request
// all these options may also be functions which are invoked with `this` set to the checkbox
method: null, // taken from data-method by default, can be any valid HTTP method
href: null // taken from data-href by default
}, options);
function getOption(opt, ctx) {
var value = options[opt];
if (_.isFunction(value)) {
return value.call(ctx);
} else {
return value;
}
}
return this.on('click', function(e) {
e.preventDefault();
var self = this;
var $this = $(this);
var checked = this.checked;
var message = checked ? $this.data('confirm_enable') : $this.data('confirm_disable');
var deferred = message ? confirmPrompt(message) : $.Deferred().resolve();
deferred.then(function() {
// update check state and prevent changes until the request finished
$this.prop('checked', checked).prop('disabled', true);
var data = options.sendData ? {
enabled: checked ? '1' : '0'
} : null;
$.ajax({
url: getOption('href', self) || $this.data('href'),
method: getOption('method', self) || $this.data('method') || 'POST',
dataType: 'json',
data: data,
complete: function() {
$this.prop('disabled', false);
},
error: function(data) {
handleAjaxError(data);
$this.prop('checked', !checked);
},
success: function(data) {
$this.prop('checked', data.enabled).trigger('ajaxCheckbox:changed', [data.enabled, data]);
handleFlashes(data, true, $this);
}
});
});
});
};
})(jQuery);
| XeCycle/indico | indico/htdocs/js/indico/jquery/ajaxcheckbox.js | JavaScript | gpl-3.0 | 3,742 |
/**
-- Odin JavaScript --------------------------------------------------------------------------------
A Pile of Herbs - The Forest of Patience <Step 5> (101000104)
-- By ---------------------------------------------------------------------------------------------
Information
-- Version Info -----------------------------------------------------------------------------------
1.0 - First Version by Information
---------------------------------------------------------------------------------------------------
*/
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (status >= 2 && mode == 0) {
cm.sendOk("Alright, see you next time.");
cm.dispose();
return;
}
if (mode == 1) {
status++;
}
else {
status--;
}
if (status == 0) {
if (cm.getQuestStatus(2051) == 1 && !cm.haveItem(4031032)) {
cm.gainItem(4031032, 1); // Double-Rooted Red Ginseng
} else {
var rand = 1 + Math.floor(Math.random() * 4);
if (rand == 1) {
cm.gainItem(4020007, 2); // Diamond Ore
} else if (rand == 2) {
cm.gainItem(4020008, 2); // Black Crystal Ore
} else if (rand == 3) {
cm.gainItem(4010006, 2); // Gold Ore
} else if (rand == 4) {
cm.gainItem(1032013, 1); // Red-Hearted Earrings
}
}
cm.warp(101000000, 0);
cm.dispose();
}
}
| swordiemen/Mushy | scripts/npc/1043001.js | JavaScript | gpl-3.0 | 1,349 |
'use strict';
var async = require('async');
var S = require('string');
var nconf = require('nconf');
var user = require('../user');
var meta = require('../meta');
var topics = require('../topics');
var posts = require('../posts');
var privileges = require('../privileges');
var plugins = require('../plugins');
var helpers = require('./helpers');
var pagination = require('../pagination');
var utils = require('../utils');
var topicsController = {};
topicsController.get = function (req, res, callback) {
var tid = req.params.topic_id;
var currentPage = parseInt(req.query.page, 10) || 1;
var pageCount = 1;
var userPrivileges;
var settings;
if ((req.params.post_index && !utils.isNumber(req.params.post_index)) || !utils.isNumber(tid)) {
return callback();
}
async.waterfall([
function (next) {
async.parallel({
privileges: function (next) {
privileges.topics.get(tid, req.uid, next);
},
settings: function (next) {
user.getSettings(req.uid, next);
},
topic: function (next) {
topics.getTopicData(tid, next);
},
}, next);
},
function (results, next) {
if (!results.topic) {
return callback();
}
userPrivileges = results.privileges;
if (!userPrivileges.read || !userPrivileges['topics:read'] || (parseInt(results.topic.deleted, 10) && !userPrivileges.view_deleted)) {
return helpers.notAllowed(req, res);
}
if (!res.locals.isAPI && (!req.params.slug || results.topic.slug !== tid + '/' + req.params.slug) && (results.topic.slug && results.topic.slug !== tid + '/')) {
var url = '/topic/' + results.topic.slug;
if (req.params.post_index) {
url += '/' + req.params.post_index;
}
if (currentPage > 1) {
url += '?page=' + currentPage;
}
return helpers.redirect(res, url);
}
settings = results.settings;
var postCount = parseInt(results.topic.postcount, 10);
pageCount = Math.max(1, Math.ceil(postCount / settings.postsPerPage));
results.topic.postcount = postCount;
if (utils.isNumber(req.params.post_index) && (req.params.post_index < 1 || req.params.post_index > postCount)) {
return helpers.redirect(res, '/topic/' + req.params.topic_id + '/' + req.params.slug + (req.params.post_index > postCount ? '/' + postCount : ''));
}
if (settings.usePagination && (currentPage < 1 || currentPage > pageCount)) {
return callback();
}
var set = 'tid:' + tid + ':posts';
var reverse = false;
// `sort` qs has priority over user setting
var sort = req.query.sort || settings.topicPostSort;
if (sort === 'newest_to_oldest') {
reverse = true;
} else if (sort === 'most_votes') {
reverse = true;
set = 'tid:' + tid + ':posts:votes';
}
var postIndex = 0;
req.params.post_index = parseInt(req.params.post_index, 10) || 0;
if (reverse && req.params.post_index === 1) {
req.params.post_index = 0;
}
if (!settings.usePagination) {
if (req.params.post_index !== 0) {
currentPage = 1;
}
if (reverse) {
postIndex = Math.max(0, postCount - (req.params.post_index || postCount) - Math.ceil(settings.postsPerPage / 2));
} else {
postIndex = Math.max(0, (req.params.post_index || 1) - Math.ceil(settings.postsPerPage / 2));
}
} else if (!req.query.page) {
var index;
if (reverse) {
index = Math.max(0, postCount - (req.params.post_index || postCount) + 2);
} else {
index = Math.max(0, req.params.post_index) || 0;
}
currentPage = Math.max(1, Math.ceil(index / settings.postsPerPage));
}
var start = ((currentPage - 1) * settings.postsPerPage) + postIndex;
var stop = start + settings.postsPerPage - 1;
topics.getTopicWithPosts(results.topic, set, req.uid, start, stop, reverse, next);
},
function (topicData, next) {
if (topicData.category.disabled) {
return callback();
}
topics.modifyPostsByPrivilege(topicData, userPrivileges);
plugins.fireHook('filter:controllers.topic.get', { topicData: topicData, uid: req.uid }, next);
},
function (data, next) {
var breadcrumbs = [
{
text: data.topicData.category.name,
url: nconf.get('relative_path') + '/category/' + data.topicData.category.slug,
},
{
text: data.topicData.title,
},
];
helpers.buildCategoryBreadcrumbs(data.topicData.category.parentCid, function (err, crumbs) {
if (err) {
return next(err);
}
data.topicData.breadcrumbs = crumbs.concat(breadcrumbs);
next(null, data.topicData);
});
},
function (topicData, next) {
function findPost(index) {
for (var i = 0; i < topicData.posts.length; i += 1) {
if (parseInt(topicData.posts[i].index, 10) === parseInt(index, 10)) {
return topicData.posts[i];
}
}
}
var description = '';
var postAtIndex = findPost(Math.max(0, req.params.post_index - 1));
if (postAtIndex && postAtIndex.content) {
description = S(postAtIndex.content).decodeHTMLEntities().stripTags().s;
}
if (description.length > 255) {
description = description.substr(0, 255) + '...';
}
var ogImageUrl = '';
if (topicData.thumb) {
ogImageUrl = topicData.thumb;
} else if (postAtIndex && postAtIndex.user && postAtIndex.user.picture) {
ogImageUrl = postAtIndex.user.picture;
} else if (meta.config['og:image']) {
ogImageUrl = meta.config['og:image'];
} else if (meta.config['brand:logo']) {
ogImageUrl = meta.config['brand:logo'];
} else {
ogImageUrl = '/logo.png';
}
if (typeof ogImageUrl === 'string' && ogImageUrl.indexOf('http') === -1) {
ogImageUrl = nconf.get('url') + ogImageUrl;
}
description = description.replace(/\n/g, ' ');
res.locals.metaTags = [
{
name: 'title',
content: topicData.titleRaw,
},
{
name: 'description',
content: description,
},
{
property: 'og:title',
content: topicData.titleRaw,
},
{
property: 'og:description',
content: description,
},
{
property: 'og:type',
content: 'article',
},
{
property: 'og:image',
content: ogImageUrl,
noEscape: true,
},
{
property: 'og:image:url',
content: ogImageUrl,
noEscape: true,
},
{
property: 'article:published_time',
content: utils.toISOString(topicData.timestamp),
},
{
property: 'article:modified_time',
content: utils.toISOString(topicData.lastposttime),
},
{
property: 'article:section',
content: topicData.category ? topicData.category.name : '',
},
];
res.locals.linkTags = [
{
rel: 'alternate',
type: 'application/rss+xml',
href: nconf.get('url') + '/topic/' + tid + '.rss',
},
];
if (topicData.category) {
res.locals.linkTags.push({
rel: 'up',
href: nconf.get('url') + '/category/' + topicData.category.slug,
});
}
next(null, topicData);
},
], function (err, data) {
if (err) {
return callback(err);
}
data.privileges = userPrivileges;
data.topicStaleDays = parseInt(meta.config.topicStaleDays, 10) || 60;
data['reputation:disabled'] = parseInt(meta.config['reputation:disabled'], 10) === 1;
data['downvote:disabled'] = parseInt(meta.config['downvote:disabled'], 10) === 1;
data['feeds:disableRSS'] = parseInt(meta.config['feeds:disableRSS'], 10) === 1;
data.bookmarkThreshold = parseInt(meta.config.bookmarkThreshold, 10) || 5;
data.postEditDuration = parseInt(meta.config.postEditDuration, 10) || 0;
data.postDeleteDuration = parseInt(meta.config.postDeleteDuration, 10) || 0;
data.scrollToMyPost = settings.scrollToMyPost;
data.rssFeedUrl = nconf.get('relative_path') + '/topic/' + data.tid + '.rss';
data.pagination = pagination.create(currentPage, pageCount, req.query);
data.pagination.rel.forEach(function (rel) {
rel.href = nconf.get('url') + '/topic/' + data.slug + rel.href;
res.locals.linkTags.push(rel);
});
req.session.tids_viewed = req.session.tids_viewed || {};
if (!req.session.tids_viewed[tid] || req.session.tids_viewed[tid] < Date.now() - 3600000) {
topics.increaseViewCount(tid);
req.session.tids_viewed[tid] = Date.now();
}
if (req.uid) {
topics.markAsRead([tid], req.uid, function (err, markedRead) {
if (err) {
return callback(err);
}
if (markedRead) {
topics.pushUnreadCount(req.uid);
topics.markTopicNotificationsRead([tid], req.uid);
}
});
}
res.render('topic', data);
});
};
topicsController.teaser = function (req, res, next) {
var tid = req.params.topic_id;
if (!utils.isNumber(tid)) {
return next();
}
async.waterfall([
function (next) {
privileges.topics.can('read', tid, req.uid, next);
},
function (canRead, next) {
if (!canRead) {
return res.status(403).json('[[error:no-privileges]]');
}
topics.getLatestUndeletedPid(tid, next);
},
function (pid, next) {
if (!pid) {
return res.status(404).json('not-found');
}
posts.getPostSummaryByPids([pid], req.uid, { stripTags: false }, next);
},
], function (err, posts) {
if (err) {
return next(err);
}
if (!Array.isArray(posts) || !posts.length) {
return res.status(404).json('not-found');
}
res.json(posts[0]);
});
};
topicsController.pagination = function (req, res, callback) {
var tid = req.params.topic_id;
var currentPage = parseInt(req.query.page, 10) || 1;
if (!utils.isNumber(tid)) {
return callback();
}
async.parallel({
privileges: async.apply(privileges.topics.get, tid, req.uid),
settings: async.apply(user.getSettings, req.uid),
topic: async.apply(topics.getTopicData, tid),
}, function (err, results) {
if (err || !results.topic) {
return callback(err);
}
if (!results.privileges.read || (parseInt(results.topic.deleted, 10) && !results.privileges.view_deleted)) {
return helpers.notAllowed(req, res);
}
var postCount = parseInt(results.topic.postcount, 10);
var pageCount = Math.max(1, Math.ceil((postCount - 1) / results.settings.postsPerPage));
var paginationData = pagination.create(currentPage, pageCount);
paginationData.rel.forEach(function (rel) {
rel.href = nconf.get('url') + '/topic/' + results.topic.slug + rel.href;
});
res.json(paginationData);
});
};
module.exports = topicsController;
| androidfanatic/NodeBB | src/controllers/topics.js | JavaScript | gpl-3.0 | 10,299 |
(function() {
"use strict";
var util = require("./util");
var NativeRequest = function(params) {
util.assign(this, "method", params);
util.assign(this, "url", params);
util.assign(this, "headers", params);
};
module.exports = NativeRequest;
})();
| foraproject/isotropy-http | lib/native-request.js | JavaScript | gpl-3.0 | 294 |
'use strict';
/**
* @ngdoc function
* @name openeyesApp.controller:AcuityViewCtrl
* @description
* # AcuityViewCtrl
* Controller of the openeyesApp
*/
angular.module('openeyesApp')
.controller('AcuityViewCtrl', ['$scope', '$routeParams', 'Element', 'Ticket', 'MODEL_DOMAIN', function($scope, $routeParams, Element, Ticket, MODEL_DOMAIN){
var self = this;
this.init = function(){
$scope.model = {};
$scope.patient = null;
$scope.$watch('patient', function(patient) {
if (patient) {
self.getElement();
}
});
this.getPatient();
};
this.getPatient = function() {
Ticket.getTicket($routeParams.ticketId)
.then(function(data) {
$scope.patient = data.data.patient;
}, function(data, status, headers, config) {
console.log('Error getting patient data', data, status, headers, config);
});
};
this.getElement = function() {
// Request element for todays date
var today = Date.now();
var eType = MODEL_DOMAIN + 'VisualAcuity';
Element.getElements($scope.patient._id.$oid, eType, today)
.then(function(data) {
$scope.model = data.data[0];
}, function(error) {
console.log(error);
});
};
}])
/**
* @ngdoc function
* @name openeyesApp.directive:oeAcuityView
* @description
* # oeAcuityView
* Directive of the openeyesApp
*/
.directive('oeVisualAcuityView', [function () {
return {
restrict: 'EA', //E = element, A = attribute, C = class, M = comment
scope: {},
templateUrl: 'views/directives/acuityView.html',
controller: 'AcuityViewCtrl', //Embed a custom controller in the directive
link: function (scope, element, attrs, AcuityViewCtrl) {
AcuityViewCtrl.init();
}
};
}]);
| openeyes/poc-frontend | app/scripts/directives/acuityView.js | JavaScript | gpl-3.0 | 1,861 |
var searchData=
[
['readme',['README',['../md_README.html',1,'']]],
['readinputbuffer',['readInputBuffer',['../classec_1_1TcpSocket.html#a64a402951553c83c1ba6be46fcf642d0',1,'ec::TcpSocket']]],
['rear',['rear',['../classec_1_1SingleQueue.html#a55e2ac6df57ba91c264955685adb94a0',1,'ec::SingleQueue']]],
['refresh',['refresh',['../classec_1_1ExtendableSingleQueue.html#a85bf9411c1e2c10b3a6c5ebdecbc1aea',1,'ec::ExtendableSingleQueue']]],
['regasynchandler',['regAsyncHandler',['../classec_1_1Loop.html#a54c8e94f74760c38d0c07c2c7584a1d4',1,'ec::Loop']]],
['regeventhandler',['regEventHandler',['../classec_1_1Loop.html#a9106028b7c268472a27832fe7812ba7f',1,'ec::Loop']]],
['regframehandler',['regFrameHandler',['../classec_1_1Loop.html#a6ad6f4a613cad7f4090c98bb370edac7',1,'ec::Loop']]],
['regposthandler',['regPostHandler',['../classec_1_1Loop.html#aa815829ba034e87209d62958d94c1bf9',1,'ec::Loop']]],
['request',['request',['../structec_1_1AsyncContext.html#ae2421cc415943bfbe6587336bafed5e4',1,'ec::AsyncContext']]],
['response',['response',['../structec_1_1AsyncContext.html#a4cba44af18997a45d803e4d2533bc303',1,'ec::AsyncContext']]]
];
| napoleonOu/MQAA-Client | doc/html/search/all_e.js | JavaScript | gpl-3.0 | 1,156 |
/* eslint no-var: 0 */
/* globals inject,beforeEach,window, */
/* exported commonSpec */
/* jshint varstmt: false */
'use strict';
let commonSpec = function(spec) {
spec.originalData = null;
beforeEach(angular.mock.module('game'));
beforeEach(angular.mock.module(function (_$provide_) {
spec.$provide = _$provide_;
}));
beforeEach(inject(function(_$rootScope_, _$controller_,_$timeout_, _$injector_, _$componentController_){
window.ga = function () {};
// The injector unwraps the underscores (_) from around the parameter names when matching
spec.$timeout = _$timeout_;
if(!spec.originalData){
spec.originalData = angular.copy(_$injector_.get('data'));
}
spec.data = {};
spec.data.achievements = {};
spec.data.constants = {};
spec.data.elements = {};
spec.data.generators = {};
spec.data.reactions = {};
spec.data.redox = {};
spec.data.resources = {};
spec.data.upgrades = {};
spec.data.global_upgrades = {};
spec.data.exotic_upgrades = {};
spec.data.dark_upgrades = {};
spec.data.html = {};
spec.data.radioisotopes = [];
spec.$provide.constant('data', spec.data);
spec.savegame = _$injector_.get('savegame');
spec.util = _$injector_.get('util');
spec.format = _$injector_.get('format');
spec.reaction = _$injector_.get('reaction');
spec.visibility = _$injector_.get('visibility');
spec.state = _$injector_.get('state');
spec.upgradeService = _$injector_.get('upgrade');
spec.state.player.options = {};
spec.state.player.elements = {};
spec.state.player.unlocks = {};
spec.state.player.element_slots = [];
spec.state.player.resources = {};
spec.state.player.achievements = {};
spec.state.player.upgrades = {};
spec.state.player.exotic_upgrades = {};
spec.state.player.dark_upgrades = {};
spec.state.player.global_upgrades = {};
spec.state.player.global_upgrades_current = {};
spec.state.player.fusion = [];
spec.state.player.statistics = {exotic_run:{},dark_run:{},all_time:{}};
spec.elements = _$componentController_('elements', null, null);
spec.upgrades = _$componentController_('upgrades', null, null);
spec.exotic = _$componentController_('exotic', null, null);
spec.dark = _$componentController_('dark', null, null);
spec.redox = _$componentController_('redox', null, null);
spec.reactions = _$componentController_('reactions', null, null);
spec.generators = _$componentController_('generators', null, null);
spec.fusion = _$componentController_('fusion', null, null);
spec.options = _$componentController_('options', null, null);
spec.achievements = _$componentController_('achievements', null, null);
spec.elementSelect = _$componentController_('elementSelect', null, null);
spec.sidebar = _$componentController_('sidebar', null, null);
spec.dashboardList = _$componentController_('dashboardList', null, null);
spec.fusionSelect = _$componentController_('fusionSelect', null, null);
spec.fusionSelect.listener();
// asinine sanity check for components
_$componentController_('getHtml', null, null);
_$componentController_('pretty', null, null);
spec.controller = _$controller_('main-loop', {$scope:_$rootScope_.$new(), visibility:spec.visibility, state:spec.state});
spec.state.registerUpdate('redox', function(){});
spec.state.registerUpdate('exotic', function(){});
spec.state.registerUpdate('dark', function(){});
}));
};
| angarg12/incremental_table_elements | test/unit/common.js | JavaScript | gpl-3.0 | 3,516 |
/**
* This file is loaded in the service web views to provide a Rambox API.
*/
const { ipcRenderer } = require('electron');
/**
* Make the Rambox API available via a global "rambox" variable.
*
* @type {{}}
*/
window.rambox = {};
/**
* Sets the unraed count of the tab.
*
* @param {*} count The unread count
*/
window.rambox.setUnreadCount = function(count) {
ipcRenderer.sendToHost('rambox.setUnreadCount', count);
};
/**
* Clears the unread count.
*/
window.rambox.clearUnreadCount = function() {
ipcRenderer.sendToHost('rambox.clearUnreadCount');
}
/**
* Override to add notification click event to display Rambox window and activate service tab
*/
var NativeNotification = Notification;
Notification = function(title, options) {
var notification = new NativeNotification(title, options);
notification.addEventListener('click', function() {
ipcRenderer.sendToHost('rambox.showWindowAndActivateTab');
});
return notification;
}
Notification.prototype = NativeNotification.prototype;
Notification.permission = NativeNotification.permission;
Notification.requestPermission = NativeNotification.requestPermission.bind(Notification);
| weeman1337/rambox | resources/js/rambox-service-api.js | JavaScript | gpl-3.0 | 1,162 |
import React from 'react';
import Proptypes from 'prop-types';
import TextField from '@material-ui/core/TextField';
import moment from 'moment';
import { withStyles } from '@material-ui/core/styles';
const styles = {
rowContainer: {
display: 'flex',
flexDirection: 'row',
justifyContent: 'left',
},
rowSpace: {
paddingLeft: '2vw',
},
columnContainer: {
display: 'flex',
flexDirection: 'column',
justifyContent: 'left',
},
columnSpace: {
paddingBottom: '2.5vh',
},
label: {
color: 'black',
},
dateField: {
backgroundColor: 'white',
border: '1px solid lightgrey',
padding: 1,
fontSize: '0.92vw',
marginTop: '1.05vh',
lineHeight: '2vh',
},
title: {
fontSize: '1.2vw',
},
field: {
minWidth: '100%',
},
};
class SelectDate extends React.Component {
constructor(props) {
super(props);
this.state = {
rangeStartDate: undefined,
rangeEndDate: undefined,
selectedStartDate: undefined,
selectedEndDate: undefined,
};
}
static propTypes = {
startDate: Proptypes.string.isRequired,
endDate: Proptypes.string.isRequired,
setHistoryRangeDate: Proptypes.func.isRequired,
row: Proptypes.bool,
classes: Proptypes.object.isRequired,
};
componentWillMount() {
const startDate = moment(this.props.startDate).format('YYYY-MM-DD');
const endDate = moment(this.props.endDate).format('YYYY-MM-DD');
if (
this.state.rangeStartDate !== startDate &&
this.state.rangeEndDate !== endDate
) {
this.setState({
rangeStartDate: startDate,
rangeEndDate: endDate,
selectedStartDate: startDate,
selectedEndDate: endDate,
});
}
}
componentWillReceiveProps(nextProps) {
const startDate = moment(nextProps.startDate).format('YYYY-MM-DD');
const endDate = moment(nextProps.endDate).format('YYYY-MM-DD');
if (
!nextProps.row &&
(this.state.selectedStartDate !== startDate ||
this.state.selectedEndDate !== endDate)
) {
this.setState({
selectedStartDate: startDate,
selectedEndDate: endDate,
});
}
}
changeStart = evt => {
const selectedStartDate = moment(evt.target.value).format('YYYY-MM-DD');
if (selectedStartDate.toString() !== 'Invalid Date')
this.setState({ selectedStartDate }, this.selectRange);
};
changeEnd = evt => {
const selectedEndDate = moment(evt.target.value).format('YYYY-MM-DD');
if (selectedEndDate.toString() !== 'Invalid Date')
this.setState({ selectedEndDate }, this.selectRange);
};
selectRange = () => {
this.props.setHistoryRangeDate(
this.formatFilterDate(this.state.selectedStartDate),
this.formatFilterDate(this.state.selectedEndDate)
);
};
formatFilterDate = (date, addOneDay) => {
if (addOneDay) {
return moment(date)
.add(1, 'days')
.format('YYYY-MM-DD');
} else {
return moment(date).format('YYYY-MM-DD');
}
};
render() {
const containerStyle = this.props.row
? styles.rowContainer
: styles.columnContainer;
const spaceStyle = this.props.row ? styles.rowSpace : styles.columnSpace;
return (
<div style={containerStyle}>
<div style={spaceStyle}>
<TextField
id="start"
label="Start Date"
type="date"
value={this.formatFilterDate(this.state.selectedStartDate)}
onChange={this.changeStart}
style={styles.field}
InputLabelProps={{
shrink: true,
style: styles.title,
}}
inputProps={{
style: styles.dateField,
min: this.formatFilterDate(this.state.rangeStartDate),
max: this.formatFilterDate(this.state.selectedEndDate),
}}
/>
</div>
<div style={spaceStyle}>
<TextField
id="end"
label="End Date"
type="date"
value={this.formatFilterDate(this.state.selectedEndDate)}
onChange={this.changeEnd}
style={styles.field}
InputLabelProps={{
shrink: true,
style: styles.title,
}}
inputProps={{
style: styles.dateField,
min: this.formatFilterDate(this.state.selectedStartDate, true),
max: this.formatFilterDate(this.state.rangeEndDate),
}}
/>
</div>
</div>
);
}
}
export default withStyles(styles)(SelectDate);
| linea-it/qlf | frontend/src/components/select-date/select-date.js | JavaScript | gpl-3.0 | 4,612 |
import IssueForm from './IssueForm';
/**
* Render IssueForm on page load
*/
window.addEventListener('load', () => {
const id = location.href.split('/issue/')[1];
ReactDOM.render(
<IssueForm
Module='issue_tracker'
DataURL={loris.BaseURL
+ '/issue_tracker/Edit/?issueID='
+ id}
action={loris.BaseURL
+ '/issue_tracker/Edit/'}
issue={id}
baseURL={loris.BaseURL}
userHasPermission={loris.userHasPermission('issue_tracker_developer')}
/>,
document.getElementById('lorisworkspace')
);
});
| aces/Loris | modules/issue_tracker/jsx/index.js | JavaScript | gpl-3.0 | 570 |
// Thanks to: https://github.com/airyland/vux/blob/v2/src/directives/transfer-dom/index.js
// Thanks to: https://github.com/calebroseland/vue-dom-portal
/**
* Get target DOM Node
* @param {(Node|string|Boolean)} [node=document.body] DOM Node, CSS selector, or Boolean
* @return {Node} The target that the el will be appended to
*/
function getTarget (node) {
if (node === void 0) {
node = document.body
}
if (node === true) { return document.body }
return node instanceof window.Node ? node : document.querySelector(node)
}
const directive = {
inserted (el, { value }, vnode) {
if ( el.dataset && el.dataset.transfer !== 'true') return false;
el.className = el.className ? el.className + ' v-transfer-dom' : 'v-transfer-dom';
const parentNode = el.parentNode;
if (!parentNode) return;
const home = document.createComment('');
let hasMovedOut = false;
if (value !== false) {
parentNode.replaceChild(home, el); // moving out, el is no longer in the document
getTarget(value).appendChild(el); // moving into new place
hasMovedOut = true
}
if (!el.__transferDomData) {
el.__transferDomData = {
parentNode: parentNode,
home: home,
target: getTarget(value),
hasMovedOut: hasMovedOut
}
}
},
componentUpdated (el, { value }) {
if ( el.dataset && el.dataset.transfer !== 'true') return false;
// need to make sure children are done updating (vs. `update`)
const ref$1 = el.__transferDomData;
if (!ref$1) return;
// homes.get(el)
const parentNode = ref$1.parentNode;
const home = ref$1.home;
const hasMovedOut = ref$1.hasMovedOut; // recall where home is
if (!hasMovedOut && value) {
// remove from document and leave placeholder
parentNode.replaceChild(home, el);
// append to target
getTarget(value).appendChild(el);
el.__transferDomData = Object.assign({}, el.__transferDomData, { hasMovedOut: true, target: getTarget(value) });
} else if (hasMovedOut && value === false) {
// previously moved, coming back home
parentNode.replaceChild(el, home);
el.__transferDomData = Object.assign({}, el.__transferDomData, { hasMovedOut: false, target: getTarget(value) });
} else if (value) {
// already moved, going somewhere else
getTarget(value).appendChild(el);
}
},
unbind (el) {
if (el.dataset && el.dataset.transfer !== 'true') return false;
el.className = el.className.replace('v-transfer-dom', '');
const ref$1 = el.__transferDomData;
if (!ref$1) return;
if (el.__transferDomData.hasMovedOut === true) {
el.__transferDomData.parentNode && el.__transferDomData.parentNode.appendChild(el)
}
el.__transferDomData = null
}
};
export default directive; | cmos3511/cmos_linux | python/op/op_site/op_static/npm/node_modules/iview/src/directives/transfer-dom.js | JavaScript | gpl-3.0 | 3,082 |
var searchData=
[
['unloadcontent',['UnloadContent',['../class_microsoft_1_1_samples_1_1_kinect_1_1_avateering_1_1_kinect_chooser.html#a7ef341c7a8390e715f93c2a73ecb1e86',1,'Microsoft::Samples::Kinect::Avateering::KinectChooser']]],
['update',['Update',['../class_microsoft_1_1_samples_1_1_kinect_1_1_avateering_1_1_avatar_animator.html#a46df6cf97a78c7ade81427b77cab321e',1,'Microsoft.Samples.Kinect.Avateering.AvatarAnimator.Update()'],['../class_microsoft_1_1_samples_1_1_kinect_1_1_avateering_1_1_avateering_x_n_a.html#a2dd0406dfab788b9e2275e7a01f23cf2',1,'Microsoft.Samples.Kinect.Avateering.AvateeringXNA.Update()'],['../class_microsoft_1_1_samples_1_1_kinect_1_1_avateering_1_1_color_stream_renderer.html#a8d596f939054c20ac74cb349a1a6562c',1,'Microsoft.Samples.Kinect.Avateering.ColorStreamRenderer.Update()'],['../class_microsoft_1_1_samples_1_1_kinect_1_1_avateering_1_1_depth_stream_renderer.html#a365af6c9d57d70df4921d6f7ea2ba90e',1,'Microsoft.Samples.Kinect.Avateering.DepthStreamRenderer.Update()'],['../class_microsoft_1_1_samples_1_1_kinect_1_1_avateering_1_1_skeleton_stream_renderer.html#a9beca14a74f9e496756a97f828364149',1,'Microsoft.Samples.Kinect.Avateering.SkeletonStreamRenderer.Update()']]],
['updatefilter',['UpdateFilter',['../class_microsoft_1_1_samples_1_1_kinect_1_1_avateering_1_1_filters_1_1_bone_orientation_double_exponential_filter.html#aa251508e7e97090475363c371cc0a595',1,'Microsoft.Samples.Kinect.Avateering.Filters.BoneOrientationDoubleExponentialFilter.UpdateFilter()'],['../class_microsoft_1_1_samples_1_1_kinect_1_1_avateering_1_1_filters_1_1_skeleton_joints_position_double_exponential_filter.html#a1853f70c62337ea0d07e4d590a06d5ab',1,'Microsoft.Samples.Kinect.Avateering.Filters.SkeletonJointsPositionDoubleExponentialFilter.UpdateFilter()']]],
['updateviewingcamera',['UpdateViewingCamera',['../class_microsoft_1_1_samples_1_1_kinect_1_1_avateering_1_1_avateering_x_n_a.html#a581371472069c4ec3d8579acb0f435de',1,'Microsoft::Samples::Kinect::Avateering::AvateeringXNA']]]
];
| kandran/musee-interactif | Prototype 3D/Docs/html/search/functions_f.js | JavaScript | gpl-3.0 | 2,024 |
dojo.provide("dojox.form.DropDownSelect");
dojo.require("dojox.form._FormSelectWidget");
dojo.require("dojox.form._HasDropDown");
dojo.require("dijit.Menu");
dojo.requireLocalization("dijit.form", "validate");
dojo.declare("dojox.form.DropDownSelect", [dojox.form._FormSelectWidget, dojox.form._HasDropDown], {
// summary:
// This is a "Styleable" select box - it is basically a DropDownButton which
// can take as its input a <select>.
baseClass: "dojoxDropDownSelect",
templatePath: dojo.moduleUrl("dojox.form", "resources/DropDownSelect.html"),
// attributeMap: Object
// Add in our style to be applied to the focus node
attributeMap: dojo.mixin(dojo.clone(dojox.form._FormSelectWidget.prototype.attributeMap),{style:"tableNode"}),
// required: Boolean
// Can be true or false, default is false.
required: false,
// state: String
// Shows current state (ie, validation result) of input (Normal, Warning, or Error)
state: "",
// tooltipPosition: String[]
// See description of dijit.Tooltip.defaultPosition for details on this parameter.
tooltipPosition: [],
// emptyLabel: string
// What to display in an "empty" dropdown
emptyLabel: "",
// _isLoaded: boolean
// Whether or not we have been loaded
_isLoaded: false,
// _childrenLoaded: boolean
// Whether or not our children have been loaded
_childrenLoaded: false,
_fillContent: function(){
// summary:
// Set the value to be the first, or the selected index
this.inherited(arguments);
if(this.options.length && !this.value){
var si = this.srcNodeRef.selectedIndex;
this.value = this.options[si != -1 ? si : 0].value;
}
// Create the dropDown widget
this.dropDown = new dijit.Menu();
dojo.addClass(this.dropDown.domNode, this.baseClass + "Menu");
},
_getMenuItemForOption: function(/* dojox.form.__SelectOption */ option){
// summary:
// For the given option, return the menu item that should be
// used to display it. This can be overridden as needed
if(!option.value){
// We are a separator (no label set for it)
return new dijit.MenuSeparator();
}else{
// Just a regular menu option
var click = dojo.hitch(this, "_setValueAttr", option);
return new dijit.MenuItem({
option: option,
label: option.label,
onClick: click,
disabled: option.disabled || false
});
}
},
_addOptionItem: function(/* dojox.form.__SelectOption */ option){
// summary:
// For the given option, add a option to our dropdown
// If the option doesn't have a value, then a separator is added
// in that place.
this.dropDown.addChild(this._getMenuItemForOption(option));
},
_getChildren: function(){ return this.dropDown.getChildren(); },
_loadChildren: function(){
// summary:
// Resets the menu and the length attribute of the button - and
// ensures that the label is appropriately set.
this.inherited(arguments);
var len = this.options.length;
this._isLoaded = false;
this._childrenLoaded = true;
// Set our length attribute and our value
if(!this._iReadOnly){
this.attr("readOnly", (len === 1));
delete this._iReadOnly;
}
if(!this._iDisabled){
this.attr("disabled", (len === 0));
delete this._iDisabled;
}
this._setValueAttr(this.value);
},
_setDisplay: function(/*String*/ newDisplay){
// summary: sets the display for the given value (or values)
this.containerNode.innerHTML = '<span class=" ' + this.baseClass + 'Label">' +
(newDisplay || this.emptyLabel || " ") +
'</span>';
this._layoutHack();
},
validate: function(/*Boolean*/ isFocused){
// summary:
// Called by oninit, onblur, and onkeypress.
// description:
// Show missing or invalid messages if appropriate, and highlight textbox field.
var isValid = this.isValid(isFocused);
this.state = isValid ? "" : "Error";
this._setStateClass();
dijit.setWaiState(this.focusNode, "invalid", isValid ? "false" : "true");
var message = isValid ? "" : this._missingMsg;
if(this._message !== message){
this._message = message;
dijit.hideTooltip(this.domNode);
if(message){
dijit.showTooltip(message, this.domNode, this.tooltipPosition);
}
}
return isValid;
},
isValid: function(/*Boolean*/ isFocused){
// summary: Whether or not this is a valid value
return (!this.required || !(/^\s*$/.test(this.value)));
},
reset: function(){
// summary: Overridden so that the state will be cleared.
this.inherited(arguments);
dijit.hideTooltip(this.domNode);
this.state = "";
this._setStateClass();
delete this._message;
},
postMixInProperties: function(){
// summary: set the missing message
this.inherited(arguments);
this._missingMsg = dojo.i18n.getLocalization("dijit.form", "validate",
this.lang).missingMessage;
},
postCreate: function(){
this.inherited(arguments);
if(dojo.attr(this.srcNodeRef, "disabled")){
this.attr("disabled", true);
}
},
startup: function(){
if(this._started){ return; }
// the child widget from srcNodeRef is the dropdown widget. Insert it in the page DOM,
// make it invisible, and store a reference to pass to the popup code.
if(!this.dropDown){
var dropDownNode = dojo.query("[widgetId]", this.dropDownContainer)[0];
this.dropDown = dijit.byNode(dropDownNode);
delete this.dropDownContainer;
}
this.inherited(arguments);
},
_onMenuMouseup: function(e){
// override this to actually "pretend" to do a click on our menu - it will
// call onExecute - so it will close our popup for us. For non-menu
// popups, it will not execute.
var dropDown = this.dropDown, t = e.target;
if(dropDown.onItemClick){
var menuItem;
while(t && !(menuItem = dijit.byNode(t))){
t = t.parentNode;
}
if(menuItem && menuItem.onClick && menuItem.getParent){
menuItem.getParent().onItemClick(menuItem, e);
}
}
// TODO: how to handle non-menu popups?
},
isLoaded: function(){
return this._isLoaded;
},
loadDropDown: function(/* Function */ loadCallback){
// summary: populates the menu
this._loadChildren();
this._isLoaded = true;
loadCallback();
},
_setReadOnlyAttr: function(value){
this._iReadOnly = value;
if(!value && this._childrenLoaded && this.options.length === 1){
return;
}
this.readOnly = value;
},
_setDisabledAttr: function(value){
this._iDisabled = value;
if(!value && this._childrenLoaded && this.options.length === 0){
return;
}
this.inherited(arguments);
}
});
| Emergen/zivios-panel | web/public/scripts/devel/current/dojox/form/DropDownSelect.js | JavaScript | gpl-3.0 | 6,496 |
/*
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'quicktable', 'th', {
more: ' เลือกอื่นๆ...'
} );
| johnforeland/Codename-JAK | public/ckeditor/plugins/quicktable/lang/th.js | JavaScript | gpl-3.0 | 240 |
import React, {Component} from "react";
import CoinInputApp from './CoinInputApp';
import { Glyphicon, Tab, Col, Row, Nav, NavItem } from 'react-bootstrap';
/** Component maps through portfolios array received from parent (PortfolioContainer) and creates tabs, each one renders CoinInputApp*/
export default class MultiplePortfolios extends Component {
constructor(props) {
super(props);
this.createNewPortfolio = this.createNewPortfolio.bind(this);
this.state = {
//controls focus on portfolio tabs
chosen: 0
}
}
//only pass active portfolio data to other components
passPortfolioMetadata(data, date, showChart){
if (data.id === this.state.chosen) {
this.props.getPortfolioMetadata(data, date, showChart);
}
}
//pass chosen coin details to chart component
showCoinChart(link, name, boolean){
this.props.showCoinChart(link, name, boolean)
}
createNewPortfolio(){
//take last portfolios id, add one, to get new id
let getId = this.props.portfolios[this.props.portfolios.length - 1].id + 1;
console.log('child asking for portfolio pls ' + getId);
//send parameters to portfolio creating function
this.props.createNewPortfolio(getId, 'Portfolio', 'Select date', []);
console.log('and now getId is ' + getId);
//focus on new portfolio tab
// this.setState({chosen: this.props.portfolios.length})
}
//send portfolio removing function id os chosen portfolio
handleRemovePortfolio(id){
this.props.removePortfolio(id);
//focus on previous tab
this.setState({chosen: id === 0 ? 0 : id-1})
}
editName(id, name){
this.props.editName(id, name)
}
handleSelect() {
//this is to prevent react-bootstrap console warning,
//selection is actually handled by tab itself
}
//map through portfolios array, create tab headers
render () {
let portfolioTabNav = this.props.portfolios.map((portfolios) => {
return (
<NavItem eventKey={portfolios.id} key={portfolios.id} onSelect={() => this.setState({chosen: portfolios.id})}>
<div className={this.state.chosen === portfolios.id ? 'tab-chosen' : 'tab'}>
{portfolios.name}
</div>
</NavItem>
)
});
//map through portfolios array, create tab content
let portfolioNode = this.props.portfolios.map((portfolios) => {
return <CoinInputApp portfolio={portfolios}
getPortfolioMetadata={this.passPortfolioMetadata.bind(this)}
showPortfolioChart={this.props.showPortfolioChart}
showCoinChart={this.showCoinChart.bind(this)}
key={portfolios.id}
handleRemovePortfolio={this.handleRemovePortfolio.bind(this)}
editName={this.editName.bind(this)}
/>
});
return (
<div className="portfolio-roster-app">
<Tab.Container
onSelect={this.handleSelect.bind(this)}
activeKey={this.state.chosen}
id="portfolio-tabs"
>
<Row className="clearfix">
<Col sm={12}>
<Nav className="tabs-nav" bsStyle="tabs">
{portfolioTabNav}
<NavItem className="add-port-btn" onClick={() => this.createNewPortfolio()}>
<Glyphicon className="add-port-gl" glyph="plus"/>
</NavItem>
</Nav>
</Col>
<Col sm={12}>
<Tab.Content animation={false}>
{portfolioNode}
</Tab.Content>
</Col>
</Row>
</Tab.Container>
</div>
)
}
}
| applebaum/open-cryptofolio | public/javascripts/components/MultiplePortfolios.js | JavaScript | gpl-3.0 | 4,140 |
/**
* Copyright (c) 2014 Geosolutions
*
* Published under the GPL license.
* See https://github.com/opengeo/gxp/raw/master/license.txt for the full text
* of the license.
*/
/** api: (define)
* module = gxp.data
* class = WPSUniqueValuesProxy
* base_link = `Ext.data.DataProxy <http://extjs.com/deploy/dev/docs/?class=Ext.data.DataProxy>`_
*/
Ext.namespace("gxp.data");
/** api: constructor
* .. class:: WPSUniqueValuesProxy(conn)
*
* A data proxy able to get unique values from the Geoserver WPS UniqueValues process.
* No config parameters are required on the constructor, the proxy can be
* fully configured on the doRequest method
*/
gxp.data.WPSUniqueValuesProxy = Ext.extend(Ext.data.DataProxy, {
constructor: function(conn) {
Ext.applyIf(conn, {
// data proxy complans if they are not defined, even if they
// are not actually used because they are overriden on the doExecute method
url: 'http://',
api: {
'read': 'load'
}
});
gxp.data.WPSUniqueValuesProxy.superclass.constructor.call(this, conn);
},
// private
client : null,
// private
getClient: function(url) {
if (this.client==null || this.url!=url) {
this.url = url;
this.client = new OpenLayers.WPSClient({servers: {'main': url}});
}
return this.client;
},
/**
* WPSUniqueValuesProxy implementation of DataProxy#doRequest
* @param {String} action The crud action type (only read is supported)
* @param {Ext.data.Record/Ext.data.Record[]} rs If action is load, rs will be null. Not used in this proxy
* @param {Object} params An object containing properties which are to be used as parameters for WPSClient
* <div class="sub-desc"><p>The following object is expected:
* <pre>
* {
* process: 'theProcessName',
* inputs: {
* anInput: 'inputValueA',
* aSecondInput: 'inputValueB'
* },
* output: 'outputName'
* },
* </pre></p>
* </div>
* @param {Ext.data.DataReader} reader The Reader object which converts the data
* object into a block of Ext.data.Records.
* @param {Function} callback
* <div class="sub-desc"><p>A function to be called after the request.
* The <tt>callback</tt> is passed the following arguments:<ul>
* <li><tt>r</tt> : Ext.data.Record[] The block of Ext.data.Records.</li>
* <li><tt>options</tt>: Options object from the action request</li>
* <li><tt>success</tt>: Boolean success indicator</li></ul></p></div>
* @param {Object} scope The scope (<code>this</code> reference) in which the callback function is executed. Defaults to the browser window.
* @param {Object} arg An optional argument which is passed to the callback as its second parameter.
* @protected
*/
doRequest : function(action, rs, params, reader, cb, scope, arg) {
var client = this.getClient(params.url);
if (!params.inputs) {
return;
}
var execOptions = {
inputs: {},
outputs: params.output,
type: "raw",
success: function(outputs) {
var records = reader.read({responseText: outputs});
cb.call(scope, records, arg);
}
};
var filter;
if(params.query) {
var queryValue = params.query;
if(queryValue.indexOf('*') === -1) {
queryValue = '*'+queryValue+'*';
}
filter = new OpenLayers.Filter.Comparison({
type: OpenLayers.Filter.Comparison.LIKE,
property: params.inputs.fieldName,
value: queryValue,
matchCase:false
});
}
execOptions.inputs.features = new OpenLayers.WPSProcess.ReferenceData({
href:'http://geoserver/wfs',
method:'POST', mimeType: 'text/xml',
body: {
wfs: {
featureType: params.inputs.featureTypeName,
version: '1.0.0',
filter: filter,
sortBy: params.inputs.fieldName
}
}
});
if (!(params.inputs.fieldName instanceof OpenLayers.WPSProcess.LiteralData)) {
execOptions.inputs.fieldName = new OpenLayers.WPSProcess.LiteralData({value: params.inputs.fieldName});
}
if (params.start) {
execOptions.inputs.startIndex = new OpenLayers.WPSProcess.LiteralData({value: params.start});
}
if (params.limit) {
execOptions.inputs.maxFeatures = new OpenLayers.WPSProcess.LiteralData({value: params.limit});
}
if (params.sortInfo && params.sortInfo.dir) {
execOptions.inputs.sort = new OpenLayers.WPSProcess.LiteralData({value: params.sortInfo.dir});
}
else {
execOptions.inputs.sort = new OpenLayers.WPSProcess.LiteralData({value:'ASC'});
}
var process = client.getProcess('main', params.process);
process.execute(execOptions);
}
});
Ext.reg('gxp_wpsuniquevaluesproxy', gxp.data.WPSUniqueValuesProxy); | mbarto/mapstore | mapcomposer/app/static/externals/gxp/src/script/data/WPSUniqueValuesProxy.js | JavaScript | gpl-3.0 | 5,259 |
semantic.customize = {};
// ready event
semantic.customize.ready = function() {
var
$accordion = $('.main.container .ui.accordion'),
$choice = $('.download .item'),
$popup = $('.main.container [data-content]'),
$checkbox = $('.download .item .checkbox'),
handler = {}
;
$choice
.on('click', function() {
$(this)
.find($checkbox)
.checkbox('toggle')
;
})
;
$checkbox
.checkbox()
;
$accordion
.accordion({
exclusive: false,
onChange: function() {
$('.ui.sticky').sticky('refresh');
}
})
;
$popup
.popup()
;
};
// attach ready event
$(document)
.ready(semantic.customize.ready)
; | michaelimperial/Nautilus | docs/server/files/javascript/customize.js | JavaScript | gpl-3.0 | 717 |
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'forms', 'ro', {
button: {
title: 'Proprietăţi buton',
text: 'Text (Valoare)',
type: 'Tip',
typeBtn: 'Buton',
typeSbm: 'Trimite',
typeRst: 'Reset'
},
checkboxAndRadio: {
checkboxTitle: 'Proprietăţi bifă (Checkbox)',
radioTitle: 'Proprietăţi buton radio (Radio Button)',
value: 'Valoare',
selected: 'Selectat',
required: 'Required' // MISSING
},
form: {
title: 'Proprietăţi formular (Form)',
menu: 'Proprietăţi formular (Form)',
action: 'Acţiune',
method: 'Metodă',
encoding: 'Encodare'
},
hidden: {
title: 'Proprietăţi câmp ascuns (Hidden Field)',
name: 'Nume',
value: 'Valoare'
},
select: {
title: 'Proprietăţi câmp selecţie (Selection Field)',
selectInfo: 'Informaţii',
opAvail: 'Opţiuni disponibile',
value: 'Valoare',
size: 'Mărime',
lines: 'linii',
chkMulti: 'Permite selecţii multiple',
required: 'Required', // MISSING
opText: 'Text',
opValue: 'Valoare',
btnAdd: 'Adaugă',
btnModify: 'Modifică',
btnUp: 'Sus',
btnDown: 'Jos',
btnSetValue: 'Setează ca valoare selectată',
btnDelete: 'Şterge'
},
textarea: {
title: 'Proprietăţi suprafaţă text (Textarea)',
cols: 'Coloane',
rows: 'Linii'
},
textfield: {
title: 'Proprietăţi câmp text (Text Field)',
name: 'Nume',
value: 'Valoare',
charWidth: 'Lărgimea caracterului',
maxChars: 'Caractere maxime',
required: 'Required', // MISSING
type: 'Tip',
typeText: 'Text',
typePass: 'Parolă',
typeEmail: 'Email',
typeSearch: 'Cauta',
typeTel: 'Numar de telefon',
typeUrl: 'URL'
}
} );
| Mediawiki-wysiwyg/WYSIWYG-CKeditor | WYSIWYG/ckeditor_source/plugins/forms/lang/ro.js | JavaScript | gpl-3.0 | 1,750 |
$(document).ready(function() {
var form = $("#signup");
var signup_pass_msg = $("#signup_pass_msg");
var signup_fail_msg = $("#signup_fail_msg");
var signup_instruct_msg = $("#signup_instruct_msg");
var inline_user_msg = $("#user_status");
var inline_user_error = $("#user_error");
var inline_pass_msg = $("#pass_status");
var inline_pass_error = $("#pass_error");
var inline_pass_conf_msg = $("pass_conf_status");
var inline_pass_conf_error = $("pass_conf_status");
var input_user = $("#username");
var input_pass = $("#password");
var input_pass_conf = $("#password_conf");
var signup_body = $("#signup_body");
var signup_header = $("#signup_header");
var signup_footer = $("#signup_footer");
//hide everything
signup_fail_msg.hide();
signup_pass_msg.hide();
signup_body.hide()
signup_instruct_msg.hide()
form.animate({width: 0, opacity: "0"},0)
form.animate({width: "95%", opacity: "1"},1000,function() {
signup_body.slideDown(1000);
signup_instruct_msg.slideDown(1000);
});
$(".inline_status").hide();
$(".inline_error").hide();
//make inline instructions appear when text box is in focus
input_user.focusin(function() {
inline_user_msg.slideDown();
});
input_user.focusout(function() {
inline_user_msg.slideUp();
var status = checkUsername($(this).val());
if (!status[0]) {
inline_user_error.text(status[1]);
inline_user_error.slideDown();
}
else {
inline_user_error.slideUp();
};
});
input_pass.focusin(function() {
inline_pass_msg.slideDown();
});
input_pass.on("input", function() {
var checkboxes = document.getElementsByClassName("pass_checkbox")
var strength = passwordStrength(input_pass.val());
// checkboxes[0].checked = true
index = 0;
// alert(checkboxes[0].checked);
while (index < checkboxes.length){
checkboxes[index].checked = strength[index];
index += 1;
};
});
input_pass.focusout(function() {
inline_pass_msg.slideUp();
if (input_pass.val() == ""){
inline_pass_error.text("A password must be set").slideDown()
} else {inline_pass_error.slideUp()}
});
input_pass_conf.focusin(function() {
inline_pass_conf_msg.slideDown();
});
input_pass_conf.focusout(function() {
inline_pass_conf_msg.slideUp();
var confcheck = checkPassConf(input_pass.val(),input_pass_conf.val())
if (confcheck[0]){
inline_pass_conf_error.slideUp();
}
else {
inline_pass_conf_error.text(confcheck[1]).slideDown()
}
});
//make status messages dissapear when clicked
$(".status_msg:not(#signup_instruct_msg)").click(function() {
$(this).slideUp();
});
form.submit(function(event) {
event.preventDefault();
var username = $("#username").val();
var password = input_pass.val();
var password_conf = input_pass_conf.val();
var captcha = grecaptcha.getResponse();
var usernameCheck = checkUsername(username)
if (!usernameCheck[0]) {
hideStatus(500, function() {
signup_fail_msg.text(usernameCheck[1]).slideDown();
});
return;
}
var passwordCheck = password.length != 0
if (!passwordCheck) {
hideStatus(500, function() {
signup_fail_msg.text("A password must be set.").slideDown();
});
return;
}
var confCheck = password == password_conf
if (!confCheck){
hideStatus(500, function() {
signup_fail_msg.text("Passwords did not match.").slideDown();
});
return;
};
if (grecaptcha.getResponse() == "") {
hideStatus(500, function() {
signup_fail_msg.text("reCAPTCHA not performed.").slideDown();
});
return;
}
$.post("signup.php", {
username: username,
password: password,
'g-recaptcha-response': captcha
}, function(res){
grecaptcha.reset()
if (res["messages"][0]["msgType"] == "success"){
$("#username").val("");
input_pass.val("");
input_pass_conf.val("");
hideStatus(500, function() {
signup_pass_msg.text(res["messages"][0]["message"]).slideDown();
});
}
else if (res["messages"][0]["msgType"] == "fail") {
hideStatus(500, function() {
signup_fail_msg.text(res["messages"][0]["message"]).slideDown();
});
}
else{
hideStatus(500, function() {
signup_fail_msg.text(res).slideDown();
});
}
})
});
});
function hideStatus(length,callback){
$(".status_msg").slideUp(length,callback);
};
function checkUsername(username) {
// username must be between 2 and 30 characters in length
if (!(2 <= username.length && username.length <= 30)) { return [false,"Username must contain between 2 and 30 characters."]; };
// username must only contain printable ascii characters (\x20_\x7e)
if (/[^\x20-\z7E]+/.test(username)) { return [false, "Username can only contain printable ASCII characters."]; };
// username cannot contain < , > or spaces
if (/[\<\> ]+/.test(username)) { return [false, "Username cannot contain '<', '>' or a space"];};
return [true,"Error"]; //something is wrong if the message box still shows after username is fine
};
function passwordStrength(password) {
length8 = password.length >= 8;
length16 = password.length >= 16;
hasUpper = /[A-Z]+/.test(password);
hasLower = /[a-z]+/.test(password);
hasSymbol = /[\x21-\x2F]+|[\x3A-\x40]+|[\x5B-\x60]+|[\x7B-\x7E]+/.test(password);
hasNumber = /[0-9]+/.test(password);
return [length8,length16,hasUpper,hasLower,hasNumber,hasSymbol];
};
function checkPassConf(password,password_conf) {
if (password != password_conf) {
return [false, "The two passwords do not match."]
}
else {return [true, "Error"]}
}; | Mitame/Notifi-Web | js/signup.js | JavaScript | gpl-3.0 | 5,516 |
import SagaTester from 'redux-saga-tester';
import * as recommendationsApi from 'amo/api/recommendations';
import recommendationsReducer, {
abortFetchRecommendations,
fetchRecommendations,
loadRecommendations,
} from 'amo/reducers/recommendations';
import recommendationsSaga from 'amo/sagas/recommendations';
import apiReducer from 'core/reducers/api';
import {
createStubErrorHandler,
fakeAddon,
dispatchClientMetadata,
} from 'tests/unit/helpers';
describe(__filename, () => {
let errorHandler;
let mockApi;
let sagaTester;
beforeEach(() => {
const clientData = dispatchClientMetadata();
errorHandler = createStubErrorHandler();
mockApi = sinon.mock(recommendationsApi);
sagaTester = new SagaTester({
initialState: clientData.state,
reducers: {
api: apiReducer,
recommendations: recommendationsReducer,
},
});
sagaTester.start(recommendationsSaga);
});
const guid = 'some-guid';
function _fetchRecommendations(params) {
sagaTester.dispatch(
fetchRecommendations({
errorHandlerId: errorHandler.id,
...params,
}),
);
}
it('calls the API to fetch recommendations', async () => {
const state = sagaTester.getState();
const recommendations = {
outcome: 'recommended_fallback',
fallback_reason: 'timeout',
results: [fakeAddon, fakeAddon],
};
mockApi
.expects('getRecommendations')
.withArgs({
api: state.api,
guid,
recommended: true,
})
.once()
.returns(Promise.resolve(recommendations));
_fetchRecommendations({ guid });
const expectedLoadAction = loadRecommendations({
addons: recommendations.results,
fallbackReason: recommendations.fallback_reason,
guid,
outcome: recommendations.outcome,
});
const loadAction = await sagaTester.waitFor(expectedLoadAction.type);
expect(loadAction).toEqual(expectedLoadAction);
mockApi.verify();
});
it('clears the error handler', async () => {
_fetchRecommendations({ guid });
const expectedAction = errorHandler.createClearingAction();
const action = await sagaTester.waitFor(expectedAction.type);
expect(action).toEqual(expectedAction);
});
it('dispatches an error and aborts the fetching', async () => {
const error = new Error('some API error maybe');
mockApi
.expects('getRecommendations')
.once()
.returns(Promise.reject(error));
_fetchRecommendations({ guid });
const expectedAction = errorHandler.createErrorAction(error);
const action = await sagaTester.waitFor(expectedAction.type);
expect(expectedAction).toEqual(action);
expect(sagaTester.getCalledActions()[3]).toEqual(
abortFetchRecommendations({ guid }),
);
});
});
| kumar303/addons-frontend | tests/unit/amo/sagas/test_recommendations.js | JavaScript | mpl-2.0 | 2,826 |
initSidebarItems({"trait":[["Typeable","Universal mixin trait for adding a `get_type` method."]]}); | susaing/doc.servo.org | typeable/sidebar-items.js | JavaScript | mpl-2.0 | 99 |
// Generated by CoffeeScript 1.7.1
(function() {
var universe;
universe = require('./universe');
universe.start();
console.log('The answer is' + universe.answer);
phantom.exit();
}).call(this);
| brandonaaskov/gunslinger-client | node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/module.js | JavaScript | mpl-2.0 | 209 |
'use strict';
// Third party libs
var when = require('when');
// Locally defined libs
var CRUDValueStream = require('./crudvaluestream');
// Export DataCollector class.
module.exports = RoomDataCollector;
// Provide an interface to collect data by room, delete data by room, and
// "iterate" over that data by room through a stream.
// @param {CRUDManager}
function RoomDataCollector(crudManager) {
this.crudManager = crudManager;
this._keysPerRoom = {};
this.crudManager.on('create', function(id) {
var room = id.substring(0, id.lastIndexOf('-'));
if (this._keysPerRoom[room] === undefined) {
this._keysPerRoom[room] = [];
}
this._keysPerRoom[room].push(id);
}.bind(this));
}
// Add data to the collection.
// @param {string} room name of room to add data to
// @param {object} data arbitrary data to store in room
// @returns {Promise}
RoomDataCollector.prototype.add = function(room, data) {
return this.crudManager.create(
room + '-' + Math.random().toString(36).substring(2),
data
);
};
// Get a stream of the data in a given room.
//
// If a room has no data when getDataForRoom is called, the returned stream
// soon after will end, emitting no objects.
// @param {string} room name of room to lookup data for
// @returns {Stream} a readable stream, each data entry will be an object
RoomDataCollector.prototype.getStream = function(room) {
return new CRUDValueStream(
this.crudManager,
(this._keysPerRoom[room] || []).slice()
);
};
// Delete all data objects that are in a given room.
// @param {string} room name of room to delete data from
// @returns {Promise}
RoomDataCollector.prototype.delete = function(room) {
if (this._keysPerRoom[room] === undefined) {
return when();
}
var promise = when.map(this._keysPerRoom[room], function(key) {
return this.crudManager.delete(key);
}.bind(this));
delete this._keysPerRoom[room];
return promise;
};
| councilforeconed/interactive-activities | src/server/roomdatacollector.js | JavaScript | mpl-2.0 | 1,939 |
// DO NOT EDIT! This test has been generated by tools/gentest.py.
// OffscreenCanvas test in a worker:2d.gradient.interpolate.solid
// Description:
// Note:
importScripts("/resources/testharness.js");
importScripts("/2dcontext/resources/canvas-tests.js");
var t = async_test("");
t.step(function() {
var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');
var g = ctx.createLinearGradient(0, 0, 100, 0);
g.addColorStop(0, '#0f0');
g.addColorStop(1, '#0f0');
ctx.fillStyle = g;
ctx.fillRect(0, 0, 100, 50);
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
t.done();
});
done();
| larsbergstrom/servo | tests/wpt/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.gradient.interpolate.solid.worker.js | JavaScript | mpl-2.0 | 649 |
/*
* Copyright (c) 2017 ThoughtWorks, Inc.
*
* Pixelated is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Pixelated is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
import i18n from 'i18next';
import i18nBackend from 'i18nextXHRBackend';
import I18nDetector from 'i18nextBrowserLanguageDetector';
const detector = new I18nDetector();
const detect = detector.detect.bind(detector);
detector.detect = (detectionOrder) => {
const result = detect(detectionOrder);
return result.replace('-', '_');
};
i18n
.use(i18nBackend)
.use(detector)
.init({
fallbackLng: 'en_US',
parseMissingKeyHandler: key => (`"${key} untranslated"`),
backend: {
loadPath: 'public/locales/{{lng}}/{{ns}}.json'
}
});
export default i18n;
| pixelated/pixelated-user-agent | web-ui/src/common/i18n.js | JavaScript | agpl-3.0 | 1,288 |
/* eslint-env node, mocha */
/* global expect */
/* eslint no-console: 0 */
'use strict';
// Uncomment the following lines to use the react test utilities
// import TestUtils from 'react-addons-test-utils';
import createComponent from 'helpers/shallowRenderHelper';
import FacebookComponent from 'components/socialMedia/FacebookComponent.js';
describe('FacebookComponent', () => {
let component;
beforeEach(() => {
component = createComponent(FacebookComponent);
});
it('should have its component name as default className', () => {
expect(component.props.className).to.equal('facebook-component');
});
});
| chimo/se-dir-frontend-react | test/components/socialMedia/FacebookComponentTest.js | JavaScript | agpl-3.0 | 630 |
import Mn from 'backbone.marionette';
import application from '../application';
import { timeToString } from '../libs/utils';
const Player = Mn.LayoutView.extend({
template: require('./templates/player'),
ui: {
player: 'audio',
currentTime: '#current-time',
totalTime: '#total-time',
progress: '#progress',
progressBar: '#progress-bar',
volume: '#volume',
volumeBar: '#volume-bar',
playButton: '#play',
trackname: '#trackname',
shuffle: '#shuffle',
repeat: '#repeat',
speaker: '#speaker'
},
events: {
'click #prev': 'prev',
'click #play': 'toggle',
'click #next': 'next',
'mousedown @ui.progressBar': 'skip',
'mousedown @ui.volumeBar': 'changeVol',
'click @ui.shuffle': 'toggleShuffle',
'click @ui.repeat': 'toggleRepeat',
'click @ui.speaker': 'toggleVolume'
},
initialize() {
this.listenTo(application.channel, {
'upnext:reset': this.render,
'player:next': this.next
});
this.listenTo(application.appState, 'change:currentTrack',
function(appState, currentTrack) {
if (currentTrack) {
this.load(currentTrack);
}
});
$(document).keyup((e) => {
e.preventDefault();
let audio = this.ui.player.get(0);
let volume;
switch (e.which) {
case 32: // 'Space'
this.toggle();
break;
case 39: // ArrowRight
this.next();
break;
case 37: // ArrowLeft
this.prev();
break;
case 38: // ArrowUp
volume = audio.volume + 0.1 > 1 ? 1 : audio.volume + 0.1;
audio.volume = volume;
application.appState.set('currentVolume', volume);
break;
case 40: // ArrowDown
volume = audio.volume - 0.1 < 0 ? 0 : audio.volume - 0.1;
audio.volume = volume;
application.appState.set('currentVolume', volume);
break;
case 77: // m
this.toggleVolume();
break;
}
});
$(document).mousemove((e) => {
if (this.volumeDown) {
this.changeVol(e);
} else if (this.progressDown) {
this.skip(e);
}
});
$(document).mouseup((e) => {
this.volumeDown = false;
this.progressDown = false;
});
},
onRender() {
let audio = this.ui.player.get(0);
audio.ontimeupdate = this.onTimeUpdate;
audio.onended = () => { this.next() };
audio.onvolumechange = this.onVolumeChange;
audio.volume = application.appState.get('currentVolume');
},
load(track) {
let title = track.get('metas').title;
let artist = track.get('metas').artist;
let text;
if (artist) {
text = artist + ' - ' + title;
} else {
text = title;
}
this.ui.trackname.text(text);
let self = this;
track.getStream(function(url) {
self.play(url);
});
},
play(url) {
let audio = this.ui.player.get(0);
audio.src = url;
audio.load();
audio.play();
this.ui.playButton.find('use').attr(
'xlink:href',
require('../assets/icons/pause-lg.svg')
);
},
toggle() {
let audio = this.ui.player.get(0);
if (audio.paused && audio.src) {
audio.play();
this.ui.playButton.find('use').attr(
'xlink:href',
require('../assets/icons/pause-lg.svg')
);
} else if (audio.src) {
audio.pause();
this.ui.playButton.find('use').attr(
'xlink:href',
require('../assets/icons/play-lg.svg')
);
}
},
prev() {
let upNext = application.upNext.get('tracks');
let currentTrack = application.appState.get('currentTrack');
let index = upNext.indexOf(currentTrack);
let prev = upNext.at(index - 1)
if (prev) {
application.appState.set('currentTrack', prev);
}
},
next() {
let repeat = application.appState.get('repeat');
let upNext = application.upNext.get('tracks');
let currentTrack = application.appState.get('currentTrack');
let index = upNext.indexOf(currentTrack) + 1;
let next = upNext.at(index)
if (repeat == 'track') {
this.replayCurrent();
} else if (next) {
application.appState.set('currentTrack', next);
} else if (repeat == 'playlist' && upNext.at(0)) {
if (upNext.length == 1) {
this.replayCurrent();
}
application.appState.set('currentTrack', upNext.at(0));
} else {
application.appState.set('currentTrack', undefined);
this.render();
}
},
replayCurrent() {
let audio = this.ui.player.get(0);
audio.currentTime = 0;
audio.play();
this.ui.playButton.find('use').attr(
'xlink:href',
require('../assets/icons/pause-lg.svg')
);
},
toggleShuffle() {
application.channel.trigger('upnext:addCurrentPlaylist');
let shuffle = application.appState.get('shuffle');
application.appState.set('shuffle', !shuffle);
this.ui.shuffle.toggleClass('active', !shuffle);
},
toggleRepeat() {
let repeat = application.appState.get('repeat');
switch (repeat) {
case 'false':
application.appState.set('repeat', 'track');
this.ui.repeat.toggleClass('active', true);
this.ui.repeat.find('use').attr(
'xlink:href',
require('../assets/icons/repeat-one-sm.svg')
);
break;
case 'track':
application.appState.set('repeat', 'playlist');
this.ui.repeat.find('use').attr(
'xlink:href',
require('../assets/icons/repeat-sm.svg')
);
break;
case 'playlist':
application.appState.set('repeat', 'false');
this.ui.repeat.toggleClass('active', false);
break;
}
},
toggleVolume() {
let audio = this.ui.player.get(0);
let mute = application.appState.get('mute');
application.appState.set('mute', !mute);
if (!mute) {
audio.volume = 0;
} else {
audio.volume = application.appState.get('currentVolume');
}
},
// Go to a certain time in the track
skip(e) {
this.progressDown = true;
let audio = this.ui.player.get(0);
let bar = this.ui.progressBar.get(0);
let percent = (e.pageX - bar.offsetLeft) / bar.clientWidth;
if (isFinite(audio.duration) && percent > 0 && percent < 1) {
audio.currentTime = audio.duration * percent;
}
},
// Change the time displayed
onTimeUpdate() {
let player = application.appLayout.getRegion('player').currentView;
let audio = player.ui.player.get(0);
player.ui.currentTime.html(timeToString(audio.currentTime));
player.ui.totalTime.html(timeToString(audio.duration));
let percent = audio.currentTime / audio.duration * 100 + '%';
player.ui.progress.width(percent);
},
// Change the volume displayed
onVolumeChange() {
let player = application.appLayout.getRegion('player').currentView;
let audio = player.ui.player.get(0);
let bar = player.ui.volumeBar.get(0);
let percent = audio.volume * 100 + '%';
player.ui.volume.width(percent);
if (audio.volume == 0) {
player.ui.speaker.find('use').attr(
'xlink:href',
require('../assets/icons/mute-sm.svg')
);
} else {
player.ui.speaker.find('use').attr(
'xlink:href',
require('../assets/icons/speaker-sm.svg')
);
}
},
// Change the volume
changeVol(e) {
this.volumeDown = true;
let audio = this.ui.player.get(0);
let bar = this.ui.volumeBar.get(0);
let volume = (e.pageX - bar.offsetLeft) / bar.clientWidth;
if (volume >= 0 && volume <= 1) {
audio.volume = volume;
application.appState.set('currentVolume', volume);
}
}
});
export default Player;
| kosssi/cozy-music | app/views/player.js | JavaScript | agpl-3.0 | 9,001 |
module.exports = function(core, config, store) {
core.on('setstate', changes => {
const future = store.with(changes);
if (changes && changes.nav && 'thread' in changes.nav && future.get('nav', 'mode') === 'chat') {
const threadId = future.get('nav', 'thread');
if (threadId) {
const roomId = future.get('nav', 'room');
const threadObj = future.getThreadById(threadId);
if (!threadObj) {
core.emit('getThreads', {
ref: threadId,
to: roomId
}, (err, res) => {
if (err) {
return;
}
if (res && res.results && res.results[0]) {
const thread = res.results[0];
core.emit('setstate', {
threads: {
[thread.to]: [ {
start: thread.startTime,
end: thread.startTime,
items: [ thread ]
} ]
}
});
}
});
}
}
}
}, 850);
};
| wesley1001/io.scrollback.neighborhoods | app/store.orig/rules/loadThread.js | JavaScript | agpl-3.0 | 887 |
/*
* (c) Copyright Ascensio System SIA 2010-2015
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
"use strict";
(function ($, window, undefined) {
var asc = window["Asc"];
var asc_applyFunction = asc.applyFunction;
var asc_Range = asc.Range;
function CCollaborativeEditing(handlers, isViewerMode) {
if (! (this instanceof CCollaborativeEditing)) {
return new CCollaborativeEditing();
}
this.m_nUseType = 1;
this.handlers = new asc.asc_CHandlersList(handlers);
this.m_bIsViewerMode = !!isViewerMode;
this.m_bGlobalLock = false;
this.m_bGlobalLockEditCell = false;
this.m_arrCheckLocks = [];
this.m_arrNeedUnlock = [];
this.m_arrNeedUnlock2 = [];
this.m_arrChanges = [];
this.m_oRecalcIndexColumns = {};
this.m_oRecalcIndexRows = {};
this.m_oInsertColumns = {};
this.m_oInsertRows = {};
this.init();
return this;
}
CCollaborativeEditing.prototype.init = function () {};
CCollaborativeEditing.prototype.clearRecalcIndex = function () {
delete this.m_oRecalcIndexColumns;
delete this.m_oRecalcIndexRows;
this.m_oRecalcIndexColumns = {};
this.m_oRecalcIndexRows = {};
};
CCollaborativeEditing.prototype.isCoAuthoringExcellEnable = function () {
return ASC_SPREADSHEET_API_CO_AUTHORING_ENABLE;
};
CCollaborativeEditing.prototype.startCollaborationEditing = function () {
this.m_nUseType = -1;
};
CCollaborativeEditing.prototype.endCollaborationEditing = function () {
if (this.m_nUseType <= 0) {
this.m_nUseType = 0;
}
};
CCollaborativeEditing.prototype.setViewerMode = function (isViewerMode) {
this.m_bIsViewerMode = isViewerMode;
};
CCollaborativeEditing.prototype.getCollaborativeEditing = function () {
if (true !== this.isCoAuthoringExcellEnable() || this.m_bIsViewerMode) {
return false;
}
return 1 !== this.m_nUseType;
};
CCollaborativeEditing.prototype.getOwnLocksLength = function () {
return this.m_arrNeedUnlock2.length;
};
CCollaborativeEditing.prototype.getGlobalLock = function () {
return this.m_bGlobalLock;
};
CCollaborativeEditing.prototype.getGlobalLockEditCell = function () {
return this.m_bGlobalLockEditCell;
};
CCollaborativeEditing.prototype.onStartEditCell = function () {
if (this.getCollaborativeEditing()) {
this.m_bGlobalLockEditCell = true;
}
};
CCollaborativeEditing.prototype.onStopEditCell = function () {
this.m_bGlobalLockEditCell = false;
};
CCollaborativeEditing.prototype.onStartCheckLock = function () {
this.m_arrCheckLocks.length = 0;
};
CCollaborativeEditing.prototype.addCheckLock = function (oItem) {
this.m_arrCheckLocks.push(oItem);
};
CCollaborativeEditing.prototype.onEndCheckLock = function (callback) {
var t = this;
if (this.m_arrCheckLocks.length > 0) {
this.handlers.trigger("askLock", this.m_arrCheckLocks, function (result) {
t.onCallbackAskLock(result, callback);
});
if (undefined !== callback) {
this.m_bGlobalLock = true;
}
} else {
asc_applyFunction(callback, true);
this.m_bGlobalLockEditCell = false;
}
};
CCollaborativeEditing.prototype.onCallbackAskLock = function (result, callback) {
this.m_bGlobalLock = false;
this.m_bGlobalLockEditCell = false;
if (result["lock"]) {
var count = this.m_arrCheckLocks.length;
for (var i = 0; i < count; ++i) {
var oItem = this.m_arrCheckLocks[i];
if (true !== oItem && false !== oItem) {
var oNewLock = new asc.CLock(oItem);
oNewLock.setType(c_oAscLockTypes.kLockTypeMine);
this.addUnlock2(oNewLock);
}
}
asc_applyFunction(callback, true);
} else {
if (result["error"]) {
asc_applyFunction(callback, false);
}
}
};
CCollaborativeEditing.prototype.addUnlock = function (LockClass) {
this.m_arrNeedUnlock.push(LockClass);
};
CCollaborativeEditing.prototype.addUnlock2 = function (Lock) {
this.m_arrNeedUnlock2.push(Lock);
this.handlers.trigger("updateDocumentCanSave");
};
CCollaborativeEditing.prototype.removeUnlock = function (Lock) {
for (var i = 0; i < this.m_arrNeedUnlock.length; ++i) {
if (Lock.Element["guid"] === this.m_arrNeedUnlock[i].Element["guid"]) {
this.m_arrNeedUnlock.splice(i, 1);
return true;
}
}
return false;
};
CCollaborativeEditing.prototype.addChanges = function (oChanges) {
this.m_arrChanges.push(oChanges);
};
CCollaborativeEditing.prototype.applyChanges = function () {
if (!this.isCoAuthoringExcellEnable()) {
return true;
}
var t = this;
var length = this.m_arrChanges.length;
if (0 < length) {
this.handlers.trigger("applyChanges", this.m_arrChanges, function () {
t.m_arrChanges.splice(0, length);
t.handlers.trigger("updateAfterApplyChanges");
});
return false;
}
return true;
};
CCollaborativeEditing.prototype.sendChanges = function () {
if (!this.isCoAuthoringExcellEnable()) {
return;
}
var bIsCollaborative = this.getCollaborativeEditing();
var bCheckRedraw = false;
var bRedrawGraphicObjects = false;
if (bIsCollaborative && (0 < this.m_arrNeedUnlock.length || 0 < this.m_arrNeedUnlock2.length)) {
bCheckRedraw = true;
this.handlers.trigger("cleanSelection");
}
var oLock = null;
while (bIsCollaborative && 0 < this.m_arrNeedUnlock2.length) {
oLock = this.m_arrNeedUnlock2.shift();
oLock.setType(c_oAscLockTypes.kLockTypeNone, false);
var drawing = g_oTableId.Get_ById(oLock.Element["rangeOrObjectId"]);
if (drawing && drawing.lockType !== c_oAscLockTypes.kLockTypeNone) {
drawing.lockType = c_oAscLockTypes.kLockTypeNone;
bRedrawGraphicObjects = true;
}
this.handlers.trigger("releaseLocks", oLock.Element["guid"]);
}
var nIndex = 0;
var nCount = this.m_arrNeedUnlock.length;
for (; bIsCollaborative && nIndex < nCount; ++nIndex) {
oLock = this.m_arrNeedUnlock[nIndex];
if (c_oAscLockTypes.kLockTypeOther2 === oLock.getType()) {
if (!this.handlers.trigger("checkCommentRemoveLock", oLock.Element)) {
drawing = g_oTableId.Get_ById(oLock.Element["rangeOrObjectId"]);
if (drawing && drawing.lockType !== c_oAscLockTypes.kLockTypeNone) {
drawing.lockType = c_oAscLockTypes.kLockTypeNone;
bRedrawGraphicObjects = true;
}
}
this.m_arrNeedUnlock.splice(nIndex, 1);
--nIndex;
--nCount;
}
}
this.handlers.trigger("sendChanges", this.getRecalcIndexSave(this.m_oRecalcIndexColumns), this.getRecalcIndexSave(this.m_oRecalcIndexRows));
if (bIsCollaborative) {
this._recalcLockArrayOthers();
delete this.m_oInsertColumns;
delete this.m_oInsertRows;
this.m_oInsertColumns = {};
this.m_oInsertRows = {};
this.clearRecalcIndex();
History.Clear();
if (bCheckRedraw) {
this.handlers.trigger("drawSelection");
this.handlers.trigger("drawFrozenPaneLines");
this.handlers.trigger("updateAllSheetsLock");
this.handlers.trigger("showComments");
}
if (bCheckRedraw || bRedrawGraphicObjects) {
this.handlers.trigger("showDrawingObjects");
}
if (0 === this.m_nUseType) {
this.m_nUseType = 1;
}
} else {
History.Reset_SavedIndex();
}
};
CCollaborativeEditing.prototype.getRecalcIndexSave = function (oRecalcIndex) {
var bHasIndex = false;
var result = {};
var element = null;
for (var sheetId in oRecalcIndex) {
if (!oRecalcIndex.hasOwnProperty(sheetId)) {
continue;
}
result[sheetId] = {
"_arrElements": []
};
for (var i = 0, length = oRecalcIndex[sheetId]._arrElements.length; i < length; ++i) {
bHasIndex = true;
element = oRecalcIndex[sheetId]._arrElements[i];
result[sheetId]["_arrElements"].push({
"_recalcType": element._recalcType,
"_position": element._position,
"_count": element._count,
"m_bIsSaveIndex": element.m_bIsSaveIndex
});
}
}
return bHasIndex ? result : null;
};
CCollaborativeEditing.prototype.S4 = function () {
return (((1 + Math.random()) * 65536) | 0).toString(16).substring(1);
};
CCollaborativeEditing.prototype.createGUID = function () {
return (this.S4() + this.S4() + "-" + this.S4() + "-" + this.S4() + "-" + this.S4() + "-" + this.S4() + this.S4() + this.S4());
};
CCollaborativeEditing.prototype.getLockInfo = function (typeElem, subType, sheetId, info) {
var oLockInfo = new asc.asc_CLockInfo();
oLockInfo["sheetId"] = sheetId;
oLockInfo["type"] = typeElem;
oLockInfo["subType"] = subType;
oLockInfo["guid"] = this.createGUID();
oLockInfo["rangeOrObjectId"] = info;
return oLockInfo;
};
CCollaborativeEditing.prototype.getLockByElem = function (element, type) {
var arrayElements = (c_oAscLockTypes.kLockTypeMine === type) ? this.m_arrNeedUnlock2 : this.m_arrNeedUnlock;
for (var i = 0; i < arrayElements.length; ++i) {
if (element["guid"] === arrayElements[i].Element["guid"]) {
return arrayElements[i];
}
}
return null;
};
CCollaborativeEditing.prototype.getLockIntersection = function (element, type, bCheckOnlyLockAll) {
var arrayElements = (c_oAscLockTypes.kLockTypeMine === type) ? this.m_arrNeedUnlock2 : this.m_arrNeedUnlock;
var oUnlockElement = null,
rangeTmp1, rangeTmp2;
for (var i = 0; i < arrayElements.length; ++i) {
oUnlockElement = arrayElements[i].Element;
if (c_oAscLockTypeElem.Sheet === element["type"] && element["type"] === oUnlockElement["type"]) {
if ((c_oAscLockTypes.kLockTypeMine !== type && false === bCheckOnlyLockAll) || element["sheetId"] === oUnlockElement["sheetId"]) {
return arrayElements[i];
}
}
if (element["sheetId"] !== oUnlockElement["sheetId"]) {
continue;
}
if (null !== element["subType"] && null !== oUnlockElement["subType"]) {
return arrayElements[i];
}
if (true === bCheckOnlyLockAll || (c_oAscLockTypeElemSubType.ChangeProperties === oUnlockElement["subType"] && c_oAscLockTypeElem.Sheet !== element["type"])) {
continue;
}
if (element["type"] === oUnlockElement["type"]) {
if (element["type"] === c_oAscLockTypeElem.Object) {
if (element["rangeOrObjectId"] === oUnlockElement["rangeOrObjectId"]) {
return arrayElements[i];
}
} else {
if (element["type"] === c_oAscLockTypeElem.Range) {
if (c_oAscLockTypeElemSubType.InsertRows === oUnlockElement["subType"] || c_oAscLockTypeElemSubType.InsertColumns === oUnlockElement["subType"]) {
continue;
}
rangeTmp1 = oUnlockElement["rangeOrObjectId"];
rangeTmp2 = element["rangeOrObjectId"];
if (rangeTmp2["c1"] > rangeTmp1["c2"] || rangeTmp2["c2"] < rangeTmp1["c1"] || rangeTmp2["r1"] > rangeTmp1["r2"] || rangeTmp2["r2"] < rangeTmp1["r1"]) {
continue;
}
return arrayElements[i];
}
}
} else {
if (oUnlockElement["type"] === c_oAscLockTypeElem.Sheet || (element["type"] === c_oAscLockTypeElem.Sheet && c_oAscLockTypes.kLockTypeMine !== type)) {
return arrayElements[i];
}
}
}
return false;
};
CCollaborativeEditing.prototype.getLockElem = function (typeElem, type, sheetId) {
var arrayElements = (c_oAscLockTypes.kLockTypeMine === type) ? this.m_arrNeedUnlock2 : this.m_arrNeedUnlock;
var count = arrayElements.length;
var element = null,
oRangeOrObjectId = null;
var result = [];
var c1, c2, r1, r2;
if (!this.m_oRecalcIndexColumns.hasOwnProperty(sheetId)) {
this.m_oRecalcIndexColumns[sheetId] = new CRecalcIndex();
}
if (!this.m_oRecalcIndexRows.hasOwnProperty(sheetId)) {
this.m_oRecalcIndexRows[sheetId] = new CRecalcIndex();
}
for (var i = 0; i < count; ++i) {
element = arrayElements[i].Element;
if (element["sheetId"] !== sheetId || element["type"] !== typeElem) {
continue;
}
if (c_oAscLockTypes.kLockTypeMine === type && c_oAscLockTypeElem.Range === typeElem && (c_oAscLockTypeElemSubType.DeleteColumns === element["subType"] || c_oAscLockTypeElemSubType.DeleteRows === element["subType"])) {
continue;
}
if (c_oAscLockTypeElem.Range === typeElem && (c_oAscLockTypeElemSubType.InsertColumns === element["subType"] || c_oAscLockTypeElemSubType.InsertRows === element["subType"])) {
continue;
}
if (c_oAscLockTypeElemSubType.ChangeProperties === element["subType"]) {
continue;
}
oRangeOrObjectId = element["rangeOrObjectId"];
if (c_oAscLockTypeElem.Range === typeElem) {
if (c_oAscLockTypes.kLockTypeMine !== type && c_oAscLockTypeElem.Range === typeElem && (c_oAscLockTypeElemSubType.DeleteColumns === element["subType"] || c_oAscLockTypeElemSubType.DeleteRows === element["subType"])) {
c1 = oRangeOrObjectId["c1"];
c2 = oRangeOrObjectId["c2"];
r1 = oRangeOrObjectId["r1"];
r2 = oRangeOrObjectId["r2"];
} else {
c1 = this.m_oRecalcIndexColumns[sheetId].getLockOther(oRangeOrObjectId["c1"], type);
c2 = this.m_oRecalcIndexColumns[sheetId].getLockOther(oRangeOrObjectId["c2"], type);
r1 = this.m_oRecalcIndexRows[sheetId].getLockOther(oRangeOrObjectId["r1"], type);
r2 = this.m_oRecalcIndexRows[sheetId].getLockOther(oRangeOrObjectId["r2"], type);
}
if (null === c1 || null === c2 || null === r1 || null === r2) {
continue;
}
oRangeOrObjectId = new asc_Range(c1, r1, c2, r2);
}
result.push(oRangeOrObjectId);
}
return result;
};
CCollaborativeEditing.prototype.getLockCellsMe = function (sheetId) {
return this.getLockElem(c_oAscLockTypeElem.Range, c_oAscLockTypes.kLockTypeMine, sheetId);
};
CCollaborativeEditing.prototype.getLockCellsOther = function (sheetId) {
return this.getLockElem(c_oAscLockTypeElem.Range, c_oAscLockTypes.kLockTypeOther, sheetId);
};
CCollaborativeEditing.prototype.getLockObjectsMe = function (sheetId) {
return this.getLockElem(c_oAscLockTypeElem.Object, c_oAscLockTypes.kLockTypeMine, sheetId);
};
CCollaborativeEditing.prototype.getLockObjectsOther = function (sheetId) {
return this.getLockElem(c_oAscLockTypeElem.Object, c_oAscLockTypes.kLockTypeOther, sheetId);
};
CCollaborativeEditing.prototype.isLockAllOther = function (sheetId) {
var arrayElements = this.m_arrNeedUnlock;
var count = arrayElements.length;
var element = null;
var oLockedObjectType = c_oAscMouseMoveLockedObjectType.None;
for (var i = 0; i < count; ++i) {
element = arrayElements[i].Element;
if (element["sheetId"] === sheetId) {
if (element["type"] === c_oAscLockTypeElem.Sheet) {
oLockedObjectType = c_oAscMouseMoveLockedObjectType.Sheet;
break;
} else {
if (element["type"] === c_oAscLockTypeElem.Range && null !== element["subType"]) {
oLockedObjectType = c_oAscMouseMoveLockedObjectType.TableProperties;
}
}
}
}
return oLockedObjectType;
};
CCollaborativeEditing.prototype._recalcLockArray = function (typeLock, oRecalcIndexColumns, oRecalcIndexRows) {
var arrayElements = (c_oAscLockTypes.kLockTypeMine === typeLock) ? this.m_arrNeedUnlock2 : this.m_arrNeedUnlock;
var count = arrayElements.length;
var element = null,
oRangeOrObjectId = null;
var i;
var sheetId = -1;
for (i = 0; i < count; ++i) {
element = arrayElements[i].Element;
if (c_oAscLockTypeElem.Range !== element["type"] || c_oAscLockTypeElemSubType.InsertColumns === element["subType"] || c_oAscLockTypeElemSubType.InsertRows === element["subType"] || c_oAscLockTypeElemSubType.DeleteColumns === element["subType"] || c_oAscLockTypeElemSubType.DeleteRows === element["subType"]) {
continue;
}
sheetId = element["sheetId"];
oRangeOrObjectId = element["rangeOrObjectId"];
if (oRecalcIndexColumns && oRecalcIndexColumns.hasOwnProperty(sheetId)) {
oRangeOrObjectId["c1"] = oRecalcIndexColumns[sheetId].getLockMe(oRangeOrObjectId["c1"]);
oRangeOrObjectId["c2"] = oRecalcIndexColumns[sheetId].getLockMe(oRangeOrObjectId["c2"]);
}
if (oRecalcIndexRows && oRecalcIndexRows.hasOwnProperty(sheetId)) {
oRangeOrObjectId["r1"] = oRecalcIndexRows[sheetId].getLockMe(oRangeOrObjectId["r1"]);
oRangeOrObjectId["r2"] = oRecalcIndexRows[sheetId].getLockMe(oRangeOrObjectId["r2"]);
}
}
};
CCollaborativeEditing.prototype._recalcLockArrayOthers = function () {
var typeLock = c_oAscLockTypes.kLockTypeOther;
var arrayElements = (c_oAscLockTypes.kLockTypeMine === typeLock) ? this.m_arrNeedUnlock2 : this.m_arrNeedUnlock;
var count = arrayElements.length;
var element = null,
oRangeOrObjectId = null;
var i;
var sheetId = -1;
for (i = 0; i < count; ++i) {
element = arrayElements[i].Element;
if (c_oAscLockTypeElem.Range !== element["type"] || c_oAscLockTypeElemSubType.InsertColumns === element["subType"] || c_oAscLockTypeElemSubType.InsertRows === element["subType"]) {
continue;
}
sheetId = element["sheetId"];
oRangeOrObjectId = element["rangeOrObjectId"];
if (this.m_oRecalcIndexColumns.hasOwnProperty(sheetId)) {
oRangeOrObjectId["c1"] = this.m_oRecalcIndexColumns[sheetId].getLockOther(oRangeOrObjectId["c1"]);
oRangeOrObjectId["c2"] = this.m_oRecalcIndexColumns[sheetId].getLockOther(oRangeOrObjectId["c2"]);
}
if (this.m_oRecalcIndexRows.hasOwnProperty(sheetId)) {
oRangeOrObjectId["r1"] = this.m_oRecalcIndexRows[sheetId].getLockOther(oRangeOrObjectId["r1"]);
oRangeOrObjectId["r2"] = this.m_oRecalcIndexRows[sheetId].getLockOther(oRangeOrObjectId["r2"]);
}
}
};
CCollaborativeEditing.prototype.addRecalcIndex = function (type, oRecalcIndex) {
if (null == oRecalcIndex) {
return null;
}
var nIndex = 0;
var nRecalcType = c_oAscRecalcIndexTypes.RecalcIndexAdd;
var oRecalcIndexElement = null;
var oRecalcIndexResult = {};
var oRecalcIndexTmp = ("0" === type) ? this.m_oRecalcIndexColumns : this.m_oRecalcIndexRows;
for (var sheetId in oRecalcIndex) {
if (oRecalcIndex.hasOwnProperty(sheetId)) {
if (!oRecalcIndexTmp.hasOwnProperty(sheetId)) {
oRecalcIndexTmp[sheetId] = new CRecalcIndex();
}
if (!oRecalcIndexResult.hasOwnProperty(sheetId)) {
oRecalcIndexResult[sheetId] = new CRecalcIndex();
}
for (; nIndex < oRecalcIndex[sheetId]["_arrElements"].length; ++nIndex) {
oRecalcIndexElement = oRecalcIndex[sheetId]["_arrElements"][nIndex];
if (true === oRecalcIndexElement["m_bIsSaveIndex"]) {
continue;
}
nRecalcType = (c_oAscRecalcIndexTypes.RecalcIndexAdd === oRecalcIndexElement["_recalcType"]) ? c_oAscRecalcIndexTypes.RecalcIndexRemove : c_oAscRecalcIndexTypes.RecalcIndexAdd;
oRecalcIndexTmp[sheetId].add(nRecalcType, oRecalcIndexElement["_position"], oRecalcIndexElement["_count"], true);
oRecalcIndexResult[sheetId].add(nRecalcType, oRecalcIndexElement["_position"], oRecalcIndexElement["_count"], true);
}
}
}
return oRecalcIndexResult;
};
CCollaborativeEditing.prototype.undoCols = function (sheetId, count) {
if (this.isCoAuthoringExcellEnable()) {
if (!this.m_oRecalcIndexColumns.hasOwnProperty(sheetId)) {
return;
}
this.m_oRecalcIndexColumns[sheetId].remove(count);
}
};
CCollaborativeEditing.prototype.undoRows = function (sheetId, count) {
if (this.isCoAuthoringExcellEnable()) {
if (!this.m_oRecalcIndexRows.hasOwnProperty(sheetId)) {
return;
}
this.m_oRecalcIndexRows[sheetId].remove(count);
}
};
CCollaborativeEditing.prototype.removeCols = function (sheetId, position, count) {
if (this.isCoAuthoringExcellEnable()) {
if (!this.m_oRecalcIndexColumns.hasOwnProperty(sheetId)) {
this.m_oRecalcIndexColumns[sheetId] = new CRecalcIndex();
}
this.m_oRecalcIndexColumns[sheetId].add(c_oAscRecalcIndexTypes.RecalcIndexRemove, position, count, false);
}
};
CCollaborativeEditing.prototype.addCols = function (sheetId, position, count) {
if (this.isCoAuthoringExcellEnable()) {
if (!this.m_oRecalcIndexColumns.hasOwnProperty(sheetId)) {
this.m_oRecalcIndexColumns[sheetId] = new CRecalcIndex();
}
this.m_oRecalcIndexColumns[sheetId].add(c_oAscRecalcIndexTypes.RecalcIndexAdd, position, count, false);
}
};
CCollaborativeEditing.prototype.removeRows = function (sheetId, position, count) {
if (this.isCoAuthoringExcellEnable()) {
if (!this.m_oRecalcIndexRows.hasOwnProperty(sheetId)) {
this.m_oRecalcIndexRows[sheetId] = new CRecalcIndex();
}
this.m_oRecalcIndexRows[sheetId].add(c_oAscRecalcIndexTypes.RecalcIndexRemove, position, count, false);
}
};
CCollaborativeEditing.prototype.addRows = function (sheetId, position, count) {
if (this.isCoAuthoringExcellEnable()) {
if (!this.m_oRecalcIndexRows.hasOwnProperty(sheetId)) {
this.m_oRecalcIndexRows[sheetId] = new CRecalcIndex();
}
this.m_oRecalcIndexRows[sheetId].add(c_oAscRecalcIndexTypes.RecalcIndexAdd, position, count, false);
}
};
CCollaborativeEditing.prototype.addColsRange = function (sheetId, range) {
if (!this.m_oInsertColumns.hasOwnProperty(sheetId)) {
this.m_oInsertColumns[sheetId] = [];
}
var arrInsertColumns = this.m_oInsertColumns[sheetId];
var countCols = range.c2 - range.c1 + 1;
var isAddNewRange = true;
for (var i = 0; i < arrInsertColumns.length; ++i) {
if (arrInsertColumns[i].c1 > range.c1) {
arrInsertColumns[i].c1 += countCols;
arrInsertColumns[i].c2 += countCols;
} else {
if (arrInsertColumns[i].c1 <= range.c1 && arrInsertColumns[i].c2 >= range.c1) {
arrInsertColumns[i].c2 += countCols;
isAddNewRange = false;
}
}
}
if (isAddNewRange) {
arrInsertColumns.push(range);
}
};
CCollaborativeEditing.prototype.addRowsRange = function (sheetId, range) {
if (!this.m_oInsertRows.hasOwnProperty(sheetId)) {
this.m_oInsertRows[sheetId] = [];
}
var arrInsertRows = this.m_oInsertRows[sheetId];
var countRows = range.r2 - range.r1 + 1;
var isAddNewRange = true;
for (var i = 0; i < arrInsertRows.length; ++i) {
if (arrInsertRows[i].r1 > range.r1) {
arrInsertRows[i].r1 += countRows;
arrInsertRows[i].r2 += countRows;
} else {
if (arrInsertRows[i].r1 <= range.r1 && arrInsertRows[i].r2 >= range.r1) {
arrInsertRows[i].r2 += countRows;
isAddNewRange = false;
}
}
}
if (isAddNewRange) {
arrInsertRows.push(range);
}
};
CCollaborativeEditing.prototype.removeColsRange = function (sheetId, range) {
if (!this.m_oInsertColumns.hasOwnProperty(sheetId)) {
return;
}
var arrInsertColumns = this.m_oInsertColumns[sheetId];
var countCols = range.c2 - range.c1 + 1;
for (var i = 0; i < arrInsertColumns.length; ++i) {
if (arrInsertColumns[i].c1 > range.c2) {
arrInsertColumns[i].c1 -= countCols;
arrInsertColumns[i].c2 -= countCols;
} else {
if (arrInsertColumns[i].c1 >= range.c1 && arrInsertColumns[i].c2 <= range.c2) {
arrInsertColumns.splice(i, 1);
i -= 1;
} else {
if (arrInsertColumns[i].c1 >= range.c1 && arrInsertColumns[i].c1 <= range.c2 && arrInsertColumns[i].c2 > range.c2) {
arrInsertColumns[i].c1 = range.c2 + 1;
arrInsertColumns[i].c1 -= countCols;
arrInsertColumns[i].c2 -= countCols;
} else {
if (arrInsertColumns[i].c1 < range.c1 && arrInsertColumns[i].c2 >= range.c1 && arrInsertColumns[i].c2 <= range.c2) {
arrInsertColumns[i].c2 = range.c1 - 1;
} else {
if (arrInsertColumns[i].c1 < range.c1 && arrInsertColumns[i].c2 > range.c2) {
arrInsertColumns[i].c2 -= countCols;
}
}
}
}
}
}
};
CCollaborativeEditing.prototype.removeRowsRange = function (sheetId, range) {
if (!this.m_oInsertRows.hasOwnProperty(sheetId)) {
return;
}
var arrInsertRows = this.m_oInsertRows[sheetId];
var countRows = range.r2 - range.r1 + 1;
for (var i = 0; i < arrInsertRows.length; ++i) {
if (arrInsertRows[i].r1 > range.r2) {
arrInsertRows[i].r1 -= countRows;
arrInsertRows[i].r2 -= countRows;
} else {
if (arrInsertRows[i].r1 >= range.r1 && arrInsertRows[i].r2 <= range.r2) {
arrInsertRows.splice(i, 1);
i -= 1;
} else {
if (arrInsertRows[i].r1 >= range.r1 && arrInsertRows[i].r1 <= range.r2 && arrInsertRows[i].r2 > range.r2) {
arrInsertRows[i].r1 = range.r2 + 1;
arrInsertRows[i].r1 -= countRows;
arrInsertRows[i].r2 -= countRows;
} else {
if (arrInsertRows[i].r1 < range.r1 && arrInsertRows[i].r2 >= range.r1 && arrInsertRows[i].r2 <= range.r2) {
arrInsertRows[i].r2 = range.r1 - 1;
} else {
if (arrInsertRows[i].r1 < range.r1 && arrInsertRows[i].r2 > range.r2) {
arrInsertRows[i].r2 -= countRows;
}
}
}
}
}
}
};
CCollaborativeEditing.prototype.isIntersectionInCols = function (sheetId, col) {
if (!this.m_oInsertColumns.hasOwnProperty(sheetId)) {
return false;
}
var arrInsertColumns = this.m_oInsertColumns[sheetId];
for (var i = 0; i < arrInsertColumns.length; ++i) {
if (arrInsertColumns[i].c1 <= col && col <= arrInsertColumns[i].c2) {
return true;
}
}
return false;
};
CCollaborativeEditing.prototype.isIntersectionInRows = function (sheetId, row) {
if (!this.m_oInsertRows.hasOwnProperty(sheetId)) {
return false;
}
var arrInsertRows = this.m_oInsertRows[sheetId];
for (var i = 0; i < arrInsertRows.length; ++i) {
if (arrInsertRows[i].r1 <= row && row <= arrInsertRows[i].r2) {
return true;
}
}
return false;
};
CCollaborativeEditing.prototype.getArrayInsertColumnsBySheetId = function (sheetId) {
if (!this.m_oInsertColumns.hasOwnProperty(sheetId)) {
return [];
}
return this.m_oInsertColumns[sheetId];
};
CCollaborativeEditing.prototype.getArrayInsertRowsBySheetId = function (sheetId) {
if (!this.m_oInsertRows.hasOwnProperty(sheetId)) {
return [];
}
return this.m_oInsertRows[sheetId];
};
CCollaborativeEditing.prototype.getLockMeColumn = function (sheetId, col) {
if (!this.m_oRecalcIndexColumns.hasOwnProperty(sheetId)) {
return col;
}
return this.m_oRecalcIndexColumns[sheetId].getLockMe(col);
};
CCollaborativeEditing.prototype.getLockMeRow = function (sheetId, row) {
if (!this.m_oRecalcIndexRows.hasOwnProperty(sheetId)) {
return row;
}
return this.m_oRecalcIndexRows[sheetId].getLockMe(row);
};
CCollaborativeEditing.prototype.getLockMeColumn2 = function (sheetId, col) {
if (!this.m_oRecalcIndexColumns.hasOwnProperty(sheetId)) {
return col;
}
return this.m_oRecalcIndexColumns[sheetId].getLockMe2(col);
};
CCollaborativeEditing.prototype.getLockMeRow2 = function (sheetId, row) {
if (!this.m_oRecalcIndexRows.hasOwnProperty(sheetId)) {
return row;
}
return this.m_oRecalcIndexRows[sheetId].getLockMe2(row);
};
CCollaborativeEditing.prototype.getLockOtherColumn2 = function (sheetId, col) {
if (!this.m_oRecalcIndexColumns.hasOwnProperty(sheetId)) {
return col;
}
return this.m_oRecalcIndexColumns[sheetId].getLockSaveOther(col);
};
CCollaborativeEditing.prototype.getLockOtherRow2 = function (sheetId, row) {
if (!this.m_oRecalcIndexRows.hasOwnProperty(sheetId)) {
return row;
}
return this.m_oRecalcIndexRows[sheetId].getLockSaveOther(row);
};
function CLock(element) {
if (! (this instanceof CLock)) {
return new CLock(element);
}
this.Type = c_oAscLockTypes.kLockTypeNone;
this.UserId = null;
this.Element = element;
this.init();
return this;
}
CLock.prototype.init = function () {};
CLock.prototype.getType = function () {
return this.Type;
};
CLock.prototype.setType = function (newType) {
if (newType === c_oAscLockTypes.kLockTypeNone) {
this.UserId = null;
}
this.Type = newType;
};
CLock.prototype.Lock = function (bMine) {
if (c_oAscLockTypes.kLockTypeNone === this.Type) {
if (true === bMine) {
this.Type = c_oAscLockTypes.kLockTypeMine;
} else {
this.Type = c_oAscLockTypes.kLockTypeOther;
}
}
};
CLock.prototype.setUserId = function (UserId) {
this.UserId = UserId;
};
function CRecalcIndexElement(recalcType, position, bIsSaveIndex) {
if (! (this instanceof CRecalcIndexElement)) {
return new CRecalcIndexElement(recalcType, position, bIsSaveIndex);
}
this._recalcType = recalcType;
this._position = position;
this._count = 1;
this.m_bIsSaveIndex = !!bIsSaveIndex;
return this;
}
CRecalcIndexElement.prototype.getLockOther = function (position, type) {
var inc = (c_oAscRecalcIndexTypes.RecalcIndexAdd === this._recalcType) ? +1 : -1;
if (position === this._position && c_oAscRecalcIndexTypes.RecalcIndexRemove === this._recalcType && true === this.m_bIsSaveIndex) {
return null;
} else {
if (position === this._position && c_oAscRecalcIndexTypes.RecalcIndexRemove === this._recalcType && c_oAscLockTypes.kLockTypeMine === type && false === this.m_bIsSaveIndex) {
return null;
} else {
if (position < this._position) {
return position;
} else {
return (position + inc);
}
}
}
};
CRecalcIndexElement.prototype.getLockSaveOther = function (position, type) {
if (this.m_bIsSaveIndex) {
return position;
}
var inc = (c_oAscRecalcIndexTypes.RecalcIndexAdd === this._recalcType) ? +1 : -1;
if (position === this._position && c_oAscRecalcIndexTypes.RecalcIndexRemove === this._recalcType && true === this.m_bIsSaveIndex) {
return null;
} else {
if (position === this._position && c_oAscRecalcIndexTypes.RecalcIndexRemove === this._recalcType && c_oAscLockTypes.kLockTypeMine === type && false === this.m_bIsSaveIndex) {
return null;
} else {
if (position < this._position) {
return position;
} else {
return (position + inc);
}
}
}
};
CRecalcIndexElement.prototype.getLockMe = function (position) {
var inc = (c_oAscRecalcIndexTypes.RecalcIndexAdd === this._recalcType) ? -1 : +1;
if (position < this._position) {
return position;
} else {
return (position + inc);
}
};
CRecalcIndexElement.prototype.getLockMe2 = function (position) {
var inc = (c_oAscRecalcIndexTypes.RecalcIndexAdd === this._recalcType) ? -1 : +1;
if (true !== this.m_bIsSaveIndex || position < this._position) {
return position;
} else {
return (position + inc);
}
};
function CRecalcIndex() {
if (! (this instanceof CRecalcIndex)) {
return new CRecalcIndex();
}
this._arrElements = [];
return this;
}
CRecalcIndex.prototype.add = function (recalcType, position, count, bIsSaveIndex) {
for (var i = 0; i < count; ++i) {
this._arrElements.push(new CRecalcIndexElement(recalcType, position, bIsSaveIndex));
}
};
CRecalcIndex.prototype.remove = function (count) {
for (var i = 0; i < count; ++i) {
this._arrElements.pop();
}
};
CRecalcIndex.prototype.clear = function () {
this._arrElements.length = 0;
};
CRecalcIndex.prototype.getLockOther = function (position, type) {
var newPosition = position;
var count = this._arrElements.length;
if (0 >= count) {
return newPosition;
}
var bIsDirect = !this._arrElements[0].m_bIsSaveIndex;
var i;
if (bIsDirect) {
for (i = 0; i < count; ++i) {
newPosition = this._arrElements[i].getLockOther(newPosition, type);
if (null === newPosition) {
break;
}
}
} else {
for (i = count - 1; i >= 0; --i) {
newPosition = this._arrElements[i].getLockOther(newPosition, type);
if (null === newPosition) {
break;
}
}
}
return newPosition;
};
CRecalcIndex.prototype.getLockSaveOther = function (position, type) {
var newPosition = position;
var count = this._arrElements.length;
for (var i = 0; i < count; ++i) {
newPosition = this._arrElements[i].getLockSaveOther(newPosition, type);
if (null === newPosition) {
break;
}
}
return newPosition;
};
CRecalcIndex.prototype.getLockMe = function (position) {
var newPosition = position;
var count = this._arrElements.length;
if (0 >= count) {
return newPosition;
}
var bIsDirect = this._arrElements[0].m_bIsSaveIndex;
var i;
if (bIsDirect) {
for (i = 0; i < count; ++i) {
newPosition = this._arrElements[i].getLockMe(newPosition);
if (null === newPosition) {
break;
}
}
} else {
for (i = count - 1; i >= 0; --i) {
newPosition = this._arrElements[i].getLockMe(newPosition);
if (null === newPosition) {
break;
}
}
}
return newPosition;
};
CRecalcIndex.prototype.getLockMe2 = function (position) {
var newPosition = position;
var count = this._arrElements.length;
if (0 >= count) {
return newPosition;
}
var bIsDirect = this._arrElements[0].m_bIsSaveIndex;
var i;
if (bIsDirect) {
for (i = 0; i < count; ++i) {
newPosition = this._arrElements[i].getLockMe2(newPosition);
if (null === newPosition) {
break;
}
}
} else {
for (i = count - 1; i >= 0; --i) {
newPosition = this._arrElements[i].getLockMe2(newPosition);
if (null === newPosition) {
break;
}
}
}
return newPosition;
};
asc.CCollaborativeEditing = CCollaborativeEditing;
asc.CLock = CLock;
asc.CRecalcIndexElement = CRecalcIndexElement;
asc.CRecalcIndex = CRecalcIndex;
})(jQuery, window); | fluent93/DocumentServer | OfficeWeb/sdk/Excel/model/CollaborativeEditing.js | JavaScript | agpl-3.0 | 42,243 |
"use strict";
module.exports = {
HTML5: require("./HTML5")
}; | asm-products/notello | node_modules/react-dnd/dist-modules/backends/index.js | JavaScript | agpl-3.0 | 64 |
import _ from 'lodash';
export function getScreenDetails() {
let widthLabel,
widthPixels,
pixelDensity,
isRetina;
let widths = {
'$width-xxs': 500,
'$width-xs': 728,
'$width-s': 970,
'$width-m': 1024,
'$width-l': 1200
}
if (typeof window != "undefined") {
widthPixels = window.innerWidth;
pixelDensity = window.devicePixelRatio;
} else {
widthPixels = 1200;
pixelDensity = 1;
}
if(widthPixels <= 500) {
widthLabel = '$width-xxs'
} else if (widthPixels <= 728) {
widthLabel = '$width-xs'
} else if (widthPixels <= 970) {
widthLabel = '$width-s'
} else if (widthPixels <= 1024) {
widthLabel = '$width-m'
} else if (widthPixels <= 1200) {
widthLabel = '$width-l'
}
isRetina = pixelDensity > 1.5;
return {
widthPixels: widthPixels,
widthLabel: widthLabel,
widthThresholds: widths,
pixelDensity: pixelDensity,
isRetina: isRetina,
isExtraSmall: (0 <= _.indexOf(
['$width-xs', '$width-xxs'],
widthLabel
))
};
};
| hiddentao/heartnotes | src/js/utils/screen.js | JavaScript | agpl-3.0 | 1,061 |
// ***** tree loader ***** //
og.MemberChooserTreeLoader = function(config) {
og.MemberChooserTreeLoader.superclass.constructor.call(this, config);
if (this.ownerTree) {
this.ownerTree.totalNodes = 0 ;
}
};
Ext.extend(og.MemberChooserTreeLoader , Ext.tree.TreeLoader, {
ownerTree: null ,
createNode: function (attr) {
if ( Ext.type(this.ownerTree ) ){
if (this.ownerTree.totalNodes) {
this.ownerTree.totalNodes++ ;
}else{
this.ownerTree.totalNodes = 1;
}
}else{
alert("MemberChooserTreeLoader.js - TREE NOT DEFINED ! ! ! "+ attr.text) ;
}
// apply baseAttrs, nice idea Corey!
if(this.baseAttrs){
Ext.applyIf(attr, this.baseAttrs);
}
if(this.applyLoader !== false){
if (!attr) attr = {};
attr.loader = this;
}
if(typeof attr.uiProvider == 'string'){
attr.uiProvider = this.uiProviders[attr.uiProvider] || eval(attr.uiProvider);
}
if(attr.nodeType){
var node = Ext.tree.TreePanel.nodeTypes[attr.nodeType](attr);
}else{
var node = attr.leaf ?
new Ext.tree.TreeNode(attr) :
new Ext.tree.AsyncTreeNode(attr);
}
node.object_id = attr.object_id ;
node.options = attr.options ;
node.object_controller = attr.object_controller ;
node.object_type_id = attr.object_type_id ;
node.allow_childs = attr.allow_childs ;
if (attr.actions){
node.actions = attr.actions ;
}
return node ;
},
processResponse:function(response, node, callback) {
if ( Ext.type(this.ownerTree ) ){
this.ownerTree.totalNodes = 1 ;
}
var json = response.responseText;
try {
var json_obj = eval("("+json+")");
var dimension_id = this.ownerTree.dimensionId;
if (!og.tmp_members_to_add) og.tmp_members_to_add = [];
//add members to og.dimensions
for (i=0; i<json_obj.dimension_members.length; i++) {
og.addMemberToOgDimensions(dimension_id,json_obj.dimension_members[i]);
}
if(typeof(json_obj.dimensions_root_members) != "undefined" && !json_obj.more_nodes_left){
ogMemberCache.addDimToDimRootMembers(json_obj.dimension_id);
}
// build tmp member arrays
var tmp_member_array = [];
var count = 0;
while (json_obj.dimension_members.length > 0) {
tmp_member_array[count] = json_obj.dimension_members.splice(0, 100);
count++;
}
tmp_member_array.reverse();
var tree_id = this.ownerTree.id;
og.tmp_members_to_add[tree_id] = tmp_member_array;
if (!og.tmp_node) og.tmp_node = [];
og.tmp_node[tree_id] = node;
// mask
var old_text = this.ownerTree.getRootNode().text;
this.ownerTree.getRootNode().setText(lang('loading'));
this.ownerTree.innerCt.mask();
// add nodes
for (x=0; x<count; x++) {
setTimeout('og.addNodesToTree("'+tree_id+'", '+(json_obj.more_nodes_left ? '1':'0')+');', 1000 * x);
}
// unmask
var t = this.ownerTree;
setTimeout(function(){
t.innerCt.unmask();
t.getRootNode().setText(old_text);
//t.getRootNode().expand(true);
//t.getRootNode().collapse(true);
//t.getRootNode().expand(false);
}, 1000 * count);
node.endUpdate();
if(typeof callback == "function"){
callback(this, node);
}
this.ownerTree.expanded_once = false;
}catch(e){
this.handleFailure(response);
}
}
}); | abhinay100/fengoffice_app | public/assets/javascript/og/MemberChooserTreeLoader.js | JavaScript | agpl-3.0 | 3,593 |
var searchData=
[
['broken_5fpipe',['broken_pipe',['../namespacequickcpplib_1_1__xxx_1_1signal__guard.html#ad51cebe56c9a0718495f06b43bd71fa3ab6de06c7476055104a0290d06b726368',1,'quickcpplib::_xxx::signal_guard']]]
];
| FSMaxB/molch | outcome/include/outcome/quickcpplib/doc/html/search/enumvalues_1.js | JavaScript | lgpl-2.1 | 219 |
/*jshint maxlen:1000*/
model.jsonModel = {
services: [
{
name: "alfresco/services/LoggingService",
config: {
loggingPreferences: {
enabled: true,
all: true
}
}
},
"alfresco/services/ErrorReporter",
"alfresco/services/DialogService",
"aikauTesting/mockservices/CommentsListMockService"
],
widgets: [
{
name: "alfresco/renderers/CommentsList",
id: "COMMENT_LIST",
config: {
pubSubScope: "COMMENTS1_",
currentItem: {
node: {
nodeRef: "workspace://SpacesStore/4fd42b12-361a-4e02-a1da-9131e6fa074d",
permissions: {
user: {
CreateChildren: true
}
}
}
}
}
},
{
name: "alfresco/logging/DebugLog"
}
]
}; | nzheyuti/Aikau | aikau/src/test/resources/testApp/WEB-INF/classes/alfresco/site-webscripts/alfresco/renderers/CommentsList.get.js | JavaScript | lgpl-3.0 | 973 |
// ax5.ui.formatter
(function () {
var UI = ax5.ui;
var U = ax5.util;
var FORMATTER;
UI.addClass({
className: "formatter",
version: "0.6.1"
}, (function () {
var TODAY = new Date();
var setSelectionRange = function (input, pos) {
if (typeof pos == "undefined") {
pos = input.value.length;
}
if (input.setSelectionRange) {
input.focus();
input.setSelectionRange(pos, pos);
}
else if (input.createTextRange) {
var range = input.createTextRange();
range.collapse(true);
range.moveEnd('character', pos);
range.moveStart('character', pos);
range.select();
}
else if (input.selectionStart) {
input.focus();
input.selectionStart = pos;
input.selectionEnd = pos;
}
};
/**
* @class ax5formatter
* @classdesc
* @author [email protected]
* @example
* ```js
* $('#idInputTime').attr('data-ax5formatter', 'time').ax5formatter();
* $('#idInputMoney').attr('data-ax5formatter', 'money').ax5formatter();
* $('#idInputPhone').attr('data-ax5formatter', 'phone').ax5formatter();
* $('#idInputDate').attr('data-ax5formatter', 'date').ax5formatter();
*
* $('#ax5formatter-custom').ax5formatter({
* pattern: "custom",
* getEnterableKeyCodes: function(){
* return {
* '65':'a',
* '66':'b',
* '67':'c',
* '68':'d',
* '69':'e',
* '70':'f'
* };
* },
* getPatternValue: function(obj){
* return obj.value.replace(/./g, "*");
* }
* });
* ```
*/
var ax5formatter = function () {
var
self = this,
cfg;
this.instanceId = ax5.getGuid();
this.config = {
animateTime: 250
};
this.queue = [];
this.openTimer = null;
this.closeTimer = null;
cfg = this.config;
var
formatterEvent = {
'focus': function (opts, optIdx, e) {
if (!opts.$input.data("__originValue__")) opts.$input.data("__originValue__", opts.$input.val());
},
/* 키 다운 이벤트에서 입력할 수 없는 키 입력을 방어 */
'keydown': function (opts, optIdx, e) {
var isStop = false;
if (!opts.enterableKeyCodes) {
}
else if (e.which && opts.enterableKeyCodes[e.which]) {
}
else if (!e.metaKey && !e.ctrlKey && !e.shiftKey) {
//console.log(e.which, opts.enterableKeyCodes);
isStop = true;
}
if (isStop) ax5.util.stopEvent(e);
},
/* 키 업 이벤트에서 패턴을 적용 */
'keyup': function (opts, optIdx, e) {
var elem = opts.$input.get(0),
elemFocusPosition,
beforeValue,
newValue,
selection, selectionLength
;
if ('selectionStart' in elem) {
// Standard-compliant browsers
elemFocusPosition = elem.selectionStart;
}
else if (document.selection) {
// IE
//elem.focus();
selection = document.selection.createRange();
selectionLength = document.selection.createRange().text.length;
selection.moveStart('character', -elem.value.length);
elemFocusPosition = selection.text.length - selectionLength;
}
beforeValue = elem.value;
if (opts.pattern in FORMATTER.formatter) {
newValue = FORMATTER.formatter[opts.pattern].getPatternValue.call(this, opts, optIdx, e, elem.value);
} else {
newValue = beforeValue
}
if (newValue != beforeValue) {
opts.$input.val(newValue).trigger("change");
setSelectionRange(elem, elemFocusPosition + newValue.length - beforeValue.length);
}
},
'blur': function (opts, optIdx, e, _force) {
var elem = opts.$input.get(0),
beforeValue,
newValue
;
opts.$input.removeData("__originValue__");
beforeValue = elem.value;
if (opts.pattern in FORMATTER.formatter) {
newValue = FORMATTER.formatter[opts.pattern].getPatternValue.call(this, opts, optIdx, e, elem.value, 'blur');
} else {
newValue = beforeValue
}
if (_force) {
opts.$input.val(newValue);
} else {
if (newValue != beforeValue) {
opts.$input.val(newValue).trigger("change");
}
}
}
},
bindFormatterTarget = function (opts, optIdx) {
if (!opts.pattern) {
if (opts.$target.get(0).tagName == "INPUT") {
opts.pattern = opts.$target
.attr('data-ax5formatter');
}
else {
opts.pattern = opts.$target
.find('input[type="text"]')
.attr('data-ax5formatter');
}
if (!opts.pattern) {
console.log(ax5.info.getError("ax5formatter", "501", "bind"));
console.log(opts.target);
return this;
}
}
var re = /[^\(^\))]+/gi,
matched = opts.pattern.match(re);
opts.pattern = matched[0];
opts.patternArgument = matched[1] || "";
// 함수타입
if (opts.pattern in FORMATTER.formatter) {
opts.enterableKeyCodes = FORMATTER.formatter[opts.pattern].getEnterableKeyCodes.call(this, opts, optIdx);
}
opts.$input
.unbind('focus.ax5formatter')
.bind('focus.ax5formatter', formatterEvent.focus.bind(this, this.queue[optIdx], optIdx));
opts.$input
.unbind('keydown.ax5formatter')
.bind('keydown.ax5formatter', formatterEvent.keydown.bind(this, this.queue[optIdx], optIdx));
opts.$input
.unbind('keyup.ax5formatter')
.bind('keyup.ax5formatter', formatterEvent.keyup.bind(this, this.queue[optIdx], optIdx));
opts.$input
.unbind('blur.ax5formatter')
.bind('blur.ax5formatter', formatterEvent.blur.bind(this, this.queue[optIdx], optIdx));
formatterEvent.blur.call(this, this.queue[optIdx], optIdx);
return this;
},
getQueIdx = function (boundID) {
if (!U.isString(boundID)) {
boundID = jQuery(boundID).data("data-formatter");
}
/*
if (!U.isString(boundID)) {
console.log(ax5.info.getError("ax5formatter", "402", "getQueIdx"));
return;
}
*/
return U.search(this.queue, function () {
return this.id == boundID;
});
};
/**
* Preferences of formatter UI
* @method ax5formatter.setConfig
* @param {Object} config - 클래스 속성값
* @returns {ax5.ui.formatter}
* @example
* ```
* ```
*/
this.init = function () {
};
this.bind = function (opts) {
var
formatterConfig = {},
optIdx;
jQuery.extend(true, formatterConfig, cfg);
if (opts) jQuery.extend(true, formatterConfig, opts);
opts = formatterConfig;
if (!opts.target) {
console.log(ax5.info.getError("ax5formatter", "401", "bind"));
return this;
}
opts.$target = jQuery(opts.target);
if (opts.$target.get(0).tagName == "INPUT") {
opts.$input = opts.$target;
}
else {
opts.$input = opts.$target.find('input[type="text"]');
if (opts.$input.length > 1) {
opts.$input.each(function () {
opts.target = this;
self.bind(opts);
});
return this;
}
}
opts.$input = (opts.$target.get(0).tagName == "INPUT") ? opts.$target : opts.$target.find('input[type="text"]');
if (!opts.id) opts.id = opts.$input.data("ax5-formatter");
if (!opts.id) {
opts.id = 'ax5-formatter-' + ax5.getGuid();
opts.$input.data("ax5-formatter", opts.id);
}
optIdx = U.search(this.queue, function () {
return this.id == opts.id;
});
if (optIdx === -1) {
this.queue.push(opts);
bindFormatterTarget.call(this, this.queue[this.queue.length - 1], this.queue.length - 1);
}
else {
this.queue[optIdx] = opts;
bindFormatterTarget.call(this, this.queue[optIdx], optIdx);
}
return this;
};
/**
* formatter value 를 다시 적용합니다.
* @method ax5formatter.formatting
* @returns {ax5formatter}
* @example
* ```js
* $('[data-ax5formatter="time"]').ax5formatter("formatting"); // 하나만
* $('[data-ax5formatter]').ax5formatter("formatting"); // 모두
* ```
*/
this.formatting = function (boundID) {
var queIdx = (U.isNumber(boundID)) ? boundID : getQueIdx.call(this, boundID);
if (queIdx === -1) {
var i = this.queue.length;
while (i--) {
formatterEvent.blur.call(this, this.queue[i], i, null, true);
}
} else {
formatterEvent.blur.call(this, this.queue[queIdx], queIdx, null, true);
}
return this;
};
this.unbind = function () {
// 구현해야함.
};
// 클래스 생성자
this.main = (function () {
if (arguments && U.isObject(arguments[0])) {
this.setConfig(arguments[0]);
}
}).apply(this, arguments);
};
return ax5formatter;
})());
FORMATTER = ax5.ui.formatter;
})();
ax5.ui.formatter_instance = new ax5.ui.formatter();
jQuery.fn.ax5formatter = (function () {
return function (config) {
if (ax5.util.isString(arguments[0])) {
var methodName = arguments[0];
switch (methodName) {
case "formatting":
return ax5.ui.formatter_instance.formatting(this);
break;
case "unbind":
return ax5.ui.formatter_instance.unbind(this);
break;
default:
return this;
}
}
else {
if (typeof config == "undefined") config = {};
jQuery.each(this, function () {
var defaultConfig = {
target: this
};
config = jQuery.extend({}, config, defaultConfig);
ax5.ui.formatter_instance.bind(config);
});
}
return this;
}
})();
| dongyoung86/ax5ui-kernel | src/ax5ui-formatter/src/ax5formatter.js | JavaScript | lgpl-3.0 | 13,600 |
/*
* Copyright (c) 2015-2016 Fraunhofer FOKUS
*
* 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.
*/
/*!
* onDomReady.js 1.4.0 (c) 2013 Tubal Martin - MIT license
*
* Specially modified to work with Holder.js
*/
;(function(name, global, callback){
global[name] = callback;
})("onDomReady", this,
(function(win) {
'use strict';
//Lazy loading fix for Firefox < 3.6
//http://webreflection.blogspot.com/2009/11/195-chars-to-help-lazy-loading.html
if (document.readyState == null && document.addEventListener) {
document.addEventListener("DOMContentLoaded", function DOMContentLoaded() {
document.removeEventListener("DOMContentLoaded", DOMContentLoaded, false);
document.readyState = "complete";
}, false);
document.readyState = "loading";
}
var doc = win.document,
docElem = doc.documentElement,
LOAD = "load",
FALSE = false,
ONLOAD = "on"+LOAD,
COMPLETE = "complete",
READYSTATE = "readyState",
ATTACHEVENT = "attachEvent",
DETACHEVENT = "detachEvent",
ADDEVENTLISTENER = "addEventListener",
DOMCONTENTLOADED = "DOMContentLoaded",
ONREADYSTATECHANGE = "onreadystatechange",
REMOVEEVENTLISTENER = "removeEventListener",
// W3C Event model
w3c = ADDEVENTLISTENER in doc,
top = FALSE,
// isReady: Is the DOM ready to be used? Set to true once it occurs.
isReady = FALSE,
// Callbacks pending execution until DOM is ready
callbacks = [];
// Handle when the DOM is ready
function ready( fn ) {
if ( !isReady ) {
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( !doc.body ) {
return defer( ready );
}
// Remember that the DOM is ready
isReady = true;
// Execute all callbacks
while ( fn = callbacks.shift() ) {
defer( fn );
}
}
}
// The ready event handler
function completed( event ) {
// readyState === "complete" is good enough for us to call the dom ready in oldIE
if ( w3c || event.type === LOAD || doc[READYSTATE] === COMPLETE ) {
detach();
ready();
}
}
// Clean-up method for dom ready events
function detach() {
if ( w3c ) {
doc[REMOVEEVENTLISTENER]( DOMCONTENTLOADED, completed, FALSE );
win[REMOVEEVENTLISTENER]( LOAD, completed, FALSE );
} else {
doc[DETACHEVENT]( ONREADYSTATECHANGE, completed );
win[DETACHEVENT]( ONLOAD, completed );
}
}
// Defers a function, scheduling it to run after the current call stack has cleared.
function defer( fn, wait ) {
// Allow 0 to be passed
setTimeout( fn, +wait >= 0 ? wait : 1 );
}
// Attach the listeners:
// Catch cases where onDomReady is called after the browser event has already occurred.
// we once tried to use readyState "interactive" here, but it caused issues like the one
// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
if ( doc[READYSTATE] === COMPLETE ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready
defer( ready );
// Standards-based browsers support DOMContentLoaded
} else if ( w3c ) {
// Use the handy event callback
doc[ADDEVENTLISTENER]( DOMCONTENTLOADED, completed, FALSE );
// A fallback to window.onload, that will always work
win[ADDEVENTLISTENER]( LOAD, completed, FALSE );
// If IE event model is used
} else {
// Ensure firing before onload, maybe late but safe also for iframes
doc[ATTACHEVENT]( ONREADYSTATECHANGE, completed );
// A fallback to window.onload, that will always work
win[ATTACHEVENT]( ONLOAD, completed );
// If IE and not a frame
// continually check to see if the document is ready
try {
top = win.frameElement == null && docElem;
} catch(e) {}
if ( top && top.doScroll ) {
(function doScrollCheck() {
if ( !isReady ) {
try {
// Use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
top.doScroll("left");
} catch(e) {
return defer( doScrollCheck, 50 );
}
// detach all dom ready events
detach();
// and execute any waiting functions
ready();
}
})();
}
}
function onDomReady( fn ) {
// If DOM is ready, execute the function (async), otherwise wait
isReady ? defer( fn ) : callbacks.push( fn );
}
// Add version
onDomReady.version = "1.4.0";
// Add method to check if DOM is ready
onDomReady.isReady = function(){
return isReady;
};
return onDomReady;
})(this));
| fhg-fokus-nubomedia/nubomedia-paas | src/main/resources/static/bower_components/holderjs/src/ondomready.js | JavaScript | apache-2.0 | 5,705 |
/*******************************************************************************
* KindEditor - WYSIWYG HTML Editor for Internet
* Copyright (C) 2006-2012 kindsoft.net
*
* @author Roddy <[email protected]>
* @website http://www.kindsoft.net/
* @licence http://www.kindsoft.net/license.php
* @version 4.1.1 (2012-06-10)
*******************************************************************************/
(function (window, undefined) {
if (window.KindEditor) {
return;
}
if (!window.console) {
window.console = {};
}
if (!console.log) {
console.log = function () {};
}
var _VERSION = '4.1.1 (2012-06-10)',
_ua = navigator.userAgent.toLowerCase(),
_IE = _ua.indexOf('msie') > -1 && _ua.indexOf('opera') == -1,
_GECKO = _ua.indexOf('gecko') > -1 && _ua.indexOf('khtml') == -1,
_WEBKIT = _ua.indexOf('applewebkit') > -1,
_OPERA = _ua.indexOf('opera') > -1,
_MOBILE = _ua.indexOf('mobile') > -1,
_IOS = /ipad|iphone|ipod/.test(_ua),
_QUIRKS = document.compatMode != 'CSS1Compat',
_matches = /(?:msie|firefox|webkit|opera)[\/:\s](\d+)/.exec(_ua),
_V = _matches ? _matches[1] : '0',
_TIME = new Date().getTime();
function _isArray(val) {
if (!val) {
return false;
}
return Object.prototype.toString.call(val) === '[object Array]';
}
function _isFunction(val) {
if (!val) {
return false;
}
return Object.prototype.toString.call(val) === '[object Function]';
}
function _inArray(val, arr) {
for (var i = 0, len = arr.length; i < len; i++) {
if (val === arr[i]) {
return i;
}
}
return -1;
}
function _each(obj, fn) {
if (_isArray(obj)) {
for (var i = 0, len = obj.length; i < len; i++) {
if (fn.call(obj[i], i, obj[i]) === false) {
break;
}
}
} else {
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
if (fn.call(obj[key], key, obj[key]) === false) {
break;
}
}
}
}
}
function _trim(str) {
return str.replace(/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, '');
}
function _inString(val, str, delimiter) {
delimiter = delimiter === undefined ? ',' : delimiter;
return (delimiter + str + delimiter).indexOf(delimiter + val + delimiter) >= 0;
}
function _addUnit(val, unit) {
unit = unit || 'px';
return val && /^\d+$/.test(val) ? val + 'px' : val;
}
function _removeUnit(val) {
var match;
return val && (match = /(\d+)/.exec(val)) ? parseInt(match[1], 10) : 0;
}
function _escape(val) {
return val.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
}
function _unescape(val) {
return val.replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/&/g, '&');
}
function _toCamel(str) {
var arr = str.split('-');
str = '';
_each(arr, function(key, val) {
str += (key > 0) ? val.charAt(0).toUpperCase() + val.substr(1) : val;
});
return str;
}
function _toHex(val) {
function hex(d) {
var s = parseInt(d, 10).toString(16).toUpperCase();
return s.length > 1 ? s : '0' + s;
}
return val.replace(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/ig,
function($0, $1, $2, $3) {
return '#' + hex($1) + hex($2) + hex($3);
}
);
}
function _toMap(val, delimiter) {
delimiter = delimiter === undefined ? ',' : delimiter;
var map = {}, arr = _isArray(val) ? val : val.split(delimiter), match;
_each(arr, function(key, val) {
if ((match = /^(\d+)\.\.(\d+)$/.exec(val))) {
for (var i = parseInt(match[1], 10); i <= parseInt(match[2], 10); i++) {
map[i.toString()] = true;
}
} else {
map[val] = true;
}
});
return map;
}
function _toArray(obj, offset) {
return Array.prototype.slice.call(obj, offset || 0);
}
function _undef(val, defaultVal) {
return val === undefined ? defaultVal : val;
}
function _invalidUrl(url) {
return !url || /[<>"]/.test(url);
}
function _addParam(url, param) {
return url.indexOf('?') >= 0 ? url + '&' + param : url + '?' + param;
}
function _extend(child, parent, proto) {
if (!proto) {
proto = parent;
parent = null;
}
var childProto;
if (parent) {
var fn = function () {};
fn.prototype = parent.prototype;
childProto = new fn();
_each(proto, function(key, val) {
childProto[key] = val;
});
} else {
childProto = proto;
}
childProto.constructor = child;
child.prototype = childProto;
child.parent = parent ? parent.prototype : null;
}
function _json(text) {
var match;
if ((match = /\{[\s\S]*\}|\[[\s\S]*\]/.exec(text))) {
text = match[0];
}
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
cx.lastIndex = 0;
if (cx.test(text)) {
text = text.replace(cx, function (a) {
return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
});
}
if (/^[\],:{}\s]*$/.
test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
return eval('(' + text + ')');
}
throw 'JSON parse error';
}
var _round = Math.round;
var K = {
DEBUG : false,
VERSION : _VERSION,
IE : _IE,
GECKO : _GECKO,
WEBKIT : _WEBKIT,
OPERA : _OPERA,
V : _V,
TIME : _TIME,
each : _each,
isArray : _isArray,
isFunction : _isFunction,
inArray : _inArray,
inString : _inString,
trim : _trim,
addUnit : _addUnit,
removeUnit : _removeUnit,
escape : _escape,
unescape : _unescape,
toCamel : _toCamel,
toHex : _toHex,
toMap : _toMap,
toArray : _toArray,
undef : _undef,
invalidUrl : _invalidUrl,
addParam : _addParam,
extend : _extend,
json : _json
};
var _INLINE_TAG_MAP = _toMap('a,abbr,acronym,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,img,input,ins,kbd,label,map,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var'),
_BLOCK_TAG_MAP = _toMap('address,applet,blockquote,body,center,dd,dir,div,dl,dt,fieldset,form,frameset,h1,h2,h3,h4,h5,h6,head,hr,html,iframe,ins,isindex,li,map,menu,meta,noframes,noscript,object,ol,p,pre,script,style,table,tbody,td,tfoot,th,thead,title,tr,ul'),
_SINGLE_TAG_MAP = _toMap('area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed'),
_STYLE_TAG_MAP = _toMap('b,basefont,big,del,em,font,i,s,small,span,strike,strong,sub,sup,u'),
_CONTROL_TAG_MAP = _toMap('img,table,input,textarea,button'),
_PRE_TAG_MAP = _toMap('pre,style,script'),
_NOSPLIT_TAG_MAP = _toMap('html,head,body,td,tr,table,ol,ul,li'),
_AUTOCLOSE_TAG_MAP = _toMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'),
_FILL_ATTR_MAP = _toMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'),
_VALUE_TAG_MAP = _toMap('input,button,textarea,select');
function _getBasePath() {
var els = document.getElementsByTagName('script'), src;
for (var i = 0, len = els.length; i < len; i++) {
src = els[i].src || '';
if (/kindeditor[\w\-\.]*\.js/.test(src)) {
return src.substring(0, src.lastIndexOf('/') + 1);
}
}
return '';
}
K.basePath = _getBasePath();
K.options = {
designMode : true,
fullscreenMode : false,
filterMode : true,
wellFormatMode : true,
shadowMode : true,
loadStyleMode : true,
basePath : K.basePath,
themesPath : K.basePath + 'themes/',
langPath : K.basePath + 'lang/',
pluginsPath : K.basePath + 'plugins/',
themeType : 'default',
langType : 'zh_CN',
urlType : '',
newlineTag : 'p',
resizeType : 2,
syncType : 'form',
pasteType : 2,
dialogAlignType : 'page',
useContextmenu : true,
fullscreenShortcut : true,
bodyClass : 'ke-content',
indentChar : '\t',
cssPath : '',
cssData : '',
minWidth : 650,
minHeight : 100,
minChangeSize : 5,
items : [
'source', '|', 'undo', 'redo', '|', 'preview', 'print','cut', 'copy', 'paste',
'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|','table', 'hr', 'emoticons', 'pagebreak',
'anchor', 'link', 'unlink', '|', 'about'
],
noDisableItems : ['source', 'fullscreen'],
colorTable : [
['#E53333', '#E56600', '#FF9900', '#64451D', '#DFC5A4', '#FFE500'],
['#009900', '#006600', '#99BB00', '#B8D100', '#60D978', '#00D5FF'],
['#337FE5', '#003399', '#4C33E5', '#9933E5', '#CC33E5', '#EE33EE'],
['#FFFFFF', '#CCCCCC', '#999999', '#666666', '#333333', '#000000']
],
fontSizeTable : ['9px', '10px', '12px', '14px', '16px', '18px', '24px', '32px'],
htmlTags : {
font : ['color', 'size', 'face', '.background-color'],
span : [
'.color', '.background-color', '.font-size', '.font-family', '.background',
'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.line-height'
],
div : [
'align', '.border', '.margin', '.padding', '.text-align', '.color',
'.background-color', '.font-size', '.font-family', '.font-weight', '.background',
'.font-style', '.text-decoration', '.vertical-align', '.margin-left'
],
table: [
'border', 'cellspacing', 'cellpadding', 'width', 'height', 'align', 'bordercolor',
'.padding', '.margin', '.border', 'bgcolor', '.text-align', '.color', '.background-color',
'.font-size', '.font-family', '.font-weight', '.font-style', '.text-decoration', '.background',
'.width', '.height', '.border-collapse'
],
'td,th': [
'align', 'valign', 'width', 'height', 'colspan', 'rowspan', 'bgcolor',
'.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight',
'.font-style', '.text-decoration', '.vertical-align', '.background', '.border'
],
a : ['href', 'target', 'name'],
embed : ['src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess'],
img : ['src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'],
'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : [
'align', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.background',
'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.text-indent', '.margin-left'
],
pre : ['class'],
hr : ['class', '.page-break-after'],
'br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del' : []
},
layout : '<div class="container"><div class="toolbar"></div><div class="edit"></div><div class="statusbar"></div></div>'
};
var _useCapture = false;
var _INPUT_KEY_MAP = _toMap('8,9,13,32,46,48..57,59,61,65..90,106,109..111,188,190..192,219..222');
var _CURSORMOVE_KEY_MAP = _toMap('33..40');
var _CHANGE_KEY_MAP = {};
_each(_INPUT_KEY_MAP, function(key, val) {
_CHANGE_KEY_MAP[key] = val;
});
_each(_CURSORMOVE_KEY_MAP, function(key, val) {
_CHANGE_KEY_MAP[key] = val;
});
function _bindEvent(el, type, fn) {
if (el.addEventListener){
el.addEventListener(type, fn, _useCapture);
} else if (el.attachEvent){
el.attachEvent('on' + type, fn);
}
}
function _unbindEvent(el, type, fn) {
if (el.removeEventListener){
el.removeEventListener(type, fn, _useCapture);
} else if (el.detachEvent){
el.detachEvent('on' + type, fn);
}
}
var _EVENT_PROPS = ('altKey,attrChange,attrName,bubbles,button,cancelable,charCode,clientX,clientY,ctrlKey,currentTarget,' +
'data,detail,eventPhase,fromElement,handler,keyCode,metaKey,newValue,offsetX,offsetY,originalTarget,pageX,' +
'pageY,prevValue,relatedNode,relatedTarget,screenX,screenY,shiftKey,srcElement,target,toElement,view,wheelDelta,which').split(',');
function KEvent(el, event) {
this.init(el, event);
}
_extend(KEvent, {
init : function(el, event) {
var self = this, doc = el.ownerDocument || el.document || el;
self.event = event;
_each(_EVENT_PROPS, function(key, val) {
self[val] = event[val];
});
if (!self.target) {
self.target = self.srcElement || doc;
}
if (self.target.nodeType === 3) {
self.target = self.target.parentNode;
}
if (!self.relatedTarget && self.fromElement) {
self.relatedTarget = self.fromElement === self.target ? self.toElement : self.fromElement;
}
if (self.pageX == null && self.clientX != null) {
var d = doc.documentElement, body = doc.body;
self.pageX = self.clientX + (d && d.scrollLeft || body && body.scrollLeft || 0) - (d && d.clientLeft || body && body.clientLeft || 0);
self.pageY = self.clientY + (d && d.scrollTop || body && body.scrollTop || 0) - (d && d.clientTop || body && body.clientTop || 0);
}
if (!self.which && ((self.charCode || self.charCode === 0) ? self.charCode : self.keyCode)) {
self.which = self.charCode || self.keyCode;
}
if (!self.metaKey && self.ctrlKey) {
self.metaKey = self.ctrlKey;
}
if (!self.which && self.button !== undefined) {
self.which = (self.button & 1 ? 1 : (self.button & 2 ? 3 : (self.button & 4 ? 2 : 0)));
}
switch (self.which) {
case 186 :
self.which = 59;
break;
case 187 :
case 107 :
case 43 :
self.which = 61;
break;
case 189 :
case 45 :
self.which = 109;
break;
case 42 :
self.which = 106;
break;
case 47 :
self.which = 111;
break;
case 78 :
self.which = 110;
break;
}
if (self.which >= 96 && self.which <= 105) {
self.which -= 48;
}
},
preventDefault : function() {
var ev = this.event;
if (ev.preventDefault) {
ev.preventDefault();
}
ev.returnValue = false;
},
stopPropagation : function() {
var ev = this.event;
if (ev.stopPropagation) {
ev.stopPropagation();
}
ev.cancelBubble = true;
},
stop : function() {
this.preventDefault();
this.stopPropagation();
}
});
var _eventExpendo = 'kindeditor_' + _TIME, _eventId = 0, _eventData = {};
function _getId(el) {
return el[_eventExpendo] || null;
}
function _setId(el) {
el[_eventExpendo] = ++_eventId;
return _eventId;
}
function _removeId(el) {
try {
delete el[_eventExpendo];
} catch(e) {
if (el.removeAttribute) {
el.removeAttribute(_eventExpendo);
}
}
}
function _bind(el, type, fn) {
if (type.indexOf(',') >= 0) {
_each(type.split(','), function() {
_bind(el, this, fn);
});
return;
}
var id = _getId(el);
if (!id) {
id = _setId(el);
}
if (_eventData[id] === undefined) {
_eventData[id] = {};
}
var events = _eventData[id][type];
if (events && events.length > 0) {
_unbindEvent(el, type, events[0]);
} else {
_eventData[id][type] = [];
_eventData[id].el = el;
}
events = _eventData[id][type];
if (events.length === 0) {
events[0] = function(e) {
var kevent = e ? new KEvent(el, e) : undefined;
_each(events, function(i, event) {
if (i > 0 && event) {
event.call(el, kevent);
}
});
};
}
if (_inArray(fn, events) < 0) {
events.push(fn);
}
_bindEvent(el, type, events[0]);
}
function _unbind(el, type, fn) {
if (type && type.indexOf(',') >= 0) {
_each(type.split(','), function() {
_unbind(el, this, fn);
});
return;
}
var id = _getId(el);
if (!id) {
return;
}
if (type === undefined) {
if (id in _eventData) {
_each(_eventData[id], function(key, events) {
if (key != 'el' && events.length > 0) {
_unbindEvent(el, key, events[0]);
}
});
delete _eventData[id];
_removeId(el);
}
return;
}
if (!_eventData[id]) {
return;
}
var events = _eventData[id][type];
if (events && events.length > 0) {
if (fn === undefined) {
_unbindEvent(el, type, events[0]);
delete _eventData[id][type];
} else {
_each(events, function(i, event) {
if (i > 0 && event === fn) {
events.splice(i, 1);
}
});
if (events.length == 1) {
_unbindEvent(el, type, events[0]);
delete _eventData[id][type];
}
}
var count = 0;
_each(_eventData[id], function() {
count++;
});
if (count < 2) {
delete _eventData[id];
_removeId(el);
}
}
}
function _fire(el, type) {
if (type.indexOf(',') >= 0) {
_each(type.split(','), function() {
_fire(el, this);
});
return;
}
var id = _getId(el);
if (!id) {
return;
}
var events = _eventData[id][type];
if (_eventData[id] && events && events.length > 0) {
events[0]();
}
}
function _ctrl(el, key, fn) {
var self = this;
key = /^\d{2,}$/.test(key) ? key : key.toUpperCase().charCodeAt(0);
_bind(el, 'keydown', function(e) {
if (e.ctrlKey && e.which == key && !e.shiftKey && !e.altKey) {
fn.call(el);
e.stop();
}
});
}
function _ready(fn) {
var loaded = false;
function readyFunc() {
if (!loaded) {
loaded = true;
fn(KindEditor);
}
}
function ieReadyFunc() {
if (!loaded) {
try {
document.documentElement.doScroll('left');
} catch(e) {
setTimeout(ieReadyFunc, 100);
return;
}
readyFunc();
}
}
function ieReadyStateFunc() {
if (document.readyState === 'complete') {
readyFunc();
}
}
if (document.addEventListener) {
_bind(document, 'DOMContentLoaded', readyFunc);
} else if (document.attachEvent) {
_bind(document, 'readystatechange', ieReadyStateFunc);
var toplevel = false;
try {
toplevel = window.frameElement == null;
} catch(e) {}
if (document.documentElement.doScroll && toplevel) {
ieReadyFunc();
}
}
_bind(window, 'load', readyFunc);
}
if (_IE) {
window.attachEvent('onunload', function() {
_each(_eventData, function(key, events) {
if (events.el) {
_unbind(events.el);
}
});
});
}
K.ctrl = _ctrl;
K.ready = _ready;
function _getCssList(css) {
var list = {},
reg = /\s*([\w\-]+)\s*:([^;]*)(;|$)/g,
match;
while ((match = reg.exec(css))) {
var key = _trim(match[1].toLowerCase()),
val = _trim(_toHex(match[2]));
list[key] = val;
}
return list;
}
function _getAttrList(tag) {
var list = {},
reg = /\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g,
match;
while ((match = reg.exec(tag))) {
var key = (match[1] || match[2] || match[4] || match[6]).toLowerCase(),
val = (match[2] ? match[3] : (match[4] ? match[5] : match[7])) || '';
list[key] = val;
}
return list;
}
function _addClassToTag(tag, className) {
if (/\s+class\s*=/.test(tag)) {
tag = tag.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/, function($0, $1, $2, $3) {
if ((' ' + $2 + ' ').indexOf(' ' + className + ' ') < 0) {
return $2 === '' ? $1 + className + $3 : $1 + $2 + ' ' + className + $3;
} else {
return $0;
}
});
} else {
tag = tag.substr(0, tag.length - 1) + ' class="' + className + '">';
}
return tag;
}
function _formatCss(css) {
var str = '';
_each(_getCssList(css), function(key, val) {
str += key + ':' + val + ';';
});
return str;
}
function _formatUrl(url, mode, host, pathname) {
mode = _undef(mode, '').toLowerCase();
url = url.replace(/([^:])\/\//g, '$1/');
if (_inArray(mode, ['absolute', 'relative', 'domain']) < 0) {
return url;
}
host = host || location.protocol + '//' + location.host;
if (pathname === undefined) {
var m = location.pathname.match(/^(\/.*)\//);
pathname = m ? m[1] : '';
}
var match;
if ((match = /^(\w+:\/\/[^\/]*)/.exec(url))) {
if (match[1] !== host) {
return url;
}
} else if (/^\w+:/.test(url)) {
return url;
}
function getRealPath(path) {
var parts = path.split('/'), paths = [];
for (var i = 0, len = parts.length; i < len; i++) {
var part = parts[i];
if (part == '..') {
if (paths.length > 0) {
paths.pop();
}
} else if (part !== '' && part != '.') {
paths.push(part);
}
}
return '/' + paths.join('/');
}
if (/^\//.test(url)) {
url = host + getRealPath(url.substr(1));
} else if (!/^\w+:\/\//.test(url)) {
url = host + getRealPath(pathname + '/' + url);
}
function getRelativePath(path, depth) {
if (url.substr(0, path.length) === path) {
var arr = [];
for (var i = 0; i < depth; i++) {
arr.push('..');
}
var prefix = '.';
if (arr.length > 0) {
prefix += '/' + arr.join('/');
}
if (pathname == '/') {
prefix += '/';
}
return prefix + url.substr(path.length);
} else {
if ((match = /^(.*)\//.exec(path))) {
return getRelativePath(match[1], ++depth);
}
}
}
if (mode === 'relative') {
url = getRelativePath(host + pathname, 0).substr(2);
} else if (mode === 'absolute') {
if (url.substr(0, host.length) === host) {
url = url.substr(host.length);
}
}
return url;
}
function _formatHtml(html, htmlTags, urlType, wellFormatted, indentChar) {
urlType = urlType || '';
wellFormatted = _undef(wellFormatted, false);
indentChar = _undef(indentChar, '\t');
var fontSizeList = 'xx-small,x-small,small,medium,large,x-large,xx-large'.split(',');
html = html.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig, function($0, $1, $2, $3) {
return $1 + $2.replace(/<(?:br|br\s[^>]*)>/ig, '\n') + $3;
});
html = html.replace(/<(?:br|br\s[^>]*)\s*\/?>\s*<\/p>/ig, '</p>');
html = html.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/ig, '$1<br />$2');
html = html.replace(/\u200B/g, '');
var htmlTagMap = {};
if (htmlTags) {
_each(htmlTags, function(key, val) {
var arr = key.split(',');
for (var i = 0, len = arr.length; i < len; i++) {
htmlTagMap[arr[i]] = _toMap(val);
}
});
if (!htmlTagMap.script) {
html = html.replace(/(<(?:script|script\s[^>]*)>)([\s\S]*?)(<\/script>)/ig, '');
}
if (!htmlTagMap.style) {
html = html.replace(/(<(?:style|style\s[^>]*)>)([\s\S]*?)(<\/style>)/ig, '');
}
}
var re = /([ \t\n\r]*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"'<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+='[^']*'))*)(\/)?>([ \t\n\r]*)/g;
var tagStack = [];
html = html.replace(re, function($0, $1, $2, $3, $4, $5, $6) {
var full = $0,
startNewline = $1 || '',
startSlash = $2 || '',
tagName = $3.toLowerCase(),
attr = $4 || '',
endSlash = $5 ? ' ' + $5 : '',
endNewline = $6 || '';
if (htmlTags && !htmlTagMap[tagName]) {
return '';
}
if (endSlash === '' && _SINGLE_TAG_MAP[tagName]) {
endSlash = ' /';
}
if (_INLINE_TAG_MAP[tagName]) {
if (startNewline) {
startNewline = ' ';
}
if (endNewline) {
endNewline = ' ';
}
}
if (_PRE_TAG_MAP[tagName]) {
if (startSlash) {
endNewline = '\n';
} else {
startNewline = '\n';
}
}
if (wellFormatted && tagName == 'br') {
endNewline = '\n';
}
if (_BLOCK_TAG_MAP[tagName] && !_PRE_TAG_MAP[tagName]) {
if (wellFormatted) {
if (startSlash && tagStack.length > 0 && tagStack[tagStack.length - 1] === tagName) {
tagStack.pop();
} else {
tagStack.push(tagName);
}
startNewline = '\n';
endNewline = '\n';
for (var i = 0, len = startSlash ? tagStack.length : tagStack.length - 1; i < len; i++) {
startNewline += indentChar;
if (!startSlash) {
endNewline += indentChar;
}
}
if (endSlash) {
tagStack.pop();
} else if (!startSlash) {
endNewline += indentChar;
}
} else {
startNewline = endNewline = '';
}
}
if (attr !== '') {
var attrMap = _getAttrList(full);
if (tagName === 'font') {
var fontStyleMap = {}, fontStyle = '';
_each(attrMap, function(key, val) {
if (key === 'color') {
fontStyleMap.color = val;
delete attrMap[key];
}
if (key === 'size') {
fontStyleMap['font-size'] = fontSizeList[parseInt(val, 10) - 1] || '';
delete attrMap[key];
}
if (key === 'face') {
fontStyleMap['font-family'] = val;
delete attrMap[key];
}
if (key === 'style') {
fontStyle = val;
}
});
if (fontStyle && !/;$/.test(fontStyle)) {
fontStyle += ';';
}
_each(fontStyleMap, function(key, val) {
if (val === '') {
return;
}
if (/\s/.test(val)) {
val = "'" + val + "'";
}
fontStyle += key + ':' + val + ';';
});
attrMap.style = fontStyle;
}
_each(attrMap, function(key, val) {
if (_FILL_ATTR_MAP[key]) {
attrMap[key] = key;
}
if (_inArray(key, ['src', 'href']) >= 0) {
attrMap[key] = _formatUrl(val, urlType);
}
if (htmlTags && key !== 'style' && !htmlTagMap[tagName]['*'] && !htmlTagMap[tagName][key] ||
tagName === 'body' && key === 'contenteditable' ||
/^kindeditor_\d+$/.test(key)) {
delete attrMap[key];
}
if (key === 'style' && val !== '') {
var styleMap = _getCssList(val);
_each(styleMap, function(k, v) {
if (htmlTags && !htmlTagMap[tagName].style && !htmlTagMap[tagName]['.' + k]) {
delete styleMap[k];
}
});
var style = '';
_each(styleMap, function(k, v) {
style += k + ':' + v + ';';
});
attrMap.style = style;
}
});
attr = '';
_each(attrMap, function(key, val) {
if (key === 'style' && val === '') {
return;
}
val = val.replace(/"/g, '"');
attr += ' ' + key + '="' + val + '"';
});
}
if (tagName === 'font') {
tagName = 'span';
}
return startNewline + '<' + startSlash + tagName + attr + endSlash + '>' + endNewline;
});
html = html.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig, function($0, $1, $2, $3) {
return $1 + $2.replace(/\n/g, '<span id="__kindeditor_pre_newline__">\n') + $3;
});
html = html.replace(/\n\s*\n/g, '\n');
html = html.replace(/<span id="__kindeditor_pre_newline__">\n/g, '\n');
return _trim(html);
}
function _clearMsWord(html, htmlTags) {
html = html.replace(/<meta[\s\S]*?>/ig, '')
.replace(/<![\s\S]*?>/ig, '')
.replace(/<style[^>]*>[\s\S]*?<\/style>/ig, '')
.replace(/<script[^>]*>[\s\S]*?<\/script>/ig, '')
.replace(/<w:[^>]+>[\s\S]*?<\/w:[^>]+>/ig, '')
.replace(/<o:[^>]+>[\s\S]*?<\/o:[^>]+>/ig, '')
.replace(/<xml>[\s\S]*?<\/xml>/ig, '')
.replace(/<(?:table|td)[^>]*>/ig, function(full) {
return full.replace(/border-bottom:([#\w\s]+)/ig, 'border:$1');
});
return _formatHtml(html, htmlTags);
}
function _mediaType(src) {
if (/\.(rm|rmvb)(\?|$)/i.test(src)) {
return 'audio/x-pn-realaudio-plugin';
}
if (/\.(swf|flv)(\?|$)/i.test(src)) {
return 'application/x-shockwave-flash';
}
return 'video/x-ms-asf-plugin';
}
function _mediaClass(type) {
if (/realaudio/i.test(type)) {
return 'ke-rm';
}
if (/flash/i.test(type)) {
return 'ke-flash';
}
return 'ke-media';
}
function _mediaAttrs(srcTag) {
return _getAttrList(unescape(srcTag));
}
function _mediaEmbed(attrs) {
var html = '<embed ';
_each(attrs, function(key, val) {
html += key + '="' + val + '" ';
});
html += '/>';
return html;
}
function _mediaImg(blankPath, attrs) {
var width = attrs.width,
height = attrs.height,
type = attrs.type || _mediaType(attrs.src),
srcTag = _mediaEmbed(attrs),
style = '';
if (width > 0) {
style += 'width:' + width + 'px;';
}
if (height > 0) {
style += 'height:' + height + 'px;';
}
var html = '<img class="' + _mediaClass(type) + '" src="' + blankPath + '" ';
if (style !== '') {
html += 'style="' + style + '" ';
}
html += 'data-ke-tag="' + escape(srcTag) + '" alt="" />';
return html;
}
function _tmpl(str, data) {
var fn = new Function("obj",
"var p=[],print=function(){p.push.apply(p,arguments);};" +
"with(obj){p.push('" +
str.replace(/[\r\t\n]/g, " ")
.split("<%").join("\t")
.replace(/((^|%>)[^\t]*)'/g, "$1\r")
.replace(/\t=(.*?)%>/g, "',$1,'")
.split("\t").join("');")
.split("%>").join("p.push('")
.split("\r").join("\\'") + "');}return p.join('');");
return data ? fn(data) : fn;
}
K.formatUrl = _formatUrl;
K.formatHtml = _formatHtml;
K.getCssList = _getCssList;
K.getAttrList = _getAttrList;
K.mediaType = _mediaType;
K.mediaAttrs = _mediaAttrs;
K.mediaEmbed = _mediaEmbed;
K.mediaImg = _mediaImg;
K.clearMsWord = _clearMsWord;
K.tmpl = _tmpl;
function _contains(nodeA, nodeB) {
if (nodeA.nodeType == 9 && nodeB.nodeType != 9) {
return true;
}
while ((nodeB = nodeB.parentNode)) {
if (nodeB == nodeA) {
return true;
}
}
return false;
}
var _getSetAttrDiv = document.createElement('div');
_getSetAttrDiv.setAttribute('className', 't');
var _GET_SET_ATTRIBUTE = _getSetAttrDiv.className !== 't';
function _getAttr(el, key) {
key = key.toLowerCase();
var val = null;
if (!_GET_SET_ATTRIBUTE && el.nodeName.toLowerCase() != 'script') {
var div = el.ownerDocument.createElement('div');
div.appendChild(el.cloneNode(false));
var list = _getAttrList(_unescape(div.innerHTML));
if (key in list) {
val = list[key];
}
} else {
try {
val = el.getAttribute(key, 2);
} catch(e) {
val = el.getAttribute(key, 1);
}
}
if (key === 'style' && val !== null) {
val = _formatCss(val);
}
return val;
}
function _queryAll(expr, root) {
var exprList = expr.split(',');
if (exprList.length > 1) {
var mergedResults = [];
_each(exprList, function() {
_each(_queryAll(this, root), function() {
if (_inArray(this, mergedResults) < 0) {
mergedResults.push(this);
}
});
});
return mergedResults;
}
root = root || document;
function escape(str) {
if (typeof str != 'string') {
return str;
}
return str.replace(/([^\w\-])/g, '\\$1');
}
function stripslashes(str) {
return str.replace(/\\/g, '');
}
function cmpTag(tagA, tagB) {
return tagA === '*' || tagA.toLowerCase() === escape(tagB.toLowerCase());
}
function byId(id, tag, root) {
var arr = [],
doc = root.ownerDocument || root,
el = doc.getElementById(stripslashes(id));
if (el) {
if (cmpTag(tag, el.nodeName) && _contains(root, el)) {
arr.push(el);
}
}
return arr;
}
function byClass(className, tag, root) {
var doc = root.ownerDocument || root, arr = [], els, i, len, el;
if (root.getElementsByClassName) {
els = root.getElementsByClassName(stripslashes(className));
for (i = 0, len = els.length; i < len; i++) {
el = els[i];
if (cmpTag(tag, el.nodeName)) {
arr.push(el);
}
}
} else if (doc.querySelectorAll) {
els = doc.querySelectorAll((root.nodeName !== '#document' ? root.nodeName + ' ' : '') + tag + '.' + className);
for (i = 0, len = els.length; i < len; i++) {
el = els[i];
if (_contains(root, el)) {
arr.push(el);
}
}
} else {
els = root.getElementsByTagName(tag);
className = ' ' + className + ' ';
for (i = 0, len = els.length; i < len; i++) {
el = els[i];
if (el.nodeType == 1) {
var cls = el.className;
if (cls && (' ' + cls + ' ').indexOf(className) > -1) {
arr.push(el);
}
}
}
}
return arr;
}
function byName(name, tag, root) {
var arr = [], doc = root.ownerDocument || root,
els = doc.getElementsByName(stripslashes(name)), el;
for (var i = 0, len = els.length; i < len; i++) {
el = els[i];
if (cmpTag(tag, el.nodeName) && _contains(root, el)) {
if (el.getAttributeNode('name')) {
arr.push(el);
}
}
}
return arr;
}
function byAttr(key, val, tag, root) {
var arr = [], els = root.getElementsByTagName(tag), el;
for (var i = 0, len = els.length; i < len; i++) {
el = els[i];
if (el.nodeType == 1) {
if (val === null) {
if (_getAttr(el, key) !== null) {
arr.push(el);
}
} else {
if (val === escape(_getAttr(el, key))) {
arr.push(el);
}
}
}
}
return arr;
}
function select(expr, root) {
var arr = [], matches;
matches = /^((?:\\.|[^.#\s\[<>])+)/.exec(expr);
var tag = matches ? matches[1] : '*';
if ((matches = /#((?:[\w\-]|\\.)+)$/.exec(expr))) {
arr = byId(matches[1], tag, root);
} else if ((matches = /\.((?:[\w\-]|\\.)+)$/.exec(expr))) {
arr = byClass(matches[1], tag, root);
} else if ((matches = /\[((?:[\w\-]|\\.)+)\]/.exec(expr))) {
arr = byAttr(matches[1].toLowerCase(), null, tag, root);
} else if ((matches = /\[((?:[\w\-]|\\.)+)\s*=\s*['"]?((?:\\.|[^'"]+)+)['"]?\]/.exec(expr))) {
var key = matches[1].toLowerCase(), val = matches[2];
if (key === 'id') {
arr = byId(val, tag, root);
} else if (key === 'class') {
arr = byClass(val, tag, root);
} else if (key === 'name') {
arr = byName(val, tag, root);
} else {
arr = byAttr(key, val, tag, root);
}
} else {
var els = root.getElementsByTagName(tag), el;
for (var i = 0, len = els.length; i < len; i++) {
el = els[i];
if (el.nodeType == 1) {
arr.push(el);
}
}
}
return arr;
}
var parts = [], arr, re = /((?:\\.|[^\s>])+|[\s>])/g;
while ((arr = re.exec(expr))) {
if (arr[1] !== ' ') {
parts.push(arr[1]);
}
}
var results = [];
if (parts.length == 1) {
return select(parts[0], root);
}
var isChild = false, part, els, subResults, val, v, i, j, k, length, len, l;
for (i = 0, lenth = parts.length; i < lenth; i++) {
part = parts[i];
if (part === '>') {
isChild = true;
continue;
}
if (i > 0) {
els = [];
for (j = 0, len = results.length; j < len; j++) {
val = results[j];
subResults = select(part, val);
for (k = 0, l = subResults.length; k < l; k++) {
v = subResults[k];
if (isChild) {
if (val === v.parentNode) {
els.push(v);
}
} else {
els.push(v);
}
}
}
results = els;
} else {
results = select(part, root);
}
if (results.length === 0) {
return [];
}
}
return results;
}
function _query(expr, root) {
var arr = _queryAll(expr, root);
return arr.length > 0 ? arr[0] : null;
}
K.query = _query;
K.queryAll = _queryAll;
function _get(val) {
return K(val)[0];
}
function _getDoc(node) {
if (!node) {
return document;
}
return node.ownerDocument || node.document || node;
}
function _getWin(node) {
if (!node) {
return window;
}
var doc = _getDoc(node);
return doc.parentWindow || doc.defaultView;
}
function _setHtml(el, html) {
if (el.nodeType != 1) {
return;
}
var doc = _getDoc(el);
try {
el.innerHTML = '<img id="__kindeditor_temp_tag__" width="0" height="0" style="display:none;" />' + html;
var temp = doc.getElementById('__kindeditor_temp_tag__');
temp.parentNode.removeChild(temp);
} catch(e) {
K(el).empty();
K('@' + html, doc).each(function() {
el.appendChild(this);
});
}
}
function _hasClass(el, cls) {
return _inString(cls, el.className, ' ');
}
function _setAttr(el, key, val) {
if (_IE && _V < 8 && key.toLowerCase() == 'class') {
key = 'className';
}
el.setAttribute(key, '' + val);
}
function _removeAttr(el, key) {
if (_IE && _V < 8 && key.toLowerCase() == 'class') {
key = 'className';
}
_setAttr(el, key, '');
el.removeAttribute(key);
}
function _getNodeName(node) {
if (!node || !node.nodeName) {
return '';
}
return node.nodeName.toLowerCase();
}
function _computedCss(el, key) {
var self = this, win = _getWin(el), camelKey = _toCamel(key), val = '';
if (win.getComputedStyle) {
var style = win.getComputedStyle(el, null);
val = style[camelKey] || style.getPropertyValue(key) || el.style[camelKey];
} else if (el.currentStyle) {
val = el.currentStyle[camelKey] || el.style[camelKey];
}
return val;
}
function _hasVal(node) {
return !!_VALUE_TAG_MAP[_getNodeName(node)];
}
function _docElement(doc) {
doc = doc || document;
return _QUIRKS ? doc.body : doc.documentElement;
}
function _docHeight(doc) {
var el = _docElement(doc);
return Math.max(el.scrollHeight, el.clientHeight);
}
function _docWidth(doc) {
var el = _docElement(doc);
return Math.max(el.scrollWidth, el.clientWidth);
}
function _getScrollPos(doc) {
doc = doc || document;
var x, y;
if (_IE || _OPERA) {
x = _docElement(doc).scrollLeft;
y = _docElement(doc).scrollTop;
} else {
x = _getWin(doc).scrollX;
y = _getWin(doc).scrollY;
}
return {x : x, y : y};
}
function KNode(node) {
this.init(node);
}
_extend(KNode, {
init : function(node) {
var self = this;
node = _isArray(node) ? node : [node];
var length = 0;
for (var i = 0, len = node.length; i < len; i++) {
if (node[i]) {
self[i] = node[i].constructor === KNode ? node[i][0] : node[i];
length++;
}
}
self.length = length;
self.doc = _getDoc(self[0]);
self.name = _getNodeName(self[0]);
self.type = self.length > 0 ? self[0].nodeType : null;
self.win = _getWin(self[0]);
self._data = {};
},
each : function(fn) {
var self = this;
for (var i = 0; i < self.length; i++) {
if (fn.call(self[i], i, self[i]) === false) {
return self;
}
}
return self;
},
bind : function(type, fn) {
this.each(function() {
_bind(this, type, fn);
});
return this;
},
unbind : function(type, fn) {
this.each(function() {
_unbind(this, type, fn);
});
return this;
},
fire : function(type) {
if (this.length < 1) {
return this;
}
_fire(this[0], type);
return this;
},
hasAttr : function(key) {
if (this.length < 1) {
return false;
}
return !!_getAttr(this[0], key);
},
attr : function(key, val) {
var self = this;
if (key === undefined) {
return _getAttrList(self.outer());
}
if (typeof key === 'object') {
_each(key, function(k, v) {
self.attr(k, v);
});
return self;
}
if (val === undefined) {
val = self.length < 1 ? null : _getAttr(self[0], key);
return val === null ? '' : val;
}
self.each(function() {
_setAttr(this, key, val);
});
return self;
},
removeAttr : function(key) {
this.each(function() {
_removeAttr(this, key);
});
return this;
},
get : function(i) {
if (this.length < 1) {
return null;
}
return this[i || 0];
},
eq : function(i) {
if (this.length < 1) {
return null;
}
return this[i] ? new KNode(this[i]) : null;
},
hasClass : function(cls) {
if (this.length < 1) {
return false;
}
return _hasClass(this[0], cls);
},
addClass : function(cls) {
this.each(function() {
if (!_hasClass(this, cls)) {
this.className = _trim(this.className + ' ' + cls);
}
});
return this;
},
removeClass : function(cls) {
this.each(function() {
if (_hasClass(this, cls)) {
this.className = _trim(this.className.replace(new RegExp('(^|\\s)' + cls + '(\\s|$)'), ' '));
}
});
return this;
},
html : function(val) {
var self = this;
if (val === undefined) {
if (self.length < 1 || self.type != 1) {
return '';
}
return _formatHtml(self[0].innerHTML);
}
self.each(function() {
_setHtml(this, val);
});
return self;
},
text : function() {
var self = this;
if (self.length < 1) {
return '';
}
return _IE ? self[0].innerText : self[0].textContent;
},
hasVal : function() {
if (this.length < 1) {
return false;
}
return _hasVal(this[0]);
},
val : function(val) {
var self = this;
if (val === undefined) {
if (self.length < 1) {
return '';
}
return self.hasVal() ? self[0].value : self.attr('value');
} else {
self.each(function() {
if (_hasVal(this)) {
this.value = val;
} else {
_setAttr(this, 'value' , val);
}
});
return self;
}
},
css : function(key, val) {
var self = this;
if (key === undefined) {
return _getCssList(self.attr('style'));
}
if (typeof key === 'object') {
_each(key, function(k, v) {
self.css(k, v);
});
return self;
}
if (val === undefined) {
if (self.length < 1) {
return '';
}
return self[0].style[_toCamel(key)] || _computedCss(self[0], key) || '';
}
self.each(function() {
this.style[_toCamel(key)] = val;
});
return self;
},
width : function(val) {
var self = this;
if (val === undefined) {
if (self.length < 1) {
return 0;
}
return self[0].offsetWidth;
}
return self.css('width', _addUnit(val));
},
height : function(val) {
var self = this;
if (val === undefined) {
if (self.length < 1) {
return 0;
}
return self[0].offsetHeight;
}
return self.css('height', _addUnit(val));
},
opacity : function(val) {
this.each(function() {
if (this.style.opacity === undefined) {
this.style.filter = val == 1 ? '' : 'alpha(opacity=' + (val * 100) + ')';
} else {
this.style.opacity = val == 1 ? '' : val;
}
});
return this;
},
data : function(key, val) {
var self = this;
if (val === undefined) {
return self._data[key];
}
self._data[key] = val;
return self;
},
pos : function() {
var self = this, node = self[0], x = 0, y = 0;
if (node) {
if (node.getBoundingClientRect) {
var box = node.getBoundingClientRect(),
pos = _getScrollPos(self.doc);
x = box.left + pos.x;
y = box.top + pos.y;
} else {
while (node) {
x += node.offsetLeft;
y += node.offsetTop;
node = node.offsetParent;
}
}
}
return {x : _round(x), y : _round(y)};
},
clone : function(bool) {
if (this.length < 1) {
return new KNode([]);
}
return new KNode(this[0].cloneNode(bool));
},
append : function(expr) {
this.each(function() {
if (this.appendChild) {
this.appendChild(_get(expr));
}
});
return this;
},
appendTo : function(expr) {
this.each(function() {
_get(expr).appendChild(this);
});
return this;
},
before : function(expr) {
this.each(function() {
this.parentNode.insertBefore(_get(expr), this);
});
return this;
},
after : function(expr) {
this.each(function() {
if (this.nextSibling) {
this.parentNode.insertBefore(_get(expr), this.nextSibling);
} else {
this.parentNode.appendChild(_get(expr));
}
});
return this;
},
replaceWith : function(expr) {
var nodes = [];
this.each(function(i, node) {
_unbind(node);
var newNode = _get(expr);
node.parentNode.replaceChild(newNode, node);
nodes.push(newNode);
});
return K(nodes);
},
empty : function() {
var self = this;
self.each(function(i, node) {
var child = node.firstChild;
while (child) {
if (!node.parentNode) {
return;
}
var next = child.nextSibling;
child.parentNode.removeChild(child);
child = next;
}
});
return self;
},
remove : function(keepChilds) {
var self = this;
self.each(function(i, node) {
if (!node.parentNode) {
return;
}
_unbind(node);
if (keepChilds) {
var child = node.firstChild;
while (child) {
var next = child.nextSibling;
node.parentNode.insertBefore(child, node);
child = next;
}
}
node.parentNode.removeChild(node);
delete self[i];
});
self.length = 0;
self._data = {};
return self;
},
show : function(val) {
return this.css('display', val === undefined ? 'block' : val);
},
hide : function() {
return this.css('display', 'none');
},
outer : function() {
var self = this;
if (self.length < 1) {
return '';
}
var div = self.doc.createElement('div'), html;
div.appendChild(self[0].cloneNode(true));
html = _formatHtml(div.innerHTML);
div = null;
return html;
},
isSingle : function() {
return !!_SINGLE_TAG_MAP[this.name];
},
isInline : function() {
return !!_INLINE_TAG_MAP[this.name];
},
isBlock : function() {
return !!_BLOCK_TAG_MAP[this.name];
},
isStyle : function() {
return !!_STYLE_TAG_MAP[this.name];
},
isControl : function() {
return !!_CONTROL_TAG_MAP[this.name];
},
contains : function(otherNode) {
if (this.length < 1) {
return false;
}
return _contains(this[0], _get(otherNode));
},
parent : function() {
if (this.length < 1) {
return null;
}
var node = this[0].parentNode;
return node ? new KNode(node) : null;
},
children : function() {
if (this.length < 1) {
return new KNode([]);
}
var list = [], child = this[0].firstChild;
while (child) {
if (child.nodeType != 3 || _trim(child.nodeValue) !== '') {
list.push(child);
}
child = child.nextSibling;
}
return new KNode(list);
},
first : function() {
var list = this.children();
return list.length > 0 ? list.eq(0) : null;
},
last : function() {
var list = this.children();
return list.length > 0 ? list.eq(list.length - 1) : null;
},
index : function() {
if (this.length < 1) {
return -1;
}
var i = -1, sibling = this[0];
while (sibling) {
i++;
sibling = sibling.previousSibling;
}
return i;
},
prev : function() {
if (this.length < 1) {
return null;
}
var node = this[0].previousSibling;
return node ? new KNode(node) : null;
},
next : function() {
if (this.length < 1) {
return null;
}
var node = this[0].nextSibling;
return node ? new KNode(node) : null;
},
scan : function(fn, order) {
if (this.length < 1) {
return;
}
order = (order === undefined) ? true : order;
function walk(node) {
var n = order ? node.firstChild : node.lastChild;
while (n) {
var next = order ? n.nextSibling : n.previousSibling;
if (fn(n) === false) {
return false;
}
if (walk(n) === false) {
return false;
}
n = next;
}
}
walk(this[0]);
return this;
}
});
_each(('blur,focus,focusin,focusout,load,resize,scroll,unload,click,dblclick,' +
'mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,' +
'change,select,submit,keydown,keypress,keyup,error,contextmenu').split(','), function(i, type) {
KNode.prototype[type] = function(fn) {
return fn ? this.bind(type, fn) : this.fire(type);
};
});
var _K = K;
K = function(expr, root) {
if (expr === undefined || expr === null) {
return;
}
function newNode(node) {
if (!node[0]) {
node = [];
}
return new KNode(node);
}
if (typeof expr === 'string') {
if (root) {
root = _get(root);
}
var length = expr.length;
if (expr.charAt(0) === '@') {
expr = expr.substr(1);
}
if (expr.length !== length || /<.+>/.test(expr)) {
var doc = root ? root.ownerDocument || root : document,
div = doc.createElement('div'), list = [];
div.innerHTML = '<img id="__kindeditor_temp_tag__" width="0" height="0" style="display:none;" />' + expr;
for (var i = 0, len = div.childNodes.length; i < len; i++) {
var child = div.childNodes[i];
if (child.id == '__kindeditor_temp_tag__') {
continue;
}
list.push(child);
}
return newNode(list);
}
return newNode(_queryAll(expr, root));
}
if (expr && expr.constructor === KNode) {
return expr;
}
if (_isArray(expr)) {
return newNode(expr);
}
return newNode(_toArray(arguments));
};
_each(_K, function(key, val) {
K[key] = val;
});
window.KindEditor = K;
var _START_TO_START = 0,
_START_TO_END = 1,
_END_TO_END = 2,
_END_TO_START = 3,
_BOOKMARK_ID = 0;
function _updateCollapsed(range) {
range.collapsed = (range.startContainer === range.endContainer && range.startOffset === range.endOffset);
return range;
}
function _copyAndDelete(range, isCopy, isDelete) {
var doc = range.doc, nodeList = [];
function splitTextNode(node, startOffset, endOffset) {
var length = node.nodeValue.length, centerNode;
if (isCopy) {
var cloneNode = node.cloneNode(true);
if (startOffset > 0) {
centerNode = cloneNode.splitText(startOffset);
} else {
centerNode = cloneNode;
}
if (endOffset < length) {
centerNode.splitText(endOffset - startOffset);
}
}
if (isDelete) {
var center = node;
if (startOffset > 0) {
center = node.splitText(startOffset);
range.setStart(node, startOffset);
}
if (endOffset < length) {
var right = center.splitText(endOffset - startOffset);
range.setEnd(right, 0);
}
nodeList.push(center);
}
return centerNode;
}
function removeNodes() {
if (isDelete) {
range.up().collapse(true);
}
for (var i = 0, len = nodeList.length; i < len; i++) {
var node = nodeList[i];
if (node.parentNode) {
node.parentNode.removeChild(node);
}
}
}
var copyRange = range.cloneRange().down();
var start = -1, incStart = -1, incEnd = -1, end = -1,
ancestor = range.commonAncestor(), frag = doc.createDocumentFragment();
if (ancestor.nodeType == 3) {
var textNode = splitTextNode(ancestor, range.startOffset, range.endOffset);
if (isCopy) {
frag.appendChild(textNode);
}
removeNodes();
return isCopy ? frag : range;
}
function extractNodes(parent, frag) {
var node = parent.firstChild, nextNode;
while (node) {
var testRange = new KRange(doc).selectNode(node);
start = testRange.compareBoundaryPoints(_START_TO_END, range);
if (start >= 0 && incStart <= 0) {
incStart = testRange.compareBoundaryPoints(_START_TO_START, range);
}
if (incStart >= 0 && incEnd <= 0) {
incEnd = testRange.compareBoundaryPoints(_END_TO_END, range);
}
if (incEnd >= 0 && end <= 0) {
end = testRange.compareBoundaryPoints(_END_TO_START, range);
}
if (end >= 0) {
return false;
}
nextNode = node.nextSibling;
if (start > 0) {
if (node.nodeType == 1) {
if (incStart >= 0 && incEnd <= 0) {
if (isCopy) {
frag.appendChild(node.cloneNode(true));
}
if (isDelete) {
nodeList.push(node);
}
} else {
var childFlag;
if (isCopy) {
childFlag = node.cloneNode(false);
frag.appendChild(childFlag);
}
if (extractNodes(node, childFlag) === false) {
return false;
}
}
} else if (node.nodeType == 3) {
var textNode;
if (node == copyRange.startContainer) {
textNode = splitTextNode(node, copyRange.startOffset, node.nodeValue.length);
} else if (node == copyRange.endContainer) {
textNode = splitTextNode(node, 0, copyRange.endOffset);
} else {
textNode = splitTextNode(node, 0, node.nodeValue.length);
}
if (isCopy) {
try {
frag.appendChild(textNode);
} catch(e) {}
}
}
}
node = nextNode;
}
}
extractNodes(ancestor, frag);
if (isDelete) {
range.up().collapse(true);
}
for (var i = 0, len = nodeList.length; i < len; i++) {
var node = nodeList[i];
if (node.parentNode) {
node.parentNode.removeChild(node);
}
}
return isCopy ? frag : range;
}
function _moveToElementText(range, el) {
var node = el;
while (node) {
var knode = K(node);
if (knode.name == 'marquee' || knode.name == 'select') {
return;
}
node = node.parentNode;
}
try {
range.moveToElementText(el);
} catch(e) {}
}
function _getStartEnd(rng, isStart) {
var doc = rng.parentElement().ownerDocument,
pointRange = rng.duplicate();
pointRange.collapse(isStart);
var parent = pointRange.parentElement(),
nodes = parent.childNodes;
if (nodes.length === 0) {
return {node: parent.parentNode, offset: K(parent).index()};
}
var startNode = doc, startPos = 0, cmp = -1;
var testRange = rng.duplicate();
_moveToElementText(testRange, parent);
for (var i = 0, len = nodes.length; i < len; i++) {
var node = nodes[i];
cmp = testRange.compareEndPoints('StartToStart', pointRange);
if (cmp === 0) {
return {node: node.parentNode, offset: i};
}
if (node.nodeType == 1) {
var nodeRange = rng.duplicate(), dummy, knode = K(node), newNode = node;
if (knode.isControl()) {
dummy = doc.createElement('span');
knode.after(dummy);
newNode = dummy;
startPos += knode.text().replace(/\r\n|\n|\r/g, '').length;
}
_moveToElementText(nodeRange, newNode);
testRange.setEndPoint('StartToEnd', nodeRange);
if (cmp > 0) {
startPos += nodeRange.text.replace(/\r\n|\n|\r/g, '').length;
} else {
startPos = 0;
}
if (dummy) {
K(dummy).remove();
}
} else if (node.nodeType == 3) {
testRange.moveStart('character', node.nodeValue.length);
startPos += node.nodeValue.length;
}
if (cmp < 0) {
startNode = node;
}
}
if (cmp < 0 && startNode.nodeType == 1) {
return {node: parent, offset: K(parent.lastChild).index() + 1};
}
if (cmp > 0) {
while (startNode.nextSibling && startNode.nodeType == 1) {
startNode = startNode.nextSibling;
}
}
testRange = rng.duplicate();
_moveToElementText(testRange, parent);
testRange.setEndPoint('StartToEnd', pointRange);
startPos -= testRange.text.replace(/\r\n|\n|\r/g, '').length;
if (cmp > 0 && startNode.nodeType == 3) {
var prevNode = startNode.previousSibling;
while (prevNode && prevNode.nodeType == 3) {
startPos -= prevNode.nodeValue.length;
prevNode = prevNode.previousSibling;
}
}
return {node: startNode, offset: startPos};
}
function _getEndRange(node, offset) {
var doc = node.ownerDocument || node,
range = doc.body.createTextRange();
if (doc == node) {
range.collapse(true);
return range;
}
if (node.nodeType == 1 && node.childNodes.length > 0) {
var children = node.childNodes, isStart, child;
if (offset === 0) {
child = children[0];
isStart = true;
} else {
child = children[offset - 1];
isStart = false;
}
if (!child) {
return range;
}
if (K(child).name === 'head') {
if (offset === 1) {
isStart = true;
}
if (offset === 2) {
isStart = false;
}
range.collapse(isStart);
return range;
}
if (child.nodeType == 1) {
var kchild = K(child), span;
if (kchild.isControl()) {
span = doc.createElement('span');
if (isStart) {
kchild.before(span);
} else {
kchild.after(span);
}
child = span;
}
_moveToElementText(range, child);
range.collapse(isStart);
if (span) {
K(span).remove();
}
return range;
}
node = child;
offset = isStart ? 0 : child.nodeValue.length;
}
var dummy = doc.createElement('span');
K(node).before(dummy);
_moveToElementText(range, dummy);
range.moveStart('character', offset);
K(dummy).remove();
return range;
}
function _toRange(rng) {
var doc, range;
function tr2td(start) {
if (K(start.node).name == 'tr') {
start.node = start.node.cells[start.offset];
start.offset = 0;
}
}
if (_IE) {
if (rng.item) {
doc = _getDoc(rng.item(0));
range = new KRange(doc);
range.selectNode(rng.item(0));
return range;
}
doc = rng.parentElement().ownerDocument;
var start = _getStartEnd(rng, true),
end = _getStartEnd(rng, false);
tr2td(start);
tr2td(end);
range = new KRange(doc);
range.setStart(start.node, start.offset);
range.setEnd(end.node, end.offset);
return range;
}
var startContainer = rng.startContainer;
doc = startContainer.ownerDocument || startContainer;
range = new KRange(doc);
range.setStart(startContainer, rng.startOffset);
range.setEnd(rng.endContainer, rng.endOffset);
return range;
}
function KRange(doc) {
this.init(doc);
}
_extend(KRange, {
init : function(doc) {
var self = this;
self.startContainer = doc;
self.startOffset = 0;
self.endContainer = doc;
self.endOffset = 0;
self.collapsed = true;
self.doc = doc;
},
commonAncestor : function() {
function getParents(node) {
var parents = [];
while (node) {
parents.push(node);
node = node.parentNode;
}
return parents;
}
var parentsA = getParents(this.startContainer),
parentsB = getParents(this.endContainer),
i = 0, lenA = parentsA.length, lenB = parentsB.length, parentA, parentB;
while (++i) {
parentA = parentsA[lenA - i];
parentB = parentsB[lenB - i];
if (!parentA || !parentB || parentA !== parentB) {
break;
}
}
return parentsA[lenA - i + 1];
},
setStart : function(node, offset) {
var self = this, doc = self.doc;
self.startContainer = node;
self.startOffset = offset;
if (self.endContainer === doc) {
self.endContainer = node;
self.endOffset = offset;
}
return _updateCollapsed(this);
},
setEnd : function(node, offset) {
var self = this, doc = self.doc;
self.endContainer = node;
self.endOffset = offset;
if (self.startContainer === doc) {
self.startContainer = node;
self.startOffset = offset;
}
return _updateCollapsed(this);
},
setStartBefore : function(node) {
return this.setStart(node.parentNode || this.doc, K(node).index());
},
setStartAfter : function(node) {
return this.setStart(node.parentNode || this.doc, K(node).index() + 1);
},
setEndBefore : function(node) {
return this.setEnd(node.parentNode || this.doc, K(node).index());
},
setEndAfter : function(node) {
return this.setEnd(node.parentNode || this.doc, K(node).index() + 1);
},
selectNode : function(node) {
return this.setStartBefore(node).setEndAfter(node);
},
selectNodeContents : function(node) {
var knode = K(node);
if (knode.type == 3 || knode.isSingle()) {
return this.selectNode(node);
}
var children = knode.children();
if (children.length > 0) {
return this.setStartBefore(children[0]).setEndAfter(children[children.length - 1]);
}
return this.setStart(node, 0).setEnd(node, 0);
},
collapse : function(toStart) {
if (toStart) {
return this.setEnd(this.startContainer, this.startOffset);
}
return this.setStart(this.endContainer, this.endOffset);
},
compareBoundaryPoints : function(how, range) {
var rangeA = this.get(), rangeB = range.get();
if (_IE) {
var arr = {};
arr[_START_TO_START] = 'StartToStart';
arr[_START_TO_END] = 'EndToStart';
arr[_END_TO_END] = 'EndToEnd';
arr[_END_TO_START] = 'StartToEnd';
var cmp = rangeA.compareEndPoints(arr[how], rangeB);
if (cmp !== 0) {
return cmp;
}
var nodeA, nodeB, nodeC, posA, posB;
if (how === _START_TO_START || how === _END_TO_START) {
nodeA = this.startContainer;
posA = this.startOffset;
}
if (how === _START_TO_END || how === _END_TO_END) {
nodeA = this.endContainer;
posA = this.endOffset;
}
if (how === _START_TO_START || how === _START_TO_END) {
nodeB = range.startContainer;
posB = range.startOffset;
}
if (how === _END_TO_END || how === _END_TO_START) {
nodeB = range.endContainer;
posB = range.endOffset;
}
if (nodeA === nodeB) {
var diff = posA - posB;
return diff > 0 ? 1 : (diff < 0 ? -1 : 0);
}
nodeC = nodeB;
while (nodeC && nodeC.parentNode !== nodeA) {
nodeC = nodeC.parentNode;
}
if (nodeC) {
return K(nodeC).index() >= posA ? -1 : 1;
}
nodeC = nodeA;
while (nodeC && nodeC.parentNode !== nodeB) {
nodeC = nodeC.parentNode;
}
if (nodeC) {
return K(nodeC).index() >= posB ? 1 : -1;
}
nodeC = K(nodeB).next();
if (nodeC && nodeC.contains(nodeA)) {
return 1;
}
nodeC = K(nodeA).next();
if (nodeC && nodeC.contains(nodeB)) {
return -1;
}
} else {
return rangeA.compareBoundaryPoints(how, rangeB);
}
},
cloneRange : function() {
return new KRange(this.doc).setStart(this.startContainer, this.startOffset).setEnd(this.endContainer, this.endOffset);
},
toString : function() {
var rng = this.get(), str = _IE ? rng.text : rng.toString();
return str.replace(/\r\n|\n|\r/g, '');
},
cloneContents : function() {
return _copyAndDelete(this, true, false);
},
deleteContents : function() {
return _copyAndDelete(this, false, true);
},
extractContents : function() {
return _copyAndDelete(this, true, true);
},
insertNode : function(node) {
var self = this,
sc = self.startContainer, so = self.startOffset,
ec = self.endContainer, eo = self.endOffset,
firstChild, lastChild, c, nodeCount = 1;
if (node.nodeName.toLowerCase() === '#document-fragment') {
firstChild = node.firstChild;
lastChild = node.lastChild;
nodeCount = node.childNodes.length;
}
if (sc.nodeType == 1) {
c = sc.childNodes[so];
if (c) {
sc.insertBefore(node, c);
if (sc === ec) {
eo += nodeCount;
}
} else {
sc.appendChild(node);
}
} else if (sc.nodeType == 3) {
if (so === 0) {
sc.parentNode.insertBefore(node, sc);
if (sc.parentNode === ec) {
eo += nodeCount;
}
} else if (so >= sc.nodeValue.length) {
if (sc.nextSibling) {
sc.parentNode.insertBefore(node, sc.nextSibling);
} else {
sc.parentNode.appendChild(node);
}
} else {
if (so > 0) {
c = sc.splitText(so);
} else {
c = sc;
}
sc.parentNode.insertBefore(node, c);
if (sc === ec) {
ec = c;
eo -= so;
}
}
}
if (firstChild) {
self.setStartBefore(firstChild).setEndAfter(lastChild);
} else {
self.selectNode(node);
}
if (self.compareBoundaryPoints(_END_TO_END, self.cloneRange().setEnd(ec, eo)) >= 1) {
return self;
}
return self.setEnd(ec, eo);
},
surroundContents : function(node) {
node.appendChild(this.extractContents());
return this.insertNode(node).selectNode(node);
},
isControl : function() {
var self = this,
sc = self.startContainer, so = self.startOffset,
ec = self.endContainer, eo = self.endOffset, rng;
return sc.nodeType == 1 && sc === ec && so + 1 === eo && K(sc.childNodes[so]).isControl();
},
get : function(hasControlRange) {
var self = this, doc = self.doc, node, rng;
if (!_IE) {
rng = doc.createRange();
try {
rng.setStart(self.startContainer, self.startOffset);
rng.setEnd(self.endContainer, self.endOffset);
} catch (e) {}
return rng;
}
if (hasControlRange && self.isControl()) {
rng = doc.body.createControlRange();
rng.addElement(self.startContainer.childNodes[self.startOffset]);
return rng;
}
var range = self.cloneRange().down();
rng = doc.body.createTextRange();
rng.setEndPoint('StartToStart', _getEndRange(range.startContainer, range.startOffset));
rng.setEndPoint('EndToStart', _getEndRange(range.endContainer, range.endOffset));
return rng;
},
html : function() {
return K(this.cloneContents()).outer();
},
down : function() {
var self = this;
function downPos(node, pos, isStart) {
if (node.nodeType != 1) {
return;
}
var children = K(node).children();
if (children.length === 0) {
return;
}
var left, right, child, offset;
if (pos > 0) {
left = children.eq(pos - 1);
}
if (pos < children.length) {
right = children.eq(pos);
}
if (left && left.type == 3) {
child = left[0];
offset = child.nodeValue.length;
}
if (right && right.type == 3) {
child = right[0];
offset = 0;
}
if (!child) {
return;
}
if (isStart) {
self.setStart(child, offset);
} else {
self.setEnd(child, offset);
}
}
downPos(self.startContainer, self.startOffset, true);
downPos(self.endContainer, self.endOffset, false);
return self;
},
up : function() {
var self = this;
function upPos(node, pos, isStart) {
if (node.nodeType != 3) {
return;
}
if (pos === 0) {
if (isStart) {
self.setStartBefore(node);
} else {
self.setEndBefore(node);
}
} else if (pos == node.nodeValue.length) {
if (isStart) {
self.setStartAfter(node);
} else {
self.setEndAfter(node);
}
}
}
upPos(self.startContainer, self.startOffset, true);
upPos(self.endContainer, self.endOffset, false);
return self;
},
enlarge : function(toBlock) {
var self = this;
self.up();
function enlargePos(node, pos, isStart) {
var knode = K(node), parent;
if (knode.type == 3 || _NOSPLIT_TAG_MAP[knode.name] || !toBlock && knode.isBlock()) {
return;
}
if (pos === 0) {
while (!knode.prev()) {
parent = knode.parent();
if (!parent || _NOSPLIT_TAG_MAP[parent.name] || !toBlock && parent.isBlock()) {
break;
}
knode = parent;
}
if (isStart) {
self.setStartBefore(knode[0]);
} else {
self.setEndBefore(knode[0]);
}
} else if (pos == knode.children().length) {
while (!knode.next()) {
parent = knode.parent();
if (!parent || _NOSPLIT_TAG_MAP[parent.name] || !toBlock && parent.isBlock()) {
break;
}
knode = parent;
}
if (isStart) {
self.setStartAfter(knode[0]);
} else {
self.setEndAfter(knode[0]);
}
}
}
enlargePos(self.startContainer, self.startOffset, true);
enlargePos(self.endContainer, self.endOffset, false);
return self;
},
shrink : function() {
var self = this, child, collapsed = self.collapsed;
while (self.startContainer.nodeType == 1 && (child = self.startContainer.childNodes[self.startOffset]) && child.nodeType == 1 && !K(child).isSingle()) {
self.setStart(child, 0);
}
if (collapsed) {
return self.collapse(collapsed);
}
while (self.endContainer.nodeType == 1 && self.endOffset > 0 && (child = self.endContainer.childNodes[self.endOffset - 1]) && child.nodeType == 1 && !K(child).isSingle()) {
self.setEnd(child, child.childNodes.length);
}
return self;
},
createBookmark : function(serialize) {
var self = this, doc = self.doc, endNode,
startNode = K('<span style="display:none;"></span>', doc)[0];
startNode.id = '__kindeditor_bookmark_start_' + (_BOOKMARK_ID++) + '__';
if (!self.collapsed) {
endNode = startNode.cloneNode(true);
endNode.id = '__kindeditor_bookmark_end_' + (_BOOKMARK_ID++) + '__';
}
if (endNode) {
self.cloneRange().collapse(false).insertNode(endNode).setEndBefore(endNode);
}
self.insertNode(startNode).setStartAfter(startNode);
return {
start : serialize ? '#' + startNode.id : startNode,
end : endNode ? (serialize ? '#' + endNode.id : endNode) : null
};
},
moveToBookmark : function(bookmark) {
var self = this, doc = self.doc,
start = K(bookmark.start, doc), end = bookmark.end ? K(bookmark.end, doc) : null;
if (!start || start.length < 1) {
return self;
}
self.setStartBefore(start[0]);
start.remove();
if (end && end.length > 0) {
self.setEndBefore(end[0]);
end.remove();
} else {
self.collapse(true);
}
return self;
},
dump : function() {
console.log('--------------------');
console.log(this.startContainer.nodeType == 3 ? this.startContainer.nodeValue : this.startContainer, this.startOffset);
console.log(this.endContainer.nodeType == 3 ? this.endContainer.nodeValue : this.endContainer, this.endOffset);
}
});
function _range(mixed) {
if (!mixed.nodeName) {
return mixed.constructor === KRange ? mixed : _toRange(mixed);
}
return new KRange(mixed);
}
K.range = _range;
K.START_TO_START = _START_TO_START;
K.START_TO_END = _START_TO_END;
K.END_TO_END = _END_TO_END;
K.END_TO_START = _END_TO_START;
function _nativeCommand(doc, key, val) {
try {
doc.execCommand(key, false, val);
} catch(e) {}
}
function _nativeCommandValue(doc, key) {
var val = '';
try {
val = doc.queryCommandValue(key);
} catch (e) {}
if (typeof val !== 'string') {
val = '';
}
return val;
}
function _getSel(doc) {
var win = _getWin(doc);
return doc.selection || win.getSelection();
}
function _getRng(doc) {
var sel = _getSel(doc), rng;
try {
if (sel.rangeCount > 0) {
rng = sel.getRangeAt(0);
} else {
rng = sel.createRange();
}
} catch(e) {}
if (_IE && (!rng || (!rng.item && rng.parentElement().ownerDocument !== doc))) {
return null;
}
return rng;
}
function _singleKeyMap(map) {
var newMap = {}, arr, v;
_each(map, function(key, val) {
arr = key.split(',');
for (var i = 0, len = arr.length; i < len; i++) {
v = arr[i];
newMap[v] = val;
}
});
return newMap;
}
function _hasAttrOrCss(knode, map) {
return _hasAttrOrCssByKey(knode, map, '*') || _hasAttrOrCssByKey(knode, map);
}
function _hasAttrOrCssByKey(knode, map, mapKey) {
mapKey = mapKey || knode.name;
if (knode.type !== 1) {
return false;
}
var newMap = _singleKeyMap(map);
if (!newMap[mapKey]) {
return false;
}
var arr = newMap[mapKey].split(',');
for (var i = 0, len = arr.length; i < len; i++) {
var key = arr[i];
if (key === '*') {
return true;
}
var match = /^(\.?)([^=]+)(?:=([^=]*))?$/.exec(key);
var method = match[1] ? 'css' : 'attr';
key = match[2];
var val = match[3] || '';
if (val === '' && knode[method](key) !== '') {
return true;
}
if (val !== '' && knode[method](key) === val) {
return true;
}
}
return false;
}
function _removeAttrOrCss(knode, map) {
if (knode.type != 1) {
return;
}
_removeAttrOrCssByKey(knode, map, '*');
_removeAttrOrCssByKey(knode, map);
}
function _removeAttrOrCssByKey(knode, map, mapKey) {
mapKey = mapKey || knode.name;
if (knode.type !== 1) {
return;
}
var newMap = _singleKeyMap(map);
if (!newMap[mapKey]) {
return;
}
var arr = newMap[mapKey].split(','), allFlag = false;
for (var i = 0, len = arr.length; i < len; i++) {
var key = arr[i];
if (key === '*') {
allFlag = true;
break;
}
var match = /^(\.?)([^=]+)(?:=([^=]*))?$/.exec(key);
key = match[2];
if (match[1]) {
key = _toCamel(key);
if (knode[0].style[key]) {
knode[0].style[key] = '';
}
} else {
knode.removeAttr(key);
}
}
if (allFlag) {
knode.remove(true);
}
}
function _getInnerNode(knode) {
var inner = knode;
while (inner.first()) {
inner = inner.first();
}
return inner;
}
function _isEmptyNode(knode) {
return knode.type == 1 && knode.html().replace(/<[^>]+>/g, '') === '';
}
function _mergeWrapper(a, b) {
a = a.clone(true);
var lastA = _getInnerNode(a), childA = a, merged = false;
while (b) {
while (childA) {
if (childA.name === b.name) {
_mergeAttrs(childA, b.attr(), b.css());
merged = true;
}
childA = childA.first();
}
if (!merged) {
lastA.append(b.clone(false));
}
merged = false;
b = b.first();
}
return a;
}
function _wrapNode(knode, wrapper) {
wrapper = wrapper.clone(true);
if (knode.type == 3) {
_getInnerNode(wrapper).append(knode.clone(false));
knode.replaceWith(wrapper);
return wrapper;
}
var nodeWrapper = knode, child;
while ((child = knode.first()) && child.children().length == 1) {
knode = child;
}
child = knode.first();
var frag = knode.doc.createDocumentFragment();
while (child) {
frag.appendChild(child[0]);
child = child.next();
}
wrapper = _mergeWrapper(nodeWrapper, wrapper);
if (frag.firstChild) {
_getInnerNode(wrapper).append(frag);
}
nodeWrapper.replaceWith(wrapper);
return wrapper;
}
function _mergeAttrs(knode, attrs, styles) {
_each(attrs, function(key, val) {
if (key !== 'style') {
knode.attr(key, val);
}
});
_each(styles, function(key, val) {
knode.css(key, val);
});
}
function _inPreElement(knode) {
while (knode && knode.name != 'body') {
if (_PRE_TAG_MAP[knode.name] || knode.name == 'div' && knode.hasClass('ke-script')) {
return true;
}
knode = knode.parent();
}
return false;
}
function KCmd(range) {
this.init(range);
}
_extend(KCmd, {
init : function(range) {
var self = this, doc = range.doc;
self.doc = doc;
self.win = _getWin(doc);
self.sel = _getSel(doc);
self.range = range;
},
selection : function(forceReset) {
var self = this, doc = self.doc, rng = _getRng(doc);
self.sel = _getSel(doc);
if (rng) {
self.range = _range(rng);
if (K(self.range.startContainer).name == 'html') {
self.range.selectNodeContents(doc.body).collapse(false);
}
return self;
}
if (forceReset) {
self.range.selectNodeContents(doc.body).collapse(false);
}
return self;
},
select : function(hasDummy) {
hasDummy = _undef(hasDummy, true);
var self = this, sel = self.sel, range = self.range.cloneRange().shrink(),
sc = range.startContainer, so = range.startOffset,
ec = range.endContainer, eo = range.endOffset,
doc = _getDoc(sc), win = self.win, rng, hasU200b = false;
if (hasDummy && sc.nodeType == 1 && range.collapsed) {
if (_IE) {
var dummy = K('<span> </span>', doc);
range.insertNode(dummy[0]);
rng = doc.body.createTextRange();
try {
rng.moveToElementText(dummy[0]);
} catch(ex) {}
rng.collapse(false);
rng.select();
dummy.remove();
win.focus();
return self;
}
if (_WEBKIT) {
var children = sc.childNodes;
if (K(sc).isInline() || so > 0 && K(children[so - 1]).isInline() || children[so] && K(children[so]).isInline()) {
range.insertNode(doc.createTextNode('\u200B'));
hasU200b = true;
}
}
}
if (_IE) {
try {
rng = range.get(true);
rng.select();
} catch(e) {}
} else {
if (hasU200b) {
range.collapse(false);
}
rng = range.get(true);
sel.removeAllRanges();
sel.addRange(rng);
}
win.focus();
return self;
},
wrap : function(val) {
var self = this, doc = self.doc, range = self.range, wrapper;
wrapper = K(val, doc);
if (range.collapsed) {
range.shrink();
range.insertNode(wrapper[0]).selectNodeContents(wrapper[0]);
return self;
}
if (wrapper.isBlock()) {
var copyWrapper = wrapper.clone(true), child = copyWrapper;
while (child.first()) {
child = child.first();
}
child.append(range.extractContents());
range.insertNode(copyWrapper[0]).selectNode(copyWrapper[0]);
return self;
}
range.enlarge();
var bookmark = range.createBookmark(), ancestor = range.commonAncestor(), isStart = false;
K(ancestor).scan(function(node) {
if (!isStart && node == bookmark.start) {
isStart = true;
return;
}
if (isStart) {
if (node == bookmark.end) {
return false;
}
var knode = K(node);
if (_inPreElement(knode)) {
return;
}
if (knode.type == 3 && _trim(node.nodeValue).length > 0) {
var parent;
while ((parent = knode.parent()) && parent.isStyle() && parent.children().length == 1) {
knode = parent;
}
_wrapNode(knode, wrapper);
}
}
});
range.moveToBookmark(bookmark);
return self;
},
split : function(isStart, map) {
var range = this.range, doc = range.doc;
var tempRange = range.cloneRange().collapse(isStart);
var node = tempRange.startContainer, pos = tempRange.startOffset,
parent = node.nodeType == 3 ? node.parentNode : node,
needSplit = false, knode;
while (parent && parent.parentNode) {
knode = K(parent);
if (map) {
if (!knode.isStyle()) {
break;
}
if (!_hasAttrOrCss(knode, map)) {
break;
}
} else {
if (_NOSPLIT_TAG_MAP[knode.name]) {
break;
}
}
needSplit = true;
parent = parent.parentNode;
}
if (needSplit) {
var dummy = doc.createElement('span');
range.cloneRange().collapse(!isStart).insertNode(dummy);
if (isStart) {
tempRange.setStartBefore(parent.firstChild).setEnd(node, pos);
} else {
tempRange.setStart(node, pos).setEndAfter(parent.lastChild);
}
var frag = tempRange.extractContents(),
first = frag.firstChild, last = frag.lastChild;
if (isStart) {
tempRange.insertNode(frag);
range.setStartAfter(last).setEndBefore(dummy);
} else {
parent.appendChild(frag);
range.setStartBefore(dummy).setEndBefore(first);
}
var dummyParent = dummy.parentNode;
if (dummyParent == range.endContainer) {
var prev = K(dummy).prev(), next = K(dummy).next();
if (prev && next && prev.type == 3 && next.type == 3) {
range.setEnd(prev[0], prev[0].nodeValue.length);
} else if (!isStart) {
range.setEnd(range.endContainer, range.endOffset - 1);
}
}
dummyParent.removeChild(dummy);
}
return this;
},
remove : function(map) {
var self = this, doc = self.doc, range = self.range;
range.enlarge();
if (range.startOffset === 0) {
var ksc = K(range.startContainer), parent;
while ((parent = ksc.parent()) && parent.isStyle() && parent.children().length == 1) {
ksc = parent;
}
range.setStart(ksc[0], 0);
ksc = K(range.startContainer);
if (ksc.isBlock()) {
_removeAttrOrCss(ksc, map);
}
var kscp = ksc.parent();
if (kscp && kscp.isBlock()) {
_removeAttrOrCss(kscp, map);
}
}
var sc, so;
if (range.collapsed) {
self.split(true, map);
sc = range.startContainer;
so = range.startOffset;
if (so > 0) {
var sb = K(sc.childNodes[so - 1]);
if (sb && _isEmptyNode(sb)) {
sb.remove();
range.setStart(sc, so - 1);
}
}
var sa = K(sc.childNodes[so]);
if (sa && _isEmptyNode(sa)) {
sa.remove();
}
if (_isEmptyNode(sc)) {
range.startBefore(sc);
sc.remove();
}
range.collapse(true);
return self;
}
self.split(true, map);
self.split(false, map);
var startDummy = doc.createElement('span'), endDummy = doc.createElement('span');
range.cloneRange().collapse(false).insertNode(endDummy);
range.cloneRange().collapse(true).insertNode(startDummy);
var nodeList = [], cmpStart = false;
K(range.commonAncestor()).scan(function(node) {
if (!cmpStart && node == startDummy) {
cmpStart = true;
return;
}
if (node == endDummy) {
return false;
}
if (cmpStart) {
nodeList.push(node);
}
});
K(startDummy).remove();
K(endDummy).remove();
sc = range.startContainer;
so = range.startOffset;
var ec = range.endContainer, eo = range.endOffset;
if (so > 0) {
var startBefore = K(sc.childNodes[so - 1]);
if (startBefore && _isEmptyNode(startBefore)) {
startBefore.remove();
range.setStart(sc, so - 1);
if (sc == ec) {
range.setEnd(ec, eo - 1);
}
}
var startAfter = K(sc.childNodes[so]);
if (startAfter && _isEmptyNode(startAfter)) {
startAfter.remove();
if (sc == ec) {
range.setEnd(ec, eo - 1);
}
}
}
var endAfter = K(ec.childNodes[range.endOffset]);
if (endAfter && _isEmptyNode(endAfter)) {
endAfter.remove();
}
var bookmark = range.createBookmark(true);
_each(nodeList, function(i, node) {
_removeAttrOrCss(K(node), map);
});
range.moveToBookmark(bookmark);
return self;
},
commonNode : function(map) {
var range = this.range;
var ec = range.endContainer, eo = range.endOffset,
node = (ec.nodeType == 3 || eo === 0) ? ec : ec.childNodes[eo - 1];
function find(node) {
var child = node, parent = node;
while (parent) {
if (_hasAttrOrCss(K(parent), map)) {
return K(parent);
}
parent = parent.parentNode;
}
while (child && (child = child.lastChild)) {
if (_hasAttrOrCss(K(child), map)) {
return K(child);
}
}
return null;
}
var cNode = find(node);
if (cNode) {
return cNode;
}
if (node.nodeType == 1 || (ec.nodeType == 3 && eo === 0)) {
var prev = K(node).prev();
if (prev) {
return find(prev);
}
}
return null;
},
commonAncestor : function(tagName) {
var range = this.range,
sc = range.startContainer, so = range.startOffset,
ec = range.endContainer, eo = range.endOffset,
startNode = (sc.nodeType == 3 || so === 0) ? sc : sc.childNodes[so - 1],
endNode = (ec.nodeType == 3 || eo === 0) ? ec : ec.childNodes[eo - 1];
function find(node) {
while (node) {
if (node.nodeType == 1) {
if (node.tagName.toLowerCase() === tagName) {
return node;
}
}
node = node.parentNode;
}
return null;
}
var start = find(startNode), end = find(endNode);
if (start && end && start === end) {
return K(start);
}
return null;
},
state : function(key) {
var self = this, doc = self.doc, bool = false;
try {
bool = doc.queryCommandState(key);
} catch (e) {}
return bool;
},
val : function(key) {
var self = this, doc = self.doc, range = self.range;
function lc(val) {
return val.toLowerCase();
}
key = lc(key);
var val = '', knode;
if (key === 'fontfamily' || key === 'fontname') {
val = _nativeCommandValue(doc, 'fontname');
val = val.replace(/['"]/g, '');
return lc(val);
}
if (key === 'formatblock') {
val = _nativeCommandValue(doc, key);
if (val === '') {
knode = self.commonNode({'h1,h2,h3,h4,h5,h6,p,div,pre,address' : '*'});
if (knode) {
val = knode.name;
}
}
if (val === 'Normal') {
val = 'p';
}
return lc(val);
}
if (key === 'fontsize') {
knode = self.commonNode({'*' : '.font-size'});
if (knode) {
val = knode.css('font-size');
}
return lc(val);
}
if (key === 'forecolor') {
knode = self.commonNode({'*' : '.color'});
if (knode) {
val = knode.css('color');
}
val = _toHex(val);
if (val === '') {
val = 'default';
}
return lc(val);
}
if (key === 'hilitecolor') {
knode = self.commonNode({'*' : '.background-color'});
if (knode) {
val = knode.css('background-color');
}
val = _toHex(val);
if (val === '') {
val = 'default';
}
return lc(val);
}
return val;
},
toggle : function(wrapper, map) {
var self = this;
if (self.commonNode(map)) {
self.remove(map);
} else {
self.wrap(wrapper);
}
return self.select();
},
bold : function() {
return this.toggle('<strong></strong>', {
span : '.font-weight=bold',
strong : '*',
b : '*'
});
},
italic : function() {
return this.toggle('<em></em>', {
span : '.font-style=italic',
em : '*',
i : '*'
});
},
underline : function() {
return this.toggle('<u></u>', {
span : '.text-decoration=underline',
u : '*'
});
},
strikethrough : function() {
return this.toggle('<s></s>', {
span : '.text-decoration=line-through',
s : '*'
});
},
forecolor : function(val) {
return this.toggle('<span style="color:' + val + ';"></span>', {
span : '.color=' + val,
font : 'color'
});
},
hilitecolor : function(val) {
return this.toggle('<span style="background-color:' + val + ';"></span>', {
span : '.background-color=' + val
});
},
fontsize : function(val) {
return this.toggle('<span style="font-size:' + val + ';"></span>', {
span : '.font-size=' + val,
font : 'size'
});
},
fontname : function(val) {
return this.fontfamily(val);
},
fontfamily : function(val) {
return this.toggle('<span style="font-family:' + val + ';"></span>', {
span : '.font-family=' + val,
font : 'face'
});
},
removeformat : function() {
var map = {
'*' : '.font-weight,.font-style,.text-decoration,.color,.background-color,.font-size,.font-family,.text-indent'
},
tags = _STYLE_TAG_MAP;
_each(tags, function(key, val) {
map[key] = '*';
});
this.remove(map);
return this.select();
},
inserthtml : function(val, quickMode) {
var self = this, range = self.range;
if (val === '') {
return self;
}
if (_inPreElement(K(range.startContainer))) {
return self;
}
function pasteHtml(range, val) {
val = '<img id="__kindeditor_temp_tag__" width="0" height="0" style="display:none;" />' + val;
var rng = range.get();
if (rng.item) {
rng.item(0).outerHTML = val;
} else {
rng.pasteHTML(val);
}
var temp = range.doc.getElementById('__kindeditor_temp_tag__');
temp.parentNode.removeChild(temp);
var newRange = _toRange(rng);
range.setEnd(newRange.endContainer, newRange.endOffset);
range.collapse(false);
self.select(false);
}
function insertHtml(range, val) {
var doc = range.doc,
frag = doc.createDocumentFragment();
K('@' + val, doc).each(function() {
frag.appendChild(this);
});
range.deleteContents();
range.insertNode(frag);
range.collapse(false);
self.select(false);
}
if (_IE && quickMode) {
try {
pasteHtml(range, val);
} catch(e) {
insertHtml(range, val);
}
return self;
}
insertHtml(range, val);
return self;
},
hr : function() {
return this.inserthtml('<hr />');
},
print : function() {
this.win.print();
return this;
},
insertimage : function(url, title, width, height, border, align) {
title = _undef(title, '');
border = _undef(border, 0);
var html = '<img src="' + _escape(url) + '" data-ke-src="' + _escape(url) + '" ';
if (width) {
html += 'width="' + _escape(width) + '" ';
}
if (height) {
html += 'height="' + _escape(height) + '" ';
}
if (title) {
html += 'title="' + _escape(title) + '" ';
}
if (align) {
html += 'align="' + _escape(align) + '" ';
}
html += 'alt="' + _escape(title) + '" ';
html += '/>';
return this.inserthtml(html);
},
createlink : function(url, type) {
var self = this, doc = self.doc, range = self.range;
self.select();
var a = self.commonNode({ a : '*' });
if (a && !range.isControl()) {
range.selectNode(a.get());
self.select();
}
var html = '<a href="' + _escape(url) + '" data-ke-src="' + _escape(url) + '" ';
if (type) {
html += ' target="' + _escape(type) + '"';
}
if (range.collapsed) {
html += '>' + _escape(url) + '</a>';
return self.inserthtml(html);
}
if (range.isControl()) {
var node = K(range.startContainer.childNodes[range.startOffset]);
html += '></a>';
node.after(K(html, doc));
node.next().append(node);
range.selectNode(node[0]);
return self.select();
}
_nativeCommand(doc, 'createlink', '__kindeditor_temp_url__');
K('a[href="__kindeditor_temp_url__"]', doc).each(function() {
K(this).attr('href', url).attr('data-ke-src', url);
if (type) {
K(this).attr('target', type);
} else {
K(this).removeAttr('target');
}
});
return self;
},
unlink : function() {
var self = this, doc = self.doc, range = self.range;
self.select();
if (range.collapsed) {
var a = self.commonNode({ a : '*' });
if (a) {
range.selectNode(a.get());
self.select();
}
_nativeCommand(doc, 'unlink', null);
if (_WEBKIT && K(range.startContainer).name === 'img') {
var parent = K(range.startContainer).parent();
if (parent.name === 'a') {
parent.remove(true);
}
}
} else {
_nativeCommand(doc, 'unlink', null);
}
return self;
}
});
_each(('formatblock,selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,' +
'insertunorderedlist,indent,outdent,subscript,superscript').split(','), function(i, name) {
KCmd.prototype[name] = function(val) {
var self = this;
self.select();
_nativeCommand(self.doc, name, val);
if (!_IE || _inArray(name, 'formatblock,selectall,insertorderedlist,insertunorderedlist'.split(',')) >= 0) {
self.selection();
}
return self;
};
});
_each('cut,copy,paste'.split(','), function(i, name) {
KCmd.prototype[name] = function() {
var self = this;
if (!self.doc.queryCommandSupported(name)) {
throw 'not supported';
}
self.select();
_nativeCommand(self.doc, name, null);
return self;
};
});
function _cmd(mixed) {
if (mixed.nodeName) {
var doc = _getDoc(mixed);
mixed = _range(doc).selectNodeContents(doc.body).collapse(false);
}
return new KCmd(mixed);
}
K.cmd = _cmd;
function _drag(options) {
var moveEl = options.moveEl,
moveFn = options.moveFn,
clickEl = options.clickEl || moveEl,
beforeDrag = options.beforeDrag,
iframeFix = options.iframeFix === undefined ? true : options.iframeFix;
var docs = [document],
poss = [{ x : 0, y : 0}],
listeners = [];
if (iframeFix) {
K('iframe').each(function() {
var doc;
try {
doc = _iframeDoc(this);
K(doc);
} catch(e) {
doc = null;
}
if (doc) {
docs.push(doc);
poss.push(K(this).pos());
}
});
}
clickEl.mousedown(function(e) {
var self = clickEl.get(),
x = _removeUnit(moveEl.css('left')),
y = _removeUnit(moveEl.css('top')),
width = moveEl.width(),
height = moveEl.height(),
pageX = e.pageX,
pageY = e.pageY,
dragging = true;
if (beforeDrag) {
beforeDrag();
}
_each(docs, function(i, doc) {
function moveListener(e) {
if (dragging) {
var diffX = _round(poss[i].x + e.pageX - pageX),
diffY = _round(poss[i].y + e.pageY - pageY);
moveFn.call(clickEl, x, y, width, height, diffX, diffY);
}
e.stop();
}
function selectListener(e) {
e.stop();
}
function upListener(e) {
dragging = false;
if (self.releaseCapture) {
self.releaseCapture();
}
_each(listeners, function() {
K(this.doc).unbind('mousemove', this.move)
.unbind('mouseup', this.up)
.unbind('selectstart', this.select);
});
e.stop();
}
K(doc).mousemove(moveListener)
.mouseup(upListener)
.bind('selectstart', selectListener);
listeners.push({
doc : doc,
move : moveListener,
up : upListener,
select : selectListener
});
});
if (self.setCapture) {
self.setCapture();
}
});
}
function KWidget(options) {
this.init(options);
}
_extend(KWidget, {
init : function(options) {
var self = this;
self.name = options.name || '';
self.doc = options.doc || document;
self.win = _getWin(self.doc);
self.x = _addUnit(options.x);
self.y = _addUnit(options.y);
self.z = options.z;
self.width = _addUnit(options.width);
self.height = _addUnit(options.height);
self.div = K('<div style="display:block;"></div>');
self.options = options;
self._alignEl = options.alignEl;
if (self.width) {
self.div.css('width', self.width);
}
if (self.height) {
self.div.css('height', self.height);
}
if (self.z) {
self.div.css({
position : 'absolute',
left : self.x,
top : self.y,
'z-index' : self.z
});
}
if (self.z && (self.x === undefined || self.y === undefined)) {
self.autoPos(self.width, self.height);
}
if (options.cls) {
self.div.addClass(options.cls);
}
if (options.shadowMode) {
self.div.addClass('ke-shadow');
}
if (options.css) {
self.div.css(options.css);
}
if (options.src) {
K(options.src).replaceWith(self.div);
} else {
K(self.doc.body).append(self.div);
}
if (options.html) {
self.div.html(options.html);
}
if (options.autoScroll) {
if (_IE && _V < 7 || _QUIRKS) {
var scrollPos = _getScrollPos();
K(self.win).bind('scroll', function(e) {
var pos = _getScrollPos(),
diffX = pos.x - scrollPos.x,
diffY = pos.y - scrollPos.y;
self.pos(_removeUnit(self.x) + diffX, _removeUnit(self.y) + diffY, false);
});
} else {
self.div.css('position', 'fixed');
}
}
},
pos : function(x, y, updateProp) {
var self = this;
updateProp = _undef(updateProp, true);
if (x !== null) {
x = x < 0 ? 0 : _addUnit(x);
self.div.css('left', x);
if (updateProp) {
self.x = x;
}
}
if (y !== null) {
y = y < 0 ? 0 : _addUnit(y);
self.div.css('top', y);
if (updateProp) {
self.y = y;
}
}
return self;
},
autoPos : function(width, height) {
var self = this,
w = _removeUnit(width) || 0,
h = _removeUnit(height) || 0,
scrollPos = _getScrollPos();
if (self._alignEl) {
var knode = K(self._alignEl),
pos = knode.pos(),
diffX = _round(knode[0].clientWidth / 2 - w / 2),
diffY = _round(knode[0].clientHeight / 2 - h / 2);
x = diffX < 0 ? pos.x : pos.x + diffX;
y = diffY < 0 ? pos.y : pos.y + diffY;
} else {
var docEl = _docElement(self.doc);
x = _round(scrollPos.x + (docEl.clientWidth - w) / 2);
y = _round(scrollPos.y + (docEl.clientHeight - h) / 2);
}
if (!(_IE && _V < 7 || _QUIRKS)) {
x -= scrollPos.x;
y -= scrollPos.y;
}
return self.pos(x, y);
},
remove : function() {
var self = this;
if (_IE && _V < 7) {
K(self.win).unbind('scroll');
}
self.div.remove();
_each(self, function(i) {
self[i] = null;
});
return this;
},
show : function() {
this.div.show();
return this;
},
hide : function() {
this.div.hide();
return this;
},
draggable : function(options) {
var self = this;
options = options || {};
options.moveEl = self.div;
options.moveFn = function(x, y, width, height, diffX, diffY) {
if ((x = x + diffX) < 0) {
x = 0;
}
if ((y = y + diffY) < 0) {
y = 0;
}
self.pos(x, y);
};
_drag(options);
return self;
}
});
function _widget(options) {
return new KWidget(options);
}
K.WidgetClass = KWidget;
K.widget = _widget;
function _iframeDoc(iframe) {
iframe = _get(iframe);
return iframe.contentDocument || iframe.contentWindow.document;
}
var html, _direction = '';
if ((html = document.getElementsByTagName('html'))) {
_direction = html[0].dir;
}
function _getInitHtml(themesPath, bodyClass, cssPath, cssData) {
var arr = [
(_direction === '' ? '<html>' : '<html dir="' + _direction + '">'),
'<head><meta charset="utf-8" /><title></title>',
'<style>',
'html {margin:0;padding:0;}',
'body {margin:0;padding:5px;}',
'body, td {font:12px/1.5 "sans serif",tahoma,verdana,helvetica;}',
'body, p, div {word-wrap: break-word;}',
'p {margin:5px 0;}',
'table {border-collapse:collapse;}',
'img {border:0;}',
'noscript {display:none;}',
'table.ke-zeroborder td {border:1px dotted #AAA;}',
'img.ke-flash {',
' border:1px solid #AAA;',
' background-image:url(' + themesPath + 'common/flash.gif);',
' background-position:center center;',
' background-repeat:no-repeat;',
' width:100px;',
' height:100px;',
'}',
'img.ke-rm {',
' border:1px solid #AAA;',
' background-image:url(' + themesPath + 'common/rm.gif);',
' background-position:center center;',
' background-repeat:no-repeat;',
' width:100px;',
' height:100px;',
'}',
'img.ke-media {',
' border:1px solid #AAA;',
' background-image:url(' + themesPath + 'common/media.gif);',
' background-position:center center;',
' background-repeat:no-repeat;',
' width:100px;',
' height:100px;',
'}',
'img.ke-anchor {',
' border:1px dashed #666;',
' width:16px;',
' height:16px;',
'}',
'.ke-script, .ke-noscript {',
' display:none;',
' font-size:0;',
' width:0;',
' height:0;',
'}',
'.ke-pagebreak {',
' border:1px dotted #AAA;',
' font-size:0;',
' height:2px;',
'}',
'</style>'
];
if (!_isArray(cssPath)) {
cssPath = [cssPath];
}
_each(cssPath, function(i, path) {
if (path) {
arr.push('<link href="' + path + '" rel="stylesheet" />');
}
});
if (cssData) {
arr.push('<style>' + cssData + '</style>');
}
arr.push('</head><body ' + (bodyClass ? 'class="' + bodyClass + '"' : '') + '></body></html>');
return arr.join('\n');
}
function _elementVal(knode, val) {
return knode.hasVal() ? knode.val(val) : knode.html(val);
}
function KEdit(options) {
this.init(options);
}
_extend(KEdit, KWidget, {
init : function(options) {
var self = this;
KEdit.parent.init.call(self, options);
self.srcElement = K(options.srcElement);
self.div.addClass('ke-edit');
self.designMode = _undef(options.designMode, true);
self.beforeGetHtml = options.beforeGetHtml;
self.beforeSetHtml = options.beforeSetHtml;
self.afterSetHtml = options.afterSetHtml;
var themesPath = _undef(options.themesPath, ''),
bodyClass = options.bodyClass,
cssPath = options.cssPath,
cssData = options.cssData,
isDocumentDomain = location.host.replace(/:\d+/, '') !== document.domain,
srcScript = ('document.open();' +
(isDocumentDomain ? 'document.domain="' + document.domain + '";' : '') +
'document.close();'),
iframeSrc = _IE ? ' src="javascript:void(function(){' + encodeURIComponent(srcScript) + '}())"' : '';
self.iframe = K('<iframe class="ke-edit-iframe" hidefocus="true" frameborder="0"' + iframeSrc + '></iframe>').css('width', '100%');
self.textarea = K('<textarea class="ke-edit-textarea" hidefocus="true"></textarea>').css('width', '100%');
if (self.width) {
self.setWidth(self.width);
}
if (self.height) {
self.setHeight(self.height);
}
if (self.designMode) {
self.textarea.hide();
} else {
self.iframe.hide();
}
function ready() {
var doc = _iframeDoc(self.iframe);
doc.open();
if (isDocumentDomain) {
doc.domain = document.domain;
}
doc.write(_getInitHtml(themesPath, bodyClass, cssPath, cssData));
doc.close();
self.win = self.iframe[0].contentWindow;
self.doc = doc;
var cmd = _cmd(doc);
self.afterChange(function(e) {
cmd.selection();
});
if (_WEBKIT) {
K(doc).click(function(e) {
if (K(e.target).name === 'img') {
cmd.selection(true);
cmd.range.selectNode(e.target);
cmd.select();
}
});
}
if (_IE) {
K(doc).keydown(function(e) {
if (e.which == 8) {
cmd.selection();
var rng = cmd.range;
if (rng.isControl()) {
rng.collapse(true);
K(rng.startContainer.childNodes[rng.startOffset]).remove();
e.preventDefault();
}
}
});
}
self.cmd = cmd;
self.html(_elementVal(self.srcElement));
if (_IE) {
doc.body.disabled = true;
doc.body.contentEditable = true;
doc.body.removeAttribute('disabled');
} else {
doc.designMode = 'on';
}
if (options.afterCreate) {
options.afterCreate.call(self);
}
}
if (isDocumentDomain) {
self.iframe.bind('load', function(e) {
self.iframe.unbind('load');
if (_IE) {
ready();
} else {
setTimeout(ready, 0);
}
});
}
self.div.append(self.iframe);
self.div.append(self.textarea);
self.srcElement.hide();
!isDocumentDomain && ready();
},
setWidth : function(val) {
this.div.css('width', _addUnit(val));
return this;
},
setHeight : function(val) {
var self = this;
val = _addUnit(val);
self.div.css('height', val);
self.iframe.css('height', val);
if ((_IE && _V < 8) || _QUIRKS) {
val = _addUnit(_removeUnit(val) - 2);
}
self.textarea.css('height', val);
return self;
},
remove : function() {
var self = this, doc = self.doc;
K(doc.body).unbind();
K(doc).unbind();
K(self.win).unbind();
_elementVal(self.srcElement, self.html());
self.srcElement.show();
doc.write('');
self.iframe.unbind();
self.textarea.unbind();
KEdit.parent.remove.call(self);
},
html : function(val, isFull) {
var self = this, doc = self.doc;
if (self.designMode) {
var body = doc.body;
if (val === undefined) {
if (isFull) {
val = '<!doctype html><html>' + body.parentNode.innerHTML + '</html>';
} else {
val = body.innerHTML;
}
if (self.beforeGetHtml) {
val = self.beforeGetHtml(val);
}
if (_GECKO && val == '<br />') {
val = '';
}
return val;
}
if (self.beforeSetHtml) {
val = self.beforeSetHtml(val);
}
K(body).html(val);
if (self.afterSetHtml) {
self.afterSetHtml();
}
return self;
}
if (val === undefined) {
return self.textarea.val();
}
self.textarea.val(val);
return self;
},
design : function(bool) {
var self = this, val;
if (bool === undefined ? !self.designMode : bool) {
if (!self.designMode) {
val = self.html();
self.designMode = true;
self.html(val);
self.textarea.hide();
self.iframe.show();
}
} else {
if (self.designMode) {
val = self.html();
self.designMode = false;
self.html(val);
self.iframe.hide();
self.textarea.show();
}
}
return self.focus();
},
focus : function() {
var self = this;
self.designMode ? self.win.focus() : self.textarea[0].focus();
return self;
},
blur : function() {
var self = this;
if (_IE) {
var input = K('<input type="text" style="float:left;width:0;height:0;padding:0;margin:0;border:0;" value="" />', self.div);
self.div.append(input);
input[0].focus();
input.remove();
} else {
self.designMode ? self.win.blur() : self.textarea[0].blur();
}
return self;
},
afterChange : function(fn) {
var self = this, doc = self.doc, body = doc.body;
K(doc).keyup(function(e) {
if (!e.ctrlKey && !e.altKey && _CHANGE_KEY_MAP[e.which]) {
fn(e);
}
});
K(doc).mouseup(fn).contextmenu(fn);
K(self.win).blur(fn);
function timeoutHandler(e) {
setTimeout(function() {
fn(e);
}, 1);
}
K(body).bind('paste', timeoutHandler);
K(body).bind('cut', timeoutHandler);
return self;
}
});
function _edit(options) {
return new KEdit(options);
}
K.edit = _edit;
K.iframeDoc = _iframeDoc;
function _selectToolbar(name, fn) {
var self = this,
knode = self.get(name);
if (knode) {
if (knode.hasClass('ke-disabled')) {
return;
}
fn(knode);
}
}
function KToolbar(options) {
this.init(options);
}
_extend(KToolbar, KWidget, {
init : function(options) {
var self = this;
KToolbar.parent.init.call(self, options);
self.disableMode = _undef(options.disableMode, false);
self.noDisableItemMap = _toMap(_undef(options.noDisableItems, []));
self._itemMap = {};
self.div.addClass('ke-toolbar').bind('contextmenu,mousedown,mousemove', function(e) {
e.preventDefault();
}).attr('unselectable', 'on');
function find(target) {
var knode = K(target);
if (knode.hasClass('ke-outline')) {
return knode;
}
if (knode.hasClass('ke-toolbar-icon')) {
return knode.parent();
}
}
function hover(e, method) {
var knode = find(e.target);
if (knode) {
if (knode.hasClass('ke-disabled')) {
return;
}
if (knode.hasClass('ke-selected')) {
return;
}
knode[method]('ke-on');
}
}
self.div.mouseover(function(e) {
hover(e, 'addClass');
})
.mouseout(function(e) {
hover(e, 'removeClass');
})
.click(function(e) {
var knode = find(e.target);
if (knode) {
if (knode.hasClass('ke-disabled')) {
return;
}
self.options.click.call(this, e, knode.attr('data-name'));
}
});
},
get : function(name) {
if (this._itemMap[name]) {
return this._itemMap[name];
}
return (this._itemMap[name] = K('span.ke-icon-' + name, this.div).parent());
},
select : function(name) {
_selectToolbar.call(this, name, function(knode) {
knode.addClass('ke-selected');
});
return self;
},
unselect : function(name) {
_selectToolbar.call(this, name, function(knode) {
knode.removeClass('ke-selected').removeClass('ke-on');
});
return self;
},
enable : function(name) {
var self = this,
knode = name.get ? name : self.get(name);
if (knode) {
knode.removeClass('ke-disabled');
knode.opacity(1);
}
return self;
},
disable : function(name) {
var self = this,
knode = name.get ? name : self.get(name);
if (knode) {
knode.removeClass('ke-selected').addClass('ke-disabled');
knode.opacity(0.5);
}
return self;
},
disableAll : function(bool, noDisableItems) {
var self = this, map = self.noDisableItemMap, item;
if (noDisableItems) {
map = _toMap(noDisableItems);
}
if (bool === undefined ? !self.disableMode : bool) {
K('span.ke-outline', self.div).each(function() {
var knode = K(this),
name = knode[0].getAttribute('data-name', 2);
if (!map[name]) {
self.disable(knode);
}
});
self.disableMode = true;
} else {
K('span.ke-outline', self.div).each(function() {
var knode = K(this),
name = knode[0].getAttribute('data-name', 2);
if (!map[name]) {
self.enable(knode);
}
});
self.disableMode = false;
}
return self;
}
});
function _toolbar(options) {
return new KToolbar(options);
}
K.toolbar = _toolbar;
function KMenu(options) {
this.init(options);
}
_extend(KMenu, KWidget, {
init : function(options) {
var self = this;
options.z = options.z || 811213;
KMenu.parent.init.call(self, options);
self.centerLineMode = _undef(options.centerLineMode, true);
self.div.addClass('ke-menu').bind('click,mousedown', function(e){
e.stopPropagation();
}).attr('unselectable', 'on');
},
addItem : function(item) {
var self = this;
if (item.title === '-') {
self.div.append(K('<div class="ke-menu-separator"></div>'));
return;
}
var itemDiv = K('<div class="ke-menu-item" unselectable="on"></div>'),
leftDiv = K('<div class="ke-inline-block ke-menu-item-left"></div>'),
rightDiv = K('<div class="ke-inline-block ke-menu-item-right"></div>'),
height = _addUnit(item.height),
iconClass = _undef(item.iconClass, '');
self.div.append(itemDiv);
if (height) {
itemDiv.css('height', height);
rightDiv.css('line-height', height);
}
var centerDiv;
if (self.centerLineMode) {
centerDiv = K('<div class="ke-inline-block ke-menu-item-center"></div>');
if (height) {
centerDiv.css('height', height);
}
}
itemDiv.mouseover(function(e) {
K(this).addClass('ke-menu-item-on');
if (centerDiv) {
centerDiv.addClass('ke-menu-item-center-on');
}
})
.mouseout(function(e) {
K(this).removeClass('ke-menu-item-on');
if (centerDiv) {
centerDiv.removeClass('ke-menu-item-center-on');
}
})
.click(function(e) {
item.click.call(K(this));
e.stopPropagation();
})
.append(leftDiv);
if (centerDiv) {
itemDiv.append(centerDiv);
}
itemDiv.append(rightDiv);
if (item.checked) {
iconClass = 'ke-icon-checked';
}
if (iconClass !== '') {
leftDiv.html('<span class="ke-inline-block ke-toolbar-icon ke-toolbar-icon-url ' + iconClass + '"></span>');
}
rightDiv.html(item.title);
return self;
},
remove : function() {
var self = this;
if (self.options.beforeRemove) {
self.options.beforeRemove.call(self);
}
K('.ke-menu-item', self.div[0]).unbind();
KMenu.parent.remove.call(self);
return self;
}
});
function _menu(options) {
return new KMenu(options);
}
K.menu = _menu;
function KColorPicker(options) {
this.init(options);
}
_extend(KColorPicker, KWidget, {
init : function(options) {
var self = this;
options.z = options.z || 811213;
KColorPicker.parent.init.call(self, options);
var colors = options.colors || [
['#E53333', '#E56600', '#FF9900', '#64451D', '#DFC5A4', '#FFE500'],
['#009900', '#006600', '#99BB00', '#B8D100', '#60D978', '#00D5FF'],
['#337FE5', '#003399', '#4C33E5', '#9933E5', '#CC33E5', '#EE33EE'],
['#FFFFFF', '#CCCCCC', '#999999', '#666666', '#333333', '#000000']
];
self.selectedColor = (options.selectedColor || '').toLowerCase();
self._cells = [];
self.div.addClass('ke-colorpicker').bind('click,mousedown', function(e){
e.stopPropagation();
}).attr('unselectable', 'on');
var table = self.doc.createElement('table');
self.div.append(table);
table.className = 'ke-colorpicker-table';
table.cellPadding = 0;
table.cellSpacing = 0;
table.border = 0;
var row = table.insertRow(0), cell = row.insertCell(0);
cell.colSpan = colors[0].length;
self._addAttr(cell, '', 'ke-colorpicker-cell-top');
for (var i = 0; i < colors.length; i++) {
row = table.insertRow(i + 1);
for (var j = 0; j < colors[i].length; j++) {
cell = row.insertCell(j);
self._addAttr(cell, colors[i][j], 'ke-colorpicker-cell');
}
}
},
_addAttr : function(cell, color, cls) {
var self = this;
cell = K(cell).addClass(cls);
if (self.selectedColor === color.toLowerCase()) {
cell.addClass('ke-colorpicker-cell-selected');
}
cell.attr('title', color || self.options.noColor);
cell.mouseover(function(e) {
K(this).addClass('ke-colorpicker-cell-on');
});
cell.mouseout(function(e) {
K(this).removeClass('ke-colorpicker-cell-on');
});
cell.click(function(e) {
e.stop();
self.options.click.call(K(this), color);
});
if (color) {
cell.append(K('<div class="ke-colorpicker-cell-color" unselectable="on"></div>').css('background-color', color));
} else {
cell.html(self.options.noColor);
}
K(cell).attr('unselectable', 'on');
self._cells.push(cell);
},
remove : function() {
var self = this;
_each(self._cells, function() {
this.unbind();
});
KColorPicker.parent.remove.call(self);
return self;
}
});
function _colorpicker(options) {
return new KColorPicker(options);
}
K.colorpicker = _colorpicker;
function KUploadButton(options) {
this.init(options);
}
_extend(KUploadButton, {
init : function(options) {
var self = this,
button = K(options.button),
fieldName = options.fieldName || 'file',
url = options.url || '',
title = button.val(),
extraParams = options.extraParams || {},
cls = button[0].className || '',
target = options.target || 'kindeditor_upload_iframe_' + new Date().getTime();
options.afterError = options.afterError || function(str) {
alert(str);
};
var hiddenElements = [];
for(var k in extraParams){
hiddenElements.push('<input type="hidden" name="' + k + '" value="' + extraParams[k] + '" />');
}
var html = [
'<div class="ke-inline-block ' + cls + '">',
(options.target ? '' : '<iframe name="' + target + '" style="display:none;"></iframe>'),
(options.form ? '<div class="ke-upload-area">' : '<form class="ke-upload-area ke-form" method="post" enctype="multipart/form-data" target="' + target + '" action="' + url + '">'),
'<span class="ke-button-common">',
hiddenElements.join(''),
'<input type="button" class="ke-button-common ke-button" value="' + title + '" />',
'</span>',
'<input type="file" class="ke-upload-file" name="' + fieldName + '" tabindex="-1" />',
(options.form ? '</div>' : '</form>'),
'</div>'].join('');
var div = K(html, button.doc);
button.hide();
button.before(div);
self.div = div;
self.button = button;
self.iframe = options.target ? K('iframe[name="' + target + '"]') : K('iframe', div);
self.form = options.form ? K(options.form) : K('form', div);
var width = options.width || K('.ke-button-common', div).width();
self.fileBox = K('.ke-upload-file', div).width(width);
self.options = options;
},
submit : function() {
var self = this,
iframe = self.iframe;
iframe.bind('load', function() {
iframe.unbind();
var tempForm = document.createElement('form');
self.fileBox.before(tempForm);
K(tempForm).append(self.fileBox);
tempForm.reset();
K(tempForm).remove(true);
var doc = K.iframeDoc(iframe),
pre = doc.getElementsByTagName('pre')[0],
str = '', data;
if (pre) {
str = pre.innerHTML;
} else {
str = doc.body.innerHTML;
}
iframe[0].src = 'javascript:false';
try {
data = K.json(str);
} catch (e) {
self.options.afterError.call(self, '<!doctype html><html>' + doc.body.parentNode.innerHTML + '</html>');
}
if (data) {
self.options.afterUpload.call(self, data);
}
});
self.form[0].submit();
return self;
},
remove : function() {
var self = this;
if (self.fileBox) {
self.fileBox.unbind();
}
self.iframe.remove();
self.div.remove();
self.button.show();
return self;
}
});
function _uploadbutton(options) {
return new KUploadButton(options);
}
K.uploadbutton = _uploadbutton;
function _createButton(arg) {
arg = arg || {};
var name = arg.name || '',
span = K('<span class="ke-button-common ke-button-outer" title="' + name + '"></span>'),
btn = K('<input class="ke-button-common ke-button" type="button" value="' + name + '" />');
if (arg.click) {
btn.click(arg.click);
}
span.append(btn);
return span;
}
function KDialog(options) {
this.init(options);
}
_extend(KDialog, KWidget, {
init : function(options) {
var self = this;
var shadowMode = _undef(options.shadowMode, true);
options.z = options.z || 811213;
options.shadowMode = false;
KDialog.parent.init.call(self, options);
var title = options.title,
body = K(options.body, self.doc),
previewBtn = options.previewBtn,
yesBtn = options.yesBtn,
noBtn = options.noBtn,
closeBtn = options.closeBtn,
showMask = _undef(options.showMask, true);
self.div.addClass('ke-dialog').bind('click,mousedown', function(e){
e.stopPropagation();
});
var contentDiv = K('<div class="ke-dialog-content"></div>').appendTo(self.div);
if (_IE && _V < 7) {
self.iframeMask = K('<iframe src="about:blank" class="ke-dialog-shadow"></iframe>').appendTo(self.div);
} else if (shadowMode) {
K('<div class="ke-dialog-shadow"></div>').appendTo(self.div);
}
var headerDiv = K('<div class="ke-dialog-header"></div>');
contentDiv.append(headerDiv);
headerDiv.html(title);
self.closeIcon = K('<span class="ke-dialog-icon-close" title="' + closeBtn.name + '"></span>').click(closeBtn.click);
headerDiv.append(self.closeIcon);
self.draggable({
clickEl : headerDiv,
beforeDrag : options.beforeDrag
});
var bodyDiv = K('<div class="ke-dialog-body"></div>');
contentDiv.append(bodyDiv);
bodyDiv.append(body);
var footerDiv = K('<div class="ke-dialog-footer"></div>');
if (previewBtn || yesBtn || noBtn) {
contentDiv.append(footerDiv);
}
_each([
{ btn : previewBtn, name : 'preview' },
{ btn : yesBtn, name : 'yes' },
{ btn : noBtn, name : 'no' }
], function() {
if (this.btn) {
var button = _createButton(this.btn);
button.addClass('ke-dialog-' + this.name);
footerDiv.append(button);
}
});
if (self.height) {
bodyDiv.height(_removeUnit(self.height) - headerDiv.height() - footerDiv.height());
}
self.div.width(self.div.width());
self.div.height(self.div.height());
self.mask = null;
if (showMask) {
var docEl = _docElement(self.doc),
docWidth = Math.max(docEl.scrollWidth, docEl.clientWidth),
docHeight = Math.max(docEl.scrollHeight, docEl.clientHeight);
self.mask = _widget({
x : 0,
y : 0,
z : self.z - 1,
cls : 'ke-dialog-mask',
width : docWidth,
height : docHeight
});
}
self.autoPos(self.div.width(), self.div.height());
self.footerDiv = footerDiv;
self.bodyDiv = bodyDiv;
self.headerDiv = headerDiv;
self.isLoading = false;
},
setMaskIndex : function(z) {
var self = this;
self.mask.div.css('z-index', z);
},
showLoading : function(msg) {
msg = _undef(msg, '');
var self = this, body = self.bodyDiv;
self.loading = K('<div class="ke-dialog-loading"><div class="ke-inline-block ke-dialog-loading-content" style="margin-top:' + Math.round(body.height() / 3) + 'px;">' + msg + '</div></div>')
.width(body.width()).height(body.height())
.css('top', self.headerDiv.height() + 'px');
body.css('visibility', 'hidden').after(self.loading);
self.isLoading = true;
return self;
},
hideLoading : function() {
this.loading && this.loading.remove();
this.bodyDiv.css('visibility', 'visible');
this.isLoading = false;
return this;
},
remove : function() {
var self = this;
if (self.options.beforeRemove) {
self.options.beforeRemove.call(self);
}
self.mask && self.mask.remove();
self.iframeMask && self.iframeMask.remove();
self.closeIcon.unbind();
K('input', self.div).unbind();
K('button', self.div).unbind();
self.footerDiv.unbind();
self.bodyDiv.unbind();
self.headerDiv.unbind();
K('iframe', self.div).each(function() {
K(this).remove();
});
KDialog.parent.remove.call(self);
return self;
}
});
function _dialog(options) {
return new KDialog(options);
}
K.dialog = _dialog;
function _tabs(options) {
var self = _widget(options),
remove = self.remove,
afterSelect = options.afterSelect,
div = self.div,
liList = [];
div.addClass('ke-tabs')
.bind('contextmenu,mousedown,mousemove', function(e) {
e.preventDefault();
});
var ul = K('<ul class="ke-tabs-ul ke-clearfix"></ul>');
div.append(ul);
self.add = function(tab) {
var li = K('<li class="ke-tabs-li">' + tab.title + '</li>');
li.data('tab', tab);
liList.push(li);
ul.append(li);
};
self.selectedIndex = 0;
self.select = function(index) {
self.selectedIndex = index;
_each(liList, function(i, li) {
li.unbind();
if (i === index) {
li.addClass('ke-tabs-li-selected');
K(li.data('tab').panel).show('');
} else {
li.removeClass('ke-tabs-li-selected').removeClass('ke-tabs-li-on')
.mouseover(function() {
K(this).addClass('ke-tabs-li-on');
})
.mouseout(function() {
K(this).removeClass('ke-tabs-li-on');
})
.click(function() {
self.select(i);
});
K(li.data('tab').panel).hide();
}
});
if (afterSelect) {
afterSelect.call(self, index);
}
};
self.remove = function() {
_each(liList, function() {
this.remove();
});
ul.remove();
remove.call(self);
};
return self;
}
K.tabs = _tabs;
function _loadScript(url, fn) {
var head = document.getElementsByTagName('head')[0] || (_QUIRKS ? document.body : document.documentElement),
script = document.createElement('script');
head.appendChild(script);
script.src = url;
script.charset = 'utf-8';
script.onload = script.onreadystatechange = function() {
if (!this.readyState || this.readyState === 'loaded') {
if (fn) {
fn();
}
script.onload = script.onreadystatechange = null;
head.removeChild(script);
}
};
}
function _chopQuery(url) {
var index = url.indexOf('?');
return index > 0 ? url.substr(0, index) : url;
}
function _loadStyle(url) {
var head = document.getElementsByTagName('head')[0] || (_QUIRKS ? document.body : document.documentElement),
link = document.createElement('link'),
absoluteUrl = _chopQuery(_formatUrl(url, 'absolute'));
var links = K('link[rel="stylesheet"]', head);
for (var i = 0, len = links.length; i < len; i++) {
if (_chopQuery(_formatUrl(links[i].href, 'absolute')) === absoluteUrl) {
return;
}
}
head.appendChild(link);
link.href = url;
link.rel = 'stylesheet';
}
function _ajax(url, fn, method, param, dataType) {
method = method || 'GET';
dataType = dataType || 'json';
var xhr = window.XMLHttpRequest ? new window.XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
xhr.open(method, url, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
if (fn) {
var data = _trim(xhr.responseText);
if (dataType == 'json') {
data = _json(data);
}
fn(data);
}
}
};
if (method == 'POST') {
var params = [];
_each(param, function(key, val) {
params.push(encodeURIComponent(key) + '=' + encodeURIComponent(val));
});
try {
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
} catch (e) {}
xhr.send(params.join('&'));
} else {
xhr.send(null);
}
}
K.loadScript = _loadScript;
K.loadStyle = _loadStyle;
K.ajax = _ajax;
var _plugins = {};
function _plugin(name, fn) {
if (name === undefined) {
return _plugins;
}
if (!fn) {
return _plugins[name];
}
_plugins[name] = fn;
}
var _language = {};
function _parseLangKey(key) {
var match, ns = 'core';
if ((match = /^(\w+)\.(\w+)$/.exec(key))) {
ns = match[1];
key = match[2];
}
return { ns : ns, key : key };
}
function _lang(mixed, langType) {
langType = langType === undefined ? K.options.langType : langType;
if (typeof mixed === 'string') {
if (!_language[langType]) {
return 'no language';
}
var pos = mixed.length - 1;
if (mixed.substr(pos) === '.') {
return _language[langType][mixed.substr(0, pos)];
}
var obj = _parseLangKey(mixed);
return _language[langType][obj.ns][obj.key];
}
_each(mixed, function(key, val) {
var obj = _parseLangKey(key);
if (!_language[langType]) {
_language[langType] = {};
}
if (!_language[langType][obj.ns]) {
_language[langType][obj.ns] = {};
}
_language[langType][obj.ns][obj.key] = val;
});
}
function _getImageFromRange(range, fn) {
if (range.collapsed) {
return;
}
range = range.cloneRange().up();
var sc = range.startContainer, so = range.startOffset;
if (!_WEBKIT && !range.isControl()) {
return;
}
var img = K(sc.childNodes[so]);
if (!img || img.name != 'img') {
return;
}
if (fn(img)) {
return img;
}
}
function _bindContextmenuEvent() {
var self = this, doc = self.edit.doc;
K(doc).contextmenu(function(e) {
if (self.menu) {
self.hideMenu();
}
if (!self.useContextmenu) {
e.preventDefault();
return;
}
if (self._contextmenus.length === 0) {
return;
}
var maxWidth = 0, items = [];
_each(self._contextmenus, function() {
if (this.title == '-') {
items.push(this);
return;
}
if (this.cond && this.cond()) {
items.push(this);
if (this.width && this.width > maxWidth) {
maxWidth = this.width;
}
}
});
while (items.length > 0 && items[0].title == '-') {
items.shift();
}
while (items.length > 0 && items[items.length - 1].title == '-') {
items.pop();
}
var prevItem = null;
_each(items, function(i) {
if (this.title == '-' && prevItem.title == '-') {
delete items[i];
}
prevItem = this;
});
if (items.length > 0) {
e.preventDefault();
var pos = K(self.edit.iframe).pos(),
menu = _menu({
x : pos.x + e.clientX,
y : pos.y + e.clientY,
width : maxWidth,
css : { visibility: 'hidden' },
shadowMode : self.shadowMode
});
_each(items, function() {
if (this.title) {
menu.addItem(this);
}
});
var docEl = _docElement(menu.doc),
menuHeight = menu.div.height();
if (e.clientY + menuHeight >= docEl.clientHeight - 100) {
menu.pos(menu.x, _removeUnit(menu.y) - menuHeight);
}
menu.div.css('visibility', 'visible');
self.menu = menu;
}
});
}
function _bindNewlineEvent() {
var self = this, doc = self.edit.doc, newlineTag = self.newlineTag;
if (_IE && newlineTag !== 'br') {
return;
}
if (_GECKO && _V < 3 && newlineTag !== 'p') {
return;
}
if (_OPERA && _V < 9) {
return;
}
var brSkipTagMap = _toMap('h1,h2,h3,h4,h5,h6,pre,li'),
pSkipTagMap = _toMap('p,h1,h2,h3,h4,h5,h6,pre,li,blockquote');
function getAncestorTagName(range) {
var ancestor = K(range.commonAncestor());
while (ancestor) {
if (ancestor.type == 1 && !ancestor.isStyle()) {
break;
}
ancestor = ancestor.parent();
}
return ancestor.name;
}
K(doc).keydown(function(e) {
if (e.which != 13 || e.shiftKey || e.ctrlKey || e.altKey) {
return;
}
self.cmd.selection();
var tagName = getAncestorTagName(self.cmd.range);
if (tagName == 'marquee' || tagName == 'select') {
return;
}
if (newlineTag === 'br' && !brSkipTagMap[tagName]) {
e.preventDefault();
self.insertHtml('<br />' + (_IE && _V < 9 ? '' : '\u200B'));
return;
}
if (!pSkipTagMap[tagName]) {
_nativeCommand(doc, 'formatblock', '<p>');
}
});
K(doc).keyup(function(e) {
if (e.which != 13 || e.shiftKey || e.ctrlKey || e.altKey) {
return;
}
if (newlineTag == 'br') {
return;
}
self.cmd.selection();
var tagName = getAncestorTagName(self.cmd.range);
if (tagName == 'marquee' || tagName == 'select') {
return;
}
if (!pSkipTagMap[tagName]) {
_nativeCommand(doc, 'formatblock', '<p>');
}
var div = self.cmd.commonAncestor('div');
if (div) {
var p = K('<p></p>'),
child = div[0].firstChild;
while (child) {
var next = child.nextSibling;
p.append(child);
child = next;
}
div.before(p);
div.remove();
self.cmd.range.selectNodeContents(p[0]);
self.cmd.select();
}
});
}
function _bindTabEvent() {
var self = this, doc = self.edit.doc;
K(doc).keydown(function(e) {
if (e.which == 9) {
e.preventDefault();
if (self.afterTab) {
self.afterTab.call(self, e);
return;
}
var cmd = self.cmd, range = cmd.range;
range.shrink();
if (range.collapsed && range.startContainer.nodeType == 1) {
range.insertNode(K('@ ', doc)[0]);
cmd.select();
}
self.insertHtml(' ');
}
});
}
function _bindFocusEvent() {
var self = this;
K(self.edit.textarea[0], self.edit.win).focus(function(e) {
if (self.afterFocus) {
self.afterFocus.call(self, e);
}
}).blur(function(e) {
if (self.afterBlur) {
self.afterBlur.call(self, e);
}
});
}
function _removeBookmarkTag(html) {
return _trim(html.replace(/<span [^>]*id="?__kindeditor_bookmark_\w+_\d+__"?[^>]*><\/span>/ig, ''));
}
function _removeTempTag(html) {
return html.replace(/<div[^>]+class="?__kindeditor_paste__"?[^>]*>[\s\S]*?<\/div>/ig, '');
}
function _addBookmarkToStack(stack, bookmark) {
if (stack.length === 0) {
stack.push(bookmark);
return;
}
var prev = stack[stack.length - 1];
if (_removeBookmarkTag(bookmark.html) !== _removeBookmarkTag(prev.html)) {
stack.push(bookmark);
}
}
function _undoToRedo(fromStack, toStack) {
var self = this, edit = self.edit,
body = edit.doc.body,
range, bookmark;
if (fromStack.length === 0) {
return self;
}
if (edit.designMode) {
range = self.cmd.range;
bookmark = range.createBookmark(true);
bookmark.html = body.innerHTML;
} else {
bookmark = {
html : body.innerHTML
};
}
_addBookmarkToStack(toStack, bookmark);
var prev = fromStack.pop();
if (_removeBookmarkTag(bookmark.html) === _removeBookmarkTag(prev.html) && fromStack.length > 0) {
prev = fromStack.pop();
}
if (edit.designMode) {
edit.html(prev.html);
if (prev.start) {
range.moveToBookmark(prev);
self.select();
}
} else {
K(body).html(_removeBookmarkTag(prev.html));
}
return self;
}
function KEditor(options) {
var self = this;
self.options = {};
function setOption(key, val) {
if (KEditor.prototype[key] === undefined) {
self[key] = val;
}
self.options[key] = val;
}
_each(options, function(key, val) {
setOption(key, options[key]);
});
_each(K.options, function(key, val) {
if (self[key] === undefined) {
setOption(key, val);
}
});
var se = K(self.srcElement || '<textarea/>');
if (!self.width) {
self.width = se[0].style.width || se.width();
}
if (!self.height) {
self.height = se[0].style.height || se.height();
}
setOption('width', _undef(self.width, self.minWidth));
setOption('height', _undef(self.height, self.minHeight));
setOption('width', _addUnit(self.width));
setOption('height', _addUnit(self.height));
if (_MOBILE && (!_IOS || _V < 534)) {
self.designMode = false;
}
self.srcElement = se;
self.initContent = '';
self.plugin = {};
self.isCreated = false;
self.isLoading = false;
self._handlers = {};
self._contextmenus = [];
self._undoStack = [];
self._redoStack = [];
self._calledPlugins = {};
self._firstAddBookmark = true;
self.menu = self.contextmenu = null;
self.dialogs = [];
}
KEditor.prototype = {
lang : function(mixed) {
return _lang(mixed, this.langType);
},
loadPlugin : function(name, fn) {
var self = this;
if (_plugins[name]) {
if (self._calledPlugins[name]) {
if (fn) {
fn.call(self);
}
return self;
}
_plugins[name].call(self, KindEditor);
if (fn) {
fn.call(self);
}
self._calledPlugins[name] = true;
return self;
}
if (self.isLoading) {
return self;
}
self.isLoading = true;
_loadScript(self.pluginsPath + name + '/' + name + '.js?ver=' + encodeURIComponent(K.DEBUG ? _TIME : _VERSION), function() {
self.isLoading = false;
if (_plugins[name]) {
self.loadPlugin(name, fn);
}
});
return self;
},
handler : function(key, fn) {
var self = this;
if (!self._handlers[key]) {
self._handlers[key] = [];
}
if (_isFunction(fn)) {
self._handlers[key].push(fn);
return self;
}
_each(self._handlers[key], function() {
fn = this.call(self, fn);
});
return fn;
},
clickToolbar : function(name, fn) {
var self = this, key = 'clickToolbar' + name;
if (fn === undefined) {
if (self._handlers[key]) {
return self.handler(key);
}
self.loadPlugin(name, function() {
self.handler(key);
});
return self;
}
return self.handler(key, fn);
},
updateState : function() {
var self = this;
_each(('justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,' +
'subscript,superscript,bold,italic,underline,strikethrough').split(','), function(i, name) {
self.cmd.state(name) ? self.toolbar.select(name) : self.toolbar.unselect(name);
});
return self;
},
addContextmenu : function(item) {
this._contextmenus.push(item);
return this;
},
afterCreate : function(fn) {
return this.handler('afterCreate', fn);
},
beforeRemove : function(fn) {
return this.handler('beforeRemove', fn);
},
beforeGetHtml : function(fn) {
return this.handler('beforeGetHtml', fn);
},
beforeSetHtml : function(fn) {
return this.handler('beforeSetHtml', fn);
},
afterSetHtml : function(fn) {
return this.handler('afterSetHtml', fn);
},
create : function() {
var self = this, fullscreenMode = self.fullscreenMode;
if (self.isCreated) {
return self;
}
if (fullscreenMode) {
_docElement().style.overflow = 'hidden';
} else {
_docElement().style.overflow = '';
}
var width = fullscreenMode ? _docElement().clientWidth + 'px' : self.width,
height = fullscreenMode ? _docElement().clientHeight + 'px' : self.height;
if ((_IE && _V < 8) || _QUIRKS) {
height = _addUnit(_removeUnit(height) + 2);
}
var container = self.container = K(self.layout);
if (fullscreenMode) {
K(document.body).append(container);
} else {
self.srcElement.before(container);
}
var toolbarDiv = K('.toolbar', container),
editDiv = K('.edit', container),
statusbar = self.statusbar = K('.statusbar', container);
container.removeClass('container')
.addClass('ke-container ke-container-' + self.themeType).css('width', width);
if (fullscreenMode) {
container.css({
position : 'absolute',
left : 0,
top : 0,
'z-index' : 811211
});
if (!_GECKO) {
self._scrollPos = _getScrollPos();
}
window.scrollTo(0, 0);
K(document.body).css({
'height' : '1px',
'overflow' : 'hidden'
});
K(document.body.parentNode).css('overflow', 'hidden');
self._fullscreenExecuted = true;
} else {
if (self._fullscreenExecuted) {
K(document.body).css({
'height' : '',
'overflow' : ''
});
K(document.body.parentNode).css('overflow', '');
}
if (self._scrollPos) {
window.scrollTo(self._scrollPos.x, self._scrollPos.y);
}
}
var htmlList = [];
K.each(self.items, function(i, name) {
if (name == '|') {
htmlList.push('<span class="ke-inline-block ke-separator"></span>');
} else if (name == '/') {
htmlList.push('<div class="ke-hr"></div>');
} else {
htmlList.push('<span class="ke-outline" data-name="' + name + '" title="' + self.lang(name) + '" unselectable="on">');
htmlList.push('<span class="ke-toolbar-icon ke-toolbar-icon-url ke-icon-' + name + '" unselectable="on"></span></span>');
}
});
var toolbar = self.toolbar = _toolbar({
src : toolbarDiv,
html : htmlList.join(''),
noDisableItems : self.noDisableItems,
click : function(e, name) {
e.stop();
if (self.menu) {
var menuName = self.menu.name;
self.hideMenu();
if (menuName === name) {
return;
}
}
self.clickToolbar(name);
}
});
var editHeight = _removeUnit(height) - toolbar.div.height();
var edit = self.edit = _edit({
height : editHeight > 0 && _removeUnit(height) > self.minHeight ? editHeight : self.minHeight,
src : editDiv,
srcElement : self.srcElement,
designMode : self.designMode,
themesPath : self.themesPath,
bodyClass : self.bodyClass,
cssPath : self.cssPath,
cssData : self.cssData,
beforeGetHtml : function(html) {
html = self.beforeGetHtml(html);
return _formatHtml(html, self.filterMode ? self.htmlTags : null, self.urlType, self.wellFormatMode, self.indentChar);
},
beforeSetHtml : function(html) {
html = _formatHtml(html, self.filterMode ? self.htmlTags : null, '', false);
return self.beforeSetHtml(html);
},
afterSetHtml : function() {
self.edit = edit = this;
self.afterSetHtml();
},
afterCreate : function() {
self.edit = edit = this;
self.cmd = edit.cmd;
self._docMousedownFn = function(e) {
if (self.menu) {
self.hideMenu();
}
};
K(edit.doc, document).mousedown(self._docMousedownFn);
_bindContextmenuEvent.call(self);
_bindNewlineEvent.call(self);
_bindTabEvent.call(self);
_bindFocusEvent.call(self);
edit.afterChange(function(e) {
if (!edit.designMode) {
return;
}
self.updateState();
self.addBookmark();
if (self.options.afterChange) {
self.options.afterChange.call(self);
}
});
edit.textarea.keyup(function(e) {
if (!e.ctrlKey && !e.altKey && _INPUT_KEY_MAP[e.which]) {
if (self.options.afterChange) {
self.options.afterChange.call(self);
}
}
});
if (self.readonlyMode) {
self.readonly();
}
self.isCreated = true;
if (self.initContent === '') {
self.initContent = self.html();
}
self.afterCreate();
if (self.options.afterCreate) {
self.options.afterCreate.call(self);
}
}
});
statusbar.removeClass('statusbar').addClass('ke-statusbar')
.append('<span class="ke-inline-block ke-statusbar-center-icon"></span>')
.append('<span class="ke-inline-block ke-statusbar-right-icon"></span>');
K(window).unbind('resize');
function initResize() {
if (statusbar.height() === 0) {
setTimeout(initResize, 100);
return;
}
self.resize(width, height);
}
initResize();
function newResize(width, height, updateProp) {
updateProp = _undef(updateProp, true);
if (width && width >= self.minWidth) {
self.resize(width, null);
if (updateProp) {
self.width = _addUnit(width);
}
}
if (height && height >= self.minHeight) {
self.resize(null, height);
if (updateProp) {
self.height = _addUnit(height);
}
}
}
if (fullscreenMode) {
K(window).bind('resize', function(e) {
if (self.isCreated) {
newResize(_docElement().clientWidth, _docElement().clientHeight, false);
}
});
toolbar.select('fullscreen');
statusbar.first().css('visibility', 'hidden');
statusbar.last().css('visibility', 'hidden');
} else {
if (_GECKO) {
K(window).bind('scroll', function(e) {
self._scrollPos = _getScrollPos();
});
}
if (self.resizeType > 0) {
_drag({
moveEl : container,
clickEl : statusbar,
moveFn : function(x, y, width, height, diffX, diffY) {
height += diffY;
newResize(null, height);
}
});
} else {
statusbar.first().css('visibility', 'hidden');
}
if (self.resizeType === 2) {
_drag({
moveEl : container,
clickEl : statusbar.last(),
moveFn : function(x, y, width, height, diffX, diffY) {
width += diffX;
height += diffY;
newResize(width, height);
}
});
} else {
statusbar.last().css('visibility', 'hidden');
}
}
return self;
},
remove : function() {
var self = this;
if (!self.isCreated) {
return self;
}
self.beforeRemove();
if (self.menu) {
self.hideMenu();
}
_each(self.dialogs, function() {
self.hideDialog();
});
K(document).unbind('mousedown', self._docMousedownFn);
self.toolbar.remove();
self.edit.remove();
self.statusbar.last().unbind();
self.statusbar.unbind();
self.container.remove();
self.container = self.toolbar = self.edit = self.menu = null;
self.dialogs = [];
self.isCreated = false;
return self;
},
resize : function(width, height) {
var self = this;
if (width !== null) {
if (_removeUnit(width) > self.minWidth) {
self.container.css('width', _addUnit(width));
}
}
if (height !== null) {
height = _removeUnit(height) - self.toolbar.div.height() - self.statusbar.height();
if (height > 0 && _removeUnit(height) > self.minHeight) {
self.edit.setHeight(height);
}
}
return self;
},
select : function() {
this.isCreated && this.cmd.select();
return this;
},
html : function(val) {
var self = this;
if (val === undefined) {
return self.isCreated ? self.edit.html() : _elementVal(self.srcElement);
}
self.isCreated ? self.edit.html(val) : _elementVal(self.srcElement, val);
return self;
},
fullHtml : function() {
return this.isCreated ? this.edit.html(undefined, true) : '';
},
text : function(val) {
var self = this;
if (val === undefined) {
return _trim(self.html().replace(/<(?!img|embed).*?>/ig, '').replace(/ /ig, ' '));
} else {
return self.html(_escape(val));
}
},
isEmpty : function() {
return _trim(this.text().replace(/\r\n|\n|\r/, '')) === '';
},
isDirty : function() {
return _trim(this.initContent.replace(/\r\n|\n|\r|t/g, '')) !== _trim(this.html().replace(/\r\n|\n|\r|t/g, ''));
},
selectedHtml : function() {
return this.isCreated ? this.cmd.range.html() : '';
},
count : function(mode) {
var self = this;
mode = (mode || 'html').toLowerCase();
if (mode === 'html') {
return _removeBookmarkTag(_removeTempTag(self.html())).length;
}
if (mode === 'text') {
return self.text().replace(/<(?:img|embed).*?>/ig, 'K').replace(/\r\n|\n|\r/g, '').length;
}
return 0;
},
exec : function(key) {
key = key.toLowerCase();
var self = this, cmd = self.cmd,
changeFlag = _inArray(key, 'selectall,copy,paste,print'.split(',')) < 0;
if (changeFlag) {
self.addBookmark(false);
}
cmd[key].apply(cmd, _toArray(arguments, 1));
if (changeFlag) {
self.updateState();
self.addBookmark(false);
if (self.options.afterChange) {
self.options.afterChange.call(self);
}
}
return self;
},
insertHtml : function(val) {
if (!this.isCreated) {
return this;
}
val = this.beforeSetHtml(val);
this.exec('inserthtml', val);
return this;
},
appendHtml : function(val) {
this.html(this.html() + val);
if (this.isCreated) {
var cmd = this.cmd;
cmd.range.selectNodeContents(cmd.doc.body).collapse(false);
cmd.select();
}
return this;
},
sync : function() {
_elementVal(this.srcElement, this.html());
return this;
},
focus : function() {
this.isCreated ? this.edit.focus() : this.srcElement[0].focus();
return this;
},
blur : function() {
this.isCreated ? this.edit.blur() : this.srcElement[0].blur();
return this;
},
addBookmark : function(checkSize) {
checkSize = _undef(checkSize, true);
var self = this, edit = self.edit,
body = edit.doc.body,
html = _removeTempTag(body.innerHTML), bookmark;
if (checkSize && self._undoStack.length > 0) {
var prev = self._undoStack[self._undoStack.length - 1];
if (Math.abs(html.length - _removeBookmarkTag(prev.html).length) < self.minChangeSize) {
return self;
}
}
if (edit.designMode && !self._firstAddBookmark) {
var range = self.cmd.range;
bookmark = range.createBookmark(true);
bookmark.html = _removeTempTag(body.innerHTML);
range.moveToBookmark(bookmark);
} else {
bookmark = {
html : html
};
}
self._firstAddBookmark = false;
_addBookmarkToStack(self._undoStack, bookmark);
return self;
},
undo : function() {
return _undoToRedo.call(this, this._undoStack, this._redoStack);
},
redo : function() {
return _undoToRedo.call(this, this._redoStack, this._undoStack);
},
fullscreen : function(bool) {
this.fullscreenMode = (bool === undefined ? !this.fullscreenMode : bool);
return this.remove().create();
},
readonly : function(isReadonly) {
isReadonly = _undef(isReadonly, true);
var self = this, edit = self.edit, doc = edit.doc;
if (self.designMode) {
self.toolbar.disableAll(isReadonly, []);
} else {
_each(self.noDisableItems, function() {
self.toolbar[isReadonly ? 'disable' : 'enable'](this);
});
}
if (_IE) {
doc.body.contentEditable = !isReadonly;
} else {
doc.designMode = isReadonly ? 'off' : 'on';
}
edit.textarea[0].disabled = isReadonly;
},
createMenu : function(options) {
var self = this,
name = options.name,
knode = self.toolbar.get(name),
pos = knode.pos();
options.x = pos.x;
options.y = pos.y + knode.height();
options.shadowMode = _undef(options.shadowMode, self.shadowMode);
if (options.selectedColor !== undefined) {
options.cls = 'ke-colorpicker-' + self.themeType;
options.noColor = self.lang('noColor');
self.menu = _colorpicker(options);
} else {
options.cls = 'ke-menu-' + self.themeType;
options.centerLineMode = false;
self.menu = _menu(options);
}
return self.menu;
},
hideMenu : function() {
this.menu.remove();
this.menu = null;
return this;
},
hideContextmenu : function() {
this.contextmenu.remove();
this.contextmenu = null;
return this;
},
createDialog : function(options) {
var self = this, name = options.name;
options.autoScroll = _undef(options.autoScroll, true);
options.shadowMode = _undef(options.shadowMode, self.shadowMode);
options.closeBtn = _undef(options.closeBtn, {
name : self.lang('close'),
click : function(e) {
self.hideDialog();
if (_IE && self.cmd) {
self.cmd.select();
}
}
});
options.noBtn = _undef(options.noBtn, {
name : self.lang(options.yesBtn ? 'no' : 'close'),
click : function(e) {
self.hideDialog();
if (_IE && self.cmd) {
self.cmd.select();
}
}
});
if (self.dialogAlignType != 'page') {
options.alignEl = self.container;
}
options.cls = 'ke-dialog-' + self.themeType;
if (self.dialogs.length > 0) {
var firstDialog = self.dialogs[0],
parentDialog = self.dialogs[self.dialogs.length - 1];
firstDialog.setMaskIndex(parentDialog.z + 2);
options.z = parentDialog.z + 3;
options.showMask = false;
}
var dialog = _dialog(options);
self.dialogs.push(dialog);
return dialog;
},
hideDialog : function() {
var self = this;
if (self.dialogs.length > 0) {
self.dialogs.pop().remove();
}
if (self.dialogs.length > 0) {
var firstDialog = self.dialogs[0],
parentDialog = self.dialogs[self.dialogs.length - 1];
firstDialog.setMaskIndex(parentDialog.z - 1);
}
return self;
},
errorDialog : function(html) {
var self = this;
var dialog = self.createDialog({
width : 750,
title : self.lang('uploadError'),
body : '<div style="padding:10px 20px;"><iframe frameborder="0" style="width:708px;height:400px;"></iframe></div>'
});
var iframe = K('iframe', dialog.div), doc = K.iframeDoc(iframe);
doc.open();
doc.write(html);
doc.close();
K(doc.body).css('background-color', '#FFF');
iframe[0].contentWindow.focus();
return self;
}
};
function _editor(options) {
return new KEditor(options);
}
_instances = [];
function _create(expr, options) {
options = options || {};
options.basePath = _undef(options.basePath, K.basePath);
options.themesPath = _undef(options.themesPath, options.basePath + 'themes/');
options.langPath = _undef(options.langPath, options.basePath + 'lang/');
options.pluginsPath = _undef(options.pluginsPath, options.basePath + 'plugins/');
if (_undef(options.loadStyleMode, K.options.loadStyleMode)) {
var themeType = _undef(options.themeType, K.options.themeType);
_loadStyle(options.themesPath + 'default/default.css');
_loadStyle(options.themesPath + themeType + '/' + themeType + '.css');
}
function create(editor) {
_each(_plugins, function(name, fn) {
fn.call(editor, KindEditor);
});
return editor.create();
}
var knode = K(expr);
if (!knode) {
return;
}
if (knode.length > 1) {
knode.each(function() {
_create(this, options);
});
return _instances[0];
}
options.srcElement = knode[0];
var editor = new KEditor(options);
_instances.push(editor);
if (_language[editor.langType]) {
return create(editor);
}
_loadScript(editor.langPath + editor.langType + '.js?ver=' + encodeURIComponent(K.DEBUG ? _TIME : _VERSION), function() {
create(editor);
});
return editor;
}
if (_IE && _V < 7) {
_nativeCommand(document, 'BackgroundImageCache', true);
}
K.EditorClass = KEditor;
K.editor = _editor;
K.create = _create;
K.instances = _instances;
K.plugin = _plugin;
K.lang = _lang;
_plugin('core', function(K) {
var self = this,
shortcutKeys = {
undo : 'Z', redo : 'Y', bold : 'B', italic : 'I', underline : 'U', print : 'P', selectall : 'A'
};
self.afterSetHtml(function() {
if (self.options.afterChange) {
self.options.afterChange.call(self);
}
});
self.afterCreate(function() {
if (self.syncType != 'form') {
return;
}
var el = K(self.srcElement), hasForm = false;
while ((el = el.parent())) {
if (el.name == 'form') {
hasForm = true;
break;
}
}
if (hasForm) {
el.bind('submit', function(e) {
self.sync();
K(window).bind('unload', function() {
self.edit.textarea.remove();
});
});
var resetBtn = K('[type="reset"]', el);
resetBtn.click(function() {
self.html(self.initContent);
self.cmd.selection();
});
self.beforeRemove(function() {
el.unbind();
resetBtn.unbind();
});
}
});
self.clickToolbar('source', function() {
if (self.edit.designMode) {
self.toolbar.disableAll(true);
self.edit.design(false);
self.toolbar.select('source');
} else {
self.toolbar.disableAll(false);
self.edit.design(true);
self.toolbar.unselect('source');
}
self.designMode = self.edit.designMode;
});
self.afterCreate(function() {
if (!self.designMode) {
self.toolbar.disableAll(true).select('source');
}
});
self.clickToolbar('fullscreen', function() {
self.fullscreen();
});
if (self.fullscreenShortcut) {
var loaded = false;
self.afterCreate(function() {
K(self.edit.doc, self.edit.textarea).keyup(function(e) {
if (e.which == 27) {
setTimeout(function() {
self.fullscreen();
}, 0);
}
});
if (loaded) {
if (_IE && !self.designMode) {
return;
}
self.focus();
}
if (!loaded) {
loaded = true;
}
});
}
_each('undo,redo'.split(','), function(i, name) {
if (shortcutKeys[name]) {
self.afterCreate(function() {
_ctrl(this.edit.doc, shortcutKeys[name], function() {
self.clickToolbar(name);
});
});
}
self.clickToolbar(name, function() {
self[name]();
});
});
self.clickToolbar('formatblock', function() {
var blocks = self.lang('formatblock.formatBlock'),
heights = {
h1 : 28,
h2 : 24,
h3 : 18,
H4 : 14,
p : 12
},
curVal = self.cmd.val('formatblock'),
menu = self.createMenu({
name : 'formatblock',
width : self.langType == 'en' ? 200 : 150
});
_each(blocks, function(key, val) {
var style = 'font-size:' + heights[key] + 'px;';
if (key.charAt(0) === 'h') {
style += 'font-weight:bold;';
}
menu.addItem({
title : '<span style="' + style + '" unselectable="on">' + val + '</span>',
height : heights[key] + 12,
checked : (curVal === key || curVal === val),
click : function() {
self.select().exec('formatblock', '<' + key + '>').hideMenu();
}
});
});
});
self.clickToolbar('fontname', function() {
var curVal = self.cmd.val('fontname'),
menu = self.createMenu({
name : 'fontname',
width : 150
});
_each(self.lang('fontname.fontName'), function(key, val) {
menu.addItem({
title : '<span style="font-family: ' + key + ';" unselectable="on">' + val + '</span>',
checked : (curVal === key.toLowerCase() || curVal === val.toLowerCase()),
click : function() {
self.exec('fontname', key).hideMenu();
}
});
});
});
self.clickToolbar('fontsize', function() {
var curVal = self.cmd.val('fontsize'),
menu = self.createMenu({
name : 'fontsize',
width : 150
});
_each(self.fontSizeTable, function(i, val) {
menu.addItem({
title : '<span style="font-size:' + val + ';" unselectable="on">' + val + '</span>',
height : _removeUnit(val) + 12,
checked : curVal === val,
click : function() {
self.exec('fontsize', val).hideMenu();
}
});
});
});
_each('forecolor,hilitecolor'.split(','), function(i, name) {
self.clickToolbar(name, function() {
self.createMenu({
name : name,
selectedColor : self.cmd.val(name) || 'default',
colors : self.colorTable,
click : function(color) {
self.exec(name, color).hideMenu();
}
});
});
});
_each(('cut,copy,paste').split(','), function(i, name) {
self.clickToolbar(name, function() {
self.focus();
try {
self.exec(name, null);
} catch(e) {
alert(self.lang(name + 'Error'));
}
});
});
self.clickToolbar('about', function() {
var html = '<div style="margin:20px;">' +
'<div>KindEditor ' + _VERSION + '</div>' +
'<div>Copyright © <a href="http://www.kindsoft.net/" target="_blank">kindsoft.net</a> All rights reserved.</div>' +
'</div>';
self.createDialog({
name : 'about',
width : 300,
title : self.lang('about'),
body : html
});
});
self.plugin.getSelectedLink = function() {
return self.cmd.commonAncestor('a');
};
self.plugin.getSelectedImage = function() {
return _getImageFromRange(self.edit.cmd.range, function(img) {
return !/^ke-\w+$/i.test(img[0].className);
});
};
self.plugin.getSelectedFlash = function() {
return _getImageFromRange(self.edit.cmd.range, function(img) {
return img[0].className == 'ke-flash';
});
};
self.plugin.getSelectedMedia = function() {
return _getImageFromRange(self.edit.cmd.range, function(img) {
return img[0].className == 'ke-media' || img[0].className == 'ke-rm';
});
};
self.plugin.getSelectedAnchor = function() {
return _getImageFromRange(self.edit.cmd.range, function(img) {
return img[0].className == 'ke-anchor';
});
};
_each('link,image,flash,media,anchor'.split(','), function(i, name) {
var uName = name.charAt(0).toUpperCase() + name.substr(1);
_each('edit,delete'.split(','), function(j, val) {
self.addContextmenu({
title : self.lang(val + uName),
click : function() {
self.loadPlugin(name, function() {
self.plugin[name][val]();
self.hideMenu();
});
},
cond : self.plugin['getSelected' + uName],
width : 150,
iconClass : val == 'edit' ? 'ke-icon-' + name : undefined
});
});
self.addContextmenu({ title : '-' });
});
self.plugin.getSelectedTable = function() {
return self.cmd.commonAncestor('table');
};
self.plugin.getSelectedRow = function() {
return self.cmd.commonAncestor('tr');
};
self.plugin.getSelectedCell = function() {
return self.cmd.commonAncestor('td');
};
_each(('prop,cellprop,colinsertleft,colinsertright,rowinsertabove,rowinsertbelow,rowmerge,colmerge,' +
'rowsplit,colsplit,coldelete,rowdelete,insert,delete').split(','), function(i, val) {
var cond = _inArray(val, ['prop', 'delete']) < 0 ? self.plugin.getSelectedCell : self.plugin.getSelectedTable;
self.addContextmenu({
title : self.lang('table' + val),
click : function() {
self.loadPlugin('table', function() {
self.plugin.table[val]();
self.hideMenu();
});
},
cond : cond,
width : 170,
iconClass : 'ke-icon-table' + val
});
});
self.addContextmenu({ title : '-' });
_each(('selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,' +
'insertunorderedlist,indent,outdent,subscript,superscript,hr,print,' +
'bold,italic,underline,strikethrough,removeformat,unlink').split(','), function(i, name) {
if (shortcutKeys[name]) {
self.afterCreate(function() {
_ctrl(this.edit.doc, shortcutKeys[name], function() {
self.cmd.selection();
self.clickToolbar(name);
});
});
}
self.clickToolbar(name, function() {
self.focus().exec(name, null);
});
});
self.afterCreate(function() {
var doc = self.edit.doc, cmd, bookmark, div,
cls = '__kindeditor_paste__', pasting = false;
function movePastedData() {
cmd.range.moveToBookmark(bookmark);
cmd.select();
if (_WEBKIT) {
K('div.' + cls, div).each(function() {
K(this).after('<br />').remove(true);
});
K('span.Apple-style-span', div).remove(true);
K('span.Apple-tab-span', div).remove(true);
K('span[style]', div).each(function() {
if (K(this).css('white-space') == 'nowrap') {
K(this).remove(true);
}
});
K('meta', div).remove();
}
var html = div[0].innerHTML;
div.remove();
if (html === '') {
return;
}
if (self.pasteType === 2) {
if (/schemas-microsoft-com|worddocument|mso-\w+/i.test(html)) {
html = _clearMsWord(html, self.filterMode ? self.htmlTags : K.options.htmlTags);
} else {
html = _formatHtml(html, self.filterMode ? self.htmlTags : null);
html = self.beforeSetHtml(html);
}
}
if (self.pasteType === 1) {
html = html.replace(/<br[^>]*>/ig, '\n');
html = html.replace(/<\/p><p[^>]*>/ig, '\n');
html = html.replace(/<[^>]+>/g, '');
html = html.replace(/ /ig, ' ');
html = html.replace(/\n\s*\n/g, '\n');
html = html.replace(/ {2}/g, ' ');
if (self.newlineTag == 'p') {
if (/\n/.test(html)) {
html = html.replace(/^/, '<p>').replace(/$/, '</p>').replace(/\n/g, '</p><p>');
}
} else {
html = html.replace(/\n/g, '<br />$&');
}
}
self.insertHtml(html, true);
}
K(doc.body).bind('paste', function(e){
if (self.pasteType === 0) {
e.stop();
return;
}
if (pasting) {
return;
}
pasting = true;
K('div.' + cls, doc).remove();
cmd = self.cmd.selection();
bookmark = cmd.range.createBookmark();
div = K('<div class="' + cls + '"></div>', doc).css({
position : 'absolute',
width : '1px',
height : '1px',
overflow : 'hidden',
left : '-1981px',
top : K(bookmark.start).pos().y + 'px',
'white-space' : 'nowrap'
});
K(doc.body).append(div);
if (_IE) {
var rng = cmd.range.get(true);
rng.moveToElementText(div[0]);
rng.select();
rng.execCommand('paste');
e.preventDefault();
} else {
cmd.range.selectNodeContents(div[0]);
cmd.select();
}
setTimeout(function() {
movePastedData();
pasting = false;
}, 0);
});
});
self.beforeGetHtml(function(html) {
return html.replace(/(<(?:noscript|noscript\s[^>]*)>)([\s\S]*?)(<\/noscript>)/ig, function($0, $1, $2, $3) {
return $1 + _unescape($2).replace(/\s+/g, ' ') + $3;
})
.replace(/<img[^>]*class="?ke-(flash|rm|media)"?[^>]*>/ig, function(full) {
var imgAttrs = _getAttrList(full),
styles = _getCssList(imgAttrs.style || ''),
attrs = _mediaAttrs(imgAttrs['data-ke-tag']);
attrs.width = _undef(imgAttrs.width, _removeUnit(_undef(styles.width, '')));
attrs.height = _undef(imgAttrs.height, _removeUnit(_undef(styles.height, '')));
return _mediaEmbed(attrs);
})
.replace(/<img[^>]*class="?ke-anchor"?[^>]*>/ig, function(full) {
var imgAttrs = _getAttrList(full);
return '<a name="' + unescape(imgAttrs['data-ke-name']) + '"></a>';
})
.replace(/<div\s+[^>]*data-ke-script-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig, function(full, attr, code) {
return '<script' + unescape(attr) + '>' + unescape(code) + '</script>';
})
.replace(/<div\s+[^>]*data-ke-noscript-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig, function(full, attr, code) {
return '<noscript' + unescape(attr) + '>' + unescape(code) + '</noscript>';
})
.replace(/(<[^>]*)data-ke-src="([^"]*)"([^>]*>)/ig, function(full, start, src, end) {
full = full.replace(/(\s+(?:href|src)=")[^"]*(")/i, '$1' + src + '$2');
full = full.replace(/\s+data-ke-src="[^"]*"/i, '');
return full;
})
.replace(/(<[^>]+\s)data-ke-(on\w+="[^"]*"[^>]*>)/ig, function(full, start, end) {
return start + end;
});
});
self.beforeSetHtml(function(html) {
return html.replace(/<embed[^>]*type="([^"]+)"[^>]*>(?:<\/embed>)?/ig, function(full) {
var attrs = _getAttrList(full);
attrs.src = _undef(attrs.src, '');
attrs.width = _undef(attrs.width, 0);
attrs.height = _undef(attrs.height, 0);
return _mediaImg(self.themesPath + 'common/blank.gif', attrs);
})
.replace(/<a[^>]*name="([^"]+)"[^>]*>(?:<\/a>)?/ig, function(full) {
var attrs = _getAttrList(full);
if (attrs.href !== undefined) {
return full;
}
return '<img class="ke-anchor" src="' + self.themesPath + 'common/anchor.gif" data-ke-name="' + escape(attrs.name) + '" />';
})
.replace(/<script([^>]*)>([\s\S]*?)<\/script>/ig, function(full, attr, code) {
return '<div class="ke-script" data-ke-script-attr="' + escape(attr) + '">' + escape(code) + '</div>';
})
.replace(/<noscript([^>]*)>([\s\S]*?)<\/noscript>/ig, function(full, attr, code) {
return '<div class="ke-noscript" data-ke-noscript-attr="' + escape(attr) + '">' + escape(code) + '</div>';
})
.replace(/(<[^>]*)(href|src)="([^"]*)"([^>]*>)/ig, function(full, start, key, src, end) {
if (full.match(/\sdata-ke-src="[^"]*"/i)) {
return full;
}
full = start + key + '="' + src + '"' + ' data-ke-src="' + src + '"' + end;
return full;
})
.replace(/(<[^>]+\s)(on\w+="[^"]*"[^>]*>)/ig, function(full, start, end) {
return start + 'data-ke-' + end;
})
.replace(/<table[^>]*\s+border="0"[^>]*>/ig, function(full) {
if (full.indexOf('ke-zeroborder') >= 0) {
return full;
}
return _addClassToTag(full, 'ke-zeroborder');
});
});
});
})(window);
| zhaojingtao/PHP-Learning-Module | 基础班/21.PHP操作MySQL及新闻页增删/js/editor/kindeditor.js | JavaScript | apache-2.0 | 154,717 |
define(['knockout',
'jquery',
'text!./FeasibilityReportViewerTemplate.html',
'./FeasibilityIntersectReport',
'./FeasibilityAttritionReport',
'css!../css/report.css'],
function (
ko,
$,
template) {
function FeasibilityReportViewer(params) {
var self = this;
self.report = params.report;
self.reportCaption = params.reportCaption;
self.selectedView = ko.observable("intersect");
if (params.viewerWidget) {
viewerWidget(self);
}
}
var component = {
viewModel: FeasibilityReportViewer,
template: template
};
ko.components.register('feasibility-report-viewer', component);
// return compoonent definition
return component;
}); | OHDSI/Calypso | js/modules/cohortbuilder/components/FeasibilityReportViewer.js | JavaScript | apache-2.0 | 697 |
$(document).ready(function() {
$.getJSON('api/presents')
.then(function(presents) {
displayPresents(presents);
})
.catch(function(err) {
console.error("failed to load presents data: %s", err.responseJSON.message);
});
var messages = pollMessages();
for (var i=0; i < messages.length; i++) {
displayMessage(messages[i]);
}
});
function displayPresents(presents) {
var list = document.getElementById('presents');
for (i=0; i < presents.length; i++) {
var item = presentItem(presents[i]);
list.appendChild(item);
}
window.presents = presents;
$('.modal').on('shown.bs.modal', function() {
$(this).find('[autofocus]').focus();
});
}
function presentItem(present) {
var item = document.createElement('div');
item.className = 'present card ' + present.status.toLowerCase();
item.innerHTML =
'<a href="' + present.url + '" target="_blank">' +
'<img class="card-img-top" src="' + present.imageUrl + '"/>' +
'</a>' +
'<div class="card-block">' +
'<h4 class="card-title"><a href="' + present.url + '" target="_blank">' + present.title + '</a></h4>' +
reservationButtonHtml(present) +
'</div>'
;
return item;
}
function reservationButtonHtml(present) {
var disabled = '';
var text = 'Rezervovat';
var styleClass = ' btn-default ';
if (present.status !== 'AVAILABLE') {
disabled = " disabled='disable'";
text = present.status === 'RESERVED' ? 'Rezervováno' : 'Ověřování rezervace...';
}
return '<button class="btn' + styleClass + 'orderReservation"' +
disabled +
' onclick="orderReservation(' + present.id +')">' + text + '</button>';
}
function orderReservation(presentId) {
var index = fetchPresentIndex(presentId);
var present = window.presents[index];
console.log(present);
var card = $('article#main #presents > div')[index];
$('#orderReservation #presentId').val(present.id);
$('#orderReservation .modal-title').html('Rezervace: ' + present.title);
$('#orderReservation #modalImage').attr('src', present.imageUrl);
$('#orderReservation #modal-title-link').attr('href', present.url);
$('#orderReservation #modal-image-link').attr('href', present.url);
$('#orderReservation').modal('show');
}
function sendReservation(el) {
var presentId = $('#orderReservation #presentId').val() >>> 0;
var mobilePhone = $('#orderReservation #phoneNumber').val();
var index = fetchPresentIndex(presentId);
var present = window.presents[index];
if (isValidPhone(mobilePhone)) {
$.ajax({
url: 'api/presents/' + presentId + '/reservations',
type:"POST",
data: JSON.stringify({ mobile: mobilePhone }, null, 2),
contentType:"application/json; charset=utf-8",
dataType:"json",
success: function(){
$('#orderReservation').modal('hide');
appendMessage(
'Rezervace daru "' + present.title + '" byla přijata ' +
'a bude v blízké době telefonicky ověřena na čísle "' +
mobilePhone + '".'
);
location.reload();
}
});
}
else {
window.alert("Zadej správně tel. číslo!");
return false;
}
}
function fetchPresentIndex(presentId) {
console.log(presentId);
var presents = window.presents;
var len = presents.length;
for (var index = 0; index < len; index++) {
if (presents[index].id === presentId) {
return index;
}
}
return -1;
}
function isValidPhone(number) {
return /^\+?[1-9]{1}[0-9]{3,14}$/.test(number);
}
function displayMessage(msg, type) {
type = type || 'success';
var message = $(
'<div class="alert alert-'+ type +' alert-dismissible" role="alert">' +
'<button type="button" class="close" data-dismiss="alert">' +
'<span aria-hidden="true">×</span>' +
'</button>' +
msg +
'</div>'
);
$('#messages').append(message);
message
.delay(6000)
.fadeOut(2000)
.queue(function() {
$(this).remove();
});
}
function appendMessage(msg) {
var messages = sessionStorage.getItem('messages');
messages = JSON.parse(messages || '[]');
messages.push(msg);
sessionStorage.setItem('messages', JSON.stringify(messages));
}
function pollMessages() {
var messages = sessionStorage.getItem('messages');
sessionStorage.removeItem('messages');
return JSON.parse(messages || '[]');
}
| bestm4n/wedding-web | src/main/resources/static/js/presents.js | JavaScript | apache-2.0 | 4,382 |
define(function(require){
return 'file_info_tab';
}); | tuxmea/one | src/sunstone/public/app/tabs/files-tab/panels/info/panelId.js | JavaScript | apache-2.0 | 55 |
var http = require('http');
var SQLUpdateJSFun = {};
SQLUpdateJSFun.options = {
host: 'localhost',
port: '8080',
path: '/webresources',
method: 'GET',
headers: {'Authorization': 'Basic ',
'Accept': 'application/json',
'Content-Type': 'application/json'}
};
SQLUpdateJSFun.sethttpOption = function (host, port, path, method, user, pwd) {
SQLUpdateJSFun.options.host = host;
SQLUpdateJSFun.options.port = port;
SQLUpdateJSFun.options.path = path;
SQLUpdateJSFun.options.method = method;
SQLUpdateJSFun.options.headers.Authorization = 'Basic ' + new Buffer(user + ":" + pwd).toString('base64');
SQLUpdateJSFun.options.headers.Accesstoken = '';
return SQLUpdateJSFun.options;
};
SQLUpdateJSFun.sethttpOption_token = function (host, port, path, method, token) {
SQLUpdateJSFun.options.host = host;
SQLUpdateJSFun.options.port = port;
SQLUpdateJSFun.options.path = path;
SQLUpdateJSFun.options.method = method;
SQLUpdateJSFun.options.headers.Authorization = '';
SQLUpdateJSFun.options.headers.Accesstoken = 'Bearer ' + token;
return SQLUpdateJSFun.options;
};
SQLUpdateJSFun.submit = function (url, port, path, method, username, pwd, jsonStringData, res_success, res_error) {
// var options = this.sethttpOption(url, port, path, method, username, pwd);
var req = http.request(SQLUpdateJSFun.options, function (response) {
var str = '';
response.on('data', function (chunk) {
str += chunk;
});
response.on('end', function () {
res_success(str);
});
}).on('error', function (error) {
res_error(error.errno);
});
if (method !== 'get')
req.write(jsonStringData);
req.end();
};
SQLUpdateJSFun.getjsoncontentData = function (config) {
var tablename = config.tablename;
var fields = config.fields;
var condictions_op = config.cond_op;
var condictions = config.conditions;
var objselectfielditem = new Object();
var fieldArray = [];
for (var index = 0; index < fields.length; index++) {
var fieldName = fields[index].name;
var value = fields[index].value;
fieldArray.push({"@fieldName": "" + fieldName + "", "@value": "" + value + ""});
}
var cond_op = {"@value": "" + condictions_op + ""};
var objcondsitem = new Object();
var condsArray = [];
for (var index = 0; index < condictions.length; index++) {
var fieldName = condictions[index].name;
var operator = condictions[index].op;
var operatorchar;
var value = condictions[index].value;
if (operator === 'equ') {
operatorchar = '=';
} else if (operator === 'notequ') {
operatorchar = '!=';
} else if (operator === 'less') {
operatorchar = '<';
} else if (operator === 'lessequ') {
operatorchar = '<=';
} else if (operator === 'large') {
operatorchar = '>';
} else if (operator === 'largeequ') {
operatorchar = '>=';
} else {
operatorchar = operator;
}
condsArray.push({
"@tableField": "" + tablename + "." + fieldName + "",
"@operator": "" + operatorchar + "",
"@value": "" + value + ""
});
}
objselectfielditem.item = fieldArray;
objcondsitem.item = condsArray;
var objFields = new Object();
objFields.tableName = {"@value": "" + tablename + ""};
if (fields.length !== 0)
objFields.fields = objselectfielditem;
objFields.condictions_op = cond_op;
if (condictions.length !== 0)
objFields.condictions = objcondsitem;
var objreq = new Object();
objreq.request = objFields;
return JSON.stringify(objreq);
};
module.exports = function (RED) {
function SQLUpdateNode(config) {
RED.nodes.createNode(this, config);
var node = this;
node.status({});
this.on('input', function (msg) {
var url = msg.url;
var port = msg.port;
var username = msg.username;
var pwd = msg.pwd;
var flag = msg.flag;
var encodestr = msg.encodestr;
var token = msg.token;
var connectype = msg.connectype;
if (flag === 'encode') {
if (typeof url === 'undefined' || typeof port === 'undefined' || url === '' || port === '') {
node.status({fill: "red", shape: "ring", text: "miss server parameters"});
return;
}
switch (connectype) {
case 'basic':
var decoder = new Buffer(encodestr, 'base64').toString();
username = decoder.split("$")[0];
pwd = decoder.split("$")[1];
SQLUpdateJSFun.options = SQLUpdateJSFun.sethttpOption(url, port, '/webresources/SQLMgmt/updateData', 'post', username, pwd);
break;
case 'oauth':
SQLUpdateJSFun.options = SQLUpdateJSFun.sethttpOption_token(url, port, '/webresources/SQLMgmt/updateData', 'post', token);
break;
}
} else {
if (typeof url === 'undefined' || typeof port === 'undefined' || typeof username === 'undefined' || typeof pwd === 'undefined' ||
url === '' || port === '' || username === '' || pwd === '') {
node.status({fill: "red", shape: "ring", text: "miss server parameters"});
return;
}
SQLUpdateJSFun.options = SQLUpdateJSFun.sethttpOption(url, port, '/webresources/SQLMgmt/updateData', 'post', username, pwd);
}
if (typeof msg.tablename !== 'undefined' && msg.tablename !== '')
config.tablename = msg.tablename;
if (typeof msg.fields !== 'undefined' && msg.fields !== '')
config.fields = msg.fields;
if (typeof msg.cond_op !== 'undefined' && msg.cond_op !== '')
config.cond_op = msg.cond_op;
if (typeof msg.conditions !== 'undefined' && msg.conditions !== '')
config.conditions = msg.conditions;
if (typeof config.tablename === 'undefined' || config.tablename === '') {
node.status({fill: "red", shape: "ring", text: "miss table name parameters"});
return;
}
if (typeof config.fields === 'undefined' || config.fields === '') {
node.status({fill: "red", shape: "ring", text: "miss fields parameters"});
return;
}
if (typeof config.cond_op === 'undefined' || config.cond_op === '') {
node.status({fill: "red", shape: "ring", text: "miss cond_op parameters"});
return;
}
if (typeof config.conditions === 'undefined' || config.conditions === '') {
node.status({fill: "red", shape: "ring", text: "miss conditions parameters"});
return;
}
SQLUpdateJSFun.submit(url, port, '/webresources/SQLMgmt/updateData', 'post', username, pwd, SQLUpdateJSFun.getjsoncontentData(config), function (res_success) {
msg.payload = res_success;
node.send(msg);
node.status({fill: "green", shape: "dot", text: 'done'});
}, function (res_error) {
node.status({fill: "red", shape: "ring", text: res_error});
});
});
}
RED.nodes.registerType("SQLUpdate", SQLUpdateNode);
}; | ADVANTECH-Corp/node-red-contrib-susiaccess-3.1 | DatabaseCtrl/SQL/SQLUpdate/SQLUpdate.js | JavaScript | apache-2.0 | 7,774 |
// the semi-colon before function invocation is a safety net against concatenated
// scripts and/or other plugins which may not be closed properly.
;
(function( $, window, document, undefined )
{
// undefined is used here as the undefined global variable in ECMAScript 3 is
// mutable (ie. it can be changed by someone else). undefined isn't really being
// passed in so we can ensure the value of it is truly undefined. In ES5, undefined
// can no longer be modified.
// window and document are passed through as local variable rather than global
// as this (slightly) quickens the resolution process and can be more efficiently
// minified (especially when both are regularly referenced in your plugin).
// Create the defaults once
var pluginName = "menuParser",
defaults = {
source: null,
sourceType: 'JSON',
events: {
onInit: function()
{
},
onFinished: function()
{
}
}
};
// The actual plugin constructor
function menuParser( element, options )
{
this.element = element;
// jQuery has an extend method which merges the contents of two or
// more objects, storing the result in the first object. The first object
// is generally empty as we don't want to alter the default options for
// future instances of the plugin
this.options = $.extend( {}, defaults, options );
this._defaults = defaults;
this._name = pluginName;
this.menuHtml = [];
this.init();
}
menuParser.prototype = {
init: function()
{
// Place initialization logic here
// You already have access to the DOM element and
// the options via the instance, e.g. this.element
// and this.settings
// you can add more functions like the one below and
// call them like so: this.yourOtherFunction(this.element, this.settings).
this.options.events.onInit.call( this );
this.parseSource();
//this.buildList();
this.options.events.onFinished.call( this );
},
/**
* Gets the given source and provide its content to this.sourceObj
*/
parseSource: function()
{
this.sourceObj = null;
// In case if there is an menu object directly given through the options
if( typeof this.options.source == 'object' )
{
this.sourceObj = this.options.source;
this.options.sourceType = 'JSON';
return;
}
else
{
var __this = this;
$.ajax( {
type: "GET",
url: this.options.source,
dataType: this.options.sourceType,
success: function( mData )
{
__this.sourceObj = mData;
__this.buildList();
},
error: function()
{
console.error( "menuParser.js: " + this.options.source + " could not be loaded." );
}
} );
}
},
/**
* Recursively builds the menu from this.sourceObj and appends it to this.element.
*/
buildList: function()
{
var __this = this;
// Recursive function for building the menu
function createList( arr, blSubMenu )
{
// Identifier whether this is a submenu or not
if( blSubMenu )
{
__this.menuHtml.push( '<ul class="submenu">' );
}
// Iterate each menu item
$.each( arr, function( i, val )
{
// Check if this menu item has a submenu
var blHasSubMenu = val.submenu && val.submenu.length > 0;
__this.menuHtml.push( '<li class="' + ( blHasSubMenu ? 'submenu-toggle' : null ) + '">' );
__this.menuHtml.push( '<a href="' + val.link + '" title="' + val.name + ' öffnen">' );
// Push icon if given
if( val.icon )
{
__this.menuHtml.push( '<i class="' + val.icon + '"></i>' );
}
__this.menuHtml.push( val.name + '</a>' );
if( blHasSubMenu )
{
createList( val.submenu, true );
}
__this.menuHtml.push( '</li>' );
} );
if( blSubMenu )
{
__this.menuHtml.push( '</ul>' );
}
}
createList( this.sourceObj, false );
// Append the HTML of the Menu to this.element.
$( this.element ).html( '' ).append( this.menuHtml.join( '' ) );
}
};
// A really lightweight plugin wrapper around the constructor,
// preventing against multiple instantiations
$.fn[ pluginName ] = function( options )
{
return this.each(
function()
{
if( !$.data( this, "plugin_" + pluginName ) )
{
$.data( this, "plugin_" + pluginName, new menuParser( this, options ) );
}
} );
};
})( jQuery, window, document ); | esironal/webdesktop | assets/js/jquery.MenuParser.js | JavaScript | apache-2.0 | 5,692 |
/*
* 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.
*/
'use strict';
/**
* Data Lake Store account information to update.
*
*/
class UpdateDataLakeStoreAccountParameters {
/**
* Create a UpdateDataLakeStoreAccountParameters.
* @property {object} [tags] Resource tags
* @property {string} [defaultGroup] The default owner group for all new
* folders and files created in the Data Lake Store account.
* @property {object} [encryptionConfig] Used for rotation of user managed
* Key Vault keys. Can only be used to rotate a user managed encryption Key
* Vault key.
* @property {object} [encryptionConfig.keyVaultMetaInfo] The updated Key
* Vault key to use in user managed key rotation.
* @property {string}
* [encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The version of
* the user managed encryption key to update through a key rotation.
* @property {array} [firewallRules] The list of firewall rules associated
* with this Data Lake Store account.
* @property {array} [virtualNetworkRules] The list of virtual network rules
* associated with this Data Lake Store account.
* @property {string} [firewallState] The current state of the IP address
* firewall for this Data Lake Store account. Disabling the firewall does not
* remove existing rules, they will just be ignored until the firewall is
* re-enabled. Possible values include: 'Enabled', 'Disabled'
* @property {string} [firewallAllowAzureIps] The current state of allowing
* or disallowing IPs originating within Azure through the firewall. If the
* firewall is disabled, this is not enforced. Possible values include:
* 'Enabled', 'Disabled'
* @property {array} [trustedIdProviders] The list of trusted identity
* providers associated with this Data Lake Store account.
* @property {string} [trustedIdProviderState] The current state of the
* trusted identity provider feature for this Data Lake Store account.
* Disabling trusted identity provider functionality does not remove the
* providers, they will just be ignored until this feature is re-enabled.
* Possible values include: 'Enabled', 'Disabled'
* @property {string} [newTier] The commitment tier to use for next month.
* Possible values include: 'Consumption', 'Commitment_1TB',
* 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB',
* 'Commitment_1PB', 'Commitment_5PB'
*/
constructor() {
}
/**
* Defines the metadata of UpdateDataLakeStoreAccountParameters
*
* @returns {object} metadata of UpdateDataLakeStoreAccountParameters
*
*/
mapper() {
return {
required: false,
serializedName: 'UpdateDataLakeStoreAccountParameters',
type: {
name: 'Composite',
className: 'UpdateDataLakeStoreAccountParameters',
modelProperties: {
tags: {
required: false,
serializedName: 'tags',
type: {
name: 'Dictionary',
value: {
required: false,
serializedName: 'StringElementType',
type: {
name: 'String'
}
}
}
},
defaultGroup: {
required: false,
serializedName: 'properties.defaultGroup',
type: {
name: 'String'
}
},
encryptionConfig: {
required: false,
serializedName: 'properties.encryptionConfig',
type: {
name: 'Composite',
className: 'UpdateEncryptionConfig'
}
},
firewallRules: {
required: false,
serializedName: 'properties.firewallRules',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'UpdateFirewallRuleWithAccountParametersElementType',
type: {
name: 'Composite',
className: 'UpdateFirewallRuleWithAccountParameters'
}
}
}
},
virtualNetworkRules: {
required: false,
serializedName: 'properties.virtualNetworkRules',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'UpdateVirtualNetworkRuleWithAccountParametersElementType',
type: {
name: 'Composite',
className: 'UpdateVirtualNetworkRuleWithAccountParameters'
}
}
}
},
firewallState: {
required: false,
serializedName: 'properties.firewallState',
type: {
name: 'Enum',
allowedValues: [ 'Enabled', 'Disabled' ]
}
},
firewallAllowAzureIps: {
required: false,
serializedName: 'properties.firewallAllowAzureIps',
type: {
name: 'Enum',
allowedValues: [ 'Enabled', 'Disabled' ]
}
},
trustedIdProviders: {
required: false,
serializedName: 'properties.trustedIdProviders',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'UpdateTrustedIdProviderWithAccountParametersElementType',
type: {
name: 'Composite',
className: 'UpdateTrustedIdProviderWithAccountParameters'
}
}
}
},
trustedIdProviderState: {
required: false,
serializedName: 'properties.trustedIdProviderState',
type: {
name: 'Enum',
allowedValues: [ 'Enabled', 'Disabled' ]
}
},
newTier: {
required: false,
serializedName: 'properties.newTier',
type: {
name: 'Enum',
allowedValues: [ 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' ]
}
}
}
}
};
}
}
module.exports = UpdateDataLakeStoreAccountParameters;
| xingwu1/azure-sdk-for-node | lib/services/datalake.Store/lib/account/models/updateDataLakeStoreAccountParameters.js | JavaScript | apache-2.0 | 6,679 |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _lodash = require('lodash');
var _events = require('events');
var _events2 = _interopRequireDefault(_events);
var _bulk_operations = require('./lib/bulk_operations');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
require('babel-polyfill');
/**
* The base class for migrations.
*/
var Migration = function () {
_createClass(Migration, null, [{
key: 'description',
/**
* Returns the description of the migration.
*/
get: function get() {
return 'No description';
}
/**
* Creates a new Migration.
*
* @param configuration {object} The migration configuration.
*/
}]);
function Migration(configuration) {
_classCallCheck(this, Migration);
if (!configuration) throw new Error('Configuration not specified.');
this._client = configuration.client;
this._config = configuration.config;
this._logger = configuration.logger;
}
_createClass(Migration, [{
key: 'parseJSON',
/**
* Tries to parse objectString to JSON Object, logs warning and returns {} on failure.
* @param {String} objectString
* @returns Parsed JSON Object or {} on failure
*/
value: function parseJSON(objectString) {
try {
return JSON.parse(objectString);
} catch (e) {
this.logger.warning('Unable to parse to JSON object: ' + objectString);
this.logger.error(e);
return {};
}
}
/**
* Returns the number of objects that can be upgraded by this migration.
*/
}, {
key: 'count',
value: function () {
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
return _context.abrupt('return', 0);
case 1:
case 'end':
return _context.stop();
}
}
}, _callee, this);
}));
function count() {
return _ref.apply(this, arguments);
}
return count;
}()
/**
* Retrieves the total hit count from a response object
* @param {Object} response
* @return {Number} Total hit count
*/
}, {
key: 'getTotalHitCount',
value: function getTotalHitCount(response) {
var total = response.hits.total;
if ((typeof total === 'undefined' ? 'undefined' : _typeof(total)) === 'object') {
return total.value;
}
return total;
}
/**
* Performs an upgrade and returns the number of objects upgraded.
*/
}, {
key: 'upgrade',
value: function () {
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
return regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
return _context2.abrupt('return', 0);
case 1:
case 'end':
return _context2.stop();
}
}
}, _callee2, this);
}));
function upgrade() {
return _ref2.apply(this, arguments);
}
return upgrade;
}()
/**
* Performs an Elasticsearch query using the scroll API and returns the hits.
*
* @param index - The index to search.
* @param type - The type to search.
* @param query - The query body.
* @param options - Additional options for the search method; currently the
* only supported one is `size`.
* @params returnEventEmitter - optional, if provided the method will return an event emitter instead of hits
* and will emit "data", "error", and "end" events in order to reduce the memory usage
* @return The search hits or event emitter.
*/
}, {
key: 'scrollSearch',
value: function () {
var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(index, type, query, options) {
var _this = this;
var executeLoop = function () {
var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
var response;
return regeneratorRuntime.wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
_context3.next = 2;
return this._client.search(searchOptions);
case 2:
response = _context3.sent;
case 3:
if (!true) {
_context3.next = 37;
break;
}
if (emitter) {
emitter.emit('data', response.hits.hits);
emmitedObjects += response.hits.hits.length;
} else {
objects.push.apply(objects, _toConsumableArray(response.hits.hits));
}
if (!(emitter && emmitedObjects === this.getTotalHitCount(response) || !emitter && objects.length === this.getTotalHitCount(response))) {
_context3.next = 21;
break;
}
if (!response._scroll_id) {
_context3.next = 19;
break;
}
_context3.prev = 7;
_context3.next = 10;
return this._client.clearScroll({
body: {
scroll_id: response._scroll_id
}
});
case 10:
_context3.next = 19;
break;
case 12:
_context3.prev = 12;
_context3.t0 = _context3['catch'](7);
if (!emitter) {
_context3.next = 18;
break;
}
emitter.emit('error', _context3.t0);
_context3.next = 19;
break;
case 18:
throw _context3.t0;
case 19:
if (emitter) {
emitter.emit('end', { total: emmitedObjects });
}
return _context3.abrupt('break', 37);
case 21:
_context3.prev = 21;
_context3.next = 24;
return this._client.scroll({
body: {
scroll: '1m',
scroll_id: response._scroll_id
}
});
case 24:
response = _context3.sent;
_context3.next = 35;
break;
case 27:
_context3.prev = 27;
_context3.t1 = _context3['catch'](21);
if (!emitter) {
_context3.next = 34;
break;
}
emitter.emit('error', _context3.t1);
return _context3.abrupt('break', 37);
case 34:
throw _context3.t1;
case 35:
_context3.next = 3;
break;
case 37:
case 'end':
return _context3.stop();
}
}
}, _callee3, this, [[7, 12], [21, 27]]);
}));
return function executeLoop() {
return _ref4.apply(this, arguments);
};
}();
var returnEventEmitter = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
var objects, emitter, emmitedObjects, opts, searchOptions;
return regeneratorRuntime.wrap(function _callee4$(_context4) {
while (1) {
switch (_context4.prev = _context4.next) {
case 0:
objects = [];
emitter = returnEventEmitter === true ? new _events2.default.EventEmitter() : undefined;
emmitedObjects = 0;
opts = (0, _lodash.defaults)(options || {}, {
size: 100
});
searchOptions = {
index: index,
type: type,
scroll: '1m',
size: opts.size
};
if (query) {
searchOptions.body = query;
}
if (!emitter) {
_context4.next = 9;
break;
}
// execute the loop in the next tick so the caller have a chance to register handlers
setTimeout(function () {
return executeLoop.call(_this);
});
return _context4.abrupt('return', emitter);
case 9:
_context4.next = 11;
return executeLoop.call(this);
case 11:
return _context4.abrupt('return', objects);
case 12:
case 'end':
return _context4.stop();
}
}
}, _callee4, this);
}));
function scrollSearch(_x, _x2, _x3, _x4) {
return _ref3.apply(this, arguments);
}
return scrollSearch;
}()
/**
* Performs an Elasticsearch query and returns the number of hits.
*
* @param index - The index to search.
* @param type - The type to search.
* @param query - The query body.
* @return The number of search hits.
*/
}, {
key: 'countHits',
value: function () {
var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(index, type, query) {
var searchOptions, response;
return regeneratorRuntime.wrap(function _callee5$(_context5) {
while (1) {
switch (_context5.prev = _context5.next) {
case 0:
searchOptions = {
index: index,
type: type,
body: query
};
_context5.next = 3;
return this._client.count(searchOptions);
case 3:
response = _context5.sent;
return _context5.abrupt('return', response.count);
case 5:
case 'end':
return _context5.stop();
}
}
}, _callee5, this);
}));
function countHits(_x6, _x7, _x8) {
return _ref5.apply(this, arguments);
}
return countHits;
}()
/**
* Executes an Elasticsearch bulk request to index documents in .siren index
* To avoid too large request body it splits the request in batches
* @param bulkBody - An array with bulk operations
* @param batchOperationNumber - Number of operations to include in a single batch, by operation we mean index, delete, update
*/
}, {
key: 'executeteBulkRequest',
value: function () {
var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(bulkBody) {
var batchOperationNumber = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 250;
var batchSize;
return regeneratorRuntime.wrap(function _callee6$(_context6) {
while (1) {
switch (_context6.prev = _context6.next) {
case 0:
if (!(bulkBody.length > 0)) {
_context6.next = 6;
break;
}
batchSize = (0, _bulk_operations.getBatchSize)(bulkBody, batchOperationNumber);
_context6.next = 4;
return this._client.bulk({
refresh: true,
body: bulkBody.splice(0, batchSize)
});
case 4:
_context6.next = 0;
break;
case 6:
case 'end':
return _context6.stop();
}
}
}, _callee6, this);
}));
function executeteBulkRequest(_x9) {
return _ref6.apply(this, arguments);
}
return executeteBulkRequest;
}()
}, {
key: 'logger',
get: function get() {
if (this._logger) {
return this._logger;
}
return {
// eslint-disable-next-line no-console
info: console.info,
// eslint-disable-next-line no-console
error: console.error,
// eslint-disable-next-line no-console
warning: console.warn,
// eslint-disable-next-line no-console
debug: console.debug
};
}
}]);
return Migration;
}();
exports.default = Migration; | sindicetech/kibiutils | lib/migrations/migration.js | JavaScript | apache-2.0 | 14,882 |
/**
* @file Defines the class CUI.ChatMediaPresenter
*/
var CUI = CUI || {};
/**
* Represents a media message in {@link CUI.ChatPresenter}.
* @class
* @param {CUI.ChatMediaModel} model - The model to present.
* @returns {CUI.ChatMediaPresenter}
*/
CUI.ChatMediaPresenter = function(model){
/**
* The HTML for the message.
* @type {String}
* @public
*/
this.el = null;
/**
* A jQuery object containing the DOM element for this message.
* @type {jQuery}
* @public
*/
this.$el = null;
/**
* A reference to the model used to generate the message.
* @type {CUI.ChatMediaModel}
* @protected
*/
this._model = model;
// Render element
this._render();
// Add event listeners
this._addEventListeners();
return this;
};
/**
* Updates the message.
* @public
* @param {CUI.ChatMediaModel} model - The model to present.
* @returns {CUI.ChatMediaPresenter}
*/
CUI.ChatMediaPresenter.prototype.update = function(model){
// Replace existing model with new model
this._model = model;
// Save reference to the old message
var $oldMessage = this.$el;
// Render the new message
this._render();
// Insert new message after old message
$oldMessage.after(this.$el);
// Delete and clean up after old message
$oldMessage.remove();
// Add event listeners for new message
this._addEventListeners();
return this;
};
/**
* Renders the html for the message using a Handlebars templates.
* @protected
*/
CUI.ChatMediaPresenter.prototype._render = function(){
this.el = CUI.views.chatMedia(this._model);
this.$el = $(this.el);
// Calculate max-width for caption
this._renderCaption();
};
/**
* Attaches event listeners to elements in the message.
* @protected
*/
CUI.ChatMediaPresenter.prototype._addEventListeners = function(){
// Add more/less toggles
this.$el.find('.chat-more-less').moreLess();
// Add listeners for selectables
this.$el.find('.chat-selectable').on('click', function(e){
// Add selected class if not radio button or checkbox
if(!$(this).is(':checkbox') && !$(this).is(':radio')) {
e.preventDefault();
$(this).toggleClass('chat-selectable-selected');
}
});
// Overflow actions toggle
this.$el.find('.chat-actions-toggle').on('click', function(e){
e.preventDefault();
$(this).parent().find('ul').stop().fadeToggle();
});
// Re-render caption only when any embedded image has loaded
var $img = this.$el.find('.chat-bubble img');
if($img.length > 0){
$($img).one('load', $.proxy(function() {
this._renderCaption();
}, this)).each($.proxy(function() {
if(this.complete) this._renderCaption();
}, this));
}
};
/**
* Sets max-width for caption based on image width. Ignored for other media types as they generally have an initial width set.
* @protected
*/
CUI.ChatMediaPresenter.prototype._renderCaption = function(){
var $caption = this.$el.find('.caption');
var $mediaElement = this.$el.find('.chat-bubble > *:first-child');
var width = $mediaElement.width();
if($caption.length > 0 && width > 0){
$caption.css('max-width', width);
}
};
/**
* Destroys the message.
* @public
*/
CUI.ChatMediaPresenter.prototype.destroy = function(){
// Use jQuery.remove() to remove element from DOM and unbind event listeners
this.$el.remove();
this.el = null;
this.$el = null;
this._model = null;
};
| cjlee112/socraticqs2 | mysite/lms/static/js/chat/presenters/cui.chat-media-presenter.js | JavaScript | apache-2.0 | 3,426 |
import test from 'tape'
import Immutable from 'immutable'
import { actionTypes as types, initialState, reducer } from '../../app/universal/ui'
test('UI:Reducer[DEFAULT] - UI reducer default output', t => {
const actual = reducer(undefined, {})
const expected = initialState
t.deepEqual(actual, expected,
'reducer() should return initial state')
t.end()
})
test('UI:Reducer[UPDATE] - UI reducer update output', t => {
const payload = { requesting: true }
const actual = reducer(initialState, { type: types.UPDATE, payload })
const expected = initialState.merge({ ...payload })
t.ok(Immutable.is(actual, expected),
'reducer() should return update UI state')
t.end()
})
test('UI:Reducer[RESET] - UI reducer reset output', t => {
const actual = reducer(initialState, { type: types.RESET })
const expected = initialState.merge({ ...initialState.toJS() })
t.ok(Immutable.is(actual, expected),
'reducer() should return reset UI state')
t.end()
})
| ShandyClub/shandy-club-app | test/ui/reducer.js | JavaScript | apache-2.0 | 995 |
import { ChangeDetectionStrategy, Component, ContentChildren, ContentChild, Directive, ElementRef, EventEmitter, Input, Optional, Output, Renderer, ViewEncapsulation, NgZone } from '@angular/core';
import { isPresent, swipeShouldReset } from '../../util/util';
import { Item } from './item';
import { List } from '../list/list';
import { Platform } from '../../platform/platform';
import { DomController } from '../../platform/dom-controller';
const /** @type {?} */ SWIPE_MARGIN = 30;
const /** @type {?} */ ELASTIC_FACTOR = 0.55;
/**
* \@name ItemOptions
* \@description
* The option buttons for an `ion-item-sliding`. These buttons can be placed either on the left or right side.
* You can combine the `(ionSwipe)` event plus the `expandable` directive to create a full swipe action for the item.
*
* \@usage
*
* ```html
* <ion-item-sliding>
* <ion-item>
* Item 1
* </ion-item>
* <ion-item-options side="right" (ionSwipe)="saveItem(item)">
* <button ion-button expandable (click)="saveItem(item)">
* <ion-icon name="star"></ion-icon>
* </button>
* </ion-item-options>
* </ion-item-sliding>
* ```
*/
export class ItemOptions {
/**
* @param {?} _elementRef
* @param {?} _renderer
*/
constructor(_elementRef, _renderer) {
this._elementRef = _elementRef;
this._renderer = _renderer;
/**
* @output {event} Emitted when the item has been fully swiped.
*/
this.ionSwipe = new EventEmitter();
}
/**
* @return {?}
*/
getSides() {
if (isPresent(this.side) && this.side === 'left') {
return 1 /* Left */;
}
else {
return 2 /* Right */;
}
}
/**
* @return {?}
*/
width() {
return this._elementRef.nativeElement.offsetWidth;
}
}
ItemOptions.decorators = [
{ type: Directive, args: [{
selector: 'ion-item-options',
},] },
];
/** @nocollapse */
ItemOptions.ctorParameters = () => [
{ type: ElementRef, },
{ type: Renderer, },
];
ItemOptions.propDecorators = {
'side': [{ type: Input },],
'ionSwipe': [{ type: Output },],
};
function ItemOptions_tsickle_Closure_declarations() {
/** @type {?} */
ItemOptions.decorators;
/**
* @nocollapse
* @type {?}
*/
ItemOptions.ctorParameters;
/** @type {?} */
ItemOptions.propDecorators;
/**
* \@input {string} The side the option button should be on. Defaults to `"right"`.
* If you have multiple `ion-item-options`, a side must be provided for each.
* @type {?}
*/
ItemOptions.prototype.side;
/**
* \@output {event} Emitted when the item has been fully swiped.
* @type {?}
*/
ItemOptions.prototype.ionSwipe;
/** @type {?} */
ItemOptions.prototype._elementRef;
/** @type {?} */
ItemOptions.prototype._renderer;
}
/**
* \@name ItemSliding
* \@description
* A sliding item is a list item that can be swiped to reveal buttons. It requires
* an [Item](../Item) component as a child and a [List](../../list/List) component as
* a parent. All buttons to reveal can be placed in the `<ion-item-options>` element.
*
* \@usage
* ```html
* <ion-list>
* <ion-item-sliding #item>
* <ion-item>
* Item
* </ion-item>
* <ion-item-options side="left">
* <button ion-button (click)="favorite(item)">Favorite</button>
* <button ion-button color="danger" (click)="share(item)">Share</button>
* </ion-item-options>
*
* <ion-item-options side="right">
* <button ion-button (click)="unread(item)">Unread</button>
* </ion-item-options>
* </ion-item-sliding>
* </ion-list>
* ```
*
* ### Swipe Direction
* By default, the buttons are revealed when the sliding item is swiped from right to left,
* so the buttons are placed in the right side. But it's also possible to reveal them
* in the right side (sliding from left to right) by setting the `side` attribute
* on the `ion-item-options` element. Up to 2 `ion-item-options` can used at the same time
* in order to reveal two different sets of buttons depending the swipping direction.
*
* ```html
* <ion-item-options side="right">
* <button ion-button (click)="archive(item)">
* <ion-icon name="archive"></ion-icon>
* Archive
* </button>
* </ion-item-options>
*
* <ion-item-options side="left">
* <button ion-button (click)="archive(item)">
* <ion-icon name="archive"></ion-icon>
* Archive
* </button>
* </ion-item-options>
* ```
*
* ### Listening for events (ionDrag) and (ionSwipe)
* It's possible to know the current relative position of the sliding item by subscribing
* to the (ionDrag)` event.
*
* ```html
* <ion-item-sliding (ionDrag)="logDrag($event)">
* <ion-item>Item</ion-item>
* <ion-item-options>
* <button ion-button>Favorite</button>
* </ion-item-options>
* </ion-item-sliding>
* ```
*
* ### Button Layout
* If an icon is placed with text in the option button, by default it will
* display the icon on top of the text. This can be changed to display the icon
* to the left of the text by setting `icon-left` as an attribute on the
* `<ion-item-options>` element.
*
* ```html
* <ion-item-options icon-left>
* <button ion-button (click)="archive(item)">
* <ion-icon name="archive"></ion-icon>
* Archive
* </button>
* </ion-item-options>
*
* ```
*
*
* \@demo /docs/v2/demos/src/item-sliding/
* @see {\@link /docs/v2/components#lists List Component Docs}
* @see {\@link ../Item Item API Docs}
* @see {\@link ../../list/List List API Docs}
*/
export class ItemSliding {
/**
* @param {?} list
* @param {?} _plt
* @param {?} _dom
* @param {?} _renderer
* @param {?} _elementRef
* @param {?} _zone
*/
constructor(list, _plt, _dom, _renderer, _elementRef, _zone) {
this._plt = _plt;
this._dom = _dom;
this._renderer = _renderer;
this._elementRef = _elementRef;
this._zone = _zone;
this._openAmount = 0;
this._startX = 0;
this._optsWidthRightSide = 0;
this._optsWidthLeftSide = 0;
this._tmr = null;
this._optsDirty = true;
this._state = 2 /* Disabled */;
/**
* @output {event} Emitted when the sliding position changes.
* It reports the relative position.
*
* ```ts
* ondrag(item) {
* let percent = item.getSlidingPercent();
* if (percent > 0) {
* // positive
* console.log('right side');
* } else {
* // negative
* console.log('left side');
* }
* if (Math.abs(percent) > 1) {
* console.log('overscroll');
* }
* }
* ```
*
*/
this.ionDrag = new EventEmitter();
list && list.containsSlidingItem(true);
_elementRef.nativeElement.$ionComponent = this;
this.setElementClass('item-wrapper', true);
}
/**
* @param {?} itemOptions
* @return {?}
*/
set _itemOptions(itemOptions) {
let /** @type {?} */ sides = 0;
// Reset left and right options in case they were removed
this._leftOptions = this._rightOptions = null;
for (var item of itemOptions.toArray()) {
var /** @type {?} */ side = item.getSides();
if (side === 1 /* Left */) {
this._leftOptions = item;
}
else {
this._rightOptions = item;
}
sides |= item.getSides();
}
this._optsDirty = true;
this._sides = sides;
}
/**
* @return {?}
*/
getOpenAmount() {
return this._openAmount;
}
/**
* @return {?}
*/
getSlidingPercent() {
let /** @type {?} */ openAmount = this._openAmount;
if (openAmount > 0) {
return openAmount / this._optsWidthRightSide;
}
else if (openAmount < 0) {
return openAmount / this._optsWidthLeftSide;
}
else {
return 0;
}
}
/**
* @param {?} startX
* @return {?}
*/
startSliding(startX) {
if (this._tmr) {
this._plt.cancelTimeout(this._tmr);
this._tmr = null;
}
if (this._openAmount === 0) {
this._optsDirty = true;
this._setState(4 /* Enabled */);
}
this._startX = startX + this._openAmount;
this.item.setElementStyle(this._plt.Css.transition, 'none');
}
/**
* @param {?} x
* @return {?}
*/
moveSliding(x) {
if (this._optsDirty) {
this.calculateOptsWidth();
return;
}
let /** @type {?} */ openAmount = (this._startX - x);
switch (this._sides) {
case 2 /* Right */:
openAmount = Math.max(0, openAmount);
break;
case 1 /* Left */:
openAmount = Math.min(0, openAmount);
break;
case 3 /* Both */: break;
case 0 /* None */: return;
default:
(void 0) /* assert */;
break;
}
if (openAmount > this._optsWidthRightSide) {
var /** @type {?} */ optsWidth = this._optsWidthRightSide;
openAmount = optsWidth + (openAmount - optsWidth) * ELASTIC_FACTOR;
}
else if (openAmount < -this._optsWidthLeftSide) {
var /** @type {?} */ optsWidth = -this._optsWidthLeftSide;
openAmount = optsWidth + (openAmount - optsWidth) * ELASTIC_FACTOR;
}
this._setOpenAmount(openAmount, false);
return openAmount;
}
/**
* @param {?} velocity
* @return {?}
*/
endSliding(velocity) {
let /** @type {?} */ restingPoint = (this._openAmount > 0)
? this._optsWidthRightSide
: -this._optsWidthLeftSide;
// Check if the drag didn't clear the buttons mid-point
// and we aren't moving fast enough to swipe open
let /** @type {?} */ isResetDirection = (this._openAmount > 0) === !(velocity < 0);
let /** @type {?} */ isMovingFast = Math.abs(velocity) > 0.3;
let /** @type {?} */ isOnCloseZone = Math.abs(this._openAmount) < Math.abs(restingPoint / 2);
if (swipeShouldReset(isResetDirection, isMovingFast, isOnCloseZone)) {
restingPoint = 0;
}
this._setOpenAmount(restingPoint, true);
this.fireSwipeEvent();
return restingPoint;
}
/**
* @return {?}
*/
fireSwipeEvent() {
if (this._state & 32 /* SwipeRight */) {
this._zone.run(() => this._rightOptions.ionSwipe.emit(this));
}
else if (this._state & 64 /* SwipeLeft */) {
this._zone.run(() => this._leftOptions.ionSwipe.emit(this));
}
}
/**
* @return {?}
*/
calculateOptsWidth() {
if (!this._optsDirty) {
return;
}
this._optsWidthRightSide = 0;
if (this._rightOptions) {
this._optsWidthRightSide = this._rightOptions.width();
(void 0) /* assert */;
}
this._optsWidthLeftSide = 0;
if (this._leftOptions) {
this._optsWidthLeftSide = this._leftOptions.width();
(void 0) /* assert */;
}
this._optsDirty = false;
}
/**
* @param {?} openAmount
* @param {?} isFinal
* @return {?}
*/
_setOpenAmount(openAmount, isFinal) {
const /** @type {?} */ platform = this._plt;
if (this._tmr) {
platform.cancelTimeout(this._tmr);
this._tmr = null;
}
this._openAmount = openAmount;
if (isFinal) {
this.item.setElementStyle(platform.Css.transition, '');
}
else {
if (openAmount > 0) {
let /** @type {?} */ state = (openAmount >= (this._optsWidthRightSide + SWIPE_MARGIN))
? 8 /* Right */ | 32 /* SwipeRight */
: 8 /* Right */;
this._setState(state);
}
else if (openAmount < 0) {
let /** @type {?} */ state = (openAmount <= (-this._optsWidthLeftSide - SWIPE_MARGIN))
? 16 /* Left */ | 64 /* SwipeLeft */
: 16 /* Left */;
this._setState(state);
}
}
if (openAmount === 0) {
this._tmr = platform.timeout(() => {
this._setState(2 /* Disabled */);
this._tmr = null;
}, 600);
this.item.setElementStyle(platform.Css.transform, '');
return;
}
this.item.setElementStyle(platform.Css.transform, `translate3d(${-openAmount}px,0,0)`);
let /** @type {?} */ ionDrag = this.ionDrag;
if (ionDrag.observers.length > 0) {
ionDrag.emit(this);
}
}
/**
* @param {?} state
* @return {?}
*/
_setState(state) {
if (state === this._state) {
return;
}
this.setElementClass('active-slide', (state !== 2 /* Disabled */));
this.setElementClass('active-options-right', !!(state & 8 /* Right */));
this.setElementClass('active-options-left', !!(state & 16 /* Left */));
this.setElementClass('active-swipe-right', !!(state & 32 /* SwipeRight */));
this.setElementClass('active-swipe-left', !!(state & 64 /* SwipeLeft */));
this._state = state;
}
/**
* Close the sliding item. Items can also be closed from the [List](../../list/List).
*
* The sliding item can be closed by grabbing a reference to `ItemSliding`. In the
* below example, the template reference variable `slidingItem` is placed on the element
* and passed to the `share` method.
*
* ```html
* <ion-list>
* <ion-item-sliding #slidingItem>
* <ion-item>
* Item
* </ion-item>
* <ion-item-options>
* <button ion-button (click)="share(slidingItem)">Share</button>
* </ion-item-options>
* </ion-item-sliding>
* </ion-list>
* ```
*
* ```ts
* import { Component } from '\@angular/core';
* import { ItemSliding } from 'ionic-angular';
*
* \@Component({...})
* export class MyClass {
* constructor() { }
*
* share(slidingItem: ItemSliding) {
* slidingItem.close();
* }
* }
* ```
* @return {?}
*/
close() {
this._setOpenAmount(0, true);
}
/**
* @param {?} cssClass
* @param {?} shouldAdd
* @return {?}
*/
setElementClass(cssClass, shouldAdd) {
this._renderer.setElementClass(this._elementRef.nativeElement, cssClass, shouldAdd);
}
}
ItemSliding.decorators = [
{ type: Component, args: [{
selector: 'ion-item-sliding',
template: `
<ng-content select="ion-item,[ion-item]"></ng-content>
<ng-content select="ion-item-options"></ng-content>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None
},] },
];
/** @nocollapse */
ItemSliding.ctorParameters = () => [
{ type: List, decorators: [{ type: Optional },] },
{ type: Platform, },
{ type: DomController, },
{ type: Renderer, },
{ type: ElementRef, },
{ type: NgZone, },
];
ItemSliding.propDecorators = {
'item': [{ type: ContentChild, args: [Item,] },],
'ionDrag': [{ type: Output },],
'_itemOptions': [{ type: ContentChildren, args: [ItemOptions,] },],
};
function ItemSliding_tsickle_Closure_declarations() {
/** @type {?} */
ItemSliding.decorators;
/**
* @nocollapse
* @type {?}
*/
ItemSliding.ctorParameters;
/** @type {?} */
ItemSliding.propDecorators;
/** @type {?} */
ItemSliding.prototype._openAmount;
/** @type {?} */
ItemSliding.prototype._startX;
/** @type {?} */
ItemSliding.prototype._optsWidthRightSide;
/** @type {?} */
ItemSliding.prototype._optsWidthLeftSide;
/** @type {?} */
ItemSliding.prototype._sides;
/** @type {?} */
ItemSliding.prototype._tmr;
/** @type {?} */
ItemSliding.prototype._leftOptions;
/** @type {?} */
ItemSliding.prototype._rightOptions;
/** @type {?} */
ItemSliding.prototype._optsDirty;
/** @type {?} */
ItemSliding.prototype._state;
/** @type {?} */
ItemSliding.prototype.item;
/**
* \@output {event} Emitted when the sliding position changes.
* It reports the relative position.
*
* ```ts
* ondrag(item) {
* let percent = item.getSlidingPercent();
* if (percent > 0) {
* // positive
* console.log('right side');
* } else {
* // negative
* console.log('left side');
* }
* if (Math.abs(percent) > 1) {
* console.log('overscroll');
* }
* }
* ```
*
* @type {?}
*/
ItemSliding.prototype.ionDrag;
/** @type {?} */
ItemSliding.prototype._plt;
/** @type {?} */
ItemSliding.prototype._dom;
/** @type {?} */
ItemSliding.prototype._renderer;
/** @type {?} */
ItemSliding.prototype._elementRef;
/** @type {?} */
ItemSliding.prototype._zone;
}
//# sourceMappingURL=item-sliding.js.map | sajithaliyanage/Travel_SriLanka | node_modules/ionic-angular/es2015/components/item/item-sliding.js | JavaScript | apache-2.0 | 17,643 |
$(function () {
var data = [1.02, 2.3, 4.75, 5.0, 6.13, 7.4, 8.9];
// format follows the d3 formatting conventions
// https://github.com/mbostock/d3/wiki/Formatting#wiki-d3_format
new Contour({
el: '.myLineChart',
yAxis: {
labels :
{ formatter:
function (datum) { return datum + '%' }
}
}
})
.cartesian()
.line(data)
.tooltip()
.render();
}); | JohnSZhang/contour | src/documentation/fiddle/config.yAxis.labels.formatter/demo.js | JavaScript | apache-2.0 | 477 |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var _ionicIonic = require('ionic/ionic');
var _angular2Angular2 = require('angular2/angular2');
var _helpers = require('../../helpers');
var __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2:
return decorators.reduceRight(function (o, d) {
return d && d(o) || o;
}, target);
case 3:
return decorators.reduceRight(function (o, d) {
return (d && d(target, key), void 0);
}, void 0);
case 4:
return decorators.reduceRight(function (o, d) {
return d && d(target, key, o) || o;
}, desc);
}
};
var __metadata = undefined && undefined.__metadata || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var FullPage = function FullPage() {
_classCallCheck(this, FullPage);
};
exports.FullPage = FullPage;
exports.FullPage = FullPage = __decorate([(0, _ionicIonic.Page)({
templateUrl: 'buttons/full/full.html',
directives: [(0, _angular2Angular2.forwardRef)(function () {
return _helpers.AndroidAttribute;
})]
}), __metadata('design:paramtypes', [])], FullPage); | philmerrell/ionic-site | docs/v2/components/demo/buttons/full/pages.js | JavaScript | apache-2.0 | 1,661 |
var extend = require('util')._extend;
var EventEmitter = require('events').EventEmitter,
inherits = require('util').inherits,
DebugConnection = require('./debugger.js');
function createFailingConnection(reason) {
return {
connected: false,
isRunning: false,
request: function(command, args, callback) {
callback({ message: new ErrorNotConnected(reason) });
},
close: function() {
}
};
}
/**
* @constructor
* @param {number} debuggerPort
*/
function DebuggerClient(debuggerHost, debuggerPort) {
this._conn = createFailingConnection('node-inspector server was restarted');
this._host = debuggerHost;
this._port = debuggerPort;
this.target = null;
}
inherits(DebuggerClient, EventEmitter);
Object.defineProperties(DebuggerClient.prototype, {
/** @type {boolean} */
isRunning: {
get: function() {
return this._conn.isRunning;
}
},
isConnected: {
get: function() {
return this._conn.connected;
}
},
isReady: {
get: function() {
return this._conn.connected && !!this.target;
}
}
});
DebuggerClient.prototype.connect = function() {
this._conn = DebugConnection.attachDebugger(this._host, this._port);
this.pendingEvents = [];
this._conn
.on('connect', this._onConnectionOpen.bind(this))
.on('error', this.emit.bind(this, 'error'))
.on('close', this._onConnectionClose.bind(this))
.on('event', function(obj) {
if (this.isReady) {
this.emit(obj.event, obj.body);
} else {
this.pendingEvents.push(obj);
}
}.bind(this));
};
DebuggerClient.prototype._onConnectionOpen = function() {
// We need to update isRunning flag before we continue with debugging.
// Send a dummy request so that we can read the state from the response.
// We also need to get node version of the debugged process,
// therefore the dummy request is `evaluate 'process.version'`
var describeProgram = '(' + function() {
return {
break: process.execArgv.some(function(argv){
// we may get --debug-brk or --debug-brk=port
return argv.indexOf('--debug-brk') === 0;
}),
pid: console.log('') && process.pid,
cwd: process.cwd(),
filename: process.mainModule ? process.mainModule.filename : process.argv[1],
nodeVersion: process.version
};
} + ')()';
this.evaluateGlobal(describeProgram, function(error, result) {
this.target = result;
this.emit('connect');
this.pendingEvents.forEach(function(obj) {
this.emit(obj.event, obj.body);
}.bind(this));
this.pendingEvents = [];
}.bind(this));
};
/**
* @param {string} reason
*/
DebuggerClient.prototype._onConnectionClose = function(reason) {
this._conn = createFailingConnection(reason);
this.target = null;
this.emit('close', reason);
};
/**
* @param {string} command
* @param {!Object} args
* @param {function(error, response, refs)} callback
*/
DebuggerClient.prototype.request = function(command, args, callback) {
if (typeof callback !== 'function') {
callback = function(error) {
if (!error) return;
console.log('Warning: ignored V8 debugger error. %s', error);
};
}
// Note: we must not add args object if it was not sent.
// E.g. resume (V8 request 'continue') does no work
// correctly when args are empty instead of undefined
if (args && args.maxStringLength == null && command !== 'continue')
args.maxStringLength = -1;
this._conn.request(command, { arguments: args }, function(response) {
var refsLookup;
if (!response.success)
callback(response.message);
else {
refsLookup = {};
if (response.refs)
response.refs.forEach(function(r) { refsLookup[r.handle] = r; });
callback(null, response.body, refsLookup);
}
});
};
/**
*/
DebuggerClient.prototype.close = function() {
if (this.isConnected)
this._conn.close();
else
this.emit('close');
};
/**
* @param {number} breakpointId
* @param {function(error, response, refs)} done
*/
DebuggerClient.prototype.clearBreakpoint = function(breakpointId, done) {
this.request(
'clearbreakpoint',
{
breakpoint: breakpointId
},
done
);
};
/**
* @param {string} expression
* @param {function(error, response)} done
*/
DebuggerClient.prototype.evaluateGlobal = function(expression, done) {
this.request(
'evaluate',
{
expression: 'JSON.stringify(' + expression + ')',
global: true
},
function _handleEvaluateResponse(err, result) {
done(err, JSON.parse(result.value));
}
);
};
/**
* @param {string} message
* @constructor
*/
function ErrorNotConnected(message) {
Error.call(this);
this.name = ErrorNotConnected.name;
this.message = message;
}
inherits(ErrorNotConnected, Error);
exports.DebuggerClient = DebuggerClient;
exports.ErrorNotConnected = ErrorNotConnected;
| liyun074/gooDay | node_modules/node-inspector/lib/DebuggerClient.js | JavaScript | apache-2.0 | 4,898 |
(function () {
'use strict';
// module definition
stockModule.factory("reactiveFactory", function reactiveFactory() {
return {
// Execute an action after a period of time without calls
getThrottle: _createThrottle
};
function _createThrottle(delay) {
var throttleTimer = null;
var throttleDelay = delay;
if (!throttleDelay) {
// use default value 250ms
throttleDelay = 250;
}
return {
run: function(action) {
return function() {
clearTimeout(throttleTimer);
throttleTimer = setTimeout(function() {
// execute action
action.apply();
// dispose timer
throttleTimer = null;
}, throttleDelay);
}();
}
};
}
});
})();
| Ryuno-Ki/angularjs-crudgrid | Items.Web/app/reactive-factory.js | JavaScript | apache-2.0 | 1,056 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.