conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
if (modifiedRequestObject.data.body.profileId) {
return Promise.reject(new BadRequestError('profile can not be provided in updateSelf'));
=======
if (modifiedRequestObject.data.body.profilesIds) {
return q.reject(new BadRequestError('profile can not be provided in updateSelf'));
>>>>>>>
if (modifiedRequestObject.data.body.profilesIds) {
return Promise.reject(new BadRequestError('profile can not be provided in updateSelf')); |
<<<<<<<
=======
setLastSub(data['user'].username);
eventsRouter.cachedEvent(event);
>>>>>>>
setLastSub(data['user'].username);
<<<<<<<
=======
setLastSub(data['user'].username);
eventsRouter.cachedEvent(event);
>>>>>>>
setLastSub(data['user'].username);
<<<<<<<
=======
setLastSub(data['user'].username);
eventsRouter.cachedEvent(event);
>>>>>>>
setLastSub(data['user'].username); |
<<<<<<<
const shell = require("electron").shell;
const fs = require("fs");
const request = require("request");
const List = require("list.js");
const howler = require("howler");
const compareVersions = require("compare-versions");
const marked = require("marked");
const path = require("path");
require("angular");
require("angular-animate");
require("angular-route");
require("angular-sanitize");
require("angular-ui-bootstrap");
require("angularjs-slider");
require("ui-select");
require("angular-ui-sortable");
require("angularjs-scroll-glue");
require("ng-toast");
require("../../node_modules/angular-summernote/dist/angular-summernote");
require("angular-translate");
require("../../node_modules/angular-translate-loader-url/angular-translate-loader-url");
require("../../node_modules/angular-translate-loader-static-files/angular-translate-loader-static-files");
=======
const shell = require('electron').shell;
const fs = require('fs');
const request = require('request');
const List = require('list.js');
const compareVersions = require('compare-versions');
const marked = require('marked');
const path = require('path');
require('angular');
require('angular-animate');
require('angular-route');
require('angular-sanitize');
require('angular-ui-bootstrap');
require('angularjs-slider');
require('ui-select');
require('angular-ui-sortable');
require('ng-youtube-embed');
require('../../node_modules/angular-summernote/dist/angular-summernote');
>>>>>>>
const shell = require("electron").shell;
const fs = require("fs");
const request = require("request");
const List = require("list.js");
const compareVersions = require("compare-versions");
const marked = require("marked");
const path = require("path");
require("angular");
require("angular-animate");
require("angular-route");
require("angular-sanitize");
require("angular-ui-bootstrap");
require("angularjs-slider");
require("ui-select");
require("angular-ui-sortable");
require('ng-youtube-embed');
require("ng-toast");
require("../../node_modules/angular-summernote/dist/angular-summernote");
require("angular-translate");
require("../../node_modules/angular-translate-loader-url/angular-translate-loader-url");
require("../../node_modules/angular-translate-loader-static-files/angular-translate-loader-static-files");
<<<<<<<
console.log(error, url, line);
logger.error("(Renderer) " + error, { url: url, line: line });
=======
logger.error("(Renderer) " + error, { error: error, url: url, line: line });
>>>>>>>
logger.error("(Renderer) " + error, { error: error, url: url, line: line }); |
<<<<<<<
const userDatabase = require("./lib/database/userDatabase");
const connectionManager = require("./lib/common/connection-manager");
const webServer = require("./server/httpServer");
const authManager = require("./lib/common/perform-auth");
=======
const fontManager = require("./lib/fontManager");
const apiServer = require('./api/apiServer.js');
>>>>>>>
const userDatabase = require("./lib/database/userDatabase");
const connectionManager = require("./lib/common/connection-manager");
const webServer = require("./server/httpServer");
const authManager = require("./lib/common/perform-auth");
const fontManager = require("./lib/fontManager");
<<<<<<<
activeProfiles.forEach(profileId => {
// Create the scripts folder if it doesn't exist
if (!dataAccess.userDataPathExistsSync("/profiles/" + profileId)) {
logger.info(
"Can't find a profile folder for " + profileId + ", creating one now..."
);
dataAccess.makeDirInUserDataSync("/profiles/" + profileId);
}
=======
// Create the fonts folder if it doesn't exist.
if (!dataAccess.userDataPathExistsSync("/user-settings/fonts")) {
logger.info("Can't find the fonts folder, creating one now...");
dataAccess.makeDirInUserDataSync("/user-settings/fonts");
}
logger.info("Finished verifying default folders and files.");
}
>>>>>>>
activeProfiles.forEach(profileId => {
// Create the scripts folder if it doesn't exist
if (!dataAccess.userDataPathExistsSync("/profiles/" + profileId)) {
logger.info(
"Can't find a profile folder for " + profileId + ", creating one now..."
);
dataAccess.makeDirInUserDataSync("/profiles/" + profileId);
}
<<<<<<<
// Create the scripts folder if it doesn't exist
if (
!dataAccess.userDataPathExistsSync("/profiles/" + profileId + "/scripts")
) {
logger.info("Can't find the scripts folder, creating one now...");
dataAccess.makeDirInUserDataSync("/profiles/" + profileId + "/scripts");
}
=======
fontManager.generateAppFontCssFile();
createWindow();
>>>>>>>
// Create the scripts folder if it doesn't exist
if (
!dataAccess.userDataPathExistsSync("/profiles/" + profileId + "/scripts")
) {
logger.info("Can't find the scripts folder, creating one now...");
dataAccess.makeDirInUserDataSync("/profiles/" + profileId + "/scripts");
}
<<<<<<<
// Create the chat folder if it doesn't exist.
if (
!dataAccess.userDataPathExistsSync("/profiles/" + profileId + "/chat")
) {
logger.info("Can't find the chat folder, creating one now...");
dataAccess.makeDirInUserDataSync("/profiles/" + profileId + "/chat");
}
=======
//start extra life manager
const extralifeManager = require('./lib/extralifeManager');
extralifeManager.start();
return true;
});
>>>>>>>
// Create the chat folder if it doesn't exist.
if (
!dataAccess.userDataPathExistsSync("/profiles/" + profileId + "/chat")
) {
logger.info("Can't find the chat folder, creating one now...");
dataAccess.makeDirInUserDataSync("/profiles/" + profileId + "/chat");
} |
<<<<<<<
q = require('q'),
_kuzzle;
=======
Promise = require('bluebird');
>>>>>>>
Promise = require('bluebird'),
_kuzzle;
<<<<<<<
if (!_kuzzle.isServer) {
return q.reject(new BadRequestError('Only a Kuzzle Server can reset the database'));
=======
if (!kuzzle.isServer) {
return Promise.reject(new BadRequestError('Only a Kuzzle Server can reset the database'));
>>>>>>>
if (!_kuzzle.isServer) {
return Promise.reject(new BadRequestError('Only a Kuzzle Server can reset the database'));
<<<<<<<
_kuzzle.indexCache.reset();
return response;
=======
requestObject.data.body.indexes = response.indexes;
return kuzzle.pluginsManager.trigger('cleanDb:deleteIndexes', requestObject);
})
.then(newRequestObject => kuzzle.workerListener.add(newRequestObject))
.then(() => {
kuzzle.indexCache.reset();
kuzzle.pluginsManager.trigger('cleanDb:done', 'Reset done: Kuzzle is now like a virgin, touched for the very first time !');
return Promise.resolve({databaseReset: true});
})
.catch(err => {
kuzzle.pluginsManager.trigger('cleanDb:error', err);
return Promise.reject(new BadRequestError(err));
>>>>>>>
_kuzzle.indexCache.reset();
return response; |
<<<<<<<
const activeUserLists = require("./builtin/activeUserLists");
=======
const channelProgression = require("./builtin/channelProgression");
const streamTitle = require("./builtin/stream-title");
const streamGame = require("./builtin/stream-game");
>>>>>>>
const activeUserLists = require("./builtin/activeUserLists");
const channelProgression = require("./builtin/channelProgression");
const streamTitle = require("./builtin/stream-title");
const streamGame = require("./builtin/stream-game");
<<<<<<<
effectManager.registerEffect(activeUserLists);
=======
effectManager.registerEffect(channelProgression);
effectManager.registerEffect(streamTitle);
effectManager.registerEffect(streamGame);
>>>>>>>
effectManager.registerEffect(activeUserLists);
effectManager.registerEffect(channelProgression);
effectManager.registerEffect(streamTitle);
effectManager.registerEffect(streamGame); |
<<<<<<<
=======
const dataAccess = require('../../lib/common/data-access.js');
let app = angular
.module('firebotApp',
['ngAnimate', 'ngRoute', 'ui.bootstrap', 'rzModule', 'ui.select', 'ngSanitize', 'ui.select', 'ui.sortable',
'ngScrollGlue', 'summernote', 'ngYoutubeEmbed', 'countUpModule']);
app.factory('$exceptionHandler',
function(logger) {
// this catches angular exceptions so we can send it to winston
return function(exception, cause) {
logger.error(exception || {}, cause || {});
};
}
);
app.run(
function initializeApplication(logger, chatMessagesService, groupsService, connectionService, notificationService,
$timeout, updatesService, commandsService) {
// 'chatMessagesService' is included so its instantiated on app start
// Run loadLogin to update the UI on page load.
connectionService.loadLogin();
>>>>>>> |
<<<<<<<
"use strict";
const { ipcMain } = require("electron");
const Carina = require("carina").Carina;
const ws = require("ws");
const profileManager = require("../common/profile-manager.js");
const eventManager = require("../live-events/EventManager");
const reconnectService = require("../common/reconnect.js");
const connectionManager = require("../common/connection-manager");
const logger = require("../logwrapper");
=======
'use strict';
const {ipcMain} = require('electron');
const Carina = require('carina').Carina;
const ws = require('ws');
const dataAccess = require('../common/data-access.js');
const eventsRouter = require('../live-events/events-router.js');
const { LiveEvent, EventSourceType, EventType } = require('./EventType');
const reconnectService = require('../common/reconnect.js');
const logger = require('../logwrapper');
const patronageManager = require("../patronageManager");
const apiAccess = require("../api-access");
>>>>>>>
"use strict";
const { ipcMain } = require("electron");
const Carina = require("carina").Carina;
const ws = require("ws");
const profileManager = require("../common/profile-manager.js");
const eventManager = require("../live-events/EventManager");
const reconnectService = require("../common/reconnect.js");
const connectionManager = require("../common/connection-manager");
const logger = require("../logwrapper");
const patronageManager = require("../patronageManager");
const apiAccess = require("../api-access");
<<<<<<<
ca.subscribe(prefix + "resubShared", data => {
eventManager.triggerEvent("mixer", "resubscribed", {
=======
ca.subscribe(prefix + 'resubShared', data => {
logger.debug("Resub shared event", data);
let event = new LiveEvent(EventType.SUBSCRIBED, EventSourceType.CONSTELLATION, {
>>>>>>>
ca.subscribe(prefix + "resubShared", data => {
eventManager.triggerEvent("mixer", "resubscribed", {
<<<<<<<
setLastSub(data['user'].username);
=======
setLastSub(data.user.username);
eventsRouter.cachedEvent(event);
>>>>>>>
setLastSub(data.user.username);
<<<<<<<
ca.subscribe(prefix + "resubscribed", data => {
eventManager.triggerEvent("mixer", "resubscribed", {
=======
ca.subscribe(prefix + 'resubscribed', data => {
logger.debug("Resub event", data);
let event = new LiveEvent(EventType.SUBSCRIBED, EventSourceType.CONSTELLATION, {
>>>>>>>
ca.subscribe(prefix + "resubscribed", data => {
eventManager.triggerEvent("mixer", "resubscribed", {
<<<<<<<
setLastSub(data['user'].username);
=======
setLastSub(data.user.username);
eventsRouter.cachedEvent(event);
>>>>>>>
setLastSub(data.user.username);
<<<<<<<
ca.subscribe(prefix + "subscribed", data => {
eventManager.triggerEvent("mixer", "subscribed", {
username: data["user"].username,
userId: data["user"].id,
=======
ca.subscribe(prefix + 'subscribed', data => {
logger.debug("Sub event", data);
let event = new LiveEvent(EventType.SUBSCRIBED, EventSourceType.CONSTELLATION, {
username: data['user'].username,
>>>>>>>
ca.subscribe(prefix + "subscribed", data => {
eventManager.triggerEvent("mixer", "subscribed", {
username: data["user"].username,
userId: data["user"].id,
<<<<<<<
setLastSub(data['user'].username);
=======
setLastSub(data.user.username);
eventsRouter.cachedEvent(event);
>>>>>>>
setLastSub(data.user.username);
<<<<<<<
ca.on("error", data => {
logger.error(data);
=======
// Skill
ca.subscribe(prefix + 'skill', data => {
logger.debug("Constellation Skill Event");
logger.debug(data);
//if gif skill effect, extract url and send to frontend
if (data && data.manifest) {
logger.debug("Checking skill for gif...");
if (data.manifest.name === "giphy") {
logger.debug("Detected gif effect type");
if (data.parameters && data.parameters.gifUrl) {
logger.debug("Gif url is present, sending url to front end");
renderWindow.webContents.send('gifUrlForSkill', {
executionId: data.executionId,
gifUrl: data.parameters.gifUrl
});
let userId = data.parameters.userId;
logger.debug("Getting user data for id '" + userId + "' so we can trigger gif event");
apiAccess.get(`users/${userId}`)
.then(userData => {
logger.debug("user data", userData);
logger.debug("Got user data, triggering gif event with url: " + data.parameters.gifUrl);
let event = new LiveEvent(EventType.SKILL_GIF, EventSourceType.CONSTELLATION, {
username: userData ? userData.username : "Unknown",
gifUrl: data.parameters.gifUrl
});
eventsRouter.cachedEvent(event);
}, () => {
logger.debug("Failed to get user data, firing event anyway");
let event = new LiveEvent(EventType.SKILL_GIF, EventSourceType.CONSTELLATION, {
username: "Unknown User",
gifUrl: data.parameters.gifUrl
});
eventsRouter.cachedEvent(event);
});
}
}
}
});
// Patronage updates
ca.subscribe(prefix + 'patronageUpdate', data => {
logger.debug("patronageUpdate Event");
logger.debug(data);
patronageManager.setChannelPatronageData(data);
});
ca.on('error', data => {
logger.error("error from constellation:", data);
>>>>>>>
// Skill
ca.subscribe(prefix + 'skill', data => {
logger.debug("Constellation Skill Event");
logger.debug(data);
//if gif skill effect, extract url and send to frontend
if (data && data.manifest) {
logger.debug("Checking skill for gif...");
if (data.manifest.name === "giphy") {
logger.debug("Detected gif effect type");
if (data.parameters && data.parameters.gifUrl) {
logger.debug("Gif url is present, sending url to front end");
renderWindow.webContents.send('gifUrlForSkill', {
executionId: data.executionId,
gifUrl: data.parameters.gifUrl
});
let userId = data.parameters.userId;
logger.debug("Getting user data for id '" + userId + "' so we can trigger gif event");
apiAccess.get(`users/${userId}`)
.then(userData => {
logger.debug("user data", userData);
logger.debug("Got user data, triggering gif event with url: " + data.parameters.gifUrl);
// TODO V5 Skill handling
/*let event = new LiveEvent(EventType.SKILL_GIF, EventSourceType.CONSTELLATION, {
username: userData ? userData.username : "Unknown",
gifUrl: data.parameters.gifUrl
});
eventsRouter.cachedEvent(event);*/
}, () => {
logger.debug("Failed to get user data, firing event anyway");
// TODO V5 Skill handling
/*let event = new LiveEvent(EventType.SKILL_GIF, EventSourceType.CONSTELLATION, {
username: "Unknown User",
gifUrl: data.parameters.gifUrl
});
eventsRouter.cachedEvent(event);*/
});
}
}
}
});
// Patronage updates
ca.subscribe(prefix + 'patronageUpdate', data => {
logger.debug("patronageUpdate Event");
logger.debug(data);
patronageManager.setChannelPatronageData(data);
});
ca.on('error', data => {
logger.error("error from constellation:", data); |
<<<<<<<
actions.push({
name: "Whisper",
icon: "fa-envelope"
});
=======
actions.push({
name: "Mention",
icon: "fa-at"
});
if (vm.message.user_name !== connectionService.accounts.streamer.username &&
vm.message.user_name !== connectionService.accounts.bot.username) {
if (vm.message.user_roles.includes("Mod")) {
actions.push({
name: "Unmod",
icon: "fa-user-times"
});
} else {
actions.push({
name: "Mod",
icon: "fa-user-plus"
});
}
>>>>>>>
actions.push({
name: "Whisper",
icon: "fa-envelope"
});
actions.push({
name: "Mention",
icon: "fa-at"
}); |
<<<<<<<
const hue = require("./builtin/philips-hue/hue");
=======
const discord = require("./builtin/discord/discord");
>>>>>>>
const hue = require("./builtin/philips-hue/hue");
const discord = require("./builtin/discord/discord");
<<<<<<<
integrationManager.registerIntegration(hue);
=======
integrationManager.registerIntegration(discord);
>>>>>>>
integrationManager.registerIntegration(hue);
integrationManager.registerIntegration(discord); |
<<<<<<<
webServer.sendToOverlay("text", data);
=======
if (dto.justify == null) {
dto.justify = "center";
}
if (dto.dontWrap == null) {
dto.dontWrap = false;
}
renderWindow.webContents.send('showtext', dto);
>>>>>>>
if (dto.justify == null) {
dto.justify = "center";
}
if (dto.dontWrap == null) {
dto.dontWrap = false;
}
webServer.sendToOverlay("text", dto); |
<<<<<<<
controller: function(
$scope,
$element,
$attrs,
settingsService,
listenerService,
connectionService
) {
let ctrl = this;
function getSelected() {
let effectDefs = listenerService
.fireEventSync("getAllEffectDefinitions")
.map(e => e.definition);
// grab the effect definitions for the given trigger
ctrl.options = effectDefs.sort((a, b) => {
let textA = a.name.toUpperCase();
let textB = b.name.toUpperCase();
return textA < textB ? -1 : textA > textB ? 1 : 0;
});
/*if (!settingsService.getCustomScriptsEnabled()) {
ctrl.options = ctrl.options.filter(
e => e.name !== Effect.EffectType.CUSTOM_SCRIPT
);
}*/
if (!connectionService.accounts.streamer.partnered) {
ctrl.options = ctrl.options.filter(e => e.name !== Effect.EffectType.CREATE_CLIP);
}
=======
controller: function($scope, $element, $attrs, settingsService, connectionService) {
let ctrl = this;
function getSelected() {
// grab the effect definitions for the given trigger
ctrl.options = Effect.getEffectDefinitions(ctrl.trigger).sort((a, b) => {
let textA = a.name.toUpperCase();
let textB = b.name.toUpperCase();
return (textA < textB) ? -1 : (textA > textB) ? 1 : 0;
});
if (!settingsService.getCustomScriptsEnabled()) {
ctrl.options = ctrl.options.filter(e => e.name !== Effect.EffectType.CUSTOM_SCRIPT);
}
if (!connectionService.accounts.streamer.partnered && !connectionService.accounts.streamer.canClip) {
ctrl.options = ctrl.options.filter(e => e.name !== Effect.EffectType.CREATE_CLIP);
}
>>>>>>>
controller: function(
$scope,
$element,
$attrs,
settingsService,
listenerService,
connectionService
) {
let ctrl = this;
function getSelected() {
let effectDefs = listenerService
.fireEventSync("getAllEffectDefinitions")
.map(e => e.definition);
// grab the effect definitions for the given trigger
ctrl.options = effectDefs.sort((a, b) => {
let textA = a.name.toUpperCase();
let textB = b.name.toUpperCase();
return textA < textB ? -1 : textA > textB ? 1 : 0;
});
/*if (!settingsService.getCustomScriptsEnabled()) {
ctrl.options = ctrl.options.filter(
e => e.name !== Effect.EffectType.CUSTOM_SCRIPT
);
}*/
if (!connectionService.accounts.streamer.partnered && !connectionService.accounts.streamer.canClip) {
ctrl.options = ctrl.options.filter(e => e.name !== Effect.EffectType.CREATE_CLIP);
} |
<<<<<<<
it('should return a rejected promise if getFormattedFilters fails', function () {
return methods.__with__({
getFormattedFilters: function () { return Promise.reject(new Error('rejected')); }
})(function () {
return should(methods.or(roomId, index, collection, filter)).be.rejectedWith('rejected');
});
=======
it('should reject an error if the filter OR is not an array', function () {
return should(methods.or(roomId, collection, {})).be.rejectedWith(BadRequestError);
});
it('should reject an error if the filter OR is an array with empty filters', function () {
return should(methods.or(roomId, collection, [{}])).be.rejectedWith(BadRequestError);
>>>>>>>
it('should return a rejected promise if getFormattedFilters fails', function () {
return methods.__with__({
getFormattedFilters: function () { return Promise.reject(new Error('rejected')); }
})(function () {
return should(methods.or(roomId, index, collection, filter)).be.rejectedWith('rejected');
});
});
it('should reject an error if the filter OR is not an array', function () {
return should(methods.or(roomId, collection, {})).be.rejectedWith(BadRequestError);
});
it('should reject an error if the filter OR is an array with empty filters', function () {
return should(methods.or(roomId, collection, [{}])).be.rejectedWith(BadRequestError); |
<<<<<<<
angular.module('cosign.network')
.factory('Network', function($rootScope) {
=======
angular.module('copay.network')
.factory('NetworkTest', function() {
this.f = function() {
return 2;
};
})
.factory('Network', function($rootScope) {
>>>>>>>
angular.module('copay.network')
.factory('Network', function($rootScope) {
<<<<<<<
for ( var i = 0; i < b.length; i++)
seen[b[i]] = true;
=======
var _onConnect = function(c, cb) {
if (c.label === 'wallet') {
var a = peer.connections[c.peer][0];
console.log(peer.connections[c.peer][0]);
console.log(a);
a.send('------ origin recived -------');
c.on('data', function(data) {
console.log('------ new data ------');
console.log(data);
>>>>>>>
for ( var i = 0; i < b.length; i++)
seen[b[i]] = true;
<<<<<<<
if (obj.data.peers) {
_connectToPeers(obj.data.peers);
}
=======
peer.on('open', function() {
$rootScope.peerId = peer.id;
$rootScope.peerReady = true;
cb(peer.id);
$rootScope.$digest();
});
>>>>>>>
if (obj.data.peers) {
_connectToPeers(obj.data.peers);
}
<<<<<<<
send: _send
=======
sendTo: _sendTo,
disconnect: _disconnect
>>>>>>>
send: _send,
disconnect: _disconnect |
<<<<<<<
url: '/uri/:url',
needProfile: true,
views: {
'main': {
templateUrl: 'views/uri.html'
}
}
})
.state('uripayment', {
url: '/uri-payment/:url',
templateUrl: 'views/paymentUri.html',
views: {
'main': {
templateUrl: 'views/paymentUri.html',
},
},
needProfile: true
})
.state('activity', {
url: '/activity',
templateUrl: 'views/activity.html'
})
=======
url: '/uri/:url',
templateUrl: 'views/uri.html'
})
.state('uripayment', {
url: '/uri-payment/:url',
templateUrl: 'views/paymentUri.html'
})
.state('uriglidera', {
url: '/uri-glidera/:url',
templateUrl: 'views/glideraUri.html'
})
.state('uricoinbase', {
url: '/uri-coinbase/:url',
templateUrl: 'views/coinbaseUri.html'
})
>>>>>>>
url: '/uri/:url',
templateUrl: 'views/uri.html'
})
.state('uripayment', {
url: '/uri-payment/:url',
templateUrl: 'views/paymentUri.html'
})
.state('uriglidera', {
url: '/uri-glidera/:url',
templateUrl: 'views/glideraUri.html'
})
.state('uricoinbase', {
url: '/uri-coinbase/:url',
templateUrl: 'views/coinbaseUri.html'
})
.state('activity', {
url: '/activity',
templateUrl: 'views/activity.html'
}) |
<<<<<<<
apiVersion: '2.3'
},
=======
apiVersion: '5.0'
}
>>>>>>>
apiVersion: '5.0'
}, |
<<<<<<<
if (data.stateParams.fromWalletId) {
$scope.sendFlowTitle = gettextCatalog.getString('Transfer between wallets');
=======
if ($scope.params.fromWalletId && !$scope.params.thirdParty) {
$scope.sendFlowTitle = gettextCatalog.getString('Wallet to Wallet Transfer');
>>>>>>>
if ($scope.params.fromWalletId && !$scope.params.thirdParty) {
$scope.sendFlowTitle = gettextCatalog.getString('Transfer between wallets'); |
<<<<<<<
})
.directive('clipCopy', function() {
ZeroClipboard.config({
moviePath: '/lib/zeroclipboard/dist/ZeroClipboard.swf',
trustedDomains: ['*'],
allowScriptAccess: 'always',
forceHandCursor: true
});
return {
restric: 'A',
scope: { clipCopy: '=clipCopy' },
link: function(scope, elm) {
var client = new ZeroClipboard(elm);
client.on( 'ready', function(event) {
client.on( 'copy', function(event) {
event.clipboardData.setData('text/plain', scope.clipCopy);
});
client.on( 'aftercopy', function(event) {
elm.removeClass('btn-copy').addClass('btn-copied').html('Copied!');
setTimeout(function() {
elm.addClass('btn-copy').removeClass('btn-copied').html('');
}, 1000);
});
});
client.on( 'error', function(event) {
console.log( 'ZeroClipboard error of type "' + event.name + '": ' + event.message );
ZeroClipboard.destroy();
});
}
};
})
;
=======
});
>>>>>>>
})
.directive('clipCopy', function() {
ZeroClipboard.config({
moviePath: '/lib/zeroclipboard/dist/ZeroClipboard.swf',
trustedDomains: ['*'],
allowScriptAccess: 'always',
forceHandCursor: true
});
return {
restric: 'A',
scope: { clipCopy: '=clipCopy' },
link: function(scope, elm) {
var client = new ZeroClipboard(elm);
client.on( 'ready', function(event) {
client.on( 'copy', function(event) {
event.clipboardData.setData('text/plain', scope.clipCopy);
});
client.on( 'aftercopy', function(event) {
elm.removeClass('btn-copy').addClass('btn-copied').html('Copied!');
setTimeout(function() {
elm.addClass('btn-copy').removeClass('btn-copied').html('');
}, 1000);
});
});
client.on( 'error', function(event) {
console.log( 'ZeroClipboard error of type "' + event.name + '": ' + event.message );
ZeroClipboard.destroy();
});
}
};
}); |
<<<<<<<
root.priceSensitivity = [
{
value: 0.5,
name: '0.5%'
},
{
value: 1,
name: '1%'
},
{
value: 2,
name: '2%'
},
{
value: 5,
name: '5%'
},
{
value: 10,
name: '10%'
}
];
=======
>>>>>>>
<<<<<<<
$log.debug('Updating pending transactions...');
root.setCredentials();
var pendingTransactions = { data: {} };
root.getPendingTransactions(pendingTransactions);
=======
$log.debug('Updating coinbase pending transactions...');
var pendingTransactions = {
data: {}
};
root.getPendingTransactions(pendingTransactions);
>>>>>>>
$log.debug('Updating coinbase pending transactions...');
var pendingTransactions = {
data: {}
};
root.getPendingTransactions(pendingTransactions); |
<<<<<<<
function($scope, $rootScope, $filter, $timeout, $log, $ionicModal, storageService, notification, profileService, platformInfo, $state, gettext, gettextCatalog, applicationService, ongoingProcess) {
var isCordova = platformInfo.isCordova;
$scope.isCordova = isCordova;
=======
function($scope, $ionicPopup, $stateParams, lodash, notification, profileService, go, gettextCatalog, ongoingProcess) {
var wallet = profileService.getWallet($stateParams.walletId);
$scope.alias = lodash.isEqual(wallet.name, wallet.credentials.walletName) ? null : wallet.name + ' ';
$scope.walletName = '[' + wallet.credentials.walletName + ']';
>>>>>>>
function($scope, $ionicPopup, $stateParams, lodash, notification, profileService, $state, gettextCatalog, ongoingProcess) {
var wallet = profileService.getWallet($stateParams.walletId);
$scope.alias = lodash.isEqual(wallet.name, wallet.credentials.walletName) ? null : wallet.name + ' ';
$scope.walletName = '[' + wallet.credentials.walletName + ']'; |
<<<<<<<
'lib/angular-gettext/dist/angular-gettext.min.js',
'lib/assert/assert.js',
=======
'lib/inherits/inherits.js',
>>>>>>>
'lib/angular-gettext/dist/angular-gettext.min.js',
'lib/inherits/inherits.js', |
<<<<<<<
'copay.socket',
=======
'copay.controllerUtils',
>>>>>>>
'copay.socket',
'copay.controllerUtils', |
<<<<<<<
=======
return { _sqlite3_value_blob: _sqlite3_value_blob, _sqlite3_column_name: _sqlite3_column_name, _sqlite3_reset: _sqlite3_reset, _sqlite3_column_type: _sqlite3_column_type, _sqlite3_exec: _sqlite3_exec, _sqlite3_result_null: _sqlite3_result_null, _sqlite3_step: _sqlite3_step, _bitshift64Lshr: _bitshift64Lshr, _sqlite3_prepare_v2: _sqlite3_prepare_v2, _sqlite3_close_v2: _sqlite3_close_v2, _sqlite3_open: _sqlite3_open, _bitshift64Shl: _bitshift64Shl, _sqlite3_result_text: _sqlite3_result_text, _fflush: _fflush, _sqlite3_column_bytes: _sqlite3_column_bytes, _sqlite3_bind_int: _sqlite3_bind_int, _sqlite3_bind_blob: _sqlite3_bind_blob, _memset: _memset, _sqlite3_value_double: _sqlite3_value_double, _memcpy: _memcpy, _sqlite3_result_double: _sqlite3_result_double, _sqlite3_value_text: _sqlite3_value_text, _sqlite3_changes: _sqlite3_changes, _sqlite3_column_blob: _sqlite3_column_blob, _sqlite3_bind_parameter_index: _sqlite3_bind_parameter_index, _sqlite3_value_type: _sqlite3_value_type, _i64Subtract: _i64Subtract, _sqlite3_column_text: _sqlite3_column_text, _i64Add: _i64Add, _sqlite3_value_bytes: _sqlite3_value_bytes, _sqlite3_finalize: _sqlite3_finalize, _sqlite3_column_double: _sqlite3_column_double, _sqlite3_create_function_v2: _sqlite3_create_function_v2, _sqlite3_free: _sqlite3_free, _sqlite3_value_int: _sqlite3_value_int, _sqlite3_data_count: _sqlite3_data_count, _sqlite3_bind_text: _sqlite3_bind_text, _sqlite3_bind_double: _sqlite3_bind_double, ___errno_location: ___errno_location, _RegisterExtensionFunctions: _RegisterExtensionFunctions, _free: _free, _memmove: _memmove, _sqlite3_errmsg: _sqlite3_errmsg, _sqlite3_clear_bindings: _sqlite3_clear_bindings, _malloc: _malloc, runPostSets: runPostSets, stackAlloc: stackAlloc, stackSave: stackSave, stackRestore: stackRestore, establishStackSpace: establishStackSpace, setThrew: setThrew, setTempRet0: setTempRet0, getTempRet0: getTempRet0, dynCall_iiii: dynCall_iiii, dynCall_i: dynCall_i, dynCall_vi: dynCall_vi, dynCall_vii: dynCall_vii, dynCall_iiiiiii: dynCall_iiiiiii, dynCall_ii: dynCall_ii, dynCall_viii: dynCall_viii, dynCall_v: dynCall_v, dynCall_iiiii: dynCall_iiiii, dynCall_viiiiii: dynCall_viiiiii, dynCall_iii: dynCall_iii, dynCall_iiiiii: dynCall_iiiiii, dynCall_viiii: dynCall_viiii };
})
// EMSCRIPTEN_END_ASM
(Module.asmGlobalArg, Module.asmLibraryArg, buffer);
var real__sqlite3_value_blob = asm["_sqlite3_value_blob"]; asm["_sqlite3_value_blob"] = function() {
assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
return real__sqlite3_value_blob.apply(null, arguments);
};
>>>>>>>
<<<<<<<
=======
var real__sqlite3_changes = asm["_sqlite3_changes"]; asm["_sqlite3_changes"] = function() {
assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
return real__sqlite3_changes.apply(null, arguments);
};
>>>>>>>
<<<<<<<
=======
var real__sqlite3_create_function_v2 = asm["_sqlite3_create_function_v2"]; asm["_sqlite3_create_function_v2"] = function() {
assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
return real__sqlite3_create_function_v2.apply(null, arguments);
};
var real__sqlite3_free = asm["_sqlite3_free"]; asm["_sqlite3_free"] = function() {
assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
return real__sqlite3_free.apply(null, arguments);
};
>>>>>>>
<<<<<<<
=======
var real__malloc = asm["_malloc"]; asm["_malloc"] = function() {
assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)');
assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
return real__malloc.apply(null, arguments);
};
var _sqlite3_value_blob = Module["_sqlite3_value_blob"] = asm["_sqlite3_value_blob"];
var _sqlite3_column_name = Module["_sqlite3_column_name"] = asm["_sqlite3_column_name"];
var _sqlite3_reset = Module["_sqlite3_reset"] = asm["_sqlite3_reset"];
var _sqlite3_column_type = Module["_sqlite3_column_type"] = asm["_sqlite3_column_type"];
var _sqlite3_exec = Module["_sqlite3_exec"] = asm["_sqlite3_exec"];
var _sqlite3_result_null = Module["_sqlite3_result_null"] = asm["_sqlite3_result_null"];
var _sqlite3_step = Module["_sqlite3_step"] = asm["_sqlite3_step"];
var _bitshift64Lshr = Module["_bitshift64Lshr"] = asm["_bitshift64Lshr"];
var _sqlite3_prepare_v2 = Module["_sqlite3_prepare_v2"] = asm["_sqlite3_prepare_v2"];
var _sqlite3_close_v2 = Module["_sqlite3_close_v2"] = asm["_sqlite3_close_v2"];
var _sqlite3_open = Module["_sqlite3_open"] = asm["_sqlite3_open"];
var _bitshift64Shl = Module["_bitshift64Shl"] = asm["_bitshift64Shl"];
var _sqlite3_result_text = Module["_sqlite3_result_text"] = asm["_sqlite3_result_text"];
var _fflush = Module["_fflush"] = asm["_fflush"];
var _sqlite3_column_bytes = Module["_sqlite3_column_bytes"] = asm["_sqlite3_column_bytes"];
var _sqlite3_bind_int = Module["_sqlite3_bind_int"] = asm["_sqlite3_bind_int"];
var _sqlite3_bind_blob = Module["_sqlite3_bind_blob"] = asm["_sqlite3_bind_blob"];
var _memset = Module["_memset"] = asm["_memset"];
var _sqlite3_value_double = Module["_sqlite3_value_double"] = asm["_sqlite3_value_double"];
var _memcpy = Module["_memcpy"] = asm["_memcpy"];
var _sqlite3_result_double = Module["_sqlite3_result_double"] = asm["_sqlite3_result_double"];
var _sqlite3_value_text = Module["_sqlite3_value_text"] = asm["_sqlite3_value_text"];
var _sqlite3_changes = Module["_sqlite3_changes"] = asm["_sqlite3_changes"];
var _sqlite3_column_blob = Module["_sqlite3_column_blob"] = asm["_sqlite3_column_blob"];
var _sqlite3_bind_parameter_index = Module["_sqlite3_bind_parameter_index"] = asm["_sqlite3_bind_parameter_index"];
var _sqlite3_value_type = Module["_sqlite3_value_type"] = asm["_sqlite3_value_type"];
var _i64Subtract = Module["_i64Subtract"] = asm["_i64Subtract"];
var _sqlite3_column_text = Module["_sqlite3_column_text"] = asm["_sqlite3_column_text"];
var _i64Add = Module["_i64Add"] = asm["_i64Add"];
var _sqlite3_value_bytes = Module["_sqlite3_value_bytes"] = asm["_sqlite3_value_bytes"];
var _sqlite3_finalize = Module["_sqlite3_finalize"] = asm["_sqlite3_finalize"];
var _sqlite3_column_double = Module["_sqlite3_column_double"] = asm["_sqlite3_column_double"];
var _sqlite3_create_function_v2 = Module["_sqlite3_create_function_v2"] = asm["_sqlite3_create_function_v2"];
var _sqlite3_free = Module["_sqlite3_free"] = asm["_sqlite3_free"];
var _sqlite3_value_int = Module["_sqlite3_value_int"] = asm["_sqlite3_value_int"];
var _sqlite3_data_count = Module["_sqlite3_data_count"] = asm["_sqlite3_data_count"];
var _sqlite3_bind_text = Module["_sqlite3_bind_text"] = asm["_sqlite3_bind_text"];
var _sqlite3_bind_double = Module["_sqlite3_bind_double"] = asm["_sqlite3_bind_double"];
var ___errno_location = Module["___errno_location"] = asm["___errno_location"];
var _RegisterExtensionFunctions = Module["_RegisterExtensionFunctions"] = asm["_RegisterExtensionFunctions"];
var _free = Module["_free"] = asm["_free"];
var runPostSets = Module["runPostSets"] = asm["runPostSets"];
var _memmove = Module["_memmove"] = asm["_memmove"];
var _sqlite3_errmsg = Module["_sqlite3_errmsg"] = asm["_sqlite3_errmsg"];
var _sqlite3_clear_bindings = Module["_sqlite3_clear_bindings"] = asm["_sqlite3_clear_bindings"];
var _malloc = Module["_malloc"] = asm["_malloc"];
var dynCall_iiii = Module["dynCall_iiii"] = asm["dynCall_iiii"];
var dynCall_i = Module["dynCall_i"] = asm["dynCall_i"];
var dynCall_vi = Module["dynCall_vi"] = asm["dynCall_vi"];
var dynCall_vii = Module["dynCall_vii"] = asm["dynCall_vii"];
var dynCall_iiiiiii = Module["dynCall_iiiiiii"] = asm["dynCall_iiiiiii"];
var dynCall_ii = Module["dynCall_ii"] = asm["dynCall_ii"];
var dynCall_viii = Module["dynCall_viii"] = asm["dynCall_viii"];
var dynCall_v = Module["dynCall_v"] = asm["dynCall_v"];
var dynCall_iiiii = Module["dynCall_iiiii"] = asm["dynCall_iiiii"];
var dynCall_viiiiii = Module["dynCall_viiiiii"] = asm["dynCall_viiiiii"];
var dynCall_iii = Module["dynCall_iii"] = asm["dynCall_iii"];
var dynCall_iiiiii = Module["dynCall_iiiiii"] = asm["dynCall_iiiiii"];
var dynCall_viiii = Module["dynCall_viiii"] = asm["dynCall_viiii"];
;
>>>>>>> |
<<<<<<<
if (newValue.toStoreNode) {
newNode = newValue.toStoreNode(self.doc.store);
}
else if (field != 'object' ||
triple.object.interfaceName == 'NamedNode') {
newNode = self.doc.store.rdf.createNamedNode(RDFE.Editor.io_strip_URL_quoting(newValue));
}
else if (triple.object.datatype == 'http://www.w3.org/2001/XMLSchema#dateTime') {
var d = new Date(newValue);
newNode = self.doc.store.rdf.createLiteral(d.toISOString(), triple.object.language, triple.object.datatype);
}
else {
newNode = self.doc.store.rdf.createLiteral(newValue, triple.object.language, triple.object.datatype);
}
=======
self.doc.store.delete(self.doc.store.rdf.createGraph([triple]), self.doc.graph, function(success) {
if (success) {
console.log("Successfully deleted old triple")
// update data in the bootstrap-table array
triple[field] = newNode;
>>>>>>>
self.doc.store.delete(self.doc.store.rdf.createGraph([triple]), self.doc.graph, function(success) {
if (success) {
console.log("Successfully deleted old triple")
// update data in the bootstrap-table array
triple[field] = newNode;
<<<<<<<
};
doc.listProperties(function (pl) {
console.log('Found existing predicates: ', pl);
doc.store.graph(doc.graph, function(success, g) {
if(success) {
container.empty();
var $list = $(document.createElement('table')).addClass('table');
container.append($list);
// add index to triples for identification
var triples = g.toArray();
for(var i = 0; i < triples.length; i+=1)
triples[i].id = i;
// remember last index for triple adding
$list.data('maxindex', i);
$list.bootstrapTable({
striped:true,
sortName:'s',
pagination:true,
search:true,
searchAlign: 'left',
showHeader: true,
editable: true,
data: triples,
dataSetter: tripleEditorDataSetter,
columns: [{
field: 'subject',
title: 'Subject',
aligh: 'left',
sortable: true,
editable: function(triple) {
return {
mode: "inline",
type: "rdfnode",
rdfnode: {
type: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#Resource'
},
value: triple.subject
}
},
formatter: RDFE.Editor.prototype.nodeFormatter
}, {
field: 'predicate',
title: 'Predicate',
align: 'left',
sortable: true,
editable: {
mode: "inline",
name: 'predicate',
type: "typeaheadjs",
placement: "right",
typeahead: {
name: 'predicate',
local: [
"http://www.w3.org/2002/07/owl#",
"http://www.w3.org/2000/01/rdf-schema#",
"http://xmlns.com/foaf/0.1/",
"http://rdfs.org/sioc/ns#",
"http://purl.org/dc/elements/1.1/",
].concat(pl)
}
},
formatter: RDFE.Editor.prototype.nodeFormatter
}, {
field: 'object',
title: 'Object',
align: 'left',
sortable: true,
editable: function(triple) {
return {
mode: "inline",
type: "rdfnode",
value: triple.object
};
},
formatter: RDFE.Editor.prototype.nodeFormatter
}, {
field: 'actions',
title: 'Actions',
align: 'center',
valign: 'middle',
clickToSelect: false,
editable: false,
formatter: function(value, row, index) {
return [
'<a class="remove ml10" href="javascript:void(0)" title="Remove">',
'<i class="glyphicon glyphicon-remove"></i>',
'</a>'
].join('');
},
events: {
'click .remove': function (e, value, row, index) {
var triple = row;
self.doc.store.delete(self.doc.store.rdf.createGraph([triple]), self.doc.graph, function(success) {
if(success) {
$list.bootstrapTable('remove', {
field: 'id',
values: [row.id]
});
}
else {
$(self).trigger('rdf-editor-error', { "type": 'triple-delete-failed', "message": 'Failed to delete triple.' });
}
});
}
}
}]
});
=======
>>>>>>> |
<<<<<<<
const { width, height, horizontal, vertical, horizontalCoordinatesGenerator,
verticalCoordinatesGenerator, xAxis, yAxis, offset, chartWidth, chartHeight } = this.props;
=======
const { x, y, width, height, horizontal, vertical, fill, fillOpacity } = this.props;
>>>>>>>
const { x, y, width, height, horizontal, vertical, horizontalCoordinatesGenerator,
verticalCoordinatesGenerator, xAxis, yAxis, offset, chartWidth, chartHeight } = this.props;
<<<<<<<
{horizontal && this.renderHorizontal(horizontalPoints)}
{vertical && this.renderVertical(verticalPoints)}
=======
{this.renderBackground()}
{horizontal && this.renderHorizontal()}
{vertical && this.renderVertical()}
>>>>>>>
{this.renderBackground()}
{horizontal && this.renderHorizontal(horizontalPoints)}
{vertical && this.renderVertical(verticalPoints)} |
<<<<<<<
pTinyMceConfigMax = function() {
return {
// Location of TinyMCE script
script_url : ip.baseUrl + 'Ip/Module/Assets/assets/js/tiny_mce/tiny_mce.js',
=======
ipTinyMceConfigMax = {
// Location of TinyMCE script
script_url : ipFileUrl('Ip/Module/Assets/assets/js/tiny_mce/tiny_mce.js'),
theme : "advanced",
entity_encoding : "raw",
plugins : "autoresize,iplink,paste,safari,spellchecker,pagebreak,style,layer,table,advhr,advimage,emotions,iespell,inlinepopups,media,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,simplebrowser,advhr",
theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,pastetext,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,blockquote,pagebreak,|,insertfile,insertimage,strikethrough,fullscreen",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : false,
width : '100%',
//content_css : ipThemUrl('ipContent.css'),
theme_advanced_styles : "Text=;Caption=caption;Signature=signature;Note=note;Button=button",
forced_root_block : "p",
>>>>>>>
pTinyMceConfigMax = function() {
return {
// Location of TinyMCE script
script_url : ipFileUrl('Ip/Module/Assets/assets/js/tiny_mce/tiny_mce.js'), |
<<<<<<<
ipTinyMceConfigMin = function() {
return {
// Location of TinyMCE script
script_url : ip.baseUrl + 'Ip/Module/Assets/assets/js/tiny_mce/tiny_mce.js',
inline: true,
// theme : "advanced",
// plugins : "paste,inlinepopups,iplink,autoresize",
plugins: "paste",
entity_encoding : "raw",
// theme_advanced_buttons1 : "copy,paste,pastetext,separator,justifyleft,justifycenter,justifyright,separator,undo,redo,separator",
// theme_advanced_buttons2 : "bold,italic,underline,styleselect",
// theme_advanced_buttons3 : "bullist,numlist,outdent,indent,link,unlink,sub,sup",
valid_elements : "@[class|style],strong,em,br,sup,sub,p,span,b,u,i,a[name|href|target|title],ul,ol,li",
theme_advanced_styles : "Text=;Caption=caption;Signature=signature;Note=note;Button=button",
forced_root_block : "p",
=======
ipTinyMceConfigMin = {
// Location of TinyMCE script
script_url : ipFileUrl('Ip/Module/Assets/assets/js/tiny_mce/tiny_mce.js'),
theme : "advanced",
plugins : "paste,inlinepopups,iplink,autoresize",
entity_encoding : "raw",
theme_advanced_buttons1 : "copy,paste,pastetext,separator,justifyleft,justifycenter,justifyright,separator,undo,redo,separator",
theme_advanced_buttons2 : "bold,italic,underline,styleselect",
theme_advanced_buttons3 : "bullist,numlist,outdent,indent,link,unlink,sub,sup",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : 0,
theme_advanced_resizing : false,
theme_advanced_resize_horizontal : false,
valid_elements : "@[class|style],strong,em,br,sup,sub,p,span,b,u,i,a[name|href|target|title],ul,ol,li",
width : '100%',
//content_css : ipThemeUrl('ipContent.css'),
theme_advanced_styles : "Text=;Caption=caption;Signature=signature;Note=note;Button=button",
forced_root_block : "p",
>>>>>>>
ipTinyMceConfigMin = function() {
return {
// Location of TinyMCE script
script_url : ipFileUrl('Ip/Module/Assets/assets/js/tiny_mce/tiny_mce.js'),
inline: true,
// theme : "advanced",
// plugins : "paste,inlinepopups,iplink,autoresize",
plugins: "paste",
entity_encoding : "raw",
// theme_advanced_buttons1 : "copy,paste,pastetext,separator,justifyleft,justifycenter,justifyright,separator,undo,redo,separator",
// theme_advanced_buttons2 : "bold,italic,underline,styleselect",
// theme_advanced_buttons3 : "bullist,numlist,outdent,indent,link,unlink,sub,sup",
valid_elements : "@[class|style],strong,em,br,sup,sub,p,span,b,u,i,a[name|href|target|title],ul,ol,li",
theme_advanced_styles : "Text=;Caption=caption;Signature=signature;Note=note;Button=button",
forced_root_block : "p", |
<<<<<<<
var ipUploadImage = $('.ipModuleInlineManagementPopupImage').find('.ipaImage');
if (ipUploadImage.ipUploadImage('getCurImage') == undefined) {
$.proxy(methods._cancel, $this)(event);
return;
}
=======
var ipUploadImage = $('.ipModuleInlineManagementPopup.ipmImage').find('.ipaImage');
>>>>>>>
var ipUploadImage = $('.ipModuleInlineManagementPopup.ipmImage').find('.ipaImage');
if (ipUploadImage.ipUploadImage('getCurImage') == undefined) {
$.proxy(methods._cancel, $this)(event);
return;
} |
<<<<<<<
should(bootstrap.engine.search)
.be.calledOnce()
.be.calledWithMatch('users', {
query: {
terms: {
profileIds: ['admin']
=======
try {
should(bootstrap.engine.search)
.be.calledOnce()
.be.calledWithMatch('users', {
query: {
in: {
profileIds: ['admin']
}
>>>>>>>
try {
should(bootstrap.engine.search)
.be.calledOnce()
.be.calledWithMatch('users', {
query: {
terms: {
profileIds: ['admin']
} |
<<<<<<<
datepicker: base+'datepicker.html',
=======
radios: base+'radios.html',
radiobuttons: base+'radio-buttons.html',
>>>>>>>
datepicker: base+'datepicker.html',
radios: base+'radios.html',
radiobuttons: base+'radio-buttons.html',
<<<<<<<
datepicker: base+'datepicker.html',
input: base+'default.html'
=======
input: base+'default.html',
radios: base+'radios.html',
radiobuttons: base+'radio-buttons.html',
>>>>>>>
datepicker: base+'datepicker.html',
input: base+'default.html',
radios: base+'radios.html',
radiobuttons: base+'radio-buttons.html',
<<<<<<<
});
=======
});
>>>>>>>
}); |
<<<<<<<
=======
require("../components/__stories__/artwork_filter")
require("../containers/__stories__/login")
>>>>>>>
require("../components/__stories__/artwork_filter") |
<<<<<<<
require("../components/publishing/__stories__/publishing")
=======
require("../components/__stories__/fair_booth")
>>>>>>>
require("../components/__stories__/fair_booth")
require("../components/publishing/__stories__/publishing") |
<<<<<<<
require("../components/__stories__/modal")
=======
require("../components/__stories__/nav")
>>>>>>>
require("../components/__stories__/modal")
require("../components/__stories__/nav") |
<<<<<<<
it('Allows selection of Ellaism', function(done) {
var params = {
selectText: "ELLA - Ellaism",
firstAddress: "0xa8B0BeA09eeBc41062308546a01d6E544277e2Ca",
};
testNetwork(done, params);
});
=======
it('Allows selection of Ethersocial Network', function(done) {
var params = {
selectText: "ESN - Ethersocial Network",
firstAddress: "0x6EE99Be2A0C7F887a71e21C8608ACF0aa0D2b767",
};
testNetwork(done, params);
});
>>>>>>>
it('Allows selection of Ellaism', function(done) {
var params = {
selectText: "ELLA - Ellaism",
firstAddress: "0xa8B0BeA09eeBc41062308546a01d6E544277e2Ca",
};
testNetwork(done, params);
});
it('Allows selection of Ethersocial Network', function(done) {
var params = {
selectText: "ESN - Ethersocial Network",
firstAddress: "0x6EE99Be2A0C7F887a71e21C8608ACF0aa0D2b767",
};
testNetwork(done, params);
}); |
<<<<<<<
// Stellar is different
if (networks[DOM.network.val()].name == "XLM - Stellar") {
var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44);
var coin = parseIntNoNaN(DOM.bip44coin.val(), 0);
var path = "m/";
path += purpose + "'/";
path += coin + "'/" + index + "'";
var keypair = stellarUtil.getKeypair(path, seed);
indexText = path;
privkey = keypair.secret();
pubkey = address = keypair.publicKey();
}
=======
if ((networks[DOM.network.val()].name == "NAS - Nebulas")) {
var NasAccount = require("nebulas-account");
var privKeyBuffer = keyPair.d.toBuffer(32);
var nebulasAccount = new NasAccount();
nebulasAccount.setPrivateKey(privKeyBuffer);
address = nebulasAccount.getAddressString();
privkey = nebulasAccount.getPrivateKeyString();
pubkey = nebulasAccount.getPublicKeyString();
}
>>>>>>>
// Stellar is different
if (networks[DOM.network.val()].name == "XLM - Stellar") {
var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44);
var coin = parseIntNoNaN(DOM.bip44coin.val(), 0);
var path = "m/";
path += purpose + "'/";
path += coin + "'/" + index + "'";
var keypair = stellarUtil.getKeypair(path, seed);
indexText = path;
privkey = keypair.secret();
pubkey = address = keypair.publicKey();
}
if ((networks[DOM.network.val()].name == "NAS - Nebulas")) {
var NasAccount = require("nebulas-account");
var privKeyBuffer = keyPair.d.toBuffer(32);
var nebulasAccount = new NasAccount();
nebulasAccount.setPrivateKey(privKeyBuffer);
address = nebulasAccount.getAddressString();
privkey = nebulasAccount.getPrivateKeyString();
pubkey = nebulasAccount.getPublicKeyString();
} |
<<<<<<<
var
_ = require('lodash'),
Promise = require('bluebird'),
uuid = require('node-uuid'),
User = require('../security/user'),
Repository = require('./repository'),
InternalError = require('kuzzle-common-objects').Errors.internalError;
=======
module.exports = function (kuzzle) {
var
_ = require('lodash'),
q = require('q'),
uuid = require('node-uuid'),
User = require('../security/user'),
Repository = require('./repository'),
NotFoundError = require('kuzzle-common-objects').Errors.notFoundError;
>>>>>>>
var
_ = require('lodash'),
Promise = require('bluebird'),
uuid = require('node-uuid'),
User = require('../security/user'),
Repository = require('./repository'),
NotFoundError = require('kuzzle-common-objects').Errors.notFoundError;
<<<<<<<
return kuzzle.repositories.profile.loadProfile(user.profileId)
.then(profile => {
if (!profile) {
return Promise.reject(new InternalError('Could not find profile: ' + user.profileId));
=======
return kuzzle.repositories.profile.loadProfiles(user.profilesIds)
.then(profiles => {
var profilesIds = profiles.map(profile => profile._id),
profilesNotFound = _.difference(user.profilesIds, profilesIds);
// Fail if not all roles are found
if (profilesNotFound.length) {
return q.reject(new NotFoundError(`Unable to hydrate the user ${data._id}. The following profiles don't exist: ${profilesNotFound}`));
>>>>>>>
return kuzzle.repositories.profile.loadProfiles(user.profilesIds)
.then(profiles => {
var
profilesIds = profiles.map(profile => profile._id),
profilesNotFound = _.difference(user.profilesIds, profilesIds);
// Fail if not all roles are found
if (profilesNotFound.length) {
return Promise.reject(new NotFoundError(`Unable to hydrate the user ${data._id}. The following profiles don't exist: ${profilesNotFound}`)); |
<<<<<<<
it('Allows selection of Safecoin', function(done) {
var params = {
selectText: "SAFE - Safecoin",
firstAddress: "RmV56kPW7jeCmDA8sukHwbR7RZSbg9NFNF",
};
testNetwork(done, params);
});
=======
it('Allows selection of Blocknode', function(done) {
var params = {
selectText: "BND - Blocknode",
firstAddress: "BG8xZSAur2jYLG9VXt8dYfkKxxeR7w9bSe",
};
testNetwork(done, params);
});
it('Allows selection of Blocknode Testnet', function(done) {
var params = {
selectText: "tBND - Blocknode Testnet",
firstAddress: "bSptsFyDktFSKpWveRywJsDoJA2TC6qfHv",
};
testNetwork(done, params);
});
>>>>>>>
it('Allows selection of Safecoin', function(done) {
var params = {
selectText: "SAFE - Safecoin",
firstAddress: "RmV56kPW7jeCmDA8sukHwbR7RZSbg9NFNF",
};
testNetwork(done, params);
});
it('Allows selection of Blocknode', function(done) {
var params = {
selectText: "BND - Blocknode",
firstAddress: "BG8xZSAur2jYLG9VXt8dYfkKxxeR7w9bSe",
};
testNetwork(done, params);
});
it('Allows selection of Blocknode Testnet', function(done) {
var params = {
selectText: "tBND - Blocknode Testnet",
firstAddress: "bSptsFyDktFSKpWveRywJsDoJA2TC6qfHv",
};
testNetwork(done, params);
}); |
<<<<<<<
=======
}
onSwitch = type => {
const { onTabChange } = this.props;
this.setState({
type,
});
onTabChange(type);
>>>>>>>
<<<<<<<
const { form, onSubmit } = this.props;
form.validateFields(activeFileds, { force: true }, (err, values) => {
onSubmit(err, values);
=======
form.validateFields(activeFileds, { force: true }, (err, values) => {
onSubmit(err, values);
>>>>>>>
form.validateFields(activeFileds, { force: true }, (err, values) => {
onSubmit(err, values); |
<<<<<<<
return q(new ResponseObject(requestObject, {now: Date.now()}));
=======
return Promise.resolve(new ResponseObject(requestObject, {now: Date.now()}));
};
this.listIndexes = function (requestObject) {
kuzzle.pluginsManager.trigger('data:listIndexes', requestObject);
return kuzzle.services.list.readEngine.listIndexes(requestObject);
>>>>>>>
return q(new ResponseObject(requestObject, {now: Date.now()}));
};
this.listIndexes = function (requestObject) {
kuzzle.pluginsManager.trigger('data:listIndexes', requestObject);
return kuzzle.services.list.readEngine.listIndexes(requestObject); |
<<<<<<<
constructor(props) {
super(props);
this.state = {
searchMode: props.defaultOpen,
value: '',
};
}
componentWillUnmount() {
clearTimeout(this.timeout);
}
=======
state = {
searchMode: this.props.defaultOpen,
value: '',
};
>>>>>>>
constructor(props) {
super(props);
this.state = {
searchMode: props.defaultOpen,
value: '',
};
}
componentWillUnmount() {
clearTimeout(this.timeout);
}
<<<<<<<
const { onPressEnter } = this.props;
const { value } = this.state;
this.timeout = setTimeout(() => {
onPressEnter(value); // Fix duplicate onPressEnter
}, 0);
=======
this.debouncePressEnter();
>>>>>>>
const { onPressEnter } = this.props;
const { value } = this.state;
this.timeout = setTimeout(() => {
onPressEnter(value); // Fix duplicate onPressEnter
}, 0);
<<<<<<<
=======
// NOTE: 不能小于500,如果长按某键,第一次触发auto repeat的间隔是500ms,小于500会导致触发2次
@Bind()
@Debounce(500, {
leading: true,
trailing: false,
})
debouncePressEnter() {
this.props.onPressEnter(this.state.value);
}
>>>>>>> |
<<<<<<<
return kuzzle.start(params, {dummy: true})
.then(() => {
// Mock
kuzzle.repositories.role.roles.role1 = { _id: 'role1' };
kuzzle.repositories.profile.validateAndSaveProfile = profile => {
if (profile._id === 'alreadyExists') {
return q.reject();
}
return q(profile);
};
kuzzle.repositories.profile.loadProfile = id => {
var profileId;
if (id instanceof Profile) {
profileId = id._id;
}
else {
profileId = id;
}
if (profileId === 'badId') {
return q(null);
}
return q(id);
};
kuzzle.services.list.readEngine.search = () => {
if (error) {
return q.reject(new Error(''));
}
return q({
hits: [{_id: 'test'}],
total: 1
});
};
kuzzle.repositories.profile.loadMultiFromDatabase = (ids, hydrate) => {
if (error) {
return q.reject(new Error(''));
}
if (!hydrate) {
return q(ids.map(id => {
return {
_id: id,
_source: {
roles: ['role1']
}
};
}));
}
return q(ids.map(id => {
return {
_id: id,
roles: [{_id: 'role1'}]
};
}));
};
kuzzle.repositories.profile.deleteProfile = () => {
if (error) {
return q.reject(new Error(''));
}
return q({_id: 'test'});
};
});
=======
return kuzzle.start(params, {dummy: true});
>>>>>>>
return kuzzle.start(params, {dummy: true});
<<<<<<<
body: {_id: 'alreadyExists' }
}))).be.rejected();
=======
body: {_id: 'test', roles: ['role1']}
}))).be.rejectedWith(ResponseObject);
>>>>>>>
body: {_id: 'test', roles: ['role1']}
}))).be.rejected();
<<<<<<<
return should(kuzzle.funnel.controllers.security.getProfile(new RequestObject({body: {_id: 'badId'}}))).be.rejected();
=======
sandbox.stub(kuzzle.repositories.profile, 'loadProfile').resolves(null);
return should(kuzzle.funnel.controllers.security.getProfile(new RequestObject({
body: {_id: 'test'}
}))).be.rejectedWith(ResponseObject);
>>>>>>>
sandbox.stub(kuzzle.repositories.profile, 'loadProfile').resolves(null);
return should(kuzzle.funnel.controllers.security.getProfile(new RequestObject({
body: {_id: 'test'}
}))).be.rejectedWith(ResponseObject); |
<<<<<<<
const RightSidebar = connect(({ setting }) => ({ ...setting }))(Sidebar);
=======
/**
* 根据菜单取得重定向地址.
*/
const redirectData = [];
const getRedirect = item => {
if (item && item.children) {
if (item.children[0] && item.children[0].path) {
redirectData.push({
from: `${item.path}`,
to: `${item.children[0].path}`,
});
item.children.forEach(children => {
getRedirect(children);
});
}
}
};
getMenuData().forEach(getRedirect);
>>>>>>>
const RightSidebar = connect(({ setting }) => ({ ...setting }))(Sidebar);
<<<<<<<
=======
let isMobile;
enquireScreen(b => {
isMobile = b;
});
>>>>>>>
<<<<<<<
=======
};
state = {
isMobile,
>>>>>>>
<<<<<<<
=======
componentDidMount() {
enquireScreen(mobile => {
this.setState({
isMobile: mobile,
});
});
this.props.dispatch({
type: 'user/fetchCurrent',
});
}
>>>>>>>
<<<<<<<
};
changeSetting = setting => {
=======
};
handleNoticeClear = type => {
message.success(`清空了${type}`);
>>>>>>>
};
changeSetting = setting => {
<<<<<<<
};
=======
};
handleMenuClick = ({ key }) => {
if (key === 'triggerError') {
this.props.dispatch(routerRedux.push('/exception/trigger'));
return;
}
if (key === 'logout') {
this.props.dispatch({
type: 'login/logout',
});
}
};
handleNoticeVisibleChange = visible => {
if (visible) {
this.props.dispatch({
type: 'global/fetchNotices',
});
}
};
>>>>>>>
};
<<<<<<<
const { isMobile, redirectData, routerData, fixedHeader, match } = this.props;
const isTop = this.props.layout === 'topmenu';
=======
const {
currentUser,
collapsed,
fetchingNotices,
notices,
routerData,
match,
location,
} = this.props;
>>>>>>>
const { isMobile, redirectData, routerData, fixedHeader, match } = this.props;
const isTop = this.props.layout === 'topmenu';
<<<<<<<
{myRedirectData.map(item => (
<Redirect key={item.from} exact from={item.from} to={item.to} />
))}
{getRoutes(match.path, routerData).map(item => (
<AuthorizedRoute
key={item.key}
path={item.path}
component={item.component}
exact={item.exact}
authority={item.authority}
redirectPath="/exception/403"
/>
))}
=======
{redirectData.map(item => (
<Redirect key={item.from} exact from={item.from} to={item.to} />
))}
{getRoutes(match.path, routerData).map(item => (
<AuthorizedRoute
key={item.key}
path={item.path}
component={item.component}
exact={item.exact}
authority={item.authority}
redirectPath="/exception/403"
/>
))}
>>>>>>>
{myRedirectData.map(item => (
<Redirect key={item.from} exact from={item.from} to={item.to} />
))}
{getRoutes(match.path, routerData).map(item => (
<AuthorizedRoute
key={item.key}
path={item.path}
component={item.component}
exact={item.exact}
authority={item.authority}
redirectPath="/exception/403"
/>
))}
<<<<<<<
<Footer />
=======
<Footer style={{ padding: 0 }}>
<GlobalFooter
links={[
{
key: 'Pro 首页',
title: 'Pro 首页',
href: 'http://pro.ant.design',
blankTarget: true,
},
{
key: 'github',
title: <Icon type="github" />,
href: 'https://github.com/ant-design/ant-design-pro',
blankTarget: true,
},
{
key: 'Ant Design',
title: 'Ant Design',
href: 'http://ant.design',
blankTarget: true,
},
]}
copyright={
<Fragment>
Copyright <Icon type="copyright" /> 2018 蚂蚁金服体验技术部出品
</Fragment>
}
/>
</Footer>
>>>>>>>
<Footer /> |
<<<<<<<
console.log('pluginsManager install');
if (plugin) {
_kuzzle.pluginsManager.trigger('log:info', `███ kuzzle-plugins: Installing plugin ${plugin}...`);
}
else {
_kuzzle.pluginsManager.trigger('log:info', '███ kuzzle-plugins: Starting plugins installation...');
}
=======
_kuzzle.pluginsManager.trigger('log:info', `███ kuzzle-plugins: Installing plugin ${pluginName}...`);
>>>>>>>
_kuzzle.pluginsManager.trigger('log:info', `███ kuzzle-plugins: Installing plugin ${pluginName}...`);
<<<<<<<
});
}
/**
* Creates the internalIndex in the Kuzzle database, if it
* doesn't already exists
*/
function initializeInternalIndex () {
return _kuzzle.internalEngine.createInternalIndex()
.then(() => {
/*
Disables mapping on the 'config' object to avoid conflicts
between different plugins
*/
return _kuzzle.internalEngine.updateMapping(
'plugins',
{
properties: {
config: {
enabled: false
}
}
}
);
})
.catch(err => {
// ignoring error if it's raised because the index already exists
if (err.status === 400) {
return Promise.resolve();
}
return Promise.reject(err);
});
}
/**
* Returns the list of plugins to install
* The returned list is in the following format:
* [
* "plugin-name": {
* "how to": "get this plugin"
* }
* ]
*
* @param {Object} db - database service
* @param {Object} cfg - Kuzzle configuration
* @returns Promise
*/
function getPluginsList() {
var list = {};
return _kuzzle.internalEngine
.search('plugins')
.then(result => {
var plugins = {};
if (result.total === 0) {
Object.keys(_kuzzle.config.plugins)
.filter(key => key !== 'common')
.forEach(key => {
list[key] = _kuzzle.config.plugins[key];
});
return list;
}
result.hits.forEach(p => {
plugins[p._id] = p._source;
});
return plugins;
});
}
/**
* Install plugins and load their configuration into the database
*
* @param plugin to install. May be undefined (install all listed plugins)
* @param options - arguments supplied by the user on the command-line
* @param dbService - handler to Kuzzle's database
* @param kuzzleConfiguration - Kuzzle configuratioin
* @returns {Promise}
*/
function installPlugins(plugin, options) {
var
p = {},
pluginsListPromise,
pluginsList;
console.log('installPlugins', plugin, options);
if (plugin) {
p[plugin] = {};
['npmVersion', 'gitUrl', 'path'].forEach(tag => {
if (options[tag] !== undefined) {
p[plugin][tag] = options[tag];
}
});
p[plugin].activated = options.activated;
pluginsListPromise = Promise.resolve(p);
}
else {
pluginsListPromise = getPluginsList();
}
return pluginsListPromise
.then(plugins => {
pluginsList = plugins;
if (_.isEmpty(plugins)) {
return Promise.resolve();
}
return acquirePlugins(plugins);
=======
>>>>>>>
<<<<<<<
});
}
/**
* Updates plugins configuration in Kuzzle database
*
* @param db - database service client
* @param collection in which the plugin configuration must be stored
* @param plugins list
* @returns {Promise}
*/
function updatePluginsConfiguration(plugins) {
var promises = [];
_.forEach(plugins, (plugin, name) => {
var
pluginPackage,
pluginConfiguration;
console.log('updatePluginsConfiguration', plugin)
try {
if (plugin.path) {
console.log('plugin.path', plugin.path)
pluginPackage = require(path.join(plugin.path, 'package.json'));
}
else {
console.log('getPluginPath(plugin, name)', getPluginPath(plugin, name))
pluginPackage = require(path.join(getPluginPath(plugin, name), 'package.json'));
}
}
catch (e) {
_kuzzle.pluginsManager.trigger('log:error',
'There is a problem with plugin ' + name + '. Check the plugin installation directory');
promises.push(Promise.reject(e));
return false;
}
// If there is no information about plugin in the package.json
if (!pluginPackage.pluginInfo) {
return false;
}
pluginConfiguration = _.extend(plugin, pluginPackage.pluginInfo);
if (pluginConfiguration.defaultConfig) {
pluginConfiguration.config = _.merge(pluginConfiguration.defaultConfig, pluginConfiguration.config);
delete pluginConfiguration.defaultConfig;
}
// By default, when a new plugin is installed, the plugin is activated
if (pluginConfiguration.activated === undefined) {
pluginConfiguration.activated = true;
}
console.log('pluginConfiguration.config', pluginConfiguration.config)
promises.push(_kuzzle.internalEngine.createOrReplace(
'plugins',
name,
pluginConfiguration
));
});
return Promise.all(promises);
}
/**
* Detects if the configured plugin must be installed
* If the plugin is configured with an url from GIT, the plugin is installed every time
* to ensure getting the latest release
* If the plugin come from NPM or , the plugin is installed only if the required version
* is different from the version of the already installed plugin
*
* @param plugin
* @param name
* @returns {boolean} true if the plugin must be installed, false if not
*/
function needInstall(plugin, name) {
var
packageDefinition,
packagePath,
lockPath,
pluginPath = getPluginPath(plugin, name);
// If we want to install a plugin with git, maybe there is no version and we want to 'pull' the plugin
if (plugin.gitUrl) {
lockPath = path.join(pluginPath, 'lock');
// Check if the plugin was installed in the current hour, if not then we install it again in case of update
if (fs.existsSync(lockPath)) {
if (new Date(fs.statSync(lockPath).mtime) > new Date() - 3600000 === true) {
return false;
}
fs.unlinkSync(lockPath);
}
return true;
}
if (plugin.path) {
return false;
}
packagePath = path.join(pluginPath, 'package.json');
if (!fs.existsSync(packagePath)) {
return true;
}
packageDefinition = require(path.join(pluginPath, 'package.json'));
// If version in package.json is different from the version the plugins.json, we want to install the updated plugin
return (packageDefinition._from !== name + '@' + plugin.npmVersion);
}
/**
* Return the real plugin path
* @param plugin
* @param name
* @returns {String}
*/
function getPluginPath (plugin, name) {
if (plugin.path) {
return plugin.path;
}
return path.join(__dirname, '..', '..', '..', '..', 'node_modules', name);
=======
>>>>>>> |
<<<<<<<
import {Icon} from '@conveyal/woonerf'
import { FlexTable, FlexColumn } from 'react-virtualized'
=======
import Icon from 'react-fa'
import { Table, Column } from 'react-virtualized'
>>>>>>>
import {Icon} from '@conveyal/woonerf'
import { FlexTable, FlexColumn } from 'react-virtualized'
import Icon from 'react-fa'
import { Table, Column } from 'react-virtualized'
<<<<<<<
<Icon type='plus'/> Create first {this.props.activeComponent === 'scheduleexception' ? 'exception' : this.props.activeComponent}
=======
<Icon name='plus' /> Create first {this.props.activeComponent === 'scheduleexception' ? 'exception' : this.props.activeComponent}
>>>>>>>
<Icon type='plus'/> Create first {this.props.activeComponent === 'scheduleexception' ? 'exception' : this.props.activeComponent} |
<<<<<<<
import {secondsAfterMidnightToHHMM} from '../../../common/util/gtfs'
import { isTimeFormat, TIMETABLE_FORMATS } from '../../util/timetable'
=======
import * as tripActions from '../../actions/trip'
import { TIMETABLE_FORMATS } from '../../util/timetable'
>>>>>>>
import * as tripActions from '../../actions/trip'
import {secondsAfterMidnightToHHMM} from '../../../common/util/gtfs'
import { isTimeFormat, TIMETABLE_FORMATS } from '../../util/timetable' |
<<<<<<<
filterByRoute?: GtfsRoute,
filterByStop?: GtfsStop,
onChange: any => Promise<any>,
=======
filterByRoute: GtfsRoute,
filterByStop: GtfsStop,
onChange: GtfsOption => void,
>>>>>>>
filterByRoute?: GtfsRoute,
filterByStop?: GtfsStop,
onChange: GtfsOption => Promise<any>,
<<<<<<<
value?: string
}
type Option = {
route?: GtfsRoute,
stop?: GtfsStop,
label: string,
value: string,
agency: Feed
=======
value: string | GtfsOption
>>>>>>>
value?: string | GtfsOption |
<<<<<<<
/**
* Get the appropriate comparison feed version or summarized feed version
* summary given a project, the feed source within the project and a comparison
* column.
*/
export function getVersionValidationSummaryByFilterStrategy (
project: Project,
feedSource: Feed,
comparisonColumn: FeedSourceTableComparisonColumns
): ?ValidationSummary {
if (comparisonColumn === 'DEPLOYED') {
const comparisonDeployment = project.deployments
? (
(
project.pinnedDeploymentId &&
project.deployments.find(
deployment => deployment.id === project.pinnedDeploymentId
)
) || (
project.deployments && project.deployments.length > 0
? project.deployments[0]
: null
)
)
: null
if (comparisonDeployment) {
const comparisonVersion = comparisonDeployment.feedVersions.find(
version => version.feedSource.id === feedSource.id
)
return comparisonVersion && comparisonVersion.validationResult
}
} else if (comparisonColumn === 'PUBLISHED') {
return feedSource.publishedValidationSummary
}
}
export const versionsComparator = (a: FeedVersion, b: FeedVersion) => {
=======
export const versionsLastUpdatedComparator = (a: FeedVersion, b: FeedVersion) => {
>>>>>>>
/**
* Get the appropriate comparison feed version or summarized feed version
* summary given a project, the feed source within the project and a comparison
* column.
*/
export function getVersionValidationSummaryByFilterStrategy (
project: Project,
feedSource: Feed,
comparisonColumn: FeedSourceTableComparisonColumns
): ?ValidationSummary {
if (comparisonColumn === 'DEPLOYED') {
const comparisonDeployment = project.deployments
? (
(
project.pinnedDeploymentId &&
project.deployments.find(
deployment => deployment.id === project.pinnedDeploymentId
)
) || (
project.deployments && project.deployments.length > 0
? project.deployments[0]
: null
)
)
: null
if (comparisonDeployment) {
const comparisonVersion = comparisonDeployment.feedVersions.find(
version => version.feedSource.id === feedSource.id
)
return comparisonVersion && comparisonVersion.validationResult
}
} else if (comparisonColumn === 'PUBLISHED') {
return feedSource.publishedValidationSummary
}
}
export const versionsLastUpdatedComparator = (a: FeedVersion, b: FeedVersion) => { |
<<<<<<<
toggleAllRows: ({active: boolean}) => void,
toggleRowSelection: ({active: boolean, rowIndex: number}) => void,
tripValidationErrors: TripValidationIssues,
updateCellValue: ({key: string, rowIndex: number, value: any}) => void,
=======
toggleAllRows: typeof tripActions.toggleAllRows,
toggleRowSelection: typeof tripActions.toggleRowSelection,
updateCellValue: typeof tripActions.updateCellValue,
>>>>>>>
toggleAllRows: typeof tripActions.toggleAllRows,
toggleRowSelection: typeof tripActions.toggleRowSelection,
tripValidationErrors: TripValidationIssues,
updateCellValue: typeof tripActions.updateCellValue, |
<<<<<<<
import {isExtensionEnabled} from '../../common/util/config'
=======
import {API_PREFIX} from '../../common/constants'
>>>>>>>
import {API_PREFIX} from '../../common/constants'
import {isExtensionEnabled} from '../../common/util/config' |
<<<<<<<
import { InputGroup, Checkbox, Nav, NavItem, NavDropdown, MenuItem, Button, Form, FormControl } from 'react-bootstrap'
import {Icon} from '@conveyal/woonerf'
=======
>>>>>>>
import { InputGroup, Checkbox, Nav, NavItem, NavDropdown, MenuItem, Button, Form, FormControl } from 'react-bootstrap'
import {Icon} from '@conveyal/woonerf'
<<<<<<<
const columns = [
{
name: 'Block ID',
width: 30,
key: 'blockId',
type: 'TEXT',
placeholder: '300'
},
{
name: 'Trip ID',
width: 300,
key: 'gtfsTripId',
type: 'TEXT',
placeholder: '12345678'
},
{
name: 'Trip Headsign',
width: 300,
key: 'tripHeadsign',
type: 'TEXT',
placeholder: 'Destination via Transfer Center'
},
]
if (activePattern && activePattern.patternStops) {
if (!activePattern.useFrequency) {
activePattern.patternStops.map((ps, index) => {
let stop = tableData.stop ? tableData.stop.find(st => st.id === ps.stopId) : null
let stopName = stop ? stop.stop_name : ps.stopId
columns.push({
name: stopName && stopName.length > 15 ? stopName.substr(0, 15) + '...' : stopName,
title: stopName,
width: 100,
key: `stopTimes.${index}.arrivalTime`,
colSpan: '2',
hidden: false,
type: 'ARRIVAL_TIME',
placeholder: 'HH:MM:SS'
})
columns.push({
key: `stopTimes.${index}.departureTime`,
hidden: this.state.hideDepartureTimes,
type: 'DEPARTURE_TIME',
placeholder: 'HH:MM:SS'
})
})
}
// columns added if using freqency schedule type
else {
columns.push({
name: 'Start time',
width: 100,
key: 'startTime',
type: 'TIME',
placeholder: 'HH:MM:SS'
})
columns.push({
name: 'End time',
width: 100,
key: 'endTime',
type: 'TIME',
placeholder: 'HH:MM:SS'
})
columns.push({
name: 'Headway',
width: 60,
key: 'headway',
type: 'MINUTES',
placeholder: '15 (min)'
})
}
}
const tableType = !activePattern
? ''
: activePattern.useFrequency
? 'Frequencies for'
: 'Timetables for'
const headerText = <span>{tableType} {activePattern ? <span title={activePattern.name}>{truncate(activePattern.name, 20)}</span> : <Icon className='fa-spin' type='refresh' />}</span>
=======
const HEADER_HEIGHT = 118
>>>>>>>
const HEADER_HEIGHT = 118
<<<<<<<
<div
className='timetable-header'
style={headerStyle}
>
<h3>
<Form
className='pull-right'
inline
>
{activePattern && !activePattern.useFrequency
? <Checkbox
value={this.state.hideDepartureTimes}
onChange={(evt) => {
this.setState({hideDepartureTimes: !this.state.hideDepartureTimes})
}}
>
<small> Hide departure times</small>
</Checkbox>
: null
}
{' '}
<InputGroup>
<HourMinuteInput
ref='offsetInput'
style={{width: '65px'}}
onChange={(seconds) => {
this.setState({offsetSeconds: seconds})
}}
/>
<InputGroup.Button>
<Button
// disabled={this.state.selected.length === 0}
onClick={() => {
if (this.state.selected.length > 0) {
this.offsetRows(this.state.selected, this.state.offsetSeconds, columns)
}
// if no rows selected, offset last row
else {
this.offsetRows([this.state.data.length - 1], this.state.offsetSeconds, columns)
}
}}
>
Offset
</Button>
</InputGroup.Button>
</InputGroup>
{' '}
<Button
onClick={() => this.addNewRow(columns)}
bsStyle='default'
>
<Icon type='plus'/> New trip
</Button>
{' '}
<Button
disabled={this.state.selected.length === 0}
>
<Icon type='clone'/>
</Button>
{' '}
<Button
disabled={this.state.selected.length === 0}
onClick={() => {
this.removeSelectedRows(feedSource.id, activePattern, activeScheduleId)
}}
bsStyle='danger'
>
<Icon type='trash'/>
</Button>
{' '}
<Button
disabled={this.state.edited.length === 0}
onClick={(e) => {
// this.props.setActiveEntity(this.props.feedSource.id, this.props.activeComponent, null)
this.props.setActiveEntity(feedSource.id, 'route', route, 'trippattern', activePattern, 'timetable', activeScheduleId)
}}
>
Reset
</Button>
{' '}
<Button
disabled={this.state.edited.length === 0}
onClick={() => {
this.saveEditedTrips(activePattern, activeScheduleId)
}}
bsStyle='primary'
>
Save
</Button>
</Form>
<Button
onClick={() => {
this.props.setActiveEntity(feedSource.id, 'route', route, 'trippattern', activePattern)
}}
><Icon type='reply'/> Back to route</Button>
{' '}
{headerText}
</h3>
<Nav style={{marginBottom: '5px'}} bsStyle='tabs' activeKey={activeScheduleId} onSelect={this.handleSelect}>
{calendars
? calendars.map(c => {
return (
<NavItem
eventKey={c.id}
onClick={() => {
if (activeScheduleId === c.id) {
// this.props.setActiveEntity(feedSource.id, 'route', route, 'trippattern', activePattern, 'timetable')
}
else {
this.props.setActiveEntity(feedSource.id, 'route', route, 'trippattern', activePattern, 'timetable', c)
}
}}
>
{c.description}
</NavItem>
)
})
: null
}
<NavDropdown eventKey="4" title="More..." id="nav-dropdown">
<MenuItem eventKey="4.1">Action</MenuItem>
<MenuItem eventKey="4.2">Another action</MenuItem>
<MenuItem eventKey="4.3">Something else here</MenuItem>
<MenuItem divider />
<MenuItem eventKey="4.4">Separated link</MenuItem>
</NavDropdown>
<NavItem
eventKey={'scheduleexception'}
onClick={() => {
if (this.props.activeComponent !== 'scheduleexception') {
this.props.setActiveEntity(feedSource.id, 'calendar', {id: 'new'})
}
}}
>
<Icon type='plus'/> Add calendar
</NavItem>
</Nav>
</div>
<div
className='timetable-body'
style={{marginTop: '125px'}}
>
=======
<TimetableHeader
activePattern={activePattern}
selected={this.props.timetable.selected}
removeSelectedRows={() => this.removeSelectedRows()}
offsetRows={(rowIndexes, offsetAmount) => this.offsetRows(rowIndexes, offsetAmount)}
hideDepartureTimes={this.props.timetable.hideDepartureTimes}
addNewRow={(blank, scroll) => this.addNewRow(blank, scroll)}
edited={this.props.timetable.edited}
data={this.props.timetable.trips}
saveEditedTrips={(pattern, scheduleId) => this.saveEditedTrips(pattern, scheduleId)}
{...this.props}
/>
>>>>>>>
<TimetableHeader
activePattern={activePattern}
selected={this.props.timetable.selected}
removeSelectedRows={() => this.removeSelectedRows()}
offsetRows={(rowIndexes, offsetAmount) => this.offsetRows(rowIndexes, offsetAmount)}
hideDepartureTimes={this.props.timetable.hideDepartureTimes}
addNewRow={(blank, scroll) => this.addNewRow(blank, scroll)}
edited={this.props.timetable.edited}
data={this.props.timetable.trips}
saveEditedTrips={(pattern, scheduleId) => this.saveEditedTrips(pattern, scheduleId)}
{...this.props}
/> |
<<<<<<<
bounds?: Array<Array<number>>,
dateTime: any,
disableRefresh?: boolean,
disableScroll?: any,
=======
bounds: Array<Array<number>>,
dateTime: DateTimeFilter,
disableRefresh: boolean,
disableScroll: boolean,
>>>>>>>
bounds?: Array<Array<number>>,
dateTime: DateTimeFilter,
disableRefresh?: boolean,
disableScroll?: boolean,
<<<<<<<
feeds?: Array<Feed>,
fetchIsochrones: Function,
=======
feeds: Array<Feed>,
fetchIsochrones: (FeedVersion, number, number, number, number) => void,
>>>>>>>
feeds?: Array<Feed>,
fetchIsochrones: (FeedVersion, number, number, number, number) => void,
<<<<<<<
isochroneBand?: number,
mapState: any,
newEntityId?: number,
onRouteClick?: (any) => void,
onStopClick?: (any) => void,
pattern?: any,
=======
isochroneBand: number,
mapState: MapState,
newEntityId: number,
onRouteClick: (GtfsRoute, Feed, number) => void,
onStopClick: (GtfsStop, any, number) => void,
onZoomChange: (any) => void,
pattern: any,
>>>>>>>
isochroneBand?: number,
mapState: MapFilter,
newEntityId?: number,
onRouteClick: (GtfsRoute, Feed, number) => void,
onStopClick: (GtfsStop, any, number) => void,
onZoomChange: (any) => void,
pattern?: any,
<<<<<<<
popupAction?: string,
refreshGtfsElements: Function,
renderTransferPerformance?: boolean,
=======
popupAction: string,
position: Array<any>,
refreshGtfsElements: (Array<Feed>, Array<string>) => void,
renderTransferPerformance: boolean,
>>>>>>>
popupAction?: string,
position: Array<any>,
refreshGtfsElements: (Array<Feed>, Array<string>) => void,
renderTransferPerformance?: boolean,
<<<<<<<
showBounds?: boolean,
showIsochrones?: boolean,
showPatterns?: boolean,
showStops?: boolean,
sidebarExpanded: any,
stop?: any,
stops: Array<any>,
updateMapState: (any) => void,
version: any,
=======
showBounds: boolean,
showIsochrones: boolean,
showPatterns: boolean,
showStops: boolean,
sidebarExpanded: boolean,
stop: StopWithFeed,
stops: Array<StopWithFeed>,
updateMapState: ({bounds: any, zoom?: number}) => void,
version: FeedVersion,
>>>>>>>
showBounds?: boolean,
showIsochrones?: boolean,
showPatterns?: boolean,
showStops?: boolean,
sidebarExpanded: any,
stop?: StopWithFeed,
stops: Array<StopWithFeed>,
updateMapState: ({bounds: any, zoom?: number}) => void,
version: FeedVersion, |
<<<<<<<
let disabled = !user.permissions.isProjectAdmin(project.id, project.organizationId)
=======
const disabled = !this.props.user.permissions.isProjectAdmin(project.id)
>>>>>>>
const disabled = !user.permissions.isProjectAdmin(project.id, project.organizationId) |
<<<<<<<
import {login} from '../../manager/actions/user'
import {removeEditorLock} from '../../editor/actions/editor'
=======
>>>>>>>
import {removeEditorLock} from '../../editor/actions/editor'
<<<<<<<
clearStatusModal,
login,
removeEditorLock
=======
clearStatusModal
>>>>>>>
clearStatusModal,
removeEditorLock |
<<<<<<<
<ManagerSidebar />
{/*<ManagerNavbar noMargin={this.props.noMargin}/>*/}
<div className='page'>
{this.props.children}
<footer className='footer'>
<div className='container'>
<ul className='list-inline text-center text-muted'>
<li><a href={DT_CONFIG.application.changelog_url}>Changelog</a></li>
<li><a href={DT_CONFIG.application.docs_url}>Guide</a></li>
<li><a href={`mailto:${DT_CONFIG.application.support_email}`}>Contact</a></li>
</ul>
<p className='text-center text-muted'>© <a href='http://conveyal.com'>Conveyal</a></p>
</div>
</footer>
</div>
=======
<footer className='footer'>
<div className='container'>
<ul className='list-inline text-center text-muted'>
<li><a href={getConfigProperty('application.changelog_url')}>Changelog</a></li>
<li><a href={getConfigProperty('application.docs_url')}>Guide</a></li>
<li><a href={`mailto:${getConfigProperty('application.support_email')}`}>Contact</a></li>
</ul>
<p className='text-center text-muted'>© <a href='http://conveyal.com'>Conveyal</a></p>
</div>
</footer>
>>>>>>>
<ManagerSidebar />
{/*<ManagerNavbar noMargin={this.props.noMargin}/>*/}
<div className='page'>
{this.props.children}
<footer className='footer'>
<div className='container'>
<ul className='list-inline text-center text-muted'>
<li><a href={getConfigProperty('application.changelog_url')}>Changelog</a></li>
<li><a href={getConfigProperty('application.docs_url')}>Guide</a></li>
<li><a href={`mailto:${getConfigProperty('application.support_email')}`}>Contact</a></li>
</ul>
<p className='text-center text-muted'>© <a href='http://conveyal.com'>Conveyal</a></p>
</div>
</footer>
</div> |
<<<<<<<
import * as adminActions from '../actions/admin'
import Loading from '../../common/components/Loading'
=======
import * as adminActions from '../actions/admin'
import * as organizationActions from '../actions/organizations'
>>>>>>>
import * as adminActions from '../actions/admin'
import * as organizationActions from '../actions/organizations'
import Loading from '../../common/components/Loading'
<<<<<<<
import type {Organization, OtpServer, Project, UserProfile} from '../../types'
import type {
AdminUsersState,
OrganizationsState,
ManagerUserState
} from '../../types/reducers'
=======
import type {Props as ContainerProps} from '../containers/ActiveUserAdmin'
import type {Project} from '../../types'
import type {AdminUsersState, OrganizationsState, ManagerUserState} from '../../types/reducers'
>>>>>>>
import type {Props as ContainerProps} from '../containers/ActiveUserAdmin'
import type {Organization, OtpServer, Project, UserProfile} from '../../types'
import type {
AdminUsersState,
OrganizationsState,
ManagerUserState
} from '../../types/reducers'
<<<<<<<
createOrganization: any => Promise<any>,
createUser: ({email: string, password: string, permissions: UserPermissions}) => void,
deleteOrganization: Organization => void,
deleteServer: typeof adminActions.deleteServer,
deleteUser: UserProfile => void,
fetchOrganizations: () => void,
fetchProjectFeeds: string => void,
=======
createOrganization: typeof organizationActions.createOrganization,
createUser: typeof adminActions.createUser,
deleteOrganization: typeof organizationActions.deleteOrganization,
deleteUser: typeof adminActions.deleteUser,
fetchOrganizations: typeof organizationActions.fetchOrganizations,
fetchProjectFeeds: typeof feedActions.fetchProjectFeeds,
fetchProjects: typeof projectActions.fetchProjects,
fetchUsers: typeof adminActions.fetchUsers,
>>>>>>>
createOrganization: typeof organizationActions.createOrganization,
createUser: typeof adminActions.createUser,
deleteOrganization: typeof organizationActions.deleteOrganization,
deleteServer: typeof adminActions.deleteServer,
deleteUser: typeof adminActions.deleteUser,
fetchOrganizations: typeof organizationActions.fetchOrganizations,
fetchProjectFeeds: typeof feedActions.fetchProjectFeeds,
fetchProjects: typeof projectActions.fetchProjects,
fetchUsers: typeof adminActions.fetchUsers,
<<<<<<<
saveOrganization: Organization => void,
saveUser: (UserProfile, any) => void,
setPage: number => void,
setUserPermission: (UserProfile, any) => void,
updateOrganization: (Organization, any) => void,
updateServer: typeof adminActions.updateServer,
=======
setUserPage: typeof adminActions.setUserPage,
setUserQueryString: typeof adminActions.setUserQueryString,
updateOrganization: typeof organizationActions.updateOrganization,
updateUserData: typeof managerUserActions.updateUserData,
>>>>>>>
setUserPage: typeof adminActions.setUserPage,
setUserQueryString: typeof adminActions.setUserQueryString,
updateOrganization: typeof organizationActions.updateOrganization,
updateServer: typeof adminActions.updateServer,
updateUserData: typeof managerUserActions.updateUserData,
<<<<<<<
user,
users,
organizations,
otpServers,
projects,
=======
>>>>>>>
<<<<<<<
{this._getMainContent(isApplicationAdmin)}
=======
{users.data &&
projects &&
organizations.data &&
activeComponent === 'users'
? <UserList
createUser={createUser}
creatingUser={user}
deleteUser={deleteUser}
fetchProjectFeeds={fetchProjectFeeds}
fetchUsers={fetchUsers}
isFetching={users.isFetching}
organizations={organizations.data}
page={users.page}
perPage={users.perPage}
projects={projects}
setUserPage={setUserPage}
setUserQueryString={setUserQueryString}
token={user.token || 'token-invalid'}
updateUserData={updateUserData}
userCount={users.userCount}
users={users.data}
/>
: activeComponent === 'logs'
? <p className='text-center' style={{marginTop: '100px'}}>
<Button
bsStyle='danger'
bsSize='large'
href='https://manage.auth0.com/#/logs'>
<Icon type='star' /> View application logs on Auth0.com
</Button>
</p>
: activeComponent === 'organizations' && isApplicationAdmin && !isModuleEnabled('enterprise')
? <OrganizationList {...this.props} />
: null
}
>>>>>>>
{this._getMainContent(isApplicationAdmin)} |
<<<<<<<
case 'MERGE_PROJECT_FEEDS':
if (!job.projectId) {
// FIXME use setErrorMessage instead?
console.warn('No project ID found for job', job)
return
}
dispatch(downloadMergedFeedViaToken(job.projectId, false))
break
=======
>>>>>>>
<<<<<<<
// No completion step for build transport network. User should just
// re-request isochrones.
case 'SYNC_PROJECT_FEEDS':
if (!job.projectId) {
// FIXME use setErrorMessage instead?
console.warn('No project ID found for job', job)
return
}
return dispatch(fetchProjectWithFeeds(job.projectId))
=======
case 'MERGE_FEED_VERSIONS':
if (job.mergeType === 'REGIONAL') {
// If merging feeds for the project, end result is to download zip.
if (!job.projectId) {
// FIXME use setErrorMessage instead?
console.warn('No project found on job')
return
}
dispatch(downloadMergedFeedViaToken(job.projectId, false))
} else {
const result = job.mergeFeedsResult
const details = []
if (result) {
// Do nothing or show merged feed modal? Feed version is be created
details.push('Remapped ID count: ' + result.remappedReferences)
if (Object.keys(result.remappedIds).length > 0) {
const remappedIdStrings = []
for (let key in result.remappedIds) {
// Modify key to remove feed name.
const split = key.split(':')
const tableAndId = split.splice(1, 1)
remappedIdStrings.push(`${tableAndId.join(':')} -> ${result.remappedIds[key]}`)
}
details.push('Remapped IDs: ' + remappedIdStrings.join(', '))
}
if (result.skippedIds.length > 0) {
const skippedRecordsForTables = {}
result.skippedIds.forEach(id => {
const table = id.split(':')[0]
if (skippedRecordsForTables[table]) {
skippedRecordsForTables[table] = skippedRecordsForTables[table] + 1
} else {
skippedRecordsForTables[table] = 1
}
})
const skippedRecordsStrings = []
for (let key in skippedRecordsForTables) {
skippedRecordsStrings.push(`${key} - ${skippedRecordsForTables[key]}`)
}
details.push('Skipped records: ' + skippedRecordsStrings.join(', '))
}
if (result.idConflicts.length > 0) {
// const conflicts = result.idConflicts
details.push('ID conflicts: ' + result.idConflicts.join(', '))
}
dispatch(setStatusModal({
title: result.failed
? 'Warning: Errors encountered during feed merge!'
: 'Feed merge was successful!',
body: result.failed
? `Merge failed with ${result.errorCount} errors. ${result.failureReasons.join(', ')}`
: `Merge was completed successfully. A new version will be processed/validated containing the resulting feed.`,
detail: details.join('\n')
}))
}
}
break
>>>>>>>
// No completion step for build transport network. User should just
// re-request isochrones.
case 'SYNC_PROJECT_FEEDS':
if (!job.projectId) {
// FIXME use setErrorMessage instead?
console.warn('No project ID found for job', job)
return
}
return dispatch(fetchProjectWithFeeds(job.projectId))
case 'MERGE_FEED_VERSIONS':
if (job.mergeType === 'REGIONAL') {
// If merging feeds for the project, end result is to download zip.
if (!job.projectId) {
// FIXME use setErrorMessage instead?
console.warn('No project found on job')
return
}
dispatch(downloadMergedFeedViaToken(job.projectId, false))
} else {
const result = job.mergeFeedsResult
const details = []
if (result) {
// Do nothing or show merged feed modal? Feed version is be created
details.push('Remapped ID count: ' + result.remappedReferences)
if (Object.keys(result.remappedIds).length > 0) {
const remappedIdStrings = []
for (let key in result.remappedIds) {
// Modify key to remove feed name.
const split = key.split(':')
const tableAndId = split.splice(1, 1)
remappedIdStrings.push(`${tableAndId.join(':')} -> ${result.remappedIds[key]}`)
}
details.push('Remapped IDs: ' + remappedIdStrings.join(', '))
}
if (result.skippedIds.length > 0) {
const skippedRecordsForTables = {}
result.skippedIds.forEach(id => {
const table = id.split(':')[0]
if (skippedRecordsForTables[table]) {
skippedRecordsForTables[table] = skippedRecordsForTables[table] + 1
} else {
skippedRecordsForTables[table] = 1
}
})
const skippedRecordsStrings = []
for (let key in skippedRecordsForTables) {
skippedRecordsStrings.push(`${key} - ${skippedRecordsForTables[key]}`)
}
details.push('Skipped records: ' + skippedRecordsStrings.join(', '))
}
if (result.idConflicts.length > 0) {
// const conflicts = result.idConflicts
details.push('ID conflicts: ' + result.idConflicts.join(', '))
}
dispatch(setStatusModal({
title: result.failed
? 'Warning: Errors encountered during feed merge!'
: 'Feed merge was successful!',
body: result.failed
? `Merge failed with ${result.errorCount} errors. ${result.failureReasons.join(', ')}`
: `Merge was completed successfully. A new version will be processed/validated containing the resulting feed.`,
detail: details.join('\n')
}))
}
}
break |
<<<<<<<
import ActiveUserAdmin from '../../admin/containers/ActiveUserAdmin'
import MainAlertsViewer from '../../alerts/containers/MainAlertsViewer'
import ActiveAlertEditor from '../../alerts/containers/ActiveAlertEditor'
import PageNotFound from '../components/PageNotFound'
import ActiveGtfsEditor from '../../editor/containers/ActiveGtfsEditor'
import { checkExistingLogin, login } from '../../manager/actions/user'
import ActiveDeploymentViewer from '../../manager/containers/ActiveDeploymentViewer'
=======
// minified file is imported because of https://github.com/bugsnag/bugsnag-js/issues/366
import bugsnag from 'bugsnag-js/dist/bugsnag.min'
import createPlugin from 'bugsnag-react'
import omit from 'lodash/omit'
import React, { Component } from 'react'
import {connect} from 'react-redux'
import { Router, Route, browserHistory } from 'react-router'
import ActiveUserAdmin from '../../admin/containers/ActiveUserAdmin'
import MainAlertsViewer from '../../alerts/containers/MainAlertsViewer'
import ActiveAlertEditor from '../../alerts/containers/ActiveAlertEditor'
import PageNotFound from '../components/PageNotFound'
import ActiveGtfsEditor from '../../editor/containers/ActiveGtfsEditor'
import Login from './Login'
import {checkLogin, login} from '../../manager/actions/user'
import ActiveDeploymentViewer from '../../manager/containers/ActiveDeploymentViewer'
>>>>>>>
// minified file is imported because of https://github.com/bugsnag/bugsnag-js/issues/366
import bugsnag from 'bugsnag-js/dist/bugsnag.min'
import createPlugin from 'bugsnag-react'
import omit from 'lodash/omit'
import React, { Component } from 'react'
import {connect} from 'react-redux'
import { Router, Route, browserHistory } from 'react-router'
import ActiveUserAdmin from '../../admin/containers/ActiveUserAdmin'
import MainAlertsViewer from '../../alerts/containers/MainAlertsViewer'
import ActiveAlertEditor from '../../alerts/containers/ActiveAlertEditor'
import PageNotFound from '../components/PageNotFound'
import ActiveGtfsEditor from '../../editor/containers/ActiveGtfsEditor'
import Login from './Login'
import {checkLogin, login} from '../../manager/actions/user'
import ActiveDeploymentViewer from '../../manager/containers/ActiveDeploymentViewer'
<<<<<<<
import ActiveProjectViewer from '../../manager/containers/ActiveProjectViewer'
import ActiveUserHomePage from '../../manager/containers/ActiveUserHomePage'
import CreateProject from '../../manager/containers/CreateProject'
=======
import ActiveProjectViewer from '../../manager/containers/ActiveProjectViewer'
import ActiveUserHomePage from '../../manager/containers/ActiveUserHomePage'
>>>>>>>
import ActiveProjectViewer from '../../manager/containers/ActiveProjectViewer'
import ActiveUserHomePage from '../../manager/containers/ActiveUserHomePage'
import CreateProject from '../../manager/containers/CreateProject'
<<<<<<<
import ActiveSignEditor from '../../signs/containers/ActiveSignEditor'
import MainSignsViewer from '../../signs/containers/MainSignsViewer'
import {isModuleEnabled} from '../util/config'
=======
import ActiveSignEditor from '../../signs/containers/ActiveSignEditor'
import MainSignsViewer from '../../signs/containers/MainSignsViewer'
import {logPageView} from '../util/analytics'
import {isModuleEnabled} from '../util/config'
import type {dispatchFn, getStateFn, AppState, ManagerUserState} from '../../types/reducers'
>>>>>>>
import ActiveSignEditor from '../../signs/containers/ActiveSignEditor'
import MainSignsViewer from '../../signs/containers/MainSignsViewer'
import {logPageView} from '../util/analytics'
import {isModuleEnabled} from '../util/config'
import type {dispatchFn, getStateFn, AppState, ManagerUserState} from '../../types/reducers'
<<<<<<<
{path: '/settings(/:subpage)(/:projectId)', component: ActiveUserAccount, onEnter: this.requireAuth},
{path: '/admin(/:subpage)', component: ActiveUserAdmin, onEnter: this.requireAdmin},
{path: '/signup', component: ActiveSignupPage, onEnter: this.checkLogin},
{path: '/home(/:projectId)', component: ActiveUserHomePage, onEnter: this.requireAuth},
{path: '/', component: ActivePublicFeedsViewer, onEnter: this.checkLogin},
{path: '/public/feed/:feedSourceId(/version/:feedVersionIndex)', component: ActivePublicFeedSourceViewer, onEnter: this.checkLogin},
{path: '/project', component: ActiveProjectsList, onEnter: this.requireAuth},
{path: '/project/new', component: CreateProject, onEnter: this.requireAuth},
{path: '/project/:projectId(/:subpage)(/:subsubpage)', component: ActiveProjectViewer, onEnter: this.requireAuth},
=======
>>>>>>> |
<<<<<<<
hasProjectPermission (organizationId, projectId, permissionType) {
if (this.isProjectAdmin(projectId, organizationId)) return true
let p = this.getProjectPermission(projectId, permissionType)
=======
hasProjectPermission (projectId, permissionType) {
if (this.isProjectAdmin(projectId)) return true
const p = this.getProjectPermission(projectId, permissionType)
>>>>>>>
hasProjectPermission (organizationId, projectId, permissionType) {
if (this.isProjectAdmin(projectId, organizationId)) return true
const p = this.getProjectPermission(projectId, permissionType)
<<<<<<<
hasFeedPermission (organizationId, projectId, feedId, permissionType) {
if (this.isProjectAdmin(projectId, organizationId)) return true
let p = this.getProjectPermission(projectId, permissionType)
=======
hasFeedPermission (projectId, feedId, permissionType) {
if (this.isProjectAdmin(projectId)) return true
const p = this.getProjectPermission(projectId, permissionType)
>>>>>>>
hasFeedPermission (organizationId, projectId, feedId, permissionType) {
if (this.isProjectAdmin(projectId, organizationId)) return true
const p = this.getProjectPermission(projectId, permissionType) |
<<<<<<<
? feedSources.map((feedSource) => {
return <FeedSourceTableRow
key={feedSource.id || Math.random()}
feedSource={feedSource}
project={project}
user={user}
updateFeedSourceProperty={updateFeedSourceProperty}
saveFeedSource={saveFeedSource}
hoverComponent={hover}
onHover={this._onHover}
active={this.state.activeFeedSource && this.state.activeFeedSource.id === feedSource.id}
hold={this.state.holdFeedSource && this.state.holdFeedSource.id === feedSource.id} />
})
: <ListGroupItem className='text-center'>
<Button
bsStyle='success'
data-test-id='create-first-feed-source-button'
disabled={!user.permissions.isProjectAdmin(project.id, project.organizationId)}
onClick={onNewFeedSourceClick}>
<Icon type='plus' /> {getMessage(messages, 'feeds.createFirst')}
</Button>
</ListGroupItem>
}
=======
? feedSources.map((feedSource) => {
return <FeedSourceTableRow
key={feedSource.id || Math.random()}
feedSource={feedSource}
project={project}
user={user}
updateFeedSource={updateFeedSource}
saveFeedSource={saveFeedSource}
hoverComponent={hover}
onHover={this._onHover}
active={this.state.activeFeedSource && this.state.activeFeedSource.id === feedSource.id}
hold={this.state.holdFeedSource && this.state.holdFeedSource.id === feedSource.id} />
})
: <ListGroupItem className='text-center'>
<Button
bsStyle='success'
disabled={!user.permissions.isProjectAdmin(project.id, project.organizationId)}
onClick={onNewFeedSourceClick}>
<Icon type='plus' /> {getMessage(messages, 'feeds.createFirst')}
</Button>
</ListGroupItem>
}
>>>>>>>
? feedSources.map((feedSource) => {
return <FeedSourceTableRow
key={feedSource.id || Math.random()}
feedSource={feedSource}
project={project}
user={user}
updateFeedSource={updateFeedSource}
saveFeedSource={saveFeedSource}
hoverComponent={hover}
onHover={this._onHover}
active={this.state.activeFeedSource && this.state.activeFeedSource.id === feedSource.id}
hold={this.state.holdFeedSource && this.state.holdFeedSource.id === feedSource.id} />
})
: <ListGroupItem className='text-center'>
<Button
bsStyle='success'
data-test-id='create-first-feed-source-button'
disabled={!user.permissions.isProjectAdmin(project.id, project.organizationId)}
onClick={onNewFeedSourceClick}>
<Icon type='plus' /> {getMessage(messages, 'feeds.createFirst')}
</Button>
</ListGroupItem>
} |
<<<<<<<
import type {Pattern} from '../../../../gtfs/reducers/patterns'
import type {Route} from '../../../../gtfs/reducers/routes'
import type {AppState, dispatchFn} from '../../../../types'
const mapStateToProps = (state: AppState, ownProps) => {
=======
const mapStateToProps = (state, ownProps) => {
const {gtfs} = state
>>>>>>>
import type {Pattern} from '../../../../gtfs/reducers/patterns'
import type {Route} from '../../../../gtfs/reducers/routes'
import type {AppState, dispatchFn} from '../../../../types'
const mapStateToProps = (state: AppState, ownProps) => {
const {gtfs} = state
<<<<<<<
gtfs: {
filter,
patterns,
routes: {
allRoutes: routes
},
timetables
}
} = state
=======
filter,
patterns,
routes,
services,
timetables
} = gtfs
>>>>>>>
filter,
patterns,
routes,
timetables
} = gtfs |
<<<<<<<
import OptionButton from '../../../common/components/OptionButton'
=======
import * as tripActions from '../../actions/trip'
>>>>>>>
import * as tripActions from '../../actions/trip'
import OptionButton from '../../../common/components/OptionButton'
<<<<<<<
import type {EditorTableData, Feed, GtfsRoute, Pattern, ServiceCalendar, TripCounts} from '../../../types'
import type {TimetableState} from '../../../types/reducers'
import type {TripValidationIssues} from '../../selectors/timetable'
=======
import type {Feed, GtfsRoute, Pattern, ServiceCalendar, TripCounts} from '../../../types'
import type {EditorTables, TimetableState} from '../../../types/reducers'
>>>>>>>
import type {TripValidationIssues} from '../../selectors/timetable'
import type {Feed, GtfsRoute, Pattern, ServiceCalendar, TripCounts} from '../../../types'
import type {EditorTables, TimetableState} from '../../../types/reducers'
<<<<<<<
setOffset: number => void,
setScrollIndexes: {scrollToColumn: number, scrollToRow: number} => void,
=======
setOffset: typeof tripActions.setOffset,
>>>>>>>
setOffset: typeof tripActions.setOffset,
setScrollIndexes: typeof tripActions.setScrollIndexes,
<<<<<<<
toggleDepartureTimes: () => void,
tripCounts: TripCounts,
tripValidationErrors: TripValidationIssues
=======
toggleDepartureTimes: typeof tripActions.toggleDepartureTimes,
tripCounts: TripCounts
>>>>>>>
toggleDepartureTimes: typeof tripActions.toggleDepartureTimes,
tripCounts: TripCounts,
tripValidationErrors: TripValidationIssues |
<<<<<<<
import type {Entity, Feed, GtfsRoute, Project} from '../../types'
import type {UserState} from '../../types/reducers'
=======
import type {AlertEntity, Feed, Project} from '../../types'
import type {UserState} from '../../manager/reducers/user'
>>>>>>>
import type {AlertEntity, Feed, Project} from '../../types'
import type {UserState} from '../../types/reducers' |
<<<<<<<
});
test('repeated non-cyclic value', function(t) {
t.plan(1);
var one = { x: 1 };
var two = { a: one, b: one };
t.equal(stringify(two), '{"a":{"x":1},"b":{"x":1}}');
=======
});
test('acyclic but with reused obj-property pointers', function (t) {
t.plan(1);
var x = { a: 1 }
var y = { b: x, c: x }
t.equal(stringify(y), '{"b":{"a":1},"c":{"a":1}}');
>>>>>>>
});
test('repeated non-cyclic value', function(t) {
t.plan(1);
var one = { x: 1 };
var two = { a: one, b: one };
t.equal(stringify(two), '{"a":{"x":1},"b":{"x":1}}');
});
test('acyclic but with reused obj-property pointers', function (t) {
t.plan(1);
var x = { a: 1 }
var y = { b: x, c: x }
t.equal(stringify(y), '{"b":{"a":1},"c":{"a":1}}'); |
<<<<<<<
factory.icons = {};
factory.iconNameTmpl = 'img/markers/number_{0}.png';
factory.mapWidth = 0;
=======
factory.icons = {};
factory.iconNameTmpl = 'img/markers/number_{0}.png';
factory.mapWidth = 0;
>>>>>>>
factory.icons = {};
factory.iconNameTmpl = 'img/markers/number_{0}.png';
factory.mapWidth = 0;
factory.mapWidth = 0;
<<<<<<<
// cw: This will fire off several times. We only want the time when we actually have data.
if (elem.clientWidth > 0) {
this.mapWidth = elem.clientWidth;
}
=======
// cw: This will fire off several times. We only want the time when we actually have data.
if (elem.clientWidth > 0) {
this.mapWidth = elem.clientWidth;
}
>>>>>>>
// cw: This will fire off several times. We only want the time when we actually have data.
if (elem.clientWidth > 0) {
this.mapWidth = elem.clientWidth;
}
<<<<<<<
/**
* [zoomToMarker - zoom to a marker on the map]
* @param {integer} marker index
* @return {void}
*/
factory.zoomToMarker = function(idx) {
// Zoom to marker with proper zoom based on bounds.
var p = this.markers[idx].getPosition();
// cw: Would like to pan & zoom to this, but V3 API doesn't make this possible.
this.map.setCenter(p);
// cw: Zoom level determined by hand. Should be a better way.
this.map.setZoom(18);
// cw: Alternative -- find closest marker, add both points to bounds and zoom to
// that to show context.
};
=======
/**
* [zoomToMarker - zoom to a marker on the map]
* @param {integer} marker index
* @return {void}
*/
factory.zoomToMarker = function(idx) {
// Zoom to marker with proper zoom based on bounds.
var p = this.markers[idx].getPosition();
// cw: Would like to pan & zoom to this, but V3 API doesn't make this possible.
this.map.setCenter(p);
// cw: Zoom level determined by hand. Should be a better way.
this.map.setZoom(18);
// cw: Alternative -- find closest marker, add both points to bounds and zoom to
// that to show context.
};
>>>>>>>
/**
* [zoomToMarker - zoom to a marker on the map]
* @param {integer} marker index
* @return {void}
*/
factory.zoomToMarker = function(idx) {
// Zoom to marker with proper zoom based on bounds.
var p = this.markers[idx].getPosition();
// cw: Would like to pan & zoom to this, but V3 API doesn't make this possible.
this.map.setCenter(p);
// cw: Zoom level determined by hand. Should be a better way.
this.map.setZoom(18);
// cw: Alternative -- find closest marker, add both points to bounds and zoom to
// that to show context.
}; |
<<<<<<<
const closeData = {
user: {
_id: user._id,
username: user.username
},
=======
const closeData = {
>>>>>>>
const closeData = {
user: {
_id: user._id,
username: user.username
},
<<<<<<<
};
RocketChat.models.Rooms.closeByRoomId(room._id, closeData);
RocketChat.models.LivechatInquiry.closeByRoomId(room._id, closeData);
=======
};
if (user) {
closeData.closer = 'user';
closeData.closedBy = {
_id: user._id,
username: user.username
};
} else if (visitor) {
closeData.closer = 'visitor';
closeData.closedBy = {
_id: visitor._id,
username: visitor.username
};
}
RocketChat.models.Rooms.closeByRoomId(room._id, closeData);
>>>>>>>
};
if (user) {
closeData.closer = 'user';
closeData.closedBy = {
_id: user._id,
username: user.username
};
} else if (visitor) {
closeData.closer = 'visitor';
closeData.closedBy = {
_id: visitor._id,
username: visitor.username
};
}
RocketChat.models.Rooms.closeByRoomId(room._id, closeData);
RocketChat.models.LivechatInquiry.closeByRoomId(room._id, closeData);
<<<<<<<
const visitor = RocketChat.models.Users.findOneById(room.v._id);
const agent = RocketChat.models.Users.findOneById(room.servedBy && room.servedBy._id);
=======
const visitor = LivechatVisitors.findOneById(room.v._id);
const agent = RocketChat.models.Users.findOneById(room.servedBy._id);
>>>>>>>
const visitor = LivechatVisitors.findOneById(room.v._id);
const agent = RocketChat.models.Users.findOneById(room.servedBy && room.servedBy._id);
<<<<<<<
=======
if (agent.emails && agent.emails.length > 0) {
postData.agent.email = agent.emails;
}
>>>>>>> |
<<<<<<<
});
RocketChat.API.v1.addRoute('channels.getAllUserMentionsByChannel', { authRequired: true }, {
get() {
const { roomId } = this.requestParams();
const { offset, count } = this.getPaginationItems();
const { sort } = this.parseJsonQuery();
if (!roomId) {
return RocketChat.API.v1.failure('The request param "roomId" is required');
}
const mentions = Meteor.runAsUser(this.userId, () => Meteor.call('getUserMentionsByChannel', {
roomId,
options: {
sort: sort ? sort : { ts: 1 },
skip: offset,
limit: count
}
}));
const allMentions = Meteor.runAsUser(this.userId, () => Meteor.call('getUserMentionsByChannel', {
roomId,
options: {}
}));
return RocketChat.API.v1.success({
mentions,
count: mentions.length,
offset,
total: allMentions.length
});
}
});
=======
});
RocketChat.API.v1.addRoute('channels.notifications', { authRequired: true }, {
get() {
const { roomId } = this.requestParams();
if (!roomId) {
return RocketChat.API.v1.failure('The \'roomId\' param is required');
}
const subscription = RocketChat.models.Subscriptions.findOneByRoomIdAndUserId(roomId, this.userId, {
fields: {
_room: 0,
_user: 0,
$loki: 0
}
});
return RocketChat.API.v1.success({
subscription
});
},
post() {
const saveNotifications = (notifications, roomId) => {
Object.keys(notifications).map((notificationKey) => {
Meteor.runAsUser(this.userId, () => Meteor.call('saveNotificationSettings', roomId, notificationKey, notifications[notificationKey]));
});
};
const { roomId, notifications } = this.bodyParams;
if (!roomId) {
return RocketChat.API.v1.failure('The \'roomId\' param is required');
}
if (!notifications || Object.keys(notifications).length === 0) {
return RocketChat.API.v1.failure('The \'notifications\' param is required');
}
saveNotifications(notifications, roomId);
}
});
>>>>>>>
});
RocketChat.API.v1.addRoute('channels.getAllUserMentionsByChannel', { authRequired: true }, {
get() {
const { roomId } = this.requestParams();
const { offset, count } = this.getPaginationItems();
const { sort } = this.parseJsonQuery();
if (!roomId) {
return RocketChat.API.v1.failure('The request param "roomId" is required');
}
const mentions = Meteor.runAsUser(this.userId, () => Meteor.call('getUserMentionsByChannel', {
roomId,
options: {
sort: sort ? sort : { ts: 1 },
skip: offset,
limit: count
}
}));
const allMentions = Meteor.runAsUser(this.userId, () => Meteor.call('getUserMentionsByChannel', {
roomId,
options: {}
}));
return RocketChat.API.v1.success({
mentions,
count: mentions.length,
offset,
total: allMentions.length
});
}
});
RocketChat.API.v1.addRoute('channels.notifications', { authRequired: true }, {
get() {
const { roomId } = this.requestParams();
if (!roomId) {
return RocketChat.API.v1.failure('The \'roomId\' param is required');
}
const subscription = RocketChat.models.Subscriptions.findOneByRoomIdAndUserId(roomId, this.userId, {
fields: {
_room: 0,
_user: 0,
$loki: 0
}
});
return RocketChat.API.v1.success({
subscription
});
},
post() {
const saveNotifications = (notifications, roomId) => {
Object.keys(notifications).map((notificationKey) => {
Meteor.runAsUser(this.userId, () => Meteor.call('saveNotificationSettings', roomId, notificationKey, notifications[notificationKey]));
});
};
const { roomId, notifications } = this.bodyParams;
if (!roomId) {
return RocketChat.API.v1.failure('The \'roomId\' param is required');
}
if (!notifications || Object.keys(notifications).length === 0) {
return RocketChat.API.v1.failure('The \'notifications\' param is required');
}
saveNotifications(notifications, roomId);
}
}); |
<<<<<<<
const postCSSPlugin = Npm.require(pluginName);
if (postCSSPlugin && postCSSPlugin().postcssPlugin) {
=======
const postCSSPlugin = require(pluginName);
if (postCSSPlugin && postCSSPlugin.name === 'creator' && postCSSPlugin().postcssPlugin) {
>>>>>>>
const postCSSPlugin = require(pluginName);
if (postCSSPlugin && postCSSPlugin().postcssPlugin) {
<<<<<<<
from: process.cwd() + file._source.url.replace('_', '-'),
parser: getPostCSSParser(),
map: {
inline: false
}
=======
from: process.cwd() + file._source.url.replace('_', '-')
>>>>>>>
from: process.cwd() + file._source.url.replace('_', '-') |
<<<<<<<
/**
* Replaces @username with full name
*
* @param {string} message The message to replace
* @param {object[]} mentions Array of mentions used to make replacements
*
* @returns {string}
*/
function replaceMentionedUsernamesWithFullNames(message, mentions) {
if (!mentions || !mentions.length) {
return message;
}
mentions.forEach((mention) => {
const user = RocketChat.models.Users.findOneById(mention._id);
if (user && user.name) {
message = message.replace(`@${ mention.username }`, user.name);
}
});
return message;
}
/**
* Send notification to user
*
* @param {string} userId The user to notify
* @param {object} user The sender
* @param {object} room The room send from
* @param {number} duration Duration of notification
*/
function notifyUser(userId, user, message, room, duration) {
const UI_Use_Real_Name = RocketChat.settings.get('UI_Use_Real_Name') === true;
if (UI_Use_Real_Name) {
message.msg = replaceMentionedUsernamesWithFullNames(message.msg, message.mentions);
}
let title = UI_Use_Real_Name ? user.name : `@${ user.username }`;
if (room.t !== 'd' && room.name) {
title += ` @ #${ room.name }`;
}
RocketChat.Notifications.notifyUser(userId, 'notification', {
title,
text: message.msg,
duration,
payload: {
_id: message._id,
rid: message.rid,
sender: message.u,
type: room.t,
name: room.name
}
});
}
/**
* Checks if a message contains a user highlight
*
* @param {string} message
* @param {array|undefined} highlights
*
* @returns {boolean}
*/
function messageContainsHighlight(message, highlights) {
if (! highlights || highlights.length === 0) { return false; }
let has = false;
highlights.some(function(highlight) {
const regexp = new RegExp(s.escapeRegExp(highlight), 'i');
if (regexp.test(message.msg)) {
has = true;
return true;
}
});
return has;
}
=======
function getBadgeCount(userId) {
const subscriptions = RocketChat.models.Subscriptions.findUnreadByUserId(userId).fetch();
return subscriptions.reduce((unread, sub) => {
return sub.unread + unread;
}, 0);
}
>>>>>>>
/**
* Replaces @username with full name
*
* @param {string} message The message to replace
* @param {object[]} mentions Array of mentions used to make replacements
*
* @returns {string}
*/
function replaceMentionedUsernamesWithFullNames(message, mentions) {
if (!mentions || !mentions.length) {
return message;
}
mentions.forEach((mention) => {
const user = RocketChat.models.Users.findOneById(mention._id);
if (user && user.name) {
message = message.replace(`@${ mention.username }`, user.name);
}
});
return message;
}
/**
* Send notification to user
*
* @param {string} userId The user to notify
* @param {object} user The sender
* @param {object} room The room send from
* @param {number} duration Duration of notification
*/
function notifyUser(userId, user, message, room, duration) {
const UI_Use_Real_Name = RocketChat.settings.get('UI_Use_Real_Name') === true;
if (UI_Use_Real_Name) {
message.msg = replaceMentionedUsernamesWithFullNames(message.msg, message.mentions);
}
let title = UI_Use_Real_Name ? user.name : `@${ user.username }`;
if (room.t !== 'd' && room.name) {
title += ` @ #${ room.name }`;
}
RocketChat.Notifications.notifyUser(userId, 'notification', {
title,
text: message.msg,
duration,
payload: {
_id: message._id,
rid: message.rid,
sender: message.u,
type: room.t,
name: room.name
}
});
}
/**
* Checks if a message contains a user highlight
*
* @param {string} message
* @param {array|undefined} highlights
*
* @returns {boolean}
*/
function messageContainsHighlight(message, highlights) {
if (! highlights || highlights.length === 0) { return false; }
let has = false;
highlights.some(function(highlight) {
const regexp = new RegExp(s.escapeRegExp(highlight), 'i');
if (regexp.test(message.msg)) {
has = true;
return true;
}
});
return has;
}
function getBadgeCount(userId) {
const subscriptions = RocketChat.models.Subscriptions.findUnreadByUserId(userId).fetch();
return subscriptions.reduce((unread, sub) => {
return sub.unread + unread;
}, 0);
} |
<<<<<<<
this.reconnectCb = [];
=======
this.loginCb = [];
this.logged = false;
>>>>>>>
this.reconnectCb = [];
this.loginCb = [];
this.logged = false;
<<<<<<<
let connectionWasOnline = true;
Tracker.autorun(() => {
const connected = Meteor.connection.status().connected;
if (connected === true && connectionWasOnline === false) {
for (const cb of this.reconnectCb) {
cb();
}
}
connectionWasOnline = connected;
});
=======
Tracker.autorun(() => {
if (Meteor.userId() !== null) {
if (this.logged === false) {
for (const cb of this.loginCb) {
cb();
}
}
}
this.logged = Meteor.userId() !== null;
});
>>>>>>>
let connectionWasOnline = true;
Tracker.autorun(() => {
const connected = Meteor.connection.status().connected;
if (connected === true && connectionWasOnline === false) {
for (const cb of this.reconnectCb) {
cb();
}
}
connectionWasOnline = connected;
});
Tracker.autorun(() => {
if (Meteor.userId() !== null) {
if (this.logged === false) {
for (const cb of this.loginCb) {
cb();
}
}
}
this.logged = Meteor.userId() !== null;
});
<<<<<<<
onReconnect(cb) {
this.reconnectCb.push(cb);
}
=======
onLogin(cb) {
this.loginCb.push(cb);
if (this.logged) {
cb();
}
}
>>>>>>>
onReconnect(cb) {
this.reconnectCb.push(cb);
}
onLogin(cb) {
this.loginCb.push(cb);
if (this.logged) {
cb();
}
} |
<<<<<<<
data.messageCounterSidebar = $('#messageCounterSidebar').find('input:checked').val();
data.highlights = _.compact(_.map($('[name=highlights]').val().split(','), function(e) {
return s.trim(e);
}));
const selectedLanguage = $('#language').val();
const enableAutoAway = $('#enableAutoAway').find('input:checked').val();
const idleTimeLimit = parseInt($('input[name=idleTimeLimit]').val());
data.enableAutoAway = enableAutoAway;
data.idleTimeLimit = idleTimeLimit;
let reload = false;
if (this.shouldUpdateLocalStorageSetting('userLanguage', selectedLanguage)) {
localStorage.setItem('userLanguage', selectedLanguage);
data.language = selectedLanguage;
reload = true;
}
if (this.shouldUpdateLocalStorageSetting('enableAutoAway', enableAutoAway)) {
localStorage.setItem('enableAutoAway', enableAutoAway);
reload = true;
}
if (this.shouldUpdateLocalStorageSetting('idleTimeLimit', idleTimeLimit)) {
localStorage.setItem('idleTimeLimit', idleTimeLimit);
reload = true;
}
=======
data.roomCounterSidebar = $('#roomCounterSidebar').find('input:checked').val();
>>>>>>>
data.roomCounterSidebar = $('#roomCounterSidebar').find('input:checked').val();
data.messageCounterSidebar = $('#messageCounterSidebar').find('input:checked').val();
data.highlights = _.compact(_.map($('[name=highlights]').val().split(','), function(e) {
return s.trim(e);
}));
const selectedLanguage = $('#language').val();
const enableAutoAway = $('#enableAutoAway').find('input:checked').val();
const idleTimeLimit = parseInt($('input[name=idleTimeLimit]').val());
data.enableAutoAway = enableAutoAway;
data.idleTimeLimit = idleTimeLimit;
let reload = false;
if (this.shouldUpdateLocalStorageSetting('userLanguage', selectedLanguage)) {
localStorage.setItem('userLanguage', selectedLanguage);
data.language = selectedLanguage;
reload = true;
}
if (this.shouldUpdateLocalStorageSetting('enableAutoAway', enableAutoAway)) {
localStorage.setItem('enableAutoAway', enableAutoAway);
reload = true;
}
if (this.shouldUpdateLocalStorageSetting('idleTimeLimit', idleTimeLimit)) {
localStorage.setItem('idleTimeLimit', idleTimeLimit);
reload = true;
} |
<<<<<<<
import s from 'underscore.string';
=======
import { RocketChat, RoomSettingsEnum } from 'meteor/rocketchat:lib';
>>>>>>>
import s from 'underscore.string';
import { RocketChat, RoomSettingsEnum } from 'meteor/rocketchat:lib'; |
<<<<<<<
console.log(settings);
if (typeof settings !== 'object') {
settings = {
[settings] : value
};
}
if (!Object.keys(settings).every(key => fields.includes(key))) {
=======
if (!['roomName', 'roomTopic', 'roomAnnouncement', 'roomDescription', 'roomType', 'readOnly', 'reactWhenReadOnly', 'systemMessages', 'default', 'joinCode', 'tokenpass'].some((s) => s === setting)) {
>>>>>>>
if (typeof settings !== 'object') {
settings = {
[settings] : value
};
}
if (!Object.keys(settings).every(key => fields.includes(key))) { |
<<<<<<<
const {room} = Template.instance();
=======
const room = ChatRoom.findOne(this.rid, {
fields: {
t: 1
}
});
>>>>>>>
const room = ChatRoom.findOne(this.rid, {
fields: {
t: 1
}
});
<<<<<<<
canView() {
return room.t !== 'd';
=======
canView(room) {
return RocketChat.roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.NAME);
>>>>>>>
canView() {
return RocketChat.roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.NAME);
<<<<<<<
if (!RocketChat.authz.hasAllPermission('edit-room', room._id) || (room.t !== 'c' && room.t !== 'p')) {
return Promise.reject(toastr.error(t('error-not-allowed')));
}
=======
>>>>>>>
<<<<<<<
return call('saveRoomSettings', room._id, 'roomName', value).then(function() {
=======
Meteor.call('saveRoomSettings', room._id, RoomSettingsEnum.NAME, value, function(err) {
if (err) {
return handleError(err);
}
>>>>>>>
return call('saveRoomSettings', room._id, RoomSettingsEnum.NAME, value).then(function() {
<<<<<<<
save(value) {
return call('saveRoomSettings', room._id, 'roomTopic', value).then(function() {
=======
save(value, room) {
return Meteor.call('saveRoomSettings', room._id, RoomSettingsEnum.TOPIC, value, function(err) {
if (err) {
return handleError(err);
}
>>>>>>>
save(value) {
return call('saveRoomSettings', room._id, RoomSettingsEnum.TOPIC, value).then(function() {
<<<<<<<
save(value) {
return call('saveRoomSettings', room._id, 'roomAnnouncement', value).then(() => {
=======
save(value, room) {
return Meteor.call('saveRoomSettings', room._id, RoomSettingsEnum.ANNOUNCEMENT, value, function(err) {
if (err) {
return handleError(err);
}
>>>>>>>
save(value) {
return call('saveRoomSettings', room._id, RoomSettingsEnum.ANNOUNCEMENT, value).then(() => {
<<<<<<<
canView() {
if (['c', 'p'].includes(room.t) === false) {
=======
canView(room) {
if (!['c', 'p'].includes(room.t)) {
>>>>>>>
canView() {
if (!['c', 'p'].includes(room.t)) {
<<<<<<<
return new Promise((resolve, reject)=> {
swal({
title: t('Room_default_change_to_private_will_be_default_no_more'),
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#DD6B55',
confirmButtonText: t('Yes'),
cancelButtonText: t('Cancel'),
closeOnConfirm: true,
html: false
}, function(confirmed) {
if (confirmed) {
return resolve(saveRoomSettings());
}
return reject();
});
=======
modal.open({
title: t('Room_default_change_to_private_will_be_default_no_more'),
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#DD6B55',
confirmButtonText: t('Yes'),
cancelButtonText: t('Cancel'),
closeOnConfirm: true,
html: false
}, function(confirmed) {
if (confirmed) {
return saveRoomSettings();
}
>>>>>>>
return new Promise((resolve, reject)=> {
modal.open({
title: t('Room_default_change_to_private_will_be_default_no_more'),
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#DD6B55',
confirmButtonText: t('Yes'),
cancelButtonText: t('Cancel'),
closeOnConfirm: true,
html: false
}, function(confirmed) {
if (confirmed) {
return resolve(saveRoomSettings());
}
return reject();
});
<<<<<<<
canView() {
return room.t !== 'd';
=======
canView(room) {
return RocketChat.roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.READ_ONLY);
>>>>>>>
canView() {
return RocketChat.roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.READ_ONLY);
<<<<<<<
save(value) {
return call('saveRoomSettings', room._id, 'readOnly', value).then(() => toastr.success(TAPi18n.__('Read_only_changed_successfully')));
=======
save(value, room) {
this.processing.set(true);
return Meteor.call('saveRoomSettings', room._id, RoomSettingsEnum.READ_ONLY, value, (err) => {
if (err) {
return handleError(err);
}
this.processing.set(false);
return toastr.success(TAPi18n.__('Read_only_changed_successfully'));
});
>>>>>>>
save(value) {
return call('saveRoomSettings', room._id, RoomSettingsEnum.READ_ONLY, value).then(() => toastr.success(TAPi18n.__('Read_only_changed_successfully')));
<<<<<<<
canView: () => {
return this.settings.t.value && this.settings.t.value.get() !== 'd' && this.settings.ro.value.get();
=======
canView(room) {
return RocketChat.roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.REACT_WHEN_READ_ONLY) && room.ro;
>>>>>>>
canView() {
return RocketChat.roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.REACT_WHEN_READ_ONLY) && room.ro;
<<<<<<<
save(value) {
return call('saveRoomSettings', room._id, 'reactWhenReadOnly', value).then(() => {
return toastr.success(TAPi18n.__('React_when_read_only_changed_successfully'));
=======
save(value, room) {
this.processing.set(true);
Meteor.call('saveRoomSettings', room._id, 'reactWhenReadOnly', value, (err) => {
if (err) {
return handleError(err);
}
this.processing.set(false);
toastr.success(TAPi18n.__('React_when_read_only_changed_successfully'));
>>>>>>>
save(value) {
return call('saveRoomSettings', room._id, 'reactWhenReadOnly', value).then(() => {
toastr.success(TAPi18n.__('React_when_read_only_changed_successfully'));
<<<<<<<
canView: () => {
return this.settings.t.value && this.settings.t.value.get() !== 'd';
=======
canView(room) {
return RocketChat.roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.ARCHIVE_OR_UNARCHIVE);
>>>>>>>
canView() {
return RocketChat.roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.ARCHIVE_OR_UNARCHIVE);
<<<<<<<
save(value) {
return new Promise((resolve, reject)=>{
swal({
title: t('Are_you_sure'),
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#DD6B55',
confirmButtonText: value ? t('Yes_archive_it') : t('Yes_unarchive_it'),
cancelButtonText: t('Cancel'),
closeOnConfirm: false,
html: false
}, function(confirmed) {
swal.disableButtons();
if (confirmed) {
const action = value ? 'archiveRoom' : 'unarchiveRoom';
return resolve(call(action, room._id).then(() => {
swal({
title: value ? t('Room_archived') : t('Room_has_been_archived'),
text: value ? t('Room_has_been_archived') : t('Room_has_been_unarchived'),
type: 'success',
timer: 2000,
showConfirmButton: false
});
return RocketChat.callbacks.run(action, room);
}, () => swal.enableButtons()));
}
return reject();
});
=======
save(value, room) {
modal.open({
title: t('Are_you_sure'),
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#DD6B55',
confirmButtonText: value ? t('Yes_archive_it') : t('Yes_unarchive_it'),
cancelButtonText: t('Cancel'),
closeOnConfirm: false,
html: false
}, function(confirmed) {
if (confirmed) {
const action = value ? 'archiveRoom' : 'unarchiveRoom';
Meteor.call(action, room._id, function(err) {
if (err) {
handleError(err);
}
modal.open({
title: value ? t('Room_archived') : t('Room_has_been_archived'),
text: value ? t('Room_has_been_archived') : t('Room_has_been_unarchived'),
type: 'success',
timer: 2000,
showConfirmButton: false
});
RocketChat.callbacks.run(action, room);
});
} else {
return $('.channel-settings form [name=\'archived\']').prop('checked', !!room.archived);
}
>>>>>>>
save(value) {
return new Promise((resolve, reject)=>{
modal.open({
title: t('Are_you_sure'),
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#DD6B55',
confirmButtonText: value ? t('Yes_archive_it') : t('Yes_unarchive_it'),
cancelButtonText: t('Cancel'),
closeOnConfirm: false,
html: false
}, function(confirmed) {
if (confirmed) {
const action = value ? 'archiveRoom' : 'unarchiveRoom';
return resolve(call(action, room._id).then(() => {
modal.open({
title: value ? t('Room_archived') : t('Room_has_been_archived'),
text: value ? t('Room_has_been_archived') : t('Room_has_been_unarchived'),
type: 'success',
timer: 2000,
showConfirmButton: false
});
return RocketChat.callbacks.run(action, room);
}));
}
return reject();
});
<<<<<<<
canView:() => {
return this.setting.t.value && this.setting.t.value.get() === 'c' && RocketChat.authz.hasAllPermission('edit-room', room._id);
=======
canView(room) {
return RocketChat.roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.JOIN_CODE) && RocketChat.authz.hasAllPermission('edit-room', room._id);
>>>>>>>
canView() {
return RocketChat.roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.JOIN_CODE) && RocketChat.authz.hasAllPermission('edit-room', room._id);
<<<<<<<
save(value) {
return call('saveRoomSettings', room._id, 'joinCode', value).then(function() {
=======
save(value, room) {
Meteor.call('saveRoomSettings', room._id, 'joinCode', value, function(err) {
if (err) {
return handleError(err);
}
>>>>>>>
save(value) {
return call('saveRoomSettings', room._id, 'joinCode', value).then(function() {
<<<<<<<
Object.keys(this.settings).forEach(key => {
const setting = this.settings[key];
const def =setting.getValue ? setting.getValue(this.room): this.room[key];
setting.default = new ReactiveVar(def || false);
setting.value = new ReactiveVar(def || false);
});
});
Template.channelSettingsEditing.helpers({
...can,
value() {
return this.value.get();
},
default() {
return this.default.get();
},
disabled() {
return !this.canEdit();
},
checked() {
return this.value.get();// ? '' : 'checked';
},
modified(text = '') {
const {settings} = Template.instance();
return !Object.keys(settings).some(key => settings[key].default.get() !== settings[key].value.get()) ? text : '';
},
equal(text = '', text2 = '', ret = '*') {
return text === text2 ? '' : ret;
},
getIcon(room) {
const roomType = RocketChat.models.Rooms.findOne(room._id).t;
switch (roomType) {
case 'd':
return 'at';
case 'p':
return 'lock';
case 'c':
return 'hashtag';
case 'l':
return 'livechat';
default :
return null;
=======
this.saveSetting = () => {
const room = ChatRoom.findOne(this.data && this.data.rid);
const field = this.editing.get();
let value;
if (!this.settings[field]) {
return;
}
if (this.settings[field].type === 'select') {
value = this.$(`.channel-settings form [name=${ field }]:checked`).val();
} else if (this.settings[field].type === 'boolean') {
value = this.$(`.channel-settings form [name=${ field }]`).is(':checked');
} else {
value = this.$(`.channel-settings form [name=${ field }]`).val();
>>>>>>>
Object.keys(this.settings).forEach(key => {
const setting = this.settings[key];
const def =setting.getValue ? setting.getValue(this.room): this.room[key];
setting.default = new ReactiveVar(def || false);
setting.value = new ReactiveVar(def || false);
});
});
Template.channelSettingsEditing.helpers({
...can,
value() {
return this.value.get();
},
default() {
return this.default.get();
},
disabled() {
return !this.canEdit();
},
checked() {
return this.value.get();// ? '' : 'checked';
},
modified(text = '') {
const {settings} = Template.instance();
return !Object.keys(settings).some(key => settings[key].default.get() !== settings[key].value.get()) ? text : '';
},
equal(text = '', text2 = '', ret = '*') {
return text === text2 ? '' : ret;
},
getIcon(room) {
const roomType = RocketChat.models.Rooms.findOne(room._id).t;
switch (roomType) {
case 'd':
return 'at';
case 'p':
return 'lock';
case 'c':
return 'hashtag';
case 'l':
return 'livechat';
default :
return null; |
<<<<<<<
=======
import _ from 'underscore';
const hideMessagesOfType = [];
RocketChat.settings.get(/Message_HideType_.+/, function(key, value) {
const type = key.replace('Message_HideType_', '');
const types = type === 'mute_unmute' ? ['user-muted', 'user-unmuted'] : [type];
return types.forEach((type) => {
const index = hideMessagesOfType.indexOf(type);
if (value === true && index === -1) {
return hideMessagesOfType.push(type);
}
if (index > -1) {
return hideMessagesOfType.splice(index, 1);
}
});
});
>>>>>>>
const hideMessagesOfType = [];
RocketChat.settings.get(/Message_HideType_.+/, function(key, value) {
const type = key.replace('Message_HideType_', '');
const types = type === 'mute_unmute' ? ['user-muted', 'user-unmuted'] : [type];
return types.forEach((type) => {
const index = hideMessagesOfType.indexOf(type);
if (value === true && index === -1) {
return hideMessagesOfType.push(type);
}
if (index > -1) {
return hideMessagesOfType.splice(index, 1);
}
});
}); |
<<<<<<<
it('should trigger a protocol:joinChannel hook', done => {
=======
it('should trigger a proxy:joinChannel hook', function (done) {
>>>>>>>
it('should trigger a proxy:joinChannel hook', done => {
<<<<<<<
kuzzle.once('protocol:joinChannel', (data) => {
=======
this.timeout(50);
kuzzle.once('proxy:joinChannel', (data) => {
>>>>>>>
kuzzle.once('proxy:joinChannel', (data) => { |
<<<<<<<
/* eslint-disable */
=======
import moment from 'moment';
>>>>>>>
/* eslint-disable */
import moment from 'moment'; |
<<<<<<<
=======
isTranslated() {
const sub = ChatSubscription.findOne({ rid: this._id }, { fields: { autoTranslate: 1, autoTranslateLanguage: 1 } });
RocketChat.settings.get('AutoTranslate_Enabled') && ((sub != null ? sub.autoTranslate : undefined) === true) && (sub.autoTranslateLanguage != null);
},
>>>>>>>
isTranslated() {
const sub = ChatSubscription.findOne({ rid: this._id }, { fields: { autoTranslate: 1, autoTranslateLanguage: 1 } });
RocketChat.settings.get('AutoTranslate_Enabled') && ((sub != null ? sub.autoTranslate : undefined) === true) && (sub.autoTranslateLanguage != null);
},
<<<<<<<
let context = $(e.target).parents('.message').data('context');
if (!context) {
context = 'message';
}
const [, message] = this._arguments;
const allItems = RocketChat.MessageAction.getButtons(message, context, 'menu').map(item => {
return {
icon: item.icon,
name: t(item.label),
type: 'message-action',
id: item.id,
modifier: item.color
};
});
const [items, deleteItem] = allItems.reduce((result, value) => (result[value.id === 'delete-message' ? 1 : 0].push(value), result), [[], []]);
const groups = [{ items }];
if (deleteItem.length) {
groups.push({ items: deleteItem });
}
const config = {
columns: [
{
groups
}
],
instance: i,
data: this,
mousePosition: {
x: e.clientX,
y: e.clientY
},
activeElement: $(e.currentTarget).parents('.message')[0],
onRendered: () => new Clipboard('.rc-popover__item')
};
popover.open(config);
=======
mountPopover(e, i, this);
>>>>>>>
let context = $(e.target).parents('.message').data('context');
if (!context) {
context = 'message';
}
const [, message] = this._arguments;
const allItems = RocketChat.MessageAction.getButtons(message, context, 'menu').map(item => {
return {
icon: item.icon,
name: t(item.label),
type: 'message-action',
id: item.id,
modifier: item.color
};
});
const [items, deleteItem] = allItems.reduce((result, value) => (result[value.id === 'delete-message' ? 1 : 0].push(value), result), [[], []]);
const groups = [{ items }];
if (deleteItem.length) {
groups.push({ items: deleteItem });
}
const config = {
columns: [
{
groups
}
],
instance: i,
data: this,
mousePosition: {
x: e.clientX,
y: e.clientY
},
activeElement: $(e.currentTarget).parents('.message')[0],
onRendered: () => new Clipboard('.rc-popover__item')
};
popover.open(config);
<<<<<<<
Tracker.autorun(function() {
const subRoom = ChatSubscription.findOne({rid:template.data._id});
if (!subRoom) {
FlowRouter.go('home');
}
});
=======
Tracker.autorun(function() {
const room = RocketChat.models.Rooms.findOne({ _id: template.data._id });
if (!room) {
FlowRouter.go('home');
}
});
>>>>>>>
Tracker.autorun(function() {
const room = RocketChat.models.Rooms.findOne({ _id: template.data._id });
if (!room) {
FlowRouter.go('home');
}
}); |
<<<<<<<
const directMessageAllow = RocketChat.settings.get('FileUpload_Enabled_Direct');
=======
const fileUploadAllowed = RocketChat.settings.get('FileUpload_Enabled');
>>>>>>>
const directMessageAllow = RocketChat.settings.get('FileUpload_Enabled_Direct');
const fileUploadAllowed = RocketChat.settings.get('FileUpload_Enabled');
<<<<<<<
if (!directMessageAllow && room.t === 'd') {
const reason = TAPi18n.__('File_not_allowed_direct_messages', user.language);
throw new Meteor.Error('error-direct-message-file-upload-not-allowed', reason);
}
if (file.size > maxFileSize) {
const reason = TAPi18n.__('File_exceeds_allowed_size_of_bytes', {
size: filesize(maxFileSize)
}, user.language);
throw new Meteor.Error('error-file-too-large', reason);
=======
if (!fileUploadAllowed) {
const reason = TAPi18n.__('FileUpload_Disabled', user.language);
throw new Meteor.Error('error-file-upload-disabled', reason);
}
if (parseInt(maxFileSize) > 0) {
if (file.size > maxFileSize) {
const reason = TAPi18n.__('File_exceeds_allowed_size_of_bytes', {
size: filesize(maxFileSize)
}, user.language);
throw new Meteor.Error('error-file-too-large', reason);
}
>>>>>>>
if (!fileUploadAllowed) {
const reason = TAPi18n.__('FileUpload_Disabled', user.language);
throw new Meteor.Error('error-file-upload-disabled', reason);
}
if (!directMessageAllow && room.t === 'd') {
const reason = TAPi18n.__('File_not_allowed_direct_messages', user.language);
throw new Meteor.Error('error-direct-message-file-upload-not-allowed', reason);
}
if (file.size > maxFileSize) {
const reason = TAPi18n.__('File_exceeds_allowed_size_of_bytes', {
size: filesize(maxFileSize)
}, user.language);
throw new Meteor.Error('error-file-too-large', reason);
}
if (parseInt(maxFileSize) > 0) {
if (file.size > maxFileSize) {
const reason = TAPi18n.__('File_exceeds_allowed_size_of_bytes', {
size: filesize(maxFileSize)
}, user.language);
throw new Meteor.Error('error-file-too-large', reason);
} |
<<<<<<<
/* globals chatMessages, fileUpload , fireGlobalEvent , mobileMessageMenu , cordova , readMessage , RoomRoles, popover */
import { RocketChatTabBar } from 'meteor/rocketchat:lib';
=======
/* globals RocketChatTabBar , chatMessages, fileUpload , fireGlobalEvent , cordova , readMessage , RoomRoles, popover , device */
>>>>>>>
/* globals chatMessages, fileUpload , fireGlobalEvent , cordova , readMessage , RoomRoles, popover , device */
import { RocketChatTabBar } from 'meteor/rocketchat:lib'; |
<<<<<<<
api.addFiles('server/methods/insertOrUpdateUser.coffee', 'server');
=======
api.addFiles('server/methods/setEmail.js', 'server');
api.addFiles('server/methods/updateUser.coffee', 'server');
>>>>>>>
api.addFiles('server/methods/insertOrUpdateUser.coffee', 'server');
api.addFiles('server/methods/setEmail.js', 'server'); |
<<<<<<<
isNotification: false,
isRecent: false,
isTopic: false,
isList: false,
isPost: false,
hostUrl: window.location.href,
searchText: "",
routeText: ""
=======
isNotification: false,
isRecent: false,
isTopic: false,
isList: false,
ifLogin: true,
hostUrl: window.location.href,
searchText: "",
routeText: ""
>>>>>>>
isNotification: false,
isRecent: false,
isTopic: false,
isList: false,
isPost: false,
ifLogin: true,
hostUrl: window.location.href,
searchText: "",
routeText: ""
<<<<<<<
// 判断是否在话题页
if (pageUrl['hostUrl'].indexOf('/t/') != -1) {
pageUrl['isPost'] = true;
pageUrl['routeText'] = pageUrl['hostUrl'].split('/').pop();
}
=======
// 判断是否登陆
pageUrl['ifLogin'] = ($('#Top').find('.top').length != 3);
pageUrl['isList'] = pageUrl['isIndex'] || pageUrl['isRecent'] || pageUrl['isTopic'];
>>>>>>>
// 判断是否在话题页
if (pageUrl['hostUrl'].indexOf('/t/') != -1) {
pageUrl['isPost'] = true;
pageUrl['routeText'] = pageUrl['hostUrl'].split('/').pop();
}
// 判断是否登陆
pageUrl['ifLogin'] = ($('#Top').find('.top').length != 3);
<<<<<<<
return(<a href={href} title="新主题">
<i className="fa fa-pencil-square-o fa-2x"></i>
<span>新主题</span>
</a>)
},
tabbar : function () {
var doms = [];
var list = {
all:"全部",
tech:"技术",
creative:"创意",
play:"好玩",
apple:"Apple",
jobs:"酷工作",
deals:"交易",
city:"城市",
qna:"问与答",
hot:"最热",
r2:"R2",
nodes:"节点",
members:"关注"
}
for(value in list){
if(this.props.pageUrl['searchText'] == value){
doms.push(<a href={"/?tab="+value} className="k_tabbar_current">{list[value]}</a>)
}else{
doms.push(<a href={"/?tab="+value} >{list[value]}</a>)
}
}
return doms
=======
return(<a href={href} title="新主题">
<i className="fa fa-pencil-square-o fa-2x"></i>
<span>新主题</span>
</a>)
>>>>>>>
return(<a href={href} title="新主题">
<i className="fa fa-pencil-square-o fa-2x"></i>
<span>新主题</span>
</a>)
},
tabbar : function () {
var doms = [];
var list = {
all:"全部",
tech:"技术",
creative:"创意",
play:"好玩",
apple:"Apple",
jobs:"酷工作",
deals:"交易",
city:"城市",
qna:"问与答",
hot:"最热",
r2:"R2",
nodes:"节点",
members:"关注"
}
for(value in list){
if(this.props.pageUrl['searchText'] == value){
doms.push(<a href={"/?tab="+value} className="k_tabbar_current">{list[value]}</a>)
}else{
doms.push(<a href={"/?tab="+value} >{list[value]}</a>)
}
}
return doms
<<<<<<<
<i className="fa fa-bell fa-2x"></i>
<span>提醒</span>
=======
<i className="fa fa-bell fa-2x" ></i>
<span>提醒</span>
>>>>>>>
<i className="fa fa-bell fa-2x"></i>
<span>提醒</span>
<<<<<<<
<i className="fa fa-sign-out fa-2x" ></i>
<span>退出</span>
=======
<i className="fa fa-sign-out fa-2x" ></i>
<span>退出</span>
</a>
</div>
)
} else {
return(
<div id="k_navbar">
<a href="/" title="首页">
<i className="fa fa-home fa-2x"></i>
<span>首页</span>
</a>
<a href="/signup" title="注册">
<i className="fa fa-user fa-2x"></i>
<span>注册</span>
</a>
<a href="/signin" title="登陆">
<i className="fa fa-sign-in fa-2x"></i>
<span>登陆</span>
>>>>>>>
<i className="fa fa-sign-out fa-2x" ></i>
<span>退出</span>
</a>
</div>
)
} else {
return(
<div id="k_navbar">
<a href="/" title="首页">
<i className="fa fa-home fa-2x"></i>
<span>首页</span>
</a>
<a href="/signup" title="注册">
<i className="fa fa-user fa-2x"></i>
<span>注册</span>
</a>
<a href="/signin" title="登陆">
<i className="fa fa-sign-in fa-2x"></i>
<span>登陆</span>
<<<<<<<
var width = $(window).width() - 140 - 680 - 20 - 48 - 20 - 10 - 10 - 25 - 23 - 5;
=======
var width = $(window).width() - 140 - 680 - 20 - 48 - 20 - 10 - 10 - 25 - 23;
>>>>>>>
var width = $(window).width() - 140 - 680 - 20 - 48 - 20 - 10 - 10 - 25 - 23 - 5;
<<<<<<<
if (self != top) {
=======
//先判断是否为ifame,再判断是否为列表
if (self == top) {
if (pageUrl['isList']) {
React.render(
<MainPage ListData={listData} NodeData={nodeData} pageUrl={pageUrl} NodeName = {pageUrl['nodeName']}/>,
document.getElementById('k_main')
);
} else {
$('#k_main').html(mainDom);
}
}else{
>>>>>>>
//先判断是否为ifame,再判断是否为列表
if (self == top) {
if (pageUrl['isList']) {
React.render(
<MainPage ListData={listData} NodeData={nodeData} pageUrl={pageUrl} NodeName = {pageUrl['nodeName']}/>,
document.getElementById('k_main')
);
} else {
$('#k_main').html(mainDom);
}
}else{
<<<<<<<
<FastReader width={'680px'} height={$(window).height()} src={'//www.v2ex.com' + url}/>,
=======
<FastReader width={'680px'} height={$(window).height()} src={'http://www.v2ex.com' + url}/>,
>>>>>>>
<FastReader width={'680px'} height={$(window).height()} src={'//www.v2ex.com' + url}/>,
<<<<<<<
$('.k_itemList_QR').click(function () {
=======
// $('#k_notifiList li').click(function () {
// var url = $(this).children('.k_notifiList_title').attr('href');
// $(this).addClass('k_itemList_choosen');
//
// React.render(
// <FastReader width={'680px'} height={$(window).height()} src={url}/>,
// document.getElementById('k_faster')
// );
//
// $('#Rightbar').width('680px');
// var item_title = $(window).width() - 140 - 680 - 20;
// $('#k_notifiList').css('width', item_title);
// });
$('.k_itemList_QR').click(function () {
>>>>>>>
$('.k_itemList_QR').click(function () { |
<<<<<<<
(function(window, videojs) {
'use strict';
var Playlist = {
/**
* The number of segments that are unsafe to start playback at in
* a live stream. Changing this value can cause playback stalls.
* See HTTP Live Streaming, "Playing the Media Playlist File"
* https://tools.ietf.org/html/draft-pantos-http-live-streaming-18#section-6.3.3
*/
UNSAFE_LIVE_SEGMENTS: 3
};
var duration, intervalDuration, backwardDuration, forwardDuration, seekable;
backwardDuration = function(playlist, endSequence) {
var result = 0, segment, i;
i = endSequence - playlist.mediaSequence;
// if a start time is available for segment immediately following
// the interval, use it
=======
import {createTimeRange} from 'video.js';
const backwardDuration = function(playlist, endSequence) {
let result = 0;
let i = endSequence - playlist.mediaSequence;
// if a start time is available for segment immediately following
// the interval, use it
let segment = playlist.segments[i];
// Walk backward until we find the latest segment with timeline
// information that is earlier than endSequence
if (segment) {
if (typeof segment.start !== 'undefined') {
return { result: segment.start, precise: true };
}
if (typeof segment.end !== 'undefined') {
return {
result: segment.end - segment.duration,
precise: true
};
}
}
while (i--) {
>>>>>>>
import {createTimeRange} from 'video.js';
let Playlist = {
/**
* The number of segments that are unsafe to start playback at in
* a live stream. Changing this value can cause playback stalls.
* See HTTP Live Streaming, "Playing the Media Playlist File"
* https://tools.ietf.org/html/draft-pantos-http-live-streaming-18#section-6.3.3
*/
UNSAFE_LIVE_SEGMENTS: 3
};
const backwardDuration = function(playlist, endSequence) {
let result = 0;
let i = endSequence - playlist.mediaSequence;
// if a start time is available for segment immediately following
// the interval, use it
let segment = playlist.segments[i];
// Walk backward until we find the latest segment with timeline
// information that is earlier than endSequence
if (segment) {
if (typeof segment.start !== 'undefined') {
return { result: segment.start, precise: true };
}
if (typeof segment.end !== 'undefined') {
return {
result: segment.end - segment.duration,
precise: true
};
}
}
while (i--) {
<<<<<<<
// live playlists should not expose three segment durations worth
// of content from the end of the playlist
// https://tools.ietf.org/html/draft-pantos-http-live-streaming-16#section-6.3.3
start = intervalDuration(playlist, playlist.mediaSequence);
end = intervalDuration(playlist,
playlist.mediaSequence +
Math.max(0, playlist.segments.length - Playlist.UNSAFE_LIVE_SEGMENTS));
return videojs.createTimeRange(start, end);
};
// exports
Playlist.duration = duration;
Playlist.seekable = seekable;
videojs.Hls.Playlist = Playlist;
})(window, window.videojs);
=======
// calculate the total duration based on the segment durations
return intervalDuration(playlist,
endSequence,
includeTrailingTime);
};
/**
* Calculates the interval of time that is currently seekable in a
* playlist. The returned time ranges are relative to the earliest
* moment in the specified playlist that is still available. A full
* seekable implementation for live streams would need to offset
* these values by the duration of content that has expired from the
* stream.
* @param playlist {object} a media playlist object
* @return {TimeRanges} the periods of time that are valid targets
* for seeking
*/
export const seekable = function(playlist) {
let start;
let end;
// without segments, there are no seekable ranges
if (!playlist.segments) {
return createTimeRange();
}
// when the playlist is complete, the entire duration is seekable
if (playlist.endList) {
return createTimeRange(0, duration(playlist));
}
// live playlists should not expose three segment durations worth
// of content from the end of the playlist
// https://tools.ietf.org/html/draft-pantos-http-live-streaming-16#section-6.3.3
start = intervalDuration(playlist, playlist.mediaSequence);
end = intervalDuration(playlist,
playlist.mediaSequence +
Math.max(0, playlist.segments.length - 3));
return createTimeRange(start, end);
};
// exports
export default {
duration,
seekable
};
>>>>>>>
// calculate the total duration based on the segment durations
return intervalDuration(playlist,
endSequence,
includeTrailingTime);
};
/**
* Calculates the interval of time that is currently seekable in a
* playlist. The returned time ranges are relative to the earliest
* moment in the specified playlist that is still available. A full
* seekable implementation for live streams would need to offset
* these values by the duration of content that has expired from the
* stream.
* @param playlist {object} a media playlist object
* @return {TimeRanges} the periods of time that are valid targets
* for seeking
*/
export const seekable = function(playlist) {
let start;
let end;
// without segments, there are no seekable ranges
if (!playlist.segments) {
return createTimeRange();
}
// when the playlist is complete, the entire duration is seekable
if (playlist.endList) {
return createTimeRange(0, duration(playlist));
}
// live playlists should not expose three segment durations worth
// of content from the end of the playlist
// https://tools.ietf.org/html/draft-pantos-http-live-streaming-16#section-6.3.3
start = intervalDuration(playlist, playlist.mediaSequence);
end = intervalDuration(playlist,
playlist.mediaSequence +
Math.max(0, playlist.segments.length - Playlist.UNSAFE_LIVE_SEGMENTS));
return createTimeRange(start, end);
};
Playlist.duration = duration;
Playlist.seekable = seekable;
// exports
export default Playlist; |
<<<<<<<
=======
app.put(
'/api/users/myself/password',
passport.authenticate('local'),
function(req, res) {
var password = req.param('newPassword');
var passwordconfirm = req.param('newPasswordconfirm');
if (password && passwordconfirm) {
if (password !== passwordconfirm) {
return res.status(400).send('passwords do not match');
}
if (password.length < passwordLength) {
return res.status(400).send('password does not meet minimum length requirment of ' + passwordLength + ' characters');
}
req.user.authentication.password = password;
req.user.authentication.forcePasswordReset = false;
new api.User().update(req.user, function(err, updatedUser) {
updatedUser = userTransformer.transform(updatedUser, {path: req.getRoot()});
res.json(updatedUser);
});
} else {
return res.status(400).send('newPassword and newPasswordconfirm are required');
}
}
);
// Create a new device
// Any authenticated user can create a new device, the registered field
// will be set to false.
app.post(
'/api/devices',
passport.authenticate('local'),
function(req, res) {
var newDevice = {
uid: req.param('uid'),
name: req.param('name'),
registered: false,
description: req.param('description'),
userId: req.user.id
};
if (!newDevice.uid) return res.send(401, "missing required param 'uid'");
Device.getDeviceByUid(newDevice.uid, function(err, device) {
if (device) {
// already exists, do not register
return res.json(device);
}
Device.createDevice(newDevice, function(err, newDevice) {
if (err) {
return res.status(400);
}
res.json(newDevice);
});
});
}
);
>>>>>>> |
<<<<<<<
function MapController($rootScope, $scope, $log, $http, $compile, ObservationService, appConstants, mageLib, UserService, DataService, MapService, Layer, LocationService, Location, CreateLocation, TimerService, Feature, TimeBucketService) {
=======
function MapController($rootScope, $scope, $log, $http, ObservationService, FilterService, FeatureTypeService, appConstants, mageLib, IconService, UserService, DataService, MapService, Layer, LocationService, Location, CreateLocation, TimerService, Feature, TimeBucketService) {
>>>>>>>
function MapController($rootScope, $scope, $log, $http, $compile, ObservationService, appConstants, mageLib, UserService, DataService, MapService, Layer, LocationService, FilterService, Location, CreateLocation, TimerService, Feature, TimeBucketService) {
<<<<<<<
=======
>>>>>>> |
<<<<<<<
, async = require('async')
, moment = require('moment')
, access = require('../access')
, environment = require('environment');
=======
, config = require('../config.js');
>>>>>>>
, environment = require('environment'); |
<<<<<<<
"import/" : "showImport",
=======
>>>>>>>
"import/" : "showImport",
<<<<<<<
$('#import').hide();
=======
$('#new_data_list').hide();
},
/**
* Displays a page where the user can make their own modified datalist specified by the given
* corpusName and the given datumId.
*
* @param {String}
* corpusName The name of the corpus this datum is from.
* @param {Number}
* sessionId The ID of the session within the corpus.
*/
newFullscreenDataList : function(corpusName) {
Utils.debug("In newFullscreenDataList: " + corpusName);
$("#dashboard-view").show();
$("#new-session-view").hide();
$("#fullscreen-datum-view").hide();
$("#fullscreen-datalist-view").hide();
$("#fullscreen-datalist-view").hide();
$('#new_data_list').show();
$("#fullscreen-search-view").hide();
$("#fullscreen-user-profile-view").hide();
$("#user-preferences-view").hide();
$("#datum-preferences-view").hide();
>>>>>>>
$('#import').hide();
$('#new_data_list').hide();
},
/**
* Displays a page where the user can make their own modified datalist specified by the given
* corpusName and the given datumId.
*
* @param {String}
* corpusName The name of the corpus this datum is from.
* @param {Number}
* sessionId The ID of the session within the corpus.
*/
newFullscreenDataList : function(corpusName) {
Utils.debug("In newFullscreenDataList: " + corpusName);
$("#dashboard-view").show();
$("#new-session-view").hide();
$("#fullscreen-datum-view").hide();
$("#fullscreen-datalist-view").hide();
$("#fullscreen-datalist-view").hide();
$('#new_data_list').show();
$("#fullscreen-search-view").hide();
$("#fullscreen-user-profile-view").hide();
$("#user-preferences-view").hide();
$("#datum-preferences-view").hide();
<<<<<<<
$('#import').hide();
=======
$('#new_data_list').hide();
>>>>>>>
$('#import').hide();
<<<<<<<
$('#import').hide();
=======
$('#new_data_list').hide();
},
>>>>>>>
$('#import').hide();
<<<<<<<
$('#import').hide();
=======
$('#new_data_list').hide();
>>>>>>>
$('#import').hide();
<<<<<<<
$('#import').hide();
=======
$('#new_data_list').hide();
$("#corpus").show();
$("#activity_feed").show();
>>>>>>>
$('#import').hide();
<<<<<<<
$('#import').hide();
=======
$('#new_data_list').hide();
>>>>>>>
$('#import').hide();
<<<<<<<
$('#import').hide();
=======
$('#new_data_list').hide();
>>>>>>>
$('#import').hide();
<<<<<<<
$('#import').hide();
=======
$('#new_data_list').hide();
>>>>>>>
$('#import').hide(); |
<<<<<<<
this.When(/^I write the document ?(?:"([^"]*)")?(?: in index "([^"]*)")?$/, function (documentName, index, callback) {
=======
this.When(/^I publish a message$/, function (callback) {
this.api.publish(this.documentGrace)
.then(function (body) {
if (body.error) {
callback(new Error(body.error.message));
return false;
}
if (!body.result) {
callback(new Error('No result provided'));
return false;
}
this.result = body.result;
callback();
}.bind(this))
.catch(function (error) {
callback(error);
});
});
this.When(/^I write the document ?(?:"([^"]*)")?$/, function (documentName, callback) {
>>>>>>>
this.When(/^I publish a message$/, function (callback) {
this.api.publish(this.documentGrace)
.then(function (body) {
if (body.error) {
callback(new Error(body.error.message));
return false;
}
if (!body.result) {
callback(new Error('No result provided'));
return false;
}
this.result = body.result;
callback();
}.bind(this))
.catch(function (error) {
callback(error);
});
});
this.When(/^I write the document ?(?:"([^"]*)")?(?: in index "([^"]*)")?$/, function (documentName, index, callback) {
<<<<<<<
this.api.create(document, true, index)
=======
this.api.create(document)
>>>>>>>
this.api.create(document, index) |
<<<<<<<
=======
/**
* Events that the InsertUnicode is listening to and their handlers.
*/
events : {
},
>>>>>>>
<<<<<<<
/**
* Change the model's state.
*/
// updateUnicode : function() {
// Utils.debug("Updated unicode to " + this.$el.children(".insert-unicode-input").val());
// this.model.set("insertUnicode", this.$el.children(".insert-unicode-input").val());
// },
=======
>>>>>>> |
<<<<<<<
$(this.el).html(this.templateLink(this.model.toJSON()));
=======
var jsonToRender = {
_id : this.model.get("_id"),
goal : this.model.get("sessionFields").where({label: "goal"})[0].get("value"),
consultants : this.model.get("sessionFields").where({label: "consultants"})[0].get("value"),
dateElicited : this.model.get("sessionFields").where({label: "dateElicited"})[0].get("value")
};
$(this.el).html(this.templateLink(jsonToRender));
>>>>>>>
$(this.el).html(this.templateLink(this.model.toJSON()));
var jsonToRender = {
_id : this.model.get("_id"),
goal : this.model.get("sessionFields").where({label: "goal"})[0].get("value"),
consultants : this.model.get("sessionFields").where({label: "consultants"})[0].get("value"),
dateElicited : this.model.get("sessionFields").where({label: "dateElicited"})[0].get("value")
};
$(this.el).html(this.templateLink(jsonToRender)); |
<<<<<<<
"hotkey/HotKey",
"hotkey/HotKeyConfigView",
"export/Export",
"export/ExportView",
=======
>>>>>>>
"hotkey/HotKey",
"hotkey/HotKeyConfigView",
"export/Export",
"export/ExportView",
<<<<<<<
UserProfileView,
HotKey,
HotKeyConfigView,
Export,
ExportView
=======
UserProfileView
>>>>>>>
UserProfileView,
HotKey,
HotKeyConfigView,
Export,
ExportView,
UserProfileView
<<<<<<<
"corpus/:corpusName" : "showDashboard",
"corpus/:corpusName/export" : "showExport",
=======
>>>>>>>
"corpus/:corpusName" : "showDashboard",
"corpus/:corpusName/export" : "showExport",
<<<<<<<
$('#new_data_list').hide();
$('#export-view').hide();
=======
$('#import').hide();
>>>>>>>
$('#new_data_list').hide();
$('#export-view').hide();
$('#import').hide();
<<<<<<<
// Display the fullscreen datum view and hide all the other views
$("#dashboard-view").show();
$("#fullscreen-datum-view").show();
$("#fullscreen-datalist-view").hide();
$("#fullscreen-search-view").hide();
$("#fullscreen-user-profile-view").hide();
$("#new-session-view").hide();
$("#user-preferences-view").hide();
$("#datum-preferences-view").hide();
$("#hotkey-config-view").hide();
$('#new_data_list').hide();
$('#export-view').hide();
=======
>>>>>>>
// Display the fullscreen datum view and hide all the other views
$("#dashboard-view").show();
$("#fullscreen-datum-view").show();
$("#new-session-view").hide();
$("#fullscreen-datalist-view").hide();
$('#new_data_list').hide();
$("#fullscreen-search-view").hide();
$("#fullscreen-user-profile-view").hide();
$("#user-preferences-view").hide();
$("#datum-preferences-view").hide();
$("#hotkey-config-view").hide();
$('#new_data_list').hide();
$('#export-view').hide();
$('#import').hide();
},
error : function() {
Utils.debug("Datum does not exist: " + datumId);
// Create a new Datum and render it
appView.fullScreenDatumView.model = new Datum();
appView.fullScreenDatumView.render();
// Display the fullscreen datum view and hide all the other views
$("#dashboard-view").show();
$("#fullscreen-datum-view").show();
$("#fullscreen-datalist-view").hide();
$("#fullscreen-search-view").hide();
$("#fullscreen-user-profile-view").hide();
$("#new-session-view").hide();
$("#user-preferences-view").hide();
$("#datum-preferences-view").hide();
$("#hotkey-config-view").hide();
$('#new_data_list').hide();
$('#export-view').hide();
<<<<<<<
$('#new_data_list').hide();
$('#export-view').hide();
},
=======
$('#import').hide();
>>>>>>>
$('#new_data_list').hide();
$('#export-view').hide();
$('#import').hide();
<<<<<<<
$('#new_data_list').hide();
$('#export-view').hide();
=======
$('#import').hide();
>>>>>>>
$('#new_data_list').hide();
$('#export-view').hide();
$('#import').hide();
<<<<<<<
$('#new_data_list').hide();
$("#corpus").show();
$("#activity_feed").show();
$('#export-view').hide();
=======
$('#import').hide();
>>>>>>>
$('#new_data_list').hide();
$("#corpus").show();
$("#activity_feed").show();
$('#export-view').hide();
$('#import').hide();
<<<<<<<
$('#new_data_list').hide();
$('#export-view').hide();
=======
$('#import').hide();
>>>>>>>
$('#new_data_list').hide();
$('#export-view').hide();
$('#import').hide();
<<<<<<<
$('#new_data_list').hide();
$('#export-view').hide();
=======
$('#import').hide();
>>>>>>>
$('#new_data_list').hide();
$('#export-view').hide();
$('#import').hide();
<<<<<<<
$('#new_data_list').hide();
$('#export-view').hide();
=======
$('#import').hide();
>>>>>>>
$('#new_data_list').hide();
$('#export-view').hide();
$('#import').hide(); |
<<<<<<<
"corpus/" : "newFullscreenCorpus",
"corpus/:corpusName" : "showDashboard",
=======
>>>>>>>
"corpus/" : "newFullscreenCorpus",
"corpus/:corpusName" : "showDashboard",
<<<<<<<
"user/:userName/hotkeyconfig" : "showHotKeyConfig",
=======
"user/:userName/hotkeyconfig" : "showHotKeyConfig",
"import/" : "showImport",
>>>>>>>
"user/:userName/hotkeyconfig" : "showHotKeyConfig",
"import/" : "showImport",
<<<<<<<
$('#new-data-list').hide();
$("#new-corpus").hide();
=======
$('#import').hide();
>>>>>>>
$('#new-data-list').hide();
$("#new-corpus").hide();
$('#import').hide();
<<<<<<<
// Display the fullscreen datum view and hide all the other views
$("#dashboard-view").show();
$("#fullscreen-datum-view").show();
$("#fullscreen-datalist-view").hide();
$("#fullscreen-search-view").hide();
$("#fullscreen-user-profile-view").hide();
$("#new-session-view").hide();
$("#user-preferences-view").hide();
$("#datum-preferences-view").hide();
$("#hotkey-config-view").hide();
$('#new-data-list').hide();
$("#new-corpus").hide(); }
=======
}
>>>>>>>
// Display the fullscreen datum view and hide all the other views
$("#dashboard-view").show();
$("#fullscreen-datum-view").show();
$("#fullscreen-datalist-view").hide();
$("#fullscreen-search-view").hide();
$("#fullscreen-user-profile-view").hide();
$("#new-session-view").hide();
$("#user-preferences-view").hide();
$("#datum-preferences-view").hide();
$("#hotkey-config-view").hide();
$('#new-data-list').hide();
$("#new-corpus").hide();
},
},
<<<<<<<
$('#new-data-list').hide();
$("#corpus").show();
$("#activity_feed").show();
$("#new-corpus").hide();
=======
$('#import').hide();
>>>>>>>
$('#new-data-list').hide();
$("#corpus").show();
$("#activity_feed").show();
$("#new-corpus").hide();
$('#import').hide();
<<<<<<<
$('#new-data-list').hide();
$("#new-corpus").hide();
=======
$('#import').hide();
>>>>>>>
$('#new-data-list').hide();
$("#new-corpus").hide();
$('#import').hide();
<<<<<<<
$('#new-data-list').hide();
$("#new-corpus").hide();
=======
$('#import').hide();
>>>>>>>
$('#new-data-list').hide();
$("#new-corpus").hide();
$('#import').hide();
<<<<<<<
$('#new-data-list').hide();
$("#new-corpus").hide();
=======
$('#import').hide();
>>>>>>>
$('#new-data-list').hide();
$("#new-corpus").hide();
$('#import').hide();
<<<<<<<
$('#new-data-list').hide();
$("#new-corpus").hide();
}
=======
$('#import').hide();
},
showImport : function() {
Utils.debug("In import: ");
$("#dashboard-view").show();
$("#fullscreen-datum-view").hide();
$("#new-session-view").hide();
$("#fullscreen-datalist-view").show();
$('#new_data_list').hide();
$("#fullscreen-search-view").hide();
$("#fullscreen-user-profile-view").hide();
$("#user-preferences-view").hide();
$("#datum-preferences-view").hide();
$("#hotkey-config-view").hide();
$('#import').show();
}
>>>>>>>
$('#new-data-list').hide();
$("#new-corpus").hide();
$('#import').hide();
},
showImport : function() {
Utils.debug("In import: ");
$("#dashboard-view").show();
$("#fullscreen-datum-view").hide();
$("#new-session-view").hide();
$("#fullscreen-datalist-view").show();
$('#new_data_list').hide();
$("#fullscreen-search-view").hide();
$("#fullscreen-user-profile-view").hide();
$("#user-preferences-view").hide();
$("#datum-preferences-view").hide();
$("#hotkey-config-view").hide();
$('#import').show();
}, |
<<<<<<<
"corpus/CorpusEditView",
"corpus/CorpusReadView",
=======
"corpus/CorpusReadFullscreenView",
"corpus/CorpusReadEmbeddedView",
"corpus/NewCorpusView",
>>>>>>>
"corpus/CorpusEditView",
"corpus/CorpusReadView",
<<<<<<<
CorpusEditView,
CorpusReadView,
=======
CorpusReadFullscreenView,
CorpusReadEmbeddedView,
NewCorpusView,
>>>>>>>
CorpusEditView,
CorpusReadView,
<<<<<<<
// Create a CorpusReadView for the Corpus in the App's left well
this.corpusReadView = new CorpusReadView({
=======
// Create a CorpusReadEmbeddedView for the Corpus in the App
this.corpusReadEmbeddedView = new CorpusReadEmbeddedView({
>>>>>>>
// Create a CorpusReadView for the Corpus in the App's left well
this.corpusReadView = new CorpusReadView({
<<<<<<<
this.corpusEditView = new CorpusEditView({
=======
this.corpusReadFullscreenView = new CorpusReadFullscreenView({
>>>>>>>
this.corpusEditView = new CorpusEditView({
<<<<<<<
corpusEditView : CorpusEditView,
=======
newCorpusView : NewCorpusView,
/**
* The CorpusReadFullscreenView is a child of the AppView.
*/
corpusReadFullscreenView : CorpusReadFullscreenView,
>>>>>>>
corpusEditView : CorpusEditView,
<<<<<<<
// Display the CorpusReadView
this.corpusReadView.render();
=======
// Display the CorpusReadEmbeddedView
this.corpusReadEmbeddedView.render();
>>>>>>>
// Display the CorpusReadView
this.corpusReadView.render();
<<<<<<<
//Display DataListEditView
this.dataListEditView.render();
=======
//Display DataListEditView
this.dataListEditView.render();
//Display NewCorpusView
this.newCorpusView.render();
>>>>>>>
//Display DataListEditView
this.dataListEditView.render();
<<<<<<<
this.corpusEditView.render();
=======
this.corpusReadFullscreenView.render();
>>>>>>>
this.corpusEditView.render();
<<<<<<<
=======
>>>>>>> |
<<<<<<<
usertemplate: Handlebars.compile(userTemplate),
=======
user: window.user,
>>>>>>>
usertemplate: Handlebars.compile(userTemplate),
user: window.user,
<<<<<<<
Handlebars.registerPartial("user", this.usertemplate(this.model.toJSON()) );
$(this.el).html(this.template(this.model.toJSON()));
=======
if (window.user == null){
return;
}
var u = new User();
console.log(u);
Handlebars.registerPartial("user", this.usertemplate(u.toJSON()) );
$(this.el).html(this.template(u.toJSON()));
>>>>>>>
Handlebars.registerPartial("user", this.usertemplate(this.model.toJSON()) );
$(this.el).html(this.template(this.model.toJSON()));
if (window.user == null){
return;
}
var u = new User();
console.log(u);
Handlebars.registerPartial("user", this.usertemplate(u.toJSON()) );
$(this.el).html(this.template(u.toJSON())); |
<<<<<<<
/**
* Displays a page where the user can make their own modified datalist specified by the given
* corpusName and the given datumId.
*
* @param {String}
* corpusName The name of the corpus this datum is from.
* @param {Number}
* sessionId The ID of the session within the corpus.
*/
newFullscreenDataList : function(corpusName) {
Utils.debug("In newFullscreenDataList: " + corpusName);
$("#dashboard-view").show();
$("#new-session-view").hide();
$("#fullscreen-datum-view").hide();
$("#fullscreen-datalist-view").hide();
$("#fullscreen-datalist-view").hide();
$("#new-data-list").show();
$("#fullscreen-search-view").hide();
$("#fullscreen-user-profile-view").hide();
$("#user-preferences-view").hide();
$("#datum-preferences-view").hide();
$("#new-corpus").hide();
$('#export-view').hide();
},
=======
>>>>>>>
/**
* Displays a page where the user can make their own modified datalist specified by the given
* corpusName and the given datumId.
*
* @param {String}
* corpusName The name of the corpus this datum is from.
* @param {Number}
* sessionId The ID of the session within the corpus.
*/
newFullscreenDataList : function(corpusName) {
Utils.debug("In newFullscreenDataList: " + corpusName);
$("#dashboard-view").show();
$("#new-session-view").hide();
$("#fullscreen-datum-view").hide();
$("#fullscreen-datalist-view").hide();
$("#fullscreen-datalist-view").hide();
$("#new-data-list").show();
$("#fullscreen-search-view").hide();
$("#fullscreen-user-profile-view").hide();
$("#user-preferences-view").hide();
$("#datum-preferences-view").hide();
$("#new-corpus").hide();
$('#export-view').hide();
},
<<<<<<<
$('#new-data-list').hide();
$("#new-corpus").hide();
=======
>>>>>>>
$('#new-data-list').hide();
$("#new-corpus").hide();
<<<<<<<
$('#new-data-list').hide();
$("#corpus").show();
$("#activity_feed").show();
$("#new-corpus").hide();
=======
>>>>>>>
$('#new-data-list').hide();
$("#corpus").show();
$("#activity_feed").show();
$("#new-corpus").hide();
<<<<<<<
$('#new-data-list').hide();
$("#new-corpus").hide();
=======
>>>>>>>
$('#new-data-list').hide();
$("#new-corpus").hide();
<<<<<<<
$('#new-data-list').hide();
$("#new-corpus").hide();
=======
$('#export-view').hide();
>>>>>>>
$('#new-data-list').hide();
$("#new-corpus").hide();
<<<<<<<
$('#new-data-list').hide();
$("#new-corpus").hide();
=======
>>>>>>>
$('#new-data-list').hide();
$("#new-corpus").hide();
<<<<<<<
$('#new_data_list').hide();
$("#fullscreen-search-view").hide();
$("#fullscreen-user-profile-view").hide();
$("#user-preferences-view").hide();
$("#datum-preferences-view").hide();
$("#hotkey-config-view").hide();
$('#import').show();
=======
>>>>>>> |
<<<<<<<
$("#fullscreen-corpus-view").show();
// $("#welcome-user-view").show();
=======
$("#corpus-read-fullscreen-view").show();
// $("#welcome-user-view").show();
>>>>>>>
$("#corpus-read-fullscreen-view").show();
// $("#welcome-user-view").show();
<<<<<<<
$("#fullscreen-corpus-view").show();
// $("#welcome-user-view").hide();
},
/**
* TODO do we need this to be full screen? why not a pop-up?
* Displays a a page where the user can create a new corpus.
*
* @param {String}
* corpusName The name of the corpus this datum is from.
* @param {Number}
* sessionId The ID of the session within the corpus.
*/
newFullscreenCorpus : function() {
Utils.debug("In newFullscreenCorpus: " );
this.hideEverything();
$("#dashboard-view").show();
$("#new-corpus").show();
=======
$("#corpus-read-fullscreen-view").show();
// $("#welcome-user-view").hide();
>>>>>>>
$("#corpus-read-fullscreen-view").show();
<<<<<<<
$("#fullscreen-corpus-view").hide();
$("#terminal-modal").hide();
$("#welcome-user-view").hide();
=======
$("#corpus-read-fullscreen-view").hide();
>>>>>>>
$("#terminal-modal").hide();
$("#corpus-read-fullscreen-view").hide(); |
<<<<<<<
this.advancedSearchSessionView.el = this.$('.advanced_search_session');
this.advancedSearchSessionView.render();
} else if (this.format == "top") {
// Display the SearchView
this.setElement($("#search-top"));
$(this.el).html(this.topTemplate(this.model.toJSON()));
}
//localization
$(".locale_Advanced_Search").html(chrome.i18n.getMessage("locale_Advanced_Search"));
$(".locale_AND").html(chrome.i18n.getMessage("locale_AND"));
$(".locale_OR").html(chrome.i18n.getMessage("locale_OR"));
=======
// this.setElement($("#search-top"));
$("#search-top").html(this.topTemplate(this.model.toJSON()));
>>>>>>>
this.setElement($("#search-top"));
$("#search-top").html(this.topTemplate(this.model.toJSON()));
//localization
$(".locale_Advanced_Search").html(chrome.i18n.getMessage("locale_Advanced_Search"));
$(".locale_AND").html(chrome.i18n.getMessage("locale_AND"));
$(".locale_OR").html(chrome.i18n.getMessage("locale_OR")); |
<<<<<<<
"click .btn-save-session" : "updatePouch",
=======
//Add button inserts new Comment
"click .add_comment" : 'insertNewComment',
"click #btn-save-session" : "updatePouch",
>>>>>>>
"click .btn-save-session" : "updatePouch",
//Add button inserts new Comment
"click .add_comment" : 'insertNewComment', |
<<<<<<<
"informant/Informant",
"user/User",
], function(Informant,User) {
=======
"informant/Informant",
"user/User"
], function(Informant,User) {
>>>>>>>
"informant/Informant",
"user/User",
"informant/Informant",
"user/User"
], function(Informant,User) { |
<<<<<<<
changeViewsOfInternalModels : function() {
// Create a CommentReadView
this.commentReadView = new UpdatingCollectionView({
collection : this.model.get("comments"),
childViewConstructor : CommentReadView,
childViewTagName : 'li'
});
},
=======
/**
* Renders only the first page of the Data List.
*/
renderFirstPage : function() {
this.clearDataList();
for (var i = 0; i < this.perPage; i++) {
this.addOne(this.model.get("datumIds")[i]);
}
},
>>>>>>>
changeViewsOfInternalModels : function() {
// Create a CommentReadView
this.commentReadView = new UpdatingCollectionView({
collection : this.model.get("comments"),
childViewConstructor : CommentReadView,
childViewTagName : 'li'
});
},
/**
* Renders only the first page of the Data List.
*/
renderFirstPage : function() {
this.clearDataList();
for (var i = 0; i < this.perPage; i++) {
this.addOne(this.model.get("datumIds")[i]);
}
}, |
<<<<<<<
Utils.debug("Session fetched successfully" +e);
=======
Utils.debug("Session fetched successfully" + e);
s.relativizePouchToACorpus(self.get("corpus"));
>>>>>>>
Utils.debug("Session fetched successfully" +e);
},
error : function(e) {
Utils.debug("There was an error restructuring the session. Loading defaults..."+e);
<<<<<<<
=======
var dl = this.get("currentDataList");
dl.relativizePouchToACorpus(this.get("corpus"));
dl.id = appids.datalistid;
dl.fetch();
this.set("currentDataList", dl);
>>>>>>>
<<<<<<<
},
router : AppRouter,
/**
* This function should be called before the user leaves the page, it should also be called before the user clicks sync
* It helps to maintain where the user was, what corpus they were working on etc. It creates the json that is used to reload
* a users' dashboard from localstorage, or to load a fresh install when the user clicks sync my data.
*/
storeCurrentDashboardIdsToLocalStorage : function(callback){
// try{
var ids = {};
this.get("currentSession").save();
this.get("currentDataList").save();
this.get("corpus").save();
ids.corpusid = this.get("corpus").id;
ids.sessionid = this.get("currentSession").id;
ids.datalistid = this.get("currentDataList").id;
localStorage.setItem("appids",JSON.stringify(ids));
localStorage.setItem("userid",this.get("authentication").get("userPrivate").id);//the user private should get their id from mongodb
//save ids to the user also so that the app can bring them back to where they were
this.get("authentication").get("userPrivate").set("mostRecentIds",ids);
if(typeof callback == "function"){
callback();
}
// }catch(e){
// Utils.debug("storeCurrentDashboardIdsTo LocalStorage failed, probably called too early. ");
// Utils.debug(e);
// }
}
=======
}
>>>>>>>
},
router : AppRouter,
/**
* This function should be called before the user leaves the page, it should also be called before the user clicks sync
* It helps to maintain where the user was, what corpus they were working on etc. It creates the json that is used to reload
* a users' dashboard from localstorage, or to load a fresh install when the user clicks sync my data.
*/
storeCurrentDashboardIdsToLocalStorage : function(callback){
// try{
var ids = {};
this.get("currentSession").save();
this.get("currentDataList").save();
this.get("corpus").save();
ids.corpusid = this.get("corpus").id;
ids.sessionid = this.get("currentSession").id;
ids.datalistid = this.get("currentDataList").id;
localStorage.setItem("appids",JSON.stringify(ids));
localStorage.setItem("userid",this.get("authentication").get("userPrivate").id);//the user private should get their id from mongodb
//save ids to the user also so that the app can bring them back to where they were
this.get("authentication").get("userPrivate").set("mostRecentIds",ids);
if(typeof callback == "function"){
callback();
}
// }catch(e){
// Utils.debug("storeCurrentDashboardIdsTo LocalStorage failed, probably called too early. ");
// Utils.debug(e);
// }
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.