conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
function createAndProcess(transactionDataArg, senderArg, cb) {
var transferObject = {
amount: transactionDataArg.amount,
passphrase: transactionDataArg.passphrase,
secondPassphrase: transactionDataArg.secondPassphrase,
recipientId: transactionDataArg.recipientId,
=======
function createAndProcess(transactionData, sender, cb) {
const transferObject = {
amount: transactionData.amount,
passphrase: transactionData.passphrase,
secondPassphrase: transactionData.secondPassphrase,
recipientId: transactionData.recipientId,
>>>>>>>
function createAndProcess(transactionDataArg, senderArg, cb) {
const transferObject = {
amount: transactionDataArg.amount,
passphrase: transactionDataArg.passphrase,
secondPassphrase: transactionDataArg.secondPassphrase,
recipientId: transactionDataArg.recipientId,
<<<<<<<
(_err, accountBefore) => {
var amount = new Bignum(validTransaction.amount.toString()).plus(
=======
(err, accountBefore) => {
const amount = new Bignum(validTransaction.amount.toString()).plus(
>>>>>>>
(_err, accountBefore) => {
const amount = new Bignum(validTransaction.amount.toString()).plus(
<<<<<<<
(_err, accountBefore) => {
var balanceBefore = new Bignum(accountBefore.balance.toString());
=======
(err, accountBefore) => {
const balanceBefore = new Bignum(accountBefore.balance.toString());
>>>>>>>
(_err, accountBefore) => {
const balanceBefore = new Bignum(accountBefore.balance.toString());
<<<<<<<
(_err, accountBefore) => {
var balanceBefore = new Bignum(accountBefore.balance.toString());
=======
(err, accountBefore) => {
const balanceBefore = new Bignum(accountBefore.balance.toString());
>>>>>>>
(_err, accountBefore) => {
const balanceBefore = new Bignum(accountBefore.balance.toString()); |
<<<<<<<
=======
async processBlock(block, lastBlock, broadcast) {
const enhancedBlock = !broadcast
? blocksUtils.addBlockProperties(block)
: block;
const normalizedBlock = blocksLogic.objectNormalize(
enhancedBlock,
this.exceptions,
);
const { verified, errors } = this.blocksVerify.verifyBlock(
normalizedBlock,
lastBlock,
);
if (!verified) {
throw errors;
}
await this.blocksVerify.checkExists(normalizedBlock);
if (typeof broadcast === 'function') {
broadcast(normalizedBlock);
}
await this.blocksVerify.validateBlockSlot(normalizedBlock);
await this.blocksVerify.checkTransactions(normalizedBlock);
await this.blocksChain.applyBlock(normalizedBlock, true);
return normalizedBlock;
}
async applyBlock(block, lastBlock) {
const enhancedBlock = blocksUtils.addBlockProperties(block);
const normalizedBlock = blocksLogic.objectNormalize(
enhancedBlock,
this.exceptions,
);
const { verified, errors } = this.blocksVerify.verifyBlock(
normalizedBlock,
lastBlock,
);
if (!verified) {
throw errors;
}
await this.blocksVerify.validateBlockSlot(normalizedBlock);
await this.blocksVerify.checkTransactions(normalizedBlock);
await this.blocksChain.applyBlock(normalizedBlock, false);
return normalizedBlock;
}
async generateBlock(lastBlock, keypair, timestamp, transactions) {
const context = {
blockTimestamp: timestamp,
};
const allowedTransactionsIds = transactionsModule
.checkAllowedTransactions(context)(transactions)
.transactionsResponses.filter(
transactionResponse =>
transactionResponse.status === TransactionStatus.OK,
)
.map(transactionReponse => transactionReponse.id);
const allowedTransactions = transactions.filter(transaction =>
allowedTransactionsIds.includes(transaction.id),
);
const {
transactionsResponses: responses,
} = await transactionsModule.applyTransactions(this.storage, this.slots)(
allowedTransactions,
);
const readyTransactions = allowedTransactions.filter(transaction =>
responses
.filter(response => response.status === TransactionStatus.OK)
.map(response => response.id)
.includes(transaction.id),
);
return blocksLogic.create({
blockReward: this.blockReward,
previousBlock: lastBlock,
transactions: readyTransactions,
maxPayloadLength: this.constants.maxPayloadLength,
keypair,
timestamp,
prevotedConfirmedUptoHeight: 1,
maxHeightPreviouslyForged: 1,
height: lastBlock.height + 1,
version: blockVersion.getBlockVersion(lastBlock.height + 1),
});
}
>>>>>>>
<<<<<<<
=======
async reload(targetHeight, isCleaning, onProgress, loadPerIteration = 1000) {
await this.storage.entities.Account.resetMemTables();
const lastBlock = await this._rebuild(
1,
undefined,
targetHeight,
isCleaning,
onProgress,
loadPerIteration,
);
return lastBlock;
}
async _rebuild(
currentHeight,
initialBlock,
targetHeight,
isCleaning,
onProgress,
loadPerIteration,
) {
const limit = loadPerIteration;
const blocks = await blocksLogic.loadBlocksWithOffset(
this.storage,
this.interfaceAdapters,
this.genesisBlock,
limit,
currentHeight,
);
let lastBlock = initialBlock;
// eslint-disable-next-line no-restricted-syntax
for (const block of blocks) {
if (isCleaning() || block.height > targetHeight) {
return lastBlock;
}
if (block.id === this.genesisBlock.id) {
// eslint-disable-next-line no-await-in-loop
lastBlock = await this.blocksChain.applyGenesisBlock(block);
onProgress(lastBlock);
// eslint-disable-next-line no-continue
continue;
}
// eslint-disable-next-line no-await-in-loop
lastBlock = await this.applyBlock(block, lastBlock);
onProgress(lastBlock);
}
const nextCurrentHeight = lastBlock.height + 1;
if (nextCurrentHeight < targetHeight) {
return this._rebuild(
nextCurrentHeight,
lastBlock,
targetHeight,
isCleaning,
onProgress,
loadPerIteration,
);
}
return lastBlock;
}
>>>>>>> |
<<<<<<<
const modulesDelegatesStub = {
=======
const modulesProcessTransactionsStub = {
verifyTransactions: sinonSandbox.stub(),
checkAllowedTransactions: sinonSandbox.stub(),
};
const modulesRoundsStub = {
>>>>>>>
const modulesRoundsStub = {
<<<<<<<
expect(modules.delegates).to.equal(bindingsStub.modules.delegates);
expect(modules.transactionPool).to.equal(
bindingsStub.modules.transactionPool
=======
expect(modules.rounds).to.equal(bindingsStub.modules.rounds);
expect(modules.transactions).to.equal(bindingsStub.modules.transactions);
expect(modules.processTransactions).to.equal(
bindingsStub.modules.processTransactions
>>>>>>>
expect(modules.rounds).to.equal(bindingsStub.modules.rounds);
expect(modules.transactionPool).to.equal(
bindingsStub.modules.transactionPool |
<<<<<<<
var transfer = new Transfer(modulesLoader.scope.logger, modulesLoader.scope.schema);
transfer.bind(__accountModule, rounds);
=======
var transfer = new Transfer();
transfer.bind(__accountModule);
>>>>>>>
var transfer = new Transfer(modulesLoader.scope.logger, modulesLoader.scope.schema);
transfer.bind(__accountModule); |
<<<<<<<
let bindings;
=======
let modules;
let __private;
>>>>>>>
let bindings;
let __private; |
<<<<<<<
const { convertErrorsToString } = require('./utils/error_handlers');
const Sequence = require('./utils/sequence');
const ed = require('./utils/ed');
=======
const { convertErrorsToString } = require('./helpers/error_handlers');
const Sequence = require('./helpers/sequence');
>>>>>>>
const { convertErrorsToString } = require('./utils/error_handlers');
const Sequence = require('./utils/sequence'); |
<<<<<<<
var _ = require('lodash');
var sandboxHelper = require('../helpers/sandbox.js');
var constants = require('../helpers/constants.js');
=======
>>>>>>>
var _ = require('lodash');
var constants = require('../helpers/constants.js'); |
<<<<<<<
cy.wait(10000);
cy.url().should('include', '/admin/projects');
=======
cy.wait(5000);
cy.url({ timeout: 30000 }).should('include', '/stories');
// cy.url().then((url) => {
// This gets the project id
// const id = url.match(/project\/(.*?)\/nlu/i)[1];
// cy.writeFile('cypress/fixtures/bf_project_id.txt', id);
// });
// cy.url().then((url) => {
// // This gets the model id
// const id = url.split('/')[7];
// cy.writeFile('cypress/fixtures/bf_model_id.txt', id);
// });
// cy.get('[data-cy=example-text-editor-input]').should('exist'); // Test if a default instance is added
// cy.get('[data-cy=nlu-menu-settings]').click();
// cy.contains('Pipeline').click();
// cy.get(':checkbox').should('be.checked');
>>>>>>>
cy.wait(5000);
cy.url({ timeout: 30000 }).should('include', '/admin/projects'); |
<<<<<<<
class BlocksChain {
constructor({
storage,
interfaceAdapters,
roundsModule,
slots,
exceptions,
genesisBlock,
}) {
this.storage = storage;
this.interfaceAdapters = interfaceAdapters;
this.roundsModule = roundsModule;
this.slots = slots;
this.exceptions = exceptions;
this.genesisBlock = genesisBlock;
}
/**
* Save genesis block to database.
*
* @returns {Object} Block genesis block
*/
async saveGenesisBlock() {
// Check if genesis block ID already exists in the database
const isPersisted = await this.storage.entities.Block.isPersisted({
id: this.genesisBlock.id,
});
if (isPersisted) {
return;
}
// If there is no block with genesis ID - save to database
// WARNING: DB_WRITE
// FIXME: This will fail if we already have genesis block in database, but with different ID
const block = {
...this.genesisBlock,
transactions: this.interfaceAdapters.transactions.fromBlock(
this.genesisBlock
),
};
await saveBlock(this.storage, block);
}
/**
* Description of the function.
*
* @param {Object} block - Full normalized genesis block
* @param {function} cb - Callback function
* @returns {function} cb - Callback function from params (through setImmediate)
* @returns {Object} cb.err - Error if occurred
* @todo Add description for the function
*/
async applyBlock(block, shouldSave = true) {
await this.storage.entities.Block.begin('Chain:applyBlock', async tx => {
await applyConfirmedStep(
this.storage,
this.slots,
block,
this.exceptions,
tx
);
await saveBlockStep(
this.storage,
this.roundsModule,
block,
shouldSave,
tx
);
});
}
/**
* Apply genesis block's transactions to blockchain.
*
* @param {Object} block - Full normalized genesis block
* @param {function} cb - Callback function
* @returns {function} cb - Callback function from params (through setImmediate)
* @returns {Object} cb.err - Error if occurred
*/
async applyGenesisBlock(block) {
// Sort transactions included in block
block.transactions = block.transactions.sort(a => {
if (a.type === TRANSACTION_TYPES_VOTE) {
return 1;
}
return 0;
});
await applyGenesisBlockTransactions(
this.storage,
this.slots,
block.transactions,
this.exceptions
);
await new Promise((resolve, reject) => {
this.roundsModule.tick(block, tickErr => {
if (tickErr) {
return reject(tickErr);
}
return resolve();
});
});
return block;
}
/**
* Deletes last block.
* - Apply the block to database if both verifications are ok
* - Update headers: broadhash and height
* - Put transactions from deleted block back into transaction pool
*
* @param {function} cb - Callback function
* @returns {function} cb - Callback function from params (through setImmediate)
* @returns {Object} cb.err - Error if occurred
* @returns {Object} cb.obj - New last block
*/
async deleteLastBlock(lastBlock) {
if (lastBlock.height === 1) {
throw new Error('Cannot delete genesis block');
}
return this.storage.entities.Block.begin('Chain:deleteBlock', async tx => {
const previousBlock = await popLastBlock(
this.storage,
this.interfaceAdapters,
this.genesisBlock,
this.roundsModule,
this.slots,
lastBlock,
this.exceptions,
tx
);
return previousBlock;
});
}
async deleteLastBlockAndStoreInTemp(lastBlock) {
if (lastBlock.height === 1) {
throw new Error('Cannot delete genesis block');
}
return this.storage.entities.Block.begin(
'Chain:deleteBlockAndStoreInTemp',
async tx => {
const previousBlock = await popLastBlock(
this.storage,
this.interfaceAdapters,
this.genesisBlock,
this.roundsModule,
this.slots,
lastBlock,
this.exceptions,
tx
);
const parsedDeletedBlock = parseBlockToJson(lastBlock);
const blockTempEntry = {
id: parsedDeletedBlock.id,
height: parsedDeletedBlock.height,
fullBlock: parsedDeletedBlock,
};
await this.storage.entities.TempBlock.create(blockTempEntry, {}, tx);
return previousBlock;
}
);
}
}
=======
>>>>>>>
<<<<<<<
exceptions,
tx
) => {
const [storageResult] = await storage.entities.Block.get(
{ id: oldLastBlock.previousBlock },
{ extended: true },
tx
);
=======
exceptions,
) =>
storage.entities.Block.begin('Chain:deleteBlock', async tx => {
const [storageResult] = await storage.entities.Block.get(
{ id: oldLastBlock.previousBlock },
{ extended: true },
tx,
);
>>>>>>>
exceptions,
tx,
) => {
const [storageResult] = await storage.entities.Block.get(
{ id: oldLastBlock.previousBlock },
{ extended: true },
tx,
);
<<<<<<<
const secondLastBlock = storageRead(storageResult);
secondLastBlock.transactions = interfaceAdapters.transactions.fromBlock(
secondLastBlock
);
=======
const secondLastBlock = storageRead(storageResult);
secondLastBlock.transactions = interfaceAdapters.transactions.fromBlock(
secondLastBlock,
);
>>>>>>>
const secondLastBlock = storageRead(storageResult);
secondLastBlock.transactions = interfaceAdapters.transactions.fromBlock(
secondLastBlock,
); |
<<<<<<<
var failureCodes = require('../api/ws/rpc/failureCodes');
var PeerUpdateError = require('../api/ws/rpc/failureCodes').PeerUpdateError;
=======
var failureCodes = require('../api/ws/rpc/failure_codes');
var Peer = require('../logic/peer');
var PeerUpdateError = require('../api/ws/rpc/failure_codes').PeerUpdateError;
>>>>>>>
var failureCodes = require('../api/ws/rpc/failure_codes');
var PeerUpdateError = require('../api/ws/rpc/failure_codes').PeerUpdateError; |
<<<<<<<
import autocomplete from './components/autocomplete'
=======
import avatar from './components/avatar'
>>>>>>>
import autocomplete from './components/autocomplete'
import avatar from './components/avatar'
<<<<<<<
accordion(componentsStories)
autocomplete(componentsStories)
=======
accordion(componentsStories)
avatar(componentsStories)
>>>>>>>
accordion(componentsStories)
autocomplete(componentsStories)
avatar(componentsStories) |
<<<<<<<
export { Accordion, Header, Body } from '@react-spectre/accordion'
export { Autocomplete, Input, Menu } from '@react-spectre/autocomplete'
=======
export { Accordion, Header, Body } from '@react-spectre/accordion'
export { Avatar, Icon, Presence } from '@react-spectre/avatar'
>>>>>>>
export { Accordion, Header, Body } from '@react-spectre/accordion'
export { Autocomplete, Input, Menu } from '@react-spectre/autocomplete'
export { Avatar, Icon, Presence } from '@react-spectre/avatar' |
<<<<<<<
import { checkIfCan } from '../../lib/scopes';
=======
>>>>>>>
import { checkIfCan } from '../../lib/scopes';
<<<<<<<
import { auditLog } from '../../../server/logger';
export const extractDomainFromStories = (stories, slots) => yamlLoad(extractDomain(stories, slots, {}, {}, false));
=======
export const extractDomainFromStories = (stories, slots) => yamlLoad(extractDomain({ stories, slots, crashOnStoryWithErrors: false }));
>>>>>>>
import { auditLog } from '../../../server/logger';
export const extractDomainFromStories = (stories, slots) => yamlLoad(extractDomain({ stories, slots, crashOnStoryWithErrors: false }));
<<<<<<<
// Delete project related permissions for users (note: the role package does not provide
const projectUsers = Meteor.users.find({ [`roles.${project._id}`]: { $exists: true } }, { fields: { roles: 1 } }).fetch();
projectUsers.forEach(u => Meteor.users.update({ _id: u._id }, { $unset: { [`roles.${project._id}`]: '' } })); // Roles.removeUsersFromRoles doesn't seem to work so we unset manually
auditLog('Deleted project, all related data has been deleted', {
user: Meteor.user(),
resId: projectId,
type: 'deleted',
operation: 'project-deleted',
before: { projectBefore },
resType: 'project',
});
=======
>>>>>>>
// Delete project related permissions for users (note: the role package does not provide
const projectUsers = Meteor.users.find({ [`roles.${project._id}`]: { $exists: true } }, { fields: { roles: 1 } }).fetch();
projectUsers.forEach(u => Meteor.users.update({ _id: u._id }, { $unset: { [`roles.${project._id}`]: '' } })); // Roles.removeUsersFromRoles doesn't seem to work so we unset manually
auditLog('Deleted project, all related data has been deleted', {
user: Meteor.user(),
resId: projectId,
type: 'deleted',
operation: 'project-deleted',
before: { projectBefore },
resType: 'project',
}); |
<<<<<<<
</>
)}>
=======
</React.Fragment>
)}
position={STATISTIC_ORDER.OPTIONAL(4)}
>
>>>>>>>
</>
)}
position={STATISTIC_ORDER.OPTIONAL(4)}
> |
<<<<<<<
const mockClonePath = "/tmp/" + (Math.random().toString(36) + "00000").substr(2, 5)
=======
const ACCESS_TOKEN = "token"
describe("submissionClone", () => {
let getState, dispatch, cloneURLMock
const mockSubmission = {
id: 1,
username: "StudentEvelyn",
displayName: "Evelyn",
cloneStatus: "",
cloneProgress: 0
}
const mockAssignment = {
title: "Test Assignment",
type: "individual",
url: "http://classroom.github.com/classrooms/test-org/assignments/test-assignment",
isFetching: false,
error: null,
}
const mockSettings = {
cloneDestination: "/some/clone/path"
}
>>>>>>>
const mockClonePath = "/tmp/" + (Math.random().toString(36) + "00000").substr(2, 5)
const ACCESS_TOKEN = "token"
describe("submissionClone", () => {
let getState, dispatch, cloneURLMock
const mockSubmission = {
id: 1,
username: "StudentEvelyn",
displayName: "Evelyn",
cloneStatus: "",
cloneProgress: 0
}
const mockAssignment = {
title: "Test Assignment",
type: "individual",
url: "http://classroom.github.com/classrooms/test-org/assignments/test-assignment",
isFetching: false,
error: null,
}
const mockSettings = {
cloneDestination: "/some/clone/path"
}
<<<<<<<
it("dispatches an action to set the clone path of a submission", async () => {
const getState = () => ({ settings: { cloneDestination: mockClonePath }, assignment: { type: "individual" } })
const dispatch = sinon.spy()
const submissionClone = submissionCloneFunc(clone)
await submissionClone(mockSubmission, mockClonePath)(dispatch, getState)
=======
getState = () => ({
settings: mockSettings,
assignment: mockAssignment,
})
>>>>>>>
getState = () => ({
settings: mockSettings,
assignment: mockAssignment,
})
<<<<<<<
it("dispatches an action to set the clone status of a submission", async () => {
const getState = () => ({ settings: { cloneDestination: mockClonePath }, assignment: { type: "individual" } })
const dispatch = sinon.spy()
const submissionClone = submissionCloneFunc(clone)
await submissionClone(mockSubmission, mockClonePath)(dispatch, getState)
expect(dispatch.calledWithMatch({ type: "SUBMISSION_SET_CLONE_STATUS", id: 1 })).is.true
=======
afterEach(() => {
keytar.findPassword.restore()
>>>>>>>
afterEach(() => {
keytar.findPassword.restore()
<<<<<<<
const submissionClone = submissionCloneFunc(cloneMock)
await submissionClone(mockSubmission, mockClonePath)(dispatch, getState)
=======
it("removes user if password is missing (public repo)", async () => {
const url = "https://testuser:@github.com/test-org/test-assignment"
cloneURLMock.reply(200, {
temp_clone_url: url
})
>>>>>>>
it("removes user if password is missing (public repo)", async () => {
const url = "https://testuser:@github.com/test-org/test-assignment"
cloneURLMock.reply(200, {
temp_clone_url: url
})
<<<<<<<
it("dispatches an action to update the clone status when an error occurs", async () => {
const getState = () => ({ settings: { cloneDestination: mockClonePath }, assignment: { type: "individual" } })
const dispatch = sinon.spy()
const submissionClone = submissionCloneFunc(clone)
await submissionClone(mockSubmission, mockClonePath)(dispatch, getState)
=======
describe("#submissionCloneFunc", () => {
beforeEach(() => {
cloneURLMock.reply(200, {
temp_clone_url: "https://testuser:@github.com/test-org/test-assignment"
})
})
it("dispatches an action to set the clone path of a submission", async () => {
const submissionClone = submissionCloneFunc(clone)
await submissionClone(mockSubmission)(dispatch, getState)
>>>>>>>
describe("#submissionCloneFunc", () => {
beforeEach(() => {
cloneURLMock.reply(200, {
temp_clone_url: "https://testuser:@github.com/test-org/test-assignment"
})
})
it("dispatches an action to set the clone path of a submission", async () => {
const submissionClone = submissionCloneFunc(clone)
await submissionClone(mockSubmission, mockClonePath)(dispatch, getState)
<<<<<<<
const getState = () => ({ settings: { cloneDestination: mockClonePath }, assignment: { type: "individual" } })
const dispatch = sinon.spy()
const submissionClone = submissionCloneFunc(cloneMock)
await submissionClone(mockSubmission, mockClonePath)(dispatch, getState)
=======
const submissionClone = submissionCloneFunc(cloneMock)
await submissionClone(mockSubmission)(dispatch, getState)
>>>>>>>
const submissionClone = submissionCloneFunc(cloneMock)
await submissionClone(mockSubmission, mockClonePath)(dispatch, getState) |
<<<<<<<
this.toHexDOM_sub(node, "tag", this.stream, this.posStart(), this.posLen());
this.toHexDOM_sub(node, (this.length >= 0) ? "dlen" : "ulen", this.stream, this.posLen(), this.posContent());
=======
if (root == node) {
var lineStart = this.posStart() & 0xF;
if (lineStart != 0) {
var skip = DOM.tag("span", "skip");
var skipStr = '';
for (var j = lineStart; j > 0; --j)
skipStr += ' ';
if (lineStart >= 8)
skipStr += ' ';
skip.innerText = skipStr;
node.appendChild(skip);
}
}
this.toHexDOM_sub(node, "tag", this.stream, this.posStart(), this.posStart() + 1);
this.toHexDOM_sub(node, (this.length >= 0) ? "dlen" : "ulen", this.stream, this.posStart() + 1, this.posContent());
>>>>>>>
if (root == node) {
var lineStart = this.posStart() & 0xF;
if (lineStart != 0) {
var skip = DOM.tag("span", "skip");
var skipStr = '';
for (var j = lineStart; j > 0; --j)
skipStr += ' ';
if (lineStart >= 8)
skipStr += ' ';
skip.innerText = skipStr;
node.appendChild(skip);
}
}
this.toHexDOM_sub(node, "tag", this.stream, this.posStart(), this.posLen());
this.toHexDOM_sub(node, (this.length >= 0) ? "dlen" : "ulen", this.stream, this.posLen(), this.posContent()); |
<<<<<<<
const ratingConfig = require('./rating-config.js');
=======
const resourceInstanceReport = require('./resource-instance-report.js');
>>>>>>>
const ratingConfig = require('./rating-config.js');
const resourceInstanceReport = require('./resource-instance-report.js');
<<<<<<<
module.exports.ratingConfig = compile(ratingConfig());
=======
module.exports.resourceInstanceReport = compile(resourceInstanceReport());
>>>>>>>
module.exports.ratingConfig = compile(ratingConfig());
module.exports.resourceInstanceReport = compile(resourceInstanceReport()); |
<<<<<<<
var regions = this.regions || {};
=======
var that = this;
var regions;
if (_.isFunction(this.regions)) {
regions = this.regions(options);
} else {
regions = this.regions || {};
}
>>>>>>>
var regions;
if (_.isFunction(this.regions)) {
regions = this.regions(options);
} else {
regions = this.regions || {};
} |
<<<<<<<
if (hasEl) {
this._isAttached = this.Dom.hasEl(document.documentElement, this.el);
}
=======
this._isAttached = isNodeAttached(this.el);
>>>>>>>
this._isAttached = this.Dom.hasEl(document.documentElement, this.el); |
<<<<<<<
import getUniqueEventName from './utils/get-unique-event-name';
=======
import deprecate from './utils/deprecate';
import getNamespacedEventName from './utils/get-namespaced-event-name';
>>>>>>>
import getNamespacedEventName from './utils/get-namespaced-event-name';
<<<<<<<
if (!behaviorHandler) { return; }
key = getUniqueEventName(key);
events[key] = behaviorHandler.bind(this);
=======
if (!behaviorHandler) { return events; }
key = getNamespacedEventName(key, this.cid);
events[key] = _.bind(behaviorHandler, this);
>>>>>>>
if (!behaviorHandler) { return events; }
key = getNamespacedEventName(key, this.cid);
events[key] = behaviorHandler.bind(this); |
<<<<<<<
namespace: {
type: String,
unique: 1,
sparse: 1,
custom() {
return !this.value.match(/^bf-[a-zA-Z0-9-]+$/) ? 'invalidNamespace' : null;
},
},
modelsBucket: { type: String, regEx: /^[a-z0-9-_]+$/, optional: true },
nluThreshold: {
type: Number, defaultValue: 0.75, min: 0.5, max: 0.95,
},
timezoneOffset: {
type: Number, defaultValue: 0, min: -22, max: 22,
},
=======
enableSharing: { type: Boolean, defaultValue: false },
>>>>>>>
namespace: {
type: String,
unique: 1,
sparse: 1,
custom() {
return !this.value.match(/^bf-[a-zA-Z0-9-]+$/) ? 'invalidNamespace' : null;
},
},
modelsBucket: { type: String, regEx: /^[a-z0-9-_]+$/, optional: true },
nluThreshold: {
type: Number, defaultValue: 0.75, min: 0.5, max: 0.95,
},
timezoneOffset: {
type: Number, defaultValue: 0, min: -22, max: 22,
},
enableSharing: { type: Boolean, defaultValue: false },
<<<<<<<
invalidNamespace: 'The namespace must starts with \'bf-\' and can only contain letters, numbers and dashes (\'-\')',
},
=======
},
>>>>>>>
invalidNamespace: 'The namespace must starts with \'bf-\' and can only contain letters, numbers and dashes (\'-\')',
}, |
<<<<<<<
import Transition from './Transition/Transition';
=======
import Uploaded from './Uploaded/Uploaded';
>>>>>>>
import Transition from './Transition/Transition';
import Uploaded from './Uploaded/Uploaded'; |
<<<<<<<
{ test: /\.scss$/, loaders: [
'style',
'css' +
'?modules' +
'&localIdentName=[path][name]-[local]',
'postcss',
'sass' +
'?outputStyle=expanded',
] }
=======
{ test: /\.scss$/, loader: [
'style',
'css' +
'?modules' +
'&localIdentName=[path][name]-[local]',
'postcss',
'sass' +
'?outputStyle=expanded',
] },
>>>>>>>
{ test: /\.scss$/, loader: [
'style',
'css' +
'?modules' +
'&localIdentName=[path][name]-[local]',
'postcss',
'sass' +
'?outputStyle=expanded',
] } |
<<<<<<<
=======
import slugify from 'slugify';
import axios from 'axios';
import { safeLoad, safeDump } from 'js-yaml';
>>>>>>>
import { safeLoad, safeDump } from 'js-yaml';
<<<<<<<
=======
import {
getAppLoggerForFile,
getAppLoggerForMethod,
addLoggingInterceptors,
} from '../../server/logger';
const requestMailSubscription = async (email, firstName, lastName) => {
const mailChimpUrl = process.env.MAILING_LIST_URI
|| 'https://europe-west1-botfront-project.cloudfunctions.net/subscribeToMailchimp';
const appMethodLogger = getAppLoggerForMethod(
getAppLoggerForFile(__filename),
'requestMailSubscription',
Meteor.userId(),
{ email, firstName, lastName },
);
try {
const mailAxios = axios.create();
addLoggingInterceptors(mailAxios, appMethodLogger);
await mailAxios.post(mailChimpUrl, {
email_address: email,
status: 'subscribed',
merge_fields: {
FNAME: firstName,
LNAME: lastName,
},
});
} catch (e) {
appMethodLogger.error(
'Email subscription failed, probably because you\'ve already subscribed',
);
}
};
>>>>>>> |
<<<<<<<
Transition,
=======
Search,
>>>>>>>
Transition,
Search,
<<<<<<<
<Route path="search" /> {/* 搜索结果 */}
<Route path="transition/:type" component={Transition} /> {/* 跳转页面 */}
=======
<Route path="search" component={Search} /> {/* 搜索结果 */}
>>>>>>>
<Route path="search" /> {/* 搜索结果 */}
<Route path="transition/:type" component={Transition} /> {/* 跳转页面 */}
<Route path="search" component={Search} /> {/* 搜索结果 */} |
<<<<<<<
SAVE_TO_NEW_PROJECT,
SAVE_TO_PROJECT,
DELETE_PROJECT,
FETCH_MEMBERS_SUGGEST_LIST,
PATCH_USERS_PROJECT_DETAIL,
PATCH_PROJECT_MEMBERS,
POST_GENERATE_VERSION,
TETCH_PROJECT_VERSION,
=======
>>>>>>>
SAVE_TO_NEW_PROJECT,
DELETE_PROJECT,
FETCH_MEMBERS_SUGGEST_LIST,
PATCH_USERS_PROJECT_DETAIL,
PATCH_PROJECT_MEMBERS,
POST_GENERATE_VERSION,
TETCH_PROJECT_VERSION,
<<<<<<<
import { push } from 'react-router-redux';
import {
dumpIconLocalStorage,
getUserProjectInfo,
} from '../../actions/cart';
=======
>>>>>>>
import { push } from 'react-router-redux';
// dumpIconLocalStorage,
import {
getUserProjectInfo,
} from '../../actions/cart';
<<<<<<<
if (action.payload.res) {
return {
...state,
currentUserProjectInfo: action.payload.data,
};
}
return state;
}
case PATCH_USERS_PROJECT_DETAIL: {
if (action.payload.res) {
getUserProjectInfo(action.project.id);
}
return state;
}
case FETCH_MEMBERS_SUGGEST_LIST: {
if (action.payload.res) {
return {
...state,
memberSuggestList: action.payload.data,
};
}
return state;
}
case FETCH_PUBLIC_PROJECT_LIST: {
if (action.payload.res) {
return {
...state,
publicProjectList: action.payload.data,
};
}
return state;
}
case FETCH_PUBLIC_PROJECT_INFO: {
if (action.payload.res) {
return {
...state,
currentPublicProjectInfo: action.payload.data,
};
}
return state;
}
case PATCH_PROJECT_MEMBERS: {
if (action.payload.res) {
getUserProjectInfo(action.project.id);
}
return state;
}
case TETCH_PROJECT_VERSION: {
if (action.payload.res) {
return {
...state,
currentUserProjectVersions: action.payload.data.version,
};
}
return state;
}
case POST_GENERATE_VERSION: {
if (action.payload.res) {
getUserProjectInfo(action.project.id);
}
return state;
}
case SAVE_TO_NEW_PROJECT: {
// if (action.res) {
//
// }
return {
=======
return {
...state,
usersProject: action.payload.data.organization,
>>>>>>>
if (action.payload.res) {
return {
...state,
currentUserProjectInfo: action.payload.data,
};
}
return state;
}
case PATCH_USERS_PROJECT_DETAIL: {
if (action.payload.res) {
getUserProjectInfo(action.project.id);
}
return state;
}
case FETCH_MEMBERS_SUGGEST_LIST: {
if (action.payload.res) {
return {
...state,
memberSuggestList: action.payload.data,
};
}
return state;
}
case FETCH_PUBLIC_PROJECT_LIST: {
if (action.payload.res) {
return {
...state,
publicProjectList: action.payload.data,
};
}
return state;
}
case FETCH_PUBLIC_PROJECT_INFO: {
if (action.payload.res) {
return {
...state,
currentPublicProjectInfo: action.payload.data,
};
}
return state;
}
case PATCH_PROJECT_MEMBERS: {
if (action.payload.res) {
getUserProjectInfo(action.project.id);
}
return state;
}
case TETCH_PROJECT_VERSION: {
if (action.payload.res) {
return {
...state,
currentUserProjectVersions: action.payload.data.version,
};
}
return state;
}
case POST_GENERATE_VERSION: {
if (action.payload.res) {
getUserProjectInfo(action.project.id);
}
return state;
}
case SAVE_TO_NEW_PROJECT: {
return {
...state,
usersProject: action.payload.data.organization,
<<<<<<<
projectForSave: action.project,
};
}
case SAVE_TO_PROJECT: {
return (dispatch) => {
if (action.res) {
// TODO
// 处理存储成功的交互
dispatch(dumpIconLocalStorage);
} else {
// TODO
// 处理存储失败的交互
}
return state;
=======
projectForSave: action.payload,
>>>>>>>
projectForSave: action.payload, |
<<<<<<<
if (!value.length) throw new Error('日志缺少参数');
return value.map(v => `@${JSON.stringify({
=======
if (!value.length) throw new Error('日志缺少参数');
return value.map(v => JSON.stringify({
>>>>>>>
if (!value.length) throw new Error('日志缺少参数');
return value.map(v => `@${JSON.stringify({
<<<<<<<
}
export function has(Arr, o) {
let result = false;
if (typeof o === 'object') {
result = Arr.some(v => typeof v === 'object' && v.id === o.id);
} else {
result = Arr.some(v => v === o);
}
return result;
}
export function diffArray(oldArr, newArr) {
const deleted = oldArr.filter(v => !has(newArr, v));
const added = newArr.filter(v => !has(oldArr, v));
return { deleted, added };
}
export function analyzeLog(type, logString) {
const regExp = /@[^@]+@/g;
const logType = logTypes[type].match(/\w+[^\s]/g);
const logArr = logString.match(regExp).map(v => v.replace(/@/g, ''));
const logs = {};
if (logType.length > 1) {
logType.forEach((v, i) => Object.assign(logs, JSON.parse(logArr[i])));
return logs;
}
const key = logType[0];
logs[key] = logArr.map(v => JSON.parse(v)[key]);
return logs;
=======
}
export function has(Arr, o) {
if (typeof o === 'object') {
return Arr.some(v => typeof v === 'object' && v.id === o.id);
}
return Arr.some(v => v === o);
}
export function diffArray(oldArr, newArr) {
const deleted = oldArr.filter(v => !has(newArr, v));
const added = newArr.filter(v => !has(oldArr, v));
return { deleted, added };
>>>>>>>
}
export function has(Arr, o) {
if (typeof o === 'object') {
return Arr.some(v => typeof v === 'object' && v.id === o.id);
}
return Arr.some(v => v === o);
}
export function diffArray(oldArr, newArr) {
const deleted = oldArr.filter(v => !has(newArr, v));
const added = newArr.filter(v => !has(oldArr, v));
return { deleted, added };
}
export function analyzeLog(type, logString) {
const regExp = /@[^@]+@/g;
const logType = logTypes[type].match(/\w+[^\s]/g);
const logArr = logString.match(regExp).map(v => v.replace(/@/g, ''));
const logs = {};
if (logType.length > 1) {
logType.forEach((v, i) => Object.assign(logs, JSON.parse(logArr[i])));
return logs;
}
const key = logType[0];
logs[key] = logArr.map(v => JSON.parse(v)[key]);
return logs; |
<<<<<<<
export function* generatorNewVersion(next) {
const { versionType = 'build', projectId } = this.param;
const versionFrom = yield ProjectVersion.max('version', { where: { projectId } });
if (isNaN(versionFrom)) throw new Error('空项目不可进行版本升级');
const versionTo = versionTools.update(versionFrom, versionType);
const versions = yield ProjectVersion.findAll({
where: { projectId, version: '0.0.0' },
});
const rawData = versions.map(v => ({
...v.get({ plain: true }), version: versionTo,
}));
this.state.respond = yield ProjectVersion.bulkCreate(rawData);
const affectedProject = yield Project.findOne({
where: { id: projectId },
include: [User],
});
const affectedUsers = affectedProject.get({ plain: true }).users.map(v => v.id);
// 配置项目 log
this.state.log = {
params: {
versionFrom: versionTools.n2v(versionFrom),
versionTo,
},
loggerId: projectId,
subscribers: affectedUsers,
};
yield next;
}
=======
export function* addProjectIcon(next) {
const { projectId, icons } = this.param;
const data = icons.map(
(value) => ({ version: '0.0.0', iconId: value, projectId })
);
const result = yield ProjectVersion.bulkCreate(data, { ignoreDuplicates: true });
if (result.length) {
this.state.respond = '添加项目图标成功';
} else {
this.state.respond = '添加项目图标失败';
}
yield next;
}
export function* deleteProjectIcon(next) {
const { projectId, icons } = this.param;
let result = 0;
for (let i = 0, len = icons.length; i < len; i++) {
result += yield ProjectVersion.destroy({
where: { version: '0.0.0', iconId: icons[i], projectId },
});
}
if (result) {
this.state.respond = '删除项目图标成功';
} else {
this.state.respond = '删除项目图标失败';
}
yield next;
}
export function* updateProjectInfo(next) {
if (!this.state.user.isOwner) throw new Error('没有权限');
const { projectId, info, name, owner, publicProject } = this.param;
const data = { info, name, owner, public: publicProject };
let projectResult = null;
if (name) {
const existProject = yield Project.findOne({ where: { name }, raw: true });
if (existProject) {
const ownerName = yield User.findOne({ where: { id: existProject.owner }, raw: true });
throw new Error(`项目名已被使用,请更改,如有需要请联系${ownerName.name}`);
}
}
const key = Object.keys(data);
key.forEach((v) => {
if (data[v] === undefined) delete data[v];
});
if (Object.keys(data).length) {
projectResult = yield Project.update(data, { where: { id: projectId } });
}
if (projectResult) {
this.state.respond = '项目信息更新成功';
} else {
this.state.respond = '项目信息更新失败';
}
yield next;
}
export function* updateProjectMember(next) {
const { projectId, members } = this.param;
let deleteMember = null;
let result = null;
let flag = true; // 标志位,当是owner且删除数据成功时flag才会重置为true
if (projectId && members.length) {
if (this.state.user.isOwner && members.indexOf(this.state.user.ownerId) > -1) {
flag = false;
let oldMember = yield UserProject.findAll({ where: { projectId }, raw: true });
oldMember = oldMember.map((v) => v.userId);
deleteMember = oldMember.filter((value) => members.indexOf(value) === -1);
const deleteCount = yield UserProject.destroy({ where: { projectId } });
if (deleteCount) flag = true;
}
const data = members.map(
(value) => ({ projectId, userId: value })
);
result = yield UserProject.bulkCreate(data, { ignoreDuplicates: true });
}
if (result && flag) {
this.state.respond = '项目成员更新成功';
} else {
this.state.respond = '项目成员更新失败';
}
this.state.log = {
params: { user: deleteMember },
subscribers: members.concat(deleteMember),
};
yield next;
}
>>>>>>>
export function* generatorNewVersion(next) {
const { versionType = 'build', projectId } = this.param;
const versionFrom = yield ProjectVersion.max('version', { where: { projectId } });
if (isNaN(versionFrom)) throw new Error('空项目不可进行版本升级');
const versionTo = versionTools.update(versionFrom, versionType);
const versions = yield ProjectVersion.findAll({
where: { projectId, version: '0.0.0' },
});
const rawData = versions.map(v => ({
...v.get({ plain: true }), version: versionTo,
}));
this.state.respond = yield ProjectVersion.bulkCreate(rawData);
const affectedProject = yield Project.findOne({
where: { id: projectId },
include: [User],
});
const affectedUsers = affectedProject.get({ plain: true }).users.map(v => v.id);
// 配置项目 log
this.state.log = {
params: {
versionFrom: versionTools.n2v(versionFrom),
versionTo,
},
loggerId: projectId,
subscribers: affectedUsers,
};
yield next;
}
export function* addProjectIcon(next) {
const { projectId, icons } = this.param;
const data = icons.map(
(value) => ({ version: '0.0.0', iconId: value, projectId })
);
const result = yield ProjectVersion.bulkCreate(data, { ignoreDuplicates: true });
if (result.length) {
this.state.respond = '添加项目图标成功';
} else {
this.state.respond = '添加项目图标失败';
}
yield next;
}
export function* deleteProjectIcon(next) {
const { projectId, icons } = this.param;
let result = 0;
for (let i = 0, len = icons.length; i < len; i++) {
result += yield ProjectVersion.destroy({
where: { version: '0.0.0', iconId: icons[i], projectId },
});
}
if (result) {
this.state.respond = '删除项目图标成功';
} else {
this.state.respond = '删除项目图标失败';
}
yield next;
}
export function* updateProjectInfo(next) {
if (!this.state.user.isOwner) throw new Error('没有权限');
const { projectId, info, name, owner, publicProject } = this.param;
const data = { info, name, owner, public: publicProject };
let projectResult = null;
if (name) {
const existProject = yield Project.findOne({ where: { name }, raw: true });
if (existProject) {
const ownerName = yield User.findOne({ where: { id: existProject.owner }, raw: true });
throw new Error(`项目名已被使用,请更改,如有需要请联系${ownerName.name}`);
}
}
const key = Object.keys(data);
key.forEach((v) => {
if (data[v] === undefined) delete data[v];
});
if (Object.keys(data).length) {
projectResult = yield Project.update(data, { where: { id: projectId } });
}
if (projectResult) {
this.state.respond = '项目信息更新成功';
} else {
this.state.respond = '项目信息更新失败';
}
yield next;
}
export function* updateProjectMember(next) {
const { projectId, members } = this.param;
let deleteMember = null;
let result = null;
let flag = true; // 标志位,当是owner且删除数据成功时flag才会重置为true
if (projectId && members.length) {
if (this.state.user.isOwner && members.indexOf(this.state.user.ownerId) > -1) {
flag = false;
let oldMember = yield UserProject.findAll({ where: { projectId }, raw: true });
oldMember = oldMember.map((v) => v.userId);
deleteMember = oldMember.filter((value) => members.indexOf(value) === -1);
const deleteCount = yield UserProject.destroy({ where: { projectId } });
if (deleteCount) flag = true;
}
const data = members.map(
(value) => ({ projectId, userId: value })
);
result = yield UserProject.bulkCreate(data, { ignoreDuplicates: true });
}
if (result && flag) {
this.state.respond = '项目成员更新成功';
} else {
this.state.respond = '项目成员更新失败';
}
this.state.log = {
params: { user: deleteMember },
subscribers: members.concat(deleteMember),
};
yield next;
} |
<<<<<<<
Upload,
UploadEdit,
=======
Uploaded,
>>>>>>>
Upload,
UploadEdit,
Uploaded,
<<<<<<<
<Route path="upload" component={Upload} /> {/* 上传图标 */}
<Route path="uploadedit" component={UploadEdit} /> {/* 上传图标 设置图标标签 */}
=======
<Route path="upload" component={NoMatch} /> {/* 上传图标 */}
>>>>>>>
<Route path="upload" component={Upload} /> {/* 上传图标 */}
<Route path="uploadedit" component={UploadEdit} /> {/* 上传图标 设置图标标签 */} |
<<<<<<<
<Route path="projects" component={Project} /> {/* 公开项目 */}
<Route path="projects/:id(/version/:version)" component={Project} /> {/* 公开项目 */}
<Route path="search" /> {/* 搜索结果 */}
=======
<Route path="projects/:id(/version/:version)" /> {/* 公开项目 */}
<Route path="transition/:type" component={Transition} /> {/* 跳转页面 */}
<Route path="search" component={Search} /> {/* 搜索结果 */}
>>>>>>>
<Route path="projects" component={Project} /> {/* 公开项目 */}
<Route path="projects/:id(/version/:version)" component={Project} /> {/* 公开项目 */}
<Route path="transition/:type" component={Transition} /> {/* 跳转页面 */}
<Route path="search" component={Search} /> {/* 搜索结果 */} |
<<<<<<<
RHOC: { precision: 8, format: '0,0.00[000000]' },
TIME: { precision: 8, format: '0,0.00[000000]' },
=======
RHOC: { precision: 8, format: '0,0.00[000000]' },
GUP: { precision: 3, format: '0,0.00[0]' }
>>>>>>>
RHOC: { precision: 8, format: '0,0.00[000000]' },
TIME: { precision: 8, format: '0,0.00[000000]' },
GUP: { precision: 3, format: '0,0.00[0]' } |
<<<<<<<
renderContent () {
const { dimensions } = this.props
const {
visibleTimeStart,
visibleTimeEnd,
timelineWidth
} = dimensions
=======
renderContent() {
>>>>>>>
renderContent() {
const { dimensions } = this.props
const { visibleTimeStart, visibleTimeEnd, timelineWidth } = dimensions |
<<<<<<<
onItemContextMenu: PropTypes.func,
itemRenderer: PropTypes.func
=======
onItemContextMenu: PropTypes.func,
selected: PropTypes.array
>>>>>>>
onItemContextMenu: PropTypes.func,
itemRenderer: PropTypes.func,
selected: PropTypes.array |
<<<<<<<
=======
stackItems(
items,
groups,
canvasTimeStart,
visibleTimeStart,
visibleTimeEnd,
width
) {
// if there are no groups return an empty array of dimensions
if (groups.length === 0) {
return {
dimensionItems: [],
height: 0,
groupHeights: [],
groupTops: []
}
}
const { keys, lineHeight, stackItems, itemHeightRatio } = this.props
const {
draggingItem,
dragTime,
resizingItem,
resizingEdge,
resizeTime,
newGroupOrder
} = this.state
const zoom = visibleTimeEnd - visibleTimeStart
const canvasTimeEnd = canvasTimeStart + zoom * 3
const canvasWidth = width * 3
const visibleItems = getVisibleItems(
items,
canvasTimeStart,
canvasTimeEnd,
keys
)
const groupOrders = getGroupOrders(groups, keys)
let dimensionItems = visibleItems.reduce((memo, item) => {
const itemId = _get(item, keys.itemIdKey)
const isDragging = itemId === draggingItem
const isResizing = itemId === resizingItem
let dimension = calculateDimensions({
itemTimeStart: _get(item, keys.itemTimeStartKey),
itemTimeEnd: _get(item, keys.itemTimeEndKey),
isDragging,
isResizing,
canvasTimeStart,
canvasTimeEnd,
canvasWidth,
dragTime,
resizingEdge,
resizeTime
})
if (dimension) {
dimension.top = null
dimension.order = isDragging
? newGroupOrder
: groupOrders[_get(item, keys.itemGroupKey)]
dimension.stack = !item.isOverlay
dimension.height = lineHeight * itemHeightRatio
dimension.isDragging = isDragging
memo.push({
id: itemId,
dimensions: dimension
})
}
return memo
}, [])
const stackingMethod = stackItems ? stack : nostack
const { height, groupHeights, groupTops } = stackingMethod(
dimensionItems,
groupOrders,
lineHeight,
groups
)
return { dimensionItems, height, groupHeights, groupTops }
}
>>>>>>>
groups
<<<<<<<
<div style={outerComponentStyle} className="rct-outer">
<ScrollElement
scrollRef={el => {
this.props.scrollRef(el);
this.scrollComponent = el
}}
width={width}
height={height}
onZoom={this.changeZoom}
onWheelZoom={this.handleWheelZoom}
traditionalZoom={traditionalZoom}
onScroll={this.onScroll}
isInteractingWithItem={isInteractingWithItem}
>
<MarkerCanvas>
{this.items(
canvasTimeStart,
zoom,
canvasTimeEnd,
canvasWidth,
minUnit,
dimensionItems,
groupHeights,
groupTops
)}
{this.columns(
canvasTimeStart,
canvasTimeEnd,
canvasWidth,
minUnit,
timeSteps,
height,
headerHeight
)}
{this.rows(canvasWidth, groupHeights)}
{this.infoLabel()}
{this.childrenWithProps(
canvasTimeStart,
canvasTimeEnd,
canvasWidth,
dimensionItems,
groupHeights,
groupTops,
height,
headerHeight,
visibleTimeStart,
visibleTimeEnd,
minUnit,
timeSteps
)}
=======
{this.rows(canvasWidth, groupHeights, groups)}
{this.infoLabel()}
{this.childrenWithProps(
canvasTimeStart,
canvasTimeEnd,
canvasWidth,
dimensionItems,
groupHeights,
groupTops,
height,
headerHeight,
visibleTimeStart,
visibleTimeEnd,
minUnit,
timeSteps
)}
>>>>>>>
<div style={outerComponentStyle} className="rct-outer">
<ScrollElement
scrollRef={el => {
this.props.scrollRef(el);
this.scrollComponent = el
}}
width={width}
height={height}
onZoom={this.changeZoom}
onWheelZoom={this.handleWheelZoom}
traditionalZoom={traditionalZoom}
onScroll={this.onScroll}
isInteractingWithItem={isInteractingWithItem}
>
<MarkerCanvas>
{this.items(
canvasTimeStart,
zoom,
canvasTimeEnd,
canvasWidth,
minUnit,
dimensionItems,
groupHeights,
groupTops
)}
{this.columns(
canvasTimeStart,
canvasTimeEnd,
canvasWidth,
minUnit,
timeSteps,
height,
headerHeight
)}
{this.rows(canvasWidth, groupHeights, groups)}
{this.infoLabel()}
{this.childrenWithProps(
canvasTimeStart,
canvasTimeEnd,
canvasWidth,
dimensionItems,
groupHeights,
groupTops,
height,
headerHeight,
visibleTimeStart,
visibleTimeEnd,
minUnit,
timeSteps
)} |
<<<<<<<
this.contentCursorLocation = 0;
}
componentDidMount() {
this.keyboardWillShowListener = Keyboard.addListener('keyboardWillShow', (e) => this.keyboardWillShow(e));
this.keyboardWillHideListener = Keyboard.addListener('keyboardWillHide', (e) => this.keyboardWillHide(e));
}
componentWillUnmount() {
this.keyboardWillShowListener.remove();
this.keyboardWillHideListener.remove();
}
keyboardWillShow(e) {
LayoutAnimation.easeInEaseOut();
this.setState({
selectedPanel: 'keyboard',
keyboardAccessoryToBottom: e.endCoordinates.height
});
}
keyboardWillHide(e) {
LayoutAnimation.easeInEaseOut();
this.setState({
keyboardAccessoryToBottom: 0,
isContentFocused: false
});
=======
this.boardId = this.props.navigation.state.params.boardId;
}
componentDidMount() {
this.props.fetchTopicList({
boardId: this.boardId,
isEndReached: false,
sortType: 'publish'
});
>>>>>>>
this.boardId = this.props.navigation.state.params.boardId;
this.contentCursorLocation = 0;
}
componentDidMount() {
this.keyboardWillShowListener = Keyboard.addListener('keyboardWillShow', (e) => this.keyboardWillShow(e));
this.keyboardWillHideListener = Keyboard.addListener('keyboardWillHide', (e) => this.keyboardWillHide(e));
this.props.fetchTopicList({
boardId: this.boardId,
isEndReached: false,
sortType: 'publish'
});
}
componentWillUnmount() {
this.keyboardWillShowListener.remove();
this.keyboardWillHideListener.remove();
}
keyboardWillShow(e) {
LayoutAnimation.easeInEaseOut();
this.setState({
selectedPanel: 'keyboard',
keyboardAccessoryToBottom: e.endCoordinates.height
});
}
keyboardWillHide(e) {
LayoutAnimation.easeInEaseOut();
this.setState({
keyboardAccessoryToBottom: 0,
isContentFocused: false
});
<<<<<<<
<KeyboardAwareScrollView
style={[styles.form, isPublishing && styles.disabledForm]}
onScroll={() => this.handleScroll()}>
{types.length > 0 &&
<TouchableHighlight
underlayColor={colors.underlay}
onPress={() => {
if (!isPublishing) {
this.togglePicker(true);
}
}}>
<View style={styles.formItem}>
<Text
style={styles.topicType}>
{typeId && types.find(type => type.typeId === typeId).typeName || '请选择分类'}
</Text>
<Icon
style={styles.topicTypeIcon}
name='angle-right'
size={18} />
</View>
</TouchableHighlight>
}
<View style={styles.formItem}>
<TextInput
ref={component => this.titleInput = component}
style={styles.topicTitle}
onFocus={() => this.setState({ isContentFocused: false })}
onChangeText={text => this.setState({ title: text })}
editable={!isPublishing}
returnKeyType='next'
onSubmitEditing={() => this.contentInput.focus()}
enablesReturnKeyAutomatically={true}
placeholder='请输入标题' />
</View>
<View style={styles.formItem}>
<TextInput
ref={component => this.contentInput = component}
value={this.state.content}
style={styles.topicContent}
onFocus={() => this.setState({ isContentFocused: true })}
onSelectionChange={(event) => this.handleContentSelectionChange(event)}
onChangeText={text => this.setState({ content: text })}
multiline={true}
editable={!isPublishing}
placeholder='请输入正文' />
</View>
<View style={styles.upload}>
<ImageUploader
disabled={isPublishing}
images={this.state.images}
addImages={images => this.addImages(images)}
removeImage={imageIndex => this.removeImage(imageIndex)} />
</View>
</KeyboardAwareScrollView>
{(this.state.isContentFocused || this.state.selectedPanel === 'meme') &&
<KeyboardAccessory
style={{ bottom: this.state.keyboardAccessoryToBottom }}
selectedPanel={this.state.selectedPanel}
handlePanelSelect={(item) => this.handlePanelSelect(item)}
handleEmojiPress={(emoji) => this.handleEmojiPress(emoji)} />
}
</View>
</Modal>
=======
}
<KeyboardAwareScrollView style={[styles.form, isPublishing && styles.disabledForm]}>
{types.length > 0 &&
<TouchableHighlight
underlayColor={colors.underlay}
onPress={() => {
if (!isPublishing) {
this.togglePicker(true);
}
}}>
<View style={styles.formItem}>
<Text
style={styles.topicType}>
{typeId && types.find(type => type.typeId === typeId).typeName || '请选择分类'}
</Text>
<Icon
style={styles.topicTypeIcon}
name='angle-right'
size={18} />
</View>
</TouchableHighlight>
}
<View style={styles.formItem}>
<TextInput
ref={component => this.titleInput = component}
style={styles.topicTitle}
onChangeText={text => this.setState({ title: text })}
editable={!isPublishing}
returnKeyType='next'
onSubmitEditing={() => this.contentInput.focus()}
enablesReturnKeyAutomatically={true}
placeholder='请输入标题' />
</View>
<View style={styles.formItem}>
<TextInput
ref={component => this.contentInput = component}
style={styles.topicContent}
onChangeText={text => this.setState({ content: text })}
multiline={true}
editable={!isPublishing}
placeholder='请输入正文' />
</View>
<View style={styles.upload}>
<ImageUploader
disabled={isPublishing}
images={this.state.images}
addImages={images => this.addImages(images)}
removeImage={imageIndex => this.removeImage(imageIndex)} />
</View>
</KeyboardAwareScrollView>
</View>
>>>>>>>
<KeyboardAwareScrollView
style={[styles.form, isPublishing && styles.disabledForm]}
onScroll={() => this.handleScroll()}>
{types.length > 0 &&
<TouchableHighlight
underlayColor={colors.underlay}
onPress={() => {
if (!isPublishing) {
this.togglePicker(true);
}
}}>
<View style={styles.formItem}>
<Text
style={styles.topicType}>
{typeId && types.find(type => type.typeId === typeId).typeName || '请选择分类'}
</Text>
<Icon
style={styles.topicTypeIcon}
name='angle-right'
size={18} />
</View>
</TouchableHighlight>
}
<View style={styles.formItem}>
<TextInput
ref={component => this.titleInput = component}
style={styles.topicTitle}
onFocus={() => this.setState({ isContentFocused: false })}
onChangeText={text => this.setState({ title: text })}
editable={!isPublishing}
returnKeyType='next'
onSubmitEditing={() => this.contentInput.focus()}
enablesReturnKeyAutomatically={true}
placeholder='请输入标题' />
</View>
<View style={styles.formItem}>
<TextInput
ref={component => this.contentInput = component}
value={this.state.content}
style={styles.topicContent}
onFocus={() => this.setState({ isContentFocused: true })}
onSelectionChange={(event) => this.handleContentSelectionChange(event)}
onChangeText={text => this.setState({ content: text })}
multiline={true}
editable={!isPublishing}
placeholder='请输入正文' />
</View>
<View style={styles.upload}>
<ImageUploader
disabled={isPublishing}
images={this.state.images}
addImages={images => this.addImages(images)}
removeImage={imageIndex => this.removeImage(imageIndex)} />
</View>
</KeyboardAwareScrollView>
{(this.state.isContentFocused || this.state.selectedPanel === 'meme') &&
<KeyboardAccessory
style={{ bottom: this.state.keyboardAccessoryToBottom }}
selectedPanel={this.state.selectedPanel}
handlePanelSelect={(item) => this.handlePanelSelect(item)}
handleEmojiPress={(emoji) => this.handleEmojiPress(emoji)} />
}
</View> |
<<<<<<<
replyId,
boardId,
topicId,
images: [],
isUploading: false,
selectedPanel: 'keyboard',
keyboardAccessoryToBottom: 0,
isContentFocused: false
=======
images: []
>>>>>>>
replyId,
boardId,
topicId,
images: [],
isUploading: false,
selectedPanel: 'keyboard',
keyboardAccessoryToBottom: 0,
isContentFocused: false
<<<<<<<
componentDidMount() {
this.keyboardWillShowListener = Keyboard.addListener('keyboardWillShow', (e) => this.keyboardWillShow(e));
this.keyboardWillHideListener = Keyboard.addListener('keyboardWillHide', (e) => this.keyboardWillHide(e));
}
componentWillUnmount() {
this.keyboardWillShowListener.remove();
this.keyboardWillHideListener.remove();
}
keyboardWillShow(e) {
LayoutAnimation.easeInEaseOut();
this.setState({
selectedPanel: 'keyboard',
keyboardAccessoryToBottom: e.endCoordinates.height
});
}
keyboardWillHide(e) {
LayoutAnimation.easeInEaseOut();
this.setState({
keyboardAccessoryToBottom: 0,
isContentFocused: false
});
}
=======
initNecessaryData() {
let {
comment,
comment: {
reply_posts_id,
board_id,
topic_id
},
isReplyInTopic
} = this.props.navigation.state.params;
this.replyId = reply_posts_id;
this.boardId = board_id,
this.topicId = topic_id;
this.isReplyInTopic = isReplyInTopic;
this.title = this.getTitle(comment);
}
fetchTopic() {
this.props.fetchTopic({
topicId: this.topicId
});
}
>>>>>>>
componentDidMount() {
this.keyboardWillShowListener = Keyboard.addListener('keyboardWillShow', (e) => this.keyboardWillShow(e));
this.keyboardWillHideListener = Keyboard.addListener('keyboardWillHide', (e) => this.keyboardWillHide(e));
}
componentWillUnmount() {
this.keyboardWillShowListener.remove();
this.keyboardWillHideListener.remove();
}
keyboardWillShow(e) {
LayoutAnimation.easeInEaseOut();
this.setState({
selectedPanel: 'keyboard',
keyboardAccessoryToBottom: e.endCoordinates.height
});
}
keyboardWillHide(e) {
LayoutAnimation.easeInEaseOut();
this.setState({
keyboardAccessoryToBottom: 0,
isContentFocused: false
});
}
initNecessaryData() {
let {
comment,
comment: {
reply_posts_id,
board_id,
topic_id
},
isReplyInTopic
} = this.props.navigation.state.params;
this.replyId = reply_posts_id;
this.boardId = board_id,
this.topicId = topic_id;
this.isReplyInTopic = isReplyInTopic;
this.title = this.getTitle(comment);
}
fetchTopic() {
this.props.fetchTopic({
topicId: this.topicId
});
}
<<<<<<<
}
</Header>
<KeyboardAwareScrollView
style={isPublishing && styles.disabledForm}
onScroll={() => this.handleScroll()}>
<View style={styles.formItem}>
<TextInput
ref={component => this.contentInput = component}
value={this.state.replyContent}
placeholder='同学,请文明用语噢~'
style={styles.replyBox}
onFocus={() => this.setState({ isContentFocused: true })}
onSelectionChange={(event) => this.handleContentSelectionChange(event)}
onChangeText={(text) => this.setState({ replyContent: text })}
autoFocus={true}
multiline={true}
editable={!isPublishing} />
</View>
<View style={styles.upload}>
<ImageUploader
disabled={isPublishing}
images={this.state.images}
addImages={images => this.addImages(images)}
removeImage={imageIndex => this.removeImage(imageIndex)} />
</View>
</KeyboardAwareScrollView>
{(this.state.isContentFocused || this.state.selectedPanel === 'meme') &&
<KeyboardAccessory
style={{ bottom: this.state.keyboardAccessoryToBottom }}
selectedPanel={this.state.selectedPanel}
handlePanelSelect={(item) => this.handlePanelSelect(item)}
handleEmojiPress={(emoji) => this.handleEmojiPress(emoji)} />
}
</View>
</Modal>
=======
)
||
<Text
style={[modalStyles.button, modalStyles.disabled]}>
发布
</Text>
}
</Header>
<KeyboardAwareScrollView style={isPublishing && styles.disabledForm}>
<View style={styles.formItem}>
<TextInput
ref={component => this.contentInput = component}
placeholder='同学,请文明用语噢~'
style={styles.replyBox}
onChangeText={(text) => this.setState({ replyContent: text })}
autoFocus={true}
multiline={true}
editable={!isPublishing} />
</View>
<View style={styles.upload}>
<ImageUploader
disabled={isPublishing}
images={this.state.images}
addImages={images => this.addImages(images)}
removeImage={imageIndex => this.removeImage(imageIndex)} />
</View>
</KeyboardAwareScrollView>
</View>
>>>>>>>
)
||
<Text
style={[modalStyles.button, modalStyles.disabled]}>
发布
</Text>
}
</Header>
<KeyboardAwareScrollView
style={isPublishing && styles.disabledForm}
onScroll={() => this.handleScroll()}>
<View style={styles.formItem}>
<TextInput
ref={component => this.contentInput = component}
value={this.state.replyContent}
placeholder='同学,请文明用语噢~'
style={styles.replyBox}
onFocus={() => this.setState({ isContentFocused: true })}
onSelectionChange={(event) => this.handleContentSelectionChange(event)}
onChangeText={(text) => this.setState({ replyContent: text })}
autoFocus={true}
multiline={true}
editable={!isPublishing} />
</View>
<View style={styles.upload}>
<ImageUploader
disabled={isPublishing}
images={this.state.images}
addImages={images => this.addImages(images)}
removeImage={imageIndex => this.removeImage(imageIndex)} />
</View>
</KeyboardAwareScrollView>
{(this.state.isContentFocused || this.state.selectedPanel === 'meme') &&
<KeyboardAccessory
style={{ bottom: this.state.keyboardAccessoryToBottom }}
selectedPanel={this.state.selectedPanel}
handlePanelSelect={(item) => this.handlePanelSelect(item)}
handleEmojiPress={(emoji) => this.handleEmojiPress(emoji)} />
}
</View> |
<<<<<<<
const TOPIC = require('./topic');
=======
const GRID = require('./grid');
>>>>>>>
const GRID = require('./grid');
const TOPIC = require('./topic');
<<<<<<<
/**
* Get the topic based on the name.
*/
const useTopicQuery = ({ name, ancestry }) => {
const [result] = useQuery({
query: TOPIC,
variables: { name, ancestry }
});
return result;
};
=======
const useGridQuery = () => {
const [result] = useQuery({
query: GRID,
variables: { id: 28, language: 'en' }
});
return result;
};
>>>>>>>
const useGridQuery = () => {
const [result] = useQuery({
query: GRID,
variables: { id: 28, language: 'en' }
});
return result;
};
/**
* Get the topic based on the name.
*/
const useTopicQuery = ({ name, ancestry }) => {
const [result] = useQuery({
query: TOPIC,
variables: { name, ancestry }
});
return result;
};
<<<<<<<
TOPIC,
=======
GRID,
>>>>>>>
TOPIC,
<<<<<<<
useMenuAndTenantQuery,
useTopicQuery
=======
useMenuAndTenantQuery,
useGridQuery
>>>>>>>
useMenuAndTenantQuery,
useGridQuery,
useTopicQuery |
<<<<<<<
test('should be able to access properties on oas', () => {
expect(
new Oas({
info: { version: '1.0' },
}).info.version,
).toBe('1.0');
});
describe('operation.getSecurity()', () => {
const security = [{ auth: [] }];
test('should return the security on this endpoint', () => {
expect(
new Oas({
info: { version: '1.0' },
paths: {
'/things': {
post: {
security,
},
},
},
})
.operation('/things', 'post')
.getSecurity(),
).toBe(security);
});
test('should fallback to global security', () => {
expect(
new Oas({
info: { version: '1.0' },
paths: {
'/things': {
post: {},
},
},
security,
})
.operation('/things', 'post')
.getSecurity(),
).toBe(security);
});
test('should default to empty array', () => {
expect(
new Oas({
info: { version: '1.0' },
paths: {
'/things': {
post: {},
},
},
})
.operation('/things', 'post')
.getSecurity(),
).toEqual([]);
});
});
=======
>>>>>>>
test('should be able to access properties on oas', () => {
expect(
new Oas({
info: { version: '1.0' },
}).info.version,
).toBe('1.0');
});
describe('operation.getSecurity()', () => {
const security = [{ auth: [] }];
test('should return the security on this endpoint', () => {
expect(
new Oas({
info: { version: '1.0' },
paths: {
'/things': {
post: {
security,
},
},
},
})
.operation('/things', 'post')
.getSecurity(),
).toBe(security);
});
test('should fallback to global security', () => {
expect(
new Oas({
info: { version: '1.0' },
paths: {
'/things': {
post: {},
},
},
security,
})
.operation('/things', 'post')
.getSecurity(),
).toBe(security);
});
test('should default to empty array', () => {
expect(
new Oas({
info: { version: '1.0' },
paths: {
'/things': {
post: {},
},
},
})
.operation('/things', 'post')
.getSecurity(),
).toEqual([]);
});
});
<<<<<<<
test('should return with an empty object if no security', () => {
const operation = new Oas(multipleSecurities).operation('/no-auth', 'post');
expect(Object.keys(operation.prepareSecurity()).length).toBe(0);
});
=======
test('should return empty object if no security', () => {
const operation = new Oas(multipleSecurities).operation('/no-auth', 'post');
expect(Object.keys(operation.prepareSecurity()).length).toBe(0);
});
test('should return empty object if security scheme doesnt exist', () => {
const operation = new Oas(multipleSecurities).operation('/unknown-scheme', 'post');
expect(Object.keys(operation.prepareSecurity()).length).toBe(0);
});
test('should return empty if security scheme type doesnt exist', () => {
const operation = new Oas(multipleSecurities).operation('/unknown-auth-type', 'post');
expect(Object.keys(operation.prepareSecurity()).length).toBe(0);
});
>>>>>>>
test('should return empty object if no security', () => {
const operation = new Oas(multipleSecurities).operation('/no-auth', 'post');
expect(Object.keys(operation.prepareSecurity()).length).toBe(0);
});
test('should return empty object if security scheme doesnt exist', () => {
const operation = new Oas(multipleSecurities).operation('/unknown-scheme', 'post');
expect(Object.keys(operation.prepareSecurity()).length).toBe(0);
});
test('should return empty if security scheme type doesnt exist', () => {
const operation = new Oas(multipleSecurities).operation('/unknown-auth-type', 'post');
expect(Object.keys(operation.prepareSecurity()).length).toBe(0);
}); |
<<<<<<<
const snippet = shallow(generateCodeSnippet(oas, operation, {}, 'node'));
=======
const { snippet } = generateCodeSnippet(oas, operation, {}, 'node');
>>>>>>>
const { snippet } = shallow(generateCodeSnippet(oas, operation, {}, 'node'));
<<<<<<<
const snippet = shallow(generateCodeSnippet(oas, operation, values, 'node'));
=======
const { snippet } = generateCodeSnippet(oas, operation, values, 'node');
>>>>>>>
const { snippet } = shallow(generateCodeSnippet(oas, operation, values, 'node'));
<<<<<<<
const snippet = shallow(
generateCodeSnippet(
Object.assign({}, oas, { [extensions.PROXY_ENABLED]: true }),
operation,
values,
'node',
),
=======
const { snippet } = generateCodeSnippet(
Object.assign({}, oas, { [extensions.PROXY_ENABLED]: true }),
operation,
values,
'node',
>>>>>>>
const { snippet } = shallow(
generateCodeSnippet(
Object.assign({}, oas, { [extensions.PROXY_ENABLED]: true }),
operation,
values,
'node',
),
<<<<<<<
const snippet = shallow(generateCodeSnippet(oas, operation, {}, 'javascript'));
=======
const { snippet } = generateCodeSnippet(oas, operation, {}, 'javascript');
>>>>>>>
const { snippet } = shallow(generateCodeSnippet(oas, operation, {}, 'javascript')); |
<<<<<<<
/**
* Convert to array
*
* @param {String} val
* @return {Array}
* @api private
*/
exports.toArray = function (val) {
return Array.isArray(val) ? val : [val];
};
/**
* Extract network from User/Channel object
*
* @param {Object} target
* @return {String}
* @api private
*/
exports.extractNetwork = function (target) {
if (typeof target.getNetwork === 'function') {
return target.getNetwork();
} else return;
};
/**
* Convert target object to string
*
* @param {Object} target
* @return {String}
* @api private
*/
exports.targetString = function (target) {
if (target.client) {
if (target.client.isUser(target)) {
return target.getNick();
} else if (target.client.isChannel(target)) {
return target.getName();
} else {
return target.toString();
}
}
return target;
};
=======
exports.nick = function(msg){
return msg.prefix.split('!')[0];
};
/**
* Merge the contents of two objects together into the first object.
*
* @param {Object} a
* @param {Object} b
* @return {Object}
* @api private
*/
exports.extend = function(a, b) {
for (var prop in b) {
a[prop] = b[prop];
}
return a;
}
>>>>>>>
/**
* Convert to array
*
* @param {String} val
* @return {Array}
* @api private
*/
exports.toArray = function (val) {
return Array.isArray(val) ? val : [val];
};
/**
* Extract network from User/Channel object
*
* @param {Object} target
* @return {String}
* @api private
*/
exports.extractNetwork = function (target) {
if (typeof target.getNetwork === 'function') {
return target.getNetwork();
} else return;
};
/**
* Convert target object to string
*
* @param {Object} target
* @return {String}
* @api private
*/
exports.targetString = function (target) {
if (target.client) {
if (target.client.isUser(target)) {
return target.getNick();
} else if (target.client.isChannel(target)) {
return target.getName();
} else {
return target.toString();
}
}
return target;
};
/**
* Merge the contents of two objects together into the first object.
*
* @param {Object} a
* @param {Object} b
* @return {Object}
* @api private
*/
exports.extend = function(a, b) {
for (var prop in b) {
a[prop] = b[prop];
}
return a;
} |
<<<<<<<
var util = require('util');
var utils = require('./lib/utils');
=======
/**
* Core plugins.
*/
var welcome = require('./lib/plugins/welcome');
var privmsg = require('./lib/plugins/privmsg');
var notice = require('./lib/plugins/notice');
var topic = require('./lib/plugins/topic');
var names = require('./lib/plugins/names');
var nick = require('./lib/plugins/nick');
var quit = require('./lib/plugins/quit');
var away = require('./lib/plugins/away');
var pong = require('./lib/plugins/pong');
var join = require('./lib/plugins/join');
var part = require('./lib/plugins/part');
var kick = require('./lib/plugins/kick');
var whois = require('./lib/plugins/whois');
var motd = require('./lib/plugins/motd');
var mode = require('./lib/plugins/mode');
var errors = require('./lib/plugins/errors');
/**
* Expose `Client.`
*/
module.exports = Client;
/**
* Initialize a new IRC client with the
* given duplex `stream`.
*
* @param {Stream} stream
* @api public
*/
>>>>>>>
var utils = require('./lib/utils'); |
<<<<<<<
// import AttributionChannel from './diagrams/AttributionChannel.html';
import AttributionGroups from './diagrams/AttributionGroups.html';
=======
import AttributionChannel from './diagrams/AttributionChannel.html';
const labels = require('../static/examples/labels.json');
>>>>>>>
import AttributionChannel from './diagrams/AttributionChannel.html';
import AttributionGroups from './diagrams/AttributionGroups.html';
const labels = require('../static/examples/labels.json'); |
<<<<<<<
if (window.location.href.indexOf("leparisien.fr") !== -1) {
window.removeEventListener('scroll', this.scrollListener);
const paywall = document.querySelector('.relative.piano-paywall.below_nav.sticky');
removeDOMElement(paywall);
setTimeout(function () {
var content = document.getElementsByClassName('content');
for (var i = 0; i < content.length; i++) {
content[i].removeAttribute("style");
}
}, 300); // Delay (in milliseconds)
}
=======
>>>>>>>
if (window.location.href.indexOf("leparisien.fr") !== -1) {
window.removeEventListener('scroll', this.scrollListener);
const paywall = document.querySelector('.relative.piano-paywall.below_nav.sticky');
removeDOMElement(paywall);
setTimeout(function () {
var content = document.getElementsByClassName('content');
for (var i = 0; i < content.length; i++) {
content[i].removeAttribute("style");
}
}, 300); // Delay (in milliseconds)
}
<<<<<<<
}
function removeClassesByPrefix(el, prefix) {
for (var i = 0; i < el.classList.length; i++){
if(el.classList[i].startsWith(prefix)) {
el.classList.remove(el.classList[i]);
}
}
=======
}
function pageContains(selector, text) {
let elements = document.querySelectorAll(selector);
return Array.prototype.filter.call(elements, function(element){
return RegExp(text).test(element.textContent);
});
>>>>>>>
}
function removeClassesByPrefix(el, prefix) {
for (var i = 0; i < el.classList.length; i++){
if(el.classList[i].startsWith(prefix)) {
el.classList.remove(el.classList[i]);
}
}
function pageContains(selector, text) {
let elements = document.querySelectorAll(selector);
return Array.prototype.filter.call(elements, function(element){
return RegExp(text).test(element.textContent);
}); |
<<<<<<<
formatError, getModelIdsFromProjectId, uploadFileToGcs, getProjectModelLocalFolder, getProjectModelFileName, getProjectIdFromModelId,
=======
formatError,
getModelIdsFromProjectId,
getProjectModelLocalFolder,
getProjectModelFileName,
>>>>>>>
formatError, getModelIdsFromProjectId, uploadFileToGcs, getProjectModelLocalFolder, getProjectModelFileName, getProjectIdFromModelId,
<<<<<<<
const { instance: host } = yaml.safeLoad(Assets.getText(
process.env.MODE === 'development'
? 'defaults/private.dev.yaml'
: process.env.MODE === 'test' ? 'defaults/private.yaml' : 'defaults/private.gke.yaml',
));
=======
const { instance: host } = yaml.safeLoad(
Assets.getText(
process.env.MODE === 'development'
? 'defaults/private.dev.yaml'
: 'defaults/private.yaml',
),
);
>>>>>>>
const { instance: host } = yaml.safeLoad(
Assets.getText(
process.env.MODE === 'development'
? 'defaults/private.dev.yaml'
: process.env.MODE === 'test' ? 'defaults/private.yaml' : 'defaults/private.gke.yaml',
),
);
<<<<<<<
name: 'Default Instance', host: host.replace(/{PROJECT_NAMESPACE}/g, project.namespace), projectId: project._id,
=======
name: 'Default Instance',
host,
projectId: project._id,
>>>>>>>
name: 'Default Instance',
host: host.replace(/{PROJECT_NAMESPACE}/g, project.namespace),
projectId: project._id,
<<<<<<<
export const getTrainingDataInRasaFormat = (model, withSynonyms = true, intents = [], withGazette = true) => {
checkIfCan('nlu-data:r', getProjectIdFromModelId(model._id));
=======
export const getTrainingDataInRasaFormat = (
model,
withSynonyms = true,
intents = [],
withGazette = true,
) => {
>>>>>>>
export const getTrainingDataInRasaFormat = (
model,
withSynonyms = true,
intents = [],
withGazette = true,
) => {
checkIfCan('nlu-data:r', getProjectIdFromModelId(model._id));
<<<<<<<
async 'rasa.getTrainingPayload'(projectId, instance, { env = 'development', language = '', joinStoryFiles = true } = {}) {
checkIfCan(['nlu-data:x', 'projects:r'], projectId);
=======
async 'rasa.getTrainingPayload'(
projectId,
instance,
{ language = '', joinStoryFiles = true } = {},
) {
>>>>>>>
async 'rasa.getTrainingPayload'(
projectId,
instance,
{ env = 'development', language = '', joinStoryFiles = true } = {},
) {
checkIfCan(['nlu-data:x', 'projects:r'], projectId);
<<<<<<<
const { stories, domain, wasPartial } = await getStoriesAndDomain(projectId, language, env);
=======
const { stories, domain, wasPartial } = await getStoriesAndDomain(
projectId,
language,
);
>>>>>>>
const { stories, domain, wasPartial } = await getStoriesAndDomain(
projectId,
language,
env,
);
<<<<<<<
appMethodLogger.debug(`Building training payload - ${(t1 - t0).toFixed(2)} ms`);
auditLog('Retreived training payload for project', {
user: Meteor.user(),
type: 'execute',
projectId,
operation: 'nlu-model-execute',
resId: projectId,
resType: 'nlu-model',
});
=======
appMethodLogger.debug(
`Building training payload - ${(t1 - t0).toFixed(2)} ms`,
);
>>>>>>>
appMethodLogger.debug(
`Building training payload - ${(t1 - t0).toFixed(2)} ms`,
);
auditLog('Retreived training payload for project', {
user: Meteor.user(),
type: 'execute',
projectId,
operation: 'nlu-model-execute',
resId: projectId,
resType: 'nlu-model',
});
<<<<<<<
const payload = await Meteor.call('rasa.getTrainingPayload', projectId, instance, { env });
=======
const payload = await Meteor.call(
'rasa.getTrainingPayload',
projectId,
instance,
);
>>>>>>>
const payload = await Meteor.call(
'rasa.getTrainingPayload',
projectId,
instance,
{ env },
); |
<<<<<<<
data: (parent, _, __) => parent.event,
message_id: (parent, _, __) => parent.message_id,
},
Data: {
elements: (parent, _, __) => parent.elements,
quick_replies: (parent, _, __) => parent.quick_replies,
buttons: (parent, _, __) => parent.buttons,
attachment: (parent, _, __) => parent.attachment,
image: (parent, _, __) => parent.image,
custom: (parent, _, __) => parent.custom,
=======
data: (parent, _, __) => parent.data,
>>>>>>>
data: (parent, _, __) => parent.data,
message_id: (parent, _, __) => parent.message_id, |
<<<<<<<
* Get a list of all im channels
* @returns {vow.Promise}
*/
getImChannels() {
if (this.ims) {
return Vow.fulfill({ ims: this.ims });
}
return this._api('im.list');
}
/**
=======
* Posts an ephemeral message to a channel and user
* @param {string} id - channel ID
* @param {string} user - user ID
* @param {string} text
* @param {object} params
* @returns {vow.Promise}
*/
postEphemeral(id, user, text, params) {
params = extend({
text: text,
channel: id,
user: user,
username: this.name
}, params || {});
return this._api('chat.postEphemeral', params);
}
/**
>>>>>>>
* Get a list of all im channels
* @returns {vow.Promise}
*/
getImChannels() {
if (this.ims) {
return Vow.fulfill({ ims: this.ims });
}
return this._api('im.list');
}
/**
* Posts an ephemeral message to a channel and user
* @param {string} id - channel ID
* @param {string} user - user ID
* @param {string} text
* @param {object} params
* @returns {vow.Promise}
*/
postEphemeral(id, user, text, params) {
params = extend({
text: text,
channel: id,
user: user,
username: this.name
}, params || {});
return this._api('chat.postEphemeral', params);
}
/** |
<<<<<<<
import { STAT_TRACKER as ROLLING_HAVOC_STATS } from 'parser/warlock/destruction/modules/azerite/RollingHavoc';
=======
import { STAT_TRACKER as FLASHPOINT_STATS } from 'parser/warlock/destruction/modules/azerite/Flashpoint';
import { STAT_TRACKER as ACCELERANT_STATS } from 'parser/warlock/destruction/modules/azerite/Accelerant';
>>>>>>>
import { STAT_TRACKER as ROLLING_HAVOC_STATS } from 'parser/warlock/destruction/modules/azerite/RollingHavoc';
import { STAT_TRACKER as FLASHPOINT_STATS } from 'parser/warlock/destruction/modules/azerite/Flashpoint';
import { STAT_TRACKER as ACCELERANT_STATS } from 'parser/warlock/destruction/modules/azerite/Accelerant';
<<<<<<<
[SPELLS.ROLLING_HAVOC_BUFF.id]: ROLLING_HAVOC_STATS,
=======
[SPELLS.FLASHPOINT_BUFF.id]: FLASHPOINT_STATS,
[SPELLS.ACCELERANT_BUFF.id]: ACCELERANT_STATS,
>>>>>>>
[SPELLS.ROLLING_HAVOC_BUFF.id]: ROLLING_HAVOC_STATS,
[SPELLS.FLASHPOINT_BUFF.id]: FLASHPOINT_STATS,
[SPELLS.ACCELERANT_BUFF.id]: ACCELERANT_STATS, |
<<<<<<<
that.colorStart = options.colorStart instanceof THREE.Color ? options.colorStart : new THREE.Color( 'white' );
that.colorEnd = options.colorEnd instanceof THREE.Color ? options.colorEnd : new THREE.Color( 'blue' );
that.colorSpread = options.colorSpread instanceof THREE.Vector3 ? options.colorSpread : new THREE.Vector3();
=======
that.angle = parseFloat( typeof options.angle === 'number' ? options.angle : 0, 10 );
that.angleSpread = parseFloat( typeof options.angleSpread === 'number' ? options.angleSpread : 0, 10 );
that.angleVelocity = parseFloat( typeof options.angleVelocity === 'number' ? options.angleVelocity : 0, 10 );
that.angleAlignVelocity = options.angleAlignVelocity || false;
>>>>>>>
that.colorStart = options.colorStart instanceof THREE.Color ? options.colorStart : new THREE.Color( 'white' );
that.colorEnd = options.colorEnd instanceof THREE.Color ? options.colorEnd : new THREE.Color( 'blue' );
that.colorSpread = options.colorSpread instanceof THREE.Vector3 ? options.colorSpread : new THREE.Vector3();
that.angle = parseFloat( typeof options.angle === 'number' ? options.angle : 0, 10 );
that.angleSpread = parseFloat( typeof options.angleSpread === 'number' ? options.angleSpread : 0, 10 );
that.angleVelocity = parseFloat( typeof options.angleVelocity === 'number' ? options.angleVelocity : 0, 10 );
that.angleAlignVelocity = options.angleAlignVelocity || false; |
<<<<<<<
// ShaderParticleGroup 0.6.0
=======
// ShaderParticleGroup 0.7.0
>>>>>>>
// ShaderParticleGroup 0.7.0
<<<<<<<
that.hasPerspective = parseInt( typeof options.hasPerspective === 'number' ? options.hasPerspective : 1, 10 );
that.colorize = parseInt( options.colorize || 1, 10 );
=======
that.hasPerspective = parseInt( typeof options.hasPerspective === 'number' ? options.hasPerspective : 1, 10 );
that.colorize = parseInt( options.colorize || 1, 10 );
that.hasGravity = parseInt( options.hasGravity || 0, 10 );
that.planetPosition = options.planetPosition instanceof THREE.Vector3 ? options.planetPosition : new THREE.Vector3();
>>>>>>>
that.hasPerspective = parseInt( typeof options.hasPerspective === 'number' ? options.hasPerspective : 1, 10 );
that.colorize = parseInt( options.colorize || 1, 10 );
<<<<<<<
acceleration: { type: 'v3', value: [] },
velocity: { type: 'v3', value: [] },
alive: { type: 'f', value: [] },
age: { type: 'f', value: [] },
sizeStart: { type: 'f', value: [] },
sizeEnd: { type: 'f', value: [] },
angle: { type: 'f', value: [] },
colorStart: { type: 'c', value: [] },
colorMiddle: { type: 'c', value: [] },
colorEnd: { type: 'c', value: [] },
opacityStart: { type: 'f', value: [] },
opacityMiddle: { type: 'f', value: [] },
opacityEnd: { type: 'f', value: [] }
=======
acceleration: { type: 'v3', value: [] },
velocity: { type: 'v3', value: [] },
alive: { type: 'f', value: [] },
age: { type: 'f', value: [] },
sizeStart: { type: 'f', value: [] },
sizeEnd: { type: 'f', value: [] },
angle: { type: 'f', value: [] },
angleAlignVelocity: { type: 'f', value: [] },
colorStart: { type: 'c', value: [] },
colorMiddle: { type: 'c', value: [] },
colorEnd: { type: 'c', value: [] },
opacityStart: { type: 'f', value: [] },
opacityMiddle: { type: 'f', value: [] },
opacityEnd: { type: 'f', value: [] }
>>>>>>>
acceleration: { type: 'v3', value: [] },
velocity: { type: 'v3', value: [] },
alive: { type: 'f', value: [] },
age: { type: 'f', value: [] },
sizeStart: { type: 'f', value: [] },
sizeEnd: { type: 'f', value: [] },
angle: { type: 'f', value: [] },
angleAlignVelocity: { type: 'f', value: [] },
colorStart: { type: 'c', value: [] },
colorMiddle: { type: 'c', value: [] },
colorEnd: { type: 'c', value: [] },
opacityStart: { type: 'f', value: [] },
opacityMiddle: { type: 'f', value: [] },
opacityEnd: { type: 'f', value: [] }
<<<<<<<
/**
* Given a base vector and a spread range vector, create
* a new THREE.Vector3 instance with randomised values.
*
* @private
*
* @param {THREE.Vector3} base
* @param {THREE.Vector3} spread
* @return {THREE.Vector3}
*/
_randomVector3: function( base, spread ) {
var v = new THREE.Vector3();
v.copy( base );
v.x += Math.random() * spread.x - (spread.x/2);
v.y += Math.random() * spread.y - (spread.y/2);
v.z += Math.random() * spread.z - (spread.z/2);
return v;
},
/**
* Create a new THREE.Color instance and given a base vector and
* spread range vector, assign random values.
*
* Note that THREE.Color RGB values are in the range of 0 - 1, not 0 - 255.
*
* @private
*
* @param {THREE.Vector3} base
* @param {THREE.Vector3} spread
* @return {THREE.Color}
*/
_randomColor: function( base, spread ) {
var v = new THREE.Color();
v.copy( base );
v.r += (Math.random() * spread.x) - (spread.x/2);
v.g += (Math.random() * spread.y) - (spread.y/2);
v.b += (Math.random() * spread.z) - (spread.z/2);
v.r = Math.max( 0, Math.min( v.r, 1 ) );
v.g = Math.max( 0, Math.min( v.g, 1 ) );
v.b = Math.max( 0, Math.min( v.b, 1 ) );
return v;
},
/**
* Create a random Number value based on an initial value and
* a spread range
*
* @private
*
* @param {Number} base
* @param {Number} spread
* @return {Number}
*/
_randomFloat: function( base, spread ) {
return base + spread * (Math.random() - 0.5);
},
/**
* Create a new THREE.Vector3 instance and project it onto a random point
* on a sphere with randomized radius.
*
* @param {THREE.Vector3} base
* @param {Number} radius
* @param {THREE.Vector3} radiusSpread
* @param {THREE.Vector3} radiusScale
*
* @private
*
* @return {THREE.Vector3}
*/
_randomVector3OnSphere: function( base, radius, radiusSpread, radiusScale ) {
var z = 2 * Math.random() - 1;
var t = 6.2832 * Math.random();
var r = Math.sqrt( 1 - z*z );
var vec = new THREE.Vector3( r * Math.cos(t), r * Math.sin(t), z );
vec.multiplyScalar( this._randomFloat( radius, radiusSpread ) );
if( radiusScale ) {
vec.multiply( radiusScale );
}
vec.add( base );
return vec;
},
/**
* Create a new THREE.Vector3 instance and project it onto a random point
* on a disk (in the XY-plane) centered at `base` and with randomized radius.
*
* @param {THREE.Vector3} base
* @param {Number} radius
* @param {THREE.Vector3} radiusSpread
* @param {THREE.Vector3} radiusScale
*
* @private
*
* @return {THREE.Vector3}
*/
_randomVector3OnDisk: function( base, radius, radiusSpread, radiusScale ) {
var t = 6.2832 * Math.random();
var vec = new THREE.Vector3( Math.cos(t), Math.sin(t), 0 ).multiplyScalar( this._randomFloat( radius, radiusSpread ) );
if ( radiusScale ) {
vec.multiply( radiusScale );
}
vec.add( base );
return vec ;
},
/**
* Create a new THREE.Vector3 instance, and given a sphere with center `base` and
* point `position` on sphere, set direction away from sphere center with random magnitude.
*
* @param {THREE.Vector3} base
* @param {THREE.Vector3} position
* @param {Number} speed
* @param {Number} speedSpread
*
* @private
*
* @return {THREE.Vector3}
*/
_randomVelocityVector3OnSphere: function( base, position, speed, speedSpread ) {
var direction = new THREE.Vector3().subVectors( base, position );
direction.normalize().multiplyScalar( this._randomFloat( speed, speedSpread ) );
return direction;
},
/**
* Given a base vector and a spread vector, randomise the given vector
* accordingly.
*
* @param {THREE.Vector3} vector
* @param {THREE.Vector3} base
* @param {THREE.Vector3} spread
*
* @private
*
* @return {[type]}
*/
_randomizeExistingVector3: function( vector, base, spread ) {
vector.set(
Math.random() * base.x - spread.x,
Math.random() * base.y - spread.y,
Math.random() * base.z - spread.z
);
},
=======
>>>>>>>
<<<<<<<
that.attributes.angle.needsUpdate = true;
=======
that.attributes.angle.needsUpdate = true;
that.attributes.angleAlignVelocity.needsUpdate = true;
>>>>>>>
that.attributes.angle.needsUpdate = true;
that.attributes.angleAlignVelocity.needsUpdate = true;
<<<<<<<
var vertices = that.geometry.vertices,
start = vertices.length,
end = emitter.numParticles + start,
a = that.attributes,
acceleration = a.acceleration.value,
velocity = a.velocity.value,
alive = a.alive.value,
age = a.age.value,
sizeStart = a.sizeStart.value,
sizeEnd = a.sizeEnd.value,
angle = a.angle.value,
colorStart = a.colorStart.value,
colorMiddle = a.colorMiddle.value,
colorEnd = a.colorEnd.value,
opacityStart = a.opacityStart.value,
opacityMiddle = a.opacityMiddle.value,
opacityEnd = a.opacityEnd.value;
emitter.particleIndex = parseFloat( start );
=======
var vertices = that.geometry.vertices,
start = vertices.length,
end = emitter.numParticles + start,
a = that.attributes,
acceleration = a.acceleration.value,
velocity = a.velocity.value,
alive = a.alive.value,
age = a.age.value,
sizeStart = a.sizeStart.value,
sizeEnd = a.sizeEnd.value,
angle = a.angle.value,
angleAlignVelocity = a.angleAlignVelocity.value,
colorStart = a.colorStart.value,
colorMiddle = a.colorMiddle.value,
colorEnd = a.colorEnd.value,
opacityStart = a.opacityStart.value,
opacityMiddle = a.opacityMiddle.value,
opacityEnd = a.opacityEnd.value;
emitter.particleIndex = parseFloat( start );
>>>>>>>
var vertices = that.geometry.vertices,
start = vertices.length,
end = emitter.numParticles + start,
a = that.attributes,
acceleration = a.acceleration.value,
velocity = a.velocity.value,
alive = a.alive.value,
age = a.age.value,
sizeStart = a.sizeStart.value,
sizeEnd = a.sizeEnd.value,
angle = a.angle.value,
angleAlignVelocity = a.angleAlignVelocity.value,
colorStart = a.colorStart.value,
colorMiddle = a.colorMiddle.value,
colorEnd = a.colorEnd.value,
opacityStart = a.opacityStart.value,
opacityMiddle = a.opacityMiddle.value,
opacityEnd = a.opacityEnd.value;
emitter.particleIndex = parseFloat( start );
<<<<<<<
=======
// Extend ShaderParticleGroup's prototype with functions from utils object.
for( var i in shaderParticleUtils ) {
ShaderParticleGroup.prototype[ '_' + i ] = shaderParticleUtils[i];
}
>>>>>>>
// Extend ShaderParticleGroup's prototype with functions from utils object.
for( var i in shaderParticleUtils ) {
ShaderParticleGroup.prototype[ '_' + i ] = shaderParticleUtils[i];
}
<<<<<<<
=======
'attribute float angleAlignVelocity;',
>>>>>>>
'attribute float angleAlignVelocity;',
<<<<<<<
=======
>>>>>>>
<<<<<<<
'float lerpAmount1 = (age / (0.5 * duration));', // percentage during first half
'float lerpAmount2 = ((age - 0.5 * duration) / (0.5 * duration));', // percentage during second half
'float halfDuration = duration / 2.0;',
'vAngle = angle;',
=======
'float lerpAmount1 = (age / (0.5 * duration));', // percentage during first half
'float lerpAmount2 = ((age - 0.5 * duration) / (0.5 * duration));', // percentage during second half
'float halfDuration = duration / 2.0;',
'vAngle = angle;',
>>>>>>>
'float lerpAmount1 = (age / (0.5 * duration));', // percentage during first half
'float lerpAmount2 = ((age - 0.5 * duration) / (0.5 * duration));', // percentage during second half
'float halfDuration = duration / 2.0;',
'vAngle = angle;',
<<<<<<<
'vec4 pos = GetPos();',
=======
'vec4 pos = vec4(0.0, 0.0, 0.0, 0.0);',
'pos = GetPos();',
'if( angleAlignVelocity == 1.0 ) {',
'vAngle = -atan(pos.y, pos.x);',
'}',
'else {',
'vAngle = 0.0;',
'}',
>>>>>>>
'vec4 pos = vec4(0.0, 0.0, 0.0, 0.0);',
'pos = GetPos();',
'if( angleAlignVelocity == 1.0 ) {',
'vAngle = -atan(pos.y, pos.x);',
'}',
'else {',
'vAngle = 0.0;',
'}', |
<<<<<<<
=======
program
.command('land')
.alias('l')
.description('Stop all created microservices')
.option('-d, --docker', 'terminate docker containers')
.action( () => {
if (!process.argv[3]) {
console.log(chalk.red('\nPlease enter a valid deployment option. See'),chalk.white('--help'), chalk.red(' for assistance\n'));
return;
}
// if inventory file doesn't exist, bootstrap file
fs.access('./inventory.txt', fs.constants.F_OK, err => {
const takeInventory = cb => {
const options = { encoding: 'utf-8' };
fs.readFile('./inventory.txt', options, (err, content) => {
if (err) return cb(err);
cb(null, content);
});
}
takeInventory( async (err, content) => {
await stop(content);
fs.unlink('inventory.txt', err => {
if (err) return console.log('Error unlinking inventory: ', err);
return console.log('Successfully cleaned up inventory');
});
});
});
});
>>>>>>>
program
.command('land')
.alias('l')
.description('Stop all created microservices')
.option('-d, --docker', 'terminate docker containers')
.action( () => {
if (!process.argv[3]) {
console.log(chalk.red('\nPlease enter a valid deployment option. See'),chalk.white('--help'), chalk.red(' for assistance\n'));
return;
}
// if inventory file doesn't exist, bootstrap file
fs.access('./inventory.txt', fs.constants.F_OK, err => {
const takeInventory = cb => {
const options = { encoding: 'utf-8' };
fs.readFile('./inventory.txt', options, (err, content) => {
if (err) return cb(err);
cb(null, content);
});
}
takeInventory( async (err, content) => {
await stop(content);
fs.unlink('inventory.txt', err => {
if (err) return console.log('Error unlinking inventory: ', err);
return console.log('Successfully cleaned up inventory');
});
});
});
}); |
<<<<<<<
const graphqlObj = require('./graphqlObj');
const createDockerfile = require('./createDockerfile');
=======
>>>>>>> |
<<<<<<<
USER_DATE_FORMAT: "Own date format (<a href='http://momentjs.com/docs/#/displaying/format/'>Syntax</a>)",
=======
USE_GITFTP: "Use Git-FTP",
>>>>>>>
USER_DATE_FORMAT: "Own date format (<a href='http://momentjs.com/docs/#/displaying/format/'>Syntax</a>)",
USE_GITFTP: "Use Git-FTP", |
<<<<<<<
=======
function askQuestion(title, question, options) {
options = options || {};
var response = q.defer();
var compiledTemplate = Mustache.render(questionDialogTemplate, {
title: title,
question: _.escape(question),
stringInput: !options.booleanResponse && !options.password,
passwordInput: options.password,
defaultValue: options.defaultValue,
Strings: Strings
});
var dialog = Dialogs.showModalDialogUsingTemplate(compiledTemplate);
if (!options.booleanResponse) {
dialog.getElement().find("input").focus();
}
dialog.done(function (buttonId) {
if (options.booleanResponse) {
response.resolve(buttonId === "ok");
return;
}
if (buttonId === "ok") {
response.resolve(dialog.getElement().find("input").val().trim());
} else {
response.reject("User aborted!");
}
});
return response.promise;
}
function handleGitPushWithPassword(originalPushError, remoteName) {
return Main.gitControl.getBranchName().then(function (branchName) {
if (!remoteName) {
throw ErrorHandler.rewrapError(originalPushError, new Error("handleGitPushWithPassword remote argument is empty!"));
}
return Main.gitControl.getGitConfig("remote." + remoteName + ".url").then(function (remoteUrl) {
if (!remoteUrl) {
throw ErrorHandler.rewrapError(originalPushError, new Error("git config remote." + remoteName + ".url is empty!"));
}
var isHttp = remoteUrl.indexOf("http") === 0;
if (!isHttp) {
throw ErrorHandler.rewrapError(originalPushError,
new Error("Asking for username/password aborted because remote is not HTTP(S)"));
}
var username,
password,
hasUsername,
hasPassword,
shouldSave = false;
var m = remoteUrl.match(/https?:\/\/([^@]+)@/);
if (!m) {
hasUsername = false;
hasPassword = false;
} else if (m[1].split(":").length === 1) {
hasUsername = true;
hasPassword = false;
} else {
hasUsername = true;
hasPassword = true;
}
if (hasUsername && hasPassword) {
throw ErrorHandler.rewrapError(originalPushError, new Error("Username/password is already present in the URL"));
}
var p = q();
if (!hasUsername) {
p = p.then(function () {
return askQuestion(Strings.TOOLTIP_PUSH, Strings.ENTER_USERNAME).then(function (str) {
username = encodeURIComponent(str);
});
});
}
if (!hasPassword) {
p = p.then(function () {
return askQuestion(Strings.TOOLTIP_PUSH, Strings.ENTER_PASSWORD, {password: true}).then(function (str) {
password = encodeURIComponent(str);
});
});
}
if (Preferences.get("storePlainTextPasswords")) {
p = p.then(function () {
return askQuestion(Strings.TOOLTIP_PUSH, Strings.SAVE_PASSWORD_QUESTION, {booleanResponse: true}).then(function (bool) {
shouldSave = bool;
});
});
}
return p.then(function () {
if (!hasUsername) {
remoteUrl = remoteUrl.replace(/(https?:\/\/)/, function (a, protocol) { return protocol + username + "@"; });
}
if (!hasPassword) {
var io = remoteUrl.indexOf("@");
remoteUrl = remoteUrl.substring(0, io) + ":" + password + remoteUrl.substring(io);
}
return Main.gitControl.gitPush(remoteUrl, branchName).then(function (stdout) {
if (shouldSave) {
return Main.gitControl.setGitConfig("remote." + remoteName + ".url", remoteUrl).then(function () {
return stdout;
});
} else {
return stdout;
}
});
});
});
});
}
function handleGitPush() {
var $btn = gitPanel.$panel.find(".git-push").prop("disabled", true).addClass("btn-loading"),
remoteName = gitPanel.$panel.find(".git-remote-selected").attr("data-remote-name");
Main.gitControl.gitPush(remoteName).fail(function (err) {
if (!ErrorHandler.contains(err, "git remote add <name> <url>")) {
throw err;
}
// this will ask user to enter an origin url for pushing
// it's pretty dumb because if he enters invalid url, he has to go to console again
// but our users are very wise so that definitely won't happen :)))
var defer = q.defer();
var compiledTemplate = Mustache.render(questionDialogTemplate, {
title: Strings.SET_ORIGIN_URL,
question: _.escape(Strings.URL),
stringInput: true,
Strings: Strings
});
var dialog = Dialogs.showModalDialogUsingTemplate(compiledTemplate);
dialog.getElement().find("input").focus();
dialog.done(function (buttonId) {
if (buttonId === "ok") {
var url = dialog.getElement().find("input").val().trim();
Main.gitControl.remoteAdd("origin", url)
.then(function () {
return Main.gitControl.gitPush("origin");
})
.then(defer.resolve)
.fail(defer.reject);
}
});
return defer.promise;
}).fail(function (err) {
if (typeof err !== "string") { throw err; }
var m = err.match(/git push --set-upstream (\S+) (\S+)/);
if (!m) { throw err; }
return Main.gitControl.gitPushSetUpstream(m[1], m[2]);
}).fail(function (err) {
var validFail = false;
if (ErrorHandler.contains(err, "rejected because")) {
validFail = true;
}
if (validFail) {
throw err;
} else {
console.warn("Traditional push failed: " + err);
return handleGitPushWithPassword(err, remoteName);
}
}).then(function (result) {
Dialogs.showModalDialog(
DefaultDialogs.DIALOG_ID_INFO,
Strings.GIT_PUSH_RESPONSE, // title
result // message
);
}).fail(function (err) {
console.warn("Pushing to remote repositories with username / password is not supported! See github page/issues for details.");
ErrorHandler.showError(err, "Pushing to remote repository failed.");
}).fin(function () {
$btn.prop("disabled", false).removeClass("btn-loading");
refresh();
});
}
function handleGitPull() {
var $btn = gitPanel.$panel.find(".git-pull").prop("disabled", true).addClass("btn-loading"),
remoteName = gitPanel.$panel.find(".git-remote-selected").attr("data-remote-name");
Main.gitControl.gitPull(remoteName).then(function (result) {
Dialogs.showModalDialog(
DefaultDialogs.DIALOG_ID_INFO,
Strings.GIT_PULL_RESPONSE, // title
result // message
);
}).fail(function (err) {
ErrorHandler.showError(err, "Pulling from remote repository failed.");
}).fin(function () {
$btn.prop("disabled", false).removeClass("btn-loading");
refresh();
});
}
>>>>>>>
<<<<<<<
EventEmitter.on(Events.GIT_REMOTE_AVAILABLE, function () {
gitPanel.$panel.find(".git-pull").prop("disabled", false);
gitPanel.$panel.find(".git-push").prop("disabled", false);
});
EventEmitter.on(Events.GIT_REMOTE_NOT_AVAILABLE, function () {
gitPanel.$panel.find(".git-pull").prop("disabled", true);
gitPanel.$panel.find(".git-push").prop("disabled", true);
});
EventEmitter.on(Events.PULL_STARTED, function () {
gitPanel.$panel.find(".git-pull").prop("disabled", true).addClass("btn-loading");
});
EventEmitter.on(Events.PULL_FINISHED, function () {
gitPanel.$panel.find(".git-pull").prop("disabled", false).removeClass("btn-loading");
refresh();
});
EventEmitter.on(Events.PUSH_STARTED, function () {
gitPanel.$panel.find(".git-push").prop("disabled", true).addClass("btn-loading");
});
EventEmitter.on(Events.PUSH_FINISHED, function () {
gitPanel.$panel.find(".git-push").prop("disabled", false).removeClass("btn-loading");
refresh();
});
=======
// Git-FTP FEATURES {
function handleGitFtpPush() {
var gitFtpRemote = gitPanel.$panel.find(".git-remote-selected").text().trim();
gitPanel.$panel.find(".gitftp-push").prop("disabled", true).addClass("btn-loading");
Main.gitControl.gitFtpPush(gitFtpRemote).done(function (result) {
Dialogs.showModalDialog(
DefaultDialogs.DIALOG_ID_INFO,
Strings.GITFTP_PUSH_RESPONSE, // title
result // message
);
gitPanel.$panel.find(".gitftp-push").prop("disabled", false).removeClass("btn-loading");
}).fail(function (err) {
ErrorHandler.showError(err, "Impossible push to Git-FTP remote.");
gitPanel.$panel.find(".gitftp-push").prop("disabled", false).removeClass("btn-loading");
});
}
// } Git-FTP FEATURES
>>>>>>>
EventEmitter.on(Events.GIT_REMOTE_AVAILABLE, function () {
gitPanel.$panel.find(".git-pull").prop("disabled", false);
gitPanel.$panel.find(".git-push").prop("disabled", false);
});
EventEmitter.on(Events.GIT_REMOTE_NOT_AVAILABLE, function () {
gitPanel.$panel.find(".git-pull").prop("disabled", true);
gitPanel.$panel.find(".git-push").prop("disabled", true);
});
EventEmitter.on(Events.PULL_STARTED, function () {
gitPanel.$panel.find(".git-pull").prop("disabled", true).addClass("btn-loading");
});
EventEmitter.on(Events.PULL_FINISHED, function () {
gitPanel.$panel.find(".git-pull").prop("disabled", false).removeClass("btn-loading");
refresh();
});
EventEmitter.on(Events.PUSH_STARTED, function () {
gitPanel.$panel.find(".git-push").prop("disabled", true).addClass("btn-loading");
});
EventEmitter.on(Events.PUSH_FINISHED, function () {
gitPanel.$panel.find(".git-push").prop("disabled", false).removeClass("btn-loading");
refresh();
});
<<<<<<<
.on("click", ".change-remote", EventEmitter.emitFactory(Events.HANDLE_REMOTE_PICK))
.on("click", ".remove-remote", EventEmitter.emitFactory(Events.HANDLE_REMOTE_DELETE))
.on("click", ".git-remote-new", EventEmitter.emitFactory(Events.HANDLE_REMOTE_CREATE))
=======
>>>>>>>
.on("click", ".change-remote", EventEmitter.emitFactory(Events.HANDLE_REMOTE_PICK))
.on("click", ".remove-remote", EventEmitter.emitFactory(Events.HANDLE_REMOTE_DELETE))
.on("click", ".git-remote-new", EventEmitter.emitFactory(Events.HANDLE_REMOTE_CREATE))
<<<<<<<
=======
Remotes.prepareRemotesPicker();
>>>>>>> |
<<<<<<<
if(data.servelocaldirectory){
var servelocaldirectoryname = data.servelocaldirectory.split(':');
servelocaldirectoryname = (servelocaldirectoryname.length == 2) ? servelocaldirectoryname[1] : null;
if(servelocaldirectoryname){
$("#servelocal").prop("checked",true);
$('.servelocal').removeClass('disabled');
$("#servelocaldirectory").data('directory',data.servelocaldirectory);
$("#servelocaldirectory").attr('value',servelocaldirectoryname);
}
}
if(data.servelocalhost){
$('#servelocalhost').children("[value='"+data.servelocalhost+"']").prop('selected',true);
}
if(data.servelocalport) $("#servelocalport").val(data.servelocalport);
=======
if(data.useragent) $('#useragent').val(data.useragent).siblings('label').addClass('active');
>>>>>>>
if(data.servelocaldirectory){
var servelocaldirectoryname = data.servelocaldirectory.split(':');
servelocaldirectoryname = (servelocaldirectoryname.length == 2) ? servelocaldirectoryname[1] : null;
if(servelocaldirectoryname){
$("#servelocal").prop("checked",true);
$('.servelocal').removeClass('disabled');
$("#servelocaldirectory").data('directory',data.servelocaldirectory);
$("#servelocaldirectory").attr('value',servelocaldirectoryname);
}
}
if(data.servelocalhost){
$('#servelocalhost').children("[value='"+data.servelocalhost+"']").prop('selected',true);
}
if(data.servelocalport) $("#servelocalport").val(data.servelocalport);
if(data.useragent) $('#useragent').val(data.useragent).siblings('label').addClass('active'); |
<<<<<<<
urls = data.url;
useragent = data.useragent;
defaultURL = urls[urlrotateindex];
if(data.multipleurlmode == 'rotate'){
rotaterate = data.rotaterate ? data.rotaterate : DEFAULT_ROTATE_RATE;
setInterval(rotateURL,rotaterate * 1000);
}
currentURL = defaultURL;
loadContent();
=======
currentURL = defaultURL = Array.isArray(data.url) ? data.url : [data.url];
useragent = data.useragent;
loadContent();
>>>>>>>
urls = Array.isArray(data.url) ? data.url : [data.url];
useragent = data.useragent;
defaultURL = urls[urlrotateindex];
if(data.multipleurlmode == 'rotate'){
rotaterate = data.rotaterate ? data.rotaterate : DEFAULT_ROTATE_RATE;
setInterval(rotateURL,rotaterate * 1000);
}
currentURL = defaultURL;
loadContent(); |
<<<<<<<
if(servelocal){
chrome.storage.local.set({'servelocaldirectory':servelocaldirectory});
chrome.storage.local.set({'servelocalhost':servelocalhost});
chrome.storage.local.set({'servelocalport':servelocalport});
}else{
chrome.storage.local.remove('servelocaldirectory');
chrome.storage.local.remove('servelocalhost');
chrome.storage.local.remove('servelocalport');
}
=======
if(resetcache) chrome.storage.local.set({'resetcache': resetcache});
else chrome.storage.local.remove('resetcache');
>>>>>>>
if(servelocal){
chrome.storage.local.set({'servelocaldirectory':servelocaldirectory});
chrome.storage.local.set({'servelocalhost':servelocalhost});
chrome.storage.local.set({'servelocalport':servelocalport});
}else{
chrome.storage.local.remove('servelocaldirectory');
chrome.storage.local.remove('servelocalhost');
chrome.storage.local.remove('servelocalport');
}
if(resetcache) chrome.storage.local.set({'resetcache': resetcache});
else chrome.storage.local.remove('resetcache'); |
<<<<<<<
Usage:
$(function () {
$("select, :radio, :checkbox").uniform();
});
You can customize the classes that Uniform uses:
$("select, :radio, :checkbox").uniform({
selectClass: 'mySelectClass',
radioClass: 'myRadioClass',
checkboxClass: 'myCheckboxClass',
checkedClass: 'myCheckedClass',
focusClass: 'myFocusClass'
});
=======
>>>>>>>
<<<<<<<
if ($.browser.msie && $.browser.version < 7) {
$.selectOpacity = false;
} else {
$.selectOpacity = true;
=======
if($.browser.msie && $.browser.version < 7){
$.support.selectOpacity = false;
}else{
$.support.selectOpacity = true;
>>>>>>>
if($.browser.msie && $.browser.version < 7){
$.support.selectOpacity = false;
}else{
$.support.selectOpacity = true;
<<<<<<<
function doCheckbox(elem) {
=======
function doCheckbox(elem){
var $el = $(elem);
>>>>>>>
function doCheckbox(elem){
var $el = $(elem);
<<<<<<<
function doRadio(elem) {
=======
function doRadio(elem){
var $el = $(elem);
>>>>>>>
function doRadio(elem){
var $el = $(elem);
<<<<<<<
var $el = elem,
divTag = $('<div />'),
filenameTag = $('<span>' + options.fileDefaultText + '</span>'),
btnTag = $('<span>' + options.fileBtnText + '</span>');
=======
var $el = $(elem);
var divTag = $('<div />'),
filenameTag = $('<span>'+options.fileDefaultText+'</span>'),
btnTag = $('<span>'+options.fileBtnText+'</span>');
if(!$el.css("display") == "none" && options.autoHide){
divTag.hide();
}
>>>>>>>
var $el = $(elem);
var divTag = $('<div />'),
filenameTag = $('<span>'+options.fileDefaultText+'</span>'),
btnTag = $('<span>'+options.fileBtnText+'</span>');
if(!$el.css("display") == "none" && options.autoHide){
divTag.hide();
}
<<<<<<<
if (options.useID) {
divTag.attr("id", options.idPrefix + "-" + $el.attr("id"));
=======
if(options.useID && $el.attr("id") != ""){
divTag.attr("id", options.idPrefix+"-"+$el.attr("id"));
>>>>>>>
if(options.useID && $el.attr("id") != ""){
divTag.attr("id", options.idPrefix+"-"+$el.attr("id"));
<<<<<<<
$.uniform.update = function (elem) {
if (typeof(elem) === "undefined") {
=======
function storeElement(elem){
//store this element in our global array
elem = $(elem).get();
if(elem.length > 1){
$.each(elem, function(i, val){
$.uniform.elements.push(val);
});
}else{
$.uniform.elements.push(elem);
}
}
//noSelect v1.0
$.uniform.noSelect = function(elem) {
function f() {
return false;
};
$(elem).each(function() {
this.onselectstart = this.ondragstart = f; // Webkit & IE
$(this)
.mousedown(f) // Webkit & Opera
.css({ MozUserSelect: 'none' }); // Firefox
});
};
$.uniform.update = function(elem){
if(elem == undefined){
>>>>>>>
function storeElement(elem) {
//store this element in our global array
elem = elem.get();
if (elem.length > 1) {
$.each(elem, function (i, val) {
$.uniform.elements.push(val);
});
} else {
$.uniform.elements.push(elem);
}
}
//noSelect v1.0
$.uniform.noSelect = function(elem) {
function f() {
return false;
};
$(elem).each(function() {
this.onselectstart = this.ondragstart = f; // Webkit & IE
$(this)
.mousedown(f) // Webkit & Opera
.css({ MozUserSelect: 'none' }); // Firefox
});
};
$.uniform.update = function(elem){
if(elem == undefined){
<<<<<<<
var $e = $(this), divTag, spanTag, filenameTag, btnTag;
=======
var $e = $(this);
>>>>>>>
var $e = $(this);
<<<<<<<
} else if ($e.is(":file")) {
divTag = $e.parent("div");
filenameTag = $e.siblings(options.filenameClass);
=======
}else if($e.is(":file")){
var divTag = $e.parent("div");
var filenameTag = $e.siblings(options.filenameClass);
>>>>>>>
} else if ($e.is(":file")){
var divTag = $e.parent("div");
var filenameTag = $e.siblings(options.filenameClass);
<<<<<<<
return this.each(function () {
if ($.selectOpacity) {
=======
return this.each(function() {
if($.support.selectOpacity){
>>>>>>>
return this.each(function() {
if($.support.selectOpacity){
<<<<<<<
if (elem.is("select:not([multiple])")) {
//element is a select, but not multiple
doSelect(elem);
} else if (elem.is(":checkbox")) {
=======
if(elem.is("select")){
//element is a select
if(elem.attr("multiple") != true){
//element is not a multi-select
if(elem.attr("size") == undefined || elem.attr("size") <= 1){
doSelect(elem);
}
}
}else if(elem.is(":checkbox")){
>>>>>>>
if(elem.is("select")){
//element is a select
if(elem.attr("multiple") != true){
//element is not a multi-select
if(elem.attr("size") == undefined || elem.attr("size") <= 1){
doSelect(elem);
}
}
}else if(elem.is(":checkbox")){ |
<<<<<<<
.bind("focus.uniform", function(){
divTag.addClass(options.focusClass);
})
.bind("blur.uniform", function(){
divTag.removeClass(options.focusClass);
})
.bind("click.uniform touchend.uniform", function(){
if(!$(elem).attr("checked")){
//box was just unchecked, uncheck span
spanTag.removeClass(options.checkedClass);
}else{
//box was just checked, check span.
spanTag.addClass(options.checkedClass);
=======
.bind({
"focus.uniform": function(){
divTag.addClass(options.focusClass);
},
"blur.uniform": function(){
divTag.removeClass(options.focusClass);
},
"click.uniform touchend.uniform": function(){
if ( $(elem).is(":checked") ) {
// the checkbox is clicked by user and its state was un checked
// so just add checked class and attribute
$(elem).attr("checked", "checked");
spanTag.addClass(options.checkedClass);
} else {
// user click checkbox when its state was checked, so we'll need to
// remove the checked class from span and attribute of the checkbox element
$(elem).removeAttr("checked");
spanTag.removeClass(options.checkedClass);
}
},
"mousedown.uniform touchbegin.uniform": function() {
divTag.addClass(options.activeClass);
},
"mouseup.uniform touchend.uniform": function() {
divTag.removeClass(options.activeClass);
},
"mouseenter.uniform": function() {
divTag.addClass(options.hoverClass);
},
"mouseleave.uniform": function() {
divTag.removeClass(options.hoverClass);
divTag.removeClass(options.activeClass);
>>>>>>>
.bind("focus.uniform", function(){
divTag.addClass(options.focusClass);
})
.bind("blur.uniform", function(){
divTag.removeClass(options.focusClass);
})
.bind("click.uniform touchend.uniform", function(){
if ( $(elem).is(":checked") ) {
// the checkbox is clicked by user and its state was un checked
// so just add checked class and attribute
$(elem).attr("checked", "checked");
spanTag.addClass(options.checkedClass);
} else {
// user click checkbox when its state was checked, so we'll need to
// remove the checked class from span and attribute of the checkbox element
$(elem).removeAttr("checked");
spanTag.removeClass(options.checkedClass);
} |
<<<<<<<
if(options.useID && elem.attr("id")){
=======
/**
* Thanks to @MaxEvron @kjantzer and @furkanmustafa from GitHub
*/
if(options.selectAutoWidth){
var origElemWidth = $el.width();
var origDivWidth = divTag.width();
var origSpanWidth = spanTag.width();
var adjustDiff = origSpanWidth-origElemWidth;
divTag.width(origDivWidth - adjustDiff + 25);
$el.width(origElemWidth + 32);
$el.css('left','2px');
spanTag.width(origElemWidth);
}
if(options.useID && elem.attr("id") != ""){
>>>>>>>
/**
* Thanks to @MaxEvron @kjantzer and @furkanmustafa from GitHub
*/
if(options.selectAutoWidth){
var origElemWidth = $el.width();
var origDivWidth = divTag.width();
var origSpanWidth = spanTag.width();
var adjustDiff = origSpanWidth-origElemWidth;
divTag.width(origDivWidth - adjustDiff + 25);
$el.width(origElemWidth + 32);
$el.css('left','2px');
spanTag.width(origElemWidth);
}
if(options.useID && elem.attr("id")){
<<<<<<<
if($(elem).is(":disabled")){
=======
if ($el.attr("disabled")) {
>>>>>>>
if($el.is(":disabled")){
<<<<<<<
.bind({
"focus.uniform": function(){
divTag.addClass(options.focusClass);
},
"blur.uniform": function(){
divTag.removeClass(options.focusClass);
},
"click.uniform touchend.uniform": function(){
if(!$(elem).is(":checked")){
//box was just unchecked, uncheck span
spanTag.removeClass(options.checkedClass);
}else{
//box was just checked, check span.
=======
.bind("focus.uniform", function(){
divTag.addClass(options.focusClass);
})
.bind("blur.uniform", function(){
divTag.removeClass(options.focusClass);
})
.bind("click.uniform touchend.uniform", function(){
if ( $(elem).is(":checked") ) {
// the checkbox is clicked by user and its state was un checked
// so just add checked class and attribute
$(elem).attr("checked", "checked");
>>>>>>>
.bind("focus.uniform", function(){
divTag.addClass(options.focusClass);
})
.bind("blur.uniform", function(){
divTag.removeClass(options.focusClass);
})
.bind("click.uniform touchend.uniform", function(){
if ( $el.is(":checked") ) {
// the checkbox is clicked by user and its state was un checked
// so just add checked class and attribute
$(elem).attr("checked", "checked");
<<<<<<<
if($(elem).is(":checked")){
=======
if($el.attr("checked")){
$el.attr("checked", "checked"); // helpful when its by-default checked
>>>>>>>
if($el.is(":checked")){
$el.attr("checked", "checked"); // helpful when its by-default checked
<<<<<<<
if($(elem).is(":disabled")){
=======
if ($el.attr("disabled")) {
>>>>>>>
if($el.is(":disabled")){
<<<<<<<
.bind({
"focus.uniform": function(){
divTag.addClass(options.focusClass);
},
"blur.uniform": function(){
divTag.removeClass(options.focusClass);
},
"click.uniform touchend.uniform": function(){
if(!$(elem).is(":checked")){
//box was just unchecked, uncheck span
spanTag.removeClass(options.checkedClass);
}else{
//box was just checked, check span
var classes = options.radioClass.split(" ")[0];
$("." + classes + " span." + options.checkedClass + ":has([name='" + $(elem).attr('name') + "'])").removeClass(options.checkedClass);
spanTag.addClass(options.checkedClass);
}
},
"mousedown.uniform touchend.uniform": function() {
if(!$(elem).is(":disabled")){
divTag.addClass(options.activeClass);
}
},
"mouseup.uniform touchbegin.uniform": function() {
divTag.removeClass(options.activeClass);
},
"mouseenter.uniform touchend.uniform": function() {
divTag.addClass(options.hoverClass);
},
"mouseleave.uniform": function() {
divTag.removeClass(options.hoverClass);
divTag.removeClass(options.activeClass);
=======
.bind("focus.uniform", function(){
divTag.addClass(options.focusClass);
})
.bind("blur.uniform", function(){
divTag.removeClass(options.focusClass);
})
.bind("click.uniform touchend.uniform", function(){
if(!$(elem).attr("checked")){
//box was just unchecked, uncheck span
spanTag.removeClass(options.checkedClass);
}else{
//box was just checked, check span
var classes = options.radioClass.split(" ")[0];
$("." + classes + " span." + options.checkedClass + ":has([name='" + $(elem).attr('name') + "'])").removeClass(options.checkedClass);
spanTag.addClass(options.checkedClass);
>>>>>>>
.bind("focus.uniform", function(){
divTag.addClass(options.focusClass);
})
.bind("blur.uniform", function(){
divTag.removeClass(options.focusClass);
})
.bind("click.uniform touchend.uniform", function(){
if(!$(elem).is(":checked")){
//box was just unchecked, uncheck span
spanTag.removeClass(options.checkedClass);
}else{
//box was just checked, check span
var classes = options.radioClass.split(" ")[0];
$("." + classes + " span." + options.checkedClass + ":has([name='" + $(elem).attr('name') + "'])").removeClass(options.checkedClass);
spanTag.addClass(options.checkedClass);
<<<<<<<
if($(elem).is(":checked")){
=======
if ($el.attr("checked")) {
>>>>>>>
if($el.is(":checked")){
<<<<<<<
if($(elem).is(":disabled")){
=======
if ($el.attr("disabled")) {
>>>>>>>
if($el.is(":disabled")){
<<<<<<<
if($el.is(":disabled")){
=======
if ($el.attr("disabled")) {
>>>>>>>
if($el.is(":disabled")){
<<<<<<<
if(elem.is("select")){
//element is a select
if(!this.multiple){
//element is not a multi-select
if(elem.attr("size") == undefined || elem.attr("size") <= 1){
doSelect(elem);
=======
if(!elem.hasClass("unified")) {
if(elem.is("select")){
//element is a select
if(elem.attr("multiple") != true){
//element is not a multi-select
if(elem.attr("size") == undefined || elem.attr("size") <= 1){
doSelect(elem);
}
>>>>>>>
if(!elem.hasClass("unified")) {
if(elem.is("select")){
//element is a select
if(!this.multiple){
//element is not a multi-select
if(elem.attr("size") == undefined || elem.attr("size") <= 1){
doSelect(elem);
} |
<<<<<<<
grunt.loadNpmTasks('grunt-webfont');
grunt.loadNpmTasks('grunt-regarde');
=======
>>>>>>>
grunt.loadNpmTasks('grunt-webfont');
<<<<<<<
=======
grunt.loadNpmTasks('grunt-jekyll');
grunt.loadNpmTasks('grunt-regarde');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-open');
>>>>>>>
grunt.loadNpmTasks('grunt-jekyll');
grunt.loadNpmTasks('grunt-regarde');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-open');
<<<<<<<
=======
},*/
// some shell cmds
shell: {
svgToFonts: {
command: './bin/fontcustom.sh',
options: {
stdout: true
}
}
>>>>>>>
<<<<<<<
grunt.registerTask('default', ['dev', 'livereload-start', 'regarde']);
grunt.registerTask('build', ['clean:dist', 'jekyll:copy', 'jekyll:dist', 'clean:jekyll', 'copy:root', 'webfont:icons', 'copy:images', 'copy:static', 'copy:medias', 'concat:dist']);
grunt.registerTask('dev', ['jshint', 'build', 'compass:dev']);
grunt.registerTask('dist', ['jshint', 'build', 'compass:dist', 'uglify:dist', 'imagemin:dist']);
=======
// main commands
grunt.registerTask('default', ['dev', 'livereload-start', 'server', 'open:dev', 'regarde']);
grunt.registerTask('dist', ['jshint', 'build', 'compass:dist', 'uglify:dist', 'imagemin:dist', 'clean:build']);
grunt.registerTask('dev', ['jshint', 'build', 'compass:dev']);
grunt.registerTask('build', ['clean:dist', 'jekyll:dist', 'copy:root', 'shell:svgToFonts', 'copy:images', 'copy:static', 'copy:medias', 'concat:dist']);
>>>>>>>
// main commands
grunt.registerTask('default', ['dev', 'livereload-start', 'server', 'open:dev', 'regarde']);
grunt.registerTask('dist', ['jshint', 'build', 'compass:dist', 'uglify:dist', 'imagemin:dist', 'clean:build']);
grunt.registerTask('dev', ['jshint', 'build', 'compass:dev']);
grunt.registerTask('build', ['clean:dist', 'jekyll:dist', 'copy:root', 'webfont:svgToFonts', 'copy:images', 'copy:static', 'copy:medias', 'concat:dist']); |
<<<<<<<
require('pdfjs-dist/web/pdf_viewer');
var PdfViewerComponent = (function (_super) {
__extends(PdfViewerComponent, _super);
=======
var PdfViewerComponent = (function () {
>>>>>>>
require('pdfjs-dist/web/pdf_viewer');
var PdfViewerComponent = (function () {
<<<<<<<
this.isInitialised = false;
this._enhanceTextSelection = false;
this._pageBorder = false;
this._externalLinkTarget = 'blank';
=======
this.afterLoadComplete = new core_1.EventEmitter();
>>>>>>>
this._enhanceTextSelection = false;
this._pageBorder = false;
this._externalLinkTarget = 'blank';
this.afterLoadComplete = new core_1.EventEmitter();
<<<<<<<
this.render();
this.wasInvalidPage = false;
}
else if (isNaN(_page)) {
this.pageChange.emit(null);
}
else if (!this.wasInvalidPage) {
this.wasInvalidPage = true;
this.pageChange.emit(this._page);
=======
this.pageChange.emit(_page);
>>>>>>>
this.pageChange.emit(_page);
<<<<<<<
if (this._pdf) {
this.setupViewer();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(PdfViewerComponent.prototype, "renderLink", {
set: function (renderLink) {
this._renderLink = renderLink;
if (this._pdf) {
this.setupViewer();
}
=======
>>>>>>>
if (this._pdf) {
this.setupViewer();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(PdfViewerComponent.prototype, "renderLink", {
set: function (renderLink) {
this._renderLink = renderLink;
if (this._pdf) {
this.setupViewer();
}
<<<<<<<
if (this._pdf) {
this.updateSize();
}
=======
>>>>>>>
if (this._pdf) {
this.updateSize();
}
<<<<<<<
if (this._pdf) {
this.render();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(PdfViewerComponent.prototype, "stickToPage", {
set: function (value) {
this._stickToPage = value;
if (this._pdf) {
this.render();
}
=======
>>>>>>>
},
enumerable: true,
configurable: true
});
Object.defineProperty(PdfViewerComponent.prototype, "stickToPage", {
set: function (value) {
this._stickToPage = value;
<<<<<<<
if (this._pdf) {
this.updateSize();
}
=======
>>>>>>>
if (this._pdf) {
this.updateSize();
}
<<<<<<<
if (!this._originalSize) {
this._pdf.getPage(this._pdfViewer._currentPageNumber).then(function (page) {
var scale = _this._zoom * (_this.element.nativeElement.offsetWidth / page.getViewport(1).width) / PdfViewerComponent.CSS_UNITS;
_this._pdfViewer._setScale(scale, !_this._stickToPage);
});
}
else {
this._pdfViewer._setScale(this._zoom, !this._stickToPage);
}
=======
var container = this.element.nativeElement.querySelector('div');
var page = 1;
this.removeAllChildNodes(container);
this.renderPage(page++).then(function () {
if (page <= _this._pdf.numPages) {
return _this.renderPage(page++);
}
});
>>>>>>>
if (!this._originalSize) {
this._pdf.getPage(this._pdfViewer._currentPageNumber).then(function (page) {
var scale = _this._zoom * (_this.element.nativeElement.offsetWidth / page.getViewport(1).width) / PdfViewerComponent.CSS_UNITS;
_this._pdfViewer._setScale(scale, !_this._stickToPage);
});
}
else {
this._pdfViewer._setScale(this._zoom, !this._stickToPage);
}
<<<<<<<
template: "<div class=\"ng2-pdf-viewer-container\"><div id=\"viewer\" class=\"pdfViewer\"></div></div>",
styles: ["\n.ng2-pdf-viewer--zoom {\n overflow-x: scroll;\n}\n\n:host >>> .ng2-pdf-viewer-container > div {\n position: relative;\n}\n\n:host >>> .textLayer {\n font-family: sans-serif;\n overflow: hidden;\n}\n "]
=======
template: "<div class=\"ng2-pdf-viewer-container\" [ngClass]=\"{'ng2-pdf-viewer--zoom': zoom < 1}\"></div>",
styles: ["\n.ng2-pdf-viewer--zoom {\n overflow-x: scroll;\n}\n\n:host >>> .ng2-pdf-viewer-container > div {\n position: relative;\n z-index: 0;\n}\n\n:host >>> .textLayer {\n font-family: sans-serif;\n overflow: hidden;\n}\n "]
>>>>>>>
template: "<div class=\"ng2-pdf-viewer-container\"><div id=\"viewer\" class=\"pdfViewer\"></div></div>",
styles: ["\n.ng2-pdf-viewer--zoom {\n overflow-x: scroll;\n}\n\n:host >>> .ng2-pdf-viewer-container > div {\n position: relative;\n z-index: 0;\n}\n\n:host >>> .textLayer {\n font-family: sans-serif;\n overflow: hidden;\n}\n "]
<<<<<<<
'afterLoadComplete': [{ type: core_1.Input, args: ['after-load-complete',] },],
'src': [{ type: core_1.Input, args: ['src',] },],
'page': [{ type: core_1.Input, args: ['page',] },],
=======
'afterLoadComplete': [{ type: core_1.Output, args: ['after-load-complete',] },],
'src': [{ type: core_1.Input },],
'page': [{ type: core_1.Input },],
>>>>>>>
'afterLoadComplete': [{ type: core_1.Output, args: ['after-load-complete',] },],
'src': [{ type: core_1.Input },],
'page': [{ type: core_1.Input, args: ['page',] },], |
<<<<<<<
/* Also run message filters on the filtered plugins. */
filtered.forEach(function(plugin){
plugin.computed.messages = plugin.getUIMessages();
});
=======
/* Also run message filters on the current card elements. */
var cards = document.getElementById('main').getElementsByTagName('loot-plugin-card');
for (var i = 0; i < cards.length; ++i) {
// Force re-filtering of messages.
if (cards[i].data) {
cards[i].data.computed.messages = cards[i].data.getUIMessages();
cards[i].onMessagesChange();
}
}
/* Now perform search again. If there is no current search, this won't
do anything. */
document.getElementById('searchBar').search();
>>>>>>>
/* Also run message filters on the filtered plugins. */
filtered.forEach(function(plugin){
plugin.computed.messages = plugin.getUIMessages();
});
/* Now perform search again. If there is no current search, this won't
do anything. */
document.getElementById('searchBar').search(); |
<<<<<<<
const writeables = [];
const snapshots = [];
const initialRender = [];
const setters = [];
let readables = [];
=======
export const writeables = [];
export const snapshots = [];
export const initialRender = [];
export let readables = [];
>>>>>>>
export const writeables = [];
export const snapshots = [];
export const initialRender = [];
export const setters = [];
export let readables = []; |
<<<<<<<
=======
var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET
>>>>>>>
var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET |
<<<<<<<
router.post('/conversations/:project_id/environment/:env', importConversationValidator, importConversation);
router.get('/conversations/:project_id/environment/:env/latest-imported-event', latestImportValidator, latestImport);
router.post('/rasa/restart', restartRasaValidator, restartRasa);
router.post('/webhook/deploy', deployModelValidator, deployModel);
=======
>>>>>>>
router.post('/rasa/restart', restartRasaValidator, restartRasa);
router.post('/webhook/deploy', deployModelValidator, deployModel); |
<<<<<<<
import rolesDataTypes from './rolesData/schemas';
import rolesDataResolver from './rolesData/resolvers/rolesDataResolver';
=======
import storiesTypes from './story/schemas/stories.types.graphql';
import storiesResolver from './story/resolvers/storiesResolver';
>>>>>>>
import storiesTypes from './story/schemas/stories.types.graphql';
import storiesResolver from './story/resolvers/storiesResolver';
import rolesDataTypes from './rolesData/schemas';
import rolesDataResolver from './rolesData/resolvers/rolesDataResolver'; |
<<<<<<<
import './testwebgl.js';
import './object-spec.js';
=======
import './testwebgl.js';
// import './testcore.js';
>>>>>>>
import './testwebgl.js';
import './object-spec.js';
// import './testcore.js'; |
<<<<<<<
rfb.send(
Word8(clientMsgTypes.fbUpdate),
Word8(1),
Word16be(0),
Word16be(0),
Word16be(vars.fbWidth),
Word16be(vars.fbHeight)
=======
rfb.fbWidth = vars.fbWidth;
rfb.fbHeight = vars.fbHeight;
})
.tap(function (vars) {
rfb.bufferedSend(
Word8(clientMsgTypes.setEncodings),
Pad8(),
Word16be(2), // number of encodings following
Word32be(encodings.raw),
Word32be(encodings.copyRect)
>>>>>>>
rfb.fbWidth = vars.fbWidth;
rfb.fbHeight = vars.fbHeight;
rfb.send(
Word8(clientMsgTypes.setEncodings),
Pad8(),
Word16be(2), // number of encodings following
Word32be(encodings.raw),
Word32be(encodings.copyRect) |
<<<<<<<
let messages = {};
if (schemaType.messages && typeof schemaType.messages == "object")
messages = schemaType.messages;
if (!messages["required"])
messages["required"] = this.messages["required"];
if (!messages[schemaType.type])
messages[schemaType.type] = this.messages[schemaType.type];
Object.keys(schemaType).forEach(rule => {
if (rule == "type" || rule == "items" || rule == "props" || rule == "messages") return;
let key = schemaType.type.toLowerCase() + rule[0].toUpperCase() + rule.substring(1);
if (!(key in messages)) messages[key] = this.messages[key];
});
return messages;
=======
let messages = {};
if (schemaType.messages && typeof schemaType.messages == "object")
messages = schemaType.messages;
if (!("required" in messages))
messages["required"] = this.messages["required"];
if (!(schemaType.type in messages))
messages[schemaType.type] = this.messages[schemaType.type];
Object.keys(schemaType).forEach(rule => {
if (rule == "type" || rule == "items" || rule == "props" || rule == "messages") return;
let key = schemaType.type.toLowerCase() + rule[0].toUpperCase() + rule.substring(1);
if (!(key in messages)) messages[key] = this.messages[key];
})
return messages;
>>>>>>>
let messages = {};
if (schemaType.messages && typeof schemaType.messages == "object")
messages = schemaType.messages;
if (!("required" in messages))
messages["required"] = this.messages["required"];
if (!(schemaType.type in messages))
messages[schemaType.type] = this.messages[schemaType.type];
Object.keys(schemaType).forEach(rule => {
if (rule == "type" || rule == "items" || rule == "props" || rule == "messages") return;
let key = schemaType.type.toLowerCase() + rule[0].toUpperCase() + rule.substring(1);
if (!(key in messages)) messages[key] = this.messages[key];
});
return messages; |
<<<<<<<
schema: deepExtend(schema, this.defaults[schema.type], { overrideDest: false }),
ruleFunction: ruleFunction
=======
schema: schema,
ruleFunction: ruleFunction,
customValidation: () => ""
>>>>>>>
schema: deepExtend(schema, this.defaults[schema.type], { overrideDest: false }),
ruleFunction: ruleFunction,
customValidation: () => "" |
<<<<<<<
in ${getVariationPathFromComponentPath(this.props.componentPath)}/meta.js`}
=======
in ${this.props.variationBasePath}/${getVariationComponentPath(this.props.componentPath)}/meta.js`}
{/* eslint-enable max-len */}
>>>>>>>
in ${this.props.variationBasePath}/${getVariationPathFromComponentPath(this.props.componentPath)}/meta.js`}
{/* eslint-enable max-len */}
<<<<<<<
componentPath={getVariationPathFromComponentPath(this.props.componentPath)}
=======
componentPath={getVariationComponentPath(this.props.componentPath)}
variationBasePath={this.props.variationBasePath}
>>>>>>>
componentPath={getVariationPathFromComponentPath(this.props.componentPath)}
variationBasePath={this.props.variationBasePath} |
<<<<<<<
=======
// Get the bundled Styleguide Client
const clientApi = fs.readFileSync(path.join(__dirname, 'client-api.js'));
const clientJs = fs.readFileSync(path.join(__dirname, 'client-bundle.js'));
>>>>>>>
<<<<<<<
</html>`;
// And emit that HTML template as 'styleguide.html'
compilation.assets['styleguide/index.html'] = {
source: () => {
return html;
},
size: () => html.length,
=======
</html>
`;
const styleguidePath = this.options.dest || 'styleguide/index.html';
// And emit that HTML template as 'styleguide/index.html'
compilation.assets[styleguidePath] = {
source: () => html,
size: () => 0,
>>>>>>>
</html>`;
const styleguidePath = this.options.dest || 'styleguide/index.html';
// And emit that HTML template as 'styleguide.html'
compilation.assets[styleguidePath] = {
source: () => {
return html;
},
size: () => html.length, |
<<<<<<<
import CallStats from '../CallStats'
=======
import styles from './styles.css';
>>>>>>>
import CallStats from '../CallStats'
import styles from './styles.css';
<<<<<<<
<div className="contact-preview">
{contact.avatarUrl ?
<img src={contact.avatarUrl} height="50" width="50" role="presentation" /> : null
}
<h5>{contact.firstName} {contact.lastName}</h5>
<CallStats calls={calls} onAddCall={onAddCall} receiverId={contact.id} />
=======
<div className={styles.root}>
<div className={styles.top}>
{contact.avatarUrl ?
<img
src={contact.avatarUrl}
className={styles.avatar}
role="presentation"
/> :
<div className={styles.avatarFallback}>
{contact.firstName[0]}
</div>
}
<div className={styles.name}>
{contact.firstName} {contact.lastName}
</div>
</div>
<div className={styles.phone}>
{contact.phone && contact.phone.map((number) => (
<div className={styles.number}>{number}</div>
))}
</div>
>>>>>>>
<div className={styles.root}>
<div className={styles.top}>
{contact.avatarUrl ?
<img
src={contact.avatarUrl}
className={styles.avatar}
role="presentation"
/> :
<div className={styles.avatarFallback}>
{contact.firstName[0]}
</div>
}
<div className={styles.name}>
{contact.firstName} {contact.lastName}
</div>
</div>
<div className={styles.phone}>
{contact.phone && contact.phone.map((number) => (
<div className={styles.number}>{number}</div>
))}
</div>
<CallStats calls={calls} onAddCall={onAddCall} receiverId={contact.id} /> |
<<<<<<<
is_gop == 1 ? (width_spec - 5) + "px" :
(width_spec < 0 ? (-width_spec) + "px" : width_spec + "ch"));
=======
width_spec <= 0 ? "3ch" :
(is_gop == 1 ? width_spec + "px" :
width_spec + "ch"));
if (is_gop == 1) {
p.style.setProperty("min-height", height_spec + "px");
}
>>>>>>>
is_gop == 1 ? (width_spec - 5) + "px" :
(width_spec < 0 ? (-width_spec) + "px" : width_spec + "ch"));
if (is_gop == 1) {
p.style.setProperty("min-height", height_spec + "px");
} |
<<<<<<<
var errorRegex = /index:\s*.+?\.\$(\S*)\s*dup key:\s*\{(.*?)\}/;
var indexesCache = {};
=======
var errorRegex = /index:\s*(?:.+?\.\$)?(\S*)\s*dup key:\s*\{(.*?)\}/;
>>>>>>>
var errorRegex = /index:\s*(?:.+?\.\$)?(\S*)\s*dup key:\s*\{(.*?)\}/;
var indexesCache = {}; |
<<<<<<<
import { checkIfCan } from '../../lib/scopes';
import { formatNewlines, formatTextOnSave } from './response.utils';
=======
import { formatTextOnSave } from './response.utils';
>>>>>>>
import { checkIfCan } from '../../lib/scopes';
import { formatTextOnSave } from './response.utils';
<<<<<<<
checkIfCan('responses:w', projectId);
check(lang, String);
=======
check(lang, String);
>>>>>>>
checkIfCan('responses:w', projectId);
check(lang, String);
<<<<<<<
checkIfCan('responses:w', projectId);
check(templates, Match.OneOf(String, [Object]));
=======
check(templates, Match.OneOf(String, [Object]));
>>>>>>>
checkIfCan('responses:w', projectId);
check(templates, Match.OneOf(String, [Object]));
<<<<<<<
checkIfCan('responses:w', projectId);
check(arg, Match.OneOf(String, [String]));
=======
check(arg, Match.OneOf(String, [String]));
>>>>>>>
checkIfCan('responses:w', projectId);
check(arg, Match.OneOf(String, [String])); |
<<<<<<<
function Router(opts, sep) {
this.routes = opts.routes;
this.opts = opts;
this.sep = sep || '';
this.go(location.pathname);
self = this;
}
Router.prototype.exec = function(path) {
for(var r in this.routes) {
var route = getRegExp(r);
if (!route.test(path)) {
continue;
}
if (typeof this.routes[r] === 'function') {
this.routes[r].apply(this, extractParams(route, path));
} else {
var fn = this.opts[this.routes[r]];
fn ? fn.apply(this, extractParams(route, path)) : void 0;
}
}
};
Router.prototype.emmit = function(path) {
if('pushState' in history) {
path = path.state.path;
}else {
path = location.href.split('#')[1] || '';
}
self.exec(path);
}
Router.prototype.start = function() {
win.addEventListener ? win.addEventListener(evt, this.emmit, false) : win.attachEvent('on' + evt, this.emmit)
};
Router.prototype.stop = function() {
win.removeEventListener ? win.removeEventListener(evt, this.emmit, false) : win.detachEvent('on' + evt, this.emmit);
};
Router.prototype.go = function(path) {
if('pushState' in history) {
history.pushState({path: path}, document.title, path);
}else {
if(this.sep !== '/') {
location.hash = this.sep + path;
}
}
this.exec(path);
};
Router.prototype.hold = function(e) {
if(!e) return;
var path = e.srcElement.pathname;
if(!('pushState' in history)) {
path = '/' + path;
}
this.go(path);
if(e && e.preventDefault) {
e.preventDefault();
}else {
if(this.sep !== '/') {
e.returnValue = false;
return false;
}
}
};
Router.prototype.back = function() {
history.back();
};
if(typeof exports === 'object') {
module.exports = Router;
}else if(typeof define === 'function' && define.amd) {
define(function() { return window.MinRouter = Router; })
}else {
window.MinRouter = Router;
}
=======
function Router(opts) {
this.opts = opts;
this.routes = opts.routes;
this.sep = opts.sep || '';
this.exec(location.pathname);
this.holdLinks(opts.links || []);
self = this;
}
Router.prototype.exec = function(path) {
for(var r in this.routes) {
var route = getRegExp(r);
if (!route.test(path)) {
continue;
}
if (typeof this.routes[r] === 'function') {
this.routes[r].apply(this, extractParams(route, path));
} else {
var fn = this.opts[this.routes[r]];
fn ? fn.apply(this, extractParams(route, path)) : void 0;
}
}
};
Router.prototype.emmit = function(path) {
if(supportPushState) {
path = path.state.path;
}else {
path = location.href.split('#')[1] || '';
}
self.exec(path);
}
Router.prototype.start = function() {
win.addEventListener ? win.addEventListener(evt, this.emmit, false) : win.attachEvent('on' + evt, this.emmit)
};
Router.prototype.stop = function() {
win.removeEventListener ? win.removeEventListener(evt, this.emmit, false) : win.detachEvent('on' + evt, this.emmit);
};
Router.prototype.go = function(path) {
if(supportPushState) {
history.pushState({path: path}, document.title, path);
}else {
if(this.sep !== '/') {
location.hash = this.sep + path;
}
}
this.exec(path);
};
Router.prototype.back = function() {
history.back();
};
Router.prototype.hold = function(e) {
if(!e) return;
var path = e.srcElement.pathname;
if(!supportPushState) {
path = '/' + path;
}
this.go(path);
if(e && e.preventDefault) {
e.preventDefault();
}else {
if(this.sep !== '/') {
e.returnValue = false;
return false;
}
}
};
Router.prototype.holdLinks = function(links) {
for(var i = 0; i < links.length; i++) {
links[i].onclick = function(e) {
self.hold(e);
}
}
};
if(typeof exports === 'object') {
module.exports = Router;
}else if(typeof define === 'function' && define.amd) {
define(function() { return window.MinRouter = Router; })
}else {
window.MinRouter = Router;
}
>>>>>>>
function Router(opts) {
this.opts = opts;
this.routes = opts.routes;
this.sep = opts.sep || '';
this.go(location.pathname);
this.holdLinks(opts.links || []);
self = this;
}
Router.prototype.exec = function(path) {
for(var r in this.routes) {
var route = getRegExp(r);
if (!route.test(path)) {
continue;
}
if (typeof this.routes[r] === 'function') {
this.routes[r].apply(this, extractParams(route, path));
} else {
var fn = this.opts[this.routes[r]];
fn ? fn.apply(this, extractParams(route, path)) : void 0;
}
}
};
Router.prototype.emmit = function(path) {
if(supportPushState) {
path = path.state.path;
}else {
path = location.href.split('#')[1] || '';
}
self.exec(path);
}
Router.prototype.start = function() {
win.addEventListener ? win.addEventListener(evt, this.emmit, false) : win.attachEvent('on' + evt, this.emmit)
};
Router.prototype.stop = function() {
win.removeEventListener ? win.removeEventListener(evt, this.emmit, false) : win.detachEvent('on' + evt, this.emmit);
};
Router.prototype.go = function(path) {
if(supportPushState) {
history.pushState({path: path}, document.title, path);
}else {
if(this.sep !== '/') {
location.hash = this.sep + path;
}
}
this.exec(path);
};
Router.prototype.back = function() {
history.back();
};
Router.prototype.hold = function(e) {
if(!e) return;
var path = e.srcElement.pathname;
if(!supportPushState) {
path = '/' + path;
}
this.go(path);
if(e && e.preventDefault) {
e.preventDefault();
}else {
if(this.sep !== '/') {
e.returnValue = false;
return false;
}
}
};
Router.prototype.holdLinks = function(links) {
for(var i = 0; i < links.length; i++) {
links[i].onclick = function(e) {
self.hold(e);
}
}
};
if(typeof exports === 'object') {
module.exports = Router;
}else if(typeof define === 'function' && define.amd) {
define(function() { return window.MinRouter = Router; })
}else {
window.MinRouter = Router;
} |
<<<<<<<
'fr': '<p>Définit la position et la taille d\'un élément dans la grille.</p><p><code><grid-row-start> / <grid-column-start> / <grid-row-end> / <grid-column-end></code></p>',
'pt-br': '<p>Especifica a posição e o tamanho do item dentro da grade.</p><p><code><grid-row-start> / <grid-column-start> / <grid-row-end> / <grid-column-end></code></p>'
=======
'fr': '<p>Définit la position et la taille d\'un élément dans la grille.</p><p><code><grid-row-start> / <grid-column-start> / <grid-row-end> / <grid-column-end></code></p>',
'ru': '<p>Определяет позицию и размер grid элемента внутри grid сетки.</p><p><code><grid-row-start> / <grid-column-start> / <grid-row-end> / <grid-column-end></code></p>'
>>>>>>>
'fr': '<p>Définit la position et la taille d\'un élément dans la grille.</p><p><code><grid-row-start> / <grid-column-start> / <grid-row-end> / <grid-column-end></code></p>',
'pt-br': '<p>Especifica a posição e o tamanho do item dentro da grade.</p><p><code><grid-row-start> / <grid-column-start> / <grid-row-end> / <grid-column-end></code></p>',
'ru': '<p>Определяет позицию и размер grid элемента внутри grid сетки.</p><p><code><grid-row-start> / <grid-column-start> / <grid-row-end> / <grid-column-end></code></p>'
<<<<<<<
'fr': '<p>Définit la position d\'un élément de la grille sur les colonnes de la grille.</p><p><code><grid-column-start> / <grid-column-end></code></p>',
'pt-br': '<p>Especifica a posição do item de acordo com as colunas da grade.</p><p><code><grid-column-start> / <grid-column-end></code></p>'
=======
'fr': '<p>Définit la position d\'un élément de la grille sur les colonnes de la grille.</p><p><code><grid-column-start> / <grid-column-end></code></p>',
'ru': '<p>Определяет позицию grid элемента внутри grid столбцов.</p><p><code><grid-column-start> / <grid-column-end></code></p>'
>>>>>>>
'fr': '<p>Définit la position d\'un élément de la grille sur les colonnes de la grille.</p><p><code><grid-column-start> / <grid-column-end></code></p>',
'pt-br': '<p>Especifica a posição do item de acordo com as colunas da grade.</p><p><code><grid-column-start> / <grid-column-end></code></p>',
'ru': '<p>Определяет позицию grid элемента внутри grid столбцов.</p><p><code><grid-column-start> / <grid-column-end></code></p>'
<<<<<<<
'fr': '<p>Définit la position de fin d\'un élément de la grille sur les colonnes de la grille.</p><p><code><integer></code> <code>span <integer></code></p>',
'pt-br': '<p>Especifica a posição final do item de acordo com as colunas da grade.</p><p><code><integer></code> <code>span <integer></code></p>'
=======
'fr': '<p>Définit la position de fin d\'un élément de la grille sur les colonnes de la grille.</p><p><code><integer></code> <code>span <integer></code></p>',
'ru': '<p>Определяет конечную позицию grid элемента внутри grid столбцов.</p><p><code><integer></code> <code>span <integer></code></p>'
>>>>>>>
'fr': '<p>Définit la position de fin d\'un élément de la grille sur les colonnes de la grille.</p><p><code><integer></code> <code>span <integer></code></p>',
'pt-br': '<p>Especifica a posição final do item de acordo com as colunas da grade.</p><p><code><integer></code> <code>span <integer></code></p>',
'ru': '<p>Определяет конечную позицию grid элемента внутри grid столбцов.</p><p><code><integer></code> <code>span <integer></code></p>'
<<<<<<<
'fr': '<p>Définit la position du début d\'un élément de la grille sur les colonnes de la grille.</p><p><code><integer></code> <code>span <integer></code></p>',
'pt-br': '<p>Especifica a posição inicial do item de acordo com as colunas da grade.</p><p><code><integer></code> <code>span <integer></code></p>'
=======
'fr': '<p>Définit la position du début d\'un élément de la grille sur les colonnes de la grille.</p><p><code><integer></code> <code>span <integer></code></p>',
'ru': '<p>Определяет начальную позицию grid элемента внутри grid столбцов.</p><p><code><integer></code> <code>span <integer></code></p>'
>>>>>>>
'fr': '<p>Définit la position du début d\'un élément de la grille sur les colonnes de la grille.</p><p><code><integer></code> <code>span <integer></code></p>',
'pt-br': '<p>Especifica a posição inicial do item de acordo com as colunas da grade.</p><p><code><integer></code> <code>span <integer></code></p>',
'ru': '<p>Определяет начальную позицию grid элемента внутри grid столбцов.</p><p><code><integer></code> <code>span <integer></code></p>'
<<<<<<<
'pt-br': '<p>Especifica a posição do item de acordo com as linhas da grade.</p><p><code><grid-row-start> / <grid-row-end></code></p>'
=======
'ru': '<p>Определяет позицию grid элемента внутри grid строк.</p><p><code><grid-row-start> / <grid-row-end></code></p>'
>>>>>>>
'pt-br': '<p>Especifica a posição do item de acordo com as linhas da grade.</p><p><code><grid-row-start> / <grid-row-end></code></p>',
'ru': '<p>Определяет позицию grid элемента внутри grid строк.</p><p><code><grid-row-start> / <grid-row-end></code></p>'
<<<<<<<
'fr': '<p>Définit la position de fin d\'un élément de la grille sur les lignes de la grille.</p><p><code><integer></code> <code>span <integer></code></p>',
'pt-br': '<p>Especifica a posição final do item de acordo com as linhas da grade.</p><p><code><integer></code> <code>span <integer></code></p>'
=======
'fr': '<p>Définit la position de fin d\'un élément de la grille sur les lignes de la grille.</p><p><code><integer></code> <code>span <integer></code></p>',
'ru': '<p>Определяет конечную позицию grid элемента внутри grid строк.</p><p><code><integer></code> <code>span <integer></code></p>'
>>>>>>>
'fr': '<p>Définit la position de fin d\'un élément de la grille sur les lignes de la grille.</p><p><code><integer></code> <code>span <integer></code></p>',
'pt-br': '<p>Especifica a posição final do item de acordo com as linhas da grade.</p><p><code><integer></code> <code>span <integer></code></p>',
'ru': '<p>Определяет конечную позицию grid элемента внутри grid строк.</p><p><code><integer></code> <code>span <integer></code></p>'
<<<<<<<
'fr': '<p>Définit la position du début d\'un élément de la grille sur les lignes de la grille.</p><p><code><integer></code> <code>span <integer></code></p>',
'pt-br': '<p>Especifica a posição inicial do item de acordo com as linhas da grade.</p><p><code><integer></code> <code>span <integer></code></p>'
=======
'fr': '<p>Définit la position du début d\'un élément de la grille sur les lignes de la grille.</p><p><code><integer></code> <code>span <integer></code></p>',
'ru': '<p>Определяет начальную позицию grid элемента внутри grid строк.</p><p><code><integer></code> <code>span <integer></code></p>'
>>>>>>>
'fr': '<p>Définit la position du début d\'un élément de la grille sur les lignes de la grille.</p><p><code><integer></code> <code>span <integer></code></p>',
'pt-br': '<p>Especifica a posição inicial do item de acordo com as linhas da grade.</p><p><code><integer></code> <code>span <integer></code></p>',
'ru': '<p>Определяет начальную позицию grid элемента внутри grid строк.</p><p><code><integer></code> <code>span <integer></code></p>'
<<<<<<<
'fr': '<p>Définit le dimensionnement et les noms des lignes et des colonnes de la grille.</p><p><code><grid-template-rows> / <grid-template-columns></code></p>',
'pt-br': '<p>Especifica o tamanho das linhas e colunas da grade.</p><p><code><grid-template-rows> / <grid-template-columns></code></p>'
=======
'fr': '<p>Définit le dimensionnement et les noms des lignes et des colonnes de la grille.</p><p><code><grid-template-rows> / <grid-template-columns></code></p>',
'ru': '<p>Определяет размер и названия для grid строк и столбцов.</p><p><code><grid-template-rows> / <grid-template-columns></code></p>'
>>>>>>>
'fr': '<p>Définit le dimensionnement et les noms des lignes et des colonnes de la grille.</p><p><code><grid-template-rows> / <grid-template-columns></code></p>',
'pt-br': '<p>Especifica o tamanho das linhas e colunas da grade.</p><p><code><grid-template-rows> / <grid-template-columns></code></p>',
'ru': '<p>Определяет размер и названия для grid строк и столбцов.</p><p><code><grid-template-rows> / <grid-template-columns></code></p>'
<<<<<<<
'fr': '<p>Définit les régions de grille nommées</p><p><code><grid-name></code></p>',
'pt-br': '<p>Especifica as áreas da grade.</p><p><code><grid-name></code></p>'
=======
'fr': '<p>Définit les régions de grille nommées</p><p><code><grid-name></code></p>',
'ru': '<p>Определяет названные grid зоны.</p><p><code><grid-name></code></p>'
>>>>>>>
'fr': '<p>Définit les régions de grille nommées</p><p><code><grid-name></code></p>',
'pt-br': '<p>Especifica as áreas da grade.</p><p><code><grid-name></code></p>',
'ru': '<p>Определяет названные grid зоны.</p><p><code><grid-name></code></p>'
<<<<<<<
'fr': '<p>Définit le dimensionnement et les noms des colonnes de la grille.</p><p><code><length></code> <code><percentage></code> <code><flex></code> <code>max-content</code> <code>min-content</code> <code>minmax(min, max)</code></p>',
'pt-br': '<p>Especifica o tamanho das colunas da grade.</p><p><code><length></code> <code><percentage></code> <code><flex></code> <code>max-content</code> <code>min-content</code> <code>minmax(min, max)</code></p>'
=======
'fr': '<p>Définit le dimensionnement et les noms des colonnes de la grille.</p><p><code><length></code> <code><percentage></code> <code><flex></code> <code>max-content</code> <code>min-content</code> <code>minmax(min, max)</code></p>',
'ru': '<p>Определяет размер и названия для grid столбцов.</p><p><code><length></code> <code><percentage></code> <code><flex></code> <code>max-content</code> <code>min-content</code> <code>minmax(min, max)</code></p>'
>>>>>>>
'fr': '<p>Définit le dimensionnement et les noms des colonnes de la grille.</p><p><code><length></code> <code><percentage></code> <code><flex></code> <code>max-content</code> <code>min-content</code> <code>minmax(min, max)</code></p>',
'pt-br': '<p>Especifica o tamanho das colunas da grade.</p><p><code><length></code> <code><percentage></code> <code><flex></code> <code>max-content</code> <code>min-content</code> <code>minmax(min, max)</code></p>',
'ru': '<p>Определяет размер и названия для grid столбцов.</p><p><code><length></code> <code><percentage></code> <code><flex></code> <code>max-content</code> <code>min-content</code> <code>minmax(min, max)</code></p>'
<<<<<<<
'fr': '<p>Définit le dimensionnement et les noms des lignes de la grille.</p><p><code><length></code> <code><percentage></code> <code><flex></code> <code>max-content</code> <code>min-content</code> <code>minmax(min, max)</code></p>',
'pt-br': '<p>Especifica o tamanho das linhas da grade.</p><p><code><length></code> <code><percentage></code> <code><flex></code> <code>max-content</code> <code>min-content</code> <code>minmax(min, max)</code></p>'
=======
'fr': '<p>Définit le dimensionnement et les noms des lignes de la grille.</p><p><code><length></code> <code><percentage></code> <code><flex></code> <code>max-content</code> <code>min-content</code> <code>minmax(min, max)</code></p>',
'ru': '<p>Определяет размер и названия для grid строк.</p><p><code><length></code> <code><percentage></code> <code><flex></code> <code>max-content</code> <code>min-content</code> <code>minmax(min, max)</code></p>'
>>>>>>>
'fr': '<p>Définit le dimensionnement et les noms des lignes de la grille.</p><p><code><length></code> <code><percentage></code> <code><flex></code> <code>max-content</code> <code>min-content</code> <code>minmax(min, max)</code></p>',
'pt-br': '<p>Especifica o tamanho das linhas da grade.</p><p><code><length></code> <code><percentage></code> <code><flex></code> <code>max-content</code> <code>min-content</code> <code>minmax(min, max)</code></p>',
'ru': '<p>Определяет размер и названия для grid строк.</p><p><code><length></code> <code><percentage></code> <code><flex></code> <code>max-content</code> <code>min-content</code> <code>minmax(min, max)</code></p>'
<<<<<<<
'fr': '<p>Définit l\'ordre de l\'élément dans la grille.</p><p><code><integer></code></p>',
'pt-br': '<p>Especifica a ordem do item na grade.</p><p><code><integer></code></p>'
=======
'fr': '<p>Définit l\'ordre de l\'élément dans la grille.</p><p><code><integer></code></p>',
'ru': '<p>Определяет порядок grid элемента.</p><p><code><integer></code></p>'
>>>>>>>
'fr': '<p>Définit l\'ordre de l\'élément dans la grille.</p><p><code><integer></code></p>',
'pt-br': '<p>Especifica a ordem do item na grade.</p><p><code><integer></code></p>',
'ru': '<p>Определяет порядок grid элемента.</p><p><code><integer></code></p>' |
<<<<<<<
'en': '<p>If grid items aren\'t explicity placed with <code>grid-area</code>, <code>grid-column</code>, <code>grid-row</code>, etc., they are automatically placed row by row according to their order in the source code. We can override this using the <code>order</code> property.</p><p>By default, all grid items have an <code>order</code> of 0, but this can be set to any positive or negative value.</p><p>Right now, the carrots in the second column are being poisoned and the weeds in the last column are being watered. Change the <code>order</code> value of the poison to fix this right away!</p>',
'fr': '<p>Si les éléments de la grille ne sont pas explicitement positionnés avec <code>grid-area</code>, <code>grid-column</code>, <code>grid-row</code>, etc., ils sont automatiquement positionnés rangée par rangée selon leur ordre dans le code source. Nous pouvons remplacer ceci en utilisant la propriété <code>order</code>.</p><p>Par défaut, tous les éléments de la grille ont <code>order</code> à 0, mais cela peut être défini sur n\'importe quelle valeur positive ou négative.</p><p>À l\'heure actuelle, les carottes dans la deuxième colonne sont empoisonnées et les mauvaises herbes dans la dernière colonne sont arrosées. Changez la valeur de <code>order</code> du poison pour résoudre ce problème immédiatement !</p>'
=======
'en': '<p>If grid items aren\'t explicity placed with <code>grid-area</code>, <code>grid-column</code>, <code>grid-row</code>, etc., they are automatically placed row by row according to their order in the source code. We can override this using the <code>order</code> property, which is one of the advantages of grid over table-based layout.</p><p>By default, all grid items have an <code>order</code> of 0, but this can be set to any positive or negative value, similar to <code>z-index</code>.</p><p>Right now, the carrots in the second column are being poisoned and the weeds in the last column are being watered. Change the <code>order</code> value of the poison to fix this right away!</p>',
>>>>>>>
'en': '<p>If grid items aren\'t explicity placed with <code>grid-area</code>, <code>grid-column</code>, <code>grid-row</code>, etc., they are automatically placed row by row according to their order in the source code. We can override this using the <code>order</code> property, which is one of the advantages of grid over table-based layout.</p><p>By default, all grid items have an <code>order</code> of 0, but this can be set to any positive or negative value, similar to <code>z-index</code>.</p><p>Right now, the carrots in the second column are being poisoned and the weeds in the last column are being watered. Change the <code>order</code> value of the poison to fix this right away!</p>',
'fr': '<p>Si les éléments de la grille ne sont pas explicitement positionnés avec <code>grid-area</code>, <code>grid-column</code>, <code>grid-row</code>, etc., ils sont automatiquement positionnés rangée par rangée selon leur ordre dans le code source. Nous pouvons remplacer ceci en utilisant la propriété <code>order</code>.</p><p>Par défaut, tous les éléments de la grille ont <code>order</code> à 0, mais cela peut être défini sur n\'importe quelle valeur positive ou négative.</p><p>À l\'heure actuelle, les carottes dans la deuxième colonne sont empoisonnées et les mauvaises herbes dans la dernière colonne sont arrosées. Changez la valeur de <code>order</code> du poison pour résoudre ce problème immédiatement !</p>'
<<<<<<<
'en': '<p><code>grid-template-columns</code> doesn\'t just accept values in percentages, but also length units like pixels and ems. You can even mix different units together.</p><p>Another unit that grid introduces is the fractional unit <code>fr</code>, which stretches to take up one equal share of the leftover space.</p><p>Here the carrots form a 50 pixel column on the left, and the weeds a 50 pixel column on the right. Use <code>fr</code> to make three columns that take up the leftover space in between.</p>',
'fr': '<p><code>grid-template-columns</code> n\'accepte pas seulement les valeurs en pourcentage, mais aussi les unités de longueur comme les pixels et les ems. Vous pouvez même mélanger différentes unités ensemble.</p><p>Une autre unité que la grille introduit est l\'unité fractionnaire <code>fr</code>, qui s\'étire pour prendre une part égale de l\'espace restant.</p><p>Ici, les carottes forment une colonne de 50 pixels sur la gauche et les mauvaises herbes, une colonne de 50 pixels sur la droite. Utilisez <code>fr</code> pour créer trois colonnes qui occupent l\'espace restant entre les deux.</p>'
=======
'en': '<p>When columns are set with pixels, percentages, or ems, any other columns set with <code>fr</code> will divvy up the space that\'s left over.</p><p>Here the carrots form a 50 pixel column on the left, and the weeds a 50 pixel column on the right. With <code>grid-template-columns</code>, create these two columns, and use <code>fr</code> to make three more columns that take up the remaining space in between.</p>',
>>>>>>>
'en': '<p>When columns are set with pixels, percentages, or ems, any other columns set with <code>fr</code> will divvy up the space that\'s left over.</p><p>Here the carrots form a 50 pixel column on the left, and the weeds a 50 pixel column on the right. With <code>grid-template-columns</code>, create these two columns, and use <code>fr</code> to make three more columns that take up the remaining space in between.</p>',
'fr': '<p><code>grid-template-columns</code> n\'accepte pas seulement les valeurs en pourcentage, mais aussi les unités de longueur comme les pixels et les ems. Vous pouvez même mélanger différentes unités ensemble.</p><p>Une autre unité que la grille introduit est l\'unité fractionnaire <code>fr</code>, qui s\'étire pour prendre une part égale de l\'espace restant.</p><p>Ici, les carottes forment une colonne de 50 pixels sur la gauche et les mauvaises herbes, une colonne de 50 pixels sur la droite. Utilisez <code>fr</code> pour créer trois colonnes qui occupent l\'espace restant entre les deux.</p>'
<<<<<<<
'en': '<p><code>grid-template</code> is a shorthand property that combines <code>grid-template-rows</code> and <code>grid-template-columns</code>.</p><p>Try using <code>grid-template</code> to water an area that includes the top 60% and left 200 pixels of your garden.</p>',
'fr': '<p><code>grid-template</code> est la propriété raccourcie qui combine <code>grid-template-rows</code> et <code>grid-template-columns</code>.</p><p>Essayez à l\'aide de <code>grid-template</code> d\'arroser une région comprenant 60% du haut et 200 pixels à gauche de votre jardin.</p>'
=======
'en': '<p><code>grid-template</code> is a shorthand property that combines <code>grid-template-rows</code> and <code>grid-template-columns</code>.</p><p>For example, <code>grid-template: 50% 50% / 200px;</code> will create a grid with two rows that are 50% each, and one column that is 200 pixels wide.</p><p>Try using <code>grid-template</code> to water an area that includes the top 60% and left 200 pixels of your garden.</p>',
>>>>>>>
'en': '<p><code>grid-template</code> is a shorthand property that combines <code>grid-template-rows</code> and <code>grid-template-columns</code>.</p><p>For example, <code>grid-template: 50% 50% / 200px;</code> will create a grid with two rows that are 50% each, and one column that is 200 pixels wide.</p><p>Try using <code>grid-template</code> to water an area that includes the top 60% and left 200 pixels of your garden.</p>',
'fr': '<p><code>grid-template</code> est la propriété raccourcie qui combine <code>grid-template-rows</code> et <code>grid-template-columns</code>.</p><p>Essayez à l\'aide de <code>grid-template</code> d\'arroser une région comprenant 60% du haut et 200 pixels à gauche de votre jardin.</p>'
<<<<<<<
'en': '<p>You win! By the power of CSS grid, you were able to grow enough carrots for Froggy to bake his world famous 20-carrot cake. What, were you expecting a different hoppy friend?</p><p>If you enjoyed Grid Garden, be sure to check out <a href="http://flexboxfroggy.com/">Flexbox Froggy</a> to learn about another powerful new feature of CSS layout. You can also keep up-to-date with my other projects on <a href="http://thomaspark.co">my blog</a> or <a href="https://twitter.com/thomashpark">Twitter</a>.</p><p>Want to support Garden Grid? Try out the topnotch web design and coding courses offered by <a href="http://treehouse.7eer.net/c/371033/228915/3944?subId1=gridgarden">Treehouse</a>. And spread the word to your friends and family about Grid Garden!</p>',
'fr': '<p>Vous avez gagné ! Par la puissance de la grille CSS, vous avez pu cultiver suffisamment de carottes pour Froggy pour faire cuire son célèbre gâteau de 20-carottes. Quoi, vous vous attendiez à un ami différent ?</p><p>Si vous avez apprécié Grid Garden, veuillez consulter <a href="http://flexboxfroggy.com/">Flexbox Froggy</a> pour en savoir plus sur une nouvelle fonctionnalité puissante sur la mise en page CSS. Vous pouvez également vous tenir au courant de mes autres projets sur <a href="http://thomaspark.co">mon blog</a> ou sur <a href="https://twitter.com/thomashpark">Twitter</a>.</p><p>Vous voulez soutenir Garden Grid ? Essayez les cours de conception et de codage proposés par <a href="http://treehouse.7eer.net/c/371033/228915/3944?subId1=gridgarden">Treehouse</a>. Et passez le mot à vos amis et à votre famille au sujet de Grid Garden !</p>'
=======
'en': '<p>You win! By the power of CSS grid, you were able to grow enough carrots for Froggy to bake his world famous 20-carrot cake. What, were you expecting a different hoppy friend?</p><p>If you enjoyed Grid Garden, be sure to check out <a href="http://flexboxfroggy.com/">Flexbox Froggy</a> to learn about another powerful new feature of CSS layout. You can also keep up-to-date with my other projects on <a href="http://thomaspark.co">my blog</a> or <a href="https://twitter.com/thomashpark">Twitter</a>.</p><p>Want to support Grid Garden? Try out the topnotch web design and coding courses offered by <a href="http://treehouse.7eer.net/c/371033/228915/3944?subId1=gridgarden">Treehouse</a>. And spread the word to your friends and family about Grid Garden!</p>',
>>>>>>>
'en': '<p>You win! By the power of CSS grid, you were able to grow enough carrots for Froggy to bake his world famous 20-carrot cake. What, were you expecting a different hoppy friend?</p><p>If you enjoyed Grid Garden, be sure to check out <a href="http://flexboxfroggy.com/">Flexbox Froggy</a> to learn about another powerful new feature of CSS layout. You can also keep up-to-date with my other projects on <a href="http://thomaspark.co">my blog</a> or <a href="https://twitter.com/thomashpark">Twitter</a>.</p><p>Want to support Grid Garden? Try out the topnotch web design and coding courses offered by <a href="http://treehouse.7eer.net/c/371033/228915/3944?subId1=gridgarden">Treehouse</a>. And spread the word to your friends and family about Grid Garden!</p>',
'fr': '<p>Vous avez gagné ! Par la puissance de la grille CSS, vous avez pu cultiver suffisamment de carottes pour Froggy pour faire cuire son célèbre gâteau de 20-carottes. Quoi, vous vous attendiez à un ami différent ?</p><p>Si vous avez apprécié Grid Garden, veuillez consulter <a href="http://flexboxfroggy.com/">Flexbox Froggy</a> pour en savoir plus sur une nouvelle fonctionnalité puissante sur la mise en page CSS. Vous pouvez également vous tenir au courant de mes autres projets sur <a href="http://thomaspark.co">mon blog</a> ou sur <a href="https://twitter.com/thomashpark">Twitter</a>.</p><p>Vous voulez soutenir Garden Grid ? Essayez les cours de conception et de codage proposés par <a href="http://treehouse.7eer.net/c/371033/228915/3944?subId1=gridgarden">Treehouse</a>. Et passez le mot à vos amis et à votre famille au sujet de Grid Garden !</p>' |
<<<<<<<
=======
var templateRepo = Hogan.compile('<div class="aa-suggestion aa-repo">' +
'{{#stargazers_count}}<div class="aa-infos">{{ stargazers_count }} <i class="octicon octicon-star"></i></div>{{/stargazers_count}}' +
'<span class="aa-name"><a href="https://github.com/{{ full_name }}/">{{{ owner }}} / {{{ _highlightResult.name.value }}}</a></span>' +
'<div class="aa-description">{{{ _snippetResult.description.value }}}</div>' +
'</div>');
var templateYourRepo = Hogan.compile('<div class="aa-suggestion aa-repo">' +
'<span class="aa-name">' +
'<span class="repo-icon octicon {{#fork}}octicon-repo-forked{{/fork}}{{^fork}}{{#private}}octicon-lock{{/private}}{{^private}}octicon-repo{{/private}}{{/fork}}"></span> ' +
'<a href="https://github.com/{{ full_name }}/">{{{ owner }}} / {{{ highlightedName }}}</a>' +
'</span>' +
'</div>');
>>>>>>> |
<<<<<<<
othis.schemas["ifc2x3tc1"] = result.classes;
callback();
=======
othis.schemas["ifc2x3tc1"] = result.classes;
$.getJSON(othis.baseUrl + "/js/ifc4.js", function(result){
othis.schemas["ifc4"] = result.classes;
callback();
});
>>>>>>>
othis.schemas["ifc2x3tc1"] = result.classes;
callback();
$.getJSON(othis.baseUrl + "/js/ifc4.js", function(result){
othis.schemas["ifc4"] = result.classes;
callback();
}); |
<<<<<<<
var config = "cef-" + process.platform,
zipSrc = grunt.config("curl-dir." + config + ".src"),
zipName,
=======
var config = "cef_" + process.platform,
zipSrc = grunt.config("curl-dir." + config + ".src"),
zipName = zipSrc.substr(zipSrc.lastIndexOf("/") + 1),
zipDest = grunt.config("curl-dir." + config + ".dest") + zipName,
>>>>>>>
var config = "cef-" + process.platform,
zipSrc = grunt.config("curl-dir." + config + ".src"),
zipName = zipSrc.substr(zipSrc.lastIndexOf("/") + 1),
zipDest = grunt.config("curl-dir." + config + ".dest") + zipName,
<<<<<<<
curlTask = "curl-dir:node-" + process.platform,
=======
nodeDest = [],
dest = grunt.config("curl-dir." + config + ".dest"),
curlTask = "curl-dir:node_" + process.platform,
>>>>>>>
nodeDest = [],
dest = grunt.config("curl-dir." + config + ".dest"),
curlTask = "curl-dir:node-" + process.platform,
<<<<<<<
nodeVersion = grunt.config("node-version"),
npmVersion = grunt.config("npm-version"),
txtName = "version-" + nodeVersion + ".txt";
=======
nodeVersion = grunt.config("node_version"),
npmVersion = grunt.config("npm_version"),
txtName = "version-" + nodeVersion + ".txt",
missingDest = false;
>>>>>>>
nodeVersion = grunt.config("node-version"),
npmVersion = grunt.config("npm-version"),
txtName = "version-" + nodeVersion + ".txt",
missingDest = false; |
<<<<<<<
checkIfCan('nlu-model:w', projectId);
=======
// Check if the model with the langauge already exists in project
// eslint-disable-next-line no-param-reassign
item.published = true; // a model should be published as soon as it is created
const { nlu_models: nluModels } = Projects.findOne({ _id: projectId }, { fields: { nlu_models: 1 } });
const nluModelLanguages = getNluModelLanguages(nluModels, true);
if (nluModelLanguages.some(lang => (lang.value === item.language))) {
throw new Meteor.Error('409', `Model with langauge ${item.language} already exists`);
}
>>>>>>>
checkIfCan('project-settings:w', projectId);
// Check if the model with the langauge already exists in project
// eslint-disable-next-line no-param-reassign
item.published = true; // a model should be published as soon as it is created
const { nlu_models: nluModels } = Projects.findOne({ _id: projectId }, { fields: { nlu_models: 1 } });
const nluModelLanguages = getNluModelLanguages(nluModels, true);
if (nluModelLanguages.some(lang => (lang.value === item.language))) {
throw new Meteor.Error('409', `Model with langauge ${item.language} already exists`);
}
<<<<<<<
checkIfCan('nlu-model:w', getProjectIdFromModelId(modelId));
=======
checkIfCan('nlu-admin', getProjectIdFromModelId(modelId));
// check the default language of project and the language of model
const modelLanguage = NLUModels.findOne({ _id: modelId });
const projectDefaultLanguage = Projects.findOne({ _id: projectId });
if (modelLanguage.language !== projectDefaultLanguage.defaultLanguage) {
try {
NLUModels.remove({ _id: modelId });
return Projects.update({ _id: projectId }, { $pull: { nlu_models: modelId } });
} catch (e) {
throw e;
}
}
throw new Meteor.Error('409', 'The default language cannot be deleted');
},
>>>>>>>
checkIfCan('nlu-model:w', getProjectIdFromModelId(modelId));
// check the default language of project and the language of model
const modelLanguage = NLUModels.findOne({ _id: modelId });
const projectDefaultLanguage = Projects.findOne({ _id: projectId });
if (modelLanguage.language !== projectDefaultLanguage.defaultLanguage) {
try {
NLUModels.remove({ _id: modelId });
return Projects.update({ _id: projectId }, { $pull: { nlu_models: modelId } });
} catch (e) {
throw e;
}
}
throw new Meteor.Error('409', 'The default language cannot be deleted');
}, |
<<<<<<<
var MarkerCluster = require('./MarkerCluster');
var geomodel = require('./geomodel');
var spherical = require('./spherical');
=======
>>>>>>>
var MarkerCluster = require('./MarkerCluster');
var geomodel = require('./geomodel');
<<<<<<<
spherical: spherical,
geomodel: geomodel
},
MarkerCluster: MarkerCluster
=======
spherical: spherical
}
>>>>>>>
spherical: spherical,
geomodel: geomodel
} |
<<<<<<<
convertJobState(frameworkState, exitCode) {
let jobState = '';
switch (frameworkState) {
case 'FRAMEWORK_WAITING':
case 'APPLICATION_CREATED':
case 'APPLICATION_LAUNCHED':
case 'APPLICATION_WAITING':
jobState = 'WAITING';
break;
case 'APPLICATION_RUNNING':
case 'APPLICATION_RETRIEVING_DIAGNOSTICS':
case 'APPLICATION_COMPLETED':
jobState = 'RUNNING';
break;
case 'FRAMEWORK_COMPLETED':
if (typeof exitCode !== 'undefined' && parseInt(exitCode) === 0) {
jobState = 'SUCCEEDED';
} else if (typeof exitCode !== 'undefined' && parseInt(exitCode) == 214) {
jobState = 'STOPPED';
} else {
jobState = 'FAILED';
}
break;
default:
jobState = 'UNKNOWN';
}
return jobState;
}
=======
>>>>>>>
convertJobState(frameworkState, exitCode) {
let jobState = '';
switch (frameworkState) {
case 'FRAMEWORK_WAITING':
case 'APPLICATION_CREATED':
case 'APPLICATION_LAUNCHED':
case 'APPLICATION_WAITING':
jobState = 'WAITING';
break;
case 'APPLICATION_RUNNING':
case 'APPLICATION_RETRIEVING_DIAGNOSTICS':
case 'APPLICATION_COMPLETED':
jobState = 'RUNNING';
break;
case 'FRAMEWORK_COMPLETED':
if (typeof exitCode !== 'undefined' && parseInt(exitCode) === 0) {
jobState = 'SUCCEEDED';
} else if (typeof exitCode !== 'undefined' && parseInt(exitCode) == 214) {
jobState = 'STOPPED';
} else {
jobState = 'FAILED';
}
break;
default:
jobState = 'UNKNOWN';
}
return jobState;
}
<<<<<<<
putJobExecutionType(name, data, next) {
unirest.get(launcherConfig.frameworkRequestPath(name))
.headers(launcherConfig.webserviceRequestHeaders)
.end((requestRes) => {
const requestResJson = typeof requestRes.body === 'object' ?
requestRes.body : JSON.parse(requestRes.body);
if (!requestResJson.frameworkDescriptor) {
next(new Error('unknown job'));
} else if (data.username === requestResJson.frameworkDescriptor.user.name) {
unirest.put(launcherConfig.frameworkExecutionTypePath(name))
.headers(launcherConfig.webserviceRequestHeaders)
.send({'executionType': data.value})
.end((res) => next());
} else {
next(new Error('can not execute other user\'s job'));
}
});
}
=======
getJobConfig(userName, jobName, next) {
let url = launcherConfig.webhdfsUri +
'/webhdfs/v1/Container/' + userName + '/' + jobName +
'/JobConfig.json?op=OPEN';
unirest.get(url)
.end((requestRes) => {
try {
const requestResJson =
typeof requestRes.body === 'object' ?
requestRes.body :
JSON.parse(requestRes.body);
if (requestRes.status === 200) {
next(requestResJson, null);
} else if (requestRes.status === 404) {
next(null, new Error('ConfigFileNotFound'));
} else {
next(null, new Error('InternalServerError'));
}
} catch (error) {
next(null, error);
}
});
}
getJobSshInfo(userName, jobName, applicationId, next) {
let folderPathPrefix = `/Container/${userName}/${jobName}/ssh/${applicationId}/`;
let webhdfsUrlPrefix = `${launcherConfig.webhdfsUri}/webhdfs/v1${folderPathPrefix}`;
let webhdfsUrl = `${webhdfsUrlPrefix}?op=LISTSTATUS`;
unirest.get(webhdfsUrl)
.end((requestRes) => {
try {
const requestResJson =
typeof requestRes.body === 'object' ?
requestRes.body :
JSON.parse(requestRes.body);
if (requestRes.status === 200) {
let result = {
'containers': [],
'keyPair': {
'folderPath': `${launcherConfig.hdfsUri}${folderPathPrefix}.ssh/`,
'publicKeyFileName': `${applicationId}.pub`,
'privateKeyFileName': `${applicationId}`,
'privateKeyDirectDownloadLink':
`${webhdfsUrlPrefix}.ssh/${applicationId}?op=OPEN`,
},
};
for (let x of requestResJson.FileStatuses.FileStatus) {
let pattern = /^container_(.*)-(.*)-(.*)$/g;
let arr = pattern.exec(x.pathSuffix);
if (arr !== null) {
result.containers.push({
'id': 'container_' + arr[1],
'sshIp': arr[2],
'sshPort': arr[3],
});
}
}
next(result, null);
} else if (requestRes.status === 404) {
next(null, new Error('SshInfoNotFound'));
} else {
next(null, new Error('InternalServerError'));
}
} catch (error) {
next(null, error);
}
});
}
convertJobState(frameworkState, exitCode) {
let jobState = '';
switch (frameworkState) {
case 'FRAMEWORK_WAITING':
case 'APPLICATION_CREATED':
case 'APPLICATION_LAUNCHED':
case 'APPLICATION_WAITING':
jobState = 'WAITING';
break;
case 'APPLICATION_RUNNING':
case 'APPLICATION_RETRIEVING_DIAGNOSTICS':
case 'APPLICATION_COMPLETED':
jobState = 'RUNNING';
break;
case 'FRAMEWORK_COMPLETED':
if (typeof exitCode !== 'undefined' && parseInt(exitCode) === 0) {
jobState = 'SUCCEEDED';
} else {
jobState = 'FAILED';
}
break;
default:
jobState = 'UNKNOWN';
}
return jobState;
}
generateJobDetail(framework) {
let jobDetail = {
'jobStatus': {},
'taskRoles': {},
};
const frameworkStatus = framework.aggregatedFrameworkStatus.frameworkStatus;
if (frameworkStatus) {
const jobState = this.convertJobState(
frameworkStatus.frameworkState,
frameworkStatus.applicationExitCode);
let jobRetryCount = 0;
const jobRetryCountInfo = frameworkStatus.frameworkRetryPolicyState;
jobRetryCount =
jobRetryCountInfo.transientNormalRetriedCount +
jobRetryCountInfo.transientConflictRetriedCount +
jobRetryCountInfo.nonTransientRetriedCount +
jobRetryCountInfo.unKnownRetriedCount;
jobDetail.jobStatus = {
name: framework.name,
username: 'unknown',
state: jobState,
subState: frameworkStatus.frameworkState,
retries: jobRetryCount,
createdTime: frameworkStatus.frameworkCreatedTimestamp,
completedTime: frameworkStatus.frameworkCompletedTimestamp,
appId: frameworkStatus.applicationId,
appProgress: frameworkStatus.applicationProgress,
appTrackingUrl: frameworkStatus.applicationTrackingUrl,
appLaunchedTime: frameworkStatus.applicationLaunchedTimestamp,
appCompletedTime: frameworkStatus.applicationCompletedTimestamp,
appExitCode: frameworkStatus.applicationExitCode,
appExitDiagnostics: frameworkStatus.applicationExitDiagnostics,
appExitType: frameworkStatus.applicationExitType,
};
}
const frameworkRequest = framework.aggregatedFrameworkRequest.frameworkRequest;
if (frameworkRequest.frameworkDescriptor) {
jobDetail.jobStatus.username = frameworkRequest.frameworkDescriptor.user.name;
}
const taskRoleStatuses = framework.aggregatedFrameworkStatus.aggregatedTaskRoleStatuses;
if (taskRoleStatuses) {
for (let taskRole of Object.keys(taskRoleStatuses)) {
jobDetail.taskRoles[taskRole] = {
taskRoleStatus: {name: taskRole},
taskStatuses: [],
};
for (let task of taskRoleStatuses[taskRole].taskStatuses.taskStatusArray) {
jobDetail.taskRoles[taskRole].taskStatuses.push({
taskIndex: task.taskIndex,
containerId: task.containerId,
containerIp: task.containerIp,
containerGpus: task.containerGpus,
containerLog: task.containerLogHttpAddress,
});
}
}
}
return jobDetail;
}
>>>>>>>
putJobExecutionType(name, data, next) {
unirest.get(launcherConfig.frameworkRequestPath(name))
.headers(launcherConfig.webserviceRequestHeaders)
.end((requestRes) => {
const requestResJson = typeof requestRes.body === 'object' ?
requestRes.body : JSON.parse(requestRes.body);
if (!requestResJson.frameworkDescriptor) {
next(new Error('unknown job'));
} else if (data.username === requestResJson.frameworkDescriptor.user.name) {
unirest.put(launcherConfig.frameworkExecutionTypePath(name))
.headers(launcherConfig.webserviceRequestHeaders)
.send({'executionType': data.value})
.end((res) => next());
} else {
next(new Error('can not execute other user\'s job'));
}
});
}
getJobConfig(userName, jobName, next) {
let url = launcherConfig.webhdfsUri +
'/webhdfs/v1/Container/' + userName + '/' + jobName +
'/JobConfig.json?op=OPEN';
unirest.get(url)
.end((requestRes) => {
try {
const requestResJson =
typeof requestRes.body === 'object' ?
requestRes.body :
JSON.parse(requestRes.body);
if (requestRes.status === 200) {
next(requestResJson, null);
} else if (requestRes.status === 404) {
next(null, new Error('ConfigFileNotFound'));
} else {
next(null, new Error('InternalServerError'));
}
} catch (error) {
next(null, error);
}
});
}
getJobSshInfo(userName, jobName, applicationId, next) {
let folderPathPrefix = `/Container/${userName}/${jobName}/ssh/${applicationId}/`;
let webhdfsUrlPrefix = `${launcherConfig.webhdfsUri}/webhdfs/v1${folderPathPrefix}`;
let webhdfsUrl = `${webhdfsUrlPrefix}?op=LISTSTATUS`;
unirest.get(webhdfsUrl)
.end((requestRes) => {
try {
const requestResJson =
typeof requestRes.body === 'object' ?
requestRes.body :
JSON.parse(requestRes.body);
if (requestRes.status === 200) {
let result = {
'containers': [],
'keyPair': {
'folderPath': `${launcherConfig.hdfsUri}${folderPathPrefix}.ssh/`,
'publicKeyFileName': `${applicationId}.pub`,
'privateKeyFileName': `${applicationId}`,
'privateKeyDirectDownloadLink':
`${webhdfsUrlPrefix}.ssh/${applicationId}?op=OPEN`,
},
};
for (let x of requestResJson.FileStatuses.FileStatus) {
let pattern = /^container_(.*)-(.*)-(.*)$/g;
let arr = pattern.exec(x.pathSuffix);
if (arr !== null) {
result.containers.push({
'id': 'container_' + arr[1],
'sshIp': arr[2],
'sshPort': arr[3],
});
}
}
next(result, null);
} else if (requestRes.status === 404) {
next(null, new Error('SshInfoNotFound'));
} else {
next(null, new Error('InternalServerError'));
}
} catch (error) {
next(null, error);
}
});
}
generateJobDetail(framework) {
let jobDetail = {
'jobStatus': {},
'taskRoles': {},
};
const frameworkStatus = framework.aggregatedFrameworkStatus.frameworkStatus;
if (frameworkStatus) {
const jobState = this.convertJobState(
frameworkStatus.frameworkState,
frameworkStatus.applicationExitCode);
let jobRetryCount = 0;
const jobRetryCountInfo = frameworkStatus.frameworkRetryPolicyState;
jobRetryCount =
jobRetryCountInfo.transientNormalRetriedCount +
jobRetryCountInfo.transientConflictRetriedCount +
jobRetryCountInfo.nonTransientRetriedCount +
jobRetryCountInfo.unKnownRetriedCount;
jobDetail.jobStatus = {
name: framework.name,
username: 'unknown',
state: jobState,
subState: frameworkStatus.frameworkState,
retries: jobRetryCount,
createdTime: frameworkStatus.frameworkCreatedTimestamp,
completedTime: frameworkStatus.frameworkCompletedTimestamp,
appId: frameworkStatus.applicationId,
appProgress: frameworkStatus.applicationProgress,
appTrackingUrl: frameworkStatus.applicationTrackingUrl,
appLaunchedTime: frameworkStatus.applicationLaunchedTimestamp,
appCompletedTime: frameworkStatus.applicationCompletedTimestamp,
appExitCode: frameworkStatus.applicationExitCode,
appExitDiagnostics: frameworkStatus.applicationExitDiagnostics,
appExitType: frameworkStatus.applicationExitType,
};
}
const frameworkRequest = framework.aggregatedFrameworkRequest.frameworkRequest;
if (frameworkRequest.frameworkDescriptor) {
jobDetail.jobStatus.username = frameworkRequest.frameworkDescriptor.user.name;
}
const taskRoleStatuses = framework.aggregatedFrameworkStatus.aggregatedTaskRoleStatuses;
if (taskRoleStatuses) {
for (let taskRole of Object.keys(taskRoleStatuses)) {
jobDetail.taskRoles[taskRole] = {
taskRoleStatus: {name: taskRole},
taskStatuses: [],
};
for (let task of taskRoleStatuses[taskRole].taskStatuses.taskStatusArray) {
jobDetail.taskRoles[taskRole].taskStatuses.push({
taskIndex: task.taskIndex,
containerId: task.containerId,
containerIp: task.containerIp,
containerGpus: task.containerGpus,
containerLog: task.containerLogHttpAddress,
});
}
}
}
return jobDetail;
} |
<<<<<<<
} else if (job.jobStatus.state !== 'JOB_NOT_FOUND' && req.method === 'PUT' && req.path === `/${jobName}`) {
logger.warn('duplicate job %s', jobName);
return res.status(400).json({
error: 'DuplicateJobSubmission',
message: 'duplicate job submission',
});
=======
>>>>>>>
<<<<<<<
/**
* Start or stop job.
*/
const execute = (req, res, next) => {
req.body.username = req.user.username;
Job.prototype.putJobExecutionType(req.job.name, req.body, (err) => {
if (err) {
logger.warn('execute job %s error\n%s', req.job.name, err.stack);
err.message = 'job execute error';
next(err);
} else {
return res.status(202).json({
message: `execute job ${req.job.name} successfully`,
});
}
});
};
=======
/**
* Get job config json string.
*/
const getConfig = (req, res) => {
Job.prototype.getJobConfig(
req.job.jobStatus.username,
req.job.name,
(configJsonString, error) => {
if (error === null) {
return res.status(200).json(configJsonString);
} else if (error.message === 'ConfigFileNotFound') {
return res.status(404).json({
error: 'ConfigFileNotFound',
message: error.message,
});
} else {
return res.status(500).json({
error: 'InternalServerError',
message: error.message,
});
}
}
);
};
/**
* Get job SSH info.
*/
const getSshInfo = (req, res) => {
Job.prototype.getJobSshInfo(
req.job.jobStatus.username,
req.job.name,
req.job.jobStatus.appId,
(sshInfo, error) => {
if (error === null) {
return res.status(200).json(sshInfo);
} else if (error.message === 'SshInfoNotFound') {
return res.status(404).json({
error: 'SshInfoNotFound',
message: error.message,
});
} else {
return res.status(500).json({
error: 'InternalServerError',
message: error.message,
});
}
}
);
};
>>>>>>>
/**
* Start or stop job.
*/
const execute = (req, res, next) => {
req.body.username = req.user.username;
Job.prototype.putJobExecutionType(req.job.name, req.body, (err) => {
if (err) {
logger.warn('execute job %s error\n%s', req.job.name, err.stack);
err.message = 'job execute error';
next(err);
} else {
return res.status(202).json({
message: `execute job ${req.job.name} successfully`,
});
}
});
};
/**
* Get job config json string.
*/
const getConfig = (req, res) => {
Job.prototype.getJobConfig(
req.job.jobStatus.username,
req.job.name,
(configJsonString, error) => {
if (error === null) {
return res.status(200).json(configJsonString);
} else if (error.message === 'ConfigFileNotFound') {
return res.status(404).json({
error: 'ConfigFileNotFound',
message: error.message,
});
} else {
return res.status(500).json({
error: 'InternalServerError',
message: error.message,
});
}
}
);
};
/**
* Get job SSH info.
*/
const getSshInfo = (req, res) => {
Job.prototype.getJobSshInfo(
req.job.jobStatus.username,
req.job.name,
req.job.jobStatus.appId,
(sshInfo, error) => {
if (error === null) {
return res.status(200).json(sshInfo);
} else if (error.message === 'SshInfoNotFound') {
return res.status(404).json({
error: 'SshInfoNotFound',
message: error.message,
});
} else {
return res.status(500).json({
error: 'InternalServerError',
message: error.message,
});
}
}
);
};
<<<<<<<
module.exports = {load, list, get, update, remove, execute};
=======
module.exports = {
load,
list,
get,
update,
remove,
getConfig,
getSshInfo,
};
>>>>>>>
module.exports = {
load,
list,
get,
update,
remove,
execute,
getConfig,
getSshInfo,
}; |
<<<<<<<
const mergeSiteDetails = (oldSiteDetail, newSiteDetail, tag, folderId) => {
=======
const mergeSiteDetails = (oldSiteDetail, newSiteDetail, tag, folderId, order) => {
const siteDetailExist = newSiteDetail.get('lastAccessedTime') !== undefined || oldSiteDetail && oldSiteDetail.get('lastAccessedTime')
>>>>>>>
const mergeSiteDetails = (oldSiteDetail, newSiteDetail, tag, folderId, order) => {
<<<<<<<
const lastAccessedTime = mergeSiteLastAccessedTime(oldSiteDetail, newSiteDetail, tag)
=======
let lastAccessedTime
if (isBookmark(tag) || isBookmarkFolder(tag)) {
siteDetailExist
? lastAccessedTime = newSiteDetail.get('lastAccessedTime') || oldSiteDetail && oldSiteDetail.get('lastAccessedTime') || 0
: lastAccessedTime = 0
} else {
lastAccessedTime = newSiteDetail.get('lastAccessedTime') || new Date().getTime()
}
>>>>>>>
const lastAccessedTime = mergeSiteLastAccessedTime(oldSiteDetail, newSiteDetail, tag)
<<<<<<<
objectId: newSiteDetail.get('objectId') || (oldSiteDetail ? oldSiteDetail.get('objectId') : undefined),
title: newSiteDetail.get('title')
=======
title: newSiteDetail.get('title'),
order
>>>>>>>
objectId: newSiteDetail.get('objectId') || (oldSiteDetail ? oldSiteDetail.get('objectId') : undefined),
title: newSiteDetail.get('title'),
order
<<<<<<<
let site = mergeSiteDetails(oldSite, siteDetail, tag, folderId)
if (getSetting(settings.SYNC_ENABLED) === true && syncCallback) {
site = module.exports.setObjectId(site)
syncCallback(site)
}
if (index === -1) {
// Insert new entry
return sites.push(site)
=======
let site = mergeSiteDetails(oldSite, siteDetail, tag, folderId, sites.size)
const key = originalSiteKey || module.exports.getSiteKey(site)
if (key === null) {
return sites
>>>>>>>
let site = mergeSiteDetails(oldSite, siteDetail, tag, folderId, sites.size)
const key = originalSiteKey || module.exports.getSiteKey(site)
if (key === null) {
return sites
}
if (getSetting(settings.SYNC_ENABLED) === true && syncCallback) {
site = module.exports.setObjectId(site)
syncCallback(site)
<<<<<<<
module.exports.moveSite = function (sites, sourceDetail, destinationDetail, prepend, destinationIsParent, disallowReparent, syncCallback) {
=======
module.exports.moveSite = function (sites, sourceDetail, destinationDetail, prepend,
destinationIsParent, disallowReparent) {
>>>>>>>
module.exports.moveSite = function (sites, sourceDetail, destinationDetail, prepend,
destinationIsParent, disallowReparent, syncCallback) {
<<<<<<<
if (getSetting(settings.SYNC_ENABLED) === true && syncCallback) {
syncCallback(sourceSite)
}
return sites.splice(newIndex, 0, sourceSite)
=======
sourceKey = module.exports.getSiteKey(sourceSite)
return sites.set(sourceKey, sourceSite)
>>>>>>>
if (getSetting(settings.SYNC_ENABLED) === true && syncCallback) {
syncCallback(sourceSite)
}
sourceKey = module.exports.getSiteKey(sourceSite)
return sites.set(sourceKey, sourceSite) |
<<<<<<<
const mergeSiteDetails = (oldSiteDetail, newSiteDetail, tag, folderId, order) => {
=======
const mergeSiteDetails = (oldSiteDetail, newSiteDetail, tag, folderId) => {
const siteDetailExist = newSiteDetail.get('lastAccessedTime') !== undefined || oldSiteDetail && oldSiteDetail.get('lastAccessedTime')
>>>>>>>
const mergeSiteDetails = (oldSiteDetail, newSiteDetail, tag, folderId, order) => {
const siteDetailExist = newSiteDetail.get('lastAccessedTime') !== undefined || oldSiteDetail && oldSiteDetail.get('lastAccessedTime') |
<<<<<<<
if (key === null) {
return sites
}
if (getSetting(settings.SYNC_ENABLED) === true && syncCallback) {
syncCallback(sites.getIn([key]))
}
=======
if (!key) {
return sites
}
>>>>>>>
if (!key) {
return sites
}
if (getSetting(settings.SYNC_ENABLED) === true && syncCallback) {
syncCallback(sites.getIn([key]))
} |
<<<<<<<
/**
* Create a log from a multihash.
* @param {IPFS} ipfs An IPFS instance
* @param {string} multihash Multihash (as a Base58 encoded string) to create the Log from
* @param {number} [length=-1] How many items to include in the log
* @param {Array<Entry>} [exclude] Entries to not fetch (cached)
* @param {function(cid, entry, parent, depth)} onProgressCallback
* @returns {Promise<Log>}
* @deprecated
*/
static async fromMultihash (ipfs, multihash, { length = -1, exclude, onProgressCallback }) {
return LogIO.fromCID(ipfs, multihash, { length, exclude, onProgressCallback })
}
static async fromEntryCid (ipfs, entryCid, { length = -1, exclude, onProgressCallback }) {
=======
static async fromEntryCid (ipfs, entryCid, length = -1, exclude, onProgressCallback) {
>>>>>>>
static async fromEntryCid (ipfs, entryCid, { length = -1, exclude, onProgressCallback }) { |
<<<<<<<
options = options || {};
var inputFiles = fileSet(src);
src = inputFiles.files;
=======
src = fileSet(src).files;
>>>>>>>
var inputFiles = fileSet(src);
src = inputFiles.files;
<<<<<<<
self.push(data);
self.push(null);
done();
=======
try {
data = applyOptions(data, options);
self.push(data);
self.push(null)
done();
} catch(err){
done(err);
}
>>>>>>>
try {
data = applyOptions(data, options);
self.push(data);
self.push(null)
done();
} catch(err){
done(err);
}
<<<<<<<
}
parse.cliOptions = [
{ name: "private", type: Boolean },
{ name: "stats", type: Boolean },
{ name: "help", alias: "h", type: Boolean },
{ name: "files", type: Array, defaultOption: true }
];
=======
}
/**
@param {string} - input json string
@param {object} - jsdoc-parse options
@returns {string} - output json string to be streamed out
@private
*/
function applyOptions(data, options){
data = JSON.parse(data);
data = data.filter(function(item){
if (options.private){
return item.ignore === undefined;
} else {
return item.ignore === undefined && item.access !== "private";
}
});
return JSON.stringify(data, null, " ");
}
>>>>>>>
}
parse.cliOptions = [
{ name: "private", type: Boolean },
{ name: "stats", type: Boolean },
{ name: "help", alias: "h", type: Boolean },
{ name: "files", type: Array, defaultOption: true }
];
/**
@param {string} - input json string
@param {object} - jsdoc-parse options
@returns {string} - output json string to be streamed out
@private
*/
function applyOptions(data, options){
data = JSON.parse(data);
data = data.filter(function(item){
if (options.private){
return item.ignore === undefined;
} else {
return item.ignore === undefined && item.access !== "private";
}
});
return JSON.stringify(data, null, " ");
} |
<<<<<<<
import { StoryGroups } from '../storyGroups/storyGroups.collection';
=======
import { ActivityCollection } from '../activity';
>>>>>>>
import { StoryGroups } from '../storyGroups/storyGroups.collection';
import { ActivityCollection } from '../activity'; |
<<<<<<<
// IMPORTANT: please take a minute to read the notes below before attempting to change
// the event we're listening to for iOS.
//
// - the keypress event is no good for us here, because it can't detect backspaces
// - the keyup event is no good here, as it doesn't seem to work with iOS's virtual keyboard
//
editor.bind('keydown', function(e) {
zss_editor.keyDownCallback();
=======
editor.bind('keypress', function(e) {
zss_editor.sendEnabledStyles(e);
zss_editor.formatNewLine(e);
zss_editor.callback("callback-user-triggered-change");
>>>>>>>
// IMPORTANT: please take a minute to read the notes below before attempting to change
// the event we're listening to for iOS.
//
// - the keypress event is no good for us here, because it can't detect backspaces
// - the keyup event is no good here, as it doesn't seem to work with iOS's virtual keyboard
//
editor.bind('keydown', function(e) {
zss_editor.keyDownCallback();
zss_editor.formatNewLine(e); |
<<<<<<<
this.domLoadedCallback();
=======
$('[contenteditable]').on('paste',function(e) {
// Ensure we only insert plaintext from the pasteboard
e.preventDefault();
var plainText = (e.originalEvent || e).clipboardData.getData('text/plain');
document.execCommand('insertText', false, plainText);
});
>>>>>>>
$('[contenteditable]').on('paste',function(e) {
// Ensure we only insert plaintext from the pasteboard
e.preventDefault();
var plainText = (e.originalEvent || e).clipboardData.getData('text/plain');
document.execCommand('insertText', false, plainText);
});
this.domLoadedCallback(); |
<<<<<<<
var jsonRpcUrl = "http://localhost:8080";
=======
var date = new Date();
var deploymentId = date.toLocaleString(Qt.locale(), "ddMMyyHHmmsszzz");
var jsonRpcUrl = "http://127.0.0.1:8080";
>>>>>>>
var jsonRpcUrl = "http://127.0.0.1:8080"; |
<<<<<<<
import {ChangeInitiativeStore_API as ChangeInitiativeStore} from "../../change-initiative/services/change-initiative-store";
=======
import {ApplicationStore_API as ApplicationStore} from "../../applications/services/application-store";
>>>>>>>
import {ApplicationStore_API as ApplicationStore} from "../../applications/services/application-store";
import {ChangeInitiativeStore_API as ChangeInitiativeStore} from "../../change-initiative/services/change-initiative-store";
<<<<<<<
ChangeInitiativeStore,
=======
ApplicationStore,
>>>>>>>
ApplicationStore,
ChangeInitiativeStore,
<<<<<<<
PersonStore,
PhysicalSpecDataTypeStore
=======
PhysicalSpecDataTypeStore,
SourceDataRatingStore,
TechnologyStatisticsService
>>>>>>>
PersonStore,
PhysicalSpecDataTypeStore,
SourceDataRatingStore,
TechnologyStatisticsService |
<<<<<<<
import {initialiseData} from '../common';
=======
import {initialiseData} from "../common";
import {toGraphId} from '../flow-diagram/flow-diagram-utils';
>>>>>>>
import {initialiseData} from '../common';
import {toGraphId} from '../flow-diagram/flow-diagram-utils';
<<<<<<<
const mkReleaseLifecycleStatusChangeCommand = (newStatus) => {
return { newStatus };
};
=======
function loadFlowDiagrams(specId, $q, flowDiagramStore, flowDiagramEntityStore) {
const ref = {
id: specId,
kind: 'PHYSICAL_SPECIFICATION'
};
const selector = {
entityReference: ref,
scope: 'EXACT'
};
const promises = [
flowDiagramStore.findForSelector(selector),
flowDiagramEntityStore.findForSelector(selector)
];
return $q
.all(promises)
.then(([flowDiagrams, flowDiagramEntities]) => ({ flowDiagrams, flowDiagramEntities }));
}
>>>>>>>
function loadFlowDiagrams(specId, $q, flowDiagramStore, flowDiagramEntityStore) {
const ref = {
id: specId,
kind: 'PHYSICAL_SPECIFICATION'
};
const selector = {
entityReference: ref,
scope: 'EXACT'
};
const promises = [
flowDiagramStore.findForSelector(selector),
flowDiagramEntityStore.findForSelector(selector)
];
return $q
.all(promises)
.then(([flowDiagrams, flowDiagramEntities]) => ({ flowDiagrams, flowDiagramEntities }));
}
const mkReleaseLifecycleStatusChangeCommand = (newStatus) => {
return { newStatus };
};
<<<<<<<
vm.deleteSpec = (specDef) => {
physicalSpecDefinitionStore
.deleteSpecification(specDef.id)
.then(result => {
if (result) {
notification.success(`Deleted version ${specDef.version}`);
loadSpecDefinitions();
} else {
notification.error(`Could not delete version ${specDef.version}`);
}
})
};
vm.activateSpec = (specDef) => {
physicalSpecDefinitionStore
.updateStatus(specDef.id, mkReleaseLifecycleStatusChangeCommand('ACTIVE'))
.then(result => {
if (result) {
notification.success(`Marked version ${specDef.version} as active`);
loadSpecDefinitions();
} else {
notification.error(`Could not mark version ${specDef.version} as active`);
}
})
};
vm.markSpecObsolete = (specDef) => {
physicalSpecDefinitionStore
.updateStatus(specDef.id, mkReleaseLifecycleStatusChangeCommand('OBSOLETE'))
.then(result => {
if (result) {
notification.success(`Marked version ${specDef.version} as obsolete`);
loadSpecDefinitions();
} else {
notification.error(`Could not mark version ${specDef.version} as obsolete`);
}
})
};
=======
vm.createFlowDiagramCommands = () => {
const nodeCommands = _
.chain(vm.logicalFlows)
.map(f => { return [f.source, f.target]; })
.flatten()
.uniqBy(toGraphId)
.map(a => ({ command: 'ADD_NODE', payload: a }))
.value();
const flowCommands = _.map(
vm.logicalFlows,
f => ({ command: 'ADD_FLOW', payload: Object.assign({}, f, { kind: 'LOGICAL_DATA_FLOW' } )}));
const moveCommands = _.map(
nodeCommands,
(nc, idx) => {
return {
command: 'MOVE',
payload: {
id : toGraphId(nc.payload),
dx: 50 + (110 * (idx % 8)),
dy: 10 + (50 * (idx / 8))
}
};
});
const physFlowCommands = _.map(
vm.physicalFlows,
pf => {
return {
command: 'ADD_DECORATION',
payload: {
ref: { kind: 'LOGICAL_DATA_FLOW', id: pf.logicalFlowId },
decoration: Object.assign({}, pf, { kind: 'PHYSICAL_FLOW' })
}
};
});
const title = `${vm.specification.name} Flows`;
const titleCommands = [
{ commands: 'SET_TITLE', payload: title }
];
return _.concat(nodeCommands, flowCommands, physFlowCommands, moveCommands, titleCommands);
};
>>>>>>>
vm.createFlowDiagramCommands = () => {
const nodeCommands = _
.chain(vm.logicalFlows)
.map(f => { return [f.source, f.target]; })
.flatten()
.uniqBy(toGraphId)
.map(a => ({ command: 'ADD_NODE', payload: a }))
.value();
const flowCommands = _.map(
vm.logicalFlows,
f => ({ command: 'ADD_FLOW', payload: Object.assign({}, f, { kind: 'LOGICAL_DATA_FLOW' } )}));
const moveCommands = _.map(
nodeCommands,
(nc, idx) => {
return {
command: 'MOVE',
payload: {
id : toGraphId(nc.payload),
dx: 50 + (110 * (idx % 8)),
dy: 10 + (50 * (idx / 8))
}
};
});
const physFlowCommands = _.map(
vm.physicalFlows,
pf => {
return {
command: 'ADD_DECORATION',
payload: {
ref: { kind: 'LOGICAL_DATA_FLOW', id: pf.logicalFlowId },
decoration: Object.assign({}, pf, { kind: 'PHYSICAL_FLOW' })
}
};
});
const title = `${vm.specification.name} Flows`;
const titleCommands = [
{ commands: 'SET_TITLE', payload: title }
];
return _.concat(nodeCommands, flowCommands, physFlowCommands, moveCommands, titleCommands);
};
vm.deleteSpec = (specDef) => {
physicalSpecDefinitionStore
.deleteSpecification(specDef.id)
.then(result => {
if (result) {
notification.success(`Deleted version ${specDef.version}`);
loadSpecDefinitions();
} else {
notification.error(`Could not delete version ${specDef.version}`);
}
})
};
vm.activateSpec = (specDef) => {
physicalSpecDefinitionStore
.updateStatus(specDef.id, mkReleaseLifecycleStatusChangeCommand('ACTIVE'))
.then(result => {
if (result) {
notification.success(`Marked version ${specDef.version} as active`);
loadSpecDefinitions();
} else {
notification.error(`Could not mark version ${specDef.version} as active`);
}
})
};
vm.markSpecObsolete = (specDef) => {
physicalSpecDefinitionStore
.updateStatus(specDef.id, mkReleaseLifecycleStatusChangeCommand('OBSOLETE'))
.then(result => {
if (result) {
notification.success(`Marked version ${specDef.version} as obsolete`);
loadSpecDefinitions();
} else {
notification.error(`Could not mark version ${specDef.version} as obsolete`);
}
})
}; |
<<<<<<<
require('./lineage-report'),
=======
require('./involvement-kind'),
>>>>>>>
require('./involvement-kind'),
require('./lineage-report'), |
<<<<<<<
import changeInitiativeBrowser from './components/change-initiative-browser/change-initiative-browser';
import changeInitiativeRelatedAppsSection from './components/related-apps-section/related-apps-section';
=======
import changeInitiativeTable from './components/change-initiative-table/change-initiative-table';
import * as changeInitiativeRelatedDataTypeSection from './components/related-data-type-section/change-initiative-related-data-type-section';
>>>>>>>
import changeInitiativeTable from './components/change-initiative-table/change-initiative-table';
import * as changeInitiativeRelatedDataTypeSection from './components/related-data-type-section/change-initiative-related-data-type-section';
import changeInitiativeBrowser from './components/change-initiative-browser/change-initiative-browser';
import changeInitiativeRelatedAppsSection from './components/related-apps-section/related-apps-section';
<<<<<<<
registerComponents(module, [
changeInitiativeBrowser,
changeInitiativeSection,
changeInitiativeRelatedAppsSection
]);
=======
registerComponents(module, [
changeInitiativeTable,
changeInitiativeSection,
changeInitiativeRelatedDataTypeSection
]);
>>>>>>>
registerComponents(module, [
changeInitiativeBrowser,
changeInitiativeSection,
changeInitiativeTable,
changeInitiativeRelatedAppsSection,
changeInitiativeRelatedDataTypeSection
]); |
<<<<<<<
import AccessLog from "./access-log";
import Actor from "./actor";
import Alias from "./alias";
import Applications from "./applications";
import AppGroups from "./app-groups";
import AssetCost from "./asset-cost";
import Attestation from "./attestation";
import AuthSources from "./auth-sources";
import Bookmarks from "./bookmarks";
import ChangeInitiative from "./change-initiative";
import Complexity from "./complexity";
import Common_Module from "./common/module";
import ChangeLog from "./change-log";
import DataFlow from "./data-flow";
import DataTypeUsage from "./data-type-usage";
import DataTypes from "./data-types";
import Databases from "./databases";
import DrillGrid from "./drill-grid";
import DynamicSection from "./dynamic-section";
import EndUserApps from "./end-user-apps";
import Entity from "./entity";
import EntityEnum from "./entity-enum";
import EntityNamedNote from "./entity-named-note";
import EntityRelationship from "./entity-relationship";
import EntityStatistics from "./entity-statistics";
import EntitySvgDiagram from "./entity-svg-diagram";
import EntityTags from "./entity-tags";
import EnumValue from "./enum-value";
import Examples from "./examples";
import Extensions from "./extensions";
import FlowDiagram from "./flow-diagram";
import Formly from "./formly";
import History from "./history";
import Involvement from "./involvement";
import InvolvementKind from "./involvement-kind";
import Lineage from "./lineage";
import LogicalDataElement from "./logical-data-element";
import LogicalFlow from "./logical-flow";
import LogicalFlowDecorator from "./logical-flow-decorator";
import Measurable from "./measurable";
import MeasurableCategory from "./measurable-category";
import MeasurableRating from "./measurable-rating";
import MeasurableRelationship from "./measurable-relationship";
import Navbar from "./navbar";
import Notification from "./notification";
import OrgUnits from "./org-units";
import Orphan from "./orphan";
import Person from "./person";
import Perspective from "./perspective";
import PhysicalFlows from "./physical-flows";
import PhysicalSpecifications from "./physical-specifications";
import PhysicalField from "./physical-field";
import Playpen from "./playpen";
import Playpen5 from "./playpen/5";
import Profile from "./profile";
import Ratings from "./ratings";
import Roadmap from "./roadmap";
import SharedPreference from "./shared-preference";
import ServerInfo from "./server-info";
import SoftwareCatalog from "./software-catalog";
import SourceDataRating from "./source-data-rating";
import StaticPanel from "./static-panel";
import Survey from "./survey";
import SvgDiagram from "./svg-diagram";
import System from "./system";
import Technology from "./technology";
import Tour from "./tour";
import User from "./user";
import UserContribution from "./user-contribution";
import Welcome from "./welcome";
import Widgets from "./widgets";
=======
import AccessLog from "./access-log";
import Actor from "./actor";
import Alias from "./alias";
import Applications from "./applications";
import AppGroups from "./app-groups";
import AssetCost from "./asset-cost";
import Attestation from "./attestation";
import AuthSources from "./auth-sources";
import Bookmarks from "./bookmarks";
import ChangeInitiative from "./change-initiative";
import Complexity from "./complexity";
import Common_Module from "./common/module";
import ChangeLog from "./change-log";
import DataFlow from "./data-flow";
import DataTypeUsage from "./data-type-usage";
import DataTypes from "./data-types";
import Databases from "./databases";
import DrillGrid from "./drill-grid";
import DynamicSection from "./dynamic-section";
import EndUserApps from "./end-user-apps";
import Entity from "./entity";
import EntityEnum from "./entity-enum";
import EntityNamedNote from "./entity-named-note";
import EntityRelationship from "./entity-relationship";
import EntityStatistics from "./entity-statistics";
import EntitySvgDiagram from "./entity-svg-diagram";
import EntityTags from "./entity-tags";
import EnumValue from "./enum-value";
import Examples from "./examples";
import Extensions from "./extensions";
import FlowDiagram from "./flow-diagram";
import Formly from "./formly";
import History from "./history";
import Involvement from "./involvement";
import InvolvementKind from "./involvement-kind";
import LogicalDataElement from "./logical-data-element";
import LogicalFlow from "./logical-flow";
import LogicalFlowDecorator from "./logical-flow-decorator";
import Measurable from "./measurable";
import MeasurableCategory from "./measurable-category";
import MeasurableRating from "./measurable-rating";
import MeasurableRelationship from "./measurable-relationship";
import Navbar from "./navbar";
import Notification from "./notification";
import OrgUnits from "./org-units";
import Orphan from "./orphan";
import Person from "./person";
import Perspective from "./perspective";
import PhysicalFlows from "./physical-flows";
import PhysicalSpecifications from "./physical-specifications";
import PhysicalField from "./physical-field";
import Playpen from "./playpen";
import Playpen5 from "./playpen/5";
import Profile from "./profile";
import Ratings from "./ratings";
import SharedPreference from "./shared-preference";
import ServerInfo from "./server-info";
import SoftwareCatalog from "./software-catalog";
import SourceDataRating from "./source-data-rating";
import StaticPanel from "./static-panel";
import Survey from "./survey";
import SvgDiagram from "./svg-diagram";
import System from "./system";
import Technology from "./technology";
import Tour from "./tour";
import User from "./user";
import UserContribution from "./user-contribution";
import Welcome from "./welcome";
import Widgets from "./widgets";
>>>>>>>
import AccessLog from "./access-log";
import Actor from "./actor";
import Alias from "./alias";
import Applications from "./applications";
import AppGroups from "./app-groups";
import AssetCost from "./asset-cost";
import Attestation from "./attestation";
import AuthSources from "./auth-sources";
import Bookmarks from "./bookmarks";
import ChangeInitiative from "./change-initiative";
import Complexity from "./complexity";
import Common_Module from "./common/module";
import ChangeLog from "./change-log";
import DataFlow from "./data-flow";
import DataTypeUsage from "./data-type-usage";
import DataTypes from "./data-types";
import Databases from "./databases";
import DrillGrid from "./drill-grid";
import DynamicSection from "./dynamic-section";
import EndUserApps from "./end-user-apps";
import Entity from "./entity";
import EntityEnum from "./entity-enum";
import EntityNamedNote from "./entity-named-note";
import EntityRelationship from "./entity-relationship";
import EntityStatistics from "./entity-statistics";
import EntitySvgDiagram from "./entity-svg-diagram";
import EntityTags from "./entity-tags";
import EnumValue from "./enum-value";
import Examples from "./examples";
import Extensions from "./extensions";
import FlowDiagram from "./flow-diagram";
import Formly from "./formly";
import History from "./history";
import Involvement from "./involvement";
import InvolvementKind from "./involvement-kind";
import LogicalDataElement from "./logical-data-element";
import LogicalFlow from "./logical-flow";
import LogicalFlowDecorator from "./logical-flow-decorator";
import Measurable from "./measurable";
import MeasurableCategory from "./measurable-category";
import MeasurableRating from "./measurable-rating";
import MeasurableRelationship from "./measurable-relationship";
import Navbar from "./navbar";
import Notification from "./notification";
import OrgUnits from "./org-units";
import Orphan from "./orphan";
import Person from "./person";
import Perspective from "./perspective";
import PhysicalFlows from "./physical-flows";
import PhysicalSpecifications from "./physical-specifications";
import PhysicalField from "./physical-field";
import Playpen from "./playpen";
import Playpen5 from "./playpen/5";
import Profile from "./profile";
import Ratings from "./ratings";
import Roadmap from "./roadmap";
import SharedPreference from "./shared-preference";
import ServerInfo from "./server-info";
import SoftwareCatalog from "./software-catalog";
import SourceDataRating from "./source-data-rating";
import StaticPanel from "./static-panel";
import Survey from "./survey";
import SvgDiagram from "./svg-diagram";
import System from "./system";
import Technology from "./technology";
import Tour from "./tour";
import User from "./user";
import UserContribution from "./user-contribution";
import Welcome from "./welcome";
import Widgets from "./widgets"; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.