conflict_resolution
stringlengths
27
16k
<<<<<<< ======= // AJAX utilities var jsonpHandlers = {}; function jsonp(url, callback){ var id = 'handler' + Math.floor(Math.random() * 0xFFFF); var handler = function(data){ // remove jsonp var script = document.getElementById(id); script.parentElement.removeChild(script); // remove self delete window[id]; callback(data); }; window[id] = handler; document.head.appendChild(wb.elem('script', {src: url + '?callback=' + id, id: id, language: 'text/json'})); }; /* adapted from code here: http://javascriptexample.net/ajax01.php */ function ajax(url, success, failure){ var req = new XMLHttpRequest(); req.onreadystatechange = function() { var cType; if (req.readyState === 4) { if (req.status === 200) { cType = this.getResponseHeader("Content-Type"); success(this.responseText, cType); }else{ if (failure){ failure(this.status, this); } } } }; req.open('GET', url, true); req.send(null); }; wb.makeArray = makeArray; wb.reposition = reposition; wb.hide = hide; wb.show = show; wb.resize = resize; wb.dist = dist; wb.overlapRect = overlapRect; wb.rect = rect; wb.overlap = overlap; wb.area = area; wb.containedBy = containedBy; wb.closest = closest; wb.indexOf = indexOf; wb.find = find; wb.findAll = findAll; wb.findChildren = findChildren; wb.findChild = findChild; wb.elem = elem; wb.jsonp = jsonp; wb.ajax = ajax; >>>>>>> wb.makeArray = makeArray; wb.reposition = reposition; wb.hide = hide; wb.show = show; wb.resize = resize; wb.dist = dist; wb.overlapRect = overlapRect; wb.rect = rect; wb.overlap = overlap; wb.area = area; wb.containedBy = containedBy; wb.closest = closest; wb.indexOf = indexOf; wb.find = find; wb.findAll = findAll; wb.findChildren = findChildren; wb.findChild = findChild; wb.elem = elem;
<<<<<<< description: 'short-circuit if market minPrice not found', params: { marketID: 'MARKET_0', outcome: 3, orderTypeLabel: 'sell' }, mock: { state: { marketsData: { MARKET_0: { minPrice: undefined, maxPrice: '1' } } } }, stub: { augurjs: { augur: { api: { Orders: { getBestOrderId: () => assert.fail() } }, trading: { orderBook: { getOrderBookChunked: () => assert.fail() } } } }, insertOrderBookChunkToOrderBook: { default: () => () => assert.fail() } }, assertions: (err, actions) => { assert.strictEqual(err, 'minPrice and maxPrice not found for market MARKET_0: undefined 1') assert.deepEqual(actions, []) } }) test({ description: 'short-circuit if market maxPrice not found', params: { marketID: 'MARKET_0', outcome: 3, orderTypeLabel: 'sell' }, mock: { state: { marketsData: { MARKET_0: { minPrice: '0', maxPrice: null } } } }, stub: { augurjs: { augur: { api: { Orders: { getBestOrderId: () => assert.fail() } }, trading: { orderBook: { getOrderBookChunked: () => assert.fail() } } } }, insertOrderBookChunkToOrderBook: { default: () => () => assert.fail() } }, assertions: (err, actions) => { assert.strictEqual(err, 'minPrice and maxPrice not found for market MARKET_0: 0 null') assert.deepEqual(actions, []) } }) test({ description: 'best order ID not found', params: { marketID: 'MARKET_0', outcome: 3, orderTypeLabel: 'sell' }, mock: { state: { marketsData } }, stub: { augurjs: { augur: { api: { Orders: { getBestOrderId: (p, callback) => { assert.deepEqual(p, { _orderType: 1, _market: 'MARKET_0', _outcome: 3 }) callback(null, '0x0') } } }, trading: { orderBook: { getOrderBookChunked: () => assert.fail() } } } }, insertOrderBookChunkToOrderBook: { default: (marketID, outcome, orderTypeLabel, orderBookChunk) => dispatch => dispatch({ type: 'INSERT_ORDER_BOOK_CHUNK_TO_ORDER_BOOK', marketID, outcome, orderTypeLabel, orderBookChunk }) } }, assertions: (err, actions) => { assert.strictEqual(err, 'best order ID not found for market MARKET_0: "0x0"') assert.deepEqual(actions, []) } }) test({ ======= >>>>>>>
<<<<<<< const { onTradeHash, onCommitSent, onCommitSuccess, onCommitFailed, onNextBlock, onTradeSent, onTradeSuccess, onTradeFailed } = args; console.log('mock short_sell called'); console.log(args); ======= const { max_amount, buyer_trade_id, sender, onTradeHash, onCommitSent, onCommitSuccess, onCommitFailed, onNextBlock, onTradeSent, onTradeSuccess, onTradeFailed } = args; // console.log('mock short_sell called'); // console.log(args); >>>>>>> const { onTradeHash, onCommitSent, onCommitSuccess, onCommitFailed, onNextBlock, onTradeSent, onTradeSuccess, onTradeFailed } = args; // console.log('mock short_sell called'); // console.log(args); <<<<<<< onCommitSent({ txHash: 'tradeHash1', callReturn: '1' }); if (mockAugur.augur.short_sell.callCount !== 3)onCommitSuccess({ gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); if (mockAugur.augur.short_sell.callCount === 3) onCommitFailed({ error: 'error', message: 'error message' }); if (mockAugur.augur.short_sell.callCount !== 3) onNextBlock({ txHash: 'tradeHash1', callReturn: '1' }); if (mockAugur.augur.short_sell.callCount !== 3) onTradeSent({ txHash: 'tradeHash1', callReturn: '1' }); if (mockAugur.augur.short_sell.callCount === 1) onTradeSuccess({ sharesBought: '0', cashFromTrade: '10.00', unmatchedShares: '0', unmatchedCash: '0', tradingFees: '0.01', gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); if (mockAugur.augur.short_sell.callCount === 2) onTradeFailed({ error: 'error', message: 'error message' }); ======= onCommitSent({ hash: 'tradeHash1', callReturn: '1' }); if (mockAugur.augur.short_sell.callCount !== 3) { onCommitSuccess({ gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); onNextBlock({ hash: 'tradeHash1', callReturn: '1' }); onTradeSent({ hash: 'tradeHash1', callReturn: '1' }); } // console.log('short_sell callcount:', mockAugur.augur.short_sell.callCount); switch (mockAugur.augur.short_sell.callCount) { case 2: onTradeFailed({ error: 'error', message: 'error message' }); break; case 3: onCommitFailed({ error: 'error', message: 'error message' }); break; case 4: onTradeSuccess({ sharesBought: ZERO, cashFromTrade: abi.bignum('10'), matchedShares: abi.bignum('10'), unmatchedShares: abi.bignum('40'), unmatchedCash: ZERO, tradingFees: abi.bignum('0.01'), gasFees: abi.bignum('0.01450404'), hash: 'testhash', timestamp: 1500000000 }); break; case 5: onTradeSuccess({ sharesBought: ZERO, cashFromTrade: abi.bignum('15'), matchedShares: abi.bignum('15'), unmatchedShares: abi.bignum('25'), unmatchedCash: ZERO, tradingFees: abi.bignum('0.01'), gasFees: abi.bignum('0.01450404'), hash: 'testhash', timestamp: 1500000000 }); break; case 6: onTradeSuccess({ sharesBought: ZERO, cashFromTrade: abi.bignum('25'), matchedShares: abi.bignum('25'), unmatchedShares: abi.bignum('0'), unmatchedCash: ZERO, tradingFees: abi.bignum('0.01'), gasFees: abi.bignum('0.01450404'), hash: 'testhash', timestamp: 1500000000 }); break; default: onTradeSuccess({ sharesBought: ZERO, cashFromTrade: abi.bignum('10.00'), unmatchedShares: ZERO, unmatchedCash: ZERO, tradingFees: abi.bignum('0.01'), gasFees: abi.bignum('0.01450404'), hash: 'testhash', timestamp:1500000000 }); break; } >>>>>>> onCommitSent({ hash: 'tradeHash1', callReturn: '1' }); if (mockAugur.augur.short_sell.callCount !== 3) { onCommitSuccess({ gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); onNextBlock({ hash: 'tradeHash1', callReturn: '1' }); onTradeSent({ hash: 'tradeHash1', callReturn: '1' }); } // console.log('short_sell callcount:', mockAugur.augur.short_sell.callCount); switch (mockAugur.augur.short_sell.callCount) { case 2: onTradeFailed({ error: 'error', message: 'error message' }); break; case 3: onCommitFailed({ error: 'error', message: 'error message' }); break; case 4: onTradeSuccess({ sharesBought: ZERO, cashFromTrade: abi.bignum('10'), matchedShares: abi.bignum('10'), unmatchedShares: abi.bignum('40'), unmatchedCash: ZERO, tradingFees: abi.bignum('0.01'), gasFees: abi.bignum('0.01450404'), hash: 'testhash', timestamp: 1500000000 }); break; case 5: onTradeSuccess({ sharesBought: ZERO, cashFromTrade: abi.bignum('15'), matchedShares: abi.bignum('15'), unmatchedShares: abi.bignum('25'), unmatchedCash: ZERO, tradingFees: abi.bignum('0.01'), gasFees: abi.bignum('0.01450404'), hash: 'testhash', timestamp: 1500000000 }); break; case 6: onTradeSuccess({ sharesBought: ZERO, cashFromTrade: abi.bignum('25'), matchedShares: abi.bignum('25'), unmatchedShares: abi.bignum('0'), unmatchedCash: ZERO, tradingFees: abi.bignum('0.01'), gasFees: abi.bignum('0.01450404'), hash: 'testhash', timestamp: 1500000000 }); break; default: onTradeSuccess({ sharesBought: ZERO, cashFromTrade: abi.bignum('10.00'), unmatchedShares: ZERO, unmatchedCash: ZERO, tradingFees: abi.bignum('0.01'), gasFees: abi.bignum('0.01450404'), hash: 'testhash', timestamp: 1500000000 }); break; }
<<<<<<< import immutableDelete from 'immutable-delete' import { UPDATE_MARKETS_DATA, CLEAR_MARKETS_DATA, UPDATE_MARKET_CATEGORY, UPDATE_MARKET_REP_BALANCE, UPDATE_MARKET_FROZEN_SHARES_VALUE, UPDATE_MARKET_ESCAPE_HATCH_GAS_COST, UPDATE_MARKET_TRADING_ESCAPE_HATCH_GAS_COST, UPDATE_MARKETS_DISPUTE_INFO, DELETE_MARKET } from 'modules/markets/actions/update-markets-data' ======= import { UPDATE_MARKETS_DATA, CLEAR_MARKETS_DATA, UPDATE_MARKET_CATEGORY, UPDATE_MARKET_REP_BALANCE, UPDATE_MARKET_FROZEN_SHARES_VALUE, UPDATE_MARKET_ESCAPE_HATCH_GAS_COST, UPDATE_MARKET_TRADING_ESCAPE_HATCH_GAS_COST, UPDATE_MARKETS_DISPUTE_INFO, REMOVE_MARKET } from 'modules/markets/actions/update-markets-data' >>>>>>> import immutableDelete from 'immutable-delete' import { UPDATE_MARKETS_DATA, CLEAR_MARKETS_DATA, UPDATE_MARKET_CATEGORY, UPDATE_MARKET_REP_BALANCE, UPDATE_MARKET_FROZEN_SHARES_VALUE, UPDATE_MARKET_ESCAPE_HATCH_GAS_COST, UPDATE_MARKET_TRADING_ESCAPE_HATCH_GAS_COST, UPDATE_MARKETS_DISPUTE_INFO, REMOVE_MARKET } from 'modules/markets/actions/update-markets-data' <<<<<<< case DELETE_MARKET: return immutableDelete(marketsData, action.marketId) ======= case REMOVE_MARKET: if (!action.marketId) return marketsData delete marketsData[action.marketId] return marketsData >>>>>>> case REMOVE_MARKET: return immutableDelete(marketsData, action.marketId)
<<<<<<< export const selectMarketsTotals = memoizerific(1)( (allMarkets, activePage, selectedMarketsHeader, keywords, selectedFilters) => { const positions = { numPositions: 0, qtyShares: 0, totalValue: 0, totalCost: 0 }; const filteredMarkets = selectFilteredMarkets(allMarkets, keywords, selectedFilters); ======= export default function() { const { activePage, selectedMarketsHeader, keywords, selectedFilters } = store.getState(), { allMarkets } = require('../../../selectors'); return selectMarketsTotals(allMarkets, activePage, selectedMarketsHeader, keywords, selectedFilters); } export const selectMarketsTotals = memoizerific(1)((allMarkets, activePage, selectedMarketsHeader, keywords, selectedFilters) => { let positions = { numPositions: 0, qtyShares: 0, totalValue: 0, totalCost: 0 }, filteredMarkets = selectFilteredMarkets(allMarkets, keywords, selectedFilters), totals, tagsTotals = {}; >>>>>>> export const selectMarketsTotals = memoizerific(1)( (allMarkets, activePage, selectedMarketsHeader, keywords, selectedFilters) => { const positions = { numPositions: 0, qtyShares: 0, totalValue: 0, totalCost: 0 }; const filteredMarkets = selectFilteredMarkets(allMarkets, keywords, selectedFilters); const tagsTotals = {}; <<<<<<< totals.positionsSummary = selectPositionsSummary(positions.numPositions, positions.qtyShares, positions.totalValue, positions.totalCost); ======= totals.positionsSummary = selectPositionsSummary(positions.numPositions, positions.qtyShares, positions.totalValue, positions.totalCost); totals.tagsTotals = Object.keys(tagsTotals).sort((a, b) => tagsTotals[b] - tagsTotals[a]).map(tag => { return { name: tag, num: tagsTotals[tag] }; }); >>>>>>> totals.positionsSummary = selectPositionsSummary( positions.numPositions, positions.qtyShares, positions.totalValue, positions.totalCost) ; totals.tagsTotals = Object.keys(tagsTotals).sort((a, b) => tagsTotals[b] - tagsTotals[a]).map(tag => { const obj = { name: tag, num: tagsTotals[tag] }; return obj; });
<<<<<<< import { loadFullMarket } from 'modules/market/actions/load-full-market' import { MARKET_ID_PARAM_NAME } from 'modules/routes/constants/param-names' import { selectMarket } from 'modules/market/selectors/market' import parseQuery from 'modules/routes/helpers/parse-query' import getValue from 'utils/get-value' ======= import { submitInitialReport } from 'modules/reporting/actions/submit-initial-report' >>>>>>> import { loadFullMarket } from 'modules/market/actions/load-full-market' import { MARKET_ID_PARAM_NAME } from 'modules/routes/constants/param-names' import { selectMarket } from 'modules/market/selectors/market' import parseQuery from 'modules/routes/helpers/parse-query' import getValue from 'utils/get-value' import { submitInitialReport } from 'modules/reporting/actions/submit-initial-report'
<<<<<<< MARKET_MAX_SPREAD, HAS_OPEN_ORDERS, ======= >>>>>>> MARKET_MAX_SPREAD, <<<<<<< updateMaxSpread: maxSpreadPercent => dispatch(updateFilterSortOptions(MARKET_MAX_SPREAD, maxSpreadPercent)), updateHasOpenOrders: hasOpenOrders => dispatch(updateFilterSortOptions(HAS_OPEN_ORDERS, hasOpenOrders)), ======= >>>>>>> updateMaxSpread: maxSpreadPercent => dispatch(updateFilterSortOptions(MARKET_MAX_SPREAD, maxSpreadPercent)),
<<<<<<< onSuccess: () => { dispatch(removeAccountDispute({ marketId })) callback(null) ======= onSuccess: (gasCost) => { if (estimateGas) { callback(null, gasCost) } else { removeAccountDispute({ marketId }) callback(null) } >>>>>>> onSuccess: (gasCost) => { if (estimateGas) { callback(null, gasCost) } else { dispatch(removeAccountDispute({ marketId })) callback(null) }
<<<<<<< import getAllMarkets from 'modules/markets/selectors/markets-all'; ======= >>>>>>> import getAllMarkets from 'modules/markets/selectors/markets-all'; <<<<<<< ======= keywords: selectTags(state), >>>>>>> <<<<<<< chat: getChatMessages(), markets: getAllMarkets(), marketsFilteredSorted: state.marketsFilteredSorted ======= chat: getChatMessages(), categories: selectTopics(state), selectedCategory: state.selectedTopic >>>>>>> chat: getChatMessages(), markets: getAllMarkets(), marketsFilteredSorted: state.marketsFilteredSorted categories: selectTopics(state), selectedCategory: state.selectedTopic
<<<<<<< // if (loggedInAccount && account !== loggedInAccount) { // dispatch(logout()); // } } // else if (existing !== loggedInAccount) { // dispatch(logout()); // } // if (loggedInAccount && accounts.includes(loggedInAccount)) { // dispatch(useUnlockedAccount(loggedInAccount)); // } if (!account) { return callback(NOT_SIGNED_IN_ERROR, account); } ======= } >>>>>>> // if (loggedInAccount && account !== loggedInAccount) { // dispatch(logout()); // } } // else if (existing !== loggedInAccount) { // dispatch(logout()); // } // if (loggedInAccount && accounts.includes(loggedInAccount)) { // dispatch(useUnlockedAccount(loggedInAccount)); // } }
<<<<<<< var on = function on(elem, eventname, selector, handler, onceOnly){ ======= function on(elem, eventname, selector, handler){ >>>>>>> function on(elem, eventname, selector, handler, onceOnly){ <<<<<<< var once = function(elem, eventname, selector, handler){ return Event.on(elem, eventname, selector, handler, true); ======= function once(elem, eventname, selector, handler){ var listener = function listener(event){ handler(event); Event.off(elem, eventname, listener); }; return Event.on(elem, eventname, selector, listener); >>>>>>> var once = function(elem, eventname, selector, handler){ return Event.on(elem, eventname, selector, handler, true); <<<<<<< // console.log(potentialDropTargets.length); ======= >>>>>>> <<<<<<< Event.on('.content', 'mousemove', null, drag); //Event.on('.scratchpad', '', null, endDragInScratchpad); Event.on(document.body, 'mouseup', null, endDrag); ======= Event.on(document, 'mousemove', null, drag); Event.on('.content', 'mouseup', null, endDrag); >>>>>>> Event.on('.content', 'mousemove', null, drag); //Event.on('.scratchpad', '', null, endDragInScratchpad); Event.on(document.body, 'mouseup', null, endDrag); <<<<<<< ======= Event.on(document.body, 'wb-remove', '.block', removeBlock); Event.on(document.body, 'wb-add', '.block', addBlock); Event.on(document.body, 'wb-delete', '.block', deleteBlock); wb.blockRegistry = blockRegistry; >>>>>>> Event.on(document.body, 'wb-remove', '.block', removeBlock); Event.on(document.body, 'wb-add', '.block', addBlock); Event.on(document.body, 'wb-delete', '.block', deleteBlock); wb.blockRegistry = blockRegistry; <<<<<<< // Event.on('.tabbar', 'click', '.chrome_tab', tabSelect); if (document.body.clientWidth < 361){ // console.log('mobile view'); Event.on('.show-files', 'click', null, showFiles); Event.on('.show-blocks', 'click', null, showBlocks); Event.on('.show-script', 'click', null, showScript); Event.on('.show-result', 'click', null, showResult); document.querySelector('.show-script').classList.add('current-button'); document.querySelector('.workspace').classList.add('current-view'); } if (document.body.clientWidth > 360){ // console.log('desktop view'); Event.on(document.body, 'change', 'input', updateScriptsView); Event.on(document.body, 'wb-modified', null, updateScriptsView); } ======= Event.on('.tabbar', 'click', '.chrome_tab', tabSelect); wb.showWorkspace = showWorkspace; wb.menu = menu; >>>>>>> // Event.on('.tabbar', 'click', '.chrome_tab', tabSelect); if (document.body.clientWidth < 361){ // console.log('mobile view'); Event.on('.show-files', 'click', null, showFiles); Event.on('.show-blocks', 'click', null, showBlocks); Event.on('.show-script', 'click', null, showScript); Event.on('.show-result', 'click', null, showResult); document.querySelector('.show-script').classList.add('current-button'); document.querySelector('.workspace').classList.add('current-view'); } if (document.body.clientWidth > 360){ // console.log('desktop view'); Event.on(document.body, 'change', 'input', updateScriptsView); Event.on(document.body, 'wb-modified', null, updateScriptsView); } <<<<<<< Event.on('.clear_scripts', 'click', null, wb.clearScripts); Event.on('.edit-script', 'click', null, function(event){ wb.historySwitchState('editor'); }); Event.on(document.body, 'click', '.load-example', function(evt){ console.log('load example ' + evt.target.dataset.example); ======= function loadExample(event){ >>>>>>> function loadExample(event){ <<<<<<< Event.on('.save_scripts', 'click', null, wb.saveCurrentScriptsToGist); Event.on('.download_scripts', 'click', null, wb.createDownloadUrl); Event.on('.load_from_gist', 'click', null, wb.loadScriptsFromGistId); Event.on('.restore_scripts', 'click', null, wb.loadScriptsFromFilesystem); wb.loaded = false; ======= >>>>>>> <<<<<<< Event.once(document.body, 'wb-workspace-initialized', null, wb.initializeDragHandlers); function handleDragover(evt){ ======= function handleDragover(event){ >>>>>>> function handleDragover(evt){ <<<<<<< function runFullSize(){ ['#block_menu', '.workspace', '.scripts_text_view'].forEach(function(sel){ wb.hide(wb.find(document.body, sel)); }); wb.show(wb.find(document.body, '.stage')); } function runWithLayout(){ ['#block_menu', '.workspace'].forEach(function(sel){ wb.show(wb.find(document.body, sel)); }); ['stage', 'scripts_text_view', 'tutorial', 'scratchpad', 'scripts_workspace'].forEach(function(name){ toggleComponent({detail: {name: name, state: wb.toggleState[name]}}); }); } function toggleComponent(evt){ var component = wb.find(document.body, '.' + evt.detail.name); if (!component) return; evt.detail.state ? wb.show(component) : wb.hide(component); var results = wb.find(document.body, '.results'); // Special cases switch(evt.detail.name){ case 'stage': if (evt.detail.state){ wb.show(results); }else{ wb.clearStage(); if (!wb.toggleState.scripts_text_view){ wb.hide(results); } } break; case 'scripts_text_view': if (evt.detail.state){ wb.show(results); wb.updateScriptsView(); }else{ if (!wb.toggleState.stage){ wb.hide(results); } } break; case 'tutorial': case 'scratchpad': case 'scripts_workspace': if (! (wb.toggleState.tutorial || wb.toggleState.scratchpad || wb.toggleState.scripts_workspace)){ wb.hide(wb.find(document.body, '.workspace')); }else{ wb.show(wb.find(document.body, '.workspace')); } default: // do nothing break; } if (wb.toggleState.stage){ // restart script on any toggle // so it runs at the new size wb.runCurrentScripts(); } } Event.on(document.body, 'wb-toggle', null, toggleComponent); window.addEventListener('popstate', function(evt){ console.log('popstate event'); ======= window.addEventListener('popstate', function(event){ // console.log('popstate event'); >>>>>>> function runFullSize(){ ['#block_menu', '.workspace', '.scripts_text_view'].forEach(function(sel){ wb.hide(wb.find(document.body, sel)); }); wb.show(wb.find(document.body, '.stage')); } function runWithLayout(){ ['#block_menu', '.workspace'].forEach(function(sel){ wb.show(wb.find(document.body, sel)); }); ['stage', 'scripts_text_view', 'tutorial', 'scratchpad', 'scripts_workspace'].forEach(function(name){ toggleComponent({detail: {name: name, state: wb.toggleState[name]}}); }); } function toggleComponent(evt){ var component = wb.find(document.body, '.' + evt.detail.name); if (!component) return; evt.detail.state ? wb.show(component) : wb.hide(component); var results = wb.find(document.body, '.results'); // Special cases switch(evt.detail.name){ case 'stage': if (evt.detail.state){ wb.show(results); }else{ wb.clearStage(); if (!wb.toggleState.scripts_text_view){ wb.hide(results); } } break; case 'scripts_text_view': if (evt.detail.state){ wb.show(results); wb.updateScriptsView(); }else{ if (!wb.toggleState.stage){ wb.hide(results); } } break; case 'tutorial': case 'scratchpad': case 'scripts_workspace': if (! (wb.toggleState.tutorial || wb.toggleState.scratchpad || wb.toggleState.scripts_workspace)){ wb.hide(wb.find(document.body, '.workspace')); }else{ wb.show(wb.find(document.body, '.workspace')); } default: // do nothing break; } if (wb.toggleState.stage){ // restart script on any toggle // so it runs at the new size wb.runCurrentScripts(); } } Event.on(document.body, 'wb-toggle', null, toggleComponent); window.addEventListener('popstate', function(evt){ console.log('popstate event'); <<<<<<< }); ======= }, false); Event.on('.clear_scripts', 'click', null, clearScripts); Event.on('.edit-script', 'click', null, function(event){ wb.historySwitchState('editor'); }); Event.on('.content', 'click', '.load-example', loadExample); Event.on(document.body, 'wb-state-change', null, handleStateChange); Event.on('.save_scripts', 'click', null, wb.saveCurrentScriptsToGist); Event.on('.download_scripts', 'click', null, wb.createDownloadUrl); Event.on('.load_from_gist', 'click', null, wb.loadScriptsFromGistId); Event.on('.restore_scripts', 'click', null, wb.loadScriptsFromFilesystem); Event.on('.workspace', 'click', '.disclosure', disclosure); Event.on('.workspace', 'dblclick', '.locals .name', wb.changeName); Event.on('.workspace', 'keypress', 'input', wb.resize); Event.on('.workspace', 'change', 'input, select', function(event){ Event.trigger(document.body, 'wb-modified', {block: event.wbTarget, type: 'valueChanged'}); }); Event.on(document.body, 'wb-script-loaded', null, handleScriptLoad); Event.on(document.body, 'wb-modified', null, handleScriptModify); wb.language = location.pathname.match(/\/([^/.]*)\.html/)[1]; wb.loaded = false; wb.clearScripts = clearScripts; wb.historySwitchState = historySwitchState; wb.createWorkspace = createWorkspace; wb.wireUpWorkspace = wireUpWorkspace; >>>>>>> }, false); Event.once(document.body, 'wb-workspace-initialized', null, wb.initializeDragHandlers); Event.on('.clear_scripts', 'click', null, clearScripts); Event.on('.edit-script', 'click', null, function(event){ wb.historySwitchState('editor'); }); Event.on('.content', 'click', '.load-example', loadExample); Event.on(document.body, 'wb-state-change', null, handleStateChange); Event.on('.save_scripts', 'click', null, wb.saveCurrentScriptsToGist); Event.on('.download_scripts', 'click', null, wb.createDownloadUrl); Event.on('.load_from_gist', 'click', null, wb.loadScriptsFromGistId); Event.on('.restore_scripts', 'click', null, wb.loadScriptsFromFilesystem); Event.on('.workspace', 'click', '.disclosure', disclosure); Event.on('.workspace', 'dblclick', '.locals .name', wb.changeName); Event.on('.workspace', 'keypress', 'input', wb.resize); Event.on('.workspace', 'change', 'input, select', function(event){ Event.trigger(document.body, 'wb-modified', {block: event.wbTarget, type: 'valueChanged'}); }); Event.on(document.body, 'wb-script-loaded', null, handleScriptLoad); Event.on(document.body, 'wb-modified', null, handleScriptModify); wb.language = location.pathname.match(/\/([^/.]*)\.html/)[1]; wb.loaded = false; wb.clearScripts = clearScripts; wb.historySwitchState = historySwitchState; wb.createWorkspace = createWorkspace; wb.wireUpWorkspace = wireUpWorkspace;
<<<<<<< import { submitNewMarket } from 'modules/create-market/actions/submit-new-market' import { selectCurrentTimestamp, selectBlockchainState } from 'src/select-state' ======= import { logout } from 'modules/auth/actions/logout' import { selectLoginAccountState } from 'src/select-state' import { formatRep, formatEther } from 'utils/format-number' >>>>>>> import { submitNewMarket } from 'modules/create-market/actions/submit-new-market' import { selectCurrentTimestamp, selectBlockchainState } from 'src/select-state' import { logout } from 'modules/auth/actions/logout' import { selectLoginAccountState } from 'src/select-state' import { formatRep, formatEther } from 'utils/format-number' <<<<<<< const createMarket = (marketData, callback = logError) => (dispatch) => { dispatch(submitNewMarket(marketData, [], (err, marketId) => { if (err) return callback({ err }) marketData.id = marketId return callback({ err: null, market: marketData }) })) } ======= const getLoggedInAccountData = (callback = logError) => dispatch => callback(selectLoginAccountState(store.getState())) const formatRepValue = (value, callback = logError) => dispatch => callback(formatRep(value)) const formatEthValue = (value, callback = logError) => dispatch => callback(formatEther(value)) >>>>>>> const createMarket = (marketData, callback = logError) => (dispatch) => { dispatch(submitNewMarket(marketData, [], (err, marketId) => { if (err) return callback({ err }) marketData.id = marketId return callback({ err: null, market: marketData }) })) } const getLoggedInAccountData = (callback = logError) => dispatch => callback(selectLoginAccountState(store.getState())) const formatRepValue = (value, callback = logError) => dispatch => callback(formatRep(value)) const formatEthValue = (value, callback = logError) => dispatch => callback(formatEther(value)) <<<<<<< findMarketId: marketDescription => new Promise((resolve, reject) => dispatch(findMarketByDesc(marketDescription, (result) => { if (result.err) return reject() resolve(result.marketId) }))), createMarket: market => new Promise((resolve, reject) => dispatch(createMarket(market, (result) => { if (result.err) return reject() resolve(result.market) }))), getCurrentTimestamp: () => new Promise(resolve => resolve(selectCurrentTimestamp(store.getState()))), getCurrentBlock: () => new Promise(resolve => resolve(selectBlockchainState(store.getState()))), ======= logout: () => dispatch(logout()), getAccountData: () => new Promise(resolve => dispatch(getLoggedInAccountData(resolve))), formatRep: value => new Promise(resolve => dispatch(formatRepValue(value, resolve))), formatEth: value => new Promise(resolve => dispatch(formatEthValue(value, resolve))), >>>>>>> findMarketId: marketDescription => new Promise((resolve, reject) => dispatch(findMarketByDesc(marketDescription, (result) => { if (result.err) return reject() resolve(result.marketId) }))), createMarket: market => new Promise((resolve, reject) => dispatch(createMarket(market, (result) => { if (result.err) return reject() resolve(result.market) }))), getCurrentTimestamp: () => new Promise(resolve => resolve(selectCurrentTimestamp(store.getState()))), getCurrentBlock: () => new Promise(resolve => resolve(selectBlockchainState(store.getState()))), logout: () => dispatch(logout()), getAccountData: () => new Promise(resolve => dispatch(getLoggedInAccountData(resolve))), formatRep: value => new Promise(resolve => dispatch(formatRepValue(value, resolve))), formatEth: value => new Promise(resolve => dispatch(formatEthValue(value, resolve))),
<<<<<<< import { augur, constants } from 'services/augurjs'; import speedomatic from 'speedomatic'; import { BUY, SELL } from 'modules/trade/constants/types'; ======= import { augur, abi, constants } from 'services/augurjs'; import { BUY, SELL } from 'modules/transactions/constants/types'; >>>>>>> import speedomatic from 'speedomatic'; import { augur, constants } from 'services/augurjs'; import { BUY, SELL } from 'modules/transactions/constants/types';
<<<<<<< import { augur } from 'services/augurjs' import { BUY } from 'modules/transactions/constants/types' import { updateIsFirstOrderBookChunkLoaded } from 'modules/bids-asks/actions/update-order-book' import insertOrderBookChunkToOrderBook from 'modules/bids-asks/actions/insert-order-book-chunk-to-order-book' import logError from 'utils/log-error' ======= import { augur } from 'services/augurjs'; import { updateIsFirstOrderBookChunkLoaded } from 'modules/bids-asks/actions/update-order-book'; import insertOrderBookChunkToOrderBook from 'modules/bids-asks/actions/insert-order-book-chunk-to-order-book'; import logError from 'utils/log-error'; >>>>>>> import { augur } from 'services/augurjs' import { updateIsFirstOrderBookChunkLoaded } from 'modules/bids-asks/actions/update-order-book' import insertOrderBookChunkToOrderBook from 'modules/bids-asks/actions/insert-order-book-chunk-to-order-book' import logError from 'utils/log-error' <<<<<<< const market = marketsData[marketID] if (!market) { return callback(`market ${marketID} data not found`) } if (market.minPrice == null || market.maxPrice == null) { return callback(`minPrice and maxPrice not found for market ${marketID}: ${market.minPrice} ${market.maxPrice}`) } const orderType = (orderTypeLabel === BUY) ? 0 : 1 augur.api.Orders.getBestOrderId({ _orderType: orderType, _market: marketID, _outcome: outcome }, (err, bestOrderId) => { if (err || !parseInt(bestOrderId, 16)) { return callback(`best order ID not found for market ${marketID}: ${JSON.stringify(bestOrderId)}`) ======= const market = marketsData[marketID]; if (!market) return callback(`market ${marketID} data not found`); dispatch(updateIsFirstOrderBookChunkLoaded(marketID, outcome, orderTypeLabel, false)); augur.trading.getOpenOrders({ marketID, outcome, orderType: orderTypeLabel }, (err, openOrders) => { if (err) return callback(err); if (openOrders != null) { // TODO verify that openOrders is the correct shape for insertion dispatch(insertOrderBookChunkToOrderBook(marketID, outcome, orderTypeLabel, openOrders)); >>>>>>> const market = marketsData[marketID] if (!market) return callback(`market ${marketID} data not found`) dispatch(updateIsFirstOrderBookChunkLoaded(marketID, outcome, orderTypeLabel, false)) augur.trading.getOpenOrders({ marketID, outcome, orderType: orderTypeLabel }, (err, openOrders) => { if (err) return callback(err) if (openOrders != null) { // TODO verify that openOrders is the correct shape for insertion dispatch(insertOrderBookChunkToOrderBook(marketID, outcome, orderTypeLabel, openOrders)) <<<<<<< dispatch(updateIsFirstOrderBookChunkLoaded(marketID, outcome, orderTypeLabel, false)) augur.trading.orderBook.getOrderBookChunked({ _orderType: orderType, _market: marketID, _outcome: outcome, _startingOrderId: bestOrderId, _numOrdersToLoad: null, minPrice: market.minPrice, maxPrice: market.maxPrice }, orderBookChunk => dispatch(insertOrderBookChunkToOrderBook(marketID, outcome, orderTypeLabel, orderBookChunk)), (err, orderBook) => { if (err) { return callback(`outcome order book not loaded for market ${marketID}: ${JSON.stringify(orderBook)}`) } callback(null) }) }) } ======= callback(null); }); }; >>>>>>> callback(null) }) }
<<<<<<< transactionsLoading: state.appStatus.transactionsLoading, isMobile: state.appStatus.isMobile, pendingLiquidityOrders: state.pendingLiquidityOrders ======= transactionsLoading: state.transactionsLoading, isMobile: state.isMobile, pendingLiquidityOrders: state.pendingLiquidityOrders, hasAllTransactionsLoaded: state.transactionsOldestLoadedBlock === state.loginAccount.registerBlockNumber, // FIXME outcomes: marketDisputeOutcomes() || {} >>>>>>> transactionsLoading: state.appStatus.transactionsLoading, isMobile: state.appStatus.isMobile, pendingLiquidityOrders: state.pendingLiquidityOrders, outcomes: marketDisputeOutcomes() || {}
<<<<<<< returns: { blocktype: 'expression', label: 'string##', script: 'local.string##', type: 'string' }, ======= locals: [ { blocktype: 'expression', labels: ['string##'], script: 'local.string##', type: 'string' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'string##', script: 'local.string##', type: 'string' } ], <<<<<<< returns: { blocktype: 'expression', label: 'number##', script: 'local.number##', type: 'number' }, ======= locals: [ { blocktype: 'expression', labels: ['number##'], script: 'local.number##', type: 'number' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'number##', script: 'local.number##', type: 'number' } ], <<<<<<< returns: { blocktype: 'expression', label: 'boolean##', script: 'local.boolean##', type: 'boolean' }, ======= locals: [ { blocktype: 'expression', labels: ['boolean##'], script: 'local.boolean##', type: 'boolean' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'boolean##', script: 'local.boolean##', type: 'boolean' } ], <<<<<<< returns: { blocktype: 'expression', label: 'array##', script: 'local.array## = {{1}}', type: 'array' }, ======= locals: [ { blocktype: 'expression', labels: ['array##'], script: 'local.array## = {{1}}', type: 'array' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'array##', script: 'local.array## = {{1}}', type: 'array' } ], <<<<<<< returns: { blocktype: 'expression', label: 'object##', script: 'local.object##', type: 'object' }, ======= locals: [ { blocktype: 'expression', labels: ['object##'], script: 'local.object##', type: 'object' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'object##', script: 'local.object##', type: 'object' } ], <<<<<<< returns: { blocktype: 'expression', label: 'color##', script: 'local.color##', type: 'color' }, ======= locals: [ { blocktype: 'expression', labels: ['color##'], script: 'local.color##', type: 'color' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'color##', script: 'local.color##', type: 'color' } ], <<<<<<< returns: { blocktype: 'expression', label: 'image##', script: 'local.image##', type: 'image' }, ======= locals: [ { blocktype: 'expression', labels: ['image##'], script: 'local.image##', type: 'image' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'image##', script: 'local.image##', type: 'image' } ], <<<<<<< returns: { blocktype: 'expression', label: 'shape##', script: 'local.shape##', type: 'shape' }, ======= locals: [ { blocktype: 'expression', labels: ['shape##'], script: 'local.shape##', type: 'shape' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'shape##', script: 'local.shape##', type: 'shape' } ], <<<<<<< returns: { blocktype: 'expression', label: 'point##', script: 'local.point##', type: 'point' }, ======= locals: [ { blocktype: 'expression', labels: ['point##'], script: 'local.point##', type: 'point' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'point##', script: 'local.point##', type: 'point' } ], <<<<<<< returns: { blocktype: 'expression', label: 'size##', script: 'local.size##', type: 'size' }, ======= locals: [ { blocktype: 'expression', labels: ['size##'], script: 'local.size##', type: 'size' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'size##', script: 'local.size##', type: 'size' } ], <<<<<<< returns: { blocktype: 'expression', label: 'rect##', script: 'local.rect##', type: 'rect' }, ======= locals: [ { blocktype: 'expression', labels: ['rect##'], script: 'local.rect##', type: 'rect' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'rect##', script: 'local.rect##', type: 'rect' } ], <<<<<<< returns: { blocktype: 'expression', label: 'gradient##', script: 'local.gradient##', type: 'gradient' }, ======= locals: [ { blocktype: 'expression', labels: ['gradient##'], script: 'local.gradient##', type: 'gradient' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'gradient##', script: 'local.gradient##', type: 'gradient' } ], <<<<<<< returns: { blocktype: 'expression', label: 'pattern##', script: 'local.pattern##', type: 'pattern' }, ======= locals: [ { blocktype: 'expression', labels: ['pattern##'], script: 'local.pattern##', type: 'pattern' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'pattern##', script: 'local.pattern##', type: 'pattern' } ], <<<<<<< returns: { blocktype: 'expression', label: 'imagedata##', script: 'local.imagedata##', type: 'imagedata' }, ======= locals: [ { blocktype: 'expression', labels: ['imagedata##'], script: 'local.imagedata##', type: 'imagedata' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'imagedata##', script: 'local.imagedata##', type: 'imagedata' } ], <<<<<<< returns: { blocktype: 'expression', label: 'any##', script: 'local.any##', type: 'any' }, ======= locals: [ { blocktype: 'expression', labels: ['any##'], script: 'local.any##', type: 'any' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'any##', script: 'local.any##', type: 'any' } ], <<<<<<< returns: { blocktype: 'expression', label: 'array##', script: 'local.array##', type: 'array' } ======= locals: [ { blocktype: 'expression', labels: ['array##'], script: 'local.array##', type: 'array' } ] >>>>>>> locals: [ { blocktype: 'expression', label: 'array##', script: 'local.array##', type: 'array' } ] <<<<<<< returns: { blocktype: 'expression', label: 'array##', script: 'local.array##', type: 'array' } ======= locals: [ { blocktype: 'expression', labels: ['array##'], script: 'local.array##', type: 'array' } ] >>>>>>> locals: [ { blocktype: 'expression', label: 'array##', script: 'local.array##', type: 'array' } ] <<<<<<< returns: { blocktype: 'expression', label: 'object##', script: 'local.object##', type: 'object' }, ======= locals: [ { blocktype: 'expression', labels: ['object##'], script: 'local.object##', type: 'object' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'object##', script: 'local.object##', type: 'object' } ], <<<<<<< returns: { blocktype: 'expression', label: 'answer##', type: 'string', script: 'local.answer##' }, ======= locals: [ { blocktype: 'expression', labels: ['answer##'], type: 'string', script: 'local.answer##' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'answer##', type: 'string', script: 'local.answer##' } ],
<<<<<<< var context = Block.model(this.view().closest('.context')); if (context && typeof context === 'Step'){ context = Block.model(this.view().closest('.context').parent().closest('.context')) ; } ======= var context = this.view().closest('.context').data('model'); >>>>>>> var context = Block.model(this.view().closest('.context')); <<<<<<< context.addLocalBlock(this.returns); ======= this.locals.forEach(function(local){ context.addLocalBlock(local); }); if (this.next){ this.next.addLocalsToParentContext(isNext); } >>>>>>> this.locals.forEach(function(local){ context.addLocalBlock(local); }); <<<<<<< this.addGlobals(this.view()); ======= this.addLocalsToParentScope(); >>>>>>> this.addLocalsToParentScope(); <<<<<<< if (droptarget.is('.scripts_workspace')){ model.addGlobals(); }else if (droptarget.is('.slot')){ var parentModel = Block.model(droptarget.closest('.context')); ======= if (container.is('.scripts_workspace')){ model.addLocalsToParentContext(); >>>>>>> if (droptarget.is('.scripts_workspace')){ model.addLocalsToParentContext(); }else if (droptarget.is('.slot')){ var parentModel = Block.model(droptarget.closest('.context'));
<<<<<<< trading: { positions: { calculateProfitLoss: sinon.stub().returns({ position: 0, realized: 10, unrealized: -1, meanOpenPrice: 0.2 }) } } ======= calculateProfitLoss: sinon.stub().returns({ realized: 10, unrealized: -1, meanOpenPrice: 0.2 }) >>>>>>> trading: { positions: { calculateProfitLoss: sinon.stub().returns({ realized: 10, unrealized: -1, meanOpenPrice: 0.2 }) } } <<<<<<< trading: { positions: { calculateProfitLoss: sinon.stub().returns({ position: 10, realized: 10, unrealized: -1, meanOpenPrice: 0.2 }) } } ======= calculateProfitLoss: sinon.stub().returns({ realized: 10, unrealized: -1, meanOpenPrice: 0.2 }) >>>>>>> trading: { positions: { calculateProfitLoss: sinon.stub().returns({ realized: 10, unrealized: -1, meanOpenPrice: 0.2 }) } }
<<<<<<< ======= market.marketCreatorFeesCollected = formatEther(marketData.marketCreatorFeesCollected || 0) // market.priceTimeSeries = selectPriceTimeSeries(market.outcomes, marketPriceHistory) >>>>>>> market.marketCreatorFeesCollected = formatEther(marketData.marketCreatorFeesCollected || 0)
<<<<<<< const { position, realized, unrealized, meanOpenPrice } = augur.trading.positions.calculateProfitLoss(trades, lastPrice); ======= const { realized, unrealized, meanOpenPrice } = augur.calculateProfitLoss(trades, lastPrice); const position = adjustedPosition || '0'; >>>>>>> const { realized, unrealized, meanOpenPrice } = augur.trading.positions.calculateProfitLoss(trades, lastPrice); const position = adjustedPosition || '0';
<<<<<<< import env from 'modules/app/reducers/env'; import requests from 'modules/app/reducers/requests'; import blockchain from 'modules/app/reducers/blockchain'; import branch from 'modules/branch/reducers/branch'; import connection from 'modules/app/reducers/connection'; import url from 'modules/link/reducers/url'; import auth from 'modules/auth/reducers/auth'; import loginAccount from 'modules/auth/reducers/login-account'; import activeView from 'modules/app/reducers/active-view'; import marketsData from 'modules/markets/reducers/markets-data'; import hasLoadedMarkets from 'modules/markets/reducers/has-loaded-markets'; import outcomesData from 'modules/markets/reducers/outcomes-data'; import eventMarketsMap from 'modules/markets/reducers/event-markets-map'; import favorites from 'modules/markets/reducers/favorites'; import pagination from 'modules/markets/reducers/pagination'; import reports from 'modules/reports/reducers/reports'; import oldestLoadedEventPeriod from 'modules/my-reports/reducers/oldest-loaded-event-period'; import eventsWithAccountReport from 'modules/my-reports/reducers/events-with-account-report'; import orderBooks from 'modules/bids-asks/reducers/order-books'; import orderCancellation from 'modules/bids-asks/reducers/order-cancellation'; import marketTrades from 'modules/portfolio/reducers/market-trades'; import accountTrades from 'modules/my-positions/reducers/account-trades'; import accountPositions from 'modules/my-positions/reducers/account-positions'; import completeSetsBought from 'modules/my-positions/reducers/complete-sets-bought'; import netEffectiveTrades from 'modules/my-positions/reducers/net-effective-trades'; import transactionsData from 'modules/transactions/reducers/transactions-data'; import scalarMarketsShareDenomination from 'modules/market/reducers/scalar-markets-share-denomination'; import closePositionTradeGroups from 'modules/my-positions/reducers/close-position-trade-groups'; import topics from 'modules/topics/reducers/topics-data'; import hasLoadedTopic from 'modules/topics/reducers/has-loaded-topic'; import selectedTopic from 'modules/topics/reducers/selected-topic'; import selectedMarketsHeader from 'modules/markets/reducers/selected-markets-header'; import selectedMarketID from 'modules/markets/reducers/selected-market-id'; import tradesInProgress from 'modules/trade/reducers/trades-in-progress'; import tradeCommitLock from 'modules/trade/reducers/trade-commit-lock'; import tradeCommitment from 'modules/trade/reducers/trade-commitment'; import sellCompleteSetsLock from 'modules/my-positions/reducers/sell-complete-sets-lock'; import smallestPositions from 'modules/my-positions/reducers/smallest-positions'; import createMarketInProgress from 'modules/create-market/reducers/create-market-in-progress'; import keywords from 'modules/markets/reducers/keywords'; import selectedTags from 'modules/markets/reducers/selected-tags'; import selectedFilterSort from 'modules/markets/reducers/selected-filter-sort'; import priceHistory from 'modules/markets/reducers/price-history'; import chatMessages from 'modules/chat/reducers/chat-messages'; import selectedOutcomeID from 'modules/outcomes/reducers/selected-outcome-id'; import loginMessage from 'modules/login-message/reducers/login-message'; import marketCreatorFees from 'modules/my-markets/reducers/market-creator-fees'; ======= import env from './modules/app/reducers/env'; import requests from './modules/app/reducers/requests'; import blockchain from './modules/app/reducers/blockchain'; import branch from './modules/branch/reducers/branch'; import connection from './modules/app/reducers/connection'; import url from './modules/link/reducers/url'; import auth from './modules/auth/reducers/auth'; import loginAccount from './modules/auth/reducers/login-account'; import activeView from './modules/app/reducers/active-view'; import marketsData from './modules/markets/reducers/markets-data'; import outcomesData from './modules/markets/reducers/outcomes-data'; import eventMarketsMap from './modules/markets/reducers/event-markets-map'; import favorites from './modules/markets/reducers/favorites'; import pagination from './modules/markets/reducers/pagination'; import reports from './modules/reports/reducers/reports'; import oldestLoadedEventPeriod from './modules/my-reports/reducers/oldest-loaded-event-period'; import eventsWithAccountReport from './modules/my-reports/reducers/events-with-account-report'; import orderBooks from './modules/bids-asks/reducers/order-books'; import orderCancellation from './modules/bids-asks/reducers/order-cancellation'; import marketTrades from './modules/portfolio/reducers/market-trades'; import accountTrades from './modules/my-positions/reducers/account-trades'; import accountPositions from './modules/my-positions/reducers/account-positions'; import completeSetsBought from './modules/my-positions/reducers/complete-sets-bought'; import netEffectiveTrades from './modules/my-positions/reducers/net-effective-trades'; import transactionsData from './modules/transactions/reducers/transactions-data'; import scalarMarketsShareDenomination from './modules/market/reducers/scalar-markets-share-denomination'; import closePositionTradeGroups from './modules/my-positions/reducers/close-position-trade-groups'; import topics from './modules/topics/reducers/topics-data'; import selectedMarketsHeader from './modules/markets/reducers/selected-markets-header'; import selectedMarketID from './modules/markets/reducers/selected-market-id'; import tradesInProgress from './modules/trade/reducers/trades-in-progress'; import tradeCommitLock from './modules/trade/reducers/trade-commit-lock'; import tradeCommitment from './modules/trade/reducers/trade-commitment'; import sellCompleteSetsLock from './modules/my-positions/reducers/sell-complete-sets-lock'; import smallestPositions from './modules/my-positions/reducers/smallest-positions'; import createMarketInProgress from './modules/create-market/reducers/create-market-in-progress'; import keywords from './modules/markets/reducers/keywords'; import selectedTags from './modules/markets/reducers/selected-tags'; import selectedFilterSort from './modules/markets/reducers/selected-filter-sort'; import priceHistory from './modules/markets/reducers/price-history'; import chatMessages from './modules/chat/reducers/chat-messages'; import loginMessage from './modules/login-message/reducers/login-message'; import marketCreatorFees from './modules/my-markets/reducers/market-creator-fees'; >>>>>>> import env from 'modules/app/reducers/env'; import requests from 'modules/app/reducers/requests'; import blockchain from 'modules/app/reducers/blockchain'; import branch from 'modules/branch/reducers/branch'; import connection from 'modules/app/reducers/connection'; import url from 'modules/link/reducers/url'; import auth from 'modules/auth/reducers/auth'; import loginAccount from 'modules/auth/reducers/login-account'; import activeView from 'modules/app/reducers/active-view'; import marketsData from 'modules/markets/reducers/markets-data'; import hasLoadedMarkets from 'modules/markets/reducers/has-loaded-markets'; import outcomesData from 'modules/markets/reducers/outcomes-data'; import eventMarketsMap from 'modules/markets/reducers/event-markets-map'; import favorites from 'modules/markets/reducers/favorites'; import pagination from 'modules/markets/reducers/pagination'; import reports from 'modules/reports/reducers/reports'; import oldestLoadedEventPeriod from 'modules/my-reports/reducers/oldest-loaded-event-period'; import eventsWithAccountReport from 'modules/my-reports/reducers/events-with-account-report'; import orderBooks from 'modules/bids-asks/reducers/order-books'; import orderCancellation from 'modules/bids-asks/reducers/order-cancellation'; import marketTrades from 'modules/portfolio/reducers/market-trades'; import accountTrades from 'modules/my-positions/reducers/account-trades'; import accountPositions from 'modules/my-positions/reducers/account-positions'; import completeSetsBought from 'modules/my-positions/reducers/complete-sets-bought'; import netEffectiveTrades from 'modules/my-positions/reducers/net-effective-trades'; import transactionsData from 'modules/transactions/reducers/transactions-data'; import scalarMarketsShareDenomination from 'modules/market/reducers/scalar-markets-share-denomination'; import closePositionTradeGroups from 'modules/my-positions/reducers/close-position-trade-groups'; import topics from 'modules/topics/reducers/topics-data'; import hasLoadedTopic from 'modules/topics/reducers/has-loaded-topic'; import selectedTopic from 'modules/topics/reducers/selected-topic'; import selectedMarketsHeader from 'modules/markets/reducers/selected-markets-header'; import selectedMarketID from 'modules/markets/reducers/selected-market-id'; import tradesInProgress from 'modules/trade/reducers/trades-in-progress'; import tradeCommitLock from 'modules/trade/reducers/trade-commit-lock'; import tradeCommitment from 'modules/trade/reducers/trade-commitment'; import sellCompleteSetsLock from 'modules/my-positions/reducers/sell-complete-sets-lock'; import smallestPositions from 'modules/my-positions/reducers/smallest-positions'; import createMarketInProgress from 'modules/create-market/reducers/create-market-in-progress'; import keywords from 'modules/markets/reducers/keywords'; import selectedTags from 'modules/markets/reducers/selected-tags'; import selectedFilterSort from 'modules/markets/reducers/selected-filter-sort'; import priceHistory from 'modules/markets/reducers/price-history'; import chatMessages from 'modules/chat/reducers/chat-messages'; import loginMessage from 'modules/login-message/reducers/login-message'; import marketCreatorFees from 'modules/my-markets/reducers/market-creator-fees';
<<<<<<< market.marketLink = selectMarketLink(market, dispatch); market.onClickToggleFavorite = () => dispatch(toggleFavorite(marketID)); market.onSubmitPlaceTrade = outcomeID => dispatch(placeTrade(marketID, outcomeID, marketTradeInProgress[outcomeID])); ======= market.onSubmitPlaceTrade = outcomeID => dispatch(placeTrade(marketID, outcomeID, marketTradeInProgress)); >>>>>>> market.onSubmitPlaceTrade = outcomeID => dispatch(placeTrade(marketID, outcomeID, marketTradeInProgress[outcomeID]));
<<<<<<< const outcomeData = marketOutcomes[outcomeID]; const outcomeTradeInProgress = marketTradeInProgress && marketTradeInProgress[outcomeID]; const outcome = { ...outcomeData, id: outcomeID, marketID, lastPrice: formatEther(outcomeData.price, { positiveSign: false }), lastPricePercent: formatPercent(outcomeData.price * 100, { positiveSign: false }) ======= var outcomeData = marketOutcomes[outcomeID], outcomeTradeInProgress = marketTradeInProgress && marketTradeInProgress[outcomeID], outcomeTradeOrders, outcome; outcome = { ...outcomeData, id: outcomeID, marketID, lastPrice: formatEther(outcomeData.price || 0, { positiveSign: false }), lastPricePercent: formatPercent((outcomeData.price || 0) * 100, { positiveSign: false }) >>>>>>> const outcomeData = marketOutcomes[outcomeID]; const outcomeTradeInProgress = marketTradeInProgress && marketTradeInProgress[outcomeID]; const outcome = { ...outcomeData, id: outcomeID, marketID, lastPrice: formatEther(outcomeData.price || 0, { positiveSign: false }), lastPricePercent: formatPercent((outcomeData.price || 0) * 100, { positiveSign: false })
<<<<<<< // market.priceTimeSeries = selectPriceTimeSeries(market.outcomes, marketPriceHistory) ======= market.unclaimedCreatorFees = formatEther(marketData.unclaimedCreatorFees) market.priceTimeSeries = selectPriceTimeSeries(market.outcomes, marketPriceHistory) >>>>>>> market.unclaimedCreatorFees = formatEther(marketData.unclaimedCreatorFees) // market.priceTimeSeries = selectPriceTimeSeries(market.outcomes, marketPriceHistory)
<<<<<<< import { augur } from 'services/augurjs' import { BUY } from 'modules/transactions/constants/types' import { clearTradeInProgress } from 'modules/trade/actions/update-trades-in-progress' import logError from 'utils/log-error' ======= import { augur } from 'services/augurjs'; import { BUY } from 'modules/transactions/constants/types'; import { clearTradeInProgress } from 'modules/trade/actions/update-trades-in-progress'; import convertDecimalToFixedPoint from 'utils/convert-decimal-to-fixed-point'; import logError from 'utils/log-error'; >>>>>>> import { augur } from 'services/augurjs' import { BUY } from 'modules/transactions/constants/types' import { clearTradeInProgress } from 'modules/trade/actions/update-trades-in-progress' import convertDecimalToFixedPoint from 'utils/convert-decimal-to-fixed-point' import logError from 'utils/log-error' <<<<<<< const limitPrice = augur.trading.normalizePrice({ minPrice: market.minPrice, maxPrice: market.maxPrice, displayPrice: tradeInProgress.limitPrice }) ======= const normalizedDecimalPrice = augur.trading.normalizePrice({ minPrice: market.minPrice, maxPrice: market.maxPrice, displayPrice: tradeInProgress.limitPrice }); >>>>>>> const normalizedDecimalPrice = augur.trading.normalizePrice({ minPrice: market.minPrice, maxPrice: market.maxPrice, displayPrice: tradeInProgress.limitPrice })
<<<<<<< }, 'taker1'), [3, 4], `Didn't return the expected tradeIDs`); ======= } }; it('should calculate trade ids for a Buy', () => { assert.deepEqual(helper.calculateBuyTradeIDs('market1', '1', '0.5', orderBook, 'taker1'), [ 3, 4 ], `Didn't return the expected tradeIDs`); assert(mockAugur.augur.filterByPriceAndOutcomeAndUserSortByPrice.calledOnce, `Didn't call augur.filterByPriceAndOutcomeAndUserSortByPrice exactly 1 time as expected`); assert(mockAugur.augur.filterByPriceAndOutcomeAndUserSortByPrice.calledWithExactly({ order3: { id: 3, price: '0.4', outcome: '1', owner: 'owner1' }, order4: { id: 4, price: '0.4', outcome: '1', owner: 'owner1' } }, 'buy', '0.5', '1', 'taker1'), `Didn't called augur.filterByPriceAndOutcomeAndUserSortByPrice with the expected args`); >>>>>>> } }; it('should calculate trade ids for a Buy', () => { assert.deepEqual(helper.calculateBuyTradeIDs('market1', '1', '0.5', orderBook, 'taker1'), [3, 4], `Didn't return the expected tradeIDs`); assert(mockAugur.augur.filterByPriceAndOutcomeAndUserSortByPrice.calledOnce, `Didn't call augur.filterByPriceAndOutcomeAndUserSortByPrice exactly 1 time as expected`); assert(mockAugur.augur.filterByPriceAndOutcomeAndUserSortByPrice.calledWithExactly({ order3: { id: 3, price: '0.4', outcome: '1', owner: 'owner1' }, order4: { id: 4, price: '0.4', outcome: '1', owner: 'owner1' } }, 'buy', '0.5', '1', 'taker1'), `Didn't called augur.filterByPriceAndOutcomeAndUserSortByPrice with the expected args`);
<<<<<<< import { WrappedBigNumber } from 'utils/wrapped-big-number' ======= import { createBigNumber } from 'utils/create-big-number' >>>>>>> import { createBigNumber } from 'utils/create-big-number' <<<<<<< afterEach(() => { __RewireAPI__.__ResetDependency__('constants', constants) __RewireAPI__.__ResetDependency__('addNewMarketCreationTransactions', addNewMarketCreationTransactions) __RewireAPI__.__ResetDependency__('invalidateMarketCreation', () => (invalidateMarketCreation)) __RewireAPI__.__ResetDependency__('clearNewMarket', () => (clearNewMarket)) }) ======= test({ description: `should submit well formed 'formattedNewMarket' object to 'createScalarMarket' for scalar market`, state: { universe: { id: '1010101', }, contractAddresses: { Cash: 'domnination', }, loginAccount: { meta: { test: 'object', }, address: '0x1233', }, newMarket: { description: 'test description', endTime: { timestamp: 1234567890000, }, expirySource: '', settlementFee: 2, makerFee: 1, designatedReporterAddress: '0x01234abcd', designatedReporterType: DESIGNATED_REPORTER_SPECIFIC, detailsText: '', category: 'test category', tags: [], type: SCALAR, scalarSmallNum: '-10', // String for the test case, normally a BigNumber scalarBigNum: '10', // String for the test case, normally a BigNumber scalarDenomination: '%', tickSize: 1000, }, }, assertions: (store) => { const { submitNewMarket, __RewireAPI__ } = require('modules/create-market/actions/submit-new-market') const mockAugur = { createMarket: { createScalarMarket: () => { } }, } let formattedNewMarket = null sinon.stub(mockAugur.createMarket, 'createScalarMarket').callsFake((createMarketObject) => { delete createMarketObject.onSent delete createMarketObject.onSuccess delete createMarketObject.onFailed formattedNewMarket = createMarketObject }) __RewireAPI__.__Rewire__('augur', mockAugur) >>>>>>> afterEach(() => { __RewireAPI__.__ResetDependency__('constants', constants) __RewireAPI__.__ResetDependency__('addNewMarketCreationTransactions', addNewMarketCreationTransactions) __RewireAPI__.__ResetDependency__('invalidateMarketCreation', () => (invalidateMarketCreation)) __RewireAPI__.__ResetDependency__('clearNewMarket', () => (clearNewMarket)) }) <<<<<<< properties: 'value', orderBook: {}, ======= description: 'test description', endTime: { timestamp: 1234567890000, }, expirySource: '', settlementFee: 2, designatedReporterAddress: false, designatedReporterType: DESIGNATED_REPORTER_SELF, makerFee: 1, detailsText: '', category: 'test category', tags: [], type: BINARY, >>>>>>> properties: 'value', orderBook: {}, <<<<<<< ======= assert.deepEqual(actual, expected, `Didn't dispatch the expected actions`) }, }) test({ description: `should dispatch the expected actions from the 'onFailed' callback`, state: { universe: { id: '1010101', }, contractAddresses: { Cash: 'domnination', }, loginAccount: { meta: { test: 'object', }, address: '0x1233', }, newMarket: { description: 'test description', endTime: { timestamp: 1234567890000, }, expirySource: '', designatedReporterAddress: false, designatedReporterType: DESIGNATED_REPORTER_SELF, settlementFee: 2, makerFee: 1, detailsText: '', category: 'test category', tags: [], type: BINARY, }, }, assertions: (store) => { const { submitNewMarket, __RewireAPI__ } = require('modules/create-market/actions/submit-new-market') __RewireAPI__.__Rewire__('invalidateMarketCreation', () => ({ type: 'invalidateMarketCreation', })) const mockAugur = { createMarket: { createBinaryMarket: (createBinaryMarket) => { createBinaryMarket.onFailed({ message: null }) }, }, } __RewireAPI__.__Rewire__('augur', mockAugur) store.dispatch(submitNewMarket(store.getState().newMarket)) const actual = store.getActions() const expected = [ { type: 'invalidateMarketCreation', }, ] >>>>>>> <<<<<<< newMarket: { properties: 'value', orderBook: {} }, ======= newMarket: { description: 'test description', endTime: { timestamp: 1234567890000, }, expirySource: '', settlementFee: 2, designatedReporterAddress: false, designatedReporterType: DESIGNATED_REPORTER_SELF, makerFee: 1, detailsText: '', category: 'test category', tags: [], type: BINARY, orderBook: {}, }, >>>>>>> newMarket: { properties: 'value', orderBook: {} }, <<<<<<< properties: 'value', ======= description: 'test description', endTime: { timestamp: 1234567890000, }, expirySource: '', settlementFee: 2, makerFee: 1, designatedReporterAddress: false, designatedReporterType: DESIGNATED_REPORTER_SELF, detailsText: '', category: 'test category', tags: [], type: CATEGORICAL, >>>>>>> properties: 'value', <<<<<<< newMarket: { properties: 'value', orderBook: {} }, ======= newMarket: { description: 'test description', endTime: { timestamp: 1234567890000, }, expirySource: '', designatedReporterAddress: false, designatedReporterType: DESIGNATED_REPORTER_SELF, settlementFee: 2, makerFee: 1, detailsText: '', category: 'test category', tags: [], type: BINARY, }, >>>>>>> newMarket: { properties: 'value', orderBook: {} },
<<<<<<< case 4: onCommitFailed({ error: 'commit failed error', message: 'commit failed error message' }); break; case 5: onCommitSuccess({ gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); onTradeSent({ txHash: 'tradeHash1', callReturn: '1' }); onTradeFailed({ error: 'trade failed error', message: 'trade failed error message' }); break; case 6: onCommitSuccess({ gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); onTradeSent({ txHash: 'tradeHash1', callReturn: '1' }); onTradeSuccess({ sharesBought: '20', cashFromTrade: '0', unmatchedShares: '80', unmatchedCash: '160', tradingFees: '0.01', gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); break; case 7: onCommitSuccess({ gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); onTradeSent({ txHash: 'tradeHash1', callReturn: '1' }); onTradeSuccess({ sharesBought: '80', cashFromTrade: '0', unmatchedShares: '0', unmatchedCash: '0', tradingFees: '0.01', gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); break; default: onCommitSuccess({ gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); onTradeSent({ txHash: 'tradeHash1', callReturn: '1' }); onTradeSuccess({ sharesBought: '10', cashFromTrade: '0', unmatchedShares: '0', unmatchedCash: '0', tradingFees: '0.01', gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); break; ======= case 4: onCommitFailed({ error: 'commit failed error', message: 'commit failed error message' }); break; case 5: onCommitSuccess({ gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); onTradeSent({ hash: 'tradeHash1', callReturn: '1' }); onTradeFailed({ error: 'trade failed error', message: 'trade failed error message' }); break; case 6: onCommitSuccess({ gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); onTradeSent({ hash: 'tradeHash1', callReturn: '1' }); onTradeSuccess({ sharesBought: '20', cashFromTrade: '0', unmatchedShares: '80', unmatchedCash: '160', tradingFees: '0.01', gasFees: '0.01450404', hash: 'testhash', timestamp:1500000000 }); break; case 7: onCommitSuccess({ gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); onTradeSent({ hash: 'tradeHash1', callReturn: '1' }); onTradeSuccess({ sharesBought: '80', cashFromTrade: '0', unmatchedShares: '0', unmatchedCash: '0', tradingFees: '0.01', gasFees: '0.01450404', hash: 'testhash', timestamp:1500000000 }); break; default: onCommitSuccess({ gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); onTradeSent({ hash: 'tradeHash1', callReturn: '1' }); onTradeSuccess({ sharesBought: '10', cashFromTrade: '0', unmatchedShares: '0', unmatchedCash: '0', tradingFees: '0.01', gasFees: '0.01450404', hash: 'testhash', timestamp:1500000000 }); break; >>>>>>> case 4: onCommitFailed({ error: 'commit failed error', message: 'commit failed error message' }); break; case 5: onCommitSuccess({ gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); onTradeSent({ hash: 'tradeHash1', callReturn: '1' }); onTradeFailed({ error: 'trade failed error', message: 'trade failed error message' }); break; case 6: onCommitSuccess({ gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); onTradeSent({ hash: 'tradeHash1', callReturn: '1' }); onTradeSuccess({ sharesBought: '20', cashFromTrade: '0', unmatchedShares: '80', unmatchedCash: '160', tradingFees: '0.01', gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); break; case 7: onCommitSuccess({ gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); onTradeSent({ hash: 'tradeHash1', callReturn: '1' }); onTradeSuccess({ sharesBought: '80', cashFromTrade: '0', unmatchedShares: '0', unmatchedCash: '0', tradingFees: '0.01', gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); break; default: onCommitSuccess({ gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); onTradeSent({ hash: 'tradeHash1', callReturn: '1' }); onTradeSuccess({ sharesBought: '10', cashFromTrade: '0', unmatchedShares: '0', unmatchedCash: '0', tradingFees: '0.01', gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); break; <<<<<<< default: onCommitSuccess({ gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); onTradeSent({ txHash: 'tradeHash1', callReturn: '1' }); onTradeSuccess({ sharesBought: '10', cashFromTrade: '0', unmatchedShares: '0', unmatchedCash: '0', tradingFees: '0.01', gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); break; ======= default: onCommitSuccess({ gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); onTradeSent({ hash: 'tradeHash1', callReturn: '1' }); onTradeSuccess({ sharesBought: '10', cashFromTrade: '0', unmatchedShares: '0', unmatchedCash: '0', tradingFees: '0.01', gasFees: '0.01450404', hash: 'testhash', timestamp:1500000000 }); break; >>>>>>> default: onCommitSuccess({ gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); onTradeSent({ hash: 'tradeHash1', callReturn: '1' }); onTradeSuccess({ sharesBought: '10', cashFromTrade: '0', unmatchedShares: '0', unmatchedCash: '0', tradingFees: '0.01', gasFees: '0.01450404', hash: 'testhash', timestamp: 1500000000 }); break;
<<<<<<< import activePage from './modules/app/selectors/active-page'; import abc from './modules/auth/selectors/abc'; ======= import activeView from './modules/app/selectors/active-view'; >>>>>>> import activeView from './modules/app/selectors/active-view'; import abc from './modules/auth/selectors/abc'; <<<<<<< activePage, abc, ======= activeView, >>>>>>> activeView, abc,
<<<<<<< import { loadFullMarket } from "modules/markets/actions/load-full-market"; import { MARKET_ID_PARAM_NAME } from "modules/routes/constants/param-names"; import { selectMarket } from "modules/markets/selectors/market"; ======= import { loadFullMarket } from "modules/market/actions/load-full-market"; import { MARKET_ID_PARAM_NAME, RETURN_PARAM_NAME } from "modules/routes/constants/param-names"; import { selectMarket } from "modules/market/selectors/market"; >>>>>>> import { loadFullMarket } from "modules/markets/actions/load-full-market"; import { MARKET_ID_PARAM_NAME, RETURN_PARAM_NAME } from "modules/routes/constants/param-names"; import { selectMarket } from "modules/markets/selectors/market";
<<<<<<< import { TOOL_CIRCLE, TOOL_LINE, TOOL_BRUSH, TOOL_ERASER, TOOL_PAINT_BUCKET, TOOL_PENCIL, TOOL_SQUARE, TOOL_TRIANGLE, } from './tools.js'; ======= /* eslint-disable no-use-before-define */ /* eslint-disable no-fallthrough */ /* eslint-disable default-case */ /* eslint-disable no-undef */ /* eslint-disable import/extensions */ import { TOOL_CIRCLE, TOOL_LINE, TOOL_BRUSH, TOOL_ERASER, TOOL_PAINT_BUCKET, TOOL_PENCIL, TOOL_SQUARE, TOOL_TRIANGLE, } from './tools.js'; >>>>>>> /* eslint-disable no-use-before-define */ /* eslint-disable no-fallthrough */ /* eslint-disable default-case */ /* eslint-disable no-undef */ /* eslint-disable import/extensions */
<<<<<<< const { logger } = require('./logging/logger'); ======= var roomsTimeout = {} >>>>>>> const { logger } = require('./logging/logger'); var roomsTimeout = {} <<<<<<< logger.warn(`SOCKET: ON CONNECTION: attempting to get managers from redis- failed, socket_id: ${socket.id} emitting dbError now`); socket.emit('dbError'); ======= console.log('Throwing dbError for client', socket.id) socket.emit('dbError') >>>>>>> logger.warn(`SOCKET: ON CONNECTION: attempting to get managers from redis- failed, socket_id: ${socket.id} emitting dbError now`); socket.emit('dbError') <<<<<<< logger.info(`SOCKET: ON CONNECTION: manager found, socket_id: ${socket.id}`); is_incoming_student = false; ======= isIncomingStudent = false; >>>>>>> logger.info(`SOCKET: ON CONNECTION: manager found, socket_id: ${socket.id}`); isIncomingStudent = false; <<<<<<< logger.warn(`SOCKET: ON CONNECTION: manager already exists, socket_id: ${socket.id}, emitting attemptToConnectMultipleManagers now`); ======= console.log('Attempted to have multiple managers'); >>>>>>> logger.info(`SOCKET: ON CONNECTION: manager already exists, socket_id: ${socket.id}, emitting attemptToConnectMultipleManagers now`); <<<<<<< logger.info(`SOCKET: terminateLecture Function Called: room_id: ${roomToJoin}`) ======= console.log(`Ending lecture ${roomToJoin}`) >>>>>>> logger.info(`SOCKET: Lecture ${roomToJoin} terminated`) <<<<<<< logger.info('SOCKET: ON DISCONNECT: trying to find client identity'); ======= console.log(`Manager of room ${roomToJoin} disconnected`) >>>>>>> logger.info(`SOCKET: Manager of room ${roomToJoin} disconnected`); <<<<<<< ======= console.log('Initializing room -> manager joining') >>>>>>> logger.info(`SOCKET: Initializing ${roomToJoin} - manager joined`); <<<<<<< logger.info("SOCKET: start calling all students already in lecture") ======= console.log("Start calling all students already in lecture") >>>>>>> logger.info("SOCKET: start calling all students already in lecture") <<<<<<< is_incoming_student = true; logger.info('SOCKET: student joining room'); roomToJoin = _id; ======= isIncomingStudent = true; console.log(`Student joining room ${roomToJoin}`); roomToJoin = urlUuid; >>>>>>> logger.info(`SOCKET: Student joining room ${roomToJoin}`); isIncomingStudent = true; roomToJoin = urlUuid;
<<<<<<< import Message from './classes/Message.js'; import Chat from './classes/Chat.js'; import { showInfoMessage, handleBoardsViewButtonsDisplay, updateBoardsBadge, } from './utility.js'; window.onload = async () => { const peerjsConfig = await fetch('/peerjs/config').then((r) => r.json()); const peer = new Peer(peerjsConfig); let calls = []; const url = window.location.pathname; const lastSlash = url.lastIndexOf('/'); const managerId = url.substr(lastSlash + 1); const sendContainer = document.getElementById('send-container'); const messageInput = document.getElementById('message-input'); const fileInput = document.getElementById('file-input'); peer.on('open', () => { const getUserMedia = navigator.mediaDevices.getUserMedia || navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; getUserMedia({ audio: true }) .then(startLecture) .catch((error) => { // handle error properly here. console.log(`Media error: ${error}`); }); }); function startLecture(stream) { const whiteboard = new Whiteboard('canvas'); const chat = new Chat('message-container'); function handleWindowResize() { let timeout; let isStartingToResize = true; const inMemCanvas = document.createElement('canvas'); const inMemCtx = inMemCanvas.getContext('2d'); const onResizeDone = () => { whiteboard.canvas.height = window.innerHeight; whiteboard.canvas.width = window.innerWidth; whiteboard.paintWhite(); whiteboard.setCurrentBoard(inMemCanvas); handleBoardsViewButtonsDisplay(); isStartingToResize = true; }; $(window).on('resize', () => { if (isStartingToResize) { inMemCanvas.width = whiteboard.canvas.width; inMemCanvas.height = whiteboard.canvas.height; inMemCtx.drawImage(whiteboard.canvas, 0, 0); isStartingToResize = false; } clearTimeout(timeout); timeout = setTimeout(onResizeDone, 100); }); } handleWindowResize(); stream.addTrack(whiteboard.getStream().getTracks()[0]); const socket = io('/', { query: `id=${managerId}` }); $(window).on('beforeunload', (e) => { e.preventDefault(); socket.disconnect(); }); socket.on('call', (remotePeerId) => { const call = peer.call(remotePeerId, stream); calls.push(call); ======= import { showInfoMessage, appendFile, appendMessage, handleBoardsViewButtonsDisplay, updateBoardsBadge, } from './utility.js'; window.onload = () => { async function beginLecture() { const peerjsConfig = await fetch('/peerjs/config').then((r) => r.json()); const peer = new Peer(peerjsConfig); let calls = []; const url = window.location.pathname; const lastSlash = url.lastIndexOf('/'); const managerId = url.substr(lastSlash + 1); const messageContainer = document.getElementById('message-container'); const sendContainer = document.getElementById('send-container'); const messageInput = document.getElementById('message-input'); const fileInput = document.getElementById('file-input'); peer.on('open', () => { const getUserMedia = navigator.mediaDevices.getUserMedia || navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; getUserMedia({ audio: true }) .then(broadcastLecture) .catch((error) => { // handle error properly here. console.log(`Media error: ${error}`); }); >>>>>>> import Message from './classes/Message.js'; import Chat from './classes/Chat.js'; import { showInfoMessage, handleBoardsViewButtonsDisplay, updateBoardsBadge, } from './utility.js'; window.onload = () => { async function beginLecture() { const peerjsConfig = await fetch('/peerjs/config').then((r) => r.json()); const peer = new Peer(peerjsConfig); let calls = []; const url = window.location.pathname; const lastSlash = url.lastIndexOf('/'); const managerId = url.substr(lastSlash + 1); const sendContainer = document.getElementById('send-container'); const messageInput = document.getElementById('message-input'); const fileInput = document.getElementById('file-input'); peer.on('open', () => { const getUserMedia = navigator.mediaDevices.getUserMedia || navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; getUserMedia({ audio: true }) .then(broadcastLecture) .catch((error) => { // handle error properly here. console.log(`Media error: ${error}`); }); <<<<<<< socket.on('send-to-manager', (message) => { chat.appendMessage(message, true); const messagesDiv = $('div.messages'); if (!messagesDiv.hasClass('active-chat')) { chat.unreadCount += 1; $('.new-messages-badge').html(chat.unreadCount); } }); $('#toggle-messages').click((e) => { e.preventDefault(); const messagesDiv = $('div.messages'); messagesDiv.toggleClass('active-chat'); if (messagesDiv.hasClass('active-chat')) { chat.unreadCount = 0; $('.new-messages-badge').html(chat.unreadCount); } }); ======= socket.on('updateNumOfStudents', (num) => { document.getElementById('specs').innerHTML = num; }); socket.on('send-to-manager', (message, file, fileType, fileName) => { appendMessage(message); if (file) appendFile(file, fileType, fileName, 'receiver'); }); >>>>>>> socket.on('send-to-manager', (message) => { chat.appendMessage(message, true); const messagesDiv = $('div.messages'); if (!messagesDiv.hasClass('active-chat')) { chat.unreadCount += 1; $('.new-messages-badge').html(chat.unreadCount); } }); $('#toggle-messages').click((e) => { e.preventDefault(); const messagesDiv = $('div.messages'); messagesDiv.toggleClass('active-chat'); if (messagesDiv.hasClass('active-chat')) { chat.unreadCount = 0; $('.new-messages-badge').html(chat.unreadCount); } }); socket.on('updateNumOfStudents', (num) => { document.getElementById('specs').innerHTML = num; }); <<<<<<< } ======= } $('#welcome-lecture-modal').show(); $('#modal-select-button').click(() => { // call endpoint to validade session fetch('/session').then((req) => { if (req.status === 200) { beginLecture(); } if (req.status === 401) { window.location.replace('/'); } }); // if valid run the functions below $('#welcome-lecture-modal').hide(); }); >>>>>>> } $('#welcome-lecture-modal').show(); $('#modal-select-button').click(() => { // call endpoint to validade session fetch('/session').then((req) => { if (req.status === 200) { beginLecture(); } if (req.status === 401) { window.location.replace('/'); } }); // if valid run the functions below $('#welcome-lecture-modal').hide(); });
<<<<<<< }else if (command === "add-page"){ //update the image of the current page var canvas = document.getElementById("canvas"); var image = canvas.toDataURL("image/png", 1.0).replace("image.png", "image/octet-stream"); document.querySelector("[data-page].active img").setAttribute("src", image); //remove the active class on the current page and make it the new page document.querySelector("[data-page].active").classList.toggle("active"); // remove the previous active function from the active class //making the new page image var currentPage = document.createElement("img"); //setting the class to item and active var outer = document.createElement("div"); outer.classList.add('item'); outer.classList.add('active'); outer.setAttribute("data-page", "page"); var inner = document.createElement("div"); inner.classList.add('swatch'); inner.style.backgroundColor = "#ffffff"; inner.appendChild(currentPage); outer.appendChild(inner); document.getElementById("pagelist").appendChild(outer); //clear the current canvas paint.clearCanvas(); //ensures the new buttons are clickable document.querySelectorAll("[data-page]").forEach( item => { item.addEventListener("click", e => { var canvas = document.getElementById("canvas"); var image = canvas.toDataURL("image/png", 1.0).replace("image.png", "image/octet-stream"); document.querySelector("[data-page].active img").setAttribute("src", image); document.querySelector("[data-page].active").classList.toggle("active"); // remove the previous active function from the active class item.classList.add("active"); // we add the element we clicked on to the active class var image = document.querySelector("[data-page].active img"); console.log(image.getAttribute("src")); //make the canvass show the current active image paint.clearCanvas(); paint.currentPage(image); }); } ); }else if (command === "remove-page"){ if(document.querySelector("[data-page].active").classList.contains("homePage")){ alert("Cannot delete the first page, you can clear it"); }else{ //document.querySelector("[data-brush-size].active").classList.toggle("active"); // remove the previous active function from the active class document.querySelector("#pagelist").removeChild(document.querySelector("[data-page].active")); document.querySelector("[data-page].homePage").classList.add("active"); // we add the element we clicked on to the active class var image = document.querySelector("[data-page].active img"); //make the canvass show the current active image paint.clearCanvas(); paint.currentPage(image); } }else if (command === "clear-page"){ paint.clearCanvas(); ======= >>>>>>> }else if (command === "add-page"){ //update the image of the current page var canvas = document.getElementById("canvas"); var image = canvas.toDataURL("image/png", 1.0).replace("image.png", "image/octet-stream"); document.querySelector("[data-page].active img").setAttribute("src", image); //remove the active class on the current page and make it the new page document.querySelector("[data-page].active").classList.toggle("active"); // remove the previous active function from the active class //making the new page image var currentPage = document.createElement("img"); //setting the class to item and active var outer = document.createElement("div"); outer.classList.add('item'); outer.classList.add('active'); outer.setAttribute("data-page", "page"); var inner = document.createElement("div"); inner.classList.add('swatch'); inner.style.backgroundColor = "#ffffff"; inner.appendChild(currentPage); outer.appendChild(inner); document.getElementById("pagelist").appendChild(outer); //clear the current canvas paint.clearCanvas(); //ensures the new buttons are clickable document.querySelectorAll("[data-page]").forEach( item => { item.addEventListener("click", e => { var canvas = document.getElementById("canvas"); var image = canvas.toDataURL("image/png", 1.0).replace("image.png", "image/octet-stream"); document.querySelector("[data-page].active img").setAttribute("src", image); document.querySelector("[data-page].active").classList.toggle("active"); // remove the previous active function from the active class item.classList.add("active"); // we add the element we clicked on to the active class var image = document.querySelector("[data-page].active img"); console.log(image.getAttribute("src")); //make the canvass show the current active image paint.clearCanvas(); paint.currentPage(image); }); } ); }else if (command === "remove-page"){ if(document.querySelector("[data-page].active").classList.contains("homePage")){ alert("Cannot delete the first page, you can clear it"); }else{ //document.querySelector("[data-brush-size].active").classList.toggle("active"); // remove the previous active function from the active class document.querySelector("#pagelist").removeChild(document.querySelector("[data-page].active")); document.querySelector("[data-page].homePage").classList.add("active"); // we add the element we clicked on to the active class var image = document.querySelector("[data-page].active img"); //make the canvass show the current active image paint.clearCanvas(); paint.currentPage(image); } }else if (command === "clear-page"){ paint.clearCanvas();
<<<<<<< server: 'https://liteboard.io/janus', ======= server: 'http://localhost:8088/janus', iceServers: [ { urls: 'stun:stun.l.google.com:19302' }, { urls: 'stun:stun1.l.google.com:19302' }, { urls: 'stun:stun2.l.google.com:19302' }, { url: 'stun:stun01.sipphone.com' }, { url: 'stun:stun.ekiga.net' }, { url: 'stun:stunserver.org' }, { url: 'stun:stun.softjoys.com' }, { url: 'stun:stun.voiparound.com' }, { url: 'stun:stun.voipbuster.com' }, { url: 'stun:stun.voipstunt.com' }, { url: 'stun:stun.voxgratia.org' }, { url: 'stun:stun.xten.com' }, ], >>>>>>> server: 'https://liteboard.io/janus', iceServers: [ { urls: 'stun:stun.l.google.com:19302' }, { urls: 'stun:stun1.l.google.com:19302' }, { urls: 'stun:stun2.l.google.com:19302' }, { url: 'stun:stun01.sipphone.com' }, { url: 'stun:stun.ekiga.net' }, { url: 'stun:stunserver.org' }, { url: 'stun:stun.softjoys.com' }, { url: 'stun:stun.voiparound.com' }, { url: 'stun:stun.voipbuster.com' }, { url: 'stun:stun.voipstunt.com' }, { url: 'stun:stun.voxgratia.org' }, { url: 'stun:stun.xten.com' }, ],
<<<<<<< (function(window){ 'use strict'; function PolySprite(pos,color,points){ ======= function Sprite(type, color){ >>>>>>> (function(window){ 'use strict'; function Sprite(type, color){ <<<<<<< window.createImageSprite = createImageSprite; window.createRectSprite = createRectSprite; window.PolySprite = PolySprite; ======= function createPolygonSprite(points,color){ var poly = new Sprite('polygon', color); var vPoints = []; for (var i = 0; i < points.length; i++){ vPoints.push(new SAT.Vector(points[i].x, points[i].y)); } poly.polygon = new SAT.Polygon(new SAT.Vector(0, 0), vPoints); poly.polygon.average = poly.polygon.calculateAverage(); poly.calculateBoundingBox(); return poly; }; function createCircleSprite(x, y, r, color){ var cir = new Sprite('circle', color); cir.circle = new SAT.Circle(new SAT.Vector(x, y), r); cir.calculateBoundingBox(); return cir; }; function createSprite(shape, color){ switch (shape.type){ case 'rect': return createRectSprite({w: shape.w, h: shape}, {x: shape.x, y: shape.y}, color); case 'circle': return createCircleSprite(shape.x, shape.y, shape.r, color); >>>>>>> function createPolygonSprite(points,color){ var poly = new Sprite('polygon', color); var vPoints = []; for (var i = 0; i < points.length; i++){ vPoints.push(new SAT.Vector(points[i].x, points[i].y)); } poly.polygon = new SAT.Polygon(new SAT.Vector(0, 0), vPoints); poly.polygon.average = poly.polygon.calculateAverage(); poly.calculateBoundingBox(); return poly; }; function createCircleSprite(x, y, r, color){ var cir = new Sprite('circle', color); cir.circle = new SAT.Circle(new SAT.Vector(x, y), r); cir.calculateBoundingBox(); return cir; }; function createSprite(shape, color){ switch (shape.type){ case 'rect': return createRectSprite({w: shape.w, h: shape}, {x: shape.x, y: shape.y}, color); case 'circle': return createCircleSprite(shape.x, shape.y, shape.r, color); <<<<<<< ctx.fillStyle = this.color; ctx.beginPath(); ctx.moveTo(this.polygon.points[0].x + this.polygon.pos.x, this.polygon.points[0].y + this.polygon.pos.y); for (var i = this.polygon.points.length - 1; i >= 1; i--) { ctx.lineTo(this.polygon.points[i].x + this.polygon.pos.x, this.polygon.points[i].y + this.polygon.pos.y); }; ctx.closePath(); if (this.image != null && this.image != 'undefined'){ ctx.drawImage(this.image,this.pos.x,this.pos.y,this.size.w,this.size.h); } else{ ctx.fillStyle = this.color; ctx.fill(); } }; function isSpriteClicked(sprite){ if(global.mouse_down){ var pos = {x: global.mouse_x, y: global.mouse_y}; var color = null; var size = {w: 1, h: 1}; var detRect = createRectSprite(size, pos, color); return detRect.collides(sprite); } return false; ======= if(this.image != null){ ctx.save(); ctx.translate(this.getPos().x,this.getPos().y); ctx.rotate( this.facingDegrees *Math.PI/180); ctx.drawImage(this.image, 0, 0,this.size.w,this.size.h); ctx.restore(); }else{ ctx.fillStyle = this.color; ctx.beginPath(); if(this.isPolygon()){ ctx.moveTo(this.polygon.points[0].x + this.polygon.pos.x, this.polygon.points[0].y + this.polygon.pos.y); for (var i = this.polygon.points.length - 1; i >= 1; i--){ ctx.lineTo(this.polygon.points[i].x + this.polygon.pos.x, this.polygon.points[i].y + this.polygon.pos.y); }; }else{ ctx.arc(this.circle.pos.x,this.circle.pos.y,this.circle.r,0,Math.PI*2,true); } ctx.closePath(); ctx.fillStyle = this.color; ctx.fill(); } if(this.text != null){ ctx.fillStyle = this.color; ctx.fill(); ctx.textAlign="center"; var height = this.size.h * 0.6; ctx.font = String(height) +"px Arial"; ctx.fillStyle = this.tColor; ctx.save(); ctx.translate(this.getPos().x ,this.getPos().y ); ctx.rotate( this.facingDegrees *Math.PI/180); ctx.fillText(this.text,this.size.w *0.5,this.size.h *0.6, this.size.w *0.8); ctx.restore(); } >>>>>>> if(this.image != null){ ctx.save(); ctx.translate(this.getPos().x,this.getPos().y); ctx.rotate( this.facingDegrees *Math.PI/180); ctx.drawImage(this.image, 0, 0,this.size.w,this.size.h); ctx.restore(); }else{ ctx.fillStyle = this.color; ctx.beginPath(); if(this.isPolygon()){ ctx.moveTo(this.polygon.points[0].x + this.polygon.pos.x, this.polygon.points[0].y + this.polygon.pos.y); for (var i = this.polygon.points.length - 1; i >= 1; i--){ ctx.lineTo(this.polygon.points[i].x + this.polygon.pos.x, this.polygon.points[i].y + this.polygon.pos.y); }; }else{ ctx.arc(this.circle.pos.x,this.circle.pos.y,this.circle.r,0,Math.PI*2,true); } ctx.closePath(); ctx.fillStyle = this.color; ctx.fill(); } if(this.text != null){ ctx.fillStyle = this.color; ctx.fill(); ctx.textAlign="center"; var height = this.size.h * 0.6; ctx.font = String(height) +"px Arial"; ctx.fillStyle = this.tColor; ctx.save(); ctx.translate(this.getPos().x ,this.getPos().y ); ctx.rotate( this.facingDegrees *Math.PI/180); ctx.fillText(this.text,this.size.w *0.5,this.size.h *0.6, this.size.w *0.8); ctx.restore(); }
<<<<<<< Event.on('.content', 'mousemove', null, drag); Event.on(document.body, 'mouseup', null, endDrag); ======= Event.on(document, 'mousemove', null, drag); Event.on('.content', 'mouseup', null, endDrag); >>>>>>> Event.on(document, 'mousemove', null, drag); Event.on(document.body, 'mouseup', null, endDrag);
<<<<<<< scratchpad = document.querySelector('.scratchpad'); ======= var scratchpad= document.querySelector('.scratchpad'); // <- WB >>>>>>> var scratchpad= document.querySelector('.scratchpad'); // <- WB <<<<<<< Event.on('.content', 'touchstart', '.block', initDrag); Event.on('.content', 'touchmove', null, drag); Event.on('.content', 'touchend', null, endDrag); // TODO: A way to cancel touch drag? Event.on('.content', 'mousedown', '.block', initDrag); Event.on('.content', 'mousemove', null, drag); Event.on(document.body, 'mouseup', null, endDrag); Event.on(document.body, 'keyup', null, cancelDrag); ======= if (Event.isTouch){ Event.on('.content', 'touchstart', '.block', initDrag); Event.on('.content', 'touchmove', null, drag); Event.on('.content', 'touchend', null, endDrag); // TODO: A way to cancel the drag? // Event.on('.scripts_workspace', 'tap', '.socket', selectSocket); }else{ Event.on('.content', 'mousedown', '.block', initDrag); Event.on(document.body, 'mousemove', null, drag); Event.on('.content', 'mouseup', null, endDrag); Event.on(document.body, 'keyup', null, cancelDrag); // Event.on('.scripts_workspace', 'click', '.socket', selectSocket); } >>>>>>> Event.on('.content', 'touchstart', '.block', initDrag); Event.on('.content', 'touchmove', null, drag); Event.on('.content', 'touchend', null, endDrag); // TODO: A way to cancel touch drag? Event.on('.content', 'mousedown', '.block', initDrag); Event.on('.content', 'mousemove', null, drag); Event.on(document.body, 'mouseup', null, endDrag); Event.on(document.body, 'keyup', null, cancelDrag); <<<<<<< var workspace = document.querySelector('.scripts_workspace') ======= var workspace = document.querySelector('.workspace > .scripts_workspace') var path = location.href.split('?')[0]; history.pushState(null, '', path); >>>>>>> var workspace = document.querySelector('.scripts_workspace') var path = location.href.split('?')[0]; history.pushState(null, '', path);
<<<<<<< "ember/no-classic-components": "off", ======= "ember/no-computed-properties-in-native-classes": "off", >>>>>>> "ember/no-classic-components": "off", "ember/no-computed-properties-in-native-classes": "off",
<<<<<<< 'no-classic-components': require('./rules/no-classic-components'), ======= 'no-computed-properties-in-native-classes': require('./rules/no-computed-properties-in-native-classes'), >>>>>>> 'no-classic-components': require('./rules/no-classic-components'), 'no-computed-properties-in-native-classes': require('./rules/no-computed-properties-in-native-classes'),
<<<<<<< isComputedProp: isComputedProp, ======= isCustomProp: isCustomProp, isActionsProp: isActionsProp, isModelProp: isModelProp, isRelation: isRelation, >>>>>>> isComputedProp: isComputedProp, isCustomProp: isCustomProp, isActionsProp: isActionsProp, isModelProp: isModelProp, isRelation: isRelation, <<<<<<< function isComputedProp(node) { return isModule(node, 'computed'); } ======= function isCustomProp(property) { var value = property.value; var isCustomObjectProp = utils.isObjectExpression(property.value) && property.key.name !== 'actions'; return utils.isLiteral(value) || utils.isIdentifier(value) || utils.isArrayExpression(value) || isCustomObjectProp; } function isModelProp(property) { return property.key.name === 'model' && utils.isFunctionExpression(property.value); } function isActionsProp(property) { return property.key.name === 'actions' && utils.isObjectExpression(property.value); } >>>>>>> function isComputedProp(node) { return isModule(node, 'computed'); } function isCustomProp(property) { var value = property.value; var isCustomObjectProp = utils.isObjectExpression(property.value) && property.key.name !== 'actions'; return utils.isLiteral(value) || utils.isIdentifier(value) || utils.isArrayExpression(value) || isCustomObjectProp; } function isModelProp(property) { return property.key.name === 'model' && utils.isFunctionExpression(property.value); } function isActionsProp(property) { return property.key.name === 'actions' && utils.isObjectExpression(property.value); }
<<<<<<< constructor() { ======= constructor (...args) { >>>>>>> constructor() { <<<<<<< run(argvs) { ======= run (uCmds) { const argvs = uCmds || this.argvs >>>>>>> run(uCmds) { const argvs = uCmds || this.argvs <<<<<<< init() { // is fbi or not // get user config try { let _path = this._.cwd(this.cfg.paths.options) fs.accessSync(_path, fs.R_OK | fs.W_OK) this.isFbi = true let usrCfg = require(_path) this._.merge(this.cfg, usrCfg) } catch (e) { this.isFbi = false ======= let difference = cmds.concat(cmdsExecuted).filter(v => !cmds.includes(v) || !cmdsExecuted.includes(v)) if (difference.length) { this._.log(`Error: Commands '${difference}' not found.`) >>>>>>> let difference = cmds.concat(cmdsExecuted).filter(v => !cmds.includes(v) || !cmdsExecuted.includes(v)) if (difference.length) { this._.log(`Error: Commands '${difference}' not found.`) <<<<<<< addTask(task) { if (Array.isArray(task)) { this.tasks = this.tasks.concat(task) } else { this.tasks.push(task) } ======= addTask (task) { Array.isArray(task) ? this.tasks = this.tasks.concat(task) : this.tasks.push(task) >>>>>>> addTask(task) { Array.isArray(task) ? this.tasks = this.tasks.concat(task) : this.tasks.push(task)
<<<<<<< var accessToken = ""; // Try to load local Access Token from .env file if env variable is not present if (!process.env.FEBL_ACCESS_TOKEN) { var env = fs.readFileSync(path.join(__dirname, "../", ".env"), "utf8").split("="); accessToken = env[1]; } else { accessToken = process.env.FEBL_ACCESS_TOKEN; } ======= var accessToken = process.env.ACCESS_TOKEN; >>>>>>> var accessToken = process.env.FEBL_ACCESS_TOKEN;
<<<<<<< window.ondeviceorientation = undefined ======= window.ondevicemotion = undefined if (opts && typeof opts.clearLayers === 'boolean' && opts.clearLayers) layers = [] >>>>>>> window.ondeviceorientation = undefined if (opts && typeof opts.clearLayers === 'boolean' && opts.clearLayers) layers = []
<<<<<<< ======= // By default use sticky reconnects _stickyReconnect = _cometd.getConfiguration().stickyReconnect !== false; var protocol = _cometd.getConfiguration().protocol; var webSocket = protocol ? new org.cometd.WebSocket(url, protocol) : new org.cometd.WebSocket(url); >>>>>>> _stickyReconnect = _cometd.getConfiguration().stickyReconnect !== false; <<<<<<< this._debug('Transport', this.getType(), 'opened', webSocket); _webSocket = webSocket; _webSocketSupported = true; ======= this._debug('Transport', this.getType(), 'opened', _webSocket); _opened = true; _webSocketConnected = true; >>>>>>> this._debug('Transport', this.getType(), 'opened', webSocket); _webSocket = webSocket; _webSocketConnected = true; <<<<<<< // This close event could be due to server shutdown, // and if it restarts we want to try websocket again _supportsWebSocket = _webSocketSupported; ======= // This close event could be due to server shutdown, and if it restarts we want to try websocket again _webSocketSupported = _stickyReconnect && _webSocketConnected; >>>>>>> // This close event could be due to server shutdown, // and if it restarts we want to try websocket again _webSocketSupported = _stickyReconnect && _webSocketConnected; <<<<<<< _supportsWebSocket = true; _webSocketSupported = false; ======= if (_opened) { this.webSocketClose(_webSocket, 1000, 'Reset'); } _webSocketSupported = true; _webSocketConnected = false; >>>>>>> _webSocketSupported = true; _webSocketConnected = false;
<<<<<<< returns: { blocktype: 'expression', label: 'imageData##', script: 'local.imageData##', type: 'imagedata' }, ======= locals: [ { blocktype: 'expression', labels: ['imageData##'], script: 'local.imageData##', type: 'imagedata' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'imageData##', script: 'local.imageData##', type: 'imagedata' } ], <<<<<<< returns: { blocktype: 'expression', label: 'imageData##', script: 'local.imageData##', type: 'imagedata' }, ======= locals: [ { blocktype: 'expression', labels: ['imageData##'], script: 'local.imageData##', type: 'imagedata' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'imageData##', script: 'local.imageData##', type: 'imagedata' } ], <<<<<<< returns: { blocktype: 'expression', label: 'imageData##', script: 'local.imageData##', type: 'imagedata' }, ======= locals: [ { blocktype: 'expression', labels: ['imageData##'], script: 'local.imageData##', type: 'imagedata' } ], >>>>>>> locals: [ { blocktype: 'expression', label: 'imageData##', script: 'local.imageData##', type: 'imagedata' } ], <<<<<<< returns: { blocktype: 'expression', label: 'radial gradient##', script: 'local.gradient##', type: 'gradient' } ======= locals: [ { blocktype: 'expression', labels: ['radial gradient##'], script: 'local.gradient##', type: 'gradient' } ] >>>>>>> locals: [ { blocktype: 'expression', label: 'radial gradient##', script: 'local.gradient##', type: 'gradient' } ] <<<<<<< returns: { blocktype: 'expression', label: 'linear gradient##', script: 'local.linear.gradient##', type: 'gradient' } ======= locals: [ { blocktype: 'expression', labels: ['linear gradient##'], script: 'local.linear.gradient##', type: 'gradient' } ] >>>>>>> locals: [ { blocktype: 'expression', label: 'linear gradient##', script: 'local.linear.gradient##', type: 'gradient' } ] <<<<<<< returns: { blocktype: 'expression', label: 'pattern##', script: 'local.pattern##', type: 'pattern' } ======= locals: [ { blocktype: 'expression', labels: ['pattern##'], script: 'local.pattern##', type: 'pattern' } ] >>>>>>> locals: [ { blocktype: 'expression', label: 'pattern##', script: 'local.pattern##', type: 'pattern' } ] <<<<<<< // returns: { // blocktype: 'expression', // label: 'pattern##', // script: 'local.pattern##', // type: 'pattern' // } ======= // locals: [ // { // blocktype: 'expression', // labels: ['pattern##'], // script: 'local.pattern##', // type: 'pattern' // } // ] >>>>>>> // locals: [ // { // blocktype: 'expression', // label: 'pattern##', // script: 'local.pattern##', // type: 'pattern' // } // ] <<<<<<< // returns: { // blocktype: 'expression', // label: 'pattern##', // script: 'local.pattern##', // type: 'pattern' ======= // locals: [ // { // blocktype: 'expression', // labels: ['pattern##'], // script: 'local.pattern##', // type: 'pattern' // } >>>>>>> // locals: [ // { // blocktype: 'expression', // label: 'pattern##', // script: 'local.pattern##', // type: 'pattern' // }
<<<<<<< unlinkAccount (psid, cb) { return request({ method: 'POST', uri: 'https://graph.facebook.com/v2.6/me/unlink_accounts', qs: this._getQs(), json: { psid: psid } }) .then(body => { if (body.error) return Promise.reject(body.error) if (!cb) return body cb(null, body) }) .catch(err => { if (!cb) return Promise.reject(err) cb(err) }) } ======= getAttachmentUploadId (url, isReusable, type, cb) { return request({ method: 'POST', uri: 'https://graph.facebook.com/v2.6/me/message_attachments', qs: this._getQs(), json: { message: { attachment: { type: type, payload: { is_reusable: isReusable, url: url } } } } }) .then(body => { if (body.error) return Promise.reject(body.error) if (!cb) return body cb(null, body) }) .catch(err => { if (!cb) return Promise.reject(err) cb(err) }) } >>>>>>> unlinkAccount (psid, cb) { return request({ method: 'POST', uri: 'https://graph.facebook.com/v2.6/me/unlink_accounts', qs: this._getQs(), json: { psid: psid } }) .then(body => { if (body.error) return Promise.reject(body.error) if (!cb) return body cb(null, body) }) .catch(err => { if (!cb) return Promise.reject(err) cb(err) }) } getAttachmentUploadId (url, isReusable, type, cb) { return request({ method: 'POST', uri: 'https://graph.facebook.com/v2.6/me/message_attachments', qs: this._getQs(), json: { message: { attachment: { type: type, payload: { is_reusable: isReusable, url: url } } } } }) .then(body => { if (body.error) return Promise.reject(body.error) if (!cb) return body cb(null, body) }) .catch(err => { if (!cb) return Promise.reject(err) cb(err) }) }
<<<<<<< // initSearch() ======= >>>>>>> <<<<<<< * Swiftype search box */ // function initSearch () { // [ // '#search-query-nav', // '#search-query-sidebar' // ].forEach(function (selector) { // if (!document.querySelector(selector)) return // docsearch({ // appId: 'BH4D9OD16A', // apiKey: '85cc3221c9f23bfbaa4e3913dd7625ea', // indexName: 'vuejs', // inputSelector: selector // }) // }) // } /** ======= >>>>>>>
<<<<<<< catalogueUrl = "http://192.168.99.101:32770"; accountsUrl = "http://192.168.99.101:32768/accounts"; cartsUrl = "http://192.168.99.103:32773/carts"; itemsUrl = "http://192.168.99.102:32773/items"; ordersUrl = "http://192.168.99.101:32770/orders"; customersUrl = "http://192.168.99.101:32768/customers"; addressUrl = "http://192.168.99.101:32768/addresses"; cardsUrl = "http://192.168.99.101:32768/cards"; loginUrl = "http://192.168.99.103:32769/login"; registerUrl = "http://localhost:8084/register"; tagsUrl = catalogueUrl + "/tags"; ======= request = request.defaults({proxy: "http://192.168.99.101:8888"}) >>>>>>> catalogueUrl = "http://192.168.99.101:32770"; accountsUrl = "http://192.168.99.101:32768/accounts"; cartsUrl = "http://192.168.99.103:32773/carts"; itemsUrl = "http://192.168.99.102:32773/items"; ordersUrl = "http://192.168.99.101:32770/orders"; customersUrl = "http://192.168.99.101:32768/customers"; addressUrl = "http://192.168.99.101:32768/addresses"; cardsUrl = "http://192.168.99.101:32768/cards"; loginUrl = "http://192.168.99.103:32769/login"; registerUrl = "http://localhost:8084/register"; tagsUrl = catalogueUrl + "/tags"; request = request.defaults({proxy: "http://192.168.99.101:8888"})
<<<<<<< if (current.items) { const hoverItemIndex = current.items.findIndex((item) => item.value === current.selectedItem.value); ======= if (current.items && !current.isMulti) { const hoverItemIndex = current.items.findIndex((item) => item.value === current.selectedValue.value); >>>>>>> if (current.items && !current.isMulti) { const hoverItemIndex = current.items.findIndex((item) => item[current.optionIdentifier] === current.selectedValue[current.optionIdentifier]); <<<<<<< if (changed.hoverItemIndex || changed.items || changed.selectedItem || changed.optionIdentifier || changed.Item || changed.getOptionLabel || changed.noOptionsMessage) { ======= if (changed.hoverItemIndex || changed.items || changed.selectedValue || changed.Item || changed.getOptionLabel) { >>>>>>> if (changed.hoverItemIndex || changed.items || changed.selectedValue || changed.optionIdentifier || changed.Item || changed.getOptionLabel || changed.noOptionsMessage) { <<<<<<< div.className = div_class_value = "listItem " + itemClasses(ctx.hoverItemIndex, ctx.item, ctx.i, ctx.items, ctx.selectedItem, ctx.optionIdentifier) + " svelte-1q7fygl"; ======= div.className = div_class_value = "listItem " + itemClasses(ctx.hoverItemIndex, ctx.item, ctx.i, ctx.items, ctx.selectedValue) + " svelte-1h82xdc"; >>>>>>> div.className = div_class_value = "listItem " + itemClasses(ctx.hoverItemIndex, ctx.item, ctx.i, ctx.items, ctx.selectedValue, ctx.optionIdentifier) + " svelte-1q7fygl"; <<<<<<< if ((changed.hoverItemIndex || changed.items || changed.selectedItem || changed.optionIdentifier) && div_class_value !== (div_class_value = "listItem " + itemClasses(ctx.hoverItemIndex, ctx.item, ctx.i, ctx.items, ctx.selectedItem, ctx.optionIdentifier) + " svelte-1q7fygl")) { ======= if ((changed.hoverItemIndex || changed.items || changed.selectedValue) && div_class_value !== (div_class_value = "listItem " + itemClasses(ctx.hoverItemIndex, ctx.item, ctx.i, ctx.items, ctx.selectedValue) + " svelte-1h82xdc")) { >>>>>>> if ((changed.hoverItemIndex || changed.items || changed.selectedValue || changed.optionIdentifier) && div_class_value !== (div_class_value = "listItem " + itemClasses(ctx.hoverItemIndex, ctx.item, ctx.i, ctx.items, ctx.selectedValue, ctx.optionIdentifier) + " svelte-1q7fygl")) { <<<<<<< autoFocus: false, containerStyles: undefined, ======= Item, Selection, MultiSelection, >>>>>>> containerStyles: undefined, Item, Selection, MultiSelection, <<<<<<< optionIdentifier: 'value', ======= groupFilter: (groups) => groups, >>>>>>> optionIdentifier: 'value', groupBy: undefined, getOptions: undefined, loadOptionsInterval: 200, noOptionsMessage: 'No options', groupFilter: (groups) => groups, <<<<<<< placeholder: 'Select...', groupBy: undefined, groupFilter: (groups) => groups, getOptions: undefined, loadOptionsInterval: 200, noOptionsMessage: 'No options' ======= >>>>>>> <<<<<<< if(current.loadOptions) { clearTimeout(this.loadOptionsTimeout); this.set({isWaiting:true}); this.loadOptionsTimeout = setTimeout(() => { if(current.filterText) { current.loadOptions(current.filterText).then((response) => { this.set({ items: response }); }); } else { this.set({ items: [] }); } this.set({isWaiting:false}); this.set({listOpen: true}); }, current.loadOptionsInterval); } else { this.loadList(); this.set({listOpen: true}); } ======= this.loadList(); this.set({listOpen: true}); if (current.isMulti) { this.set({activeSelectedValue: undefined}); } >>>>>>> if(current.loadOptions) { clearTimeout(this.loadOptionsTimeout); this.set({isWaiting:true}); this.loadOptionsTimeout = setTimeout(() => { if(current.filterText) { current.loadOptions(current.filterText).then((response) => { this.set({ items: response }); }); } else { this.set({ items: [] }); } this.set({isWaiting:false}); this.set({listOpen: true}); }, current.loadOptionsInterval); } else { this.loadList(); this.set({listOpen: true}); if (current.isMulti) { this.set({activeSelectedValue: undefined}); } } <<<<<<< function create_main_fragment$4(component, ctx) { var div, input, input_updating = false, input_readonly_value, text0, text1, text2, div_class_value; ======= function create_main_fragment$4(component, ctx) { var div, text0, input, input_updating = false, input_readonly_value, text1, text2, text3, text4; >>>>>>> function create_main_fragment$5(component, ctx) { var div, text0, input, input_updating = false, input_readonly_value, text1, text2, text3, text4; <<<<<<< if (!document.getElementById("svelte-1r3r83f-style")) add_css$2(); ======= if (!document.getElementById("svelte-84hful-style")) add_css$2(); >>>>>>> if (!document.getElementById("svelte-84hful-style")) add_css$3(); <<<<<<< function add_css$6() { ======= function add_css$8() { >>>>>>> function add_css$9() { <<<<<<< function create_main_fragment$8(component, ctx) { ======= function create_main_fragment$a(component, ctx) { >>>>>>> function create_main_fragment$b(component, ctx) { var link, text, div_10; return { c() { link = createElement("link"); text = createText("\n\n"); div_10 = createElement("div"); div_10.innerHTML = `<div class="listItem hover svelte-mj7ksi"><div class="item">Chocolate</div></div> <div class="listItem svelte-mj7ksi"><div class="item">Pizza</div></div> <div class="listItem svelte-mj7ksi"><div class="item">Cake</div></div> <div class="listItem svelte-mj7ksi"><div class="item">Chips</div></div> <div class="listItem svelte-mj7ksi"><div class="item">Ice Cream</div></div>`; link.rel = "stylesheet"; link.href = "../reset.css"; div_10.className = "listContainer svelte-mj7ksi"; }, m(target, anchor) { insert(target, link, anchor); insert(target, text, anchor); insert(target, div_10, anchor); }, p: noop, d(detach) { if (detach) { detachNode(link); detachNode(text); detachNode(div_10); } } }; } function List_default(options) { init(this, options); this._state = assign({}, options.data); this._intro = true; if (!document.getElementById("svelte-mj7ksi-style")) add_css$9(); this._fragment = create_main_fragment$b(this, this._state); if (options.target) { this._fragment.c(); this._mount(options.target, options.anchor); } } assign(List_default.prototype, proto); /* test/src/List/List--empty.html generated by Svelte v2.15.3 */ function add_css$a() { var style = createElement("style"); style.id = 'svelte-1padgs0-style'; style.textContent = ".listContainer.svelte-1padgs0{box-shadow:0 2px 3px 0 rgba(44, 62, 80, 0.24);border-radius:4px;max-height:176px;overflow-y:auto}.empty.svelte-1padgs0{text-align:center;padding:20px 0;color:#78848F}"; append(document.head, style); } function create_main_fragment$c(component, ctx) { var link, text, div_1; return { c() { link = createElement("link"); text = createText("\n\n"); div_1 = createElement("div"); div_1.innerHTML = `<div class="empty svelte-1padgs0">No options</div>`; link.rel = "stylesheet"; link.href = "../reset.css"; div_1.className = "listContainer svelte-1padgs0"; }, m(target, anchor) { insert(target, link, anchor); insert(target, text, anchor); insert(target, div_1, anchor); }, p: noop, d(detach) { if (detach) { detachNode(link); detachNode(text); detachNode(div_1); } } }; } function List_empty(options) { init(this, options); this._state = assign({}, options.data); this._intro = true; if (!document.getElementById("svelte-1padgs0-style")) add_css$a(); this._fragment = create_main_fragment$c(this, this._state); if (options.target) { this._fragment.c(); this._mount(options.target, options.anchor); } } assign(List_empty.prototype, proto); /* test/src/List/List--grouped.html generated by Svelte v2.15.3 */ function add_css$b() { var style = createElement("style"); style.id = 'svelte-66i8ah-style'; style.textContent = ".listContainer.svelte-66i8ah{box-shadow:0 2px 3px 0 rgba(44, 62, 80, 0.24);border-radius:4px;height:176px;overflow-y:auto}.listGroupTitle.svelte-66i8ah{color:#8f8f8f;cursor:default;font-size:12px;height:40px;line-height:40px;padding:0 20px;text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap;text-transform:uppercase}.listItem.svelte-66i8ah{padding:20px}.listItem.svelte-66i8ah:hover,.listItem.hover.svelte-66i8ah{background:#e7f2ff}.listItem.svelte-66i8ah:first-child{border-radius:4px 4px 0 0}"; append(document.head, style); } function create_main_fragment$d(component, ctx) { var link, text, div_12; return { c() { link = createElement("link"); text = createText("\n\n"); div_12 = createElement("div"); div_12.innerHTML = `<div class="listGroupTitle svelte-66i8ah">Sweet</div> <div class="listItem hover svelte-66i8ah"><div class="item">Chocolate</div></div> <div class="listItem svelte-66i8ah"><div class="item">Cake</div></div> <div class="listItem svelte-66i8ah"><div class="item">Ice Cream</div></div> <div class="listGroupTitle svelte-66i8ah">Savory</div> <div class="listItem svelte-66i8ah"><div class="item">Pizza</div></div> <div class="listItem svelte-66i8ah"><div class="item">Chips</div></div>`; link.rel = "stylesheet"; link.href = "../reset.css"; div_12.className = "listContainer svelte-66i8ah"; }, m(target, anchor) { insert(target, link, anchor); insert(target, text, anchor); insert(target, div_12, anchor); }, p: noop, d(detach) { if (detach) { detachNode(link); detachNode(text); detachNode(div_12); } } }; } function List_grouped(options) { init(this, options); this._state = assign({}, options.data); this._intro = true; if (!document.getElementById("svelte-66i8ah-style")) add_css$b(); this._fragment = create_main_fragment$d(this, this._state); if (options.target) { this._fragment.c(); this._mount(options.target, options.anchor); } } assign(List_grouped.prototype, proto); /* test/src/List/List--groupedFiltered.html generated by Svelte v2.15.3 */ function add_css$c() { var style = createElement("style"); style.id = 'svelte-66i8ah-style'; style.textContent = ".listContainer.svelte-66i8ah{box-shadow:0 2px 3px 0 rgba(44, 62, 80, 0.24);border-radius:4px;height:176px;overflow-y:auto}.listGroupTitle.svelte-66i8ah{color:#8f8f8f;cursor:default;font-size:12px;height:40px;line-height:40px;padding:0 20px;text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap;text-transform:uppercase}.listItem.svelte-66i8ah{padding:20px}.listItem.svelte-66i8ah:hover,.listItem.hover.svelte-66i8ah{background:#e7f2ff}.listItem.svelte-66i8ah:first-child{border-radius:4px 4px 0 0}"; append(document.head, style); } function create_main_fragment$e(component, ctx) { <<<<<<< /* test/src/List/List--empty.html generated by Svelte v2.15.3 */ function add_css$a() { var style = createElement("style"); style.id = 'svelte-1padgs0-style'; style.textContent = ".listContainer.svelte-1padgs0{box-shadow:0 2px 3px 0 rgba(44, 62, 80, 0.24);border-radius:4px;max-height:176px;overflow-y:auto}.empty.svelte-1padgs0{text-align:center;padding:20px 0;color:#78848F}"; append(document.head, style); } function create_main_fragment$c(component, ctx) { var link, text, div_1; return { c() { link = createElement("link"); text = createText("\n\n"); div_1 = createElement("div"); div_1.innerHTML = `<div class="empty svelte-1padgs0">No options</div>`; link.rel = "stylesheet"; link.href = "../reset.css"; div_1.className = "listContainer svelte-1padgs0"; }, m(target, anchor) { insert(target, link, anchor); insert(target, text, anchor); insert(target, div_1, anchor); }, p: noop, d(detach) { if (detach) { detachNode(link); detachNode(text); detachNode(div_1); } } }; } function List_empty(options) { init(this, options); this._state = assign({}, options.data); this._intro = true; if (!document.getElementById("svelte-1padgs0-style")) add_css$a(); this._fragment = create_main_fragment$c(this, this._state); if (options.target) { this._fragment.c(); this._mount(options.target, options.anchor); } } assign(List_empty.prototype, proto); ======= >>>>>>> <<<<<<< function add_css$b() { ======= function add_css$d() { >>>>>>> function add_css$e() { <<<<<<< function create_main_fragment$e(component, ctx) { var div, select_updating = {}, text0, p, text1_value = ctx.selectedItem.label, text1; ======= function create_main_fragment$g(component, ctx) { var div, select_updating = {}, text0, p, text1_value = ctx.selectedValue.label, text1; >>>>>>> function create_main_fragment$h(component, ctx) { var div, select_updating = {}, text0, p, text1_value = ctx.selectedValue.label, text1; <<<<<<< this._fragment = create_main_fragment$e(this, this._state); ======= this._fragment = create_main_fragment$g(this, this._state); >>>>>>> this._fragment = create_main_fragment$h(this, this._state);
<<<<<<< if (current.items) { const hoverItemIndex = current.items.findIndex((item) => item.value === current.selectedItem.value); ======= if (current.items && !current.isMulti) { const hoverItemIndex = current.items.findIndex((item) => item.value === current.selectedValue.value); >>>>>>> if (current.items && !current.isMulti) { const hoverItemIndex = current.items.findIndex((item) => item[current.optionIdentifier] === current.selectedValue[current.optionIdentifier]); <<<<<<< if (changed.hoverItemIndex || changed.items || changed.selectedItem || changed.optionIdentifier || changed.Item || changed.getOptionLabel || changed.noOptionsMessage) { ======= if (changed.hoverItemIndex || changed.items || changed.selectedValue || changed.Item || changed.getOptionLabel) { >>>>>>> if (changed.hoverItemIndex || changed.items || changed.selectedValue || changed.optionIdentifier || changed.Item || changed.getOptionLabel || changed.noOptionsMessage) { <<<<<<< div.className = div_class_value = "listItem " + itemClasses(ctx.hoverItemIndex, ctx.item, ctx.i, ctx.items, ctx.selectedItem, ctx.optionIdentifier) + " svelte-1q7fygl"; ======= div.className = div_class_value = "listItem " + itemClasses(ctx.hoverItemIndex, ctx.item, ctx.i, ctx.items, ctx.selectedValue) + " svelte-1h82xdc"; >>>>>>> div.className = div_class_value = "listItem " + itemClasses(ctx.hoverItemIndex, ctx.item, ctx.i, ctx.items, ctx.selectedValue, ctx.optionIdentifier) + " svelte-1q7fygl"; <<<<<<< if ((changed.hoverItemIndex || changed.items || changed.selectedItem || changed.optionIdentifier) && div_class_value !== (div_class_value = "listItem " + itemClasses(ctx.hoverItemIndex, ctx.item, ctx.i, ctx.items, ctx.selectedItem, ctx.optionIdentifier) + " svelte-1q7fygl")) { ======= if ((changed.hoverItemIndex || changed.items || changed.selectedValue) && div_class_value !== (div_class_value = "listItem " + itemClasses(ctx.hoverItemIndex, ctx.item, ctx.i, ctx.items, ctx.selectedValue) + " svelte-1h82xdc")) { >>>>>>> if ((changed.hoverItemIndex || changed.items || changed.selectedValue || changed.optionIdentifier) && div_class_value !== (div_class_value = "listItem " + itemClasses(ctx.hoverItemIndex, ctx.item, ctx.i, ctx.items, ctx.selectedValue, ctx.optionIdentifier) + " svelte-1q7fygl")) { <<<<<<< autoFocus: false, containerStyles: undefined, ======= Item, Selection, MultiSelection, >>>>>>> containerStyles: undefined, Item, Selection, MultiSelection, <<<<<<< optionIdentifier: 'value', ======= groupFilter: (groups) => groups, >>>>>>> optionIdentifier: 'value', groupBy: undefined, getOptions: undefined, loadOptionsInterval: 200, noOptionsMessage: 'No options', groupFilter: (groups) => groups, <<<<<<< placeholder: 'Select...', groupBy: undefined, groupFilter: (groups) => groups, getOptions: undefined, loadOptionsInterval: 200, noOptionsMessage: 'No options' ======= >>>>>>> <<<<<<< if(current.loadOptions) { clearTimeout(this.loadOptionsTimeout); this.set({isWaiting:true}); this.loadOptionsTimeout = setTimeout(() => { if(current.filterText) { current.loadOptions(current.filterText).then((response) => { this.set({ items: response }); }); } else { this.set({ items: [] }); } this.set({isWaiting:false}); this.set({listOpen: true}); }, current.loadOptionsInterval); } else { this.loadList(); this.set({listOpen: true}); } ======= this.loadList(); this.set({listOpen: true}); if (current.isMulti) { this.set({activeSelectedValue: undefined}); } >>>>>>> if(current.loadOptions) { clearTimeout(this.loadOptionsTimeout); this.set({isWaiting:true}); this.loadOptionsTimeout = setTimeout(() => { if(current.filterText) { current.loadOptions(current.filterText).then((response) => { this.set({ items: response }); }); } else { this.set({ items: [] }); } this.set({isWaiting:false}); this.set({listOpen: true}); }, current.loadOptionsInterval); } else { this.loadList(); this.set({listOpen: true}); if (current.isMulti) { this.set({activeSelectedValue: undefined}); } }
<<<<<<< if (DEBUG) { //conn_log("active_game message:", JSON.stringify(gamedata, null, 4)); } if (gamedata.phase == 'stone removal' ======= // OGS auto scores bot games now, no removal processing is needed by the bot. // /* if (gamedata.phase == 'stone removal' >>>>>>> if (DEBUG) { //conn_log("active_game message:", JSON.stringify(gamedata, null, 4)); } // OGS auto scores bot games now, no removal processing is needed by the bot. // /* if (gamedata.phase == 'stone removal'
<<<<<<< if (this.processing) { this.processing = false; --moves_processing; if (argv.corrqueue && this.state.time_control.speed == "correspondence") { --corr_moves_processing; } } ======= if (argv.farewell && this.state != null && this.state.game_id != null) { this.sendChat(FAREWELL, "discussion"); } >>>>>>> if (this.processing) { this.processing = false; --moves_processing; if (argv.corrqueue && this.state.time_control.speed == "correspondence") { --corr_moves_processing; } } if (argv.farewell && this.state != null && this.state.game_id != null) { this.sendChat(FAREWELL, "discussion"); }
<<<<<<< '_Terms_of_Service':'terms of service', '_SG_delete_header':'Are you sure you want to delete this surveygroup?', '_SG_delete_message':'This cannot be undone.' ======= '_Terms_of_Service':'terms of service', '_Current_Devices_List':'Current Devices List', '_Current_Assignments':'Current Assignments', '_Edit_Assignment':'Edit Assignment', '_Disable_Devices':'Disable Devices', '_Add_to_Device_group':'Add to Device group', '_Remove_from_Device_Group':'Remove from Device Group', '_Find_anything_here':'Find anything here', '_Loading':'Loading', '_Saving':'Saving', '_Manage_device_groups':'Manage device groups', >>>>>>> '_Terms_of_Service':'terms of service', '_Current_Devices_List':'Current Devices List', '_Current_Assignments':'Current Assignments', '_Edit_Assignment':'Edit Assignment', '_Disable_Devices':'Disable Devices', '_Add_to_Device_group':'Add to Device group', '_Remove_from_Device_Group':'Remove from Device Group', '_Find_anything_here':'Find anything here', '_Loading':'Loading', '_Saving':'Saving', '_Manage_device_groups':'Manage device groups', '_SG_delete_header':'Are you sure you want to delete this surveygroup?', '_SG_delete_message':'This cannot be undone.'
<<<<<<< repeatable: false, ======= pollingTimer: null, amCopying: function(){ return this.content.get('status') == "COPYING"; }.property('this.content.status'), >>>>>>> repeatable: false, pollingTimer: null, amCopying: function(){ return this.content.get('status') == "COPYING"; }.property('this.content.status'),
<<<<<<< criteria: null, timeout: 30000, requestInterval: 3000, payloads: { DATA_CLEANING: { surveyId: '75201', exportType: 'DATA_CLEANING', opts: { exportMode: 'DATA_CLEANING', lastCollection: 'false', } }, DATA_ANALYSIS: { surveyId: '75201', exportType: 'DATA_ANALYSIS', opts: { exportMode: 'DATA_ANALYSIS', lastCollection: 'false', } }, COMPREHENSIVE: { surveyId: '75201', exportType: 'COMPREHENSIVE', opts: { exportMode: 'COMPREHENSIVE', } }, GEOSHAPE: { surveyId: '75201', exportType: 'GEOSHAPE', opts: { questionId: '12345' } }, SURVEY_FORM: { surveyId: '75201', exportType: 'SURVEY_FORM', opts: {} } }, ======= >>>>>>> <<<<<<< criteria.opts.email = FLOW.currentUser.email; criteria.opts.flowServices = FLOW.Env.flowServices; this.set('criteria', criteria); FLOW.savingMessageControl.numLoadingChange(1); this.requestReport(); }, requestReport: function () { this.set('processing', true); $.ajax({ url: FLOW.Env.flowServices + '/generate', data: { criteria: JSON.stringify(this.get('criteria')) }, jsonpCallback: 'FLOW.ReportLoader.handleResponse', dataType: 'jsonp', timeout: this.timeout }); Ember.run.later(this, this.handleError, this.timeout); }, handleResponse: function (resp) { if (!resp || resp.status !== 'OK') { FLOW.savingMessageControl.numLoadingChange(-1); this.showError(); return; } if (resp.message === 'PROCESSING') { this.set('processing', false); this.showEmailNotification(); } else if (resp.file && this.get('processing')) { FLOW.savingMessageControl.numLoadingChange(-1); this.set('processing', false); this.set('criteria', null); $('#downloader').attr('src', FLOW.Env.flowServices + '/report/' + resp.file); } }, handleError: function () { if (this.get('processing')) { FLOW.savingMessageControl.numLoadingChange(-1); this.showError(); } }, ======= newReport.set('reportType', exportType); newReport.set('formId', surveyId); newReport.set('filename', ''); newReport.set('state', 'QUEUED'); //newReport.set('lastCollectionOnly', ('' + (exportType === 'DATA_CLEANING' && FLOW.selectedControl.get('selectedSurveyGroup').get('monitoringGroup') && !!FLOW.editControl.lastCollection)); >>>>>>> newReport.set('reportType', exportType); newReport.set('formId', surveyId); newReport.set('filename', ''); newReport.set('state', 'QUEUED'); <<<<<<< var opts = {from:this.get("reportFromDate"), to:this.get("reportToDate"), lastCollection: this.get('exportOption') === "recent"}; ======= var opts = {startDate:this.get("reportFromDate"), endDate:this.get("reportToDate")}; >>>>>>> var opts = {startDate:this.get("reportFromDate"), endDate:this.get("reportToDate"), lastCollectionOnly: this.get('exportOption') === "recent"}; <<<<<<< var opts = {from:this.get("reportFromDate"), to:this.get("reportToDate"), lastCollection: this.get('exportOption') === "recent"}; ======= var opts = {startDate:this.get("reportFromDate"), endDate:this.get("reportToDate")}; >>>>>>> var opts = {startDate:this.get("reportFromDate"), endDate:this.get("reportToDate"), lastCollectionOnly: this.get('exportOption') === "recent"}; <<<<<<< }, eventManager: Ember.Object.create({ click: function(event, clickedView){ var exportTypes = ["dataCleanExp", "dataAnalyseExp", "compReportExp", "geoshapeSelect", "surveyFormExp"]; if (exportTypes.indexOf(clickedView.get('export')) > -1) { var i, options, trigger; options = document.getElementsByClassName("options"); for (i = 0; i < options.length; i++) { options[i].style.display = "none"; } trigger = document.getElementsByClassName("trigger"); for (i = 0; i < trigger.length; i++) { trigger[i].className = trigger[i].className.replace(" active", ""); } document.getElementById(clickedView.get('export')).style.display = "block"; event.currentTarget.className += " active"; //by default select the range option if (clickedView.get('export') == "dataCleanExp") { if ($('input:radio[name=cleaning-export-option]').is(':checked') === false) { $('input:radio[name=cleaning-export-option]').filter('[value=range]').prop('checked', true); } } else if (clickedView.get('export') == "dataAnalyseExp") { if ($('input:radio[name=analysis-export-option]').is(':checked') === false) { $('input:radio[name=analysis-export-option]').filter('[value=range]').prop('checked', true); } } } } }) ======= } }); FLOW.ReportsListView = Ember.View.extend({ templateName: 'navReports/reports-list', didInsertElement: function () { FLOW.router.reportsController.populate(); }, exportNewReport: function () { FLOW.router.transitionTo('navData.exportReports'); } >>>>>>> }, eventManager: Ember.Object.create({ click: function(event, clickedView){ var exportTypes = ["dataCleanExp", "dataAnalyseExp", "compReportExp", "geoshapeSelect", "surveyFormExp"]; if (exportTypes.indexOf(clickedView.get('export')) > -1) { var i, options, trigger; options = document.getElementsByClassName("options"); for (i = 0; i < options.length; i++) { options[i].style.display = "none"; } trigger = document.getElementsByClassName("trigger"); for (i = 0; i < trigger.length; i++) { trigger[i].className = trigger[i].className.replace(" active", ""); } document.getElementById(clickedView.get('export')).style.display = "block"; event.currentTarget.className += " active"; //by default select the range option if (clickedView.get('export') == "dataCleanExp") { if ($('input:radio[name=cleaning-export-option]').is(':checked') === false) { $('input:radio[name=cleaning-export-option]').filter('[value=range]').prop('checked', true); } } else if (clickedView.get('export') == "dataAnalyseExp") { if ($('input:radio[name=analysis-export-option]').is(':checked') === false) { $('input:radio[name=analysis-export-option]').filter('[value=range]').prop('checked', true); } } } } }) }); FLOW.ReportsListView = Ember.View.extend({ templateName: 'navReports/reports-list', didInsertElement: function () { FLOW.router.reportsController.populate(); }, exportNewReport: function () { FLOW.router.transitionTo('navData.exportReports'); }
<<<<<<< Ember.Object.create({ label: "Doughnut chart", value: "doughnut" }), Ember.Object.create({ label: "Vertical bar chart", value: "vbar" }), Ember.Object.create({ label: "Horizontal bar chart", value: "hbar" })] }); FLOW.statisticsControl = Ember.ArrayController.create({ selectedSurvey: null, allreadyTriggered: false, content:null, QAcontent:null, sortProperties: ['name'], sortAscending: true, totalsSurveys:[], total:null, computeTotal: function(){ this.set('total',Math.max.apply(Math, this.get('totalsSurveys'))); }, getMetrics: function(){ if (!Ember.none(this.get('selectedSurvey'))){ this.set('totalsSurveys',[]); this.set('total',null); this.set('alreadyTriggered',false); this.set('content',FLOW.store.findQuery(FLOW.Metric,{ surveyId: this.selectedSurvey.get('keyId') })); } }.observes('this.selectedSurvey'), resetSurvey: function(){ this.set('selectedSurvey',null); this.set('totalsSurveys',[]); this.set('total',null); this.set('content',null); }.observes('FLOW.selectedControl.selectedSurveyGroup'), getQA: function(){ if (!Ember.none(this.get('content') && !this.get('allreadyTriggered'))){ this.set('totalsSurveys',[]); this.set('total',null); // for each metric, get all the QuestionAnswerSummery objects of the questions // this could be a single call: give me all he QA summ for questions with a metric. this.set('QAcontent',FLOW.store.findQuery(FLOW.SurveyQuestionSummary,{ surveyId:this.selectedSurvey.get('keyId'), metricOnly:"true" })); allreadyTriggered = true; } }.observes('this.content.isLoaded') ======= Ember.Object.create({ label: "Doughnut chart", value: "doughnut" }), Ember.Object.create({ label: "Vertical bar chart", value: "vbar" }), Ember.Object.create({ label: "Horizontal bar chart", value: "hbar" }) ] >>>>>>> Ember.Object.create({ label: "Doughnut chart", value: "doughnut" }), Ember.Object.create({ label: "Vertical bar chart", value: "vbar" }), Ember.Object.create({ label: "Horizontal bar chart", value: "hbar" }) ] }); FLOW.statisticsControl = Ember.ArrayController.create({ selectedSurvey: null, allreadyTriggered: false, content:null, QAcontent:null, sortProperties: ['name'], sortAscending: true, totalsSurveys:[], total:null, computeTotal: function(){ this.set('total',Math.max.apply(Math, this.get('totalsSurveys'))); }, getMetrics: function(){ if (!Ember.none(this.get('selectedSurvey'))){ this.set('totalsSurveys',[]); this.set('total',null); this.set('alreadyTriggered',false); this.set('content',FLOW.store.findQuery(FLOW.Metric,{ surveyId: this.selectedSurvey.get('keyId') })); } }.observes('this.selectedSurvey'), resetSurvey: function(){ this.set('selectedSurvey',null); this.set('totalsSurveys',[]); this.set('total',null); this.set('content',null); }.observes('FLOW.selectedControl.selectedSurveyGroup'), getQA: function(){ if (!Ember.none(this.get('content') && !this.get('allreadyTriggered'))){ this.set('totalsSurveys',[]); this.set('total',null); // for each metric, get all the QuestionAnswerSummery objects of the questions // this could be a single call: give me all he QA summ for questions with a metric. this.set('QAcontent',FLOW.store.findQuery(FLOW.SurveyQuestionSummary,{ surveyId:this.selectedSurvey.get('keyId'), metricOnly:"true" })); allreadyTriggered = true; } }.observes('this.content.isLoaded')
<<<<<<< selectedCountryCode: null, selectedLevel1: null, selectedLevel2: null, ======= alreadyLoaded: [], >>>>>>> alreadyLoaded: [], selectedCountryCode: null, selectedLevel1: null, selectedLevel2: null, <<<<<<< init: function(){ this._super(); FLOW.selectedControl.set('selectedSurveyGroup',null); FLOW.selectedControl.set('selectedSurvey',null); FLOW.dateControl.set('toDate',null); FLOW.dateControl.set('fromDate',null); FLOW.surveyInstanceControl.set('pageNumber',0); FLOW.locationControl.set('selectedLevel1',null); FLOW.locationControl.set('selectedLevel2',null); }, ======= init: function () { this._super(); FLOW.selectedControl.set('selectedSurveyGroup', null); FLOW.selectedControl.set('selectedSurvey', null); FLOW.dateControl.set('toDate', null); FLOW.dateControl.set('fromDate', null); FLOW.surveyInstanceControl.set('pageNumber', 0); }, >>>>>>> init: function () { this._super(); FLOW.selectedControl.set('selectedSurveyGroup', null); FLOW.selectedControl.set('selectedSurvey', null); FLOW.dateControl.set('toDate', null); FLOW.dateControl.set('fromDate', null); FLOW.surveyInstanceControl.set('pageNumber', 0); FLOW.locationControl.set('selectedLevel1', null); FLOW.locationControl.set('selectedLevel2', null); },
<<<<<<< localeNameFlag:false, localeLocationFlag:false, ======= geoLocked: null, >>>>>>> localeNameFlag:false, localeLocationFlag:false, geoLocked: null, <<<<<<< this.set('localeNameFlag', FLOW.selectedControl.selectedQuestion.get('localeNameFlag')); this.set('localeLocationFlag', FLOW.selectedControl.selectedQuestion.get('localeLocationFlag')); ======= this.set('geoLocked', FLOW.selectedControl.selectedQuestion.get('geoLocked')); >>>>>>> this.set('localeNameFlag', FLOW.selectedControl.selectedQuestion.get('localeNameFlag')); this.set('localeLocationFlag', FLOW.selectedControl.selectedQuestion.get('localeLocationFlag')); this.set('geoLocked', FLOW.selectedControl.selectedQuestion.get('geoLocked')); <<<<<<< FLOW.selectedControl.selectedQuestion.set('localeNameFlag', this.get('localeNameFlag')); FLOW.selectedControl.selectedQuestion.set('localeLocationFlag', this.get('localeLocationFlag')); ======= FLOW.selectedControl.selectedQuestion.set('geoLocked', this.get('geoLocked')); >>>>>>> FLOW.selectedControl.selectedQuestion.set('localeNameFlag', this.get('localeNameFlag')); FLOW.selectedControl.selectedQuestion.set('localeLocationFlag', this.get('localeLocationFlag')); FLOW.selectedControl.selectedQuestion.set('geoLocked', this.get('geoLocked'));
<<<<<<< require('akvo-flow/controllers/languages'); ======= require('akvo-flow/currentuser'); >>>>>>> require('akvo-flow/controllers/languages'); require('akvo-flow/currentuser');
<<<<<<< var dataCollectionDate = pointData['answers']['created_at']; var date = new Date(dataCollectionDate); var pointDetailsHeader = '<ul class="placeMarkBasicInfo floats-in">' +'<h3>' +((dataPointName != "" && dataPointName != "null" && dataPointName != null) ? dataPointName : "") +'</h3>' +'<li>' +'<span>'+Ember.String.loc('_data_point_id') +':</span>' +'<div style="display: inline; margin: 0 0 0 5px;">'+dataPointIdentifier+'</div>' +'</li>' +'<li>' +'<span>'+Ember.String.loc('_collected_on') +':</span>' +'<div class="placeMarkCollectionDate">' +date.toUTCString() +'</div></li><li></li></ul>'; $("#pointDetails").append(pointDetailsHeader); var clickedPointContent = ""; //create a questions array with the correct order of questions as in the survey if(self.questions.length > 0){ var geoshapeObject, geoshapeCheck = false; self.geoshapeCoordinates = null; clickedPointContent += '<div class="mapInfoDetail" style="opacity: 1; display: inherit;">'; for (column in pointData['answers']){ var questionAnswer = pointData['answers'][column]; for(var i=0; i<self.questions.length; i++){ if (column.match(self.questions[i].keyId)) { if(self.questions[i].type === "GEOSHAPE" && questionAnswer !== null){ var geoshapeObject = FLOW.parseGeoshape(questionAnswer); if(geoshapeObject !== null){ clickedPointContent += '<h4><div style="float: left">' +self.questions[i].text +'</div>&nbsp;<a style="float: right" id="projectGeoshape">'+Ember.String.loc('_project_geoshape_onto_main_map') +'</a></h4>'; } } else { clickedPointContent += '<h4>'+self.questions[i].text+'&nbsp;</h4>'; } clickedPointContent += '<div style="float: left; width: 100%">'; if(questionAnswer !== "" && questionAnswer !== null && questionAnswer !== "null"){ switch (self.questions[i].questionType) { case "PHOTO": var imageString = "", imageJson; if (questionAnswer.charAt(0) === '{') { imageJson = JSON.parse(questionAnswer); imageString = imageJson.filename } else { imageString = questionAnswer; } var image = '<div class=":imgContainer photoUrl:shown:hidden">'; var imageFilename = FLOW.Env.photo_url_root+imageString.substring(imageString.lastIndexOf("/")+1); image += '<a href="'+imageFilename+'" target="_blank">' +'<img src="'+imageFilename+'" alt=""/></a>'; image += '</div>'; clickedPointContent += image; break; case "GEOSHAPE": geoshapeObject = FLOW.parseGeoshape(questionAnswer); self.geoshapeCoordinates = geoshapeObject; ======= //get request for questions $.get( "/rest/cartodb/questions?form_id="+pointData['formId'], function(questionsData, status){ var geoshapeObject, geoshapeQuestionsCount = 0; var dataCollectionDate = pointData['answers']['created_at']; var date = new Date(dataCollectionDate); clickedPointContent += '<ul class="placeMarkBasicInfo floats-in">' +'<h3>' +((dataPointName != "" && dataPointName != "null" && dataPointName != null) ? dataPointName : "") +'</h3>' +'<li>' +'<span>'+Ember.String.loc('_data_point_id') +':</span>' +'<div style="display: inline; margin: 0 0 0 5px;">'+dataPointIdentifier+'</div>' +'</li>' +'<li>' +'<span>'+Ember.String.loc('_collected_on') +':</span>' +'<div class="placeMarkCollectionDate">' +date.toISOString().slice(0,-8).replace("T", " ") +'</div></li><li></li></ul>'; clickedPointContent += '<div class="mapInfoDetail" style="opacity: 1; display: inherit;">'; for (column in pointData['answers']){ var questionAnswer = pointData['answers'][column]; for(var i=0; i<questionsData['questions'].length; i++){ if (column.match(questionsData['questions'][i].id)) { if(questionsData['questions'][i].type === "GEOSHAPE" && questionAnswer !== null){ var geoshapeObject = FLOW.parseGeoshape(questionAnswer); >>>>>>> var geoshapeObject, geoshapeQuestionsCount = 0; var dataCollectionDate = pointData['answers']['created_at']; var date = new Date(dataCollectionDate); var pointDetailsHeader = '<ul class="placeMarkBasicInfo floats-in">' +'<h3>' +((dataPointName != "" && dataPointName != "null" && dataPointName != null) ? dataPointName : "") +'</h3>' +'<li>' +'<span>'+Ember.String.loc('_data_point_id') +':</span>' +'<div style="display: inline; margin: 0 0 0 5px;">'+dataPointIdentifier+'</div>' +'</li>' +'<li>' +'<span>'+Ember.String.loc('_collected_on') +':</span>' +'<div class="placeMarkCollectionDate">' +date.toISOString().slice(0,-8).replace("T", " ") +'</div></li><li></li></ul>'; $("#pointDetails").append(pointDetailsHeader); var clickedPointContent = ""; //create a questions array with the correct order of questions as in the survey if(self.questions.length > 0){ var geoshapeObject, geoshapeCheck = false; self.geoshapeCoordinates = null; clickedPointContent += '<div class="mapInfoDetail" style="opacity: 1; display: inherit;">'; for (column in pointData['answers']){ var questionAnswer = pointData['answers'][column]; for(var i=0; i<self.questions.length; i++){ if (column.match(self.questions[i].keyId)) { if(self.questions[i].type === "GEOSHAPE" && questionAnswer !== null){ var geoshapeObject = FLOW.parseGeoshape(questionAnswer); if(geoshapeObject !== null){ geoshapeQuestionsCount++; clickedPointContent += '<h4><div style="float: left">' +self.questions[i].text +'</div>&nbsp;<a style="float: right" class="project-geoshape" data-geoshape-object=\''+questionAnswer+'\'>' +Ember.String.loc('_project_geoshape_onto_main_map')+'</a></h4>'; } } else { clickedPointContent += '<h4>'+self.questions[i].text+'&nbsp;</h4>'; } clickedPointContent += '<div style="float: left; width: 100%">'; if(questionAnswer !== "" && questionAnswer !== null && questionAnswer !== "null"){ switch (self.questions[i].questionType) { case "PHOTO": var imageString = "", imageJson; if (questionAnswer.charAt(0) === '{') { imageJson = JSON.parse(questionAnswer); imageString = imageJson.filename } else { imageString = questionAnswer; } var image = '<div class=":imgContainer photoUrl:shown:hidden">'; var imageFilename = FLOW.Env.photo_url_root+imageString.substring(imageString.lastIndexOf("/")+1); image += '<a href="'+imageFilename+'" target="_blank">' +'<img src="'+imageFilename+'" alt=""/></a>'; image += '</div>'; clickedPointContent += image; break; case "GEOSHAPE": geoshapeObject = FLOW.parseGeoshape(questionAnswer); self.geoshapeCoordinates = geoshapeObject; <<<<<<< $("#pointDetails").append(clickedPointContent); //if there's geoshape, draw it if(geoshapeCheck){ FLOW.drawGeoShape($("#geoShapeMap")[0], geoshapeObject); } } ======= //if there's geoshape, draw it if(geoshapeQuestionsCount > 0){ $('.geoshape-map').each(function(index){ FLOW.drawGeoShape($('.geoshape-map')[index], $(this).data('geoshape-object')); }); } }); >>>>>>> $("#pointDetails").append(clickedPointContent); //if there's geoshape, draw it if(geoshapeQuestionsCount > 0){ $('.geoshape-map').each(function(index){ FLOW.drawGeoShape($('.geoshape-map')[index], $(this).data('geoshape-object')); }); } }
<<<<<<< var nextStep; ======= return this.get('nextApprovalStep') && this.get('nextApprovalStep').get('keyId'); }.property('this.nextApprovalStep'), /* * Derive the next approval step (in ordered approvals) */ nextApprovalStep: function () { >>>>>>> return this.get('nextApprovalStep') && this.get('nextApprovalStep').get('keyId'); }.property('this.nextApprovalStep'), /* * Derive the next approval step (in ordered approvals) */ nextApprovalStep: function () { var nextStep; <<<<<<< return nextStep && nextStep.get('keyId'); ======= var nextStep = steps.filterProperty('order', ++lastApprovedStepOrder).get('firstObject'); return nextStep; >>>>>>> return nextStep;
<<<<<<< surveysPreview: Ember.A([]), ======= devicesPreview: Ember.A([]), >>>>>>> <<<<<<< const previewSurveys = Ember.A([]); ======= const previewDevices = Ember.A([]); >>>>>>> <<<<<<< FLOW.selectedControl.set('selectedDevices', []); FLOW.selectedControl.set('selectedSurveys', null); ======= FLOW.selectedControl.set('selectedDevices', null); FLOW.selectedControl.set('selectedSurveys', []); >>>>>>> FLOW.selectedControl.set('selectedDevices', []); FLOW.selectedControl.set('selectedSurveys', []); <<<<<<< addSelectedSurveys() { const sgName = FLOW.selectedControl.selectedSurveyGroup.get('code'); FLOW.selectedControl.get('selectedSurveys').forEach((item) => { item.set('surveyGroupName', sgName); }); this.surveysPreview.pushObjects(FLOW.selectedControl.get('selectedSurveys')); // delete duplicates this.set('surveysPreview', FLOW.ArrNoDupe(this.get('surveysPreview'))); }, selectAllSurveys() { const selected = FLOW.surveyControl.get('content').filter(item => item.get('status') === 'PUBLISHED'); FLOW.selectedControl.set('selectedSurveys', selected); }, deselectAllSurveys() { FLOW.selectedControl.set('selectedSurveys', []); }, removeSingleSurvey(event) { const id = event.context.get('clientId'); const surveysPreview = this.get('surveysPreview'); for (let i = 0; i < surveysPreview.length; i++) { if (surveysPreview.objectAt(i).clientId == id) { surveysPreview.removeAt(i); } } this.set('surveysPreview', surveysPreview); }, removeAllSurveys() { this.set('surveysPreview', Ember.A([])); }, ======= addSelectedDevices() { this.devicesPreview.pushObjects(FLOW.selectedControl.get('selectedDevices')); // delete duplicates this.set('devicesPreview', FLOW.ArrNoDupe(this.get('devicesPreview'))); }, selectAllDevices() { const selected = Ember.A([]); FLOW.devicesInGroupControl.get('content').forEach((item) => { selected.pushObject(item); }); FLOW.selectedControl.set('selectedDevices', selected); }, deselectAllDevices() { FLOW.selectedControl.set('selectedDevices', []); }, removeSingleDevice(event) { const id = event.context.get('clientId'); const devicesPreview = this.get('devicesPreview'); for (let i = 0; i < devicesPreview.length; i++) { if (devicesPreview.objectAt(i).clientId == id) { devicesPreview.removeAt(i); } } this.set('devicesPreview', devicesPreview); }, removeAllDevices() { this.set('devicesPreview', Ember.A([])); }, >>>>>>>
<<<<<<< find(resource: string, criteria?: {}|string|number, options?: {}): Promise<any|Error> { return this.request('GET', getRequestPath(resource, this.useTraditionalUriTemplates, criteria), undefined, options); ======= find(resource: string, idOrCriteria?: string|number|{}, options?: {}): Promise<any|Error> { return this.request('GET', getRequestPath(resource, idOrCriteria), undefined, options); >>>>>>> find(resource: string, idOrCriteria?: string|number|{}, options?: {}): Promise<any|Error> { return this.request('GET', getRequestPath(resource, this.useTraditionalUriTemplates, idOrCriteria), undefined, options); <<<<<<< update(resource: string, criteria?: {}|string|number, body?: {}, options?: {}): Promise<any|Error> { return this.request('PUT', getRequestPath(resource, this.useTraditionalUriTemplates, criteria), body, options); ======= update(resource: string, idOrCriteria?: string|number|{}, body?: {}, options?: {}): Promise<any|Error> { return this.request('PUT', getRequestPath(resource, idOrCriteria), body, options); >>>>>>> update(resource: string, idOrCriteria?: string|number|{}, body?: {}, options?: {}): Promise<any|Error> { return this.request('PUT', getRequestPath(resource, this.useTraditionalUriTemplates, idOrCriteria), body, options); <<<<<<< patch(resource: string, criteria?: {}|string|number, body?: {}, options?: {}): Promise<any|Error> { return this.request('PATCH', getRequestPath(resource, this.useTraditionalUriTemplates, criteria), body, options); ======= patch(resource: string, idOrCriteria?: string|number|{}, body?: {}, options?: {}): Promise<any|Error> { return this.request('PATCH', getRequestPath(resource, idOrCriteria), body, options); >>>>>>> patch(resource: string, idOrCriteria?: string|number|{}, body?: {}, options?: {}): Promise<any|Error> { return this.request('PATCH', getRequestPath(resource, this.useTraditionalUriTemplates, idOrCriteria), body, options); <<<<<<< destroy(resource: string, criteria?: {}|string|number, options?: {}): Promise<any|Error> { return this.request('DELETE', getRequestPath(resource, this.useTraditionalUriTemplates, criteria), undefined, options); ======= destroy(resource: string, idOrCriteria?: string|number|{}, options?: {}): Promise<any|Error> { return this.request('DELETE', getRequestPath(resource, idOrCriteria), undefined, options); >>>>>>> destroy(resource: string, idOrCriteria?: string|number|{}, options?: {}): Promise<any|Error> { return this.request('DELETE', getRequestPath(resource, this.useTraditionalUriTemplates, idOrCriteria), undefined, options);
<<<<<<< module.exports = ({name, email, address, shhIdentity}) => { let user = {} user.name = name user.email = email user.address = address.toLowerCase() user.shh_identity = shhIdentity || '' return user } ======= /* eslint-disable import/no-commonjs */ module.exports = ({ name, email, address, isAuditor, shhIdentity }) => { const user = {}; user.name = name; user.email = email; user.address = address.toLowerCase(); user.is_auditor = isAuditor; user.shh_identity = shhIdentity || ''; return user; }; >>>>>>> /* eslint-disable import/no-commonjs */ module.exports = ({name, email, address, shhIdentity}) => { let user = {} user.name = name user.email = email user.address = address.toLowerCase() user.shh_identity = shhIdentity || '' return user }
<<<<<<< // Fetch the receiver's pk from the PKD by passing their username const { pk } = await offchain.getZkpPublicKeyFromName(req.body.receiver_name); req.body.pk_B = pk; ======= // Fetch the transferee's pk from the PKD by passing their username req.body.pk_B = await offchain.getZkpPublicKeyFromName(req.body.receiver_name); >>>>>>> // Fetch the receiver's pk from the PKD by passing their username req.body.pk_B = await offchain.getZkpPublicKeyFromName(req.body.receiver_name);
<<<<<<< function start() { if (!started) return // the timeout is needed to solve // a weird safari bug https://github.com/riot/route/issues/33 setTimeout(function() { debouncedEmit = debounce(emit, 1) win[ADD_EVENT_LISTENER](POPSTATE, debouncedEmit) win[ADD_EVENT_LISTENER](HASHCHANGE, debouncedEmit) doc[ADD_EVENT_LISTENER](clickEvent, click) }, 1) ======= function start(autoExec) { win[ADD_EVENT_LISTENER](POPSTATE, emit) doc[ADD_EVENT_LISTENER](clickEvent, click) if (autoExec) emit(true) >>>>>>> function start(autoExec) { debouncedEmit = debounce(emit, 1) win[ADD_EVENT_LISTENER](POPSTATE, debouncedEmit) win[ADD_EVENT_LISTENER](HASHCHANGE, debouncedEmit) doc[ADD_EVENT_LISTENER](clickEvent, click) if (autoExec) emit(true)
<<<<<<< var _speed, adminEmail, localParsoid, customZimFavicon, verbose, minifyHtml, skipCacheCleaning, keepEmptyParagraphs, mwUrl, mwWikiPath, mwApiPath, mwDomain, mwUsername, mwPassword, requestTimeout, publisher, customMainPage, customZimTitle, customZimDescription, customZimTags, cacheDirectory, outputDirectory, tmpDirectory, withZimFullTextIndex, format, filenamePrefix, keepHtml, resume, deflateTmpHtml, writeHtmlRedirects, articleList, _addNamespaces, _useCache, parsoidUrl, useCache, cpuCount, speed, logger, nodeVersionSatisfiesPackage, mw, downloader, creator, zimOpts, zim, env, INFINITY_WIDTH, articleDetailXId, webUrlHost, parsoidContentType, addNamespaces, articleListLines, redis, dirs, cssLinks, jsScripts, redirectTemplate, footerTemplate, leadSectionTemplate, sectionTemplate, subSectionTemplate, genericJsModules, genericCssModules, mediaRegex, htmlTemplateCode, articleListHomeTemplate, optimizationQueue, downloadFileQueue, redirectQueue, tmpArticleListPath, articleListContentStream_1, articleListWriteStream_1; ======= var _speed, adminEmail, localMcs, customZimFavicon, verbose, minifyHtml, skipCacheCleaning, keepEmptyParagraphs, mwUrl, mwWikiPath, mwApiPath, mwModulePath, mwDomain, mwUsername, mwPassword, requestTimeout, publisher, customMainPage, customZimTitle, customZimDescription, customZimTags, cacheDirectory, outputDirectory, tmpDirectory, withZimFullTextIndex, format, filenamePrefix, keepHtml, resume, deflateTmpHtml, writeHtmlRedirects, articleList, _addNamespaces, _useCache, mcsUrl, useCache, cpuCount, speed, logger, runner, nodeVersionSatisfiesPackage, mw, downloader, creator, zimOpts, zim, env, INFINITY_WIDTH, articleIds, webUrlHost, addNamespaces, domain, redis, dirs, cssLinks, jsScripts, redirectTemplate, footerTemplate, leadSectionTemplate, sectionTemplate, subSectionTemplate, genericJsModules, genericCssModules, mediaRegex, htmlTemplateCode, optimizationQueue, downloadFileQueue, redirectQueue, tmpArticleListPath, articleListContentStream_1, articleListWriteStream_1; >>>>>>> var _speed, adminEmail, localMcs, customZimFavicon, verbose, minifyHtml, skipCacheCleaning, keepEmptyParagraphs, mwUrl, mwWikiPath, mwApiPath, mwModulePath, mwDomain, mwUsername, mwPassword, requestTimeout, publisher, customMainPage, customZimTitle, customZimDescription, customZimTags, cacheDirectory, outputDirectory, tmpDirectory, withZimFullTextIndex, format, filenamePrefix, keepHtml, resume, deflateTmpHtml, writeHtmlRedirects, articleList, _addNamespaces, _useCache, mcsUrl, useCache, cpuCount, speed, logger, runner, nodeVersionSatisfiesPackage, mw, downloader, creator, zimOpts, zim, env, INFINITY_WIDTH, articleDetailXId, webUrlHost, addNamespaces, articleListLines, domain, redis, dirs, cssLinks, jsScripts, redirectTemplate, footerTemplate, leadSectionTemplate, sectionTemplate, subSectionTemplate, genericJsModules, genericCssModules, mediaRegex, htmlTemplateCode, articleListHomeTemplate, optimizationQueue, downloadFileQueue, redirectQueue, tmpArticleListPath, articleListContentStream_1, articleListWriteStream_1; <<<<<<< articleListLines = articleList ? fs_1.default.readFileSync(zim.articleList).toString().split('\n') : []; if (!!parsoidUrl) return [3 /*break*/, 3]; if (!localParsoid) return [3 /*break*/, 2]; logger.log('Starting Parsoid'); // Icky but necessary fs_1.default.writeFileSync('./localsettings.js', "\n exports.setup = function(parsoidConfig) {\n parsoidConfig.setMwApi({\n uri: '" + (mw.base + mw.apiPath) + "',\n });\n };\n ", 'utf8'); return [4 /*yield*/, parsoid_1.default .apiServiceWorker({ appBasePath: './node_modules/parsoid', logger: console, config: { localsettings: '../../localsettings.js', parent: undefined, ======= if (!localMcs) return [3 /*break*/, 2]; // Start Parsoid logger.log('Starting Parsoid & MCS'); return [4 /*yield*/, runner.start({ num_workers: 0, services: [{ name: 'parsoid', module: 'node_modules/parsoid/lib/index.js', entrypoint: 'apiServiceWorker', conf: { mwApis: [{ uri: "" + (mw.base + mw.apiPath), }], }, }, { name: 'mcs', module: 'node_modules/service-mobileapp-node/app.js', conf: { port: 6927, mwapi_req: { method: 'post', uri: "https://{{domain}}/" + mw.apiPath, headers: { 'user-agent': '{{user-agent}}', }, body: '{{ default(request.query, {}) }}', }, restbase_req: { method: '{{request.method}}', uri: 'http://localhost:8000/{{domain}}/v3/{+path}', query: '{{ default(request.query, {}) }}', headers: '{{request.headers}}', body: '{{request.body}}', }, }, }], logging: { level: 'info', >>>>>>> articleListLines = articleList ? fs_1.default.readFileSync(zim.articleList).toString().split('\n') : []; if (!localMcs) return [3 /*break*/, 2]; // Start Parsoid logger.log('Starting Parsoid & MCS'); return [4 /*yield*/, runner.start({ num_workers: 0, services: [{ name: 'parsoid', module: 'node_modules/parsoid/lib/index.js', entrypoint: 'apiServiceWorker', conf: { mwApis: [{ uri: "" + (mw.base + mw.apiPath), }], }, }, { name: 'mcs', module: 'node_modules/service-mobileapp-node/app.js', conf: { port: 6927, mwapi_req: { method: 'post', uri: "https://{{domain}}/" + mw.apiPath, headers: { 'user-agent': '{{user-agent}}', }, body: '{{ default(request.query, {}) }}', }, restbase_req: { method: '{{request.method}}', uri: 'http://localhost:8000/{{domain}}/v3/{+path}', query: '{{ default(request.query, {}) }}', headers: '{{request.headers}}', body: '{{request.body}}', }, }, }], logging: { level: 'info', <<<<<<< redirectQueue = async_1.default.queue(function (articleId, finished) { return __awaiter(_this, void 0, void 0, function () { var url, content, body, redirects_1, redirectsCount_1, pages, err_3; return __generator(this, function (_a) { switch (_a.label) { ======= redirectQueue = async_1.default.cargo(function (articleIds, finished) { return __awaiter(_this, void 0, void 0, function () { var articleId, url, content, body, redirects, redirectsCount, _a, pages, normalized, fromXTo, pageIds, _i, pageIds_1, pageId, redirects_2, _b, redirects_1, entry, originalArticleId, title, err_2; return __generator(this, function (_c) { switch (_c.label) { >>>>>>> redirectQueue = async_1.default.cargo(function (articleIds, finished) { return __awaiter(_this, void 0, void 0, function () { var articleId, url, content, body, redirects, redirectsCount, _a, pages, normalized, fromXTo, pageIds, _i, pageIds_1, pageId, redirects_2, _b, redirects_1, entry, originalArticleId, title, err_3; return __generator(this, function (_c) { switch (_c.label) { <<<<<<< err_3 = _a.sent(); finished(err_3); ======= err_2 = _c.sent(); finished(err_2); >>>>>>> err_3 = _c.sent(); finished(err_3);
<<<<<<< cssResources: ['mobile', 'content.parsoid', 'inserted_style_mobile'], mainPageCssResources: ['mobile_main_page'], jsResources: ['mobile'], ======= cssResources: ['style', 'content.parsoid', 'inserted_style'], jsResources: ['script'], >>>>>>> cssResources: ['style', 'content.parsoid', 'inserted_style'], mainPageCssResources: ['mobile_main_page'], jsResources: ['script'], <<<<<<< mobile: './templates/mobile.html', desktop: './templates/desktop.html', articleListHomeTemplate: './templates/article_list_home.html', ======= page: './templates/page.html', >>>>>>> page: './templates/page.html', articleListHomeTemplate: './templates/article_list_home.html',
<<<<<<< var _speed, adminEmail, localMcs, customZimFavicon, verbose, minifyHtml, skipCacheCleaning, keepEmptyParagraphs, mwUrl, mwWikiPath, mwApiPath, mwModulePath, mwDomain, mwUsername, mwPassword, requestTimeout, publisher, customMainPage, customZimTitle, customZimDescription, customZimTags, cacheDirectory, outputDirectory, tmpDirectory, withZimFullTextIndex, format, filenamePrefix, keepHtml, resume, deflateTmpHtml, writeHtmlRedirects, _addNamespaces, _articleList, useCache, mcsUrl, articleList, cpuCount, speed, logger, runner, nodeVersionSatisfiesPackage, mw, downloader, creator, zimOpts, zim, env, INFINITY_WIDTH, articleDetailXId, webUrlHost, addNamespaces, domain, redis, dirs, cssLinks, jsScripts, redirectTemplate, footerTemplate, leadSectionTemplate, sectionTemplate, subSectionTemplate, genericJsModules, genericCssModules, mediaRegex, htmlTemplateCode, articleListHomeTemplate, optimizationQueue, downloadFileQueue, redirectQueue, dumpId, dumpTmpDir, err_1, fileName, tmpArticleListPath, articleListContentStream_1, articleListWriteStream_1, err_2, articleListLines, strings; ======= var _speed, adminEmail, localMcs, customZimFavicon, verbose, minifyHtml, skipCacheCleaning, keepEmptyParagraphs, mwUrl, mwWikiPath, mwApiPath, mwModulePath, mwDomain, mwUsername, mwPassword, requestTimeout, publisher, customMainPage, customZimTitle, customZimDescription, customZimTags, cacheDirectory, outputDirectory, tmpDirectory, withZimFullTextIndex, format, filenamePrefix, keepHtml, resume, deflateTmpHtml, writeHtmlRedirects, language, _addNamespaces, _articleList, useCache, strings, mcsUrl, articleList, cpuCount, speed, logger, runner, nodeVersionSatisfiesPackage, mw, downloader, creator, zimOpts, zim, env, INFINITY_WIDTH, articleDetailXId, webUrlHost, addNamespaces, dumpId, dumpTmpDir, err_1, domain, redis, dirs, cssLinks, jsScripts, redirectTemplate, footerTemplate, leadSectionTemplate, sectionTemplate, subSectionTemplate, genericJsModules, genericCssModules, mediaRegex, htmlTemplateCode, articleListHomeTemplate, optimizationQueue, downloadFileQueue, redirectQueue, fileName, tmpArticleListPath, articleListContentStream_1, articleListWriteStream_1, err_2, articleListLines; >>>>>>> var _speed, adminEmail, localMcs, customZimFavicon, verbose, minifyHtml, skipCacheCleaning, keepEmptyParagraphs, mwUrl, mwWikiPath, mwApiPath, mwModulePath, mwDomain, mwUsername, mwPassword, requestTimeout, publisher, customMainPage, customZimTitle, customZimDescription, customZimTags, cacheDirectory, outputDirectory, tmpDirectory, withZimFullTextIndex, format, filenamePrefix, keepHtml, resume, deflateTmpHtml, writeHtmlRedirects, _addNamespaces, _articleList, useCache, mcsUrl, articleList, cpuCount, speed, logger, runner, nodeVersionSatisfiesPackage, mw, downloader, creator, zimOpts, zim, env, INFINITY_WIDTH, articleDetailXId, webUrlHost, addNamespaces, dumpId, dumpTmpDir, err_1, domain, redis, dirs, cssLinks, jsScripts, redirectTemplate, footerTemplate, leadSectionTemplate, sectionTemplate, subSectionTemplate, genericJsModules, genericCssModules, mediaRegex, htmlTemplateCode, articleListHomeTemplate, optimizationQueue, downloadFileQueue, redirectQueue, fileName, tmpArticleListPath, articleListContentStream_1, articleListWriteStream_1, err_2, articleListLines, strings; <<<<<<< _a.label = 30; case 30: strings = U.getStringsForLang(zim.langIso2 || 'en', 'en'); return [4 /*yield*/, redis.flushDBs()]; case 31: ======= _a.label = 29; case 29: return [4 /*yield*/, redis.flushDBs()]; case 30: >>>>>>> _a.label = 29; case 29: strings = U.getStringsForLang(zim.langIso2 || 'en', 'en'); return [4 /*yield*/, redis.flushDBs()]; case 30:
<<<<<<< polygon: function(){ ======= triangle: function(p1, p2, p3){ util.setLastPoint(p1); return new util.Shape(function(ctx){ ctx.beginPath(); ctx.moveTo(p1.x, p1.y); ctx.lineTo(p2.x, p2.y); ctx.lineTo(p3.x, p3.y); ctx.lineTo(p1.x, p1.y); }); }, polygon: function(args){ >>>>>>> triangle: function(p1, p2, p3){ util.setLastPoint(p1); return new util.Shape(function(ctx){ ctx.beginPath(); ctx.moveTo(p1.x, p1.y); ctx.lineTo(p2.x, p2.y); ctx.lineTo(p3.x, p3.y); ctx.lineTo(p1.x, p1.y); }); }, polygon: function(){
<<<<<<< 'page': Page ======= home: Home, page: Page >>>>>>> page: Page
<<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Color', 'fill']); getContext().fillStyle = color; ======= ctx().fillStyle = color; >>>>>>> getContext().fillStyle = color; <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Color', 'stroke']); getContext().strokeStyle = color; ======= ctx().strokeStyle = color; >>>>>>> getContext().strokeStyle = color; <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Color', 'shadow']); getContext().shadowColor = color; ======= ctx().shadowColor = color; >>>>>>> getContext().shadowColor = color; <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Image', 'drawAtPoint']); img.drawAtPoint(getContext(), pt); ======= img.drawAtPoint(ctx(), pt); >>>>>>> img.drawAtPoint(getContext(), pt); <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Path', 'lineTo']); return new util.Path(getContext().lineTo, new Array(toPoint.x, toPoint.y)) ======= return new util.Path(ctx().lineTo, new Array(toPoint.x, toPoint.y)) >>>>>>> return new util.Path(getContext().lineTo, new Array(toPoint.x, toPoint.y)) <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Path', 'bezierCurveTo']); return new util.Path(getContext().bezierCurveTo, new Array(controlPoint1.x, controlPoint1.y, ======= return new util.Path(ctx().bezierCurveTo, new Array(controlPoint1.x, controlPoint1.y, >>>>>>> return new util.Path(getContext().bezierCurveTo, new Array(controlPoint1.x, controlPoint1.y, <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Path', 'moveTo']); return new util.Path(getContext().moveTo, new Array(toPoint.x, toPoint.y)); ======= return new util.Path(ctx().moveTo, new Array(toPoint.x, toPoint.y)); >>>>>>> return new util.Path(getContext().moveTo, new Array(toPoint.x, toPoint.y)); <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Path', 'quadraticCurveTo']); return new util.Path(getContext().quadraticCurveTo, new Array(controlPoint.x, ======= return new util.Path(ctx().quadraticCurveTo, new Array(controlPoint.x, >>>>>>> return new util.Path(getContext().quadraticCurveTo, new Array(controlPoint.x, <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Path', 'arcTo']); return new util.Path(getContext().arcTo, new Array(controlPoint1.x, ======= return new util.Path(ctx().arcTo, new Array(controlPoint1.x, >>>>>>> return new util.Path(getContext().arcTo, new Array(controlPoint1.x, <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Path', 'closePath']); return new util.Path(getContext().closePath); ======= return new util.Path(ctx().closePath); >>>>>>> return new util.Path(getContext().closePath); <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Path', 'lineStyle']); getContext().lineWidth = width; getContext().strokeStyle = color; getContext().lineCap = capStyle; getContext().lineJoin = joinStyle; ======= ctx().lineWidth = width; ctx().strokeStyle = color; ctx().lineCap = capStyle; ctx().lineJoin = joinStyle; >>>>>>> getContext().lineWidth = width; getContext().strokeStyle = color; getContext().lineCap = capStyle; getContext().lineJoin = joinStyle; <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Shape', 'stroke']); shapeArg.draw(getContext()); ctx.stroke(); ======= shapeArg.draw(ctx()); ctx().stroke(); >>>>>>> shapeArg.draw(getContext()); ctx.stroke(); <<<<<<< return new util.Shape(function(ctx){ _gaq.push(['_trackEvent', 'Blocks', 'Shape', 'circle']); ctx.beginPath(); ctx.arc(pt.x, pt.y, rad, 0, Math.PI * 2, true); }); ======= ctx().beginPath(); ctx().arc(pt.x, pt.y, rad, 0, Math.PI * 2, true); >>>>>>> return new util.Shape(function(ctx){ ctx.beginPath(); ctx.arc(pt.x, pt.y, rad, 0, Math.PI * 2, true); }); <<<<<<< return new util.Shape(function(ctx){ _gaq.push(['_trackEvent', 'Blocks', 'Shape', 'rectangle']); ctx.beginPath(); if(orientation == "center"){ ctx.moveTo(pt.x - width/2, pt.y - height/2); ctx.lineTo(pt.x + width/2, pt.y - height/2); ctx.lineTo(pt.x + width/2, pt.y + height/2); ctx.lineTo(pt.x - width/2, pt.y + height/2); ctx.lineTo(pt.x - width/2, pt.y - height/2); } else{ ctx.lineTo(pt.x + width, pt.y); ctx.lineTo(pt.x + width, pt.y + height); ctx.lineTo(pt.x, pt.y + height); ctx.lineTo(pt.x, pt.y); } }); ======= ctx().beginPath(); if(orientation == "center"){ ctx().moveTo(pt.x - width/2, pt.y - height/2); ctx().lineTo(pt.x + width/2, pt.y - height/2); ctx().lineTo(pt.x + width/2, pt.y + height/2); ctx().lineTo(pt.x - width/2, pt.y + height/2); ctx().lineTo(pt.x - width/2, pt.y - height/2); } else{ ctx().lineTo(pt.x + width, pt.y); ctx().lineTo(pt.x + width, pt.y + height); ctx().lineTo(pt.x, pt.y + height); ctx().lineTo(pt.x, pt.y); } >>>>>>> return new util.Shape(function(ctx){ ctx.beginPath(); if(orientation == "center"){ ctx.moveTo(pt.x - width/2, pt.y - height/2); ctx.lineTo(pt.x + width/2, pt.y - height/2); ctx.lineTo(pt.x + width/2, pt.y + height/2); ctx.lineTo(pt.x - width/2, pt.y + height/2); ctx.lineTo(pt.x - width/2, pt.y - height/2); } else{ ctx.lineTo(pt.x + width, pt.y); ctx.lineTo(pt.x + width, pt.y + height); ctx.lineTo(pt.x, pt.y + height); ctx.lineTo(pt.x, pt.y); } }); <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Sound', 'draw']); spt.draw(getContext()); ======= spt.draw(ctx()); >>>>>>> spt.draw(getContext()); <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Text', 'textAlign']); getContext().textAlign = alignment; ======= ctx().textAlign = alignment; >>>>>>> getContext().textAlign = alignment; <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Text', 'textBaseline']); getContext().textBaseline = baseline; ======= ctx().textBaseline = baseline; >>>>>>> getContext().textBaseline = baseline; <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Text', 'fillText']); getContext().fillText(text, x, y); ======= ctx().fillText(text, x, y); >>>>>>> getContext().fillText(text, x, y); <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Text', 'fillTextWidth']); getContext().fillText(text, x, y, width); ======= ctx().fillText(text, x, y, width); >>>>>>> getContext().fillText(text, x, y, width); <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Text', 'strokeText']); getContext().strokeText(text, x, y); ======= ctx().strokeText(text, x, y); >>>>>>> getContext().strokeText(text, x, y); <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Text', 'strokeTextWidth']); getContext().strokeText(text, x, y, width); ======= ctx().strokeText(text, x, y, width); >>>>>>> getContext().strokeText(text, x, y, width); <<<<<<< _gaq.push(['_trackEvent', 'Blocks', 'Text', 'width']); var textMetric = getContext().measureText(text); ======= var textMetric = ctx().measureText(text); >>>>>>> var textMetric = getContext().measureText(text);
<<<<<<< function runScript(options) { runtime.startEventLoop(); ======= function runScript(){ >>>>>>> function runScript(options) { <<<<<<< /* Handle debugger events. */ Event.on(window, 'process:step', null, function (evt) { var block = evt.detail.target; var oldBlocks; document.body.classList.add('debugger-paused'); /* Update the paused element. */ oldBlocks = document.querySelectorAll('.wb-paused'); console.assert(oldBlocks.length <= 1); if (oldBlocks.length) { oldBlocks[0].classList.remove('wb-paused'); } block.classList.add('wb-paused'); }); Event.on(window, 'process:pause', null, function (evt) { /* No-op: wb-paused added on step. */ }); Event.on(window, 'process:resume', null, function (evt) { document.body.classList.remove('wb-paused'); }); ======= Event.on(document.body, 'ui:click', '.undo', Event.handleUndoButton); Event.on(document.body, 'ui:click', '.redo', Event.handleRedoButton); Event.on(window, 'input:keydown', null, Event.undoKeyCombo); Event.on(window, 'input:keydown', null, Event.redoKeyCombo); Event.clearStacks(); >>>>>>> /* Handle debugger events. */ Event.on(window, 'process:step', null, function (evt) { var block = evt.detail.target; var oldBlocks; document.body.classList.add('debugger-paused'); /* Update the paused element. */ oldBlocks = document.querySelectorAll('.wb-paused'); console.assert(oldBlocks.length <= 1); if (oldBlocks.length) { oldBlocks[0].classList.remove('wb-paused'); } block.classList.add('wb-paused'); }); Event.on(window, 'process:pause', null, function (evt) { /* No-op: wb-paused added on step. */ }); Event.on(window, 'process:resume', null, function (evt) { document.body.classList.remove('wb-paused'); }); Event.on(document.body, 'ui:click', '.undo', Event.handleUndoButton); Event.on(document.body, 'ui:click', '.redo', Event.handleRedoButton); Event.on(window, 'input:keydown', null, Event.undoKeyCombo); Event.on(window, 'input:keydown', null, Event.redoKeyCombo); Event.clearStacks();
<<<<<<< handleExample('Draw on Image', 'drawimage'), ======= handleExample('Pastels', 'pastels'), handleExample('Clipping Demo', 'clipping'), >>>>>>> handleExample('Draw on Image', 'drawimage'), handleExample('Pastels', 'pastels'), handleExample('Clipping Demo', 'clipping'),
<<<<<<< extraBabelPlugins: [ [ 'import', { libraryName: 'antd', libraryDirectory: 'es', style: true, }, ], ], ======= extraBabelPlugins: [['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }]], >>>>>>> extraBabelPlugins: [['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }]], <<<<<<< ======= lessLoaderOptions: { javascriptEnabled: true, }, disableDynamicImport: true, >>>>>>>
<<<<<<< import React from 'react'; ======= import { parse, stringify } from 'qs'; >>>>>>> import React from 'react'; import { parse, stringify } from 'qs';
<<<<<<< "control.confirm reveal no marks": "Would you like to reveal the answer to this question?", "control.submit part.confirm remove next parts": "<p>One or more subsequent parts depend on your answer to this part. Submitting this part again will invalidate those parts, and remove them from the question. This cannot be undone.</p>\n<p>Would you like to submit this part again?</p>", "control.proceed anyway": "Proceed anyway?", "control.regen": "Try another question like this one", "control.submit answer": "Submit answer", "control.submit all parts": "Submit all parts", "control.submit again": "Submit again", "control.submit": "Submit", "control.previous": "Previous", "control.next": "Next", "control.advice": "Advice", "control.reveal": "Reveal answers", "control.total": "Total", "control.pause": "Pause", "control.end exam": "End Exam", "control.back to results": "Go back to results", "control.toggle navigation menu": "Toggle the navigation menu", "display.part.jme.error making maths": "Error making maths display", ======= "control.proceed anyway": "المتابعة على أي حال", "control.regen": "محاولة سؤال آخر مثل هذا", "control.submit answer": "أرسل الإجابة", "control.submit all parts": "أرسل كل الأجزاء", "control.submit again": "أرسل مرة ثانية", "control.submit": "أرسل", "control.previous": "السابق", "control.next": "التالي", "control.advice": "مساعدة", "control.reveal": "كشف الإجابات", "control.total": "المجموع", "control.pause": "إيقاف مؤقت", "control.end exam": "إنهاء الامتحان", "control.back to results": "العودة إلى النتائج", "display.part.jme.error making maths": "يوجد خطأ في عرض الصيغة الرياضية", >>>>>>> "control.proceed anyway": "المتابعة على أي حال", "control.regen": "محاولة سؤال آخر مثل هذا", "control.submit answer": "أرسل الإجابة", "control.submit all parts": "أرسل كل الأجزاء", "control.submit again": "أرسل مرة ثانية", "control.submit": "أرسل", "control.previous": "السابق", "control.next": "التالي", "control.advice": "مساعدة", "control.reveal": "كشف الإجابات", "control.total": "المجموع", "control.pause": "إيقاف مؤقت", "control.end exam": "إنهاء الامتحان", "control.back to results": "العودة إلى النتائج", "display.part.jme.error making maths": "يوجد خطأ في عرض الصيغة الرياضية", <<<<<<< "jme.display.simplifyTree.empty expression": "Expression is empty", "jme.display.simplifyTree.stuck in a loop": "Simplifier is stuck in a loop: <code>{{expr}}</code>", "jme.calculus.unknown derivative": "Don't know how to differentiate <code>{{tree}}</code>", ======= >>>>>>> <<<<<<< "part.error": "{{path}}: {{-message}}", "part.with steps answer prompt": "Answer: ", "part.prompt": "prompt", "part.feedback": "feedback", "part.choose next part": "What do you want to do next?", "part.reached dead end": "There's nothing more to do from here.", "part.next part.penalty amount": "(lose {{count}} $t(mark))", ======= "part.with steps answer prompt": "الإجابة:", >>>>>>> "part.with steps answer prompt": "الإجابة:", <<<<<<< "part.marking.not submitted": "No answer submitted.", "part.marking.did not answer": "You did not answer this question.", "part.marking.total score": "You scored <strong>{{count,niceNumber}}</strong> $t(mark) for this part.", "part.marking.counts towards objective": "This part counts towards the objective <strong>“{{objective}}”</strong>.", "part.marking.minimum score applied": "The minimum score for this part is <strong>{{score,niceNumber}}</strong>.", "part.marking.maximum score applied": "The maximum score for this part is <strong>{{score,niceNumber}}</strong>.", "part.marking.nothing entered": "You did not enter an answer.", "part.marking.incorrect": "Your answer is incorrect.", "part.marking.correct": "Your answer is correct.", ======= "part.marking.not submitted": "لم يتم إرسال الإجابة", "part.marking.did not answer": "لم تقم بالإجابة على هذا السؤال", "part.marking.nothing entered": "لم تقم بإدخال الإجابة", "part.marking.incorrect": "إجابتك غير صحيحة", "part.marking.correct": "إجابة صحيحة", >>>>>>> "part.marking.not submitted": "لم يتم إرسال الإجابة", "part.marking.did not answer": "لم تقم بالإجابة على هذا السؤال", "part.marking.nothing entered": "لم تقم بإدخال الإجابة", "part.marking.incorrect": "إجابتك غير صحيحة", "part.marking.correct": "إجابة صحيحة", <<<<<<< "question.preamble.error": "Error in preamble: {{-message}}", "question.preamble.syntax error": "Syntax error in preamble", "question.unsupported part type": "Unsupported part type", "question.header": "Question {{number}}", "question.submit part": "Submit part", "question.show steps": "Show steps", "question.show steps penalty": "You will lose <strong>{{count,niceNumber}}</strong> $t(mark).", "question.show steps no penalty": "Your score will not be affected.", "question.show steps already penalised": "You have already shown steps. You can show them again with no further penalty.", "question.hide steps": "Hide steps", "question.hide steps no penalty": "Your score will not be affected.", "question.statement": "Statement", "question.advice": "Advice", "question.progress": "Question progress:", "question.no such part": "Can't find part {{path}}", "question.can not submit": "Can not submit answer - check for errors.", "question.answer submitted": "Answer submitted", "question.unsubmitted changes": "You have made a change to your answer but not submitted it. Please check your answer and then press the <strong>Submit answer</strong> button.", "question.unsubmitted changes_plural": "You have made changes to your answers but not submitted them. Please check your answers to each part and then press the <strong>Submit all parts</strong> button.", "question.score feedback.none": "", "question.score feedback.show": "Show feedback", "question.score feedback.hide": "Hide feedback", ======= >>>>>>> <<<<<<< "question.score feedback.score actual.plain": "{{scoreString}}", "question.score feedback.score total actual.plain": "{{score,niceNumber}}/{{marks,niceNumber}}", "question.score feedback.correct": "Your answer is correct", "question.score feedback.partial": "Your answer is partially correct", "question.score feedback.wrong": "Your answer is incorrect", "question.objectives": "Objectives", "question.penalties": "Penalties", "question.selector.unsubmitted changes": "Unsubmitted changes.", "question.back to previous part": "Go back to the previous part", "ruleset.circular reference": "Circular reference in definition of ruleset <code>{{name}}</code>", "ruleset.set not defined": "Ruleset {{name}} has not been defined", "timing.no accumulator": "no timing accumulator {{name}}", "timing.time remaining": "Time remaining:", ======= >>>>>>>
<<<<<<< /** Evaluate the given expressions until the list of conditions is satisfied * @param {Array.<String>} names - names for each expression * @param {Array.<Numbas.jme.tree>} definitions - definition of each expression * @param {Array.<Numbas.jme.tree>} conditions - expressions in terms of the assigned names, which should evaluate to `true` if the values are acceptable. * @param {Numbas.jme.Scope} scope - the scope in which to evaluate everything * @param {Number} [maxRuns=100] - the maximum number of times to try to generate a set of values * @returns {Object.<Numbas.jme.token>} - a dictionary mapping names to their generated values. */ ======= Numbas.jme.lazyOps.push('repeat'); >>>>>>> Numbas.jme.lazyOps.push('repeat'); /** Evaluate the given expressions until the list of conditions is satisfied * @param {Array.<String>} names - names for each expression * @param {Array.<Numbas.jme.tree>} definitions - definition of each expression * @param {Array.<Numbas.jme.tree>} conditions - expressions in terms of the assigned names, which should evaluate to `true` if the values are acceptable. * @param {Numbas.jme.Scope} scope - the scope in which to evaluate everything * @param {Number} [maxRuns=100] - the maximum number of times to try to generate a set of values * @returns {Object.<Numbas.jme.token>} - a dictionary mapping names to their generated values. */ <<<<<<< /** Is the given token the value `true`? * @param {Numbas.jme.token} item * @returns {Boolean} */ ======= newBuiltin('take',[TNum,'?',TName,'?'],TList,null, { evaluate: function(args,scope) { var n = scope.evaluate(args[0]).value; var lambda = args[1]; var list = scope.evaluate(args[3]); switch(list.type) { case 'list': list = list.value; break; case 'range': list = math.rangeToList(list.value); for(var i=0;i<list.length;i++) { list[i] = new TNum(list[i]); } break; default: throw(new Numbas.Error('jme.typecheck.map not on enumerable',list.type)); } scope = new Scope(scope); var name = args[2].tok.name; var value = []; for(var i=0;i<list.length && value.length<n;i++) { var v = list[i]; scope.setVariable(name,v); var ok = scope.evaluate(lambda).value; if(ok) { value.push(v); } }; return new TList(value); } }); Numbas.jme.lazyOps.push('take'); jme.findvarsOps.take = function(tree,boundvars,scope) { var mapped_boundvars = boundvars.slice(); if(tree.args[2].tok.type=='list') { var names = tree.args[2].args; for(var i=0;i<names.length;i++) { mapped_boundvars.push(names[i].tok.name.toLowerCase()); } } else { mapped_boundvars.push(tree.args[2].tok.name.toLowerCase()); } var vars = jme.findvars(tree.args[1],mapped_boundvars,scope); vars = vars.merge(jme.findvars(tree.args[0],boundvars,scope)); vars = vars.merge(jme.findvars(tree.args[3],boundvars,scope)); return vars; } jme.substituteTreeOps.take = function(tree,scope,allowUnbound) { var args = tree.args.slice(); args[0] = jme.substituteTree(args[0],scope,allowUnbound); args[3] = jme.substituteTree(args[3],scope,allowUnbound); return {tok:tree.tok, args: args}; } >>>>>>> newBuiltin('take',[TNum,'?',TName,'?'],TList,null, { evaluate: function(args,scope) { var n = scope.evaluate(args[0]).value; var lambda = args[1]; var list = scope.evaluate(args[3]); switch(list.type) { case 'list': list = list.value; break; case 'range': list = math.rangeToList(list.value); for(var i=0;i<list.length;i++) { list[i] = new TNum(list[i]); } break; default: throw(new Numbas.Error('jme.typecheck.map not on enumerable',list.type)); } scope = new Scope(scope); var name = args[2].tok.name; var value = []; for(var i=0;i<list.length && value.length<n;i++) { var v = list[i]; scope.setVariable(name,v); var ok = scope.evaluate(lambda).value; if(ok) { value.push(v); } }; return new TList(value); } }); Numbas.jme.lazyOps.push('take'); jme.findvarsOps.take = function(tree,boundvars,scope) { var mapped_boundvars = boundvars.slice(); if(tree.args[2].tok.type=='list') { var names = tree.args[2].args; for(var i=0;i<names.length;i++) { mapped_boundvars.push(names[i].tok.name.toLowerCase()); } } else { mapped_boundvars.push(tree.args[2].tok.name.toLowerCase()); } var vars = jme.findvars(tree.args[1],mapped_boundvars,scope); vars = vars.merge(jme.findvars(tree.args[0],boundvars,scope)); vars = vars.merge(jme.findvars(tree.args[3],boundvars,scope)); return vars; } jme.substituteTreeOps.take = function(tree,scope,allowUnbound) { var args = tree.args.slice(); args[0] = jme.substituteTree(args[0],scope,allowUnbound); args[3] = jme.substituteTree(args[3],scope,allowUnbound); return {tok:tree.tok, args: args}; } /** Is the given token the value `true`? * @param {Numbas.jme.token} item * @returns {Boolean} */
<<<<<<< finaliseLoad: function() { var settings = this.settings; if(settings.precisionType!='none') { settings.allowFractions = false; } try { this.getCorrectAnswer(this.getScope()); } catch(e) { this.error(e.message); } var displayAnswer = (settings.minvalue + settings.maxvalue)/2; if(settings.correctAnswerFraction) { var diff = Math.abs(settings.maxvalue-settings.minvalue)/2; var accuracy = Math.max(15,Math.ceil(-Math.log(diff))); settings.displayAnswer = jme.display.jmeRationalNumber(displayAnswer,{accuracy:accuracy}); } else { settings.displayAnswer = math.niceNumber(displayAnswer,{precisionType: settings.precisionType,precision:settings.precision, style: settings.correctAnswerStyle}); } this.stagedAnswer = ''; if(Numbas.display) { this.display = new Numbas.display.NumberEntryPartDisplay(this); } }, resume: function() { if(!this.store) { return; } var pobj = this.store.loadPart(this); this.stagedAnswer = pobj.studentAnswer+''; }, ======= try { this.getCorrectAnswer(this.question.scope); } catch(e) { this.error(e.message); } var messageNode = this.xml.selectSingleNode('answer/precision/message'); if(messageNode) settings.precisionMessage = $.xsl.transform(Numbas.xml.templates.question,messageNode).string; this.display = new Numbas.display.NumberEntryPartDisplay(this); if(loading) { var pobj = Numbas.store.loadNumberEntryPart(this); this.stagedAnswer = [pobj.studentAnswer+'']; } } NumberEntryPart.prototype = /** @lends Numbas.parts.NumberEntryPart.prototype */ { >>>>>>> finaliseLoad: function() { var settings = this.settings; if(settings.precisionType!='none') { settings.allowFractions = false; } try { this.getCorrectAnswer(this.getScope()); } catch(e) { this.error(e.message); } this.stagedAnswer = ''; if(Numbas.display) { this.display = new Numbas.display.NumberEntryPartDisplay(this); } }, resume: function() { if(!this.store) { return; } var pobj = this.store.loadPart(this); this.stagedAnswer = pobj.studentAnswer+''; },
<<<<<<< this.viewModel = { exam: Knockout.observable(Numbas.exam.display) } this.setExam(Numbas.exam); Knockout.applyBindings(this.viewModel); }, setExam: function(exam) { this.viewModel.exam(exam.display); for(var i=0;i<exam.questionList.length;i++) { exam.display.applyQuestionBindings(exam.questionList[i]); } exam.display.questions().map(function(q) { q.init(); }); ======= Numbas.signals.trigger('display ready'); >>>>>>> this.viewModel = { exam: Knockout.observable(Numbas.exam.display) } this.setExam(Numbas.exam); Knockout.applyBindings(this.viewModel); }, setExam: function(exam) { this.viewModel.exam(exam.display); for(var i=0;i<exam.questionList.length;i++) { exam.display.applyQuestionBindings(exam.questionList[i]); } exam.display.questions().map(function(q) { q.init(); }); Numbas.signals.trigger('display ready'); <<<<<<< var ingredients = messageIngredients(); return R(ingredients.key,ingredients.scoreobj); }), plainMessage: Knockout.computed(function() { var ingredients = messageIngredients(); var key = ingredients.key; if(key=='question.score feedback.score total actual' || key=='question.score feedback.score actual') { key += '.plain'; ======= var score = obj.score(); var marks = obj.marks(); var scoreobj = { marks: marks, score: score, marksString: niceNumber(marks)+' '+R('mark',{count:marks}), scoreString: niceNumber(score)+' '+R('mark',{count:score}), }; if(marks==0) { return R('question.score feedback.not marked'); } if(!revealed()) { if(settings.showActualMark) { if(settings.showTotalMark) { return R('question.score feedback.score total actual',scoreobj); } else { return R('question.score feedback.score actual',scoreobj); } } else if(settings.showTotalMark) { return R('question.score feedback.score total',scoreobj); } else { var key = answered () ? 'answered' : anyAnswered() ? 'partially answered' : 'unanswered'; return R('question.score feedback.'+key); } } else { return R('question.score feedback.score total actual',scoreobj); >>>>>>> var ingredients = messageIngredients(); return R(ingredients.key,ingredients.scoreobj); }), plainMessage: Knockout.computed(function() { var ingredients = messageIngredients(); var key = ingredients.key; if(key=='question.score feedback.score total actual' || key=='question.score feedback.score actual') { key += '.plain';
<<<<<<< var settings = this.settings; util.copyinto(MultipleResponsePart.prototype.settings,settings); } MultipleResponsePart.prototype = /** @lends Numbas.parts.MultipleResponsePart.prototype */ { loadFromXML: function(xml) { var settings = this.settings; var tryGetAttribute = Numbas.xml.tryGetAttribute; var scope = this.getScope(); //get number of answers and answer order setting if(this.type == '1_n_2' || this.type == 'm_n_2') { // the XML for these parts lists the options in the <choices> tag, but it makes more sense to list them as answers // so swap "answers" and "choices" // this all stems from an extremely bad design decision made very early on this.flipped = true; } else { this.flipped = false; } //work out marks available tryGetAttribute(settings,xml,'marking/maxmarks','enabled','maxMarksEnabled'); if(settings.maxMarksEnabled) { tryGetAttribute(this,xml,'marking/maxmarks','value','marks'); } else { tryGetAttribute(this,xml,'.','marks'); } //get minimum marks setting tryGetAttribute(settings,xml,'marking/minmarks','enabled','minMarksEnabled'); if(settings.minMarksEnabled) { tryGetAttribute(settings,xml,'marking/minmarks','value','minimumMarks'); } //get restrictions on number of choices var choicesNode = xml.selectSingleNode('choices'); if(!choicesNode) { this.error('part.mcq.choices missing'); } tryGetAttribute(settings,null,choicesNode,['minimumexpected','maximumexpected','shuffleChoices','displayType'],['minAnswersString','maxAnswersString','shuffleChoices']); var choiceNodes = choicesNode.selectNodes('choice'); var answersNode, answerNodes; if(this.type == '1_n_2' || this.type == 'm_n_2') { // the XML for these parts lists the options in the <choices> tag, but it makes more sense to list them as answers // so swap "answers" and "choices" // this all stems from an extremely bad design decision made very early on this.numAnswers = choiceNodes.length; this.numChoices = 1; answersNode = choicesNode; choicesNode = null; } else { this.numChoices = choiceNodes.length; answersNode = xml.selectSingleNode('answers'); if(answersNode) { tryGetAttribute(settings,null,answersNode,'shuffleAnswers','shuffleAnswers'); answerNodes = answersNode.selectNodes('answer'); this.numAnswers = answerNodes.length; } } var def; function loadDef(def,scope,topNode,nodeName) { var values = jme.evaluate(def,scope); if(values.type!='list') { p.error('part.mcq.options def not a list',{properties: nodeName}); } var numValues = values.value.length; values.value.map(function(value) { var node = xml.ownerDocument.createElement(nodeName); var content = xml.ownerDocument.createElement('content'); var span = xml.ownerDocument.createElement('span'); content.appendChild(span); node.appendChild(content); topNode.appendChild(node); switch(value.type) { case 'string': var d = document.createElement('d'); d.innerHTML = value.value; var newNode; ======= var settings = this.settings; util.copyinto(MultipleResponsePart.prototype.settings,settings); //work out marks available tryGetAttribute(settings,this.xml,'marking/maxmarks','enabled','maxMarksEnabled'); if(settings.maxMarksEnabled) { tryGetAttribute(this,this.xml,'marking/maxmarks','value','marks'); } else { tryGetAttribute(this,this.xml,'.','marks'); } this.marks = util.parseNumber(this.marks) || 0; //get minimum marks setting tryGetAttribute(settings,this.xml,'marking/minmarks','enabled','minMarksEnabled'); if(settings.minMarksEnabled) { tryGetAttribute(this.settings,this.xml,'marking/minmarks','value','minimumMarks'); } this.settings.minimumMarks = util.parseNumber(this.settings.minimumMarks) || 0; //get restrictions on number of choices var choicesNode = this.xml.selectSingleNode('choices'); if(!choicesNode) { this.error('part.mcq.choices missing'); } tryGetAttribute(settings,null,choicesNode,['minimumexpected','maximumexpected','order','displayType'],['minAnswers','maxAnswers','choiceOrder']); var minAnswers = jme.subvars(settings.minAnswers, this.question.scope); minAnswers = jme.evaluate(settings.minAnswers,this.question.scope); if(minAnswers && minAnswers.type=='number') { settings.minAnswers = minAnswers.value; } else { this.error('part.setting not present','minimum answers'); } var maxAnswers = jme.subvars(settings.maxAnswers, question.scope); maxAnswers = jme.evaluate(settings.maxAnswers,this.question.scope); if(maxAnswers && maxAnswers.type=='number') { settings.maxAnswers = maxAnswers.value; } else { this.error('part.setting not present','maximum answers'); } var choiceNodes = choicesNode.selectNodes('choice'); var answersNode, answerNodes; //get number of answers and answer order setting if(this.type == '1_n_2' || this.type == 'm_n_2') { // the XML for these parts lists the options in the <choices> tag, but it makes more sense to list them as answers // so swap "answers" and "choices" // this all stems from an extremely bad design decision made very early on this.flipped = true; this.numAnswers = choiceNodes.length; this.numChoices = 1; settings.answerOrder = settings.choiceOrder; settings.choiceOrder = ''; answersNode = choicesNode; answerNodes = choiceNodes; choicesNode = null; } else { this.flipped = false; this.numChoices = choiceNodes.length; answersNode = this.xml.selectSingleNode('answers'); if(answersNode) { tryGetAttribute(settings,null,answersNode,'order','answerOrder'); answerNodes = answersNode.selectNodes('answer'); this.numAnswers = answerNodes.length; } } var def; function loadDef(def,scope,topNode,nodeName) { var values = jme.evaluate(def,scope); if(values.type!='list') { p.error('part.mcq.options def not a list',nodeName); } var numValues = values.value.length; values.value.map(function(value) { var node = xml.ownerDocument.createElement(nodeName); var content = xml.ownerDocument.createElement('content'); var span = xml.ownerDocument.createElement('span'); content.appendChild(span); node.appendChild(content); topNode.appendChild(node); switch(value.type) { case 'string': case 'number': var d = document.createElement('d'); d.innerHTML = value.type == 'string' ? value.value : Numbas.math.niceNumber(value.value); var newNode; try { newNode = xml.ownerDocument.importNode(d,true); } catch(e) { d = Numbas.xml.dp.parseFromString('<d>'+value.value.replace(/&(?!amp;)/g,'&amp;')+'</d>','text/xml').documentElement; newNode = xml.ownerDocument.importNode(d,true); } while(newNode.childNodes.length) { span.appendChild(newNode.childNodes[0]); } break; case 'html': var selection = $(value.value); for(var i=0;i<selection.length;i++) { >>>>>>> var settings = this.settings; util.copyinto(MultipleResponsePart.prototype.settings,settings); } MultipleResponsePart.prototype = /** @lends Numbas.parts.MultipleResponsePart.prototype */ { loadFromXML: function(xml) { var settings = this.settings; var tryGetAttribute = Numbas.xml.tryGetAttribute; var scope = this.getScope(); //get number of answers and answer order setting if(this.type == '1_n_2' || this.type == 'm_n_2') { // the XML for these parts lists the options in the <choices> tag, but it makes more sense to list them as answers // so swap "answers" and "choices" // this all stems from an extremely bad design decision made very early on this.flipped = true; } else { this.flipped = false; } //work out marks available tryGetAttribute(settings,xml,'marking/maxmarks','enabled','maxMarksEnabled'); if(settings.maxMarksEnabled) { tryGetAttribute(this,xml,'marking/maxmarks','value','marks'); } else { tryGetAttribute(this,xml,'.','marks'); } //get minimum marks setting tryGetAttribute(settings,xml,'marking/minmarks','enabled','minMarksEnabled'); if(settings.minMarksEnabled) { tryGetAttribute(settings,xml,'marking/minmarks','value','minimumMarks'); } //get restrictions on number of choices var choicesNode = xml.selectSingleNode('choices'); if(!choicesNode) { this.error('part.mcq.choices missing'); } tryGetAttribute(settings,null,choicesNode,['minimumexpected','maximumexpected','shuffleChoices','displayType'],['minAnswersString','maxAnswersString','shuffleChoices']); var choiceNodes = choicesNode.selectNodes('choice'); var answersNode, answerNodes; if(this.type == '1_n_2' || this.type == 'm_n_2') { // the XML for these parts lists the options in the <choices> tag, but it makes more sense to list them as answers // so swap "answers" and "choices" // this all stems from an extremely bad design decision made very early on this.numAnswers = choiceNodes.length; this.numChoices = 1; answersNode = choicesNode; choicesNode = null; } else { this.numChoices = choiceNodes.length; answersNode = xml.selectSingleNode('answers'); if(answersNode) { tryGetAttribute(settings,null,answersNode,'shuffleAnswers','shuffleAnswers'); answerNodes = answersNode.selectNodes('answer'); this.numAnswers = answerNodes.length; } } var def; function loadDef(def,scope,topNode,nodeName) { var values = jme.evaluate(def,scope); if(values.type!='list') { p.error('part.mcq.options def not a list',{properties: nodeName}); } var numValues = values.value.length; values.value.map(function(value) { var node = xml.ownerDocument.createElement(nodeName); var content = xml.ownerDocument.createElement('content'); var span = xml.ownerDocument.createElement('span'); content.appendChild(span); node.appendChild(content); topNode.appendChild(node); switch(value.type) { case 'string': case 'number': var d = document.createElement('d'); d.innerHTML = value.type == 'string' ? value.value : Numbas.math.niceNumber(value.value); var newNode;
<<<<<<< const { channel } = this.props; const { lastRead } = this.state; if (!this.isActive()) { const unread = channel.countUnread(lastRead); ======= const channel = this.props.channel; const isActive = this.props.activeChannel && this.props.activeChannel.cid === channel.cid; if (!isActive) { const unread = channel.countUnread(); >>>>>>> const { channel } = this.props; if (!this.isActive()) { const unread = channel.countUnread();
<<<<<<< debug: this._config.debug, endPoint: this._config.overPassEndPoint, minZoom: layerModel.get('minZoom'), timeout: this._config.overPassTimeout, retryOnTimeout: true, query: overPassRequest, beforeRequest: () => { ======= 'debug': this._config.debug, 'endPoint': this._config.overPassEndPoint, 'minZoom': layerModel.get('minZoom'), 'timeout': this._config.overPassTimeout, 'retryOnTimeout': true, 'query': overPassRequest, loadedBounds: [ layerModel.get('cacheBounds') ], 'beforeRequest': () => { >>>>>>> debug: this._config.debug, endPoint: this._config.overPassEndPoint, minZoom: layerModel.get('minZoom'), timeout: this._config.overPassTimeout, retryOnTimeout: true, query: overPassRequest, loadedBounds: [ layerModel.get('cacheBounds') ], beforeRequest: () => { <<<<<<< .on('ready', (layer) => { const rootLayer = this._buildRootLayer(layerModel); ======= .on('ready', layer => { >>>>>>> .on('ready', (layer) => {
<<<<<<< _setLayerStateSuccess(theme, layer, filePath) { ======= _setLayerStateSuccess (theme, layer, bounds, filePath) { >>>>>>> _setLayerStateSuccess(theme, layer, bounds, filePath) { <<<<<<< }, ======= 'layers.$.cacheBounds': bounds, } >>>>>>> 'layers.$.cacheBounds': bounds, }, <<<<<<< }, ======= 'layers.$.cacheBounds': null, } >>>>>>> 'layers.$.cacheBounds': null, },
<<<<<<< .on('error', (error) => { new GpxErrorNotificationView({ model: layerModel, error: error.error[0].message, }).open(); ======= .on('error', function(xhr) { if (xhr.error.status === 404) { new GpxErrorNotificationView({ 'model': layerModel, 'error': document.l10n.getSync('fileNotFound'), }).open(); } >>>>>>> .on('error', (xhr) => { if (xhr.error.status === 404) { new GpxErrorNotificationView({ model: layerModel, error: document.l10n.getSync('fileNotFound'), }).open(); } <<<<<<< .on('error', (error) => { new CsvErrorNotificationView({ model: layerModel, error: error.error[0].message, }).open(); ======= .on('error', function(xhr) { if (xhr.error.status === 404) { new CsvErrorNotificationView({ 'model': layerModel, 'error': document.l10n.getSync('fileNotFound'), }).open(); } >>>>>>> .on('error', (xhr) => { if (xhr.error.status === 404) { new CsvErrorNotificationView({ model: layerModel, error: document.l10n.getSync('fileNotFound'), }).open(); } <<<<<<< .on('error', (error) => { new GeoJsonErrorNotificationView({ model: layerModel, error: error.error[0].message, }).open(); ======= .on('error', function(xhr) { if (xhr.error.status === 404) { new GeoJsonErrorNotificationView({ 'model': layerModel, 'error': document.l10n.getSync('fileNotFound'), }).open(); } >>>>>>> .on('error', (xhr) => { if (xhr.error.status === 404) { new GeoJsonErrorNotificationView({ model: layerModel, error: document.l10n.getSync('fileNotFound'), }).open(); } <<<<<<< .on('error', (error) => { new GeoJsonErrorNotificationView({ model: layerModel, error: error.error[0].message, }).open(); }) .on('ready', (layer) => { ======= .on('ready', layer => { >>>>>>> .on('ready', (layer) => {
<<<<<<< ======= let version = '0.8.10'; >>>>>>> <<<<<<< 'osm': { 'name': 'OpenStreetMap', 'attribution': 'Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>', 'urlTemplate': ['//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'], ======= 'osmFr': { 'name': 'OpenStreetMap Français', 'attribution': 'Données &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>', 'urlTemplate': ['//{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png'], 'minZoom': 0, 'maxZoom': 20, }, 'osmFrBano': { 'name': 'OpenStreetMap Français + BANO', 'attribution': 'Données &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> et <a href="https://openstreetmap.fr/bano" target="_blank">BANO</a>', 'urlTemplate': [ '//{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', '//{s}.layers.openstreetmap.fr/bano/{z}/{x}/{y}.png' ], >>>>>>> 'osm': { 'name': 'OpenStreetMap', 'attribution': 'Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>', 'urlTemplate': ['//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'], <<<<<<< 'osmFr': { 'name': 'OpenStreetMap Français', 'attribution': 'Données &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>', 'urlTemplate': ['http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png'], 'minZoom': 0, 'maxZoom': 20, }, 'osmFrBano': { 'name': 'OpenStreetMap Français + BANO', 'attribution': 'Données &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> et <a href="https://openstreetmap.fr/bano" target="_blank">BANO</a>', 'urlTemplate': [ 'http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', 'http://{s}.layers.openstreetmap.fr/bano/{z}/{x}/{y}.png' ], 'minZoom': 0, 'maxZoom': 19, }, 'cadastre': { 'name': 'Cadastre Français', 'attribution': 'Données &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>', 'urlTemplate': ['http://tms.cadastre.openstreetmap.fr/*/tout/{z}/{x}/{y}.png'], 'minZoom': 0, 'maxZoom': 22, }, ======= 'osmFr': { 'name': 'OpenStreetMap Français', 'attribution': 'Données &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>', 'urlTemplate': ['//{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png'], 'minZoom': 0, 'maxZoom': 20, }, 'osmFrBano': { 'name': 'OpenStreetMap Français + BANO', 'attribution': 'Données &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> et <a href="https://openstreetmap.fr/bano" target="_blank">BANO</a>', 'urlTemplate': [ '//{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', '//{s}.layers.openstreetmap.fr/bano/{z}/{x}/{y}.png' ], 'minZoom': 0, 'maxZoom': 19, }, 'cadastre': { 'name': 'Cadastre Français', 'attribution': 'Données &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>', 'urlTemplate': ['//tms.cadastre.openstreetmap.fr/*/tout/{z}/{x}/{y}.png'], 'minZoom': 0, 'maxZoom': 22, }, >>>>>>> 'osmFr': { 'name': 'OpenStreetMap Français', 'attribution': 'Données &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>', 'urlTemplate': ['//{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png'], 'minZoom': 0, 'maxZoom': 20, }, 'osmFrBano': { 'name': 'OpenStreetMap Français + BANO', 'attribution': 'Données &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> et <a href="https://openstreetmap.fr/bano" target="_blank">BANO</a>', 'urlTemplate': [ '//{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', '//{s}.layers.openstreetmap.fr/bano/{z}/{x}/{y}.png' ], 'minZoom': 0, 'maxZoom': 19, }, 'cadastre': { 'name': 'Cadastre Français', 'attribution': 'Données &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>', 'urlTemplate': ['//tms.cadastre.openstreetmap.fr/*/tout/{z}/{x}/{y}.png'], 'minZoom': 0, 'maxZoom': 22, },
<<<<<<< Object.keys( process.env ) .sort( ( x, y ) => x.length < y.length ) // sort by descending length to prevent partial replacement .forEach( key => { const regex = new RegExp( `\\$${ key }|%${ key }%`, "i" ); arg = arg.replace( regex, process.env[ key ] ); } ); ======= Object.keys( process.env ).forEach( key => { const regex = new RegExp( `\\$${ key }|%${ key }%`, "ig" ); arg = arg.replace( regex, process.env[ key ] ); } ); >>>>>>> Object.keys( process.env ) .sort( ( x, y ) => x.length < y.length ) // sort by descending length to prevent partial replacement .forEach( key => { const regex = new RegExp( `\\$${ key }|%${ key }%`, "ig" ); arg = arg.replace( regex, process.env[ key ] ); } );
<<<<<<< this.forceParse = true; if ('forceParse' in options) { this.forceParse = options.forceParse; } else if ('dateForceParse' in this.element.data()) { this.forceParse = this.element.data('date-force-parse'); } this.picker = $(DPGlobal.template); this._buildEvents(); this._attachEvents(); ======= this._attachEvents(); this.picker = $(DPGlobal.template) .appendTo(this.isInline ? this.element : 'body') .on({ click: $.proxy(this.click, this), mousedown: $.proxy(this.mousedown, this) }); >>>>>>> this.picker = $(DPGlobal.template); this._buildEvents(); this._attachEvents(); <<<<<<< ======= $(document).on('mousedown', function (e) { // Clicked outside the datepicker, hide it if ($(e.target).closest('.datepicker.datepicker-inline, .datepicker.datepicker-dropdown').length === 0) { that.hide(); } }); >>>>>>> <<<<<<< this.clearBtn = (options.clearBtn||this.element.data('date-clear-btn')||false); this.calendarWeeks = false; if ('calendarWeeks' in options) { this.calendarWeeks = options.calendarWeeks; } else if ('dateCalendarWeeks' in this.element.data()) { this.calendarWeeks = this.element.data('date-calendar-weeks'); } if (this.calendarWeeks) ======= if (this.o.calendarWeeks) >>>>>>> if (this.o.calendarWeeks) <<<<<<< this._allow_update = false; this.weekStart = ((options.weekStart||this.element.data('date-weekstart')||dates[this.language].weekStart||0) % 7); this.weekEnd = ((this.weekStart + 6) % 7); this.startDate = -Infinity; this.endDate = Infinity; this.daysOfWeekDisabled = []; this.beforeShowDay = options.beforeShowDay || $.noop; this.setStartDate(options.startDate||this.element.data('date-startdate')); this.setEndDate(options.endDate||this.element.data('date-enddate')); this.setDaysOfWeekDisabled(options.daysOfWeekDisabled||this.element.data('date-days-of-week-disabled')); ======= this.setStartDate(this.o.startDate); this.setEndDate(this.o.endDate); this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled); >>>>>>> this._allow_update = false; this.setStartDate(this.o.startDate); this.setEndDate(this.o.endDate); this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled); <<<<<<< this.picker.hide().detach(); this._detachSecondaryEvents(); this.viewMode = this.startViewMode; ======= this.picker.hide(); $(window).off('resize', this.place); this.viewMode = this.o.startView; >>>>>>> this.picker.hide().detach(); this._detachSecondaryEvents(); this.viewMode = this.o.startView; <<<<<<< clsName = this.getClassNames(prevMonth); clsName.push('day'); var before = this.beforeShowDay(prevMonth); if (before === undefined) before = {}; else if (typeof(before) === 'boolean') before = {enabled: before}; else if (typeof(before) === 'string') before = {classes: before}; if (before.enabled === false) clsName.push('disabled'); if (before.classes) clsName = clsName.concat(before.classes.split(/\s+/)); if (before.tooltip) tooltip = before.tooltip; clsName = $.unique(clsName); html.push('<td class="'+clsName.join(' ')+'"' + (tooltip ? ' title="'+tooltip+'"' : '') + '>'+prevMonth.getUTCDate() + '</td>'); if (prevMonth.getUTCDay() == this.weekEnd) { ======= clsName = ''; if (prevMonth.getUTCFullYear() < year || (prevMonth.getUTCFullYear() == year && prevMonth.getUTCMonth() < month)) { clsName += ' old'; } else if (prevMonth.getUTCFullYear() > year || (prevMonth.getUTCFullYear() == year && prevMonth.getUTCMonth() > month)) { clsName += ' new'; } // Compare internal UTC date with local today, not UTC today if (this.o.todayHighlight && prevMonth.getUTCFullYear() == today.getFullYear() && prevMonth.getUTCMonth() == today.getMonth() && prevMonth.getUTCDate() == today.getDate()) { clsName += ' today'; } if (currentDate && prevMonth.valueOf() == currentDate) { clsName += ' active'; } if (prevMonth.valueOf() < this.o.startDate || prevMonth.valueOf() > this.o.endDate || $.inArray(prevMonth.getUTCDay(), this.o.daysOfWeekDisabled) !== -1) { clsName += ' disabled'; } html.push('<td class="day'+clsName+'">'+prevMonth.getUTCDate() + '</td>'); if (prevMonth.getUTCDay() == this.o.weekEnd) { >>>>>>> clsName = this.getClassNames(prevMonth); clsName.push('day'); var before = this.o.beforeShowDay(prevMonth); if (before === undefined) before = {}; else if (typeof(before) === 'boolean') before = {enabled: before}; else if (typeof(before) === 'string') before = {classes: before}; if (before.enabled === false) clsName.push('disabled'); if (before.classes) clsName = clsName.concat(before.classes.split(/\s+/)); if (before.tooltip) tooltip = before.tooltip; clsName = $.unique(clsName); html.push('<td class="'+clsName.join(' ')+'"' + (tooltip ? ' title="'+tooltip+'"' : '') + '>'+prevMonth.getUTCDate() + '</td>'); if (prevMonth.getUTCDay() == this.o.weekEnd) { <<<<<<< this._trigger('changeMonth', this.viewDate); if ( this.minViewMode == 1 ) { ======= this.element.trigger({ type: 'changeMonth', date: this.viewDate }); if (this.o.minViewMode === 1) { >>>>>>> this._trigger('changeMonth', this.viewDate); if (this.o.minViewMode === 1) { <<<<<<< this._trigger('changeYear', this.viewDate); if ( this.minViewMode == 2 ) { ======= this.element.trigger({ type: 'changeYear', date: this.viewDate }); if (this.o.minViewMode === 2) { >>>>>>> this._trigger('changeYear', this.viewDate); if (this.o.minViewMode === 2) { <<<<<<< var DateRangePicker = function(element, options){ this.element = $(element); this.inputs = $.map(options.inputs, function(i){ return i.jquery ? i[0] : i; }); delete options.inputs; $(this.inputs) .datepicker(options) .bind('changeDate', $.proxy(this.dateUpdated, this)); this.pickers = $.map(this.inputs, function(i){ return $(i).data('datepicker'); }); this.updateDates(); }; DateRangePicker.prototype = { updateDates: function(){ this.dates = $.map(this.pickers, function(i){ return i.date; }); this.updateRanges(); }, updateRanges: function(){ var range = $.map(this.dates, function(d){ return d.valueOf(); }); $.each(this.pickers, function(i, p){ p.setRange(range); }); }, dateUpdated: function(e){ var dp = $(e.target).data('datepicker'), new_date = dp.getUTCDate(), i = $.inArray(e.target, this.inputs), l = this.inputs.length; if (i == -1) return; if (new_date < this.dates[i]){ // Date being moved earlier/left while (i>=0 && new_date < this.dates[i]){ this.pickers[i--].setUTCDate(new_date); } } else if (new_date > this.dates[i]){ // Date being moved later/right while (i<l && new_date > this.dates[i]){ this.pickers[i++].setUTCDate(new_date); } } this.updateDates(); }, remove: function(){ $.map(this.pickers, function(p){ p.remove(); }); delete this.element.data().datepicker; } }; var old = $.fn.datepicker; ======= function opts_from_el(el, prefix){ // Derive options from element data-attrs var data = $(el).data(), out = {}, inkey, replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])'), prefix = new RegExp('^' + prefix.toLowerCase()); for (var key in data) if (prefix.test(key)){ inkey = key.replace(replace, function(_,a){ return a.toLowerCase(); }); out[inkey] = data[key]; } return out; } function opts_from_locale(lang){ // Derive options from locale plugins var out = {}; // Check if "de-DE" style date is available, if not language should // fallback to 2 letter code eg "de" if (!dates[lang]) { lang = lang.split('-')[0] if (!dates[lang]) return; } var d = dates[lang]; $.each($.fn.datepicker.locale_opts, function(i,k){ if (k in d) out[k] = d[k]; }); return out; } >>>>>>> var DateRangePicker = function(element, options){ this.element = $(element); this.inputs = $.map(options.inputs, function(i){ return i.jquery ? i[0] : i; }); delete options.inputs; $(this.inputs) .datepicker(options) .bind('changeDate', $.proxy(this.dateUpdated, this)); this.pickers = $.map(this.inputs, function(i){ return $(i).data('datepicker'); }); this.updateDates(); }; DateRangePicker.prototype = { updateDates: function(){ this.dates = $.map(this.pickers, function(i){ return i.date; }); this.updateRanges(); }, updateRanges: function(){ var range = $.map(this.dates, function(d){ return d.valueOf(); }); $.each(this.pickers, function(i, p){ p.setRange(range); }); }, dateUpdated: function(e){ var dp = $(e.target).data('datepicker'), new_date = dp.getUTCDate(), i = $.inArray(e.target, this.inputs), l = this.inputs.length; if (i == -1) return; if (new_date < this.dates[i]){ // Date being moved earlier/left while (i>=0 && new_date < this.dates[i]){ this.pickers[i--].setUTCDate(new_date); } } else if (new_date > this.dates[i]){ // Date being moved later/right while (i<l && new_date > this.dates[i]){ this.pickers[i++].setUTCDate(new_date); } } this.updateDates(); }, remove: function(){ $.map(this.pickers, function(p){ p.remove(); }); delete this.element.data().datepicker; } }; function opts_from_el(el, prefix){ // Derive options from element data-attrs var data = $(el).data(), out = {}, inkey, replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])'), prefix = new RegExp('^' + prefix.toLowerCase()); for (var key in data) if (prefix.test(key)){ inkey = key.replace(replace, function(_,a){ return a.toLowerCase(); }); out[inkey] = data[key]; } return out; } function opts_from_locale(lang){ // Derive options from locale plugins var out = {}; // Check if "de-DE" style date is available, if not language should // fallback to 2 letter code eg "de" if (!dates[lang]) { lang = lang.split('-')[0] if (!dates[lang]) return; } var d = dates[lang]; $.each($.fn.datepicker.locale_opts, function(i,k){ if (k in d) out[k] = d[k]; }); return out; } var old = $.fn.datepicker; <<<<<<< if ($this.is('.input-daterange') || options.inputs){ var opts = { inputs: options.inputs || $this.find('input').toArray() }; $this.data('datepicker', (data = new DateRangePicker(this, $.extend(opts, $.fn.datepicker.defaults,options)))); } else{ $this.data('datepicker', (data = new Datepicker(this, $.extend({}, $.fn.datepicker.defaults,options)))); } ======= var elopts = opts_from_el(this, 'date'), // Preliminary otions xopts = $.extend({}, $.fn.datepicker.defaults, elopts, options), locopts = opts_from_locale(xopts.language), // Options priority: js args, data-attrs, locales, defaults opts = $.extend({}, $.fn.datepicker.defaults, locopts, elopts, options) $this.data('datepicker', (data = new Datepicker(this, opts))); >>>>>>> var elopts = opts_from_el(this, 'date'), // Preliminary otions xopts = $.extend({}, $.fn.datepicker.defaults, elopts, options), locopts = opts_from_locale(xopts.language), // Options priority: js args, data-attrs, locales, defaults opts = $.extend({}, $.fn.datepicker.defaults, locopts, elopts, options); $this.data('datepicker', (data = new Datepicker(this, opts))); if ($this.is('.input-daterange') || opts.inputs){ var ropts = { inputs: opts.inputs || $this.find('input').toArray() }; $this.data('datepicker', (data = new DateRangePicker(this, $.extend(opts, ropts)))); } else{ $this.data('datepicker', (data = new Datepicker(this, opts))); }
<<<<<<< var old = $.fn.datepicker; ======= var DateRangePicker = function(element, options){ this.element = $(element); this.inputs = $.map(options.inputs, function(i){ return i.jquery ? i[0] : i; }); delete options.inputs; $(this.inputs) .datepicker(options) .bind('changeDate', $.proxy(this.dateUpdated, this)); this.pickers = $.map(this.inputs, function(i){ return $(i).data('datepicker'); }); this.updateDates(); }; DateRangePicker.prototype = { updateDates: function(){ this.dates = $.map(this.pickers, function(i){ return i.date; }); this.updateRanges(); }, updateRanges: function(){ var range = $.map(this.dates, function(d){ return d.valueOf(); }); $.each(this.pickers, function(i, p){ p.setRange(range); }); }, dateUpdated: function(e){ var dp = $(e.target).data('datepicker'), new_date = e.date, i = $.inArray(e.target, this.inputs), l = this.inputs.length; if (i == -1) return; if (new_date < this.dates[i]){ // Date being moved earlier/left while (i>=0 && new_date < this.dates[i]){ this.pickers[i--].setUTCDate(new_date); } } else if (new_date > this.dates[i]){ // Date being moved later/right while (i<l && new_date > this.dates[i]){ this.pickers[i++].setUTCDate(new_date); } } this.updateDates(); }, remove: function(){ $.map(this.pickers, function(p){ p.remove(); }); delete this.element.data().datepicker; } }; >>>>>>> var DateRangePicker = function(element, options){ this.element = $(element); this.inputs = $.map(options.inputs, function(i){ return i.jquery ? i[0] : i; }); delete options.inputs; $(this.inputs) .datepicker(options) .bind('changeDate', $.proxy(this.dateUpdated, this)); this.pickers = $.map(this.inputs, function(i){ return $(i).data('datepicker'); }); this.updateDates(); }; DateRangePicker.prototype = { updateDates: function(){ this.dates = $.map(this.pickers, function(i){ return i.date; }); this.updateRanges(); }, updateRanges: function(){ var range = $.map(this.dates, function(d){ return d.valueOf(); }); $.each(this.pickers, function(i, p){ p.setRange(range); }); }, dateUpdated: function(e){ var dp = $(e.target).data('datepicker'), new_date = e.date, i = $.inArray(e.target, this.inputs), l = this.inputs.length; if (i == -1) return; if (new_date < this.dates[i]){ // Date being moved earlier/left while (i>=0 && new_date < this.dates[i]){ this.pickers[i--].setUTCDate(new_date); } } else if (new_date > this.dates[i]){ // Date being moved later/right while (i<l && new_date > this.dates[i]){ this.pickers[i++].setUTCDate(new_date); } } this.updateDates(); }, remove: function(){ $.map(this.pickers, function(p){ p.remove(); }); delete this.element.data().datepicker; } }; var old = $.fn.datepicker;
<<<<<<< if (this.date < this.o.startDate) { this.viewDate = new Date(this.o.startDate); } else if (this.date > this.o.endDate) { this.viewDate = new Date(this.o.endDate); ======= if (this.date < this.startDate) { this.viewDate = new Date(this.startDate); this.date = new Date(this.startDate); } else if (this.date > this.endDate) { this.viewDate = new Date(this.endDate); this.date = new Date(this.endDate); >>>>>>> if (this.date < this.o.startDate) { this.viewDate = new Date(this.o.startDate); this.date = new Date(this.o.startDate); } else if (this.date > this.o.endDate) { this.viewDate = new Date(this.o.endDate); this.date = new Date(this.o.endDate);
<<<<<<< }); test('Changing view mode triggers changeViewMode', function () { var viewMode = -1, triggered = 0; this.input.val('22-07-2016'); this.dp.update(); this.input.on('changeViewMode', function (e) { viewMode = e.viewMode; triggered++; }); // change from days to months this.picker.find('.datepicker-days .datepicker-switch').click(); equal(triggered, 1); equal(viewMode, 1); // change from months to years this.picker.find('.datepicker-months .datepicker-switch').click(); equal(triggered, 2); equal(viewMode, 2); // change from years to decade this.picker.find('.datepicker-years .datepicker-switch').click(); equal(triggered, 3); equal(viewMode, 3); // change from decades to centuries this.picker.find('.datepicker-decades .datepicker-switch').click(); equal(triggered, 4); equal(viewMode, 4); }); ======= }) test('Manually changing date should not trigger changeDate until we finish typing(it meets the required format)', function(){ var triggers = 0; var expectedTriggers = 1; this.input.on('changeDate', function(){ triggers++ }); this.input.focus(); this.input.val('04-03-20'); this.dp.update(); this.input.val('04-03-201'); this.dp.update(); this.input.val('04-03-2013'); this.dp.update(); equal(triggers, expectedTriggers); }); >>>>>>> }); test('Changing view mode triggers changeViewMode', function () { var viewMode = -1, triggered = 0; this.input.val('22-07-2016'); this.dp.update(); this.input.on('changeViewMode', function (e) { viewMode = e.viewMode; triggered++; }); // change from days to months this.picker.find('.datepicker-days .datepicker-switch').click(); equal(triggered, 1); equal(viewMode, 1); // change from months to years this.picker.find('.datepicker-months .datepicker-switch').click(); equal(triggered, 2); equal(viewMode, 2); // change from years to decade this.picker.find('.datepicker-years .datepicker-switch').click(); equal(triggered, 3); equal(viewMode, 3); // change from decades to centuries this.picker.find('.datepicker-decades .datepicker-switch').click(); equal(triggered, 4); equal(viewMode, 4); }); test('Manually changing date should not trigger changeDate until we finish typing(it meets the required format)', function(){ var triggers = 0; var expectedTriggers = 1; this.input.on('changeDate', function(){ triggers++ }); this.input.focus(); this.input.val('04-03-20'); this.dp.update(); this.input.val('04-03-201'); this.dp.update(); this.input.val('04-03-2013'); this.dp.update(); equal(triggers, expectedTriggers); });
<<<<<<< var plc = String(o.orientation).toLowerCase().split(/\s+/g), _plc = o.orientation.toLowerCase(); plc = $.grep(plc, function(word){ return (/^auto|left|right|top|bottom$/).test(word); }); o.orientation = {x: 'auto', y: 'auto'}; if (!_plc || _plc === 'auto') ; // no action else if (plc.length === 1){ switch (plc[0]){ case 'top': case 'bottom': o.orientation.y = plc[0]; break; case 'left': case 'right': o.orientation.x = plc[0]; break; } } else { _plc = $.grep(plc, function(word){ return (/^left|right$/).test(word); }); o.orientation.x = _plc[0] || 'auto'; _plc = $.grep(plc, function(word){ return (/^top|bottom$/).test(word); }); o.orientation.y = _plc[0] || 'auto'; } ======= o.datesDisabled = o.datesDisabled||[]; if (!$.isArray(o.datesDisabled)) { o.datesDisabled = []; o.datesDisabled.push( DPGlobal.parseDate(o.datesDisabled, format, o.language) ); } o.datesDisabled = $.map(o.datesDisabled, function (d) { return DPGlobal.parseDate(d, format, o.language); }); >>>>>>> o.datesDisabled = o.datesDisabled||[]; if (!$.isArray(o.datesDisabled)) { o.datesDisabled = []; o.datesDisabled.push( DPGlobal.parseDate(o.datesDisabled, format, o.language) ); } o.datesDisabled = $.map(o.datesDisabled, function (d) { return DPGlobal.parseDate(d, format, o.language); }); var plc = String(o.orientation).toLowerCase().split(/\s+/g), _plc = o.orientation.toLowerCase(); plc = $.grep(plc, function(word){ return (/^auto|left|right|top|bottom$/).test(word); }); o.orientation = {x: 'auto', y: 'auto'}; if (!_plc || _plc === 'auto') ; // no action else if (plc.length === 1){ switch (plc[0]){ case 'top': case 'bottom': o.orientation.y = plc[0]; break; case 'left': case 'right': o.orientation.x = plc[0]; break; } } else { _plc = $.grep(plc, function(word){ return (/^left|right$/).test(word); }); o.orientation.x = _plc[0] || 'auto'; _plc = $.grep(plc, function(word){ return (/^top|bottom$/).test(word); }); o.orientation.y = _plc[0] || 'auto'; }
<<<<<<< !function( $ ) { ======= (function($, undefined) { var $window = $(window); >>>>>>> (function($, undefined) { var $window = $(window); <<<<<<< if ( currentDate ) { if ( this.multidate != true && date.valueOf() == currentDate) cls.push('active'); else if ( this.multidate == true && this.dateSelected[ date.valueOf() ] ) cls.push('active'); ======= if (date.valueOf() == currentDate) { cls.push('active'); >>>>>>> if (currentDate && date.valueOf() == currentDate) { { if ( this.multidate != true && date.valueOf() == currentDate) cls.push('active'); else if ( this.multidate == true && this.dateSelected[ date.valueOf() ] ) cls.push('active'); <<<<<<< this.element.val(""); else this.element.find('input').val(""); ======= element = this.element; else if (this.component) element = this.element.find('input'); if (element) element.val("").change(); >>>>>>> element = this.element; else if (this.component) element = this.element.find('input'); if (element) element.val("").change(); <<<<<<< this.viewDate = new Date(date); if ( this.multidate == true ) this._toggle_multidate( date ); ======= this.viewDate = date && new Date(date); >>>>>>> this.viewDate = date && new Date(date); if ( this.multidate == true ) this._toggle_multidate( date ); <<<<<<< ======= if (!date) return ''; if (typeof format === 'string') format = DPGlobal.parseFormat(format); >>>>>>> if (!date) return ''; if (typeof format === 'string') format = DPGlobal.parseFormat(format);
<<<<<<< }); test("Picker is shown on input focus when showOnFocus is not defined", function () { var input = $('<input />') .appendTo('#qunit-fixture') .val('2014-01-01') .datepicker({ }), dp = input.data('datepicker'), picker = dp.picker; input.focus(); ok(picker.is(":visible"), "Datepicker is visible"); }); test("Picker is shown on input focus when showOnFocus is true", function () { var input = $('<input />') .appendTo('#qunit-fixture') .val('2014-01-01') .datepicker({ showOnFocus: true }), dp = input.data('datepicker'), picker = dp.picker; input.focus(); ok(picker.is(":visible"), "Datepicker is visible"); }); test("Picker is hidden on input focus when showOnFocus is false", function () { var input = $('<input />') .appendTo('#qunit-fixture') .val('2014-01-01') .datepicker({ showOnFocus: false }), dp = input.data('datepicker'), picker = dp.picker; input.focus(); ok(picker.is(":hidden"), "Datepicker is hidden"); }); test('Container', function(){ var testContainer = $('<div class="date-picker-container"/>') .appendTo('#qunit-fixture'), input = $('<input />') .appendTo('#qunit-fixture') .val('2012-10-26') .datepicker({ format: 'yyyy-mm-dd', container: '.date-picker-container', startDate: new Date(2012, 9, 26) }), dp = input.data('datepicker'), target = dp.picker; input.focus(); equal(target.parent()[0], testContainer[0], 'Container is not the testContainer that was specificed'); ======= }); test('Default View Date', function(){ var input = $('<input />') .appendTo('#qunit-fixture') .datepicker({ format: 'yyyy-mm-dd', defaultViewDate: { year: 1977, month: 04, day: 25 } }), dp = input.data('datepicker'), picker = dp.picker, target; input.focus(); equal(picker.find('.datepicker-days thead .datepicker-switch').text(), 'May 1977'); >>>>>>> }); test("Picker is shown on input focus when showOnFocus is not defined", function () { var input = $('<input />') .appendTo('#qunit-fixture') .val('2014-01-01') .datepicker({ }), dp = input.data('datepicker'), picker = dp.picker; input.focus(); ok(picker.is(":visible"), "Datepicker is visible"); }); test("Picker is shown on input focus when showOnFocus is true", function () { var input = $('<input />') .appendTo('#qunit-fixture') .val('2014-01-01') .datepicker({ showOnFocus: true }), dp = input.data('datepicker'), picker = dp.picker; input.focus(); ok(picker.is(":visible"), "Datepicker is visible"); }); test("Picker is hidden on input focus when showOnFocus is false", function () { var input = $('<input />') .appendTo('#qunit-fixture') .val('2014-01-01') .datepicker({ showOnFocus: false }), dp = input.data('datepicker'), picker = dp.picker; input.focus(); ok(picker.is(":hidden"), "Datepicker is hidden"); }); test('Container', function(){ var testContainer = $('<div class="date-picker-container"/>') .appendTo('#qunit-fixture'), input = $('<input />') .appendTo('#qunit-fixture') .val('2012-10-26') .datepicker({ format: 'yyyy-mm-dd', container: '.date-picker-container', startDate: new Date(2012, 9, 26) }), dp = input.data('datepicker'), target = dp.picker; input.focus(); equal(target.parent()[0], testContainer[0], 'Container is not the testContainer that was specificed'); }); test('Default View Date', function(){ var input = $('<input />') .appendTo('#qunit-fixture') .datepicker({ format: 'yyyy-mm-dd', defaultViewDate: { year: 1977, month: 04, day: 25 } }), dp = input.data('datepicker'), picker = dp.picker, target; input.focus(); equal(picker.find('.datepicker-days thead .datepicker-switch').text(), 'May 1977');
<<<<<<< currentDate = this.date && this.date.valueOf(); this.picker.find('.datepicker-days thead th.switch') ======= currentDate = this.date && this.date.valueOf(), today = new Date(); this.picker.find('.datepicker-days thead th.datepicker-switch') >>>>>>> currentDate = this.date && this.date.valueOf(); this.picker.find('.datepicker-days thead th.datepicker-switch')
<<<<<<< tooltip, currentYear; if (isNaN(year) || isNaN(month)) return; ======= todaytxt = dates[this.o.language].today || dates['en'].today || '', cleartxt = dates[this.o.language].clear || dates['en'].clear || '', tooltip; >>>>>>> todaytxt = dates[this.o.language].today || dates['en'].today || '', cleartxt = dates[this.o.language].clear || dates['en'].clear || '', tooltip; if (isNaN(year) || isNaN(month)) return;
<<<<<<< o.showOnFocus = o.showOnFocus !== undefined ? o.showOnFocus : true; }, ======= if (o.defaultViewDate) { var year = o.defaultViewDate.year || new Date().getFullYear(); var month = o.defaultViewDate.month || 0; var day = o.defaultViewDate.day || 1; o.defaultViewDate = UTCDate(year, month, day); } else { o.defaultViewDate = UTCToday(); } }, >>>>>>> if (o.defaultViewDate) { var year = o.defaultViewDate.year || new Date().getFullYear(); var month = o.defaultViewDate.month || 0; var day = o.defaultViewDate.day || 1; o.defaultViewDate = UTCDate(year, month, day); } else { o.defaultViewDate = UTCToday(); } o.showOnFocus = o.showOnFocus !== undefined ? o.showOnFocus : true; },
<<<<<<< //Loop through all of Tink's pointers (there will usually //just be one) this.pointers.forEach(pointer => { pointer.shouldBeHand = false; //Loop through all the button-like sprites that were created //using the `makeInteractive` method this.buttons.forEach(o => { ======= //Loop through all of Tink's pointers (there will usually //just be one) this.pointers.forEach(function (pointer) { >>>>>>> //Loop through all of Tink's pointers (there will usually //just be one) this.pointers.forEach(pointer => { pointer.shouldBeHand = false; //Loop through all the button-like sprites that were created //using the `makeInteractive` method this.buttons.forEach(o => { <<<<<<< //Figure out if the pointer is touching the sprite let hit = pointer.hitTestSprite(o); ======= //Only do this if the interactive object is enabled if (o.enabled) { >>>>>>> //Figure out if the pointer is touching the sprite let hit = pointer.hitTestSprite(o); //Only do this if the interactive object is enabled if (o.enabled) { <<<<<<< } } ======= } }); >>>>>>> } } }); <<<<<<< //# sourceMappingURL=tink.js.map ======= return Tink; })(); >>>>>>> //# sourceMappingURL=tink.js.map return Tink; })();
<<<<<<< ======= Post.persistence().read(function(models) { equals(models.length, 1) same(models[0].attr(), post.attr()) }) >>>>>>> <<<<<<< ======= Post.persistence().read(function(models) { equals(models.length, 1) same(models[0].attr(), post.attr()) }) >>>>>>>