conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
export const createResource = (resource, {
onSuccess: onSuccess = noop,
onError: onError = noop
} = {}) => {
if (onSuccess !== noop || onError !== noop) {
console.warn('onSuccess/onError callbacks are deprecated. Please use returned promise: https://github.com/dixieio/redux-json-api/issues/17');
}
=======
export const uploadFile = (file, {
companyId,
fileableType: fileableType = null,
fileableId: fileableId = null
}, {
onSuccess: onSuccess = noop,
onError: onError = noop
} = {}) => {
console.warn('uploadFile has been deprecated and will no longer be supported by redux-json-api https://github.com/dixieio/redux-json-api/issues/2');
return (dispatch, getState) => {
const accessToken = getState().api.endpoint.accessToken;
const path = [companyId, fileableType, fileableId].filter(o => !!o).join('/');
const url = `${__API_HOST__}/upload/${path}?access_token=${accessToken}`;
const data = new FormData;
data.append('file', file);
const options = {
method: 'POST',
body: data
};
return fetch(url, options)
.then(res => {
if (res.status >= 200 && res.status < 300) {
if (jsonContentTypes.some(contentType => res.headers.get('Content-Type').indexOf(contentType) > -1)) {
return res.json();
}
return res;
}
const e = new Error(res.statusText);
e.response = res;
throw e;
})
.then(json => {
onSuccess(json);
})
.catch(error => {
onError(error);
});
};
};
export const createResource = (resource) => {
>>>>>>>
export const createResource = (resource) => { |
<<<<<<<
this.state = { domain: props.initialDomain || this.domain };
=======
this.state = { domain: this.getDataDomain() };
>>>>>>>
this.state = { domain: props.initialDomain || this.getDataDomain() };
<<<<<<<
const nextXDomain = ZoomHelpers.pan(this.lastDomain.x, this.domain.x, calculatedDx);
this.setDomain({x: nextXDomain});
=======
const nextXDomain = ZoomHelpers.pan(this.lastDomain.x, domain.x, calculatedDx);
this.setState({domain: {x: nextXDomain}});
>>>>>>>
const nextXDomain = ZoomHelpers.pan(this.lastDomain.x, domain.x, calculatedDx);
this.setDomain({x: nextXDomain});
this.setState({domain: {x: nextXDomain}}); |
<<<<<<<
import {VictoryBar, VictoryChart, VictoryGroup, VictoryStack, VictoryEvents} from "../../src/index";
import { random, range } from "lodash";
=======
import { assign, random, range } from "lodash";
import {VictoryBar, VictoryChart, VictoryGroup, VictoryStack} from "../../src/index";
>>>>>>>
import {VictoryBar, VictoryChart, VictoryGroup, VictoryStack, VictoryEvents} from "../../src/index";
import { assign, random, range } from "lodash"; |
<<<<<<<
import { PropTypes as CustomPropTypes, Helpers, Style, Log } from "../victory-util/index";
import { default as VictoryPortal } from "../victory-portal/victory-portal";
=======
import CustomPropTypes from "../victory-util/prop-types";
import Helpers from "../victory-util/helpers";
import Style from "../victory-util/style";
import Log from "../victory-util/log";
>>>>>>>
import VictoryPortal from "../victory-portal/victory-portal";
import CustomPropTypes from "../victory-util/prop-types";
import Helpers from "../victory-util/helpers";
import Style from "../victory-util/style";
import Log from "../victory-util/log"; |
<<<<<<<
const container = modifiedProps.standalone && this.getContainer(modifiedProps, calculatedProps);
let newChildren = this.getNewChildren(modifiedProps, childComponents, calculatedProps);
if (this.props.modifyChildren) {
newChildren = this.props.modifyChildren(newChildren, modifiedProps);
}
if (modifiedProps.events) {
=======
const newChildren = this.getNewChildren(modifiedProps, childComponents, calculatedProps);
const group = this.renderGroup(newChildren, calculatedProps.style.parent);
const container = standalone ? this.getContainer(modifiedProps, calculatedProps) : group;
if (events) {
>>>>>>>
let newChildren = this.getNewChildren(modifiedProps, childComponents, calculatedProps);
if (this.props.modifyChildren) {
newChildren = this.props.modifyChildren(newChildren, modifiedProps);
}
const group = this.renderGroup(newChildren, calculatedProps.style.parent);
const container = standalone ? this.getContainer(modifiedProps, calculatedProps) : group;
if (events) { |
<<<<<<<
import omit from "lodash/omit";
import range from "lodash/range";
import SvgTestHelper from "../../../../svg-test-helper";
=======
import { omit, range } from "lodash";
>>>>>>>
import { omit, range } from "lodash";
import SvgTestHelper from "../../../../svg-test-helper"; |
<<<<<<<
const min = Collection.containsDates(domain) ?
Helpers.retainDate(Math.min(...domain, 0)) :
Math.min(...domain, 0);
const max = Collection.containsDates(domain) ?
Helpers.retainDate(Math.max(...domain, 0)) :
Math.max(...domain, 0);
return isDependent ? [min, max] : domain;
=======
const zeroDomain = isDependent ? [Math.min(...domain, 0), Math.max(... domain, 0)]
: domain;
return this.padDomain(zeroDomain, props, axis);
>>>>>>>
const min = Collection.containsDates(domain) ?
Helpers.retainDate(Math.min(...domain, 0)) :
Math.min(...domain, 0);
const max = Collection.containsDates(domain) ?
Helpers.retainDate(Math.max(...domain, 0)) :
Math.max(...domain, 0);
const zeroDomain = isDependent ? [min, max] : domain;
return this.padDomain(zeroDomain, props, axis);
<<<<<<<
const domainMin = Collection.containsDates(domain) ?
Helpers.retainDate(Math.min(...domain)) :
Math.min(...domain);
const domainMax = Collection.containsDates(domain) ?
Helpers.retainDate(Math.max(...domain)) :
Math.max(...domain);
=======
const domainMin = Math.min(...domain);
const domainMax = Math.max(...domain);
>>>>>>>
const domainMin = Collection.containsDates(domain) ?
Helpers.retainDate(Math.min(...domain)) :
Math.min(...domain);
const domainMax = Collection.containsDates(domain) ?
Helpers.retainDate(Math.max(...domain)) :
Math.max(...domain); |
<<<<<<<
const { dataComponent, labelComponent, groupComponent } = props;
=======
const { role } = VictoryBar;
const { dataComponent, labelComponent } = props;
>>>>>>>
const { dataComponent, labelComponent, groupComponent } = props;
const { role } = VictoryBar; |
<<<<<<<
import { sortBy, defaults } from "lodash";
=======
import { defaults, last } from "lodash";
>>>>>>>
import { defaults } from "lodash";
<<<<<<<
=======
const dataSegments = this.getDataSegments(dataset);
>>>>>>>
<<<<<<<
=======
},
getDataSegments(dataset) {
const segments = [];
let segmentStartIndex = 0;
let segmentIndex = 0;
for (let index = 0, len = dataset.length; index < len; index++) {
const datum = dataset[index];
if (datum._y === null || typeof datum._y === "undefined") {
segments[segmentIndex] = dataset.slice(segmentStartIndex, index);
segmentIndex++;
segmentStartIndex = index + 1;
}
}
segments[segmentIndex] = dataset.slice(segmentStartIndex, dataset.length);
return segments.filter((segment) => {
return Array.isArray(segment) && segment.length > 0;
});
>>>>>>> |
<<<<<<<
import PolarDemo from "./components/victory-polar-chart-demo";
=======
import DebugDemo from "./components/debug-demo";
>>>>>>>
import PolarDemo from "./components/victory-polar-chart-demo";
import DebugDemo from "./components/debug-demo";
<<<<<<<
case "/polar": Child = PolarDemo; break;
=======
case "/debug": Child = DebugDemo; break;
>>>>>>>
case "/polar": Child = PolarDemo; break;
case "/debug": Child = DebugDemo; break; |
<<<<<<<
const { horizontal, polar, startAngle, endAngle } = props;
const minDomain = this.getMinFromProps(props, axis);
const maxDomain = this.getMaxFromProps(props, axis);
const currentAxis = Helpers.getCurrentAxis(axis, horizontal);
if (dataset.length < 1) {
const scaleDomain = Scale.getBaseScale(props, axis).domain();
const min = minDomain !== undefined ? minDomain : Collection.getMinValue(scaleDomain);
const max = maxDomain !== undefined ? maxDomain : Collection.getMaxValue(scaleDomain);
return this.getDomainFromMinMax(min, max);
=======
const { polar, horizontal, startAngle = 0, endAngle = 360 } = props;
const currentAxis = Helpers.getCurrentAxis(axis, horizontal);
const flatData = flatten(dataset);
const allData = flatData.map((datum) => {
return datum[`_${currentAxis}1`] === undefined ?
datum[`_${currentAxis}`] : datum[`_${currentAxis}1`];
});
const allMinData = flatData.map((datum) => {
return datum[`_${currentAxis}0`] === undefined ?
datum[`_${currentAxis}`] : datum[`_${currentAxis}0`];
});
if (allData.length < 1) {
return Scale.getBaseScale(props, axis).domain();
>>>>>>>
const { horizontal, polar, startAngle = 0, endAngle = 360 } = props;
const minDomain = this.getMinFromProps(props, axis);
const maxDomain = this.getMaxFromProps(props, axis);
const currentAxis = Helpers.getCurrentAxis(axis, horizontal);
if (dataset.length < 1) {
const scaleDomain = Scale.getBaseScale(props, axis).domain();
const min = minDomain !== undefined ? minDomain : Collection.getMinValue(scaleDomain);
const max = maxDomain !== undefined ? maxDomain : Collection.getMaxValue(scaleDomain);
return this.getDomainFromMinMax(min, max);
<<<<<<<
const angularRange = Math.abs((startAngle || 0) - (endAngle || 360));
return polar && axis === "x" && angularRange === 360 ?
this.getSymmetricDomain(domain, this.getFlatData(dataset, currentAxis)) : domain;
=======
const min = Collection.getMinValue(allMinData);
const max = Collection.getMaxValue(allData);
let domain;
if (+min === +max) {
domain = this.getSinglePointDomain(max);
} else {
domain = [min, max];
}
return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ?
this.getSymmetricDomain(domain, allData) : domain;
>>>>>>>
return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ?
this.getSymmetricDomain(domain, this.getFlatData(dataset, currentAxis)) : domain;
<<<<<<<
const { tickValues, polar } = props;
const minDomain = this.getMinFromProps(props, axis);
const maxDomain = this.getMaxFromProps(props, axis);
const stringTicks = Helpers.stringTicks(props);
const ticks = tickValues.map((value) => +value);
const defaultMin = stringTicks ? 1 : Collection.getMinValue(ticks);
const defaultMax = stringTicks ? tickValues.length : Collection.getMaxValue(ticks);
const min = minDomain !== undefined ? minDomain : defaultMin;
const max = maxDomain !== undefined ? maxDomain : defaultMax;
const initialDomain = this.getDomainFromMinMax(min, max);
const domain = polar && axis === "x" && !stringTicks ?
this.getSymmetricDomain(initialDomain, ticks) : initialDomain;
=======
const { polar, tickValues, startAngle = 0, endAngle = 360 } = props;
let domain;
if (Helpers.stringTicks(props)) {
domain = [1, tickValues.length];
} else {
// coerce ticks to numbers
const ticks = tickValues.map((value) => +value);
const initialDomain = [Collection.getMinValue(ticks), Collection.getMaxValue(ticks)];
domain = polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ?
this.getSymmetricDomain(initialDomain, ticks) : initialDomain;
}
>>>>>>>
const { tickValues, polar, startAngle = 0, endAngle = 360 } = props;
const minDomain = this.getMinFromProps(props, axis);
const maxDomain = this.getMaxFromProps(props, axis);
const stringTicks = Helpers.stringTicks(props);
const ticks = tickValues.map((value) => +value);
const defaultMin = stringTicks ? 1 : Collection.getMinValue(ticks);
const defaultMax = stringTicks ? tickValues.length : Collection.getMaxValue(ticks);
const min = minDomain !== undefined ? minDomain : defaultMin;
const max = maxDomain !== undefined ? maxDomain : defaultMax;
const initialDomain = this.getDomainFromMinMax(min, max);
const domain = polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ?
this.getSymmetricDomain(initialDomain, ticks) : initialDomain;
<<<<<<<
getDomainFromCategories(props, axis, categories) {
categories = categories || Data.getCategories(props, axis);
=======
getDomainFromCategories(props, axis) {
const { polar, startAngle = 0, endAngle = 360 } = props;
const categories = Data.getCategories(props, axis);
>>>>>>>
getDomainFromCategories(props, axis, categories) {
categories = categories || Data.getCategories(props, axis);
const { polar, startAngle = 0, endAngle = 360 } = props;
<<<<<<<
const min = minDomain !== undefined ? minDomain : Collection.getMinValue(categoryValues);
const max = maxDomain !== undefined ? maxDomain : Collection.getMaxValue(categoryValues);
return this.getDomainFromMinMax(min, max);
=======
const categoryDomain = [
Collection.getMinValue(categoryValues), Collection.getMaxValue(categoryValues)
];
return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ?
this.getSymmetricDomain(categoryDomain, categoryValues) : categoryDomain;
>>>>>>>
const min = minDomain !== undefined ? minDomain : Collection.getMinValue(categoryValues);
const max = maxDomain !== undefined ? maxDomain : Collection.getMaxValue(categoryValues);
const categoryDomain = this.getDomainFromMinMax(min, max);
return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ?
this.getSymmetricDomain(categoryDomain, categoryValues) : categoryDomain;
<<<<<<<
if (dependent && props.categories && props.categories[axis]) {
=======
const categories = isPlainObject(props.categories) ? props.categories.axis : props.categories;
if (dependent && categories) {
>>>>>>>
const categories = isPlainObject(props.categories) ? props.categories.axis : props.categories;
if (dependent && categories) { |
<<<<<<<
import { includes, defaults, isFunction, range, without } from "lodash";
import { Helpers, Scale, Domain } from "victory-core";
=======
import { includes, defaults, defaultsDeep, isFunction, range, without } from "lodash";
import Scale from "../../helpers/scale";
import Axis from "../../helpers/axis";
import Domain from "../../helpers/domain";
import { Helpers } from "victory-core";
>>>>>>>
import { includes, defaults, defaultsDeep, isFunction, range, without } from "lodash";
import { Helpers, Scale, Domain } from "victory-core"; |
<<<<<<<
const y1 = scale.y(datum.high);
const y2 = scale.y(datum.low);
const candleHeight = Math.abs(scale.y(datum.open) - scale.y(datum.close));
const y = scale.y(Math.max(datum.open, datum.close));
const size = this.getSize(datum, modifiedProps, calculatedValues);
const dataStyle = assign(this.getDataStyles(datum, style.data, modifiedProps));
=======
const y1 = scale.y(datum.y[2]);
const y2 = scale.y(datum.y[3]);
const candleHeight = Math.abs(scale.y(datum.y[0]) - scale.y(datum.y[1]));
const y = scale.y(Math.max(datum.y[0], datum.y[1]));
const dataStyle = Object.assign(this.getDataStyles(datum, style.data, modifiedProps));
>>>>>>>
const y1 = scale.y(datum.y[2]);
const y2 = scale.y(datum.y[3]);
const candleHeight = Math.abs(scale.y(datum.y[0]) - scale.y(datum.y[1]));
const y = scale.y(Math.max(datum.y[0], datum.y[1]));
const dataStyle = assign(this.getDataStyles(datum, style.data, modifiedProps)); |
<<<<<<<
import { last } from "lodash";
import { Helpers, Log } from "victory-core";
=======
import { assign, last } from "lodash";
import { Helpers } from "victory-core";
>>>>>>>
import { assign, last } from "lodash";
import { Helpers, Log } from "victory-core";
<<<<<<<
let data = Data.getData(props);
if (data.length < 2) {
Log.warn("Area requires at least two data points.");
data = Data.generateData(props);
}
const minY = Math.min(...domain.y) > 0 ? Math.min(...domain.y) : 0;
=======
const data = Data.getData(props);
const defaultMin = Scale.getScaleType(props, "y") === "log" ? 1 / Number.MAX_SAFE_INTEGER : 0;
const minY = Math.min(...domain.y) > 0 ? Math.min(...domain.y) : defaultMin;
>>>>>>>
let data = Data.getData(props);
if (data.length < 2) {
Log.warn("Area requires at least two data points.");
data = Data.generateData(props);
}
const defaultMin = Scale.getScaleType(props, "y") === "log" ? 1 / Number.MAX_SAFE_INTEGER : 0;
const minY = Math.min(...domain.y) > 0 ? Math.min(...domain.y) : defaultMin; |
<<<<<<<
EventEmitter = require('events').EventEmitter,
Device = require('./device');
=======
path = require('path'),
EventEmitter = require('events').EventEmitter;
>>>>>>>
EventEmitter = require('events').EventEmitter,
path = require('path'),
Device = require('./device'); |
<<<<<<<
=======
import take from "lodash/array/take";
import uniq from "lodash/array/uniq";
import isDate from "lodash/lang/isDate";
import defaults from "lodash/object/defaults";
>>>>>>>
import isDate from "lodash/lang/isDate"; |
<<<<<<<
this.baseProps = ScatterHelpers.getBaseProps(this.props,
defaultStyles, defaultWidthHeight);
=======
this.setupEvents(this.props);
>>>>>>>
this.setupEvents(this.props);
<<<<<<<
this.baseProps = ScatterHelpers.getBaseProps(newProps,
defaultStyles, defaultWidthHeight);
=======
this.setupEvents(newProps);
>>>>>>>
this.setupEvents(newProps);
<<<<<<<
this.props = Object.assign({}, this.props, Size.getWidthHeight(this.props,
defaultWidthHeight));
const { animate, style, standalone, width, height, containerComponent } = this.props;
=======
const { animate, style, standalone } = this.props;
>>>>>>>
this.props = Object.assign({}, this.props, Size.getWidthHeight(this.props,
defaultWidthHeight));
const { animate, style, standalone } = this.props; |
<<<<<<<
clipWidth: props.width,
clipHeight: props.height,
=======
domainPadding: child.props.domainPadding ||
props.domainPadding || calculatedProps.defaultDomainPadding,
>>>>>>>
clipWidth: props.width,
clipHeight: props.height,
domainPadding: child.props.domainPadding ||
props.domainPadding || calculatedProps.defaultDomainPadding, |
<<<<<<<
template: `
<h1 cp-style="{color: $ctrl.numberOne == 70 ? 'red' : 'green'}"> [[ $ctrl.numberOne + $ctrl.numberTwo ]] </h1>
<p cp-style="{ background: 'red', padding: '10px'}">Exemplo 1</p>
<p id="p1" cp-style="{ background: $ctrl.blue, padding: '10px'}">Exemplo 2</p>
=======
template: `
<h1 cp-click="$ctrl.hi()">
[[ $ctrl.$constants.nome ]]
</h1>
`,
constants: ['nome'],
controller: function(scope){
const $ctrl = this;
>>>>>>>
template: `
<h1 cp-style="{color: $ctrl.numberOne == 70 ? 'red' : 'green'}"> [[ $ctrl.numberOne + $ctrl.numberTwo ]] </h1>
<p cp-style="{ background: 'red', padding: '10px'}">Exemplo 1</p>
<p id="p1" cp-style="{ background: $ctrl.blue, padding: '10px'}">Exemplo 2</p>
<<<<<<<
$ctrl.$onInit = function () {
$ctrl.numberOne = 50;
$ctrl.numberTwo = 80;
$ctrl.blue = "blue";
};
$ctrl.changeNumberOne = function () {
$ctrl.numberOne = 70;
};
$ctrl.changeBackground = function () {
$ctrl.blue = "gray";
}
=======
$ctrl.hi = function(){
console.log("Hi");
}
>>>>>>>
$ctrl.$onInit = function () {
$ctrl.numberOne = 50;
$ctrl.numberTwo = 80;
$ctrl.blue = "blue";
};
$ctrl.changeNumberOne = function () {
$ctrl.numberOne = 70;
};
$ctrl.changeBackground = function () {
$ctrl.blue = "gray";
}; |
<<<<<<<
collectCoverageFrom: ['src/**/*.{ts,tsx}', 'plugins/**/*.{ts,tsx}', '!src/app/src/icons/**/*.{ts,tsx}'],
projects: ['<rootDir>/src/*', '<rootDir>/plugins/*'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
testPathIgnorePatterns: ['node_modules'],
modulePathIgnorePatterns: ['dist', 'lib']
=======
projects: ['<rootDir>/src/*'],
testPathIgnorePatterns: ['src']
>>>>>>>
projects: ['<rootDir>/src/*', '<rootDir>/plugins/*'],
testPathIgnorePatterns: ['src'] |
<<<<<<<
} else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
=======
// This path appears unavoidable for IE9. When cloning an object
// element in IE9, the outerHTML strategy above is not sufficient.
// If the src has innerHTML and the destination does not,
// copy the src.innerHTML into the dest.innerHTML. #10324
if ( jQuery.support.html5Clone && (src.innerHTML && !jQuery.trim(dest.innerHTML)) ) {
dest.innerHTML = src.innerHTML;
}
} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
>>>>>>>
// This path appears unavoidable for IE9. When cloning an object
// element in IE9, the outerHTML strategy above is not sufficient.
// If the src has innerHTML and the destination does not,
// copy the src.innerHTML into the dest.innerHTML. #10324
if ( jQuery.support.html5Clone && (src.innerHTML && !jQuery.trim(dest.innerHTML)) ) {
dest.innerHTML = src.innerHTML;
}
} else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { |
<<<<<<<
});
test("jQuery(<tag>) & wrap[Inner/All]() handle unknown elems (#10667)", function() {
expect(2);
var $wraptarget = jQuery( "<div id='wrap-target'>Target</div>" ).appendTo( "#qunit-fixture" ),
$section = jQuery( "<section>" ).appendTo( "#qunit-fixture" );
$wraptarget.wrapAll("<aside style='background-color:green'></aside>");
notEqual( $wraptarget.parent("aside").css("background-color"), "transparent", "HTML5 elements created with wrapAll inherit styles" );
notEqual( $section.css("background-color"), "transparent", "HTML5 elements create with jQuery( string ) inherit styles" );
});
test("Cloned, detached HTML5 elems (#10667,10670)", function() {
expect(7);
var $section = jQuery( "<section>" ).appendTo( "#qunit-fixture" ),
$clone;
// First clone
$clone = $section.clone();
// Infer that the test is being run in IE<=8
if ( $clone[0].outerHTML && !jQuery.support.opacity ) {
// This branch tests cloning nodes by reading the outerHTML, used only in IE<=8
equal( $clone[0].outerHTML, "<section></section>", "detached clone outerHTML matches '<section></section>'" );
} else {
// This branch tests a known behaviour in modern browsers that should never fail.
// Included for expected test count symmetry (expecting 1)
equal( $clone[0].nodeName, "SECTION", "detached clone nodeName matches 'SECTION' in modern browsers" );
}
// Bind an event
$section.bind( "click", function( event ) {
ok( true, "clone fired event" );
});
// Second clone (will have an event bound)
$clone = $section.clone( true );
// Trigger an event from the first clone
$clone.trigger( "click" );
$clone.unbind( "click" );
// Add a child node with text to the original
$section.append( "<p>Hello</p>" );
// Third clone (will have child node and text)
$clone = $section.clone( true );
equal( $clone.find("p").text(), "Hello", "Assert text in child of clone" );
// Trigger an event from the third clone
$clone.trigger( "click" );
$clone.unbind( "click" );
// Add attributes to copy
$section.attr({
"class": "foo bar baz",
"title": "This is a title"
});
// Fourth clone (will have newly added attributes)
$clone = $section.clone( true );
equal( $clone.attr("class"), $section.attr("class"), "clone and element have same class attribute" );
equal( $clone.attr("title"), $section.attr("title"), "clone and element have same title attribute" );
// Remove the original
$section.remove();
// Clone the clone
$section = $clone.clone( true );
// Remove the clone
$clone.remove();
// Trigger an event from the clone of the clone
$section.trigger( "click" );
// Unbind any remaining events
$section.unbind( "click" );
$clone.unbind( "click" );
=======
});
test("jQuery.fragments cache expectations", function() {
expect( 10 );
jQuery.fragments = {};
function fragmentCacheSize() {
var n = 0, c;
for ( c in jQuery.fragments ) {
n++;
}
return n;
}
jQuery("<li></li>");
jQuery("<li>?</li>");
jQuery("<li>whip</li>");
jQuery("<li>it</li>");
jQuery("<li>good</li>");
jQuery("<div></div>");
jQuery("<div><div><span></span></div></div>");
jQuery("<tr><td></td></tr>");
jQuery("<tr><td></tr>");
jQuery("<li>aaa</li>");
jQuery("<ul><li>?</li></ul>");
jQuery("<div><p>arf</p>nnn</div>");
jQuery("<div><p>dog</p>?</div>");
jQuery("<span><span>");
equal( fragmentCacheSize(), 12, "12 entries exist in jQuery.fragments, 1" );
jQuery.each( [
"<tr><td></td></tr>",
"<ul><li>?</li></ul>",
"<div><p>dog</p>?</div>",
"<span><span>"
], function( i, frag ) {
jQuery( frag );
equal( jQuery.fragments[ frag ].nodeType, 11, "Second call with " + frag + " creates a cached DocumentFragment, has nodeType 11" );
ok( jQuery.fragments[ frag ].childNodes.length, "Second call with " + frag + " creates a cached DocumentFragment, has childNodes with length" );
});
equal( fragmentCacheSize(), 12, "12 entries exist in jQuery.fragments, 2" );
>>>>>>>
});
test("jQuery(<tag>) & wrap[Inner/All]() handle unknown elems (#10667)", function() {
expect(2);
var $wraptarget = jQuery( "<div id='wrap-target'>Target</div>" ).appendTo( "#qunit-fixture" ),
$section = jQuery( "<section>" ).appendTo( "#qunit-fixture" );
$wraptarget.wrapAll("<aside style='background-color:green'></aside>");
notEqual( $wraptarget.parent("aside").css("background-color"), "transparent", "HTML5 elements created with wrapAll inherit styles" );
notEqual( $section.css("background-color"), "transparent", "HTML5 elements create with jQuery( string ) inherit styles" );
});
test("Cloned, detached HTML5 elems (#10667,10670)", function() {
expect(7);
var $section = jQuery( "<section>" ).appendTo( "#qunit-fixture" ),
$clone;
// First clone
$clone = $section.clone();
// Infer that the test is being run in IE<=8
if ( $clone[0].outerHTML && !jQuery.support.opacity ) {
// This branch tests cloning nodes by reading the outerHTML, used only in IE<=8
equal( $clone[0].outerHTML, "<section></section>", "detached clone outerHTML matches '<section></section>'" );
} else {
// This branch tests a known behaviour in modern browsers that should never fail.
// Included for expected test count symmetry (expecting 1)
equal( $clone[0].nodeName, "SECTION", "detached clone nodeName matches 'SECTION' in modern browsers" );
}
// Bind an event
$section.bind( "click", function( event ) {
ok( true, "clone fired event" );
});
// Second clone (will have an event bound)
$clone = $section.clone( true );
// Trigger an event from the first clone
$clone.trigger( "click" );
$clone.unbind( "click" );
// Add a child node with text to the original
$section.append( "<p>Hello</p>" );
// Third clone (will have child node and text)
$clone = $section.clone( true );
equal( $clone.find("p").text(), "Hello", "Assert text in child of clone" );
// Trigger an event from the third clone
$clone.trigger( "click" );
$clone.unbind( "click" );
// Add attributes to copy
$section.attr({
"class": "foo bar baz",
"title": "This is a title"
});
// Fourth clone (will have newly added attributes)
$clone = $section.clone( true );
equal( $clone.attr("class"), $section.attr("class"), "clone and element have same class attribute" );
equal( $clone.attr("title"), $section.attr("title"), "clone and element have same title attribute" );
// Remove the original
$section.remove();
// Clone the clone
$section = $clone.clone( true );
// Remove the clone
$clone.remove();
// Trigger an event from the clone of the clone
$section.trigger( "click" );
// Unbind any remaining events
$section.unbind( "click" );
$clone.unbind( "click" );
});
test("jQuery.fragments cache expectations", function() {
expect( 10 );
jQuery.fragments = {};
function fragmentCacheSize() {
var n = 0, c;
for ( c in jQuery.fragments ) {
n++;
}
return n;
}
jQuery("<li></li>");
jQuery("<li>?</li>");
jQuery("<li>whip</li>");
jQuery("<li>it</li>");
jQuery("<li>good</li>");
jQuery("<div></div>");
jQuery("<div><div><span></span></div></div>");
jQuery("<tr><td></td></tr>");
jQuery("<tr><td></tr>");
jQuery("<li>aaa</li>");
jQuery("<ul><li>?</li></ul>");
jQuery("<div><p>arf</p>nnn</div>");
jQuery("<div><p>dog</p>?</div>");
jQuery("<span><span>");
equal( fragmentCacheSize(), 12, "12 entries exist in jQuery.fragments, 1" );
jQuery.each( [
"<tr><td></td></tr>",
"<ul><li>?</li></ul>",
"<div><p>dog</p>?</div>",
"<span><span>"
], function( i, frag ) {
jQuery( frag );
equal( jQuery.fragments[ frag ].nodeType, 11, "Second call with " + frag + " creates a cached DocumentFragment, has nodeType 11" );
ok( jQuery.fragments[ frag ].childNodes.length, "Second call with " + frag + " creates a cached DocumentFragment, has childNodes with length" );
});
equal( fragmentCacheSize(), 12, "12 entries exist in jQuery.fragments, 2" ); |
<<<<<<<
equals( jQuery("#empty").css("opacity"), "0", "Assert opacity is accessible via filter property set in stylesheet in IE" );
jQuery("#empty").css({ opacity: "1" });
equals( jQuery("#empty").css("opacity"), "1", "Assert opacity is taken from style attribute when set vs stylesheet in IE with filters" );
=======
equals( jQuery('#empty').css('opacity'), '0', "Assert opacity is accessible via filter property set in stylesheet in IE" );
jQuery('#empty').css({ opacity: '1' });
equals( jQuery('#empty').css('opacity'), '1', "Assert opacity is taken from style attribute when set vs stylesheet in IE with filters" );
jQuery.support.opacity ?
ok(true, "Requires the same number of tests"):
ok( ~jQuery("#empty")[0].currentStyle.filter.indexOf("gradient"), "Assert setting opacity doesn't overwrite other filters of the stylesheet in IE" );
>>>>>>>
equals( jQuery("#empty").css("opacity"), "0", "Assert opacity is accessible via filter property set in stylesheet in IE" );
jQuery("#empty").css({ opacity: "1" });
equals( jQuery("#empty").css("opacity"), "1", "Assert opacity is taken from style attribute when set vs stylesheet in IE with filters" );
jQuery.support.opacity ?
ok(true, "Requires the same number of tests"):
ok( ~jQuery("#empty")[0].currentStyle.filter.indexOf("gradient"), "Assert setting opacity doesn't overwrite other filters of the stylesheet in IE" ); |
<<<<<<<
});
test( "animate properties missing px w/ opacity as last (#9074)", 2, function() {
expect( 6 );
stop();
var div = jQuery( "<div style='position: absolute; margin-left: 0; left: 0px;'></div>" )
.appendTo( "#qunit-fixture" );
function cssInt( prop ) {
return parseInt( div.css( prop ), 10 );
}
equal( cssInt( "marginLeft" ), 0, "Margin left is 0" );
equal( cssInt( "left" ), 0, "Left is 0" );
div.animate({
left: 200,
marginLeft: 200,
opacity: 0
}, 1000);
setTimeout(function() {
var ml = cssInt( "marginLeft" ),
l = cssInt( "left" );
notEqual( ml, 0, "Margin left is not 0 after partial animate" );
notEqual( ml, 200, "Margin left is not 200 after partial animate" );
notEqual( l, 0, "Left is not 0 after partial animate" );
notEqual( l, 200, "Left is not 200 after partial animate" );
div.stop().remove();
start();
}, 100);
=======
});
test("callbacks should fire in correct order (#9100)", function() {
stop();
var a = 1,
cb = 0,
$lis = jQuery("<p data-operation='*2'></p><p data-operation='^2'></p>").appendTo("#qunit-fixture")
// The test will always pass if no properties are animated or if the duration is 0
.animate({fontSize: 12}, 13, function() {
a *= jQuery(this).data("operation") === "*2" ? 2 : a;
cb++;
if ( cb === 2 ) {
equal( a, 4, "test value has been *2 and _then_ ^2");
start();
}
});
>>>>>>>
});
test( "animate properties missing px w/ opacity as last (#9074)", 2, function() {
expect( 6 );
stop();
var div = jQuery( "<div style='position: absolute; margin-left: 0; left: 0px;'></div>" )
.appendTo( "#qunit-fixture" );
function cssInt( prop ) {
return parseInt( div.css( prop ), 10 );
}
equal( cssInt( "marginLeft" ), 0, "Margin left is 0" );
equal( cssInt( "left" ), 0, "Left is 0" );
div.animate({
left: 200,
marginLeft: 200,
opacity: 0
}, 1000);
setTimeout(function() {
var ml = cssInt( "marginLeft" ),
l = cssInt( "left" );
notEqual( ml, 0, "Margin left is not 0 after partial animate" );
notEqual( ml, 200, "Margin left is not 200 after partial animate" );
notEqual( l, 0, "Left is not 0 after partial animate" );
notEqual( l, 200, "Left is not 200 after partial animate" );
div.stop().remove();
start();
}, 100);
});
test("callbacks should fire in correct order (#9100)", function() {
stop();
var a = 1,
cb = 0,
$lis = jQuery("<p data-operation='*2'></p><p data-operation='^2'></p>").appendTo("#qunit-fixture")
// The test will always pass if no properties are animated or if the duration is 0
.animate({fontSize: 12}, 13, function() {
a *= jQuery(this).data("operation") === "*2" ? 2 : a;
cb++;
if ( cb === 2 ) {
equal( a, 4, "test value has been *2 and _then_ ^2");
start();
}
}); |
<<<<<<<
if (typeof(this.octree) !== 'undefined' && (typeof(use_octree) === 'undefined' || use_octree === "true")) {
this.octree.insert(sceneObj);
this.sceneObjectsById[sceneObj.id] = sceneObj;
}
=======
if (typeof(this.octree) !== 'undefined' && (typeof(use_octree) === 'undefined' || use_octree === "true")) { this.octree.insert(sceneObj); }
>>>>>>>
if (typeof(this.octree) !== 'undefined' && (typeof(use_octree) === 'undefined' || use_octree === "true")) {
this.octree.insert(sceneObj);
this.sceneObjectsById[sceneObj.id] = sceneObj;
}
<<<<<<<
function FrustumWorkerProxy(worker, camera)
{
this.camera = camera;
this.worker = worker;
this.draw_on_map = function(map_context) { return; }
} //FrustumWorkerProxy
FrustumWorkerProxy.prototype.extract = function(camera, mvMatrix, pMatrix)
{
this.worker.send({type:"set_camera", data:{mvMatrix:this.camera.mvMatrix, pMatrix:this.camera.pMatrix, position:this.camera.position, target:this.camera.target}});
} //FrustumWorkerProxy::extract
Frustum = function() {
=======
var Frustum = function() {
>>>>>>>
function FrustumWorkerProxy(worker, camera)
{
this.camera = camera;
this.worker = worker;
this.draw_on_map = function(map_context) { return; }
} //FrustumWorkerProxy
FrustumWorkerProxy.prototype.extract = function(camera, mvMatrix, pMatrix)
{
this.worker.send({type:"set_camera", data:{mvMatrix:this.camera.mvMatrix, pMatrix:this.camera.pMatrix, position:this.camera.position, target:this.camera.target}});
} //FrustumWorkerProxy::extract
var Frustum = function() { |
<<<<<<<
function OcTreeWorkerProxy(worker, camera, octree, scene)
{
this.worker = worker;
this.scene = scene;
this.worker.send({type:"init", data:{size: octree._size, max_depth:octree._max_depth}});
this.worker.send({type:"set_camera", data:camera});
var that = this;
this.onmessage = function(e)
{
switch(e.data.type)
{
case "log":
console.log(e.data.data);
break;
case "get_frustum_hits":
for (var i in that.scene.sceneObjects)
that.scene.sceneObjects[i].frustum_visible = false;
for (var j in e.data.data)
that.scene.sceneObjectsById[j].frustum_visible = true;
break;
default: break;
} //switch
} //onmessage
this.worker.message_function = this.onmessage;
this.toString = function()
{
return "[OcTreeWorkerProxy]";
} //toString
this.insert = function(node)
{
var s = JSON.stringify(node);
this.worker.send({type:"insert", data:s});
} //insert
this.draw_on_map = function()
{
return;
} //draw_on_map
this.reset_node_visibility = function()
{
return;
} //reset_node_visibility
this.get_frustum_hits = function()
{
} //get_frustum_hits
} //OcTreeWorkerProxy
OcTree = function(size, max_depth, root, position)
{
=======
OcTree = function(size, max_depth, root, position) {
>>>>>>>
function OcTreeWorkerProxy(worker, camera, octree, scene)
{
this.worker = worker;
this.scene = scene;
this.worker.send({type:"init", data:{size: octree._size, max_depth:octree._max_depth}});
this.worker.send({type:"set_camera", data:camera});
var that = this;
this.onmessage = function(e)
{
switch(e.data.type)
{
case "log":
console.log(e.data.data);
break;
case "get_frustum_hits":
for (var i in that.scene.sceneObjects)
that.scene.sceneObjects[i].frustum_visible = false;
for (var j in e.data.data)
that.scene.sceneObjectsById[j].frustum_visible = true;
break;
default: break;
} //switch
} //onmessage
this.worker.message_function = this.onmessage;
this.toString = function()
{
return "[OcTreeWorkerProxy]";
} //toString
this.insert = function(node)
{
var s = JSON.stringify(node);
this.worker.send({type:"insert", data:s});
} //insert
this.draw_on_map = function()
{
return;
} //draw_on_map
this.reset_node_visibility = function()
{
return;
} //reset_node_visibility
this.get_frustum_hits = function()
{
} //get_frustum_hits
} //OcTreeWorkerProxy
OcTree = function(size, max_depth, root, position) {
<<<<<<<
this._children[i] = null;
if (size === undefined)
this._size = 0;
else
this._size = size;
if (max_depth === undefined)
this._max_depth = 0;
else
this._max_depth = max_depth;
/*
if (root === undefined)
this._root = null;
else
this._root = root;
*/
if (position === undefined)
this._position = new Vector3();
else
this._position = position;
=======
this._children[i] = null;
if (size === undefined) this._size = 0;
else this._size = size;
if (max_depth === undefined) this._max_depth = 0;
else this._max_depth = max_depth;
if (root === undefined) this._root = null;
else this._root = root;
if (position === undefined) this._position = new Vector3();
else this._position = position;
>>>>>>>
this._children[i] = null;
if (size === undefined) this._size = 0;
else this._size = size;
if (max_depth === undefined) this._max_depth = 0;
else this._max_depth = max_depth;
if (root === undefined) this._root = null;
else this._root = root;
if (position === undefined) this._position = new Vector3();
else this._position = position;
<<<<<<<
OcTree.prototype.insert = function(node)
{
if (this._max_depth == 0)
{
var s = "" + node.position + " -> " + "into: " + this.toString();
//postMessage({type:"log", data:s});
//console.log(s);
=======
OcTree.prototype.insert = function(node) {
if (this._max_depth === 0) {
//console.log(node.position, " -> ", node.name, "into: " + this.toString());
>>>>>>>
OcTree.prototype.insert = function(node)
{
if (this._max_depth == 0) {
//var s = "" + node.position + " -> " + "into: " + this.toString();
//postMessage({type:"log", data:s});
//console.log(s);
<<<<<<<
OcTree.prototype.contains_point = function(position)
{
return position[0] <= this._position.x + this._size/2
&& position[1] <= this._position.y + this._size/2
&& position[2] <= this._position.z + this._size/2
&& position[0] >= this._position.x - this._size/2
&& position[1] >= this._position.y - this._size/2
&& position[2] >= this._position.z - this._size/2;
} //OcTree::contains_point
OcTree.prototype.get_frustum_hits = function(camera, test_children)
{
var hits = [];
if(test_children === undefined || test_children == true)
{
if(!(this.contains_point(camera.position)))
{
if(camera.frustum.sphere.intersects(this._sphere) == false) return hits;
//if(_sphere.intersects(c.get_frustum().get_cone()) == false) return h;
switch(camera.frustum.contains_sphere(this._sphere))
{
case -1:
=======
OcTree.prototype.contains_point = function(position) {
return position[0] <= this._position.x + this._size / 2 && position[1] <= this._position.y + this._size / 2 && position[2] <= this._position.z + this._size / 2 && position[0] >= this._position.x - this._size / 2 && position[1] >= this._position.y - this._size / 2 && position[2] >= this._position.z - this._size / 2;
} //OcTree::contains_points
OcTree.prototype.get_frustum_hits = function(camera, test_children) {
if (test_children === undefined || test_children === true) {
if (! (this.contains_point(camera.position))) {
if (camera.frustum.sphere.intersects(this._sphere) === false) return;
//if(_sphere.intersects(c.get_frustum().get_cone()) === false) return h;
switch (camera.frustum.contains_sphere(this._sphere)) {
case -1:
this._debug_visible = false;
return;
case 1:
this._debug_visible = 2;
test_children = false;
break;
case 0:
this._debug_visible = true;
switch (camera.frustum.contains_box(this._bbox)) {
case -1:
>>>>>>>
OcTree.prototype.contains_point = function(position) {
return position[0] <= this._position.x + this._size / 2 && position[1] <= this._position.y + this._size / 2 && position[2] <= this._position.z + this._size / 2 && position[0] >= this._position.x - this._size / 2 && position[1] >= this._position.y - this._size / 2 && position[2] >= this._position.z - this._size / 2;
} //OcTree::contains_point
OcTree.prototype.get_frustum_hits = function(camera, test_children) {
var hits = [];
if (test_children === undefined || test_children === true) {
if (! (this.contains_point(camera.position))) {
if (camera.frustum.sphere.intersects(this._sphere) === false) return hits;
//if(_sphere.intersects(c.get_frustum().get_cone()) === false) return hits;
switch (camera.frustum.contains_sphere(this._sphere)) {
case -1:
this._debug_visible = false;
return hits;
case 1:
this._debug_visible = 2;
test_children = false;
break;
case 0:
this._debug_visible = true;
switch (camera.frustum.contains_box(this._bbox)) {
case -1:
<<<<<<<
return hits;
case 1:
this._debug_visible = 2;
test_children = false;
break;
case 0:
this._debug_visible = true;
switch(camera.frustum.contains_box(this._bbox))
{
case -1:
this._debug_visible = false;
return hits;
case 1:
this._debug_visible = 3;
test_children = false;
break;
} //switch
break;
} //switch
}//if
} //if
for (var node in this._nodes)
{
=======
return;
case 1:
this._debug_visible = 3;
test_children = false;
break;
} //switch
break;
} //switch
} //if
} //if
for (var node in this._nodes) {
>>>>>>>
return hits;
case 1:
this._debug_visible = 3;
test_children = false;
break;
} //switch
break;
} //switch
} //if
} //if
for (var node in this._nodes) {
<<<<<<<
function FrustumWorkerProxy(worker, camera)
{
this.camera = camera;
this.worker = worker;
this.draw_on_map = function(map_context) { return; }
} //FrustumWorkerProxy
FrustumWorkerProxy.prototype.extract = function(camera, mvMatrix, pMatrix)
{
this.worker.send({type:"set_camera", data:{mvMatrix:this.camera.mvMatrix, pMatrix:this.camera.pMatrix, position:this.camera.position, target:this.camera.target}});
} //FrustumWorkerProxy::extract
Frustum = function()
{
=======
Frustum = function() {
>>>>>>>
function FrustumWorkerProxy(worker, camera)
{
this.camera = camera;
this.worker = worker;
this.draw_on_map = function(map_context) { return; }
} //FrustumWorkerProxy
FrustumWorkerProxy.prototype.extract = function(camera, mvMatrix, pMatrix)
{
this.worker.send({type:"set_camera", data:{mvMatrix:this.camera.mvMatrix, pMatrix:this.camera.pMatrix, position:this.camera.position, target:this.camera.target}});
} //FrustumWorkerProxy::extract
Frustum = function() {
<<<<<<<
this.sphere = new Sphere();
for(var i = 0; i < 6; ++i)
{
=======
this.sphere = null;
for (var i = 0; i < 6; ++i) {
>>>>>>>
this.sphere = null;
for (var i = 0; i < 6; ++i) { |
<<<<<<<
//add path of CSS files to inject last into the HTML file
var injectLastCss=[
//example: src/css/somefile.css
];
=======
//add path of CSS files to inject last into the HTML file
var injectLastCss=[
//example: src/css/somefile.css
'src/css/login-custom.css'
];
>>>>>>>
//add path of CSS files to inject last into the HTML file
var injectLastCss=[
//example: src/css/somefile.css
'src/css/login-custom.css'
];
<<<<<<<
=======
>>>>>>>
<<<<<<<
['sass', 'css', 'css-app-last', 'images', 'fonts', 'fonts-app', 'templates'],
=======
['sass', 'css', 'css-app-last', 'images', 'fonts', 'templates'],
>>>>>>>
['sass', 'css', 'css-app-last', 'images', 'fonts', 'fonts-app', 'templates'], |
<<<<<<<
=======
this.state.daysLoaded = 1
this.state.daysToLoad = 4 // how many days to load in the future?
>>>>>>>
<<<<<<<
addDay (blocks, block = 0) {
if (blocks.length == 0) return
console.log('add day' , block)
let group = new THREE.Group()
=======
buildBlocks (blocks, index, group, spiralPoints) {
return new Promise((resolve, reject) => {
for (let blockIndex = 0; blockIndex < blocks.length; blockIndex++) {
// for (let blockIndex = 0; blockIndex < 1; blockIndex++) {
let block = blocks[blockIndex]
>>>>>>>
buildBlocks (blocks, index, group, spiralPoints) {
return new Promise((resolve, reject) => {
for (let blockIndex = 0; blockIndex < blocks.length; blockIndex++) {
// for (let blockIndex = 0; blockIndex < 1; blockIndex++) {
let block = blocks[blockIndex]
<<<<<<<
=======
ambientCameraMovement () {
this.camera.lookAt(this.lookAtPos)
this.targetPos.x += this.mousePos.x
this.targetPos.y += this.mousePos.y
document.dispatchEvent(this.cameraMoveEvent)
}
smoothCameraMovement () {
if (this.targetPos.x > this.cameraDriftLimitMax.x) {
this.targetPos.x = this.cameraDriftLimitMax.x - 1
}
if (this.targetPos.y > this.cameraDriftLimitMax.y) {
this.targetPos.y = this.cameraDriftLimitMax.y - 1
}
if (this.targetPos.x < this.cameraDriftLimitMin.x) {
this.targetPos.x = this.cameraDriftLimitMin.x + 1
}
if (this.targetPos.y < this.cameraDriftLimitMin.y) {
this.targetPos.y = this.cameraDriftLimitMin.y + 1
}
// if (
// this.targetPos.x < this.cameraDriftLimitMax.x &&
// this.targetPos.y < this.cameraDriftLimitMax.y
// ) {
this.camPos.lerp(this.targetPos, this.cameraLerpSpeed)
this.camera.position.copy(this.camPos)
// }
this.lookAtPos.lerp(this.targetLookAt, this.cameraLerpSpeed)
}
>>>>>>>
ambientCameraMovement () {
this.camera.lookAt(this.lookAtPos)
this.targetPos.x += this.mousePos.x
this.targetPos.y += this.mousePos.y
document.dispatchEvent(this.cameraMoveEvent)
}
smoothCameraMovement () {
if (this.targetPos.x > this.cameraDriftLimitMax.x) {
this.targetPos.x = this.cameraDriftLimitMax.x - 1
}
if (this.targetPos.y > this.cameraDriftLimitMax.y) {
this.targetPos.y = this.cameraDriftLimitMax.y - 1
}
if (this.targetPos.x < this.cameraDriftLimitMin.x) {
this.targetPos.x = this.cameraDriftLimitMin.x + 1
}
if (this.targetPos.y < this.cameraDriftLimitMin.y) {
this.targetPos.y = this.cameraDriftLimitMin.y + 1
}
// if (
// this.targetPos.x < this.cameraDriftLimitMax.x &&
// this.targetPos.y < this.cameraDriftLimitMax.y
// ) {
this.camPos.lerp(this.targetPos, this.cameraLerpSpeed)
this.camera.position.copy(this.camPos)
// }
this.lookAtPos.lerp(this.targetLookAt, this.cameraLerpSpeed)
}
<<<<<<<
this.renderer.render(this.scene, this.camera)
=======
this.loadDays()
this.smoothCameraMovement()
this.ambientCameraMovement()
this.composer.render()
// this.renderer.render(this.scene, this.camera)
>>>>>>>
this.loadDays()
this.smoothCameraMovement()
this.ambientCameraMovement()
this.composer.render()
// this.renderer.render(this.scene, this.camera) |
<<<<<<<
// animation loop
this.animate()
})
=======
this.moveCamera()
// animation loop
this.animate()
>>>>>>>
this.moveCamera()
// animation loop
this.animate()
})
<<<<<<<
//TWEEN.update()
// Interpolate camPos toward targetPos
this.camPos.lerp(this.targetPos, 0.05)
// Apply new camPos to your camera
this.camera.position.copy(this.camPos)
if (this.time < 1) {
this.time += 0.01
}
THREE.Quaternion.slerp(this.fromQuaternion, this.toQuaternion, this.moveQuaternion, this.time)
this.camera.quaternion.set(this.moveQuaternion.x, this.moveQuaternion.y, this.moveQuaternion.z, this.moveQuaternion.w)
//this.lookAtPos.lerp(this.origin, 0.05)
//console.log(this.lookAtPos)
//this.camera.lookAt(this.lookAtPos)
=======
>>>>>>>
//TWEEN.update()
// Interpolate camPos toward targetPos
this.camPos.lerp(this.targetPos, 0.05)
// Apply new camPos to your camera
this.camera.position.copy(this.camPos)
if (this.time < 1) {
this.time += 0.01
}
THREE.Quaternion.slerp(this.fromQuaternion, this.toQuaternion, this.moveQuaternion, this.time)
this.camera.quaternion.set(this.moveQuaternion.x, this.moveQuaternion.y, this.moveQuaternion.z, this.moveQuaternion.w)
//this.lookAtPos.lerp(this.origin, 0.05)
//console.log(this.lookAtPos)
//this.camera.lookAt(this.lookAtPos) |
<<<<<<<
this.currentBlock = block
=======
>>>>>>>
<<<<<<<
/*new TWEEN.Tween( blockObject.material )
=======
/* new TWEEN.Tween( blockObject.material )
>>>>>>>
/*new TWEEN.Tween( blockObject.material )
<<<<<<<
// document.getElementById('loading').style.display = 'none'
=======
this.state.lineGroups.push(lineGroup)
>>>>>>>
this.state.lineGroups.push(lineGroup) |
<<<<<<<
import {getBlocksOnDay, getTransactionsForBlock, getBlock} from '../api/btc'
=======
import {getBlocksSince, getTransactionsForBlock, getBlock, getHashRateforDay} from '../api/btc'
>>>>>>>
import {getBlocksOnDay, getTransactionsForBlock, getBlock, getHashRateforDay} from '../api/btc'
<<<<<<<
this.clock = new THREE.Clock()
this.materials = new Map()
this.days = new Map()
=======
this.path = path
this.font = null
this.fontLoader = new THREE.FontLoader()
>>>>>>>
this.clock = new THREE.Clock()
this.materials = new Map()
this.days = new Map()
this.path = path
this.font = null
this.fontLoader = new THREE.FontLoader()
<<<<<<<
/*
Moves the camera to a new date in the block chain and loads data
*/
async setDate(date){
if( date < this.earliestDate ) return Promise.reject('Requested date is before the earliest available block date of ' + moment(this.earlestDate).format("MMM Do YYYY"))
if( date > this.latestDate ) return Promise.reject('Requested date is after the lateset available block date of ' + moment(this.latestDate).format("MMM Do YYYY"))
if(this.currentBlockObject) this.resetDayView()
this.stage.targetCameraPos.z = this.getPositionForDate(date) + 1000
this.stage.targetCameraLookAt.z = this.stage.targetCameraPos.z - 1000
=======
setDate (date, focusOnBlock = false) {
if (date < this.earliestDate) return Promise.reject('Requested date is before the earliest available block date of ' + moment(this.earlestDate).format('MMM Do YYYY'))
if (date > this.latestDate) return Promise.reject('Requested date is after the lateset available block date of ' + moment(this.latestDate).format('MMM Do YYYY'))
>>>>>>>
/*
Moves the camera to a new date in the block chain and loads data
*/
async setDate(date){
if( date < this.earliestDate ) return Promise.reject('Requested date is before the earliest available block date of ' + moment(this.earlestDate).format("MMM Do YYYY"))
if( date > this.latestDate ) return Promise.reject('Requested date is after the lateset available block date of ' + moment(this.latestDate).format("MMM Do YYYY"))
if(this.currentBlockObject) this.resetDayView()
this.stage.targetCameraPos.z = this.getPositionForDate(date) + 1000
this.stage.targetCameraLookAt.z = this.stage.targetCameraPos.z - 1000
<<<<<<<
getSumOfBlocks(blocks){
return {
input: blocks.reduce((a, b) => a + b.input, 0),
output: blocks.reduce((a, b) => a + b.output, 0),
fee: blocks.reduce((a, b) => a + b.fee, 0)
=======
if (focusOnBlock) {
for (let index = 0; index < this.state.dayGroups[dayIndex].children.length; index++) {
const mesh = this.state.dayGroups[dayIndex].children[index]
if (mesh.blockchainData.hash === this.state.currentHash) {
this.focusOnBlock(mesh)
break
}
}
}
} catch (error) {
console.log(error)
>>>>>>>
getSumOfBlocks(blocks){
return {
input: blocks.reduce((a, b) => a + b.input, 0),
output: blocks.reduce((a, b) => a + b.output, 0),
fee: blocks.reduce((a, b) => a + b.fee, 0)
<<<<<<<
=======
if (window.Worker) {
this.treeBuilderWorker = TreeBuilderWorker
this.treeBuilderWorker.addEventListener('message', this.addTreeToStage.bind(this), false)
}
this.on('dayChanged', function (data) {
if (this.state.currentDay) {
this.state.hashRate = this.state.currentDay.hashRate
this.state.audioFreqCutoff = map(this.state.hashRate, 0.0, 20000000.0, 50.0, 15000)
this.audio.setAmbienceFilterCutoff(this.state.audioFreqCutoff)
}
})
>>>>>>>
this.on('dayChanged', function ({ date }) {
const hashRate = getGroupForDay(date.valueOf()).hashRate
this.state.audioFreqCutoff = map(hashRate, 0.0, 20000000.0, 50.0, 15000)
this.audio.setAmbienceFilterCutoff(this.state.audioFreqCutoff)
})
<<<<<<<
let mesh = new THREE.Mesh(treeGeo, this.getMaterialsForDay(block.day).merkle)
=======
let merkleMaterial = this.merkleMaterial.clone()
let mesh = new THREE.Mesh(treeGeo, merkleMaterial)
>>>>>>>
let mesh = new THREE.Mesh(treeGeo, this.getMaterialsForDay(block.day).merkle)
<<<<<<<
createCubeMap (day) {
// if (typeof this.state.dayData[dayIndex] !== 'undefined') {
this.stage.scene.background = this.bgMap
const { front, back, merkle } = this.getMaterialsForDay(day)
const group = this.getGroupForDay(day)
front.color.setHex(0xffffff)
let cubeCamera = new THREE.CubeCamera(100.0, 5000, 1024)
cubeCamera.position.copy(group.position)
cubeCamera.renderTarget.texture.minFilter = THREE.LinearMipMapLinearFilter
cubeCamera.update(this.stage.renderer, this.stage.scene)
front.envMap = cubeCamera.renderTarget.texture
back.envMap = cubeCamera.renderTarget.texture
merkle.envMap = cubeCamera.renderTarget.texture
this.stage.scene.background = new THREE.Color(Config.scene.bgColor)
=======
createCubeMap (position, dayIndex) {
if (typeof this.state.dayData[dayIndex] !== 'undefined') {
this.stage.scene.background = this.bgMap
this.state.dayData[dayIndex].blockMaterialFront.color.setHex(0xffffff)
let cubeCamera = new THREE.CubeCamera(100.0, 5000, 1024)
cubeCamera.position.set(position.x, position.y, position.z)
cubeCamera.renderTarget.texture.minFilter = THREE.LinearMipMapLinearFilter
cubeCamera.update(this.stage.renderer, this.stage.scene)
this.state.dayData[dayIndex].blockMaterialFront.envMap = cubeCamera.renderTarget.texture
this.state.dayData[dayIndex].blockMaterialBack.envMap = cubeCamera.renderTarget.texture
// this.state.dayData[dayIndex].merkleMaterial.envMap = cubeCamera.renderTarget.texture
this.stage.scene.background = new THREE.Color(Config.scene.bgColor)
}
>>>>>>>
createCubeMap (day) {
// if (typeof this.state.dayData[dayIndex] !== 'undefined') {
this.stage.scene.background = this.bgMap
const { front, back, merkle } = this.getMaterialsForDay(day)
const group = this.getGroupForDay(day)
front.color.setHex(0xffffff)
let cubeCamera = new THREE.CubeCamera(100.0, 5000, 1024)
cubeCamera.position.copy(group.position)
cubeCamera.renderTarget.texture.minFilter = THREE.LinearMipMapLinearFilter
cubeCamera.update(this.stage.renderer, this.stage.scene)
front.envMap = cubeCamera.renderTarget.texture
back.envMap = cubeCamera.renderTarget.texture
// merkle.envMap = cubeCamera.renderTarget.texture
this.stage.scene.background = new THREE.Color(Config.scene.bgColor)
<<<<<<<
setupMaterials (textures, cubeTextures) {
const bumpMap = new THREE.Texture(textures[0])
this.bgMap = new THREE.CubeTexture(cubeTextures)
=======
buildTree (blockObject) {
let block = blockObject.blockchainData
if (this.state.currentBlockObject) {
this.state.currentBlockObject.remove(this.state.currentBlockObject.tree)
this.audio.unloadSound()
}
this.state.currentBlock = block
// this.removeTrees()
getTransactionsForBlock(block.hash)
.then((transactions) => {
block.transactions = transactions
this.treeBuilderWorker.postMessage(
{
cmd: 'build',
block: block
}
)
}).catch((error) => {
console.log(error)
})
}
setupMaterials (textures, cubeMap) {
this.bgMap = cubeMap
>>>>>>>
setupMaterials (textures, cubeTextures) {
const bumpMap = new THREE.Texture(textures[0])
this.bgMap = new THREE.CubeTexture(cubeTextures)
<<<<<<<
/* this.state.hashRate = this.state.currentDay.hashRate
this.state.audioFreqCutoff = map(this.state.hashRate, 0.0, 20000000.0, 50.0, 15000) // TODO: set upper bound to max hashrate from blockchain.info
// this.state.audioFreqCutoff = 20000
// this.audio.setAmbienceFilterCutoff(this.state.audioFreqCutoff)
*/
=======
>>>>>>> |
<<<<<<<
this.currentBlockObject = null
this.crystalOpacity = 0.5
=======
this.crystalOpacity = 0.7
>>>>>>>
this.currentBlockObject = null
this.crystalOpacity = 0.5
<<<<<<<
console.log('Root hash: ' + tree.root)
=======
// console.log('Root hash: ' + tree.root)
//console.log('Number of leaves: ' + tree.leaves)
//console.log('Number of levels: ' + tree.levels)
>>>>>>>
// console.log('Root hash: ' + tree.root)
<<<<<<<
=======
//crystal.panner = panner
>>>>>>>
<<<<<<<
=======
//this.camera.lookAt(this.origin)
//let objectRotation = THREE.Euler().copy(target.rotation)
//let toRotation = target.rotation.clone()
//this.camera.rotation.set(objectRotation.x, objectRotation.y, objectRotation.z)
//let toRotation = new THREE.Euler().copy(this.camera.rotation)
>>>>>>>
<<<<<<<
console.log('Root hash: ' + tree.root)
=======
// console.log('Root hash: ' + tree.root)
// console.timeEnd('merkle')
//console.log('Number of leaves: ' + tree.leaves)
//console.log('Number of levels: ' + tree.levels)
>>>>>>>
// console.log('Root hash: ' + tree.root)
// console.timeEnd('merkle')
<<<<<<<
=======
>>>>>>> |
<<<<<<<
=======
toggleBlocks (visibility) {
/* this.state.dayGroups.forEach((group) => {
group.visible = visibility
}, this)
this.state.lineGroups.forEach((group) => {
group.visible = visibility
}, this) */
}
>>>>>>>
<<<<<<<
=======
/*new TWEEN.Tween( blockObject.material )
.to( { opacity: 0 }, 4000 )
.onComplete(() => {
})
.start() */
>>>>>>>
<<<<<<<
loadDays () {
// load in prev day?
if (this.state.daysLoaded <= this.state.daysToLoad) {
this.state.daysLoaded++
this.loadPrevDay()
}
}
=======
animateBlock () {
// if (this.state.view === 'block') {
// this.state.currentBlockObject.rotation.z += 0.002
// this.treeGroup.rotation.z += 0.002
// }
}
>>>>>>>
<<<<<<<
this.loadDays()
=======
this.animateBlock()
>>>>>>> |
<<<<<<<
=======
var $color = $('header').css('background-color');
>>>>>>>
var $color = $('header').css('background-color'); |
<<<<<<<
}
// Replace p tags by br
export function formatLineBreak(text) {
return text
.replace(/<\/p>\n<p>/g, '<br>')
.replace(/<p>/g, '')
.replace(/<\/p>/g, '');
=======
}
// parse an integer/float and returns null if it's not an integer
export function toInt(number) {
if (number === '0') return 0;
return parseInt(number) || null
>>>>>>>
}
// Replace p tags by br
export function formatLineBreak(text) {
return text
.replace(/<\/p>\n<p>/g, '<br>')
.replace(/<p>/g, '')
.replace(/<\/p>/g, '');
}
// parse an integer/float and returns null if it's not an integer
export function toInt(number) {
if (number === '0') return 0;
return parseInt(number) || null |
<<<<<<<
/* Component: header shadow toggle */
new Material.Event.MatchMedia("(min-width: 1220px)",
new Material.Event.Listener(window, [
"scroll", "resize", "orientationchange"
], new Material.Header.Shadow("[data-md-component=container]")))
/* Component: tabs visibility toggle */
new Material.Event.Listener(window, [
"scroll", "resize", "orientationchange"
], new Material.Tabs.Toggle("[data-md-component=tabs]")).listen()
/* Component: sidebar container */
if (!Modernizr.csscalc)
new Material.Event.MatchMedia("(min-width: 960px)",
new Material.Event.Listener(window, [
"resize", "orientationchange"
], new Material.Sidebar.Container("[data-md-component=container]")))
=======
>>>>>>>
/* Component: header shadow toggle */
new Material.Event.MatchMedia("(min-width: 1220px)",
new Material.Event.Listener(window, [
"scroll", "resize", "orientationchange"
], new Material.Header.Shadow("[data-md-component=container]")))
/* Component: tabs visibility toggle */
new Material.Event.Listener(window, [
"scroll", "resize", "orientationchange"
], new Material.Tabs.Toggle("[data-md-component=tabs]")).listen() |
<<<<<<<
for (var i = 0; i < matches.length; i++) {
var leadingWhitespaceMatch = matches[i].match(/^\s*/);
var leadingWhitespace = null;
if (leadingWhitespaceMatch) {
leadingWhitespace = leadingWhitespaceMatch[0].replace("\n", "");
}
// Remove beginnings, endings and trim.
var includeCommand = matches[i]
.replace(/\s+/g, " ")
.replace(/(\/\/|\/\*|\#|<!--)(\s+)?=(\s+)?/g, "")
.replace(/(\*\/|-->)$/g, "")
.replace(/['"]/g, "")
.trim();
var split = includeCommand.split(" ");
var currentLine;
if (sourceMap) {
// get position of current match and get current line number
currentPos = content.indexOf(matches[i], currentPos);
currentLine = currentPos === -1 ? 0 : content.substr(0, currentPos).match(/^/mg).length;
// sometimes the line matches the leading \n and sometimes it doesn't. wierd.
// in case it does, increment the current line counter
if (leadingWhitespaceMatch[0][0] == '\n') currentLine++;
mapSelf(currentLine);
}
// SEARCHING STARTS HERE
// Split the directive and the path
var includeType = split[0];
// Use glob for file searching
var fileMatches = [];
var includePath = "";
if (includePaths != false && !isExplicitRelativePath(split[1])) {
// If includepaths are set, search in those folders
for (var y = 0; y < includePaths.length; y++) {
includePath = includePaths[y] + "/" + split[1];
var globResults = glob.sync(includePath, {mark: true});
fileMatches = fileMatches.concat(globResults);
}
}else{
// Otherwise search relatively
includePath = relativeBasePath + "/" + removeRelativePathPrefix(split[1]);
var globResults = glob.sync(includePath, {mark: true});
fileMatches = globResults;
}
=======
function processInclude(content, filePath, sourceMap, includedFiles) {
var matches = content.match(/^(\s+)?(\/\/|\/\*|\#|\<\!\-\-)(\s+)?=(\s+)?(include|require)(.+$)/mg);
var relativeBasePath = path.dirname(filePath);
>>>>>>>
function processInclude(content, filePath, sourceMap, includedFiles) {
var matches = content.match(/^(\s+)?(\/\/|\/\*|\#|\<\!\-\-)(\s+)?=(\s+)?(include|require)(.+$)/mg);
var relativeBasePath = path.dirname(filePath);
<<<<<<<
return {content: content, map: map ? map.toString() : null};
}
function unixStylePath(filePath) {
return filePath.replace(/\\/g, '/');
}
function isExplicitRelativePath(filePath) {
return filePath.indexOf('./') === 0;
}
function removeRelativePathPrefix(filePath) {
return filePath.replace(/^\.\//, '');
}
function addLeadingWhitespace(whitespace, string) {
return string.split("\n").map(function(line) {
return whitespace + line;
}).join("\n");
}
function fileNotFoundError(includePath) {
if (hardFail) {
throw new gutil.PluginError('gulp-include', 'No files found matching ' + includePath);
}else{
console.warn(
gutil.colors.yellow('WARN: ') +
gutil.colors.cyan('gulp-include') +
' - no files found matching ' + includePath
);
=======
function fileNotFoundError(includePath) {
if (hardFail) {
throw new PluginError('gulp-include', 'No files found matching ' + includePath);
} else {
console.warn(
colors.yellow('WARN: ') +
colors.cyan('gulp-include') +
' - no files found matching ' + includePath
);
}
>>>>>>>
function isExplicitRelativePath(filePath) {
return filePath.indexOf('./') === 0;
}
function removeRelativePathPrefix(filePath) {
return filePath.replace(/^\.\//, '');
}
function fileNotFoundError(includePath) {
if (hardFail) {
throw new PluginError('gulp-include', 'No files found matching ' + includePath);
} else {
console.warn(
colors.yellow('WARN: ') +
colors.cyan('gulp-include') +
' - no files found matching ' + includePath
);
} |
<<<<<<<
it("should work with html-comments", function(done) {
var file = new gutil.File({
base: "test/fixtures/",
path: "test/fixtures/html/basic-include.html",
contents: fs.readFileSync("test/fixtures/html/basic-include.html")
});
testInclude = include();
testInclude.on("data", function (newFile) {
should.exist(newFile);
should.exist(newFile.contents);
String(newFile.contents).should.equal(String(fs.readFileSync("test/expected/html/basic-include-output.html"), "utf8"))
done();
});
testInclude.write(file);
})
=======
it('should support source maps', function (done) {
gulp.src('test/fixtures/js/basic-include.js')
.pipe(sourcemaps.init())
.pipe(include())
.pipe(assert.length(1))
.pipe(assert.first(function (d) {
d.sourceMap.sources.should.have.length(3);
d.sourceMap.file.should.eql('basic-include.js');
d.sourceMap.sources.should.eql(['basic-include.js', 'deep_path/b.js', 'deep_path/deeper_path/c.js'])
}))
.pipe(assert.end(done));
});
>>>>>>>
it("should work with html-comments", function(done) {
var file = new gutil.File({
base: "test/fixtures/",
path: "test/fixtures/html/basic-include.html",
contents: fs.readFileSync("test/fixtures/html/basic-include.html")
});
testInclude = include();
testInclude.on("data", function (newFile) {
should.exist(newFile);
should.exist(newFile.contents);
String(newFile.contents).should.equal(String(fs.readFileSync("test/expected/html/basic-include-output.html"), "utf8"))
done();
});
testInclude.write(file);
})
it('should support source maps', function (done) {
gulp.src('test/fixtures/js/basic-include.js')
.pipe(sourcemaps.init())
.pipe(include())
.pipe(assert.length(1))
.pipe(assert.first(function (d) {
d.sourceMap.sources.should.have.length(3);
d.sourceMap.file.should.eql('basic-include.js');
d.sourceMap.sources.should.eql(['basic-include.js', 'deep_path/b.js', 'deep_path/deeper_path/c.js'])
}))
.pipe(assert.end(done));
}); |
<<<<<<<
//Constants
this.NETWORK_ID = 'loopback';
this.USER_ID = 'Test User'; //My userId
this.CLIENT_ID = 'Test User.0'; //My clientId
console.log("Loopback Social Provider");
var STATUS_CLIENT = freedom.social().STATUS_CLIENT;
=======
console.log("Loopback Social provider");
this.client_codes = freedom.social().STATUS_CLIENT;
this.net_codes = freedom.social().STATUS_NETWORK;
>>>>>>>
//Constants
this.NETWORK_ID = 'loopback';
this.USER_ID = 'Test User'; //My userId
this.CLIENT_ID = 'Test User.0'; //My clientId
this.client_codes = freedom.social().STATUS_CLIENT;
this.net_codes = freedom.social().STATUS_NETWORK;
console.log("Loopback Social Provider");
<<<<<<<
'clientId': this.CLIENT_ID,
'network': this.NETWORK_ID,
'status': STATUS_CLIENT["MESSAGEABLE"]
=======
'clientId': CLIENT_ID,
'network': NETWORK_ID,
'status': this.client_codes["MESSAGEABLE"]
>>>>>>>
'clientId': this.CLIENT_ID,
'network': this.NETWORK_ID,
'status': this.client_codes["MESSAGEABLE"]
<<<<<<<
'network': this.NETWORK_ID,
'status': STATUS_CLIENT["MESSAGEABLE"]
=======
'network': NETWORK_ID,
'status': this.client_codes["MESSAGEABLE"]
>>>>>>>
'network': this.NETWORK_ID,
'status': this.client_codes["MESSAGEABLE"]
<<<<<<<
LoopbackSocialProvider.prototype.makeOnStatus = function(stat) {
var STATUS_NETWORK = freedom.social().STATUS_NETWORK;
=======
LoopbackSocialProvider.prototype.makeOnStatus = function(stat) {
>>>>>>>
LoopbackSocialProvider.prototype.makeOnStatus = function(stat) {
<<<<<<<
network: this.NETWORK_ID,
userId: this.USER_ID,
clientId: this.CLIENT_ID,
status: STATUS_NETWORK[stat],
=======
network: NETWORK_ID,
userId: USER_ID,
clientId: CLIENT_ID,
status: this.net_codes[stat],
>>>>>>>
network: this.NETWORK_ID,
userId: this.USER_ID,
clientId: this.CLIENT_ID,
status: this.net_codes[stat],
<<<<<<<
network: this.NETWORK_ID,
status: STATUS_CLIENT[STATUSES[i]]
=======
network: NETWORK_ID,
status: this.client_codes[STATUSES[i]]
>>>>>>>
network: this.NETWORK_ID,
status: this.client_codes[STATUSES[i]] |
<<<<<<<
'login': {type: 'method', value: [{
'agent': 'string', //Name of the application
'version': 'string', //Version of application
'url': 'string', //URL of application
'interactive': 'bool', //If true, always prompt for login. If false, try with cached credentials
'rememberLogin': 'bool' //Cache the login credentials
}]},
=======
'login': {
type: 'method',
value: [{
'network': 'string', //Network name (as emitted by 'onStatus' events)
'agent': 'string', //Name of the application
'version': 'string', //Version of application
'url': 'string', //URL of application
'interactive': 'bool' //Prompt user for login if credentials not cached?
}],
ret: {
'network': 'string', // Name of the network (chosen by social provider)
'userId': 'string', // userId of myself on this network
'clientId': 'string', // clientId of my client on this network
'status': 'number', // One of the constants defined in 'STATUS_NETWORK'
'message': 'string' // More detailed message about status
}
},
>>>>>>>
'login': {
type: 'method',
value: [{
'agent': 'string', //Name of the application
'version': 'string', //Version of application
'url': 'string', //URL of application
'interactive': 'bool' //Prompt user for login if credentials not cached?
'rememberLogin': 'bool' //Cache the login credentials
}],
ret: {
'userId': 'string', // userId of myself on this network
'clientId': 'string', // clientId of my client on this network
'status': 'number', // One of the constants defined in 'STATUS'
'timestamp': 'number' // Timestamp of last received change to <client_state>
}
},
<<<<<<<
'getUsers': {type: 'method', value: []},
=======
'getRoster': {type: 'method', value: [], ret: "object"},
>>>>>>>
'getUsers': {type: 'method', value: [], ret: "object"},
<<<<<<<
'logout': {type: 'method', value: []},
=======
'logout': {type: 'method', value: [{
'network': 'string', // Network to log out of
'userId': 'string' // User to log out
}], ret: {
'network': 'string', // Name of the network (chosen by social provider)
'userId': 'string', // userId of myself on this network
'clientId': 'string', // clientId of my client on this network
'status': 'number', // One of the constants defined in 'STATUS_NETWORK'
'message': 'string' // More detailed message about status
}},
>>>>>>>
'logout': {type: 'method', value: []}, |
<<<<<<<
var providers = {
// "core": freedom.core(),
// "storage.shared": freedom.storageShared(),
// "storage.isolated": freedom.storageIsolated(),
// "transport.webrtc": freedom.transportWebrtc()
};
// We need to keep track of want events we are already listening for
// so that we don't send duplicate notifcations events the helper.
var listeningFor = {};
=======
var providers = {"core": freedom.core()};
var channels = {};
>>>>>>>
var listeningFor = {};
var providers = {"core": freedom.core()};
var channels = {};
<<<<<<<
});
freedom.on('listenForEvent', function(listenEventInfo) {
var providerName = listenEventInfo.provider;
var eventName = listenEventInfo.event;
var provider = providers[providerName];
if (!listeningFor[providerName][eventName]) {
provider.on(listenEventInfo.event, function (eventPayload) {
freedom.emit('eventFired', {provider: providerName,
event: eventName,
eventPayload: eventPayload});
});
listeningFor[providerName][eventName] = true;
}
=======
});
freedom.on("createChannel", function() {
//providers.core.createChannel().done(function(chan) {
freedom.core().createChannel().done(function(chan) {
channels[chan.identifier] = chan.channel;
chan.channel.on("message", function(msg){
freedom.emit("inFromChannel", {
chanId: chan.identifier,
message: msg
});
});
freedom.emit("initChannel", chan.identifier);
});
});
// action = {
// chanId: channel identifier,
// message: message to send
// }
freedom.on("outToChannel", function(action) {
channels[action.chanId].emit("message", action.message);
>>>>>>>
});
freedom.on('listenForEvent', function(listenEventInfo) {
var providerName = listenEventInfo.provider;
var eventName = listenEventInfo.event;
var provider = providers[providerName];
if (!listeningFor[providerName][eventName]) {
provider.on(listenEventInfo.event, function (eventPayload) {
freedom.emit('eventFired', {provider: providerName,
event: eventName,
eventPayload: eventPayload});
});
listeningFor[providerName][eventName] = true;
}
});
freedom.on("createChannel", function() {
//providers.core.createChannel().done(function(chan) {
freedom.core().createChannel().done(function(chan) {
channels[chan.identifier] = chan.channel;
chan.channel.on("message", function(msg){
freedom.emit("inFromChannel", {
chanId: chan.identifier,
message: msg
});
});
freedom.emit("initChannel", chan.identifier);
});
});
// action = {
// chanId: channel identifier,
// message: message to send
// }
freedom.on("outToChannel", function(action) {
channels[action.chanId].emit("message", action.message); |
<<<<<<<
var oauth = require('../../providers/core/core.oauth');
require('../../providers/oauth/oauth.localpageauth').register(oauth);
require('../../providers/oauth/oauth.remotepageauth').register(oauth);
providers.push(oauth);
=======
>>>>>>> |
<<<<<<<
this.seq++;
var opcode = 0x0E;
var serialized = this.serializer.serialize(opcode, value, '');
var request = makeRequestBuffer(opcode, key, serialized.extras, serialized.value, this.seq);
=======
this.incrSeq();
var request = makeRequestBuffer(0x0E, key, '', value, this.seq);
>>>>>>>
this.incrSeq();
var opcode = 0x0E;
var serialized = this.serializer.serialize(opcode, value, '');
var request = makeRequestBuffer(opcode, key, serialized.extras, serialized.value, this.seq);
<<<<<<<
this.seq++;
var opcode = 0x0E;
var serialized = this.serializer.serialize(opcode, value, '');
var request = makeRequestBuffer(opcode, key, serialized.extras, serialized.value, this.seq);
=======
this.incrSeq();
var request = makeRequestBuffer(0x0E, key, '', value, this.seq);
>>>>>>>
this.incrSeq();
var opcode = 0x0E;
var serialized = this.serializer.serialize(opcode, value, '');
var request = makeRequestBuffer(opcode, key, serialized.extras, serialized.value, this.seq); |
<<<<<<<
import * as doc from './doc.tests.js'
=======
>>>>>>>
import * as doc from './doc.tests.js'
<<<<<<<
map, array, text, xml, doc, encoding, undoredo, compatibility
=======
doc, map, array, text, xml, consistency, encoding, undoredo, compatibility
>>>>>>>
doc, map, array, text, xml, encoding, undoredo, compatibility |
<<<<<<<
EventEmitter.prototype.setMaxListeners = function(n) {
if (!util.isNumber(n) || n < 0 || isNaN(n))
=======
var defaultMaxListeners = 10;
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
if (typeof n !== 'number' || n < 0 || isNaN(n))
>>>>>>>
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
if (!util.isNumber(n) || n < 0 || isNaN(n))
<<<<<<<
EventEmitter.prototype.once = function(type, listener) {
if (!util.isFunction(listener))
=======
EventEmitter.prototype.once = function once(type, listener) {
if (typeof listener !== 'function')
>>>>>>>
EventEmitter.prototype.once = function once(type, listener) {
if (!util.isFunction(listener)) |
<<<<<<<
assert.equal(0xe6, b[19]);
// Test custom decode
function demoDecode(str) {
return str + str;
}
assert.deepEqual(
qs.parse('a=a&b=b&c=c', null, null, { decodeURIComponent: demoDecode }),
{ aa: 'aa', bb: 'bb', cc: 'cc' });
// Test custom encode
function demoEncode(str) {
return str[0];
}
var obj = { aa: 'aa', bb: 'bb', cc: 'cc' };
assert.equal(
qs.stringify(obj, null, null, { encodeURIComponent: demoEncode }),
'a=a&b=b&c=c');
=======
assert.equal(0xe6, b[19]);
// test overriding .unescape
var prevUnescape = qs.unescape;
qs.unescape = function (str) {
return str.replace(/o/g, '_');
};
assert.deepEqual(qs.parse('foo=bor'), {f__: 'b_r'});
qs.unescape = prevUnescape;
>>>>>>>
assert.equal(0xe6, b[19]);
// Test custom decode
function demoDecode(str) {
return str + str;
}
assert.deepEqual(
qs.parse('a=a&b=b&c=c', null, null, { decodeURIComponent: demoDecode }),
{ aa: 'aa', bb: 'bb', cc: 'cc' });
// Test custom encode
function demoEncode(str) {
return str[0];
}
var obj = { aa: 'aa', bb: 'bb', cc: 'cc' };
assert.equal(
qs.stringify(obj, null, null, { encodeURIComponent: demoEncode }),
'a=a&b=b&c=c');
// test overriding .unescape
var prevUnescape = qs.unescape;
qs.unescape = function (str) {
return str.replace(/o/g, '_');
};
assert.deepEqual(qs.parse('foo=bor'), {f__: 'b_r'});
qs.unescape = prevUnescape; |
<<<<<<<
return new Cipher(cipher, password);
this._binding = new binding.CipherBase(true);
=======
return new Cipher(cipher, password, options);
this._binding = new binding.Cipher;
>>>>>>>
return new Cipher(cipher, password, options);
this._binding = new binding.CipherBase(true);
<<<<<<<
return new Cipheriv(cipher, key, iv);
this._binding = new binding.CipherBase(true);
=======
return new Cipheriv(cipher, key, iv, options);
this._binding = new binding.Cipher();
>>>>>>>
return new Cipheriv(cipher, key, iv, options);
this._binding = new binding.CipherBase(true); |
<<<<<<<
applyTransactions()
=======
applyTransactions(0.5)
yield users[0].connector.flushAll()
>>>>>>>
applyTransactions(0.5)
<<<<<<<
yield g.garbageCollectAllUsers(users)
=======
// TODO: gc here????
yield wait(100)
>>>>>>>
yield wait(100)
<<<<<<<
yield wait(100)
=======
yield wait()
>>>>>>>
yield wait() |
<<<<<<<
// url: '//localhost:1234',
url: 'https://yjs-v13.herokuapp.com/',
// options: { transports: ['websocket'], upgrade: false }
=======
url: 'https://yjs-v13.herokuapp.com/'
>>>>>>>
// url: '//localhost:1234',
url: 'https://yjs-v13.herokuapp.com/'
// options: { transports: ['websocket'], upgrade: false }
<<<<<<<
textarea: 'Text'
}
=======
textarea: 'Text', // y.share.textarea is of type Y.Text
test: 'Array'
},
timeout: 5000 // reject if no connection was established within 5 seconds
>>>>>>>
textarea: 'Text'
},
timeout: 5000 // reject if no connection was established within 5 seconds |
<<<<<<<
=======
const checked_animation_delta_state = ({key, start_state, end_state, delta_state}) => {
// TODO: is it inconceivable that an animation could be defined
// with a tick that defines a transition from a
// numeric -> non-numeric type?
// e.g. Become does this
if (start_state !== undefined
&& end_state === undefined
&& delta_state === undefined) {
return {}
}
if (typeof(start_state) === 'number') {
if ([start_state, end_state, delta_state].filter(a => typeof(a) == 'number').length < 2) {
console.log({start_state, end_state, delta_state})
throw 'Need at least 2/3 to calculate animation: start_state, end_state, delta_state'
}
if (start_state === undefined)
start_state = end_state - delta_state
if (end_state === undefined)
end_state = start_state + delta_state
if (delta_state === undefined)
delta_state = end_state - start_state
if (start_state + delta_state != end_state) {
console.log({start_state, end_state, delta_state})
throw 'Conflicting values, Animation end_state != start + delta_state'
}
return {start_state, end_state, delta_state}
} else if (typeof(start_state) === 'object') {
if (end_state === undefined) end_state = {}
if (delta_state === undefined) delta_state = {}
if (key !== undefined)
return checked_animation_delta_state({
start_state: start_state[key],
end_state: end_state[key],
delta_state: delta_state[key]
})
console.log({key, start_state, end_state, delta_state})
if (typeof(start_state) !== 'object'
|| typeof(end_state) !== 'object'
|| typeof(delta_state) !== 'object') {
throw 'Incompatible types passed as {start_state, end_state, delta_state}, must all be objects or numbers'
}
let keys = Object.keys(start_state)
if (!keys.length) keys = Object.keys(end_state)
if (!keys.length) keys = Object.keys(delta_state)
return keys.reduce((acc, key) => {
// Recursively check that deltas in state add up
const delta_states = checked_animation_delta_state({
start_state: start_state[key],
end_state: end_state[key],
delta_state: delta_state[key]
})
acc.start_state[key] = delta_states.start_state
acc.end_state[key] = delta_states.end_state
acc.delta_state[key] = delta_states.delta_state
return acc
}, {start_state: {}, end_state: {}, delta_state: {}})
} else {
return {start_state, end_state, delta_state}
}
}
>>>>>>>
<<<<<<<
=======
let animation = {
type: type ? type : 'ANIMATE',
path,
split_path: path.split('/').slice(1),
start_time, end_time, duration,
start_state, end_state, delta_state,
curve,
unit,
tick,
}
>>>>>>>
<<<<<<<
[_start_time,
_end_time,
_duration] = startEndDeltaCheck(start_time, end_time, duration)
[_start_state,
_end_state,
_delta_state] = startEndDeltaCheck(start_state, end_state, delta_state)
=======
try {
if (!animation.tick) {
animation.tick = tick_func(animation)
}
//console.log({start_state, end_state, delta_state})
animation = {
...animation,
...checked_animation_delta_state({start_state, end_state, delta_state})
}
>>>>>>>
[_start_time,
_end_time,
_duration] = startEndDeltaCheck(start_time, end_time, duration)
[_start_state,
_end_state,
_delta_state] = startEndDeltaCheck(start_state, end_state, delta_state)
_type = type ? type : 'ANIMATE'
_split_path = path.split('/').slice(1)
let animation = {
type: _type,
split_path: _split_path,
start_time: _start_time,
end_time: _end_time,
duration: _duration,
start_state: _start_state,
end_state: _end_state,
delta_state: _delta_state,
path: path,
curve: curve,
unit: unit,
} |
<<<<<<<
lockDuration?: number = 5000,
lockRenewTime?: number = lockDuration / 2,
stalledInterval?: number = 5000,
=======
lockDuration?: number = 30000,
lockRenewTime?: number = lockDuration / 2,
stalledInterval?: number = 30000,
>>>>>>>
lockDuration?: number = 30000,
lockRenewTime?: number = lockDuration / 2,
stalledInterval?: number = 30000,
<<<<<<<
=======
// emit ready when redis connections ready
var initializers = [this.client, this.eclient].map(function (client) {
return new Promise(function(resolve, reject) {
client.once('ready', resolve);
client.once('error', reject);
});
});
var events = [
'delayed',
'paused',
'resumed',
'added'
];
this._initializing = Promise.all(initializers).then(function(){
return Promise.all(events.map(function(event){
return _this.eclient.subscribe(_this.toKey(event))
})).then(function(){
return commands(_this.client);
});
}).then(function(){
debuglog(name + ' queue ready');
_this.emit('ready');
}, function(err){
_this.emit('error', err, 'Error initializing queue');
});
>>>>>>> |
<<<<<<<
// if (shouldAnimate(animations.queue, new_timestamp, this.time.speed)) {
this.ticker(::this.tick)
// } else {
// this.animating = false
// }
=======
>>>>>>> |
<<<<<<<
var publishHappened = false;
client.on('ready', function () {
client.on("message", function(channel, message) {
expect(parseInt(message, 10)).to.be.a('number');
publishHappened = true;
});
client.subscribe(queue.toKey("jobs"));
});
=======
>>>>>>>
var publishHappened = false;
client.on('ready', function () {
client.on("message", function(channel, message) {
expect(parseInt(message, 10)).to.be.a('number');
publishHappened = true;
});
client.subscribe(queue.toKey("jobs"));
}); |
<<<<<<<
var paused = queue.getJobCountByTypes(['paused','wait', 'delayed']).then(function (count) {
expect(count).to.be.eql(10);
=======
var paused = queue.getJobCountByTypes(['paused','wait','delayed']).then(function (count) {
expect(count).to.be(10);
>>>>>>>
var paused = queue.getJobCountByTypes(['paused','wait', 'delayed']).then(function (count) {
expect(count).to.be.eql(10);
<<<<<<<
queue.getJobs('completed', 'ZSET').then(function (jobs) {
expect(jobs).to.be.an('array').that.have.length(3);
expect(jobs[0]).to.have.property('finishedOn');
expect(jobs[1]).to.have.property('finishedOn');
expect(jobs[2]).to.have.property('finishedOn');
expect(jobs[0]).to.have.property('processedOn');
expect(jobs[1]).to.have.property('processedOn');
expect(jobs[2]).to.have.property('processedOn');
=======
queue.getJobs('completed').then(function (jobs) {
expect(jobs).to.be.an(Array);
expect(jobs).to.have.length(3);
>>>>>>>
queue.getJobs('completed').then(function (jobs) {
expect(jobs).to.be.an('array').that.have.length(3);
expect(jobs[0]).to.have.property('finishedOn');
expect(jobs[1]).to.have.property('finishedOn');
expect(jobs[2]).to.have.property('finishedOn');
expect(jobs[0]).to.have.property('processedOn');
expect(jobs[1]).to.have.property('processedOn');
expect(jobs[2]).to.have.property('processedOn');
<<<<<<<
queue.getJobs('failed', 'ZSET').then(function (jobs) {
expect(jobs).to.be.an('array').that.has.length(3);
expect(jobs[0]).to.have.property('finishedOn');
expect(jobs[1]).to.have.property('finishedOn');
expect(jobs[2]).to.have.property('finishedOn');
expect(jobs[0]).to.have.property('processedOn');
expect(jobs[1]).to.have.property('processedOn');
expect(jobs[2]).to.have.property('processedOn');
=======
queue.getJobs('failed').then(function (jobs) {
expect(jobs).to.be.an(Array);
expect(jobs).to.have.length(3);
>>>>>>>
queue.getJobs('failed').then(function (jobs) {
expect(jobs).to.be.an('array').that.has.length(3);
expect(jobs[0]).to.have.property('finishedOn');
expect(jobs[1]).to.have.property('finishedOn');
expect(jobs[2]).to.have.property('finishedOn');
expect(jobs[0]).to.have.property('processedOn');
expect(jobs[1]).to.have.property('processedOn');
expect(jobs[2]).to.have.property('processedOn');
<<<<<<<
queue.getJobs('completed', 'ZSET', true, 1, 2).then(function (jobs) {
expect(jobs).to.be.an('array').that.has.length(2);
=======
queue.getJobs('completed', 1, 2, true).then(function (jobs) {
expect(jobs).to.be.an(Array);
expect(jobs).to.have.length(2);
>>>>>>>
queue.getJobs('completed', 1, 2, true).then(function (jobs) {
expect(jobs).to.be.an('array').that.has.length(2);
<<<<<<<
queue.getJobs('completed', 'ZSET', true, -3, -1).then(function (jobs) {
expect(jobs).to.be.an('array').that.has.length(3);
=======
queue.getJobs('completed', -3, -1, true).then(function (jobs) {
expect(jobs).to.be.an(Array);
expect(jobs).to.have.length(3);
>>>>>>>
queue.getJobs('completed', -3, -1, true).then(function (jobs) {
expect(jobs).to.be.an('array').that.has.length(3);
<<<<<<<
queue.getJobs('completed', 'ZSET', true, -300, 99999).then(function (jobs) {
expect(jobs).to.be.an('array').that.has.length(3);
=======
queue.getJobs('completed', -300, 99999, true).then(function (jobs) {
expect(jobs).to.be.an(Array);
expect(jobs).to.have.length(3);
>>>>>>>
queue.getJobs('completed', -300, 99999, true).then(function (jobs) {
expect(jobs).to.be.an('array').that.has.length(3); |
<<<<<<<
clearInterval(this.refreshTheme)
=======
eventEmitter.off('dispatch:push', this.changeRoutePush.bind(this))
}
changeRoutePush(event, destination) {
const { dispatch } = this.props
dispatch(push(destination))
>>>>>>>
eventEmitter.off('dispatch:push', this.changeRoutePush.bind(this))
clearInterval(this.refreshTheme)
}
changeRoutePush(event, destination) {
const { dispatch } = this.props
dispatch(push(destination)) |
<<<<<<<
app.post('/:org/:repo/collaborators/', middleware.requireParams(['email']), api_collaborators.post);
app.delete('/:org/:repo/collaborators/', middleware.requireParams(['email']), api_collaborators.del);
=======
app.post('/:org/:repo/collaborators/', middleware.requireBody(['email']), api_collaborators.post);
app.delete('/:org/:repo/collaborators/', middleware.requireBody(['email']), api_collaborators.del);
>>>>>>>
app.post('/:org/:repo/collaborators/', middleware.requireBody(['email']), api_collaborators.post);
app.delete('/:org/:repo/collaborators/', middleware.requireBody(['email']), api_collaborators.del);
<<<<<<<
app.use('/:org/:repo/branches/', api_branches);
// TODO: remove after refactroing
//app.all('/:org/:repo/branches/',
//auth.requireUserOr401,
//middleware.project,
//auth.requireProjectAdmin)
//app.post('/:org/:repo/branches/', middleware.requireParams(['name']), api_branches.post);
//app.put('/:org/:repo/branches/', middleware.requireParams(['branches']), api_branches.put);
//app.delete('/:org/:repo/branches/', middleware.requireParams(['name']), api_branches.del);
=======
app.all('/:org/:repo/branches/',
auth.requireUserOr401,
middleware.project,
auth.requireProjectAdmin)
app.post('/:org/:repo/branches/', middleware.requireBody(['name']), api_branches.post);
app.put('/:org/:repo/branches/', middleware.requireBody(['branches']), api_branches.put);
app.delete('/:org/:repo/branches/', middleware.requireBody(['name']), api_branches.del);
>>>>>>>
app.use('/:org/:repo/branches/', api_branches);
// TODO: remove after refactroing
//app.all('/:org/:repo/branches/',
//auth.requireUserOr401,
//middleware.project,
//auth.requireProjectAdmin)
//app.post('/:org/:repo/branches/', middleware.requireBody(['name']), api_branches.post);
//app.put('/:org/:repo/branches/', middleware.requireBody(['branches']), api_branches.put);
//app.delete('/:org/:repo/branches/', middleware.requireBody(['name']), api_branches.del); |
<<<<<<<
it('should not return error if uploadId exists on multipart abort call',
done => {
_createAndAbortMpu(false, err => {
assert.strictEqual(err, null, `Expected no error, got ${err}`);
=======
it('should not return error if mpu exists with uploadId and at least ' +
'one part', done => {
_createAndAbortMpu(true, false, 'us-east-1', err => {
assert.strictEqual(err, null, `Expected no error, got ${err}`);
>>>>>>>
it('should not return error if mpu exists with uploadId and at least ' +
'one part', done => {
_createAndAbortMpu(true, false, 'us-east-1', err => {
assert.strictEqual(err, null, `Expected no error, got ${err}`);
<<<<<<<
'multipart abort call', done => {
_createAndAbortMpu(true, err => {
assert.strictEqual(err, null, `Expected no error, got ${err}`);
=======
'multipart abort call, in region other than us-east-1', done => {
_createAndAbortMpu(true, true, 'us-west-1', err => {
assert.strictEqual(err, undefined, `Expected no error, got ${err}`);
>>>>>>>
'multipart abort call, in region other than us-east-1', done => {
_createAndAbortMpu(true, true, 'us-west-1', err => {
assert.strictEqual(err, null, `Expected no error, got ${err}`); |
<<<<<<<
log.debug('routing request', {
method: 'routeBackbeat',
url: request.url,
});
_normalizeBackbeatRequest(request);
const requestContexts = prepareRequestContexts('objectReplicate', request);
// proxy api requests to Backbeat API server
if (request.resourceType === 'api') {
if (!config.backbeat) {
log.debug('unable to proxy backbeat api request', {
backbeatConfig: config.backbeat,
});
return responseJSONBody(errors.MethodNotAllowed, null, response,
log);
}
const path = request.url.replace('/_/backbeat/api', '/_/');
const { host, port } = config.backbeat;
const target = `http://${host}:${port}${path}`;
return auth.server.doAuth(request, log, (err, userInfo) => {
if (err) {
log.debug('authentication error', {
error: err,
method: request.method,
bucketName: request.bucketName,
objectKey: request.objectKey,
});
return responseJSONBody(err, null, response, log);
}
// FIXME for now, any authenticated user can access API
// routes. We should introduce admin accounts or accounts
// with admin privileges, and restrict access to those
// only.
if (userInfo.getCanonicalID() === constants.publicId) {
log.debug('unauthenticated access to API routes', {
method: request.method,
bucketName: request.bucketName,
objectKey: request.objectKey,
});
return responseJSONBody(
errors.AccessDenied, null, response, log);
}
return backbeatProxy.web(request, response, { target }, err => {
log.error('error proxying request to api server',
{ error: err.message });
return responseJSONBody(errors.ServiceUnavailable, null,
response, log);
});
}, 's3', requestContexts);
}
const useMultipleBackend =
request.resourceType.startsWith('multiplebackend');
const invalidRequest =
(!request.resourceType ||
(_isObjectRequest(request) &&
(!request.bucketName || !request.objectKey)) ||
(!request.query.operation &&
request.resourceType === 'multiplebackenddata'));
const invalidRoute =
(backbeatRoutes[request.method] === undefined ||
backbeatRoutes[request.method][request.resourceType] === undefined ||
(backbeatRoutes[request.method][request.resourceType]
[request.query.operation] === undefined &&
request.resourceType === 'multiplebackenddata'));
if (invalidRequest || invalidRoute) {
log.debug(invalidRequest ? 'invalid request' : 'no such route', {
method: request.method, bucketName: request.bucketName,
objectKey: request.objectKey, resourceType: request.resourceType,
=======
log.debug('routing request', { method: 'routeBackbeat' });
normalizeBackbeatRequest(request);
const useMultipleBackend = request.resourceType === 'multiplebackenddata';
const invalidRequest = (!request.bucketName ||
!request.objectKey ||
!request.resourceType ||
(!request.query.operation && useMultipleBackend));
log.addDefaultFields({
bucketName: request.bucketName,
objectKey: request.objectKey,
bytesReceived: request.parsedContentLength || 0,
bodyLength: parseInt(request.headers['content-length'], 10) || 0,
});
if (invalidRequest) {
log.debug('invalid request', {
method: request.method,
resourceType: request.resourceType,
>>>>>>>
log.debug('routing request', {
method: 'routeBackbeat',
url: request.url,
});
_normalizeBackbeatRequest(request);
const requestContexts = prepareRequestContexts('objectReplicate', request);
// proxy api requests to Backbeat API server
if (request.resourceType === 'api') {
if (!config.backbeat) {
log.debug('unable to proxy backbeat api request', {
backbeatConfig: config.backbeat,
});
return responseJSONBody(errors.MethodNotAllowed, null, response,
log);
}
const path = request.url.replace('/_/backbeat/api', '/_/');
const { host, port } = config.backbeat;
const target = `http://${host}:${port}${path}`;
return auth.server.doAuth(request, log, (err, userInfo) => {
if (err) {
log.debug('authentication error', {
error: err,
method: request.method,
bucketName: request.bucketName,
objectKey: request.objectKey,
});
return responseJSONBody(err, null, response, log);
}
// FIXME for now, any authenticated user can access API
// routes. We should introduce admin accounts or accounts
// with admin privileges, and restrict access to those
// only.
if (userInfo.getCanonicalID() === constants.publicId) {
log.debug('unauthenticated access to API routes', {
method: request.method,
bucketName: request.bucketName,
objectKey: request.objectKey,
});
return responseJSONBody(
errors.AccessDenied, null, response, log);
}
return backbeatProxy.web(request, response, { target }, err => {
log.error('error proxying request to api server',
{ error: err.message });
return responseJSONBody(errors.ServiceUnavailable, null,
response, log);
});
}, 's3', requestContexts);
}
const useMultipleBackend =
request.resourceType.startsWith('multiplebackend');
const invalidRequest =
(!request.resourceType ||
(_isObjectRequest(request) &&
(!request.bucketName || !request.objectKey)) ||
(!request.query.operation &&
request.resourceType === 'multiplebackenddata'));
const invalidRoute =
(backbeatRoutes[request.method] === undefined ||
backbeatRoutes[request.method][request.resourceType] === undefined ||
(backbeatRoutes[request.method][request.resourceType]
[request.query.operation] === undefined &&
request.resourceType === 'multiplebackenddata'));
log.addDefaultFields({
bucketName: request.bucketName,
objectKey: request.objectKey,
bytesReceived: request.parsedContentLength || 0,
bodyLength: parseInt(request.headers['content-length'], 10) || 0,
});
if (invalidRequest || invalidRoute) {
log.debug(invalidRequest ? 'invalid request' : 'no such route', {
method: request.method,
resourceType: request.resourceType, |
<<<<<<<
router.route('/password')
.post(function(req, res) {
if (req.user !== undefined) {
console.log("password change by " + req.user.email);
}
var password = req.param('password');
if (password.length < 6) {
return res.status(400).json({
status:"error",
errors:[{"message":"password must be at least 6 characters long"}]
});
}
req.user.password = password;
req.user.save(function(err, user_obj) {
if (err) {
throw err;
}
email.notify_password_change(req.user);
res.json({
status: "ok",
errors:[]
});
});
=======
exports.account_password = function(req, res)
{
if (req.user !== undefined) {
console.log("password change by " + req.user.email);
}
var password = req.body.password;
if (password.length < 6) {
res.statusCode = 400;
res.end(JSON.stringify({status:"error",
errors:[{"message":"password must be at least 6 characters long"}]}));
return;
}
req.user.password = password;
req.user.save(function(err, user_obj) {
if (err) throw err;
email.notify_password_change(req.user);
res.end(JSON.stringify({status:"ok", errors:[]}));
>>>>>>>
router.route('/password')
.post(function(req, res) {
if (req.user !== undefined) {
console.log("password change by " + req.user.email);
}
var password = req.body.password;
if (password.length < 6) {
return res.status(400).json({
status:"error",
errors:[{"message":"password must be at least 6 characters long"}]
});
}
req.user.password = password;
req.user.save(function(err, user_obj) {
if (err) {
throw err;
}
email.notify_password_change(req.user);
res.json({
status: "ok",
errors:[]
});
});
<<<<<<<
router.route('/email')
.post(function(req, res) {
var newEmail = req.params.email;
if (!validator.isEmail(newEmail)) {
return res.status(400).json({
=======
exports.account_email = function(req, res) {
var newEmail = req.body.email;
if (!validator.isEmail(newEmail)) {
res.statusCode = 400;
res.end(JSON.stringify({
status:"error",
errors:[{"message":"email is invalid"}]}));
return;
}
console.log("email change from " + req.user.email + " to " + newEmail);
var oldEmail = req.user.email;
req.user.email = newEmail;
req.user.save(function(err, user_obj) {
if (err) {
res.statusCode = 400;
return res.end(JSON.stringify({
>>>>>>>
router.route('/email')
.post(function(req, res) {
var newEmail = req.body.email;
if (!validator.isEmail(newEmail)) {
return res.status(400).json({ |
<<<<<<<
function _storeInMDandDeleteData(bucketName, objMD, dataGetInfo, cipherBundle,
=======
function _storeInMDandDeleteData(bucketName, dataGetInfo,
>>>>>>>
function _storeInMDandDeleteData(bucketName, dataGetInfo, cipherBundle,
<<<<<<<
services.metadataStoreObject(bucketName, objMD, dataGetInfo,
cipherBundle, metadataStoreParams, (err, contentMD5) => {
=======
services.metadataStoreObject(bucketName, dataGetInfo,
metadataStoreParams, (err, contentMD5) => {
>>>>>>>
services.metadataStoreObject(bucketName, dataGetInfo,
cipherBundle, metadataStoreParams, (err, contentMD5) => {
<<<<<<<
return _storeInMDandDeleteData(
bucketName, objMD, dataGetInfoArr, cipherBundle,
metadataStoreParams, dataToDelete,
logger.newRequestLoggerFromSerializedUids(
log.getSerializedUids()), callback);
=======
return _storeInMDandDeleteData(bucketName,
dataGetInfoArr, metadataStoreParams, dataToDelete,
logger.newRequestLoggerFromSerializedUids(log
.getSerializedUids()), callback);
>>>>>>>
return _storeInMDandDeleteData(
bucketName, dataGetInfoArr, cipherBundle,
metadataStoreParams, dataToDelete,
logger.newRequestLoggerFromSerializedUids(
log.getSerializedUids()), callback);
<<<<<<<
return _storeInMDandDeleteData(bucketName, objMD, dataGetInfo, cipherBundle,
=======
return _storeInMDandDeleteData(bucketName, dataGetInfo,
>>>>>>>
return _storeInMDandDeleteData(bucketName, dataGetInfo, cipherBundle, |
<<<<<<<
const objectLockValidationError
= validateHeaders(bucket, headers, log);
if (objectLockValidationError) {
return next(objectLockValidationError);
}
=======
writeContinue(request, request._response);
>>>>>>>
const objectLockValidationError
= validateHeaders(bucket, headers, log);
if (objectLockValidationError) {
return next(objectLockValidationError);
}
writeContinue(request, request._response); |
<<<<<<<
// TODO push metric for objectPutCopyPart
// pushMetric('putObjectCopyPart', log, {
// bucket: destBucketName,
// keys: [objectKey],
// });
monitoring.promMetrics(
'PUT', destBucketName, '200', 'putObjectCopyPart');
=======
pushMetric('uploadPartCopy', log, {
authInfo,
bucket: destBucketName,
keys: [destObjectKey],
newByteLength: copyObjectSize,
oldByteLength: prevObjectSize,
});
>>>>>>>
pushMetric('uploadPartCopy', log, {
authInfo,
bucket: destBucketName,
keys: [destObjectKey],
newByteLength: copyObjectSize,
oldByteLength: prevObjectSize,
});
monitoring.promMetrics(
'PUT', destBucketName, '200', 'putObjectCopyPart'); |
<<<<<<<
const invalidMultiObjectDelReq = request.query.delete !== undefined
&& request.bucketName === undefined;
if (invalidMultiObjectDelReq) {
return routesUtils.responseNoBody(errors.MethodNotAllowed, null,
response, null, log);
}
request.post = '';
=======
>>>>>>>
const invalidMultiObjectDelReq = request.query.delete !== undefined
&& request.bucketName === undefined;
if (invalidMultiObjectDelReq) {
return routesUtils.responseNoBody(errors.MethodNotAllowed, null,
response, null, log);
}
request.post = '';
<<<<<<<
if (request.query.uploads !== undefined) {
// POST multipart upload
api.callApiMethod('initiateMultipartUpload', request, log,
=======
if (postLength > MAX_POST_LENGTH) {
log.error('body length is too long for request type',
{ postLength });
return routesUtils.responseXMLBody(errors.InvalidRequest, null,
response, log);
}
// Convert array of post buffers into one string
request.post = Buffer.concat(post, postLength).toString();
// POST initiate multipart upload
if (request.query.uploads !== undefined) {
return api.callApiMethod('initiateMultipartUpload', request, log,
>>>>>>>
if (postLength > MAX_POST_LENGTH) {
log.error('body length is too long for request type',
{ postLength });
return routesUtils.responseXMLBody(errors.InvalidRequest, null,
response, log);
}
// Convert array of post buffers into one string
request.post = Buffer.concat(post, postLength).toString();
// POST initiate multipart upload
if (request.query.uploads !== undefined) {
return api.callApiMethod('initiateMultipartUpload', request, log,
<<<<<<<
} else if (request.query.delete !== undefined) {
// POST multiObjectDelete
api.callApiMethod('multiObjectDelete', request, log,
(err, xml, totalDeletedContentLength, numOfObjects) => {
pushMetrics(err, log, utapi, 'multiObjectDelete',
request.bucketName, totalDeletedContentLength,
numOfObjects);
return routesUtils.responseXMLBody(err, xml, response,
log);
});
} else {
routesUtils.responseNoBody(errors.NotImplemented, null, response,
200, log);
=======
>>>>>>>
}
// POST multiObjectDelete
if (request.query.delete !== undefined) {
return api.callApiMethod('multiObjectDelete', request, log,
(err, xml, totalDeletedContentLength, numOfObjects) => {
pushMetrics(err, log, utapi, 'multiObjectDelete',
request.bucketName, totalDeletedContentLength,
numOfObjects);
return routesUtils.responseXMLBody(err, xml, response,
log);
}); |
<<<<<<<
require('arsenal').storage.metadata.file.MetadataFileServer;
=======
require('arsenal').storage.metadata.MetadataFileServer;
const logger = require('./lib/utilities/logger');
process.on('uncaughtException', err => {
logger.fatal('caught error', {
error: err.message,
stack: err.stack,
workerId: this.worker ? this.worker.id : undefined,
workerPid: this.worker ? this.worker.process.pid : undefined,
});
process.exit(1);
});
>>>>>>>
require('arsenal').storage.metadata.file.MetadataFileServer;
const logger = require('./lib/utilities/logger');
process.on('uncaughtException', err => {
logger.fatal('caught error', {
error: err.message,
stack: err.stack,
workerId: this.worker ? this.worker.id : undefined,
workerPid: this.worker ? this.worker.process.pid : undefined,
});
process.exit(1);
}); |
<<<<<<<
const { isBucketAuthorized } = require('./apiUtils/authorization/aclChecks');
const monitoring = require('../utilities/monitoringHandler');
=======
>>>>>>>
const monitoring = require('../utilities/monitoringHandler'); |
<<<<<<<
const monitoring = require('../utilities/monitoringHandler');
const requestUtils = require('../utilities/requestUtils');
=======
const { config } = require('../Config');
const requestUtils = policies.requestUtils;
>>>>>>>
const monitoring = require('../utilities/monitoringHandler');
const { config } = require('../Config');
const requestUtils = policies.requestUtils; |
<<<<<<<
const utapiConfig = _config.utapi &&
Object.assign({}, _config.utapi, { redis: _config.redis });
const utapi = new UtapiClient(utapiConfig); // setup utapi client
=======
// setup utapi client
let utapiConfig;
if (utapiVersion === 1 && _config.utapi) {
utapiConfig = Object.assign({}, _config.utapi);
} else if (utapiVersion === 2) {
utapiConfig = Object.assign({ tls: _config.https }, _config.utapi || {});
}
const utapi = new UtapiClient(utapiConfig);
>>>>>>>
// setup utapi client
let utapiConfig;
if (utapiVersion === 1 && _config.utapi) {
utapiConfig = Object.assign({}, _config.utapi, { redis: _config.redis });
} else if (utapiVersion === 2) {
utapiConfig = Object.assign({ tls: _config.https }, _config.utapi || {});
}
const utapi = new UtapiClient(utapiConfig); |
<<<<<<<
* @param {WebsiteConfiguration} [websiteConfiguration] - website
* configuration
=======
* @param {string} locationConstraint - locationConstraint for bucket
>>>>>>>
* @param {WebsiteConfiguration} [websiteConfiguration] - website
* configuration
* @param {string} locationConstraint - locationConstraint for bucket
<<<<<<<
serverSideEncryption, versioningConfiguration,
websiteConfiguration) {
=======
serverSideEncryption, versioningConfiguration,
locationConstraint) {
>>>>>>>
serverSideEncryption, versioningConfiguration,
websiteConfiguration, locationConstraint) {
<<<<<<<
if (websiteConfiguration) {
assert(websiteConfiguration instanceof WebsiteConfiguration);
const { indexDocument, errorDocument, redirectAllRequestsTo,
routingRules } = websiteConfiguration;
assert(indexDocument === undefined ||
typeof indexDocument === 'string');
assert(errorDocument === undefined ||
typeof errorDocument === 'string');
assert(redirectAllRequestsTo === undefined ||
typeof redirectAllRequestsTo === 'object');
assert(routingRules === undefined ||
Array.isArray(routingRules));
}
=======
if (locationConstraint) {
assert.strictEqual(typeof locationConstraint, 'string');
}
>>>>>>>
if (websiteConfiguration) {
assert(websiteConfiguration instanceof WebsiteConfiguration);
const { indexDocument, errorDocument, redirectAllRequestsTo,
routingRules } = websiteConfiguration;
assert(indexDocument === undefined ||
typeof indexDocument === 'string');
assert(errorDocument === undefined ||
typeof errorDocument === 'string');
assert(redirectAllRequestsTo === undefined ||
typeof redirectAllRequestsTo === 'object');
assert(routingRules === undefined ||
Array.isArray(routingRules));
}
if (locationConstraint) {
assert.strictEqual(typeof locationConstraint, 'string');
}
<<<<<<<
this._websiteConfiguration = websiteConfiguration || null;
=======
this._locationConstraint = locationConstraint || null;
>>>>>>>
this._websiteConfiguration = websiteConfiguration || null;
this._locationConstraint = locationConstraint || null;
<<<<<<<
obj.versioningConfiguration, websiteConfig);
=======
obj.versioningConfiguration, obj.locationConstraint);
>>>>>>>
obj.versioningConfiguration, websiteConfig, obj.locationConstraint);
<<<<<<<
data._versioningConfiguration, data._websiteConfiguration);
=======
data._versioningConfiguration, data._locationConstraint);
>>>>>>>
data._versioningConfiguration, data._websiteConfiguration,
data._locationConstraint); |
<<<<<<<
const monitoring = require('../utilities/monitoringHandler');
const { data } = require('../data/wrapper');
const applyZenkoUserMD = require('./apiUtils/object/applyZenkoUserMD');
=======
const { config } = require('../Config');
const multipleBackendGateway = require('../data/multipleBackendGateway');
const checkObjectEncryption = require('./apiUtils/object/checkEncryption');
const externalVersioningErrorMessage = 'We do not currently support putting ' +
'a versioned object to a location-constraint of type Azure.';
>>>>>>>
const monitoring = require('../utilities/monitoringHandler');
const { data } = require('../data/wrapper');
const applyZenkoUserMD = require('./apiUtils/object/applyZenkoUserMD');
const checkObjectEncryption = require('./apiUtils/object/checkEncryption'); |
<<<<<<<
=======
const { ds } = require('../../../lib/data/in_memory/backend');
const metastore = require('../../../lib/metadata/in_memory/backend');
>>>>>>> |
<<<<<<<
const { auth, errors } = require('arsenal');
const async = require('async');
=======
const { auth, errors, policies } = require('arsenal');
>>>>>>>
const { auth, errors, policies } = require('arsenal');
const async = require('async');
<<<<<<<
if (tagAuthResults) {
const checkedResults = checkAuthResults(tagAuthResults);
if (checkedResults instanceof Error) {
return callback(checkedResults);
=======
const authNames = { accountName: userInfo.getAccountDisplayName() };
if (userInfo.isRequesterAnIAMUser()) {
authNames.userName = userInfo.getIAMdisplayName();
}
log.addDefaultFields(authNames);
if (authorizationResults) {
if (apiMethod === 'objectGet') {
// first item checks s3:GetObject(Version) action
if (!authorizationResults[0].isAllowed) {
log.trace('get object authorization denial from Vault');
return callback(errors.AccessDenied);
}
// second item checks s3:GetObject(Version)Tagging action
if (!authorizationResults[1].isAllowed) {
log.trace('get tagging authorization denial ' +
'from Vault');
returnTagCount = false;
}
} else {
for (let i = 0; i < authorizationResults.length; i++) {
if (!authorizationResults[i].isAllowed) {
log.trace('authorization denial from Vault');
return callback(errors.AccessDenied);
}
}
>>>>>>>
const authNames = { accountName: userInfo.getAccountDisplayName() };
if (userInfo.isRequesterAnIAMUser()) {
authNames.userName = userInfo.getIAMdisplayName();
}
log.addDefaultFields(authNames);
if (tagAuthResults) {
const checkedResults = checkAuthResults(tagAuthResults);
if (checkedResults instanceof Error) {
return callback(checkedResults); |
<<<<<<<
// hierarchy
require('./src/transform/hierarchy/treemap');
=======
require('./src/transform/geo/region');
>>>>>>>
require('./src/transform/geo/region');
// hierarchy
require('./src/transform/hierarchy/treemap'); |
<<<<<<<
locationConstraint, log, err => {
if (err) {
return callback(err);
}
pushMetric('createBucket', log, {
bucket: bucketName,
});
return callback();
});
=======
locationConstraint, config.usEastBehavior, log, callback);
>>>>>>>
locationConstraint, config.usEastBehavior, log, err => {
if (err) {
return callback(err);
}
pushMetric('createBucket', log, {
bucket: bucketName,
});
return callback();
}); |
<<<<<<<
const { isManagementAgentUsed } = require('./agentClient');
=======
const { reshapeExceptionError } = arsenal.errorUtils;
>>>>>>>
const { reshapeExceptionError } = arsenal.errorUtils;
const { isManagementAgentUsed } = require('./agentClient'); |
<<<<<<<
const { config } = require('../Config');
const monitoring = require('../utilities/monitoringHandler');
=======
const { getPartCountFromMd5 } = require('./apiUtils/object/partInfo');
>>>>>>>
const { config } = require('../Config');
const monitoring = require('../utilities/monitoringHandler');
const { getPartCountFromMd5 } = require('./apiUtils/object/partInfo'); |
<<<<<<<
it('should add the Accept-Ranges header', () => {
const headers = collectResponseHeaders({});
assert.strictEqual(headers['Accept-Ranges'], 'bytes');
});
=======
it('should return an undefined value when x-amz-website-redirect-location' +
' is empty', () => {
const objectMD = { 'x-amz-website-redirect-location': '' };
const headers = collectResponseHeaders(objectMD);
assert.strictEqual(headers['x-amz-website-redirect-location'],
undefined);
});
it('should return the (nonempty) value of WebsiteRedirectLocation', () => {
const obj = { 'x-amz-website-redirect-location': 'google.com' };
const headers = collectResponseHeaders(obj);
assert.strictEqual(headers['x-amz-website-redirect-location'],
'google.com');
});
>>>>>>>
it('should add the Accept-Ranges header', () => {
const headers = collectResponseHeaders({});
assert.strictEqual(headers['Accept-Ranges'], 'bytes');
});
it('should return an undefined value when x-amz-website-redirect-location' +
' is empty', () => {
const objectMD = { 'x-amz-website-redirect-location': '' };
const headers = collectResponseHeaders(objectMD);
assert.strictEqual(headers['x-amz-website-redirect-location'],
undefined);
});
it('should return the (nonempty) value of WebsiteRedirectLocation', () => {
const obj = { 'x-amz-website-redirect-location': 'google.com' };
const headers = collectResponseHeaders(obj);
assert.strictEqual(headers['x-amz-website-redirect-location'],
'google.com');
}); |
<<<<<<<
handleScroll (e) {
if (this.props.onScroll) {
this.props.onScroll(e)
}
}
=======
handlePasteUrl (e, editor, pastedTxt) {
e.preventDefault()
const taggedUrl = `<${pastedTxt}>`
editor.replaceSelection(taggedUrl)
fetch(pastedTxt, {
method: 'get'
}).then((response) => {
return (response.text())
}).then((response) => {
const parsedResponse = (new window.DOMParser()).parseFromString(response, 'text/html')
const value = editor.getValue()
const cursor = editor.getCursor()
const LinkWithTitle = `[${parsedResponse.title}](${pastedTxt})`
const newValue = value.replace(taggedUrl, LinkWithTitle)
editor.setValue(newValue)
editor.setCursor(cursor)
}).catch((e) => {
const value = editor.getValue()
const newValue = value.replace(taggedUrl, pastedTxt)
const cursor = editor.getCursor()
editor.setValue(newValue)
editor.setCursor(cursor)
})
}
>>>>>>>
handleScroll (e) {
if (this.props.onScroll) {
this.props.onScroll(e)
}
handlePasteUrl (e, editor, pastedTxt) {
e.preventDefault()
const taggedUrl = `<${pastedTxt}>`
editor.replaceSelection(taggedUrl)
fetch(pastedTxt, {
method: 'get'
}).then((response) => {
return (response.text())
}).then((response) => {
const parsedResponse = (new window.DOMParser()).parseFromString(response, 'text/html')
const value = editor.getValue()
const cursor = editor.getCursor()
const LinkWithTitle = `[${parsedResponse.title}](${pastedTxt})`
const newValue = value.replace(taggedUrl, LinkWithTitle)
editor.setValue(newValue)
editor.setCursor(cursor)
}).catch((e) => {
const value = editor.getValue()
const newValue = value.replace(taggedUrl, pastedTxt)
const cursor = editor.getCursor()
editor.setValue(newValue)
editor.setCursor(cursor)
})
} |
<<<<<<<
nodeHeightSeperation: function(nodeWidth, nodeMaxHeight) {
return TreeBuilder._nodeHeightSeperation(nodeWidth, nodeMaxHeight);
},
=======
nodeRightClick: function(name, extra, id) {},
>>>>>>>
nodeRightClick: function(name, extra, id) {},
nodeHeightSeperation: function(nodeWidth, nodeMaxHeight) {
return TreeBuilder._nodeHeightSeperation(nodeWidth, nodeMaxHeight);
}, |
<<<<<<<
if (typeof _this.directionsService === 'undefined') {
_this.directionsService = new google.maps.DirectionsService;
}
=======
if (typeof _this.panel === 'undefined') {
_this.directionsDisplay.setPanel(null);
}
else {
_this.directionsDisplay.setPanel(_this.panel);
}
>>>>>>>
if (typeof _this.directionsService === 'undefined') {
_this.directionsService = new google.maps.DirectionsService;
}
if (typeof _this.panel === 'undefined') {
_this.directionsDisplay.setPanel(null);
}
else {
_this.directionsDisplay.setPanel(_this.panel);
}
<<<<<<<
__decorate([
core_1.Input(),
__metadata("design:type", Object)
], AgmDirection.prototype, "renderOptions", void 0);
=======
__decorate([
core_1.Input(),
__metadata("design:type", Object)
], AgmDirection.prototype, "panel", void 0);
>>>>>>>
__decorate([
core_1.Input(),
__metadata("design:type", Object)
], AgmDirection.prototype, "renderOptions", void 0);
__decorate([
core_1.Input(),
__metadata("design:type", Object)
], AgmDirection.prototype, "panel", void 0); |
<<<<<<<
icsFormat += foldLine(`PRODID:${productId}`) + '\r\n'
=======
icsFormat += `PRODID:${productId}\r\n`
icsFormat += `METHOD:PUBLISH\r\n`
icsFormat += `X-PUBLISHED-TTL:PT1H\r\n`
>>>>>>>
icsFormat += foldLine(`PRODID:${productId}`) + '\r\n'
icsFormat += `METHOD:PUBLISH\r\n`
icsFormat += `X-PUBLISHED-TTL:PT1H\r\n` |
<<<<<<<
import {setSearchResults} from './search.actions';
import _ from 'underscore';
=======
>>>>>>>
import _ from 'underscore'; |
<<<<<<<
export const setUserProjects = (userProjects) => ({
type: types.SET_USER_PROJECTS,
payload: userProjects
})
=======
export const toggleModal = (use) => ({
type: types.TOGGLE_MODAL,
payload: use
})
export const reset = () => ({
type: types.RESET
})
>>>>>>>
export const toggleModal = (use) => ({
type: types.TOGGLE_MODAL,
payload: use
})
export const reset = () => ({
type: types.RESET
})
export const setUserProjects = (userProjects) => ({
type: types.SET_USER_PROJECTS,
payload: userProjects
}) |
<<<<<<<
const aboutPattern = /\/about\/([^\/]+)\/index.html$/;
const readAboutTerm = input => {
const match = aboutPattern.exec(input);
return match != null ? match[1] : null;
}
const asAboutURI = uri => {
const base = getBaseURI();
const {origin, pathname} = new URI(uri);
const about = base.origin === origin ? readAboutTerm(pathname) : null;
return about != null ? `about:${about}` : null;
}
=======
exports.parse = parse;
>>>>>>>
const aboutPattern = /\/about\/([^\/]+)\/index.html$/;
const readAboutTerm = input => {
const match = aboutPattern.exec(input);
return match != null ? match[1] : null;
}
const asAboutURI = uri => {
const base = getBaseURI();
const {origin, pathname} = new URI(uri);
const about = base.origin === origin ? readAboutTerm(pathname) : null;
return about != null ? `about:${about}` : null;
}
exports.parse = parse; |
<<<<<<<
(isSelected(webViewerCursor) ? ' selected' : ''),
style: {
backgroundImage: readThumbnailURI(webViewerCursor.get('location'))
},
onMouseOver: event => onSelect(webViewerCursor),
onMouseDown: event => onActivate(),
=======
(item.get('isSelected') ? ' selected' : ''),
onMouseDown: event => select(items, equals(item)),
>>>>>>>
(isSelected(webViewerCursor) ? ' selected' : ''),
onMouseOver: event => onSelect(webViewerCursor),
onMouseDown: event => onActivate(),
<<<<<<<
}));
=======
}, [
DOM.span({
key: 'thumbnail',
className: 'tab-thumbnail',
style: {backgroundImage: readThumbnailURI(item.get('location'))},
})
]));
Tab.Deck = Deck(Tab);
>>>>>>>
}, [
DOM.span({
key: 'thumbnail',
className: 'tab-thumbnail',
style: {backgroundImage: readThumbnailURI(webViewerCursor.get('location'))},
})
])); |
<<<<<<<
projectName = "haha";
db
=======
return db
>>>>>>>
return db
<<<<<<<
Project.findAll({
=======
return Project.findAll({
>>>>>>>
return Project.findAll({
<<<<<<<
{returning: true, where: {projectName, uid}}
).then(updatedRecord => console.log(updatedRecord[1][0].dataValues))
=======
{returning: true, where: {projectName}}
).catch(err => {
console.log('err in updating db', err);
return err
})
>>>>>>>
{returning: true, where: {projectName, uid}}
).catch(err => {
console.log('err in updating db', err);
return err
})
<<<<<<<
}).then(newRecord => console.log("CREATED!", newRecord.dataValues))
=======
}).catch(err => {
console.log('err in creating entry', err)
return err
})
>>>>>>>
}).catch(err => {
console.log('err in creating entry', err)
return err
})
<<<<<<<
}).catch(err => {
console.log("Error saving to the database ", err)
=======
>>>>>>> |
<<<<<<<
const {loader, page, progress, security} = WebView.get(webViews,
webViews.selected);
const id = loader && loader.id;
=======
const {loader, page, security} = WebView.get(webViews, webViews.selected);
>>>>>>>
const {loader, page, security} = WebView.get(webViews, webViews.selected);
const id = loader && loader.id;
<<<<<<<
state.mode, id, shell, theme, address),
render('ProgressBar', Progress.view,
state.mode, id, progress, theme, address),
=======
!input.isFocused,
loader && loader.id,
shell,
theme,
address),
>>>>>>>
state.mode, id, shell, theme, address),
<<<<<<<
webViews.selected),
=======
webViews.selected,
!input.isFocused),
render('ProgressBars', Progress.view,
webViews.loader,
webViews.progress,
webViews.selected,
theme),
>>>>>>>
webViews.selected),
render('ProgressBars', Progress.view,
webViews.loader,
webViews.progress,
webViews.selected,
theme), |
<<<<<<<
prettifyMarkdown: 'Shift + F',
=======
insertDate: OSX ? 'Command + /' : 'Ctrl + /',
insertDateTime: OSX ? 'Command + Alt + /' : 'Ctrl + Shift + /',
>>>>>>>
prettifyMarkdown: 'Shift + F',
insertDate: OSX ? 'Command + /' : 'Ctrl + /',
insertDateTime: OSX ? 'Command + Alt + /' : 'Ctrl + Shift + /', |
<<<<<<<
// 'react-redux',
'redux-use-mutable-source',
// 'reactive-react-redux',
// 'react-tracked',
// 'constate',
// 'zustand',
// 'react-sweet-state',
// 'storeon',
// 'react-hooks-global-state-1',
// 'react-hooks-global-state-2',
// 'use-context-selector',
// 'mobx-react-lite',
// 'use-subscription',
// 'mobx-use-sub',
// 'react-state',
// 'simplux',
// 'react-apollo',
=======
'react-redux',
'reactive-react-redux',
'react-tracked',
'constate',
'zustand',
'react-sweet-state',
'storeon',
'react-hooks-global-state-1',
'react-hooks-global-state-2',
'use-context-selector',
'use-enhanced-reducer',
'mobx-react-lite',
'use-subscription',
'mobx-use-sub',
'react-state',
'simplux',
'react-apollo',
>>>>>>>
'react-redux',
'redux-use-mutable-source',
'reactive-react-redux',
'react-tracked',
'constate',
'zustand',
'react-sweet-state',
'storeon',
'react-hooks-global-state-1',
'react-hooks-global-state-2',
'use-context-selector',
'use-enhanced-reducer',
'mobx-react-lite',
'use-subscription',
'mobx-use-sub',
'react-state',
'simplux',
'react-apollo', |
<<<<<<<
setNativeProps(nativeProps: any) {
this._root.setNativeProps(nativeProps);
}
_onReady(event: SyntheticEvent) {
return this.props.onReady && this.props.onReady(event.nativeEvent);
}
_onChangeState(event: SyntheticEvent) {
if (event.nativeEvent.state === 'ended' && this.props.loop) {
this.seekTo(0);
}
return this.props.onChangeState && this.props.onChangeState(event.nativeEvent);
}
_onChangeQuality(event: SyntheticEvent) {
return this.props.onChangeQuality && this.props.onChangeQuality(event.nativeEvent);
}
_onError(event: SyntheticEvent) {
return this.props.onError && this.props.onError(event.nativeEvent);
=======
stopVideo() {
NativeModules.YouTubeManager.stopVideo(ReactNative.findNodeHandle(this));
>>>>>>>
setNativeProps(nativeProps: any) {
this._root.setNativeProps(nativeProps);
}
_onChangeQuality(event: SyntheticEvent) {
return this.props.onChangeQuality && this.props.onChangeQuality(event.nativeEvent);
}
stopVideo() {
NativeModules.YouTubeManager.stopVideo(ReactNative.findNodeHandle(this)); |
<<<<<<<
_root: any;
constructor(props) {
=======
_root: any;
_exportedProps: any;
setNativeProps(nativeProps: any) {
this._root.setNativeProps(nativeProps);
}
constructor(props: any) {
>>>>>>>
_root: any;
_exportedProps: any;
constructor(props: any) {
<<<<<<<
setNativeProps(nativeProps: any) {
this._root.setNativeProps(nativeProps);
}
_onReady(event) {
=======
_onReady(event: SyntheticEvent) {
>>>>>>>
setNativeProps(nativeProps: any) {
this._root.setNativeProps(nativeProps);
}
_onReady(event: SyntheticEvent) {
<<<<<<<
return <RCTYouTube
ref={component => { this._root = component; }}
{... nativeProps} />;
=======
this._root.setNativeProps(nativeProps);
>>>>>>>
this._root.setNativeProps(nativeProps); |
<<<<<<<
readFaviconURI(model),
style.favicon),
=======
model.page && model.page.faviconURI,
styles.favicon),
>>>>>>>
readFaviconURI(model),
styles.favicon),
<<<<<<<
style: style.title
}, [
// @TODO localize this string
readTitle(model, 'Untitled')
])
=======
style: styles.title
}, [readTitle(model)])
>>>>>>>
style: styles.title
}, [
// @TODO localize this string
readTitle(model, 'Untitled')
]) |
<<<<<<<
describe('#destroy', function() {
beforeEach(function() {
this.dropdownView.destroy();
});
it('should remove event listeners', function() {
expect($._data(this.$menu, 'events')).toBeUndefined();
});
it('should drop references to DOM elements', function() {
expect(this.dropdownView.$menu).toBeNull();
});
});
describe('#hide', function() {
var spy;
beforeEach(function() {
this.dropdownView.on('hide', spy = jasmine.createSpy());
});
describe('if menu has tt-is-open class', function() {
=======
describe('#close', function() {
describe('if open', function() {
>>>>>>>
describe('#destroy', function() {
beforeEach(function() {
this.dropdownView.destroy();
});
it('should remove event listeners', function() {
expect($._data(this.$menu, 'events')).toBeUndefined();
});
it('should drop references to DOM elements', function() {
expect(this.dropdownView.$menu).toBeNull();
});
});
describe('#close', function() {
describe('if open', function() {
<<<<<<<
this.dropdownView
.on('suggestionsRender', this.spy = jasmine.createSpy());
=======
this.dropdownView.on('suggestionsRendered', spy = jasmine.createSpy());
>>>>>>>
this.dropdownView.
on('suggestionsRendered', this.spy = jasmine.createSpy());
<<<<<<<
it('should trigger suggestionsRender', function() {
expect(this.spy).toHaveBeenCalled();
=======
it('should trigger suggestionsRendered', function() {
expect(spy).toHaveBeenCalled();
>>>>>>>
it('should trigger suggestionsRendered', function() {
expect(this.spy).toHaveBeenCalled();
<<<<<<<
this.dropdownView
.on('suggestionsRender', this.spy = jasmine.createSpy());
=======
this.dropdownView
.on('suggestionsRendered', this.spy = jasmine.createSpy());
>>>>>>>
this.dropdownView
.on('suggestionsRendered', this.spy = jasmine.createSpy());
<<<<<<<
it('should trigger suggestionsRender', function() {
expect(this.spy).toHaveBeenCalled();
=======
it('should trigger suggestionsRendered', function() {
expect(this.spy).toHaveBeenCalled();
>>>>>>>
it('should trigger suggestionsRendered', function() {
expect(this.spy).toHaveBeenCalled(); |
<<<<<<<
var query, $candidate, data, payload, cancelMove, id;
=======
var query, $candidate, data, suggestion, datasetName, cancelMove;
>>>>>>>
var query, $candidate, data, suggestion, datasetName, cancelMove, id;
<<<<<<<
payload = data ? data.obj : null;
id = $candidate ? $candidate.attr('id') : null;
this.input.trigger('cursorchange', id);
=======
suggestion = data ? data.obj : null;
datasetName = data ? data.dataset : null;
>>>>>>>
suggestion = data ? data.obj : null;
datasetName = data ? data.dataset : null;
id = $candidate ? $candidate.attr('id') : null;
this.input.trigger('cursorchange', id); |
<<<<<<<
grunt.loadNpmTasks('grunt-parallel');
grunt.loadNpmTasks('grunt-contrib-less');
=======
>>>>>>>
grunt.loadNpmTasks('grunt-parallel'); |
<<<<<<<
export { default as InputText } from "./InputText";
export { default as InputTextarea } from "./InputTextarea";
=======
>>>>>>>
export { default as InputText } from "./InputText";
export { default as InputTextarea } from "./InputTextarea"; |
<<<<<<<
primary: "#46515e",
secondary: "#7f91a8",
attention: "#171B1E",
error: "#D02228",
input: "#bac7d5",
};
export const fontSizes = {
small: "12px",
normal: "14px",
large: "16px",
=======
primary: colors.shuttle,
secondary: colors.polo,
attention: colors.smoke,
error: colors.red,
input: colors.casper,
active: colors.teal,
>>>>>>>
primary: colors.shuttle,
secondary: colors.polo,
attention: colors.smoke,
error: colors.red,
input: colors.casper,
active: colors.teal,
};
export const fontSizes = {
small: "12px",
normal: "14px",
large: "16px", |
<<<<<<<
import { setConfigValue, setUserActivity } from "../../shared/actions/app.js";
=======
import { setAutoLogin } from "../../shared/actions/autoLogin.js";
import { setConfigValue } from "../../shared/actions/app.js";
>>>>>>>
import { setConfigValue, setUserActivity } from "../../shared/actions/app.js";
import { setAutoLogin } from "../../shared/actions/autoLogin.js"; |
<<<<<<<
]),
downloadInBackground: React.PropTypes.bool
=======
]),
checkNetwork: React.PropTypes.bool,
networkAvailable: React.PropTypes.bool
>>>>>>>
]),
checkNetwork: React.PropTypes.bool,
networkAvailable: React.PropTypes.bool,
downloadInBackground: React.PropTypes.bool
<<<<<<<
useQueryParamsInCacheKey: false, // bc
downloadInBackground: false
=======
useQueryParamsInCacheKey: false, // bc
checkNetwork: true,
networkAvailable: false
>>>>>>>
useQueryParamsInCacheKey: false, // bc
checkNetwork: true,
networkAvailable: false,
downloadInBackground: false |
<<<<<<<
var async = require('async');
=======
'use strict';
var RiakNode = require ('./riaknode');
var DefaultNodeManager = require('./defaultnodemanager');
>>>>>>>
'use strict';
var async = require('async'); |
<<<<<<<
it('should allow confirmGameEnded after claimTimeout', (done) => {
assert.doesNotThrow(() => {
Chess.claimTimeout(gameId, {from: player2, gas: 200000});
});
assert.doesNotThrow(() => {
Chess.confirmGameEnded(gameId, {from: player1, gas: 200000});
});
let filter = Chess.GameEnded({});
filter.watch((error, result) => {
assert.equal(gameId, result.args.gameId);
assert.equal(player2, Chess.games(result.args.gameId)[5]);
filter.stopWatching();
done();
});
});
it('should assign ether pot to winning player after confirmGameEnded', (done) => {
=======
it('should allow confirmGameEnded after claimWin, update state and ELO scores', (done) => {
>>>>>>>
it('should allow confirmGameEnded after claimWin, update state and ELO scores', (done) => {
assert.doesNotThrow(() => {
Chess.claimTimeout(gameId, {from: player2, gas: 200000});
});
assert.doesNotThrow(() => {
Chess.confirmGameEnded(gameId, {from: player1, gas: 200000});
});
let filter = Chess.GameEnded({});
filter.watch((error, result) => {
assert.equal(gameId, result.args.gameId);
assert.equal(player2, Chess.games(result.args.gameId)[5]);
filter.stopWatching();
done();
});
});
it('should assign ether pot to winning player after confirmGameEnded', (done) => { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.