conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
updateBrowserHistory () {
// Ensure history state does not already contain our modal name to avoid double-pushing
if (!history.state || !history.state[this.modalName]) {
// Push to history so that the page is not lost on browser back button press
history.pushState({ [this.modalName]: true }, '')
}
// Listen for back button presses
window.addEventListener('popstate', this.handlePopState, false)
}
handlePopState (event) {
// Close the modal if the history state no longer contains our modal name
if (!event.state || !event.state[this.modalName]) {
this.closeModal({ manualClose: false })
}
// When the browser back button is pressed and uppy is now the latest entry in the history but the modal is closed, fix the history by removing the uppy history entry
// This occurs when another entry is added into the history state while the modal is open, and then the modal gets manually closed
// Solves PR #575 (https://github.com/transloadit/uppy/pull/575)
if (!this.isModalOpen() && event.state && event.state[this.modalName]) {
history.go(-1)
}
}
=======
setFocusToBrowse () {
const browseBtn = this.el.querySelector('.uppy-Dashboard-browse')
if (browseBtn) browseBtn.focus()
}
>>>>>>>
updateBrowserHistory () {
// Ensure history state does not already contain our modal name to avoid double-pushing
if (!history.state || !history.state[this.modalName]) {
// Push to history so that the page is not lost on browser back button press
history.pushState({ [this.modalName]: true }, '')
}
// Listen for back button presses
window.addEventListener('popstate', this.handlePopState, false)
}
handlePopState (event) {
// Close the modal if the history state no longer contains our modal name
if (!event.state || !event.state[this.modalName]) {
this.closeModal({ manualClose: false })
}
// When the browser back button is pressed and uppy is now the latest entry in the history but the modal is closed, fix the history by removing the uppy history entry
// This occurs when another entry is added into the history state while the modal is open, and then the modal gets manually closed
// Solves PR #575 (https://github.com/transloadit/uppy/pull/575)
if (!this.isModalOpen() && event.state && event.state[this.modalName]) {
history.go(-1)
}
}
setFocusToBrowse () {
const browseBtn = this.el.querySelector('.uppy-Dashboard-browse')
if (browseBtn) browseBtn.focus()
} |
<<<<<<<
const Provider = require('../server/Provider')
const emitSocketProgress = require('../utils/emitSocketProgress')
const getSocketHost = require('../utils/getSocketHost')
const settle = require('../utils/settle')
const limitPromises = require('../utils/limitPromises')
=======
const { Provider, RequestClient } = require('../server')
const {
emitSocketProgress,
getSocketHost,
settle,
limitPromises
} = require('../core/Utils')
>>>>>>>
const { Provider, RequestClient } = require('../server')
const emitSocketProgress = require('../utils/emitSocketProgress')
const getSocketHost = require('../utils/getSocketHost')
const settle = require('../utils/settle')
const limitPromises = require('../utils/limitPromises') |
<<<<<<<
this.title = this.opts.title || 'Google Drive'
=======
Provider.initPlugin(this, opts)
this.title = 'Google Drive'
>>>>>>>
this.title = this.opts.title || 'Google Drive'
Provider.initPlugin(this, opts)
this.title = this.opts.title || 'Google Drive' |
<<<<<<<
const isUploadInProgress = inProgressFiles.length > 0
const resumableUploads = state.capabilities.resumableUploads || false
=======
const resumableUploads = capabilities.resumableUploads || false
>>>>>>>
const isUploadInProgress = inProgressFiles.length > 0
const resumableUploads = capabilities.resumableUploads || false
<<<<<<<
error: state.error,
uploadState: this.getUploadingState(isAllErrored, isAllComplete, state.files || {}),
totalProgress: state.totalProgress,
totalSize: totalSize,
totalUploadedSize: totalUploadedSize,
isAllComplete,
isAllPaused,
isAllErrored,
isUploadStarted,
isUploadInProgress,
=======
error,
uploadState: this.getUploadingState(isAllErrored, isAllComplete, files || {}),
allowNewUpload,
totalProgress,
totalSize,
totalUploadedSize,
uploadStarted: uploadStartedFiles.length,
isAllComplete,
isAllPaused,
isAllErrored,
isUploadStarted,
>>>>>>>
error: state.error,
uploadState: this.getUploadingState(isAllErrored, isAllComplete, state.files || {}),
allowNewUpload,
totalProgress,
totalSize,
totalUploadedSize,
isAllComplete,
isAllPaused,
isAllErrored,
isUploadStarted,
isUploadInProgress, |
<<<<<<<
this.plugin.uppy.addFile(tagFile)
}
removeFile (id) {
const { currentSelection } = this.plugin.getPluginState()
this.plugin.setPluginState({
currentSelection: currentSelection.filter((file) => file.id !== id)
})
=======
try {
this.plugin.uppy.addFile(tagFile)
} catch (err) {
// Nothing, restriction errors handled in Core
}
if (!isCheckbox) {
this.donePicking()
}
>>>>>>>
try {
this.plugin.uppy.addFile(tagFile)
} catch (err) {
// Nothing, restriction errors handled in Core
}
}
removeFile (id) {
const { currentSelection } = this.plugin.getPluginState()
this.plugin.setPluginState({
currentSelection: currentSelection.filter((file) => file.id !== id)
}) |
<<<<<<<
output: {
libraryTarget: 'umd',
libraryExport: 'default',
umdNamedDefine: true
},
devtool: 'inline-source-map',
=======
// webpack configuration
output: {
libraryTarget: 'umd',
libraryExport: 'default',
// umdNamedDefine: true
},
devtool: 'inline-source-map',
>>>>>>>
output: {
libraryTarget: 'umd',
libraryExport: 'default',
umdNamedDefine: true
},
devtool: 'inline-source-map',
<<<<<<<
rules: [
{
test: /\.js/,
exclude: /(test|node_modules|bower_components)/,
loader: 'istanbul-instrumenter-loader',
options: {
esModules: true,
presets: [
['@babel/env', {
targets: {
browsers: [
'>0.25%',
'not dead'
]
}
}]
],
plugins: [
...basePlugins
]
},
}
]
// ,
// enforce: 'post',
// }],
=======
rules: [{
test: /\.js/,
exclude: /(test|node_modules|bower_components)/,
loader: 'istanbul-instrumenter-loader',
options: {
esModules: true,
presets: [
['@babel/env', {
targets: {
browsers: [
'>0.25%',
'not dead'
]
}
}]
],
plugins: [
...basePlugins
]
},
enforce: 'post',
}],
>>>>>>>
rules: [
{
test: /\.js/,
exclude: /(test|node_modules|bower_components)/,
loader: 'istanbul-instrumenter-loader',
options: {
esModules: true,
presets: [
['@babel/env', {
targets: {
browsers: [
'>0.25%',
'not dead'
]
}
}]
],
plugins: [
...basePlugins
]
},
}
]
<<<<<<<
// externals: [externals()],
target: 'web'
=======
// externals: [externals()],
target: 'node'
>>>>>>>
target: 'web' |
<<<<<<<
import Plugin from 'lib/plugin';
import {keccak256} from 'js-sha3';
=======
import * as Ethers from 'ethers';
>>>>>>>
import Plugin from 'lib/plugin';
import * as Ethers from 'ethers'; |
<<<<<<<
import React, { useContext } from 'react';
import { Button, Slider, Flex } from 'theme-ui';
=======
import React, { useContext, useEffect, useState } from 'react';
import { Button } from 'theme-ui';
>>>>>>>
import React, { useContext, useEffect, useState } from 'react';
import { Button, Slider, Flex } from 'theme-ui';
<<<<<<<
const Zoom = ({ circular, horizontal, controlType, sx, ...rest }) => {
=======
const Zoom = ({ circular, horizontal, showZoomLevel, sx, ...rest }) => {
>>>>>>>
const Zoom = ({
circular,
horizontal,
controlType,
showZoomLevel,
sx,
...rest
}) => {
<<<<<<<
const { map } = config;
=======
const { map } = config;
const [zoom, setZoom] = useState('');
function displayZoom() {
setZoom(numeral(map.getZoom()).format('0.0'));
}
useEffect(() => {
if (mapExists(map)) {
// map.on('load', () => {
map.on('zoom', () => {
displayZoom();
});
// });
}
}, [map]);
>>>>>>>
const { map } = config;
const [zoom, setZoom] = useState('');
function displayZoom() {
setZoom(numeral(map.getZoom()).format('0.0'));
}
useEffect(() => {
if (mapExists(map)) {
// map.on('load', () => {
map.on('zoom', () => {
displayZoom();
});
// });
}
}, [map]); |
<<<<<<<
// This test is added for the edge case where transactions fail
it('should be able to request a proof from web3 and verify it', function (done) {
eP.getTransactionProof('0xdaa2fcc5d94f03348dc26bfacf84828ff563ccc57f6ab8260d2bd35b5d668ef8').then((result)=>{
EP.transaction(result.path, result.value, result.parentNodes, result.header, result.blockHash).should.be.true()
(false).to.be.true("not a tx. `get` should fail")
}).catch((e)=>{
done()
})
});
=======
});
describe('getTransactionTrieRoot', function () {
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0xb53f752216120e8cbe18783f41c6d960254ad59fac16229d4eaec5f7591319de').then((result)=>{
let trustedTxRoot = "0x76de858022a0904dbc0d6ed58f42423abe3b3ced468f81636d52c74d2186efa3"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0xc55e2b90168af6972193c1f86fa4d7d7b31a29c156665d15b9cd48618b5177ef').then((result)=>{
let trustedTxRoot = "0xb31f174d27b99cdae8e746bd138a01ce60d8dd7b224f7c60845914def05ecc58"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0x299a93acf5b100336455ef6ecda39e22329fb750e6264c8ee44f579947349de9').then((result)=>{
let trustedTxRoot = "0x18f2a30bb2c4d0818a253d287ed8c1defd65d6d3bcf47cc355b4fcf6b17ecf46"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0x4e4b9cd37d9b5bb38941983a34d1539e4930572bdaf41d1aa54ddc738630b1bb').then((result)=>{
let trustedTxRoot = "0xcbd33f19aa3c22fac0c085ed80c05aa52d1429240c20f2751a23ef8922664177"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0x74bdf5450025b8806d55cfbb9b393dce630232f5bf87832ae6b675db9d286ac3').then((result)=>{
let trustedTxRoot = "0xa4e60606f59a911abb9dfd8817e4269d8b7fdef3e729f3645b1f468c280ac68f"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0x84e86114ea47d97e882411db029b5c42e7e25395f279636e4a277ec44dce23a4').then((result)=>{
let trustedTxRoot = "0xf098b19e48f22f7c09c78050f950a88b59487e1547d0a85c3aa82ba2338e37e9"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0x8d0da05c3256da94a4213149de3e17fae7d1fd1b86fd4e57557527325ba87adc').then((result)=>{
let trustedTxRoot = "0x18197cbce03e417d2901174b2ff6f6471b8c9be986d898cc77ee5a0dc511ad5c"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0xe6c0c5e61a52b2226f7730d915e4c1baf606f34719dcfbda7164266cce111ae3').then((result)=>{
let trustedTxRoot = "0x31de9f64927bc2353ccceabdedaf5d221f744849b68fa066bdddc5ed6fc7e7f9"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0x1e1a818d63fd4d03c6125ea4f5e99a27255728a2bad195f858635543a95f1c3f').then((result)=>{
let trustedTxRoot = "0x3a9ff72c3cd0f13edcfae1247baa9a6ae916ac3304943c973c6520544e9e5ea6"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0x598bf980dead5d96ca0e2325f2dbc884ada041ca2e05f8c9bdac1c60926764e0').then((result)=>{
let trustedTxRoot = "0xad6572af16ccec83dae3476a605b9a7190d0dc574cc6d00a16b2e2556f0087ee"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0xed2903beb85ffce50cec37050313951920d997199ff4a4d7b8fbc0b45ca44c84').then((result)=>{
let trustedTxRoot = "0xf7e9dfc1ab46f0b4580c37044f56e7f1c32f42280125b5fb051fc32163af6d33"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0x299a93acf5b100336455ef6ecda39e22329fb750e6264c8ee44f579947349de9').then((result)=>{
let trustedTxRoot = "0x18f2a30bb2c4d0818a253d287ed8c1defd65d6d3bcf47cc355b4fcf6b17ecf46"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0x6afb931aa1008783dedf5c66dc41b1fc8f01bf34ebc183b37110a7a77523e15c').then((result)=>{
let trustedTxRoot = "0xea589e0a2602c8d8cae2259d57ad3a8f98c993b92371cf03963e06ecf3949862"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0xc12e727125b5733a90555a1438ec48b27ffa928b84d39775923afeb229ba1a60').then((result)=>{
let trustedTxRoot = "0xfae44bf08293cad7ec9f1e1d42cfb8398cde79c6b4db2c663c0f9b519f019299"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
>>>>>>>
// This test is added for the edge case where transactions fail
it('should be able to request a proof from web3 and verify it', function (done) {
eP.getTransactionProof('0xdaa2fcc5d94f03348dc26bfacf84828ff563ccc57f6ab8260d2bd35b5d668ef8').then((result)=>{
EP.transaction(result.path, result.value, result.parentNodes, result.header, result.blockHash).should.be.true()
(false).to.be.true("not a tx. `get` should fail")
}).catch((e)=>{
done()
})
});
});
describe('getTransactionTrieRoot', function () {
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0xb53f752216120e8cbe18783f41c6d960254ad59fac16229d4eaec5f7591319de').then((result)=>{
let trustedTxRoot = "0x76de858022a0904dbc0d6ed58f42423abe3b3ced468f81636d52c74d2186efa3"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0xc55e2b90168af6972193c1f86fa4d7d7b31a29c156665d15b9cd48618b5177ef').then((result)=>{
let trustedTxRoot = "0xb31f174d27b99cdae8e746bd138a01ce60d8dd7b224f7c60845914def05ecc58"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0x299a93acf5b100336455ef6ecda39e22329fb750e6264c8ee44f579947349de9').then((result)=>{
let trustedTxRoot = "0x18f2a30bb2c4d0818a253d287ed8c1defd65d6d3bcf47cc355b4fcf6b17ecf46"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0x4e4b9cd37d9b5bb38941983a34d1539e4930572bdaf41d1aa54ddc738630b1bb').then((result)=>{
let trustedTxRoot = "0xcbd33f19aa3c22fac0c085ed80c05aa52d1429240c20f2751a23ef8922664177"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0x74bdf5450025b8806d55cfbb9b393dce630232f5bf87832ae6b675db9d286ac3').then((result)=>{
let trustedTxRoot = "0xa4e60606f59a911abb9dfd8817e4269d8b7fdef3e729f3645b1f468c280ac68f"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0x84e86114ea47d97e882411db029b5c42e7e25395f279636e4a277ec44dce23a4').then((result)=>{
let trustedTxRoot = "0xf098b19e48f22f7c09c78050f950a88b59487e1547d0a85c3aa82ba2338e37e9"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0x8d0da05c3256da94a4213149de3e17fae7d1fd1b86fd4e57557527325ba87adc').then((result)=>{
let trustedTxRoot = "0x18197cbce03e417d2901174b2ff6f6471b8c9be986d898cc77ee5a0dc511ad5c"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0xe6c0c5e61a52b2226f7730d915e4c1baf606f34719dcfbda7164266cce111ae3').then((result)=>{
let trustedTxRoot = "0x31de9f64927bc2353ccceabdedaf5d221f744849b68fa066bdddc5ed6fc7e7f9"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0x1e1a818d63fd4d03c6125ea4f5e99a27255728a2bad195f858635543a95f1c3f').then((result)=>{
let trustedTxRoot = "0x3a9ff72c3cd0f13edcfae1247baa9a6ae916ac3304943c973c6520544e9e5ea6"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0x598bf980dead5d96ca0e2325f2dbc884ada041ca2e05f8c9bdac1c60926764e0').then((result)=>{
let trustedTxRoot = "0xad6572af16ccec83dae3476a605b9a7190d0dc574cc6d00a16b2e2556f0087ee"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0xed2903beb85ffce50cec37050313951920d997199ff4a4d7b8fbc0b45ca44c84').then((result)=>{
let trustedTxRoot = "0xf7e9dfc1ab46f0b4580c37044f56e7f1c32f42280125b5fb051fc32163af6d33"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0x299a93acf5b100336455ef6ecda39e22329fb750e6264c8ee44f579947349de9').then((result)=>{
let trustedTxRoot = "0x18f2a30bb2c4d0818a253d287ed8c1defd65d6d3bcf47cc355b4fcf6b17ecf46"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0x6afb931aa1008783dedf5c66dc41b1fc8f01bf34ebc183b37110a7a77523e15c').then((result)=>{
let trustedTxRoot = "0xea589e0a2602c8d8cae2259d57ad3a8f98c993b92371cf03963e06ecf3949862"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
});
it('should be able to request a TxRoot from web3 and verify it', function (done) {
eP.getTransactionTrieRoot('0xc12e727125b5733a90555a1438ec48b27ffa928b84d39775923afeb229ba1a60').then((result)=>{
let trustedTxRoot = "0xfae44bf08293cad7ec9f1e1d42cfb8398cde79c6b4db2c663c0f9b519f019299"
let resultTxRoot = "0x" + result.toString('hex')
resultTxRoot.should.be.equal(trustedTxRoot)
done()
}).catch((e)=>{console.log(e)})
}); |
<<<<<<<
// console.log("nodeKey != sha3(rlp.encode(currentNode)): ", nodeKey, Buffer.from(sha3(rlp.encode(currentNode)),'hex'))
=======
>>>>>>>
// console.log("nodeKey != sha3(rlp.encode(currentNode)): ", nodeKey, Buffer.from(sha3(rlp.encode(currentNode)),'hex'))
<<<<<<<
// console.log("pathPtr >= path.length ", pathPtr, path.length)
=======
>>>>>>>
// console.log("pathPtr >= path.length ", pathPtr, path.length)
<<<<<<<
// console.log('currentNode[16],rlp.encode(value): ', currentNode[16], rlp.encode(value))
=======
>>>>>>>
// console.log('currentNode[16],rlp.encode(value): ', currentNode[16], rlp.encode(value))
<<<<<<<
// console.log("currentNode[1] == rlp.encode(value) ", currentNode[1], rlp.encode(value))
=======
>>>>>>>
// console.log("currentNode[1] == rlp.encode(value) ", currentNode[1], rlp.encode(value))
<<<<<<<
// console.log("all nodes must be length 17 or 2");
=======
>>>>>>>
// console.log("all nodes must be length 17 or 2"); |
<<<<<<<
language,
=======
loading: false,
>>>>>>>
loading: false,
language,
<<<<<<<
placeholder: "Search for a show...",
=======
language: language,
placeholder: "Search for a show..."
>>>>>>>
placeholder: "Search for a show...", |
<<<<<<<
var cursor = this.writer.selection.cursor;
var node = cursor.node;
=======
var node = this.writer.selection.cursor.node;
>>>>>>>
var cursor = this.writer.selection.cursor;
var node = cursor.node;
<<<<<<<
// TODO: dynamically
$(this.cursor).css({
top: pos.top,
left: pos.left
// height: '20px' -> getHeightBasedOnContext() -> 100% for image, line-height for text and heading and so on.
});
=======
// TODO: dynamically
$(this.cursor).css({
top: pos.top,
left: pos.left
});
}
>>>>>>>
// TODO: dynamically
$(this.cursor).css({
top: pos.top,
left: pos.left
}); |
<<<<<<<
},
serialize: function (value, key, mug, data) {
data.id = mug.form.getAbsolutePath(mug, true);
},
deserialize: function (data, key, mug) {
if (!data.id || data.id === mug.p.nodeID) {
return mug.p.nodeID; // use default id
}
var id = data.id.slice(data.id.lastIndexOf("/") + 1) ||
mug.form.generate_question_id(id, mug);
if (data.conflictedNodeId) {
// first set to value that is in expressions
// to make associations in logic manager
// NOTE obscure edge case: if (this temporary) id
// conflicts with an existing question then expressions
// will be associated with that question and the Later
// assignment will not work.
mug.p.nodeID = id;
return new Later(function () {
// after all other properties are deserialized,
// assign conflicted ID to convert expressions
// or setup new conflict
mug.p.nodeID = data.conflictedNodeId;
});
}
return id;
=======
},
dropMessage: function (mug, attr, key) {
if (attr === "nodeID" && key === "mug-conflictedNodeId-warning") {
resolveConflictedNodeId(mug);
}
>>>>>>>
},
dropMessage: function (mug, attr, key) {
if (attr === "nodeID" && key === "mug-conflictedNodeId-warning") {
resolveConflictedNodeId(mug);
}
},
serialize: function (value, key, mug, data) {
data.id = mug.form.getAbsolutePath(mug, true);
},
deserialize: function (data, key, mug) {
if (!data.id || data.id === mug.p.nodeID) {
return mug.p.nodeID; // use default id
}
var id = data.id.slice(data.id.lastIndexOf("/") + 1) ||
mug.form.generate_question_id(id, mug);
if (data.conflictedNodeId) {
// first set to value that is in expressions
// to make associations in logic manager
// NOTE obscure edge case: if (this temporary) id
// conflicts with an existing question then expressions
// will be associated with that question and the Later
// assignment will not work.
mug.p.nodeID = id;
return new Later(function () {
// after all other properties are deserialized,
// assign conflicted ID to convert expressions
// or setup new conflict
mug.p.nodeID = data.conflictedNodeId;
});
}
return id; |
<<<<<<<
'vellum/xpath',
'tpl!vellum/templates/auto_box',
'text!vellum/templates/button_remove.html',
'tpl!vellum/templates/control_group',
=======
>>>>>>>
'tpl!vellum/templates/auto_box',
'text!vellum/templates/button_remove.html',
'tpl!vellum/templates/control_group',
<<<<<<<
xpath,
auto_box,
button_remove,
control_group,
=======
>>>>>>>
auto_box,
button_remove,
control_group, |
<<<<<<<
'vellum/undomanager',
'vellum/fuse',
=======
>>>>>>>
'vellum/undomanager',
<<<<<<<
undomanager,
Fuse,
=======
>>>>>>>
undomanager, |
<<<<<<<
'text!static/javaRosa/no-label-text-one-lang.xml'
=======
'text!static/javaRosa/no-label-text-one-lang.xml',
'text!static/javaRosa/test-xml-1.xml',
'text!static/javaRosa/test-xml-2.xml',
'text!static/javaRosa/test-xml-3.xml',
'text!static/javaRosa/test-xml-4.xml',
'text!static/markdown/with-markdown.xml',
'text!static/markdown/no-markdown.xml'
>>>>>>>
'text!static/javaRosa/no-label-text-one-lang.xml',
'text!static/javaRosa/test-xml-1.xml',
'text!static/javaRosa/test-xml-2.xml',
'text!static/javaRosa/test-xml-3.xml',
'text!static/javaRosa/test-xml-4.xml'
<<<<<<<
NO_LABEL_TEXT_ONE_LANG_XML
=======
NO_LABEL_TEXT_ONE_LANG_XML,
TEST_XML_1,
TEST_XML_2,
TEST_XML_3,
TEST_XML_4,
WITH_MARKDOWN_XML,
NO_MARKDOWN_XML
>>>>>>>
NO_LABEL_TEXT_ONE_LANG_XML,
TEST_XML_1,
TEST_XML_2,
TEST_XML_3,
TEST_XML_4
<<<<<<<
var TEST_XML_1 = '' +
'<?xml version="1.0" encoding="UTF-8" ?>\
<h:html xmlns:h="http://www.w3.org/1999/xhtml"\
xmlns:orx="http://openrosa.org/jr/xforms"\
xmlns="http://www.w3.org/2002/xforms"\
xmlns:xsd="http://www.w3.org/2001/XMLSchema"\
xmlns:jr="http://openrosa.org/javarosa"\
xmlns:vellum="http://commcarehq.org/xforms/vellum">\
<h:head>\
<h:title>Untitled Form</h:title>\
<model>\
<instance>\
<data xmlns:jrm="http://dev.commcarehq.org/jr/xforms"\
xmlns="http://openrosa.org/formdesigner/8D6CF8A5-4396-45C3-9D05-64C3FD97A5D0"\
uiVersion="1"\
version="1"\
name="Untitled Form">\
<question1 />\
</data>\
</instance>\
<bind nodeset="/data/question1"\
type="xsd:string"\
constraint="1"\
jr:constraintMsg="jr:itext(\'question1-constraintMsg\')" />\
<itext>\
<translation lang="en" default="">\
<text id="question1-label">\
<value>question1</value>\
</text>\
</translation>\
<translation lang="hin">\
<text id="question1-constraintMsg">\
<value>xyz</value>\
</text>\
</translation>\
</itext>\
</model>\
</h:head>\
<h:body>\
<input ref="/data/question1">\
<label ref="jr:itext(\'question1-label\')" />\
</input>\
</h:body>\
</h:html>';
var TEST_XML_2 = '' +
'<h:html xmlns:h="http://www.w3.org/1999/xhtml"\
xmlns:orx="http://openrosa.org/jr/xforms"\
xmlns="http://www.w3.org/2002/xforms"\
xmlns:xsd="http://www.w3.org/2001/XMLSchema"\
xmlns:jr="http://openrosa.org/javarosa"\
xmlns:vellum="http://commcarehq.org/xforms/vellum">\
<h:head>\
<h:title>Untitled Form</h:title>\
<model>\
<instance>\
<data xmlns:jrm="http://dev.commcarehq.org/jr/xforms"\
xmlns="http://openrosa.org/formdesigner/8D6CF8A5-4396-45C3-9D05-64C3FD97A5D0"\
uiVersion="1" version="1" name="Untitled Form">\
<question1/>\
</data>\
</instance>\
<bind nodeset="/data/question1" type="xsd:string"\
jr:constraintMsg="jr:itext(\'question1-constraintMsg\')"/>\
<itext>\
<translation lang="en" default="">\
<text id="question1-label">\
<value>question1 en label</value>\
<value form="image">jr://file/commcare/image/data/question1.png</value>\
<value form="audio">jr://file/commcare/audio/data/question1.mp3</value>\
<value form="video">jr://file/commcare/video/data/question1.3gp</value>\
<value form="long">question1 en long</value>\
<value form="short">question1 en short</value>\
<value form="custom">question1 en custom</value>\
</text>\
<text id="question1-hint">\
<value>question1 en hint</value>\
</text>\
<text id="question1-help">\
<value>question1 en help</value>\
<value form="image">jr://file/commcare/image/help/data/question1.png</value>\
<value form="audio">jr://file/commcare/audio/help/data/question1.mp3</value>\
<value form="video">jr://file/commcare/video/help/data/question1.3gp</value>\
</text>\
<text id="question1-constraintMsg">\
<value>question1 en validation</value>\
</text>\
</translation>\
<translation lang="hin">\
<text id="question1-label">\
<value>question1 hin label</value>\
<value form="image">jr://file/commcare/image/data/question1.png</value>\
<value form="audio">jr://file/commcare/audio/data/question1.mp3</value>\
<value form="video">jr://file/commcare/video/data/question1.3gp</value>\
<value form="long">question1 hin long</value>\
<value form="short">question1 hin short</value>\
<value form="custom">question1 hin custom</value>\
</text>\
<text id="question1-hint">\
<value>question1 hin hint</value>\
</text>\
<text id="question1-help">\
<value>question1 hin help</value>\
<value form="image">jr://file/commcare/image/help/data/question1.png</value>\
<value form="audio">jr://file/commcare/audio/help/data/question1.mp3</value>\
<value form="video">jr://file/commcare/video/help/data/question1.3gp</value>\
</text>\
<text id="question1-constraintMsg">\
<value>question1 hin validation</value>\
</text>\
</translation>\
</itext>\
</model>\
</h:head>\
<h:body>\
<input ref="/data/question1">\
<label ref="jr:itext(\'question1-label\')"/>\
<hint ref="jr:itext(\'question1-hint\')"/>\
<help ref="jr:itext(\'question1-help\')"/>\
</input>\
</h:body>\
</h:html>';
var TEST_XML_3 = '' +
'<?xml version="1.0" encoding="UTF-8" ?>\
<h:html xmlns:h="http://www.w3.org/1999/xhtml"\
xmlns:orx="http://openrosa.org/jr/xforms"\
xmlns="http://www.w3.org/2002/xforms"\
xmlns:xsd="http://www.w3.org/2001/XMLSchema"\
xmlns:jr="http://openrosa.org/javarosa"\
xmlns:vellum="http://commcarehq.org/xforms/vellum">\
<h:head>\
<h:title>Untitled Form</h:title>\
<model>\
<instance>\
<data xmlns:jrm="http://dev.commcarehq.org/jr/xforms"\
xmlns="http://openrosa.org/formdesigner/8D6CF8A5-4396-45C3-9D05-64C3FD97A5D0"\
uiVersion="1"\
version="1"\
name="Untitled Form">\
<question1 />\
</data>\
</instance>\
<bind nodeset="/data/question1" type="xsd:string" />\
<itext>\
<translation lang="en" default="">\
<text id="question1-label">\
<value>question1</value>\
</text>\
</translation>\
<translation lang="hin">\
<text id="question1-label">\
<value>xyz</value>\
</text>\
</translation>\
<translation lang="es">\
<text id="question1-label">\
<value>Spanish!</value>\
</text>\
</translation>\
</itext>\
</model>\
</h:head>\
<h:body>\
<input ref="/data/question1">\
<label ref="jr:itext(\'question1-label\')" />\
</input>\
</h:body>\
</h:html>';
var TEST_XML_4 = '' +
'<h:html xmlns:h="http://www.w3.org/1999/xhtml"\
xmlns:orx="http://openrosa.org/jr/xforms"\
xmlns="http://www.w3.org/2002/xforms"\
xmlns:xsd="http://www.w3.org/2001/XMLSchema"\
xmlns:jr="http://openrosa.org/javarosa"\
xmlns:vellum="http://commcarehq.org/xforms/vellum">\
<h:head>\
<h:title>Untitled Form</h:title>\
<model>\
<instance>\
<data xmlns:jrm="http://dev.commcarehq.org/jr/xforms"\
xmlns="http://openrosa.org/formdesigner/8D6CF8A5-4396-45C3-9D05-64C3FD97A5D0"\
uiVersion="1" version="1" name="Untitled Form">\
<first_question/>\
<question2/>\
</data>\
</instance>\
<bind nodeset="/data/first_question" type="xsd:string"/>\
<bind nodeset="/data/question2" type="xsd:string"/>\
<itext>\
<translation lang="en" default="">\
<text id="first_question-label">\
<value>first_question</value>\
</text>\
<text id="question2-label">\
<value><output value="/data/first_question" /> a <output value="/data/first_question" /> b <output value="/data/first_question" /> c <output value="/data/first_question" /> d <output value="if(/data/first_question = \'\', \'\', format-date(date(/data/first_question), \'%a%b%c\'))" /></value>\
</text>\
</translation>\
<translation lang="hin">\
<text id="first_question-label">\
<value>first_question</value>\
</text>\
<text id="question2-label">\
<value><output value="/data/first_question" /></value>\
</text>\
</translation>\
</itext>\
</model>\
</h:head>\
<h:body>\
<input ref="/data/first_question">\
<label ref="jr:itext(\'first_question-label\')"/>\
</input>\
<input ref="/data/question2">\
<label ref="jr:itext(\'question2-label\')"/>\
</input>\
</h:body>\
</h:html>';
=======
>>>>>>> |
<<<<<<<
assert(bubble.length, "No bubbles detected");
try {
bubble.mouseenter();
var $popover = $('.popover-content');
assert.strictEqual($popover.find('p:first').text(),
"How many burpees did you do on #form/new_burpee_data/burpee_date ?");
var $link = $popover.find("a");
assert($link.length);
$link.click();
assert.strictEqual($(".jstree-hovered").length, 1);
} finally {
$(".popover").remove();
}
=======
assert(bubble, "No bubbles detected");
bubble.mouseenter();
var $popover = $('.popover-content:last');
assert.strictEqual($popover.find('p:first').text(),
"How many burpees did you do on #form/new_burpee_data/burpee_date ?");
var $link = $popover.find("a");
assert($link.length);
$link.click();
assert.strictEqual($(".jstree-hovered").length, 1);
>>>>>>>
assert(bubble.length, "No bubbles detected");
try {
bubble.mouseenter();
var $popover = $('.popover-content:last');
assert.strictEqual($popover.find('p:first').text(),
"How many burpees did you do on #form/new_burpee_data/burpee_date ?");
var $link = $popover.find("a");
assert($link.length);
$link.click();
assert.strictEqual($(".jstree-hovered").length, 1);
} finally {
$(".popover").remove();
}
<<<<<<<
assert(bubble.length, "No bubbles detected");
try {
bubble.mouseenter();
var $popover = $('.popover-content p:first');
assert.strictEqual($popover.text(),
"How many burpees did you do on #form/new_burpee_data/burpee_date ?");
widget.input.ckeditor().editor.widgets.destroyAll();
// popover destroy just fades the popover
assert.strictEqual($('.popover:not(.fade)').length, 0);
} finally {
$(".popover").remove();
}
done();
});
});
=======
assert(bubble, "No bubbles detected");
bubble.mouseenter();
var $popover = $('.popover-content:last p:first');
assert.strictEqual($popover.text(),
"How many burpees did you do on #form/new_burpee_data/burpee_date ?");
var bubbles = widget.input.ckeditor().editor.widgets.instances;
_.each(bubbles, function(bubble) {
bubble.fire('destroy');
});
>>>>>>>
assert(bubble.length, "No bubbles detected");
try {
bubble.mouseenter();
var $popover = $('.popover-content:last p:first');
assert.strictEqual($popover.text(),
"How many burpees did you do on #form/new_burpee_data/burpee_date ?");
widget.input.ckeditor().editor.widgets.destroyAll();
// popover destroy just fades the popover
assert.strictEqual($('.popover:not(.fade)').length, 0);
} finally {
$(".popover").remove();
}
done();
});
}); |
<<<<<<<
this.xpath = escapedHashtags.parser(this.hashtagDictionary);
this.undomanager = new undomanager();
=======
this.xpath = xpath.createParser();
this.undomanager = new undomanager(this);
>>>>>>>
this.xpath = escapedHashtags.parser(this.hashtagDictionary);
this.undomanager = new undomanager(this); |
<<<<<<<
'vellum/escapedHashtags',
'vellum/fuse',
=======
'vellum/undomanager',
>>>>>>>
'vellum/escapedHashtags',
'vellum/fuse',
'vellum/undomanager',
<<<<<<<
escapedHashtags,
Fuse,
=======
undomanager,
>>>>>>>
escapedHashtags,
Fuse,
undomanager,
<<<<<<<
this.xpath = escapedHashtags.parser(this.hashtagDictionary);
=======
this.xpath = xpath.createParser();
this.undomanager = new undomanager();
>>>>>>>
this.xpath = escapedHashtags.parser(this.hashtagDictionary);
this.undomanager = new undomanager(); |
<<<<<<<
'markdown-it': '../bower_components/markdown-it/dist/markdown-it',
=======
'caretjs': '../bower_components/Caret.js/dist/jquery.caret',
'atjs': '../bower_components/At.js/dist/js/jquery.atwho'
>>>>>>>
'markdown-it': '../bower_components/markdown-it/dist/markdown-it',
'caretjs': '../bower_components/Caret.js/dist/jquery.caret',
'atjs': '../bower_components/At.js/dist/js/jquery.atwho'
<<<<<<<
},
'markdown-it': {
exports: 'markdown-it'
=======
},
'caretjs': {
deps: ['jquery'],
exports: 'caretjs'
},
'atjs': {
deps: ['jquery', 'caretjs', 'css!../bower_components/At.js/dist/css/jquery.atwho'],
exports: 'atjs'
>>>>>>>
},
'markdown-it': {
exports: 'markdown-it'
},
'caretjs': {
deps: ['jquery'],
exports: 'caretjs'
},
'atjs': {
deps: ['jquery', 'caretjs', 'css!../bower_components/At.js/dist/css/jquery.atwho'],
exports: 'atjs' |
<<<<<<<
sectionId: {
lstring: 'Balance ID',
visibility: 'visible',
presence: 'optional',
widget: widgets.text,
help: 'The name of the balance you are tracking. ' +
'This is an internal identifier which does not appear on the phone.',
},
entryId: {
lstring: 'Product',
visibility: 'visible',
presence: 'optional',
widget: setValueWidget,
serialize: serializeValue,
deserialize: deserializeValue,
xpathType: "generic",
help: 'A reference to a product ID, e.g., "/data/products/current_product"',
},
quantity: {
lstring: 'Quantity',
visibility: 'visible',
presence: 'optional',
widget: widgets.xPath,
xpathType: "generic",
help: 'A reference to an integer question in this form.',
},
relevantAttr: {
visibility: 'visible',
presence: 'optional',
widget: widgets.xPath,
xpathType: "bool",
lstring: 'Display Condition'
},
=======
>>>>>>> |
<<<<<<<
},
undo: function() {
this.undomanager.undo();
this.vellum.selectSomethingOrHideProperties();
=======
},
isCaseReference: function (path) {
return /instance\('casedb'\)/.test(path) ? true : false;
>>>>>>>
},
undo: function() {
this.undomanager.undo();
this.vellum.selectSomethingOrHideProperties();
},
isCaseReference: function (path) {
return /instance\('casedb'\)/.test(path) ? true : false; |
<<<<<<<
=======
'vellum/xpath',
>>>>>>> |
<<<<<<<
},
select: function() {
$('#' + this.ufid + '_anchor').click();
},
=======
},
isInRepeat: function() {
if (this.__className === "Repeat") { // HACK hard-coded class name
return true;
}
return this.parentMug && this.parentMug.isInRepeat();
},
supportsRichText: function() {
return this.options.richText && this.form.useRichText !== false;
}
>>>>>>>
},
select: function() {
$('#' + this.ufid + '_anchor').click();
},
isInRepeat: function() {
if (this.__className === "Repeat") { // HACK hard-coded class name
return true;
}
return this.parentMug && this.parentMug.isInRepeat();
},
supportsRichText: function() {
return this.options.richText && this.form.useRichText !== false;
} |
<<<<<<<
// may add map and reduce phases later
}
=======
// for now just have 1 event for when we finally rebuilt lazy view
// once we refactor transactions, i will tie in certain transactional events
this.events = {
'rebuild': []
};
};
DynamicView.prototype = new LokiEventEmitter;
>>>>>>>
// may add map and reduce phases later
// for now just have 1 event for when we finally rebuilt lazy view
// once we refactor transactions, i will tie in certain transactional events
this.events = {
'rebuild': []
};
}
DynamicView.prototype = new LokiEventEmitter;
<<<<<<<
options = options || {};
=======
options = options || { };
>>>>>>>
options = options || {};
<<<<<<<
=======
// emit rebuild event in case user wants to be notified
this.emit('rebuild', this);
>>>>>>>
// emit rebuild event in case user wants to be notified
this.emit('rebuild', this);
<<<<<<<
function Collection(name, indices, options) {
// the name of the collection
=======
function Collection(name, indices, transactionOptions) {
// the name of the collection
>>>>>>>
function Collection(name, indices, options) {
// the name of the collection
<<<<<<<
Loki.prototype.generateChangesNotification = function () {
var self = this,
changesArray = [];
self.changes.forEach(function (i) {
changesArray.push(self.collections[i.collection].get(i.id));
});
return changesArray;
};
=======
/**
* anonym() - shorthand method for quickly creating and populating an anonymous collection.
* This collection is not referenced internally so upon losing scope it will be garbage collected.
*
* Example : var results = new loki().anonym(myDocArray).find({'age': {'$gt': 30} });
*
* @param {Array} docs - document array to initialize the anonymous collection with
* @param {Array} indexesArray - (Optional) array of property names to index
* @returns {Collection} New collection which you can query or chain
*/
Loki.prototype.anonym = function (docs, indexesArray) {
var collection = new Collection('anonym', indexesArray);
collection.insert(docs);
return collection;
}
>>>>>>>
Loki.prototype.generateChangesNotification = function () {
var self = this,
changesArray = [];
self.changes.forEach(function (i) {
changesArray.push(self.collections[i.collection].get(i.id));
});
return changesArray;
};
/**
* anonym() - shorthand method for quickly creating and populating an anonymous collection.
* This collection is not referenced internally so upon losing scope it will be garbage collected.
*
* Example : var results = new loki().anonym(myDocArray).find({'age': {'$gt': 30} });
*
* @param {Array} docs - document array to initialize the anonymous collection with
* @param {Array} indexesArray - (Optional) array of property names to index
* @returns {Collection} New collection which you can query or chain
*/
Loki.prototype.anonym = function (docs, indexesArray) {
var collection = new Collection('anonym', indexesArray);
collection.insert(docs);
return collection;
} |
<<<<<<<
/*******************
* VERTLET STUFF *
*******************/
this.x = x;
this.y = y;
this.px = x;
this.py = y;
this.vx = 0;
this.vy = 0;
this.pinX = null;
this.pinY = null;
this.constraints = [];
}
Vertex.prototype.register = function(entity)
{
var ID = entity.getSpatialID();
this._entities[ID] = entity;
this.color = entity.color;
this.isWall = true;
};
Vertex.prototype.unregister = function(entity)
{
var ID = entity.getSpatialID();
this.isWall = false;
delete this._entities[ID];
//this.color = this.std_color;
};
Vertex.prototype.reset = function()
{
this.color = this.std_color;
this.isWall = false;
};
Vertex.prototype.getPos = function()
{
return {x: this.x, y: this.y};
};
Vertex.prototype.setPos = function(x, y)
{
this.x = x;
this.y = y;
};
Vertex.prototype.pin = function(px, py)
{
this.pinX = px;
this.pinY = py;
}
Vertex.prototype.update = function(du)
{
//if (this.pinX && this.pinY) return;
this.px = this.x;
this.py = this.y;
var players = entityManager.getPlayers();
for (var i = 0; i < players.length; ++i)
{
var pos = players[i].getPos();
pos = spatialManager.getVertex(pos.x, pos.y).getPos();
var dist = util.distSq(pos.x, pos.y, this.x, this.y);
if (dist < 8000)
{
var scale = (dist > 2000) ? (8000/dist) : 4;
var vel = players[i].getVel();
this.px -= vel.x * du * scale;
this.py -= vel.y * du * scale;
}
}
this.applyForce(0, gravity * du);
//du *= du;
var nx = this.x + ((this.x - this.px) * 0.99) + ((this.vx / 2) * du);
var ny = this.y + ((this.y - this.py) * 0.99) + ((this.vy / 2) * du);
this.px = this.x;
this.py = this.y;
this.x = nx;
this.y = ny;
this.vx = 0;
this.vy = 0;
};
Vertex.prototype.render = function(ctx, vtx)
{
if (this.constraints.length === 0) return;
/*
for (var i = 0; i < this.constraints.length; ++i)
{
this.constraints[i].render(ctx);
}
*/
if (this.constraints.length < 2 || !vtx) return;
ctx.beginPath();
ctx.moveTo(vtx.x, vtx.y);
ctx.lineTo(this.constraints[0].vtx2.x, this.constraints[0].vtx2.y);
ctx.lineTo(this.x, this.y);
ctx.lineTo(this.constraints[1].vtx2.x, this.constraints[1].vtx2.y);
ctx.closePath();
var off = (this.x - vtx.x) + (this.y - vtx.y);
off *= 0.25;
var coef = Math.round((Math.abs(off)/VERTEX_MARGIN) * 255);
if (coef > 220)
coef = 220;
ctx.fillStyle = "rgba(" + coef + ", 65, " + (220 - coef) + ", " + util.linearInterpolate(0.25, 1, coef/255.0) + ")";
ctx.fill();
ctx.strokeStyle = '#000';
ctx.stroke();
};
Vertex.prototype.applyConstraints = function(du)
{
// ATTN
// Currently, cannot be pinned to a falsy coord
if (this.pinX && this.pinY)
{
this.setPos(this.pinX, this.pinY);
return;
=======
this.register = function(entity) {
var ID = entity.getSpatialID();
this._entities[ID] = entity;
this.color = entity.color;
this.isWall = true;
this.isWally = true;
};
this.unregister = function(entity) {
var ID = entity.getSpatialID();
this.isWall = false;
delete this._entities[ID];
//this.color = this.std_color;
};
this.render = function(ctx) {
ctx.save();
ctx.strokeStyle = this._color;
//util.fillCircle(ctx, )
ctx.restore();
};
this.reset = function() {
this.color = this.std_color;
this.isWall = false;
this.isWally = false;
>>>>>>>
/*******************
* VERTLET STUFF *
*******************/
this.x = x;
this.y = y;
this.px = x;
this.py = y;
this.vx = 0;
this.vy = 0;
this.pinX = null;
this.pinY = null;
this.constraints = [];
}
Vertex.prototype.register = function(entity)
{
var ID = entity.getSpatialID();
this._entities[ID] = entity;
this.color = entity.color;
this.isWall = true;
};
Vertex.prototype.unregister = function(entity)
{
var ID = entity.getSpatialID();
this.isWall = false;
delete this._entities[ID];
//this.color = this.std_color;
};
Vertex.prototype.reset = function()
{
this.isWall = false;
this.isWally = false;
};
Vertex.prototype.getPos = function()
{
return {x: this.x, y: this.y};
};
Vertex.prototype.setPos = function(x, y)
{
this.x = x;
this.y = y;
};
Vertex.prototype.pin = function(px, py)
{
this.pinX = px;
this.pinY = py;
}
Vertex.prototype.update = function(du)
{
//if (this.pinX && this.pinY) return;
this.px = this.x;
this.py = this.y;
var players = entityManager.getPlayers();
for (var i = 0; i < players.length; ++i)
{
var pos = players[i].getPos();
pos = spatialManager.getVertex(pos.x, pos.y).getPos();
var dist = util.distSq(pos.x, pos.y, this.x, this.y);
if (dist < 8000)
{
var scale = (dist > 2000) ? (8000/dist) : 4;
var vel = players[i].getVel();
this.px -= vel.x * du * scale;
this.py -= vel.y * du * scale;
}
}
this.applyForce(0, gravity * du);
//du *= du;
var nx = this.x + ((this.x - this.px) * 0.99) + ((this.vx / 2) * du);
var ny = this.y + ((this.y - this.py) * 0.99) + ((this.vy / 2) * du);
this.px = this.x;
this.py = this.y;
this.x = nx;
this.y = ny;
this.vx = 0;
this.vy = 0;
};
Vertex.prototype.render = function(ctx, vtx)
{
if (this.constraints.length === 0) return;
/*
for (var i = 0; i < this.constraints.length; ++i)
{
this.constraints[i].render(ctx);
}
*/
if (this.constraints.length < 2 || !vtx) return;
ctx.beginPath();
ctx.moveTo(vtx.x, vtx.y);
ctx.lineTo(this.constraints[0].vtx2.x, this.constraints[0].vtx2.y);
ctx.lineTo(this.x, this.y);
ctx.lineTo(this.constraints[1].vtx2.x, this.constraints[1].vtx2.y);
ctx.closePath();
var off = (this.x - vtx.x) + (this.y - vtx.y);
off *= 0.25;
var coef = Math.round((Math.abs(off)/VERTEX_MARGIN) * 255);
if (coef > 220)
coef = 220;
ctx.fillStyle = "rgba(" + coef + ", 65, " + (220 - coef) + ", " + util.linearInterpolate(0.25, 1, coef/255.0) + ")";
ctx.fill();
ctx.strokeStyle = '#000';
ctx.stroke();
};
Vertex.prototype.applyConstraints = function(du)
{
// ATTN
// Currently, cannot be pinned to a falsy coord
if (this.pinX && this.pinY)
{
this.setPos(this.pinX, this.pinY);
return; |
<<<<<<<
//======================
// AI
//======================
=======
// AI
// We implemented an alpha beta pruning algorithm to control the AI movements
// The main functions are the decisionMaker, maxValue and minValue functions
// all other functions are helper functions.
>>>>>>>
//======================
// AI
//======================
// We implemented an alpha beta pruning algorithm to control the AI movements
// The main functions are the decisionMaker, maxValue and minValue functions
// all other functions are helper functions.
<<<<<<<
=======
/*var x1 = cx,
y1 = cy,
x2 = cx,
y2 = cy;
if (N===0) return false;
N--;
switch (direction)
{
case 'North':
y1--;
y2-=2;
break;
case 'South':
y1++;
y2+=2;
break;
case 'West':
x1--;
x2-=2;
break;
default :
x1++;
x2-=2;
break;
};
return (this.isADeadlyMove(grid, x1, y1) ||
this.isADeadlyMove(grid, x2, y2));*/
>>>>>>> |
<<<<<<<
seedText: "",
loading: false,
error: false,
success: false
=======
pending: false,
>>>>>>>
seedText: "",
loading: false,
error: false,
success: false,
pending: false, |
<<<<<<<
if (config.window_hotkey) {
try {
globalShortcut.register(config.window_hotkey, async() => {
thisShouldFixMacIssuesAndIdkWhy();
await runCapture(true);
});
} catch (_) {
dialog.showErrorBox("MagicCap", await i18n.getPoPhrase("The hotkey you gave was invalid.", "app"));
}
}
=======
>>>>>>>
<<<<<<<
{ label: i18nSelect, type: "normal", click: async() => { await runCapture(false); } },
{ label: i18nWindow, type: "normal", click: async() => { await runCapture(true); } },
{ label: i18nConfig, type: "normal", click: openConfig },
{ label: i18nUploadTo, submenu: uploadDropdown },
{ label: i18nExit, type: "normal", role: "quit" },
=======
{ label: "Screen Capture", type: "normal", click: async() => { await runCapture(false); } },
{ label: "Config", type: "normal", click: openConfig },
{ label: "Upload to...", submenu: uploadDropdown },
{ label: "Exit", type: "normal", role: "quit" },
>>>>>>>
{ label: i18nSelect, type: "normal", click: async() => { await runCapture(false); } },
{ label: i18nConfig, type: "normal", click: openConfig },
{ label: i18nUploadTo, submenu: uploadDropdown },
{ label: i18nExit, type: "normal", role: "quit" },
<<<<<<<
ipcMain.on("window-hotkey-change", async(event, hotkey) => {
try {
globalShortcut.register(hotkey, async() => {
thisShouldFixMacIssuesAndIdkWhy();
await runCapture(true);
});
} catch (_) {
dialog.showErrorBox("MagicCap", await i18n.getPoPhrase("The hotkey you gave was invalid.", "app"));
}
});
// Handles the window hotkey changing.
=======
>>>>>>> |
<<<<<<<
var when, slice;
when = require('when');
slice = [].slice;
=======
var slice, undef;
slice = [].slice;
>>>>>>>
var when, slice;
when = require('when');
slice = [].slice;
<<<<<<<
return conditionalWhen(result, function(result) {
return f.call(context, result);
});
}, x);
=======
return f.call(context, result);
}, first.apply(this, arguments));
>>>>>>>
return conditionalWhen(result, function(result) {
return f.call(context, result);
});
}, first.apply(this, arguments)); |
<<<<<<<
//noinspection JSUnusedLocalSymbols
function amdPlugin(name, require, callback, config) {
=======
//noinspection JSUnusedLocalSymbols
function amdLoad(name, require, callback, config) {
>>>>>>>
//noinspection JSUnusedLocalSymbols
function amdLoad(name, require, callback, config) {
<<<<<<<
// If spec is a module Id, or list of module Ids, load it/them, then wire.
// If it's a spec object or array of objects, wire it now.
if(isString(specs)) {
var specIds = specs.split(',');
=======
>>>>>>>
<<<<<<<
if(parent.destroyed) {
parent.destroyed.then(destroy);
=======
if (parent.destroyed) {
parent.destroyed.then(null, null, destroy);
>>>>>>>
if (parent.destroyed) {
parent.destroyed.then(null, null, destroy);
<<<<<<<
contextPromise = chain(scopeReady, Deferred(), objects).promise;
=======
var doDestroy = function() {
scopeDestroyed.progress();
// TODO: Clear out the context prototypes?
var p;
for (p in local) delete local[p];
for (p in objects) delete objects[p];
for (p in scope) delete scope[p];
// Retain a do-nothing destroy() func, in case
// it is called again for some reason.
doDestroy = noop;
// Resolve promise
scopeDestroyed.resolve();
};
var contextPromise = chain(scopeReady, Deferred(), objects).promise;
>>>>>>>
contextPromise = chain(scopeReady, Deferred(), objects).promise;
<<<<<<<
listeners.push(plugin);
if(plugin.proxies) {
=======
if (plugin.proxies) {
>>>>>>>
listeners.push(plugin);
if (plugin.proxies) {
<<<<<<<
for(name in facets) {
options = spec[name];
if(options) {
processStep(promises, facets[name], step, proxy, options);
}
}
var d = Deferred();
whenAll(promises).then(
function() { processListeners(d, step, proxy); },
chainReject(d)
);
return d;
}
function processListeners(promise, step, proxy) {
var listenerPromises = [];
for(var i=0; i<listeners.length; i++) {
processStep(listenerPromises, listeners[i], step, proxy);
=======
for (name in facets) {
options = facet.options = spec[name];
processFacet(facets[name], step, facet, promises);
>>>>>>>
for(name in facets) {
options = spec[name];
if(options) {
processStep(promises, facets[name], step, proxy, options);
}
}
var d = Deferred();
whenAll(promises).then(
function() { processListeners(d, step, proxy); },
chainReject(d)
);
return d;
}
function processListeners(promise, step, proxy) {
var listenerPromises = [];
for(var i=0; i<listeners.length; i++) {
processStep(listenerPromises, listeners[i], step, proxy);
<<<<<<<
function processStep(promises, processor, step, proxy, options) {
var facet, facetPromise;
if(processor && processor[step]) {
facetPromise = Deferred();
=======
function processFacet(processor, step, facet, promises) {
if (facet.options && processor && processor[step]) {
var facetPromise = Deferred();
>>>>>>>
function processStep(promises, processor, step, proxy, options) {
var facet, facetPromise;
if(processor && processor[step]) {
facetPromise = Deferred();
<<<<<<<
function moduleFactory(promise, spec) {
=======
function moduleFactory(promise, spec /*, wire */) {
>>>>>>>
function moduleFactory(promise, spec /*, wire */) {
<<<<<<<
Function: instanceFactory
Factory that uses an AMD module either directly, or as a
constructor or plain function to create the resulting item.
*/
function instanceFactory(promise, spec) {
=======
Function: instanceFactory
Factory that uses an AMD module either directly, or as a
constructor or plain function to create the resulting item.
*/
function instanceFactory(promise, spec /*, wire */) {
>>>>>>>
Function: instanceFactory
Factory that uses an AMD module either directly, or as a
constructor or plain function to create the resulting item.
*/
function instanceFactory(promise, spec /*, wire */) {
<<<<<<<
} // createScope
=======
} // createScope
>>>>>>>
} // createScope |
<<<<<<<
goog.require('Blockly.Events');
=======
goog.require('Blockly.Options');
>>>>>>>
goog.require('Blockly.Events');
goog.require('Blockly.Options');
<<<<<<<
'blocklySelectChange', this, function() {this.traceOn_ = false; });
=======
'blocklySelectChange', this, function() {this.traceOn_ = false;});
>>>>>>>
'blocklySelectChange', this, function() {this.traceOn_ = false; });
<<<<<<<
this.scrollbar.resize();
} else {
this.translate(0, 0);
}
// Hide the WidgetDiv without animation (zoom makes field out of place with div)
Blockly.WidgetDiv.hide(true);
Blockly.DropDownDiv.hideWithoutAnimation();
Blockly.hideChaff(false);
if (this.flyout_) {
// No toolbox, resize flyout.
this.flyout_.reflow();
}
=======
var matrix = canvas.getCTM()
.translate(x * (1 - scaleChange), y * (1 - scaleChange))
.scale(scaleChange);
// newScale and matrix.a should be identical (within a rounding error).
this.scrollX = matrix.e - metrics.absoluteLeft;
this.scrollY = matrix.f - metrics.absoluteTop;
}
this.setScale(newScale);
>>>>>>>
var matrix = canvas.getCTM()
.translate(x * (1 - scaleChange), y * (1 - scaleChange))
.scale(scaleChange);
// newScale and matrix.a should be identical (within a rounding error).
this.scrollX = matrix.e - metrics.absoluteLeft;
this.scrollY = matrix.f - metrics.absoluteTop;
}
this.setScale(newScale);
// Hide the WidgetDiv without animation (zoom makes field out of place with div)
Blockly.WidgetDiv.hide(true);
Blockly.DropDownDiv.hideWithoutAnimation();
<<<<<<<
this.scale = newScale;
this.updateGridPattern_();
this.scrollbar.resize();
// Hide the WidgetDiv without animation (zoom makes field out of place with div)
Blockly.WidgetDiv.hide(true);
Blockly.DropDownDiv.hideWithoutAnimation();
Blockly.hideChaff(false);
=======
var metrics = this.getMetrics();
var x = (metrics.contentWidth - metrics.viewWidth) / 2;
>>>>>>>
this.scale = newScale;
this.updateGridPattern_();
this.scrollbar.resize();
// Hide the WidgetDiv without animation (zoom makes field out of place with div)
Blockly.WidgetDiv.hide(true);
Blockly.DropDownDiv.hideWithoutAnimation();
Blockly.hideChaff(false);
var metrics = this.getMetrics();
var x = (metrics.contentWidth - metrics.viewWidth) / 2;
<<<<<<<
// Hide the WidgetDiv without animation (zoom makes field out of place with div)
Blockly.WidgetDiv.hide(true);
Blockly.DropDownDiv.hideWithoutAnimation();
=======
if (this.scrollbar) {
this.scrollbar.resize();
} else {
this.translate(this.scrollX, this.scrollY);
}
>>>>>>>
// Hide the WidgetDiv without animation (zoom makes field out of place with div)
Blockly.WidgetDiv.hide(true);
Blockly.DropDownDiv.hideWithoutAnimation();
if (this.scrollbar) {
this.scrollbar.resize();
} else {
this.translate(this.scrollX, this.scrollY);
} |
<<<<<<<
this.syncTrees_(newTree, this.tree_, this.iconic_,
this.workspace_.options.pathToMedia);
=======
var openNode =
this.syncTrees_(newTree, this.tree_, this.workspace_.options.pathToMedia);
>>>>>>>
var openNode =
this.syncTrees_(newTree, this.tree_, this.iconic_,
this.workspace_.options.pathToMedia);
<<<<<<<
this.syncTrees_(childIn, childOut, iconic, pathToMedia);
=======
var newOpenNode = this.syncTrees_(childIn, childOut, pathToMedia);
if (newOpenNode) {
openNode = newOpenNode;
}
>>>>>>>
var newOpenNode = this.syncTrees_(childIn, childOut, iconic,
pathToMedia);
if (newOpenNode) {
openNode = newOpenNode;
} |
<<<<<<<
goog.addDependency("../../../" + dir + "/core/workspace_svg.js", ['Blockly.WorkspaceSvg'], ['Blockly.ConnectionDB', 'Blockly.constants', 'Blockly.Options', 'Blockly.ScrollbarPair', 'Blockly.Touch', 'Blockly.Trashcan', 'Blockly.Workspace', 'Blockly.Xml', 'Blockly.ZoomControls', 'goog.dom', 'goog.math.Coordinate', 'goog.userAgent']);
goog.addDependency("../../../" + dir + "/core/bubble.js", ['Blockly.Bubble'], ['Blockly.Touch', 'Blockly.Workspace', 'goog.dom', 'goog.math', 'goog.math.Coordinate', 'goog.userAgent']);
goog.addDependency("../../../" + dir + "/core/procedures.js", ['Blockly.Procedures'], ['Blockly.Blocks', 'Blockly.Field', 'Blockly.Names', 'Blockly.Workspace']);
goog.addDependency("../../../" + dir + "/core/flyout.js", ['Blockly.Flyout'], ['Blockly.Block', 'Blockly.Comment', 'Blockly.Events', 'Blockly.FlyoutButton', 'Blockly.Touch', 'Blockly.WorkspaceSvg', 'goog.dom', 'goog.events', 'goog.math.Rect', 'goog.userAgent']);
=======
goog.addDependency("../../../" + dir + "/core/warning.js", ['Blockly.Warning'], ['Blockly.Bubble', 'Blockly.Icon']);
goog.addDependency("../../../" + dir + "/core/widgetdiv.js", ['Blockly.WidgetDiv'], ['Blockly.Css', 'goog.dom', 'goog.dom.TagName', 'goog.style']);
goog.addDependency("../../../" + dir + "/core/workspace.js", ['Blockly.Workspace'], ['goog.array', 'goog.math']);
goog.addDependency("../../../" + dir + "/core/workspace_svg.js", ['Blockly.WorkspaceSvg'], ['Blockly.ConnectionDB', 'Blockly.constants', 'Blockly.Options', 'Blockly.ScrollbarPair', 'Blockly.Touch', 'Blockly.Trashcan', 'Blockly.Workspace', 'Blockly.Xml', 'Blockly.ZoomControls', 'goog.array', 'goog.dom', 'goog.math.Coordinate', 'goog.userAgent']);
>>>>>>>
goog.addDependency("../../../" + dir + "/core/workspace_svg.js", ['Blockly.WorkspaceSvg'], ['Blockly.ConnectionDB', 'Blockly.constants', 'Blockly.Options', 'Blockly.ScrollbarPair', 'Blockly.Touch', 'Blockly.Trashcan', 'Blockly.Workspace', 'Blockly.Xml', 'Blockly.ZoomControls', 'goog.array', 'goog.dom', 'goog.math.Coordinate', 'goog.userAgent']);
goog.addDependency("../../../" + dir + "/core/bubble.js", ['Blockly.Bubble'], ['Blockly.Touch', 'Blockly.Workspace', 'goog.dom', 'goog.math', 'goog.math.Coordinate', 'goog.userAgent']);
goog.addDependency("../../../" + dir + "/core/procedures.js", ['Blockly.Procedures'], ['Blockly.Blocks', 'Blockly.Field', 'Blockly.Names', 'Blockly.Workspace']);
goog.addDependency("../../../" + dir + "/core/flyout.js", ['Blockly.Flyout'], ['Blockly.Block', 'Blockly.Comment', 'Blockly.Events', 'Blockly.FlyoutButton', 'Blockly.Touch', 'Blockly.WorkspaceSvg', 'goog.dom', 'goog.events', 'goog.math.Rect', 'goog.userAgent']); |
<<<<<<<
if (eventsEnabled) {
event.recordNew();
Blockly.resizeSvgContents(this.workspace);
Blockly.Events.fire(event);
}
};
/**
* Set this block to an absolute translation.
* @param {number} x Horizontal translation.
* @param {number} y Vertical translation.
* @param {boolean=} opt_use3d If set, use 3d translation.
*/
Blockly.BlockSvg.prototype.translate = function(x, y, opt_use3d) {
if (opt_use3d) {
this.getSvgRoot().setAttribute('style',
'transform: translate3d(' + x + 'px,' + y + 'px, 0px)');
} else {
this.getSvgRoot().setAttribute('transform',
'translate(' + x + ',' + y + ')');
}
=======
event.recordNew();
this.workspace.resizeContents();
Blockly.Events.fire(event);
>>>>>>>
if (eventsEnabled) {
event.recordNew();
this.workspace.resizeContents();
Blockly.Events.fire(event);
}
};
/**
* Set this block to an absolute translation.
* @param {number} x Horizontal translation.
* @param {number} y Vertical translation.
* @param {boolean=} opt_use3d If set, use 3d translation.
*/
Blockly.BlockSvg.prototype.translate = function(x, y, opt_use3d) {
if (opt_use3d) {
this.getSvgRoot().setAttribute('style',
'transform: translate3d(' + x + 'px,' + y + 'px, 0px)');
} else {
this.getSvgRoot().setAttribute('transform',
'translate(' + x + ',' + y + ')');
} |
<<<<<<<
goog.require('Blockly.DropDownDiv');
goog.require('Blockly.Events');
=======
goog.require('Blockly.constants');
>>>>>>>
goog.require('Blockly.constants');
goog.require('Blockly.DropDownDiv');
goog.require('Blockly.Events'); |
<<<<<<<
/** @type {!Array.<!Function>} */
this.tapListeners_ = [];
=======
/** @type {!Array.<!Blockly.Events.Abstract>} */
this.undoStack_ = [];
/** @type {!Array.<!Blockly.Events.Abstract>} */
this.redoStack_ = [];
>>>>>>>
/** @type {!Array.<!Function>} */
this.tapListeners_ = [];
/** @type {!Array.<!Blockly.Events.Abstract>} */
this.undoStack_ = [];
/** @type {!Array.<!Blockly.Events.Abstract>} */
this.redoStack_ = []; |
<<<<<<<
// Re-enable workspace resizing.
selected.workspace.setResizesEnabled(true);
// Ensure that any stap and bump are part of this move's event group.
=======
selected.workspace.setResizesEnabled(true);
// Ensure that any snap and bump are part of this move's event group.
>>>>>>>
// Re-enable workspace resizing.
selected.workspace.setResizesEnabled(true);
// Ensure that any snap and bump are part of this move's event group.
<<<<<<<
this.addDragging();
=======
var group = this.getSvgRoot();
group.translate_ = '';
group.skew_ = '';
>>>>>>>
var group = this.getSvgRoot();
group.translate_ = '';
group.skew_ = '';
<<<<<<<
// Must move to drag surface before unplug(),
// or else connections will calculate the wrong relative to surface XY
// in tighten_(). Then blocks connected to this block move around on the
// drag surface. By moving to the drag surface before unplug, connection
// positions will be calculated correctly.
this.moveToDragSurface_();
// Disable workspace resizing as an optimization.
this.workspace.setResizesEnabled(false);
// Clear WidgetDiv/DropDownDiv without animating, in case blocks are moved
// around
Blockly.WidgetDiv.hide(true);
Blockly.DropDownDiv.hideWithoutAnimation();
=======
this.workspace.setResizesEnabled(false);
>>>>>>>
// Must move to drag surface before unplug(),
// or else connections will calculate the wrong relative to surface XY
// in tighten_(). Then blocks connected to this block move around on the
// drag surface. By moving to the drag surface before unplug, connection
// positions will be calculated correctly.
this.moveToDragSurface_();
// Disable workspace resizing as an optimization.
this.workspace.setResizesEnabled(false);
// Clear WidgetDiv/DropDownDiv without animating, in case blocks are moved
// around
Blockly.WidgetDiv.hide(true);
Blockly.DropDownDiv.hideWithoutAnimation();
<<<<<<<
=======
* Set whether the block is disabled or not.
* @param {boolean} disabled True if disabled.
*/
Blockly.BlockSvg.prototype.setDisabled = function(disabled) {
if (this.disabled != disabled) {
Blockly.BlockSvg.superClass_.setDisabled.call(this, disabled);
if (this.rendered) {
this.updateDisabled();
}
}
};
/**
* Set whether the block is highlighted or not.
* @param {boolean} highlighted True if highlighted.
*/
Blockly.BlockSvg.prototype.setHighlighted = function(highlighted) {
if (highlighted) {
this.svgPath_.setAttribute('filter',
'url(#' + this.workspace.options.embossFilterId + ')');
this.svgPathLight_.style.display = 'none';
} else {
this.svgPath_.removeAttribute('filter');
this.svgPathLight_.style.display = 'block';
}
};
/**
>>>>>>>
<<<<<<<
/**
* Adds the dragging class to this block.
*/
Blockly.BlockSvg.prototype.addDragging = function() {
Blockly.addClass_(/** @type {!Element} */ (this.svgGroup_),
'blocklyDragging');
};
/**
* Removes the dragging class from this block.
*/
Blockly.BlockSvg.prototype.removeDragging = function() {
Blockly.removeClass_(/** @type {!Element} */ (this.svgGroup_),
'blocklyDragging');
};
=======
>>>>>>> |
<<<<<<<
var parentBlock = parentConnection.sourceBlock_;
var childBlock = childConnection.sourceBlock_;
var isSurroundingC = false;
if (parentConnection == parentBlock.getFirstStatementConnection()) {
isSurroundingC = true;
}
=======
var parentBlock = parentConnection.getSourceBlock();
var childBlock = childConnection.getSourceBlock();
>>>>>>>
var parentBlock = parentConnection.getSourceBlock();
var childBlock = childConnection.getSourceBlock();
var isSurroundingC = false;
if (parentConnection == parentBlock.getFirstStatementConnection()) {
isSurroundingC = true;
}
<<<<<<<
* @return true if the connection is not connected or is connected to a ghost
* block, false otherwise.
*/
Blockly.Connection.prototype.isConnectedToNonGhost = function() {
return this.targetConnection && !this.targetBlock().isGhost();
};
/**
=======
* Get the source block for this connection.
* @return {Blockly.Block} The source block, or null if there is none.
*/
Blockly.Connection.prototype.getSourceBlock = function() {
return this.sourceBlock_;
};
/**
>>>>>>>
* @return true if the connection is not connected or is connected to a ghost
* block, false otherwise.
*/
Blockly.Connection.prototype.isConnectedToNonGhost = function() {
return this.targetConnection && !this.targetBlock().isGhost();
};
/**
* Get the source block for this connection.
* @return {Blockly.Block} The source block, or null if there is none.
*/
Blockly.Connection.prototype.getSourceBlock = function() {
return this.sourceBlock_;
};
/**
<<<<<<<
// Don't let blocks try to connect to themselves or ones they nest.
return !this.isAncestor_(candidate);
};
/**
* Do basic checks for whether this connection can be dragged to connect to the
* candidate. These checks don't care about the type of the connections.
* @param {Blockly.Connection} candidate The candidate connection.
* @return True if the connections are compatible, false otherwise.
*/
Blockly.Connection.prototype.checkBasicCompatibility_ = function(candidate,
maxRadius) {
if (this.distanceFrom(candidate) > maxRadius) {
=======
// Offering to connect the left (male) of a value block to an already
// connected value pair is ok, we'll splice it in.
// However, don't offer to splice into an immovable block.
if (candidate.type == Blockly.INPUT_VALUE && candidate.targetConnection &&
!candidate.targetBlock().isMovable() &&
!candidate.targetBlock().isShadow()) {
>>>>>>>
// Don't let blocks try to connect to themselves or ones they nest.
return !this.isAncestor_(candidate);
};
/**
* Do basic checks for whether this connection can be dragged to connect to the
* candidate. These checks don't care about the type of the connections.
* @param {Blockly.Connection} candidate The candidate connection.
* @return True if the connections are compatible, false otherwise.
*/
Blockly.Connection.prototype.checkBasicCompatibility_ = function(candidate,
maxRadius) {
if (this.distanceFrom(candidate) > maxRadius) {
<<<<<<<
// Type checking.
var canConnect = this.canConnectWithReason_(candidate);
if (canConnect != Blockly.Connection.CAN_CONNECT &&
canConnect != Blockly.Connection.REASON_MUST_DISCONNECT) {
return false;
}
return true;
};
/**
* Checks if a candidate connection is on this connection's source block or a
* nested block.
* @param {Blockly.Connection} candidate The candidate connection to check.
* @return Whether the candidate connection is on this connection's source block
* or descendant blocks.
*/
Blockly.Connection.prototype.isAncestor_ = function(candidate) {
var targetSourceBlock = candidate.sourceBlock_;
=======
// Don't let blocks try to connect to themselves or ones they nest.
var targetSourceBlock = candidate.getSourceBlock();
>>>>>>>
// Type checking.
var canConnect = this.canConnectWithReason_(candidate);
if (canConnect != Blockly.Connection.CAN_CONNECT &&
canConnect != Blockly.Connection.REASON_MUST_DISCONNECT) {
return false;
}
return true;
};
/**
* Checks if a candidate connection is on this connection's source block or a
* nested block.
* @param {Blockly.Connection} candidate The candidate connection to check.
* @return Whether the candidate connection is on this connection's source block
* or descendant blocks.
*/
Blockly.Connection.prototype.isAncestor_ = function(candidate) {
var targetSourceBlock = candidate.sourceBlock_; |
<<<<<<<
// A field is being edited if either the WidgetDiv or DropDownDiv is currently open.
// If a field is being edited, don't fire any click events.
var fieldEditing = Blockly.WidgetDiv.isVisible() || Blockly.DropDownDiv.isVisible();
if (Blockly.dragMode_ != Blockly.DRAG_FREE && !fieldEditing) {
=======
Blockly.Touch.clearTouchIdentifier();
if (Blockly.dragMode_ != Blockly.DRAG_FREE &&
!Blockly.WidgetDiv.isVisible()) {
>>>>>>>
// A field is being edited if either the WidgetDiv or DropDownDiv is currently open.
// If a field is being edited, don't fire any click events.
var fieldEditing = Blockly.WidgetDiv.isVisible() || Blockly.DropDownDiv.isVisible();
Blockly.Touch.clearTouchIdentifier();
if (Blockly.dragMode_ != Blockly.DRAG_FREE && !fieldEditing) { |
<<<<<<<
describe('function condition', function () {
beforeEach(function () {
jasmine.clock().install();
});
afterEach(function () {
jasmine.clock().uninstall();
});
it('should check condition and return boolean', function () {
let match;
match = flexToolBar.condition(() => true);
expect(match).toBe(true);
match = flexToolBar.condition(() => 1);
expect(match).toBe(true);
match = flexToolBar.condition(() => false);
expect(match).toBe(false);
match = flexToolBar.condition(() => 0);
expect(match).toBe(false);
});
it('should poll function conditions', async function () {
await atom.workspace.open('./fixtures/sample.js');
spyOn(flexToolBar, 'pollFunctions').and.callThrough();
spyOn(flexToolBar, 'reloadToolbar').and.callThrough();
spyOn(flexToolBar, 'loadConfig').and.returnValues([{
text: 'test',
callback: 'application:about',
show: {
function: (editor) => editor.isModified()
}
}]);
flexToolBar.reloadToolbar();
expect(flexToolBar.functionConditions.length).toBe(1);
jasmine.clock().tick(900);
expect(flexToolBar.pollFunctions).toHaveBeenCalledTimes(4);
expect(flexToolBar.reloadToolbar).toHaveBeenCalledTimes(1);
});
it('should not poll if no function conditions', async function () {
await atom.workspace.open('./fixtures/sample.js');
spyOn(flexToolBar, 'pollFunctions').and.callThrough();
spyOn(flexToolBar, 'reloadToolbar').and.callThrough();
spyOn(flexToolBar, 'loadConfig').and.returnValues([{
text: 'test',
callback: 'application:about',
show: {
pattern: '*.js'
}
}]);
flexToolBar.reloadToolbar();
expect(flexToolBar.functionConditions.length).toBe(0);
jasmine.clock().tick(1000);
expect(flexToolBar.pollFunctions).toHaveBeenCalledTimes(1);
expect(flexToolBar.reloadToolbar).toHaveBeenCalledTimes(1);
});
it('should reload if a function condition changes', async function () {
const textEditor = await atom.workspace.open('./fixtures/sample.js');
spyOn(flexToolBar, 'pollFunctions').and.callThrough();
spyOn(flexToolBar, 'reloadToolbar').and.callThrough();
spyOn(flexToolBar, 'loadConfig').and.returnValues([{
text: 'test',
callback: 'application:about',
show: {
function: (editor) => editor.isModified()
}
}]);
flexToolBar.reloadToolbar();
expect(flexToolBar.pollFunctions).toHaveBeenCalledTimes(1);
expect(flexToolBar.reloadToolbar).toHaveBeenCalledTimes(1);
jasmine.clock().tick(300);
spyOn(textEditor, 'isModified').and.returnValues(true);
jasmine.clock().tick(600);
expect(flexToolBar.pollFunctions).toHaveBeenCalledTimes(3);
expect(flexToolBar.reloadToolbar).toHaveBeenCalledTimes(2);
});
});
=======
describe('correct project config path', function () {
beforeEach(function () {
flexToolBar.configFilePath = path.resolve(__dirname, './fixtures/config/config.json');
});
it('should load toolbar.cson from specified path', async function () {
atom.config.set('flex-tool-bar.toolBarProjectConfigurationFilePath', '.');
await atom.workspace.open(path.join(__dirname, 'fixtures/sample.js'));
expect(flexToolBar.projectToolbarConfigPath).toBe(path.resolve(__dirname, './fixtures/toolbar.cson'));
});
it('should load specified config file', async function () {
atom.config.set('flex-tool-bar.toolBarProjectConfigurationFilePath', './config/config.cson');
await atom.workspace.open(path.join(__dirname, 'fixtures/sample.js'));
expect(flexToolBar.projectToolbarConfigPath).toBe(path.resolve(__dirname, './fixtures/config/config.cson'));
});
it('should not load if path equals global config file', async function () {
atom.config.set('flex-tool-bar.toolBarProjectConfigurationFilePath', './config/config.json');
await atom.workspace.open(path.join(__dirname, 'fixtures/sample.js'));
expect(flexToolBar.projectToolbarConfigPath).toBe(null);
});
});
describe('persistent project tool bar', function () {
beforeEach(async function () {
this.project1Config = path.join(__dirname, 'fixtures/project1/toolbar.cson');
this.project2Config = path.join(__dirname, 'fixtures/project2/toolbar.cson');
this.project1Sample = path.join(__dirname, 'fixtures/project1/sample.js');
this.project2Sample = path.join(__dirname, 'fixtures/project2/sample.js');
this.project3Sample = path.join(__dirname, 'fixtures/project3/sample.js');
this.settingsView = 'atom://config/packages/flex-toolbar';
await atom.packages.activatePackage('settings-view');
flexToolBar.projectToolbarConfigPath = null;
atom.project.setPaths([
path.join(__dirname, 'fixtures/project1/'),
path.join(__dirname, 'fixtures/project2/'),
path.join(__dirname, 'fixtures/project3/'),
]);
});
it('should not persistent when an editor is open that does not have a project config', async function () {
atom.config.set('flex-tool-bar.persistentProjectToolBar', false);
await atom.workspace.open(this.project1Sample);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project1Config);
await atom.workspace.open(this.settingsView);
expect(flexToolBar.projectToolbarConfigPath).toBeNull();
await atom.workspace.open(this.project3Sample);
expect(flexToolBar.projectToolbarConfigPath).toBeNull();
await atom.workspace.open(this.project2Sample);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project2Config);
await atom.workspace.open(this.settingsView);
expect(flexToolBar.projectToolbarConfigPath).toBeNull();
await atom.workspace.open(this.project3Sample);
expect(flexToolBar.projectToolbarConfigPath).toBeNull();
await atom.workspace.open(this.project1Sample);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project1Config);
});
it('should persistent when an editor is open that does not have a project config', async function () {
atom.config.set('flex-tool-bar.persistentProjectToolBar', true);
await atom.workspace.open(this.project1Sample);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project1Config);
await atom.workspace.open(this.settingsView);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project1Config);
await atom.workspace.open(this.project3Sample);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project1Config);
await atom.workspace.open(this.project2Sample);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project2Config);
await atom.workspace.open(this.settingsView);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project2Config);
await atom.workspace.open(this.project3Sample);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project2Config);
await atom.workspace.open(this.project1Sample);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project1Config);
});
});
>>>>>>>
describe('function condition', function () {
beforeEach(function () {
jasmine.clock().install();
});
afterEach(function () {
jasmine.clock().uninstall();
});
it('should check condition and return boolean', function () {
let match;
match = flexToolBar.condition(() => true);
expect(match).toBe(true);
match = flexToolBar.condition(() => 1);
expect(match).toBe(true);
match = flexToolBar.condition(() => false);
expect(match).toBe(false);
match = flexToolBar.condition(() => 0);
expect(match).toBe(false);
});
it('should poll function conditions', async function () {
await atom.workspace.open('./fixtures/sample.js');
spyOn(flexToolBar, 'pollFunctions').and.callThrough();
spyOn(flexToolBar, 'reloadToolbar').and.callThrough();
spyOn(flexToolBar, 'loadConfig').and.returnValues([{
text: 'test',
callback: 'application:about',
show: {
function: (editor) => editor.isModified()
}
}]);
flexToolBar.reloadToolbar();
expect(flexToolBar.functionConditions.length).toBe(1);
jasmine.clock().tick(900);
expect(flexToolBar.pollFunctions).toHaveBeenCalledTimes(4);
expect(flexToolBar.reloadToolbar).toHaveBeenCalledTimes(1);
});
it('should not poll if no function conditions', async function () {
await atom.workspace.open('./fixtures/sample.js');
spyOn(flexToolBar, 'pollFunctions').and.callThrough();
spyOn(flexToolBar, 'reloadToolbar').and.callThrough();
spyOn(flexToolBar, 'loadConfig').and.returnValues([{
text: 'test',
callback: 'application:about',
show: {
pattern: '*.js'
}
}]);
flexToolBar.reloadToolbar();
expect(flexToolBar.functionConditions.length).toBe(0);
jasmine.clock().tick(1000);
expect(flexToolBar.pollFunctions).toHaveBeenCalledTimes(1);
expect(flexToolBar.reloadToolbar).toHaveBeenCalledTimes(1);
});
it('should reload if a function condition changes', async function () {
const textEditor = await atom.workspace.open('./fixtures/sample.js');
spyOn(flexToolBar, 'pollFunctions').and.callThrough();
spyOn(flexToolBar, 'reloadToolbar').and.callThrough();
spyOn(flexToolBar, 'loadConfig').and.returnValues([{
text: 'test',
callback: 'application:about',
show: {
function: (editor) => editor.isModified()
}
}]);
flexToolBar.reloadToolbar();
expect(flexToolBar.pollFunctions).toHaveBeenCalledTimes(1);
expect(flexToolBar.reloadToolbar).toHaveBeenCalledTimes(1);
jasmine.clock().tick(300);
spyOn(textEditor, 'isModified').and.returnValues(true);
jasmine.clock().tick(600);
expect(flexToolBar.pollFunctions).toHaveBeenCalledTimes(3);
expect(flexToolBar.reloadToolbar).toHaveBeenCalledTimes(2);
});
});
describe('correct project config path', function () {
beforeEach(function () {
flexToolBar.configFilePath = path.resolve(__dirname, './fixtures/config/config.json');
});
it('should load toolbar.cson from specified path', async function () {
atom.config.set('flex-tool-bar.toolBarProjectConfigurationFilePath', '.');
await atom.workspace.open(path.join(__dirname, 'fixtures/sample.js'));
expect(flexToolBar.projectToolbarConfigPath).toBe(path.resolve(__dirname, './fixtures/toolbar.cson'));
});
it('should load specified config file', async function () {
atom.config.set('flex-tool-bar.toolBarProjectConfigurationFilePath', './config/config.cson');
await atom.workspace.open(path.join(__dirname, 'fixtures/sample.js'));
expect(flexToolBar.projectToolbarConfigPath).toBe(path.resolve(__dirname, './fixtures/config/config.cson'));
});
it('should not load if path equals global config file', async function () {
atom.config.set('flex-tool-bar.toolBarProjectConfigurationFilePath', './config/config.json');
await atom.workspace.open(path.join(__dirname, 'fixtures/sample.js'));
expect(flexToolBar.projectToolbarConfigPath).toBe(null);
});
});
describe('persistent project tool bar', function () {
beforeEach(async function () {
this.project1Config = path.join(__dirname, 'fixtures/project1/toolbar.cson');
this.project2Config = path.join(__dirname, 'fixtures/project2/toolbar.cson');
this.project1Sample = path.join(__dirname, 'fixtures/project1/sample.js');
this.project2Sample = path.join(__dirname, 'fixtures/project2/sample.js');
this.project3Sample = path.join(__dirname, 'fixtures/project3/sample.js');
this.settingsView = 'atom://config/packages/flex-toolbar';
await atom.packages.activatePackage('settings-view');
flexToolBar.projectToolbarConfigPath = null;
atom.project.setPaths([
path.join(__dirname, 'fixtures/project1/'),
path.join(__dirname, 'fixtures/project2/'),
path.join(__dirname, 'fixtures/project3/'),
]);
});
it('should not persistent when an editor is open that does not have a project config', async function () {
atom.config.set('flex-tool-bar.persistentProjectToolBar', false);
await atom.workspace.open(this.project1Sample);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project1Config);
await atom.workspace.open(this.settingsView);
expect(flexToolBar.projectToolbarConfigPath).toBeNull();
await atom.workspace.open(this.project3Sample);
expect(flexToolBar.projectToolbarConfigPath).toBeNull();
await atom.workspace.open(this.project2Sample);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project2Config);
await atom.workspace.open(this.settingsView);
expect(flexToolBar.projectToolbarConfigPath).toBeNull();
await atom.workspace.open(this.project3Sample);
expect(flexToolBar.projectToolbarConfigPath).toBeNull();
await atom.workspace.open(this.project1Sample);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project1Config);
});
it('should persistent when an editor is open that does not have a project config', async function () {
atom.config.set('flex-tool-bar.persistentProjectToolBar', true);
await atom.workspace.open(this.project1Sample);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project1Config);
await atom.workspace.open(this.settingsView);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project1Config);
await atom.workspace.open(this.project3Sample);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project1Config);
await atom.workspace.open(this.project2Sample);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project2Config);
await atom.workspace.open(this.settingsView);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project2Config);
await atom.workspace.open(this.project3Sample);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project2Config);
await atom.workspace.open(this.project1Sample);
expect(flexToolBar.projectToolbarConfigPath).toBe(this.project1Config);
});
}); |
<<<<<<<
Blockly.Lua.scrub_=function(a,b){var c="";if(!a.outputConnection||!a.outputConnection.targetConnection){var d=a.getCommentText();(d=Blockly.utils.wrap(d,this.COMMENT_WRAP-3))&&(c+=Blockly.Lua.prefixLines(d,"-- ")+"\n");for(var e=0;e<a.inputList.length;e++)a.inputList[e].type==Blockly.INPUT_VALUE&&(d=a.inputList[e].connection.targetBlock())&&(d=Blockly.Lua.allNestedComments(d))&&(c+=Blockly.Lua.prefixLines(d,"-- "))}e=a.nextConnection&&a.nextConnection.targetBlock();e=Blockly.Lua.blockToCode(e);return c+
b+e};Blockly.Lua.lists={};Blockly.Lua.lists_create_empty=function(a){return["({})",Blockly.Lua.ORDER_ATOMIC]};Blockly.Lua.lists_create_with=function(a){for(var b=Array(a.itemCount_),c=0;c<a.itemCount_;c++)b[c]=Blockly.Lua.valueToCode(a,"ADD"+c,Blockly.Lua.ORDER_NONE)||"None";b="({"+b.join(", ")+"})";return[b,Blockly.Lua.ORDER_ATOMIC]};
=======
Blockly.Lua.scrub_=function(a,b){var c="";if(!a.outputConnection||!a.outputConnection.targetConnection){var d=a.getCommentText();(d=Blockly.utils.wrap(d,Blockly.Lua.COMMENT_WRAP-3))&&(c+=Blockly.Lua.prefixLines(d,"-- ")+"\n");for(var e=0;e<a.inputList.length;e++)a.inputList[e].type==Blockly.INPUT_VALUE&&(d=a.inputList[e].connection.targetBlock())&&(d=Blockly.Lua.allNestedComments(d))&&(c+=Blockly.Lua.prefixLines(d,"-- "))}e=a.nextConnection&&a.nextConnection.targetBlock();e=Blockly.Lua.blockToCode(e);
return c+b+e};Blockly.Lua.colour={};Blockly.Lua.colour_picker=function(a){return["'"+a.getFieldValue("COLOUR")+"'",Blockly.Lua.ORDER_ATOMIC]};Blockly.Lua.colour_random=function(a){return['string.format("#%06x", math.random(0, 2^24 - 1))',Blockly.Lua.ORDER_HIGH]};
Blockly.Lua.colour_rgb=function(a){var b=Blockly.Lua.provideFunction_("colour_rgb",["function "+Blockly.Lua.FUNCTION_NAME_PLACEHOLDER_+"(r, g, b)"," r = math.floor(math.min(100, math.max(0, r)) * 2.55 + .5)"," g = math.floor(math.min(100, math.max(0, g)) * 2.55 + .5)"," b = math.floor(math.min(100, math.max(0, b)) * 2.55 + .5)",' return string.format("#%02x%02x%02x", r, g, b)',"end"]),c=Blockly.Lua.valueToCode(a,"RED",Blockly.Lua.ORDER_NONE)||0,d=Blockly.Lua.valueToCode(a,"GREEN",Blockly.Lua.ORDER_NONE)||
0;a=Blockly.Lua.valueToCode(a,"BLUE",Blockly.Lua.ORDER_NONE)||0;return[b+"("+c+", "+d+", "+a+")",Blockly.Lua.ORDER_HIGH]};
Blockly.Lua.colour_blend=function(a){var b=Blockly.Lua.provideFunction_("colour_blend",["function "+Blockly.Lua.FUNCTION_NAME_PLACEHOLDER_+"(colour1, colour2, ratio)"," local r1 = tonumber(string.sub(colour1, 2, 3), 16)"," local r2 = tonumber(string.sub(colour2, 2, 3), 16)"," local g1 = tonumber(string.sub(colour1, 4, 5), 16)"," local g2 = tonumber(string.sub(colour2, 4, 5), 16)"," local b1 = tonumber(string.sub(colour1, 6, 7), 16)"," local b2 = tonumber(string.sub(colour2, 6, 7), 16)"," local ratio = math.min(1, math.max(0, ratio))",
" local r = math.floor(r1 * (1 - ratio) + r2 * ratio + .5)"," local g = math.floor(g1 * (1 - ratio) + g2 * ratio + .5)"," local b = math.floor(b1 * (1 - ratio) + b2 * ratio + .5)",' return string.format("#%02x%02x%02x", r, g, b)',"end"]),c=Blockly.Lua.valueToCode(a,"COLOUR1",Blockly.Lua.ORDER_NONE)||"'#000000'",d=Blockly.Lua.valueToCode(a,"COLOUR2",Blockly.Lua.ORDER_NONE)||"'#000000'";a=Blockly.Lua.valueToCode(a,"RATIO",Blockly.Lua.ORDER_NONE)||0;return[b+"("+c+", "+d+", "+a+")",Blockly.Lua.ORDER_HIGH]};Blockly.Lua.lists={};Blockly.Lua.lists_create_empty=function(a){return["{}",Blockly.Lua.ORDER_ATOMIC]};Blockly.Lua.lists_create_with=function(a){for(var b=Array(a.itemCount_),c=0;c<a.itemCount_;c++)b[c]=Blockly.Lua.valueToCode(a,"ADD"+c,Blockly.Lua.ORDER_NONE)||"None";return["{"+b.join(", ")+"}",Blockly.Lua.ORDER_ATOMIC]};
>>>>>>>
Blockly.Lua.scrub_=function(a,b){var c="";if(!a.outputConnection||!a.outputConnection.targetConnection){var d=a.getCommentText();(d=Blockly.utils.wrap(d,Blockly.Lua.COMMENT_WRAP-3))&&(c+=Blockly.Lua.prefixLines(d,"-- ")+"\n");for(var e=0;e<a.inputList.length;e++)a.inputList[e].type==Blockly.INPUT_VALUE&&(d=a.inputList[e].connection.targetBlock())&&(d=Blockly.Lua.allNestedComments(d))&&(c+=Blockly.Lua.prefixLines(d,"-- "))}e=a.nextConnection&&a.nextConnection.targetBlock();e=Blockly.Lua.blockToCode(e);
return c+b+e};Blockly.Lua.lists={};Blockly.Lua.lists_create_empty=function(a){return["{}",Blockly.Lua.ORDER_ATOMIC]};Blockly.Lua.lists_create_with=function(a){for(var b=Array(a.itemCount_),c=0;c<a.itemCount_;c++)b[c]=Blockly.Lua.valueToCode(a,"ADD"+c,Blockly.Lua.ORDER_NONE)||"None";return["{"+b.join(", ")+"}",Blockly.Lua.ORDER_ATOMIC]};
<<<<<<<
" break"," else"," table.insert(t, string.sub(input, pos, next_delim-1))"," pos = next_delim + #delim"," end"," end"," return t","end"]);else if("JOIN"==a)b||(b="({})"),a="table.concat";else throw"Unknown mode: "+a;return[a+"("+b+", "+c+")",Blockly.Lua.ORDER_HIGH]};Blockly.Lua.math={};Blockly.Lua.math_number=function(a){a=parseFloat(a.getFieldValue("NUM"));return[a,0>a?Blockly.Lua.ORDER_UNARY:Blockly.Lua.ORDER_ATOMIC]};
=======
" break"," else"," table.insert(t, string.sub(input, pos, next_delim-1))"," pos = next_delim + #delim"," end"," end"," return t","end"]);else if("JOIN"==a)b||(b="{}"),a="table.concat";else throw"Unknown mode: "+a;return[a+"("+b+", "+c+")",Blockly.Lua.ORDER_HIGH]};Blockly.Lua.logic={};Blockly.Lua.controls_if=function(a){for(var b=0,c=Blockly.Lua.valueToCode(a,"IF"+b,Blockly.Lua.ORDER_NONE)||"false",d=Blockly.Lua.statementToCode(a,"DO"+b),e="if "+c+" then\n"+d,b=1;b<=a.elseifCount_;b++)c=Blockly.Lua.valueToCode(a,"IF"+b,Blockly.Lua.ORDER_NONE)||"false",d=Blockly.Lua.statementToCode(a,"DO"+b),e+=" elseif "+c+" then\n"+d;a.elseCount_&&(d=Blockly.Lua.statementToCode(a,"ELSE"),e+=" else\n"+d);return e+"end\n"};
Blockly.Lua.logic_compare=function(a){var b={EQ:"==",NEQ:"~=",LT:"<",LTE:"<=",GT:">",GTE:">="}[a.getFieldValue("OP")],c=Blockly.Lua.valueToCode(a,"A",Blockly.Lua.ORDER_RELATIONAL)||"0";a=Blockly.Lua.valueToCode(a,"B",Blockly.Lua.ORDER_RELATIONAL)||"0";return[c+" "+b+" "+a,Blockly.Lua.ORDER_RELATIONAL]};
Blockly.Lua.logic_operation=function(a){var b="AND"==a.getFieldValue("OP")?"and":"or",c="and"==b?Blockly.Lua.ORDER_AND:Blockly.Lua.ORDER_OR,d=Blockly.Lua.valueToCode(a,"A",c);a=Blockly.Lua.valueToCode(a,"B",c);if(d||a){var e="and"==b?"true":"false";d||(d=e);a||(a=e)}else a=d="false";return[d+" "+b+" "+a,c]};Blockly.Lua.logic_negate=function(a){return["not "+(Blockly.Lua.valueToCode(a,"BOOL",Blockly.Lua.ORDER_UNARY)||"true"),Blockly.Lua.ORDER_UNARY]};
Blockly.Lua.logic_boolean=function(a){return["TRUE"==a.getFieldValue("BOOL")?"true":"false",Blockly.Lua.ORDER_ATOMIC]};Blockly.Lua.logic_null=function(a){return["nil",Blockly.Lua.ORDER_ATOMIC]};Blockly.Lua.logic_ternary=function(a){var b=Blockly.Lua.valueToCode(a,"IF",Blockly.Lua.ORDER_AND)||"false",c=Blockly.Lua.valueToCode(a,"THEN",Blockly.Lua.ORDER_AND)||"nil";a=Blockly.Lua.valueToCode(a,"ELSE",Blockly.Lua.ORDER_OR)||"nil";return[b+" and "+c+" or "+a,Blockly.Lua.ORDER_OR]};Blockly.Lua.loops={};Blockly.Lua.CONTINUE_STATEMENT="goto continue\n";Blockly.Lua.addContinueLabel=function(a){return-1<a.indexOf(Blockly.Lua.CONTINUE_STATEMENT)?a+Blockly.Lua.INDENT+"::continue::\n":a};Blockly.Lua.controls_repeat=function(a){var b=parseInt(a.getFieldValue("TIMES"),10);a=Blockly.Lua.statementToCode(a,"DO")||"";a=Blockly.Lua.addContinueLabel(a);return"for "+Blockly.Lua.variableDB_.getDistinctName("count",Blockly.Variables.NAME_TYPE)+" = 1, "+b+" do\n"+a+"end\n"};
Blockly.Lua.controls_repeat_ext=function(a){var b=Blockly.Lua.valueToCode(a,"TIMES",Blockly.Lua.ORDER_NONE)||"0",b=Blockly.isNumber(b)?parseInt(b,10):"math.floor("+b+")";a=Blockly.Lua.statementToCode(a,"DO")||"\n";a=Blockly.Lua.addContinueLabel(a);return"for "+Blockly.Lua.variableDB_.getDistinctName("count",Blockly.Variables.NAME_TYPE)+" = 1, "+b+" do\n"+a+"end\n"};
Blockly.Lua.controls_whileUntil=function(a){var b="UNTIL"==a.getFieldValue("MODE"),c=Blockly.Lua.valueToCode(a,"BOOL",b?Blockly.Lua.ORDER_UNARY:Blockly.Lua.ORDER_NONE)||"false",d=Blockly.Lua.statementToCode(a,"DO")||"\n",d=Blockly.Lua.addLoopTrap(d,a.id),d=Blockly.Lua.addContinueLabel(d);b&&(c="not "+c);return"while "+c+" do\n"+d+"end\n"};
Blockly.Lua.controls_for=function(a){var b=Blockly.Lua.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE),c=Blockly.Lua.valueToCode(a,"FROM",Blockly.Lua.ORDER_NONE)||"0",d=Blockly.Lua.valueToCode(a,"TO",Blockly.Lua.ORDER_NONE)||"0",e=Blockly.Lua.valueToCode(a,"BY",Blockly.Lua.ORDER_NONE)||"1",f=Blockly.Lua.statementToCode(a,"DO")||"\n",f=Blockly.Lua.addLoopTrap(f,a.id),f=Blockly.Lua.addContinueLabel(f);a="";var g;Blockly.isNumber(c)&&Blockly.isNumber(d)&&Blockly.isNumber(e)?(g=
parseFloat(c)<=parseFloat(d),e=Math.abs(parseFloat(e)),g=(g?"":"-")+e):(a="",g=Blockly.Lua.variableDB_.getDistinctName(b+"_inc",Blockly.Variables.NAME_TYPE),a+=g+" = ",a=Blockly.isNumber(e)?a+(Math.abs(e)+"\n"):a+("math.abs("+e+")\n"),a=a+("if ("+c+") > ("+d+") then\n")+(Blockly.Lua.INDENT+g+" = -"+g+"\n"),a+="end\n");return a+("for "+b+" = "+c+", "+d+", "+g)+(" do\n"+f+"end\n")};
Blockly.Lua.controls_forEach=function(a){var b=Blockly.Lua.variableDB_.getName(a.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE),c=Blockly.Lua.valueToCode(a,"LIST",Blockly.Lua.ORDER_NONE)||"{}";a=Blockly.Lua.statementToCode(a,"DO")||"\n";a=Blockly.Lua.addContinueLabel(a);return"for _, "+b+" in ipairs("+c+") do \n"+a+"end\n"};
Blockly.Lua.controls_flow_statements=function(a){switch(a.getFieldValue("FLOW")){case "BREAK":return"break\n";case "CONTINUE":return Blockly.Lua.CONTINUE_STATEMENT}throw"Unknown flow statement.";};Blockly.Lua.math={};Blockly.Lua.math_number=function(a){a=parseFloat(a.getFieldValue("NUM"));return[a,0>a?Blockly.Lua.ORDER_UNARY:Blockly.Lua.ORDER_ATOMIC]};
>>>>>>>
" break"," else"," table.insert(t, string.sub(input, pos, next_delim-1))"," pos = next_delim + #delim"," end"," end"," return t","end"]);else if("JOIN"==a)b||(b="{}"),a="table.concat";else throw"Unknown mode: "+a;return[a+"("+b+", "+c+")",Blockly.Lua.ORDER_HIGH]};Blockly.Lua.math={};Blockly.Lua.math_number=function(a){a=parseFloat(a.getFieldValue("NUM"));return[a,0>a?Blockly.Lua.ORDER_UNARY:Blockly.Lua.ORDER_ATOMIC]}; |
<<<<<<<
=======
var workspaceOptions = {
disabledPatternId: workspace.options.disabledPatternId,
parentWorkspace: workspace,
RTL: workspace.RTL,
oneBasedIndex: workspace.options.oneBasedIndex,
horizontalLayout: workspace.horizontalLayout,
toolboxPosition: workspace.options.toolboxPosition
};
/**
* @type {!Blockly.Flyout}
* @private
*/
this.flyout_ = new Blockly.Flyout(workspaceOptions);
goog.dom.insertSiblingAfter(this.flyout_.createDom(), workspace.svgGroup_);
this.flyout_.init(workspace);
>>>>>>>
<<<<<<<
=======
* Fill the toolbox with categories and blocks.
* @param {!Node} newTree DOM tree of blocks.
* @return {Node} Tree node to open at startup (or null).
* @private
*/
Blockly.Toolbox.prototype.populate_ = function(newTree) {
this.tree_.removeChildren(); // Delete any existing content.
this.tree_.blocks = [];
this.hasColours_ = false;
var openNode =
this.syncTrees_(newTree, this.tree_, this.workspace_.options.pathToMedia);
if (this.tree_.blocks.length) {
throw 'Toolbox cannot have both blocks and categories in the root level.';
}
// Fire a resize event since the toolbox may have changed width and height.
this.workspace_.resizeContents();
return openNode;
};
/**
* Sync trees of the toolbox.
* @param {!Node} treeIn DOM tree of blocks.
* @param {!Blockly.Toolbox.TreeControl} treeOut
* @param {string} pathToMedia
* @return {Node} Tree node to open at startup (or null).
* @private
*/
Blockly.Toolbox.prototype.syncTrees_ = function(treeIn, treeOut, pathToMedia) {
var openNode = null;
var lastElement = null;
for (var i = 0, childIn; childIn = treeIn.childNodes[i]; i++) {
if (!childIn.tagName) {
// Skip over text.
continue;
}
switch (childIn.tagName.toUpperCase()) {
case 'CATEGORY':
var childOut = this.tree_.createNode(childIn.getAttribute('name'));
childOut.blocks = [];
treeOut.add(childOut);
var custom = childIn.getAttribute('custom');
if (custom) {
// Variables and procedures are special dynamic categories.
childOut.blocks = custom;
} else {
var newOpenNode = this.syncTrees_(childIn, childOut, pathToMedia);
if (newOpenNode) {
openNode = newOpenNode;
}
}
var colour = childIn.getAttribute('colour');
if (goog.isString(colour)) {
if (colour.match(/^#[0-9a-fA-F]{6}$/)) {
childOut.hexColour = colour;
} else {
childOut.hexColour = Blockly.hueToRgb(colour);
}
this.hasColours_ = true;
} else {
childOut.hexColour = '';
}
if (childIn.getAttribute('expanded') == 'true') {
if (childOut.blocks.length) {
// This is a category that directly contians blocks.
// After the tree is rendered, open this category and show flyout.
openNode = childOut;
}
childOut.setExpanded(true);
} else {
childOut.setExpanded(false);
}
lastElement = childIn;
break;
case 'SEP':
if (lastElement) {
if (lastElement.tagName.toUpperCase() == 'CATEGORY') {
// Separator between two categories.
// <sep></sep>
treeOut.add(new Blockly.Toolbox.TreeSeparator(
this.treeSeparatorConfig_));
} else {
// Change the gap between two blocks.
// <sep gap="36"></sep>
// The default gap is 24, can be set larger or smaller.
// Note that a deprecated method is to add a gap to a block.
// <block type="math_arithmetic" gap="8"></block>
var newGap = parseFloat(childIn.getAttribute('gap'));
if (!isNaN(newGap) && lastElement) {
lastElement.setAttribute('gap', newGap);
}
}
}
break;
case 'BLOCK':
case 'SHADOW':
case 'LABEL':
case 'BUTTON':
treeOut.blocks.push(childIn);
lastElement = childIn;
break;
}
}
return openNode;
};
/**
* Recursively add colours to this toolbox.
* @param {Blockly.Toolbox.TreeNode} opt_tree Starting point of tree.
* Defaults to the root node.
* @private
*/
Blockly.Toolbox.prototype.addColour_ = function(opt_tree) {
var tree = opt_tree || this.tree_;
var children = tree.getChildren();
for (var i = 0, child; child = children[i]; i++) {
var element = child.getRowElement();
if (element) {
if (this.hasColours_) {
var border = '8px solid ' + (child.hexColour || '#ddd');
} else {
var border = 'none';
}
if (this.workspace_.RTL) {
element.style.borderRight = border;
} else {
element.style.borderLeft = border;
}
}
this.addColour_(child);
}
};
/**
>>>>>>>
<<<<<<<
Blockly.Toolbox.prototype.setSelectedItem = function(item) {
if (this.selectedItem_) {
// Don't do anything if they selected the already-open category.
if (this.selectedItem_ == item) {
return;
}
// They selected a different category but one was already open. Close it.
this.selectedItem_.setSelected(false);
}
this.selectedItem_ = item;
if (this.selectedItem_ != null) {
this.selectedItem_.setSelected(true);
this.flyout_.show(item.getContents());
this.flyout_.scrollToStart();
=======
Blockly.Toolbox.TreeControl.prototype.enterDocument = function() {
Blockly.Toolbox.TreeControl.superClass_.enterDocument.call(this);
var el = this.getElement();
// Add touch handler.
if (goog.events.BrowserFeature.TOUCH_ENABLED) {
Blockly.bindEventWithChecks_(el, goog.events.EventType.TOUCHSTART, this,
this.handleTouchEvent_);
>>>>>>>
Blockly.Toolbox.prototype.setSelectedItem = function(item) {
if (this.selectedItem_) {
// Don't do anything if they selected the already-open category.
if (this.selectedItem_ == item) {
return;
}
// They selected a different category but one was already open. Close it.
this.selectedItem_.setSelected(false);
}
this.selectedItem_ = item;
if (this.selectedItem_ != null) {
this.selectedItem_.setSelected(true);
this.flyout_.show(item.getContents());
this.flyout_.scrollToStart();
<<<<<<<
Blockly.Toolbox.Category = function(parent, parentHtml, domTree) {
this.parent_ = parent;
this.parentHtml_ = parentHtml;
this.name_ = domTree.getAttribute('name');
this.setColour(domTree);
this.custom_ = domTree.getAttribute('custom');
this.contents_ = [];
if (!this.custom_) {
this.parseContents_(domTree);
=======
Blockly.Toolbox.TreeNode = function(toolbox, html, opt_config, opt_domHelper) {
goog.ui.tree.TreeNode.call(this, html, opt_config, opt_domHelper);
if (toolbox) {
var resize = function() {
// Even though the div hasn't changed size, the visible workspace
// surface of the workspace has, so we may need to reposition everything.
Blockly.svgResize(toolbox.workspace_);
};
// Fire a resize event since the toolbox may have changed width.
goog.events.listen(toolbox.tree_,
goog.ui.tree.BaseNode.EventType.EXPAND, resize);
goog.events.listen(toolbox.tree_,
goog.ui.tree.BaseNode.EventType.COLLAPSE, resize);
>>>>>>>
Blockly.Toolbox.Category = function(parent, parentHtml, domTree) {
this.parent_ = parent;
this.parentHtml_ = parentHtml;
this.name_ = domTree.getAttribute('name');
this.setColour(domTree);
this.custom_ = domTree.getAttribute('custom');
this.contents_ = [];
if (!this.custom_) {
this.parseContents_(domTree);
<<<<<<<
Blockly.Toolbox.Category.prototype.parseContents_ = function(domTree) {
for (var i = 0, child; child = domTree.childNodes[i]; i++) {
if (!child.tagName) {
// Skip
continue;
}
switch (child.tagName.toUpperCase()) {
case 'BLOCK':
case 'SHADOW':
case 'BUTTON':
case 'TEXT':
this.contents_.push(child);
break;
default:
break;
}
=======
Blockly.Toolbox.TreeNode.prototype.onKeyDown = function(e) {
if (this.tree.toolbox_.horizontalLayout_) {
var map = {};
var next = goog.events.KeyCodes.DOWN
var prev = goog.events.KeyCodes.UP
map[goog.events.KeyCodes.RIGHT] = this.rightToLeft_ ? prev : next;
map[goog.events.KeyCodes.LEFT] = this.rightToLeft_ ? next : prev;
map[goog.events.KeyCodes.UP] = goog.events.KeyCodes.LEFT;
map[goog.events.KeyCodes.DOWN] = goog.events.KeyCodes.RIGHT;
var newKeyCode = map[e.keyCode];
e.keyCode = newKeyCode || e.keyCode;
>>>>>>>
Blockly.Toolbox.Category.prototype.parseContents_ = function(domTree) {
for (var i = 0, child; child = domTree.childNodes[i]; i++) {
if (!child.tagName) {
// Skip
continue;
}
switch (child.tagName.toUpperCase()) {
case 'BLOCK':
case 'SHADOW':
case 'LABEL':
case 'BUTTON':
case 'TEXT':
this.contents_.push(child);
break;
default:
break;
} |
<<<<<<<
/*! formstone v1.1.0 [touch.js] 2016-04-03 | MIT License | formstone.it */
=======
/*! formstone v1.0.1 [touch.js] 2016-04-14 | MIT License | formstone.it */
>>>>>>>
/*! formstone v1.1.0 [touch.js] 2016-04-14 | MIT License | formstone.it */ |
<<<<<<<
/*! formstone v0.6.14 [carousel.js] 2015-06-23 | MIT License | formstone.it */
=======
/*! formstone v0.6.12 [carousel.js] 2015-07-04 | MIT License | formstone.it */
>>>>>>>
/*! formstone v0.6.14 [carousel.js] 2015-07-04 | MIT License | formstone.it */ |
<<<<<<<
<span className={lineContainerClass}
onClick={item.get('isCheckbox') ? this.handleCheckboxClick(item.get('id')) : null}>
{item.get('isCheckbox') && (
<Checkbox state={item.get('checkboxState')} />
)}
<AttributedString parts={item.get('titleLine')} subPartDataAndHandlers={subPartDataAndHandlers} />
=======
<span
className={lineContainerClass}
onClick={item.get('isCheckbox') ? this.handleCheckboxClick(item.get('id')) : null}
>
{item.get('isCheckbox') && <Checkbox state={item.get('checkboxState')} />}
<AttributedString parts={item.get('titleLine')} />
>>>>>>>
<span
className={lineContainerClass}
onClick={item.get('isCheckbox') ? this.handleCheckboxClick(item.get('id')) : null}
>
{item.get('isCheckbox') && <Checkbox state={item.get('checkboxState')} />}
<AttributedString
parts={item.get('titleLine')}
subPartDataAndHandlers={subPartDataAndHandlers}
/> |
<<<<<<<
{activePopupType === 'tags-editor' && !!selectedHeader && (
<TagsEditorModal header={selectedHeader}
allTags={OrderedSet(headers.flatMap(header => header.getIn(['titleLine', 'tags']))).sort()}
onClose={this.handlePopupClose}
onChange={this.handleTagsChange} />
)}
{activePopupType === 'timestamp-editor' && (
<TimestampEditorModal timestamp={timestampWithId(headers, activePopupData.get('timestampId'))}
onClose={this.handlePopupClose}
onChange={this.handleTimestampChange(activePopupData.get('timestampId'))} />
)}
{!shouldDisableActions && !activePopup && (
<ActionDrawer shouldDisableSyncButtons={shouldDisableSyncButtons}
staticFile={staticFile} />
)}
=======
{activePopupType === 'tags-editor' &&
!!selectedHeader && (
<TagsEditorModal
header={selectedHeader}
allTags={OrderedSet(
headers.flatMap(header => header.getIn(['titleLine', 'tags']))
).sort()}
onClose={this.handlePopupClose}
onChange={this.handleTagsChange}
/>
)}
{!shouldDisableActions &&
!activePopup && (
<ActionDrawer
shouldDisableSyncButtons={shouldDisableSyncButtons}
staticFile={staticFile}
/>
)}
>>>>>>>
{activePopupType === 'tags-editor' &&
!!selectedHeader && (
<TagsEditorModal
header={selectedHeader}
allTags={OrderedSet(
headers.flatMap(header => header.getIn(['titleLine', 'tags']))
).sort()}
onClose={this.handlePopupClose}
onChange={this.handleTagsChange}
/>
)}
{activePopupType === 'timestamp-editor' && (
<TimestampEditorModal
timestamp={timestampWithId(headers, activePopupData.get('timestampId'))}
onClose={this.handlePopupClose}
onChange={this.handleTimestampChange(activePopupData.get('timestampId'))}
/>
)}
{!shouldDisableActions &&
!activePopup && (
<ActionDrawer
shouldDisableSyncButtons={shouldDisableSyncButtons}
staticFile={staticFile}
/>
)} |
<<<<<<<
/*! formstone v0.6.14 [cookie.js] 2015-06-23 | MIT License | formstone.it */
=======
/*! formstone v0.6.12 [cookie.js] 2015-07-04 | MIT License | formstone.it */
>>>>>>>
/*! formstone v0.6.14 [cookie.js] 2015-07-04 | MIT License | formstone.it */ |
<<<<<<<
/*! formstone v1.1.0 [touch.js] 2016-04-17 | GPL-3.0 License | formstone.it */
=======
/*! formstone v1.0.4 [touch.js] 2016-04-18 | GPL-3.0 License | formstone.it */
>>>>>>>
/*! formstone v1.1.0 [touch.js] 2016-04-18 | GPL-3.0 License | formstone.it */ |
<<<<<<<
/*! formstone v1.1.0 [cookie.js] 2016-04-03 | MIT License | formstone.it */
=======
/*! formstone v1.0.1 [cookie.js] 2016-04-14 | MIT License | formstone.it */
>>>>>>>
/*! formstone v1.1.0 [cookie.js] 2016-04-14 | MIT License | formstone.it */ |
<<<<<<<
/*! formstone v0.6.14 [tabs.js] 2015-06-23 | MIT License | formstone.it */
=======
/*! formstone v0.6.12 [tabs.js] 2015-07-04 | MIT License | formstone.it */
>>>>>>>
/*! formstone v0.6.14 [tabs.js] 2015-07-04 | MIT License | formstone.it */ |
<<<<<<<
/*! formstone v1.1.0 [lightbox.js] 2016-04-03 | MIT License | formstone.it */
=======
/*! formstone v1.0.1 [lightbox.js] 2016-04-14 | MIT License | formstone.it */
>>>>>>>
/*! formstone v1.1.0 [lightbox.js] 2016-04-14 | MIT License | formstone.it */ |
<<<<<<<
/*! formstone v1.1.0 [number.js] 2016-04-03 | MIT License | formstone.it */
=======
/*! formstone v1.0.1 [number.js] 2016-04-14 | MIT License | formstone.it */
>>>>>>>
/*! formstone v1.1.0 [number.js] 2016-04-14 | MIT License | formstone.it */ |
<<<<<<<
/*! formstone v1.1.0 [checkbox.js] 2016-04-17 | GPL-3.0 License | formstone.it */
=======
/*! formstone v1.0.4 [checkbox.js] 2016-04-18 | GPL-3.0 License | formstone.it */
>>>>>>>
/*! formstone v1.1.0 [checkbox.js] 2016-04-18 | GPL-3.0 License | formstone.it */ |
<<<<<<<
/*! formstone v1.1.0 [tooltip.js] 2016-04-17 | GPL-3.0 License | formstone.it */
=======
/*! formstone v1.0.4 [tooltip.js] 2016-04-18 | GPL-3.0 License | formstone.it */
>>>>>>>
/*! formstone v1.1.0 [tooltip.js] 2016-04-18 | GPL-3.0 License | formstone.it */ |
<<<<<<<
/*! formstone v1.1.0 [equalize.js] 2016-04-03 | MIT License | formstone.it */
=======
/*! formstone v1.0.1 [equalize.js] 2016-04-14 | MIT License | formstone.it */
>>>>>>>
/*! formstone v1.1.0 [equalize.js] 2016-04-14 | MIT License | formstone.it */ |
<<<<<<<
/*! formstone v0.6.14 [scrollbar.js] 2015-06-23 | MIT License | formstone.it */
=======
/*! formstone v0.6.12 [scrollbar.js] 2015-07-04 | MIT License | formstone.it */
>>>>>>>
/*! formstone v0.6.14 [scrollbar.js] 2015-07-04 | MIT License | formstone.it */ |
<<<<<<<
/*! formstone v1.1.0 [transition.js] 2016-04-03 | MIT License | formstone.it */
=======
/*! formstone v1.0.1 [transition.js] 2016-04-14 | MIT License | formstone.it */
>>>>>>>
/*! formstone v1.1.0 [transition.js] 2016-04-14 | MIT License | formstone.it */ |
<<<<<<<
/*! formstone v1.1.0 [scrollbar.js] 2016-04-03 | MIT License | formstone.it */
=======
/*! formstone v1.0.1 [scrollbar.js] 2016-04-14 | MIT License | formstone.it */
>>>>>>>
/*! formstone v1.1.0 [scrollbar.js] 2016-04-14 | MIT License | formstone.it */ |
<<<<<<<
* @version v2.1.2-M2
=======
* @version v2.1.0
>>>>>>>
* @version v2.1.0
<<<<<<<
return "<!--div class='auth_button' id='apikey_button'><img class='auth_icon' alt='apply api key' src='images/apikey.jpeg'></div-->\r\n<div class='auth_container' id='apikey_container'>\r\n <div class='key_input_container'>\r\n <div class='auth_label'>"
=======
return "<!--div class='auth_button' id='apikey_button'><img class='auth_icon' alt='apply api key' src='images/apikey.jpeg'></div-->\n<div class='auth_container' id='apikey_container'>\n <div class='key_input_container'>\n <div class='auth_label'><label for='input_apiKey_entry'>"
>>>>>>>
return "<!--div class='auth_button' id='apikey_button'><img class='auth_icon' alt='apply api key' src='images/apikey.jpeg'></div-->\n<div class='auth_container' id='apikey_container'>\n <div class='key_input_container'>\n <div class='auth_label'><label for='input_apiKey_entry'>"
<<<<<<<
+ "</div>\r\n <input placeholder=\"api_key\" class=\"auth_input\" id=\"input_apiKey_entry\" name=\"apiKey\" type=\"text\"/>\r\n <div class='auth_submit'><a class='auth_submit_button' id=\"apply_api_key\" href=\"#\">apply</a></div>\r\n </div>\r\n</div>\r\n\r\n";
=======
+ "</label></div>\n <input placeholder='api_key' class='auth_input' id='input_apiKey_entry' name='apiKey' type='text'/>\n <div class='auth_submit'><a class='auth_submit_button' id='apply_api_key' href='#''>apply</a></div>\n </div>\n</div>\n\n";
>>>>>>>
+ "</label></div>\n <input placeholder='api_key' class='auth_input' id='input_apiKey_entry' name='apiKey' type='text'/>\n <div class='auth_submit'><a class='auth_submit_button' id='apply_api_key' href='#''>apply</a></div>\n </div>\n</div>\n\n";
<<<<<<<
return "<div class='auth_button' id='basic_auth_button'><img class='auth_icon' src='images/password.jpeg'></div>\r\n<div class='auth_container' id='basic_auth_container'>\r\n <div class='key_input_container'>\r\n <div class=\"auth_label\">Username</div>\r\n <input placeholder=\"username\" class=\"auth_input\" id=\"input_username\" name=\"username\" type=\"text\"/>\r\n <div class=\"auth_label\">Password</div>\r\n <input placeholder=\"password\" class=\"auth_input\" id=\"input_password\" name=\"password\" type=\"password\"/>\r\n <div class='auth_submit'><a class='auth_submit_button' id=\"apply_basic_auth\" href=\"#\">apply</a></div>\r\n </div>\r\n</div>\r\n\r\n";
=======
return "<div class='auth_button' id='basic_auth_button'><img class='auth_icon' src='images/password.jpeg'></div>\n<div class='auth_container' id='basic_auth_container'>\n <div class='key_input_container'>\n <div class=\"auth_label\"><label for=\"input_username\">Username</label></div>\n <input placeholder=\"username\" class=\"auth_input\" id=\"input_username\" name=\"username\" type=\"text\"/>\n <div class=\"auth_label\"><label for=\"password\">Password</label></div>\n <input placeholder=\"password\" class=\"auth_input\" id=\"input_password\" name=\"password\" type=\"password\"/>\n <div class='auth_submit'><a class='auth_submit_button' id=\"apply_basic_auth\" href=\"#\">apply</a></div>\n </div>\n</div>\n\n";
>>>>>>>
return "<div class='auth_button' id='basic_auth_button'><img class='auth_icon' src='images/password.jpeg'></div>\n<div class='auth_container' id='basic_auth_container'>\n <div class='key_input_container'>\n <div class=\"auth_label\"><label for=\"input_username\">Username</label></div>\n <input placeholder=\"username\" class=\"auth_input\" id=\"input_username\" name=\"username\" type=\"text\"/>\n <div class=\"auth_label\"><label for=\"password\">Password</label></div>\n <input placeholder=\"password\" class=\"auth_input\" id=\"input_password\" name=\"password\" type=\"password\"/>\n <div class='auth_submit'><a class='auth_submit_button' id=\"apply_basic_auth\" href=\"#\">apply</a></div>\n </div>\n</div>\n\n";
<<<<<<<
+ "'></textarea>\n <div class=\"editor_holder\"></div>\n <br />\n <div class=\"parameter-content-type\" />\n";
=======
+ "' id='"
+ escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ "'></textarea>\n <br />\n <div class=\"parameter-content-type\" />\n";
>>>>>>>
+ "' id='"
+ escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ "'></textarea>\n <div class=\"editor_holder\"></div>\n <br />\n <div class=\"parameter-content-type\" />\n";
<<<<<<<
+ "'></textarea>\n <div class=\"editor_holder\"></div>\n <br />\n <div class=\"parameter-content-type\" />\n";
=======
+ "' id='"
+ escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ "'></textarea>\n <br />\n <div class=\"parameter-content-type\" />\n";
>>>>>>>
+ "' id='"
+ escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ "'></textarea>\n <div class=\"editor_holder\"></div>\n <br />\n <div class=\"parameter-content-type\" />\n"; |
<<<<<<<
// Crafted
import DarkmoonDeckTides from './Modules/Items/BFA/Crafted/DarkmoonDeckTides';
=======
import BalefireBranch from './Modules/Items/BFA/Dungeons/BalefireBranch';
>>>>>>>
import BalefireBranch from './Modules/Items/BFA/Dungeons/BalefireBranch';
// Crafted
import DarkmoonDeckTides from './Modules/Items/BFA/Crafted/DarkmoonDeckTides';
<<<<<<<
// Crafted
darkmoonDeckTides: DarkmoonDeckTides,
=======
balefireBranch: BalefireBranch,
>>>>>>>
balefireBranch: BalefireBranch,
// Crafted
darkmoonDeckTides: DarkmoonDeckTides, |
<<<<<<<
/*! formstone v1.1.0 [pagination.js] 2016-04-17 | GPL-3.0 License | formstone.it */
=======
/*! formstone v1.0.4 [pagination.js] 2016-04-18 | GPL-3.0 License | formstone.it */
>>>>>>>
/*! formstone v1.1.0 [pagination.js] 2016-04-18 | GPL-3.0 License | formstone.it */ |
<<<<<<<
/*! formstone v1.1.0 [asap.js] 2016-04-03 | MIT License | formstone.it */
=======
/*! formstone v1.0.1 [asap.js] 2016-04-14 | MIT License | formstone.it */
>>>>>>>
/*! formstone v1.1.0 [asap.js] 2016-04-14 | MIT License | formstone.it */ |
<<<<<<<
'babel-polyfill',
'./src/core/index.js',
=======
'./src/polyfills',
'./src/core/index.js'
>>>>>>>
'./src/polyfills',
'./src/core/index.js'
<<<<<<<
=======
'webpack/hot/dev-server',
'./src/polyfills',
>>>>>>>
'./src/polyfills', |
<<<<<<<
describe('following a user', function() {
const userToFollow = 'ingalls';
before(function() {
return user.unfollow(userToFollow);
})
=======
it('should show user\'s starred gists', function(done) {
const option = {
since: '2015-01-01T00:00:00Z',
};
user.listStarredGists(option, assertArray(done));
});
it('should follow user', function(done) {
user.follow('ingalls', assertSuccessful(done));
});
>>>>>>>
it('should show user\'s starred gists', function(done) {
const option = {
since: '2015-01-01T00:00:00Z',
};
user.listStarredGists(option, assertArray(done));
});
describe('following a user', function() {
const userToFollow = 'ingalls';
before(function() {
return user.unfollow(userToFollow);
}) |
<<<<<<<
$('script[src*="gpt.js"]').remove();
window.googletag = null;
delete window.googletag;
};
beforeEach(cleanup);
afterEach(cleanup);
=======
$('script[src*="googletagservices.com/tag/js/gpt.js"]').remove();
window.googletag = undefined;
});
>>>>>>>
$('script[src*="gpt.js"]').remove();
window.googletag = undefined;
};
beforeEach(cleanup);
afterEach(cleanup); |
<<<<<<<
, createRBT = require('functional-red-black-tree')
=======
, globalStore = {}
>>>>>>>
, createRBT = require('functional-red-black-tree')
, globalStore = {}
function toKey (key) {
return typeof key == 'string' ? '$' + key : JSON.stringify(key)
}
<<<<<<<
function gte(value) {
return value >= this._end
}
function lt(value) {
return value < this._end
}
function lte(value) {
return value <= this._end
=======
function getOrCreateDatabaseFromGlobal(name) {
var key = toKey(name)
, db = globalStore[key]
if (!db)
db = globalStore[key] = {store: {}, keys: []}
return db
}
function sortedIndexOf (arr, item) {
var low = 0, high = arr.length, mid
while (low < high) {
mid = (low + high) >>> 1
arr[mid] < item ? low = mid + 1 : high = mid
}
return low
>>>>>>>
function gte(value) {
return value >= this._end
}
function lt(value) {
return value < this._end
}
function lte(value) {
return value <= this._end
}
function getOrCreateDatabaseFromGlobal(name) {
var key = toKey(name)
, db = globalStore[key]
if (!db)
db = globalStore[key] = {store: {}, keys: []}
return db
}
function sortedIndexOf (arr, item) {
var low = 0, high = arr.length, mid
while (low < high) {
mid = (low + high) >>> 1
arr[mid] < item ? low = mid + 1 : high = mid
}
return low
<<<<<<<
this.tree = createRBT()
=======
var db = getOrCreateDatabaseFromGlobal(location)
this._store = db.store
this._keys = db.keys
>>>>>>>
this.tree = createRBT()
<<<<<<<
this.tree = this.tree.remove(key).insert(key, value)
=======
var ix = sortedIndexOf(this._keys, key)
if (ix >= this._keys.length || this._keys[ix] != key) {
this._keys.splice(ix, 0, key)
}
key = toKey(key) // safety, to avoid key='__proto__'-type skullduggery
this._store[key] = value
>>>>>>>
this.tree = this.tree.remove(key).insert(key, value)
<<<<<<<
this.tree = this.tree.remove(key)
=======
var ix = sortedIndexOf(this._keys, key)
if (this._keys[ix] == key) {
this._keys.splice(ix, 1)
}
delete this._store[toKey(key)]
>>>>>>>
this.tree = this.tree.remove(key) |
<<<<<<<
const RightSidebar = connect(({ setting }) => ({ ...setting }))(Sidebar);
=======
/**
* 根据菜单取得重定向地址.
*/
const redirectData = [];
const getRedirect = item => {
if (item && item.children) {
if (item.children[0] && item.children[0].path) {
redirectData.push({
from: `${item.path}`,
to: `${item.children[0].path}`,
});
item.children.forEach(children => {
getRedirect(children);
});
}
}
};
getMenuData().forEach(getRedirect);
>>>>>>>
const RightSidebar = connect(({ setting }) => ({ ...setting }))(Sidebar);
<<<<<<<
=======
let isMobile;
enquireScreen(b => {
isMobile = b;
});
>>>>>>>
<<<<<<<
=======
};
state = {
isMobile,
>>>>>>>
<<<<<<<
=======
componentDidMount() {
enquireScreen(mobile => {
this.setState({
isMobile: mobile,
});
});
this.props.dispatch({
type: 'user/fetchCurrent',
});
}
>>>>>>>
<<<<<<<
};
changeSetting = setting => {
=======
};
handleNoticeClear = type => {
message.success(`清空了${type}`);
>>>>>>>
};
changeSetting = setting => {
<<<<<<<
};
=======
};
handleMenuClick = ({ key }) => {
if (key === 'triggerError') {
this.props.dispatch(routerRedux.push('/exception/trigger'));
return;
}
if (key === 'logout') {
this.props.dispatch({
type: 'login/logout',
});
}
};
handleNoticeVisibleChange = visible => {
if (visible) {
this.props.dispatch({
type: 'global/fetchNotices',
});
}
};
>>>>>>>
};
<<<<<<<
const { isMobile, redirectData, routerData, fixedHeader, match } = this.props;
const isTop = this.props.layout === 'topmenu';
=======
const {
currentUser,
collapsed,
fetchingNotices,
notices,
routerData,
match,
location,
} = this.props;
>>>>>>>
const { isMobile, redirectData, routerData, fixedHeader, match } = this.props;
const isTop = this.props.layout === 'topmenu';
<<<<<<<
{myRedirectData.map(item => (
<Redirect key={item.from} exact from={item.from} to={item.to} />
))}
{getRoutes(match.path, routerData).map(item => (
<AuthorizedRoute
key={item.key}
path={item.path}
component={item.component}
exact={item.exact}
authority={item.authority}
redirectPath="/exception/403"
/>
))}
=======
{redirectData.map(item => (
<Redirect key={item.from} exact from={item.from} to={item.to} />
))}
{getRoutes(match.path, routerData).map(item => (
<AuthorizedRoute
key={item.key}
path={item.path}
component={item.component}
exact={item.exact}
authority={item.authority}
redirectPath="/exception/403"
/>
))}
>>>>>>>
{myRedirectData.map(item => (
<Redirect key={item.from} exact from={item.from} to={item.to} />
))}
{getRoutes(match.path, routerData).map(item => (
<AuthorizedRoute
key={item.key}
path={item.path}
component={item.component}
exact={item.exact}
authority={item.authority}
redirectPath="/exception/403"
/>
))}
<<<<<<<
<Footer />
=======
<Footer style={{ padding: 0 }}>
<GlobalFooter
links={[
{
key: 'Pro 首页',
title: 'Pro 首页',
href: 'http://pro.ant.design',
blankTarget: true,
},
{
key: 'github',
title: <Icon type="github" />,
href: 'https://github.com/ant-design/ant-design-pro',
blankTarget: true,
},
{
key: 'Ant Design',
title: 'Ant Design',
href: 'http://ant.design',
blankTarget: true,
},
]}
copyright={
<Fragment>
Copyright <Icon type="copyright" /> 2018 蚂蚁金服体验技术部出品
</Fragment>
}
/>
</Footer>
>>>>>>>
<Footer /> |
<<<<<<<
import { fakeAccountLogin, getFakeCaptcha } from '../services/api';
=======
import { stringify } from 'qs';
import { fakeAccountLogin } from '../services/api';
>>>>>>>
import { stringify } from 'qs';
import { fakeAccountLogin, getFakeCaptcha } from '../services/api';
<<<<<<<
*getCaptcha({ payload }, { call }) {
yield call(getFakeCaptcha, payload);
},
=======
*logout(_, { put }) {
yield put({
type: 'changeLoginStatus',
payload: {
status: false,
currentAuthority: 'guest',
},
});
reloadAuthorized();
yield put(
routerRedux.push({
pathname: '/user/login',
search: stringify({
redirect: window.location.href,
}),
})
);
},
>>>>>>>
*getCaptcha({ payload }, { call }) {
yield call(getFakeCaptcha, payload);
},
*logout(_, { put }) {
yield put({
type: 'changeLoginStatus',
payload: {
status: false,
currentAuthority: 'guest',
},
});
reloadAuthorized();
yield put(
routerRedux.push({
pathname: '/user/login',
search: stringify({
redirect: window.location.href,
}),
})
);
}, |
<<<<<<<
=======
const { SubMenu } = Menu;
// Allow menu.js config icon as string or ReactNode
// icon: 'setting',
// icon: 'http://demo.com/icon.png',
// icon: <Icon type="setting" />,
const getIcon = (icon) => {
if (typeof icon === 'string' && icon.indexOf('http') === 0) {
return <img src={icon} alt="icon" className={`${styles.icon} sider-menu-item-img`} />;
}
if (typeof icon === 'string') {
return <Icon type={icon} />;
}
return icon;
};
export const getMeunMatcheys = (flatMenuKeys, path) => {
return flatMenuKeys.filter((item) => {
return pathToRegexp(item).test(path);
});
};
>>>>>>>
const { SubMenu } = Menu;
// Allow menu.js config icon as string or ReactNode
// icon: 'setting',
// icon: 'http://demo.com/icon.png',
// icon: <Icon type="setting" />,
const getIcon = (icon) => {
if (typeof icon === 'string' && icon.indexOf('http') === 0) {
return <img src={icon} alt="icon" className={`${styles.icon} sider-menu-item-img`} />;
}
if (typeof icon === 'string') {
return <Icon type={icon} />;
}
return icon;
};
<<<<<<<
* Convert pathname to openKeys
* /list/search/articles = > ['list','/list/search']
* @param props
=======
* 判断是否是http链接.返回 Link 或 a
* Judge whether it is http link.return a or Link
* @memberof SiderMenu
*/
getMenuItemPath = (item) => {
const itemPath = this.conversionPath(item.path);
const icon = getIcon(item.icon);
const { target, name } = item;
// Is it a http link
if (/^https?:\/\//.test(itemPath)) {
return (
<a href={itemPath} target={target}>
{icon}
<span>{name}</span>
</a>
);
}
return (
<Link
to={itemPath}
target={target}
replace={itemPath === this.props.location.pathname}
onClick={
this.props.isMobile
? () => {
this.props.onCollapse(true);
}
: undefined
}
>
{icon}
<span>{name}</span>
</Link>
);
};
/**
* get SubMenu or Item
*/
getSubMenuOrItem = (item) => {
if (item.children && item.children.some(child => child.name)) {
const childrenItems = this.getNavMenuItems(item.children);
// 当无子菜单时就不展示菜单
if (childrenItems && childrenItems.length > 0) {
return (
<SubMenu
title={
item.icon ? (
<span>
{getIcon(item.icon)}
<span>{item.name}</span>
</span>
) : (
item.name
)
}
key={item.path}
>
{childrenItems}
</SubMenu>
);
}
return null;
} else {
return (
<Menu.Item key={item.path}>{this.getMenuItemPath(item)}</Menu.Item>
);
}
};
/**
* 获得菜单子节点
* @memberof SiderMenu
>>>>>>>
* Convert pathname to openKeys
* /list/search/articles = > ['list','/list/search']
* @param props
* 判断是否是http链接.返回 Link 或 a
* Judge whether it is http link.return a or Link
* @memberof SiderMenu
*/
getMenuItemPath = (item) => {
const itemPath = this.conversionPath(item.path);
const icon = getIcon(item.icon);
const { target, name } = item;
// Is it a http link
if (/^https?:\/\//.test(itemPath)) {
return (
<a href={itemPath} target={target}>
{icon}
<span>{name}</span>
</a>
);
}
return (
<Link
to={itemPath}
target={target}
replace={itemPath === this.props.location.pathname}
onClick={
this.props.isMobile
? () => {
this.props.onCollapse(true);
}
: undefined
}
>
{icon}
<span>{name}</span>
</Link>
);
};
/**
* get SubMenu or Item
*/
getSubMenuOrItem = (item) => {
if (item.children && item.children.some(child => child.name)) {
const childrenItems = this.getNavMenuItems(item.children);
// 当无子菜单时就不展示菜单
if (childrenItems && childrenItems.length > 0) {
return (
<SubMenu
title={
item.icon ? (
<span>
{getIcon(item.icon)}
<span>{item.name}</span>
</span>
) : (
item.name
)
}
key={item.path}
>
{childrenItems}
</SubMenu>
);
}
return null;
} else {
return (
<Menu.Item key={item.path}>{this.getMenuItemPath(item)}</Menu.Item>
);
}
};
/**
* 获得菜单子节点
* @memberof SiderMenu |
<<<<<<<
import { Row, Col, Card, Form, Input, Select, Icon, Button, Dropdown, Menu,
InputNumber, DatePicker, Modal, message, Badge, Divider, Steps, Radio } from 'antd';
import StandardTable from '../../components/StandardTable';
=======
import { Row, Col, Card, Form, Input, Select, Icon, Button, Dropdown, Menu, InputNumber, DatePicker, Modal, message, Badge, Divider } from 'antd';
import StandardTable from 'components/StandardTable';
>>>>>>>
import { Row, Col, Card, Form, Input, Select, Icon, Button, Dropdown, Menu,
InputNumber, DatePicker, Modal, message, Badge, Divider, Steps, Radio } from 'antd';
import StandardTable from 'components/StandardTable'; |
<<<<<<<
=======
}
onSwitch = type => {
const { onTabChange } = this.props;
this.setState({
type,
});
onTabChange(type);
>>>>>>>
<<<<<<<
const { form, onSubmit } = this.props;
form.validateFields(activeFileds, { force: true }, (err, values) => {
onSubmit(err, values);
=======
form.validateFields(activeFileds, { force: true }, (err, values) => {
onSubmit(err, values);
>>>>>>>
form.validateFields(activeFileds, { force: true }, (err, values) => {
onSubmit(err, values); |
<<<<<<<
componentDidUpdate(preProps) {
if (this.props.data !== preProps.data) {
this.getLegendData();
=======
componentWillReceiveProps(nextProps) {
const { data } = this.props;
if (data !== nextProps.data) {
this.getLengendData();
>>>>>>>
componentDidUpdate(preProps) {
const { data } = this.props;
if (data !== preProps.data) {
this.getLegendData(); |
<<<<<<<
this.id = get(options, 'chrome.android.deviceSerial');
this.port = options.devToolsPort;
=======
this.id = get(options, 'chrome.android.deviceSerial', get(options, 'firefox.android.deviceSerial'));
>>>>>>>
this.id = get(options, 'chrome.android.deviceSerial', get(options, 'firefox.android.deviceSerial'));
this.port = options.devToolsPort; |
<<<<<<<
const { addConnectivity, removeConnectivity } = require('../../connectivity');
=======
const path = require('path');
const fs = require('fs');
const util = require('../../support/util.js');
>>>>>>>
const { addConnectivity, removeConnectivity } = require('../../connectivity');
const path = require('path');
const fs = require('fs');
const util = require('../../support/util.js');
<<<<<<<
// Before we needed Chrome to open once to get correct values for Chrome HAR
// but now Firefox first visual change is slower if we remove this ...
await browser.getDriver().get(startURL);
=======
// at the moment we need Chrome to open once to get correct values for Chrome HAR
// but let us fix that
/*
[2018-12-30 22:37:25] ERROR: RangeError: Invalid time value
at Date.toISOString (<anonymous>)
at h.d.toISOString (/Users/peter/git/browsertime/node_modules/chrome-har/node_modules/dayjs/dayjs.min.js:1:6434)
at module.exports (/Users/peter/git/browsertime/node_modules/chrome-har/lib/entryFromResponse.js:148:53)
at Object.harFromMessages (/Users/peter/git/browsertime/node_modules/chrome-har/index.js:307:15)
at ChromeDelegate.onCollect (/Users/peter/git/browsertime/lib/chrome/webdriver/chromeDelegate.js:135:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
*/
if (
!options.processStartTime &&
!(isAndroidConfigured(options) && options.browser == 'firefox')
) {
await browser.getDriver().get('data:text/html;charset=utf-8,');
}
>>>>>>>
// Before we needed Chrome to open once to get correct values for Chrome HAR
// but now Firefox first visual change is slower if we remove this ...
await browser.getDriver().get(startURL);
<<<<<<<
if (options.visualMetrics && !options.videoParams.debug) {
=======
if (processVideo && !options.videoParams.debug) {
>>>>>>>
if (options.visualMetrics && !options.videoParams.debug) { |
<<<<<<<
const { filterWhitelisted } = require('../../../support/userTiming');
const { isAndroidConfigured } = require('../../../android');
const delay = ms => new Promise(res => setTimeout(res, ms));
=======
const delay = ms => new Promise(res => setTimeout(res, ms));
const filterWhitelisted = require('../../../support/userTiming')
.filterWhitelisted;
const { isAndroidConfigured, createAndroidConnection } = require('../../../android');
>>>>>>>
const { filterWhitelisted } = require('../../../support/userTiming');
const { isAndroidConfigured, createAndroidConnection } = require('../../../android');
const delay = ms => new Promise(res => setTimeout(res, ms));
<<<<<<<
}
if (this.numberOfVisitedPages === 0) {
await this.engineDelegate.onStartIteration(this.browser, this.index);
=======
>>>>>>>
}
if (this.numberOfVisitedPages === 0) {
await this.engineDelegate.onStartIteration(this.browser, this.index);
<<<<<<<
=======
// when we have the URL we can use that to stop the video and put it where we want it
if (this.recordVideo && !this.options.videoParams.debug) {
await this.video.stop(url);
this.result[this.numberOfMeasuredPages].recordingStartTime = parseFloat(
this.video.getRecordingStartTime()
);
this.result[this.numberOfMeasuredPages].timeToFirstFrame = parseInt(
this.video.getTimeToFirstFrame(),
10
);
this.videos.push(this.video);
}
>>>>>>>
// when we have the URL we can use that to stop the video and put it where we want it
if (this.recordVideo && !this.options.videoParams.debug) {
await this.video.stop(url);
this.result[this.numberOfMeasuredPages].recordingStartTime = parseFloat(
this.video.getRecordingStartTime()
);
this.result[this.numberOfMeasuredPages].timeToFirstFrame = parseInt(
this.video.getTimeToFirstFrame(),
10
);
this.videos.push(this.video);
}
<<<<<<<
for (const postURLScript of this.postURLScripts) {
await postURLScript(this.context);
}
=======
if (isAndroidConfigured(this.options) && this.options.processStartTime) {
var packageName;
if (this.options.firefox && this.options.firefox.android && this.options.firefox.android.package) {
packageName = this.options.firefox.android.package;
} else {
packageName = this.options.chrome.android.package;
}
if (packageName) {
const android = createAndroidConnection(this.options);
await android.initConnection();
const pid = await android.pidof(packageName);
if (pid) {
const processStartTime = await android.processStartTime(pid);
this.result[this.numberOfMeasuredPages].browserScripts.browser.processStartTime = processStartTime;
}
}
}
>>>>>>>
if (isAndroidConfigured(this.options) && this.options.processStartTime) {
var packageName;
if (this.options.firefox && this.options.firefox.android && this.options.firefox.android.package) {
packageName = this.options.firefox.android.package;
} else {
packageName = this.options.chrome.android.package;
}
if (packageName) {
const android = createAndroidConnection(this.options);
await android.initConnection();
const pid = await android.pidof(packageName);
if (pid) {
const processStartTime = await android.processStartTime(pid);
this.result[this.numberOfMeasuredPages].browserScripts.browser.processStartTime = processStartTime;
}
}
}
for (const postURLScript of this.postURLScripts) {
await postURLScript(this.context);
} |
<<<<<<<
function getProtocol(setting, params) {
var protocol = setting;
if(setting == 'https-if-token') {
protocol = tokenExists(params) ? 'https' : 'http';
}
return protocol.replace(/:?$/, '://');
}
function tokenExists(params) {
return arrayAny(ACCESS_TOKEN_PARAMS, function(p) {
return params[p];
});
}
function allowMethodOverride(setting, method, jsonp) {
=======
function allowGetOverride(setting, method, jsonp) {
>>>>>>>
function getProtocol(setting, params) {
var protocol = setting;
if(setting == 'https-if-token') {
protocol = tokenExists(params) ? 'https' : 'http';
}
return protocol.replace(/:?$/, '://');
}
function tokenExists(params) {
return arrayAny(ACCESS_TOKEN_PARAMS, function(p) {
return params[p];
});
}
function allowGetOverride(setting, method, jsonp) {
<<<<<<<
protocol: 'https-if-token',
methodOverride: 'jsonp-except-get',
=======
protocol: window.location.protocol,
getOverride: 'jsonp-except-get',
>>>>>>>
protocol: 'https-if-token',
getOverride: 'jsonp-except-get', |
<<<<<<<
//#region Add support for using node_modules.asar
(function () {
const path = require('path');
const Module = require('module');
const NODE_MODULES_PATH = path.join(__dirname, '../node_modules');
const NODE_MODULES_ASAR_PATH = NODE_MODULES_PATH + '.asar';
const originalResolveLookupPaths = Module._resolveLookupPaths;
Module._resolveLookupPaths = function (request, parent) {
const result = originalResolveLookupPaths(request, parent);
const paths = result[1];
for (let i = 0, len = paths.length; i < len; i++) {
if (paths[i] === NODE_MODULES_PATH) {
paths.splice(i, 0, NODE_MODULES_ASAR_PATH);
break;
}
}
return result;
};
})();
//#endregion
var app = require('electron').app;
var fs = require('fs');
var path = require('path');
var minimist = require('minimist');
var paths = require('./paths');
=======
let app = require('electron').app;
let fs = require('fs');
let path = require('path');
let minimist = require('minimist');
let paths = require('./paths');
>>>>>>>
//#region Add support for using node_modules.asar
(function () {
const path = require('path');
const Module = require('module');
const NODE_MODULES_PATH = path.join(__dirname, '../node_modules');
const NODE_MODULES_ASAR_PATH = NODE_MODULES_PATH + '.asar';
const originalResolveLookupPaths = Module._resolveLookupPaths;
Module._resolveLookupPaths = function (request, parent) {
const result = originalResolveLookupPaths(request, parent);
const paths = result[1];
for (let i = 0, len = paths.length; i < len; i++) {
if (paths[i] === NODE_MODULES_PATH) {
paths.splice(i, 0, NODE_MODULES_ASAR_PATH);
break;
}
}
return result;
};
})();
//#endregion
let app = require('electron').app;
let fs = require('fs');
let path = require('path');
let minimist = require('minimist');
let paths = require('./paths'); |
<<<<<<<
const { big } = require('../zoom-settings');
const { eventID, on, off } = require('../../vue/mixins/event-id');
=======
const {
createNewlyLinkedPassages,
deletePassageInStory,
updatePassageInStory
} =
require('../../data/actions');
>>>>>>>
const {
createNewlyLinkedPassages,
deletePassageInStory,
updatePassageInStory
} =
require('../../data/actions');
<<<<<<<
this.createNewLinks(this.text, oldText);
});
},
followDrag(e) {
this.$dispatch(
'passage-drag',
e.clientX + window.scrollX - this.startDragX,
e.clientY + window.scrollY - this.startDragY
);
},
stopDrag(e) {
// Only listen to the left mouse button.
if (e.which !== 1) {
return;
}
// Remove event listeners set up at the start of the drag.
off(window, this.$eventID);
document.querySelector('body').classList.remove('draggingPassages');
// If we haven't actually been moved and the shift or control key
// were not held down, select just this passage only. This handles
// the scenario where the user clicks a single passage when several
// were selected. We don't want to immediately deselect them all,
// as the user may be starting a drag; but now that we know for
// sure that the user didn't intend this, we select just this one.
if (this.dragXOffset === 0 && this.dragYOffset === 0) {
if (!(e.ctrlKey || e.shiftKey)) {
this.$dispatch('passage-deselect-except', this);
}
}
else {
this.$dispatch(
'passage-drag-complete',
e.clientX + window.scrollX - this.startDragX,
e.clientY + window.scrollY - this.startDragY,
this
=======
this.createNewlyLinkedPassages(
this.parentStory.id,
this.passage.id,
oldText
>>>>>>>
this.createNewlyLinkedPassages(
this.parentStory.id,
this.passage.id,
oldText
<<<<<<<
this.startDragX = e.clientX + window.scrollX;
this.startDragY = e.clientY + window.scrollY;
on(window, `mousemove${this.$eventID}`, e => this.followDrag(e));
on(window, `mouseup${this.$eventID}`, e => this.stopDrag(e));
=======
this.screenDragStartX = e.clientX + window.scrollX;
this.screenDragStartY = e.clientY + window.scrollY;
window.addEventListener('mousemove', this.$onMouseMove);
window.addEventListener('mouseup', this.$onMouseUp);
>>>>>>>
this.screenDragStartX = e.clientX + window.scrollX;
this.screenDragStartY = e.clientY + window.scrollY;
on(window, `mousemove${this.$eventID}`, e => this.followDrag(e));
on(window, `mouseup${this.$eventID}`, e => this.stopDrag(e));
<<<<<<<
mixins: [backboneModel, backboneCollection, eventID]
=======
vuex: {
actions: {
createNewlyLinkedPassages,
updatePassageInStory,
deletePassageInStory
}
}
>>>>>>>
vuex: {
actions: {
createNewlyLinkedPassages,
updatePassageInStory,
deletePassageInStory
}
} |
<<<<<<<
setPref(
store,
'defaultFormat',
{ name: 'Harlowe', version: '3.0.1' }
);
=======
setPref(store, 'defaultFormat', {
name: 'Harlowe',
version: '3.0.0'
});
>>>>>>>
setPref(store, 'defaultFormat', {
name: 'Harlowe',
version: '3.0.1'
}); |
<<<<<<<
const { itemToLD } = require('../common/linked-data')
=======
const { win } = require('../window')
>>>>>>>
const { itemToLD } = require('../common/linked-data')
const { win } = require('../window') |
<<<<<<<
case 'copy':
this.handleItemCopy(this.props.selection)
break
case 'paste':
this.props.onItemPaste()
break
=======
case 'edit':
this.edit(this.current())
break
>>>>>>>
case 'copy':
this.handleItemCopy(this.props.selection)
break
case 'paste':
this.props.onItemPaste()
break
case 'edit':
this.edit(this.current())
break |
<<<<<<<
// Extract default SEO props from page props.
const {
defaultSeo: {social, ...defaultSeoData},
...passThruProps
} = pageProps
const componentProps = {
...passThruProps,
post: {
...passThruProps?.post,
seo: {
...passThruProps?.post?.seo,
social
}
}
}
=======
// Initialize state for Menu context provider.
const [navMenus] = useState({
menus: pageProps?.menus
})
>>>>>>>
// Extract default SEO props from page props.
const {
defaultSeo: {social, ...defaultSeoData},
...passThruProps
} = pageProps
const componentProps = {
...passThruProps,
post: {
...passThruProps?.post,
seo: {
...passThruProps?.post?.seo,
social
}
}
}
// Initialize state for Menu context provider.
const [navMenus] = useState({
menus: pageProps?.menus
})
<<<<<<<
{error ? (
<Error statusCode={500} title={errorMessage} />
) : (
<>
{!!defaultSeoData && <DefaultSeo {...defaultSeoData} />}
<Component {...componentProps} />
</>
)}
=======
<MenuProvider value={navMenus}>
{error ? (
<Error statusCode={500} title={errorMessage} />
) : (
<>
<DefaultSeo
title="Query from Yoast SEO"
description="Query from Yoast SEO"
noIndex={false} // query from yoast seo
noFollow={false} // query from yoast seo
openGraph={{
type: 'website',
locale: 'en_US',
url: 'Query from Yoast SEO',
site_name: '',
images: [
{
url: 'Query from Yoast SEO',
width: 'Query from Yoast SEO',
height: 'Query from Yoast SEO',
alt: 'Query from Yoast SEO'
}
]
}}
/>
<Component {...pageProps} />
</>
)}
</MenuProvider>
>>>>>>>
<MenuProvider value={navMenus}>
{error ? (
<Error statusCode={500} title={errorMessage} />
) : (
<>
{!!defaultSeoData && <DefaultSeo {...defaultSeoData} />}
<Component {...componentProps} />
</>
)}
</MenuProvider> |
<<<<<<<
'--image-url': `url(${backgroundImage.url})`,
'--image-tint-color': `#00000020`,
'--image-fallback-color': `#000`
=======
'--image-url': `url(${backgroundImage})`,
'--image-tint-color': `${tailwindConfig.theme.colors.black['DEFAULT']}50`,
'--image-fallback-color': `${tailwindConfig.theme.colors.grey['darkest']}`
>>>>>>>
'--image-url': `url(${backgroundImage})`,
'--image-tint-color': `#00000020`,
'--image-fallback-color': `#000` |
<<<<<<<
import defaultSeoFields from '../_partials/defaultSeoFields'
import commentsPostFields from '../_partials/commentsPostFields'
=======
import defaultPageData from '../_partials/defaultPageData'
>>>>>>>
import defaultPageData from '../_partials/defaultPageData'
import commentsPostFields from '../_partials/commentsPostFields' |
<<<<<<<
export {default as BlockCode} from './BlockCode'
export {default as BlockMediaText} from './BlockMediaText'
export {default as BlockButton} from './BlockButton'
export {default as BlockButtons} from './BlockButtons'
export {default as BlockColumns} from './BlockColumns'
export {default as BlockCover} from './BlockCover'
export {default as BlockEmbed} from './BlockEmbed'
=======
export {default as BlockVideoEmbed} from './BlockVideoEmbed'
>>>>>>>
export {default as BlockEmbed} from './BlockEmbed' |
<<<<<<<
case 'core/embed':
return <Blocks.BlockEmbed {...attributes} key={index} />
case 'core/media-text':
=======
// case 'core/embed':
// return <Blocks.BlockVideoEmbed {...attributes} key={index} />
case 'lazyblock/mediatext':
>>>>>>>
case 'core/embed':
return <Blocks.BlockEmbed {...attributes} key={index} />
case 'core/media-text':
case 'lazyblock/mediatext': |
<<<<<<<
import queryEventsArchive from '../events/queryEventsArchive'
=======
import queryCareersArchive from '../careers/queryCareersArchive'
>>>>>>>
import queryEventsArchive from '../events/queryEventsArchive'
import queryCareersArchive from '../careers/queryCareersArchive'
<<<<<<<
event: queryEventsArchive,
=======
career: queryCareersArchive,
>>>>>>>
career: queryCareersArchive,
event: queryEventsArchive, |
<<<<<<<
import queryEventById from '../events/queryEventById'
=======
import queryCareerById from '../careers/queryCareerById'
>>>>>>>
import queryEventById from '../events/queryEventById'
import queryCareerById from '../careers/queryCareerById'
<<<<<<<
event: queryEventById,
=======
career: queryCareerById,
>>>>>>>
career: queryCareerById,
event: queryEventById, |
<<<<<<<
name: 'tutorialIFrame',
=======
// Bugfix for firefox and IE
name: 'tutorialIFrame',
>>>>>>>
name: 'tutorialIFrame', // Bugfix for firefox and IE |
<<<<<<<
if (['terms','stats','range'].indexOf(sel.name.value) === -1) {
createAggregations(sel, parents.concat([sel.name.value]), fields)
=======
if (sel.name.value !== 'buckets') {
createAggregations(sel, parents.concat([sel.name.value]), fields, termsTranslation)
>>>>>>>
if (['terms','stats','range'].indexOf(sel.name.value) === -1) {
createAggregations(sel, parents.concat([sel.name.value]), fields, termsTranslation) |
<<<<<<<
const print = require('./../../../lib/expression/step-solver/print');
const NodeCreator = require('../../../lib/expression/step-solver/NodeCreator.js');
=======
const print = require('./../../../lib/expression/step-solver/prettyPrint');
>>>>>>>
const print = require('./../../../lib/expression/step-solver/print'); |
<<<<<<<
it('(-2/3)x + 3/7 = 1/2 -> x = -3/28', function() {
assert.equal(
testSolve('(-2/3)x + 3/7 = 1/2', '=').asciimath,
'x = -3/28');
});
it('-9/4v + 4/5 = 7/8 -> v = -1/30', function() {
assert.equal(
testSolve('-9/4v + 4/5 = 7/8 ', '=').asciimath,
'v = -1/30');
});
=======
it('y - x - 2 = 3*2 -> y = 8 + x', function () {
assert.equal(
testSolve('y - x - 2 = 3*2', '=').asciimath,
'y = 8 + x');
});
// TODO: update test once we fix simplifying fractions (should be y = x + 1)
it('2y - x - 2 = x -> y = (2x + 2)/2', function () {
assert.equal(
testSolve('2y - x - 2 = x', '=').asciimath,
'y = (2x + 2) / 2');
});
>>>>>>>
it('(-2/3)x + 3/7 = 1/2 -> x = -3/28', function() {
assert.equal(
testSolve('(-2/3)x + 3/7 = 1/2', '=').asciimath,
'x = -3/28');
});
it('-9/4v + 4/5 = 7/8 -> v = -1/30', function() {
assert.equal(
testSolve('-9/4v + 4/5 = 7/8 ', '=').asciimath,
'v = -1/30');
});
it('y - x - 2 = 3*2 -> y = 8 + x', function () {
assert.equal(
testSolve('y - x - 2 = 3*2', '=').asciimath,
'y = 8 + x');
});
// TODO: update test once we fix simplifying fractions (should be y = x + 1)
it('2y - x - 2 = x -> y = (2x + 2)/2', function () {
assert.equal(
testSolve('2y - x - 2 = x', '=').asciimath,
'y = (2x + 2) / 2');
}); |
<<<<<<<
const NodeType = require('./NodeType');
const print = require('./print');
=======
const prettyPrint = require('./prettyPrint');
>>>>>>>
const print = require('./print');
<<<<<<<
console.log('\n\nSimplifying: ' + print(node, false, true));
=======
// eslint-disable-next-line
console.log('\n\nSimplifying: ' + prettyPrint(node, false, true));
>>>>>>>
// eslint-disable-next-line
console.log('\n\nSimplifying: ' + print(node, false, true));
<<<<<<<
console.log('before change: ' + print(change) +
=======
// eslint-disable-next-line
console.log('before change: ' + prettyPrint(change) +
>>>>>>>
// eslint-disable-next-line
console.log('before change: ' + print(change) +
<<<<<<<
console.log('after change: ' + print(change) +
=======
// eslint-disable-next-line
console.log('after change: ' + prettyPrint(change) +
>>>>>>>
// eslint-disable-next-line
console.log('after change: ' + print(change) + |
<<<<<<<
console.log(print(flattened));
=======
// eslint-disable-next-line
console.log(flattened.toString());
>>>>>>>
// eslint-disable-next-line
console.log(print(flattened)); |
<<<<<<<
=======
if (Spine.isBlank(data) || _this.record.destroyed) {
data = false;
} else {
data = _this.model.fromJSON(data);
}
>>>>>>> |
<<<<<<<
function testSprintf()
{
assert.equals('abcdef', sprintf('a%sc%se%s', 'b','d', 'f'));
assert.equals('10 20 b 30.55', sprintf('%s %d %s %f', 10, 20.33, 'b', 30.55));
}
=======
function testNewURI() {
let spec = "http://example.org/";
let uri = newURI(spec);
assert.equals(uri.spec, spec);
uri = newURI("bar", null, "http://example.org/foo");
assert.equals(uri.spec, "http://example.org/bar");
}
>>>>>>>
function testSprintf()
{
assert.equals('abcdef', sprintf('a%sc%se%s', 'b','d', 'f'));
assert.equals('10 20 b 30.55', sprintf('%s %d %s %f', 10, 20.33, 'b', 30.55));
}
function testNewURI() {
let spec = "http://example.org/";
let uri = newURI(spec);
assert.equals(uri.spec, spec);
uri = newURI("bar", null, "http://example.org/foo");
assert.equals(uri.spec, "http://example.org/bar");
} |
<<<<<<<
pref("extensions.hatenabookmark.addPanel.tagMaxResult", 20);
// comment viewer
pref("extensions.hatenabookmark.commentviwer.allShow", true);
=======
pref("extensions.hatenabookmark.addPanel.tagMaxResult", 20);
pref("extensions.hatenabookmark.addPanel.initialTagCount", 30);
>>>>>>>
pref("extensions.hatenabookmark.addPanel.tagMaxResult", 20);
pref("extensions.hatenabookmark.addPanel.initialTagCount", 30);
// comment viewer
pref("extensions.hatenabookmark.commentviwer.allShow", true); |
<<<<<<<
//Kill client if they take too long to respond to the chunk transmission
// (max 1 minute)
var disconnect_interval = setTimeout(function() {
if(player.net_state === 'loading') {
player.client.kick();
}
}, 60*1000);
=======
>>>>>>> |
<<<<<<<
import clientReducer from './clientReducer';
=======
import cookieReducer from './cookieReducer';
import conversationReducer from './conversationReducer';
>>>>>>>
import clientReducer from './clientReducer';
import cookieReducer from './cookieReducer';
import conversationReducer from './conversationReducer';
<<<<<<<
clientState: clientReducer,
=======
conversationState: conversationReducer,
cookieState: cookieReducer,
>>>>>>>
clientState: clientReducer,
conversationState: conversationReducer,
cookieState: cookieReducer, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.