conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
this.forceConnect = options.forceConnect || false;
this.uuid = uuid;
=======
>>>>>>>
this.forceConnect = options.forceConnect || false; |
<<<<<<<
if (ivCiphertext.length < 16 || ivCiphertext.length % 16 != 0) {
=======
if (ivCiphertext.length < 16 || ivCiphertext.length % 16 != 0) {
>>>>>>>
if (ivCiphertext.length < 16 || ivCiphertext.length % 16 != 0) {
<<<<<<<
options.sharedKey = NRS.getSharedSecretJava(options.privateKey, options.publicKey);
var sharedKey = NRS.getSharedSecretJava(options.privateKey, options.publicKey);
var options = {};
options.sharedKey = sharedKey;
}
options.sharedKey = new Uint8Array(options.sharedKey);
data = converters.hexStringToByteArray(data);
var result = aesDecrypt(data, options);
var binData = new Uint8Array(result.decrypted);
options.isCompressed = false;
options.isText = false;
=======
options.sharedKey = getSharedSecret(options.privateKey, options.publicKey);
}
>>>>>>>
options.sharedKey = NRS.getSharedSecretJava(options.privateKey, options.publicKey);
var sharedKey = NRS.getSharedSecretJava(options.privateKey, options.publicKey);
var options = {};
options.sharedKey = sharedKey;
}
options.sharedKey = new Uint8Array(options.sharedKey);
data = converters.hexStringToByteArray(data);
var result = aesDecrypt(data, options);
var binData = new Uint8Array(result.decrypted);
options.isCompressed = false;
options.isText = false;
options.sharedKey = getSharedSecret(options.privateKey, options.publicKey);
} |
<<<<<<<
that.items = JSON.parse(data);
if (that.transactionType === 'getBlockchainTransactions' || that.transactionType === 'getPrivateBlockchainTransactions') {
that.items = JSON.parse(data).transactions;
that.serverKey = JSON.parse(data).serverPublicKey;
if (that.items.length < 15 && that.page == 1) {
$(that.target).parent().find('[data-transactions-pagination]').find('.page-nav').addClass('disabled');
} else {
$(that.target).parent().find('[data-transactions-pagination]').find('.page-nav').removeClass('disabled');
}
for (var i = 0; i < that.items.length; i++) {
var transaction = that.items[i];
transaction.confirmed = true;
rows += NRS.getTransactionRowHTML(transaction, false, {amount: 0, fee: 0});
}
if ($el === '#transactions_contents') {
NRS.dataLoaded(rows);
}
NRS.addPhasingInfoToTransactionRows(that.items);
}
if (that.transactionType === 'getAccountLedger' || that.transactionType === 'getPrivateAccountLedger') {
that.items = JSON.parse(data).entries;
that.serverKey = JSON.parse(data).serverPublicKey;
if (that.items) {
var decimalParams = NRS.getLedgerNumberOfDecimals(that.items);
for (var i = 0; i < that.items.length; i++) {
var entry = that.items[i];
if ('encryptedLedgerEntry' in entry) {
var options = {
publicKey : converters.hexStringToInt8ByteArray(that.serverKey),
privateKey : converters.hexStringToInt8ByteArray(that.privateKey),
};
options.sharedKey = NRS.getSharedSecretJava(options.privateKey, options.publicKey);
var decrypted = NRS.decryptData(entry.encryptedLedgerEntry, options);
decrypted = decrypted.message;
decrypted = converters.hexStringToString(decrypted);
decrypted = decrypted.slice(0, decrypted.lastIndexOf('}') + 1);
decrypted = JSON.parse(decrypted);
entry = decrypted;
}
rows += NRS.getLedgerEntryRow(entry, decimalParams);
}
}
if ($el === '#ledger_contents') {
NRS.dataLoaded(rows);
}
}
if (that.transactionType === 'getBlocks') {
that.items = JSON.parse(data).blocks;
if ($el === '#blocks_contents') {
NRS.blocksPageLoaded(that.items);
}
}
=======
that.items = JSON.parse(data);
if (that.transactionType === 'getBlockchainTransactions' || that.transactionType === 'getPrivateBlockchainTransactions') {
that.items = JSON.parse(data).transactions;
that.serverKey = JSON.parse(data).serverPublicKey;
if (that.items.length < 15 && that.page == 1) {
$(that.target).parent().find('[data-transactions-pagination]').find('.page-nav').addClass('disabled');
} else {
$(that.target).parent().find('[data-transactions-pagination]').find('.page-nav').removeClass('disabled');
}
for (var i = 0; i < that.items.length; i++) {
var transaction = that.items[i];
transaction.confirmed = true;
rows += NRS.getTransactionRowHTML(transaction, false, {amount: 0, fee: 0});
}
if ($el === '#transactions_contents') {
NRS.dataLoaded(rows);
}
NRS.addPhasingInfoToTransactionRows(that.items);
}
if (that.transactionType === 'getAccountLedger' || that.transactionType === 'getPrivateAccountLedger') {
that.items = JSON.parse(data).entries;
var decimalParams = NRS.getLedgerNumberOfDecimals(that.items);
for (var i = 0; i < that.items.length; i++) {
var entry = that.items[i];
rows += NRS.getLedgerEntryRow(entry, decimalParams);
}
if ($el === '#ledger_contents') {
NRS.dataLoaded(rows);
}
}
if (that.transactionType === 'getBlocks') {
that.items = JSON.parse(data).blocks;
if ($el === '#blocks_contents') {
NRS.blocksPageLoaded(that.items);
}
}
>>>>>>>
that.items = JSON.parse(data);
if (that.transactionType === 'getBlockchainTransactions' || that.transactionType === 'getPrivateBlockchainTransactions') {
that.items = JSON.parse(data).transactions;
that.serverKey = JSON.parse(data).serverPublicKey;
if (that.items.length < 15 && that.page == 1) {
$(that.target).parent().find('[data-transactions-pagination]').find('.page-nav').addClass('disabled');
} else {
$(that.target).parent().find('[data-transactions-pagination]').find('.page-nav').removeClass('disabled');
}
for (var i = 0; i < that.items.length; i++) {
var transaction = that.items[i];
transaction.confirmed = true;
rows += NRS.getTransactionRowHTML(transaction, false, {amount: 0, fee: 0});
}
if ($el === '#transactions_contents') {
NRS.dataLoaded(rows);
}
NRS.addPhasingInfoToTransactionRows(that.items);
}
if (that.transactionType === 'getAccountLedger' || that.transactionType === 'getPrivateAccountLedger') {
that.items = JSON.parse(data).entries;
that.serverKey = JSON.parse(data).serverPublicKey;
if (that.items) {
var decimalParams = NRS.getLedgerNumberOfDecimals(that.items);
for (var i = 0; i < that.items.length; i++) {
var entry = that.items[i];
if ('encryptedLedgerEntry' in entry) {
var options = {
publicKey : converters.hexStringToInt8ByteArray(that.serverKey),
privateKey : converters.hexStringToInt8ByteArray(that.privateKey),
};
options.sharedKey = NRS.getSharedSecretJava(options.privateKey, options.publicKey);
var decrypted = NRS.decryptData(entry.encryptedLedgerEntry, options);
decrypted = decrypted.message;
decrypted = converters.hexStringToString(decrypted);
decrypted = decrypted.slice(0, decrypted.lastIndexOf('}') + 1);
decrypted = JSON.parse(decrypted);
entry = decrypted;
}
rows += NRS.getLedgerEntryRow(entry, decimalParams);
}
}
if ($el === '#ledger_contents') {
NRS.dataLoaded(rows);
}
}
if (that.transactionType === 'getBlocks') {
that.items = JSON.parse(data).blocks;
if ($el === '#blocks_contents') {
NRS.blocksPageLoaded(that.items);
}
}
<<<<<<<
// console.log(sharedKey);
NRS.sendRequest("getBlockchainTransactions", {
=======
NRS.sendRequest("getBlockchainTransactions", {
>>>>>>>
NRS.sendRequest("getBlockchainTransactions", {
<<<<<<<
options.sharedKey = NRS.getSharedSecretJava(options.privateKey, options.publicKey);
var decrypted = NRS.decryptData(t.encryptedTransaction, options);
decrypted = decrypted.message;
decrypted = converters.hexStringToString(decrypted);
decrypted = decrypted.slice(0, decrypted.lastIndexOf('}') + 1);
decrypted = JSON.parse(decrypted);
t = decrypted;
}
console.log(t);
var transactionType = $.t(NRS.transactionTypes[t.type]['subTypes'][t.subtype]['i18nKeyTitle']);
console.log(decimals);
if (transactionType === 'Unknown') {
=======
if ('encryptedTransaction' in t) {
var options = {
publicKey : converters.hexStringToInt8ByteArray(NRS.myTransactionPagination.serverKey),
privateKey : converters.hexStringToInt8ByteArray(NRS.myTransactionPagination.privateKey),
};
options.sharedKey = NRS.getSharedSecretJava(options.privateKey, options.publicKey);
var decrypted = NRS.decryptData(t.encryptedTransaction, options);
decrypted = decrypted.message;
decrypted = converters.hexStringToString(decrypted);
decrypted = decrypted.slice(0, decrypted.lastIndexOf('}') + 1);
decrypted = JSON.parse(decrypted);
t = decrypted;
}
var transactionType = $.t(NRS.transactionTypes[t.type]['subTypes'][t.subtype]['i18nKeyTitle']);
if (transactionType === 'Unknown') {
>>>>>>>
options.sharedKey = NRS.getSharedSecretJava(options.privateKey, options.publicKey);
var decrypted = NRS.decryptData(t.encryptedTransaction, options);
decrypted = decrypted.message;
decrypted = converters.hexStringToString(decrypted);
decrypted = decrypted.slice(0, decrypted.lastIndexOf('}') + 1);
decrypted = JSON.parse(decrypted);
t = decrypted;
}
var transactionType = $.t(NRS.transactionTypes[t.type]['subTypes'][t.subtype]['i18nKeyTitle']);
if (transactionType === 'Unknown') { |
<<<<<<<
=======
>>>>>>>
<<<<<<<
=======
>>>>>>> |
<<<<<<<
self.getStylesheets().forEach(function extract_rules(stylesheet) {
Array.prototype.forEach.call(self.getCSSRules(stylesheet), function filter_by_column_selector(rule) {
if (rule.media && self.mediaRuleHasColumnsSelector(rule.cssRules)) {
=======
self.get_stylesheets().forEach(function extract_rules(stylesheet) {
Array.prototype.forEach.call(self.get_css_rules(stylesheet), function filter_by_column_selector(rule) {
if (rule.media && rule.cssRules && self.media_rule_has_columns_selector(rule.cssRules)) {
>>>>>>>
self.getStylesheets().forEach(function extract_rules(stylesheet) {
Array.prototype.forEach.call(self.getCSSRules(stylesheet), function filter_by_column_selector(rule) {
if (rule.media && rule.cssRules && self.mediaRuleHasColumnsSelector(rule.cssRules)) { |
<<<<<<<
self.next_element_column_index = function next_element_column_index(grid, fragments) {
=======
self.nextElementColumnIndex = function nextElementColumnIndex(grid) {
>>>>>>>
self.nextElementColumnIndex = function nextElementColumnIndex(grid, fragments) {
<<<<<<<
, fragments = self.create_list_of_fragments(numberOfColumns)
=======
, fragments = self.createFragmentsList(numberOfColumns)
, columnIndex = self.nextElementColumnIndex(grid)
>>>>>>>
, fragments = self.createFragmentsList(numberOfColumns) |
<<<<<<<
console.error(JsSIP.C.LOG_URI + 'missing or invalid "host" parameter');
throw new TypeError('missing "host" parameter');
=======
console.warn(JsSIP.C.LOG_URI + 'Missing "host" in URI');
throw new TypeError('Invalid host: '+ host);
>>>>>>>
throw new TypeError('missing or invalid "host" parameter'); |
<<<<<<<
var item = $('<li>', {"class": "upload-kit-item done"})
=======
console.log(options);
var item = $('<li>', {"class": "upload-kit-item done", value: index})
>>>>>>>
var item = $('<li>', {"class": "upload-kit-item done", value: index}) |
<<<<<<<
breakEditLinkTitle: 'Cancel',
forceDeleteConfirmation: 'There are more records using this tag, are you sure do you want to remove it?'
}
=======
breakEditLinkTitle: 'Cancel'
},
tabindex: false
>>>>>>>
breakEditLinkTitle: 'Cancel',
forceDeleteConfirmation: 'There are more records using this tag, are you sure do you want to remove it?'
},
tabindex: false
<<<<<<<
var resultValue = result[i].label? result[i].label : result[i];
var label = options.checkNewEntriesCaseSensitive == true? resultValue : resultValue.toLowerCase();
=======
var label = typeof result[i] == 'string' ? result[i] : result[i].label;
if (options.checkNewEntriesCaseSensitive == false)
label = label.toLowerCase();
>>>>>>>
var label = typeof result[i] == 'string' ? result[i] : result[i].label;
if (options.checkNewEntriesCaseSensitive == false)
label = label.toLowerCase();
var resultValue = result[i].label? result[i].label : result[i];
var label = options.checkNewEntriesCaseSensitive == true? resultValue : resultValue.toLowerCase(); |
<<<<<<<
test('table.get, nested relationships', function (t) {
useDb(t, ['user', 'book', 'review'], function (db, done) {
const user = makeUserTable(db)
const book = makeBookTable(db)
const review = makeReviewTable(db)
review.getOne({ id: 1 }, {
debug: true,
relationships: true,
relationshipsDepth: -1
}, function (err, review) {
t.notOk(err, 'no errors')
t.same(review.test(), 'This is a review', 'review is model instance')
t.ok(review.book, 'review book returned')
t.same(review.book.test(), 'This is a book', 'book is model instance')
t.ok(review.book.author, 'review book author returned')
t.same(review.book.author.test(), 'This is a user', 'author is model instance')
t.ok(review.book.author.books, 'review book author publications returned')
t.same(review.book.author.books[0].test(), 'This is a book', 'review book author publications are model instances')
t.end()
})
})
})
=======
// https://github.com/brianloveswords/streamsql/issues/10
test('table.get, relationships should not hang when query returns empty set', function (t) {
useDb(t, ['user', 'book'], function (db, done) {
const user = makeUserTable(db)
const book = makeBookTable(db)
user.get({ id: 'whatever' }, {
debug: true,
relationships: true
}, function (err, authors) {
t.same(authors, [])
t.end()
})
})
})
>>>>>>>
test('table.get, nested relationships', function (t) {
useDb(t, ['user', 'book', 'review'], function (db, done) {
const user = makeUserTable(db)
const book = makeBookTable(db)
const review = makeReviewTable(db)
review.getOne({ id: 1 }, {
debug: true,
relationships: true,
relationshipsDepth: -1
}, function (err, review) {
t.notOk(err, 'no errors')
t.same(review.test(), 'This is a review', 'review is model instance')
t.ok(review.book, 'review book returned')
t.same(review.book.test(), 'This is a book', 'book is model instance')
t.ok(review.book.author, 'review book author returned')
t.same(review.book.author.test(), 'This is a user', 'author is model instance')
t.ok(review.book.author.books, 'review book author publications returned')
t.same(review.book.author.books[0].test(), 'This is a book', 'review book author publications are model instances')
t.end()
})
})
})
// https://github.com/brianloveswords/streamsql/issues/10
test('table.get, relationships should not hang when query returns empty set', function (t) {
useDb(t, ['user', 'book'], function (db, done) {
const user = makeUserTable(db)
const book = makeBookTable(db)
user.get({ id: 'whatever' }, {
debug: true,
relationships: true
}, function (err, authors) {
t.same(authors, [])
t.end()
})
})
}) |
<<<<<<<
this.get = function (table, id) {
=======
this.get = function (table, key) {
if (closed) {
throw new Error('Database has been closed');
}
var transaction = db.transaction(table);
var store = transaction.objectStore(table);
key = mongoifyKey(key);
var req = store.get(key);
>>>>>>>
this.get = function (table, key) {
<<<<<<<
if (closed) {
reject('Database has been closed');
return;
}
var transaction = db.transaction(table);
var store = transaction.objectStore(table);
var req = store.count();
=======
key = mongoifyKey(key);
var req = store.count(key);
>>>>>>>
if (closed) {
reject('Database has been closed');
return;
}
var transaction = db.transaction(table);
var store = transaction.objectStore(table);
key = mongoifyKey(key);
var req = store.count(); |
<<<<<<<
db.delete(dbName).then(function () {
var request = indexedDB.open(dbName);
request.onupgradeneeded = function (e) {
expect(e.oldVersion).toEqual(0); // Confirm deletion had occurred
e.target.transaction.onabort = function () {
=======
var spec = this;
db.open({
server: this.dbName,
version: 1,
schema: {
test: {
}
}
}).then(function (s) {
s.close();
db.delete(spec.dbName).then(function () {
var request = indexedDB.open(spec.dbName);
request.onupgradeneeded = function (e) {
expect(e.oldVersion).to.equal(0);
e.target.transaction.abort();
>>>>>>>
var spec = this;
db.delete(spec.dbName).then(function () {
var request = indexedDB.open(spec.dbName);
request.onupgradeneeded = function (e) {
expect(e.oldVersion).to.equal(0); // Confirm deletion had occurred
e.target.transaction.onabort = function () { |
<<<<<<<
let activityTitle = (document.querySelector('meta[property="og:title"]') === null) ? document.title : document.querySelector('meta[property="og:title"]').content;
let activityDescription = (document.querySelector('link[rel~="canonical"][href]') === null) ? ((document.querySelector('meta[property="og:url"][content],meta[name="og:url"][content]') === null) ? document.location : document.querySelector('meta[property="og:url"][content],meta[name="og:url"][content]').content) : document.querySelector('link[rel~="canonical"][href]').href;
=======
let activityTitle = (document.querySelector('meta[property="og:title"],meta[name="og:title"]') === null) ? document.title : document.querySelector('meta[property="og:title"],meta[name="og:title"]').content;
let activityDescription = location.href;
>>>>>>>
let activityTitle = (document.querySelector('meta[property="og:title"],meta[name="og:title"]') === null) ? document.title : document.querySelector('meta[property="og:title"],meta[name="og:title"]').content;
let activityDescription = (document.querySelector('link[rel~="canonical"][href]') === null) ? ((document.querySelector('meta[property="og:url"][content],meta[name="og:url"][content]') === null) ? document.location : document.querySelector('meta[property="og:url"][content],meta[name="og:url"][content]').content) : document.querySelector('link[rel~="canonical"][href]').href; |
<<<<<<<
import { parseVector3, parseEuler, parseQuaternion } from '../parsers.js';
=======
import { Object3D } from 'three';
import { parseVector3, parseEuler } from '../parsers';
>>>>>>>
import { Object3D } from 'three';
import { parseVector3, parseEuler, parseQuaternion } from '../parsers';
<<<<<<<
vector3, euler, quaternion, boolean, string,
} from '../validators.js';
import { Object3D } from '../three.js';
=======
vector3,
euler,
boolean,
string,
} from '../validators';
>>>>>>>
vector3,
euler,
quaternion,
boolean,
string,
} from '../validators'; |
<<<<<<<
import VglLineDashedMaterial from './materials/vgl-line-dashed-material.js';
=======
import VglMeshNormalMaterial from './materials/vgl-mesh-normal-material.js';
>>>>>>>
import VglLineDashedMaterial from './materials/vgl-line-dashed-material.js';
import VglMeshNormalMaterial from './materials/vgl-mesh-normal-material.js';
<<<<<<<
VglLineDashedMaterial,
=======
VglMeshNormalMaterial,
>>>>>>>
VglLineDashedMaterial,
VglMeshNormalMaterial, |
<<<<<<<
// console.log(json, 'XXX');
=======
console.log('this is json in GINAP', json)
>>>>>>>
// console.log(json, 'XXX');
console.log('this is json in GINAP', json)
<<<<<<<
}
=======
}
console.log(result, 'this is result line 239 importPath')
>>>>>>>
} |
<<<<<<<
=======
res.locals.respoitoryUrl = 'https://github.com/bookbrainz/bookbrainz-site/';
res.locals.siteRevision = siteRevision;
// Get the latest count of messages in the user's inbox.
if (req.session && req.session.bearerToken) {
return bbws.get('/message/inbox/', {
accessToken: req.session.bearerToken
})
.then((list) => {
res.locals.inboxCount = list.objects.length;
})
.catch((err) => {
console.log(err.stack);
res.locals.inboxCount = 0;
})
.finally(next);
}
>>>>>>>
res.locals.respoitoryUrl = 'https://github.com/bookbrainz/bookbrainz-site/';
res.locals.siteRevision = siteRevision; |
<<<<<<<
/* Middleware loader functions. */
var makeEntityLoader = require('../../helpers/middleware').makeEntityLoader;
var loadCreatorTypes = require('../../helpers/middleware').loadCreatorTypes;
var loadGenders = require('../../helpers/middleware').loadGenders;
var loadLanguages = require('../../helpers/middleware').loadLanguages;
var loadEntityRelationships = require('../../helpers/middleware').loadEntityRelationships;
=======
var Gender = require('../../data/properties/gender');
var CreatorType = require('../../data/properties/creator-type');
var Language = require('../../data/properties/language');
var Entity = require('../../data/entity');
var renderRelationship = require('../../helpers/render');
var React = require('react');
>>>>>>>
/* Middleware loader functions. */
var makeEntityLoader = require('../../helpers/middleware').makeEntityLoader;
var loadCreatorTypes = require('../../helpers/middleware').loadCreatorTypes;
var loadGenders = require('../../helpers/middleware').loadGenders;
var loadLanguages = require('../../helpers/middleware').loadLanguages;
var loadEntityRelationships = require('../../helpers/middleware').loadEntityRelationships;
var React = require('react'); |
<<<<<<<
=======
const ReactDOMServer = require('react-dom/server');
const User = require('../data/user');
const bbws = require('../helpers/bbws');
>>>>>>>
const ReactDOMServer = require('react-dom/server');
<<<<<<<
new Editor({id: parseInt(req.user.id, 10)})
.fetch()
.then((editor) => {
const markup = React.renderToString(ProfileForm(editor.toJSON()));
=======
User.getCurrent(req.session.bearerToken)
.then((user) => {
const props = {
id: user.id,
bio: user.bio
};
const markup = ReactDOMServer.renderToString(ProfileForm(props));
>>>>>>>
new Editor({id: parseInt(req.user.id, 10)})
.fetch()
.then((editor) => {
const markup = ReactDOMServer.renderToString(ProfileForm(editor.toJSON()));
<<<<<<<
new Editor({
id: parseInt(req.body.id, 10),
bio: req.body.bio,
email: req.body.email
})
.save()
.then((editor) => {
res.send(editor.toJSON());
})
=======
bbws.put(
`/user/${req.body.id}/`,
{bio: req.body.bio},
{accessToken: req.session.bearerToken}
)
.then((response) => {
res.send(response);
})
>>>>>>>
new Editor({
id: parseInt(req.body.id, 10),
bio: req.body.bio,
email: req.body.email
})
.save()
.then((editor) => {
res.send(editor.toJSON());
}) |
<<<<<<<
var auth = require('../../helpers/auth');
var Relationship = require('../../data/relationship');
var RelationshipType = require('../../data/properties/relationship-type');
var Entity = require('../../data/entity');
var React = require('react');
var EditForm = React.createFactory(require('../../../client/components/forms/creator.jsx'));
var Promise = require('bluebird');
var config = require('../../helpers/config');
var _ = require('underscore');
=======
const auth = require('../../helpers/auth');
const Relationship = require('../../data/relationship');
const RelationshipType = require('../../data/properties/relationship-type');
const Entity = require('../../data/entity');
const React = require('react');
const EditForm = React.createFactory(
require('../../../client/components/forms/creator.jsx')
);
const Promise = require('bluebird');
const config = require('../../helpers/config');
>>>>>>>
const auth = require('../../helpers/auth');
const Relationship = require('../../data/relationship');
const RelationshipType = require('../../data/properties/relationship-type');
const Entity = require('../../data/entity');
const React = require('react');
const EditForm = React.createFactory(
require('../../../client/components/forms/creator.jsx')
);
const Promise = require('bluebird');
const config = require('../../helpers/config');
const _ = require('underscore');
<<<<<<<
router.post('/:bbid/relationships/handler', auth.isAuthenticated, function(req, res) {
// Send a relationship revision for each of the relationships
const relationshipsPromise = Promise.all(
req.body.map((relationship) =>
Relationship.create(relationship, {
=======
router.post('/:bbid/relationships/handler', auth.isAuthenticated,
(req, res) => {
req.body.forEach((relationship) => {
// Send a relationship revision for each of the relationships
const changes = relationship;
Relationship.create(changes, {
>>>>>>>
router.post('/:bbid/relationships/handler', auth.isAuthenticated, function(req, res) {
// Send a relationship revision for each of the relationships
const relationshipsPromise = Promise.all(
req.body.map((relationship) =>
Relationship.create(relationship, {
<<<<<<<
})
)
);
relationshipsPromise.then(() => {
res.send({result: "success"});
})
.catch(() => {
res.send({result: "error"});
});
});
=======
}).then(res.send);
});
}
);
>>>>>>>
})
)
);
relationshipsPromise.then(() => {
res.send({result: "success"});
})
.catch(() => {
res.send({result: "error"});
});
}); |
<<<<<<<
const passport = require('passport');
const config = require('../helpers/config');
const BBWSStrategy = require('./passport-bookbrainz-ws');
=======
var passport = require('passport');
var Editor = require('bookbrainz-data').Editor;
var LocalStrategy = require('passport-local').Strategy;
>>>>>>>
const passport = require('passport');
const Editor = require('bookbrainz-data').Editor;
const LocalStrategy = require('passport-local').Strategy;
<<<<<<<
auth.authenticate = function authenticate() {
return function authenticateFunc(req, res, next) {
const options = {
username: req.body.username,
password: req.body.password
};
passport.authenticate('bbws', options)(req, res, (err) => {
if (err) {
console.log(err.stack);
let newErr;
switch (err.name) {
case 'InternalOAuthError':
case 'TokenError':
newErr = new Error(
'An internal error occurred during authentication'
);
break;
case 'AuthorizationError':
newErr = new Error('Invalid username or password');
break;
default:
newErr = new Error(
'An unknown error occurred during authentication'
);
}
return next(newErr);
}
next();
});
};
};
auth.isAuthenticated = function isAuthenticated(req, res, next) {
=======
auth.isAuthenticated = function isAuthenticated(req, res, next) {
>>>>>>>
auth.isAuthenticated = function isAuthenticated(req, res, next) { |
<<<<<<<
import Promise from 'bluebird';
import _ from 'lodash';
=======
>>>>>>>
import Promise from 'bluebird';
import _ from 'lodash'; |
<<<<<<<
=======
const auth = require('../helpers/auth');
const React = require('react');
const ReactDOMServer = require('react-dom/server');
const LoginPage = React.createFactory(
require('../../client/components/pages/login.jsx')
);
>>>>>>>
const React = require('react');
const ReactDOMServer = require('react-dom/server');
const LoginPage = React.createFactory(
require('../../client/components/pages/login.jsx')
); |
<<<<<<<
import DeleteOrRemoveCollaborationModal from './parts/delete-or-remove-collaboration-modal';
import {ENTITY_TYPE_ICONS} from '../../helpers/entity';
=======
import DeleteCollectionModal from './parts/delete-collection-modal';
>>>>>>>
import DeleteCollectionModal from './parts/delete-collection-modal';
import DeleteOrRemoveCollaborationModal from './parts/delete-or-remove-collaboration-modal';
import {ENTITY_TYPE_ICONS} from '../../helpers/entity';
<<<<<<<
showCheckboxes: this.props.isCollaborator || this.props.isOwner
=======
showCheckboxes: this.props.isOwner || this.props.isCollaborator
>>>>>>>
showCheckboxes: this.props.isOwner || this.props.isCollaborator
<<<<<<<
delete={this.props.isOwner}
show={this.state.showModal}
onCloseModal={this.handleCloseModal}
=======
show={this.state.showDeleteModal}
onCloseModal={this.handleCloseDeleteModal}
/>
<AddEntityToCollectionModal
closeModalAndShowMessage={this.closeAddEntityModalShowMessageAndRefreshTable}
collectionId={this.props.collection.id}
collectionType={this.props.collection.entityType}
show={this.state.showAddEntityModal}
onCloseModal={this.handleCloseAddEntityModal}
>>>>>>>
delete={this.props.isOwner}
show={this.state.showDeleteModal}
onCloseModal={this.handleCloseDeleteModal}
/>
<AddEntityToCollectionModal
closeModalAndShowMessage={this.closeAddEntityModalShowMessageAndRefreshTable}
collectionId={this.props.collection.id}
collectionType={this.props.collection.entityType}
show={this.state.showAddEntityModal}
onCloseModal={this.handleCloseAddEntityModal}
<<<<<<<
(this.props.isOwner || this.props.isCollaborator) && this.props.entities.length ?
=======
this.props.isCollaborator || this.props.isOwner ?
<Button
bsSize="small"
bsStyle="success"
title={`Add ${this.props.collection.entityType}`}
onClick={this.handleShowAddEntityModal}
>
<FontAwesomeIcon icon="plus"/>
Add {_.lowerCase(this.props.collection.entityType)}
</Button> : null
}
{
(this.props.isCollaborator || this.props.isOwner) && this.props.entities.length ?
>>>>>>>
this.props.isCollaborator || this.props.isOwner ?
<Button
bsSize="small"
bsStyle="success"
title={`Add ${this.props.collection.entityType}`}
onClick={this.handleShowAddEntityModal}
>
<FontAwesomeIcon icon="plus"/>
Add {_.lowerCase(this.props.collection.entityType)}
</Button> : null
}
{
(this.props.isCollaborator || this.props.isOwner) && this.props.entities.length ?
<<<<<<<
showCheckboxes: PropTypes.bool,
size: PropTypes.number,
userId: PropTypes.number.isRequired
=======
size: PropTypes.number
>>>>>>>
size: PropTypes.number,
userId: PropTypes.number.isRequired |
<<<<<<<
this.state = {
ended: this.props.publisher ?
this.props.publisher.ended :
false
};
=======
// React does not autobind non-React class methods
this.handleEnded = this.handleEnded.bind(this);
}
>>>>>>>
// React does not autobind non-React class methods
this.handleEnded = this.handleEnded.bind(this);
}
<<<<<<<
getValue() {
return {
beginDate: this.begin.getValue(),
endDate: this.ended.getChecked() ?
this.end.getValue() :
'',
ended: this.ended.getChecked(),
publisherType: this.publisherType.getValue(),
disambiguation: this.disambiguation.getValue(),
annotation: this.annotation.getValue(),
identifiers: this.identifiers.getValue()
};
}
=======
valid() {
return this.begin.valid() &&
(!this.ended.getValue() || this.end.valid()) &&
this.identifiers.valid();
}
>>>>>>>
valid() {
return this.begin.valid() &&
(!this.ended.getValue() || this.end.valid()) &&
this.identifiers.valid();
}
<<<<<<<
render() {
let initialBeginDate = null;
let initialEndDate = null;
let initialPublisherType = null;
let initialDisambiguation = null;
let initialAnnotation = null;
let initialIdentifiers = [];
const prefillData = this.props.publisher;
if (prefillData) {
initialBeginDate = prefillData.beginDate;
initialEndDate = prefillData.endDate;
initialPublisherType = prefillData.publisherType ?
prefillData.publisherType.id :
null;
initialDisambiguation = prefillData.disambiguation ?
prefillData.disambiguation.comment :
null;
initialAnnotation = prefillData.annotation ?
prefillData.annotation.content :
null;
initialIdentifiers = prefillData.identifierSet &&
prefillData.identifierSet.identifiers.map((identifier) => ({
id: identifier.id,
value: identifier.value,
typeId: identifier.type.id
}));
}
const select2Options = {
allowClear: true,
width: '100%'
};
const publisherDataVisibleClass = this.props.visible ?
'' :
'hidden';
const endDataHiddenClass = this.state.ended ?
'' :
'hidden';
return (
<div className={publisherDataVisibleClass}>
<h2>Add Data</h2>
<p className="lead">
Fill out any data you know about the entity.
</p>
<div className="form-horizontal">
<PartialDate
defaultValue={initialBeginDate}
label="Begin Date"
labelClassName="col-md-4"
placeholder="YYYY-MM-DD"
ref={(ref) => this.begin = ref}
wrapperClassName="col-md-4"
/>
<PartialDate
defaultValue={initialEndDate}
groupClassName={endDataHiddenClass}
label="End Date"
labelClassName="col-md-4"
placeholder="YYYY-MM-DD"
ref={(ref) => this.end = ref}
wrapperClassName="col-md-4"
/>
<Input
defaultChecked={this.state.ended}
label="Ended"
ref={(ref) => this.ended = ref}
type="checkbox"
wrapperClassName="col-md-offset-4 col-md-4"
onChange={this.handleEnded}
/>
<Select
noDefault
defaultValue={initialPublisherType}
idAttribute="id"
label="Type"
labelAttribute="label"
labelClassName="col-md-4"
options={this.props.publisherTypes}
placeholder="Select publisher type…"
ref={(ref) => this.publisherType = ref}
select2Options={select2Options}
wrapperClassName="col-md-4"
/>
<hr/>
<Identifiers
identifiers={initialIdentifiers}
ref={(ref) => this.identifiers = ref}
types={this.props.identifierTypes}
/>
<Input
defaultValue={initialDisambiguation}
label="Disambiguation"
labelClassName="col-md-3"
ref={(ref) => this.disambiguation = ref}
type="text"
wrapperClassName="col-md-6"
/>
<Input
defaultValue={initialAnnotation}
label="Annotation"
labelClassName="col-md-3"
ref={(ref) => this.annotation = ref}
rows="6"
type="textarea"
wrapperClassName="col-md-6"
/>
<nav className="margin-top-1">
<ul className="pager">
<li className="previous">
<a
href="#"
onClick={this.props.onBackClick}
>
<Icon
aria-hidden="true"
name="angle-double-left"
/>
Back
</a>
</li>
<li className="next">
<a
href="#"
onClick={this.props.onNextClick}
>
Next
<Icon
aria-hidden="true"
name="angle-double-right"
/>
</a>
</li>
</ul>
</nav>
</div>
=======
const select2Options = {
allowClear: true,
width: '100%'
};
return (
<div className={this.props.visible === false ? 'hidden' : ''}>
<h2>Add Data</h2>
<p className="lead">
Fill out any data you know about the entity.
</p>
<div className="form-horizontal">
<PartialDate
defaultValue={initialBeginDate}
label="Begin Date"
labelClassName="col-md-4"
placeholder="YYYY-MM-DD"
ref={(ref) => this.begin = ref}
wrapperClassName="col-md-4"
/>
<PartialDate
defaultValue={initialEndDate}
groupClassName={this.state.ended ? '' : 'hidden'}
label="End Date"
labelClassName="col-md-4"
placeholder="YYYY-MM-DD"
ref={(ref) => this.end = ref}
wrapperClassName="col-md-4"
/>
<Input
defaultChecked={this.state.ended}
label="Ended"
ref={(ref) => this.ended = ref}
type="checkbox"
wrapperClassName="col-md-offset-4 col-md-4"
onChange={this.handleEnded}
/>
<Select
noDefault
defaultValue={initialPublisherType}
idAttribute="id"
label="Type"
labelAttribute="label"
labelClassName="col-md-4"
options={this.props.publisherTypes}
placeholder="Select publisher type…"
ref={(ref) => this.publisherType = ref}
select2Options={select2Options}
wrapperClassName="col-md-4"
/>
<hr/>
<Identifiers
identifiers={initialIdentifiers}
ref={(ref) => this.identifiers = ref}
types={this.props.identifierTypes}
/>
<Input
defaultValue={initialDisambiguation}
label="Disambiguation"
labelClassName="col-md-3"
ref={(ref) => this.disambiguation = ref}
type="text"
wrapperClassName="col-md-6"
/>
<Input
defaultValue={initialAnnotation}
label="Annotation"
labelClassName="col-md-3"
ref={(ref) => this.annotation = ref}
rows="6"
type="textarea"
wrapperClassName="col-md-6"
/>
<nav className="margin-top-1">
<ul className="pager">
<li className="previous">
<a
href="#"
onClick={this.props.onBackClick}
>
<Icon
aria-hidden="true"
name="angle-double-left"
/>
Back
</a>
</li>
<li className="next">
<a
href="#"
onClick={this.props.onNextClick}
>
Next
<Icon
aria-hidden="true"
name="angle-double-right"
/>
</a>
</li>
</ul>
</nav>
>>>>>>>
const select2Options = {
allowClear: true,
width: '100%'
};
const publisherDataVisibleClass = this.props.visible ?
'' :
'hidden';
const endDataHiddenClass = this.state.ended ?
'' :
'hidden';
return (
<div className={publisherDataVisibleClass}>
<h2>Add Data</h2>
<p className="lead">
Fill out any data you know about the entity.
</p>
<div className="form-horizontal">
<PartialDate
defaultValue={initialBeginDate}
label="Begin Date"
labelClassName="col-md-4"
placeholder="YYYY-MM-DD"
ref={(ref) => this.begin = ref}
wrapperClassName="col-md-4"
/>
<PartialDate
defaultValue={initialEndDate}
groupClassName={endDataHiddenClass}
label="End Date"
labelClassName="col-md-4"
placeholder="YYYY-MM-DD"
ref={(ref) => this.end = ref}
wrapperClassName="col-md-4"
/>
<Input
defaultChecked={this.state.ended}
label="Ended"
ref={(ref) => this.ended = ref}
type="checkbox"
wrapperClassName="col-md-offset-4 col-md-4"
onChange={this.handleEnded}
/>
<Select
noDefault
defaultValue={initialPublisherType}
idAttribute="id"
label="Type"
labelAttribute="label"
labelClassName="col-md-4"
options={this.props.publisherTypes}
placeholder="Select publisher type…"
ref={(ref) => this.publisherType = ref}
select2Options={select2Options}
wrapperClassName="col-md-4"
/>
<hr/>
<Identifiers
identifiers={initialIdentifiers}
ref={(ref) => this.identifiers = ref}
types={this.props.identifierTypes}
/>
<Input
defaultValue={initialDisambiguation}
label="Disambiguation"
labelClassName="col-md-3"
ref={(ref) => this.disambiguation = ref}
type="text"
wrapperClassName="col-md-6"
/>
<Input
defaultValue={initialAnnotation}
label="Annotation"
labelClassName="col-md-3"
ref={(ref) => this.annotation = ref}
rows="6"
type="textarea"
wrapperClassName="col-md-6"
/>
<nav className="margin-top-1">
<ul className="pager">
<li className="previous">
<a
href="#"
onClick={this.props.onBackClick}
>
<Icon
aria-hidden="true"
name="angle-double-left"
/>
Back
</a>
</li>
<li className="next">
<a
href="#"
onClick={this.props.onNextClick}
>
Next
<Icon
aria-hidden="true"
name="angle-double-right"
/>
</a>
</li>
</ul>
</nav>
<<<<<<<
/* eslint camelcase: 0 */
PublisherData.displayName = 'PublisherData';
PublisherData.propTypes = {
identifierTypes: React.PropTypes.arrayOf(validators.labeledProperty),
publisher: React.PropTypes.shape({
annotation: React.PropTypes.shape({
content: React.PropTypes.string
}),
begin_date: React.PropTypes.string,
disambiguation: React.PropTypes.shape({
comment: React.PropTypes.string
}),
end_date: React.PropTypes.string,
ended: React.PropTypes.bool,
identifiers: React.PropTypes.arrayOf(React.PropTypes.shape({
id: React.PropTypes.number,
value: React.PropTypes.string,
typeId: React.PropTypes.number
})),
publisherType: validators.labeledProperty
=======
}
PublisherData.displayName = 'PublisherData';
PublisherData.propTypes = {
identifierTypes: React.PropTypes.arrayOf(validators.labeledProperty),
publisher: React.PropTypes.shape({
annotation: React.PropTypes.shape({
content: React.PropTypes.string
}),
begin_date: React.PropTypes.string,
disambiguation: React.PropTypes.shape({
comment: React.PropTypes.string
>>>>>>>
}
/* eslint camelcase: 0 */
PublisherData.displayName = 'PublisherData';
PublisherData.propTypes = {
identifierTypes: React.PropTypes.arrayOf(validators.labeledProperty),
publisher: React.PropTypes.shape({
annotation: React.PropTypes.shape({
content: React.PropTypes.string
}),
begin_date: React.PropTypes.string,
disambiguation: React.PropTypes.shape({
comment: React.PropTypes.string |
<<<<<<<
checkIfNameExists, debouncedUpdateDisambiguationField,
debouncedUpdateNameField, debouncedUpdateSortNameField, searchName,
updateLanguageField
=======
debouncedUpdateDisambiguationField,
debouncedUpdateNameField,
debouncedUpdateSortNameField,
updateLanguageField
>>>>>>>
checkIfNameExists, debouncedUpdateDisambiguationField,
debouncedUpdateNameField, debouncedUpdateSortNameField, searchName,
updateLanguageField
<<<<<<<
validateNameSectionDisambiguation, validateNameSectionLanguage,
validateNameSectionName, validateNameSectionSortName
=======
validateNameSectionLanguage,
validateNameSectionName,
validateNameSectionSortName
>>>>>>>
validateNameSectionDisambiguation, validateNameSectionLanguage,
validateNameSectionName, validateNameSectionSortName
<<<<<<<
warn={(isRequiredDisambiguationEmpty(
warnIfExists,
disambiguationDefaultValue
))}
onChange={handleNameChange}
=======
tooltipText={`Official name of the ${_.capitalize(entityType)} in its original language. Names in other languages should be added as 'aliases'.`}
onChange={onNameChange}
>>>>>>>
tooltipText={`Official name of the ${_.capitalize(entityType)} in its original language. Names in other languages should be added as 'aliases'.`}
warn={(isRequiredDisambiguationEmpty(
warnIfExists,
disambiguationDefaultValue
))}
onChange={handleNameChange} |
<<<<<<<
const express = require('express');
const router = express.Router();
const Revision = require('../data/properties/revision');
const User = require('../data/user');
const _ = require('underscore');
function formatPairAttributeSingle(pair, attribute) {
if (attribute) {
return [
pair[0] ? [pair[0][attribute]] : null,
pair[1] ? [pair[1][attribute]] : null
];
}
return [
pair[0] ? [pair[0]] : null,
pair[1] ? [pair[1]] : null
];
}
=======
var express = require('express');
var router = express.Router();
var Revision = require('../data/properties/revision');
var _ = require('underscore');
>>>>>>>
const express = require('express');
const router = express.Router();
const _ = require('underscore');
const Revision = require('../data/properties/revision');
function formatPairAttributeSingle(pair, attribute) {
if (attribute) {
return [
pair[0] ? [pair[0][attribute]] : null,
pair[1] ? [pair[1][attribute]] : null
];
}
return [
pair[0] ? [pair[0]] : null,
pair[1] ? [pair[1]] : null
];
}
<<<<<<<
User.findOne(revision.user.user_id).then((user) => {
revision.user = user;
res.render('revision', {
title: 'Revision',
revision,
diff
=======
new Editor({ id: revision.user.user_id })
.fetch({ require: true })
.then(function(editor) {
revision.user = editor.toJSON();
res.render('revision', {
title: 'Revision',
revision: revision,
diff: diff
});
>>>>>>>
new Editor({ id: revision.user.user_id })
.fetch({ require: true })
.then((editor) => {
revision.user = editor.toJSON();
res.render('revision', {
title: 'Revision',
revision: revision,
diff: diff
}); |
<<<<<<<
const express = require('express');
const router = express.Router();
const User = require('../data/user');
const UserType = require('../data/properties/user-type');
=======
var express = require('express');
var router = express.Router();
var Editor = require('bookbrainz-data').Editor;
var EditorType = require('bookbrainz-data').EditorType;
>>>>>>>
const express = require('express');
const router = express.Router();
const Editor = require('bookbrainz-data').Editor;
const EditorType = require('bookbrainz-data').EditorType;
<<<<<<<
// This function should post a new user to the /user endpoint of the ws.
UserType.find()
.then((results) => {
let editorType = null;
const hasEditorType = !results.every((userType) => {
if (userType.label === 'Editor') {
editorType = userType;
return false;
}
return true;
});
if (!hasEditorType) {
throw new Error('Editor user type not found');
}
return User.create({
=======
EditorType.forge({ label: 'Editor' })
.fetch({ require: true })
.then(function createEditor(editorType) {
return Editor.forge({
>>>>>>>
EditorType.forge({ label: 'Editor' })
.fetch({ require: true })
.then((editorType) => {
return Editor.forge({
<<<<<<<
.then(() => {
=======
.then(function success() {
>>>>>>>
.then(() => {
<<<<<<<
.catch(next);
=======
.catch(function ifError(err) {
next(err);
});
>>>>>>>
.catch(next); |
<<<<<<<
const passport = require('passport');
=======
const status = require('http-status');
const auth = require('../helpers/auth');
>>>>>>>
const passport = require('passport');
const status = require('http-status');
<<<<<<<
res.redirect(303, redirect);
},
(err, req, res) => {
// If an error occurs during login, send the user back.
res.redirect(301, `/login?error=${err.message}`);
}
);
=======
res.redirect(status.SEE_OTHER, redirect);
}, (err, req, res) => {
// If an error occurs during login, send the user back.
res.redirect(status.MOVED_PERMANENTLY, `/login?error=${err.message}`);
});
>>>>>>>
res.redirect(status.SEE_OTHER, redirect);
},
(err, req, res) => {
// If an error occurs during login, send the user back.
res.redirect(status.MOVED_PERMANENTLY, `/login?error=${err.message}`);
}
); |
<<<<<<<
const express = require('express');
const router = express.Router();
const config = require('../helpers/config');
const auth = require('../helpers/auth');
const bbws = require('../helpers/bbws');
=======
var express = require('express');
var router = express.Router();
var Message = require('bookbrainz-data').Message;
var MessageReceipt = require('bookbrainz-data').MessageReceipt;
var config = require('../helpers/config');
var auth = require('../helpers/auth');
var Promise = require('bluebird');
var _ = require('underscore');
>>>>>>>
const express = require('express');
const router = express.Router();
const config = require('../helpers/config');
const auth = require('../helpers/auth');
const Promise = require('bluebird');
const _ = require('underscore');
const Message = require('bookbrainz-data').Message;
const MessageReceipt = require('bookbrainz-data').MessageReceipt;
<<<<<<<
function renderMessageList(view, req, res) {
bbws.get(`/message/${view}/`, {
accessToken: req.session.bearerToken
})
.then((messages) => {
res.render('editor/messageList', {view, messages});
});
=======
function renderMessageList(view, collectionJSON, res) {
res.render('editor/messageList', {
view: view,
messages: {
objects: collectionJSON
}
});
>>>>>>>
function renderMessageList(view, collectionJSON, res) {
res.render('editor/messageList', {
view: view,
messages: {
objects: collectionJSON
}
});
<<<<<<<
router.post('/send/handler', auth.isAuthenticated, (req, res) => {
// This function should post a new message to the /message/send endpoint
// of the ws.
const ws = config.site.webservice;
=======
router.post('/send/handler', auth.isAuthenticated, function(req, res) {
>>>>>>>
router.post('/send/handler', auth.isAuthenticated, (req, res) => {
<<<<<<<
const recipientIds = req.body.recipients.split(',').map((recipientId) => {
return parseInt(recipientId, 10);
=======
var recipientIds = req.body.recipients.split(',').map(parseInt);
// Create new message
var messageStored = new Message({
senderId: req.user.id, subject: req.body.subject, content: req.body.content
}).save()
.then(function addRecipients(message) {
return Promise.all(
recipientIds.map(function addRecipient(recipientId) {
return new MessageReceipt({
recipientId: recipientId, messageId: message.get('id')
}).save();
})
);
>>>>>>>
var recipientIds = req.body.recipients.split(',').map(parseInt);
// Create new message
var messageStored = new Message({
senderId: req.user.id, subject: req.body.subject, content: req.body.content
}).save()
.then((message) => {
return Promise.all(
recipientIds.map((recipientId) => {
return new MessageReceipt({
recipientId: recipientId, messageId: message.get('id')
}).save();
})
);
<<<<<<<
request.post(`${ws}/message/sent/`)
.set('Authorization', `Bearer ${req.session.bearerToken}`)
.send({
recipient_ids: recipientIds,
subject: req.body.subject,
content: req.body.content
}).promise()
.then(() => {
res.redirect(303, '/message/sent');
});
=======
messageStored.then(function redirect() {
res.redirect(303, '/message/sent');
});
>>>>>>>
messageStored.then(() => {
res.redirect(303, '/message/sent');
}); |
<<<<<<<
this.setState({waiting: true});
request.post('/editor/edit/handler')
.send(data)
.promise()
.then(() => {
window.location.href = `/editor/${this.props.editor.id}`;
});
}
render() {
const loadingElement = this.state.waiting ?
<LoadingSpinner/> :
null;
const titles = this.props.titles.map((unlock) => {
const title = unlock.title;
title.unlockId = unlock.id;
return title;
=======
request.post('/editor/edit/handler')
.send(data).promise()
.then(() => {
window.location.href = `/editor/${this.props.editor.id}`;
>>>>>>>
request.post('/editor/edit/handler')
.send(data)
.promise()
.then(() => {
window.location.href = `/editor/${this.props.editor.id}`; |
<<<<<<<
<div className="container">
<div id="pageWithPagination">
<RevisionsTable results={this.state.results}/>
<PagerElement
from={this.props.from}
paginationUrl={this.paginationUrl}
results={this.state.results}
searchResultsCallback={this.searchResultsCallback}
size={this.props.size}
/>
</div>
=======
<div id="RevisionsPage">
<RevisionsTable results={this.state.results}/>
{
this.state.results && this.state.results.length ?
<div>
<hr className="thin"/>
<Pager>
<Pager.Item
previous disabled={this.state.from <= 0}
href="#" onClick={this.handleClickPrevious}
>
← Previous Page
</Pager.Item>
<ButtonGroup>
<Button disabled>Results {this.state.from + 1} —
{this.state.results.length < this.state.size ?
this.state.from + this.state.results.length :
this.state.from + this.state.size
}
</Button>
<DropdownButton
dropup bsStyle="info" id="bg-nested-dropdown"
title={`${this.state.size} per page`}
onSelect={this.handleResultsPerPageChange}
>
<MenuItem eventKey="10">10 per page</MenuItem>
<MenuItem eventKey="20">20 per page</MenuItem>
<MenuItem eventKey="35">35 per page</MenuItem>
<MenuItem eventKey="50">50 per page</MenuItem>
<MenuItem eventKey="100">100 per page</MenuItem>
</DropdownButton>
</ButtonGroup>
<Pager.Item
next disabled={!this.state.nextEnabled}
href="#" onClick={this.handleClickNext}
>
Next Page →
</Pager.Item>
</Pager>
</div> :
null
}
>>>>>>>
<div id="pageWithPagination">
<RevisionsTable results={this.state.results}/>
<PagerElement
from={this.props.from}
paginationUrl={this.paginationUrl}
results={this.state.results}
searchResultsCallback={this.searchResultsCallback}
size={this.props.size}
/> |
<<<<<<<
=======
const User = require('../data/user');
const UserType = require('../data/properties/user-type');
const React = require('react');
const ReactDOMServer = require('react-dom/server');
const RegisterPage = React.createFactory(
require('../../client/components/pages/register.jsx')
);
>>>>>>>
const React = require('react');
const ReactDOMServer = require('react-dom/server');
const RegisterPage = React.createFactory(
require('../../client/components/pages/register.jsx')
); |
<<<<<<<
render() {
const guessSortNameButton = (
<Button
bsStyle="link"
title="Guess Sort Name"
onClick={this.handleGuessSortNameClick}
>
<Icon name="magic"/>
</Button>
);
const select2Options = {
allowClear: true
};
const removeHiddenClass = this.props.removeHidden ?
'hidden' :
'';
return (
<div
className="row"
onChange={this.props.onChange}
>
=======
handleSortNameChange(event) {
this.setState({sortName: event.target.value});
}
render() {
const guessSortNameButton = (
<Button
bsStyle="link"
title="Guess Sort Name"
onClick={this.handleGuessSortNameClick}
>
<Icon name="magic"/>
</Button>
);
const select2Options = {
allowClear: true
};
return (
<div
className="row"
onChange={this.props.onChange}
>
<Input
defaultValue={this.props.aliasId}
ref={(ref) => this.id = ref}
type="hidden"
/>
<div className="col-md-3">
<Input
bsStyle={this.validationState()}
defaultValue={this.props.name}
ref={(ref) => this.name = ref}
type="text"
wrapperClassName="col-md-11"
/>
</div>
<div className="col-md-3">
>>>>>>>
handleSortNameChange(event) {
this.setState({sortName: event.target.value});
}
render() {
const guessSortNameButton = (
<Button
bsStyle="link"
title="Guess Sort Name"
onClick={this.handleGuessSortNameClick}
>
<Icon name="magic"/>
</Button>
);
const select2Options = {
allowClear: true
};
const removeHiddenClass = this.props.removeHidden ?
'hidden' :
'';
return (
<div
className="row"
onChange={this.props.onChange}
>
<Input
defaultValue={this.props.aliasId}
ref={(ref) => this.id = ref}
type="hidden"
/>
<div className="col-md-3">
<Input
bsStyle={this.validationState()}
defaultValue={this.props.name}
ref={(ref) => this.name = ref}
type="text"
wrapperClassName="col-md-11"
/>
</div>
<div className="col-md-3">
<<<<<<<
<div className="col-md-3">
<Input
bsStyle={this.validationState()}
defaultValue={this.props.name}
ref={(ref) => this.name = ref}
type="text"
wrapperClassName="col-md-11"
/>
</div>
<div className="col-md-3">
<Input
bsStyle={this.validationState()}
buttonAfter={guessSortNameButton}
ref={(ref) => this.sortName = ref}
type="text"
value={this.state.sortName}
wrapperClassName="col-md-11"
onChange={this.handleSortNameChange}
/>
</div>
<div className="col-md-3">
<Select
noDefault
bsStyle={this.validationState()}
defaultValue={this.props.languageId}
idAttribute="id"
labelAttribute="name"
options={this.props.languages}
placeholder="Select alias language…"
ref={(ref) => this.languageId = ref}
select2Options={select2Options}
wrapperClassName="col-md-11"
onChange={this.props.onChange}
/>
</div>
<div className="col-md-1">
<Input
defaultChecked={this.props.primary}
label=" "
ref={(ref) => this.primary = ref}
type="checkbox"
wrapperClassName="col-md-11"
/>
</div>
<div className="col-md-1">
<Input
defaultChecked={this.props.default}
label=" "
name="default"
ref={(ref) => this.default = ref}
type="radio"
wrapperClassName="col-md-11"
/>
</div>
<div className="col-md-1 text-right">
<Button
bsStyle="danger"
className={removeHiddenClass}
onClick={this.props.onRemove}
>
<Icon name="times"/>
</Button>
</div>
=======
>>>>>>> |
<<<<<<<
faCircleNotch, faCodeBranch, faComment, faEnvelope, faExclamationTriangle,
faExternalLinkAlt, faGlobe, faGripVertical, faHistory, faInfo, faListUl, faPenNib, faPencilAlt, faPencilRuler,
faPlus, faQuestionCircle, faRemoveFormat, faSave, faSearch, faSignInAlt,
=======
faCircleNotch, faCodeBranch, faCommentDots, faComments, faEnvelope, faExclamationTriangle,
faExternalLinkAlt, faGlobe, faHistory, faInfo, faListUl, faPenNib, faPencilAlt, faPencilRuler,
faPlus, faQuestionCircle, faRemoveFormat, faSearch, faSignInAlt,
>>>>>>>
faCircleNotch, faCodeBranch, faComment, faCommentDots, faComments, faEnvelope, faExclamationTriangle,
faExternalLinkAlt, faGlobe, faGripVertical, faHistory, faInfo, faListUl, faPenNib, faPencilAlt, faPencilRuler,
faPlus, faQuestionCircle, faRemoveFormat, faSave, faSearch, faSignInAlt,
<<<<<<<
faCircleNotch, faCodeBranch, faComment, faEnvelope, faExclamationTriangle,
faExternalLinkAlt, faGlobe, faGripVertical, faHistory, faInfo, faListUl, faPenNib, faPencilAlt, faPencilRuler,
faPlus, faQuestionCircle, faRemoveFormat, faSave, faSearch, faSignInAlt,
=======
faCircleNotch, faCodeBranch, faCommentDots, faComments, faEnvelope, faExclamationTriangle,
faExternalLinkAlt, faGlobe, faHistory, faInfo, faListUl, faPenNib, faPencilAlt, faPencilRuler,
faPlus, faQuestionCircle, faRemoveFormat, faSearch, faSignInAlt,
>>>>>>>
faCircleNotch, faCodeBranch, faComment, faCommentDots, faComments, faEnvelope, faExclamationTriangle,
faExternalLinkAlt, faGlobe, faGripVertical, faHistory, faInfo, faListUl, faPenNib, faPencilAlt, faPencilRuler,
faPlus, faQuestionCircle, faRemoveFormat, faSave, faSearch, faSignInAlt,
faCircleNotch, faCodeBranch, faCommentDots, faComments, faEnvelope, faExclamationTriangle,
faExternalLinkAlt, faGlobe, faHistory, faInfo, faListUl, faPenNib, faPencilAlt, faPencilRuler,
faPlus, faQuestionCircle, faRemoveFormat, faSearch, faSignInAlt, |
<<<<<<<
=======
import Badge from './../shared/Badge';
>>>>>>>
import Badge from './../shared/Badge';
<<<<<<<
<NavigationButton href={`/builds`}>My Builds <Badge><BuildsCount viewer={this.props.viewer} /></Badge></NavigationButton>
<NavigationButton href={`/docs`}>Documentation</NavigationButton>
<NavigationButton href="mailto:[email protected]">Support</NavigationButton>
=======
<NavigationButton className="md-flex" href={`/docs`}>Documentation</NavigationButton>
<NavigationButton className="md-flex" href="mailto:[email protected]">Support</NavigationButton>
>>>>>>>
<NavigationButton href={`/builds`}>My Builds <Badge><BuildsCount viewer={this.props.viewer} /></Badge></NavigationButton>
<NavigationButton className="md-flex" href={`/docs`}>Documentation</NavigationButton>
<NavigationButton className="md-flex" href="mailto:[email protected]">Support</NavigationButton> |
<<<<<<<
, fs = require('fs')
=======
, utils = require('utilities')
, errors = require('../response/errors')
>>>>>>>
, fs = require('fs')
, utils = require('utilities')
, errors = require('../response/errors') |
<<<<<<<
, inflection = require('../deps/inflection')
=======
, model = require('./model')
, utils = require('utilities')
, i18n = require('./i18n')
>>>>>>>
, inflection = require('../deps/inflection')
, model = require('./model')
, utils = require('utilities')
, i18n = require('./i18n')
<<<<<<<
, i18n = require('./i18n')
=======
, helpers = require('./template/helpers')
, actionHelpers = require('./template/helpers/action')
, FunctionRouter = require('./routers/function_router').FunctionRouter
, RegExpRouter = require('barista').Router
>>>>>>>
, helpers = require('./template/helpers')
, actionHelpers = require('./template/helpers/action')
, FunctionRouter = require('./routers/function_router').FunctionRouter
, RegExpRouter = require('barista').Router |
<<<<<<<
const inputButtonContent = <IconEdit />;
class NumPad extends Component {
constructor(props) {
super(props);
this.state = {
show: false,
value: (props.value || '').toString(),
};
this.toggleKeyPad = this.toggleKeyPad.bind(this);
this.confirm = this.confirm.bind(this);
}
static getDerivedStateFromProps(props, state) {
if (props.value && props.value !== state.value) {
return { value: (props.value || '').toString() };
}
return null;
}
toggleKeyPad(coords = {}) {
const { position } = this.props;
const { show } = this.state;
const inputCoords =
!show && updateCoords[position] ? updateCoords[position](coords) : undefined;
this.setState(prevState => ({ show: !prevState.show, inputCoords }));
}
confirm(value) {
const { onChange } = this.props;
const { show } = this.state;
if (show) {
onChange(value);
}
this.setState(prevState => Object.assign({}, { show: !prevState.show }));
}
render() {
const { show, value, inputCoords } = this.state;
const {
children,
placeholder,
label,
theme,
locale,
position,
sync,
customInput,
onChange
} = this.props;
const customTheme = typeof theme === 'object' ? theme : styles(theme);
customTheme.position = position;
customTheme.coords = inputCoords;
const display = position !== 'flex-start' && position !== 'flex-end' ? show : true;
const { transition, transitionProps } = getTransition(show, position);
return (
<Fragment>
<GlobalStyle />
<ThemeProvider theme={customTheme}>
<InputField
placeholder={placeholder}
showKeyPad={this.toggleKeyPad}
inputValue={value}
label={label}
disabled={show}
buttonContent={inputButtonContent}
customInput={customInput}
/>
</ThemeProvider>
<Portal>
{display &&
React.createElement(
transition,
transitionProps,
<ThemeProvider theme={customTheme}>
<Wrapper show>
{React.cloneElement(children, {
cancel: this.toggleKeyPad,
confirm: this.confirm,
onChange,
value,
label,
locale,
sync,
})}
</Wrapper>
</ThemeProvider>
)}
</Portal>
</Fragment>
);
}
}
=======
const NumPad = ({
children,
placeholder,
label,
theme,
locale,
markers,
position,
sync,
customInput,
buttonContent,
onChange,
value: valueFromProps,
}) => {
const [show, setShow] = useState(false);
const [value, setValue] = useState((valueFromProps || '').toString());
const [preValue, setPreValue] = useState();
const [inputCoords, setInputCoords] = useState();
if (valueFromProps !== preValue) {
setPreValue(valueFromProps);
setValue((valueFromProps || '').toString());
}
const toggleKeyPad = useCallback(
(coords = {}) => {
setInputCoords(!show && updateCoords[position] ? updateCoords[position](coords) : undefined);
setShow(!show);
},
[show, position]
);
const confirm = useCallback(
value => {
if (show) {
onChange(value);
setValue(value);
}
setShow(!show);
},
[show]
);
const customTheme = typeof theme === 'object' ? theme : styles(theme);
customTheme.position = position;
customTheme.coords = inputCoords;
const display = position !== 'flex-start' && position !== 'flex-end' ? show : true;
const { transition, transitionProps } = getTransition(show, position);
return (
<Fragment>
<GlobalStyle />
<ThemeProvider theme={customTheme}>
<InputField
placeholder={placeholder}
showKeyPad={toggleKeyPad}
inputValue={value}
label={label}
disabled={show}
buttonContent={buttonContent}
customInput={customInput}
/>
</ThemeProvider>
<Portal>
{display &&
React.createElement(
transition,
transitionProps,
<ThemeProvider theme={customTheme}>
<Wrapper show>
{React.cloneElement(children, {
cancel: toggleKeyPad,
confirm,
update: onChange,
eventTypes: ['click', 'touchend'],
value,
label,
locale,
markers,
sync,
})}
</Wrapper>
</ThemeProvider>
)}
</Portal>
</Fragment>
);
};
>>>>>>>
const NumPad = ({
children,
placeholder,
label,
theme,
locale,
markers,
position,
sync,
customInput,
buttonContent,
onChange,
value: valueFromProps,
}) => {
const [show, setShow] = useState(false);
const [value, setValue] = useState((valueFromProps || '').toString());
const [preValue, setPreValue] = useState();
const [inputCoords, setInputCoords] = useState();
if (valueFromProps !== preValue) {
setPreValue(valueFromProps);
setValue((valueFromProps || '').toString());
}
const toggleKeyPad = useCallback(
(coords = {}) => {
setInputCoords(!show && updateCoords[position] ? updateCoords[position](coords) : undefined);
setShow(!show);
},
[show, position]
);
const confirm = useCallback(
value => {
if (show) {
onChange(value);
setValue(value);
}
setShow(!show);
},
[show]
);
const customTheme = typeof theme === 'object' ? theme : styles(theme);
customTheme.position = position;
customTheme.coords = inputCoords;
const display = position !== 'flex-start' && position !== 'flex-end' ? show : true;
const { transition, transitionProps } = getTransition(show, position);
return (
<Fragment>
<GlobalStyle />
<ThemeProvider theme={customTheme}>
<InputField
placeholder={placeholder}
showKeyPad={toggleKeyPad}
inputValue={value}
label={label}
disabled={show}
buttonContent={buttonContent}
customInput={customInput}
/>
</ThemeProvider>
<Portal>
{display &&
React.createElement(
transition,
transitionProps,
<ThemeProvider theme={customTheme}>
<Wrapper show>
{React.cloneElement(children, {
cancel: toggleKeyPad,
confirm,
update: onChange,
value,
label,
locale,
markers,
sync,
})}
</Wrapper>
</ThemeProvider>
)}
</Portal>
</Fragment>
);
};
<<<<<<<
sync: false,
=======
sync: false,
markers: [],
buttonContent: <IconEdit />,
>>>>>>>
sync: false,
markers: [],
buttonContent: <IconEdit />, |
<<<<<<<
deferred.reject('No URL');
} else {
$http({
url: url,
method: 'GET',
timeout: 5000,
=======
deferred.reject('You must provide Kong node url.');
return deferred.promise;
}
try {
Request({
kong_url: url,
endpoint: '/',
method: 'GET'
>>>>>>>
deferred.reject('No URL');
return deferred.promise;
}
try {
Request({
kong_url: url,
endpoint: '/',
method: 'GET' |
<<<<<<<
{ text: _config.actionLabels.delay, onPress: () => {}, style: 'default' },
{ text: _config.actionLabels.decline, onPress: () => { RatingsData.recordDecline(); }, style: 'destructive' },
=======
{ text: _config.actionLabels.decline, onPress: () => { RatingsData.recordDecline(); callback(true, 'decline'); } },
{ text: _config.actionLabels.delay, onPress: () => { callback(true, 'delay'); } },
>>>>>>>
{ text: _config.actionLabels.decline, onPress: () => { RatingsData.recordDecline(); callback(true, 'decline'); } },
{ text: _config.actionLabels.delay, onPress: () => { callback(true, 'delay'); } },
<<<<<<<
Linking.openURL(storeUrl);
}, style: 'cancel' }
=======
callback(true, 'accept');
LinkingIOS.openURL('http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=' + _config.appStoreId + '&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8');
}, style: 'default' }
>>>>>>>
callback(true, 'accept');
Linking.openURL(storeUrl);
}, style: 'cancel' } |
<<<<<<<
return <AnswerRadioInput
id={"choice-" + i}
key={"choice-" + i}
name={this.state.id}
label={choice}
value={choice}
checked={this.state.value === choice}
onChanged={this.handleChanged} />
=======
return AnswerRadioInput({
key: 'choice-' + i,
name: this.state.id,
label: choice,
value: choice,
checked: this.state.value === choice,
onChanged: this.handleChanged
});
>>>>>>>
return <AnswerRadioInput
key={"choice-" + i}
name={this.state.id}
label={choice}
value={choice}
checked={this.state.value === choice}
onChanged={this.handleChanged} /> |
<<<<<<<
describe('--export-environment', function () {
var outDir = 'out',
environment = 'test/fixtures/run/simple-variables.json',
exportedEnvironmentPath = path.join(__dirname, '..', '..', outDir, 'test-environment.json');
=======
describe('newman.run exportEnvironment', function () {
var environment = 'test/fixtures/run/simple-variables.json',
exportedEnvironmentPath = path.join(__dirname, '..', '..', 'out', 'test-environment.json');
beforeEach(function (done) {
fs.stat('out', function (err) {
if (err) { return fs.mkdir('out', done); }
>>>>>>>
describe('newman.run exportEnvironment', function () {
var outDir = 'out',
environment = 'test/fixtures/run/simple-variables.json',
exportedEnvironmentPath = path.join(__dirname, '..', '..', outDir, 'test-environment.json');
<<<<<<<
it('`newman run` should export environment to a file in a pre-existing directory', function (done) {
newman.run({
collection: 'test/fixtures/run/single-get-request.json',
environment: environment,
exportEnvironment: outDir
}, function (err) {
if (err) { return done(err); }
var dir = fs.readdirSync(outDir),
file = dir[0],
environment;
expect(dir).to.have.length(1);
try { environment = JSON.parse(fs.readFileSync(outDir + '/' + file).toString()); }
catch (e) { console.error(e); }
expect(environment).be.ok();
expect(environment).have.property('_postman_exported_at');
expect(environment).have.property('values');
expect(environment.values).eql([
{ key: 'var-1', value: 'value-1', type: 'any' },
{ key: 'var-2', value: 'value-2', type: 'any' }
]);
expect(environment).have.property('_postman_variable_scope', 'environment');
done();
});
});
it('`newman run` should export env with a name if the input file doesn\'t have one', function (done) {
=======
it('should export environment with a name if the input file doesn\'t have one', function (done) {
>>>>>>>
it('`newman run` should export environment to a file in a pre-existing directory', function (done) {
newman.run({
collection: 'test/fixtures/run/single-get-request.json',
environment: environment,
exportEnvironment: outDir
}, function (err) {
if (err) { return done(err); }
var dir = fs.readdirSync(outDir),
file = dir[0],
environment;
expect(dir).to.have.length(1);
try { environment = JSON.parse(fs.readFileSync(outDir + '/' + file).toString()); }
catch (e) { console.error(e); }
expect(environment).to.be.ok;
expect(environment).have.property('_postman_exported_at');
expect(environment).have.property('values');
expect(environment.values).eql([
{ key: 'var-1', value: 'value-1', type: 'any' },
{ key: 'var-2', value: 'value-2', type: 'any' }
]);
expect(environment).have.property('_postman_variable_scope', 'environment');
done();
});
});
it('should export environment with a name if the input file doesn\'t have one', function (done) { |
<<<<<<<
'bin/newman -c tests/integ_tests/caseInsenHeader.json -s &&' +
'bin/newman -c tests/integ_tests/helper.postman_collection -n 3 -s'
=======
'bin/newman -c tests/integ_tests/steph.json -s -d tests/integ_tests/steph_data.csv -n 2 -s && ' +
'bin/newman -c tests/integ_tests/caseInsenHeader.json -s'
>>>>>>>
'bin/newman -c tests/integ_tests/helper.postman_collection -n 3 -s && ' +
'bin/newman -c tests/integ_tests/steph.json -s -d tests/integ_tests/steph_data.csv -n 2 -s && ' +
'bin/newman -c tests/integ_tests/caseInsenHeader.json -s' |
<<<<<<<
it('`newman run` should export globals to a file in a pre-existing directory', function (done) {
// eslint-disable-next-line max-len
exec('node ./bin/newman.js run test/fixtures/run/single-get-request.json -g test/fixtures/run/simple-variables.json --export-globals out', function (code) {
var globals,
dir = fs.readdirSync(outDir),
file = dir[0];
expect(dir).to.have.length(1);
try { globals = JSON.parse(fs.readFileSync(outDir + '/' + file).toString()); }
catch (e) { console.error(e); }
expect(code).be(0);
expect(globals).be.ok();
expect(globals).have.property('_postman_exported_at');
expect(globals).have.property('values');
expect(globals.values).eql([
{ key: 'var-1', value: 'value-1', type: 'any' },
{ key: 'var-2', value: 'value-2', type: 'any' }
]);
expect(globals).have.property('_postman_variable_scope', 'globals');
done();
});
});
=======
it('`newman run` should export globals with a name when provided under --global-var', function (done) {
// eslint-disable-next-line max-len
exec('node ./bin/newman.js run test/fixtures/run/single-request-failing.json --global-var foo=bar --export-globals out/test-globals.json', function (code) {
var globals;
try { globals = JSON.parse(fs.readFileSync(exportedGlobalsPath).toString()); }
catch (e) { console.error(e); }
expect(code).not.be(0);
expect(globals).be.ok();
expect(globals).have.property('_postman_exported_at');
expect(globals).have.property('values');
expect(globals).have.property('name', 'globals');
expect(globals.values).eql([
{ key: 'foo', value: 'bar', type: 'any' }
]);
expect(globals).have.property('_postman_variable_scope', 'globals');
done();
});
});
>>>>>>>
it('`newman run` should export globals to a file in a pre-existing directory', function (done) {
// eslint-disable-next-line max-len
exec('node ./bin/newman.js run test/fixtures/run/single-get-request.json -g test/fixtures/run/simple-variables.json --export-globals out', function (code) {
var globals,
dir = fs.readdirSync(outDir),
file = dir[0];
expect(dir).to.have.length(1);
try { globals = JSON.parse(fs.readFileSync(outDir + '/' + file).toString()); }
catch (e) { console.error(e); }
expect(code).be(0);
expect(globals).be.ok();
expect(globals).have.property('_postman_exported_at');
expect(globals).have.property('values');
expect(globals.values).eql([
{ key: 'var-1', value: 'value-1', type: 'any' },
{ key: 'var-2', value: 'value-2', type: 'any' }
]);
expect(globals).have.property('_postman_variable_scope', 'globals');
done();
});
});
it('`newman run` should export globals with a name when provided under --global-var', function (done) {
// eslint-disable-next-line max-len
exec('node ./bin/newman.js run test/fixtures/run/single-request-failing.json --global-var foo=bar --export-globals out/test-globals.json', function (code) {
var globals;
try { globals = JSON.parse(fs.readFileSync(exportedGlobalsPath).toString()); }
catch (e) { console.error(e); }
expect(code).not.be(0);
expect(globals).be.ok();
expect(globals).have.property('_postman_exported_at');
expect(globals).have.property('values');
expect(globals).have.property('name', 'globals');
expect(globals.values).eql([
{ key: 'foo', value: 'bar', type: 'any' }
]);
expect(globals).have.property('_postman_variable_scope', 'globals');
done();
});
}); |
<<<<<<<
util.cast.memoizeKeyVal, [])
.option('--color <value>', 'Enable/Disable colored output. (auto|on|off)', /^(auto|on|off)$/, 'auto')
=======
util.cast.memoize, [])
.option('--color <value>', 'Enable/Disable colored output. (auto|on|off)', util.cast.colorOptions, 'auto')
>>>>>>>
util.cast.memoizeKeyVal, [])
.option('--color <value>', 'Enable/Disable colored output. (auto|on|off)', util.cast.colorOptions, 'auto') |
<<<<<<<
it('`newman run` should export globals to a file in a pre-existing directory', function (done) {
newman.run({
collection: 'test/fixtures/run/single-get-request.json',
globals: globals,
exportGlobals: outDir
}, function (err) {
if (err) { return done(err); }
var dir = fs.readdirSync(outDir),
file = dir[0],
globals;
expect(dir).to.have.length(1);
try { globals = JSON.parse(fs.readFileSync(outDir + '/' + file).toString()); }
catch (e) { console.error(e); }
expect(globals).be.ok();
expect(globals).have.property('_postman_exported_at');
expect(globals).have.property('values');
expect(globals.values).eql([
{ key: 'var-1', value: 'value-1', type: 'any' },
{ key: 'var-2', value: 'value-2', type: 'any' }
]);
expect(globals).have.property('_postman_variable_scope', 'globals');
done();
});
});
=======
it('`newman run` should export globals with a name if the input file doesn\'t have one', function (done) {
newman.run({
collection: 'test/fixtures/run/single-request-failing.json',
globals: {
values: [{ key: 'var-1', value: 'value-1' }]
},
exportGlobals: exportedGlobalsPath
}, function (err) {
if (err) { return done(err); }
var globals;
try { globals = JSON.parse(fs.readFileSync(exportedGlobalsPath).toString()); }
catch (e) { console.error(e); }
expect(globals).be.ok();
expect(globals).have.property('_postman_exported_at');
expect(globals).have.property('values');
expect(globals).have.property('name', 'globals');
expect(globals.values).eql([
{ key: 'var-1', value: 'value-1', type: 'any' }
]);
expect(globals).have.property('_postman_variable_scope', 'globals');
done();
});
});
it('`newman run` should export globals with a name when no input file is provided', function (done) {
newman.run({
collection: {
item: [{
event: [{
listen: 'test',
script: 'pm.globals.set("var-1", "value-1");'
}],
request: 'https://postman-echo.com/get?source=newman-sample-github-collection'
}]
},
exportGlobals: exportedGlobalsPath
}, function (err) {
if (err) { return done(err); }
var globals;
try { globals = JSON.parse(fs.readFileSync(exportedGlobalsPath).toString()); }
catch (e) { console.error(e); }
expect(globals).be.ok();
expect(globals).have.property('_postman_exported_at');
expect(globals).have.property('values');
expect(globals).have.property('name', 'globals');
expect(globals.values).eql([
{ key: 'var-1', value: 'value-1', type: 'any' }
]);
expect(globals).have.property('_postman_variable_scope', 'globals');
done();
});
});
>>>>>>>
it('`newman run` should export globals to a file in a pre-existing directory', function (done) {
newman.run({
collection: 'test/fixtures/run/single-get-request.json',
globals: globals,
exportGlobals: outDir
}, function (err) {
if (err) { return done(err); }
var dir = fs.readdirSync(outDir),
file = dir[0],
globals;
expect(dir).to.have.length(1);
try { globals = JSON.parse(fs.readFileSync(outDir + '/' + file).toString()); }
catch (e) { console.error(e); }
expect(globals).be.ok();
expect(globals).have.property('_postman_exported_at');
expect(globals).have.property('values');
expect(globals.values).eql([
{ key: 'var-1', value: 'value-1', type: 'any' },
{ key: 'var-2', value: 'value-2', type: 'any' }
]);
expect(globals).have.property('_postman_variable_scope', 'globals');
done();
});
});
it('`newman run` should export globals with a name if the input file doesn\'t have one', function (done) {
newman.run({
collection: 'test/fixtures/run/single-request-failing.json',
globals: {
values: [{ key: 'var-1', value: 'value-1' }]
},
exportGlobals: exportedGlobalsPath
}, function (err) {
if (err) { return done(err); }
var globals;
try { globals = JSON.parse(fs.readFileSync(exportedGlobalsPath).toString()); }
catch (e) { console.error(e); }
expect(globals).be.ok();
expect(globals).have.property('_postman_exported_at');
expect(globals).have.property('values');
expect(globals).have.property('name', 'globals');
expect(globals.values).eql([
{ key: 'var-1', value: 'value-1', type: 'any' }
]);
expect(globals).have.property('_postman_variable_scope', 'globals');
done();
});
});
it('`newman run` should export globals with a name when no input file is provided', function (done) {
newman.run({
collection: {
item: [{
event: [{
listen: 'test',
script: 'pm.globals.set("var-1", "value-1");'
}],
request: 'https://postman-echo.com/get?source=newman-sample-github-collection'
}]
},
exportGlobals: exportedGlobalsPath
}, function (err) {
if (err) { return done(err); }
var globals;
try { globals = JSON.parse(fs.readFileSync(exportedGlobalsPath).toString()); }
catch (e) { console.error(e); }
expect(globals).be.ok();
expect(globals).have.property('_postman_exported_at');
expect(globals).have.property('values');
expect(globals.values).eql([
{ key: 'var-1', value: 'value-1', type: 'any' }
]);
expect(globals).have.property('_postman_variable_scope', 'globals');
done();
});
}); |
<<<<<<<
print.lf('%s %s', passed ? colors.green(` ${cliUtils.symbols.ok} `) :
colors.red.bold(pad(this.summary.failures.length, 3, SPC) + cliUtils.symbols.dot), passed ?
colors.gray(o.assertion) : colors.red.bold(o.assertion));
=======
print.lf('%s %s', passed ? colors.green(' ✔ ') :
colors.red.bold(pad(this.summary.run.failures.length, 3, SPC) + '⠄'), passed ?
colors.gray(o.assertion) : colors.red.bold(o.assertion));
>>>>>>>
print.lf('%s %s', passed ? colors.green(` ${cliUtils.symbols.ok} `) :
colors.red.bold(pad(this.summary.run.failures.length, 3, SPC) + cliUtils.symbols.dot), passed ?
colors.gray(o.assertion) : colors.red.bold(o.assertion)); |
<<<<<<<
it('should sanitize styles correctly', function() {
var sanitizeString = '<p dir="ltr"><strong>beste</strong><em>testestes</em><s>testestset</s><u>testestest</u></p><ul dir="ltr"> <li><u>test</u></li></ul><blockquote dir="ltr"> <ol> <li><u>test</u></li><li><u>test</u></li><li style="text-align: right;"><u>test</u></li><li style="text-align: justify;"><u>test</u></li></ol> <p><u><span style="color:#00FF00;">test</span></u></p><p><span style="color:#00FF00"><span style="font-size:36px;">TESTETESTESTES</span></span></p></blockquote>';
var expected = '<p dir="ltr"><strong>beste</strong><em>testestes</em><s>testestset</s><u>testestest</u></p><ul dir="ltr"> <li><u>test</u></li></ul><blockquote dir="ltr"> <ol> <li><u>test</u></li><li><u>test</u></li><li style="text-align: right;"><u>test</u></li><li style="text-align: justify;"><u>test</u></li></ol> <p><u><span style="color:#00FF00;">test</span></u></p><p><span style="color:#00FF00;"><span style="font-size:36px;">TESTETESTESTES</span></span></p></blockquote>';
assert.equal(
sanitizeHtml(sanitizeString, {
allowedTags: false,
allowedAttributes: {
'*': ["dir"],
p: ["dir", "style"],
li: ["style"],
span: ["style"]
},
allowedStyles: {
'*': {
'color': '*',
'text-align': ['left','right','center','justify','initial','inherit'],
'font-size': '*'
}
}
}).replace(/ /g,''), expected.replace(/ /g,'')
)
});
it('Should remove empty style tags', function() {
assert.equal(
sanitizeHtml("<span style=''></span>", {
allowedTags: false,
allowedAttributes: false
}),
"<span></span>"
);
});
it('Should remote invalid styles', function() {
assert.equal(
sanitizeHtml("<span style='color: blue; text-align: justify'></span>", {
allowedTags: false,
allowedAttributes: {
"span": ["style"]
},
allowedStyles: {
'span': {
"color": "blue",
"text-align": ['left']
}
}
}), '<span style="color:blue;"></span>'
);
});
it('Should allow a specific style from global', function() {
assert.equal(
sanitizeHtml("<span style='color: yellow;'></span>", {
allowedTags: false,
allowedAttributes: {
"span": ["style"]
},
allowedStyles: {
'*': {
"color": ["yellow"]
},
'span': {
"color": ["green"]
}
}
}), '<span style="color:yellow;"></span>'
);
})
=======
it('should allow protocol relative links by default', function() {
assert.equal(
sanitizeHtml('<a href="//cnn.com/example">test</a>'),
'<a href="//cnn.com/example">test</a>'
);
});
it('should not allow protocol relative links when allowProtocolRelative is false', function() {
assert.equal(
sanitizeHtml('<a href="//cnn.com/example">test</a>', { allowProtocolRelative: false }),
'<a>test</a>'
);
assert.equal(
sanitizeHtml('<a href="/\\cnn.com/example">test</a>', { allowProtocolRelative: false }),
'<a>test</a>'
);
assert.equal(
sanitizeHtml('<a href="\\\\cnn.com/example">test</a>', { allowProtocolRelative: false }),
'<a>test</a>'
);
assert.equal(
sanitizeHtml('<a href="\\/cnn.com/example">test</a>', { allowProtocolRelative: false }),
'<a>test</a>'
);
});
it('should still allow regular relative URLs when allowProtocolRelative is false', function() {
assert.equal(
sanitizeHtml('<a href="/welcome">test</a>', { allowProtocolRelative: false }),
'<a href="/welcome">test</a>'
);
});
it('should discard srcset by default', function() {
assert.equal(
sanitizeHtml('<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x" />', {
allowedTags: sanitizeHtml.defaults.allowedTags.concat([ 'img' ])
}),
'<img src="fallback.jpg" />'
);
});
it('should accept srcset if allowed', function() {
assert.equal(
sanitizeHtml('<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x" />', {
allowedTags: sanitizeHtml.defaults.allowedTags.concat([ 'img' ]),
allowedAttributes: { img: [ 'src', 'srcset' ] }
}),
'<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x" />'
);
});
it('should drop bogus srcset', function() {
assert.equal(
sanitizeHtml('<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x, javascript:alert(1) 100w 2x" />', {
allowedTags: sanitizeHtml.defaults.allowedTags.concat([ 'img' ]),
allowedAttributes: { img: [ 'src', 'srcset' ] }
}),
'<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x" />'
);
});
it('drop attribute names with meta-characters', function() {
assert.equal(
sanitizeHtml('<span data-<script>alert(1)//>', {
allowedTags: ['span'],
allowedAttributes: { 'span': ['data-*'] }
}),
'<span>alert(1)//></span>'
);
});
>>>>>>>
it('should allow protocol relative links by default', function() {
assert.equal(
sanitizeHtml('<a href="//cnn.com/example">test</a>'),
'<a href="//cnn.com/example">test</a>'
);
});
it('should not allow protocol relative links when allowProtocolRelative is false', function() {
assert.equal(
sanitizeHtml('<a href="//cnn.com/example">test</a>', { allowProtocolRelative: false }),
'<a>test</a>'
);
assert.equal(
sanitizeHtml('<a href="/\\cnn.com/example">test</a>', { allowProtocolRelative: false }),
'<a>test</a>'
);
assert.equal(
sanitizeHtml('<a href="\\\\cnn.com/example">test</a>', { allowProtocolRelative: false }),
'<a>test</a>'
);
assert.equal(
sanitizeHtml('<a href="\\/cnn.com/example">test</a>', { allowProtocolRelative: false }),
'<a>test</a>'
);
});
it('should still allow regular relative URLs when allowProtocolRelative is false', function() {
assert.equal(
sanitizeHtml('<a href="/welcome">test</a>', { allowProtocolRelative: false }),
'<a href="/welcome">test</a>'
);
});
it('should discard srcset by default', function() {
assert.equal(
sanitizeHtml('<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x" />', {
allowedTags: sanitizeHtml.defaults.allowedTags.concat([ 'img' ])
}),
'<img src="fallback.jpg" />'
);
});
it('should accept srcset if allowed', function() {
assert.equal(
sanitizeHtml('<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x" />', {
allowedTags: sanitizeHtml.defaults.allowedTags.concat([ 'img' ]),
allowedAttributes: { img: [ 'src', 'srcset' ] }
}),
'<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x" />'
);
});
it('should drop bogus srcset', function() {
assert.equal(
sanitizeHtml('<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x, javascript:alert(1) 100w 2x" />', {
allowedTags: sanitizeHtml.defaults.allowedTags.concat([ 'img' ]),
allowedAttributes: { img: [ 'src', 'srcset' ] }
}),
'<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x" />'
);
});
it('drop attribute names with meta-characters', function() {
assert.equal(
sanitizeHtml('<span data-<script>alert(1)//>', {
allowedTags: ['span'],
allowedAttributes: { 'span': ['data-*'] }
}),
'<span>alert(1)//></span>'
);
});
it('should sanitize styles correctly', function() {
var sanitizeString = '<p dir="ltr"><strong>beste</strong><em>testestes</em><s>testestset</s><u>testestest</u></p><ul dir="ltr"> <li><u>test</u></li></ul><blockquote dir="ltr"> <ol> <li><u>test</u></li><li><u>test</u></li><li style="text-align: right;"><u>test</u></li><li style="text-align: justify;"><u>test</u></li></ol> <p><u><span style="color:#00FF00;">test</span></u></p><p><span style="color:#00FF00"><span style="font-size:36px;">TESTETESTESTES</span></span></p></blockquote>';
var expected = '<p dir="ltr"><strong>beste</strong><em>testestes</em><s>testestset</s><u>testestest</u></p><ul dir="ltr"> <li><u>test</u></li></ul><blockquote dir="ltr"> <ol> <li><u>test</u></li><li><u>test</u></li><li style="text-align: right;"><u>test</u></li><li style="text-align: justify;"><u>test</u></li></ol> <p><u><span style="color:#00FF00;">test</span></u></p><p><span style="color:#00FF00;"><span style="font-size:36px;">TESTETESTESTES</span></span></p></blockquote>';
assert.equal(
sanitizeHtml(sanitizeString, {
allowedTags: false,
allowedAttributes: {
'*': ["dir"],
p: ["dir", "style"],
li: ["style"],
span: ["style"]
},
allowedStyles: {
'*': {
'color': '*',
'text-align': ['left','right','center','justify','initial','inherit'],
'font-size': '*'
}
}
}).replace(/ /g,''), expected.replace(/ /g,'')
)
});
it('Should remove empty style tags', function() {
assert.equal(
sanitizeHtml("<span style=''></span>", {
allowedTags: false,
allowedAttributes: false
}),
"<span></span>"
);
});
it('Should remote invalid styles', function() {
assert.equal(
sanitizeHtml("<span style='color: blue; text-align: justify'></span>", {
allowedTags: false,
allowedAttributes: {
"span": ["style"]
},
allowedStyles: {
'span': {
"color": "blue",
"text-align": ['left']
}
}
}), '<span style="color:blue;"></span>'
);
});
it('Should allow a specific style from global', function() {
assert.equal(
sanitizeHtml("<span style='color: yellow;'></span>", {
allowedTags: false,
allowedAttributes: {
"span": ["style"]
},
allowedStyles: {
'*': {
"color": ["yellow"]
},
'span': {
"color": ["green"]
}
}
}), '<span style="color:yellow;"></span>'
);
}); |
<<<<<<<
it('text from transformTags should not specify tags', function() {
var input = '<input value="<script>alert(1)</script>">';
var want = '<u class="inlined-input"><script>alert(1)</script></u>';
// Runs the sanitizer with a policy that turns an attribute into
// text. A policy like this might be used to turn inputs into
// inline elements that look like the original but which do not
// affect form submissions.
var got = sanitizeHtml(
input,
{
allowedTags: [ 'u' ],
allowedAttributes: { '*': ['class'] },
transformTags: {
input: function (tagName, attribs) {
return {
tagName: 'u',
attribs: { class: 'inlined-input' },
text: attribs.value
};
}
}
});
assert.equal(got, want);
});
=======
it('should discard srcset by default', function() {
assert.equal(
sanitizeHtml('<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x" />', {
allowedTags: sanitizeHtml.defaults.allowedTags.concat([ 'img' ])
}),
'<img src="fallback.jpg" />'
);
});
it('should accept srcset if allowed', function() {
assert.equal(
sanitizeHtml('<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x" />', {
allowedTags: sanitizeHtml.defaults.allowedTags.concat([ 'img' ]),
allowedAttributes: { img: [ 'src', 'srcset' ] }
}),
'<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x" />'
);
});
it('should drop bogus srcset', function() {
assert.equal(
sanitizeHtml('<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x, javascript:alert(1) 100w 2x" />', {
allowedTags: sanitizeHtml.defaults.allowedTags.concat([ 'img' ]),
allowedAttributes: { img: [ 'src', 'srcset' ] }
}),
'<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x" />'
);
});
>>>>>>>
it('should discard srcset by default', function() {
assert.equal(
sanitizeHtml('<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x" />', {
allowedTags: sanitizeHtml.defaults.allowedTags.concat([ 'img' ])
}),
'<img src="fallback.jpg" />'
);
});
it('should accept srcset if allowed', function() {
assert.equal(
sanitizeHtml('<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x" />', {
allowedTags: sanitizeHtml.defaults.allowedTags.concat([ 'img' ]),
allowedAttributes: { img: [ 'src', 'srcset' ] }
}),
'<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x" />'
);
});
it('should drop bogus srcset', function() {
assert.equal(
sanitizeHtml('<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x, javascript:alert(1) 100w 2x" />', {
allowedTags: sanitizeHtml.defaults.allowedTags.concat([ 'img' ]),
allowedAttributes: { img: [ 'src', 'srcset' ] }
}),
'<img src="fallback.jpg" srcset="foo.jpg 100w 2x, bar.jpg 200w 1x" />'
);
});
it('text from transformTags should not specify tags', function() {
var input = '<input value="<script>alert(1)</script>">';
var want = '<u class="inlined-input"><script>alert(1)</script></u>';
// Runs the sanitizer with a policy that turns an attribute into
// text. A policy like this might be used to turn inputs into
// inline elements that look like the original but which do not
// affect form submissions.
var got = sanitizeHtml(
input,
{
allowedTags: [ 'u' ],
allowedAttributes: { '*': ['class'] },
transformTags: {
input: function (tagName, attribs) {
return {
tagName: 'u',
attribs: { class: 'inlined-input' },
text: attribs.value
};
}
}
});
assert.equal(got, want);
}); |
<<<<<<<
components.charts.push({
header: "RobeBarChart",
=======
components.push({
header: "BarChart",
>>>>>>>
components.charts.push({
header: "BarChart",
<<<<<<<
components.charts.push({
header: "RobeComposedChart",
=======
components.push({
header: "ComposedChart",
>>>>>>>
components.charts.push({
header: "ComposedChart",
<<<<<<<
components.charts.push({
header: "RobeLineChart",
=======
components.push({
header: "LineChart",
>>>>>>>
components.charts.push({
header: "LineChart",
<<<<<<<
components.charts.push({
header: "RobePieChart",
=======
components.push({
header: "PieChart",
>>>>>>>
components.charts.push({
header: "PieChart",
<<<<<<<
components.charts.push({
header: "RobeRadarChart",
=======
components.push({
header: "RadarChart",
>>>>>>>
components.charts.push({
header: "RadarChart",
<<<<<<<
components.charts.push({
header: "RobeRadialBarChart",
=======
components.push({
header: "RadialBarChart",
>>>>>>>
components.charts.push({
header: "RadialBarChart",
<<<<<<<
components.charts.push({
header: "RobeScatterChart",
=======
components.push({
header: "ScatterChart",
>>>>>>>
components.charts.push({
header: "ScatterChart", |
<<<<<<<
desc: Application.i18n(ComponentList, "components.ComponentList", "areaChartDesc"),
// json: require("./jsons/charts/AreaChart.json"),
=======
desc: " displays graphically quantitative data. It is based on the line chart. The area between axis and line are commonly emphasized with colors, textures and hatchings. Commonly one compares with an area chart two or more quantities.",
json: require("./jsons/charts/AreaChart.json"),
>>>>>>>
desc: Application.i18n(ComponentList, "components.ComponentList", "areaChartDesc"),
json: require("./jsons/charts/AreaChart.json"),
<<<<<<<
desc: Application.i18n(ComponentList, "components.ComponentList", "barChartDesc"),
// json: require("./jsons/charts/BarChart.json"),
=======
desc: " a bar chart or bar graph is a chart or graph that presents grouped data with rectangle|rectangular bars with lengths proportional to the values that they represent. The bars can be plotted vertically or horizontally. A vertical bar chart is sometimes called a Line graph.",
json: require("./jsons/charts/BarChart.json"),
>>>>>>>
desc: Application.i18n(ComponentList, "components.ComponentList", "barChartDesc"),
json: require("./jsons/charts/BarChart.json"),
<<<<<<<
header: "ComposedChart",
desc: Application.i18n(ComponentList, "components.ComponentList", "composedChartDesc"),
// json: require("./jsons/charts/ComposedChart.json"),
sample: require("./samples/charts/ComposedChartSample"),
code: require("./samples/charts/ComposedChartSample.txt")
});
components.charts.push({
=======
>>>>>>>
header: "ComposedChart",
desc: Application.i18n(ComponentList, "components.ComponentList", "composedChartDesc"),
// json: require("./jsons/charts/ComposedChart.json"),
sample: require("./samples/charts/ComposedChartSample"),
code: require("./samples/charts/ComposedChartSample.txt")
});
components.charts.push({
<<<<<<<
desc: Application.i18n(ComponentList, "components.ComponentList", "lineChartDesc"),
// json: require("./jsons/charts/LineChart.json"),
=======
desc: " a line chart or line graph is a type of chart which displays information as a series of data points called 'markers' connected by straight line segments.It is a basic type of chart common in many fields.It is a basic type of chart common in many fields.",
json: require("./jsons/charts/LineChart.json"),
>>>>>>>
desc: Application.i18n(ComponentList, "components.ComponentList", "lineChartDesc"),
json: require("./jsons/charts/LineChart.json"),
<<<<<<<
desc: Application.i18n(ComponentList, "components.ComponentList", "pieChartDesc"),
// json: require("./jsons/charts/PieChart.json"),
=======
desc: " a pie chart (or a circle chart) is a circular statistical graphic which is divided into slices to illustrate numerical proportion. In a pie chart, the arc length of each slice (and consequently its central angle and area), is proportional to the quantity it represents",
json: require("./jsons/charts/PieChart.json"),
>>>>>>>
desc: Application.i18n(ComponentList, "components.ComponentList", "pieChartDesc"),
json: require("./jsons/charts/PieChart.json"),
<<<<<<<
header: "RadarChart",
desc: Application.i18n(ComponentList, "components.ComponentList", "radarChartDesc"),
// json: require("./jsons/charts/RadarChart.json"),
sample: require("./samples/charts/RadarChartSample"),
code: require("./samples/charts/RadarChartSample.txt")
});
components.charts.push({
header: "RadialBarChart",
desc: Application.i18n(ComponentList, "components.ComponentList", "radialBarChartDesc"),
// json: require("./jsons/charts/RadialBarChart.json"),
sample: require("./samples/charts/RadialBarChartSample"),
code: require("./samples/charts/RadialBarChartSample.txt")
});
components.charts.push({
=======
>>>>>>>
header: "RadarChart",
desc: Application.i18n(ComponentList, "components.ComponentList", "radarChartDesc"),
// json: require("./jsons/charts/RadarChart.json"),
sample: require("./samples/charts/RadarChartSample"),
code: require("./samples/charts/RadarChartSample.txt")
});
components.charts.push({
header: "RadialBarChart",
desc: Application.i18n(ComponentList, "components.ComponentList", "radialBarChartDesc"),
// json: require("./jsons/charts/RadialBarChart.json"),
sample: require("./samples/charts/RadialBarChartSample"),
code: require("./samples/charts/RadialBarChartSample.txt")
});
components.charts.push({
<<<<<<<
desc: Application.i18n(ComponentList, "components.ComponentList", "scatterChartDesc"),
// json: require("./jsons/charts/RobeScatterChart.json"),
=======
desc: " a scatter chart (also called a scatter graph, scatter plot, scattergram, or scatter diagram) is a type of plot or mathematical diagram using Cartesian coordinates to display values for typically two variables for a set of data",
json: require("./jsons/charts/ScatterChart.json"),
>>>>>>>
desc: Application.i18n(ComponentList, "components.ComponentList", "scatterChartDesc"),
json: require("./jsons/charts/ScatterChart.json"), |
<<<<<<<
Photo = PNM.Photo,
Photos = PNM.Photos,
Place = PNM.Place,
Helpers = PNM.Helpers,
Templates = Y.Template._cache,
=======
Helpers = Y.PNM.Helpers,
Templates = Y.PNM.Templates,
>>>>>>>
Helpers = Y.PNM.Helpers,
Templates = Y.Template._cache,
<<<<<<<
}, '0.7.2', {
affinity: 'client',
=======
}, '0.9.0', {
>>>>>>>
}, '0.9.0', {
affinity: 'client', |
<<<<<<<
const ALERT_TYPE_ERROR = 'error'
=======
export const setUrl = url => ({ type: SET_URL, url })
>>>>>>>
const ALERT_TYPE_ERROR = 'error'
export const setUrl = url => ({ type: SET_URL, url }) |
<<<<<<<
function createClient(protoFile, directory, serviceName, address, options) {
let parsed = grpc.load({
root: directory,
file: protoFile
});
inquirer.prompt([{
type: 'list',
name: 'packageName',
message: 'What package you want to use?',
choices: Object.keys(parsed)
}]).then(function(answers) {
init(answers.packageName, parsed, protoFile, directory, serviceName, address, options);
});
}
function init(packageName, parsed, protoFile, directory, serviceName, address, options) {
let pkg = packageName;
=======
function createClient(protoFile, serviceName, address, options) {
let parsed = grpc.load(protoFile);
let pkg = Object.keys(parsed)[0];
>>>>>>>
function createClient(protoFile, serviceName, address, options) {
let parsed = grpc.load(protoFile);
let pkg = Object.keys(parsed)[0];
function createClient(protoFile, directory, serviceName, address, options) {
let parsed = grpc.load({
root: directory,
file: protoFile
});
inquirer.prompt([{
type: 'list',
name: 'packageName',
message: 'What package you want to use?',
choices: Object.keys(parsed)
}]).then(function(answers) {
init(answers.packageName, parsed, protoFile, directory, serviceName, address, options);
});
}
function init(packageName, parsed, protoFile, directory, serviceName, address, options) {
let pkg = packageName; |
<<<<<<<
effect: false,
=======
rotateCompleteLoop: false,
>>>>>>>
effect: false,
rotateCompleteLoop: false, |
<<<<<<<
this.url = EsriLeaflet.Util.cleanUrl(url);
this._service = new EsriLeaflet.Services.FeatureLayer(this.url, options);
this._service.addEventParent(this);
=======
this._service = new EsriLeaflet.Services.FeatureLayer(options);
>>>>>>>
this._service.addEventParent(this);
this._service = new EsriLeaflet.Services.FeatureLayer(options);
<<<<<<<
// if there are no more active requests fire a load event for this view
if(this._activeRequests <= 0){
this.fire('load', {
bounds: bounds
}, true);
}
=======
>>>>>>> |
<<<<<<<
=======
map.on('moveend', this._update, this);
// if we had an image loaded and it matches the
// current bounds show the image otherwise remove it
if(this._currentImage && this._currentImage._bounds.equals(this._map.getBounds())){
map.addLayer(this._currentImage);
} else if(this._currentImage) {
this._map.removeLayer(this._currentImage);
this._currentImage = null;
}
>>>>>>>
map.on('moveend', this._update, this);
// if we had an image loaded and it matches the
// current bounds show the image otherwise remove it
if(this._currentImage && this._currentImage._bounds.equals(this._map.getBounds())){
map.addLayer(this._currentImage);
} else if(this._currentImage) {
this._map.removeLayer(this._currentImage);
this._currentImage = null;
}
<<<<<<<
getEvents: function(){
return {
moveend: this._update
};
},
=======
addTo: function(map){
map.addLayer(this);
return this;
},
removeFrom: function(map){
map.removeLayer(this);
return this;
},
>>>>>>>
getEvents: function(){
return {
moveend: this._update
};
}, |
<<<<<<<
'src/Layers/RasterLayer.js',
'src/Layers/DynamicMapLayer.js',
'src/Layers/ImageMapLayer.js',
'src/Layers/TiledMapLayer.js'
=======
'src/Tasks/Find.js',
'src/Layers/DynamicMapLayer',
'src/Layers/TiledMapLayer'
>>>>>>>
'src/Tasks/Find.js',
'src/Layers/RasterLayer.js',
'src/Layers/DynamicMapLayer.js',
'src/Layers/ImageMapLayer.js',
'src/Layers/TiledMapLayer.js' |
<<<<<<<
this._service = new L.esri.Services.MapService(this.url, options);
this._service.addEventParent(this);
=======
this._service = new L.esri.Services.MapService(options);
this._service.on('authenticationrequired requeststart requestend requesterror requestsuccess', this._propagateEvent, this);
>>>>>>>
this._service = new L.esri.Services.MapService(options);
this._service.addEventParent(this);
<<<<<<<
=======
},
// from https://github.com/Leaflet/Leaflet/blob/v0.7.2/src/layer/FeatureGroup.js
// @TODO remove at Leaflet 0.8
_propagateEvent: function (e) {
e = L.extend({
layer: e.target,
target: this
}, e);
this.fire(e.type, e);
},
_withinPercentage: function (a, b, percentage) {
var diff = Math.abs((a/b) - 1);
return diff < percentage;
>>>>>>>
},
_withinPercentage: function (a, b, percentage) {
var diff = Math.abs((a/b) - 1);
return diff < percentage; |
<<<<<<<
if (keys.length === 0) return store.state;
else if (keys.length > 1) {
=======
if (logger) console.log('Get: ', ...keys);
if (keys.length > 1) {
>>>>>>>
if (logger) console.log('Get: ', ...keys);
if (keys.length === 0) return store.state;
else if (keys.length > 1) { |
<<<<<<<
this.calculateWidth = function()
{
var width = 0;
for (var i = 0; i < $container.find("li").length; i++)
{
if($container.find("li").eq(i).children("a").eq(0).length > 0){
width += $container.find("li").eq(i).children("a").eq(0).outerWidth();
}
if($container.find("li").eq(i).children("span").eq(0).length > 0){
width += $container.find("li").eq(i).children("span").eq(0).outerWidth();
}
}
return width;
}
=======
this.calculateWidth = function()
{
var width = 0;
for (var i = 0; i < $container.find("li").length; i++)
{
if(!($container.find("li").eq(i).css('display') == 'none'))
{
width += $container.find("li").eq(i).children("a").eq(0).outerWidth();
width += $container.find("li").eq(i).children("span").eq(0).outerWidth();
}
}
return width;
}
>>>>>>>
this.calculateWidth = function()
{
var width = 0;
for (var i = 0; i < $container.find("li").length; i++)
{
if(!($container.find("li").eq(i).css('display') == 'none'))
{
if($container.find("li").eq(i).children("a").eq(0).length > 0){
width += $container.find("li").eq(i).children("a").eq(0).outerWidth();
}
if($container.find("li").eq(i).children("span").eq(0).length > 0){
width += $container.find("li").eq(i).children("span").eq(0).outerWidth();
}
}
}
return width;
} |
<<<<<<<
external: true,
},
{
title: 'Dokumentation',
path: 'https://preview.datengui.de/dokumentation',
external: true,
=======
external: true,
>>>>>>>
},
{
title: 'Dokumentation',
path: 'https://preview.datengui.de/dokumentation',
external: true,
<<<<<<<
Icon: TwitterIcon,
},
{
title: 'Datenguide auf Mastodon',
path: 'https://chaos.social/@datenguide',
Icon: MastodonIcon,
=======
Icon: TwitterIcon,
>>>>>>>
Icon: TwitterIcon,
},
{
title: 'Datenguide auf Mastodon',
path: 'https://chaos.social/@datenguide',
Icon: MastodonIcon,
<<<<<<<
left: '-1em',
},
=======
top: '-0.1em',
left: '-1em',
},
>>>>>>>
top: '-0.1em',
left: '-1em',
}, |
<<<<<<<
{process.env.NODE_ENV !== 'production' ? (
<a
className="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-colorInherit"
href="/docs/gettingstarted/intro"
>
Docs
</a>
) : (
<Link href="/docs/gettingstarted/intro" passHref>
<Button component="a" color="inherit">
Docs
</Button>
</Link>
)}
<div className={classes.nav}>
<Link href="/statistiken">
<Button component="a" color="inherit">
Data
</Button>
</Link>
<Link href="/regionen">
<Button component="a" color="inherit">
Regions
</Button>
</Link>
<Link href="/blog">
<Button component="a" color="inherit">
Blog
</Button>
</Link>
<Link href="/info">
<Button component="a" color="inherit">
About
</Button>
</Link>
</div>
=======
{/* {process.env.NODE_ENV !== 'production' ? ( */}
{/* <a */}
{/* className="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-colorInherit" */}
{/* href="/docs/gettingstarted/intro" */}
{/* > */}
{/* Docs */}
{/* </a> */}
{/* ) : ( */}
{/* <Link href="/docs/gettingstarted/intro" passHref> */}
{/* <Button component="a" color="inherit"> */}
{/* Docs */}
{/* </Button> */}
{/* </Link> */}
{/* )} */}
{/* <Link href="/statistics"> */}
{/* <Button component="a" color="inherit"> */}
{/* Data */}
{/* </Button> */}
{/* </Link> */}
{/* <Link href="/regions"> */}
{/* <Button component="a" color="inherit"> */}
{/* Regions */}
{/* </Button> */}
{/* </Link> */}
<Link href="/info">
<Button component="a" color="inherit">
Über Datenguide
</Button>
</Link>
<Link href="/blog">
<Button component="a" color="inherit">
Blog
</Button>
</Link>
>>>>>>>
{process.env.NODE_ENV !== 'production' ? (
<a
className="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-colorInherit"
href="/docs/gettingstarted/intro"
>
Docs
</a>
) : (
<Link href="/docs/gettingstarted/intro" passHref>
<Button component="a" color="inherit">
Docs
</Button>
</Link>
)}
<div className={classes.nav}>
<Link href="/statistiken">
<Button component="a" color="inherit">
Data
</Button>
</Link>
<Link href="/regionen">
<Button component="a" color="inherit">
Regions
</Button>
</Link>
<Link href="/info">
<Button component="a" color="inherit">
Über Datenguide
</Button>
</Link>
<Link href="/blog">
<Button component="a" color="inherit">
Blog
</Button>
</Link>
</div> |
<<<<<<<
this.wm = (binding ? binding : new X11wm());
// Known layouts
=======
if(process.version.indexOf('v0.6') != -1) {
console.log(process.version);
// the right way would be to fix the wscript, but waf makes me cry for help
this.wm = require('./build/Release/nwm.node');
} else {
this.wm = require('./build/default/nwm.node');
}
// Known layous
>>>>>>>
if(process.version.indexOf('v0.6') != -1) {
console.log(process.version);
// the right way would be to fix the wscript, but waf makes me cry for help
this.wm = require('./build/Release/nwm.node');
} else {
this.wm = require('./build/default/nwm.node');
}
// Known layouts
<<<<<<<
console.log('Add window', {
window: window,
current_monitor: {
width: current_monitor.width,
height: current_monitor.height
}
});
this.windows.add(win);
=======
this.windows.add(window);
>>>>>>>
console.log('Add window', {
window: window,
current_monitor: {
width: current_monitor.width,
height: current_monitor.height
}
});
this.windows.add(win);
<<<<<<<
NWM.prototype.currentMonitor = function() {
return this.monitors.get(this.monitors.current);
};
=======
>>>>>>> |
<<<<<<<
import SocialProfiles from './SocialProfiles';
=======
import StatusImage from './StatusImage';
>>>>>>>
import StatusImage from './StatusImage';
import SocialProfiles from './SocialProfiles';
<<<<<<<
SocialProfiles,
=======
StatusImage,
>>>>>>>
StatusImage,
SocialProfiles, |
<<<<<<<
imageSrc={require('./create-data-objects.png')}
image2xSrc={require('./[email protected]')}
imageSmallSrc={require('./create-data-objects-small.png')}
imageSmall2xSrc={require('./[email protected]')}
headline="Create data objects"
=======
imageSrc={require('./screen-3.jpg')}
image2xSrc={require('./[email protected]')}
imageSmallSrc={require('./screen-3-small.jpg')}
imageSmall2xSrc={require('./[email protected]')}
headline="Create Data Objects"
>>>>>>>
imageSrc={require('./create-data-objects.png')}
image2xSrc={require('./[email protected]')}
imageSmallSrc={require('./create-data-objects-small.png')}
imageSmall2xSrc={require('./[email protected]')}
headline="Create Data Objects" |
<<<<<<<
import CounterBoxes from './CounterBoxes';
=======
import ContactForm from './ContactForm';
>>>>>>>
import ContactForm from './ContactForm';
import CounterBoxes from './CounterBoxes';
<<<<<<<
CounterBoxes,
=======
ContactForm,
>>>>>>>
ContactForm,
CounterBoxes, |
<<<<<<<
SlackSlider,
=======
PlatformsSection,
>>>>>>>
SlackSlider,
PlatformsSection, |
<<<<<<<
import Testimonials from './Testimonials';
=======
import SocialProfiles from './SocialProfiles';
import Testimtionals from './Testimtionals';
>>>>>>>
import Testimonials from './Testimonials';
import SocialProfiles from './SocialProfiles';
<<<<<<<
Testimonials,
=======
SocialProfiles,
Testimtionals,
>>>>>>>
Testimonials,
SocialProfiles, |
<<<<<<<
import { AboutUsHeaderImage, BlockquoteSection, CounterBoxes, CTASection, Footer, PageHeader } from '../../components';
=======
import { BlockquoteSection, CounterBoxes, CTASection, Footer, OfficesMap, PageHeader, Team } from '../../components';
>>>>>>>
import { AboutUsHeaderImage, BlockquoteSection, CounterBoxes, CTASection, Footer, OfficesMap, PageHeader, Team } from '../../components'; |
<<<<<<<
import TextColumns from './TextColumns';
=======
import TextWithBottomImage from './TextWithBottomImage';
>>>>>>>
import TextColumns from './TextColumns';
import TextWithBottomImage from './TextWithBottomImage';
<<<<<<<
TextColumns,
=======
TextWithBottomImage,
>>>>>>>
TextColumns,
TextWithBottomImage, |
<<<<<<<
this.beamsTokenProviderInstance = beamsTokenProviderInstance
this.beamsInstanceInitFn = beamsInstanceInitFn
this.logger = serverInstanceV4.logger
=======
this.logger = serverInstanceV5.logger
>>>>>>>
this.beamsTokenProviderInstance = beamsTokenProviderInstance
this.beamsInstanceInitFn = beamsInstanceInitFn
this.logger = serverInstanceV5.logger |
<<<<<<<
const icon = argv.icon || argv.i || 'build/icon';
if (icon) {
DEFAULT_OPTS.icon = icon;
}
=======
const icon = argv.icon || argv.i || 'app/app';
if (icon) DEFAULT_OPTS.icon = icon;
>>>>>>>
const icon = argv.icon || argv.i || 'build/icon';
if (icon) DEFAULT_OPTS.icon = icon; |
<<<<<<<
import TooltipTrigger from 'common/components/TooltipTrigger';
import styles from './styles.less';
=======
import TooltipTrigger from 'common/components/TooltipTrigger';
import Icon from 'common/components/Icon';
import styles from './styles.less';
>>>>>>>
import TooltipTrigger from 'common/components/TooltipTrigger';
import Icon from 'common/components/Icon';
import styles from './styles.less';
<<<<<<<
inline?: boolean,
=======
tooltipTextOverride?: string,
equipped?: boolean,
>>>>>>>
tooltipTextOverride?: string,
equipped?: boolean,
inline?: boolean,
<<<<<<<
inline,
=======
tooltipTextOverride,
equipped,
>>>>>>>
inline,
tooltipTextOverride,
equipped,
<<<<<<<
<div className={cx(styles.root, styles[`${type}Icon`], { [styles.busy]: busy, [styles.small]: small, [styles.inline]: inline }, className)}>
<div
=======
<Icon
name={type ? `${type}-slot-icon.png` : 'empty-skill-back.png'}
className={cx(styles.root, className, {
[styles.busy]: busy,
[styles.small]: small,
[styles.emptyBg]: !type,
})}
>
<Icon
>>>>>>>
<Icon
name={type ? `${type}-slot-icon.png` : 'empty-skill-back.png'}
className={cx(styles.root, className, {
[styles.busy]: busy,
[styles.small]: small,
[styles.emptyBg]: !type,
[styles.inline]: inline,
})}
>
<Icon |
<<<<<<<
<div className={styles.root}>
<ArmoryBadge className={styles.badge} />
=======
<div className={cx(styles.root, className)}>
>>>>>>>
<div className={cx(styles.root, className)}>
<ArmoryBadge className={styles.badge} /> |
<<<<<<<
suite('inequalities', function() {
// assertFullyFunctioningInequality() checks not only that the inequality
// has the right LaTeX and when you backspace it has the right LaTeX,
// but also that when you backspace you get the right state such that
// you can either type = again to get the non-strict inequality again,
// or backspace again and it'll delete correctly.
function assertFullyFunctioningInequality(nonStrict, strict) {
assertLatex(nonStrict);
mq.keystroke('Backspace');
assertLatex(strict);
mq.typedText('=');
assertLatex(nonStrict);
mq.keystroke('Backspace');
assertLatex(strict);
mq.keystroke('Backspace');
assertLatex('');
}
test('typing and backspacing <= and >=', function() {
mq.typedText('<');
assertLatex('<');
mq.typedText('=');
assertFullyFunctioningInequality('\\le', '<');
mq.typedText('>');
assertLatex('>');
mq.typedText('=');
assertFullyFunctioningInequality('\\ge', '>');
mq.typedText('<<>>==>><<==');
assertLatex('<<>\\ge=>><\\le=');
});
test('typing ≤ and ≥ chars directly', function() {
mq.typedText('≤');
assertFullyFunctioningInequality('\\le', '<');
mq.typedText('≥');
assertFullyFunctioningInequality('\\ge', '>');
});
suite('rendered from LaTeX', function() {
test('control sequences', function() {
mq.latex('\\le');
assertFullyFunctioningInequality('\\le', '<');
mq.latex('\\ge');
assertFullyFunctioningInequality('\\ge', '>');
});
test('≤ and ≥ chars', function() {
mq.latex('≤');
assertFullyFunctioningInequality('\\le', '<');
mq.latex('≥');
assertFullyFunctioningInequality('\\ge', '>');
});
});
});
=======
suite('auto-cmds', function() {
MathQuill.addAutoCommands('pi tau phi theta Gamma '
+ 'sum prod sqrt nthroot');
test('individual commands', function(){
mq.typedText('sum' + 'n=0');
mq.keystroke('Up').typedText('100').keystroke('Right');
assertLatex('\\sum_{n=0}^{100}');
mq.keystroke('Backspace');
mq.typedText('prod');
mq.typedText('n=0').keystroke('Up').typedText('100').keystroke('Right');
assertLatex('\\prod_{n=0}^{100}');
mq.keystroke('Backspace');
mq.typedText('sqrt');
mq.typedText('100').keystroke('Right');
assertLatex('\\sqrt{100}');
mq.keystroke('Backspace').keystroke('Backspace');
mq.typedText('nthroot');
mq.typedText('n').keystroke('Right').typedText('100').keystroke('Right');
assertLatex('\\sqrt[n]{100}');
mq.keystroke('Backspace').keystroke('Backspace');
mq.typedText('pi');
assertLatex('\\pi');
mq.keystroke('Backspace');
mq.typedText('tau');
assertLatex('\\tau');
mq.keystroke('Backspace');
mq.typedText('phi');
assertLatex('\\phi');
mq.keystroke('Backspace');
mq.typedText('theta');
assertLatex('\\theta');
mq.keystroke('Backspace');
mq.typedText('Gamma');
assertLatex('\\Gamma');
mq.keystroke('Backspace');
});
test('sequences of auto-commands and other assorted characters', function() {
mq.typedText('sin' + 'pi');
assertLatex('\\sin\\pi');
mq.keystroke('Left Backspace');
assertLatex('si\\pi');
mq.keystroke('Left').typedText('p');
assertLatex('spi\\pi');
mq.typedText('i');
assertLatex('s\\pi i\\pi');
mq.typedText('p');
assertLatex('s\\pi pi\\pi');
mq.keystroke('Right').typedText('n');
assertLatex('s\\pi pin\\pi');
mq.keystroke('Left Left Left').typedText('s');
assertLatex('s\\pi spin\\pi');
mq.keystroke('Backspace');
assertLatex('s\\pi pin\\pi');
mq.keystroke('Del').keystroke('Backspace');
assertLatex('\\sin\\pi');
});
test('command contains non-letters', function() {
assert.throws(function() { MathQuill.addAutoCommands('e1'); });
});
test('command length less than 2', function() {
assert.throws(function() { MathQuill.addAutoCommands('e'); });
});
test('command is already unitalicized', function() {
var cmds = 'Pr arg deg det dim exp gcd hom inf ker lg lim ln log max '
+ 'min sup inj proj sin cos tan sec cosec csc cotan cot ctg';
cmds = cmds.split(' ');
for (var i = 0; i < cmds.length; i += 1) {
assert.throws(function() { MathQuill.addAutoCommands(cmds[i]) },
'MathQuill.addAutoCommands("'+cmds[i]+'")');
}
});
});
>>>>>>>
suite('auto-cmds', function() {
MathQuill.addAutoCommands('pi tau phi theta Gamma '
+ 'sum prod sqrt nthroot');
test('individual commands', function(){
mq.typedText('sum' + 'n=0');
mq.keystroke('Up').typedText('100').keystroke('Right');
assertLatex('\\sum_{n=0}^{100}');
mq.keystroke('Backspace');
mq.typedText('prod');
mq.typedText('n=0').keystroke('Up').typedText('100').keystroke('Right');
assertLatex('\\prod_{n=0}^{100}');
mq.keystroke('Backspace');
mq.typedText('sqrt');
mq.typedText('100').keystroke('Right');
assertLatex('\\sqrt{100}');
mq.keystroke('Backspace').keystroke('Backspace');
mq.typedText('nthroot');
mq.typedText('n').keystroke('Right').typedText('100').keystroke('Right');
assertLatex('\\sqrt[n]{100}');
mq.keystroke('Backspace').keystroke('Backspace');
mq.typedText('pi');
assertLatex('\\pi');
mq.keystroke('Backspace');
mq.typedText('tau');
assertLatex('\\tau');
mq.keystroke('Backspace');
mq.typedText('phi');
assertLatex('\\phi');
mq.keystroke('Backspace');
mq.typedText('theta');
assertLatex('\\theta');
mq.keystroke('Backspace');
mq.typedText('Gamma');
assertLatex('\\Gamma');
mq.keystroke('Backspace');
});
test('sequences of auto-commands and other assorted characters', function() {
mq.typedText('sin' + 'pi');
assertLatex('\\sin\\pi');
mq.keystroke('Left Backspace');
assertLatex('si\\pi');
mq.keystroke('Left').typedText('p');
assertLatex('spi\\pi');
mq.typedText('i');
assertLatex('s\\pi i\\pi');
mq.typedText('p');
assertLatex('s\\pi pi\\pi');
mq.keystroke('Right').typedText('n');
assertLatex('s\\pi pin\\pi');
mq.keystroke('Left Left Left').typedText('s');
assertLatex('s\\pi spin\\pi');
mq.keystroke('Backspace');
assertLatex('s\\pi pin\\pi');
mq.keystroke('Del').keystroke('Backspace');
assertLatex('\\sin\\pi');
});
test('command contains non-letters', function() {
assert.throws(function() { MathQuill.addAutoCommands('e1'); });
});
test('command length less than 2', function() {
assert.throws(function() { MathQuill.addAutoCommands('e'); });
});
test('command is already unitalicized', function() {
var cmds = 'Pr arg deg det dim exp gcd hom inf ker lg lim ln log max '
+ 'min sup inj proj sin cos tan sec cosec csc cotan cot ctg';
cmds = cmds.split(' ');
for (var i = 0; i < cmds.length; i += 1) {
assert.throws(function() { MathQuill.addAutoCommands(cmds[i]) },
'MathQuill.addAutoCommands("'+cmds[i]+'")');
}
});
});
suite('inequalities', function() {
// assertFullyFunctioningInequality() checks not only that the inequality
// has the right LaTeX and when you backspace it has the right LaTeX,
// but also that when you backspace you get the right state such that
// you can either type = again to get the non-strict inequality again,
// or backspace again and it'll delete correctly.
function assertFullyFunctioningInequality(nonStrict, strict) {
assertLatex(nonStrict);
mq.keystroke('Backspace');
assertLatex(strict);
mq.typedText('=');
assertLatex(nonStrict);
mq.keystroke('Backspace');
assertLatex(strict);
mq.keystroke('Backspace');
assertLatex('');
}
test('typing and backspacing <= and >=', function() {
mq.typedText('<');
assertLatex('<');
mq.typedText('=');
assertFullyFunctioningInequality('\\le', '<');
mq.typedText('>');
assertLatex('>');
mq.typedText('=');
assertFullyFunctioningInequality('\\ge', '>');
mq.typedText('<<>>==>><<==');
assertLatex('<<>\\ge=>><\\le=');
});
test('typing ≤ and ≥ chars directly', function() {
mq.typedText('≤');
assertFullyFunctioningInequality('\\le', '<');
mq.typedText('≥');
assertFullyFunctioningInequality('\\ge', '>');
});
suite('rendered from LaTeX', function() {
test('control sequences', function() {
mq.latex('\\le');
assertFullyFunctioningInequality('\\le', '<');
mq.latex('\\ge');
assertFullyFunctioningInequality('\\ge', '>');
});
test('≤ and ≥ chars', function() {
mq.latex('≤');
assertFullyFunctioningInequality('\\le', '<');
mq.latex('≥');
assertFullyFunctioningInequality('\\ge', '>');
});
});
}); |
<<<<<<<
if (textBlock[R].siblingCreated) textBlock[R].siblingCreated(cursor.options, L);
if (textBlock[L].siblingCreated) textBlock[L].siblingCreated(cursor.options, R);
textBlock.bubble('edited');
=======
if (textBlock[R].siblingCreated) textBlock[R].siblingCreated(L);
if (textBlock[L].siblingCreated) textBlock[L].siblingCreated(R);
textBlock.bubble('reflow');
>>>>>>>
if (textBlock[R].siblingCreated) textBlock[R].siblingCreated(cursor.options, L);
if (textBlock[L].siblingCreated) textBlock[L].siblingCreated(cursor.options, R);
textBlock.bubble('reflow'); |
<<<<<<<
block.finalizeInsert(cursor.options, cursor);
if (block.ends[R][R].siblingCreated) block.ends[R][R].siblingCreated(cursor.options, L);
if (block.ends[L][L].siblingCreated) block.ends[L][L].siblingCreated(cursor.options, R);
cursor.parent.bubble('edited');
=======
block.finalizeInsert(cursor);
if (block.ends[R][R].siblingCreated) block.ends[R][R].siblingCreated(L);
if (block.ends[L][L].siblingCreated) block.ends[L][L].siblingCreated(R);
cursor.parent.bubble('reflow');
>>>>>>>
block.finalizeInsert(cursor.options, cursor);
if (block.ends[R][R].siblingCreated) block.ends[R][R].siblingCreated(cursor.options, L);
if (block.ends[L][L].siblingCreated) block.ends[L][L].siblingCreated(cursor.options, R);
cursor.parent.bubble('reflow'); |
<<<<<<<
=======
var TextBlock =
CharCmds.$ =
LatexCmds.text =
LatexCmds.textnormal =
LatexCmds.textrm =
LatexCmds.textup =
LatexCmds.textmd = P(MathCommand, function(_, _super) {
_.ctrlSeq = '\\text';
_.htmlTemplate = '<span class="text">&0</span>';
_.replaces = function(replacedText) {
if (replacedText instanceof MathFragment)
this.replacedText = replacedText.remove().jQ.text();
else if (typeof replacedText === 'string')
this.replacedText = replacedText;
};
_.textTemplate = ['"', '"'];
_.parser = function() {
// TODO: correctly parse text mode
var string = Parser.string;
var regex = Parser.regex;
var optWhitespace = Parser.optWhitespace;
return optWhitespace
.then(string('{')).then(regex(/^[^}]*/)).skip(string('}'))
.map(function(text) {
var cmd = TextBlock();
cmd.createBlocks();
var block = cmd.firstChild;
for (var i = 0; i < text.length; i += 1) {
var ch = VanillaSymbol(text.charAt(i));
ch.adopt(block, block.lastChild, 0);
}
return cmd;
})
;
};
_.createBlocks = function() {
//FIXME: another possible Law of Demeter violation, but this seems much cleaner, like it was supposed to be done this way
this.firstChild =
this.lastChild =
InnerTextBlock();
this.blocks = [ this.firstChild ];
this.firstChild.parent = this;
};
_.finalizeInsert = function() {
//FIXME HACK blur removes the TextBlock
this.firstChild.blur = function() { delete this.blur; return this; };
_super.finalizeInsert.call(this);
};
_.createBefore = function(cursor) {
_super.createBefore.call(this, this.cursor = cursor);
if (this.replacedText)
for (var i = 0; i < this.replacedText.length; i += 1)
this.write(this.replacedText.charAt(i));
};
_.write = function(ch) {
var html;
if (ch === '<') html = '<';
else if (ch === '>') html = '>';
this.cursor.insertNew(VanillaSymbol(ch, html));
};
_.onKey = function(key, e) {
//backspace and delete and ends of block don't unwrap
if (!this.cursor.selection &&
(
(key === 'Backspace' && !this.cursor.prev) ||
(key === 'Del' && !this.cursor.next)
)
) {
if (this.isEmpty())
this.cursor.insertAfter(this);
return false;
}
};
_.onText = function(ch) {
this.cursor.prepareEdit();
if (ch !== '$')
this.write(ch);
else if (this.isEmpty())
this.cursor.insertAfter(this).backspace().insertNew(VanillaSymbol('\\$','$'));
else if (!this.cursor.next)
this.cursor.insertAfter(this);
else if (!this.cursor.prev)
this.cursor.insertBefore(this);
else { //split apart
var next = TextBlock(MathFragment(this.cursor.next, this.firstChild.lastChild));
next.placeCursor = function(cursor) { //FIXME HACK: pretend no prev so they don't get merged
this.prev = 0;
delete this.placeCursor;
this.placeCursor(cursor);
};
next.firstChild.focus = function(){ return this; };
this.cursor.insertAfter(this).insertNew(next);
next.prev = this;
this.cursor.insertBefore(next);
delete next.firstChild.focus;
}
return false;
};
});
var InnerTextBlock = P(MathBlock, function(_, _super) {
_.blur = function() {
this.jQ.removeClass('hasCursor');
if (this.isEmpty()) {
var textblock = this.parent, cursor = textblock.cursor;
if (cursor.parent === this)
this.jQ.addClass('empty');
else {
cursor.hide();
textblock.remove();
if (cursor.next === textblock)
cursor.next = textblock.next;
else if (cursor.prev === textblock)
cursor.prev = textblock.prev;
cursor.show().parent.bubble('redraw');
}
}
return this;
};
_.focus = function() {
_super.focus.call(this);
var textblock = this.parent;
if (textblock.next.ctrlSeq === textblock.ctrlSeq) { //TODO: seems like there should be a better way to move MathElements around
var innerblock = this,
cursor = textblock.cursor,
next = textblock.next.firstChild;
next.eachChild(function(child){
child.parent = innerblock;
child.jQ.appendTo(innerblock.jQ);
});
if (this.lastChild)
this.lastChild.next = next.firstChild;
else
this.firstChild = next.firstChild;
next.firstChild.prev = this.lastChild;
this.lastChild = next.lastChild;
next.parent.remove();
if (cursor.prev)
cursor.insertAfter(cursor.prev);
else
cursor.prependTo(this);
cursor.parent.bubble('redraw');
}
else if (textblock.prev.ctrlSeq === textblock.ctrlSeq) {
var cursor = textblock.cursor;
if (cursor.prev)
textblock.prev.firstChild.focus();
else
cursor.appendTo(textblock.prev.firstChild);
}
return this;
};
});
function makeTextBlock(latex, tagName, attrs) {
return P(TextBlock, {
ctrlSeq: latex,
htmlTemplate: '<'+tagName+' '+attrs+'>&0</'+tagName+'>'
});
}
LatexCmds.em = LatexCmds.italic = LatexCmds.italics =
LatexCmds.emph = LatexCmds.textit = LatexCmds.textsl =
makeTextBlock('\\textit', 'i', 'class="text"');
LatexCmds.strong = LatexCmds.bold = LatexCmds.textbf =
makeTextBlock('\\textbf', 'b', 'class="text"');
LatexCmds.sf = LatexCmds.textsf =
makeTextBlock('\\textsf', 'span', 'class="sans-serif text"');
LatexCmds.tt = LatexCmds.texttt =
makeTextBlock('\\texttt', 'span', 'class="monospace text"');
LatexCmds.textsc =
makeTextBlock('\\textsc', 'span', 'style="font-variant:small-caps" class="text"');
LatexCmds.uppercase =
makeTextBlock('\\uppercase', 'span', 'style="text-transform:uppercase" class="text"');
LatexCmds.lowercase =
makeTextBlock('\\lowercase', 'span', 'style="text-transform:lowercase" class="text"');
>>>>>>>
<<<<<<<
var latex = this.ch[L].latex(), cmd;
=======
var latex = this.firstChild.latex();
>>>>>>>
var latex = this.ch[L].latex();
<<<<<<<
if (currentBlock[L]) {
this.cursor.appendTo(currentBlock[L])
currentBlock[L][R] = currentBlock[R];
=======
if (currentBlock.prev) {
this.cursor.appendTo(currentBlock.prev);
currentBlock.prev.next = currentBlock.next;
>>>>>>>
if (currentBlock[L]) {
this.cursor.appendTo(currentBlock[L]);
currentBlock[L][R] = currentBlock[R]; |
<<<<<<<
suite('SupSub behavior options', function() {
test('addCharsThatBreakOutOfSupSub', function() {
assert.equal(mq.typedText('x^2n+y').latex(), 'x^{2n+y}');
mq.latex('');
MathQuill.addCharsThatBreakOutOfSupSub('+-=<>');
assert.equal(mq.typedText('x^2n+y').latex(), 'x^{2n}+y');
});
test('disableCharsWithoutOperand', function() {
assert.equal(mq.typedText('^').latex(), '^{ }');
assert.equal(mq.typedText('2').latex(), '^2');
assert.equal(mq.typedText('n').latex(), '^{2n}');
mq.latex('');
assert.equal(mq.typedText('x').latex(), 'x');
assert.equal(mq.typedText('^').latex(), 'x^{ }');
assert.equal(mq.typedText('2').latex(), 'x^2');
assert.equal(mq.typedText('n').latex(), 'x^{2n}');
mq.latex('');
assert.equal(mq.typedText('x').latex(), 'x');
assert.equal(mq.typedText('^').latex(), 'x^{ }');
assert.equal(mq.typedText('^').latex(), 'x^{^{ }}');
assert.equal(mq.typedText('2').latex(), 'x^{^2}');
assert.equal(mq.typedText('n').latex(), 'x^{^{2n}}');
mq.latex('');
MathQuill.disableCharsWithoutOperand('^_');
assert.equal(mq.typedText('^').latex(), '');
assert.equal(mq.typedText('2').latex(), '2');
assert.equal(mq.typedText('n').latex(), '2n');
mq.latex('');
assert.equal(mq.typedText('x').latex(), 'x');
assert.equal(mq.typedText('^').latex(), 'x^{ }');
assert.equal(mq.typedText('2').latex(), 'x^2');
assert.equal(mq.typedText('n').latex(), 'x^{2n}');
mq.latex('');
assert.equal(mq.typedText('x').latex(), 'x');
assert.equal(mq.typedText('^').latex(), 'x^{ }');
assert.equal(mq.typedText('^').latex(), 'x^{ }');
assert.equal(mq.typedText('2').latex(), 'x^2');
assert.equal(mq.typedText('n').latex(), 'x^{2n}');
});
});
=======
suite('inequalities', function() {
// assertFullyFunctioningInequality() checks not only that the inequality
// has the right LaTeX and when you backspace it has the right LaTeX,
// but also that when you backspace you get the right state such that
// you can either type = again to get the non-strict inequality again,
// or backspace again and it'll delete correctly.
function assertFullyFunctioningInequality(nonStrict, strict) {
assertLatex(nonStrict);
mq.keystroke('Backspace');
assertLatex(strict);
mq.typedText('=');
assertLatex(nonStrict);
mq.keystroke('Backspace');
assertLatex(strict);
mq.keystroke('Backspace');
assertLatex('');
}
test('typing and backspacing <= and >=', function() {
mq.typedText('<');
assertLatex('<');
mq.typedText('=');
assertFullyFunctioningInequality('\\le', '<');
mq.typedText('>');
assertLatex('>');
mq.typedText('=');
assertFullyFunctioningInequality('\\ge', '>');
mq.typedText('<<>>==>><<==');
assertLatex('<<>\\ge=>><\\le=');
});
test('typing ≤ and ≥ chars directly', function() {
mq.typedText('≤');
assertFullyFunctioningInequality('\\le', '<');
mq.typedText('≥');
assertFullyFunctioningInequality('\\ge', '>');
});
suite('rendered from LaTeX', function() {
test('control sequences', function() {
mq.latex('\\le');
assertFullyFunctioningInequality('\\le', '<');
mq.latex('\\ge');
assertFullyFunctioningInequality('\\ge', '>');
});
test('≤ and ≥ chars', function() {
mq.latex('≤');
assertFullyFunctioningInequality('\\le', '<');
mq.latex('≥');
assertFullyFunctioningInequality('\\ge', '>');
});
});
});
>>>>>>>
suite('inequalities', function() {
// assertFullyFunctioningInequality() checks not only that the inequality
// has the right LaTeX and when you backspace it has the right LaTeX,
// but also that when you backspace you get the right state such that
// you can either type = again to get the non-strict inequality again,
// or backspace again and it'll delete correctly.
function assertFullyFunctioningInequality(nonStrict, strict) {
assertLatex(nonStrict);
mq.keystroke('Backspace');
assertLatex(strict);
mq.typedText('=');
assertLatex(nonStrict);
mq.keystroke('Backspace');
assertLatex(strict);
mq.keystroke('Backspace');
assertLatex('');
}
test('typing and backspacing <= and >=', function() {
mq.typedText('<');
assertLatex('<');
mq.typedText('=');
assertFullyFunctioningInequality('\\le', '<');
mq.typedText('>');
assertLatex('>');
mq.typedText('=');
assertFullyFunctioningInequality('\\ge', '>');
mq.typedText('<<>>==>><<==');
assertLatex('<<>\\ge=>><\\le=');
});
test('typing ≤ and ≥ chars directly', function() {
mq.typedText('≤');
assertFullyFunctioningInequality('\\le', '<');
mq.typedText('≥');
assertFullyFunctioningInequality('\\ge', '>');
});
suite('rendered from LaTeX', function() {
test('control sequences', function() {
mq.latex('\\le');
assertFullyFunctioningInequality('\\le', '<');
mq.latex('\\ge');
assertFullyFunctioningInequality('\\ge', '>');
});
test('≤ and ≥ chars', function() {
mq.latex('≤');
assertFullyFunctioningInequality('\\le', '<');
mq.latex('≥');
assertFullyFunctioningInequality('\\ge', '>');
});
});
});
suite('SupSub behavior options', function() {
test('addCharsThatBreakOutOfSupSub', function() {
assert.equal(mq.typedText('x^2n+y').latex(), 'x^{2n+y}');
mq.latex('');
MathQuill.addCharsThatBreakOutOfSupSub('+-=<>');
assert.equal(mq.typedText('x^2n+y').latex(), 'x^{2n}+y');
});
test('disableCharsWithoutOperand', function() {
assert.equal(mq.typedText('^').latex(), '^{ }');
assert.equal(mq.typedText('2').latex(), '^2');
assert.equal(mq.typedText('n').latex(), '^{2n}');
mq.latex('');
assert.equal(mq.typedText('x').latex(), 'x');
assert.equal(mq.typedText('^').latex(), 'x^{ }');
assert.equal(mq.typedText('2').latex(), 'x^2');
assert.equal(mq.typedText('n').latex(), 'x^{2n}');
mq.latex('');
assert.equal(mq.typedText('x').latex(), 'x');
assert.equal(mq.typedText('^').latex(), 'x^{ }');
assert.equal(mq.typedText('^').latex(), 'x^{^{ }}');
assert.equal(mq.typedText('2').latex(), 'x^{^2}');
assert.equal(mq.typedText('n').latex(), 'x^{^{2n}}');
mq.latex('');
MathQuill.disableCharsWithoutOperand('^_');
assert.equal(mq.typedText('^').latex(), '');
assert.equal(mq.typedText('2').latex(), '2');
assert.equal(mq.typedText('n').latex(), '2n');
mq.latex('');
assert.equal(mq.typedText('x').latex(), 'x');
assert.equal(mq.typedText('^').latex(), 'x^{ }');
assert.equal(mq.typedText('2').latex(), 'x^2');
assert.equal(mq.typedText('n').latex(), 'x^{2n}');
mq.latex('');
assert.equal(mq.typedText('x').latex(), 'x');
assert.equal(mq.typedText('^').latex(), 'x^{ }');
assert.equal(mq.typedText('^').latex(), 'x^{ }');
assert.equal(mq.typedText('2').latex(), 'x^2');
assert.equal(mq.typedText('n').latex(), 'x^{2n}');
});
}); |
<<<<<<<
$$('.CodeMirror')
.map(e => e.CodeMirror)
.forEach(cm => setupAutocomplete(cm, el.checked));
=======
editors.forEach(cm => {
const onOff = el.checked ? 'on' : 'off';
cm[onOff]('changes', autocompleteOnTyping);
cm[onOff]('pick', autocompletePicked);
});
>>>>>>>
$$('.CodeMirror')
.map(e => e.CodeMirror)
.forEach(cm => setupAutocomplete(cm, el.checked));
<<<<<<<
setupAutocomplete(cm);
=======
cm.on('changes', autocompleteOnTyping);
cm.on('pick', autocompletePicked);
>>>>>>>
setupAutocomplete(cm);
<<<<<<<
function setupAutocomplete(cm, enable = true) {
const onOff = enable ? 'on' : 'off';
cm[onOff]('change', autocompleteOnTyping);
cm[onOff]('pick', autocompletePicked);
}
function autocompleteOnTyping(cm, info, debounced) {
=======
function autocompleteOnTyping(cm, [info], debounced) {
>>>>>>>
function setupAutocomplete(cm, enable = true) {
const onOff = enable ? 'on' : 'off';
cm[onOff]('change', autocompleteOnTyping);
cm[onOff]('pick', autocompletePicked);
}
function autocompleteOnTyping(cm, [info], debounced) {
<<<<<<<
if (!cm || offscreenDistance(cm) > 0) {
const sorted = $$('#sections .CodeMirror').map(e => e.CodeMirror)
.map((cm, index) => ({cm: cm, distance: offscreenDistance(cm), index: index}))
.sort((a, b) => a.distance - b.distance || a.index - b.index);
cm = sorted[0].cm;
if (sorted[0].distance > 0) {
makeSectionVisible(cm);
=======
// closest editor should have at least 2 lines visible
const lineHeight = editors[0].defaultTextHeight();
const scrollY = window.scrollY;
const windowBottom = scrollY + window.innerHeight - 2 * lineHeight;
const allSectionsContainerTop = scrollY + $('#sections').getBoundingClientRect().top;
const distances = [];
const alreadyInView = cm && offscreenDistance(null, cm) === 0;
return alreadyInView ? cm : findClosest();
function offscreenDistance(index, cm) {
if (index >= 0 && distances[index] !== undefined) {
return distances[index];
>>>>>>>
// closest editor should have at least 2 lines visible
const lineHeight = editors[0].defaultTextHeight();
const scrollY = window.scrollY;
const windowBottom = scrollY + window.innerHeight - 2 * lineHeight;
const allSectionsContainerTop = scrollY + $('#sections').getBoundingClientRect().top;
const distances = [];
const alreadyInView = cm && offscreenDistance(null, cm) === 0;
return alreadyInView ? cm : findClosest();
function offscreenDistance(index, cm) {
if (index >= 0 && distances[index] !== undefined) {
return distances[index];
<<<<<<<
=======
addSection(null, section);
editors[0].setOption('lint', CodeMirror.defaults.lint);
editors[0].focus();
// default to enabled
$('#enabled').checked = true;
initHooks();
setCleanGlobal();
updateTitle();
return;
>>>>>>> |
<<<<<<<
/* global moment */
var formatTimeago = Ember.Handlebars.makeBoundHelper(function (timeago) {
moment.locale('zh-cn');
=======
var formatTimeago = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) {
if (!arr || !arr.length) {
return;
}
var timeago = arr[0];
>>>>>>>
var formatTimeago = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) {
if (!arr || !arr.length) {
return;
}
moment.locale('zh-cn');
var timeago = arr[0]; |
<<<<<<<
=======
open: {
server: {
url: 'http://localhost:<%= connect.options.port %>'
},
test: {
url: 'http://localhost:<%= connect.test.options.port %>/test/e2e/runner.html'
},
docs: {
url: 'docs/index.html'
},
coverage: {
url: 'http://localhost:5555'
}
},
>>>>>>>
<<<<<<<
server: '.tmp'
=======
server: '.tmp',
docs: 'docs',
coverage: './test/coverage'
>>>>>>>
server: '.tmp',
coverage: './test/coverage'
<<<<<<<
},
open: {
server: {
url: 'http://localhost:<%= connect.options.port %>'
},
test: {
url: 'http://localhost:<%= connect.test.options.port %>'
},
dist: {
url: 'http://localhost:<%= connect.dist.options.port %>'
}
=======
},
// unit testing config
karma: {
// options {
// configFile: './test-unit.conf.js'
// },
unit: {
configFile: './test-unit.conf.js',
autoWatch: false,
singleRun: true
},
unitAuto: {
configFile: './test-unit.conf.js',
autoWatch: true,
singleRun: false
},
unitCoverage: {
configFile: './test-unit.conf.js',
autoWatch: false,
singleRun: true,
reporters: ['progress', 'coverage'],
preprocessors: {
'./app/modules/**/*.js': ['coverage']
},
coverageReporter: {
type : 'html',
dir : './test/coverage/'
}
},
travis: {
configFile: './test-unit.conf.js',
autoWatch: false,
singleRun: true,
browsers: ['PhantomJS']
}
},
watch: {
livereload: {
files: [
'<%= yeoman.app %>/components/bootstrap/{,*/}*.css',
'<%= yeoman.app %>/styles/{,*/}*.css',
'<%= yeoman.app %>/{,*/}*.html',
'{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css',
'{.tmp,<%= yeoman.app %>}/views/{,*/}*.html',
'{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js',
'<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
],
tasks: ['livereload']
},
less: {
files: [
'<%= yeoman.app %>/components/bootstrap/less/{,*/}*.less',
'<%= yeoman.app %>/styles/less/{,*/}*.less'
],
tasks: ['less']
},
unitTests: {
files: '<%= karma.unitAuto.files %>'
}
>>>>>>>
},
open: {
server: {
url: 'http://localhost:<%= connect.options.port %>'
},
test: {
url: 'http://localhost:<%= connect.test.options.port %>'
},
dist: {
url: 'http://localhost:<%= connect.dist.options.port %>'
},
coverage: {
url: 'http://localhost:<%= appConfig.test.coverage.port %>'
}
},
// unit testing config
karma: {
// options {
// configFile: './test-unit.conf.js'
// },
unit: {
configFile: '<%= appConfig.test.conf %>',
autoWatch: false,
singleRun: true
},
unitAuto: {
configFile: '<%= appConfig.test.conf %>',
autoWatch: true,
singleRun: false
},
unitCoverage: {
configFile: '<%= appConfig.test.conf %>',
autoWatch: false,
singleRun: true,
reporters: ['progress', 'coverage'],
preprocessors: {
'./app/modules/**/*.js': ['coverage']
},
coverageReporter: {
type : 'html',
dir : '<%= appConfig.test.coverage.path %>'
}
},
travis: {
configFile: '<%= appConfig.test.conf %>',
autoWatch: false,
singleRun: true,
browsers: ['PhantomJS']
} |
<<<<<<<
List: 'js/core/List',
RegExValidator: 'js/data/validator/RegExValidator'
=======
Model: 'js/data/Model',
List: 'js/core/List'
>>>>>>>
Model: 'js/data/Model',
List: 'js/core/List',
RegExValidator: 'js/data/validator/RegExValidator' |
<<<<<<<
onDelete={this.onDelete.bind(this)}
onAddition={this.onAddition.bind(this)} />
<hr />
=======
handleDelete={this.handleDelete.bind(this)}
handleAddition={this.handleAddition.bind(this)} />
<p>Output:</p>
>>>>>>>
onDelete={this.onDelete.bind(this)}
onAddition={this.onAddition.bind(this)} />
<p>Output:</p> |
<<<<<<<
handleDrag: React.PropTypes.func.isRequired,
handleChange: React.PropTypes.func,
minQueryLength: React.PropTypes.number
=======
handleDrag: React.PropTypes.func.isRequired,
allowDeleteFromEmptyInput: React.PropTypes.bool,
handleInputChange: React.PropTypes.func
>>>>>>>
handleDrag: React.PropTypes.func.isRequired,
allowDeleteFromEmptyInput: React.PropTypes.bool,
handleInputChange: React.PropTypes.func,
minQueryLength: React.PropTypes.number
<<<<<<<
autofocus: true,
inline: true
=======
autofocus: true,
allowDeleteFromEmptyInput: true
>>>>>>>
autofocus: true,
inline: true,
allowDeleteFromEmptyInput: true,
minQueryLength: 2
<<<<<<<
this.refs.input.focus();
=======
ReactDOM.findDOMNode(this.refs.input).focus();
>>>>>>>
this.refs.input.focus();
<<<<<<<
var input = this.refs.input;
=======
var input = ReactDOM.findDOMNode(this.refs.input);
>>>>>>>
var input = this.refs.input; |
<<<<<<<
const { id, query, placeholder, expanded, classNames, index } = this.props
=======
const { inputAttributes, query, placeholder, expandable, listboxId, selectedIndex } = this.props
>>>>>>>
const { id, query, placeholder, expanded, classNames, inputAttributes, index } = this.props
<<<<<<<
<div className={classNames.searchWrapper}>
<input
=======
<div className={this.props.classNames.searchInput}>
<input {...inputAttributes}
>>>>>>>
<div className={classNames.searchWrapper}>
<input
{...inputAttributes} |
<<<<<<<
<div
className={this.state.classNames.search}
onInputCapture={this.onInput.bind(this)}
onFocusCapture={this.onFocus.bind(this)}
onBlurCapture={this.onBlur.bind(this)}
onKeyDown={this.onKeyDown.bind(this)}>
=======
<div className={this.state.classNames.search}>
>>>>>>>
<div className={this.state.classNames.search}>
<<<<<<<
id={this.props.id}
=======
inputAttributes={this.props.inputAttributes}
inputEventHandlers={this.inputEventHandlers}
>>>>>>>
id={this.props.id}
inputAttributes={this.props.inputAttributes}
inputEventHandlers={this.inputEventHandlers} |
<<<<<<<
expanded={expanded}
placeholderText={this.props.placeholderText} />
<Suggestions
{...this.state}
id={this.props.id}
ref={this.suggestions}
classNames={this.props.classNames}
expanded={expanded}
=======
expandable={expandable}
placeholder={this.props.placeholder} />
<Suggestions {...this.state}
ref={(c) => { this.suggestions = c }}
listboxId={listboxId}
expandable={expandable}
noSuggestionsText={this.props.noSuggestionsText}
suggestions={this.props.suggestions}
suggestionsFilter={this.props.suggestionsFilter}
>>>>>>>
expanded={expanded}
placeholderText={this.props.placeholderText} />
<Suggestions
{...this.state}
id={this.props.id}
ref={this.suggestions}
classNames={this.props.classNames}
expanded={expanded}
<<<<<<<
placeholderText: 'Add new tag',
removeButtonText: 'Click to remove tag',
=======
placeholder: 'Add new tag',
noSuggestionsText: null,
>>>>>>>
placeholderText: 'Add new tag',
removeButtonText: 'Click to remove tag',
noSuggestionsText: null,
<<<<<<<
placeholderText: PropTypes.string,
removeButtonText: PropTypes.string,
=======
placeholder: PropTypes.string,
noSuggestionsText: PropTypes.string,
>>>>>>>
placeholderText: PropTypes.string,
removeButtonText: PropTypes.string,
noSuggestionsText: PropTypes.string, |
<<<<<<<
const DefaultSuggestionComponent = ({ item, query }) => (
<span dangerouslySetInnerHTML={{ __html: markIt(item.name, query) }} />
)
=======
function markIt (input, query) {
if (query) {
const regex = RegExp(escapeForRegExp(query), 'gi')
input = input.replace(regex, '<mark>$&</mark>')
}
return {
__html: input
}
}
function filterSuggestions (query, suggestions, length, suggestionsFilter, noSuggestionsText) {
if (!suggestionsFilter) {
const regex = new RegExp(`(?:^|\\s)${escapeForRegExp(query)}`, 'i')
suggestionsFilter = (item) => regex.test(item.name)
}
const filtered = suggestions.filter((item) => suggestionsFilter(item, query)).slice(0, length)
if (filtered.length === 0 && noSuggestionsText) {
filtered.push({ id: 0, name: noSuggestionsText, disabled: true, disableMarkIt: true })
}
return filtered
}
>>>>>>>
const DefaultSuggestionComponent = ({ item, query }) => (
<span dangerouslySetInnerHTML={{ __html: markIt(item.name, query) }} />
)
<<<<<<<
onMouseDown (item, e) {
=======
constructor (props) {
super(props)
this.state = {
options: filterSuggestions(this.props.query, this.props.suggestions, this.props.maxSuggestionsLength, this.props.suggestionsFilter, this.props.noSuggestionsText)
}
}
componentWillReceiveProps (newProps) {
this.setState({
options: filterSuggestions(newProps.query, newProps.suggestions, newProps.maxSuggestionsLength, newProps.suggestionsFilter, newProps.noSuggestionsText)
})
}
handleMouseDown (item, e) {
>>>>>>>
onMouseDown (item, e) {
<<<<<<<
onMouseDown={this.onMouseDown.bind(this, item)}>
<SuggestionComponent item={item} query={this.props.query} />
=======
onMouseDown={this.handleMouseDown.bind(this, item)}>
{item.disableMarkIt ? item.name
: <span dangerouslySetInnerHTML={markIt(item.name, this.props.query, item.markInput)} />}
>>>>>>>
onMouseDown={this.onMouseDown.bind(this, item)}>
{item.disableMarkIt ? item.name
: <SuggestionComponent item={item} query={this.props.query} />} |
<<<<<<<
// save song history in a cookie
if (shuffle) {
$.cookie('history', JSON.stringify(arr));
}
=======
$.cookie('history', JSON.stringify(arr));
$.cookie('isPlaying','true');
>>>>>>>
// save song history in a cookie
if (shuffle) {
$.cookie('history', JSON.stringify(arr));
$.cookie('isPlaying','true');
}
<<<<<<<
grid.prevSong = function (shuffle) {
if (shuffle) {
var arr = JSON.parse($.cookie('history'));
var new_id;
// extract last song from history (pop twice because current song is there also)
arr.pop();
new_id = arr.pop();
if (!new_id) {
return;
}
$.cookie('history', JSON.stringify(arr));
grid.playSong(new_id);
} else {
var number_of_rows = grid.getDataLength();
var new_row = number_of_rows - 1;
var current_row = dataView.getRowById(grid.playingSongId);
if (current_row === undefined) {
// current song is not in the grid, stop playing
stop();
return;
}
if ((current_row - 1) >= 0) {
new_row = current_row - 1;
}
grid.playSongAtRow(new_row);
=======
grid.prevSong = function () {
var arr = JSON.parse($.cookie('history'));
var new_id = arr.pop()
if (grid.playingSongId !== null){
new_id = arr.pop()
}
$.cookie('history', JSON.stringify(arr));
if (new_id == undefined){
stop();
return;
>>>>>>>
grid.prevSong = function (shuffle) {
if (shuffle) {
var arr = JSON.parse($.cookie('history'));
var new_id;
// extract last song from history (pop twice because current song is there also)
new_id = arr.pop();
if (grid.playingSongId !== null){
new_id = arr.pop();
}
if (!new_id) {
return;
}
$.cookie('history', JSON.stringify(arr));
grid.playSong(new_id);
} else {
var number_of_rows = grid.getDataLength();
var new_row = number_of_rows - 1;
var current_row = dataView.getRowById(grid.playingSongId);
if (current_row === undefined) {
// current song is not in the grid, stop playing
stop();
return;
}
if ((current_row - 1) >= 0) {
new_row = current_row - 1;
}
grid.playSongAtRow(new_row); |
<<<<<<<
var HomeAssistantLock;
var HomeAssistantGarageDoor;
=======
var HomeAssistantRollershutter;
>>>>>>>
var HomeAssistantLock;
var HomeAssistantGarageDoor;
<<<<<<<
HomeAssistantLock = require('./accessories/lock')(Service, Characteristic, communicationError);
HomeAssistantGarageDoor = require('./accessories/garage_door')(Service, Characteristic, communicationError);
=======
HomeAssistantRollershutter = require('./accessories/rollershutter')(Service, Characteristic, communicationError);
>>>>>>>
HomeAssistantLock = require('./accessories/lock')(Service, Characteristic, communicationError);
HomeAssistantGarageDoor = require('./accessories/garage_door')(Service, Characteristic, communicationError);
HomeAssistantRollershutter = require('./accessories/rollershutter')(Service, Characteristic, communicationError);
<<<<<<<
}else if (entity_type == 'lock'){
accessory = new HomeAssistantLock(that.log, entity, that)
}else if (entity_type == 'garage_door'){
accessory = new HomeAssistantGarageDoor(that.log, entity, that)
=======
}else if (entity_type == 'rollershutter'){
accessory = new HomeAssistantRollershutter(that.log, entity, that)
>>>>>>>
}else if (entity_type == 'lock'){
accessory = new HomeAssistantLock(that.log, entity, that)
}else if (entity_type == 'garage_door'){
accessory = new HomeAssistantGarageDoor(that.log, entity, that) |
<<<<<<<
...options
};
=======
wrapHeadingTextInAnchor: false,
...options,
}
>>>>>>>
wrapHeadingTextInAnchor: false,
...options
}; |
<<<<<<<
import colorway_serika from "./colorway_serika.json";
=======
import colorway_shoko from "./colorway_shoko.json";
>>>>>>>
import colorway_serika from "./colorway_serika.json";
import colorway_shoko from "./colorway_shoko.json";
<<<<<<<
1976: colorway_1976,
serika: colorway_serika,
=======
"1976": colorway_1976,
shoko: colorway_shoko,
>>>>>>>
serika: colorway_serika,
"1976": colorway_1976,
shoko: colorway_shoko, |
<<<<<<<
store: null,
insertCss: styles => styles._insertCss(),
=======
insertCss: styles => styles._insertCss(), // eslint-disable-line no-underscore-dangle
>>>>>>>
store: null,
insertCss: styles => styles._insertCss(), // eslint-disable-line no-underscore-dangle |
<<<<<<<
import parse from "html-react-parser";
=======
import { withRouter } from 'react-router-dom'
import { rsvpYes } from '../../../actions/eventAction'
>>>>>>>
import parse from "html-react-parser";
import { withRouter } from 'react-router-dom'
import { rsvpYes } from '../../../actions/eventAction' |
<<<<<<<
=======
// eslint-disable-next-line no-underscore-dangle
theme._insertCss();
>>>>>>> |
<<<<<<<
script: PropTypes.string,
chunk: PropTypes.string,
state: PropTypes.object,
=======
scripts: PropTypes.arrayOf(PropTypes.string.isRequired),
>>>>>>>
scripts: PropTypes.arrayOf(PropTypes.string.isRequired),
state: PropTypes.object,
<<<<<<<
const { title, description, style, script, chunk, state, children } = this.props;
=======
const { title, description, style, scripts, children } = this.props;
>>>>>>>
const { title, description, style, scripts, state, children } = this.props;
<<<<<<<
{state && (
<script
dangerouslySetInnerHTML={{ __html:
`window.APP_STATE=${serialize(state, { isJSON: true })}` }}
/>
)}
{script && <script src={script} />}
{chunk && <script src={chunk} />}
=======
{scripts && scripts.map(script => <script key={script} src={script} />)}
>>>>>>>
{state && (
<script
dangerouslySetInnerHTML={{ __html:
`window.APP_STATE=${serialize(state, { isJSON: true })}` }}
/>
)}
{scripts && scripts.map(script => <script key={script} src={script} />)} |
<<<<<<<
=======
import queryString from 'query-string';
>>>>>>>
<<<<<<<
import { ErrorReporter, deepForceUpdate } from './core/devUtils';
import theme from './styles/theme.scss';
// eslint-disable-next-line no-underscore-dangle
theme._insertCss();
=======
import history from './history';
import { updateMeta } from './DOMUtils';
import { ErrorReporter, deepForceUpdate } from './devUtils';
/* eslint-disable global-require */
>>>>>>>
import { ErrorReporter, deepForceUpdate } from './core/devUtils';
import theme from './styles/theme.scss';
// eslint-disable-next-line no-underscore-dangle
theme._insertCss();
<<<<<<<
=======
let router = require('./router').default;
>>>>>>>
<<<<<<<
=======
// Traverses the list of routes in the order they are defined until
// it finds the first route that matches provided URL path string
// and whose action method returns anything other than `undefined`.
const route = await router.resolve({
...context,
path: location.pathname,
query: queryString.parse(location.search),
});
>>>>>>>
<<<<<<<
module.hot.accept('./components/App', () => {
=======
module.hot.accept('./router', () => {
router = require('./router').default;
>>>>>>>
module.hot.accept('./components/App', () => { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.