conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
output = "> " + fromUser + " sends karma to " + toUserMessage;
=======
output = "> " + fromUser + " sends brownie points to " + toUser;
>>>>>>>
output = "> " + fromUser + " sends brownie points to " + toUserMessage;
<<<<<<<
=======
var apiPath = `/api/users/give-brownie-points?receiver=${toUser}&giver=${fromUser}`;
var options = { method: 'POST' };
HttpWrap.callApi(apiPath, options, function(apiRes) {
showInfo(input, bot, apiRes);
});
>>>>>>> |
<<<<<<<
extensions: ['.ts', '.js', '.tsx', '.scss']
=======
extensions: ['.ts', '.tsx', '.scss'],
alias: {
tslib: path.join(__dirname, './src/entries/chunks/helpers.ts'),
}
>>>>>>>
extensions: ['.ts', '.js', '.tsx', '.scss'],
alias: {
tslib: path.join(__dirname, './src/entries/chunks/helpers.ts'),
} |
<<<<<<<
work: function (font_id, glyphs) {
=======
work: function (font_id, config, user) {
>>>>>>>
work: function (font_id, config) {
<<<<<<<
glyphs: glyphs
=======
fontname: config.font.fontname,
glyphs: config.glyphs,
user: user
>>>>>>>
fontname: config.font.fontname,
glyphs: config.glyphs,
<<<<<<<
glyphs: glyphs.length,
time: (times[2] - times[0]) / 1000
=======
glyphs: config.glyphs.length,
time: (times[2] - times[0]) / 1000,
user: user
>>>>>>>
glyphs: config.glyphs.length,
time: (times[2] - times[0]) / 1000,
<<<<<<<
var self = this, glyphs = get_glyphs_config(params), font_id, errmsg;
=======
var self = this, font = get_font_config(params), font_id, user, errmsg;
>>>>>>>
var self = this, font = get_font_config(params), font_id, errmsg;
<<<<<<<
font_id = get_download_id(glyphs);
=======
font_id = get_download_id(font);
user = this.__raw__.socket.handshake.address.address;
>>>>>>>
font_id = get_download_id(font);
<<<<<<<
worker_id: job_mgr.enqueue('generate-font', font_id, glyphs)
=======
worker_id: job_mgr.enqueue('generate-font', font_id, font, user)
>>>>>>>
worker_id: job_mgr.enqueue('generate-font', font_id, font) |
<<<<<<<
// const SvgPath = require('svgpath');
=======
const ttf2eot = require('ttf2eot');
const ttf2woff = require('ttf2woff');
const wawoff2 = require('wawoff2');
>>>>>>>
<<<<<<<
const jade = require('jade');
=======
const pug = require('pug');
const b64 = require('base64-js');
>>>>>>>
const pug = require('pug');
const b64 = require('base64-js');
<<<<<<<
//'demo.jade': 'demo/index.html',
//'index.jade': 'index.html',
//'bower.jade': 'bower.json',
//'css/css.jade': 'css/${FONTNAME}.css',
//'css/css-ie7.jade': 'css/${FONTNAME}-ie7.css',
//'css/css-codes.jade': 'css/${FONTNAME}-codes.css',
//'css/css-ie7-codes.jade': 'css/${FONTNAME}-ie7-codes.css',
//'css/css-embedded.jade': 'css/${FONTNAME}-embedded.css',
//'LICENSE.jade': 'LICENSE.txt',
//'css/animation.css': 'css/animation.css',
//'README.txt': 'README.txt'
=======
'demo.pug': 'demo.html',
'css/css.pug': 'css/${FONTNAME}.css',
'css/css-ie7.pug': 'css/${FONTNAME}-ie7.css',
'css/css-codes.pug': 'css/${FONTNAME}-codes.css',
'css/css-ie7-codes.pug': 'css/${FONTNAME}-ie7-codes.css',
'css/css-embedded.pug': 'css/${FONTNAME}-embedded.css',
'LICENSE.pug': 'LICENSE.txt',
'css/animation.css': 'css/animation.css',
'README.txt': 'README.txt'
>>>>>>>
//'demo.pug': 'demo/index.html',
//'index.pug': 'index.html',
//'bower.pug': 'bower.json',
//'css/css.pug': 'css/${FONTNAME}.css',
//'css/css-ie7.pug': 'css/${FONTNAME}-ie7.css',
//'css/css-codes.pug': 'css/${FONTNAME}-codes.css',
//'css/css-ie7-codes.pug': 'css/${FONTNAME}-ie7-codes.css',
//'css/css-embedded.pug': 'css/${FONTNAME}-embedded.css',
//'LICENSE.pug': 'LICENSE.txt',
//'css/animation.css': 'css/animation.css',
//'README.txt': 'README.txt'
<<<<<<<
function buildFlutterConfig(originalBuilderConfig) {
let flutterBuilderConfig = _.clone(originalBuilderConfig, true);
for (let i = 0; i < flutterBuilderConfig.glyphs.length; i++) {
let glyph = flutterBuilderConfig.glyphs[i];
flutterBuilderConfig.glyphs[i].code16 = glyph.code.toString(16);
flutterBuilderConfig.glyphs[i].dart = glyph.css.replace(/[^A-Za-z0-9_]/g, '_');
if (_.includes(dart_reserved, flutterBuilderConfig.glyphs[i].dart)) {
flutterBuilderConfig.glyphs[i].dart += '_icon';
}
}
return flutterBuilderConfig;
}
module.exports = co.wrap(function* fontWorker(taskInfo) {
=======
module.exports = async function fontWorker(taskInfo) {
>>>>>>>
function buildFlutterConfig(originalBuilderConfig) {
let flutterBuilderConfig = _.clone(originalBuilderConfig, true);
for (let i = 0; i < flutterBuilderConfig.glyphs.length; i++) {
let glyph = flutterBuilderConfig.glyphs[i];
flutterBuilderConfig.glyphs[i].code16 = glyph.code.toString(16);
flutterBuilderConfig.glyphs[i].dart = glyph.css.replace(/[^A-Za-z0-9_]/g, '_');
if (_.includes(dart_reserved, flutterBuilderConfig.glyphs[i].dart)) {
flutterBuilderConfig.glyphs[i].dart += '_icon';
}
}
return flutterBuilderConfig;
}
module.exports = async function fontWorker(taskInfo) {
<<<<<<<
yield rimraf(taskInfo.tmpDir);
yield mkdirp(taskInfo.tmpDir);
// yield mkdirp(path.join(taskInfo.tmpDir, 'demo'));
yield mkdirp(path.join(taskInfo.tmpDir, 'fonts'));
//yield mkdirp(path.join(taskInfo.tmpDir, 'css'));
// yield mkdirp(path.join(taskInfo.tmpDir, `${fontname}-iconset-svg`));
=======
await rimraf(taskInfo.tmpDir);
await mkdirp(taskInfo.tmpDir);
await mkdirp(path.join(taskInfo.tmpDir, 'font'));
await mkdirp(path.join(taskInfo.tmpDir, 'css'));
>>>>>>>
await rimraf(taskInfo.tmpDir);
await mkdirp(taskInfo.tmpDir);
// yield mkdirp(path.join(taskInfo.tmpDir, 'demo'));
await mkdirp(path.join(taskInfo.tmpDir, 'fonts'));
//yield mkdirp(path.join(taskInfo.tmpDir, 'css'));
// yield mkdirp(path.join(taskInfo.tmpDir, `${fontname}-iconset-svg`));
<<<<<<<
yield mz.fs.writeFile(files.config, configOutput, 'utf8');
// yield mz.fs.writeFile(files.svg, svgOutput, 'utf8');
// yield mz.fs.writeFile(files.polymer, polymerOutput, 'utf8');
yield mz.fs.writeFile(files.flutter, flutterOutput, 'utf8');
=======
await mz.fs.writeFile(files.config, configOutput, 'utf8');
await mz.fs.writeFile(files.svg, svgOutput, 'utf8');
>>>>>>>
await mz.fs.writeFile(files.config, configOutput, 'utf8');
// yield mz.fs.writeFile(files.svg, svgOutput, 'utf8');
// yield mz.fs.writeFile(files.polymer, polymerOutput, 'utf8');
await mz.fs.writeFile(files.flutter, flutterOutput, 'utf8');
<<<<<<<
// if (max_segments <= 500 && taskInfo.builderConfig.hinting) {
// yield mz.fs.rename(files.ttf, files.ttfUnhinted);
// yield mz.child_process.execFile('ttfautohint', [
// '--no-info',
// '--windows-compatibility',
// '--symbol',
// // temporary workaround for #464
// // https://github.com/fontello/fontello/issues/464#issuecomment-202244651
// '--fallback-script=latn',
// files.ttfUnhinted,
// files.ttf
// ], { cwd: taskInfo.cwdDir });
// yield mz.fs.unlink(files.ttfUnhinted);
// }
=======
if (max_segments <= 500 && taskInfo.builderConfig.hinting) {
await mz.fs.rename(files.ttf, files.ttfUnhinted);
await mz.child_process.execFile('ttfautohint', [
'--no-info',
'--windows-compatibility',
'--symbol',
// temporary workaround for #464
// https://github.com/fontello/fontello/issues/464#issuecomment-202244651
'--fallback-script=latn',
files.ttfUnhinted,
files.ttf
], { cwd: taskInfo.cwdDir });
await mz.fs.unlink(files.ttfUnhinted);
}
>>>>>>>
// if (max_segments <= 500 && taskInfo.builderConfig.hinting) {
// await mz.fs.rename(files.ttf, files.ttfUnhinted);
// await mz.child_process.execFile('ttfautohint', [
// '--no-info',
// '--windows-compatibility',
// '--symbol',
// // temporary workaround for #464
// // https://github.com/fontello/fontello/issues/464#issuecomment-202244651
// '--fallback-script=latn',
// files.ttfUnhinted,
// files.ttf
// ], { cwd: taskInfo.cwdDir });
// await mz.fs.unlink(files.ttfUnhinted);
// }
<<<<<<<
//let ttfOutput = new Uint8Array(yield mz.fs.readFile(files.ttf));
=======
let ttfOutput = new Uint8Array(await mz.fs.readFile(files.ttf));
>>>>>>>
//let ttfOutput = new Uint8Array(await mz.fs.readFile(files.ttf));
<<<<<<<
//yield mz.fs.writeFile(files.eot, new Buffer(eotOutput));
=======
await mz.fs.writeFile(files.eot, eotOutput);
>>>>>>>
//await mz.fs.writeFile(files.eot, eotOutput);
<<<<<<<
//yield mz.fs.writeFile(files.woff, new Buffer(woffOutput));
=======
await mz.fs.writeFile(files.woff, woffOutput);
>>>>>>>
// await mz.fs.writeFile(files.woff, woffOutput);
<<<<<<<
//yield mz.fs.writeFile(files.woff2, ttf2woff2(ttfOutput));
=======
let woff2Output = await wawoff2.compress(ttfOutput);
await mz.fs.writeFile(files.woff2, woff2Output);
>>>>>>>
// let woff2Output = await wawoff2.compress(ttfOutput);
// await mz.fs.writeFile(files.woff2, woff2Output); |
<<<<<<<
"lastUpdated": "2019-12-24 03:39:37"
=======
"lastUpdated": "2019-12-24 01:55:44"
>>>>>>>
"lastUpdated": "2019-12-24 07:35:29"
<<<<<<<
// var items = getItemsFromSearchResults(doc, url);
=======
>>>>>>>
<<<<<<<
} else if (url.match(/kns\/brief\/(Default_Result|result)\.aspx/i)) {
=======
} else if (url.includes("kns/brief/result.aspx")) {
>>>>>>>
} else if (url.match(/kns\/brief\/(default_)?result\.aspx/i)) {
<<<<<<<
Z.debug(itemInfo);
if (!items) return false; // no items
=======
// Z.debug(itemInfo);
if (!items) return false; // no items
>>>>>>>
Z.debug(itemInfo);
if (!items) return false; // no items
<<<<<<<
=======
// add PDF/CAJ attachments
// var loginStatus = loginDetect(doc);
var loginStatus = true;
var fatTitle = newItem.title + " " + newItem.date;
// Z.debug('loginStatus: '+loginStatus);
if (itemInfo && loginStatus) { // search result
newItem.attachments = [{
title: "Full Text PDF",
mimeType: "application/pdf",
url: itemInfo[fatTitle]
}];
} else if (loginStatus && (!itemInfo)) { // detail page
newItem.attachments = getAttachments(doc, newItem);
}
>>>>>>> |
<<<<<<<
"display/shape.js",
=======
"display/mapsprite.js",
>>>>>>>
"display/shape.js",
"display/mapsprite.js", |
<<<<<<<
describe('window.webContents.send(channel, args...)', function() {
it('throws an error when the channel is missing', function() {
assert.throws(function() {
w.webContents.send();
}, 'Missing required channel argument');
assert.throws(function() {
w.webContents.send(null);
}, 'Missing required channel argument');
});
});
=======
describe('dev tool extensions', function () {
it('serializes the registered extensions on quit', function () {
var extensionName = 'foo';
var extensionPath = path.join(__dirname, 'fixtures', 'devtools-extensions', extensionName);
var serializedPath = path.join(app.getPath('userData'), 'DevTools Extensions');
BrowserWindow.addDevToolsExtension(extensionPath);
app.emit('will-quit');
assert.deepEqual(JSON.parse(fs.readFileSync(serializedPath)), [extensionPath]);
BrowserWindow.removeDevToolsExtension(extensionName);
app.emit('will-quit');
assert.equal(fs.existsSync(serializedPath), false);
});
});
>>>>>>>
describe('window.webContents.send(channel, args...)', function() {
it('throws an error when the channel is missing', function() {
assert.throws(function() {
w.webContents.send();
}, 'Missing required channel argument');
assert.throws(function() {
w.webContents.send(null);
}, 'Missing required channel argument');
});
});
describe('dev tool extensions', function () {
it('serializes the registered extensions on quit', function () {
var extensionName = 'foo';
var extensionPath = path.join(__dirname, 'fixtures', 'devtools-extensions', extensionName);
var serializedPath = path.join(app.getPath('userData'), 'DevTools Extensions');
BrowserWindow.addDevToolsExtension(extensionPath);
app.emit('will-quit');
assert.deepEqual(JSON.parse(fs.readFileSync(serializedPath)), [extensionPath]);
BrowserWindow.removeDevToolsExtension(extensionName);
app.emit('will-quit');
assert.equal(fs.existsSync(serializedPath), false);
});
}); |
<<<<<<<
assert.deepEqual(message.storageItems, {foo: 'bar'})
=======
assert.equal(message.tabId, w.webContents.id)
assert.equal(message.i18nString, 'foo - bar (baz)')
>>>>>>>
assert.equal(message.tabId, w.webContents.id)
assert.equal(message.i18nString, 'foo - bar (baz)')
assert.deepEqual(message.storageItems, {foo: 'bar'}) |
<<<<<<<
/*! angular-bootstrap-show-errors (version 1.0.2) 2014-09-10 */
(function(){angular.module("ui.bootstrap.showErrors",[]).directive("showErrors",["$timeout",function(a){var b;return b=function(b,c,d,e){var f,g,h,i;if(f=!1,g=c[0].querySelector("[name]"),i=angular.element(g),h=i.attr("name"),!h)throw"show-errors element has no child input elements with a 'name' attribute";return i.bind("blur",function(){return f=!0,c.toggleClass("has-error",e[h].$invalid)}),b.$watch(function(){return e[h].$invalid},function(a){return f||!a?c.toggleClass("has-error",a):void 0}),b.$on("show-errors-check-validity",function(){return c.toggleClass("has-error",e[h].$invalid)}),b.$on("show-errors-reset",function(){return a(function(){return c.removeClass("has-error"),f=!1},0,!1)})},{restrict:"A",require:"^form",compile:function(a){if(!a.hasClass("form-group"))throw"show-errors element does not have the 'form-group' class";return b}}}])}).call(this);
=======
/*! angular-bootstrap-show-errors (version 1.0.2) 2014-09-03 */
(function(){angular.module("ui.bootstrap.showErrors",[]).directive("showErrors",["$timeout",function(a){var b;return b=function(b,c,d,e){var f,g,h,i;if(f=!1,g=c[0].querySelector("[name]"),i=angular.element(g),h=i.attr("name"),!h)throw"show-errors element has no child input elements with a 'name' attribute";return i.bind("blur",function(){return f=!0,c.toggleClass("has-error",e[h].$invalid)}),b.$watch(function(){return e[h]&&e[h].$invalid},function(a){return f||!a?c.toggleClass("has-error",a):void 0}),b.$on("show-errors-check-validity",function(){return c.toggleClass("has-error",e[h].$invalid)}),b.$on("show-errors-reset",function(){return a(function(){return c.removeClass("has-error"),f=!1},0,!1)})},{restrict:"A",require:"^form",compile:function(a){if(!a.hasClass("form-group"))throw"show-errors element does not have the 'form-group' class";return b}}}])}).call(this);
>>>>>>>
/*! angular-bootstrap-show-errors (version 1.0.2) 2014-09-10 */
(function(){angular.module("ui.bootstrap.showErrors",[]).directive("showErrors",["$timeout",function(a){var b;return b=function(b,c,d,e){var f,g,h,i;if(f=!1,g=c[0].querySelector("[name]"),i=angular.element(g),h=i.attr("name"),!h)throw"show-errors element has no child input elements with a 'name' attribute";return i.bind("blur",function(){return f=!0,c.toggleClass("has-error",e[h].$invalid)}),b.$watch(function(){return e[h]&&e[h].$invalid},function(a){return f||!a?c.toggleClass("has-error",a):void 0}),b.$on("show-errors-check-validity",function(){return c.toggleClass("has-error",e[h].$invalid)}),b.$on("show-errors-reset",function(){return a(function(){return c.removeClass("has-error"),f=!1},0,!1)})},{restrict:"A",require:"^form",compile:function(a){if(!a.hasClass("form-group"))throw"show-errors element does not have the 'form-group' class";return b}}}])}).call(this); |
<<<<<<<
function createEntry(node, lang) {
=======
// Matches characters outside of the Latin-1 character set
var nonLatin1 = /[^\x01-\xFF]/;
// Unicode bidi isolation characters
var FSI = '\u2068';
var PDI = '\u2069';
function createEntry(node, env) {
>>>>>>>
// Matches characters outside of the Latin-1 character set
var nonLatin1 = /[^\x01-\xFF]/;
// Unicode bidi isolation characters
var FSI = '\u2068';
var PDI = '\u2069';
function createEntry(node, lang) {
<<<<<<<
function subPlaceable(ctx, lang, args, id) {
=======
function subPlaceable(locals, args, env, id) {
>>>>>>>
function subPlaceable(locals, ctx, lang, args, id) {
<<<<<<<
var placeable = subPlaceable(ctx, lang, args, cur.v);
=======
var placeable = subPlaceable(locals, args, env, cur.v);
>>>>>>>
var placeable = subPlaceable(locals, ctx, lang, args, cur.v);
<<<<<<<
return interpolate(locals, ctx, lang, args, expr);
=======
locals.contextIsNonLatin1 = expr.some(function($_) {
return typeof($_) === 'string' && $_.match(nonLatin1);
});
return interpolate(locals, args, env, expr);
>>>>>>>
locals.contextIsNonLatin1 = expr.some(function($_) {
return typeof($_) === 'string' && $_.match(nonLatin1);
});
return interpolate(locals, ctx, lang, args, expr); |
<<<<<<<
/* global Env, io */
/* global translateFragment, translateElement */
=======
/* global Locale, Context, L10nError, Resolver, PropertiesParser */
/* global getPluralRule, rePlaceables */
/* global translateDocument, io */
/* global translateFragment, localizeElement, translateElement */
>>>>>>>
/* global Env, io */
/* global translateFragment, translateElement */
<<<<<<<
=======
language: {
set code(lang) {
navigator.mozL10n.ctx.requestLocales(lang);
},
get code() {
return navigator.mozL10n.ctx.supportedLocales[0];
},
get direction() {
return getDirection(navigator.mozL10n.ctx.supportedLocales[0]);
}
},
qps: PSEUDO_STRATEGIES,
_getInternalAPI: function() {
return {
Error: L10nError,
Context: Context,
Locale: Locale,
Resolver: Resolver,
getPluralRule: getPluralRule,
rePlaceables: rePlaceables,
translateDocument: translateDocument,
onManifestInjected: onManifestInjected,
onMetaInjected: onMetaInjected,
PropertiesParser: PropertiesParser,
walkContent: walkContent
};
}
};
>>>>>>> |
<<<<<<<
import FTLParser from '../../lib/format/ftl/ast/parser';
import {default as FTLEntriesParser } from '../../lib/format/ftl/entries/parser';
=======
import FTLASTParser from '../../lib/format/ftl/ast/parser';
>>>>>>>
import FTLASTParser from '../../lib/format/ftl/ast/parser';
import {default as FTLEntriesParser } from '../../lib/format/ftl/entries/parser';
<<<<<<<
export { PropertiesParser, L20nParser, FTLParser, FTLEntriesParser };
=======
export { format } from '../../lib/resolver';
export { PropertiesParser, L20nParser, FTLASTParser };
export * from '../../lib/mocks';
>>>>>>>
export { format } from '../../lib/resolver';
export { PropertiesParser, L20nParser, FTLASTParser, FTLEntriesParser };
export * from '../../lib/mocks'; |
<<<<<<<
const val = bundle.formatPattern(msg.value, args, errs);
assert.equal(val, 'MISSING()');
=======
const val = bundle.format(msg, args, errs);
assert.equal(val, '{MISSING()}');
>>>>>>>
const val = bundle.formatPattern(msg.value, args, errs);
assert.equal(val, '{MISSING()}'); |
<<<<<<<
var ctx = l10n.require(['pl'], [path('fixtures/{locale}.properties')]);
ctx.ready.then(function(supported) {
=======
var ctx = l10n.createContext([path('fixtures/{locale}.properties')]);
ctx.ready.then(function(supported) {
>>>>>>>
var ctx = l10n.createContext(
['pl'], [path('fixtures/{locale}.properties')]);
ctx.ready.then(function(supported) {
<<<<<<<
var ctx = l10n.require(['pl'], [path('fixtures/{locale}.properties')]);
ctx.get('foo').then(function(val) {
=======
var ctx = l10n.createContext([path('fixtures/{locale}.properties')]);
ctx.formatEntity('foo').then(function(val) {
assert.strictEqual(val, 'Foo pl');
}).then(done, done);
});
});
describe('ctx.formatEntity racing against a lang change', function() {
it('returns the value from the former chain', function(done) {
var ctx = l10n.createContext([path('fixtures/{locale}.properties')]);
l10n.requestLanguages(['en-US']);
ctx.formatEntity('foo').then(function(val) {
>>>>>>>
var ctx = l10n.createContext(
['pl'], [path('fixtures/{locale}.properties')]);
ctx.formatEntity('foo').then(function(val) {
<<<<<<<
=======
it('returns the value from the new chain', function(done) {
var ctx = l10n.createContext([path('fixtures/{locale}.properties')]);
l10n.requestLanguages(['en-US']).then(function() {
return ctx.formatEntity('foo').then(function(val) {
assert.strictEqual(val, 'Foo en-US');
});
}).then(done, done);
});
>>>>>>>
<<<<<<<
ctx2 = l10n.require(['pl'], [path('fixtures/{locale}.properties')]);
=======
ctx2 = l10n.createContext([path('fixtures/{locale}.properties')]);
>>>>>>>
ctx2 = l10n.createContext(
['pl'], [path('fixtures/{locale}.properties')]); |
<<<<<<<
this.ctx = this.env.require(langs, this.resources);
return this.ctx.ready.then(translateDocument.bind(this));
=======
return this.env.requestLanguages(langs).then(
translateDocument.bind(this));
>>>>>>>
this.ctx = this.env.createContext(langs, this.resources);
return this.ctx.ready.then(translateDocument.bind(this));
<<<<<<<
navigator.mozL10n.request(navigator.languages);
=======
navigator.mozL10n.ctx = navigator.mozL10n.env.createContext(
navigator.mozL10n.resources);
>>>>>>>
navigator.mozL10n.request(navigator.languages);
<<<<<<<
=======
navigator.mozL10n.ctx.ready.then(
translateDocument.bind(navigator.mozL10n));
>>>>>>> |
<<<<<<<
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, '$arg');
=======
const val = bundle.format(msg, {}, errs);
assert.equal(val, '{$arg}');
>>>>>>>
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, '{$arg}');
<<<<<<<
const val = bundle.formatPattern(msg.value, { arg: [1, 2, 3] }, errs);
assert.equal(val, '$arg');
=======
const val = bundle.format(msg, { arg: [1, 2, 3] }, errs);
assert.equal(val, '{$arg}');
>>>>>>>
const val = bundle.formatPattern(msg.value, { arg: [1, 2, 3] }, errs);
assert.equal(val, '{$arg}');
<<<<<<<
const val = bundle.formatPattern(msg.value, { arg: { prop: 1 } }, errs);
assert.equal(val, '$arg');
=======
const val = bundle.format(msg, { arg: { prop: 1 } }, errs);
assert.equal(val, '{$arg}');
>>>>>>>
const val = bundle.formatPattern(msg.value, { arg: { prop: 1 } }, errs);
assert.equal(val, '{$arg}');
<<<<<<<
const val = bundle.formatPattern(msg.value, { arg: true }, errs);
assert.equal(val, '$arg');
=======
const val = bundle.format(msg, { arg: true }, errs);
assert.equal(val, '{$arg}');
>>>>>>>
const val = bundle.formatPattern(msg.value, { arg: true }, errs);
assert.equal(val, '{$arg}');
<<<<<<<
const val = bundle.formatPattern(msg.value, { arg: undefined }, errs);
assert.equal(val, '$arg');
=======
const val = bundle.format(msg, { arg: undefined }, errs);
assert.equal(val, '{$arg}');
>>>>>>>
const val = bundle.formatPattern(msg.value, { arg: undefined }, errs);
assert.equal(val, '{$arg}');
<<<<<<<
const val = bundle.formatPattern(msg.value, { arg: null }, errs);
assert.equal(val, '$arg');
=======
const val = bundle.format(msg, { arg: null }, errs);
assert.equal(val, '{$arg}');
>>>>>>>
const val = bundle.formatPattern(msg.value, { arg: null }, errs);
assert.equal(val, '{$arg}');
<<<<<<<
const val = bundle.formatPattern(msg.value, { arg: () => null }, errs);
assert.equal(val, '$arg');
=======
const val = bundle.format(msg, { arg: () => null }, errs);
assert.equal(val, '{$arg}');
>>>>>>>
const val = bundle.formatPattern(msg.value, { arg: () => null }, errs);
assert.equal(val, '{$arg}'); |
<<<<<<<
import { prioritizeLocales } from '../../intl/locale';
import { valueFromContext } from '../../lib/format';
import { ChromeLocalizationObserver } from '../../bindings/observer/chrome';
import { XULLocalization, contexts } from '../../bindings/dom/xul';
import { ResourceBundle } from './resourcebundle';
import { documentReady, getXULResourceLinks, observe } from './util';
=======
import { documentReady, getXULResourceLinks } from './util';
import { GeckoLocalization } from './localization';
>>>>>>>
import { valueFromContext } from '../../lib/format';
import { ChromeLocalizationObserver } from '../../bindings/observer/chrome';
import { XULLocalization, contexts } from '../../bindings/dom/xul';
import { documentReady, getXULResourceLinks, observe } from './util';
<<<<<<<
Components.utils.import('resource://gre/modules/IntlMessageContext.jsm');
=======
Components.utils.import('resource://gre/modules/L10nService.jsm');
>>>>>>>
Components.utils.import('resource://gre/modules/L10nService.jsm');
Components.utils.import('resource://gre/modules/IntlMessageContext.jsm'); |
<<<<<<<
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {arg: 1}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {arg: 1}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {arg: 1}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {arg: 1}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {arg: 1}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {arg: 1}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {arg: 5}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {arg: 5}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {arg: 5}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {arg: 5}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {arg: 5}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {arg: 5}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {arg: 5}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {arg: 5}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {arg: 5}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {arg: 5}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {arg: 5}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {arg: 5}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {arg: 5}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {arg: 5}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {arg: 5}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {arg: 5}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {arg: 5}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {arg: 5}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {arg: 5}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {arg: 5}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {arg: 5}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {arg: 5}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {arg: 5}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {arg: 5}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {}, errs);
assert.equal(val, "Foo {$arg}");
<<<<<<<
const val = bundle.formatPattern(msg.value, {arg: 5}, errs);
assert.equal(val, "Foo $arg");
=======
const val = bundle.format(msg, {arg: 5}, errs);
assert.equal(val, "Foo {$arg}");
>>>>>>>
const val = bundle.formatPattern(msg.value, {arg: 5}, errs);
assert.equal(val, "Foo {$arg}"); |
<<<<<<<
"arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole",
"arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess",
{"Ref":"EsPolicy"},
=======
{"Ref":"QueryPolicy"},
>>>>>>>
"arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole",
"arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess",
{"Ref":"EsPolicy"},
{"Ref":"QueryPolicy"}, |
<<<<<<<
"PublicOrPrivate",
"XraySetting"
=======
"ElasticSearchNodeCount",
"PublicOrPrivate"
>>>>>>>
"ElasticSearchNodeCount",
"PublicOrPrivate",
"XraySetting" |
<<<<<<<
});
app.del('/', function(req, res, next) {
return res.clearCookie('token').send(200);
=======
signin(req, res, next);
});
function signin(req, res, next) {
auth(req.body.email, req.body.password, function (err, user, info) {
if (err) {
return res.json(200, { error: t(err.message) });
}
if (!user) {
return res.json(200, { error: t(info.message) });
}
if (!user.emailValidated) {
return res.json(200, { error: t('signin.error.email-not-valid') });
}
if (user.disabledAt) {
return res.json(200, { error: t('signin.account-disabled') });
}
return jwt.signin(user, req, res);
});
}
app.del('/', function(req, res, next) {
return res.clearCookie('token').send(200);
>>>>>>>
signin(req, res, next);
});
function signin(req, res, next) {
auth(req.body.email, req.body.password, function (err, user, info) {
if (err) {
return res.json(200, { error: t(err.message) });
}
if (!user) {
return res.json(200, { error: t(info.message) });
}
if (!user.emailValidated) {
return res.json(200, { error: t('signin.error.email-not-valid') });
}
if (user.disabledAt) {
return res.json(200, { error: t('signin.account-disabled') });
}
return jwt.signin(user, req, res);
});
}
app.del('/', function(req, res, next) {
return res.clearCookie('token').send(200);
});
app.del('/', function(req, res, next) {
return res.clearCookie('token').send(200); |
<<<<<<<
'.gm_room_list': {
'list-style': 'none',
'text-align': 'left',
'font-size': '11px',
'column-count': '3',
'-moz-column-count': '3',
'-webkit-column-count': '3'
},
'.gm_room_list li a': {
'display': 'block',
'padding': '2px 8px'
},
'.gm_room_list li a:hover': {
'background-color': '#eee'
}
=======
'.gm_room_list': {
'list-style': 'none',
'text-align': 'left',
'font-size': '11px',
'column-count': '3',
'-moz-column-count': '3',
'-webkit-column-count': '3'
},
'.gm_room_list li a' : {
'display': 'block',
'padding': '4px 8px'
},
'.gm_room_list li a:hover': {
'background-color': '#eee'
},
'.gm_room_list.profile li img': {
'margin-right': '4px'
}
});
>>>>>>>
'.gm_room_list': {
'list-style': 'none',
'text-align': 'left',
'font-size': '11px',
'column-count': '3',
'-moz-column-count': '3',
'-webkit-column-count': '3'
},
'.gm_room_list li a': {
'display': 'block',
'padding': '4px 8px'
},
'.gm_room_list li a:hover': {
'background-color': '#eee'
},
'.gm_room_list.profile li img': {
'margin-right': '4px'
} |
<<<<<<<
// @include http://chat.meta.stackoverflow.com/rooms/*
// @include http://chat.stackexchange.com/rooms/*
// @include http://chat.stackoverflow.com/rooms/*
// @include http://chat.superuser.com/rooms/*
// @include http://chat.serverfault.com/rooms/*
// @include http://chat.askubuntu.com/rooms/*
// @author @rchern
=======
// @include http://chat.meta.stackoverflow.com/rooms/*
// @include http://chat.stackexchange.com/rooms/*
// @include http://chat.stackoverflow.com/rooms/*
// @include http://chat.superuser.com/rooms/*
// @include http://chat.serverfault.com/rooms/*
// @include http://chat.askubuntu.com/rooms/*
// @author @rchern
>>>>>>>
// @include http://chat.meta.stackoverflow.com/rooms/*
// @include http://chat.stackexchange.com/rooms/*
// @include http://chat.stackoverflow.com/rooms/*
// @include http://chat.superuser.com/rooms/*
// @include http://chat.serverfault.com/rooms/*
// @include http://chat.askubuntu.com/rooms/*
// @author @rchern
<<<<<<<
=======
'68': 'del',
'69': 'edit',
'81': 'quote',
'82': 'reply',
'83': 'star',
'72': 'history',
>>>>>>>
<<<<<<<
var monologue = selected.closest('.monologue'),
selectedTopOffset = monologue.offset().top,
scrollTopOffset = $(document).scrollTop();
=======
var monologue = selected.closest('.monologue');
selectedTopOffset = monologue.offset().top,
scrollTopOffset = $(document).scrollTop();
>>>>>>>
var monologue = selected.closest('.monologue'),
selectedTopOffset = monologue.offset().top,
scrollTopOffset = $(document).scrollTop();
<<<<<<<
var action = (!event.ctrlKey ? Navigation._actions : $.extend({}, Navigation._actions, Navigation._actions.ctrl))[event.which],
message = selected[0].id.replace("message-", ""),
parent = selected.data('info').parent_id,
replied = null,
command = action ? action.command : null;
=======
var command = (!event.ctrlKey ? Navigation._actions : Navigation._actions.ctrl)[event.which],
message = selected[0].id.replace("message-", "");
>>>>>>>
var action = (!event.ctrlKey ? Navigation._actions : $.extend({}, Navigation._actions, Navigation._actions.ctrl))[event.which],
message = selected[0].id.replace("message-", ""),
parent = selected.data('info').parent_id,
replied = null,
command = action ? action.command : null;
<<<<<<<
.wrap('<li />')
.parent()
.appendTo(ul);
=======
.wrap('<li />')
.parent()
.appendTo(ul);
>>>>>>>
.wrap('<li />')
.parent()
.appendTo(ul);
<<<<<<<
{
'.gm_room_list': {
'list-style': 'none',
'text-align': 'left',
'font-size': '11px',
'padding': '10px',
'margin': '0',
'column-count': '3',
'-moz-column-count': '3',
'-webkit-column-count': '3'
},
'.gm_room_list li a': {
'display': 'block',
'padding': '4px 8px'
},
'.gm_room_list li a:hover': {
'background-color': '#eee',
'text-decoration': 'none'
},
'.gm_room_list.profile li img': {
'margin-right': '4px'
},
'.clips_list': {
'list-style': 'none',
'text-align': 'left',
'font-size': '11px',
'padding': '8px 14px',
'margin': '0'
},
'.clips_list li': {
'padding': '8px 20px',
'border-bottom': '1px dashed #999',
'cursor': 'pointer',
'overflow': 'hidden',
'position': 'relative'
},
'.clips_list li:hover': {
'background-color': '#efefef'
},
'.clips_list li div.cl_commands': {
'position': 'absolute',
'top': '5px',
'right': '5px',
'display': 'none',
'border': '1px solid #ccc'
},
'.clips_list li:hover div.cl_commands': {
'display': 'block'
},
'.clips_list li div.cl_commands a': {
'display': 'inline-block',
'padding': '2px 4px 3px',
'background-color': '#efefef'
},
'span.action_clip': {
'display': 'inline-block',
'height': '11px',
'width': '12px',
'margin-right': '3px',
'padding': '0',
'background': 'url("http://sstatic.net/chat/img/leave-and-switch-icons.png") no-repeat',
'cursor': 'pointer'
},
'#chat-body .monologue.mine .message:hover .meta': {
'display': 'inline-block !important'
},
'#chat-body .monologue.mine .message .meta .vote-count-container': {
'display': 'none !important'
},
'.easy-navigation-selected': {
'-moz-border-radius': '4px 4px 4px 4px',
'background-color': '#D2F7D0',
'border-radius': '4px 4px 4px 4px',
'margin-left': '5px',
'padding-left': '15px !important'
},
'.easy-navigation-peekable': {
'-moz-border-radius': '4px 4px 4px 4px',
'background-color': '#000000',
'border-radius': '4px 4px 4px 4px',
'color': '#F0F0F0',
'margin-top': '5px',
'padding-right': '0px !important',
'position': 'absolute',
'z-index': '4'
},
'.easy-navigation-peeked-message': {
'line-height': '1.5em',
'padding': '3px 0px 3px 15px'
},
'.easy-navigation-subtle': {
'color': '#D2F7D0',
'display': 'block',
'font-size': '10px'
}
}
);
=======
{
'.gm_room_list': {
'list-style': 'none',
'text-align': 'left',
'font-size': '11px',
'padding': '10px',
'margin': '0',
'min-width': '540px'
},
'.gm_room_list li': {
'float': 'left',
'width': '33%'
},
'.gm_room_list li a': {
'display': 'block',
'padding': '4px 8px'
},
'.gm_room_list li a:hover': {
'background-color': '#eee',
'text-decoration': 'none'
},
'.gm_room_list.profile li img': {
'margin-right': '4px'
},
'.clips_list': {
'list-style': 'none',
'text-align': 'left',
'font-size': '11px',
'padding': '8px 14px',
'margin': '0'
},
'.clips_list li': {
'padding': '8px 20px',
'border-bottom': '1px dashed #999',
'cursor': 'pointer',
'overflow': 'hidden',
'position': 'relative'
},
'.clips_list li:hover': {
'background-color': '#efefef'
},
'.clips_list li div.cl_commands': {
'position': 'absolute',
'top': '5px',
'right': '5px',
'display': 'none',
'border': '1px solid #ccc'
},
'.clips_list li:hover div.cl_commands': {
'display': 'block'
},
'.clips_list li div.cl_commands a': {
'display': 'inline-block',
'padding': '2px 4px 3px',
'background-color': '#efefef'
},
'span.action_clip': {
'display': 'inline-block',
'height': '11px',
'width': '12px',
'margin-right': '3px',
'padding': '0',
'background': 'url("http://sstatic.net/chat/img/leave-and-switch-icons.png") no-repeat',
'cursor': 'pointer'
},
'#chat-body .monologue.mine .message:hover .meta': {
'display': 'inline-block !important'
},
'#chat-body .monologue.mine .message .meta .vote-count-container': {
'display': 'none !important'
},
'.easy-navigation-selected': {
'background-color': '#D2F7D0',
'margin-left': '5px',
'-moz-border-radius': '4px 4px 4px 4px',
'padding-left': '15px !important;'
}
});
>>>>>>>
{
'.gm_room_list': {
'list-style': 'none',
'text-align': 'left',
'font-size': '11px',
'padding': '10px',
'margin': '0',
'min-width': '540px'
},
'.gm_room_list li': {
'float': 'left',
'width': '33%'
},
'.gm_room_list li a': {
'display': 'block',
'padding': '4px 8px'
},
'.gm_room_list li a:hover': {
'background-color': '#eee',
'text-decoration': 'none'
},
'.gm_room_list.profile li img': {
'margin-right': '4px'
},
'.clips_list': {
'list-style': 'none',
'text-align': 'left',
'font-size': '11px',
'padding': '8px 14px',
'margin': '0'
},
'.clips_list li': {
'padding': '8px 20px',
'border-bottom': '1px dashed #999',
'cursor': 'pointer',
'overflow': 'hidden',
'position': 'relative'
},
'.clips_list li:hover': {
'background-color': '#efefef'
},
'.clips_list li div.cl_commands': {
'position': 'absolute',
'top': '5px',
'right': '5px',
'display': 'none',
'border': '1px solid #ccc'
},
'.clips_list li:hover div.cl_commands': {
'display': 'block'
},
'.clips_list li div.cl_commands a': {
'display': 'inline-block',
'padding': '2px 4px 3px',
'background-color': '#efefef'
},
'span.action_clip': {
'display': 'inline-block',
'height': '11px',
'width': '12px',
'margin-right': '3px',
'padding': '0',
'background': 'url("http://sstatic.net/chat/img/leave-and-switch-icons.png") no-repeat',
'cursor': 'pointer'
},
'#chat-body .monologue.mine .message:hover .meta': {
'display': 'inline-block !important'
},
'#chat-body .monologue.mine .message .meta .vote-count-container': {
'display': 'none !important'
},
'.easy-navigation-selected': {
'-moz-border-radius': '4px 4px 4px 4px',
'background-color': '#D2F7D0',
'border-radius': '4px 4px 4px 4px',
'margin-left': '5px',
'padding-left': '15px !important'
},
'.easy-navigation-peekable': {
'-moz-border-radius': '4px 4px 4px 4px',
'background-color': '#000000',
'border-radius': '4px 4px 4px 4px',
'color': '#F0F0F0',
'margin-top': '5px',
'padding-right': '0px !important',
'position': 'absolute',
'z-index': '4'
},
'.easy-navigation-peeked-message': {
'line-height': '1.5em',
'padding': '3px 0px 3px 15px'
},
'.easy-navigation-subtle': {
'color': '#D2F7D0',
'display': 'block',
'font-size': '10px'
}
}
); |
<<<<<<<
'39': function (target) {
return target.closest('.monologue').hasClass('mine') ? 'edit' : 'reply';
=======
'37': {
command: 'peek',
jump: false
},
'39': {
command: function (target) {
return target.closest('.monologue').hasClass('mine') ? 'edit' : 'reply';
},
jump: true
},
'68': {
command: 'del',
jump: true
},
'72': {
command: 'history',
jump: false
},
'69': {
command: 'edit',
jump: true
},
'80': {
command: 'peek',
jump: false
},
'81': {
command: 'quote',
jump: true
},
'82': {
command: 'reply',
jump: true
},
'83': {
command: 'star',
jump: true
>>>>>>>
'37': {
command: 'peek',
jump: false
},
'39': {
command: function (target) {
return target.closest('.monologue').hasClass('mine') ? 'edit' : 'reply';
},
jump: true
<<<<<<<
navigate: function (event) {
=======
handles: function (key, isCtrl) {
return (!isCtrl ? Navigation._actions : $.extend({}, Navigation._actions, Navigation._actions.ctrl))[key];
},
navigate: function (event, n) {
Navigation.unpeek();
>>>>>>>
handles: function (key, isCtrl) {
return (!isCtrl ? Navigation._actions : $.extend({}, Navigation._actions, Navigation._actions.ctrl))[key];
},
navigate: function (event, n) {
Navigation.unpeek();
<<<<<<<
var command = (!event.ctrlKey ? Navigation._actions : Navigation._actions.ctrl)[event.which],
message = selected[0].id.replace("message-", "");
=======
var action = Navigation.handles(event.which, event.ctrlKey),
message = selected[0].id.replace("message-", ""),
parent = selected.data('info').parent_id,
replied,
command = action ? action.command : null;
>>>>>>>
var action = Navigation.handles(event.which, event.ctrlKey),
message = selected[0].id.replace("message-", ""),
parent = selected.data('info').parent_id,
replied,
command = action ? action.command : null;
<<<<<<<
deselect: function () {
Navigation._active = false;
$('#chat .easy-navigation-selected').removeClass('easy-navigation-selected');
=======
peek: function (reply, text) {
if ((reply = $('#message-' + reply + '.easy-navigation-selected')).length) {
$('<div class="easy-navigation-peekable"></div>')
.append('<div class="easy-navigation-peeked-message"><span class="easy-navigation-subtle">Referenced message</span>' + text + '</div>')
.css({
'left': reply.offset().left + 'px',
'width': reply.outerWidth() + 'px',
'opacity': '0.8'
})
.data('reply', reply.attr('id'))
.appendTo(document.body);
Navigation.update();
}
},
suppress: function (event) {
if (Navigation._active && Navigation.handles((event.which < 123 && event.which > 96 ? event.which - 32 : event.which), event.isCtrl)) {
event.stopImmediatePropagation();
event.preventDefault();
}
},
unpeek: function () {
$('.easy-navigation-peekable').remove();
},
update: function() {
var peekable = $('body > .easy-navigation-peekable'),
reply,
scrollTopOffset = $(document).scrollTop(),
peekableTopOffset;
if (peekable.length && (reply = $('#' + peekable.data('reply') + '.easy-navigation-selected')).length) {
peekableTopOffset = reply.offset().top - peekable.outerHeight(true) - 3;
peekable.css({
'top': peekableTopOffset + 'px',
});
if (peekableTopOffset < scrollTopOffset) {
$(document).scrollTo(peekable);
}
}
>>>>>>>
peek: function (reply, text) {
if ((reply = $('#message-' + reply + '.easy-navigation-selected')).length) {
$('<div class="easy-navigation-peekable"></div>')
.append('<div class="easy-navigation-peeked-message"><span class="easy-navigation-subtle">Referenced message</span>' + text + '</div>')
.css({
'left': reply.offset().left + 'px',
'width': reply.outerWidth() + 'px',
'opacity': '0.8'
})
.data('reply', reply.attr('id'))
.appendTo(document.body);
Navigation.update();
}
},
suppress: function (event) {
if (Navigation._active && Navigation.handles((event.which < 123 && event.which > 96 ? event.which - 32 : event.which), event.isCtrl)) {
event.stopImmediatePropagation();
event.preventDefault();
}
},
unpeek: function () {
$('.easy-navigation-peekable').remove();
},
update: function() {
var peekable = $('body > .easy-navigation-peekable'),
reply,
scrollTopOffset = $(document).scrollTop(),
peekableTopOffset;
if (peekable.length && (reply = $('#' + peekable.data('reply') + '.easy-navigation-selected')).length) {
peekableTopOffset = reply.offset().top - peekable.outerHeight(true) - 3;
peekable.css({
'top': peekableTopOffset + 'px',
});
if (peekableTopOffset < scrollTopOffset) {
$(document).scrollTo(peekable);
}
}
<<<<<<<
=======
$(document).bindAs(0, 'keypress', Navigation.suppress);
$('.message').livequery(Navigation.update);
>>>>>>>
$(document).bindAs(0, 'keypress', Navigation.suppress);
$('.message').livequery(Navigation.update);
<<<<<<<
{
'.gm_room_list': {
'list-style': 'none',
'text-align': 'left',
'font-size': '11px',
'padding': '10px',
'margin': '0',
'min-width': '540px'
},
'.gm_room_list li': {
'float': 'left',
'width': '33%'
},
'.gm_room_list li a': {
'display': 'block',
'padding': '4px 8px'
},
'.gm_room_list li a:hover': {
'background-color': '#eee',
'text-decoration': 'none'
},
'.gm_room_list.profile li img': {
'margin-right': '4px'
},
'.clips_list': {
'list-style': 'none',
'text-align': 'left',
'font-size': '11px',
'padding': '8px 14px',
'margin': '0'
},
'.clips_list li': {
'padding': '8px 20px',
'border-bottom': '1px dashed #999',
'cursor': 'pointer',
'overflow': 'hidden',
'position': 'relative'
},
'.clips_list li:hover': {
'background-color': '#efefef'
},
'.clips_list li div.cl_commands': {
'position': 'absolute',
'top': '5px',
'right': '5px',
'display': 'none',
'border': '1px solid #ccc'
},
'.clips_list li:hover div.cl_commands': {
'display': 'block'
},
'.clips_list li div.cl_commands a': {
'display': 'inline-block',
'padding': '2px 4px 3px',
'background-color': '#efefef'
},
'span.action_clip': {
'display': 'inline-block',
'height': '11px',
'width': '12px',
'margin-right': '3px',
'padding': '0',
'background': 'url("http://sstatic.net/chat/img/leave-and-switch-icons.png") no-repeat',
'cursor': 'pointer'
},
'#chat-body .monologue.mine .message:hover .meta': {
'display': 'inline-block !important'
},
'#chat-body .monologue.mine .message .meta .vote-count-container': {
'display': 'none !important'
},
'.easy-navigation-selected': {
'background-color': '#D2F7D0',
'margin-left': '5px',
'-moz-border-radius': '4px 4px 4px 4px',
'padding-left': '15px !important;'
}
});
=======
{
'.gm_room_list': {
'list-style': 'none',
'text-align': 'left',
'font-size': '11px',
'padding': '10px',
'margin': '0',
'min-width': '540px'
},
'.gm_room_list li': {
'float': 'left',
'width': '33%'
},
'.gm_room_list li a': {
'display': 'block',
'padding': '4px 8px'
},
'.gm_room_list li a:hover': {
'background-color': '#eee',
'text-decoration': 'none'
},
'.gm_room_list.profile li img': {
'margin-right': '4px'
},
'.clips_list': {
'list-style': 'none',
'text-align': 'left',
'font-size': '11px',
'padding': '8px 14px',
'margin': '0'
},
'.clips_list li': {
'padding': '8px 20px',
'border-bottom': '1px dashed #999',
'cursor': 'pointer',
'overflow': 'hidden',
'position': 'relative'
},
'.clips_list li:hover': {
'background-color': '#efefef'
},
'.clips_list li div.cl_commands': {
'position': 'absolute',
'top': '5px',
'right': '5px',
'display': 'none',
'border': '1px solid #ccc'
},
'.clips_list li:hover div.cl_commands': {
'display': 'block'
},
'.clips_list li div.cl_commands a': {
'display': 'inline-block',
'padding': '2px 4px 3px',
'background-color': '#efefef'
},
'span.action_clip': {
'display': 'inline-block',
'height': '11px',
'width': '12px',
'margin-right': '3px',
'padding': '0',
'background': 'url("http://sstatic.net/chat/img/leave-and-switch-icons.png") no-repeat',
'cursor': 'pointer'
},
'#chat-body .monologue.mine .message:hover .meta': {
'display': 'inline-block !important'
},
'#chat-body .monologue.mine .message .meta .vote-count-container': {
'display': 'none !important'
},
'.easy-navigation-selected': {
'-moz-border-radius': '4px 4px 4px 4px',
'background-color': '#D2F7D0',
'border-radius': '4px 4px 4px 4px',
'margin-left': '5px',
'padding-left': '15px !important'
},
'.easy-navigation-peekable': {
'-moz-border-radius': '4px 4px 4px 4px',
'background-color': '#000000',
'border-radius': '4px 4px 4px 4px',
'color': '#F0F0F0',
'margin-top': '5px',
'padding-right': '0px !important',
'position': 'absolute',
'z-index': '4'
},
'.easy-navigation-peeked-message': {
'line-height': '1.5em',
'padding': '3px 0px 3px 15px'
},
'.easy-navigation-peeked-message .mention': {
'color': '#000000'
},
'.easy-navigation-subtle': {
'color': '#D2F7D0',
'display': 'block',
'font-size': '10px'
}
}
);
>>>>>>>
{
'.gm_room_list': {
'list-style': 'none',
'text-align': 'left',
'font-size': '11px',
'padding': '10px',
'margin': '0',
'min-width': '540px'
},
'.gm_room_list li': {
'float': 'left',
'width': '33%'
},
'.gm_room_list li a': {
'display': 'block',
'padding': '4px 8px'
},
'.gm_room_list li a:hover': {
'background-color': '#eee',
'text-decoration': 'none'
},
'.gm_room_list.profile li img': {
'margin-right': '4px'
},
'.clips_list': {
'list-style': 'none',
'text-align': 'left',
'font-size': '11px',
'padding': '8px 14px',
'margin': '0'
},
'.clips_list li': {
'padding': '8px 20px',
'border-bottom': '1px dashed #999',
'cursor': 'pointer',
'overflow': 'hidden',
'position': 'relative'
},
'.clips_list li:hover': {
'background-color': '#efefef'
},
'.clips_list li div.cl_commands': {
'position': 'absolute',
'top': '5px',
'right': '5px',
'display': 'none',
'border': '1px solid #ccc'
},
'.clips_list li:hover div.cl_commands': {
'display': 'block'
},
'.clips_list li div.cl_commands a': {
'display': 'inline-block',
'padding': '2px 4px 3px',
'background-color': '#efefef'
},
'span.action_clip': {
'display': 'inline-block',
'height': '11px',
'width': '12px',
'margin-right': '3px',
'padding': '0',
'background': 'url("http://or.sstatic.net/chat/img/leave-and-switch-icons.png") no-repeat',
'cursor': 'pointer'
},
'#chat-body .monologue.mine .message:hover .meta': {
'display': 'inline-block !important'
},
'#chat-body .monologue.mine .message .meta .vote-count-container': {
'display': 'none !important'
},
'.easy-navigation-selected': {
'-moz-border-radius': '4px 4px 4px 4px',
'background-color': '#D2F7D0',
'border-radius': '4px 4px 4px 4px',
'margin-left': '5px',
'padding-left': '15px !important'
},
'.easy-navigation-peekable': {
'-moz-border-radius': '4px 4px 4px 4px',
'background-color': '#000000',
'border-radius': '4px 4px 4px 4px',
'color': '#F0F0F0',
'margin-top': '5px',
'padding-right': '0px !important',
'position': 'absolute',
'z-index': '4'
},
'.easy-navigation-peeked-message': {
'line-height': '1.5em',
'padding': '3px 0px 3px 15px'
},
'.easy-navigation-peeked-message .mention': {
'color': '#000000'
},
'.easy-navigation-subtle': {
'color': '#D2F7D0',
'display': 'block',
'font-size': '10px'
}
}
); |
<<<<<<<
var AuthInfo = require('./authinfo').AuthInfo;
var blobClient = require('./blob').BlobClient;
var crypt = require('./crypt').Crypt;
=======
var async = require('async');
var blobClient = require('./blob');
var AuthInfo = require('./authinfo').AuthInfo;
var crypt = require('./crypt').Crypt;
>>>>>>>
var async = require('async');
var blobClient = require('./blob').BlobClient;
var AuthInfo = require('./authinfo').AuthInfo;
var crypt = require('./crypt').Crypt;
<<<<<<<
if (!opts) opts = {};
else if (typeof opts === "string") opts = {domain:opts};
this.domain = opts.domain || 'ripple.com';
this.authInfo = new AuthInfo();
this.infos = {};
}
/**
* Reduce username to standardized form.
* Strips whitespace at beginning and end.
* @param {string} username - Username to normalize
*/
VaultClient.prototype.normalizeUsername = function (username) {
username = ""+username;
username = username.trim();
return username;
};
=======
if (!opts) {
opts = { };
}
>>>>>>>
if (!opts) {
opts = { };
}
<<<<<<<
VaultClient.prototype.exists = function (username, fn) {
this.authInfo.get(this.domain, username.toLowerCase(), function(err, authInfo){
if (err) return fn(err);
return fn(null, !!authInfo.exists);
});
};
=======
>>>>>>>
<<<<<<<
blobClient.verify(authInfo.blobvault, username.toLowerCase(), token, fn);
});
};
=======
if (typeof authInfo.blobvault !== 'string') {
return callback(new Error('No blobvault specified in the authinfo.'));
}
>>>>>>>
if (typeof authInfo.blobvault !== 'string') {
return callback(new Error('No blobvault specified in the authinfo.'));
}
<<<<<<<
VaultClient.prototype.register = function (options, fn) {
var self = this,
username = this.normalizeUsername(options.username),
password = this.normalizePassword(options.password);
self.authInfo.get(self.domain, username, function(err, authInfo){
if (err) return fn(err);
if ("string" !== typeof authInfo.blobvault) {
return fn(new Error("No blobvault specified in the authinfo."));
}
if (!authInfo.pakdf) {
return fn(new Error("No settings for PAKDF in auth packet."));
}
//derive login keys
crypt.derive(authInfo.pakdf, 'login', username.toLowerCase(), password, function(err, loginKeys){
if (err) return fn(err);
//derive unlock key
crypt.derive(authInfo.pakdf, 'unlock', username.toLowerCase(), password, function(err, unlockKeys){
if (err) return fn(err);
var params = {
'url' : authInfo.blobvault,
'id' : loginKeys.id,
'crypt' : loginKeys.crypt,
'unlock' : unlockKeys.unlock,
'username' : username,
'email' : options.email,
'masterkey' : options.masterkey || crypt.createMaster(),
'activateLink' : options.activateLink,
'oldUserBlob' : options.oldUserBlob
};
blobClient.create(params, function(err, blob){
if (err) return fn(err);
fn(null, blob, loginKeys, authInfo.username);
});
=======
VaultClient.prototype.register = function(options, fn) {
var self = this;
var username = String(options.username).trim();
var password = String(options.password).trim();
function getAuthInfo(callback) {
self.authInfo.get(self.domain, username, function(err, authInfo) {
if (err) {
return callback(err);
}
if (typeof authInfo.blobvault !== 'string') {
return callback(new Error('No blobvault specified in the authinfo.'));
}
if (!authInfo.pakdf) {
return callback(new Error('No settings for PAKDF in auth packet.'));
}
callback(null, authInfo);
});
};
function deriveKeys(authInfo, callback) {
// derive unlock and login keys
var keys = { };
function deriveKey(keyType, callback) {
crypt.derive(authInfo.pakdf, keyType, username.toLowerCase(), password, function(err, key) {
if (err) {
callback(err);
} else {
keys[keyType] = key;
callback();
}
>>>>>>>
VaultClient.prototype.register = function(options, fn) {
var self = this;
var username = String(options.username).trim();
var password = String(options.password).trim();
function getAuthInfo(callback) {
self.authInfo.get(self.domain, username, function(err, authInfo) {
if (err) {
return callback(err);
}
if (typeof authInfo.blobvault !== 'string') {
return callback(new Error('No blobvault specified in the authinfo.'));
}
if (!authInfo.pakdf) {
return callback(new Error('No settings for PAKDF in auth packet.'));
}
callback(null, authInfo);
});
};
function deriveKeys(authInfo, callback) {
// derive unlock and login keys
var keys = { };
function deriveKey(keyType, callback) {
crypt.derive(authInfo.pakdf, keyType, username.toLowerCase(), password, function(err, key) {
if (err) {
callback(err);
} else {
keys[keyType] = key;
callback();
}
<<<<<<<
module.exports.VaultClient = VaultClient;
=======
exports.VaultClient = VaultClient;
>>>>>>>
exports.VaultClient = VaultClient; |
<<<<<<<
var crypt = require('./crypt').Crypt;
var request = require('superagent');
var async = require('async');
var extend = require("extend");
var BlobClient = {};
=======
var request = require('superagent');
var extend = require('extend');
var crypt = require('./crypt').Crypt;
>>>>>>>
var crypt = require('./crypt').Crypt;
var request = require('superagent');
var extend = require("extend");
var BlobClient = {};
<<<<<<<
//Identity fields
var identityRoot = 'identityVault';
var identityFields = [
'name',
'entityType',
'email',
'phone',
'address',
'nationalID',
'birthday',
'birthplace'
];
var entityTypes = [
'individual',
'organization',
'corporation'
]
var addressFields = [
'contact',
'line1',
'line2',
'city',
'region', //state/province/region
'postalCode',
'country'
];
var nationalIDFields = [
'number',
'type',
'country',
];
var idTypeFields = [
'ssn',
'taxID',
'passport',
'driversLicense',
'other'
];
/*
=======
/**
>>>>>>>
//Identity fields
var identityRoot = 'identityVault';
var identityFields = [
'name',
'entityType',
'email',
'phone',
'address',
'nationalID',
'birthday',
'birthplace'
];
var entityTypes = [
'individual',
'organization',
'corporation'
]
var addressFields = [
'contact',
'line1',
'line2',
'city',
'region', //state/province/region
'postalCode',
'country'
];
var nationalIDFields = [
'number',
'type',
'country',
];
var idTypeFields = [
'ssn',
'taxID',
'passport',
'driversLicense',
'other'
];
/**
<<<<<<<
fn(null, self);//return with newly decrypted blob
}).timeout(8000);
};
=======
if (successful) {
self.consolidate();
}
}
>>>>>>>
if (successful) {
self.consolidate();
}
}
<<<<<<<
};
=======
};
>>>>>>>
};
<<<<<<<
}
/***** identity ****/
/**
* Identity class
*
*/
var Identity = function (blob) {
var self = this;
self.blob = blob;
//make sure the identity setup is valid
self.validate = function(fn) {
if (!self.blob) return fn(new Error("Identity must be associated with a blob"));
else if (!self.blob.data) return fn(new Error("Invalid Blob"));
else if (!self.blob.data[identityRoot]) {
self.blob.set(identityRoot, {}, function(err, res){
if (err) return fn(err);
else return fn(null, true);
});
} else return fn(null, true);
};
};
=======
};
>>>>>>>
}
/***** identity ****/
/**
* Identity class
*
*/
var Identity = function (blob) {
var self = this;
self.blob = blob;
//make sure the identity setup is valid
self.validate = function(fn) {
if (!self.blob) return fn(new Error("Identity must be associated with a blob"));
else if (!self.blob.data) return fn(new Error("Invalid Blob"));
else if (!self.blob.data[identityRoot]) {
self.blob.set(identityRoot, {}, function(err, res){
if (err) return fn(err);
else return fn(null, true);
});
} else return fn(null, true);
};
};
<<<<<<<
*/
BlobClient.Blob = BlobObj;
=======
*/
exports.Blob = BlobObj
>>>>>>>
*/
exports.Blob = BlobObj;
<<<<<<<
module.exports.getRippleName = function (url, address, fn) {
if (!crypt.isValidAddress(address)) return fn (new Error("Invalid ripple address"));
request.get(url + '/v1/user/' + address, function(err, resp){
if (err) return fn(new Error("Unable to access vault sever"));
else if (resp.body && resp.body.username) return fn(null, resp.body.username);
else if (resp.body && resp.body.exists === false) return fn (new Error("No ripple name for this address"));
else return fn(new Error("Unable to determine if ripple name exists"));
});
};
=======
>>>>>>>
<<<<<<<
BlobClient.get = function (url, id, crypt, fn) {
=======
exports.get = function(url, id, crypt, fn) {
>>>>>>>
BlobClient.get = function (url, id, crypt, fn) {
<<<<<<<
};
=======
};
>>>>>>>
};
<<<<<<<
BlobClient.verify = function (url, username, token, fn) {
=======
exports.verify = function(url, username, token, fn) {
>>>>>>>
BlobClient.verify = function(url, username, token, fn) {
<<<<<<<
if (err) return fn(err);
else if (resp.body && resp.body.result === 'success') return fn(null, data);
else return fn(new Error("Failed to verify the account"));
});
};
=======
if (err) {
fn(err);
} else if (resp.body && resp.body.result === 'success') {
fn(null, data);
} else {
fn(new Error('Failed to verify the account'));
}
});
};
>>>>>>>
if (err) {
fn(err);
} else if (resp.body && resp.body.result === 'success') {
fn(null, data);
} else {
fn(new Error('Failed to verify the account'));
}
});
};
<<<<<<<
BlobClient.create = function (options, fn) {
var blob = new BlobObj(options.url, options.id, options.crypt);
=======
exports.create = function(options, fn) {
var blob = new BlobObj(options.url, options.id, options.crypt);
>>>>>>>
BlobClient.create = function(options, fn) {
var blob = new BlobObj(options.url, options.id, options.crypt);
<<<<<<<
if (err) return fn(err);
else if (resp.body && resp.body.result === 'success') return fn(null, blob,resp.body);
else return fn(new Error("Could not create blob"));
});
};
module.exports.BlobClient = BlobClient;
=======
if (err) {
fn(err);
} else if (resp.body && resp.body.result === 'success') {
fn(null, blob,resp.body);
} else {
fn(new Error('Could not create blob'));
}
});
};
>>>>>>>
if (err) {
fn(err);
} else if (resp.body && resp.body.result === 'success') {
fn(null, blob,resp.body);
} else {
fn(new Error('Could not create blob'));
}
});
};
exports.BlobClient = BlobClient; |
<<<<<<<
var sjcl = require('./utils').sjcl;
var base = require('./base').Base;
var UInt160 = require('./uint160').UInt160;
var message = require('./message');
var request = require('superagent');
var extend = require("extend");
var parser = require("url");
var Crypt = {};
=======
var parser = require('url');
var querystring = require('querystring');
var extend = require('extend');
var request = require('superagent');
var sjcl = require('./utils').sjcl;
var base = require('./base').Base;
var UInt160 = require('./uint160').UInt160;
var message = require('./message');
>>>>>>>
var sjcl = require('./utils').sjcl;
var base = require('./base').Base;
var UInt160 = require('./uint160').UInt160;
var message = require('./message');
var request = require('superagent');
var querystring = require('querystring');
var extend = require("extend");
var parser = require("url");
var Crypt = { };
<<<<<<<
var iBlind = iRandom.powermodMontgomery(iPublic.mul(iExponent), iModulus);
var iSignreq = iSecret.mulmod(iBlind, iModulus);
var signreq = sjcl.codec.hex.fromBits(iSignreq.toBits());
=======
var iBlind = iRandom.powermodMontgomery(iPublic.mul(iExponent), iModulus);
var iSignreq = iSecret.mulmod(iBlind, iModulus);
var signreq = sjcl.codec.hex.fromBits(iSignreq.toBits());
>>>>>>>
var iBlind = iRandom.powermodMontgomery(iPublic.mul(iExponent), iModulus);
var iSignreq = iSecret.mulmod(iBlind, iModulus);
var signreq = sjcl.codec.hex.fromBits(iSignreq.toBits());
<<<<<<<
return [].concat(a, i >> 24, (i >> 16) & 0xff, (i >> 8) & 0xff, i & 0xff);
}
=======
return [].concat(a, i >> 24, (i >> 16) & 0xff, (i >> 8) & 0xff, i & 0xff)
};
>>>>>>>
return [].concat(a, i >> 24, (i >> 16) & 0xff, (i >> 8) & 0xff, i & 0xff);
}
<<<<<<<
throw "Invalid seed.";
=======
throw new Error('Invalid seed.');
>>>>>>>
throw new Error('Invalid seed.');
<<<<<<<
};
=======
};
>>>>>>>
};
<<<<<<<
Crypt.decrypt = function (key, data) {
=======
Crypt.decrypt = function(key, data) {
>>>>>>>
Crypt.decrypt = function (key, data) {
<<<<<<<
};
=======
};
>>>>>>>
};
<<<<<<<
Crypt.isValidAddress = function (address) {
return UInt160.is_valid(address);
};
=======
>>>>>>>
<<<<<<<
Crypt.createSecret = function (nWords) {
return sjcl.codec.hex.fromBits(sjcl.random.randomWords(nWords));
};
=======
>>>>>>>
<<<<<<<
Crypt.createMaster = function () {
return base.encode_check(33, sjcl.codec.bytes.fromBits(sjcl.random.randomWords(4)));
};
=======
>>>>>>>
<<<<<<<
Crypt.getAddress = function (masterkey) {
return new Crypt.RippleAddress(masterkey).getAddress();
};
=======
>>>>>>>
<<<<<<<
Crypt.hashSha512 = function (data) {
return sjcl.codec.hex.fromBits(sjcl.hash.sha512.hash(data));
};
=======
>>>>>>>
<<<<<<<
};
=======
};
>>>>>>>
};
<<<<<<<
};
=======
};
>>>>>>>
};
<<<<<<<
config.url += (parsed.search ? "&" : "?") +
'signature='+Crypt.base64ToBase64Url(signature)+
'&signature_date='+date+
'&signature_blob_id='+blob_id+
'&signature_type='+signatureType;
=======
var query = querystring.stringify({
signature: Crypt.base64ToBase64Url(signature),
signature_date: date,
signature_blob_id: blob_id,
signature_type: signatureType
});
config.url += (parsed.search ? '&' : '?') + query;
>>>>>>>
var query = querystring.stringify({
signature: Crypt.base64ToBase64Url(signature),
signature_date: date,
signature_blob_id: blob_id,
signature_type: signatureType
});
config.url += (parsed.search ? '&' : '?') + query;
<<<<<<<
return key === undefined || hasOwn.call( obj, key );
}
=======
return key === void(0) || hasOwn.call( obj, key );
};
>>>>>>>
return key === void(0) || hasOwn.call( obj, key );
} |
<<<<<<<
// .then(fontsPromise.bind(null, mod, conf.modulePath, conf.appPath))
=======
>>>>>>> |
<<<<<<<
value = (value * advance) + callDateMethod(date, 'get', false, method);
=======
value = (value * advance) + callDateMethod(date, 'get', '', method);
} else if(unit === 'month' && paramExists('day')) {
// When setting the month, there is a chance that we will traverse into a new month.
// This happens in DST shifts, for example June 1st DST jumping to January 1st
// (non-DST) will have a shift of -1:00 which will traverse into the previous year.
// Prevent this by proactively setting the day when we know it will be set again anyway.
// It can also happen when there are not enough days in the target month. This second
// situation is identical to checkMonthTraversal below, however when we are advancing
// we want to reset the date to "the last date in the target month". In the case of
// DST shifts, however, we want to avoid the "edges" of months as that is where this
// unintended traversal can happen. This is the reason for the different handling of
// two similar but slightly different situations.
//
// TL;DR This method avoids the edges of a month IF not advancing and the date is going
// to be set anyway, while checkMonthTraversal resets the date to the last day if advancing.
//
date.setDate(15);
>>>>>>>
value = (value * advance) + callDateMethod(date, 'get', false, method);
} else if(unit === 'month' && paramExists('day')) {
// When setting the month, there is a chance that we will traverse into a new month.
// This happens in DST shifts, for example June 1st DST jumping to January 1st
// (non-DST) will have a shift of -1:00 which will traverse into the previous year.
// Prevent this by proactively setting the day when we know it will be set again anyway.
// It can also happen when there are not enough days in the target month. This second
// situation is identical to checkMonthTraversal below, however when we are advancing
// we want to reset the date to "the last date in the target month". In the case of
// DST shifts, however, we want to avoid the "edges" of months as that is where this
// unintended traversal can happen. This is the reason for the different handling of
// two similar but slightly different situations.
//
// TL;DR This method avoids the edges of a month IF not advancing and the date is going
// to be set anyway, while checkMonthTraversal resets the date to the last day if advancing.
//
date.setDate(15);
<<<<<<<
'addFormat': function(format, match, locale, variant) {
addDateInputFormat(format, match, locale, variant, 'unshift');
},
'range': function(start, end) {
return new DateRange(start, end);
=======
'addFormat': function(format, match, localeCode) {
addDateInputFormat(getLocalization(localeCode), format, match);
>>>>>>>
'addFormat': function(format, match, localeCode) {
addDateInputFormat(getLocalization(localeCode), format, match);
},
'range': function(start, end) {
return new DateRange(start, end);
<<<<<<<
buildDateRange();
=======
>>>>>>>
buildDateRange(); |
<<<<<<<
defineStaticPolyfill(sugarArray, {
=======
function getCoercedObject(obj) {
if (obj == null) {
throw new TypeError('Object required.');
}
return coercePrimitiveToObject(obj);
}
defineStaticPolyfill(Array, {
>>>>>>>
function getCoercedObject(obj) {
if (obj == null) {
throw new TypeError('Object required.');
}
return coercePrimitiveToObject(obj);
}
defineStaticPolyfill(sugarArray, { |
<<<<<<<
import AdminEventsSection from './components/AdminEventsSection';
import AdminEventUploadRsvps from './components/AdminEventUploadRsvps';
import ConstituentLookup from './components/ConstituentLookup';
import AdminCallAssignmentsSection from './components/AdminCallAssignmentsSection';
import AdminCallAssignmentCreationForm from './components/AdminCallAssignmentCreationForm';
import FastFwdForm from './components/FastFwdForm';
import EventsDashboard from './components/EventsDashboard';
import EventView from './components/EventView';
import EventDataUpload from './components/EventDataUpload';
import GCTextField from './components/forms/GCTextField';
import GCPhoneField from './components/forms/GCPhoneField';
import GCDateField from './components/forms/GCDateField';
import GCDateTimeField from './components/forms/GCDateTimeField';
import GCTimeField from './components/forms/GCTimeField';
import GCPasswordField from './components/forms/GCPasswordField';
import GCRadioButtonsField from './components/forms/GCRadioButtonsField';
import GCSelectField from './components/forms/GCSelectField';
import GCCheckboxesField from './components/forms/GCCheckboxesField';
import GCBooleanField from './components/forms/GCBooleanField';
import GCToggleField from './components/forms/GCToggleField';
import CallAssignmentsDashboard from './components/CallAssignmentsDashboard';
import AdminCallAssignment from './components/AdminCallAssignment';
import CallAssignment from './components/CallAssignment';
import CallAssignmentsSection from './components/CallAssignmentsSection';
import Dashboard from './components/Dashboard';
import Signup from './components/Signup';
=======
import AdminEventsSection from './components/AdminEventsSection'
import AdminEventUploadRsvps from './components/AdminEventUploadRsvps'
import ConstituentLookup from './components/ConstituentLookup'
import AdminCallAssignmentsSection from './components/AdminCallAssignmentsSection'
import AdminCallAssignmentCreationForm from './components/AdminCallAssignmentCreationForm'
import FastFwdForm from './components/FastFwdForm'
import GCTextField from './components/forms/GCTextField'
import GCRichTextField from './components/forms/GCRichTextField'
import GCPhoneField from './components/forms/GCPhoneField'
import GCDateField from './components/forms/GCDateField'
import GCDateTimeField from './components/forms/GCDateTimeField'
import GCTimeField from './components/forms/GCTimeField'
import GCPasswordField from './components/forms/GCPasswordField'
import GCRadioButtonsField from './components/forms/GCRadioButtonsField'
import GCSelectField from './components/forms/GCSelectField'
import GCCheckboxesField from './components/forms/GCCheckboxesField'
import GCBooleanField from './components/forms/GCBooleanField'
import GCToggleField from './components/forms/GCToggleField'
import CallAssignmentsDashboard from './components/CallAssignmentsDashboard'
import AdminCallAssignment from './components/AdminCallAssignment'
import CallAssignment from './components/CallAssignment'
import CallAssignmentsSection from './components/CallAssignmentsSection'
import Dashboard from './components/Dashboard'
import Signup from './components/Signup'
>>>>>>>
import AdminEventsSection from './components/AdminEventsSection'
import AdminEventUploadRsvps from './components/AdminEventUploadRsvps'
import ConstituentLookup from './components/ConstituentLookup'
import AdminCallAssignmentsSection from './components/AdminCallAssignmentsSection'
import AdminCallAssignmentCreationForm from './components/AdminCallAssignmentCreationForm'
import FastFwdForm from './components/FastFwdForm'
import EventsDashboard from './components/EventsDashboard'
import EventView from './components/EventView'
import EventDataUpload from './components/EventDataUpload'
import GCTextField from './components/forms/GCTextField'
import GCRichTextField from './components/forms/GCRichTextField'
import GCPhoneField from './components/forms/GCPhoneField'
import GCDateField from './components/forms/GCDateField'
import GCDateTimeField from './components/forms/GCDateTimeField'
import GCTimeField from './components/forms/GCTimeField'
import GCPasswordField from './components/forms/GCPasswordField'
import GCRadioButtonsField from './components/forms/GCRadioButtonsField'
import GCSelectField from './components/forms/GCSelectField'
import GCCheckboxesField from './components/forms/GCCheckboxesField'
import GCBooleanField from './components/forms/GCBooleanField'
import GCToggleField from './components/forms/GCToggleField'
import CallAssignmentsDashboard from './components/CallAssignmentsDashboard'
import AdminCallAssignment from './components/AdminCallAssignment'
import CallAssignment from './components/CallAssignment'
import CallAssignmentsSection from './components/CallAssignmentsSection'
import Dashboard from './components/Dashboard'
import Signup from './components/Signup'
<<<<<<<
>
<IndexRedirect to='/call' />
=======
>
<IndexRedirect to='/call'/>
>>>>>>>
>
<IndexRedirect to='/call' />
<<<<<<<
<Route
path='events'
component={EventsDashboard}
queries={{
...CurrentUserQueries,
}}
/>
<Route
path='events'
component={CallAssignmentsDashboard}
queries={CurrentUserQueries}
>
<IndexRoute
component={EventsDashboard}
queries={{
...CurrentUserQueries,
}}
/>
<Route
path=':id'
component={EventView}
queries={{
...EventQueries,
...CurrentUserQueries
}}
renderLoading={() => <Loading />}
/>
<Route
path=':id/upload'
component={EventDataUpload}
queries={{
...EventQueries,
...CurrentUserQueries
}}
renderLoading={() => <Loading />}
/>
<Route
path=':id/request-email'
component={FastFwdForm}
queries={{
...EventQueries,
...CurrentUserQueries
}}
renderLoading={() => <Loading />}
/>
</Route>
=======
<Route
path='account'
component={UserAccountDashboard}
queries={CurrentUserQueries}
>
<IndexRoute
component={UserAccountChangePasswordForm}
/>
</Route>
>>>>>>>
<Route
path='events'
component={EventsDashboard}
queries={{
...CurrentUserQueries,
}}
/>
<Route
path='events'
component={CallAssignmentsDashboard}
queries={CurrentUserQueries}
>
<IndexRoute
component={EventsDashboard}
queries={{
...CurrentUserQueries,
}}
/>
<Route
path=':id'
component={EventView}
queries={{
...EventQueries,
...CurrentUserQueries
}}
renderLoading={() => <Loading />}
/>
<Route
path=':id/upload'
component={EventDataUpload}
queries={{
...EventQueries,
...CurrentUserQueries
}}
renderLoading={() => <Loading />}
/>
<Route
path=':id/request-email'
component={FastFwdForm}
queries={{
...EventQueries,
...CurrentUserQueries
}}
renderLoading={() => <Loading />}
/>
</Route>
<Route
path='account'
component={UserAccountDashboard}
queries={CurrentUserQueries}
>
<IndexRoute
component={UserAccountChangePasswordForm}
/>
</Route> |
<<<<<<<
filters: {flagApproval: true},
hostFilters: {}
},
=======
filters: {flagApproval: true}
}
if (hashParams.query){
try {
let newQueryParams = Object.assign({}, defaultParams, hashParams.query)
newQueryParams.filters = Object.assign({}, defaultParams.filters, hashParams.query.filters)
return newQueryParams
}
catch(ex) {
console.error('Invalid query parameters', ex)
}
}
return defaultParams
}
export default Relay.createContainer(AdminEventsSection, {
initialVariables: getDefaultQuery(),
>>>>>>>
filters: {flagApproval: true},
hostFilters: {}
}
if (hashParams.query){
try {
let newQueryParams = Object.assign({}, defaultParams, hashParams.query)
newQueryParams.filters = Object.assign({}, defaultParams.filters, hashParams.query.filters)
return newQueryParams
}
catch(ex) {
console.error('Invalid query parameters', ex)
}
}
return defaultParams
}
export default Relay.createContainer(AdminEventsSection, {
initialVariables: getDefaultQuery(), |
<<<<<<<
filterOptions: {type: GraphQLEventInput },
hasHostMessages: {type: GraphQLBoolean},
=======
eventFilterOptions: {type: GraphQLEventInput },
hostFilterOptions: {type: GraphQLPersonInput },
>>>>>>>
eventFilterOptions: {type: GraphQLEventInput },
hasHostMessages: {type: GraphQLBoolean},
hostFilterOptions: {type: GraphQLPersonInput },
<<<<<<<
resolve: async (event, {first, filterOptions, sortField, sortDirection, hasHostMessages}, {rootValue}) => {
let filters = eventFromAPIFields(filterOptions);
=======
resolve: async (event, {first, eventFilterOptions, hostFilterOptions, sortField, sortDirection}, {rootValue}) => {
let eventFilters = eventFromAPIFields(eventFilterOptions)
>>>>>>>
resolve: async (event, {first, eventFilterOptions, hostFilterOptions, sortField, sortDirection, hasHostMessages}, {rootValue}) => {
let eventFilters = eventFromAPIFields(eventFilterOptions)
<<<<<<<
if(hasHostMessages){
events.join('fast_fwd_request', 'bsd_events.event_id', '=', 'fast_fwd_request.event_id')
.whereNull('email_sent_dt')
}
return connectionFromArray(await events, {first})
=======
if (Object.keys(hostFilterOptions).length){
events = events.leftJoin('bsd_people', 'bsd_events.creator_cons_id', 'bsd_people.cons_id')
let hostFilters = humps.decamelizeKeys(hostFilterOptions)
Object.keys(hostFilters).forEach((key) => {
if (key === 'email'){
events = events.join('bsd_emails', 'bsd_events.creator_cons_id', 'bsd_emails.cons_id')
events = addWhere({query: events, property: `bsd_emails.${key}`, value: hostFilters[key]})
}
else if (key === 'phone'){
events = events.join('bsd_phones', 'bsd_events.creator_cons_id', 'bsd_phones.cons_id')
events = addWhere({query: events, property: `bsd_phones.${key}`, value: hostFilters[key]})
}
else {
events = addWhere({query: events, property: `bsd_people.${key}`, value: hostFilters[key]})
}
})
}
return connectionFromArray(await events, {first})
>>>>>>>
if (Object.keys(hostFilterOptions).length){
events = events.leftJoin('bsd_people', 'bsd_events.creator_cons_id', 'bsd_people.cons_id')
let hostFilters = humps.decamelizeKeys(hostFilterOptions)
Object.keys(hostFilters).forEach((key) => {
if (key === 'email'){
events = events.join('bsd_emails', 'bsd_events.creator_cons_id', 'bsd_emails.cons_id')
events = addWhere({query: events, property: `bsd_emails.${key}`, value: hostFilters[key]})
}
else if (key === 'phone'){
events = events.join('bsd_phones', 'bsd_events.creator_cons_id', 'bsd_phones.cons_id')
events = addWhere({query: events, property: `bsd_phones.${key}`, value: hostFilters[key]})
}
else {
events = addWhere({query: events, property: `bsd_people.${key}`, value: hostFilters[key]})
}
})
}
if(hasHostMessages){
events.join('fast_fwd_request', 'bsd_events.event_id', '=', 'fast_fwd_request.event_id')
.whereNull('email_sent_dt')
}
return connectionFromArray(await events, {first}) |
<<<<<<<
function activeCallAssignments(query) {
return query
.where('end_dt', '>', moment().add(1, 'days').toDate())
.orWhere('end_dt', null)
}
function inactiveCallAssignments(query) {
return query
.where('end_dt', '<', moment().add(1, 'days').toDate())
}
function interpretDateAsUTC(date) {
return moment.tz(moment(date).format('YYYY-MM-DD HH:mm:ss'), 'UTC').toDate()
}
function authRequired (session) {
=======
function interpretDateAsUTC(date) {
return moment.tz(moment(date).format('YYYY-MM-DD HH:mm:ss'), 'UTC').toDate()
}
function authRequired (session) {
>>>>>>>
function activeCallAssignments(query) {
return query
.where('end_dt', '>', moment().add(1, 'days').toDate())
.orWhere('end_dt', null)
}
function inactiveCallAssignments(query) {
return query
.where('end_dt', '<', moment().add(1, 'days').toDate())
}
function interpretDateAsUTC(date) {
return moment.tz(moment(date).format('YYYY-MM-DD HH:mm:ss'), 'UTC').toDate()
}
function authRequired (session) {
<<<<<<<
if (newFieldName === 'start_dt')
event[newFieldName] = event[newFieldName].toISOString()
=======
console.log(newFieldName)
>>>>>>>
if (newFieldName === 'start_dt')
event[newFieldName] = event[newFieldName].toISOString()
<<<<<<<
// So that I can program late at night
if (process.env.NODE_ENV === 'development')
validOffsets = allOffsets
=======
>>>>>>>
// So that I can program late at night
if (process.env.NODE_ENV === 'development')
validOffsets = allOffsets
<<<<<<<
.orderBy('bsd_people.id')
else
query = query
.from('bsd_people')
=======
} else {
query = query.from('bsd_people')
}
>>>>>>>
.orderBy('bsd_people.id')
} else {
query = query.from('bsd_people')
}
<<<<<<<
instructions: { type: GraphQLString },
startDate: { type: GraphQLDate },
endDate: { type: GraphQLDate },
callerGroupId: { type: GraphQLString }
=======
instructions: { type: GraphQLString },
startDate: { type: GraphQLDate },
endDate: { type: GraphQLDate },
>>>>>>>
instructions: { type: GraphQLString },
startDate: { type: GraphQLDate },
endDate: { type: GraphQLDate },
callerGroupId: { type: GraphQLString } |
<<<<<<<
{value: 1, 'text': 'Pending Approval'},
{value: 0, 'text': 'Approved Events'},
{value: 2, 'text': 'FastFwd Requests'}
=======
{value: 'PENDING_APPROVAL', 'text': 'Pending Approval'},
{value: 'PENDING_REVIEW', 'text': 'Pending Review'},
{value: 'APPROVED', 'text': 'Public Events'}
>>>>>>>
{value: 'PENDING_APPROVAL', 'text': 'Pending Approval'},
{value: 'PENDING_REVIEW', 'text': 'Pending Review'},
{value: 'APPROVED', 'text': 'Public Events'}
<<<<<<<
value={this.props.relay.variables.filters.flagApproval ? 1 : this.props.relay.variables.hasHostMessages ? 2 : 0}
=======
value={this.props.relay.variables.status}
>>>>>>>
value={this.props.relay.variables.status}
<<<<<<<
this._handleApprovalFilterChange(value);
}}
=======
this._handleQueryChange({status: value});
}
}
>>>>>>>
this._handleQueryChange({status: value});
}
}
<<<<<<<
filters: {flagApproval: true},
hostFilters: {},
hasHostMessages: false
=======
status: 'PENDING_REVIEW',
filters: {},
hostFilters: {}
>>>>>>>
status: 'PENDING_REVIEW',
filters: {},
hostFilters: {}
hasHostMessages: false
<<<<<<<
hasHostMessages: $hasHostMessages
=======
status: $status
>>>>>>>
status: $status
hasHostMessages: $hasHostMessages |
<<<<<<<
=======
app.post('/logout',
wrap(async (req, res) => {
req.logout();
res.send('Success!')
}))
// this endpoint is for testing email rendering/sending
app.get('/events/confirmation-email', wrap(async (req, res) => {
let event_types = await BSDClient.getEventTypes();
let result = await Mailgun.sendEventConfirmation(demoData.EventCreationForm, demoData.EventCreationConstituent, event_types, true);
res.send(result.html)
}));
>>>>>>>
app.post('/logout',
wrap(async (req, res) => {
req.logout();
res.send('Success!')
})) |
<<<<<<<
constructor(forum) {
=======
constructor () {
>>>>>>>
constructor () {
<<<<<<<
this.setForum(forum);
=======
>>>>>>>
<<<<<<<
url(path = 'all') {
const forum = this.forum ? `forum=${this.forum}` : ''
return `/api/topic/${path}?${forum}`;
=======
url (id, forumName) {
if (!forumName) return super.url(id);
return `${super.url(id)}?forum=${forumName}`;
>>>>>>>
url (id, forumName) {
if (!forumName) return super.url(id);
return `${super.url(id)}?forum=${forumName}`;
<<<<<<<
setForum(forum) {
this.forum = forum;
this.allItems = null;
}
=======
>>>>>>> |
<<<<<<<
let aliceLocator = padAddressToLocator(aliceAddress)
let bobLocator = padAddressToLocator(bobAddress)
const MIN_STAKE_250 = 250
const MIN_STAKE_500 = 500
=======
>>>>>>>
let aliceLocator = padAddressToLocator(aliceAddress)
let bobLocator = padAddressToLocator(bobAddress)
<<<<<<<
await setupMockContracts()
indexer = await Indexer.new(
stakingTokenAddress,
MIN_STAKE_250,
EMPTY_ADDRESS
)
whitelistedIndexer = await Indexer.new(
stakingTokenAddress,
MIN_STAKE_250,
whitelistAddress
)
=======
await setupMockToken()
indexer = await Indexer.new(stakingTokenAddress)
>>>>>>>
await setupMockContracts()
indexer = await Indexer.new(stakingTokenAddress, EMPTY_ADDRESS)
whitelistedIndexer = await Indexer.new(
stakingTokenAddress,
whitelistAddress
)
<<<<<<<
it('should set the staking minimum correctly', async () => {
const actualMinimum = await indexer.stakeMinimum()
equal(actualMinimum, MIN_STAKE_250, 'Staking minimum was set incorrectly')
})
it('should emit an event in the constructor', async () => {
// create a new indexer
const newIndexer = await Indexer.new(
stakingTokenAddress,
MIN_STAKE_250,
EMPTY_ADDRESS
)
// get the tx hash and get the transaction result from it
let txHash = newIndexer.transactionHash
let result = await getResult(newIndexer, txHash)
emitted(result, 'SetStakeMinimum', event => {
return event.amount.toNumber() === MIN_STAKE_250
})
})
})
describe('Test setStakeMinimum', async () => {
it('should not allow a non-owner to change the minimum', async () => {
await reverted(
indexer.setStakeMinimum(MIN_STAKE_500, {
from: nonOwner,
}),
'Ownable: caller is not the owner'
)
})
it('should allow the owner to change the minimum', async () => {
let result = await indexer.setStakeMinimum(MIN_STAKE_500, { from: owner })
emitted(result, 'SetStakeMinimum', event => {
return event.amount.toNumber() === MIN_STAKE_500
})
})
=======
>>>>>>>
<<<<<<<
it('should not set an intent if the locator is not whitelisted', async () => {
await reverted(
whitelistedIndexer.setIntent(
tokenOne,
tokenTwo,
250,
await getTimestampPlusDays(1),
aliceLocator,
{
from: aliceAddress,
}
),
'LOCATOR_NOT_WHITELISTED'
)
})
it('should not set an intent if the minimim stake isnt met', async () => {
// make the market first
await indexer.createMarket(tokenOne, tokenTwo, {
from: aliceAddress,
})
// now try to stake with an amount less than 250
await reverted(
indexer.setIntent(
tokenOne,
tokenTwo,
249,
await getTimestampPlusDays(1),
aliceLocator,
{
from: aliceAddress,
}
),
'MINIMUM_NOT_MET'
)
})
=======
>>>>>>>
it('should not set an intent if the locator is not whitelisted', async () => {
await reverted(
whitelistedIndexer.setIntent(
tokenOne,
tokenTwo,
250,
await getTimestampPlusDays(1),
aliceLocator,
{
from: aliceAddress,
}
),
'LOCATOR_NOT_WHITELISTED'
)
})
<<<<<<<
describe('Test setTwoSidedIntent', async () => {
it('should not set either intent if 1 breaks a rule', async () => {
// make one market
await indexer.createMarket(tokenOne, tokenTwo, {
from: aliceAddress,
})
let expiry = await getTimestampPlusDays(1)
// try to set both intents, but one market doesnt exist
await reverted(
indexer.setTwoSidedIntent(
tokenOne,
tokenTwo,
250,
expiry,
aliceLocator,
{
from: aliceAddress,
}
),
'MARKET_DOES_NOT_EXIST'
)
// create the other market (both exist now)
await indexer.createMarket(tokenTwo, tokenOne, {
from: aliceAddress,
})
// alice stakes on one market
await indexer.setIntent(tokenOne, tokenTwo, 250, expiry, aliceAddress, {
from: aliceAddress,
})
// try to set both intents, but fails as alice has already staked on one
await reverted(
indexer.setTwoSidedIntent(
tokenOne,
tokenTwo,
250,
expiry,
aliceLocator,
{
from: aliceAddress,
}
),
'USER_ALREADY_STAKED'
)
})
it('should set 2 valid intents and emit 2 events', async () => {
// make both markets
await indexer.createTwoSidedMarket(tokenOne, tokenTwo, {
from: aliceAddress,
})
let expiry = await getTimestampPlusDays(1)
// set the intents
let result = await indexer.setTwoSidedIntent(
tokenOne,
tokenTwo,
250,
expiry,
aliceLocator,
{
from: aliceAddress,
}
)
passes(result)
// check both events were emitted
emitted(result, 'Stake', event => {
return (
event.wallet === aliceAddress &&
event.makerToken === tokenOne &&
event.takerToken == tokenTwo &&
event.amount.toNumber() === 250 &&
event.expiry.toNumber() === expiry
)
})
emitted(result, 'Stake', event => {
return (
event.wallet === aliceAddress &&
event.makerToken === tokenTwo &&
event.takerToken == tokenOne &&
event.amount.toNumber() === 250 &&
event.expiry.toNumber() === expiry
)
})
})
})
describe('Test unsetTwoSidedIntent', async () => {
it('should not unset either intent if 1 breaks a rule', async () => {
// make one market and one intent
await indexer.createMarket(tokenOne, tokenTwo, {
from: aliceAddress,
})
let expiry = await getTimestampPlusDays(1)
await indexer.setIntent(tokenOne, tokenTwo, 250, expiry, aliceLocator, {
from: aliceAddress,
})
// try to unset both intents, but the second market doesnt exist
await reverted(
indexer.unsetTwoSidedIntent(tokenOne, tokenTwo, {
from: aliceAddress,
}),
'MARKET_DOES_NOT_EXIST'
)
// create the other market (both exist now), and stake on it
await indexer.createMarket(tokenTwo, tokenOne, {
from: aliceAddress,
})
await indexer.setIntent(tokenTwo, tokenOne, 250, expiry, aliceLocator, {
from: aliceAddress,
})
// unset intent from first market
await indexer.unsetIntent(tokenOne, tokenTwo, {
from: aliceAddress,
})
// try to unset both intents, but fails as alice has only staked on one
await reverted(
indexer.unsetTwoSidedIntent(tokenOne, tokenTwo, {
from: aliceAddress,
}),
'INTENT_DOES_NOT_EXIST'
)
})
it('should unset 2 valid intents and emit 2 events', async () => {
// make both markets
await indexer.createTwoSidedMarket(tokenOne, tokenTwo, {
from: aliceAddress,
})
let expiry = await getTimestampPlusDays(1)
// set both intents
await indexer.setTwoSidedIntent(
tokenOne,
tokenTwo,
250,
expiry,
aliceLocator,
{
from: aliceAddress,
}
)
// now unset 2 intents
let result = await indexer.unsetTwoSidedIntent(tokenOne, tokenTwo, {
from: aliceAddress,
})
passes(result)
// check both events were emitted
emitted(result, 'Unstake', event => {
return (
event.wallet === aliceAddress &&
event.makerToken === tokenOne &&
event.takerToken == tokenTwo &&
event.amount.toNumber() === 250
)
})
emitted(result, 'Unstake', event => {
return (
event.wallet === aliceAddress &&
event.makerToken === tokenTwo &&
event.takerToken == tokenOne &&
event.amount.toNumber() === 250
)
})
})
})
=======
>>>>>>>
<<<<<<<
describe('Test lengthOf', async () => {
it("should return 0 if the market doesn't exist", async () => {
// call length of without creating the market
let result = await indexer.lengthOf.call(tokenOne, tokenTwo)
equal(result, 0, 'result should be 0')
})
it('should return the length of the market', async () => {
// create market
await indexer.createMarket(tokenOne, tokenTwo, {
from: aliceAddress,
})
// set two intents
await indexer.setIntent(
tokenOne,
tokenTwo,
250,
await getTimestampPlusDays(1),
aliceLocator,
{
from: aliceAddress,
}
)
await indexer.setIntent(
tokenOne,
tokenTwo,
250,
await getTimestampPlusDays(1),
bobLocator,
{
from: bobAddress,
}
)
// now call length of
let result = await indexer.lengthOf.call(tokenOne, tokenTwo)
equal(result, 2, 'result should be 2')
})
})
=======
>>>>>>> |
<<<<<<<
indexer = await Indexer.new(tokenAST.address, 200, EMPTY_ADDRESS, {
from: ownerAddress,
})
=======
indexer = await Indexer.new(tokenAST.address, { from: ownerAddress })
>>>>>>>
indexer = await Indexer.new(tokenAST.address, EMPTY_ADDRESS, {
from: ownerAddress,
})
<<<<<<<
it('Alice attempts to stake and set an intent but fails due to minimum', async () => {
await reverted(
indexer.setIntent(
tokenWETH.address,
tokenDAI.address,
100,
await getTimestampPlusDays(1),
aliceLocator,
{
from: aliceAddress,
}
),
'MINIMUM_NOT_MET'
)
})
=======
>>>>>>> |
<<<<<<<
let tx = await delegateFactory.createDelegate(tradeWalletOne, {
from: delegateOwnerOne,
})
=======
const tx = await delegateFactory.createDelegate(
delegateOwnerOne,
tradeWalletOne
)
>>>>>>>
const tx = await delegateFactory.createDelegate(tradeWalletOne, {
from: delegateOwnerOne,
})
<<<<<<<
let tx = await delegateFactory.createDelegate(tradeWalletTwo, {
from: delegateOwnerTwo,
})
=======
const tx = await delegateFactory.createDelegate(
delegateOwnerTwo,
tradeWalletTwo
)
>>>>>>>
const tx = await delegateFactory.createDelegate(tradeWalletTwo, {
from: delegateOwnerTwo,
}) |
<<<<<<<
describe('Swaps (Fungible)', async () => {
let _order
before(
'Alice creates an order for Bob (200 AST for 50 DAI)',
async () => {
_order = await orders.getOrder({
signer: {
wallet: aliceAddress,
token: tokenAST.address,
param: 200,
},
sender: {
wallet: bobAddress,
token: tokenDAI.address,
param: 50,
},
})
_order.signature = await signatures.getWeb3Signature(
_order,
aliceAddress,
swapAddress,
GANACHE_PROVIDER
)
}
)
it('Checks that Bob can swap with Alice (200 AST for 50 DAI)', async () => {
emitted(await swap(_order, { from: bobAddress }), 'Swap')
})
=======
it('Checks that Alice cannot swap with herself (200 AST for 50 AST)', async () => {
const _selfOrder = await orders.getOrder({
signer: {
wallet: aliceAddress,
token: tokenAST.address,
amount: 200,
},
sender: {
wallet: aliceAddress,
token: tokenAST.address,
amount: 50,
},
})
await reverted(
swap(_selfOrder, { from: aliceAddress }),
'INVALID_SELF_TRANSFER'
)
})
>>>>>>>
describe('Swaps (Fungible)', async () => {
let _order
before(
'Alice creates an order for Bob (200 AST for 50 DAI)',
async () => {
_order = await orders.getOrder({
signer: {
wallet: aliceAddress,
token: tokenAST.address,
amount: 200,
},
sender: {
wallet: bobAddress,
token: tokenDAI.address,
amount: 50,
},
})
_order.signature = await signatures.getWeb3Signature(
_order,
aliceAddress,
swapAddress,
GANACHE_PROVIDER
)
}
)
it('Checks that Bob can swap with Alice (200 AST for 50 DAI)', async () => {
emitted(await swap(_order, { from: bobAddress }), 'Swap')
})
<<<<<<<
it('Checks that Bob can not trade more than he holds', async () => {
const order = await orders.getOrder({
signer: {
wallet: bobAddress,
token: tokenDAI.address,
param: 1000,
},
sender: {
wallet: aliceAddress,
},
})
await reverted(swap(order, { from: aliceAddress }))
})
=======
describe('Swaps (Non-standard Fungible)', async () => {
let _order
before('Alice creates an order for Bob (200 OMG for 50 DAI)', async () => {
_order = await orders.getOrder({
signer: {
wallet: aliceAddress,
token: tokenOMG.address,
amount: 200,
},
sender: {
wallet: bobAddress,
token: tokenDAI.address,
amount: 50,
},
})
_order.signature = await signatures.getWeb3Signature(
_order,
aliceAddress,
swapAddress,
GANACHE_PROVIDER
)
})
>>>>>>>
it('Checks that Bob can not trade more than he holds', async () => {
const order = await orders.getOrder({
signer: {
wallet: bobAddress,
token: tokenDAI.address,
amount: 1000,
},
sender: {
wallet: aliceAddress,
},
})
await reverted(swap(order, { from: aliceAddress }))
})
<<<<<<<
it('Checks that Bob cannot take the same order again (200 OMG for 50 DAI)', async () => {
await reverted(
swap(_order, { from: bobAddress }),
'ORDER_TAKEN_OR_CANCELLED'
)
=======
it('Checks that Alice cannot trade more than approved (200 OMG)', async () => {
const order = await orders.getOrder({
signer: {
wallet: aliceAddress,
token: tokenOMG.address,
amount: 200,
},
>>>>>>>
it('Checks that Bob cannot take the same order again (200 OMG for 50 DAI)', async () => {
await reverted(
swap(_order, { from: bobAddress }),
'ORDER_TAKEN_OR_CANCELLED'
)
<<<<<<<
it('Checks that Bob can not trade more than he holds', async () => {
const order = await orders.getOrder({
signer: {
wallet: bobAddress,
token: tokenDAI.address,
param: 1000,
},
sender: {
wallet: aliceAddress,
},
})
await reverted(swap(order, { from: aliceAddress }))
})
=======
describe('Signer Delegation (Signer-side)', async () => {
let _order
let _unsignedOrder
before('Alice creates an order for Bob (200 AST for 50 DAI)', async () => {
_unsignedOrder = await orders.getOrder({
signer: {
wallet: aliceAddress,
token: tokenAST.address,
amount: 50,
},
sender: {
wallet: bobAddress,
token: tokenDAI.address,
amount: 10,
},
})
_order = _unsignedOrder
_order.signature = await signatures.getWeb3Signature(
_order,
davidAddress,
swapAddress,
GANACHE_PROVIDER
)
})
>>>>>>>
it('Checks that Bob can not trade more than he holds', async () => {
const order = await orders.getOrder({
signer: {
wallet: bobAddress,
token: tokenDAI.address,
amount: 1000,
},
sender: {
wallet: aliceAddress,
},
})
await reverted(swap(order, { from: aliceAddress }))
}) |
<<<<<<<
const mockRegistry = accounts[5]
=======
const PROTOCOL = '0x0001'
>>>>>>>
const mockRegistry = accounts[5]
const PROTOCOL = '0x0001' |
<<<<<<<
.then(() => deployer.deploy(Indexer, FungibleToken.address, 250, EMPTY_ADDRESS))
=======
.then(() => deployer.deploy(Indexer, FungibleToken.address))
>>>>>>>
.then(() => deployer.deploy(Indexer, FungibleToken.address, EMPTY_ADDRESS)) |
<<<<<<<
exports.setup = function(svc, loggedOutSvc) {
var splunkjs = require('../splunk');
=======
exports.setup = function(svc) {
var splunkjs = require('../index');
>>>>>>>
exports.setup = function(svc, loggedOutSvc) {
var splunkjs = require('../index');
<<<<<<<
"Properties Tests": {
setUp: function(done) {
this.service = svc;
done();
},
"Callback#list": function(test) {
var that = this;
Async.chain([
function(done) { that.service.properties().refresh(done); },
function(props, done) {
var files = props.list();
test.ok(files.length > 0);
done();
}
],
function(err) {
test.ok(!err);
test.done();
});
},
"Callback#contains": function(test) {
var that = this;
Async.chain([
function(done) { that.service.properties().refresh(done); },
function(props, done) {
var file = props.contains("web");
test.ok(file);
file.refresh(done);
},
function(file, done) {
test.strictEqual(file.name, "web");
done();
}
],
function(err) {
test.ok(!err);
test.done();
});
},
"Callback#contains stanza": function(test) {
var that = this;
Async.chain([
function(done) { that.service.properties().refresh(done); },
function(props, done) {
var file = props.contains("web");
test.ok(file);
file.refresh(done);
},
function(file, done) {
test.strictEqual(file.name, "web");
var stanza = file.contains("settings");
test.ok(stanza);
stanza.refresh(done);
},
function(stanza, done) {
test.ok(stanza.properties().hasOwnProperty("httpport"));
done();
}
],
function(err) {
test.ok(!err);
test.done();
});
},
"Callback#create file + create stanza + update stanza": function(test) {
var that = this;
var fileName = "jssdk_file";
var value = "barfoo_" + getNextId();
Async.chain([
function(done) {
var properties = that.service.properties();
properties.refresh(done);
},
function(properties, done) {
properties.create(fileName, done);
},
function(file, done) {
file.create("stanza", done);
},
function(stanza, done) {
stanza.update({"jssdk_foobar": value}, done);
},
function(stanza, done) {
test.strictEqual(stanza.properties()["jssdk_foobar"], value);
done();
},
function(done) {
var file = new splunkjs.Service.PropertyFile(svc, fileName);
file.refresh(done);
},
function(file, done) {
var stanza = file.contains("stanza");
test.ok(stanza);
stanza.remove(done);
}
],
function(err) {
console.log(err);
test.ok(!err);
test.done();
});
}
}
,
=======
>>>>>>>
"Properties Tests": {
setUp: function(done) {
this.service = svc;
done();
},
"Callback#list": function(test) {
var that = this;
Async.chain([
function(done) { that.service.properties().refresh(done); },
function(props, done) {
var files = props.list();
test.ok(files.length > 0);
done();
}
],
function(err) {
test.ok(!err);
test.done();
});
},
"Callback#contains": function(test) {
var that = this;
Async.chain([
function(done) { that.service.properties().refresh(done); },
function(props, done) {
var file = props.contains("web");
test.ok(file);
file.refresh(done);
},
function(file, done) {
test.strictEqual(file.name, "web");
done();
}
],
function(err) {
test.ok(!err);
test.done();
});
},
"Callback#contains stanza": function(test) {
var that = this;
Async.chain([
function(done) { that.service.properties().refresh(done); },
function(props, done) {
var file = props.contains("web");
test.ok(file);
file.refresh(done);
},
function(file, done) {
test.strictEqual(file.name, "web");
var stanza = file.contains("settings");
test.ok(stanza);
stanza.refresh(done);
},
function(stanza, done) {
test.ok(stanza.properties().hasOwnProperty("httpport"));
done();
}
],
function(err) {
test.ok(!err);
test.done();
});
},
"Callback#create file + create stanza + update stanza": function(test) {
var that = this;
var fileName = "jssdk_file";
var value = "barfoo_" + getNextId();
Async.chain([
function(done) {
var properties = that.service.properties();
properties.refresh(done);
},
function(properties, done) {
properties.create(fileName, done);
},
function(file, done) {
file.create("stanza", done);
},
function(stanza, done) {
stanza.update({"jssdk_foobar": value}, done);
},
function(stanza, done) {
test.strictEqual(stanza.properties()["jssdk_foobar"], value);
done();
},
function(done) {
var file = new splunkjs.Service.PropertyFile(svc, fileName);
file.refresh(done);
},
function(file, done) {
var stanza = file.contains("stanza");
test.ok(stanza);
stanza.remove(done);
}
],
function(err) {
console.log(err);
test.ok(!err);
test.done();
});
}
}, |
<<<<<<<
yield put(notify('error', e.error.details[0].message));
=======
yield put(signUp.failure(new SubmissionError({ _error: e.error.details[0].message })));
yield call([Toast, Toast.red], { message: e.error.details[0].message });
>>>>>>>
yield call([Toast, Toast.red], { message: e.error.details[0].message });
<<<<<<<
yield put(notify('error', e.error));
=======
yield put(signUp.failure(new SubmissionError({ _error: e.error })));
yield call([Toast, Toast.red], { message: e.message });
>>>>>>>
yield call([Toast, Toast.red], { message: e.message });
<<<<<<<
yield put(verifySignUp.failure(new SubmissionError({ _error: e.error })));
yield put(notify('error', e.error));
=======
yield put(confirmEmail.failure(new SubmissionError({ _error: e.error })));
yield call([Toast, Toast.red], { message: e.message });
>>>>>>>
yield put(verifySignUp.failure(new SubmissionError({ _error: e.error })));
yield call([Toast, Toast.red], { message: e.message }); |
<<<<<<<
case 'SET_PEN_UP_HEIGHT':
return {...state, penUpHeight: action.value}
case 'SET_PEN_DOWN_HEIGHT':
return {...state, penDownHeight: action.value}
case 'SET_RESOLUTION':
return {...state, resolution: action.value}
case 'SET_PAPER_SIZE':
const landscape = action.size.size.x === action.size.landscape.size.x
&& action.size.size.y === action.size.landscape.size.y
return {...state, paperSize: action.size, landscape}
case 'SET_LANDSCAPE':
const paperSize = state.paperSize[action.value ? 'landscape' : 'portrait']
return {...state, landscape: action.value, paperSize}
case 'SET_MARGIN':
return {...state, marginMm: action.value}
case 'SET_PATHS':
const {paths, layers, selectedLayers} = action
return {...state, plan: null, paths, layers, selectedLayers}
case 'SET_PLAN':
return {...state, plan: action.plan, plannedOptions: action.planOptions}
case 'SET_LAYERS':
return {...state, selectedLayers: action.selectedLayers}
case 'SET_PROGRESS':
return {...state, progress: action.motionIdx}
default:
console.warn(`Unrecognized action type '${action.type}'`)
return state
=======
case 'SET_PEN_UP_HEIGHT':
return {...state, penUpHeight: action.value}
case 'SET_PEN_DOWN_HEIGHT':
return {...state, penDownHeight: action.value}
case 'SET_PAPER_SIZE':
const landscape = action.size.size.x === action.size.landscape.size.x
&& action.size.size.y === action.size.landscape.size.y
return {...state, paperSize: action.size, landscape}
case 'SET_LANDSCAPE':
const paperSize = state.paperSize[action.value ? 'landscape' : 'portrait']
return {...state, landscape: action.value, paperSize}
case 'SET_MARGIN':
return {...state, marginMm: action.value}
case 'SET_PATHS':
const {paths, layers, selectedLayers} = action
return {...state, plan: null, paths, layers, selectedLayers}
case 'SET_PLAN':
return {...state, plan: action.plan, plannedOptions: action.planOptions}
case 'SET_LAYERS':
return {...state, selectedLayers: action.selectedLayers}
case 'SET_PROGRESS':
return {...state, progress: action.motionIdx}
default:
console.warn(`Unrecognized action type '${action.type}'`)
return state
>>>>>>>
case 'SET_PEN_UP_HEIGHT':
return {...state, penUpHeight: action.value}
case 'SET_PEN_DOWN_HEIGHT':
return {...state, penDownHeight: action.value}
case 'SET_RESOLUTION':
return {...state, resolution: action.value}
case 'SET_PAPER_SIZE':
const landscape = action.size.size.x === action.size.landscape.size.x
&& action.size.size.y === action.size.landscape.size.y
return {...state, paperSize: action.size, landscape}
case 'SET_LANDSCAPE':
const paperSize = state.paperSize[action.value ? 'landscape' : 'portrait']
return {...state, landscape: action.value, paperSize}
case 'SET_MARGIN':
return {...state, marginMm: action.value}
case 'SET_PATHS':
const {paths, layers, selectedLayers} = action
return {...state, plan: null, paths, layers, selectedLayers}
case 'SET_PLAN':
return {...state, plan: action.plan, plannedOptions: action.planOptions}
case 'SET_LAYERS':
return {...state, selectedLayers: action.selectedLayers}
case 'SET_PROGRESS':
return {...state, progress: action.motionIdx}
default:
console.warn(`Unrecognized action type '${action.type}'`)
return state
<<<<<<<
<div>
<PenHeight state={state} driver={driver} />
<PaperConfig state={state} />
<PlanOptions state={state} />
<MotorControl driver={driver} />
<PlanStatistics plan={state.plan} />
=======
<div className="control-panel">
<div className="saxi-title red">
<span className="red reg">s</span><span className="teal">axi</span>
</div>
<div className="section-header">pen</div>
<div className="section-body">
<PenHeight state={state} driver={driver} />
<MotorControl driver={driver} />
</div>
<div className="section-header">paper</div>
<div className="section-body">
<PaperConfig state={state} />
<LayerSelector state={state} />
</div>
<div className="spacer" />
<div className="control-panel-bottom">
<div className="section-header">plot</div>
<div className="section-body section-body__plot">
<PlanStatistics plan={state.plan} />
<PlotButtons state={state} />
</div>
</div>
</div>
<div className="preview-area">
>>>>>>>
<div className="control-panel">
<div className="saxi-title red">
<span className="red reg">s</span><span className="teal">axi</span>
</div>
<div className="section-header">pen</div>
<div className="section-body">
<PenHeight state={state} driver={driver} />
<MotorControl driver={driver} />
</div>
<div className="section-header">paper</div>
<div className="section-body">
<PaperConfig state={state} />
<PlanOptions state={state} />
<LayerSelector state={state} />
</div>
<div className="spacer" />
<div className="control-panel-bottom">
<div className="section-header">plot</div>
<div className="section-body section-body__plot">
<PlanStatistics plan={state.plan} />
<PlotButtons state={state} />
</div>
</div>
</div>
<div className="preview-area">
<<<<<<<
const optimized = timed("optimize")(() => Planning.optimize(deduped))
=======
const optimized = timed('optimize')(() => Planning.optimize(scaledToPaperSelected))
>>>>>>>
const optimized = timed('optimize')(() => Planning.optimize(deduped)) |
<<<<<<<
const expressPath = path.join(cwdPath, options.expressPath)
chokidar
=======
const expressPath = cwdPath + options.expressPath
const watcher = chokidar
>>>>>>>
const expressPath = path.join(cwdPath, options.expressPath)
const watcher = chokidar |
<<<<<<<
mongoUrl: env.MONGOHQ_URL,
mongoUsersUrl: env.MONGO_USERS_URL,
=======
mongoUrl: env.MONGO_URI ? env.MONGO_URI : (env.MONGO_URL ? env.MONGO_URL : env.MONGOHQ_URL),
>>>>>>>
mongoUrl: env.MONGO_URI ? env.MONGO_URI : (env.MONGO_URL ? env.MONGO_URL : env.MONGOHQ_URL),
mongoUsersUrl: env.MONGO_USERS_URL, |
<<<<<<<
}
=======
zoomend: this._zoomEnd // reset the gl map view at the end of a zoom
};
>>>>>>>
}; |
<<<<<<<
server.use(prerender.basicAuth());
=======
server.use(prerender.sendPrerenderHeader());
// server.use(prerender.basicAuth());
>>>>>>>
server.use(prerender.basicAuth());
server.use(prerender.sendPrerenderHeader()); |
<<<<<<<
static isRegisteredForRemoteNotifications() {
return NativeRNNotifications.isRegisteredForRemoteNotifications();
}
static checkPermissions() {
return NativeRNNotifications.checkPermissions();
}
=======
/**
* Remove all delivered notifications from Notification Center
*/
static removeAllDeliveredNotifications() {
return NativeRNNotifications.removeAllDeliveredNotifications();
}
/**
* Removes the specified notifications from Notification Center
*
* @param identifiers Array of notification identifiers
*/
static removeDeliveredNotifications(identifiers: [string]) {
return NativeRNNotifications.removeDeliveredNotifications(identifiers);
}
/**
* Provides you with a list of the app’s notifications that are still displayed in Notification Center
*
* @param callback Function which receive an array of delivered notifications
*
* A delivered notification is an object containing:
*
* - `identifier` : The identifier of this notification.
* - `alertBody` : The message displayed in the notification alert.
* - `alertTitle` : The message title displayed in the notification.
* - `category` : The category of this notification, if has one.
* - `userInfo` : An optional object containing additional notification data.
* - `thread-id` : The thread identifier of this notification, if has one.
* - `fireDate` : The date and time when the system should deliver the notification. if not specified, the notification will be dispatched immediately.
*/
static getDeliveredNotifications(callback: (notifications: [Object]) => void) {
return NativeRNNotifications.getDeliveredNotifications(callback);
}
>>>>>>>
static isRegisteredForRemoteNotifications() {
return NativeRNNotifications.isRegisteredForRemoteNotifications();
}
static checkPermissions() {
return NativeRNNotifications.checkPermissions();
}
/**
* Remove all delivered notifications from Notification Center
*/
static removeAllDeliveredNotifications() {
return NativeRNNotifications.removeAllDeliveredNotifications();
}
/**
* Removes the specified notifications from Notification Center
*
* @param identifiers Array of notification identifiers
*/
static removeDeliveredNotifications(identifiers: [string]) {
return NativeRNNotifications.removeDeliveredNotifications(identifiers);
}
/**
* Provides you with a list of the app’s notifications that are still displayed in Notification Center
*
* @param callback Function which receive an array of delivered notifications
*
* A delivered notification is an object containing:
*
* - `identifier` : The identifier of this notification.
* - `alertBody` : The message displayed in the notification alert.
* - `alertTitle` : The message title displayed in the notification.
* - `category` : The category of this notification, if has one.
* - `userInfo` : An optional object containing additional notification data.
* - `thread-id` : The thread identifier of this notification, if has one.
* - `fireDate` : The date and time when the system should deliver the notification. if not specified, the notification will be dispatched immediately.
*/
static getDeliveredNotifications(callback: (notifications: [Object]) => void) {
return NativeRNNotifications.getDeliveredNotifications(callback);
} |
<<<<<<<
deviceRemoveEventListener,
nativeAppAddEventListener,
nativeAppRemoveEventListener,
nativeRequestPermissionsWithCategories,
nativeAbandonPermissions,
nativeRegisterPushKit,
nativeBackgroundTimeRemaining,
nativeConsumeBackgroundQueue,
nativeLocalNotification,
nativeCancelLocalNotification,
nativeCancelAllLocalNotifications,
nativeSetBadgesCount,
nativeIsRegisteredForRemoteNotifications,
nativeCheckPermissions;
=======
deviceRemoveEventListener,
nativeAppAddEventListener,
nativeAppRemoveEventListener,
nativeRequestPermissionsWithCategories,
nativeAbandonPermissions,
nativeRegisterPushKit,
nativeBackgroundTimeRemaining,
nativeConsumeBackgroundQueue,
nativeLocalNotification,
nativeCancelLocalNotification,
nativeCancelAllLocalNotifications,
nativeRemoveAllDeliveredNotifications,
nativeRemoveDeliveredNotifications,
nativeGetDeliveredNotifications;
>>>>>>>
deviceRemoveEventListener,
nativeAppAddEventListener,
nativeAppRemoveEventListener,
nativeRequestPermissionsWithCategories,
nativeAbandonPermissions,
nativeRegisterPushKit,
nativeBackgroundTimeRemaining,
nativeConsumeBackgroundQueue,
nativeLocalNotification,
nativeCancelLocalNotification,
nativeCancelAllLocalNotifications,
nativeSetBadgesCount,
nativeIsRegisteredForRemoteNotifications,
nativeCheckPermissions,
nativeRemoveAllDeliveredNotifications,
nativeRemoveDeliveredNotifications,
nativeGetDeliveredNotifications;
<<<<<<<
nativeSetBadgesCount = sinon.spy();
nativeIsRegisteredForRemoteNotifications = sinon.spy();
nativeCheckPermissions = sinon.spy();
=======
nativeRemoveAllDeliveredNotifications = sinon.spy();
nativeRemoveDeliveredNotifications = sinon.spy();
nativeGetDeliveredNotifications = sinon.spy();
>>>>>>>
nativeSetBadgesCount = sinon.spy();
nativeIsRegisteredForRemoteNotifications = sinon.spy();
nativeCheckPermissions = sinon.spy();
nativeRemoveAllDeliveredNotifications = sinon.spy();
nativeRemoveDeliveredNotifications = sinon.spy();
nativeGetDeliveredNotifications = sinon.spy();
<<<<<<<
cancelAllLocalNotifications: nativeCancelAllLocalNotifications,
setBadgesCount: nativeSetBadgesCount,
isRegisteredForRemoteNotifications: nativeIsRegisteredForRemoteNotifications,
checkPermissions: nativeCheckPermissions
=======
cancelAllLocalNotifications: nativeCancelAllLocalNotifications,
removeAllDeliveredNotifications: nativeRemoveAllDeliveredNotifications,
removeDeliveredNotifications: nativeRemoveDeliveredNotifications,
getDeliveredNotifications: nativeGetDeliveredNotifications
>>>>>>>
cancelAllLocalNotifications: nativeCancelAllLocalNotifications,
setBadgesCount: nativeSetBadgesCount,
isRegisteredForRemoteNotifications: nativeIsRegisteredForRemoteNotifications,
checkPermissions: nativeCheckPermissions,
removeAllDeliveredNotifications: nativeRemoveAllDeliveredNotifications,
removeDeliveredNotifications: nativeRemoveDeliveredNotifications,
getDeliveredNotifications: nativeGetDeliveredNotifications
<<<<<<<
nativeIsRegisteredForRemoteNotifications.reset();
nativeCheckPermissions.reset();
=======
nativeRemoveAllDeliveredNotifications.reset();
nativeRemoveDeliveredNotifications.reset();
nativeGetDeliveredNotifications.reset();
>>>>>>>
nativeIsRegisteredForRemoteNotifications.reset();
nativeCheckPermissions.reset();
nativeRemoveAllDeliveredNotifications.reset();
nativeRemoveDeliveredNotifications.reset();
nativeGetDeliveredNotifications.reset();
<<<<<<<
nativeIsRegisteredForRemoteNotifications = null;
nativeCheckPermissions = null;
=======
nativeRemoveAllDeliveredNotifications = null;
nativeRemoveDeliveredNotifications = null;
nativeGetDeliveredNotifications = null;
>>>>>>>
nativeIsRegisteredForRemoteNotifications = null;
nativeCheckPermissions = null;
nativeRemoveAllDeliveredNotifications = null;
nativeRemoveDeliveredNotifications = null;
nativeGetDeliveredNotifications = null;
<<<<<<<
describe("Is registered for remote notifications ", () => {
it("should call native is registered for remote notifications", () => {
NotificationsIOS.isRegisteredForRemoteNotifications();
expect(nativeIsRegisteredForRemoteNotifications).to.have.been.calledWith();
});
});
describe("Check permissions ", () => {
it("should call native check permissions", () => {
NotificationsIOS.checkPermissions();
expect(nativeCheckPermissions).to.have.been.calledWith();
});
});
=======
describe("Remove all delivered notifications", () => {
it("should call native remove all delivered notifications method", () => {
NotificationsIOS.removeAllDeliveredNotifications();
expect(nativeRemoveAllDeliveredNotifications).to.have.been.calledWith();
});
});
describe("Remove delivered notifications", () => {
it("should call native remove delivered notifications method", () => {
NotificationsIOS.removeDeliveredNotifications(identifiers);
expect(nativeRemoveDeliveredNotifications).to.have.been.calledWith(identifiers);
});
});
describe("Get delivered notifications", () => {
it("should call native get delivered notifications method", () => {
const callback = (notifications) => console.log(notifications);
NotificationsIOS.getDeliveredNotifications(callback);
expect(nativeGetDeliveredNotifications).to.have.been.calledWith(callback);
});
});
>>>>>>>
describe("Is registered for remote notifications ", () => {
it("should call native is registered for remote notifications", () => {
NotificationsIOS.isRegisteredForRemoteNotifications();
expect(nativeIsRegisteredForRemoteNotifications).to.have.been.calledWith();
});
});
describe("Check permissions ", () => {
it("should call native check permissions", () => {
NotificationsIOS.checkPermissions();
expect(nativeCheckPermissions).to.have.been.calledWith();
});
});
describe("Remove all delivered notifications", () => {
it("should call native remove all delivered notifications method", () => {
NotificationsIOS.removeAllDeliveredNotifications();
expect(nativeRemoveAllDeliveredNotifications).to.have.been.calledWith();
});
});
describe("Remove delivered notifications", () => {
it("should call native remove delivered notifications method", () => {
NotificationsIOS.removeDeliveredNotifications(identifiers);
expect(nativeRemoveDeliveredNotifications).to.have.been.calledWith(identifiers);
});
});
describe("Get delivered notifications", () => {
it("should call native get delivered notifications method", () => {
const callback = (notifications) => console.log(notifications);
NotificationsIOS.getDeliveredNotifications(callback);
expect(nativeGetDeliveredNotifications).to.have.been.calledWith(callback);
});
}); |
<<<<<<<
this._boundedEventHandlers = {};
=======
this.id = HotelDatepicker.getNewId();
>>>>>>>
this._boundedEventHandlers = {};
this.id = HotelDatepicker.getNewId();
<<<<<<<
HotelDatepicker.prototype.addBoundedListener = function addBoundedListener (node, event, handler, capture) {
if (!(node in this._boundedEventHandlers)) {
// _boundedEventHandlers stores references to nodes
this._boundedEventHandlers[node] = {};
}
if (!(event in this._boundedEventHandlers[node])) {
// Each entry contains another entry for each event type
this._boundedEventHandlers[node][event] = [];
}
// Capture reference
var boundedHandler = handler.bind(this);
this._boundedEventHandlers[node][event].push([boundedHandler, capture]);
node.addEventListener(event, boundedHandler, capture);
};
HotelDatepicker.prototype.removeAllBoundedListeners = function removeAllBoundedListeners (node, event) {
if (node in this._boundedEventHandlers) {
var handlers = this._boundedEventHandlers[node];
if (event in handlers) {
var eventHandlers = handlers[event];
for (var i = eventHandlers.length; i--;) {
var handler = eventHandlers[i];
node.removeEventListener(event, handler[0], handler[1]);
}
}
}
};
=======
HotelDatepicker.getNewId = function getNewId () {
return ++idCounter;
};
>>>>>>>
HotelDatepicker.prototype.addBoundedListener = function addBoundedListener (node, event, handler, capture) {
if (!(node in this._boundedEventHandlers)) {
// _boundedEventHandlers stores references to nodes
this._boundedEventHandlers[node] = {};
}
if (!(event in this._boundedEventHandlers[node])) {
// Each entry contains another entry for each event type
this._boundedEventHandlers[node][event] = [];
}
// Capture reference
var boundedHandler = handler.bind(this);
this._boundedEventHandlers[node][event].push([boundedHandler, capture]);
node.addEventListener(event, boundedHandler, capture);
};
HotelDatepicker.prototype.removeAllBoundedListeners = function removeAllBoundedListeners (node, event) {
if (node in this._boundedEventHandlers) {
var handlers = this._boundedEventHandlers[node];
if (event in handlers) {
var eventHandlers = handlers[event];
for (var i = eventHandlers.length; i--;) {
var handler = eventHandlers[i];
node.removeEventListener(event, handler[0], handler[1]);
}
}
}
HotelDatepicker.getNewId = function getNewId () {
return ++idCounter;
}; |
<<<<<<<
this.input = input;
input.setAttribute("aria-autocomplete", "list");
=======
this.input = $(input);
this.input.setAttribute("aria-autocomplete", "list");
>>>>>>>
this.input = $(input);
this.input.setAttribute("aria-autocomplete", "list");
<<<<<<<
=======
this.status = $.create("span", {
className: "visually-hidden",
role: "status",
"aria-live": "assertive",
"aria-relevant": "additions",
inside: this.container
});
>>>>>>>
this.status = $.create("span", {
className: "visually-hidden",
role: "status",
"aria-live": "assertive",
"aria-relevant": "additions",
inside: this.container
});
<<<<<<<
// If the dropdown `ul` is in view, then act on keydown for the following keys:
// Enter / Esc / Up / Down
if(me.opened) {
if (c === 13 && me.selected) { // Enter
evt.preventDefault();
me.select();
}
else if (c === 27) { // Esc
me.close();
}
else if (c === 38 || c === 40) { // Down/Up arrow
evt.preventDefault();
me[c === 38? "previous" : "next"]();
}
=======
if (c === 13 && me.selected) { // Enter
evt.preventDefault();
me.select();
}
else if (c === 27) { // Esc
me.close();
}
else if (c === 38 || c === 40) { // Down/Up arrow
evt.preventDefault();
me[c === 38? "previous" : "next"]();
>>>>>>>
// If the dropdown `ul` is in view, then act on keydown for the following keys:
// Enter / Esc / Up / Down
if(me.opened) {
if (c === 13 && me.selected) { // Enter
evt.preventDefault();
me.select();
}
else if (c === 27) { // Esc
me.close();
}
else if (c === 38 || c === 40) { // Down/Up arrow
evt.preventDefault();
me[c === 38? "previous" : "next"]();
}
<<<<<<<
$.bind(this.input.form, {"submit": me.close.bind(me)});
=======
$.bind(this.input.form, {"submit": this.close.bind(this)});
>>>>>>>
$.bind(this.input.form, {"submit": this.close.bind(this)});
<<<<<<<
if (input.hasAttribute("list")) {
=======
if (this.input.hasAttribute("list")) {
>>>>>>>
if (this.input.hasAttribute("list")) {
<<<<<<<
get opened() {
return this.ul && this.ul.getAttribute("hidden") == null;
},
=======
>>>>>>>
get opened() {
return this.ul && this.ul.getAttribute("hidden") == null;
},
<<<<<<<
this.open();
=======
if (this.ul.children.length === 0) {
this.close();
} else {
this.open();
}
>>>>>>>
if (this.ul.children.length === 0) {
this.close();
} else {
this.open();
} |
<<<<<<<
const debugApiIds = newDebug('steem:api_ids');
const debugWs = newDebug('steem:ws');
let WebSocket;
if (isNode) {
WebSocket = require('ws'); // eslint-disable-line global-require
} else if (typeof window !== 'undefined') {
WebSocket = window.WebSocket;
} else {
throw new Error('Couldn\'t decide on a `WebSocket` class');
}
const DEFAULTS = {
apiIds: {
database_api: 0,
login_api: 1,
follow_api: 2,
network_broadcast_api: 4,
},
id: 0,
};
=======
>>>>>>>
<<<<<<<
this.inFlight = 0;
this.currentP = Promise.fulfilled();
this.apiIds = this.options.apiIds;
this.isOpen = false;
this.releases = [];
// A Map of api name to a promise to it's API ID refresh call
this.apiIdsP = {};
}
setWebSocket(url) {
console.warn("steem.api.setWebSocket(url) is now deprecated instead use steem.config.set('websocket',url)");
debugSetup('Setting WS', url);
config.set('websocket', url);
this.stop();
}
start() {
if (this.startP) {
return this.startP;
}
const startP = new Promise((resolve, reject) => {
if (startP !== this.startP) return;
const url = config.get('websocket');
this.ws = new WebSocket(url);
const releaseOpen = this.listenTo(this.ws, 'open', () => {
debugWs('Opened WS connection with', url);
this.isOpen = true;
releaseOpen();
resolve();
});
const releaseClose = this.listenTo(this.ws, 'close', () => {
debugWs('Closed WS connection with', url);
this.isOpen = false;
delete this.ws;
this.stop();
if (startP.isPending()) {
reject(new Error(
'The WS connection was closed before this operation was made'
));
}
});
const releaseMessage = this.listenTo(this.ws, 'message', (message) => {
debugWs('Received message', message.data);
this.emit('message', JSON.parse(message.data));
});
this.releases = this.releases.concat([
releaseOpen,
releaseClose,
releaseMessage,
]);
});
this.startP = startP;
this.getApiIds();
return startP;
}
stop() {
debugSetup('Stopping...');
if (this.ws) this.ws.close();
this.apiIdsP = {};
delete this.startP;
delete this.ws;
this.releases.forEach((release) => release());
this.releases = [];
}
listenTo(target, eventName, callback) {
debugEmitters('Adding listener for', eventName, 'from', target.constructor.name);
if (target.addEventListener) target.addEventListener(eventName, callback);
else target.on(eventName, callback);
return () => {
debugEmitters('Removing listener for', eventName, 'from', target.constructor.name);
if (target.removeEventListener) target.removeEventListener(eventName, callback);
else target.removeListener(eventName, callback);
};
}
/**
* Refreshes API IDs, populating the `Steem::apiIdsP` map.
*
* @param {String} [requestName] If provided, only this API will be refreshed
* @param {Boolean} [force] If true the API will be forced to refresh, ignoring existing results
*/
getApiIds(requestName, force) {
if (!force && requestName && this.apiIdsP[requestName]) {
return this.apiIdsP[requestName];
}
const apiNamesToRefresh = requestName ? [requestName] : Object.keys(this.apiIds);
apiNamesToRefresh.forEach((name) => {
debugApiIds('Syncing API ID', name);
this.apiIdsP[name] = this.getApiByNameAsync(name).then((result) => {
if (result != null) {
this.apiIds[name] = result;
} else {
debugApiIds('Dropped null API ID for', name, result);
}
});
});
// If `requestName` was provided, only wait for this API ID
if (requestName) {
return this.apiIdsP[requestName];
}
// Otherwise wait for all of them
return Promise.props(this.apiIdsP);
}
waitForSlot() {
if (this.inFlight < 10) {
debugEmitters('Less than 10 in-flight messages, moving on');
return null;
}
debugEmitters('More than 10 in-flight messages, waiting');
return Promise.delay(100).then(() => {
if (this.inFlight < 10) {
debugEmitters('Less than 10 in-flight messages, moving on');
return null;
}
return this.waitForSlot();
});
=======
this.uri = config.uri;
>>>>>>>
this.uri = config.get('uri');
<<<<<<<
const startP = this.start();
const apiIdsP = api === 'login_api' && data.method === 'get_api_by_name'
? Promise.fulfilled()
: this.getApiIds(api);
if (api === 'login_api' && data.method === 'get_api_by_name') {
debugApiIds('Sending setup message');
} else {
debugApiIds('Going to wait for setup messages to resolve');
}
this.currentP = Promise.join(startP, apiIdsP, this.waitForSlot())
.then(() => new Promise((resolve, reject) => {
if (!this.ws) {
reject(new Error(
'The WS connection was closed while this request was pending'
));
return;
}
const payload = JSON.stringify({
id,
method: 'call',
params: [
this.apiIds[api],
data.method,
data.params,
],
});
const release = this.listenTo(this, 'message', (message) => {
// We're still seeing old messages
if (message.id !== id) {
debugProtocol('Different message was dropped', message);
return;
}
this.inFlight -= 1;
release();
// Our message's response came back
const errorCause = message.error;
if (errorCause) {
const err = new Error(
// eslint-disable-next-line prefer-template
(errorCause.message || 'Failed to complete operation') +
' (see err.payload for the full error payload)'
);
err.payload = message;
reject(err);
return;
}
if (api === 'login_api' && data.method === 'login') {
debugApiIds(
'network_broadcast_api API ID depends on the WS\' session. ' +
'Triggering a refresh...'
);
this.getApiIds('network_broadcast_api', true);
}
debugProtocol('Resolved', api, data, '->', message);
resolve(message.result);
});
debugWs('Sending message', payload);
this.ws.send(payload);
}))
.nodeify(callback);
this.inFlight += 1;
=======
const payload = {
id,
method: 'call',
params: [
api,
data.method,
data.params,
],
};
fetch(this.uri, {
method: 'POST',
body: JSON.stringify(payload),
})
.then((res) => {
return res.json();
})
.then((json) => {
const err = json.error || '';
const result = json.result || '';
callback(err, result);
}).catch((err) => {
callback(err, '');
});
}
>>>>>>>
const payload = {
id,
method: 'call',
params: [
api,
data.method,
data.params,
],
};
fetch(this.uri, {
method: 'POST',
body: JSON.stringify(payload),
})
.then((res) => {
return res.json();
})
.then((json) => {
const err = json.error || '';
const result = json.result || '';
callback(err, result);
}).catch((err) => {
callback(err, '');
});
} |
<<<<<<<
var bcrypt = require('bcryptjs');
=======
var Articles = require('../models/article.js');
var bcrypt = require('bcrypt');
>>>>>>>
var bcrypt = require('bcryptjs');
var Articles = require('../models/article.js'); |
<<<<<<<
=======
.factory('ClassView', function($http, $route) {
var qid;
return {
getQid: function(){
qid = ($route.current.params.id) ? ($route.current.params.id) : "Q5";
return qid;
}
};
})
>>>>>>>
.factory('ClassView', function($http, $route) {
var qid;
return {
getQid: function(){
qid = ($route.current.params.id) ? ($route.current.params.id) : "Q5";
return qid;
}
};
})
<<<<<<<
.directive('pageSelection', ['$compile', 'Classes', function($compile, Classes){
var generatePagnition = function(promise){
console.log(promise);
promise.then(function(data){
data.refresh();
console.log(data.getPageSelectorData());
});
// ret = "";
// for (var i = from)
// return "<div>" + arg + "</div>";
};
return {
restrict: 'E',
scope: {
properties: '='
},
template: generatePagnition(Classes),
link: function(element){
console.log(element);
}
}
}])
=======
.controller('ClassViewController', function($scope,Classes,ClassView){
$scope.qid = ClassView.getQid();
$scope.url = "http://www.wikidata.org/entity/" + $scope.qid;
var url = buildUrlForSparQLRequest(getQueryForInstances ($scope.qid, 10));
xhr(url).then(function(response) {
$scope.exampleInstances = parseExampleInstances(response);
console.log("parsed ExampleInstances");
});
xhr(buildUrlForApiRequest($scope.qid)).then(function(response){
$scope.classData = parseClassDataFromJson(response, $scope.qid);
console.log("parsed class data");
});
Classes.then(function(data){
$scope.relatedProperties = util.parseRelatedProperties($scope.qid, data.getClasses());
$scope.classNumbers = util.parseClassNumbers($scope.qid, data.getClasses());
//$scope.exampleInstances = getExampleInstances($scope.qid);
//$scope.classNumbers = getNumberForClass($scope.qid);
console.log("fetched ClassData");
});
})
>>>>>>>
.directive('pageSelection', ['$compile', 'Classes', function($compile, Classes){
var generatePagnition = function(promise){
console.log(promise);
promise.then(function(data){
data.refresh();
console.log(data.getPageSelectorData());
});
// ret = "";
// for (var i = from)
// return "<div>" + arg + "</div>";
};
return {
restrict: 'E',
scope: {
properties: '='
},
template: generatePagnition(Classes),
link: function(element){
console.log(element);
}
}
}])
.controller('ClassViewController', function($scope,Classes,ClassView){
$scope.qid = ClassView.getQid();
$scope.url = "http://www.wikidata.org/entity/" + $scope.qid;
var url = buildUrlForSparQLRequest(getQueryForInstances ($scope.qid, 10));
xhr(url).then(function(response) {
$scope.exampleInstances = parseExampleInstances(response);
console.log("parsed ExampleInstances");
});
xhr(buildUrlForApiRequest($scope.qid)).then(function(response){
$scope.classData = parseClassDataFromJson(response, $scope.qid);
console.log("parsed class data");
});
Classes.then(function(data){
$scope.relatedProperties = util.parseRelatedProperties($scope.qid, data.getClasses());
$scope.classNumbers = util.parseClassNumbers($scope.qid, data.getClasses());
//$scope.exampleInstances = getExampleInstances($scope.qid);
//$scope.classNumbers = getNumberForClass($scope.qid);
console.log("fetched ClassData");
});
}) |
<<<<<<<
$("[data-toggle=popover]").popover({html:true});
var classBrowser = angular.module('classBrowserApp', ['ngAnimate', 'ngRoute', 'utilities', 'ui.bootstrap', 'pascalprecht.translate'])
=======
var classBrowser = angular.module('classBrowserApp', ['ngAnimate', 'ngRoute', 'utilities', 'angucomplete-alt'])
>>>>>>>
$("[data-toggle=popover]").popover({html:true});
var classBrowser = angular.module('classBrowserApp', ['ngAnimate', 'ngRoute', 'utilities', 'ui.bootstrap', 'pascalprecht.translate', 'angucomplete-alt'])
<<<<<<<
=======
var idArray;
>>>>>>>
var idArray;
<<<<<<<
getClasses: function(id){ return getData(id, 'pc', []); }
=======
getClasses: function(id){ return getData(id, 'pc', []); },
formatRelatedProperties: formatRelatedProperties,
sortProperties: function(comparator){idArray.sort(comparator(properties));}
>>>>>>>
getClasses: function(id){ return getData(id, 'pc', []); },
sortProperties: function(comparator){idArray.sort(comparator(properties));}
<<<<<<<
getNonemptySubclasses: function(id){ return getData(id, 'sb', []); }
=======
getNonemptySubclasses: getNonemptySubclasses,
sortClasses: function(comparator){idArray.sort(comparator(classes));}
>>>>>>>
getNonemptySubclasses: function(id){ return getData(id, 'sb', []); },
sortClasses: function(comparator){ idArray.sort(comparator(classes)); } |
<<<<<<<
.when('/classview', { templateUrl: 'views/classview.html' })
.when('/propertyview', { templateUrl: 'views/propertyview.html'})
.when('/query', { templateUrl: 'views/queryview.html'})
=======
.when('/view', { templateUrl: 'views/view.html' })
>>>>>>>
.when('/view', { templateUrl: 'views/view.html' })
.when('/query', { templateUrl: 'views/queryview.html'}) |
<<<<<<<
function uniqueClasses(list) {
list = list.split(' ');
var hash = {};
var i = list.length;
var out = [];
while (i--) {
if (!hash.hasOwnProperty(list[i])) {
hash[list[i]] = 1;
out.unshift(list[i]);
}
}
return out.join(' ');
}
=======
/**
* cache (or polyfill for <= IE8) Array.forEach()
* source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach
*/
var forEach = Array.prototype.forEach || function (fn, scope) {
if (this === void 0 || this === null || typeof fn !== 'function') {
throw new TypeError();
}
/* jshint bitwise: false */
var i, len = this.length >>> 0;
/* jshint bitwise: true */
for (i = 0; i < len; ++i) {
if (i in this) {
fn.call(scope, this[i], i, this);
}
}
};
>>>>>>>
function uniqueClasses(list) {
list = list.split(' ');
var hash = {};
var i = list.length;
var out = [];
while (i--) {
if (!hash.hasOwnProperty(list[i])) {
hash[list[i]] = 1;
out.unshift(list[i]);
}
}
return out.join(' ');
}
/**
* cache (or polyfill for <= IE8) Array.forEach()
* source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach
*/
var forEach = Array.prototype.forEach || function (fn, scope) {
if (this === void 0 || this === null || typeof fn !== 'function') {
throw new TypeError();
}
/* jshint bitwise: false */
var i, len = this.length >>> 0;
/* jshint bitwise: true */
for (i = 0; i < len; ++i) {
if (i in this) {
fn.call(scope, this[i], i, this);
}
}
}; |
<<<<<<<
const {
getTempFilePath,
complete,
cleanupStream,
tempFileHandler
} = require('./tempFileHandler');
=======
const processNested = require('./processNested');
>>>>>>>
const {
getTempFilePath,
complete,
cleanupStream,
tempFileHandler
} = require('./tempFileHandler');
const processNested = require('./processNested'); |
<<<<<<<
'networks': [
{
=======
'networks': {
'mainnet': {
'userCreated': false,
'http': 'https://gethnode.com/http',
'name': 'Mainnet (default)',
'ws': 'wss://gethnode.com/ws',
'id': '1'
},
'rinkeby': {
>>>>>>>
'networks': [
{
'userCreated': false,
'http': 'https://gethnode.com/http',
'name': 'Mainnet (default)',
'ws': 'wss://gethnode.com/ws',
'id': '1'
},
{
<<<<<<<
},
{
'userCreated': false,
'http': 'https://gethnode.com/http',
'name': 'Mainnet',
'ws': 'wss://gethnode.com/ws',
'id': '1'
=======
>>>>>>> |
<<<<<<<
* @param {Object} [options.style] Map style and data source definition (either a JSON object or a JSON URL), described in the [style reference](https://mapbox.com/mapbox-gl-style-spec/)
=======
* @param {Object|string} options.style Map style. This must be an an object conforming to the schema described in the [style reference](https://mapbox.com/mapbox-gl-style-spec/), or a URL to a JSON style. To load a style from the Mapbox API, you can use a URL of the form `mapbox://styles/:owner/:style`, where `:owner` is your Mapbox account name and `:style` is the style ID. Or you can use one of the predefined Mapbox styles:
* * `mapbox://styles/mapbox/basic-v8` - Simple and flexible starting template.
* * `mapbox://styles/mapbox/bright-v8` - Template for complex custom basemaps.
* * `mapbox://styles/mapbox/streets-v8` - A ready-to-use basemap, perfect for minor customization or incorporating your own data.
* * `mapbox://styles/mapbox/light-v8` - Subtle light backdrop for data vizualizations.
* * `mapbox://styles/mapbox/dark-v8` - Subtle dark backdrop for data vizualizations.
>>>>>>>
* @param {Object|string} [options.style] Map style. This must be an an object conforming to the schema described in the [style reference](https://mapbox.com/mapbox-gl-style-spec/), or a URL to a JSON style. To load a style from the Mapbox API, you can use a URL of the form `mapbox://styles/:owner/:style`, where `:owner` is your Mapbox account name and `:style` is the style ID. Or you can use one of the predefined Mapbox styles:
* * `mapbox://styles/mapbox/basic-v8` - Simple and flexible starting template.
* * `mapbox://styles/mapbox/bright-v8` - Template for complex custom basemaps.
* * `mapbox://styles/mapbox/streets-v8` - A ready-to-use basemap, perfect for minor customization or incorporating your own data.
* * `mapbox://styles/mapbox/light-v8` - Subtle light backdrop for data vizualizations.
* * `mapbox://styles/mapbox/dark-v8` - Subtle dark backdrop for data vizualizations. |
<<<<<<<
glyphVertex.add(anchor.x, anchor.y, tl.x, tl.y, tex.x, tex.y, angle, minZoom, placementRange, maxZoom, placementZoom);
glyphVertex.add(anchor.x, anchor.y, tr.x, tr.y, tex.x + width, tex.y, angle, minZoom, placementRange, maxZoom, placementZoom);
glyphVertex.add(anchor.x, anchor.y, bl.x, bl.y, tex.x, tex.y + height, angle, minZoom, placementRange, maxZoom, placementZoom);
=======
glyphVertex.add(glyphAnchor.x, glyphAnchor.y, tl.x, tl.y, tex.x, tex.y, angle, minZoom, placementRange, maxZoom);
glyphVertex.add(glyphAnchor.x, glyphAnchor.y, tr.x, tr.y, tex.x + width, tex.y, angle, minZoom, placementRange, maxZoom);
glyphVertex.add(glyphAnchor.x, glyphAnchor.y, bl.x, bl.y, tex.x, tex.y + height, angle, minZoom, placementRange, maxZoom);
>>>>>>>
glyphVertex.add(glyphAnchor.x, glyphAnchor.y, tl.x, tl.y, tex.x, tex.y, angle, minZoom, placementRange, maxZoom, placementZoom);
glyphVertex.add(glyphAnchor.x, glyphAnchor.y, tr.x, tr.y, tex.x + width, tex.y, angle, minZoom, placementRange, maxZoom, placementZoom);
glyphVertex.add(glyphAnchor.x, glyphAnchor.y, bl.x, bl.y, tex.x, tex.y + height, angle, minZoom, placementRange, maxZoom, placementZoom);
<<<<<<<
glyphVertex.add(anchor.x, anchor.y, tr.x, tr.y, tex.x + width, tex.y, angle, minZoom, placementRange, maxZoom, placementZoom);
glyphVertex.add(anchor.x, anchor.y, bl.x, bl.y, tex.x, tex.y + height, angle, minZoom, placementRange, maxZoom, placementZoom);
glyphVertex.add(anchor.x, anchor.y, br.x, br.y, tex.x + width, tex.y + height, angle, minZoom, placementRange, maxZoom, placementZoom);
=======
glyphVertex.add(glyphAnchor.x, glyphAnchor.y, tr.x, tr.y, tex.x + width, tex.y, angle, minZoom, placementRange, maxZoom);
glyphVertex.add(glyphAnchor.x, glyphAnchor.y, bl.x, bl.y, tex.x, tex.y + height, angle, minZoom, placementRange, maxZoom);
glyphVertex.add(glyphAnchor.x, glyphAnchor.y, br.x, br.y, tex.x + width, tex.y + height, angle, minZoom, placementRange, maxZoom);
>>>>>>>
glyphVertex.add(glyphAnchor.x, glyphAnchor.y, tr.x, tr.y, tex.x + width, tex.y, angle, minZoom, placementRange, maxZoom, placementZoom);
glyphVertex.add(glyphAnchor.x, glyphAnchor.y, bl.x, bl.y, tex.x, tex.y + height, angle, minZoom, placementRange, maxZoom, placementZoom);
glyphVertex.add(glyphAnchor.x, glyphAnchor.y, br.x, br.y, tex.x + width, tex.y + height, angle, minZoom, placementRange, maxZoom, placementZoom); |
<<<<<<<
constructor (options = {}) {
super(template, {
topic: options.topic,
reference: options.topic.url,
canComment: options.canComment
});
this.options = options;
this.topic = options.topic;
this.page = 0;
this.filter = new CommentsFilter();
this.sort = this.filter.getSort();
this.filter.appendTo(this.find('.all-comments h4')[0]);
this.comments = [];
this.mycomments = [];
this.textarea = this.find('textarea');
this.form = this.find('form')[0];
=======
constructor (topic) {
super(template, { topic: topic, reference: topic.url })
this.topic = topic
this.page = 0
this.filter = new CommentsFilter()
this.sort = this.filter.getSort()
this.filter.appendTo(this.find('.all-comments h4')[0])
this.comments = []
this.mycomments = []
this.textarea = this.find('textarea')
this.form = this.find('form')[0]
>>>>>>>
constructor (options = {}) {
super(template, {
topic: options.topic,
reference: options.topic.url,
canComment: options.canComment
})
this.options = options
this.topic = options.topic
this.page = 0
this.filter = new CommentsFilter()
this.sort = this.filter.getSort()
this.filter.appendTo(this.find('.all-comments h4')[0])
this.comments = []
this.mycomments = []
this.textarea = this.find('textarea')
this.form = this.find('form')[0]
<<<<<<<
var card = new CommentCard({
canComment: this.options.canComment,
comment
});
this.comments.push(comment);
var container = this.find('.comments-list')[0];
card.appendTo(container);
card.on('delete', function(){
self.comments.splice(self.comments.indexOf(comment), 1);
self.bound('refreshState')();
});
=======
var card = new CommentCard(comment)
this.comments.push(comment)
var container = this.find('.comments-list')[0]
card.appendTo(container)
card.on('delete', function () {
self.comments.splice(self.comments.indexOf(comment), 1)
self.bound('refreshState')()
})
>>>>>>>
var card = new CommentCard({
canComment: this.options.canComment,
comment
})
this.comments.push(comment)
var container = this.find('.comments-list')[0]
card.appendTo(container)
card.on('delete', function () {
self.comments.splice(self.comments.indexOf(comment), 1)
self.bound('refreshState')()
})
<<<<<<<
let card = new CommentCard({
canComment: this.options.canComment,
comment
});
let container = this.find('.my-comments-list')[0];
this.mycomments.push(comment);
card.appendTo(container);
card.on('delete', this.bound('removemycomment'));
=======
let card = new CommentCard(comment)
let container = this.find('.my-comments-list')[0]
this.mycomments.push(comment)
card.appendTo(container)
card.on('delete', this.bound('removemycomment'))
>>>>>>>
let card = new CommentCard({
canComment: this.options.canComment,
comment
})
let container = this.find('.my-comments-list')[0]
this.mycomments.push(comment)
card.appendTo(container)
card.on('delete', this.bound('removemycomment')) |
<<<<<<<
GLPainter.prototype.drawTile = function(tile, layers) {
this.setExtent(tile.tileExtent);
=======
Painter.prototype.drawTile = function(tile, layers) {
>>>>>>>
Painter.prototype.drawTile = function(tile, layers) {
this.setExtent(tile.tileExtent); |
<<<<<<<
var GlyphAtlas = require('../symbol/glyph_atlas');
var SpriteAtlas = require('../symbol/sprite_atlas');
=======
>>>>>>>
<<<<<<<
this.glyphAtlas = new GlyphAtlas(1024, 1024);
// this.glyphAtlas.debug = true;
this.glyphAtlas.bind(gl);
this.spriteAtlas = new SpriteAtlas(512, 512);
this.spriteAtlas.resize(browser.devicePixelRatio);
// this.spriteAtlas.debug = true;
=======
>>>>>>> |
<<<<<<<
['a_pos', 'a_extrude', 'a_linesofar'],
['u_matrix', 'u_linewidth', 'u_color', 'u_ratio', 'u_dasharray', 'u_blur', 'u_extra', 'u_antialiasingmatrix']);
=======
['a_pos', 'a_data'],
['u_matrix', 'u_exmatrix', 'u_linewidth', 'u_color', 'u_ratio', 'u_blur']);
>>>>>>>
['a_pos', 'a_data'],
['u_matrix', 'u_linewidth', 'u_color', 'u_ratio', 'u_blur', 'u_extra', 'u_antialiasingmatrix']);
<<<<<<<
['a_pos', 'a_tex', 'a_offset', 'a_angle', 'a_minzoom', 'a_maxzoom', 'a_rangeend', 'a_rangestart', 'a_labelminzoom'],
['u_matrix', 'u_exmatrix', 'u_texture', 'u_texsize', 'u_color', 'u_gamma', 'u_buffer', 'u_angle', 'u_zoom', 'u_flip', 'u_fadedist', 'u_minfadezoom', 'u_maxfadezoom', 'u_fadezoom', 'u_skewed', 'u_extra']);
=======
['a_pos', 'a_offset', 'a_data1', 'a_data2'],
['u_matrix', 'u_exmatrix', 'u_texture', 'u_texsize', 'u_color', 'u_gamma', 'u_buffer', 'u_angle', 'u_zoom', 'u_flip', 'u_fadedist', 'u_minfadezoom', 'u_maxfadezoom', 'u_fadezoom']);
>>>>>>>
['a_pos', 'a_offset', 'a_data1', 'a_data2'],
['u_matrix', 'u_exmatrix', 'u_texture', 'u_texsize', 'u_color', 'u_gamma', 'u_buffer', 'u_angle', 'u_zoom', 'u_flip', 'u_fadedist', 'u_minfadezoom', 'u_maxfadezoom', 'u_fadezoom', 'u_skewed', 'u_extra']);
<<<<<<<
['a_pos', 'a_tex', 'a_offset', 'a_angle', 'a_minzoom', 'a_maxzoom', 'a_rangeend', 'a_rangestart', 'a_labelminzoom'],
['u_matrix', 'u_exmatrix', 'u_texture', 'u_texsize', 'u_angle', 'u_zoom', 'u_flip', 'u_fadedist', 'u_minfadezoom', 'u_maxfadezoom', 'u_fadezoom', 'u_opacity', 'u_skewed', 'u_extra']);
=======
['a_pos', 'a_offset', 'a_data1', 'a_data2'],
['u_matrix', 'u_exmatrix', 'u_texture', 'u_texsize', 'u_angle', 'u_zoom', 'u_flip', 'u_fadedist', 'u_minfadezoom', 'u_maxfadezoom', 'u_fadezoom', 'u_opacity']);
>>>>>>>
['a_pos', 'a_offset', 'a_data1', 'a_data2'],
['u_matrix', 'u_exmatrix', 'u_texture', 'u_texsize', 'u_angle', 'u_zoom', 'u_flip', 'u_fadedist', 'u_minfadezoom', 'u_maxfadezoom', 'u_fadezoom', 'u_opacity', 'u_skewed', 'u_extra']); |
<<<<<<<
"gaussian": glify('../../shaders/gaussian.*.glsl'),
"label": glify('../../shaders/label.*.glsl'),
=======
>>>>>>>
"gaussian": glify('../../shaders/gaussian.*.glsl'), |
<<<<<<<
if (info['icon-image'] && this.sprite) {
imagePos = this.sprite[resolveTokens(feature, info['icon-image'])];
=======
if (info['point-image'] && this.sprite) {
imagePos = this.sprite[resolveTokens(feature.properties, info['point-image'])];
>>>>>>>
if (info['icon-image'] && this.sprite) {
imagePos = this.sprite[resolveTokens(feature.properties, info['icon-image'])]; |
<<<<<<<
, t = require('t')
, delegates = require('delegates')
=======
, events = require('events')
>>>>>>>
, t = require('t')
, events = require('events')
<<<<<<<
this.options = domify(options({ proposal: proposal, citizen: citizen, t: t }));
this.events = delegates(this.options, this);
// this.events.bind('click a.change-vote small', 'showvote');
this.events.bind('click .vote-box .direct-vote .vote-option span', 'vote');
this.events.bind('click .vote-box .proxy-vote .vote-option span', 'proxy');
this.events.bind('click .vote-box .meta-data a.change-vote small', 'changevote');
=======
this.options = domify(options({ proposal: proposal, citizen: citizen }));
this.events = events(this.options, this);
this.events.bind('click .vote-box .direct-vote .vote-option', 'vote');
// this.events.bind('click .vote-box .proxy-vote .vote-option', 'proxy');
this.events.bind('click .vote-box .meta-data .change-vote', 'changevote');
>>>>>>>
this.options = domify(options({ proposal: proposal, citizen: citizen, t: t }));
this.events = events(this.options, this);
this.events.bind('click .vote-box .direct-vote .vote-option', 'vote');
// this.events.bind('click .vote-box .proxy-vote .vote-option', 'proxy');
this.events.bind('click .vote-box .meta-data .change-vote', 'changevote'); |
<<<<<<<
exports.Map = require('./map.js');
exports.evented = require('./evented.js');
exports.chroma = require('./lib/chroma.js');
exports.util = require('./util.js');
=======
if (typeof window === 'undefined') {
require('./worker/worker.js');
} else {
exports.Map = require('./ui/map.js');
exports.Style = require('./style/style.js');
exports.StyleLayer = require('./style/stylelayer.js');
exports.evented = require('./lib/evented.js');
exports.chroma = require('./lib/chroma.js');
exports.util = require('./util/util.js');
}
>>>>>>>
if (typeof window === 'undefined') {
require('./worker/worker.js');
} else {
exports.Map = require('./ui/map.js');
exports.evented = require('./lib/evented.js');
exports.chroma = require('./lib/chroma.js');
exports.util = require('./util/util.js');
} |
<<<<<<<
actor.send('get icons', {
id: tile.id,
icons: icons
}, setIcons.bind(this));
=======
actor.send('get icons', {icons: icons}, function(err, newicons) {
if (err) return callback(err);
this.icons = newicons;
callback();
}.bind(this));
>>>>>>>
actor.send('get icons', { icons: icons }, setIcons.bind(this)); |
<<<<<<<
Collision.prototype.place = function(boxes, anchor, horizontal, props) {
var padding = props['text-padding'];
var alwaysVisible = props['text-always-visible'];
var minPlacementScale = anchor.scale;
=======
Collision.prototype.place = function(boxes, anchor, minPlacementScale, maxPlacementScale,
padding, horizontal, allowOverlap, ignorePlacement) {
>>>>>>>
Collision.prototype.place = function(boxes, anchor, horizontal, props) {
var padding = props['text-padding'];
var allowOverlap = props['symbol-allow-overlap'];
var ignorePlacement = props['symbol-ignore-placement'];
var minPlacementScale = anchor.scale;
<<<<<<<
var scale = alwaysVisible ? minPlacementScale :
this.getPlacementScale(boxes, minPlacementScale, padding);
=======
var scale = allowOverlap ? minPlacementScale :
this.getPlacementScale(boxes, minPlacementScale, maxPlacementScale, padding);
>>>>>>>
var scale = allowOverlap ? minPlacementScale :
this.getPlacementScale(boxes, minPlacementScale, padding); |
<<<<<<<
drawLine(gl, painter, layerData, layerStyle, tile, stats, params, style.sprite);
=======
drawLine(gl, painter, layerData, layerStyle, tile, stats[layer.bucket], params);
>>>>>>>
drawLine(gl, painter, layerData, layerStyle, tile, stats[layer.bucket], params, style.sprite);
<<<<<<<
gl.vertexAttribPointer(painter.fillShader.a_pos, vertex.itemSize / 2, gl.SHORT, false, 0, 0);
gl.drawElements(gl.TRIANGLES, (end - begin) * 3, gl.UNSIGNED_SHORT, begin * 6);
=======
stats.triangles += (end - begin);
buffer++;
}
>>>>>>>
gl.vertexAttribPointer(painter.fillShader.a_pos, vertex.itemSize / 2, gl.SHORT, false, 0, 0);
gl.drawElements(gl.TRIANGLES, (end - begin) * 3, gl.UNSIGNED_SHORT, begin * 6);
stats.triangles += (end - begin);
<<<<<<<
begin = buffer == layer.fillBufferIndex ? layer.fillVertexIndex : 0;
end = buffer == layer.fillBufferIndexEnd ? layer.fillVertexIndexEnd : vertex.index;
gl.vertexAttribPointer(painter.outlineShader.a_pos, 2, gl.SHORT, false, 0, 0);
gl.drawArrays(gl.LINE_STRIP, begin, (end - begin));
buffer++;
}
=======
stats.lines += (end - begin);
buffer++;
>>>>>>>
begin = buffer == layer.fillBufferIndex ? layer.fillVertexIndex : 0;
end = buffer == layer.fillBufferIndexEnd ? layer.fillVertexIndexEnd : vertex.index;
gl.vertexAttribPointer(painter.outlineShader.a_pos, 2, gl.SHORT, false, 0, 0);
gl.drawArrays(gl.LINE_STRIP, begin, (end - begin));
stats.lines += (end - begin);
buffer++;
} |
<<<<<<<
, config = require('lib/config');
=======
, env = require('./env')
, utils = require('lib/utils')
, mandrillMailer = require('lib/mailer').mandrillMailer
, expressUrl = require('lib/express-url');
>>>>>>>
, config = require('lib/config');
<<<<<<<
* Save config in app
*/
app.set('config', config);
/**
* Set `mongoUrl` from config settings
*/
app.set( 'mongoUrl', config('mongoUrl') );
/**
=======
* Config mandrill mailer
*/
mandrillMailer(app);
/**
>>>>>>>
* Save config in app
*/
app.set('config', config);
/**
* Set `mongoUrl` from config settings
*/
app.set( 'mongoUrl', config('mongoUrl') );
/**
* Config mandrill mailer
*/
mandrillMailer(app);
/** |
<<<<<<<
} else if (info.type == 'point') {
var image = painter.images.texture(gl, info.url, tile.url);
if (image) {
gl.disable(gl.STENCIL_TEST);
gl.switchShader(painter.pointShader, painter.posMatrix, painter.exMatrix);
var first = typeof tile.point.positionBuffer === 'undefined';
// Positions
if (first) tile.point.positionBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, tile.point.positionBuffer);
if (first) gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(tile.point.points), gl.STATIC_DRAW);
gl.vertexAttribPointer(painter.pointShader.a_pos, 2, gl.FLOAT, false, 0, 0);
// Corners
if (first) tile.point.cornerBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, tile.point.cornerBuffer);
if (first) gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(tile.point.corners), gl.STATIC_DRAW);
gl.vertexAttribPointer(painter.pointShader.a_corner, 2, gl.FLOAT, false, 0, 0);
// Indices
if (first) tile.point.indexBuffer = gl.createBuffer();
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, tile.point.indexBuffer);
if (first) gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(tile.point.indices), gl.STATIC_DRAW);
// Image and canvas size
gl.uniform2fv(painter.pointShader.u_size, [image.img.width, image.img.height]);
gl.uniform2fv(painter.pointShader.u_canvasSize, [window.innerWidth, window.innerHeight]); // todo fix this
gl.bindTexture(gl.TEXTURE_2D, image.texture);
gl.drawElements(gl.TRIANGLES, tile.point.indices.length, gl.UNSIGNED_SHORT, 0);
}
} else {
for (var i = 0; i < layer.labels.length; i++) {
var label = layer.labels[i];
labelTexture.drawText('400 50px Helvetica Neue', label.text, label.x, label.y, painter.textSize);
}
}
}
}
gl.switchShader(this.labelShader, this.posMatrix, this.exMatrix);
=======
} else if (info.type == 'text') {
var labelTexture = tile.labelTexture;
gl.switchShader(painter.labelShader, painter.posMatrix, painter.exMatrix);
labelTexture.bind(painter);
>>>>>>>
} else if (info.type == 'point') {
var image = painter.images.texture(gl, info.url, tile.url);
if (image) {
gl.disable(gl.STENCIL_TEST);
gl.switchShader(painter.pointShader, painter.posMatrix, painter.exMatrix);
var first = typeof tile.point.positionBuffer === 'undefined';
// Positions
if (first) tile.point.positionBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, tile.point.positionBuffer);
if (first) gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(tile.point.points), gl.STATIC_DRAW);
gl.vertexAttribPointer(painter.pointShader.a_pos, 2, gl.FLOAT, false, 0, 0);
// Corners
if (first) tile.point.cornerBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, tile.point.cornerBuffer);
if (first) gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(tile.point.corners), gl.STATIC_DRAW);
gl.vertexAttribPointer(painter.pointShader.a_corner, 2, gl.FLOAT, false, 0, 0);
// Indices
if (first) tile.point.indexBuffer = gl.createBuffer();
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, tile.point.indexBuffer);
if (first) gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(tile.point.indices), gl.STATIC_DRAW);
// Image and canvas size
gl.uniform2fv(painter.pointShader.u_size, [image.img.width, image.img.height]);
gl.uniform2fv(painter.pointShader.u_canvasSize, [window.innerWidth, window.innerHeight]); // todo fix this
gl.bindTexture(gl.TEXTURE_2D, image.texture);
gl.drawElements(gl.TRIANGLES, tile.point.indices.length, gl.UNSIGNED_SHORT, 0);
}
} else if (info.type == 'text') {
var labelTexture = tile.labelTexture;
gl.switchShader(painter.labelShader, painter.posMatrix, painter.exMatrix);
labelTexture.bind(painter); |
<<<<<<<
var express = require('express');
var restrict = require('lib/utils').restrict;
var accepts = require('lib/accepts');
var utils = require('lib/utils');
var expose = utils.expose;
var api = require('lib/db-api');
var privileges = require('lib/forum-middlewares').privileges;
var t = require('t-component');
var log = require('debug')('democracyos:comment');
=======
/**
* Module dependencies.
*/
var express = require('express')
var restrict = require('lib/utils').restrict
var accepts = require('lib/accepts')
var utils = require('lib/utils')
var expose = utils.expose
var api = require('lib/db-api')
var t = require('t-component')
var log = require('debug')('democracyos:comment')
>>>>>>>
var express = require('express')
var restrict = require('lib/utils').restrict
var accepts = require('lib/accepts')
var utils = require('lib/utils')
var expose = utils.expose
var api = require('lib/db-api')
var privileges = require('lib/forum-middlewares').privileges
var t = require('t-component')
var log = require('debug')('democracyos:comment')
<<<<<<<
app.param('id', function (req, res, next, id) {
api.comment.getById(id, function (err, comment) {
if (err) {
log('Error fetching comment: %s', err);
return res.status(404).send();
}
if (!comment) return res.status(404).send();
req.comment = comment;
var topicId = comment.topicId || comment.reference;
if (!topicId) {
log('Error getting topicId of comment: %s', id);
return res.status(500).send();
}
api.topic.get(topicId, function (topicErr, topic) {
if (topicErr) {
log('Error fetching topic of comment: %s', topicErr);
return res.status(500).send();
}
if (!topic) {
log('Error finding topic of comment: %s', id, topicId);
return res.status(500).send();
}
req.topic = topic;
if (!topic.forum) {
log('Error finding forum of comment: %s', topic.forum);
return res.status(500).send();
}
api.forum.findById(topic.forum, function (_err, forum) {
if (_err || !forum) return _handleError(_err, req, res);
req.forum = forum;
next();
});
});
});
});
app.post('/comment/:id/reply', restrict, privileges('canVoteAndComment'), function (req, res) {
log('Request /comment/%s/reply %j', req.params.id, req.body.reply);
=======
app.post('/comment/:id/reply', restrict, function (req, res) {
log('Request /comment/%s/reply %j', req.params.id, req.body.reply)
>>>>>>>
app.param('id', function (req, res, next, id) {
api.comment.getById(id, function (err, comment) {
if (err) {
log('Error fetching comment: %s', err)
return res.status(404).send()
}
if (!comment) return res.status(404).send()
req.comment = comment
var topicId = comment.topicId || comment.reference
if (!topicId) {
log('Error getting topicId of comment: %s', id)
return res.status(500).send()
}
api.topic.get(topicId, function (topicErr, topic) {
if (topicErr) {
log('Error fetching topic of comment: %s', topicErr)
return res.status(500).send()
}
if (!topic) {
log('Error finding topic of comment: %s', id, topicId)
return res.status(500).send()
}
req.topic = topic
if (!topic.forum) {
log('Error finding forum of comment: %s', topic.forum)
return res.status(500).send()
}
api.forum.findById(topic.forum, function (_err, forum) {
if (_err || !forum) return _handleError(_err, req, res)
req.forum = forum
next()
})
})
})
})
app.post('/comment/:id/reply', restrict, privileges('canVoteAndComment'), function (req, res) {
log('Request /comment/%s/reply %j', req.params.id, req.body.reply)
<<<<<<<
app.get('/comment/:id/replies', privileges('canView'), function (req, res) {
log('Request /comment/%s/replies', req.params.id);
=======
app.get('/comment/:id/replies', function (req, res) {
log('Request /comment/%s/replies', req.params.id)
>>>>>>>
app.get('/comment/:id/replies', privileges('canView'), function (req, res) {
log('Request /comment/%s/replies', req.params.id)
<<<<<<<
'id createdAt editedAt text',
'author.id author.fullName author.avatar'
].join(' ');
=======
'id createdAt editedAt text',
'author.id author.fullName author.avatar'
].join(' ')
>>>>>>>
'id createdAt editedAt text',
'author.id author.fullName author.avatar'
].join(' ')
<<<<<<<
app.post('/comment/:id/upvote', restrict, privileges('canVoteAndComment'), function (req, res) {
log('Request /comment/%s/upvote', req.params.id);
=======
app.post('/comment/:id/upvote', restrict, function (req, res) {
log('Request /comment/%s/upvote', req.params.id)
>>>>>>>
app.post('/comment/:id/upvote', restrict, privileges('canVoteAndComment'), function (req, res) {
log('Request /comment/%s/upvote', req.params.id)
<<<<<<<
app.post('/comment/:id/downvote', restrict, privileges('canVoteAndComment'), function (req, res) {
log('Request /comment/%s/upvote', req.params.id);
=======
app.post('/comment/:id/downvote', restrict, function (req, res) {
log('Request /comment/%s/upvote', req.params.id)
>>>>>>>
app.post('/comment/:id/downvote', restrict, privileges('canVoteAndComment'), function (req, res) {
log('Request /comment/%s/upvote', req.params.id)
<<<<<<<
app.post('/comment/:id/unflag', restrict, privileges('canVoteAndComment'), function (req, res) {
log('Request /comment/%s/unflag', req.params.id);
=======
app.post('/comment/:id/unflag', restrict, function (req, res) {
log('Request /comment/%s/unflag', req.params.id)
>>>>>>>
app.post('/comment/:id/unflag', restrict, privileges('canVoteAndComment'), function (req, res) {
log('Request /comment/%s/unflag', req.params.id)
<<<<<<<
app.put('/comment/:id', restrict, privileges('canVoteAndComment'), function (req, res) {
log('Request PUT /comment/%s', req.params.id);
=======
app.put('/comment/:id', restrict, function (req, res) {
log('Request PUT /comment/%s', req.params.id)
>>>>>>>
app.put('/comment/:id', restrict, privileges('canVoteAndComment'), function (req, res) {
log('Request PUT /comment/%s', req.params.id)
<<<<<<<
comment.text = req.body.text;
comment.editedAt = Date.now();
api.comment.edit(comment, function (_err) {
if (_err) return _handleError(_err, req, res);
=======
comment.text = req.body.text
comment.editedAt = Date.now()
api.comment.edit(comment, function (err, comment) {
if (err) return _handleError(err, req, res)
>>>>>>>
comment.text = req.body.text;
comment.editedAt = Date.now();
api.comment.edit(comment, function (_err) {
if (_err) return _handleError(_err, req, res)
<<<<<<<
reply.text = req.body.text;
reply.editedAt = Date.now();
api.comment.editReply(comment, reply, function (_err) {
if (_err) return _handleError(_err, req, res);
=======
reply.text = req.body.text
reply.editedAt = Date.now()
api.comment.editReply(comment, reply, function (err, comment) {
if (err) return _handleError(err, req, res)
>>>>>>>
reply.text = req.body.text
reply.editedAt = Date.now()
api.comment.editReply(comment, reply, function (_err) {
if (_err) return _handleError(_err, req, res)
<<<<<<<
api.comment.remove(comment, function (_err) {
if (_err) return _handleError(_err, req, res);
=======
api.comment.remove(comment, function (err) {
if (err) return _handleError(err, req, res)
>>>>>>>
api.comment.remove(comment, function (_err) {
if (_err) return _handleError(_err, req, res) |
<<<<<<<
GlyphSource.prototype.getSimpleGlyphs = function(fontstack, glyphIDs, tileID, callback) {
=======
GlyphSource.prototype.getRects = function(fontstack, glyphIDs, uid, callback) {
>>>>>>>
GlyphSource.prototype.getSimpleGlyphs = function(fontstack, glyphIDs, uid, callback) {
<<<<<<<
var rect = glyphAtlas.addGlyph(tileID, fontstack, glyph, buffer);
if (glyph) glyphs[glyphID] = new SimpleGlyph(glyph, rect, buffer);
=======
var buffer = 3;
rects[glyphID] = glyphAtlas.addGlyph(uid, fontstack, glyph, buffer);
if (glyph) glyphs[glyphID] = simpleGlyph(glyph);
>>>>>>>
var rect = glyphAtlas.addGlyph(uid, fontstack, glyph, buffer);
if (glyph) glyphs[glyphID] = new SimpleGlyph(glyph, rect, buffer);
<<<<<<<
var rect = glyphAtlas.addGlyph(tileID, fontstack, glyph, buffer);
if (glyph) glyphs[glyphID] = new SimpleGlyph(glyph, rect, buffer);
=======
var buffer = 3;
rects[glyphID] = glyphAtlas.addGlyph(uid, fontstack, glyph, buffer);
if (glyph) glyphs[glyphID] = simpleGlyph(glyph);
>>>>>>>
var rect = glyphAtlas.addGlyph(uid, fontstack, glyph, buffer);
if (glyph) glyphs[glyphID] = new SimpleGlyph(glyph, rect, buffer); |
<<<<<<<
/**
* @param {TileCoord} parent TileCoord that is potentially a parent of this TileCoord
* @param {number} sourceMaxZoom x and y coordinates only shift with z up to sourceMaxZoom
* @returns {boolean} result boolean describing whether or not `child` is a child tile of the root
*/
isChildOf(parent: TileCoord, sourceMaxZoom: number) {
const parentZ = Math.min(sourceMaxZoom, parent.z);
const childZ = Math.min(sourceMaxZoom, this.z);
=======
isChildOf(parent: any) {
>>>>>>>
/**
* @param {TileCoord} parent TileCoord that is potentially a parent of this TileCoord
* @param {number} sourceMaxZoom x and y coordinates only shift with z up to sourceMaxZoom
* @returns {boolean} result boolean describing whether or not `child` is a child tile of the root
* @private
*/
isChildOf(parent: TileCoord, sourceMaxZoom: number) {
const parentZ = Math.min(sourceMaxZoom, parent.z);
const childZ = Math.min(sourceMaxZoom, this.z); |
<<<<<<<
['u_matrix', 'u_exmatrix', 'u_texture', 'u_texsize', 'u_color', 'u_gamma', 'u_buffer', 'u_zoom', 'u_fadedist', 'u_minfadezoom', 'u_maxfadezoom', 'u_fadezoom']);
=======
['u_matrix', 'u_exmatrix', 'u_texture', 'u_texsize', 'u_color', 'u_gamma', 'u_buffer', 'u_angle', 'u_zoom', 'u_flip', 'u_fadedist', 'u_minfadezoom', 'u_maxfadezoom', 'u_fadezoom', 'u_skewed', 'u_extra']);
>>>>>>>
['u_matrix', 'u_exmatrix', 'u_texture', 'u_texsize', 'u_color', 'u_gamma', 'u_buffer', 'u_zoom', 'u_fadedist', 'u_minfadezoom', 'u_maxfadezoom', 'u_fadezoom', 'u_skewed', 'u_extra']);
<<<<<<<
['u_matrix', 'u_exmatrix', 'u_texture', 'u_texsize', 'u_zoom', 'u_fadedist', 'u_minfadezoom', 'u_maxfadezoom', 'u_fadezoom', 'u_opacity']);
=======
['u_matrix', 'u_exmatrix', 'u_texture', 'u_texsize', 'u_angle', 'u_zoom', 'u_flip', 'u_fadedist', 'u_minfadezoom', 'u_maxfadezoom', 'u_fadezoom', 'u_opacity', 'u_skewed', 'u_extra']);
>>>>>>>
['u_matrix', 'u_exmatrix', 'u_texture', 'u_texsize', 'u_zoom', 'u_fadedist', 'u_minfadezoom', 'u_maxfadezoom', 'u_fadezoom', 'u_opacity', 'u_skewed', 'u_extra']); |
<<<<<<<
this._transportType = null;
this._transportParameters = null;
this._transport = null;
=======
this._speedometer = null;
this._controlPointCharacteristicId = null;
this._packetCharacteristicId = null;
this._handleProgressUpdate = _.throttle(this._handleProgressUpdate.bind(this), 1000);
>>>>>>>
this._transportType = null;
this._transportParameters = null;
this._transport = null;
this._speedometer = null;
this._handleProgressUpdate = _.throttle(this._handleProgressUpdate.bind(this), 1000);
<<<<<<<
_performSingleUpdate(update) {
return new Promise((resolve, reject) => {
this._getProgressHandlers(update)
.then(([initPacketProgressHandler, firmwareProgressHandler]) => {
// Set up and configure transport
DfuTransportFactory.create(this._transportParameters)
.then(transport => { this._transport = transport; })
// Send the update
.then(() => this._sendInitPacket(update['initPacket'], initPacketProgressHandler))
.then(() => this._sendFirmware(update['firmware'], firmwareProgressHandler))
// That's all
.then(() => setTimeout(() => resolve(), 5000))
.catch(err => reject(err));
})
.catch(err => reject(err));
});
}
_sendInitPacket(dataPromise, progressHandler) {
return this._sendData(dataPromise,
this._transport.sendInitPacket.bind(this._transport),
progressHandler);
}
_sendFirmware(dataPromise, progressHandler) {
return this._sendData(dataPromise,
this._transport.sendFirmware.bind(this._transport),
progressHandler);
}
_sendData(dataPromise, sendFunction, progressHandler) {
return new Promise((resolve, reject) => {
Promise.resolve()
.then(() => this._transport.on('progressUpdate', progressHandler))
.then(dataPromise)
.then(data => sendFunction(data))
.then(() => this._transport.removeListener('progressUpdate', progressHandler))
.then(() => resolve())
.catch(err => {
this._transport.removeListener('progressUpdate', progressHandler);
reject(err);
});
})
}
_getProgressHandlers(update) {
return Promise.all([
Promise.resolve()
.then(update['initPacket'])
.then(data => this._handleProgressFactory(0.05, 0.1, data.length))
.catch(err => reject(err)),
Promise.resolve()
.then(update['firmware'])
.then(data => this._handleProgressFactory(0.1, 1.0, data.length))
.catch(err => reject(err))
]);
=======
_performSingleUpdate(transport, update) {
transport.on('progressUpdate', this._handleProgressUpdate);
return Promise.resolve()
.then(update['initPacket'])
.then(data => transport.sendInitPacket(data))
.then(update['firmware'])
.then(data => this._transferFirmware(transport, data))
.then(() => transport.removeListener('progressUpdate', this._handleProgressUpdate))
.catch(err => {
transport.removeListener('progressUpdate', this._handleProgressUpdate);
throw err;
});
>>>>>>>
_performSingleUpdate(update) {
return new Promise((resolve, reject) => {
DfuTransportFactory.create(this._transportParameters)
.then(transport => { this._transport = transport; })
.then(() => this._transport.on('progressUpdate', this._handleProgressUpdate))
.then(update['initPacket'])
.then(data => this._transport.sendInitPacket(data))
.then(update['firmware'])
.then(data => this._transferFirmware(this._transport, data))
.then(() => this._transport.removeListener('progressUpdate', this._handleProgressUpdate))
.then(() => setTimeout(() => resolve(), 5000))
.catch(err => {
this._transport.removeListener('progressUpdate', this._handleProgressUpdate);
reject(err);
});
}); |
<<<<<<<
, tag: { type:ObjectId, ref:'Tag', required: true }
=======
, officialTitle: { type: String, required: false }
, mediaTitle: { type: String, required: false }
, summary: { type: String, required: false }
>>>>>>>
, tag: { type:ObjectId, ref:'Tag', required: true }
, officialTitle: { type: String, required: false }
, mediaTitle: { type: String, required: false }
, summary: { type: String, required: false } |
<<<<<<<
var express = require('express');
var api = require('lib/db-api');
var utils = require('lib/utils');
var accepts = require('lib/accepts');
var restrict = utils.restrict;
var expose = utils.expose;
var log = require('debug')('democracyos:topic');
var config = require('lib/config');
var notifier = require('lib/notifications').notifier;
var privileges = require('lib/forum-middlewares').privileges;
var migrateTopic = require('lib/migrations/topic');
var app = module.exports = express();
=======
/**
* Module dependencies.
*/
var express = require('express')
var mongoose = require('mongoose')
var api = require('lib/db-api')
var utils = require('lib/utils')
var accepts = require('lib/accepts')
var restrict = utils.restrict
var pluck = utils.pluck
var expose = utils.expose
var log = require('debug')('democracyos:topic')
var config = require('lib/config')
var notifier = require('lib/notifications').notifier
var migrateTopic = require('lib/migrations/topic')
var hasAccess = require('lib/is-owner').hasAccess
var app = module.exports = express()
>>>>>>>
var express = require('express')
var api = require('lib/db-api')
var utils = require('lib/utils')
var accepts = require('lib/accepts')
var restrict = utils.restrict
var expose = utils.expose
var log = require('debug')('democracyos:topic')
var config = require('lib/config')
var notifier = require('lib/notifications').notifier
var privileges = require('lib/forum-middlewares').privileges
var migrateTopic = require('lib/migrations/topic')
var app = module.exports = express()
<<<<<<<
app.get('/topic/:id/sidecomments', privileges('canView'), function (req, res) {
log('Requesting /topic/%s/sidecomments', req.params.id);
=======
app.get('/topic/:id/sidecomments', function (req, res) {
log('Requesting /topic/%s/sidecomments', req.params.id)
// var paging = { page: 0, limit: 0, sort: 'createdAt', exclude_user: null }
>>>>>>>
app.get('/topic/:id/sidecomments', privileges('canView'), function (req, res) {
log('Requesting /topic/%s/sidecomments', req.params.id)
<<<<<<<
app.get('/topic/:id/my-comments', restrict, privileges('canView'), function (req, res) {
log('Request /topic/%s/my-comments', req.params.id);
=======
app.get('/topic/:id/my-comments', restrict, function (req, res) {
log('Request /topic/%s/my-comments', req.params.id)
>>>>>>>
app.get('/topic/:id/my-comments', restrict, privileges('canView'), function (req, res) {
log('Request /topic/%s/my-comments', req.params.id)
<<<<<<<
app.post('/topic/:id/link', restrict, privileges('canChangeTopics'), function (req, res) {
log('Request POST /topic/%s/link', req.params.id);
=======
app.post('/topic/:id/link', restrict, hasAccess, function (req, res) {
log('Request POST /topic/%s/link', req.params.id)
>>>>>>>
app.post('/topic/:id/link', restrict, privileges('canChangeTopics'), function (req, res) {
log('Request POST /topic/%s/link', req.params.id)
<<<<<<<
app.delete('/topic/:id/link', restrict, privileges('canChangeTopics'), function (req, res) {
log('Request DELETE /topic/%s/link', req.params.id);
=======
app.delete('/topic/:id/link', restrict, hasAccess, function (req, res) {
log('Request DELETE /topic/%s/link', req.params.id)
>>>>>>>
app.delete('/topic/:id/link', restrict, privileges('canChangeTopics'), function (req, res) {
log('Request DELETE /topic/%s/link', req.params.id)
<<<<<<<
app.post('/topic/:id/publish', restrict, privileges('canChangeTopics'), function (req, res) {
log('Request POST /topic/%s/publish', req.params.id);
=======
app.post('/topic/:id/publish', restrict, hasAccess, function (req, res) {
log('Request POST /topic/%s/publish', req.params.id)
>>>>>>>
app.post('/topic/:id/publish', restrict, privileges('canChangeTopics'), function (req, res) {
log('Request POST /topic/%s/publish', req.params.id)
<<<<<<<
.send(function (notifyErr) {
if (notifyErr) {
log('Error when sending notification for event %s', eventName);
=======
.send(function (err) {
if (err) {
log('Error when sending notification for event %s', eventName)
>>>>>>>
.send(function (notifyErr) {
if (notifyErr) {
log('Error when sending notification for event %s', eventName)
<<<<<<<
app.post('/topic/:id/unpublish', restrict, privileges('canChangeTopics'), function (req, res) {
log('Request POST /topic/%s/unpublish', req.params.id);
=======
app.post('/topic/:id/unpublish', restrict, hasAccess, function (req, res) {
log('Request POST /topic/%s/unpublish', req.params.id)
>>>>>>>
app.post('/topic/:id/unpublish', restrict, privileges('canChangeTopics'), function (req, res) {
log('Request POST /topic/%s/unpublish', req.params.id)
<<<<<<<
app.delete('/topic/:id', restrict, privileges('canChangeTopics'), function (req, res) {
log('Request DEL /topic/%s', req.params.id);
=======
app.delete('/topic/:id', restrict, hasAccess, function (req, res) {
log('Request DEL /topic/%s', req.params.id)
>>>>>>>
app.delete('/topic/:id', restrict, privileges('canChangeTopics'), function (req, res) {
log('Request DEL /topic/%s', req.params.id)
<<<<<<<
log('Error found: %s', err);
var error = err;
if (err.errors && err.errors.text) error = err.errors.text;
if (error.type) error = error.type;
=======
log('Error found: %s', err)
var error = err
if (err.errors && err.errors.text) error = err.errors.text
if (error.type) error = error.type
>>>>>>>
log('Error found: %s', err)
var error = err
if (err.errors && err.errors.text) error = err.errors.text
if (error.type) error = error.type |
<<<<<<<
# INSERT(trigger_cell, destination_range [,formula_range,value_range,formula_range, ...])
# DELETEIF(trigger_cell, criteria , test_range)
# COMMAND(trigger_cell, commands)
# COMMANDIF(trigger_cell, condition, commands)
=======
# INSERT(trigger_cell, destination_range [,formula_range,value_range,formula_range, ...]) //
# DELETEIF(trigger_cell, criteria , test_range) //
# PANEL(indices_or_csv, panel1_range [, panel2_range , ...])
>>>>>>>
# INSERT(trigger_cell, destination_range [,formula_range,value_range,formula_range, ...])
# DELETEIF(trigger_cell, criteria , test_range)
# COMMAND(trigger_cell, commands)
# COMMANDIF(trigger_cell, condition, commands)
# PANEL(indices_or_csv, panel1_range [, panel2_range , ...])
<<<<<<<
,COMMAND: [4, 14]
,COMMANDIF: [4, 13, 14]
=======
,PANEL:[15, -12] // # PANEL(indices_or_csv, panel1_range [, panel2_range , ...])
>>>>>>>
,COMMAND: [4, 14]
,COMMANDIF: [4, 13, 14]
,PANEL:[15, -12] // # PANEL(indices_or_csv, panel1_range [, panel2_range , ...])
<<<<<<<
SocialCalc.Formula.FunctionList["COMMAND"] = [SocialCalc.Formula.IoFunctions, -1, "trigger_cell, commands", "", "action", "", "EventTree"];
SocialCalc.Formula.FunctionList["COMMANDIF"] = [SocialCalc.Formula.IoFunctions, -1, "trigger_cell, conditions, commands", "", "action", "", "EventTree"];
=======
SocialCalc.Formula.FunctionList["PANEL"] = [SocialCalc.Formula.IoFunctions, -1, "showindices_range_or_csv, panel1_range [, panel2_range , ...]", "", "action", "", "EventTree"];
>>>>>>>
SocialCalc.Formula.FunctionList["COMMAND"] = [SocialCalc.Formula.IoFunctions, -1, "trigger_cell, commands", "", "action", "", "EventTree"];
SocialCalc.Formula.FunctionList["COMMANDIF"] = [SocialCalc.Formula.IoFunctions, -1, "trigger_cell, conditions, commands", "", "action", "", "EventTree"];
SocialCalc.Formula.FunctionList["PANEL"] = [SocialCalc.Formula.IoFunctions, -1, "showindices_range_or_csv, panel1_range [, panel2_range , ...]", "", "action", "", "EventTree"]; |
<<<<<<<
this.fetch = this.fetch.bind(this);
this.onlawsready = this.onlawsready.bind(this);
=======
this.reset = this.reset.bind(this);
this.fetch = this.fetch.bind(this);
this.refresh = this.refresh.bind(this);
>>>>>>>
this.reset = this.reset.bind(this);
this.fetch = this.fetch.bind(this);
this.refresh = this.refresh.bind(this);
this.onlawsready = this.onlawsready.bind(this);
<<<<<<<
this.$_items = [];
this.$_filters = {};
this.$_counts = [];
this.sorts = sorts;
this.$_filters['sort'] = 'closing-soon';
this.sort = sorts[this.get('sort')];
laws.on('loaded', this.onlawsready)
=======
this.initialize();
laws.ready(this.fetch);
//TODO: make all this dependent on `bus` when making views reactive in #284
citizen.on('loaded', this.refresh);
citizen.on('unloaded', this.reset);
>>>>>>>
this.initialize();
laws.on('loaded', this.onlawsready)
//TODO: make all this dependent on `bus` when making views reactive in #284
citizen.on('loaded', this.refresh);
citizen.on('unloaded', this.reset);
<<<<<<<
// TODO: remove this once #288 is closed
// Always exclude drafts
items = items.filter(_('publishedAt != null'))
=======
>>>>>>>
// TODO: remove this once #288 is closed
// Always exclude drafts
items = items.filter(_('publishedAt != null')) |
<<<<<<<
import brazilPopulation from '../../data/brazil/brazil-populations.csv'
=======
import irelandVotes from '../../data/ireland/constituency_values.csv'
>>>>>>>
import brazilPopulation from '../../data/brazil/brazil-populations.csv'
import irelandVotes from '../../data/ireland/constituency_values.csv' |
<<<<<<<
if (!util.isBlockHash(req.query.block)) {
return res.status(400).send({
error: 'Invalid block hash',
});
}
db.blocks.getBestHeight(
(err, blockHeight) => {
if (err) {
logger.log('err', err);
=======
const height = db.blocks.bestHeight();
// Get Bcoin data
return request(`${API_URL}/block/${req.query.block}`,
{ timeout: TTL },
(error, localRes, block) => {
if (error) {
logger.log('error',
`${error}`);
return res.status(404).send();
}
// Catch JSON errors
try {
block = JSON.parse(block);
} catch (e) {
logger.log('error',
`${e}`);
>>>>>>>
if (!util.isBlockHash(req.query.block)) {
return res.status(400).send({
error: 'Invalid block hash',
});
}
const height = db.blocks.bestHeight();
// Get Bcoin data
return request(`${API_URL}/block/${req.query.block}`,
{ timeout: TTL },
(error, localRes, block) => {
if (error) {
logger.log('error',
`${error}`);
return res.status(404).send();
}
// Catch JSON errors
try {
block = JSON.parse(block);
} catch (e) {
logger.log('error',
`${e}`); |
<<<<<<<
ios.sockets.in('inv').emit('block', block);
};
module.exports.broadcast_address_tx = function(address, tx) {
ios.sockets.in(address).emit('tx', tx);
};
=======
ios.sockets.emit('block', block);
};
module.exports.broadcastSyncInfo = function(syncInfo) {
ios.sockets.emit('block', syncInfo);
};
>>>>>>>
ios.sockets.in('inv').emit('block', block);
};
module.exports.broadcast_address_tx = function(address, tx) {
ios.sockets.in(address).emit('tx', tx);
};
module.exports.broadcastSyncInfo = function(syncInfo) {
ios.sockets.emit('block', syncInfo);
}; |
<<<<<<<
angular.module('insight.system').controller('IndexController',
['$scope',
'Global',
'socket',
'Blocks',
'Transactions',
function($scope, Global, socket, Blocks, Transactions) {
=======
angular.module('insight.system').controller('IndexController', ['$scope', '$rootScope', 'Global', 'socket', 'Blocks', 'Transactions', function($scope, $rootScope, Global, socket, Blocks, Transactions) {
>>>>>>>
angular.module('insight.system').controller('IndexController',
['$scope',
'$rootScope',
'Global',
'socket',
'Blocks',
'Transactions',
function($scope, $rootScope, Global, socket, Blocks, Transactions) {
<<<<<<<
socket.on('connect', function() {
socket.emit('subscribe', 'inv');
});
=======
//show errors
$scope.flashMessage = $rootScope.flashMessage || null;
>>>>>>>
socket.on('connect', function() {
socket.emit('subscribe', 'inv');
});
//show errors
$scope.flashMessage = $rootScope.flashMessage || null; |
<<<<<<<
if (err) return res.status(400).json({ error: err.message })
return res.json(200)
=======
if (err) return res.status(200).json({ error: err.message })
return res.status(200).send()
>>>>>>>
if (err) return res.status(400).json({ error: err.message })
return res.status(200).send() |
<<<<<<<
};
};
=======
}
/**
* iban
*
* @method faker.finance.iban
*/
self.iban = function (formatted) {
var ibanFormat = faker.random.arrayElement(ibanLib.formats);
var s = "";
var count = 0;
for (var b = 0; b < ibanFormat.bban.length; b++) {
var bban = ibanFormat.bban[b];
var c = bban.count;
count += bban.count;
while (c > 0) {
if (bban.type == "a") {
s += faker.random.arrayElement(ibanLib.alpha);
} else if (bban.type == "c") {
if (faker.random.number(100) < 80) {
s += faker.random.number(9);
} else {
s += faker.random.arrayElement(ibanLib.alpha);
}
} else {
if (c >= 3 && faker.random.number(100) < 30) {
if (faker.random.boolean()) {
s += faker.random.arrayElement(ibanLib.pattern100);
c -= 2;
} else {
s += faker.random.arrayElement(ibanLib.pattern10);
c--;
}
} else {
s += faker.random.number(9);
}
}
c--;
}
s = s.substring(0, count);
}
var checksum = 98 - ibanLib.mod97(ibanLib.toDigitString(s + ibanFormat.country + "00"));
if (checksum < 10) {
checksum = "0" + checksum;
}
var iban = ibanFormat.country + checksum + s;
return formatted ? iban.match(/.{1,4}/g).join(" ") : iban;
}
/**
* bic
*
* @method faker.finance.bic
*/
self.bic = function () {
var vowels = ["A", "E", "I", "O", "U"];
var prob = faker.random.number(100);
return Helpers.replaceSymbols("???") +
faker.random.arrayElement(vowels) +
faker.random.arrayElement(ibanLib.iso3166) +
Helpers.replaceSymbols("?") + "1" +
(prob < 10 ?
Helpers.replaceSymbols("?" + faker.random.arrayElement(vowels) + "?") :
prob < 40 ?
Helpers.replaceSymbols("###") : "");
}
}
>>>>>>>
};
/**
* iban
*
* @method faker.finance.iban
*/
self.iban = function (formatted) {
var ibanFormat = faker.random.arrayElement(ibanLib.formats);
var s = "";
var count = 0;
for (var b = 0; b < ibanFormat.bban.length; b++) {
var bban = ibanFormat.bban[b];
var c = bban.count;
count += bban.count;
while (c > 0) {
if (bban.type == "a") {
s += faker.random.arrayElement(ibanLib.alpha);
} else if (bban.type == "c") {
if (faker.random.number(100) < 80) {
s += faker.random.number(9);
} else {
s += faker.random.arrayElement(ibanLib.alpha);
}
} else {
if (c >= 3 && faker.random.number(100) < 30) {
if (faker.random.boolean()) {
s += faker.random.arrayElement(ibanLib.pattern100);
c -= 2;
} else {
s += faker.random.arrayElement(ibanLib.pattern10);
c--;
}
} else {
s += faker.random.number(9);
}
}
c--;
}
s = s.substring(0, count);
}
var checksum = 98 - ibanLib.mod97(ibanLib.toDigitString(s + ibanFormat.country + "00"));
if (checksum < 10) {
checksum = "0" + checksum;
}
var iban = ibanFormat.country + checksum + s;
return formatted ? iban.match(/.{1,4}/g).join(" ") : iban;
};
/**
* bic
*
* @method faker.finance.bic
*/
self.bic = function () {
var vowels = ["A", "E", "I", "O", "U"];
var prob = faker.random.number(100);
return Helpers.replaceSymbols("???") +
faker.random.arrayElement(vowels) +
faker.random.arrayElement(ibanLib.iso3166) +
Helpers.replaceSymbols("?") + "1" +
(prob < 10 ?
Helpers.replaceSymbols("?" + faker.random.arrayElement(vowels) + "?") :
prob < 40 ?
Helpers.replaceSymbols("###") : "");
};
}; |
<<<<<<<
"name": ["first_name", "last_name", "prefix", "suffix", "title", "male_first_name", "male_last_name", "female_first_name", "female_last_name"],
"address": ["city_prefix", "city_suffix", "street_suffix", "county", "country", "country_code", "state", "state_abbr", "street_prefix"],
"company": ["adjective", "noun", "descriptor", "bs_adjective", "bs_noun", "bs_verb", "suffix"],
=======
"name": ["first_name", "last_name", "prefix", "suffix", "male_first_name", "female_first_name", "male_middle_name", "female_middle_name", "male_last_name", "female_last_name"],
"address": ["city_prefix", "city_suffix", "street_suffix", "county", "country", "state", "state_abbr"],
"company": ["adjective", "noun", "descriptor", "bs_adjective", "bs_noun", "bs_verb"],
>>>>>>>
"name": ["first_name", "last_name", "prefix", "suffix", "title", "male_first_name", "female_first_name", "male_middle_name", "female_middle_name", "male_last_name", "female_last_name"],
"address": ["city_prefix", "city_suffix", "street_suffix", "county", "country", "country_code", "state", "state_abbr", "street_prefix"],
"company": ["adjective", "noun", "descriptor", "bs_adjective", "bs_noun", "bs_verb", "suffix"], |
<<<<<<<
"address": ["city_prefix", "city_suffix", "street_suffix", "county", "country", "country_code", "country_code_alpha_3", "state", "state_abbr", "street_prefix", "postcode", "postcode_by_state", "direction", "direction_abbr"],
=======
"address": ["city_prefix", "city_suffix", "street_suffix", "county", "country", "country_code", "state", "state_abbr", "street_prefix", "postcode", "postcode_by_state", "direction", "direction_abbr", "time_zone"],
>>>>>>>
"address": ["city_prefix", "city_suffix", "street_suffix", "county", "country", "country_code", "country_code_alpha_3", "state", "state_abbr", "street_prefix", "postcode", "postcode_by_state", "direction", "direction_abbr", "time_zone"], |
<<<<<<<
exports.definitions = require('./lib/definitions');
exports.Finance = require('./lib/finance');
=======
exports.random = require('./lib/random');
exports.definitions = require('./lib/definitions');
>>>>>>>
exports.random = require('./lib/random');
exports.definitions = require('./lib/definitions');
exports.Finance = require('./lib/finance'); |
<<<<<<<
"name": ["first_name", "last_name", "prefix", "suffix", "title"],
"address": ["city_prefix", "city_suffix", "street_suffix", "county", "country", "state", "state_abbr"],
"company": ["adjective", "noun", "descriptor", "bs_adjective", "bs_noun", "bs_verb", "suffix"],
=======
"name": ["first_name", "last_name", "prefix", "suffix"],
"address": ["city_prefix", "city_suffix", "street_suffix", "county", "country", "state", "state_abbr", "street_prefix"],
"company": ["adjective", "noun", "descriptor", "bs_adjective", "bs_noun", "bs_verb"],
>>>>>>>
"name": ["first_name", "last_name", "prefix", "suffix", "title"],
"address": ["city_prefix", "city_suffix", "street_suffix", "county", "country", "state", "state_abbr", "street_prefix"],
"company": ["adjective", "noun", "descriptor", "bs_adjective", "bs_noun", "bs_verb", "suffix"], |
<<<<<<<
/** @typedef {"nsfw"|"racist"|"sexist"|"religious"|"political"|"explicit"} BlacklistFlags */
=======
/** @typedef {"Any"|"Programming"|"Miscellaneous"|"Dark"} JokeCategory */
>>>>>>>
/** @typedef {"nsfw"|"racist"|"sexist"|"religious"|"political"|"explicit"} BlacklistFlags */
/** @typedef {"Any"|"Programming"|"Miscellaneous"|"Dark"} JokeCategory */ |
<<<<<<<
var deferred = Q.defer(),
ignore;
=======
var deferred = Q.defer();
var ignore;
var finish;
finish = function (err) {
// Ensure that all listeners are removed
writer.removeAllListeners();
reader.removeAllListeners();
// If we got an error, simply reject the deferred
// Otherwise resolve it
if (err) {
deferred.reject(err);
} else {
deferred.resolve();
}
};
>>>>>>>
var deferred = Q.defer();
var ignore; |
<<<<<<<
=======
>>>>>>>
<<<<<<<
.on('suggest.show', $.proxy(this.options.onshow, this))
.on('suggest.select', $.proxy(this.options.onselect, this))
.on('suggest.lookup', $.proxy(this.options.onlookup, this))
.on('keypress', $.proxy(this.__keypress, this))
.on('keyup', $.proxy(this.__keyup, this));
=======
.on('suggest.show', $.proxy(this.options.onshow, this))
.on('suggest.select', $.proxy(this.options.onselect, this))
.on('suggest.lookup', $.proxy(this.options.onlookup, this))
.on('keyup', $.proxy(this.__keyup, this));
>>>>>>>
.on('suggest.show', $.proxy(this.options.onshow, this))
.on('suggest.select', $.proxy(this.options.onselect, this))
.on('suggest.lookup', $.proxy(this.options.onlookup, this))
.on('keyup', $.proxy(this.__keyup, this)); |
<<<<<<<
import FetchCompileWasmTemplatePlugin from 'webpack/lib/web/FetchCompileWasmTemplatePlugin';
=======
import WORKER_PLUGIN_SYMBOL from './symbol';
>>>>>>>
import FetchCompileWasmTemplatePlugin from 'webpack/lib/web/FetchCompileWasmTemplatePlugin';
import WORKER_PLUGIN_SYMBOL from './symbol'; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.