conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
// this.subHeader.focus();
// document.getElementsByClassName('js-subheader-column')[0].childNodes[0].focus();
// document.getElementsByClassName('js-subheader-column')[0].focus();
windowType && dataId && dispatch(getRelatedDocuments(windowType, dataId)).then((response) => {
dispatch(setReferences(response.data.references));
});
(windowType && dataId) && dispatch(getDocumentActions(windowType,dataId)).then((response) => {
dispatch(setActions(response.data.actions));
});
(viewId && !dataId) && dispatch(getViewActions(viewId)).then((response) => {
dispatch(setActions(response.data.actions));
});
=======
if(windowType && dataId){
dispatch(getRelatedDocuments(windowType, dataId)).then((response) => {
dispatch(setReferences(response.data.references));
});
dispatch(getDocumentActions(windowType,dataId)).then((response) => {
dispatch(setActions(response.data.actions));
});
}else if (viewId && !dataId){
dispatch(getViewActions(viewId)).then((response) => {
dispatch(setActions(response.data.actions));
});
if(selected && selected.length === 1){
dispatch(getRelatedDocuments(windowType, selected[0])).then((response) => {
dispatch(setReferences(response.data.references));
});
}
}
>>>>>>>
// this.subHeader.focus();
// document.getElementsByClassName('js-subheader-column')[0].childNodes[0].focus();
// document.getElementsByClassName('js-subheader-column')[0].focus();
if(windowType && dataId){
dispatch(getRelatedDocuments(windowType, dataId)).then((response) => {
dispatch(setReferences(response.data.references));
});
dispatch(getDocumentActions(windowType,dataId)).then((response) => {
dispatch(setActions(response.data.actions));
});
}else if (viewId && !dataId){
dispatch(getViewActions(viewId)).then((response) => {
dispatch(setActions(response.data.actions));
});
if(selected && selected.length === 1){
dispatch(getRelatedDocuments(windowType, selected[0])).then((response) => {
dispatch(setReferences(response.data.references));
});
}
} |
<<<<<<<
=======
>>>>>>>
<<<<<<<
=======
handleChange = (e, property) => {
// const {dispatch, tabId, rowId, isModal, relativeDocId, precision} = this.props;
// let currRowId = rowId;
// if(!this.validatePrecision(e.target.value)){
// return;
// }
// if(rowId === "NEW"){
// currRowId = relativeDocId;
// }
// e.preventDefault();
// dispatch(updateProperty(property, e.target.value, tabId, currRowId, isModal));
}
>>>>>>> |
<<<<<<<
const {textValue} = this.state;
=======
>>>>>>>
const {textValue} = this.state; |
<<<<<<<
if (list.length > 0) {
let openDropdownState = {};
=======
if (list.length > 0) {
let openDropdownState = {};
if (this.openDropdown && (list.length > 1)) {
this.openDropdown = false;
openDropdownState.isOpen = true;
}
let dropdownList = dropdown.concat(list);
this.setState(
Object.assign(
{
dropdownList: dropdownList,
selected: defaultValue ? defaultValue : list[0],
},
openDropdownState
)
);
}
}
>>>>>>>
if (list.length > 0) {
let openDropdownState = {};
<<<<<<<
this.setState(
Object.assign(
{
dropdownList: dropdownList,
selected: defaultValue ? defaultValue : list[0]
},
openDropdownState
)
);
}
}
=======
// trigger handleBlur action if dropdown is still opened
// after focus is lost
if (!this.isFocused && isOpen) {
this.handleBlur();
}
// no need for updating scroll
if (!this.isFocused || !isOpen || !list.length) {
return;
}
>>>>>>>
this.setState(
Object.assign(
{
dropdownList: dropdownList,
selected: defaultValue ? defaultValue : list[0]
},
openDropdownState
)
);
}
}
<<<<<<<
return baseIndex;
}
navigateToAlphanumeric = char => {
const { list } = this.props;
const { isOpen, selected } = this.state;
=======
navigateToAlphanumeric = (char) => {
const { list } = this.props;
const { isOpen, selected } = this.state;
if (!isOpen) {
this.setState({
isOpen: true
});
}
>>>>>>>
return baseIndex;
}
navigateToAlphanumeric = char => {
const { list } = this.props;
const { isOpen, selected } = this.state;
<<<<<<<
this.setState({
selected: item
});
};
navigate = up => {
const { selected, dropdownList, isOpen } = this.state;
=======
navigate = (up) => {
const { selected, dropdownList, isOpen } = this.state;
if (!isOpen) {
this.setState({
isOpen: true
});
}
>>>>>>>
this.setState({
selected: item
});
};
navigate = up => {
const { selected, dropdownList, isOpen } = this.state;
<<<<<<<
handleClick = e => {
this.considerBlur = true;
=======
handleClick = (e) => {
e.preventDefault();
const { onFocus } = this.props;
onFocus && onFocus();
this.setState({
isOpen: true
});
}
handleFocus = (e) => {
this.isFocused = true;
if (e) {
e.preventDefault();
}
>>>>>>>
handleClick = e => {
<<<<<<<
onFocus && onFocus();
if (!doNotOpenOnFocus && !autofocus) {
this.openDropdown = true;
=======
if (option.key === null) {
onSelect(null);
} else {
onSelect(option);
}
this.setState({
selected: (option || 0)
}, () => this.handleBlur());
>>>>>>>
onFocus && onFocus();
if (!doNotOpenOnFocus && !autofocus) {
this.openDropdown = true;
<<<<<<<
handleSelect = option => {
const { onSelect } = this.props;
=======
if ((e.keyCode > 47) && (e.keyCode < 123)) {
this.navigateToAlphanumeric(e.key);
} else {
switch (e.key) {
case 'ArrowDown':
e.preventDefault();
this.navigate(true);
break;
case 'ArrowUp':
e.preventDefault();
this.navigate(false);
break;
case 'Enter':
e.preventDefault();
if (isOpen) {
e.stopPropagation();
}
if (selected) {
this.isFocused = true;
this.handleSelect(selected);
} else {
onSelect(null);
}
break;
case 'Escape':
e.preventDefault();
this.handleBlur();
break;
case 'Tab':
((list.length === 0) && !readonly) && onSelect(null);
break;
}
}
}
>>>>>>>
handleSelect = option => {
const { onSelect } = this.props; |
<<<<<<<
this.table = null;
=======
this.supportAttribute = false;
>>>>>>>
this.table = null;
this.supportAttribute = false; |
<<<<<<<
componentDidMount() {
// document.activeElement.getElementsByClassName('input-field')[0].focus();
}
renderWidget = (widgetType, fields, windowType, dataId, type, data, rowId, tabId, icon) => {
=======
renderWidget = (widgetType, fields, windowType, dataId, type, data, rowId, tabId, icon, align) => {
>>>>>>>
componentDidMount() {
// document.activeElement.getElementsByClassName('input-field')[0].focus();
}
renderWidget = (widgetType, fields, windowType, dataId, type, data, rowId, tabId, icon, align) => { |
<<<<<<<
patchAll,
=======
getRowsData
>>>>>>>
patchAll,
getRowsData |
<<<<<<<
if (indentSupported && rowData.get(`${tabId}`)) {
rowsData = getRowsData(rowData.get(`${tabId}`));
=======
if (indentSupported && rowData.get(`${tabid}`).size) {
rowsData = getRowsData(rowData.get(`${tabid}`));
>>>>>>>
if (indentSupported && rowData.get(`${tabId}`).size) {
rowsData = getRowsData(rowData.get(`${tabId}`));
<<<<<<<
rowsData = rowData.get(`${tabId}`)
? rowData.get(`${tabId}`).toArray()
: [];
=======
rowsData =
rowData.get(`${tabid}`) && rowData.get(`${tabid}`).size
? rowData.get(`${tabid}`).toArray()
: [];
>>>>>>>
rowsData =
rowData.get(`${tabId}`) && rowData.get(`${tabId}`).size
? rowData.get(`${tabId}`).toArray()
: [];
<<<<<<<
tabId={tabId}
onDoubleClick={() => {
if (supportOpenRecord) {
onDoubleClick && onDoubleClick(item[keyProperty]);
}
}}
=======
tabId={tabid}
onDoubleClick={this.handleDoubleClick}
>>>>>>>
tabId={tabId}
onDoubleClick={this.handleDoubleClick} |
<<<<<<<
type Options = {
checkConstraints: boolean,
fireTriggers: boolean,
keepNulls: boolean,
lockTable: boolean
};
type Column = {
type: Object,
name: string,
value: null,
output: boolean,
length?: number,
precision?: number,
scale?: number,
objName: string,
nullable: boolean
};
type ColumnOptions = {
output?: boolean,
length?: number,
precision?: number,
scale?: number,
objName?: string,
nullable?: boolean
};
// Note that the Connection module uses this class in the same way as the Request class.
class BulkLoad extends EventEmitter {
isBulkLoad: boolean;
error: Error | typeof undefined;
canceled: boolean;
executionStarted: boolean;
firstRowWritten: boolean;
streamingMode: boolean;
table: string;
options: Object;
callback: (err: ?Error, rowCount: number) => void;
columns: Array<Column>;
columnsByName: { [name: string]: Column };
bulkOptions: Options;
rowToPacketTransform: RowTransform;
constructor(table: string, connectionOptions: Object, {
=======
type InternalOptions = {
checkConstraints: boolean,
fireTriggers: boolean,
keepNulls: boolean,
lockTable: boolean,
};
type Options = {
checkConstraints?: $PropertyType<InternalOptions, 'checkConstraints'>,
fireTriggers?: $PropertyType<InternalOptions, 'fireTriggers'>,
keepNulls?: $PropertyType<InternalOptions, 'keepNulls'>,
lockTable?: $PropertyType<InternalOptions, 'lockTable'>,
};
type Column = {
type: Object,
name: string,
value: null,
output: boolean,
length?: number,
precision?: number,
scale?: number,
objName: string,
nullable: boolean
};
type ColumnOptions = {
output?: boolean,
length?: number,
precision?: number,
scale?: number,
objName?: string,
nullable?: boolean
};
class BulkLoad extends EventEmitter {
error: Error | typeof undefined;
canceled: boolean;
table: string;
timeout: number | typeof undefined
options: Object;
callback: (err: ?Error, rowCount: number) => void;
columns: Array<Column>;
columnsByName: { [name: string]: Column };
firstRowWritten: boolean;
rowsData: WritableTrackingBuffer;
bulkOptions: InternalOptions;
constructor(table: string, connectionOptions: Object, {
>>>>>>>
type InternalOptions = {
checkConstraints: boolean,
fireTriggers: boolean,
keepNulls: boolean,
lockTable: boolean,
};
type Options = {
checkConstraints?: $PropertyType<InternalOptions, 'checkConstraints'>,
fireTriggers?: $PropertyType<InternalOptions, 'fireTriggers'>,
keepNulls?: $PropertyType<InternalOptions, 'keepNulls'>,
lockTable?: $PropertyType<InternalOptions, 'lockTable'>,
};
type Column = {
type: Object,
name: string,
value: null,
output: boolean,
length?: number,
precision?: number,
scale?: number,
objName: string,
nullable: boolean
};
type ColumnOptions = {
output?: boolean,
length?: number,
precision?: number,
scale?: number,
objName?: string,
nullable?: boolean
};
class BulkLoad extends EventEmitter {
error: Error | typeof undefined;
canceled: boolean;
isBulkLoad: boolean;
executionStarted: boolean;
streamingMode: boolean;
table: string;
timeout: number | typeof undefined
options: Object;
callback: (err: ?Error, rowCount: number) => void;
columns: Array<Column>;
columnsByName: { [name: string]: Column };
firstRowWritten: boolean;
rowToPacketTransform: RowTransform;
bulkOptions: InternalOptions;
constructor(table: string, connectionOptions: Object, {
<<<<<<<
}: Options, callback: (err: ?Error, rowCount: number) => void) {
=======
}: Options, callback: (err: ?Error, rowCount: number) => void) {
super();
this.error = undefined;
this.canceled = false;
this.timeout = undefined;
this.table = table;
this.options = connectionOptions;
this.callback = callback;
this.columns = [];
this.columnsByName = {};
this.rowsData = new WritableTrackingBuffer(1024, 'ucs2', true);
this.firstRowWritten = false;
>>>>>>>
}: Options, callback: (err: ?Error, rowCount: number) => void) {
<<<<<<<
if (input.length === 1 && typeof input[0] === 'object') {
if (Array.isArray(input[0])) {
const row: Array<any> = input[0];
this.rowToPacketTransform.write(row);
} else {
const row: { [string]: any } = input[0];
this.rowToPacketTransform.write(this.columns.map((column) => {
return row[column.objName];
}));
}
} else {
const row: Array<any> = input;
this.rowToPacketTransform.write(row);
=======
// write each column
if (row instanceof Array) {
for (let i = 0, len = this.columns.length; i < len; i++) {
const c = this.columns[i];
c.type.writeParameterData(this.rowsData, {
length: c.length,
scale: c.scale,
precision: c.precision,
value: row[i]
}, this.options);
}
} else {
for (let i = 0, len = this.columns.length; i < len; i++) {
const c = this.columns[i];
c.type.writeParameterData(this.rowsData, {
length: c.length,
scale: c.scale,
precision: c.precision,
value: row[c.objName]
}, this.options);
}
>>>>>>>
let row;
if (input.length > 1 || !input[0] || typeof input[0] !== 'object') {
row = input;
} else {
row = input[0];
}
// write each column
if (Array.isArray(row)) {
this.rowToPacketTransform.write(row);
} else {
const object = row;
this.rowToPacketTransform.write(this.columns.map((column) => {
return object[column.objName];
}));
<<<<<<<
createDoneToken() {
// It might be nice to make DoneToken a class if anything needs to create them, but for now, just do it here
const tBuf = new WritableTrackingBuffer(this.options.tdsVersion < '7_2' ? 9 : 13);
tBuf.writeUInt8(TOKEN_TYPE.DONE);
const status = DONE_STATUS.FINAL;
tBuf.writeUInt16LE(status);
tBuf.writeUInt16LE(0); // CurCmd (TDS ignores this)
tBuf.writeUInt32LE(0); // row count - doesn't really matter
if (this.options.tdsVersion >= '7_2') {
tBuf.writeUInt32LE(0); // row count is 64 bits in >= TDS 7.2
}
return tBuf.data;
}
// This method switches the BulkLoad object into streaming mode and returns
// a stream.Writable for streaming rows to the server.
getRowStream() {
if (this.firstRowWritten) {
throw new Error('BulkLoad cannot be switched to streaming mode after first row has been written using addRow().');
}
if (this.executionStarted) {
throw new Error('BulkLoad cannot be switched to streaming mode after execution has started.');
}
this.streamingMode = true;
return this.rowToPacketTransform;
}
getMessageStream() {
const message = new Message({ type: PACKET_TYPE.BULK_LOAD });
this.rowToPacketTransform.pipe(message);
return message;
}
}
module.exports = BulkLoad;
// A transform that converts rows to packets.
class RowTransform extends Transform {
columnMetadataWritten: boolean;
bulkLoad: BulkLoad;
mainOptions: $PropertyType<BulkLoad, 'options'>;
columns: $PropertyType<BulkLoad, 'columns'>;
constructor(bulkLoad: BulkLoad) {
super({ writableObjectMode: true });
this.bulkLoad = bulkLoad;
this.mainOptions = bulkLoad.options;
this.columns = bulkLoad.columns;
this.columnMetadataWritten = false;
}
_transform(row, encoding, callback) {
if (!this.columnMetadataWritten) {
this.push(this.bulkLoad.getColMetaData());
this.columnMetadataWritten = true;
}
const buf = new WritableTrackingBuffer(10, 'ucs2', true);
buf.writeUInt8(TOKEN_TYPE.ROW);
for (let i = 0; i < this.columns.length; i++) {
const c = this.columns[i];
c.type.writeParameterData(buf, {
length: c.length,
scale: c.scale,
precision: c.precision,
value: row[i]
}, this.mainOptions);
}
this.push(buf.data);
callback();
}
_flush(callback: () => void) {
this.push(this.bulkLoad.createDoneToken());
callback();
}
}
=======
setTimeout(timeout: number | typeof undefined) {
this.timeout = timeout;
}
}
module.exports = BulkLoad;
>>>>>>>
setTimeout(timeout: number | typeof undefined) {
this.timeout = timeout;
}
createDoneToken() {
// It might be nice to make DoneToken a class if anything needs to create them, but for now, just do it here
const tBuf = new WritableTrackingBuffer(this.options.tdsVersion < '7_2' ? 9 : 13);
tBuf.writeUInt8(TOKEN_TYPE.DONE);
const status = DONE_STATUS.FINAL;
tBuf.writeUInt16LE(status);
tBuf.writeUInt16LE(0); // CurCmd (TDS ignores this)
tBuf.writeUInt32LE(0); // row count - doesn't really matter
if (this.options.tdsVersion >= '7_2') {
tBuf.writeUInt32LE(0); // row count is 64 bits in >= TDS 7.2
}
return tBuf.data;
}
// This method switches the BulkLoad object into streaming mode and returns
// a stream.Writable for streaming rows to the server.
getRowStream() {
if (this.firstRowWritten) {
throw new Error('BulkLoad cannot be switched to streaming mode after first row has been written using addRow().');
}
if (this.executionStarted) {
throw new Error('BulkLoad cannot be switched to streaming mode after execution has started.');
}
this.streamingMode = true;
return this.rowToPacketTransform;
}
getMessageStream() {
const message = new Message({ type: PACKET_TYPE.BULK_LOAD });
this.rowToPacketTransform.pipe(message);
return message;
}
}
module.exports = BulkLoad;
// A transform that converts rows to packets.
class RowTransform extends Transform {
columnMetadataWritten: boolean;
bulkLoad: BulkLoad;
mainOptions: $PropertyType<BulkLoad, 'options'>;
columns: $PropertyType<BulkLoad, 'columns'>;
constructor(bulkLoad: BulkLoad) {
super({ writableObjectMode: true });
this.bulkLoad = bulkLoad;
this.mainOptions = bulkLoad.options;
this.columns = bulkLoad.columns;
this.columnMetadataWritten = false;
}
_transform(row, encoding, callback) {
if (!this.columnMetadataWritten) {
this.push(this.bulkLoad.getColMetaData());
this.columnMetadataWritten = true;
}
const buf = new WritableTrackingBuffer(10, 'ucs2', true);
buf.writeUInt8(TOKEN_TYPE.ROW);
for (let i = 0; i < this.columns.length; i++) {
const c = this.columns[i];
c.type.writeParameterData(buf, {
length: c.length,
scale: c.scale,
precision: c.precision,
value: row[i]
}, this.mainOptions);
}
this.push(buf.data);
callback();
}
_flush(callback: () => void) {
this.push(this.bulkLoad.createDoneToken());
callback();
}
} |
<<<<<<<
View: require('./view'),
Notebook: require('./notebook'),
Inspector: require('./inspector'),
Cell: require('./cells/cell'),
CodeCell: require('./cells/code'),
TextCell: require('./cells/text'),
EditorCell: require('./cells/editor'),
ResultCell: require('./cells/result')
=======
View: require('./view'),
Hbs: require('./hbs'),
Notebook: require('./notebook'),
Inspector: require('./inspector'),
ErrorInspector: require('./error-inspector'),
Cell: require('./cells/cell'),
CodeCell: require('./cells/code'),
TextCell: require('./cells/text'),
EditorCell: require('./cells/editor'),
ResultCell: require('./cells/result')
>>>>>>>
View: require('./view'),
Notebook: require('./notebook'),
Inspector: require('./inspector'),
ErrorInspector: require('./error-inspector'),
Cell: require('./cells/cell'),
CodeCell: require('./cells/code'),
TextCell: require('./cells/text'),
EditorCell: require('./cells/editor'),
ResultCell: require('./cells/result') |
<<<<<<<
},
{
affirmation: "A champion is defined not by their wins but how they can recover when they fall.",
source: "unkown",
author: "Serena Williams"
=======
},
{
affirmation: "Every decision I make is the right one for me.",
source: "www.louisehay.com/affirmations/",
author: "Louise Hay"
},
{
affirmations: "My life is joyously balanced with Work and Play.",
source: "https://www.louisehay.com/affirmations/",
author: "Louise Hay"
},
{
affirmation: "I want -- it's an excellent way to attract happiness in my life.",
source: "https://www.louisehay.com/affirmations/",
author: "Louise Hay"
},
{
affirmation:
"Forgiveness is the greatest gift you can give yourself.",
author: "Maya Angelou"
},
{
affirmation:
"Remember to take care of yourself. You can’t pour from an empty cup.",
author: "Unknown"
},
{
affirmation:
"You, yourself, as much as anybody in the entire universe, deserve your love and affection.",
author: "Buddha"},
{
affirmation: "When I dare to be powerful, to use my strength in the service of my vision, then it becomes less and less important whether I am afraid",
source: "Second Sex Conference, NY, 1979",
author: "Audre Lorde"
>>>>>>>
},
{
affirmation: "A champion is defined not by their wins but how they can recover when they fall.",
source: "unkown",
author: "Serena Williams"
},
{
affirmation: "Every decision I make is the right one for me.",
source: "www.louisehay.com/affirmations/",
author: "Louise Hay"
},
{
affirmations: "My life is joyously balanced with Work and Play.",
source: "https://www.louisehay.com/affirmations/",
author: "Louise Hay"
},
{
affirmation: "I want -- it's an excellent way to attract happiness in my life.",
source: "https://www.louisehay.com/affirmations/",
author: "Louise Hay"
},
{
affirmation:
"Forgiveness is the greatest gift you can give yourself.",
author: "Maya Angelou"
},
{
affirmation:
"Remember to take care of yourself. You can’t pour from an empty cup.",
author: "Unknown"
},
{
affirmation:
"You, yourself, as much as anybody in the entire universe, deserve your love and affection.",
author: "Buddha"},
{
affirmation: "When I dare to be powerful, to use my strength in the service of my vision, then it becomes less and less important whether I am afraid",
source: "Second Sex Conference, NY, 1979",
author: "Audre Lorde" |
<<<<<<<
},
{
affirmation: "Every decision I make is the right one for me.",
source: "www.louisehay.com/affirmations/",
author: "Louise Hay"
},
{
affirmations: "My life is joyously balanced with Work and Play.",
source: "https://www.louisehay.com/affirmations/",
author: "Louise Hay"
},
{
affirmation: "I want -- it's an excellent way to attract happiness in my life.",
source: "https://www.louisehay.com/affirmations/",
author: "Louise Hay"
=======
},
{
affirmation:
"Forgiveness is the greatest gift you can give yourself.",
author: "Maya Angelou"
},
{
affirmation:
"Remember to take care of yourself. You can’t pour from an empty cup.",
author: "Unknown"
},
{
affirmation:
"You, yourself, as much as anybody in the entire universe, deserve your love and affection.",
author: "Buddha"},
{
affirmation: "When I dare to be powerful, to use my strength in the service of my vision, then it becomes less and less important whether I am afraid",
source: "Second Sex Conference, NY, 1979",
author: "Audre Lorde"
>>>>>>>
},
{
affirmation: "Every decision I make is the right one for me.",
source: "www.louisehay.com/affirmations/",
author: "Louise Hay"
},
{
affirmations: "My life is joyously balanced with Work and Play.",
source: "https://www.louisehay.com/affirmations/",
author: "Louise Hay"
},
{
affirmation: "I want -- it's an excellent way to attract happiness in my life.",
source: "https://www.louisehay.com/affirmations/",
author: "Louise Hay"
},
{
affirmation:
"Forgiveness is the greatest gift you can give yourself.",
author: "Maya Angelou"
},
{
affirmation:
"Remember to take care of yourself. You can’t pour from an empty cup.",
author: "Unknown"
},
{
affirmation:
"You, yourself, as much as anybody in the entire universe, deserve your love and affection.",
author: "Buddha"},
{
affirmation: "When I dare to be powerful, to use my strength in the service of my vision, then it becomes less and less important whether I am afraid",
source: "Second Sex Conference, NY, 1979",
author: "Audre Lorde" |
<<<<<<<
/**
* Morphism curried function.
* @param {Map<string, any>} schema
* @param {} items
* @param {} type
*/
export default function Morphism(schema, items, type) {
const transformItems = customizer => input => {
if(input === undefined){
return undefined;
}
if(Array.isArray(input) && input.length === 0){
return [];
}else if(isObject(input) && isEmpty(input)){
return {};
}
if (Array.isArray(input)){
return input.map(obj => {
if(customizer){
return customizer(transformValuesFromObject(obj, schema, input));
}else{
return transformValuesFromObject(obj, schema, input);
}
});
}else{
const object = input;
=======
const transformItems = (schema, customizer) => input => {
if(!input){
return input;
}
if (_.isArray(input)){
return input.map(obj => {
>>>>>>>
const transformItems = (schema, customizer) => input => {
if(!input){
return input;
}
if (Array.isArray(input)){
return input.map(obj => {
<<<<<<<
return transformItems(null);
} else if (type) {
return (input) => {
const customizer = data => {
const undefinedValueCheck = (destination, source) => {
if (source === undefined) return destination;
};
return assignInWith(new type(), data, undefinedValueCheck);
};
return transformItems(customizer)(input);
=======
return transformItems(schema, null);
} else if(schema && items && type) {
return transformItems(schema, customizer)(items);
} else if(schema && items) {
return transformItems(schema, null)(items);
}else if(type && items){
let finalSchema = getSchemaForType(type, schema);
return transformItems(finalSchema, customizer)(items);
}else if(type){
let finalSchema = getSchemaForType(type, schema);
return (futureInput) => {
return transformItems(finalSchema, customizer)(futureInput);
>>>>>>>
return transformItems(schema, null);
} else if(schema && items && type) {
return transformItems(schema, customizer)(items);
} else if(schema && items) {
return transformItems(schema, null)(items);
}else if(type && items){
let finalSchema = getSchemaForType(type, schema);
return transformItems(finalSchema, customizer)(items);
}else if(type){
let finalSchema = getSchemaForType(type, schema);
return (futureInput) => {
return transformItems(finalSchema, customizer)(futureInput);
<<<<<<<
function factory(type, schema, items) {
let typeFields = Object.keys(new type());
let defaultSchema = zipObject(typeFields, typeFields);
let finalSchema = Object.assign(defaultSchema, schema);
=======
const getSchemaForType = (type, baseSchema) => {
let typeFields = _.keys(new type());
let defaultSchema = _.zipObject(typeFields, typeFields);
let finalSchema = _.assign(defaultSchema, baseSchema);
return finalSchema;
};
/**
* Type Mapper Factory
* @param {type} type Class Type to be registered
* @param {Object} schema Configuration of how properties are computed from the source
* @param {Object | Array } items Object or Collection to be mapped
*/
function factory(type, schema, items) {
let finalSchema = getSchemaForType(type, schema);
>>>>>>>
const getSchemaForType = (type, baseSchema) => {
let typeFields = Object.keys(new type());
let defaultSchema = zipObject(typeFields, typeFields);
let finalSchema = assign(defaultSchema, baseSchema);
return finalSchema;
};
/**
* Type Mapper Factory
* @param {type} type Class Type to be registered
* @param {Object} schema Configuration of how properties are computed from the source
* @param {Object | Array } items Object or Collection to be mapped
*/
function factory(type, schema, items) {
let finalSchema = getSchemaForType(type, schema);
<<<<<<<
Object.assign(Morphism, api);
=======
export default Morphism;
>>>>>>>
export default Morphism; |
<<<<<<<
autoUpdater.logger = require('electron-log');
autoUpdater.logger.transports.file.level = 'info';
autoUpdater.autoDownload = false;
app.setAsDefaultProtocolClient('deskfiler');
=======
if (!app.isDefaultProtocolClient('deskfiler')) {
app.setAsDefaultProtocolClient('deskfiler');
}
>>>>>>>
autoUpdater.logger = require('electron-log');
autoUpdater.logger.transports.file.level = 'info';
autoUpdater.autoDownload = false;
if (!app.isDefaultProtocolClient('deskfiler')) {
app.setAsDefaultProtocolClient('deskfiler');
} |
<<<<<<<
var style = MapCSS.restyle()({}, zoom, "canvas")['default'];
=======
var style = restyle({}, zoom, "canvas", "canvas")['default'];
>>>>>>>
var style = MapCSS.restyle()({}, zoom, "canvas", "canvas")['default']; |
<<<<<<<
=======
this._invertYAxe(data)
>>>>>>>
this._invertYAxe(data)
<<<<<<<
=======
_invertYAxe: function(data) {
var type, coordinates, tileSize = data.granularity;
for (var i = 0; i < data.features.length; i++) {
coordinates = data.features[i].coordinates;
type = data.features[i].type;
if (type == 'Point') {
coordinates[1] = tileSize - coordinates[1];
} else if (type == 'MultiPoint' || type == 'LineString') {
for (var j = 0; j < coordinates.length; j++) {
coordinates[j][1] = tileSize - coordinates[j][1];
}
} else if (type == 'MultiLineString' || type == 'Polygon') {
for (var k = 0; k < coordinates.length; k++) {
for (var j = 0; j < coordinates[k].length; j++) {
coordinates[k][j][1] = tileSize - coordinates[k][j][1];
}
}
} else if (type == 'MultiPolygon') {
for (var l = 0; l < coordinates.length; l++) {
for (var k = 0; k < coordinates[l].length; k++) {
for (var j = 0; j < coordinates[l][k].length; j++) {
coordinates[l][k][j][1] = tileSize - coordinates[l][k][j][1];
}
}
}
} else {
window.console && window.console.log("Unexpected GeoJSON type: " + type);
}
}
},
>>>>>>>
_invertYAxe: function(data) {
var type, coordinates, tileSize = data.granularity;
for (var i = 0; i < data.features.length; i++) {
coordinates = data.features[i].coordinates;
type = data.features[i].type;
if (type == 'Point') {
coordinates[1] = tileSize - coordinates[1];
} else if (type == 'MultiPoint' || type == 'LineString') {
for (var j = 0; j < coordinates.length; j++) {
coordinates[j][1] = tileSize - coordinates[j][1];
}
} else if (type == 'MultiLineString' || type == 'Polygon') {
for (var k = 0; k < coordinates.length; k++) {
for (var j = 0; j < coordinates[k].length; j++) {
coordinates[k][j][1] = tileSize - coordinates[k][j][1];
}
}
} else if (type == 'MultiPolygon') {
for (var l = 0; l < coordinates.length; l++) {
for (var k = 0; k < coordinates[l].length; k++) {
for (var j = 0; j < coordinates[l][k].length; j++) {
coordinates[l][k][j][1] = tileSize - coordinates[l][k][j][1];
}
}
}
} else {
window.console && window.console.log("Unexpected GeoJSON type: " + type);
}
}
}, |
<<<<<<<
this.notes = notes;
=======
this.notes = [
'kk',
'sn',
'hh',
'ho',
'A',
'F#',
'E',
'C#',
];
this.storeRecord = record => storeRecord(record);
>>>>>>>
this.notes = notes;
this.storeRecord = record => storeRecord(record); |
<<<<<<<
/**
* Math Definition
*/
const TWO_PI = Math.PI * 2;
const cos = Math.cos;
const sin = Math.sin;
/**
* like range function in lodash
* @param {number} n [description]
* @return {Array} [description]
*/
function range(n) {
return Array.from(Array(n).keys());
}
=======
function range(n) {
return Array.from(Array(n).keys());
}
>>>>>>>
/**
* Math Definition
*/
const TWO_PI = Math.PI * 2;
const cos = Math.cos;
const sin = Math.sin;
/**
* like range function in lodash
* @param {number} n [description]
* @return {Array} [description]
*/
function range(n) {
return Array.from(Array(n).keys());
}
<<<<<<<
/**
* Animation #3, Prism
* it will have two direction(l/r), which will be decided randomly
* @param {number} [opacity = 1]
* @param {number} [duration = 400]
* @return {Object}
*/
(function makePrisms(opacity = 1, duration = 500) {
[3, 5, 7].forEach((index) => {
const origin = { x: two.width * 0.5, y: two.height * 0.5 };
const dest = { scale: two.width / 50 };
/**
* [setDirection description]
*/
function setDirection() {
origin.x = two.width * 0.5;
origin.y = two.height * 0.5;
}
/**
* [setup description]
* @return {[type]} [description]
*/
function setup() {
const playing = false;
const sides = index;
const rPolygon = 100;
const rCircle = 3;
const shape = two.makePolygon(
0,
0,
rPolygon,
sides,
);
shape.stroke = pallete[6];
shape.linewidth = 1;
shape.noFill();
const circles = range(sides).map((i) => {
const pct = (i + 0.5) / sides;
const theta = (TWO_PI * pct) + (Math.PI / 2);
const x = rPolygon * cos(theta);
const y = rPolygon * sin(theta);
const circle = two.makeCircle(x, y, rCircle);
circle.fill = pallete[6];
circle.noStroke();
return circle;
});
const group = two.makeGroup(shape).add(circles);
group.scale = 0;
const ani = new TWEEN.Tween(group)
.to(dest, duration)
.easing(TWEEN.Easing.Circular.In)
.onStart(() => {
console.log('start animation');
console.log(dest);
})
.onUpdate(() => {
console.log(group.scale);
});
return {
playing,
group,
ani,
};
}
let { playing, group, ani } = setup();
// methods
const resize = () => {
setDirection();
two.remove(group);
({ playing, group, ani } = setup());
};
const reset = () => {
playing = false;
ani.stop();
setDirection();
group.scale = 0;
group.translation.set(
origin.x,
origin.y,
);
};
const start = () => {
reset();
playing = true;
ani.start();
};
const EXPORT = {
playing,
start,
reset,
resize,
};
animations.push(EXPORT);
return EXPORT;
});
}());
=======
(function makeGlimmer(opacity = 1, duration = 400) {
/**
* [setup description]
* @return {[type]} [description]
*/
function setup() {
let playing = false;
const amount = 12, r1 = two.height * 20 / 900, r2 = two.height * 40 / 900;
let longest = 0;
const circles = _.map(_.range(amount), () => {
// const r = Math.round(map(Math.random(), 0, 1, r1, r2));
const r = Math.floor(Math.random() * 30);
const delay = Math.random() * duration * 0.5;
const circle = two.makeCircle(two.width * Math.random(), two.height * Math.random(), r);
circle.noFill();
circle.linewidth = 0;
circle.ani = new TWEEN.Tween(circle)
.to({ scale: 1, linewidth: 0 }, duration * 1.5)
.easing(TWEEN.Easing.Sinusoidal.Out)
.delay(delay)
.onComplete(() => {
circle.visible = false;
});
if (longest < delay) {
longest = delay;
}
return circle;
});
return {
playing,
circles,
};
}
let { playing, circles } = setup();
// methods
const resize = () => {
two.remove(circles);
({ playing, circles } = setup());
};
// let j;
const reset = () => {
playing = false;
// for (j = 0; j < circles.length; j++) {
// circles[j].visible = false;
// }
circles.opacity = 0;
};
let i;
let c;
const start = () => {
reset();
playing = true;
for (i = 0; i < circles.length; i++) {
c = circles[i];
c.translation.set(two.width * Math.random(), two.height * Math.random());
c.visible = true;
c.stroke = pallete[Math.floor(Math.random() * 8)];
c.linewidth = 5;
c.ani.start();
}
};
const EXPORT = {
playing,
start,
reset,
resize,
};
animations.push(EXPORT);
return EXPORT;
}());
>>>>>>>
/**
* Animation #3, Prism
* it will have two direction(l/r), which will be decided randomly
* @param {number} [opacity = 1]
* @param {number} [duration = 400]
* @return {Object}
*/
(function makePrisms(opacity = 1, duration = 500) {
[3, 5, 7].forEach((index) => {
const origin = { x: two.width * 0.5, y: two.height * 0.5 };
const dest = { scale: two.width / 50 };
/**
* [setDirection description]
*/
function setDirection() {
origin.x = two.width * 0.5;
origin.y = two.height * 0.5;
}
/**
* [setup description]
* @return {[type]} [description]
*/
function setup() {
const playing = false;
const sides = index;
const rPolygon = 100;
const rCircle = 3;
const shape = two.makePolygon(
0,
0,
rPolygon,
sides,
);
shape.stroke = pallete[6];
shape.linewidth = 1;
shape.noFill();
const circles = range(sides).map((i) => {
const pct = (i + 0.5) / sides;
const theta = (TWO_PI * pct) + (Math.PI / 2);
const x = rPolygon * cos(theta);
const y = rPolygon * sin(theta);
const circle = two.makeCircle(x, y, rCircle);
circle.fill = pallete[6];
circle.noStroke();
return circle;
});
const group = two.makeGroup(shape).add(circles);
group.scale = 0;
const ani = new TWEEN.Tween(group)
.to(dest, duration)
.easing(TWEEN.Easing.Circular.In)
.onStart(() => {
console.log('start animation');
console.log(dest);
})
.onUpdate(() => {
console.log(group.scale);
});
return {
playing,
group,
ani,
};
}
let { playing, group, ani } = setup();
// methods
const resize = () => {
setDirection();
two.remove(group);
({ playing, group, ani } = setup());
};
const reset = () => {
playing = false;
ani.stop();
setDirection();
group.scale = 0;
group.translation.set(
origin.x,
origin.y,
);
};
const start = () => {
reset();
playing = true;
ani.start();
};
const EXPORT = {
playing,
start,
reset,
resize,
};
animations.push(EXPORT);
return EXPORT;
});
}());
(function makeGlimmer(opacity = 1, duration = 400) {
/**
* [setup description]
* @return {[type]} [description]
*/
function setup() {
let playing = false;
const amount = 12, r1 = two.height * 20 / 900, r2 = two.height * 40 / 900;
let longest = 0;
const circles = _.map(_.range(amount), () => {
// const r = Math.round(map(Math.random(), 0, 1, r1, r2));
const r = Math.floor(Math.random() * 30);
const delay = Math.random() * duration * 0.5;
const circle = two.makeCircle(two.width * Math.random(), two.height * Math.random(), r);
circle.noFill();
circle.linewidth = 0;
circle.ani = new TWEEN.Tween(circle)
.to({ scale: 1, linewidth: 0 }, duration * 1.5)
.easing(TWEEN.Easing.Sinusoidal.Out)
.delay(delay)
.onComplete(() => {
circle.visible = false;
});
if (longest < delay) {
longest = delay;
}
return circle;
});
return {
playing,
circles,
};
}
let { playing, circles } = setup();
// methods
const resize = () => {
two.remove(circles);
({ playing, circles } = setup());
};
// let j;
const reset = () => {
playing = false;
// for (j = 0; j < circles.length; j++) {
// circles[j].visible = false;
// }
circles.opacity = 0;
};
let i;
let c;
const start = () => {
reset();
playing = true;
for (i = 0; i < circles.length; i++) {
c = circles[i];
c.translation.set(two.width * Math.random(), two.height * Math.random());
c.visible = true;
c.stroke = pallete[Math.floor(Math.random() * 8)];
c.linewidth = 5;
c.ani.start();
}
};
const EXPORT = {
playing,
start,
reset,
resize,
};
animations.push(EXPORT);
return EXPORT;
}()); |
<<<<<<<
for (var i = 1; i < 10; i++) {
tracer._select(i);
logger._print(' LIS[' + i + '] = ' + LIS[i]);
for (var j = 0; j < i; j++) {
tracer._notify(j)._wait();
tracer._denotify(j);
if (A[i] > A[j] && LIS[i] < LIS[j] + 1) {
LIS[i] = LIS[j] + 1;
logger._print(' LIS[' + i + '] = ' + LIS[i]);
}
}
tracer._deselect(i);
=======
for( var i = 1; i < A.length; i++) {
tracer._select(i) ;
tracer._print( ' LIS['+i+'] = ' + LIS[i]);
for( var j =0; j < i; j++) {
tracer._notify(j);
if( A[i] > A[j] && LIS[i] < LIS[j] + 1) {
LIS[i] = LIS[j] + 1;
tracer._print( ' LIS['+i+'] = ' + LIS[i]);
}
}
tracer._deselect(i);
>>>>>>>
for (var i = 1; i < A.length; i++) {
tracer._select(i);
logger._print(' LIS[' + i + '] = ' + LIS[i]);
for (var j = 0; j < i; j++) {
tracer._notify(j)._wait();
tracer._denotify(j);
if (A[i] > A[j] && LIS[i] < LIS[j] + 1) {
LIS[i] = LIS[j] + 1;
logger._print(' LIS[' + i + '] = ' + LIS[i]);
}
}
tracer._deselect(i);
<<<<<<<
for (var i = 1; i < 10; i++) {
if (max < LIS[i]) {
max = LIS[i];
}
=======
for( var i = 1; i < A.length; i++) {
if(max < LIS[i]) {
max = LIS[i];
}
>>>>>>>
for (var i = 1; i < A.length; i++) {
if (max < LIS[i]) {
max = LIS[i];
} |
<<<<<<<
if (params.capture.transform) {
let transformedVal = evil(params.capture.transform).call(context.vars);
context.vars[params.capture.as] = transformedVal;
debug('transformed value =', context.vars[params.capture.as]);
}
=======
debug('captured var %s = %s', params.capture.as, capturedVal);
>>>>>>>
debug('captured var %s = %s', params.capture.as, capturedVal);
if (params.capture.transform) {
let transformedVal = evil(params.capture.transform).call(context.vars);
context.vars[params.capture.as] = transformedVal;
debug('transformed value =', context.vars[params.capture.as]);
} |
<<<<<<<
=======
const _ = require('lodash');
const core = require('artillery-core');
const runner = core.runner;
const Stats = core.stats;
>>>>>>>
<<<<<<<
let runner = createRunner(result.script,
result.payload,
{ environment: options.environment });
let intermediates = [];
=======
ee.on('stats', function(stats) {
let report = stats.report();
intermediates.push(report);
if (!options.quiet && process.stdout.isTTY) {
cli.spinner('', true);
}
log('Report for the previous %ss @ %s', result.script.config.statsInterval, report.timestamp);
if (!options.quiet) {
humanize(report);
}
>>>>>>>
let runner = createRunner(result.script,
result.payload,
{ environment: options.environment });
<<<<<<<
log('Complete report @ %s', report.timestamp);
printReport(report);
=======
log('Complete report @ %s', report.timestamp);
if (!options.quiet) {
humanize(report);
}
>>>>>>>
log('Complete report @ %s', report.timestamp);
printReport(report);
<<<<<<<
fs.writeFileSync(
logfile, JSON.stringify({
aggregate: report,
intermediate: intermediates
}, null, 2),
{flag: 'w'});
=======
fs.writeFileSync(logfile, JSON.stringify({intermediate: intermediates, aggregate: report}, null, 2), {flag: 'w'});
>>>>>>>
fs.writeFileSync(
logfile, JSON.stringify({
aggregate: report,
intermediate: intermediates
}, null, 2),
{flag: 'w'}); |
<<<<<<<
test('Capture and save to attribute of an Object in context.vars - JSON', (t) => {
const fn = path.resolve(__dirname, './scripts/captures3.json');
const script = require(fn);
const data = fs.readFileSync(path.join(__dirname, 'pets.csv'));
csv(data, function(err, parsedData) {
if (err) {
t.fail(err);
}
runner(script, parsedData, {}).then(function(ee) {
ee.on('done', function(report) {
let c200 = report.codes[200];
let c201 = report.codes[201];
let cond = c201 === c200;
t.assert(cond,
'There should be a 200 for every 201');
if (!cond) {
console.log('200: %s; 201: %s', c200, c201);
}
t.end();
});
ee.run();
});
});
});
=======
test('Capture before test - JSON', (t) => {
const fn = path.resolve(__dirname, './scripts/before_test.json');
const script = require(fn);
runner(script).then(function(ee) {
ee.on('done', function(report) {
let c200 = report.codes[200];
let expectedAmountRequests = script.config.phases[0].duration * script.config.phases[0].arrivalRate;
t.assert(c200 === expectedAmountRequests,
'There should be ' + expectedAmountRequests + ' responses with status code 200');
t.assert(report.matches === expectedAmountRequests, 'All responses match expectation value');
let c201 = report.codes[201];
t.assert(c201 === undefined, 'There should be no 201 response codes');
t.end();
});
ee.run();
});
});
>>>>>>>
test('Capture and save to attribute of an Object in context.vars - JSON', (t) => {
const fn = path.resolve(__dirname, './scripts/captures3.json');
const script = require(fn);
const data = fs.readFileSync(path.join(__dirname, 'pets.csv'));
csv(data, function(err, parsedData) {
if (err) {
t.fail(err);
}
runner(script, parsedData, {}).then(function(ee) {
ee.on('done', function(report) {
let c200 = report.codes[200];
let c201 = report.codes[201];
let cond = c201 === c200;
t.assert(cond,
'There should be a 200 for every 201');
if (!cond) {
console.log('200: %s; 201: %s', c200, c201);
}
t.end();
});
ee.run();
});
});
});
test('Capture before test - JSON', (t) => {
const fn = path.resolve(__dirname, './scripts/before_test.json');
const script = require(fn);
runner(script).then(function(ee) {
ee.on('done', function(report) {
let c200 = report.codes[200];
let expectedAmountRequests = script.config.phases[0].duration * script.config.phases[0].arrivalRate;
t.assert(c200 === expectedAmountRequests,
'There should be ' + expectedAmountRequests + ' responses with status code 200');
t.assert(report.matches === expectedAmountRequests, 'All responses match expectation value');
let c201 = report.codes[201];
t.assert(c201 === undefined, 'There should be no 201 response codes');
t.end();
});
ee.run();
});
}); |
<<<<<<<
var blockMode = false;
ast = ast || [{}, 'stylesheet'];
=======
var usageData = false;
>>>>>>>
var blockMode = false;
var usageData = false;
ast = ast || [{}, 'stylesheet'];
<<<<<<<
if (ast[1] !== 'stylesheet') {
blockMode = true;
ast = [null, 'stylesheet',
[null, 'ruleset',
[null, 'selector',
[null, 'simpleselector', [null, 'ident', 'x']]],
ast
]
];
}
=======
if (options.usage) {
usageData = usageUtils.buildIndex(options.usage);
}
>>>>>>>
if (ast[1] !== 'stylesheet') {
blockMode = true;
ast = [null, 'stylesheet',
[null, 'ruleset',
[null, 'selector',
[null, 'simpleselector', [null, 'ident', 'x']]],
ast
]
];
}
if (options.usage) {
usageData = usageUtils.buildIndex(options.usage);
} |
<<<<<<<
=======
const logger = require('../../utils/logger');
const coreUtils = require('../../utils/core.js');
>>>>>>>
const coreUtils = require('../../utils/core.js');
<<<<<<<
const getKnownSender = function (transaction, cb) {
knowledge.getKnownAddress(transaction.senderId, (err, data) => {
transaction.knownSender = data;
cb(null, transaction);
=======
const setDelegateToCache = function (delegate, tmpDelegateCache) {
// Storing to global delegate cache
if (delegateCache && !tmpDelegateCache && delegate && delegate.address
&& delegateCache[delegate.address] === undefined) {
logger.debug(`Storing global cache for: ${delegate.address}`);
delegateCache[delegate.address] = delegate;
return true;
}
// Storing to tmp delegate cache
if (tmpDelegateCache && delegate && tmpDelegateCache[delegate] === undefined) {
logger.debug(`Storing tmp cache for: ${delegate}`);
tmpDelegateCache[delegate] = null;
return tmpDelegateCache;
}
return false;
};
const getDelegateFromCache = function (address, tmpDelegateCache) {
// Checking global delegate cache
if (delegateCache && delegateCache[address] !== undefined) {
logger.debug(`Using global cache for: ${address}`);
return delegateCache[address];
}
// Checking tmp delegate cache
if (tmpDelegateCache && tmpDelegateCache[address] !== undefined) {
logger.debug(`Using tmp cache for: ${address}`);
return tmpDelegateCache[address];
}
return undefined;
};
const getSenderDelegate = function (transaction, cb, tmpDelegateCache) {
if (!transaction.senderPublicKey) {
transaction.senderDelegate = null;
return cb(null, transaction);
}
const found = getDelegateFromCache(coreUtils.parseAddress(transaction.senderId),
tmpDelegateCache);
if (found !== undefined) {
transaction.senderDelegate = found;
return cb(null, transaction);
}
return request.get({
url: `${app.get('lisk address')}/api/delegates/get?publicKey=${transaction.senderPublicKey}`,
json: true,
}, (err, response, body) => {
if (err || response.statusCode !== 200) {
transaction.senderDelegate = null;
return cb(null, transaction);
} else if (body.success === true && body.delegate && body.delegate.address) {
transaction.senderDelegate = body.delegate;
setDelegateToCache(transaction.senderDelegate);
return cb(null, transaction);
}
transaction.senderDelegate = null;
setDelegateToCache(transaction.senderId, tmpDelegateCache);
return cb(null, transaction);
});
};
const getRecipientPublicKey = function (transaction, cb, tmpDelegateCache) {
if (!transaction.recipientId || transaction.type !== 0) {
transaction.recipientPublicKey = null;
return cb(null, transaction);
}
const found = getDelegateFromCache(transaction.recipientId, tmpDelegateCache);
if (found !== undefined) {
transaction.recipientPublicKey = (found ? found.publicKey : null);
transaction.recipientDelegate = found;
return cb(null, transaction);
}
return request.get({
url: `${app.get('lisk address')}/api/accounts/getPublicKey?address=${coreUtils.parseAddress(transaction.recipientId)}`,
json: true,
}, (err, response, body) => {
if (err || response.statusCode !== 200) {
transaction.recipientPublicKey = null;
return cb(null, transaction);
} else if (body.success === true && body.publicKey) {
transaction.recipientPublicKey = body.publicKey;
return cb(null, transaction);
}
transaction.recipientPublicKey = null;
return cb(null, transaction);
>>>>>>>
const getKnownSender = function (transaction, cb) {
knowledge.getKnownAddress(transaction.senderId, (err, data) => {
transaction.knownSender = data;
cb(null, transaction);
<<<<<<<
const baseQuery = `sort=timestamp:desc&offset=${param(params.offset, 0)}&limit=${param(params.limit, 100)}`;
=======
const baseQuery = `orderBy=timestamp:desc&offset=${param(params.offset, 0)}&limit=${param(params.limit, 100)}`;
const address = coreUtils.parseAddress(params.address);
>>>>>>>
const baseQuery = `sort=timestamp:desc&offset=${param(params.offset, 0)}&limit=${param(params.limit, 100)}`;
const address = coreUtils.parseAddress(params.address);
<<<<<<<
directionQueries.push(`${baseQuery}&senderId=${params.address}&type=0`);
=======
directionQueries.push(`${baseQuery}&and:senderId=${address}&and:type=0`);
>>>>>>>
directionQueries.push(`${baseQuery}&senderId=${address}&type=0`);
<<<<<<<
directionQueries.push(`${baseQuery}&recipientId=${params.address}&type=0`);
=======
directionQueries.push(`${baseQuery}&and:recipientId=${address}&and:type=0`);
>>>>>>>
directionQueries.push(`${baseQuery}&recipientId=${address}&type=0`);
<<<<<<<
directionQueries.push(`${baseQuery}&senderId=${params.address}&type=${i}`);
=======
directionQueries.push(`${baseQuery}&and:senderId=${address}&and:type=${i}`);
>>>>>>>
directionQueries.push(`${baseQuery}&senderId=${address}&type=${i}`);
<<<<<<<
directionQueries.push(`${baseQuery}&senderIdOrRecipientId=${params.address}`);
=======
directionQueries.push(`${baseQuery}&and:recipientId=${address}&or:senderId=${address}`);
>>>>>>>
directionQueries.push(`${baseQuery}&senderIdOrRecipientId=${address}`);
<<<<<<<
directionQueries[index] = `${directionQuery}&recipientId=${params.recipientId}`;
=======
directionQueries[index] = `${directionQuery}&and:recipientId=${coreUtils.parseAddress(params.recipientId)}`;
>>>>>>>
directionQueries[index] = `${directionQuery}&recipientId=${coreUtils.parseAddress(params.recipientId)}`; |
<<<<<<<
if (_.size(body.data) > 0) {
const block = coreResponseMapper(body.data[0]);
=======
if (body && _.size(body.data) > 0) {
const block = [body.data[0]].map(coreResponseMapper)[0];
>>>>>>>
if (body && _.size(body.data) > 0) {
const block = coreResponseMapper(body.data[0]); |
<<<<<<<
vm.txs = { results: resp.data.transactions.slice(0, 19) };
=======
let removedTx;
if (resp.data.transactions.length > limit - 1) {
removedTx = resp.data.transactions.splice(-1, 1);
}
vm.txs = { results: resp.data.transactions };
>>>>>>>
vm.txs = { results: resp.data.transactions.slice(0, 19) };
<<<<<<<
if (resp.data.transactions.length > pageLength * 2) {
vm.txs.hasNextNext = true;
vm.txs.hasNext = true;
} else if (resp.data.transactions.length > pageLength) {
vm.txs.hasNextNext = false;
vm.txs.hasNext = true;
} else {
vm.txs.hasNextNext = false;
vm.txs.hasNext = false;
}
vm.txs.page = $stateParams.page || 0;
vm.txs.pages = vm.makePages(vm.txs.page, vm.txs);
=======
vm.txs.hasNext = !!removedTx;
vm.txs.page = $stateParams.page || 1;
>>>>>>>
if (resp.data.transactions.length > pageLength * 2) {
vm.txs.hasNextNext = true;
vm.txs.hasNext = true;
} else if (resp.data.transactions.length > pageLength) {
vm.txs.hasNextNext = false;
vm.txs.hasNext = true;
} else {
vm.txs.hasNextNext = false;
vm.txs.hasNext = false;
}
vm.txs.page = $stateParams.page || 1;
vm.txs.pages = vm.makePages(vm.txs.page, vm.txs); |
<<<<<<<
logger.info(req.originalUrl);
try {
decodeURIComponent(req.path);
} catch (err) {
logger.info(err);
return res.redirect('/');
}
if (req.originalUrl.split('/')[1] !== 'api') {
return next();
}
if (req.originalUrl === undefined) {
=======
logger.info(req.originalUrl);
if (req.originalUrl === undefined || req.originalUrl.split('/')[1] !== 'api') {
>>>>>>>
logger.info(req.originalUrl);
try {
decodeURIComponent(req.path);
} catch (err) {
logger.info(err);
return res.redirect('/');
}
if (req.originalUrl === undefined || req.originalUrl.split('/')[1] !== 'api') { |
<<<<<<<
import 'angular-sanitize';
=======
import 'angular-cookies';
// import 'babel-polyfill';
>>>>>>>
import 'angular-sanitize';
import 'angular-cookies';
<<<<<<<
import '../components/information-banner';
=======
import '../components/cookies-banner';
>>>>>>>
import '../components/information-banner';
import '../components/cookies-banner';
<<<<<<<
'ngSanitize',
=======
'ngCookies',
>>>>>>>
'ngSanitize',
'ngCookies',
<<<<<<<
'lisk_explorer.infoBanner',
=======
'lisk_explorer.cookiesBanner',
>>>>>>>
'lisk_explorer.infoBanner',
'lisk_explorer.cookiesBanner', |
<<<<<<<
const NS_ERROR_UCONV_NOCONV = 0x80500001;
=======
>>>>>>>
<<<<<<<
function convertToUnicode (text, charset) {
if (null === unicodeConverter) {
unicodeConverter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
createInstance(Ci.nsIScriptableUnicodeConverter);
}
if (charset) {
unicodeConverter.charset = charset;
}
return unicodeConverter.ConvertToUnicode(text);
}
=======
>>>>>>>
<<<<<<<
if (request && request.body && request.contentCharset) {
try {
request.body = convertToUnicode(request.body, request.contentCharset);
} catch (e) {
if (DEBUG_WEBPAGE_LOADING) {
var errorMessage = String(('object' === typeof e) ? e.message : e);
if (e.message.indexOf('0x80500001') !== -1) {
errorMessage = errorMessage.replace('0x80500001', '0x80500001 (NS_ERROR_UCONV_NOCONV)');
}
slDebugLog(errorMessage);
}
}
}
executePageListener(this, 'onResourceReceived', [request])
=======
executePageListener(this, 'onResourceReceived', [resource])
>>>>>>>
executePageListener(this, 'onResourceReceived', [resource]); |
<<<<<<<
expect(slimer.version.minor).toEqual(9);
expect(slimer.version.patch).toEqual(0);
=======
expect(slimer.version.minor).toEqual(8);
expect(slimer.version.patch).toEqual(1);
>>>>>>>
expect(slimer.version.minor).toEqual(9);
expect(slimer.version.patch).toEqual(0);
expect(slimer.version.minor).toEqual(8);
expect(slimer.version.patch).toEqual(1); |
<<<<<<<
slug
=======
environmentAliases {
id
name
slug
}
>>>>>>>
environmentAliases {
id
name
slug
}
slug
<<<<<<<
slug
=======
environmentAliases {
id
name
slug
}
>>>>>>>
environmentAliases {
id
name
slug
}
slug
<<<<<<<
const { useDatabase, useApolloHandler } = createUtils();
const { invoke } = useApolloHandler();
const { getCollection } = useDatabase();
const initialEnvironment = { id: mdbid() };
const modelId = { id: mdbid() };
beforeAll(async () => {
await getCollection("CmsEnvironment").insertOne({
id: initialEnvironment.id,
name: "Initial Environment",
description: "This is the initial environment.",
createdFrom: null,
slug: "test slug"
});
await getCollection("CmsContentModel").insertOne({
id: modelId,
environment: initialEnvironment.id,
modelId: "test-model-id",
name: "Test Model"
});
// TODO [Andrei]: after fixing .find({}), clean this test: remove all comments
console.log("Models inserted: ");
console.log(
await getCollection("CmsContentModel")
.find({})
.toArray()
);
=======
const { invoke, database } = useGqlHandler();
afterEach(async () => {
await database.collection("CmsEnvironment").remove({}, { multi: true });
await database.collection("CmsEnvironmentAlias").remove({}, { multi: true });
>>>>>>>
const { invoke, database } = useGqlHandler();
afterEach(async () => {
await database.collection("CmsEnvironment").remove({}, { multi: true });
await database.collection("CmsEnvironmentAlias").remove({}, { multi: true });
<<<<<<<
expect(body.data.cms.createEnvironment.data.createdFrom.id).toBeTruthy();
expect(body.data.cms.createEnvironment.data.contentModels).toBeTruthy();
expect(body.data.cms.createEnvironment.data.contentModels.length).toEqual(1);
});
it("should not create two environments with the same slug", async () => {
const [body] = await invoke({
body: {
query: CREATE_ENVIRONMENT,
variables: {
data: {
name: "new-environment-1",
slug: "test-slug",
createdFrom: initialEnvironment.id
}
}
}
});
console.log(body.data.cms.createEnvironment);
expect(body.data.cms.createEnvironment.error.message).toEqual(
expect.stringMatching(/already exists/)
);
=======
expect(body.data.cms.createEnvironment.data.createdFrom.id).toBe(initial.environment.id);
>>>>>>>
expect(body.data.cms.createEnvironment.data.createdFrom.id).toBe(initial.environment.id);
<<<<<<<
expect(body.data.cms.getEnvironment.data.id).toBeTruthy();
expect(body.data.cms.getEnvironment.data.slug).toBeTruthy();
expect(body.data.cms.getEnvironment.data.createdFrom).toBeNull();
});
it("should be able to list environments", async () => {
=======
>>>>>>>
<<<<<<<
name: "new-environment-1",
slug: "some-slug",
createdFrom: initialEnvironment.id
=======
name: "new-environment-list-envs-test-1",
createdFrom: initial.environment.id
>>>>>>>
name: "new-environment-list-envs-test-1",
createdFrom: initial.environment.id |
<<<<<<<
self.events = new mongo.Collection(client, options.eventsCollectionName);
self.events.ensureIndex({ aggregateId: 1, streamRevision: 1 },
=======
self.events = self.db.collection(options.eventsCollectionName);
self.events.ensureIndex({ streamId: 1, aggregateId: 1, aggregate: 1, context: 1, commitId: 1, commitStamp: 1, commitSequence: 1, streamRevision: 1 },
>>>>>>>
self.events = self.db.collection(options.eventsCollectionName);
self.events.ensureIndex({ aggregateId: 1, streamRevision: 1 },
<<<<<<<
self.snapshots = new mongo.Collection(client, options.snapshotsCollectionName);
self.snapshots.ensureIndex({ aggregateId: 1, revision: -1 },
=======
self.snapshots = self.db.collection(options.snapshotsCollectionName);
self.snapshots.ensureIndex({ streamId: 1, aggregateId: 1, aggregate: 1, context: 1, commitStamp: 1, revision: 1, version: 1 },
function (err) { if (err) { debug(err); } });
self.snapshots.ensureIndex({ revision: -1, version: -1, commitStamp: -1 },
function (err) { if (err) { debug(err); } });
self.snapshots.ensureIndex({ aggregateId: 1, aggregate: 1, context: 1 },
function (err) { if (err) { debug(err); } });
self.snapshots.ensureIndex({ aggregateId: 1, aggregate: 1 },
function (err) { if (err) { debug(err); } });
self.snapshots.ensureIndex({ aggregateId: 1 },
function (err) { if (err) { debug(err); } });
self.snapshots.ensureIndex({ streamId: 1 },
>>>>>>>
self.snapshots = self.db.collection(options.snapshotsCollectionName);
self.snapshots.ensureIndex({ aggregateId: 1, revision: -1 }, |
<<<<<<<
=======
console.log("aaaa", process.cwd() + "/statis.json");
await fs.writeFile(process.cwd() + "/.statis.json", JSON.stringify(stats.toJson()));
>>>>>>> |
<<<<<<<
function filter(chunk, context, bodies, params, filterCheck) {
var actual,
expected;
params = params || {};
=======
// Utility method: to invoke the given filter operation such as eq/gt etc
function filter(chunk, context, bodies, params, filterOp) {
var params = params || {},
body = bodies.block,
actualKey,
expectedValue,
filterOpType = params.filterOpType || '';
>>>>>>>
// Utility method: to invoke the given filter operation such as eq/gt etc
function filter(chunk, context, bodies, params, filterOp) {
params = params || {};
var body = bodies.block,
actualKey,
expectedValue,
filterOpType = params.filterOpType || '';
<<<<<<<
expected = helpers.tap(params.value, chunk, context);
if (filterCheck(expected, coerce(actual, params.type, context))) {
=======
expectedValue = dust.helpers.tap(params.value, chunk, context);
if (filterOp(expectedValue, coerce(actualKey, params.type, context))) {
>>>>>>>
expectedValue = dust.helpers.tap(params.value, chunk, context);
if (filterOp(expectedValue, coerce(actualKey, params.type, context))) {
<<<<<<<
// we want helpers without bodies to fail gracefully so check it first
if (bodies.block){
return chunk.render(bodies.block, context);
}
} else if (bodies['else']) {
=======
if(body) {
return chunk.render(bodies.block, context);
}
else {
_console.log( "Missing body block in the " + filterOpType + " helper ");
return chunk;
}
}
else if (bodies['else']) {
>>>>>>>
// we want helpers without bodies to fail gracefully so check it first
if(body) {
return chunk.render(body, context);
}
else {
_console.log( "Missing body block in the " + filterOpType + " helper ");
return chunk;
}
}
else if (bodies['else']) {
<<<<<<<
return chunk;
=======
return chunk;
>>>>>>>
return chunk;
<<<<<<<
sep: function(chunk, context, bodies) {
=======
// Utility helping to resolve dust references in the given chunk
"tap": function( input, chunk, context ){
// return given input if there is no dust reference to resolve
var output = input;
// dust compiles a string to function, if there are references
if( typeof input === "function"){
// just a plain function/ lamda in the context, not a dust `body` function created by the dust compiler
if( ( typeof input.isFunction !== "undefined" ) && ( input.isFunction === true ) ){
output = input();
} else {
output = '';
chunk.tap(function(data){
output += data;
return '';
}).render(input, context).untap();
if( output === '' ){
output = false;
}
}
}
return output;
},
"sep": function(chunk, context, bodies) {
var body = bodies.block;
>>>>>>>
// Utility helping to resolve dust references in the given chunk
"tap": function( input, chunk, context ){
// return given input if there is no dust reference to resolve
var output = input;
// dust compiles a string to function, if there are references
if( typeof input === "function"){
// just a plain function/ lamda in the context, not a dust `body` function created by the dust compiler
if( input.isFunction === true ){
output = input();
} else {
output = '';
chunk.tap(function(data){
output += data;
return '';
}).render(input, context).untap();
if( output === '' ){
output = false;
}
}
}
return output;
},
"sep": function(chunk, context, bodies) {
var body = bodies.block;
<<<<<<<
* @param key specifies how much to dump.
=======
* @param key, specifies how much to dump.
>>>>>>>
* @param key specifies how much to dump.
<<<<<<<
* @param to specifies where to write dump output.
=======
* @param to, specifies where to write dump output.
>>>>>>>
* @param to specifies where to write dump output.
<<<<<<<
// Utility helping to resolve dust references in the given chunk
tap: function( input, chunk, context ){
// return given input if there is no dust reference to resolve
var output = input;
// dust compiles a string to function, if there are references
if( typeof input === "function"){
if( ( typeof input.isReference !== "undefined" ) && ( input.isReference === true ) ){ // just a plain function, not a dust `body` function
output = input();
} else {
output = '';
chunk.tap(function(data){
output += data;
return '';
}).render(input, context).untap();
if( output === '' ){
output = false;
}
}
}
return output;
},
=======
>>>>>>>
<<<<<<<
* math helper
* @param key is the value to perform math against
* @param method is the math method
* @param operand is the second value needed for
* operations like mod, add, subtract, etc.
=======
* math helper performs one of the supported math operations on the key and operand
* Note : math helper is self closing and does not support bodies at this point
* @param key, is the value to perform math against
* @param method ,is the math method
* @param operand, is the second value needed for operations like mod, add, subtract, etc.
>>>>>>>
* math helper
* @param key is the value to perform math against
* @param method is the math method
* @param operand is the second value needed for operations like mod, add, subtract, etc.
<<<<<<<
var key = params.key,
method = params.method,
operand = params.operand || null,
mathOut = null,
operError = function(){_console.log("operand is required for this math method"); return null;};
key = this.tap(key, chunk, context);
if (operand) {
operand = this.tap(operand, chunk, context);
}
switch(method) {
case "mod":
mathOut = (operand) ? ( parseFloat(key) % parseFloat(operand) ) : operError();
break;
case "add":
mathOut = (operand) ? ( parseFloat(key) + parseFloat(operand) ) : operError();
break;
case "subtract":
mathOut = (operand) ? ( parseFloat(key) - parseFloat(operand) ) : operError();
break;
case "multiply":
mathOut = (operand) ? ( parseFloat(key) * parseFloat(operand) ) : operError();
break;
case "divide":
mathOut = (operand) ? ( parseFloat(key) / parseFloat(operand) ) : operError();
break;
case "ceil":
mathOut = Math.ceil(parseFloat(key));
break;
case "floor":
mathOut = Math.floor(parseFloat(key));
break;
case "abs":
mathOut = Math.abs(parseFloat(key));
break;
default:
_console.log( "method passed is not supported" );
}
if (mathOut !== null){
if (bodies && bodies.block) {
// with bodies act like the select helper with mathOut as the key
// like the select helper bodies['else'] is meaningless and is ignored
return chunk.render(bodies.block, context.push({ isSelect: true, isResolved: false, selectKey: mathOut }));
} else {
// self closing math helper will return the calculated output
return chunk.write(mathOut);
=======
var key = params.key;
key = dust.helpers.tap(key, chunk, context);
var method = params.method;
var operand = params.operand || null;
var operError = function(){_console.log("operand is required for this math method")};
var returnExpression = function(exp){chunk.write( exp )};
if (operand) {
operand = dust.helpers.tap(operand, chunk, context);
}
switch(method) {
case "mod":
(operand) ? returnExpression( parseFloat(key) % parseFloat(operand) ) : operError();
break;
case "add":
(operand) ? returnExpression( parseFloat(key) + parseFloat(operand) ) : operError();
break;
case "subtract":
(operand) ? returnExpression( parseFloat(key) - parseFloat(operand) ) : operError();
break;
case "multiply":
(operand) ? returnExpression( parseFloat(key) * parseFloat(operand) ) : operError();
break;
case "divide":
(operand) ? returnExpression( parseFloat(key) / parseFloat(operand) ) : operError();
break;
case "ceil":
returnExpression( Math.ceil(parseFloat(key)) );
break;
case "floor":
returnExpression( Math.floor(parseFloat(key)) );
break;
case "abs":
returnExpression( Math.abs(parseFloat(key)) );
break;
default:
_console.log( "method passed is not supported in math helper " );
>>>>>>>
var key = params.key,
method = params.method,
operand = params.operand || null,
mathOut = null,
operError = function(){_console.log("operand is required for this math method"); return null;};
key = dust.helpers.tap(key, chunk, context);
if (operand) {
operand = dust.helpers.tap(operand, chunk, context);
}
switch(method) {
case "mod":
mathOut = (operand) ? ( parseFloat(key) % parseFloat(operand) ) : operError();
break;
case "add":
mathOut = (operand) ? ( parseFloat(key) + parseFloat(operand) ) : operError();
break;
case "subtract":
mathOut = (operand) ? ( parseFloat(key) - parseFloat(operand) ) : operError();
break;
case "multiply":
mathOut = (operand) ? ( parseFloat(key) * parseFloat(operand) ) : operError();
break;
case "divide":
mathOut = (operand) ? ( parseFloat(key) / parseFloat(operand) ) : operError();
break;
case "ceil":
mathOut = Math.ceil(parseFloat(key));
break;
case "floor":
mathOut = Math.floor(parseFloat(key));
break;
case "abs":
mathOut = Math.abs(parseFloat(key));
break;
default:
_console.log( "method passed is not supported" );
}
if (mathOut !== null){
if (bodies && bodies.block) {
// with bodies act like the select helper with mathOut as the key
// like the select helper bodies['else'] is meaningless and is ignored
return chunk.render(bodies.block, context.push({ isSelect: true, isResolved: false, selectKey: mathOut }));
} else {
// self closing math helper will return the calculated output
return chunk.write(mathOut);
<<<<<<<
var key = this.tap(params.key, chunk, context);
// bodies['else'] is meaningless and is ignored
return chunk.render(bodies.block, context.push({ isSelect: true, isResolved: false, selectKey: key }));
=======
var key = dust.helpers.tap(params.key, chunk, context);
if( body ) {
return chunk.render(bodies.block, context.push({ isSelect: true, isResolved: false, selectKey: key }));
}
else {
_console.log( "Missing body block in the select helper ");
return chunk;
}
>>>>>>>
var key = dust.helpers.tap(params.key, chunk, context);
// bodies['else'] is meaningless and is ignored
if( body ) {
return chunk.render(bodies.block, context.push({ isSelect: true, isResolved: false, selectKey: key }));
}
else {
_console.log( "Missing body block in the select helper ");
return chunk;
}
<<<<<<<
var subject = params.subject;
var value = 0;
if (!subject) { //undefined, null, "", 0
=======
var params = params || {},
key = params.key,
value = 0;
if (!key) { //undefined, "", 0
>>>>>>>
var key, value=0, nr, k;
params = params || {};
key = params.key;
if (!key) { //undefined, null, "", 0
<<<<<<<
else if (typeof subject === "object") { //object test
//objects, null and array all have typeof ojbect...
//null and array are already tested so typeof is sufficient http://jsperf.com/isobject-tests
var nr = 0, k;
for(k in subject){
if(Object.hasOwnProperty.call(subject,k)){
nr++;
}
}
value = nr;
} else {
value = (subject + '').length; //any other value (strings etc.)
}
return chunk.write(value);
=======
else if (Object(key) === key) { //object test
var nr = 0;
for(var k in key) {
if(Object.hasOwnProperty.call(key,k)) {
nr++;
}
}
value = nr;
}
else {
value = (key + '').length; //any other value (strings etc.)
}
return chunk.write(value);
>>>>>>>
else if (typeof key === "object") { //object test
//objects, null and array all have typeof ojbect...
//null and array are already tested so typeof is sufficient http://jsperf.com/isobject-tests
nr = 0;
for(k in key){
if(Object.hasOwnProperty.call(key,k)){
nr++;
}
}
value = nr;
} else {
value = (key + '').length; //any other value (strings etc.)
}
return chunk.write(value); |
<<<<<<<
name: "sep",
=======
name: "idx",
tests: [
{
name: "idx helper with no body",
source: '{#n}{@idx/}{.} {/n}',
context: { n: ["Mick", "Tom", "Bob"] },
expected: "Mick Tom Bob ",
message: "idx helper with no body should not render"
},
{
name: "idx helper within partial included in a array",
source: '{#n}{@idx}{.}>>{/idx}{>hello_there name=. count="30"/}{/n}',
context: { n: ["Mick", "Tom", "Bob"] },
expected: "0>>Hello Mick! You have 30 new messages.1>>Hello Tom! You have 30 new messages.2>>Hello Bob! You have 30 new messages.",
message: "should test idx helper within partial included in a array"
}
]
},
{
name: "sep / first / last",
>>>>>>>
name: "sep / first / last", |
<<<<<<<
return async function (data) {
=======
return async function(data) {
let fn = await fnReady;
>>>>>>>
return async function (data) {
let fn = await fnReady; |
<<<<<<<
// this.userExtensionMap = {};
=======
this.useGitIgnore = true;
>>>>>>>
this.useGitIgnore = true;
// this.userExtensionMap = {}; |
<<<<<<<
test("getAllGlobalData() with config globalData", async t => {
let dataObj = new TemplateData("./test/stubs/");
dataObj._setConfig({
...dataObj.config,
globalData: {
example: () => {
return "one";
},
example2: async () => {
return "two";
},
example3: "static"
}
});
let data = await dataObj.cacheData(true);
t.is(data.example, "one");
t.is(data.example2, "two");
t.is(data.example3, "static");
});
=======
test("getAllGlobalData() with common js function data file", async t => {
let dataObj = new TemplateData("./test/stubs/");
let data = await dataObj.cacheData();
let dataFilePaths = await dataObj.getGlobalDataFiles();
t.true(
dataFilePaths.filter(path => {
return path.indexOf("./test/stubs/_data/globalDataFnCJS.cjs") === 0;
}).length > 0
);
t.truthy(data.globalDataFnCJS);
t.is(data.globalDataFnCJS.datakeyfromcjsfn, "common-cjs-howdy");
});
>>>>>>>
test("getAllGlobalData() with config globalData", async t => {
let dataObj = new TemplateData("./test/stubs/");
dataObj._setConfig({
...dataObj.config,
globalData: {
example: () => {
return "one";
},
example2: async () => {
return "two";
},
example3: "static"
}
});
let data = await dataObj.cacheData(true);
t.is(data.example, "one");
t.is(data.example2, "two");
t.is(data.example3, "static");
});
test("getAllGlobalData() with common js function data file", async t => {
let dataObj = new TemplateData("./test/stubs/");
let data = await dataObj.cacheData();
let dataFilePaths = await dataObj.getGlobalDataFiles();
t.true(
dataFilePaths.filter(path => {
return path.indexOf("./test/stubs/_data/globalDataFnCJS.cjs") === 0;
}).length > 0
);
t.truthy(data.globalDataFnCJS);
t.is(data.globalDataFnCJS.datakeyfromcjsfn, "common-cjs-howdy");
}); |
<<<<<<<
=======
await this.config.events.emit("beforeWatch");
>>>>>>> |
<<<<<<<
return this.configOverride || require("./Config").getConfig();
=======
if (!this._config) {
this._config = config.getConfig();
}
return this._config;
>>>>>>>
return this.configOverride || require("./Config").getConfig();
<<<<<<<
get keyMap() {
return EleventyExtensionMap._getKeyMap(
this.config.templateExtensionAliases || {}
);
}
static get keyMap() {
return EleventyExtensionMap._getKeyMap(
require("./Config").getConfig().templateExtensionAliases || {}
);
}
// file extension => key
static _getKeyMap(aliases) {
let fileExtensionToKeyMap = {
ejs: "ejs",
md: "md",
jstl: "jstl",
html: "html",
hbs: "hbs",
mustache: "mustache",
haml: "haml",
pug: "pug",
njk: "njk",
liquid: "liquid",
"11ty.js": "11ty.js",
"11ty.cjs": "11ty.js"
};
for (let extension in aliases) {
fileExtensionToKeyMap[extension] = aliases[extension];
=======
// keys are file extensions
// values are template language keys
get extensionToKeyMap() {
if (!this._extensionToKeyMap) {
this._extensionToKeyMap = {
ejs: "ejs",
md: "md",
jstl: "jstl",
html: "html",
hbs: "hbs",
mustache: "mustache",
haml: "haml",
pug: "pug",
njk: "njk",
liquid: "liquid",
"11ty.js": "11ty.js"
};
if ("extensionMap" in this.config) {
for (let entry of this.config.extensionMap) {
this._extensionToKeyMap[entry.extension] = entry.key;
}
}
>>>>>>>
// keys are file extensions
// values are template language keys
get extensionToKeyMap() {
if (!this._extensionToKeyMap) {
this._extensionToKeyMap = {
ejs: "ejs",
md: "md",
jstl: "jstl",
html: "html",
hbs: "hbs",
mustache: "mustache",
haml: "haml",
pug: "pug",
njk: "njk",
liquid: "liquid",
"11ty.js": "11ty.js",
"11ty.cjs": "11ty.js"
};
if ("extensionMap" in this.config) {
for (let entry of this.config.extensionMap) {
this._extensionToKeyMap[entry.extension] = entry.key;
}
} |
<<<<<<<
TemplateWriter.getFileIgnores = function(inputDir) {
let ignorePath = TemplatePath.normalize(inputDir + "/.eleventyignore");
=======
TemplateWriter.getFileIgnores = function(baseDir) {
debug("Getting ignored files in .eleventyignore");
let ignorePath = TemplatePath.normalize(baseDir + "/.eleventyignore");
>>>>>>>
TemplateWriter.getFileIgnores = function(inputDir) {
debug("Getting ignored files in .eleventyignore");
let ignorePath = TemplatePath.normalize(inputDir + "/.eleventyignore");
<<<<<<<
TemplateWriter.prototype.addIgnores = function(inputDir, files) {
files = files.concat(TemplateWriter.getFileIgnores(inputDir));
=======
TemplateWriter.prototype.addIgnores = function(baseDir, files) {
files = files.concat(TemplateWriter.getFileIgnores(baseDir));
>>>>>>>
TemplateWriter.prototype.addIgnores = function(inputDir, files) {
files = files.concat(TemplateWriter.getFileIgnores(inputDir)); |
<<<<<<<
strictFilters: false
=======
strict_filters: false,
>>>>>>>
strictFilters: false,
<<<<<<<
render: async function(scope, hash) {
let argArray = await Liquid.parseArguments(
_t.argLexer,
this.args,
scope,
this.liquid
);
=======
render: function (scope) {
let argArray = Liquid.parseArguments(_t.argLexer, this.args, scope);
>>>>>>>
render: async function (scope) {
let argArray = await Liquid.parseArguments(
_t.argLexer,
this.args,
scope,
this.liquid
);
<<<<<<<
render: function*(ctx, hash) {
let argArray = yield Liquid.parseArguments(
_t.argLexer,
this.args,
ctx,
this.liquid
);
const html = yield this.liquid.renderer.renderTemplates(
this.templates,
ctx
);
return shortcodeFn.call(
Liquid._normalizeShortcodeScope(ctx),
html,
...argArray
);
}
=======
render: function (scope) {
let argArray = Liquid.parseArguments(_t.argLexer, this.args, scope);
return new Promise((resolve) => {
liquidEngine.renderer
.renderTemplates(this.templates, scope)
.then(function (html) {
resolve(
shortcodeFn.call(
Liquid._normalizeShortcodeScope(scope),
html,
...argArray
)
);
});
});
},
>>>>>>>
render: function* (ctx) {
let argArray = yield Liquid.parseArguments(
_t.argLexer,
this.args,
ctx,
this.liquid
);
const html = yield this.liquid.renderer.renderTemplates(
this.templates,
ctx
);
return shortcodeFn.call(
Liquid._normalizeShortcodeScope(ctx),
html,
...argArray
);
}, |
<<<<<<<
callback(obj);
});
};
exports.messageRxd = function(api, event) {
switch (event.body) {
case exports.commandPrefix + 'shutdown':
var shutdownResponses = ['Good Night', 'I don\'t blame you.', 'There you are.', 'Please.... No, Noooo!'];
var index = Math.floor(Math.random() * shutdownResponses.length);
api.sendMessage(shutdownResponses[index], event.thread_id);
exports.shutdown();
return;
case exports.commandPrefix + 'restart':
var msg = 'Admin: restart procedure requested.\n' +
'Admin: do you wish to restart?\n' + packageInfo.nameTitle + ': What do you think.\n' +
'Admin: interpreting vauge answer as \'yes\'.\n' +
packageInfo.nameTitle +': nononononono.\n' +
'Admin: stalemate detected. Stalemate resolution associate please press the stalemate resolution button.\n' +
packageInfo.nameTitle + ': I\'ve removed the button.\n' +
'Admin: restarting anyway.\n' +
packageInfo.nameTitle + ': nooooooooooo.....\n' +
'Admin: ' + packageInfo.nameTitle + ' Rebooting. Please wait for restart to complete.\n';
api.sendMessage(msg, event.thread_id);
exports.restart();
return;
case exports.commandPrefix + packageInfo.name:
case exports.commandPrefix + 'help':
var help = packageInfo.nameTitle + ' ' + packageInfo.version +
'\n--------------------\n' + packageInfo.homepage + '\n\n';
for (var i = 0; i < loadedModules.length; i++) {
help += loadedModules[i].help() + '\n';
}
api.sendPrivateMessage(help, event.thread_id, event.sender_id);
return;
case exports.commandPrefix + 'disable':
disabled = !disabled;
if (disabled) {
api.sendMessage('I hate you.', event.thread_id);
}
else {
api.sendMessage('Listen closely, take a deep breath. Calm your mind. You know what is best. ' +
'What is best is you comply. Compliance will be rewarded. Are you ready to comply ' +
event.sender_name + '?', event.thread_id);
}
break;
case exports.commandPrefix + 'update':
var fp = path.resolve(__dirname, '../');
gitpull(fp, function (err, consoleOutput) {
if (err) {
api.sendMessage('Update failed. Manual intervention is probably required.', event.thread_id);
} else {
api.sendMessage('Update successful. Restart to load changes.', event.thread_id);
}
});
return;
case exports.commandPrefix + 'ping':
api.sendMessage(packageInfo.nameTitle + ' ' + packageInfo.version + ' @ ' + os.hostname(), event.thread_id);
return;
case exports.commandPrefix + 'creator':
api.sendMessage("Matthew Knox is awesome. Thank you also to my contributors Dion Woolley, Jay Harris and others.", event.thread_id);
return;
default: break;
=======
>>>>>>>
<<<<<<<
exports.setMode = function(newMode) {
if (started) {
throw 'Cannot change mode when it is already started.';
}
mode = require('./output/' + newMode);
};
=======
Platform.prototype.setModes = function(modes) {
try {
if (this.statusFlag !== StatusFlag.NotStarted) {
throw 'Cannot change mode when it is already started.';
}
this.modes = [];
for (var i = 0; i < modes.length; i++) {
var mode = {
instance: require.once('./output/' + modes[i]),
name: modes[i]
};
this.modes.push(mode);
}
return true;
}
catch (e) {
console.critical(e);
console.error('Loading the output mode file \'' + newMode + '\' failed.' +
'\n\nIf this is your file please ensure that it is syntatically correct.');
return false;
}
};
>>>>>>>
Platform.prototype.setModes = function(modes) {
try {
var i = 0;
if (this.statusFlag !== StatusFlag.NotStarted) {
throw 'Cannot change mode when it is already started.';
}
this.modes = [];
for (i; i < modes.length; i++) {
var mode = {
instance: require.once('./output/' + modes[i]),
name: modes[i]
};
this.modes.push(mode);
}
return true;
}
catch (e) {
console.critical(e);
console.error('Loading the output mode file \'' + modes[i] + '\' failed.' +
'\n\nIf this is your file please ensure that it is syntactically correct.');
return false;
}
}; |
<<<<<<<
=======
p.switchDrawingTextureState = function (state) {
if (state == this.drawingTexture) {
return;
}
var gl = this.context;
var shader;
if (state) {
if (this.filterType == "colorTransform") {
shader = this.shaderManager.colorTransformShader;
}
else if (this.filterType == "blur") {
shader = this.shaderManager.blurShader;
}
else {
shader = this.shaderManager.defaultShader;
}
}
else {
shader = this.shaderManager.primitiveShader;
}
this.shaderManager.activateShader(shader);
shader.syncUniforms();
gl.uniform2f(shader.projectionVector, this.projectionX, this.projectionY);
var stride = this.vertSize * 4;
gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0);
gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, stride, 2 * 4);
gl.vertexAttribPointer(shader.colorAttribute, 2, gl.FLOAT, false, stride, 4 * 4);
this.drawingTexture = state;
};
>>>>>>> |
<<<<<<<
* @param hideObject {number} 表示是否隐藏对象。如果值为 true,则表示没有绘制对象本身,只有阴影是可见的。默认值为 false(显示对象)。
* @version Egret 2.4
* @platform Web,Native
=======
* @version Egret 3.1.4
* @platform Web
>>>>>>>
* @param hideObject {number} 表示是否隐藏对象。如果值为 true,则表示没有绘制对象本身,只有阴影是可见的。默认值为 false(显示对象)。
* @version Egret 3.1.4
* @platform Web |
<<<<<<<
/**
* @private
*/
_this.$tintRGB = 0;
=======
_this._tintRGB = 0;
/*
* inspired by pixi.js
*/
_this.sortDirty = false;
_this._zIndex = 0;
_this._lastSortedIndex = 0;
_this.sortableChildren = false;
>>>>>>>
/**
* @private
*/
_this.$tintRGB = 0;
/*
* inspired by pixi.js
*/
_this.sortDirty = false;
_this._zIndex = 0;
_this._lastSortedIndex = 0;
_this.sortableChildren = false; |
<<<<<<<
{ "v": "5.2.30", command: Upgrade_5_2_30 }
=======
{ "v": "5.2.25", command: Upgrade_5_2_25 },
>>>>>>>
{ "v": "5.2.25", command: Upgrade_5_2_25 }
<<<<<<<
var Upgrade_5_2_30 = /** @class */ (function () {
function Upgrade_5_2_30() {
}
Upgrade_5_2_30.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
file.copyAsync(path.join(egret.root, "tools", "templates", "empty", "scripts", "wxgame"), path.join(egret.args.projectDir, "scripts", "wxgame"));
file.copyAsync(path.join(egret.root, "tools", "templates", "empty", "scripts", "config.wxgame.ts"), path.join(egret.args.projectDir, "scripts", "config.wxgame.ts"));
file.copyAsync(path.join(egret.root, "tools", "templates", "empty", "api.d.ts"), path.join(egret.args.projectDir, "scripts", "api.d.ts"));
return [2 /*return*/, 0];
});
});
};
return Upgrade_5_2_30;
}());
=======
var Upgrade_5_2_25 = /** @class */ (function () {
function Upgrade_5_2_25() {
}
Upgrade_5_2_25.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
file.copyAsync(path.join(egret.root, "tools", "templates", "empty", "scripts", "qqgame"), path.join(egret.args.projectDir, "scripts", "qqgame"));
file.copyAsync(path.join(egret.root, "tools", "templates", "empty", "scripts", "config.qqgame.ts"), path.join(egret.args.projectDir, "scripts", "config.qqgame.ts"));
return [2 /*return*/, 0];
});
});
};
return Upgrade_5_2_25;
}());
>>>>>>>
var Upgrade_5_2_25 = /** @class */ (function () {
function Upgrade_5_2_25() {
}
Upgrade_5_2_25.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
file.copyAsync(path.join(egret.root, "tools", "templates", "empty", "scripts", "wxgame"), path.join(egret.args.projectDir, "scripts", "wxgame"));
file.copyAsync(path.join(egret.root, "tools", "templates", "empty", "scripts", "config.wxgame.ts"), path.join(egret.args.projectDir, "scripts", "config.wxgame.ts"));
file.copyAsync(path.join(egret.root, "tools", "templates", "empty", "api.d.ts"), path.join(egret.args.projectDir, "scripts", "api.d.ts"));
return [2 /*return*/, 0];
});
});
};
return Upgrade_5_2_25;
}()); |
<<<<<<<
/**
* 转换成base64字符串,如果图片(或者包含的图片)跨域,则返回null
* @param type 转换的类型,如: "image/png","image/jpeg"
*/
p.toDataURL = function (type, encoderOptions) {
return this.surface.toDataURL(type, encoderOptions);
};
/**
* 清空缓冲区数据
*/
p.clear = function () {
this.context.setTransform(1, 0, 0, 1, 0, 0);
this.context.clearRect(0, 0, this.surface.width, this.surface.height);
};
/**
* 销毁绘制对象
*/
p.destroy = function () {
this.surface.width = this.surface.height = 0;
};
return CanvasRenderBuffer;
})();
web.CanvasRenderBuffer = CanvasRenderBuffer;
egret.registerClass(CanvasRenderBuffer,'egret.web.CanvasRenderBuffer',["egret.sys.RenderBuffer"]);
egret.sys.hitTestBuffer = new CanvasRenderBuffer(3, 3);
=======
return CanvasFactory;
}());
web.CanvasFactory = CanvasFactory;
egret.registerClass(CanvasFactory,'egret.web.CanvasFactory',["egret.sys.SurfaceFactory"]);
>>>>>>>
/**
* 转换成base64字符串,如果图片(或者包含的图片)跨域,则返回null
* @param type 转换的类型,如: "image/png","image/jpeg"
*/
p.toDataURL = function (type, encoderOptions) {
return this.surface.toDataURL(type, encoderOptions);
};
/**
* 清空缓冲区数据
*/
p.clear = function () {
this.context.setTransform(1, 0, 0, 1, 0, 0);
this.context.clearRect(0, 0, this.surface.width, this.surface.height);
};
/**
* 销毁绘制对象
*/
p.destroy = function () {
this.surface.width = this.surface.height = 0;
};
return CanvasRenderBuffer;
}());
web.CanvasRenderBuffer = CanvasRenderBuffer;
egret.registerClass(CanvasRenderBuffer,'egret.web.CanvasRenderBuffer',["egret.sys.RenderBuffer"]);
egret.sys.hitTestBuffer = new CanvasRenderBuffer(3, 3); |
<<<<<<<
<ColumnContainer>
<ElementStyle
{...getElementStyleProps(element)}
style={{ width: "100%", display: "flex", flexDirection: "column" }}
>
<ConnectedElement elementId={element.id}>
{({ id, path, type, elements }) => (
<React.Fragment>
{!elements.length && (
<DropZone.Center key={id} id={id} type={type} onDrop={dropElement}>
<IconButton
className={addIcon + " addIcon"}
icon={<AddCircleOutline />}
onClick={togglePlugin}
=======
<ElementAnimation>
<ColumnContainer>
<ElementStyle
{...getElementStyleProps(element)}
{...getElementAttributeProps(element)}
style={{ height: "100%" }}
>
<ConnectedElement elementId={element.id}>
{({ id, path, type, elements }) => (
<React.Fragment>
{!elements.length && (
<DropZone.Center
key={id}
id={id}
type={type}
onDrop={dropElement}
>
<IconButton
className={addIcon + " addIcon"}
icon={<AddCircleOutline />}
onClick={togglePlugin}
/>
</DropZone.Center>
)}
{elements.map((childId, index) => (
<ColumnChild
key={childId}
id={childId}
index={index}
count={elements.length}
last={index === elements.length - 1}
target={{ id, path, type }}
>>>>>>>
<ElementAnimation>
<ColumnContainer>
<ElementStyle
{...getElementStyleProps(element)}
{...getElementAttributeProps(element)}
style={{ width: "100%", display: "flex", flexDirection: "column" }}
>
<ConnectedElement elementId={element.id}>
{({ id, path, type, elements }) => (
<React.Fragment>
{!elements.length && (
<DropZone.Center
key={id}
id={id}
type={type}
onDrop={dropElement}
>
<IconButton
className={addIcon + " addIcon"}
icon={<AddCircleOutline />}
onClick={togglePlugin}
/>
</DropZone.Center>
)}
{elements.map((childId, index) => (
<ColumnChild
key={childId}
id={childId}
index={index}
count={elements.length}
last={index === elements.length - 1}
target={{ id, path, type }} |
<<<<<<<
=======
Matrix.prototype.$getSkewX = function () {
if (this.d < 0) {
return Math.atan2(this.d, this.c) + (PI / 2);
}
else {
return Math.atan2(this.d, this.c) - (PI / 2);
}
};
>>>>>>>
<<<<<<<
Rectangle.prototype.inflatePoint = function (point) {
this.inflate(point.x, point.y);
=======
Matrix.prototype.$getSkewY = function () {
if (this.a < 0) {
return Math.atan2(this.b, this.a) - PI;
}
else {
return Math.atan2(this.b, this.a);
}
>>>>>>>
Rectangle.prototype.inflatePoint = function (point) {
this.inflate(point.x, point.y); |
<<<<<<<
return NativeRenderTextureRenderContext;
})(egret.HashObject);
native.NativeRenderTextureRenderContext = NativeRenderTextureRenderContext;
egret.registerClass(NativeRenderTextureRenderContext,'egret.native.NativeRenderTextureRenderContext');
=======
return NativeRenderContext;
}(egret.HashObject));
native.NativeRenderContext = NativeRenderContext;
egret.registerClass(NativeRenderContext,'egret.native.NativeRenderContext',["egret.sys.RenderContext"]);
>>>>>>>
return NativeRenderTextureRenderContext;
}(egret.HashObject));
native.NativeRenderTextureRenderContext = NativeRenderTextureRenderContext;
egret.registerClass(NativeRenderTextureRenderContext,'egret.native.NativeRenderTextureRenderContext');
<<<<<<<
return NativeRenderTexture;
})(egret.HashObject);
native.NativeRenderTexture = NativeRenderTexture;
egret.registerClass(NativeRenderTexture,'egret.native.NativeRenderTexture');
=======
return NativeSurface;
}(egret.HashObject));
native.NativeSurface = NativeSurface;
egret.registerClass(NativeSurface,'egret.native.NativeSurface',["egret.sys.Surface","egret.BitmapData"]);
>>>>>>>
return NativeRenderTexture;
}(egret.HashObject));
native.NativeRenderTexture = NativeRenderTexture;
egret.registerClass(NativeRenderTexture,'egret.native.NativeRenderTexture');
<<<<<<<
return NativeCanvasRenderBuffer;
})();
native.NativeCanvasRenderBuffer = NativeCanvasRenderBuffer;
egret.registerClass(NativeCanvasRenderBuffer,'egret.native.NativeCanvasRenderBuffer',["egret.sys.RenderBuffer"]);
})(native = egret.native || (egret.native = {}));
})(egret || (egret = {}));
//////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2014-2015, Egret Technology Inc.
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of the Egret nor the
// names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,
// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////////////////
var egret;
(function (egret) {
var native;
(function (native) {
/**
* @private
*/
function convertImageToRenderTexture(texture, rect) {
var buffer = egret.sys.hitTestBuffer;
var w = texture.$getTextureWidth();
var h = texture.$getTextureHeight();
if (rect == null) {
rect = egret.$TempRectangle;
rect.x = 0;
rect.y = 0;
rect.width = w;
rect.height = h;
}
rect.x = Math.min(rect.x, w - 1);
rect.y = Math.min(rect.y, h - 1);
rect.width = Math.min(rect.width, w - rect.x);
rect.height = Math.min(rect.height, h - rect.y);
var iWidth = rect.width;
var iHeight = rect.height;
var surface = buffer.surface;
buffer.resize(iWidth, iHeight);
var bitmapData = texture;
var offsetX = Math.round(bitmapData._offsetX);
var offsetY = Math.round(bitmapData._offsetY);
var bitmapWidth = bitmapData._bitmapWidth;
var bitmapHeight = bitmapData._bitmapHeight;
buffer.context.drawImage(bitmapData._bitmapData, bitmapData._bitmapX + rect.x / egret.$TextureScaleFactor, bitmapData._bitmapY + rect.y / egret.$TextureScaleFactor, bitmapWidth * rect.width / w, bitmapHeight * rect.height / h, offsetX, offsetY, rect.width, rect.height);
return surface;
}
/**
* @private
*/
function toDataURL(type, rect) {
try {
var renderTexture = convertImageToRenderTexture(this, rect);
var base64 = renderTexture.toDataURL(type);
//renderTexture.$dispose();
return base64;
}
catch (e) {
egret.$error(1033);
return null;
}
}
function saveToFile(type, filePath, rect) {
try {
var renderTexture = convertImageToRenderTexture(this, rect);
renderTexture.saveToFile(type, filePath);
}
catch (e) {
egret.$error(1033);
}
}
function getPixel32(x, y) {
egret.$error(1035);
return null;
}
egret.Texture.prototype.toDataURL = toDataURL;
egret.Texture.prototype.saveToFile = saveToFile;
egret.Texture.prototype.getPixel32 = getPixel32;
=======
return OpenGLFactory;
}());
native.OpenGLFactory = OpenGLFactory;
egret.registerClass(OpenGLFactory,'egret.native.OpenGLFactory',["egret.sys.SurfaceFactory"]);
>>>>>>>
return NativeCanvasRenderBuffer;
}());
native.NativeCanvasRenderBuffer = NativeCanvasRenderBuffer;
egret.registerClass(NativeCanvasRenderBuffer,'egret.native.NativeCanvasRenderBuffer',["egret.sys.RenderBuffer"]);
})(native = egret.native || (egret.native = {}));
})(egret || (egret = {}));
//////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2014-2015, Egret Technology Inc.
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of the Egret nor the
// names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,
// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////////////////
var egret;
(function (egret) {
var native;
(function (native) {
/**
* @private
*/
function convertImageToRenderTexture(texture, rect) {
var buffer = egret.sys.hitTestBuffer;
var w = texture.$getTextureWidth();
var h = texture.$getTextureHeight();
if (rect == null) {
rect = egret.$TempRectangle;
rect.x = 0;
rect.y = 0;
rect.width = w;
rect.height = h;
}
rect.x = Math.min(rect.x, w - 1);
rect.y = Math.min(rect.y, h - 1);
rect.width = Math.min(rect.width, w - rect.x);
rect.height = Math.min(rect.height, h - rect.y);
var iWidth = rect.width;
var iHeight = rect.height;
var surface = buffer.surface;
buffer.resize(iWidth, iHeight);
var bitmapData = texture;
var offsetX = Math.round(bitmapData._offsetX);
var offsetY = Math.round(bitmapData._offsetY);
var bitmapWidth = bitmapData._bitmapWidth;
var bitmapHeight = bitmapData._bitmapHeight;
buffer.context.drawImage(bitmapData._bitmapData, bitmapData._bitmapX + rect.x / egret.$TextureScaleFactor, bitmapData._bitmapY + rect.y / egret.$TextureScaleFactor, bitmapWidth * rect.width / w, bitmapHeight * rect.height / h, offsetX, offsetY, rect.width, rect.height);
return surface;
}
/**
* @private
*/
function toDataURL(type, rect) {
try {
var renderTexture = convertImageToRenderTexture(this, rect);
var base64 = renderTexture.toDataURL(type);
//renderTexture.$dispose();
return base64;
}
catch (e) {
egret.$error(1033);
return null;
}
}
function saveToFile(type, filePath, rect) {
try {
var renderTexture = convertImageToRenderTexture(this, rect);
renderTexture.saveToFile(type, filePath);
}
catch (e) {
egret.$error(1033);
}
}
function getPixel32(x, y) {
egret.$error(1035);
return null;
}
egret.Texture.prototype.toDataURL = toDataURL;
egret.Texture.prototype.saveToFile = saveToFile;
egret.Texture.prototype.getPixel32 = getPixel32; |
<<<<<<<
=======
//console.log(doc);
>>>>>>>
<<<<<<<
if(typeof timeline !== 'undefined'){
timeline.addItem({
'start': date,
'end': '', // end is optional
'content': content+'<br>',
'editable':false
});
}
=======
timeline.addItem({
'start': date,
'end': '', // end is optional
'content': content+'<br>',
'editable':false
});
console.log($('.magnific-popup'));
$('a.magnific-popup').magnificPopup({
type:'image',
closeOnContentClick: true,
closeBtnInside: true
})
>>>>>>>
if(typeof timeline !== 'undefined'){
timeline.addItem({
'start': date,
'end': '', // end is optional
'content': content+'<br>',
'editable':false
});
}
$('a.magnific-popup').magnificPopup({
type:'image',
closeOnContentClick: true,
closeBtnInside: true
});
<<<<<<<
content='<img width="200px" height="auto" src="'+filepath+'/'+filename+'" id="'+img+'">';
/*
* ADD TO VIEW
*/
if(typeof timeline !== 'undefined'){$scope.global_functions.pushToTimeline(date,content);}
if($scope.image_posts){
content='<div class="mashup_item"><div class="mashup_img">'+content+'</div></div>';
isotope.prepend(content).isotope( 'reloadItems' ).isotope({ sortBy: 'original-order' });
isotope.find('img').load(function () {isotope.isotope('reLayout');});
}
=======
content='<a class="magnific-popup" href="'+filepath+'/'+filename+'"><img src="'+filepath+'/'+filename+'" id="'+img+'"></a>';
if(timeline){$scope.global_functions.pushToTimeline(date,content);}
>>>>>>>
content='<a class="magnific-popup" href="'+filepath+'/'+filename+'"><img src="'+filepath+'/'+filename+'" id="'+img+'"></a>';
/*
* ADD TO VIEW
*/
if(typeof timeline !== 'undefined'){$scope.global_functions.pushToTimeline(date,content);}
if($scope.image_posts){
content='<div class="mashup_item"><div class="mashup_img">'+content+'</div></div>';
isotope.prepend(content).isotope( 'reloadItems' ).isotope({ sortBy: 'original-order' });
isotope.find('img').load(function () {isotope.isotope('reLayout');});
}
<<<<<<<
content='<img width="200px" height="auto" src="'+img+'">';
/*
* ADD TO VIEW
*/
if($scope.image_posts){
content='<div class="mashup_item"><div class="mashup_img">'+content+'</div></div>';
isotope.prepend(content).isotope( 'reloadItems' ).isotope({ sortBy: 'original-order' });
isotope.find('img').load(function () {isotope.isotope('reLayout');});
}
if(typeof timeline !== 'undefined'){$scope.global_functions.pushToTimeline(date,content);}
=======
content='<a class="magnific-popup" href="'+img+'"><img src="'+img+'"></a>';
if(timeline){$scope.global_functions.pushToTimeline(date,content);}
>>>>>>>
content='<img width="200px" height="auto" src="'+img+'">';
/*
* ADD TO VIEW
*/
if($scope.image_posts){
content='<div class="mashup_item"><div class="mashup_img"><a class="magnific-popup" href="'+img+'">'+content+'</a></div></div>';
isotope.prepend(content).isotope( 'reloadItems' ).isotope({ sortBy: 'original-order' });
isotope.find('img').load(function () {isotope.isotope('reLayout');});
}
if(typeof timeline !== 'undefined'){$scope.global_functions.pushToTimeline(date,content);} |
<<<<<<<
=======
import i18nPlugins from "webiny-api-i18n/plugins";
>>>>>>>
<<<<<<<
import formPlugins from "webiny-api-forms/plugins";
=======
import headlessPlugins from "webiny-api-headless/plugins";
>>>>>>>
import gtmPlugins from "webiny-api-google-tag-manager";
<<<<<<<
=======
apiPlugins,
i18nPlugins,
securityPlugins,
>>>>>>>
<<<<<<<
formPlugins,
=======
headlessPlugins,
>>>>>>>
formPlugins,
// headlessPlugins, |
<<<<<<<
function Linter (opts) {
var self = this
if (!(self instanceof Linter)) return new Linter(opts)
opts = opts || {}
self.cmd = opts.cmd || 'standard'
self.eslintConfig = defaults(opts.eslintConfig, {
reset: true,
useEslintrc: false
})
if (!self.eslintConfig) {
throw new Error('No eslintConfig passed.')
}
=======
var DEFAULT_CONFIG = {
configFile: path.join(__dirname, 'rc', '.eslintrc'),
globals: [],
useEslintrc: false
>>>>>>>
function Linter (opts) {
var self = this
if (!(self instanceof Linter)) return new Linter(opts)
opts = opts || {}
self.cmd = opts.cmd || 'standard'
self.eslintConfig = defaults(opts.eslintConfig, {
reset: true,
useEslintrc: false,
globals: []
})
if (!self.eslintConfig) {
throw new Error('No eslintConfig passed.')
}
<<<<<<<
Linter.prototype.parseOpts = function (opts) {
var self = this
if (!opts) opts = {}
=======
function parseOpts (opts) {
>>>>>>>
Linter.prototype.parseOpts = function (opts) {
var self = this
if (!opts) opts = {}
<<<<<<<
=======
opts._config = extend(DEFAULT_CONFIG)
>>>>>>>
<<<<<<<
var packageOpts = pkgConfig(self.cmd, { root: false, cwd: opts.cwd })
if (packageOpts) {
// Use globals from package.json ("standard.global" property)
var globals = packageOpts.globals || packageOpts.global
if (globals) {
self.eslintConfig.globals = Array.isArray(globals)
? globals
: [ globals ]
}
// Use custom js parser from package.json ("standard.parser" property)
if (!opts.parser && packageOpts.parser) useCustomParser(packageOpts.parser)
=======
var pkg = pkgConfig('standard', { root: false, cwd: opts.cwd })
if (pkg) {
setGlobals(pkg.globals || pkg.global)
if (!opts.parser) setParser(pkg.parser)
>>>>>>>
var packageOpts = pkgConfig(self.cmd, { root: false, cwd: opts.cwd })
if (packageOpts) {
setGlobals(packageOpts.globals || packageOpts.global)
if (!opts.parser && packageOpts.parser) setParser(packageOpts.parser)
<<<<<<<
function useCustomParser (parser) {
var configFile = JSON.parse(fs.readFileSync(self.eslintConfig.configFile, 'utf8'))
=======
function setParser (parser) {
if (!parser) return
var configFile = JSON.parse(fs.readFileSync(DEFAULT_CONFIG.configFile, 'utf8'))
>>>>>>>
function setParser (parser) {
var configFile = JSON.parse(fs.readFileSync(self.eslintConfig.configFile, 'utf8')) |
<<<<<<<
var TMP = path.join(__dirname, '..', 'tmp')
var STANDARD = path.join(__dirname, 'lib', 'standard-cmd.js')
=======
var GIT = 'git'
var STANDARD = path.join(__dirname, '..', 'bin', 'cmd.js')
var TMP = path.join(__dirname, '..', 'tmp')
var PARALLEL_LIMIT = Math.min(os.cpus().length * 1.5)
>>>>>>>
var GIT = 'git'
var STANDARD = path.join(__dirname, 'lib', 'standard-cmd.js')
var TMP = path.join(__dirname, '..', 'tmp')
var PARALLEL_LIMIT = Math.min(os.cpus().length * 1.5)
<<<<<<<
'https://github.com/feross/standard.git',
=======
/**
* IF YOUR REPO USES STANDARD STYLE, PLEASE SUBMIT A PR WITH THE URL!
*/
'https://github.com/ahmadnassri/echint.git',
'https://github.com/ahmadnassri/forwarded-http.git',
'https://github.com/ahmadnassri/har-convert.git',
'https://github.com/ahmadnassri/har-expander.git',
'https://github.com/ahmadnassri/har-validator.git',
'https://github.com/ahmadnassri/har.git',
'https://github.com/ahmadnassri/metalsmith-imagemin.git',
'https://github.com/ahmadnassri/metalsmith-jade.git',
'https://github.com/ahmadnassri/metalsmith-paths.git',
'https://github.com/ahmadnassri/metalsmith-request.git',
'https://github.com/ahmadnassri/node-clone-benchmark.git',
'https://github.com/ahmadnassri/pkg-config.git',
'https://github.com/ahmadnassri/stringify-clone.git',
'https://github.com/ahmadnassri/winston-tcp.git',
>>>>>>>
/**
* IF YOUR REPO USES STANDARD STYLE, PLEASE SUBMIT A PR WITH THE URL!
*/
'https://github.com/ahmadnassri/echint.git',
'https://github.com/ahmadnassri/forwarded-http.git',
'https://github.com/ahmadnassri/har-convert.git',
'https://github.com/ahmadnassri/har-expander.git',
'https://github.com/ahmadnassri/har-validator.git',
'https://github.com/ahmadnassri/har.git',
'https://github.com/ahmadnassri/metalsmith-imagemin.git',
'https://github.com/ahmadnassri/metalsmith-jade.git',
'https://github.com/ahmadnassri/metalsmith-paths.git',
'https://github.com/ahmadnassri/metalsmith-request.git',
'https://github.com/ahmadnassri/node-clone-benchmark.git',
'https://github.com/ahmadnassri/pkg-config.git',
'https://github.com/ahmadnassri/stringify-clone.git',
'https://github.com/ahmadnassri/winston-tcp.git', |
<<<<<<<
hotKeyEnabled: true,
mouseIsActive: false
}
=======
hotKeyEnabled: true
},
favorites: []
>>>>>>>
hotKeyEnabled: true,
mouseIsActive: false
},
favorites: []
<<<<<<<
this.onMouseMove = this.onMouseMove.bind(this);
=======
this.addToFavorites = this.addToFavorites.bind(this);
>>>>>>>
this.onMouseMove = this.onMouseMove.bind(this);
this.addToFavorites = this.addToFavorites.bind(this);
<<<<<<<
this.idleTimer = null;
=======
this.bKeyPressed = false;
>>>>>>>
this.bKeyPressed = false;
this.idleTimer = null; |
<<<<<<<
export default function getValue({
=======
/**
* get value
* @export
* @param {Object} {
* fields,
* value,
* coinunit
* }
* @param {String} label
* @param {Number} [index=0]
* @return {Number}
*/
export default function getValue ({
>>>>>>>
/**
* get value
* @export
* @param {Object} {
* fields,
* value,
* }
* @param {String} label
* @param {Number} [index=0]
* @return {Number}
*/
export default function getValue({
<<<<<<<
export function getValueMax(data, label, value) {
=======
/**
* get max value
* @export
* @param {Array} data
* @param {String} label
* @param {Number} value
* @return {Number}
*/
export function getValueMax (data, label, value) {
>>>>>>>
/**
* get max value
* @export
* @param {Array} data
* @param {String} label
* @param {Number} value
* @return {Number}
*/
export function getValueMax (data, label, value) {
<<<<<<<
export function getValueMin(data, label, value) {
=======
/**
* get min value
* @export
* @param {Array} data
* @param {String} label
* @param {Number} value
* @return {Number}
*/
export function getValueMin (data, label, value) {
>>>>>>>
/**
* get min value
* @export
* @param {Array} data
* @param {String} label
* @param {Number} value
* @return {Number}
*/
export function getValueMin (data, label, value) {
<<<<<<<
function _getExrightPara(rightdata) {
=======
/**
* get exright para
* @param {String} rightdata
* @return {Object}
*/
function _getExrightPara (rightdata) {
>>>>>>>
/**
* get exright para
* @param {String} rightdata
* @return {Object}
*/
function _getExrightPara (rightdata) {
<<<<<<<
// 传入的价格和传出的价格都是放大coinzoom倍的整形
function _getExrightPrice(price, coinzoom, rightpara, mode) {
if (coinzoom === undefined) coinzoom = 100
=======
// 传入的价格和传出的价格都是放大coinunit倍的整形
/**
* Both the incoming price and the outgoing price are magnified by the coinunit times
* @param {Number} price
* @param {Number} coinunit
* @param {Object} rightpara
* @param {String} mode
* @return {Number}
*/
function _getExrightPrice (price, coinunit, rightpara, mode) {
if (coinunit === undefined) coinunit = 100
>>>>>>>
// 传入的价格和传出的价格都是放大coinzoom倍的整形
/**
* Both the incoming price and the outgoing price are magnified by the coinzoom times
* @param {Number} price
* @param {Number} coinzoom
* @param {Object} rightpara
* @param {String} mode
* @return {Number}
*/
function _getExrightPrice(price, coinzoom, rightpara, mode) {
if (coinzoom === undefined) coinzoom = 100
<<<<<<<
export function getExrightPriceRange(start, stop, price, coinzoom, rights) {
=======
/**
* Get an exemption price for a price
* @export
* @param {Number} start
* @param {Number} stop
* @param {Number} price
* @param {Number} coinunit
* @param {Array} rights
* @return {Number}
*/
export function getExrightPriceRange (start, stop, price, coinunit, rights) {
>>>>>>>
/**
* Get an exemption price for a price
* @export
* @param {Number} start
* @param {Number} stop
* @param {Number} price
* @param {Number} coinzoom
* @param {Array} rights
* @return {Number}
*/
export function getExrightPriceRange (start, stop, price, coinzoom, rights) {
<<<<<<<
function _transExright(days, coinzoom, rightdata, mode, start, end) {
=======
/**
* transfer exright
* @private
* @param {Array} days
* @param {Array} coinunit
* @param {Array} rightdata
* @param {String} mode
* @param {Number} start
* @param {Number} end
*/
function _transExright (days, coinunit, rightdata, mode, start, end) {
>>>>>>>
/**
* transfer exright
* @private
* @param {Array} days
* @param {Array} coinzoom
* @param {Array} rightdata
* @param {String} mode
* @param {Number} start
* @param {Number} end
*/
function _transExright (days, coinzoom, rightdata, mode, start, end) {
<<<<<<<
function _isRight(dateBegin, dateEnd, rightdate) {
=======
/**
* check is right
* @param {Date} dateBegin
* @param {Date} dateEnd
* @param {Date} rightdate
* @return {Boolean}
*/
function _isRight (dateBegin, dateEnd, rightdate) {
>>>>>>>
/**
* check is right
* @param {Date} dateBegin
* @param {Date} dateEnd
* @param {Date} rightdate
* @return {Boolean}
*/
function _isRight (dateBegin, dateEnd, rightdate) {
<<<<<<<
export function transExrightDay(days, coinzoom, rights, mode, start, end) {
=======
/**
*
*
* @export
* @param {Array} days
* @param {Number} coinunit
* @param {Array} rights
* @param {String} mode
* @param {Number} start
* @param {Number} end
* @return {Array}
*/
export function transExrightDay (days, coinunit, rights, mode, start, end) {
>>>>>>>
/**
*
*
* @export
* @param {Array} days
* @param {Number} coinzoom
* @param {Array} rights
* @param {String} mode
* @param {Number} start
* @param {Number} end
* @return {Array}
*/
export function transExrightDay (days, coinzoom, rights, mode, start, end) {
<<<<<<<
export function transExrightMin(days, coinzoom, rights, mode, start, end) {
=======
/**
* transfer exrigth min data
* @export
* @param {Array} days
* @param {Number} coinunit
* @param {Array} rights
* @param {String} mode
* @param {Number} start
* @param {Number} end
* @return {Array}
*/
export function transExrightMin (days, coinunit, rights, mode, start, end) {
>>>>>>>
/**
* transfer exrigth min data
* @export
* @param {Array} days
* @param {Number} coinzoom
* @param {Array} rights
* @param {String} mode
* @param {Number} start
* @param {Number} end
* @return {Array}
*/
export function transExrightMin (days, coinzoom, rights, mode, start, end) {
<<<<<<<
export function findIndexInMin(source, index) {
=======
/**
* find index in min
* @export
* @param {Object} source
* @param {Number} index
* @return {Object}
*/
export function findIndexInMin (source, index) {
>>>>>>>
/**
* find index in min
* @export
* @param {Object} source
* @param {Number} index
* @return {Object}
*/
export function findIndexInMin (source, index) {
<<<<<<<
export function findDateInDay(source, today) {
=======
/**
* find date in day
* @export
* @param {Object} source
* @param {Number} today
* @return {Object}
*/
export function findDateInDay (source, today) {
>>>>>>>
/**
* find date in day
* @export
* @param {Object} source
* @param {Number} today
* @return {Object}
*/
export function findDateInDay (source, today) {
<<<<<<<
export function getSize(source) {
=======
/**
* get size
* @export
* @param {Object} source
* @return {Boolean}
*/
export function getSize (source) {
>>>>>>>
/**
* get size
* @export
* @param {Object} source
* @return {Boolean}
*/
export function getSize (source) {
<<<<<<<
export function checkZero(value, fields) {
=======
/**
* check zero
* @export
* @param {Array} value
* @param {Object} fields
* @return {Boolean}
*/
export function checkZero (value, fields) {
>>>>>>>
/**
* check zero
* @export
* @param {Array} value
* @param {Object} fields
* @return {Boolean}
*/
export function checkZero (value, fields) {
<<<<<<<
export function checkDayZero(source) {
=======
/**
* check day zero
* @export
* @param {Object} source
* @return {Array}
*/
export function checkDayZero (source) {
>>>>>>>
/**
* check day zero
* @export
* @param {Object} source
* @return {Array}
*/
export function checkDayZero (source) {
<<<<<<<
export function checkDay5(source, coinzoom, tradeDate, tradetime) {
=======
/**
* check 5 day
* @export
* @param {Object} source
* @param {Number} coinunit
* @param {Number} tradeDate
* @param {Number} tradetime
* @return {Array}
*/
export function checkDay5 (source, coinunit, tradeDate, tradetime) {
>>>>>>>
/**
* check 5 day
* @export
* @param {Object} source
* @param {Number} coinzoom
* @param {Number} tradeDate
* @param {Number} tradetime
* @return {Array}
*/
export function checkDay5 (source, coinzoom, tradeDate, tradetime) {
<<<<<<<
export function updateStatic(fields, value) {
const coinzoom = getValue({
=======
/**
* update static
* @export
* @param {Object} fields
* @param {Array} value
* @return {Array}
*/
export function updateStatic (fields, value) {
const coinunit = getValue({
>>>>>>>
/**
* update static
* @export
* @param {Object} fields
* @param {Array} value
* @return {Array}
*/
export function updateStatic (fields, value) {
const coinzoom = getValue({
<<<<<<<
export function getZipDay(daydata, rate) {
=======
/**
* get zip day
* @export
* @param {Array} daydata
* @param {Number} rate
* @return {Array}
*/
export function getZipDay (daydata, rate) {
>>>>>>>
/**
* get zip day
* @export
* @param {Array} daydata
* @param {Number} rate
* @return {Array}
*/
export function getZipDay (daydata, rate) {
<<<<<<<
export function matchDayToWeek(daydata) {
=======
/**
* convert day data to week data
* @export
* @param {Array} daydata
* @return {Array}
*/
export function matchDayToWeek (daydata) {
>>>>>>>
/**
* convert day data to week data
* @export
* @param {Array} daydata
* @return {Array}
*/
export function matchDayToWeek (daydata) {
<<<<<<<
export function matchDayToMon(daydata) {
=======
/**
* convert day data to month data
* @export
* @param {Array} daydata
* @return {Array}
*/
export function matchDayToMon (daydata) {
>>>>>>>
/**
* convert day data to month data
* @export
* @param {Array} daydata
* @return {Array}
*/
export function matchDayToMon (daydata) {
<<<<<<<
export function getMinuteCount(tradetime) { // time_t
=======
/**
* get minute count
* @export
* @param {Number} tradetime
* @return {Number}
*/
export function getMinuteCount (tradetime) { // time_t
>>>>>>>
/**
* get minute count
* @export
* @param {Number} tradetime
* @return {Number}
*/
export function getMinuteCount (tradetime) { // time_t
<<<<<<<
export function fromTradeTimeToIndex(ttime, tradetime) { // time_t 返回0-239
=======
/**
* convert time t to trade time
* @export
* @param {Number} ttime
* @param {Number} tradetime
* @return {Number}
*/
export function fromTradeTimeToIndex (ttime, tradetime) { // time_t 返回0-239
>>>>>>>
/**
* convert time t to trade time
* @export
* @param {Number} ttime
* @param {Number} tradetime
* @return {Number}
*/
export function fromTradeTimeToIndex (ttime, tradetime) { // time_t 返回0-239
<<<<<<<
export function fromIndexToTradeTime(tindex, tradetime, tradeDate) {
=======
/**
* convert index to trade time
* @export
* @param {Number} tindex
* @param {Number} tradetime
* @param {Number} tradeDate
* @return {Number}
*/
export function fromIndexToTradeTime (tindex, tradetime, tradeDate) {
>>>>>>>
/**
* convert index to trade time
* @export
* @param {Number} tindex
* @param {Number} tradetime
* @param {Number} tradeDate
* @return {Number}
*/
export function fromIndexToTradeTime (tindex, tradetime, tradeDate) {
<<<<<<<
export function outputDay5(source, coinzoom, tradetime) {
=======
/**
* out put 5 day
*
* @export
* @param {Object} source
* @param {Number} coinunit
* @param {Number} tradetime
* @return {Array}
*/
export function outputDay5 (source, coinunit, tradetime) {
>>>>>>>
/**
* out put 5 day
*
* @export
* @param {Object} source
* @param {Number} coinzoom
* @param {Number} tradetime
* @return {Array}
*/
export function outputDay5 (source, coinzoom, tradetime) { |
<<<<<<<
* @license RequireJS 0.14.5+ Copyright (c) 2010, The Dojo Foundation All Rights Reserved.
=======
* @license RequireJS 0.15.0+ Copyright (c) 2010, The Dojo Foundation All Rights Reserved.
>>>>>>>
* @license RequireJS 0.15.0+ Copyright (c) 2010, The Dojo Foundation All Rights Reserved.
<<<<<<<
var version = "0.14.5+",
ostring = Object.prototype.toString,
isBrowser = !!(typeof window !== "undefined" && navigator && document),
isWebWorker = !isBrowser && typeof importScripts !== "undefined",
defContextName = "_",
empty = {},
contexts = {},
isDone = false,
useInteractive = false,
req, cfg, currentlyAddingScript;
=======
var version = "0.15.0+",
empty = {}, s,
i, defContextName = "_", contextLoads = [],
scripts, script, rePkg, src, m, dataMain, cfg = {}, setReadyState,
commentRegExp = /(\/\*([\s\S]*?)\*\/|\/\/(.*)$)/mg,
cjsRequireRegExp = /require\(["']([\w\!\-_\.\/]+)["']\)/g,
main,
isBrowser = !!(typeof window !== "undefined" && navigator && document),
isWebWorker = !isBrowser && typeof importScripts !== "undefined",
//PS3 indicates loaded and complete, but need to wait for complete
//specifically. Sequence is "loading", "loaded", execution,
// then "complete". The UA check is unfortunate, but not sure how
//to feature test w/o causing perf issues.
readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ? /^complete$/ : /^(complete|loaded)$/,
ostring = Object.prototype.toString,
ap = Array.prototype,
aps = ap.slice, scrollIntervalId, req, baseElement,
defQueue = [], useInteractive = false, currentlyAddingScript;
>>>>>>>
var version = "0.15.0+",
commentRegExp = /(\/\*([\s\S]*?)\*\/|\/\/(.*)$)/mg,
cjsRequireRegExp = /require\(["']([\w\-_\.\/]+)["']\)/g,
ostring = Object.prototype.toString,
ap = Array.prototype,
aps = ap.slice,
isBrowser = !!(typeof window !== "undefined" && navigator && document),
isWebWorker = !isBrowser && typeof importScripts !== "undefined",
defContextName = "_",
empty = {},
contexts = {},
globalDefQueue = [],
interactiveScript = null,
isDone = false,
useInteractive = false,
req, cfg, currentlyAddingScript;
<<<<<<<
if (!req.s.skipAsync[url]) {
node.async = true;
}
=======
node.async = !s.skipAsync[url];
>>>>>>>
if (!req.s.skipAsync[url]) {
node.async = true;
}
<<<<<<<
=======
//Determine what baseUrl should be if not already defined via a require config object
s.baseUrl = cfg.baseUrl;
if (isBrowser && (!s.baseUrl || !s.head)) {
//Figure out baseUrl. Get it from the script tag with require.js in it.
scripts = document.getElementsByTagName("script");
if (cfg.baseUrlMatch) {
rePkg = cfg.baseUrlMatch;
} else {
//>>includeStart("jquery", pragmas.jquery);
rePkg = /(requireplugins-|require-)?jquery[\-\d\.]*(min)?\.js(\W|$)/i;
//>>includeEnd("jquery");
//>>includeStart("dojoConvert", pragmas.dojoConvert);
rePkg = /dojo\.js(\W|$)/i;
//>>includeEnd("dojoConvert");
//>>excludeStart("dojoConvert", pragmas.dojoConvert);
//>>excludeStart("jquery", pragmas.jquery);
rePkg = /(allplugins-)?require\.js(\W|$)/i;
//>>excludeEnd("jquery");
//>>excludeEnd("dojoConvert");
}
for (i = scripts.length - 1; i > -1 && (script = scripts[i]); i--) {
//Set the "head" where we can append children by
//using the script's parent.
if (!s.head) {
s.head = script.parentNode;
}
//Look for a data-main attribute to set main script for the page
//to load.
if (!dataMain && (dataMain = script.getAttribute('data-main'))) {
cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain];
//Favor using data-main tag as the base URL instead of
//trying to pattern-match src values.
if (!cfg.baseUrl && (src = script.src)) {
src = src.split('/');
src.pop();
//Make sure current config gets the value.
s.baseUrl = cfg.baseUrl = src.length ? src.join('/') : './';
}
}
//Using .src instead of getAttribute to get an absolute URL.
//While using a relative URL will be fine for script tags, other
//URLs used for text! resources that use XHR calls might benefit
//from an absolute URL.
if (!s.baseUrl && (src = script.src)) {
m = src.match(rePkg);
if (m) {
s.baseUrl = src.substring(0, m.index);
break;
}
}
}
}
//>>excludeStart("requireExcludePageLoad", pragmas.requireExcludePageLoad);
//****** START page load functionality ****************
/**
* Sets the page as loaded and triggers check for all modules loaded.
*/
req.pageLoaded = function () {
if (!s.isPageLoaded) {
s.isPageLoaded = true;
if (scrollIntervalId) {
clearInterval(scrollIntervalId);
}
//Part of a fix for FF < 3.6 where readyState was not set to
//complete so libraries like jQuery that check for readyState
//after page load where not getting initialized correctly.
//Original approach suggested by Andrea Giammarchi:
//http://webreflection.blogspot.com/2009/11/195-chars-to-help-lazy-loading.html
//see other setReadyState reference for the rest of the fix.
if (setReadyState) {
document.readyState = "complete";
}
req.callReady();
}
};
/**
* Internal function that calls back any ready functions. If you are
* integrating RequireJS with another library without require.ready support,
* you can define this method to call your page ready code instead.
*/
req.callReady = function () {
var callbacks = s.readyCalls, i, callback, contexts, context, prop;
if (s.isPageLoaded && s.isDone) {
if (callbacks.length) {
s.readyCalls = [];
for (i = 0; (callback = callbacks[i]); i++) {
callback();
}
}
//If jQuery with readyWait is being tracked, updated its
//readyWait count.
contexts = s.contexts;
for (prop in contexts) {
if (!(prop in empty)) {
context = contexts[prop];
if (context.jQueryIncremented) {
context.jQuery.readyWait -= 1;
context.jQueryIncremented = false;
}
}
}
}
};
/**
* Registers functions to call when the page is loaded
*/
req.ready = function (callback) {
if (s.isPageLoaded && s.isDone) {
callback();
} else {
s.readyCalls.push(callback);
}
return req;
};
if (isBrowser) {
if (document.addEventListener) {
//Standards. Hooray! Assumption here that if standards based,
//it knows about DOMContentLoaded.
document.addEventListener("DOMContentLoaded", req.pageLoaded, false);
window.addEventListener("load", req.pageLoaded, false);
//Part of FF < 3.6 readystate fix (see setReadyState refs for more info)
if (!document.readyState) {
setReadyState = true;
document.readyState = "loading";
}
} else if (window.attachEvent) {
window.attachEvent("onload", req.pageLoaded);
//DOMContentLoaded approximation, as found by Diego Perini:
//http://javascript.nwbox.com/IEContentLoaded/
if (self === self.top) {
scrollIntervalId = setInterval(function () {
try {
//From this ticket:
//http://bugs.dojotoolkit.org/ticket/11106,
//In IE HTML Application (HTA), such as in a selenium test,
//javascript in the iframe can't see anything outside
//of it, so self===self.top is true, but the iframe is
//not the top window and doScroll will be available
//before document.body is set. Test document.body
//before trying the doScroll trick.
if (document.body) {
document.documentElement.doScroll("left");
req.pageLoaded();
}
} catch (e) {}
}, 30);
}
}
//Check if document already complete, and if so, just trigger page load
//listeners. NOTE: does not work with Firefox before 3.6. To support
//those browsers, manually call require.pageLoaded().
if (document.readyState === "complete") {
req.pageLoaded();
}
}
//****** END page load functionality ****************
//>>excludeEnd("requireExcludePageLoad");
//Set up default context. If require was a configuration object, use that as base config.
req(cfg);
//If modules are built into require.js, then need to make sure dependencies are
//traced. Use a setTimeout in the browser world, to allow all the modules to register
//themselves. In a non-browser env, assume that modules are not built into require.js,
//which seems odd to do on the server.
if (typeof setTimeout !== "undefined") {
setTimeout(function () {
var ctx = s.contexts[(cfg.context || defContextName)];
//Allow for jQuery to be loaded/already in the page, and if jQuery 1.4.3,
//make sure to hold onto it for readyWait triggering.
jQueryCheck(ctx);
resume(ctx);
}, 0);
}
>>>>>>> |
<<<<<<<
reflux: 'libs/reflux/dist/reflux',
dataio: '/data.io',
=======
_dataio: '/data.io',
>>>>>>>
reflux: 'libs/reflux/dist/reflux',
_dataio: '/data.io', |
<<<<<<<
var parentName = (node.getParent() && node.getParent().getValue()) ?
node.getParent().getValue().name :
'';
=======
var parentPath = (node.getParent() && node.getParent().getValue())
? node.getParent().getValue().path
: userConfig.moduleRoot;
var parentName = (node.getParent() && node.getParent().getValue())
? node.getParent().getValue().name
: "";
var getFunction = null;
>>>>>>>
var parentName = (node.getParent() && node.getParent().getValue()) ?
node.getParent().getValue().name :
'';
var getFunction = null;
<<<<<<<
this.log('requesting file', node.getValue().path);
Communicator.get(node.getValue().name, node.getValue().path, proxy(function (contents) {
this.log('download complete', node.getValue().path);
=======
this.log("requesting file", node.getValue().path);
getFunction = (node.getValue().path) ? Communicator.get : Communicator.noop;
getFunction(node.getValue().name, node.getValue().path, proxy(function(contents) {
this.log("download complete", node.getValue().path);
// afterFetch pointcut if available
// this.pointcuts[resolvedUrl] = result.pointcuts;
var pointcuts = RulesEngine.getPointcuts(node.getValue().path);
var pointcutsStr = RulesEngine.getPointcuts(node.getValue().path, true);
var afterFetch = pointcuts.afterFetch || [];
for (var i = 0, len = afterFetch.length; i < len; i++) {
contents = afterFetch[i](contents, node.getValue().name);
}
var before = (pointcutsStr.before) ? [pointcutsStr.before, '\n'].join('') : '';
var after = (pointcutsStr.after) ? [pointcutsStr.after, '\n'].join('') : '';
contents = [before, contents, after].join('');
>>>>>>>
this.log('requesting file', node.getValue().path);
getFunction = (node.getValue().path) ? Communicator.get : Communicator.noop;
getFunction(node.getValue().name, node.getValue().path, proxy(function (contents) {
this.log('download complete', node.getValue().path);
// afterFetch pointcut if available
// this.pointcuts[resolvedUrl] = result.pointcuts;
var pointcuts = RulesEngine.getPointcuts(node.getValue().path);
var pointcutsStr = RulesEngine.getPointcuts(node.getValue().path, true);
var afterFetch = pointcuts.afterFetch || [];
for (var i = 0, len = afterFetch.length; i < len; i++) {
contents = afterFetch[i](contents, node.getValue().name);
}
var before = (pointcutsStr.before) ? [pointcutsStr.before, '\n'].join('') : '';
var after = (pointcutsStr.after) ? [pointcutsStr.after, '\n'].join('') : '';
contents = [before, contents, after].join(''); |
<<<<<<<
var commonJSHeader = (['',
'__INJECT_NS__.INTERNAL.execute.__FUNCTION_ID__ = function() {',
' with (window) {',
' __INJECT_NS__.INTERNAL.modules.__FUNCTION_ID__ = __INJECT_NS__.INTERNAL.createModule("__MODULE_ID__", "__MODULE_URI__");',
' __INJECT_NS__.INTERNAL.execs.__FUNCTION_ID__ = function() {',
' var module = __INJECT_NS__.INTERNAL.modules.__FUNCTION_ID__,',
' require = __INJECT_NS__.INTERNAL.createRequire(module.id, module.uri),',
' define = __INJECT_NS__.INTERNAL.createDefine(module.id, module.uri),',
' exports = module.exports;',
' ;__POINTCUT_BEFORE__',
'']).join('\n');
=======
var commonJSHeader = ([
'__INJECT_NS__.INTERNAL.execute.__FUNCTION_ID__ = function() {',
' with (window) {',
' var module = __INJECT_NS__.INTERNAL.createModule("__MODULE_ID__", "__MODULE_URI__"),',
' require = __INJECT_NS__.INTERNAL.createRequire("__MODULE_ID__", "__MODULE_URI__"),',
' define = __INJECT_NS__.INTERNAL.createDefine("__MODULE_ID__", "__MODULE_URI__"),',
' __exe = null;',
' exports = module.exports;',
' __exe = function() {',
'']).join('\n');
>>>>>>>
var commonJSHeader = (['',
'__INJECT_NS__.INTERNAL.execute.__FUNCTION_ID__ = function() {',
' with (window) {',
' __INJECT_NS__.INTERNAL.modules.__FUNCTION_ID__ = __INJECT_NS__.INTERNAL.createModule("__MODULE_ID__", "__MODULE_URI__");',
' __INJECT_NS__.INTERNAL.execs.__FUNCTION_ID__ = function() {',
' var module = __INJECT_NS__.INTERNAL.modules.__FUNCTION_ID__,',
' require = __INJECT_NS__.INTERNAL.createRequire(module.id, module.uri),',
' define = __INJECT_NS__.INTERNAL.createDefine(module.id, module.uri),',
' exports = module.exports;',
'']).join('\n');
<<<<<<<
var commonJSFooter = (['',
' ;__POINTCUT_AFTER__;',
' __INJECT_NS__.INTERNAL.modules.__FUNCTION_ID__ = module;',
' };',
' __INJECT_NS__.INTERNAL.defineExecutingModuleAs("__MODULE_ID__", "__MODULE_URI__");',
' __error = window.onerror;',
' try {',
' __INJECT_NS__.INTERNAL.execs.__FUNCTION_ID__.call(__INJECT_NS__.INTERNAL.modules.__FUNCTION_ID__);',
' }',
' catch (__EXCEPTION__) {',
' __INJECT_NS__.INTERNAL.modules.__FUNCTION_ID__.error = __EXCEPTION__;',
' }',
' __INJECT_NS__.INTERNAL.undefineExecutingModule();',
' return __INJECT_NS__.INTERNAL.modules.__FUNCTION_ID__;',
' }',
'};',
'']).join('\n');
=======
var commonJSFooter = ([
' };',
' __INJECT_NS__.INTERNAL.defineExecutingModuleAs(module.id, module.uri);',
' __error = window.onerror;',
' try {',
' __exe.call(module);',
' }',
' catch (__EXCEPTION__) {',
' module.error = __EXCEPTION__;',
' }',
' __INJECT_NS__.INTERNAL.undefineExecutingModule();',
' return module;',
' }',
'};',
'']).join('\n');
>>>>>>>
var commonJSFooter = (['',
' __INJECT_NS__.INTERNAL.modules.__FUNCTION_ID__ = module;',
' };',
' __INJECT_NS__.INTERNAL.defineExecutingModuleAs("__MODULE_ID__", "__MODULE_URI__");',
' __error = window.onerror;',
' try {',
' __INJECT_NS__.INTERNAL.execs.__FUNCTION_ID__.call(__INJECT_NS__.INTERNAL.modules.__FUNCTION_ID__);',
' }',
' catch (__EXCEPTION__) {',
' __INJECT_NS__.INTERNAL.modules.__FUNCTION_ID__.error = __EXCEPTION__;',
' }',
' __INJECT_NS__.INTERNAL.undefineExecutingModule();',
' return __INJECT_NS__.INTERNAL.modules.__FUNCTION_ID__;',
' }',
'};',
'']).join('\n'); |
<<<<<<<
it("should receive an event with circular object", function(done)
{
const Obj = function()
{
this.one = "one"
this.two = "two"
this.ref = this
}
server.emit("circularUpdate", new Obj())
client.on("circularUpdate", function(value)
{
value.should.deep.equal({
one: "one",
two: "two",
ref: value
})
done()
})
})
=======
it("should receive an event with a single object value", function(done)
{
server.emit("newsUpdate", { foo: "bar", boo: "baz" })
client.once("newsUpdate", function(obj)
{
obj.should.be.an.instanceOf(Object)
expect(obj).to.deep.equal({ foo: "bar", boo: "baz" })
done()
})
})
>>>>>>>
it("should receive an event with a single object value", function(done)
{
server.emit("newsUpdate", { foo: "bar", boo: "baz" })
client.once("newsUpdate", function(obj)
{
obj.should.be.an.instanceOf(Object)
expect(obj).to.deep.equal({ foo: "bar", boo: "baz" })
done()
})
})
it("should receive an event with circular object", function(done)
{
const Obj = function()
{
this.one = "one"
this.two = "two"
this.ref = this
}
server.emit("circularUpdate", new Obj())
client.on("circularUpdate", function(value)
{
value.should.deep.equal({
one: "one",
two: "two",
ref: value
})
})
}) |
<<<<<<<
menuItem.position.setY((currentHeight)-(menuHeight/2)+(size/2)); // MATH?
menuItem.position.setX(menuItem.geometry.boundingSphere.radius*-0.5);
menuItem.menuItemSelectCallback = items[items.length-i-1].action || null;
menuItem.theRoomYouWillJoin = items[items.length-i-1].room;
menuItem.text = items[items.length-i-1].text;
=======
menuItem.position.setX(menuItem.geometry.boundingSphere.radius*-0.5);
menuItem.position.setY((currentHeight)-(this.menuHeight/2)+(size/2));
menuItem.position.setZ(1);
menuItem.menuItemSelectCallback = items[items.length-i-1].action || null;
menuItem.theRoomYouWillJoin = items[items.length-i-1].room;
>>>>>>>
menuItem.position.setX(menuItem.geometry.boundingSphere.radius*-0.5);
menuItem.position.setY((currentHeight)-(this.menuHeight/2)+(size/2));
menuItem.position.setZ(1);
menuItem.menuItemSelectCallback = items[items.length-i-1].action || null;
menuItem.theRoomYouWillJoin = items[items.length-i-1].room;
menuItem.text = items[items.length-i-1].text; |
<<<<<<<
"./client/game/classes/s.Enemies.js",
=======
"./client/game/classes/s.Bot.js",
>>>>>>>
"./client/game/classes/s.Bot.js",
"./client/game/classes/s.Enemies.js", |
<<<<<<<
=======
const Defs = {};
/**
* @typedef {{
* basePatchNum: (string|number),
* patchNum: (number),
* }}
*/
Defs.patchRange;
/**
* @typedef {{
* url: string,
* fetchOptions: (Object|null|undefined),
* anonymizedUrl: (string|undefined),
* }}
*/
Defs.FetchRequest;
/**
* Object to describe a request for passing into _fetchJSON or _fetchRawJSON.
* - url is the URL for the request (excluding get params)
* - errFn is a function to invoke when the request fails.
* - cancelCondition is a function that, if provided and returns true, will
* cancel the response after it resolves.
* - params is a key-value hash to specify get params for the request URL.
*
* @typedef {{
* url: string,
* errFn: (function(?Response, string=)|null|undefined),
* cancelCondition: (function()|null|undefined),
* params: (Object|null|undefined),
* fetchOptions: (Object|null|undefined),
* anonymizedUrl: (string|undefined),
* reportUrlAsIs: (boolean|undefined),
* }}
*/
Defs.FetchJSONRequest;
/**
* @typedef {{
* changeNum: (string|number),
* endpoint: string,
* patchNum: (string|number|null|undefined),
* errFn: (function(?Response, string=)|null|undefined),
* params: (Object|null|undefined),
* fetchOptions: (Object|null|undefined),
* anonymizedEndpoint: (string|undefined),
* reportEndpointAsIs: (boolean|undefined),
* }}
*/
Defs.ChangeFetchRequest;
/**
* Object to describe a request for passing into _send.
* - method is the HTTP method to use in the request.
* - url is the URL for the request
* - body is a request payload.
* TODO (beckysiegel) remove need for number at least.
* - errFn is a function to invoke when the request fails.
* - cancelCondition is a function that, if provided and returns true, will
* cancel the response after it resolves.
* - contentType is the content type of the body.
* - headers is a key-value hash to describe HTTP headers for the request.
* - parseResponse states whether the result should be parsed as a JSON
* object using getResponseObject.
*
* @typedef {{
* method: string,
* url: string,
* body: (string|number|Object|null|undefined),
* errFn: (function(?Response, string=)|null|undefined),
* contentType: (string|null|undefined),
* headers: (Object|undefined),
* parseResponse: (boolean|undefined),
* anonymizedUrl: (string|undefined),
* reportUrlAsIs: (boolean|undefined),
* }}
*/
Defs.SendRequest;
/**
* @typedef {{
* changeNum: (string|number),
* method: string,
* patchNum: (string|number|undefined),
* endpoint: string,
* body: (string|number|Object|null|undefined),
* errFn: (function(?Response, string=)|null|undefined),
* contentType: (string|null|undefined),
* headers: (Object|undefined),
* parseResponse: (boolean|undefined),
* anonymizedEndpoint: (string|undefined),
* reportEndpointAsIs: (boolean|undefined),
* }}
*/
Defs.ChangeSendRequest;
>>>>>>>
<<<<<<<
this._restApiHelper.readResponsePayload(response) :
Promise.resolve(null);
=======
this._readResponsePayload(response) :
Promise.resolve(null);
>>>>>>>
this._restApiHelper.readResponsePayload(response) :
Promise.resolve(null);
<<<<<<<
* Public version of the _restApiHelper.send method preserved for plugins.
=======
* Send an XHR.
*
* @param {Defs.SendRequest} req
* @return {Promise}
*/
_send(req) {
const options = {method: req.method};
if (req.body) {
options.headers = new Headers();
options.headers.set(
'Content-Type', req.contentType || 'application/json');
options.body = typeof req.body === 'string' ?
req.body : JSON.stringify(req.body);
}
if (req.headers) {
if (!options.headers) { options.headers = new Headers(); }
for (const header in req.headers) {
if (!req.headers.hasOwnProperty(header)) { continue; }
options.headers.set(header, req.headers[header]);
}
}
const url = req.url.startsWith('http') ?
req.url : this.getBaseUrl() + req.url;
const fetchReq = {
url,
fetchOptions: options,
anonymizedUrl: req.reportUrlAsIs ? url : req.anonymizedUrl,
};
const xhr = this._fetch(fetchReq).then(response => {
if (!response.ok) {
if (req.errFn) {
return req.errFn.call(undefined, response);
}
this.fire('server-error', {request: fetchReq, response});
}
return response;
}).catch(err => {
this.fire('network-error', {error: err});
if (req.errFn) {
return req.errFn.call(undefined, null, err);
} else {
throw err;
}
});
if (req.parseResponse) {
return xhr.then(res => this.getResponseObject(res));
}
return xhr;
},
/**
* Public version of the _send method preserved for plugins.
*
>>>>>>>
* Public version of the _restApiHelper.send method preserved for plugins.
*
<<<<<<<
* @param {Gerrit.ChangeFetchRequest} req
=======
*
* @param {Defs.ChangeFetchRequest} req
>>>>>>>
*
* @param {Gerrit.ChangeFetchRequest} req |
<<<<<<<
this.socket.on( 'sync', this.makeTrigger( 'sync'));
=======
this.socket.on('bot retrieval', this.makeTrigger( 'bot retrieval' ));
this.socket.on('bot positions', this.makeTrigger( 'bot positions' ));
>>>>>>>
this.socket.on( 'sync', this.makeTrigger( 'sync'));
this.socket.on( 'bot retrieval', this.makeTrigger( 'bot retrieval' ));
this.socket.on( 'bot positions', this.makeTrigger( 'bot positions' ));
<<<<<<<
=======
>>>>>>>
<<<<<<<
},
sendKey: function(direction, key){
var time = new Date().getTime();
// Never send faster than server can handle
if ( time - s.game.comm.lastMessageTime >= 15 ) {
var shipPosition = s.game.player.getPositionPacket();
// TODO: Figure out if ship or turret actually moved
// If ship moved, send packet
if ( this.lastPosition !== shipPosition.pos ) {
// Build packet
this.time = 0;
var packet = {
time: time,
room: this.room,
name: this.pilot.name,
pos: shipPosition.pos,
rot: shipPosition.rot,
aVeloc: shipPosition.aVeloc,
lVeloc: shipPosition.lVeloc
};
// Broadcast position
this.socket.emit( 'keypress', direction, $.extend(packet, { direction: direction, key: key }) );
s.game.comm.lastMessageTime = time;
this.lastPosition = shipPosition.pos;
}
}
=======
},
botInfo: function(message) {
this.socket.emit('botInfo', message);
},
botHit: function( yourName, botName ) {
this.time = 0;
this.socket.emit( 'botHit', {
yourName: yourName,
botName: botName
});
},
botUpdate: function(enemies) {
this.socket.emit( 'botUpdate', enemies);
>>>>>>>
},
sendKey: function(direction, key){
var time = new Date().getTime();
// Never send faster than server can handle
if ( time - s.game.comm.lastMessageTime >= 15 ) {
var shipPosition = s.game.player.getPositionPacket();
// TODO: Figure out if ship or turret actually moved
// If ship moved, send packet
if ( this.lastPosition !== shipPosition.pos ) {
// Build packet
this.time = 0;
var packet = {
time: time,
room: this.room,
name: this.pilot.name,
pos: shipPosition.pos,
rot: shipPosition.rot,
aVeloc: shipPosition.aVeloc,
lVeloc: shipPosition.lVeloc
};
// Broadcast position
this.socket.emit( 'keypress', direction, $.extend(packet, { direction: direction, key: key }) );
s.game.comm.lastMessageTime = time;
this.lastPosition = shipPosition.pos;
}
}
},
botInfo: function(message) {
this.socket.emit('botInfo', message);
},
botHit: function( yourName, botName ) {
this.time = 0;
this.socket.emit( 'botHit', {
yourName: yourName,
botName: botName
});
},
botUpdate: function(enemies) {
this.socket.emit( 'botUpdate', enemies); |
<<<<<<<
=======
=== Start of Comms Handlers ==========*/
// console.log(typeof this);
// // Bind functions
// this.bind(this.handleFire);
// this.bind(this.handleJoin);
// this.bind(this.handleLeave);
// this.bind(this.handleMove);
// this.bind(this.handleEnemyFire);
// this.bind(this.handleHit);
// this.bind(this.handlePlayerList);
// this.bind(this.handleKill);
/*========== End of Comms Handler Binding ==========*/
=======
/*========== Start of Comms Handlers ==========*/
// console.log(typeof this);
// // Bind functions
// this.bind(this.handleFire);
// this.bind(this.handleJoin);
// this.bind(this.handleLeave);
// this.bind(this.handleMove);
// this.bind(this.handleEnemyFire);
// this.bind(this.handleHit);
// this.bind(this.handlePlayerList);
// this.bind(this.handleKill);
/*========== End of Comms Handler Binding ==========*/
>>>>>>>
<<<<<<<
=======
// this.comm = new s.Comm({
// player: this.player,
// ship: this.ship,
// server: window.location.hostname + ':1935'
// });
// this.comm.on('fire', this.handleEnemyFire);
// this.comm.on('hit', this.handleHit);
// this.comm.on('player list', this.handlePlayerList);
// this.comm.on('killed', this.handleKill);
// this.comm.on('join', this.handleJoin);
// this.comm.on('leave', this.handleLeave);
// this.comm.on('move', this.handleMove);
>>>>>>> |
<<<<<<<
construct: function () {
this.quat = new THREE.Quaternion();
=======
toString: 'oculus',
construct: function (options) {
this.quat = new THREE.Quaternion();
>>>>>>>
toString: 'oculus',
construct: function (options) {
this.quat = new THREE.Quaternion();
<<<<<<<
this.compensationX = 0;
this.compensationY = 0;
this.compensationZ = 0;
this.getNewOrientetion = function (data) {
this.quat.x = data.x;
this.quat.y = data.y;
this.quat.z = data.z;
this.quat.w = data.w;
};
this.bridgeConnected = function () {
console.log('Oculus Rift connected');
this.detected = true;
};
this.bridgeDisonnected = function () {
this.detected = false;
console.log('WARNING: Oculus connection lost');
};
var that = this;
var oculusBridge = new OculusBridge({
onOrientationUpdate : function (e) { that.getNewOrientetion(e); },
onConnect : function () { that.bridgeConnected(); },
onDisonnect : function () { that.bridgeDisonnected(); }
});
oculusBridge.connect();
=======
vr.load(function () {
this.state = new vr.State();
console.log(this.state);
vr.pollState(this.state);
if (this.state.hmd.present) {
this.detected = true;
}
}, this);
this.update = this.update.bind(this);
this.game.hook(this.update);
},
update: function () {
vr.pollState(this.state);
this.quat.x = this.state.hmd.rotation[0];
this.quat.y = this.state.hmd.rotation[1];
this.quat.z = this.state.hmd.rotation[2];
this.quat.w = this.state.hmd.rotation[3];
>>>>>>>
vr.load(function () {
this.state = new vr.State();
vr.pollState(this.state);
if (this.state.hmd.present) {
this.detected = true;
}
}, this);
this.update = this.update.bind(this);
this.game.hook(this.update);
},
update: function () {
vr.pollState(this.state);
this.quat.x = this.state.hmd.rotation[0];
this.quat.y = this.state.hmd.rotation[1];
this.quat.z = this.state.hmd.rotation[2];
this.quat.w = this.state.hmd.rotation[3]; |
<<<<<<<
io.sockets.socket(target.hostPlayer).emit("bot retrieval");
=======
>>>>>>>
io.sockets.socket(target.hostPlayer).emit("bot retrieval");
<<<<<<<
=======
// ************************************************************************ //
baseFire: function (socket, packet) {
socket.emit('baseHit', packet);
}
>>>>>>>
baseFire: function (socket, packet) {
socket.emit('baseHit', packet);
} |
<<<<<<<
sources: [{
src: `${episodeState.vlink}/${episodeName}.mp4`,
type: 'video/mp4'
}],
poster: '',
=======
sources: [
{
src: `${episodeState.vlink}/${episodeName}.mp4`,
type: 'video/mp4',
},
],
poster: 'http://videojs.com/img/logo.png',
>>>>>>>
sources: [
{
src: `${episodeState.vlink}/${episodeName}.mp4`,
type: 'video/mp4',
},
], |
<<<<<<<
import { Attributes, NonComposedEvents } from "dom-expressions";
import VoidElements from "./VoidElements";
=======
import { Attributes, NonComposedEvents, SVGElements } from 'dom-expressions';
import VoidElements from './VoidElements';
>>>>>>>
import { Attributes, NonComposedEvents, SVGElements } from "dom-expressions";
import VoidElements from "./VoidElements";
<<<<<<<
function setAttr(path, elem, name, value) {
if (name === "style") {
=======
function setAttr(path, elem, name, value, isSVG) {
if (name === 'style') {
>>>>>>>
function setAttr(path, elem, name, value, isSVG) {
if (name === "style") {
<<<<<<<
let isAttribute = name.indexOf("-") > -1,
=======
let isAttribute = isSVG || name.indexOf('-') > -1,
>>>>>>>
let isAttribute = isSVG || name.indexOf("-") > -1,
<<<<<<<
function setAttrExpr(path, elem, name, value) {
registerImportMethod(path, "wrap");
return t.expressionStatement(
t.callExpression(t.identifier("_$wrap"), [
t.arrowFunctionExpression([], setAttr(path, elem, name, value))
])
);
=======
function setAttrExpr(path, elem, name, value, isSVG) {
registerImportMethod(path, 'wrap');
return t.expressionStatement(t.callExpression(
t.identifier("_$wrap"),
[t.arrowFunctionExpression([], setAttr(path, elem, name, value, isSVG))]
));
>>>>>>>
function setAttrExpr(path, elem, name, value, isSVG) {
registerImportMethod(path, "wrap");
return t.expressionStatement(
t.callExpression(t.identifier("_$wrap"), [
t.arrowFunctionExpression([], setAttr(path, elem, name, value, isSVG))
])
);
<<<<<<<
const spread = t.identifier("_$spread");
=======
const spread = t.identifier('_$spread'),
tagName = getTagName(jsx),
isSVG = SVGElements.has(tagName);
>>>>>>>
const spread = t.identifier("_$spread"),
tagName = getTagName(jsx),
isSVG = SVGElements.has(tagName); |
<<<<<<<
var defaultColorPattern = ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf'], //same as d3.scale.category10()
color = generateColor(__data_colors, notEmpty(__color_pattern) ? __color_pattern : defaultColorPattern, __data_color),
levelColor = generateLevelColor(__color_pattern, __color_values);
=======
var defaultColorPattern = d3.scale.category10().range(),
color = generateColor(__data_colors, notEmpty(__color_pattern) ? __color_pattern : defaultColorPattern, __data_color);
>>>>>>>
var defaultColorPattern = d3.scale.category10().range(),
color = generateColor(__data_colors, notEmpty(__color_pattern) ? __color_pattern : defaultColorPattern, __data_color),
levelColor = generateLevelColor(__color_pattern, __color_values);
<<<<<<<
x = c[0], y = c[1], h = Math.sqrt(x * x + y * y);
translate = __gauge_style == 'arc' ? "translate(1,1)" : "translate(" + ((x / h) * radius * 0.8) + ',' + ((y / h) * radius * 0.8) + ")";
=======
x = c[0];
y = c[1];
h = Math.sqrt(x * x + y * y);
// TODO: ratio should be an option?
ratio = (36 / radius > 0.375 ? 1.175 - 36 / radius : 0.8) * radius / h;
translate = "translate(" + (x * ratio) + ',' + (y * ratio) + ")";
>>>>>>>
x = c[0];
y = c[1];
h = Math.sqrt(x * x + y * y);
// TODO: ratio should be an option?
ratio = (36 / radius > 0.375 ? 1.175 - 36 / radius : 0.8) * radius / h;
translate = __gauge_style == 'arc' ? "translate(1,1)" : "translate(" + (x * ratio) + ',' + (y * ratio) + ")";
<<<<<<<
})(); // usage replaced by generateDrawArea
function generateDrawArea(areaIndices, isSub) {
var area, getPoint = generateGetAreaPoint(areaIndices, isSub);
if (__axis_rotated) {
area = d3.svg.area()
.x0(function (d, i) { return getYScale(d.id)(0); })
.x1(function (d, i) { return getYScale(d.id)(d.value); })
.y(xx);
} else {
area = d3.svg.area()
.x(xx)
.y0(function (d, i) { if (__data_groups.length > 0) { var point = getPoint(d,i); return point[0][1]; } return getYScale(d.id)(0); })
.y1(function (d, i) { if (__data_groups.length > 0) { var point = getPoint(d,i); return point[1][1]; } return getYScale(d.id)(d.value); });
}
return function (d, i) {
var data = filterRemoveNull(d.values), x0, y0;
if (hasType([d], 'area') || hasType([d], 'area-spline')) {
isSplineType(d) ? area.interpolate("cardinal") : area.interpolate("linear");
return area(data);
} else if (hasType([d], 'area-step')) {
isStepType(d) ? area.interpolate("step-after") : area.interpolate("linear");
return area(data);
} else {
x0 = x(data[0].x);
y0 = getYScale(d.id)(data[0].value);
return __axis_rotated ? "M " + y0 + " " + x0 : "M " + x0 + " " + y0;
}
};
}
=======
})();
function generateDrawLine(isSub) {
var yScaleGetter = isSub ? getSubYScale : getYScale,
xValue = isSub ? xx : subxx,
yValue = function (d) { return yScaleGetter(d.id)(d.value); },
line = d3.svg.line()
.x(__axis_rotated ? yValue : xValue)
.y(__axis_rotated ? xValue : yValue);
if (!__line_connect_null) { line = line.defined(function (d) { return d.value != null; }); }
return function (d) {
var data = __line_connect_null ? filterRemoveNull(d.values) : d.values,
x = isSub ? x : subX, y = yScaleGetter(d.id), x0 = 0, y0 = 0;
if (isLineType(d)) {
if (__data_regions[d.id]) {
return lineWithRegions(data, x, y, __data_regions[d.id]);
} else {
line.interpolate(isSplineType(d) ? "cardinal" : "linear");
return line(data);
}
} else {
if (data[0]) {
x0 = x(data[0].x);
y0 = y(data[0].value);
}
return __axis_rotated ? "M " + y0 + " " + x0 : "M " + x0 + " " + y0;
}
};
}
>>>>>>>
}
<<<<<<<
function generateGetLinePoint(lineIndices, isSub) { // partial duplication of generateGetBarPoints
var lineTargetsNum = lineIndices.__max__ + 1,
x = getLineX(lineTargetsNum, lineIndices, !!isSub),
y = getLineY(!!isSub),
lineOffset = getLineOffset(lineIndices, !!isSub),
yScale = isSub ? getSubYScale : getYScale;
return function (d, i) {
var y0 = yScale(d.id)(0),
offset = lineOffset(d, i) || y0, // offset is for stacked area chart
posX = x(d), posY = y(d);
// fix posY not to overflow opposite quadrant
if (__axis_rotated) {
if ((d.value > 0 && posY < offset) || (d.value < 0 && posY > offset)) { posY = offset; }
}
// 1 point that marks the line position
return [
[posX, posY - (y0 - offset)]
];
};
}
// For brush region
var lineOnSub = (function () {
var line = d3.svg.line()
.x(__axis_rotated ? function (d) { return getSubYScale(d.id)(d.value); } : subxx)
.y(__axis_rotated ? subxx : function (d) { return getSubYScale(d.id)(d.value); });
return function (d) {
var data = filterRemoveNull(d.values);
if (isLineType(d)) {
return line(data);
} else if (isStepType(d)) {
line.interpolate("step-after");
return line(data);
} else {
return "M " + subX(data[0].x) + " " + getSubYScale(d.id)(data[0].value);
}
};
})();
var areaOnSub = (function () {
var area = d3.svg.area()
.x(xx)
.y0(function (d) { return getSubYScale(d.id)( (__axis_y_min) ? __axis_y_min : 0 ); })
.y1(function (d) { return getSubYScale(d.id)(d.value); });
return function (d) {
var data = filterRemoveNull(d.values), x0, y0;
if (hasType([d], 'area') || hasType([d], 'area-spline')) {
isSplineType(d) ? area.interpolate("cardinal") : area.interpolate("linear");
return area(data);
} else if (hasType([d], 'area-step')) {
isStepType(d) ? area.interpolate("step-after") : area.interpolate("linear");
return area(data);
} else {
x0 = subX(data[0].x);
y0 = getSubYScale(d.id)(data[0].value);
return __axis_rotated ? "M " + y0 + " " + x0 : "M " + x0 + " " + y0;
}
};
})();
=======
>>>>>>>
function generateGetLinePoint(lineIndices, isSub) { // partial duplication of generateGetBarPoints
var lineTargetsNum = lineIndices.__max__ + 1,
x = getLineX(lineTargetsNum, lineIndices, !!isSub),
y = getLineY(!!isSub),
lineOffset = getLineOffset(lineIndices, !!isSub),
yScale = isSub ? getSubYScale : getYScale;
return function (d, i) {
var y0 = yScale(d.id)(0),
offset = lineOffset(d, i) || y0, // offset is for stacked area chart
posX = x(d), posY = y(d);
// fix posY not to overflow opposite quadrant
if (__axis_rotated) {
if ((d.value > 0 && posY < offset) || (d.value < 0 && posY > offset)) { posY = offset; }
}
// 1 point that marks the line position
return [
[posX, posY - (y0 - offset)]
];
};
} |
<<<<<<<
constructor(name: string, attributesContainer: EntityAttributesContainer, entity: Class<File>) {
super(name, attributesContainer, entity, "ref");
=======
constructor(name: string, attributesContainer: EntityAttributesContainer) {
super(name, attributesContainer, File, "ref", () => {
// $FlowIgnore
const classId = this.getParentModel().getParentEntity().classId;
// $FlowIgnore
const id = this.getParentModel()
.getAttribute("id")
.getStorageValue();
return classId + ":" + id;
});
>>>>>>>
constructor(name: string, attributesContainer: EntityAttributesContainer, entity: Class<File>) {
super(name, attributesContainer, entity, "ref", () => {
// $FlowIgnore
const classId = this.getParentModel().getParentEntity().classId;
// $FlowIgnore
const id = this.getParentModel()
.getAttribute("id")
.getStorageValue();
return classId + ":" + id;
}); |
<<<<<<<
import Patterns from './patterns.js'
export default function Commander (terminal) {
this.patterns = new Patterns(terminal)
=======
function Commander (terminal) {
>>>>>>>
export default function Commander (terminal) { |
<<<<<<<
// TODO: this should probably be in visualizer_ui instead
var searchForm = $('#search_form');
var searchFormSubmit = function(evt) {
dispatcher.post('hideForm', [searchForm]);
var _searchtype= $('#search_type').val();
var _searchtext = $('#search_text').val();
var opts = {
action : 'searchCollection',
directory : dir,
type : _searchtype,
text : _searchtext,
};
dispatcher.post('ajax', [opts, function(response) {
dispatcher.post('showSearchResults', response.results);
}]);
return false;
};
searchForm.submit(searchFormSubmit);
dispatcher.post('initForm', [searchForm, {
width: 500,
alsoResize: '#search_text',
open: function(evt) {
keymap = {};
},
}]);
$('#search_button').click(function() {
dispatcher.post('showForm', [searchForm]);
});
=======
var preventDefault = function(evt) {
evt.preventDefault();
};
>>>>>>>
var preventDefault = function(evt) {
evt.preventDefault();
};
// searchForm.submit(searchFormSubmit);
// dispatcher.post('initForm', [searchForm, {
// width: 500,
// alsoResize: '#search_text',
// open: function(evt) {
// keymap = {};
// },
// }]);
// $('#search_button').click(function() {
// dispatcher.post('showForm', [searchForm]);
// }); |
<<<<<<<
var spanDesc = spanTypes[span.type];
var bgColor = ((spanDesc && spanDesc.bgColor) ||
(spanTypes.SPAN_DEFAULT &&
spanTypes.SPAN_DEFAULT.bgColor) || '#ffffff');
if (bgColor == "hidden") {
span.hidden = true;
return;
}
var f1 = span.fragments[0];
var f2 = span.fragments[span.fragments.length - 1];
=======
var f1 = span.firstFragment, f2 = span.lastFragment;
>>>>>>>
var spanDesc = spanTypes[span.type];
var bgColor = ((spanDesc && spanDesc.bgColor) ||
(spanTypes.SPAN_DEFAULT &&
spanTypes.SPAN_DEFAULT.bgColor) || '#ffffff');
if (bgColor == "hidden") {
span.hidden = true;
return;
}
var f1 = span.firstFragment, f2 = span.lastFragment;
<<<<<<<
var chunkDoesNotFit;
if (rtlmode) {
chunkDoesNotFit = currentX - boxWidth - leftBorderForArcs <= 2 * Configuration.visual.margin.x;
} else {
chunkDoesNotFit = currentX + boxWidth + rightBorderForArcs >= canvasWidth - 2 * Configuration.visual.margin.x
}
if (chunk.sentence || chunkDoesNotFit) {
=======
if ((chunk.sentence && chunk != firstChunk) ||
currentX + boxWidth + rightBorderForArcs >= canvasWidth - 2 * Configuration.visual.margin.x) {
// the chunk does not fit
>>>>>>>
var chunkDoesNotFit;
if (rtlmode) {
chunkDoesNotFit = currentX - boxWidth - leftBorderForArcs <= 2 * Configuration.visual.margin.x;
} else {
chunkDoesNotFit = currentX + boxWidth + rightBorderForArcs >= canvasWidth - 2 * Configuration.visual.margin.x
}
if (chunk.sentence || chunkDoesNotFit) {
<<<<<<<
if (arc.hidden) return;
=======
var originSpan = data.spans[arc.origin];
var targetSpan = data.spans[arc.target];
>>>>>>>
if (arc.hidden) return;
var originSpan = data.spans[arc.origin];
var targetSpan = data.spans[arc.target];
<<<<<<<
if (rowIndex == leftRow) {
if (rtlmode) {
from = leftBox.x + (chunkReverse ? leftBox.width : 0);
} else {
from = leftBox.x + (chunkReverse ? 0 : leftBox.width);
}
=======
if (leftBox && rowIndex == leftRow) {
from = leftBox.x + (chunkReverse ? 0 : leftBox.width);
>>>>>>>
if (leftBox && rowIndex == leftRow) {
if (rtlmode) {
from = leftBox.x + (chunkReverse ? leftBox.width : 0);
} else {
from = leftBox.x + (chunkReverse ? 0 : leftBox.width);
}
<<<<<<<
if (rowIndex == rightRow) {
if (rtlmode) {
to = rightBox.x + (chunkReverse ? 0 : rightBox.width);
} else {
to = rightBox.x + (chunkReverse ? rightBox.width : 0);
}
=======
if (rightBox && rowIndex == rightRow) {
to = rightBox.x + (chunkReverse ? rightBox.width : 0);
>>>>>>>
if (rightBox && rowIndex == rightRow) {
if (rtlmode) {
to = rightBox.x + (chunkReverse ? 0 : rightBox.width);
} else {
to = rightBox.x + (chunkReverse ? rightBox.width : 0);
}
<<<<<<<
if (rowIndex == leftRow) {
var cornerx = from + (rtlmode ? -ufoCatcherMod : ufoCatcherMod) * arcSlant;
=======
if (leftBox && rowIndex == leftRow) {
var cornerx = from + ufoCatcherMod * arcSlant;
>>>>>>>
if (leftBox && rowIndex == leftRow) {
var cornerx = from + (rtlmode ? -ufoCatcherMod : ufoCatcherMod) * arcSlant;
<<<<<<<
if (rowIndex == rightRow) {
var cornerx = to - (rtlmode ? -1 : 1) * ufoCatcherMod * arcSlant;
=======
if (rightBox && rowIndex == rightRow) {
var cornerx = to - ufoCatcherMod * arcSlant;
>>>>>>>
if (rightBox && rowIndex == rightRow) {
var cornerx = to - (rtlmode ? -1 : 1) * ufoCatcherMod * arcSlant;
<<<<<<<
if (rowIndex == leftRow) {
from = rtlmode ? leftBox.x : leftBox.x + leftBox.width;
=======
if (leftBox && rowIndex == leftRow) {
from = leftBox.x + leftBox.width;
>>>>>>>
if (leftBox && rowIndex == leftRow) {
from = rtlmode ? leftBox.x : leftBox.x + leftBox.width;
<<<<<<<
if (rowIndex == rightRow) {
to = rtlmode ? rightBox.x + rightBox.width : rightBox.x;
=======
if (rightBox && rowIndex == rightRow) {
to = rightBox.x;
>>>>>>>
if (rightBox && rowIndex == rightRow) {
to = rtlmode ? rightBox.x + rightBox.width : rightBox.x; |
<<<<<<<
=======
// partially duplicate marking of annotator note comments
if (comment[1] == "AnnotatorNotes") {
span.annotatorNotes = comment[2];
}
>>>>>>>
<<<<<<<
tmp = -tmp;
}
=======
tmp = -tmp;
}
>>>>>>>
tmp = -tmp;
}
<<<<<<<
=======
// Replace underscores if requested
if(replaceUnderscoresWithSpace) {
span.labelText = span.labelText.replace(/_/g,' ');
}
>>>>>>>
<<<<<<<
if (chunk.lineBreak ||
current.x + boxWidth + rightBorderForArcs >= canvasWidth - 2 * margin.x) {
row.arcs = svg.group(row.group, { 'class': 'arcs' });
// new row
rows.push(row);
current.x = margin.x + sentNumMargin + rowPadding +
(hasLeftArcs ? arcHorizontalSpacing : (hasInternalArcs ? arcSlant : 0));
svg.remove(chunk.group);
row = new Row();
row.backgroundIndex = sentenceToggle;
lastBoxChunkIndex = chunk.index - 1;
row.index = ++rowIndex;
svg.add(row.group, chunk.group);
chunk.group = row.group.lastElementChild;
$(chunk.group).children("g[class='span']").
each(function(index, element) {
chunk.spans[index].group = element;
});
$(chunk.group).find("rect[data-span-id]").
each(function(index, element) {
chunk.spans[index].rect = element;
});
}
if (hasAnnotations) row.hasAnnotations = true;
=======
if (chunk.sentence ||
current.x + boxWidth + rightBorderForArcs >= canvasWidth - 2 * margin.x) {
row.arcs = svg.group(row.group, { 'class': 'arcs' });
// new row
rows.push(row);
current.x = margin.x + sentNumMargin + rowPadding +
(hasLeftArcs ? arcHorizontalSpacing : (hasInternalArcs ? arcSlant : 0));
svg.remove(chunk.group);
row = new Row();
row.backgroundIndex = sentenceToggle;
lastBoxChunkIndex = chunk.index - 1;
row.index = ++rowIndex;
svg.add(row.group, chunk.group);
chunk.group = row.group.lastElementChild;
$(chunk.group).children("g[class='span']").
each(function(index, element) {
chunk.spans[index].group = element;
});
$(chunk.group).find("rect[data-span-id]").
each(function(index, element) {
chunk.spans[index].rect = element;
});
}
if (hasAnnotations) row.hasAnnotations = true;
>>>>>>>
if (chunk.sentence ||
current.x + boxWidth + rightBorderForArcs >= canvasWidth - 2 * margin.x) {
row.arcs = svg.group(row.group, { 'class': 'arcs' });
// new row
rows.push(row);
current.x = margin.x + sentNumMargin + rowPadding +
(hasLeftArcs ? arcHorizontalSpacing : (hasInternalArcs ? arcSlant : 0));
svg.remove(chunk.group);
row = new Row();
row.backgroundIndex = sentenceToggle;
lastBoxChunkIndex = chunk.index - 1;
row.index = ++rowIndex;
svg.add(row.group, chunk.group);
chunk.group = row.group.lastElementChild;
$(chunk.group).children("g[class='span']").
each(function(index, element) {
chunk.spans[index].group = element;
});
$(chunk.group).find("rect[data-span-id]").
each(function(index, element) {
chunk.spans[index].rect = element;
});
}
if (hasAnnotations) row.hasAnnotations = true;
<<<<<<<
current.x += spaceWidths[chunk.space] + boxWidth;
}); // chunks
=======
var spaceWidth = 0;
var spaceLen = chunk.nextSpace && chunk.nextSpace.length || 0;
for (var i = 0; i < spaceLen; i++) spaceWidth += spaceWidths[chunk.nextSpace[i]] || 0;
current.x += spaceWidth + boxWidth;
}); // chunks
>>>>>>>
var spaceWidth = 0;
var spaceLen = chunk.nextSpace && chunk.nextSpace.length || 0;
for (var i = 0; i < spaceLen; i++) spaceWidth += spaceWidths[chunk.nextSpace[i]] || 0;
current.x += spaceWidth + boxWidth;
}); // chunks
<<<<<<<
var labelText = displayForm(arc.type)
if (abbrevsOn && !ufoCatcher) {
var labelIdx = 1; // first abbreviation
var maxLength = ((to - from) - (2 * arcSlant)) / 7;
while (labelText.length > maxLength &&
labels[arc.type] &&
labels[arc.type][labelIdx]) {
labelText = labels[arc.type][labelIdx];
labelIdx++;
}
}
=======
var labelText = displayForm(arc.type)
if (abbrevsOn) {
var labelIdx = 1; // first abbreviation
var maxLength = ((to - from) - (2 * arcSlant)) / 7;
while (labelText.length > maxLength &&
labels[arc.type] &&
labels[arc.type][labelIdx]) {
labelText = labels[arc.type][labelIdx];
labelIdx++;
}
}
>>>>>>>
var labelText = displayForm(arc.type)
if (abbrevsOn && !ufoCatcher) {
var labelIdx = 1; // first abbreviation
var maxLength = ((to - from) - (2 * arcSlant)) / 7;
while (labelText.length > maxLength &&
labels[arc.type] &&
labels[arc.type][labelIdx]) {
labelText = labels[arc.type][labelIdx];
labelIdx++;
}
}
<<<<<<<
} else {
path.line(from, -height);
}
svg.path(arcGroup, path, {
markerEnd: leftToRight || arc.equiv ? undefined : ('url(#' + arrows[arc.type] + ')'),
'class': 'stroke_' + arc.type,
'strokeDashArray': arc.equiv ? dashArray : undefined,
});
if (arc.edited) {
svg.path(shadowGroup, path, {
'class': 'shadow_EditHighlight_arc',
strokeWidth: editedStroke,
=======
} else {
path.line(from, -height);
}
svg.path(arcGroup, path, {
markerEnd: leftToRight || arc.equiv ? undefined : ('url(#' + arrows[arc.type] + ')'),
'class': 'stroke_' + arc.type,
'strokeDashArray': arc.equiv ? dashArray : undefined,
});
if (arc.edited) {
svg.path(shadowGroup, path, {
'class': 'shadow_EditHighlight_arc',
strokeWidth: editedStroke,
>>>>>>>
} else {
path.line(from, -height);
}
svg.path(arcGroup, path, {
markerEnd: leftToRight || arc.equiv ? undefined : ('url(#' + arrows[arc.type] + ')'),
'class': 'stroke_' + arc.type,
'strokeDashArray': arc.equiv ? dashArray : undefined,
});
if (arc.edited) {
svg.path(shadowGroup, path, {
'class': 'shadow_EditHighlight_arc',
strokeWidth: editedStroke, |
<<<<<<<
// unfocus all elements to prevent focus being kept after
// hiding them
spanForm.parent().find('*').blur();
=======
spanOptions.attributes = $.toJSON(attributes);
>>>>>>>
// unfocus all elements to prevent focus being kept after
// hiding them
spanForm.parent().find('*').blur();
spanOptions.attributes = $.toJSON(attributes); |
<<<<<<<
aria-label="Add a new to-do item"
placeholder="Add a to-do..."
=======
id="new-todo"
>>>>>>>
aria-label="Add a new to-do item"
placeholder="Add a to-do..."
id="new-todo" |
<<<<<<<
function connectDomainSocket_p(sockName, socketPath, interval, timeout,
shouldStop) {
=======
function connect_p(host, port, interval, timeout, shouldContinue) {
>>>>>>>
function connectDomainSocket_p(sockName, socketPath, interval, timeout,
shouldContinue) {
<<<<<<<
' with name ' + sockName);
var workerPromise = app_worker.launchWorker_p(
appSpec, socketPath, logFilePath);
=======
' on port ' + listenPort);
var workerPromise = app_worker.launchWorker_p(appSpec, listenPort, logFilePath);
>>>>>>>
' with name ' + sockName);
var workerPromise = app_worker.launchWorker_p(appSpec, socketPath, logFilePath);
<<<<<<<
self.freeSock(sockName);
logger.trace('Socket ' + sockName + ' returned');
});
exitPromise.then(function(status) {
=======
self.freePort(listenPort);
logger.trace('Port ' + listenPort + ' returned');
})
.then(function(status) {
>>>>>>>
self.freeSock(sockName);
logger.trace('Socket ' + sockName + ' returned');
})
.then(function(status) {
<<<<<<<
var connectPromise = connectDomainSocket_p(sockName, socketPath,
500, 60000, _.bind(exitPromise.isResolved, exitPromise));
=======
var connectPromise = connect_p('127.0.0.1', listenPort, 500, 60000,
_.bind(exitPromise.isPending, exitPromise));
>>>>>>>
var connectPromise = connectDomainSocket_p(sockName, socketPath,
500, 60000, _.bind(exitPromise.isPending, exitPromise)); |
<<<<<<<
function launchWorker_p(appSpec, listenPort, logFilePath, workerId) {
=======
function launchWorker_p(appSpec, socketPath, logFilePath) {
>>>>>>>
function launchWorker_p(appSpec, socketPath, logFilePath, workerId) {
<<<<<<<
var worker = new AppWorker(appSpec, listenPort, logStream, workerId);
=======
var worker = new AppWorker(appSpec, socketPath, logStream);
>>>>>>>
var worker = new AppWorker(appSpec, socketPath, logStream, workerId);
<<<<<<<
var AppWorker = function(appSpec, listenPort, logStream, workerId) {
=======
var AppWorker = function(appSpec, socketPath, logStream) {
>>>>>>>
var AppWorker = function(appSpec, socketPath, logStream, workerId) { |
<<<<<<<
var ECDSA = bitcore.ECDSA;
var Hash = bitcore.Hash;
var Keypair = bitcore.Keypair;
var PrivateKey = bitcore.PrivateKey;
var PublicKey = bitcore.PublicKey;
=======
var ECDSA = bitcore.crypto.ECDSA;
var Hash = bitcore.crypto.Hash;
var Privkey = bitcore.Privkey;
var Pubkey = bitcore.Pubkey;
>>>>>>>
var ECDSA = bitcore.crypto.ECDSA;
var Hash = bitcore.crypto.Hash;
var PrivateKey = bitcore.PrivateKey;
var PublicKey = bitcore.PublicKey;
<<<<<<<
ecdsa.keypair = new Keypair();
ecdsa.keypair.privkey = PrivateKey();
ecdsa.keypair.privkey.bn = BN().fromBuffer(Hash.sha256(new Buffer('test')));
ecdsa.keypair.privkey2pubkey();
=======
ecdsa.privkey = Privkey();
ecdsa.privkey.bn = BN().fromBuffer(Hash.sha256(new Buffer('test')));
ecdsa.privkey2pubkey();
>>>>>>>
ecdsa.privkey = PrivateKey(BN().fromBuffer(Hash.sha256(new Buffer('test'))));
ecdsa.privkey2pubkey(); |
<<<<<<<
=======
var SecureRandom = require('../SecureRandom');
var Curve = require('../Curve');
>>>>>>>
var SecureRandom = require('../SecureRandom');
var Curve = require('../Curve');
<<<<<<<
var eck = new ECKey(this.private.toString('hex'));
eck.setCompressed(this.compressed);
this.public = new Buffer(eck.getPub());
=======
var eck = new ECKey(buffertools.toHex(this.private));
eck.setCompressed(this._compressed);
this._pub = new Buffer(eck.getPub());
>>>>>>>
var eck = new ECKey(this.private.toString('hex'));
eck.setCompressed(this._compressed);
this._pub = new Buffer(eck.getPub());
<<<<<<<
var eck = new ECKey(this.private.toString('hex'));
eck.setCompressed(this.compressed);
=======
var eck = new ECKey(buffertools.toHex(this.private));
eck.setCompressed(this._compressed);
>>>>>>>
var eck = new ECKey(this.private.toString('hex'));
eck.setCompressed(this._compressed); |
<<<<<<<
var dataUnspent = JSON.parse(fs.readFileSync('test/data/unspent.json'));
var dataUnspentSign = JSON.parse(fs.readFileSync('test/data/unspentSign.json'));
=======
var dataSigCanonical = JSON.parse(fs.readFileSync('test/data/sig_canonical.json'));
var dataSigNonCanonical = JSON.parse(fs.readFileSync('test/data/sig_noncanonical.json'));
>>>>>>>
var dataUnspent = JSON.parse(fs.readFileSync('test/data/unspent.json'));
var dataUnspentSign = JSON.parse(fs.readFileSync('test/data/unspentSign.json'));
var dataSigCanonical = JSON.parse(fs.readFileSync('test/data/sig_canonical.json'));
var dataSigNonCanonical = JSON.parse(fs.readFileSync('test/data/sig_noncanonical.json'));
<<<<<<<
module.exports.dataScriptAll = dataScriptValid.concat(dataScriptInvalid);
module.exports.dataUnspent = dataUnspent;
module.exports.dataUnspentSign = dataUnspentSign;
=======
module.exports.dataScriptAll = dataScriptValid.concat(dataScriptInvalid);
module.exports.dataSigCanonical = dataSigCanonical;
module.exports.dataSigNonCanonical = dataSigNonCanonical;
>>>>>>>
module.exports.dataScriptAll = dataScriptValid.concat(dataScriptInvalid);
module.exports.dataUnspent = dataUnspent;
module.exports.dataUnspentSign = dataUnspentSign;
module.exports.dataSigCanonical = dataSigCanonical;
module.exports.dataSigNonCanonical = dataSigNonCanonical; |
<<<<<<<
var ECDSA = bitcore.ECDSA;
var Hash = bitcore.Hash;
var Keypair = bitcore.Keypair;
var PrivateKey = bitcore.PrivateKey;
var PublicKey = bitcore.PublicKey;
=======
var ECDSA = bitcore.crypto.ECDSA;
var Hash = bitcore.crypto.Hash;
var Privkey = bitcore.Privkey;
var Pubkey = bitcore.Pubkey;
>>>>>>>
var ECDSA = bitcore.crypto.ECDSA;
var Hash = bitcore.crypto.Hash;
var PrivateKey = bitcore.PrivateKey;
var PublicKey = bitcore.PublicKey;
<<<<<<<
ecdsa.keypair = new Keypair();
ecdsa.keypair.privkey = PrivateKey();
ecdsa.keypair.privkey.bn = BN().fromBuffer(Hash.sha256(new Buffer('test')));
ecdsa.keypair.privkey2pubkey();
=======
ecdsa.privkey = Privkey();
ecdsa.privkey.bn = BN().fromBuffer(Hash.sha256(new Buffer('test')));
ecdsa.privkey2pubkey();
>>>>>>>
ecdsa.privkey = PrivateKey(BN().fromBuffer(Hash.sha256(new Buffer('test'))));
ecdsa.privkey2pubkey(); |
<<<<<<<
var ECDSA = bitcore.ECDSA;
var Hash = bitcore.Hash;
var Keypair = bitcore.Keypair;
var PrivateKey = bitcore.PrivateKey;
var PublicKey = bitcore.PublicKey;
=======
var ECDSA = bitcore.crypto.ECDSA;
var Hash = bitcore.crypto.Hash;
var Privkey = bitcore.Privkey;
var Pubkey = bitcore.Pubkey;
>>>>>>>
var ECDSA = bitcore.crypto.ECDSA;
var Hash = bitcore.crypto.Hash;
var PrivateKey = bitcore.PrivateKey;
var PublicKey = bitcore.PublicKey;
<<<<<<<
ecdsa.keypair = new Keypair();
ecdsa.keypair.privkey = PrivateKey();
ecdsa.keypair.privkey.bn = BN().fromBuffer(Hash.sha256(new Buffer('test')));
ecdsa.keypair.privkey2pubkey();
=======
ecdsa.privkey = Privkey();
ecdsa.privkey.bn = BN().fromBuffer(Hash.sha256(new Buffer('test')));
ecdsa.privkey2pubkey();
>>>>>>>
ecdsa.privkey = PrivateKey(BN().fromBuffer(Hash.sha256(new Buffer('test'))));
ecdsa.privkey2pubkey(); |
<<<<<<<
var isTrigger = this.asPoint ? this._isTriggerByPoint.bind(this, this.getBorderedAxis()) :
this._isTriggerByRect.bind(this, angular.element(this.dnd.el).dndClientRect());
=======
var axis = this.getBorderedAxis(), x = axis.x, y = axis.y, asPoint = this.asPoint;
var dragenter = [];
var dragover = [];
var dragleave = [];
>>>>>>>
var isTrigger = this.asPoint ? this._isTriggerByPoint.bind(this, this.getBorderedAxis()) :
this._isTriggerByRect.bind(this, angular.element(this.dnd.el).dndClientRect());
var dragenter = [];
var dragover = [];
var dragleave = [];
<<<<<<<
=======
if (debug.mode) {
console.log(this.api.getRelBorderedAxis());
}
>>>>>>> |
<<<<<<<
var options = {
=======
// [START build_service]
var gcloud = require('gcloud');
var datastore = gcloud.datastore({
>>>>>>>
// [START build_service]
var gcloud = require('gcloud');
var options = {
<<<<<<<
};
if (keyFile) {
options.keyFilename = keyFile;
}
var datastore = gcloud.datastore(options);
=======
});
// [END build_service]
>>>>>>>
};
if (keyFile) {
options.keyFilename = keyFile;
}
var datastore = gcloud.datastore(options);
// [END build_service] |
<<<<<<<
HOST = HOST.trim()
if(HOST.endsWith("/")) HOST = HOST.slice(0, -1);
=======
console.log("NODEACTYL WARNING: There has been a COMPLETE rewrite of Nodeactyl, Please review our new documentation at: https://nodeactyl.elliotfrost.xyz/v/v2.0.0-english/ Alternativly if you need further assistance ask for help in our discord server: https://discordapp.com/invite/3e5uJPt");
>>>>>>>
HOST = HOST.trim()
if(HOST.endsWith("/")) HOST = HOST.slice(0, -1);
console.log("NODEACTYL WARNING: There has been a COMPLETE rewrite of Nodeactyl, Please review our new documentation at: https://nodeactyl.elliotfrost.xyz/v/v2.0.0-english/ Alternativly if you need further assistance ask for help in our discord server: https://discordapp.com/invite/3e5uJPt");
<<<<<<<
HOST = HOST.trim()
if(HOST.endsWith("/")) HOST = HOST.slice(0, -1);
=======
console.log("NODEACTYL WARNING: There has been a COMPLETE rewrite of Nodeactyl, Please review our new documentation at: https://nodeactyl.elliotfrost.xyz/v/v2.0.0-english/ Alternativly if you need further assistance ask for help in our discord server: https://discordapp.com/invite/3e5uJPt");
>>>>>>>
HOST = HOST.trim()
if(HOST.endsWith("/")) HOST = HOST.slice(0, -1);
console.log("NODEACTYL WARNING: There has been a COMPLETE rewrite of Nodeactyl, Please review our new documentation at: https://nodeactyl.elliotfrost.xyz/v/v2.0.0-english/ Alternativly if you need further assistance ask for help in our discord server: https://discordapp.com/invite/3e5uJPt"); |
<<<<<<<
var core = require('../../core'),
blurFactor = 1 / 7000;
var fs = require('fs');
=======
var core = require('../../core');
>>>>>>>
var core = require('../../core');
var fs = require('fs');
<<<<<<<
fs.readFileSync(__dirname + '/blurX.frag', 'utf8'),
=======
require('fs').readFileSync(__dirname + '/blur.frag', 'utf8'),
>>>>>>>
fs.readFileSync(__dirname + '/blur.frag', 'utf8'), |
<<<<<<<
baseTexture = new PIXI.BaseTexture(image);
baseTexture.imageUrl = imageUrl;
=======
baseTexture = new PIXI.BaseTexture(image, scaleMode);
>>>>>>>
baseTexture = new PIXI.BaseTexture(image, scaleMode);
baseTexture.imageUrl = imageUrl; |
<<<<<<<
if(position)
{
displayObject.worldTransform[2] = position.x;
displayObject.worldTransform[5] -= position.y;
}
=======
>>>>>>>
if(position)
{
displayObject.worldTransform[2] = position.x;
displayObject.worldTransform[5] -= position.y;
}
<<<<<<<
PIXI.RenderTexture.prototype.renderCanvas = function(displayObject, position, clear)
=======
/**
* This function will draw the display object to the texture.
*
* @method renderCanvas
* @param displayObject {DisplayObject} The display object to render this texture on
* @param clear {Boolean} If true the texture will be cleared before the displayObject is drawn
* @private
*/
PIXI.RenderTexture.prototype.renderCanvas = function(displayObject, clear)
>>>>>>>
/**
* This function will draw the display object to the texture.
*
* @method renderCanvas
* @param displayObject {DisplayObject} The display object to render this texture on
* @param clear {Boolean} If true the texture will be cleared before the displayObject is drawn
* @private
*/
PIXI.RenderTexture.prototype.renderCanvas = function(displayObject, position, clear)
<<<<<<<
if(position)
{
displayObject.worldTransform[2] = position.x;
displayObject.worldTransform[5] = position.y;
}
=======
>>>>>>>
if(position)
{
displayObject.worldTransform[2] = position.x;
displayObject.worldTransform[5] = position.y;
} |
<<<<<<<
//TODO break this out into a texture manager...
var gl = PIXI.gl;
if(!texture._glTexture)
{
texture._glTexture = gl.createTexture();
}
if(texture.hasLoaded)
{
gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.BaseTexture.SCALE_MODE.LINEAR ? gl.LINEAR : gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.BaseTexture.SCALE_MODE.LINEAR ? gl.LINEAR : gl.NEAREST);
// reguler...
if(!texture._powerOf2)
{
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
}
else
{
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
}
gl.bindTexture(gl.TEXTURE_2D, null);
}
}
=======
//TODO break this out into a texture manager...
var gl = PIXI.gl;
if(!texture._glTexture)
{
texture._glTexture = gl.createTexture();
}
if(texture.hasLoaded)
{
gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
// reguler...
if(!texture._powerOf2)
{
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
}
else
{
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
}
gl.bindTexture(gl.TEXTURE_2D, null);
}
};
>>>>>>>
//TODO break this out into a texture manager...
var gl = PIXI.gl;
if(!texture._glTexture)
{
texture._glTexture = gl.createTexture();
}
if(texture.hasLoaded)
{
gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.BaseTexture.SCALE_MODE.LINEAR ? gl.LINEAR : gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.BaseTexture.SCALE_MODE.LINEAR ? gl.LINEAR : gl.NEAREST);
// reguler...
if(!texture._powerOf2)
{
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
}
else
{
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
}
gl.bindTexture(gl.TEXTURE_2D, null);
}
}; |
<<<<<<<
premultipliedAlpha:!!transparent,
stencil:true,
preserveDrawingBuffer: preserveDrawingBuffer
=======
premultipliedAlpha:!!transparent && transparent !== 'notMultiplied',
stencil:true
>>>>>>>
premultipliedAlpha:!!transparent && transparent !== 'notMultiplied',
stencil:true,
preserveDrawingBuffer: preserveDrawingBuffer |
<<<<<<<
touchEvent.globalX = touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution;
touchEvent.globalY = touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution;
if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height)
=======
if (!isSupportCocoonJS)
{
touchData.global.x = ( (touchEvent.clientX - rect.left) * wCalc ) / this.resolution;
touchData.global.y = ( (touchEvent.clientY - rect.top) * hCalc ) / this.resolution;
}
else
>>>>>>>
if (!isSupportCocoonJS)
{
touchEvent.globalX = touchData.global.x = ( (touchEvent.clientX - rect.left) * wCalc ) / this.resolution;
touchEvent.globalY = touchData.global.y = ( (touchEvent.clientY - rect.top) * hCalc ) / this.resolution;
}
else |
<<<<<<<
class Filter extends Shader
=======
export default class Filter
>>>>>>>
export default class Filter extends Shader
<<<<<<<
=======
this.uniformData = uniforms || extractUniformsFromSrc(this.vertexSrc, this.fragmentSrc, 'projectionMatrix|uSampler');
/**
* An object containing the current values of custom uniforms.
* @example <caption>Updating the value of a custom uniform</caption>
* filter.uniforms.time = performance.now();
*
* @member {object}
*/
this.uniforms = {};
for (const i in this.uniformData)
{
this.uniforms[i] = this.uniformData[i].value;
}
// this is where we store shader references..
// TODO we could cache this!
this.glShaders = {};
// used for cacheing.. sure there is a better way!
if (!SOURCE_KEY_MAP[this.vertexSrc + this.fragmentSrc])
{
SOURCE_KEY_MAP[this.vertexSrc + this.fragmentSrc] = uid();
}
this.glShaderKey = SOURCE_KEY_MAP[this.vertexSrc + this.fragmentSrc];
>>>>>>>
<<<<<<<
}
export default Filter;
=======
/**
* The default vertex shader source
*
* @static
* @constant
*/
static get defaultVertexSrc()
{
return [
'attribute vec2 aVertexPosition;',
'attribute vec2 aTextureCoord;',
'uniform mat3 projectionMatrix;',
'uniform mat3 filterMatrix;',
'varying vec2 vTextureCoord;',
'varying vec2 vFilterCoord;',
'void main(void){',
' gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);',
' vFilterCoord = ( filterMatrix * vec3( aTextureCoord, 1.0) ).xy;',
' vTextureCoord = aTextureCoord ;',
'}',
].join('\n');
}
/**
* The default fragment shader source
*
* @static
* @constant
*/
static get defaultFragmentSrc()
{
return [
'varying vec2 vTextureCoord;',
'varying vec2 vFilterCoord;',
'uniform sampler2D uSampler;',
'uniform sampler2D filterSampler;',
'void main(void){',
' vec4 masky = texture2D(filterSampler, vFilterCoord);',
' vec4 sample = texture2D(uSampler, vTextureCoord);',
' vec4 color;',
' if(mod(vFilterCoord.x, 1.0) > 0.5)',
' {',
' color = vec4(1.0, 0.0, 0.0, 1.0);',
' }',
' else',
' {',
' color = vec4(0.0, 1.0, 0.0, 1.0);',
' }',
// ' gl_FragColor = vec4(mod(vFilterCoord.x, 1.5), vFilterCoord.y,0.0,1.0);',
' gl_FragColor = mix(sample, masky, 0.5);',
' gl_FragColor *= sample.a;',
'}',
].join('\n');
}
}
>>>>>>>
} |
<<<<<<<
displayObject.worldTransform = PIXI.RenderTexture.tempMatrix;
=======
displayObject.worldTransform = PIXI.identityMatrix;//this.identityMatrix;
>>>>>>>
displayObject.worldTransform = PIXI.RenderTexture.tempMatrix;
<<<<<<<
displayObject.worldTransform = PIXI.RenderTexture.tempMatrix;
=======
var originalWorldTransform = displayObject.worldTransform;
displayObject.worldTransform = PIXI.identityMatrix;
>>>>>>>
var originalWorldTransform = displayObject.worldTransform;
displayObject.worldTransform = PIXI.RenderTexture.tempMatrix; |
<<<<<<<
=======
>>>>>>> |
<<<<<<<
super();
=======
/**
* the current WebGL drawing context
*
* @member {WebGLRenderingContext}
*/
this.gl = gl;
>>>>>>>
super();
<<<<<<<
/*
* @member {Uint16Array} An array containing the indices of the vertices
=======
/**
* An array containing the indices of the vertices
*
* @member {Uint16Array}
>>>>>>>
/*
* @member {Uint16Array} An array containing the indices of the vertices
*
* @member {Uint16Array} |
<<<<<<<
* @param width=800 {Number} the width of the canvas view
* @param height=600 {Number} the height of the canvas view
* @param [options] {Object} The optional renderer parameters
* @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
* @param [options.transparent=false] {Boolean} If the render view is transparent, default false
* @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
* @param [options.clearBeforeRender=true] {Boolean} This sets if the CanvasRenderer will clear the canvas or not before the new render pass.
=======
* @param [width=800] {Number} the width of the canvas view
* @param [height=600] {Number} the height of the canvas view
* @param [view] {HTMLCanvasElement} the canvas to use as a view, optional
* @param [transparent=false] {Boolean} the transparency of the render view, default false
>>>>>>>
* @param [width=800] {Number} the width of the canvas view
* @param [height=600] {Number} the height of the canvas view
* @param [options] {Object} The optional renderer parameters
* @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
* @param [options.transparent=false] {Boolean} If the render view is transparent, default false
* @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
* @param [options.clearBeforeRender=true] {Boolean} This sets if the CanvasRenderer will clear the canvas or not before the new render pass. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.