conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
return self.config.enablePredictorMl ? self.mlPredictor.predict(cb) : setImmediate(cb);
=======
if (!self.config.enablePredictorMl || !self.mlPredictor.ready) return setImmediate(cb);
self.mlPredictor.predict(function(err, data) {
if (!err && data) {
self.listener.write({ type: "ml", data });
} else {
log.warn("skip ml result because err=" + err + " data=" + JSON.stringify(data));
}
cb(err);
});
>>>>>>>
if (!self.config.enablePredictorMl || !self.mlPredictor.ready) return setImmediate(cb);
self.mlPredictor.predict(function(err, data) {
if (!err && data) {
self.listener.write({ type: "ml", data });
} else {
log.warn("skip ml result because err=" + err + " data=" + JSON.stringify(data));
}
cb(err);
});
<<<<<<<
await this.mlPredictor.load();
}
=======
if (!this.mlPredictor) {
this.mlPredictor = new MlPredictor({
country: this.country,
name: this.name,
});
} else if (this.mlPredictor.ready2) {
this.decoder.stdout.unpipe(this.mlPredictor);
}
>>>>>>>
await this.mlPredictor.load();
<<<<<<<
});*/
if (!this.config.enablePredictorMl && this.mlPredictor) {
this.decoder.stdout.unpipe(this.mlPredictor);
this.mlPredictor.unpipe(this.listener);
this.mlPredictor.destroy();
this.mlPredictor = null;
=======
});
} else {
if (this.mlPredictor) {
if (this.mlPredictor.ready2) this.decoder.stdout.unpipe(this.mlPredictor);
this.mlPredictor.destroy();
this.mlPredictor = null;
}
>>>>>>>
*/
} else {
if (this.mlPredictor) {
if (this.mlPredictor.ready2) this.decoder.stdout.unpipe(this.mlPredictor);
this.mlPredictor.destroy();
this.mlPredictor = null;
} |
<<<<<<<
this.setUpInitialConnection();
=======
// creates func to clear client connection when it disconnects
this._createIceDisconnHandler = (connName) => () => {
// have variable
// close client's RTC Peer Connection
console.log('ICE disconnecting on:', connName);
if (this[connName]) {
this[connName].closeRTC();
// clear connection
this[connName] = null;
// open socket if not already open and if from parent
if (connName === 'connToParent') this.socket.disconnected && this.socket.open();
}
};
// telling neighboring clients to reconnect
const reconnectNeighbors = (event) => {
// sending disconnecting message to each client
for (let conn of ['connToParent', 'connToChild']) {
if (this[conn]) {
// if the connection exists, use opposite connection name
// for example, if sending to parent on connToParent,
// parent would be receiving message on connToChild so we'd use connToChild
const oppConn = (conn === 'connToParent') ? 'connToChild' : 'connToParent';
// send disconnection message telling peer on other end to disable the connection between this and them
this[conn].sendMessage('disconnecting', {
// will allow disconnected root to reassign root role to next client
isRoot: this.isRoot,
// tells neighboring clients which connection to disconnect
disconnector: oppConn,
});
}
};
};
// adding document unload listener : fires when this client's browser closes the page
window.addEventListener('unload', reconnectNeighbors);
>>>>>>>
this.setUpInitialConnection();
// creates func to clear client connection when it disconnects
this._createIceDisconnHandler = (connName) => () => {
// have variable
// close client's RTC Peer Connection
console.log('ICE disconnecting on:', connName);
if (this[connName]) {
this[connName].closeRTC();
// clear connection
this[connName] = null;
// open socket if not already open and if from parent
if (connName === 'connToParent') this.socket.disconnected && this.socket.open();
}
};
// telling neighboring clients to reconnect
const reconnectNeighbors = (event) => {
// sending disconnecting message to each client
for (let conn of ['connToParent', 'connToChild']) {
if (this[conn]) {
// if the connection exists, use opposite connection name
// for example, if sending to parent on connToParent,
// parent would be receiving message on connToChild so we'd use connToChild
const oppConn = (conn === 'connToParent') ? 'connToChild' : 'connToParent';
// send disconnection message telling peer on other end to disable the connection between this and them
this[conn].sendMessage('disconnecting', {
// will allow disconnected root to reassign root role to next client
isRoot: this.isRoot,
// tells neighboring clients which connection to disconnect
disconnector: oppConn,
});
}
};
};
// adding document unload listener : fires when this client's browser closes the page
window.addEventListener('unload', reconnectNeighbors); |
<<<<<<<
=======
var Message = function Message(type, message) {
if (typeof type !== 'string') throw new Error('type must be a string');
// if (typeof message !== 'object') throw new Error('message must be an object');
this.type = type;
this.message = message;
};
module.exports = Message;
// export default Message
/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
>>>>>>> |
<<<<<<<
const WebTorrent = require('webtorrent');
let client = new WebTorrent();
let client2;
=======
const socketController = require('./socketController');
>>>>>>>
const WebTorrent = require('webtorrent');
let client = new WebTorrent();
let client2;
const socketController = require('./socketController');
<<<<<<<
// app.use(express.static(path.join(__dirname, 'torrents')));
=======
>>>>>>>
// app.use(express.static(path.join(__dirname, 'torrents'))); |
<<<<<<<
// this.socket = io.connect();
this.socket = observeSignaling(io.connect());
// limit of child clients per client
this.childLimit = 1;
=======
this.socket = io.connect();
>>>>>>>
// this.socket = io.connect();
this.socket = observeSignaling(io.connect());
// limit of child clients per client
this.childLimit = 1;
this.socket = io.connect(); |
<<<<<<<
ZeroClipboard._client = null; // The client
// ZeroClipboard options defaults
var _defaults = {
moviePath: "ZeroClipboard.swf", // URL to movie
trustedDomain: undefined, // Domains that we should trust
hoverClass: "zeroclipboard-is-hover", // The class used to hover over the object
activeClass: "zeroclipboard-is-active" // The class used to set object active
=======
ZeroClipboard._moviePath = 'ZeroClipboard.swf'; // URL to movie
/*
* Set the movie path for the flash file.
*
* returns nothing
*/
ZeroClipboard.setMoviePath = function (path) {
// set path to ZeroClipboard.swf
this._moviePath = path;
>>>>>>>
// ZeroClipboard options defaults
var _defaults = {
moviePath: "ZeroClipboard.swf", // URL to movie
trustedDomain: undefined, // Domains that we should trust
hoverClass: "zeroclipboard-is-hover", // The class used to hover over the object
activeClass: "zeroclipboard-is-active" // The class used to set object active
<<<<<<<
delete ZeroClipboard._client;
=======
delete ZeroClipboard.Client.prototype._singleton;
delete ZeroClipboard._trustedDomain;
ZeroClipboard._moviePath = 'ZeroClipboard.swf';
>>>>>>>
delete ZeroClipboard.Client.prototype._singleton; |
<<<<<<<
=======
setUp: function (callback) {
zeroClipboard = require("../ZeroClipboard");
clip = new zeroClipboard();
callback();
},
tearDown: function (callback) {
zeroClipboard.destroy();
callback();
},
>>>>>>>
<<<<<<<
test.ok(!zeroClipboard.Client.prototype._singleton);
=======
test.ok(!zeroClipboard.prototype._singleton);
test.ok(!zeroClipboard._trustedDomain);
test.equal(zeroClipboard._moviePath, 'ZeroClipboard.swf');
>>>>>>>
test.ok(!zeroClipboard.prototype._singleton); |
<<<<<<<
var ZeroClipboard = {};
ZeroClipboard.Client = function(elements, options) {
if (elements) (ZeroClipboard.Client.prototype._singleton || this).glue(elements);
if (ZeroClipboard.Client.prototype._singleton) return ZeroClipboard.Client.prototype._singleton;
ZeroClipboard.Client.prototype._singleton = this;
this.options = {};
for (var kd in _defaults) this.options[kd] = _defaults[kd];
for (var ko in options) this.options[ko] = options[ko];
=======
var _getStyle = function(el, prop) {
var y = el.style[prop];
if (el.currentStyle) y = el.currentStyle[prop]; else if (window.getComputedStyle) y = document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);
if (y == "auto" && prop == "cursor") {
var possiblePointers = [ "a" ];
for (var i = 0; i < possiblePointers.length; i++) {
if (el.tagName.toLowerCase() == possiblePointers[i]) {
return "pointer";
}
}
}
return y;
};
var _elementMouseOver = function(event) {
if (!event) {
event = window.event;
}
var target;
if (this !== window) {
target = this;
} else if (event.target) {
target = event.target;
} else if (event.srcElement) {
target = event.srcElement;
}
ZeroClipboard.prototype._singleton.setCurrent(target);
};
var _addEventHandler = function(element, method, func) {
if (element.addEventListener) {
element.addEventListener(method, func, false);
} else if (element.attachEvent) {
element.attachEvent("on" + method, func);
}
};
var _removeEventHandler = function(element, method, func) {
if (element.removeEventListener) {
element.removeEventListener(method, func, false);
} else if (element.detachEvent) {
element.detachEvent("on" + method, func);
}
};
var _addClass = function(element, value) {
if (element.addClass) {
element.addClass(value);
return element;
}
if (value && typeof value === "string") {
var classNames = (value || "").split(/\s+/);
if (element.nodeType === 1) {
if (!element.className) {
element.className = value;
} else {
var className = " " + element.className + " ", setClass = element.className;
for (var c = 0, cl = classNames.length; c < cl; c++) {
if (className.indexOf(" " + classNames[c] + " ") < 0) {
setClass += " " + classNames[c];
}
}
element.className = setClass.replace(/^\s+|\s+$/g, "");
}
}
}
return element;
};
var _removeClass = function(element, value) {
if (element.removeClass) {
element.removeClass(value);
return element;
}
if (value && typeof value === "string" || value === undefined) {
var classNames = (value || "").split(/\s+/);
if (element.nodeType === 1 && element.className) {
if (value) {
var className = (" " + element.className + " ").replace(/[\n\t]/g, " ");
for (var c = 0, cl = classNames.length; c < cl; c++) {
className = className.replace(" " + classNames[c] + " ", " ");
}
element.className = className.replace(/^\s+|\s+$/g, "");
} else {
element.className = "";
}
}
}
return element;
};
var _getDOMObjectPosition = function(obj) {
var info = {
left: 0,
top: 0,
width: obj.width || obj.offsetWidth || 0,
height: obj.height || obj.offsetHeight || 0,
zIndex: 9999
};
var zi = _getStyle(obj, "zIndex");
if (zi && zi != "auto") {
info.zIndex = parseInt(zi, 10);
}
while (obj) {
var borderLeftWidth = parseInt(_getStyle(obj, "borderLeftWidth"), 10);
var borderTopWidth = parseInt(_getStyle(obj, "borderTopWidth"), 10);
info.left += isNaN(obj.offsetLeft) ? 0 : obj.offsetLeft;
info.left += isNaN(borderLeftWidth) ? 0 : borderLeftWidth;
info.top += isNaN(obj.offsetTop) ? 0 : obj.offsetTop;
info.top += isNaN(borderTopWidth) ? 0 : borderTopWidth;
obj = obj.offsetParent;
}
return info;
};
var _noCache = function(path) {
return (path.indexOf("?") >= 0 ? "&" : "?") + "nocache=" + (new Date).getTime();
};
var _vars = function() {
var str = [];
if (ZeroClipboard._trustedDomain) str.push("trustedDomain=" + ZeroClipboard._trustedDomain);
return str.join("&");
};
var ZeroClipboard = function(elements) {
if (elements) (ZeroClipboard.prototype._singleton || this).glue(elements);
if (ZeroClipboard.prototype._singleton) return ZeroClipboard.prototype._singleton;
ZeroClipboard.prototype._singleton = this;
>>>>>>>
var _getStyle = function(el, prop) {
var y = el.style[prop];
if (el.currentStyle) y = el.currentStyle[prop]; else if (window.getComputedStyle) y = document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);
if (y == "auto" && prop == "cursor") {
var possiblePointers = [ "a" ];
for (var i = 0; i < possiblePointers.length; i++) {
if (el.tagName.toLowerCase() == possiblePointers[i]) {
return "pointer";
}
}
}
return y;
};
var _elementMouseOver = function(event) {
if (!event) {
event = window.event;
}
var target;
if (this !== window) {
target = this;
} else if (event.target) {
target = event.target;
} else if (event.srcElement) {
target = event.srcElement;
}
ZeroClipboard.prototype._singleton.setCurrent(target);
};
var _addEventHandler = function(element, method, func) {
if (element.addEventListener) {
element.addEventListener(method, func, false);
} else if (element.attachEvent) {
element.attachEvent("on" + method, func);
}
};
var _removeEventHandler = function(element, method, func) {
if (element.removeEventListener) {
element.removeEventListener(method, func, false);
} else if (element.detachEvent) {
element.detachEvent("on" + method, func);
}
};
var _addClass = function(element, value) {
if (element.addClass) {
element.addClass(value);
return element;
}
if (value && typeof value === "string") {
var classNames = (value || "").split(/\s+/);
if (element.nodeType === 1) {
if (!element.className) {
element.className = value;
} else {
var className = " " + element.className + " ", setClass = element.className;
for (var c = 0, cl = classNames.length; c < cl; c++) {
if (className.indexOf(" " + classNames[c] + " ") < 0) {
setClass += " " + classNames[c];
}
}
element.className = setClass.replace(/^\s+|\s+$/g, "");
}
}
}
return element;
};
var _removeClass = function(element, value) {
if (element.removeClass) {
element.removeClass(value);
return element;
}
if (value && typeof value === "string" || value === undefined) {
var classNames = (value || "").split(/\s+/);
if (element.nodeType === 1 && element.className) {
if (value) {
var className = (" " + element.className + " ").replace(/[\n\t]/g, " ");
for (var c = 0, cl = classNames.length; c < cl; c++) {
className = className.replace(" " + classNames[c] + " ", " ");
}
element.className = className.replace(/^\s+|\s+$/g, "");
} else {
element.className = "";
}
}
}
return element;
};
var _getDOMObjectPosition = function(obj) {
var info = {
left: 0,
top: 0,
width: obj.width || obj.offsetWidth || 0,
height: obj.height || obj.offsetHeight || 0,
zIndex: 9999
};
var zi = _getStyle(obj, "zIndex");
if (zi && zi != "auto") {
info.zIndex = parseInt(zi, 10);
}
while (obj) {
var borderLeftWidth = parseInt(_getStyle(obj, "borderLeftWidth"), 10);
var borderTopWidth = parseInt(_getStyle(obj, "borderTopWidth"), 10);
info.left += isNaN(obj.offsetLeft) ? 0 : obj.offsetLeft;
info.left += isNaN(borderLeftWidth) ? 0 : borderLeftWidth;
info.top += isNaN(obj.offsetTop) ? 0 : obj.offsetTop;
info.top += isNaN(borderTopWidth) ? 0 : borderTopWidth;
obj = obj.offsetParent;
}
return info;
};
var _noCache = function(path) {
return (path.indexOf("?") >= 0 ? "&" : "?") + "nocache=" + (new Date).getTime();
};
var _vars = function(options) {
var str = [];
if (options.trustedDomain) str.push("trustedDomain=" + options.trustedDomain);
return str.join("&");
};
var ZeroClipboard = function(elements, options) {
if (elements) (ZeroClipboard.prototype._singleton || this).glue(elements);
if (ZeroClipboard.prototype._singleton) return ZeroClipboard.prototype._singleton;
ZeroClipboard.prototype._singleton = this;
this.options = {};
for (var kd in _defaults) this.options[kd] = _defaults[kd];
for (var ko in options) this.options[ko] = options[ko];
<<<<<<<
ZeroClipboard.Client.prototype.setTitle = function(newTitle) {
=======
ZeroClipboard.prototype.resetText = function() {
this._text = null;
};
ZeroClipboard.prototype.setTitle = function(newTitle) {
>>>>>>>
ZeroClipboard.prototype.setTitle = function(newTitle) {
<<<<<<<
delete ZeroClipboard.Client.prototype._singleton;
=======
delete ZeroClipboard.prototype._singleton;
delete ZeroClipboard._trustedDomain;
ZeroClipboard._moviePath = "ZeroClipboard.swf";
>>>>>>>
delete ZeroClipboard.prototype._singleton;
<<<<<<<
_addClass(currentElement, this.options.hoverClass);
=======
_addClass(element, "zeroclipboard-is-hover");
>>>>>>>
_addClass(element, this.options.hoverClass);
<<<<<<<
_removeClass(currentElement, this.options.hoverClass);
=======
_removeClass(element, "zeroclipboard-is-hover");
>>>>>>>
_removeClass(element, this.options.hoverClass);
<<<<<<<
_addClass(currentElement, this.options.activeClass);
=======
_addClass(element, "zeroclipboard-is-active");
>>>>>>>
_addClass(element, this.options.activeClass);
<<<<<<<
_removeClass(currentElement, this.options.activeClass);
=======
_removeClass(element, "zeroclipboard-is-active");
>>>>>>>
_removeClass(element, this.options.activeClass);
<<<<<<<
var _getStyle = function(el, prop) {
var y = el.style[prop];
if (el.currentStyle) y = el.currentStyle[prop]; else if (window.getComputedStyle) y = document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);
if (y == "auto" && prop == "cursor") {
var possiblePointers = [ "a" ];
for (var i = 0; i < possiblePointers.length; i++) {
if (el.tagName.toLowerCase() == possiblePointers[i]) {
return "pointer";
}
}
}
return y;
};
var _elementMouseOver = function(event) {
if (!event) {
event = window.event;
}
var target;
if (this !== window) {
target = this;
} else if (event.target) {
target = event.target;
} else if (event.srcElement) {
target = event.srcElement;
}
ZeroClipboard.Client.prototype._singleton.setCurrent(target);
};
var _addEventHandler = function(element, method, func) {
if (element.addEventListener) {
element.addEventListener(method, func, false);
} else if (element.attachEvent) {
element.attachEvent("on" + method, func);
}
};
var _removeEventHandler = function(element, method, func) {
if (element.removeEventListener) {
element.removeEventListener(method, func, false);
} else if (element.detachEvent) {
element.detachEvent("on" + method, func);
}
};
var _addClass = function(element, value) {
if (element.addClass) {
element.addClass(value);
return element;
}
if (value && typeof value === "string") {
var classNames = (value || "").split(/\s+/);
if (element.nodeType === 1) {
if (!element.className) {
element.className = value;
} else {
var className = " " + element.className + " ", setClass = element.className;
for (var c = 0, cl = classNames.length; c < cl; c++) {
if (className.indexOf(" " + classNames[c] + " ") < 0) {
setClass += " " + classNames[c];
}
}
element.className = setClass.replace(/^\s+|\s+$/g, "");
}
}
}
return element;
};
var _removeClass = function(element, value) {
if (element.removeClass) {
element.removeClass(value);
return element;
}
if (value && typeof value === "string" || value === undefined) {
var classNames = (value || "").split(/\s+/);
if (element.nodeType === 1 && element.className) {
if (value) {
var className = (" " + element.className + " ").replace(/[\n\t]/g, " ");
for (var c = 0, cl = classNames.length; c < cl; c++) {
className = className.replace(" " + classNames[c] + " ", " ");
}
element.className = className.replace(/^\s+|\s+$/g, "");
} else {
element.className = "";
}
}
}
return element;
};
var _getDOMObjectPosition = function(obj) {
var info = {
left: 0,
top: 0,
width: obj.width || obj.offsetWidth || 0,
height: obj.height || obj.offsetHeight || 0,
zIndex: 9999
};
var zi = _getStyle(obj, "zIndex");
if (zi && zi != "auto") {
info.zIndex = parseInt(zi, 10);
}
while (obj) {
var borderLeftWidth = parseInt(_getStyle(obj, "borderLeftWidth"), 10);
var borderTopWidth = parseInt(_getStyle(obj, "borderTopWidth"), 10);
info.left += isNaN(obj.offsetLeft) ? 0 : obj.offsetLeft;
info.left += isNaN(borderLeftWidth) ? 0 : borderLeftWidth;
info.top += isNaN(obj.offsetTop) ? 0 : obj.offsetTop;
info.top += isNaN(borderTopWidth) ? 0 : borderTopWidth;
obj = obj.offsetParent;
}
return info;
};
var _noCache = function(path) {
return (path.indexOf("?") >= 0 ? "&" : "?") + "nocache=" + (new Date).getTime();
};
var _vars = function(options) {
var str = [];
if (options.trustedDomain) str.push("trustedDomain=" + options.trustedDomain);
return str.join("&");
};
=======
>>>>>>> |
<<<<<<<
ZeroClipboard.Client = function (elements, options) {
=======
var ZeroClipboard = function (elements) {
>>>>>>>
var ZeroClipboard = function (elements, options) {
<<<<<<<
=======
* Sets the object's _text to null
*
* returns nothing
*/
ZeroClipboard.prototype.resetText = function () {
this._text = null;
};
/*
>>>>>>> |
<<<<<<<
ZeroClipboard.Client = function(elements, options) {
var singleton = ZeroClipboard._client;
if (singleton) {
if (elements) singleton.glue(elements);
return singleton;
}
this.options = {};
for (var kd in _defaults) this.options[kd] = _defaults[kd];
for (var ko in options) this.options[ko] = options[ko];
=======
ZeroClipboard.Client = function(elements) {
if (elements) (ZeroClipboard.Client.prototype._singleton || this).glue(elements);
if (ZeroClipboard.Client.prototype._singleton) return ZeroClipboard.Client.prototype._singleton;
ZeroClipboard.Client.prototype._singleton = this;
>>>>>>>
ZeroClipboard.Client = function(elements, options) {
if (elements) (ZeroClipboard.Client.prototype._singleton || this).glue(elements);
if (ZeroClipboard.Client.prototype._singleton) return ZeroClipboard.Client.prototype._singleton;
ZeroClipboard.Client.prototype._singleton = this;
this.options = {};
for (var kd in _defaults) this.options[kd] = _defaults[kd];
for (var ko in options) this.options[ko] = options[ko];
<<<<<<<
ZeroClipboard._client = null;
var _defaults = {
moviePath: "ZeroClipboard.swf",
trustedDomain: undefined,
hoverClass: "zeroclipboard-is-hover",
activeClass: "zeroclipboard-is-active"
=======
ZeroClipboard._moviePath = "ZeroClipboard.swf";
ZeroClipboard.setMoviePath = function(path) {
this._moviePath = path;
>>>>>>>
var _defaults = {
moviePath: "ZeroClipboard.swf",
trustedDomain: undefined,
hoverClass: "zeroclipboard-is-hover",
activeClass: "zeroclipboard-is-active"
<<<<<<<
delete ZeroClipboard._client;
=======
delete ZeroClipboard.Client.prototype._singleton;
delete ZeroClipboard._trustedDomain;
ZeroClipboard._moviePath = "ZeroClipboard.swf";
>>>>>>>
delete ZeroClipboard.Client.prototype._singleton; |
<<<<<<<
ZeroClipboard.version = "1.1.0";
=======
ZeroClipboard.version = "1.1.0";
ZeroClipboard.clients = {};
>>>>>>>
ZeroClipboard.version = "1.1.0";
<<<<<<<
ZeroClipboard.dispatch = function(eventName, args) {
ZeroClipboard.currentClient.receiveEvent(eventName, args);
=======
ZeroClipboard.register = function(id, client) {
this.clients[id] = client;
};
ZeroClipboard.detectFlashSupport = function() {
this.hasFlash = false;
try {
if (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) {
this.hasFlash = true;
}
} catch (error) {
if (navigator.mimeTypes["application/x-shockwave-flash"] !== undefined) {
this.hasFlash = true;
}
}
if (!this.hasFlash) {
for (var id in this.clients) {
this.dispatch(id, "onNoFlash", null);
}
}
return this.hasFlash;
};
ZeroClipboard.dispatch = function(id, eventName, args) {
var client = this.clients[id];
if (client) {
client.receiveEvent(eventName, args);
}
>>>>>>>
ZeroClipboard.detectFlashSupport = function() {
this.hasFlash = false;
try {
if (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) {
this.hasFlash = true;
}
} catch (error) {
if (navigator.mimeTypes["application/x-shockwave-flash"] !== undefined) {
this.hasFlash = true;
}
}
if (!this.hasFlash) {
this.dispatch("onNoFlash", null);
}
return this.hasFlash;
};
ZeroClipboard.dispatch = function(eventName, args) {
ZeroClipboard.currentClient.receiveEvent(eventName, args);
<<<<<<<
this.htmlBridge.setAttribute("data-clipboard-ready", true);
=======
if (args && parseFloat(args.flashVersion.replace(",", ".").replace(/[^0-9\.]/gi, "")) < 10) {
this.receiveEvent("onWrongFlash", {
flashVersion: args.flashVersion
});
return;
}
this.movie = document.getElementById(this.movieId);
var self;
if (!this.movie) {
self = this;
setTimeout(function() {
self.receiveEvent("load", null);
}, 1);
return;
}
if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) {
self = this;
setTimeout(function() {
self.receiveEvent("load", null);
}, 100);
this.ready = true;
return;
}
this.ready = true;
this.movie.setText(this.clipText);
this.movie.setHandCursor(this.handCursorEnabled);
>>>>>>>
if (args && parseFloat(args.flashVersion.replace(",", ".").replace(/[^0-9\.]/gi, "")) < 10) {
this.receiveEvent("onWrongFlash", {
flashVersion: args.flashVersion
});
return;
}
this.htmlBridge.setAttribute("data-clipboard-ready", true);
<<<<<<<
ZeroClipboard.getDOMObjectPosition = function(obj) {
=======
ZeroClipboard.Client.prototype.glue = function(elem, appendElem, stylesToAdd) {
this.domElement = ZeroClipboard.$(elem);
if (this.domElement.length) this.domElement = this.domElement[0];
if (this.domElement.style.zIndex) {
this.zIndex = parseInt(this.domElement.style.zIndex, 10) + 1;
}
if (!this.title && this.domElement.getAttribute("title")) {
this.title = this.domElement.getAttribute("title");
}
if (!this.clipText && this.domElement.getAttribute("data-clipboard-text")) {
this.clipText = this.domElement.getAttribute("data-clipboard-text");
}
if (typeof appendElem == "string") {
appendElem = ZeroClipboard.$(appendElem);
} else if (typeof appendElem == "undefined") {
appendElem = document.getElementsByTagName("body")[0];
}
var box = ZeroClipboard.getDOMObjectPosition(this.domElement, appendElem);
this.div = document.createElement("div");
var style = this.div.style;
style.position = "absolute";
style.left = "" + box.left + "px";
style.top = "" + box.top + "px";
style.width = "" + box.width + "px";
style.height = "" + box.height + "px";
style.zIndex = this.zIndex;
if (typeof stylesToAdd == "object") {
for (var addedStyle in stylesToAdd) {
style[addedStyle] = stylesToAdd[addedStyle];
}
}
this.div.innerHTML = this.getHTML(box.width, box.height);
appendElem.appendChild(this.div);
};
ZeroClipboard.getDOMObjectPosition = function(obj, stopObj) {
>>>>>>>
ZeroClipboard.getDOMObjectPosition = function(obj) {
<<<<<<<
function elementWrapper(element) {
if (!element || element.addClass) return element;
element.addClass = function(value) {
if (value && typeof value === "string") {
var classNames = (value || "").split(/\s+/);
var elem = this;
if (elem.nodeType === 1) {
if (!elem.className) {
elem.className = value;
} else {
var className = " " + elem.className + " ", setClass = elem.className;
for (var c = 0, cl = classNames.length; c < cl; c++) {
if (className.indexOf(" " + classNames[c] + " ") < 0) {
setClass += " " + classNames[c];
}
}
elem.className = setClass.replace(/^\s+|\s+$/g, "");
=======
ZeroClipboard.Client.prototype.reposition = function(elem) {
if (elem) {
this.domElement = ZeroClipboard.$(elem);
if (!this.domElement) this.hide();
}
if (this.domElement && this.div) {
var box = ZeroClipboard.getDOMObjectPosition(this.domElement);
var style = this.div.style;
style.left = "" + box.left + "px";
style.top = "" + box.top + "px";
}
};
ZeroClipboard.Client.prototype.hide = function() {
if (this.div) {
this.div.style.left = "-2000px";
}
};
ZeroClipboard.Client.prototype.show = function() {
this.reposition();
};
function elementWrapper(element) {
if (!element || element.addClass) return element;
element.addClass = function(value) {
if (value && typeof value === "string") {
var classNames = (value || "").split(/\s+/);
var elem = this;
if (elem.nodeType === 1) {
if (!elem.className) {
elem.className = value;
} else {
var className = " " + elem.className + " ", setClass = elem.className;
for (var c = 0, cl = classNames.length; c < cl; c++) {
if (className.indexOf(" " + classNames[c] + " ") < 0) {
setClass += " " + classNames[c];
}
}
elem.className = setClass.replace(/^\s+|\s+$/g, "");
>>>>>>>
function elementWrapper(element) {
if (!element || element.addClass) return element;
element.addClass = function(value) {
if (value && typeof value === "string") {
var classNames = (value || "").split(/\s+/);
var elem = this;
if (elem.nodeType === 1) {
if (!elem.className) {
elem.className = value;
} else {
var className = " " + elem.className + " ", setClass = elem.className;
for (var c = 0, cl = classNames.length; c < cl; c++) {
if (className.indexOf(" " + classNames[c] + " ") < 0) {
setClass += " " + classNames[c];
}
}
elem.className = setClass.replace(/^\s+|\s+$/g, "");
<<<<<<<
}
return this;
};
return element;
}
ZeroClipboard.$ = function(query) {
var ZeroClipboardSelect = function(s, n) {
return n.querySelectorAll(s);
}, result;
if (typeof Sizzle === "function") {
ZeroClipboardSelect = function(s, n) {
return Sizzle.uniqueSort(Sizzle(s, n));
=======
}
return this;
};
element.hasClass = function(selector) {
var className = " " + selector + " ";
if ((" " + this.className + " ").replace(/[\n\t]/g, " ").indexOf(className) > -1) {
return true;
}
return false;
};
return element;
}
ZeroClipboard.$ = function(query) {
var ZeroClipboardSelect = function(s, n) {
return n.querySelectorAll(s);
}, result;
if (typeof Sizzle === "function") {
ZeroClipboardSelect = function(s, n) {
return Sizzle.uniqueSort(Sizzle(s, n));
>>>>>>>
}
return this;
};
return element;
}
ZeroClipboard.$ = function(query) {
var ZeroClipboardSelect = function(s, n) {
return n.querySelectorAll(s);
}, result;
if (typeof Sizzle === "function") {
ZeroClipboardSelect = function(s, n) {
return Sizzle.uniqueSort(Sizzle(s, n)); |
<<<<<<<
if (!$.commandExists(command)) {
=======
if (command.indexOf('!!') > -1 && !$.commandExists(command)) {
//$.say($.whisperPrefix(sender) + $.lang.get('cmd.404', command));
>>>>>>>
if (command.indexOf('!!') > -1 && !$.commandExists(command)) {
//$.say($.whisperPrefix(sender) + $.lang.get('cmd.404', command));
<<<<<<<
=======
//$.say($.whisperPrefix(sender) + $.lang.get('cooldown.active', command, $.getTimeString(cooldown / 1e3)));
>>>>>>>
//$.say($.whisperPrefix(sender) + $.lang.get('cooldown.active', command, $.getTimeString(cooldown / 1e3)));
<<<<<<<
addHook('command', function (event) {
var sender = event.getSender().toLowerCase(),
username = $.username.resolve(sender, event.getTags()),
command = event.getCommand(),
args = event.getArgs(),
action = args[0],
temp,
index;
=======
if (command.equalsIgnoreCase('reconnect')) {
if (!$.isModv3(sender, event.getTags())) {
$.say($.whisperPrefix(sender) + $.modMsg);
return;
}
$.logEvent('init.js', 354, username + ' requested a reconnect!');
$.connmgr.reconnectSession($.hostname);
$.say($.lang.get('init.reconnect'));
}
if (command.equalsIgnoreCase('chat') && sender.equalsIgnoreCase($.botName)) {
$.say(argString);
}
if (command.equalsIgnoreCase('module')) {
if (!$.isAdmin(sender)) {
$.say($.whisperPrefix(sender) + $.adminMsg);
return;
}
if (!action) {
$.say($.whisperPrefix(sender) + $.lang.get('init.module.usage'));
return;
}
>>>>>>>
$api.on($script, 'command', function (event) {
var sender = event.getSender().toLowerCase(),
tags = event.getTags(),
origCommand = event.getCommand().toLowerCase(),
cooldown,
command;
if (!$.isModv3(sender, tags) && $.commandPause.isPaused()) {
//$.say($.whisperPrefix(sender) + $.lang.get('commandpause.isactive'));
return;
}
if ($.inidb.exists('aliases', origCommand)) {
event.setCommand($.inidb.get('aliases', origCommand));
}
command = event.getCommand().toLowerCase();
if (command.indexOf('!!') > -1 && !$.commandExists(command)) {
//$.say($.whisperPrefix(sender) + $.lang.get('cmd.404', command));
return;
}
if (!$.permCom(sender, command)) {
//$.say($.whisperPrefix(sender) + $.lang.get('cmd.noperm', $.getUserGroupName(sender), command));
return;
}
if (!$.isAdmin(sender)) {
cooldown = $.coolDown.get(command, sender);
if (cooldown > 0) {
//$.say($.whisperPrefix(sender) + $.lang.get('cooldown.active', command, $.getTimeString(cooldown / 1e3)));
return;
}
}
if (isModuleEnabled('./core/pointsSystem.js') && !$.isModv3(sender, event.getTags()) && $.inidb.exists('pricecom', command)) {
if ($.getUserPoints(sender) < $.getCommandPrice(command)) {
$.say($.whisperPrefix(sender) + $.lang.get('cmd.needpoints', $.getPointsString($.inidb.get('pricecom', command))));
return;
}
if (parseInt($.inidb.get('pricecom', command)) > 0) {
$.inidb.decr('points', sender, $.inidb.get('pricecom', command));
}
}
callHook('command', event, false);
});
/**
* @event api-consoleInput
*/
$api.on($script, 'consoleInput', function (event) {
callHook('consoleInput', event, true);
});
/**
* @event api-twitchFollow
*/
$api.on($script, 'twitchFollow', function (event) {
callHook('twitchFollow', event, true);
});
/**
* @event api-twitchUnFollow
*/
$api.on($script, 'twitchUnfollow', function (event) {
callHook('twitchUnfollow', event, true);
});
/**
* @event api-twitchFollowsInitialized
*/
$api.on($script, 'twitchFollowsInitialized', function (event) {
callHook('twitchFollowsInitialized', event, true);
});
/**
* @event api-twitchHosted
*/
$api.on($script, 'twitchHosted', function (event) {
callHook('twitchHosted', event, true);
});
/**
* @event api-twitchUnhosted
*/
$api.on($script, 'twitchUnhosted', function (event) {
callHook('twitchUnhosted', event, true);
});
/**
* @event api-twitchHostsInitialized
*/
$api.on($script, 'twitchHostsInitialized', function (event) {
callHook('twitchHostsInitialized', event, true);
});
/**
* @event api-twitchSubscribe
*/
$api.on($script, 'twitchSubscribe', function (event) {
callHook('twitchSubscribe', event, true);
});
/**
* @event api-twitchUnsubscribe
*/
$api.on($script, 'twitchUnsubscribe', function (event) {
callHook('twitchUnsubscribe', event, true);
});
/**
* @event api-twitchSubscribesInitialized
*/
$api.on($script, 'twitchSubscribesInitialized', function (event) {
callHook('twitchSubscribesInitialized', event, true);
});
/**
* @event api-ircChannelJoin
*/
$api.on($script, 'ircChannelJoin', function (event) {
callHook('ircChannelJoin', event, true);
});
/**
* @event api-ircChannelLeave
*/
$api.on($script, 'ircChannelLeave', function (event) {
callHook('ircChannelLeave', event, true);
});
/**
* @event api-ircChannelUserMode
*/
$api.on($script, 'ircChannelUserMode', function (event) {
callHook('ircChannelUserMode', event, true);
});
/**
* @event api-ircConnectComplete
*/
$api.on($script, 'ircConnectComplete', function (event) {
callHook('ircConnectComplete', event, true);
});
/**
* @event api-ircJoinComplete
*/
$api.on($script, 'ircJoinComplete', function (event) {
callHook('ircJoinComplete', event, true);
});
/**
* @event api-ircPrivateMessage
*/
$api.on($script, 'ircPrivateMessage', function (event) {
callHook('ircPrivateMessage', event, false);
});
/**
* @event api-musicPlayerConnect
*/
$api.on($script, 'musicPlayerConnect', function (event) {
callHook('musicPlayerConnect', event, false);
});
/**
* @event api-musicPlayerCurrentId
*/
$api.on($script, 'musicPlayerCurrentId', function (event) {
callHook('musicPlayerCurrentId', event, false);
});
/**
* @event api-musicPlayerCurrentVolume
*/
$api.on($script, 'musicPlayerCurrentVolume', function (event) {
callHook('musicPlayerCurrentVolume', event, false);
});
/**
* @event api-musicPlayerDisconnect
*/
$api.on($script, 'musicPlayerDisconnect', function (event) {
callHook('musicPlayerDisconnect', event, false);
});
/**
* @event api-musicPlayerState
*/
$api.on($script, 'musicPlayerState', function (event) {
callHook('musicPlayerState', event, false);
});
$.logEvent('init.js', 534, 'Bot locked & loaded!');
$.consoleLn('Bot locked & loaded!');
addHook('initReady', function () {
$.registerChatCommand('./init.js', 'reconnect', 2);
$.registerChatCommand('./init.js', 'module', 1);
});
// Send out initReady event
callHook('initReady', null, true);
}
/**
* @event api-command
*/
$api.on(initScript, 'command', function (event) {
var sender = event.getSender().toLowerCase(),
username = $.username.resolve(sender, event.getTags()),
command = event.getCommand(),
args = event.getArgs(),
argString = event.getArguments(),
action = args[0],
temp,
index; |
<<<<<<<
$.bind('twitchSubscribe', function(event) { // from twitch api
if (!$.bot.isModuleEnabled('./handlers/subscribeHandler.js')) {
return;
}
var subscriber = event.getSubscriber();
if (!$.inidb.exists('subscribed', subscriber)) {
$.addSubUsersList(subscriber);
$.restoreSubscriberStatus(subscriber, true);
}
});
/**
* @event twitchUnSubscribe
*/
$.bind('twitchUnsubscribe', function(event) { // from twitch api
if (!$.bot.isModuleEnabled('./handlers/subscribeHandler.js')) {
return;
}
var subscriber = event.getSubscriber();
if ($.inidb.exists('subscribed', subscriber)) {
$.delSubUsersList(subscriber);
$.restoreSubscriberStatus(subscriber, true);
}
});
$.bind('newSubscriber', function(event) { // From twitchnotify
=======
$.bind('newSubscriber', function(event) {
>>>>>>>
$.bind('newSubscriber', function(event) {
<<<<<<<
if (subReward > 0 && $.bot.isModuleEnabled('./systems/pointSystem.js')) {
$.inidb.incr('points', subscriber, subReward);
}
=======
>>>>>>>
<<<<<<<
if (subReward > 0 && $.bot.isModuleEnabled('./systems/pointSystem.js')) {
$.inidb.incr('points', subscriber, subReward);
}
=======
>>>>>>>
<<<<<<<
if (reSubRewardToggle) {
if (reSubReward > 0 && $.bot.isModuleEnabled('./systems/pointSystem.js')) {
$.inidb.incr('points', resubscriber, reSubReward);
}
} else {
if (subReward > 0 && $.bot.isModuleEnabled('./systems/pointSystem.js')) {
$.inidb.incr('points', resubscriber, subReward);
}
}
=======
>>>>>>>
<<<<<<<
/**
* @commandpath resubwelcometoggle - Enable or disable resubsciption alerts.
=======
/*
* @commandpath resubwelcometoggle - Enable or disable resubsciption alerts.
>>>>>>>
/*
* @commandpath resubwelcometoggle - Enable or disable resubsciption alerts.
<<<<<<<
if (reSubWelcomeToggle) {
$.inidb.set('subscribeHandler', 'reSubscriberWelcomeToggle', false);
reSubWelcomeToggle = false;
$.say($.whisperPrefix(sender) + $.lang.get('subscribehandler.resub.toggle.off'));
$.log.event(sender + ' disabled re-subscriber announcements');
return;
} else {
$.inidb.set('subscribeHandler', 'reSubscriberWelcomeToggle', true);
reSubWelcomeToggle = true;
$.say($.whisperPrefix(sender) + $.lang.get('subscribehandler.resub.toggle.on'));
$.log.event(sender + ' enabled re-subscriber announcements');
return;
}
=======
reSubWelcomeToggle = !reSubWelcomeToggle;
$.setIniDbBoolean('subscribeHandler', 'reSubscriberWelcomeToggle', reSubWelcomeToggle);
$.say($.whisperPrefix(sender) + (reSubWelcomeToggle ? $.lang.get('subscribehandler.resub.toggle.on') : $.lang.get('subscribehandler.resub.toggle.off')))
>>>>>>>
reSubWelcomeToggle = !reSubWelcomeToggle;
$.setIniDbBoolean('subscribeHandler', 'reSubscriberWelcomeToggle', reSubWelcomeToggle);
$.say($.whisperPrefix(sender) + (reSubWelcomeToggle ? $.lang.get('subscribehandler.resub.toggle.on') : $.lang.get('subscribehandler.resub.toggle.off')))
}
/**
* @commandpath resubrewardtoggle - Enable or disable resubsciption rewards to be separate from subscription rewards.
*/
if (command.equalsIgnoreCase('resubrewardtoggle')) {
reSubRewardToggle = !reSubRewardToggle;
$.setIniDbBoolean('subscribeHandler', 'reSubscriberRewardToggle', reSubRewardToggle);
$.say($.whisperPrefix(sender) + (reSubRewardToggle ? $.lang.get('subscribehandler.resub.reward.toggle.on') : $.lang.get('subscribehandler.resub.reward.toggle.off')))
}
/*
* @commandpath submessage [message] - Set a welcome message for new subscribers.
*/
if (command.equalsIgnoreCase('submessage')) {
if (action === undefined) {
$.say($.whisperPrefix(sender) + $.lang.get('subscribehandler.sub.msg.usage'));
return;
}
subMessage = argsString;
$.setIniDbString('subscribeHandler', 'subscribeMessage', subMessage);
$.say($.whisperPrefix(sender) + $.lang.get('subscribehandler.sub.msg.set'));
}
/*
* @commandpath primesubmessage [message] - Set a welcome message for new Twitch Prime subscribers.
*/
if (command.equalsIgnoreCase('primesubmessage')) {
if (action === undefined) {
$.say($.whisperPrefix(sender) + $.lang.get('subscribehandler.primesub.msg.usage'));
return;
}
primeSubMessage = argsString;
$.setIniDbString('subscribeHandler', 'primeSubscribeMessage', primeSubMessage);
$.say($.whisperPrefix(sender) + $.lang.get('subscribehandler.primesub.msg.set'));
}
/*
* @commandpath resubmessage [message] - Set a message for resubscribers.
*/
if (command.equalsIgnoreCase('resubmessage')) {
if (action === undefined) {
$.say($.whisperPrefix(sender) + $.lang.get('subscribehandler.resub.msg.usage'));
return;
}
reSubMessage = argsString ;
$.setIniDbString('subscribeHandler', 'reSubscribeMessage', reSubMessage);
$.say($.whisperPrefix(sender) + $.lang.get('subscribehandler.resub.msg.set'));
}
/**
* @commandpath subscribereward [points] - Set an award for subscribers.
*/
if (command.equalsIgnoreCase('subscribereward')) {
if (isNaN(parseInt(action))) {
$.say($.whisperPrefix(sender) + $.lang.get('subscribehandler.sub.reward.usage'));
return;
}
subReward = parseInt(action);
$.setIniDbNumber('subscribeHandler', 'subscribeReward', subReward);
$.say($.whisperPrefix(sender) + $.lang.get('subscribehandler.sub.reward.set')); |
<<<<<<<
// octave bands
// generate a table of frequencies based on an equal-tempered scale
=======
// generate a table of octave bands based on the equal tempered scale
>>>>>>>
// octave bands
// generate a table of frequencies based on the equal tempered scale |
<<<<<<<
fs.normalize("./../a").should.be.eql("../a");
fs.normalize("/a/./../b").should.be.eql("/b");
fs.normalize("/./../b").should.be.eql("/b");
fs.normalize("C:\\.\\..\\a").should.be.eql("C:\\a");
fs.normalize("C:\\a\\.\\..\\b").should.be.eql("C:\\b");
=======
fs.normalize("\\\\remote-computer\\c$\\file").should.be.eql("\\\\remote-computer\\c$\\file");
>>>>>>>
fs.normalize("\\\\remote-computer\\c$\\file").should.be.eql("\\\\remote-computer\\c$\\file");
fs.normalize("./../a").should.be.eql("../a");
fs.normalize("/a/./../b").should.be.eql("/b");
fs.normalize("/./../b").should.be.eql("/b");
fs.normalize("C:\\.\\..\\a").should.be.eql("C:\\a");
fs.normalize("C:\\a\\.\\..\\b").should.be.eql("C:\\b"); |
<<<<<<<
throw new Error("Path doesn't exist " + _path);
=======
throw new Error("Path doesn't exists '" + _path + "'");
>>>>>>>
throw new Error("Path doesn't exist '" + _path + "'");
<<<<<<<
throw new Error("Path doesn't exist " + _path);
=======
throw new Error("Path doesn't exists '" + _path + "'");
>>>>>>>
throw new Error("Path doesn't exist '" + _path + "'");
<<<<<<<
throw new Error("Path doesn't exist " + _path);
=======
throw new Error("Path doesn't exists '" + _path + "'");
>>>>>>>
throw new Error("Path doesn't exist '" + _path + "'");
<<<<<<<
throw new Error("File doesn't exist " + _path);
=======
throw new Error("File doesn't exists '" + _path + "'");
>>>>>>>
throw new Error("Path doesn't exist '" + _path + "'");
<<<<<<<
throw new Error("Path doesn't exist " + _path);
=======
throw new Error("Path doesn't exists '" + _path + "'");
>>>>>>>
throw new Error("Path doesn't exist '" + _path + "'");
<<<<<<<
throw new Error("File doesn't exist " + _path);
=======
throw new Error("File doesn't exists '" + _path + "'");
>>>>>>>
throw new Error("Path doesn't exist '" + _path + "'");
<<<<<<<
throw new Error("Path doesn't exist " + _path);
=======
throw new Error("Path doesn't exists '" + _path + "'");
>>>>>>>
throw new Error("Path doesn't exist '" + _path + "'");
<<<<<<<
throw new Error("Path doesn't exist " + _path);
=======
throw new Error("Path doesn't exists '" + _path + "'");
>>>>>>>
throw new Error("Path doesn't exist '" + _path + "'");
<<<<<<<
throw new Error("Path doesn't exist " + _path);
=======
throw new Error("Path doesn't exists '" + _path + "'");
>>>>>>>
throw new Error("Path doesn't exist '" + _path + "'"); |
<<<<<<<
<ListItemLink to="/blog" primary="Blog" />
=======
<ListItemLink to="/page/contribution-guide" primary="Contribution Guide" data-testid="ContributionGuide" />
>>>>>>>
<ListItemLink to="/blog" primary="Blog" />
<ListItemLink to="/page/contribution-guide" primary="Contribution Guide" data-testid="ContributionGuide" /> |
<<<<<<<
const authors = props.authors.filter(a => a);
=======
const formatDate = (date) => {
return moment(date).format("MMMM D, YYYY");
};
>>>>>>>
const authors = props.authors.filter(a => a);
const formatDate = (date) => {
return moment(date).format("MMMM D, YYYY");
}; |
<<<<<<<
const wrapEvent = (child, theirHandler, ourHandler) => event => {
if (typeof child === "string") return;
if (child.props[theirHandler]) {
child.props[theirHandler](event);
}
if (!event.defaultPrevented) {
return ourHandler(event);
}
};
=======
// const activeTooltip = { id: "" };
>>>>>>>
const wrapEvent = (child, theirHandler, ourHandler) => event => {
if (typeof child === "string") return;
if (child.props[theirHandler]) {
child.props[theirHandler](event);
}
if (!event.defaultPrevented) {
return ourHandler(event);
}
};
<<<<<<<
const bgColor = rest.bg || rest.backgroundColor || _bg;
const textColor = color || _color;
const handleClick = wrapEvent(children, "onClick", () => {
=======
const handleClick = event => {
>>>>>>>
const handleClick = wrapEvent(children, "onClick", () => { |
<<<<<<<
gulp.task('styles', function () {
<% if (props.cssPreprocessor.key === 'less') { %>
var lessOptions = {
paths: [
'bower_components',
paths.src + '/app',
paths.src + '/components'
]
};
<% } if (props.cssPreprocessor.extension === 'scss') { %>
var sassOptions = {
style: 'expanded'
};
<% } %>
=======
module.exports = function(options) {
gulp.task('styles', function () {
<% if (props.cssPreprocessor.key === 'less') { %>
var lessOptions = {
options: [
'bower_components',
options.src + '/app',
options.src + '/components'
]
};
<% } %>
<% if (props.cssPreprocessor.extension === 'scss') { %>
var sassOptions = {
style: 'expanded'
};
<% } %>
>>>>>>>
module.exports = function(options) {
gulp.task('styles', function () {
<% if (props.cssPreprocessor.key === 'less') { %>
var lessOptions = {
options: [
'bower_components',
options.src + '/app',
options.src + '/components'
]
};
<% } if (props.cssPreprocessor.extension === 'scss') { %>
var sassOptions = {
style: 'expanded'
};
<% } %> |
<<<<<<<
model.on('add remove reset sort', getter);
=======
modelMethods.on(model, 'add remove reset sort', setter);
>>>>>>>
modelMethods.on(model, 'add remove reset sort', getter);
<<<<<<<
model.on('change:' + ch, getter);
this._normalizeModelEvents(model, 'change:' + ch, getter);
=======
modelMethods.on(model, 'change:' + ch, setter);
>>>>>>>
modelMethods.on(model, 'change:' + ch, getter);
<<<<<<<
handler, getter, events,
model, i, l;
=======
handler, setter, events,
modelName, model, i, l;
>>>>>>>
handler, getter, events,
modelName, model, i, l;
<<<<<<<
for (model in changeAttrs) {
if (changeAttrs.hasOwnProperty(model)) {
if (this.view[model] instanceof Backbone.Collection) {
if (col.indexOf(model) === -1) {
col.push(model);
this.view[model].off('add remove reset sort', getter);
=======
for (modelName in changeAttrs) {
if (changeAttrs.hasOwnProperty(modelName)) {
model = this.view[modelName];
if (model instanceof Backbone.Collection) {
if (col.indexOf(modelName) === -1) {
col.push(modelName);
modelMethods.off(model, 'add remove reset sort', setter);
>>>>>>>
for (modelName in changeAttrs) {
if (changeAttrs.hasOwnProperty(modelName)) {
model = this.view[modelName];
if (model instanceof Backbone.Collection) {
if (col.indexOf(modelName) === -1) {
col.push(modelName);
modelMethods.off(model, 'add remove reset sort', getter);
<<<<<<<
this.view[model].off('change:' + changeAttr[i], getter);
=======
modelMethods.off(model, 'change:' + changeAttr[i], setter);
>>>>>>>
modelMethods.off(model, 'change:' + changeAttr[i], getter);
<<<<<<<
if (selector === 'el') {
this.dummies.push(this.view._ribs.dummy);
} else {
for (var i = 0; i < this.$el.length; i++) {
dummy = document.createComment(this.$el[i].tagName);
this.dummies.push(dummy);
}
=======
for (var i = 0; i < this.$el.length; i++) {
dummy = document.createComment(this.$el[i].tagName);
this.dummies.push(dummy);
}
>>>>>>>
for (var i = 0; i < this.$el.length; i++) {
dummy = document.createComment(this.$el[i].tagName);
this.dummies.push(dummy);
} |
<<<<<<<
'.bind-input': {
value: {
data: ['model.first', 'model.second'],
processor: {
get: function (first, second) {
return first + ';' + second;
},
set: function (val) {
val = val.split(';');
return null; //[val[0], val[1]];
}
}
=======
/*'el': {
toggleByClass: 'model.visible',
classes: {
'list-item': 'model.list'
>>>>>>>
'.bind-input': {
value: {
data: ['model.first', 'model.second'],
processor: {
get: function (first, second) {
return first + ';' + second;
},
set: function (val) {
val = val.split(';');
return null; //[val[0], val[1]];
}
}
/*'el': {
toggleByClass: 'model.visible',
classes: {
'list-item': 'model.list'
<<<<<<<
this.model = new Backbone.Ribs.Model({
first: 'aaaaa',
second: 'bbbbb'
=======
this.addBindings('el', {
text: {
data:'model.test',
filter: function (test) {
console.log('bind');
return test;
}
}
>>>>>>>
this.addBindings('el', {
text: {
data:'model.test',
filter: function (test) {
console.log('bind');
return test;
}
} |
<<<<<<<
=======
var options
, defaults;
function setOptions(opt) {
if (!opt) opt = defaults;
if (options === opt) return;
options = opt;
if (options.gfm) {
block.fences = block.gfm.fences;
block.paragraph = block.gfm.paragraph;
block.table = block.gfm.table;
block.nptable = block.gfm.nptable;
inline.text = inline.gfm.text;
inline.url = inline.gfm.url;
} else {
block.fences = block.normal.fences;
block.paragraph = block.normal.paragraph;
block.table = block.normal.table;
block.nptable = block.normal.nptable;
inline.text = inline.normal.text;
inline.url = inline.normal.url;
}
if (options.pedantic) {
inline.em = inline.pedantic.em;
inline.strong = inline.pedantic.strong;
} else {
inline.em = inline.normal.em;
inline.strong = inline.normal.strong;
}
}
>>>>>>> |
<<<<<<<
catch (e) {
if (appInsights) appInsights.trackEvent("isError exception");
if (appInsights) appInsights.trackEvent("isError exception with error", e);
}
=======
>>>>>>>
<<<<<<<
var errback = function (err) {
if (appInsights) appInsights.trackEvent("parseError errback");
stack = [JSON.stringify(exception, null, 2), "Parsing error:", JSON.stringify(err, null, 2)];
errorHandler(eventName, stack);
=======
// exception - an exception object
// message - a string describing the error
// handler - function to call with parsed error
var parse = function (exception, message, handler) {
var stack;
var exceptionMessage = Errors.getErrorMessage(exception);
var eventName = Errors.joinArray([message, exceptionMessage], ' : ');
if (!eventName) {
eventName = "Unknown exception";
}
var callback = function (stackframes) {
stack = filterStack(stackframes).map(function (sf) {
return sf.toString();
});
handler(eventName, stack);
};
var errback = function (err) {
appInsights.trackEvent("Errors.parse errback");
stack = [JSON.stringify(exception, null, 2), "Parsing error:", JSON.stringify(err, null, 2)];
handler(eventName, stack);
};
// TODO: Move filter from callbacks into gets
if (!Errors.isError(exception)) {
StackTrace.get().then(callback).catch(errback);
} else {
StackTrace.fromError(exception).then(callback).catch(errback);
}
};
var getErrorMessage = function (error) {
if (!error) return '';
if (Object.prototype.toString.call(error) === "[object String]") return error;
if (Object.prototype.toString.call(error) === "[object Number]") return error.toString();
if ("message" in error) return error.message;
if ("description" in error) return error.description;
return JSON.stringify(error, null, 2);
>>>>>>>
// exception - an exception object
// message - a string describing the error
// handler - function to call with parsed error
var parse = function (exception, message, handler) {
var stack;
var exceptionMessage = Errors.getErrorMessage(exception);
var eventName = Errors.joinArray([message, exceptionMessage], ' : ');
if (!eventName) {
eventName = "Unknown exception";
}
var callback = function (stackframes) {
stack = filterStack(stackframes).map(function (sf) {
return sf.toString();
});
handler(eventName, stack);
};
var errback = function (err) {
if (appInsights) appInsights.trackEvent("parseError errback");
stack = [JSON.stringify(exception, null, 2), "Parsing error:", JSON.stringify(err, null, 2)];
handler(eventName, stack);
};
// TODO: Move filter from callbacks into gets
if (!Errors.isError(exception)) {
StackTrace.get().then(callback).catch(errback);
} else {
StackTrace.fromError(exception).then(callback).catch(errback);
}
};
var getErrorMessage = function (error) {
if (!error) return '';
if (Object.prototype.toString.call(error) === "[object String]") return error;
if (Object.prototype.toString.call(error) === "[object Number]") return error.toString();
if ("message" in error) return error.message;
if ("description" in error) return error.description;
return JSON.stringify(error, null, 2); |
<<<<<<<
assert.rowsEqual(received.parseHeader(broke3), {
"date": "Invalid Date",
=======
assert.propEqual(received.parseHeader(broke3), {
"date": "4/21/2018 8:00:00 PM",
"dateNum": 1524355200000,
>>>>>>>
assert.rowsEqual(received.parseHeader(broke3), {
"date": "4/21/2018 8:00:00 PM",
"dateNum": 1524355200000, |
<<<<<<<
dateString: dateString, // For testing only
computeTime: computeTime, // For testing only
toString: function () {
if (!exists()) return "";
var ret = ["Received"];
receivedRows.forEach(function (row) {
ret.push(row);
})
return ret.join("\n");
}
};
=======
computeTime: computeTime // For testing only
}
>>>>>>>
computeTime: computeTime, // For testing only
toString: function () {
if (!exists()) return "";
var ret = ["Received"];
receivedRows.forEach(function (row) {
ret.push(row);
})
return ret.join("\n");
}
}; |
<<<<<<<
.style("stroke", (stroke === undefined || stroke === null) ? "none" : stroke)
.style("opacity", function(d, i) {
return opacities[i]
});
=======
.style("stroke", stroke)
.style("opacity", opacity);
>>>>>>>
.style("stroke", stroke)
.style("opacity", function(d, i) {
return opacities[i]
}); |
<<<<<<<
workers: 0,
key: '',
cert: '',
pfx: '',
passphrase: '',
ca: [],
crl: [],
ciphers: '',
handshakeTimeout: 0,
honorCipherOrder: 0,
requestCert: 0,
rejectUnauthorized: 0,
NPNProtocols: [],
SNICallback: function() {},
sessionIdContext: '',
secureProtocol: ''
=======
workers: 0,
delayRespawn: 0,
maxRespawn: -1
>>>>>>>
workers: 0,
delayRespawn: 0,
maxRespawn: -1,
key: '',
cert: '',
pfx: '',
passphrase: '',
ca: [],
crl: [],
ciphers: '',
handshakeTimeout: 0,
honorCipherOrder: 0,
requestCert: 0,
rejectUnauthorized: 0,
NPNProtocols: [],
SNICallback: function() {},
sessionIdContext: '',
secureProtocol: ''
<<<<<<<
* @option host {string} HTTP host name to accept connections on. Defaults to
* '0.0.0.0' (INADDR_ANY).
* @option port {number} HTTP port to accept connections on. Defaults to 80.
* @option path {string} URL path to accept requests to. Defaults to '/beacon'.
* @option referer {regexp} HTTP referers to accept requests from. Defaults to `.*`.
* @option origin {string|array} URL(s) for the Access-Control-Allow-Origin header.
* @option limit {number} Minimum elapsed time between requests from the same IP
* address. Defaults to 0.
* @option maxSize {number} Maximum body size for POST requests.
* @option log {object} Object with `info` and `error` log functions.
* @option validator {string} Validator used to accept or reject beacon requests,
* loaded with `require`. Defaults to 'permissive'.
* @option filter {string} Filter used to purge unwanted data, loaded with `require`.
* Defaults to `unfiltered`.
* @option mapper {string} Data mapper used to transform data before forwarding,
* loaded with `require`. Defaults to 'statsd'.
* @option prefix {string} Prefix to use for mapped metric names. Defaults to ''.
* @option svgTemplate {string} Path to alternative SVG handlebars template file (SVG mapper only).
* @option svgSettings {string} Path to alternative SVG settings JSON file (SVG mapper only).
* @option forwarder {string} Forwarder used to send data, loaded with `require`.
* Defaults to 'udp'.
* @option fwdHost {string} Host name to forward mapped data to (UDP only).
* @option fwdPort {number} Port to forward mapped data on (UDP only).
* @option fwdSize {bytes} Maximum allowable packet size for data forwarding (UDP only).
* @option fwdUrl {string} URL to forward mapped data to (HTTP only).
* @option fwdMethod {string} Method to forward mapped data with (HTTP only).
* @option fwdDir {string} Directory to write mapped data to (file forwarder only).
* @option workers {number} Number of child worker processes to fork. Defaults to 0.
* @option key {string} Private key for secure connection. Defaults to ''.
* @option cert {string} Public key for secure connection. Defaults to ''.
* @option pfx {string} String containing the private key, certificate and CA certs of the
* server in PFX or PKCS12 format. Defaults to ''.
* @option passphrase {string} Passphrase for the private key or pfx. Defaults to ''.
* @option ca {array} Array of strings of trusted certificates in PEM format. Defaults to
* empty array.
* @option crl {array} Array of strings of PEM encoded CRLs. Defaults to empty array.
* @option ciphers {string} String describing the ciphers to use or exclude. Defaults to
* "AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH".
* @option handshakeTimeout {milliseconds} Abort the connection if the SSL/TLS handshake does not
* finish in this many milliseconds. Defaults to 120.
* @option honorCipherOrder {number} Use the cipher order added with the ciphers argument. Defaults
* to 0.
* @option requestCert {number} If 1, the server will request a certificate from clients that connect
* and attempt to verify that certificate. Defaults to 0.
* @option rejectUnauthorized {number} If 1, the server will reject any connection which is not authorized
* with the list of supplied CAs. Defaults to 0.
* @option NPNProtocols {array} Array of possible NPN protocols. Defaults to empty array.
* @option SNICallback {function} Function that will be called if client supports SNI TLS extension.
* @option sessionIdContext {string} String containing a opaque identifier for session resumption.
* Defaults to MD5 hash value generated from command-line, otherwise,
* the default is not provided.
* @option secureProtocol {string} SSL method to use.
=======
* @option host {string} HTTP host name to accept connections on. Defaults to
* '0.0.0.0' (INADDR_ANY).
* @option port {number} HTTP port to accept connections on. Defaults to 80.
* @option path {string} URL path to accept requests to. Defaults to '/beacon'.
* @option referer {regexp} HTTP referers to accept requests from. Defaults to `.*`.
* @option origin {string|array} URL(s) for the Access-Control-Allow-Origin header.
* @option limit {number} Minimum elapsed time between requests from the same IP
* address. Defaults to 0.
* @option maxSize {number} Maximum body size for POST requests.
* @option log {object} Object with `info` and `error` log functions.
* @option validator {string} Validator used to accept or reject beacon requests,
* loaded with `require`. Defaults to 'permissive'.
* @option filter {string} Filter used to purge unwanted data, loaded with `require`.
* Defaults to `unfiltered`.
* @option mapper {string} Data mapper used to transform data before forwarding,
* loaded with `require`. Defaults to 'statsd'.
* @option prefix {string} Prefix to use for mapped metric names. Defaults to ''.
* @option svgTemplate {string} Path to alternative SVG handlebars template file (SVG mapper only).
* @option svgSettings {string} Path to alternative SVG settings JSON file (SVG mapper only).
* @option forwarder {string} Forwarder used to send data, loaded with `require`.
* Defaults to 'udp'.
* @option fwdHost {string} Host name to forward mapped data to (UDP only).
* @option fwdPort {number} Port to forward mapped data on (UDP only).
* @option fwdSize {bytes} Maximum allowable packet size for data forwarding (UDP only).
* @option fwdUrl {string} URL to forward mapped data to (HTTP only).
* @option fwdMethod {string} Method to forward mapped data with (HTTP only).
* @option fwdDir {string} Directory to write mapped data to (file forwarder only).
* @option workers {number} Number of child worker processes to fork. Defaults to 0.
* @option delayRespawn {number} Number of milliseconds to delay respawning. Defaults to 0.
* @option maxRespawn {number} Maximum number of respawn attempts. Defaults to -1.
>>>>>>>
* @option host {string} HTTP host name to accept connections on. Defaults to
* '0.0.0.0' (INADDR_ANY).
* @option port {number} HTTP port to accept connections on. Defaults to 80.
* @option path {string} URL path to accept requests to. Defaults to '/beacon'.
* @option referer {regexp} HTTP referers to accept requests from. Defaults to `.*`.
* @option origin {string|array} URL(s) for the Access-Control-Allow-Origin header.
* @option limit {number} Minimum elapsed time between requests from the same IP
* address. Defaults to 0.
* @option maxSize {number} Maximum body size for POST requests.
* @option log {object} Object with `info` and `error` log functions.
* @option validator {string} Validator used to accept or reject beacon requests,
* loaded with `require`. Defaults to 'permissive'.
* @option filter {string} Filter used to purge unwanted data, loaded with `require`.
* Defaults to `unfiltered`.
* @option mapper {string} Data mapper used to transform data before forwarding,
* loaded with `require`. Defaults to 'statsd'.
* @option prefix {string} Prefix to use for mapped metric names. Defaults to ''.
* @option svgTemplate {string} Path to alternative SVG handlebars template file (SVG mapper only).
* @option svgSettings {string} Path to alternative SVG settings JSON file (SVG mapper only).
* @option forwarder {string} Forwarder used to send data, loaded with `require`.
* Defaults to 'udp'.
* @option fwdHost {string} Host name to forward mapped data to (UDP only).
* @option fwdPort {number} Port to forward mapped data on (UDP only).
* @option fwdSize {bytes} Maximum allowable packet size for data forwarding (UDP only).
* @option fwdUrl {string} URL to forward mapped data to (HTTP only).
* @option fwdMethod {string} Method to forward mapped data with (HTTP only).
* @option fwdDir {string} Directory to write mapped data to (file forwarder only).
* @option workers {number} Number of child worker processes to fork. Defaults to 0.
* @option delayRespawn {number} Number of milliseconds to delay respawning. Defaults to 0.
* @option maxRespawn {number} Maximum number of respawn attempts. Defaults to -1.
* @option key {string} Private key for secure connection. Defaults to ''.
* @option cert {string} Public key for secure connection. Defaults to ''.
* @option pfx {string} String containing the private key, certificate and CA certs of the
* server in PFX or PKCS12 format. Defaults to ''.
* @option passphrase {string} Passphrase for the private key or pfx. Defaults to ''.
* @option ca {array} Array of strings of trusted certificates in PEM format. Defaults to
* empty array.
* @option crl {array} Array of strings of PEM encoded CRLs. Defaults to empty array.
* @option ciphers {string} String describing the ciphers to use or exclude. Defaults to
* "AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH".
* @option handshakeTimeout {milliseconds} Abort the connection if the SSL/TLS handshake does not
* finish in this many milliseconds. Defaults to 120.
* @option honorCipherOrder {number} Use the cipher order added with the ciphers argument. Defaults
* to 0.
* @option requestCert {number} If 1, the server will request a certificate from clients that connect
* and attempt to verify that certificate. Defaults to 0.
* @option rejectUnauthorized {number} If 1, the server will reject any connection which is not authorized
* with the list of supplied CAs. Defaults to 0.
* @option NPNProtocols {array} Array of possible NPN protocols. Defaults to empty array.
* @option SNICallback {function} Function that will be called if client supports SNI TLS extension.
* @option sessionIdContext {string} String containing a opaque identifier for session resumption.
* Defaults to MD5 hash value generated from command-line, otherwise,
* the default is not provided.
* @option secureProtocol {string} SSL method to use. |
<<<<<<<
var crc32fn = require('./crc32');
var utf8 = require('./utf8');
var compressions = require('./compressions');
=======
var jszipProto = require('./object');
var support = require('./support');
>>>>>>>
var crc32fn = require('./crc32');
var utf8 = require('./utf8');
var compressions = require('./compressions');
var support = require('./support');
<<<<<<<
// the fileName is stored as binary data, the handleUTF8 method will take care of the encoding.
this.fileName = reader.readData(this.fileNameLength);
=======
this.fileName = reader.readData(this.fileNameLength);
>>>>>>>
// the fileName is stored as binary data, the handleUTF8 method will take care of the encoding.
this.fileName = reader.readData(this.fileNameLength);
<<<<<<<
throw new Error("Corrupted zip : compression " + utils.pretty(this.compressionMethod) + " unknown (inner file : " + utils.transformTo("string", this.fileName) + ")");
=======
throw new Error("Corrupted zip : compression " + utils.pretty(this.compressionMethod) + " unknown (inner file : " + utils.transformTo("string", this.fileName) + ")");
}
this.decompressed = new CompressedObject();
this.decompressed.compressedSize = this.compressedSize;
this.decompressed.uncompressedSize = this.uncompressedSize;
this.decompressed.crc32 = this.crc32;
this.decompressed.compressionMethod = this.compressionMethod;
this.decompressed.getCompressedContent = this.prepareCompressedContent(reader, reader.index, this.compressedSize, compression);
this.decompressed.getContent = this.prepareContent(reader, reader.index, this.compressedSize, compression, this.uncompressedSize);
// we need to compute the crc32...
if (this.loadOptions.checkCRC32) {
this.decompressed = utils.transformTo("string", this.decompressed.getContent());
if (jszipProto.crc32(this.decompressed) !== this.crc32) {
throw new Error("Corrupted zip : CRC32 mismatch");
}
>>>>>>>
throw new Error("Corrupted zip : compression " + utils.pretty(this.compressionMethod) + " unknown (inner file : " + utils.transformTo("string", this.fileName) + ")");
<<<<<<<
// will be read in the local part, see the comments there
reader.skip(fileNameLength);
=======
this.fileName = reader.readData(this.fileNameLength);
>>>>>>>
// will be read in the local part, see the comments there
reader.skip(fileNameLength);
<<<<<<<
this.fileNameStr = utf8.utf8decode(this.fileName);
this.fileCommentStr = utf8.utf8decode(this.fileComment);
=======
this.fileNameStr = jszipProto.utf8decode(this.fileName);
this.fileCommentStr = jszipProto.utf8decode(this.fileComment);
>>>>>>>
this.fileNameStr = utf8.utf8decode(this.fileName);
this.fileCommentStr = utf8.utf8decode(this.fileComment);
<<<<<<<
this.fileNameStr = upath;
} else {
// ASCII text or unsupported code page
this.fileNameStr = utils.transformTo("string", this.fileName);
=======
this.fileNameStr = upath;
} else {
var fileNameByteArray = utils.transformTo(decodeParamType, this.fileName);
this.fileNameStr = this.loadOptions.decodeFileName(fileNameByteArray);
>>>>>>>
this.fileNameStr = upath;
} else {
// ASCII text or unsupported code page
var fileNameByteArray = utils.transformTo(decodeParamType, this.fileName);
this.fileNameStr = this.loadOptions.decodeFileName(fileNameByteArray);
<<<<<<<
this.fileCommentStr = ucomment;
} else {
// ASCII text or unsupported code page
this.fileCommentStr = utils.transformTo("string", this.fileComment);
=======
this.fileCommentStr = ucomment;
} else {
var commentByteArray = utils.transformTo(decodeParamType, this.fileComment);
this.fileCommentStr = this.loadOptions.decodeFileName(commentByteArray);
>>>>>>>
this.fileCommentStr = ucomment;
} else {
// ASCII text or unsupported code page
var commentByteArray = utils.transformTo(decodeParamType, this.fileComment);
this.fileCommentStr = this.loadOptions.decodeFileName(commentByteArray); |
<<<<<<<
exports.arrayBuffer2Blob = function(buffer) {
return exports.newBlob(buffer, "application/zip");
};
/**
* Create a new blob with the given content and the given type.
* @param {String|ArrayBuffer} part the content to put in the blob. DO NOT use
* an Uint8Array because the stock browser of android 4 won't accept it (it
* will be silently converted to a string, "[object Uint8Array]").
* @param {String} type the mime type of the blob.
* @return {Blob} the created blob.
*/
exports.newBlob = function(part, type) {
=======
exports.arrayBuffer2Blob = function(buffer, mimeType) {
>>>>>>>
/**
* Create a new blob with the given content and the given type.
* @param {String|ArrayBuffer} part the content to put in the blob. DO NOT use
* an Uint8Array because the stock browser of android 4 won't accept it (it
* will be silently converted to a string, "[object Uint8Array]").
* @param {String} type the mime type of the blob.
* @return {Blob} the created blob.
*/
exports.newBlob = function(part, type) {
<<<<<<<
return new Blob([part], {
type: type
=======
return new Blob([buffer], {
type: mimeType
>>>>>>>
return new Blob([part], {
type: type
<<<<<<<
builder.append(part);
return builder.getBlob(type);
=======
builder.append(buffer);
return builder.getBlob(mimeType);
>>>>>>>
builder.append(part);
return builder.getBlob(type); |
<<<<<<<
},
/**
Handle AddRelation messages
@method handleClientAddRelation
@param {Object} data The contents of the API arguments.
@param {Object} client The active ClientConnection.
@param {Object} state An instance of FakeBackend.
@return {undefined} Side effects only.
*/
handleClientAddRelation: function(data, client, state) {
var stateResp = state.addRelation(
data.Params.Endpoints[0], data.Params.Endpoints[1]);
var resp = {RequestId: data.RequestId};
if (stateResp === false) {
// Everything checks out but could not create a new relation model.
resp.Error = 'Unable to create relation';
client.receive(resp);
return;
}
if (stateResp.error) {
resp.Error = stateResp.error;
client.receive(resp);
return;
}
var endpoints = {},
epA = {
Name: stateResp.endpoints[0][1].name,
Scope: stateResp.scope,
Interface: '',
Role: ''
},
epB = {
Name: stateResp.endpoints[1][1].name,
Scope: stateResp.scope,
Interface: '',
Role: ''
};
endpoints[stateResp.endpoints[0][0]] = epA;
endpoints[stateResp.endpoints[1][0]] = epB;
resp.Response = {
Params: {
Endpoints: endpoints
}
};
client.receive(resp);
},
/**
Handle DestroyRelation messages
@method handleClientDestroyRelation
@param {Object} data The contents of the API arguments.
@param {Object} client The active ClientConnection.
@param {Object} state An instance of FakeBackend.
@return {undefined} Side effects only.
*/
handleClientDestroyRelation: function(data, client, state) {
var stateResp = state.removeRelation(
data.Params.Endpoints[0], data.Params.Endpoints[1]);
var resp = {RequestId: data.RequestId};
if (stateResp.error) {
resp.Error = stateResp.error;
}
client.receive(resp);
=======
},
/**
Handle AddServiceUnits messages
@method handleClientAddServiceUnits
@param {Object} data The contents of the API arguments.
@param {Object} client The active ClientConnection.
@param {Object} state An instance of FakeBackend.
@return {undefined} Side effects only.
*/
handleClientAddServiceUnits: function(data, client, state) {
var reply = state.addUnit(data.Params.ServiceName, data.Params.NumUnits);
var units = [];
if (!reply.error) {
units = reply.units.map(function(u) {return u.id;});
}
client.receive({
RequestId: data.RequestId,
Error: reply.error,
Response: {Units: units}
});
},
/**
Handle ServiceExpose messages
@method handleClientServiceExpose
@param {Object} data The contents of the API arguments.
@param {Object} client The active ClientConnection.
@param {Object} state An instance of FakeBackend.
@return {undefined} Side effects only.
*/
handleClientServiceExpose: function(data, client, state) {
var reply = state.expose(data.Params.ServiceName);
client.receive({
RequestId: data.RequestId,
Error: reply.error,
Response: {}});
},
/**
Handle ServiceUnexpose messages
@method handleClientServiceUnexpose
@param {Object} data The contents of the API arguments.
@param {Object} client The active ClientConnection.
@param {Object} state An instance of FakeBackend.
@return {undefined} Side effects only.
*/
handleClientServiceUnexpose: function(data, client, state) {
var reply = state.unexpose(data.Params.ServiceName);
client.receive({
RequestId: data.RequestId,
Error: reply.error,
Response: {}});
>>>>>>>
},
/**
Handle AddServiceUnits messages
@method handleClientAddServiceUnits
@param {Object} data The contents of the API arguments.
@param {Object} client The active ClientConnection.
@param {Object} state An instance of FakeBackend.
@return {undefined} Side effects only.
*/
handleClientAddServiceUnits: function(data, client, state) {
var reply = state.addUnit(data.Params.ServiceName, data.Params.NumUnits);
var units = [];
if (!reply.error) {
units = reply.units.map(function(u) {return u.id;});
}
client.receive({
RequestId: data.RequestId,
Error: reply.error,
Response: {Units: units}
});
},
/**
Handle ServiceExpose messages
@method handleClientServiceExpose
@param {Object} data The contents of the API arguments.
@param {Object} client The active ClientConnection.
@param {Object} state An instance of FakeBackend.
@return {undefined} Side effects only.
*/
handleClientServiceExpose: function(data, client, state) {
var reply = state.expose(data.Params.ServiceName);
client.receive({
RequestId: data.RequestId,
Error: reply.error,
Response: {}});
},
/**
Handle ServiceUnexpose messages
@method handleClientServiceUnexpose
@param {Object} data The contents of the API arguments.
@param {Object} client The active ClientConnection.
@param {Object} state An instance of FakeBackend.
@return {undefined} Side effects only.
*/
handleClientServiceUnexpose: function(data, client, state) {
var reply = state.unexpose(data.Params.ServiceName);
client.receive({
RequestId: data.RequestId,
Error: reply.error,
Response: {}});
},
/**
Handle AddRelation messages
@method handleClientAddRelation
@param {Object} data The contents of the API arguments.
@param {Object} client The active ClientConnection.
@param {Object} state An instance of FakeBackend.
@return {undefined} Side effects only.
*/
handleClientAddRelation: function(data, client, state) {
var stateResp = state.addRelation(
data.Params.Endpoints[0], data.Params.Endpoints[1]);
var resp = {RequestId: data.RequestId};
if (stateResp === false) {
// Everything checks out but could not create a new relation model.
resp.Error = 'Unable to create relation';
client.receive(resp);
return;
}
if (stateResp.error) {
resp.Error = stateResp.error;
client.receive(resp);
return;
}
var endpoints = {},
epA = {
Name: stateResp.endpoints[0][1].name,
Scope: stateResp.scope,
Interface: '',
Role: ''
},
epB = {
Name: stateResp.endpoints[1][1].name,
Scope: stateResp.scope,
Interface: '',
Role: ''
};
endpoints[stateResp.endpoints[0][0]] = epA;
endpoints[stateResp.endpoints[1][0]] = epB;
resp.Response = {
Params: {
Endpoints: endpoints
}
};
client.receive(resp);
},
/**
Handle DestroyRelation messages
@method handleClientDestroyRelation
@param {Object} data The contents of the API arguments.
@param {Object} client The active ClientConnection.
@param {Object} state An instance of FakeBackend.
@return {undefined} Side effects only.
*/
handleClientDestroyRelation: function(data, client, state) {
var stateResp = state.removeRelation(
data.Params.Endpoints[0], data.Params.Endpoints[1]);
var resp = {RequestId: data.RequestId};
if (stateResp.error) {
resp.Error = stateResp.error;
}
client.receive(resp); |
<<<<<<<
addNotification: React.PropTypes.func.isRequired,
apiUrl: React.PropTypes.string.isRequired,
changeState: React.PropTypes.func.isRequired,
entityModel: React.PropTypes.object.isRequired,
getDiagramURL: React.PropTypes.func.isRequired,
getFile: React.PropTypes.func.isRequired,
hasPlans: React.PropTypes.bool.isRequired,
hash: React.PropTypes.string,
plans: React.PropTypes.array,
pluralize: React.PropTypes.func.isRequired,
renderMarkdown: React.PropTypes.func.isRequired,
scrollCharmbrowser: React.PropTypes.func.isRequired,
showTerms: React.PropTypes.func.isRequired
=======
addNotification: PropTypes.func.isRequired,
apiUrl: PropTypes.string.isRequired,
changeState: PropTypes.func.isRequired,
entityModel: PropTypes.object.isRequired,
flags: PropTypes.object,
getFile: PropTypes.func.isRequired,
hasPlans: PropTypes.bool.isRequired,
hash: PropTypes.string,
plans: PropTypes.array,
pluralize: PropTypes.func.isRequired,
renderMarkdown: PropTypes.func.isRequired,
scrollCharmbrowser: PropTypes.func.isRequired,
showTerms: PropTypes.func.isRequired
>>>>>>>
addNotification: React.PropTypes.func.isRequired,
apiUrl: React.PropTypes.string.isRequired,
changeState: React.PropTypes.func.isRequired,
entityModel: React.PropTypes.object.isRequired,
flags: PropTypes.object,
getDiagramURL: React.PropTypes.func.isRequired,
getFile: React.PropTypes.func.isRequired,
hasPlans: React.PropTypes.bool.isRequired,
hash: React.PropTypes.string,
plans: React.PropTypes.array,
pluralize: React.PropTypes.func.isRequired,
renderMarkdown: React.PropTypes.func.isRequired,
scrollCharmbrowser: React.PropTypes.func.isRequired,
showTerms: React.PropTypes.func.isRequired |
<<<<<<<
icon = ev.currentTarget.one('i');
if (el.getStyle('height') === '0px') {
el.show('sizeIn', {duration: 0.25, width: null});
icon.replaceClass('icon-chevron-up', 'icon-chevron-down');
} else {
el.hide('sizeOut', {duration: 0.25, width: null});
icon.replaceClass('icon-chevron-down', 'icon-chevron-up');
}
},
setScroll = function(container, height) {
var scrollContainer = container.one('.charm-panel');
if (scrollContainer && height) {
var diff = scrollContainer.getY() - container.getY(),
clientDiff = (
scrollContainer.get('clientHeight') -
parseInt(scrollContainer.getComputedStyle('height'), 10)),
scrollHeight = height - diff - clientDiff;
scrollContainer.setStyle('height', scrollHeight + 'px');
}
};
=======
icon = ev.currentTarget.one('i');
icon = ev.currentTarget.one('i');
if (el.getStyle('height') === '0px') {
el.show('sizeIn', {duration: 0.25, width: null});
icon.replaceClass('icon-chevron-up', 'icon-chevron-down');
} else {
el.hide('sizeOut', {duration: 0.25, width: null});
icon.replaceClass('icon-chevron-down', 'icon-chevron-up');
}
};
>>>>>>>
icon = ev.currentTarget.one('i');
if (el.getStyle('height') === '0px') {
el.show('sizeIn', {duration: 0.25, width: null});
icon.replaceClass('icon-chevron-up', 'icon-chevron-down');
} else {
el.hide('sizeOut', {duration: 0.25, width: null});
icon.replaceClass('icon-chevron-down', 'icon-chevron-up');
}
},
setScroll = function(container, height) {
var scrollContainer = container.one('.charm-panel');
if (scrollContainer && height) {
var diff = scrollContainer.getY() - container.getY(),
clientDiff = (
scrollContainer.get('clientHeight') -
parseInt(scrollContainer.getComputedStyle('height'), 10)),
scrollHeight = height - diff - clientDiff;
scrollContainer.setStyle('height', scrollHeight + 'px');
}
};
<<<<<<<
subscriptions.push(searchField.on('keydown', handleKeyDown));
subscriptions.push(searchField.on('blur', handleBlur));
subscriptions.push(searchField.on('focus', handleFocus));
=======
searchField.on('keydown', handleKeyDown);
>>>>>>>
subscriptions.push(searchField.on('keydown', handleKeyDown)); |
<<<<<<<
'.btn#charm-deploy': {click: 'onCharmDeployClicked'},
'.remove-config-file': {click: 'onFileRemove'},
'.charm-section h4': {click: 'toggleSectionVisibility'},
'.config-file-upload': {change: 'onFileChange'},
},
onFileChange: function(evt) {
console.log("onFileChange:", evt);
this.fileInput = evt.target;
var file = this.fileInput.get('files').shift(),
reader = new FileReader();
reader.onerror = Y.bind(this.onFileError, this);
reader.onload = Y.bind(this.onFileLoaded, this);
reader.readAsText(file);
},
onFileRemove: function(evt) {
this.configFileContent = null;
// TODO tell the file input that the file is gone
// TODO hide "Remove configuration file" button
// TODO show file input element
this.get('container').one('charm-settings').show();
},
onFileLoaded: function(evt) {
this.configFileContent = evt.target.result;
this.get('container').one('.charm-settings').hide();
this.get('container').one('.remove-config-file')
.removeClass('hidden');
// TODO add "Remove configuration file" button
console.log(this.configFileContent);
},
onFileError: function(evt) {
// TODO show error message
},
// TODO this is (almost) a duplicate of the same function in the
// search pane, unify them.
toggleSectionVisibility: function(ev) {
var el = ev.currentTarget.ancestor('.charm-section')
.one('.collapsible'),
icon = ev.currentTarget.one('i');
if (el.getStyle('display') === 'none') {
// sizeIn doesn't work smoothly without this bit of jiggery to get
// accurate heights and widths.
el.setStyles({height: null, width: null, display: 'block'});
var config =
{ duration: 0.25,
height: el.get('scrollHeight') + 'px',
width: el.get('scrollWidth') + 'px'
};
// Now we need to set our starting point.
el.setStyles({height: 0, width: config.width});
el.show('sizeIn', config);
icon.replaceClass('icon-chevron-right', 'icon-chevron-down');
} else {
el.hide('sizeOut', {duration: 0.25});
icon.replaceClass('icon-chevron-down', 'icon-chevron-right');
}
=======
'.btn': {click: 'onCharmDeployClicked'},
'.charm-section h4': {click: toggleSectionVisibility}
>>>>>>>
'.btn#charm-deploy': {click: 'onCharmDeployClicked'},
'.remove-config-file': {click: 'onFileRemove'},
'.charm-section h4': {click: 'toggleSectionVisibility'},
'.config-file-upload': {change: 'onFileChange'},
},
onFileChange: function(evt) {
console.log("onFileChange:", evt);
this.fileInput = evt.target;
var file = this.fileInput.get('files').shift(),
reader = new FileReader();
reader.onerror = Y.bind(this.onFileError, this);
reader.onload = Y.bind(this.onFileLoaded, this);
reader.readAsText(file);
},
onFileRemove: function(evt) {
this.configFileContent = null;
// TODO tell the file input that the file is gone
// TODO hide "Remove configuration file" button
// TODO show file input element
this.get('container').one('charm-settings').show();
},
onFileLoaded: function(evt) {
this.configFileContent = evt.target.result;
this.get('container').one('.charm-settings').hide();
this.get('container').one('.remove-config-file')
.removeClass('hidden');
// TODO add "Remove configuration file" button
console.log(this.configFileContent);
},
onFileError: function(evt) {
// TODO show error message
},
// TODO this is (almost) a duplicate of the same function in the
// search pane, unify them.
toggleSectionVisibility: function(ev) {
var el = ev.currentTarget.ancestor('.charm-section')
.one('.collapsible'),
icon = ev.currentTarget.one('i');
if (el.getStyle('display') === 'none') {
// sizeIn doesn't work smoothly without this bit of jiggery to get
// accurate heights and widths.
el.setStyles({height: null, width: null, display: 'block'});
var config =
{ duration: 0.25,
height: el.get('scrollHeight') + 'px',
width: el.get('scrollWidth') + 'px'
};
// Now we need to set our starting point.
el.setStyles({height: 0, width: config.width});
el.show('sizeIn', config);
icon.replaceClass('icon-chevron-right', 'icon-chevron-down');
} else {
el.hide('sizeOut', {duration: 0.25});
icon.replaceClass('icon-chevron-down', 'icon-chevron-right');
}
<<<<<<<
// XXX: Look in utils for validator called 'validate'.
// TODO select the right config, use a file if they uploaded one,
// otherwise scrape out the config form and use those values
=======
>>>>>>>
// TODO select the right config, use a file if they uploaded one,
// otherwise scrape out the config form and use those values |
<<<<<<<
const loginToController = controllerAPI.loginWithMacaroon.bind(
controllerAPI, this.bakery);
=======
const controllerIsAvailable = () =>
this.controllerAPI &&
this.controllerAPI.get('connected') &&
this.controllerAPI.userIsAuthenticated;
const loginToController =
controllerAPI.loginWithMacaroon.bind(
controllerAPI, this.bakeryFactory.get('juju'));
>>>>>>>
const controllerIsAvailable = () =>
this.controllerAPI &&
this.controllerAPI.get('connected') &&
this.controllerAPI.userIsAuthenticated;
const loginToController = controllerAPI.loginWithMacaroon.bind(
controllerAPI, this.bakery);
<<<<<<<
this.payment && this.payment.getCountries.bind(this.payment)
|| null}
=======
this.payment && this.payment.getCountries.bind(this.payment)}
getDiagramURL={charmstore.getDiagramURL.bind(charmstore)}
>>>>>>>
this.payment && this.payment.getCountries.bind(this.payment)
|| null}
getDiagramURL={charmstore.getDiagramURL.bind(charmstore)}
<<<<<<<
=======
'modal-gui-settings',
'modal-shortcuts',
'notification',
>>>>>>>
'modal-gui-settings',
'modal-shortcuts', |
<<<<<<<
EnvironmentView = Y.Base.create('EnvironmentView', Y.View, [views.JujuBaseView], {
events: {
'#add-relation-btn': {click: 'add_relation'}
},
=======
var EnvironmentView = Y.Base.create('EnvironmentView', Y.View, [views.JujuBaseView], {
events: {},
>>>>>>>
var EnvironmentView = Y.Base.create('EnvironmentView', Y.View, [views.JujuBaseView], {
events: {
'#add-relation-btn': {click: 'add_relation'}
}, |
<<<<<<<
prettify: {
modules: {
'prettify': {
fullpath: '/juju-ui/assets/javascripts/prettify.js'
}
}
},
=======
jsyaml: {
modules: {
'js-yaml': {
fullpath: '/juju-ui/assets/javascripts/js-yaml.min.js'
}
}
},
>>>>>>>
prettify: {
modules: {
'prettify': {
fullpath: '/juju-ui/assets/javascripts/prettify.js'
}
}
},
jsyaml: {
'js-yaml': {
fullpath: '/juju-ui/assets/javascripts/js-yaml.min.js'
}
},
<<<<<<<
'browser-fileviewer-widget': {
fullpath: '/juju-ui/widgets/fileviewer.js'
},
=======
'browser-search-widget': {
fullpath: '/juju-ui/widgets/charm-search.js'
},
>>>>>>>
'browser-fileviewer-widget': {
fullpath: '/juju-ui/widgets/fileviewer.js'
},
'browser-search-widget': {
fullpath: '/juju-ui/widgets/charm-search.js'
}, |
<<<<<<<
multisig: { Account2fa, MULTISIG_GAS, MULTISIG_DEPOSIT },
=======
InMemorySigner,
keyStores: { InMemoryKeyStore },
multisig: { Account2FA, MULTISIG_GAS, MULTISIG_DEPOSIT },
>>>>>>>
InMemorySigner,
multisig: { Account2FA, MULTISIG_GAS, MULTISIG_DEPOSIT }, |
<<<<<<<
var charmView = new ns.BrowserCharmView({
charm: new models.BrowserCharm(data),
store: this.get('store')
});
charmView.render(tplNode.one('.bws-view-data'), this.isFullscreen());
container.setHTML(tplNode);
=======
this._renderCharmDetails(
new models.BrowserCharm(data),
tplNode);
>>>>>>>
var charmView = new ns.BrowserCharmView({
charm: new models.BrowserCharm(data),
store: this.get('store')
});
charmView.render(tplNode.one('.bws-view-data'), this.isFullscreen());
container.setHTML(tplNode);
<<<<<<<
},
/**
* Check if this view is the fullscreen version to help aid us in
* template work.
*
* @method isFullscreen
* @return {{Bool}}
*
*/
isFullscreen: function() {
if (this.name.indexOf('fullscreen') === -1) {
return false;
} else {
return true;
}
=======
// Hold onto charm data so we can pass model instances to other views when
// charms are selected.
this._cacheCharms = new models.BrowserCharmList();
>>>>>>>
// Hold onto charm data so we can pass model instances to other views when
// charms are selected.
this._cacheCharms = new models.BrowserCharmList();
},
/**
* Check if this view is the fullscreen version to help aid us in
* template work.
*
* @method isFullscreen
* @return {{Bool}}
*
*/
isFullscreen: function() {
if (this.name.indexOf('fullscreen') === -1) {
return false;
} else {
return true;
} |
<<<<<<<
this.get('store').charm(
this.get('storeId'),
{
'success': Y.bind(this.on_charm_data, this),
'failure': function er(e) { console.error(e.error); }
}
);
=======
this.get('charm_store').loadByPath(this.get('charm_data_url'), {
'success': Y.bind(this.on_charm_data, this),
'failure': function er(e) {
console.error(e.error);
}
});
this.get('charm_store').get('datasource').sendRequest({
request: this.get('charm_data_url'),
});
>>>>>>>
this.get('store').charm(
this.get('storeId'),
{
'success': Y.bind(this.on_charm_data, this),
'failure': function er(e) { console.error(e.error); }
}
);
<<<<<<<
// Convert time stamp TODO: should be in db layer
debugger;
var last_modified = charm.last_change.created;
if (last_modified) {
charm.last_change.created = new Date(last_modified * 1000);
}
=======
>>>>>>>
<<<<<<<
on_charm_data: function(data) {
var charm = data.charm;
=======
on_charm_data: function(data) {
data.id = data.store_url;
data.is_subordinate = data.subordinate;
var charm = new Y.juju.models.Charm(data);
>>>>>>>
on_charm_data: function(data) {
data.id = data.store_url;
data.is_subordinate = data.subordinate;
var charm = new Y.juju.models.Charm(data); |
<<<<<<<
charmsGetById={charmsGetById}
=======
>>>>>>>
charmsGetById={charmsGetById}
<<<<<<<
it('can handle the agreements when there are no added apps', function() {
delete groupedChanges['_deploy'];
=======
// Click log in and pass the given error string to the login callback used by
// the component. Return the component instance.
const login = function(err) {
const loginToController = sinon.stub();
const renderer = jsTestUtils.shallowRender(
<juju.components.DeploymentFlow
acl={acl}
changes={{}}
changesFilterByParent={sinon.stub()}
changeState={sinon.stub()}
deploy={sinon.stub()}
generateAllChangeDescriptions={sinon.stub()}
generateCloudCredentialName={sinon.stub()}
getAuth={sinon.stub().returns(false)}
getCloudCredentials={sinon.stub()}
getCloudCredentialNames={sinon.stub()}
getCloudProviderDetails={sinon.stub()}
groupedChanges={groupedChanges}
listBudgets={sinon.stub()}
listClouds={sinon.stub()}
listPlansForCharm={sinon.stub()}
loginToController={loginToController}
modelCommitted={true}
modelName="Pavlova"
servicesGetById={sinon.stub()}
updateCloudCredential={sinon.stub()}
user="user-admin">
<span>content</span>
</juju.components.DeploymentFlow>, true);
const instance = renderer.getMountedInstance();
assert.strictEqual(instance.state.loggedIn, false);
instance.refs = {
modelName: {
getValue: sinon.stub().returns('Lamington')
}
};
const output = renderer.getRenderOutput();
const loginSection = output.props.children[1];
const loginButton = loginSection.props.children.props.children.props;
// Click to log in.
loginButton.action();
assert.strictEqual(loginToController.callCount, 1);
const cb = loginToController.args[0][0];
cb(err);
return instance;
};
it('can login (success)', function() {
const instance = login(null);
assert.strictEqual(instance.state.loggedIn, true);
});
it('can login (failure)', function() {
const instance = login('bad wolf');
assert.strictEqual(instance.state.loggedIn, false);
});
it('can deploy', function() {
var deploy = sinon.stub().callsArg(0);
var changeState = sinon.stub();
>>>>>>>
it('can handle the agreements when there are no added apps', function() {
delete groupedChanges['_deploy'];
<<<<<<<
charmsGetById={charmsGetById}
=======
>>>>>>>
charmsGetById={charmsGetById} |
<<<<<<<
for (var i in iface_decl) {
if (!i)
continue;
result.push({
'name': i,
'interface': iface_decl[i]['interface']});
}
=======
Y.Object.each(iface_decl, function(value, name) {
if (name) {
result.push({
name: name, 'interface': value['interface']
});
}
});
>>>>>>>
Y.Object.each(iface_decl, function(value, name) {
if (name) {
result.push({
name: name, 'interface': value['interface']
});
}
});
<<<<<<<
for (var x = 0, j = result.length; x < j; x++) {
ret = ret + options.fn(result[x]);
}
=======
for (var x = 0, j = result.length; x < j; x += 1) {
ret = ret + options.fn(result[x]);
}
>>>>>>>
for (var x = 0, j = result.length; x < j; x += 1) {
ret = ret + options.fn(result[x]);
}
<<<<<<<
render: function() {
console.log('render', this.get('charm'));
var container = this.get('container');
CharmCollectionView.superclass.render.apply(this, arguments);
if (this.get('charm')) {
var charm = this.get('charm');
// Convert time stamp TODO: should be in db layer
var last_modified = charm.last_change.created;
if (last_modified)
charm.last_change.created = new Date(last_modified * 1000);
container.setHTML(this.template({'charm': charm}));
container.one('#charm-deploy').on(
'click', Y.bind(this.on_charm_deploy, this));
} else {
container.setHTML('<div class="alert">Loading...</div>');
}
return this;
=======
render: function() {
console.log('render', this.get('charm'));
var container = this.get('container');
CharmCollectionView.superclass.render.apply(this, arguments);
if (this.get('charm')) {
var charm = this.get('charm');
// Convert time stamp TODO: should be in db layer
var last_modified = charm.last_change.created;
if (last_modified) {
charm.last_change.created = new Date(last_modified * 1000);
}
container.setHTML(this.template({'charm': charm}));
container.one('#charm-deploy').on(
'click', Y.bind(this.on_charm_deploy, this));
} else {
container.setHTML('<div class="alert">Loading...</div>');
}
return this;
>>>>>>>
render: function() {
console.log('render', this.get('charm'));
var container = this.get('container');
CharmCollectionView.superclass.render.apply(this, arguments);
if (this.get('charm')) {
var charm = this.get('charm');
// Convert time stamp TODO: should be in db layer
var last_modified = charm.last_change.created;
if (last_modified)
charm.last_change.created = new Date(last_modified * 1000);
container.setHTML(this.template({'charm': charm}));
container.one('#charm-deploy').on(
'click', Y.bind(this.on_charm_deploy, this));
} else {
container.setHTML('<div class="alert">Loading...</div>');
}
return this;
<<<<<<<
render: function() {
var container = this.get('container'),
self = this;
CharmCollectionView.superclass.render.apply(this, arguments);
container.setHTML(this.template({'charms': this.get('charms')}));
// TODO: Use view.events structure to attach this
container.all('div.thumbnail').each(function(el ) {
el.on('click', function(evt) {
//console.log('Click', this.getData('charm-url'));
self.fire('showCharm', {charm_data_url: this.getData('charm-url')});
=======
render: function() {
var container = this.get('container'),
self = this;
CharmCollectionView.superclass.render.apply(this, arguments);
container.setHTML(this.template({'charms': this.get('charms')}));
// TODO: Use view.events structure to attach this
container.all('div.thumbnail').each(function(el) {
el.on('click', function(evt) {
self.fire('showCharm', {charm_data_url: this.getData('charm-url')});
>>>>>>>
render: function() {
var container = this.get('container'),
self = this;
CharmCollectionView.superclass.render.apply(this, arguments);
container.setHTML(this.template({'charms': this.get('charms')}));
// TODO: Use view.events structure to attach this
container.all('div.thumbnail').each(function(el ) {
el.on('click', function(evt) {
self.fire('showCharm', {charm_data_url: this.getData('charm-url')});
<<<<<<<
console.log('search update');
if (evt) {
evt.preventDefault();
evt.stopImmediatePropagation();
}
var query = Y.one('#charm-search').get('value');
if (query) {
this.set('query', query);
} else {
query = this.get('query');
}
// The handling in datasources-plugins is an example of doing this a bit better
// ie. io cancellation outstanding requests, it does seem to cause some interference
// with various datasource plugins though.
this.get('charm_store').sendRequest({
request: 'search/json?search_text=' + query,
callback: {
'success': Y.bind(this.on_results_change, this),
'failure': function er(e) { console.error(e.error); }
=======
console.log('search update');
if (evt) {
evt.preventDefault();
evt.stopImmediatePropagation();
}
var query = Y.one('#charm-search').get('value');
if (query) {
this.set('query', query);
} else {
query = this.get('query');
}
// The handling in datasources-plugins is an example of doing this a bit
// better ie. io cancellation outstanding requests, it does seem to
// cause some interference with various datasource plugins though.
this.get('charm_store').sendRequest({
request: 'search/json?search_text=' + query,
callback: {
'success': Y.bind(this.on_results_change, this),
'failure': function er(e) { console.error(e.error); }
>>>>>>>
console.log('search update');
if (evt) {
evt.preventDefault();
evt.stopImmediatePropagation();
}
var query = Y.one('#charm-search').get('value');
if (query) {
this.set('query', query);
} else {
query = this.get('query');
}
// The handling in datasources-plugins is an example of doing this a bit
// better ie. io cancellation outstanding requests, it does seem to
// cause some interference with various datasource plugins though.
this.get('charm_store').sendRequest({
request: 'search/json?search_text=' + query,
callback: {
'success': Y.bind(this.on_results_change, this),
'failure': function er(e) { console.error(e.error); } |
<<<<<<<
{container: container, model: service, db: db,
env: env, querystring: {}}).render();
var rendered_names = container.one(
'ul.thumbnails').all('div.well').get('id');
=======
{ container: container, model: service, app: app,
querystring: {}}).render();
var rendered_names = container.all('div.thumbnail').get('id');
>>>>>>>
{ container: container, model: service, app: app,
querystring: {}}).render();
var rendered_names = container.one(
'ul.thumbnails').all('div.well').get('id');
<<<<<<<
{ container: container, model: service, db: db,
env: env, querystring: {state: 'running'}}).render();
var rendered_names = container.one(
'ul.thumbnails').all('div.well').get('id');
rendered_names.should.eql(['mysql/0', 'mysql/2']);
=======
{ container: container, model: service, app: app,
querystring: {state: 'running'}}).render();
container.all('div.thumbnail').get('id').should.eql(
['mysql/0', 'mysql/2']);
>>>>>>>
{ container: container, model: service, app: app,
querystring: {state: 'running'}}).render();
var rendered_names = container.one(
'ul.thumbnails').all('div.well').get('id');
rendered_names.should.eql(['mysql/0', 'mysql/2']);
<<<<<<<
{ container: container, model: service, db: db,
env: env, querystring: {state: 'pending'}}).render();
var rendered_names = container.one(
'ul.thumbnails').all('div.well').get('id');
rendered_names.should.eql(['mysql/0', 'mysql/2']);
=======
{ container: container, model: service, app: app,
querystring: {state: 'pending'}}).render();
container.all('div.thumbnail').get('id').should.eql(
['mysql/0', 'mysql/2']);
>>>>>>>
{ container: container, model: service, app: app,
querystring: {state: 'pending'}}).render();
var rendered_names = container.one(
'ul.thumbnails').all('div.well').get('id');
rendered_names.should.eql(['mysql/0', 'mysql/2']);
<<<<<<<
{ container: container, model: service, db: db,
env: env, querystring: {state: 'error'}}).render();
var rendered_names = container.one(
'ul.thumbnails').all('div.well').get('id');
rendered_names.should.eql(['mysql/0', 'mysql/2']);
=======
{ container: container, model: service, app: app,
querystring: {state: 'error'}}).render();
container.all('div.thumbnail').get('id').should.eql(
['mysql/0', 'mysql/2']);
>>>>>>>
{ container: container, model: service, app: app,
querystring: {state: 'error'}}).render();
var rendered_names = container.one(
'ul.thumbnails').all('div.well').get('id');
rendered_names.should.eql(['mysql/0', 'mysql/2']); |
<<<<<<<
env = this.get('env');
=======
env = this.get('app').env;
>>>>>>>
env = this.get('app').env;
<<<<<<<
db = this.get('db'),
app = this.get('app');
if (ev.err) {
db.notifications.add(
new models.Notification({
title: 'Error un-exposing service',
message: 'Service name: ' + ev.service_name,
level: 'error',
link: app.getModelURL(service),
modelId: service
})
);
} else {
service.set('exposed', false);
db.fire('update');
}
=======
db = this.get('app').db;
service.set('exposed', false);
db.fire('update');
>>>>>>>
db = this.get('app').db,
app = this.get('app');
if (ev.err) {
db.notifications.add(
new models.Notification({
title: 'Error un-exposing service',
message: 'Service name: ' + ev.service_name,
level: 'error',
link: app.getModelURL(service),
modelId: service
})
);
} else {
service.set('exposed', false);
db.fire('update');
}
<<<<<<<
db = this.get('db'),
app = this.get('app');
if (ev.err) {
db.notifications.add(
new models.Notification({
title: 'Error exposing service',
message: 'Service name: ' + ev.service_name,
level: 'error',
link: app.getModelURL(service),
modelId: service
})
);
} else {
service.set('exposed', true);
db.fire('update');
}
=======
db = this.get('app').db;
service.set('exposed', true);
db.fire('update');
>>>>>>>
db = this.get('app').db,
app = this.get('app');
if (ev.err) {
db.notifications.add(
new models.Notification({
title: 'Error exposing service',
message: 'Service name: ' + ev.service_name,
level: 'error',
link: app.getModelURL(service),
modelId: service
})
);
} else {
service.set('exposed', true);
db.fire('update');
}
<<<<<<<
Y.bind(this._setConstraintsCallback, this, container)
);
},
_setConstraintsCallback: function(container, ev) {
var service = this.get('model'),
env = this.get('env'),
app = this.get('app'),
db = this.get('db');
if (ev.err) {
db.notifications.add(
new models.Notification({
title: 'Error setting service constraints',
message: 'Service name: ' + ev.service_name,
level: 'error',
link: app.getModelURL(service) + 'constraints',
modelId: service
})
);
container.one('#save-service-constraints')
.removeAttribute('disabled');
} else {
env.get_service(
service.get('id'), Y.bind(app.load_service, app));
}
=======
utils.buildRpcHandler({
container: container,
successHandler: function() {
var service = this.get('model'),
app = this.get('app');
app.env.get_service(
service.get('id'), Y.bind(app.load_service, app));
},
errorHandler: function() {
container.one('#save-service-constraints')
.removeAttribute('disabled');
},
scope: this}
));
>>>>>>>
Y.bind(this._setConstraintsCallback, this, container)
);
},
_setConstraintsCallback: function(container, ev) {
var service = this.get('model'),
env = this.get('app').env,
app = this.get('app'),
db = this.get('app').db;
if (ev.err) {
db.notifications.add(
new models.Notification({
title: 'Error setting service constraints',
message: 'Service name: ' + ev.service_name,
level: 'error',
link: app.getModelURL(service) + 'constraints',
modelId: service
})
);
container.one('#save-service-constraints')
.removeAttribute('disabled');
} else {
env.get_service(
service.get('id'), Y.bind(app.load_service, app));
}
<<<<<<<
Y.bind(this._setConfigCallback, this, container)
=======
utils.buildRpcHandler({
container: container,
successHandler: function() {
var service = this.get('model'),
app = this.get('app');
app.env.get_service(
service.get('id'), Y.bind(app.load_service, app));
},
errorHandler: function() {
container.one('#save-service-config')
.removeAttribute('disabled');
},
scope: this}
)
>>>>>>>
Y.bind(this._setConfigCallback, this, container)
<<<<<<<
var db = this.get('db'),
app = this.get('app'),
=======
var db = this.get('app').db,
>>>>>>>
var db = this.get('app').db,
app = this.get('app'),
<<<<<<<
app = this.get('app'),
db = this.get('db'),
=======
db = this.get('app').db,
>>>>>>>
app = this.get('app'),
db = this.get('app').db,
<<<<<<<
app = this.get('app'),
db = this.get('db'),
=======
db = this.get('app').db,
>>>>>>>
app = this.get('app'),
db = this.get('app').db, |
<<<<<<<
_instance = null;
=======
_instance = null,
// Delay between a "keyup" event and the service request
_searchDelay = 500,
// Delay before showing tooltip.
_tooltipDelay = 500;
var toggleSectionVisibility = function(ev) {
var el = ev.currentTarget.ancestor('.charm-section')
.one('.collapsible'),
icon = ev.currentTarget.one('i');
icon = ev.currentTarget.one('i');
if (el.getStyle('height') === '0px') {
el.show('sizeIn', {duration: 0.25, width: null});
icon.replaceClass('icon-chevron-right', 'icon-chevron-down');
} else {
el.hide('sizeOut', {duration: 0.25, width: null});
icon.replaceClass('icon-chevron-down', 'icon-chevron-right');
}
};
>>>>>>>
_instance = null,
// Delay before showing tooltip.
_tooltipDelay = 500;
var toggleSectionVisibility = function(ev) {
var el = ev.currentTarget.ancestor('.charm-section')
.one('.collapsible'),
icon = ev.currentTarget.one('i');
icon = ev.currentTarget.one('i');
if (el.getStyle('height') === '0px') {
el.show('sizeIn', {duration: 0.25, width: null});
icon.replaceClass('icon-chevron-right', 'icon-chevron-down');
} else {
el.hide('sizeOut', {duration: 0.25, width: null});
icon.replaceClass('icon-chevron-down', 'icon-chevron-right');
}
};
<<<<<<<
'.charm-entry .btn': {
click: function(ev) {
var info_url = ev.currentTarget.getData('info-url');
// In the future, fire an event to show the configure pane instead.
this.get('app').fire('showCharm', {charm_data_url: info_url});
}
},
=======
'.charm-entry .btn.deploy': {click: 'showConfiguration'},
'.charms-search-field-div button.clear': {click: 'clearSearch'},
'.charms-search-field': {keyup: 'search'},
>>>>>>>
'.charm-entry .btn.deploy': {click: 'showConfiguration'},
<<<<<<<
=======
showConfiguration: function(ev) {
// Without the ev.halt the 'outside' click handler is getting
// called which immediately closes the panel.
ev.halt();
this.fire(
'changePanel',
{ name: 'configuration',
charmId: ev.currentTarget.getData('url')});
},
>>>>>>>
showConfiguration: function(ev) {
// Without the ev.halt the 'outside' click handler is getting
// called which immediately closes the panel.
ev.halt();
this.fire(
'changePanel',
{ name: 'configuration',
charmId: ev.currentTarget.getData('url')});
},
<<<<<<<
'event-key'
=======
'event-outside',
'widget-anim',
'overlay'
>>>>>>>
'event-key',
'event-outside',
'widget-anim',
'overlay' |
<<<<<<<
// If you're using the new service Inspector then use the deploy method
// from the Y.juju.GhostDeployer extension
if (window.flags && window.flags.serviceInspector) {
cfg.deploy = Y.bind(this.deployService, this);
} else {
cfg.deploy = this.charmPanel.deploy;
}
=======
cfg.deploy = this.charmPanel.deploy;
if (window.flags && window.flags.serviceInspector) {
cfg.deploy = Y.bind(cfg.db.services.ghostService, cfg.db.services);
// Watch specific things, (add units), remove db.update above
// Note: This hides under tha flag as tests don't properly clean
// up sometimes and this binding creates spooky interaction
// at a distance and strange failures.
this.db.services.after(['add', 'remove', '*:change'],
this.on_database_changed, this);
this.db.relations.after(['add', 'remove', '*:change'],
this.on_database_changed, this);
}
>>>>>>>
// If you're using the new service Inspector then use the deploy method
// from the Y.juju.GhostDeployer extension
if (window.flags && window.flags.serviceInspector) {
cfg.deploy = this.charmPanel.deploy;
} else {
cfg.deploy = Y.bind(this.deployService, this);
cfg.deploy = Y.bind(cfg.db.services.ghostService, cfg.db.services);
// Watch specific things, (add units), remove db.update above
// Note: This hides under tha flag as tests don't properly clean
// up sometimes and this binding creates spooky interaction
// at a distance and strange failures.
this.db.services.after(['add', 'remove', '*:change'],
this.on_database_changed, this);
this.db.relations.after(['add', 'remove', '*:change'],
this.on_database_changed, this);
} |
<<<<<<<
Y.log("App: Re-rendering current view " + this.getPath(), "info");
=======
Y.log('App: Rerendering current view ' + this.getPath(), 'info');
>>>>>>>
Y.log('App: Re-rendering current view ' + this.getPath(), 'info');
<<<<<<<
this.showView("service", {model: service, domain_models: this.db,
app: this});
=======
this.showView('service', {model: service, domain_models: this.db});
>>>>>>>
this.showView('service', {model: service, domain_models: this.db,
app: this}); |
<<<<<<<
var EnvironmentView = Y.Base.create('EnvironmentView', Y.View,
[views.JujuBaseView], {
=======
function styleToNumber(selector, style) {
style = style || 'height';
return parseInt(Y.one(selector).getComputedStyle(style), 10);
}
var EnvironmentView = Y.Base.create('EnvironmentView',
Y.View, [views.JujuBaseView], {
>>>>>>>
function styleToNumber(selector, style) {
style = style || 'height';
return parseInt(Y.one(selector).getComputedStyle(style), 10);
}
function relationToId(d) {
return d.source.get('modelId') + ':' + d.target.get('modelId');
}
var EnvironmentView = Y.Base.create('EnvironmentView',
Y.View, [views.JujuBaseView], {
<<<<<<<
width = 640,
fill = d3.scale.category20(),
xscale = d3.scale.linear()
.domain([-width / 2, width / 2])
.range([0, width]),
yscale = d3.scale.linear()
.domain([-height / 2, height / 2])
.range([height, 0]);
this.service_scale_width = d3.scale.log().range([164, 200]),
this.service_scale_height = d3.scale.log().range([64, 100]);
function rescale() {
vis.attr("transform", "translate(" + d3.event.translate + ")"
+ " scale(" + d3.event.scale + ")");
}
=======
width = 640;
var services = m.services.map(function(s) {
s.value = s.get('unit_count');
return s;
});
var relations = m.relations.toArray();
var fill = d3.scale.category20();
var xscale = d3.scale.linear()
.domain([-width / 2, width / 2])
.range([2, width]);
var yscale = d3.scale.linear()
.domain([-height / 2, height / 2])
.range([height, 0]);
// Create a pan/zoom behavior manager.
var zoom = d3.behavior.zoom()
.x(xscale)
.y(yscale)
.scaleExtent([0.25, 1.75])
.on('zoom', function() {
self.rescale(vis, d3.event);
});
self.set('zoom', zoom);
// Scales for unit sizes.
// XXX magic numbers will have to change; likely during
// the UI work
var service_scale_width = d3.scale.log().range([164, 200]);
var service_scale_height = d3.scale.log().range([64, 100]);
>>>>>>>
width = 640,
fill = d3.scale.category20(),
xscale = d3.scale.linear()
.domain([-width / 2, width / 2])
.range([0, width]),
yscale = d3.scale.linear()
.domain([-height / 2, height / 2])
.range([height, 0]);
this.service_scale_width = d3.scale.log().range([164, 200]),
this.service_scale_height = d3.scale.log().range([64, 100]);
// Create a pan/zoom behavior manager.
var zoom = d3.behavior.zoom()
.x(xscale)
.y(yscale)
.scaleExtent([0.25, 1.75])
.on('zoom', function() {
self.rescale(vis, d3.event);
});
this.set('zoom', zoom);
function rescale() {
vis.attr('transform',
'translate(' + d3.event.translate + ')' + ' scale(' + d3.event.scale + ')');
}
// Set up the visualization with a pack layout
var vis = d3.select(container.getDOMNode())
.selectAll('#canvas')
.append('svg:svg')
.attr('pointer-events', 'all')
.attr('width', '100%')
.attr('height', '100%')
.append('svg:g')
.call(zoom)
.append('g');
vis.append('svg:rect')
.attr('width', width)
.attr('height', height)
.attr('fill', 'white');
// Bind visualization resizing on window resize
Y.on('windowresize', function() {
self.setSizesFromViewport(vis, container, xscale, yscale);
});
// If the view is bound to the dom, set sizes from viewport
if (Y.one('svg')) {
self.setSizesFromViewport(vis, container, xscale, yscale);
}
this.vis = vis;
this.tree = d3.layout.pack()
.size([width, height])
.padding(200);
this.update_canvas(true);
},
/*
* Sync our data arrays to the current data
*/
update_data: function() {
//model data
var vis = this.vis,
db = this.get('db'),
services = db.services.map(views.toBoundingBox).map(
function(s) {
s.value = s.unit_count;
return s;
}),
relations = db.relations.map(views.toBoundingBox);
this.services = services;
this.rel_data = this.processRelations(relations);
this.node = vis.selectAll('.service')
.data(services, function(d) {
return d.get('modelId');});
this.link = vis.selectAll('polyline.relation')
.data(this.rel_data, relationToId);
},
update_canvas: function(initial) {
var self = this,
tree = this.tree,
vis = this.vis;
// Process any changed data
this.update_data();
var drag = d3.behavior.drag()
.on('drag', function(d,i) {
d.x += d3.event.dx;
d.y += d3.event.dy;
d3.select(this).attr('transform', function(d,i) {
return d.translateStr();
});
update_links();
});
// Generate a node for each service, draw it as a rect with
// labels for service and charm
var node = this.node,
link = this.link;
// rerun the pack layout
this.tree.nodes({children: this.services});
// enter
node
.enter().append('g')
.attr('class', 'service')
.on('click', function(m) {
// Get the current click action
var curr_click_action = self.get(
'current_service_click_action');
// Fire the action named in the following scheme:
// service_click_action.<action>
// with the service, the SVG node, and the view
// as arguments
(self.service_click_actions[curr_click_action])(
m, this, self);
})
.call(drag)
.transition()
.duration(500)
.attr('transform', function(d) {
return d.translateStr();});
// Update
this.draw_service(node);
// Exit
node.exit()
.transition()
.duration(500)
.attr('x', 0)
.remove();
function update_links() {
// Link persistence hasn't worked properly
// this removes and redraws links
self.link.remove();
self.link = vis.selectAll('polyline.relation')
.data(self.rel_data, relationToId);
self.link.enter().insert('svg:polyline', 'g.service')
.attr('class', 'relation')
.attr('points', self.draw_relation);
}
if (initial) {
Y.later(500, this, update_links);
} else {
update_links();
}
self.set('tree', tree);
self.set('vis', vis);
},
<<<<<<<
// labels for service and charm
var node = this.node,
link = this.link;
// rerun the pack layout
this.tree.nodes({children: this.services});
// enter
node
=======
// labels for service and charm.
var node = vis.selectAll('.service')
.data(self._saved_coords(services) ?
services :
self._generate_coords(services, tree))
>>>>>>>
// labels for service and charm
var node = this.node,
link = this.link;
// rerun the pack layout
this.tree.nodes({children: this.services});
// enter
node
<<<<<<<
.attr("class", "service")
.on("click", function(m) {
// Get the current click action
var curr_click_action = self.get(
'current_service_click_action');
=======
.attr('class', 'service')
.attr('transform', function (d) {
return 'translate(' + [d.x,d.y] + ')';
})
.on('click', function(m) {
// Get the current click action.
var curr_click_action =
self.get('current_service_click_action');
>>>>>>>
.attr('class', 'service')
.on('click', function(m) {
// Get the current click action
var curr_click_action = self.get(
'current_service_click_action');
<<<<<<<
// as arguments
(self.service_click_actions[curr_click_action])(
m, this, self);
=======
// as arguments.
(self.service_click_actions[curr_click_action])(m, this, self);
>>>>>>>
// as arguments
(self.service_click_actions[curr_click_action])(
m, this, self);
<<<<<<<
var w = service_scale_width(d.unit_count);
d.w = w;
=======
var w = service_scale_width(d.get('unit_count'));
d.set('width', w);
>>>>>>>
var w = service_scale_width(d.unit_count);
d.w = w;
<<<<<<<
var h = service_scale_height(d.unit_count);
d.h = h;
=======
var h = service_scale_height(d.get('unit_count'));
d.set('height', h);
>>>>>>>
var h = service_scale_height(d.unit_count);
d.h = h;
<<<<<<<
// add temp relation between services
var link = vis.selectAll("polyline.pending-relation")
=======
// Add temp relation between services.
var link = vis.selectAll('path.pending-relation')
>>>>>>>
// add temp relation between services
var link = vis.selectAll('polyline.pending-relation')
<<<<<<<
link.enter().insert("svg:polyline", "g.service")
.attr("class", "relation pending-relation")
.attr('d', view.draw_relation(rel));
=======
link.enter().insert('svg:polyline', 'g.service')
.attr('class', 'relation pending-relation')
.attr('points', view.draw_relation(rel));
>>>>>>>
link.enter().insert('svg:polyline', 'g.service')
.attr('class', 'relation pending-relation')
.attr('d', view.draw_relation(rel)); |
<<<<<<<
// Start the process of adding a relation.
view.service_click_actions.ambiguousAddRelationCheck(
d3.select(service.next().getDOMNode()).datum(),
view,
service.next());
=======
container.all('.dragline')
.size()
.should.equal(1);
service.next().simulate('click');
>>>>>>>
container.all('.dragline')
.size()
.should.equal(1);
// Start the process of adding a relation.
view.service_click_actions.ambiguousAddRelationCheck(
d3.select(service.next().getDOMNode()).datum(),
view,
service.next()); |
<<<<<<<
// Before an erronious event is processed, no alert exists.
=======
var ev = {err: true},
alert_ = container.one('#message-area>.alert');
// Before an erroneous event is processed, no alert exists.
>>>>>>>
// Before an erroneous event is processed, no alert exists. |
<<<<<<<
=======
// Define the disconnected model unique identifier.
const DISCONNECTED_UUID = 'disconnected';
>>>>>>>
<<<<<<<
Return the current model unique identifier.
@method _getModelUUID
@return {String} The model UUID.
*/
_getModelUUID: function() {
return this.get('modelUUID') ||
(window.juju_config && window.juju_config.jujuEnvUUID);
},
/**
=======
Return the current model unique identifier.
@method _getModelUUID
@return {String} The model UUID.
*/
_getModelUUID: function() {
return this.get('modelUUID') ||
(window.juju_config && window.juju_config.jujuEnvUUID);
},
/**
>>>>>>>
Return the current model unique identifier.
@method _getModelUUID
@return {String} The model UUID.
*/
_getModelUUID: function() {
return this.get('modelUUID') ||
(window.juju_config && window.juju_config.jujuEnvUUID);
},
/**
<<<<<<<
if (this.controllerAPI) {
// In Juju >= 2 we connect to the controller and then to the model.
this.controllerAPI.connect();
} else {
// We won't have a controller API connection in Juju 1.
this.env.connect();
}
this.on('*:autoplaceAndCommitAll', this._autoplaceAndCommitAll, this);
this.state.bootstrap();
=======
this.once('ready', function(e) {
if (this.controllerAPI) {
// In Juju >= 2 we connect to the controller and then to the model.
this.controllerAPI.connect();
} else {
// We won't have a controller API connection in Juju 1.
this.env.connect();
}
this.dispatch();
}, this);
>>>>>>>
if (this.controllerAPI) {
// In Juju >= 2 we connect to the controller and then to the model.
this.controllerAPI.connect();
} else {
// We won't have a controller API connection in Juju 1.
this.env.connect();
}
this.on('*:autoplaceAndCommitAll', this._autoplaceAndCommitAll, this);
this.state.bootstrap();
<<<<<<<
this._renderLoginOutLink();
console.log('successfully logged into controller');
=======
console.log('successfully logged into controller');
// After logging in trigger the app to dispatch to re-render the
// components that require an active connection to the controllerAPI.
this.dispatch();
>>>>>>>
this._renderLoginOutLink();
console.log('successfully logged into controller');
<<<<<<<
const modelUUID = this._getModelUUID();
const current = this.state.current;
if (modelUUID) {
// A model uuid was defined in the config so attempt to connect to it.
this._listAndSwitchModel(null, modelUUID);
} else if (entityPromise !== null) {
this._disambiguateUserState(entityPromise);
} else {
// Drop into disconnected mode and show the profile but only if there
// is no state defined in root. If there is a state defined in root
// then we want to let that dispatcher handle the routing.
this.maskVisibility(false);
const isLogin = current.root === 'login';
const newState = {
root: isLogin ? null : current.root,
};
if ((isLogin || !current.root) && this.get('gisf')) {
// We only want to redirect the users to the profile page if they
// are in gisf(not gijoe) and root state is login.
newState.profile = this._getAuth().rootUserName;
=======
const modelUUID = this._getModelUUID();
// If the model UUID provided by the external system is "disconnected"
// that means that the external GUI host decided that it wants to load
// the GUI in the disconnected mode. In this case, it's not necessary
// to switch the model, but we still want to render the breadcrumb for
// the new logged in user.
if (modelUUID === DISCONNECTED_UUID) {
this._renderBreadcrumb();
return;
}
// If the user isn't currently connected to a model then fetch the
// available models so that we can connect to an available one.
this.controllerAPI.listModelsWithInfo((err, modelList) => {
if (err) {
console.error('unable to list models', err);
this.db.notifications.add({
title: 'Unable to list models',
message: 'Unable to list models: ' + err,
level: 'error'
});
return;
}
modelList = modelList.filter(model => !model.err);
if (modelList.some(data => data.id === this.env.get('modelId'))) {
// If the user is already connected to a model in this list then
// leave it be.
return;
}
// Pick a model to connect to.
const selectedModel = this._pickModel(modelList, modelUUID);
if (selectedModel === null) {
console.log('cannot select a model: using unconnected mode');
// Drop the user into the unconnected state.
this.switchEnv();
return;
>>>>>>>
const modelUUID = this._getModelUUID();
const current = this.state.current;
if (modelUUID) {
// A model uuid was defined in the config so attempt to connect to it.
this._listAndSwitchModel(null, modelUUID);
} else if (entityPromise !== null) {
this._disambiguateUserState(entityPromise);
} else {
// Drop into disconnected mode and show the profile but only if there
// is no state defined in root. If there is a state defined in root
// then we want to let that dispatcher handle the routing.
this.maskVisibility(false);
const isLogin = current.root === 'login';
const newState = {
root: isLogin ? null : current.root,
};
if ((isLogin || !current.root) && this.get('gisf')) {
// We only want to redirect the users to the profile page if they
// are in gisf(not gijoe) and root state is login.
newState.profile = this._getAuth().rootUserName;
<<<<<<<
const gisf = this.get('gisf');
const currentState = this.state.current;
// If an anon user lands on the GUI at /new then don't attempt to log
// into the controller.
if (!creds.areAvailable && gisf &&
(currentState && currentState.root === 'new')) {
console.log('now in anonymous mode');
this.maskVisibility(false);
return;
}
if (!creds.areAvailable) {
=======
if (!creds.areAvailable && !this.get('gisf')) {
// Credentials are not available and, not being in GISF mode, we
// don't support external or anonymous connections. Just show the
// login form.
>>>>>>>
const gisf = this.get('gisf');
const currentState = this.state.current;
// If an anon user lands on the GUI at /new then don't attempt to log
// into the controller.
if (!creds.areAvailable && gisf &&
(currentState && currentState.root === 'new')) {
console.log('now in anonymous mode');
this.maskVisibility(false);
return;
}
if (!creds.areAvailable) {
<<<<<<<
// If macaroons are available or if we have an external token from
// Keystone, then proceed with the macaroons based authentication.
if (creds.macaroons || creds.areExternal) {
=======
if (this._getModelUUID() === DISCONNECTED_UUID) {
console.log('now in anonymous mode');
// When in GISF, never display the log in form. Authentication will
// either happen below (if macaroons are provided) or deferred to
// the beginning of the deployment flow.
this.maskVisibility(false);
}
// If we're in a JIMM controlled environment, HJC, or if we have
// macaroon credentials then use the macaroon login. If not then uses
// the standard u/p method.
if (this.get('gisf') || creds.macaroons || creds.areExternal) {
>>>>>>>
// If macaroons are available or if we have an external token from
// Keystone, then proceed with the macaroons based authentication.
if (creds.macaroons || creds.areExternal) {
<<<<<<<
if (this.state.current.root === 'login') {
this.state.changeState({root: null});
}
if (!err) {
return;
}
=======
if (!err) {
return;
}
>>>>>>>
if (this.state.current.root === 'login') {
this.state.changeState({root: null});
}
if (!err) {
return;
}
<<<<<<<
const getUserName = () => {
const credentials = controllerAPI && controllerAPI.getCredentials();
return credentials ? credentials.user : undefined;
};
const loginToController = controllerAPI.loginWithMacaroon.bind(
controllerAPI, this.bakeryFactory.get('juju'));
=======
const credentials = controllerAPI && controllerAPI.getCredentials();
const user = credentials && credentials.user || undefined;
const loginToController = controllerAPI.loginWithMacaroon.bind(
controllerAPI, this.bakeryFactory.get('juju'));
>>>>>>>
const getUserName = () => {
const credentials = controllerAPI && controllerAPI.getCredentials();
return credentials ? credentials.user : undefined;
};
const loginToController = controllerAPI.loginWithMacaroon.bind(
controllerAPI, this.bakeryFactory.get('juju'));
<<<<<<<
charmsGetById={db.charms.getById.bind(db.charms)}
=======
>>>>>>>
charmsGetById={db.charms.getById.bind(db.charms)}
<<<<<<<
loginToController={loginToController}
modelCommitted={connected}
=======
loginToController={loginToController}
modelCommitted={this.env.get('connected')}
>>>>>>>
loginToController={loginToController}
modelCommitted={connected} |
<<<<<<<
// hack to avoid loading a Gruntfile
// You can skip this and just use a Gruntfile instead
grunt.task.init = function() {};
// Init config
grunt.initConfig({
asset_deploy: {
options: {
src: 'screenshot.png',
host: 'playground.yahoofs.com',
path: '/gfranko/'
// yca: 'yahoo.mobstor.client.some.property'
}
}
});
// Load tasks
grunt.loadNpmTasks('grunt-asset-deploy');
grunt.registerTask('blah', function() {
console.log('yoooo');
})
=======
>>>>>>>
<<<<<<<
// grunt.tasks('asset_deploy');
grunt.util.spawn({
'grunt': true,
'args': ['blah', 'asset_deploy']
});
=======
var content = fs.createReadStream('screenshot.png'),
config = {
host : "playground.yahoofs.com"
},
client;
client = mobstor.createClient(config);
client.storeFile('/gfranko/screenshot.png', content, function mobstorStoreFileCb(err) {
// skip 409 conflict issues since the asset was uploaded correctly
if (err && err.code !== 409) {
console.log('Failed');
} else {
console.log('Successfully deployed');
}
});
>>>>>>> |
<<<<<<<
if (!service) {
console.log('not connected / maybe');
return this;
}
var units = db.units.get_units_for_service(service);
var charm_name = service.get('charm');
container.setHTML(this.template(
{'service': service.getAttrs(),
'charm': this.renderable_charm(charm_name, db),
'units': units
}));
=======
if (!service) {
console.log('not connected / maybe');
>>>>>>>
if (!service) {
console.log('not connected / maybe');
<<<<<<<
for (var i=units.length - 1;
unit_ids_to_remove.length < delta;
i--) {
unit_ids_to_remove.push(units[i].id);
}
env.remove_units(
unit_ids_to_remove,
Y.bind(this._removeUnitCallback, this)
);
=======
for (var i = units.length - 1;
unit_ids_to_remove.length < delta;
i -= 1) {
unit_ids_to_remove.push(units[i].get('id'));
>>>>>>>
for (var i = units.length - 1;
unit_ids_to_remove.length < delta;
i -= 1) {
unit_ids_to_remove.push(units[i].id);
<<<<<<<
var service = this.get('model'),
service_id = service.get('id'),
db = this.get('db'),
unit_names = ev.result || [];
console.log('_addUnitCallback with: ', arguments);
// Received acknowledgement message for the 'add_units' operation.
// ev.results is an array of the new unit ids to be created.
db.units.add(
Y.Array.map(unit_names, function (unit_id) {
return {id: unit_id,
agent_state: 'pending'};
}));
service.set(
'unit_count', service.get('unit_count') + unit_names.length);
db.fire('update');
// View is redrawn so we do not need to enable field.
=======
var service = this.get('model'),
service_id = service.get('id'),
db = this.get('db'),
unit_names = ev.result || [];
console.log('_addUnitCallback with: ', arguments);
// Received acknowledgement message for the 'add_units' operation.
// ev.results is an array of the new unit ids to be created.
db.units.add(
Y.Array.map(unit_names, function(unit_id) {
return new models.ServiceUnit(
{id: unit_id,
agent_state: 'pending',
service: service_id});
}));
service.set(
'unit_count', service.get('unit_count') + unit_names.length);
db.fire('update');
// View is redrawn so we do not need to enable field.
>>>>>>>
var service = this.get('model'),
service_id = service.get('id'),
db = this.get('db'),
unit_names = ev.result || [];
console.log('_addUnitCallback with: ', arguments);
// Received acknowledgement message for the 'add_units' operation.
// ev.results is an array of the new unit ids to be created.
db.units.add(
Y.Array.map(unit_names, function(unit_id) {
return {id: unit_id,
agent_state: 'pending'};
}));
service.set(
'unit_count', service.get('unit_count') + unit_names.length);
db.fire('update');
// View is redrawn so we do not need to enable field. |
<<<<<<<
=======
'juju-models',
'juju-notification-controller',
>>>>>>> |
<<<<<<<
machine.name = command.options.modelId;
changes.addMachines.push(machine);
=======
>>>>>>> |
<<<<<<<
it('can deploy a service', function() {
env.deploy('precise/mysql');
msg = conn.last_message();
var expected = {
Type: 'Client',
Request: 'ServiceDeploy',
Params: {
CharmUrl: 'precise/mysql'
},
RequestId: 1
};
assert.deepEqual(expected, msg);
});
it('can deploy a service with a config file', function() {
/*jshint multistr:true */
var config_raw = 'tuning-level: \nexpert-mojo';
/*jshint multistr:false */
var expected = {
Type: 'Client',
Request: 'ServiceDeploy',
Params: {
ServiceName: null,
Config: null,
ConfigYAML: config_raw,
CharmUrl: 'precise/mysql'
},
RequestId: 1
};
env.deploy('precise/mysql', null, null, config_raw);
msg = conn.last_message();
assert.deepEqual(expected, msg);
});
=======
it('sends the correct get_annotations message', function() {
env.get_annotations('service-apache');
var last_message = conn.last_message();
var expected = {
Type: 'Client',
Request: 'GetAnnotations',
RequestId: 1,
Params: {EntityId: 'service-apache'}
};
assert.deepEqual(expected, last_message);
});
it('sends the correct update_annotations message', function() {
env.update_annotations('service-apache', {'mykey': 'myvalue'});
var last_message = conn.last_message();
var expected = {
Type: 'Client',
Request: 'SetAnnotations',
RequestId: 1,
Params: {
EntityId: 'service-apache',
Pairs: {
mykey: 'myvalue'
}
}
};
assert.deepEqual(expected, last_message);
});
it('sends correct multiple update_annotations messages', function() {
env.update_annotations('service-apache', {
'key1': 'value1',
'key2': 'value2'
});
var expected = [
{
Type: 'Client',
Request: 'SetAnnotations',
RequestId: 1,
Params: {
EntityId: 'service-apache',
Pairs: {
key1: 'value1',
key2: 'value2'
}
}
}
];
assert.deepEqual(expected, conn.messages);
});
it('sends the correct remove_annotations message', function() {
env.remove_annotations('service-apache', ['key1']);
var last_message = conn.last_message();
var expected = {
Type: 'Client',
Request: 'SetAnnotations',
RequestId: 1,
Params: {
EntityId: 'service-apache',
Pairs: {
key1: ''
}
}
};
assert.deepEqual(expected, last_message);
});
it('sends the correct remove_annotations message', function() {
env.remove_annotations('service-apache', ['key1', 'key2']);
var last_message = conn.last_message();
var expected = {
Type: 'Client',
Request: 'SetAnnotations',
RequestId: 1,
Params: {
EntityId: 'service-apache',
Pairs: {
key1: '',
key2: ''
}
}
};
assert.deepEqual(expected, last_message);
});
it('successfully retrieves annotations', function() {
var annotations;
var expected = {
'key1': 'value1',
'key2': 'value2'
};
env.get_annotations('service-mysql', function(data) {
annotations = data.results;
});
// Mimic response.
conn.msg({
RequestId: 1,
Response: {
Annotations: expected
}
});
assert.deepEqual(expected, annotations);
});
it('successfully sets annotation', function() {
var err;
env.update_annotations('mysql', {'mykey': 'myvalue'}, function(data) {
err = data.err;
});
// Mimic response.
conn.msg({
RequestId: 1,
Response: {}
});
assert.isUndefined(err);
});
it('successfully sets annotations', function() {
var err;
env.update_annotations('mysql', {
'key1': 'value1',
'key2': 'value2'
}, function(data) {
err = data.err;
});
// Mimic response.
conn.msg({
RequestId: 1,
Response: {}
});
assert.isUndefined(err);
});
it('successfully removes annotations', function() {
var err;
env.remove_annotations('mysql', ['key1', 'key2'], function(data) {
err = data.err;
});
// Mimic response.
conn.msg({
RequestId: 1,
Response: {}
});
assert.isUndefined(err);
});
it('correctly handles errors from getting annotations', function() {
var err;
env.get_annotations('service-haproxy', function(data) {
err = data.err;
});
// Mimic response.
conn.msg({
RequestId: 1,
Error: 'This is an error.'
});
assert.equal('This is an error.', err);
});
it('correctly handles errors from setting annotations', function() {
var err;
env.update_annotations('service-haproxy', {
'key': 'value'
}, function(data) {
err = data.err;
});
// Mimic response.
conn.msg({
RequestId: 1,
Error: 'This is an error.'
});
assert.equal('This is an error.', err);
});
it('correctly handles errors from removing annotations', function() {
var err;
env.remove_annotations('service-haproxy', ['key1', 'key2'],
function(data) {
err = data.err;
});
// Mimic response.
conn.msg({
RequestId: 1,
Error: 'This is an error.'
});
assert.equal('This is an error.', err);
});
>>>>>>>
it('can deploy a service', function() {
env.deploy('precise/mysql');
msg = conn.last_message();
var expected = {
Type: 'Client',
Request: 'ServiceDeploy',
Params: {
CharmUrl: 'precise/mysql'
},
RequestId: 1
};
assert.deepEqual(expected, msg);
});
it('can deploy a service with a config file', function() {
/*jshint multistr:true */
var config_raw = 'tuning-level: \nexpert-mojo';
/*jshint multistr:false */
var expected = {
Type: 'Client',
Request: 'ServiceDeploy',
Params: {
ServiceName: null,
Config: null,
ConfigYAML: config_raw,
CharmUrl: 'precise/mysql'
},
RequestId: 1
};
env.deploy('precise/mysql', null, null, config_raw);
msg = conn.last_message();
assert.deepEqual(expected, msg);
});
it('sends the correct get_annotations message', function() {
env.get_annotations('service-apache');
var last_message = conn.last_message();
var expected = {
Type: 'Client',
Request: 'GetAnnotations',
RequestId: 1,
Params: {EntityId: 'service-apache'}
};
assert.deepEqual(expected, last_message);
});
it('sends the correct update_annotations message', function() {
env.update_annotations('service-apache', {'mykey': 'myvalue'});
var last_message = conn.last_message();
var expected = {
Type: 'Client',
Request: 'SetAnnotations',
RequestId: 1,
Params: {
EntityId: 'service-apache',
Pairs: {
mykey: 'myvalue'
}
}
};
assert.deepEqual(expected, last_message);
});
it('sends correct multiple update_annotations messages', function() {
env.update_annotations('service-apache', {
'key1': 'value1',
'key2': 'value2'
});
var expected = [
{
Type: 'Client',
Request: 'SetAnnotations',
RequestId: 1,
Params: {
EntityId: 'service-apache',
Pairs: {
key1: 'value1',
key2: 'value2'
}
}
}
];
assert.deepEqual(expected, conn.messages);
});
it('sends the correct remove_annotations message', function() {
env.remove_annotations('service-apache', ['key1']);
var last_message = conn.last_message();
var expected = {
Type: 'Client',
Request: 'SetAnnotations',
RequestId: 1,
Params: {
EntityId: 'service-apache',
Pairs: {
key1: ''
}
}
};
assert.deepEqual(expected, last_message);
});
it('sends the correct remove_annotations message', function() {
env.remove_annotations('service-apache', ['key1', 'key2']);
var last_message = conn.last_message();
var expected = {
Type: 'Client',
Request: 'SetAnnotations',
RequestId: 1,
Params: {
EntityId: 'service-apache',
Pairs: {
key1: '',
key2: ''
}
}
};
assert.deepEqual(expected, last_message);
});
it('successfully retrieves annotations', function() {
var annotations;
var expected = {
'key1': 'value1',
'key2': 'value2'
};
env.get_annotations('service-mysql', function(data) {
annotations = data.results;
});
// Mimic response.
conn.msg({
RequestId: 1,
Response: {
Annotations: expected
}
});
assert.deepEqual(expected, annotations);
});
it('successfully sets annotation', function() {
var err;
env.update_annotations('mysql', {'mykey': 'myvalue'}, function(data) {
err = data.err;
});
// Mimic response.
conn.msg({
RequestId: 1,
Response: {}
});
assert.isUndefined(err);
});
it('successfully sets annotations', function() {
var err;
env.update_annotations('mysql', {
'key1': 'value1',
'key2': 'value2'
}, function(data) {
err = data.err;
});
// Mimic response.
conn.msg({
RequestId: 1,
Response: {}
});
assert.isUndefined(err);
});
it('successfully removes annotations', function() {
var err;
env.remove_annotations('mysql', ['key1', 'key2'], function(data) {
err = data.err;
});
// Mimic response.
conn.msg({
RequestId: 1,
Response: {}
});
assert.isUndefined(err);
});
it('correctly handles errors from getting annotations', function() {
var err;
env.get_annotations('service-haproxy', function(data) {
err = data.err;
});
// Mimic response.
conn.msg({
RequestId: 1,
Error: 'This is an error.'
});
assert.equal('This is an error.', err);
});
it('correctly handles errors from setting annotations', function() {
var err;
env.update_annotations('service-haproxy', {
'key': 'value'
}, function(data) {
err = data.err;
});
// Mimic response.
conn.msg({
RequestId: 1,
Error: 'This is an error.'
});
assert.equal('This is an error.', err);
});
it('correctly handles errors from removing annotations', function() {
var err;
env.remove_annotations('service-haproxy', ['key1', 'key2'],
function(data) {
err = data.err;
});
// Mimic response.
conn.msg({
RequestId: 1,
Error: 'This is an error.'
});
assert.equal('This is an error.', err);
}); |
<<<<<<<
Y.Handlebars.registerHelper('unitState', function(relation_errors,
agent_state) {
if ('started' !== agent_state && relation_errors &&
Y.Object.keys(relation_errors).length) {
return 'relation-error';
}
return agent_state;
});
=======
Y.Handlebars.registerHelper('any', function() {
var conditions = Y.Array(arguments, 0, true),
options = conditions.pop();
if (Y.Array.some(conditions, function(c) { return !!c; })) {
return options.fn(this);
} else {
return options.inverse(this);
}
});
Y.Handlebars.registerHelper('dateformat', function(date, format) {
// See http://yuilibrary.com/yui/docs/datatype/ for formatting options.
if (date) {
return Y.Date.format(date, {format: format});
}
return '';
});
Y.Handlebars.registerHelper('iflat', function(iface_decl, options) {
// console.log('helper', iface_decl, options, this);
var result = [];
var ret = '';
Y.Object.each(iface_decl, function(value, name) {
if (name) {
result.push({
name: name, 'interface': value['interface']
});
}
});
if (result && result.length > 0) {
for (var x = 0, j = result.length; x < j; x += 1) {
ret = ret + options.fn(result[x]);
}
} else {
ret = 'None';
}
return ret;
});
Y.Handlebars.registerHelper('markdown', function(text) {
if (!text || text === undefined) {return '';}
return new Y.Handlebars.SafeString(
Y.Markdown.toHTML(text));
});
>>>>>>>
Y.Handlebars.registerHelper('unitState', function(relation_errors,
agent_state) {
if ('started' !== agent_state && relation_errors &&
Y.Object.keys(relation_errors).length) {
return 'relation-error';
}
return agent_state;
});
Y.Handlebars.registerHelper('any', function() {
var conditions = Y.Array(arguments, 0, true),
options = conditions.pop();
if (Y.Array.some(conditions, function(c) { return !!c; })) {
return options.fn(this);
} else {
return options.inverse(this);
}
});
Y.Handlebars.registerHelper('dateformat', function(date, format) {
// See http://yuilibrary.com/yui/docs/datatype/ for formatting options.
if (date) {
return Y.Date.format(date, {format: format});
}
return '';
});
Y.Handlebars.registerHelper('iflat', function(iface_decl, options) {
// console.log('helper', iface_decl, options, this);
var result = [];
var ret = '';
Y.Object.each(iface_decl, function(value, name) {
if (name) {
result.push({
name: name, 'interface': value['interface']
});
}
});
if (result && result.length > 0) {
for (var x = 0, j = result.length; x < j; x += 1) {
ret = ret + options.fn(result[x]);
}
} else {
ret = 'None';
}
return ret;
});
Y.Handlebars.registerHelper('markdown', function(text) {
if (!text || text === undefined) {return '';}
return new Y.Handlebars.SafeString(
Y.Markdown.toHTML(text));
}); |
<<<<<<<
/*
console.log("App: Dispatch", this.get('activeView'))
if (this.hasRoute(this.getPath())) {
} else {
console.log("App: Route default Overview");
this.show_overview();
} */
=======
>>>>>>>
<<<<<<<
{path: "/", callback: 'show_environment'},
=======
{path: "/", callback: 'show_overview'}
>>>>>>>
{path: "/", callback: 'show_environment'}, |
<<<<<<<
return compose(
createElement,
context,
{
component,
parentPropKeys,
childrenAdapter,
}
)
=======
return compose(createElement, context, {
component,
parentPropKeys,
componentPropKeys,
childrenAdapter
})
>>>>>>>
return compose(
createElement,
context,
{
component,
parentPropKeys,
componentPropKeys,
childrenAdapter,
}
)
<<<<<<<
function compose(
createElement,
context,
{ component, parentPropKeys, childrenAdapter }
) {
=======
function compose(createElement, context, {
component,
parentPropKeys,
componentPropKeys,
childrenAdapter
}) {
>>>>>>>
function compose(
createElement,
context,
{ component, parentPropKeys, componentPropKeys, childrenAdapter }
) {
<<<<<<<
const {
children,
parent: { $attrs },
} = context
// Extracts the props that should be passed to the View
=======
const {
children,
parent: { $attrs: parentAttrs },
data: { attrs: componentAttrs = {} },
} = context
// Extracts the parent props that should be passed to the View
>>>>>>>
const {
children,
parent: { $attrs: parentAttrs },
data: { attrs: componentAttrs = {} },
} = context
// Extracts the parent props that should be passed to the View |
<<<<<<<
data: '{"id": "cs:foo/bar-1"}',
dataType: 'token-drag-and-drop',
=======
charmData: '{"id": "cs:foo/bar-1"}',
dataType: 'charm-token-drag-and-drop',
>>>>>>>
data: '{"id": "cs:foo/bar-1"}',
dataType: 'charm-token-drag-and-drop', |
<<<<<<<
console.log("View: Initialized: Charm Search")
this.publish('showCharmCollection', {preventable: false});
=======
console.log("View: Initialized: Charm Search");
>>>>>>>
console.log("View: Initialized: Charm Search")
this.publish('showCharmCollection', {preventable: false});
<<<<<<<
=======
>>>>>>>
<<<<<<<
console.log('Fire show charm collection', this, charm_url);
this.fire('showCharmCollection', {query: charm_url});
// this.get('app').env.deploy(charm_url);
=======
console.log('deploying charm', this, charm_url);
app.env.deploy(charm_url);
>>>>>>>
console.log('Fire show charm collection', this, charm_url);
this.fire('showCharmCollection', {query: charm_url}); |
<<<<<<<
=======
YUI(GlobalConfig).use(['juju-gui', 'juju-tests-utils'], function(Y) {
>>>>>>> |
<<<<<<<
var Y, container, search, Search, utils;
=======
var Y, container, search, Search;
>>>>>>>
var Y, container, search, Search, utils;
<<<<<<<
if (search) {
search.destroy();
}
=======
search.destroy();
>>>>>>>
if (search) {
search.destroy();
}
<<<<<<<
search = new Search();
search.render(container);
=======
>>>>>>>
search = new Search();
search.render(container);
<<<<<<<
it('should support setting search string', function() {
search = new Search();
=======
it('shows the home links when withHome is set', function() {
// Skip the default beforeEach Search and create our own.
search.destroy();
search = new Search({
withHome: true
});
>>>>>>>
it('shows the home links when withHome is set', function() {
// Skip the default beforeEach Search and create our own.
search.destroy();
search = new Search({
withHome: true
});
<<<<<<<
it('supports autocompletion while entering text', function(done) {
// We need a valid store instance to send back the data.
var data = utils.loadFixture('data/autocomplete.json');
var fakeStore = new Y.juju.Charmworld2({});
fakeStore.set('datasource', {
sendRequest: function(params) {
// Stubbing the server callback value
params.callback.success({
response: {
results: [{
responseText: data
}]
}
});
}
});
search = new Search({
autocompleteSource: Y.bind(
fakeStore.autocomplete,
fakeStore
),
autocompleteDataFormatter: fakeStore.resultsToCharmlist,
filters: {}
});
search.render(container);
search.ac.queryDelay = 0;
search.ac.on('results', function(ev) {
// The results should be displaying now. Check for charm-token nodes.
assert.equal(ev.results.length, 19);
assert.isTrue(ev.results[0].display.hasClass('yui3-charmtoken'));
fakeStore.destroy();
done();
});
// hack into the ac widget to simulate the valueChange event
search.ac._afterValueChange({
newVal: 'test',
src: 'ui'
});
});
it('adds the search text to the suggestions api call', function(done) {
search = new Search({
autocompleteSource: function(filters, callbacks, scope) {
assert.equal(filters.text, 'test');
done();
},
filters: {}
});
search._fetchSuggestions('test', function() {});
});
=======
it('supports an onHome event', function(done) {
search.on(search.EVT_SEARCH_GOHOME, function() {
done();
});
container.one('i.home').simulate('click');
});
it('clicking on the home link also works', function(done) {
search.on(search.EVT_SEARCH_GOHOME, function() {
done();
});
container.one('a.home').simulate('click');
});
>>>>>>>
it('supports autocompletion while entering text', function(done) {
// We need a valid store instance to send back the data.
var data = utils.loadFixture('data/autocomplete.json');
var fakeStore = new Y.juju.Charmworld2({});
fakeStore.set('datasource', {
sendRequest: function(params) {
// Stubbing the server callback value
params.callback.success({
response: {
results: [{
responseText: data
}]
}
});
}
});
search = new Search({
autocompleteSource: Y.bind(
fakeStore.autocomplete,
fakeStore
),
autocompleteDataFormatter: fakeStore.resultsToCharmlist,
filters: {}
});
search.render(container);
search.ac.queryDelay = 0;
search.ac.on('results', function(ev) {
// The results should be displaying now. Check for charm-token nodes.
assert.equal(ev.results.length, 19);
assert.isTrue(ev.results[0].display.hasClass('yui3-charmtoken'));
fakeStore.destroy();
done();
});
// hack into the ac widget to simulate the valueChange event
search.ac._afterValueChange({
newVal: 'test',
src: 'ui'
});
});
it('adds the search text to the suggestions api call', function(done) {
search = new Search({
autocompleteSource: function(filters, callbacks, scope) {
assert.equal(filters.text, 'test');
done();
},
filters: {}
});
search._fetchSuggestions('test', function() {});
});
it('supports an onHome event', function(done) {
search.on(search.EVT_SEARCH_GOHOME, function() {
done();
});
container.one('i.home').simulate('click');
});
it('clicking on the home link also works', function(done) {
search.on(search.EVT_SEARCH_GOHOME, function() {
done();
});
container.one('a.home').simulate('click');
}); |
<<<<<<<
<BasicTable
=======
<juju.components.BasicTable
changeState={this.props.changeState}
>>>>>>>
<BasicTable
changeState={this.props.changeState}
<<<<<<<
<BasicTable
=======
<juju.components.BasicTable
changeState={this.props.changeState}
>>>>>>>
<BasicTable
changeState={this.props.changeState}
<<<<<<<
<BasicTable
=======
<juju.components.BasicTable
changeState={this.props.changeState}
>>>>>>>
<BasicTable
changeState={this.props.changeState} |
<<<<<<<
units_for_service.forEach(function(unit) {
var state = unit.agent_state;
if (aggregate_map[state] === undefined) {
aggregate_map[state] = 1;
} else {
aggregate_map[state]++;
}
=======
units_for_service.forEach(function(unit) {
var state = unit.get('agent_state');
if (aggregate_map[state] === undefined) {
aggregate_map[state] = 1;
}
else {
aggregate_map[state] += 1;
}
>>>>>>>
units_for_service.forEach(function(unit) {
var state = unit.agent_state;
if (aggregate_map[state] === undefined) {
aggregate_map[state] = 1;
}
else {
aggregate_map[state] += 1;
} |
<<<<<<<
Calls the deployer import method with the bundle data
to deploy the bundle to the environment.
@method deployBundle
@param {Object} bundle Bundle data.
*/
deployBundle: function(bundle, bundle_id) {
var notifications = this.db.notifications;
this.env.deployerImport(
Y.JSON.stringify({bundle: bundle}),
null, bundle_id,
Y.bind(utils.deployBundleCallback, null, notifications));
},
/**
=======
>>>>>>> |
<<<<<<<
if (validator && !propertyValue) {
return callback(true);
=======
if (validator && propertyValue === undefined) {
return callback('‘' + property + '’ is required');
>>>>>>>
if (validator && propertyValue === undefined) {
return callback(true); |
<<<<<<<
locale: PropTypes.string.isRequired,
=======
dateFormat: PropTypes.string,
>>>>>>>
dateFormat: PropTypes.string,
locale: PropTypes.string.isRequired,
<<<<<<<
{day.locale(this.props.locale).format(format)}
=======
{day.format(this.dateFormat)}
>>>>>>>
{day.locale(this.props.locale).format(this.dateFormat)} |
<<<<<<<
<XLabels
date={this.props.date}
display={this.props.display}
locale={this.props.locale}
/>
=======
<XLabels
date={this.props.date}
display={this.props.display}
dateFormat={this.props.dateFormat}
/>
>>>>>>>
<XLabels
date={this.props.date}
display={this.props.display}
dateFormat={this.props.dateFormat}
locale={this.props.locale}
/> |
<<<<<<<
/**
* Claroline TinyMCE parameters and methods.
*/
tinymce.claroline = {
'disableBeforeUnload': false,
'domChange': null
=======
//Load external plugins
tinymce.PluginManager.load('mention', home.asset + 'bundles/frontend/tinymce/plugins/mention/plugin.min.js');
tinymce.PluginManager.load('accordion', home.asset + 'bundles/frontend/tinymce/plugins/accordion/plugin.min.js');
tinymce.DOM.loadCSS(home.asset + 'bundles/frontend/tinymce/plugins/mention/css/autocomplete.css');
var language = home.locale.trim();
var contentCSS = home.asset + 'bundles/clarolinecore/css/tinymce/tinymce.css';
var configTinyMCE = {
'relative_urls': false,
'theme': 'modern',
'language': language,
'browser_spellcheck': true,
'autoresize_min_height': 100,
'autoresize_max_height': 500,
'content_css': contentCSS,
'plugins': [
'autoresize advlist autolink lists link image charmap print preview hr anchor pagebreak',
'searchreplace wordcount visualblocks visualchars fullscreen',
'insertdatetime media nonbreaking save table directionality',
'template paste textcolor emoticons code -mention -accordion'
],
'toolbar1': 'styleselect | bold italic | alignleft aligncenter alignright alignjustify | ' +
'preview fullscreen resourcePicker fileUpload accordion',
'toolbar2': 'undo redo | forecolor backcolor emoticons | bullist numlist outdent indent | ' +
'link image media print code',
'extended_valid_elements': 'user[id], a[data-toggle|data-parent]',
'paste_preprocess': function (plugin, args) {
var link = $('<div>' + args.content + '</div>').text().trim(); //inside div because a bug of jquery
home.canGenerateContent(link, function (data) {
tinymce.activeEditor.insertContent('<div>' + data + '</div>');
editorChange(tinymce.activeEditor);
});
},
mentions: {
source: function (query, process, delimiter) {
if (!_.isUndefined(window.Workspace) && !_.isNull(window.Workspace.id)) {
if (delimiter === '@' && query.length>0) {
$.getJSON(home.path + 'user/searchInWorkspace/' + window.Workspace.id + '/' + query, function (data) {
if(!_.isEmpty(data) && !_.isUndefined(data.users) && !_.isEmpty(data.users))process(data.users);
});
}
}
},
render: function(item) {
var avatar = '<i class="icon-user"></i>';
if(item.avatar != null) {
avatar = '<img src="' + home.asset + 'uploads/pictures/' + item.avatar + '"/>';
}
return '<li>' +
'<a href="javascript:;"><span class="user-picker-dropdown-avatar">' + avatar + '</span> <span class="user-picker-dropdown-name">' + item.name + '</span> <small class="user-picker-avatar-mail text-muted">('+item.mail+')</small></a>' +
'</li>';
},
insert: function(item) {
return '<user id="' + item.id + '"><a href="' + home.path + 'profile/view/' + item.id + '">' + item.name + '</a></user>';
},
delay: 200
},
setup: function (editor) {
editor.on('change', function () {
if (editor.getElement()) {
editor.getElement().value = editor.getContent();
}
});
editor.on('LoadContent', function () {
editorChange(editor);
});
if ($(editor.getElement()).data('resource-picker') !== 'off') {
editor.addButton('resourcePicker', {
'icon': 'none icon-folder-open',
'classes': 'widget btn',
'tooltip': translator.get('platform:resources'),
'onclick': function () {
tinymce.activeEditor = editor;
resourcePickerOpen();
}
});
editor.addButton('fileUpload', {
'icon': 'none icon-file',
'classes': 'widget btn',
'tooltip': translator.get('platform:upload'),
'onclick': function () {
tinymce.activeEditor = editor;
modal.fromRoute('claro_upload_modal', null, function (element) {
element.on('click', '.resourcePicker', function () {
resourcePickerOpen();
})
.on('click', '.filePicker', function () {
$('#file_form_file').click();
})
.on('change', '#file_form_file', function () {
uploadfile(this, element);
});
});
}
});
}
$('body').bind('ajaxComplete', function () {
setTimeout(function () {
if (editor.getElement() && editor.getElement().value === '') {
editor.setContent('');
}
}, 200);
});
}
>>>>>>>
//Load external plugins
tinymce.PluginManager.load('mention', home.asset + 'bundles/frontend/tinymce/plugins/mention/plugin.min.js');
tinymce.PluginManager.load('accordion', home.asset + 'bundles/frontend/tinymce/plugins/accordion/plugin.min.js');
tinymce.DOM.loadCSS(home.asset + 'bundles/frontend/tinymce/plugins/mention/css/autocomplete.css');
/**
* Claroline TinyMCE parameters and methods.
*/
tinymce.claroline = {
'disableBeforeUnload': false,
'domChange': null |
<<<<<<<
import 'angular-daterangepicker/js/angular-daterangepicker'
=======
>>>>>>>
import 'angular-daterangepicker/js/angular-daterangepicker' |
<<<<<<<
import {getLocale} from '#/main/core/intl/locale'
// configure moment
// this may be not the better place to do it
moment.locale(getLocale())
=======
import {getLocale} from '#/main/core/intl/locale'
>>>>>>>
import {getLocale} from '#/main/core/intl/locale'
<<<<<<<
function localeDate(date, withTime = false) {
return moment(date).format(getFormat(withTime))
=======
/**
* Converts a date from the displayed format to the API one.
*
* @param {string} displayDate - the display date to convert.
* @param {boolean} long - does the display date use the full text format ?
* @param {boolean} withTime - has it time ?
*
* @return {string} - the date in api format.
*/
function apiDate(displayDate, long = false, withTime = false) {
let date = moment(displayDate, getDisplayFormat(long, withTime))
if (withTime) {
date = date.utc()
}
return date.format(getApiFormat())
}
/**
* Converts a date from the api format to the displayed one.
*
* @param {string} apiDate - the api date to convert.
* @param {boolean} long - does the display date use the full text format ?
* @param {boolean} withTime - has it time ?
*
* @return {string} - the date in display format.
*/
function displayDate(apiDate, long = false, withTime = false) {
return moment.utc(apiDate).local().format(getDisplayFormat(long, withTime))
>>>>>>>
/**
* Converts a date from the displayed format to the API one.
*
* @param {string} displayDate - the display date to convert.
* @param {boolean} long - does the display date use the full text format ?
* @param {boolean} withTime - has it time ?
*
* @return {string} - the date in api format.
*/
function apiDate(displayDate, long = false, withTime = false) {
let date = moment(displayDate, getDisplayFormat(long, withTime))
if (withTime) {
date = date.utc()
}
return date.format(getApiFormat())
}
/**
* Converts a date from the api format to the displayed one.
*
* @param {string} apiDate - the api date to convert.
* @param {boolean} long - does the display date use the full text format ?
* @param {boolean} withTime - has it time ?
*
* @return {string} - the date in display format.
*/
function displayDate(apiDate, long = false, withTime = false) {
return moment.utc(apiDate).local().format(getDisplayFormat(long, withTime))
<<<<<<<
getFormat,
localeDate,
serverDate,
getApiFormat,
getDisplayFormat,
isValidDate,
apiDate,
displayDate,
now
=======
getApiFormat,
getDisplayFormat,
isValidDate,
apiDate,
displayDate,
now
>>>>>>>
localeDate,
serverDate,
getApiFormat,
getDisplayFormat,
isValidDate,
apiDate,
displayDate,
now |
<<<<<<<
clientState: null, //state from client
// mutations: [], //history of mutations from client
messages: ['Store works!', 'Chicken wings are delicious'],
tests: ['hardCodeTest', 'test2'],
events: ['connected to app', 'state change', 'state initialized']
=======
clientState: {}, //state from client
events: [{title:'CONNECTED TO APP'}, {title:'STATE INITIALIZED'}]
>>>>>>>
clientState: null, //state from client
events: [{title:'CONNECTED TO APP'}, {title:'STATE INITIALIZED'}] |
<<<<<<<
=======
/*
* This file is part of the Claroline Connect package.
*
* (c) Claroline Consortium <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
>>>>>>>
/*
* This file is part of the Claroline Connect package.
*
* (c) Claroline Consortium <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/ |
<<<<<<<
var inFunction, inGenerator, inAsync, labels, strict,
inXJSChild, inXJSTag, inXJSChildExpression;
=======
var inFunction, inGenerator, labels, strict,
inXJSChild, inXJSTag, inType;
>>>>>>>
var inFunction, inGenerator, inAsync, labels, strict,
inXJSChild, inXJSTag, inType;
<<<<<<<
if (starttype === _name) {
if (expr.type === "FunctionExpression" && expr.async) {
expr.type = "FunctionDeclaration";
return expr;
} else if (expr.type === "Identifier") {
if (eat(_colon)) {
return parseLabeledStatement(node, maybeName, expr);
}
}
}
return parseExpressionStatement(node, expr);
=======
if (starttype === _name && expr.type === "Identifier") {
if (eat(_colon)) {
return parseLabeledStatement(node, maybeName, expr);
}
if (expr.name === "declare") {
if (tokType === _class || tokType === _name || tokType === _function || tokType === _var) {
return parseDeclare(node);
}
} else if (tokType === _name) {
if (expr.name === "interface") {
return parseInterface(node);
} else if (expr.name === "type") {
return parseTypeAlias(node);
}
}
}
return parseExpressionStatement(node, expr);
>>>>>>>
if (starttype === _name) {
if (expr.type === "FunctionExpression" && expr.async) {
expr.type = "FunctionDeclaration";
return expr;
} else if (expr.type === "Identifier") {
if (eat(_colon)) {
return parseLabeledStatement(node, maybeName, expr);
}
if (expr.name === "declare") {
if (tokType === _class || tokType === _name || tokType === _function || tokType === _var) {
return parseDeclare(node);
}
} else if (tokType === _name) {
if (expr.name === "interface") {
return parseInterface(node);
} else if (expr.name === "type") {
return parseTypeAlias(node);
}
}
}
}
return parseExpressionStatement(node, expr);
<<<<<<<
if (options.ecmaVersion >= 7 && !isGenerator && tokType === _name && tokVal === "async") {
var asyncId = parseIdent();
if (tokType === _colon || tokType === _parenL) {
prop.key = asyncId;
} else {
isAsync = true;
parsePropertyName(prop);
}
} else {
parsePropertyName(prop);
}
=======
parsePropertyName(prop);
var typeParameters
if (tokType === _lt) {
typeParameters = parseTypeParameterDeclaration();
if (tokType !== _parenL) unexpected();
}
>>>>>>>
if (options.ecmaVersion >= 7 && !isGenerator && tokType === _name && tokVal === "async") {
var asyncId = parseIdent();
if (tokType === _colon || tokType === _parenL) {
prop.key = asyncId;
} else {
isAsync = true;
parsePropertyName(prop);
}
} else {
parsePropertyName(prop);
}
var typeParameters
if (tokType === _lt) {
typeParameters = parseTypeParameterDeclaration();
if (tokType !== _parenL) unexpected();
}
<<<<<<<
method.value = parseMethod(isGenerator, isAsync);
classBody.body.push(finishNode(method, "MethodDefinition"));
eat(_semi);
=======
if (tokType === _colon) {
method.typeAnnotation = parseTypeAnnotation();
semicolon();
classBody.body.push(finishNode(method, "ClassProperty"));
} else {
var typeParameters;
if (tokType === _lt) {
typeParameters = parseTypeParameterDeclaration();
}
method.value = parseMethod(isGenerator);
method.value.typeParameters = typeParameters;
classBody.body.push(finishNode(method, "MethodDefinition"));
eat(_semi);
}
>>>>>>>
if (tokType === _colon) {
if (isGenerator || isAsync) unexpected();
method.typeAnnotation = parseTypeAnnotation();
semicolon();
classBody.body.push(finishNode(method, "ClassProperty"));
} else {
var typeParameters;
if (tokType === _lt) {
typeParameters = parseTypeParameterDeclaration();
}
method.value = parseMethod(isGenerator, isAsync);
method.value.typeParameters = typeParameters;
classBody.body.push(finishNode(method, "MethodDefinition"));
eat(_semi);
} |
<<<<<<<
var q_tmpl = {token: "`", isExpr: true};
var j_oTag = {token: "<tag", isExpr: false}, j_cTag = {token: "</tag", isExpr: false}, j_expr = {token: "<tag>...</tag>", isExpr: true};
function curTokContext() {
return tokContext[tokContext.length - 1];
}
=======
var q_tmpl = {token: "`", isExpr: true}, f_expr = {token: "function", isExpr: true};
function curTokContext() {
return tokContext[tokContext.length - 1];
}
>>>>>>>
var j_oTag = {token: "<tag", isExpr: false}, j_cTag = {token: "</tag", isExpr: false}, j_expr = {token: "<tag>...</tag>", isExpr: true};
var q_tmpl = {token: "`", isExpr: true}, f_expr = {token: "function", isExpr: true};
function curTokContext() {
return tokContext[tokContext.length - 1];
}
<<<<<<<
return curTokContext() === b_stat;
if (prevType === _jsxTagEnd || prevType === _jsxText)
return true;
if (prevType === _jsxName)
return false;
=======
return curTokContext() === b_stat;
>>>>>>>
return curTokContext() === b_stat;
if (prevType === _jsxTagEnd || prevType === _jsxText)
return true;
if (prevType === _jsxName)
return false;
<<<<<<<
tokExprAllowed = !(out && out.isExpr);
preserveSpace = out === b_tmpl || curTokContext() === j_expr;
=======
if (out === b_tmpl) {
preserveSpace = true;
} else if (out === b_stat && curTokContext() === f_expr) {
tokContext.pop();
tokExprAllowed = false;
} else {
tokExprAllowed = !(out && out.isExpr);
}
>>>>>>>
if (out === b_tmpl) {
preserveSpace = true;
} else if (out === b_stat && curTokContext() === f_expr) {
tokContext.pop();
tokExprAllowed = false;
} else {
tokExprAllowed = !(out && out.isExpr);
}
<<<<<<<
var context = curTokContext();
if (context === q_tmpl) {
=======
if (curTokContext() === q_tmpl) {
>>>>>>>
var context = curTokContext();
if (context === q_tmpl) { |
<<<<<<<
case "MemberExpression":
case "VirtualPropertyExpression":
=======
>>>>>>>
case "VirtualPropertyExpression":
case "MemberExpression":
<<<<<<<
if (options.ecmaVersion >= 7) {
// async functions!
if (id.name === "async") {
// arrow functions
if (tokType === _parenL) {
next();
var exprList;
if (tokType !== _parenR) {
var val = parseExpression();
exprList = val.type === "SequenceExpression" ? val.expressions : [val];
} else {
exprList = [];
}
expect(_parenR);
// if '=>' follows '(...)', convert contents to arguments
if (eat(_arrow)) {
return parseArrowExpression(node, exprList, true);
} else {
node.callee = id;
node.arguments = exprList;
return parseSubscripts(finishNode(node, "CallExpression"), start);
}
} else if (tokType === _name) {
id = parseIdent();
if (eat(_arrow)) {
return parseArrowExpression(node, [id], true);
}
return id;
}
// normal functions
if (tokType === _function && !canInsertSemicolon()) {
next();
return parseFunction(node, false, true);
}
} else if (id.name === "await") {
if (inAsync) return parseAwait(node);
}
}
if (eat(_arrow)) {
return parseArrowExpression(node, [id]);
=======
if (!canInsertSemicolon() && eat(_arrow)) {
return parseArrowExpression(startNodeAt(start), [id]);
>>>>>>>
if (options.ecmaVersion >= 7) {
// async functions!
if (id.name === "async") {
// arrow functions
if (tokType === _parenL) {
next();
var exprList;
if (tokType !== _parenR) {
var val = parseExpression();
exprList = val.type === "SequenceExpression" ? val.expressions : [val];
} else {
exprList = [];
}
expect(_parenR);
// if '=>' follows '(...)', convert contents to arguments
if (eat(_arrow)) {
return parseArrowExpression(node, exprList, true);
} else {
node.callee = id;
node.arguments = exprList;
return parseSubscripts(finishNode(node, "CallExpression"), start);
}
} else if (tokType === _name) {
id = parseIdent();
if (eat(_arrow)) {
return parseArrowExpression(node, [id], true);
}
return id;
}
// normal functions
if (tokType === _function && !canInsertSemicolon()) {
next();
return parseFunction(node, false, true);
}
} else if (id.name === "await") {
if (inAsync) return parseAwait(node);
}
}
if (!canInsertSemicolon() && eat(_arrow)) {
return parseArrowExpression(startNodeAt(start), [id]);
<<<<<<<
if (isRelational("<")) {
node.typeParameters = parseTypeParameterDeclaration();
}
parseFunctionParams(node);
=======
expect(_parenL);
node.params = parseBindingList(_parenR, false);
>>>>>>>
if (isRelational("<")) {
node.typeParameters = parseTypeParameterDeclaration();
}
parseFunctionParams(node);
expect(_parenL);
node.params = parseBindingList(_parenR, false);
<<<<<<<
initFunction(node, isAsync);
parseFunctionParams(node);
=======
initFunction(node);
expect(_parenL);
node.params = parseBindingList(_parenR, false);
>>>>>>>
initFunction(node, isAsync);
parseFunctionParams(node);
<<<<<<<
var declar = node.declaration = parseMaybeAssign(true);
if (declar.id) {
if (declar.type === "FunctionExpression") {
declar.type = "FunctionDeclaration";
} else if (declar.type === "ClassExpression") {
declar.type = "ClassDeclaration";
}
}
=======
var expr = parseMaybeAssign();
if (expr.id) {
switch (expr.type) {
case "FunctionExpression": expr.type = "FunctionDeclaration"; break;
case "ClassExpression": expr.type = "ClassDeclaration"; break;
}
}
node.declaration = expr;
>>>>>>>
var expr = parseMaybeAssign();
if (expr.id) {
switch (expr.type) {
case "FunctionExpression": expr.type = "FunctionDeclaration"; break;
case "ClassExpression": expr.type = "ClassDeclaration"; break;
}
}
node.declaration = expr; |
<<<<<<<
if (options.strictMode) {
strict = true;
}
isKeyword = options.ecmaVersion >= 6 ? isEcma6Keyword : isEcma5AndLessKeyword;
=======
if (options.ecmaVersion >= 7) {
isKeyword = isEcma7Keyword;
} else if (options.ecmaVersion === 6) {
isKeyword = isEcma6Keyword;
} else {
isKeyword = isEcma5AndLessKeyword;
}
>>>>>>>
if (options.strictMode) {
strict = true;
}
if (options.ecmaVersion >= 7) {
isKeyword = isEcma7Keyword;
} else if (options.ecmaVersion === 6) {
isKeyword = isEcma6Keyword;
} else {
isKeyword = isEcma5AndLessKeyword;
}
<<<<<<<
var inFunction, inGenerator, labels, strict,
inXJSChild, inXJSTag, inXJSChildExpression;
=======
var inFunction, inGenerator, inAsync, labels, strict;
>>>>>>>
var inFunction, inGenerator, inAsync, labels, strict,
inXJSChild, inXJSTag, inXJSChildExpression;
<<<<<<<
}
=======
}
if (options.ecmaVersion >= 7) {
node.async = isAsync;
}
>>>>>>>
}
if (options.ecmaVersion >= 7) {
node.async = isAsync;
}
<<<<<<<
=======
var oldInAsync = inAsync;
inAsync = node.async;
>>>>>>>
var oldInAsync = inAsync;
inAsync = node.async;
<<<<<<<
}
=======
}
var isAsync = false;
if (options.ecmaVersion >= 7) {
isAsync = eat(_async);
if (tokType === _star) unexpected();
}
>>>>>>>
}
var isAsync = false;
if (options.ecmaVersion >= 7) {
isAsync = eat(_async);
if (tokType === _star) unexpected();
} |
<<<<<<<
var tmp = content;
if (mods) {
var validFlags = /^[gmsiy]*$/;
if (options.ecmaVersion >= 6) validFlags = /^[gmsiyu]*$/;
if (!validFlags.test(mods)) raise(start, "Invalid regular expression flag");
if (mods.indexOf('u') >= 0) {
// Replace each astral symbol and every Unicode code point
// escape sequence that represents such a symbol with a single
// ASCII symbol to avoid throwing on regular expressions that
// are only valid in combination with the `/u` flag.
tmp = tmp
.replace(/\\u\{([0-9a-fA-F]{5,6})\}/g, 'x')
.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, 'x');
}
}
// Detect invalid regular expressions.
=======
var tmp = content;
if (mods) {
var validFlags = /^[gmsiy]*$/;
if (options.ecmaVersion >= 6) validFlags = /^[gmsiyu]*$/;
if (!validFlags.test(mods)) raise(start, "Invalid regular expression flag");
if (mods.indexOf('u') >= 0 && !regexpUnicodeSupport) {
// Replace each astral symbol and every Unicode code point
// escape sequence that represents such a symbol with a single
// ASCII symbol to avoid throwing on regular expressions that
// are only valid in combination with the `/u` flag.
tmp = tmp
.replace(/\\u\{([0-9a-fA-F]{5,6})\}/g, "x")
.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "x");
}
}
// Detect invalid regular expressions.
>>>>>>>
// Detect invalid regular expressions.
var tmp = content;
if (mods) {
var validFlags = /^[gmsiy]*$/;
if (options.ecmaVersion >= 6) validFlags = /^[gmsiyu]*$/;
if (!validFlags.test(mods)) raise(start, "Invalid regular expression flag");
if (mods.indexOf('u') >= 0 && !regexpUnicodeSupport) {
// Replace each astral symbol and every Unicode code point
// escape sequence that represents such a symbol with a single
// ASCII symbol to avoid throwing on regular expressions that
// are only valid in combination with the `/u` flag.
tmp = tmp
.replace(/\\u\{([0-9a-fA-F]{5,6})\}/g, "x")
.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "x");
}
}
// Detect invalid regular expressions.
<<<<<<<
case _num: case _string: case _xjsText:
=======
case _regexp:
var node = startNode();
node.regex = {pattern: tokVal.pattern, flags: tokVal.flags};
node.value = tokVal.value;
node.raw = input.slice(tokStart, tokEnd);
next();
return finishNode(node, "Literal");
case _num: case _string:
>>>>>>>
case _num: case _string: case _xjsText: |
<<<<<<<
const isMaybeStatic = this.match(tt.name) && this.state.value === "static";
let isGenerator = this.eat(tt.star);
let isGetSet = false;
let isAsync = false;
this.parsePropertyName(method);
method.static = isMaybeStatic && !this.match(tt.parenL);
if (method.static) {
isGenerator = this.eat(tt.star);
this.parsePropertyName(method);
}
if (!isGenerator) {
if (this.isClassProperty()) {
=======
method.static = false;
if (this.match(tt.name) && this.state.value === "static") {
const key = this.parseIdentifier(true); // eats 'static'
if (this.isClassMethod()) {
// a method named 'static'
method.kind = "method";
method.computed = false;
method.key = key;
this.parseClassMethod(classBody, method, false, false);
continue;
} else if (this.isClassProperty()) {
// a property named 'static'
method.computed = false;
method.key = key;
>>>>>>>
method.static = false;
if (this.match(tt.name) && this.state.value === "static") {
const key = this.parseIdentifier(true); // eats 'static'
if (this.isClassMethod()) {
// a method named 'static'
method.kind = "method";
method.computed = false;
method.key = key;
this.parseClassMethod(classBody, method, false, false);
continue;
} else if (this.isClassProperty()) {
// a property named 'static'
method.computed = false;
method.key = key;
<<<<<<<
=======
// otherwise something static
method.static = true;
>>>>>>>
// otherwise something static
method.static = true;
<<<<<<<
// disallow invalid constructors
const isConstructor = !method.static && (
(key.name === "constructor") || // Identifier
(key.value === "constructor") // Literal
);
if (isConstructor) {
if (hadConstructor) this.raise(key.start, "Duplicate constructor in the same class");
if (isGetSet) this.raise(key.start, "Constructor can't have get/set modifier");
if (isGenerator) this.raise(key.start, "Constructor can't be a generator");
if (isAsync) this.raise(key.start, "Constructor can't be an async function");
method.kind = "constructor";
hadConstructor = true;
=======
if (!method.computed && method.static && (method.key.name === "prototype" || method.key.value === "prototype")) {
this.raise(method.key.start, "Classes may not have static property named prototype");
>>>>>>>
if (!method.computed && method.static && (method.key.name === "prototype" || method.key.value === "prototype")) {
this.raise(method.key.start, "Classes may not have static property named prototype");
<<<<<<<
}
// disallow decorators on class constructors
if (method.kind === "constructor" && method.decorators) {
this.raise(method.start, "You can't attach decorators to a class constructor");
}
this.parseClassMethod(classBody, method, isGenerator, isAsync);
if (isGetSet) {
this.checkGetterSetterParamCount(method);
=======
>>>>>>> |
<<<<<<<
if (options.strictMode) {
strict = true;
}
isKeyword = options.ecmaVersion >= 6 ? isEcma6Keyword : isEcma5AndLessKeyword;
=======
if (options.ecmaVersion >= 7) {
isKeyword = isEcma7Keyword;
} else if (options.ecmaVersion === 6) {
isKeyword = isEcma6Keyword;
} else {
isKeyword = isEcma5AndLessKeyword;
}
>>>>>>>
if (options.strictMode) {
strict = true;
}
if (options.ecmaVersion >= 7) {
isKeyword = isEcma7Keyword;
} else if (options.ecmaVersion === 6) {
isKeyword = isEcma6Keyword;
} else {
isKeyword = isEcma5AndLessKeyword;
}
<<<<<<<
var inFunction, inGenerator, labels, strict,
inXJSChild, inXJSTag, inXJSChildExpression;
=======
var inFunction, inGenerator, inAsync, labels, strict;
>>>>>>>
var inFunction, inGenerator, inAsync, labels, strict,
inXJSChild, inXJSTag, inXJSChildExpression;
<<<<<<<
}
=======
}
if (options.ecmaVersion >= 7) {
node.async = isAsync;
}
>>>>>>>
}
if (options.ecmaVersion >= 7) {
node.async = isAsync;
}
<<<<<<<
=======
var oldInAsync = inAsync;
inAsync = node.async;
>>>>>>>
var oldInAsync = inAsync;
inAsync = node.async;
<<<<<<<
}
=======
}
var isAsync = false;
if (options.ecmaVersion >= 7) {
isAsync = eat(_async);
if (isAsync && tokType === _star) unexpected();
}
>>>>>>>
}
var isAsync = false;
if (options.ecmaVersion >= 7) {
isAsync = eat(_async);
if (isAsync && tokType === _star) unexpected();
} |
<<<<<<<
var inFunction, inGenerator, inAsync, labels, strict,
inXJSChild, inXJSTag, inXJSChildExpression;
=======
var inFunction, inGenerator, labels, strict,
inXJSChild, inXJSTag;
>>>>>>>
var inFunction, inGenerator, inAsync, labels, strict,
inXJSChild, inXJSTag, inXJSChildExpression;
<<<<<<<
case 125: ++tokPos; return finishToken(_braceR, undefined, !inXJSChildExpression);
=======
case 125: ++tokPos; return finishToken(_braceR, undefined, !inXJSChild);
case 58: ++tokPos; return finishToken(_colon);
>>>>>>>
case 125: ++tokPos; return finishToken(_braceR, undefined, !inXJSChild); |
<<<<<<<
{ path: '/eventstream', component: EventStream}
];
=======
{ path: '/eventstream', component: EventStream },
{ path: '/componentTree', component: ComponentTree }
];
>>>>>>>
{ path: '/componentTree', component: ComponentTree }
];
<<<<<<<
});
=======
});
import BootstrapVue from 'bootstrap-vue';
import 'bootstrap/dist/css/bootstrap.css';
import 'bootstrap-vue/dist/bootstrap-vue.css';
Vue.use(BootstrapVue);
>>>>>>>
}); |
<<<<<<<
casperIns.waitFor(function checkWeather() {
return casperIns.evaluate(function () {
return window.to_casper_weather
})
}, function () {
var weather = JSON.parse(casperIns.evaluate(function () {
var weather = window.to_casper_weather;
window.to_casper_weather = null;
return weather;
}))
casperIns.evaluate(function () {
return window.to_casper_weather=null
})
if(weather.status==1000){
message.send(casperIns, formatWeather(local, weather))
}else{
message.send(casperIns, '未查找到相关天气信息。请尝试输入格式如"广州天气"。')
}
}, function () {
console.log('请求天气超时...')
}, 10000)
=======
//手机查询
'/^1[34578]\d{9}$/': function() {
//https://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=15717501945
// __GetZoneResult_ = {
// mts: '1510363',
// province: '海南',
// catName: '中国移动',
// telString: '15103637664',
// areaVid: '30520',
// ispVid: '3236139',
// carrier: '海南移动'
// }
>>>>>>>
//手机查询
'/^1[34578]\d{9}$/': function () {
//https://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=15717501945
// __GetZoneResult_ = {
// mts: '1510363',
// province: '海南',
// catName: '中国移动',
// telString: '15103637664',
// areaVid: '30520',
// ispVid: '3236139',
// carrier: '海南移动'
// } |
<<<<<<<
var lastpos = null;
=======
ctx.fillStyle= "rgba(255, 255, 255, 1)";
ctx.fillRect(0, 0, canvas.width, canvas.height);
var lastpos = [0,0];
>>>>>>>
var lastpos = null;
ctx.fillStyle= "rgba(255, 255, 255, 1)";
ctx.fillRect(0, 0, canvas.width, canvas.height); |
<<<<<<<
[JOBS.DARK_KNIGHT.logType]: () => import('./jobs/drk' /* webpackChunkName: "jobs-drk" */),
=======
[JOBS.MACHINIST.logType]: () => import('./jobs/mch' /* webpackChunkName: "jobs-mch" */),
>>>>>>>
[JOBS.DARK_KNIGHT.logType]: () => import('./jobs/drk' /* webpackChunkName: "jobs-drk" */),
[JOBS.MACHINIST.logType]: () => import('./jobs/mch' /* webpackChunkName: "jobs-mch" */), |
<<<<<<<
// import ArcanaTracking from './ArcanaTracking'
// import ArcanaSuggestions from './ArcanaSuggestions'
import Sect from './Sect'
=======
import {ArcanaTracking, ArcanaSuggestions} from './ArcanaTracking'
>>>>>>>
import {ArcanaTracking, ArcanaSuggestions} from './ArcanaTracking'
import Sect from './Sect'
<<<<<<<
// ArcanaTracking,
// ArcanaSuggestions,
Sect,
=======
ArcanaTracking,
ArcanaSuggestions,
>>>>>>>
ArcanaTracking,
ArcanaSuggestions,
Sect, |
<<<<<<<
import CelestialIntersection from './CelestialIntersection'
import Overheal from './Overheal'
// import ArcanaTracking from './ArcanaTracking'
// import ArcanaSuggestions from './ArcanaSuggestions'
=======
import {ArcanaTracking, ArcanaSuggestions} from './ArcanaTracking'
import Sect from './Sect'
>>>>>>>
import {ArcanaTracking, ArcanaSuggestions} from './ArcanaTracking'
import Sect from './Sect'
import CelestialIntersection from './CelestialIntersection'
import Overheal from './Overheal'
<<<<<<<
// ArcanaTracking,
// ArcanaSuggestions,
CelestialIntersection,
Overheal,
=======
ArcanaTracking,
ArcanaSuggestions,
Sect,
>>>>>>>
ArcanaTracking,
ArcanaSuggestions,
Sect,
CelestialIntersection,
Overheal, |
<<<<<<<
import BRD from './BRD'
=======
import BLM from './BLM'
>>>>>>>
import BRD from './BRD'
import BLM from './BLM'
<<<<<<<
...BRD,
=======
...NIN,
...BLM,
>>>>>>>
...BRD,
...NIN,
...BLM, |
<<<<<<<
import DRK from './DRK'
=======
import WHM from './WHM'
import PLD from './PLD'
import SAM from './SAM'
>>>>>>>
import WHM from './WHM'
import PLD from './PLD'
import SAM from './SAM'
import DRK from './DRK' |
<<<<<<<
[JOBS.BARD.logType]: () => import('./jobs/brd' /* webpackChunkName: "jobs-smn" */),
=======
[JOBS.BLACK_MAGE.logType]: () => import('./jobs/blm' /* webpackChunkName: "jobs-blm" */),
>>>>>>>
[JOBS.BARD.logType]: () => import('./jobs/brd' /* webpackChunkName: "jobs-smn" */),
[JOBS.BLACK_MAGE.logType]: () => import('./jobs/blm' /* webpackChunkName: "jobs-blm" */), |
<<<<<<<
[JOBS.BARD.logType]: () => import('./jobs/brd' /* webpackChunkName: "jobs-smn" */),
=======
[JOBS.RED_MAGE.logType]: () => import('./jobs/rdm' /* webpackChunkName: "jobs-rdm" */),
[JOBS.WARRIOR.logType]: () => import('./jobs/war' /* webpackChunkName: "jobs-war" */),
>>>>>>>
[JOBS.BARD.logType]: () => import('./jobs/brd' /* webpackChunkName: "jobs-smn" */),
[JOBS.RED_MAGE.logType]: () => import('./jobs/rdm' /* webpackChunkName: "jobs-rdm" */),
[JOBS.WARRIOR.logType]: () => import('./jobs/war' /* webpackChunkName: "jobs-war" */), |
<<<<<<<
import CardSubscriptions from "app/mixins/subscriptions/card";
import Messaging from "app/mixins/messaging";
import IssueFiltersMixin from "app/mixins/issue-filters";
=======
import CardRelationshipParser from 'app/utilities/parsing/card-relationship-parser';
import issueReferenceVisitor from 'app/visitors/issue/references';
>>>>>>>
import CardSubscriptions from "app/mixins/subscriptions/card";
import Messaging from "app/mixins/messaging";
import IssueFiltersMixin from "app/mixins/issue-filters";
import CardRelationshipParser from 'app/utilities/parsing/card-relationship-parser';
import issueReferenceVisitor from 'app/visitors/issue/references'; |
<<<<<<<
over: function(){
_self.set('isHovering', true);
},
out: function(){
_self.set('isHovering', false);
},
stop: function(ev, ui){
_self.set('freezeIssueArray', false);
},
=======
>>>>>>>
stop: function(ev, ui){
_self.set('freezeIssueArray', false);
}, |
<<<<<<<
return new MockView(domToArrayTreeCursor($(this.top).get(0)),
[],
=======
return new MockView(domToCursor($(this.top).get(0)),
EMPTY_PENDING_ACTIONS,
>>>>>>>
return new MockView(domToArrayTreeCursor($(this.top).get(0)),
EMPTY_PENDING_ACTIONS, |
<<<<<<<
ContinuationMarkSet.prototype.toDomNode = function(params) {
=======
ContinuationMarkSet.prototype.shift = function() {
this.kvlists.shift();
};
ContinuationMarkSet.prototype.toDomNode = function(cache) {
>>>>>>>
ContinuationMarkSet.prototype.shift = function() {
this.kvlists.shift();
};
ContinuationMarkSet.prototype.toDomNode = function(params) {
<<<<<<<
var isContinuationMarkSet = baselib.makeClassPredicate(ContinuationMarkSet);
=======
>>>>>>>
var isContinuationMarkSet = baselib.makeClassPredicate(ContinuationMarkSet);
<<<<<<<
var isContinuationPromptTag = baselib.makeClassPredicate(ContinuationPromptTag);
var DEFAULT_CONTINUATION_PROMPT_TAG =
new ContinuationPromptTag("default-continuation-prompt-tag");
=======
var isContinuationMarkSet = baselib.makeClassPredicate(ContinuationMarkSet);
var isContinuationPromptTag = baselib.makeClassPredicate(ContinuationPromptTag);
>>>>>>>
var isContinuationPromptTag = baselib.makeClassPredicate(ContinuationPromptTag);
var DEFAULT_CONTINUATION_PROMPT_TAG =
new ContinuationPromptTag("default-continuation-prompt-tag");
<<<<<<<
exports.isContinuationPromptTag = isContinuationPromptTag;
exports.DEFAULT_CONTINUATION_PROMPT_TAG = DEFAULT_CONTINUATION_PROMPT_TAG;
=======
exports.isContinuationMarkSet = isContinuationMarkSet;
exports.isContinuationPromptTag = isContinuationPromptTag;
>>>>>>>
exports.isContinuationPromptTag = isContinuationPromptTag;
exports.DEFAULT_CONTINUATION_PROMPT_TAG = DEFAULT_CONTINUATION_PROMPT_TAG; |
<<<<<<<
if (i1 < 0) i1 = 0;
=======
i1 = Sk.builtin.asnum$(i1);
i2 = Sk.builtin.asnum$(i2);
>>>>>>>
i1 = Sk.builtin.asnum$(i1);
i2 = Sk.builtin.asnum$(i2);
if (i1 < 0) i1 = 0;
<<<<<<<
Sk.builtin.pyCheckArgs("split", arguments, 1, 3);
if (on === undefined) {
on = null;
}
if ((on !== null) && !Sk.builtin.checkString(on)) {
throw new Sk.builtin.TypeError("expected a string");
}
if ((on !== null) && on.v === "") {
throw new Sk.builtin.ValueError("empty separator");
}
if ((howmany !== undefined) && !Sk.builtin.checkInt(howmany)) {
throw new Sk.builtin.TypeError("an integer is required");
}
var regex = /[\s]+/g;
var str = self.v;
if (on === null) {
str = str.trimLeft();
=======
howmany = Sk.builtin.asnum$(howmany);
var res;
if (! on) {
res = self.v.trim().split(/[\s]+/, howmany);
>>>>>>>
Sk.builtin.pyCheckArgs("split", arguments, 1, 3);
if (on === undefined) {
on = null;
}
if ((on !== null) && !Sk.builtin.checkString(on)) {
throw new Sk.builtin.TypeError("expected a string");
}
if ((on !== null) && on.v === "") {
throw new Sk.builtin.ValueError("empty separator");
}
if ((howmany !== undefined) && !Sk.builtin.checkInt(howmany)) {
throw new Sk.builtin.TypeError("an integer is required");
}
var regex = /[\s]+/g;
var str = self.v;
if (on === null) {
str = str.trimLeft(); |
<<<<<<<
Sk.abstr.setUpInheritance($name, klass, best_base, metaclass);
=======
klass.prototype.tp$name = _name;
klass.prototype.ob$type = Sk.builtin.type.makeIntoTypeObj(_name, klass);
// set __module__ if not present (required by direct type(name, bases, dict) calls)
if(dict.mp$lookup(Sk.builtin.str.$module) === undefined) {
dict.mp$ass_subscript(Sk.builtin.str.$module, Sk.globals["__name__"]);
}
>>>>>>>
Sk.abstr.setUpInheritance($name, klass, best_base, metaclass);
<<<<<<<
if (klass.prototype.sk$prototypical) {
klass.$typeLookup = function (pyName) {
var jsName = pyName.$mangled;
return this.prototype[jsName];
=======
// We do not define tp$getattr here. We usually inherit it from object,
// unless we (or one of our parents) overrode it by defining
// __getattribute__. It's handled down with the other dunder-funcs.
// We could migrate other tp$/dunder-functions that way, but
// tp$getattr() is the performance hot-spot, and doing it this way
// allows us to work out *once* whether this class has a
// __getattribute__, rather than checking on every tp$getattr() call
klass.prototype.tp$str = function () {
const strf = Sk.abstr.lookupSpecial(this, Sk.builtin.str.$str);
if (strf !== undefined && strf !== Sk.builtin.object.prototype["__str__"]) {
return Sk.misceval.callsimArray(strf, [this]);
}
if ((klass.prototype.tp$base !== undefined) &&
(klass.prototype.tp$base !== Sk.builtin.object) &&
(klass.prototype.tp$base.prototype.tp$str !== undefined)) {
// If subclass of a builtin which is not object, use that class' repr
return klass.prototype.tp$base.prototype.tp$str.call(this);
}
return this["$r"]();
};
klass.prototype.tp$length = function (canSuspend) {
var r = Sk.misceval.chain(Sk.abstr.gattr(this, Sk.builtin.str.$len, canSuspend), function(lenf) {
return Sk.misceval.applyOrSuspend(lenf, undefined, undefined, undefined, []);
});
return canSuspend ? r : Sk.misceval.retryOptionalSuspensionOrThrow(r);
>>>>>>>
if (klass.prototype.sk$prototypical) {
klass.$typeLookup = function (pyName) {
var jsName = pyName.$mangled;
return this.prototype[jsName];
<<<<<<<
=======
klass.prototype.tp$setitem = function (key, value, canSuspend) {
var setf = this.tp$getattr(Sk.builtin.str.$setitem, canSuspend), r;
if (setf !== undefined) {
r = Sk.misceval.applyOrSuspend(setf, undefined, undefined, undefined, [key, value]);
return canSuspend ? r : Sk.misceval.retryOptionalSuspensionOrThrow(r);
}
throw new Sk.builtin.TypeError("'" + Sk.abstr.typeName(this) + "' object does not support item assignment");
};
if (bases) {
//print("building mro for", name);
//for (var i = 0; i < bases.length; ++i)
//print("base[" + i + "]=" + bases[i].tp$name);
klass["$d"] = new Sk.builtin.dict([]);
klass["$d"].mp$ass_subscript(Sk.builtin.type.basesStr_, bases);
mro = Sk.builtin.type.buildMRO(klass);
klass["$d"].mp$ass_subscript(Sk.builtin.type.mroStr_, mro);
klass.tp$mro = mro;
//print("mro result", Sk.builtin.repr(mro).v);
}
// fix for class attributes
klass.tp$setattr = Sk.builtin.type.prototype.tp$setattr;
// Register skulpt shortcuts to magic methods defined by this class.
// Dynamically defined methods (eg those returned by __getattr__())
// cannot be used by these magic functions; this is consistent with
// how CPython handles "new-style" classes:
// https://docs.python.org/2/reference/datamodel.html#special-method-lookup-for-old-style-classes
var dunder;
for (dunder in Sk.dunderToSkulpt) {
if (klass.hasOwnProperty(dunder)) {
Sk.builtin.type.$allocateSlot(klass, dunder);
}
}
// tp$getattr is a special case; we need to catch AttributeErrors and
// return undefined instead.
let getattributeFn = Sk.builtin.type.typeLookup(klass, Sk.builtin.str.$getattribute);
if (getattributeFn !== undefined && getattributeFn !== Sk.builtin.object.prototype.__getattribute__) {
klass.prototype.tp$getattr = function (pyName, canSuspend) {
let r = Sk.misceval.tryCatch(
() => Sk.misceval.callsimOrSuspendArray(getattributeFn, [this, pyName]),
function (e) {
if (e instanceof Sk.builtin.AttributeError) {
return undefined;
} else {
throw e;
}
}
);
return canSuspend ? r : Sk.misceval.retryOptionalSuspensionOrThrow(r);
};
} else if (!klass.prototype.tp$getattr) {
// This is only relevant in Python 2, where
// it's possible not to inherit from object
// (or perhaps when inheriting from builtins? Unclear)
klass.prototype.tp$getattr = Sk.builtin.object.prototype.GenericGetAttr;
}
return klass;
>>>>>>>
<<<<<<<
=======
return undefined;
};
Sk.builtin.type.prototype.tp$setattr = function (pyName, value) {
// class attributes are direct properties of the object
if (this.sk$klass === undefined) {
throw new Sk.builtin.TypeError("can't set attributes of built-in/extension type '" + this.prototype.tp$name + "'");
}
var jsName = Sk.fixReserved(pyName.$jsstr());
this[jsName] = value;
>>>>>>>
<<<<<<<
Sk.builtin.type.prototype.$typeLookup = function (pyName) {
const proto = this.prototype;
const jsName = pyName.$mangled;
if (proto.sk$prototypical === true) {
return proto[jsName];
=======
Sk.builtin.type.typeLookup = function (type, pyName) {
var mro = type.tp$mro;
var base;
var res;
var i;
var jsName = pyName.$mangled;
// todo; probably should fix this, used for builtin types to get stuff
// from prototype
if (!mro) {
if (type.prototype) {
return type.prototype[jsName];
}
return undefined;
>>>>>>>
Sk.builtin.type.prototype.$typeLookup = function (pyName) {
const proto = this.prototype;
const jsName = pyName.$mangled;
if (proto.sk$prototypical === true) {
return proto[jsName];
<<<<<<<
for (let i = 0; i < kbases.length; ++i) {
all.push([...kbases[i].prototype.tp$mro]);
}
const bases = [];
for (let i = 0; i < kbases.length; ++i) {
bases.push(kbases[i]);
}
all.push(bases);
return this.$mroMerge_(all);
};
Sk.builtin.type.prototype.$isSubType = function (other) {
return this === other || this.prototype instanceof other || (!this.prototype.sk$prototypical && this.prototype.tp$mro.includes(other));
};
Sk.builtin.type.prototype.$allocateSlots = function () {
// only allocate certain slots
const proto = { ...this.prototype };
for (let dunder in proto) {
if (dunder in Sk.slots) {
const dunderFunc = proto[dunder];
this.$allocateSlot(dunder, dunderFunc);
}
}
if (!proto.sk$prototypical) {
// we allocate getter slots on non-prototypical klasses that walk the MRO
// and who don't have the dunder already declared
for (let dunder in Sk.slots) {
if (!proto.hasOwnProperty(dunder)) {
this.$allocateGetterSlot(dunder);
}
}
}
};
=======
>>>>>>>
for (let i = 0; i < kbases.length; ++i) {
all.push([...kbases[i].prototype.tp$mro]);
}
const bases = [];
for (let i = 0; i < kbases.length; ++i) {
bases.push(kbases[i]);
}
all.push(bases);
return this.$mroMerge_(all);
};
Sk.builtin.type.prototype.$isSubType = function (other) {
return this === other || this.prototype instanceof other || (!this.prototype.sk$prototypical && this.prototype.tp$mro.includes(other));
};
Sk.builtin.type.prototype.$allocateSlots = function () {
// only allocate certain slots
const proto = { ...this.prototype };
for (let dunder in proto) {
if (dunder in Sk.slots) {
const dunderFunc = proto[dunder];
this.$allocateSlot(dunder, dunderFunc);
}
}
if (!proto.sk$prototypical) {
// we allocate getter slots on non-prototypical klasses that walk the MRO
// and who don't have the dunder already declared
for (let dunder in Sk.slots) {
if (!proto.hasOwnProperty(dunder)) {
this.$allocateGetterSlot(dunder);
}
}
}
}; |
<<<<<<<
Sk.builtin.interned = Object.create(null); // avoid name conflicts with Object.prototype
function getInterned(x) {
return Sk.builtin.interned[x];
}
function setInterned(x, pyStr) {
Sk.builtin.interned[x] = pyStr;
}
=======
Sk.builtin.interned = Object.create(null);
function getInterned (x) {
return Sk.builtin.interned[x];
}
function setInterned (x, pyStr) {
Sk.builtin.interned[x] = pyStr;
}
>>>>>>>
Sk.builtin.interned = Object.create(null); // avoid name conflicts with Object.prototype
function getInterned(x) {
return Sk.builtin.interned[x];
}
function setInterned(x, pyStr) {
Sk.builtin.interned[x] = pyStr;
}
<<<<<<<
if (interned !== undefined) {
return interned;
} else {
setInterned(ret, this);
=======
const interned = getInterned(ret);
if (interned !== undefined) {
return interned;
>>>>>>>
if (interned !== undefined) {
return interned;
} else {
setInterned(ret, this);
<<<<<<<
=======
this["v"] = this.v;
setInterned(ret, this);
return this;
>>>>>>>
<<<<<<<
=======
Sk.builtin.str.prototype.__contains__ = new Sk.builtin.func(function(self, item) {
Sk.builtin.pyCheckArgsLen("__contains__", arguments.length - 1, 1, 1);
return new Sk.builtin.bool(self.v.indexOf(item.v) != -1);
});
Sk.builtin.str.prototype.__iter__ = new Sk.builtin.func(function (self) {
return new Sk.builtin.str_iter_(self);
});
>>>>>>>
<<<<<<<
Sk.builtin.str.methods.startswith = function (self, tgt) {
Sk.builtin.pyCheckArgsLen("startswith", arguments.length, 2, 2);
Sk.builtin.pyCheckType("tgt", "string", Sk.builtin.checkString(tgt));
return new Sk.builtin.bool(self.v.indexOf(tgt.v) === 0);
};
=======
Sk.builtin.str.prototype["startswith"] = new Sk.builtin.func(function (self, prefix, start, end) {
Sk.builtin.pyCheckArgsLen("startswith", arguments.length -1 , 1, 3);
if(Sk.abstr.typeName(prefix) != "str" && Sk.abstr.typeName(prefix) != "tuple"){
throw new Sk.builtin.TypeError("startswith first arg must be str or a tuple of str, not " + Sk.abstr.typeName(prefix));
}
if ((start !== undefined) && !Sk.misceval.isIndex(start) && !Sk.builtin.checkNone(start)) {
throw new Sk.builtin.TypeError("slice indices must be integers or None or have an __index__ method");
}
if ((end !== undefined) && !Sk.misceval.isIndex(end) && !Sk.builtin.checkNone(end)) {
throw new Sk.builtin.TypeError("slice indices must be integers or None or have an __index__ method");
}
if (start === undefined || Sk.builtin.checkNone(start)) {
start = 0;
} else {
start = Sk.misceval.asIndex(start);
start = start >= 0 ? start : self.v.length + start;
}
if (end === undefined || Sk.builtin.checkNone(end)) {
end = self.v.length;
} else {
end = Sk.misceval.asIndex(end);
end = end >= 0 ? end : self.v.length + end;
}
if(start > self.v.length){
return Sk.builtin.bool.false$;
}
var substr = self.v.slice(start, end);
if(Sk.abstr.typeName(prefix) == "tuple"){
var tmpBool = false, resultBool = false;
if(start > end){
tmpBool = start <= 0;
}
if(tmpBool){
return Sk.builtin.bool.true$;
}
var it, i;
for (it = Sk.abstr.iter(prefix), i = it.tp$iternext(); i !== undefined; i = it.tp$iternext()) {
if(!tmpBool){
tmpBool = substr.indexOf(i.v) === 0;
}
resultBool = resultBool || tmpBool;
if(resultBool){
break;
}
}
return resultBool?Sk.builtin.bool.true$ : Sk.builtin.bool.false$;
}
if(prefix.v == "" && start > end && end >= 0){
return Sk.builtin.bool.false$;
}
return new Sk.builtin.bool(substr.indexOf(prefix.v) === 0);
});
>>>>>>>
Sk.builtin.str.methods.startswith = function (self, prefix, start, end) {
Sk.builtin.pyCheckArgsLen("startswith", arguments.length, 1, 3, false, true);
if(Sk.abstr.typeName(prefix) != "str" && Sk.abstr.typeName(prefix) != "tuple"){
throw new Sk.builtin.TypeError("startswith first arg must be str or a tuple of str, not " + Sk.abstr.typeName(prefix));
}
if ((start !== undefined) && !Sk.misceval.isIndex(start) && !Sk.builtin.checkNone(start)) {
throw new Sk.builtin.TypeError("slice indices must be integers or None or have an __index__ method");
}
if ((end !== undefined) && !Sk.misceval.isIndex(end) && !Sk.builtin.checkNone(end)) {
throw new Sk.builtin.TypeError("slice indices must be integers or None or have an __index__ method");
}
if (start === undefined || Sk.builtin.checkNone(start)) {
start = 0;
} else {
start = Sk.misceval.asIndex(start);
start = start >= 0 ? start : self.v.length + start;
}
if (end === undefined || Sk.builtin.checkNone(end)) {
end = self.v.length;
} else {
end = Sk.misceval.asIndex(end);
end = end >= 0 ? end : self.v.length + end;
}
if(start > self.v.length){
return Sk.builtin.bool.false$;
}
var substr = self.v.slice(start, end);
if(Sk.abstr.typeName(prefix) == "tuple"){
var tmpBool = false, resultBool = false;
if(start > end){
tmpBool = start <= 0;
}
if(tmpBool){
return Sk.builtin.bool.true$;
}
var it, i;
for (it = Sk.abstr.iter(prefix), i = it.tp$iternext(); i !== undefined; i = it.tp$iternext()) {
if(!tmpBool){
tmpBool = substr.indexOf(i.v) === 0;
}
resultBool = resultBool || tmpBool;
if(resultBool){
break;
}
}
return resultBool?Sk.builtin.bool.true$ : Sk.builtin.bool.false$;
}
if(prefix.v == "" && start > end && end >= 0){
return Sk.builtin.bool.false$;
}
return new Sk.builtin.bool(substr.indexOf(prefix.v) === 0);
};
<<<<<<<
Sk.builtin.str.methods.endswith = function (self, tgt) {
Sk.builtin.pyCheckArgsLen("endswith", arguments.length, 2, 2);
Sk.builtin.pyCheckType("tgt", "string", Sk.builtin.checkString(tgt));
return new Sk.builtin.bool(self.v.indexOf(tgt.v, self.v.length - tgt.v.length) !== -1);
};
=======
Sk.builtin.str.prototype["endswith"] = new Sk.builtin.func(function (self, suffix, start, end) {
Sk.builtin.pyCheckArgsLen("endswith", arguments.length - 1, 1, 3);
if(Sk.abstr.typeName(suffix) != "str" && Sk.abstr.typeName(suffix) != "tuple"){
throw new Sk.builtin.TypeError("endswith first arg must be str or a tuple of str, not " + Sk.abstr.typeName(suffix));
}
if ((start !== undefined) && !Sk.misceval.isIndex(start) && !Sk.builtin.checkNone(start)) {
throw new Sk.builtin.TypeError("slice indices must be integers or None or have an __index__ method");
}
if ((end !== undefined) && !Sk.misceval.isIndex(end) && !Sk.builtin.checkNone(end)) {
throw new Sk.builtin.TypeError("slice indices must be integers or None or have an __index__ method");
}
if (start === undefined || Sk.builtin.checkNone(start)) {
start = 0;
} else {
start = Sk.misceval.asIndex(start);
start = start >= 0 ? start : self.v.length + start;
}
if (end === undefined || Sk.builtin.checkNone(end)) {
end = self.v.length;
} else {
end = Sk.misceval.asIndex(end);
end = end >= 0 ? end : self.v.length + end;
}
if(start > self.v.length){
return Sk.builtin.bool.false$;
}
//take out the substring
var substr = self.v.slice(start, end);
if(Sk.abstr.typeName(suffix) == "tuple"){
var tmpBool = false, resultBool = false;
if(start > end){
tmpBool = start <= 0;
}
if(tmpBool){
return Sk.builtin.bool.true$;
}
var it, i;
for (it = Sk.abstr.iter(suffix), i = it.tp$iternext(); i !== undefined; i = it.tp$iternext()) {
if(!tmpBool){
tmpBool = substr.indexOf(i.v, substr.length - i.v.length) !== -1;
}
resultBool = resultBool || tmpBool;
if(resultBool){
break;
}
}
return resultBool?Sk.builtin.bool.true$ : Sk.builtin.bool.false$;
}
if(suffix.v == "" && start > end && end >= 0){
return Sk.builtin.bool.false$;
}
return new Sk.builtin.bool(substr.indexOf(suffix.v, substr.length - suffix.v.length) !== -1);
});
>>>>>>>
Sk.builtin.str.methods.endswith = function (self, suffix, start, end) {
Sk.builtin.pyCheckArgsLen("endswith", arguments.length, 1, 3, false, true);
if(Sk.abstr.typeName(suffix) != "str" && Sk.abstr.typeName(suffix) != "tuple"){
throw new Sk.builtin.TypeError("endswith first arg must be str or a tuple of str, not " + Sk.abstr.typeName(suffix));
}
if ((start !== undefined) && !Sk.misceval.isIndex(start) && !Sk.builtin.checkNone(start)) {
throw new Sk.builtin.TypeError("slice indices must be integers or None or have an __index__ method");
}
if ((end !== undefined) && !Sk.misceval.isIndex(end) && !Sk.builtin.checkNone(end)) {
throw new Sk.builtin.TypeError("slice indices must be integers or None or have an __index__ method");
}
if (start === undefined || Sk.builtin.checkNone(start)) {
start = 0;
} else {
start = Sk.misceval.asIndex(start);
start = start >= 0 ? start : self.v.length + start;
}
if (end === undefined || Sk.builtin.checkNone(end)) {
end = self.v.length;
} else {
end = Sk.misceval.asIndex(end);
end = end >= 0 ? end : self.v.length + end;
}
if(start > self.v.length){
return Sk.builtin.bool.false$;
}
//take out the substring
var substr = self.v.slice(start, end);
if(Sk.abstr.typeName(suffix) == "tuple"){
var tmpBool = false, resultBool = false;
if(start > end){
tmpBool = start <= 0;
}
if(tmpBool){
return Sk.builtin.bool.true$;
}
var it, i;
for (it = Sk.abstr.iter(suffix), i = it.tp$iternext(); i !== undefined; i = it.tp$iternext()) {
if(!tmpBool){
tmpBool = substr.indexOf(i.v, substr.length - i.v.length) !== -1;
}
resultBool = resultBool || tmpBool;
if(resultBool){
break;
}
}
return resultBool?Sk.builtin.bool.true$ : Sk.builtin.bool.false$;
}
if(suffix.v == "" && start > end && end >= 0){
return Sk.builtin.bool.false$;
}
return new Sk.builtin.bool(substr.indexOf(suffix.v, substr.length - suffix.v.length) !== -1);
};
<<<<<<<
=======
>>>>>>> |
<<<<<<<
=======
} else if ((x === null) || (x === Sk.builtin.none.none$)) {
ret = "None";
} else if (x instanceof Sk.builtin.bool) {
if (x.v) {
ret = "True";
} else {
ret = "False";
}
>>>>>>>
<<<<<<<
=======
this["v"] = this.v;
setInterned(ret, this);
this.$mangled = fixReserved(ret);
return this;
>>>>>>>
<<<<<<<
if (on === undefined || on instanceof Sk.builtin.none) {
=======
if ((on === undefined) || (on === Sk.builtin.none.none$)) {
>>>>>>>
if ((on === undefined) || (on === Sk.builtin.none.none$)) {
<<<<<<<
return name + "_$rw$";
}
Sk.builtin.str.reservedWords_ = reservedWords_;
=======
return ret;
};
var reservedWords_ = {
"abstract": true,
"as": true,
"boolean": true,
"break": true,
"byte": true,
"case": true,
"catch": true,
"char": true,
"class": true,
"continue": true,
"const": true,
"debugger": true,
"default": true,
"delete": true,
"do": true,
"double": true,
"else": true,
"enum": true,
"export": true,
"extends": true,
"false": true,
"final": true,
"finally": true,
"float": true,
"for": true,
"function": true,
"goto": true,
"if": true,
"implements": true,
"import": true,
"in": true,
"instanceof": true,
"int": true,
"interface": true,
"is": true,
"long": true,
"namespace": true,
"native": true,
"new": true,
"null": true,
"package": true,
"private": true,
"protected": true,
"public": true,
"return": true,
"short": true,
"static": true,
// "super": false,
"switch": true,
"synchronized": true,
"this": true,
"throw": true,
"throws": true,
"transient": true,
"true": true,
"try": true,
"typeof": true,
"use": true,
"var": true,
"void": true,
"volatile": true,
"while": true,
"with": true,
// reserved Names
"__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,
};
Sk.builtin.str.reservedWords_ = reservedWords_;
function fixReserved(name) {
if (reservedWords_[name] === undefined) {
return name;
}
return name + "_$rw$";
}
>>>>>>>
return name + "_$rw$";
}
Sk.builtin.str.reservedWords_ = reservedWords_; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.