conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
=======
var reservedNames_ = {
"__defineGetter__": true,
"__defineSetter__": true,
"apply": true,
"arguments": true,
"call": true,
"caller": true,
"eval": true,
"hasOwnProperty": true,
"isPrototypeOf": true,
"__lookupGetter__": true,
"__lookupSetter__": true,
"__noSuchMethod__": true,
"propertyIsEnumerable": true,
"prototype": true,
"toSource": true,
"toLocaleString": true,
"toString": true,
"unwatch": true,
"valueOf": true,
"watch": true,
"length": true,
"name": true,
};
function fixReservedNames (name) {
if (reservedNames_[name]) {
return name + "_$rn$";
}
return name;
}
function fixReserved (name) {
name = fixReservedNames(fixReservedWords(name));
return name;
}
>>>>>>>
<<<<<<<
=======
mangled = fixReserved(mangled);
>>>>>>>
<<<<<<<
if (Sk.python3 && class_for_super) {
this.u.varDeclsCode += "$gbl.__class__=$gbl." + class_for_super.v + ";";
=======
if (Sk.__future__.python3 && class_for_super) {
this.u.varDeclsCode += "$gbl.__class__=$gbl." + class_for_super.v + ";";
>>>>>>>
if (Sk.__future__.python3 && class_for_super) {
this.u.varDeclsCode += "$gbl.__class__=$gbl." + class_for_super.v + ";";
<<<<<<<
// mangled = fixReserved(mangled);
=======
mangled = fixReserved(mangled);
>>>>>>> |
<<<<<<<
kwlen = kw.length;
for (i = 0; i < kwlen; i += 2) {
=======
var kwlen = kw.length;
var varnames = this.im_func.func_code['co_varnames'];
var numvarnames = varnames && varnames.length;
for (var i = 0; i < kwlen; i += 2)
{
>>>>>>>
kwlen = kw.length;
varnames = this.im_func.func_code["co_varnames"];
numvarnames = varnames && varnames.length;
for (i = 0; i < kwlen; i += 2)
{
<<<<<<<
varnames = this.im_func.func_code["co_varnames"];
numvarnames = varnames && varnames.length;
for (j = 0; j < numvarnames; ++j) {
if (kw[i] === varnames[j]) {
=======
for (var j = 0; j < numvarnames; ++j)
{
if (kw[i] === varnames[j])
>>>>>>>
for (j = 0; j < numvarnames; ++j)
{
if (kw[i] === varnames[j]) {
<<<<<<<
args[j] = kw[i + 1];
=======
if (varnames && j !== numvarnames)
{
args[j] = kw[i+1];
}
else if (expectskw)
{
// build kwargs dict
kwargsarr.push(new Sk.builtin.str(kw[i]));
kwargsarr.push(kw[i + 1]);
}
else
{
name = (this.im_func.func_code && this.im_func.func_code['co_name'] && this.im_func.func_code['co_name'].v) || '<native JS>';
throw new Sk.builtin.TypeError(name + "() got an unexpected keyword argument '" + kw[i] + "'");
}
>>>>>>>
if (varnames && j !== numvarnames)
{
args[j] = kw[i+1];
}
else if (expectskw)
{
// build kwargs dict
kwargsarr.push(new Sk.builtin.str(kw[i]));
kwargsarr.push(kw[i + 1]);
}
else
{
name = (this.im_func.func_code && this.im_func.func_code["co_name"] && this.im_func.func_code["co_name"].v) || "<native JS>";
throw new Sk.builtin.TypeError(name + "() got an unexpected keyword argument '" + kw[i] + "'");
} |
<<<<<<<
function escKeyHandler() {
deselectAllEdges();
deselectAllNodes();
}//escKeyHandler
=======
/*
* Make a node "in the commons" (with a green circle) lose its
* green circle so it stays on the console/map/...
*/
>>>>>>>
function escKeyHandler() {
deselectAllEdges();
deselectAllNodes();
}//escKeyHandler
/*
* Make a node "in the commons" (with a green circle) lose its
* green circle so it stays on the console/map/...
*/ |
<<<<<<<
if (o === null || o.constructor === Sk.builtin.lng || o.tp$index
|| o === true || o === false) {
return true;
}
return Sk.builtin.checkInt(o);
=======
return o === null || typeof o === "number" || o.constructor === Sk.builtin.lng || o.constructor === Sk.builtin.nmber || o.tp$index;
>>>>>>>
if (o === null || o.constructor === Sk.builtin.lng || o.tp$index
|| o === true || o === false) {
return true;
}
return Sk.builtin.checkInt(o);
<<<<<<<
* for reversed comparison: Gt -> Lt, etc.
=======
* for reversed comparison: Lt -> GtE, etc.
>>>>>>>
* for reversed comparison: Gt -> Lt, etc.
<<<<<<<
'Eq': 'Eq',
'NotEq': 'NotEq',
'Lt': 'Gt',
'LtE': 'GtE',
'Gt': 'Lt',
'GtE': 'LtE',
'Is': 'IsNot',
'IsNot': 'Is',
'In_': 'NotIn',
'NotIn': 'In_'
=======
'Eq': 'Eq', //
'NotEq': 'NotEq', //
'Lt': 'GtE',
'LtE': 'Gt',
'Gt': 'LtE',
'GtE': 'Lt',
'Is': 'Is', //
'IsNot': 'IsNot', //
'In_': undefined, // No swap equivalent (equivalent = "contains")
'NotIn': undefined // No swap equivalent (equivalent = "does not contain")
>>>>>>>
'Eq': 'Eq',
'NotEq': 'NotEq',
'Lt': 'GtE',
'LtE': 'Gt',
'Gt': 'LtE',
'GtE': 'Lt',
'Is': 'IsNot',
'IsNot': 'Is',
'In_': 'NotIn',
'NotIn': 'In_'
<<<<<<<
else if (w && w['__ne__'])
return Sk.misceval.callsim(w['__ne__'], w, v);
=======
else if (w && w['__eq__'])
return Sk.misceval.callsim(w['__ne__'], w, v);
>>>>>>>
else if (w && w['__ne__'])
return Sk.misceval.callsim(w['__ne__'], w, v);
<<<<<<<
else if (!v['$r']) {
if (v.tp$name) {
return new Sk.builtin.str("<" + v.tp$name + " object>");
} else {
return new Sk.builtin.str("<unknown>");
};
}
=======
else if (v.constructor === Sk.builtin.nmber)
return new Sk.builtin.str("" + v.v);
else if (!v['$r'])
return new Sk.builtin.str("<" + v.tp$name + " object>");
>>>>>>>
else if (!v['$r']) {
if (v.tp$name) {
return new Sk.builtin.str("<" + v.tp$name + " object>");
} else {
return new Sk.builtin.str("<unknown>");
};
}
else if (v.constructor === Sk.builtin.nmber)
return new Sk.builtin.str("" + v.v);
<<<<<<<
if (x instanceof Sk.builtin.lng) return x.nb$nonzero();
=======
if (x.constructor === Sk.builtin.nmber) return x.v !== 0;
>>>>>>>
if (x instanceof Sk.builtin.lng) return x.nb$nonzero();
if (x.constructor === Sk.builtin.nmber) return x.v !== 0; |
<<<<<<<
Sk.builtin.ord = function ord(x) {
if (!Sk.builtin.checkString(x)) {
throw new Sk.builtin.TypeError("ord() expected a string of length 1, but " + Sk.abstr.typeName(x) + " found");
} else if (x.v.length !== 1) {
throw new Sk.builtin.TypeError("ord() expected a character, but string of length " + x.v.length + " found");
=======
Sk.builtin.ord = function ord (x) {
Sk.builtin.pyCheckArgsLen("ord", arguments.length, 1, 1);
if (Sk.builtin.checkString(x)) {
if (x.v.length !== 1 && x.sq$length() !== 1) {
// ^^ avoid the astral check unless necessary ^^
throw new Sk.builtin.TypeError("ord() expected a character, but string of length " + x.v.length + " found");
}
return new Sk.builtin.int_(x.v.codePointAt(0));
} else if (Sk.builtin.checkBytes(x)) {
if (x.sq$length() !== 1) {
throw new Sk.builtin.TypeError("ord() expected a character, but string of length " + x.v.length + " found");
}
return new Sk.builtin.int_(x.v[0]);
>>>>>>>
Sk.builtin.ord = function ord (x) {
if (Sk.builtin.checkString(x)) {
if (x.v.length !== 1 && x.sq$length() !== 1) {
// ^^ avoid the astral check unless necessary ^^
throw new Sk.builtin.TypeError("ord() expected a character, but string of length " + x.v.length + " found");
}
return new Sk.builtin.int_(x.v.codePointAt(0));
} else if (Sk.builtin.checkBytes(x)) {
if (x.sq$length() !== 1) {
throw new Sk.builtin.TypeError("ord() expected a character, but string of length " + x.v.length + " found");
}
return new Sk.builtin.int_(x.v[0]);
<<<<<<<
Sk.builtin.open = function open(filename, mode, bufsize) {
=======
Sk.builtin.repr = function repr (x) {
Sk.builtin.pyCheckArgsLen("repr", arguments.length, 1, 1);
return Sk.misceval.objectRepr(x);
};
Sk.builtin.ascii = function ascii (x) {
return Sk.misceval.chain(Sk.misceval.objectRepr(x), (r) => {
if (!(r instanceof Sk.builtin.str)) {
throw new Sk.builtin.TypeError("__repr__ returned non-string (type " + Sk.abstr.typeName(r) + ")");
}
let ret;
let i;
// Fast path
for (i=0; i < r.v.length; i++) {
if (r.v.charCodeAt(i) >= 0x7f) {
ret = r.v.substr(0, i);
break;
}
}
if (!ret) {
return r;
}
for (; i < r.v.length; i++) {
let c = r.v.charAt(i);
let cc = r.v.charCodeAt(i);
if (cc > 0x7f && cc <= 0xff) {
let ashex = cc.toString(16);
if (ashex.length < 2) {
ashex = "0" + ashex;
}
ret += "\\x" + ashex;
} else if (cc > 0x7f && cc < 0xd800 || cc >= 0xe000) {
// BMP
ret += "\\u" + ("000"+cc.toString(16)).slice(-4);
} else if (cc >= 0xd800) {
// Surrogate pair stuff
let val = r.v.codePointAt(i);
i++;
val = val.toString(16);
let s = ("0000000"+val.toString(16));
if (val.length > 4) {
ret += "\\U" + s.slice(-8);
} else {
ret += "\\u" + s.slice(-4);
}
} else {
ret += c;
}
}
return new Sk.builtin.str(ret);
});
};
Sk.builtin.open = function open (filename, mode, bufsize) {
Sk.builtin.pyCheckArgsLen("open", arguments.length, 1, 3);
>>>>>>>
Sk.builtin.ascii = function ascii (x) {
return Sk.misceval.chain(x.$r(), (r) => {
let ret;
let i;
// Fast path
for (i=0; i < r.v.length; i++) {
if (r.v.charCodeAt(i) >= 0x7f) {
ret = r.v.substr(0, i);
break;
}
}
if (!ret) {
return r;
}
for (; i < r.v.length; i++) {
let c = r.v.charAt(i);
let cc = r.v.charCodeAt(i);
if (cc > 0x7f && cc <= 0xff) {
let ashex = cc.toString(16);
if (ashex.length < 2) {
ashex = "0" + ashex;
}
ret += "\\x" + ashex;
} else if (cc > 0x7f && cc < 0xd800 || cc >= 0xe000) {
// BMP
ret += "\\u" + ("000"+cc.toString(16)).slice(-4);
} else if (cc >= 0xd800) {
// Surrogate pair stuff
let val = r.v.codePointAt(i);
i++;
val = val.toString(16);
let s = ("0000000"+val.toString(16));
if (val.length > 4) {
ret += "\\U" + s.slice(-8);
} else {
ret += "\\u" + s.slice(-4);
}
} else {
ret += c;
}
}
return new Sk.builtin.str(ret);
});
};
Sk.builtin.open = function open (filename, mode, bufsize) { |
<<<<<<<
goog.exportSymbol("Sk.__future__", Sk.__future__);
=======
// Information about method names and their internal functions for
// methods that differ (in visibility or name) between Python 2 and 3.
//
// Format:
// internal function: {
// "classes" : <array of affected classes>,
// 2 : <visible Python 2 method name> or null if none
// 3 : <visible Python 3 method name> or null if none
// },
// ...
Sk.setup_method_mappings = function () {
Sk.methodMappings = {
"round$": {
"classes": [Sk.builtin.float_,
Sk.builtin.int_,
Sk.builtin.nmber],
2: null,
3: "__round__"
},
"next$": {
"classes": [Sk.builtin.dict_iter_,
Sk.builtin.list_iter_,
Sk.builtin.set_iter_,
Sk.builtin.str_iter_,
Sk.builtin.tuple_iter_,
Sk.builtin.generator,
Sk.builtin.enumerate,
Sk.builtin.iterator],
2: "next",
3: "__next__"
}
};
};
Sk.switch_version = function (python3) {
var internal, klass, classes, idx, len, newmeth, oldmeth;
if (!Sk.hasOwnProperty("methodMappings")) {
Sk.setup_method_mappings();
}
for (internal in Sk.methodMappings) {
if (python3) {
newmeth = Sk.methodMappings[internal][3];
oldmeth = Sk.methodMappings[internal][2];
} else {
newmeth = Sk.methodMappings[internal][2];
oldmeth = Sk.methodMappings[internal][3];
}
classes = Sk.methodMappings[internal]["classes"];
len = classes.length;
for (idx = 0; idx < len; idx++) {
klass = classes[idx];
if (oldmeth && klass.prototype.hasOwnProperty(oldmeth)) {
delete klass.prototype[oldmeth];
}
if (newmeth) {
klass.prototype[newmeth] = new Sk.builtin.func(klass.prototype[internal]);
}
}
}
};
goog.exportSymbol("Sk.python3", Sk.python3);
>>>>>>>
// Information about method names and their internal functions for
// methods that differ (in visibility or name) between Python 2 and 3.
//
// Format:
// internal function: {
// "classes" : <array of affected classes>,
// 2 : <visible Python 2 method name> or null if none
// 3 : <visible Python 3 method name> or null if none
// },
// ...
Sk.setup_method_mappings = function () {
Sk.methodMappings = {
"round$": {
"classes": [Sk.builtin.float_,
Sk.builtin.int_,
Sk.builtin.nmber],
2: null,
3: "__round__"
},
"next$": {
"classes": [Sk.builtin.dict_iter_,
Sk.builtin.list_iter_,
Sk.builtin.set_iter_,
Sk.builtin.str_iter_,
Sk.builtin.tuple_iter_,
Sk.builtin.generator,
Sk.builtin.enumerate,
Sk.builtin.iterator],
2: "next",
3: "__next__"
}
};
};
Sk.switch_version = function (python3) {
var internal, klass, classes, idx, len, newmeth, oldmeth;
if (!Sk.hasOwnProperty("methodMappings")) {
Sk.setup_method_mappings();
}
for (internal in Sk.methodMappings) {
if (python3) {
newmeth = Sk.methodMappings[internal][3];
oldmeth = Sk.methodMappings[internal][2];
} else {
newmeth = Sk.methodMappings[internal][2];
oldmeth = Sk.methodMappings[internal][3];
}
classes = Sk.methodMappings[internal]["classes"];
len = classes.length;
for (idx = 0; idx < len; idx++) {
klass = classes[idx];
if (oldmeth && klass.prototype.hasOwnProperty(oldmeth)) {
delete klass.prototype[oldmeth];
}
if (newmeth) {
klass.prototype[newmeth] = new Sk.builtin.func(klass.prototype[internal]);
}
}
}
};
goog.exportSymbol("Sk.__future__", Sk.__future__);
goog.exportSymbol("Sk.python3", Sk.python3); |
<<<<<<<
Sk.builtins["bytes"] = Sk.builtin.bytes;
=======
Sk.builtins["range"] = new Sk.builtin.func(Sk.builtin.xrange);
delete Sk.builtins["xrange"];
delete Sk.builtins["StandardError"];
delete Sk.builtins["unicode"];
>>>>>>>
Sk.builtins["bytes"] = Sk.builtin.bytes;
Sk.builtins["range"] = new Sk.builtin.func(Sk.builtin.xrange);
delete Sk.builtins["xrange"];
delete Sk.builtins["StandardError"];
delete Sk.builtins["unicode"];
<<<<<<<
if (Sk.builtins["bytes"]) {
delete Sk.builtins["bytes"];
}
=======
Sk.builtins["range"] = new Sk.builtin.func(Sk.builtin.range);
Sk.builtins["xrange"] = new Sk.builtin.func(Sk.builtin.xrange);
Sk.builtins["StandardError"] = Sk.builtin.StandardError;
Sk.builtins["unicode"] = Sk.builtin.str;
>>>>>>>
Sk.builtins["range"] = new Sk.builtin.func(Sk.builtin.range);
Sk.builtins["xrange"] = new Sk.builtin.func(Sk.builtin.xrange);
Sk.builtins["StandardError"] = Sk.builtin.StandardError;
Sk.builtins["unicode"] = Sk.builtin.str;
if (Sk.builtins["bytes"]) {
delete Sk.builtins["bytes"];
} |
<<<<<<<
if (!(this instanceof Sk.builtin.lng)) return new Sk.builtin.lng(x, base);
if (x === undefined)
this.biginteger = new Sk.builtin.biginteger(0);
else if (x instanceof Sk.builtin.lng)
this.biginteger = x.biginteger.clone();
else if (x instanceof Sk.builtin.biginteger)
this.biginteger = x;
else if (x instanceof String)
return Sk.longFromStr(x, base);
else if (x instanceof Sk.builtin.str)
return Sk.longFromStr(x.v, base);
else
this.biginteger = new Sk.builtin.biginteger(x);
=======
if (!(this instanceof Sk.builtin.lng)) return new Sk.builtin.lng(x);
if (x instanceof Sk.builtin.str)
x = x.v;
if (x instanceof Sk.builtin.lng)
this.biginteger = x.biginteger.clone();
else if (x instanceof Sk.builtin.biginteger)
this.biginteger = x;
else if (typeof x === "string")
return Sk.longFromStr(x);
else {
x = Sk.builtin.asnum$nofloat(x);
this.biginteger = new Sk.builtin.biginteger(x);
}
>>>>>>>
if (!(this instanceof Sk.builtin.lng)) return new Sk.builtin.lng(x, base);
if (x === undefined)
this.biginteger = new Sk.builtin.biginteger(0);
else if (x instanceof Sk.builtin.lng)
this.biginteger = x.biginteger.clone();
else if (x instanceof Sk.builtin.biginteger)
this.biginteger = x;
else if (x instanceof String)
return Sk.longFromStr(x, base);
else if (x instanceof Sk.builtin.str)
return Sk.longFromStr(x.v, base);
else {
x = Sk.builtin.asnum$nofloat(x);
this.biginteger = new Sk.builtin.biginteger(x);
}
<<<<<<<
// l/L are valid digits with base >= 22
// goog.asserts.assert(s.charAt(s.length - 1) !== "L" && s.charAt(s.length - 1) !== 'l', "L suffix should be removed before here");
=======
goog.asserts.assert(s.charAt(s.length - 1) !== "L" && s.charAt(s.length - 1) !== 'l', "L suffix should be removed before here");
var neg=false;
if (s.substr(0, 1) == "-") {
s = s.substr(1);
neg=true;
}
var base = 10;
if (s.substr(0, 2) === "0x" || s.substr(0, 2) === "0X")
{
s = s.substr(2);
base = 16;
}
else if (s.substr(0, 2) === "0o")
{
s = s.substr(2);
base = 8;
}
else if (s.substr(0, 1) === "0")
{
s = s.substr(1);
base = 8;
}
else if (s.substr(0, 2) === "0b")
{
s = s.substr(2);
base = 2;
}
if (base == 10) {
if (s.indexOf('e') >= 0 || s.indexOf('E') >= 0 || s.indexOf('.') >= 0) {
s = Math.floor(parseFloat(s));
}
}
var biginteger;
if (base == 10)
biginteger = new Sk.builtin.biginteger(s);
else
biginteger = new Sk.builtin.biginteger(s,base);
>>>>>>>
// l/L are valid digits with base >= 22
// goog.asserts.assert(s.charAt(s.length - 1) !== "L" && s.charAt(s.length - 1) !== 'l', "L suffix should be removed before here");
<<<<<<<
Sk.builtin.lng.prototype.nb$inplace_power = Sk.builtin.lng.prototype.nb$power;
Sk.builtin.lng.prototype.nb$lshift = function(other)
{
if (other instanceof Sk.builtin.lng) {
if (other.biginteger.signum() < 0) {
throw new Sk.builtin.ValueError("negative shift count");
}
return new Sk.builtin.lng(this.biginteger.shiftLeft(other.biginteger));
}
if (other instanceof Sk.builtin.biginteger) {
if (other.signum() < 0) {
throw new Sk.builtin.ValueError("negative shift count");
}
return new Sk.builtin.lng(this.biginteger.shiftLeft(other));
}
if (other < 0) {
throw new Sk.builtin.ValueError("negative shift count");
}
return new Sk.builtin.lng(this.biginteger.shiftLeft(new Sk.builtin.biginteger(other)));
}
Sk.builtin.lng.prototype.nb$inplace_lshift = Sk.builtin.lng.prototype.nb$lshift;
Sk.builtin.lng.prototype.nb$rshift = function(other)
{
if (other instanceof Sk.builtin.lng) {
if (other.biginteger.signum() < 0) {
throw new Sk.builtin.ValueError("negative shift count");
}
return new Sk.builtin.lng(this.biginteger.shiftRight(other.biginteger));
}
if (other instanceof Sk.builtin.biginteger) {
if (other.signum() < 0) {
throw new Sk.builtin.ValueError("negative shift count");
}
return new Sk.builtin.lng(this.biginteger.shiftRight(other));
}
if (other < 0) {
throw new Sk.builtin.ValueError("negative shift count");
}
return new Sk.builtin.lng(this.biginteger.shiftRight(new Sk.builtin.biginteger(other)));
}
Sk.builtin.lng.prototype.nb$inplace_rshift = Sk.builtin.lng.prototype.nb$rshift;
Sk.builtin.lng.prototype.nb$and = function(other)
{
if (other instanceof Sk.builtin.lng) {
return new Sk.builtin.lng(this.biginteger.and(other.biginteger));
}
if (other instanceof Sk.builtin.biginteger) {
return new Sk.builtin.lng(this.biginteger.and(other));
}
return new Sk.builtin.lng(this.biginteger.and(new Sk.builtin.biginteger(other)));
}
Sk.builtin.lng.prototype.nb$inplace_and = Sk.builtin.lng.prototype.nb$and;
Sk.builtin.lng.prototype.nb$or = function(other)
{
if (other instanceof Sk.builtin.lng) {
return new Sk.builtin.lng(this.biginteger.or(other.biginteger));
}
if (other instanceof Sk.builtin.biginteger) {
return new Sk.builtin.lng(this.biginteger.or(other));
}
return new Sk.builtin.lng(this.biginteger.or(new Sk.builtin.biginteger(other)));
}
Sk.builtin.lng.prototype.nb$inplace_or = Sk.builtin.lng.prototype.nb$or;
Sk.builtin.lng.prototype.nb$xor = function(other)
{
if (other instanceof Sk.builtin.lng) {
return new Sk.builtin.lng(this.biginteger.xor(other.biginteger));
}
if (other instanceof Sk.builtin.biginteger) {
return new Sk.builtin.lng(this.biginteger.xor(other));
}
return new Sk.builtin.lng(this.biginteger.xor(new Sk.builtin.biginteger(other)));
}
Sk.builtin.lng.prototype.nb$inplace_xor = Sk.builtin.lng.prototype.nb$xor;
=======
Sk.builtin.lng.prototype.nb$inplace_add = Sk.builtin.lng.prototype.nb$add;
Sk.builtin.lng.prototype.nb$inplace_subtract = Sk.builtin.lng.prototype.nb$subtract;
Sk.builtin.lng.prototype.nb$inplace_multiply = Sk.builtin.lng.prototype.nb$multiply;
Sk.builtin.lng.prototype.nb$inplace_divide = Sk.builtin.lng.prototype.nb$divide;
Sk.builtin.lng.prototype.nb$inplace_remainder = Sk.builtin.lng.prototype.nb$remainder;
Sk.builtin.lng.prototype.nb$inplace_floor_divide = Sk.builtin.lng.prototype.nb$floor_divide;
Sk.builtin.lng.prototype.nb$inplace_power = Sk.builtin.lng.prototype.nb$power;
>>>>>>>
Sk.builtin.lng.prototype.nb$inplace_power = Sk.builtin.lng.prototype.nb$power;
Sk.builtin.lng.prototype.nb$lshift = function(other)
{
if (other instanceof Sk.builtin.lng) {
if (other.biginteger.signum() < 0) {
throw new Sk.builtin.ValueError("negative shift count");
}
return new Sk.builtin.lng(this.biginteger.shiftLeft(other.biginteger));
}
if (other instanceof Sk.builtin.biginteger) {
if (other.signum() < 0) {
throw new Sk.builtin.ValueError("negative shift count");
}
return new Sk.builtin.lng(this.biginteger.shiftLeft(other));
}
if (other < 0) {
throw new Sk.builtin.ValueError("negative shift count");
}
return new Sk.builtin.lng(this.biginteger.shiftLeft(new Sk.builtin.biginteger(other)));
}
Sk.builtin.lng.prototype.nb$inplace_lshift = Sk.builtin.lng.prototype.nb$lshift;
Sk.builtin.lng.prototype.nb$rshift = function(other)
{
if (other instanceof Sk.builtin.lng) {
if (other.biginteger.signum() < 0) {
throw new Sk.builtin.ValueError("negative shift count");
}
return new Sk.builtin.lng(this.biginteger.shiftRight(other.biginteger));
}
if (other instanceof Sk.builtin.biginteger) {
if (other.signum() < 0) {
throw new Sk.builtin.ValueError("negative shift count");
}
return new Sk.builtin.lng(this.biginteger.shiftRight(other));
}
if (other < 0) {
throw new Sk.builtin.ValueError("negative shift count");
}
return new Sk.builtin.lng(this.biginteger.shiftRight(new Sk.builtin.biginteger(other)));
}
Sk.builtin.lng.prototype.nb$inplace_rshift = Sk.builtin.lng.prototype.nb$rshift;
Sk.builtin.lng.prototype.nb$and = function(other)
{
if (other instanceof Sk.builtin.lng) {
return new Sk.builtin.lng(this.biginteger.and(other.biginteger));
}
if (other instanceof Sk.builtin.biginteger) {
return new Sk.builtin.lng(this.biginteger.and(other));
}
return new Sk.builtin.lng(this.biginteger.and(new Sk.builtin.biginteger(other)));
}
Sk.builtin.lng.prototype.nb$inplace_and = Sk.builtin.lng.prototype.nb$and;
Sk.builtin.lng.prototype.nb$or = function(other)
{
if (other instanceof Sk.builtin.lng) {
return new Sk.builtin.lng(this.biginteger.or(other.biginteger));
}
if (other instanceof Sk.builtin.biginteger) {
return new Sk.builtin.lng(this.biginteger.or(other));
}
return new Sk.builtin.lng(this.biginteger.or(new Sk.builtin.biginteger(other)));
}
Sk.builtin.lng.prototype.nb$inplace_or = Sk.builtin.lng.prototype.nb$or;
Sk.builtin.lng.prototype.nb$xor = function(other)
{
if (other instanceof Sk.builtin.lng) {
return new Sk.builtin.lng(this.biginteger.xor(other.biginteger));
}
if (other instanceof Sk.builtin.biginteger) {
return new Sk.builtin.lng(this.biginteger.xor(other));
}
return new Sk.builtin.lng(this.biginteger.xor(new Sk.builtin.biginteger(other)));
}
Sk.builtin.lng.prototype.nb$inplace_xor = Sk.builtin.lng.prototype.nb$xor; |
<<<<<<<
this.lst = lst.v.slice();
this.sq$length = this.lst.length;
this.tp$iter = () => this;
=======
this.lst = lst.v;
this.$done = false;
this.tp$iter = this;
>>>>>>>
this.lst = lst.v;
this.$done = false;
this.tp$iter = () => this; |
<<<<<<<
link.x.receive(packet)
.then(function(inner){
// this pipe is valid, if it hasn't been seen yet, we need to resync
if(!link.seen[pipe.uid])
{
log.debug('never seen pipe',pipe.uid,pipe.path)
link.addPipe(pipe,true); // must see it first
process.nextTick(link.sync); // full resync in the background
}
// if channel exists, handle it
var chan = link.x.channels[inner.json.c];
if(chan)
{
if(chan.state == 'gone') return log.debug('incoming channel is gone');
return chan.receive(inner);
}
// new channel open, valid?
if(inner.json.err || typeof inner.json.type != 'string') return log.debug('invalid channel open',inner.json,link.hashname);
// do we handle this type
log.debug('new channel open',inner.json);
// error utility for any open handler problems
function bouncer(err)
{
if(!err) return;
var json = {err:err};
json.c = inner.json.c;
log.debug('bouncing open',json);
link.x.send({json:json});
}
// check all the extensions for any handlers of this type
var args = {pipe:pipe};
for(var i=0;i<mesh.extended.length;i++)
{
if(typeof mesh.extended[i].open != 'object') continue;
var handler = mesh.extended[i].open[inner.json.type];
if(typeof handler != 'function') continue;
// set the link to be 'this' and be done
handler.call(link, args, inner, bouncer);
return;
}
// default bounce if not handled
return bouncer('unknown type');
})
.catch(log.debug);
=======
var inner = link.x.receive(packet);
if(!inner)
{
log.debug('error receiving channel packet',link.x.err);
return;
}
// this pipe is valid, if it hasn't been seen yet, we need to resync
if(!link.seen[pipe.uid])
{
log.debug('never seen pipe',pipe.uid,pipe.path)
link.addPipe(pipe,true); // must see it first
process.nextTick(link.sync); // full resync in the background
}
// if channel exists, handle it
var chan = link.x.channels[inner.json.c];
// if we have a matching channel AND our incoming packet is not expliciely an open
if(chan && !inner.json.type)
{
if(chan.state == 'gone') return log.debug('incoming channel is gone');
log.debug('resuming old channel' + inner)
return chan.receive(inner);
}
// new channel open, valid?
if(inner.json.err || typeof inner.json.type != 'string') return log.debug('invalid channel open',inner.json,link.hashname);
// do we handle this type
log.debug('new channel open ' + inner.json.type);
// error utility for any open handler problems
function bouncer(err)
{
if(!err) return;
var json = {err:err};
json.c = inner.json.c;
log.debug('bouncing open',json);
link.x.send({json:json});
}
// check all the extensions for any handlers of this type
var args = {pipe:pipe};
for(var i=0;i<mesh.extended.length;i++)
{
if(typeof mesh.extended[i].open != 'object') continue;
var handler = mesh.extended[i].open[inner.json.type];
if(typeof handler != 'function') continue;
// set the link to be 'this' and be done
log.debug("calling handler for " + mesh.extended[i].name)
handler.call(link, args, inner, bouncer);
return;
}
>>>>>>>
link.x.receive(packet)
.then(function(inner){
// this pipe is valid, if it hasn't been seen yet, we need to resync
if(!link.seen[pipe.uid])
{
log.debug('never seen pipe',pipe.uid,pipe.path)
link.addPipe(pipe,true); // must see it first
process.nextTick(link.sync); // full resync in the background
}
// if channel exists, handle it
var chan = link.x.channels[inner.json.c];
if(chan && !inner.json.type)
{
if(chan.state == 'gone') return log.debug('incoming channel is gone');
return chan.receive(inner);
}
// new channel open, valid?
if(inner.json.err || typeof inner.json.type != 'string') return log.debug('invalid channel open',inner.json,link.hashname);
// do we handle this type
log.debug('new channel open',inner.json);
// error utility for any open handler problems
function bouncer(err)
{
if(!err) return;
var json = {err:err};
json.c = inner.json.c;
log.debug('bouncing open',json);
link.x.send({json:json});
}
// check all the extensions for any handlers of this type
var args = {pipe:pipe};
for(var i=0;i<mesh.extended.length;i++)
{
if(typeof mesh.extended[i].open != 'object') continue;
var handler = mesh.extended[i].open[inner.json.type];
if(typeof handler != 'function') continue;
// set the link to be 'this' and be done
handler.call(link, args, inner, bouncer);
return;
}
// default bounce if not handled
return bouncer('unknown type');
})
.catch(log.debug); |
<<<<<<<
import processThreadContent from 'shared/draft-utils/process-thread-content';
import { ThreadHeading } from 'src/views/thread/style';
import { SegmentedControl, Segment } from 'src/components/segmentedControl';
import ThreadRenderer from '../threadRenderer';
import { closeComposer } from '../../actions/composer';
import { openModal } from '../../actions/modals';
import { changeActiveThread } from '../../actions/dashboardFeed';
import { addToastWithTimeout } from '../../actions/toasts';
import {
toPlainText,
fromPlainText,
toJSON,
toState,
isAndroid,
} from 'shared/draft-utils';
=======
import getThreadLink from 'src/helpers/get-thread-link';
import { changeActiveThread } from 'src/actions/dashboardFeed';
import { addToastWithTimeout } from 'src/actions/toasts';
>>>>>>>
import processThreadContent from 'shared/draft-utils/process-thread-content';
import { ThreadHeading } from 'src/views/thread/style';
import { SegmentedControl, Segment } from 'src/components/segmentedControl';
import ThreadRenderer from '../threadRenderer';
import { openModal } from 'src/actions/modals';
import { addToastWithTimeout } from 'src/actions/toasts';
import {
toPlainText,
fromPlainText,
toJSON,
toState,
isAndroid,
} from 'shared/draft-utils';
import getThreadLink from 'src/helpers/get-thread-link';
import { changeActiveThread } from 'src/actions/dashboardFeed';
<<<<<<<
// if a post was published in this session,
// clear redux so that the next composer open will start fresh
if (postWasPublished) return this.closeComposer('clear');
=======
// if a post was published, in this session, clear redux so that the next
// composer open will start fresh
if (postWasPublished) return;
>>>>>>>
// if a post was published, in this session, clear redux so that the next
// composer open will start fresh
if (postWasPublished) return;
<<<<<<<
// we need to verify the source of the keypress event
// so that if it comes from the discard draft modal, it should not
// listen to the events for composer
const innerText = e.target.innerText;
const modalIsOpen = innerText.indexOf(DISCARD_DRAFT_MESSAGE) >= 0;
if (modalIsOpen) {
=======
if (esc) {
e.stopPropagation();
this.closeComposer();
this.activateLastThread();
>>>>>>>
// we need to verify the source of the keypress event
// so that if it comes from the discard draft modal, it should not
// listen to the events for composer
const innerText = e.target.innerText;
const modalIsOpen = innerText.indexOf(DISCARD_DRAFT_MESSAGE) >= 0;
if (modalIsOpen) {
e.stopPropagation();
this.closeComposer();
this.activateLastThread();
<<<<<<<
onCancelClick = async () => {
this.discardDraft();
};
=======
>>>>>>>
onCancelClick = async () => {
this.discardDraft();
};
<<<<<<<
isOpen={isOpen}
onClick={this.discardDraft}
=======
slider={slider}
onClick={this.closeComposer}
>>>>>>>
slider={slider}
onClick={this.discardDraft}
<<<<<<<
<TextButton hoverColor="warn.alt" onClick={this.discardDraft}>
=======
<TextButton
data-cy="composer-cancel-button"
hoverColor="warn.alt"
onClick={this.closeComposer}
>
>>>>>>>
<TextButton
data-cy="composer-cancel-button"
hoverColor="warn.alt"
onClick={this.discardDraft}
> |
<<<<<<<
import MainRouter from './MainRouter';
import Root from './Root';
=======
import { Body } from './App/style';
// import Root from './Root';
>>>>>>>
import MainRouter from './MainRouter';
<<<<<<<
<ThemeProvider theme={theme}>
<MainRouter />
</ThemeProvider>
=======
<Router history={history}>
<ThemeProvider theme={theme}>
<Wrapper>
<SectionOne>
<SectionContent>
<FlexCol>
<LogoContainer><LogoWhite /></LogoContainer>
<Tagline>
Spectrum is currently undergoing maintenance, we'll be back in a few hours! Follow{' '}
<a
style={{ textDecoration: 'underline' }}
href="https://twitter.com/withspectrum"
>
@withspectrum on Twitter
</a>
{' '}for updates.
<br />
<span style={{ fontSize: '0.5em' }}>
(posted at: 10:00am CEST)
</span>
</Tagline>
</FlexCol>
</SectionContent>
<GoopyOne />
</SectionOne>
</Wrapper>
</ThemeProvider>
</Router>
>>>>>>>
<ThemeProvider theme={theme}>
<MainRouter />
</ThemeProvider> |
<<<<<<<
export const getCurrentUserProfile = graphql(GET_CURRENT_USER_PROFILE_QUERY, {
options: { fetchPolicy: 'cache-and-network' },
});
=======
export const getCurrentUserProfile = graphql(GET_CURRENT_USER_PROFILE_QUERY);
/*
Delete a thread
*/
const TOGGLE_NOTIFICATION_SETTINGS_MUTATION = gql`
mutation toggleNotificationSettings($input: ToggleNotificationSettingsInput) {
toggleNotificationSettings(input: $input) {
...userInfo,
...userSettings
}
}
${userInfoFragment}
${userSettingsFragment}
`;
const TOGGLE_NOTIFICATION_SETTINGS_OPTIONS = {
props: ({ input, mutate }) => ({
toggleNotificationSettings: input =>
mutate({
variables: {
input,
},
}),
}),
};
export const toggleNotificationSettingsMutation = graphql(
TOGGLE_NOTIFICATION_SETTINGS_MUTATION,
TOGGLE_NOTIFICATION_SETTINGS_OPTIONS
);
>>>>>>>
export const getCurrentUserProfile = graphql(GET_CURRENT_USER_PROFILE_QUERY, {
options: { fetchPolicy: 'cache-and-network' },
});
/*
Delete a thread
*/
const TOGGLE_NOTIFICATION_SETTINGS_MUTATION = gql`
mutation toggleNotificationSettings($input: ToggleNotificationSettingsInput) {
toggleNotificationSettings(input: $input) {
...userInfo,
...userSettings
}
}
${userInfoFragment}
${userSettingsFragment}
`;
const TOGGLE_NOTIFICATION_SETTINGS_OPTIONS = {
props: ({ input, mutate }) => ({
toggleNotificationSettings: input =>
mutate({
variables: {
input,
},
}),
}),
};
export const toggleNotificationSettingsMutation = graphql(
TOGGLE_NOTIFICATION_SETTINGS_MUTATION,
TOGGLE_NOTIFICATION_SETTINGS_OPTIONS
); |
<<<<<<<
<Link
to={'/spectrum/hugs-n-bugs'}
onClick={() => track(events.SUPPORT_PAGE_REPORT_BUG)}
>
<Button
gradientTheme={'warn'}
icon={'bug'}
style={{ marginTop: '24px', width: '100%' }}
>
Report a bug
=======
<Link to={'/spectrum/hugs-n-bugs'}>
<Button gradientTheme={'warn'} icon={'bug'}>
Join Hugs-n-Bugs
>>>>>>>
<Link to={'/spectrum/hugs-n-bugs'}>
<Button
gradientTheme={'warn'}
icon={'bug'}
onClick={() => track(events.SUPPORT_PAGE_REPORT_BUG)}
>
Join Hugs-n-Bugs
<<<<<<<
<Link
to={'/spectrum/feature-requests'}
onClick={() => track(events.SUPPORT_PAGE_REQUEST_FEATURE)}
>
<Button
gradientTheme={'space'}
icon={'idea'}
style={{ marginTop: '24px', width: '100%' }}
>
=======
<Link to={'/spectrum/feature-requests'}>
<Button gradientTheme={'space'} icon={'idea'}>
>>>>>>>
<Link to={'/spectrum/feature-requests'}>
<Button
gradientTheme={'space'}
icon={'idea'}
onClick={() => track(events.SUPPORT_PAGE_REQUEST_FEATURE)}
>
<<<<<<<
<Button
gradientTheme={'social.twitter'}
icon={'twitter'}
style={{ marginTop: '24px', width: '100%' }}
onClick={() => track(events.SUPPORT_PAGE_FOLLOW_ON_TWITTER)}
>
=======
<Button gradientTheme={'social.twitter'} icon={'twitter'}>
>>>>>>>
<Button
gradientTheme={'social.twitter'}
icon={'twitter'}
onClick={() => track(events.SUPPORT_PAGE_FOLLOW_ON_TWITTER)}
>
<<<<<<<
<Button
gradientTheme={'brand'}
icon={'logo'}
style={{ marginTop: '12px', width: '100%' }}
onClick={() =>
track(events.SUPPORT_PAGE_JOIN_SPECTRUM_COMMUNITY)
}
>
=======
<Button gradientTheme={'brand'} icon={'logo'}>
>>>>>>>
<Button
gradientTheme={'brand'}
icon={'logo'}
onClick={() =>
track(events.SUPPORT_PAGE_JOIN_SPECTRUM_COMMUNITY)
}
>
<<<<<<<
<Button
onClick={() => track(events.SUPPORT_PAGE_EMAIL_US)}
gradientTheme={'special'}
icon={'email'}
style={{ marginTop: '24px', width: '100%' }}
>
=======
<Button gradientTheme={'special'} icon={'email'}>
>>>>>>>
<Button
gradientTheme={'special'}
icon={'email'}
onClick={() => track(events.SUPPORT_PAGE_EMAIL_US)}
> |
<<<<<<<
import archiveChannel from './archiveChannel';
import restoreChannel from './restoreChannel';
=======
import joinChannelWithToken from './joinChannelWithToken';
import enableChannelTokenJoin from './enableChannelTokenJoin';
import disableChannelTokenJoin from './disableChannelTokenJoin';
import resetChannelJoinToken from './resetChannelJoinToken';
>>>>>>>
import archiveChannel from './archiveChannel';
import restoreChannel from './restoreChannel';
import joinChannelWithToken from './joinChannelWithToken';
import enableChannelTokenJoin from './enableChannelTokenJoin';
import disableChannelTokenJoin from './disableChannelTokenJoin';
import resetChannelJoinToken from './resetChannelJoinToken';
<<<<<<<
archiveChannel,
restoreChannel,
=======
joinChannelWithToken,
enableChannelTokenJoin,
disableChannelTokenJoin,
resetChannelJoinToken,
>>>>>>>
archiveChannel,
restoreChannel,
joinChannelWithToken,
enableChannelTokenJoin,
disableChannelTokenJoin,
resetChannelJoinToken, |
<<<<<<<
import redraft from 'redraft';
import { getLinkPreviewFromUrl, timeDifference } from '../../../helpers/utils';
=======
import {
getLinkPreviewFromUrl,
timeDifference,
convertTimestampToDate,
} from '../../../helpers/utils';
>>>>>>>
import redraft from 'redraft';
import {
getLinkPreviewFromUrl,
timeDifference,
convertTimestampToDate,
} from '../../../helpers/utils';
<<<<<<<
this.state = {
=======
const viewBody =
thread.type === 'SLATE'
? toPlainText(toState(JSON.parse(thread.content.body)))
: thread.content.body;
const editBody =
thread.type === 'SLATE'
? toState(JSON.parse(thread.content.body))
: thread.content.body;
this.setState({
>>>>>>>
this.setState({
<<<<<<<
<span>
{isEditing
? <Textarea
onChange={this.changeTitle}
style={ThreadTitle}
value={this.state.title}
placeholder={'A title for your thread...'}
ref="titleTextarea"
autoFocus
/>
: <ThreadHeading>
{thread.content.title}
</ThreadHeading>}
{thread.modifiedAt &&
<Edited>
Edited {timeDifference(Date.now(), editedTimestamp)}
</Edited>}
<div className="markdown">
=======
{!isEditing &&
<span>
<ThreadHeading>
{thread.content.title}
</ThreadHeading>
<FlexRow>
<Timestamp>
{convertTimestampToDate(thread.createdAt)}
</Timestamp>
{thread.modifiedAt &&
<Edited>
(Edited {timeDifference(Date.now(), editedTimestamp)})
</Edited>}
</FlexRow>
<div className="markdown">
<ThreadContent>
{viewBody}
</ThreadContent>
</div>
{linkPreview &&
!fetchingLinkPreview &&
<LinkPreview
trueUrl={linkPreview.url}
data={linkPreview}
size={'large'}
editable={false}
margin={'16px 0 0 0'}
/>}
</span>}
{isEditing &&
<span>
<Textarea
onChange={this.changeTitle}
style={ThreadTitle}
value={this.state.title}
placeholder={'A title for your thread...'}
ref="titleTextarea"
autoFocus
/>
>>>>>>>
<span>
{isEditing
? <Textarea
onChange={this.changeTitle}
style={ThreadTitle}
value={this.state.title}
placeholder={'A title for your thread...'}
ref="titleTextarea"
autoFocus
/>
: <ThreadHeading>
{thread.content.title}
</ThreadHeading>}
<FlexRow>
<Timestamp>
{convertTimestampToDate(thread.createdAt)}
</Timestamp>
{thread.modifiedAt &&
<Edited>
(Edited {timeDifference(Date.now(), editedTimestamp)})
</Edited>}
</FlexRow>
<div className="markdown"> |
<<<<<<<
mapOutlet : function( sourceKey, targetKey, outletName ){
if( targetKey == undefined ) targetKey = "global";
if( outletName == undefined ) outletName = source;
if( ! this._outlets.hasOwnProperty( targetKey ) ) this._outlets[ targetKey ] = {};
this._outlets[ targetKey ][ outletName ] = sourceKey
=======
mapOutlet : function( source, target, outlet ){
if( source == undefined ) throw new Error( 1010 );
if( target == undefined ) target = "global";
if( outlet == undefined ) outlet = source;
if( ! this._outlets.hasOwnProperty( target ) ) this._outlets[ target ] = {};
this._outlets[ target ][ outlet ] = source
>>>>>>>
mapOutlet : function( sourceKey, targetKey, outletName ){
if( source == undefined ) throw new Error( 1010 );
if( targetKey == undefined ) targetKey = "global";
if( outletName == undefined ) outletName = source;
if( ! this._outlets.hasOwnProperty( targetKey ) ) this._outlets[ targetKey ] = {};
this._outlets[ targetKey ][ outletName ] = sourceKey
<<<<<<<
getObject : function( key ){
=======
getInstance : function( key ){
if( key == undefined ) throw new Error( 1010 )
>>>>>>>
getObject : function( key ){
if( key == undefined ) throw new Error( 1010 )
<<<<<<<
* Perform an injection into an object, satisfying all it's dependencies, using the outlets as configured for
* <code>key</code>
=======
* Perform an injection into an object, satisfying all it's dependencies
* @param {String} key
>>>>>>>
* Perform an injection into an object, satisfying all it's dependencies
<<<<<<<
injectInto : function( instance, key ){
=======
injectInto : function( key, instance ){
if( key == undefined ) throw new Error( 1010 );
if( instance == undefined ) throw new Error( 1010 );
>>>>>>>
injectInto : function( instance, key ){
if( key == undefined ) throw new Error( 1010 );
if( instance == undefined ) throw new Error( 1010 );
<<<<<<<
mapHandler : function( eventName, key, handler, oneShot, passEvent ){
=======
mapHandler : function( eventName, key, handler, oneShot ){
if( eventName == undefined ) throw new Error( 1010 );
if( key == undefined ) throw new Error( 1010 );
>>>>>>>
mapHandler : function( eventName, key, handler, oneShot, passEvent ){
if( eventName == undefined ) throw new Error( 1010 );
if( key == undefined ) throw new Error( 1010 );
<<<<<<<
oneShot: oneShot,
passEvent: passEvent
};
=======
oneShot: oneShot
} );
>>>>>>>
oneShot: oneShot
passEvent: passEvent
} );
<<<<<<<
addCallback : function( eventName, callback, oneShot, passEvent ){
=======
addCallback : function( eventName, callback, oneShot ){
if( eventName == undefined ) throw new Error( 1010 );
if( callback == undefined ) throw new Error( 1010 );
>>>>>>>
addCallback : function( eventName, callback, oneShot, passEvent ){
if( eventName == undefined ) throw new Error( 1010 );
if( callback == undefined ) throw new Error( 1010 );
<<<<<<<
var argsWithEvent = Array.prototype.slice.call( arguments );
var argsClean = argsWithEvent.slice(1);
=======
if( eventName == undefined ) throw new Error( 1010 );
var args = Array.prototype.slice( arguments );
>>>>>>>
var argsWithEvent = Array.prototype.slice.call( arguments );
var argsClean = argsWithEvent.slice(1); |
<<<<<<<
import { ScrollBody, Bubble, BubbleGroup, FromName } from './style';
=======
// eslint-disable-next-line
import ChatMessage from '../ChatMessage';
import { ScrollBody } from './style';
>>>>>>>
import { ScrollBody, Bubble, BubbleGroup, FromName } from './style';
import ChatMessage from '../ChatMessage'; |
<<<<<<<
import Thread from './views/thread';
import RedirectOldThreadRoute from './views/thread/redirect-old-route';
=======
import { FullscreenThreadView } from './views/thread';
>>>>>>>
import RedirectOldThreadRoute from './views/thread/redirect-old-route';
import { FullscreenThreadView } from './views/thread';
<<<<<<<
<Route
path="/thread/:threadId"
component={RedirectOldThreadRoute}
/>
=======
<Route
path="/thread/:threadId"
component={FullscreenThreadView}
/>
>>>>>>>
<Route
path="/thread/:threadId"
component={RedirectOldThreadRoute}
/> |
<<<<<<<
activeCommunity,
=======
metadata,
frequencies: { active },
story,
>>>>>>>
activeCommunity,
metadata,
frequencies: { active },
story,
<<<<<<<
Object.keys(participants).length >= 3 &&
activeCommunity !== 'everything'
=======
Object.keys(participants).length >= 0 &&
active !== 'everything'
>>>>>>>
Object.keys(participants).length >= 0 &&
activeCommunity !== 'everything' |
<<<<<<<
import styled from 'styled-components/native';
import { TouchableOpacity } from 'react-native';
=======
import styled, { css } from 'styled-components/native';
import { Stylesheet } from 'react-native';
import Avatar from '../Avatar';
>>>>>>>
import styled, { css } from 'styled-components/native';
import { TouchableOpacity } from 'react-native';
import { Stylesheet } from 'react-native';
import Avatar from '../Avatar';
<<<<<<<
`;
export const ThreadCommunityInfoWrapper = styled.View`
display: flex;
flex-direction: row;
align-items: center;
padding-bottom: 12px;
`;
export const ThreadCommunityName = styled.Text`
font-size: 14px;
font-weight: 400;
color: ${props => props.theme.text.alt};
margin-right: 8px;
`;
export const ThreadChannelPill = styled(TouchableOpacity)`
padding: 2px 8px;
background: ${props => props.theme.bg.wash};
border: 1px solid ${props => props.theme.bg.border};
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
`;
export const ThreadChannelName = styled.Text`
color: ${props => props.theme.text.alt};
font-size: 12px;
=======
`;
const stackingStyles = css`
margin-right: -10px;
border-width: 2px;
border-color: #ffffff;
`;
export const StackedEmptyParticipantHead = styled(EmptyParticipantHead)`
${stackingStyles};
`;
export const StackedAvatar = styled(Avatar)`
${stackingStyles};
>>>>>>>
`;
export const ThreadCommunityInfoWrapper = styled.View`
display: flex;
flex-direction: row;
align-items: center;
padding-bottom: 12px;
`;
export const ThreadCommunityName = styled.Text`
font-size: 14px;
font-weight: 400;
color: ${props => props.theme.text.alt};
margin-right: 8px;
`;
export const ThreadChannelPill = styled(TouchableOpacity)`
padding: 2px 8px;
background: ${props => props.theme.bg.wash};
border: 1px solid ${props => props.theme.bg.border};
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
`;
export const ThreadChannelName = styled.Text`
color: ${props => props.theme.text.alt};
font-size: 12px;
`;
const stackingStyles = css`
margin-right: -10px;
border-width: 2px;
border-color: #ffffff;
`;
export const StackedEmptyParticipantHead = styled(EmptyParticipantHead)`
${stackingStyles};
`;
export const StackedAvatar = styled(Avatar)`
${stackingStyles}; |
<<<<<<<
fetchMore={props.fetchMore}
=======
fetchMore={props.data.fetchMore}
refetch={props.data.refetch}
refetching={props.data.refetching}
>>>>>>>
fetchMore={props.fetchMore}
refetch={props.data.refetch}
refetching={props.data.refetching} |
<<<<<<<
messageGroups,
=======
errors,
>>>>>>>
messageGroups,
errors, |
<<<<<<<
import StoryMaster from './components/StoryMaster';
import DetailView from './components/DetailView';
// import ListDetail from './components/ListDetail';
=======
import { Provider } from 'react-redux'
import { initStore } from '../store'
import PostList from './components/PostList';
import Chat from './components/Chat';
// import ListDetail from './components/ListDetail';
>>>>>>>
import StoryMaster from './components/StoryMaster';
import DetailView from './components/DetailView';
import { Provider } from 'react-redux'
import { initStore } from '../store'
// import ListDetail from './components/ListDetail';
<<<<<<<
<Body>
<NavBar></NavBar>
<StoryMaster
currentTag={this.state.currentTag}
selectPost={this.selectPost}
currentData={{currentPost: this.state.currentPost, currentUser: this.state.currentUser }} />
<DetailView />
</Body>
=======
<Provider store={this.store}>
<Body>
<NavBar />
<PostList />
<Chat />
</Body>
</Provider>
>>>>>>>
<Provider store={this.store}>
<Body>
<NavBar />
<StoryMaster />
<DetailView />
</Body>
</Provider> |
<<<<<<<
=======
// if user has no dm threads, make sure they stay on /new
if (
data.user && data.user.directMessageThreadsConnection.edges.length === 0
) {
return (
<View>
{isMobile && <Titlebar title={'Messages'} provideBack={false} />}
<MessagesList>
<Link to="/messages/new">
<ComposeHeader>
<Icon glyph="message-new" />
</ComposeHeader>
</Link>
</MessagesList>
{/*
pass the user's existing DM threads into the composer so that we can more quickly
determine if the user is creating a new thread or has typed the names that map
to an existing DM thread
*/}
<Route
path={`${match.url}/new`}
render={props => (
<NewThread
{...props}
threads={threads}
currentUser={currentUser}
/>
)}
/>
</View>
);
}
>>>>>>> |
<<<<<<<
import React from 'react';
import styled, { css } from 'styled-components';
=======
import styled, { css } from 'styled-components';
>>>>>>>
import React from 'react';
import styled, { css } from 'styled-components';
<<<<<<<
=======
z-index: ${zIndex.composer};
@media (max-width: 768px) {
max-width: 100vw;
padding: 32px;
padding-left: 48px;
}
@media (max-width: 480px) {
max-width: 100vw;
padding: 16px;
padding-left: 48px;
}
>>>>>>>
z-index: ${zIndex.composer}; |
<<<<<<<
if (user.uid && frequencies.active === 'notifications' && unread >= 0) {
sortedStories.unshift(<NuxJoinCard />);
}
if (user.uid && messageGroups.active === 'new' || messageComposer.isOpen) {
sortedMessageGroups.unshift(
<NewMessageCard active={messageComposer.isOpen} />,
);
}
=======
>>>>>>>
if (user.uid && messageGroups.active === 'new' || messageComposer.isOpen) {
sortedMessageGroups.unshift(
<NewMessageCard active={messageComposer.isOpen} />,
);
}
<<<<<<<
<MiddleColumnContainer active={stories.active} viewing={ui.viewing}>
<MiddleColumn
loggedIn={!!user.uid}
role={
user &&
frequency &&
frequency.users[user.uid] &&
frequency.users[user.uid].permission
}
activeFrequency={frequencies.active}
isPrivate={frequency && frequency.settings.private}
stories={sortedStories}
frequency={frequency}
messageGroups={sortedMessageGroups}
/>
</MiddleColumnContainer>
=======
{!isExplore &&
<MiddleColumnContainer active={stories.active} viewing={ui.viewing}>
<MiddleColumn
loggedIn={!!user.uid}
role={
user &&
frequency &&
frequency.users[user.uid] &&
frequency.users[user.uid].permission
}
activeFrequency={frequencies.active}
isPrivate={frequency && frequency.settings.private}
stories={sortedStories}
frequency={frequency}
/>
</MiddleColumnContainer>}
>>>>>>>
{!isExplore &&
<MiddleColumnContainer active={stories.active} viewing={ui.viewing}>
<MiddleColumn
loggedIn={!!user.uid}
role={
user &&
frequency &&
frequency.users[user.uid] &&
frequency.users[user.uid].permission
}
activeFrequency={frequencies.active}
isPrivate={frequency && frequency.settings.private}
stories={sortedStories}
frequency={frequency}
messageGroups={sortedMessageGroups}
/>
</MiddleColumnContainer>} |
<<<<<<<
import billingSettings from './billingSettings';
import hasChargeableSource from './hasChargeableSource';
import hasFeatures from './hasFeatures';
=======
import brandedLogin from './brandedLogin';
>>>>>>>
import billingSettings from './billingSettings';
import hasChargeableSource from './hasChargeableSource';
import hasFeatures from './hasFeatures';
import brandedLogin from './brandedLogin';
<<<<<<<
billingSettings,
hasChargeableSource,
hasFeatures,
=======
brandedLogin,
>>>>>>>
billingSettings,
hasChargeableSource,
hasFeatures,
brandedLogin, |
<<<<<<<
=======
import {setTotal, setPage} from "pagination.jsx";
>>>>>>>
<<<<<<<
filterTarget
} from "actions.js";
=======
filterTarget,
} from "filters.jsx";
>>>>>>>
filterTarget,
BATCH
} from "actions.js";
<<<<<<<
=======
const BATCH = "batch";
const batch = (...actions) => {
return {
type: BATCH,
actions: actions,
};
};
// https://github.com/reactjs/redux/issues/911#issuecomment-149192251
const enableBatching = reducer => {
return function batchingReducer(state, action) {
switch (action.type) {
case BATCH:
return action.actions.reduce(batchingReducer, state);
default:
return reducer(state, action);
}
};
};
// getOneAd() and refresh() are thunk action creators.
const getOneAd = (ad_id, url = "/facebook-ads/ads") => {
if (!ad_id) return () => null;
let path = `${url}/${ad_id}`;
return (dispatch, getState) => {
let state = getState();
if (
state.permalinked_ad &&
state.permalinked_ad.ads &&
state.permalinked_ad.ads[ad_id] &&
state.permalinked_ad.ads[ad_id].id
) {
return Promise.resolve(
dispatch(receiveOneAd({ads: [state.permalinked_ad.ads[ad_id]]}))
);
}
dispatch(requestingOneAd(ad_id));
fetch(path, {
method: "GET",
headers: headers(state.credentials, state.lang),
})
.then(res => res.json())
.then(ad => {
dispatch(receiveOneAd(ad));
});
};
};
>>>>>>>
<<<<<<<
export { headers, refresh, deserialize };
=======
export {
headers,
newAds,
NEW_ADS,
search,
getOneAd,
GOT_THAT_AD,
REQUESTING_ONE_AD,
refresh,
newSearch,
deserialize,
enableBatching,
lang,
};
>>>>>>>
export { headers, refresh, deserialize }; |
<<<<<<<
}
export const canViewThread = async (
userId: string,
threadId: string,
loaders: any
) => {
const thread = await getThreadById(threadId);
if (!thread || thread.deletedAt) return false;
const [
channel,
community,
channelPermissions,
communityPermissions,
] = await Promise.all([
loaders.channel.load(thread.channelId),
loaders.community.load(thread.communityId),
loaders.userPermissionsInChannel.load([userId, thread.channelId]),
loaders.userPermissionsInCommunity.load([userId, thread.communityId]),
]);
if (!channel.isPrivate && !community.isPrivate) return true;
if (channel.isPrivate) return channelPermissions.isMember;
if (community.isPrivate) return communityPermissions.isMember;
return false;
};
const canViewDMThread = async (
userId: string,
threadId: string,
loaders: any
) => {
if (!userId) return false;
const thread = await loaders.directMessageParticipants.load(threadId);
if (!thread || !thread.reduction || thread.reduction.length === 0)
return false;
const participants = thread.reduction;
const ids = participants.map(({ userId }) => userId);
if (ids.indexOf(userId) === -1) return false;
return true;
};
=======
}
// prettier-ignore
export const canViewChannel = async (user: DBUser, channelId: string, loaders: any) => {
if (!channelId) return false;
const channel = await channelExists(channelId, loaders);
if (!channel) return false;
const community = await communityExists(channel.communityId, loaders);
if (!community) return false
if (!channel.isPrivate && !community.isPrivate) return true
if (!user) return false
const [
communityPermissions,
channelPermissions
] = await Promise.all([
loaders.userPermissionsInCommunity.load([
user.id,
community.id,
]),
loaders.userPermissionsInChannel.load([
user.id,
channel.id,
])
])
if (channel.isPrivate && !channelPermissions) return false
if (community.isPrivate && !communityPermissions) return false
if (channel.isPrivate && !channelPermissions.isMember) return false
if (community.isPrivate && !communityPermissions.isMember) return false
return true
}
>>>>>>>
}
export const canViewThread = async (
userId: string,
threadId: string,
loaders: any
) => {
const thread = await getThreadById(threadId);
if (!thread || thread.deletedAt) return false;
const [
channel,
community,
channelPermissions,
communityPermissions,
] = await Promise.all([
loaders.channel.load(thread.channelId),
loaders.community.load(thread.communityId),
loaders.userPermissionsInChannel.load([userId, thread.channelId]),
loaders.userPermissionsInCommunity.load([userId, thread.communityId]),
]);
if (!channel.isPrivate && !community.isPrivate) return true;
if (channel.isPrivate) return channelPermissions.isMember;
if (community.isPrivate) return communityPermissions.isMember;
return false;
};
const canViewDMThread = async (
userId: string,
threadId: string,
loaders: any
) => {
if (!userId) return false;
const thread = await loaders.directMessageParticipants.load(threadId);
if (!thread || !thread.reduction || thread.reduction.length === 0)
return false;
const participants = thread.reduction;
const ids = participants.map(({ userId }) => userId);
if (ids.indexOf(userId) === -1) return false;
return true;
};
// prettier-ignore
export const canViewChannel = async (user: DBUser, channelId: string, loaders: any) => {
if (!channelId) return false;
const channel = await channelExists(channelId, loaders);
if (!channel) return false;
const community = await communityExists(channel.communityId, loaders);
if (!community) return false
if (!channel.isPrivate && !community.isPrivate) return true
if (!user) return false
const [
communityPermissions,
channelPermissions
] = await Promise.all([
loaders.userPermissionsInCommunity.load([
user.id,
community.id,
]),
loaders.userPermissionsInChannel.load([
user.id,
channel.id,
])
])
if (channel.isPrivate && !channelPermissions) return false
if (community.isPrivate && !communityPermissions) return false
if (channel.isPrivate && !channelPermissions.isMember) return false
if (community.isPrivate && !communityPermissions.isMember) return false
return true
} |
<<<<<<<
state = {
nuxFrequency: true,
};
=======
state = {
cache: new CellMeasurerCache({
fixedWidth: true,
minHeight: MIN_STORY_CARD_HEIGHT,
keyMapper: index => this.props.stories[index].id,
}),
};
componentWillReceiveProps = nextProps => {
// If any of the things the story list cares about change,
// rerender the list
if (
storyArraysEqual(this.props.stories, nextProps.stories) &&
nextProps.activeStory === this.props.activeStory &&
storyArraysEqual(this.props.stories, nextProps.stories)
)
return;
this.setState({
cache: new CellMeasurerCache({
fixedWidth: true,
minHeight: MIN_STORY_CARD_HEIGHT,
keyMapper: index => nextProps.stories[index].id,
}),
});
};
>>>>>>>
state = {
nuxFrequency: true,
cache: new CellMeasurerCache({
fixedWidth: true,
minHeight: MIN_STORY_CARD_HEIGHT,
keyMapper: index => this.props.stories[index].id,
}),
};
componentWillReceiveProps = nextProps => {
// If any of the things the story list cares about change,
// rerender the list
if (
storyArraysEqual(this.props.stories, nextProps.stories) &&
nextProps.activeStory === this.props.activeStory &&
storyArraysEqual(this.props.stories, nextProps.stories)
)
return;
this.setState({
cache: new CellMeasurerCache({
fixedWidth: true,
minHeight: MIN_STORY_CARD_HEIGHT,
keyMapper: index => nextProps.stories[index].id,
}),
});
};
<<<<<<<
{isEverything || frequency
? stories.filter(story => story.published).map((story, i) => {
const notification = notifications.find(
notification =>
notification.activityType === ACTIVITY_TYPES.NEW_MESSAGE &&
notification.ids.story === story.id &&
notification.read === false,
);
const isNew = notifications.some(
notification =>
notification.activityType === ACTIVITY_TYPES.NEW_STORY &&
notification.ids.story === story.id &&
notification.read === false,
);
const unreadMessages = notification ? notification.unread : 0;
const freq = isEverything &&
getCurrentFrequency(story.frequencyId, frequencies);
return (
<Card
isActive={activeStory === story.id}
key={`story-${i}`}
link={`/~${activeFrequency}/${story.id}`}
media={story.content.media}
messages={
story.messages ? Object.keys(story.messages).length : 0
}
metaLink={isEverything && freq && `/~${freq.slug}`}
metaText={isEverything && freq && `~${freq.name}`}
privateFreq={isEverything && freq && freq.settings.private}
person={{
photo: story.creator.photoURL,
name: story.creator.displayName,
}}
timestamp={story.timestamp}
title={story.content.title}
unreadMessages={unreadMessages}
isNew={isNew}
/>
);
})
: ''}
{!isEverything &&
frequency &&
<ShareCard slug={activeFrequency} name={frequency.name} />}
=======
{(isEverything || frequency) &&
<InfiniteLoader
isRowLoaded={() => true}
loadMoreRows={() => Promise.resolve()}
rowCount={stories.length}
>
{({ onRowsRendered, registerChild }) => (
<List
ref={registerChild}
onRowsRendered={onRowsRendered}
height={window.innerHeight - 50}
width={419}
rowCount={stories.length}
rowRenderer={this.renderStory}
deferredMeasurementCache={this.state.cache}
rowHeight={this.state.cache.rowHeight}
/>
)}
</InfiniteLoader>}
{isEverything &&
frequencies.length === 0 && // user is viewing everything but isn't subscribed to anything
<NuxJoinCard />}
>>>>>>>
{(isEverything || frequency) &&
<InfiniteLoader
isRowLoaded={() => true}
loadMoreRows={() => Promise.resolve()}
rowCount={stories.length}
>
{({ onRowsRendered, registerChild }) => (
<List
ref={registerChild}
onRowsRendered={onRowsRendered}
height={window.innerHeight - 50}
width={419}
rowCount={stories.length}
rowRenderer={this.renderStory}
deferredMeasurementCache={this.state.cache}
rowHeight={this.state.cache.rowHeight}
/>
)}
</InfiniteLoader>} |
<<<<<<<
require('../stories/TimeInput');
=======
require('../stories/Tooltip');
>>>>>>>
require('../stories/TimeInput');
require('../stories/Tooltip'); |
<<<<<<<
title: node.isRequired,
=======
...Header.propTypes,
withNewIcons: bool,
>>>>>>>
...Header.propTypes,
title: node.isRequired,
<<<<<<<
subtitle: null,
withoutDivider: false,
=======
withNewIcons: false,
>>>>>>>
subtitle: null,
withoutDivider: false,
<<<<<<<
=======
withNewIcons={withNewIcons}
>>>>>>> |
<<<<<<<
/* prettier-ignore */
const Search = Loadable({
loader: () => import('./views/search'/* webpackChunkName: "Splash" */),
loading: ({ isLoading }) => isLoading && <LoadingScreen />,
});
const About = () => (
<div>
<h3>About</h3>
</div>
);
=======
/* prettier-ignore */
const Pricing = Loadable({
loader: () => import('./views/splash/pricing'/* webpackChunkName: "Pricing" */),
loading: ({ isLoading }) => isLoading && <Loading />,
});
/* prettier-ignore */
const Support = Loadable({
loader: () => import('./views/splash/support'/* webpackChunkName: "Support" */),
loading: ({ isLoading }) => isLoading && <Loading />,
});
>>>>>>>
/* prettier-ignore */
const Search = Loadable({
loader: () => import('./views/search'/* webpackChunkName: "Splash" */),
loading: ({ isLoading }) => isLoading && <LoadingScreen />,
});
/* prettier-ignore */
const Pricing = Loadable({
loader: () => import('./views/splash/pricing'/* webpackChunkName: "Pricing" */),
loading: ({ isLoading }) => isLoading && <Loading />,
});
/* prettier-ignore */
const Support = Loadable({
loader: () => import('./views/splash/support'/* webpackChunkName: "Support" */),
loading: ({ isLoading }) => isLoading && <Loading />,
}); |
<<<<<<<
onClick={() => this.trackNavigationClick('logo')}
=======
data-cy="navbar-logo"
>>>>>>>
onClick={() => this.trackNavigationClick('logo')}
data-cy="navbar-logo"
<<<<<<<
onClick={() => this.trackNavigationClick('home')}
=======
data-cy="navbar-home"
>>>>>>>
onClick={() => this.trackNavigationClick('home')}
data-cy="navbar-home"
<<<<<<<
onClick={() => this.trackNavigationClick('explore')}
=======
data-cy="navbar-explore"
>>>>>>>
onClick={() => this.trackNavigationClick('explore')}
data-cy="navbar-explore" |
<<<<<<<
=======
const { expandOwnerDetails } = require('./user_details');
const { getPosts } = require('./posts_graphql');
const { formatSinglePost } = require('./details');
>>>>>>>
const { formatSinglePost } = require('./details');
<<<<<<<
queryTag: itemSpec.tagName,
queryUsername: itemSpec.userUsername,
queryLocation: itemSpec.locationName,
alt: item.node.accessibility_caption,
url: `https://www.instagram.com/p/${item.node.shortcode}`,
likesCount: item.node.edge_media_preview_like.count,
commentsCount: item.node.edge_media_to_comment.count,
caption: item.node.edge_media_to_caption.edges && item.node.edge_media_to_caption.edges[0] && item.node.edge_media_to_caption.edges[0].node.text,
imageUrl: item.node.display_url,
videoUrl: item.node.video_url,
id: item.node.id,
position: currentScrollingPosition + 1 + index,
mediaType: item.node.__typename ? item.node.__typename.replace('Graph', '') : (item.node.is_video ? 'Video' : 'Image'),
shortcode: item.node.shortcode,
firstComment: item.node.edge_media_to_comment.edges && item.node.edge_media_to_comment.edges[0] && item.node.edge_media_to_comment.edges[0].node.text,
timestamp: new Date(parseInt(item.node.taken_at_timestamp, 10) * 1000),
locationName: (item.node.location && item.node.location.name) || null,
// usable by appending https://www.instagram.com/explore/locations/ to see the location
locationId: (item.node.location && item.node.location.id) || null,
ownerId: item.owner && item.owner.id || null,
ownerUsername: (item.node.owner && item.node.owner.username) || null,
}))
=======
...filteredItemSpec,
...formatSinglePost(item.node),
}));
if (request.userData.limit) {
output = output.slice(0, request.userData.limit);
}
if (request.userData.scrapePostsUntilDate) {
const scrapePostsUntilDate = new Date(request.userData.scrapePostsUntilDate);
output = output.filter((item) => item.timestamp > scrapePostsUntilDate);
}
if (input.expandOwners && itemSpec.pageType !== PAGE_TYPES.PROFILE) {
output = await expandOwnerDetails(output, page, input, itemSpec);
}
for (const post of output) {
if (itemSpec.pageType !== PAGE_TYPES.PROFILE && (post.locationName === null || post.ownerUsername === null)) {
// Try to scrape at post detail
await requestQueue.addRequest({ url: post.url, userData: { label: 'postDetail' } });
} else {
await Apify.pushData(post);
}
}
log(itemSpec, `${output.length} items saved, task finished`);
};
/**
* Catches GraphQL responses and if they contain post data, it stores the data
* to the global variable.
* @param {Object} page Puppeteer Page object
* @param {Object} response Puppeteer Response object
*/
async function handlePostsGraphQLResponse(page, response) {
const responseUrl = response.url();
// Get variable we look for in the query string of request
const checkedVariable = getCheckedVariable(page.itemSpec.pageType);
// Skip queries for other stuff then posts
if (!responseUrl.includes(checkedVariable) || !responseUrl.includes('%22first%22')) return;
const data = await response.json();
const timeline = getPostsFromGraphQL(page.itemSpec.pageType, data.data);
posts[page.itemSpec.id] = posts[page.itemSpec.id].concat(timeline.posts);
if (!initData[page.itemSpec.id]) initData[page.itemSpec.id] = timeline;
else if (initData[page.itemSpec.id].hasNextPage && !timeline.hasNextPage) {
initData[page.itemSpec.id].hasNextPage = false;
}
// await Apify.pushData(output);
// log(itemSpec, `${output.length} items saved, task finished`);
log(page.itemSpec, `${timeline.posts.length} posts added, ${posts[page.itemSpec.id].length} posts total`);
>>>>>>>
queryTag: itemSpec.tagName,
queryUsername: itemSpec.userUsername,
queryLocation: itemSpec.locationName,
position: currentScrollingPosition + 1 + index,
...formatSinglePost(item.node),
})) |
<<<<<<<
import { PUBLIC_STRIPE_KEY } from '../../api/constants';
import { payInvoiceMutation } from '../../api/invoice';
=======
import { PUBLIC_STRIPE_KEY } from '../../api';
>>>>>>>
import { PUBLIC_STRIPE_KEY } from '../../api/constants'; |
<<<<<<<
{this.state.featured.length > 0 &&
this.state.featured.map((freq, i) => {
const community = communities.find(
community => community.id === freq.communityId,
);
=======
{this.state.allFrequencies &&
this.state.allFrequencies.map((freq, i) => {
console.log(freq);
>>>>>>>
{this.state.allFrequencies &&
this.state.allFrequencies.map((freq, i) => { |
<<<<<<<
const { getCheckedVariable, log } = require('./helpers');
const { PAGE_TYPES, GRAPHQL_ENDPOINT } = require('./consts');
const initData = {};
const posts = {};
/**
* Takes type of page and data loaded through GraphQL and outputs
* correct list of posts based on the page type.
* @param {String} pageType Type of page we are scraping posts from
* @param {Object} data GraphQL data
*/
const getPostsFromGraphQL = (pageType, data) => {
let timeline;
switch (pageType) {
case PAGE_TYPES.PLACE:
timeline = data.location.edge_location_to_media;
break;
case PAGE_TYPES.PROFILE:
timeline = data && data.user && data.user.edge_owner_to_timeline_media;
break;
case PAGE_TYPES.HASHTAG:
timeline = data.hashtag.edge_hashtag_to_media;
break;
default: throw new Error('Not supported');
}
const postItems = timeline ? timeline.edges : [];
const hasNextPage = timeline ? timeline.page_info.has_next_page : false;
return { posts: postItems, hasNextPage };
};
/**
* Takes type of page and it's initial loaded data and outputs
* correct list of posts based on the page type.
* @param {String} pageType Type of page we are scraping posts from
* @param {Object} data GraphQL data
*/
const getPostsFromEntryData = (pageType, data) => {
let pageData;
switch (pageType) {
case PAGE_TYPES.PLACE:
pageData = data.LocationsPage;
break;
case PAGE_TYPES.PROFILE:
pageData = data.ProfilePage;
break;
case PAGE_TYPES.HASHTAG:
pageData = data.TagPage;
break;
default: throw new Error('Not supported');
}
if (!pageData || !pageData.length) return null;
return getPostsFromGraphQL(pageType, pageData[0].graphql);
};
/**
* Attempts to scroll window and waits for XHR response, when response is fired
* it returns back to caller, else it retries the attempt again.
* @param {Object} pageData Object containing parsed page data
* @param {Object} page Puppeteer Page object
* @param {Integer} retry Retry attempts counter
*/
const loadMore = async (pageData, page, retry = 0) => {
await page.keyboard.press('PageUp');
const checkedVariable = getCheckedVariable(pageData.pageType);
const responsePromise = page.waitForResponse(
(response) => {
const responseUrl = response.url();
return responseUrl.startsWith(GRAPHQL_ENDPOINT)
&& responseUrl.includes(checkedVariable)
&& responseUrl.includes('%22first%22');
},
{ timeout: 20000 },
).catch(() => null);
let clicked;
for (let i = 0; i < 10; i++) {
const elements = await page.$x("//div[contains(text(), 'Show More Posts')]");
if (elements.length === 0) {
break;
}
const [button] = elements;
clicked = await Promise.all([
button.click(),
page.waitForRequest(
(request) => {
const requestUrl = request.url();
return requestUrl.startsWith(GRAPHQL_ENDPOINT)
&& requestUrl.includes(checkedVariable)
&& requestUrl.includes('%22first%22');
},
{
timeout: 1000,
},
).catch(() => null),
]);
if (clicked[1]) break;
}
let scrolled;
for (let i = 0; i < 10; i++) {
scrolled = await Promise.all([
// eslint-disable-next-line no-restricted-globals
page.evaluate(() => scrollBy(0, 9999999)),
page.waitForRequest(
(request) => {
const requestUrl = request.url();
return requestUrl.startsWith(GRAPHQL_ENDPOINT)
&& requestUrl.includes(checkedVariable)
&& requestUrl.includes('%22first%22');
},
{
timeout: 1000,
},
).catch(() => null),
]);
if (scrolled[1]) break;
}
let data = null;
if (scrolled[1]) {
try {
const response = await responsePromise;
const json = await response.json();
// eslint-disable-next-line prefer-destructuring
if (json) data = json.data;
} catch (error) {
Apify.utils.log.error(error);
}
}
if (!data && retry < 10 && (scrolled[1] || retry < 5)) {
const retryDelay = retry ? ++retry * retry * 1000 : ++retry * 1000;
log(pageData, `Retry scroll after ${retryDelay / 1000} seconds`);
await page.waitFor(retryDelay);
const returnData = await loadMore(pageData, page, retry);
return returnData;
}
await page.waitFor(500);
return data;
};
/**
* Scrolls page and loads data until the limit is reached or the page has no more posts
* @param {Object} pageData
* @param {Object} page
* @param {Object} request
* @param {Number} length
*/
const finiteScroll = async (pageData, page, request, length = 0) => {
const data = await loadMore(pageData, page);
if (data) {
const timeline = getPostsFromGraphQL(pageData.pageType, data);
if (!timeline.hasNextPage) return;
}
await page.waitFor(1500); // prevent rate limited error
if (posts[pageData.id].length < request.userData.limit && posts[pageData.id].length !== length) {
await finiteScroll(pageData, page, request, posts[pageData.id].length);
}
};
=======
const { expandOwnerDetails } = require('./user_details');
const { log } = require('./helpers');
const { PAGE_TYPES } = require('./consts');
const { getPosts } = require('./posts_graphql');
>>>>>>>
const { getCheckedVariable, log } = require('./helpers');
const { PAGE_TYPES, GRAPHQL_ENDPOINT } = require('./consts');
const { expandOwnerDetails } = require('./user_details');
const { getPosts } = require('./posts_graphql');
const initData = {};
const posts = {};
/**
* Takes type of page and data loaded through GraphQL and outputs
* correct list of posts based on the page type.
* @param {String} pageType Type of page we are scraping posts from
* @param {Object} data GraphQL data
*/
const getPostsFromGraphQL = (pageType, data) => {
let timeline;
switch (pageType) {
case PAGE_TYPES.PLACE:
timeline = data.location.edge_location_to_media;
break;
case PAGE_TYPES.PROFILE:
timeline = data && data.user && data.user.edge_owner_to_timeline_media;
break;
case PAGE_TYPES.HASHTAG:
timeline = data.hashtag.edge_hashtag_to_media;
break;
default: throw new Error('Not supported');
}
const postItems = timeline ? timeline.edges : [];
const hasNextPage = timeline ? timeline.page_info.has_next_page : false;
return { posts: postItems, hasNextPage };
};
/**
* Takes type of page and it's initial loaded data and outputs
* correct list of posts based on the page type.
* @param {String} pageType Type of page we are scraping posts from
* @param {Object} data GraphQL data
*/
const getPostsFromEntryData = (pageType, data) => {
let pageData;
switch (pageType) {
case PAGE_TYPES.PLACE:
pageData = data.LocationsPage;
break;
case PAGE_TYPES.PROFILE:
pageData = data.ProfilePage;
break;
case PAGE_TYPES.HASHTAG:
pageData = data.TagPage;
break;
default: throw new Error('Not supported');
}
if (!pageData || !pageData.length) return null;
return getPostsFromGraphQL(pageType, pageData[0].graphql);
};
/**
* Attempts to scroll window and waits for XHR response, when response is fired
* it returns back to caller, else it retries the attempt again.
* @param {Object} pageData Object containing parsed page data
* @param {Object} page Puppeteer Page object
* @param {Integer} retry Retry attempts counter
*/
const loadMore = async (pageData, page, retry = 0) => {
await page.keyboard.press('PageUp');
const checkedVariable = getCheckedVariable(pageData.pageType);
const responsePromise = page.waitForResponse(
(response) => {
const responseUrl = response.url();
return responseUrl.startsWith(GRAPHQL_ENDPOINT)
&& responseUrl.includes(checkedVariable)
&& responseUrl.includes('%22first%22');
},
{ timeout: 20000 },
).catch(() => null);
let clicked;
for (let i = 0; i < 10; i++) {
const elements = await page.$x("//div[contains(text(), 'Show More Posts')]");
if (elements.length === 0) {
break;
}
const [button] = elements;
clicked = await Promise.all([
button.click(),
page.waitForRequest(
(request) => {
const requestUrl = request.url();
return requestUrl.startsWith(GRAPHQL_ENDPOINT)
&& requestUrl.includes(checkedVariable)
&& requestUrl.includes('%22first%22');
},
{
timeout: 1000,
},
).catch(() => null),
]);
if (clicked[1]) break;
}
let scrolled;
for (let i = 0; i < 10; i++) {
scrolled = await Promise.all([
// eslint-disable-next-line no-restricted-globals
page.evaluate(() => scrollBy(0, 9999999)),
page.waitForRequest(
(request) => {
const requestUrl = request.url();
return requestUrl.startsWith(GRAPHQL_ENDPOINT)
&& requestUrl.includes(checkedVariable)
&& requestUrl.includes('%22first%22');
},
{
timeout: 1000,
},
).catch(() => null),
]);
if (scrolled[1]) break;
}
let data = null;
if (scrolled[1]) {
try {
const response = await responsePromise;
const json = await response.json();
// eslint-disable-next-line prefer-destructuring
if (json) data = json.data;
} catch (error) {
Apify.utils.log.error(error);
}
}
if (!data && retry < 10 && (scrolled[1] || retry < 5)) {
const retryDelay = retry ? ++retry * retry * 1000 : ++retry * 1000;
log(pageData, `Retry scroll after ${retryDelay / 1000} seconds`);
await page.waitFor(retryDelay);
const returnData = await loadMore(pageData, page, retry);
return returnData;
}
await page.waitFor(500);
return data;
};
/**
* Scrolls page and loads data until the limit is reached or the page has no more posts
* @param {Object} pageData
* @param {Object} page
* @param {Object} request
* @param {Number} length
*/
const finiteScroll = async (pageData, page, request, length = 0) => {
const data = await loadMore(pageData, page);
if (data) {
const timeline = getPostsFromGraphQL(pageData.pageType, data);
if (!timeline.hasNextPage) return;
}
await page.waitFor(1500); // prevent rate limited error
if (posts[pageData.id].length < request.userData.limit && posts[pageData.id].length !== length) {
await finiteScroll(pageData, page, request, posts[pageData.id].length);
}
};
<<<<<<<
for (const post of output) {
if (itemSpec.pageType !== PAGE_TYPES.PROFILE && (post.locationName === null || post.ownerUsername === null)) {
// Try to scrape at post detail
await requestQueue.addRequest({ url: post.url, userData: { label: 'postDetail' } });
} else {
await Apify.pushData(post);
}
}
log(itemSpec, `${output.length} items saved, task finished`);
};
/**
* Catches GraphQL responses and if they contain post data, it stores the data
* to the global variable.
* @param {Object} page Puppeteer Page object
* @param {Object} response Puppeteer Response object
*/
async function handlePostsGraphQLResponse(page, response) {
const responseUrl = response.url();
// Get variable we look for in the query string of request
const checkedVariable = getCheckedVariable(page.itemSpec.pageType);
// Skip queries for other stuff then posts
if (!responseUrl.includes(checkedVariable) || !responseUrl.includes('%22first%22')) return;
const data = await response.json();
const timeline = getPostsFromGraphQL(page.itemSpec.pageType, data.data);
posts[page.itemSpec.id] = posts[page.itemSpec.id].concat(timeline.posts);
if (!initData[page.itemSpec.id]) initData[page.itemSpec.id] = timeline;
else if (initData[page.itemSpec.id].hasNextPage && !timeline.hasNextPage) {
initData[page.itemSpec.id].hasNextPage = false;
=======
if (input.expandOwners && itemSpec.pageType !== PAGE_TYPES.PROFILE) {
output = await expandOwnerDetails(output, page, input, itemSpec);
>>>>>>>
if (input.expandOwners && itemSpec.pageType !== PAGE_TYPES.PROFILE) {
output = await expandOwnerDetails(output, page, input, itemSpec);
}
for (const post of output) {
if (itemSpec.pageType !== PAGE_TYPES.PROFILE && (post.locationName === null || post.ownerUsername === null)) {
// Try to scrape at post detail
await requestQueue.addRequest({ url: post.url, userData: { label: 'postDetail' } });
} else {
await Apify.pushData(post);
}
}
log(itemSpec, `${output.length} items saved, task finished`);
};
/**
* Catches GraphQL responses and if they contain post data, it stores the data
* to the global variable.
* @param {Object} page Puppeteer Page object
* @param {Object} response Puppeteer Response object
*/
async function handlePostsGraphQLResponse(page, response) {
const responseUrl = response.url();
// Get variable we look for in the query string of request
const checkedVariable = getCheckedVariable(page.itemSpec.pageType);
// Skip queries for other stuff then posts
if (!responseUrl.includes(checkedVariable) || !responseUrl.includes('%22first%22')) return;
const data = await response.json();
const timeline = getPostsFromGraphQL(page.itemSpec.pageType, data.data);
posts[page.itemSpec.id] = posts[page.itemSpec.id].concat(timeline.posts);
if (!initData[page.itemSpec.id]) initData[page.itemSpec.id] = timeline;
else if (initData[page.itemSpec.id].hasNextPage && !timeline.hasNextPage) {
initData[page.itemSpec.id].hasNextPage = false; |
<<<<<<<
!isEditing &&
isChannelMember &&
(isChannelOwner || isCommunityOwner || thread.isCreator) && (
<DropWrap className={flyoutOpen ? 'open' : ''}>
<IconButton glyph="settings" onClick={this.toggleFlyout} />
<Flyout>
{isCommunityOwner &&
!thread.channel.isPrivate && (
<FlyoutRow>
<IconButton
glyph={isPinned ? 'pin-fill' : 'pin'}
hoverColor={
isPinned ? 'warn.default' : 'special.default'
}
tipText={
isPinned
? 'Un-pin thread'
: `Pin in ${thread.channel.community.name}`
}
tipLocation="top-left"
onClick={this.togglePinThread}
/>
</FlyoutRow>
)}
{(isChannelOwner || isCommunityOwner) && (
<FlyoutRow>
<IconButton
glyph="freeze"
hoverColor="space.light"
tipText={
thread.isLocked ? 'Unfreeze chat' : 'Freeze chat'
}
tipLocation="top-left"
onClick={this.threadLock}
/>
</FlyoutRow>
)}
{(thread.isCreator || isChannelOwner || isCommunityOwner) && (
<FlyoutRow>
<IconButton
glyph="delete"
hoverColor="warn.alt"
tipText="Delete thread"
tipLocation="top-left"
onClick={this.triggerDelete}
/>
</FlyoutRow>
)}
{thread.isCreator && (
<FlyoutRow>
<IconButton
glyph="edit"
hoverColor="text.alt"
tipText="Edit"
tipLocation="top-left"
onClick={this.toggleEdit}
/>
</FlyoutRow>
)}
</Flyout>
</DropWrap>
)}
=======
!isEditing &&
isChannelMember &&
(isChannelOwner || isCommunityOwner || thread.isCreator) && (
<DropWrap className={flyoutOpen ? 'open' : ''}>
<IconButton glyph="settings" onClick={this.toggleFlyout} />
<Flyout>
{isCommunityOwner &&
!thread.channel.isPrivate && (
<FlyoutRow>
<IconButton
glyph={isPinned ? 'pin-fill' : 'pin'}
hoverColor={isPinned ? 'warn.default' : 'special.default'}
tipText={
isPinned ? (
'Un-pin thread'
) : (
`Pin in ${thread.channel.community.name}`
)
}
tipLocation="top-left"
onClick={this.togglePinThread}
/>
</FlyoutRow>
)}
{(isChannelOwner || isCommunityOwner) && (
<FlyoutRow>
<IconButton
glyph="freeze"
hoverColor="space.alt"
tipText={
thread.isLocked ? 'Unfreeze chat' : 'Freeze chat'
}
tipLocation="top-left"
onClick={this.threadLock}
/>
</FlyoutRow>
)}
{(thread.isCreator || isChannelOwner || isCommunityOwner) && (
<FlyoutRow>
<IconButton
glyph="delete"
hoverColor="warn.alt"
tipText="Delete thread"
tipLocation="top-left"
onClick={this.triggerDelete}
/>
</FlyoutRow>
)}
{thread.isCreator &&
thread.type === 'SLATE' && (
<FlyoutRow>
<IconButton
glyph="edit"
hoverColor="text.alt"
tipText="Edit"
tipLocation="top-left"
onClick={this.toggleEdit}
/>
</FlyoutRow>
)}
</Flyout>
</DropWrap>
)}
>>>>>>>
!isEditing &&
isChannelMember &&
(isChannelOwner || isCommunityOwner || thread.isCreator) && (
<DropWrap className={flyoutOpen ? 'open' : ''}>
<IconButton glyph="settings" onClick={this.toggleFlyout} />
<Flyout>
{isCommunityOwner &&
!thread.channel.isPrivate && (
<FlyoutRow>
<IconButton
glyph={isPinned ? 'pin-fill' : 'pin'}
hoverColor={
isPinned ? 'warn.default' : 'special.default'
}
tipText={
isPinned
? 'Un-pin thread'
: `Pin in ${thread.channel.community.name}`
}
tipLocation="top-left"
onClick={this.togglePinThread}
/>
</FlyoutRow>
)}
{(isChannelOwner || isCommunityOwner) && (
<FlyoutRow>
<IconButton
glyph="freeze"
hoverColor="space.alt"
tipText={
thread.isLocked ? 'Unfreeze chat' : 'Freeze chat'
}
tipLocation="top-left"
onClick={this.threadLock}
/>
</FlyoutRow>
)}
{(thread.isCreator || isChannelOwner || isCommunityOwner) && (
<FlyoutRow>
<IconButton
glyph="delete"
hoverColor="warn.alt"
tipText="Delete thread"
tipLocation="top-left"
onClick={this.triggerDelete}
/>
</FlyoutRow>
)}
{thread.isCreator && (
<FlyoutRow>
<IconButton
glyph="edit"
hoverColor="text.alt"
tipText="Edit"
tipLocation="top-left"
onClick={this.toggleEdit}
/>
</FlyoutRow>
)}
</Flyout>
</DropWrap>
)} |
<<<<<<<
import ArchiveForm from './archiveForm';
// import { ChannelInvitationForm } from '../../../components/emailInvitationForm';
=======
import LoginTokenSettings from './loginTokenSettings';
>>>>>>>
import ArchiveForm from './archiveForm';
import LoginTokenSettings from './loginTokenSettings'; |
<<<<<<<
<Wrapper data-e2e-id="pricing-page">
<Intro />
<Paid />
<Discount />
<CommunityList
setOwnsCommunities={this.setOwnsCommunities}
ref={component => (this.ownedCommunitiesSection = component)}
/>
=======
<Wrapper data-cy="pricing-page">
<Nav location={'pricing'} />
<ContentContainer>
<PageTitle>Pricing designed with communities in mind.</PageTitle>
<PageSubtitle>
We know how hard it can be to build a great online community. We’ve
designed our pricing to make things easier. The result is our{' '}
<a
style={{ fontWeight: 'bold' }}
onClick={this.scrollToFairPriceFaq}
>
Fair Price Promise
</a>.
</PageSubtitle>
<Section>
<PricingPlanTable
scrollToPaidFeatures={this.scrollToPaidFeatures}
scrollToOss={this.scrollToOss}
/>
</Section>
<Section>
<SectionTitle>Our Fair Price Promise</SectionTitle>
<SectionDescription>
Growing and managing an active online community is hard work. The
last thing you need is another bill looming on the horizon for
features you don’t need, or rarely ever use.
</SectionDescription>
<SectionDescription>
<Highlight>
That’s why we automatically prorate your monthly bill to only
charge for the time that features were used.
</Highlight>
</SectionDescription>
<TableCardButton
light
onClick={this.scrollToFairPriceFaq}
style={{ marginTop: '24px' }}
>
Learn more about how this works
</TableCardButton>
</Section>
<Section
innerRef={component => (this.freeFeaturesSection = component)}
>
<SectionTitle>It all starts with free</SectionTitle>
<SectionDescription>
It takes time for a community to find its feet - we’ve been there
before. That’s why all communities on Spectrum can be started and
maintained indefinitely for free. Free communities come with:
</SectionDescription>
<FreeFeaturesList />
</Section>
<Section
innerRef={component => (this.paidFeaturesSection = component)}
>
<SectionTitle>
Pay as you go for powerful management features
</SectionTitle>
<SectionDescription>
For growing communities that need deeper understanding and
powerful management tools, we’ve got you covered. All of our paid
features are covered by our{' '}
<Highlight>Fair Price Promise</Highlight>.
</SectionDescription>
<PaidFeaturesList />
</Section>
<Section innerRef={component => (this.ossSection = component)}>
<SectionTitle>For communities that are giving back</SectionTitle>
<SectionDescription>
If you’re looking for a place to grow your community for an
<Highlight>
open-source project, non-profit, or education program
</Highlight>, we want to help. Qualifying communities will have
access to{' '}
<Highlight>
one free moderator seat and one free private channel
</Highlight>.
</SectionDescription>
<SectionDescription>
Get in touch with information about your community or
organization, and we’ll get back to you soon.
</SectionDescription>
{ownsCommunities && (
<TableCardButton
light
onClick={this.scrollToOwnedCommunities}
style={{ marginTop: '24px' }}
>
View my communities
</TableCardButton>
)}
<a href={'mailto:[email protected]'} style={{ width: '100%' }}>
<TableCardButton light>Get in touch</TableCardButton>
</a>
</Section>
<CommunityList
setOwnsCommunities={this.setOwnsCommunities}
ref={component => (this.ownedCommunitiesSection = component)}
/>
<Section>
<SectionTitle>Creating a new community?</SectionTitle>
<SectionDescription>
Communities can be created for free at any time. Get started
below.
</SectionDescription>
<Link style={{ width: '100%' }} to={'/new/community'}>
<TableCardButton style={{ marginTop: '24px' }}>
Create a community
</TableCardButton>
</Link>
</Section>
<Divider />
<Section
innerRef={component => (this.fairPriceFaqSection = component)}
>
<SectionTitle>More about our Fair Price Promise</SectionTitle>
<Subsection>
<SectionSubtitle>How it works</SectionSubtitle>
<SectionDescription>
Each month we only bill you for the features that you used in
that time period, and prorate any features used for less than a
month.
</SectionDescription>
<SectionDescription>Here’s a quick example:</SectionDescription>
<SectionDescription>
Imagine you need a private channel for an event planning team
within your community. When you create the private channel,
Spectrum bills you $10. If your private channel is still being
used at the end of the month, we’ll automatically keep the
subscription going.
</SectionDescription>
<SectionDescription>
However, if you archive the channel after one week, we’ll
automatically apply credit to your account for the unused time.
</SectionDescription>
</Subsection>
<Subsection>
<SectionSubtitle>
How will this be reflected on my credit card statement?
</SectionSubtitle>
<SectionDescription>
Spectrum calculates usage at the end of each billing cycle, and
then prorates back any credit for unused features. You may
receive lower-than-expected charges on your card that reflect
credit being used.
</SectionDescription>
</Subsection>
<Subsection>
<SectionSubtitle>
Will I know when I’ve received a proration for unused time?
</SectionSubtitle>
<SectionDescription>
Yes. At the end of each billing cycle we will send you a receipt
email that will include line items for all charges, prorations,
and credit used.
</SectionDescription>
</Subsection>
<Subsection>
<SectionSubtitle>
I would like to talk with the team about how this works.
</SectionSubtitle>
<SectionDescription>
If you have any questions about this, or feel you’ve found an
error in how much you were charged, please don’t hesitate to{' '}
<a href="mailto:[email protected]">get in touch</a>.
</SectionDescription>
</Subsection>
</Section>
</ContentContainer>
>>>>>>>
<Wrapper data-cy="pricing-page">
<Intro />
<Paid />
<Discount />
<CommunityList
setOwnsCommunities={this.setOwnsCommunities}
ref={component => (this.ownedCommunitiesSection = component)}
/> |
<<<<<<<
import { getCommunity } from '../db/communities';
=======
import { throwError } from './errors';
>>>>>>>
import { getCommunity } from '../db/communities';
import { throwError } from './errors';
<<<<<<<
const { communities: { active } } = getState();
if (!active || active === 'everything') return;
=======
const { user: { uid } } = getState();
// Notifications
if (lowerCaseFrequency === 'notifications') {
if (!uid) return;
track('notifications', 'viewed', null);
getNotifications(uid)
.then(notifications => {
dispatch({
type: 'SET_NOTIFICATIONS',
notifications,
});
})
.catch(err => {
dispatch(throwError(err));
});
return;
}
// Everything
if (lowerCaseFrequency === 'everything') {
// If there's no UID yet we might need to show the homepage, so don't do anything
if (!uid) return;
track('everything', 'viewed', null);
// Get all the stories from all the frequencies
getAllStories(uid)
.then(stories => {
dispatch({
type: 'ADD_STORIES',
stories,
});
})
.catch(err => {
dispatch(throwError(err, { stopLoading: true }));
});
return;
}
// Explore
if (lowerCaseFrequency === 'explore') {
if (!uid) return;
track('explore', 'viewed', null);
dispatch({ type: 'STOP_LOADING' });
return;
}
>>>>>>>
const { communities: { active } } = getState();
if (!active || active === 'everything' || active === 'explore') return; |
<<<<<<<
};
export type DBStripeCustomer = {
created: number,
currency: ?string,
customerId: string,
email: string,
metadata: ?{
communityId?: string,
communityName?: string,
},
=======
};
export type FileUpload = {
filename: string,
mimetype: string,
encoding: string,
stream: any,
>>>>>>>
};
export type DBStripeCustomer = {
created: number,
currency: ?string,
customerId: string,
email: string,
metadata: ?{
communityId?: string,
communityName?: string,
},
};
export type FileUpload = {
filename: string,
mimetype: string,
encoding: string,
stream: any, |
<<<<<<<
const Notification = require('./types/Notification');
=======
const DirectMessageGroup = require('./types/DirectMessageGroup');
>>>>>>>
const DirectMessageGroup = require('./types/DirectMessageGroup');
const Notification = require('./types/Notification');
<<<<<<<
const notificationQueries = require('./queries/notification');
=======
const reactionQueries = require('./queries/reaction');
const directMessageGroupQueries = require('./queries/directMessageGroup');
>>>>>>>
const reactionQueries = require('./queries/reaction');
const directMessageGroupQueries = require('./queries/directMessageGroup');
const notificationQueries = require('./queries/notification');
<<<<<<<
const notificationMutations = require('./mutations/notification');
=======
const reactionMutations = require('./mutations/reaction');
const communityMutations = require('./mutations/community');
const directMessageGroupMutations = require('./mutations/directMessageGroup');
>>>>>>>
const reactionMutations = require('./mutations/reaction');
const communityMutations = require('./mutations/community');
const directMessageGroupMutations = require('./mutations/directMessageGroup');
const notificationMutations = require('./mutations/notification');
<<<<<<<
Notification,
=======
DirectMessageGroup,
>>>>>>>
DirectMessageGroup,
Notification,
<<<<<<<
notificationQueries,
=======
directMessageGroupQueries,
reactionQueries,
// mutations
>>>>>>>
directMessageGroupQueries,
reactionQueries,
notificationQueries,
// mutations
<<<<<<<
notificationMutations,
=======
directMessageGroupMutations,
reactionMutations,
communityMutations,
// subscriptions
>>>>>>>
directMessageGroupMutations,
reactionMutations,
communityMutations,
notificationMutations,
// subscriptions |
<<<<<<<
{theme.old && notificationComponent}
=======
>>>>>>>
{theme.old && notificationComponent} |
<<<<<<<
`;
/* NOTE(@mxstbr): This is super hacky, but I couldn't find a way to give two mentions in the same message a different key. (i.e. "Yo @mxstbr, where is @brianlovin at? I can't find @brianlovin" would only show the mention once) */
let i = 0;
export const Mention = props => {
return (
<Link key={`mention-${i++}`} to={`/users/${props.decoratedText.substr(1)}`}>
{props.children}
</Link>
);
};
=======
`;
export const EmbedContainer = styled.div`
position: relative;
width: 100%;
margin-bottom: 32px;
display: flex;
justify-content: center;
`;
export const AspectRatio = styled(EmbedContainer)`
padding-bottom: ${props => (props.ratio ? props.ratio : '0')};
`;
export const EmbedComponent = styled.iframe`
position: absolute;
height: 100%;
width: 100%;
`;
>>>>>>>
`;
/* NOTE(@mxstbr): This is super hacky, but I couldn't find a way to give two mentions in the same message a different key. (i.e. "Yo @mxstbr, where is @brianlovin at? I can't find @brianlovin" would only show the mention once) */
let i = 0;
export const Mention = props => {
return (
<Link key={`mention-${i++}`} to={`/users/${props.decoratedText.substr(1)}`}>
{props.children}
</Link>
);
};
export const EmbedContainer = styled.div`
position: relative;
width: 100%;
margin-bottom: 32px;
display: flex;
justify-content: center;
`;
export const AspectRatio = styled(EmbedContainer)`
padding-bottom: ${props => (props.ratio ? props.ratio : '0')};
`;
export const EmbedComponent = styled.iframe`
position: absolute;
height: 100%;
width: 100%;
`; |
<<<<<<<
if (
isEverything && this.state.showDiscoverCard && user.uid ||
user.uid && frequencies.active === 'discover'
) {
sortedStories.unshift(<NuxJoinCard />);
}
if (user.uid && frequencies.active === 'hugs-n-bugs') {
sortedStories.unshift(<ReportBugCard />);
}
if (!user.uid) {
sortedStories.unshift(<LoginCard />);
}
=======
>>>>>>> |
<<<<<<<
children?: Node,
};
=======
children?: Children,
|};
>>>>>>>
children?: Node,
|}; |
<<<<<<<
DEFAULT_SESSIONS,
=======
DEFAULT_MESSAGES,
>>>>>>>
DEFAULT_SESSIONS,
DEFAULT_MESSAGES,
<<<<<<<
sessions: DEFAULT_SESSIONS,
=======
messages: DEFAULT_MESSAGES,
>>>>>>>
sessions: DEFAULT_SESSIONS,
messages: DEFAULT_MESSAGES, |
<<<<<<<
export const THREAD_NOTIFICATION = 'thread notification';
export const COMMUNITY_INVITE_NOTIFICATION = 'community invite notification';
export const SEND_COMMUNITY_INVITE_EMAIL = 'community invite email';
export const SLACK_IMPORT = 'slack import';
=======
export const THREAD_NOTIFICATION = 'thread notification';
export const SEND_NEW_MESSAGE_EMAIL = 'send new message email';
>>>>>>>
export const THREAD_NOTIFICATION = 'thread notification';
export const COMMUNITY_INVITE_NOTIFICATION = 'community invite notification';
export const SEND_COMMUNITY_INVITE_EMAIL = 'community invite email';
export const SLACK_IMPORT = 'slack import';
export const SEND_NEW_MESSAGE_EMAIL = 'send new message email'; |
<<<<<<<
unread,
frequencies,
communities,
activeFrequency,
loaded,
=======
>>>>>>>
frequencies,
communities,
activeFrequency,
loaded, |
<<<<<<<
type StripeCard {
brand: String
exp_month: Int
exp_year: Int
last4: String
}
type StripeSource {
id: ID
card: StripeCard
isDefault: Boolean
}
type StripeItem {
id: ID
amount: Int
quantity: Int
planId: String
planName: String
}
type StripeSubscriptionItem {
created: Int
planId: String
planName: String
amount: Int
quantity: Int
id: String
}
type StripeDiscount {
amount_off: Int
percent_off: Int
id: String
}
type StripeSubscription {
id: ID
created: Int
discount: StripeDiscount
billing_cycle_anchor: Int
current_period_end: Int
canceled_at: Int
items: [StripeSubscriptionItem]
status: String
}
type StripeInvoice {
id: ID
date: Int
items: [StripeItem]
total: Int
}
type CommunityBillingSettings {
pendingAdministratorEmail: String
administratorEmail: String
sources: [StripeSource]
invoices: [StripeInvoice]
subscriptions: [StripeSubscription]
}
type Features {
analytics: Boolean
prioritySupport: Boolean
}
=======
type BrandedLogin {
isEnabled: Boolean
message: String
}
>>>>>>>
type StripeCard {
brand: String
exp_month: Int
exp_year: Int
last4: String
}
type StripeSource {
id: ID
card: StripeCard
isDefault: Boolean
}
type StripeItem {
id: ID
amount: Int
quantity: Int
planId: String
planName: String
}
type StripeSubscriptionItem {
created: Int
planId: String
planName: String
amount: Int
quantity: Int
id: String
}
type StripeDiscount {
amount_off: Int
percent_off: Int
id: String
}
type StripeSubscription {
id: ID
created: Int
discount: StripeDiscount
billing_cycle_anchor: Int
current_period_end: Int
canceled_at: Int
items: [StripeSubscriptionItem]
status: String
}
type StripeInvoice {
id: ID
date: Int
items: [StripeItem]
total: Int
}
type CommunityBillingSettings {
pendingAdministratorEmail: String
administratorEmail: String
sources: [StripeSource]
invoices: [StripeInvoice]
subscriptions: [StripeSubscription]
}
type Features {
analytics: Boolean
prioritySupport: Boolean
}
type BrandedLogin {
isEnabled: Boolean
message: String
}
<<<<<<<
input UpdateAdministratorEmailInput {
id: ID!
email: String!
}
input AddPaymentSourceInput {
sourceId: String!
communityId: ID!
}
input RemovePaymentSourceInput {
sourceId: String!
communityId: ID!
}
input MakePaymentSourceDefaultInput {
sourceId: String!
communityId: ID!
}
input CancelSubscriptionInput {
communityId: ID!
}
input EnableCommunityAnalyticsInput {
communityId: ID!
}
input DisableCommunityAnalyticsInput {
communityId: ID!
}
=======
input EnableBrandedLoginInput {
id: String!
}
input DisableBrandedLoginInput {
id: String!
}
input SaveBrandedLoginSettingsInput {
id: String!
message: String
}
>>>>>>>
input UpdateAdministratorEmailInput {
id: ID!
email: String!
}
input AddPaymentSourceInput {
sourceId: String!
communityId: ID!
}
input RemovePaymentSourceInput {
sourceId: String!
communityId: ID!
}
input MakePaymentSourceDefaultInput {
sourceId: String!
communityId: ID!
}
input CancelSubscriptionInput {
communityId: ID!
}
input EnableCommunityAnalyticsInput {
communityId: ID!
}
input DisableCommunityAnalyticsInput {
communityId: ID!
}
input EnableBrandedLoginInput {
id: String!
}
input DisableBrandedLoginInput {
id: String!
}
input SaveBrandedLoginSettingsInput {
id: String!
message: String
}
<<<<<<<
updateAdministratorEmail(input: UpdateAdministratorEmailInput!): Community
addPaymentSource(input: AddPaymentSourceInput!): Community
removePaymentSource(input: RemovePaymentSourceInput!): Community
makePaymentSourceDefault(input: MakePaymentSourceDefaultInput!): Community
cancelSubscription(input: CancelSubscriptionInput!): Community
enableCommunityAnalytics(input: EnableCommunityAnalyticsInput!): Community
disableCommunityAnalytics(input: DisableCommunityAnalyticsInput!): Community
=======
enableBrandedLogin(input: EnableBrandedLoginInput!): Community
disableBrandedLogin(input: DisableBrandedLoginInput!): Community
saveBrandedLoginSettings(input: SaveBrandedLoginSettingsInput!): Community
>>>>>>>
updateAdministratorEmail(input: UpdateAdministratorEmailInput!): Community
addPaymentSource(input: AddPaymentSourceInput!): Community
removePaymentSource(input: RemovePaymentSourceInput!): Community
makePaymentSourceDefault(input: MakePaymentSourceDefaultInput!): Community
cancelSubscription(input: CancelSubscriptionInput!): Community
enableCommunityAnalytics(input: EnableCommunityAnalyticsInput!): Community
disableCommunityAnalytics(input: DisableCommunityAnalyticsInput!): Community
enableBrandedLogin(input: EnableBrandedLoginInput!): Community
disableBrandedLogin(input: DisableBrandedLoginInput!): Community
saveBrandedLoginSettings(input: SaveBrandedLoginSettingsInput!): Community |
<<<<<<<
hasRights &&
!isFrozen && (
<Input>
<ChatInputWrapper type="only">
<ChatInput
threadType="story"
thread={thread.id}
currentUser={loggedInUser}
forceScrollToBottom={this.forceScrollToBottom}
autoFocus={isParticipantOrCreator}
/>
</ChatInputWrapper>
</Input>
)}
=======
hasRights &&
!isFrozen && (
<Input>
<ChatInputWrapper type="only">
<ChatInput
threadType="story"
thread={thread.id}
currentUser={loggedInUser}
forceScrollToBottom={this.forceScrollToBottom}
onRef={chatInput => (this.chatInput = chatInput)}
/>
</ChatInputWrapper>
</Input>
)}
>>>>>>>
hasRights &&
!isFrozen && (
<Input>
<ChatInputWrapper type="only">
<ChatInput
threadType="story"
thread={thread.id}
currentUser={loggedInUser}
forceScrollToBottom={this.forceScrollToBottom}
autoFocus={isParticipantOrCreator}
onRef={chatInput => (this.chatInput = chatInput)}
/>
</ChatInputWrapper>
</Input>
)} |
<<<<<<<
// import { createQuery } from 'shared/rethinkdb/create-query';
import type { DBUsersChannels, DBChannel } from 'shared/types';
=======
import {
incrementMemberCount,
decrementMemberCount,
setMemberCount,
} from './channel';
>>>>>>>
import {
incrementMemberCount,
decrementMemberCount,
setMemberCount,
} from './channel';
import type { DBUsersChannels, DBChannel } from 'shared/types';
<<<<<<<
=======
await decrementMemberCount(channelId)
>>>>>>>
await decrementMemberCount(channelId)
<<<<<<<
const approveBlockedUserInChannel = (channelId: string, userId: string): Promise<DBUsersChannels> => {
=======
const approveBlockedUserInChannel = async (channelId: string, userId: string): Promise<DBUsersChannels> => {
>>>>>>>
const approveBlockedUserInChannel = async (channelId: string, userId: string): Promise<DBUsersChannels> => { |
<<<<<<<
const tabBarVisible = navigation => {
const { routes } = navigation.state;
const nonTabbarRoutes = ['Thread', 'ThreadDetail', 'DirectMessageThread'];
let showTabbar = true;
routes.forEach(route => {
if (nonTabbarRoutes.indexOf(route.routeName) >= 0) {
showTabbar = false;
}
});
return showTabbar;
};
=======
const IS_PROD = process.env.NODE_ENV === 'production';
>>>>>>>
const tabBarVisible = navigation => {
const { routes } = navigation.state;
const nonTabbarRoutes = ['Thread', 'ThreadDetail', 'DirectMessageThread'];
let showTabbar = true;
routes.forEach(route => {
if (nonTabbarRoutes.indexOf(route.routeName) >= 0) {
showTabbar = false;
}
});
return showTabbar;
};
const IS_PROD = process.env.NODE_ENV === 'production'; |
<<<<<<<
const { topbar, theme } = stores;
=======
const { profile, topbar } = stores;
>>>>>>>
const { profile, topbar, theme } = stores; |
<<<<<<<
markAllNotificationsSeen = () => {
const { allUnseenCount } = this.state;
if (allUnseenCount === 0) {
return null;
} else {
this.setState({
allUnseenCount: 0,
});
this.props
.markAllNotificationsSeen()
.then(({ data: { markAllNotificationsSeen } }) => {
// notifs were marked as seen
})
.catch(err => {
// error
});
}
};
markAllNotificationsRead = () => {
this.props
.markAllNotificationsRead()
.then(({ data: { markAllNotificationsRead } }) => {
// notifs were marked as read
})
.catch(err => {
// error
});
};
markDmNotificationsAsSeen = () => {
const { dmUnseenCount } = this.state;
if (dmUnseenCount === 0) {
return null;
} else {
this.setState({
dmUnseenCount: 0,
});
this.props
.markDirectMessageNotificationsSeen()
.then(({ data: { markAllUserDirectMessageNotificationsRead } }) => {
// notifs were marked as seen
})
.catch(err => {
// err
});
}
};
login = () => {
// log the user in and return them to this page
return (window.location.href = `${SERVER_URL}/auth/twitter?redirectTo=${window.location.pathname}`);
};
=======
login = () => {
// log the user in and return them to this page
return (window.location.href = `${SERVER_URL}/auth/twitter?r=${window.location.href}`);
};
>>>>>>>
markAllNotificationsSeen = () => {
const { allUnseenCount } = this.state;
if (allUnseenCount === 0) {
return null;
} else {
this.setState({
allUnseenCount: 0,
});
this.props
.markAllNotificationsSeen()
.then(({ data: { markAllNotificationsSeen } }) => {
// notifs were marked as seen
})
.catch(err => {
// error
});
}
};
markAllNotificationsRead = () => {
this.props
.markAllNotificationsRead()
.then(({ data: { markAllNotificationsRead } }) => {
// notifs were marked as read
})
.catch(err => {
// error
});
};
markDmNotificationsAsSeen = () => {
const { dmUnseenCount } = this.state;
if (dmUnseenCount === 0) {
return null;
} else {
this.setState({
dmUnseenCount: 0,
});
this.props
.markDirectMessageNotificationsSeen()
.then(({ data: { markAllUserDirectMessageNotificationsRead } }) => {
// notifs were marked as seen
})
.catch(err => {
// err
});
}
};
login = () => {
// log the user in and return them to this page
return (window.location.href = `${SERVER_URL}/auth/twitter?r=${window.location.href}`);
};
<<<<<<<
const { allUnseenCount, dmUnseenCount, notifications } = this.state;
=======
>>>>>>>
const { allUnseenCount, dmUnseenCount, notifications } = this.state; |
<<<<<<<
classicTheme: boolean
=======
removeWord: Function,
hasWord: Function
>>>>>>>
removeWord: Function,
hasWord: Function,
classicTheme: boolean
<<<<<<<
classicTheme={classicTheme}
=======
onFinishBackup={onFinishBackup}
removeWord={removeWord}
hasWord={hasWord}
>>>>>>>
onFinishBackup={onFinishBackup}
removeWord={removeWord}
hasWord={hasWord}
classicTheme={classicTheme} |
<<<<<<<
placeholder: '+ Embed',
embedUrl: '',
=======
creating: true,
>>>>>>>
placeholder: '+ Embed',
embedUrl: '',
creating: true,
<<<<<<<
<Byline>New Story</Byline>
<Textarea
onChange={this.changeTitle}
style={StoryTitle}
value={composer.title}
placeholder={"What's up?"}
autoFocus
/>
<Textarea
onChange={this.changeBody}
value={composer.body}
style={TextBody}
placeholder={'Say more words...'}
/>
<MediaInput
ref="media"
type="file"
id="file"
name="file"
accept=".png, .jpg, .jpeg, .gif"
multiple={true}
onChange={this.uploadMedia}
/>
<MediaLabel htmlFor="file">+ Upload Image</MediaLabel>
<EmbedInput
placeholder={this.state.placeholder}
onFocus={this.handleFocus}
onBlur={this.handleBlur}
onChange={this.handleChange}
value={this.state.embedUrl}
/>
<SubmitContainer>
=======
<Byline
onClick={this.setCreating}
hasContent={true}
active={this.state.creating}
>
Create
</Byline>
<Byline
onClick={this.setPreviewing}
active={!this.state.creating}
hasContent={
composer.title.length > 0 && composer.body.length > 0
}
>
Preview
</Byline>
{this.state.creating
? <div>
<Textarea
onChange={this.changeTitle}
style={StoryTitle}
value={composer.title}
placeholder={'What’s up?'}
autoFocus
/>
<Textarea
onChange={this.changeBody}
value={composer.body}
style={TextBody}
placeholder={'Say more words...'}
/>
<MediaInput
ref="media"
type="file"
id="file"
name="file"
accept=".png, .jpg, .jpeg, .gif"
multiple={true}
onChange={this.uploadMedia}
/>
<MediaLabel htmlFor="file">+ Upload Image</MediaLabel>
</div>
: <PreviewWrapper>
<StoryTitlePreview>{composer.title}</StoryTitlePreview>
<div className="markdown" ref="story">
<Markdown
options={{
html: true,
linkify: true,
}}
source={composer.body}
/>
</div>
</PreviewWrapper>}
<SubmitContainer sticky={!this.state.creating}>
>>>>>>>
<Byline
onClick={this.setCreating}
hasContent={true}
active={this.state.creating}
>
Create
</Byline>
<Byline
onClick={this.setPreviewing}
active={!this.state.creating}
hasContent={
composer.title.length > 0 && composer.body.length > 0
}
>
Preview
</Byline>
{this.state.creating
? <div>
<Textarea
onChange={this.changeTitle}
style={StoryTitle}
value={composer.title}
placeholder={'What’s up?'}
autoFocus
/>
<Textarea
onChange={this.changeBody}
value={composer.body}
style={TextBody}
placeholder={'Say more words...'}
/>
<MediaInput
ref="media"
type="file"
id="file"
name="file"
accept=".png, .jpg, .jpeg, .gif"
multiple={true}
onChange={this.uploadMedia}
/>
<MediaLabel htmlFor="file">+ Upload Image</MediaLabel>
</div>
: <PreviewWrapper>
<StoryTitlePreview>{composer.title}</StoryTitlePreview>
<div className="markdown" ref="story">
<Markdown
options={{
html: true,
linkify: true,
}}
source={composer.body}
/>
</div>
</PreviewWrapper>}
<SubmitContainer sticky={!this.state.creating}> |
<<<<<<<
=======
const LS_BODY_KEY = 'last-thread-composer-body';
const LS_TITLE_KEY = 'last-thread-composer-title';
const LS_COMPOSER_EXPIRE = 'last-thread-composer-expire';
const DISCARD_DRAFT_MESSAGE = 'Are you sure you want to discard this draft?';
const ONE_DAY = (): string => {
const time = new Date().getTime() + 60 * 60 * 24 * 1000;
return time.toString();
};
>>>>>>>
const DISCARD_DRAFT_MESSAGE = 'Are you sure you want to discard this draft?';
<<<<<<<
=======
// we will clear the composer if it unmounts as a result of a post
// being published or draft discarded, that way the next composer open will start fresh
if (clear) {
this.clearEditorStateAfterPublish();
this.setState({
title: '',
body: '',
preview: false,
});
}
>>>>>>>
// we will clear the composer if it unmounts as a result of a post
// being published or draft discarded, that way the next composer open will start fresh
if (clear) {
this.clearEditorStateAfterPublish();
this.setState({
title: '',
body: '',
preview: false,
});
}
<<<<<<<
handleTitleBodyChange = (key: 'title' | 'body') => {
storeDraftThread({
[key]: this.state[key],
});
=======
onCancelClick = async () => {
this.discardDraft();
};
handleTitleBodyChange = titleOrBody => {
if (titleOrBody === 'body') {
localStorage.setItem(LS_BODY_KEY, this.state.body);
} else {
localStorage.setItem(LS_TITLE_KEY, this.state.title);
}
localStorage.setItem(LS_COMPOSER_EXPIRE, ONE_DAY());
>>>>>>>
onCancelClick = () => {
this.discardDraft();
};
handleTitleBodyChange = (key: 'title' | 'body') => {
storeDraftThread({
[key]: this.state[key],
}); |
<<<<<<<
},
getAddressesWithFundsError: {
id: 'api.errors.getAddressesWithFundsError',
defaultMessage: '!!!Error while getting addresses with funds.',
description: '"Error while getting addresses with funds." error message'
},
generateTransferTxError: {
id: 'api.errors.generateTransferTxError',
defaultMessage: '!!!Error while generating transfer transacion.',
description: '"Error while generating transfer transacion." error message'
=======
},
pendingTransactionError: {
id: 'api.errors.pendingTransactionError',
defaultMessage: '!!!Error while updating pending transactions.',
description: '"Error while updating pending transactions." error message'
>>>>>>>
},
pendingTransactionError: {
id: 'api.errors.pendingTransactionError',
defaultMessage: '!!!Error while updating pending transactions.',
description: '"Error while updating pending transactions." error message'
},
getAddressesWithFundsError: {
id: 'api.errors.getAddressesWithFundsError',
defaultMessage: '!!!Error while getting addresses with funds.',
description: '"Error while getting addresses with funds." error message'
},
generateTransferTxError: {
id: 'api.errors.generateTransferTxError',
defaultMessage: '!!!Error while generating transfer transacion.',
description: '"Error while generating transfer transacion." error message'
<<<<<<<
}
export class GetAddressesWithFundsError extends LocalizableError {
constructor() {
super({
id: messages.getAddressesWithFundsError.id,
defaultMessage: messages.getAddressesWithFundsError.defaultMessage
});
}
}
export class GenerateTransferTxError extends LocalizableError {
constructor() {
super({
id: messages.generateTransferTxError.id,
defaultMessage: messages.generateTransferTxError.defaultMessage
});
}
=======
}
export class PendingTransactionError extends LocalizableError {
constructor() {
super({
id: messages.pendingTransactionError.id,
defaultMessage: messages.pendingTransactionError.defaultMessage,
});
}
>>>>>>>
}
export class PendingTransactionError extends LocalizableError {
constructor() {
super({
id: messages.pendingTransactionError.id,
defaultMessage: messages.pendingTransactionError.defaultMessage,
});
}
}
export class GetAddressesWithFundsError extends LocalizableError {
constructor() {
super({
id: messages.getAddressesWithFundsError.id,
defaultMessage: messages.getAddressesWithFundsError.defaultMessage
});
}
}
export class GenerateTransferTxError extends LocalizableError {
constructor() {
super({
id: messages.generateTransferTxError.id,
defaultMessage: messages.generateTransferTxError.defaultMessage
});
} |
<<<<<<<
// Select the first thread on SSR if none is selected
componentWillMount() {
const { mountedWithActiveThread } = this.props;
if (
mountedWithActiveThread ||
this.props.selectedId ||
!this.props.data.threads
)
return;
const threadNodes = this.props.data.threads
.slice()
.map(thread => thread && thread.node);
const sortedThreadNodes = sortByDate(threadNodes, 'lastActive', 'desc');
const hasFirstThread = sortedThreadNodes.length > 0;
const firstThreadId = hasFirstThread ? sortedThreadNodes[0].id : '';
if (hasFirstThread) {
this.props.history.replace(`/?t=${firstThreadId}`);
}
}
componentDidUpdate(prev) {
=======
componentDidUpdate(prevProps) {
>>>>>>>
componentDidUpdate(prev) { |
<<<<<<<
const freq = isEverything &&
getCurrentFrequency(story.frequencyId, frequencies);
return React.isValidElement(story)
? story
: <StoryCard
isActive={activeStory === story.id}
key={key}
link={`/~${activeFrequency}/${story.id}`}
media={story.content.media}
messages={story.messages ? Object.keys(story.messages).length : 0}
metaLink={isEverything && freq && `/~${freq.slug}`}
metaText={isEverything && freq && `~${freq.name}`}
person={{
photo: story.creator.photoURL,
name: story.creator.displayName,
uid: story.creator.uid,
}}
timestamp={story.last_activity || story.timestamp}
title={story.content.title}
unreadMessages={unreadMessages}
isNew={isNew}
story={story}
participants={story.participants}
metadata={story.metadata ? story.metadata : null}
/>;
=======
const freq = getCurrentFrequency(story.frequencyId, frequencies);
const community = freq &&
communities.find(community => community.id === freq.communityId);
const linkPrefix = isEverything
? `/everything`
: `/${community.slug}/~${activeFrequency}`;
return (
<StoryCard
isActive={activeStory === story.id}
key={key}
link={`${linkPrefix}/${story.id}`}
media={story.content.media}
messages={story.messages ? Object.keys(story.messages).length : 0}
metaLink={isEverything && freq && `/${community.slug}/~${freq.slug}`}
metaText={isEverything && freq && `~${freq.name}`}
person={{
photo: story.creator.photoURL,
name: story.creator.displayName,
}}
timestamp={story.last_activity || story.timestamp}
title={story.content.title}
unreadMessages={unreadMessages}
isNew={isNew}
story={story}
participants={story.participants}
metadata={story.metadata ? story.metadata : null}
/>
);
>>>>>>>
const freq = getCurrentFrequency(story.frequencyId, frequencies);
const community = freq &&
communities.find(community => community.id === freq.communityId);
const linkPrefix = isEverything
? `/everything`
: `/${community.slug}/~${activeFrequency}`;
return (
<StoryCard
isActive={activeStory === story.id}
key={key}
link={`${linkPrefix}/${story.id}`}
media={story.content.media}
messages={story.messages ? Object.keys(story.messages).length : 0}
metaLink={isEverything && freq && `/${community.slug}/~${freq.slug}`}
metaText={isEverything && freq && `~${freq.name}`}
person={{
photo: story.creator.photoURL,
name: story.creator.displayName,
}}
timestamp={story.last_activity || story.timestamp}
title={story.content.title}
unreadMessages={unreadMessages}
isNew={isNew}
story={story}
participants={story.participants}
metadata={story.metadata ? story.metadata : null}
/>
);
<<<<<<<
=======
communities: { active },
// allStories,
>>>>>>>
communities: { active },
<<<<<<<
const isEverything = activeFrequency === 'everything';
const isNotifications = activeFrequency === 'notifications';
const isMessages = activeFrequency === 'messages';
=======
const isEverything = active === 'everything';
const isNotifications = active === 'notifications';
>>>>>>>
const isEverything = active === 'everything';
const isNotifications = active === 'notifications';
const isMessages = active === 'messages';
<<<<<<<
messageComposer: state.messageComposer,
=======
communities: state.communities,
>>>>>>>
messageComposer: state.messageComposer,
communities: state.communities, |
<<<<<<<
classicTheme: boolean,
};
=======
|};
>>>>>>>
classicTheme: boolean,
|}; |
<<<<<<<
display: flex;
flex-direction: row;
=======
display: ${props => props.visible ? 'flex' : 'none'};
flex-direction: row-reverse;
>>>>>>>
flex-direction: row;
display: ${props => props.visible ? 'flex' : 'none'}; |
<<<<<<<
import idx from 'idx';
=======
import queryString from 'query-string';
>>>>>>>
import queryString from 'query-string';
import idx from 'idx';
<<<<<<<
import type { ThreadInfoType } from 'shared/graphql/fragments/thread/threadInfo';
import ChatMessages from '../../../components/messageGroup';
import { LoadingChat } from '../../../components/loading';
import { Button } from '../../../components/buttons';
import Icon from '../../../components/icons';
import { NullState } from '../../../components/upsell';
import viewNetworkHandler from '../../../components/viewNetworkHandler';
import Head from '../../../components/head';
import NextPageButton from '../../../components/nextPageButton';
import {
ChatWrapper,
NullMessagesWrapper,
NullCopy,
EmptyThreadHeading,
EmptyThreadDescription,
SocialShareWrapper,
A,
} from '../style';
=======
import ChatMessages from 'src/components/messageGroup';
import { Loading } from 'src/components/loading';
import { Button } from 'src/components/buttons';
import Icon from 'src/components/icons';
import { NullState } from 'src/components/upsell';
import viewNetworkHandler from 'src/components/viewNetworkHandler';
import Head from 'src/components/head';
import NextPageButton from 'src/components/nextPageButton';
import { ChatWrapper, NullMessagesWrapper, NullCopy } from '../style';
>>>>>>>
import type { ThreadInfoType } from 'shared/graphql/fragments/thread/threadInfo';
import ChatMessages from '../../../components/messageGroup';
import { Loading } from '../../../components/loading';
import { Button } from '../../../components/buttons';
import Icon from '../../../components/icons';
import { NullState } from '../../../components/upsell';
import viewNetworkHandler from '../../../components/viewNetworkHandler';
import Head from '../../../components/head';
import NextPageButton from '../../../components/nextPageButton';
import {
ChatWrapper,
NullMessagesWrapper,
NullCopy,
EmptyThreadHeading,
EmptyThreadDescription,
SocialShareWrapper,
A,
} from '../style';
<<<<<<<
data: {
thread: ThreadInfoType,
},
=======
data: { thread: GetThreadMessageConnectionType },
thread: GetThreadType,
currentUser: ?Object,
>>>>>>>
data: { thread: GetThreadMessageConnectionType },
thread: GetThreadType,
currentUser: ?Object,
<<<<<<<
if (threadIsLocked) return null;
return this.getIsAuthor()
? this.getAuthorEmptyMessage()
: this.getNonAuthorEmptyMessage();
=======
if (isLocked) return null;
return (
<NullMessagesWrapper>
<Icon glyph={'emoji'} size={64} />
<NullCopy>
No messages have been sent in this conversation yet - why don’t you
kick things off below?
</NullCopy>
</NullMessagesWrapper>
);
>>>>>>>
if (isLocked) return null;
return this.getIsAuthor()
? this.getAuthorEmptyMessage()
: this.getNonAuthorEmptyMessage(); |
<<<<<<<
padding: 8px 0;
=======
max-width: 11vw;
overflow: hidden;
>>>>>>>
padding: 8px 0;
overflow: hidden; |
<<<<<<<
import { subscribeToNewMessages } from '../../subscriptions';
=======
import { btoa } from 'abab';
import { subscribeToNewMessages } from 'shared/graphql/subscriptions';
>>>>>>>
import { btoa } from 'abab';
import { subscribeToNewMessages } from '../../subscriptions'; |
<<<<<<<
require('css.escape');
=======
// This needs to be imported before everything else
import './helpers/consolidate-streamed-styles';
>>>>>>>
// This needs to be imported before everything else
import './helpers/consolidate-streamed-styles';
require('css.escape'); |
<<<<<<<
cy.get('[data-cy="navbar-splash-apps"]').should('be.visible');
cy.get('[data-cy="navbar-splash-pricing"]').should('be.visible');
=======
>>>>>>>
cy.get('[data-cy="navbar-splash-apps"]').should('be.visible'); |
<<<<<<<
import * as events from 'shared/analytics/event-types';
import { track } from 'src/helpers/events';
=======
import { isViewingMarketingPage } from 'src/helpers/is-viewing-marketing-page';
>>>>>>>
import * as events from 'shared/analytics/event-types';
import { track } from 'src/helpers/events';
import { isViewingMarketingPage } from 'src/helpers/is-viewing-marketing-page'; |
<<<<<<<
{
id: 'ce2b4488-4c75-47e0-8ebc-2539c1e6a193',
communityId: 'ce2b4488-4c75-47e0-8ebc-2539c1e6a191',
createdAt: new Date(DATE),
name: 'Private',
description: 'Private chatter',
slug: 'private',
isPrivate: true,
isDefault: false,
},
=======
{
id: 'ce2b4488-4c75-47e0-8ebc-2539c1e6a193',
communityId: 'ce2b4488-4c75-47e0-8ebc-2539c1e6a192',
createdAt: new Date(DATE),
name: 'General',
description: 'General chatter',
slug: 'general',
isPrivate: false,
isDefault: true,
},
>>>>>>>
{
id: 'ce2b4488-4c75-47e0-8ebc-2539c1e6a193',
communityId: 'ce2b4488-4c75-47e0-8ebc-2539c1e6a191',
createdAt: new Date(DATE),
name: 'Private',
description: 'Private chatter',
slug: 'private',
isPrivate: true,
isDefault: false,
},
{
id: 'ce2b4488-4c75-47e0-8ebc-2539c1e6a193',
communityId: 'ce2b4488-4c75-47e0-8ebc-2539c1e6a192',
createdAt: new Date(DATE),
name: 'General',
description: 'General chatter',
slug: 'general',
isPrivate: false,
isDefault: true,
}, |
<<<<<<<
// @flow
import { graphql, gql } from 'react-apollo';
import { subscribeToNewMessages } from 'shared/graphql/subscriptions';
import messageInfoFragment from 'shared/graphql/fragments/message/messageInfo';
import directMessageThreadInfoFragment from 'shared/graphql/fragments/directMessageThread/directMessageThreadInfo';
=======
import gql from 'graphql-tag';
// $FlowFixMe
import { graphql } from 'react-apollo';
import { subscribeToNewMessages } from '../../api/subscriptions';
import { messageInfoFragment } from '../../api/fragments/message/messageInfo';
import { directMessageThreadInfoFragment } from '../../api/fragments/directMessageThread/directMessageThreadInfo';
>>>>>>>
// @flow
import gql from 'graphql-tag';
import { graphql } from 'react-apollo';
import { subscribeToNewMessages } from 'shared/graphql/subscriptions';
import messageInfoFragment from 'shared/graphql/fragments/message/messageInfo';
import directMessageThreadInfoFragment from 'shared/graphql/fragments/directMessageThread/directMessageThreadInfo'; |
<<<<<<<
import updateAdministratorEmail from './updateAdministratorEmail';
import addPaymentSource from './addPaymentSource';
import removePaymentSource from './removePaymentSource';
import makePaymentSourceDefault from './makePaymentSourceDefault';
import cancelSubscription from './cancelSubscription';
import enableCommunityAnalytics from './enableCommunityAnalytics';
import disableCommunityAnalytics from './disableCommunityAnalytics';
=======
import enableBrandedLogin from './enableBrandedLogin';
import disableBrandedLogin from './disableBrandedLogin';
import saveBrandedLoginSettings from './saveBrandedLoginSettings';
>>>>>>>
import updateAdministratorEmail from './updateAdministratorEmail';
import addPaymentSource from './addPaymentSource';
import removePaymentSource from './removePaymentSource';
import makePaymentSourceDefault from './makePaymentSourceDefault';
import cancelSubscription from './cancelSubscription';
import enableCommunityAnalytics from './enableCommunityAnalytics';
import disableCommunityAnalytics from './disableCommunityAnalytics';
import enableBrandedLogin from './enableBrandedLogin';
import disableBrandedLogin from './disableBrandedLogin';
import saveBrandedLoginSettings from './saveBrandedLoginSettings';
<<<<<<<
updateAdministratorEmail,
addPaymentSource,
removePaymentSource,
makePaymentSourceDefault,
cancelSubscription,
enableCommunityAnalytics,
disableCommunityAnalytics,
=======
enableBrandedLogin,
disableBrandedLogin,
saveBrandedLoginSettings,
>>>>>>>
updateAdministratorEmail,
addPaymentSource,
removePaymentSource,
makePaymentSourceDefault,
cancelSubscription,
enableCommunityAnalytics,
disableCommunityAnalytics,
enableBrandedLogin,
disableBrandedLogin,
saveBrandedLoginSettings, |
<<<<<<<
import UpgradeAnalyticsModal from './UpgradeAnalyticsModal';
import UpgradeModeratorSeatModal from './UpgradeModeratorSeatModal';
import RestoreChannelModal from './RestoreChannelModal';
=======
import ChatInputLoginModal from './ChatInputLoginModal';
>>>>>>>
import UpgradeAnalyticsModal from './UpgradeAnalyticsModal';
import UpgradeModeratorSeatModal from './UpgradeModeratorSeatModal';
import RestoreChannelModal from './RestoreChannelModal';
import ChatInputLoginModal from './ChatInputLoginModal';
<<<<<<<
UPGRADE_ANALYTICS_MODAL: UpgradeAnalyticsModal,
UPGRADE_MODERATOR_SEAT_MODAL: UpgradeModeratorSeatModal,
RESTORE_CHANNEL_MODAL: RestoreChannelModal,
=======
CHAT_INPUT_LOGIN_MODAL: ChatInputLoginModal,
>>>>>>>
UPGRADE_ANALYTICS_MODAL: UpgradeAnalyticsModal,
UPGRADE_MODERATOR_SEAT_MODAL: UpgradeModeratorSeatModal,
RESTORE_CHANNEL_MODAL: RestoreChannelModal,
CHAT_INPUT_LOGIN_MODAL: ChatInputLoginModal, |
<<<<<<<
import ScrollManager from 'src/components/scrollManager';
import Head from 'src/components/head';
import ModalRoot from 'src/components/modals/modalRoot';
import Gallery from 'src/components/gallery';
import Toasts from 'src/components/toasts';
import { Loading, LoadingScreen } from 'src/components/loading';
import Composer from 'src/components/composer';
import AuthViewHandler from 'src/views/authViewHandler';
import signedOutFallback from 'src/helpers/signed-out-fallback';
import PrivateChannelJoin from 'src/views/privateChannelJoin';
import PrivateCommunityJoin from 'src/views/privateCommunityJoin';
import ThreadSlider from 'src/views/threadSlider';
import Navbar from 'src/views/navbar';
import Status from 'src/views/status';
import Login from 'src/views/login';
import DirectMessages from 'src/views/directMessages';
import { FullscreenThreadView } from 'src/views/thread';
import ThirdPartyContext from 'src/components/thirdPartyContextSetting';
import { withCurrentUser } from 'src/components/withCurrentUser';
import type { GetUserType } from 'shared/graphql/queries/user/getUser';
=======
import ScrollManager from './components/scrollManager';
import Head from './components/head';
import ModalRoot from './components/modals/modalRoot';
import Gallery from './components/gallery';
import Toasts from './components/toasts';
import { Loading, LoadingScreen } from './components/loading';
import LoadingDashboard from './views/dashboard/components/dashboardLoading';
import Composer from './components/composer';
import AuthViewHandler from './views/authViewHandler';
import signedOutFallback from './helpers/signed-out-fallback';
import PrivateChannelJoin from './views/privateChannelJoin';
import PrivateCommunityJoin from './views/privateCommunityJoin';
import ThreadSlider from './views/threadSlider';
import Navbar from './views/navbar';
import Status from './views/status';
import Login from './views/login';
import DirectMessages from './views/directMessages';
import RedirectOldThreadRoute from './views/thread/redirect-old-route';
import { FullscreenThreadView } from './views/thread';
>>>>>>>
import ScrollManager from 'src/components/scrollManager';
import Head from 'src/components/head';
import ModalRoot from 'src/components/modals/modalRoot';
import Gallery from 'src/components/gallery';
import Toasts from 'src/components/toasts';
import { Loading, LoadingScreen } from 'src/components/loading';
import Composer from 'src/components/composer';
import AuthViewHandler from 'src/views/authViewHandler';
import signedOutFallback from 'src/helpers/signed-out-fallback';
import PrivateChannelJoin from 'src/views/privateChannelJoin';
import PrivateCommunityJoin from 'src/views/privateCommunityJoin';
import ThreadSlider from 'src/views/threadSlider';
import Navbar from 'src/views/navbar';
import Status from 'src/views/status';
import Login from 'src/views/login';
import DirectMessages from 'src/views/directMessages';
import { FullscreenThreadView } from 'src/views/thread';
import ThirdPartyContext from 'src/components/thirdPartyContextSetting';
import { withCurrentUser } from 'src/components/withCurrentUser';
import type { GetUserType } from 'shared/graphql/queries/user/getUser';
import LoadingDashboard from './views/dashboard/components/dashboardLoading';
import RedirectOldThreadRoute from './views/thread/redirect-old-route'; |
<<<<<<<
componentWillUnmount() {
this.unsubscribe();
}
subscribe = () => {
this.setState({
subscription: this.props.subscribeToNewNotifications(),
});
};
unsubscribe = () => {
const { subscription } = this.state;
if (subscription) {
// This unsubscribes the subscription
subscription();
}
};
markAllNotificationsSeen = () => {
const { allUnseenCount } = this.state;
if (allUnseenCount === 0) {
return null;
} else {
this.setState({
allUnseenCount: 0,
});
this.props
.markAllNotificationsSeen()
.then(({ data: { markAllNotificationsSeen } }) => {
// notifs were marked as seen
})
.catch(err => {
// error
});
}
};
markAllNotificationsRead = () => {
this.props
.markAllNotificationsRead()
.then(({ data: { markAllNotificationsRead } }) => {
// notifs were marked as read
})
.catch(err => {
// error
});
};
markDmNotificationsAsSeen = () => {
const { dmUnseenCount } = this.state;
if (dmUnseenCount === 0) {
return null;
} else {
this.setState({
dmUnseenCount: 0,
});
this.props
.markDirectMessageNotificationsSeen()
.then(({ data: { markAllUserDirectMessageNotificationsRead } }) => {
// notifs were marked as seen
})
.catch(err => {
// err
});
}
};
=======
componentWillUnmount() {
if (this.interval) {
clearInterval(this.interval);
}
}
logout = () => {
if (this.interval) {
clearInterval(this.interval);
}
logout();
};
>>>>>>>
componentWillUnmount() {
this.unsubscribe();
}
subscribe = () => {
this.setState({
subscription: this.props.subscribeToNewNotifications(),
});
};
unsubscribe = () => {
const { subscription } = this.state;
if (subscription) {
// This unsubscribes the subscription
subscription();
}
};
markAllNotificationsSeen = () => {
const { allUnseenCount } = this.state;
if (allUnseenCount === 0) {
return null;
} else {
this.setState({
allUnseenCount: 0,
});
this.props
.markAllNotificationsSeen()
.then(({ data: { markAllNotificationsSeen } }) => {
// notifs were marked as seen
})
.catch(err => {
// error
});
}
};
markAllNotificationsRead = () => {
this.props
.markAllNotificationsRead()
.then(({ data: { markAllNotificationsRead } }) => {
// notifs were marked as read
})
.catch(err => {
// error
});
};
markDmNotificationsAsSeen = () => {
const { dmUnseenCount } = this.state;
if (dmUnseenCount === 0) {
return null;
} else {
this.setState({
dmUnseenCount: 0,
});
this.props
.markDirectMessageNotificationsSeen()
.then(({ data: { markAllUserDirectMessageNotificationsRead } }) => {
// notifs were marked as seen
})
.catch(err => {
// err
});
}
if (this.interval) {
clearInterval(this.interval);
}
};
logout = () => {
if (this.interval) {
clearInterval(this.interval);
}
logout();
};
<<<<<<<
<ProfileDropdown user={currentUser} width={'200px'} />
=======
<ProfileDropdown logout={this.logout} user={currentUser} />
>>>>>>>
<ProfileDropdown logout={this.logout} user={currentUser} />
<<<<<<<
getNotificationsForNavbar,
markNotificationsSeenMutation,
markNotificationsReadMutation,
markDirectMessageNotificationsSeenMutation,
=======
setUserLastSeenMutation,
>>>>>>>
getNotificationsForNavbar,
markNotificationsSeenMutation,
markNotificationsReadMutation,
markDirectMessageNotificationsSeenMutation,
setUserLastSeenMutation, |
<<<<<<<
import MessagesTab from './components/messagesTab';
import NotificationsTab from './components/notificationsTab';
import Head from '../../components/head';
=======
import MessagesTab from './components/messagesTab';
import NotificationsTab from './components/notificationsTab';
>>>>>>>
import MessagesTab from './components/messagesTab';
import NotificationsTab from './components/notificationsTab';
import Head from '../../components/head';
<<<<<<<
type Props = {
isLoading: boolean,
hasError: boolean,
location: Object,
history: Object,
match: Object,
notificationCounts: {
notifications: number,
directMessageNotifications: number,
},
data: {
user?: Object,
},
currentUser?: Object,
activeInboxThread: ?string,
};
class Navbar extends React.Component<Props> {
shouldComponentUpdate(nextProps) {
const currProps = this.props;
=======
type Props = {
isLoading: boolean,
hasError: boolean,
location: Object,
history: Object,
match: Object,
data: {
user?: Object,
},
currentUser?: Object,
activeInboxThread: ?string,
};
class Navbar extends React.Component<Props> {
shouldComponentUpdate(nextProps) {
const currProps = this.props;
>>>>>>>
type Props = {
isLoading: boolean,
hasError: boolean,
location: Object,
history: Object,
match: Object,
notificationCounts: {
notifications: number,
directMessageNotifications: number,
},
data: {
user?: Object,
},
currentUser?: Object,
activeInboxThread: ?string,
};
class Navbar extends React.Component<Props> {
shouldComponentUpdate(nextProps) {
const currProps = this.props;
<<<<<<<
=======
// Fuck updating
console.log('scu falsing thisprops', this.props);
console.log('scu falsing nextprops', nextProps);
>>>>>>>
<<<<<<<
=======
console.log('navbar props', this.props);
console.log('navbar state', this.state);
>>>>>>>
<<<<<<<
const isHome =
history.location.pathname === '/' ||
history.location.pathname === '/home';
=======
const viewing = history.location.pathname;
const isHome = viewing === '/' || viewing === '/home';
const isSplash =
viewing === '/pricing' ||
viewing === '/about' ||
viewing === '/contact' ||
viewing === '/terms' ||
viewing === '/code-of-conduct';
>>>>>>>
const viewing = history.location.pathname;
const isHome = viewing === '/' || viewing === '/home';
const isSplash =
viewing === '/pricing' ||
viewing === '/about' ||
viewing === '/contact' ||
viewing === '/terms' ||
viewing === '/code-of-conduct';
<<<<<<<
if (!loggedInUser && isHome) return null;
=======
if ((!loggedInUser && isHome) || isSplash) return null;
>>>>>>>
if ((!loggedInUser && isHome) || isSplash) return null;
<<<<<<<
<Head>
{notificationCounts.directMessageNotifications > 0 ||
notificationCounts.notifications > 0 ? (
<link
rel="shortcut icon"
id="dynamic-favicon"
// $FlowIssue
href={`${process.env.PUBLIC_URL}/img/favicon_unread.ico`}
/>
) : (
<link
rel="shortcut icon"
id="dynamic-favicon"
// $FlowIssue
href={`${process.env.PUBLIC_URL}/img/favicon.ico`}
/>
)}
</Head>
<Section>
=======
<Section>
>>>>>>>
<Head>
{notificationCounts.directMessageNotifications > 0 ||
notificationCounts.notifications > 0 ? (
<link
rel="shortcut icon"
id="dynamic-favicon"
// $FlowIssue
href={`${process.env.PUBLIC_URL}/img/favicon_unread.ico`}
/>
) : (
<link
rel="shortcut icon"
id="dynamic-favicon"
// $FlowIssue
href={`${process.env.PUBLIC_URL}/img/favicon.ico`}
/>
)}
</Head>
<Section>
<<<<<<<
const mapStateToProps = state => ({
currentUser: state.users.currentUser,
notificationCounts: state.notifications,
});
=======
const mapStateToProps = state => ({ currentUser: state.users.currentUser });
>>>>>>>
const mapStateToProps = state => ({
currentUser: state.users.currentUser,
notificationCounts: state.notifications,
}); |
<<<<<<<
function setSegmentOverlapToleranceTime(value) {
segmentOverlapToleranceTime = value;
}
function getSegmentOverlapToleranceTime() {
return segmentOverlapToleranceTime;
}
=======
function setCacheLoadThresholdForType(type, value) {
cacheLoadThresholds[type] = value;
}
function getCacheLoadThresholdForType(type) {
return cacheLoadThresholds[type];
}
>>>>>>>
function setSegmentOverlapToleranceTime(value) {
segmentOverlapToleranceTime = value;
}
function getSegmentOverlapToleranceTime() {
return segmentOverlapToleranceTime;
}
function setCacheLoadThresholdForType(type, value) {
cacheLoadThresholds[type] = value;
}
function getCacheLoadThresholdForType(type) {
return cacheLoadThresholds[type];
}
<<<<<<<
setSegmentOverlapToleranceTime: setSegmentOverlapToleranceTime,
getSegmentOverlapToleranceTime: getSegmentOverlapToleranceTime,
=======
getCacheLoadThresholdForType: getCacheLoadThresholdForType,
setCacheLoadThresholdForType: setCacheLoadThresholdForType,
>>>>>>>
setSegmentOverlapToleranceTime: setSegmentOverlapToleranceTime,
getSegmentOverlapToleranceTime: getSegmentOverlapToleranceTime,
getCacheLoadThresholdForType: getCacheLoadThresholdForType,
setCacheLoadThresholdForType: setCacheLoadThresholdForType, |
<<<<<<<
appendingMediaChunk,
=======
isAppendingInProgress,
>>>>>>>
<<<<<<<
=======
function onAppended(e) {
let ranges = null;
if (buffer === e.buffer) {
if (e.error) {
if (e.error.code === SourceBufferController.QUOTA_EXCEEDED_ERROR_CODE) {
criticalBufferLevel = sourceBufferController.getTotalBufferedTime(buffer) * 0.8;
log('Quota exceeded for type: ' + type + ', Critical Buffer: ' + criticalBufferLevel);
if (criticalBufferLevel > 0) {
// recalculate buffer lengths to keep (bufferToKeep, bufferAheadToKeep, bufferTimeAtTopQuality) according to criticalBufferLevel
const bufferToKeep = Math.max(0.2 * criticalBufferLevel, 1);
const bufferAhead = criticalBufferLevel - bufferToKeep;
mediaPlayerModel.setBufferToKeep(parseFloat(bufferToKeep).toFixed(5));
mediaPlayerModel.setBufferAheadToKeep(parseFloat(bufferAhead).toFixed(5));
}
}
if (e.error.code === SourceBufferController.QUOTA_EXCEEDED_ERROR_CODE || !hasEnoughSpaceToAppend()) {
log('Clearing playback buffer to overcome quota exceed situation for type: ' + type);
eventBus.trigger(Events.QUOTA_EXCEEDED, { sender: instance, criticalBufferLevel: criticalBufferLevel }); //Tells ScheduleController to stop scheduling.
pruneAllSafely(); // Then we clear the buffer and onCleared event will tell ScheduleController to start scheduling again.
}
return;
}
if (appendedBytesInfo && !isNaN(appendedBytesInfo.index)) {
maxAppendedIndex = Math.max(appendedBytesInfo.index, maxAppendedIndex);
checkIfBufferingCompleted();
}
if (appendedBytesInfo.segmentType === HTTPRequest.MEDIA_SEGMENT_TYPE) {
ranges = sourceBufferController.getAllRanges(buffer);
showBufferRanges(ranges);
onPlaybackProgression();
} else {
if (bufferResetInProgress) {
const currentTime = playbackController.getTime();
log('[BufferController][', type,'] appendToBuffer seek target should be ' + currentTime);
streamProcessor.getScheduleController().setSeekTarget(currentTime);
adapter.setIndexHandlerTime(streamProcessor, currentTime);
}
}
log('[BufferController][', type,'] onAppended chunk type = ', appendedBytesInfo.segmentType, ' and index = ', appendedBytesInfo.index);
isAppendingInProgress = false;
if (appendedBytesInfo) {
eventBus.trigger(Events.BYTES_APPENDED, {
sender: instance,
quality: appendedBytesInfo.quality,
startTime: appendedBytesInfo.start,
index: appendedBytesInfo.index,
bufferedRanges: ranges
});
}
}
}
>>>>>>>
function onAppended(e) {
if (e.error) {
if (e.error.code === QUOTA_EXCEEDED_ERROR_CODE) {
criticalBufferLevel = getTotalBufferedTime() * 0.8;
log('Quota exceeded for type: ' + type + ', Critical Buffer: ' + criticalBufferLevel);
if (criticalBufferLevel > 0) {
// recalculate buffer lengths to keep (bufferToKeep, bufferAheadToKeep, bufferTimeAtTopQuality) according to criticalBufferLevel
const bufferToKeep = Math.max(0.2 * criticalBufferLevel, 1);
const bufferAhead = criticalBufferLevel - bufferToKeep;
mediaPlayerModel.setBufferToKeep(parseFloat(bufferToKeep).toFixed(5));
mediaPlayerModel.setBufferAheadToKeep(parseFloat(bufferAhead).toFixed(5));
}
}
if (e.error.code === QUOTA_EXCEEDED_ERROR_CODE || !hasEnoughSpaceToAppend()) {
log('Clearing playback buffer to overcome quota exceed situation for type: ' + type);
eventBus.trigger(Events.QUOTA_EXCEEDED, { sender: instance, criticalBufferLevel: criticalBufferLevel }); //Tells ScheduleController to stop scheduling.
pruneAllSafely(); // Then we clear the buffer and onCleared event will tell ScheduleController to start scheduling again.
}
return;
}
appendedBytesInfo = e.chunk;
if (appendedBytesInfo && !isNaN(appendedBytesInfo.index)) {
maxAppendedIndex = Math.max(appendedBytesInfo.index, maxAppendedIndex);
checkIfBufferingCompleted();
}
const ranges = buffer.getAllBufferRanges();
if (appendedBytesInfo.segmentType === HTTPRequest.MEDIA_SEGMENT_TYPE) {
showBufferRanges(ranges);
onPlaybackProgression();
} else {
if (bufferResetInProgress) {
const currentTime = playbackController.getTime();
log('[BufferController][', type,'] appendToBuffer seek target should be ' + currentTime);
streamProcessor.getScheduleController().setSeekTarget(currentTime);
adapter.setIndexHandlerTime(streamProcessor, currentTime);
}
}
log('[BufferController][', type,'] onAppended chunk type = ', appendedBytesInfo.segmentType, ' and index = ', appendedBytesInfo.index);
if (appendedBytesInfo) {
eventBus.trigger(Events.BYTES_APPENDED, {
sender: instance,
quality: appendedBytesInfo.quality,
startTime: appendedBytesInfo.start,
index: appendedBytesInfo.index,
bufferedRanges: ranges
});
}
}
<<<<<<<
if (buffer) {
if (!errored) {
buffer.abort();
}
buffer.reset();
buffer = null;
}
=======
bufferResetInProgress = false;
>>>>>>>
if (buffer) {
if (!errored) {
buffer.abort();
}
buffer.reset();
buffer = null;
}
bufferResetInProgress = false; |
<<<<<<<
smallGapLimit,
lowLatencyEnabled;
=======
smallGapLimit,
manifestUpdateRetryInterval;
>>>>>>>
smallGapLimit,
lowLatencyEnabled,
manifestUpdateRetryInterval;
<<<<<<<
function getLowLatencyEnabled() {
return lowLatencyEnabled;
}
function setLowLatencyEnabled(value) {
lowLatencyEnabled = value;
}
=======
function setManifestUpdateRetryInterval(value) {
manifestUpdateRetryInterval = value;
}
function getManifestUpdateRetryInterval() {
return manifestUpdateRetryInterval;
}
>>>>>>>
function getLowLatencyEnabled() {
return lowLatencyEnabled;
}
function setLowLatencyEnabled(value) {
lowLatencyEnabled = value;
}
function setManifestUpdateRetryInterval(value) {
manifestUpdateRetryInterval = value;
}
function getManifestUpdateRetryInterval() {
return manifestUpdateRetryInterval;
}
<<<<<<<
getLowLatencyEnabled: getLowLatencyEnabled,
setLowLatencyEnabled: setLowLatencyEnabled,
=======
setManifestUpdateRetryInterval: setManifestUpdateRetryInterval,
getManifestUpdateRetryInterval: getManifestUpdateRetryInterval,
>>>>>>>
getLowLatencyEnabled: getLowLatencyEnabled,
setLowLatencyEnabled: setLowLatencyEnabled,
setManifestUpdateRetryInterval: setManifestUpdateRetryInterval,
getManifestUpdateRetryInterval: getManifestUpdateRetryInterval, |
<<<<<<<
import classnames from 'classnames';
import Footer from '../footer/Footer';
=======
import classNames from 'classnames';
>>>>>>>
import classnames from 'classnames';
// import Footer from '../footer/Footer';
<<<<<<<
banner?: Node,
isTopBarVisible?: boolean,
isBannerVisible?: boolean,
languageSelectionBackground?: boolean,
withFooter? : boolean,
oldTheme?: boolean
=======
banner?: Node,
footer?: Node,
>>>>>>>
banner?: Node,
isTopBarVisible?: boolean,
isBannerVisible?: boolean,
languageSelectionBackground?: boolean,
withFooter? : boolean,
oldTheme?: boolean,
footer?: Node,
<<<<<<<
banner: undefined,
isTopBarVisible: true,
isBannerVisible: true,
languageSelectionBackground: false,
withFooter: false,
oldTheme: false
=======
banner: undefined,
footer: undefined,
>>>>>>>
banner: undefined,
isTopBarVisible: true,
isBannerVisible: true,
languageSelectionBackground: false,
withFooter: false,
oldTheme: false,
footer: undefined,
<<<<<<<
const {
banner,
children,
topbar,
notification,
isTopBarVisible,
isBannerVisible,
languageSelectionBackground,
withFooter,
oldTheme
} = this.props;
const componentClasses = classnames([
styles.component,
languageSelectionBackground && !oldTheme ? styles.languageSelectionBackground : '',
]);
const topbarClasses = classnames([
oldTheme ? styles.topbarOld : styles.topbar,
]);
const contentClasses = classnames([
styles.content,
withFooter ? styles.contentFooter : ''
]);
=======
const {
banner,
children,
topbar,
notification,
footer
} = this.props;
const contentStyle = classNames([
styles.content,
(footer) ? styles.contentWithFooter : null,
]);
>>>>>>>
const {
banner,
children,
topbar,
notification,
isTopBarVisible,
isBannerVisible,
languageSelectionBackground,
withFooter,
footer,
oldTheme
} = this.props;
const componentClasses = classnames([
styles.component,
languageSelectionBackground && !oldTheme ? styles.languageSelectionBackground : '',
]);
const topbarClasses = classnames([
oldTheme ? styles.topbarOld : styles.topbar,
]);
const contentClasses = classnames([
styles.content,
withFooter ? styles.contentFooter : null,
footer ? styles.contentWithFooter : null,
]);
<<<<<<<
<div className={contentClasses}>
=======
<div className={contentStyle}>
>>>>>>>
<div className={contentClasses}>
<<<<<<<
{withFooter && <Footer />}
=======
{footer &&
<div className={styles.footer}>
{footer}
</div>}
>>>>>>>
{/* {withFooter && <Footer />} */}
{footer &&
<div className={styles.footer}>
{footer}
</div>} |
<<<<<<<
eventBus.off(Events.BYTES_APPENDED_END_FRAGMENT, onBytesAppended, this);
=======
eventBus.off(Events.BYTES_APPENDED, onBytesAppended, this);
eventBus.off(Events.PERIOD_SWITCH_STARTED, onPeriodSwitchStarted, this);
>>>>>>>
eventBus.off(Events.BYTES_APPENDED_END_FRAGMENT, onBytesAppended, this);
eventBus.off(Events.PERIOD_SWITCH_STARTED, onPeriodSwitchStarted, this); |
<<<<<<<
=======
* @deprecated since version 2.6.0.
* ABR rules now switch from Throughput to Buffer Occupancy mode when there is sufficient buffer.
* This renders the rich buffer mechanism redundant.
*
* @param {number} value
* @memberof module:MediaPlayer
* @instance
*/
function setRichBufferThreshold(value) {
throw new Error('Calling obsolete function - setRichBufferThreshold(' + value + ') has no effect.');
}
/**
* For a given media type, the threshold which defines if the response to a fragment
* request is coming from browser cache or not.
* Valid media types are "video", "audio"
*
* @default 50 milliseconds for video fragment requests; 5 milliseconds for audio fragment requests.
* @param {string} type 'video' or 'audio' are the type options.
* @param {number} value Threshold value in milliseconds.
* @memberof module:MediaPlayer
* @instance
*/
function setCacheLoadThresholdForType(type, value) {
mediaPlayerModel.setCacheLoadThresholdForType(type, value);
}
/**
>>>>>>>
* For a given media type, the threshold which defines if the response to a fragment
* request is coming from browser cache or not.
* Valid media types are "video", "audio"
*
* @default 50 milliseconds for video fragment requests; 5 milliseconds for audio fragment requests.
* @param {string} type 'video' or 'audio' are the type options.
* @param {number} value Threshold value in milliseconds.
* @memberof module:MediaPlayer
* @instance
*/
function setCacheLoadThresholdForType(type, value) {
mediaPlayerModel.setCacheLoadThresholdForType(type, value);
}
/**
<<<<<<<
=======
setRichBufferThreshold: setRichBufferThreshold,
setCacheLoadThresholdForType: setCacheLoadThresholdForType,
>>>>>>>
setCacheLoadThresholdForType: setCacheLoadThresholdForType, |
<<<<<<<
const timelineConverter = config.timelineConverter;
=======
config = config || {};
let timelineConverter = config.timelineConverter;
>>>>>>>
config = config || {};
const timelineConverter = config.timelineConverter; |
<<<<<<<
it('should configure setSegmentOverlapToleranceTime', function () {
let val = mediaPlayerModel.getSegmentOverlapToleranceTime();
expect(val).to.equal(0.05);
player.setSegmentOverlapToleranceTime(1.5);
val = mediaPlayerModel.getSegmentOverlapToleranceTime();
expect(val).to.equal(1.5);
});
=======
it('should configure cacheLoadThresholds', function () {
let cacheLoadThresholdForVideo = mediaPlayerModel.getCacheLoadThresholdForType(Constants.VIDEO);
expect(cacheLoadThresholdForVideo).to.equal(50);
player.setCacheLoadThresholdForType(Constants.VIDEO, 10);
cacheLoadThresholdForVideo = mediaPlayerModel.getCacheLoadThresholdForType(Constants.VIDEO);
expect(cacheLoadThresholdForVideo).to.equal(10);
let cacheLoadThresholdForAudio = mediaPlayerModel.getCacheLoadThresholdForType(Constants.AUDIO);
expect(cacheLoadThresholdForAudio).to.equal(5);
player.setCacheLoadThresholdForType(Constants.AUDIO, 2);
cacheLoadThresholdForAudio = mediaPlayerModel.getCacheLoadThresholdForType(Constants.AUDIO);
expect(cacheLoadThresholdForAudio).to.equal(2);
});
>>>>>>>
it('should configure setSegmentOverlapToleranceTime', function () {
let val = mediaPlayerModel.getSegmentOverlapToleranceTime();
expect(val).to.equal(0.05);
player.setSegmentOverlapToleranceTime(1.5);
val = mediaPlayerModel.getSegmentOverlapToleranceTime();
expect(val).to.equal(1.5);
});
it('should configure cacheLoadThresholds', function () {
let cacheLoadThresholdForVideo = mediaPlayerModel.getCacheLoadThresholdForType(Constants.VIDEO);
expect(cacheLoadThresholdForVideo).to.equal(50);
player.setCacheLoadThresholdForType(Constants.VIDEO, 10);
cacheLoadThresholdForVideo = mediaPlayerModel.getCacheLoadThresholdForType(Constants.VIDEO);
expect(cacheLoadThresholdForVideo).to.equal(10);
let cacheLoadThresholdForAudio = mediaPlayerModel.getCacheLoadThresholdForType(Constants.AUDIO);
expect(cacheLoadThresholdForAudio).to.equal(5);
player.setCacheLoadThresholdForType(Constants.AUDIO, 2);
cacheLoadThresholdForAudio = mediaPlayerModel.getCacheLoadThresholdForType(Constants.AUDIO);
expect(cacheLoadThresholdForAudio).to.equal(2);
}); |
<<<<<<<
const settings = Settings(context).getInstance();
const bufferLevelRule = BufferLevelRule(context).create({
textController: textControllerMock,
dashMetrics: new DashMetricsMock(),
metricsModel: new MetricsModelMock(),
abrController: new AbrControllerMock(),
mediaPlayerModel: new MediaPlayerModelMock(),
settings: settings
});
=======
const bufferLevelRule = BufferLevelRule(context).create({textController: textControllerMock,
dashMetrics: new DashMetricsMock(),
abrController: new AbrControllerMock(),
mediaPlayerModel: new MediaPlayerModelMock()});
>>>>>>>
const settings = Settings(context).getInstance();
const bufferLevelRule = BufferLevelRule(context).create({
textController: textControllerMock,
dashMetrics: new DashMetricsMock(),
abrController: new AbrControllerMock(),
mediaPlayerModel: new MediaPlayerModelMock(),
settings: settings
}); |
<<<<<<<
=======
let trackType = 'audio';
>>>>>>> |
<<<<<<<
// Sync executed queue with buffer range (to check for silent purge)
const bufferedRanges = sourceBufferController.getAllRanges(buffer);
const streamDuration = streamProcessor.getStreamInfo().duration;
streamProcessor.getFragmentModel().syncExecutedRequestsWithBufferedRange(bufferedRanges, streamDuration);
// Then, check if this request was downloaded or not
while ( streamProcessor.getFragmentModel().isFragmentLoaded(request)) {
=======
while (request && request.action !== FragmentRequest.ACTION_COMPLETE && streamProcessor.getFragmentModel().isFragmentLoaded(request)) {
>>>>>>>
// Sync executed queue with buffer range (to check for silent purge)
const bufferedRanges = sourceBufferController.getAllRanges(buffer);
const streamDuration = streamProcessor.getStreamInfo().duration;
streamProcessor.getFragmentModel().syncExecutedRequestsWithBufferedRange(bufferedRanges, streamDuration);
// Then, check if this request was downloaded or not
while (request && request.action !== FragmentRequest.ACTION_COMPLETE && streamProcessor.getFragmentModel().isFragmentLoaded(request)) { |
<<<<<<<
function getMaxIndex(rulesContext) {
let streamProcessor = rulesContext.getStreamProcessor();
=======
function onMediaFragmentLoaded(e) {
if (e && e.chunk && e.chunk.mediaInfo) {
let type = e.chunk.mediaInfo.type;
let start = e.chunk.start;
if (type !== undefined && !isNaN(start)) {
if (start <= lastFragmentLoadedDict[type]) {
lastFragmentWasSwitchDict[type] = true;
// keep lastFragmentLoadedDict[type] e.g. last fragment start 10, switch fragment 8, last is still 10
} else {
// isNaN(lastFragmentLoadedDict[type]) also falls here
lastFragmentWasSwitchDict[type] = false;
lastFragmentLoadedDict[type] = start;
}
}
}
}
function execute(rulesContext, callback) {
const streamProcessor = rulesContext.getStreamProcessor();
>>>>>>>
function onMediaFragmentLoaded(e) {
if (e && e.chunk && e.chunk.mediaInfo) {
let type = e.chunk.mediaInfo.type;
let start = e.chunk.start;
if (type !== undefined && !isNaN(start)) {
if (start <= lastFragmentLoadedDict[type]) {
lastFragmentWasSwitchDict[type] = true;
// keep lastFragmentLoadedDict[type] e.g. last fragment start 10, switch fragment 8, last is still 10
} else {
// isNaN(lastFragmentLoadedDict[type]) also falls here
lastFragmentWasSwitchDict[type] = false;
lastFragmentLoadedDict[type] = start;
}
}
}
}
function getMaxIndex(rulesContext) {
const streamProcessor = rulesContext.getStreamProcessor(); |
<<<<<<<
if (!currentRepresentationInfo) return;
=======
>>>>>>>
if (!currentRepresentationInfo) return;
<<<<<<<
function onPlaybackStarted() {
if (isStopped || !scheduleWhilePaused) {
start();
}
}
=======
>>>>>>>
function onPlaybackStarted() {
if (isStopped || !scheduleWhilePaused) {
start();
}
}
<<<<<<<
eventBus.off(Events.PLAYBACK_STARTED, onPlaybackStarted, this);
=======
>>>>>>>
eventBus.off(Events.PLAYBACK_STARTED, onPlaybackStarted, this); |
<<<<<<<
if (bufferController) {
const range = bufferController.getRangeAt(time);
if (range !== null) {
=======
if (buffer) {
const range = sourceBufferController.getBufferRange(buffer, time);
if (range !== null && !hasSeekTarget) {
>>>>>>>
if (bufferController) {
const range = bufferController.getRangeAt(time);
if (range !== null && !hasSeekTarget) { |
<<<<<<<
if (player.isPaused()) {
setPlayBtn();
} else {
setPauseBtn();
}
},
setPlayBtn = function () {
var span = document.getElementById('iconPlayPause');
if (span !== null) {
span.classList.remove('icon-pause');
span.classList.add('icon-play');
}
},
setPauseBtn = function () {
var span = document.getElementById('iconPlayPause');
if (span !== null) {
span.classList.remove('icon-play');
span.classList.add('icon-pause');
=======
var span = document.getElementById(getControlId('iconPlayPause'));
if(span !== null) {
if (player.isPaused()) {
span.classList.remove('icon-pause');
span.classList.add('icon-play');
} else {
span.classList.remove('icon-play');
span.classList.add('icon-pause');
}
>>>>>>>
if (player.isPaused()) {
setPlayBtn();
} else {
setPauseBtn();
}
},
setPlayBtn = function () {
var span = document.getElementById(getControlId('iconPlayPause'));
if (span !== null) {
span.classList.remove('icon-pause');
span.classList.add('icon-play');
}
},
setPauseBtn = function () {
var span = document.getElementById(getControlId('iconPlayPause'));
if (span !== null) {
span.classList.remove('icon-play');
span.classList.add('icon-pause'); |
<<<<<<<
function postponeUpdate(postponeTimePeriod) {
var delay = postponeTimePeriod;
=======
function resetAvailabilityWindow() {
availableRepresentations.forEach(rep => {
rep.segmentAvailabilityRange = null;
});
}
function postponeUpdate(availabilityDelay) {
var delay = (availabilityDelay + (currentRepresentation.segmentDuration * mediaPlayerModel.getLiveDelayFragmentCount())) * 1000;
>>>>>>>
function resetAvailabilityWindow() {
availableRepresentations.forEach(rep => {
rep.segmentAvailabilityRange = null;
});
}
function postponeUpdate(postponeTimePeriod) {
var delay = postponeTimePeriod; |
<<<<<<<
if (!metrics || !bufferStateVO || useBufferOccupancyABR) {
=======
if (!metrics || isNaN(throughput) || !bufferStateVO || hasRichBuffer) {
>>>>>>>
if (!metrics || isNaN(throughput) || !bufferStateVO || useBufferOccupancyABR) { |
<<<<<<<
compatibleWithPreviousStream,
isLowLatencySeekingInProgress,
playbackStalled,
minPlaybackRateChange;
=======
compatibleWithPreviousStream,
uriFragmentModel;
let catchUpPlaybackRate = DEFAULT_CATCHUP_PLAYBACK_RATE;
>>>>>>>
compatibleWithPreviousStream,
isLowLatencySeekingInProgress,
playbackStalled,
minPlaybackRateChange,
uriFragmentModel;
<<<<<<<
if (config.timelineConverter) {
timelineConverter = config.timelineConverter;
}
=======
if (config.uriFragmentModel) {
uriFragmentModel = config.uriFragmentModel;
}
>>>>>>>
if (config.timelineConverter) {
timelineConverter = config.timelineConverter;
}
if (config.uriFragmentModel) {
uriFragmentModel = config.uriFragmentModel;
} |
<<<<<<<
ko.bindingHandlers.typeahead = {
update: function(element, valueAccessor) {
var value = ko.utils.unwrapObservable(valueAccessor());
$(element).typeahead({source: value});
}
};
=======
ko.bindingHandlers.fadeIn = {
init: function(element, valueAccessor, allBindingsAccessor, vm) {
var postbox = vm.postbox || allBindingsAccessor().postbox;
if (!postbox) throw new Error("viewmodel must have a postbox to use select");
var eventName = valueAccessor();
postbox.subscribe(function(value) {
if (value === vm) {
$(element).css('opacity', 0).animate({'opacity': 1}, 500);
}
}, vm, eventName);
}
};
>>>>>>>
ko.bindingHandlers.typeahead = {
update: function(element, valueAccessor) {
var value = ko.utils.unwrapObservable(valueAccessor());
$(element).typeahead({source: value});
}
};
ko.bindingHandlers.fadeIn = {
init: function(element, valueAccessor, allBindingsAccessor, vm) {
var postbox = vm.postbox || allBindingsAccessor().postbox;
if (!postbox) throw new Error("viewmodel must have a postbox to use select");
var eventName = valueAccessor();
postbox.subscribe(function(value) {
if (value === vm) {
$(element).css('opacity', 0).animate({'opacity': 1}, 500);
}
}, vm, eventName);
}
}; |
<<<<<<<
import daedalusTransferIcon from '../assets/images/sidebar/daedalus-transfer-white.inline.svg';
=======
import settingsIcon from '../assets/images/sidebar/settings-ic.inline.svg';
>>>>>>>
import settingsIcon from '../assets/images/sidebar/settings-ic.inline.svg';
import daedalusTransferIcon from '../assets/images/sidebar/daedalus-transfer-white.inline.svg';
<<<<<<<
},
{
name: 'DAEDALUS_TRANSFER',
route: ROUTES.DAEDALUS_TRANFER.ROOT,
icon: daedalusTransferIcon,
}
=======
},
{
name: 'SETTINGS',
route: ROUTES.SETTINGS.ROOT,
icon: settingsIcon,
},
>>>>>>>
},
{
name: 'SETTINGS',
route: ROUTES.SETTINGS.ROOT,
icon: settingsIcon,
},
{
name: 'DAEDALUS_TRANSFER',
route: ROUTES.DAEDALUS_TRANFER.ROOT,
icon: daedalusTransferIcon,
} |
<<<<<<<
=======
.alias('r', 'reporter')
.default('r', 'console')
.describe('r', 'reporter module [console, json, html, coverage, threshold, spec]')
.alias('t', 'threshold')
.default('t', 100)
.describe('t', 'code coverage threshold in percentage')
.alias('m', 'timeout')
.default('m', 2000)
.describe('m', 'timeout for each test in milliseconds')
>>>>>>>
<<<<<<<
if (['json', 'html', 'coverage', 'threshold'].indexOf(argv.r) !== -1) {
Coverage.instrument();
=======
if (['json', 'html', 'coverage', 'threshold', 'spec'].indexOf(argv.r) !== -1) {
var currentDir = process.cwd().replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
var filterPattern = '^' + currentDir + '\\/((?!node_modules|test).).*$';
var blanketOptions = {
pattern: new RegExp(filterPattern, 'i'),
onlyCwd: true,
branchTracking: true
};
var blanket = require('blanket')(blanketOptions);
>>>>>>>
if (['json', 'html', 'coverage', 'threshold'].indexOf(argv.r) !== -1) {
Coverage.instrument(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.