conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
=======
Faye.Timeouts = {
addTimeout: function(name, delay, callback, scope) {
this._timeouts = this._timeouts || {};
if (this._timeouts.hasOwnProperty(name)) return;
var self = this;
this._timeouts[name] = setTimeout(function() {
delete self._timeouts[name];
callback.call(scope);
}, 1000 * delay);
},
removeTimeout: function(name) {
this._timeouts = this._timeouts || {};
var timeout = this._timeouts[name];
if (!timeout) return;
clearTimeout(timeout);
delete this._timeouts[name];
}
};
Faye.Extensible = {
addExtension: function(extension) {
this._extensions = this._extensions || [];
this._extensions.push(extension);
},
removeExtension: function(extension) {
if (!this._extensions) return;
var i = this._extensions.length;
while (i--) {
if (this._extensions[i] === extension)
this._extensions.splice(i,1);
}
},
pipeThroughExtensions: function(stage, message, callback, scope) {
if (!this._extensions) return callback.call(scope, message);
var extensions = this._extensions.slice();
var pipe = function(message) {
if (!message) return callback.call(scope, message);
var extension = extensions.shift();
if (!extension) return callback.call(scope, message);
if (extension[stage]) extension[stage](message, pipe);
else pipe(message);
};
pipe(message);
}
};
>>>>>>>
Faye.Extensible = {
addExtension: function(extension) {
this._extensions = this._extensions || [];
this._extensions.push(extension);
},
removeExtension: function(extension) {
if (!this._extensions) return;
var i = this._extensions.length;
while (i--) {
if (this._extensions[i] === extension)
this._extensions.splice(i,1);
}
},
pipeThroughExtensions: function(stage, message, callback, scope) {
if (!this._extensions) return callback.call(scope, message);
var extensions = this._extensions.slice();
var pipe = function(message) {
if (!message) return callback.call(scope, message);
var extension = extensions.shift();
if (!extension) return callback.call(scope, message);
if (extension[stage]) extension[stage](message, pipe);
else pipe(message);
};
pipe(message);
}
};
<<<<<<<
this.info('Client ? calling listeners for ? with ?', this._clientId, message.channel, message.data);
this._channels.distributeMessage(message);
=======
this.pipeThroughExtensions('incoming', message, function(message) {
if (!message) return;
this.info('Client ? calling listeners for ? with ?', this._clientId, message.channel, message.data);
var channels = this._channels.glob(message.channel);
Faye.each(channels, function(callback) {
callback[0].call(callback[1], message.data);
});
}, this);
>>>>>>>
this.pipeThroughExtensions('incoming', message, function(message) {
if (!message) return;
this.info('Client ? calling listeners for ? with ?', this._clientId, message.channel, message.data);
this._channels.distributeMessage(message);
}, this);
<<<<<<<
var channelName = message.channel,
response;
message.__id = Faye.random();
Faye.each(this._channels.glob(channelName), function(channel) {
channel.push(message);
this.info('Publishing message ? from client ? to ?', message.data, message.clientId, channel.name);
}, this);
if (Faye.Channel.isMeta(channelName)) {
response = this[Faye.Channel.parse(channelName)[1]](message, local);
=======
this.pipeThroughExtensions('incoming', message, function(message) {
if (!message) return callback.call(scope, []);
var channel = message.channel,
response;
>>>>>>>
this.pipeThroughExtensions('incoming', message, function(message) {
if (!message) return callback.call(scope, []);
var channelName = message.channel, response; |
<<<<<<<
// `web` extension prefixes have been added for better support
// for React Native Web.
extensions: [
'.web.ts',
'.ts',
'.web.tsx',
'.tsx',
'.web.js',
'.js',
'.json',
'.web.jsx',
'.jsx',
],
=======
// `web` extension prefixes have been added for better support
// for React Native Web.
extensions: ['.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx'],
>>>>>>>
// `web` extension prefixes have been added for better support
// for React Native Web.
extensions: [
'.mjs',
'.web.ts',
'.ts',
'.web.tsx',
'.tsx',
'.web.js',
'.js',
'.json',
'.web.jsx',
'.jsx',
],
<<<<<<<
test: /\.js$/,
loader: require.resolve('source-map-loader'),
=======
test: /\.(js|jsx|mjs)$/,
>>>>>>>
test: /\.(js|jsx|mjs)$/,
loader: require.resolve('source-map-loader'),
<<<<<<<
include: paths.appSrc,
},
=======
use: [
{
options: {
formatter: eslintFormatter,
eslintPath: require.resolve('eslint'),
// @remove-on-eject-begin
baseConfig: {
extends: [require.resolve('eslint-config-react-app')],
},
ignore: false,
useEslintrc: false,
// @remove-on-eject-end
},
loader: require.resolve('eslint-loader'),
},
],
include: paths.appSrc,
},
>>>>>>>
include: paths.appSrc,
}, |
<<<<<<<
=======
var babelConfig = JSON.parse(fs.readFileSync(path.join(ownPath, 'babelrc'), 'utf8'));
var eslintConfig = JSON.parse(fs.readFileSync(path.join(ownPath, 'eslintrc'), 'utf8'));
>>>>>>>
<<<<<<<
appPackage.scripts[key] = appPackage.scripts[key]
.replace(/react-scripts-ts (\w+)/g, 'node scripts/$1.js');
console.log(
' Replacing ' +
cyan('"react-scripts-ts ' + key + '"') +
' with ' +
cyan('"node scripts/' + key + '.js"')
);
=======
Object.keys(ownPackage.bin).forEach(function (binKey) {
var regex = new RegExp(binKey + ' (\\w+)', 'g');
appPackage.scripts[key] = appPackage.scripts[key]
.replace(regex, 'node scripts/$1.js');
console.log(
' Replacing ' +
cyan('"' + binKey + ' ' + key + '"') +
' with ' +
cyan('"node scripts/' + key + '.js"')
);
});
>>>>>>>
Object.keys(ownPackage.bin).forEach(function (binKey) {
var regex = new RegExp(binKey + ' (\\w+)', 'g');
appPackage.scripts[key] = appPackage.scripts[key]
.replace(regex, 'node scripts/$1.js');
console.log(
' Replacing ' +
cyan('"' + binKey + ' ' + key + '"') +
' with ' +
cyan('"node scripts/' + key + '.js"')
);
});
<<<<<<<
=======
// Add Babel config
console.log(' Adding ' + cyan('Babel') + ' preset');
appPackage.babel = babelConfig;
// Add ESlint config
console.log(' Adding ' + cyan('ESLint') +' configuration');
appPackage.eslintConfig = eslintConfig;
>>>>>>> |
<<<<<<<
var recursive = require('recursive-readdir');
var stripAnsi = require('strip-ansi');
var { highlight } = require('cli-highlight');
=======
var FileSizeReporter = require('react-dev-utils/FileSizeReporter');
var measureFileSizesBeforeBuild = FileSizeReporter.measureFileSizesBeforeBuild;
var printFileSizesAfterBuild = FileSizeReporter.printFileSizesAfterBuild;
>>>>>>>
var FileSizeReporter = require('react-dev-utils/FileSizeReporter');
var measureFileSizesBeforeBuild = FileSizeReporter.measureFileSizesBeforeBuild;
var printFileSizesAfterBuild = FileSizeReporter.printFileSizesAfterBuild;
var recursive = require('recursive-readdir');
var stripAnsi = require('strip-ansi');
var { highlight } = require('cli-highlight');
<<<<<<<
function padLeft(n, nr, str = ' '){
return Array(n-String(nr).length+1).join(str)+nr;
}
// Input: /User/dan/app/build/static/js/main.82be8.js
// Output: /static/js/main.js
function removeFileNameHash(fileName) {
return fileName
.replace(paths.appBuild, '')
.replace(/\/?(.*)(\.\w+)(\.js|\.css)/, (match, p1, p2, p3) => p1 + p3);
}
// Input: 1024, 2048
// Output: "(+1 KB)"
function getDifferenceLabel(currentSize, previousSize) {
var FIFTY_KILOBYTES = 1024 * 50;
var difference = currentSize - previousSize;
var fileSize = !Number.isNaN(difference) ? filesize(difference) : 0;
if (difference >= FIFTY_KILOBYTES) {
return chalk.red('+' + fileSize);
} else if (difference < FIFTY_KILOBYTES && difference > 0) {
return chalk.yellow('+' + fileSize);
} else if (difference < 0) {
return chalk.green(fileSize);
} else {
return '';
}
}
=======
>>>>>>>
function padLeft(n, nr, str = ' '){
return Array(n-String(nr).length+1).join(str)+nr;
} |
<<<<<<<
// Insert direct channel
if (options && options.direct) {
name = _.sortBy(options.allowedUsers, function(s) {return s;}).join("+");
if (!Channels.findOne({teamId: teamId, name: name})) {
return Channels.insert({name: name, teamId: teamId, direct: true, allowedUsers: options.allowedUsers});
} else {
return Channels.update({name: name}, {$set: {name: name, teamId: teamId, direct: true, allowedUsers: options.allowedUsers}});
}
}
=======
// Get rid of extra spaces in names, lower-case it
// (like Slack does), and trim it
channelName = channelName.replace(/\s{2,}/g, ' ').toLowerCase().trim();
>>>>>>>
// Insert direct channel
if (options && options.direct) {
name = _.sortBy(options.allowedUsers, function(s) {return s;}).join("+");
if (!Channels.findOne({teamId: teamId, name: name})) {
return Channels.insert({name: name, teamId: teamId, direct: true, allowedUsers: options.allowedUsers});
} else {
return Channels.update({name: name}, {$set: {name: name, teamId: teamId, direct: true, allowedUsers: options.allowedUsers}});
}
}
// Get rid of extra spaces in names, lower-case it
// (like Slack does), and trim it
channelName = channelName.replace(/\s{2,}/g, ' ').toLowerCase().trim(); |
<<<<<<<
var autoprefixer = require('autoprefixer');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
var InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
var WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
var getClientEnvironment = require('./env');
var paths = require('./paths');
=======
const autoprefixer = require('autoprefixer');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
const eslintFormatter = require('react-dev-utils/eslintFormatter');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
const getClientEnvironment = require('./env');
const paths = require('./paths');
>>>>>>>
const autoprefixer = require('autoprefixer');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
const getClientEnvironment = require('./env');
const paths = require('./paths');
<<<<<<<
extensions: ['.ts', '.tsx', '.js', '.json', '.jsx', ''],
=======
extensions: ['.js', '.json', '.jsx'],
>>>>>>>
extensions: ['.ts', '.tsx', '.js', '.json', '.jsx'],
<<<<<<<
test: /\.(ts|tsx)$/,
loader: 'tslint',
=======
test: /\.(js|jsx)$/,
enforce: 'pre',
use: [
{
options: {
formatter: eslintFormatter,
// @remove-on-eject-begin
baseConfig: {
extends: [require.resolve('eslint-config-react-app')],
},
ignore: false,
useEslintrc: false,
// @remove-on-eject-end
},
loader: require.resolve('eslint-loader'),
},
],
>>>>>>>
test: /\.(ts|tsx)$/,
loader: require.resolve('tslint-loader'),
enforce: 'pre',
<<<<<<<
loader: 'ts',
=======
loader: require.resolve('babel-loader'),
options: {
// @remove-on-eject-begin
babelrc: false,
presets: [require.resolve('babel-preset-react-app')],
// @remove-on-eject-end
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
// directory for faster rebuilds.
cacheDirectory: true,
},
>>>>>>>
loader: require.resolve('ts-loader'),
<<<<<<<
// Remember to add the new extension(s) to the "url" loader exclusion list.
]
},
// We use PostCSS for autoprefixing only.
postcss: function() {
return [
autoprefixer({
browsers: [
'>1%',
'last 4 versions',
'Firefox ESR',
'not ie < 9', // React doesn't support IE8 anyway
]
}),
];
=======
// Remember to add the new extension(s) to the "file" loader exclusion list.
],
>>>>>>>
// Remember to add the new extension(s) to the "url" loader exclusion list.
], |
<<<<<<<
image.contain.bind(image, 100, 100, function() {}).should.throwError();
});
});
describe('image.contain lock', function() {
it('should lock image', function() {
image.contain.bind(image, 100, 200, function() {}).should.not.throwError();
=======
image.cover.bind(image, 100, 100, function() {}).should.throwError();
});
});
describe('image.cover lock', function() {
it('should lock image', function() {
image.cover.bind(image, 200, 300, function() {}).should.not.throwError();
>>>>>>>
image.contain.bind(image, 100, 100, function() {}).should.throwError();
});
});
describe('image.contain lock', function() {
it('should lock image', function() {
image.contain.bind(image, 100, 200, function() {}).should.not.throwError();
image.cover.bind(image, 100, 100, function() {}).should.throwError();
});
});
describe('image.cover lock', function() {
it('should lock image', function() {
image.cover.bind(image, 200, 300, function() {}).should.not.throwError(); |
<<<<<<<
contain: decree(defs.args.contain),
=======
cover: decree(defs.args.cover),
>>>>>>>
contain: decree(defs.args.contain),
cover: decree(defs.args.cover),
<<<<<<<
Image.prototype.contain = function() {
var that = this;
judges.contain(
arguments,
function(width, height, color, inter, callback) {
var s = Math.min(width / that.width(), height / that.height());
that.scale(s, s, inter, function(err){
if (err) return callback(err);
var padX = (width - that.width()) / 2,
padY = (height - that.height()) / 2;
that.pad(
Math.ceil(padX),
Math.ceil(padY),
Math.floor(padX),
Math.floor(padY),
color,
callback
);
});
}
);
};
=======
Image.prototype.cover = function() {
var that = this;
judges.cover(
arguments,
function(width, height, inter, callback) {
var s = Math.max(width / that.width(), height / that.height());
that.scale(s, s, inter, function(err){
if (err) return callback(err);
that.crop(width, height, callback);
});
}
);
};
>>>>>>>
Image.prototype.contain = function() {
var that = this;
judges.contain(
arguments,
function(width, height, color, inter, callback) {
var s = Math.min(width / that.width(), height / that.height());
that.scale(s, s, inter, function(err){
if (err) return callback(err);
var padX = (width - that.width()) / 2,
padY = (height - that.height()) / 2;
that.pad(
Math.ceil(padX),
Math.ceil(padY),
Math.floor(padX),
Math.floor(padY),
color,
callback
);
});
}
);
};
Image.prototype.cover = function() {
var that = this;
judges.cover(
arguments,
function(width, height, inter, callback) {
var s = Math.max(width / that.width(), height / that.height());
that.scale(s, s, inter, function(err){
if (err) return callback(err);
that.crop(width, height, callback);
});
}
);
}; |
<<<<<<<
componentWillMount() {
// ignore the warning of Failed propType for date of DatePickerIOS, will remove after being fixed by official
if (!console.ignoredYellowBox) {
console.ignoredYellowBox = [];
}
console.ignoredYellowBox.push('Warning: Failed propType');
}
componentDidMount() {
if (this.props.locale) {
Moment.locale(this.props.locale);
}
}
=======
>>>>>>>
componentDidMount() {
if (this.props.locale) {
Moment.locale(this.props.locale);
}
} |
<<<<<<<
<div className="text-center">
{windowsBuild ?
<span
data-tip
data-for="windowsDisabled"
>
Add a username
</span>
:
<Link
to={`/profiles/i/add-username/${identityIndex}/search`}
className="btn btn-link btn-link-mute btn-xs"
>
Add a username
</Link>
}
</div>
=======
<Link
to={`/profiles/i/add-username/${identityIndex}/search`}
className="btn btn-outline-dark btn-pill btn-xs m-t-15 m-b-15"
>
Add a username
</Link>
>>>>>>>
<div className="text-center">
{windowsBuild ?
<span
data-tip
data-for="windowsDisabled"
>
Add a username
</span>
:
<Link
to={`/profiles/i/add-username/${identityIndex}/search`}
className="btn btn-outline-dark btn-pill btn-xs m-t-15 m-b-15"
>
Add a username
</Link>
}
</div> |
<<<<<<<
import bip39, { validateMnemonic } from 'bip39'
import crypto from 'crypto'
import triplesec from 'triplesec'
function normalizeMnemonic(mnemonic) {
return bip39.mnemonicToEntropy(mnemonic).toString('hex')
}
function denormalizeMnemonic(normalizedMnemonic) {
return bip39.entropyToMnemonic(normalizedMnemonic)
}
function encryptMnemonic(plaintextBuffer, password) {
return Promise.resolve().then(() => {
// must be bip39 mnemonic
if (!bip39.validateMnemonic(plaintextBuffer.toString())) {
throw new Error('Not a valid bip39 nmemonic')
}
// normalize plaintext to fixed length byte string
const plaintextNormalized = Buffer.from(
normalizeMnemonic(plaintextBuffer.toString()), 'hex')
// AES-128-CBC with SHA256 HMAC
const salt = crypto.randomBytes(16)
const keysAndIV = crypto.pbkdf2Sync(password, salt, 100000, 48, 'sha512')
const encKey = keysAndIV.slice(0, 16)
const macKey = keysAndIV.slice(16, 32)
const iv = keysAndIV.slice(32, 48)
const cipher = crypto.createCipheriv('aes-128-cbc', encKey, iv)
let cipherText = cipher.update(plaintextNormalized, '', 'hex')
cipherText += cipher.final('hex')
const hmacPayload = Buffer.concat([salt, Buffer.from(cipherText, 'hex')])
const hmac = crypto.createHmac('sha256', macKey)
hmac.write(hmacPayload)
const hmacDigest = hmac.digest()
const payload = Buffer.concat([salt, hmacDigest, Buffer.from(cipherText, 'hex')])
return payload
})
}
function decryptMnemonic(dataBuffer, password) {
return Promise.resolve().then(() => {
const salt = dataBuffer.slice(0, 16)
const hmacSig = dataBuffer.slice(16, 48) // 32 bytes
const cipherText = dataBuffer.slice(48)
const hmacPayload = Buffer.concat([salt, cipherText])
const keysAndIV = crypto.pbkdf2Sync(password, salt, 100000, 48, 'sha512')
const encKey = keysAndIV.slice(0, 16)
const macKey = keysAndIV.slice(16, 32)
const iv = keysAndIV.slice(32, 48)
const decipher = crypto.createDecipheriv('aes-128-cbc', encKey, iv)
let plaintext = decipher.update(cipherText, '', 'hex')
plaintext += decipher.final('hex')
const hmac = crypto.createHmac('sha256', macKey)
hmac.write(hmacPayload)
const hmacDigest = hmac.digest()
// hash both hmacSig and hmacDigest so string comparison time
// is uncorrelated to the ciphertext
const hmacSigHash = crypto.createHash('sha256')
.update(hmacSig)
.digest()
.toString('hex')
const hmacDigestHash = crypto.createHash('sha256')
.update(hmacDigest)
.digest()
.toString('hex')
if (hmacSigHash !== hmacDigestHash) {
// not authentic
throw new Error('Wrong password (HMAC mismatch)')
}
const mnemonic = denormalizeMnemonic(plaintext)
if (!bip39.validateMnemonic(mnemonic)) {
throw new Error('Wrong password (invalid plaintext)')
}
return mnemonic
})
}
=======
import makeEncryptWorker from './workers/encrypt.worker.js'
import makeDecryptWorker from './workers/decrypt.worker.js'
>>>>>>>
import { validateMnemonic } from 'bip39'
import makeEncryptWorker from './workers/encrypt.worker.js'
import makeDecryptWorker from './workers/decrypt.worker.js'
<<<<<<<
return decryptMnemonic(dataBuffer, password)
.catch(() => // try the old way
new Promise((resolve, reject) => {
triplesec.decrypt(
{
key: new Buffer(password),
data: dataBuffer
},
(err, plaintextBuffer) => {
if (!err) {
resolve(plaintextBuffer)
} else {
reject(err)
}
}
)
})
)
}
export const RECOVERY_TYPE = {
MNEMONIC: 'mnemonic',
ENCRYPTED: 'encrypted'
}
/**
* Checks if a recovery option is valid, and attempts to clean it up.
* @param {string} input - User input of recovery method
* @returns {{ isValid: boolean, cleaned: (string|undefined), type: (string|undefined) }}
*/
export function validateAndCleanRecoveryInput(input) {
const cleaned = input.trim()
// Raw mnemonic phrase
const cleanedMnemonic = cleaned.toLowerCase().split(/\s|-|_|\./).join(' ')
if (validateMnemonic(cleanedMnemonic)) {
return {
isValid: true,
type: RECOVERY_TYPE.MNEMONIC,
cleaned: cleanedMnemonic
}
}
// Base64 encoded encrypted phrase
const cleanedEncrypted = cleaned.replace(/\s/gm, '')
if (/^[a-zA-Z0-9\/]+=$/.test(cleanedEncrypted)) {
return {
isValid: true,
type: RECOVERY_TYPE.ENCRYPTED,
cleaned: cleanedEncrypted
}
}
return { isValid: false }
}
=======
const encryptedMnemonic = dataBuffer.toString('hex')
const decryptWorker = makeDecryptWorker()
return decryptWorker.decrypt(encryptedMnemonic, password)
.then(mnemonic => Buffer.from(mnemonic))
}
>>>>>>>
const encryptedMnemonic = dataBuffer.toString('hex')
const decryptWorker = makeDecryptWorker()
return decryptWorker.decrypt(encryptedMnemonic, password)
.then(mnemonic => Buffer.from(mnemonic))
}
export const RECOVERY_TYPE = {
MNEMONIC: 'mnemonic',
ENCRYPTED: 'encrypted'
}
/**
* Checks if a recovery option is valid, and attempts to clean it up.
* @param {string} input - User input of recovery method
* @returns {{ isValid: boolean, cleaned: (string|undefined), type: (string|undefined) }}
*/
export function validateAndCleanRecoveryInput(input) {
const cleaned = input.trim()
// Raw mnemonic phrase
const cleanedMnemonic = cleaned.toLowerCase().split(/\s|-|_|\./).join(' ')
if (validateMnemonic(cleanedMnemonic)) {
return {
isValid: true,
type: RECOVERY_TYPE.MNEMONIC,
cleaned: cleanedMnemonic
}
}
// Base64 encoded encrypted phrase
const cleanedEncrypted = cleaned.replace(/\s/gm, '')
if (/^[a-zA-Z0-9\/]+=$/.test(cleanedEncrypted)) {
return {
isValid: true,
type: RECOVERY_TYPE.ENCRYPTED,
cleaned: cleanedEncrypted
}
}
return { isValid: false }
} |
<<<<<<<
var $name = $(event.target).find('[name=name]')
var name = $name.val();
=======
var currentForm = this.$('.left-sidebar-channels-add-form');
var inputField = $(event.target).find('[name=name]');
var name = inputField.val();
>>>>>>>
var currentForm = this.$('.left-sidebar-channels-add-form');
var inputField = $(event.target).find('[name=name]');
var name = inputField.val();
<<<<<<<
// Channel created, hide the form and reset the input
this.$('.left-sidebar-channels-add-form').addClass('hidden');
$name.val('');
// Navigate to the new channel view
var newChannel = Channels.findOne(result);
FlowRouter.go('channel', {
team: currentTeamSlug(),
channel: newChannel.slug
});
=======
// Channel created, clear the input and hide the form
inputField.val('');
currentForm.addClass('hidden');
>>>>>>>
// Navigate to the new channel view
var newChannel = Channels.findOne(result);
FlowRouter.go('channel', {
team: currentTeamSlug(),
channel: newChannel.slug
});
// Channel created, clear the input and hide the form
inputField.val('');
currentForm.addClass('hidden'); |
<<<<<<<
import { AccountActions } from '../account/store/account'
function mapStateToProps(state) {
return {
dropboxAccessToken: state.settings.api.dropboxAccessToken,
localIdentities: state.profiles.identity.localIdentities,
addressBalanceUrl: state.settings.api.addressBalanceUrl,
coreWalletAddress: state.account.coreWallet.address,
coreWalletBalance: state.account.coreWallet.balance,
coreAPIPassword: state.settings.api.coreAPIPassword
}
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(Object.assign({}, AccountActions), dispatch)
}
=======
import Completion from './Completion'
import ActionItem from './ActionItem'
import { Popover, OverlayTrigger } from 'react-bootstrap'
const popover = (
<Popover>
<ActionItem
action="Connect a storage provider to regain control of your data"
destinationUrl="/storage/providers"
destinationName="Storage"
completed={false}
/>
<ActionItem
action="Create your first profile independent of 3rd parties"
destinationUrl="/profiles"
destinationName="Profiles"
completed={false}
/>
<ActionItem
action="Sign in to your first Blockstack app"
destinationUrl="https://helloblockstack.com"
destinationName="Apps"
completed={false}
/>
<ActionItem
action="Write down your backup code for keychain recovery"
destinationUrl="/account/backup"
destinationName="Backup"
completed={false}
/>
<ActionItem
action="Deposit Bitcoin to enable username registration"
destinationUrl="/wallet/receive"
destinationName="Wallet"
completed={false}
/>
<ActionItem
action="Register a username for your profile"
destinationUrl="/wallet/receive"
destinationName="Wallet"
completed={false}
/>
</Popover>
)
>>>>>>>
import { AccountActions } from '../account/store/account'
import Completion from './Completion'
import ActionItem from './ActionItem'
import { Popover, OverlayTrigger } from 'react-bootstrap'
function mapStateToProps(state) {
return {
dropboxAccessToken: state.settings.api.dropboxAccessToken,
localIdentities: state.profiles.identity.localIdentities,
addressBalanceUrl: state.settings.api.addressBalanceUrl,
coreWalletAddress: state.account.coreWallet.address,
coreWalletBalance: state.account.coreWallet.balance,
coreAPIPassword: state.settings.api.coreAPIPassword
}
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(Object.assign({}, AccountActions), dispatch)
}
const popover = (
<Popover>
<ActionItem
action="Connect a storage provider to regain control of your data"
destinationUrl="/storage/providers"
destinationName="Storage"
completed={false}
/>
<ActionItem
action="Create your first profile independent of 3rd parties"
destinationUrl="/profiles"
destinationName="Profiles"
completed={false}
/>
<ActionItem
action="Sign in to your first Blockstack app"
destinationUrl="https://helloblockstack.com"
destinationName="Apps"
completed={false}
/>
<ActionItem
action="Write down your backup code for keychain recovery"
destinationUrl="/account/backup"
destinationName="Backup"
completed={false}
/>
<ActionItem
action="Deposit Bitcoin to enable username registration"
destinationUrl="/wallet/receive"
destinationName="Wallet"
completed={false}
/>
<ActionItem
action="Register a username for your profile"
destinationUrl="/wallet/receive"
destinationName="Wallet"
completed={false}
/>
</Popover>
) |
<<<<<<<
=======
type Props = {
coreAPIPassword: string,
routeParams: Object,
bar?: string,
identityAddresses: Array<string>,
identityKeypairs: Object,
localIdentities: Object,
nameTransfers: Array<mixed>,
broadcastNameTransfer: Function,
nameTransferUrl: string
}
type State = {
agreed: boolean,
alerts: Array<{ status: string, message: string }>,
clickedBroadcast: boolean,
disabled: boolean,
newOwner: string
}
>>>>>>>
<<<<<<<
class TransferNamePage extends Component {
=======
class TransferNamePage extends Component<Props, State> {
static propTypes = {
coreAPIPassword: PropTypes.string,
routeParams: PropTypes.object.isRequired,
identityAddresses: PropTypes.array.isRequired,
identityKeypairs: PropTypes.array,
localIdentities: PropTypes.array.isRequired,
nameTransfers: PropTypes.array.isRequired,
broadcastNameTransfer: PropTypes.func,
nameTransferUrl: PropTypes.string
}
>>>>>>>
class TransferNamePage extends Component {
static propTypes = {
coreAPIPassword: PropTypes.string,
routeParams: PropTypes.object.isRequired,
identityAddresses: PropTypes.array.isRequired,
identityKeypairs: PropTypes.array,
localIdentities: PropTypes.array.isRequired,
nameTransfers: PropTypes.array.isRequired,
broadcastNameTransfer: PropTypes.func,
nameTransferUrl: PropTypes.string
} |
<<<<<<<
makeAuthResponse, getAuthRequestFromURL, Person, redirectUserToApp,
getAppIndexFileUrl
=======
makeAuthResponse, getAuthRequestFromURL, Person, redirectUserToApp,
isLaterVersion
>>>>>>>
makeAuthResponse, getAuthRequestFromURL, Person, redirectUserToApp,
getAppIndexFileUrl, isLaterVersion
<<<<<<<
import { validateScopes } from '../utils'
import ToolTip from '../../components/ToolTip'
=======
import { validateScopes, appRequestSupportsDirectHub } from '../utils'
>>>>>>>
import { validateScopes, appRequestSupportsDirectHub } from '../utils'
import ToolTip from '../../components/ToolTip'
<<<<<<<
completeAuthResponse = (privateKey, blockchainId, coreSessionToken,
appPrivateKey, profile, profileUrl) => {
const appDomain = this.state.decodedToken.payload.domain_name
const email = this.props.email
const sendEmail = this.state.sendEmail
=======
// TODO: what if the token is expired?
>>>>>>>
completeAuthResponse = (privateKey, blockchainId, coreSessionToken,
appPrivateKey, profile, profileUrl) => {
const appDomain = this.state.decodedToken.payload.domain_name
const email = this.props.email
const sendEmail = this.state.sendEmail |
<<<<<<<
import { isArray } from '@common'
import { ArrowLeftIcon, ChevronDoubleRightIcon } from 'mdi-react'
=======
import ArrowLeftIcon from 'mdi-react/ArrowLeftIcon'
import ChevronDoubleRightIcon from 'mdi-react/ChevronDoubleRightIcon'
>>>>>>>
import { isArray } from '@common'
import ArrowLeftIcon from 'mdi-react/ArrowLeftIcon'
import ChevronDoubleRightIcon from 'mdi-react/ChevronDoubleRightIcon' |
<<<<<<<
import { isWindowsBuild } from '../../utils/window-utils'
=======
import { getTokenFileUrlFromZoneFile } from '../../utils/zone-utils'
>>>>>>>
import { isWindowsBuild } from '../../utils/window-utils'
import { getTokenFileUrlFromZoneFile } from '../../utils/zone-utils'
<<<<<<<
windowsBuild: isWindowsBuild(),
invalidScopes: false
=======
invalidScopes: false,
sendEmail: false,
blockchainId: null,
noStorage: false,
responseSent: false,
requestingEmail: false
>>>>>>>
windowsBuild: isWindowsBuild(),
invalidScopes: false,
sendEmail: false,
blockchainId: null,
noStorage: false,
responseSent: false,
requestingEmail: false
<<<<<<<
if (isWindowsBuild()) {
return (
<div className="">
<Modal
isOpen
onRequestClose={this.closeModal}
contentLabel="This is My Modal"
shouldCloseOnOverlayClick
style={{ overlay: { zIndex: 10 } }}
className="container-fluid"
portalClassName="auth-modal"
>
<h3>Sign In Request</h3>
<div>
<p>
Authenticating with applications is not supported yet in our Windows build.
Feature coming soon!
</p>
</div>
</Modal>
</div>
)
}
=======
const requestingEmail = this.state.requestingEmail
>>>>>>>
if (isWindowsBuild()) {
return (
<div className="">
<Modal
isOpen
onRequestClose={this.closeModal}
contentLabel="This is My Modal"
shouldCloseOnOverlayClick
style={{ overlay: { zIndex: 10 } }}
className="container-fluid"
portalClassName="auth-modal"
>
<h3>Sign In Request</h3>
<div>
<p>
Authenticating with applications is not supported yet in our Windows build.
Feature coming soon!
</p>
</div>
</Modal>
</div>
)
}
const requestingEmail = this.state.requestingEmail |
<<<<<<<
events: function () {
return [
{
'click .channel-accordion-section-header': function (event) {
event.preventDefault();
$(event.target).parent('.channel-accordion-section').toggleClass('open');
}
}
];
}
=======
creatorUsername : function() {
return currentChannel().createdBy ? Meteor.users.findOne(currentChannel().createdBy).username : '';
},
dateCreated: function () {
return moment(currentChannel().timestamp).format('MMMM Do YYYY');
}
>>>>>>>
events: function () {
return [
{
'click .channel-accordion-section-header': function (event) {
event.preventDefault();
$(event.target).parent('.channel-accordion-section').toggleClass('open');
}
}
];
},
creatorUsername : function() {
return currentChannel().createdBy ? Meteor.users.findOne(currentChannel().createdBy).username : '';
},
dateCreated: function () {
return moment(currentChannel().timestamp).format('MMMM Do YYYY');
} |
<<<<<<<
=======
const BLOCKSTACK_HANDLER = "blockstack"
>>>>>>>
<<<<<<<
console.log(privateKey)
console.log(profile)
const authResponse = makeAuthResponse(privateKey, profile)
redirectUserToApp(this.state.authRequest, authResponse)
=======
const authResponseToken = makeAuthResponse(privateKey, profile, userDomainName)
window.location = this.state.appURI + '?authResponse=' + authResponseToken
>>>>>>>
const authResponse = makeAuthResponse(privateKey, profile)
redirectUserToApp(this.state.authRequest, authResponse) |
<<<<<<<
function noUsernameOwned(index: number) {
return {
type: types.NO_USERNAME_OWNED,
index
}
}
function updateProfile(index: number, profile: any, verifications: Array<any>, zoneFile: string) {
=======
function updateProfile(domainName, profile, verifications, trustLevel, zoneFile) {
>>>>>>>
function noUsernameOwned(index: number) {
return {
type: types.NO_USERNAME_OWNED,
index
}
}
function updateProfile(index: number, profile: any, verifications: Array<any>, trustLevel: number, zoneFile: string) {
<<<<<<<
function updateSocialProofVerifications(index: number, verifications: Array<any>) {
=======
function updateSocialProofVerifications(domainName, verifications, trustLevel) {
>>>>>>>
function updateSocialProofVerifications(index: number, verifications: Array<any>, trustLevel: number) {
<<<<<<<
index,
verifications
=======
domainName,
verifications,
trustLevel,
>>>>>>>
index,
verifications,
trustLevel
<<<<<<<
.then((lookupResponseJson) => {
const zoneFile = lookupResponseJson.zonefile
const ownerAddress = lookupResponseJson.address
logger.debug(`refreshIdentities: resolving zonefile of ${nameOwned} to profile`)
return resolveZoneFileToProfile(zoneFile, ownerAddress).then((profile) => {
if (profile) {
dispatch(updateProfile(index, profile, [], zoneFile))
let verifications = []
return validateProofs(profile, ownerAddress, nameOwned).then((proofs) => {
verifications = proofs
dispatch(updateProfile(index, profile, verifications, zoneFile))
})
.catch((error) => {
logger.error(`refreshIdentities: ${nameOwned} validateProofs: error`, error)
return Promise.resolve()
=======
.then((responseJson) => {
i++
newNamesOwned = newNamesOwned.concat(responseJson.names)
logger.debug(`i: ${i} addresses.length: ${addresses.length}`)
if (i >= addresses.length) {
const updatedLocalIdentities = calculateLocalIdentities(localIdentities,
newNamesOwned)
if (JSON.stringify(newNamesOwned) === JSON.stringify(namesOwned)) {
// pass
logger.trace('Names owned have not changed')
resolve()
} else {
logger.trace('Names owned changed. Dispatching updateOwnedIdentities')
dispatch(updateOwnedIdentities(updatedLocalIdentities, newNamesOwned))
logger.debug(`Preparing to resolve profiles for ${namesOwned.length} names`)
let j = 0
newNamesOwned.forEach((domainName) => {
const identity = updatedLocalIdentities[domainName]
const lookupUrl = api.nameLookupUrl.replace('{name}', identity.domainName)
logger.debug(`j: ${j} fetching: ${lookupUrl}`)
fetch(lookupUrl).then((response) => response.text())
.then((responseText) => JSON.parse(responseText))
.then((lookupResponseJson) => {
const zoneFile = lookupResponseJson.zonefile
const ownerAddress = lookupResponseJson.address
if (updatedLocalIdentities[ownerAddress]) {
logger.debug(`j: ${j} attempting to add username to ${ownerAddress}`)
dispatch(addUsername(domainName, ownerAddress, zoneFile))
}
logger.debug(`j: ${j} resolving zonefile to profile`)
resolveZoneFileToProfile(zoneFile, ownerAddress).then((profile) => {
j++
if (profile) {
dispatch(updateProfile(domainName, profile, [], 0, zoneFile))
let verifications = []
let trustLevel = 0
validateProofs(profile, ownerAddress, domainName).then((proofs) => {
verifications = proofs
trustLevel = calculateTrustLevel(verifications)
dispatch(updateProfile(domainName, profile, verifications, trustLevel, zoneFile))
}).catch((error) => {
logger.error(`fetchCurrentIdentity: ${domainName} validateProofs: error`, error)
})
}
logger.debug(`j: ${j} namesOwned.length: ${namesOwned.length}`)
if (j >= namesOwned.length) {
resolve()
}
})
.catch((error) => {
j++
logger.error(`j: ${j} refreshIdentities: resolveZoneFileToProfile: error`, error)
if (j >= namesOwned.length) {
resolve()
}
})
})
.catch((error) => {
j++
logger.error(`j: ${j} refreshIdentities: lookupUrl: error`, error)
if (j >= namesOwned.length) {
resolve()
}
})
>>>>>>>
.then((lookupResponseJson) => {
const zoneFile = lookupResponseJson.zonefile
const ownerAddress = lookupResponseJson.address
logger.debug(`refreshIdentities: resolving zonefile of ${nameOwned} to profile`)
return resolveZoneFileToProfile(zoneFile, ownerAddress).then((profile) => {
if (profile) {
dispatch(updateProfile(index, profile, [], 0, zoneFile))
let verifications = []
let trustLevel = 0
return validateProofs(profile, ownerAddress, nameOwned).then((proofs) => {
verifications = proofs
trustLevel = calculateTrustLevel(verifications)
dispatch(updateProfile(index, profile, verifications, trustLevel, zoneFile))
})
.catch((error) => {
logger.error(`refreshIdentities: ${nameOwned} validateProofs: error`, error)
return Promise.resolve()
<<<<<<<
function refreshSocialProofVerifications(identityIndex: number,
ownerAddress: string, username: string, profile: {}) {
return (dispatch: Dispatch<*>): Promise<*> => new Promise((resolve) => {
let verifications = []
validateProofs(profile, ownerAddress, username).then((proofs) => {
verifications = proofs
dispatch(updateSocialProofVerifications(identityIndex, verifications))
resolve()
}).catch((error) => {
logger.error(`refreshSocialProofVerifications: index ${identityIndex} proofs error`, error)
dispatch(updateSocialProofVerifications(identityIndex, []))
resolve()
=======
function refreshSocialProofVerifications(profile, ownerAddress, domainName) {
return dispatch => {
return new Promise((resolve, reject) => {
let verifications = []
let trustLevel = 0
// let fqdn = null
// if (ownerAddress !== domainName) {
// fqdn = domainName
// }
validateProofs(profile, ownerAddress, domainName).then((proofs) => {
verifications = proofs
trustLevel = calculateTrustLevel(verifications)
dispatch(updateSocialProofVerifications(domainName, verifications, trustLevel))
resolve()
}).catch((error) => {
logger.error(`fetchCurrentIdentity: ${domainName} validateProofs: error`, error)
dispatch(updateSocialProofVerifications(domainName, [], trustLevel))
resolve()
})
>>>>>>>
function refreshSocialProofVerifications(identityIndex: number,
ownerAddress: string, username: string, profile: {}) {
return (dispatch: Dispatch<*>): Promise<*> => new Promise((resolve) => {
let verifications = []
let trustLevel = 0
validateProofs(profile, ownerAddress, username).then((proofs) => {
verifications = proofs
trustLevel = calculateTrustLevel(verifications)
dispatch(updateSocialProofVerifications(identityIndex, verifications, trustLevel))
resolve()
}).catch((error) => {
logger.error(`refreshSocialProofVerifications: index ${identityIndex} proofs error`, error)
dispatch(updateSocialProofVerifications(identityIndex, [], trustLevel))
resolve() |
<<<<<<<
it('should replace "+" with space', function () {
var q = getQuery("http://example.com/?q=hello+world&a=123++456&b=false&c=null");
expect( q ).toBe( '?q=hello world&a=123 456&b=false&c=null' );
});
=======
it('should extract query string from url with hash', function () {
var q = getQuery("http://example.com/#/with-hash/?foo=bar&a=123&b=false&c=null");
expect( q ).toBe( '?foo=bar&a=123&b=false&c=null' );
});
it('should extract first group of the query string when has multiple queries', function () {
var q = getQuery("http://example.com/?foo=bar&a=123#/hash?b=false&c=null");
expect( q ).toBe( '?foo=bar&a=123' );
});
>>>>>>>
it('should replace "+" with space', function () {
var q = getQuery("http://example.com/?q=hello+world&a=123++456&b=false&c=null");
expect( q ).toBe( '?q=hello world&a=123 456&b=false&c=null' );
});
it('should extract query string from url with hash', function () {
var q = getQuery("http://example.com/#/with-hash/?foo=bar&a=123&b=false&c=null");
expect( q ).toBe( '?foo=bar&a=123&b=false&c=null' );
});
it('should extract first group of the query string when has multiple queries', function () {
var q = getQuery("http://example.com/?foo=bar&a=123#/hash?b=false&c=null");
expect( q ).toBe( '?foo=bar&a=123' );
}); |
<<<<<<<
this.set('_deletedHostComponentResult', null);
=======
this.set('_deletedHostComponentError', null);
this.removeHostComponentModel(data.componentName, data.hostName);
>>>>>>>
this.set('_deletedHostComponentError', null); |
<<<<<<<
pack: function(data, utf8){
var packer = new Packer(utf8);
var buffer = packer.pack(data);
=======
pack: function(data){
var packer = new Packer();
packer.pack(data);
var buffer = packer.getBuffer();
>>>>>>>
pack: function(data, utf8){
var packer = new Packer(utf8);
packer.pack(data);
var buffer = packer.getBuffer();
<<<<<<<
function Packer(utf8){
this.utf8 = utf8;
=======
function Packer (){
>>>>>>>
function Packer(utf8){
this.utf8 = utf8; |
<<<<<<<
// no match:
// if same zoom: destroy
// else if lower zoom: quad up: re-check
// else if higher zoom: quad down: re-check
//console.log("purging '%s %s'", this.source, key);
=======
>>>>>>>
// no match:
// if same zoom: destroy
// else if lower zoom: quad up: re-check
// else if higher zoom: quad down: re-check
//console.log("purging '%s %s'", this.source, key); |
<<<<<<<
import Icon from 'core-components/icon';
=======
import DropDown from 'core-components/drop-down';
import Checkbox from 'core-components/checkbox';
>>>>>>>
import Icon from 'core-components/icon';
import Checkbox from 'core-components/checkbox'; |
<<<<<<<
OSMBuildings.VERSION = '2.2.1';
OSMBuildings.ATTRIBUTION = '<a href="https://osmbuildings.org">© OSM Buildings</a>';
=======
OSMBuildings.VERSION = '{{VERSION}}';
OSMBuildings.ATTRIBUTION = '© OSM Buildings <a href="http://osmbuildings.org">http://osmbuildings.org</a>';
>>>>>>>
OSMBuildings.VERSION = '{{VERSION}}';
OSMBuildings.ATTRIBUTION = '<a href="https://osmbuildings.org">© OSM Buildings</a>'; |
<<<<<<<
'PRIVATE': 'ιδιωτικός',
=======
'ENABLE_USER': 'Ενεργοποίηση χρήστη',
'DISABLE_USER': 'Απενεργοποίηση χρήστη',
>>>>>>>
'PRIVATE': 'ιδιωτικός',
'ENABLE_USER': 'Ενεργοποίηση χρήστη',
'DISABLE_USER': 'Απενεργοποίηση χρήστη', |
<<<<<<<
roofHeight = properties.roofHeight || 3,
colors = {
wall: properties.wallColor || properties.color || getMaterialColor(properties.material),
roof: properties.roofColor || properties.color || getMaterialColor(properties.roofMaterial)
},
=======
roofHeight = properties.roofHeight || 3,
wallColor = properties.wallColor || properties.color || getMaterialColor(properties.material),
roofColor = properties.roofColor || properties.color || getMaterialColor(properties.roofMaterial),
hasContinuousWindows = (properties.material === "glass"),
>>>>>>>
roofHeight = properties.roofHeight || 3,
colors = {
wall: properties.wallColor || properties.color || getMaterialColor(properties.material),
roof: properties.roofColor || properties.color || getMaterialColor(properties.roofMaterial)
},
<<<<<<<
// add ID to item properties to allow user-defined colorizers to color
// buildings based in their OSM ID
properties.id = properties.id | id;
//let user-defined colorizer overwrite the colors
if (this.colorizer) {
this.colorizer(properties, colors);
}
var wallColor = colors.wall;
var roofColor = colors.roof;
=======
>>>>>>>
// add ID to item properties to allow user-defined colorizers to color
// buildings based in their OSM ID
properties.id = properties.id | id;
//let user-defined colorizer overwrite the colors
if (this.colorizer) {
this.colorizer(properties, colors);
}
var wallColor = colors.wall;
var roofColor = colors.roof; |
<<<<<<<
case 'cone':
Triangulate.cylinder(tris, center, radius, 0, item.minHeight, item.height);
break;
=======
case 'dome':
Triangulate.dome(tris, center, radius, item.minHeight, item.height);
break;
case 'sphere':
Triangulate.cylinder(tris, center, radius, radius/2, item.minHeight, item.height);
//Triangulate.circle(tris, center, radius/2, item.height, item.roofColor);
break;
>>>>>>>
case 'cone':
Triangulate.cylinder(tris, center, radius, 0, item.minHeight, item.height);
break;
case 'dome':
Triangulate.dome(tris, center, radius, item.minHeight, item.height);
break;
<<<<<<<
default:
Triangulate.extrusion(tris, polygon, item.minHeight, item.height);
}
=======
res.push({
id: id,
color: item.wallColor,
vertices: tris.vertices,
normals: tris.normals
});
tris = { vertices:[], normals:[] };
switch (item.roofShape) {
case 'cone':
Triangulate.cylinder(tris, center, radius, 0, item.height, item.height+item.roofHeight);
break;
case 'dome':
Triangulate.dome(tris, center, radius, item.height, item.height+item.roofHeight);
break;
case 'pyramid':
Triangulate.pyramid(tris, polygon, center, item.height, item.height+item.roofHeight);
break;
default:
if (item.shape === 'cylinder') {
Triangulate.circle(tris, center, radius, item.height);
} else if (item.shape === undefined) {
Triangulate.polygon(tris, polygon, item.height);
}
}
>>>>>>>
default:
Triangulate.extrusion(tris, polygon, item.minHeight, item.height);
} |
<<<<<<<
/**
* Basemap
* @Basemap
* @param {HTMLElement} DOM container
* @param {Object} options
*/
=======
/**
* OSMBuildings basemap
* @constructor
* @param {String} container - The id of the html element to display the map in
* @param {Object} options
* @param {Integer} [options.minZoom=10] - Minimum allowed zoom
* @param {Integer} [options.maxZoom=20] - Maxiumum allowed zoom
* @param {Object} [options.bounds] - A bounding box to restrict the map to
* @param {Boolean} [options.state=false] - Store the map state in the URL
* @param {Boolean} [options.disabled=false] - Disable user input
* @param {String} [options.attribution] - An attribution string
* @param {Float} [options.zoom=minZoom] - Initial zoom
* @param {Float} [options.rotation=0] - Initial rotation
* @param {Float} [options.tilt=0] - Initial tilt
* @param {Object} [options.position] - Initial position
* @param {Float} [options.position.latitude=52.520000]
* @param {Float} [options.position.latitude=13.410000]
*/
>>>>>>>
/**
* Basemap
* @Basemap
* @param {HTMLElement} DOM container
* @param {Object} options
*/
/**
* OSMBuildings basemap
* @constructor
* @param {String} container - The id of the html element to display the map in
* @param {Object} options
* @param {Integer} [options.minZoom=10] - Minimum allowed zoom
* @param {Integer} [options.maxZoom=20] - Maxiumum allowed zoom
* @param {Object} [options.bounds] - A bounding box to restrict the map to
* @param {Boolean} [options.state=false] - Store the map state in the URL
* @param {Boolean} [options.disabled=false] - Disable user input
* @param {String} [options.attribution] - An attribution string
* @param {Float} [options.zoom=minZoom] - Initial zoom
* @param {Float} [options.rotation=0] - Initial rotation
* @param {Float} [options.tilt=0] - Initial tilt
* @param {Object} [options.position] - Initial position
* @param {Float} [options.position.latitude=52.520000]
* @param {Float} [options.position.latitude=13.410000]
*/
<<<<<<<
/* returns the geographical bounds of the current view.
* notes:
* - since the bounds are always axis-aligned they will contain areas that are
=======
/**
* Returns the geographical bounds of the current view.
* Notes:
* - Since the bounds are always axis-aligned they will contain areas that are
>>>>>>>
/* returns the geographical bounds of the current view.
* notes:
* - since the bounds are always axis-aligned they will contain areas that are
/**
* Returns the geographical bounds of the current view.
* Notes:
* - Since the bounds are always axis-aligned they will contain areas that are
<<<<<<<
* - the bounds only consider ground level. For example, buildings whose top
* is seen at the lower edge of the screen, but whose footprint is outside
=======
* - The bounds only consider ground level. For example, buildings whose top
* is seen at the lower edge of the screen, but whose footprint is outside
>>>>>>>
* - the bounds only consider ground level. For example, buildings whose top
* is seen at the lower edge of the screen, but whose footprint is outside
* - The bounds only consider ground level. For example, buildings whose top
* is seen at the lower edge of the screen, but whose footprint is outside |
<<<<<<<
var vRight = [ Math.cos(angle), Math.sin(angle)];
var vForward=[ Math.cos(angle - Math.PI/2), Math.sin(angle - Math.PI/2)]
var dir = add2( mul2scalar(vRight, dx),
=======
var vRight = [ Math.cos(angle), Math.sin(angle)];
var vForward = [ Math.cos(angle - Math.PI/2), Math.sin(angle - Math.PI/2)]
var dir = add2( mul2scalar(vRight, dx),
>>>>>>>
var vRight = [ Math.cos(angle), Math.sin(angle)];
var vForward = [ Math.cos(angle - Math.PI/2), Math.sin(angle - Math.PI/2)]
var dir = add2( mul2scalar(vRight, dx),
<<<<<<<
var new_position = {
longitude: this.map.position.longitude - dir[0] * scale*lonScale,
latitude: this.map.position.latitude + dir[1] * scale };
this.map.setPosition(new_position);
/**
* Fired basemap is moved
* @event Basemap#move
*/
this.map.emit('move', new_position);
=======
var newPosition = {
longitude: this.map.position.longitude - dir[0] * scale*lonScale,
latitude: this.map.position.latitude + dir[1] * scale };
this.map.setPosition(newPosition);
this.map.emit('move', newPosition);
>>>>>>>
var newPosition = {
longitude: this.map.position.longitude - dir[0] * scale*lonScale,
latitude: this.map.position.latitude + dir[1] * scale };
/**
* Fired basemap is moved
* @event Basemap#move
*/
this.map.setPosition(newPosition);
this.map.emit('move', newPosition); |
<<<<<<<
'TICKET_ACTIVITY': 'Ticket Activity',
=======
'VERIFY_SUCCESS': 'User verified',
'VERIFY_FAILED': 'Could not verify',
>>>>>>>
'VERIFY_SUCCESS': 'User verified',
'VERIFY_FAILED': 'Could not verify',
'TICKET_ACTIVITY': 'Ticket Activity', |
<<<<<<<
const resolveStorageMap = _.memoize((state, schemaPaths) => createSchemasMap(state, schemaPaths));
const defaultOptions = {
schema: '',
};
=======
>>>>>>>
const defaultOptions = {
schema: '',
}; |
<<<<<<<
'SUPPORT_CENTER_URL': 'Support Center URL',
'SUPPORT_CENTER_TITLE': 'Support Center Title',
'SUPPORT_CENTER_LAYOUT': 'Support Center Layout',
'DEFAULT_TIMEZONE': 'Default Timezone',
'NOREPLY_EMAIL': 'Noreply Email',
'SMTP_USER': 'SMTP User',
'SMTP_SERVER': 'SMTP Server',
'SMTP_PASSWORD': 'SMTP Password',
'PORT': 'Port',
'RECAPTCHA_PUBLIC_KEY': 'Recaptcha Public Key',
'RECAPTCHA_PRIVATE_KEY': 'Recaptcha Private Key',
'ALLOW_FILE_ATTACHMENTS': 'Allow file attachments',
'MAX_SIZE_KB': 'Max Size (KB)',
'UPDATE_SETTINGS': 'Update settings',
'DEFAULT_LANGUAGE': 'Default Language',
'SUPPORTED_LANGUAGES': 'Supported Languages',
'ALLOWED_LANGUAGES': 'Allowed Languages',
'SETTINGS_UPDATED': 'Settings have been updated',
'ON': 'On',
'OFF': 'Off',
'BOXED': 'Boxed',
'FULL_WIDTH': 'Full width',
=======
'RECOVER_DEFAULT': 'Recover default',
>>>>>>>
'RECOVER_DEFAULT': 'Recover default',
'SUPPORT_CENTER_URL': 'Support Center URL',
'SUPPORT_CENTER_TITLE': 'Support Center Title',
'SUPPORT_CENTER_LAYOUT': 'Support Center Layout',
'DEFAULT_TIMEZONE': 'Default Timezone',
'NOREPLY_EMAIL': 'Noreply Email',
'SMTP_USER': 'SMTP User',
'SMTP_SERVER': 'SMTP Server',
'SMTP_PASSWORD': 'SMTP Password',
'PORT': 'Port',
'RECAPTCHA_PUBLIC_KEY': 'Recaptcha Public Key',
'RECAPTCHA_PRIVATE_KEY': 'Recaptcha Private Key',
'ALLOW_FILE_ATTACHMENTS': 'Allow file attachments',
'MAX_SIZE_KB': 'Max Size (KB)',
'UPDATE_SETTINGS': 'Update settings',
'DEFAULT_LANGUAGE': 'Default Language',
'SUPPORTED_LANGUAGES': 'Supported Languages',
'ALLOWED_LANGUAGES': 'Allowed Languages',
'SETTINGS_UPDATED': 'Settings have been updated',
'ON': 'On',
'OFF': 'Off',
'BOXED': 'Boxed',
'FULL_WIDTH': 'Full width', |
<<<<<<<
'featurecode': false,
'directory': false
=======
'cdr': false,
'featurecode': false
>>>>>>>
'featurecode': false,
'cdr': false,
'directory': false |
<<<<<<<
'IMAGE_HEADER_URL': 'छवि शीर्षलेख यूआरएल',
=======
'SHOW_CLOSED_TICKETS': 'बंद टिकट दिखाएं',
>>>>>>>
'SHOW_CLOSED_TICKETS': 'बंद टिकट दिखाएं',
'IMAGE_HEADER_URL': 'छवि शीर्षलेख यूआरएल', |
<<<<<<<
event.preventDefault();
// event.stopImmediatePropagation();
// this.close(emojis[0]);
this.enterEmoji(emojis[this.selectionIndex]);
this.selectionIndex = 0;
// this.enterEmoji(emojis[0]);
//this.close(null);
=======
this.enterEmoji(emojis[0]);
>>>>>>>
this.enterEmoji(emojis[0]);
<<<<<<<
console.log('close',value);
=======
>>>>>>> |
<<<<<<<
}
$scope.pagingExample = {
exData:null,
limit:0,
currentPage:0,
total:0,
pages:[]
};
var ctrl = this,
initialLoaded=false;
$scope.loadData = function(n){
//don't load if n==0 or n>pages
if($scope.pagingExample.pages.length){
if(n==0 || n > $scope.pagingExample.pages.length) return;
};
//load data
$http.get('data/data-page'+ n +'.json').then(function(response){
$scope.pagingExample.exData = response.data.data;
$scope.pagingExample.limit = response.data.limit;
$scope.pagingExample.currentPage = response.data.page;
$scope.pagingExample.total = response.data.total;
//calculate pages just once - after first loading
if(!initialLoaded){
ctrl.getTotalPages();
initialLoaded = true;
};
});
};
// load first page
$scope.loadData($scope.pagingExample.currentPage+1);
// calculate totals and return page range ([1,2,3])
this.getTotalPages = function(){
var count = Math.round($scope.pagingExample.total / $scope.pagingExample.limit);
for (var i = 0; i < count; i++) {
$scope.pagingExample.pages.push(i);
};
};
=======
};
$scope.getTotalBalance = function(data){
if(!data || !data.length) return;
var totalNumber = 0;
for(var i=0; i<data.length; i++){
totalNumber = totalNumber + parseFloat(data[i].money);
}
return Math.round(totalNumber);
};
>>>>>>>
}
$scope.pagingExample = {
exData:null,
limit:0,
currentPage:0,
total:0,
pages:[]
};
var ctrl = this,
initialLoaded=false;
$scope.loadData = function(n){
//don't load if n==0 or n>pages
if($scope.pagingExample.pages.length){
if(n==0 || n > $scope.pagingExample.pages.length) return;
};
//load data
$http.get('data/data-page'+ n +'.json').then(function(response){
$scope.pagingExample.exData = response.data.data;
$scope.pagingExample.limit = response.data.limit;
$scope.pagingExample.currentPage = response.data.page;
$scope.pagingExample.total = response.data.total;
//calculate pages just once - after first loading
if(!initialLoaded){
ctrl.getTotalPages();
initialLoaded = true;
};
});
};
// load first page
$scope.loadData($scope.pagingExample.currentPage+1);
// calculate totals and return page range ([1,2,3])
this.getTotalPages = function(){
var count = Math.round($scope.pagingExample.total / $scope.pagingExample.limit);
for (var i = 0; i < count; i++) {
$scope.pagingExample.pages.push(i);
};
};
$scope.getTotalBalance = function(data){
if(!data || !data.length) return;
var totalNumber = 0;
for(var i=0; i<data.length; i++){
totalNumber = totalNumber + parseFloat(data[i].money);
}
return Math.round(totalNumber);
}; |
<<<<<<<
'CHECK_TICKET': 'Check Ticket',
=======
'STATISTICS': 'Statistics',
'ACTIVITY': 'Activity',
'CHART_CREATE_TICKET': 'Tickets created',
'CHART_CLOSE': 'Tickets closed',
'CHART_SIGNUP': 'Signups',
'CHART_COMMENT': 'Replies',
'CHART_ASSIGN': 'Assigned',
>>>>>>>
'CHECK_TICKET': 'Check Ticket',
'STATISTICS': 'Statistics',
'ACTIVITY': 'Activity',
'CHART_CREATE_TICKET': 'Tickets created',
'CHART_CLOSE': 'Tickets closed',
'CHART_SIGNUP': 'Signups',
'CHART_COMMENT': 'Replies',
'CHART_ASSIGN': 'Assigned', |
<<<<<<<
function last(arr) {
return arr.length > 0 ? arr[arr.length - 1] : undefined
}
export function flatMap<T, S>(arr: T[], iteratee: (arg: T) => S[] | S): S[] {
=======
function flatMap(arr, iteratee) {
>>>>>>>
function last(arr) {
return arr.length > 0 ? arr[arr.length - 1] : undefined
}
function flatMap(arr, iteratee) { |
<<<<<<<
export const styled = (tag, cls, vars = [], content) => props =>
React.createElement(
=======
export const styled = (tag, [cls, vars = [], content]) => props => {
const className = magic(
cls,
vars.map(v => (v && typeof v === 'function' ? v(props) : v)),
content
)
return React.createElement(
>>>>>>>
export const styled = (tag, cls, vars = [], content) => props => {
const className = magic(
cls,
vars.map(v => (v && typeof v === 'function' ? v(props) : v)),
content
)
return React.createElement( |
<<<<<<<
localfile: require('../../fields/types/localfile/localfile'),
=======
textarray: require('../../fields/types/textarray/textarray'),
numberarray: require('../../fields/types/textarray/textarray'),
code: require('../../fields/types/code/code'),
number: require('../../fields/types/number/number'),
>>>>>>>
localfile: require('../../fields/types/localfile/localfile'),
textarray: require('../../fields/types/textarray/textarray'),
numberarray: require('../../fields/types/textarray/textarray'),
code: require('../../fields/types/code/code'),
number: require('../../fields/types/number/number'), |
<<<<<<<
'IMAGE_HEADER_URL': 'Image header URL',
=======
'SHOW_CLOSED_TICKETS': 'Toon gesloten tickets',
>>>>>>>
'SHOW_CLOSED_TICKETS': 'Toon gesloten tickets',
'IMAGE_HEADER_URL': 'Image header URL', |
<<<<<<<
var React = require('react');
var Pikaday = require('pikaday');
var moment = require('moment');
var FormInput = require('elemental').FormInput;
=======
var moment = require('moment');
var Pikaday = require('pikaday');
var React = require('react');
>>>>>>>
var moment = require('moment');
var Pikaday = require('pikaday');
var React = require('react');
var Pikaday = require('pikaday');
var moment = require('moment');
var FormInput = require('elemental').FormInput; |
<<<<<<<
const { field, filter } = this.props;
return <SegmentedControl equalWidthSegments options={EXISTS_OPTIONS} value={filter.exists} onChange={this.toggleExists} />;
=======
const { filter } = this.props;
return <SegmentedControl equalWidthSegments options={TOGGLE_OPTIONS} value={filter.exists} onChange={this.toggleExists} />;
>>>>>>>
const { filter } = this.props;
return <SegmentedControl equalWidthSegments options={EXISTS_OPTIONS} value={filter.exists} onChange={this.toggleExists} />; |
<<<<<<<
var React = require('react');
var Field = require('../Field');
var DateInput = require('../../components/DateInput');
var moment = require('moment');
var Button = require('elemental').Button;
var FormField = require('elemental').FormField;
var FormInput = require('elemental').FormInput;
var FormNote = require('elemental').FormNote;
var FormRow = require('elemental').FormRow;
var InputGroup = require('elemental').InputGroup;
=======
var React = require('react');
var Field = require('../Field');
var Note = require('../../components/Note');
var DateInput = require('../../components/DateInput');
var moment = require('moment');
>>>>>>>
var React = require('react');
var Field = require('../Field');
var Note = require('../../components/Note');
var DateInput = require('../../components/DateInput');
var moment = require('moment');
var Button = require('elemental').Button;
var FormField = require('elemental').FormField;
var FormInput = require('elemental').FormInput;
var FormNote = require('elemental').FormNote;
var FormRow = require('elemental').FormRow;
var InputGroup = require('elemental').InputGroup;
<<<<<<<
var input;
=======
var input;
var fieldClassName = 'field-ui';
>>>>>>>
var input;
var fieldClassName = 'field-ui'; |
<<<<<<<
this.attachAll();
=======
if (this.get('history')) {
schemaPlugins.history.apply(this);
}
>>>>>>>
if (this.get('history')) {
schemaPlugins.history.apply(this);
}
this.attachAll(); |
<<<<<<<
'MAINTENANCE_MODE': 'Maintenance mode',
=======
'COMMENTS': 'Comments',
'DELETE_STAFF_MEMBER': 'Delete staff member',
>>>>>>>
'COMMENTS': 'Comments',
'DELETE_STAFF_MEMBER': 'Delete staff member',
'MAINTENANCE_MODE': 'Maintenance mode', |
<<<<<<<
<Portal className="Popout-wrapper">
<Transition className="Popout-animation" transitionEnterTimeout={200} transitionLeaveTimeout={200} transitionName="Popout" component="div">
=======
<Portal className="Popout-wrapper" ref="portal">
<Transition className="Popout-animation" transitionName="Popout" component="div">
>>>>>>>
<Portal className="Popout-wrapper" ref="portal">
<Transition className="Popout-animation" transitionEnterTimeout={200} transitionLeaveTimeout={200} transitionName="Popout" component="div"> |
<<<<<<<
=======
statics: {
type: 'Name',
},
>>>>>>>
statics: {
type: 'Name',
}, |
<<<<<<<
const customLists = this.getCustomlists();
return this.getItemsByFilteredByLevel([
=======
return this.getItemsByFilteredByLevel(_.without([
>>>>>>>
const customLists = this.getCustomlists();
return this.getItemsByFilteredByLevel(_.without([ |
<<<<<<<
var DateList = require('./lists/date');
=======
var ColorList = require('./lists/color');
>>>>>>>
var ColorList = require('./lists/color');
var DateList = require('./lists/date');
<<<<<<<
dateList: new DateList(),
=======
colorList: new ColorList(),
>>>>>>>
colorList: new ColorList(),
dateList: new DateList(), |
<<<<<<<
import Table from 'core-components/table';
import Button from 'core-components/button';
import Tooltip from 'core-components/tooltip';
import TicketInfo from 'app-components/ticket-info';
=======
import TicketList from 'app-components/ticket-list';
>>>>>>>
import TicketList from 'app-components/ticket-list';
import TicketInfo from 'app-components/ticket-info';
<<<<<<<
getTableHeaders() {
return [
{
key: 'number',
value: 'Number',
className: 'dashboard-ticket-list__number col-md-1'
},
{
key: 'title',
value: 'Title',
className: 'dashboard-ticket-list__title col-md-6'
},
{
key: 'department',
value: 'Department',
className: 'dashboard-ticket-list__department col-md-3'
},
{
key: 'date',
value: 'Date',
className: 'dashboard-ticket-list__date col-md-2'
}
];
}
getTableRows() {
return this.props.tickets.map(this.gerTicketTableObject.bind(this));
}
gerTicketTableObject(ticket) {
let titleText = (ticket.unread) ? ticket.title + ' (1)' : ticket.title;
return {
number: (
<Tooltip content={<TicketInfo ticket={ticket}/>} >
{'#' + ticket.ticketNumber}
</Tooltip>
),
title: (
<Button className="dashboard-ticket-list__title-link" type="clean" route={{to: '/dashboard/ticket/' + ticket.ticketNumber}}>
{titleText}
</Button>
),
department: ticket.department.name,
date: ticket.date,
highlighted: ticket.unread
};
}
=======
>>>>>>> |
<<<<<<<
=======
>>>>>>>
<<<<<<<
=======
>>>>>>>
<<<<<<<
var optionKeys = [
'path',
'paths',
'type',
'label',
'note',
'size',
'initial',
'required',
'col',
'noedit',
'nocol',
'nosort',
'nofilter',
'indent',
'hidden',
'collapse',
'dependsOn'
];
=======
var optionKeys = DEFAULT_OPTION_KEYS;
>>>>>>>
var optionKeys = [
'path',
'paths',
'type',
'label',
'note',
'size',
'initial',
'required',
'col',
'noedit',
'nocol',
'nosort',
'nofilter',
'indent',
'hidden',
'collapse',
'dependsOn'
];
<<<<<<<
=======
>>>>>>>
<<<<<<<
=======
this.__options.hasFilterMethod = this.addFilterToQuery ? true : false;
>>>>>>>
this.__options.hasFilterMethod = this.addFilterToQuery ? true : false;
<<<<<<<
=======
>>>>>>>
<<<<<<<
=======
>>>>>>> |
<<<<<<<
var DateList = require('./lists/date');
=======
var ColorList = require('./lists/color');
>>>>>>>
var ColorList = require('./lists/color');
var DateList = require('./lists/date');
<<<<<<<
dateList: new DateList(),
=======
colorList: new ColorList(),
>>>>>>>
colorList: new ColorList(),
dateList: new DateList(), |
<<<<<<<
'MY_TICKETS_DESCRIPTION': 'Here you can view the tickets you are responsible for.',
=======
'TICKET_VIEW_DESCRIPTION': 'This ticket has been sent by a customer. Here you can respond or assign the ticket',
>>>>>>>
'MY_TICKETS_DESCRIPTION': 'Here you can view the tickets you are responsible for.',
'TICKET_VIEW_DESCRIPTION': 'This ticket has been sent by a customer. Here you can respond or assign the ticket', |
<<<<<<<
this._fixedSize = 'full';
this._properties = ['formatString'];
=======
this._fixedSize = 'large';
this._properties = ['formatString', 'isUTC'];
>>>>>>>
this._fixedSize = 'full';
this._properties = ['formatString', 'isUTC']; |
<<<<<<<
if (this.__size) return this.__size;
var size = this._fixedSize || this.options.size || this.options.width;
if (size !== 'small' && size !== 'medium' && size !== 'large' && size !== 'full') {
size = this._defaultSize || 'full';
=======
if (!this.__size) {
var size = this._fixedSize || this.options.size || this.options.width;
if (size !== 'small' && size !== 'medium' && size !== 'large' && size !== 'full') {
size = this._defaultSize || 'large';
}
this.__size = size;
>>>>>>>
if (!this.__size) {
var size = this._fixedSize || this.options.size || this.options.width;
if (size !== 'small' && size !== 'medium' && size !== 'large' && size !== 'full') {
size = this._defaultSize || 'full';
}
this.__size = size; |
<<<<<<<
=======
onCloseTicketClick(event){
event.preventDefault();
API.call({
path: '/ticket/close',
data: {
ticketNumber: this.props.ticket.ticketNumber
}
}).then(this.onTicketModification.bind(this));
}
getStaffAssignmentItems() {
const {staffMembers, userDepartments, userId, ticket} = this.props;
const ticketDepartmentId = ticket.department.id;
let staffAssignmentItems = [
{content: 'None', id: 0}
];
if(_.any(userDepartments, {id: ticketDepartmentId})) {
staffAssignmentItems.push({content: i18n('ASSIGN_TO_ME'), id: userId});
}
staffAssignmentItems = staffAssignmentItems.concat(
_.map(
_.filter(staffMembers, ({id, departments}) => {
return (id != userId) && _.any(departments, {id: ticketDepartmentId});
}),
({id, name}) => ({content: name, id})
)
);
return staffAssignmentItems;
}
>>>>>>>
getStaffAssignmentItems() {
const {staffMembers, userDepartments, userId, ticket} = this.props;
const ticketDepartmentId = ticket.department.id;
let staffAssignmentItems = [
{content: 'None', id: 0}
];
if(_.any(userDepartments, {id: ticketDepartmentId})) {
staffAssignmentItems.push({content: i18n('ASSIGN_TO_ME'), id: userId});
}
staffAssignmentItems = staffAssignmentItems.concat(
_.map(
_.filter(staffMembers, ({id, departments}) => {
return (id != userId) && _.any(departments, {id: ticketDepartmentId});
}),
({id, name}) => ({content: name, id})
)
);
return staffAssignmentItems;
} |
<<<<<<<
var generateNames = require('./generateNamesArr');
=======
var renameComponent = require('./renameComponent');
>>>>>>>
var generateNames = require('./generateNamesArr');
var renameComponent = require('./renameComponent'); |
<<<<<<<
<Gui id={this.props.id} hash={this.props.hash}/>
<Options id={this.props.id} hash={this.props.hash} submit={this.props.submit}/>
=======
<Gui />
<Options />
>>>>>>>
<Gui />
<Options submit={this.props.submit}/> |
<<<<<<<
'PRIVATE': '私人的',
=======
'ENABLE_USER': '启用用户',
'DISABLE_USER': '禁用用户',
>>>>>>>
'PRIVATE': '私人的',
'ENABLE_USER': '启用用户',
'DISABLE_USER': '禁用用户', |
<<<<<<<
var Task = require('../../lib/internal/task');
describe('attempt', function() {
var closeTo = function(average, jitter) {
return {
asymmetricMatch: function(actual) {
return average * (1 - jitter) <= actual &&
average * (1 + jitter) >= actual;
}
}
};
=======
var within = require('../within');
>>>>>>>
var Task = require('../../lib/internal/task');
var within = require('../within');
<<<<<<<
attempt({'do': doSomething, until: equalTo200})
.thenDo(function(err, result) {
var closeTo500 = {
asymmetricMatch: function(actual) {
return 250 <= actual && actual <= 750;
}
};
expect(timeoutDurations).toEqual([closeTo(500, 0.5)]);
=======
attempt({'do': doSomething, until: equalTo200}, function(err, result) {
expect(timeoutDurations).toEqual([within(250).of(500)]);
>>>>>>>
attempt({'do': doSomething, until: equalTo200})
.thenDo(function(err, result) {
expect(timeoutDurations).toEqual([within(250).of(500)]); |
<<<<<<<
if (isSuccessful(response)) {
=======
// We add the request url and the original query to the response
// to be able to use them when debugging errors.
response.requestUrl = requestUrl;
response.query = query;
if (response.status === 200 && (
response.json.status === 'OK' ||
response.json.status === 'ZERO_RESULTS')) {
>>>>>>>
// We add the request url and the original query to the response
// to be able to use them when debugging errors.
response.requestUrl = requestUrl;
response.query = query;
if (isSuccessful(response)) { |
<<<<<<<
var modes = utils.Set(['driving', 'walking', 'bicycling', 'transit']);
=======
var InvalidValueError = require('../invalid-value-error');
var v = require('../validate');
var path = '/maps/api/directions/json';
var validateDirectionsQuery = v.compose([
v.mutuallyExclusiveProperties(['arrival_time', 'departure_time']),
v.object({
alternatives: v.optional(v.boolean),
arrival_time: v.optional(utils.timeStamp),
avoid: v.optional(utils.pipedArrayOf(v.oneOf([
'tolls', 'highways', 'ferries', 'indoor'
]))),
departure_time: v.optional(utils.timeStamp),
destination: utils.latLng,
mode: v.optional(v.oneOf(['driving', 'walking', 'bicycling', 'transit'])),
optimize: v.optional(v.boolean),
origin: utils.latLng,
retryOptions: v.optional(utils.retryOptions),
units: v.optional(v.oneOf(['metric', 'imperial'])),
waypoints: v.optional(utils.pipedArrayOf(utils.latLng))
}),
function(query) {
if (query.waypoints && query.optimize) {
query.waypoints = 'optimize:true|' + query.waypoints;
}
delete query.optimize;
return query;
}
]);
>>>>>>>
var InvalidValueError = require('../invalid-value-error');
var v = require('../validate');
var validateDirectionsQuery = v.compose([
v.mutuallyExclusiveProperties(['arrival_time', 'departure_time']),
v.object({
alternatives: v.optional(v.boolean),
arrival_time: v.optional(utils.timeStamp),
avoid: v.optional(utils.pipedArrayOf(v.oneOf([
'tolls', 'highways', 'ferries', 'indoor'
]))),
departure_time: v.optional(utils.timeStamp),
destination: utils.latLng,
mode: v.optional(v.oneOf(['driving', 'walking', 'bicycling', 'transit'])),
optimize: v.optional(v.boolean),
origin: utils.latLng,
retryOptions: v.optional(utils.retryOptions),
units: v.optional(v.oneOf(['metric', 'imperial'])),
waypoints: v.optional(utils.pipedArrayOf(utils.latLng))
}),
function(query) {
if (query.waypoints && query.optimize) {
query.waypoints = 'optimize:true|' + query.waypoints;
}
delete query.optimize;
return query;
}
]);
<<<<<<<
if (!query.origin || !query.destination) {
throw 'origin and destination params required';
} else if (query.departure_time && query.arrival_time) {
throw 'should not specify both departure_time and arrival_time params';
} else if (query.mode && !modes.has(query.mode)) {
throw 'invalid mode param';
}
query.origin = utils.latLng(query.origin);
query.destination = utils.latLng(query.destination);
if (query.waypoints) {
query.waypoints = utils.locations(query.waypoints);
if (query.optimize) {
query.waypoints = 'optimize:true|' + query.waypoints;
}
}
delete query.optimize;
if (query.alternatives) {
query.alternatives = 'true';
} else {
delete query.alternatives;
}
if (query.avoid) {
query.avoid = utils.piped(query.avoid);
}
if (query.departure_time) {
query.departure_time = utils.timeStamp(query.departure_time);
}
if (query.arrival_time) {
query.arrival_time = utils.timeStamp(query.arrival_time);
}
return makeApiCall(url, query, callback);
=======
query = validateDirectionsQuery(query);
return makeApiCall(path, query, callback);
>>>>>>>
query = validateDirectionsQuery(query);
return makeApiCall(url, query, callback); |
<<<<<<<
'PRIVATE': 'privado',
=======
'ENABLE_USER': 'Ativar usuário',
'DISABLE_USER': 'Desativar usuário',
>>>>>>>
'PRIVATE': 'privado',
'ENABLE_USER': 'Ativar usuário',
'DISABLE_USER': 'Desativar usuário', |
<<<<<<<
import brazilLanguage from 'data/languages/br';
import greekLanguage from 'data/languages/gr';
=======
import dutchLanguage from 'data/languages/nl';
>>>>>>>
import brazilLanguage from 'data/languages/br';
import greekLanguage from 'data/languages/gr';
import dutchLanguage from 'data/languages/nl'; |
<<<<<<<
'PRIVATE': 'privado',
=======
'ENABLE_USER': 'Habilitar usuario',
'DISABLE_USER': 'Deshabilitar usuario',
>>>>>>>
'PRIVATE': 'privado',
'ENABLE_USER': 'Habilitar usuario',
'DISABLE_USER': 'Deshabilitar usuario', |
<<<<<<<
var log;
exports.dashboard = function(settings) {
=======
exports.dashboard = function(settings, cb) {
>>>>>>>
var log;
exports.dashboard = function(settings, cb) {
<<<<<<<
log('Server started.');
=======
util.log('Server started.');
if (cb) cb();
>>>>>>>
log('Server started.');
if (cb) cb(); |
<<<<<<<
'STAFF_LEVEL': 'Staff Level',
'ASSIGNED': 'Assigned',
=======
'ASSIGNED_TICKETS': '{tickets} assigned tickets',
'CLOSED_TICKETS': '{tickets} closed tickets',
'LAST_LOGIN': 'Last login',
'ADD_NEW_STAFF': 'Add new staff',
'ADD_STAFF': 'Add staff',
'LEVEL': 'Level',
'LEVEL_1': 'Level 1 (Tickets)',
'LEVEL_2': 'Level 2 (Tickets + Articles)',
'LEVEL_3': 'Level 2 (Tickets + Articles + Staff)',
>>>>>>>
'STAFF_LEVEL': 'Staff Level',
'ASSIGNED': 'Assigned',
'ASSIGNED_TICKETS': '{tickets} assigned tickets',
'CLOSED_TICKETS': '{tickets} closed tickets',
'LAST_LOGIN': 'Last login',
'ADD_NEW_STAFF': 'Add new staff',
'ADD_STAFF': 'Add staff',
'LEVEL': 'Level',
'LEVEL_1': 'Level 1 (Tickets)',
'LEVEL_2': 'Level 2 (Tickets + Articles)',
'LEVEL_3': 'Level 2 (Tickets + Articles + Staff)', |
<<<<<<<
_cmd_insecureServerDomainQuery: function(bridgeQueryName, query) {
var queryHandle = this._notif.newTrackedQuery(
this._querySource, bridgeQueryName,
NS_SERVERS, query),
viewItems = [],
clientDataItems = queryHandle.items = [], self = this;
queryHandle.splices.push({ index: 0, howMany: 0, items: viewItems });
when(this._rawClient.insecurelyGetServerSelfIdentUsingDomainName(
query.domain),
=======
updatePocoWithPartial: function(partialPoco) {
var poco = this._rawClient.getPoco();
for (var prop in partialPoco) {
if (partialPoco.hasOwnProperty(prop)) {
poco[prop] = partialPoco[prop];
}
}
this._rawClient.updatePoco(poco);
},
_cmd_provideProofOfIdentity: function(_ignored, proof) {
var self = this,
rawClient = this._rawClient;
when(rawClient.provideProofOfIdentity(proof),
function(data){
if (proof.type === 'email') {
var email = data.email;
// Convert email into a an image. Use gravatar.
if (email) {
when(rawClient.fetchGravatarImageUrl(email),
function (dataUrl) {
// dataUrl is a string, data URI
self.updatePocoWithPartial({
emails: [{
value: email
}],
photos: [{
value: dataUrl
}]
});
}, function (err) {
// Just eat it, continue on.
self.updatePocoWithPartial({
emails: [{
value: email
}]
});
}
);
}
}
},
function(err) {
}
);
},
_cmd_insecurelyGetServerSelfIdentUsingDomainName: function(ignored, domain) {
when(this._rawClient.insecurelyGetServerSelfIdentUsingDomainName(domain),
>>>>>>>
updatePocoWithPartial: function(partialPoco) {
var poco = this._rawClient.getPoco();
for (var prop in partialPoco) {
if (partialPoco.hasOwnProperty(prop)) {
poco[prop] = partialPoco[prop];
}
}
this._rawClient.updatePoco(poco);
},
_cmd_provideProofOfIdentity: function(_ignored, proof) {
var self = this,
rawClient = this._rawClient;
when(rawClient.provideProofOfIdentity(proof),
function(data){
if (proof.type === 'email') {
var email = data.email;
// Convert email into a an image. Use gravatar.
if (email) {
when(rawClient.fetchGravatarImageUrl(email),
function (dataUrl) {
// dataUrl is a string, data URI
self.updatePocoWithPartial({
emails: [{
value: email
}],
photos: [{
value: dataUrl
}]
});
}, function (err) {
// Just eat it, continue on.
self.updatePocoWithPartial({
emails: [{
value: email
}]
});
}
);
}
}
},
function(err) {
}
);
},
_cmd_insecureServerDomainQuery: function(bridgeQueryName, query) {
var queryHandle = this._notif.newTrackedQuery(
this._querySource, bridgeQueryName,
NS_SERVERS, query),
viewItems = [],
clientDataItems = queryHandle.items = [], self = this;
queryHandle.splices.push({ index: 0, howMany: 0, items: viewItems });
when(this._rawClient.insecurelyGetServerSelfIdentUsingDomainName(
query.domain), |
<<<<<<<
return self.manager.getTool('manager-modal', {
decorate: self.decorateManager,
chooser: self,
source: 'chooser-modal',
body: {
limit: self.limit
},
transition: 'slide'
=======
return self.convertInlineRelationships(function(err) {
if (err) {
alert('Please address errors first.');
return;
}
return self.manager.getTool('manager-modal', {
decorate: self.decorateManager,
chooser: self,
source: 'chooser-modal',
transition: 'slide'
});
>>>>>>>
return self.convertInlineRelationships(function(err) {
if (err) {
alert('Please address errors first.');
return;
}
return self.manager.getTool('manager-modal', {
decorate: self.decorateManager,
chooser: self,
source: 'chooser-modal',
body: {
limit: self.limit
},
transition: 'slide'
}); |
<<<<<<<
// Override to modify `data` before it is passed to
// the `chooserModal.html` template
self.beforeChooserModal = function(req, data) {
};
=======
// Most of the time, this is called for you. Any schema field
// with `sortify: true` will automatically get a migration to
// ensure that, if the field is named `lastName`, then
// `lastNameSortified` exists.
//
// Adds a migration that takes the given field, such as `lastName`, and
// creates a parallel `lastNameSortified` field, formatted with
// `apos.utils.sortify` so that it sorts and compares in a more
// intuitive, case-insensitive way.
//
// After adding such a migration, you can add `sortify: true` to the
// schema field declaration for `field`, and any calls to
// the `sort()` cursor filter for `lastName` will automatically
// use `lastNameSortified`. You can also do that explicitly of course.
//
// Note that you want to do both things (add the migration, and
// add `sortify: true`) because `sortify: true` guarantees that
// `lastNameSortified` gets updated on all saves of a doc of this type.
// The migration is a one-time fix for existing data.
self.addSortifyMigration = function(field) {
if (!self.name) {
return;
}
return self.apos.migrations.addSortify(self.__meta.name, { type: self.name }, field);
};
>>>>>>>
// Override to modify `data` before it is passed to
// the `chooserModal.html` template
self.beforeChooserModal = function(req, data) {
};
// Most of the time, this is called for you. Any schema field
// with `sortify: true` will automatically get a migration to
// ensure that, if the field is named `lastName`, then
// `lastNameSortified` exists.
//
// Adds a migration that takes the given field, such as `lastName`, and
// creates a parallel `lastNameSortified` field, formatted with
// `apos.utils.sortify` so that it sorts and compares in a more
// intuitive, case-insensitive way.
//
// After adding such a migration, you can add `sortify: true` to the
// schema field declaration for `field`, and any calls to
// the `sort()` cursor filter for `lastName` will automatically
// use `lastNameSortified`. You can also do that explicitly of course.
//
// Note that you want to do both things (add the migration, and
// add `sortify: true`) because `sortify: true` guarantees that
// `lastNameSortified` gets updated on all saves of a doc of this type.
// The migration is a one-time fix for existing data.
self.addSortifyMigration = function(field) {
if (!self.name) {
return;
}
return self.apos.migrations.addSortify(self.__meta.name, { type: self.name }, field);
}; |
<<<<<<<
/**
* Display results of the search
* @param {Number} numbCategories - The number of categories found
*/
showResult: function(numbCategories) {
if (numbCategories == 0) {
this.$archiveResult.html(this.messages.zero).show();
}
else if (numbCategories == -1) {
this.$archiveResult.html('').hide();
}
else if (numbCategories == 1) {
this.$archiveResult.html(this.messages.one).show();
}
else {
this.$archiveResult.html(this.messages.other.replace(/\{n\}/, numbCategories)).show();
}
},
=======
/**
* Display results of the search
* @param {Number} numbCategories - The number of categories found
* @return {void}
*/
showResult: function(numbCategories) {
if (numbCategories === 0) {
this.$archiveResult.html(this.messages.zero).show();
}
else if (numbCategories === -1) {
this.$archiveResult.html('').hide();
}
else if (numbCategories === 1) {
this.$archiveResult.html(numbCategories + ' ' + this.messages.one).show();
}
else {
this.$archiveResult.html(numbCategories + ' ' + this.messages.other).show();
}
},
>>>>>>>
/**
* Display results of the search
* @param {Number} numbCategories - The number of categories found
* @return {void}
*/
showResult: function(numbCategories) {
if (numbCategories === -1) {
this.$archiveResult.html('').hide();
}
else if (numbCategories === 0) {
this.$archiveResult.html(this.messages.zero).show();
}
else if (numbCategories === 1) {
this.$archiveResult.html(this.messages.one).show();
}
else {
this.$archiveResult.html(this.messages.other.replace(/\{n\}/, numbCategories)).show();
}
}, |
<<<<<<<
/*global $, SystemPath, radioData, checkData, bodymovin, messageController, mainController */
=======
/*global $, SystemPath, radioData, gearData, bodymovin, messageController, mainController */
>>>>>>>
/*global $, SystemPath, radioData, gearData, checkData, bodymovin, messageController, mainController */
<<<<<<<
function handleStandaloneClick() {
if (!comp.selected && !comp.standalone) {
handleStateClick();
}
comp.standalone = !comp.standalone;
if (comp.standalone) {
comp.animCheck.play();
} else {
comp.animCheck.goToAndStop(0);
}
var eScript = 'bm_compsManager.setCompositionStandaloneState(' + comp.id + ',' + comp.standalone + ')';
csInterface.evalScript(eScript);
}
function handleGlyphsClick() {
if (!comp.selected && !comp.standalone) {
handleStateClick();
}
console.log('comp.glyphs: ', comp.glyphs);
comp.glyphs = !comp.glyphs;
if (comp.glyphs) {
elem.find('.glyphsTd .glyphs').html('Shape');
} else {
elem.find('.glyphsTd .glyphs').html('Font');
}
var eScript = 'bm_compsManager.setCompositionGlyphsState(' + comp.id + ',' + comp.glyphs + ')';
csInterface.evalScript(eScript);
}
=======
function saveSettings(data) {
comp.settings = data;
var eScript = 'bm_compsManager.setCompositionSettings(' + comp.id + ',' + JSON.stringify(comp.settings) + ')';
csInterface.evalScript(eScript);
}
function showElemSetings() {
settingsManager.show(comp.settings, saveSettings);
}
function overElemSetings() {
comp.gearAnim.play();
}
function outElemSetings() {
comp.gearAnim.goToAndStop(0);
}
>>>>>>>
function handleStandaloneClick() {
if (!comp.selected && !comp.standalone) {
handleStateClick();
}
comp.standalone = !comp.standalone;
if (comp.standalone) {
comp.animCheck.play();
} else {
comp.animCheck.goToAndStop(0);
}
var eScript = 'bm_compsManager.setCompositionStandaloneState(' + comp.id + ',' + comp.standalone + ')';
csInterface.evalScript(eScript);
}
function handleGlyphsClick() {
if (!comp.selected && !comp.standalone) {
handleStateClick();
}
console.log('comp.glyphs: ', comp.glyphs);
comp.glyphs = !comp.glyphs;
if (comp.glyphs) {
elem.find('.glyphsTd .glyphs').html('Shape');
} else {
elem.find('.glyphsTd .glyphs').html('Font');
}
var eScript = 'bm_compsManager.setCompositionGlyphsState(' + comp.id + ',' + comp.glyphs + ')';
csInterface.evalScript(eScript);
}
function saveSettings(data) {
comp.settings = data;
var eScript = 'bm_compsManager.setCompositionSettings(' + comp.id + ',' + JSON.stringify(comp.settings) + ')';
csInterface.evalScript(eScript);
}
function showElemSetings() {
settingsManager.show(comp.settings, saveSettings);
}
function overElemSetings() {
comp.gearAnim.play();
}
function outElemSetings() {
comp.gearAnim.goToAndStop(0);
}
<<<<<<<
elem.find('.standaloneTd').on('click', handleStandaloneClick);
elem.find('.glyphsTd').on('click', handleGlyphsClick);
=======
elem.find('.settingsTd').on('click', showElemSetings);
elem.find('.settingsTd').hover(overElemSetings, outElemSetings);
/*elem.find('.settingsTd').on('rollover', overElemSetings);
elem.find('.settingsTd').on('rollout', outElemSetings);*/
>>>>>>>
elem.find('.settingsTd').on('click', showElemSetings);
elem.find('.settingsTd').hover(overElemSetings, outElemSetings);
elem.find('.standaloneTd').on('click', handleStandaloneClick);
elem.find('.glyphsTd').on('click', handleGlyphsClick);
<<<<<<<
animContainer = comp.elem.find('.standalone')[0];
animData = JSON.parse(checkData);
params = {
animType: 'canvas',
wrapper: animContainer,
loop: false,
autoplay: false,
prerender: true,
animationData: animData
};
anim = bodymovin.loadAnimation(params);
comp.animCheck = anim;
=======
animContainer = comp.elem.find('.settings')[0];
animData = JSON.parse(gearData);
params = {
animType: 'svg',
wrapper: animContainer,
loop: false,
autoplay: false,
prerender: true,
animationData: animData
};
anim = bodymovin.loadAnimation(params);
comp.gearAnim = anim;
>>>>>>>
animContainer = comp.elem.find('.standalone')[0];
animData = JSON.parse(checkData);
params = {
animType: 'canvas',
wrapper: animContainer,
loop: false,
autoplay: false,
prerender: true,
animationData: animData
};
anim = bodymovin.loadAnimation(params);
comp.animCheck = anim;
animContainer = comp.elem.find('.settings')[0];
animData = JSON.parse(gearData);
params = {
animType: 'svg',
wrapper: animContainer,
loop: false,
autoplay: false,
prerender: true,
animationData: animData
};
anim = bodymovin.loadAnimation(params);
comp.gearAnim = anim; |
<<<<<<<
readonly: PropTypes.bool,
=======
sundayFirstDayOfWeek: React.PropTypes.bool,
>>>>>>>
readonly: PropTypes.bool,
sundayFirstDayOfWeek: React.PropTypes.bool,
<<<<<<<
const { autoOk, inputClassName, inputFormat, maxDate, minDate,
onEscKeyDown, onOverlayClick, readonly, value, ...others } = this.props;
=======
const { autoOk, inputClassName, inputFormat, maxDate, minDate, sundayFirstDayOfWeek,
onEscKeyDown, onOverlayClick, value, locale, ...others } = this.props;
>>>>>>>
const { autoOk, inputClassName, inputFormat, locale, maxDate, minDate,
onEscKeyDown, onOverlayClick, readonly, sundayFirstDayOfWeek, value,
...others } = this.props; |
<<<<<<<
autoOk, inputClassName, inputFormat, locale, maxDate, minDate,
onEscKeyDown, onOverlayClick, readonly, sundayFirstDayOfWeek, value,
onDismiss, ...others } = this.props;
=======
autoOk, cancelLabel, inputClassName, inputFormat, locale, maxDate, minDate,
okLabel, onEscKeyDown, onOverlayClick, readonly, sundayFirstDayOfWeek, value,
...others } = this.props;
>>>>>>>
autoOk, cancelLabel, inputClassName, inputFormat, locale, maxDate, minDate,
okLabel, onEscKeyDown, onOverlayClick, readonly, sundayFirstDayOfWeek, value,
onDismiss, ...others } = this.props;
<<<<<<<
onDismiss={onDismiss || this.handleDismiss}
=======
okLabel={okLabel}
onDismiss={this.handleDismiss}
>>>>>>>
onDismiss={onDismiss || this.handleDismiss}
okLabel={okLabel} |
<<<<<<<
handleChange = (keys, event) => {
const key = this.props.multiple ? keys : keys[0];
const { showSuggestionsWhenValueIsSet: showAllSuggestions } = this.props;
const query = this.query(key);
if (this.props.onChange) this.props.onChange(key, event);
if (this.props.keepFocusOnChange) {
this.setState({ query, showAllSuggestions });
} else {
this.setState({ focus: false, query, showAllSuggestions }, () => {
ReactDOM.findDOMNode(this).querySelector('input').blur();
});
}
=======
handleChange = (values, event) => {
const value = this.props.multiple ? values : values[0];
const { showSuggestionsWhenValueIsSet: showAllSuggestions } = this.props;
const query = this.query(value);
if (this.props.onChange) this.props.onChange(value, event);
if (this.props.keepFocusOnChange) {
this.setState({ query, showAllSuggestions });
} else {
this.setState({ focus: false, query, showAllSuggestions }, () => {
ReactDOM.findDOMNode(this).querySelector('input').blur();
});
}
};
handleMouseDown = () => {
this.selectOrCreateActiveItem();
>>>>>>>
handleChange = (values, event) => {
const value = this.props.multiple ? values : values[0];
const { showSuggestionsWhenValueIsSet: showAllSuggestions } = this.props;
const query = this.query(value);
if (this.props.onChange) this.props.onChange(value, event);
if (this.props.keepFocusOnChange) {
this.setState({ query, showAllSuggestions });
} else {
this.setState({ focus: false, query, showAllSuggestions }, () => {
ReactDOM.findDOMNode(this).querySelector('input').blur();
});
}
<<<<<<<
this.setState({query: value, showAllSuggestions: false, active: null});
=======
if (this.props.onQueryChange) this.props.onQueryChange(value);
this.setState({query: value, showAllSuggestions: false, active: null});
>>>>>>>
if (this.props.onQueryChange) this.props.onQueryChange(value);
this.setState({query: value, showAllSuggestions: false, active: null});
<<<<<<<
selectedPosition, keepFocusOnChange, showSuggestionsWhenValueIsSet, //eslint-disable-line no-unused-vars
=======
selectedPosition, keepFocusOnChange, showSuggestionsWhenValueIsSet, showSelectedWhenNotInSource, onQueryChange, //eslint-disable-line no-unused-vars
>>>>>>>
selectedPosition, keepFocusOnChange, showSuggestionsWhenValueIsSet, showSelectedWhenNotInSource, onQueryChange, //eslint-disable-line no-unused-vars |
<<<<<<<
import { Site, Grid, List, Button } from "tabler-react";
=======
import { Site, Nav, Button } from "tabler-react";
>>>>>>>
import { Site, Nav, Grid, List, Button } from "tabler-react"; |
<<<<<<<
import DocsChartsPage from "./DocsChartsPage.react";
=======
import DocsTagsPage from "./DocsTagsPage.react";
>>>>>>>
import DocsChartsPage from "./DocsChartsPage.react";
import DocsTagsPage from "./DocsTagsPage.react";
<<<<<<<
DocsCardsPage,
DocsChartsPage,
=======
DocsCardsPage,
DocsTagsPage,
>>>>>>>
DocsCardsPage,
DocsChartsPage,
DocsTagsPage, |
<<<<<<<
<Form.Group label="Password">
<Form.Input
type="password"
name="example-password-input"
placeholder="Password..."
/>
</Form.Group>
<Form.Group label="Valid State">
<Form.Input valid placeholder="Is Valid" />
<Form.Input tick placeholder="Tick" className="mt-3" />
</Form.Group>
<Form.Group label="Invalid State">
<Form.Input
invalid
feedback="Invalid feedback"
placeholder="Is Invalid"
/>
<Form.Input cross placeholder="Cross" className="mt-3" />
</Form.Group>
<Form.Group label="Select">
<Form.Select>
<option>United Kingdom</option>
<option>Germany</option>
</Form.Select>
</Form.Group>
<Form.Group label="Ratios">
<Form.Ratio step={5} min={0} max={50} defaultValue={15} />
</Form.Group>
=======
<ComponentDemo>
<Form.Group label="Password">
<Form.Input
type="password"
name="example-password-input"
placeholder="Password..."
/>
</Form.Group>
</ComponentDemo>
<ComponentDemo>
<Form.Group label="Valid State">
<Form.Input valid placeholder="Is Valid" />
<Form.Input tick placeholder="Tick" className="mt-3" />
</Form.Group>
</ComponentDemo>
<ComponentDemo>
<Form.Group label="Invalid State">
<Form.Input
invalid
feedback="Invalid feedback"
placeholder="Is Invalid"
/>
<Form.Input cross placeholder="Cross" className="mt-3" />
</Form.Group>
</ComponentDemo>
<ComponentDemo>
<Form.Group label="Select">
<Form.Select>
<option>United Kingdom</option>
<option>Germany</option>
</Form.Select>
</Form.Group>
</ComponentDemo>
>>>>>>>
<ComponentDemo>
<Form.Group label="Password">
<Form.Input
type="password"
name="example-password-input"
placeholder="Password..."
/>
</Form.Group>
</ComponentDemo>
<ComponentDemo>
<Form.Group label="Valid State">
<Form.Input valid placeholder="Is Valid" />
<Form.Input tick placeholder="Tick" className="mt-3" />
</Form.Group>
</ComponentDemo>
<ComponentDemo>
<Form.Group label="Invalid State">
<Form.Input
invalid
feedback="Invalid feedback"
placeholder="Is Invalid"
/>
<Form.Input cross placeholder="Cross" className="mt-3" />
</Form.Group>
</ComponentDemo>
<ComponentDemo>
<Form.Group label="Select">
<Form.Select>
<option>United Kingdom</option>
<option>Germany</option>
</Form.Select>
</Form.Group>
</ComponentDemo>
<ComponentDemo>
<Form.Group label="Ratios">
<Form.Ratio step={5} min={0} max={50} defaultValue={15} />
</Form.Group>
</ComponentDemo> |
<<<<<<<
+onClick?: () => void,
=======
+active?: boolean,
>>>>>>>
+onClick?: () => void,
+active?: boolean,
<<<<<<<
onClick,
=======
active,
>>>>>>>
onClick,
active, |
<<<<<<<
export { default as PricingCard } from "./PricingCard";
export { default as StoreCard } from "./StoreCard";
=======
export { default as PricingCard } from "./PricingCard";
export { default as StatsCard } from "./StatsCard";
export { default as Stamp } from "./Stamp";
export { default as StampCard } from "./StampCard";
export { default as Dimmer } from "./Dimmer";
export { default as Loader } from "./Loader";
export { default as Tag } from "./Tag";
>>>>>>>
export { default as PricingCard } from "./PricingCard";
export { default as StoreCard } from "./StoreCard";
export { default as StatsCard } from "./StatsCard";
export { default as Stamp } from "./Stamp";
export { default as StampCard } from "./StampCard";
export { default as Dimmer } from "./Dimmer";
export { default as Loader } from "./Loader";
export { default as Tag } from "./Tag"; |
<<<<<<<
import {
Header,
Card,
TabbedCard,
Tab,
Button,
Grid,
Dimmer,
} from "tabler-react";
=======
import {
Header,
Card,
Button,
Grid,
Dimmer,
Timeline,
Stamp,
} from "tabler-react";
>>>>>>>
import {
Header,
Card,
TabbedCard,
Tab,
Button,
Grid,
Dimmer,
Timeline,
Stamp,
} from "tabler-react"; |
<<<<<<<
<ComponentDemo>
<Form.FieldSet>
<Form.Group label="Full name" isRequired>
<Form.Input name="example-text-input" />
</Form.Group>
<Form.Group label="Company" isRequired>
<Form.Input name="example-text-input" />
</Form.Group>
<Form.Group label="Email" isRequired>
<Form.Input name="example-text-input" />
</Form.Group>
<Form.Group label="Phone number" className="mb-0">
<Form.Input name="example-text-input" />
</Form.Group>
</Form.FieldSet>
</ComponentDemo>
=======
<ComponentDemo>
<Form.Group label="Size">
<Form.SelectGroup>
<Form.SelectGroupItem name="size" label="S" value="50" />
<Form.SelectGroupItem name="size" label="M" value="100" />
<Form.SelectGroupItem name="size" label="L" value="150" />
<Form.SelectGroupItem name="size" label="XL" value="200" />
</Form.SelectGroup>
</Form.Group>
</ComponentDemo>
<ComponentDemo>
<Form.Group label="Icons input">
<Form.SelectGroup>
<Form.SelectGroupItem
name="device"
icon="smartphone"
value="smartphone"
/>
<Form.SelectGroupItem
name="device"
icon="tablet"
value="tablet"
/>
<Form.SelectGroupItem
name="device"
icon="monitor"
value="monitor"
/>
<Form.SelectGroupItem name="device" icon="x" value="x" />
</Form.SelectGroup>
</Form.Group>
</ComponentDemo>
<ComponentDemo>
<Form.Group label="Icon input">
<Form.SelectGroup pills>
<Form.SelectGroupItem name="weather" icon="sun" value="sun" />
<Form.SelectGroupItem
name="weather"
icon="moon"
value="moon"
/>
<Form.SelectGroupItem
name="weather"
icon="cloud-rain"
value="rain"
/>
<Form.SelectGroupItem
name="weather"
icon="cloud"
value="cloud"
/>
</Form.SelectGroup>
</Form.Group>
</ComponentDemo>
<ComponentDemo>
<Form.Group label="Your skills">
<Form.SelectGroup pills canSelectMultiple>
<Form.SelectGroupItem
name="language"
label="HTML"
value="HTML"
/>
<Form.SelectGroupItem
name="language"
label="CSS"
value="CSS"
/>
<Form.SelectGroupItem
name="language"
label="JavaScript"
value="JavaScript"
/>
<Form.SelectGroupItem
name="language"
label="Ruby"
value="Ruby"
/>
<Form.SelectGroupItem
name="language"
label="Python"
value="Python"
/>
<Form.SelectGroupItem
name="language"
label="C++"
value="C++"
/>
</Form.SelectGroup>
</Form.Group>
</ComponentDemo>
>>>>>>>
<ComponentDemo>
<Form.FieldSet>
<Form.Group label="Full name" isRequired>
<Form.Input name="example-text-input" />
</Form.Group>
<Form.Group label="Company" isRequired>
<Form.Input name="example-text-input" />
</Form.Group>
<Form.Group label="Email" isRequired>
<Form.Input name="example-text-input" />
</Form.Group>
<Form.Group label="Phone number" className="mb-0">
<Form.Input name="example-text-input" />
</Form.Group>
</Form.FieldSet>
<Form.Group label="Size">
<Form.SelectGroup>
<Form.SelectGroupItem name="size" label="S" value="50" />
<Form.SelectGroupItem name="size" label="M" value="100" />
<Form.SelectGroupItem name="size" label="L" value="150" />
<Form.SelectGroupItem name="size" label="XL" value="200" />
</Form.SelectGroup>
</Form.Group>
</ComponentDemo>
<ComponentDemo>
<Form.Group label="Icons input">
<Form.SelectGroup>
<Form.SelectGroupItem
name="device"
icon="smartphone"
value="smartphone"
/>
<Form.SelectGroupItem
name="device"
icon="tablet"
value="tablet"
/>
<Form.SelectGroupItem
name="device"
icon="monitor"
value="monitor"
/>
<Form.SelectGroupItem name="device" icon="x" value="x" />
</Form.SelectGroup>
</Form.Group>
</ComponentDemo>
<ComponentDemo>
<Form.Group label="Icon input">
<Form.SelectGroup pills>
<Form.SelectGroupItem name="weather" icon="sun" value="sun" />
<Form.SelectGroupItem
name="weather"
icon="moon"
value="moon"
/>
<Form.SelectGroupItem
name="weather"
icon="cloud-rain"
value="rain"
/>
<Form.SelectGroupItem
name="weather"
icon="cloud"
value="cloud"
/>
</Form.SelectGroup>
</Form.Group>
</ComponentDemo>
<ComponentDemo>
<Form.Group label="Your skills">
<Form.SelectGroup pills canSelectMultiple>
<Form.SelectGroupItem
name="language"
label="HTML"
value="HTML"
/>
<Form.SelectGroupItem
name="language"
label="CSS"
value="CSS"
/>
<Form.SelectGroupItem
name="language"
label="JavaScript"
value="JavaScript"
/>
<Form.SelectGroupItem
name="language"
label="Ruby"
value="Ruby"
/>
<Form.SelectGroupItem
name="language"
label="Python"
value="Python"
/>
<Form.SelectGroupItem
name="language"
label="C++"
value="C++"
/>
</Form.SelectGroup>
</Form.Group>
</ComponentDemo> |
<<<<<<<
import {
DocsIntroPage,
DocsAlertsPage,
DocsButtonsPage,
} from "./documentation";
=======
import {
DocsIntroPage,
DocsAlertsPage,
DocsCardsPage,
DocsAvatarsPage,
} from "./documentation";
>>>>>>>
import {
DocsIntroPage,
DocsAlertsPage,
DocsButtonsPage,
DocsCardsPage,
DocsAvatarsPage,
} from "./documentation";
<<<<<<<
<Route exact path="/docs/buttons" component={DocsButtonsPage} />
=======
<Route exact path="/docs/avatars" component={DocsAvatarsPage} />
<Route exact path="/docs/cards" component={DocsCardsPage} />
>>>>>>>
<Route exact path="/docs/buttons" component={DocsButtonsPage} />
<Route exact path="/docs/avatars" component={DocsAvatarsPage} />
<Route exact path="/docs/cards" component={DocsCardsPage} /> |
<<<<<<<
type State = {
isOpen: boolean,
};
class Dropdown extends React.Component<Props, State> {
state = { isOpen: false };
static Trigger = DropdownTrigger;
static Menu = DropdownMenu;
static Item = DropdownItem;
static ItemDivider = DropdownItemDivider;
_handleTriggerOnClick = () => {
this.setState(s => ({ isOpen: !s.isOpen }));
};
render(): React.Node {
const { className, children, desktopOnly, isOption }: Props = this.props;
const classes = cn(
{
dropdown: true,
"d-none": desktopOnly,
"d-md-flex": desktopOnly,
"card-options-dropdown": isOption,
show: this.state.isOpen,
},
className
);
const trigger = (() => {
if (this.props.trigger) return this.props.trigger;
if (this.props.icon || this.props.triggerContent) {
const {
icon,
triggerContent,
isNavLink,
type,
triggerClassName,
color,
toggle,
} = this.props;
return (
<Reference>
{({ ref }: ReferenceChildrenProps) => (
<DropdownTrigger
rootRef={ref}
isNavLink={isNavLink}
icon={icon}
type={type}
className={triggerClassName}
isOption={isOption}
color={color}
toggle={toggle}
onClick={this._handleTriggerOnClick}
>
{triggerContent}
</DropdownTrigger>
)}
</Reference>
);
}
return null;
})();
const items = (() => {
if (this.props.items) return this.props.items;
if (this.props.itemsObject) {
return this.props.itemsObject.map(
(item, i) =>
item.isDivider ? (
<Dropdown.ItemDivider key={i} />
) : (
<Dropdown.Item
icon={item.icon}
badge={item.badge}
badgeType={item.badgeType}
value={item.value}
key={i}
/>
)
);
}
return null;
})();
const menu = (() => {
if (this.props.items || this.props.itemsObject) {
const { position, arrow, dropdownMenuClassName } = this.props;
return (
<Popper placement={position}>
{({ ref, style, placement, arrowProps }: PopperChildrenProps) => (
<DropdownMenu
position={placement}
arrow={arrow}
className={dropdownMenuClassName}
rootRef={ref}
style={style}
show={this.state.isOpen}
>
{items}
</DropdownMenu>
)}
</Popper>
);
}
return null;
})();
return (
<Manager>
<div className={classes}>
{trigger}
{menu || children}
</div>
</Manager>
);
}
=======
function Dropdown(props: Props): React.Node {
const { className, children, desktopOnly, isOption } = props;
const classes = cn(
{
dropdown: true,
"d-none": desktopOnly,
"d-md-flex": desktopOnly,
"card-options-dropdown": isOption,
},
className
);
const trigger =
props.trigger ||
((props.icon || props.triggerContent) && (
<DropdownTrigger
isNavLink={props.isNavLink}
icon={props.icon}
type={props.type}
className={props.triggerClassName}
isOption={isOption}
color={props.color}
toggle={props.toggle}
>
{props.triggerContent}
</DropdownTrigger>
));
const items =
props.items ||
(props.itemsObject &&
props.itemsObject.map(
(item, i) =>
item.isDivider ? (
<Dropdown.ItemDivider key={i} />
) : (
<Dropdown.Item
icon={item.icon}
badge={item.badge}
badgeType={item.badgeType}
value={item.value}
key={i}
to={item.to}
RootComponent={item.RootComponent}
/>
)
));
const menu = (props.items || props.itemsObject) && (
<DropdownMenu
position={props.position}
arrow={props.arrow}
className={props.dropdownMenuClassName}
>
{items}
</DropdownMenu>
);
return (
<div className={classes}>
{trigger}
{menu || children}
</div>
);
>>>>>>>
type State = {
isOpen: boolean,
};
class Dropdown extends React.Component<Props, State> {
state = { isOpen: false };
static Trigger = DropdownTrigger;
static Menu = DropdownMenu;
static Item = DropdownItem;
static ItemDivider = DropdownItemDivider;
_handleTriggerOnClick = () => {
this.setState(s => ({ isOpen: !s.isOpen }));
};
render(): React.Node {
const { className, children, desktopOnly, isOption }: Props = this.props;
const classes = cn(
{
dropdown: true,
"d-none": desktopOnly,
"d-md-flex": desktopOnly,
"card-options-dropdown": isOption,
show: this.state.isOpen,
},
className
);
const trigger = (() => {
if (this.props.trigger) return this.props.trigger;
if (this.props.icon || this.props.triggerContent) {
const {
icon,
triggerContent,
isNavLink,
type,
triggerClassName,
color,
toggle,
} = this.props;
return (
<Reference>
{({ ref }: ReferenceChildrenProps) => (
<DropdownTrigger
rootRef={ref}
isNavLink={isNavLink}
icon={icon}
type={type}
className={triggerClassName}
isOption={isOption}
color={color}
toggle={toggle}
onClick={this._handleTriggerOnClick}
>
{triggerContent}
</DropdownTrigger>
)}
</Reference>
);
}
return null;
})();
const items = (() => {
if (this.props.items) return this.props.items;
if (this.props.itemsObject) {
return this.props.itemsObject.map(
(item, i) =>
item.isDivider ? (
<Dropdown.ItemDivider key={i} />
) : (
<Dropdown.Item
icon={item.icon}
badge={item.badge}
badgeType={item.badgeType}
value={item.value}
key={i}
to={item.to}
RootComponent={item.RootComponent}
/>
)
);
}
return null;
})();
const menu = (() => {
if (this.props.items || this.props.itemsObject) {
const { position, arrow, dropdownMenuClassName } = this.props;
return (
<Popper placement={position}>
{({ ref, style, placement, arrowProps }: PopperChildrenProps) => (
<DropdownMenu
position={placement}
arrow={arrow}
className={dropdownMenuClassName}
rootRef={ref}
style={style}
show={this.state.isOpen}
>
{items}
</DropdownMenu>
)}
</Popper>
);
}
return null;
})();
return (
<Manager>
<div className={classes}>
{trigger}
{menu || children}
</div>
</Manager>
);
} |
<<<<<<<
import DocsFormComponentsPage from "./DocsFormComponentsPage.react";
=======
import DocsChartsPage from "./DocsChartsPage.react";
import DocsTagsPage from "./DocsTagsPage.react";
>>>>>>>
import DocsFormComponentsPage from "./DocsFormComponentsPage.react";
import DocsChartsPage from "./DocsChartsPage.react";
import DocsTagsPage from "./DocsTagsPage.react";
<<<<<<<
DocsCardsPage,
DocsFormComponentsPage,
=======
DocsCardsPage,
DocsChartsPage,
DocsTagsPage,
>>>>>>>
DocsCardsPage,
DocsFormComponentsPage,
DocsChartsPage,
DocsTagsPage, |
<<<<<<<
+size: 1 | 2 | 3 | 4 | 5
|};
=======
+size: 1 | 2 | 3 | 4 | 5,
};
>>>>>>>
+size: 1 | 2 | 3 | 4 | 5,
|}; |
<<<<<<<
=======
function smooth(width, samples) {
if (!this.k){
return this.pv;
}
width = (width || 0.4) * 0.5;
samples = Math.floor(samples || 5);
if (samples <= 1) {
return this.pv;
}
var currentTime = this.comp.renderedFrame / this.comp.globalData.frameRate;
var initFrame = currentTime - width;
var endFrame = currentTime + width;
var sampleFrequency = samples > 1 ? (endFrame - initFrame) / (samples - 1) : 1;
var i = 0, j = 0;
var value;
if (this.pv.length) {
value = createTypedArray('float32', this.pv.length);
} else {
value = 0;
}
var sampleValue;
while (i < samples) {
sampleValue = this.getValueAtTime(initFrame + i * sampleFrequency);
if(this.pv.length) {
for (j = 0; j < this.pv.length; j += 1) {
value[j] += sampleValue[j];
}
} else {
value += sampleValue;
}
i += 1;
}
if(this.pv.length) {
for (j = 0; j < this.pv.length; j += 1) {
value[j] /= samples;
}
} else {
value /= samples;
}
return value;
}
function getValueAtTime(frameNum) {
frameNum *= this.elem.globalData.frameRate;
frameNum -= this.offsetTime;
if(frameNum !== this._cachingAtTime.lastFrame) {
this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
this._cachingAtTime.lastFrame = frameNum;
}
return this._cachingAtTime.value;
}
function getSpeedAtTime(frameNum) {
var delta = -0.01;
var v1 = this.getValueAtTime(frameNum);
var v2 = this.getValueAtTime(frameNum + delta);
var speed = 0;
if(v1.length){
var i;
for(i=0;i<v1.length;i+=1){
speed += Math.pow(v2[i] - v1[i], 2);
}
speed = Math.sqrt(speed) * 100;
} else {
speed = 0;
}
return speed;
}
function getVelocityAtTime(frameNum) {
if(this.vel !== undefined){
return this.vel;
}
var delta = -0.001;
//frameNum += this.elem.data.st;
var v1 = this.getValueAtTime(frameNum);
var v2 = this.getValueAtTime(frameNum + delta);
var velocity;
if(v1.length){
velocity = createTypedArray('float32', v1.length);
var i;
for(i=0;i<v1.length;i+=1){
//removing frameRate
//if needed, don't add it here
//velocity[i] = this.elem.globalData.frameRate*((v2[i] - v1[i])/delta);
velocity[i] = (v2[i] - v1[i])/delta;
}
} else {
velocity = (v2 - v1)/delta;
}
return velocity;
}
function setGroupProperty(propertyGroup){
this.propertyGroup = propertyGroup;
}
function searchExpressions(elem,data,prop){
if(data.x){
prop.k = true;
prop.x = true;
prop.initiateExpression = ExpressionManager.initiateExpression;
prop.effectsSequence.push(prop.initiateExpression(elem,data,prop).bind(prop));
}
}
>>>>>>>
function smooth(width, samples) {
if (!this.k){
return this.pv;
}
width = (width || 0.4) * 0.5;
samples = Math.floor(samples || 5);
if (samples <= 1) {
return this.pv;
}
var currentTime = this.comp.renderedFrame / this.comp.globalData.frameRate;
var initFrame = currentTime - width;
var endFrame = currentTime + width;
var sampleFrequency = samples > 1 ? (endFrame - initFrame) / (samples - 1) : 1;
var i = 0, j = 0;
var value;
if (this.pv.length) {
value = createTypedArray('float32', this.pv.length);
} else {
value = 0;
}
var sampleValue;
while (i < samples) {
sampleValue = this.getValueAtTime(initFrame + i * sampleFrequency);
if(this.pv.length) {
for (j = 0; j < this.pv.length; j += 1) {
value[j] += sampleValue[j];
}
} else {
value += sampleValue;
}
i += 1;
}
if(this.pv.length) {
for (j = 0; j < this.pv.length; j += 1) {
value[j] /= samples;
}
} else {
value /= samples;
}
return value;
}
function getValueAtTime(frameNum) {
frameNum *= this.elem.globalData.frameRate;
frameNum -= this.offsetTime;
if(frameNum !== this._cachingAtTime.lastFrame) {
this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
this._cachingAtTime.lastFrame = frameNum;
}
return this._cachingAtTime.value;
}
<<<<<<<
prop.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(prop);
prop.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(prop);
=======
prop.smooth = smooth;
prop.getVelocityAtTime = getVelocityAtTime.bind(prop);
prop.getSpeedAtTime = getSpeedAtTime.bind(prop);
>>>>>>>
prop.smooth = smooth;
prop.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(prop);
prop.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(prop); |
<<<<<<<
+className?: string
=======
+className?: string,
+value?: string,
>>>>>>>
+className?: string, |
<<<<<<<
const feedback = error || props.feedback;
=======
const allInputProps = {
name,
className: classes,
type,
placeholder,
value,
disabled,
readOnly,
onChange,
onBlur,
};
>>>>>>>
const feedback = error || props.feedback;
const allInputProps = {
name,
className: classes,
type,
placeholder,
value,
disabled,
readOnly,
onChange,
onBlur,
};
<<<<<<<
<React.Fragment>
<div className="input-icon">
{position === "prepend" && (
<span className="input-icon-addon">
<Icon name={icon} />
</span>
)}
<input
name={name}
className={classes}
type={type}
placeholder={placeholder}
value={value}
disabled={disabled}
readOnly={readOnly}
onChange={onChange}
/>
{position === "append" && (
<span className="input-icon-addon">
<Icon name={icon} />
</span>
)}
</div>
{feedback && <span className="invalid-feedback">{feedback}</span>}
</React.Fragment>
=======
<div className="input-icon">
{position === "prepend" && (
<span className="input-icon-addon">
<Icon name={icon} />
</span>
)}
<input {...allInputProps} />
{position === "append" && (
<span className="input-icon-addon">
<Icon name={icon} />
</span>
)}
</div>
>>>>>>>
<React.Fragment>
<div className="input-icon">
{position === "prepend" && (
<span className="input-icon-addon">
<Icon name={icon} />
</span>
)}
<input {...allInputProps} />
{position === "append" && (
<span className="input-icon-addon">
<Icon name={icon} />
</span>
)}
</div>
{feedback && <span className="invalid-feedback">{feedback}</span>}
</React.Fragment> |
<<<<<<<
* Media
****************************************************************************/
var numMedia = 0;
var Media = function ( options ) {
options = options || {};
var tracksByName = {},
tracks = [],
id = numMedia++;
name = options.name || "Media" + id + Date.now();
that = this;
this.getName = function () {
return name;
};
this.getId = function () {
return id;
};
this.getTracks = function () {
return tracks;
};
this.addTrack = function ( track ) {
if ( !(track instanceof Track) ) {
track = new Track( track );
} //if
tracksByName[ track.getName() ] = track;
tracks.push( track );
return track;
}; //addTrack
this.getTrack = function ( name ) {
var track = tracksByName[ name ];
if ( track ) {
return track;
} //if
for ( var i=0, l=tracks.length; i<l; ++i ) {
console.log(tracks[i].getName(), name );
if ( tracks[i].getName() === name ) {
return tracks[i];
} //if
} //for
return undefined;
}; //getTrack
this.removeTrack = function ( track ) {
if ( typeof(track) === "string" ) {
track = that.getTrack( track );
} //if
var idx = tracks.indexOf( track );
if ( idx > -1 ) {
tracks.splice( idx, 1 );
delete tracksByName[ track.getName() ];
return track;
} //if
return undefined;
}; //removeTrack
}; //Media
/****************************************************************************
=======
* Media
****************************************************************************/
var numMedia = 0;
var Media = function ( options ) {
options = options || {};
var tracksByName = {},
tracks = [],
id = numMedia++,
name = options.name || "Media" + id + Date.now(),
media = options.media,
that = this;
this.setMedia = function ( mediaElement ) {
media = mediaElement;
};
this.getMedia = function () {
return media;
};
this.getName = function () {
return name;
};
this.getId = function () {
return id;
};
this.getTracks = function () {
return tracks;
};
this.addTrack = function ( track ) {
if ( !(track instanceof Track) ) {
track = new Track( track );
} //if
tracksByName[ track.getName() ] = track;
tracks.push( track );
return track;
}; //addTrack
this.getTrack = function ( name ) {
var track = tracksByName[ name ];
if ( track ) {
return track;
} //if
for ( var i=0, l=tracks.length; i<l; ++i ) {
if ( tracks[i].getName() === name ) {
return tracks[i];
} //if
} //for
return undefined;
}; //getTrack
this.removeTrack = function ( track ) {
if ( typeof(track) === "string" ) {
track = that.getTrack( track );
} //if
var idx = tracks.indexOf( track );
if ( idx > -1 ) {
tracks.splice( idx, 1 );
delete tracksByName[ track.getName() ];
return track;
} //if
return undefined;
}; //removeTrack
}; //Media
/****************************************************************************
>>>>>>>
* Media
****************************************************************************/
var numMedia = 0;
var Media = function ( options ) {
options = options || {};
var tracksByName = {},
tracks = [],
id = numMedia++,
name = options.name || "Media" + id + Date.now(),
media = options.media,
that = this;
this.setMedia = function ( mediaElement ) {
media = mediaElement;
};
this.getMedia = function () {
return media;
};
this.getName = function () {
return name;
};
this.getId = function () {
return id;
};
this.getTracks = function () {
return tracks;
};
this.addTrack = function ( track ) {
if ( !(track instanceof Track) ) {
track = new Track( track );
} //if
tracksByName[ track.getName() ] = track;
tracks.push( track );
return track;
}; //addTrack
this.getTrack = function ( name ) {
var track = tracksByName[ name ];
if ( track ) {
return track;
} //if
for ( var i=0, l=tracks.length; i<l; ++i ) {
if ( tracks[i].getName() === name ) {
return tracks[i];
} //if
} //for
return undefined;
}; //getTrack
this.removeTrack = function ( track ) {
if ( typeof(track) === "string" ) {
track = that.getTrack( track );
} //if
var idx = tracks.indexOf( track );
if ( idx > -1 ) {
tracks.splice( idx, 1 );
delete tracksByName[ track.getName() ];
return track;
} //if
return undefined;
}; //removeTrack
}; //Media
/****************************************************************************
<<<<<<<
checkMedia();
=======
>>>>>>>
checkMedia();
<<<<<<<
//addMedia - add a media object
this.addMedia = function ( media ) {
medias.push( media );
mediaByName[ media.getName() ] = media;
if ( !currentMedia ) {
that.setMedia( media );
} //if
that.trigger( "mediaadded", media );
return media;
};
//removeMedia - forget a media object
this.removeMedia = function ( media ) {
if ( typeof( media ) === "string" ) {
media = that.getMedia( media );
} //if
var idx = medias.indexOf( media );
if ( idx > -1 ) {
medias.splice( idx, 1 );
delete mediaByName[ media.getName() ];
return media;
} //if
that.trigger( "mediaremoved", media );
return undefined;
};
=======
//addMedia - add a media object
this.addMedia = function ( media ) {
if ( !( media instanceof Media ) ) {
media = new Media( media );
} //if
var mediaName = media.getName();
medias.push( media );
mediaByName[ mediaName ] = media;
if ( !currentMedia ) {
that.setMedia( media );
} //if
that.trigger( "mediaadded", media );
return media;
};
//removeMedia - forget a media object
this.removeMedia = function ( media ) {
if ( typeof( media ) === "string" ) {
media = that.getMedia( media );
} //if
var idx = medias.indexOf( media );
if ( idx > -1 ) {
medias.splice( idx, 1 );
delete mediaByName[ media.getName() ];
that.trigger( "mediaremoved", media );
if ( media === currentMedia ) {
currentMedia = undefined;
} //if
return media;
} //if
return undefined;
};
>>>>>>>
//addMedia - add a media object
this.addMedia = function ( media ) {
if ( !( media instanceof Media ) ) {
media = new Media( media );
} //if
var mediaName = media.getName();
medias.push( media );
mediaByName[ mediaName ] = media;
if ( !currentMedia ) {
that.setMedia( media );
} //if
that.trigger( "mediaadded", media );
return media;
};
//removeMedia - forget a media object
this.removeMedia = function ( media ) {
if ( typeof( media ) === "string" ) {
media = that.getMedia( media );
} //if
var idx = medias.indexOf( media );
if ( idx > -1 ) {
medias.splice( idx, 1 );
delete mediaByName[ media.getName() ];
that.trigger( "mediaremoved", media );
if ( media === currentMedia ) {
currentMedia = undefined;
} //if
return media;
} //if
return undefined;
};
<<<<<<<
Butter.extend = function ( obj /* , extra arguments ... */) {
var dest = obj, src = [].slice.call( arguments, 1 );
src.forEach( function( copy ) {
for ( var prop in copy ) {
dest[ prop ] = copy[ prop ];
}
});
};
Butter.Media = Media;
=======
Butter.Media = Media;
>>>>>>>
Butter.extend = function ( obj /* , extra arguments ... */) {
var dest = obj, src = [].slice.call( arguments, 1 );
src.forEach( function( copy ) {
for ( var prop in copy ) {
dest[ prop ] = copy[ prop ];
}
});
};
Butter.Media = Media; |
<<<<<<<
var addTrackEvent = function( trackEvent ) {
var trackLinerTrackEvent = currentMediaInstance.lastTrack.createTrackEvent( "butterapp", trackEvent );
=======
this.listen( "trackeventadded", function( event ) {
var trackEvent = event.data;
var trackLinerTrackEvent = currentMediaInstance.trackLinerTracks[ trackEvent.track.getId() ].createTrackEvent( "butterapp", trackEvent );
>>>>>>>
var addTrackEvent = function( trackEvent ) {
var trackLinerTrackEvent = currentMediaInstance.trackLinerTracks[ trackEvent.track.getId() ].createTrackEvent( "butterapp", trackEvent ); |
<<<<<<<
define( [ "utils" ], function( utils ) {
=======
var fallbackMedia = "http://videos-cdn.mozilla.net/serv/webmademovies/Moz_Doc_0329_GetInvolved_ST.webm";
function Template ( root, layoutsDir ) {
var manifest = PopcornMaker.getJSON( layoutsDir + "/" + root + "/manifest.json" ),
name = manifest.title || root,
defaultMedia = manifest.defaultMedia || fallbackMedia,
thumbnail = new Image();
if ( manifest.thumbnail ) {
thumbnail.src = layoutsDir + "/" + root + "/" + manifest.thumbnail;
}
var template = manifest.template || "index.html";
Object.defineProperty( this, "title", { get: function() { return name; } });
Object.defineProperty( this, "thumbnail", { get: function() { return thumbnail; } });
Object.defineProperty( this, "template", { get: function() { return layoutsDir + "/" + root + "/" + template; } });
Object.defineProperty( this, "root", { get: function() { return root } } );
Object.defineProperty( this, "defaultMedia", { get: function() { return defaultMedia } } );
} //Template
function TemplateManager ( options ) {
var templates = [],
templateList = PopcornMaker.getJSON( options.config ),
mediaInputBox = document.getElementById( 'timeline-media-input-box' );
for ( var i=0; i<templateList.length; ++i ) {
templates.push( new Template( templateList[ i ], options.layoutsDir ) );
} //for
Object.defineProperty( this, "templates", { get: function() { return templates; } } );
this.find = function( options ) {
for ( var i=0; i<templates.length; ++i ) {
if ( templates[ i ].title === options ||
templates[ i ].title === options.title ||
templates[ i ].template === options.template ||
templates[ i ].root === options.root ) {
return templates[ i ];
} //if
} //for
return;
}; //find
var select = document.getElementById( options.container ),
thumbnailContainer = $( "#template-thumbnail" );
function showThumbnail( img ) {
thumbnailContainer.html("");
thumbnailContainer.append( $( img ) );
} //showThumbnail
showThumbnail( templates[ 0 ].thumbnail );
this.buildList = function() {
function createOption( value, innerHTML ) {
var option = document.createElement( 'option' );
option.value = value;
option.appendChild( document.createTextNode( PopcornMaker.getSafeString( innerHTML ) ) );
option.class = "ddprojects-option";
return option;
}
>>>>>>>
define( [ "utils" ], function( utils ) {
var fallbackMedia = "http://videos-cdn.mozilla.net/serv/webmademovies/Moz_Doc_0329_GetInvolved_ST.webm";
<<<<<<<
for ( var i=0; i<templates.length; ++i ) {
select.appendChild( createOption( templates[ i ].template, templates[ i ].title ) );
}
select.appendChild( createOption( "-1", "Other..." ) );
$( "#template-other" ).hide();
var otherOption = select.options[ select.options.length - 1 ],
otherText = $( "#template-other" )[ 0 ];
select.addEventListener( 'change', function( e ) {
if ( select.selectedIndex === otherOption.index ) {
$( "#template-other" ).show();
=======
else {
for ( var i=0; i<templates.length; ++i ) {
if ( templates[ i ].template === select.options[ select.selectedIndex ].value ) {
showThumbnail( templates[ i ].thumbnail );
mediaInputBox.value = templates[ i ].defaultMedia;
break;
}
>>>>>>>
for ( var i=0; i<templates.length; ++i ) {
select.appendChild( createOption( templates[ i ].template, templates[ i ].title ) );
}
select.appendChild( createOption( "-1", "Other..." ) );
$( "#template-other" ).hide();
var otherOption = select.options[ select.options.length - 1 ],
otherText = $( "#template-other" )[ 0 ];
select.addEventListener( 'change', function( e ) {
if ( select.selectedIndex === otherOption.index ) {
$( "#template-other" ).show(); |
<<<<<<<
media,
=======
butter = undefined,
media = options.media,
>>>>>>>
media,
butter = undefined, |
<<<<<<<
trackEvent.setButter( butter );
butter.trigger( "trackeventadded", trackEvent );
=======
return trackEvent;
>>>>>>>
trackEvent.setButter( butter );
butter.trigger( "trackeventadded", trackEvent );
return trackEvent;
<<<<<<<
id = numMedia++;
name = options.name || "Media" + id + Date.now();
butter = undefined,
=======
id = numMedia++,
name = options.name || "Media" + id + Date.now(),
media = options.media,
>>>>>>>
id = numMedia++;
name = options.name || "Media" + id + Date.now();
butter = undefined,
media = options.media, |
<<<<<<<
popupManager = new PopupManager(),
buttonManager = new ButtonManager();
butter.comm();
butter.eventeditor({ target: "editor-popup", defaultEditor: "lib/popcornMakerEditor.html" });
butter.plugintray({ target: "plugin-tray", pattern: '<li class="$type_tool"><a href="#" title="$type"><span></span>$type</a></li>' });
butter.timeline({ target: "timeline-div" });
butter.trackeditor({ target: "edit-target-popup" });
butter.addCustomEditor( "external/layouts/city-slickers/editor.html", "slickers" );
butter.addCustomEditor( "external/layouts/cgg/editor.html", "fkb" );
butter.addCustomEditor( "external/layouts/blackpanthers/editor.html", "googlestreets" );
butter.addCustomEditor( "layouts/key/editors/editor-key.html", "key" );
butter.addCustomEditor( "layouts/shared/editors/editor-words.html", "words" );
butter.addCustomEditor( "layouts/knell/editors/editor-tweet-chapter.html", "tweetChapter" );
butter.addCustomEditor( "layouts/shared/editors/editor-lightbox.html", "lightbox" );
butter.addCustomEditor( "layouts/shared/editors/editor-pop.html", "pop" );
butter.setProjectDetails("title", "Untitled Project" );
butter.previewer({
=======
_popupManager = new PopupManager(),
_buttonManager = new ButtonManager();
_butter.comm();
_butter.eventeditor({ target: "editor-popup", defaultEditor: "lib/popcornMakerEditor.html" });
_butter.plugintray({ target: "plugin-tray", pattern: '<li class="$type_tool"><a href="#" title="$type"><span></span>$type</a></li>' });
_butter.timeline({ target: "timeline-div" });
_butter.trackeditor({ target: "edit-target-popup" });
_butter.addCustomEditor( "external/layouts/city-slickers/editor.html", "slickers" );
_butter.addCustomEditor( "external/layouts/cgg/editor.html", "fkb" );
_butter.addCustomEditor( "external/layouts/blackpanthers/editor.html", "googlestreets" );
_butter.setProjectDetails("title", "Untitled Project" );
_butter.previewer({
>>>>>>>
_popupManager = new PopupManager(),
_buttonManager = new ButtonManager();
_butter.comm();
_butter.eventeditor({ target: "editor-popup", defaultEditor: "lib/popcornMakerEditor.html" });
_butter.plugintray({ target: "plugin-tray", pattern: '<li class="$type_tool"><a href="#" title="$type"><span></span>$type</a></li>' });
_butter.timeline({ target: "timeline-div" });
_butter.trackeditor({ target: "edit-target-popup" });
_butter.addCustomEditor( "external/layouts/city-slickers/editor.html", "slickers" );
_butter.addCustomEditor( "external/layouts/cgg/editor.html", "fkb" );
_butter.addCustomEditor( "external/layouts/blackpanthers/editor.html", "googlestreets" );
_butter.addCustomEditor( "layouts/key/editors/editor-key.html", "key" );
_butter.addCustomEditor( "layouts/shared/editors/editor-words.html", "words" );
_butter.addCustomEditor( "layouts/knell/editors/editor-tweet-chapter.html", "tweetChapter" );
_butter.addCustomEditor( "layouts/shared/editors/editor-lightbox.html", "lightbox" );
_butter.addCustomEditor( "layouts/shared/editors/editor-pop.html", "pop" );
_butter.setProjectDetails("title", "Untitled Project" );
_butter.previewer({ |
<<<<<<<
that.trigger( "videoReady", that.getCurrentMedia() );
framePopcorn.media.addEventListener( "timeupdate", function(){
that.currentTime( framePopcorn.media.currentTime );
that.trigger( "timeupdate", that.getCurrentMedia() );
},false);
=======
that.trigger( "mediaready", that.getCurrentMedia() );
>>>>>>>
that.trigger( "mediaready", that.getCurrentMedia() );
framePopcorn.media.addEventListener( "timeupdate", function(){
that.currentTime( framePopcorn.media.currentTime );
that.trigger( "timeupdate", that.getCurrentMedia() );
},false); |
<<<<<<<
var editor = new butter.trackeditor.Editor( track );
trackJSONtextArea.value = JSON.stringify( editor.json );
=======
var editor = new butter.trackeditor.Editor( track );
trackJSONtextArea.value = JSON.stringify(editor.json);
>>>>>>>
var editor = new butter.trackeditor.Editor( track );
trackJSONtextArea.value = JSON.stringify( editor.json );
<<<<<<<
$trackTitletb.val( $textNode.text() );
=======
popupManager.showPopup( "edit-target" );
>>>>>>>
$trackTitletb.val( $textNode.text() );
popupManager.showPopup( "edit-target" );
<<<<<<<
=======
document.getElementById( "cancel-track-edit" ).removeEventListener( "click", clickCancel, false );
>>>>>>> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.