conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
// hide all submit-rows
iframe.contents().find('.submit-row').hide();
=======
row.hide(); // hide submit-row
var form = iframe.contents().find('form');
//avoids conflict between the browser's form validation and Django's validation
form.submit(function () {
if (that.hideFrame) { //submit button was clicked
that.modal.find('.cms_modal-frame iframe').hide();
//page has been saved, run checkup
that.saved = true;
}
});
>>>>>>>
// hide all submit-rows
iframe.contents().find('.submit-row').hide();
row.hide(); // hide submit-row
var form = iframe.contents().find('form');
//avoids conflict between the browser's form validation and Django's validation
form.submit(function () {
if (that.hideFrame) { //submit button was clicked
that.modal.find('.cms_modal-frame iframe').hide();
//page has been saved, run checkup
that.saved = true;
}
}); |
<<<<<<<
// @ts-check
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
/**@type {any} */
const AureliaWebpackPlugin = require('aurelia-webpack-plugin');
const outDir = path.resolve(__dirname, 'dist');
/**
* @returns {import('webpack').Configuration}
*/
module.exports = function ({ production = '' } = {}) {
return {
mode: production === 'production' ? 'production' : 'development',
output: {
path: outDir,
filename: production ? '[name].[chunkhash].bundle.js' : '[name].[hash].bundle.js',
sourceMapFilename: production ? '[name].[chunkhash].bundle.map' : '[name].[hash].bundle.map',
chunkFilename: production ? '[name].[chunkhash].chunk.js' : '[name].[hash].chunk.js'
},
resolve: {
extensions: ['.ts', '.js'],
modules: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'node_modules'),
],
alias: {
'src': path.resolve(__dirname, 'src'),
// alias all aurelia packages to parent node_modules,
// so packages & core modules will use the same version of core modules
...([
'polyfills',
'dependency-injection',
'loader',
'pal',
'pal-browser',
'metadata',
'logging',
'binding',
'path',
'framework',
'history',
'history-browser',
'event-aggregator',
'router',
'route-recognizer',
'templating',
'templating-binding',
'templating-resources',
'templating-router',
'task-queue',
].reduce(
/**
* @param {Record<string, string>} map
*/
(map, packageName) => {
const aureliaName = `aurelia-${packageName}`;
map[aureliaName] = path.resolve(__dirname, `../node_modules/${aureliaName}`);
return map;
},
{}
)),
// alias all packages to src code
...([
'button',
'card',
'checkbox',
'chip-input',
'core',
'datepicker',
'expandable',
'form',
'grid',
'icons',
'input',
'input-info',
'list',
'modal',
'positioning',
'radio',
'select',
'slider',
'switch',
'textarea',
].reduce((map, packageName) => {
const mappedPackagedName = `@aurelia-ux/${packageName}`;
map[mappedPackagedName] = path.resolve(__dirname, `../packages/${packageName}/src`);
return map;
}, {}))
},
},
entry: {
app: './src/main.ts'
},
module: {
rules: [
{
test: /\.ts$/,
loader: 'ts-loader'
},
{
test: /\.html$/,
loader: 'html-loader'
},
{
test: /\.css$/i,
issuer: [{ not: [{ test: /\.html$/i }] }],
use: ['style-loader', 'css-loader']
},
{
test: /\.css$/i,
issuer: [{ test: /\.html$/i }],
// CSS required in templates cannot be extracted safely
// because Aurelia would try to require it again in runtime
use: ['css-loader']
},
]
},
plugins: [
new AureliaWebpackPlugin.AureliaPlugin({
aureliaApp: undefined,
entry: undefined,
dist: 'es2015',
}),
new HtmlWebpackPlugin({ template: './index.ejs' })
]
}
}
=======
// @ts-check
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
/**@type {any} */
const AureliaWebpackPlugin = require('aurelia-webpack-plugin');
const outDir = path.resolve(__dirname, 'dist');
/**
* @returns {import('webpack').Configuration}
*/
module.exports = function ({ production = '' } = {}) {
return {
mode: production === 'production' ? 'production' : 'development',
output: {
path: outDir,
filename: production ? '[name].[chunkhash].bundle.js' : '[name].[hash].bundle.js',
sourceMapFilename: production ? '[name].[chunkhash].bundle.map' : '[name].[hash].bundle.map',
chunkFilename: production ? '[name].[chunkhash].chunk.js' : '[name].[hash].chunk.js'
},
resolve: {
extensions: ['.ts', '.js'],
modules: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'node_modules'),
],
alias: {
'src': path.resolve(__dirname, 'src'),
// alias all aurelia packages to parent node_modules,
// so packages & core modules will use the same version of core modules
...([
'polyfills',
'dependency-injection',
'loader',
'pal',
'pal-browser',
'metadata',
'logging',
'binding',
'path',
'framework',
'history',
'history-browser',
'event-aggregator',
'router',
'route-recognizer',
'templating',
'templating-binding',
'templating-resources',
'templating-router',
'task-queue',
].reduce(
/**
* @param {Record<string, string>} map
*/
(map, packageName) => {
const aureliaName = `aurelia-${packageName}`;
map[aureliaName] = path.resolve(__dirname, `../node_modules/${aureliaName}`);
return map;
},
{}
)),
// alias all packages to src code
...([
'button',
'card',
'checkbox',
'chip-input',
'core',
'datepicker',
'form',
'grid',
'icons',
'input',
'input-info',
'list',
'modal',
'positioning',
'progress',
'radio',
'select',
'sidenav',
'slider',
'switch',
'textarea',
].reduce((map, packageName) => {
const mappedPackagedName = `@aurelia-ux/${packageName}`;
map[mappedPackagedName] = path.resolve(__dirname, `../packages/${packageName}/src`);
return map;
}, {}))
},
},
entry: {
app: './src/main.ts'
},
module: {
rules: [
{
test: /\.ts$/,
loader: 'ts-loader'
},
{
test: /\.html$/,
loader: 'html-loader'
},
{
test: /\.css$/i,
issuer: [{ not: [{ test: /\.html$/i }] }],
use: ['style-loader', 'css-loader']
},
{
test: /\.css$/i,
issuer: [{ test: /\.html$/i }],
// CSS required in templates cannot be extracted safely
// because Aurelia would try to require it again in runtime
use: ['css-loader']
},
]
},
plugins: [
new AureliaWebpackPlugin.AureliaPlugin({
aureliaApp: undefined,
entry: undefined,
dist: 'es2015',
}),
new HtmlWebpackPlugin({ template: './index.ejs' })
]
}
}
>>>>>>>
// @ts-check
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
/**@type {any} */
const AureliaWebpackPlugin = require('aurelia-webpack-plugin');
const outDir = path.resolve(__dirname, 'dist');
/**
* @returns {import('webpack').Configuration}
*/
module.exports = function ({ production = '' } = {}) {
return {
mode: production === 'production' ? 'production' : 'development',
output: {
path: outDir,
filename: production ? '[name].[chunkhash].bundle.js' : '[name].[hash].bundle.js',
sourceMapFilename: production ? '[name].[chunkhash].bundle.map' : '[name].[hash].bundle.map',
chunkFilename: production ? '[name].[chunkhash].chunk.js' : '[name].[hash].chunk.js'
},
resolve: {
extensions: ['.ts', '.js'],
modules: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'node_modules'),
],
alias: {
'src': path.resolve(__dirname, 'src'),
// alias all aurelia packages to parent node_modules,
// so packages & core modules will use the same version of core modules
...([
'polyfills',
'dependency-injection',
'loader',
'pal',
'pal-browser',
'metadata',
'logging',
'binding',
'path',
'framework',
'history',
'history-browser',
'event-aggregator',
'router',
'route-recognizer',
'templating',
'templating-binding',
'templating-resources',
'templating-router',
'task-queue',
].reduce(
/**
* @param {Record<string, string>} map
*/
(map, packageName) => {
const aureliaName = `aurelia-${packageName}`;
map[aureliaName] = path.resolve(__dirname, `../node_modules/${aureliaName}`);
return map;
},
{}
)),
// alias all packages to src code
...([
'button',
'card',
'checkbox',
'chip-input',
'core',
'datepicker',
'expandable',
'form',
'grid',
'icons',
'input',
'input-info',
'list',
'modal',
'positioning',
'progress',
'radio',
'select',
'sidenav',
'slider',
'switch',
'textarea',
].reduce((map, packageName) => {
const mappedPackagedName = `@aurelia-ux/${packageName}`;
map[mappedPackagedName] = path.resolve(__dirname, `../packages/${packageName}/src`);
return map;
}, {}))
},
},
entry: {
app: './src/main.ts'
},
module: {
rules: [
{
test: /\.ts$/,
loader: 'ts-loader'
},
{
test: /\.html$/,
loader: 'html-loader'
},
{
test: /\.css$/i,
issuer: [{ not: [{ test: /\.html$/i }] }],
use: ['style-loader', 'css-loader']
},
{
test: /\.css$/i,
issuer: [{ test: /\.html$/i }],
// CSS required in templates cannot be extracted safely
// because Aurelia would try to require it again in runtime
use: ['css-loader']
},
]
},
plugins: [
new AureliaWebpackPlugin.AureliaPlugin({
aureliaApp: undefined,
entry: undefined,
dist: 'es2015',
}),
new HtmlWebpackPlugin({ template: './index.ejs' })
]
}
} |
<<<<<<<
var chrome = {
browserAction: {
setBadgeText: function () {},
setBadgeBackgroundColor: function () {}
},
tabs : {
create: function () {}
},
extension: {
sendMessage: function () {},
onMessage: {
addListener: function () {}
}
},
cookies: {
remove: function () {}
}
};
require.config({
baseUrl: '../src',
paths: {
messages: 'options/messagesStatic',
bootbox: '../components/bootbox/bootbox',
mout: '../components/mout/src',
bootstrap: '../lib/twitter-bootstrap/js/bootstrap',
fixtures: '../spec/fixtures',
jasmineSignals: '../components/jasmine-signals/jasmine-signals',
jquery: '../components/jquery/jquery',
json: '../components/requirejs-plugins/src/json',
mocks: '../spec/mocks',
spec: '../spec',
signals: '../components/js-signals/dist/signals',
text: '../components/requirejs-text/text',
hbs: '../lib/require-handlebars-plugin/hbs-plugin',
handlebars: '../lib/require-handlebars-plugin/Handlebars',
underscore: '../lib/require-handlebars-plugin/hbs/underscore',
i18nprecompile: '../lib/require-handlebars-plugin/hbs/i18nprecompile',
json2: '../lib/require-handlebars-plugin/hbs/json2',
rx: '../components/rxjs/rx',
'rx.jquery': '../components/rxjs-jquery/rx.jquery',
'rx.time': '../components/rxjs/rx.time',
bootstrapToggle: '../lib/bootstrap-toggle-buttons/js/jquery.toggle.buttons'
},
map: {
'rx.jquery': {
'jQuery': 'jquery'
}
},
shim: {
bootstrap: [ 'jquery' ],
bootbox: {
deps: [ 'bootstrap' ],
exports: 'bootbox'
},
bootstrapToggle: {
deps: [ 'jquery', 'bootstrap' ]
}
},
hbs: {
templateExtension: 'html',
helperDirectory: 'templates/helpers/',
i18nDirectory: 'templates/i18n/'
},
waitSeconds: 2
});
=======
/*global $:false, jasmine:true */
var chrome = {
browserAction: {
setBadgeText: function () {},
setBadgeBackgroundColor: function () {}
},
tabs : {
create: function () {}
},
extension: {
sendMessage: function () {},
onMessage: {
addListener: function () {}
}
}
};
window.webkitNotifications = window.webkitNotifications || {};
window.webkitNotifications.createNotification = function () {};
jasmine.getFixtures().fixturesPath = 'spec/fixtures';
>>>>>>>
/*global $:false, jasmine:true */
var chrome = {
browserAction: {
setBadgeText: function () {},
setBadgeBackgroundColor: function () {}
},
tabs : {
create: function () {}
},
extension: {
sendMessage: function () {},
onMessage: {
addListener: function () {}
}
},
cookies: {
remove: function () {}
}
};
window.webkitNotifications = window.webkitNotifications || {};
window.webkitNotifications.createNotification = function () {};
jasmine.getFixtures().fixturesPath = 'spec/fixtures';
require.config({
baseUrl: '../src',
paths: {
messages: 'options/messagesStatic',
bootbox: '../components/bootbox/bootbox',
mout: '../components/mout/src',
bootstrap: '../lib/twitter-bootstrap/js/bootstrap',
fixtures: '../spec/fixtures',
jasmineSignals: '../components/jasmine-signals/jasmine-signals',
jquery: '../components/jquery/jquery',
json: '../components/requirejs-plugins/src/json',
mocks: '../spec/mocks',
spec: '../spec',
signals: '../components/js-signals/dist/signals',
text: '../components/requirejs-text/text',
hbs: '../lib/require-handlebars-plugin/hbs-plugin',
handlebars: '../lib/require-handlebars-plugin/Handlebars',
underscore: '../lib/require-handlebars-plugin/hbs/underscore',
i18nprecompile: '../lib/require-handlebars-plugin/hbs/i18nprecompile',
json2: '../lib/require-handlebars-plugin/hbs/json2',
rx: '../components/rxjs/rx',
'rx.jquery': '../components/rxjs-jquery/rx.jquery',
'rx.time': '../components/rxjs/rx.time',
bootstrapToggle: '../lib/bootstrap-toggle-buttons/js/jquery.toggle.buttons'
},
map: {
'rx.jquery': {
'jQuery': 'jquery'
}
},
shim: {
bootstrap: [ 'jquery' ],
bootbox: {
deps: [ 'bootstrap' ],
exports: 'bootbox'
},
bootstrapToggle: {
deps: [ 'jquery', 'bootstrap' ]
}
},
hbs: {
templateExtension: 'html',
helperDirectory: 'templates/helpers/',
i18nDirectory: 'templates/i18n/'
},
waitSeconds: 2
}); |
<<<<<<<
const {prometheusURL, grafanaURL, grafanaAPIKey, panel, from, to, templateVars, liveTail, testUUID, panelData} = this.props;
const {data, chartData} = this.state;
=======
const {prometheusURL, grafanaURL, panel, from, to, templateVars, testUUID} = this.props;
const {chartData} = this.state;
let {xAxis} = this.state;
>>>>>>>
const {prometheusURL, grafanaURL, grafanaAPIKey, panel, from, to, templateVars, testUUID, liveTail, panelData} = this.props;
const {data, chartData} = this.state;
let {xAxis} = this.state;
<<<<<<<
createOptions() {
const {panel, from, to, panelData} = this.props;
const fromDate = grafanaDateRangeToDate(from);
const toDate = grafanaDateRangeToDate(to);
=======
createOptions(xAxis, chartData, groups) {
const {panel, board, inDialog} = this.props;
>>>>>>>
// createOptions() {
// const {panel, from, to, panelData} = this.props;
// const fromDate = grafanaDateRangeToDate(from);
// const toDate = grafanaDateRangeToDate(to);
createOptions(xAxis, chartData, groups) {
const {panel, board, inDialog} = this.props;
<<<<<<<
const { classes, board, panel, inDialog, handleChartDialogOpen, panelData } = this.props;
const {chartData, options, error} = this.state;
let finalChartData = {
datasets: [],
labels: [],
}
const filteredData = chartData.datasets.filter(x => typeof x !== 'undefined')
if(chartData.datasets.length === filteredData.length){
finalChartData = chartData;
}
=======
const { classes, board, panel, inDialog, handleChartDialogOpen } = this.props;
const {error, chartData} = this.state;
>>>>>>>
// const { classes, board, panel, inDialog, handleChartDialogOpen, panelData } = this.props;
// const {chartData, options, error} = this.state;
// let finalChartData = {
// datasets: [],
// labels: [],
// }
// const filteredData = chartData.datasets.filter(x => typeof x !== 'undefined')
// if(chartData.datasets.length === filteredData.length){
// finalChartData = chartData;
// }
const { classes, board, panel, inDialog, handleChartDialogOpen, panelData } = this.props;
const {error, chartData, options} = this.state; |
<<<<<<<
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/no-object-literal-type-assertion': 0
=======
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/array-type': 0
>>>>>>>
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/no-object-literal-type-assertion': 0
'@typescript-eslint/array-type': 0 |
<<<<<<<
=======
it('correctly sets field value on assignment', () => {
schema.register(Person, Location);
const session = schema.from(schema.getDefaultState());
Person.create({id: 0, name: 'Tommi', friend: null});
const nextState = session.reduce();
const nextSession = schema.from(nextState);
const newName = 'NewName';
nextSession.Person.withId(0).name = newName;
const nextNextState = session.reduce();
const nextNextSession = schema.from(nextNextState);
expect(nextNextSession.Person.withId(0).name).to.equal(newName);
});
});
it('correctly works with mutations', () => {
const schema = new Schema();
class PersonModel extends Model {
static get fields() {
return {
location: new ForeignKey('Location'),
};
}
}
PersonModel.modelName = 'Person';
>>>>>>> |
<<<<<<<
=======
import useQueryParam from 'hooks/useQueryParam';
import useSortableData from 'hooks/UseSortableData';
import useToggle from 'hooks/UseToggle';
import DeckPropType from 'proptypes/DeckPropType';
>>>>>>>
import useQueryParam from 'hooks/useQueryParam';
import useToggle from 'hooks/UseToggle';
import DeckPropType from 'proptypes/DeckPropType';
<<<<<<<
import useToggle from 'hooks/UseToggle';
import { SortableTable } from 'components/SortableTable';
=======
>>>>>>> |
<<<<<<<
import { sortIntoGroups, SORTS } from 'utils/Sort';
import { compareStrings, SortableTable } from 'components/SortableTable';
=======
import { sortIntoGroups, getSorts } from 'utils/Sort';
import useQueryParam from 'hooks/useQueryParam';
>>>>>>>
import { sortIntoGroups, SORTS } from 'utils/Sort';
<<<<<<<
const [sort, setSort] = useState('Color');
const [characteristic, setCharacteristic] = useState('CMC');
=======
const sorts = getSorts();
const [sort, setSort] = useQueryParam('sort', 'Color');
const [characteristic, setCharacteristic] = useQueryParam('field', 'CMC');
>>>>>>>
const [sort, setSort] = useQueryParam('sort', 'Color');
const [characteristic, setCharacteristic] = useQueryParam('field', 'CMC'); |
<<<<<<<
const cube = await Cube.findOne(buildIdQuery(req.params.id)).lean();
=======
const cube = await Cube.findOne(build_id_query(req.params.id)).lean();
for (const card of cube.cards) {
const details = carddb.cardFromId(card.cardID);
card.details = details;
}
cube.cards = sortutil.sortForCSVDownload(cube.cards);
>>>>>>>
const cube = await Cube.findOne(buildIdQuery(req.params.id)).lean();
for (const card of cube.cards) {
const details = carddb.cardFromId(card.cardID);
card.details = details;
}
cube.cards = sortutil.sortForCSVDownload(cube.cards); |
<<<<<<<
try {
const response = await csrfFetch(`/cube/api/updatecard/${document.getElementById('cubeID').value}`, {
method: 'POST',
body: JSON.stringify({ src: card, updated }),
headers: {
'Content-Type': 'application/json',
},
});
const json = await response.json();
if (json.success === 'true') {
const cardResponse = await fetch(`/cube/api/getcardfromid/${updated.cardID}`);
const cardJson = await cardResponse.json();
const newCard = {
...card,
...updated,
details: {
...cardJson.card,
display_image: updated.imgUrl || cardJson.card.image_normal,
},
};
updateCubeCard(cardIndex, newCard);
setIsOpen(false);
}
} catch (e) {
console.error(e);
=======
const response = await csrfFetch(`/cube/api/updatecard/${document.getElementById('cubeID').value}`, {
method: 'POST',
body: JSON.stringify({ src: card, updated }),
headers: {
'Content-Type': 'application/json',
},
}).catch((err) => console.error(err));
const json = await response.json().catch((err) => console.error(err));
if (json.success === 'true') {
const cardResponse = await fetch(`/cube/api/getcardfromid/${updated.cardID}`).catch((err) => console.error(err));
const cardJson = await cardResponse.json().catch((err) => console.error(err));
const newCard = {
...card,
...updated,
details: cardJson.card,
};
this.props.updateCubeCard(index, newCard);
this.setState({ card: newCard, isOpen: false });
>>>>>>>
try {
const response = await csrfFetch(`/cube/api/updatecard/${document.getElementById('cubeID').value}`, {
method: 'POST',
body: JSON.stringify({ src: card, updated }),
headers: {
'Content-Type': 'application/json',
},
});
const json = await response.json();
if (json.success === 'true') {
const cardResponse = await fetch(`/cube/api/getcardfromid/${updated.cardID}`);
const cardJson = await cardResponse.json();
const newCard = {
...card,
...updated,
details: cardJson.card,
};
updateCubeCard(cardIndex, newCard);
setIsOpen(false);
}
} catch (e) {
console.error(e);
<<<<<<<
setIsOpen(true);
const currentCard = card;
fetch(`/cube/api/getversions/${card.cardID}`)
.then((response) => response.json())
.then((json) => {
// Otherwise the modal has changed in between.
if (currentCard.details.name == cube[newCardIndex].details.name) {
setVersions(json.cards);
}
});
},
[cube],
);
const closeCardModal = useCallback(() => setIsOpen(false));
const details = versions.find((version) => version._id === formValues.version) || card.details;
const renderCard = { ...card, details };
return (
<CardModalContext.Provider value={openCardModal}>
{children}
<CardModal
values={formValues}
onChange={handleChange}
card={renderCard}
versions={versions}
toggle={closeCardModal}
isOpen={isOpen}
disabled={!canEdit}
saveChanges={saveChanges}
queueRemoveCard={queueRemoveCard}
tagActions={{ addTag, deleteTag, reorderTag }}
{...props}
/>
</CardModalContext.Provider>
);
};
=======
}
closeCardModal() {
this.setState({ isOpen: false });
}
render() {
const { canEdit, setOpenCollapse, children, cube, updateCubeCard, ...props } = this.props;
const { index, isOpen, versions, formValues } = this.state;
const baseCard = typeof index !== 'undefined' ? cube[index] : { details: {}, tags: [] };
const details = versions.find((version) => version._id === formValues.version) || baseCard.details;
const card = { ...baseCard, details };
return (
<CardModalContext.Provider value={this.openCardModal}>
{children}
<CardModal
values={formValues}
onChange={this.handleChange}
card={card}
versions={versions}
toggle={this.closeCardModal}
isOpen={isOpen}
disabled={!canEdit}
saveChanges={this.saveChanges}
queueRemoveCard={this.queueRemoveCard}
tagActions={{
addTag: this.addTag,
deleteTag: this.deleteTag,
reorderTag: this.reorderTag,
}}
{...props}
/>
</CardModalContext.Provider>
);
}
}
const CardModalForm = (props) => (
<CubeContext.Consumer>
{({ cube, updateCubeCard }) => <CardModalFormRaw {...{ cube, updateCubeCard }} {...props} />}
</CubeContext.Consumer>
);
>>>>>>>
setIsOpen(true);
const currentCard = card;
fetch(`/cube/api/getversions/${card.cardID}`)
.then((response) => response.json())
.then((json) => {
// Otherwise the modal has changed in between.
if (currentCard.details.name == cube[newCardIndex].details.name) {
setVersions(json.cards);
}
});
},
[cube],
);
const closeCardModal = useCallback(() => setIsOpen(false));
const details = versions.find((version) => version._id === formValues.version) || card.details;
const renderCard = { ...card, details };
return (
<CardModalContext.Provider value={openCardModal}>
{children}
<CardModal
values={formValues}
onChange={handleChange}
card={renderCard}
versions={versions}
toggle={closeCardModal}
isOpen={isOpen}
disabled={!canEdit}
saveChanges={saveChanges}
queueRemoveCard={queueRemoveCard}
tagActions={{ addTag, deleteTag, reorderTag }}
{...props}
/>
</CardModalContext.Provider>
);
}; |
<<<<<<<
const cube = await Cube.findOne(buildIdQuery(req.params.id));
=======
const cube = await Cube.findOne(build_id_query(req.params.id));
if (!req.user._id.equals(cube.owner)) {
req.flash('danger', 'Formats can only be changed by cube owner.');
return res.redirect(`/cube/list/${req.params.id}`);
}
>>>>>>>
const cube = await Cube.findOne(buildIdQuery(req.params.id));
if (!req.user._id.equals(cube.owner)) {
req.flash('danger', 'Formats can only be changed by cube owner.');
return res.redirect(`/cube/list/${req.params.id}`);
}
<<<<<<<
let cube = await Cube.findOne(buildIdQuery(req.params.id));
cube.date_updated = Date.now();
cube.updated_string = cube.date_updated.toLocaleString('en-US');
cube = setCubeType(cube, carddb);
await cube.save();
=======
>>>>>>>
<<<<<<<
const ratingsQ = CardRating.find({
name: { $in: [...names] },
}).lean();
const cubeQ = Cube.findOne(buildIdQuery(draft.cube)).lean();
const [cube, ratings] = await Promise.all([cubeQ, ratingsQ]);
if (!cube) {
req.flash('danger', 'Cube not found');
return res.status(404).render('misc/404', {});
=======
for (const seat of draft.seats) {
for (const collection of [seat.drafted, seat.sideboard, seat.packbacklog]) {
for (const pack of collection) {
for (const card of pack) {
card.details = carddb.cardFromId(card.cardID);
}
}
}
for (const card of seat.pickorder) {
card.details = carddb.cardFromId(card.cardID);
}
>>>>>>>
for (const seat of draft.seats) {
for (const collection of [seat.drafted, seat.sideboard, seat.packbacklog]) {
for (const pack of collection) {
for (const card of pack) {
card.details = carddb.cardFromId(card.cardID);
}
}
}
for (const card of seat.pickorder) {
card.details = carddb.cardFromId(card.cardID);
}
<<<<<<<
const cube = await Cube.findOne(buildIdQuery(draft.cube));
=======
deck.cubename = cube.name;
deck.seats = [];
for (const seat of draft.seats) {
deck.seats.push({
bot: seat.bot,
userid: seat.userid,
username: seat.name,
pickorder: seat.pickorder,
name: `Draft of ${cube.name}`,
description: '',
cols: 16,
deck: seat.drafted,
sideboard: seat.sideboard ? seat.sideboard : [],
});
}
>>>>>>>
deck.cubename = cube.name;
deck.seats = [];
for (const seat of draft.seats) {
deck.seats.push({
bot: seat.bot,
userid: seat.userid,
username: seat.name,
pickorder: seat.pickorder,
name: `Draft of ${cube.name}`,
description: '',
cols: 16,
deck: seat.drafted,
sideboard: seat.sideboard ? seat.sideboard : [],
});
}
<<<<<<<
deck.bots = base.bots;
deck.playersideboard = base.playersideboard;
const cube = await Cube.findOne(buildIdQuery(deck.cube));
if (!cube.decks) {
cube.decks = [];
}
cube.decks.push(deck._id);
if (!cube.numDecks) {
cube.numDecks = 0;
}
=======
deck.cubename = cube.name;
deck.comments = [];
deck.seats = [
{
userid: req.user._id,
username: req.user.username,
pickorder: base.seats[req.params.index].pickorder,
name: `${req.user.username}'s rebuild from ${cube.name} on ${deck.date.toLocaleString('en-US')}`,
description: 'This deck was rebuilt from another draft deck.',
cols: base.seats[req.params.index].cols,
deck: base.seats[req.params.index].deck,
sideboard: base.seats[req.params.index].sideboard,
},
];
>>>>>>>
deck.cubename = cube.name;
deck.comments = [];
deck.seats = [
{
userid: req.user._id,
username: req.user.username,
pickorder: base.seats[req.params.index].pickorder,
name: `${req.user.username}'s rebuild from ${cube.name} on ${deck.date.toLocaleString('en-US')}`,
description: 'This deck was rebuilt from another draft deck.',
cols: base.seats[req.params.index].cols,
deck: base.seats[req.params.index].deck,
sideboard: base.seats[req.params.index].sideboard,
},
];
<<<<<<<
const cube = await Cube.findOne(buildIdQuery(deck.cube), Cube.LAYOUT_FIELDS).lean();
=======
const cube = await Cube.findOne(build_id_query(deck.cube), Cube.LAYOUT_FIELDS).lean();
>>>>>>>
const cube = await Cube.findOne(buildIdQuery(deck.cube), Cube.LAYOUT_FIELDS).lean(); |
<<<<<<<
export function arrayRotate(arr, reverse) {
if (reverse) arr.unshift(arr.pop());
else arr.push(arr.shift());
return arr;
}
export function arrayShuffle(array) {
let currentIndex = array.length;
let temporaryValue, randomIndex;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
// And swap it with the current element.
temporaryValue = array[currentIndex];
array[currentIndex] = array[randomIndex];
array[randomIndex] = temporaryValue;
}
return array;
};
export function randomElement(array) {
const randomIndex = Math.floor(Math.random() * array.length);
return array[randomIndex];
}
=======
export function arrayMove(arr, oldIndex, newIndex) {
const result = [...arr];
const [element] = result.splice(oldIndex, 1);
result.splice(newIndex, 0, element);
return result;
}
>>>>>>>
export function arrayRotate(arr, reverse) {
if (reverse) arr.unshift(arr.pop());
else arr.push(arr.shift());
return arr;
}
export function arrayShuffle(array) {
let currentIndex = array.length;
let temporaryValue, randomIndex;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
// And swap it with the current element.
temporaryValue = array[currentIndex];
array[currentIndex] = array[randomIndex];
array[randomIndex] = temporaryValue;
}
return array;
};
export function randomElement(array) {
const randomIndex = Math.floor(Math.random() * array.length);
return array[randomIndex];
}
export function arrayMove(arr, oldIndex, newIndex) {
const result = [...arr];
const [element] = result.splice(oldIndex, 1);
result.splice(newIndex, 0, element);
return result;
}
<<<<<<<
export default { arraysEqual, arrayRotate, fromEntries };
=======
export default { arraysEqual, arrayMove, fromEntries };
>>>>>>>
export default { arraysEqual, arrayRotate, arrayMove, fromEntries }; |
<<<<<<<
StandardDraftCard.propTypes = {
onSetDefaultFormat: PropTypes.func.isRequired,
defaultDraftFormat: PropTypes.number.isRequired,
};
=======
const SealedCard = () => {
const { cubeID } = useContext(CubeContext);
return (
<Card className="mb-3">
<CSRFForm method="POST" action={`/cube/startsealed/${cubeID}`}>
<CardHeader>
<CardTitleH5>Standard Sealed</CardTitleH5>
</CardHeader>
<CardBody>
<LabelRow htmlFor="packs" label="Number of Packs">
<Input type="select" name="packs" id="packs" defaultValue="6">
{rangeOptions(1, 11)}
</Input>
</LabelRow>
<LabelRow htmlFor="cards" label="Cards per Pack">
<Input type="select" name="cards" id="cards" defaultValue="15">
{rangeOptions(5, 21)}
</Input>
</LabelRow>
</CardBody>
<CardFooter>
<Button color="success">Start Sealed</Button>
</CardFooter>
</CSRFForm>
</Card>
);
};
>>>>>>>
StandardDraftCard.propTypes = {
onSetDefaultFormat: PropTypes.func.isRequired,
defaultDraftFormat: PropTypes.number.isRequired,
};
const SealedCard = () => {
const { cubeID } = useContext(CubeContext);
return (
<Card className="mb-3">
<CSRFForm method="POST" action={`/cube/startsealed/${cubeID}`}>
<CardHeader>
<CardTitleH5>Standard Sealed</CardTitleH5>
</CardHeader>
<CardBody>
<LabelRow htmlFor="packs" label="Number of Packs">
<Input type="select" name="packs" id="packs" defaultValue="6">
{rangeOptions(1, 11)}
</Input>
</LabelRow>
<LabelRow htmlFor="cards" label="Cards per Pack">
<Input type="select" name="cards" id="cards" defaultValue="15">
{rangeOptions(5, 21)}
</Input>
</LabelRow>
</CardBody>
<CardFooter>
<Button color="success">Start Sealed</Button>
</CardFooter>
</CSRFForm>
</Card>
);
};
<<<<<<<
{decks.length !== 0 && <DecksCard decks={decks} cubeID={cubeID} className="mb-3" />}
<SamplePackCard className="mb-3" />
</Col>
<Col xs="12" md="6" xl="6">
{defaultDraftFormat === -1 && <StandardDraftFormatCard />}
=======
>>>>>>>
{defaultDraftFormat === -1 && <StandardDraftFormatCard />}
<<<<<<<
{defaultDraftFormat !== -1 && <StandardDraftFormatCard />}
=======
<StandardDraftCard className="mb-3" />
<SealedCard className="mb-3" />
</Col>
<Col xs="12" md="6" xl="6">
{decks.length !== 0 && <DecksCard decks={decks} cubeID={cubeID} className="mb-3" />}
<SamplePackCard className="mb-3" />
>>>>>>>
{defaultDraftFormat !== -1 && <StandardDraftFormatCard />}
<SealedCard className="mb-3" />
</Col>
<Col xs="12" md="6" xl="6">
{decks.length !== 0 && <DecksCard decks={decks} cubeID={cubeID} className="mb-3" />}
<SamplePackCard className="mb-3" /> |
<<<<<<<
const draftutil = require('../dist/util/draftutil.js');
const cardutil = require('../dist/util/Card.js');
=======
const analytics = require('../serverjs/analytics.js');
const draftutil = require('../dist/utils/draftutil.js');
const cardutil = require('../dist/utils/Card.js');
>>>>>>>
const draftutil = require('../dist/utils/draftutil.js');
const cardutil = require('../dist/utils/Card.js'); |
<<<<<<<
this.state = {
data: { type: 'none' },
workers: {},
analytics: {
curve: { url: '/js/analytics/colorCurve.js', title: 'Curve' },
typeBreakdown: { url: '/js/analytics/typeBreakdown.js', title: 'Type Breakdown' },
typeBreakdownCounts: { url: '/js/analytics/typeBreakdownCount.js', title: 'Type Breakdown Counts' },
colorCount: { url: '/js/analytics/colorCount.js', title: 'Color Counts' },
tokenGrid: { url: '/js/analytics/tokenGrid.js', title: 'Tokens' },
tagCloud: { url: '/js/analytics/tagCloud.js', title: 'Tag Cloud' },
cumulativeColorCount: { url: '/js/analytics/cumulativeColorCount.js', title: 'Cumulative Color Counts' },
},
analytics_order: [
'curve',
'typeBreakdown',
'typeBreakdownCounts',
'colorCount',
'cumulativeColorCount',
'tokenGrid',
'tagCloud',
],
filter: [],
cardsWithAsfan: null,
filteredWithAsfan: null,
formatId: this.props.defaultFormatId || -1,
nav: this.props.defaultNav || 'curve',
};
this.updateAsfan = this.updateAsfan.bind(this);
this.updateFilter = this.updateFilter.bind(this);
this.updateData = this.updateData.bind(this);
this.setFilter = this.setFilter.bind(this);
this.toggleFormatDropdownOpen = this.toggleFormatDropdownOpen.bind(this);
this.setFormat = this.setFormat.bind(this);
=======
const { defaultNav } = this.props;
this.state = { activeNav: defaultNav };
this.select = this.select.bind(this);
this.handleNav = this.handleNav.bind(this);
>>>>>>>
this.state = {
data: { type: 'none' },
workers: {},
analytics: {
curve: { url: '/js/analytics/colorCurve.js', title: 'Curve' },
typeBreakdown: { url: '/js/analytics/typeBreakdown.js', title: 'Type Breakdown' },
typeBreakdownCounts: { url: '/js/analytics/typeBreakdownCount.js', title: 'Type Breakdown Counts' },
colorCount: { url: '/js/analytics/colorCount.js', title: 'Color Counts' },
tokenGrid: { url: '/js/analytics/tokenGrid.js', title: 'Tokens' },
tagCloud: { url: '/js/analytics/tagCloud.js', title: 'Tag Cloud' },
cumulativeColorCount: { url: '/js/analytics/cumulativeColorCount.js', title: 'Cumulative Color Counts' },
},
analytics_order: [
'curve',
'typeBreakdown',
'typeBreakdownCounts',
'colorCount',
'cumulativeColorCount',
'tokenGrid',
'tagCloud',
],
filter: [],
cardsWithAsfan: null,
filteredWithAsfan: null,
formatId: this.props.defaultFormatId || -1,
nav: this.props.defaultNav || 'curve',
} ;
this.updateAsfan = this.updateAsfan.bind(this);
this.updateFilter = this.updateFilter.bind(this);
this.updateData = this.updateData.bind(this);
this.setFilter = this.setFilter.bind(this);
this.toggleFormatDropdownOpen = this.toggleFormatDropdownOpen.bind(this);
this.setFormat = this.setFormat.bind(this);
<<<<<<<
this.updateAsfan();
=======
const { nav } = this.state;
>>>>>>>
this.updateAsfan();
const { nav } = this.state;
<<<<<<<
this.setState({ nav }, this.updateData);
}
toggleFormatDropdownOpen() {
this.setState((prevState) => {
return { formatDropdownOpen: !prevState.formatDropdownOpen };
});
=======
this.setState({ activeNav: nav });
}
handleNav(event) {
event.preventDefault();
this.select(event.target.getAttribute('data-nav'));
>>>>>>>
this.setState({ nav }, this.updateData);
}
toggleFormatDropdownOpen() {
this.setState((prevState) => {
return { formatDropdownOpen: !prevState.formatDropdownOpen };
});
<<<<<<<
const { cube, cubeID } = this.props;
const { analytics, analytics_order, data, filter, formatId, nav } = this.state;
const { cards } = cube;
const filteredCards =
(filter && filter.length) > 0 ? cards.filter((card) => Filter.filterCard(card, filter)) : cards;
const navItem = (active, text) => (
<NavLink active={active === nav} onClick={this.select.bind(this, active)} href="#" key={active}>
=======
const { cube, cubeID, curve, typeByColor, multicoloredCounts, tokens } = this.props;
const { activeNav } = this.state;
const navItem = (nav, text) => (
<NavLink active={activeNav === nav} data-nav={nav} onClick={this.handleNav} href="#">
>>>>>>>
const { cube, cubeID } = this.props;
const { analytics, analytics_order, data, filter, formatId, nav } = this.state;
const { cards } = cube;
const filteredCards =
(filter && filter.length) > 0 ? cards.filter((card) => Filter.filterCard(card, filter)) : cards;
const navItem = (active, text) => (
<NavLink active={active === nav} onClick={() => this.select.bind(active)} href="#" key={active}>
<<<<<<<
<Row>
<Col>
<h4 className="d-lg-block d-none">{analytics[nav].title}</h4>
<p>
<MagicMarkdown markdown={data.description} cube={cube} />
</p>
</Col>
</Row>
<ErrorBoundary>{visualization}</ErrorBoundary>
=======
<ErrorBoundary>
{
{
curve: <CurveAnalysis curve={curve} />,
type: <TypeAnalysis typeByColor={typeByColor} />,
multi: <MulticoloredAnalysis multicoloredCounts={multicoloredCounts} />,
tokens: <TokenAnalysis tokens={tokens} />,
}[activeNav]
}
</ErrorBoundary>
>>>>>>>
<Row>
<Col>
<h4 className="d-lg-block d-none">{analytics[nav].title}</h4>
<p>
<MagicMarkdown markdown={data.description} cube={cube} />
</p>
</Col>
</Row>
<ErrorBoundary>{visualization}</ErrorBoundary> |
<<<<<<<
<DisplayContext.Consumer>
{({ showMaybeboard }) => (
<MaybeboardContextProvider initialCards={maybe}>
{showMaybeboard && <Maybeboard filter={filter} />}
</MaybeboardContextProvider>
)}
</DisplayContext.Consumer>
=======
<ClientOnly>
<DisplayContext.Consumer>
{({ showMaybeboard }) => showMaybeboard && <Maybeboard filter={filter} initialCards={maybe} />}
</DisplayContext.Consumer>
</ClientOnly>
>>>>>>>
<ClientOnly>
<DisplayContext.Consumer>
{({ showMaybeboard }) => (
<MaybeboardContextProvider initialCards={maybe}>
{showMaybeboard && <Maybeboard filter={filter} />}
</MaybeboardContextProvider>
)}
</DisplayContext.Consumer>
</ClientOnly> |
<<<<<<<
indexOfTag: function(cards, tag) {
tag = tag.toLowerCase();
if (tag == '*') {
return 0;
}
for (let i = 0; i < cards.length; i++) {
if (cards[i].tags && cards[i].tags.length > 0) {
for (let j = 0; j < cards[i].tags.length; j++) {
if (tag == cards[i].tags[j].toLowerCase()) {
return i;
}
}
}
}
return -1;
},
=======
getCardRatings: function(names, CardRating, callback) {
CardRating.find(
{
name: {
$in: names,
},
},
function(err, ratings) {
var dict = {};
if (ratings) {
ratings.forEach(function(rating, index) {
dict[rating.name] = rating.value;
});
}
callback(dict);
},
);
},
getDraftFormat: function(params, cube) {
let format;
if (params.id >= 0) {
format = parseDraftFormat(cube.draft_formats[params.id].packs);
format.custom = true;
format.multiples = cube.draft_formats[params.id].multiples;
} else {
// default format
format = [];
format.custom = false;
format.multiples = false;
for (let pack = 0; pack < params.packs; pack++) {
format[pack] = [];
for (let card = 0; card < params.cards; card++) {
format[pack].push('*'); // any card
}
}
}
return format;
},
// NOTE: format is an array with extra attributes, see getDraftFormat()
createDraft: function(format, cards, bots, seats) {
let draft = new Draft();
let nextCardfn = null;
if (cards.length === 0) {
throw new Error('Unable to create draft: no cards.');
}
if (bots.length === 0) {
throw new Error('Unable to create draft: no bots.');
}
if (seats < 2) {
throw new Error('Unable to create draft: invalid seats: ' + seats);
}
if (format.custom === true) {
nextCardfn = customDraft(cards, format.multiples);
} else {
nextCardfn = standardDraft(cards);
}
let result = createPacks(draft, format, seats, nextCardfn);
if (result.messages.length > 0) {
// TODO: display messages to user
draft.messages = result.messages.join('\n');
}
if (!result.ok) {
throw new Error('Could not create draft:\n' + result.messages.join('\n'));
}
// initial draft state
draft.initial_state = draft.packs.slice();
draft.pickNumber = 1;
draft.packNumber = 1;
draft.bots = bots;
return draft;
},
>>>>>>>
getDraftFormat: function(params, cube) {
let format;
if (params.id >= 0) {
format = parseDraftFormat(cube.draft_formats[params.id].packs);
format.custom = true;
format.multiples = cube.draft_formats[params.id].multiples;
} else {
// default format
format = [];
format.custom = false;
format.multiples = false;
for (let pack = 0; pack < params.packs; pack++) {
format[pack] = [];
for (let card = 0; card < params.cards; card++) {
format[pack].push('*'); // any card
}
}
}
return format;
},
// NOTE: format is an array with extra attributes, see getDraftFormat()
createDraft: function(format, cards, bots, seats) {
let draft = new Draft();
let nextCardfn = null;
if (cards.length === 0) {
throw new Error('Unable to create draft: no cards.');
}
if (bots.length === 0) {
throw new Error('Unable to create draft: no bots.');
}
if (seats < 2) {
throw new Error('Unable to create draft: invalid seats: ' + seats);
}
if (format.custom === true) {
nextCardfn = customDraft(cards, format.multiples);
} else {
nextCardfn = standardDraft(cards);
}
let result = createPacks(draft, format, seats, nextCardfn);
if (result.messages.length > 0) {
// TODO: display messages to user
draft.messages = result.messages.join('\n');
}
if (!result.ok) {
throw new Error('Could not create draft:\n' + result.messages.join('\n'));
}
// initial draft state
draft.initial_state = draft.packs.slice();
draft.pickNumber = 1;
draft.packNumber = 1;
draft.bots = bots;
return draft;
}, |
<<<<<<<
import Filter from '../../../src/utils/Filter';
import { getDraftBots, getDraftFormat, createDraft } from '../../../src/utils/draftutil';
import { expectOperator } from '../../helpers';
const sinon = require('sinon');
=======
import { getDraftBots, getDraftFormat, populateDraft } from 'utils/draftutil';
import { makeFilter } from 'filtering/FilterCards';
>>>>>>>
import { getDraftBots, getDraftFormat, createDraft } from 'utils/draftutil';
import { makeFilter } from 'filtering/FilterCards';
<<<<<<<
const CardRating = require('../../../models/cardrating');
const Draft = require('../../../models/draft');
=======
const Draft = require('../../../models/draft');
>>>>>>>
const Draft = require('../../../models/draft');
<<<<<<<
const expected_format = [
=======
const expectedFormat = [
>>>>>>>
const expectedFormat = [
<<<<<<<
const expectedFilters = function(...args) {
const expectedFormat = [];
=======
const expectedFilters = (...args) => {
const expectedFormat = [];
>>>>>>>
const expectedFilters = (...args) => {
const expectedFormat = [];
<<<<<<<
const tokens = [];
Filter.tokenizeInput(filterText, tokens);
filterText = Filter.parseTokens(tokens);
=======
({ filter: filterText } = makeFilter(filterText));
>>>>>>>
({ filter: filterText } = makeFilter(filterText));
<<<<<<<
describe('createDraft', () => {
let draft;
let format;
let cards;
let bots;
let seats;
=======
describe('populateDraft', () => {
let draft;
let format;
let cards;
let bots;
let seats;
>>>>>>>
describe('createDraft', () => {
let draft;
let format;
let cards;
let bots;
let seats;
<<<<<<<
format = getDraftFormat({ id: -1, packs: 1, cards: 15, seats }, exampleCube);
createDraft(format, cards, bots, 8, { username: 'user', _id: 0 });
=======
format = getDraftFormat({ id: -1, packs: 1, cards: 15, seats }, exampleCube);
populateDraft(format, cards, bots, 8, { username: 'user', _id: 0 });
>>>>>>>
format = getDraftFormat({ id: -1, packs: 1, cards: 15, seats }, exampleCube);
createDraft(format, cards, bots, 8, { username: 'user', _id: 0 });
<<<<<<<
const initial_stateJSON = JSON.stringify(draft.initial_state);
const packsJSON = JSON.stringify(draft.packs);
expect(initial_stateJSON).toEqual(packsJSON);
=======
const initialStateJSON = JSON.stringify(draft.initial_state);
const packsJSON = JSON.stringify(draft.packs);
expect(initialStateJSON).toEqual(packsJSON);
>>>>>>>
const initialStateJSON = JSON.stringify(draft.initial_state);
const packsJSON = JSON.stringify(draft.packs);
expect(initialStateJSON).toEqual(packsJSON); |
<<<<<<<
<FormGroup check>
<Label check>
<Input type="radio" name="deleteTags" checked={formValues.deleteTags} onChange={handleChange} />{' '}
Delete tags from all
</Label>
</FormGroup>
</FormGroup>
<TagInput tags={formValues.tags} {...{ addTag, deleteTag, reorderTag }} />
</Form>
</Col>
</Row>
<Row>
<Col xs="4">
<div className="card-price">Total Price: ${totalPrice.toFixed(2)}</div>
<div className="card-price">Total Foil Price: ${totalPriceFoil.toFixed(2)}</div>
</Col>
</Row>
</ModalBody>
<ModalFooter>
<Button color="danger" onClick={handleRemoveAll}>
Remove all from cube
</Button>
<MassBuyButton cards={cards}>Buy all</MassBuyButton>
<Button color="success" onClick={handleApply}>
Apply to all
</Button>
</ModalFooter>
</Modal>
</>
);
};
=======
<TagInput tags={tags} {...this.tagActions} />
</Form>
</Col>
</Row>
<Row>
<Col xs="4">
<div className="card-price">Total Price: ${totalPrice.toFixed(2)}</div>
<div className="card-price">Total Foil Price: ${totalPriceFoil.toFixed(2)}</div>
</Col>
</Row>
</ModalBody>
<ModalFooter>
<Button color="danger" onClick={this.handleRemoveAll}>
Remove all from cube
</Button>
<MassBuyButton cards={cards}>Buy all</MassBuyButton>
<LoadingButton color="success" onClick={this.handleApply}>
Apply to all
</LoadingButton>
</ModalFooter>
</Modal>
</>
);
}
}
>>>>>>>
<FormGroup check>
<Label check>
<Input type="radio" name="deleteTags" checked={formValues.deleteTags} onChange={handleChange} />{' '}
Delete tags from all
</Label>
</FormGroup>
</FormGroup>
<TagInput tags={formValues.tags} {...{ addTag, deleteTag, reorderTag }} />
</Form>
</Col>
</Row>
<Row>
<Col xs="4">
<div className="card-price">Total Price: ${totalPrice.toFixed(2)}</div>
<div className="card-price">Total Foil Price: ${totalPriceFoil.toFixed(2)}</div>
</Col>
</Row>
</ModalBody>
<ModalFooter>
<Button color="danger" onClick={handleRemoveAll}>
Remove all from cube
</Button>
<MassBuyButton cards={cards}>Buy all</MassBuyButton>
<LoadingButton color="success" onClick={handleApply}>
Apply to all
</LoadingButton>
</ModalFooter>
</Modal>
</>
);
}; |
<<<<<<<
<AutocardListItem key={card.index} card={card} noCardModal>
<Button close className="mr-1" data-index={card.index} onClick={handleRemoveCard} />
=======
<AutocardListItem key={card.index} card={card} noCardModal inModal>
<Button close className="float-none mr-1" data-index={card.index} onClick={handleRemoveCard} />
>>>>>>>
<AutocardListItem key={card.index} card={card} noCardModal inModal>
<Button close className="mr-1" data-index={card.index} onClick={handleRemoveCard} /> |
<<<<<<<
const cards = [...cube.cards];
const cardNames = [];
=======
const cards = cube.cards;
>>>>>>>
const cardNames = [];
const cards = cube.cards; |
<<<<<<<
const user_id = req.user ? req.user._id : '';
Cube.findOne(build_id_query(id_a), function(err, cubeA) {
Cube.findOne(build_id_query(id_b), function(err, cubeB) {
=======
Cube.findById(id_a, function(err, cubeA) {
Cube.findById(id_b, function(err, cubeB) {
>>>>>>>
const user_id = req.user ? req.user._id : '';
Cube.findOne(build_id_query(id_a), function(err, cubeA) {
Cube.findOne(build_id_query(id_b), function(err, cubeB) {
<<<<<<<
router.post('/api/updatecard/:id', function(req, res) {
Cube.findOne(build_id_query(req.params.id), function(err, cube) {
User.findById(cube.owner, function(err, owner) {
if (req.body.token != owner.edit_token) {
res.status(401).send({
=======
router.post('/api/updatecard/:id', ensureAuth, function(req, res) {
Cube.findById(req.params.id, function(err, cube) {
if (cube.owner === req.body._id) {
var found = false;
cube.cards.forEach(function(card, index) {
if (!card.type_line) {
card.type_line = carddb.carddict[card.cardID].type;
}
if (!found && cardsAreEquivalent(card, req.body.src, carddb)) {
found = true;
var updated = req.body.updated;
Object.keys(Cube.schema.paths.cards.schema.paths).forEach(function(key) {
if (!updated.hasOwnProperty(key)) {
updated[key] = card[key];
}
});
cube.cards[index] = updated;
}
});
if (!found) {
res.status(400).send({
>>>>>>>
router.post('/api/updatecard/:id', ensureAuth, function(req, res) {
Cube.findOne(build_id_query(req.params.id), function(err, cube) {
if (cube.owner === req.body._id) {
var found = false;
cube.cards.forEach(function(card, index) {
if (!card.type_line) {
card.type_line = carddb.carddict[card.cardID].type;
}
if (!found && cardsAreEquivalent(card, req.body.src, carddb)) {
found = true;
var updated = req.body.updated;
Object.keys(Cube.schema.paths.cards.schema.paths).forEach(function(key) {
if (!updated.hasOwnProperty(key)) {
updated[key] = card[key];
}
});
cube.cards[index] = updated;
}
});
if (!found) {
res.status(400).send({
<<<<<<<
router.post('/api/updatecards/:id', function(req, res) {
Cube.findOne(build_id_query(req.params.id), function(err, cube) {
User.findById(cube.owner, function(err, owner) {
if (req.body.token != owner.edit_token) {
res.status(401).send({
success: 'false',
message: 'Unauthorized'
});
} else {
=======
router.post('/api/updatecards/:id', ensureAuth, function(req, res) {
Cube.findById(req.params.id, function(err, cube) {
if (cube.owner === req.user._id) {
>>>>>>>
router.post('/api/updatecards/:id', ensureAuth, function(req, res) {
Cube.findOne(build_id_query(req.params.id), function(err, cube) {
if (cube.owner === req.user._id) {
<<<<<<<
router.post('/api/savesorts/:id', function(req, res) {
Cube.findOne(build_id_query(req.params.id), function(err, cube) {
User.findById(cube.owner, function(err, owner) {
if (req.body.token != owner.edit_token) {
res.status(401).send({
success: 'false',
message: 'Unauthorized'
});
} else {
var found = false;
cube.default_sorts = req.body.sorts;
cube.save(function(err) {
if (err) {
res.status(500).send({
success: 'false',
message: 'Error saving cube'
});
} else {
res.status(200).send({
success: 'true'
});
}
});
}
});
=======
router.post('/api/savesorts/:id', ensureAuth, function(req, res) {
Cube.findById(req.params.id, function(err, cube) {
if (cube.owner === req.body._id) {
var found = false;
cube.default_sorts = req.body.sorts;
cube.save(function(err) {
if (err) {
res.status(500).send({
success: 'false',
message: 'Error saving cube'
});
} else {
res.status(200).send({
success: 'true'
});
}
});
}
>>>>>>>
router.post('/api/savesorts/:id', ensureAuth, function(req, res) {
Cube.findOne(build_id_query(req.params.id), function(err, cube) {
if (cube.owner === req.body._id) {
var found = false;
cube.default_sorts = req.body.sorts;
cube.save(function(err) {
if (err) {
res.status(500).send({
success: 'false',
message: 'Error saving cube'
});
} else {
res.status(200).send({
success: 'true'
});
}
});
} |
<<<<<<<
me.proto_version = 300;
=======
me.hikas_2_mode = false;
>>>>>>>
me.proto_version = 300;
me.hikas_2_mode = false; |
<<<<<<<
picks: {
type: [[Number]],
default: [],
},
passed: {
type: Number,
default: 0,
},
=======
index: Number,
>>>>>>>
picks: {
type: [[Number]],
default: [],
},
passed: {
type: Number,
default: 0,
},
index: Number, |
<<<<<<<
var msg = new Nachricht(me.proto_version);
msg.sign({'pin':me.pin,'tan':NULL,'sys_id':me.sys_id,'pin_vers':me.upd.availible_tan_verfahren[0],'sig_id':me.getNewSigId()});
msg.init(me.dialog_id, me.next_msg_nr,me.blz,me.kunden_id);
me.next_msg_nr++;
var konto_verb=null;
=======
//Vars
var processed = false;
var v1=null;
var sepa_list=new Array();
// Create Segment
>>>>>>>
//Vars
var processed = false;
var v1=null;
var sepa_list=new Array();
// Create Segment
<<<<<<<
var msg = new Nachricht(me.proto_version);
=======
var processed = false;
var v7=null;
if(from_date==null&&to_date==null){
v7 = [[konto.iban,konto.bic,konto.konto_nr,konto.unter_konto,konto.ctry_code,konto.blz],"N"];
}else{
v7 = [[konto.iban,konto.bic,konto.konto_nr,konto.unter_konto,konto.ctry_code,konto.blz],"N",Helper.convertDateToDFormat(from_date),Helper.convertDateToDFormat(to_date)];
}
// Start
var req_umsaetze = new Order(me);
// TODO check if we can do the old or the new version HKCAZ
req_umsaetze.msg({
type:"HKKAZ",
ki_type:"HIKAZ",
aufsetzpunkt_loc:[6],
send_msg:{
7:v7
},
recv_msg:{
7:function(seg_vers,relatedRespSegments,relatedRespMsgs,recvMsg){
try{
if(req_umsaetze.checkMessagesOkay(relatedRespMsgs,true)){
// Erfolgreich Meldung
var txt = "";
for(var i in relatedRespSegments){
if(relatedRespSegments[i].name=="HIKAZ"){
var HIKAZ = relatedRespSegments[i];
txt += HIKAZ.getEl(1);
}
}
var mtparse = new MTParser();
mtparse.parse(txt);
var umsatze = mtparse.getKontoUmsaetzeFromMT490();
// Callback
try{
cb(null,recvMsg,umsatze);
}catch(cb_error){
me.log.gv.error(cb_error,{gv:"HKKAZ"},"Unhandled callback Error in HKKAZ");
}
}
}catch(ee){
me.log.gv.error(ee,{gv:"HKKAZ",resp_msg:recvMsg},"Exception while parsing HKKAZ response");
// Callback
try{
cb(ee,recvMsg,null);
}catch(cb_error){
me.log.gv.error(cb_error,{gv:"HKKAZ"},"Unhandled callback Error in HKKAZ");
}
}
processed = true;
}}
});
req_umsaetze.done(function(error,order,recvMsg){
if(error&&!processed){
me.log.gv.error(error,{gv:"HKKAZ",msg:recvMsg},"HKKAZ could not be send");
// Callback
try{
cb(error,recvMsg,null);
}catch(cb_error){
me.log.gv.error(cb_error,{gv:"HKKAZ"},"Unhandled callback Error in HKKAZ");
}
}else if(!processed){
error = new Exceptions.InternalError("HKKAZ response was not analysied");
me.log.gv.error(error,{gv:"HKKAZ",msg:msg},"HKKAZ response was not analysied");
// Callback
try{
cb(error,recvMsg,null);
}catch(cb_error){
me.log.gv.error(cb_error,{gv:"HKKAZ"},"Unhandled callback Error in HKKAZ");
}
}
});
};
me.MsgGetSaldo = function(konto,from_date,to_date,cb){
var msg = new Nachricht();
>>>>>>>
var processed = false;
var v7=null;
if(from_date==null&&to_date==null){
v7 = [[konto.iban,konto.bic,konto.konto_nr,konto.unter_konto,konto.ctry_code,konto.blz],"N"];
}else{
v7 = [[konto.iban,konto.bic,konto.konto_nr,konto.unter_konto,konto.ctry_code,konto.blz],"N",Helper.convertDateToDFormat(from_date),Helper.convertDateToDFormat(to_date)];
}
// Start
var req_umsaetze = new Order(me);
// TODO check if we can do the old or the new version HKCAZ
req_umsaetze.msg({
type:"HKKAZ",
ki_type:"HIKAZ",
aufsetzpunkt_loc:[6],
send_msg:{
7:v7
},
recv_msg:{
7:function(seg_vers,relatedRespSegments,relatedRespMsgs,recvMsg){
try{
if(req_umsaetze.checkMessagesOkay(relatedRespMsgs,true)){
// Erfolgreich Meldung
var txt = "";
for(var i in relatedRespSegments){
if(relatedRespSegments[i].name=="HIKAZ"){
var HIKAZ = relatedRespSegments[i];
txt += HIKAZ.getEl(1);
}
}
var mtparse = new MTParser();
mtparse.parse(txt);
var umsatze = mtparse.getKontoUmsaetzeFromMT490();
// Callback
try{
cb(null,recvMsg,umsatze);
}catch(cb_error){
me.log.gv.error(cb_error,{gv:"HKKAZ"},"Unhandled callback Error in HKKAZ");
}
}
}catch(ee){
me.log.gv.error(ee,{gv:"HKKAZ",resp_msg:recvMsg},"Exception while parsing HKKAZ response");
// Callback
try{
cb(ee,recvMsg,null);
}catch(cb_error){
me.log.gv.error(cb_error,{gv:"HKKAZ"},"Unhandled callback Error in HKKAZ");
}
}
processed = true;
}}
});
req_umsaetze.done(function(error,order,recvMsg){
if(error&&!processed){
me.log.gv.error(error,{gv:"HKKAZ",msg:recvMsg},"HKKAZ could not be send");
// Callback
try{
cb(error,recvMsg,null);
}catch(cb_error){
me.log.gv.error(cb_error,{gv:"HKKAZ"},"Unhandled callback Error in HKKAZ");
}
}else if(!processed){
error = new Exceptions.InternalError("HKKAZ response was not analysied");
me.log.gv.error(error,{gv:"HKKAZ",msg:msg},"HKKAZ response was not analysied");
// Callback
try{
cb(error,recvMsg,null);
}catch(cb_error){
me.log.gv.error(cb_error,{gv:"HKKAZ"},"Unhandled callback Error in HKKAZ");
}
}
});
};
me.MsgGetSaldo = function(konto,from_date,to_date,cb){
var msg = new Nachricht();
<<<<<<<
if(vers_step==1){
try{
var HIRMS = recvMsg.selectSegByNameAndBelongTo("HIRMS",1)[0];
if(HIRMS.getEl(1).getEl(1)=="9120"){
me.log.conest.debug({step:step,hirms:HIRMS},"Test Switch Version from FinTS to HBCI2.2");
me.proto_version = 220;
vers_step = 2;
perform_step(1);
}
}catch(e){
me.log.conest.error(e,{step:step,error2:error},"Init Dialog failed and no switch version: "+error);
}
}else{
me.log.conest.error({step:step,hirms:HIRMS},"Test Switch Version from FinTS to HBCI2.2 failed.");
me.proto_version = 300;
}
if(error){
me.log.conest.error({step:step,error:error},"Init Dialog failed: "+error);
cb(error);
}
=======
me.log.conest.error({step:step,error:error},"Init Dialog failed: "+error);
// Callback
try{
cb(error);
}catch(cb_error){
me.log.conest.error(cb_error,{step:step},"Unhandled callback Error in EstablishConnection");
}
>>>>>>>
if(vers_step==1){
try{
var HIRMS = recvMsg.selectSegByNameAndBelongTo("HIRMS",1)[0];
if(HIRMS.getEl(1).getEl(1)=="9120"){
me.log.conest.debug({step:step,hirms:HIRMS},"Test Switch Version from FinTS to HBCI2.2");
me.proto_version = 220;
vers_step = 2;
perform_step(1);
}
}catch(e){
me.log.conest.error(e,{step:step,error2:error},"Init Dialog failed and no switch version: "+error);
}
}else{
me.log.conest.error({step:step,hirms:HIRMS},"Test Switch Version from FinTS to HBCI2.2 failed.");
me.proto_version = 300;
}
if(error){
me.log.conest.error({step:step,error:error},"Init Dialog failed: "+error);
cb(error);
// Callback
try{
cb(error);
}catch(cb_error){
me.log.conest.error(cb_error,{step:step},"Unhandled callback Error in EstablishConnection");
}
} |
<<<<<<<
const RSS = require('rss');
const CARD_HEIGHT = 204;
const CARD_WIDTH = 146;
=======
const CARD_HEIGHT = 680;
const CARD_WIDTH = 488;
>>>>>>>
const RSS = require('rss');
const CARD_HEIGHT = 680;
const CARD_WIDTH = 488; |
<<<<<<<
/*Exceptions.WrongUserOrPinError = function(){
Exceptions.OpenFinTSClientException.call(this);
this.toString = function(){
return "Wrong user or wrong pin.";
};
};
util.inherits(Exceptions.WrongUserOrPinError, Exceptions.OpenFinTSClientException);*/
Exceptions.MissingBankConnectionDataException = function(blz){
Exceptions.OpenFinTSClientException.call(this);
this.blz = blz;
this.toString = function(){
return "No connection Url in Bankenliste found to connect to blz: "+this.blz+".";
};
};
util.inherits(Exceptions.MissingBankConnectionDataException, Exceptions.OpenFinTSClientException);
=======
Exceptions.OutofSequenceMessageException = function(){
Exceptions.OpenFinTSClientException.call(this);
this.toString = function(){
return "You have to ensure that only one message at a time is send to the server, use libraries like async or promisses. You can send a new message as soon as the callback returns.";
};
};
util.inherits(Exceptions.OutofSequenceMessageException, Exceptions.OpenFinTSClientException);
>>>>>>>
/*Exceptions.WrongUserOrPinError = function(){
Exceptions.OpenFinTSClientException.call(this);
this.toString = function(){
return "Wrong user or wrong pin.";
};
};
util.inherits(Exceptions.WrongUserOrPinError, Exceptions.OpenFinTSClientException);*/
Exceptions.MissingBankConnectionDataException = function(blz){
Exceptions.OpenFinTSClientException.call(this);
this.blz = blz;
this.toString = function(){
return "No connection Url in Bankenliste found to connect to blz: "+this.blz+".";
};
};
util.inherits(Exceptions.MissingBankConnectionDataException, Exceptions.OpenFinTSClientException);
Exceptions.OutofSequenceMessageException = function(){
Exceptions.OpenFinTSClientException.call(this);
this.toString = function(){
return "You have to ensure that only one message at a time is send to the server, use libraries like async or promisses. You can send a new message as soon as the callback returns.";
};
};
util.inherits(Exceptions.OutofSequenceMessageException, Exceptions.OpenFinTSClientException); |
<<<<<<<
const cube = await Cube.findOne(build_id_query(draft.cube));
=======
const ratingsQ = CardRating.find({
name: { $in: [...names] },
}).lean();
const cubeQ = Cube.findOne(build_id_query(draft.cube)).lean();
const [cube, ratings] = await Promise.all([cubeQ, ratingsQ]);
>>>>>>>
const cube = await Cube.findOne(build_id_query(draft.cube)).lean();
<<<<<<<
if (!deckOwner || !deckOwner._id.equals(req.user._id)) {
=======
if (!req.user._id.equals(deck.owner)) {
>>>>>>>
if (!deckOwner || !deckOwner._id.equals(req.user._id)) { |
<<<<<<<
if (options.limit && options.types && options.types.length === 1) {
options.limit = options.limit > 5 ? 5 : options.limit;
} else if (options.limit > 1) {
return callback(errcode('limit must be combined with a single type parameter when reverse geocoding', 'EINVALID'));
}
=======
// set a maxidx to limit context i/o to only allowed types and their
// parent features. When a types filter is present this limits maxidx
// to a lower number. When there's no types filter this allows all
// indexes to do i/o.
var maxidx = 0;
for (var type in geocoder.bytype) {
if (options.types && options.types.indexOf(type) === -1) continue;
for (var i = 0; i < geocoder.bytype[type].length; i++) {
maxidx = Math.max(maxidx, geocoder.bytype[type][i].idx + 1);
}
}
>>>>>>>
if (options.limit && options.types && options.types.length === 1) {
options.limit = options.limit > 5 ? 5 : options.limit;
} else if (options.limit > 1) {
return callback(errcode('limit must be combined with a single type parameter when reverse geocoding', 'EINVALID'));
}
// set a maxidx to limit context i/o to only allowed types and their
// parent features. When a types filter is present this limits maxidx
// to a lower number. When there's no types filter this allows all
// indexes to do i/o.
var maxidx = 0;
for (var type in geocoder.bytype) {
if (options.types && options.types.indexOf(type) === -1) continue;
for (var i = 0; i < geocoder.bytype[type].length; i++) {
maxidx = Math.max(maxidx, geocoder.bytype[type][i].idx + 1);
}
}
<<<<<<<
if (options.limit > 1) {
context(geocoder, queryData.query[0], queryData.query[1], {
full: false,
types: options.types,
stacks: options.stacks,
limit: options.limit
}, function(err, contexts) {
if (err) return callback(err);
var q = queue();
for (var context_it = 0; context_it < contexts.length; context_it++) {
var coords = contexts[context_it]['carmen:geom'];
q.defer(context, geocoder, coords[0], coords[1], {
full: true,
types: options.types,
stacks: options.stacks
});
}
q.awaitAll(function(err, contexts) {
if (err) return callback(err);
stackContext(null, contexts);
});
});
} else {
context(geocoder, queryData.query[0], queryData.query[1], {
full:true,
types: options.types,
stacks: options.stacks
}, function(err, context) {
if (err) return callback(err);
splitContext(null, context);
});
}
//If multiple reulst are being returned, do not split context array
//and simply format for output. So [poi, poi, poi] => [[poi, place], [poi, place], [poi, place]]
function stackContext(err, contexts) {
queryData.features = [];
var contextIndexes = {};
for (var contexts_it = 0; contexts_it < contexts.length; contexts_it++) {
var context = contexts[contexts_it];
context._relevance = 1;
// use the display template appropriate to the language, if available
var index = geocoder.byidx[context[0].properties['carmen:dbidx']];
var formats = { default: index.geocoder_format };
if (options.language) formats[options.language] = index['geocoder_format_' + options.language];
queryData.features.push(ops.toFeature(context, formats, options.language));
// record index names
if (options.indexes) contextIndexes[geocoder.byidx[context[0].properties['carmen:dbidx']].id] = true;
}
if (options.indexes) queryData.indexes = Object.keys(contextIndexes);
return callback(null, queryData);
}
//If a single result is being returned, split the context array into
//each of its compenents. So [poi, place, country]
// => [[poi, place, country], [place, country], [country]]
function splitContext(err, context) {
=======
context(geocoder, queryData.query[0], queryData.query[1], {
full:true,
maxidx: maxidx,
types: options.types,
stacks: options.stacks
}, function(err, context) {
if (err) return callback(err);
>>>>>>>
if (options.limit > 1) {
context(geocoder, queryData.query[0], queryData.query[1], {
full: false,
types: options.types,
stacks: options.stacks,
limit: options.limit
}, function(err, contexts) {
if (err) return callback(err);
var q = queue();
for (var context_it = 0; context_it < contexts.length; context_it++) {
var coords = contexts[context_it]['carmen:geom'];
q.defer(context, geocoder, coords[0], coords[1], {
full: true,
types: options.types,
stacks: options.stacks
});
}
q.awaitAll(function(err, contexts) {
if (err) return callback(err);
stackContext(null, contexts);
});
});
} else {
context(geocoder, queryData.query[0], queryData.query[1], {
full:true,
types: options.types,
stacks: options.stacks
}, function(err, context) {
if (err) return callback(err);
splitContext(null, context);
});
}
//If multiple reulst are being returned, do not split context array
//and simply format for output. So [poi, poi, poi] => [[poi, place], [poi, place], [poi, place]]
function stackContext(err, contexts) {
queryData.features = [];
var contextIndexes = {};
for (var contexts_it = 0; contexts_it < contexts.length; contexts_it++) {
var context = contexts[contexts_it];
context._relevance = 1;
// use the display template appropriate to the language, if available
var index = geocoder.byidx[context[0].properties['carmen:dbidx']];
var formats = { default: index.geocoder_format };
if (options.language) formats[options.language] = index['geocoder_format_' + options.language];
queryData.features.push(ops.toFeature(context, formats, options.language));
// record index names
if (options.indexes) contextIndexes[geocoder.byidx[context[0].properties['carmen:dbidx']].id] = true;
}
if (options.indexes) queryData.indexes = Object.keys(contextIndexes);
return callback(null, queryData);
}
//If a single result is being returned, split the context array into
//each of its compenents. So [poi, place, country]
// => [[poi, place, country], [place, country], [country]]
function splitContext(err, context) { |
<<<<<<<
indexdocs(docs, freq, known, updateCache);
=======
indexDocs(freq[0], freq, source._geocoder.zoom, callback);
>>>>>>>
indexdocs(docs, freq, source._geocoder.zoom, updateCache);
<<<<<<<
function updateCache(err, patch) {
if (err) return callback(err);
=======
// Second pass over docs.
// - Create term => docid index. Uses calculated frequencies to index only
// significant terms for each document.
// - Create id => grid zxy index.
function indexDocs(approxdocs, freq, zoom, callback) {
var patch = { grid: {}, term: {}, phrase: {}, degen: {} };
var features = {};
try {
for (var i = 0; i < docs.length; i++) loadDoc(docs[i], freq, patch, known, zoom);
} catch(err) {
return callback(err);
}
>>>>>>>
function updateCache(err, patch) {
if (err) return callback(err);
<<<<<<<
=======
function loadDoc(doc, freq, patch, known, zoom) {
if(!zoom) throw new Error('index has no zoom')
if (!doc._id) throw new Error('doc has no _id');
if (!doc._text) throw new Error('doc has no _text on _id:' + doc._id);
if (!doc._center) throw new Error('doc has no _center on _id:' + doc._id);
if (!doc._zxy || !doc._zxy.length) {
var tiles = cover.tiles(doc._geometry, {min_zoom: zoom, max_zoom: zoom});
doc._zxy = [];
tiles.forEach(function(tile){
doc._zxy.push(tile[2]+'/'+tile[0]+'/'+tile[1])
});
}
if (!doc._zxy || doc._zxy < 1) throw new Error('doc failed spatial indexing')
doc._hash = termops.feature(doc._id.toString());
doc._grid = doc._grid || [];
if (doc._zxy) for (var i = 0; i < doc._zxy.length; i++) {
doc._grid.push(ops.zxy(doc._hash, doc._zxy[i]));
}
var texts = doc._text.split(',');
var termsets = [];
var termsmaps = [];
var tokensets = [];
for (var x = 0; x < texts.length; x++) {
var tokens = termops.tokenize(texts[x]);
if (!tokens.length) continue;
termsets.push(termops.termsWeighted(tokens, freq));
termsmaps.push(termops.termsMap(tokens));
tokensets.push(tokens);
}
for (var x = 0; x < termsets.length; x++) {
var terms = termsets[x];
var sigid = null;
var sigweight = 0;
var termsmap = termsmaps[x];
for (var i = 0; i < terms.length; i++) {
// Decode the term id, weight from weighted terms.
var id = terms[i] >>> 4 << 4 >>> 0;
var weight = terms[i] % 16;
if (weight > sigweight) {
sigid = id;
sigweight = weight;
}
// This check avoids doing redundant work for a term once
// it is known to be indexed. @TODO known issue, this prevents
// degens from being used as an approach to avoiding fnv1a term
// collisions.
if (known.term[id]) continue;
known.term[id] = true;
// Degenerate terms are indexed for all terms
// (not just significant ones).
var degens = termops.degens(termsmap[id]);
for (var j = 0; j < degens.length; j = j+2) {
var d = degens[j];
patch.degen[d] = patch.degen[d] || [];
patch.degen[d].push(degens[j+1]);
}
}
// Generate phrase, clustered by most significant term.
var phrase = termops.phrase(tokensets[x], termsmap[sigid]);
patch.phrase[phrase] = patch.phrase[phrase] || terms;
patch.term[sigid] = patch.term[sigid] || [];
patch.term[sigid].push(phrase);
patch.grid[phrase] = patch.grid[phrase] || [];
patch.grid[phrase].push.apply(patch.grid[phrase], doc._grid);
// Debug significant term selection.
if (DEBUG) {
var debug = termsmap;
var oldtext = terms.map(function(id) {
id = id >>> 4 << 4 >>> 0;
return debug[id];
}).join(' ');
var sigtext = debug[sigid];
if (oldtext !== sigtext) console.log('%s => %s', oldtext, sigtext);
}
}
}
>>>>>>> |
<<<<<<<
let from, orig_to;
if (Object.keys(word_replacement[i]).length > 0) {
from = word_replacement[i].tokens.from; // normalize expanded
orig_to = word_replacement[i].tokens.to;
=======
}
if (inverseOpts.custom) {
for (const token in inverseOpts.custom) {
tokens[token] = inverseOpts.custom[token];
isInverse[token] = true;
isCustom[token] = true;
>>>>>>>
let from, orig_to;
if (Object.keys(word_replacement[i]).length > 0) {
from = word_replacement[i].tokens.from; // normalize expanded
orig_to = word_replacement[i].tokens.to;
<<<<<<<
=======
entry.fromLastWord = complex ? false :
new RegExp(
'(' + WORD_BOUNDARY + '|^)' +
from.replace('.', '\\.') +
'(' + WORD_BOUNDARY + '*)$',
'i');
>>>>>>>
entry.fromLastWord = complex ? false :
new RegExp(
'(' + WORD_BOUNDARY + '|^)' +
from.replace('.', '\\.') +
'(' + WORD_BOUNDARY + '*)$',
'i'); |
<<<<<<<
freq = generateFrequency(docs, source.token_replacer, source.maxscore);
=======
freq = generateFrequency(docs, source.token_replacer, options.tokens);
>>>>>>>
freq = generateFrequency(docs, source.token_replacer, options.tokens, source.maxscore);
<<<<<<<
function generateFrequency(docs, replacer, maxScore) {
=======
function generateFrequency(docs, replacer, globalTokens) {
>>>>>>>
function generateFrequency(docs, replacer, globalTokens, maxScore) {
<<<<<<<
freq[1][0] = maxScore ? maxScore : Math.max(freq[1][0], docs[i].properties["carmen:score"] || 0);
var texts = termops.getIndexableText(replacer, docs[i]);
=======
freq[1][0] = Math.max(freq[1][0], docs[i].properties["carmen:score"] || 0);
var texts = termops.getIndexableText(replacer, globalTokens, docs[i]);
>>>>>>>
freq[1][0] = maxScore || Math.max(freq[1][0], docs[i].properties["carmen:score"] || 0);
var texts = termops.getIndexableText(replacer, globalTokens, docs[i]); |
<<<<<<<
=======
//Add Global Tokens to source token list
if (options.tokens) {
var tokens = Object.keys(options.tokens);
for (tokens_it = 0; tokens_it < tokens.length; tokens_it++) {
source.geocoder_tokens[tokens[tokens_it]] = options.tokens[tokens[tokens_it]];
}
}
if (TIMER) console.time('update:freq');
try {
var freq = generateFrequency(docs, source.token_replacer);
} catch (err) {
return callback(err);
}
if (TIMER) console.timeEnd('update:freq');
>>>>>>>
//Add Global Tokens to source token list
if (options.tokens) {
var tokens = Object.keys(options.tokens);
for (tokens_it = 0; tokens_it < tokens.length; tokens_it++) {
source.geocoder_tokens[tokens[tokens_it]] = options.tokens[tokens[tokens_it]];
}
} |
<<<<<<<
let feat;
let dist = Infinity;
let mapped;
let resultsSorted = false;
=======
var forwardMatchFeat;
var ghostMatchFeat;
var feat;
var dist = Infinity;
var mapped;
var resultsSorted = false;
>>>>>>>
let forwardMatchFeat;
let ghostMatchFeat;
let feat;
let dist = Infinity;
let mapped;
let resultsSorted = false; |
<<<<<<<
=======
var c_it, addr_it, feat;
>>>>>>>
let c_it, addr_it, feat;
<<<<<<<
for (let addr_it = 0; addr_it < docs[i].properties['carmen:addressnumber'][c_it].length; addr_it++) {
const feat = point(docs[i].geometry.geometries[c_it].coordinates[addr_it], feature.storableProperties(docs[i].properties, 'vector'));
=======
for (addr_it = 0; addr_it < docs[i].properties['carmen:addressnumber'][c_it].length; addr_it++) {
feat = point(docs[i].geometry.geometries[c_it].coordinates[addr_it], feature.storableProperties(docs[i].properties, 'vector'));
>>>>>>>
for (addr_it = 0; addr_it < docs[i].properties['carmen:addressnumber'][c_it].length; addr_it++) {
feat = point(docs[i].geometry.geometries[c_it].coordinates[addr_it], feature.storableProperties(docs[i].properties, 'vector'));
<<<<<<<
for (let addr_it = 0; addr_it < docs[i].geometry.geometries[c_it].coordinates.length; addr_it++) {
const feat = linestring(docs[i].geometry.geometries[c_it].coordinates[addr_it], feature.storableProperties(docs[i].properties, 'vector'));
=======
for (addr_it = 0; addr_it < docs[i].geometry.geometries[c_it].coordinates.length; addr_it++) {
feat = linestring(docs[i].geometry.geometries[c_it].coordinates[addr_it], feature.storableProperties(docs[i].properties, 'vector'));
>>>>>>>
for (addr_it = 0; addr_it < docs[i].geometry.geometries[c_it].coordinates.length; addr_it++) {
feat = linestring(docs[i].geometry.geometries[c_it].coordinates[addr_it], feature.storableProperties(docs[i].properties, 'vector'));
<<<<<<<
for (let err_it = 0; err_it < geojsonErr.length; err_it++) {
if (geojsonErr[err_it].level === 'message') {
// It's good practice to follow these warnings but required
=======
for (var err_it = 0; err_it < geojsonErr.length; err_it++) {
if (geojsonErr[err_it].level == 'message') {
//It's good practice to follow these warnings but required
>>>>>>>
for (let err_it = 0; err_it < geojsonErr.length; err_it++) {
if (geojsonErr[err_it].level === 'message') {
// It's good practice to follow these warnings but required
<<<<<<<
// Throw error for everything else except single geom GeometryCollection as we use these for pt/itp addresses
=======
>>>>>>>
<<<<<<<
} else if (doc.properties['carmen:geocoder_stack'] &&
typeof doc.properties['carmen:geocoder_stack'] !== 'string') {
=======
} else if (doc.properties["carmen:geocoder_stack"] && typeof doc.properties["carmen:geocoder_stack"] !== 'string') {
>>>>>>>
} else if (doc.properties['carmen:geocoder_stack'] && typeof doc.properties['carmen:geocoder_stack'] !== 'string') {
<<<<<<<
if (!doc.properties['carmen:center'] || !verifyCenter(doc.properties['carmen:center'], tiles)) {
=======
// if an outlier is detected in address numbers for example in [1,2,3,5000], 5000 is considered an outlier, then drop interpolation for it
if (doc.properties['carmen:addressnumber'] && doc.geometry.type === 'GeometryCollection') {
if (isOutlierDetected(doc.properties['carmen:addressnumber'])) {
console.warn('address cluster contains addressnumbers outside the threshold, drop interpolation for address cluster');
var interpolationProperties = ['carmen:lfromhn','carmen:ltohn', 'carmen:parityr', 'carmen:rfromhn','carmen:rtohn', 'carmen:parityl'];
//set interpolation properties values to null, for example: "carmen:parityr":[["O", "O" ,null ,null ,null], null] would become "carmen:parityr":[[null, null ,null ,null ,null], null]
interpolationProperties.forEach((p) => {
if (doc.properties[p]) {
for (var i = 0; i < doc.properties[p].length; i++) {
if (doc.properties[p][i] != null) {
doc.properties[p][i] = doc.properties[p][i].fill(null);
}
doc.properties[p][i] = doc.properties[p][i];
}
}
});
}
}
if (!doc.properties["carmen:center"] || !verifyCenter(doc.properties["carmen:center"], tiles)) {
>>>>>>>
// if an outlier is detected in address numbers for example in [1,2,3,5000], 5000 is considered an outlier, then drop interpolation for it
if (doc.properties['carmen:addressnumber'] && doc.geometry.type === 'GeometryCollection') {
if (isOutlierDetected(doc.properties['carmen:addressnumber'])) {
console.warn('address cluster contains addressnumbers outside the threshold, drop interpolation for address cluster');
const interpolationProperties = ['carmen:lfromhn','carmen:ltohn', 'carmen:parityr', 'carmen:rfromhn','carmen:rtohn', 'carmen:parityl'];
// set interpolation properties values to null, for example: "carmen:parityr":[["O", "O" ,null ,null ,null], null] would become "carmen:parityr":[[null, null ,null ,null ,null], null]
interpolationProperties.forEach((p) => {
if (doc.properties[p]) {
for (let i = 0; i < doc.properties[p].length; i++) {
if (doc.properties[p][i] != null) {
doc.properties[p][i] = doc.properties[p][i].fill(null);
}
doc.properties[p][i] = doc.properties[p][i];
}
}
});
}
}
if (!doc.properties['carmen:center'] || !verifyCenter(doc.properties['carmen:center'], tiles)) {
<<<<<<<
const texts = termops.getIndexableText(token_replacer, globalTokens, doc, source ? source.use_normalization_cache : false);
const allPhrases = new Map();
const variants = new Map();
let phrase, phraseObj, languages, y = new Map();
for (let x = 0; x < texts.length; x++) {
const phrases = termops.getIndexablePhrases(texts[x].tokens, freq);
=======
var texts = termops.getIndexableText(token_replacer, globalTokens, doc, source ? source.use_normalization_cache : false);
var allPhrases = new Map();
var phrase, phraseObj, languages, y, variants = new Map();
for (var x = 0; x < texts.length; x++) {
var phrases = termops.getIndexablePhrases(texts[x].tokens, freq);
>>>>>>>
const texts = termops.getIndexableText(token_replacer, globalTokens, doc, source ? source.use_normalization_cache : false);
const allPhrases = new Map();
let phrase, phraseObj, languages, y, variants = new Map(); // eslint-disable-line prefer-const
for (let x = 0; x < texts.length; x++) {
const phrases = termops.getIndexablePhrases(texts[x].tokens, freq);
<<<<<<<
if (!allPhrases.has(phrase)) allPhrases.set(phrase, { languages: new Set(), phrase: phrases[y] });
=======
if (!allPhrases.has(phrase)) allPhrases.set(phrase, {languages: new Set(), phrase: phrases[y]});
>>>>>>>
if (!allPhrases.has(phrase)) allPhrases.set(phrase, { languages: new Set(), phrase: phrases[y] });
<<<<<<<
for (const candidate of source.lang.fallback_matrix.get(lang)) {
=======
for (var candidate of source.lang.fallback_matrix.get(lang)) {
// at this point we know a language we're missing (lang)
// and the closest language to it that we do have (candidate)
// so iterate over each phrase of language candidate
// and make it also a phrase of lang
>>>>>>>
for (const candidate of source.lang.fallback_matrix.get(lang)) {
// at this point we know a language we're missing (lang)
// and the closest language to it that we do have (candidate)
// so iterate over each phrase of language candidate
// and make it also a phrase of lang
<<<<<<<
// at this point we know a language we're missing (lang)
// and the closest language to it that we do have (candidate)
// so iterate over each phrase of language candidate
// and make it also a phrase of lang
for (const item of phrasesByLanguage.get(candidate)) {
=======
for (var item of phrasesByLanguage.get(candidate)) {
>>>>>>>
for (const item of phrasesByLanguage.get(candidate)) {
<<<<<<<
l = xy.length;
=======
>>>>>>>
<<<<<<<
const texts = termops.getIndexableText(replacer, globalTokens, docs[i]);
for (let x = 0; x < texts.length; x++) {
const terms = termops.terms(texts[x].tokens);
for (let k = 0; k < terms.length; k++) {
const id = terms[k];
=======
var texts = termops.getIndexableText(replacer, globalTokens, docs[i]);
for (var x = 0; x < texts.length; x++) {
var terms = termops.terms(texts[x].tokens);
for (var k = 0; k < terms.length; k++) {
var id = terms[k];
>>>>>>>
const texts = termops.getIndexableText(replacer, globalTokens, docs[i]);
for (let x = 0; x < texts.length; x++) {
const terms = termops.terms(texts[x].tokens);
for (let k = 0; k < terms.length; k++) {
const id = terms[k]; |
<<<<<<<
function update(source, docs, callback) {
=======
function update(source, docs, zoom, callback) {
source._geocoder._known = source._geocoder._known || { term:{} };
var known = source._geocoder._known;
>>>>>>>
function update(source, docs, zoom, callback) {
<<<<<<<
indexdocs(docs, freq, source._geocoder.zoom, updateCache);
=======
indexDocs(freq[0], freq, zoom, callback);
>>>>>>>
indexdocs(docs, freq, zoom, updateCache);
<<<<<<<
function updateCache(err, patch) {
if (err) return callback(err);
=======
// Second pass over docs.
// - Create term => docid index. Uses calculated frequencies to index only
// significant terms for each document.
// - Create id => grid zxy index.
function indexDocs(approxdocs, freq, zoom, callback) {
var patch = { grid: {}, term: {}, phrase: {}, degen: {} };
var features = {};
try {
for (var i = 0; i < docs.length; i++) loadDoc(docs[i], freq, patch, known, zoom);
} catch(err) {
return callback(err);
}
>>>>>>>
function updateCache(err, patch) {
if (err) return callback(err);
<<<<<<<
feature.putFeatures(source, patch.docs, function(err) {
=======
if (reduce) {
var l = docs.length;
while (l--){
docs[l]._geometry = {
"type": "Point",
"coordinates": docs[l]._center
};
}
}
feature.putFeatures(source, docs, function(err) {
>>>>>>>
feature.putFeatures(source, patch.docs, function(err) {
<<<<<<<
=======
function loadDoc(doc, freq, patch, known, zoom) {
if (!doc._id) throw new Error('doc has no _id');
if (!doc._text) throw new Error('doc has no _text on _id:' + doc._id);
if (!doc._center) throw new Error('doc has no _center on _id:' + doc._id);
if(typeof zoom != 'number') throw new Error('index has no zoom');
if(zoom < 0) throw new Error('zoom must be greater than 0');
if(zoom > 14) throw new Error('zoom must be less than 15');
if (!doc._zxy || !doc._zxy.length) {
var tiles = cover.tiles(doc._geometry, {min_zoom: zoom, max_zoom: zoom});
doc._zxy = [];
tiles.forEach(function(tile){
doc._zxy.push(tile[2]+'/'+tile[0]+'/'+tile[1]);
});
}
if (!doc._zxy || doc._zxy < 1) throw new Error('doc failed spatial indexing');
doc._hash = termops.feature(doc._id.toString());
doc._grid = doc._grid || [];
if (doc._zxy) for (var i = 0; i < doc._zxy.length; i++) {
doc._grid.push(ops.zxy(doc._hash, doc._zxy[i]));
}
var texts = doc._text.split(',');
var termsets = [];
var termsmaps = [];
var tokensets = [];
for (var x = 0; x < texts.length; x++) {
var tokens = termops.tokenize(texts[x]);
if (!tokens.length) continue;
termsets.push(termops.termsWeighted(tokens, freq));
termsmaps.push(termops.termsMap(tokens));
tokensets.push(tokens);
}
for (var x = 0; x < termsets.length; x++) {
var terms = termsets[x];
var sigid = null;
var sigweight = 0;
var termsmap = termsmaps[x];
for (var i = 0; i < terms.length; i++) {
// Decode the term id, weight from weighted terms.
var id = terms[i] >>> 4 << 4 >>> 0;
var weight = terms[i] % 16;
if (weight > sigweight) {
sigid = id;
sigweight = weight;
}
// This check avoids doing redundant work for a term once
// it is known to be indexed. @TODO known issue, this prevents
// degens from being used as an approach to avoiding fnv1a term
// collisions.
if (known.term[id]) continue;
known.term[id] = true;
// Degenerate terms are indexed for all terms
// (not just significant ones).
var degens = termops.degens(termsmap[id]);
for (var j = 0; j < degens.length; j = j+2) {
var d = degens[j];
patch.degen[d] = patch.degen[d] || [];
patch.degen[d].push(degens[j+1]);
}
}
// Generate phrase, clustered by most significant term.
var phrase = termops.phrase(tokensets[x], termsmap[sigid]);
patch.phrase[phrase] = patch.phrase[phrase] || terms;
patch.term[sigid] = patch.term[sigid] || [];
patch.term[sigid].push(phrase);
patch.grid[phrase] = patch.grid[phrase] || [];
patch.grid[phrase].push.apply(patch.grid[phrase], doc._grid);
// Debug significant term selection.
if (DEBUG) {
var debug = termsmap;
var oldtext = terms.map(function(id) {
id = id >>> 4 << 4 >>> 0;
return debug[id];
}).join(' ');
var sigtext = debug[sigid];
if (oldtext !== sigtext) console.log('%s => %s', oldtext, sigtext);
}
}
}
>>>>>>> |
<<<<<<<
var addressOrder = context[0].properties['carmen:addressOrder'];
=======
var spatialmatch = context[0].properties['carmen:spatialmatch'];
>>>>>>>
var addressOrder = context[0].properties['carmen:addressOrder'];
var spatialmatch = context[0].properties['carmen:spatialmatch']; |
<<<<<<<
if (options.language) {
Object.keys(index).forEach(function(key) {
if (/^geocoder_format_/.exec(key)) {
formats[key.substr(16)] = index[key];
}
})
}
queryData.features.push(ops.toFeature(context, formats, options.language));
=======
if (options.language) formats[options.language] = index['geocoder_format_' + options.language];
queryData.features.push(ops.toFeature(context, formats, options.language, options.debug));
>>>>>>>
if (options.language) {
Object.keys(index).forEach(function(key) {
if (/^geocoder_format_/.exec(key)) {
formats[key.substr(16)] = index[key];
}
})
}
queryData.features.push(ops.toFeature(context, formats, options.language, options.debug));
<<<<<<<
if (options.language) {
Object.keys(index).forEach(function(key) {
if (/^geocoder_format_/.exec(key)) {
formats[key.substr(16)] = index[key];
}
})
}
var feature = ops.toFeature(contexts[i], formats, options.language);
=======
if (options.language) formats[options.language] = index['geocoder_format_' + options.language];
var feature = ops.toFeature(contexts[i], formats, options.language, options.debug);
>>>>>>>
if (options.language) {
Object.keys(index).forEach(function(key) {
if (/^geocoder_format_/.exec(key)) {
formats[key.substr(16)] = index[key];
}
})
}
var feature = ops.toFeature(contexts[i], formats, options.language, options.debug); |
<<<<<<<
getTokens(texts);
var keys = Object.keys(doc);
for (var i = 0; i < keys.length; i ++) {
if (/_text_\w+/.test(keys[i])) getTokens(doc[keys[i]].split(','));
}
function getTokens(texts) {
for (var x = 0; x < texts.length; x++) {
// push tokens with replacements
var tokens = tokenize(token.replaceToken(replacer, texts[x]));
if (!tokens.length) continue;
// push tokens with housenum range token if applicable
var range = getHousenumRange(doc);
if (range) {
var l = range.length;
while (l--) {
add([range[l]].concat(tokens));
add(tokens.concat([range[l]]));
}
} else {
add(tokens);
}
=======
for (var x = 0; x < texts.length; x++) {
// push tokens with replacements
var tokens = tokenize(token.replaceToken(replacer, texts[x]));
if (!tokens.length) continue;
// push tokens with housenum range token if applicable
var range = getHousenumRangeV3(doc);
if (range) {
var l = range.length;
while (l--) add([range[l]].concat(tokens));
} else {
add(tokens);
>>>>>>>
getTokens(texts);
var keys = Object.keys(doc);
for (var i = 0; i < keys.length; i ++) {
if (/_text_\w+/.test(keys[i])) getTokens(doc[keys[i]].split(','));
}
function getTokens(texts) {
for (var x = 0; x < texts.length; x++) {
// push tokens with replacements
var tokens = tokenize(token.replaceToken(replacer, texts[x]));
if (!tokens.length) continue;
// push tokens with housenum range token if applicable
var range = getHousenumRangeV3(doc);
if (range) {
var l = range.length;
while (l--) add([range[l]].concat(tokens));
} else {
add(tokens);
} |
<<<<<<<
new PhrasematchResult([a1], { idx: 0, bmask: {}, ndx: 0 }),
new PhrasematchResult([b1, b2], { idx: 1, bmask: {}, ndx: 1 })
]).map(function(stack) {
=======
new PhrasematchResult([a1], null, null, { idx: 0, bmask: {}, ndx: 0 }),
new PhrasematchResult([b1, b2], null, null, { idx: 1, bmask: {}, ndx: 1 })
]);
debug.forEach(function(stack) { stack.sort(sortByZoomIdx); });
debug.sort(sortByRelevLengthIdx);
debug = debug.map(function(stack) {
>>>>>>>
new PhrasematchResult([a1], { idx: 0, bmask: {}, ndx: 0 }),
new PhrasematchResult([b1, b2], { idx: 1, bmask: {}, ndx: 1 })
]);
debug.forEach(function(stack) { stack.sort(sortByZoomIdx); });
debug.sort(sortByRelevLengthIdx);
debug = debug.map(function(stack) {
<<<<<<<
new PhrasematchResult([a1], { idx: 0, bmask: {}, ndx: 0 }),
new PhrasematchResult([b1], { idx: 1, bmask: {}, ndx: 1 }),
new PhrasematchResult([c1], { idx: 2, bmask: {}, ndx: 1 })
]).map(function(stack) {
return stack.map(function(s) { return s.subquery.join(' ')});
=======
new PhrasematchResult([a1], null, null, { idx: 0, bmask: {}, ndx: 0 }),
new PhrasematchResult([b1], null, null, { idx: 1, bmask: {}, ndx: 1 }),
new PhrasematchResult([c1], null, null, { idx: 2, bmask: {}, ndx: 1 })
]);
debug.forEach(function(stack) { stack.sort(sortByZoomIdx); });
debug.sort(sortByRelevLengthIdx);
debug = debug.map(function(stack) {
return stack.map(function(s) { return s.subquery.join(' '); });
>>>>>>>
new PhrasematchResult([a1], { idx: 0, bmask: {}, ndx: 0 }),
new PhrasematchResult([b1], { idx: 1, bmask: {}, ndx: 1 }),
new PhrasematchResult([c1], { idx: 2, bmask: {}, ndx: 1 })
]);
debug.forEach(function(stack) { stack.sort(sortByZoomIdx); });
debug.sort(sortByRelevLengthIdx);
debug = debug.map(function(stack) {
return stack.map(function(s) { return s.subquery.join(' '); });
<<<<<<<
new PhrasematchResult([a1], { idx: 0, bmask: [0, 1], ndx: 0 }),
new PhrasematchResult([b1], { idx: 1, bmask: [1, 0], ndx: 1 })
]).map(function(stack) {
=======
new PhrasematchResult([a1], null, null, { idx: 0, bmask: [0, 1], ndx: 0 }),
new PhrasematchResult([b1], null, null, { idx: 1, bmask: [1, 0], ndx: 1 })
]);
debug.forEach(function(stack) { stack.sort(sortByZoomIdx); });
debug.sort(sortByRelevLengthIdx);
debug = debug.map(function(stack) {
>>>>>>>
new PhrasematchResult([a1], { idx: 0, bmask: [0, 1], ndx: 0 }),
new PhrasematchResult([b1], { idx: 1, bmask: [1, 0], ndx: 1 })
]);
debug.forEach(function(stack) { stack.sort(sortByZoomIdx); });
debug.sort(sortByRelevLengthIdx);
debug = debug.map(function(stack) {
<<<<<<<
new PhrasematchResult([a1, a2], { idx: 0, bmask: [], ndx: 0 }),
new PhrasematchResult([b1, b2], { idx: 1, bmask: [], ndx: 1 }),
new PhrasematchResult([c1, c2], { idx: 1, bmask: [], ndx: 2 }),
]).map(function(stack) {
=======
new PhrasematchResult([a1, a2], null, null, { idx: 0, bmask: [], ndx: 0 }),
new PhrasematchResult([b1, b2], null, null, { idx: 1, bmask: [], ndx: 1 }),
new PhrasematchResult([c1, c2], null, null, { idx: 1, bmask: [], ndx: 2 }),
]);
debug.forEach(function(stack) { stack.sort(sortByZoomIdx); });
debug.sort(sortByRelevLengthIdx);
debug = debug.map(function(stack) {
>>>>>>>
new PhrasematchResult([a1, a2], { idx: 0, bmask: [], ndx: 0 }),
new PhrasematchResult([b1, b2], { idx: 1, bmask: [], ndx: 1 }),
new PhrasematchResult([c1, c2], { idx: 1, bmask: [], ndx: 2 }),
]);
debug.forEach(function(stack) { stack.sort(sortByZoomIdx); });
debug.sort(sortByRelevLengthIdx);
debug = debug.map(function(stack) {
<<<<<<<
new PhrasematchResult([a1, a2], { idx: 0, bmask: [], ndx: 0 }),
new PhrasematchResult([b1, b2], { idx: 1, bmask: [], ndx: 1 }),
new PhrasematchResult([c1, c2], { idx: 2, bmask: [], ndx: 2 }),
new PhrasematchResult([d1, d2], { idx: 3, bmask: [], ndx: 3 }),
]).map(function(stack) {
=======
new PhrasematchResult([a1, a2], null, null, { idx: 0, bmask: [], ndx: 0 }),
new PhrasematchResult([b1, b2], null, null, { idx: 1, bmask: [], ndx: 1 }),
new PhrasematchResult([c1, c2], null, null, { idx: 2, bmask: [], ndx: 2 }),
new PhrasematchResult([d1, d2], null, null, { idx: 3, bmask: [], ndx: 3 }),
]);
debug.forEach(function(stack) { stack.sort(sortByZoomIdx); });
debug.sort(sortByRelevLengthIdx);
debug = debug.map(function(stack) {
>>>>>>>
new PhrasematchResult([a1, a2], { idx: 0, bmask: [], ndx: 0 }),
new PhrasematchResult([b1, b2], { idx: 1, bmask: [], ndx: 1 }),
new PhrasematchResult([c1, c2], { idx: 2, bmask: [], ndx: 2 }),
new PhrasematchResult([d1, d2], { idx: 3, bmask: [], ndx: 3 }),
]);
debug.forEach(function(stack) { stack.sort(sortByZoomIdx); });
debug.sort(sortByRelevLengthIdx);
debug = debug.map(function(stack) { |
<<<<<<<
var obj = {
degen: tokens.indexDegens,
relev: perms[i].relev,
text: encodableText(perms[i].join(' ')),
phrase: encodePhrase(perms[i].join(' '))
};
=======
var toEncode = [];
var etext = encodableText(text);
toEncode.push({
degen: false,
relev: relev,
text: etext,
phrase: encodePhraseText(etext, false)
});
// Encode degens of phrase.
// Pre-unidecoded text is used to handle CJK degens properly.
if (tokens.indexDegens) {
var degens = getPhraseDegens(text);
l = degens.length;
while (l--) {
var egtext = encodableText(degens[l]);
toEncode.push({
degen: true,
relev: relev,
text: egtext,
phrase: encodePhraseText(egtext, true)
});
}
// Enclude degen=true version of the canonical phrase.
} else {
toEncode.push({
degen: true,
relev: relev,
text: etext,
phrase: encodePhraseText(etext, true)
});
}
l = toEncode.length;
while (l--) {
var obj = toEncode[l];
>>>>>>>
var obj = {
degen: tokens.indexDegens,
relev: relev,
text: etext,
phrase: encodePhraseText(etext, false)
}; |
<<<<<<<
var spatialmatch = context[0].properties['carmen:spatialmatch'];
var addressOrder = context[0].properties['carmen:addressOrder'];
=======
>>>>>>>
var addressOrder = context[0].properties['carmen:addressOrder']; |
<<<<<<<
split = require('split'),
TIMER = process.env.TIMER
=======
TIMER = process.env.TIMER,
DEBUG = process.env.DEBUG;
>>>>>>>
split = require('split'),
TIMER = process.env.TIMER
<<<<<<<
//Output geometries to vectorize
if (options.output) {
for (var docs_it = 0; docs_it < patch.vectors.length; docs_it++) {
options.output.write(JSON.stringify(patch.vectors[docs_it]));
}
}
=======
>>>>>>>
//Output geometries to vectorize
if (options.output) {
for (var docs_it = 0; docs_it < patch.vectors.length; docs_it++) {
options.output.write(JSON.stringify(patch.vectors[docs_it]));
}
} |
<<<<<<<
var serveMp4 = require('../utils/serve-mp4');
=======
var fs = require('fs');
var isFile = function(item) {
return fs.existsSync(item.path) && fs.statSync(item.path).isFile();
};
>>>>>>>
var serveMp4 = require('../utils/serve-mp4');
var fs = require('fs');
var isFile = function(item) {
return fs.existsSync(item.path) && fs.statSync(item.path).isFile();
};
<<<<<<<
ctx.options.path = 'http://' + internalIp() + ':' + port;
ctx.options.type = 'video/mp4';
ctx.options.media = {
metadata: {
title: path.basename(filePath)
}
};
http.createServer(function(req, res) {
serveMp4(req, res, filePath);
}).listen(port);
=======
var route = router();
var list = ctx.options.playlist.slice(0);
ctx.options.playlist = list.map(function(item, idx) {
if (!isFile(item)) return item;
return {
path: 'http://' + internalIp() + ':' + port + '/' + idx,
type: 'video/mp4',
media: {
metadata: {
title: path.basename(item.path)
}
}
};
});
route.all('/{idx}', function(req, res) {
res.writeHead(200, {
'Access-Control-Allow-Origin': '*'
});
fs.createReadStream(list[req.params.idx].path).pipe(res);
});
http.createServer(route).listen(port);
>>>>>>>
var route = router();
var list = ctx.options.playlist.slice(0);
ctx.options.playlist = list.map(function(item, idx) {
if (!isFile(item)) return item;
return {
path: 'http://' + internalIp() + ':' + port + '/' + idx,
type: 'video/mp4',
media: {
metadata: {
title: path.basename(item.path)
}
}
};
});
route.all('/{idx}', function(req, res) {
serveMp4(req, res, list[req.params.idx].path);
});
http.createServer(route).listen(port); |
<<<<<<<
import frFlag from '../assets/flags/fr.png';
=======
import thFlag from '../assets/flags/th.png';
>>>>>>>
import frFlag from '../assets/flags/fr.png';
import thFlag from '../assets/flags/th.png';
<<<<<<<
import fr from '../locales/fr.json';
=======
import th from '../locales/th.json';
>>>>>>>
import fr from '../locales/fr.json';
import th from '../locales/th.json';
<<<<<<<
fr,
=======
th,
>>>>>>>
fr,
th,
<<<<<<<
{
code: 'fr',
name: 'Français',
title: 'Suivi du COVID-19',
description: `Aidez l'Équipe de la Protection Civile à suivre les infections potentielles au COVID-19 en Islande`,
button: 'Continuer en français',
flag: frFlag,
},
=======
{
code: 'th',
name: 'ภาษาไทย',
title: 'ติดตาม COVID-19',
description: 'ช่วยเหลือทีมติดตามของกรมพลเรือนและเหตุฉุกเฉินในการติดตาม COVID-19 ในประเทศไอซ์แลนด์i',
button: 'ดูต่อในภาษาไทย',
flag: thFlag,
},
>>>>>>>
{
code: 'fr',
name: 'Français',
title: 'Suivi du COVID-19',
description: `Aidez l'Équipe de la Protection Civile à suivre les infections potentielles au COVID-19 en Islande`,
button: 'Continuer en français',
flag: frFlag,
},
{
code: 'th',
name: 'ภาษาไทย',
title: 'ติดตาม COVID-19',
description: 'ช่วยเหลือทีมติดตามของกรมพลเรือนและเหตุฉุกเฉินในการติดตาม COVID-19 ในประเทศไอซ์แลนด์i',
button: 'ดูต่อในภาษาไทย',
flag: thFlag,
}, |
<<<<<<<
import Footer from '../../../components/Footer';
=======
import LoadingScreen from '../../../components/LoadingScreen';
>>>>>>>
import Footer from '../../../components/Footer';
import LoadingScreen from '../../../components/LoadingScreen'; |
<<<<<<<
relativePath === path.join('..', 'exports', 'atom.js') ||
relativePath === path.join('..', 'src', 'electron-shims.js') ||
relativePath === path.join('..', 'src', 'safe-clipboard.js') ||
relativePath === path.join('..', 'node_modules', 'atom-keymap', 'lib', 'command-event.js') ||
relativePath === path.join('..', 'node_modules', 'babel-core', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'cached-run-in-this-context', 'lib', 'main.js') ||
relativePath === path.join('..', 'node_modules', 'coffee-script', 'lib', 'coffee-script', 'register.js') ||
relativePath === path.join('..', 'node_modules', 'cson-parser', 'node_modules', 'coffee-script', 'lib', 'coffee-script', 'register.js') ||
relativePath === path.join('..', 'node_modules', 'decompress-zip', 'lib', 'decompress-zip.js') ||
relativePath === path.join('..', 'node_modules', 'debug', 'node.js') ||
relativePath === path.join('..', 'node_modules', 'git-utils', 'lib', 'git.js') ||
relativePath === path.join('..', 'node_modules', 'glob', 'glob.js') ||
relativePath === path.join('..', 'node_modules', 'graceful-fs', 'graceful-fs.js') ||
relativePath === path.join('..', 'node_modules', 'htmlparser2', 'lib', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'iconv-lite', 'encodings', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'less', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'less', 'lib', 'less', 'fs.js') ||
relativePath === path.join('..', 'node_modules', 'less', 'lib', 'less-node', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'less', 'node_modules', 'graceful-fs', 'graceful-fs.js') ||
relativePath === path.join('..', 'node_modules', 'superstring', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'oniguruma', 'lib', 'oniguruma.js') ||
relativePath === path.join('..', 'node_modules', 'request', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'resolve', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'resolve', 'lib', 'core.js') ||
relativePath === path.join('..', 'node_modules', 'settings-view', 'node_modules', 'glob', 'glob.js') ||
relativePath === path.join('..', 'node_modules', 'spellchecker', 'lib', 'spellchecker.js') ||
relativePath === path.join('..', 'node_modules', 'spelling-manager', 'node_modules', 'natural', 'lib', 'natural', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'tar', 'tar.js') ||
relativePath === path.join('..', 'node_modules', 'temp', 'lib', 'temp.js') ||
relativePath === path.join('..', 'node_modules', 'tmp', 'lib', 'tmp.js')
=======
relativePath == path.join('..', 'exports', 'atom.js') ||
relativePath == path.join('..', 'src', 'electron-shims.js') ||
relativePath == path.join('..', 'src', 'safe-clipboard.js') ||
relativePath == path.join('..', 'node_modules', 'atom-keymap', 'lib', 'command-event.js') ||
relativePath == path.join('..', 'node_modules', 'babel-core', 'index.js') ||
relativePath == path.join('..', 'node_modules', 'cached-run-in-this-context', 'lib', 'main.js') ||
relativePath == path.join('..', 'node_modules', 'coffee-script', 'lib', 'coffee-script', 'register.js') ||
relativePath == path.join('..', 'node_modules', 'cson-parser', 'node_modules', 'coffee-script', 'lib', 'coffee-script', 'register.js') ||
relativePath == path.join('..', 'node_modules', 'decompress-zip', 'lib', 'decompress-zip.js') ||
relativePath == path.join('..', 'node_modules', 'debug', 'node.js') ||
relativePath == path.join('..', 'node_modules', 'git-utils', 'lib', 'git.js') ||
relativePath == path.join('..', 'node_modules', 'glob', 'glob.js') ||
relativePath == path.join('..', 'node_modules', 'graceful-fs', 'graceful-fs.js') ||
relativePath == path.join('..', 'node_modules', 'htmlparser2', 'lib', 'index.js') ||
relativePath == path.join('..', 'node_modules', 'iconv-lite', 'encodings', 'index.js') ||
relativePath == path.join('..', 'node_modules', 'less', 'index.js') ||
relativePath == path.join('..', 'node_modules', 'less', 'lib', 'less', 'fs.js') ||
relativePath == path.join('..', 'node_modules', 'less', 'lib', 'less-node', 'index.js') ||
relativePath == path.join('..', 'node_modules', 'less', 'node_modules', 'graceful-fs', 'graceful-fs.js') ||
relativePath == path.join('..', 'node_modules', 'minimatch', 'minimatch.js') ||
relativePath == path.join('..', 'node_modules', 'superstring', 'index.js') ||
relativePath == path.join('..', 'node_modules', 'oniguruma', 'lib', 'oniguruma.js') ||
relativePath == path.join('..', 'node_modules', 'request', 'index.js') ||
relativePath == path.join('..', 'node_modules', 'resolve', 'index.js') ||
relativePath == path.join('..', 'node_modules', 'resolve', 'lib', 'core.js') ||
relativePath == path.join('..', 'node_modules', 'scandal', 'node_modules', 'minimatch', 'minimatch.js') ||
relativePath == path.join('..', 'node_modules', 'settings-view', 'node_modules', 'glob', 'glob.js') ||
relativePath == path.join('..', 'node_modules', 'settings-view', 'node_modules', 'minimatch', 'minimatch.js') ||
relativePath == path.join('..', 'node_modules', 'spellchecker', 'lib', 'spellchecker.js') ||
relativePath == path.join('..', 'node_modules', 'spelling-manager', 'node_modules', 'natural', 'lib', 'natural', 'index.js') ||
relativePath == path.join('..', 'node_modules', 'tar', 'tar.js') ||
relativePath == path.join('..', 'node_modules', 'temp', 'lib', 'temp.js') ||
relativePath == path.join('..', 'node_modules', 'tmp', 'lib', 'tmp.js') ||
relativePath == path.join('..', 'node_modules', 'tree-view', 'node_modules', 'minimatch', 'minimatch.js')
>>>>>>>
relativePath === path.join('..', 'exports', 'atom.js') ||
relativePath === path.join('..', 'src', 'electron-shims.js') ||
relativePath === path.join('..', 'src', 'safe-clipboard.js') ||
relativePath === path.join('..', 'node_modules', 'atom-keymap', 'lib', 'command-event.js') ||
relativePath === path.join('..', 'node_modules', 'babel-core', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'cached-run-in-this-context', 'lib', 'main.js') ||
relativePath === path.join('..', 'node_modules', 'coffee-script', 'lib', 'coffee-script', 'register.js') ||
relativePath === path.join('..', 'node_modules', 'cson-parser', 'node_modules', 'coffee-script', 'lib', 'coffee-script', 'register.js') ||
relativePath === path.join('..', 'node_modules', 'decompress-zip', 'lib', 'decompress-zip.js') ||
relativePath === path.join('..', 'node_modules', 'debug', 'node.js') ||
relativePath === path.join('..', 'node_modules', 'git-utils', 'lib', 'git.js') ||
relativePath === path.join('..', 'node_modules', 'glob', 'glob.js') ||
relativePath === path.join('..', 'node_modules', 'graceful-fs', 'graceful-fs.js') ||
relativePath === path.join('..', 'node_modules', 'htmlparser2', 'lib', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'iconv-lite', 'encodings', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'less', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'less', 'lib', 'less', 'fs.js') ||
relativePath === path.join('..', 'node_modules', 'less', 'lib', 'less-node', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'less', 'node_modules', 'graceful-fs', 'graceful-fs.js') ||
relativePath === path.join('..', 'node_modules', 'minimatch', 'minimatch.js') ||
relativePath === path.join('..', 'node_modules', 'superstring', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'oniguruma', 'lib', 'oniguruma.js') ||
relativePath === path.join('..', 'node_modules', 'request', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'resolve', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'resolve', 'lib', 'core.js') ||
relativePath === path.join('..', 'node_modules', 'scandal', 'node_modules', 'minimatch', 'minimatch.js') ||
relativePath === path.join('..', 'node_modules', 'settings-view', 'node_modules', 'glob', 'glob.js') ||
relativePath === path.join('..', 'node_modules', 'settings-view', 'node_modules', 'minimatch', 'minimatch.js') ||
relativePath === path.join('..', 'node_modules', 'spellchecker', 'lib', 'spellchecker.js') ||
relativePath === path.join('..', 'node_modules', 'spelling-manager', 'node_modules', 'natural', 'lib', 'natural', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'tar', 'tar.js') ||
relativePath === path.join('..', 'node_modules', 'temp', 'lib', 'temp.js') ||
relativePath === path.join('..', 'node_modules', 'tmp', 'lib', 'tmp.js') ||
relativePath === path.join('..', 'node_modules', 'tree-view', 'node_modules', 'minimatch', 'minimatch.js') |
<<<<<<<
let appPath = `\"${process.execPath}\"`
let fileIconPath = `\"${Path.join(process.execPath, '..', 'resources', 'cli', 'file.ico')}\"`
=======
let appPath = `"${process.execPath}"`
let fileIconPath = `"${Path.join(process.execPath, '..', 'resources', 'cli', 'file.ico')}"`
let isBeta = appPath.includes(' Beta')
let appName = exeName.replace('atom', isBeta ? 'Atom Beta' : 'Atom').replace('.exe', '')
>>>>>>>
let appPath = `"${process.execPath}"`
let fileIconPath = `"${Path.join(process.execPath, '..', 'resources', 'cli', 'file.ico')}"`
<<<<<<<
function getShellOptions (appName) {
const contextParts = [
{key: 'command', name: '', value: `${appPath} \"%1\"`},
{name: '', value: `Open with ${appName}`},
{name: 'Icon', value: `${appPath}`}
=======
exports.appName = appName
exports.fileHandler = new ShellOption(`\\Software\\Classes\\Applications\\${exeName}`,
[
{key: 'shell\\open\\command', name: '', value: `${appPath} "%1"`},
{key: 'shell\\open', name: 'FriendlyAppName', value: `${appName}`},
{key: 'DefaultIcon', name: '', value: `${fileIconPath}`}
>>>>>>>
function getShellOptions (appName) {
const contextParts = [
{key: 'command', name: '', value: `${appPath} "%1"`},
{name: '', value: `Open with ${appName}`},
{name: 'Icon', value: `${appPath}`}
<<<<<<<
return {
fileHandler: new ShellOption(`\\Software\\Classes\\Applications\\${exeName}`,
[
{key: 'shell\\open\\command', name: '', value: `${appPath} \"%1\"`},
{key: 'shell\\open', name: 'FriendlyAppName', value: `${appName}`},
{key: 'DefaultIcon', name: '', value: `${fileIconPath}`}
]
),
fileContextMenu: new ShellOption(`\\Software\\Classes\\*\\shell\\${appName}`, contextParts),
folderContextMenu: new ShellOption(`\\Software\\Classes\\Directory\\shell\\${appName}`, contextParts),
folderBackgroundContextMenu: new ShellOption(`\\Software\\Classes\\Directory\\background\\shell\\${appName}`,
JSON.parse(JSON.stringify(contextParts).replace('%1', '%V'))
)
}
}
function registerShellIntegration (appName, callback) {
const shellOptions = getShellOptions(appName)
shellOptions.fileHandler.register(() =>
shellOptions.fileContextMenu.update(() =>
shellOptions.folderContextMenu.update(() =>
shellOptions.folderBackgroundContextMenu.update(() => callback())
)
)
)
}
function updateShellIntegration (appName, callback) {
const shellOptions = getShellOptions(appName)
shellOptions.fileHandler.update(() =>
shellOptions.fileContextMenu.update(() =>
shellOptions.folderContextMenu.update(() =>
shellOptions.folderBackgroundContextMenu.update(() => callback())
)
)
)
}
function deregisterShellIntegration (appName, callback) {
const shellOptions = getShellOptions(appName)
shellOptions.fileHandler.deregister(() =>
shellOptions.fileContextMenu.deregister(() =>
shellOptions.folderContextMenu.deregister(() =>
shellOptions.folderBackgroundContextMenu.deregister(() => callback())
)
)
)
}
=======
let contextParts = [
{key: 'command', name: '', value: `${appPath} "%1"`},
{name: '', value: `Open with ${appName}`},
{name: 'Icon', value: `${appPath}`}
]
>>>>>>>
return {
fileHandler: new ShellOption(`\\Software\\Classes\\Applications\\${exeName}`,
[
{key: 'shell\\open\\command', name: '', value: `${appPath} "%1"`},
{key: 'shell\\open', name: 'FriendlyAppName', value: `${appName}`},
{key: 'DefaultIcon', name: '', value: `${fileIconPath}`}
]
),
fileContextMenu: new ShellOption(`\\Software\\Classes\\*\\shell\\${appName}`, contextParts),
folderContextMenu: new ShellOption(`\\Software\\Classes\\Directory\\shell\\${appName}`, contextParts),
folderBackgroundContextMenu: new ShellOption(`\\Software\\Classes\\Directory\\background\\shell\\${appName}`,
JSON.parse(JSON.stringify(contextParts).replace('%1', '%V'))
)
}
}
function registerShellIntegration (appName, callback) {
const shellOptions = getShellOptions(appName)
shellOptions.fileHandler.register(() =>
shellOptions.fileContextMenu.update(() =>
shellOptions.folderContextMenu.update(() =>
shellOptions.folderBackgroundContextMenu.update(() => callback())
)
)
)
}
function updateShellIntegration (appName, callback) {
const shellOptions = getShellOptions(appName)
shellOptions.fileHandler.update(() =>
shellOptions.fileContextMenu.update(() =>
shellOptions.folderContextMenu.update(() =>
shellOptions.folderBackgroundContextMenu.update(() => callback())
)
)
)
}
function deregisterShellIntegration (appName, callback) {
const shellOptions = getShellOptions(appName)
shellOptions.fileHandler.deregister(() =>
shellOptions.fileContextMenu.deregister(() =>
shellOptions.folderContextMenu.deregister(() =>
shellOptions.folderBackgroundContextMenu.deregister(() => callback())
)
)
)
} |
<<<<<<<
appBundleId: 'com.github.atom',
appCopyright: `Copyright © 2014-${(new Date()).getFullYear()} GitHub, Inc. All rights reserved.`,
appVersion: CONFIG.appMetadata.version,
arch: process.platform === 'darwin' ? 'x64' : HOST_ARCH, // OS X is 64-bit only
asar: {unpack: buildAsarUnpackGlobExpression()},
buildVersion: CONFIG.appMetadata.version,
download: {cache: CONFIG.electronDownloadPath},
dir: CONFIG.intermediateAppPath,
electronVersion: CONFIG.appMetadata.electronVersion,
extendInfo: path.join(CONFIG.repositoryRootPath, 'resources', 'mac', 'atom-Info.plist'),
helperBundleId: 'com.github.atom.helper',
icon: path.join(CONFIG.repositoryRootPath, 'resources', 'app-icons', CONFIG.channel, 'atom'),
name: appName,
out: CONFIG.buildOutputPath,
overwrite: true,
platform: process.platform,
// Atom doesn't have devDependencies, but if prune is true, it will delete the non-standard packageDependencies.
prune: false,
win32metadata: {
CompanyName: 'GitHub, Inc.',
FileDescription: 'Atom',
ProductName: 'Atom'
=======
'appBundleId': 'com.github.atom',
'appCopyright': `Copyright © 2014-${(new Date()).getFullYear()} GitHub, Inc. All rights reserved.`,
'appVersion': CONFIG.appMetadata.version,
'arch': process.platform === 'darwin' ? 'x64' : process.arch, // OS X is 64-bit only
'asar': {unpack: buildAsarUnpackGlobExpression()},
'buildVersion': CONFIG.appMetadata.version,
'download': {cache: CONFIG.electronDownloadPath},
'dir': CONFIG.intermediateAppPath,
'extendInfo': path.join(CONFIG.repositoryRootPath, 'resources', 'mac', 'atom-Info.plist'),
'helperBundleId': 'com.github.atom.helper',
'icon': getIcon(),
'name': appName,
'out': CONFIG.buildOutputPath,
'overwrite': true,
'derefSymlinks': false,
'platform': process.platform,
'electronVersion': CONFIG.appMetadata.electronVersion,
'win32metadata': {
'CompanyName': 'GitHub, Inc.',
'FileDescription': 'Atom',
'ProductName': 'Atom'
>>>>>>>
appBundleId: 'com.github.atom',
appCopyright: `Copyright © 2014-${(new Date()).getFullYear()} GitHub, Inc. All rights reserved.`,
appVersion: CONFIG.appMetadata.version,
arch: process.platform === 'darwin' ? 'x64' : HOST_ARCH, // OS X is 64-bit only
asar: {unpack: buildAsarUnpackGlobExpression()},
buildVersion: CONFIG.appMetadata.version,
derefSymlinks: false,
download: {cache: CONFIG.electronDownloadPath},
dir: CONFIG.intermediateAppPath,
electronVersion: CONFIG.appMetadata.electronVersion,
extendInfo: path.join(CONFIG.repositoryRootPath, 'resources', 'mac', 'atom-Info.plist'),
helperBundleId: 'com.github.atom.helper',
icon: path.join(CONFIG.repositoryRootPath, 'resources', 'app-icons', CONFIG.channel, 'atom'),
name: appName,
out: CONFIG.buildOutputPath,
overwrite: true,
platform: process.platform,
// Atom doesn't have devDependencies, but if prune is true, it will delete the non-standard packageDependencies.
prune: false,
win32metadata: {
CompanyName: 'GitHub, Inc.',
FileDescription: 'Atom',
ProductName: 'Atom'
<<<<<<<
function runPackager (options) {
return electronPackager(options)
.then(packageOutputDirPaths => {
assert(packageOutputDirPaths.length === 1, 'Generated more than one electron application!')
return renamePackagedAppDir(packageOutputDirPaths[0])
})
=======
function getIcon () {
switch (process.platform) {
case 'darwin':
return path.join(CONFIG.repositoryRootPath, 'resources', 'app-icons', CONFIG.channel, 'atom.icns')
case 'linux':
// Don't pass an icon, as the dock/window list icon is set via the icon
// option in the BrowserWindow constructor in atom-window.coffee.
return null
default:
return path.join(CONFIG.repositoryRootPath, 'resources', 'app-icons', CONFIG.channel, 'atom.ico')
}
}
async function runPackager (options) {
const packageOutputDirPaths = await electronPackager(options)
assert(packageOutputDirPaths.length === 1, 'Generated more than one electron application!')
return renamePackagedAppDir(packageOutputDirPaths[0])
>>>>>>>
async function runPackager (options) {
const packageOutputDirPaths = await electronPackager(options)
assert(packageOutputDirPaths.length === 1, 'Generated more than one electron application!')
return renamePackagedAppDir(packageOutputDirPaths[0])
<<<<<<<
const appName = CONFIG.channel === 'beta' ? 'Atom Beta' : 'Atom'
packagedAppPath = path.join(CONFIG.buildOutputPath, appName)
if (process.platform === 'win32' && HOST_ARCH !== 'ia32') {
packagedAppPath += ` ${HOST_ARCH}`
=======
packagedAppPath = path.join(CONFIG.buildOutputPath, CONFIG.appName)
if (process.platform === 'win32' && process.arch !== 'ia32') {
packagedAppPath += ` ${process.arch}`
>>>>>>>
packagedAppPath = path.join(CONFIG.buildOutputPath, CONFIG.appName)
if (process.platform === 'win32' && HOST_ARCH !== 'ia32') {
packagedAppPath += ` ${process.arch}` |
<<<<<<<
modulePath.endsWith('.node') ||
coreModules.has(modulePath) ||
(relativePath.startsWith(path.join('..', 'src')) && relativePath.endsWith('-element.js')) ||
relativePath.startsWith(path.join('..', 'node_modules', 'dugite')) ||
relativePath.endsWith(path.join('node_modules', 'coffee-script', 'lib', 'coffee-script', 'register.js')) ||
relativePath.endsWith(path.join('node_modules', 'fs-extra', 'lib', 'index.js')) ||
relativePath.endsWith(path.join('node_modules', 'graceful-fs', 'graceful-fs.js')) ||
relativePath.endsWith(path.join('node_modules', 'htmlparser2', 'lib', 'index.js')) ||
relativePath.endsWith(path.join('node_modules', 'minimatch', 'minimatch.js')) ||
relativePath === path.join('..', 'exports', 'atom.js') ||
relativePath === path.join('..', 'src', 'electron-shims.js') ||
relativePath === path.join('..', 'node_modules', 'atom-keymap', 'lib', 'command-event.js') ||
relativePath === path.join('..', 'node_modules', 'babel-core', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'cached-run-in-this-context', 'lib', 'main.js') ||
relativePath === path.join('..', 'node_modules', 'decompress-zip', 'lib', 'decompress-zip.js') ||
relativePath === path.join('..', 'node_modules', 'debug', 'node.js') ||
relativePath === path.join('..', 'node_modules', 'git-utils', 'src', 'git.js') ||
relativePath === path.join('..', 'node_modules', 'glob', 'glob.js') ||
relativePath === path.join('..', 'node_modules', 'iconv-lite', 'lib', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'less', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'less', 'lib', 'less', 'fs.js') ||
relativePath === path.join('..', 'node_modules', 'less', 'lib', 'less-node', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'lodash.isequal', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'node-fetch', 'lib', 'fetch-error.js') ||
relativePath === path.join('..', 'node_modules', 'superstring', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'oniguruma', 'src', 'oniguruma.js') ||
relativePath === path.join('..', 'node_modules', 'request', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'resolve', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'resolve', 'lib', 'core.js') ||
relativePath === path.join('..', 'node_modules', 'settings-view', 'node_modules', 'glob', 'glob.js') ||
relativePath === path.join('..', 'node_modules', 'spellchecker', 'lib', 'spellchecker.js') ||
relativePath === path.join('..', 'node_modules', 'spelling-manager', 'node_modules', 'natural', 'lib', 'natural', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'tar', 'tar.js') ||
relativePath === path.join('..', 'node_modules', 'temp', 'lib', 'temp.js') ||
relativePath === path.join('..', 'node_modules', 'tmp', 'lib', 'tmp.js') ||
relativePath === path.join('..', 'node_modules', 'tree-sitter', 'index.js') ||
relativePath === path.join('..', 'node_modules', 'winreg', 'lib', 'registry.js')
=======
requiredModulePath.endsWith('.node') ||
coreModules.has(requiredModulePath) ||
requiringModuleRelativePath.endsWith(path.join('node_modules/xregexp/xregexp-all.js')) ||
(requiredModuleRelativePath.startsWith(path.join('..', 'src')) && requiredModuleRelativePath.endsWith('-element.js')) ||
requiredModuleRelativePath.startsWith(path.join('..', 'node_modules', 'dugite')) ||
requiredModuleRelativePath.endsWith(path.join('node_modules', 'coffee-script', 'lib', 'coffee-script', 'register.js')) ||
requiredModuleRelativePath.endsWith(path.join('node_modules', 'fs-extra', 'lib', 'index.js')) ||
requiredModuleRelativePath.endsWith(path.join('node_modules', 'graceful-fs', 'graceful-fs.js')) ||
requiredModuleRelativePath.endsWith(path.join('node_modules', 'htmlparser2', 'lib', 'index.js')) ||
requiredModuleRelativePath.endsWith(path.join('node_modules', 'minimatch', 'minimatch.js')) ||
requiredModuleRelativePath.endsWith(path.join('node_modules', 'request', 'index.js')) ||
requiredModuleRelativePath.endsWith(path.join('node_modules', 'request', 'request.js')) ||
requiredModuleRelativePath === path.join('..', 'exports', 'atom.js') ||
requiredModuleRelativePath === path.join('..', 'src', 'electron-shims.js') ||
requiredModuleRelativePath === path.join('..', 'src', 'safe-clipboard.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'atom-keymap', 'lib', 'command-event.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'babel-core', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'cached-run-in-this-context', 'lib', 'main.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'debug', 'node.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'git-utils', 'src', 'git.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'glob', 'glob.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'iconv-lite', 'lib', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'less', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'less', 'lib', 'less', 'fs.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'less', 'lib', 'less-node', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'lodash.isequal', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'node-fetch', 'lib', 'fetch-error.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'superstring', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'oniguruma', 'src', 'oniguruma.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'resolve', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'resolve', 'lib', 'core.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'settings-view', 'node_modules', 'glob', 'glob.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'spellchecker', 'lib', 'spellchecker.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'spelling-manager', 'node_modules', 'natural', 'lib', 'natural', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'tar', 'tar.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'ls-archive', 'node_modules', 'tar', 'tar.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'temp', 'lib', 'temp.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'tmp', 'lib', 'tmp.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'tree-sitter', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'yauzl', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'winreg', 'lib', 'registry.js')
>>>>>>>
requiredModulePath.endsWith('.node') ||
coreModules.has(requiredModulePath) ||
requiringModuleRelativePath.endsWith(path.join('node_modules/xregexp/xregexp-all.js')) ||
(requiredModuleRelativePath.startsWith(path.join('..', 'src')) && requiredModuleRelativePath.endsWith('-element.js')) ||
requiredModuleRelativePath.startsWith(path.join('..', 'node_modules', 'dugite')) ||
requiredModuleRelativePath.endsWith(path.join('node_modules', 'coffee-script', 'lib', 'coffee-script', 'register.js')) ||
requiredModuleRelativePath.endsWith(path.join('node_modules', 'fs-extra', 'lib', 'index.js')) ||
requiredModuleRelativePath.endsWith(path.join('node_modules', 'graceful-fs', 'graceful-fs.js')) ||
requiredModuleRelativePath.endsWith(path.join('node_modules', 'htmlparser2', 'lib', 'index.js')) ||
requiredModuleRelativePath.endsWith(path.join('node_modules', 'minimatch', 'minimatch.js')) ||
requiredModuleRelativePath.endsWith(path.join('node_modules', 'request', 'index.js')) ||
requiredModuleRelativePath.endsWith(path.join('node_modules', 'request', 'request.js')) ||
requiredModuleRelativePath === path.join('..', 'exports', 'atom.js') ||
requiredModuleRelativePath === path.join('..', 'src', 'electron-shims.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'atom-keymap', 'lib', 'command-event.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'babel-core', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'cached-run-in-this-context', 'lib', 'main.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'debug', 'node.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'git-utils', 'src', 'git.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'glob', 'glob.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'iconv-lite', 'lib', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'less', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'less', 'lib', 'less', 'fs.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'less', 'lib', 'less-node', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'lodash.isequal', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'node-fetch', 'lib', 'fetch-error.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'superstring', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'oniguruma', 'src', 'oniguruma.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'resolve', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'resolve', 'lib', 'core.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'settings-view', 'node_modules', 'glob', 'glob.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'spellchecker', 'lib', 'spellchecker.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'spelling-manager', 'node_modules', 'natural', 'lib', 'natural', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'tar', 'tar.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'ls-archive', 'node_modules', 'tar', 'tar.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'temp', 'lib', 'temp.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'tmp', 'lib', 'tmp.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'tree-sitter', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'yauzl', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'winreg', 'lib', 'registry.js') |
<<<<<<<
beforeEach(async function () {
editor.setShowInvisibles(true)
editor.setInvisibles(invisibles)
await nextViewUpdatePromise()
=======
beforeEach(function () {
atom.config.set('editor.showInvisibles', true)
atom.config.set('editor.invisibles', invisibles)
runAnimationFrames()
>>>>>>>
beforeEach(function () {
editor.setShowInvisibles(true)
editor.setInvisibles(invisibles)
runAnimationFrames()
<<<<<<<
editor.setShowInvisibles(false)
await nextViewUpdatePromise()
=======
atom.config.set('editor.showInvisibles', false)
runAnimationFrames()
>>>>>>>
editor.setShowInvisibles(false)
runAnimationFrames()
<<<<<<<
editor.setShowInvisibles(true)
await nextViewUpdatePromise()
=======
atom.config.set('editor.showInvisibles', true)
runAnimationFrames()
>>>>>>>
editor.setShowInvisibles(true)
runAnimationFrames()
<<<<<<<
it('renders a placeholder space on empty lines when the line-ending character is an empty string', async function () {
editor.setInvisibles({
=======
it('renders a placeholder space on empty lines when the line-ending character is an empty string', function () {
atom.config.set('editor.invisibles', {
>>>>>>>
it('renders a placeholder space on empty lines when the line-ending character is an empty string', function () {
editor.setInvisibles({
<<<<<<<
it('renders an placeholder space on empty lines when the line-ending character is false', async function () {
editor.setInvisibles({
=======
it('renders an placeholder space on empty lines when the line-ending character is false', function () {
atom.config.set('editor.invisibles', {
>>>>>>>
it('renders an placeholder space on empty lines when the line-ending character is false', function () {
editor.setInvisibles({
<<<<<<<
it('interleaves invisible line-ending characters with indent guides on empty lines', async function () {
editor.update({showIndentGuide: true})
=======
it('interleaves invisible line-ending characters with indent guides on empty lines', function () {
atom.config.set('editor.showIndentGuide', true)
>>>>>>>
it('interleaves invisible line-ending characters with indent guides on empty lines', function () {
editor.update({showIndentGuide: true})
<<<<<<<
beforeEach(async function () {
editor.update({showIndentGuide: true})
await nextViewUpdatePromise()
=======
beforeEach(function () {
atom.config.set('editor.showIndentGuide', true)
runAnimationFrames()
>>>>>>>
beforeEach(function () {
editor.update({showIndentGuide: true})
runAnimationFrames()
<<<<<<<
it('renders indent guides correctly on lines containing only whitespace when invisibles are enabled', async function () {
editor.setShowInvisibles(true)
editor.setInvisibles({
=======
it('renders indent guides correctly on lines containing only whitespace when invisibles are enabled', function () {
atom.config.set('editor.showInvisibles', true)
atom.config.set('editor.invisibles', {
>>>>>>>
it('renders indent guides correctly on lines containing only whitespace when invisibles are enabled', function () {
editor.update({
showInvisibles: true,
invisibles: {
<<<<<<<
editor.update({showLineNumbers: false})
await nextViewUpdatePromise()
=======
atom.config.set('editor.showLineNumbers', false)
runAnimationFrames()
>>>>>>>
editor.update({showLineNumbers: false})
runAnimationFrames()
<<<<<<<
editor.update({showLineNumbers: true})
await nextViewUpdatePromise()
=======
atom.config.set('editor.showLineNumbers', true)
runAnimationFrames()
>>>>>>>
editor.update({showLineNumbers: true})
runAnimationFrames()
<<<<<<<
it('accounts for character widths when positioning cursors', async function () {
component.setFontFamily('sans-serif')
=======
it('accounts for character widths when positioning cursors', function () {
atom.config.set('editor.fontFamily', 'sans-serif')
>>>>>>>
it('accounts for character widths when positioning cursors', function () {
component.setFontFamily('sans-serif')
<<<<<<<
it('accounts for the width of paired characters when positioning cursors', async function () {
component.setFontFamily('sans-serif')
=======
it('accounts for the width of paired characters when positioning cursors', function () {
atom.config.set('editor.fontFamily', 'sans-serif')
>>>>>>>
it('accounts for the width of paired characters when positioning cursors', function () {
component.setFontFamily('sans-serif')
<<<<<<<
it('updates the scrollLeft or scrollTop according to the scroll sensitivity', async function () {
editor.setScrollSensitivity(50)
=======
it('updates the scrollLeft or scrollTop according to the scroll sensitivity', function () {
atom.config.set('editor.scrollSensitivity', 50)
>>>>>>>
it('updates the scrollLeft or scrollTop according to the scroll sensitivity', function () {
editor.setScrollSensitivity(50)
<<<<<<<
=======
it('uses the previous scrollSensitivity when the value is not an int', function () {
atom.config.set('editor.scrollSensitivity', 'nope')
componentNode.dispatchEvent(new WheelEvent('mousewheel', {
wheelDeltaX: 0,
wheelDeltaY: -10
}))
runAnimationFrames()
expect(verticalScrollbarNode.scrollTop).toBe(10)
})
it('parses negative scrollSensitivity values at the minimum', function () {
atom.config.set('editor.scrollSensitivity', -50)
componentNode.dispatchEvent(new WheelEvent('mousewheel', {
wheelDeltaX: 0,
wheelDeltaY: -10
}))
runAnimationFrames()
expect(verticalScrollbarNode.scrollTop).toBe(1)
})
>>>>>>>
<<<<<<<
=======
describe('scoped config settings', function () {
let coffeeComponent, coffeeEditor
beforeEach(async function () {
await atom.packages.activatePackage('language-coffee-script')
coffeeEditor = await atom.workspace.open('coffee.coffee', {autoIndent: false})
})
afterEach(function () {
atom.packages.deactivatePackages()
atom.packages.unloadPackages()
})
describe('soft wrap settings', function () {
beforeEach(function () {
atom.config.set('editor.softWrap', true, {
scopeSelector: '.source.coffee'
})
atom.config.set('editor.preferredLineLength', 17, {
scopeSelector: '.source.coffee'
})
atom.config.set('editor.softWrapAtPreferredLineLength', true, {
scopeSelector: '.source.coffee'
})
editor.setDefaultCharWidth(1)
editor.setEditorWidthInChars(20)
coffeeEditor.setDefaultCharWidth(1)
coffeeEditor.setEditorWidthInChars(20)
})
it('wraps lines when editor.softWrap is true for a matching scope', function () {
expect(editor.lineTextForScreenRow(2)).toEqual(' if (items.length <= 1) return items;')
expect(coffeeEditor.lineTextForScreenRow(3)).toEqual(' return items ')
})
it('updates the wrapped lines when editor.preferredLineLength changes', function () {
atom.config.set('editor.preferredLineLength', 20, {
scopeSelector: '.source.coffee'
})
expect(coffeeEditor.lineTextForScreenRow(2)).toEqual(' return items if ')
})
it('updates the wrapped lines when editor.softWrapAtPreferredLineLength changes', function () {
atom.config.set('editor.softWrapAtPreferredLineLength', false, {
scopeSelector: '.source.coffee'
})
expect(coffeeEditor.lineTextForScreenRow(2)).toEqual(' return items if ')
})
it('updates the wrapped lines when editor.softWrap changes', function () {
atom.config.set('editor.softWrap', false, {
scopeSelector: '.source.coffee'
})
expect(coffeeEditor.lineTextForScreenRow(2)).toEqual(' return items if items.length <= 1')
atom.config.set('editor.softWrap', true, {
scopeSelector: '.source.coffee'
})
expect(coffeeEditor.lineTextForScreenRow(3)).toEqual(' return items ')
})
it('updates the wrapped lines when the grammar changes', function () {
editor.setGrammar(coffeeEditor.getGrammar())
expect(editor.isSoftWrapped()).toBe(true)
expect(editor.lineTextForScreenRow(0)).toEqual('var quicksort = ')
})
describe('::isSoftWrapped()', function () {
it('returns the correct value based on the scoped settings', function () {
expect(editor.isSoftWrapped()).toBe(false)
expect(coffeeEditor.isSoftWrapped()).toBe(true)
})
})
})
describe('invisibles settings', function () {
const jsInvisibles = {
eol: 'J',
space: 'A',
tab: 'V',
cr: 'A'
}
const coffeeInvisibles = {
eol: 'C',
space: 'O',
tab: 'F',
cr: 'E'
}
beforeEach(function () {
atom.config.set('editor.showInvisibles', true, {
scopeSelector: '.source.js'
})
atom.config.set('editor.invisibles', jsInvisibles, {
scopeSelector: '.source.js'
})
atom.config.set('editor.showInvisibles', false, {
scopeSelector: '.source.coffee'
})
atom.config.set('editor.invisibles', coffeeInvisibles, {
scopeSelector: '.source.coffee'
})
editor.setText(' a line with tabs\tand spaces \n')
runAnimationFrames()
})
it('renders the invisibles when editor.showInvisibles is true for a given grammar', function () {
expect(component.lineNodeForScreenRow(0).textContent).toBe('' + jsInvisibles.space + 'a line with tabs' + jsInvisibles.tab + 'and spaces' + jsInvisibles.space + jsInvisibles.eol)
})
it('does not render the invisibles when editor.showInvisibles is false for a given grammar', function () {
editor.setGrammar(coffeeEditor.getGrammar())
runAnimationFrames()
expect(component.lineNodeForScreenRow(0).textContent).toBe(' a line with tabs and spaces ')
})
it('re-renders the invisibles when the invisible settings change', function () {
let jsGrammar = editor.getGrammar()
editor.setGrammar(coffeeEditor.getGrammar())
atom.config.set('editor.showInvisibles', true, {
scopeSelector: '.source.coffee'
})
runAnimationFrames()
let newInvisibles = {
eol: 'N',
space: 'E',
tab: 'W',
cr: 'I'
}
expect(component.lineNodeForScreenRow(0).textContent).toBe('' + coffeeInvisibles.space + 'a line with tabs' + coffeeInvisibles.tab + 'and spaces' + coffeeInvisibles.space + coffeeInvisibles.eol)
atom.config.set('editor.invisibles', newInvisibles, {
scopeSelector: '.source.coffee'
})
runAnimationFrames()
expect(component.lineNodeForScreenRow(0).textContent).toBe('' + newInvisibles.space + 'a line with tabs' + newInvisibles.tab + 'and spaces' + newInvisibles.space + newInvisibles.eol)
editor.setGrammar(jsGrammar)
runAnimationFrames()
expect(component.lineNodeForScreenRow(0).textContent).toBe('' + jsInvisibles.space + 'a line with tabs' + jsInvisibles.tab + 'and spaces' + jsInvisibles.space + jsInvisibles.eol)
})
})
describe('editor.showIndentGuide', function () {
beforeEach(function () {
atom.config.set('editor.showIndentGuide', true, {
scopeSelector: '.source.js'
})
atom.config.set('editor.showIndentGuide', false, {
scopeSelector: '.source.coffee'
})
runAnimationFrames()
})
it('has an "indent-guide" class when scoped editor.showIndentGuide is true, but not when scoped editor.showIndentGuide is false', function () {
let line1LeafNodes = getLeafNodes(component.lineNodeForScreenRow(1))
expect(line1LeafNodes[0].textContent).toBe(' ')
expect(line1LeafNodes[0].classList.contains('indent-guide')).toBe(true)
expect(line1LeafNodes[1].classList.contains('indent-guide')).toBe(false)
editor.setGrammar(coffeeEditor.getGrammar())
runAnimationFrames()
line1LeafNodes = getLeafNodes(component.lineNodeForScreenRow(1))
expect(line1LeafNodes[0].textContent).toBe(' ')
expect(line1LeafNodes[0].classList.contains('indent-guide')).toBe(false)
expect(line1LeafNodes[1].classList.contains('indent-guide')).toBe(false)
})
it('removes the "indent-guide" class when editor.showIndentGuide to false', function () {
let line1LeafNodes = getLeafNodes(component.lineNodeForScreenRow(1))
expect(line1LeafNodes[0].textContent).toBe(' ')
expect(line1LeafNodes[0].classList.contains('indent-guide')).toBe(true)
expect(line1LeafNodes[1].classList.contains('indent-guide')).toBe(false)
atom.config.set('editor.showIndentGuide', false, {
scopeSelector: '.source.js'
})
runAnimationFrames()
line1LeafNodes = getLeafNodes(component.lineNodeForScreenRow(1))
expect(line1LeafNodes[0].textContent).toBe(' ')
expect(line1LeafNodes[0].classList.contains('indent-guide')).toBe(false)
expect(line1LeafNodes[1].classList.contains('indent-guide')).toBe(false)
})
})
})
>>>>>>> |
<<<<<<<
expect(atom.applicationDelegate.confirm).toHaveBeenCalled()
expect(editor.largeFileMode).toBe(true)
=======
runs(() => {
expect(atom.applicationDelegate.confirm).toHaveBeenCalled()
})
>>>>>>>
expect(atom.applicationDelegate.confirm).toHaveBeenCalled() |
<<<<<<<
describe('serialization', () => {
function simulateReload() {
waitsForPromise(() => {
const workspaceState = atom.workspace.serialize()
const projectState = atom.project.serialize({isUnloading: true})
atom.workspace.destroy()
atom.project.destroy()
atom.project = new Project({
notificationManager: atom.notifications,
packageManager: atom.packages,
confirm: atom.confirm.bind(atom),
applicationDelegate: atom.applicationDelegate
})
return atom.project.deserialize(projectState).then(() => {
atom.workspace = new Workspace({
config: atom.config,
project: atom.project,
packageManager: atom.packages,
grammarRegistry: atom.grammars,
styleManager: atom.styles,
deserializerManager: atom.deserializers,
notificationManager: atom.notifications,
applicationDelegate: atom.applicationDelegate,
viewRegistry: atom.views,
assert: atom.assert.bind(atom),
textEditorRegistry: atom.textEditors
})
atom.workspace.deserialize(workspaceState, atom.deserializers)
})
})
}
=======
const simulateReload = () => {
const workspaceState = workspace.serialize()
const projectState = atom.project.serialize({isUnloading: true})
workspace.destroy()
atom.project.destroy()
atom.project = new Project({
notificationManager: atom.notifications,
packageManager: atom.packages,
confirm: atom.confirm.bind(atom),
applicationDelegate: atom.applicationDelegate
})
atom.project.deserialize(projectState)
workspace = atom.workspace = new Workspace({
config: atom.config,
project: atom.project,
packageManager: atom.packages,
grammarRegistry: atom.grammars,
styleManager: atom.styles,
deserializerManager: atom.deserializers,
notificationManager: atom.notifications,
applicationDelegate: atom.applicationDelegate,
viewRegistry: atom.views,
assert: atom.assert.bind(atom),
textEditorRegistry: atom.textEditors
})
return workspace.deserialize(workspaceState, atom.deserializers)
}
>>>>>>>
function simulateReload() {
waitsForPromise(() => {
const workspaceState = workspace.serialize()
const projectState = atom.project.serialize({isUnloading: true})
workspace.destroy()
atom.project.destroy()
atom.project = new Project({
notificationManager: atom.notifications,
packageManager: atom.packages,
confirm: atom.confirm.bind(atom),
applicationDelegate: atom.applicationDelegate
})
return atom.project.deserialize(projectState).then(() => {
workspace = atom.workspace = new Workspace({
config: atom.config,
project: atom.project,
packageManager: atom.packages,
grammarRegistry: atom.grammars,
styleManager: atom.styles,
deserializerManager: atom.deserializers,
notificationManager: atom.notifications,
applicationDelegate: atom.applicationDelegate,
viewRegistry: atom.views,
assert: atom.assert.bind(atom),
textEditorRegistry: atom.textEditors
})
workspace.deserialize(workspaceState, atom.deserializers)
})
})
}
<<<<<<<
describe('where a dock contains an editor', () => {
afterEach(() => {
atom.workspace.getRightDock().paneContainer.destroy()
})
it('constructs the view with the same panes', () => {
const pane1 = atom.workspace.getRightDock().getActivePane()
const pane2 = pane1.splitRight({copyActiveItem: true})
const pane3 = pane2.splitRight({copyActiveItem: true})
let pane4 = null
waitsForPromise(() =>
atom.workspace.open(null, {location: 'right'}).then(editor => editor.setText('An untitled editor.'))
)
waitsForPromise(() =>
atom.workspace.open('b', {location: 'right'}).then(editor => pane2.activateItem(editor.copy()))
)
waitsForPromise(() =>
atom.workspace.open('../sample.js', {location: 'right'}).then(editor => pane3.activateItem(editor))
)
runs(() => {
pane3.activeItem.setCursorScreenPosition([2, 4])
pane4 = pane2.splitDown()
})
waitsForPromise(() =>
atom.workspace.open('../sample.txt', {location: 'right'}).then(editor => pane4.activateItem(editor))
)
runs(() => {
pane4.getActiveItem().setCursorScreenPosition([0, 2])
pane2.activate()
})
simulateReload()
runs(() => {
expect(atom.workspace.getTextEditors().length).toBe(5)
const [editor1, editor2, untitledEditor, editor3, editor4] = atom.workspace.getTextEditors()
const firstDirectory = atom.project.getDirectories()[0]
expect(firstDirectory).toBeDefined()
expect(editor1.getPath()).toBe(firstDirectory.resolve('b'))
expect(editor2.getPath()).toBe(firstDirectory.resolve('../sample.txt'))
expect(editor2.getCursorScreenPosition()).toEqual([0, 2])
expect(editor3.getPath()).toBe(firstDirectory.resolve('b'))
expect(editor4.getPath()).toBe(firstDirectory.resolve('../sample.js'))
expect(editor4.getCursorScreenPosition()).toEqual([2, 4])
expect(untitledEditor.getPath()).toBeUndefined()
expect(untitledEditor.getText()).toBe('An untitled editor.')
expect(atom.workspace.getRightDock().getActiveTextEditor().getPath()).toBe(editor3.getPath())
})
})
})
=======
>>>>>>> |
<<<<<<<
this.fileRecoveryService.didCrashWindow(this)
dialog.showMessageBox(this.browserWindow, {
=======
await this.fileRecoveryService.didCrashWindow(this)
const chosen = dialog.showMessageBox(this.browserWindow, {
>>>>>>>
await this.fileRecoveryService.didCrashWindow(this)
dialog.showMessageBox(this.browserWindow, { |
<<<<<<<
//
// * `options` (optional) {Object}
// * `bypassReadOnly` (optional) {Boolean} Must be `true` to modify a read-only editor. (default: false)
undo (options = {}) {
this.ensureWritable('undo', options)
this.avoidMergingSelections(() => this.buffer.undo())
=======
undo () {
this.avoidMergingSelections(() => this.buffer.undo({selectionsMarkerLayer: this.selectionsMarkerLayer}))
>>>>>>>
//
// * `options` (optional) {Object}
// * `bypassReadOnly` (optional) {Boolean} Must be `true` to modify a read-only editor. (default: false)
undo (options = {}) {
this.ensureWritable('undo', options)
this.avoidMergingSelections(() => this.buffer.undo({selectionsMarkerLayer: this.selectionsMarkerLayer}))
<<<<<<<
//
// * `options` (optional) {Object}
// * `bypassReadOnly` (optional) {Boolean} Must be `true` to modify a read-only editor. (default: false)
redo (options = {}) {
this.ensureWritable('redo', options)
this.avoidMergingSelections(() => this.buffer.redo())
=======
redo () {
this.avoidMergingSelections(() => this.buffer.redo({selectionsMarkerLayer: this.selectionsMarkerLayer}))
>>>>>>>
//
// * `options` (optional) {Object}
// * `bypassReadOnly` (optional) {Boolean} Must be `true` to modify a read-only editor. (default: false)
redo (options = {}) {
this.ensureWritable('redo', options)
this.avoidMergingSelections(() => this.buffer.redo({selectionsMarkerLayer: this.selectionsMarkerLayer})) |
<<<<<<<
=======
>>>>>>>
<<<<<<<
else if (i.instance_type != 'bitfocus-companion') {
=======
else {
>>>>>>>
else if (i.instance_type !== 'bitfocus-companion') { |
<<<<<<<
var http = require('./lib/http')(system);
var io = require('./lib/io')(system, http);
var log = require('./lib/log')(system,io);
var db = require('./lib/db')(system,cfgDir);
var userconfig = require('./lib/userconfig')(system)
var appRoot = require('app-root-path');
var express = require('express');
var bank = require('./lib/bank')(system);
var elgatoDM = require('./lib/elgato_dm')(system);
var preview = require('./lib/preview')(system);
var action = require('./lib/action')(system);
var instance = require('./lib/instance')(system);
var variable = require('./lib/variable')(system);
var osc = require('./lib/osc')(system);
var rest = require('./lib/rest')(system);
var udp = require('./lib/udp')(system);
=======
var http = require('./lib/http')(system);
var io = require('./lib/io')(system, http);
var log = require('./lib/log')(system,io);
var db = require('./lib/db')(system,cfgDir);
var appRoot = require('app-root-path');
var express = require('express');
var bank = require('./lib/bank')(system);
var elgatoDM = require('./lib/elgato_dm')(system);
var preview = require('./lib/preview')(system);
var action = require('./lib/action')(system);
var instance = require('./lib/instance')(system);
var variable = require('./lib/variable')(system);
var osc = require('./lib/osc')(system);
var rest = require('./lib/rest')(system);
>>>>>>>
var http = require('./lib/http')(system);
var io = require('./lib/io')(system, http);
var log = require('./lib/log')(system,io);
var db = require('./lib/db')(system,cfgDir);
var userconfig = require('./lib/userconfig')(system)
var appRoot = require('app-root-path');
var express = require('express');
var bank = require('./lib/bank')(system);
var elgatoDM = require('./lib/elgato_dm')(system);
var preview = require('./lib/preview')(system);
var action = require('./lib/action')(system);
var instance = require('./lib/instance')(system);
var variable = require('./lib/variable')(system);
var osc = require('./lib/osc')(system);
var rest = require('./lib/rest')(system); |
<<<<<<<
* @param {...Function[]} fns
* @returns {Object}
=======
* @param {...Function} fns
* @returns {object}
>>>>>>>
* @param {...Function[]} fns
* @returns {object} |
<<<<<<<
=======
function enableTLSAuth(checked) {
var disabled = $("#service_params_dialog #params_url").val()
.lastIndexOf("https", 0) !== 0;
$("#params_sslauth, #params_sslauth_all").prop("disabled", disabled);
$("#params_sslauth").prop("checked", checked);
}
>>>>>>>
function enableTLSAuth(checked) {
var disabled = $("#service_params_dialog #params_url").val()
.lastIndexOf("https", 0) !== 0;
$("#params_sslauth, #params_sslauth_all").prop("disabled", disabled);
$("#params_sslauth").prop("checked", checked);
}
<<<<<<<
if (type == 'filter') {
if ( data ) {
// if it is WSDL row, return current filter
// value to always keep the row visible
var filterValue = $("#services_filter input").val();
return filterValue ? filterValue : data;
} else {
return data;
}
=======
if (type == 'filter' && data) {
// if it is WSDL row, return current filter
// value to always keep the row visible
var filterValue = $("#services_filter input").val();
return filterValue ? filterValue : data;
>>>>>>>
if (type == 'filter') {
if ( data ) {
// if it is WSDL row, return current filter
// value to always keep the row visible
var filterValue = $("#services_filter input").val();
return filterValue ? filterValue : data;
} else {
return data;
}
<<<<<<<
function initTestability() {
// add data-name attributes to improve testability
$("#wsdl_add_dialog").parent().attr("data-name", "wsdl_add_dialog");
$("#wsdl_params_dialog").parent().attr("data-name", "wsdl_params_dialog");
$("#service_params_dialog").parent().attr("data-name", "service_params_dialog");
$("#wsdl_disable_dialog").parent().attr("data-name", "wsdl_disable_dialog");
$("button span:contains('Close')").parent().attr("data-name", "close");
$("button span:contains('Cancel')").parent().attr("data-name", "cancel");
$("button span:contains('OK')").parent().attr("data-name", "ok");
}
=======
function showOutput(jqXHR) {
var response = $.parseJSON(jqXHR.responseText);
if (response.data.stderr && response.data.stderr.length > 0) {
initConsoleOutput(response.data.stderr,
_("clients.client_services_tab.wsdl_validator_output"), 500);
}
}
>>>>>>>
function initTestability() {
// add data-name attributes to improve testability
$("#wsdl_add_dialog").parent().attr("data-name", "wsdl_add_dialog");
$("#wsdl_params_dialog").parent().attr("data-name", "wsdl_params_dialog");
$("#service_params_dialog").parent().attr("data-name", "service_params_dialog");
$("#wsdl_disable_dialog").parent().attr("data-name", "wsdl_disable_dialog");
$("button span:contains('Close')").parent().attr("data-name", "close");
$("button span:contains('Cancel')").parent().attr("data-name", "cancel");
$("button span:contains('OK')").parent().attr("data-name", "ok");
}
function showOutput(jqXHR) {
var response = $.parseJSON(jqXHR.responseText);
if (response.data.stderr && response.data.stderr.length > 0) {
initConsoleOutput(response.data.stderr,
_("clients.client_services_tab.wsdl_validator_output"), 500);
}
} |
<<<<<<<
import { ADD_CHILD, REMOVE_CHILD, MOVE_CHILD, DELETE_CHILD } from '../../actions/workspace';
import { ADD_STATE, ADD_PROPS, ADD_STYLES, ADD_EVENTS, DELETE_STATE, DELETE_PROPS, DELETE_STYLES, DELETE_EVENTS } from '../../actions/config';
import { SET_ACTIVE_COMPONENT} from '../../actions/FileSystemActions';
=======
import {
ADD_CHILD,
REMOVE_CHILD,
MOVE_CHILD,
DELETE_CHILD,
UPDATE_STYLE
} from '../../actions/workspace';
>>>>>>>
import { ADD_CHILD, REMOVE_CHILD, MOVE_CHILD, DELETE_CHILD, UPDATE_STYLE } from '../../actions/workspace';
import { ADD_STATE, ADD_PROPS, ADD_STYLES, ADD_EVENTS, DELETE_STATE, DELETE_PROPS, DELETE_STYLES, DELETE_EVENTS } from '../../actions/config';
import { SET_ACTIVE_COMPONENT} from '../../actions/FileSystemActions';
<<<<<<<
import addStateValue from './addStateValue';
import addPropsValue from './addPropsValue';
import addStyleValue from './addStyleValue';
import addEvent from './addEvent';
import deleteStateValue from './deleteStateValue';
import deletePropsValue from './deletePropsValue';
import deleteStylesValue from './deleteStylesValue';
import deleteEvent from './deleteEvent';
import setActiveComponent from './setActiveComponent';
=======
import updateStyle from './updateStyle';
>>>>>>>
import addStateValue from './addStateValue';
import addPropsValue from './addPropsValue';
import addStyleValue from './addStyleValue';
import addEvent from './addEvent';
import deleteStateValue from './deleteStateValue';
import deletePropsValue from './deletePropsValue';
import deleteStylesValue from './deleteStylesValue';
import deleteEvent from './deleteEvent';
import setActiveComponent from './setActiveComponent';
import updateStyle from './updateStyle';
<<<<<<<
case ADD_STATE:
return addStateValue(state, action.aState);
case ADD_PROPS:
return addPropsValue(state, action.prop, action.component);
case ADD_STYLES:
return addStyleValue(state, action.style, action.component);
case ADD_EVENTS:
return addEvent(state, action.event, action.component);
case DELETE_STATE:
return deleteStateValue(state, action.propKey);
case DELETE_PROPS:
return deletePropsValue(state, action.prop, action.component);
case DELETE_STYLES:
return deleteStylesValue(state, action.style, action.component);
case DELETE_EVENTS:
return deleteEvent(state, action.event, action.component);
case SET_ACTIVE_COMPONENT:
return setActiveComponent(state, action.component);
=======
case UPDATE_STYLE:
return updateStyle(state, action);
>>>>>>>
case ADD_STATE:
return addStateValue(state, action.aState);
case ADD_PROPS:
return addPropsValue(state, action.prop, action.component);
case ADD_STYLES:
return addStyleValue(state, action.style, action.component);
case ADD_EVENTS:
return addEvent(state, action.event, action.component);
case DELETE_STATE:
return deleteStateValue(state, action.propKey);
case DELETE_PROPS:
return deletePropsValue(state, action.prop, action.component);
case DELETE_STYLES:
return deleteStylesValue(state, action.style, action.component);
case DELETE_EVENTS:
return deleteEvent(state, action.event, action.component);
case SET_ACTIVE_COMPONENT:
return setActiveComponent(state, action.component);
case UPDATE_STYLE:
return updateStyle(state, action); |
<<<<<<<
console.log('AC: ', allComponents);
=======
>>>>>>> |
<<<<<<<
=======
>>>>>>>
<<<<<<<
tabElement.relatedDownloadButton = document.getElementById('button-tab-' + intTabNumber + '-download');
=======
if (window.process && window.process.type === 'renderer') {
tabElement.relatedDownloadButton = document.getElementById('button-tab-' + intTabNumber + '-save');
tabElement.relatedDownloadButton2 = document.getElementById('button-tab-' + intTabNumber + '-save-as');
tabElement.relatedDownloadButton.addEventListener('click', function (event) {
//console.log(event, event.which);
var strFileName = this.getAttribute('data-filename');
saveScriptAsFile(strFileName);
});
tabElement.relatedDownloadButton2.addEventListener('click', function (event) {
//console.log(event, event.which);
var strFileName = this.getAttribute('data-filename');
saveScriptAsFile(strFileName, true);
});
} else {
tabElement.relatedDownloadButton = document.getElementById('button-tab-' + intTabNumber + '-download');
}
>>>>>>>
if (window.process && window.process.type === 'renderer') {
tabElement.relatedDownloadButton = document.getElementById('button-tab-' + intTabNumber + '-save');
tabElement.relatedDownloadButton2 = document.getElementById('button-tab-' + intTabNumber + '-save-as');
tabElement.relatedDownloadButton.addEventListener('click', function (event) {
//console.log(event, event.which);
var strFileName = this.getAttribute('data-filename');
saveScriptAsFile(strFileName);
});
tabElement.relatedDownloadButton2.addEventListener('click', function (event) {
//console.log(event, event.which);
var strFileName = this.getAttribute('data-filename');
saveScriptAsFile(strFileName, true);
});
} else {
tabElement.relatedDownloadButton = document.getElementById('button-tab-' + intTabNumber + '-download');
}
<<<<<<<
=======
if (evt.touchDevice) {
console.log(tabElement.relatedAcePositionContainer);
tabElement.relatedAcePositionContainer.style.height = '1px';
//if (tabElement.relatedAcePositionContainer.offsetHeight < 3) {
// tabElement.relatedAcePositionContainer.style.height = '';
//}
}
>>>>>>>
if (evt.touchDevice) {
console.log(tabElement.relatedAcePositionContainer);
tabElement.relatedAcePositionContainer.style.height = '1px';
//if (tabElement.relatedAcePositionContainer.offsetHeight < 3) {
// tabElement.relatedAcePositionContainer.style.height = '';
//}
}
<<<<<<<
=======
//console.log('step 1:', intHeight, intMin, intMax);
>>>>>>>
//console.log('step 1:', intHeight, intMin, intMax);
<<<<<<<
=======
//console.log('step 2:', intHeight, intMin, intMax);
>>>>>>>
//console.log('step 2:', intHeight, intMin, intMax); |
<<<<<<<
message += 'stats.timers.' + key + '.mean_' + clean_pct + ' ' + mean + ' ' + ts + "\n";
message += 'stats.timers.' + key + '.upper_' + clean_pct + ' ' + maxAtThreshold + ' ' + ts + "\n";
message += 'stats.timers.' + key + '.sum_' + clean_pct + ' ' + sum + ' ' + ts + "\n";
}
sum = cumulativeValues[count-1];
mean = sum / count;
var sumOfDiffs = 0;
for (var i = 0; i < count; i++) {
sumOfDiffs += (values[i] - mean) * (values[i] - mean);
=======
message += prefixTimer + key + '.mean_' + clean_pct + ' ' + mean + ' ' + ts + "\n";
message += prefixTimer + key + '.upper_' + clean_pct + ' ' + maxAtThreshold + ' ' + ts + "\n";
>>>>>>>
message += prefixTimer + key + '.mean_' + clean_pct + ' ' + mean + ' ' + ts + "\n";
message += prefixTimer + key + '.upper_' + clean_pct + ' ' + maxAtThreshold + ' ' + ts + "\n";
message += prefixTimer + key + '.sum_' + clean_pct + ' ' + sum + ' ' + ts + "\n";
}
sum = cumulativeValues[count-1];
mean = sum / count;
var sumOfDiffs = 0;
for (var i = 0; i < count; i++) {
sumOfDiffs += (values[i] - mean) * (values[i] - mean);
<<<<<<<
message += 'stats.timers.' + key + '.std ' + stddev + ' ' + ts + "\n";
message += 'stats.timers.' + key + '.upper ' + max + ' ' + ts + "\n";
message += 'stats.timers.' + key + '.lower ' + min + ' ' + ts + "\n";
message += 'stats.timers.' + key + '.count ' + count + ' ' + ts + "\n";
message += 'stats.timers.' + key + '.sum ' + sum + ' ' + ts + "\n";
message += 'stats.timers.' + key + '.mean ' + mean + ' ' + ts + "\n";
=======
message += prefixTimer + key + '.upper ' + max + ' ' + ts + "\n";
message += prefixTimer + key + '.lower ' + min + ' ' + ts + "\n";
message += prefixTimer + key + '.count ' + count + ' ' + ts + "\n";
>>>>>>>
message += prefixTimer + key + '.std ' + stddev + ' ' + ts + "\n";
message += prefixTimer + key + '.upper ' + max + ' ' + ts + "\n";
message += prefixTimer + key + '.lower ' + min + ' ' + ts + "\n";
message += prefixTimer + key + '.count ' + count + ' ' + ts + "\n";
message += prefixTimer + key + '.sum ' + sum + ' ' + ts + "\n";
message += prefixTimer + key + '.mean ' + mean + ' ' + ts + "\n"; |
<<<<<<<
graphite:
globalPrefix: global prefix to use for sending stats to graphite [default: "stats"]
prefixCounter: graphite prefix for counter metrics [default: "counters"]
prefixTimer: graphite prefix for timer metrics [default: "timers"]
prefixGauge: graphite prefix for gauge metrics [default: "gauges"]
=======
repeater: an array of hashes of the for host: and port:
that details other statsd servers to which the received
packets should be "repeated" (duplicated to).
e.g. [ { host: '10.10.10.10', port: 8125 },
{ host: 'observer', port: 88125 } ]
>>>>>>>
graphite:
globalPrefix: global prefix to use for sending stats to graphite [default: "stats"]
prefixCounter: graphite prefix for counter metrics [default: "counters"]
prefixTimer: graphite prefix for timer metrics [default: "timers"]
prefixGauge: graphite prefix for gauge metrics [default: "gauges"]
repeater: an array of hashes of the for host: and port:
that details other statsd servers to which the received
packets should be "repeated" (duplicated to).
e.g. [ { host: '10.10.10.10', port: 8125 },
{ host: 'observer', port: 88125 } ] |
<<<<<<<
' if it does not contain sql % wildcard, it will put your pattern between two % <br /><br />' +
' else it will consider you pattern as it is.'
=======
'- if it does not contain sql % wildcard, it will put your pattern between two % <br /><br />' +
'- else it will consider your pattern as it is.' +
'</pre>'
>>>>>>>
'- if it does not contain sql % wildcard, it will put your pattern between two % <br /><br />' +
'- else it will consider your pattern as it is.' |
<<<<<<<
var enabledCapabilities = {};
=======
const maxVertexAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS );
const newAttributes = new Uint8Array( maxVertexAttributes );
const enabledAttributes = new Uint8Array( maxVertexAttributes );
const attributeDivisors = new Uint8Array( maxVertexAttributes );
let enabledCapabilities = {};
>>>>>>>
let enabledCapabilities = {};
<<<<<<<
=======
function initAttributes() {
for ( let i = 0, l = newAttributes.length; i < l; i ++ ) {
newAttributes[ i ] = 0;
}
}
function enableAttribute( attribute ) {
enableAttributeAndDivisor( attribute, 0 );
}
function enableAttributeAndDivisor( attribute, meshPerAttribute ) {
newAttributes[ attribute ] = 1;
if ( enabledAttributes[ attribute ] === 0 ) {
gl.enableVertexAttribArray( attribute );
enabledAttributes[ attribute ] = 1;
}
if ( attributeDivisors[ attribute ] !== meshPerAttribute ) {
const extension = isWebGL2 ? gl : extensions.get( 'ANGLE_instanced_arrays' );
extension[ isWebGL2 ? 'vertexAttribDivisor' : 'vertexAttribDivisorANGLE' ]( attribute, meshPerAttribute );
attributeDivisors[ attribute ] = meshPerAttribute;
}
}
function disableUnusedAttributes() {
for ( let i = 0, l = enabledAttributes.length; i !== l; ++ i ) {
if ( enabledAttributes[ i ] !== newAttributes[ i ] ) {
gl.disableVertexAttribArray( i );
enabledAttributes[ i ] = 0;
}
}
}
function vertexAttribPointer( index, size, type, normalized, stride, offset ) {
if ( isWebGL2 === true && ( type === gl.INT || type === gl.UNSIGNED_INT ) ) {
gl.vertexAttribIPointer( index, size, type, normalized, stride, offset );
} else {
gl.vertexAttribPointer( index, size, type, normalized, stride, offset );
}
}
>>>>>>>
<<<<<<<
=======
for ( let i = 0; i < enabledAttributes.length; i ++ ) {
if ( enabledAttributes[ i ] === 1 ) {
gl.disableVertexAttribArray( i );
enabledAttributes[ i ] = 0;
}
}
>>>>>>>
<<<<<<<
=======
initAttributes: initAttributes,
enableAttribute: enableAttribute,
enableAttributeAndDivisor: enableAttributeAndDivisor,
disableUnusedAttributes: disableUnusedAttributes,
vertexAttribPointer: vertexAttribPointer,
>>>>>>> |
<<<<<<<
if ( keys ) imports.push( `import {${keys}${EOL}} from "${pathPrefix}../../build/three.module.js";` );
=======
if ( keys ) imports.push( `import {${keys}\n} from '${pathPrefix}../../build/three.module.js';` );
>>>>>>>
if ( keys ) imports.push( `import {${keys}${EOL}} from '${pathPrefix}../../build/three.module.js';` ); |
<<<<<<<
;window.Swipe = function(element, options) {
=======
function Swipe(container, options) {
>>>>>>>
function Swipe(container, options) {
<<<<<<<
// static css
this.container.style.overflow = 'hidden';
this.element.style.listStyle = 'none';
this.element.style.margin = 0;
=======
var slide = slides[pos];
>>>>>>>
var slide = slides[pos];
<<<<<<<
// add event listeners
if (this.element.addEventListener) {
this.element.addEventListener('touchstart', this, false);
this.element.addEventListener('touchmove', this, false);
this.element.addEventListener('touchend', this, false);
this.element.addEventListener('touchcancel', this, false);
this.element.addEventListener('webkitTransitionEnd', this, false);
this.element.addEventListener('msTransitionEnd', this, false);
this.element.addEventListener('oTransitionEnd', this, false);
this.element.addEventListener('transitionend', this, false);
window.addEventListener('resize', this, false);
=======
>>>>>>>
<<<<<<<
// determine width of each slide
this.width = Math.ceil(("getBoundingClientRect" in this.container) ? this.container.getBoundingClientRect().width : this.container.offsetWidth);
// Fix width for Android WebView (i.e. PhoneGap)
if (this.width === 0 && typeof window.getComputedStyle === 'function') {
this.width = window.getComputedStyle(this.container, null).width.replace('px','');
}
// return immediately if measurement fails
if (!this.width) return null;
// hide slider element but keep positioning during setup
var origVisibility = this.container.style.visibility;
this.container.style.visibility = 'hidden';
// dynamic css
this.element.style.width = Math.ceil(this.slides.length * this.width) + 'px';
var index = this.slides.length;
while (index--) {
var el = this.slides[index];
el.style.width = this.width + 'px';
el.style.display = 'table-cell';
el.style.verticalAlign = 'top';
=======
>>>>>>>
<<<<<<<
// restore the visibility of the slider element
this.container.style.visibility = origVisibility;
=======
function move(index, dist, speed) {
>>>>>>>
function move(index, dist, speed) {
<<<<<<<
// cancel next scheduled automatic transition, if any
this.delay = delay || 0;
clearTimeout(this.interval);
=======
element.style.left = (( (to - from) * (Math.floor((timeElap / speed) * 100) / 100) ) + from) + 'px';
>>>>>>>
element.style.left = (( (to - from) * (Math.floor((timeElap / speed) * 100) / 100) ) + from) + 'px';
<<<<<<<
this.interval = (this.delay)
? setTimeout(function() {
_this.next(_this.delay);
}, this.delay)
: 0;
},
stop: function() {
this.delay = 0;
clearTimeout(this.interval);
},
resume: function() {
this.delay = this.options.auto || 0;
this.begin();
},
handleEvent: function(e) {
switch (e.type) {
case 'touchstart': this.onTouchStart(e); break;
case 'touchmove': this.onTouchMove(e); break;
case 'touchcancel' :
case 'touchend': this.onTouchEnd(e); break;
case 'webkitTransitionEnd':
case 'msTransitionEnd':
case 'oTransitionEnd':
case 'transitionend': this.transitionEnd(e); break;
case 'resize': this.setup(); break;
=======
>>>>>>>
<<<<<<<
// set transition time to 0 for 1-to-1 touch movement
this.element.style.MozTransitionDuration = this.element.style.webkitTransitionDuration = 0;
e.stopPropagation();
},
=======
// expose the Swipe API
return {
setup: function() {
>>>>>>>
// expose the Swipe API
return {
setup: function() {
<<<<<<<
}
e.stopPropagation();
=======
if (browser.transitions) translate(pos, 0, 0);
}
// removed event listeners
if (browser.addEventListener) {
// remove current event listeners
element.removeEventListener('touchstart', events, false);
element.removeEventListener('webkitTransitionEnd', events, false);
element.removeEventListener('msTransitionEnd', events, false);
element.removeEventListener('oTransitionEnd', events, false);
element.removeEventListener('otransitionend', events, false);
element.removeEventListener('transitionend', events, false);
window.removeEventListener('resize', events, false);
}
else {
window.onresize = null;
}
}
>>>>>>>
if (browser.transitions) translate(pos, 0, 0);
}
// removed event listeners
if (browser.addEventListener) {
// remove current event listeners
element.removeEventListener('touchstart', events, false);
element.removeEventListener('webkitTransitionEnd', events, false);
element.removeEventListener('msTransitionEnd', events, false);
element.removeEventListener('oTransitionEnd', events, false);
element.removeEventListener('otransitionend', events, false);
element.removeEventListener('transitionend', events, false);
window.removeEventListener('resize', events, false);
}
else {
window.onresize = null;
}
} |
<<<<<<<
envMapEncoding: getTextureEncodingFromMap( material.envMap, renderer.gammaInput ),
=======
envMapCubeUV: (!!material.envMap) && ((material.envMap.mapping === THREE.CubeUVReflectionMapping) ||
(material.envMap.mapping === THREE.CubeUVRefractionMapping)),
envMapEncoding: ( !! material.envMap ) ? material.envMap.encoding : false,
>>>>>>>
envMapEncoding: getTextureEncodingFromMap( material.envMap, renderer.gammaInput ),
envMapCubeUV: (!!material.envMap) && ((material.envMap.mapping === THREE.CubeUVReflectionMapping) ||
(material.envMap.mapping === THREE.CubeUVRefractionMapping)), |
<<<<<<<
if ( _this.gammaInput ) {
uniforms.emissive.value.copyGammaToLinear( material.emissive, _this.gammaFactor );
uniforms.specular.value.copyGammaToLinear( material.specular, _this.gammaFactor );
} else {
uniforms.emissive.value = material.emissive;
uniforms.specular.value = material.specular;
}
=======
uniforms.ambient.value = material.ambient;
uniforms.emissive.value = material.emissive;
uniforms.specular.value = material.specular;
>>>>>>>
uniforms.emissive.value = material.emissive;
uniforms.specular.value = material.specular;
<<<<<<<
if ( _this.gammaInput ) {
uniforms.emissive.value.copyGammaToLinear( material.emissive, _this.gammaFactor );
} else {
uniforms.emissive.value = material.emissive;
}
=======
uniforms.ambient.value = material.ambient;
uniforms.emissive.value = material.emissive;
>>>>>>>
uniforms.emissive.value = material.emissive; |
<<<<<<<
EXT_MESHOPT_COMPRESSION: 'EXT_meshopt_compression',
=======
EXT_TEXTURE_WEBP: 'EXT_texture_webp',
>>>>>>>
EXT_TEXTURE_WEBP: 'EXT_texture_webp',
EXT_MESHOPT_COMPRESSION: 'EXT_meshopt_compression',
<<<<<<<
/**
* meshopt BufferView Compression Extension
*
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression
*/
function GLTFMeshoptCompression( parser ) {
this.name = EXTENSIONS.EXT_MESHOPT_COMPRESSION;
this.parser = parser;
}
GLTFMeshoptCompression.prototype.loadBufferView = function ( index ) {
var json = this.parser.json;
var bufferView = json.bufferViews[ index ];
if ( bufferView.extensions && bufferView.extensions[ this.name ] ) {
var extensionDef = bufferView.extensions[ this.name ];
var buffer = this.parser.getDependency( 'buffer', extensionDef.buffer );
var decoder = this.parser.options.meshoptDecoder;
if ( ! decoder || ! decoder.supported ) {
if ( json.extensionsRequired && json.extensionsRequired.indexOf( this.name ) >= 0 ) {
throw new Error( 'THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files' );
} else {
// Assumes that the extension is optional and that fallback buffer data is present
return null;
}
}
return Promise.all( [ buffer, decoder.ready ] ).then( function ( res ) {
var byteOffset = extensionDef.byteOffset || 0;
var byteLength = extensionDef.byteLength || 0;
var count = extensionDef.count;
var stride = extensionDef.byteStride;
var result = new ArrayBuffer( count * stride );
var source = new Uint8Array( res[ 0 ], byteOffset, byteLength );
decoder.decodeGltfBuffer( new Uint8Array( result ), count, stride, source, extensionDef.mode, extensionDef.filter );
return result;
} );
} else {
return null;
}
};
=======
/**
* WebP Texture Extension
*
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp
*/
function GLTFTextureWebPExtension( parser ) {
this.parser = parser;
this.name = EXTENSIONS.EXT_TEXTURE_WEBP;
this.isSupported = null;
}
GLTFTextureWebPExtension.prototype.loadTexture = function ( textureIndex ) {
var name = this.name;
var parser = this.parser;
var json = parser.json;
var textureDef = json.textures[ textureIndex ];
if ( ! textureDef.extensions || ! textureDef.extensions[ name ] ) {
return null;
}
var extension = textureDef.extensions[ name ];
var source = json.images[ extension.source ];
var loader = source.uri ? parser.options.manager.getHandler( source.uri ) : parser.textureLoader;
return this.detectSupport().then( function ( isSupported ) {
if ( isSupported ) return parser.loadTextureImage( textureIndex, source, loader );
if ( json.extensionsRequired && json.extensionsRequired.indexOf( name ) >= 0 ) {
throw new Error( 'THREE.GLTFLoader: WebP required by asset but unsupported.' );
}
// Fall back to PNG or JPEG.
return parser.loadTexture( textureIndex );
} );
};
GLTFTextureWebPExtension.prototype.detectSupport = function () {
if ( ! this.isSupported ) {
this.isSupported = new Promise( function ( resolve ) {
var image = new Image();
// Lossy test image. Support for lossy images doesn't guarantee support for all
// WebP images, unfortunately.
image.src = 'data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA';
image.onload = image.onerror = function () {
resolve( image.height === 1 );
};
} );
}
return this.isSupported;
};
>>>>>>>
/**
* WebP Texture Extension
*
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp
*/
function GLTFTextureWebPExtension( parser ) {
this.parser = parser;
this.name = EXTENSIONS.EXT_TEXTURE_WEBP;
this.isSupported = null;
}
GLTFTextureWebPExtension.prototype.loadTexture = function ( textureIndex ) {
var name = this.name;
var parser = this.parser;
var json = parser.json;
var textureDef = json.textures[ textureIndex ];
if ( ! textureDef.extensions || ! textureDef.extensions[ name ] ) {
return null;
}
var extension = textureDef.extensions[ name ];
var source = json.images[ extension.source ];
var loader = source.uri ? parser.options.manager.getHandler( source.uri ) : parser.textureLoader;
return this.detectSupport().then( function ( isSupported ) {
if ( isSupported ) return parser.loadTextureImage( textureIndex, source, loader );
if ( json.extensionsRequired && json.extensionsRequired.indexOf( name ) >= 0 ) {
throw new Error( 'THREE.GLTFLoader: WebP required by asset but unsupported.' );
}
// Fall back to PNG or JPEG.
return parser.loadTexture( textureIndex );
} );
};
GLTFTextureWebPExtension.prototype.detectSupport = function () {
if ( ! this.isSupported ) {
this.isSupported = new Promise( function ( resolve ) {
var image = new Image();
// Lossy test image. Support for lossy images doesn't guarantee support for all
// WebP images, unfortunately.
image.src = 'data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA';
image.onload = image.onerror = function () {
resolve( image.height === 1 );
};
} );
}
return this.isSupported;
};
/**
* meshopt BufferView Compression Extension
*
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression
*/
function GLTFMeshoptCompression( parser ) {
this.name = EXTENSIONS.EXT_MESHOPT_COMPRESSION;
this.parser = parser;
}
GLTFMeshoptCompression.prototype.loadBufferView = function ( index ) {
var json = this.parser.json;
var bufferView = json.bufferViews[ index ];
if ( bufferView.extensions && bufferView.extensions[ this.name ] ) {
var extensionDef = bufferView.extensions[ this.name ];
var buffer = this.parser.getDependency( 'buffer', extensionDef.buffer );
var decoder = this.parser.options.meshoptDecoder;
if ( ! decoder || ! decoder.supported ) {
if ( json.extensionsRequired && json.extensionsRequired.indexOf( this.name ) >= 0 ) {
throw new Error( 'THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files' );
} else {
// Assumes that the extension is optional and that fallback buffer data is present
return null;
}
}
return Promise.all( [ buffer, decoder.ready ] ).then( function ( res ) {
var byteOffset = extensionDef.byteOffset || 0;
var byteLength = extensionDef.byteLength || 0;
var count = extensionDef.count;
var stride = extensionDef.byteStride;
var result = new ArrayBuffer( count * stride );
var source = new Uint8Array( res[ 0 ], byteOffset, byteLength );
decoder.decodeGltfBuffer( new Uint8Array( result ), count, stride, source, extensionDef.mode, extensionDef.filter );
return result;
} );
} else {
return null;
}
}; |
<<<<<<<
=======
if ( ! hasMorphPosition && ! hasMorphNormal ) return;
var morphPositions = [];
var morphNormals = [];
>>>>>>>
if ( ! hasMorphPosition && ! hasMorphNormal ) return;
var morphPositions = [];
var morphNormals = [];
<<<<<<<
=======
if ( hasMorphNormal ) {
>>>>>>>
if ( hasMorphNormal ) {
<<<<<<<
}
/**
* @param {THREE.Mesh} mesh
* @param {GLTF.Mesh} meshDef
*/
function updateMorphTargets( mesh, meshDef ) {
=======
if ( hasMorphPosition ) geometry.morphAttributes.position = morphPositions;
if ( hasMorphNormal ) geometry.morphAttributes.normal = morphNormals;
>>>>>>>
if ( hasMorphPosition ) geometry.morphAttributes.position = morphPositions;
if ( hasMorphNormal ) geometry.morphAttributes.normal = morphNormals;
}
/**
* @param {THREE.Mesh} mesh
* @param {GLTF.Mesh} meshDef
*/
function updateMorphTargets( mesh, meshDef ) {
<<<<<<<
if ( material.aoMap && geometry.attributes.uv2 === undefined && geometry.attributes.uv !== undefined ) {
=======
material.morphTargets = true;
if ( mesh.geometry.morphAttributes.normal !== undefined ) material.morphNormals = true;
}
>>>>>>>
if ( material.aoMap && geometry.attributes.uv2 === undefined && geometry.attributes.uv !== undefined ) { |
<<<<<<<
var deserializedImage = deserializeImage( currentUrl );
if ( deserializedImage !== null ) {
if ( deserializedImage instanceof HTMLImageElement ) {
=======
const path = /^(\/\/)|([a-z]+:(\/\/)?)/i.test( currentUrl ) ? currentUrl : scope.resourcePath + currentUrl;
>>>>>>>
const deserializedImage = deserializeImage( currentUrl );
if ( deserializedImage !== null ) {
if ( deserializedImage instanceof HTMLImageElement ) {
<<<<<<<
var deserializedImage = deserializeImage( image.url );
if ( deserializedImage !== null ) {
=======
const path = /^(\/\/)|([a-z]+:(\/\/)?)/i.test( image.url ) ? image.url : scope.resourcePath + image.url;
>>>>>>>
const deserializedImage = deserializeImage( image.url );
if ( deserializedImage !== null ) {
<<<<<<<
var texture;
var image = images[ data.image ];
=======
let texture;
>>>>>>>
let texture;
const image = images[ data.image ];
<<<<<<<
var TYPED_ARRAYS = {
Int8Array: Int8Array,
Uint8Array: Uint8Array,
// Workaround for IE11 pre KB2929437. See #11440
Uint8ClampedArray: typeof Uint8ClampedArray !== 'undefined' ? Uint8ClampedArray : Uint8Array,
Int16Array: Int16Array,
Uint16Array: Uint16Array,
Int32Array: Int32Array,
Uint32Array: Uint32Array,
Float32Array: Float32Array,
Float64Array: Float64Array
};
=======
>>>>>>>
const TYPED_ARRAYS = {
Int8Array: Int8Array,
Uint8Array: Uint8Array,
// Workaround for IE11 pre KB2929437. See #11440
Uint8ClampedArray: typeof Uint8ClampedArray !== 'undefined' ? Uint8ClampedArray : Uint8Array,
Int16Array: Int16Array,
Uint16Array: Uint16Array,
Int32Array: Int32Array,
Uint32Array: Uint32Array,
Float32Array: Float32Array,
Float64Array: Float64Array
}; |
<<<<<<<
function WebGLPrograms( renderer, extensions, capabilities, textures, bindingStates ) {
=======
function WebGLPrograms( renderer, extensions, capabilities ) {
>>>>>>>
function WebGLPrograms( renderer, extensions, capabilities, textures, bindingStates ) {
<<<<<<<
program = new WebGLProgram( renderer, extensions, code, material, shader, parameters, capabilities, textures, bindingStates );
=======
program = new WebGLProgram( renderer, extensions, cacheKey, material, shader, parameters );
>>>>>>>
program = new WebGLProgram( renderer, extensions, cacheKey, material, shader, parameters, capabilities, textures, bindingStates ); |
<<<<<<<
// Tetrahedron
var option = new UI.Row();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/tetrahedron' ) );
option.onClick( function () {
var geometry = new THREE.TetrahedronBufferGeometry( 1, 0 );
var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() );
mesh.name = 'Tetrahedron';
editor.execute( new AddObjectCommand( mesh ) );
} );
options.add( option );
=======
// Octahedron
var option = new UI.Row();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/octahedron' ) );
option.onClick( function () {
var geometry = new THREE.OctahedronBufferGeometry( 1, 0 );
var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() );
mesh.name = 'Octahedron';
editor.execute( new AddObjectCommand( mesh ) );
} );
options.add( option );
>>>>>>>
// Octahedron
var option = new UI.Row();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/octahedron' ) );
option.onClick( function () {
var geometry = new THREE.OctahedronBufferGeometry( 1, 0 );
var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() );
mesh.name = 'Octahedron';
editor.execute( new AddObjectCommand( mesh ) );
} );
options.add( option );
// Tetrahedron
var option = new UI.Row();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/tetrahedron' ) );
option.onClick( function () {
var geometry = new THREE.TetrahedronBufferGeometry( 1, 0 );
var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() );
mesh.name = 'Tetrahedron';
editor.execute( new AddObjectCommand( mesh ) );
} );
options.add( option ); |
<<<<<<<
// Otherwise, if the current value is a string, move it to an array
// if it's already in an array, then append to that array
if (currentValue === undefined) {
=======
if(typeof currentValue === 'undefined') {
>>>>>>>
if (typeof currentValue === 'undefined') {
<<<<<<<
} else if (typeof currentValue === 'string') {
configBlock[name] = [currentValue, value];
} else if (currentValue.length !== undefined) {
configBlock[name].push(value);
=======
return;
}
// Otherwise if config property has a value
if(typeof value !== 'undefined') {
// And the current value is a string, move it to an array
// if it's already in an array, then append to that array
if(typeof currentValue === 'string') {
configBlock[name] = [currentValue, value];
} else if (typeof currentValue.length !== 'undefined') {
configBlock[name].push(value);
}
>>>>>>>
}
// Otherwise if config property has a value
else if (typeof value !== 'undefined') {
// And the current value is a string, move it to an array
// if it's already in an array, then append to that array
if (typeof currentValue === 'string') {
configBlock[name] = [currentValue, value];
} else if (currentValue.length !== undefined) {
configBlock[name].push(value);
}
<<<<<<<
/**
* Parses a parameter
*
* @param {string} param - the parameter to parse
*
* @returns {Object} parsedParams - the name and value of the parameter
*/
function parseParam (param) {
var kvRegex = /([\w-]+)\s+(.+)?/,
=======
// Parse a parameter
function parseParam(param) {
var kvRegex = /([\w-]+)(?:\s+(.+))?/,
>>>>>>>
/**
* Parses a parameter
*
* @param {string} param - the parameter to parse
*
* @returns {Object} parsedParams - the name and value of the parameter
*/
function parseParam (param) {
var kvRegex = /([\w-]+)(?:\s+(.+))?/, |
<<<<<<<
[ "How to run things locally", "manual/introduction/How-to-run-thing-locally" ],
[ "Matrix transformations", "manual/introduction/Matrix-transformations" ]
=======
[ "Matrix transformations", "manual/introduction/Matrix-transformations" ],
[ "FAQ", "manual/introduction/FAQ" ]
>>>>>>>
[ "How to run things locally", "manual/introduction/How-to-run-thing-locally" ],
[ "Matrix transformations", "manual/introduction/Matrix-transformations" ],
[ "FAQ", "manual/introduction/FAQ" ] |
<<<<<<<
// Collect influences
=======
const morphTargets = material.morphTargets && geometry.morphAttributes.position;
const morphNormals = material.morphNormals && geometry.morphAttributes.normal;
// Remove current morphAttributes
>>>>>>>
// Collect influences
<<<<<<<
var influence = workInfluences[ i ];
var index = influence[ 0 ];
var value = influence[ 1 ];
=======
const influence = influences[ i ];
>>>>>>>
const influence = workInfluences[ i ];
const index = influence[ 0 ];
const value = influence[ 1 ];
<<<<<<<
if ( morphTargets && geometry.getAttribute( 'morphTarget' + i ) !== morphTargets[ index ] ) {
=======
const index = influence[ 0 ];
const value = influence[ 1 ];
>>>>>>>
if ( morphTargets && geometry.getAttribute( 'morphTarget' + i ) !== morphTargets[ index ] ) { |
<<<<<<<
import { WebGLMultiviewRenderTarget } from '../WebGLMultiviewRenderTarget.js';
import { NoToneMapping, AddOperation, MixOperation, MultiplyOperation, EquirectangularRefractionMapping, CubeRefractionMapping, SphericalReflectionMapping, EquirectangularReflectionMapping, CubeUVRefractionMapping, CubeUVReflectionMapping, CubeReflectionMapping, PCFSoftShadowMap, PCFShadowMap, ACESFilmicToneMapping, CineonToneMapping, Uncharted2ToneMapping, ReinhardToneMapping, LinearToneMapping, GammaEncoding, RGBDEncoding, RGBM16Encoding, RGBM7Encoding, RGBEEncoding, sRGBEncoding, LinearEncoding } from '../../constants.js';
=======
import { NoToneMapping, AddOperation, MixOperation, MultiplyOperation, EquirectangularRefractionMapping, CubeRefractionMapping, SphericalReflectionMapping, EquirectangularReflectionMapping, CubeUVRefractionMapping, CubeUVReflectionMapping, CubeReflectionMapping, PCFSoftShadowMap, PCFShadowMap, ACESFilmicToneMapping, CineonToneMapping, Uncharted2ToneMapping, ReinhardToneMapping, LinearToneMapping, GammaEncoding, RGBDEncoding, RGBM16Encoding, RGBM7Encoding, RGBEEncoding, sRGBEncoding, LinearEncoding, LogLuvEncoding } from '../../constants.js';
>>>>>>>
import { WebGLMultiviewRenderTarget } from '../WebGLMultiviewRenderTarget.js';
import { NoToneMapping, AddOperation, MixOperation, MultiplyOperation, EquirectangularRefractionMapping, CubeRefractionMapping, SphericalReflectionMapping, EquirectangularReflectionMapping, CubeUVRefractionMapping, CubeUVReflectionMapping, CubeReflectionMapping, PCFSoftShadowMap, PCFShadowMap, ACESFilmicToneMapping, CineonToneMapping, Uncharted2ToneMapping, ReinhardToneMapping, LinearToneMapping, GammaEncoding, RGBDEncoding, RGBM16Encoding, RGBM7Encoding, RGBEEncoding, sRGBEncoding, LinearEncoding, LogLuvEncoding } from '../../constants.js'; |
<<<<<<<
coverage = require('./coverage'),
constants = require('./constants');
=======
coverage = require('./coverage');
>>>>>>>
coverage = require('./coverage'),
constants = require('./constants');
<<<<<<<
this.config = config || configHelper.instance();
this.hostname = constants.hostname;
=======
this.config = configHelper.getConfig(cwd);
>>>>>>>
this.hostname = constants.hostname;
this.config = configHelper.getConfig(cwd);
<<<<<<<
staticContent = this.config.get('static');
=======
staticContent = this.config.static;
>>>>>>>
staticContent = this.config.static;
<<<<<<<
phantomPath = this.config.resolve('binaries.phantomjs');
}
=======
if (this.config.binaries && this.config.phantomjs) {
phantomPath = this.config.binaries.phantomjs;
}
>>>>>>>
if (this.config.binaries && this.config.phantomjs) {
phantomPath = this.config.binaries.phantomjs;
}
}
<<<<<<<
try {
stat = fs.statSync(path);
// check if testname is a dir or file
if (stat.isDirectory()) {
dirContents = fs.readdirSync(path);
dirContents = dirContents.map(function(file) {
return pathm.resolve(path, file);
});
this.parseTestPaths(dirContents, testObjects);
} else if(_s.endsWith(path, '.js')) {
// create test case
testId = this.getNextTestId();
test = testcase.create(
path,
testId,
'http://' + hostname + ':' + this.port + this.urlNamespace + '/' + testId,
this.enableCodeCoverage
);
if(!this.requireTestAnnotations || test.hasAnnotations) {
testObjects[testId] = test;
} else {
logger.warn( i18n('no annotations -- skipping test file %s', path) );
}
} else {
logger.warn( i18n('skipping invalid test file %s', path) );
}
} catch(e) {
logger.error( i18n('Cannot parse %s, %s', path, e ) );
throw e;
}
=======
try {
stat = fs.statSync(path);
// check if testname is a dir or file
if (stat.isDirectory()) {
dirContents = fs.readdirSync(path);
dirContents = dirContents.map(function(file) {
return pathm.resolve(path, file);
});
this.parseTestPaths(dirContents, testObjects);
} else if(_s.endsWith(path, '.js')) {
// Set the config path to the path of the current file
configHelper.cwd = pathm.dirname(path);
// create test case
testId = this.getNextTestId();
testCaseConfig = {
path: path,
id: testId,
runUrl: 'http://' + hostname + ':' + this.port + this.urlNamespace + '/' + testId,
instrumentCodeCoverate: this.enableCodeCoverage,
config: configHelper.getConfig()
};
test = testcase.create(testCaseConfig);
if(!this.requireTestAnnotations || test.hasAnnotations) {
testObjects[testId] = test;
} else {
logger.warn( i18n('no annotations -- skipping test file %s', path) );
}
} else {
logger.warn( i18n('skipping invalid test file %s', path) );
}
} catch(e) {
logger.error( i18n('Cannot parse %s, %s', path, e ) );
throw e;
}
>>>>>>>
try {
stat = fs.statSync(path);
// check if testname is a dir or file
if (stat.isDirectory()) {
dirContents = fs.readdirSync(path);
dirContents = dirContents.map(function(file) {
return pathm.resolve(path, file);
});
this.parseTestPaths(dirContents, testObjects);
} else if(_s.endsWith(path, '.js')) {
// Set the config path to the path of the current file
configHelper.cwd = pathm.dirname(path);
// create test case
testId = this.getNextTestId();
testCaseConfig = {
path: path,
id: testId,
runUrl: 'http://' + hostname + ':' + this.port + this.urlNamespace + '/' + testId,
instrumentCodeCoverate: this.enableCodeCoverage,
config: configHelper.getConfig()
};
test = testcase.create(testCaseConfig);
if(!this.requireTestAnnotations || test.hasAnnotations) {
testObjects[testId] = test;
} else {
logger.warn( i18n('no annotations -- skipping test file %s', path) );
}
} else {
logger.warn( i18n('skipping invalid test file %s', path) );
}
} catch (e) {
logger.error( i18n('Cannot parse %s, %s', path, e ) );
throw e;
}
<<<<<<<
/**
* Prepend fixtures to body if they exist for current test
* @param {Object} test Test object
* @param {String} testId The testId to be used in the DOM id
* @param {String} harnessTemplate An HTML string
* @returns {String} String representing the harness template HTML
*/
Executor.prototype.loadFixtures = function(test, testId, harnessTemplate) {
var fixtureContent = test.annotations[testcase.annotation.VENUS_FIXTURE],
fixtureId = 'fixture_' + testId,
fixturePartialReference;
=======
// Set up routes
Executor.prototype.initRoutes = function() {
var app = this.app,
port = this.port,
exec = this,
tests = this.testgroup.tests,
host = hostname,
routeKey,
routes = this.config.routes;
>>>>>>>
/**
* Prepend fixtures to body if they exist for current test
* @param {Object} test Test object
* @param {String} testId The testId to be used in the DOM id
* @param {String} harnessTemplate An HTML string
* @returns {String} String representing the harness template HTML
*/
Executor.prototype.loadFixtures = function(test, testId, harnessTemplate) {
var fixtureContent = test.annotations[testcase.annotation.VENUS_FIXTURE],
fixtureId = 'fixture_' + testId,
fixturePartialReference;
<<<<<<<
return false;
};
/**
* Responds to /sandbox/:testid route
* @param {Object} request Request object
* @param {Object} response Response object
*/
Executor.prototype.handleSandboxPage = function(request, response) {
var tests = this.testgroup.tests,
testId = request.params.testid,
test = tests[testId],
fixtureContent,
templateData,
harnessTemplate,
harnessTemplateId;
// Check if testid is valid and in the currently loaded testgroup
if (!test || !test.harnessTemplate) {
return response.status(404).json(
{ error: 'TestId ' + testId + ' does not exist' }
);
=======
// Set up routes explicitly defined in the config.
if (routes) {
for (routeKey in routes) {
app.get(
'/' + routeKey,
function(request, response) {
fs.readFile(
routes[routeKey],
function(err, data) {
if (err) {
throw err;
}
response.send(data);
});
});
}
>>>>>>>
return false;
};
/**
* Responds to /sandbox/:testid route
* @param {Object} request Request object
* @param {Object} response Response object
*/
Executor.prototype.handleSandboxPage = function(request, response) {
var tests = this.testgroup.tests,
testId = request.params.testid,
test = tests[testId],
fixtureContent,
templateData,
harnessTemplate,
harnessTemplateId;
// Check if testid is valid and in the currently loaded testgroup
if (!test || !test.harnessTemplate) {
return response.status(404).json(
{ error: 'TestId ' + testId + ' does not exist' }
);
<<<<<<<
/**
* Responds to /results/:testid route
* @param {Object} request Request object
* @param {Object} response Response object
*/
Executor.prototype.handleResultsPage = function(request, response) {
var testId = request.params.testid,
test = tests[testId];
// Check if testid is valid and in the currently loaded testgroup
if(!test) {
return response.status(404).json(
{ error: 'TestId ' + testId + ' does not exist' }
);
}
// Print test results
console.log('\nTEST FILE: '.cyan + test.path.cyan);
this.printResults(JSON.parse(request.body));
process.exit(1);
};
/**
* Responds to / route
* @param {Object} request Request object
* @param {Object} response Response object
*/
Executor.prototype.handleIndexPage = function(request, response) {
var data = { tests: [] },
tests = this.testgroup.tests;
Object.keys(tests).forEach(function (key) {
data.tests.push(tests[key]);
});
response.render( 'executor/index', data );
};
/**
* Processes routes
* @param {Object} request Request object
* @param {Object} response Response object
*/
Executor.prototype.processRoute = function (routeFile) {
return function (request, response) {
fs.readFile(routeFile, function(err, data) {
=======
// Set template data, and render the Dust template
templateData = {
postTestResultsUrl: exec.urlNamespace + '/results/' + testId,
testSandboxUrl: exec.urlNamespace + '/sandbox/' + testId,
testId: testId
};
harnessTemplate = configHelper.loadTemplate('default');
harnessTemplateId = 'harness-' + testId;
dust.loadSource(dust.compile(harnessTemplate, harnessTemplateId));
dust.render(harnessTemplateId, templateData, function(err, out) {
>>>>>>>
/**
* Responds to /results/:testid route
* @param {Object} request Request object
* @param {Object} response Response object
*/
Executor.prototype.handleResultsPage = function(request, response) {
var testId = request.params.testid,
test = tests[testId];
// Check if testid is valid and in the currently loaded testgroup
if(!test) {
return response.status(404).json(
{ error: 'TestId ' + testId + ' does not exist' }
);
}
// Print test results
console.log('\nTEST FILE: '.cyan + test.path.cyan);
this.printResults(JSON.parse(request.body));
process.exit(1);
};
/**
* Responds to / route
* @param {Object} request Request object
* @param {Object} response Response object
*/
Executor.prototype.handleIndexPage = function(request, response) {
var data = { tests: [] },
tests = this.testgroup.tests;
Object.keys(tests).forEach(function (key) {
data.tests.push(tests[key]);
});
response.render( 'executor/index', data );
};
/**
* Processes routes
* @param {Object} request Request object
* @param {Object} response Response object
*/
Executor.prototype.processRoute = function (routeFile) {
return function (request, response) {
fs.readFile(routeFile, function(err, data) {
// // Set template data, and render the Dust template
// templateData = {
// postTestResultsUrl: exec.urlNamespace + '/results/' + testId,
// testSandboxUrl: exec.urlNamespace + '/sandbox/' + testId,
// testId: testId
// };
// harnessTemplate = configHelper.loadTemplate('default');
// harnessTemplateId = 'harness-' + testId;
// dust.loadSource(dust.compile(harnessTemplate, harnessTemplateId));
// dust.render(harnessTemplateId, templateData, function(err, out) { |
<<<<<<<
import { EventDispatcher } from '../core/EventDispatcher';
import { UVMapping } from '../constants';
import { MirroredRepeatWrapping, ClampToEdgeWrapping, RepeatWrapping, LinearEncoding, UnsignedByteType, RGBAFormat, LinearMipMapLinearFilter, LinearFilter } from '../constants';
import { _Math } from '../math/Math';
import { Vector2 } from '../math/Vector2';
import { Matrix3 } from '../math/Matrix3';
=======
>>>>>>> |
<<<<<<<
_currentCamera = null,
_currentArrayCamera = null,
=======
// geometry and program caching
const _currentGeometryProgram = {
geometry: null,
program: null,
wireframe: false
};
let _currentCamera = null;
let _currentArrayCamera = null;
>>>>>>>
let _currentCamera = null;
let _currentArrayCamera = null; |
<<<<<<<
// if ( x.length() === 0 ) x.set( 1, 0, 0 );
// if ( y.length() === 0 ) y.set( 0, 1, 0 );
/* this.n11 = x.x; this.n12 = x.y; this.n13 = x.z; this.n14 = - x.dot( eye );
this.n21 = y.x; this.n22 = y.y; this.n23 = y.z; this.n24 = - y.dot( eye );
this.n31 = z.x; this.n32 = z.y; this.n33 = z.z; this.n34 = - z.dot( eye );
this.n41 = 0; this.n42 = 0; this.n43 = 0; this.n44 = 1;
*/
this.n11 = x.x; this.n12 = y.x; this.n13 = z.x; this.n14 = eye.x;
this.n21 = x.y; this.n22 = y.y; this.n23 = z.y; this.n24 = eye.y;
this.n31 = x.z; this.n32 = y.z; this.n33 = z.z; this.n34 = eye.z;
=======
this.n11 = x.x; this.n12 = y.x; this.n13 = z.x;
this.n21 = x.y; this.n22 = y.y; this.n23 = z.y;
this.n31 = x.z; this.n32 = y.z; this.n33 = z.z;
>>>>>>>
this.n11 = x.x; this.n12 = y.x; this.n13 = z.x; this.n14 = eye.x;
this.n21 = x.y; this.n22 = y.y; this.n23 = z.y; this.n24 = eye.y;
this.n31 = x.z; this.n32 = y.z; this.n33 = z.z; this.n34 = eye.z; |
<<<<<<<
var position = geometry.attributes.position;
if ( position.isInterleavedBufferAttribute ) {
count = position.data.count;
extension[ gl.isWebGL2 ? 'drawArraysInstanced' : 'drawArraysInstancedANGLE' ]( mode, 0, count, geometry.maxInstancedCount );
} else {
extension[ gl.isWebGL2 ? 'drawArraysInstanced' : 'drawArraysInstancedANGLE' ]( mode, start, count, geometry.maxInstancedCount );
}
=======
extension.drawArraysInstancedANGLE( mode, start, count, geometry.maxInstancedCount );
>>>>>>>
extension[ gl.isWebGL2 ? 'drawArraysInstanced' : 'drawArraysInstancedANGLE' ]( mode, start, count, geometry.maxInstancedCount ); |
<<<<<<<
/**
* @author alteredq / http://alteredqualia.com/
* @author mrdoob / http://mrdoob.com/
* @author WestLangley / http://github.com/WestLangley
*/
function SpotLightHelper( light, color ) {
=======
function SpotLightHelper( light ) {
>>>>>>>
function SpotLightHelper( light, color ) { |
<<<<<<<
=======
if ( raycaster.camera === null ) {
console.error( 'THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.' );
}
if ( _uvC === undefined ) {
_intersectPoint = new Vector3();
_worldScale = new Vector3();
_mvPosition = new Vector3();
_alignedPosition = new Vector2();
_rotatedPosition = new Vector2();
_viewWorldMatrix = new Matrix4();
_vA = new Vector3();
_vB = new Vector3();
_vC = new Vector3();
_uvA = new Vector2();
_uvB = new Vector2();
_uvC = new Vector2();
}
>>>>>>>
if ( raycaster.camera === null ) {
console.error( 'THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.' );
} |
<<<<<<<
if( material.length == 0 ) return;
material = material[ currentMaterialSlot ]
=======
>>>>>>> |
<<<<<<<
return _clearAlpha;
=======
THREE.warn( 'THREE.WebGLRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.' );
this.setClearColor( hex, alpha );
>>>>>>>
return _clearAlpha;
<<<<<<<
console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( ' + texture.sourceFile + ' )' );
=======
THREE.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT is set to THREE.ClampToEdgeWrapping. ( ' + texture.sourceFile + ' )' );
>>>>>>>
THREE.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( ' + texture.sourceFile + ' )' );
<<<<<<<
console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( ' + texture.sourceFile + ' )' );
=======
THREE.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter is set to THREE.LinearFilter or THREE.NearestFilter. ( ' + texture.sourceFile + ' )' );
>>>>>>>
THREE.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( ' + texture.sourceFile + ' )' ); |
<<<<<<<
'menubar/add/tetrahedron': 'Tetrahedron',
=======
'menubar/add/octahedron': 'Octahedron',
>>>>>>>
'menubar/add/octahedron': 'Octahedron',
'menubar/add/tetrahedron': 'Tetrahedron',
<<<<<<<
'sidebar/geometry/tetrahedron_geometry/radius': 'Radius',
'sidebar/geometry/tetrahedron_geometry/detail': 'Detail',
=======
'sidebar/geometry/octahedron_geometry/radius': 'Radius',
'sidebar/geometry/octahedron_geometry/detail': 'Detail',
>>>>>>>
'sidebar/geometry/octahedron_geometry/radius': 'Radius',
'sidebar/geometry/octahedron_geometry/detail': 'Detail',
'sidebar/geometry/tetrahedron_geometry/radius': 'Radius',
'sidebar/geometry/tetrahedron_geometry/detail': 'Detail', |
<<<<<<<
"FlyControls": "examples/en/controls/FlyControls",
"OrbitControls": "examples/en/controls/OrbitControls"
=======
"OrbitControls": "examples/en/controls/OrbitControls",
"PointerLockControls": "examples/en/controls/PointerLockControls"
>>>>>>>
"FlyControls": "examples/en/controls/FlyControls",
"OrbitControls": "examples/en/controls/OrbitControls",
"PointerLockControls": "examples/en/controls/PointerLockControls"
<<<<<<<
"FlyControls": "examples/zh/controls/FlyControls",
"OrbitControls": "examples/zh/controls/OrbitControls"
=======
"OrbitControls": "examples/zh/controls/OrbitControls",
"PointerLockControls": "examples/zh/controls/PointerLockControls"
>>>>>>>
"FlyControls": "examples/zh/controls/FlyControls",
"OrbitControls": "examples/zh/controls/OrbitControls",
"PointerLockControls": "examples/zh/controls/PointerLockControls" |
<<<<<<<
"lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "objectSpaceNormalMap", "tangentSpaceNormalMap", "clearCoatNormalMap", "displacementMap", "specularMap",
=======
"lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "objectSpaceNormalMap", "clearcoatNormalMap", "displacementMap", "specularMap",
>>>>>>>
"lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "objectSpaceNormalMap", "tangentSpaceNormalMap", "clearcoatNormalMap", "displacementMap", "specularMap",
<<<<<<<
tangentSpaceNormalMap: material.normalMapType === TangentSpaceNormalMap,
clearCoatNormalMap: !! material.clearCoatNormalMap,
=======
clearcoatNormalMap: !! material.clearcoatNormalMap,
>>>>>>>
tangentSpaceNormalMap: material.normalMapType === TangentSpaceNormalMap,
clearcoatNormalMap: !! material.clearcoatNormalMap, |
<<<<<<<
var cache = this.primitiveCache;
return this._withDependencies( [
=======
return this.getDependencies( 'accessor' ).then( function ( accessors ) {
>>>>>>>
var cache = this.primitiveCache;
return this.getDependencies( 'accessor' ).then( function ( accessors ) { |
<<<<<<<
{ path: 'misc/CarControls.js', dependencies: [], ignoreList: [] },
=======
{ path: 'misc/Ocean.js', dependencies: [ { name: 'OceanShaders', path: 'shaders/OceanShaders.js' } ], ignoreList: [] },
>>>>>>>
{ path: 'misc/CarControls.js', dependencies: [], ignoreList: [] },
{ path: 'misc/Ocean.js', dependencies: [ { name: 'OceanShaders', path: 'shaders/OceanShaders.js' } ], ignoreList: [] }, |
<<<<<<<
},
// Normalize UVs to be from <0,1>
// (for now just the first set of UVs)
normalizeUVs: function ( geometry ) {
var uvSet = geometry.faceVertexUvs[ 0 ];
for ( var i = 0, il = uvSet.length; i < il; i ++ ) {
var uvs = uvSet[ i ];
=======
return new THREE.Vector3( dx, dy, dz );
}
>>>>>>>
return new THREE.Vector3( dx, dy, dz );
},
// Normalize UVs to be from <0,1>
// (for now just the first set of UVs)
normalizeUVs: function ( geometry ) {
var uvSet = geometry.faceVertexUvs[ 0 ];
for ( var i = 0, il = uvSet.length; i < il; i ++ ) {
var uvs = uvSet[ i ]; |
<<<<<<<
var utils, bindingStates;
=======
let utils;
>>>>>>>
let utils, bindingStates;
<<<<<<<
attributes = new WebGLAttributes( _gl );
bindingStates = new WebGLBindingStates( _gl, extensions, attributes, capabilities );
geometries = new WebGLGeometries( _gl, attributes, info, bindingStates );
=======
attributes = new WebGLAttributes( _gl, capabilities );
geometries = new WebGLGeometries( _gl, attributes, info );
>>>>>>>
attributes = new WebGLAttributes( _gl, capabilities );
bindingStates = new WebGLBindingStates( _gl, extensions, attributes, capabilities );
geometries = new WebGLGeometries( _gl, attributes, info, bindingStates );
<<<<<<<
programCache = new WebGLPrograms( _this, extensions, capabilities, textures, bindingStates );
=======
programCache = new WebGLPrograms( _this, extensions, capabilities );
materials = new WebGLMaterials( properties );
>>>>>>>
programCache = new WebGLPrograms( _this, extensions, capabilities, bindingStates );
materials = new WebGLMaterials( properties );
<<<<<<<
=======
let updateBuffers = false;
if ( _currentGeometryProgram.geometry !== geometry.id ||
_currentGeometryProgram.program !== program.id ||
_currentGeometryProgram.wireframe !== ( material.wireframe === true ) ) {
_currentGeometryProgram.geometry = geometry.id;
_currentGeometryProgram.program = program.id;
_currentGeometryProgram.wireframe = material.wireframe === true;
updateBuffers = true;
}
if ( material.morphTargets || material.morphNormals ) {
morphtargets.update( object, geometry, material, program );
updateBuffers = true;
}
if ( object.isInstancedMesh === true ) {
updateBuffers = true;
}
>>>>>>>
<<<<<<<
if ( object.morphTargetInfluences ) {
morphtargets.update( object, geometry, material, program );
}
bindingStates.setup( object, material, program, geometry, index );
var attribute;
var renderer = bufferRenderer;
=======
let attribute;
let renderer = bufferRenderer;
>>>>>>>
if ( material.morphTargets || material.morphNormals ) {
morphtargets.update( object, geometry, material, program );
}
bindingStates.setup( object, material, program, geometry, index );
let attribute;
let renderer = bufferRenderer;
<<<<<<<
=======
function setupVertexAttributes( object, geometry, material, program ) {
if ( capabilities.isWebGL2 === false && ( object.isInstancedMesh || geometry.isInstancedBufferGeometry ) ) {
if ( extensions.get( 'ANGLE_instanced_arrays' ) === null ) return;
}
state.initAttributes();
const geometryAttributes = geometry.attributes;
const programAttributes = program.getAttributes();
const materialDefaultAttributeValues = material.defaultAttributeValues;
for ( const name in programAttributes ) {
const programAttribute = programAttributes[ name ];
if ( programAttribute >= 0 ) {
const geometryAttribute = geometryAttributes[ name ];
if ( geometryAttribute !== undefined ) {
const normalized = geometryAttribute.normalized;
const size = geometryAttribute.itemSize;
const attribute = attributes.get( geometryAttribute );
// TODO Attribute may not be available on context restore
if ( attribute === undefined ) continue;
const buffer = attribute.buffer;
const type = attribute.type;
const bytesPerElement = attribute.bytesPerElement;
if ( geometryAttribute.isInterleavedBufferAttribute ) {
const data = geometryAttribute.data;
const stride = data.stride;
const offset = geometryAttribute.offset;
if ( data && data.isInstancedInterleavedBuffer ) {
state.enableAttributeAndDivisor( programAttribute, data.meshPerAttribute );
if ( geometry._maxInstanceCount === undefined ) {
geometry._maxInstanceCount = data.meshPerAttribute * data.count;
}
} else {
state.enableAttribute( programAttribute );
}
_gl.bindBuffer( _gl.ARRAY_BUFFER, buffer );
state.vertexAttribPointer( programAttribute, size, type, normalized, stride * bytesPerElement, offset * bytesPerElement );
} else {
if ( geometryAttribute.isInstancedBufferAttribute ) {
state.enableAttributeAndDivisor( programAttribute, geometryAttribute.meshPerAttribute );
if ( geometry._maxInstanceCount === undefined ) {
geometry._maxInstanceCount = geometryAttribute.meshPerAttribute * geometryAttribute.count;
}
} else {
state.enableAttribute( programAttribute );
}
_gl.bindBuffer( _gl.ARRAY_BUFFER, buffer );
state.vertexAttribPointer( programAttribute, size, type, normalized, 0, 0 );
}
} else if ( name === 'instanceMatrix' ) {
const attribute = attributes.get( object.instanceMatrix );
// TODO Attribute may not be available on context restore
if ( attribute === undefined ) continue;
const buffer = attribute.buffer;
const type = attribute.type;
state.enableAttributeAndDivisor( programAttribute + 0, 1 );
state.enableAttributeAndDivisor( programAttribute + 1, 1 );
state.enableAttributeAndDivisor( programAttribute + 2, 1 );
state.enableAttributeAndDivisor( programAttribute + 3, 1 );
_gl.bindBuffer( _gl.ARRAY_BUFFER, buffer );
_gl.vertexAttribPointer( programAttribute + 0, 4, type, false, 64, 0 );
_gl.vertexAttribPointer( programAttribute + 1, 4, type, false, 64, 16 );
_gl.vertexAttribPointer( programAttribute + 2, 4, type, false, 64, 32 );
_gl.vertexAttribPointer( programAttribute + 3, 4, type, false, 64, 48 );
} else if ( materialDefaultAttributeValues !== undefined ) {
const value = materialDefaultAttributeValues[ name ];
if ( value !== undefined ) {
switch ( value.length ) {
case 2:
_gl.vertexAttrib2fv( programAttribute, value );
break;
case 3:
_gl.vertexAttrib3fv( programAttribute, value );
break;
case 4:
_gl.vertexAttrib4fv( programAttribute, value );
break;
default:
_gl.vertexAttrib1fv( programAttribute, value );
}
}
}
}
}
state.disableUnusedAttributes();
}
>>>>>>> |
<<<<<<<
drawText : function(text) {
var characterpts = [], pts = [];
=======
drawText : function( text ) {
var pts = [];
>>>>>>>
drawText : function( text ) {
var characterpts = [], pts = [];
<<<<<<<
extractGlyphPoints : function(c, face, scale, offset){
var i, cpx, cpy, outline, action, length,
glyph = face.glyphs[c] || face.glyphs[ctxt.options.fallbackCharacter];
var pts = [];
=======
extractGlyphPoints : function( pts, c, face, scale, offset ) {
var i, i2,
outline, action, length,
scaleX, scaleY,
x, y, cpx, cpy, cpx0, cpy0, cpx1, cpy1, cpx2, cpy2,
laste,
glyph = face.glyphs[ c ] || face.glyphs[ ctxt.options.fallbackCharacter ];
>>>>>>>
extractGlyphPoints : function( c, face, scale, offset ) {
var pts = [];
var i, i2,
outline, action, length,
scaleX, scaleY,
x, y, cpx, cpy, cpx0, cpy0, cpx1, cpy1, cpx2, cpy2,
laste,
glyph = face.glyphs[ c ] || face.glyphs[ ctxt.options.fallbackCharacter ];
<<<<<<<
for (var i2 = 1, divisions = this.divisions;i2<=divisions;i2++) {
var t = i2/divisions;
var tx = THREE.FontUtils.b3(t, cpx0, cpx1, cpx2, cpx);
var ty = THREE.FontUtils.b3(t, cpy0, cpy1, cpy2, cpy);
pts.push(new THREE.Vector2(tx, ty));
}
}
break;
}
}
}
return { offset: glyph.ha*scale, points:pts };
}
=======
for ( i2 = 1, divisions = this.divisions; i2 <= divisions; i2++ ) {
>>>>>>>
for ( i2 = 1, divisions = this.divisions; i2 <= divisions; i2++ ) { |
<<<<<<<
var label = Ti.UI.createLabel({
color: (i === 0 && !!args.tabs.activeColor) ? args.tabs.activeColor : args.tabs.color,
=======
tabs[i].add(Ti.UI.createLabel({
color: "#000",
font: args.tabs.font,
>>>>>>>
var label = Ti.UI.createLabel({
color: (i === 0 && !!args.tabs.activeColor) ? args.tabs.activeColor : args.tabs.color,
font: args.tabs.font, |
<<<<<<<
// restrict this to $.scrollableView to support nesting scrollableViews
if (e.source.id === $.scrollableView.id){
// update the indicator position
$.indicator.setLeft(e.currentPageAsFloat * $.iWidth);
args.tabs && updateOffset(e.currentPageAsFloat);
}
=======
if(e.source !== $.scrollableView)
return;
// update the indicator position
$.indicator.setLeft(e.currentPageAsFloat * $.iWidth);
args.tabs && updateOffset(e.currentPageAsFloat);
>>>>>>>
// restrict this to $.scrollableView to support nesting scrollableViews
if(e.source !== $.scrollableView)
return;
// update the indicator position
$.indicator.setLeft(e.currentPageAsFloat * $.iWidth);
args.tabs && updateOffset(e.currentPageAsFloat); |
<<<<<<<
material = opaque.list[ i ];
setDepthTest( material.depthTest );
renderBuffer( camera, lights, fog, material, buffer, object );
}
=======
setDepthTest( material.depthTest );
setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits );
renderBuffer( camera, lights, fog, material, buffer, object );
>>>>>>>
material = opaque.list[ i ];
setDepthTest( material.depthTest );
setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits );
renderBuffer( camera, lights, fog, material, buffer, object );
} |
<<<<<<<
#ifdef REFLECTIVITY
uniform float reflectivity;
#endif
#ifdef CLEARCOAT
uniform float clearCoat;
uniform float clearCoatRoughness;
=======
#ifdef PHYSICAL
uniform float clearcoat;
uniform float clearcoatRoughness;
#endif
#ifdef USE_SHEEN
uniform vec3 sheen;
>>>>>>>
#ifdef REFLECTIVITY
uniform float reflectivity;
#endif
#ifdef CLEARCOAT
uniform float clearcoat;
uniform float clearcoatRoughness;
#endif
#ifdef USE_SHEEN
uniform vec3 sheen; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.