code
stringlengths 2
1.05M
|
---|
/**
* @license Highstock JS v8.0.4 (2020-03-10)
* @module highcharts/indicators/price-envelopes
* @requires highcharts
* @requires highcharts/modules/stock
*
* Indicator series type for Highstock
*
* (c) 2010-2019 Paweł Fus
*
* License: www.highcharts.com/license
*/
'use strict';
import '../../indicators/price-envelopes.src.js';
|
/**! Qoopido.demand 6.0.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */
!function(n){"use strict";provide(["path","/demand/function/iterate","/demand/validator/isObject","/demand/validator/isTypeOf"],(function(t,e,o,i){var a,c="Thu, 01 Jan 1970 00:00:00 GMT",r=[];function u(t,e,o){(a||function(n){for(var t,e,o=0;t=r[o];o++)0===n.indexOf(t.pattern)&&(!e||t.weight>e.weight)&&(e=t);return!!e&&e.state}(t.path))&&(n.cookie="demand["+t.type+"]["+t.path+"]="+encodeURIComponent(e)+"; expires="+o+"; path=/")}return demand.on("postConfigure:"+t,(function(n){o(n)?(r.length=0,e(n,(function(n,t){r.push({pattern:n,weight:n.length,state:t})}))):i(n,"boolean")&&(a=n)})).on("cacheMiss",(function(n){u(n,"",c)})).on("cacheClear",(function(n){u(n,"",c)})).on("postCache",(function(n,t){u(n,JSON.stringify(t),"Fri, 31 Dec 9999 23:59:59 GMT")})),!0}))}(document);
//# sourceMappingURL=cookie.js.map
|
/*
Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang("easyimage","sr-latn",{commands:{fullImage:"Slika u punoj veličini",sideImage:"Slika sa strane",altText:"Izmena alternativnog teksta",upload:"Postavljanje fotografije"},uploadFailed:"Slika se ne može postaviti zbog greške u mreži"});
|
'use strict';
angular.module('copayApp.controllers').controller('createController',
function($scope, $rootScope, $location, $timeout, $log, lodash, go, profileService, configService, isMobile, isCordova, gettext) {
var self = this;
var defaults = configService.getDefaults();
this.isWindowsPhoneApp = isMobile.Windows() && isCordova;
/* For compressed keys, m*73 + n*34 <= 496 */
var COPAYER_PAIR_LIMITS = {
1: 1,
2: 2,
3: 3,
4: 4,
5: 4,
6: 4,
7: 3,
8: 3,
9: 2,
10: 2,
11: 1,
12: 1,
};
// ng-repeat defined number of times instead of repeating over array?
this.getNumber = function(num) {
return new Array(num);
}
var updateRCSelect = function(n) {
$scope.totalCopayers = n;
var maxReq = COPAYER_PAIR_LIMITS[n];
self.RCValues = lodash.range(1, maxReq + 1);
$scope.requiredCopayers = Math.min(parseInt(n / 2 + 1), maxReq);
};
this.TCValues = lodash.range(2, defaults.limits.totalCopayers + 1);
$scope.totalCopayers = defaults.wallet.totalCopayers;
this.setTotalCopayers = function(tc) {
updateRCSelect(tc);
};
this.create = function(form) {
if (form && form.$invalid) {
this.error = gettext('Please enter the required fields');
return;
}
var opts = {
m: $scope.requiredCopayers,
n: $scope.totalCopayers,
name: form.walletName.$modelValue,
extendedPrivateKey: form.privateKey.$modelValue,
myName: $scope.totalCopayers > 1 ? form.myName.$modelValue : null,
networkName: form.isTestnet.$modelValue ? 'testnet' : 'livenet'
};
self.loading = true;
$timeout(function() {
profileService.createWallet(opts, function(err, secret) {
self.loading = false;
if (err) {
$log.debug(err);
self.error = err;
}
else {
go.walletHome();
}
});
}, 100);
};
this.formFocus = function(what) {
if (!this.isWindowsPhoneApp) return
if (what && what == 'my-name') {
this.hideWalletName = true;
this.hideTabs = true;
}
else if (what && what == 'wallet-name'){
this.hideTabs = true;
}
else {
this.hideWalletName = false;
this.hideTabs = false;
}
$timeout(function() {
$rootScope.$digest();
}, 1);
};
$scope.$on("$destroy", function() {
$rootScope.hideWalletNavigation = false;
});
});
|
// This class holds the states of the the Pressure config
var Config = {
// 'false' will make polyfill not run when pressure is not supported and the 'unsupported' method will be called
polyfill: true,
// milliseconds it takes to go from 0 to 1 for the polyfill
polyfillSpeedUp: 1000,
// milliseconds it takes to go from 1 to 0 for the polyfill
polyfillSpeedDown: 0,
// 'true' prevents the selecting of text and images via css properties
preventSelect: true,
// 'touch', 'mouse', or 'pointer' will make it run only on that type of device
only: null,
// this will get the correct config / option settings for the current pressure check
get(option, options) {
return options.hasOwnProperty(option) ? options[option] : this[option];
},
// this will set the global configs
set(options) {
for (var k in options) {
if (options.hasOwnProperty(k) && this.hasOwnProperty(k) && k != 'get' && k != 'set') {
this[k] = options[k];
}
}
}
}
|
var infos = {
check: function () {
return window.bright && window.bright.debug && window.bright.debug.modules;
},
inspectHost: function () {
return window.location.host;
},
loadedpacket: function () {
var n = $.debug.modules.mapping, a = [];
for (var i in n) {
a.push(i);
}
return {
packets: a
};
},
getMethods: function (name) {
var n = $.debug.modules.mapping, adapt = null, r = [];
for (var i in n) {
if (i === name) {
adapt = n[i];
}
}
for (var i in adapt.prototype) {
r.push(adapt.prototype[i]);
}
return r;
},
getAdaptInfo: function (name) {
var n = $.debug.modules.mapping, adapt = null, r = {
extendlink: []
};
for (var i in n) {
if (i === name) {
adapt = n[i];
}
}
if (adapt) {
var inx = adapt.prototype.__adapt__;
r.extendlink = inx._extendslink;
r.mapping = [];
r.packet = inx._packet||"''";
r.tagName = adapt.prototype.tagName||"''";
r.className = adapt.prototype.className||"''";
r.fullClassName=adapt.prototype.fullClassName||"''";
r.parent = inx._parent||"''";
r.shortName = inx._shortName||"''";
r.option = [];
r.methods = [];
r.privator = [];
r.staticor = [];
for (var i in inx._private) {
r.privator.push(i);
}
for (var i in inx._static) {
r.staticor.push(i);
}
for (var i in inx._mapping) {
if (inx._extendslink.indexOf(i) === -1) {
r.mapping.push(i);
}
}
if (inx._factory) {
for (var i = inx._extendslink.length - 1; i > 0; i--) {
var n = inx._factory.get(inx._extendslink[i]), m = [];
if (n) {
for (var t in n.prototype.__adapt__._instance_props) {
var k = n.prototype.__adapt__._instance_props[t];
if ($.is.isFunction(n.prototype[k])) {
k = k + " " + n.prototype[k].toString().match(/function\s*([^(]*)\(.*\)/)[0].substring(9);
}
m.push(k);
}
r.methods.push({
name: inx._extendslink[i],
is: "parent",
props: m
});
}
}
for (var i in r.mapping) {
var n = inx._factory.get(r.mapping[i]), m = [];
if (n) {
for (var t in n.prototype.__adapt__._instance_props) {
var k = n.prototype.__adapt__._instance_props[t];
if ($.is.isFunction(n.prototype[k])) {
k = k + " " + n.prototype[k].toString().match(/function\s*([^(]*)\(.*\)/)[0].substring(9);
}
m.push(k);
}
r.methods.push({
name: r.mapping[i],
is: "multi",
props: m
});
}
}
var n = inx._factory.get(inx._extendslink[0]), m = [];
if (n) {
for (var t in n.prototype.__adapt__._instance_props) {
var k = n.prototype.__adapt__._instance_props[t];
if ($.is.isFunction(n.prototype[k])) {
k = k + " " + n.prototype[k].toString().match(/function\s*([^(]*)\(.*\)/)[0].substring(9);
}
m.push(k);
}
r.methods.push({
name: inx._extendslink[0],
is: "self",
props: m
});
}
for (var i = inx._extendslink.length - 1; i > 0; i--) {
var n = inx._factory.get(inx._extendslink[i]), m = [], q = [], qq = [];
if (n) {
r.option.push({
name: inx._extendslink[i],
is: "parent",
props: n.prototype.__adapt__._original_option
});
}
}
for (var i in r.mapping) {
var n = inx._factory.get(r.mapping[i]), m = [], q = [], qq = [];
if (n) {
r.option.push({
name: r.mapping[i],
is: "multi",
props: n.prototype.__adapt__._original_option
});
}
}
var n = inx._factory.get(inx._extendslink[0]), m = [], q = [], qq = [];
if (n) {
r.option.push({
name: inx._extendslink[0],
is: "self",
props: n.prototype.__adapt__._original_option
});
}
} else {
r.methods.push({
name: "adapt",
is: "self",
props: $.debug.modules.mapping["adapt"].prototype.__adapt__._instance_props
});
}
}
return r;
},
getOptionList: function () {
var a = $.debug.options, r = [];
for (var i in a) {
r.push(i);
}
return r;
},
getRequireList: function () {
var a=$.debug.require,b={};
for(var i in a){
for(var t in a[i]){
b[i]="";
break;
}
}
return b;
},
getRequire: function (name) {
var a = $.debug.require[name];
if (a) {
return a;
} else {
return {};
}
},
getDomList: function () {
return $.debug.doms;
},
getDom: function (name) {
var a = $.debug.doms[name];
if (a) {
return a;
} else {
return "";
}
},
getOption: function (name) {
var a = $.debug.options[name];
if (a) {
return a;
} else {
return {};
}
},
getPacketList: function () {
return $.debug.resource;
},
getJSONList:function(){
return $.debug.json;
},
getJSON:function(name){
return $.debug.json[name];
},
reloadCss: function () {
$("link").each(function () {
$(this).attr("href", $(this).attr("href").split("?")[0] + "?reload=" + Math.round(Math.random() * 1000000000));
});
},
reloadPreCss: function (css) {
var dstr = "<div id='___brighttoolkit___' style='" +
"-webkit-box-shadow:0 0 15px #00A185;font-family: proxima-nova,Helvetica, Arial, sans-serif;" +
"background:#24D0AE;color:black;line-height:25px;padding:0 10px 0 10px;border-top:1px solid #00A185;" +
"-webkit-transition:all .5s ease-out;" +
"font-size:12px;position:fixed;left:0;right:0;bottom:0;" +
"'><i class='fa fa-refresh fa-spin'></i> BrightToolkit:Loading Css...</div>";
var loadingbar = $(dstr).appendTo("body"),has=false;
$("link").each(function () {
var a = $(this).attr("href").split("?")[0];
if (a === css) {
has=true;
$(this).remove();
$("<link href='"+a+ "?reload=" + Math.round(Math.random() * 1000000000)+"' type='text/css' rel='stylesheet'>").bind("load",function(){
loadingbar.html("BrightToolkit:File loaded");
setTimeout(function () {
loadingbar.bind("webkitTransitionEnd", function () {
loadingbar.remove();
}).css("bottom", "-25px");
}, 2000);
}).appendTo("head");
}
});
if(!has){
loadingbar.remove();
}
},
reloadPreJs: function (js) {
var dstr = "<div id='___brighttoolkit___' style='" +
"-webkit-box-shadow:0 0 15px #00A185;font-family: proxima-nova,Helvetica, Arial, sans-serif;" +
"background:#24D0AE;color:black;line-height:25px;padding:0 10px 0 10px;border-top:1px solid #00A185;" +
"-webkit-transition:all .5s ease-out;z-index:999999999;" +
"font-size:12px;position:fixed;left:0;right:0;bottom:0;" +
"'><i class='fa fa-refresh fa-spin'></i> BrightToolkit:Loading Javascript...</div>";
var loadingbar = $(dstr).appendTo("body");
$.ajax({
url: js,
dataType: "text",
success: function (str) {
loadingbar.html("BrightToolkit:File loaded");
setTimeout(function () {
loadingbar.bind("webkitTransitionEnd", function () {
loadingbar.remove();
}).css("bottom", "-25px");
}, 2000);
var packet = {
isNote: /\/\*[\w\W]*?\*\//,
isInfo: /@([\s\S]*?);/g,
isPacketTag: /[",\']@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*[",\']/g,
isCurrentTag: /[",\']@\.[A-Za-z0-9_-]*[",\']/g
};
var a = str.match(packet.isNote), n = {"_packets_": {}, "packet": "", require: [], css: []};
if (a && a.length > 0) {
var b = a[0];
b.match(packet.isInfo).forEach(function (a) {
var d = a.split(" ");
if (d.length >= 2) {
var key = d[0].substring(1, d[0].length), value = d[1].substring(0, d[1].length - 1);
if (key === "require") {
var t = value.split(":");
if (t.length > 1) {
if (n._packets_[t[1]]) {
console.info("[packet] maybe the packet with name of " + n.packet + " contain duplicate packet shortname,it is " + t[1]);
}
n._packets_[t[1]] = t[0];
} else {
var m = t[0].split("\.");
if (n._packets_[m[m.length - 1]]) {
console.info("[packet] maybe the packet with name of " + n.packet + " contain duplicate packet shortname,it is " + m[m.length - 1]);
}
n._packets_[m[m.length - 1]] = t[0];
}
value = js;
} else if (key === "css") {
value = "";
} else if (key === "packet") {
n.packet = value;
} else {
n[key] = value;
}
n["path"] = js;
if (n[key]) {
if (n[key].indexOf(value) === -1) {
n[key].push(value);
}
}
}
});
} else {
console.info("======file has no packet note=========");
}
str = str.replace(packet.isPacketTag, function (str) {
var a = str.split("\."), index = 0, key = a[1].substring(0, a[1].length - 1), index = a[0].substring(2);
if (n._packets_[index]) {
return "\"" + n._packets_[index] + "." + key + "\"";
} else {
throw Error("[packet] packet can not find with tag of " + str + ",packet is " + n.packet);
}
}).replace(packet.isCurrentTag, function (str) {
return "\"" + n.packet + "." + str.split("\.")[1];
});
var xcode = "//# sourceURL=" + js + "\r\n$.___info=info;\r\n" + str + "\r\n$.___info=null;";
try {
(new Function("info", "$", xcode))(n, packet);
} catch (e) {
packet.___info = null;
console.error(e.stack);
}
}
});
}
};
window.getInspectInfo = function (type, data, fnx) {
var fn = infos[type];
chrome.devtools.inspectedWindow.eval("(" + fn.toString() + ")('" + (data || "") + "')", fnx);
};
|
var common = require('./common');
var airbrake = require(common.dir.root).createClient(common.projectId, common.key, 'production');
var sinon = require('sinon');
var assert = require('assert');
var nock = require('nock');
nock.disableNetConnect();
var err = new Error('Node.js just totally exploded on me');
err.env = { protect: 'the environment!' };
err.session = { iKnow: 'what you did last minute' };
err.url = 'http://example.org/bad-url';
var circular = {};
circular.circular = circular;
err.params = { some: 'params', circular: circular };
airbrake.on('vars', function(type, vars) {
/* eslint no-param-reassign: 0 */
delete vars.SECRET;
});
var spy = sinon.spy();
var endpoint = nock('https://api.airbrake.io').
post('/api/v3/projects/' + common.projectId + '/notices?key=' + common.key).
reply(201, '{"url":"https://airbrake.io/locate/123"}');
airbrake.notify(err, spy);
process.on('exit', function() {
assert.ok(spy.called);
endpoint.done();
var error = spy.args[0][0];
if (error) {
throw error;
}
var url = spy.args[0][1];
assert.ok(/^https?:\/\//.test(url));
});
|
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _mongoose=require('mongoose');var _mongoose2=_interopRequireDefault(_mongoose);var _mongooseTimestamp=require('mongoose-timestamp');var _mongooseTimestamp2=_interopRequireDefault(_mongooseTimestamp);var _mongooseDeepPopulate=require('mongoose-deep-populate');var _mongooseDeepPopulate2=_interopRequireDefault(_mongooseDeepPopulate);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var Schema=_mongoose2.default.Schema;var CommentSchema=new Schema({author:{type:Schema.Types.ObjectId,ref:'User'},post:{type:Schema.Types.ObjectId,ref:'Post'},content:{type:String,required:true}});CommentSchema.plugin(_mongooseTimestamp2.default);CommentSchema.plugin((0,_mongooseDeepPopulate2.default)(_mongoose2.default));exports.default=_mongoose2.default.model('Comment',CommentSchema);
|
"use strict";
const regexEscape = require("regex-escape")
, typpy = require("typpy")
, iterateObject = require("iterate-object")
;
/**
* barbe
* Renders the input template including the data.
*
* @name barbe
* @function
* @param {String} text The template text.
* @param {Array} arr An array of two elements: the first one being the start snippet (default: `"{"`) and the second one being the end snippet (default: `"}"`).
* @param {Object} data The template data.
* @return {String} The rendered template.
*/
function barbe(text, arr, data) {
if (!Array.isArray(arr)) {
data = arr;
arr = ["{", "}"];
}
if (!data || data.constructor !== Object) {
return text;
}
arr = arr.map(regexEscape);
let deep = (obj, path) => {
iterateObject(obj, (value, c) => {
path.push(c);
if (typpy(value, Object)) {
deep(value, path);
path.pop();
return;
}
text = text.replace(
new RegExp(arr[0] + path.join(".") + arr[1], "gm")
, typpy(value, Function) ? value : String(value)
);
path.pop();
});
};
deep(data, []);
return text;
}
module.exports = barbe;
|
'use strict';
const filter = new MetadataFilter({ all: trimSpaces });
const filterRules = [
{ source: /\t/g, target: ' ' },
{ source: /\n/g, target: ' ' },
{ source: /\s+/g, target: ' ' },
];
Connector.playerSelector = '#app';
Connector.artistSelector = '.player-song-artist';
Connector.trackSelector = '.player-song-title';
Connector.isPlaying = () => {
return $('#audio-player').attr('src') !== undefined;
};
Connector.applyFilter(filter);
function trimSpaces(text) {
return MetadataFilter.filterWithFilterRules(text, filterRules);
}
|
import accountActions from '../../constants/account';
export default function fetchAccountDetails(context, payload, done) {
context.dispatch(accountActions.ACCOUNT_FETCH);
context.api.account.get().then(function successFn(result) {
context.dispatch(accountActions.ACCOUNT_FETCH_SUCCESS, result);
done && done();
}, function errorFn(err) {
context.dispatch(accountActions.ACCOUNT_FETCH_ERROR, err.result);
done && done();
});
}
|
/*
* 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';
const models = require('./index');
/**
* Refresh Index Response.
*
*/
class RefreshIndex {
/**
* Create a RefreshIndex.
* @member {string} [contentSourceId] Content source Id.
* @member {boolean} [isUpdateSuccess] Update success status.
* @member {array} [advancedInfo] Advanced info list.
* @member {object} [status] Refresh index status.
* @member {number} [status.code] Status code.
* @member {string} [status.description] Status description.
* @member {string} [status.exception] Exception status.
* @member {string} [trackingId] Tracking Id.
*/
constructor() {
}
/**
* Defines the metadata of RefreshIndex
*
* @returns {object} metadata of RefreshIndex
*
*/
mapper() {
return {
required: false,
serializedName: 'RefreshIndex',
type: {
name: 'Composite',
className: 'RefreshIndex',
modelProperties: {
contentSourceId: {
required: false,
serializedName: 'ContentSourceId',
type: {
name: 'String'
}
},
isUpdateSuccess: {
required: false,
serializedName: 'IsUpdateSuccess',
type: {
name: 'Boolean'
}
},
advancedInfo: {
required: false,
serializedName: 'AdvancedInfo',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'RefreshIndexAdvancedInfoItemElementType',
type: {
name: 'Composite',
className: 'RefreshIndexAdvancedInfoItem'
}
}
}
},
status: {
required: false,
serializedName: 'Status',
type: {
name: 'Composite',
className: 'Status'
}
},
trackingId: {
required: false,
serializedName: 'TrackingId',
type: {
name: 'String'
}
}
}
}
};
}
}
module.exports = RefreshIndex;
|
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Broad Institute
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
var igvxhr = (function (igvxhr) {
// Compression types
const NONE = 0;
const GZIP = 1;
const BGZF = 2;
igvxhr.load = function (url, options) {
if (!options) options = {};
return new Promise(function (fulfill, reject) {
var xhr = new XMLHttpRequest(),
sendData = options.sendData,
method = options.method || (sendData ? "POST" : "GET"),
range = options.range,
responseType = options.responseType,
contentType = options.contentType,
mimeType = options.mimeType,
headers = options.headers,
isSafari = navigator.vendor.indexOf("Apple") == 0 && /\sSafari\//.test(navigator.userAgent),
withCredentials = options.withCredentials,
header_keys, key, value, i;
// Support for GCS paths.
url = url.startsWith("gs://") ? igv.Google.translateGoogleCloudURL(url) : url;
if (igv.Google.isGoogleURL(url)) {
url = igv.Google.addApiKey(url);
// Add google headers (e.g. oAuth)
headers = headers || {};
igv.Google.addGoogleHeaders(headers);
// Hack to prevent caching for google storage files. Get weird net:err-cache errors otherwise
if (range) {
url += url.includes("?") ? "&" : "?";
url += "someRandomSeed=" + Math.random().toString(36);
}
}
xhr.open(method, url);
if (range) {
var rangeEnd = range.size ? range.start + range.size - 1 : "";
xhr.setRequestHeader("Range", "bytes=" + range.start + "-" + rangeEnd);
}
if (contentType) {
xhr.setRequestHeader("Content-Type", contentType);
}
if (mimeType) {
xhr.overrideMimeType(mimeType);
}
if (responseType) {
xhr.responseType = responseType;
}
if (headers) {
header_keys = Object.keys(headers);
for (i = 0; i < header_keys.length; i++) {
key = header_keys[i];
value = headers[key];
// console.log("Adding to header: " + key + "=" + value);
xhr.setRequestHeader(key, value);
}
}
// NOTE: using withCredentials with servers that return "*" for access-allowed-origin will fail
if (withCredentials === true) {
xhr.withCredentials = true;
}
xhr.onload = function (event) {
// when the url points to a local file, the status is 0 but that is no error
if (xhr.status == 0 || (xhr.status >= 200 && xhr.status <= 300)) {
if (range && xhr.status != 206) {
handleError("ERROR: range-byte header was ignored for url: " + url);
}
else {
fulfill(xhr.response, xhr);
}
}
else {
//
if (xhr.status === 416) {
// Tried to read off the end of the file. This shouldn't happen, but if it does return an
handleError("Unsatisfiable range");
}
else {// TODO -- better error handling
handleError("Error accessing resource: " + xhr.status);
}
}
};
xhr.onerror = function (event) {
if (isCrossDomain(url) && url && !options.crossDomainRetried && igv.browser.crossDomainProxy &&
url != igv.browser.crossDomainProxy) {
options.sendData = "url=" + url;
options.crossDomainRetried = true;
igvxhr.load(igv.browser.crossDomainProxy, options).then(fulfill);
}
else {
handleError("Error accessing resource: " + url + " Status: " + xhr.status);
}
}
xhr.ontimeout = function (event) {
handleError("Timed out");
};
xhr.onabort = function (event) {
console.log("Aborted");
reject(new igv.AbortLoad());
};
try {
xhr.send(sendData);
} catch (e) {
console.log(e);
}
function handleError(message) {
if (reject) {
reject(message);
}
else {
throw Error(message);
}
}
});
}
igvxhr.loadArrayBuffer = function (url, options) {
if (options === undefined) options = {};
options.responseType = "arraybuffer";
return igvxhr.load(url, options);
};
igvxhr.loadJson = function (url, options) {
var method = options.method || (options.sendData ? "POST" : "GET");
if (method == "POST") options.contentType = "application/json";
return new Promise(function (fulfill, reject) {
igvxhr.load(url, options).then(
function (result) {
if (result) {
fulfill(JSON.parse(result));
}
else {
fulfill(result);
}
}).catch(reject);
})
}
/**
* Load a "raw" string.
*/
igvxhr.loadString = function (url, options) {
var compression, fn, idx;
if (options === undefined) options = {};
// Strip parameters from url
// TODO -- handle local files with ?
idx = url.indexOf("?");
fn = idx > 0 ? url.substring(0, idx) : url;
if (options.bgz) {
compression = BGZF;
}
else if (fn.endsWith(".gz")) {
compression = GZIP;
}
else {
compression = NONE;
}
if (compression === NONE) {
options.mimeType = 'text/plain; charset=x-user-defined';
return igvxhr.load(url, options);
}
else {
options.responseType = "arraybuffer";
return new Promise(function (fulfill, reject) {
igvxhr.load(url, options).then(
function (data) {
var result = igvxhr.arrayBufferToString(data, compression);
fulfill(result);
}).catch(reject)
})
}
};
igvxhr.loadStringFromFile = function (localfile, options) {
return new Promise(function (fulfill, reject) {
var fileReader = new FileReader(),
range = options.range;
fileReader.onload = function (e) {
var compression, result;
if (options.bgz) {
compression = BGZF;
}
else if (localfile.name.endsWith(".gz")) {
compression = GZIP;
}
else {
compression = NONE;
}
result = igvxhr.arrayBufferToString(fileReader.result, compression);
fulfill(result, localfile);
};
fileReader.onerror = function (e) {
console.log("reject uploading local file " + localfile.name);
reject(null, fileReader);
};
fileReader.readAsArrayBuffer(localfile);
});
}
function isCrossDomain(url) {
var origin = window.location.origin;
return !url.startsWith(origin);
}
igvxhr.arrayBufferToString = function (arraybuffer, compression) {
var plain, inflate;
if (compression === GZIP) {
inflate = new Zlib.Gunzip(new Uint8Array(arraybuffer));
plain = inflate.decompress();
}
else if (compression === BGZF) {
plain = new Uint8Array(igv.unbgzf(arraybuffer));
}
else {
plain = new Uint8Array(arraybuffer);
}
var result = "";
for (var i = 0, len = plain.length; i < len; i++) {
result = result + String.fromCharCode(plain[i]);
}
return result;
};
igv.AbortLoad = function () {
}
return igvxhr;
})
(igvxhr || {});
|
/* ========================================================================
* Bootstrap: alert.js v3.1.0
* http://getbootstrap.com/javascript/#alerts
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// ALERT CLASS DEFINITION
// ======================
var dismiss = '[data-dismiss="alert"]'
var Alert = function (el) {
$(el).on('click', dismiss, this.close)
}
Alert.prototype.close = function (e) {
var $this = $(this)
var selector = $this.attr('data-target')
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}
var $parent = $(selector)
if (e) e.preventDefault()
if (!$parent.length) {
$parent = $this.hasClass('alert') ? $this : $this.parent()
}
$parent.trigger(e = $.Event('close.bs.alert'))
if (e.isDefaultPrevented()) return
$parent.removeClass('in')
function removeElement() {
$parent.trigger('closed.bs.alert').remove()
}
$.support.transition && $parent.hasClass('fade') ?
$parent
.one($.support.transition.end, removeElement)
.emulateTransitionEnd(150) :
removeElement()
}
// ALERT PLUGIN DEFINITION
// =======================
var old = $.fn.alert
$.fn.alert = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.alert')
if (!data) $this.data('bs.alert', (data = new Alert(this)))
if (typeof option == 'string') data[option].call($this)
})
}
$.fn.alert.Constructor = Alert
// ALERT NO CONFLICT
// =================
$.fn.alert.noConflict = function () {
$.fn.alert = old
return this
}
// ALERT DATA-API
// ==============
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
}(jQuery);
/* ========================================================================
* Bootstrap: button.js v3.1.0
* http://getbootstrap.com/javascript/#buttons
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// BUTTON PUBLIC CLASS DEFINITION
// ==============================
var Button = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, Button.DEFAULTS, options)
this.isLoading = false
}
Button.DEFAULTS = {
loadingText: 'loading...'
}
Button.prototype.setState = function (state) {
var d = 'disabled'
var $el = this.$element
var val = $el.is('input') ? 'val' : 'html'
var data = $el.data()
state = state + 'Text'
if (!data.resetText) $el.data('resetText', $el[val]())
$el[val](data[state] || this.options[state])
// push to event loop to allow forms to submit
setTimeout($.proxy(function () {
if (state == 'loadingText') {
this.isLoading = true
$el.addClass(d).attr(d, d)
} else if (this.isLoading) {
this.isLoading = false
$el.removeClass(d).removeAttr(d)
}
}, this), 0)
}
Button.prototype.toggle = function () {
var changed = true
var $parent = this.$element.closest('[data-toggle="buttons"]')
if ($parent.length) {
var $input = this.$element.find('input')
if ($input.prop('type') == 'radio') {
if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
else $parent.find('.active').removeClass('active')
}
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
}
if (changed) this.$element.toggleClass('active')
}
// BUTTON PLUGIN DEFINITION
// ========================
var old = $.fn.button
$.fn.button = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.button')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.button', (data = new Button(this, options)))
if (option == 'toggle') data.toggle()
else if (option) data.setState(option)
})
}
$.fn.button.Constructor = Button
// BUTTON NO CONFLICT
// ==================
$.fn.button.noConflict = function () {
$.fn.button = old
return this
}
// BUTTON DATA-API
// ===============
$(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
var $btn = $(e.target)
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
$btn.button('toggle')
e.preventDefault()
})
}(jQuery);
/* ========================================================================
* Bootstrap: carousel.js v3.1.0
* http://getbootstrap.com/javascript/#carousel
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// CAROUSEL CLASS DEFINITION
// =========================
var Carousel = function (element, options) {
this.$element = $(element)
this.$indicators = this.$element.find('.carousel-indicators')
this.options = options
this.paused =
this.sliding =
this.interval =
this.$active =
this.$items = null
this.options.pause == 'hover' && this.$element
.on('mouseenter', $.proxy(this.pause, this))
.on('mouseleave', $.proxy(this.cycle, this))
}
Carousel.DEFAULTS = {
interval: 5000,
pause: 'hover',
wrap: true
}
Carousel.prototype.cycle = function (e) {
e || (this.paused = false)
this.interval && clearInterval(this.interval)
this.options.interval
&& !this.paused
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
return this
}
Carousel.prototype.getActiveIndex = function () {
this.$active = this.$element.find('.item.active')
this.$items = this.$active.parent().children()
return this.$items.index(this.$active)
}
Carousel.prototype.to = function (pos) {
var that = this
var activeIndex = this.getActiveIndex()
if (pos > (this.$items.length - 1) || pos < 0) return
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
if (activeIndex == pos) return this.pause().cycle()
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
}
Carousel.prototype.pause = function (e) {
e || (this.paused = true)
if (this.$element.find('.next, .prev').length && $.support.transition) {
this.$element.trigger($.support.transition.end)
this.cycle(true)
}
this.interval = clearInterval(this.interval)
return this
}
Carousel.prototype.next = function () {
if (this.sliding) return
return this.slide('next')
}
Carousel.prototype.prev = function () {
if (this.sliding) return
return this.slide('prev')
}
Carousel.prototype.slide = function (type, next) {
var $active = this.$element.find('.item.active')
var $next = next || $active[type]()
var isCycling = this.interval
var direction = type == 'next' ? 'left' : 'right'
var fallback = type == 'next' ? 'first' : 'last'
var that = this
if (!$next.length) {
if (!this.options.wrap) return
$next = this.$element.find('.item')[fallback]()
}
if ($next.hasClass('active')) return this.sliding = false
var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
this.sliding = true
isCycling && this.pause()
if (this.$indicators.length) {
this.$indicators.find('.active').removeClass('active')
this.$element.one('slid.bs.carousel', function () {
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
$nextIndicator && $nextIndicator.addClass('active')
})
}
if ($.support.transition && this.$element.hasClass('slide')) {
$next.addClass(type)
$next[0].offsetWidth // force reflow
$active.addClass(direction)
$next.addClass(direction)
$active
.one($.support.transition.end, function () {
$next.removeClass([type, direction].join(' ')).addClass('active')
$active.removeClass(['active', direction].join(' '))
that.sliding = false
setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
})
.emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
} else {
$active.removeClass('active')
$next.addClass('active')
this.sliding = false
this.$element.trigger('slid.bs.carousel')
}
isCycling && this.cycle()
return this
}
// CAROUSEL PLUGIN DEFINITION
// ==========================
var old = $.fn.carousel
$.fn.carousel = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.carousel')
var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
var action = typeof option == 'string' ? option : options.slide
if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
if (typeof option == 'number') data.to(option)
else if (action) data[action]()
else if (options.interval) data.pause().cycle()
})
}
$.fn.carousel.Constructor = Carousel
// CAROUSEL NO CONFLICT
// ====================
$.fn.carousel.noConflict = function () {
$.fn.carousel = old
return this
}
// CAROUSEL DATA-API
// =================
$(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
var $this = $(this), href
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
var options = $.extend({}, $target.data(), $this.data())
var slideIndex = $this.attr('data-slide-to')
if (slideIndex) options.interval = false
$target.carousel(options)
if (slideIndex = $this.attr('data-slide-to')) {
$target.data('bs.carousel').to(slideIndex)
}
e.preventDefault()
})
$(window).on('load', function () {
$('[data-ride="carousel"]').each(function () {
var $carousel = $(this)
$carousel.carousel($carousel.data())
})
})
}(jQuery);
/* ========================================================================
* Bootstrap: dropdown.js v3.1.0
* http://getbootstrap.com/javascript/#dropdowns
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// DROPDOWN CLASS DEFINITION
// =========================
var backdrop = '.dropdown-backdrop'
var toggle = '[data-toggle=dropdown]'
var Dropdown = function (element) {
$(element).on('click.bs.dropdown', this.toggle)
}
Dropdown.prototype.toggle = function (e) {
var $this = $(this)
if ($this.is('.disabled, :disabled')) return
var $parent = getParent($this)
var isActive = $parent.hasClass('open')
clearMenus()
if (!isActive) {
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
// if mobile we use a backdrop because click events don't delegate
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
}
var relatedTarget = { relatedTarget: this }
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
if (e.isDefaultPrevented()) return
$parent
.toggleClass('open')
.trigger('shown.bs.dropdown', relatedTarget)
$this.focus()
}
return false
}
Dropdown.prototype.keydown = function (e) {
if (!/(38|40|27)/.test(e.keyCode)) return
var $this = $(this)
e.preventDefault()
e.stopPropagation()
if ($this.is('.disabled, :disabled')) return
var $parent = getParent($this)
var isActive = $parent.hasClass('open')
if (!isActive || (isActive && e.keyCode == 27)) {
if (e.which == 27) $parent.find(toggle).focus()
return $this.click()
}
var desc = ' li:not(.divider):visible a'
var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)
if (!$items.length) return
var index = $items.index($items.filter(':focus'))
if (e.keyCode == 38 && index > 0) index-- // up
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
if (!~index) index = 0
$items.eq(index).focus()
}
function clearMenus(e) {
$(backdrop).remove()
$(toggle).each(function () {
var $parent = getParent($(this))
var relatedTarget = { relatedTarget: this }
if (!$parent.hasClass('open')) return
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
if (e.isDefaultPrevented()) return
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
})
}
function getParent($this) {
var selector = $this.attr('data-target')
if (!selector) {
selector = $this.attr('href')
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
var $parent = selector && $(selector)
return $parent && $parent.length ? $parent : $this.parent()
}
// DROPDOWN PLUGIN DEFINITION
// ==========================
var old = $.fn.dropdown
$.fn.dropdown = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.dropdown')
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
if (typeof option == 'string') data[option].call($this)
})
}
$.fn.dropdown.Constructor = Dropdown
// DROPDOWN NO CONFLICT
// ====================
$.fn.dropdown.noConflict = function () {
$.fn.dropdown = old
return this
}
// APPLY TO STANDARD DROPDOWN ELEMENTS
// ===================================
$(document)
.on('click.bs.dropdown.data-api', clearMenus)
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
.on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown)
}(jQuery);
/* ========================================================================
* Bootstrap: modal.js v3.1.0
* http://getbootstrap.com/javascript/#modals
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// MODAL CLASS DEFINITION
// ======================
var Modal = function (element, options) {
this.options = options
this.$element = $(element)
this.$backdrop =
this.isShown = null
if (this.options.remote) {
this.$element
.find('.modal-content')
.load(this.options.remote, $.proxy(function () {
this.$element.trigger('loaded.bs.modal')
}, this))
}
}
Modal.DEFAULTS = {
backdrop: true,
keyboard: true,
show: true
}
Modal.prototype.toggle = function (_relatedTarget) {
return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
}
Modal.prototype.show = function (_relatedTarget) {
var that = this
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
this.$element.trigger(e)
if (this.isShown || e.isDefaultPrevented()) return
this.isShown = true
this.escape()
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
this.backdrop(function () {
var transition = $.support.transition && that.$element.hasClass('fade')
if (!that.$element.parent().length) {
that.$element.appendTo(document.body) // don't move modals dom position
}
that.$element
.show()
.scrollTop(0)
if (transition) {
that.$element[0].offsetWidth // force reflow
}
that.$element
.addClass('in')
.attr('aria-hidden', false)
that.enforceFocus()
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
transition ?
that.$element.find('.modal-dialog') // wait for modal to slide in
.one($.support.transition.end, function () {
that.$element.focus().trigger(e)
})
.emulateTransitionEnd(300) :
that.$element.focus().trigger(e)
})
}
Modal.prototype.hide = function (e) {
if (e) e.preventDefault()
e = $.Event('hide.bs.modal')
this.$element.trigger(e)
if (!this.isShown || e.isDefaultPrevented()) return
this.isShown = false
this.escape()
$(document).off('focusin.bs.modal')
this.$element
.removeClass('in')
.attr('aria-hidden', true)
.off('click.dismiss.bs.modal')
$.support.transition && this.$element.hasClass('fade') ?
this.$element
.one($.support.transition.end, $.proxy(this.hideModal, this))
.emulateTransitionEnd(300) :
this.hideModal()
}
Modal.prototype.enforceFocus = function () {
$(document)
.off('focusin.bs.modal') // guard against infinite focus loop
.on('focusin.bs.modal', $.proxy(function (e) {
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
this.$element.focus()
}
}, this))
}
Modal.prototype.escape = function () {
if (this.isShown && this.options.keyboard) {
this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
e.which == 27 && this.hide()
}, this))
} else if (!this.isShown) {
this.$element.off('keyup.dismiss.bs.modal')
}
}
Modal.prototype.hideModal = function () {
var that = this
this.$element.hide()
this.backdrop(function () {
that.removeBackdrop()
that.$element.trigger('hidden.bs.modal')
})
}
Modal.prototype.removeBackdrop = function () {
this.$backdrop && this.$backdrop.remove()
this.$backdrop = null
}
Modal.prototype.backdrop = function (callback) {
var animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.isShown && this.options.backdrop) {
var doAnimate = $.support.transition && animate
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.appendTo(document.body)
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
if (e.target !== e.currentTarget) return
this.options.backdrop == 'static'
? this.$element[0].focus.call(this.$element[0])
: this.hide.call(this)
}, this))
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
this.$backdrop.addClass('in')
if (!callback) return
doAnimate ?
this.$backdrop
.one($.support.transition.end, callback)
.emulateTransitionEnd(150) :
callback()
} else if (!this.isShown && this.$backdrop) {
this.$backdrop.removeClass('in')
$.support.transition && this.$element.hasClass('fade') ?
this.$backdrop
.one($.support.transition.end, callback)
.emulateTransitionEnd(150) :
callback()
} else if (callback) {
callback()
}
}
// MODAL PLUGIN DEFINITION
// =======================
var old = $.fn.modal
$.fn.modal = function (option, _relatedTarget) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.modal')
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
if (typeof option == 'string') data[option](_relatedTarget)
else if (options.show) data.show(_relatedTarget)
})
}
$.fn.modal.Constructor = Modal
// MODAL NO CONFLICT
// =================
$.fn.modal.noConflict = function () {
$.fn.modal = old
return this
}
// MODAL DATA-API
// ==============
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
var $this = $(this)
var href = $this.attr('href')
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
if ($this.is('a')) e.preventDefault()
$target
.modal(option, this)
.one('hide', function () {
$this.is(':visible') && $this.focus()
})
})
$(document)
.on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
.on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
}(jQuery);
/* ========================================================================
* Bootstrap: tooltip.js v3.1.0
* http://getbootstrap.com/javascript/#tooltip
* Inspired by the original jQuery.tipsy by Jason Frame
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// TOOLTIP PUBLIC CLASS DEFINITION
// ===============================
var Tooltip = function (element, options) {
this.type =
this.options =
this.enabled =
this.timeout =
this.hoverState =
this.$element = null
this.init('tooltip', element, options)
}
Tooltip.DEFAULTS = {
animation: true,
placement: 'top',
selector: false,
template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
trigger: 'hover focus',
title: '',
delay: 0,
html: false,
container: false
}
Tooltip.prototype.init = function (type, element, options) {
this.enabled = true
this.type = type
this.$element = $(element)
this.options = this.getOptions(options)
var triggers = this.options.trigger.split(' ')
for (var i = triggers.length; i--;) {
var trigger = triggers[i]
if (trigger == 'click') {
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
} else if (trigger != 'manual') {
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
}
}
this.options.selector ?
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
this.fixTitle()
}
Tooltip.prototype.getDefaults = function () {
return Tooltip.DEFAULTS
}
Tooltip.prototype.getOptions = function (options) {
options = $.extend({}, this.getDefaults(), this.$element.data(), options)
if (options.delay && typeof options.delay == 'number') {
options.delay = {
show: options.delay,
hide: options.delay
}
}
return options
}
Tooltip.prototype.getDelegateOptions = function () {
var options = {}
var defaults = this.getDefaults()
this._options && $.each(this._options, function (key, value) {
if (defaults[key] != value) options[key] = value
})
return options
}
Tooltip.prototype.enter = function (obj) {
var self = obj instanceof this.constructor ?
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
clearTimeout(self.timeout)
self.hoverState = 'in'
if (!self.options.delay || !self.options.delay.show) return self.show()
self.timeout = setTimeout(function () {
if (self.hoverState == 'in') self.show()
}, self.options.delay.show)
}
Tooltip.prototype.leave = function (obj) {
var self = obj instanceof this.constructor ?
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
clearTimeout(self.timeout)
self.hoverState = 'out'
if (!self.options.delay || !self.options.delay.hide) return self.hide()
self.timeout = setTimeout(function () {
if (self.hoverState == 'out') self.hide()
}, self.options.delay.hide)
}
Tooltip.prototype.show = function () {
var e = $.Event('show.bs.' + this.type)
if (this.hasContent() && this.enabled) {
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
var that = this;
var $tip = this.tip()
this.setContent()
if (this.options.animation) $tip.addClass('fade')
var placement = typeof this.options.placement == 'function' ?
this.options.placement.call(this, $tip[0], this.$element[0]) :
this.options.placement
var autoToken = /\s?auto?\s?/i
var autoPlace = autoToken.test(placement)
if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
$tip
.detach()
.css({ top: 0, left: 0, display: 'block' })
.addClass(placement)
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
var pos = this.getPosition()
var actualWidth = $tip[0].offsetWidth
var actualHeight = $tip[0].offsetHeight
if (autoPlace) {
var $parent = this.$element.parent()
var orgPlacement = placement
var docScroll = document.documentElement.scrollTop || document.body.scrollTop
var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth()
var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight()
var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left
placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' :
placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' :
placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' :
placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' :
placement
$tip
.removeClass(orgPlacement)
.addClass(placement)
}
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
this.applyPlacement(calculatedOffset, placement)
this.hoverState = null
var complete = function() {
that.$element.trigger('shown.bs.' + that.type)
}
$.support.transition && this.$tip.hasClass('fade') ?
$tip
.one($.support.transition.end, complete)
.emulateTransitionEnd(150) :
complete()
}
}
Tooltip.prototype.applyPlacement = function (offset, placement) {
var replace
var $tip = this.tip()
var width = $tip[0].offsetWidth
var height = $tip[0].offsetHeight
// manually read margins because getBoundingClientRect includes difference
var marginTop = parseInt($tip.css('margin-top'), 10)
var marginLeft = parseInt($tip.css('margin-left'), 10)
// we must check for NaN for ie 8/9
if (isNaN(marginTop)) marginTop = 0
if (isNaN(marginLeft)) marginLeft = 0
offset.top = offset.top + marginTop
offset.left = offset.left + marginLeft
// $.fn.offset doesn't round pixel values
// so we use setOffset directly with our own function B-0
$.offset.setOffset($tip[0], $.extend({
using: function (props) {
$tip.css({
top: Math.round(props.top),
left: Math.round(props.left)
})
}
}, offset), 0)
$tip.addClass('in')
// check to see if placing tip in new offset caused the tip to resize itself
var actualWidth = $tip[0].offsetWidth
var actualHeight = $tip[0].offsetHeight
if (placement == 'top' && actualHeight != height) {
replace = true
offset.top = offset.top + height - actualHeight
}
if (/bottom|top/.test(placement)) {
var delta = 0
if (offset.left < 0) {
delta = offset.left * -2
offset.left = 0
$tip.offset(offset)
actualWidth = $tip[0].offsetWidth
actualHeight = $tip[0].offsetHeight
}
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
} else {
this.replaceArrow(actualHeight - height, actualHeight, 'top')
}
if (replace) $tip.offset(offset)
}
Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '')
}
Tooltip.prototype.setContent = function () {
var $tip = this.tip()
var title = this.getTitle()
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
$tip.removeClass('fade in top bottom left right')
}
Tooltip.prototype.hide = function () {
var that = this
var $tip = this.tip()
var e = $.Event('hide.bs.' + this.type)
function complete() {
if (that.hoverState != 'in') $tip.detach()
that.$element.trigger('hidden.bs.' + that.type)
}
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$tip.removeClass('in')
$.support.transition && this.$tip.hasClass('fade') ?
$tip
.one($.support.transition.end, complete)
.emulateTransitionEnd(150) :
complete()
this.hoverState = null
return this
}
Tooltip.prototype.fixTitle = function () {
var $e = this.$element
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
}
}
Tooltip.prototype.hasContent = function () {
return this.getTitle()
}
Tooltip.prototype.getPosition = function () {
var el = this.$element[0]
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
width: el.offsetWidth,
height: el.offsetHeight
}, this.$element.offset())
}
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
}
Tooltip.prototype.getTitle = function () {
var title
var $e = this.$element
var o = this.options
title = $e.attr('data-original-title')
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
return title
}
Tooltip.prototype.tip = function () {
return this.$tip = this.$tip || $(this.options.template)
}
Tooltip.prototype.arrow = function () {
return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
}
Tooltip.prototype.validate = function () {
if (!this.$element[0].parentNode) {
this.hide()
this.$element = null
this.options = null
}
}
Tooltip.prototype.enable = function () {
this.enabled = true
}
Tooltip.prototype.disable = function () {
this.enabled = false
}
Tooltip.prototype.toggleEnabled = function () {
this.enabled = !this.enabled
}
Tooltip.prototype.toggle = function (e) {
var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
}
Tooltip.prototype.destroy = function () {
clearTimeout(this.timeout)
this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
}
// TOOLTIP PLUGIN DEFINITION
// =========================
var old = $.fn.tooltip
$.fn.tooltip = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.tooltip')
var options = typeof option == 'object' && option
if (!data && option == 'destroy') return
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.tooltip.Constructor = Tooltip
// TOOLTIP NO CONFLICT
// ===================
$.fn.tooltip.noConflict = function () {
$.fn.tooltip = old
return this
}
}(jQuery);
/* ========================================================================
* Bootstrap: popover.js v3.1.0
* http://getbootstrap.com/javascript/#popovers
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// POPOVER PUBLIC CLASS DEFINITION
// ===============================
var Popover = function (element, options) {
this.init('popover', element, options)
}
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
placement: 'right',
trigger: 'click',
content: '',
template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
})
// NOTE: POPOVER EXTENDS tooltip.js
// ================================
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
Popover.prototype.constructor = Popover
Popover.prototype.getDefaults = function () {
return Popover.DEFAULTS
}
Popover.prototype.setContent = function () {
var $tip = this.tip()
var title = this.getTitle()
var content = this.getContent()
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
$tip.find('.popover-content')[ // we use append for html objects to maintain js events
this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
](content)
$tip.removeClass('fade top bottom left right in')
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
// this manually by checking the contents.
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
}
Popover.prototype.hasContent = function () {
return this.getTitle() || this.getContent()
}
Popover.prototype.getContent = function () {
var $e = this.$element
var o = this.options
return $e.attr('data-content')
|| (typeof o.content == 'function' ?
o.content.call($e[0]) :
o.content)
}
Popover.prototype.arrow = function () {
return this.$arrow = this.$arrow || this.tip().find('.arrow')
}
Popover.prototype.tip = function () {
if (!this.$tip) this.$tip = $(this.options.template)
return this.$tip
}
// POPOVER PLUGIN DEFINITION
// =========================
var old = $.fn.popover
$.fn.popover = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.popover')
var options = typeof option == 'object' && option
if (!data && option == 'destroy') return
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.popover.Constructor = Popover
// POPOVER NO CONFLICT
// ===================
$.fn.popover.noConflict = function () {
$.fn.popover = old
return this
}
}(jQuery);
/* ========================================================================
* Bootstrap: tab.js v3.1.0
* http://getbootstrap.com/javascript/#tabs
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// TAB CLASS DEFINITION
// ====================
var Tab = function (element) {
this.element = $(element)
}
Tab.prototype.show = function () {
var $this = this.element
var $ul = $this.closest('ul:not(.dropdown-menu)')
var selector = $this.data('target')
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
if ($this.parent('li').hasClass('active')) return
var previous = $ul.find('.active:last a')[0]
var e = $.Event('show.bs.tab', {
relatedTarget: previous
})
$this.trigger(e)
if (e.isDefaultPrevented()) return
var $target = $(selector)
this.activate($this.parent('li'), $ul)
this.activate($target, $target.parent(), function () {
$this.trigger({
type: 'shown.bs.tab',
relatedTarget: previous
})
})
}
Tab.prototype.activate = function (element, container, callback) {
var $active = container.find('> .active')
var transition = callback
&& $.support.transition
&& $active.hasClass('fade')
function next() {
$active
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
element.addClass('active')
if (transition) {
element[0].offsetWidth // reflow for transition
element.addClass('in')
} else {
element.removeClass('fade')
}
if (element.parent('.dropdown-menu')) {
element.closest('li.dropdown').addClass('active')
}
callback && callback()
}
transition ?
$active
.one($.support.transition.end, next)
.emulateTransitionEnd(150) :
next()
$active.removeClass('in')
}
// TAB PLUGIN DEFINITION
// =====================
var old = $.fn.tab
$.fn.tab = function ( option ) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.tab')
if (!data) $this.data('bs.tab', (data = new Tab(this)))
if (typeof option == 'string') data[option]()
})
}
$.fn.tab.Constructor = Tab
// TAB NO CONFLICT
// ===============
$.fn.tab.noConflict = function () {
$.fn.tab = old
return this
}
// TAB DATA-API
// ============
$(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
e.preventDefault()
$(this).tab('show')
})
}(jQuery);
/* ========================================================================
* Bootstrap: affix.js v3.1.0
* http://getbootstrap.com/javascript/#affix
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// AFFIX CLASS DEFINITION
// ======================
var Affix = function (element, options) {
this.options = $.extend({}, Affix.DEFAULTS, options)
this.$window = $(window)
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
this.$element = $(element)
this.affixed =
this.unpin =
this.pinnedOffset = null
this.checkPosition()
}
Affix.RESET = 'affix affix-top affix-bottom'
Affix.DEFAULTS = {
offset: 0
}
Affix.prototype.getPinnedOffset = function () {
if (this.pinnedOffset) return this.pinnedOffset
this.$element.removeClass(Affix.RESET).addClass('affix')
var scrollTop = this.$window.scrollTop()
var position = this.$element.offset()
return (this.pinnedOffset = position.top - scrollTop)
}
Affix.prototype.checkPositionWithEventLoop = function () {
setTimeout($.proxy(this.checkPosition, this), 1)
}
Affix.prototype.checkPosition = function () {
if (!this.$element.is(':visible')) return
var scrollHeight = $(document).height()
var scrollTop = this.$window.scrollTop()
var position = this.$element.offset()
var offset = this.options.offset
var offsetTop = offset.top
var offsetBottom = offset.bottom
if (this.affixed == 'top') position.top += scrollTop
if (typeof offset != 'object') offsetBottom = offsetTop = offset
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
if (this.affixed === affix) return
if (this.unpin) this.$element.css('top', '')
var affixType = 'affix' + (affix ? '-' + affix : '')
var e = $.Event(affixType + '.bs.affix')
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
this.affixed = affix
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
this.$element
.removeClass(Affix.RESET)
.addClass(affixType)
.trigger($.Event(affixType.replace('affix', 'affixed')))
if (affix == 'bottom') {
this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() })
}
}
// AFFIX PLUGIN DEFINITION
// =======================
var old = $.fn.affix
$.fn.affix = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.affix')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.affix.Constructor = Affix
// AFFIX NO CONFLICT
// =================
$.fn.affix.noConflict = function () {
$.fn.affix = old
return this
}
// AFFIX DATA-API
// ==============
$(window).on('load', function () {
$('[data-spy="affix"]').each(function () {
var $spy = $(this)
var data = $spy.data()
data.offset = data.offset || {}
if (data.offsetBottom) data.offset.bottom = data.offsetBottom
if (data.offsetTop) data.offset.top = data.offsetTop
$spy.affix(data)
})
})
}(jQuery);
/* ========================================================================
* Bootstrap: collapse.js v3.1.0
* http://getbootstrap.com/javascript/#collapse
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// COLLAPSE PUBLIC CLASS DEFINITION
// ================================
var Collapse = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, Collapse.DEFAULTS, options)
this.transitioning = null
if (this.options.parent) this.$parent = $(this.options.parent)
if (this.options.toggle) this.toggle()
}
Collapse.DEFAULTS = {
toggle: true
}
Collapse.prototype.dimension = function () {
var hasWidth = this.$element.hasClass('width')
return hasWidth ? 'width' : 'height'
}
Collapse.prototype.show = function () {
if (this.transitioning || this.$element.hasClass('in')) return
var startEvent = $.Event('show.bs.collapse')
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
var actives = this.$parent && this.$parent.find('> .panel > .in')
if (actives && actives.length) {
var hasData = actives.data('bs.collapse')
if (hasData && hasData.transitioning) return
actives.collapse('hide')
hasData || actives.data('bs.collapse', null)
}
var dimension = this.dimension()
this.$element
.removeClass('collapse')
.addClass('collapsing')
[dimension](0)
this.transitioning = 1
var complete = function () {
this.$element
.removeClass('collapsing')
.addClass('collapse in')
[dimension]('auto')
this.transitioning = 0
this.$element.trigger('shown.bs.collapse')
}
if (!$.support.transition) return complete.call(this)
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
this.$element
.one($.support.transition.end, $.proxy(complete, this))
.emulateTransitionEnd(350)
[dimension](this.$element[0][scrollSize])
}
Collapse.prototype.hide = function () {
if (this.transitioning || !this.$element.hasClass('in')) return
var startEvent = $.Event('hide.bs.collapse')
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
var dimension = this.dimension()
this.$element
[dimension](this.$element[dimension]())
[0].offsetHeight
this.$element
.addClass('collapsing')
.removeClass('collapse')
.removeClass('in')
this.transitioning = 1
var complete = function () {
this.transitioning = 0
this.$element
.trigger('hidden.bs.collapse')
.removeClass('collapsing')
.addClass('collapse')
}
if (!$.support.transition) return complete.call(this)
this.$element
[dimension](0)
.one($.support.transition.end, $.proxy(complete, this))
.emulateTransitionEnd(350)
}
Collapse.prototype.toggle = function () {
this[this.$element.hasClass('in') ? 'hide' : 'show']()
}
// COLLAPSE PLUGIN DEFINITION
// ==========================
var old = $.fn.collapse
$.fn.collapse = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.collapse')
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
if (!data && options.toggle && option == 'show') option = !option
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.collapse.Constructor = Collapse
// COLLAPSE NO CONFLICT
// ====================
$.fn.collapse.noConflict = function () {
$.fn.collapse = old
return this
}
// COLLAPSE DATA-API
// =================
$(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
var $this = $(this), href
var target = $this.attr('data-target')
|| e.preventDefault()
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
var $target = $(target)
var data = $target.data('bs.collapse')
var option = data ? 'toggle' : $this.data()
var parent = $this.attr('data-parent')
var $parent = parent && $(parent)
if (!data || !data.transitioning) {
if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
$this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
}
$target.collapse(option)
})
}(jQuery);
/* ========================================================================
* Bootstrap: scrollspy.js v3.1.0
* http://getbootstrap.com/javascript/#scrollspy
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// SCROLLSPY CLASS DEFINITION
// ==========================
function ScrollSpy(element, options) {
var href
var process = $.proxy(this.process, this)
this.$element = $(element).is('body') ? $(window) : $(element)
this.$body = $('body')
this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
this.selector = (this.options.target
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|| '') + ' .nav li > a'
this.offsets = $([])
this.targets = $([])
this.activeTarget = null
this.refresh()
this.process()
}
ScrollSpy.DEFAULTS = {
offset: 10
}
ScrollSpy.prototype.refresh = function () {
var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
this.offsets = $([])
this.targets = $([])
var self = this
var $targets = this.$body
.find(this.selector)
.map(function () {
var $el = $(this)
var href = $el.data('target') || $el.attr('href')
var $href = /^#./.test(href) && $(href)
return ($href
&& $href.length
&& $href.is(':visible')
&& [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
})
.sort(function (a, b) { return a[0] - b[0] })
.each(function () {
self.offsets.push(this[0])
self.targets.push(this[1])
})
}
ScrollSpy.prototype.process = function () {
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
var maxScroll = scrollHeight - this.$scrollElement.height()
var offsets = this.offsets
var targets = this.targets
var activeTarget = this.activeTarget
var i
if (scrollTop >= maxScroll) {
return activeTarget != (i = targets.last()[0]) && this.activate(i)
}
if (activeTarget && scrollTop <= offsets[0]) {
return activeTarget != (i = targets[0]) && this.activate(i)
}
for (i = offsets.length; i--;) {
activeTarget != targets[i]
&& scrollTop >= offsets[i]
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
&& this.activate( targets[i] )
}
}
ScrollSpy.prototype.activate = function (target) {
this.activeTarget = target
$(this.selector)
.parentsUntil(this.options.target, '.active')
.removeClass('active')
var selector = this.selector +
'[data-target="' + target + '"],' +
this.selector + '[href="' + target + '"]'
var active = $(selector)
.parents('li')
.addClass('active')
if (active.parent('.dropdown-menu').length) {
active = active
.closest('li.dropdown')
.addClass('active')
}
active.trigger('activate.bs.scrollspy')
}
// SCROLLSPY PLUGIN DEFINITION
// ===========================
var old = $.fn.scrollspy
$.fn.scrollspy = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.scrollspy')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.scrollspy.Constructor = ScrollSpy
// SCROLLSPY NO CONFLICT
// =====================
$.fn.scrollspy.noConflict = function () {
$.fn.scrollspy = old
return this
}
// SCROLLSPY DATA-API
// ==================
$(window).on('load', function () {
$('[data-spy="scroll"]').each(function () {
var $spy = $(this)
$spy.scrollspy($spy.data())
})
})
}(jQuery);
/* ========================================================================
* Bootstrap: transition.js v3.1.0
* http://getbootstrap.com/javascript/#transitions
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
// ============================================================
function transitionEnd() {
var el = document.createElement('bootstrap')
var transEndEventNames = {
'WebkitTransition' : 'webkitTransitionEnd',
'MozTransition' : 'transitionend',
'OTransition' : 'oTransitionEnd otransitionend',
'transition' : 'transitionend'
}
for (var name in transEndEventNames) {
if (el.style[name] !== undefined) {
return { end: transEndEventNames[name] }
}
}
return false // explicit for ie8 ( ._.)
}
// http://blog.alexmaccaw.com/css-transitions
$.fn.emulateTransitionEnd = function (duration) {
var called = false, $el = this
$(this).one($.support.transition.end, function () { called = true })
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
setTimeout(callback, duration)
return this
}
$(function () {
$.support.transition = transitionEnd()
})
}(jQuery);
//::::::PARALAX EFFECT:::::::::
var jumboHeight = $('.jumbotron').outerHeight();
function parallax(){
var scrolled = $(window).scrollTop();
$('.bg').css('height', (jumboHeight-scrolled) + 'px');
}
$(window).scroll(function(e){
parallax();
});
|
'use strict;'
import React, { Component } from 'react';
import template from './NavTodo.rt';
module.exports = React.createClass({
render: template
});
|
/**
* Service Proxy for CpProxyOpenhomeOrgTestBasic1
* @module ohnet
* @class TestBasic
*/
var CpProxyOpenhomeOrgTestBasic1 = function(udn){
this.url = window.location.protocol + "//" + window.location.host + "/" + udn + "/openhome.org-TestBasic-1/control"; // upnp control url
this.domain = "openhome-org";
this.type = "TestBasic";
this.version = "1";
this.serviceName = "openhome.org-TestBasic-1";
this.subscriptionId = ""; // Subscription identifier unique to each Subscription Manager
this.udn = udn; // device name
// Collection of service properties
this.serviceProperties = {};
this.serviceProperties["VarUint"] = new ohnet.serviceproperty("VarUint","int");
this.serviceProperties["VarInt"] = new ohnet.serviceproperty("VarInt","int");
this.serviceProperties["VarBool"] = new ohnet.serviceproperty("VarBool","bool");
this.serviceProperties["VarStr"] = new ohnet.serviceproperty("VarStr","string");
this.serviceProperties["VarBin"] = new ohnet.serviceproperty("VarBin","binary");
}
/**
* Subscribes the service to the subscription manager to listen for property change events
* @method Subscribe
* @param {Function} serviceAddedFunction The function that executes once the subscription is successful
*/
CpProxyOpenhomeOrgTestBasic1.prototype.subscribe = function (serviceAddedFunction) {
ohnet.subscriptionmanager.addService(this,serviceAddedFunction);
}
/**
* Unsubscribes the service from the subscription manager to stop listening for property change events
* @method Unsubscribe
*/
CpProxyOpenhomeOrgTestBasic1.prototype.unsubscribe = function () {
ohnet.subscriptionmanager.removeService(this.subscriptionId);
}
/**
* Adds a listener to handle "VarUint" property change events
* @method VarUint_Changed
* @param {Function} stateChangedFunction The handler for state changes
*/
CpProxyOpenhomeOrgTestBasic1.prototype.VarUint_Changed = function (stateChangedFunction) {
this.serviceProperties.VarUint.addListener(function (state)
{
stateChangedFunction(ohnet.soaprequest.readIntParameter(state));
});
}
/**
* Adds a listener to handle "VarInt" property change events
* @method VarInt_Changed
* @param {Function} stateChangedFunction The handler for state changes
*/
CpProxyOpenhomeOrgTestBasic1.prototype.VarInt_Changed = function (stateChangedFunction) {
this.serviceProperties.VarInt.addListener(function (state)
{
stateChangedFunction(ohnet.soaprequest.readIntParameter(state));
});
}
/**
* Adds a listener to handle "VarBool" property change events
* @method VarBool_Changed
* @param {Function} stateChangedFunction The handler for state changes
*/
CpProxyOpenhomeOrgTestBasic1.prototype.VarBool_Changed = function (stateChangedFunction) {
this.serviceProperties.VarBool.addListener(function (state)
{
stateChangedFunction(ohnet.soaprequest.readBoolParameter(state));
});
}
/**
* Adds a listener to handle "VarStr" property change events
* @method VarStr_Changed
* @param {Function} stateChangedFunction The handler for state changes
*/
CpProxyOpenhomeOrgTestBasic1.prototype.VarStr_Changed = function (stateChangedFunction) {
this.serviceProperties.VarStr.addListener(function (state)
{
stateChangedFunction(ohnet.soaprequest.readStringParameter(state));
});
}
/**
* Adds a listener to handle "VarBin" property change events
* @method VarBin_Changed
* @param {Function} stateChangedFunction The handler for state changes
*/
CpProxyOpenhomeOrgTestBasic1.prototype.VarBin_Changed = function (stateChangedFunction) {
this.serviceProperties.VarBin.addListener(function (state)
{
stateChangedFunction(ohnet.soaprequest.readBinaryParameter(state));
});
}
/**
* A service action to Increment
* @method Increment
* @param {Int} Value An action parameter
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.Increment = function(Value, successFunction, errorFunction){
var request = new ohnet.soaprequest("Increment", this.url, this.domain, this.type, this.version);
request.writeIntParameter("Value", Value);
request.send(function(result){
result["Result"] = ohnet.soaprequest.readIntParameter(result["Result"]);
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to EchoAllowedRangeUint
* @method EchoAllowedRangeUint
* @param {Int} Value An action parameter
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.EchoAllowedRangeUint = function(Value, successFunction, errorFunction){
var request = new ohnet.soaprequest("EchoAllowedRangeUint", this.url, this.domain, this.type, this.version);
request.writeIntParameter("Value", Value);
request.send(function(result){
result["Result"] = ohnet.soaprequest.readIntParameter(result["Result"]);
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to Decrement
* @method Decrement
* @param {Int} Value An action parameter
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.Decrement = function(Value, successFunction, errorFunction){
var request = new ohnet.soaprequest("Decrement", this.url, this.domain, this.type, this.version);
request.writeIntParameter("Value", Value);
request.send(function(result){
result["Result"] = ohnet.soaprequest.readIntParameter(result["Result"]);
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to Toggle
* @method Toggle
* @param {Boolean} Value An action parameter
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.Toggle = function(Value, successFunction, errorFunction){
var request = new ohnet.soaprequest("Toggle", this.url, this.domain, this.type, this.version);
request.writeBoolParameter("Value", Value);
request.send(function(result){
result["Result"] = ohnet.soaprequest.readBoolParameter(result["Result"]);
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to EchoString
* @method EchoString
* @param {String} Value An action parameter
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.EchoString = function(Value, successFunction, errorFunction){
var request = new ohnet.soaprequest("EchoString", this.url, this.domain, this.type, this.version);
request.writeStringParameter("Value", Value);
request.send(function(result){
result["Result"] = ohnet.soaprequest.readStringParameter(result["Result"]);
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to EchoAllowedValueString
* @method EchoAllowedValueString
* @param {String} Value An action parameter
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.EchoAllowedValueString = function(Value, successFunction, errorFunction){
var request = new ohnet.soaprequest("EchoAllowedValueString", this.url, this.domain, this.type, this.version);
request.writeStringParameter("Value", Value);
request.send(function(result){
result["Result"] = ohnet.soaprequest.readStringParameter(result["Result"]);
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to EchoBinary
* @method EchoBinary
* @param {String} Value An action parameter
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.EchoBinary = function(Value, successFunction, errorFunction){
var request = new ohnet.soaprequest("EchoBinary", this.url, this.domain, this.type, this.version);
request.writeBinaryParameter("Value", Value);
request.send(function(result){
result["Result"] = ohnet.soaprequest.readBinaryParameter(result["Result"]);
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to SetUint
* @method SetUint
* @param {Int} ValueUint An action parameter
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.SetUint = function(ValueUint, successFunction, errorFunction){
var request = new ohnet.soaprequest("SetUint", this.url, this.domain, this.type, this.version);
request.writeIntParameter("ValueUint", ValueUint);
request.send(function(result){
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to GetUint
* @method GetUint
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.GetUint = function(successFunction, errorFunction){
var request = new ohnet.soaprequest("GetUint", this.url, this.domain, this.type, this.version);
request.send(function(result){
result["ValueUint"] = ohnet.soaprequest.readIntParameter(result["ValueUint"]);
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to SetInt
* @method SetInt
* @param {Int} ValueInt An action parameter
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.SetInt = function(ValueInt, successFunction, errorFunction){
var request = new ohnet.soaprequest("SetInt", this.url, this.domain, this.type, this.version);
request.writeIntParameter("ValueInt", ValueInt);
request.send(function(result){
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to GetInt
* @method GetInt
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.GetInt = function(successFunction, errorFunction){
var request = new ohnet.soaprequest("GetInt", this.url, this.domain, this.type, this.version);
request.send(function(result){
result["ValueInt"] = ohnet.soaprequest.readIntParameter(result["ValueInt"]);
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to SetBool
* @method SetBool
* @param {Boolean} ValueBool An action parameter
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.SetBool = function(ValueBool, successFunction, errorFunction){
var request = new ohnet.soaprequest("SetBool", this.url, this.domain, this.type, this.version);
request.writeBoolParameter("ValueBool", ValueBool);
request.send(function(result){
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to GetBool
* @method GetBool
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.GetBool = function(successFunction, errorFunction){
var request = new ohnet.soaprequest("GetBool", this.url, this.domain, this.type, this.version);
request.send(function(result){
result["ValueBool"] = ohnet.soaprequest.readBoolParameter(result["ValueBool"]);
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to SetMultiple
* @method SetMultiple
* @param {Int} ValueUint An action parameter
* @param {Int} ValueInt An action parameter
* @param {Boolean} ValueBool An action parameter
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.SetMultiple = function(ValueUint, ValueInt, ValueBool, successFunction, errorFunction){
var request = new ohnet.soaprequest("SetMultiple", this.url, this.domain, this.type, this.version);
request.writeIntParameter("ValueUint", ValueUint);
request.writeIntParameter("ValueInt", ValueInt);
request.writeBoolParameter("ValueBool", ValueBool);
request.send(function(result){
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to GetMultiple
* @method GetMultiple
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.GetMultiple = function(successFunction, errorFunction){
var request = new ohnet.soaprequest("GetMultiple", this.url, this.domain, this.type, this.version);
request.send(function(result){
result["ValueUint"] = ohnet.soaprequest.readIntParameter(result["ValueUint"]);
result["ValueInt"] = ohnet.soaprequest.readIntParameter(result["ValueInt"]);
result["ValueBool"] = ohnet.soaprequest.readBoolParameter(result["ValueBool"]);
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to SetString
* @method SetString
* @param {String} ValueStr An action parameter
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.SetString = function(ValueStr, successFunction, errorFunction){
var request = new ohnet.soaprequest("SetString", this.url, this.domain, this.type, this.version);
request.writeStringParameter("ValueStr", ValueStr);
request.send(function(result){
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to GetString
* @method GetString
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.GetString = function(successFunction, errorFunction){
var request = new ohnet.soaprequest("GetString", this.url, this.domain, this.type, this.version);
request.send(function(result){
result["ValueStr"] = ohnet.soaprequest.readStringParameter(result["ValueStr"]);
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to SetBinary
* @method SetBinary
* @param {String} ValueBin An action parameter
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.SetBinary = function(ValueBin, successFunction, errorFunction){
var request = new ohnet.soaprequest("SetBinary", this.url, this.domain, this.type, this.version);
request.writeBinaryParameter("ValueBin", ValueBin);
request.send(function(result){
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to GetBinary
* @method GetBinary
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.GetBinary = function(successFunction, errorFunction){
var request = new ohnet.soaprequest("GetBinary", this.url, this.domain, this.type, this.version);
request.send(function(result){
result["ValueBin"] = ohnet.soaprequest.readBinaryParameter(result["ValueBin"]);
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to ToggleBool
* @method ToggleBool
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.ToggleBool = function(successFunction, errorFunction){
var request = new ohnet.soaprequest("ToggleBool", this.url, this.domain, this.type, this.version);
request.send(function(result){
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to WriteFile
* @method WriteFile
* @param {String} Data An action parameter
* @param {String} FileFullName An action parameter
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.WriteFile = function(Data, FileFullName, successFunction, errorFunction){
var request = new ohnet.soaprequest("WriteFile", this.url, this.domain, this.type, this.version);
request.writeStringParameter("Data", Data);
request.writeStringParameter("FileFullName", FileFullName);
request.send(function(result){
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
/**
* A service action to Shutdown
* @method Shutdown
* @param {Function} successFunction The function that is executed when the action has completed successfully
* @param {Function} errorFunction The function that is executed when the action has cause an error
*/
CpProxyOpenhomeOrgTestBasic1.prototype.Shutdown = function(successFunction, errorFunction){
var request = new ohnet.soaprequest("Shutdown", this.url, this.domain, this.type, this.version);
request.send(function(result){
if (successFunction){
successFunction(result);
}
}, function(message, transport) {
if (errorFunction) {errorFunction(message, transport);}
});
}
|
// Action to get all Repos
export function getRepos(response) {
return {
type: 'Get_Repos',
payload: response,
};
}
// Thunk function, it calls the getRepos action above after it receives the fetch response.
export function getRepoThunk() {
return function (dispatch, getState) {
fetch('http://www.investnaira.com/wp-json/wp/v2/posts')
.then(e => e.json())
.then((response) => {
console.log(response);
let arr = response.slice(0, 20);
// remove slice
dispatch(getRepos(arr));
}).catch((error) => {
console.error(error, 'ERRRRRORRR');
});
};
}
export function getMediaThunk() {
return function (dispatch, getState) {
fetch('https://api.github.com/repositories')
.then(e => e.json())
.then((response) => {
console.log(response);
const arr = response.slice(0, 10);
// remove slice
dispatch(getRepos(arr));
}).catch((error) => {
console.error(error, 'ERRRRRORRR');
});
};
}
// Repo selected action
export function repoSelected(repo) {
return {
type: 'Repo_Selected',
payload: repo,
};
}
// open drawer
export function toggleDrawer() {
return { type: 'Toggle_Drawer' };
}
export function openPage(page) {
return { type: 'Open_Page',
payload: page };
}
|
(function () {
'use strict';
angular.module('storage.firebase', ['firebase'])
.factory('$firebase', function ($log, $q, $location, $timeout, $firebaseAuth, $firebaseObject, $storage, FirebaseConstants) {
var firebase = this;
firebase.setVariable = setVariable;
function setVariable(path, name, callback) {
if (!name) name = path;
firebase[name] = {};
var root = new Firebase(FirebaseConstants.dbname + path);
$firebaseObject(root)
.$loaded(function (value) {
firebase[name] = value;
if (callback) callback(value);
});
return firebase[name];
}
return firebase;
});
})();
|
import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<React.Fragment><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" /><path fill="none" d="M0 0h24v24H0z" /><path d="M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z" /></React.Fragment>
, 'QueryBuilder');
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = makeFinalStore;
/**
* makeFinalStore(alt: AltInstance): AltStore
*
* > Creates a `FinalStore` which is a store like any other except that it
* waits for all other stores in your alt instance to emit a change before it
* emits a change itself.
*
* Want to know when a particular dispatch has completed? This is the util
* you want.
*
* Good for: taking a snapshot and persisting it somewhere, saving data from
* a set of stores, syncing data, etc.
*
* Usage:
*
* ```js
* var FinalStore = makeFinalStore(alt);
*
* FinalStore.listen(function () {
* // all stores have now changed
* });
* ```
*/
function FinalStore() {
var _this = this;
this.dispatcher.register(function (payload) {
var stores = Object.keys(_this.alt.stores).reduce(function (arr, store) {
arr.push(_this.alt.stores[store].dispatchToken);
return arr;
}, []);
_this.waitFor(stores);
_this.setState({ payload: payload });
_this.emitChange();
});
}
function makeFinalStore(alt) {
return alt.FinalStore ? alt.FinalStore : alt.FinalStore = alt.createUnsavedStore(FinalStore);
}
module.exports = exports["default"];
|
/**
* The global state selectors
*/
import { createSelector } from 'reselect';
const selectGlobal = () => (state) => state.get('global');
const selectLoading = () => createSelector(
selectGlobal(),
(globalState) => globalState.get('loading')
);
const selectError = () => createSelector(
selectGlobal(),
(globalState) => globalState.get('error')
);
const selectContestList = () => createSelector(
selectGlobal(),
(globalState) => globalState.get('contestList')
);
const selectIsDrawerOpen = () => createSelector(
selectGlobal(),
(globalState) => globalState.get('isDrawerOpen')
);
const selectLocationState = () => {
let prevRoutingState;
let prevRoutingStateJS;
return (state) => {
const routingState = state.get('route'); // or state.route
if (!routingState.equals(prevRoutingState)) {
prevRoutingState = routingState;
prevRoutingStateJS = routingState.toJS();
}
return prevRoutingStateJS;
};
};
export {
selectGlobal,
selectContestList,
selectLoading,
selectError,
selectLocationState,
selectIsDrawerOpen,
};
|
/*
Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.26
Mocha integration test from: microformats-v2/h-product/justahyperlink
The test was built on Fri May 27 2016 13:35:35 GMT+0100 (BST)
*/
var chai = require('chai'),
assert = chai.assert,
helper = require('../test/helper.js');
describe('h-product', function() {
var htmlFragment = "<a class=\"h-product\" href=\"http://www.raspberrypi.org/\">Raspberry Pi</a>";
var found = helper.parseHTML(htmlFragment,'http://example.com/');
var expected = {"items":[{"type":["h-product"],"properties":{"name":["Raspberry Pi"],"url":["http://www.raspberrypi.org/"]}}],"rels":{},"rel-urls":{}};
it('justahyperlink', function(){
assert.deepEqual(found, expected);
});
});
|
/*global Ext */
Ext.define("Tiegan.store.Func", {
extend: "Ext.data.Store",
model: "Tiegan.model.Func",
autoLoad: true,
pageSize: 20,
proxy: {
type: 'ajax',
url: '/admin_api/getFuncLog',
reader: {
type: 'json',
root: 'data',
totalProperty: 'total'
}
}
});
//end file
|
const
BrowserWindow = require('browser-window')
;
module.exports = function () {
var win = new BrowserWindow({
width: 400,
height: 450,
resizable: false
});
var params = [
'https://soundcloud.com/connect',
'?client_id=cee5bcd6c4ed31b6370e29b4e5190808',
'&response_type=token',
'&display=popup',
'&redirect_uri=forecast-player://callback'
];
win.loadUrl(params.join(''));
return win;
};
|
goog.provide('ngeo.FeatureHelper');
goog.require('ngeo');
/** @suppress {extraRequire} */
goog.require('ngeo.filters');
goog.require('ngeo.interaction.Measure');
goog.require('ngeo.interaction.MeasureAzimut');
goog.require('ngeo.Download');
goog.require('ol.Feature');
goog.require('ol.animation');
goog.require('ol.geom.LineString');
goog.require('ol.geom.MultiPoint');
goog.require('ol.geom.Point');
goog.require('ol.geom.Polygon');
goog.require('ol.format.GPX');
goog.require('ol.format.KML');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.RegularShape');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
goog.require('ol.style.Text');
/**
* Provides methods for features, such as:
* - style setting / getting
* - measurement
* - export
*
* @constructor
* @struct
* @param {angular.$injector} $injector Main injector.
* @param {angular.$filter} $filter Angular filter
* @ngdoc service
* @ngname ngeoFeatureHelper
* @ngInject
*/
ngeo.FeatureHelper = function($injector, $filter) {
/**
* @type {angular.$filter}
* @private
*/
this.$filter_ = $filter;
/**
* @type {?number}
* @private
*/
this.decimals_ = null;
if ($injector.has('ngeoMeasureDecimals')) {
this.decimals_ = $injector.get('ngeoMeasureDecimals');
}
/**
* @type {ngeox.unitPrefix}
*/
this.format_ = $injector.get('$filter')('ngeoUnitPrefix');
/**
* Filter function to display point coordinates or null to don't use any
* filter.
* @type {function(*):string|null}
* @private
*/
this.pointFilterFn_ = null;
/**
* Arguments to apply to the the point filter function.
* @type {Array.<*>}
* @private
*/
this.pointFilterArgs_ = [];
if ($injector.has('ngeoPointfilter')) {
var filterElements = $injector.get('ngeoPointfilter').split(':');
var filterName = filterElements.shift();
var filter = this.$filter_(filterName);
goog.asserts.assertFunction(filter);
this.pointFilterFn_ = filter;
this.pointFilterArgs_ = filterElements;
} else {
this.pointFilterFn_ = null;
}
/**
* @type {ol.proj.Projection}
* @private
*/
this.projection_;
/**
* Download service.
* @type {ngeo.Download}
* @private
*/
this.download_ = $injector.get('ngeoDownload');
};
/**
* @param {ol.proj.Projection} projection Projection.
* @export
*/
ngeo.FeatureHelper.prototype.setProjection = function(projection) {
this.projection_ = projection;
};
// === STYLE METHODS ===
/**
* Set the style of a feature using its inner properties and depending on
* its geometry type.
* @param {ol.Feature} feature Feature.
* @param {boolean=} opt_select Whether the feature should be rendered as
* selected, which includes additional vertex and halo styles.
* @export
*/
ngeo.FeatureHelper.prototype.setStyle = function(feature, opt_select) {
var styles = this.getStyle(feature);
if (opt_select) {
if (this.supportsVertex_(feature)) {
styles.push(this.getVertexStyle());
}
styles.unshift(this.getHaloStyle_(feature));
}
feature.setStyle(styles);
};
/**
* Create and return a style object from a given feature using its inner
* properties and depending on its geometry type.
* @param {ol.Feature} feature Feature.
* @return {Array.<ol.style.Style>} The style object.
* @export
*/
ngeo.FeatureHelper.prototype.getStyle = function(feature) {
var type = this.getType(feature);
var style;
switch (type) {
case ngeo.GeometryType.LINE_STRING:
style = this.getLineStringStyle_(feature);
break;
case ngeo.GeometryType.POINT:
style = this.getPointStyle_(feature);
break;
case ngeo.GeometryType.CIRCLE:
case ngeo.GeometryType.POLYGON:
case ngeo.GeometryType.RECTANGLE:
style = this.getPolygonStyle_(feature);
break;
case ngeo.GeometryType.TEXT:
style = this.getTextStyle_(feature);
break;
default:
break;
}
goog.asserts.assert(style, 'Style should be thruthy');
var styles;
if (style.constructor === Array) {
styles = /** @type {Array.<ol.style.Style>}*/ (style);
} else {
styles = [style];
}
return styles;
};
/**
* @param {ol.Feature} feature Feature with linestring geometry.
* @return {ol.style.Style} Style.
* @private
*/
ngeo.FeatureHelper.prototype.getLineStringStyle_ = function(feature) {
var strokeWidth = this.getStrokeProperty(feature);
var showMeasure = this.getShowMeasureProperty(feature);
var color = this.getRGBAColorProperty(feature);
var options = {
stroke: new ol.style.Stroke({
color: color,
width: strokeWidth
})
};
if (showMeasure) {
options.text = this.createTextStyle_({
text: this.getMeasure(feature)
});
}
return new ol.style.Style(options);
};
/**
* @param {ol.Feature} feature Feature with point geometry.
* @return {ol.style.Style} Style.
* @private
*/
ngeo.FeatureHelper.prototype.getPointStyle_ = function(feature) {
var size = this.getSizeProperty(feature);
var color = this.getRGBAColorProperty(feature);
var options = {
image: new ol.style.Circle({
radius: size,
fill: new ol.style.Fill({
color: color
})
})
};
var showMeasure = this.getShowMeasureProperty(feature);
if (showMeasure) {
options.text = this.createTextStyle_({
text: this.getMeasure(feature),
offsetY: -(size + 10 / 2 + 4)
});
}
return new ol.style.Style(options);
};
/**
* @param {ol.Feature} feature Feature with polygon geometry.
* @return {Array.<ol.style.Style>} Style.
* @private
*/
ngeo.FeatureHelper.prototype.getPolygonStyle_ = function(feature) {
var strokeWidth = this.getStrokeProperty(feature);
var opacity = this.getOpacityProperty(feature);
var color = this.getRGBAColorProperty(feature);
var showMeasure = this.getShowMeasureProperty(feature);
// fill color with opacity
var fillColor = color.slice();
fillColor[3] = opacity;
var azimut = /** @type {number} */ (
feature.get(ngeo.FeatureProperties.AZIMUT));
var styles = [new ol.style.Style({
fill: new ol.style.Fill({
color: fillColor
}),
stroke: new ol.style.Stroke({
color: color,
width: strokeWidth
})
})];
if (showMeasure) {
if (azimut !== undefined) {
// Radius style:
var line = this.getRadiusLine(feature, azimut);
var length = ngeo.interaction.Measure.getFormattedLength(
line, this.projection_, this.decimals_, this.format_);
styles.push(new ol.style.Style({
geometry: line,
fill: new ol.style.Fill({
color: fillColor
}),
stroke: new ol.style.Stroke({
color: color,
width: strokeWidth
}),
text: this.createTextStyle_({
text: length,
angle: ((azimut % 180) + 180) % 180 - 90
})
}));
// Azimut style
styles.push(new ol.style.Style({
geometry: new ol.geom.Point(line.getLastCoordinate()),
text: this.createTextStyle_({
text: azimut + '°',
size: 10,
offsetX: Math.cos((azimut - 90) * Math.PI / 180) * 20,
offsetY: Math.sin((azimut - 90) * Math.PI / 180) * 20
})
}));
} else {
styles.push(new ol.style.Style({
text: this.createTextStyle_({
text: this.getMeasure(feature)
})
}));
}
}
return styles;
};
/**
* @param {ol.Feature} feature Feature with point geometry, rendered as text.
* @return {ol.style.Style} Style.
* @private
*/
ngeo.FeatureHelper.prototype.getTextStyle_ = function(feature) {
return new ol.style.Style({
text: this.createTextStyle_({
text: this.getNameProperty(feature),
size: this.getSizeProperty(feature),
angle: this.getAngleProperty(feature),
color: this.getRGBAColorProperty(feature)
})
});
};
/**
* @param {ol.Feature} feature Feature to create the editing styles with.
* @return {Array.<ol.style.Style>} List of style.
* @export
*/
ngeo.FeatureHelper.prototype.createEditingStyles = function(feature) {
// (1) Style definition depends on geometry type
var white = [255, 255, 255, 1];
var blue = [0, 153, 255, 1];
var width = 3;
var styles = [];
var geom = feature.getGeometry();
console.assert(geom);
var type = geom.getType();
if (type === ol.geom.GeometryType.POINT) {
styles.push(
new ol.style.Style({
image: new ol.style.Circle({
radius: width * 2,
fill: new ol.style.Fill({
color: blue
}),
stroke: new ol.style.Stroke({
color: white,
width: width / 2
})
}),
zIndex: Infinity
})
);
} else {
if (type === ol.geom.GeometryType.LINE_STRING) {
styles.push(
new ol.style.Style({
stroke: new ol.style.Stroke({
color: white,
width: width + 2
})
})
);
styles.push(
new ol.style.Style({
stroke: new ol.style.Stroke({
color: blue,
width: width
})
})
);
} else {
styles.push(
new ol.style.Style({
stroke: new ol.style.Stroke({
color: blue,
width: width / 2
}),
fill: new ol.style.Fill({
color: [255, 255, 255, 0.5]
})
})
);
}
// (2) Anything else than 'Point' requires the vertex style as well
styles.push(this.getVertexStyle(true));
}
return styles;
};
/**
* Create and return a style object to be used for vertex.
* @param {boolean=} opt_incGeomFunc Whether to include the geometry function
* or not. One wants to use the geometry function when you want to draw
* the vertex of features that don't have point geometries. One doesn't
* want to include the geometry function if you just want to have the
* style object itself to be used to draw features that have point
* geometries. Defaults to `true`.
* @return {ol.style.Style} Style.
* @export
*/
ngeo.FeatureHelper.prototype.getVertexStyle = function(opt_incGeomFunc) {
var incGeomFunc = opt_incGeomFunc !== undefined ? opt_incGeomFunc : true;
var options = {
image: new ol.style.RegularShape({
radius: 6,
points: 4,
angle: Math.PI / 4,
fill: new ol.style.Fill({
color: [255, 255, 255, 0.5]
}),
stroke: new ol.style.Stroke({
color: [0, 0, 0, 1]
})
})
};
if (incGeomFunc) {
options.geometry = function(feature) {
var geom = feature.getGeometry();
if (geom.getType() == ol.geom.GeometryType.POINT) {
return;
}
var innerMultiCoordinates;
var multiCoordinates = [];
var coordinates = [];
var i, ii;
if (geom instanceof ol.geom.LineString) {
coordinates = geom.getCoordinates();
} else if (geom instanceof ol.geom.MultiLineString) {
multiCoordinates = geom.getCoordinates();
} else if (geom instanceof ol.geom.Polygon) {
coordinates = geom.getCoordinates()[0];
} else if (geom instanceof ol.geom.MultiPolygon) {
innerMultiCoordinates = geom.getCoordinates();
}
if (innerMultiCoordinates) {
for (i = 0, ii = innerMultiCoordinates.length; i < ii; i++) {
multiCoordinates = multiCoordinates.concat(innerMultiCoordinates[i]);
}
}
for (i = 0, ii = multiCoordinates.length; i < ii; i++) {
coordinates = coordinates.concat(multiCoordinates[i]);
}
if (coordinates.length) {
return new ol.geom.MultiPoint(coordinates);
} else {
return geom;
}
};
}
return new ol.style.Style(options);
};
/**
* @param {ol.Feature} feature Feature.
* @return {boolean} Whether the feature supports vertex or not.
* @private
*/
ngeo.FeatureHelper.prototype.supportsVertex_ = function(feature) {
var supported = [
ngeo.GeometryType.LINE_STRING,
ngeo.GeometryType.POLYGON,
ngeo.GeometryType.RECTANGLE
];
var type = this.getType(feature);
return ol.array.includes(supported, type);
};
/**
* @param {ol.Feature} feature Feature.
* @return {ol.style.Style} Style.
* @private
*/
ngeo.FeatureHelper.prototype.getHaloStyle_ = function(feature) {
var type = this.getType(feature);
var style;
var haloSize = 3;
switch (type) {
case ngeo.GeometryType.POINT:
var size = this.getSizeProperty(feature);
style = new ol.style.Style({
image: new ol.style.Circle({
radius: size + haloSize,
fill: new ol.style.Fill({
color: [255, 255, 255, 1]
})
})
});
break;
case ngeo.GeometryType.LINE_STRING:
case ngeo.GeometryType.CIRCLE:
case ngeo.GeometryType.POLYGON:
case ngeo.GeometryType.RECTANGLE:
var strokeWidth = this.getStrokeProperty(feature);
style = new ol.style.Style({
stroke: new ol.style.Stroke({
color: [255, 255, 255, 1],
width: strokeWidth + haloSize * 2
})
});
break;
case ngeo.GeometryType.TEXT:
style = new ol.style.Style({
text: this.createTextStyle_({
text: this.getNameProperty(feature),
size: this.getSizeProperty(feature),
angle: this.getAngleProperty(feature),
width: haloSize * 3
})
});
break;
default:
break;
}
goog.asserts.assert(style, 'Style should be thruthy');
return style;
};
// === PROPERTY GETTERS ===
/**
* Delete the unwanted ol3 properties from the current feature then return the
* properties.
* @param {ol.Feature} feature Feature.
* @return {!Object.<string, *>} Filtered properties of the current feature.
* @export
*/
ngeo.FeatureHelper.prototype.getFilteredFeatureValues = function(feature) {
var properties = feature.getProperties();
delete properties['boundedBy'];
delete properties[feature.getGeometryName()];
return properties;
};
/**
* @param {ol.Feature} feature Feature.
* @return {number} Angle.
* @export
*/
ngeo.FeatureHelper.prototype.getAngleProperty = function(feature) {
var angle = +(/** @type {string} */ (
feature.get(ngeo.FeatureProperties.ANGLE)));
goog.asserts.assertNumber(angle);
return angle;
};
/**
* @param {ol.Feature} feature Feature.
* @return {string} Color.
* @export
*/
ngeo.FeatureHelper.prototype.getColorProperty = function(feature) {
var color = /** @type {string} */ (feature.get(ngeo.FeatureProperties.COLOR));
goog.asserts.assertString(color);
return color;
};
/**
* @param {ol.Feature} feature Feature.
* @return {ol.Color} Color.
* @export
*/
ngeo.FeatureHelper.prototype.getRGBAColorProperty = function(feature) {
return ol.color.fromString(this.getColorProperty(feature));
};
/**
* @param {ol.Feature} feature Feature.
* @return {string} Name.
* @export
*/
ngeo.FeatureHelper.prototype.getNameProperty = function(feature) {
var name = /** @type {string} */ (feature.get(ngeo.FeatureProperties.NAME));
goog.asserts.assertString(name);
return name;
};
/**
* @param {ol.Feature} feature Feature.
* @return {number} Opacity.
* @export
*/
ngeo.FeatureHelper.prototype.getOpacityProperty = function(feature) {
var opacityStr = (/** @type {string} */ (
feature.get(ngeo.FeatureProperties.OPACITY)));
var opacity = opacityStr !== undefined ? +opacityStr : 1;
goog.asserts.assertNumber(opacity);
return opacity;
};
/**
* @param {ol.Feature} feature Feature.
* @return {boolean} Show measure.
* @export
*/
ngeo.FeatureHelper.prototype.getShowMeasureProperty = function(feature) {
var showMeasure = feature.get(ngeo.FeatureProperties.SHOW_MEASURE);
if (showMeasure === undefined) {
showMeasure = false;
} else if (typeof showMeasure === 'string') {
showMeasure = (showMeasure === 'true') ? true : false;
}
goog.asserts.assertBoolean(showMeasure);
return /** @type {boolean} */ (showMeasure);
};
/**
* @param {ol.Feature} feature Feature.
* @return {number} Size.
* @export
*/
ngeo.FeatureHelper.prototype.getSizeProperty = function(feature) {
var size = +(/** @type {string} */ (feature.get(ngeo.FeatureProperties.SIZE)));
goog.asserts.assertNumber(size);
return size;
};
/**
* @param {ol.Feature} feature Feature.
* @return {number} Stroke.
* @export
*/
ngeo.FeatureHelper.prototype.getStrokeProperty = function(feature) {
var stroke = +(/** @type {string} */ (
feature.get(ngeo.FeatureProperties.STROKE)));
goog.asserts.assertNumber(stroke);
return stroke;
};
// === EXPORT ===
/**
* Export features in the given format. The projection of the exported features
* is: `EPSG:4326`.
* @param {Array.<ol.Feature>} features Array of vector features.
* @param {string} formatType Format type to export the features.
* @export
*/
ngeo.FeatureHelper.prototype.export = function(features, formatType) {
switch (formatType) {
case ngeo.FeatureHelper.FormatType.GPX:
this.exportGPX(features);
break;
case ngeo.FeatureHelper.FormatType.KML:
this.exportKML(features);
break;
default:
break;
}
};
/**
* Export features in GPX and download the result to the browser. The
* projection of the exported features is: `EPSG:4326`.
* @param {Array.<ol.Feature>} features Array of vector features.
* @export
*/
ngeo.FeatureHelper.prototype.exportGPX = function(features) {
var format = new ol.format.GPX();
var mimeType = 'application/gpx+xml';
var fileName = 'export.gpx';
this.export_(features, format, fileName, mimeType);
};
/**
* Export features in KML and download the result to the browser. The
* projection of the exported features is: `EPSG:4326`.
* @param {Array.<ol.Feature>} features Array of vector features.
* @export
*/
ngeo.FeatureHelper.prototype.exportKML = function(features) {
var format = new ol.format.KML();
var mimeType = 'application/vnd.google-earth.kml+xml';
var fileName = 'export.kml';
this.export_(features, format, fileName, mimeType);
};
/**
* Export features using a given format to a specific filename and download
* the result to the browser. The projection of the exported features is:
* `EPSG:4326`.
* @param {Array.<ol.Feature>} features Array of vector features.
* @param {ol.format.Feature} format Format
* @param {string} fileName Name of the file.
* @param {string=} opt_mimeType Mime type. Defaults to 'text/plain'.
* @private
*/
ngeo.FeatureHelper.prototype.export_ = function(features, format, fileName,
opt_mimeType) {
var mimeType = opt_mimeType !== undefined ? opt_mimeType : 'text/plain';
// clone the features to apply the original style to the clone
// (the original may have select style active)
var clones = [];
var clone;
features.forEach(function(feature) {
clone = new ol.Feature(feature.getProperties());
this.setStyle(clone, false);
clones.push(clone);
}, this);
var writeOptions = this.projection_ ? {
dataProjection: 'EPSG:4326',
featureProjection: this.projection_
} : {};
var data = format.writeFeatures(clones, writeOptions);
this.download_(
data, fileName, mimeType + ';charset=utf-8');
};
// === OTHER UTILITY METHODS ===
/**
* @param {ngeox.style.TextOptions} options Options.
* @return {ol.style.Text} Style.
* @private
*/
ngeo.FeatureHelper.prototype.createTextStyle_ = function(options) {
if (options.angle) {
var angle = options.angle !== undefined ? options.angle : 0;
var rotation = angle * Math.PI / 180;
options.rotation = rotation;
delete options.angle;
}
options.font = ['normal', (options.size || 10) + 'pt', 'Arial'].join(' ');
if (options.color) {
options.fill = new ol.style.Fill({color: options.color || [0, 0, 0, 1]});
delete options.color;
}
options.stroke = new ol.style.Stroke({
color: [255, 255, 255, 1],
width: options.width || 3
});
delete options.width;
return new ol.style.Text(options);
};
/**
* Get the measure of the given feature as a string. For points, you can format
* the result by setting a filter to apply on the coordinate with the function
* {@link ngeo.FeatureHelper.prototype.setPointFilterFn}.
* @param {ol.Feature} feature Feature.
* @return {string} Measure.
* @export
*/
ngeo.FeatureHelper.prototype.getMeasure = function(feature) {
var geometry = feature.getGeometry();
goog.asserts.assert(geometry, 'Geometry should be truthy');
var measure = '';
if (geometry instanceof ol.geom.Polygon) {
if (this.getType(feature) === ngeo.GeometryType.CIRCLE) {
var azimut = /** @type {number} */ (
feature.get(ngeo.FeatureProperties.AZIMUT));
var line = this.getRadiusLine(feature, azimut);
measure = ngeo.interaction.MeasureAzimut.getFormattedAzimutRadius(
line, this.projection_, this.decimals_, this.format_);
} else {
measure = ngeo.interaction.Measure.getFormattedArea(
geometry, this.projection_, this.decimals_, this.format_);
}
} else if (geometry instanceof ol.geom.LineString) {
measure = ngeo.interaction.Measure.getFormattedLength(
geometry, this.projection_, this.decimals_, this.format_);
} else if (geometry instanceof ol.geom.Point) {
if (this.pointFilterFn_ === null) {
measure = ngeo.interaction.Measure.getFormattedPoint(
geometry, this.projection_, this.decimals_);
} else {
var coordinates = geometry.getCoordinates();
var args = this.pointFilterArgs_.slice(0);
args.unshift(coordinates);
measure = this.pointFilterFn_.apply(this, args);
}
}
return measure;
};
/**
* Return the type of geometry of a feature using its geometry property and
* some inner properties.
* @param {ol.Feature} feature Feature.
* @return {string} The type of geometry.
* @export
*/
ngeo.FeatureHelper.prototype.getType = function(feature) {
var geometry = feature.getGeometry();
goog.asserts.assert(geometry, 'Geometry should be thruthy');
var type;
if (geometry instanceof ol.geom.Point) {
if (feature.get(ngeo.FeatureProperties.IS_TEXT)) {
type = ngeo.GeometryType.TEXT;
} else {
type = ngeo.GeometryType.POINT;
}
} else if (geometry instanceof ol.geom.Polygon) {
if (feature.get(ngeo.FeatureProperties.IS_CIRCLE)) {
type = ngeo.GeometryType.CIRCLE;
} else if (feature.get(ngeo.FeatureProperties.IS_RECTANGLE)) {
type = ngeo.GeometryType.RECTANGLE;
} else {
type = ngeo.GeometryType.POLYGON;
}
} else if (geometry instanceof ol.geom.LineString) {
type = ngeo.GeometryType.LINE_STRING;
}
goog.asserts.assert(type, 'Type should be thruthy');
return type;
};
/**
* This method first checks if a feature's extent intersects with the map view
* extent. If it doesn't, then the view gets recentered with an animation to
* the center of the feature.
* @param {ol.Feature} feature Feature.
* @param {ol.Map} map Map.
* @param {number=} opt_panDuration Pan animation duration. Defaults to `250`.
* @export
*/
ngeo.FeatureHelper.prototype.panMapToFeature = function(feature, map,
opt_panDuration) {
var panDuration = opt_panDuration !== undefined ? opt_panDuration : 250;
var size = map.getSize();
goog.asserts.assertArray(size);
var view = map.getView();
var extent = view.calculateExtent(size);
var geometry = feature.getGeometry();
if (!geometry.intersectsExtent(extent)) {
var mapCenter = view.getCenter();
goog.asserts.assertArray(mapCenter);
map.beforeRender(ol.animation.pan({
source: mapCenter,
duration: panDuration
}));
var featureCenter;
if (geometry instanceof ol.geom.LineString) {
featureCenter = geometry.getCoordinateAt(0.5);
} else if (geometry instanceof ol.geom.Polygon) {
featureCenter = geometry.getInteriorPoint().getCoordinates();
} else if (geometry instanceof ol.geom.Point) {
featureCenter = geometry.getCoordinates();
} else {
featureCenter = ol.extent.getCenter(geometry.getExtent());
}
map.getView().setCenter(featureCenter);
}
};
/**
* This method generates a line string geometry that represents the radius for
* a given azimut. It expects the input geometry to be a circle.
* @param {ol.Feature} feature Feature.
* @param {number} azimut Azimut in degrees.
* @return {ol.geom.LineString} The line geometry.
*/
ngeo.FeatureHelper.prototype.getRadiusLine = function(feature, azimut) {
var geometry = feature.getGeometry();
// Determine the radius for the circle
var extent = geometry.getExtent();
var radius = (extent[3] - extent[1]) / 2;
var center = ol.extent.getCenter(geometry.getExtent());
var x = Math.cos((azimut - 90) * Math.PI / 180) * radius;
var y = -Math.sin((azimut - 90) * Math.PI / 180) * radius;
var endPoint = [x + center[0], y + center[1]];
return new ol.geom.LineString([center, endPoint]);
};
ngeo.module.service('ngeoFeatureHelper', ngeo.FeatureHelper);
// === FORMAT TYPES ===
/**
* @enum {string}
* @export
*/
ngeo.FeatureHelper.FormatType = {
/**
* @type {string}
* @export
*/
GPX: 'GPX',
/**
* @type {string}
* @export
*/
KML: 'KML'
};
|
// Dependencies
const React = require('react');
import builder from 'focus-core/component/builder';
const {reduce} = require('lodash/collection');
// Components
const Button = require('../../common/button/action').component;
const SelectAction = require('../../common/select-action').component;
const actionContextualMixin = {
/**
* Display name.
*/
displayName: 'ActionContextual',
/**
* Init default props.
* @returns {object} Default props.
*/
getDefaultProps() {
return {
buttonComponent: Button,
operationList: [],
operationParam: undefined
};
},
/**
* Init default state.
* @returns {oject} Initial state.
*/
getInitialState() {
return {
isSecondaryActionListExpanded: false // true if secondary actionList is expanded.
};
},
/**
* Handle contextual action on click.
* @param {string} key Action key.
* @return {function} action handler.
*/
_handleAction(key) {
const {operationList, operationParam} = this.props;
return event => {
event.preventDefault();
event.stopPropagation();
if (operationParam) {
operationList[key].action(operationParam);
} else {
operationList[key].action();
}
};
},
/**
* render the component.
* @returns {JSX} Html code.
*/
render() {
const {operationList, operationParam, buttonComponent} = this.props;
const {isSecondaryActionListExpanded} = this.state;
const {primaryActionList, secondaryActionList} = reduce(operationList, (actionLists, operation, key) => {
let {primaryActionList: primaryActions, secondaryActionList: secondaryActions} = actionLists;
if (1 === operation.priority) {
primaryActions.push(
<this.props.buttonComponent
handleOnClick={this._handleAction(key)}
icon={operation.icon}
iconLibrary={operation.iconLibrary}
key={key}
label={operation.label}
shape={operation.style.shape || 'icon'}
style={operation.style || {}}
type='button'
{...this.props}
{...operation}
/>
);
} else {
secondaryActions.push(operation);
}
return actionLists;
}, {primaryActionList: [], secondaryActionList: []}, this);
return (
<div className='list-action-contextual'>
<span>{primaryActionList}</span>
<SelectAction
isExpanded={isSecondaryActionListExpanded}
operationList={secondaryActionList}
operationParam={operationParam}
/>
</div>
);
}
};
module.exports = builder(actionContextualMixin);
|
import {generateAction} from '../generators/action';
import {generateComponent} from '../generators/component';
import {generateContainer} from '../generators/container';
import {generateCollection} from '../generators/collection';
import {generateMethod} from '../generators/method';
import {generatePublication} from '../generators/publication';
import {generateModule} from '../generators/module';
/**
* Get a generator given an entity type. Returns undefined if there is no
* generator for the type.
*
* @param type {String} - type of entity to generate
* @return generator {Function} - generator for that entity
*/
export function getGenerator(type) {
const generatorMap = {
action: generateAction,
component: generateComponent,
container: generateContainer,
collection: generateCollection,
method: generateMethod,
publication: generatePublication,
module: generateModule
};
return generatorMap[type];
}
function validateName(name) {
let entityName;
if (/.*:.*/.test(name)) {
const split = name.split(':');
if (split.length !== 2) {
return false;
}
entityName = split[1];
} else {
entityName = name;
}
if (entityName.indexOf('.') > -1) {
return false;
}
return true;
}
export default function generate(type, name, options = {}, config) {
let generator = getGenerator(type);
if (!generator) {
console.log(`Could not find a generator for ${type}`);
console.log('Run `mantra generate --help` for more options.');
return;
}
if (!validateName(name)) {
console.log(`${name} is an invalid name`);
console.log('Name of the file cannot contain any dots.');
return;
}
generator(name, options, config);
}
|
var functions = {
one: function (param1) {
return 1;
},
onePartialSum: function (param1) {
return param1;
},
linear01: function (param1) {
return param1.times(0.01);
},
linear05: function (param1) {
return param1.times(0.05);
},
linear1: function (param1) {
return param1;
},
linearEzPz: function (param1) {
return param1.dividedBy(3).ceil();
},
linear2: function (param1) {
return param1.times(2);
},
linear3: function (param1) {
return param1.times(3);
},
linear5: function (param1) {
return param1.times(5);
},
linear10: function (param1) {
return param1.times(10);
},
linear11: function (param1) {
return param1.times(11);
},
linear15: function (param1) {
return param1.times(15);
},
linear20: function (param1) {
return param1.times(20);
},
linear25: function (param1) {
return param1.times(25);
},
linear30: function (param1) {
return param1.times(30);
},
linear35: function (param1) {
return param1.times(35);
},
linear40: function (param1) {
return param1.times(40);
},
linear45: function (param1) {
return param1.times(45);
},
linear50: function (param1) {
return param1.times(50);
},
linear100: function (param1) {
return param1.times(100);
},
linear0_25: function (param1) {
return param1.times(0.25);
},
linear: function (param1, param2) {
param2 = new Decimal(param2);
return param1.times(param2);
},
linearPartialSum: function (param1, param2) {
param2 = new Decimal(param2);
return param1.times(param1.plus(1)).times(0.5).times(param2);
},
exponential: function (param1, param2) {
param2 = new Decimal(param2);
return param2.pow(param1);
},
exponentialPartialSum: function (param1, param2) {
var r = new Decimal(param2);
var one = new Decimal(1);
return one.minus(r.pow(param1.plus(1))).dividedBy(one.minus(r));
},
polynomial1_5: function (param1) {
return param1.times(param1.sqrt()).ceil();
},
/* Approximation */
polynomial1_5PartialSum: function (param1) {
return Decimal.div(2, 5).times(param1.pow(Decimal.div(5, 2)))
.plus(Decimal.div(1, 2).times(param1.pow(Decimal.div(3, 2))))
.plus(Decimal.div(1, 8).times(param1.pow(Decimal.div(1, 2))))
.plus(Decimal.div(1, 1920).times(param1.pow(Decimal.div(-3, 2)))).ceil();
},
quadratic: function (param1) {
return param1.pow(2);
},
cubic: function (param1) {
return param1.pow(3);
}
};
|
'use strict';
var isValid = module.exports.isValid = require('./borderColor').isValid;
module.exports.definition = {
set: function (v) {
if (isValid(v)) {
this.setProperty('border-left-color', v);
}
},
get: function () {
return this.getPropertyValue('border-left-color');
},
enumerable: true
};
|
const { writeSeed, loadSeedId, genArray, casual } = require('../helpers')
module.exports = async function generate () {
const userIds = loadSeedId('user')
const bookIds = loadSeedId('book')
let result = []
for (let i = 0; i < bookIds.length; i += 1) {
const bookId = bookIds[i]
result = [...result, ...genArray(userIds, 1000).map(userId => ({
_id: casual.objectId,
userId,
bookId
}))]
}
writeSeed('book-follower', result)
}
|
var expect = require('expect.js'),
async = require('async'),
revisionGuardStore = require('../../lib/revisionGuardStore'),
Base = require('../../lib/revisionGuardStore/base'),
InMemory = require('../../lib/revisionGuardStore/databases/inmemory');
describe('revisionGuardStore', function() {
it('it should have the correct interface', function() {
expect(revisionGuardStore).to.be.an('object');
expect(revisionGuardStore.create).to.be.a('function');
expect(revisionGuardStore.Store).to.eql(Base);
});
describe('calling create', function() {
describe('without options', function() {
it('it should return with the in memory store', function() {
var store = revisionGuardStore.create();
expect(store).to.be.a('object');
});
describe('but with a callback', function() {
it('it should callback with store object', function(done) {
revisionGuardStore.create(function(err, store) {
expect(err).not.to.be.ok();
expect(store).to.be.a('object');
done();
});
});
});
});
describe('with options of a non existing db implementation', function() {
it('it should throw an error', function() {
expect(function() {
revisionGuardStore.create({ type: 'strangeDb' });
}).to.throwError();
});
it('it should callback with an error', function(done) {
expect(function() {
revisionGuardStore.create({ type: 'strangeDb' }, function(err) {
expect(err).to.be.ok();
done();
});
}).to.throwError();
});
});
describe('with options of an own db implementation', function() {
it('it should return with the an instance of that implementation', function() {
var store = revisionGuardStore.create({ type: InMemory });
expect(store).to.be.a(InMemory);
});
});
describe('with options containing a type property with the value of', function() {
var types = ['inmemory', 'mongodb', 'tingodb', 'redis'/*, 'azuretable'*/];
types.forEach(function(type) {
describe('"' + type + '"', function() {
var store;
describe('without callback', function() {
afterEach(function(done) {
store.disconnect(done);
});
it('it should return with the correct store', function() {
store = revisionGuardStore.create({ type: type });
expect(store).to.be.a('object');
expect(store).to.be.a(Base);
expect(store.connect).to.be.a('function');
expect(store.disconnect).to.be.a('function');
expect(store.getNewId).to.be.a('function');
expect(store.get).to.be.a('function');
expect(store.set).to.be.a('function');
expect(store.saveLastEvent).to.be.a('function');
expect(store.getLastEvent).to.be.a('function');
});
});
describe('with callback', function() {
afterEach(function(done) {
store.disconnect(done);
});
it('it should return with the correct store', function(done) {
revisionGuardStore.create({ type: type }, function(err, resS) {
expect(err).not.to.be.ok();
store = resS;
expect(store).to.be.a('object');
done();
});
});
});
describe('calling connect', function () {
afterEach(function(done) {
store.disconnect(done);
});
describe('with a callback', function () {
it('it should callback successfully', function(done) {
store = revisionGuardStore.create({ type: type });
store.connect(function (err) {
expect(err).not.to.be.ok();
done();
});
});
});
describe('without a callback', function () {
it('it should emit connect', function(done) {
store = revisionGuardStore.create({ type: type });
store.once('connect', done);
store.connect();
});
});
});
describe('having connected', function() {
describe('calling disconnect', function() {
beforeEach(function(done) {
store = revisionGuardStore.create({ type: type });
store.connect(done);
});
it('it should callback successfully', function(done) {
store.disconnect(function(err) {
expect(err).not.to.be.ok();
done();
});
});
it('it should emit disconnect', function(done) {
store.once('disconnect', done);
store.disconnect();
});
});
describe('using the store', function() {
before(function(done) {
store = revisionGuardStore.create({ type: type });
store.connect(done);
});
describe('calling getNewId', function() {
it('it should callback with a new Id as string', function(done) {
store.getNewId(function(err, id) {
expect(err).not.to.be.ok();
expect(id).to.be.a('string');
done();
});
});
});
describe('having no entries', function() {
before(function(done) {
store.clear(done);
});
describe('calling get', function() {
it('it should callback with an empty revision', function(done) {
store.get('23', function (err, rev) {
expect(err).not.to.be.ok();
expect(rev).not.to.be.ok();
done();
});
});
});
describe('calling set', function() {
it('it should work as expected', function(done) {
store.set('23', 5, 4, function (err) {
expect(err).not.to.be.ok();
store.get('23', function (err, rev) {
expect(err).not.to.be.ok();
expect(rev).to.eql(5);
done();
});
});
});
describe('with a current revision that is less than expected', function () {
it('it should callback with a ConcurrencyError', function(done) {
store.set('23', 6, 4, function (err) {
expect(err).to.be.ok();
expect(err.name).to.eql('ConcurrencyError');
store.get('23', function (err, rev) {
expect(err).not.to.be.ok();
expect(rev).to.eql(5);
done();
});
});
});
});
describe('with a current revision that is greater than expected', function () {
it('it should callback with a ConcurrencyError', function(done) {
store.set('23', 6, 7, function (err) {
expect(err).to.be.ok();
expect(err.name).to.eql('ConcurrencyError');
store.get('23', function (err, rev) {
expect(err).not.to.be.ok();
expect(rev).to.eql(5);
done();
});
});
});
});
describe('with a current revision that is equal than expected', function () {
it('it should callback with a ConcurrencyError', function(done) {
store.set('23', 6, 6, function (err) {
expect(err).to.be.ok();
expect(err.name).to.eql('ConcurrencyError');
store.get('23', function (err, rev) {
expect(err).not.to.be.ok();
expect(rev).to.eql(5);
done();
});
});
});
});
describe('with a current revision that is null', function () {
it('it should callback without an error', function(done) {
store.set('2345', 2, null, function (err) {
expect(err).not.to.be.ok();
store.get('2345', function (err, rev) {
expect(err).not.to.be.ok();
expect(rev).to.eql(2);
done();
});
});
});
});
describe('with a current revision that is correct', function () {
it('it should callback without an error', function(done) {
store.set('23', 6, 5, function (err) {
expect(err).not.to.be.ok();
store.get('23', function (err, rev) {
expect(err).not.to.be.ok();
expect(rev).to.eql(6);
done();
});
});
});
});
});
describe('saving the last event', function() {
it('it should work as expected', function (done) {
store.getLastEvent(function (err, evt) {
expect(err).not.to.be.ok();
expect(evt).not.to.be.ok();
store.saveLastEvent({ my: 'evt' }, function (err) {
expect(err).not.to.be.ok();
store.getLastEvent(function (err, evt) {
expect(err).not.to.be.ok();
expect(evt.my).to.eql('evt');
store.clear(function (err) {
expect(err).not.to.be.ok();
store.getLastEvent(function (err, evt) {
expect(err).not.to.be.ok();
expect(evt).not.to.be.ok();
done();
});
});
});
});
});
});
});
});
});
});
});
});
});
});
});
|
'use strict';
import MongoDB from 'mongodb';
const mongodb = MongoDB.MongoClient;
import {DB_NAME, COLLECTION_NAME, DB_HOSTNAME, DB_PORT} from 'blam-constants';
export default class DBWriter
{
constructor() {
this['db'] = null;
this['collection'] = null;
}
init() {
return new Promise( (resolve) => {
let uri = 'mongodb://' + DB_HOSTNAME + ":" + DB_PORT + "/" + DB_NAME;
console.log("Connecting to DB Server " + uri + " ...");
let self_ = this;
mongodb.connect(uri, function (err, db) {
if (err) {
throw new Error("Failed to connect DB Server " + url);
}
self_['db'] = db;
self_['collection'] = db.collection(COLLECTION_NAME);
resolve();
});
});
}
connected() {
return this['db'] ? true : false;
}
close() {
if (!this['db']) { throw new Error("DB does not open"); }
this['db'].close();
}
add(info) {
return new Promise( (resolve) => {
if (!this['collection']) { throw new Error("Collection is null"); }
this['collection'].insert(info, function (err, record) {
if (err) { throw new Error("Failed to add (data=" + info + ")"); }
console.log("Suceeded insert.");
resolve(record);
});
});
}
update(key, data) {
return new Promise( (resolve) => {
if (!this['collection']) { throw new Error("Collection is null"); }
this['collection'].update(key, {$set: data}, function (err) {
if (err) { throw new Error("Failed to update (key=" + key + ", err=" + err + ")"); }
resolve();
});
});
}
findAll() {
return new Promise( (resolve) => {
if (!this['collection']) { throw new Error("Collection is null"); }
let results = this['collection'].find();
resolve(results);
});
}
countAll() {
return new Promise( (resolve) => {
if (!this['collection']) { throw new Error("Collection is null"); }
this['collection'].count({}, (err, count) => {
if (err) {
throw new Error("Failed to process countAll");
}
resolve(count);
});
});
}
findOne(key) {
return new Promise( (resolve) => {
if (!this['collection']) { throw new Error("Collection is null"); }
this['collection'].findOne(key, (err, result) => {
if (err) {
throw new Error("Failed to process findOne");
}
resolve(result);
});
});
}
remove(key) {
return new Promise( (resolve) => {
if (!this['collection']) { throw new Error("Collection is null"); }
this['collection'].remove(key, (err, result) => {
if (err) {
throw new Error("Failed to process remove");
}
resolve(result);
});
});
}
}
|
exports.deps = [
{
"block": "baz"
}
];
exports.depsByTechs = {
"": {}
};
|
module.exports = function (grunt) {
grunt.initConfig({
coffeelint: {
app: ['lib/*.coffee'],
options: {
max_line_length: {
level: 'ignore'
},
line_endings: {
value: "unix",
level: "error"
},
no_trailing_semicolons: {
level: "ignore"
}
}
},
coffee: {
compile: {
files: [{
expand: true, // Enable dynamic expansion.
cwd: 'lib/', // Src matches are relative to this path.
src: ['**/*.coffee'], // Actual pattern(s) to match.
dest: 'lib/', // Destination path prefix.
ext: '.js' // Dest filepaths will have this extension.
}],
options: {
bare: true // Skip surrounding IIFE in compiled output.
}
}
},
concat: {
"firepadjs": {
options: {
banner: [
'/*!',
' * Firepad-RethinkDB is an open-source, collaborative code and text editor. It was designed',
' * to be embedded inside larger applications. Since it uses RethinkDB as a backend,',
' * it requires server-side code that can be easily installed.',
' *',
' * Firepad-RethinkDB 0.0.0',
' * http://www.unrestrictedcoding.com/',
' * License: MIT',
' * Copyright: 2015 Shannon Duncan',
' * With code from ot.js (Copyright 2012-2013 Tim Baumann)',
' * With code from Firepad (Copyright 2014 Firebase) MIT',
' */\n',
'(function (name, definition, context) {',
' //try CommonJS, then AMD (require.js), then use global.',
' if (typeof module != \'undefined\' && module.exports) module.exports = definition();',
' else if (typeof context[\'define\'] == \'function\' && context[\'define\'][\'amd\']) define(definition);',
' else context[name] = definition();',
'})(\'Firepad\', function () {'
].join('\n'),
footer: "\nreturn firepad.Firepad; }, this);"
},
"src": [
"lib/utils.js",
"lib/span.js",
"lib/text-op.js",
"lib/text-operation.js",
"lib/annotation-list.js",
"lib/cursor.js",
"lib/firebase-adapter.js",
"lib/rethinkdb-adapter.js",
"lib/rich-text-toolbar.js",
"lib/wrapped-operation.js",
"lib/undo-manager.js",
"lib/client.js",
"lib/editor-client.js",
"lib/ace-adapter.js",
"lib/constants.js",
"lib/entity-manager.js",
"lib/entity.js",
"lib/rich-text-codemirror.js",
"lib/rich-text-codemirror-adapter.js",
"lib/formatting.js",
"lib/text.js",
"lib/line-formatting.js",
"lib/line.js",
"lib/parse-html.js",
"lib/serialize-html.js",
"lib/text-pieces-to-inserts.js",
"lib/headless.js",
"lib/firepad.js"
],
"dest": "dist/firepad.js"
}
},
uglify: {
options: {
preserveComments: "some"
},
"firepad-min-js": {
src: "dist/firepad.js",
dest: "dist/firepad.min.js"
}
},
copy: {
toBuild: {
files: [
{
src: 'font/firepad.eot',
dest: 'dist/firepad.eot'
},
{
src: 'lib/firepad.css',
dest: 'dist/firepad.css'
},
]
}
},
watch: {
files: ['lib/*.js', 'lib/*.coffee', 'lib/*.css'],
tasks: ['build']
},
// Unit tests
karma: {
options: {
configFile: 'test/karma.conf.js',
},
unit: {
autowatch: false,
singleRun: true
}
}
});
grunt.loadNpmTasks('grunt-coffeelint');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-karma');
// Tasks
grunt.registerTask('test', ['karma:unit']);
grunt.registerTask('build', ['coffeelint', 'coffee', 'concat', 'uglify', 'copy'])
grunt.registerTask('default', ['build', 'test']);
};
|
// flow-typed signature: 1369f8072e3ab3023d55b479bf6efbe8
// flow-typed version: <<STUB>>/webpack_v^3.5.5/flow_v0.54.0
/**
* This is an autogenerated libdef stub for:
*
* 'webpack'
*
* Fill this stub out by replacing all the `any` types.
*
* Once filled out, we encourage you to share your work with the
* community by sending a pull request to:
* https://github.com/flowtype/flow-typed
*/
declare module 'webpack' {
declare module.exports: any;
}
/**
* We include stubs for each file inside this npm package in case you need to
* require those files directly. Feel free to delete any files that aren't
* needed.
*/
declare module 'webpack/bin/config-optimist' {
declare module.exports: any;
}
declare module 'webpack/bin/config-yargs' {
declare module.exports: any;
}
declare module 'webpack/bin/convert-argv' {
declare module.exports: any;
}
declare module 'webpack/bin/webpack' {
declare module.exports: any;
}
declare module 'webpack/buildin/amd-define' {
declare module.exports: any;
}
declare module 'webpack/buildin/amd-options' {
declare module.exports: any;
}
declare module 'webpack/buildin/global' {
declare module.exports: any;
}
declare module 'webpack/buildin/harmony-module' {
declare module.exports: any;
}
declare module 'webpack/buildin/module' {
declare module.exports: any;
}
declare module 'webpack/buildin/system' {
declare module.exports: any;
}
declare module 'webpack/hot/dev-server' {
declare module.exports: any;
}
declare module 'webpack/hot/emitter' {
declare module.exports: any;
}
declare module 'webpack/hot/log-apply-result' {
declare module.exports: any;
}
declare module 'webpack/hot/log' {
declare module.exports: any;
}
declare module 'webpack/hot/only-dev-server' {
declare module.exports: any;
}
declare module 'webpack/hot/poll' {
declare module.exports: any;
}
declare module 'webpack/hot/signal' {
declare module.exports: any;
}
declare module 'webpack/lib/AmdMainTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/APIPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/AsyncDependenciesBlock' {
declare module.exports: any;
}
declare module 'webpack/lib/AutomaticPrefetchPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/BannerPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/BasicEvaluatedExpression' {
declare module.exports: any;
}
declare module 'webpack/lib/CachePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/CaseSensitiveModulesWarning' {
declare module.exports: any;
}
declare module 'webpack/lib/Chunk' {
declare module.exports: any;
}
declare module 'webpack/lib/ChunkRenderError' {
declare module.exports: any;
}
declare module 'webpack/lib/ChunkTemplate' {
declare module.exports: any;
}
declare module 'webpack/lib/compareLocations' {
declare module.exports: any;
}
declare module 'webpack/lib/CompatibilityPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/Compilation' {
declare module.exports: any;
}
declare module 'webpack/lib/Compiler' {
declare module.exports: any;
}
declare module 'webpack/lib/ConstPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/ContextModule' {
declare module.exports: any;
}
declare module 'webpack/lib/ContextModuleFactory' {
declare module.exports: any;
}
declare module 'webpack/lib/ContextReplacementPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/DefinePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/DelegatedModule' {
declare module.exports: any;
}
declare module 'webpack/lib/DelegatedModuleFactoryPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/DelegatedPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/AMDDefineDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/AMDDefineDependencyParserPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/AMDPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/AMDRequireArrayDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/AMDRequireContextDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/AMDRequireDependenciesBlock' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/AMDRequireDependenciesBlockParserPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/AMDRequireDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/AMDRequireItemDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/CommonJsPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/CommonJsRequireContextDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/CommonJsRequireDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/CommonJsRequireDependencyParserPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ConstDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ContextDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ContextDependencyHelpers' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ContextDependencyTemplateAsId' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ContextDependencyTemplateAsRequireCall' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ContextElementDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/CriticalDependencyWarning' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/DelegatedExportsDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/DelegatedSourceDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/DepBlockHelpers' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/DllEntryDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/getFunctionExpression' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/HarmonyAcceptDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/HarmonyAcceptImportDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/HarmonyCompatibilityDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/HarmonyDetectionParserPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/HarmonyExportDependencyParserPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/HarmonyExportExpressionDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/HarmonyExportHeaderDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/HarmonyExportImportedSpecifierDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/HarmonyExportSpecifierDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/HarmonyImportDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/HarmonyImportDependencyParserPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/HarmonyImportSpecifierDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/HarmonyModulesHelpers' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/HarmonyModulesPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ImportContextDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ImportDependenciesBlock' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ImportDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ImportEagerContextDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ImportEagerDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ImportLazyContextDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ImportLazyOnceContextDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ImportParserPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ImportPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ImportWeakContextDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ImportWeakDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/LoaderDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/LoaderPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/LocalModule' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/LocalModuleDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/LocalModulesHelpers' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ModuleDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ModuleDependencyTemplateAsId' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ModuleDependencyTemplateAsRequireId' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ModuleHotAcceptDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/ModuleHotDeclineDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/MultiEntryDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/NullDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/PrefetchDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/RequireContextDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/RequireContextDependencyParserPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/RequireContextPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/RequireEnsureDependenciesBlock' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/RequireEnsureDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/RequireEnsureItemDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/RequireEnsurePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/RequireHeaderDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/RequireIncludeDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/RequireIncludeDependencyParserPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/RequireIncludePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/RequireResolveContextDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/RequireResolveDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/RequireResolveDependencyParserPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/RequireResolveHeaderDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/SingleEntryDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/SystemPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/UnsupportedDependency' {
declare module.exports: any;
}
declare module 'webpack/lib/dependencies/WebpackMissingModule' {
declare module.exports: any;
}
declare module 'webpack/lib/DependenciesBlock' {
declare module.exports: any;
}
declare module 'webpack/lib/DependenciesBlockVariable' {
declare module.exports: any;
}
declare module 'webpack/lib/Dependency' {
declare module.exports: any;
}
declare module 'webpack/lib/DllEntryPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/DllModule' {
declare module.exports: any;
}
declare module 'webpack/lib/DllModuleFactory' {
declare module.exports: any;
}
declare module 'webpack/lib/DllPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/DllReferencePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/DynamicEntryPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/EntryModuleNotFoundError' {
declare module.exports: any;
}
declare module 'webpack/lib/EntryOptionPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/Entrypoint' {
declare module.exports: any;
}
declare module 'webpack/lib/EnvironmentPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/ErrorHelpers' {
declare module.exports: any;
}
declare module 'webpack/lib/EvalDevToolModulePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/EvalDevToolModuleTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/EvalSourceMapDevToolModuleTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/EvalSourceMapDevToolPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/ExportPropertyMainTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/ExtendedAPIPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/ExternalModule' {
declare module.exports: any;
}
declare module 'webpack/lib/ExternalModuleFactoryPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/ExternalsPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/FlagDependencyExportsPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/FlagDependencyUsagePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/FlagInitialModulesAsUsedPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/formatLocation' {
declare module.exports: any;
}
declare module 'webpack/lib/FunctionModulePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/FunctionModuleTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/HashedModuleIdsPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/HotModuleReplacement.runtime' {
declare module.exports: any;
}
declare module 'webpack/lib/HotModuleReplacementPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/HotUpdateChunkTemplate' {
declare module.exports: any;
}
declare module 'webpack/lib/IgnorePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/JsonpChunkTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/JsonpExportMainTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/JsonpHotUpdateChunkTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/JsonpMainTemplate.runtime' {
declare module.exports: any;
}
declare module 'webpack/lib/JsonpMainTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/JsonpTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/LibManifestPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/LibraryTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/LoaderOptionsPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/LoaderTargetPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/MainTemplate' {
declare module.exports: any;
}
declare module 'webpack/lib/MemoryOutputFileSystem' {
declare module.exports: any;
}
declare module 'webpack/lib/Module' {
declare module.exports: any;
}
declare module 'webpack/lib/ModuleBuildError' {
declare module.exports: any;
}
declare module 'webpack/lib/ModuleDependencyError' {
declare module.exports: any;
}
declare module 'webpack/lib/ModuleDependencyWarning' {
declare module.exports: any;
}
declare module 'webpack/lib/ModuleError' {
declare module.exports: any;
}
declare module 'webpack/lib/ModuleFilenameHelpers' {
declare module.exports: any;
}
declare module 'webpack/lib/ModuleNotFoundError' {
declare module.exports: any;
}
declare module 'webpack/lib/ModuleParseError' {
declare module.exports: any;
}
declare module 'webpack/lib/ModuleReason' {
declare module.exports: any;
}
declare module 'webpack/lib/ModuleTemplate' {
declare module.exports: any;
}
declare module 'webpack/lib/ModuleWarning' {
declare module.exports: any;
}
declare module 'webpack/lib/MovedToPluginWarningPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/MultiCompiler' {
declare module.exports: any;
}
declare module 'webpack/lib/MultiEntryPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/MultiModule' {
declare module.exports: any;
}
declare module 'webpack/lib/MultiModuleFactory' {
declare module.exports: any;
}
declare module 'webpack/lib/MultiStats' {
declare module.exports: any;
}
declare module 'webpack/lib/MultiWatching' {
declare module.exports: any;
}
declare module 'webpack/lib/NamedChunksPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/NamedModulesPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/NewWatchingPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/node/NodeChunkTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/node/NodeEnvironmentPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/node/NodeHotUpdateChunkTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/node/NodeMainTemplate.runtime' {
declare module.exports: any;
}
declare module 'webpack/lib/node/NodeMainTemplateAsync.runtime' {
declare module.exports: any;
}
declare module 'webpack/lib/node/NodeMainTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/node/NodeOutputFileSystem' {
declare module.exports: any;
}
declare module 'webpack/lib/node/NodeSourcePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/node/NodeTargetPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/node/NodeTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/node/NodeWatchFileSystem' {
declare module.exports: any;
}
declare module 'webpack/lib/NodeStuffPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/NoEmitOnErrorsPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/NoErrorsPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/NormalModule' {
declare module.exports: any;
}
declare module 'webpack/lib/NormalModuleFactory' {
declare module.exports: any;
}
declare module 'webpack/lib/NormalModuleReplacementPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/NullFactory' {
declare module.exports: any;
}
declare module 'webpack/lib/optimize/AggressiveMergingPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/optimize/AggressiveSplittingPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/optimize/ChunkModuleIdRangePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/optimize/CommonsChunkPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/optimize/ConcatenatedModule' {
declare module.exports: any;
}
declare module 'webpack/lib/optimize/DedupePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/optimize/EnsureChunkConditionsPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/optimize/FlagIncludedChunksPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/optimize/LimitChunkCountPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/optimize/MergeDuplicateChunksPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/optimize/MinChunkSizePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/optimize/ModuleConcatenationPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/optimize/OccurrenceOrderPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/optimize/RemoveEmptyChunksPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/optimize/RemoveParentModulesPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/optimize/UglifyJsPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/OptionsApply' {
declare module.exports: any;
}
declare module 'webpack/lib/OptionsDefaulter' {
declare module.exports: any;
}
declare module 'webpack/lib/Parser' {
declare module.exports: any;
}
declare module 'webpack/lib/ParserHelpers' {
declare module.exports: any;
}
declare module 'webpack/lib/performance/AssetsOverSizeLimitWarning' {
declare module.exports: any;
}
declare module 'webpack/lib/performance/EntrypointsOverSizeLimitWarning' {
declare module.exports: any;
}
declare module 'webpack/lib/performance/NoAsyncChunksWarning' {
declare module.exports: any;
}
declare module 'webpack/lib/performance/SizeLimitsPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/PrefetchPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/prepareOptions' {
declare module.exports: any;
}
declare module 'webpack/lib/ProgressPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/ProvidePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/RawModule' {
declare module.exports: any;
}
declare module 'webpack/lib/RecordIdsPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/removeAndDo' {
declare module.exports: any;
}
declare module 'webpack/lib/RequestShortener' {
declare module.exports: any;
}
declare module 'webpack/lib/RequireJsStuffPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/RuleSet' {
declare module.exports: any;
}
declare module 'webpack/lib/SetVarMainTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/SingleEntryPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/SizeFormatHelpers' {
declare module.exports: any;
}
declare module 'webpack/lib/SourceMapDevToolModuleOptionsPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/SourceMapDevToolPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/Stats' {
declare module.exports: any;
}
declare module 'webpack/lib/Template' {
declare module.exports: any;
}
declare module 'webpack/lib/TemplatedPathPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/UmdMainTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/UnsupportedFeatureWarning' {
declare module.exports: any;
}
declare module 'webpack/lib/UseStrictPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/util/identifier' {
declare module.exports: any;
}
declare module 'webpack/lib/util/Semaphore' {
declare module.exports: any;
}
declare module 'webpack/lib/util/SortableSet' {
declare module.exports: any;
}
declare module 'webpack/lib/validateSchema' {
declare module.exports: any;
}
declare module 'webpack/lib/WarnCaseSensitiveModulesPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/WatchIgnorePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/web/WebEnvironmentPlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/webpack' {
declare module.exports: any;
}
declare module 'webpack/lib/webpack.web' {
declare module.exports: any;
}
declare module 'webpack/lib/WebpackError' {
declare module.exports: any;
}
declare module 'webpack/lib/WebpackOptionsApply' {
declare module.exports: any;
}
declare module 'webpack/lib/WebpackOptionsDefaulter' {
declare module.exports: any;
}
declare module 'webpack/lib/WebpackOptionsValidationError' {
declare module.exports: any;
}
declare module 'webpack/lib/webworker/WebWorkerChunkTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/webworker/WebWorkerHotUpdateChunkTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/webworker/WebWorkerMainTemplate.runtime' {
declare module.exports: any;
}
declare module 'webpack/lib/webworker/WebWorkerMainTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/lib/webworker/WebWorkerTemplatePlugin' {
declare module.exports: any;
}
declare module 'webpack/schemas/ajv.absolutePath' {
declare module.exports: any;
}
declare module 'webpack/web_modules/node-libs-browser' {
declare module.exports: any;
}
// Filename aliases
declare module 'webpack/bin/config-optimist.js' {
declare module.exports: $Exports<'webpack/bin/config-optimist'>;
}
declare module 'webpack/bin/config-yargs.js' {
declare module.exports: $Exports<'webpack/bin/config-yargs'>;
}
declare module 'webpack/bin/convert-argv.js' {
declare module.exports: $Exports<'webpack/bin/convert-argv'>;
}
declare module 'webpack/bin/webpack.js' {
declare module.exports: $Exports<'webpack/bin/webpack'>;
}
declare module 'webpack/buildin/amd-define.js' {
declare module.exports: $Exports<'webpack/buildin/amd-define'>;
}
declare module 'webpack/buildin/amd-options.js' {
declare module.exports: $Exports<'webpack/buildin/amd-options'>;
}
declare module 'webpack/buildin/global.js' {
declare module.exports: $Exports<'webpack/buildin/global'>;
}
declare module 'webpack/buildin/harmony-module.js' {
declare module.exports: $Exports<'webpack/buildin/harmony-module'>;
}
declare module 'webpack/buildin/module.js' {
declare module.exports: $Exports<'webpack/buildin/module'>;
}
declare module 'webpack/buildin/system.js' {
declare module.exports: $Exports<'webpack/buildin/system'>;
}
declare module 'webpack/hot/dev-server.js' {
declare module.exports: $Exports<'webpack/hot/dev-server'>;
}
declare module 'webpack/hot/emitter.js' {
declare module.exports: $Exports<'webpack/hot/emitter'>;
}
declare module 'webpack/hot/log-apply-result.js' {
declare module.exports: $Exports<'webpack/hot/log-apply-result'>;
}
declare module 'webpack/hot/log.js' {
declare module.exports: $Exports<'webpack/hot/log'>;
}
declare module 'webpack/hot/only-dev-server.js' {
declare module.exports: $Exports<'webpack/hot/only-dev-server'>;
}
declare module 'webpack/hot/poll.js' {
declare module.exports: $Exports<'webpack/hot/poll'>;
}
declare module 'webpack/hot/signal.js' {
declare module.exports: $Exports<'webpack/hot/signal'>;
}
declare module 'webpack/lib/AmdMainTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/AmdMainTemplatePlugin'>;
}
declare module 'webpack/lib/APIPlugin.js' {
declare module.exports: $Exports<'webpack/lib/APIPlugin'>;
}
declare module 'webpack/lib/AsyncDependenciesBlock.js' {
declare module.exports: $Exports<'webpack/lib/AsyncDependenciesBlock'>;
}
declare module 'webpack/lib/AutomaticPrefetchPlugin.js' {
declare module.exports: $Exports<'webpack/lib/AutomaticPrefetchPlugin'>;
}
declare module 'webpack/lib/BannerPlugin.js' {
declare module.exports: $Exports<'webpack/lib/BannerPlugin'>;
}
declare module 'webpack/lib/BasicEvaluatedExpression.js' {
declare module.exports: $Exports<'webpack/lib/BasicEvaluatedExpression'>;
}
declare module 'webpack/lib/CachePlugin.js' {
declare module.exports: $Exports<'webpack/lib/CachePlugin'>;
}
declare module 'webpack/lib/CaseSensitiveModulesWarning.js' {
declare module.exports: $Exports<'webpack/lib/CaseSensitiveModulesWarning'>;
}
declare module 'webpack/lib/Chunk.js' {
declare module.exports: $Exports<'webpack/lib/Chunk'>;
}
declare module 'webpack/lib/ChunkRenderError.js' {
declare module.exports: $Exports<'webpack/lib/ChunkRenderError'>;
}
declare module 'webpack/lib/ChunkTemplate.js' {
declare module.exports: $Exports<'webpack/lib/ChunkTemplate'>;
}
declare module 'webpack/lib/compareLocations.js' {
declare module.exports: $Exports<'webpack/lib/compareLocations'>;
}
declare module 'webpack/lib/CompatibilityPlugin.js' {
declare module.exports: $Exports<'webpack/lib/CompatibilityPlugin'>;
}
declare module 'webpack/lib/Compilation.js' {
declare module.exports: $Exports<'webpack/lib/Compilation'>;
}
declare module 'webpack/lib/Compiler.js' {
declare module.exports: $Exports<'webpack/lib/Compiler'>;
}
declare module 'webpack/lib/ConstPlugin.js' {
declare module.exports: $Exports<'webpack/lib/ConstPlugin'>;
}
declare module 'webpack/lib/ContextModule.js' {
declare module.exports: $Exports<'webpack/lib/ContextModule'>;
}
declare module 'webpack/lib/ContextModuleFactory.js' {
declare module.exports: $Exports<'webpack/lib/ContextModuleFactory'>;
}
declare module 'webpack/lib/ContextReplacementPlugin.js' {
declare module.exports: $Exports<'webpack/lib/ContextReplacementPlugin'>;
}
declare module 'webpack/lib/DefinePlugin.js' {
declare module.exports: $Exports<'webpack/lib/DefinePlugin'>;
}
declare module 'webpack/lib/DelegatedModule.js' {
declare module.exports: $Exports<'webpack/lib/DelegatedModule'>;
}
declare module 'webpack/lib/DelegatedModuleFactoryPlugin.js' {
declare module.exports: $Exports<'webpack/lib/DelegatedModuleFactoryPlugin'>;
}
declare module 'webpack/lib/DelegatedPlugin.js' {
declare module.exports: $Exports<'webpack/lib/DelegatedPlugin'>;
}
declare module 'webpack/lib/dependencies/AMDDefineDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/AMDDefineDependency'>;
}
declare module 'webpack/lib/dependencies/AMDDefineDependencyParserPlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/AMDDefineDependencyParserPlugin'>;
}
declare module 'webpack/lib/dependencies/AMDPlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/AMDPlugin'>;
}
declare module 'webpack/lib/dependencies/AMDRequireArrayDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/AMDRequireArrayDependency'>;
}
declare module 'webpack/lib/dependencies/AMDRequireContextDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/AMDRequireContextDependency'>;
}
declare module 'webpack/lib/dependencies/AMDRequireDependenciesBlock.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/AMDRequireDependenciesBlock'>;
}
declare module 'webpack/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/AMDRequireDependenciesBlockParserPlugin'>;
}
declare module 'webpack/lib/dependencies/AMDRequireDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/AMDRequireDependency'>;
}
declare module 'webpack/lib/dependencies/AMDRequireItemDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/AMDRequireItemDependency'>;
}
declare module 'webpack/lib/dependencies/CommonJsPlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/CommonJsPlugin'>;
}
declare module 'webpack/lib/dependencies/CommonJsRequireContextDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/CommonJsRequireContextDependency'>;
}
declare module 'webpack/lib/dependencies/CommonJsRequireDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/CommonJsRequireDependency'>;
}
declare module 'webpack/lib/dependencies/CommonJsRequireDependencyParserPlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/CommonJsRequireDependencyParserPlugin'>;
}
declare module 'webpack/lib/dependencies/ConstDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ConstDependency'>;
}
declare module 'webpack/lib/dependencies/ContextDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ContextDependency'>;
}
declare module 'webpack/lib/dependencies/ContextDependencyHelpers.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ContextDependencyHelpers'>;
}
declare module 'webpack/lib/dependencies/ContextDependencyTemplateAsId.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ContextDependencyTemplateAsId'>;
}
declare module 'webpack/lib/dependencies/ContextDependencyTemplateAsRequireCall.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ContextDependencyTemplateAsRequireCall'>;
}
declare module 'webpack/lib/dependencies/ContextElementDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ContextElementDependency'>;
}
declare module 'webpack/lib/dependencies/CriticalDependencyWarning.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/CriticalDependencyWarning'>;
}
declare module 'webpack/lib/dependencies/DelegatedExportsDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/DelegatedExportsDependency'>;
}
declare module 'webpack/lib/dependencies/DelegatedSourceDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/DelegatedSourceDependency'>;
}
declare module 'webpack/lib/dependencies/DepBlockHelpers.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/DepBlockHelpers'>;
}
declare module 'webpack/lib/dependencies/DllEntryDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/DllEntryDependency'>;
}
declare module 'webpack/lib/dependencies/getFunctionExpression.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/getFunctionExpression'>;
}
declare module 'webpack/lib/dependencies/HarmonyAcceptDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyAcceptDependency'>;
}
declare module 'webpack/lib/dependencies/HarmonyAcceptImportDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyAcceptImportDependency'>;
}
declare module 'webpack/lib/dependencies/HarmonyCompatibilityDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyCompatibilityDependency'>;
}
declare module 'webpack/lib/dependencies/HarmonyDetectionParserPlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyDetectionParserPlugin'>;
}
declare module 'webpack/lib/dependencies/HarmonyExportDependencyParserPlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyExportDependencyParserPlugin'>;
}
declare module 'webpack/lib/dependencies/HarmonyExportExpressionDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyExportExpressionDependency'>;
}
declare module 'webpack/lib/dependencies/HarmonyExportHeaderDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyExportHeaderDependency'>;
}
declare module 'webpack/lib/dependencies/HarmonyExportImportedSpecifierDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyExportImportedSpecifierDependency'>;
}
declare module 'webpack/lib/dependencies/HarmonyExportSpecifierDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyExportSpecifierDependency'>;
}
declare module 'webpack/lib/dependencies/HarmonyImportDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyImportDependency'>;
}
declare module 'webpack/lib/dependencies/HarmonyImportDependencyParserPlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyImportDependencyParserPlugin'>;
}
declare module 'webpack/lib/dependencies/HarmonyImportSpecifierDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyImportSpecifierDependency'>;
}
declare module 'webpack/lib/dependencies/HarmonyModulesHelpers.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyModulesHelpers'>;
}
declare module 'webpack/lib/dependencies/HarmonyModulesPlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyModulesPlugin'>;
}
declare module 'webpack/lib/dependencies/ImportContextDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ImportContextDependency'>;
}
declare module 'webpack/lib/dependencies/ImportDependenciesBlock.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ImportDependenciesBlock'>;
}
declare module 'webpack/lib/dependencies/ImportDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ImportDependency'>;
}
declare module 'webpack/lib/dependencies/ImportEagerContextDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ImportEagerContextDependency'>;
}
declare module 'webpack/lib/dependencies/ImportEagerDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ImportEagerDependency'>;
}
declare module 'webpack/lib/dependencies/ImportLazyContextDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ImportLazyContextDependency'>;
}
declare module 'webpack/lib/dependencies/ImportLazyOnceContextDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ImportLazyOnceContextDependency'>;
}
declare module 'webpack/lib/dependencies/ImportParserPlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ImportParserPlugin'>;
}
declare module 'webpack/lib/dependencies/ImportPlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ImportPlugin'>;
}
declare module 'webpack/lib/dependencies/ImportWeakContextDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ImportWeakContextDependency'>;
}
declare module 'webpack/lib/dependencies/ImportWeakDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ImportWeakDependency'>;
}
declare module 'webpack/lib/dependencies/LoaderDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/LoaderDependency'>;
}
declare module 'webpack/lib/dependencies/LoaderPlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/LoaderPlugin'>;
}
declare module 'webpack/lib/dependencies/LocalModule.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/LocalModule'>;
}
declare module 'webpack/lib/dependencies/LocalModuleDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/LocalModuleDependency'>;
}
declare module 'webpack/lib/dependencies/LocalModulesHelpers.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/LocalModulesHelpers'>;
}
declare module 'webpack/lib/dependencies/ModuleDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ModuleDependency'>;
}
declare module 'webpack/lib/dependencies/ModuleDependencyTemplateAsId.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ModuleDependencyTemplateAsId'>;
}
declare module 'webpack/lib/dependencies/ModuleDependencyTemplateAsRequireId.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ModuleDependencyTemplateAsRequireId'>;
}
declare module 'webpack/lib/dependencies/ModuleHotAcceptDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ModuleHotAcceptDependency'>;
}
declare module 'webpack/lib/dependencies/ModuleHotDeclineDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/ModuleHotDeclineDependency'>;
}
declare module 'webpack/lib/dependencies/MultiEntryDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/MultiEntryDependency'>;
}
declare module 'webpack/lib/dependencies/NullDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/NullDependency'>;
}
declare module 'webpack/lib/dependencies/PrefetchDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/PrefetchDependency'>;
}
declare module 'webpack/lib/dependencies/RequireContextDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/RequireContextDependency'>;
}
declare module 'webpack/lib/dependencies/RequireContextDependencyParserPlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/RequireContextDependencyParserPlugin'>;
}
declare module 'webpack/lib/dependencies/RequireContextPlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/RequireContextPlugin'>;
}
declare module 'webpack/lib/dependencies/RequireEnsureDependenciesBlock.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/RequireEnsureDependenciesBlock'>;
}
declare module 'webpack/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin'>;
}
declare module 'webpack/lib/dependencies/RequireEnsureDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/RequireEnsureDependency'>;
}
declare module 'webpack/lib/dependencies/RequireEnsureItemDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/RequireEnsureItemDependency'>;
}
declare module 'webpack/lib/dependencies/RequireEnsurePlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/RequireEnsurePlugin'>;
}
declare module 'webpack/lib/dependencies/RequireHeaderDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/RequireHeaderDependency'>;
}
declare module 'webpack/lib/dependencies/RequireIncludeDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/RequireIncludeDependency'>;
}
declare module 'webpack/lib/dependencies/RequireIncludeDependencyParserPlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/RequireIncludeDependencyParserPlugin'>;
}
declare module 'webpack/lib/dependencies/RequireIncludePlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/RequireIncludePlugin'>;
}
declare module 'webpack/lib/dependencies/RequireResolveContextDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/RequireResolveContextDependency'>;
}
declare module 'webpack/lib/dependencies/RequireResolveDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/RequireResolveDependency'>;
}
declare module 'webpack/lib/dependencies/RequireResolveDependencyParserPlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/RequireResolveDependencyParserPlugin'>;
}
declare module 'webpack/lib/dependencies/RequireResolveHeaderDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/RequireResolveHeaderDependency'>;
}
declare module 'webpack/lib/dependencies/SingleEntryDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/SingleEntryDependency'>;
}
declare module 'webpack/lib/dependencies/SystemPlugin.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/SystemPlugin'>;
}
declare module 'webpack/lib/dependencies/UnsupportedDependency.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/UnsupportedDependency'>;
}
declare module 'webpack/lib/dependencies/WebpackMissingModule.js' {
declare module.exports: $Exports<'webpack/lib/dependencies/WebpackMissingModule'>;
}
declare module 'webpack/lib/DependenciesBlock.js' {
declare module.exports: $Exports<'webpack/lib/DependenciesBlock'>;
}
declare module 'webpack/lib/DependenciesBlockVariable.js' {
declare module.exports: $Exports<'webpack/lib/DependenciesBlockVariable'>;
}
declare module 'webpack/lib/Dependency.js' {
declare module.exports: $Exports<'webpack/lib/Dependency'>;
}
declare module 'webpack/lib/DllEntryPlugin.js' {
declare module.exports: $Exports<'webpack/lib/DllEntryPlugin'>;
}
declare module 'webpack/lib/DllModule.js' {
declare module.exports: $Exports<'webpack/lib/DllModule'>;
}
declare module 'webpack/lib/DllModuleFactory.js' {
declare module.exports: $Exports<'webpack/lib/DllModuleFactory'>;
}
declare module 'webpack/lib/DllPlugin.js' {
declare module.exports: $Exports<'webpack/lib/DllPlugin'>;
}
declare module 'webpack/lib/DllReferencePlugin.js' {
declare module.exports: $Exports<'webpack/lib/DllReferencePlugin'>;
}
declare module 'webpack/lib/DynamicEntryPlugin.js' {
declare module.exports: $Exports<'webpack/lib/DynamicEntryPlugin'>;
}
declare module 'webpack/lib/EntryModuleNotFoundError.js' {
declare module.exports: $Exports<'webpack/lib/EntryModuleNotFoundError'>;
}
declare module 'webpack/lib/EntryOptionPlugin.js' {
declare module.exports: $Exports<'webpack/lib/EntryOptionPlugin'>;
}
declare module 'webpack/lib/Entrypoint.js' {
declare module.exports: $Exports<'webpack/lib/Entrypoint'>;
}
declare module 'webpack/lib/EnvironmentPlugin.js' {
declare module.exports: $Exports<'webpack/lib/EnvironmentPlugin'>;
}
declare module 'webpack/lib/ErrorHelpers.js' {
declare module.exports: $Exports<'webpack/lib/ErrorHelpers'>;
}
declare module 'webpack/lib/EvalDevToolModulePlugin.js' {
declare module.exports: $Exports<'webpack/lib/EvalDevToolModulePlugin'>;
}
declare module 'webpack/lib/EvalDevToolModuleTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/EvalDevToolModuleTemplatePlugin'>;
}
declare module 'webpack/lib/EvalSourceMapDevToolModuleTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/EvalSourceMapDevToolModuleTemplatePlugin'>;
}
declare module 'webpack/lib/EvalSourceMapDevToolPlugin.js' {
declare module.exports: $Exports<'webpack/lib/EvalSourceMapDevToolPlugin'>;
}
declare module 'webpack/lib/ExportPropertyMainTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/ExportPropertyMainTemplatePlugin'>;
}
declare module 'webpack/lib/ExtendedAPIPlugin.js' {
declare module.exports: $Exports<'webpack/lib/ExtendedAPIPlugin'>;
}
declare module 'webpack/lib/ExternalModule.js' {
declare module.exports: $Exports<'webpack/lib/ExternalModule'>;
}
declare module 'webpack/lib/ExternalModuleFactoryPlugin.js' {
declare module.exports: $Exports<'webpack/lib/ExternalModuleFactoryPlugin'>;
}
declare module 'webpack/lib/ExternalsPlugin.js' {
declare module.exports: $Exports<'webpack/lib/ExternalsPlugin'>;
}
declare module 'webpack/lib/FlagDependencyExportsPlugin.js' {
declare module.exports: $Exports<'webpack/lib/FlagDependencyExportsPlugin'>;
}
declare module 'webpack/lib/FlagDependencyUsagePlugin.js' {
declare module.exports: $Exports<'webpack/lib/FlagDependencyUsagePlugin'>;
}
declare module 'webpack/lib/FlagInitialModulesAsUsedPlugin.js' {
declare module.exports: $Exports<'webpack/lib/FlagInitialModulesAsUsedPlugin'>;
}
declare module 'webpack/lib/formatLocation.js' {
declare module.exports: $Exports<'webpack/lib/formatLocation'>;
}
declare module 'webpack/lib/FunctionModulePlugin.js' {
declare module.exports: $Exports<'webpack/lib/FunctionModulePlugin'>;
}
declare module 'webpack/lib/FunctionModuleTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/FunctionModuleTemplatePlugin'>;
}
declare module 'webpack/lib/HashedModuleIdsPlugin.js' {
declare module.exports: $Exports<'webpack/lib/HashedModuleIdsPlugin'>;
}
declare module 'webpack/lib/HotModuleReplacement.runtime.js' {
declare module.exports: $Exports<'webpack/lib/HotModuleReplacement.runtime'>;
}
declare module 'webpack/lib/HotModuleReplacementPlugin.js' {
declare module.exports: $Exports<'webpack/lib/HotModuleReplacementPlugin'>;
}
declare module 'webpack/lib/HotUpdateChunkTemplate.js' {
declare module.exports: $Exports<'webpack/lib/HotUpdateChunkTemplate'>;
}
declare module 'webpack/lib/IgnorePlugin.js' {
declare module.exports: $Exports<'webpack/lib/IgnorePlugin'>;
}
declare module 'webpack/lib/JsonpChunkTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/JsonpChunkTemplatePlugin'>;
}
declare module 'webpack/lib/JsonpExportMainTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/JsonpExportMainTemplatePlugin'>;
}
declare module 'webpack/lib/JsonpHotUpdateChunkTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/JsonpHotUpdateChunkTemplatePlugin'>;
}
declare module 'webpack/lib/JsonpMainTemplate.runtime.js' {
declare module.exports: $Exports<'webpack/lib/JsonpMainTemplate.runtime'>;
}
declare module 'webpack/lib/JsonpMainTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/JsonpMainTemplatePlugin'>;
}
declare module 'webpack/lib/JsonpTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/JsonpTemplatePlugin'>;
}
declare module 'webpack/lib/LibManifestPlugin.js' {
declare module.exports: $Exports<'webpack/lib/LibManifestPlugin'>;
}
declare module 'webpack/lib/LibraryTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/LibraryTemplatePlugin'>;
}
declare module 'webpack/lib/LoaderOptionsPlugin.js' {
declare module.exports: $Exports<'webpack/lib/LoaderOptionsPlugin'>;
}
declare module 'webpack/lib/LoaderTargetPlugin.js' {
declare module.exports: $Exports<'webpack/lib/LoaderTargetPlugin'>;
}
declare module 'webpack/lib/MainTemplate.js' {
declare module.exports: $Exports<'webpack/lib/MainTemplate'>;
}
declare module 'webpack/lib/MemoryOutputFileSystem.js' {
declare module.exports: $Exports<'webpack/lib/MemoryOutputFileSystem'>;
}
declare module 'webpack/lib/Module.js' {
declare module.exports: $Exports<'webpack/lib/Module'>;
}
declare module 'webpack/lib/ModuleBuildError.js' {
declare module.exports: $Exports<'webpack/lib/ModuleBuildError'>;
}
declare module 'webpack/lib/ModuleDependencyError.js' {
declare module.exports: $Exports<'webpack/lib/ModuleDependencyError'>;
}
declare module 'webpack/lib/ModuleDependencyWarning.js' {
declare module.exports: $Exports<'webpack/lib/ModuleDependencyWarning'>;
}
declare module 'webpack/lib/ModuleError.js' {
declare module.exports: $Exports<'webpack/lib/ModuleError'>;
}
declare module 'webpack/lib/ModuleFilenameHelpers.js' {
declare module.exports: $Exports<'webpack/lib/ModuleFilenameHelpers'>;
}
declare module 'webpack/lib/ModuleNotFoundError.js' {
declare module.exports: $Exports<'webpack/lib/ModuleNotFoundError'>;
}
declare module 'webpack/lib/ModuleParseError.js' {
declare module.exports: $Exports<'webpack/lib/ModuleParseError'>;
}
declare module 'webpack/lib/ModuleReason.js' {
declare module.exports: $Exports<'webpack/lib/ModuleReason'>;
}
declare module 'webpack/lib/ModuleTemplate.js' {
declare module.exports: $Exports<'webpack/lib/ModuleTemplate'>;
}
declare module 'webpack/lib/ModuleWarning.js' {
declare module.exports: $Exports<'webpack/lib/ModuleWarning'>;
}
declare module 'webpack/lib/MovedToPluginWarningPlugin.js' {
declare module.exports: $Exports<'webpack/lib/MovedToPluginWarningPlugin'>;
}
declare module 'webpack/lib/MultiCompiler.js' {
declare module.exports: $Exports<'webpack/lib/MultiCompiler'>;
}
declare module 'webpack/lib/MultiEntryPlugin.js' {
declare module.exports: $Exports<'webpack/lib/MultiEntryPlugin'>;
}
declare module 'webpack/lib/MultiModule.js' {
declare module.exports: $Exports<'webpack/lib/MultiModule'>;
}
declare module 'webpack/lib/MultiModuleFactory.js' {
declare module.exports: $Exports<'webpack/lib/MultiModuleFactory'>;
}
declare module 'webpack/lib/MultiStats.js' {
declare module.exports: $Exports<'webpack/lib/MultiStats'>;
}
declare module 'webpack/lib/MultiWatching.js' {
declare module.exports: $Exports<'webpack/lib/MultiWatching'>;
}
declare module 'webpack/lib/NamedChunksPlugin.js' {
declare module.exports: $Exports<'webpack/lib/NamedChunksPlugin'>;
}
declare module 'webpack/lib/NamedModulesPlugin.js' {
declare module.exports: $Exports<'webpack/lib/NamedModulesPlugin'>;
}
declare module 'webpack/lib/NewWatchingPlugin.js' {
declare module.exports: $Exports<'webpack/lib/NewWatchingPlugin'>;
}
declare module 'webpack/lib/node/NodeChunkTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/node/NodeChunkTemplatePlugin'>;
}
declare module 'webpack/lib/node/NodeEnvironmentPlugin.js' {
declare module.exports: $Exports<'webpack/lib/node/NodeEnvironmentPlugin'>;
}
declare module 'webpack/lib/node/NodeHotUpdateChunkTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/node/NodeHotUpdateChunkTemplatePlugin'>;
}
declare module 'webpack/lib/node/NodeMainTemplate.runtime.js' {
declare module.exports: $Exports<'webpack/lib/node/NodeMainTemplate.runtime'>;
}
declare module 'webpack/lib/node/NodeMainTemplateAsync.runtime.js' {
declare module.exports: $Exports<'webpack/lib/node/NodeMainTemplateAsync.runtime'>;
}
declare module 'webpack/lib/node/NodeMainTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/node/NodeMainTemplatePlugin'>;
}
declare module 'webpack/lib/node/NodeOutputFileSystem.js' {
declare module.exports: $Exports<'webpack/lib/node/NodeOutputFileSystem'>;
}
declare module 'webpack/lib/node/NodeSourcePlugin.js' {
declare module.exports: $Exports<'webpack/lib/node/NodeSourcePlugin'>;
}
declare module 'webpack/lib/node/NodeTargetPlugin.js' {
declare module.exports: $Exports<'webpack/lib/node/NodeTargetPlugin'>;
}
declare module 'webpack/lib/node/NodeTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/node/NodeTemplatePlugin'>;
}
declare module 'webpack/lib/node/NodeWatchFileSystem.js' {
declare module.exports: $Exports<'webpack/lib/node/NodeWatchFileSystem'>;
}
declare module 'webpack/lib/NodeStuffPlugin.js' {
declare module.exports: $Exports<'webpack/lib/NodeStuffPlugin'>;
}
declare module 'webpack/lib/NoEmitOnErrorsPlugin.js' {
declare module.exports: $Exports<'webpack/lib/NoEmitOnErrorsPlugin'>;
}
declare module 'webpack/lib/NoErrorsPlugin.js' {
declare module.exports: $Exports<'webpack/lib/NoErrorsPlugin'>;
}
declare module 'webpack/lib/NormalModule.js' {
declare module.exports: $Exports<'webpack/lib/NormalModule'>;
}
declare module 'webpack/lib/NormalModuleFactory.js' {
declare module.exports: $Exports<'webpack/lib/NormalModuleFactory'>;
}
declare module 'webpack/lib/NormalModuleReplacementPlugin.js' {
declare module.exports: $Exports<'webpack/lib/NormalModuleReplacementPlugin'>;
}
declare module 'webpack/lib/NullFactory.js' {
declare module.exports: $Exports<'webpack/lib/NullFactory'>;
}
declare module 'webpack/lib/optimize/AggressiveMergingPlugin.js' {
declare module.exports: $Exports<'webpack/lib/optimize/AggressiveMergingPlugin'>;
}
declare module 'webpack/lib/optimize/AggressiveSplittingPlugin.js' {
declare module.exports: $Exports<'webpack/lib/optimize/AggressiveSplittingPlugin'>;
}
declare module 'webpack/lib/optimize/ChunkModuleIdRangePlugin.js' {
declare module.exports: $Exports<'webpack/lib/optimize/ChunkModuleIdRangePlugin'>;
}
declare module 'webpack/lib/optimize/CommonsChunkPlugin.js' {
declare module.exports: $Exports<'webpack/lib/optimize/CommonsChunkPlugin'>;
}
declare module 'webpack/lib/optimize/ConcatenatedModule.js' {
declare module.exports: $Exports<'webpack/lib/optimize/ConcatenatedModule'>;
}
declare module 'webpack/lib/optimize/DedupePlugin.js' {
declare module.exports: $Exports<'webpack/lib/optimize/DedupePlugin'>;
}
declare module 'webpack/lib/optimize/EnsureChunkConditionsPlugin.js' {
declare module.exports: $Exports<'webpack/lib/optimize/EnsureChunkConditionsPlugin'>;
}
declare module 'webpack/lib/optimize/FlagIncludedChunksPlugin.js' {
declare module.exports: $Exports<'webpack/lib/optimize/FlagIncludedChunksPlugin'>;
}
declare module 'webpack/lib/optimize/LimitChunkCountPlugin.js' {
declare module.exports: $Exports<'webpack/lib/optimize/LimitChunkCountPlugin'>;
}
declare module 'webpack/lib/optimize/MergeDuplicateChunksPlugin.js' {
declare module.exports: $Exports<'webpack/lib/optimize/MergeDuplicateChunksPlugin'>;
}
declare module 'webpack/lib/optimize/MinChunkSizePlugin.js' {
declare module.exports: $Exports<'webpack/lib/optimize/MinChunkSizePlugin'>;
}
declare module 'webpack/lib/optimize/ModuleConcatenationPlugin.js' {
declare module.exports: $Exports<'webpack/lib/optimize/ModuleConcatenationPlugin'>;
}
declare module 'webpack/lib/optimize/OccurrenceOrderPlugin.js' {
declare module.exports: $Exports<'webpack/lib/optimize/OccurrenceOrderPlugin'>;
}
declare module 'webpack/lib/optimize/RemoveEmptyChunksPlugin.js' {
declare module.exports: $Exports<'webpack/lib/optimize/RemoveEmptyChunksPlugin'>;
}
declare module 'webpack/lib/optimize/RemoveParentModulesPlugin.js' {
declare module.exports: $Exports<'webpack/lib/optimize/RemoveParentModulesPlugin'>;
}
declare module 'webpack/lib/optimize/UglifyJsPlugin.js' {
declare module.exports: $Exports<'webpack/lib/optimize/UglifyJsPlugin'>;
}
declare module 'webpack/lib/OptionsApply.js' {
declare module.exports: $Exports<'webpack/lib/OptionsApply'>;
}
declare module 'webpack/lib/OptionsDefaulter.js' {
declare module.exports: $Exports<'webpack/lib/OptionsDefaulter'>;
}
declare module 'webpack/lib/Parser.js' {
declare module.exports: $Exports<'webpack/lib/Parser'>;
}
declare module 'webpack/lib/ParserHelpers.js' {
declare module.exports: $Exports<'webpack/lib/ParserHelpers'>;
}
declare module 'webpack/lib/performance/AssetsOverSizeLimitWarning.js' {
declare module.exports: $Exports<'webpack/lib/performance/AssetsOverSizeLimitWarning'>;
}
declare module 'webpack/lib/performance/EntrypointsOverSizeLimitWarning.js' {
declare module.exports: $Exports<'webpack/lib/performance/EntrypointsOverSizeLimitWarning'>;
}
declare module 'webpack/lib/performance/NoAsyncChunksWarning.js' {
declare module.exports: $Exports<'webpack/lib/performance/NoAsyncChunksWarning'>;
}
declare module 'webpack/lib/performance/SizeLimitsPlugin.js' {
declare module.exports: $Exports<'webpack/lib/performance/SizeLimitsPlugin'>;
}
declare module 'webpack/lib/PrefetchPlugin.js' {
declare module.exports: $Exports<'webpack/lib/PrefetchPlugin'>;
}
declare module 'webpack/lib/prepareOptions.js' {
declare module.exports: $Exports<'webpack/lib/prepareOptions'>;
}
declare module 'webpack/lib/ProgressPlugin.js' {
declare module.exports: $Exports<'webpack/lib/ProgressPlugin'>;
}
declare module 'webpack/lib/ProvidePlugin.js' {
declare module.exports: $Exports<'webpack/lib/ProvidePlugin'>;
}
declare module 'webpack/lib/RawModule.js' {
declare module.exports: $Exports<'webpack/lib/RawModule'>;
}
declare module 'webpack/lib/RecordIdsPlugin.js' {
declare module.exports: $Exports<'webpack/lib/RecordIdsPlugin'>;
}
declare module 'webpack/lib/removeAndDo.js' {
declare module.exports: $Exports<'webpack/lib/removeAndDo'>;
}
declare module 'webpack/lib/RequestShortener.js' {
declare module.exports: $Exports<'webpack/lib/RequestShortener'>;
}
declare module 'webpack/lib/RequireJsStuffPlugin.js' {
declare module.exports: $Exports<'webpack/lib/RequireJsStuffPlugin'>;
}
declare module 'webpack/lib/RuleSet.js' {
declare module.exports: $Exports<'webpack/lib/RuleSet'>;
}
declare module 'webpack/lib/SetVarMainTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/SetVarMainTemplatePlugin'>;
}
declare module 'webpack/lib/SingleEntryPlugin.js' {
declare module.exports: $Exports<'webpack/lib/SingleEntryPlugin'>;
}
declare module 'webpack/lib/SizeFormatHelpers.js' {
declare module.exports: $Exports<'webpack/lib/SizeFormatHelpers'>;
}
declare module 'webpack/lib/SourceMapDevToolModuleOptionsPlugin.js' {
declare module.exports: $Exports<'webpack/lib/SourceMapDevToolModuleOptionsPlugin'>;
}
declare module 'webpack/lib/SourceMapDevToolPlugin.js' {
declare module.exports: $Exports<'webpack/lib/SourceMapDevToolPlugin'>;
}
declare module 'webpack/lib/Stats.js' {
declare module.exports: $Exports<'webpack/lib/Stats'>;
}
declare module 'webpack/lib/Template.js' {
declare module.exports: $Exports<'webpack/lib/Template'>;
}
declare module 'webpack/lib/TemplatedPathPlugin.js' {
declare module.exports: $Exports<'webpack/lib/TemplatedPathPlugin'>;
}
declare module 'webpack/lib/UmdMainTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/UmdMainTemplatePlugin'>;
}
declare module 'webpack/lib/UnsupportedFeatureWarning.js' {
declare module.exports: $Exports<'webpack/lib/UnsupportedFeatureWarning'>;
}
declare module 'webpack/lib/UseStrictPlugin.js' {
declare module.exports: $Exports<'webpack/lib/UseStrictPlugin'>;
}
declare module 'webpack/lib/util/identifier.js' {
declare module.exports: $Exports<'webpack/lib/util/identifier'>;
}
declare module 'webpack/lib/util/Semaphore.js' {
declare module.exports: $Exports<'webpack/lib/util/Semaphore'>;
}
declare module 'webpack/lib/util/SortableSet.js' {
declare module.exports: $Exports<'webpack/lib/util/SortableSet'>;
}
declare module 'webpack/lib/validateSchema.js' {
declare module.exports: $Exports<'webpack/lib/validateSchema'>;
}
declare module 'webpack/lib/WarnCaseSensitiveModulesPlugin.js' {
declare module.exports: $Exports<'webpack/lib/WarnCaseSensitiveModulesPlugin'>;
}
declare module 'webpack/lib/WatchIgnorePlugin.js' {
declare module.exports: $Exports<'webpack/lib/WatchIgnorePlugin'>;
}
declare module 'webpack/lib/web/WebEnvironmentPlugin.js' {
declare module.exports: $Exports<'webpack/lib/web/WebEnvironmentPlugin'>;
}
declare module 'webpack/lib/webpack.js' {
declare module.exports: $Exports<'webpack/lib/webpack'>;
}
declare module 'webpack/lib/webpack.web.js' {
declare module.exports: $Exports<'webpack/lib/webpack.web'>;
}
declare module 'webpack/lib/WebpackError.js' {
declare module.exports: $Exports<'webpack/lib/WebpackError'>;
}
declare module 'webpack/lib/WebpackOptionsApply.js' {
declare module.exports: $Exports<'webpack/lib/WebpackOptionsApply'>;
}
declare module 'webpack/lib/WebpackOptionsDefaulter.js' {
declare module.exports: $Exports<'webpack/lib/WebpackOptionsDefaulter'>;
}
declare module 'webpack/lib/WebpackOptionsValidationError.js' {
declare module.exports: $Exports<'webpack/lib/WebpackOptionsValidationError'>;
}
declare module 'webpack/lib/webworker/WebWorkerChunkTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/webworker/WebWorkerChunkTemplatePlugin'>;
}
declare module 'webpack/lib/webworker/WebWorkerHotUpdateChunkTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/webworker/WebWorkerHotUpdateChunkTemplatePlugin'>;
}
declare module 'webpack/lib/webworker/WebWorkerMainTemplate.runtime.js' {
declare module.exports: $Exports<'webpack/lib/webworker/WebWorkerMainTemplate.runtime'>;
}
declare module 'webpack/lib/webworker/WebWorkerMainTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/webworker/WebWorkerMainTemplatePlugin'>;
}
declare module 'webpack/lib/webworker/WebWorkerTemplatePlugin.js' {
declare module.exports: $Exports<'webpack/lib/webworker/WebWorkerTemplatePlugin'>;
}
declare module 'webpack/schemas/ajv.absolutePath.js' {
declare module.exports: $Exports<'webpack/schemas/ajv.absolutePath'>;
}
declare module 'webpack/web_modules/node-libs-browser.js' {
declare module.exports: $Exports<'webpack/web_modules/node-libs-browser'>;
}
|
const buildConfig = require("../../jest.base.config")
module.exports = buildConfig(__dirname, {
testRegex: "__tests__/.*\\.tsx?$",
setupFilesAfterEnv: [`<rootDir>/jest.setup.ts`],
testPathIgnorePatterns: ["node_modules", "<rootDir>/__tests__/utils"]
})
|
/*
zoomwall.js
The MIT License (MIT)
Copyright (c) 2014 Eric Leong
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var zoomwall = {
create: function(blocks, enableKeys) {
zoomwall.resize(blocks.children);
blocks.classList.remove('loading');
// shrink blocks if an empty space is clicked
blocks.addEventListener('click', function() {
if (this.children && this.children.length > 0) {
zoomwall.shrink(this.children[0]);
}
});
// add click listeners to blocks
for (var i = 0; i < blocks.children.length; i++) {
blocks.children[i].addEventListener('click', zoomwall.animate);
}
// add key down listener
if (enableKeys) {
zoomwall.keys(blocks);
}
},
keys: function(blocks) {
var keyPager = function(e) {
if (e.defaultPrevented) {
return;
}
// either use the provided blocks, or query for the first lightboxed zoomwall
var elem = blocks || document.getElementsByClassName('zoomwall lightbox')[0];
if (elem) {
switch (e.keyCode) {
case 27: // escape
if (elem.children && elem.children.length > 0) {
zoomwall.shrink(elem.children[0]);
}
e.preventDefault();
break;
case 37: // left
zoomwall.page(elem, false);
e.preventDefault();
break;
case 39: // right
zoomwall.page(elem, true);
e.preventDefault();
break;
}
}
}
document.addEventListener('keydown', keyPager);
return keyPager;
},
resizeRow: function(row, width) {
if (row && row.length > 1) {
for (var i in row) {
row[i].style.width = (parseInt(window.getComputedStyle(row[i]).width, 10) / width * 100) + '%';
row[i].style.height = 'auto';
}
}
},
calcRowWidth: function(row) {
var width = 0;
for (var i in row) {
width += parseInt(window.getComputedStyle(row[i]).width, 10);
}
return width;
},
resize: function(blocks) {
var row = [];
var top = -1;
for (var c = 0; c < blocks.length; c++) {
var block = blocks[c];
if (block) {
if (top == -1) {
top = block.offsetTop;
} else if (block.offsetTop != top) {
zoomwall.resizeRow(row, zoomwall.calcRowWidth(row));
row = [];
top = block.offsetTop;
}
row.push(block);
}
}
zoomwall.resizeRow(row, zoomwall.calcRowWidth(row));
},
reset: function(block) {
block.style.transform = 'translate(0, 0) scale(1)';
block.style.webkitTransform = 'translate(0, 0) scale(1)';
block.classList.remove('active');
},
shrink: function(block) {
block.parentNode.classList.remove('lightbox');
// reset all blocks
zoomwall.reset(block);
var prev = block.previousElementSibling;
while (prev) {
zoomwall.reset(prev);
prev = prev.previousElementSibling;
}
var next = block.nextElementSibling;
while (next) {
zoomwall.reset(next);
next = next.nextElementSibling;
}
// swap images
if (block.dataset.lowres) {
block.src = block.dataset.lowres;
}
},
expand: function(block) {
block.classList.add('active');
block.parentNode.classList.add('lightbox');
// parent dimensions
var parentStyle = window.getComputedStyle(block.parentNode);
var parentWidth = parseInt(parentStyle.width, 10);
var parentHeight = parseInt(parentStyle.height, 10);
var parentTop = block.parentNode.getBoundingClientRect().top;
// block dimensions
var blockStyle = window.getComputedStyle(block);
var blockWidth = parseInt(blockStyle.width, 10);
var blockHeight = parseInt(blockStyle.height, 10);
// determine maximum height
var targetHeight = window.innerHeight;
if (parentHeight < window.innerHeight) {
targetHeight = parentHeight;
} else if (parentTop > 0) {
targetHeight -= parentTop;
}
// swap images
if (block.dataset.highres) {
if (block.src != block.dataset.highres && block.dataset.lowres === undefined) {
block.dataset.lowres = block.src;
}
block.src = block.dataset.highres;
}
// determine what blocks are on this row
var row = [];
row.push(block);
var next = block.nextElementSibling;
while (next && next.offsetTop == block.offsetTop) {
row.push(next);
next = next.nextElementSibling;
}
var prev = block.previousElementSibling;
while (prev && prev.offsetTop == block.offsetTop) {
row.unshift(prev);
prev = prev.previousElementSibling;
}
// calculate scale
var scale = targetHeight / blockHeight;
if (blockWidth * scale > parentWidth) {
scale = parentWidth / blockWidth;
}
// determine offset
var offsetY = parentTop - block.parentNode.offsetTop + block.offsetTop;
if (offsetY > 0) {
if (parentHeight < window.innerHeight) {
offsetY -= targetHeight / 2 - blockHeight * scale / 2;
}
if (parentTop > 0) {
offsetY -= parentTop;
}
}
var leftOffsetX = 0; // shift in current row
for (var i = 0; i < row.length && row[i] != block; i++) {
leftOffsetX += parseInt(window.getComputedStyle(row[i]).width, 10) * scale;
}
leftOffsetX = parentWidth / 2 - blockWidth * scale / 2 - leftOffsetX;
var rightOffsetX = 0; // shift in current row
for (var i = row.length - 1; i >= 0 && row[i] != block; i--) {
rightOffsetX += parseInt(window.getComputedStyle(row[i]).width, 10) * scale;
}
rightOffsetX = parentWidth / 2 - blockWidth * scale / 2 - rightOffsetX;
// transform current row
var itemOffset = 0; // offset due to scaling of previous items
var prevWidth = 0;
for (var i = 0; i < row.length; i++) {
itemOffset += (prevWidth * scale - prevWidth);
prevWidth = parseInt(window.getComputedStyle(row[i]).width, 10);
var percentageOffsetX = (itemOffset + leftOffsetX) / prevWidth * 100;
var percentageOffsetY = -offsetY / parseInt(window.getComputedStyle(row[i]).height, 10) * 100;
row[i].style.transformOrigin = '0% 0%';
row[i].style.webkitTransformOrigin = '0% 0%';
row[i].style.transform = 'translate(' + percentageOffsetX.toFixed(8) + '%, ' + percentageOffsetY.toFixed(8) + '%) scale(' + scale.toFixed(8) + ')';
row[i].style.webkitTransform = 'translate(' + percentageOffsetX.toFixed(8) + '%, ' + percentageOffsetY.toFixed(8) + '%) scale(' + scale.toFixed(8) + ')';
}
// transform items after
var nextOffsetY = blockHeight * (scale - 1) - offsetY;
var prevHeight;
itemOffset = 0; // offset due to scaling of previous items
prevWidth = 0;
var next = row[row.length - 1].nextElementSibling;
var nextRowTop = -1;
while (next) {
var curTop = next.offsetTop;
if (curTop == nextRowTop) {
itemOffset += prevWidth * scale - prevWidth;
} else {
if (nextRowTop != -1) {
itemOffset = 0;
nextOffsetY += prevHeight * (scale - 1);
}
nextRowTop = curTop;
}
prevWidth = parseInt(window.getComputedStyle(next).width, 10);
prevHeight = parseInt(window.getComputedStyle(next).height, 10);
var percentageOffsetX = (itemOffset + leftOffsetX) / prevWidth * 100;
var percentageOffsetY = nextOffsetY / prevHeight * 100;
next.style.transformOrigin = '0% 0%';
next.style.webkitTransformOrigin = '0% 0%';
next.style.transform = 'translate(' + percentageOffsetX.toFixed(8) + '%, ' + percentageOffsetY.toFixed(8) + '%) scale(' + scale.toFixed(8) + ')';
next.style.webkitTransform = 'translate(' + percentageOffsetX.toFixed(8) + '%, ' + percentageOffsetY.toFixed(8) + '%) scale(' + scale.toFixed(8) + ')';
next = next.nextElementSibling;
}
// transform items before
var prevOffsetY = -offsetY;
itemOffset = 0; // offset due to scaling of previous items
prevWidth = 0;
var prev = row[0].previousElementSibling;
var prevRowTop = -1;
while (prev) {
var curTop = prev.offsetTop;
if (curTop == prevRowTop) {
itemOffset -= prevWidth * scale - prevWidth;
} else {
itemOffset = 0;
prevOffsetY -= parseInt(window.getComputedStyle(prev).height, 10) * (scale - 1);
prevRowTop = curTop;
}
prevWidth = parseInt(window.getComputedStyle(prev).width, 10);
var percentageOffsetX = (itemOffset - rightOffsetX) / prevWidth * 100;
var percentageOffsetY = prevOffsetY / parseInt(window.getComputedStyle(prev).height, 10) * 100;
prev.style.transformOrigin = '100% 0%';
prev.style.webkitTransformOrigin = '100% 0%';
prev.style.transform = 'translate(' + percentageOffsetX.toFixed(8) + '%, ' + percentageOffsetY.toFixed(8) + '%) scale(' + scale.toFixed(8) + ')';
prev.style.webkitTransform = 'translate(' + percentageOffsetX.toFixed(8) + '%, ' + percentageOffsetY.toFixed(8) + '%) scale(' + scale.toFixed(8) + ')';
prev = prev.previousElementSibling;
}
},
animate: function(e) {
if (this.classList.contains('active')) {
zoomwall.shrink(this);
} else {
var actives = this.parentNode.getElementsByClassName('active');
for (var i = 0; i < actives.length; i++) {
actives[i].classList.remove('active');
}
zoomwall.expand(this);
}
e.stopPropagation();
},
page: function(blocks, isNext) {
var actives = blocks.getElementsByClassName('active');
if (actives && actives.length > 0) {
var current = actives[0];
var next;
if (isNext) {
next = current.nextElementSibling;
} else {
next = current.previousElementSibling;
}
if (next) {
current.classList.remove('active');
// swap images
if (current.dataset.lowres) {
current.src = current.dataset.lowres;
}
zoomwall.expand(next);
}
}
}
};
|
// https://gist.github.com/paulirish/1579671
(function() {
var lastTime = 0;
var vendors = ['webkit', 'moz'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
window.cancelAnimationFrame =
window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame'];
}
if (!window.requestAnimationFrame)
window.requestAnimationFrame = function(callback, element) {
var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
timeToCall);
lastTime = currTime + timeToCall;
return id;
};
if (!window.cancelAnimationFrame)
window.cancelAnimationFrame = function(id) {
clearTimeout(id);
};
}());
|
version https://git-lfs.github.com/spec/v1
oid sha256:bd6a4f073e56a291485d81f121567209294d60dbf503622bd03b524caa3f08d1
size 25637
|
"use strict";
var database = require('../../database');
var getExpression = require('../../crawl/getExpression');
var approve = require('../../crawl/approve');
var isValidResource = require('../../crawl/isValidResource');
var addAlias = require('../../server/addAlias');
var approveResource = require('../../server/approveResource');
function errlog(context){
return function(err){
if(err.query)
err.query = JSON.stringify(err.query);
console.error(context, err);
}
}
module.exports = function(resource, territoireId, depth){
var taskResourceId = resource.id;
var url = resource.url;
return getExpression(url)
.then(function(resExprLink){
//console.log('resExprLink', resExprLink);
var resourceIdP = resExprLink.resource.url !== url ?
addAlias(taskResourceId, resExprLink.resource.url, territoireId, depth).catch(errlog("addAlias")) :
Promise.resolve(taskResourceId);
return resourceIdP.then(function(resourceId){
var resourceUpdatedP = database.Resources.update(
resourceId,
Object.assign(
{},
{other_error: null}, // remove any previous other_error if there was one
resExprLink.resource // take the other_error from here if there is one
)
)
.catch(errlog("Resources.update"));
var expressionUpdatedP;
var linksUpdatedP;
var tasksCreatedP;
if(isValidResource(resExprLink.resource)){
expressionUpdatedP = database.Expressions.create(resExprLink.expression)
.then(function(expressions){
var expression = expressions[0];
return database.Resources.associateWithExpression(resourceId, expression.id)
.then(function(){
if(expression.publication_date){
// create default annotation value
return database.ResourceAnnotations.update(
resourceId,
territoireId,
null,
{publication_date: expression.publication_date}
).catch(errlog("ResourceAnnotations.update"))
}
});
}).catch(errlog("Expressions.create + associateWithExpression"));
expressionUpdatedP
.then(function(){
return database.Tasks.createTasksTodo(resourceId, territoireId, 'analyze_expression', depth);
})
.catch(function(err){
console.error('Error while trying to create analyze_expression tasks', err, err.stack);
})
linksUpdatedP = resExprLink.links.size >= 1 ?
database.Resources.findByURLsOrCreate(resExprLink.links)
.then(function(linkResources){
return Promise._allResolved(linkResources.map(function(r){
return database.Tasks.createTasksTodo(r.id, territoireId, 'prepare_resource', depth+1);
})).then(function(){ return linkResources; })
})
.then(function(linkResources){
var linksData = linkResources.map(function(r){
return {
source: resourceId,
target: r.id
};
});
return database.Links.create(linksData).catch(errlog("Links.create"));
}).catch(errlog("Resources.findByURLsOrCreate link"))
: undefined;
if(approve({depth: depth, expression: resExprLink.expression})){
approveResource(resourceId, territoireId, depth);
}
}
return Promise.all([resourceUpdatedP, expressionUpdatedP, linksUpdatedP, tasksCreatedP]);
});
})
.catch(function(err){
console.log('getExpression error', url, err, err.stack);
return; // symbolic. Just to make explicit the next .then is a "finally"
})
}
|
import distance from "@turf/distance";
/**
* Takes a bounding box and calculates the minimum square bounding box that
* would contain the input.
*
* @name square
* @param {BBox} bbox extent in [west, south, east, north] order
* @returns {BBox} a square surrounding `bbox`
* @example
* var bbox = [-20, -20, -15, 0];
* var squared = turf.square(bbox);
*
* //addToMap
* var addToMap = [turf.bboxPolygon(bbox), turf.bboxPolygon(squared)]
*/
function square(bbox) {
var west = bbox[0];
var south = bbox[1];
var east = bbox[2];
var north = bbox[3];
var horizontalDistance = distance(bbox.slice(0, 2), [east, south]);
var verticalDistance = distance(bbox.slice(0, 2), [west, north]);
if (horizontalDistance >= verticalDistance) {
var verticalMidpoint = (south + north) / 2;
return [
west,
verticalMidpoint - (east - west) / 2,
east,
verticalMidpoint + (east - west) / 2,
];
} else {
var horizontalMidpoint = (west + east) / 2;
return [
horizontalMidpoint - (north - south) / 2,
south,
horizontalMidpoint + (north - south) / 2,
north,
];
}
}
export default square;
|
var svg = d3.select("#histogramme"),
margin = {top: 20, right: 20, bottom: 12 , left: 40},
width = parseInt(d3.select("#histogramme").style("width")) - margin.left - margin.right,
height = parseInt(d3.select("#histogramme").style("height")) - margin.bottom - margin.top;
var x = d3.scale.ordinal()
.rangeRoundBands([0, width], .1);
y = d3.scale.linear().rangeRound([height, 0]);
var g = svg.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
var createGraph = function(data){
x.domain(data.map(function(d) { return d.letter; }));
y.domain([0, d3.max(data, function(d) { return d.frequency; })]);
g.append("g")
.attr("class", "axis axis--x")
.attr("transform", "translate(0," + height + ")")
.call(d3.svg.axis()
.scale(x)
.orient("bottom"));
g.append("g")
.attr("class", "axis axis--y")
.call(d3.svg.axis()
.scale(y)
.orient("left").ticks(10, "%"))
.append("text")
.attr("transform", "rotate(-90)")
.attr("y", 6)
.attr("dy", "0.71em")
.attr("text-anchor", "end")
.text("Taux");
var bar = g.selectAll(".bar")
.data(data)
.enter()
.append("g");
bar.append("rect")
.attr("class", "bar")
.attr("x", function(d) { return x(d.letter); })
.attr("y", function(d) { return y(d.frequency); })
.attr("width", x.rangeBand())
.attr("height", function(d) { return height - y(d.frequency) - margin.bottom - margin.top; });
bar.append("text")
.attr("class", "textHisto")
.attr("x", function(d) { return x(d.letter)})
.attr("y", function(d) { return y(d.frequency); })
.attr("dx", ".35em")
.attr("dy", "1.2em")
.text(function(d) {return (d.frequency*100)+"%";});
bar.append("text")
.attr("class", "dateHisto")
.attr("x", function(d) { return x(d.letter)})
.attr("y", function(d) { return height - margin.bottom - margin.top; })
.attr("dx", ".35em")
.attr("dy", "-.35em")
.text(function(d) {return (d.letter);});
}
d3.tsv("data/data.tsv", function(d) {
createGraph(d);
});
|
/*
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("widget","no",{move:"Klikk og dra for å flytte"});
|
/*
* @Author: detailyang
* @Date: 2016-02-29 10:18:29
* @Last modified by: detailyang
* @Last modified time: 2016-05-06T23:33:41+08:00
*/
import uuid from 'uuid';
import sequelize from 'sequelize';
import models from '../../models';
import utils from '../../utils';
module.exports = {
async get(ctx) {
const keyword = ctx.request.query.keyword || '';
const where = {
is_delete: 0,
};
if (keyword.length > 0) {
where.$or = [{
name: {
$like: `%${keyword}%`,
},
}, {
secret: {
$like: `%${keyword}%`,
},
}];
}
// it's not necessary to await in parallel for performance
const ocs = await models.oauth.findAll({
attributes: ['id', 'name', 'secret', 'identify', 'domain', 'type',
'desc', 'callback', 'is_admin', 'callback_debug'],
where: where,
offset: (ctx.request.page - 1) * ctx.request.per_page,
limit: ctx.request.per_page,
});
if (!ocs) {
throw new utils.error.NotFoundError('dont find oauths');
}
const count = await models.oauth.findOne({
attributes: [
[sequelize.fn('COUNT', sequelize.col('id')), 'count'],
],
where: where,
});
ctx.return.data = {
value: ocs,
total: count.dataValues.count,
per_page: ctx.request.per_page,
page: ctx.request.page,
};
ctx.body = ctx.return;
},
async post(ctx) {
ctx.request.body.secret = uuid.v4();
ctx.request.body.identify = uuid.v4();
const oc = await models.oauth.create(ctx.request.body);
if (!oc) {
throw new utils.error.ServerError('create oauth error');
}
ctx.body = ctx.return;
},
id: {
async get(ctx) {
const oc = await models.oauth.findOne({
where: {
id: ctx.params.id,
},
});
ctx.return.data.value = oc;
ctx.body = ctx.return;
},
async delete(ctx) {
const oc = await models.oauth.update({
is_delete: true,
}, {
where: {
id: ctx.params.id,
},
});
if (!oc) {
throw new utils.error.ServerError('delete oauth error');
}
ctx.body = ctx.return;
},
async put(ctx) {
delete ctx.request.body.secret;
delete ctx.request.identify;
const oc = await models.oauth.update(ctx.request.body, {
where: {
id: ctx.params.id,
},
});
if (!oc) {
throw new utils.error.ServerError('create oauth error');
}
ctx.body = ctx.return;
},
},
};
|
import { Component, ElementRef, HostListener, Input, Optional, Renderer, ViewEncapsulation } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { Config } from '../../config/config';
import { isTrueProperty } from '../../util/util';
import { Form } from '../../util/form';
import { BaseInput } from '../../util/base-input';
import { Item } from '../item/item';
/**
* \@name Checkbox
* \@module ionic
*
* \@description
* The Checkbox is a simple component styled based on the mode. It can be
* placed in an `ion-item` or used as a stand-alone checkbox.
*
* See the [Angular 2 Docs](https://angular.io/docs/ts/latest/guide/forms.html)
* for more info on forms and inputs.
*
*
* \@usage
* ```html
*
* <ion-list>
*
* <ion-item>
* <ion-label>Pepperoni</ion-label>
* <ion-checkbox [(ngModel)]="pepperoni"></ion-checkbox>
* </ion-item>
*
* <ion-item>
* <ion-label>Sausage</ion-label>
* <ion-checkbox [(ngModel)]="sausage" disabled="true"></ion-checkbox>
* </ion-item>
*
* <ion-item>
* <ion-label>Mushrooms</ion-label>
* <ion-checkbox [(ngModel)]="mushrooms"></ion-checkbox>
* </ion-item>
*
* </ion-list>
* ```
*
* \@advanced
*
* ```html
*
* <!-- Call function when state changes -->
* <ion-list>
*
* <ion-item>
* <ion-label>Cucumber</ion-label>
* <ion-checkbox [(ngModel)]="cucumber" (ionChange)="updateCucumber()"></ion-checkbox>
* </ion-item>
*
* </ion-list>
* ```
*
* ```ts
* \@Component({
* templateUrl: 'main.html'
* })
* class SaladPage {
* cucumber: boolean;
*
* updateCucumber() {
* console.log("Cucumbers new state:" + this.cucumber);
* }
* }
* ```
*
* \@demo /docs/demos/src/checkbox/
* @see {\@link /docs/components#checkbox Checkbox Component Docs}
*/
export class Checkbox extends BaseInput {
/**
* @param {?} config
* @param {?} form
* @param {?} item
* @param {?} elementRef
* @param {?} renderer
*/
constructor(config, form, item, elementRef, renderer) {
super(config, elementRef, renderer, 'checkbox', false, form, item, null);
}
/**
* \@input {boolean} If true, the element is selected.
* @return {?}
*/
get checked() {
return this.value;
}
/**
* @param {?} val
* @return {?}
*/
set checked(val) {
this.value = val;
}
/**
* @hidden
* @return {?}
*/
initFocus() {
this._elementRef.nativeElement.querySelector('button').focus();
}
/**
* @hidden
* @param {?} ev
* @return {?}
*/
_click(ev) {
ev.preventDefault();
ev.stopPropagation();
this.value = !this.value;
}
/**
* @hidden
* @param {?} val
* @return {?}
*/
_inputNormalize(val) {
return isTrueProperty(val);
}
/**
* @hidden
* @param {?} val
* @return {?}
*/
_inputCheckHasValue(val) {
this._item && this._item.setElementClass('item-checkbox-checked', val);
}
}
Checkbox.decorators = [
{ type: Component, args: [{
selector: 'ion-checkbox',
template: '<div class="checkbox-icon" [class.checkbox-checked]="_value">' +
'<div class="checkbox-inner"></div>' +
'</div>' +
'<button role="checkbox" ' +
'type="button" ' +
'ion-button="item-cover" ' +
'[id]="id" ' +
'[attr.aria-checked]="_value" ' +
'[attr.aria-labelledby]="_labelId" ' +
'[attr.aria-disabled]="_disabled" ' +
'class="item-cover"> ' +
'</button>',
host: {
'[class.checkbox-disabled]': '_disabled'
},
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: Checkbox, multi: true }],
encapsulation: ViewEncapsulation.None,
},] },
];
/**
* @nocollapse
*/
Checkbox.ctorParameters = () => [
{ type: Config, },
{ type: Form, },
{ type: Item, decorators: [{ type: Optional },] },
{ type: ElementRef, },
{ type: Renderer, },
];
Checkbox.propDecorators = {
'checked': [{ type: Input },],
'_click': [{ type: HostListener, args: ['click', ['$event'],] },],
};
function Checkbox_tsickle_Closure_declarations() {
/** @type {?} */
Checkbox.decorators;
/**
* @nocollapse
* @type {?}
*/
Checkbox.ctorParameters;
/** @type {?} */
Checkbox.propDecorators;
}
//# sourceMappingURL=checkbox.js.map
|
import { createStructuredSelector } from 'reselect';
import { workspaceSelector } from '../_store/directSelectors';
export default createStructuredSelector({
workspace: workspaceSelector,
});
|
define(['marionette',
'./menuTemplate.hbs',
'rup.menu','rup.lang','rup.navbar'], function(Marionette, MenuTemplate){
var MenuView = Marionette.LayoutView.extend({
template: MenuTemplate,
redirectNavLink: fncRedirectNavLink,
ui:{
// menuElement: "#x21aResponsiveWar_menu",
// menuMixedElement: "#x21aResponsiveWar_menu"
languageTool: '#languageDropdown',
navbar: '#navbarResponsive',
navLink : '[data-redirect-navLink]'
// navLinkBt4: "#navLinkBt4",
// navLinkBt3: "#navLinkBt3",
// navLinkJQui: "#navLinkJQui"
},
events: {
'click @ui.navLink': 'redirectNavLink'
},
onAttach : fncOnAttach
});
function fncOnAttach(){
this.ui.languageTool.rup_language({languages: jQuery.rup.AVAILABLE_LANGS_ARRAY});
this.ui.navbar.rup_navbar();
}
function fncRedirectNavLink(event){
var newIndex = $(event.target).attr('data-redirect-navLink');
window.location.href = _replaceIndex(newIndex);
}
function _replaceIndex(newIndex){
var pathname = window.location.pathname,
splitPathname = pathname.split('/'),
index = splitPathname[splitPathname.length-1],
href = window.location.href,
splitHref = href.split(index);
return splitHref[0] + newIndex +(splitHref.length>1?splitHref[splitHref.length-1]:'');
}
return MenuView;
});
|
var searchData=
[
['computefactorial',['computeFactorial',['../namespacecppbase.html#aa174d9b369de9be85584968104f9ff1d',1,'cppbase']]]
];
|
/*!
* WebSocket Library
* @author Lanfei
* @module websocket-lib
*/
exports.Server = require('./lib/server');
exports.Client = require('./lib/client');
exports.Frame = require('./lib/frame');
exports.Session = require('./lib/session');
/**
* Create a WebSocket Server.
* @param {Object} [options]
* @param {String} [options.path] see {@link Server#path}
* @param {http.Server} [options.httpServer] see {@link Server#httpServer}
* @param {Boolean} [options.autoAccept = true] see {@link Server#autoAccept}
* @param {Function} [sessionListener] A listener for the 'session' event.
* @return {Server}
*/
exports.createServer = function (options, sessionListener) {
return new exports.Server(options, sessionListener);
};
/**
* Create a connection to the WebSocket Server.
* @param {Number|String|Object} [options] If options is a string, it is automatically parsed with url.parse().
* @param {String} [options.host = localhost] A domain name or IP address of the server.
* @param {Number} [options.port = 80|443] Port of remote server.
* @param {Object} [options.headers] Headers to be sent to the server.
* @param {String|Array} [options.subProtocols] The list of WebSocket sub-protocols.
* @param {Function} [connectListener] A one time listener for the 'connect' event.
* @return {Client}
*/
exports.connect = function (options, connectListener) {
return new exports.Client(options, connectListener);
};
|
'use strict';
/*
query-parser.js
On a RESTful route, a database resource should be associated with it. Here,
we parse the potential query logic for the querying of the resource.
*/
module.exports = {
inject: [ ],
middleware: function queryParserMiddleware() {
return function queryParser(req, res, next) {
req.searchParams = {};
if (!req.params.id && req.controller.permissions.searchableBy) {
const allowed = req.controller.permissions.searchableBy;
for (let field of allowed) {
if (!req.parsedQuery[field]) continue;
let searchValue = req.parsedQuery[field];
if (typeof searchValue === 'string' && searchValue.indexOf(',') > -1) {
searchValue = { $in: req.parsedQuery[field].split(',') };
}
req.searchParams[field] = searchValue;
}
}
return next();
};
}
};
|
/*#__PURE__*/
React.createElement("div", {
id: "wôw"
});
/*#__PURE__*/
React.createElement("div", {
id: "\\w"
});
/*#__PURE__*/
React.createElement("div", {
id: "w < w"
});
|
import shaderParse from 'utils/shader-parse';
import vertexShader from './shaders/vert.glsl';
import fragmentShader from './shaders/frag.glsl';
/**
* GradientMaterial class
*/
class GradientMaterial extends THREE.ShaderMaterial {
/**
* Constructor function
* @param {Object} options Options
*/
constructor({ texture, preset, ...options }) {
super( options );
this.vertexShader = shaderParse( vertexShader );
this.fragmentShader = shaderParse( fragmentShader );
this.gradientTexture = texture;
this.gradientTexture.magFilter = this.gradientTexture.minFilter = THREE.LinearFilter;
this.transparent = true;
this.fog = true;
this.uniforms = {
...THREE.UniformsLib[ 'fog' ],
'time': {
type: 'f',
value: 0.0
},
'opacity': {
type: 'f',
value: 0.9
},
'random': {
type: 'f',
value: 1.0
},
'gradientTexture': {
type: 't',
value: this.gradientTexture
},
'luminanceSteps': {
type: 'i',
value: 2
},
'luminanceBoost': {
type: 'f',
value: 0.1
},
'useWave': {
type: 'f',
value: true
},
'modelLength': {
type: 'f',
value: 650.0
},
'waveLength': {
type: 'f',
value: 3.0
},
'waveSpeed': {
type: 'f',
value: 1.0
},
'waveBendAmount': {
type: 'f',
value: 10.0
},
'waveOffset': {
type: 'f',
value: 1.0
}
};
if( preset.material && preset.material.uniforms ) {
this.uniforms = {
...this.uniforms,
...preset.material.uniforms
};
}
}
/**
* Update function
* @param {number} time Time
*/
update( time ) {
this.uniforms.time.value = time;
}
}
export default GradientMaterial;
|
const visit = require(`unist-util-visit`)
const { id } = require(`./constants`)
module.exports = function remarkPlugin({ cache, markdownAST }) {
const promises = []
visit(markdownAST, `html`, node => {
promises.push(
(async () => {
if (node.value.match(id)) {
const value = await cache.get(id)
node.value = node.value.replace(/%SUBCACHE_VALUE%/, value)
}
})()
)
})
return Promise.all(promises)
}
|
/* The Computer Language Benchmarks Game
https://salsa.debian.org/benchmarksgame-team/benchmarksgame/
contributed by Léo Sarrazin
*/
const TreeNode = function(left, right) {
this.left = left;
this.right = right;
};
const itemCheck = function(node){
if (node===null) return 1;
return 1 + itemCheck(node.left) + itemCheck(node.right);
};
function bottomUpTree(depth){
return depth>0 ? new TreeNode(
bottomUpTree(depth-1),
bottomUpTree(depth-1)
) : null;
};
const maxDepth = Math.max(6, parseInt(process.argv[2]));
const stretchDepth = maxDepth + 1;
let check = itemCheck(bottomUpTree(stretchDepth));
console.log("stretch tree of depth "+ stretchDepth+ "\t check: "+ check);
const longLivedTree = new TreeNode(
bottomUpTree(maxDepth-1),
bottomUpTree(maxDepth-1)
);
for (let depth=4; depth<=maxDepth; depth+=2){
const iterations = 1 << maxDepth - depth + 4;
check = 0;
for (let i=1; i<=iterations; i++){
check += itemCheck(bottomUpTree(depth));
}
console.log(iterations+"\t trees of depth "+ depth +"\t check: " + check);
}
console.log("long lived tree of depth "+ maxDepth
+ "\t check: "+ itemCheck(longLivedTree));
|
export{addIcons}from"./components/icon/utils";export*from"./components";
|
const async = require('async')
const dbStreamer = require('db-streamer')
const util = require('./util')
/**
* Make an update query to the db to set the interpolated times in
* a particular range of a particular trip
*/
function updateInterpolatedTimes (cfg, callback) {
const db = cfg.db
const lastTimepoint = cfg.lastTimepoint
const nextTimepoint = cfg.nextTimepoint
const timeDiff = nextTimepoint.arrival_time - lastTimepoint.departure_time
let literal
// sqlite null is a string
if (nextTimepoint.shape_dist_traveled && nextTimepoint.shape_dist_traveled !== 'NULL') {
// calculate interpolation based off of distance ratios
const distanceTraveled = nextTimepoint.shape_dist_traveled - lastTimepoint.shape_dist_traveled
literal = `${lastTimepoint.departure_time} +
${timeDiff} *
(shape_dist_traveled - ${lastTimepoint.shape_dist_traveled}) /
${distanceTraveled}`
} else {
// calculate interpolation based off of stop sequence ratios
const numStopsPassed = nextTimepoint.stop_sequence - lastTimepoint.stop_sequence
literal = `${lastTimepoint.departure_time} +
${timeDiff} *
(stop_sequence - ${lastTimepoint.stop_sequence}) /
${numStopsPassed}`
}
const updateLiteral = db.sequelize.literal(literal)
db.stop_time
.update(
{
arrival_time: updateLiteral,
departure_time: updateLiteral
},
{
where: {
trip_id: lastTimepoint.trip_id,
stop_sequence: {
$gt: lastTimepoint.stop_sequence,
$lt: nextTimepoint.stop_sequence
}
}
}
)
.then(() => {
callback()
})
.catch(callback)
}
/**
* Calculate and assign an approximate arrival and departure time
* at all stop_times that have an undefined arrival and departure time
*/
function interpolateStopTimes (db, callback) {
console.log('interpolating stop times')
const streamerConfig = util.makeStreamerConfig(db.trip)
const querier = dbStreamer.getQuerier(streamerConfig)
const maxUpdateConcurrency = db.trip.sequelize.getDialect() === 'sqlite' ? 1 : 100
const updateQueue = async.queue(updateInterpolatedTimes, maxUpdateConcurrency)
let isComplete = false
let numUpdates = 0
/**
* Helper function to call upon completion of interpolation
*/
function onComplete (err) {
if (err) {
console.log('interpolation encountered an error: ', err)
return callback(err)
}
// set is complete and create a queue drain function
// however, a feed may not have any interpolated times, so
// `isComplete` is set in case nothing is pushed to the queue
isComplete = true
updateQueue.drain = () => {
console.log('interpolation completed successfully')
callback(err)
}
}
let rowTimeout
/**
* Helper function to account for stop_times that are completely interpolated
*/
function onRowComplete () {
if (rowTimeout) {
clearTimeout(rowTimeout)
}
if (isComplete && numUpdates === 0) {
rowTimeout = setTimeout(() => {
// check yet again, because interpolated times could've appeared since setting timeout
if (numUpdates === 0) {
console.log('interpolation completed successfully (no interpolations needed)')
callback()
}
}, 10000)
}
}
// TODO: fix this cause it doesn't work w/ sqlite with a schema for some reason
const statement = `SELECT trip_id FROM ${streamerConfig.tableName}`
querier.execute(
statement,
row => {
// get all stop_times for trip
db.stop_time
.findAll({
where: {
trip_id: row.trip_id
}
})
// iterate through stop times to determine null arrival or departure times
.then(stopTimes => {
let lastStopTime
let lastTimepoint
let lookingForNextTimepoint = false
stopTimes.forEach(stopTime => {
if (lookingForNextTimepoint) {
// check if current stop time has a time
// mysql null stop times are showin up as 0, which might be bug elsewhere
// sqlite null shows up as 'NULL'
if (
stopTime.arrival_time !== null &&
stopTime.arrival_time !== 'NULL' &&
stopTime.arrival_time >= lastTimepoint.departure_time
) {
// found next timepoint
// make update query to set interpolated times
updateQueue.push({
db: db,
lastTimepoint: lastTimepoint,
nextTimepoint: stopTime
})
numUpdates++
lookingForNextTimepoint = false
}
} else {
// sqlite uninterpolated shows up ass 'NULL'
if (stopTime.arrival_time === null || stopTime.arrival_time === 'NULL') {
lastTimepoint = lastStopTime
lookingForNextTimepoint = true
}
}
lastStopTime = stopTime
})
onRowComplete()
})
.catch(onComplete)
},
onComplete
)
}
module.exports = {
interpolateStopTimes: interpolateStopTimes
}
|
/* jshint expr: true, mocha:true */
(function () {
'use strict';
var log = require('../app/log');
describe('log', function () {
before(function() {
log.initFileLog('./log', 'test');
});
it('should log', function () {
log.silly('message');
log.debug('message');
log.verbose('message');
log.info('message');
log.warn('message');
log.error('message');
});
});
})();
|
var common = require('./common');
describe('CWD/CDUP commands', function () {
'use strict';
var client;
var server;
var pathExisting = 'usr/local';
var pathWithQuotes = '/"quote"';
var pathFile = 'data.txt';
function pathEscape(text) {
text = text.replace(/\"/g, '""');
return text;
}
function pathExtract(response) {
var text = response && response.text || '';
var match = text.match(/\"(.*)\"/);
text = match && match[1] || '';
return text;
}
beforeEach(function (done) {
server = common.server();
client = common.client(done);
});
describe('CWD command', function () {
it('should change to existing directory', function (done) {
client.raw('CWD', pathExisting, function (error, response) {
var pathCwd = pathExtract(response);
response.code.should.equal(250);
client.raw('PWD', function (error, response) {
var pathPwd = pathExtract(response);
response.code.should.equal(257);
pathPwd.should.equal(pathCwd);
done();
});
});
});
it('should not change to non-existent directory', function (done) {
client.raw('CWD', pathExisting, function (error, response) {
response.code.should.equal(250);
client.raw('CWD', pathExisting, function (error) {
error.code.should.equal(550);
done();
});
});
});
it('should not change to regular file', function (done) {
client.raw('CWD', pathFile, function (error) {
error.code.should.equal(550);
done();
});
});
it('should escape quotation marks', function (done) {
client.raw('MKD', pathWithQuotes, function (error, response) {
var pathEscaped = pathEscape(pathWithQuotes);
var pathMkd = pathExtract(response);
pathMkd.should.equal(pathEscaped);
client.raw('CWD', pathWithQuotes, function (error, response) {
var pathCwd = pathExtract(response);
pathCwd.should.equal(pathEscaped);
client.raw('PWD', function (error, response) {
var pathPwd = pathExtract(response);
pathPwd.should.equal(pathEscaped);
client.raw('RMD', pathWithQuotes);
done();
});
});
});
});
});
describe('CDUP command', function () {
it('should change to parent directory', function (done) {
client.raw('CWD', pathExisting, function (error, response) {
response.code.should.equal(250);
client.raw('CDUP', function (error, response) {
var pathCdup = pathExtract(response);
response.code.should.equal(250);
client.raw('PWD', function (error, response) {
var pathPwd = pathExtract(response);
response.code.should.equal(257);
pathCdup.should.equal(pathPwd);
done();
});
});
});
});
});
afterEach(function () {
server.close();
});
});
|
/*
* jQuery Image Reveal - A Simple Before/After Image Viewer
*
* Version: Master
* Homepage: http://github.com/lemoncreative/jquery-image-reveal
* Licence: MIT
* Copyright: (c) 2013 Lemon Creative;
*/
(function ($) {
$.fn.extend({ imageReveal: function (options) {
var $el = {};
// Merge passed in options with defaults
options = $.extend({}, {
barWidth: 20
, touchBarWidth: 60
, startPosition: 0.5
, paddingLeft: 0
, paddingRight: 0
, showCaption: false
, linkCaption: false
, captionChange: 0.5
, width: 500
, height: 500
, ids: []
}, options);
options.ids = [];
// Ensure startPosition is valid.
if(options.startPosition > 1) options.startPosition = 1;
else if(options.startPosition < 0) options.startPosition = 0;
// Ensure captionChange is valid
if(options.captionChange > 1) options.captionChange = 1;
else if(options.captionChange < 0) options.captionChange = 0;
// Update - Moves the overlay and drag bar to the new location and displays the correct caption.
function update(width, id) {
// The width cannot be set lower than 0 or higher than options.width
if(width < 0) width = 0;
if(width > options.width) width = options.width;
// The width must not go outside any specified padding
if(width < options.paddingLeft) width = options.paddingLeft;
if(width > (options.width - options.paddingRight)) width = options.width - options.paddingRight;
// Apply new width
$el[id].overlay.width(width);
// The drag bar 'left' position should be set to (width - barWidth/2) so we always drag from the center.
var dragBarPosition = width - (options.barWidth / 2);
if(dragBarPosition < 0) dragBarPosition = 0;
if(dragBarPosition > options.width - options.barWidth) dragBarPosition = options.width - options.barWidth;
$el[id].drag.css({ left: dragBarPosition });
// The caption should be set when the given threshold is met
if(options.showCaption) {
var beforeCaption = $el[id].before.attr('title'),
afterCaption = $el[id].after.attr('title');
if (width > options.width * options.captionChange) {
if(beforeCaption && beforeCaption !== '') {
$el[id].caption.text(beforeCaption).fadeIn(options.captionFade || 1000).data('link', $el[id].before.data('link'));
}
else $el[id].caption.fadeOut(options.captionFade || 1000);
}
else {
if(afterCaption && afterCaption !== '') {
$el[id].caption.text(afterCaption).fadeIn(options.captionFade || 1000).data('link', $el[id].after.data('link'));
}
else $el[id].caption.fadeOut(options.captionFade || 1000);
}
}
}
// handleEvent - Calls 'update' if the event is valid
function handleEvent(e) {
var id = $(this).data('imageRevealID');
if(!$el[id].dragging && e.type !== 'click') return false;
var position;
// If it was a touch event
if(e.originalEvent && e.originalEvent.changedTouches) {
// Increase the bar width
if(!options.touchDevice) {
options.touchDevice = true;
options.originalBarWidth = options.barWidth;
options.barWidth = parseInt(options.touchBarWidth, 10);
$.each(options.ids, function(index, value) {
var dragBarPosition = $el[value].drag.position().left - ((options.touchBarWidth / 2) - (options.originalBarWidth / 2));
$el[value].drag.width(options.touchBarWidth).css({ left: dragBarPosition });
});
}
// Get position from touch event
position = e.originalEvent.changedTouches[0].pageX;
}
// Otherwise get position from mouse event
else {
position = e.pageX;
}
// Call update with new width
update(position - $el[id].overlay.offset().left, id);
return false;
}
return this.each(function (i) {
$el[i] = {};
options.ids.push(i);
// Container
$el[i].container = $(this).addClass('imageReveal').data('imageRevealID', i);
// Before Image
$el[i].before = $el[i].container.children('img').first()
.width(options.width)
.height(options.height)
.hide();
// After Image
$el[i].after = $el[i].before.next()
.width(options.width)
.height(options.height)
.hide();
// Set up container
$el[i].container
.width(options.width)
.height(options.height)
.css({ overflow: 'hidden', position: 'relative' })
.append('<div class="imageReveal-overlay"></div>')
.append('<div class="imageReveal-background"></div>')
.append('<div class="imageReveal-drag"></div>')
.append('<div class="imageReveal-caption">' + $el[i].before.attr('title') + '</div>');
// Background
$el[i].bg = $el[i].container.children('.imageReveal-background')
.width(options.width)
.height(options.height)
.css({
'background-image': 'url(' + $el[i].after.attr('src') + ')'
, 'background-size': options.width + 'px ' + options.height + 'px'
});
// Caption
$el[i].caption = $el[i].container.children('.imageReveal-caption');
if(options.showCaption && $el[i].before.attr('title') && $el[i].before.attr('title') !== '') {
$el[i].caption.show();
} else $el[i].caption.hide();
if(options.linkCaption) {
$el[i].caption
.css('cursor', 'pointer')
.data('link', $el[i].before.data('link'))
.on('click', function() {
if($el[i].caption.data('link')) window.location = $el[i].caption.data('link');
return false;
});
}
// Overlay
$el[i].overlay = $el[i].container.children('.imageReveal-overlay')
.width(options.width)
.height(options.height)
.css({
'background-image': 'url(' + $el[i].before.attr('src') + ')'
, 'background-size': options.width + 'px ' + options.height + 'px'
})
.animate({ width: options.width - (options.width * options.startPosition) });
// Drag Bar
$el[i].drag = $el[i].container.children('.imageReveal-drag')
.width(options.barWidth)
.height(options.height)
.animate({ right: (options.width * options.startPosition) - (options.barWidth / 2) })
.on('mousedown touchstart', function() {
$el[i].dragging = true;
$el[i].drag.addClass('dragging');
return false;
})
.on('mouseup touchend touchcancel', function() {
$el[i].dragging = false;
$el[i].drag.removeClass('dragging');
return false;
});
// Catch mouseup on document for when the user
// releases the mouse button outside the container.
$(document).on('mouseup touchend touchcancel', function() {
if(!$el[i].dragging) return;
$el[i].dragging = false;
$el[i].drag.removeClass('dragging');
});
// When the bar is dragged outside the container, immediately
// move it to the min or max position. This avoids the bar
// getting stuck when the mouse is moved too fast
$el[i].container.on('mouseout', function(e) {
if(!$el[i].dragging) return;
update(e.pageX - $el[i].overlay.offset().left, i);
});
}).on('mousemove click touchmove', handleEvent);
}});
})(jQuery);
|
'use strict';
window.DefinePanel('Playback Buttons', {
author: "Teddy Gustiaux, adapted from marc2k3's script",
version: '2019.01.06',
});
// Based on the script found at https://github.com/marc2k3/smp_2003/blob/master/track%20info%20%2B%20seekbar%20%2B%20buttons.txt
include(fb.ComponentPath + 'samples\\complete\\js\\lodash.min.js');
include(fb.ComponentPath + 'samples\\complete\\js\\helpers.js');
include(fb.ComponentPath + 'samples\\complete\\js\\panel.js');
include(fb.ComponentPath + 'samples\\complete\\js\\seekbar.js');
// For more documentation, refer to
// https://github.com/marc2k3/smp_2003/blob/master/js/helpers.js
// https://github.com/TheQwertiest/foo_spider_monkey_panel/blob/master/component/docs/Flags.js
// %AppData%\foobar2000\user-components\foo_spider_monkey_panel\docs\html
//////////////////////////////////////////////////////////////
let colours = {
buttons: window.GetColourCUI(0),
background : window.GetColourCUI(3),
};
function _unicodeToImg(chr, colour) {
const size = 256;
let temp_bmp = gdi.CreateImage(size, size);
let temp_gr = temp_bmp.GetGraphics();
temp_gr.SetTextRenderingHint(4);
let fontItemsEnlarged = gdi.Font(window.GetFontCUI(0).Name, window.GetFontCUI(0).Size * 15, 1);
temp_gr.DrawString(chr, fontItemsEnlarged, colour, 0, 0, size, size, SF_CENTRE);
temp_bmp.ReleaseGraphics(temp_gr);
temp_gr = null;
return temp_bmp;
}
//////////////////////////////////////////////////////////////
let panel = new _panel();
let buttons = new _buttons();
const bs = _scale(24);
on_playback_new_track(fb.GetNowPlaying());
buttons.update = () => {
const y = Math.round((panel.h - bs) / 2);
buttons.buttons.stop = new _button(LM + (bs * 0), y, bs, bs, {normal : _unicodeToImg('\u25fc', colours.buttons)}, () => { fb.Stop(); }, 'Stop');
buttons.buttons.previous = new _button(LM + (bs * 1), y, bs, bs, {normal : _unicodeToImg('\u23EE', colours.buttons)}, () => { fb.Prev(); }, 'Previous');
buttons.buttons.play = new _button(LM + (bs * 2), y, bs, bs, {normal : !fb.IsPlaying || fb.IsPaused ? _unicodeToImg('\u2bc8', colours.buttons) : _unicodeToImg('\u23F8', colours.buttons)}, () => { fb.PlayOrPause(); }, !fb.IsPlaying || fb.IsPaused ? 'Play' : 'Pause');
buttons.buttons.next = new _button(LM + (bs * 3), y, bs, bs, {normal : _unicodeToImg('\u23ED', colours.buttons)}, () => { fb.Next(); }, 'Next');
}
function on_mouse_lbtn_down(x, y) {
return;
}
function on_mouse_lbtn_up(x, y) {
if (buttons.lbtn_up(x, y)) {
return;
}
}
function on_mouse_leave() {
buttons.leave();
}
function on_mouse_move(x, y) {
if (buttons.move(x, y)) {
return;
}
}
function on_mouse_rbtn_up(x, y) {
return panel.rbtn_up(x, y);
}
function on_paint(gr) {
gr.FillSolidRect(0, 0, panel.w, panel.h, colours.background);
buttons.paint(gr);
}
function on_playback_edited() {
window.Repaint();
}
function on_playback_new_track(metadb) {
if (!metadb) {
return;
}
window.Repaint();
}
function on_playback_pause() {
buttons.update();
window.Repaint();
}
function on_playback_starting() {
buttons.update();
window.Repaint();
}
function on_playback_stop() {
buttons.update();
window.Repaint();
}
function on_size() {
panel.size();
buttons.update();
}
|
function solve(args) {
var rules = {},
props = [],
isInRule = false,
noSpace = {
'+': true,
'>': true,
'.': true,
'#': true,
'~': true,
'}': true,
'{': true
};
String.prototype.last = function() {
return this[this.length - 1];
};
for (var i = 0; i < args.length; i++) {
var line = args[i].trim();
if (isInRule) {
let split = line.trim();
if (split.last() === '}') {
isInRule = false;
}
} else {
let spl = line.trim().split(/\s+/);
let selector = '';
for (let j = 0; j < spl.length; j++) {
if ((selector === '') || noSpace[spl[j][0]] || noSpace[selector.last()]) {
selector += spl[j];
} else {
selector += ' ' + spl[j];
}
}
if (selector.last() === '{') {
isInRule = true;
}
console.log(selector);
}
}
}
// tests
solve([
'#the-big-b{',
' color: yellow;',
' size: big;',
'}',
'.muppet{',
' powers: all;',
' skin: fluffy;',
'}',
' .water-spirit {',
' powers: water;',
' alignment : not-good;',
'}',
'all{',
' meant-for: nerdy-children;',
'}',
'.muppet {',
' powers: everything;',
'}',
'all .muppet {',
' alignment : good ;',
'}',
'.muppet+ .water-spirit{',
' power: everything-a-muppet-can-do-and-water;',
'}'
]);
|
'use strict';
var React = require('react');
var sinon = require('sinon');
var expect = require('chai').expect;
var uuid = require('../../core/utils/uuid');
var Diagnostics = require('../../core/diagnostics');
var ActionPayload = require('../../core/actionPayload');
var buildMarty = require('../../../test/lib/buildMarty');
var renderIntoDocument = require('react/addons').addons.TestUtils.renderIntoDocument;
describe('StateMixin', function () {
var element, sandbox, mixin, initialState, Marty, app, state, componentFunctionContext;
beforeEach(function () {
Marty = buildMarty();
app = new Marty.Application();
sandbox = sinon.sandbox.create();
initialState = {
name: 'hello'
};
Diagnostics.devtoolsEnabled = true;
mixin = Marty.createStateMixin({
getInitialState: function getInitialState() {
return initialState;
}
});
});
afterEach(function () {
Diagnostics.devtoolsEnabled = false;
sandbox.restore();
});
describe('when a store changes', function () {
var expectedState, expectedId, action, log;
beforeEach(function () {
expectedId = '123';
sandbox.stub(uuid, 'small').returns(expectedId);
action = new ActionPayload();
expectedState = {};
log = console.log;
console.log = function () {};
app.register('store', Marty.createStore({
action: action,
displayName: 'Store Changes',
addChangeListener: sinon.spy(),
getInitialState: function getInitialState() {
return {};
},
getState: sinon.stub().returns(expectedState)
}));
mixin = Marty.createStateMixin({
listenTo: 'store',
getState: function getState() {
return this.app.store.getState();
}
});
action.addStoreHandler(app.store, 'test');
element = renderClassWithMixin(mixin);
});
afterEach(function () {
console.log = log;
});
});
describe('when the component unmounts', function () {
var disposable;
beforeEach(function () {
disposable = {
dispose: sinon.spy()
};
app.register('unmountStore', Marty.createStore({
getInitialState: function getInitialState() {
return {};
},
addChangeListener: function addChangeListener() {
return disposable;
}
}));
mixin = Marty.createStateMixin({
listenTo: 'unmountStore'
});
element = renderClassWithMixin(mixin);
React.unmountComponentAtNode(element.getDOMNode().parentNode);
});
it('should dispose of any listeners', function () {
expect(disposable.dispose).to.have.been.called;
});
});
describe('when the component props changes', function () {
var child, parent, childRenderCount;
beforeEach(function () {
childRenderCount = 0;
mixin = Marty.createStateMixin({
getState: sinon.spy(function () {
return {};
})
});
child = React.createClass({
displayName: 'child',
mixin: [mixin],
render: function render() {
childRenderCount++;
return React.createElement('div');
}
});
parent = React.createClass({
displayName: 'parent',
render: function render() {
return React.createElement(child, { user: this.state.user });
},
getInitialState: function getInitialState() {
return {
user: { name: 'foo' }
};
}
});
element = renderIntoDocument(React.createElement(parent));
element.setState({
user: { name: 'bar' }
});
});
it('should update the components state', function () {
expect(childRenderCount).to.equal(2);
});
});
describe('when you pass in an object literal', function () {
describe('#getState()', function () {
describe('when not listening to anything', function () {
var context;
beforeEach(function () {
mixin = Marty.createStateMixin({
getState: function getState() {
context = this;
return initialState;
}
});
element = renderClassWithMixin(mixin);
});
it('should call #getState() when calling #getInitialState()', function () {
expect(element.state).to.eql(initialState);
});
it('should set the function context to the store', function () {
expect(context).to.equal(element);
});
});
});
describe('#getInitialState()', function () {
var state;
beforeEach(function () {
state = {
foo: 'bar'
};
initialState = {
bar: 'baz'
};
mixin = Marty.createStateMixin({
getInitialState: function getInitialState() {
return initialState;
},
getState: function getState() {
return state;
}
});
});
it('should set state to merge of #getInitialState() and #getState()', function () {
expect(mixin.getInitialState()).to.eql({
foo: 'bar',
bar: 'baz'
});
});
});
describe('#listenTo', function () {
var newState = {
meh: 'bar'
};
describe('single store', function () {
beforeEach(function () {
app.register('store1', createStore());
mixin = Marty.createStateMixin({
listenTo: 'store1',
getState: function getState() {
return this.app.store1.getState();
}
});
element = renderClassWithMixin(mixin);
});
it('should called #getState() when the store has changed', function () {
app.store1.setState(newState);
expect(element.state).to.eql(newState);
});
});
describe('multiple stores', function () {
var store1State = { woo: 'bar' };
var newState = { foo: 'bar' };
beforeEach(function () {
app.register('store1', createStore(store1State));
app.register('store2', createStore());
mixin = Marty.createStateMixin({
listenTo: ['store1', 'store2'],
getState: function getState() {
return {
store1: this.app.store1.getState(),
store2: this.app.store2.getState()
};
}
});
element = renderClassWithMixin(mixin);
});
it('should called #getState() when any of the stores change', function () {
app.store2.setState(newState);
expect(element.state).to.eql({
store1: store1State,
store2: newState
});
});
});
});
});
function createStore(state) {
return Marty.createStore({
id: uuid.type('StateMixin'),
getInitialState: function getInitialState() {
return state || {};
}
});
}
function renderClassWithMixin(mixin, render) {
var Component = React.createClass({
mixins: [mixin],
displayName: mixin.displayName,
render: render || function () {
state = this.state;
componentFunctionContext = this;
return React.createElement('div', null, this.state.name);
}
});
return renderIntoDocument(React.createElement(Component, { app: app }));
}
});
|
var settings = {
"async": true,
"crossDomain": true,
"url": "http://mockbin.com/har",
"method": "POST",
"headers": {
"content-type": "application/json"
},
"processData": false,
"data": "{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":{}}],\"boolean\":false}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
|
// authorize filter
export function authorize(req, res, next) {
if(req.isAuthenticated()){
next();
}else{
res.redirect('/auth/login');
}
};
|
const path = require('path')
const util = require('util')
const async = require('async')
const fs = require('fs')
const YAML = require('yamljs')
// const replace = require('replace')
const logger = require(path.resolve(__dirname, 'logging.js'))('out.log')
const BOOKS = [
{
"BOOK": "r_1",
"FIRST_PAGE": 78,
"LAST_PAGE": 709
},
{
"BOOK": "r_2",
"FIRST_PAGE": 132,
"LAST_PAGE": 732
},
{
"BOOK": "r_3",
"FIRST_PAGE": 310,
"LAST_PAGE": 824
},
{
"BOOK": "r_5",
"FIRST_PAGE": 26,
"LAST_PAGE": 728
}
]
let bnr = 0
const BOOK = BOOKS[bnr].BOOK
const FIRST_PAGE = BOOKS[bnr].FIRST_PAGE
const LAST_PAGE = BOOKS[bnr].LAST_PAGE
const PARANDUSED = YAML.load(BOOK + '_parandused.yaml')
const FIELDS = YAML.load(BOOK + '_fields.yaml')
const RECORD_PARSER_STR = "^" + FIELDS
.filter(function(field) { return field.re && field.ix })
.sort(function(a, b) {
return a.ix - b.ix
})
.reduce(function(re, field) {
if (typeof(re) === 'object') { re = re.re }
return re + field.re
}) + "$"
const RECORD_PARSER_RE = new RegExp(RECORD_PARSER_STR)
// console.log(RECORD_PARSER_RE)
fs.access(BOOK + '.txt', (err) => {
if (!err) {
console.log('readConvertedFile ' + BOOK + '.txt')
readConvertedFile(BOOK + '.txt')
return;
}
console.log('Convert file ' + BOOK + '.pdf')
var exec = require('child_process').exec
var cmd = 'pdftotext "' + BOOK + '.pdf" -nopgbrk -enc UTF-8 -f ' + FIRST_PAGE + ' -l ' + LAST_PAGE + ' -layout'
exec(cmd, function(error, stdout, stderr) {
let filename = BOOK + '.txt'
const cleanupConvertedFile = function(filename, callback) {
fs.readFile(filename, 'utf8', function (err, data) {
if (err) {
return console.log(err)
}
PARANDUSED.global.forEach(function(parandus) {
let re = new RegExp(parandus.f, 'g')
data = data.replace(re, parandus.t)
})
fs.writeFile(filename, data, 'utf8', function (err) {
if (err) return console.log(err)
callback()
})
})
}
cleanupConvertedFile(filename, function() {
readConvertedFile(filename)
})
})
})
const readConvertedFile = function(filename) {
const lineReader = require('readline').createInterface({
input: fs.createReadStream(filename)
})
let pages = {}
let raw_lines = []
let skip_line_after_pagenum = true
let page_number_re = /^ {0,125}([0-9]{1,3})$/
lineReader.on('line', function (line) {
if (skip_line_after_pagenum) {
skip_line_after_pagenum = false
return
}
if (line === '') { return }
let match = page_number_re.exec(line)
if (match) {
skip_line_after_pagenum = true
let page_number = match[1]
// process.stdout.cursorTo(0)
// process.stdout.write('page_number: ' + page_number)
pages[page_number] = {n:page_number, lines:mergePage(raw_lines)}
// console.log(pages[page_number].lines.join("\n"));
// process.exit(1)
raw_lines = []
return
}
// let page_name_re = /^( {0,120}[A-ZÕÜÄÖŠŽ\-]{3,})$/
// if (page_name_re.exec(line)) { return }
raw_lines.push(line)
return
})
lineReader.on('close', function (line) {
console.log('converted ' + Object.keys(pages).length + ' pages from pdf.')
readRecords(pages)
})
}
const mergePage = function(raw_lines) {
// console.log(JSON.stringify(raw_lines, null, 4))
function findSplit(raw_lines, log) {
let positionMap = []
for (var i = 0; i < 150; i++) {
positionMap[i] = true
}
raw_lines.forEach(function(line) {
if (log) { console.log(line) }
let temp = ''
for (var i = 0; i < line.length; i++) {
positionMap[i] = positionMap[i] && (line.charAt(i) === ' ' ? true : false)
// console.log(i,line.charAt(i))
temp = temp + (line.charAt(i) === ' ' ? '+' : '-')
}
if (log) { console.log(temp) }
})
if (log) { return }
split_re = /^(\-*)(\+*)(\-*)\+/
let match = split_re.exec(
positionMap
.map(function(n){ return n ? '+' : '-' })
.join('')
)
// In case of pattern mismatch
// if (match[3] === '' || match[2].charAt(0) !== '+') {
// console.log('ERR');
// findSplit(raw_lines, true)
// console.log(positionMap
// .map(function(n){ return n ? '+' : '-' })
// .join(''))
// console.log(JSON.stringify({match:match}, null, 4))
// process.exit()
// }
// console.log(' left:',(match[1].length + 1))
// console.log(JSON.stringify(positionMap, null, 4));
// process.exit()
return {left: match[1].length, split: match[2].length}
}
let lefthalf = []
let righthalf = []
let split = findSplit(raw_lines)
let line_split_str = '^(.{1,' + split.left + '}).{0,' + split.split + '}(.*)$'
let line_split_re = new RegExp(line_split_str)
raw_lines.forEach(function(line) {
match = line_split_re.exec(line)
if (match) {
if (match[1].trim().length > 1) {
lefthalf.push((match[1]).trim())
}
if (match[2] && match[2].trim().length > 1) {
righthalf.push((match[2]).trim())
}
}
})
// console.log(JSON.stringify(lefthalf.concat(righthalf), null, 4))
return lefthalf.concat(righthalf)
}
const readRecords = function(pages) {
const joinRows = function(record, line) {
let re = /[^0-9]-$/
if (record === '') { return line }
if (re.test(record)) {
return record.slice(0, (record.length - 1)) + line
}
if (record.charAt(record.length - 1) === '.' && /^[0-9]/.test(line)) {
return record + line
}
re = /[0-9]-$/
if (re.test(record)) {
return record + line
}
return record + ' ' + line
}
let record = ''
let records = []
let re = /(]| \.)$/
Object.keys(pages).forEach(function(ix) {
pages[ix].lines.forEach(function(line) {
record = joinRows(record, line)
if (re.test(line)) {
record = record.replace( / +/g, ' ' )
PARANDUSED.line.forEach(function(parandus) {
let re = new RegExp(parandus.f, 'g')
record = record.replace(re, parandus.t)
})
// Poolitusmärke eemaldades kadusid sidekriipsud ka liitnimede seest.
// Convert all CamelCaseStrings to Dash-Separated-Strings
// re = /([A-ZŠ])([A-ZŠ])([a-z])|([a-z])([A-ZŠ])/g
// line = line.replace(re, '$1$4-$2$3$5')
// leftstream.write(record + '\n')
record = record.split('\n')
records = records.concat(record)
record = ''
}
})
})
// console.log(JSON.stringify(records, null, 4))
console.log("==========");
// console.log(records.join("\n"));
// process.exit(1)
parseRecords(records)
}
const CSVSTREAM = fs.createWriteStream(BOOK + '_isikud.csv')
const csvWrite = function csvWrite(isik) {
CSVSTREAM.write(
FIELDS
.map(function(field) {
let ret_val = isik[field['field']] ? isik[field['field']] : field['default']
try {
return '"' + ret_val.replace(/"/g, '""') + '"'
} catch (e) {
console.log({ isik:isik, field:field, ret_val:ret_val })
throw e
}
})
.join(', ') + '\n'
)
}
const elasticsearch = require('elasticsearch')
var esClient = new elasticsearch.Client({
host: 'https://' + process.env.ES_CREDENTIALS + '@94abc9318c712977e8c684628aa5ea0f.us-east-1.aws.found.io:9243'
// log: 'trace'
})
const queue = require('async/queue')
var q = queue(function(task, callback) {
// console.log('Start ' + task.id)
esClient.create(task, function(error, response) {
if (error) {
if (error.status === 409) {
console.log('Skip allready imported ' + task.id)
return callback(null)
}
if (error.status === 408) {
console.log('Timed out for ' + task.id)
q.push(task, callback)
return // callback next time
}
console.log('Failed ' + task.id)
return callback(error)
}
console.log('Inserted ' + task.id)
return callback(null)
})
}, 5)
q.drain = function() {
console.log('all items have been processed')
}
const save2db = function save2db(isik, callback) {
let create = {}
create.index = 'isikud'
create.type = 'isik'
create.id = isik.id
create.body = isik
// console.log('enqueue ', isik.id);
q.push(create, function(error) {
if (error) {
return callback(error)
}
return callback(null)
})
}
let labels = {}
FIELDS.forEach(function(field) {
labels[field.field] = field.label
})
csvWrite(labels)
const leftPad = function(i) {
let pad = "00000"
return pad.substring(0, pad.length - i.length) + i.toString()
}
var isikud = []
const parseRecords = function(records) {
console.log('parseRecords');
let i = 1
records.forEach(function(record) {
i++
logger.log(record, i)
PARANDUSED.split.forEach(function(parandus) {
let re = new RegExp(parandus.f, 'g')
record = record.replace(re, parandus.t)
})
// logger.log(record, i)
let _records = record.split('\n')
_records.forEach(function(record) {
parseRecord(record)
// logger.log(record, i)
})
})
}
const crc32 = require('crc32');
let unmatched = 0
const parseRecord = function(record) {
let isik = {
id: crc32(record),
kirje: record
}
logger.log(isik)
// console.log(isik)
let match = RECORD_PARSER_RE.exec(record)
if (match) {
FIELDS.forEach(function(field) {
if (!field.ix) { return }
if (match[field.ix]) {
isik[field.field] = match[field.ix].replace(/^[,\. ]+|[,\. ]+$/gm,'')
}
} )
} else {
console.log(++unmatched, 'Cant match', JSON.stringify({i:isik, re:RECORD_PARSER_STR}, null, 4))
}
csvWrite(isik)
save2db(isik, function(error) {
if (error) {
console.log(JSON.stringify(error, null, 4))
} else {
// console.log('created ', isik.id)
}
})
}
|
'use strict';
var BorderXform = require('../../../../../lib/xlsx/xform/style/border-xform');
var testXformHelper = require('./../test-xform-helper');
var expectations = [
{
title: 'Empty',
create: function() { return new BorderXform(); },
preparedModel: {},
xml: '<border><left/><right/><top/><bottom/><diagonal/></border>',
get parsedModel() { return this.preparedModel; },
tests: ['render', 'renderIn', 'parse']
},
{
title: 'Thin Red Box',
create: function() { return new BorderXform(); },
preparedModel: {
left: { color: {argb: 'FFFF0000'}, style: 'thin' },
right: { color: {argb: 'FFFF0000'}, style: 'thin' },
top: { color: {argb: 'FFFF0000'}, style: 'thin' },
bottom: { color: {argb: 'FFFF0000'}, style: 'thin' }
},
xml: '<border><left style="thin"><color rgb="FFFF0000"/></left><right style="thin"><color rgb="FFFF0000"/></right><top style="thin"><color rgb="FFFF0000"/></top><bottom style="thin"><color rgb="FFFF0000"/></bottom><diagonal/></border>',
get parsedModel() { return this.preparedModel; },
tests: ['render', 'renderIn', 'parse']
},
{
title: 'Dotted colourless Box',
create: function() { return new BorderXform(); },
preparedModel: {
left: { style: 'dotted' },
right: { style: 'dotted' },
top: { style: 'dotted' },
bottom: { style: 'dotted' }
},
xml: '<border><left style="dotted"/><right style="dotted"/><top style="dotted"/><bottom style="dotted"/><diagonal/></border>',
get parsedModel() { return this.preparedModel; },
tests: ['render', 'renderIn', 'parse']
},
{
title: 'Cross',
create: function() { return new BorderXform(); },
preparedModel: {diagonal: {style: 'thin', up: true, down: true}},
xml: '<border diagonalUp="1" diagonalDown="1"><left/><right/><top/><bottom/><diagonal style="thin"/></border>',
get parsedModel() { return this.preparedModel; },
tests: ['render', 'renderIn', 'parse']
},
{
title: 'Missing Style',
create: function() { return new BorderXform(); },
preparedModel: {
left: { color: {argb: 'FFFF0000'} },
right: { color: {argb: 'FFFF0000'} },
top: { color: {argb: 'FFFF0000'}, style: 'medium' },
bottom: { color: {argb: 'FFFF0000'}, style: 'medium' }
},
xml: '<border><left/><right/><top style="medium"><color rgb="FFFF0000"/></top><bottom style="medium"><color rgb="FFFF0000"/></bottom><diagonal/></border>',
tests: ['render', 'renderIn']
},
{
title: 'Missing Style',
create: function() { return new BorderXform(); },
xml: '<border><left><color rgb="FFFF0000"/></left><right><color rgb="FFFF0000"/></right><top style="medium"><color rgb="FFFF0000"/></top><bottom style="medium"><color rgb="FFFF0000"/></bottom><diagonal/></border>',
parsedModel: {
left: { color: {argb: 'FFFF0000'} },
right: { color: {argb: 'FFFF0000'} },
top: { color: {argb: 'FFFF0000'}, style: 'medium' },
bottom: { color: {argb: 'FFFF0000'}, style: 'medium' }
},
tests: ['parse']
}
];
describe('BorderXform', function() {
testXformHelper(expectations);
});
|
/**
* Templates to match those used previous versions of Backbone Form, i.e. <= 0.11.0.
* NOTE: These templates are deprecated.
*/
Form.template = _.template('\
<form class="bbf-form" data-fieldsets></form>\
');
Form.Fieldset.template = _.template('\
<fieldset>\
<% if (legend) { %>\
<legend><%= legend %></legend>\
<% } %>\
<ul data-fields></ul>\
</fieldset>\
');
Form.Field.template = _.template('\
<li class="bbf-field field-<%= key %>">\
<label for="<%= editorId %>"><%= title %></label>\
<div class="bbf-editor" data-editor></div>\
<div class="bbf-help"><%= help %></div>\
<div class="bbf-error" data-error></div>\
</li>\
');
Form.NestedField.template = _.template('\
<li class="bbf-field bbf-nested-field field-<%= key %>">\
<label for="<%= editorId %>"><%= title %></label>\
<div class="bbf-editor" data-editor></div>\
<div class="bbf-help"><%= help %></div>\
<div class="bbf-error" data-error></div>\
</li>\
');
Form.editors.Date.template = _.template('\
<div class="bbf-date">\
<select class="bbf-date" data-type="date"><%= dates %></select>\
<select class="bbf-month" data-type="month"><%= months %></select>\
<select class="bbf-year" data-type="year"><%= years %></select>\
</div>\
');
Form.editors.DateTime.template = _.template('\
<div class="bbf-datetime">\
<div class="bbf-date-container" data-date></div>\
<select data-type="hour"><%= hours %></select>\
:\
<select data-type="min"><%= mins %></select>\
</div>\
');
Form.editors.List.template = _.template('\
<div class="bbf-list">\
<ul data-items></ul>\
<div class="bbf-actions"><button type="button" data-action="add">Add</div>\
</div>\
');
Form.editors.List.Item.template = _.template('\
<li>\
<button type="button" data-action="remove" class="bbf-remove">×</button>\
<div class="bbf-editor-container" data-editor></div>\
</li>\
');
Form.editors.List.Object.template = Form.editors.List.NestedModel.template = _.template('\
<div class="bbf-list-modal"><%= summary %></div>\
');
|
<<<<<<< HEAD
// Export sub-modules
exports.error = exports.Error = require('boom');
exports.sntp = require('sntp');
exports.server = require('./server');
exports.client = require('./client');
exports.crypto = require('./crypto');
exports.utils = require('./utils');
exports.uri = {
authenticate: exports.server.authenticateBewit,
getBewit: exports.client.getBewit
};
=======
// Export sub-modules
exports.error = exports.Error = require('boom');
exports.sntp = require('sntp');
exports.server = require('./server');
exports.client = require('./client');
exports.crypto = require('./crypto');
exports.utils = require('./utils');
exports.uri = {
authenticate: exports.server.authenticateBewit,
getBewit: exports.client.getBewit
};
>>>>>>> 50c6ad9722620f2ede718c0872171e74ab9f4123
|
var should = require('should'),
// Stuff we are testing
helpers = require('../../../frontend/helpers');
describe('{{page_url}} helper', function () {
var options = {data: {root: {pagination: {}}}};
beforeEach(function () {
options.data.root = {pagination: {}};
});
it('can return a valid url when the relative URL is /', function () {
options.data.root.relativeUrl = '/';
options.data.root.pagination.next = 3;
options.data.root.pagination.prev = 6;
helpers.page_url(1, options).should.equal('/');
helpers.page_url(2, options).should.equal('/page/2/');
helpers.page_url(50, options).should.equal('/page/50/');
helpers.page_url('next', options).should.eql('/page/3/');
helpers.page_url('prev', options).should.eql('/page/6/');
});
it('can return a valid url when the relative url has a path', function () {
options.data.root.relativeUrl = '/tag/pumpkin/';
options.data.root.pagination.next = 10;
options.data.root.pagination.prev = 2;
helpers.page_url(1, options).should.equal('/tag/pumpkin/');
helpers.page_url(2, options).should.equal('/tag/pumpkin/page/2/');
helpers.page_url(50, options).should.equal('/tag/pumpkin/page/50/');
helpers.page_url('next', options).should.eql('/tag/pumpkin/page/10/');
helpers.page_url('prev', options).should.eql('/tag/pumpkin/page/2/');
});
it('should assume 1 if page is undefined', function () {
options.data.root.relativeUrl = '/tag/pumpkin/';
options.data.root.pagination.next = 10;
options.data.root.pagination.prev = 2;
helpers.page_url(options).should.equal(helpers.page_url(1, options));
});
});
|
import RSS from 'rss';
import { errorHtml } from '../util';
/**
* Generates RSS.
*
* @param {object} props
* @return {string}
*/
export default function renderRss(props = {}) {
const missingProp = prop =>
errorHtml(
`Error while rendering an RSS feed ${props.sourcePath}: ` +
`missing required property "${prop}".`
);
const requiredProps = ['title', 'description', 'items'];
for (const prop of requiredProps) {
if (!props[prop]) {
return missingProp(prop);
}
}
props = {
...props,
language: props.lang,
feed_url: props.absolutizeUrl(props.feedUrl || `${props.url}.xml`),
site_url: props.absolutizeUrl(props.siteUrl || ''),
image_url: props.imageUrl && props.absolutizeUrl(props.imageUrl),
custom_namespaces: props.customNamespaces,
custom_elements: props.customElements,
};
const feed = new RSS(props);
props.items.forEach(item => {
feed.item({
...item,
url: props.absolutizeUrl(item.url),
description: props.absolutizeLinks(item.content),
custom_elements: item.customElements,
});
});
return feed.xml({ indent: true });
}
|
var render = require('../render');
describe("A render function", function () {
it("parses the template with a substitute and block", function () {
var template = "<h1>Category: {{category}}</h1>\n" +
"<ol>\n" +
"{# items must be non-empty for valid markup #}" +
"{% items %}" +
" <li>{{ . }}</li>\n" +
"{% / %}" +
"</ol>\n";
var result = render(template, {
category: "Fruits",
items: ["Mango", "Banana", "Orange" ]
});
var expected = "<h1>Category: Fruits</h1>\n" +
"<ol>\n" +
" <li>Mango</li>\n" +
" <li>Banana</li>\n" +
" <li>Orange</li>\n" +
"</ol>\n";
expect(result).toEqual(expected);
});
it("parses a template with a nested block", function () {
var data = { table: [
[1, 2, 3],
[4, 5, 6]
] };
var template = "<table>\n" +
"{% table %}" +
" <tr>\n" +
" {% . %}" +
"<td>{{ . }}</td>" +
"{% / %}" +
"\n </tr>\n" +
"{% / %}" +
"</table>\n";
var result = render(template, data);
var expected = "<table>\n" +
" <tr>\n" +
" <td>1</td><td>2</td><td>3</td>\n" +
" </tr>\n" +
" <tr>\n" +
" <td>4</td><td>5</td><td>6</td>\n" +
" </tr>\n" +
"</table>\n";
expect(result).toEqual(expected);
});
it("matches :default() filter", function () {
var data = { ok: "ok" };
var template = "{{ missingValue : default ({{are here!}}) }} {{ ok: default (not replaced)}}";
var result = render(template, data);
expect(result).toEqual("{{are here!}} ok");
});
it("matches any filters combined", function () {
var data = { hello: " world " };
var template = "{{ hello : upper:capitalize:trim }} {{ hello : capitalize:trim }}";
var result = render(template, data);
expect(result).toEqual("WORLD World");
});
});
|
/**
* the cat clicker app - it basically knows about the octopus (aka controller) and kicks off the app
*/
(function () {
var octopus = this.octopus;
octopus.initializeModel();
octopus.setupCatList();
}());
|
/** @license MIT License (c) copyright 2011-2013 original author or authors */
/**
* Licensed under the MIT License at:
* http://www.opensource.org/licenses/mit-license.php
*
* @author Brian Cavalier
* @author John Hann
*/
(function(define) { 'use strict';
define(function(require) {
var when = require('./when');
var Promise = when.Promise;
var toPromise = when.resolve;
return {
all: when.lift(all),
map: map,
settle: settle
};
/**
* Resolve all the key-value pairs in the supplied object or promise
* for an object.
* @param {Promise|object} object or promise for object whose key-value pairs
* will be resolved
* @returns {Promise} promise for an object with the fully resolved key-value pairs
*/
function all(object) {
var p = Promise._defer();
var resolver = Promise._handler(p);
var results = {};
var keys = Object.keys(object);
var pending = keys.length;
for(var i=0, k; i<keys.length; ++i) {
k = keys[i];
Promise._handler(object[k]).fold(settleKey, k, results, resolver);
}
if(pending === 0) {
resolver.resolve(results);
}
return p;
function settleKey(k, x, resolver) {
/*jshint validthis:true*/
this[k] = x;
if(--pending === 0) {
resolver.resolve(results);
}
}
}
/**
* Map values in the supplied object's keys
* @param {Promise|object} object or promise for object whose key-value pairs
* will be reduced
* @param {function(value:*, key:String):*} f mapping function which may
* return either a promise or a value
* @returns {Promise} promise for an object with the mapped and fully
* resolved key-value pairs
*/
function map(object, f) {
return toPromise(object).then(function(object) {
return all(Object.keys(object).reduce(function(o, k) {
o[k] = toPromise(object[k]).fold(mapWithKey, k);
return o;
}, {}));
});
function mapWithKey(k, x) {
return f(x, k);
}
}
/**
* Resolve all key-value pairs in the supplied object and return a promise
* that will always fulfill with the outcome states of all input promises.
* @param {object} object whose key-value pairs will be settled
* @returns {Promise} promise for an object with the mapped and fully
* settled key-value pairs
*/
function settle(object) {
var keys = Object.keys(object);
var results = {};
if(keys.length === 0) {
return toPromise(results);
}
var p = Promise._defer();
var resolver = Promise._handler(p);
var promises = keys.map(function(k) { return object[k]; });
when.settle(promises).then(function(states) {
populateResults(keys, states, results, resolver);
});
return p;
}
function populateResults(keys, states, results, resolver) {
for(var i=0; i<keys.length; i++) {
results[keys[i]] = states[i];
}
resolver.resolve(results);
}
});
})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });
|
var searchData=
[
['cammode_5fphoto',['CamMode_Photo',['../classrc_1_1_flycam_one.html#ad02cbbfa372bad663bb832bd47d67909aed570c1d81630ed6515f0762dc6a162a',1,'rc::FlycamOne']]],
['cammode_5fserial',['CamMode_Serial',['../classrc_1_1_flycam_one.html#ad02cbbfa372bad663bb832bd47d67909a3f765466ee391f4ad80cdeeccd7cbdb5',1,'rc::FlycamOne']]],
['cammode_5fvideo',['CamMode_Video',['../classrc_1_1_flycam_one.html#ad02cbbfa372bad663bb832bd47d67909ac77602e5ef987db02838694a6ddb6180',1,'rc::FlycamOne']]]
];
|
'use strict'
var Type = require('./Type.js')
, uniqueTypeID = 0
, globalOptions = require('../globalOptions.js')
function UniqueType(sourceName, id) {
Type.call(this, sourceName || '')
this.id = id || ++uniqueTypeID
}
UniqueType.prototype = Object.create(Type.prototype)
UniqueType.prototype.constructor = Type
UniqueType.prototype.containsType = function(instance, typeFilters, recs) {
return instance instanceof UniqueType && instance.id === this.id
}
UniqueType.prototype.toString = function() {
return '#' + this.name +
(globalOptions.uniqueTypeDetail ? this.id : '')
}
module.exports = UniqueType
|
(function() {
var ExecutionError, ResponseCode,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
ResponseCode = require('../message/ResponseCode');
module.exports = ExecutionError = (function(superClass) {
extend(ExecutionError, superClass);
function ExecutionError(message) {
this.message = message;
this.responseCode = ResponseCode.ERROR;
}
return ExecutionError;
})(Error);
}).call(this);
//# sourceMappingURL=ExecutionError.js.map
|
/**
* mux.js
*
* Copyright (c) 2015 Brightcove
* All rights reserved.
*
* Reads in-band caption information from a video elementary
* stream. Captions must follow the CEA-708 standard for injection
* into an MPEG-2 transport streams.
* @see https://en.wikipedia.org/wiki/CEA-708
*/
(function(window, muxjs, undefined) {
'use strict';
// -----------------
// Link To Transport
// -----------------
// Supplemental enhancement information (SEI) NAL units have a
// payload type field to indicate how they are to be
// interpreted. CEAS-708 caption content is always transmitted with
// payload type 0x04.
var USER_DATA_REGISTERED_ITU_T_T35 = 4;
/**
* Parse a supplemental enhancement information (SEI) NAL unit.
*
* @param bytes {Uint8Array} the bytes of a SEI NAL unit
* @return {object} the parsed SEI payload
* @see Rec. ITU-T H.264, 7.3.2.3.1
*/
var parseSei = function(bytes) {
var result = {
payloadType: -1,
payloadSize: 0,
}, i;
// parse the payload type
// if the payload type is not user_data_registered_itu_t_t35,
// don't bother parsing any further
if (bytes[1] !== USER_DATA_REGISTERED_ITU_T_T35) {
return result;
}
result.payloadType = USER_DATA_REGISTERED_ITU_T_T35;
// parse the payload size
for (i = 2; i < bytes.length && bytes[i] === 0xff; i++) {
result.payloadSize += 255;
}
result.payloadSize <<= 8;
result.payloadSize |= bytes[i];
i++;
result.payload = bytes.subarray(i, i + result.payloadSize);
return result;
};
// see ANSI/SCTE 128-1 (2013), section 8.1
var parseUserData = function(sei) {
// itu_t_t35_contry_code must be 181 (United States) for
// captions
if (sei.payload[0] !== 181) {
return null;
}
// itu_t_t35_provider_code should be 49 (ATSC) for captions
if (((sei.payload[1] << 8) | sei.payload[2]) !== 49) {
return null;
}
// the user_identifier should be "GA94" to indicate ATSC1 data
if (String.fromCharCode(sei.payload[3],
sei.payload[4],
sei.payload[5],
sei.payload[6]) !== 'GA94') {
return null;
}
// finally, user_data_type_code should be 0x03 for caption data
if (sei.payload[7] !== 0x03) {
return null;
}
// return the user_data_type_structure and strip the trailing
// marker bits
return sei.payload.subarray(8, sei.payload.length - 1);
};
// see CEA-708-D, section 4.4
var parseCaptionPackets = function(pts, userData) {
var results = [], i, count, offset, data;
// if this is just filler, return immediately
if (!(userData[0] & 0x40)) {
return results;
}
// parse out the cc_data_1 and cc_data_2 fields
count = userData[0] & 0x1f;
for (i = 0; i < count; i++) {
offset = i * 3;
data = {
type: userData[offset + 2] & 0x03,
pts: pts
};
// capture cc data when cc_valid is 1
if (userData[offset + 2] & 0x04) {
data.ccData = (userData[offset + 3] << 8) | userData[offset + 4];
results.push(data);
}
}
return results;
};
var CaptionStream = function() {
CaptionStream.prototype.init.call(this);
this.field1_ = new Cea608Stream();
this.field1_.on('data', this.trigger.bind(this, 'data'));
};
CaptionStream.prototype = new muxjs.utils.Stream();
CaptionStream.prototype.push = function(event) {
var sei, userData, captionPackets, i;
// only examine SEI NALs
if (event.nalUnitType !== 'sei_rbsp') {
return;
}
// parse the sei
sei = parseSei(event.data);
// ignore everything but user_data_registered_itu_t_t35
if (sei.payloadType !== USER_DATA_REGISTERED_ITU_T_T35) {
return;
}
// parse out the user data payload
userData = parseUserData(sei);
// ignore unrecognized userData
if (!userData) {
return;
}
// parse out CC data packets
captionPackets = parseCaptionPackets(event.pts, userData);
// send the data to the appropriate field
for (i = 0; i < captionPackets.length; i++) {
if (captionPackets[i].type === 0) {
this.field1_.push(captionPackets[i]);
}
}
};
// ----------------------
// Session to Application
// ----------------------
var BASIC_CHARACTER_TRANSLATION = {
0x5c: 0xe9,
0x5e: 0xed,
0x5f: 0xf3,
0x60: 0xfa,
0x7b: 0xe7,
0x7c: 0xf7,
0x7d: 0xd1,
0x7e: 0xf1,
0x2a: 0xe1,
0x7f: 0x2588
};
// Constants for the byte codes recognized by Cea608Stream. This
// list is not exhaustive. For a more comprehensive listing and
// semantics see
// http://www.gpo.gov/fdsys/pkg/CFR-2010-title47-vol1/pdf/CFR-2010-title47-vol1-sec15-119.pdf
var PADDING = 0x0000,
// Pop-on Mode
RESUME_CAPTION_LOADING = 0x1420,
END_OF_CAPTION = 0x142f,
// Roll-up Mode
ROLL_UP_2_ROWS = 0x1425,
ROLL_UP_3_ROWS = 0x1426,
ROLL_UP_4_ROWS = 0x1427,
CARRIAGE_RETURN = 0x142d,
// Erasure
BACKSPACE = 0x1421,
ERASE_DISPLAYED_MEMORY = 0x142c,
ERASE_NON_DISPLAYED_MEMORY = 0x142e;
// the index of the last row in a CEA-608 display buffer
var BOTTOM_ROW = 14;
// CEA-608 captions are rendered onto a 34x15 matrix of character
// cells. The "bottom" row is the last element in the outer array.
var createDisplayBuffer = function() {
var result = [], i = BOTTOM_ROW + 1;
while (i--) {
result.push('');
}
return result;
};
var Cea608Stream = function() {
Cea608Stream.prototype.init.call(this);
this.mode_ = 'popOn';
// When in roll-up mode, the index of the last row that will
// actually display captions. If a caption is shifted to a row
// with a lower index than this, it is cleared from the display
// buffer
this.topRow_ = 0;
this.startPts_ = 0;
this.displayed_ = createDisplayBuffer();
this.nonDisplayed_ = createDisplayBuffer();
this.push = function(packet) {
var data, swap, charCode;
// remove the parity bits
data = packet.ccData & 0x7f7f;
switch (data) {
case PADDING:
break;
case RESUME_CAPTION_LOADING:
this.mode_ = 'popOn';
break;
case END_OF_CAPTION:
// if a caption was being displayed, it's gone now
this.flushDisplayed(packet.pts);
// flip memory
swap = this.displayed_;
this.displayed_ = this.nonDisplayed_;
this.nonDisplayed_ = swap;
// start measuring the time to display the caption
this.startPts_ = packet.pts;
break;
case ROLL_UP_2_ROWS:
this.topRow_ = BOTTOM_ROW - 1;
this.mode_ = 'rollUp';
break;
case ROLL_UP_3_ROWS:
this.topRow_ = BOTTOM_ROW - 2;
this.mode_ = 'rollUp';
break;
case ROLL_UP_4_ROWS:
this.topRow_ = BOTTOM_ROW - 3;
this.mode_ = 'rollUp';
break;
case CARRIAGE_RETURN:
this.flushDisplayed(packet.pts);
this.shiftRowsUp_();
this.startPts_ = packet.pts;
break;
case BACKSPACE:
if (this.mode_ === 'popOn') {
this.nonDisplayed_[BOTTOM_ROW] = this.nonDisplayed_[BOTTOM_ROW].slice(0, -1);
} else {
this.displayed_[BOTTOM_ROW] = this.displayed_[BOTTOM_ROW].slice(0, -1);
}
break;
case ERASE_DISPLAYED_MEMORY:
this.flushDisplayed(packet.pts);
this.displayed_ = createDisplayBuffer();
break;
case ERASE_NON_DISPLAYED_MEMORY:
this.nonDisplayed_ = createDisplayBuffer();
break;
default:
charCode = data >>> 8;
// ignore unsupported control codes
if ((charCode & 0xf0) === 0x10) {
return;
}
// character handling is dependent on the current mode
this[this.mode_](packet.pts, charCode, data & 0xff);
break;
}
};
};
Cea608Stream.prototype = new muxjs.utils.Stream();
// Trigger a cue point that captures the current state of the
// display buffer
Cea608Stream.prototype.flushDisplayed = function(pts) {
var row, i;
for (i = 0; i < this.displayed_.length; i++) {
row = this.displayed_[i];
if (row.length) {
this.trigger('data', {
startPts: this.startPts_,
endPts: pts,
text: row
});
}
}
};
// Mode Implementations
Cea608Stream.prototype.popOn = function(pts, char0, char1) {
var baseRow = this.nonDisplayed_[BOTTOM_ROW];
// buffer characters
char0 = BASIC_CHARACTER_TRANSLATION[char0] || char0;
baseRow += String.fromCharCode(char0);
char1 = BASIC_CHARACTER_TRANSLATION[char1] || char1;
baseRow += String.fromCharCode(char1);
this.nonDisplayed_[BOTTOM_ROW] = baseRow;
};
Cea608Stream.prototype.rollUp = function(pts, char0, char1) {
var baseRow = this.displayed_[BOTTOM_ROW];
if (baseRow === '') {
// we're starting to buffer new display input, so flush out the
// current display
this.flushDisplayed(pts);
this.startPts_ = pts;
}
char0 = BASIC_CHARACTER_TRANSLATION[char0] || char0;
baseRow += String.fromCharCode(char0);
char1 = BASIC_CHARACTER_TRANSLATION[char1] || char1;
baseRow += String.fromCharCode(char1);
this.displayed_[BOTTOM_ROW] = baseRow;
};
Cea608Stream.prototype.shiftRowsUp_ = function() {
var i;
// clear out inactive rows
for (i = 0; i < this.topRow_; i++) {
this.displayed_[i] = '';
}
// shift displayed rows up
for (i = this.topRow_; i < BOTTOM_ROW; i++) {
this.displayed_[i] = this.displayed_[i + 1];
}
// clear out the bottom row
this.displayed_[BOTTOM_ROW] = '';
};
// exports
muxjs.mp2t = muxjs.mp2t || {};
muxjs.mp2t.CaptionStream = CaptionStream;
muxjs.mp2t.Cea608Stream = Cea608Stream;
})(this, this.muxjs);
|
exports.up = function(knex, Promise) {
return knex.schema.table('teams', function(table) {
table.string('image_path');
});
};
exports.down = function(knex, Promise) {
return knex.schema.table('teams', function(table) {
table.dropColumn('image_path');
});
};
|
{"root":{"section":[{"title":["Nested data"],"data":[{"resources":[{"_":"/var/www/logs","$":{"type":"logs"}},{"_":"/var/www/errors","$":{"type":"errors"}}],"systems":[{"infrastructure":[{"data":["null"]}]}]}]},{"title":["Nested data"],"data":[{"resources":[{"_":"/var/www/logs","$":{"type":"logs"}},{"_":"/var/www/errors","$":{"type":"errors"}}],"systems":[{"infrastructure":[{"data":["null"]}]}]}]},{"title":["Nested data"],"data":[{"resources":[{"_":"/var/www/logs","$":{"type":"logs"}},{"_":"/var/www/errors","$":{"type":"errors"}}],"systems":[{"infrastructure":[{"data":["null"]}]}]}]},{"title":["Nested data"],"data":[{"resources":[{"_":"/var/www/logs","$":{"type":"logs"}},{"_":"/var/www/errors","$":{"type":"errors"}}],"systems":[{"infrastructure":[{"data":["null"]}]}]}]},{"title":["Nested data"],"data":[{"resources":[{"_":"/var/www/logs","$":{"type":"logs"}},{"_":"/var/www/errors","$":{"type":"errors"}}],"systems":[{"infrastructure":[{"data":["null"]}]}]}]}]}}
|
{
$(".bullet").click(function () {
if ($(this).next(".detail").is(":hidden")) {
$(this).next(".detail").toggle(750);
$(this).children('span').text('-');
} else {
$(this).next(".detail").toggle(750);
$(this).children('span').text('+');
}
});
}
|
/*
* Copyright (c) 2017. MIT-license for Jari Van Melckebeke
* Note that there was a lot of educational work in this project,
* this project was (or is) used for an assignment from Realdolmen in Belgium.
* Please just don't abuse my work
*/
//! moment.js locale configuration
//! locale : Morocco Central Atlas Tamaziɣt (tzm)
//! author : Abdel Said : https://github.com/abdelsaid
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['moment'], factory) :
factory(global.moment)
}(this, function (moment) { 'use strict';
var tzm = moment.defineLocale('tzm', {
months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
monthsShort : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
weekdays : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
weekdaysShort : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
weekdaysMin : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS: 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',
nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',
nextWeek: 'dddd [ⴴ] LT',
lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',
lastWeek: 'dddd [ⴴ] LT',
sameElse: 'L'
},
relativeTime : {
future : 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',
past : 'ⵢⴰⵏ %s',
s : 'ⵉⵎⵉⴽ',
m : 'ⵎⵉⵏⵓⴺ',
mm : '%d ⵎⵉⵏⵓⴺ',
h : 'ⵙⴰⵄⴰ',
hh : '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',
d : 'ⴰⵙⵙ',
dd : '%d oⵙⵙⴰⵏ',
M : 'ⴰⵢoⵓⵔ',
MM : '%d ⵉⵢⵢⵉⵔⵏ',
y : 'ⴰⵙⴳⴰⵙ',
yy : '%d ⵉⵙⴳⴰⵙⵏ'
},
week : {
dow : 6, // Saturday is the first day of the week.
doy : 12 // The week that contains Jan 1st is the first week of the year.
}
});
return tzm;
}));
|
/**
* Copyright 2015 Google Inc. All Rights Reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file or at
* https://github.com/firebase/superstatic/blob/master/LICENSE
*/
const path = require("path");
const fs = require("fs-extra");
const request = require("supertest");
const expect = require("chai").expect;
const stdMocks = require("std-mocks");
const server = require("../../src/server");
// NOTE: skipping these tests because of how
// supertest runs a connect server. The Superstatic
// server runs with a #listen() method, while the
// supertest runner uses the connect app object in
// a bare http.createServer() method. This
// doesn't work with how we are loading services.
describe.skip("server", () => {
beforeEach(() => {
fs.outputFileSync(".tmp/index.html", "index file content");
fs.outputFileSync(".tmp/.env.json", '{"key": "value"}');
});
afterEach(() => {
fs.removeSync(".tmp");
});
it("starts a server", (done) => {
const app = server();
request(app)
.get("/")
.end(done);
});
it("with config", (done) => {
const app = server({
config: {
public: ".tmp"
}
});
request(app)
.get("/")
.expect("index file content")
.end(done);
});
it("with port", (done) => {
const app = server({
port: 9876
});
const s = app.listen(() => {
expect(s.address().port).to.equal(9876);
s.close(done);
});
});
it("with hostname", (done) => {
const app = server({
hostname: "127.0.0.1"
});
const s = app.listen(() => {
expect(s.address().address).to.equal("127.0.0.1");
s.close(done);
});
});
it("with host", (done) => {
const app = server({
host: "127.0.0.1"
});
const s = app.listen(() => {
expect(s.address().address).to.equal("127.0.0.1");
s.close(done);
});
});
it("with debug", (done) => {
let output;
const app = server({
debug: true
});
stdMocks.use();
request(app)
.get("/")
.end(() => {
stdMocks.restore();
output = stdMocks.flush();
expect(
output.stdout.toString().indexOf('"GET / HTTP/1.1" 404')
).to.be.greaterThan(-1);
done();
});
});
it("with env filename", (done) => {
const app = server({
env: ".tmp/.env.json",
config: {
public: ".tmp"
}
});
request(app)
.get("/__/env.json")
.expect({
key: "value"
})
.end(done);
});
it("with env object", (done) => {
const app = server({
env: {
type: "object"
},
config: {
public: ".tmp"
}
});
request(app)
.get("/__/env.json")
.expect({
type: "object"
})
.end(done);
});
it("default error page", (done) => {
const notFoundContent = fs
.readFileSync(
path.resolve(__dirname, "../../templates/assets/not_found.html")
)
.toString();
const app = server();
request(app)
.get("/nope")
.expect(404)
.expect(notFoundContent)
.end(done);
});
it("overriden default error page", (done) => {
fs.outputFileSync(".tmp/error.html", "error page");
const app = server({
errorPage: ".tmp/error.html",
config: {
public: ".tmp"
}
});
request(app)
.get("/nope")
.expect(404)
.expect("error page")
.end(done);
});
});
|
module.exports = {
plugins: [
require('autoprefixer'),
],
};
|
/**
* @depends {nrs.js}
* @depends {nrs.modals.js}
*/
var NRS = (function(NRS, $, undefined) {
$("#nrs_modal").on("show.bs.modal", function(e) {
if (NRS.fetchingModalData) {
return;
}
NRS.fetchingModalData = true;
NRS.sendRequest("getState", function(state) {
for (var key in state) {
var el = $("#nrs_node_state_" + key);
if (el.length) {
if (key.indexOf("number") != -1) {
el.html(NRS.formatAmount(state[key]));
} else if (key.indexOf("Memory") != -1) {
el.html(NRS.formatVolume(state[key]));
} else if (key == "time") {
el.html(NRS.formatTimestamp(state[key]));
} else {
el.html(String(state[key]).escapeHTML());
}
}
}
$("#nrs_node_state_version").html(NRS.spnliteversion);
$("#nrs_update_explanation").show();
$("#nrs_modal_state").show();
NRS.fetchingModalData = false;
});
});
$("#nrs_modal").on("hide.bs.modal", function(e) {
$("body").off("dragover.nrs, drop.nrs");
$("#nrs_update_drop_zone, #nrs_update_result, #nrs_update_hashes, #nrs_update_hash_progress").hide();
$(this).find("ul.nav li.active").removeClass("active");
$("#nrs_modal_state_nav").addClass("active");
$(".nrs_modal_content").hide();
});
$("#nrs_modal ul.nav li").click(function(e) {
e.preventDefault();
var tab = $(this).data("tab");
$(this).siblings().removeClass("active");
$(this).addClass("active");
$(".nrs_modal_content").hide();
var content = $("#nrs_modal_" + tab);
content.show();
});
return NRS;
}(NRS || {}, jQuery));
|
{
"name": "dotsplit.js",
"url": "https://github.com/wilmoore/dotsplit.js.git"
}
|
/**
* Created by Peter on 2015. 7. 29..
*/
"use strict";
var winston = require('winston');
var config = require('../config/config');
require('winston-logentries');
//silly, debug, verbose, info, warn, error
var LogentriesToken;
if (config.mode === 'gather') {
LogentriesToken = config.logToken.gather;
}
else if (config.mode === 'service') {
LogentriesToken = config.logToken.service;
}
module.exports = function(filename) {
var transports = [];
transports.push(new winston.transports.Console({
level : 'info',
colorize : true
}));
transports.push(new winston.transports.Logentries({
level: 'info',
token: LogentriesToken
}));
if (filename) {
transports.push(new winston.transports.File({
level : 'error',
json : false,
filename : filename
}));
}
var logger = new winston.Logger({
levels: {
silly: 0,
input: 1,
verbose: 2,
prompt: 3,
debug: 4,
info: 5,
data: 6,
help: 7,
warn: 8,
error: 9
},
colors: {
silly: 'magenta',
input: 'grey',
verbose: 'cyan',
prompt: 'grey',
debug: 'blue',
info: 'green',
data: 'grey',
help: 'cyan',
warn: 'yellow',
error: 'red'
},
transports: transports
});
logger.exitOnError = false;
return logger;
};
|
const Koa = require('koa');
const helper = require('think-helper');
const pkg = require('../package.json');
const bluebird = require('bluebird');
const assert = require('assert');
const messenger = require('think-cluster').messenger;
/**
* use bluebird instead of default Promise
*/
global.Promise = bluebird;
/**
* global think object
* @type {Object}
*/
global.think = Object.create(helper);
/**
* Koa application instance
* @type {Koa}
*/
think.app = new Koa();
/**
* think.env
*/
Object.defineProperty(think, 'env', {
get() {
return think.app.env;
}
});
/**
* add think to think.app
*/
think.app.think = think;
/**
* thinkjs version
*/
think.version = pkg.version;
/**
* messenger
* @type {Object}
*/
think.messenger = messenger;
/**
* base controller class
*/
think.Controller = class Controller {
constructor(ctx) {
this.ctx = ctx;
}
};
/**
* base logic class
*/
think.Logic = class Logic extends think.Controller {};
/**
* service base class
*/
think.Service = class Service {};
/**
* get service
*/
think.service = (name, m, ...args) => {
let mcls = think.app.services;
if (think.app.modules.length) {
mcls = think.app.services[m || 'common'] || {};
} else {
args.unshift(m);
}
const Cls = mcls[name];
assert(Cls, `can not find service: ${name}`);
if (helper.isFunction(Cls)) return new Cls(...args);
return Cls;
};
// before start server
const promises = [];
think.beforeStartServer = fn => {
if (fn) {
assert(helper.isFunction(fn), 'fn in think.beforeStartServer must be a function');
return promises.push(fn());
}
const promise = Promise.all(promises);
const timeout = helper.ms(think.config('startServerTimeout'));
const timeoutPromise = helper.timeout(timeout).then(() => {
const err = new Error(`waiting for start server timeout, time: ${timeout}ms`);
return Promise.reject(err);
});
return Promise.race([promise, timeoutPromise]);
};
|
/*!
* Module dependencies.
*/
var util = require('util'),
super_ = require('../Type');
/**
* Code FieldType Constructor
* @extends Field
* @api public
*/
function code(list, path, options) {
this._nativeType = String;
this._defaultSize = 'full';
this.height = options.height || 180;
this.lang = options.lang;
this.mime = getMime(this.lang);
// TODO: implement initial form, usage disabled for now
if (options.initial) {
throw new Error('Invalid Configuration\n\n' +
'code fields (' + list.key + '.' + path + ') do not currently support being used as initial fields.\n');
}
code.super_.call(this, list, path, options);
}
/*!
* Inherit from Field
*/
util.inherits(code, super_);
/**
* Gets the mime type for the specified language
* @api private
*/
function getMime(lang) {
var mime;
switch (lang) {
case 'c':
mime = 'text/x-csrc'; break;
case 'c++':
case 'objetivec':
mime = 'text/x-c++src'; break;
case 'css':
mime = 'text/css'; break;
case 'asp':
mime = 'application/x-aspx'; break;
case 'c#':
mime = 'text/x-csharp'; break;
case 'vb':
mime = 'text/x-vb'; break;
case 'xml':
mime = 'text/xml'; break;
case 'php':
mime = 'application/x-httpd-php'; break;
case 'html':
mime = 'text/html'; break;
case 'ini':
mime = 'text/x-properties'; break;
case 'js':
mime = 'text/javascript'; break;
case 'java':
mime = 'text/x-java'; break;
case 'coffee':
mime = 'text/x-coffeescript'; break;
case 'lisp':
mime = 'text/x-common-lisp'; break;
case 'perl':
mime = 'text/x-perl'; break;
case 'python':
mime = 'text/x-python'; break;
case 'sql':
mime = 'text/x-sql'; break;
case 'json':
mime = 'application/json'; break;
case 'less':
mime = 'text/x-less'; break;
case 'sass':
mime = 'text/x-sass'; break;
case 'sh':
mime = 'text/x-sh'; break;
case 'ruby':
mime = 'text/x-ruby'; break;
case 'jsp':
mime = 'application/x-jsp'; break;
case 'tpl':
mime = 'text/x-smarty'; break;
case 'jade':
mime = 'text/x-jade'; break;
}
return mime;
}
/*!
* Export class
*/
exports = module.exports = code;
|
/**
* Copyright 2015 Telerik AD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(function(f, define){
define([], f);
})(function(){
(function( window, undefined ) {
var kendo = window.kendo || (window.kendo = { cultures: {} });
kendo.cultures["mt"] = {
name: "mt",
numberFormat: {
pattern: ["-n"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
percent: {
pattern: ["-n %","n %"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
symbol: "%"
},
currency: {
name: "",
abbr: "",
pattern: ["-$n","$n"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
symbol: "€"
}
},
calendars: {
standard: {
days: {
names: ["Il-Ħadd","It-Tnejn","It-Tlieta","L-Erbgħa","Il-Ħamis","Il-Ġimgħa","Is-Sibt"],
namesAbbr: ["Ħad","Tne","Tli","Erb","Ħam","Ġim","Sib"],
namesShort: ["Ħd","Tn","Tl","Er","Ħm","Ġi","Si"]
},
months: {
names: ["Jannar","Frar","Marzu","April","Mejju","Ġunju","Lulju","Awwissu","Settembru","Ottubru","Novembru","Diċembru"],
namesAbbr: ["Jan","Fra","Mar","Apr","Mej","Ġun","Lul","Aww","Set","Ott","Nov","Diċ"]
},
AM: ["AM","am","AM"],
PM: ["PM","pm","PM"],
patterns: {
d: "dd/MM/yyyy",
D: "dddd, d' ta\' 'MMMM yyyy",
F: "dddd, d' ta\' 'MMMM yyyy HH:mm:ss",
g: "dd/MM/yyyy HH:mm",
G: "dd/MM/yyyy HH:mm:ss",
m: "d' ta\' 'MMMM",
M: "d' ta\' 'MMMM",
s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
t: "HH:mm",
T: "HH:mm:ss",
u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
y: "MMMM yyyy",
Y: "MMMM yyyy"
},
"/": "/",
":": ":",
firstDay: 1
}
}
}
})(this);
return window.kendo;
}, typeof define == 'function' && define.amd ? define : function(_, f){ f(); });
|
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* Compute a random unit vector.
*
* Computes random values for the given vector between -1 and 1 that can be used to represent a direction.
*
* Optionally accepts a scale value to scale the resulting vector by.
*
* @function Phaser.Math.RandomXY
* @since 3.0.0
*
* @param {Phaser.Math.Vector2} vector - The Vector to compute random values for.
* @param {number} [scale=1] - The scale of the random values.
*
* @return {Phaser.Math.Vector2} The given Vector.
*/
var RandomXY = function (vector, scale)
{
if (scale === undefined) { scale = 1; }
var r = Math.random() * 2 * Math.PI;
vector.x = Math.cos(r) * scale;
vector.y = Math.sin(r) * scale;
return vector;
};
module.exports = RandomXY;
|
import { Backburner } from "backburner";
module("autorun");
test("autorun", function() {
var bb = new Backburner(['zomg']),
step = 0;
ok(!bb.currentInstance, "The DeferredActionQueues object is lazily instaniated");
equal(step++, 0);
bb.schedule('zomg', null, function() {
start();
equal(step, 2);
stop();
setTimeout(function() {
start();
ok(!bb.hasTimers(), "The all timers are cleared");
});
});
ok(bb.currentInstance, "The DeferredActionQueues object exists");
equal(step++, 1);
stop();
});
|
/**
* @fileoverview Rule to flag use of an empty block statement
* @author Alex Shnayder
*/
'use strict';
module.exports = function(context) {
return {
BlockStatement: function(node) {
var parent = node.parent,
parentType = parent.type;
// Not sure if there is a reason to allow empty finally blocks
// If ever find one, this will help:
// var isFinallyBlock = (parentType === 'TryStatement') && (parent.finalizer === node),
// // Parent.handlers is deprecated
// hasHandler = !!(parent.handler || (parent.handlers && parent.handlers.length));
// if (isFinallyBlock && !hasHandler) {
// return;
// }
// If the body is not empty, we can just return immediately
if (node.body.length !== 0) {
return;
}
// A function is generally allowed to be empty
if (['FunctionDeclaration', 'FunctionExpression', 'ArrowFunctionExpression'].indexOf(parentType) !== -1) {
return;
}
// If the `allowCatch` option is provided, allow empty catch blocks
if (context.options[0] === 'allowCatch' && parentType === 'CatchClause') {
return;
}
// Any other block is only allowed to be empty if it contains a comment
if (context.getComments(node).trailing.length > 0) {
return;
}
context.report(node, 'Empty block statement.');
},
SwitchStatement: function(node) {
if (typeof node.cases === 'undefined' || node.cases.length === 0) {
context.report(node, 'Empty switch statement.');
}
}
};
};
|
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const {randomFillSync} = require('crypto');
test('randomFillSync()', () => {
const buf = Buffer.alloc(10);
randomFillSync(buf);
});
|
$(document).ready(
function() {
$.ajax({
url : "/api/dashboard/keywords",
processData : false,
type : 'GET',
contentType : 'application/json',
success : function(response) {
for (var i = 0; i < response.length; i++) {
var keywordName = response[i].name;
generateKeywordDiv(keywordName, i);
var keywordRequest = {
"keyword" : keywordName,
"onlineMediaList" : [ "kompas.com", "detik.com",
"liputan6.com", "tribunnews.com",
"merdeka.com" ],
"lastPublishedDate" : "2014-12-01"
};
generateColumnBarChart(keywordRequest, i);
generatePieChart(keywordRequest, i);
generateLineChart(keywordRequest, i);
}
}
});
// generateKeywordDiv('Jokowi');
//
// // BEGIN Initial display
// var keywordRequest = {
// "keyword" : "Jokowi",
// "onlineMediaList" : [ "kompas.com", "detik.com",
// "liputan6.com", "tribunnews.com", "merdeka.com" ],
// "lastPublishedDate" : "2014-12-01"
// };
//
// generateColumnBarChart(keywordRequest);
// generatePieChart(keywordRequest);
// generateLineChart(keywordRequest);
// // END Initial display
$('#lastPublishedDateInput').datepicker({
format : "yyyy-mm-dd",
autoclose : true
});
});
function generateKeywordDiv(keywordName, i) {
$('#keywordHolder').append(
'<div class="panel panel-default">' + '<div class="panel-heading">'
+ '<div class="pull-left">' + '<h3 class="panel-title">'
+ '<i class="fa fa-key"></i> '
+ keywordName
+ '</h3>'
+ '</div>'
+ '<div class="clearfix"></div>'
+ '</div>'
+ '<!-- /.panel-heading -->'
+ '<div id="media-reach-body" class="panel-body">'
+ '<div class="row">'
+ '<div class="col-md-4">'
+ '<div id="chartAnalyticsMediaReach1'
+ i
+ '" style="margin: 0 auto"></div>'
+ '</div>'
+ '<div class="col-md-4">'
+ '<div id="chartAnalyticsMediaReach2'
+ i
+ '" style="margin: 0 auto"></div>'
+ '</div>'
+ '<div class="col-md-4">'
+ '<div id="chartAnalyticsBuzzTrends'
+ i
+ '" style="margin: 0 auto"></div>'
+ '</div>'
+ '</div>'
+ '</div>' + '<!-- /.panel-body -->' + '</div>');
}
function generateColumnBarChart(keywordRequest, i) {
var highChartSeriesList = null;
var keywordRequestJson = JSON.stringify(keywordRequest);
$.ajax({
url : "/api/mediareach/columnBar",
data : keywordRequestJson,
processData : false,
type : 'POST',
contentType : 'application/json',
success : function(highChartResponse) {
$('#chartAnalyticsMediaReach2' + i).highcharts({
chart : {
type : 'column'
},
title : {
text : 'Total mentions'
},
subtitle : {
text : 'by media types'
},
xAxis : {
categories : highChartResponse.categories
},
yAxis : {
min : 0,
title : {
text : ''
}
},
credits : {
enabled : false
},
series : highChartResponse.highChartSeriesList
});
}
});
}
function generatePieChart(keywordRequest, i) {
var highChartSeriesList = null;
var keywordRequestJson = JSON.stringify(keywordRequest);
$
.ajax({
url : "/api/mediareach/pie",
data : keywordRequestJson,
processData : false,
type : 'POST',
contentType : 'application/json',
success : function(highChartResponse) {
// $('#mentions-table > div').html('');
//
// var total = 0;
// for (var i = 0; i < highChartResponse.length; i++) {
//
// $('#mentions-table > div')
// .append(
// '<div>'
// + '<span class="btn btn-primary disabled">'
// + highChartResponse[i][0]
// + '</span>' + '<h4>'
// + highChartResponse[i][1]
// + '</h4>' + '</div>');
//
// total = total + highChartResponse[i][1];
//
// }
//
// $('#mentions-table > div')
// .append(
// '<div>'
// + '<span class="btn btn-primary disabled">Total</span>'
// + '<h4>' + total + '</h4><div>');
$('#chartAnalyticsMediaReach1' + i)
.highcharts(
{
chart : {
plotBackgroundColor : null,
plotBorderWidth : null,
plotShadow : false
},
title : {
text : "Media's shares"
},
subtitle : {
text : 'of the total mentions'
},
tooltip : {
pointFormat : '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions : {
pie : {
allowPointSelect : true,
cursor : 'pointer',
dataLabels : {
enabled : false
},
showInLegend : true
}
},
credits : {
enabled : false
},
series : [ {
type : 'pie',
name : 'Browser share',
data : highChartResponse
} ]
});
} // success : function(highChartResponse) {
}); // $.ajax({
}
function generateLineChart(keywordRequest, i) {
var highChartSeriesList = null;
var keywordRequestJson = JSON.stringify(keywordRequest);
$.ajax({
url : "/api/buzztrends/line",
data : keywordRequestJson,
processData : false,
type : 'POST',
contentType : 'application/json',
success : function(highChartResponse) {
$('#chartAnalyticsBuzzTrends' + i).highcharts({
title : {
text : 'The trends of total mentions',
x : -20
},
subtitle : {
text : 'by media types',
x : -20
},
xAxis : {
categories : highChartResponse.categories
},
plotOptions : {
line : {
marker : {
enabled : false
}
}
},
yAxis : {
min : 0,
title : {
text : ''
}
},
credits : {
enabled : false
},
series : highChartResponse.highChartSeriesList
});
}
});
}
function buildKeywordRequest() {
var jsonArr = [];
var keywordRequest = {};
keywordRequest.keyword = $('#keywordInput').val();
$('#formOnlineMedia input:checkbox:checked').each(function(key, value) {
var onlineMediaName = $(this).attr('id');
onlineMediaName = onlineMediaName.substring(3, onlineMediaName.length);
jsonArr.push(onlineMediaName);
});
keywordRequest.onlineMediaList = jsonArr;
keywordRequest.lastPublishedDate = $('#lastPublishedDateInput').val();
return keywordRequest;
}
|
/**
* Copyright 2013-2014 Facebook, Inc.
*
* 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.
*
* @providesModule ReactMultiChild
* @typechecks static-only
*/
"use strict";
var ReactComponent = require('ReactComponent');
var ReactMultiChildUpdateTypes = require('ReactMultiChildUpdateTypes');
var flattenChildren = require('flattenChildren');
var shouldUpdateReactComponent = require('shouldUpdateReactComponent');
/**
* Updating children of a component may trigger recursive updates. The depth is
* used to batch recursive updates to render markup more efficiently.
*
* @type {number}
* @private
*/
var updateDepth = 0;
/**
* Queue of update configuration objects.
*
* Each object has a `type` property that is in `ReactMultiChildUpdateTypes`.
*
* @type {array<object>}
* @private
*/
var updateQueue = [];
/**
* Queue of markup to be rendered.
*
* @type {array<string>}
* @private
*/
var markupQueue = [];
/**
* Enqueues markup to be rendered and inserted at a supplied index.
*
* @param {string} parentID ID of the parent component.
* @param {string} markup Markup that renders into an element.
* @param {number} toIndex Destination index.
* @private
*/
function enqueueMarkup(parentID, markup, toIndex) {
// NOTE: Null values reduce hidden classes.
updateQueue.push({
parentID: parentID,
parentNode: null,
type: ReactMultiChildUpdateTypes.INSERT_MARKUP,
markupIndex: markupQueue.push(markup) - 1,
textContent: null,
fromIndex: null,
toIndex: toIndex
});
}
/**
* Enqueues moving an existing element to another index.
*
* @param {string} parentID ID of the parent component.
* @param {number} fromIndex Source index of the existing element.
* @param {number} toIndex Destination index of the element.
* @private
*/
function enqueueMove(parentID, fromIndex, toIndex) {
// NOTE: Null values reduce hidden classes.
updateQueue.push({
parentID: parentID,
parentNode: null,
type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
markupIndex: null,
textContent: null,
fromIndex: fromIndex,
toIndex: toIndex
});
}
/**
* Enqueues removing an element at an index.
*
* @param {string} parentID ID of the parent component.
* @param {number} fromIndex Index of the element to remove.
* @private
*/
function enqueueRemove(parentID, fromIndex) {
// NOTE: Null values reduce hidden classes.
updateQueue.push({
parentID: parentID,
parentNode: null,
type: ReactMultiChildUpdateTypes.REMOVE_NODE,
markupIndex: null,
textContent: null,
fromIndex: fromIndex,
toIndex: null
});
}
/**
* Enqueues setting the text content.
*
* @param {string} parentID ID of the parent component.
* @param {string} textContent Text content to set.
* @private
*/
function enqueueTextContent(parentID, textContent) {
// NOTE: Null values reduce hidden classes.
updateQueue.push({
parentID: parentID,
parentNode: null,
type: ReactMultiChildUpdateTypes.TEXT_CONTENT,
markupIndex: null,
textContent: textContent,
fromIndex: null,
toIndex: null
});
}
/**
* Processes any enqueued updates.
*
* @private
*/
function processQueue() {
if (updateQueue.length) {
ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(
updateQueue,
markupQueue
);
clearQueue();
}
}
/**
* Clears any enqueued updates.
*
* @private
*/
function clearQueue() {
updateQueue.length = 0;
markupQueue.length = 0;
}
/**
* ReactMultiChild are capable of reconciling multiple children.
*
* @class ReactMultiChild
* @internal
*/
var ReactMultiChild = {
/**
* Provides common functionality for components that must reconcile multiple
* children. This is used by `ReactDOMComponent` to mount, update, and
* unmount child components.
*
* @lends {ReactMultiChild.prototype}
*/
Mixin: {
/**
* Generates a "mount image" for each of the supplied children. In the case
* of `ReactDOMComponent`, a mount image is a string of markup.
*
* @param {?object} nestedChildren Nested child maps.
* @return {array} An array of mounted representations.
* @internal
*/
mountChildren: function(nestedChildren, transaction) {
var children = flattenChildren(nestedChildren);
var mountImages = [];
var index = 0;
this._renderedChildren = children;
for (var name in children) {
var child = children[name];
if (children.hasOwnProperty(name)) {
// Inlined for performance, see `ReactInstanceHandles.createReactID`.
var rootID = this._rootNodeID + name;
var mountImage = child.mountComponent(
rootID,
transaction,
this._mountDepth + 1
);
child._mountIndex = index;
mountImages.push(mountImage);
index++;
}
}
return mountImages;
},
/**
* Replaces any rendered children with a text content string.
*
* @param {string} nextContent String of content.
* @internal
*/
updateTextContent: function(nextContent) {
updateDepth++;
var errorThrown = true;
try {
var prevChildren = this._renderedChildren;
// Remove any rendered children.
for (var name in prevChildren) {
if (prevChildren.hasOwnProperty(name)) {
this._unmountChildByName(prevChildren[name], name);
}
}
// Set new text content.
this.setTextContent(nextContent);
errorThrown = false;
} finally {
updateDepth--;
if (!updateDepth) {
errorThrown ? clearQueue() : processQueue();
}
}
},
/**
* Updates the rendered children with new children.
*
* @param {?object} nextNestedChildren Nested child maps.
* @param {ReactReconcileTransaction} transaction
* @internal
*/
updateChildren: function(nextNestedChildren, transaction) {
updateDepth++;
var errorThrown = true;
try {
this._updateChildren(nextNestedChildren, transaction);
errorThrown = false;
} finally {
updateDepth--;
if (!updateDepth) {
errorThrown ? clearQueue() : processQueue();
}
}
},
/**
* Improve performance by isolating this hot code path from the try/catch
* block in `updateChildren`.
*
* @param {?object} nextNestedChildren Nested child maps.
* @param {ReactReconcileTransaction} transaction
* @final
* @protected
*/
_updateChildren: function(nextNestedChildren, transaction) {
var nextChildren = flattenChildren(nextNestedChildren);
var prevChildren = this._renderedChildren;
if (!nextChildren && !prevChildren) {
return;
}
var name;
// `nextIndex` will increment for each child in `nextChildren`, but
// `lastIndex` will be the last index visited in `prevChildren`.
var lastIndex = 0;
var nextIndex = 0;
for (name in nextChildren) {
if (!nextChildren.hasOwnProperty(name)) {
continue;
}
var prevChild = prevChildren && prevChildren[name];
var nextChild = nextChildren[name];
if (shouldUpdateReactComponent(prevChild, nextChild)) {
this.moveChild(prevChild, nextIndex, lastIndex);
lastIndex = Math.max(prevChild._mountIndex, lastIndex);
prevChild.receiveComponent(nextChild, transaction);
prevChild._mountIndex = nextIndex;
} else {
if (prevChild) {
// Update `lastIndex` before `_mountIndex` gets unset by unmounting.
lastIndex = Math.max(prevChild._mountIndex, lastIndex);
this._unmountChildByName(prevChild, name);
}
this._mountChildByNameAtIndex(
nextChild, name, nextIndex, transaction
);
}
nextIndex++;
}
// Remove children that are no longer present.
for (name in prevChildren) {
if (prevChildren.hasOwnProperty(name) &&
!(nextChildren && nextChildren[name])) {
this._unmountChildByName(prevChildren[name], name);
}
}
},
/**
* Unmounts all rendered children. This should be used to clean up children
* when this component is unmounted.
*
* @internal
*/
unmountChildren: function() {
var renderedChildren = this._renderedChildren;
for (var name in renderedChildren) {
var renderedChild = renderedChildren[name];
// TODO: When is this not true?
if (renderedChild.unmountComponent) {
renderedChild.unmountComponent();
}
}
this._renderedChildren = null;
},
/**
* Moves a child component to the supplied index.
*
* @param {ReactComponent} child Component to move.
* @param {number} toIndex Destination index of the element.
* @param {number} lastIndex Last index visited of the siblings of `child`.
* @protected
*/
moveChild: function(child, toIndex, lastIndex) {
// If the index of `child` is less than `lastIndex`, then it needs to
// be moved. Otherwise, we do not need to move it because a child will be
// inserted or moved before `child`.
if (child._mountIndex < lastIndex) {
enqueueMove(this._rootNodeID, child._mountIndex, toIndex);
}
},
/**
* Creates a child component.
*
* @param {ReactComponent} child Component to create.
* @param {string} mountImage Markup to insert.
* @protected
*/
createChild: function(child, mountImage) {
enqueueMarkup(this._rootNodeID, mountImage, child._mountIndex);
},
/**
* Removes a child component.
*
* @param {ReactComponent} child Child to remove.
* @protected
*/
removeChild: function(child) {
enqueueRemove(this._rootNodeID, child._mountIndex);
},
/**
* Sets this text content string.
*
* @param {string} textContent Text content to set.
* @protected
*/
setTextContent: function(textContent) {
enqueueTextContent(this._rootNodeID, textContent);
},
/**
* Mounts a child with the supplied name.
*
* NOTE: This is part of `updateChildren` and is here for readability.
*
* @param {ReactComponent} child Component to mount.
* @param {string} name Name of the child.
* @param {number} index Index at which to insert the child.
* @param {ReactReconcileTransaction} transaction
* @private
*/
_mountChildByNameAtIndex: function(child, name, index, transaction) {
// Inlined for performance, see `ReactInstanceHandles.createReactID`.
var rootID = this._rootNodeID + name;
var mountImage = child.mountComponent(
rootID,
transaction,
this._mountDepth + 1
);
child._mountIndex = index;
this.createChild(child, mountImage);
this._renderedChildren = this._renderedChildren || {};
this._renderedChildren[name] = child;
},
/**
* Unmounts a rendered child by name.
*
* NOTE: This is part of `updateChildren` and is here for readability.
*
* @param {ReactComponent} child Component to unmount.
* @param {string} name Name of the child in `this._renderedChildren`.
* @private
*/
_unmountChildByName: function(child, name) {
// TODO: When is this not true?
if (ReactComponent.isValidComponent(child)) {
this.removeChild(child);
child._mountIndex = null;
child.unmountComponent();
delete this._renderedChildren[name];
}
}
}
};
module.exports = ReactMultiChild;
|
module.exports = require("npm:asn1.js@4.9.1/lib/asn1.js");
|
$A.bind(window, 'load', function(){
// Set the A tag ARIA Toggle Button
var standardA = new $A.Toggle('a1',
{
// Set the initial state
state: false,
// Declare a callback to run every time the state changes
callback: function(state){
// 'this' is the triggering element
if (state)
$A.addClass(this, 'pressed');
else
$A.remClass(this, 'pressed');
$A.getEl('a1mirror').checked = state ? 'checked' : false;
// Return true to accept the ARIA state change, or false to prevent
return true;
}
});
$A.bind('#a1mirror', 'change', function(ev){
// Manually set the A tag ARIA Toggle Button to match the new value
standardA.set(this.checked);
});
// Set the standard DIV tag ARIA Toggle Button
var divBtn = new $A.Toggle('div1',
{
state: false,
callback: function(state){
if (state)
$A.addClass(this, 'pressed');
else
$A.remClass(this, 'pressed');
$A.getEl('div1mirror').checked = state ? 'checked' : false;
// Return true to accept the ARIA state change, or false to prevent
return true;
}
});
$A.bind('#div1mirror', 'change', function(ev){
divBtn.set(this.checked);
});
// Set the SPAN tag ARIA Toggle Button
var spanBtn = new $A.Toggle('span1',
{
state: false,
callback: function(state){
if (state)
$A.addClass(this, 'pressed');
else
$A.remClass(this, 'pressed');
$A.getEl('span1mirror').checked = state ? 'checked' : false;
// Return true to accept the ARIA state change, or false to prevent
return true;
}
});
$A.bind('#span1mirror', 'change', function(ev){
spanBtn.set(this.checked);
});
// Set the HelpIcon IMG ARIA Toggle Button
var helpIcon = new $A.Toggle('helpIcon',
{
state: true,
callback: function(state){
if (state){
$A.addClass(this, 'pressed');
$A.remClass($A.getEl('helpSect1'), 'hidden');
}
else{
$A.remClass(this, 'pressed');
$A.addClass($A.getEl('helpSect1'), 'hidden');
}
return true;
}
});
});
|
(function(addon) {
var component;
if (window.UIkit) {
component = addon(UIkit);
}
if (typeof define == "function" && define.amd) {
define("uikit-tooltip", ["uikit"], function(){
return component || addon(UIkit);
});
}
})(function(UI){
"use strict";
var $tooltip, // tooltip container
tooltipdelay, checkdelay;
UI.component('tooltip', {
defaults: {
offset: 5,
pos: 'top',
animation: false,
delay: 0, // in miliseconds
cls: "",
activeClass: "uk-active",
src: function(ele) {
var title = ele.attr('title');
if (title !== undefined) {
ele.data('cached-title', title).removeAttr('title');
}
return ele.data("cached-title");
}
},
tip: "",
boot: function() {
// init code
UI.$html.on("mouseenter.tooltip.uikit focus.tooltip.uikit", "[data-uk-tooltip]", function(e) {
var ele = UI.$(this);
if (!ele.data("tooltip")) {
UI.tooltip(ele, UI.Utils.options(ele.attr("data-uk-tooltip")));
ele.trigger("mouseenter");
}
});
},
init: function() {
var $this = this;
if (!$tooltip) {
$tooltip = UI.$('<div class="uk-tooltip"></div>').appendTo("body");
}
this.on({
focus : function(e) { $this.show(); },
blur : function(e) { $this.hide(); },
mouseenter : function(e) { $this.show(); },
mouseleave : function(e) { $this.hide(); }
});
},
show: function() {
this.tip = typeof(this.options.src) === "function" ? this.options.src(this.element) : this.options.src;
if (tooltipdelay) clearTimeout(tooltipdelay);
if (checkdelay) clearTimeout(checkdelay);
if (typeof(this.tip) === 'string' ? !this.tip.length:true) return;
$tooltip.stop().css({"top": -2000, "visibility": "hidden"}).removeClass(this.options.activeClass).show();
$tooltip.html('<div class="uk-tooltip-inner">' + this.tip + '</div>');
var $this = this,
pos = UI.$.extend({}, this.element.offset(), {width: this.element[0].offsetWidth, height: this.element[0].offsetHeight}),
width = $tooltip[0].offsetWidth,
height = $tooltip[0].offsetHeight,
offset = typeof(this.options.offset) === "function" ? this.options.offset.call(this.element) : this.options.offset,
position = typeof(this.options.pos) === "function" ? this.options.pos.call(this.element) : this.options.pos,
tmppos = position.split("-"),
tcss = {
"display" : "none",
"visibility" : "visible",
"top" : (pos.top + pos.height + height),
"left" : pos.left
};
// prevent strange position
// when tooltip is in offcanvas etc.
if (UI.$html.css('position')=='fixed' || UI.$body.css('position')=='fixed'){
var bodyoffset = UI.$('body').offset(),
htmloffset = UI.$('html').offset(),
docoffset = {'top': (htmloffset.top + bodyoffset.top), 'left': (htmloffset.left + bodyoffset.left)};
pos.left -= docoffset.left;
pos.top -= docoffset.top;
}
if ((tmppos[0] == "left" || tmppos[0] == "right") && UI.langdirection == 'right') {
tmppos[0] = tmppos[0] == "left" ? "right" : "left";
}
var variants = {
"bottom" : {top: pos.top + pos.height + offset, left: pos.left + pos.width / 2 - width / 2},
"top" : {top: pos.top - height - offset, left: pos.left + pos.width / 2 - width / 2},
"left" : {top: pos.top + pos.height / 2 - height / 2, left: pos.left - width - offset},
"right" : {top: pos.top + pos.height / 2 - height / 2, left: pos.left + pos.width + offset}
};
UI.$.extend(tcss, variants[tmppos[0]]);
if (tmppos.length == 2) tcss.left = (tmppos[1] == 'left') ? (pos.left) : ((pos.left + pos.width) - width);
var boundary = this.checkBoundary(tcss.left, tcss.top, width, height);
if(boundary) {
switch(boundary) {
case "x":
if (tmppos.length == 2) {
position = tmppos[0]+"-"+(tcss.left < 0 ? "left": "right");
} else {
position = tcss.left < 0 ? "right": "left";
}
break;
case "y":
if (tmppos.length == 2) {
position = (tcss.top < 0 ? "bottom": "top")+"-"+tmppos[1];
} else {
position = (tcss.top < 0 ? "bottom": "top");
}
break;
case "xy":
if (tmppos.length == 2) {
position = (tcss.top < 0 ? "bottom": "top")+"-"+(tcss.left < 0 ? "left": "right");
} else {
position = tcss.left < 0 ? "right": "left";
}
break;
}
tmppos = position.split("-");
UI.$.extend(tcss, variants[tmppos[0]]);
if (tmppos.length == 2) tcss.left = (tmppos[1] == 'left') ? (pos.left) : ((pos.left + pos.width) - width);
}
tcss.left -= UI.$body.position().left;
tooltipdelay = setTimeout(function(){
$tooltip.css(tcss).attr("class", ["uk-tooltip", "uk-tooltip-"+position, $this.options.cls].join(' '));
if ($this.options.animation) {
$tooltip.css({opacity: 0, display: 'block'}).addClass($this.options.activeClass).animate({opacity: 1}, parseInt($this.options.animation, 10) || 400);
} else {
$tooltip.show().addClass($this.options.activeClass);
}
tooltipdelay = false;
// close tooltip if element was removed or hidden
checkdelay = setInterval(function(){
if(!$this.element.is(':visible')) $this.hide();
}, 150);
}, parseInt(this.options.delay, 10) || 0);
},
hide: function() {
if(this.element.is("input") && this.element[0]===document.activeElement) return;
if(tooltipdelay) clearTimeout(tooltipdelay);
if (checkdelay) clearTimeout(checkdelay);
$tooltip.stop();
if (this.options.animation) {
var $this = this;
$tooltip.fadeOut(parseInt(this.options.animation, 10) || 400, function(){
$tooltip.removeClass($this.options.activeClass)
});
} else {
$tooltip.hide().removeClass(this.options.activeClass);
}
},
content: function() {
return this.tip;
},
checkBoundary: function(left, top, width, height) {
var axis = "";
if(left < 0 || ((left - UI.$win.scrollLeft())+width) > window.innerWidth) {
axis += "x";
}
if(top < 0 || ((top - UI.$win.scrollTop())+height) > window.innerHeight) {
axis += "y";
}
return axis;
}
});
return UI.tooltip;
});
|
require('jquery-slimscroll');
//# sourceMappingURL=baSlimScroll.loader.js.map
|
/**
* Add an item to the database.
* This controller works in conjunction with the 'edit' view.
*/
define(['app'], function(app) {
app.controller('AddCtrl', ['$scope', '$routeParams', 'database', 'inputDateHandler',
function AddCtrl($scope, $routeParams, database, inputDates) {
$scope.mode = 'new';
$scope.title = 'New';
$scope.item = {
title: null,
description: null,
dateValue: inputDates.format(new Date())
};
$scope.save = function() {
$scope.item.date = inputDates.parse($scope.item.dateValue);
var obj = database.addItem($scope.item);
console.log("Added", obj.id, "to database");
$scope.go('/', 'popdown');
};
}
]);
});
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.